-
Notifications
You must be signed in to change notification settings - Fork 0
Tier 1 API
Cadenza's Tier 1 names are exposed via global using static in each SDK, so they're callable without imports or type prefixes. The promise: ≤ 10 bare names per SDK, kept small, stable, and a single screen wide in the README.
This page lists the names. For deeper signatures, see the spec (§4 onward).
| Name | Purpose |
|---|---|
WriteLine, Write
|
Console output |
ReadText(path) |
Read a UTF-8 text file |
WriteText(path, content) |
Write a UTF-8 text file |
Glob(pattern) |
Enumerate paths matching a glob (**/*.cs, etc.) |
Log.Info / .Warn / .Error / .Debug |
Structured logging via ILogger
|
Env |
Process environment (incl. Env.ScriptPath) |
Run() |
Start the host appropriate to the SDK |
TODO: trim to the actual exported surface as of 1.0.15.
Bare names focus on filesystem, process, and standard I/O. No host — the script runs top-to-bottom and exits.
Adds the worker variant of Run:
await Run(async (CancellationToken ct) => { /* loop */ });ct cancels on graceful shutdown.
| Name | Purpose |
|---|---|
Get(path, handler) |
Register a GET route |
Post(path, handler) |
Register a POST route |
Put, Delete, Patch
|
The other HTTP verbs |
Map(path, handler) |
All methods |
HostUrls(...), HostName(...)
|
Configure the bind address |
Run() |
Start Kestrel |
| Name | Purpose |
|---|---|
Tool(name, description, handler) |
Register a callable tool |
Prompt(name, description, handler) |
TODO |
Resource(...) |
TODO |
Run() |
Start the MCP server on stdio |
| Name | Purpose |
|---|---|
SystemPrompt(text) |
Set the system prompt |
Tool(name, description, handler) |
Register a callable tool (same shape as Mcp) |
UseOllama(model) |
Choose an Ollama backend |
UseOpenAI(model) |
Choose OpenAI proper |
UseOpenRouter(model) |
Choose OpenRouter |
HostName(...), HostUrls(...)
|
Configure the bind address |
Run() |
Start the OpenAI-compatible HTTP server |
PascalCase, no prefixes — see the spec, §2.1. The SDK absorbs the prefix tax so your single-file script stays single-screen.
-
Directives —
#:sdk,#:include,#:package - Samples
Cadenza · MIT · .NET 10+ · github.com/rkttu/cadenza · No orchestra. No project. Just one file, playing solo.