@robota-sdk/agent-sdk 3.0.0-beta.54 → 3.0.0-beta.56
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/README.md +34 -16
- package/dist/node/index.cjs +2552 -1184
- package/dist/node/index.d.cts +1286 -952
- package/dist/node/index.d.ts +1286 -952
- package/dist/node/index.js +2530 -1172
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ const response = await query('Analyze the code', {
|
|
|
44
44
|
- **Hooks** — `PreToolUse`, `PostToolUse`, `PreCompact`, `PostCompact`, `SessionStart`, `UserPromptSubmit`, `Stop` events with shell command execution
|
|
45
45
|
- **Streaming** — Real-time text delta callbacks via `onTextDelta`
|
|
46
46
|
- **Context Loading** — AGENTS.md / CLAUDE.md walk-up discovery and system prompt assembly
|
|
47
|
-
- **Config Loading** — 6-
|
|
47
|
+
- **Config Loading** — 6-file settings merge with provider profiles, legacy provider compatibility, and `$ENV:VAR` substitution for provider API keys
|
|
48
48
|
- **Context Window Management** — Token tracking, auto-compaction at ~83.5%, manual `session.compact()`
|
|
49
49
|
- **Bundle Plugin System** — Install and manage reusable extensions packaged as bundle plugins
|
|
50
50
|
|
|
@@ -273,7 +273,7 @@ import { webFetchTool, webSearchTool } from '@robota-sdk/agent-tools';
|
|
|
273
273
|
|
|
274
274
|
## Subagent Sessions
|
|
275
275
|
|
|
276
|
-
`createSubagentSession()` creates an isolated child session for delegating subtasks. The subagent receives pre-resolved config and context from the parent — it does not load config files or context from disk.
|
|
276
|
+
`createSubagentSession()` creates an isolated child session for delegating subtasks. The subagent receives pre-resolved config and context from the parent — it does not load config files or context from disk. Callers may provide a stable `sessionId` and `sessionLogger` so the child session writes a durable transcript.
|
|
277
277
|
|
|
278
278
|
```typescript
|
|
279
279
|
import { createSubagentSession } from '@robota-sdk/agent-sdk';
|
|
@@ -296,6 +296,8 @@ Built-in agents: `general-purpose` (full tool access), `Explore` (read-only, Hai
|
|
|
296
296
|
|
|
297
297
|
`createAgentTool()` wraps subagent creation into a tool the AI can invoke directly. The parent session's hooks, permissions, and context are forwarded to the child.
|
|
298
298
|
|
|
299
|
+
Background subagent lifecycle events are persisted through `InteractiveSession` when a `SessionStore` is configured. Streaming chunks are written to append-only JSONL logs/transcripts rather than rewriting the main session JSON per token.
|
|
300
|
+
|
|
299
301
|
## Hook Executors (SDK-Specific)
|
|
300
302
|
|
|
301
303
|
`agent-sdk` provides two `IHookTypeExecutor` implementations beyond the `command` and `http` executors in `agent-core`:
|
|
@@ -330,26 +332,40 @@ Manages plugin installation and uninstallation:
|
|
|
330
332
|
|
|
331
333
|
## Configuration
|
|
332
334
|
|
|
333
|
-
Settings are
|
|
335
|
+
Settings are merged from lowest to highest priority:
|
|
334
336
|
|
|
335
|
-
| Layer | Path
|
|
336
|
-
| ----- |
|
|
337
|
-
| 1 |
|
|
338
|
-
| 2 |
|
|
339
|
-
| 3 | `.robota/settings.json`
|
|
340
|
-
| 4 | `.
|
|
341
|
-
| 5 |
|
|
342
|
-
| 6 |
|
|
337
|
+
| Layer | Path | Scope |
|
|
338
|
+
| ----- | ----------------------------- | --------------------------------------- |
|
|
339
|
+
| 1 | `~/.robota/settings.json` | User global |
|
|
340
|
+
| 2 | `~/.claude/settings.json` | User global (Claude Code compatible) |
|
|
341
|
+
| 3 | `.robota/settings.json` | Project |
|
|
342
|
+
| 4 | `.robota/settings.local.json` | Project (local) |
|
|
343
|
+
| 5 | `.claude/settings.json` | Project (Claude Code compatible) |
|
|
344
|
+
| 6 | `.claude/settings.local.json` | Project (local, Claude Code compatible) |
|
|
343
345
|
|
|
344
|
-
`$ENV:VAR` substitution is applied after merge.
|
|
346
|
+
`$ENV:VAR` substitution is applied after merge for provider API keys.
|
|
345
347
|
|
|
346
348
|
```json
|
|
347
349
|
{
|
|
348
350
|
"defaultMode": "default",
|
|
349
|
-
"
|
|
350
|
-
|
|
351
|
-
"
|
|
352
|
-
|
|
351
|
+
"currentProvider": "gemma",
|
|
352
|
+
"providers": {
|
|
353
|
+
"gemma": {
|
|
354
|
+
"type": "gemma",
|
|
355
|
+
"model": "supergemma4-26b-uncensored-v2",
|
|
356
|
+
"apiKey": "lm-studio",
|
|
357
|
+
"baseURL": "http://localhost:1234/v1"
|
|
358
|
+
},
|
|
359
|
+
"openai": {
|
|
360
|
+
"type": "openai",
|
|
361
|
+
"model": "<openai-compatible-model>",
|
|
362
|
+
"apiKey": "$ENV:OPENAI_API_KEY"
|
|
363
|
+
},
|
|
364
|
+
"anthropic": {
|
|
365
|
+
"type": "anthropic",
|
|
366
|
+
"model": "claude-sonnet-4-6",
|
|
367
|
+
"apiKey": "$ENV:ANTHROPIC_API_KEY"
|
|
368
|
+
}
|
|
353
369
|
},
|
|
354
370
|
"permissions": {
|
|
355
371
|
"allow": ["Bash(pnpm *)"],
|
|
@@ -358,6 +374,8 @@ Settings are loaded from (highest priority first):
|
|
|
358
374
|
}
|
|
359
375
|
```
|
|
360
376
|
|
|
377
|
+
`currentProvider` selects the active entry from `providers`. Gemma-family local models should use a `type: "gemma"` profile so provider-specific stream projection is applied. The resolved SDK config normalizes the active profile into `provider.name`, `provider.model`, `provider.apiKey`, optional `provider.baseURL`, and optional `provider.timeout`. The legacy `provider` object remains supported when `currentProvider` is not configured.
|
|
378
|
+
|
|
361
379
|
## Permission Modes
|
|
362
380
|
|
|
363
381
|
| Mode | Read/Glob/Grep | Write/Edit | Bash |
|