@octavus/docs 3.6.0 → 4.0.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.
@@ -106,6 +106,36 @@ tools: {
106
106
 
107
107
  The handler also receives Zod-validated arguments. Invalid inputs throw before reaching your code, with the failed paths and messages joined into the error.
108
108
 
109
+ ## Declaring an Output Schema
110
+
111
+ `defineInlineMcpTool()` accepts an optional `output` Zod schema. When provided, two things happen:
112
+
113
+ 1. The schema is converted to JSON Schema and forwarded to the LLM as `outputSchema`. Providers that support structured tool outputs (e.g. OpenAI strict mode) can use it to validate the tool result they reason over.
114
+ 2. Handler return values are validated against the schema at runtime. A handler returning a malformed result throws before the result reaches the LLM, with the failed paths and messages joined into the error.
115
+
116
+ ```typescript
117
+ 'get-pr-overview': defineInlineMcpTool({
118
+ description: 'Get pull request metadata and file changes',
119
+ parameters: z.object({
120
+ owner: z.string(),
121
+ repo: z.string(),
122
+ pullNumber: z.number(),
123
+ }),
124
+ output: z.object({
125
+ title: z.string(),
126
+ state: z.enum(['open', 'closed', 'merged']),
127
+ additions: z.number(),
128
+ deletions: z.number(),
129
+ }),
130
+ handler: async (args) => {
131
+ // Return type is type-checked against the `output` schema.
132
+ return await githubService.getPrOverview(args.owner, args.repo, args.pullNumber);
133
+ },
134
+ }),
135
+ ```
136
+
137
+ Omitting `output` preserves the previous behavior - the handler return type is unconstrained and the LLM sees no `outputSchema` on the tool.
138
+
109
139
  ## Attaching to a Session
110
140
 
111
141
  Pass inline MCP servers via `mcpServers` on `attach()`. They merge with `tools` and survive across `setDynamicTools()` calls:
@@ -33,7 +33,8 @@ type UIMessagePart =
33
33
  | UIFilePart
34
34
  | UIObjectPart
35
35
  | UITodoPart
36
- | UIWorkerPart;
36
+ | UIWorkerPart
37
+ | UIStepStartPart;
37
38
 
38
39
  // Text content
39
40
  interface UITextPart {
@@ -60,7 +61,7 @@ interface UIToolCallPart {
60
61
  args: Record<string, unknown>;
61
62
  result?: unknown;
62
63
  error?: string;
63
- status: 'pending' | 'running' | 'done' | 'error';
64
+ status: 'pending' | 'running' | 'done' | 'error' | 'cancelled';
64
65
  thread?: string;
65
66
  }
66
67
 
@@ -134,6 +135,11 @@ interface UIWorkerPart {
134
135
  error?: string;
135
136
  status: 'running' | 'done' | 'error';
136
137
  }
138
+
139
+ // Step boundary marker (structural, not rendered visually)
140
+ interface UIStepStartPart {
141
+ type: 'step-start';
142
+ }
137
143
  ```
138
144
 
139
145
  ## Sending Messages
@@ -316,6 +322,9 @@ function PartRenderer({ part }: { part: UIMessagePart }) {
316
322
  // See Structured Output guide for more details
317
323
  return <ObjectPartRenderer part={part} />;
318
324
 
325
+ case 'step-start':
326
+ return null;
327
+
319
328
  default:
320
329
  return null;
321
330
  }
@@ -24,6 +24,23 @@ curl -H "Authorization: Bearer YOUR_API_KEY" \
24
24
 
25
25
  API keys can be created in the Octavus Platform under your project's **API Keys** page.
26
26
 
27
+ ## Wire-Format Versioning
28
+
29
+ The platform negotiates wire shape via the `X-Octavus-Sdk-Version` header. The Server SDK sets this automatically; direct API users only need to send it when they want the latest format.
30
+
31
+ ```bash
32
+ curl -H "Authorization: Bearer YOUR_API_KEY" \
33
+ -H "X-Octavus-Sdk-Version: 4" \
34
+ https://octavus.ai/api/agent-sessions/SESSION_ID
35
+ ```
36
+
37
+ | Header value | Wire shape |
38
+ | ------------ | -------------------------------------------------------------------------------------------------------- |
39
+ | (missing) | Legacy (v3) - matches `@octavus/server-sdk@^3` |
40
+ | `4` | Current (v4) - matches `@octavus/server-sdk@^4`. Adds `step-start` parts to `UIMessage` / `ChatMessage`. |
41
+
42
+ The header value is the major version the client can parse, not the SDK release version. Future wire-incompatible additions bump it again.
43
+
27
44
  ## API Key Permissions
28
45
 
29
46
  API keys have two permission scopes: