@ouispec/agent-worker 0.12.2 → 0.13.1
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 +11 -10
- package/dist/approvals/client.d.ts +2 -2
- package/dist/approvals/continuation.d.ts +2 -2
- package/dist/approvals/preview.d.ts +1 -1
- package/dist/approvals/preview.js +1 -1
- package/dist/approvals/requirement.js +1 -1
- package/dist/attachments/content.d.ts +2 -2
- package/dist/attachments/guard.js +1 -1
- package/dist/attachments/limits.d.ts +2 -2
- package/dist/attachments/limits.d.ts.map +1 -1
- package/dist/attachments/limits.js +2 -2
- package/dist/attachments/limits.js.map +1 -1
- package/dist/attachments/store.d.ts +3 -3
- package/dist/attachments/store.d.ts.map +1 -1
- package/dist/attachments/tools.js +2 -2
- package/dist/attachments/tools.js.map +1 -1
- package/dist/authz/tool-policy.d.ts +4 -4
- package/dist/authz/tool-policy.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/model.d.ts +1 -1
- package/dist/openapi/executor.d.ts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/openapi/loader.d.ts +4 -4
- package/dist/openapi/loader.js +7 -7
- package/dist/openapi/loader.js.map +1 -1
- package/dist/openapi/x-agent.d.ts +2 -2
- package/dist/openapi/x-agent.js +2 -2
- package/dist/orchestrator.d.ts +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +89 -56
- package/dist/orchestrator.js.map +1 -1
- package/dist/prompt/rules/ui-control.d.ts +3 -3
- package/dist/prompt/rules/ui-control.js +3 -3
- package/dist/prompt/spoken-input.d.ts +1 -1
- package/dist/prompt/spoken-input.js +1 -1
- package/dist/runtime/config.js +1 -1
- package/dist/runtime/turn-runner.d.ts +2 -2
- package/dist/runtime/turn-runner.d.ts.map +1 -1
- package/dist/runtime/turn-runner.js +6 -5
- package/dist/runtime/turn-runner.js.map +1 -1
- package/dist/runtime/types.d.ts +21 -15
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/stop/partial.d.ts +1 -1
- package/dist/stop/partial.js +1 -1
- package/dist/stop/results.d.ts +1 -1
- package/dist/stop/turn-stop.d.ts +3 -3
- package/dist/stop/turn-stop.d.ts.map +1 -1
- package/dist/stop/turn-stop.js +1 -1
- package/dist/stop/turn-stop.js.map +1 -1
- package/dist/testing/desk-events.d.ts +1 -1
- package/dist/testing/desk-events.js +1 -1
- package/dist/time-hand-back.d.ts +49 -0
- package/dist/time-hand-back.d.ts.map +1 -0
- package/dist/time-hand-back.js +49 -0
- package/dist/time-hand-back.js.map +1 -0
- package/dist/tools/async-binding.d.ts +1 -1
- package/dist/tools/builtin-tools.d.ts +3 -3
- package/dist/tools/entity-tools.d.ts.map +1 -1
- package/dist/tools/entity-tools.js +0 -1
- package/dist/tools/entity-tools.js.map +1 -1
- package/dist/tools/load-all-tools.d.ts.map +1 -1
- package/dist/tools/load-all-tools.js +0 -1
- package/dist/tools/load-all-tools.js.map +1 -1
- package/dist/tools/schema-loader.d.ts.map +1 -1
- package/dist/tools/schema-loader.js +1 -2
- package/dist/tools/schema-loader.js.map +1 -1
- package/dist/tools/types.d.ts +9 -9
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/turn-ledger.d.ts +1 -1
- package/dist/turn-ledger.js +1 -1
- package/dist/types.d.ts +21 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/answer-image.d.ts +1 -1
- package/dist/ui/answer-image.js +1 -1
- package/dist/ui/channel.d.ts +1 -1
- package/dist/ui/knowledge.d.ts +2 -2
- package/dist/ui/observations.d.ts +2 -2
- package/dist/ui/observations.js +2 -2
- package/dist/ui/outline.d.ts +1 -1
- package/dist/ui/outline.js +1 -1
- package/dist/ui/page-index.d.ts +1 -1
- package/dist/ui/page-index.js +1 -1
- package/dist/ui/snapshot.d.ts +2 -2
- package/dist/ui/snapshot.d.ts.map +1 -1
- package/dist/ui/ui-tools.d.ts +1 -1
- package/dist/ui/ui-tools.js +8 -8
- package/dist/ui/ui-tools.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ouispec/agent-worker
|
|
2
2
|
|
|
3
|
-
The agent runtime. One core runs a turn: the model, the tool loop, UI actions answered by the user's own tab
|
|
3
|
+
The agent runtime. One core runs a turn: the model, the tool loop, UI actions answered by the user's own tab, streaming, retries and deadlines. Two host adapters run that core: Lambda + SQS, and a long-running container.
|
|
4
4
|
|
|
5
5
|
## What the host supplies
|
|
6
6
|
|
|
@@ -22,6 +22,7 @@ Optional tuning, with its defaults:
|
|
|
22
22
|
- `forcedToolChoice`: true. Set `false` for a model that refuses a forced tool choice (Claude Sonnet 5.5 answers 400 to one): a step the turn policy forces to a tool is given only that tool and told to call it.
|
|
23
23
|
- `toolTimeoutMs`: 30 s
|
|
24
24
|
- `turnDeadlineMs`: 14 min (keep it below your host's own limit)
|
|
25
|
+
- `handBackReserveMs`: 30 s, at most a quarter of `turnDeadlineMs`. Before each step the worker checks that a step as long as the turn's longest so far, plus this reserve, still fits before the deadline. When it does not, that step is the turn's last: the model is told to say what is done and what is left and to offer to continue (with `present_options` when the host gives it, in words otherwise), the host's turn policy is not asked about it, and the turn ends with `stopReason: 'time_limit'`. The deadline itself still stops a step that runs longer than any before it.
|
|
25
26
|
- `retries`: 3
|
|
26
27
|
|
|
27
28
|
A host that fits its stored history loads `@ouispec/agent-worker/history` (`answerWithoutState`): a module with no runtime imports, which also answers a CommonJS resolver.
|
|
@@ -34,9 +35,9 @@ Three keys on the turn's `context` are for the worker itself, and your persona o
|
|
|
34
35
|
|
|
35
36
|
| Key | What the tab puts there | What the worker does with it |
|
|
36
37
|
|---|---|---|
|
|
37
|
-
| `oui` | Its surface snapshot: `ouiRuntime.snapshot()`
|
|
38
|
+
| `oui` | Its surface snapshot: `ouiRuntime.snapshot()` | Builds the turn's UI tools from it, and from nothing else |
|
|
38
39
|
| `uiKnowledge` | Its generated knowledge for the page the user is on: `resolveKnowledge(generatedKnowledge, path)` from `@ouispec/bindings` | Renders it after your prompt: each entry under "Platform Knowledge", then each recipe under "Active Workflows" |
|
|
39
|
-
| `input` | How the person entered the message, when they did not type it: `{ mode: 'voice', language }` for one they spoke, with the language the recogniser detected
|
|
40
|
+
| `input` | How the person entered the message, when they did not type it: `{ mode: 'voice', language }` for one they spoke, with the language the recogniser detected. `@ouispec/agent-react` sets it from `sendMessage(text, { input })` | Adds one line to the turn's user message, after the person's words: the message was spoken and machine-transcribed, so it may contain recognition errors; the language; and to ask rather than guess when a likely mis-hearing makes the request ambiguous. An unknown mode is read as typed, and a language that is not a BCP 47 tag of at most 16 characters is left out (`readMessageInput` in `@ouispec/agent-core`). A typed message, and the turn an approval card's click starts, get nothing |
|
|
40
41
|
|
|
41
42
|
`timeZone` (the user's IANA zone, which `@ouispec/agent-react` sends with every turn) is read by the worker too: the date and time on the user's clock are added to the turn's user message.
|
|
42
43
|
|
|
@@ -44,7 +45,7 @@ What the worker adds to the user's message goes on the newest user message only,
|
|
|
44
45
|
|
|
45
46
|
Every other key is the page's context, which a persona prompt shows as the current UI state. A malformed `oui` or `uiKnowledge` fails the turn, naming the bad field. The worker logs `UI surfaces for this turn` with the surface ids and the knowledge's entry and workflow counts.
|
|
46
47
|
|
|
47
|
-
## Approvals
|
|
48
|
+
## Approvals
|
|
48
49
|
|
|
49
50
|
An irreversible action runs only on an approval the user gave, bound to the exact call. A call needs approval when:
|
|
50
51
|
|
|
@@ -79,7 +80,7 @@ What a stopped turn does:
|
|
|
79
80
|
|
|
80
81
|
A stop that arrives once the turn has begun its own end is not one: the turn completes as it would have.
|
|
81
82
|
|
|
82
|
-
A turn that reaches its deadline (`turnDeadlineMs`) ends on the same path, with `stopReason: 'deadline'`: what it did before it ran out of time is kept, marked, and the next turn is told. If its store fails or does not finish in time, nothing of it was kept: the runner records it with `recordTurnFailure` as `TURN_DEADLINE_EXCEEDED`, and its outcome carries `stored: false`. A store that timed out may still finish after that, so record the failure only over a turn that is still running (a conditional update from `running`).
|
|
83
|
+
A turn that runs short of time normally ends before its deadline, with a last step that says what is done (`handBackReserveMs` above). A turn that reaches its deadline anyway (`turnDeadlineMs`) ends on the same path, with `stopReason: 'deadline'`: what it did before it ran out of time is kept, marked, and the next turn is told. If its store fails or does not finish in time, nothing of it was kept: the runner records it with `recordTurnFailure` as `TURN_DEADLINE_EXCEEDED`, and its outcome carries `stored: false`. A store that timed out may still finish after that, so record the failure only over a turn that is still running (a conditional update from `running`).
|
|
83
84
|
|
|
84
85
|
For a message sent while a turn is running (a barge-in), your API stops the running turn (`POST /internal/turns/:turnId/stop` with `superseded`), withdraws a waiting approval (`settle` with `expire`), and puts the ids of the turns it stopped on the new turn's payload as `supersedes`. The hooks then let you order the two:
|
|
85
86
|
|
|
@@ -177,7 +178,7 @@ Your API sends turns to the worker's HTTP endpoints:
|
|
|
177
178
|
|
|
178
179
|
## API tools from an OpenAPI document
|
|
179
180
|
|
|
180
|
-
`loadOpenApiTools` turns the product's own OpenAPI 3 document into tools for backend, MCP and external agents
|
|
181
|
+
`loadOpenApiTools` turns the product's own OpenAPI 3 document into tools for backend, MCP and external agents. There is no second manifest format. It is also exported at `@ouispec/agent-worker/openapi`.
|
|
181
182
|
|
|
182
183
|
```ts
|
|
183
184
|
import { loadOpenApiTools } from '@ouispec/agent-worker/openapi';
|
|
@@ -194,21 +195,21 @@ An operation opts in per operation, with `x-agent`:
|
|
|
194
195
|
| Key | Meaning |
|
|
195
196
|
|---|---|
|
|
196
197
|
| `expose: true` | The operation is a tool. Without it, it is not offered. |
|
|
197
|
-
| `effect` | What calling it changes
|
|
198
|
+
| `effect` | What calling it changes: `view` (a read), `file`, `mutate`, `job` or `transaction`, or the effect's object form. `selection`, `navigate`, `open` and `edit` are a page's effects and are refused. |
|
|
198
199
|
| `destructive: true` | On a write: it removes or replaces something the person made. |
|
|
199
200
|
| `consequence` | A sentence saying what happens. It goes in the description, and in an approval's preview. |
|
|
200
|
-
| `pa: true` | The product's own assistant may call it. Allowed only on a read
|
|
201
|
+
| `pa: true` | The product's own assistant may call it. Allowed only on a read. |
|
|
201
202
|
|
|
202
203
|
Each tool:
|
|
203
204
|
- is named by the operation's `operationId`, and described by its `summary` and `description`;
|
|
204
205
|
- takes its parameters and JSON body as input, with `$ref`s inlined, 3.0 `nullable` read as `null`, and `readOnly` fields left out. A closed object body's fields sit beside the parameters; any other body is the `body` property. The input refuses undeclared properties, and the worker validates every call against it;
|
|
205
206
|
- carries `effect` and `destructive` for approvals to key on, and its operation's standard `security` requirement as the permissions it needs;
|
|
206
207
|
- calls the API with the headers `actAs` returns, so the API treats the call as that caller. A permission the caller lacks comes back as the route's own refusal. The tool returns it as its error, with the status and body, and the model reads it;
|
|
207
|
-
- runs a `transaction` only with the person's approval of that exact call
|
|
208
|
+
- runs a `transaction` only with the person's approval of that exact call: the worker's approval card supplies it, and its title and consequence come from the operation's `summary` and `x-agent.consequence`. Without one, as over MCP, it returns `APPROVAL_REQUIRED` and sends nothing.
|
|
208
209
|
|
|
209
210
|
Refused at load, naming the operation: `pa` on anything but a read, a missing or invalid `operationId`, a missing `effect`, an unknown `x-agent` key, `destructive` on a read, a read on `PUT`, `PATCH` or `DELETE`, no security requirement (use `[]` for a public operation), an undeclared security scheme, a non-JSON body, a self-referencing or external `$ref`, and a path whose template and parameters disagree.
|
|
210
211
|
|
|
211
|
-
**Async operations
|
|
212
|
+
**Async operations.** An operation that starts a job names the declared completion it ends with, in `x-async-binding`:
|
|
212
213
|
|
|
213
214
|
```yaml
|
|
214
215
|
x-agent: { expose: true, effect: job }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The worker's side of the approval store
|
|
2
|
+
* The worker's side of the approval store, which lives in the
|
|
3
3
|
* realtime server beside the UI action result store. The worker stores a
|
|
4
4
|
* pending approval when it stops a turn, redeems the token the next turn
|
|
5
5
|
* carries, and reads a decline.
|
|
@@ -28,7 +28,7 @@ export interface ApprovalStoreClient {
|
|
|
28
28
|
*/
|
|
29
29
|
confirmExpirySettled?(approvalId: string, owner: ApprovalOwner): Promise<void>;
|
|
30
30
|
/**
|
|
31
|
-
* Expire an approval now, saying why
|
|
31
|
+
* Expire an approval now, saying why: the turn that asked
|
|
32
32
|
* for it was stopped, so its card must not stay live. Optional: a store
|
|
33
33
|
* without it leaves the approval to its time limit. Rejects when the store
|
|
34
34
|
* cannot be reached.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The turn after a decision
|
|
2
|
+
* The turn after a decision. It carries, outside the
|
|
3
3
|
* message text, the token to redeem or that the user declined. The worker
|
|
4
4
|
* asks the store — never the client — what was decided, runs exactly the
|
|
5
5
|
* stored call when there is one, and tells the model what happened in an
|
|
@@ -42,7 +42,7 @@ export interface ApprovalMarker {
|
|
|
42
42
|
/** The user approved it, and the approval expired before the call ran. */
|
|
43
43
|
expired?: true;
|
|
44
44
|
/**
|
|
45
|
-
* The approval did not run out of time: it was withdrawn
|
|
45
|
+
* The approval did not run out of time: it was withdrawn,
|
|
46
46
|
* because the user sent a new message while it waited, or stopped the turn
|
|
47
47
|
* that asked for it.
|
|
48
48
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The approval card's words
|
|
2
|
+
* The approval card's words. Every one comes from the
|
|
3
3
|
* tool's declaration — its title, its description, its input schema's labels —
|
|
4
4
|
* and the call's arguments. None comes from the model: the model chooses the
|
|
5
5
|
* call, never how it is described to the person approving it.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The approval card's words
|
|
2
|
+
* The approval card's words. Every one comes from the
|
|
3
3
|
* tool's declaration — its title, its description, its input schema's labels —
|
|
4
4
|
* and the call's arguments. None comes from the model: the model chooses the
|
|
5
5
|
* call, never how it is described to the person approving it.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What a tool's declaration says about approval
|
|
2
|
+
* What a tool's declaration says about approval, for every
|
|
3
3
|
* kind of tool the worker runs: a UI action from the client's surfaces, a
|
|
4
4
|
* generated API tool (its effect from the operation's `x-agent`), a host tool.
|
|
5
5
|
* The rule itself is OUI's `requiresApproval` (through oui-bindings), which the browser applies too; a host's
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The files of the turn's message, as the model is given them
|
|
2
|
+
* The files of the turn's message, as the model is given them,
|
|
3
3
|
* and history's reference to every earlier one.
|
|
4
4
|
*
|
|
5
|
-
* - An image: the platform's model rendition, as a file part
|
|
5
|
+
* - An image: the platform's model rendition, as a file part.
|
|
6
6
|
* - Text, and a PDF's text: up to 20,000 characters a file and 40,000 a turn,
|
|
7
7
|
* with a note of how much was left out.
|
|
8
8
|
* - A short PDF as a document part, when the host turns that on.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What the model is given of a file, in one place
|
|
2
|
+
* What the model is given of a file, in one place.
|
|
3
3
|
*
|
|
4
4
|
* Ours, and the tighter of ours and the provider's. Claude on Amazon Bedrock
|
|
5
5
|
* through the Converse API (checked 2026-10-06, "Message", Bedrock API
|
|
@@ -34,7 +34,7 @@ export declare const PDF_DOCUMENT_MAX_PAGES = 20;
|
|
|
34
34
|
export declare const PDF_DOCUMENT_MAX_BYTES: number;
|
|
35
35
|
/** The provider's limit on documents in one message. */
|
|
36
36
|
export declare const PROVIDER_MAX_DOCUMENTS = 5;
|
|
37
|
-
/** The cost guard's caps on attachment input, in estimated tokens
|
|
37
|
+
/** The cost guard's caps on attachment input, in estimated tokens. */
|
|
38
38
|
export declare const DEFAULT_TURN_ATTACHMENT_TOKENS = 30000;
|
|
39
39
|
export declare const DEFAULT_CONVERSATION_ATTACHMENT_TOKENS = 300000;
|
|
40
40
|
/** An image's tokens as Claude counts them: about one per 750 pixels, at the size it is given. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/attachments/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sGAAsG;AACtG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,QAAc,CAAC;AACjD,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,oDAAqD,CAAC;AAC1F;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASjF;AAED,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,QAAoB,CAAC;AACxD,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/attachments/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sGAAsG;AACtG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,QAAc,CAAC;AACjD,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,oDAAqD,CAAC;AAC1F;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASjF;AAED,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,QAAoB,CAAC;AACxD,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,sEAAsE;AACtE,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,sCAAsC,SAAU,CAAC;AAE9D,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAIzF;AAED,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEnE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What the model is given of a file, in one place
|
|
2
|
+
* What the model is given of a file, in one place.
|
|
3
3
|
*
|
|
4
4
|
* Ours, and the tighter of ours and the provider's. Claude on Amazon Bedrock
|
|
5
5
|
* through the Converse API (checked 2026-10-06, "Message", Bedrock API
|
|
@@ -43,7 +43,7 @@ export const PDF_DOCUMENT_MAX_PAGES = 20;
|
|
|
43
43
|
export const PDF_DOCUMENT_MAX_BYTES = 4.5 * 1024 * 1024;
|
|
44
44
|
/** The provider's limit on documents in one message. */
|
|
45
45
|
export const PROVIDER_MAX_DOCUMENTS = 5;
|
|
46
|
-
/** The cost guard's caps on attachment input, in estimated tokens
|
|
46
|
+
/** The cost guard's caps on attachment input, in estimated tokens. */
|
|
47
47
|
export const DEFAULT_TURN_ATTACHMENT_TOKENS = 30_000;
|
|
48
48
|
export const DEFAULT_CONVERSATION_ATTACHMENT_TOKENS = 300_000;
|
|
49
49
|
/** An image's tokens as Claude counts them: about one per 750 pixels, at the size it is given. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/attachments/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,sGAAsG;AACtG,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AACzC,sFAAsF;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAU,CAAC;AAC1F;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,KAAa;IAChE,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACxE,IAAI,CAAE,uBAA6C,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnE,OAAO,kBAAkB,IAAI,IAAI,YAAY,+BAA+B,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACnH,CAAC;IACD,IAAI,KAAK,GAAG,qBAAqB,EAAE,CAAC;QAClC,OAAO,kBAAkB,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,qBAAqB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAC1I,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,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C,GAAG,GAAG,CAAC,CAAC;AACnF,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IACzD,OAAO,CAAC,KAAK,IAAI,sBAAsB,CAAC,GAAG,KAAK,CAAC;AACnD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The host's file area, as the worker reads it
|
|
2
|
+
* The host's file area, as the worker reads it. The worker never
|
|
3
3
|
* holds a URL or a key: it asks the host for a file by id, for the turn's own
|
|
4
4
|
* conversation and user, and the host checks the file is theirs on every call.
|
|
5
5
|
*/
|
|
@@ -73,11 +73,11 @@ export interface AttachmentWorkerConfig {
|
|
|
73
73
|
turnTokens?: number;
|
|
74
74
|
/** Estimated tokens of attachment input one conversation may give the model. Default 300,000. */
|
|
75
75
|
conversationTokens?: number;
|
|
76
|
-
/** Files one message gives the model; any more are named as not given. Default 5
|
|
76
|
+
/** Files one message gives the model; any more are named as not given. Default 5. */
|
|
77
77
|
perMessage?: number;
|
|
78
78
|
/**
|
|
79
79
|
* Give a short PDF to the model as a document part. Off until a live eval
|
|
80
|
-
* of the provider's document part passes
|
|
80
|
+
* of the provider's document part passes: a PDF then goes
|
|
81
81
|
* as its extracted text, which is complete without it.
|
|
82
82
|
*/
|
|
83
83
|
pdfAsDocument?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/attachments/store.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,+GAA+G;AAC/G,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB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AAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACzH;;;;OAIG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,eAAe,EACtB,EAAE,EAAE,gBAAgB,EACpB,OAAO,CAAC,EAAE,0BAA0B,GAAG;QAAE,KAAK,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GACnF,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9B,4GAA4G;IAC5G,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7F;;;OAGG;IACH,iBAAiB,CAAC,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnG;AAED,0FAA0F;AAC1F,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iGAAiG;IACjG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The attachment tools
|
|
2
|
+
* The attachment tools: how the assistant comes back to a
|
|
3
3
|
* file after the message it came with, by its id.
|
|
4
4
|
*
|
|
5
5
|
* - `attachment_list`: the conversation's files, so "the logo I sent earlier"
|
|
@@ -196,7 +196,7 @@ export function attachmentTools(context) {
|
|
|
196
196
|
leftOutLine: `${attachmentReferenceLine(ref)} The text read from it is not repeated from here on, to keep within the allowance for files. Read it again if needed.`,
|
|
197
197
|
});
|
|
198
198
|
const end = offset + text.length;
|
|
199
|
-
// The text is the model's, with this result, and nothing else's
|
|
199
|
+
// The text is the model's, with this result, and nothing else's: what is
|
|
200
200
|
// emitted, recorded and stored says which characters were read, never what they say.
|
|
201
201
|
return {
|
|
202
202
|
success: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/attachments/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAsB,MAAM,qBAAqB,CAAC;AAIlG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5F,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAE3E,MAAM,IAAI,GAAG,CAAC,KAAa,EAAuB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAEjF,SAAS,QAAQ,CAAC,KAAiB;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1F,CAAC;AAED,4FAA4F;AAC5F,SAAS,UAAU,CAAC,GAAyB,EAAE,GAAY;IACzD,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAC7D,MAAM,OAAO,GAAG,GAAG,YAAY,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|
|
25
25
|
hasSideEffects: boolean;
|
|
26
26
|
/**
|
|
27
|
-
* `ui` for an action on the client's UI
|
|
27
|
+
* `ui` for an action on the client's UI, which runs in the
|
|
28
28
|
* user's browser under their own session; `backend` for a host tool.
|
|
29
29
|
* Decide by this, not by the name: a UI action id can equal a host tool's.
|
|
30
30
|
*/
|
|
31
31
|
toolKind: 'ui' | 'backend';
|
|
32
32
|
/**
|
|
33
33
|
* The SDK's class for a tool it owns: `attachment` for the attachment tools
|
|
34
|
-
|
|
34
|
+
*. A policy that admits by name should admit the class too,
|
|
35
35
|
* so a tool the SDK adds to it later needs no change.
|
|
36
36
|
*/
|
|
37
37
|
toolClass?: 'attachment';
|
|
38
|
-
/** What the tool declares it does
|
|
38
|
+
/** What the tool declares it does; undefined when it declares nothing, which counts as a write. */
|
|
39
39
|
effect: ToolEffect | undefined;
|
|
40
40
|
/** Whether the tool declares it removes or replaces something the person made. */
|
|
41
41
|
destructive: boolean;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* - `allow`: run it. A `transaction` or destructive call still needs the
|
|
45
|
-
* user's approval
|
|
45
|
+
* user's approval: no policy waives that.
|
|
46
46
|
* - `deny`: never run it. Approval never overrides a deny.
|
|
47
47
|
* - `require_approval`: run it only on the user's approval of this exact call,
|
|
48
48
|
* given on the approval card (or a conversation channel's readback). The
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-policy.d.ts","sourceRoot":"","sources":["../../src/authz/tool-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;GAOG;AAEH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,SAAS,EAAE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AAA;CAAE,GACnB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAE/B,CAAC;AAEF;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAU7B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @ouispec/agent-worker — the agent runtime.
|
|
3
3
|
*
|
|
4
4
|
* Hosts provide: the model (any `ai` provider), the realtime server, the
|
|
5
|
-
* persona, tools and persistence callbacks
|
|
5
|
+
* persona, tools and persistence callbacks.
|
|
6
6
|
* The worker handles: the multi-round tool loop, UI actions, streaming,
|
|
7
7
|
* retries and timeouts, on Lambda + SQS or in a container.
|
|
8
8
|
*/
|
package/dist/index.js
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* @ouispec/agent-worker — the agent runtime.
|
|
3
3
|
*
|
|
4
4
|
* Hosts provide: the model (any `ai` provider), the realtime server, the
|
|
5
|
-
* persona, tools and persistence callbacks
|
|
5
|
+
* persona, tools and persistence callbacks.
|
|
6
6
|
* The worker handles: the multi-round tool loop, UI actions, streaming,
|
|
7
7
|
* retries and timeouts, on Lambda + SQS or in a container.
|
|
8
8
|
*/
|
|
9
9
|
export { createToolRegistry } from './tools/types.js';
|
|
10
10
|
export { loadToolsFromSchema } from './tools/schema-loader.js';
|
|
11
|
-
// Async tools wait on the product's declared events
|
|
11
|
+
// Async tools wait on the product's declared events
|
|
12
12
|
export { bindAsyncTool, awaitAsyncTool } from './tools/async-binding.js';
|
|
13
13
|
export { createHttpEventWaiter } from './events/http-waiter.js';
|
|
14
14
|
export { loadEntityToolsFromSchema } from './tools/entity-tools.js';
|
|
15
15
|
export { loadBuiltinTools } from './tools/builtin-tools.js';
|
|
16
16
|
export { loadAllTools } from './tools/load-all-tools.js';
|
|
17
17
|
export { createToolInputValidator } from './tools/input-validation.js';
|
|
18
|
-
// API tools generated from any OpenAPI 3 document
|
|
18
|
+
// API tools generated from any OpenAPI 3 document, each call acting
|
|
19
19
|
// as the caller the host's actAs seam names. Also at `/openapi`.
|
|
20
20
|
export { loadOpenApiTools, OpenApiToolError, API_OPERATION_EFFECTS } from './openapi/index.js';
|
|
21
21
|
export { defaultToolPolicy, evaluateToolPolicySafe } from './authz/tool-policy.js';
|
|
22
|
-
// Approvals
|
|
22
|
+
// Approvals: an irreversible action runs only on an approval the
|
|
23
23
|
// user gave, bound to the call, kept by the realtime server's approval store.
|
|
24
24
|
export { createHttpApprovalStoreClient } from './approvals/client.js';
|
|
25
25
|
export { approvalRequirement, APPROVAL_TOOL_NOTE } from './approvals/requirement.js';
|
|
26
26
|
export { buildApprovalPreview } from './approvals/preview.js';
|
|
27
|
-
// Stopping a turn
|
|
27
|
+
// Stopping a turn: the person's Stop, or a newer message that
|
|
28
28
|
// supersedes the turn, is kept by the realtime server and asked for by the
|
|
29
29
|
// turn. What the turn had produced is stored, then announced.
|
|
30
30
|
export { createHttpTurnStopClient, watchTurnStop, stopOf, TurnStopped, DEFAULT_STOP_GRACE_MS } from './stop/turn-stop.js';
|
|
@@ -44,7 +44,7 @@ export { createUISequence } from './ui/ui-sequence.js';
|
|
|
44
44
|
export { runAgentTurn } from './orchestrator.js';
|
|
45
45
|
// The model seam: any `ai` library model; the worker imports no provider.
|
|
46
46
|
export { PROMPT_CACHE_BREAKPOINTS, describeModel } from './model.js';
|
|
47
|
-
// An answer as the model is sent it and as it is stored, for a host that fits answers stored before 0.11
|
|
47
|
+
// An answer as the model is sent it and as it is stored, for a host that fits answers stored before 0.11.
|
|
48
48
|
export { answerWithoutState } from './ui/page-state-at-end.js';
|
|
49
49
|
export { defaultTurnPolicy } from './turn-policy.js';
|
|
50
50
|
export { createHttpEmitAdapter } from './emit/http-adapter.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,oDAAoD;AACpD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,oEAAoE;AACpE,iEAAiE;AACjE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAkB/F,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,iEAAiE;AACjE,8EAA8E;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE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gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAevD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,0EAA0E;AAC1E,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,0GAA0G;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,qEAAqE;AACrE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAE1H,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,mBAAmB;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAU3D,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/model.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface OperationRef {
|
|
|
35
35
|
* Who a call acts as: the headers that make the API treat it as that caller.
|
|
36
36
|
*
|
|
37
37
|
* It is required and has no default. A product passes its own mechanism, such as a
|
|
38
|
-
* signed assertion naming the user
|
|
38
|
+
* signed assertion naming the user, or the credential an
|
|
39
39
|
* MCP client authenticated with.
|
|
40
40
|
*/
|
|
41
41
|
export type ActAs = (ctx: ToolExecutionContext, operation: OperationRef) => Record<string, string> | Promise<Record<string, string>>;
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* API tools generated from any OpenAPI 3 document
|
|
2
|
+
* API tools generated from any OpenAPI 3 document: the loader, the
|
|
3
3
|
* executor's auth seam, and the input validator every generated tool is checked with.
|
|
4
4
|
*/
|
|
5
5
|
export { loadOpenApiTools } from './loader.js';
|
package/dist/openapi/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* API tools generated from any OpenAPI 3 document
|
|
2
|
+
* API tools generated from any OpenAPI 3 document: the loader, the
|
|
3
3
|
* executor's auth seam, and the input validator every generated tool is checked with.
|
|
4
4
|
*/
|
|
5
5
|
export { loadOpenApiTools } from './loader.js';
|
package/dist/openapi/loader.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* loadOpenApiTools — a product's OpenAPI 3 document becomes its agent tools
|
|
3
|
-
|
|
3
|
+
*. No second manifest format: the document is read directly.
|
|
4
4
|
*
|
|
5
5
|
* - An operation is a tool only when its `x-agent` says `expose: true`.
|
|
6
6
|
* - Its name is its `operationId`; its description its `summary` and `description`;
|
|
7
7
|
* its input its parameters and JSON request body, validated by the worker before
|
|
8
8
|
* every call.
|
|
9
9
|
* - Its effect and `destructive` come from `x-agent`, and are on the tool for
|
|
10
|
-
* approvals to key on
|
|
10
|
+
* approvals to key on.
|
|
11
11
|
* - Its required permissions are its standard `security` requirement.
|
|
12
12
|
* - A call runs as the caller the required `actAs` seam names, and the API decides
|
|
13
13
|
* what that caller may do.
|
|
14
14
|
* - The product's own assistant (`audience: 'pa'`) gets only the operations flagged
|
|
15
|
-
* `pa: true`, and the flag is refused on anything but a read
|
|
15
|
+
* `pa: true`, and the flag is refused on anything but a read.
|
|
16
16
|
* - An operation that starts a job names its declared completion event in
|
|
17
|
-
* `x-async-binding
|
|
17
|
+
* `x-async-binding`. It is checked against the product's declarations at
|
|
18
18
|
* load, and with a waiter the tool waits for the job to settle.
|
|
19
19
|
*
|
|
20
20
|
* Anything that cannot become a safe, callable tool is refused at load, naming the
|
package/dist/openapi/loader.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* loadOpenApiTools — a product's OpenAPI 3 document becomes its agent tools
|
|
3
|
-
|
|
3
|
+
*. No second manifest format: the document is read directly.
|
|
4
4
|
*
|
|
5
5
|
* - An operation is a tool only when its `x-agent` says `expose: true`.
|
|
6
6
|
* - Its name is its `operationId`; its description its `summary` and `description`;
|
|
7
7
|
* its input its parameters and JSON request body, validated by the worker before
|
|
8
8
|
* every call.
|
|
9
9
|
* - Its effect and `destructive` come from `x-agent`, and are on the tool for
|
|
10
|
-
* approvals to key on
|
|
10
|
+
* approvals to key on.
|
|
11
11
|
* - Its required permissions are its standard `security` requirement.
|
|
12
12
|
* - A call runs as the caller the required `actAs` seam names, and the API decides
|
|
13
13
|
* what that caller may do.
|
|
14
14
|
* - The product's own assistant (`audience: 'pa'`) gets only the operations flagged
|
|
15
|
-
* `pa: true`, and the flag is refused on anything but a read
|
|
15
|
+
* `pa: true`, and the flag is refused on anything but a read.
|
|
16
16
|
* - An operation that starts a job names its declared completion event in
|
|
17
|
-
* `x-async-binding
|
|
17
|
+
* `x-async-binding`. It is checked against the product's declarations at
|
|
18
18
|
* load, and with a waiter the tool waits for the job to settle.
|
|
19
19
|
*
|
|
20
20
|
* Anything that cannot become a safe, callable tool is refused at load, naming the
|
|
@@ -152,7 +152,7 @@ function buildInput(path, parameters, requestBody, resolver, where) {
|
|
|
152
152
|
type: 'object',
|
|
153
153
|
properties,
|
|
154
154
|
...(required.length > 0 ? { required } : {}),
|
|
155
|
-
// A tool accepts exactly what its operation declares
|
|
155
|
+
// A tool accepts exactly what its operation declares.
|
|
156
156
|
additionalProperties: false,
|
|
157
157
|
},
|
|
158
158
|
placements,
|
|
@@ -313,7 +313,7 @@ export function loadOpenApiTools(document, options) {
|
|
|
313
313
|
inputSchema: input.schema,
|
|
314
314
|
effect,
|
|
315
315
|
destructive: exposure.destructive,
|
|
316
|
-
// The approval card's title and consequence come from the operation
|
|
316
|
+
// The approval card's title and consequence come from the operation.
|
|
317
317
|
title: summary || operationId,
|
|
318
318
|
...(exposure.consequence ? { consequence: exposure.consequence } : {}),
|
|
319
319
|
operation: {
|
|
@@ -336,7 +336,7 @@ export function loadOpenApiTools(document, options) {
|
|
|
336
336
|
},
|
|
337
337
|
async execute(args, ctx) {
|
|
338
338
|
// An irreversible act runs only on the person's approval of this exact call
|
|
339
|
-
|
|
339
|
+
//. The worker runs it with that approval once the person gave it;
|
|
340
340
|
// any other runner (an MCP server, a host calling the tool itself) has none.
|
|
341
341
|
if (irreversible && !ctx.approval) {
|
|
342
342
|
return {
|