@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.
- package/content/01-getting-started/01-introduction.md +15 -15
- package/content/01-getting-started/02-quickstart.md +2 -2
- package/content/02-server-sdk/01-overview.md +11 -7
- package/content/02-server-sdk/02-sessions.md +8 -8
- package/content/02-server-sdk/03-tools.md +11 -11
- package/content/02-server-sdk/04-streaming.md +1 -1
- package/content/02-server-sdk/05-cli.md +15 -15
- package/content/02-server-sdk/06-workers.md +10 -10
- package/content/02-server-sdk/07-debugging.md +7 -7
- package/content/02-server-sdk/08-computer.md +26 -8
- package/content/03-client-sdk/01-overview.md +11 -11
- package/content/03-client-sdk/03-streaming.md +3 -3
- package/content/03-client-sdk/04-execution-blocks.md +1 -1
- package/content/03-client-sdk/05-socket-transport.md +5 -5
- package/content/03-client-sdk/06-http-transport.md +5 -5
- package/content/03-client-sdk/07-structured-output.md +3 -3
- package/content/03-client-sdk/08-file-uploads.md +2 -2
- package/content/03-client-sdk/09-error-handling.md +3 -3
- package/content/03-client-sdk/10-client-tools.md +3 -3
- package/content/04-protocol/01-overview.md +18 -18
- package/content/04-protocol/02-input-resources.md +1 -1
- package/content/04-protocol/03-triggers.md +1 -1
- package/content/04-protocol/04-tools.md +6 -6
- package/content/04-protocol/05-skills.md +5 -5
- package/content/04-protocol/06-handlers.md +3 -0
- package/content/04-protocol/07-agent-config.md +66 -11
- package/content/04-protocol/09-skills-advanced.md +18 -18
- package/content/04-protocol/10-types.md +22 -22
- package/content/04-protocol/11-workers.md +31 -30
- package/content/04-protocol/12-references.md +10 -10
- package/content/04-protocol/13-mcp-servers.md +63 -6
- package/content/05-api-reference/02-sessions.md +2 -2
- package/content/06-examples/02-nextjs-chat.md +3 -3
- package/content/06-examples/03-socket-chat.md +3 -3
- package/dist/chunk-PD34BHI2.js +1523 -0
- package/dist/chunk-PD34BHI2.js.map +1 -0
- package/dist/content.js +1 -1
- package/dist/docs.json +39 -48
- package/dist/index.js +1 -1
- package/dist/search-index.json +1 -1
- package/dist/search.js +1 -1
- package/dist/search.js.map +1 -1
- package/dist/sections.json +39 -56
- package/package.json +1 -1
- package/content/07-migration/01-v1-to-v2.md +0 -366
- package/content/07-migration/_meta.md +0 -4
- package/dist/chunk-4XCEGHY7.js +0 -1549
- package/dist/chunk-4XCEGHY7.js.map +0 -1
- package/dist/chunk-BVJLZYTT.js +0 -1549
- package/dist/chunk-BVJLZYTT.js.map +0 -1
- package/dist/chunk-O5XHIDDC.js +0 -1549
- package/dist/chunk-O5XHIDDC.js.map +0 -1
- package/dist/chunk-PKBPANXP.js +0 -1549
- package/dist/chunk-PKBPANXP.js.map +0 -1
- package/dist/chunk-Q2SRPPSB.js +0 -1549
- package/dist/chunk-Q2SRPPSB.js.map +0 -1
- package/dist/chunk-WYHGKCEV.js +0 -1549
- package/dist/chunk-WYHGKCEV.js.map +0 -1
|
@@ -11,11 +11,11 @@ Octavus is an agent orchestration platform that lets developers define, manage,
|
|
|
11
11
|
|
|
12
12
|
Building and managing AI agents is complex. Developers face challenges with:
|
|
13
13
|
|
|
14
|
-
- **Fragmented tooling**
|
|
15
|
-
- **Prompt management**
|
|
16
|
-
- **Integration complexity**
|
|
17
|
-
- **Observability**
|
|
18
|
-
- **Infrastructure overhead**
|
|
14
|
+
- **Fragmented tooling** - No unified way to define, manage, and deploy agents
|
|
15
|
+
- **Prompt management** - Prompts are scattered across codebases, hard to version and iterate
|
|
16
|
+
- **Integration complexity** - Connecting agents to tools, resources, and other agents requires significant custom work
|
|
17
|
+
- **Observability** - Difficult to debug, monitor, and understand agent behavior in production
|
|
18
|
+
- **Infrastructure overhead** - Teams rebuild the same agent infrastructure repeatedly
|
|
19
19
|
|
|
20
20
|
Octavus solves these problems by providing:
|
|
21
21
|
|
|
@@ -30,7 +30,7 @@ Octavus solves these problems by providing:
|
|
|
30
30
|
|
|
31
31
|
### Agents
|
|
32
32
|
|
|
33
|
-
An **Agent** is the main entity in Octavus
|
|
33
|
+
An **Agent** is the main entity in Octavus - a self-contained unit that defines how an AI agent behaves. Agents are defined using YAML protocols that specify:
|
|
34
34
|
|
|
35
35
|
- Input variables the agent accepts
|
|
36
36
|
- Triggers that invoke the agent (user messages, button clicks, API calls)
|
|
@@ -49,16 +49,16 @@ A **Session** represents a conversation with an agent. Sessions:
|
|
|
49
49
|
|
|
50
50
|
**Triggers** define how an agent is invoked:
|
|
51
51
|
|
|
52
|
-
- **User Message**
|
|
53
|
-
- **User Action**
|
|
54
|
-
- **API Call**
|
|
52
|
+
- **User Message** - Respond to a text message in a chat interface
|
|
53
|
+
- **User Action** - Respond to UI actions (button clicks, form submissions)
|
|
54
|
+
- **API Call** - Direct invocation via SDK
|
|
55
55
|
|
|
56
56
|
### Tools
|
|
57
57
|
|
|
58
58
|
**Tools** extend what agents can do:
|
|
59
59
|
|
|
60
|
-
- **External Tools**
|
|
61
|
-
- **Internal Tools**
|
|
60
|
+
- **External Tools** - Consumer-defined tools that call back to your systems
|
|
61
|
+
- **Internal Tools** - Built-in capabilities (web search, code execution)
|
|
62
62
|
|
|
63
63
|
Tools execute on your server, not on Octavus, giving you full control over data and authentication.
|
|
64
64
|
|
|
@@ -87,7 +87,7 @@ sequenceDiagram
|
|
|
87
87
|
|
|
88
88
|
## Next Steps
|
|
89
89
|
|
|
90
|
-
- [Quick Start](/docs/getting-started/quickstart)
|
|
91
|
-
- [Server SDK](/docs/server-sdk/overview)
|
|
92
|
-
- [Client SDK](/docs/client-sdk/overview)
|
|
93
|
-
- [Protocol Reference](/docs/protocol/overview)
|
|
90
|
+
- [Quick Start](/docs/getting-started/quickstart) - Get your first agent running in minutes
|
|
91
|
+
- [Server SDK](/docs/server-sdk/overview) - Learn about backend integration
|
|
92
|
+
- [Client SDK](/docs/client-sdk/overview) - Build chat interfaces with React (or other frameworks)
|
|
93
|
+
- [Protocol Reference](/docs/protocol/overview) - Deep dive into agent protocols
|
|
@@ -17,7 +17,7 @@ This guide will walk you through integrating Octavus into your application in un
|
|
|
17
17
|
|
|
18
18
|
Before integrating with SDKs, use **Agent Preview** to test your agent directly in the platform:
|
|
19
19
|
|
|
20
|
-
1. Open your agent in the platform
|
|
20
|
+
1. Open your agent in the platform (navigate to your project, then select the agent)
|
|
21
21
|
2. Click the **Preview** tab
|
|
22
22
|
3. Configure session inputs and tool mock responses
|
|
23
23
|
4. Start a conversation to test agent behavior
|
|
@@ -81,7 +81,7 @@ There are two ways to create and manage agents:
|
|
|
81
81
|
**Option 1: Platform UI (Recommended for getting started)**
|
|
82
82
|
|
|
83
83
|
1. Go to [octavus.ai](https://octavus.ai) and create an agent in the web editor
|
|
84
|
-
2. Copy the agent ID from the URL (e.g., `octavus.ai/
|
|
84
|
+
2. Copy the agent ID from the URL (e.g., `octavus.ai/projects/.../agents/clxyz123abc456`)
|
|
85
85
|
3. Add it to your `.env.local`: `OCTAVUS_SUPPORT_AGENT_ID=clxyz123abc456`
|
|
86
86
|
|
|
87
87
|
**Option 2: Local Development with CLI**
|
|
@@ -117,8 +117,9 @@ const session = client.agentSessions.attach(sessionId, {
|
|
|
117
117
|
tools: {
|
|
118
118
|
'set-chat-title': async (args) => ({ title: args.title }),
|
|
119
119
|
},
|
|
120
|
-
computer,
|
|
121
120
|
});
|
|
121
|
+
|
|
122
|
+
session.setDynamicTools(computer);
|
|
122
123
|
```
|
|
123
124
|
|
|
124
125
|
### Workers
|
|
@@ -210,6 +211,9 @@ class AgentSession {
|
|
|
210
211
|
|
|
211
212
|
// Get the session ID
|
|
212
213
|
getSessionId(): string;
|
|
214
|
+
|
|
215
|
+
// Register dynamic tools (e.g., pass a Computer or explicit DynamicTool[])
|
|
216
|
+
setDynamicTools(source: ToolProvider | DynamicTool[]): void;
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
type SessionRequest = TriggerRequest | ContinueRequest;
|
|
@@ -259,9 +263,9 @@ The client uploads files directly to S3 using the presigned upload URL. See [Fil
|
|
|
259
263
|
|
|
260
264
|
## Next Steps
|
|
261
265
|
|
|
262
|
-
- [Sessions](/docs/server-sdk/sessions)
|
|
263
|
-
- [Tools](/docs/server-sdk/tools)
|
|
264
|
-
- [Streaming](/docs/server-sdk/streaming)
|
|
265
|
-
- [Workers](/docs/server-sdk/workers)
|
|
266
|
-
- [Debugging](/docs/server-sdk/debugging)
|
|
267
|
-
- [Computer](/docs/server-sdk/computer)
|
|
266
|
+
- [Sessions](/docs/server-sdk/sessions) - Deep dive into session management
|
|
267
|
+
- [Tools](/docs/server-sdk/tools) - Implementing tool handlers
|
|
268
|
+
- [Streaming](/docs/server-sdk/streaming) - Understanding stream events
|
|
269
|
+
- [Workers](/docs/server-sdk/workers) - Executing worker agents
|
|
270
|
+
- [Debugging](/docs/server-sdk/debugging) - Model request tracing and debugging
|
|
271
|
+
- [Computer](/docs/server-sdk/computer) - Browser, filesystem, and shell via MCP
|
|
@@ -87,19 +87,19 @@ const session = client.agentSessions.attach(sessionId, {
|
|
|
87
87
|
resources: [
|
|
88
88
|
// Resource watchers (optional)
|
|
89
89
|
],
|
|
90
|
-
computer: computer, // Computer capabilities (optional, see Computer documentation)
|
|
91
90
|
});
|
|
92
91
|
```
|
|
93
92
|
|
|
94
93
|
### Attach Options
|
|
95
94
|
|
|
96
|
-
| Option
|
|
97
|
-
|
|
|
98
|
-
| `tools`
|
|
99
|
-
| `resources`
|
|
100
|
-
| `
|
|
95
|
+
| Option | Type | Description |
|
|
96
|
+
| ----------------------- | --------------------------------- | ------------------------------------------------------------------------------- |
|
|
97
|
+
| `tools` | `ToolHandlers` | Server-side tool handler functions |
|
|
98
|
+
| `resources` | `Resource[]` | Resource watchers for real-time updates |
|
|
99
|
+
| `onToolResults` | `(results: ToolResult[]) => void` | Callback invoked after server-side tool results are produced |
|
|
100
|
+
| `rejectClientToolCalls` | `boolean` | If `true`, reject tool calls that have no server handler (no client forwarding) |
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
For MCP tool integration (browser, filesystem, shell via `@octavus/computer`), register dynamic tools after attaching with `session.setDynamicTools()`. See [Computer](/docs/server-sdk/computer) for details.
|
|
103
103
|
|
|
104
104
|
## Executing Requests
|
|
105
105
|
|
|
@@ -416,7 +416,7 @@ interface ClearSessionResult {
|
|
|
416
416
|
}
|
|
417
417
|
```
|
|
418
418
|
|
|
419
|
-
This is idempotent
|
|
419
|
+
This is idempotent - calling `clear()` on an already expired session succeeds without error.
|
|
420
420
|
|
|
421
421
|
## Error Handling
|
|
422
422
|
|
|
@@ -9,18 +9,18 @@ Tools extend what agents can do. In Octavus, tools can execute either on your se
|
|
|
9
9
|
|
|
10
10
|
## Server Tools vs Client Tools
|
|
11
11
|
|
|
12
|
-
| Location | Use Case | Registration
|
|
13
|
-
| ---------- | ------------------------------------------------- |
|
|
14
|
-
| **Server** | Database queries, API calls, sensitive operations | Register handler in `attach()`
|
|
15
|
-
| **MCP** | Browser, filesystem, shell, external services | Via `
|
|
16
|
-
| **Client** | Browser APIs, interactive UIs, confirmations | No server handler (forwarded to client)
|
|
12
|
+
| Location | Use Case | Registration |
|
|
13
|
+
| ---------- | ------------------------------------------------- | ------------------------------------------------ |
|
|
14
|
+
| **Server** | Database queries, API calls, sensitive operations | Register handler in `attach()` |
|
|
15
|
+
| **MCP** | Browser, filesystem, shell, external services | Via `session.setDynamicTools()` after `attach()` |
|
|
16
|
+
| **Client** | Browser APIs, interactive UIs, confirmations | No server handler (forwarded to client) |
|
|
17
17
|
|
|
18
18
|
When the Server SDK encounters a tool call:
|
|
19
19
|
|
|
20
|
-
1. **Handler exists** (server or
|
|
20
|
+
1. **Handler exists** (server or dynamic) → Execute on server, continue automatically
|
|
21
21
|
2. **No handler** → Forward to client via `client-tool-request` event
|
|
22
22
|
|
|
23
|
-
MCP tool handlers from `@octavus/computer`
|
|
23
|
+
MCP tool handlers registered via `session.setDynamicTools()` (e.g., from `@octavus/computer`) work identically to manual handlers from the platform's perspective. See [Computer](/docs/server-sdk/computer) for MCP tool integration.
|
|
24
24
|
|
|
25
25
|
For client-side tool handling, see [Client Tools](/docs/client-sdk/client-tools).
|
|
26
26
|
|
|
@@ -28,10 +28,10 @@ For client-side tool handling, see [Client Tools](/docs/client-sdk/client-tools)
|
|
|
28
28
|
|
|
29
29
|
Server-side tools give you full control:
|
|
30
30
|
|
|
31
|
-
- ✅ **Full data access**
|
|
32
|
-
- ✅ **Your authentication**
|
|
33
|
-
- ✅ **No data exposure**
|
|
34
|
-
- ✅ **Custom logic**
|
|
31
|
+
- ✅ **Full data access** - Query your database directly
|
|
32
|
+
- ✅ **Your authentication** - Use your existing auth context
|
|
33
|
+
- ✅ **No data exposure** - Sensitive data never leaves your infrastructure
|
|
34
|
+
- ✅ **Custom logic** - Any complexity you need
|
|
35
35
|
|
|
36
36
|
## Defining Tool Handlers
|
|
37
37
|
|
|
@@ -41,7 +41,7 @@ The `X-Accel-Buffering: no` header disables proxy buffering on Nginx-based infra
|
|
|
41
41
|
|
|
42
42
|
### Heartbeat
|
|
43
43
|
|
|
44
|
-
`toSSEStream` automatically sends SSE comment lines (`: heartbeat`) every 15 seconds during idle periods. This prevents proxies and load balancers from closing the connection due to inactivity
|
|
44
|
+
`toSSEStream` automatically sends SSE comment lines (`: heartbeat`) every 15 seconds during idle periods. This prevents proxies and load balancers from closing the connection due to inactivity - particularly important during multi-step executions where the stream may be silent while waiting for tool processing or LLM responses.
|
|
45
45
|
|
|
46
46
|
Heartbeat comments are ignored by all SSE parsers per the spec. No client-side handling is needed.
|
|
47
47
|
|
|
@@ -88,8 +88,8 @@ octavus sync ./agents/my-agent
|
|
|
88
88
|
|
|
89
89
|
**Options:**
|
|
90
90
|
|
|
91
|
-
- `--json`
|
|
92
|
-
- `--quiet`
|
|
91
|
+
- `--json` - Output as JSON (for CI/CD parsing)
|
|
92
|
+
- `--quiet` - Suppress non-essential output
|
|
93
93
|
|
|
94
94
|
**Example output:**
|
|
95
95
|
|
|
@@ -110,9 +110,9 @@ octavus validate ./agents/my-agent
|
|
|
110
110
|
|
|
111
111
|
**Exit codes:**
|
|
112
112
|
|
|
113
|
-
- `0`
|
|
114
|
-
- `1`
|
|
115
|
-
- `2`
|
|
113
|
+
- `0` - Validation passed
|
|
114
|
+
- `1` - Validation errors
|
|
115
|
+
- `2` - Configuration errors (missing API key, etc.)
|
|
116
116
|
|
|
117
117
|
### `octavus list`
|
|
118
118
|
|
|
@@ -150,8 +150,8 @@ octavus archive support-chat
|
|
|
150
150
|
|
|
151
151
|
**Options:**
|
|
152
152
|
|
|
153
|
-
- `--json`
|
|
154
|
-
- `--quiet`
|
|
153
|
+
- `--json` - Output as JSON (for CI/CD parsing)
|
|
154
|
+
- `--quiet` - Suppress non-essential output
|
|
155
155
|
|
|
156
156
|
**Example output:**
|
|
157
157
|
|
|
@@ -171,8 +171,8 @@ octavus skills sync ./skills/github
|
|
|
171
171
|
|
|
172
172
|
**Options:**
|
|
173
173
|
|
|
174
|
-
- `--json`
|
|
175
|
-
- `--quiet`
|
|
174
|
+
- `--json` - Output as JSON (for CI/CD parsing)
|
|
175
|
+
- `--quiet` - Suppress non-essential output
|
|
176
176
|
|
|
177
177
|
**Example output:**
|
|
178
178
|
|
|
@@ -187,7 +187,7 @@ octavus skills sync ./skills/github
|
|
|
187
187
|
|
|
188
188
|
**Secret handling:**
|
|
189
189
|
|
|
190
|
-
If the skill directory contains a `.env` file, secrets are pushed alongside the bundle. Secrets are cross-validated against the `secrets` declarations in `SKILL.md`
|
|
190
|
+
If the skill directory contains a `.env` file, secrets are pushed alongside the bundle. Secrets are cross-validated against the `secrets` declarations in `SKILL.md` - warnings are shown for undeclared or missing required secrets.
|
|
191
191
|
|
|
192
192
|
```
|
|
193
193
|
my-skill/
|
|
@@ -289,11 +289,11 @@ Add sync scripts to your `package.json`:
|
|
|
289
289
|
|
|
290
290
|
The recommended workflow for managing agents:
|
|
291
291
|
|
|
292
|
-
1. **Define agent locally**
|
|
293
|
-
2. **Validate**
|
|
294
|
-
3. **Sync**
|
|
295
|
-
4. **Store agent ID**
|
|
296
|
-
5. **Use in app**
|
|
292
|
+
1. **Define agent locally** - Create `settings.json`, `protocol.yaml`, and prompts
|
|
293
|
+
2. **Validate** - Run `octavus validate ./my-agent` to check for errors
|
|
294
|
+
3. **Sync** - Run `octavus sync ./my-agent` to push to platform
|
|
295
|
+
4. **Store agent ID** - Save the output ID in an environment variable
|
|
296
|
+
5. **Use in app** - Read the ID from env and pass to `client.agentSessions.create()`
|
|
297
297
|
|
|
298
298
|
```bash
|
|
299
299
|
# After syncing: octavus sync ./agents/support-chat
|
|
@@ -92,8 +92,8 @@ interface WorkerExecuteOptions {
|
|
|
92
92
|
tools?: ToolHandlers;
|
|
93
93
|
/** Abort signal to cancel the execution */
|
|
94
94
|
signal?: AbortSignal;
|
|
95
|
-
/**
|
|
96
|
-
|
|
95
|
+
/** Dynamic tool schemas (e.g., from MCP servers - browser, filesystem, shell) */
|
|
96
|
+
dynamicToolSchemas?: ToolSchema[];
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -105,7 +105,7 @@ interface WorkerExecuteOptions {
|
|
|
105
105
|
| `input` | `Record<string, unknown>` | Input values for the worker |
|
|
106
106
|
| `options` | `WorkerExecuteOptions` | Optional configuration |
|
|
107
107
|
|
|
108
|
-
The `
|
|
108
|
+
The `dynamicToolSchemas` option enables MCP tool support for workers executed via the SDK. Pass tool schemas from `@octavus/computer` (or any `ToolProvider`) so the worker can use MCP tools like browser, filesystem, and shell. Schemas are sent on the first request and cached for continuation rounds.
|
|
109
109
|
|
|
110
110
|
## Tool Handlers
|
|
111
111
|
|
|
@@ -128,7 +128,7 @@ const { output } = await client.workers.generate(
|
|
|
128
128
|
);
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
Tools defined in the worker protocol but not provided as handlers become client tools
|
|
131
|
+
Tools defined in the worker protocol but not provided as handlers become client tools - the execution pauses and emits a `client-tool-request` event.
|
|
132
132
|
|
|
133
133
|
## Error Handling
|
|
134
134
|
|
|
@@ -146,7 +146,7 @@ try {
|
|
|
146
146
|
if (error instanceof WorkerError) {
|
|
147
147
|
console.error('Worker failed:', error.message);
|
|
148
148
|
if (error.sessionId) {
|
|
149
|
-
console.error(`Debug: ${client.baseUrl}/
|
|
149
|
+
console.error(`Debug: ${client.baseUrl}/sessions/${error.sessionId}`);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -211,7 +211,7 @@ try {
|
|
|
211
211
|
|
|
212
212
|
## Streaming
|
|
213
213
|
|
|
214
|
-
When you need real-time visibility into the worker's execution
|
|
214
|
+
When you need real-time visibility into the worker's execution - text generation, tool calls, or progress - use `execute()` instead of `generate()`.
|
|
215
215
|
|
|
216
216
|
### Basic Streaming
|
|
217
217
|
|
|
@@ -359,7 +359,7 @@ try {
|
|
|
359
359
|
if (error instanceof WorkerError) {
|
|
360
360
|
console.error('Failed:', error.message);
|
|
361
361
|
if (error.sessionId) {
|
|
362
|
-
console.error(`Debug: ${client.baseUrl}/
|
|
362
|
+
console.error(`Debug: ${client.baseUrl}/sessions/${error.sessionId}`);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
}
|
|
@@ -434,6 +434,6 @@ console.log('Result:', result);
|
|
|
434
434
|
|
|
435
435
|
## Next Steps
|
|
436
436
|
|
|
437
|
-
- [Workers Protocol](/docs/protocol/workers)
|
|
438
|
-
- [Streaming](/docs/server-sdk/streaming)
|
|
439
|
-
- [Tools](/docs/server-sdk/tools)
|
|
437
|
+
- [Workers Protocol](/docs/protocol/workers) - Worker protocol reference
|
|
438
|
+
- [Streaming](/docs/server-sdk/streaming) - Understanding stream events
|
|
439
|
+
- [Tools](/docs/server-sdk/tools) - Tool handler patterns
|
|
@@ -7,7 +7,7 @@ description: Model request tracing and debugging tools for Octavus agents.
|
|
|
7
7
|
|
|
8
8
|
## Model Request Tracing
|
|
9
9
|
|
|
10
|
-
Model request tracing captures the full payload sent to model providers (LLM and image) during agent execution. This helps you understand exactly what was sent
|
|
10
|
+
Model request tracing captures the full payload sent to model providers (LLM and image) during agent execution. This helps you understand exactly what was sent - system prompts, messages, tool definitions, and provider options - making it easier to debug agent behavior.
|
|
11
11
|
|
|
12
12
|
### Enabling Tracing
|
|
13
13
|
|
|
@@ -57,8 +57,8 @@ Traces appear as **Model Request** entries in the execution log timeline, alongs
|
|
|
57
57
|
|
|
58
58
|
In the Octavus dashboard:
|
|
59
59
|
|
|
60
|
-
- **Session debug view**
|
|
61
|
-
- **Agent preview**
|
|
60
|
+
- **Session debug view** - Full execution log with expandable model request entries
|
|
61
|
+
- **Agent preview** - Activity panel shows model requests in the execution steps
|
|
62
62
|
|
|
63
63
|
Each entry shows the raw JSON payload with a copy button for easy inspection.
|
|
64
64
|
|
|
@@ -70,10 +70,10 @@ Traces are stored in Redis alongside other execution log entries with a 24-hour
|
|
|
70
70
|
|
|
71
71
|
| Environment | Recommendation |
|
|
72
72
|
| ----------- | ---------------------------------------------------------- |
|
|
73
|
-
| Development | Enable
|
|
74
|
-
| Staging | Enable
|
|
75
|
-
| Production | Disable (default)
|
|
73
|
+
| Development | Enable - helps debug agent behavior during development |
|
|
74
|
+
| Staging | Enable - useful for pre-production testing |
|
|
75
|
+
| Production | Disable (default) - saves storage for high-volume sessions |
|
|
76
76
|
|
|
77
77
|
### Preview Sessions
|
|
78
78
|
|
|
79
|
-
Model request tracing is always enabled for preview sessions in the Octavus dashboard. No configuration needed
|
|
79
|
+
Model request tracing is always enabled for preview sessions in the Octavus dashboard. No configuration needed - the platform automatically traces all model requests when using the agent preview.
|
|
@@ -40,11 +40,12 @@ const session = client.agentSessions.attach(sessionId, {
|
|
|
40
40
|
tools: {
|
|
41
41
|
'set-chat-title': async (args) => ({ title: args.title }),
|
|
42
42
|
},
|
|
43
|
-
computer,
|
|
44
43
|
});
|
|
44
|
+
|
|
45
|
+
session.setDynamicTools(computer);
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
Dynamic tools are registered after attaching via `session.setDynamicTools()`. Pass the `computer` directly - the session extracts schemas and handlers from the `ToolProvider`. Tool schemas are sent to the platform on the next `execute()` call, and tool calls flow back through the existing execution loop.
|
|
48
49
|
|
|
49
50
|
## How It Works
|
|
50
51
|
|
|
@@ -53,7 +54,7 @@ The `computer` is passed to `attach()` — the server-sdk handles the rest. Tool
|
|
|
53
54
|
3. Each tool is namespaced with `__` (e.g., `browser__navigate_page`, `filesystem__read_file`)
|
|
54
55
|
4. The server-sdk sends tool schemas to the platform and handles tool call execution
|
|
55
56
|
|
|
56
|
-
The agent's protocol must declare matching `mcpServers` with `source: device`
|
|
57
|
+
The agent's protocol must declare matching `mcpServers` with `source: device` - see [MCP Servers](/docs/protocol/mcp-servers).
|
|
57
58
|
|
|
58
59
|
## Entry Types
|
|
59
60
|
|
|
@@ -159,7 +160,7 @@ When `allowedPatterns` is set, only matching commands are permitted. When `block
|
|
|
159
160
|
|
|
160
161
|
### Starting
|
|
161
162
|
|
|
162
|
-
`computer.start()` connects to all configured MCP servers in parallel. If some servers fail to connect, the computer still starts with the remaining servers
|
|
163
|
+
`computer.start()` connects to all configured MCP servers in parallel. If some servers fail to connect, the computer still starts with the remaining servers - only if _all_ connections fail does it throw an error.
|
|
163
164
|
|
|
164
165
|
```typescript
|
|
165
166
|
const { errors } = await computer.start();
|
|
@@ -227,7 +228,13 @@ interface ToolProvider {
|
|
|
227
228
|
}
|
|
228
229
|
```
|
|
229
230
|
|
|
230
|
-
|
|
231
|
+
`setDynamicTools()` accepts any `ToolProvider` directly - the session extracts schemas and handlers automatically:
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
session.setDynamicTools(computer);
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
You can also pass a custom `ToolProvider`:
|
|
231
238
|
|
|
232
239
|
```typescript
|
|
233
240
|
const customProvider: ToolProvider = {
|
|
@@ -257,8 +264,18 @@ const customProvider: ToolProvider = {
|
|
|
257
264
|
|
|
258
265
|
const session = client.agentSessions.attach(sessionId, {
|
|
259
266
|
tools: { 'set-chat-title': titleHandler },
|
|
260
|
-
computer: customProvider,
|
|
261
267
|
});
|
|
268
|
+
|
|
269
|
+
session.setDynamicTools(customProvider);
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
For cases where you need explicit control, `setDynamicTools()` also accepts a `DynamicTool[]` array:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
interface DynamicTool {
|
|
276
|
+
schema: ToolSchema;
|
|
277
|
+
handler: ToolHandler;
|
|
278
|
+
}
|
|
262
279
|
```
|
|
263
280
|
|
|
264
281
|
## Complete Example
|
|
@@ -300,7 +317,7 @@ async function startSession(sessionId: string) {
|
|
|
300
317
|
console.warn('Failed to connect:', errors);
|
|
301
318
|
}
|
|
302
319
|
|
|
303
|
-
// 4. Attach to session
|
|
320
|
+
// 4. Attach to session and register dynamic tools
|
|
304
321
|
const client = new OctavusClient({
|
|
305
322
|
baseUrl: process.env.OCTAVUS_API_URL!,
|
|
306
323
|
apiKey: process.env.OCTAVUS_API_KEY!,
|
|
@@ -313,9 +330,10 @@ async function startSession(sessionId: string) {
|
|
|
313
330
|
return { success: true };
|
|
314
331
|
},
|
|
315
332
|
},
|
|
316
|
-
computer,
|
|
317
333
|
});
|
|
318
334
|
|
|
335
|
+
session.setDynamicTools(computer);
|
|
336
|
+
|
|
319
337
|
// 5. Execute and stream
|
|
320
338
|
const events = session.execute({
|
|
321
339
|
type: 'trigger',
|
|
@@ -12,7 +12,7 @@ Octavus provides two packages for frontend integration:
|
|
|
12
12
|
| `@octavus/react` | React hooks and bindings | Building React applications |
|
|
13
13
|
| `@octavus/client-sdk` | Framework-agnostic core | Using Vue, Svelte, vanilla JS, or custom integrations |
|
|
14
14
|
|
|
15
|
-
**Most users should install `@octavus/react`**
|
|
15
|
+
**Most users should install `@octavus/react`** - it includes everything from `@octavus/client-sdk` plus React-specific hooks.
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
@@ -271,7 +271,7 @@ interface UserMessageInput {
|
|
|
271
271
|
|
|
272
272
|
### useAutoScroll
|
|
273
273
|
|
|
274
|
-
Smart auto-scroll for chat containers. Scrolls to bottom when content updates, but pauses if the user has scrolled up. See [Streaming
|
|
274
|
+
Smart auto-scroll for chat containers. Scrolls to bottom when content updates, but pauses if the user has scrolled up. See [Streaming - Auto-Scroll](/docs/client-sdk/streaming#auto-scroll) for full usage.
|
|
275
275
|
|
|
276
276
|
```typescript
|
|
277
277
|
function useAutoScroll(options?: UseAutoScrollOptions): {
|
|
@@ -373,12 +373,12 @@ class OctavusChat {
|
|
|
373
373
|
|
|
374
374
|
## Next Steps
|
|
375
375
|
|
|
376
|
-
- [HTTP Transport](/docs/client-sdk/http-transport)
|
|
377
|
-
- [Socket Transport](/docs/client-sdk/socket-transport)
|
|
378
|
-
- [Messages](/docs/client-sdk/messages)
|
|
379
|
-
- [Streaming](/docs/client-sdk/streaming)
|
|
380
|
-
- [Client Tools](/docs/client-sdk/client-tools)
|
|
381
|
-
- [Operations](/docs/client-sdk/execution-blocks)
|
|
382
|
-
- [Error Handling](/docs/client-sdk/error-handling)
|
|
383
|
-
- [File Uploads](/docs/client-sdk/file-uploads)
|
|
384
|
-
- [Examples](/docs/examples/overview)
|
|
376
|
+
- [HTTP Transport](/docs/client-sdk/http-transport) - HTTP/SSE integration (recommended)
|
|
377
|
+
- [Socket Transport](/docs/client-sdk/socket-transport) - WebSocket and SockJS integration
|
|
378
|
+
- [Messages](/docs/client-sdk/messages) - Working with message state
|
|
379
|
+
- [Streaming](/docs/client-sdk/streaming) - Building streaming UIs
|
|
380
|
+
- [Client Tools](/docs/client-sdk/client-tools) - Interactive browser-side tool handling
|
|
381
|
+
- [Operations](/docs/client-sdk/execution-blocks) - Showing agent progress
|
|
382
|
+
- [Error Handling](/docs/client-sdk/error-handling) - Handling errors with type guards
|
|
383
|
+
- [File Uploads](/docs/client-sdk/file-uploads) - Uploading images and documents
|
|
384
|
+
- [Examples](/docs/examples/overview) - Complete working examples
|
|
@@ -256,9 +256,9 @@ The hook returns four values:
|
|
|
256
256
|
| Return Value | Purpose |
|
|
257
257
|
| ----------------- | ------------------------------------------------------------------------------------------------- |
|
|
258
258
|
| `scrollRef` | Attach to the scrollable container's `ref` |
|
|
259
|
-
| `handleScroll` | Attach to the container's `onScroll`
|
|
260
|
-
| `scrollOnUpdate` | Call inside a `useEffect` when messages change
|
|
261
|
-
| `resetAutoScroll` | Call when the user sends a message
|
|
259
|
+
| `handleScroll` | Attach to the container's `onScroll` - tracks whether the user is near the bottom |
|
|
260
|
+
| `scrollOnUpdate` | Call inside a `useEffect` when messages change - scrolls to bottom if the user hasn't scrolled up |
|
|
261
|
+
| `resetAutoScroll` | Call when the user sends a message - forces the next update to scroll to bottom |
|
|
262
262
|
|
|
263
263
|
You can customize the hook with options:
|
|
264
264
|
|
|
@@ -111,7 +111,7 @@ function EscalationProgress({ message }: { message: UIMessage }) {
|
|
|
111
111
|
|
|
112
112
|
Operations are only sent to the client if their protocol block has a visible display mode (`name`, `description`, or `stream`). Hidden operations (`display: hidden`) are filtered out by the platform before reaching the client.
|
|
113
113
|
|
|
114
|
-
This means you can safely render all operations without checking display mode
|
|
114
|
+
This means you can safely render all operations without checking display mode - hidden ones won't be in the message parts.
|
|
115
115
|
|
|
116
116
|
## Named Thread Operations
|
|
117
117
|
|
|
@@ -19,7 +19,7 @@ The socket transport enables real-time bidirectional communication using WebSock
|
|
|
19
19
|
|
|
20
20
|
## Connection Lifecycle
|
|
21
21
|
|
|
22
|
-
By default, socket transport uses **lazy connection**
|
|
22
|
+
By default, socket transport uses **lazy connection** - the socket connects only when you first call `send()`. This is efficient but can be surprising if you want to show connection status.
|
|
23
23
|
|
|
24
24
|
For UI indicators, use **eager connection**:
|
|
25
25
|
|
|
@@ -86,7 +86,7 @@ There are two main patterns for socket-based integrations:
|
|
|
86
86
|
|
|
87
87
|
## Server-Managed Sessions (Recommended)
|
|
88
88
|
|
|
89
|
-
The cleanest pattern is to have the server manage session lifecycle. The client never needs to know about `sessionId`
|
|
89
|
+
The cleanest pattern is to have the server manage session lifecycle. The client never needs to know about `sessionId` - the server creates it lazily on first message.
|
|
90
90
|
|
|
91
91
|
### Client Setup
|
|
92
92
|
|
|
@@ -104,7 +104,7 @@ function connectSocket(): Promise<SocketLike> {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
function Chat() {
|
|
107
|
-
// Transport is stable
|
|
107
|
+
// Transport is stable - no dependencies on sessionId
|
|
108
108
|
const transport = useMemo(() => createSocketTransport({ connect: connectSocket }), []);
|
|
109
109
|
|
|
110
110
|
const { messages, status, send, stop, connectionState, connect, disconnect } = useOctavusChat({
|
|
@@ -185,7 +185,7 @@ sockServer.installHandlers(httpServer);
|
|
|
185
185
|
|
|
186
186
|
**Benefits of this pattern:**
|
|
187
187
|
|
|
188
|
-
- Client code is simple
|
|
188
|
+
- Client code is simple - no sessionId management
|
|
189
189
|
- No transport caching issues
|
|
190
190
|
- Session is created only when needed
|
|
191
191
|
- Server controls session configuration
|
|
@@ -300,7 +300,7 @@ function ChatPage() {
|
|
|
300
300
|
}
|
|
301
301
|
```
|
|
302
302
|
|
|
303
|
-
This is the cleanest approach
|
|
303
|
+
This is the cleanest approach - the `Chat` component always receives a valid `sessionId`.
|
|
304
304
|
|
|
305
305
|
### Option 2: Server-Managed Sessions
|
|
306
306
|
|
|
@@ -364,8 +364,8 @@ See [Streaming Events](/docs/server-sdk/streaming#event-types) for the full list
|
|
|
364
364
|
|
|
365
365
|
## Next Steps
|
|
366
366
|
|
|
367
|
-
- [Quick Start](/docs/getting-started/quickstart)
|
|
368
|
-
- [Client Tools](/docs/client-sdk/client-tools)
|
|
369
|
-
- [Messages](/docs/client-sdk/messages)
|
|
370
|
-
- [Streaming](/docs/client-sdk/streaming)
|
|
371
|
-
- [Error Handling](/docs/client-sdk/error-handling)
|
|
367
|
+
- [Quick Start](/docs/getting-started/quickstart) - Complete Next.js integration guide
|
|
368
|
+
- [Client Tools](/docs/client-sdk/client-tools) - Handling tools on the client side
|
|
369
|
+
- [Messages](/docs/client-sdk/messages) - Working with message state
|
|
370
|
+
- [Streaming](/docs/client-sdk/streaming) - Building streaming UIs
|
|
371
|
+
- [Error Handling](/docs/client-sdk/error-handling) - Handling errors with type guards
|
|
@@ -373,9 +373,9 @@ The `responseType` in your protocol must be an **object type** (regular custom t
|
|
|
373
373
|
|
|
374
374
|
The following cannot be used directly as `responseType`:
|
|
375
375
|
|
|
376
|
-
- **Discriminated unions**
|
|
377
|
-
- **Array types**
|
|
378
|
-
- **Primitives**
|
|
376
|
+
- **Discriminated unions** - LLM providers don't allow `anyOf` at the schema root
|
|
377
|
+
- **Array types** - Must be wrapped in an object
|
|
378
|
+
- **Primitives** - `string`, `number`, etc. are not valid
|
|
379
379
|
|
|
380
380
|
If you need variant responses, wrap the discriminated union in an object:
|
|
381
381
|
|
|
@@ -188,12 +188,12 @@ Uploads include built-in timeout and retry logic for handling transient failures
|
|
|
188
188
|
|
|
189
189
|
**Default behavior:**
|
|
190
190
|
|
|
191
|
-
- **Timeout**: 60 seconds per file
|
|
191
|
+
- **Timeout**: 60 seconds per file - prevents uploads from hanging on stalled connections
|
|
192
192
|
- **Retries**: 2 automatic retries on transient failures (network errors, 5xx, 429)
|
|
193
193
|
- **Retry delay**: 1 second between retries
|
|
194
194
|
- **Non-retryable errors** (4xx like 403, 404) fail immediately without retrying
|
|
195
195
|
|
|
196
|
-
Only the S3 upload is retried
|
|
196
|
+
Only the S3 upload is retried - the presigned URL stays valid for 15 minutes. On retry, the progress callback resets to 0%.
|
|
197
197
|
|
|
198
198
|
Configure via `uploadOptions`:
|
|
199
199
|
|