@ouispec/agent-worker 0.27.0 → 0.29.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 +40 -15
- package/dist/authz/tool-policy.d.ts +6 -5
- package/dist/authz/tool-policy.d.ts.map +1 -1
- package/dist/authz/tool-policy.js.map +1 -1
- package/dist/capture/capture-tools.d.ts +51 -0
- package/dist/capture/capture-tools.d.ts.map +1 -0
- package/dist/capture/capture-tools.js +242 -0
- package/dist/capture/capture-tools.js.map +1 -0
- package/dist/index.d.ts +9 -4
- 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 +19 -9
- package/dist/live-call/handler.d.ts.map +1 -1
- package/dist/live-call/handler.js +44 -18
- package/dist/live-call/handler.js.map +1 -1
- package/dist/live-call/protocol.d.ts +76 -31
- package/dist/live-call/protocol.d.ts.map +1 -1
- package/dist/live-call/protocol.js +88 -35
- package/dist/live-call/protocol.js.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +27 -14
- package/dist/orchestrator.js.map +1 -1
- package/dist/prompt/bearer-route.d.ts +33 -0
- package/dist/prompt/bearer-route.d.ts.map +1 -0
- package/dist/prompt/bearer-route.js +57 -0
- package/dist/prompt/bearer-route.js.map +1 -0
- package/dist/prompt/capture.d.ts +132 -0
- package/dist/prompt/capture.d.ts.map +1 -0
- package/dist/prompt/capture.js +230 -0
- package/dist/prompt/capture.js.map +1 -0
- package/dist/prompt/escape.d.ts +7 -0
- package/dist/prompt/escape.d.ts.map +1 -0
- package/dist/prompt/escape.js +9 -0
- package/dist/prompt/escape.js.map +1 -0
- package/dist/prompt/vision.d.ts +63 -55
- package/dist/prompt/vision.d.ts.map +1 -1
- package/dist/prompt/vision.js +87 -90
- package/dist/prompt/vision.js.map +1 -1
- package/dist/runtime/turn-runner.d.ts.map +1 -1
- package/dist/runtime/turn-runner.js +14 -1
- package/dist/runtime/turn-runner.js.map +1 -1
- package/dist/runtime/types.d.ts +16 -6
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/step-messages.d.ts +2 -6
- package/dist/step-messages.d.ts.map +1 -1
- package/dist/step-messages.js +3 -7
- package/dist/step-messages.js.map +1 -1
- package/dist/tools/types.d.ts +17 -3
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/types.d.ts +13 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/vision/look-tool.d.ts +43 -0
- package/dist/vision/look-tool.d.ts.map +1 -0
- package/dist/vision/look-tool.js +145 -0
- package/dist/vision/look-tool.js.map +1 -0
- package/package.json +4 -4
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Content-Type: application/json
|
|
13
13
|
* Accept: text/event-stream
|
|
14
14
|
*
|
|
15
|
-
* { sessionId, clientRef, turnId, kind, text, input?, output?, supersedes?, disclosureLine?, client?: { ui?, vision? } }
|
|
15
|
+
* { sessionId, clientRef, turnId, kind, text, input?, output?, supersedes?, disclosureLine?, client?: { ui?, vision?, capture? } }
|
|
16
16
|
*
|
|
17
17
|
* `input` is `{ mode: 'voice', language? }` for what the person said and
|
|
18
18
|
* `{ mode: 'text' }` for what they typed during the call. `output` is
|
|
@@ -23,24 +23,45 @@
|
|
|
23
23
|
* `client.ui`, when the person's page sent its UI into the call, is that page
|
|
24
24
|
* as its typed turns carry it: `{ buildId?, currentPath?, oui?, uiKnowledge? }`.
|
|
25
25
|
*
|
|
26
|
-
* `client.vision`, when the character
|
|
26
|
+
* `client.vision`, when the character may see the caller, is
|
|
27
27
|
*
|
|
28
|
-
* { seeing, remarks,
|
|
29
|
-
*
|
|
28
|
+
* { seeing, remarks, canLook, absent: 'camera_off' | 'turned_off' | null,
|
|
29
|
+
* look: { url, token, expiresAt } | null, observation: '<one sentence>' | null }
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
* bring up what it sees unprompted.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
31
|
+
* No turn carries a picture. `seeing`: the character may see
|
|
32
|
+
* the caller; `remarks`: it may bring up what it sees unprompted. With
|
|
33
|
+
* `canLook`, the model is given the `look` tool, which asks the call service's
|
|
34
|
+
* `look.url` a question about the caller's camera with `look.token` and is
|
|
35
|
+
* answered in words; it is told to look only when the conversation calls for
|
|
36
|
+
* it. Without, it is told it cannot see the caller, and why (`absent`). The
|
|
37
|
+
* token, a look's question and answer, and the observation are never logged
|
|
38
|
+
* or emitted.
|
|
38
39
|
*
|
|
39
40
|
* A `glance` turn is the call service's look between turns: nobody has spoken
|
|
40
|
-
* for a while and
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* with no `text`, and the
|
|
41
|
+
* for a while, and its own look noticed something worth a remark. `text` is
|
|
42
|
+
* empty, `client.vision.remarks` is on and `client.vision.observation` says
|
|
43
|
+
* what was noticed. The model phrases one short remark on it (and may look for
|
|
44
|
+
* more), or says nothing: an empty answer is `done` with no `text`, and the
|
|
45
|
+
* call stays silent. `observation` is read on a glance only.
|
|
46
|
+
*
|
|
47
|
+
* `client.capture`, on every turn of a session whose client defined capture
|
|
48
|
+
* plans, is
|
|
49
|
+
*
|
|
50
|
+
* { plans: [{ key, title, offerWhen }], control: { url, token, expiresAt },
|
|
51
|
+
* active: { captureId, plan, status, step: { id, label, index, of } | null } | null,
|
|
52
|
+
* update: '<words>' | null }
|
|
53
|
+
*
|
|
54
|
+
* With plans and a control route, the model has `capture_start`,
|
|
55
|
+
* `capture_status` and `capture_stop` (capture/capture-tools.ts), which call
|
|
56
|
+
* the route with the token. Everything it learns of a capture is words: no
|
|
57
|
+
* turn or tool carries a photo. A `capture` turn is the call service passing
|
|
58
|
+
* on what happened in a capture: `text` is empty, `client.capture.update`
|
|
59
|
+
* says what happened, and the model reads `liveCallCaptureMessage(update)`
|
|
60
|
+
* where the person's words would be. It narrates it in a short line, or says
|
|
61
|
+
* nothing. The call service sends `client.capture` and `capture` turns only to
|
|
62
|
+
* a brain whose endpoint declares `acceptsCapture`: a worker before them
|
|
63
|
+
* refuses a turn kind it does not know. The token and the update's words are
|
|
64
|
+
* never logged.
|
|
44
65
|
*
|
|
45
66
|
* and the answer is `200 text/event-stream`:
|
|
46
67
|
*
|
|
@@ -53,13 +74,17 @@
|
|
|
53
74
|
*/
|
|
54
75
|
import { readMessageInput, readReplyOutput } from '@ouispec/agent-core';
|
|
55
76
|
import { VISION_LIMITS, readTurnVision } from '../prompt/vision.js';
|
|
77
|
+
import { CAPTURE_LIMITS, readTurnCapture } from '../prompt/capture.js';
|
|
78
|
+
import { escapeTagText } from '../prompt/escape.js';
|
|
56
79
|
/**
|
|
57
80
|
* `message`: the person said `text`. `opening`: the call has just connected;
|
|
58
81
|
* nothing has been said, and the agent greets. `glance`: nobody has spoken for
|
|
59
82
|
* a while and the caller's picture changed; the agent remarks on it, or says
|
|
83
|
+
* nothing. `capture`: something happened in a photo capture
|
|
84
|
+
* (`client.capture.update`); the agent says it in a short line, or says
|
|
60
85
|
* nothing.
|
|
61
86
|
*/
|
|
62
|
-
export const LIVE_CALL_TURN_KINDS = ['message', 'opening', 'glance'];
|
|
87
|
+
export const LIVE_CALL_TURN_KINDS = ['message', 'opening', 'glance', 'capture'];
|
|
63
88
|
/**
|
|
64
89
|
* The person's message for an `opening` turn: an instruction to greet, which
|
|
65
90
|
* the model reads where the person's words would be. A host that stores the
|
|
@@ -86,16 +111,33 @@ export function liveCallOpeningMessage(request) {
|
|
|
86
111
|
}
|
|
87
112
|
/**
|
|
88
113
|
* The person's message for a `glance` turn, as the model reads it: an
|
|
89
|
-
* instruction to
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* the opening's
|
|
114
|
+
* instruction to phrase one short remark on what a look at the camera just
|
|
115
|
+
* noticed (the turn's `observation`, in its vision note), or to say nothing,
|
|
116
|
+
* so the call stays silent. A host that stores the person's messages stores
|
|
117
|
+
* this for the glance turn, as it stores the opening's: the observation is
|
|
118
|
+
* never in it.
|
|
93
119
|
*/
|
|
94
|
-
export const LIVE_CALL_GLANCE_MESSAGE = '<call_glance>Nobody has spoken for a few seconds, and
|
|
95
|
-
'
|
|
96
|
-
'
|
|
120
|
+
export const LIVE_CALL_GLANCE_MESSAGE = '<call_glance>Nobody has spoken for a few seconds, and a look at the user’s camera noticed something; what it noticed is in the vision note. ' +
|
|
121
|
+
'This is not a message from the user. ' +
|
|
122
|
+
'If it is worth one brief, friendly remark (they hold something up, put something on, someone else appears), say that remark, in one short sentence; ' +
|
|
123
|
+
'you may look first if you need to see more. ' +
|
|
97
124
|
'Otherwise answer with nothing at all, not a word or a mark, and the call stays silent. ' +
|
|
98
125
|
'Never repeat a remark you have already made in this call.</call_glance>';
|
|
126
|
+
/**
|
|
127
|
+
* The person's message for a `capture` turn, as the model reads it: what
|
|
128
|
+
* happened in the photo capture, in Closure's words (`client.capture.update`),
|
|
129
|
+
* and an instruction to say it to the caller in a short line, or to say
|
|
130
|
+
* nothing, so the call stays silent. A host that stores the person's messages
|
|
131
|
+
* stores this for the capture turn (`liveCallTurnMessage(request)` gives it),
|
|
132
|
+
* so the conversation keeps what happened in the capture as a readable row.
|
|
133
|
+
*/
|
|
134
|
+
export function liveCallCaptureMessage(update) {
|
|
135
|
+
return (`<call_capture><capture_update>${escapeTagText(update.trim())}</capture_update> ` +
|
|
136
|
+
'This is an update from the photo capture on the user’s screen, in Closure’s words: not a message from the user, and never something you saw. ' +
|
|
137
|
+
'Say it to them in one or two short, natural sentences in their language, as their guide through the photos, and never read out a code. ' +
|
|
138
|
+
'When it ends with an offer ("Offer: …"), the photos did not all get taken: say what is missing without pushing, and make that offer. ' +
|
|
139
|
+
'If nothing in it is worth saying, answer with nothing at all, not a word or a mark, and the call stays silent.</call_capture>');
|
|
140
|
+
}
|
|
99
141
|
/**
|
|
100
142
|
* The `input` mode of a message the person typed during the call. It is read
|
|
101
143
|
* as typed: the turn's context carries no `input`, as for a message typed in
|
|
@@ -116,8 +158,10 @@ export const LIVE_CALL_LIMITS = {
|
|
|
116
158
|
disclosureLineChars: 1_000,
|
|
117
159
|
/** The most `client.ui` may weigh, as UTF-8 JSON: the bound the page and the call service hold it to. */
|
|
118
160
|
clientUiBytes: 64 * 1024,
|
|
119
|
-
/** The longest `client.vision.
|
|
120
|
-
|
|
161
|
+
/** The longest `client.vision.observation` (`VISION_LIMITS.observationChars`). */
|
|
162
|
+
visionObservationChars: VISION_LIMITS.observationChars,
|
|
163
|
+
/** The longest `client.capture.update` (`CAPTURE_LIMITS.updateChars`). */
|
|
164
|
+
captureUpdateChars: CAPTURE_LIMITS.updateChars,
|
|
121
165
|
};
|
|
122
166
|
/** An id: letters, digits and `.` `_` `:` `-`, starting with a letter or digit. */
|
|
123
167
|
const ID = new RegExp(`^[A-Za-z0-9][A-Za-z0-9._:-]{0,${LIVE_CALL_LIMITS.idChars - 1}}$`);
|
|
@@ -151,7 +195,7 @@ export function readLiveCallTurnRequest(body) {
|
|
|
151
195
|
if (kind === 'message' && !text.trim())
|
|
152
196
|
return refuse('a message turn needs the text the person said');
|
|
153
197
|
if (kind !== 'message' && text.trim())
|
|
154
|
-
return refuse(`${kind === 'opening' ? 'an opening' :
|
|
198
|
+
return refuse(`${kind === 'opening' ? 'an opening' : `a ${kind}`} turn carries no text`);
|
|
155
199
|
for (const field of ['input', 'output']) {
|
|
156
200
|
const value = b[field];
|
|
157
201
|
if (value !== undefined && value !== null && (typeof value !== 'object' || Array.isArray(value)))
|
|
@@ -168,16 +212,21 @@ export function readLiveCallTurnRequest(body) {
|
|
|
168
212
|
(typeof disclosureLine !== 'string' || disclosureLine.length > LIVE_CALL_LIMITS.disclosureLineChars || CONTROL.test(disclosureLine))) {
|
|
169
213
|
return refuse(`disclosureLine must be a string of at most ${LIVE_CALL_LIMITS.disclosureLineChars} characters with no control characters`);
|
|
170
214
|
}
|
|
171
|
-
const
|
|
172
|
-
if (typeof
|
|
173
|
-
return refuse(
|
|
215
|
+
const read = readClient(b.client);
|
|
216
|
+
if (typeof read === 'string')
|
|
217
|
+
return refuse(read);
|
|
174
218
|
if (kind === 'glance') {
|
|
175
|
-
// A glance
|
|
176
|
-
if (!
|
|
177
|
-
return refuse('a glance turn needs client.vision.frame');
|
|
178
|
-
if (!client.vision.remarks)
|
|
219
|
+
// A glance offers a remark on what was noticed: without leave to remark, or with nothing noticed, there is nothing to run.
|
|
220
|
+
if (!read?.vision?.remarks)
|
|
179
221
|
return refuse('a glance turn needs client.vision.remarks on');
|
|
222
|
+
if (!read.vision.observation)
|
|
223
|
+
return refuse('a glance turn needs client.vision.observation');
|
|
180
224
|
}
|
|
225
|
+
// A capture turn passes on what happened in a capture: with nothing to pass on, there is nothing to run.
|
|
226
|
+
if (kind === 'capture' && !read?.capture?.update)
|
|
227
|
+
return refuse('a capture turn needs client.capture.update');
|
|
228
|
+
// What a look noticed belongs to its glance alone.
|
|
229
|
+
const client = read?.vision?.observation && kind !== 'glance' ? { ...read, vision: { ...read.vision, observation: null } } : read;
|
|
181
230
|
return {
|
|
182
231
|
ok: true,
|
|
183
232
|
request: {
|
|
@@ -202,7 +251,8 @@ function isPlainObject(value) {
|
|
|
202
251
|
/**
|
|
203
252
|
* The request's `client`, or why it is not one. Fields it does not know are
|
|
204
253
|
* left out, so a newer call service is read past; a known field of the wrong
|
|
205
|
-
* type is refused, naming it. A refusal never repeats a
|
|
254
|
+
* type is refused, naming it. A refusal never repeats a look's or a capture's
|
|
255
|
+
* token.
|
|
206
256
|
*/
|
|
207
257
|
function readClient(value) {
|
|
208
258
|
if (value === undefined || value === null)
|
|
@@ -212,10 +262,13 @@ function readClient(value) {
|
|
|
212
262
|
const vision = readTurnVision(value.vision, 'client.vision');
|
|
213
263
|
if (typeof vision === 'string')
|
|
214
264
|
return vision;
|
|
265
|
+
const capture = readTurnCapture(value.capture, 'client.capture');
|
|
266
|
+
if (typeof capture === 'string')
|
|
267
|
+
return capture;
|
|
215
268
|
const ui = readClientUi(value.ui);
|
|
216
269
|
if (typeof ui === 'string')
|
|
217
270
|
return ui;
|
|
218
|
-
return { ui, vision };
|
|
271
|
+
return { ui, vision, capture };
|
|
219
272
|
}
|
|
220
273
|
/** The request's `client.ui`, or why it is not one. */
|
|
221
274
|
function readClientUi(raw) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/live-call/protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/live-call/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAuC,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAkHzF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,mGAAmG;IACnG,8HAA8H,CAAC;AAEjI;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAoD;IACzF,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IAClD,IAAI,CAAC,UAAU;QAAE,OAAO,yBAAyB,CAAC;IAClD,OAAO,CACL,mGAAmG;QACnG,sDAAsD,UAAU,IAAI;QACpE,wHAAwH;QACxH,qDAAqD,CACtD,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAA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,IAAI,CAAC,KAAK,IAAI;YAAE,SAAS;QAC5C,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YAAE,OAAO,aAAa,KAAK,oBAAoB,CAAC;QACrE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,kEAAkE;AAClE,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA4B,CAAC,IAAI,KAAK,0BAA0B,CAAC;AACnH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAqC;IACxE,UAAU,EAAE,+CAA+C;IAC3D,mBAAmB,EAAE,oCAAoC;IACzD,aAAa,EAAE,sBAAsB;IACrC,YAAY,EAAE,qBAAqB;IACnC,sBAAsB,EAAE,2BAA2B;IACnD,YAAY,EAAE,0EAA0E;IACxF,aAAa,EAAE,uCAAuC;IACtD,YAAY,EAAE,kBAAkB;CACjC,CAAC;AAEF,4CAA4C;AAC5C,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,wBAAwB,CAAC,IAAI,CAAC,IAAI,wBAAwB,CAAC,YAAY,EAAE,CAAC;AACpG,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;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAmE,MAAM,I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,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GACnF,WAAW,EAAE,CAoCf"}
|
package/dist/orchestrator.js
CHANGED
|
@@ -36,7 +36,10 @@ import { stepMessages as forStep, STEP_NOTE_CLOSE, STEP_NOTE_OPEN } from './step
|
|
|
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';
|
|
39
|
-
import {
|
|
39
|
+
import { visionText } from './prompt/vision.js';
|
|
40
|
+
import { lookTool } from './vision/look-tool.js';
|
|
41
|
+
import { captureText } from './prompt/capture.js';
|
|
42
|
+
import { captureTools } from './capture/capture-tools.js';
|
|
40
43
|
import { AttachmentGuard } from './attachments/guard.js';
|
|
41
44
|
import { ATTACHMENT_DATA_NOTE, turnAttachmentParts, withReferenceLines, withTurnAttachments, withoutLeftOut } from './attachments/content.js';
|
|
42
45
|
import { attachmentTools } from './attachments/tools.js';
|
|
@@ -214,6 +217,12 @@ export async function runAgentTurn(config, input) {
|
|
|
214
217
|
conversationUsed: conversationFileTokens,
|
|
215
218
|
});
|
|
216
219
|
const fileTools = fileArea ? attachmentTools({ store: fileArea.store, owner: fileOwner, guard: fileGuard }) : [];
|
|
220
|
+
// The caller's camera is looked at only when the model chooses to (vision/look-tool.ts): no turn carries a picture.
|
|
221
|
+
const visionTools = input.vision?.canLook && input.vision.look ? [lookTool(input.vision.look)] : [];
|
|
222
|
+
// The SDK's own tools: they take their names before the host's.
|
|
223
|
+
// The caller is asked for photos only through the client's plans (capture/capture-tools.ts): words, never a photo.
|
|
224
|
+
const photoTools = captureTools(input.capture);
|
|
225
|
+
const sdkTools = [...fileTools, ...visionTools, ...photoTools];
|
|
217
226
|
log('info', 'agent:ui', 'UI surfaces for this turn', {
|
|
218
227
|
turnId,
|
|
219
228
|
clientSentSnapshot: client !== null,
|
|
@@ -455,6 +464,8 @@ export async function runAgentTurn(config, input) {
|
|
|
455
464
|
const executeCall = async (t, rawArgs, toolUseId, uiSlot, approved) => {
|
|
456
465
|
const startMs = Date.now();
|
|
457
466
|
const isUI = t.kind === 'ui';
|
|
467
|
+
// A tool whose input speaks of the person (a look's question) is said to have been called, and no more.
|
|
468
|
+
const shownInput = (value) => (t.inputPrivate ? {} : value);
|
|
458
469
|
// A stopped turn starts nothing more.
|
|
459
470
|
if (stopState.reason())
|
|
460
471
|
return { text: resultText(stoppedNotRun(t.name)), ran: false };
|
|
@@ -471,7 +482,7 @@ export async function runAgentTurn(config, input) {
|
|
|
471
482
|
turnId,
|
|
472
483
|
toolUseId,
|
|
473
484
|
name: t.name,
|
|
474
|
-
input: given,
|
|
485
|
+
input: shownInput(given),
|
|
475
486
|
timestamp: now,
|
|
476
487
|
});
|
|
477
488
|
await emitAfterText(AGENT_SOCKET_EVENTS.TOOL_CALL_COMPLETE, {
|
|
@@ -756,7 +767,7 @@ export async function runAgentTurn(config, input) {
|
|
|
756
767
|
turnId,
|
|
757
768
|
toolName: t.name,
|
|
758
769
|
kind: t.kind ?? 'backend',
|
|
759
|
-
input: args,
|
|
770
|
+
...(t.inputPrivate ? { inputPrivate: true } : { input: args }),
|
|
760
771
|
...(approved ? { approvalId: approved.approvalId } : {}),
|
|
761
772
|
});
|
|
762
773
|
// Emit tool call started BEFORE execution
|
|
@@ -764,7 +775,7 @@ export async function runAgentTurn(config, input) {
|
|
|
764
775
|
turnId,
|
|
765
776
|
toolUseId,
|
|
766
777
|
name: t.name,
|
|
767
|
-
input: callArgs,
|
|
778
|
+
input: shownInput(callArgs),
|
|
768
779
|
timestamp: startMs,
|
|
769
780
|
});
|
|
770
781
|
// Execute with timeout
|
|
@@ -1073,9 +1084,9 @@ export async function runAgentTurn(config, input) {
|
|
|
1073
1084
|
// with the id of an action of the page, is withheld: for a
|
|
1074
1085
|
// UI-only agent, the page is the authority.
|
|
1075
1086
|
function hostTools(ui) {
|
|
1076
|
-
const sdkOwned = new Set(
|
|
1087
|
+
const sdkOwned = new Set(sdkTools.map((t) => t.name));
|
|
1077
1088
|
if (!ui)
|
|
1078
|
-
return [...config.tools.tools.filter((t) => !sdkOwned.has(t.name)), ...
|
|
1089
|
+
return [...config.tools.tools.filter((t) => !sdkOwned.has(t.name)), ...sdkTools];
|
|
1079
1090
|
const taken = (name) => sdkOwned.has(name) || ui.actions.has(name) || UI_TOOL_NAMES.has(name);
|
|
1080
1091
|
const withheld = config.tools.tools.filter((t) => taken(t.name)).map((t) => t.name);
|
|
1081
1092
|
if (withheld.length > 0) {
|
|
@@ -1084,7 +1095,7 @@ export async function runAgentTurn(config, input) {
|
|
|
1084
1095
|
withheld,
|
|
1085
1096
|
});
|
|
1086
1097
|
}
|
|
1087
|
-
return [...config.tools.tools.filter((t) => !taken(t.name)), ...
|
|
1098
|
+
return [...config.tools.tools.filter((t) => !taken(t.name)), ...sdkTools];
|
|
1088
1099
|
}
|
|
1089
1100
|
/** Every tool a call can name: the host's, and the page's actions. What an approved call is looked up in. */
|
|
1090
1101
|
function callableTools() {
|
|
@@ -1158,8 +1169,8 @@ export async function runAgentTurn(config, input) {
|
|
|
1158
1169
|
function describeStepTool(name) {
|
|
1159
1170
|
if (UI_TOOL_NAMES.has(name))
|
|
1160
1171
|
return { name, kind: 'ui' };
|
|
1161
|
-
// The SDK's own
|
|
1162
|
-
const registered =
|
|
1172
|
+
// The SDK's own tools take their names before the host's (hostTools).
|
|
1173
|
+
const registered = sdkTools.find((t) => t.name === name) ?? config.tools.tools.find((t) => t.name === name);
|
|
1163
1174
|
if (!registered)
|
|
1164
1175
|
return { name, kind: 'builtin' };
|
|
1165
1176
|
return { name, kind: registered.kind === 'ui' ? 'ui' : 'backend', ...(registered.toolClass ? { toolClass: registered.toolClass } : {}) };
|
|
@@ -1671,10 +1682,10 @@ export async function runAgentTurn(config, input) {
|
|
|
1671
1682
|
const turnSpoken = input.approval || input.resume ? null : readClientMessageInput(input.context ?? null);
|
|
1672
1683
|
// The reply is spoken on every turn of a call, the turn an approval continues included.
|
|
1673
1684
|
const turnSpokenReply = readClientReplyOutput(input.context ?? null);
|
|
1674
|
-
//
|
|
1685
|
+
// Whether the model may look at the person, and how, or why it cannot (prompt/vision.ts): a line after the conversation.
|
|
1675
1686
|
const turnVisionText = visionText(input.vision);
|
|
1676
|
-
|
|
1677
|
-
const
|
|
1687
|
+
// When to offer each photo plan, where a running capture stands, and an update that rode this turn (prompt/capture.ts).
|
|
1688
|
+
const turnCaptureText = captureText(input.capture);
|
|
1678
1689
|
const turnPageValues = client && client.page.length > 0
|
|
1679
1690
|
? [
|
|
1680
1691
|
observationsText(client.observations, config.ui?.maxObservationChars ?? DEFAULT_PAGE_STATE_CHARS, {
|
|
@@ -1707,8 +1718,10 @@ export async function runAgentTurn(config, input) {
|
|
|
1707
1718
|
...(turnSpoken ? [spokenInputText(turnSpoken)] : []),
|
|
1708
1719
|
// A reply a voice will read out is written for the ear (prompt/spoken-reply.ts).
|
|
1709
1720
|
...(turnSpokenReply ? [spokenReplyText(turnSpokenReply)] : []),
|
|
1710
|
-
//
|
|
1721
|
+
// When the model may look at the person, or that it cannot see them and why.
|
|
1711
1722
|
...(turnVisionText ? [turnVisionText] : []),
|
|
1723
|
+
// When the model may ask for photos, and what has happened in a capture.
|
|
1724
|
+
...(turnCaptureText ? [turnCaptureText] : []),
|
|
1712
1725
|
...(expired.outcomes.length > 0 ? [expiredNote(expired)] : []),
|
|
1713
1726
|
...(input.stepContext?.trim() ? [input.stepContext.trim()] : []),
|
|
1714
1727
|
...(notes.length > 0 ? [[STEP_NOTE_OPEN, ...notes, STEP_NOTE_CLOSE].join('\n')] : []),
|
|
@@ -1887,7 +1900,7 @@ export async function runAgentTurn(config, input) {
|
|
|
1887
1900
|
const stepMessages = leftOut.length > 0 && messages ? withoutLeftOut(trimmed?.messages ?? messages, leftOut) : trimmed?.messages ?? messages;
|
|
1888
1901
|
return {
|
|
1889
1902
|
...constraints,
|
|
1890
|
-
...(stepMessages ? { messages: forStep(stepMessages, stepTail(notes), cachePoint
|
|
1903
|
+
...(stepMessages ? { messages: forStep(stepMessages, stepTail(notes), cachePoint) } : {}),
|
|
1891
1904
|
instructions,
|
|
1892
1905
|
};
|
|
1893
1906
|
},
|