@standardagents/agentbuilder-template 0.43.0 → 0.44.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/dist/index.d.ts +8 -8
- package/dist/index.js +78 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -42,6 +42,27 @@ the agent relies on it. Authentication, billing, deployment, and branded UI
|
|
|
42
42
|
services may remain external as long as they are not required for the packed
|
|
43
43
|
agent's core execution semantics.
|
|
44
44
|
|
|
45
|
+
## Packaging and Definition Visibility
|
|
46
|
+
|
|
47
|
+
The packer follows side \`subagents\` relationships and includes child agents
|
|
48
|
+
and their dependencies. This includes hidden children and relationships with
|
|
49
|
+
\`as\`. The package includes referenced handlers and exports a \`handlers\`
|
|
50
|
+
registry. The pack and unpack dialogs list handlers. Unpack analysis reports an agent\u2019s handlers and side \`subagents\` relationships.
|
|
51
|
+
In the pack dialog, a handler defaults to extract. Shared handlers default to copy. Extract removes
|
|
52
|
+
the local file; copy keeps it. Dependencies reached by another local agent,
|
|
53
|
+
including through its children, default to copy.
|
|
54
|
+
|
|
55
|
+
The runtime discovers packages in \`node_modules\` and \`agents/packed/\`.
|
|
56
|
+
It loads definitions from lazy registries and \`__meta\` exported by each
|
|
57
|
+
package entry module. A malformed \`package.json\` or missing or invalid
|
|
58
|
+
\`__meta\` produces a warning and the runtime skips that package.
|
|
59
|
+
|
|
60
|
+
\`ThreadState.loadModel\`, \`loadPrompt\`, and \`loadAgent\` enforce package
|
|
61
|
+
visibility. Global code can load unpacked definitions and packed entry agents.
|
|
62
|
+
Packed code can load its own definitions and other packages' entry agents.
|
|
63
|
+
A packed model cannot fall back to a host model with the same short name.
|
|
64
|
+
A refused load returns the same not-found error as a missing definition.
|
|
65
|
+
|
|
45
66
|
## How Components Compose
|
|
46
67
|
|
|
47
68
|
### Basic Flow
|
|
@@ -147,7 +168,9 @@ interface ThreadState {
|
|
|
147
168
|
runtimeStreams?: RuntimeStreams; // Optional live execution-host byte streams
|
|
148
169
|
|
|
149
170
|
// Methods
|
|
150
|
-
getMessages(options?): Promise<MessagesResult>; // Get conversation history
|
|
171
|
+
getMessages(options?): Promise<MessagesResult>; // Get conversation history, newest first by default
|
|
172
|
+
getMessage(id): Promise<Message | null>; // Find a persisted message by ID
|
|
173
|
+
updateMessage(id, updates): Promise<Message>; // Update a persisted message
|
|
151
174
|
injectMessage(input): Promise<Message>; // Add message to thread
|
|
152
175
|
queueMessage(input): Promise<void>; // Queue message for next step
|
|
153
176
|
emit(event, data): void; // Broadcast a custom event to connected thread clients
|
|
@@ -199,7 +222,7 @@ what was sent (\`request\`), what came back (\`response\` or \`error\`), and its
|
|
|
199
222
|
execution; oversized fields are truncated (name 120 chars, message and error
|
|
200
223
|
4 KiB, data JSON 16 KiB, request and response JSON 64 KiB each).
|
|
201
224
|
|
|
202
|
-
\`runCode\` has no implicit access to thread state, filesystem, network, timers, or host globals. Bridge only the exact capabilities needed through \`imports\` or \`globals\`; use \`modules\` for local relative ES modules; use \`execute\` to select the export and args to run. \`modules\` keys are graph-root relative paths; entry-source imports resolve from \`filename\` when supplied, including \`../\` parent paths that stay inside the supplied graph. TypeScript input is accepted by default and erased before evaluation. In thread endpoints, \`runCode\`
|
|
225
|
+
\`runCode\` has no implicit access to thread state, filesystem, network, timers, or host globals. Bridge only the exact capabilities needed through \`imports\` or \`globals\`; use \`modules\` for local relative ES modules; use \`execute\` to select the export and args to run. \`modules\` keys are graph-root relative paths; entry-source imports resolve from \`filename\` when supplied, including \`../\` parent paths that stay inside the supplied graph. TypeScript input is accepted by default and erased before evaluation. In thread endpoints, \`runCode\` forwards functions in imports, globals, and execution arguments as callable proxies. Call \`run.terminate(reason)\` to stop the sandbox. A caller disconnect also stops the run. When \`report\` is supplied, the host receives reports during the run and \`run.reports\` updates as reports arrive.
|
|
203
226
|
|
|
204
227
|
## Subagents
|
|
205
228
|
|
|
@@ -567,6 +590,7 @@ Prompts define system instructions, model selection, and available tools for LLM
|
|
|
567
590
|
| \`tools\` | \`(string \\| ToolConfig)[]\` | No | Available tools: tool names, sub-prompt names, provider tools, and exposed agent names for handoffs. Subagent relationships never appear here \u2014 they are declared on the agent side's \`subagents\` array |
|
|
568
591
|
| \`includeChat\` | \`boolean\` | No | Include full conversation history |
|
|
569
592
|
| \`includePastTools\` | \`boolean\` | No | Include previous tool results |
|
|
593
|
+
| \`historyLimit\` | \`number\` | No | With \`includeChat\`, load only the newest top-level messages: at least N and under 2N, the cut moving N at a time (prompt-cache stable). Execution history and \`filter_messages\` see only that window; stored history is untouched |
|
|
570
594
|
| \`parallelToolCalls\` | \`boolean\` | No | Allow multiple concurrent tool calls |
|
|
571
595
|
| \`toolChoice\` | \`'auto' \\| 'none' \\| 'required'\` | No | Tool calling strategy |
|
|
572
596
|
| \`requiredSchema\` | \`z.ZodObject\` | No | Input validation when called as tool |
|
|
@@ -574,6 +598,7 @@ Prompts define system instructions, model selection, and available tools for LLM
|
|
|
574
598
|
| \`env\` | \`Record<string, string>\` | No | Prompt-level default values for variables |
|
|
575
599
|
| \`hooks\` | \`string[]\` | No | Hook IDs to run for this prompt (overrides agent hooks) |
|
|
576
600
|
| \`reasoning\` | \`ReasoningConfig\` | No | Extended thinking configuration |
|
|
601
|
+
| \`providerOptions\` | \`Record<string, unknown>\` | No | Provider-specific request options |
|
|
577
602
|
|
|
578
603
|
## Basic Example
|
|
579
604
|
|
|
@@ -610,6 +635,8 @@ export default definePrompt({
|
|
|
610
635
|
});
|
|
611
636
|
\`\`\`
|
|
612
637
|
|
|
638
|
+
A circular prompt include raises an error that names the include chain. A prompt can include the same partial through different paths.
|
|
639
|
+
|
|
613
640
|
\`type: 'env'\` inserts a resolved thread variable value. Use this only for non-secret values that are safe to expose to the LLM.
|
|
614
641
|
|
|
615
642
|
The sandboxed coding prompt declares \`HTTP_HOST\` as a text variable and injects its resolved value with a structured \`{ type: 'env', property: 'HTTP_HOST' }\` prompt part. Its URL helper uses that value as the origin for files exposed from the thread \`public/\` directory and endpoints exposed from the thread \`api/\` directory. Public URLs should usually omit extensions; extensionless public paths resolve \`.html\`, then \`.js\`, then \`.ts\`, then matching \`index\` files in the same order. Browser pages should reference only public files, \`api/\` endpoints, or absolute external URLs, using relative asset URLs like \`./app\` and \`./api/todos\`; private \`src/\` files are not served directly. Public \`.ts\` files are transformed to browser JavaScript and are not server endpoints. Server-side endpoints live under the thread filesystem \`api/\` directory, and the \`api/\` directory name stays in the public URL: \`api/todo.ts\` is \`/api/threads/{threadId}/api/todo\`, while \`api/todo.ts\` is not \`/api/threads/{threadId}/todo\` or \`/api/threads/{threadId}/todos\`. Endpoint files default-export a function that accepts \`Request\` and returns \`Response\` or \`Promise<Response>\`. Endpoint code can import \`fetch\`, \`fs\`, and \`storage\`, and can import private helpers with relative paths such as \`../src/todo.ts\`. When the coding agent creates a site, page, or endpoint, it should call \`get_public_url\` with the created file path and use the returned URL.
|
|
@@ -664,7 +691,7 @@ sideA: {
|
|
|
664
691
|
For a prompt-backed side with non-hidden relationships, the runtime automatically injects three lifecycle tools scoped to that side's declarations:
|
|
665
692
|
|
|
666
693
|
- \`subagents\` \u2014 pull-based visibility: returns the registry snapshot (reference, relationship name, agent name, status, initial arguments, creation time). Call it before \`subagent_create\` so existing instances are reused rather than duplicated.
|
|
667
|
-
- \`subagent_create\` \u2014 creates (or continues) an instance. Its \`agent\` argument enumerates the side's enabled relationship *names* (\`as\`, defaulting to \`agent\`), never internal agent identifiers. It requires a non-empty \`name\` for the spawned instance; AgentBuilder stores that as a \`name:<value>\` thread tag for human-friendly labels.
|
|
694
|
+
- \`subagent_create\` \u2014 creates (or continues) an instance. Its \`agent\` argument enumerates the side's enabled relationship *names* (\`as\`, defaulting to the unqualified part of \`agent\`), never internal agent identifiers. It requires a non-empty \`name\` for the spawned instance; AgentBuilder stores that as a \`name:<value>\` thread tag for human-friendly labels.
|
|
668
695
|
- \`subagent_message\` \u2014 queues a message to an existing instance by reference.
|
|
669
696
|
|
|
670
697
|
These three names are reserved; a relationship \`as\` that collides with them (or with any other tool name) is a definition-time error.
|
|
@@ -696,8 +723,16 @@ export default definePrompt({
|
|
|
696
723
|
});
|
|
697
724
|
\`\`\`
|
|
698
725
|
|
|
726
|
+
Provider options merge from model defaults to prompt overrides. Later values win.
|
|
727
|
+
|
|
699
728
|
## Extended Thinking (Reasoning)
|
|
700
729
|
|
|
730
|
+
A prompt can set \`reasoning.level\` from 0 to 100. An unset level uses the model's default. Level 0 disables reasoning when the model supports a disabling control. Otherwise, the provider selects the lowest reasoning setting. A model with no reasoning control receives no control. Each provider maps the level to the nearest option the model declares.
|
|
731
|
+
|
|
732
|
+
A prompt's \`reasoning.level\` replaces a native effort value in \`providerOptions\`. Other \`providerOptions\` keys remain. Without a level, \`providerOptions\` apply as provided. Native effort values in a model's \`providerOptions\` remain valid.
|
|
733
|
+
|
|
734
|
+
Saved prompt input with \`reasoning.effort\` fails validation. A published package prompt with \`reasoning.effort\` loads with a warning. The runtime ignores that field.
|
|
735
|
+
|
|
701
736
|
Enable for complex reasoning tasks:
|
|
702
737
|
|
|
703
738
|
\`\`\`typescript
|
|
@@ -707,7 +742,7 @@ export default definePrompt({
|
|
|
707
742
|
model: 'heavy',
|
|
708
743
|
prompt: 'Review the code thoroughly...',
|
|
709
744
|
reasoning: {
|
|
710
|
-
|
|
745
|
+
level: 100, // 0 to 100
|
|
711
746
|
maxTokens: 16000, // Max thinking tokens
|
|
712
747
|
exclude: true, // Don't include thinking in response
|
|
713
748
|
},
|
|
@@ -718,7 +753,7 @@ export default definePrompt({
|
|
|
718
753
|
|
|
719
754
|
\`\`\`typescript
|
|
720
755
|
reasoning: {
|
|
721
|
-
|
|
756
|
+
level: 33, // 0 to 100
|
|
722
757
|
},
|
|
723
758
|
\`\`\`
|
|
724
759
|
|
|
@@ -797,8 +832,8 @@ A side's configuration is discriminated by its backing: exactly one of \`human\`
|
|
|
797
832
|
| \`label\` | \`string\` | No | Display name for this side |
|
|
798
833
|
| \`subagents\` | \`SubagentRelationship[]\` | No | Side-owned child relationships (see Subagent Relationships below) |
|
|
799
834
|
| \`stopOnResponse\` | \`boolean\` | No | Stop side turn on text response without tool calls (default: true) |
|
|
800
|
-
| \`stopTool\` | \`string\` | No | Tool that stops this side's turn |
|
|
801
|
-
| \`stopToolResponseProperty\` | \`string\` | No | Property to extract from stop tool result |
|
|
835
|
+
| \`stopTool\` | \`string\` | No | Tool that stops this side's turn when called, with or without \`stopToolResponseProperty\` |
|
|
836
|
+
| \`stopToolResponseProperty\` | \`string\` | No | Property to extract from the stop tool result. This option requires \`stopTool\`. |
|
|
802
837
|
| \`maxSteps\` | \`number\` | No | Maximum step budget for this side |
|
|
803
838
|
| \`sessionStop\` | \`SessionToolBinding\` | No | Terminal success lifecycle binding (object form only) |
|
|
804
839
|
| \`sessionFail\` | \`SessionToolBinding\` | No | Terminal failure lifecycle binding (object form only) |
|
|
@@ -913,7 +948,7 @@ sideA: {
|
|
|
913
948
|
\`\`\`
|
|
914
949
|
|
|
915
950
|
- The owning side is where child traffic lands: completion, failure, and status messages arrive on the owning side's perspective. Parent\u2192child traffic enters in the child's side B perspective (\`role: 'user'\`), so the child's side A acts on it.
|
|
916
|
-
- A relationship name (\`as\`, defaulting to \`agent\`) may appear on at most one side, must not collide with another tool name, and must not collide with the reserved lifecycle tool names \`subagents\`, \`subagent_create\`, \`subagent_message\`.
|
|
951
|
+
- A relationship name (\`as\`, defaulting to the unqualified part of \`agent\`) may appear on at most one side, must not collide with another tool name, and must not collide with the reserved lifecycle tool names \`subagents\`, \`subagent_create\`, \`subagent_message\`.
|
|
917
952
|
- For a prompt-backed owning side, the runtime injects those lifecycle tools automatically. Handler-backed owning sides need no tool grant \u2014 handlers reach children through \`ThreadState\` directly.
|
|
918
953
|
- **Persistence is universal**: every child instance is a persistent thread. Session end never terminates a thread; only explicit \`state.terminate()\` destroys an instance. \`blocking\` is purely a waiting style.
|
|
919
954
|
|
|
@@ -1201,6 +1236,10 @@ export default defineTool({
|
|
|
1201
1236
|
});
|
|
1202
1237
|
\`\`\`
|
|
1203
1238
|
|
|
1239
|
+
Tool variable definitions preserve \`scoped: true\`. A scoped variable blocks inheritance from the parent thread environment.
|
|
1240
|
+
|
|
1241
|
+
\`defineTool()\` preserves \`annotations\` unchanged.
|
|
1242
|
+
|
|
1204
1243
|
## Argument Schemas
|
|
1205
1244
|
|
|
1206
1245
|
Tool args must be a top-level \`z.object(...)\`. Prefer explicit, bounded schemas made from strings, numbers, booleans, nulls, literals, enums, arrays, objects, optionals, nullables, and defaults. Avoid provider-visible recursive or open-ended schemas such as \`z.unknown()\`, \`z.any()\`, and \`z.object({}).catchall(...)\`; strict tool providers can reject the generated JSON Schema. If a tool needs arbitrary JSON input, accept it as a JSON string and parse it inside \`execute\`.
|
|
@@ -1246,9 +1285,8 @@ execute: async (state, args) => {
|
|
|
1246
1285
|
// per-user personalization or entitlement checks. Null when user-less.
|
|
1247
1286
|
const user = await state.user();
|
|
1248
1287
|
|
|
1249
|
-
//
|
|
1250
|
-
//
|
|
1251
|
-
// only when it's applicable (progressive disclosure).
|
|
1288
|
+
// A thread sees its owner's skills and enabled shared skills.
|
|
1289
|
+
// Load a skill body when it applies. Mutations require an instance admin.
|
|
1252
1290
|
const skills = await state.skills.list();
|
|
1253
1291
|
const skill = await state.skills.get('pdf-processing');
|
|
1254
1292
|
const script = await state.skills.readFile('pdf-processing', 'scripts/extract.py');
|
|
@@ -1270,7 +1308,7 @@ execute: async (state, args) => {
|
|
|
1270
1308
|
}
|
|
1271
1309
|
\`\`\`
|
|
1272
1310
|
|
|
1273
|
-
Use \`state.runCode()\` instead of \`eval\` or \`new Function\` for model- or user-authored JavaScript/TypeScript. The sandbox starts with no ambient host capabilities; provide imports/globals explicitly, use \`modules\` for local relative ES modules, use \`execute\` to select an export and pass args, use \`report\` for streamed observations, and call \`run.terminate(reason)\` from your own timeout budget when needed. \`modules\` keys are graph-root relative paths; entry-source imports resolve from \`options.filename\` when supplied. Relative module imports may use \`./\` and \`../\` as long as they resolve within the supplied module graph. In thread endpoints, \`runCode\`
|
|
1311
|
+
Use \`state.runCode()\` instead of \`eval\` or \`new Function\` for model- or user-authored JavaScript/TypeScript. The sandbox starts with no ambient host capabilities; provide imports/globals explicitly, use \`modules\` for local relative ES modules, use \`execute\` to select an export and pass args, use \`report\` for streamed observations, and call \`run.terminate(reason)\` from your own timeout budget when needed. \`modules\` keys are graph-root relative paths; entry-source imports resolve from \`options.filename\` when supplied. Relative module imports may use \`./\` and \`../\` as long as they resolve within the supplied module graph. In thread endpoints, \`runCode\` forwards functions in imports, globals, and execution arguments as callable proxies. Call \`run.terminate(reason)\` to stop the sandbox. A caller disconnect also stops the run. When \`report\` is supplied, the host receives reports during the run and \`run.reports\` updates as reports arrive.
|
|
1274
1312
|
|
|
1275
1313
|
### Optional Runtime Streams
|
|
1276
1314
|
|
|
@@ -1513,11 +1551,11 @@ Hooks intercept and modify agent execution at specific lifecycle points.
|
|
|
1513
1551
|
| \`after_thread_created\` | \`(state: ThreadState) => void\` | Initialize a newly created thread before execution |
|
|
1514
1552
|
| \`after_subagent_created\` | \`(state: ThreadState, childState: ThreadState) => void\` | Run parent-side logic after a child thread is created |
|
|
1515
1553
|
| \`after_system_message\` | \`(state: ThreadState, systemMessage: string) => string \\| null \\| undefined\` | Modify the rendered system message before the history snapshot |
|
|
1516
|
-
| \`filter_messages\` | \`(state: ThreadState, messages: Message[]) => Message[]\` | Build the request context from one stable history snapshot per model request |
|
|
1554
|
+
| \`filter_messages\` | \`(state: ThreadState, messages: Message[]) => Message[]\` | Build the request context from one stable history snapshot per model request (only the newest window when the prompt sets \`historyLimit\`) |
|
|
1517
1555
|
| \`prefilter_llm_history\` | \`(state: ThreadState, messages: LLMMessage[]) => LLMMessage[]\` | Modify transformed provider messages before dispatch |
|
|
1518
1556
|
| \`before_create_message\` | \`(state: ThreadState, message: Message) => Message\` | Modify message before database insert |
|
|
1519
1557
|
| \`after_create_message\` | \`(state: ThreadState, message: Message) => void\` | Run logic after message created |
|
|
1520
|
-
| \`before_update_message\` | \`(state: ThreadState, id: string, updates: Record) => Record\` | Modify updates
|
|
1558
|
+
| \`before_update_message\` | \`(state: ThreadState, id: string, updates: Record) => Record\` | Modify updates for a persisted message before its update |
|
|
1521
1559
|
| \`after_update_message\` | \`(state: ThreadState, message: Message) => void\` | Run logic after message updated |
|
|
1522
1560
|
| \`before_store_tool_result\` | \`(state: ThreadState, toolCall: HookToolCall, result: HookToolResult) => HookToolResult\` | Modify tool result before storage |
|
|
1523
1561
|
| \`after_tool_call_success\` | \`(state: ThreadState, toolCall: HookToolCall, result: HookToolResult) => HookToolResult \\| null\` | Process successful tool execution |
|
|
@@ -1533,6 +1571,10 @@ first and \`HookExecutionContext\` last. The context source is prompt, agent, or
|
|
|
1533
1571
|
child provenance; child provenance includes \`relationshipName\`, resolved
|
|
1534
1572
|
\`agentName\`, and optional package signature.
|
|
1535
1573
|
|
|
1574
|
+
Packed thread hooks receive a \`ThreadState\` in their owning package namespace.
|
|
1575
|
+
Every hook can use \`state.loadPrompt('own')\` to load a package-local prompt.
|
|
1576
|
+
This includes \`before_create_message\`.
|
|
1577
|
+
|
|
1536
1578
|
## Creating a Hook
|
|
1537
1579
|
|
|
1538
1580
|
Each hook file exports a default \`defineHook\` call with three properties:
|
|
@@ -1590,6 +1632,11 @@ the current snapshot. Messages injected by either request-context hook enter the
|
|
|
1590
1632
|
following snapshot. Silent messages remain eligible unless a request-context hook removes
|
|
1591
1633
|
them.
|
|
1592
1634
|
|
|
1635
|
+
When the active prompt sets \`historyLimit\` (N), the snapshot and
|
|
1636
|
+
\`state.execution.messageHistory\` hold only the newest top-level rows: at least N
|
|
1637
|
+
and fewer than 2N, the cut moving N at a time. A hook looking for an older marker
|
|
1638
|
+
(a compaction summary, a task header) may not see it; stored history is untouched.
|
|
1639
|
+
|
|
1593
1640
|
## Create-Message Lifecycle
|
|
1594
1641
|
|
|
1595
1642
|
\`before_create_message\` and \`after_create_message\` run for runtime insertion
|
|
@@ -1844,10 +1891,16 @@ A public endpoint is reachable by anyone who has the URL \u2014 treat it like an
|
|
|
1844
1891
|
internet-facing route: validate the path, reject early, and never echo
|
|
1845
1892
|
private state to anonymous callers.
|
|
1846
1893
|
|
|
1847
|
-
Note: \`state.execution\` is always \`null\` in endpoints since the thread is at rest. \`
|
|
1894
|
+
Note: \`state.execution\` is always \`null\` in endpoints since the thread is at rest. In thread endpoints, \`runCode\` forwards functions in imports, globals, and execution arguments as callable proxies. Call \`run.terminate(reason)\` to stop the sandbox. A caller disconnect also stops the run. When \`report\` is supplied, the host receives reports during the run and \`run.reports\` updates as reports arrive. \`state.emit(event, data)\` broadcasts a custom WebSocket event from endpoints as well as active executions; use it as an invalidation hint after persisting durable state, not as a replacement for reconnect recovery.
|
|
1848
1895
|
|
|
1849
1896
|
## ThreadState Methods
|
|
1850
1897
|
|
|
1898
|
+
\`getMessages()\` returns messages newest first by default. Set \`order: 'asc'\` for oldest first.
|
|
1899
|
+
\`getMessage(id)\` finds persisted messages at any depth. It also finds pending messages from the message list. It returns \`null\` for unknown IDs.
|
|
1900
|
+
\`updateMessage(id, updates)\` updates a persisted message. It returns the updated \`Message\`.
|
|
1901
|
+
Updates to missing or pending messages fail before update hooks run.
|
|
1902
|
+
Message results include \`reasoning_content\`, \`reasoning_details\`, \`prompt\`, and available subagent fields: \`subagent_id\`, \`subagent_name\`, \`subagent_title\`, \`subagent_description\`, \`subagent_status\`, \`subagent_relationship\`, \`subagent_blocking\`, \`subagent_thread_name\`, and \`subagent_spawn_group_id\`.
|
|
1903
|
+
|
|
1851
1904
|
Access thread data through the state object:
|
|
1852
1905
|
|
|
1853
1906
|
\`\`\`typescript
|
|
@@ -1888,6 +1941,12 @@ export default defineThreadEndpoint(async (req, state) => {
|
|
|
1888
1941
|
});
|
|
1889
1942
|
\`\`\`
|
|
1890
1943
|
|
|
1944
|
+
\`state.loadModel\`, \`state.loadPrompt\`, and \`state.loadAgent\` enforce package
|
|
1945
|
+
visibility. Global code can load unpacked definitions and packed entry agents.
|
|
1946
|
+
Packed code can load its own definitions and other packages' entry agents.
|
|
1947
|
+
A packed model cannot fall back to a host model with the same short name.
|
|
1948
|
+
A refused load returns the same not-found error as a missing definition.
|
|
1949
|
+
|
|
1891
1950
|
## POST with Request Body
|
|
1892
1951
|
|
|
1893
1952
|
\`\`\`typescript
|
|
@@ -1898,7 +1957,7 @@ export default defineThreadEndpoint(async (req, state) => {
|
|
|
1898
1957
|
const body = await req.json();
|
|
1899
1958
|
const { format = 'json' } = body;
|
|
1900
1959
|
|
|
1901
|
-
const { messages } = await state.getMessages();
|
|
1960
|
+
const { messages } = await state.getMessages({ order: 'asc' });
|
|
1902
1961
|
|
|
1903
1962
|
if (format === 'csv') {
|
|
1904
1963
|
const csv = messages.map(m => \`\${m.role},\${m.content}\`).join('\\n');
|
|
@@ -2037,6 +2096,8 @@ the user event stream at \`/api/users/me/stream\`), \`listThreads()\`,
|
|
|
2037
2096
|
\`fetch(grant, url, init)\` (privileged fetch through a credential grant), and
|
|
2038
2097
|
\`thread(threadId)\` (raise one of the user's threads at rest).
|
|
2039
2098
|
|
|
2099
|
+
\`user.identity()\` returns a \`UserIdentity\`. Its \`username\` and \`role\` fields may be absent or null.
|
|
2100
|
+
|
|
2040
2101
|
## User Rooms
|
|
2041
2102
|
|
|
2042
2103
|
A \`users/pkg/room.ts\` file may export \`defineUserRoom\` to handle hub frames
|
|
@@ -2130,7 +2191,7 @@ var APPROVED_DEPENDENCY_BUILD_SCRIPTS = [
|
|
|
2130
2191
|
"sharp",
|
|
2131
2192
|
"workerd"
|
|
2132
2193
|
];
|
|
2133
|
-
var AGENTBUILDER_TEMPLATE_VERSION = "0.
|
|
2194
|
+
var AGENTBUILDER_TEMPLATE_VERSION = "0.44.0";
|
|
2134
2195
|
var DEFAULT_TEMPLATE_VERSIONS = {
|
|
2135
2196
|
standardAgents: `^${AGENTBUILDER_TEMPLATE_VERSION}`,
|
|
2136
2197
|
sip: "^1.0.1",
|