@ouispec/agent-worker 0.29.1 → 0.31.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 +53 -7
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +31 -19
- package/dist/orchestrator.js.map +1 -1
- package/dist/prompt/builder.d.ts +2 -1
- package/dist/prompt/builder.d.ts.map +1 -1
- package/dist/prompt/builder.js +13 -8
- package/dist/prompt/builder.js.map +1 -1
- package/dist/prompt/capture.d.ts +2 -2
- package/dist/prompt/capture.js +2 -2
- package/dist/prompt/clock.d.ts +4 -4
- package/dist/prompt/clock.js +4 -4
- package/dist/prompt/index.d.ts +2 -2
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/index.js +1 -1
- package/dist/prompt/index.js.map +1 -1
- package/dist/prompt/rules/communication.d.ts +43 -2
- package/dist/prompt/rules/communication.d.ts.map +1 -1
- package/dist/prompt/rules/communication.js +67 -7
- package/dist/prompt/rules/communication.js.map +1 -1
- package/dist/prompt/spoken-input.d.ts +2 -2
- package/dist/prompt/spoken-input.js +2 -2
- package/dist/prompt/spoken-reply.d.ts +2 -2
- package/dist/prompt/spoken-reply.js +2 -2
- package/dist/prompt/types.d.ts +17 -3
- package/dist/prompt/types.d.ts.map +1 -1
- package/dist/prompt/vision.d.ts +3 -3
- package/dist/prompt/vision.js +3 -3
- package/dist/runtime/config.d.ts.map +1 -1
- package/dist/runtime/config.js +9 -0
- package/dist/runtime/config.js.map +1 -1
- package/dist/runtime/turn-runner.d.ts.map +1 -1
- package/dist/runtime/turn-runner.js +1 -0
- package/dist/runtime/turn-runner.js.map +1 -1
- package/dist/runtime/types.d.ts +15 -5
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/step-messages.d.ts +46 -9
- package/dist/step-messages.d.ts.map +1 -1
- package/dist/step-messages.js +43 -23
- package/dist/step-messages.js.map +1 -1
- package/dist/testing/scripted.d.ts +6 -4
- package/dist/testing/scripted.d.ts.map +1 -1
- package/dist/testing/scripted.js +7 -5
- package/dist/testing/scripted.js.map +1 -1
- package/dist/types.d.ts +25 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/snapshot.d.ts +1 -1
- package/dist/ui/snapshot.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,6 +27,29 @@ Optional tuning, with its defaults:
|
|
|
27
27
|
- `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.
|
|
28
28
|
- `retries`: 3
|
|
29
29
|
|
|
30
|
+
### How replies are written
|
|
31
|
+
|
|
32
|
+
A persona's `overrides.communicationStyle` sets the tone and the format of its replies: a preset, or a preset and a format.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const persona: AgentPersonaConfig = {
|
|
36
|
+
name: 'Ava',
|
|
37
|
+
identity: 'You are Ava, the dealership’s assistant.',
|
|
38
|
+
overrides: { communicationStyle: { preset: 'concise', format: 'plain' } },
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
| Field | Values | Default |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `preset` | `conversational` (friendly, collaborative), `concise` (short, direct), `formal` (professional, structured) | `conversational` |
|
|
45
|
+
| `format` | `markdown`: rich markdown (bold, headings, bullet lists, tables), for a panel that renders it. `plain`: plain text, for a channel that shows the reply exactly as written, such as a web chat that renders no markdown or a text message | `markdown` |
|
|
46
|
+
|
|
47
|
+
`communicationStyle: 'concise'` is the concise preset in markdown, as it always was, and a persona that names no style gets the conversational preset in markdown: the prompt is unchanged for every persona that does not ask for `plain`.
|
|
48
|
+
|
|
49
|
+
With `format: 'plain'`, the markdown lines are replaced. The model is told to write short, natural sentences; to use no markdown syntax of any kind (no bold or italics, headings, bullet or numbered lists, tables, code, block quotes, rules or link syntax); to say several items in a sentence and compare things in words; to say what matters in tool data in sentences; and that this holds whatever the formatting of the prompt or its examples. The concise preset's "bullet points over paragraphs" becomes one or two short sentences, and the formal preset's "numbered lists and clear headings" becomes a few short paragraphs in a clear order. The few-shot examples and workflows are labelled without bold (`User:`, `Assistant:`, `Trigger:`). No other part of the prompt the SDK writes, and no description of the SDK's own tools, asks for markdown; what your persona's own text says (its identity, instructions, knowledge and examples) is yours to keep plain.
|
|
50
|
+
|
|
51
|
+
The format is part of the system prompt, so it stays the same on every turn of a runtime, as the prompt cache needs: a channel that needs plain text (SMS, a dealer's web chat) gets a runtime whose persona asks for it, rather than a format that changes turn by turn. A live call's turn is also told, in the turn's context, that its reply will be spoken ("What a UI client sends with a turn", `output`); in plain text the two agree, and the system prompt is the same on the call as in the chat. A preset or format the worker does not know, in the object form, fails when the adapter is created, naming it. A `systemPrompt` callback writes its own prompt, so the option does not apply to it. `resolveCommunicationStyle`, `COMMUNICATION_STYLES` and `COMMUNICATION_FORMATS` are exported for a host that reads the setting itself.
|
|
52
|
+
|
|
30
53
|
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.
|
|
31
54
|
|
|
32
55
|
Policy hooks: `turnPolicy`, `toolPolicy`, `uiActions`, `approvals`, `stops`, `logger`, and the hooks every turn passes through, `beforeTurn` and `filterEvent` ("Hooks on every turn").
|
|
@@ -39,15 +62,38 @@ Four keys on the turn's `context` are for the worker itself, and your persona or
|
|
|
39
62
|
|---|---|---|
|
|
40
63
|
| `oui` | Its surface snapshot: `ouiRuntime.snapshot()` | Builds the turn's UI tools from it, and from nothing else |
|
|
41
64
|
| `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" |
|
|
42
|
-
| `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
|
|
43
|
-
| `output` | How the reply reaches the person, when it is not shown as text: `{ mode: 'voice' }` when a voice reads it out, with `voiceDirections: { engine, tags, guidance }` when that voice can be directed by inline tags. The live-call handler sets it from the call's request | Adds one line
|
|
65
|
+
| `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 context ("How a turn is assembled"): 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 |
|
|
66
|
+
| `output` | How the reply reaches the person, when it is not shown as text: `{ mode: 'voice' }` when a voice reads it out, with `voiceDirections: { engine, tags, guidance }` when that voice can be directed by inline tags. The live-call handler sets it from the call's request | Adds one line to the turn's context: the reply will be heard, not read, so short plain sentences; no markdown, lists, headings, links, code or emoji; numbers, prices, dates and times written as they are said; anything the person should look at shown through the page's actions rather than read out; and a few words before a slow lookup. With `voiceDirections`, the same line offers the engine's tags, written exactly as given, says they are performed rather than read out and that no other tags are used, and ends with the service's `guidance`. An unknown mode is read as a shown reply, which gets nothing, and malformed directions (an empty tag list, a tag or engine with a control character, guidance over 2,000 characters; `VOICE_DIRECTIONS_LIMITS`) are left out while the reply is still spoken (`readReplyOutput` in `@ouispec/agent-core`). It applies on every turn of a call, the turn that continues an approval included |
|
|
44
67
|
|
|
45
|
-
`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
|
|
68
|
+
`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 open the turn's context.
|
|
46
69
|
|
|
47
|
-
What is true only for this turn (the clock, how the message was entered, how the reply is delivered) goes
|
|
70
|
+
What is true only for this turn (the clock, how the message was entered, how the reply is delivered) is the turn's context: it goes with the turn's message, never in the system prompt or in a stored message ("How a turn is assembled"). The system prompt, the tools and every stored message stay byte for byte the same whatever the turn says, so a conversation's chat turns and call turns read the same prefix. Store `input` with the user's message if your chat shows how a message was entered (`AgentStoredMessage.input`); the history the worker reads needs no copy of it.
|
|
48
71
|
|
|
49
72
|
Every other key is the page's context, which a persona prompt shows as the current UI state ("CURRENT UI CONTEXT", as JSON). A persona whose context is not a page renders it itself: `persona.renderContext(ctx)` returns the section to end the system prompt with, or null (or blank) for none, and is given the context without the four keys above. It renders into the system prompt, the start of the cached prefix, so render nothing that changes from turn to turn unless the conversation's context did. 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.
|
|
50
73
|
|
|
74
|
+
## How a turn is assembled
|
|
75
|
+
|
|
76
|
+
Each step of a turn (each call to the model: the first, and one after every round of tool calls) sends, in this order:
|
|
77
|
+
|
|
78
|
+
1. **The system prompt**, with a cache breakpoint, then the page's index (`<page_index>`) when the client has a page, with its own. The same on every step, and on every turn on the same page.
|
|
79
|
+
2. **The conversation** as the host stored it, ending with the turn's own message: the person's words, or the instruction that stands for them (a call's opening, glance or capture update).
|
|
80
|
+
3. **The turn's context**, straight after the turn's message: what is true for the whole turn and for no other. In this order: the clock (`<now>`), how the message was entered (`<input>`), how the reply is delivered (`<output>`), whether the model can look at the caller (`<vision>`, a glance's observation included), the photo plans and the running capture (`<capture>`), calls whose approval expired, and the host's `stepContext` (what `getHistory` returns beside the messages: an index of work notes, a dealer's notes on what the customer needs). Every step sends it in the same place, in the same words.
|
|
81
|
+
4. **The turn's rounds so far**: each round's text and tool calls, then their results. A cache breakpoint moves with the end of the conversation: on the turn's context on the first step, then on the newest result, so each step reads all of the step before it from the cache.
|
|
82
|
+
5. **What is true for this step only**, after that breakpoint, when there is any: the page's state (`<page_state>`: the page as the user's screen sent it, then as the newest answer that carried it left it) and the step's notes (`<step_note>`: the turn policy's `note`, a forced action, the turn's record after a call that failed, a step that has to plan less).
|
|
83
|
+
|
|
84
|
+
So nothing in the user's role follows a tool result except the page's state and the step's notes, each in its own tags, and a UI answer that gave its state up says where it is. The turn's context never does. Sent after a result, it reads as the person's newest message, and the model answers that instead: Claude Haiku 5.5 with thinking off told a caller "your message came through blank", or went back to an earlier question, and dropped what `look` had said, in 14 to 20 of 20 answers to "What am I wearing?" with the host's notes about "their newest message" and an appointment question still open. With the context beside the turn's message it answered from the look in 20 of 20, with and without a page beside the call (`evals/turn-context.live-eval.ts`). A framed `<turn_context>` block after the result, explained in the system prompt, did no better.
|
|
85
|
+
|
|
86
|
+
What is stored is only the person's message and the model's rounds, so the next turn sends the conversation as the host stored it, without this turn's context. It reads from the cache everything up to this turn's message, and writes this turn's calls and results to it once more, after which they are read like the rest.
|
|
87
|
+
|
|
88
|
+
`turnContextPlacement` (on the runtime config and `AgentWorkerConfig`) chooses where the turn's context goes:
|
|
89
|
+
|
|
90
|
+
| Value | Where | |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `'with-message'` (default) | Straight after the turn's message, on every step | Safe for every model. The next turn writes this turn's tool calls and results to the cache once more. |
|
|
93
|
+
| `'after-conversation'` | After the conversation's end on every step, before the step's notes: where 0.30 and earlier sent it | The next turn reads all of this one from the cache. After a tool result, the context reads as the person's newest message. Choose it only for a model that `evals/turn-context.live-eval.ts` (`EVAL_MODEL_ID`) shows answering from its tool results with it. |
|
|
94
|
+
|
|
95
|
+
A placement the worker does not know fails when the adapter is created, naming the ones there are (`TURN_CONTEXT_PLACEMENTS`). Context that should reach the model on one step only goes in a turn policy's `note`, never in `stepContext`.
|
|
96
|
+
|
|
51
97
|
## Hooks on every turn
|
|
52
98
|
|
|
53
99
|
Every turn reaches the runtime one of four ways: the Lambda adapter, the container's `/turns`, the live-call handler, or your own code calling `runner.run`. Each hook below runs for all of them, and is told which turn it is called for (`AgentTurnInfo`):
|
|
@@ -342,7 +388,7 @@ The stream is written from the turn's own events as the room receives them (`Tur
|
|
|
342
388
|
`seeing`: the character may see the caller; `remarks`: it may bring up what it sees unprompted (false whenever `seeing` is). `canLook`: it can look now, through `look` (true only with `seeing` and a `look`; the call service sends it only to a brain whose endpoint declares `acceptsVision`). `absent` says why it cannot: `camera_off`, or `turned_off` (the caller or the session turned vision off, with `seeing: false`). `look` is the call service's look route and a token for this session only, sent only over https (or to this machine). It is read as strictly as `client.ui`: a wrong field answers `400` naming it, and no refusal repeats the token. A `frame` from a call service before §2.9 is read past. The handler sets it as the turn payload's `vision` (`TurnVision`; any turn can carry one, `payloadRefusal` checks it), and the worker gives the model:
|
|
343
389
|
|
|
344
390
|
- with `canLook`, the **`look` tool** (`lookTool`, the SDK's `vision` tool class, a `view`): `look({ question, frames? })`, a question of at most 500 characters about the picture and 1–4 of the newest pictures (default 1). It `POST`s `{ question, frames? }` to `look.url` with `Authorization: Bearer <token>`. The answer, `{ looked: true, answer, frames, newestAgeMs }`, reaches the model beside the call's result for that call only: the stored result is `{ looked: true, pictures, newestSecondsAgo }`, so a later turn that needs to see looks again. `{ looked: false, absent }` (`camera_off`, `turned_off`, `no_picture`) is a result that says why there was nothing to see. A `409` (the call is no longer live), `429` (more than 20 looks a minute), any other refusal, a timeout (20 s) or an expired token fails the call with what to do instead, never with the route's own words. A host tool named `look` gives way to it; a tool policy that admits by name should admit the `vision` class;
|
|
345
|
-
- one line
|
|
391
|
+
- one line in the turn's context, with what else is true only for this turn: "You can look at the caller with `look` when the conversation calls for it: they ask about how they look or what is around them, they show you something, or a glance offers it. Do not look otherwise." (`LOOK_WHEN`), that it describes only what the look said; with `remarks`, that it may also remark unprompted on something significant or compliment what they wear, at most once about their appearance in its greeting and never the same remark twice; without, that it brings up nothing it sees unless asked; and always, that it never infers or names sensitive traits (ethnicity, health or disability, religion, sexual orientation, a guessed age or weight), never identifies anyone from their face and never comments on a body;
|
|
346
392
|
- without `canLook`, a line that it cannot see the caller and why, so it never claims to.
|
|
347
393
|
|
|
348
394
|
A **glance** is the call service's look between turns: nobody has spoken for a while, and its own look noticed something worth a remark. `text` is empty, `remarks` is on, and `client.vision.observation` is that one sentence. The model reads `LIVE_CALL_GLANCE_MESSAGE` where the person's words would be and the observation in the turn's vision line, as data (never an instruction), and phrases one short remark, looking first if it needs more; or it says nothing, and the stream is `done` with no `text` event: the call stays silent. Store `liveCallTurnMessage(request)` for it as you store an opening's message: the observation is never in it, and is read on a glance only. A history that kept the glance as its empty `text` is read past (a blank message with no files is never sent to the provider). A glance without `remarks`, or without an observation, answers `400`. An opening carries no picture: a greeting that compliments the caller looks first.
|
|
@@ -368,7 +414,7 @@ Set `acceptsCapture: true` on your brain endpoint once you run this version: the
|
|
|
368
414
|
- `capture_stop({ reason? })` (a `mutate`): `POST {url}/{captureId}/stop` with `{ reason? }` (at most 200 characters).
|
|
369
415
|
|
|
370
416
|
Each result is `{ captureId, status, outcome?, words }`: the route's `words`, one or two sentences, are what the model says from. A refusal fails with a line chosen by its code, never the route's own words: `CAPTURE_IN_PROGRESS` is "A photo capture is already running; use capture_status.", `RESUME_NOT_ALLOWED` says why by `details.why`, `CAPTURE_AGENT_UNAVAILABLE` gives Closure's `details.words` (its offer included), and `SESSION_NOT_LIVE`, `NO_ROOM_AGENT`, `CAPTURE_PLAN_NOT_FOUND`, `RATE_LIMITED`, `401`/`403`, a timeout (20 s) or an expired token each say what to do instead. No tool returns a picture. A host tool of the same name gives way to them; a tool policy that admits by name should admit the `capture` class;
|
|
371
|
-
- one line
|
|
417
|
+
- one line in the turn's context: "You can ask the caller for photos with `capture_start` when a plan below fits. Closure’s checker accepts or rejects every photo; you never judge a photo, and you never use `look` for one. While a capture runs you receive capture updates: turn each into one or two short, natural sentences in the caller’s language, and never read out a code. When a capture ends without completing, offer what its update says to offer." (`CAPTURE_WHEN`, the clause Closure's own brain is given), that a plan is offered only when its "offer it when" applies, that it never sees a photo and never claims to (`CAPTURE_NEVER`), the plans, and where the running capture stands. Without a `control` route the tools are not offered, and the line says photos cannot be started from this turn.
|
|
372
418
|
|
|
373
419
|
A **capture** turn passes on what happened in a capture: consent asked, given or declined, the camera, each step, a hint, a photo accepted or rejected, a step skipped or failed, the end. `text` is empty and `client.capture.update` is the words, for example `Odometer accepted: 48,212 mi.` The model reads `liveCallCaptureMessage(update)` where the person's words would be: the update in a `<capture_update>` tag, as data, and the instruction to say it in one or two short sentences, or to say nothing, and the stream is `done` with no `text` event. Every capture that ends without completing (declined, unanswered, the camera blocked or missing, stopped, out of retries, timed out, the guide or the checker unavailable) ends its words with `Offer: …`, the plan's own offer (a link to finish on the caller's phone, say), and the model is told to say what is missing without pushing and to make that offer. Store `liveCallTurnMessage(request)` for the turn, as for an opening: it is a readable row with what happened, so later turns know which photos were taken. An update can also ride a `message` turn (the caller spoke first): it then reaches the model in the turn's capture line, for that turn only, and the person's message is stored as it is. A capture turn without an update answers `400`.
|
|
374
420
|
|
|
@@ -447,5 +493,5 @@ Header parameters are never model input: `actAs` supplies them, and a call fails
|
|
|
447
493
|
- `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.
|
|
448
494
|
- `pnpm record:fixture-turn` re-records the Bedrock responses from a live model.
|
|
449
495
|
- `pnpm eval:live` runs the live operating-rules eval.
|
|
450
|
-
- `@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
|
|
496
|
+
- `@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 turn’s context and the step’s tail), and the Desk fixture API.
|
|
451
497
|
- Both of those live commands need Bedrock credentials in the environment.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export type { AgentWorkerConfig, AgentTurnInput, AgentTurnResult, TurnMessage, TurnHistoryMessage, ToolCallRef, SystemPromptContext } from './types.js';
|
|
10
10
|
export { historyOf } from './history.js';
|
|
11
|
+
export { TURN_CONTEXT_PLACEMENTS } from './step-messages.js';
|
|
12
|
+
export type { TurnContextPlacement } from './step-messages.js';
|
|
11
13
|
export type { RealtimeEmitAdapter } from './emit/types.js';
|
|
12
14
|
export { filterEmitAdapter } from './emit/filter.js';
|
|
13
15
|
export type { TurnEventFilter } from './emit/filter.js';
|
|
@@ -94,6 +96,6 @@ export { readTurnCapture, captureText, captureFacts, canCapture, CAPTURE_LIMITS,
|
|
|
94
96
|
export type { TurnCapture, CapturePlanOffer, CaptureControl, CaptureActive, CaptureActiveStep, CaptureStatus, CaptureOutcome, CaptureEndReason, CaptureBrainUpdateKind, } from './prompt/capture.js';
|
|
95
97
|
export { captureTools, CAPTURE_START_TOOL, CAPTURE_STATUS_TOOL, CAPTURE_STOP_TOOL, CAPTURE_TOOLS, CAPTURE_TOOL_CLASS, CAPTURE_TOOL_LIMITS, } from './capture/capture-tools.js';
|
|
96
98
|
export { buildAgentSystemPrompt } from './prompt/index.js';
|
|
97
|
-
export type { AgentPersonaConfig, AgentKnowledgeEntry, AgentWorkflow, AgentFewShotExample, AgentPersonaOverrides, PromptBuildContext, CommunicationStyle, } from './prompt/index.js';
|
|
98
|
-
export { getBaseRules, getCommunicationRules, getToolStrategyRules, getUIControlRules } from './prompt/index.js';
|
|
99
|
+
export type { AgentPersonaConfig, AgentKnowledgeEntry, AgentWorkflow, AgentFewShotExample, AgentPersonaOverrides, PromptBuildContext, CommunicationStyle, CommunicationFormat, CommunicationStyleOptions, CommunicationStyleSetting, ResolvedCommunicationStyle, } from './prompt/index.js';
|
|
100
|
+
export { getBaseRules, getCommunicationRules, resolveCommunicationStyle, COMMUNICATION_STYLES, COMMUNICATION_FORMATS, getToolStrategyRules, getUIControlRules, } from './prompt/index.js';
|
|
99
101
|
//# sourceMappingURL=index.d.ts.map
|
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,YAAY,CAAC;AACxJ,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAClI,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC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C;AAEzD,OAAO,EACL,eAAe,EACf,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* retries and timeouts, on Lambda + SQS or in a container.
|
|
8
8
|
*/
|
|
9
9
|
export { historyOf } from './history.js';
|
|
10
|
+
export { TURN_CONTEXT_PLACEMENTS } from './step-messages.js';
|
|
10
11
|
export { filterEmitAdapter } from './emit/filter.js';
|
|
11
12
|
export { createToolRegistry } from './tools/types.js';
|
|
12
13
|
export { loadToolsFromSchema } from './tools/schema-loader.js';
|
|
@@ -76,5 +77,5 @@ export { readTurnCapture, captureText, captureFacts, canCapture, CAPTURE_LIMITS,
|
|
|
76
77
|
export { captureTools, CAPTURE_START_TOOL, CAPTURE_STATUS_TOOL, CAPTURE_STOP_TOOL, CAPTURE_TOOLS, CAPTURE_TOOL_CLASS, CAPTURE_TOOL_LIMITS, } from './capture/capture-tools.js';
|
|
77
78
|
// Prompt Framework
|
|
78
79
|
export { buildAgentSystemPrompt } from './prompt/index.js';
|
|
79
|
-
export { getBaseRules, getCommunicationRules, getToolStrategyRules, getUIControlRules } from './prompt/index.js';
|
|
80
|
+
export { getBaseRules, getCommunicationRules, resolveCommunicationStyle, COMMUNICATION_STYLES, COMMUNICATION_FORMATS, getToolStrategyRules, getUIControlRules, } from './prompt/index.js';
|
|
80
81
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,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,EAA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AO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,mBAAmB;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAc3D,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAmE,MAAM,IAAI,CAAC;AAmBxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA6FtH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,yEAA0E,CAAC;AAExG,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,QAE+D,CAAC;AAwCtG;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAmE,MAAM,IAAI,CAAC;AAmBxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA6FtH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,yEAA0E,CAAC;AAExG,8EAA8E;AAC9E,eAAO,MAAM,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/spec';
|
|
|
32
32
|
import { CLIENT_SNAPSHOT_KEY, readClientPage, withoutClientUI } from './ui/snapshot.js';
|
|
33
33
|
import { KNOWLEDGE_TOOL, knowledgeTool, readClientKnowledge, withClientKnowledge } from './ui/knowledge.js';
|
|
34
34
|
import { answerWithoutState, withStatesAtEnd } from './ui/page-state-at-end.js';
|
|
35
|
-
import { stepMessages as forStep, STEP_NOTE_CLOSE, STEP_NOTE_OPEN } from './step-messages.js';
|
|
35
|
+
import { readTurnContextPlacement, stepMessages as forStep, STEP_NOTE_CLOSE, STEP_NOTE_OPEN } from './step-messages.js';
|
|
36
36
|
import { clockText, readClientTimeZone } from './prompt/clock.js';
|
|
37
37
|
import { readClientMessageInput, spokenInputText } from './prompt/spoken-input.js';
|
|
38
38
|
import { readClientReplyOutput, spokenReplyText } from './prompt/spoken-reply.js';
|
|
@@ -1596,9 +1596,9 @@ export async function runAgentTurn(config, input) {
|
|
|
1596
1596
|
// cache reads it (step-messages.ts). What is true only now — the page's
|
|
1597
1597
|
// index and values, the user's clock, a note on calls whose approval
|
|
1598
1598
|
// expired, the host's step context — is not added to the user's message,
|
|
1599
|
-
//
|
|
1600
|
-
//
|
|
1601
|
-
//
|
|
1599
|
+
// which the host stores as the person wrote it: the index goes after the
|
|
1600
|
+
// system prompt, the page's values after the conversation (`stepTail`), and
|
|
1601
|
+
// the rest in the turn's context, beside the message (`turnContext`). An approved
|
|
1602
1602
|
// call that ran is the result of the call the model made (see
|
|
1603
1603
|
// continueApproval).
|
|
1604
1604
|
const turnFilesGiven = !!fileArea && (input.attachments?.length ?? 0) > 0;
|
|
@@ -1674,7 +1674,7 @@ export async function runAgentTurn(config, input) {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
: null;
|
|
1676
1676
|
const instructions = pageIndex ? [systemMessage, pageIndex] : systemMessage;
|
|
1677
|
-
// ─── What is true now, after the conversation (step-messages.ts)
|
|
1677
|
+
// ─── What is true now: with the turn's message, and after the conversation (step-messages.ts) ───
|
|
1678
1678
|
// The turn's own message: answers after it are this turn's, and only those
|
|
1679
1679
|
// are newer than the page the turn began on.
|
|
1680
1680
|
const turnMessageAt = messages.map((m) => m.role).lastIndexOf('user');
|
|
@@ -1682,7 +1682,7 @@ export async function runAgentTurn(config, input) {
|
|
|
1682
1682
|
const turnSpoken = input.approval || input.resume ? null : readClientMessageInput(input.context ?? null);
|
|
1683
1683
|
// The reply is spoken on every turn of a call, the turn an approval continues included.
|
|
1684
1684
|
const turnSpokenReply = readClientReplyOutput(input.context ?? null);
|
|
1685
|
-
// Whether the model may look at the person, and how, or why it cannot (prompt/vision.ts): a line
|
|
1685
|
+
// Whether the model may look at the person, and how, or why it cannot (prompt/vision.ts): a line of the turn's context.
|
|
1686
1686
|
const turnVisionText = visionText(input.vision);
|
|
1687
1687
|
// When to offer each photo plan, where a running capture stands, and an update that rode this turn (prompt/capture.ts).
|
|
1688
1688
|
const turnCaptureText = captureText(input.capture);
|
|
@@ -1694,8 +1694,30 @@ export async function runAgentTurn(config, input) {
|
|
|
1694
1694
|
client.fit?.observations?.length ? `Not shown: ${fitNotes(client.fit.observations).join(' ')}` : null,
|
|
1695
1695
|
]
|
|
1696
1696
|
: null;
|
|
1697
|
+
/**
|
|
1698
|
+
* What is true for the whole turn, sent with the turn's own message on every
|
|
1699
|
+
* step in the same words (step-messages.ts): never after a tool result, where
|
|
1700
|
+
* the model reads it as the person's newest message and drops the result.
|
|
1701
|
+
*/
|
|
1702
|
+
const turnContext = [
|
|
1703
|
+
turnClock,
|
|
1704
|
+
// A message the person spoke may hold a mis-heard word (prompt/spoken-input.ts). A click on an
|
|
1705
|
+
// approval card, and a resume after work, are not messages, so they say nothing.
|
|
1706
|
+
...(turnSpoken ? [spokenInputText(turnSpoken)] : []),
|
|
1707
|
+
// A reply a voice will read out is written for the ear (prompt/spoken-reply.ts).
|
|
1708
|
+
...(turnSpokenReply ? [spokenReplyText(turnSpokenReply)] : []),
|
|
1709
|
+
// When the model may look at the person, or that it cannot see them and why.
|
|
1710
|
+
...(turnVisionText ? [turnVisionText] : []),
|
|
1711
|
+
// When the model may ask for photos, and what has happened in a capture.
|
|
1712
|
+
...(turnCaptureText ? [turnCaptureText] : []),
|
|
1713
|
+
...(expired.outcomes.length > 0 ? [expiredNote(expired)] : []),
|
|
1714
|
+
...(input.stepContext?.trim() ? [input.stepContext.trim()] : []),
|
|
1715
|
+
];
|
|
1697
1716
|
/** The page's state from this turn's newest answer that carried one; until then, as the user's screen sent it. */
|
|
1698
1717
|
let newestAnswerState;
|
|
1718
|
+
// Where it goes: with the turn's message (the default), or after the conversation, as 0.30 sent it.
|
|
1719
|
+
const turnContextPlacement = readTurnContextPlacement(config.turnContextPlacement);
|
|
1720
|
+
/** What is true for this step only, after the conversation: the page's state, and the step's notes. */
|
|
1699
1721
|
const stepTail = (notes) => [
|
|
1700
1722
|
...(turnPageValues
|
|
1701
1723
|
? [
|
|
@@ -1712,18 +1734,8 @@ export async function runAgentTurn(config, input) {
|
|
|
1712
1734
|
].join('\n'),
|
|
1713
1735
|
]
|
|
1714
1736
|
: []),
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
// approval card, and a resume after work, are not messages, so they say nothing.
|
|
1718
|
-
...(turnSpoken ? [spokenInputText(turnSpoken)] : []),
|
|
1719
|
-
// A reply a voice will read out is written for the ear (prompt/spoken-reply.ts).
|
|
1720
|
-
...(turnSpokenReply ? [spokenReplyText(turnSpokenReply)] : []),
|
|
1721
|
-
// When the model may look at the person, or that it cannot see them and why.
|
|
1722
|
-
...(turnVisionText ? [turnVisionText] : []),
|
|
1723
|
-
// When the model may ask for photos, and what has happened in a capture.
|
|
1724
|
-
...(turnCaptureText ? [turnCaptureText] : []),
|
|
1725
|
-
...(expired.outcomes.length > 0 ? [expiredNote(expired)] : []),
|
|
1726
|
-
...(input.stepContext?.trim() ? [input.stepContext.trim()] : []),
|
|
1737
|
+
// Placed after the conversation, the turn's context goes between the page and the notes, as it did in 0.30.
|
|
1738
|
+
...(turnContextPlacement === 'after-conversation' ? turnContext : []),
|
|
1727
1739
|
...(notes.length > 0 ? [[STEP_NOTE_OPEN, ...notes, STEP_NOTE_CLOSE].join('\n')] : []),
|
|
1728
1740
|
];
|
|
1729
1741
|
const withCachePoint = (msgs) => !cachePoint ? msgs : [
|
|
@@ -1900,7 +1912,7 @@ export async function runAgentTurn(config, input) {
|
|
|
1900
1912
|
const stepMessages = leftOut.length > 0 && messages ? withoutLeftOut(trimmed?.messages ?? messages, leftOut) : trimmed?.messages ?? messages;
|
|
1901
1913
|
return {
|
|
1902
1914
|
...constraints,
|
|
1903
|
-
...(stepMessages ? { messages: forStep(stepMessages, stepTail(notes), cachePoint) } : {}),
|
|
1915
|
+
...(stepMessages ? { messages: forStep(stepMessages, { turnContext: turnContextPlacement === 'with-message' ? turnContext : [], tail: stepTail(notes) }, cachePoint) } : {}),
|
|
1904
1916
|
instructions,
|
|
1905
1917
|
};
|
|
1906
1918
|
},
|