@octavus/docs 2.21.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/content/01-getting-started/01-introduction.md +15 -15
  2. package/content/01-getting-started/02-quickstart.md +2 -2
  3. package/content/02-server-sdk/01-overview.md +11 -7
  4. package/content/02-server-sdk/02-sessions.md +8 -8
  5. package/content/02-server-sdk/03-tools.md +11 -11
  6. package/content/02-server-sdk/04-streaming.md +1 -1
  7. package/content/02-server-sdk/05-cli.md +15 -15
  8. package/content/02-server-sdk/06-workers.md +10 -10
  9. package/content/02-server-sdk/07-debugging.md +7 -7
  10. package/content/02-server-sdk/08-computer.md +26 -8
  11. package/content/03-client-sdk/01-overview.md +11 -11
  12. package/content/03-client-sdk/03-streaming.md +3 -3
  13. package/content/03-client-sdk/04-execution-blocks.md +1 -1
  14. package/content/03-client-sdk/05-socket-transport.md +5 -5
  15. package/content/03-client-sdk/06-http-transport.md +5 -5
  16. package/content/03-client-sdk/07-structured-output.md +3 -3
  17. package/content/03-client-sdk/08-file-uploads.md +2 -2
  18. package/content/03-client-sdk/09-error-handling.md +3 -3
  19. package/content/03-client-sdk/10-client-tools.md +3 -3
  20. package/content/04-protocol/01-overview.md +18 -18
  21. package/content/04-protocol/02-input-resources.md +1 -1
  22. package/content/04-protocol/03-triggers.md +1 -1
  23. package/content/04-protocol/04-tools.md +6 -6
  24. package/content/04-protocol/05-skills.md +5 -5
  25. package/content/04-protocol/06-handlers.md +3 -0
  26. package/content/04-protocol/07-agent-config.md +66 -11
  27. package/content/04-protocol/09-skills-advanced.md +18 -18
  28. package/content/04-protocol/10-types.md +22 -22
  29. package/content/04-protocol/11-workers.md +31 -30
  30. package/content/04-protocol/12-references.md +10 -10
  31. package/content/04-protocol/13-mcp-servers.md +63 -6
  32. package/content/05-api-reference/02-sessions.md +2 -2
  33. package/content/06-examples/02-nextjs-chat.md +3 -3
  34. package/content/06-examples/03-socket-chat.md +3 -3
  35. package/dist/chunk-PD34BHI2.js +1523 -0
  36. package/dist/chunk-PD34BHI2.js.map +1 -0
  37. package/dist/content.js +1 -1
  38. package/dist/docs.json +39 -48
  39. package/dist/index.js +1 -1
  40. package/dist/search-index.json +1 -1
  41. package/dist/search.js +1 -1
  42. package/dist/search.js.map +1 -1
  43. package/dist/sections.json +39 -56
  44. package/package.json +1 -1
  45. package/content/07-migration/01-v1-to-v2.md +0 -366
  46. package/content/07-migration/_meta.md +0 -4
  47. package/dist/chunk-4XCEGHY7.js +0 -1549
  48. package/dist/chunk-4XCEGHY7.js.map +0 -1
  49. package/dist/chunk-BVJLZYTT.js +0 -1549
  50. package/dist/chunk-BVJLZYTT.js.map +0 -1
  51. package/dist/chunk-O5XHIDDC.js +0 -1549
  52. package/dist/chunk-O5XHIDDC.js.map +0 -1
  53. package/dist/chunk-PKBPANXP.js +0 -1549
  54. package/dist/chunk-PKBPANXP.js.map +0 -1
  55. package/dist/chunk-Q2SRPPSB.js +0 -1549
  56. package/dist/chunk-Q2SRPPSB.js.map +0 -1
  57. package/dist/chunk-WYHGKCEV.js +0 -1549
  58. package/dist/chunk-WYHGKCEV.js.map +0 -1
@@ -137,7 +137,7 @@ if (canRetry) {
137
137
  }
138
138
  ```
139
139
 
140
- `retry()` also works after stopping (cancellation) or when the result is unsatisfactory not just errors.
140
+ `retry()` also works after stopping (cancellation) or when the result is unsatisfactory - not just errors.
141
141
 
142
142
  ## Building Error UI
143
143
 
@@ -281,7 +281,7 @@ interface ErrorEvent {
281
281
 
282
282
  ## Tool Errors
283
283
 
284
- Tool errors are handled differentlythey appear inline on the tool call:
284
+ Tool errors are handled differently - they appear inline on the tool call:
285
285
 
286
286
  ```tsx
287
287
  function ToolCallPart({ part }: { part: UIToolCallPart }) {
@@ -295,4 +295,4 @@ function ToolCallPart({ part }: { part: UIToolCallPart }) {
295
295
  }
296
296
  ```
297
297
 
298
- Tool errors don't trigger `onError`—they're captured on the tool call part itself.
298
+ Tool errors don't trigger `onError` - they're captured on the tool call part itself.
@@ -7,9 +7,9 @@ description: Handling tool calls on the client side for interactive UI and brows
7
7
 
8
8
  By default, tools execute on your server where you have access to databases and APIs. However, some tools are better suited for client-side execution:
9
9
 
10
- - **Browser-only operations** Geolocation, clipboard, local storage
11
- - **Interactive UIs** Confirmation dialogs, form inputs, selections
12
- - **Real-time feedback** Progress indicators, approval workflows
10
+ - **Browser-only operations** - Geolocation, clipboard, local storage
11
+ - **Interactive UIs** - Confirmation dialogs, form inputs, selections
12
+ - **Real-time feedback** - Progress indicators, approval workflows
13
13
 
14
14
  ## How Client Tools Work
15
15
 
@@ -11,11 +11,11 @@ Agent protocols define how an AI agent behaves. They're written in YAML and spec
11
11
 
12
12
  Protocols provide:
13
13
 
14
- - **Declarative definition** Define behavior, not implementation
15
- - **Portable agents** Move agents between projects
16
- - **Versioning** Track changes with git
17
- - **Validation** Catch errors before runtime
18
- - **Visualization** Debug execution flows
14
+ - **Declarative definition** - Define behavior, not implementation
15
+ - **Portable agents** - Move agents between projects
16
+ - **Versioning** - Track changes with git
17
+ - **Validation** - Catch errors before runtime
18
+ - **Visualization** - Debug execution flows
19
19
 
20
20
  ## Agent Formats
21
21
 
@@ -26,9 +26,9 @@ Octavus supports two agent formats:
26
26
  | `interactive` | Chat and multi-turn dialogue | `triggers` + `handlers` + `agent` |
27
27
  | `worker` | Background tasks and pipelines | `steps` + `output` |
28
28
 
29
- **Interactive agents** handle conversations they respond to triggers (like user messages) and maintain session state across interactions.
29
+ **Interactive agents** handle conversations - they respond to triggers (like user messages) and maintain session state across interactions.
30
30
 
31
- **Worker agents** execute tasks they run steps sequentially and return an output value. Workers can be called independently or composed into interactive agents.
31
+ **Worker agents** execute tasks - they run steps sequentially and return an output value. Workers can be called independently or composed into interactive agents.
32
32
 
33
33
  See [Workers](/docs/protocol/workers) for the worker protocol reference.
34
34
 
@@ -192,14 +192,14 @@ The referenced prompt content is inserted before variable interpolation, so vari
192
192
 
193
193
  ## Next Steps
194
194
 
195
- - [Input & Resources](/docs/protocol/input-resources) Defining agent inputs
196
- - [Triggers](/docs/protocol/triggers) How agents are invoked
197
- - [Tools](/docs/protocol/tools) External capabilities
198
- - [MCP Servers](/docs/protocol/mcp-servers) Remote services and device capabilities via MCP
199
- - [Skills](/docs/protocol/skills) Code execution and knowledge packages
200
- - [References](/docs/protocol/references) On-demand context documents
201
- - [Handlers](/docs/protocol/handlers) Execution blocks
202
- - [Agent Config](/docs/protocol/agent-config) Model and settings
203
- - [Workers](/docs/protocol/workers) Worker agent format
204
- - [Provider Options](/docs/protocol/provider-options) Provider-specific features
205
- - [Types](/docs/protocol/types) Custom type definitions
195
+ - [Input & Resources](/docs/protocol/input-resources) - Defining agent inputs
196
+ - [Triggers](/docs/protocol/triggers) - How agents are invoked
197
+ - [Tools](/docs/protocol/tools) - External capabilities
198
+ - [MCP Servers](/docs/protocol/mcp-servers) - Remote services and device capabilities via MCP
199
+ - [Skills](/docs/protocol/skills) - Code execution and knowledge packages
200
+ - [References](/docs/protocol/references) - On-demand context documents
201
+ - [Handlers](/docs/protocol/handlers) - Execution blocks
202
+ - [Agent Config](/docs/protocol/agent-config) - Model and settings
203
+ - [Workers](/docs/protocol/workers) - Worker agent format
204
+ - [Provider Options](/docs/protocol/provider-options) - Provider-specific features
205
+ - [Types](/docs/protocol/types) - Custom type definitions
@@ -77,7 +77,7 @@ In prompts, reference variables with `{{VARIABLE_NAME}}`:
77
77
  You are a support agent for {{COMPANY_NAME}}.
78
78
  ```
79
79
 
80
- To use a variable in a prompt, pass it through the `input` mapping on the [agent config](/docs/protocol/agent-config#system-prompt) or [block](/docs/protocol/handlers#block-input-mapping). Variables not listed in the `input` mapping won't be interpolated the `{{VARIABLE}}` placeholder will be preserved as-is.
80
+ To use a variable in a prompt, pass it through the `input` mapping on the [agent config](/docs/protocol/agent-config#system-prompt) or [block](/docs/protocol/handlers#block-input-mapping). Variables not listed in the `input` mapping won't be interpolated - the `{{VARIABLE}}` placeholder will be preserved as-is.
81
81
 
82
82
  > **Note:** Variables must be `UPPER_SNAKE_CASE`. Nested properties (dot notation like `{{VAR.property}}`) are not supported. Objects are serialized as JSON when interpolated.
83
83
 
@@ -11,7 +11,7 @@ Triggers define how an agent can be invoked. Each trigger has a name, optional i
11
11
 
12
12
  ### User Message
13
13
 
14
- The most common trigger when a user sends a chat message:
14
+ The most common trigger - when a user sends a chat message:
15
15
 
16
16
  ```yaml
17
17
  triggers:
@@ -7,13 +7,13 @@ description: Defining external tools implemented in your backend.
7
7
 
8
8
  Tools extend what agents can do. Octavus supports multiple types:
9
9
 
10
- 1. **External Tools** Defined in the protocol, implemented in your backend (this page)
11
- 2. **MCP Tools** Auto-discovered from MCP servers (see [MCP Servers](/docs/protocol/mcp-servers))
12
- 3. **Built-in Tools** Provider-agnostic tools managed by Octavus (web search, image generation)
13
- 4. **Provider Tools** Provider-specific tools executed by the provider (e.g., Anthropic's code execution)
14
- 5. **Skills** Code execution and knowledge packages (see [Skills](/docs/protocol/skills))
10
+ 1. **External Tools** - Defined in the protocol, implemented in your backend (this page)
11
+ 2. **MCP Tools** - Auto-discovered from MCP servers (see [MCP Servers](/docs/protocol/mcp-servers))
12
+ 3. **Built-in Tools** - Provider-agnostic tools managed by Octavus (web search, image generation)
13
+ 4. **Provider Tools** - Provider-specific tools executed by the provider (e.g., Anthropic's code execution)
14
+ 5. **Skills** - Code execution and knowledge packages (see [Skills](/docs/protocol/skills))
15
15
 
16
- This page covers external tools. For MCP-based tools from services like Figma, Sentry, or device capabilities like browser and filesystem, see [MCP Servers](/docs/protocol/mcp-servers). Built-in tools are enabled via agent config see [Web Search](/docs/protocol/agent-config#web-search) and [Image Generation](/docs/protocol/agent-config#image-generation). For provider-specific tools, see [Provider Options](/docs/protocol/provider-options). For code execution, see [Skills](/docs/protocol/skills).
16
+ This page covers external tools. For MCP-based tools from services like Figma, Sentry, or device capabilities like browser and filesystem, see [MCP Servers](/docs/protocol/mcp-servers). Built-in tools are enabled via agent config - see [Web Search](/docs/protocol/agent-config#web-search) and [Image Generation](/docs/protocol/agent-config#image-generation). For provider-specific tools, see [Provider Options](/docs/protocol/provider-options). For code execution, see [Skills](/docs/protocol/skills).
17
17
 
18
18
  ## External Tools
19
19
 
@@ -413,7 +413,7 @@ When a skill has secrets configured for the organization, it automatically runs
413
413
 
414
414
  - The skill gets its own **isolated sandbox** (separate from other skills)
415
415
  - Secrets are injected as **environment variables** available to all scripts
416
- - Only `octavus_skill_read`, `octavus_skill_list`, and `octavus_skill_run` are available `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked
416
+ - Only `octavus_skill_read`, `octavus_skill_list`, and `octavus_skill_run` are available - `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked
417
417
  - Scripts receive input as **JSON via stdin** (using the `input` parameter on `octavus_skill_run`) instead of CLI args
418
418
  - All output (stdout/stderr) is **automatically redacted** for secret values before being returned to the LLM
419
419
 
@@ -442,10 +442,10 @@ Skills run in isolated sandbox environments:
442
442
  - **No persistent storage** (sandbox destroyed after each `next-message` execution)
443
443
  - **File output only** via `/output/` directory
444
444
  - **Time limits** enforced (5-minute default, configurable via `sandboxTimeout`)
445
- - **Secret redaction** output from secure skills is automatically scanned for secret values
445
+ - **Secret redaction** - output from secure skills is automatically scanned for secret values
446
446
 
447
447
  ## Next Steps
448
448
 
449
- - [Agent Config](/docs/protocol/agent-config) Configuring skills in agent settings
450
- - [Provider Options](/docs/protocol/provider-options) Anthropic's built-in skills
451
- - [Skills Advanced Guide](/docs/protocol/skills-advanced) Best practices and advanced patterns
449
+ - [Agent Config](/docs/protocol/agent-config) - Configuring skills in agent settings
450
+ - [Provider Options](/docs/protocol/provider-options) - Anthropic's built-in skills
451
+ - [Skills Advanced Guide](/docs/protocol/skills-advanced) - Best practices and advanced patterns
@@ -146,6 +146,7 @@ Start summary thread:
146
146
  model: anthropic/claude-sonnet-4-5 # Optional: different model
147
147
  backupModel: openai/gpt-4o # Failover on provider errors
148
148
  thinking: low # Extended reasoning level
149
+ cache: auto # auto (default) | extended | off
149
150
  maxSteps: 1 # Tool call limit
150
151
  system: escalation-summary # System prompt
151
152
  input: [COMPANY_NAME] # Variables for prompt
@@ -155,6 +156,8 @@ Start summary thread:
155
156
  imageModel: google/gemini-2.5-flash-image # Image generation model
156
157
  ```
157
158
 
159
+ The `cache` field controls prompt caching for this thread and defaults to `auto` when omitted. Threads do not inherit the agent's `cache` value - see [Prompt Caching](/docs/protocol/agent-config#prompt-caching).
160
+
158
161
  The `model` field can also reference a variable for dynamic model selection. The `backupModel` field follows the same format and supports variable references.
159
162
 
160
163
  ```yaml
@@ -38,6 +38,7 @@ agent:
38
38
  | `maxSteps` | No | Maximum agentic steps (default: 10) |
39
39
  | `temperature` | No | Model temperature (0-2) |
40
40
  | `thinking` | No | Extended reasoning level |
41
+ | `cache` | No | Prompt caching mode: `auto` (default), `extended`, or `off` |
41
42
  | `anthropic` | No | Anthropic-specific options (tools, skills) |
42
43
 
43
44
  ## Models
@@ -99,9 +100,9 @@ const sessionId = await client.agentSessions.create('my-agent', {
99
100
 
100
101
  This enables:
101
102
 
102
- - **Multi-provider support** Same agent works with different providers
103
- - **A/B testing** Test different models without protocol changes
104
- - **User preferences** Let users choose their preferred model
103
+ - **Multi-provider support** - Same agent works with different providers
104
+ - **A/B testing** - Test different models without protocol changes
105
+ - **User preferences** - Let users choose their preferred model
105
106
 
106
107
  The model value is validated at runtime to ensure it's in the correct `provider/model-id` format.
107
108
 
@@ -122,7 +123,7 @@ When a provider error occurs, the system retries once with the backup model. If
122
123
 
123
124
  **Key behaviors:**
124
125
 
125
- - Only transient provider errors trigger fallback authentication and validation errors are not retried
126
+ - Only transient provider errors trigger fallback - authentication and validation errors are not retried
126
127
  - Provider-specific options (like `anthropic:`) are only forwarded to the backup model if it uses the same provider
127
128
  - For streaming responses, fallback only occurs if no content has been sent to the client yet
128
129
 
@@ -144,7 +145,7 @@ agent:
144
145
 
145
146
  ## System Prompt
146
147
 
147
- The system prompt sets the agent's persona and instructions. The `input` field controls which variables are available to the prompt only variables listed in `input` are interpolated.
148
+ The system prompt sets the agent's persona and instructions. The `input` field controls which variables are available to the prompt - only variables listed in `input` are interpolated.
148
149
 
149
150
  ```yaml
150
151
  agent:
@@ -232,6 +233,59 @@ agent:
232
233
 
233
234
  Thinking content streams to the UI and can be displayed to users.
234
235
 
236
+ ## Prompt Caching
237
+
238
+ Providers charge less for tokens served from their prompt cache (often 10% of the uncached rate). Octavus exposes a single `cache` field that picks the right retention policy per provider, so the stable prefix of your agent - tools, system prompt, and historical messages - gets billed at the cache-read rate on repeat requests.
239
+
240
+ ```yaml
241
+ agent:
242
+ model: anthropic/claude-sonnet-4-5
243
+ cache: auto # auto (default) | extended | off
244
+ ```
245
+
246
+ | Mode | Behavior | When to use |
247
+ | ---------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
248
+ | `auto` | Short-TTL caching. Default when omitted. | Most agents. Free on all supported providers and pays for itself within the same session. |
249
+ | `extended` | Long-TTL caching. Trades a higher cache-write cost for much longer residency. | Agents triggered with gaps (daily reports, on-call assistants) where the prefix is reused across hours. |
250
+ | `off` | No opt-in caching emitted. | When you explicitly want to skip caching - e.g. debugging a non-deterministic prefix. |
251
+
252
+ ### Per-provider behavior
253
+
254
+ The `cache` field is provider-agnostic at the protocol level - each provider translates it into its own cache retention policy:
255
+
256
+ | Provider | `auto` TTL | `extended` TTL |
257
+ | --------- | ------------------------- | -------------- |
258
+ | Anthropic | 5 minutes | 1 hour |
259
+ | OpenAI | in-memory (~5–10 minutes) | 24 hours |
260
+ | Google | Implicit (Gemini 2.5+) | Implicit |
261
+
262
+ On `off`, Octavus emits no explicit cache options. Providers that auto-cache (OpenAI on prefixes ≥ 1,024 tokens, Gemini 2.5+) may still cache transparently - `off` just disables Octavus's opt-in behavior.
263
+
264
+ ### Threads don't inherit
265
+
266
+ Named threads (created with `start-thread`) read their own `cache` field independently - they **do not** inherit the agent's cache value:
267
+
268
+ ```yaml
269
+ agent:
270
+ cache: extended # 1-hour TTL on the main thread
271
+
272
+ handlers:
273
+ summarize:
274
+ Start summary:
275
+ block: start-thread
276
+ thread: summary
277
+ # No cache field → defaults to 'auto' (5-minute TTL), NOT 'extended'
278
+ system: summary-system
279
+ ```
280
+
281
+ This is intentional: named threads are often used for short, one-shot work (summarization, classification) where the long TTL would be wasted. Set `cache` explicitly on `start-thread` when you do want it.
282
+
283
+ ### Cost trade-offs
284
+
285
+ - **Cache reads** are always much cheaper than uncached input on any provider - caching is effectively free if your prefix is stable.
286
+ - **Cache writes** on Anthropic cost ~1.25× input for `auto` and 2× input for `extended`. OpenAI and Google don't charge separately for cache writes.
287
+ - Use `extended` only when the same prefix is genuinely reused across sessions that span hours; otherwise the higher write cost dominates the savings.
288
+
235
289
  ## Skills
236
290
 
237
291
  Enable Octavus skills for code execution and file generation:
@@ -297,9 +351,9 @@ When `imageModel` is configured, the `octavus_generate_image` tool becomes avail
297
351
 
298
352
  The tool supports three image sizes:
299
353
 
300
- - `1024x1024` (default) Square
301
- - `1792x1024` Landscape (16:9)
302
- - `1024x1792` Portrait (9:16)
354
+ - `1024x1024` (default) - Square
355
+ - `1792x1024` - Landscape (16:9)
356
+ - `1024x1792` - Portrait (9:16)
303
357
 
304
358
  ### Image Editing with Reference Images
305
359
 
@@ -338,7 +392,7 @@ agent:
338
392
 
339
393
  When `webSearch` is enabled, the `octavus_web_search` tool becomes available. The LLM can decide when to search the web based on the conversation. Search results include source URLs that are emitted as citations in the UI.
340
394
 
341
- This is a **provider-agnostic** built-in tool it works with any LLM provider (Anthropic, Google, OpenAI, etc.). For Anthropic's own web search implementation, see [Provider Options](/docs/protocol/provider-options).
395
+ This is a **provider-agnostic** built-in tool - it works with any LLM provider (Anthropic, Google, OpenAI, etc.). For Anthropic's own web search implementation, see [Provider Options](/docs/protocol/provider-options).
342
396
 
343
397
  Use cases:
344
398
 
@@ -381,7 +435,7 @@ agent:
381
435
  description: Processing PDF
382
436
  ```
383
437
 
384
- Provider options are validated against the modelusing `anthropic:` with a non-Anthropic model will fail validation.
438
+ Provider options are validated against the model - using `anthropic:` with a non-Anthropic model will fail validation.
385
439
 
386
440
  See [Provider Options](/docs/protocol/provider-options) for full documentation.
387
441
 
@@ -398,6 +452,7 @@ handlers:
398
452
  model: anthropic/claude-sonnet-4-5 # Different model
399
453
  backupModel: openai/gpt-4o # Failover model
400
454
  thinking: low # Different thinking
455
+ cache: off # Different cache mode (does not inherit from agent)
401
456
  maxSteps: 1 # Limit tool calls
402
457
  system: escalation-summary # Different prompt
403
458
  mcpServers: [figma, browser] # Thread-specific MCP servers
@@ -407,7 +462,7 @@ handlers:
407
462
  webSearch: true # Thread-specific web search
408
463
  ```
409
464
 
410
- Each thread can have its own model, backup model, MCP servers, skills, references, image model, and web search setting. Skills must be defined in the protocol's `skills:` section. References must exist in the agent's `references/` directory. Workers use this same pattern since they don't have a global `agent:` section.
465
+ Each thread can have its own model, backup model, cache mode, MCP servers, skills, references, image model, and web search setting. Skills must be defined in the protocol's `skills:` section. References must exist in the agent's `references/` directory. Workers use this same pattern since they don't have a global `agent:` section.
411
466
 
412
467
  ## Full Example
413
468
 
@@ -28,7 +28,7 @@ Use external tools instead when:
28
28
 
29
29
  Define all skills in the `skills:` section, then reference which skills are available where they're used:
30
30
 
31
- **Interactive agents** reference in `agent.skills`:
31
+ **Interactive agents** - reference in `agent.skills`:
32
32
 
33
33
  ```yaml
34
34
  skills:
@@ -45,7 +45,7 @@ agent:
45
45
  skills: [qr-code]
46
46
  ```
47
47
 
48
- **Workers and named threads** reference per-thread in `start-thread.skills`:
48
+ **Workers and named threads** - reference per-thread in `start-thread.skills`:
49
49
 
50
50
  ```yaml
51
51
  skills:
@@ -348,8 +348,8 @@ print(result.stdout)
348
348
  Key patterns:
349
349
 
350
350
  - **Read stdin**: `json.load(sys.stdin)` to get the `input` object from the `octavus_skill_run` call
351
- - **Access secrets**: `os.environ["SECRET_NAME"]` secrets are injected as env vars
352
- - **Print output**: Write results to stdout the LLM sees the (redacted) stdout
351
+ - **Access secrets**: `os.environ["SECRET_NAME"]` - secrets are injected as env vars
352
+ - **Print output**: Write results to stdout - the LLM sees the (redacted) stdout
353
353
  - **Error handling**: Write errors to stderr and exit with non-zero code
354
354
 
355
355
  ### Declaring Secrets in SKILL.md
@@ -447,10 +447,10 @@ The LLM sees these errors and can retry or explain to users.
447
447
 
448
448
  For skills with configured secrets:
449
449
 
450
- - **Isolated sandbox** each secure skill gets its own sandbox, preventing cross-skill secret leakage
451
- - **No arbitrary code** `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked for secure skills, so only pre-built scripts can execute
452
- - **Output redaction** all stdout and stderr are scanned for secret values before being returned to the LLM
453
- - **Encrypted at rest** secrets are encrypted using AES-256-GCM and only decrypted at execution time
450
+ - **Isolated sandbox** - each secure skill gets its own sandbox, preventing cross-skill secret leakage
451
+ - **No arbitrary code** - `octavus_code_run`, `octavus_file_write`, and `octavus_file_read` are blocked for secure skills, so only pre-built scripts can execute
452
+ - **Output redaction** - all stdout and stderr are scanned for secret values before being returned to the LLM
453
+ - **Encrypted at rest** - secrets are encrypted using AES-256-GCM and only decrypted at execution time
454
454
 
455
455
  ### Input Validation
456
456
 
@@ -534,16 +534,16 @@ Check execution logs in the platform debug view:
534
534
 
535
535
  ## Best Practices Summary
536
536
 
537
- 1. **Enable only needed skills** Don't overwhelm the LLM
538
- 2. **Choose appropriate display modes** Match user experience needs
539
- 3. **Write clear skill descriptions** Help LLM understand when to use
540
- 4. **Handle errors gracefully** Provide helpful error messages
541
- 5. **Test skills locally** Verify before uploading
542
- 6. **Monitor execution** Check logs for issues
543
- 7. **Combine with tools** Use tools for data, skills for processing
544
- 8. **Consider performance** Be aware of timeouts and limits
545
- 9. **Use secrets for credentials** Declare secrets in frontmatter instead of hardcoding tokens
546
- 10. **Design scripts for stdin input** Secure skills receive JSON via stdin, so plan for both input methods if the skill might be used in either mode
537
+ 1. **Enable only needed skills** - Don't overwhelm the LLM
538
+ 2. **Choose appropriate display modes** - Match user experience needs
539
+ 3. **Write clear skill descriptions** - Help LLM understand when to use
540
+ 4. **Handle errors gracefully** - Provide helpful error messages
541
+ 5. **Test skills locally** - Verify before uploading
542
+ 6. **Monitor execution** - Check logs for issues
543
+ 7. **Combine with tools** - Use tools for data, skills for processing
544
+ 8. **Consider performance** - Be aware of timeouts and limits
545
+ 9. **Use secrets for credentials** - Declare secrets in frontmatter instead of hardcoding tokens
546
+ 10. **Design scripts for stdin input** - Secure skills receive JSON via stdin, so plan for both input methods if the skill might be used in either mode
547
547
 
548
548
  ## Next Steps
549
549
 
@@ -9,11 +9,11 @@ Types let you define reusable data structures for your agent. Use them in inputs
9
9
 
10
10
  ## Why Types?
11
11
 
12
- - **Reusability** Define once, use in multiple places
13
- - **Validation** Catch errors at protocol validation time
14
- - **Documentation** Clear data contracts for your agent
15
- - **Tool Parameters** Use complex types in tool parameters
16
- - **Structured Output** Get typed JSON responses from the LLM
12
+ - **Reusability** - Define once, use in multiple places
13
+ - **Validation** - Catch errors at protocol validation time
14
+ - **Documentation** - Clear data contracts for your agent
15
+ - **Tool Parameters** - Use complex types in tool parameters
16
+ - **Structured Output** - Get typed JSON responses from the LLM
17
17
 
18
18
  ## Defining Types
19
19
 
@@ -504,9 +504,9 @@ The tool receives: `{ cartItems: [{ productId: "...", quantity: 1 }, ...] }`
504
504
 
505
505
  Named array types provide:
506
506
 
507
- - **Reusability** Use the same array type in multiple tools
508
- - **Clear schema** The array structure is validated
509
- - **Clean tool calls** No unnecessary wrapper objects
507
+ - **Reusability** - Use the same array type in multiple tools
508
+ - **Clear schema** - The array structure is validated
509
+ - **Clean tool calls** - No unnecessary wrapper objects
510
510
 
511
511
  ## Structured Output
512
512
 
@@ -602,9 +602,9 @@ The `responseType` must be an **object type** (regular custom type with properti
602
602
 
603
603
  The following cannot be used directly as `responseType`:
604
604
 
605
- - **Discriminated unions** LLM providers don't allow `anyOf` at the schema root ([OpenAI docs](https://platform.openai.com/docs/guides/structured-outputs#root-objects-must-not-be-anyof-and-must-be-an-object))
606
- - **Array types** Must be wrapped in an object
607
- - **Primitives** `string`, `number`, etc. are not valid
605
+ - **Discriminated unions** - LLM providers don't allow `anyOf` at the schema root ([OpenAI docs](https://platform.openai.com/docs/guides/structured-outputs#root-objects-must-not-be-anyof-and-must-be-an-object))
606
+ - **Array types** - Must be wrapped in an object
607
+ - **Primitives** - `string`, `number`, etc. are not valid
608
608
 
609
609
  ```yaml
610
610
  types:
@@ -695,23 +695,23 @@ Types are validated when the protocol is loaded:
695
695
 
696
696
  ### Type Definition Limits
697
697
 
698
- - **No standalone `array` or `object`** Define a custom type instead, or use `unknown` for untyped data
699
- - **No recursive types** A type cannot reference itself (directly or indirectly)
700
- - **No generic types** Types are concrete, not parameterized
701
- - **String enums only** `enum` values must be strings
702
- - **No array constraints** `minItems` and `maxItems` are not supported (LLM providers don't enforce them)
698
+ - **No standalone `array` or `object`** - Define a custom type instead, or use `unknown` for untyped data
699
+ - **No recursive types** - A type cannot reference itself (directly or indirectly)
700
+ - **No generic types** - Types are concrete, not parameterized
701
+ - **String enums only** - `enum` values must be strings
702
+ - **No array constraints** - `minItems` and `maxItems` are not supported (LLM providers don't enforce them)
703
703
 
704
704
  ### Tool Limitations
705
705
 
706
- - **Tool parameters are always objects** Each tool call is `{ param1: value1, param2: value2, ... }`
707
- - **Array parameters need named types** Use top-level array types for array parameters
706
+ - **Tool parameters are always objects** - Each tool call is `{ param1: value1, param2: value2, ... }`
707
+ - **Array parameters need named types** - Use top-level array types for array parameters
708
708
 
709
709
  ### Structured Output Limitations
710
710
 
711
- - **responseType must be an object type** Only object types can be used as responseType
712
- - **Discriminated unions need object wrapper** Unions (`anyOf`) are not allowed at the schema root
713
- - **Array types need object wrapper** Arrays cannot be used directly as responseType
714
- - **Primitives are not allowed** `string`, `number`, etc. cannot be used as responseType
711
+ - **responseType must be an object type** - Only object types can be used as responseType
712
+ - **Discriminated unions need object wrapper** - Unions (`anyOf`) are not allowed at the schema root
713
+ - **Array types need object wrapper** - Arrays cannot be used directly as responseType
714
+ - **Primitives are not allowed** - `string`, `number`, etc. cannot be used as responseType
715
715
 
716
716
  These limitations exist because LLM providers (OpenAI, Anthropic) require the root schema to be an object:
717
717
 
@@ -11,16 +11,16 @@ Workers are agents designed for task-based execution. Unlike interactive agents
11
11
 
12
12
  Workers are ideal for:
13
13
 
14
- - **Background processing** Long-running tasks that don't need conversation
15
- - **Composable tasks** Reusable units of work called by other agents
16
- - **Pipelines** Multi-step processing with structured output
17
- - **Parallel execution** Tasks that can run independently
14
+ - **Background processing** - Long-running tasks that don't need conversation
15
+ - **Composable tasks** - Reusable units of work called by other agents
16
+ - **Pipelines** - Multi-step processing with structured output
17
+ - **Parallel execution** - Tasks that can run independently
18
18
 
19
19
  Use interactive agents instead when:
20
20
 
21
- - **Conversation is needed** Multi-turn dialogue with users
22
- - **Persistence matters** State should survive across interactions
23
- - **Session context** User context needs to persist
21
+ - **Conversation is needed** - Multi-turn dialogue with users
22
+ - **Persistence matters** - State should survive across interactions
23
+ - **Session context** - User context needs to persist
24
24
 
25
25
  ## Worker vs Interactive
26
26
 
@@ -124,7 +124,7 @@ Workers are identified by the `format` field:
124
124
 
125
125
  ### No Global Agent Config
126
126
 
127
- Interactive agents have a global `agent:` section that configures a main thread. Workers don't have this every thread must be explicitly created via `start-thread`:
127
+ Interactive agents have a global `agent:` section that configures a main thread. Workers don't have this - every thread must be explicitly created via `start-thread`:
128
128
 
129
129
  ```yaml
130
130
  # Interactive agent: Global config
@@ -219,20 +219,21 @@ steps:
219
219
 
220
220
  All LLM configuration goes here:
221
221
 
222
- | Field | Description |
223
- | ------------- | ------------------------------------------------- |
224
- | `thread` | Thread name (defaults to block name) |
225
- | `model` | LLM model to use |
226
- | `system` | System prompt filename (required) |
227
- | `input` | Variables for system prompt |
228
- | `tools` | Tools available in this thread |
229
- | `skills` | Octavus skills available in this thread |
230
- | `mcpServers` | MCP servers available in this thread |
231
- | `imageModel` | Image generation model |
232
- | `webSearch` | Enable built-in web search tool |
233
- | `thinking` | Extended reasoning level |
234
- | `temperature` | Model temperature |
235
- | `maxSteps` | Maximum tool call cycles (enables agentic if > 1) |
222
+ | Field | Description |
223
+ | ------------- | ----------------------------------------------------------- |
224
+ | `thread` | Thread name (defaults to block name) |
225
+ | `model` | LLM model to use |
226
+ | `system` | System prompt filename (required) |
227
+ | `input` | Variables for system prompt |
228
+ | `tools` | Tools available in this thread |
229
+ | `skills` | Octavus skills available in this thread |
230
+ | `mcpServers` | MCP servers available in this thread |
231
+ | `imageModel` | Image generation model |
232
+ | `webSearch` | Enable built-in web search tool |
233
+ | `thinking` | Extended reasoning level |
234
+ | `cache` | Prompt caching mode: `auto` (default), `extended`, or `off` |
235
+ | `temperature` | Model temperature |
236
+ | `maxSteps` | Maximum tool call cycles (enables agentic if > 1) |
236
237
 
237
238
  ## Simple Example
238
239
 
@@ -389,7 +390,7 @@ steps:
389
390
  maxSteps: 10
390
391
  ```
391
392
 
392
- Workers resolve their own MCP connections independently they don't inherit MCP servers from a parent interactive agent. Remote MCP connections are project-scoped, so a worker in the same project automatically has access to the same OAuth connections.
393
+ Workers resolve their own MCP connections independently - they don't inherit MCP servers from a parent interactive agent. Remote MCP connections are project-scoped, so a worker in the same project automatically has access to the same OAuth connections.
393
394
 
394
395
  See [MCP Servers](/docs/protocol/mcp-servers) for full documentation.
395
396
 
@@ -423,8 +424,8 @@ See [Skills](/docs/protocol/skills) for full documentation.
423
424
 
424
425
  Workers support the same tool handling as interactive agents:
425
426
 
426
- - **Server tools** Handled by tool handlers you provide
427
- - **Client tools** Pause execution, return tool request to caller
427
+ - **Server tools** - Handled by tool handlers you provide
428
+ - **Client tools** - Pause execution, return tool request to caller
428
429
 
429
430
  ```typescript
430
431
  // Non-streaming: get the output directly
@@ -467,8 +468,8 @@ All standard events (text-delta, tool calls, etc.) are also emitted.
467
468
 
468
469
  Interactive agents can call workers in two ways:
469
470
 
470
- 1. **Deterministically** Using the `run-worker` block
471
- 2. **Agentically** LLM calls worker as a tool
471
+ 1. **Deterministically** - Using the `run-worker` block
472
+ 2. **Agentically** - LLM calls worker as a tool
472
473
 
473
474
  ### Worker Declaration
474
475
 
@@ -542,6 +543,6 @@ When the worker calls its `search` tool, your `web-search` handler executes.
542
543
 
543
544
  ## Next Steps
544
545
 
545
- - [Server SDK Workers](/docs/server-sdk/workers) Executing workers from code
546
- - [Handlers](/docs/protocol/handlers) Block reference for steps
547
- - [Agent Config](/docs/protocol/agent-config) Model and settings
546
+ - [Server SDK Workers](/docs/server-sdk/workers) - Executing workers from code
547
+ - [Handlers](/docs/protocol/handlers) - Block reference for steps
548
+ - [Agent Config](/docs/protocol/agent-config) - Model and settings
@@ -11,9 +11,9 @@ References are markdown documents that agents can fetch on demand. Instead of lo
11
11
 
12
12
  References are useful for:
13
13
 
14
- - **Large context** Documents too long to include in every system prompt
15
- - **Selective loading** Let the agent decide which context is relevant
16
- - **Shared knowledge** Reusable documents across threads
14
+ - **Large context** - Documents too long to include in every system prompt
15
+ - **Selective loading** - Let the agent decide which context is relevant
16
+ - **Shared knowledge** - Reusable documents across threads
17
17
 
18
18
  ### How References Work
19
19
 
@@ -165,10 +165,10 @@ When a user asks the agent to review code, the agent will:
165
165
 
166
166
  The CLI and platform validate references during sync and deployment:
167
167
 
168
- - **Undefined references** Referencing a name that doesn't have a matching file in `references/`
169
- - **Unused references** A reference file exists but isn't listed in any `agent.references` or `start-thread.references`
170
- - **Invalid names** Names that don't follow the `lowercase-with-dashes` convention
171
- - **Missing description** Reference files without the required `description` in frontmatter
168
+ - **Undefined references** - Referencing a name that doesn't have a matching file in `references/`
169
+ - **Unused references** - A reference file exists but isn't listed in any `agent.references` or `start-thread.references`
170
+ - **Invalid names** - Names that don't follow the `lowercase-with-dashes` convention
171
+ - **Missing description** - Reference files without the required `description` in frontmatter
172
172
 
173
173
  ## References vs Skills
174
174
 
@@ -184,6 +184,6 @@ Use **references** when the agent needs access to text-based knowledge. Use **sk
184
184
 
185
185
  ## Next Steps
186
186
 
187
- - [Agent Config](/docs/protocol/agent-config) Configuring references in agent settings
188
- - [Skills](/docs/protocol/skills) Code execution and knowledge packages
189
- - [Workers](/docs/protocol/workers) Using references in worker agents
187
+ - [Agent Config](/docs/protocol/agent-config) - Configuring references in agent settings
188
+ - [Skills](/docs/protocol/skills) - Code execution and knowledge packages
189
+ - [Workers](/docs/protocol/workers) - Using references in worker agents