@ouispec/agent-worker 0.16.0 → 0.18.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/README.md +42 -2
- package/dist/approvals/client.d.ts +5 -1
- package/dist/approvals/client.d.ts.map +1 -1
- package/dist/approvals/client.js +3 -2
- package/dist/approvals/client.js.map +1 -1
- package/dist/approvals/continuation.d.ts +2 -1
- package/dist/approvals/continuation.d.ts.map +1 -1
- package/dist/approvals/continuation.js +2 -1
- package/dist/approvals/continuation.js.map +1 -1
- package/dist/approvals/requirement.d.ts +29 -1
- package/dist/approvals/requirement.d.ts.map +1 -1
- package/dist/approvals/requirement.js +29 -1
- package/dist/approvals/requirement.js.map +1 -1
- package/dist/conversations/client.d.ts +44 -0
- package/dist/conversations/client.d.ts.map +1 -0
- package/dist/conversations/client.js +49 -0
- package/dist/conversations/client.js.map +1 -0
- package/dist/history.d.ts +10 -1
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +20 -6
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/live-call/handler.d.ts +12 -2
- package/dist/live-call/handler.d.ts.map +1 -1
- package/dist/live-call/handler.js +31 -3
- package/dist/live-call/handler.js.map +1 -1
- package/dist/live-call/protocol.d.ts +5 -2
- package/dist/live-call/protocol.d.ts.map +1 -1
- package/dist/live-call/protocol.js.map +1 -1
- package/dist/openapi/executor.d.ts +0 -7
- package/dist/openapi/executor.d.ts.map +1 -1
- package/dist/openapi/executor.js +17 -0
- package/dist/openapi/executor.js.map +1 -1
- package/dist/openapi/loader.d.ts +2 -1
- package/dist/openapi/loader.d.ts.map +1 -1
- package/dist/openapi/loader.js +8 -1
- package/dist/openapi/loader.js.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +103 -12
- package/dist/orchestrator.js.map +1 -1
- package/dist/runtime/turn-info.d.ts +22 -2
- package/dist/runtime/turn-info.d.ts.map +1 -1
- package/dist/runtime/turn-info.js +6 -11
- package/dist/runtime/turn-info.js.map +1 -1
- package/dist/runtime/turn-runner.d.ts +15 -2
- package/dist/runtime/turn-runner.d.ts.map +1 -1
- package/dist/runtime/turn-runner.js +38 -8
- package/dist/runtime/turn-runner.js.map +1 -1
- package/dist/runtime/types.d.ts +16 -2
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/stop/partial.d.ts +3 -1
- package/dist/stop/partial.d.ts.map +1 -1
- package/dist/stop/partial.js +10 -5
- package/dist/stop/partial.js.map +1 -1
- package/dist/stop/turn-stop.d.ts +9 -4
- package/dist/stop/turn-stop.d.ts.map +1 -1
- package/dist/stop/turn-stop.js +14 -9
- package/dist/stop/turn-stop.js.map +1 -1
- package/dist/testing/cassette.d.ts +44 -0
- package/dist/testing/cassette.d.ts.map +1 -0
- package/dist/testing/cassette.js +72 -0
- package/dist/testing/cassette.js.map +1 -0
- package/dist/testing/index.d.ts +7 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +5 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/scripted.d.ts +64 -0
- package/dist/testing/scripted.d.ts.map +1 -0
- package/dist/testing/scripted.js +89 -0
- package/dist/testing/scripted.js.map +1 -0
- package/dist/tools/types.d.ts +31 -4
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/ui-tools.d.ts.map +1 -1
- package/dist/ui/ui-tools.js +2 -1
- package/dist/ui/ui-tools.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -92,7 +92,32 @@ In a browser, the turn after the decision comes from `ApprovalCard` (`@ouispec/a
|
|
|
92
92
|
|
|
93
93
|
On a call there is no card. The live-call handler sends the preview's `readback`, verbatim, after the turn's text, and the person answers in words. Their next utterance comes as an ordinary message, and your `resolveTurn` decides whether it approves: classify the words, then decide as the user on a conversation channel with the approval store client (`createHttpApprovalStoreClient(...).decide(approvalId, { userId, decision, channel: 'voice' })`). An `approve` answers with the token; return `approval: { approvalId, decision: 'approve', token }` on the turn's target, and the turn runs exactly the stored call, once. Anything else (a no, a correction, a new request) leaves the approval to expire, or decline it with `decision: 'decline'`. A UI action that needs approval still runs only on the grant from the tab's own card click: the tab's OUI runtime refuses one approved by voice, so on a call put irreversible acts in host or API tools, or let the page show the card.
|
|
94
94
|
|
|
95
|
-
Declare a host tool's approval needs on the tool itself: `effect`, `destructive`, `title`, `consequence`,
|
|
95
|
+
Declare a host tool's approval needs on the tool itself: `effect`, `destructive`, `title`, `consequence`, `argsSensitive: false` when its arguments may be logged, and `approvalAudience`, the origin of the API its approved calls go to (see "The receipt an approved call carries"). Without an approval store, such a call is refused and never runs. The runtime uses the realtime server's store unless you pass `approvals.store`.
|
|
96
|
+
|
|
97
|
+
### The receipt an approved call carries
|
|
98
|
+
|
|
99
|
+
When the realtime server has receipt keys, redeeming the token also returns a signed receipt, and the approved call carries it to the tool's own API, so that API can refuse any irreversible request no user approved:
|
|
100
|
+
|
|
101
|
+
- **A generated API tool** sends it as the `OUI-Approval-Receipt` header (`APPROVAL_RECEIPT_HEADER`), on the approved call only, never on another call of the turn. Its audience is the origin of the `baseUrl` it was loaded with, and the receipt names its `operationId`. A header of that name from your `actAs` is dropped.
|
|
102
|
+
- **A host tool** finds it on `ctx.approval.receipt`, beside `approvalId` and `argsHash`, and forwards it however its API expects; the header name is the recommended one. Its audience is its `approvalAudience` (an origin such as `https://bookings.example.com`), or, when it names none, the realtime server's `approvals.defaultAudience`. A tool whose `approvalAudience` is not an origin is not asked for approval: the call is refused and never runs.
|
|
103
|
+
- **A UI action** gets none: the browser checks its own grant, and a receipt never reaches a browser.
|
|
104
|
+
|
|
105
|
+
The receipt's audience is fixed when the approval is stored, with the call. It lasts 120 seconds. With a realtime server that has no receipt keys, `ctx.approval.receipt` is absent and nothing is sent. Update the realtime server before the worker: an older one refuses the pending approval's new fields (`audience`, `toolKind`, `operationId`, `accountId`), and no approval can be asked for.
|
|
106
|
+
|
|
107
|
+
The API verifies it with `verifyApprovalReceipt` from `@ouispec/agent-core`:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { APPROVAL_RECEIPT_HEADER, argsHash, verifyApprovalReceipt } from '@ouispec/agent-core';
|
|
111
|
+
|
|
112
|
+
const checked = await verifyApprovalReceipt(req.get(APPROVAL_RECEIPT_HEADER) ?? '', {
|
|
113
|
+
jwks: 'https://realtime.example.com/.well-known/oui-approval-jwks.json',
|
|
114
|
+
// The tool's input as the worker sent it: every path, query and body parameter by its declared name.
|
|
115
|
+
expectedArgsHash: await argsHash({ dealerId: req.params.dealerId, ...req.body }),
|
|
116
|
+
audience: 'https://bookings.example.com',
|
|
117
|
+
});
|
|
118
|
+
if (!checked.ok) return res.status(403).json({ code: 'APPROVAL_RECEIPT', reason: checked.reason });
|
|
119
|
+
// Single use is yours: act on each checked.claims.jti at most once, and keep it for at least two minutes.
|
|
120
|
+
```
|
|
96
121
|
|
|
97
122
|
Two hooks give you a say before an approval is asked for. Both are told the turn (`turn`, `channel`), the user, account and conversation, and `locale`: the language the person's message was recognised in (on a call, the request's `input.language`), null for a typed message.
|
|
98
123
|
|
|
@@ -101,6 +126,20 @@ Two hooks give you a say before an approval is asked for. Both are told the turn
|
|
|
101
126
|
|
|
102
127
|
Of the calls in one response, only the first that needs approval is asked for. While its check and preview are written, a call that arrives waits for the outcome: if the first is refused, the next is checked as if it had come first.
|
|
103
128
|
|
|
129
|
+
**On a conversation channel** there is no card. Give the turn payload `channel: 'chat' | 'sms' | 'voice' | 'phone'` (default `ui`); a live call's turns are `voice`, or `phone` when your `resolveTurn` sets `channel: 'phone'`. The model is then told that calling the tool sends the customer a readback of exactly its arguments, and the readback, word for word (on a voice, your preview's `spokenReadback` when you wrote one), is the turn's last words: emitted as `agent:token` with `readback: true` and stored as an assistant message, so your channel's adapter sends or speaks it like the rest of the reply. A live call sends it once, as its `readback` event. When your classifier reads the customer's next message as confirming it, decide for them (`ApprovalStoreClient.decide`, or `POST /internal/approvals/:id/decide`, with the channel) and send the continuation turn with the token, as the card would. Your hooks see the channel as `AgentTurnInfo.approvalChannel`.
|
|
130
|
+
|
|
131
|
+
**An action on the person's page is approved only by its card, on every channel.** The page runs it only on its own grant, from the person's click, so on a conversation channel the model is told the card is on their screen, nothing is read back, and the store refuses a conversation channel's approve of it (`channel`).
|
|
132
|
+
|
|
133
|
+
## A person takes the conversation over
|
|
134
|
+
|
|
135
|
+
A person on your staff can take a conversation from the agent, answer the customer as themselves, and hand it back. The hold is kept by the realtime server; your API takes and releases it after its own permission check, with `createHttpConversationClient({ url, apiKey })` (`takeOver`, `handBack`, `announce`, `hold`).
|
|
136
|
+
|
|
137
|
+
- **The agent does not answer a held conversation.** The turn's stop watch asks for its conversation's hold too: a turn running when the conversation is taken over stops at a safe point, keeps what it had produced marked `taken_over`, and its tab is told `agent:turn_complete` with `stopReason: 'taken_over'`; a turn that arrives while it is held makes no model call and stores nothing (`persistMessages` is called with no messages and the `taken_over` marker, so you can settle its row). `runner.reply` does not answer a held conversation either.
|
|
138
|
+
- **On a live call** the handler answers a turn of a held conversation with `done { stopReason: 'taken_over' }` and no words, so the call service keeps the character quiet; a turn speaking when it is taken over ends the same way. Quiet the call service's own session too, and store what the person says in the call as `staff` messages.
|
|
139
|
+
- **Approvals waiting at the take-over are withdrawn** by the realtime server (`taken_over`); the next turn records each as withdrawn, and none runs or gets a receipt.
|
|
140
|
+
- **The staff's words are in the history.** Store a person's message with `role: 'staff'` and its `speaker` (`{ userId, displayName, role? }`), and the take-over and hand-back as `staff` entries with `takeover: 'taken_over' | 'handed_back'` and no content. `getHistory` returns them as `{ role: 'staff', content, speaker, takeover? }`; the model reads them as the business's side of the conversation, under the person's name, never as its own words or the customer's. After the hand-back the agent answers from the whole exchange.
|
|
141
|
+
- `historyOf(messages)` maps the messages a turn stored back to the history form, for a host that keeps them as given.
|
|
142
|
+
|
|
104
143
|
## Stopping a turn
|
|
105
144
|
|
|
106
145
|
A turn can be stopped by the person, or superseded by their next message. The request is kept by the realtime server (`@ouispec/agent-realtime`, "Stopping a turn"), and the turn asks for it there for as long as it runs. Nothing needs configuring: the runtime uses the realtime server you already gave it. `stops.graceMs` (default 2 s) is how long an answer already on its way is still waited for.
|
|
@@ -323,7 +362,7 @@ Each tool:
|
|
|
323
362
|
- 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;
|
|
324
363
|
- carries `effect` and `destructive` for approvals to key on, and its operation's standard `security` requirement as the permissions it needs;
|
|
325
364
|
- 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;
|
|
326
|
-
- 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.
|
|
365
|
+
- 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. The approved call carries its receipt as the `OUI-Approval-Receipt` header, for the API's origin ("The receipt an approved call carries").
|
|
327
366
|
|
|
328
367
|
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.
|
|
329
368
|
|
|
@@ -354,4 +393,5 @@ Header parameters are never model input: `actAs` supplies them, and a call fails
|
|
|
354
393
|
- `pnpm test` includes the fixture turn. It runs on both adapters and on two providers, replaying recorded responses through each provider's real `ai` package, against the SDK realtime server on Redis.
|
|
355
394
|
- `pnpm record:fixture-turn` re-records the Bedrock responses from a live model.
|
|
356
395
|
- `pnpm eval:live` runs the live operating-rules eval.
|
|
396
|
+
- `@ouispec/agent-worker/testing` has what a product's own tests use: `recordingFetch` and `replayingFetch` (recorded model responses through a provider's real package), `scriptedChatCompletions` (a model whose every answer a test states), `conversationOf` (a request's conversation without the step's tail), and the Desk fixture API.
|
|
357
397
|
- Both of those live commands need Bedrock credentials in the environment.
|
|
@@ -8,7 +8,11 @@ import type { ApprovalChannel, ApprovalDecideResult, ApprovalDecision, ApprovalO
|
|
|
8
8
|
export interface ApprovalStoreClient {
|
|
9
9
|
/** Store a pending approval. Rejects when it was not stored: the call must then not wait on it. */
|
|
10
10
|
create(pending: PendingApprovalInput): Promise<void>;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The stored call for a valid, unexpired, unused token of this user and
|
|
13
|
+
* conversation, with its receipt when the store issues one; otherwise why
|
|
14
|
+
* not. Rejects when the store cannot be reached.
|
|
15
|
+
*/
|
|
12
16
|
redeem(token: string, caller: {
|
|
13
17
|
userId: string;
|
|
14
18
|
conversationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/approvals/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EAEpB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EAEtB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,mBAAmB;IAClC,mGAAmG;IACnG,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/approvals/client.ts"],"names":[],"mappings":"AA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AC,CAAC;CACzJ;AAED,MAAM,WAAW,6BAA6B;IAC5C,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8DAA8D;AAC9D,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,6BAA6B,GAAG,mBAAmB,CAkFxG"}
|
package/dist/approvals/client.js
CHANGED
|
@@ -30,8 +30,9 @@ export function createHttpApprovalStoreClient(config) {
|
|
|
30
30
|
},
|
|
31
31
|
async redeem(token, caller) {
|
|
32
32
|
const { status, json } = await call('/internal/approvals/redeem', { token, ...caller });
|
|
33
|
-
if (status === 200)
|
|
34
|
-
return { ok: true, call: json.call };
|
|
33
|
+
if (status === 200) {
|
|
34
|
+
return { ok: true, call: json.call, ...(typeof json.receipt === 'string' && json.receipt ? { receipt: json.receipt } : {}) };
|
|
35
|
+
}
|
|
35
36
|
if (status >= 400 && status < 500 && typeof json.reason === 'string') {
|
|
36
37
|
return { ok: false, reason: json.reason, error: String(json.error ?? json.reason) };
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/approvals/client.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/approvals/client.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAoD1D,8DAA8D;AAC9D,MAAM,UAAU,6BAA6B,CAAC,MAAqC;IACjF,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/B,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;IAE5C,MAA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AAU,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YACxG,IAAI,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI;gBAAE,OAAO,IAAuC,CAAC;YACvF,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACrE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAA+B,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/G,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,4DAA4D,UAAU,UAAU,MAAM,EAAE,CAAC,CAAC;QAC5G,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM;YAC7B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,uBAAuB,kBAAkB,CAAC,UAAU,CAAC,IAAI,IAAI,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;YAChI,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,IAAiC,CAAC;YAC7D,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,IAAI,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,4DAA4D,UAAU,UAAU,MAAM,EAAE,CAAC,CAAC;QAC5G,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
import type { ApprovalContinuation, ApprovalWithdrawReason, ApprovedCall } from '@ouispec/agent-core';
|
|
9
9
|
import type { ApprovalStoreClient } from './client.js';
|
|
10
10
|
export type ContinuationOutcome =
|
|
11
|
-
/** Approved and redeemed: run this call, exactly. */
|
|
11
|
+
/** Approved and redeemed: run this call, exactly, carrying its receipt when the store issued one. */
|
|
12
12
|
{
|
|
13
13
|
kind: 'run';
|
|
14
14
|
call: ApprovedCall;
|
|
15
|
+
receipt?: string;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Nothing runs; the model is told why. `settled`: the person's decision, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation.d.ts","sourceRoot":"","sources":["../../src/approvals/continuation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAyB,sBAAsB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7H,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,mBAAmB;AAC7B,
|
|
1
|
+
{"version":3,"file":"continuation.d.ts","sourceRoot":"","sources":["../../src/approvals/continuation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAyB,sBAAsB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7H,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,mBAAmB;AAC7B,qGAAqG;AACnG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;AACvD;;;;GAIG;GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;CAAE,CAAC;AAEnF,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,eAAe,CAAC;IACzB,iGAAiG;IACjG,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC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AC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACtG,WAAW,EAAE,CAmBf;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAmBxG;AAED,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,mBAAmB,GAAG,SAAS,EACtC,YAAY,EAAE,oBAAoB,EAClC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAC/C,OAAO,CAAC,mBAAmB,CAAC,CA+B9B"}
|
|
@@ -19,6 +19,7 @@ export function approvedExpiredMarker(now = new Date()) {
|
|
|
19
19
|
const WITHDRAWN_BECAUSE = {
|
|
20
20
|
superseded: 'the user sent a new message',
|
|
21
21
|
stopped: 'the user stopped the turn that asked for it',
|
|
22
|
+
taken_over: 'a person on the staff took the conversation over',
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* An approval that was withdrawn before it was used: said as what happened,
|
|
@@ -182,6 +183,6 @@ export async function resolveContinuation(store, continuation, turn) {
|
|
|
182
183
|
...(redeemed.reason === 'expired' ? { settled: 'expired' } : {}),
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
|
-
return { kind: 'run', call: redeemed.call };
|
|
186
|
+
return { kind: 'run', call: redeemed.call, ...(redeemed.receipt ? { receipt: redeemed.receipt } : {}) };
|
|
186
187
|
}
|
|
187
188
|
//# sourceMappingURL=continuation.js.map
|
|
@@ -1 +1 @@
|
|
|
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,EAAE,CAAC;AAC1G,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a tool's declaration says about approval, for every
|
|
3
|
+
* kind of tool the worker runs: a UI action from the client's surfaces, a
|
|
4
|
+
* generated API tool (its effect from the operation's `x-agent`), a host tool.
|
|
5
|
+
* The rule itself is OUI's `requiresApproval` (through oui-bindings), which the browser applies too; a host's
|
|
6
|
+
* policy may require approval of more, never of less.
|
|
7
|
+
*/
|
|
8
|
+
import { type ApprovalChannel } from '@ouispec/agent-core';
|
|
1
9
|
import type { RegisteredTool, ToolEffect } from '../tools/types.js';
|
|
2
10
|
export interface ApprovalRequirement {
|
|
3
11
|
effect: ToolEffect | undefined;
|
|
@@ -10,6 +18,26 @@ export interface ApprovalRequirement {
|
|
|
10
18
|
ttlMs: number;
|
|
11
19
|
}
|
|
12
20
|
export declare function approvalRequirement(tool: RegisteredTool): ApprovalRequirement;
|
|
13
|
-
/** What the model reads on a tool whose calls need approval, in place of any "confirm first" instruction. */
|
|
21
|
+
/** What the model reads on a tool whose calls need approval, in place of any "confirm first" instruction: in a UI, the card. */
|
|
14
22
|
export declare const APPROVAL_TOOL_NOTE: string;
|
|
23
|
+
/**
|
|
24
|
+
* The same on a conversation channel (chat, SMS, voice, phone), where there is
|
|
25
|
+
* no card: the customer is sent the readback, verbatim, and their next message
|
|
26
|
+
* confirms it or not.
|
|
27
|
+
*/
|
|
28
|
+
export declare const READBACK_APPROVAL_TOOL_NOTE: string;
|
|
29
|
+
/**
|
|
30
|
+
* A UI action on a conversation channel: the person's page runs it only on its
|
|
31
|
+
* own grant, from a click on its card, so it is approved there and nowhere
|
|
32
|
+
* else. A yes said or sent in the conversation does not approve it.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SCREEN_APPROVAL_TOOL_NOTE: string;
|
|
35
|
+
/** The conversation channels a voice reads the readback out on: it says the host's `spokenReadback` when there is one. */
|
|
36
|
+
export declare const VOICE_APPROVAL_CHANNELS: ReadonlySet<ApprovalChannel>;
|
|
37
|
+
/**
|
|
38
|
+
* What the model reads on a tool whose calls need approval, for the turn's
|
|
39
|
+
* channel: the card in a UI; the readback on a conversation channel; and, for
|
|
40
|
+
* a UI action on a conversation channel, the card on the person's screen.
|
|
41
|
+
*/
|
|
42
|
+
export declare function approvalToolNote(channel?: ApprovalChannel, toolKind?: RegisteredTool['kind']): string;
|
|
15
43
|
//# sourceMappingURL=requirement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement.d.ts","sourceRoot":"","sources":["../../src/approvals/requirement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requirement.d.ts","sourceRoot":"","sources":["../../src/approvals/requirement.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAgD,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEzG,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,+EAA+E;IAC/E,QAAQ,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,UAAU,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,mBAAmB,CAW7E;AAED,gIAAgI;AAChI,eAAO,MAAM,kBAAkB,QAGX,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAGkE,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,QAGwB,CAAC;AAE/D,0HAA0H;AAC1H,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,eAAe,CAAgD,CAAC;AAElH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,eAAsB,EAAE,QAAQ,GAAE,cAAc,CAAC,MAAM,CAAa,GAAG,MAAM,CAGtH"}
|
|
@@ -19,8 +19,36 @@ export function approvalRequirement(tool) {
|
|
|
19
19
|
ttlMs: minutes ? Math.min(minutes * 60_000, MAX_APPROVAL_TTL_MS) : DEFAULT_APPROVAL_TTL_MS,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
/** What the model reads on a tool whose calls need approval, in place of any "confirm first" instruction. */
|
|
22
|
+
/** What the model reads on a tool whose calls need approval, in place of any "confirm first" instruction: in a UI, the card. */
|
|
23
23
|
export const APPROVAL_TOOL_NOTE = "Needs the user's approval: calling it shows them an approval card with exactly these arguments, and it runs only when " +
|
|
24
24
|
'they approve it there. Call it directly when they ask for it. Do not ask for a yes in chat first, and never treat a typed ' +
|
|
25
25
|
'yes as approval.';
|
|
26
|
+
/**
|
|
27
|
+
* The same on a conversation channel (chat, SMS, voice, phone), where there is
|
|
28
|
+
* no card: the customer is sent the readback, verbatim, and their next message
|
|
29
|
+
* confirms it or not.
|
|
30
|
+
*/
|
|
31
|
+
export const READBACK_APPROVAL_TOOL_NOTE = "Needs the customer's confirmation: calling it sends them a readback of exactly these arguments, word for word, and it runs " +
|
|
32
|
+
'only if they confirm that readback in their next message. Call it directly when they ask for it. Do not read the details ' +
|
|
33
|
+
'back or ask for a yes yourself first, and never treat a yes given before the readback as confirmation.';
|
|
34
|
+
/**
|
|
35
|
+
* A UI action on a conversation channel: the person's page runs it only on its
|
|
36
|
+
* own grant, from a click on its card, so it is approved there and nowhere
|
|
37
|
+
* else. A yes said or sent in the conversation does not approve it.
|
|
38
|
+
*/
|
|
39
|
+
export const SCREEN_APPROVAL_TOOL_NOTE = "Needs the user's approval on their screen: calling it shows them an approval card with exactly these arguments, and it runs " +
|
|
40
|
+
'only when they approve it there. Call it directly when they ask for it, and tell them the card is on their screen. A yes ' +
|
|
41
|
+
'they say or send in this conversation does not approve it.';
|
|
42
|
+
/** The conversation channels a voice reads the readback out on: it says the host's `spokenReadback` when there is one. */
|
|
43
|
+
export const VOICE_APPROVAL_CHANNELS = new Set(['voice', 'phone']);
|
|
44
|
+
/**
|
|
45
|
+
* What the model reads on a tool whose calls need approval, for the turn's
|
|
46
|
+
* channel: the card in a UI; the readback on a conversation channel; and, for
|
|
47
|
+
* a UI action on a conversation channel, the card on the person's screen.
|
|
48
|
+
*/
|
|
49
|
+
export function approvalToolNote(channel = 'ui', toolKind = 'backend') {
|
|
50
|
+
if (channel === 'ui')
|
|
51
|
+
return APPROVAL_TOOL_NOTE;
|
|
52
|
+
return toolKind === 'ui' ? SCREEN_APPROVAL_TOOL_NOTE : READBACK_APPROVAL_TOOL_NOTE;
|
|
53
|
+
}
|
|
26
54
|
//# sourceMappingURL=requirement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement.js","sourceRoot":"","sources":["../../src/approvals/requirement.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"requirement.js","sourceRoot":"","sources":["../../src/approvals/requirement.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAwB,MAAM,qBAAqB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAcjE,MAAM,UAAU,mBAAmB,CAAC,IAAoB;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;IAC9C,MAAM,OAAO,GAAG,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3H,OAAO;QACL,MAAM;QACN,WAAW;QACX,QAAQ,EAAE,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC;QAC/C,UAAU,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;QAC/D,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,uBAAuB;KAC3F,CAAC;AACJ,CAAC;AAED,gIAAgI;AAChI,MAAM,CAAC,MAAM,kBAAkB,GAC7B,wHAAwH;IACxH,4HAA4H;IAC5H,kBAAkB,CAAC;AAErB;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,6HAA6H;IAC7H,2HAA2H;IAC3H,wGAAwG,CAAC;AAE3G;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,8HAA8H;IAC9H,2HAA2H;IAC3H,4DAA4D,CAAC;AAE/D,0HAA0H;AAC1H,MAAM,CAAC,MAAM,uBAAuB,GAAiC,IAAI,GAAG,CAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAElH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAA2B,IAAI,EAAE,WAAmC,SAAS;IAC5G,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,kBAAkB,CAAC;IAChD,OAAO,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,2BAA2B,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product API's side of a conversation's hold: take a
|
|
3
|
+
* conversation over, hand it back, announce a stored message, ask who holds
|
|
4
|
+
* it. The realtime server keeps the hold and enforces it; the product calls
|
|
5
|
+
* these from its own routes, after its own check that this person may.
|
|
6
|
+
*
|
|
7
|
+
* It ships beside the clients of the approval store and the stop record,
|
|
8
|
+
* which the worker uses; a product's API imports it from here.
|
|
9
|
+
*/
|
|
10
|
+
import type { AnnounceMessageRequest, AnnounceMessageResult, ConversationHold, HandBackRequest, HandBackResult, TakeOverRequest, TakeOverResult } from '@ouispec/agent-core';
|
|
11
|
+
export interface ConversationClient {
|
|
12
|
+
/** Who holds the conversation, or null when the agent answers it. */
|
|
13
|
+
hold(conversationId: string): Promise<ConversationHold | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Take it over for `request.holder`: `taken_over` (the rooms are told, its
|
|
16
|
+
* running turn stops, and every approval of it still waiting, or approved
|
|
17
|
+
* and not yet used, is withdrawn: their ids are `withdrawn`), `already`
|
|
18
|
+
* (this holder had it), or refused with who holds it. Call it after the
|
|
19
|
+
* product's own permission check.
|
|
20
|
+
*/
|
|
21
|
+
takeOver(conversationId: string, request: TakeOverRequest): Promise<TakeOverResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Hand it back: with `userId`, as that holder; without it, on the product's
|
|
24
|
+
* own authority (an idle policy, a manager). Refused when `userId` does not
|
|
25
|
+
* hold it.
|
|
26
|
+
*/
|
|
27
|
+
handBack(conversationId: string, request: HandBackRequest): Promise<HandBackResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Announce a message the product has stored, to the people watching the
|
|
30
|
+
* conversation. A `staff` message is refused unless its speaker holds it.
|
|
31
|
+
*/
|
|
32
|
+
announce(conversationId: string, request: AnnounceMessageRequest): Promise<AnnounceMessageResult>;
|
|
33
|
+
}
|
|
34
|
+
export interface HttpConversationClientConfig {
|
|
35
|
+
/** The realtime server's base URL. */
|
|
36
|
+
url: string;
|
|
37
|
+
/** Its internal key. */
|
|
38
|
+
apiKey: string;
|
|
39
|
+
/** Per request. Default 5 s. */
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
}
|
|
42
|
+
/** The conversation routes over the realtime server's internal HTTP API. Throws on anything but an answer. */
|
|
43
|
+
export declare function createHttpConversationClient(config: HttpConversationClientConfig): ConversationClient;
|
|
44
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/conversations/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACf,MAAM,qBAAqB,CAAC;AAG7B,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC/D;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACpF;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACpF;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnG;AAED,MAAM,WAAW,4BAA4B;IAC3C,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8GAA8G;AAC9G,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,4BAA4B,GAAG,kBAAkB,CA6CrG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { requireRealtime } from '../emit/http-adapter.js';
|
|
2
|
+
/** The conversation routes over the realtime server's internal HTTP API. Throws on anything but an answer. */
|
|
3
|
+
export function createHttpConversationClient(config) {
|
|
4
|
+
const { url, apiKey } = config;
|
|
5
|
+
requireRealtime(url, apiKey);
|
|
6
|
+
const timeoutMs = config.timeoutMs ?? 5_000;
|
|
7
|
+
const call = async (conversationId, path, body) => {
|
|
8
|
+
const res = await fetch(`${url}/internal/conversations/${encodeURIComponent(conversationId)}${path}`, {
|
|
9
|
+
method: body === undefined ? 'GET' : 'POST',
|
|
10
|
+
headers: { 'Content-Type': 'application/json', 'X-Api-Key': apiKey },
|
|
11
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
12
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
13
|
+
});
|
|
14
|
+
const text = await res.text();
|
|
15
|
+
let json = null;
|
|
16
|
+
try {
|
|
17
|
+
json = text ? JSON.parse(text) : null;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// A non-JSON answer is reported by status below.
|
|
21
|
+
}
|
|
22
|
+
return { status: res.status, json };
|
|
23
|
+
};
|
|
24
|
+
/** A 200 or a 409 is the server's answer; anything else is a failure to ask. */
|
|
25
|
+
const answer = (what, conversationId, { status, json }) => {
|
|
26
|
+
if (status === 200 || status === 409)
|
|
27
|
+
return json;
|
|
28
|
+
const error = json && typeof json === 'object' && 'error' in json ? String(json.error) : '';
|
|
29
|
+
throw new Error(`[agent-sdk] The realtime server could not ${what} conversation ${conversationId}: HTTP ${status} ${error}`.trim());
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
async hold(conversationId) {
|
|
33
|
+
const res = await call(conversationId, '/hold');
|
|
34
|
+
if (res.status === 204)
|
|
35
|
+
return null;
|
|
36
|
+
return answer('read the hold of', conversationId, res);
|
|
37
|
+
},
|
|
38
|
+
async takeOver(conversationId, request) {
|
|
39
|
+
return answer('take over', conversationId, await call(conversationId, '/hold', request));
|
|
40
|
+
},
|
|
41
|
+
async handBack(conversationId, request) {
|
|
42
|
+
return answer('hand back', conversationId, await call(conversationId, '/hold/release', request));
|
|
43
|
+
},
|
|
44
|
+
async announce(conversationId, request) {
|
|
45
|
+
return answer('announce a message of', conversationId, await call(conversationId, '/messages', request));
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
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AQ,CAAC,cAAc,EAAE,OAAO;YACpC,OAAO,MAAM,CAAwB,uBAAuB,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QAClI,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/history.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* For a host that fits its stored history before a turn
|
|
2
|
+
* For a host that fits its stored history before a turn, or hands back the
|
|
3
|
+
* messages a turn stored (`@ouispec/agent-worker/history`).
|
|
3
4
|
*
|
|
4
5
|
* A module of its own, with nothing the turn runtime needs: a host's history
|
|
5
6
|
* code, and its tests, load this without loading the model SDK. It also answers
|
|
6
7
|
* a CommonJS resolver (`default`), which the package's other entries do not.
|
|
7
8
|
*/
|
|
9
|
+
import type { TurnHistoryMessage, TurnMessage } from './types.js';
|
|
8
10
|
export { answerWithoutState, STATE_AT_END } from './ui/page-state-at-end.js';
|
|
11
|
+
/**
|
|
12
|
+
* What a host hands back as history for the messages a turn stored: the
|
|
13
|
+
* worker's own `TurnMessage`s, in the `TurnHistoryMessage` form `getHistory`
|
|
14
|
+
* returns. A host that keeps the turn's messages as they were given needs
|
|
15
|
+
* nothing else; one that stores them in its own shape maps them the same way.
|
|
16
|
+
*/
|
|
17
|
+
export declare function historyOf(messages: readonly TurnMessage[]): TurnHistoryMessage[];
|
|
9
18
|
//# sourceMappingURL=history.d.ts.map
|
package/dist/history.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAchF"}
|
package/dist/history.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
export { answerWithoutState, STATE_AT_END } from './ui/page-state-at-end.js';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* A
|
|
5
|
-
*
|
|
6
|
-
* a CommonJS resolver (`default`), which the package's other entries do not.
|
|
3
|
+
* What a host hands back as history for the messages a turn stored: the
|
|
4
|
+
* worker's own `TurnMessage`s, in the `TurnHistoryMessage` form `getHistory`
|
|
5
|
+
* returns. A host that keeps the turn's messages as they were given needs
|
|
6
|
+
* nothing else; one that stores them in its own shape maps them the same way.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function historyOf(messages) {
|
|
9
|
+
return messages.map((m) => {
|
|
10
|
+
if (m.role === 'assistant') {
|
|
11
|
+
return {
|
|
12
|
+
role: 'assistant',
|
|
13
|
+
content: m.content,
|
|
14
|
+
...(m.toolCalls?.length
|
|
15
|
+
? { tool_calls: m.toolCalls.map((c) => ({ id: c.id, type: 'function', function: { name: c.name, arguments: JSON.stringify(c.arguments) } })) }
|
|
16
|
+
: {}),
|
|
17
|
+
...(m.stopped ? { stopped: m.stopped } : {}),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return { role: 'tool', content: m.content ?? '', tool_call_id: m.toolCallId ?? '', ...(m.name ? { name: m.name } : {}) };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
9
23
|
//# sourceMappingURL=history.js.map
|
package/dist/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"A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
* retries and timeouts, on Lambda + SQS or in a container.
|
|
8
8
|
*/
|
|
9
9
|
export type { AgentWorkerConfig, AgentTurnInput, AgentTurnResult, TurnMessage, TurnHistoryMessage, ToolCallRef, SystemPromptContext } from './types.js';
|
|
10
|
+
export { historyOf } from './history.js';
|
|
10
11
|
export type { RealtimeEmitAdapter } from './emit/types.js';
|
|
11
12
|
export { filterEmitAdapter } from './emit/filter.js';
|
|
12
13
|
export type { TurnEventFilter } from './emit/filter.js';
|
|
13
|
-
export type { ToolRegistry, RegisteredTool, ToolExecutionResult, ToolExecutionContext } from './tools/types.js';
|
|
14
|
+
export type { ToolRegistry, RegisteredTool, ToolExecutionResult, ToolExecutionContext, ToolCallApproval } from './tools/types.js';
|
|
14
15
|
export { createToolRegistry } from './tools/types.js';
|
|
15
16
|
export { loadToolsFromSchema } from './tools/schema-loader.js';
|
|
16
17
|
export type { LoadToolsOptions } from './tools/schema-loader.js';
|
|
@@ -30,7 +31,7 @@ export type { ToolPolicy, ToolPolicyContext, ToolPolicyDecision } from './authz/
|
|
|
30
31
|
export { defaultToolPolicy, evaluateToolPolicySafe } from './authz/tool-policy.js';
|
|
31
32
|
export { createHttpApprovalStoreClient } from './approvals/client.js';
|
|
32
33
|
export type { ApprovalStoreClient, HttpApprovalStoreClientConfig } from './approvals/client.js';
|
|
33
|
-
export { approvalRequirement, APPROVAL_TOOL_NOTE } from './approvals/requirement.js';
|
|
34
|
+
export { approvalRequirement, approvalToolNote, APPROVAL_TOOL_NOTE, READBACK_APPROVAL_TOOL_NOTE, SCREEN_APPROVAL_TOOL_NOTE, VOICE_APPROVAL_CHANNELS, } from './approvals/requirement.js';
|
|
34
35
|
export type { ApprovalRequirement } from './approvals/requirement.js';
|
|
35
36
|
export { buildApprovalPreview } from './approvals/preview.js';
|
|
36
37
|
export { readHostPreview, readValidation, MAX_VALIDATION_ERROR_CHARS } from './approvals/hooks.js';
|
|
@@ -38,6 +39,8 @@ export type { ApprovalHookContext, ApprovalPreviewContext, ApprovalPreviewHook,
|
|
|
38
39
|
export { createHttpTurnStopClient, watchTurnStop, withLocalStop, stopOf, TurnStopped, DEFAULT_STOP_GRACE_MS } from './stop/turn-stop.js';
|
|
39
40
|
export type { TurnStopClient, HttpTurnStopClientConfig, TurnStopWatch, TurnStopState } from './stop/turn-stop.js';
|
|
40
41
|
export { stoppedTurnMessages } from './stop/partial.js';
|
|
42
|
+
export { createHttpConversationClient } from './conversations/client.js';
|
|
43
|
+
export type { ConversationClient, HttpConversationClientConfig } from './conversations/client.js';
|
|
41
44
|
export type { AttachmentStore, AttachmentStoreCallOptions, AttachmentOwner, AttachmentLoadAs, AttachmentContent, AttachmentWorkerConfig } from './attachments/store.js';
|
|
42
45
|
export { AttachmentGuard, type AttachmentUsage, type GuardedPart, type AttachmentCap } from './attachments/guard.js';
|
|
43
46
|
export { attachmentTools, ATTACHMENT_TOOLS, ATTACHMENT_TOOL_CLASS } from './attachments/tools.js';
|
|
@@ -66,7 +69,7 @@ export { createHttpEmitAdapter } from './emit/http-adapter.js';
|
|
|
66
69
|
export type { HttpEmitAdapterConfig } from './emit/http-adapter.js';
|
|
67
70
|
export { teeEmitAdapter } from './emit/tee.js';
|
|
68
71
|
export type { TurnEventObserver } from './emit/tee.js';
|
|
69
|
-
export { createAgentTurnRunner, categorizeError, payloadRefusal, TURN_DEADLINE_EXCEEDED } from './runtime/turn-runner.js';
|
|
72
|
+
export { createAgentTurnRunner, categorizeError, hostSystemPrompt, payloadRefusal, TURN_DEADLINE_EXCEEDED } from './runtime/turn-runner.js';
|
|
70
73
|
export type { AgentTurnRunner, TurnHost, TurnOutcome, CategorizedError } from './runtime/turn-runner.js';
|
|
71
74
|
export { assertAgentRuntimeConfig } from './runtime/config.js';
|
|
72
75
|
export { turnInfoOf, DEFAULT_TURN_CHANNEL } from './runtime/turn-info.js';
|
|
@@ -75,8 +78,8 @@ export type { AgentRuntimeConfig, LambdaAgentConfig, AgentTurnPayload, HistoryRe
|
|
|
75
78
|
export { createLambdaAgentHandler } from './lambda/handler.js';
|
|
76
79
|
export { startContainerAgentWorker, DEFAULT_LIVE_CALL_PATH } from './container/server.js';
|
|
77
80
|
export type { ContainerAgentConfig, ContainerAgentWorker, ContainerLiveCallRoute } from './container/server.js';
|
|
78
|
-
export { createLiveCallTurnHandler, LIVE_CALL_SPEECH, LIVE_CALL_CHANNEL } from './live-call/handler.js';
|
|
79
|
-
export type { LiveCallSpeech, LiveCallTurnHandler, LiveCallTurnHandlerConfig, LiveCallTurnOptions, LiveCallTurnTarget, LiveCallTurnCallContext, } from './live-call/handler.js';
|
|
81
|
+
export { createLiveCallTurnHandler, LIVE_CALL_SPEECH, LIVE_CALL_CHANNEL, LIVE_CALL_APPROVAL_CHANNELS } from './live-call/handler.js';
|
|
82
|
+
export type { LiveCallSpeech, LiveCallApprovalChannel, LiveCallTurnHandler, LiveCallTurnHandlerConfig, LiveCallTurnOptions, LiveCallTurnTarget, LiveCallTurnCallContext, } from './live-call/handler.js';
|
|
80
83
|
export { readLiveCallTurnRequest, liveCallError, LIVE_CALL_TURN_KINDS, LIVE_CALL_OPENING_MESSAGE, liveCallOpeningMessage, LIVE_CALL_TYPED_INPUT_MODE, LIVE_CALL_LIMITS, LIVE_CALL_ERROR_MESSAGES, } from './live-call/protocol.js';
|
|
81
84
|
export type { LiveCallTurnKind, LiveCallTurnRequest, LiveCallStreamEvents, LiveCallStreamEventName, LiveCallRequestReading, } from './live-call/protocol.js';
|
|
82
85
|
export { DEFAULT_KEEP_ALIVE_MS as LIVE_CALL_KEEP_ALIVE_MS } from './live-call/event-stream.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,YAA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