@ouispec/agent-worker 0.32.2 → 0.32.4

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.
Files changed (121) hide show
  1. package/README.md +30 -3
  2. package/dist/approvals/client.d.ts +3 -2
  3. package/dist/approvals/client.d.ts.map +1 -1
  4. package/dist/approvals/client.js +6 -4
  5. package/dist/approvals/client.js.map +1 -1
  6. package/dist/attachments/content.d.ts +6 -8
  7. package/dist/attachments/content.d.ts.map +1 -1
  8. package/dist/attachments/content.js +29 -13
  9. package/dist/attachments/content.js.map +1 -1
  10. package/dist/capture/capture-tools.d.ts +2 -3
  11. package/dist/capture/capture-tools.d.ts.map +1 -1
  12. package/dist/capture/capture-tools.js +2 -3
  13. package/dist/capture/capture-tools.js.map +1 -1
  14. package/dist/conversations/client.d.ts +3 -2
  15. package/dist/conversations/client.d.ts.map +1 -1
  16. package/dist/conversations/client.js +6 -4
  17. package/dist/conversations/client.js.map +1 -1
  18. package/dist/emit/http-adapter.d.ts +4 -2
  19. package/dist/emit/http-adapter.d.ts.map +1 -1
  20. package/dist/emit/http-adapter.js +9 -6
  21. package/dist/emit/http-adapter.js.map +1 -1
  22. package/dist/events/http-waiter.d.ts +3 -2
  23. package/dist/events/http-waiter.d.ts.map +1 -1
  24. package/dist/events/http-waiter.js +4 -2
  25. package/dist/events/http-waiter.js.map +1 -1
  26. package/dist/handoff/handoff-tool.d.ts +2 -1
  27. package/dist/handoff/handoff-tool.d.ts.map +1 -1
  28. package/dist/handoff/handoff-tool.js +2 -1
  29. package/dist/handoff/handoff-tool.js.map +1 -1
  30. package/dist/index.d.ts +7 -4
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +8 -4
  33. package/dist/index.js.map +1 -1
  34. package/dist/orchestrator.d.ts +24 -2
  35. package/dist/orchestrator.d.ts.map +1 -1
  36. package/dist/orchestrator.js +243 -84
  37. package/dist/orchestrator.js.map +1 -1
  38. package/dist/prompt/builder.d.ts +10 -0
  39. package/dist/prompt/builder.d.ts.map +1 -1
  40. package/dist/prompt/builder.js +14 -2
  41. package/dist/prompt/builder.js.map +1 -1
  42. package/dist/prompt/capture.d.ts +9 -3
  43. package/dist/prompt/capture.d.ts.map +1 -1
  44. package/dist/prompt/capture.js +32 -11
  45. package/dist/prompt/capture.js.map +1 -1
  46. package/dist/prompt/handoff.d.ts +5 -2
  47. package/dist/prompt/handoff.d.ts.map +1 -1
  48. package/dist/prompt/handoff.js +13 -5
  49. package/dist/prompt/handoff.js.map +1 -1
  50. package/dist/prompt/index.d.ts +1 -1
  51. package/dist/prompt/index.d.ts.map +1 -1
  52. package/dist/prompt/index.js +1 -1
  53. package/dist/prompt/index.js.map +1 -1
  54. package/dist/prompt/rules/tool-strategy.d.ts +5 -5
  55. package/dist/prompt/rules/tool-strategy.d.ts.map +1 -1
  56. package/dist/prompt/rules/tool-strategy.js +27 -6
  57. package/dist/prompt/rules/tool-strategy.js.map +1 -1
  58. package/dist/prompt/rules/ui-control.d.ts +5 -9
  59. package/dist/prompt/rules/ui-control.d.ts.map +1 -1
  60. package/dist/prompt/rules/ui-control.js +49 -14
  61. package/dist/prompt/rules/ui-control.js.map +1 -1
  62. package/dist/prompt/step-tools.d.ts +68 -0
  63. package/dist/prompt/step-tools.d.ts.map +1 -0
  64. package/dist/prompt/step-tools.js +72 -0
  65. package/dist/prompt/step-tools.js.map +1 -0
  66. package/dist/prompt/vision.d.ts +4 -2
  67. package/dist/prompt/vision.d.ts.map +1 -1
  68. package/dist/prompt/vision.js +17 -4
  69. package/dist/prompt/vision.js.map +1 -1
  70. package/dist/realtime/api-key.d.ts +65 -0
  71. package/dist/realtime/api-key.d.ts.map +1 -0
  72. package/dist/realtime/api-key.js +120 -0
  73. package/dist/realtime/api-key.js.map +1 -0
  74. package/dist/realtime/long-poll.d.ts +6 -2
  75. package/dist/realtime/long-poll.d.ts.map +1 -1
  76. package/dist/realtime/long-poll.js +20 -1
  77. package/dist/realtime/long-poll.js.map +1 -1
  78. package/dist/runtime/config.d.ts.map +1 -1
  79. package/dist/runtime/config.js +2 -1
  80. package/dist/runtime/config.js.map +1 -1
  81. package/dist/runtime/turn-runner.d.ts.map +1 -1
  82. package/dist/runtime/turn-runner.js +10 -4
  83. package/dist/runtime/turn-runner.js.map +1 -1
  84. package/dist/runtime/types.d.ts +13 -1
  85. package/dist/runtime/types.d.ts.map +1 -1
  86. package/dist/step-messages.d.ts +8 -0
  87. package/dist/step-messages.d.ts.map +1 -1
  88. package/dist/step-messages.js +24 -0
  89. package/dist/step-messages.js.map +1 -1
  90. package/dist/stop/turn-stop.d.ts +3 -2
  91. package/dist/stop/turn-stop.d.ts.map +1 -1
  92. package/dist/stop/turn-stop.js +9 -3
  93. package/dist/stop/turn-stop.js.map +1 -1
  94. package/dist/time-hand-back.d.ts +6 -2
  95. package/dist/time-hand-back.d.ts.map +1 -1
  96. package/dist/time-hand-back.js +13 -3
  97. package/dist/time-hand-back.js.map +1 -1
  98. package/dist/tools/builtin-tools.d.ts +2 -0
  99. package/dist/tools/builtin-tools.d.ts.map +1 -1
  100. package/dist/tools/builtin-tools.js +3 -1
  101. package/dist/tools/builtin-tools.js.map +1 -1
  102. package/dist/tools/sdk-tool-names.d.ts +27 -0
  103. package/dist/tools/sdk-tool-names.d.ts.map +1 -0
  104. package/dist/tools/sdk-tool-names.js +27 -0
  105. package/dist/tools/sdk-tool-names.js.map +1 -0
  106. package/dist/turn-policy.d.ts +9 -1
  107. package/dist/turn-policy.d.ts.map +1 -1
  108. package/dist/turn-policy.js.map +1 -1
  109. package/dist/ui/channel.d.ts +3 -2
  110. package/dist/ui/channel.d.ts.map +1 -1
  111. package/dist/ui/channel.js +14 -11
  112. package/dist/ui/channel.js.map +1 -1
  113. package/dist/ui/knowledge.d.ts +8 -5
  114. package/dist/ui/knowledge.d.ts.map +1 -1
  115. package/dist/ui/knowledge.js +17 -9
  116. package/dist/ui/knowledge.js.map +1 -1
  117. package/dist/vision/look-tool.d.ts +2 -1
  118. package/dist/vision/look-tool.d.ts.map +1 -1
  119. package/dist/vision/look-tool.js +2 -1
  120. package/dist/vision/look-tool.js.map +1 -1
  121. package/package.json +2 -2
@@ -34,6 +34,8 @@
34
34
  */
35
35
  import { readBearerRoute } from './bearer-route.js';
36
36
  import { escapeTagText } from './escape.js';
37
+ import { EVERY_TOOL, renderPieces, renderRule } from './step-tools.js';
38
+ import { CAPTURE_START_TOOL, CAPTURE_STATUS_TOOL, CAPTURE_STOP_TOOL, LOOK_TOOL } from '../tools/sdk-tool-names.js';
37
39
  // ─── The capture contract's names and values ────────────────────────────────
38
40
  // Closure's capture contract (`@closurestudio/realtime-contracts`, `live-capture`)
39
41
  // declares these. This package does not depend on it, so it keeps its own copy
@@ -286,15 +288,29 @@ function readActive(value, field) {
286
288
  export function canCapture(capture) {
287
289
  return !!capture && capture.plans.length > 0 && capture.control !== null;
288
290
  }
291
+ /** The capture clause, in pieces: its words about `look` are said only to a step that offers it (prompt/step-tools.ts). */
292
+ const CAPTURE_WHEN_PIECES = [
293
+ 'You can ask the caller for photos with `capture_start` when a plan below fits. ' +
294
+ 'Closure’s checker accepts or rejects every photo; you never judge a photo',
295
+ { tools: [LOOK_TOOL], text: ', and you never use `look` for one' },
296
+ '. 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. ' +
297
+ 'When a capture ends without completing, offer what its update says to offer.',
298
+ ];
289
299
  /**
290
300
  * The clause every brain that takes captures is given, word for word:
291
301
  * Closure's brain in its spoken-reply contract, and a
292
- * client's brain here.
302
+ * client's brain here, when its step offers `look` too.
293
303
  */
294
- export const CAPTURE_WHEN = 'You can ask the caller for photos with `capture_start` when a plan below fits. ' +
295
- 'Closure’s checker accepts or rejects every photo; you never judge a photo, and you never use `look` for one. ' +
296
- '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. ' +
297
- 'When a capture ends without completing, offer what its update says to offer.';
304
+ export const CAPTURE_WHEN = captureWhen(EVERY_TOOL);
305
+ /** The capture clause as a step offering `offered` is told it: `look` is named only when the step offers it. */
306
+ export function captureWhen(offered) {
307
+ return renderPieces(CAPTURE_WHEN_PIECES, offered);
308
+ }
309
+ /** How the running capture is checked and stopped: said only to a step that offers both tools. */
310
+ const CAPTURE_STATUS_AND_STOP = {
311
+ tools: [CAPTURE_STATUS_TOOL, CAPTURE_STOP_TOOL],
312
+ text: 'Use `capture_status` to ask where it stands; use `capture_stop` only when the caller wants to stop.',
313
+ };
298
314
  /**
299
315
  * The sentence every brain that takes captures is given when the caller has
300
316
  * an earlier capture to continue, word for word: Closure's brain in its
@@ -335,21 +351,26 @@ const BLOCKED_WORDS = {
335
351
  * the conversation. With plans and a route, the clause (`CAPTURE_WHEN`), when
336
352
  * to offer each plan, and that it never sees a photo; where the running
337
353
  * capture stands; and an update that rode this turn, as data. Null when the
338
- * turn says nothing of captures, or nothing the model can use.
354
+ * turn says nothing of captures, or nothing the model can use. Written for
355
+ * the tools the step offers (`offered`): a step a host's policy holds to
356
+ * other tools is told photos cannot be started at that step, and is never
357
+ * told to call a capture tool, or `look`, it was not given.
339
358
  */
340
- export function captureText(capture) {
359
+ export function captureText(capture, offered = EVERY_TOOL) {
341
360
  if (!capture)
342
361
  return null;
343
362
  const parts = [];
344
- if (canCapture(capture)) {
363
+ if (canCapture(capture) && offered.has(CAPTURE_START_TOOL)) {
345
364
  const plans = capture.plans.map((p) => `"${p.key}" (${escapeTagText(p.title)}): offer it when ${escapeTagText(p.offerWhen)}`);
346
- parts.push(CAPTURE_WHEN, 'Offer a plan only when its “offer it when” applies, and start it once the caller agrees to take the photos; ' +
365
+ parts.push(captureWhen(offered), 'Offer a plan only when its “offer it when” applies, and start it once the caller agrees to take the photos; ' +
347
366
  'before you call `capture_start`, say one short line so they know a request for photos is coming to their screen.', CAPTURE_NEVER, `Plans: ${plans.join('; ')}.`,
348
367
  // An earlier capture to continue: offered when photos fit, so only what it is missing is asked.
349
368
  ...(capture.resumable?.length ? [CAPTURE_RESUME_WHEN] : []));
350
369
  }
351
370
  else if (capture.plans.length > 0 || capture.active || capture.update) {
352
- parts.push('Photos cannot be started, checked or stopped from this turn. ' +
371
+ parts.push(
372
+ // The turn can take photos, and this step cannot start them: a later step may.
373
+ (canCapture(capture) ? 'Photos cannot be started at this step. ' : 'Photos cannot be started, checked or stopped from this turn. ') +
353
374
  'While a capture runs, turn each capture update into one or two short, natural sentences in the caller’s language, and never read out a code; ' +
354
375
  'when one ends without completing, offer what its update says to offer.', CAPTURE_NEVER);
355
376
  }
@@ -357,7 +378,7 @@ export function captureText(capture) {
357
378
  const a = capture.active;
358
379
  const step = a.step ? `, on step ${a.step.index} of ${a.step.of}, ${escapeTagText(a.step.label)}` : '';
359
380
  parts.push(`A photo capture is running now: plan "${a.plan}", capture ${a.captureId}, ${a.blockedReason ? BLOCKED_WORDS[a.blockedReason] : STATUS_WORDS[a.status]}${step}. ` +
360
- (canCapture(capture) ? 'Use `capture_status` to ask where it stands; use `capture_stop` only when the caller wants to stop.' : ''));
381
+ (canCapture(capture) ? renderRule(CAPTURE_STATUS_AND_STOP, offered) : ''));
361
382
  }
362
383
  else if (canCapture(capture)) {
363
384
  parts.push('No photo capture is running now.');
@@ -1 +1 @@
1
- {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/prompt/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,+EAA+E;AAC/E,mFAAmF;AACnF,+EAA+E;AAC/E,mEAAmE;AAEnE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAGlH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,gBAAgB,GAAG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AsG,CACzG,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,YAAY,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC;AACpE,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,YAAY,CAAC,OAAuC;IAClE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM;QAC3B,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC;QAC7B,GAAG,CAAC,OAAO,CAAC,MAAM;YAChB,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;YACvI,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9E,CAAC;AACJ,CAAC"}
@@ -28,6 +28,7 @@
28
28
  * (`handoffFacts`).
29
29
  */
30
30
  import { type BearerRoute } from './bearer-route.js';
31
+ import { type OfferedTools } from './step-tools.js';
31
32
  /** Why the call moves (`CallHandoffPurpose`): the tool's `purpose`. */
32
33
  export declare const CALL_HANDOFF_PURPOSES: readonly ["photos", "caller_asked", "other"];
33
34
  export type CallHandoffPurpose = (typeof CALL_HANDOFF_PURPOSES)[number];
@@ -132,9 +133,11 @@ export declare const FORM_FACTOR_WORDS: Readonly<Record<CallFormFactor, string>>
132
133
  * the turn's message. With a route, the clause (`HANDOFF_WHEN`), and that it
133
134
  * never sees a device or a code; the device the call is on and how often it
134
135
  * has moved; an open offer; and an update that rode this turn, as data. Null
135
- * when the turn says nothing of hand-offs.
136
+ * when the turn says nothing of hand-offs. Written for the tools the step
137
+ * offers (`offered`): a step a host's policy holds to other tools is told the
138
+ * call cannot be moved at that step, and is never told to call `call_handoff`.
136
139
  */
137
- export declare function handoffText(handoff: TurnHandoff | null | undefined): string | null;
140
+ export declare function handoffText(handoff: TurnHandoff | null | undefined, offered?: OfferedTools): string | null;
138
141
  /** What a log line may say of a turn's hand-off: facts, never the token or the update's words. */
139
142
  export declare function handoffFacts(handoff: TurnHandoff | null | undefined): Record<string, unknown> | null;
140
143
  //# sourceMappingURL=handoff.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../src/prompt/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQtE,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,8CAA+C,CAAC;AAClF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,oDAAqD,CAAC;AACpF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,kDAAkD;AAClD,eAAO,MAAM,qBAAqB,0DAA2D,CAAC;AAC9F,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBA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GAAG,SAAS,GAAG,OAAO,IAAI,WAAW,GAAG;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,CAExH;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAIiF,CAAC;AAE3G,wEAAwE;AACxE,eAAO,MAAM,aAAa,iJACiH,CAAC;AAE5I,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAKtE,CAAC;AASF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,YAAyB,GAAG,MAAM,GAAG,IAAI,CAmCtH;AAED,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAQpG"}
@@ -29,6 +29,8 @@
29
29
  */
30
30
  import { readBearerRoute } from './bearer-route.js';
31
31
  import { escapeTagText } from './escape.js';
32
+ import { EVERY_TOOL } from './step-tools.js';
33
+ import { CALL_HANDOFF_TOOL } from '../tools/sdk-tool-names.js';
32
34
  // ─── The hand-off contract's names and values ───────────────────────────────
33
35
  // Closure's hand-off contract (`@closurestudio/realtime-contracts` 0.28.0, `live-call-devices`)
34
36
  // declares these. This package does not depend on it, so it keeps its own copy
@@ -173,17 +175,23 @@ const PURPOSE_WORDS = {
173
175
  * the turn's message. With a route, the clause (`HANDOFF_WHEN`), and that it
174
176
  * never sees a device or a code; the device the call is on and how often it
175
177
  * has moved; an open offer; and an update that rode this turn, as data. Null
176
- * when the turn says nothing of hand-offs.
178
+ * when the turn says nothing of hand-offs. Written for the tools the step
179
+ * offers (`offered`): a step a host's policy holds to other tools is told the
180
+ * call cannot be moved at that step, and is never told to call `call_handoff`.
177
181
  */
178
- export function handoffText(handoff) {
182
+ export function handoffText(handoff, offered = EVERY_TOOL) {
179
183
  if (!handoff)
180
184
  return null;
181
185
  const parts = [];
182
- if (canHandoff(handoff)) {
186
+ // The turn can move the call, and this step offers the tool that does.
187
+ const moves = canHandoff(handoff) && offered.has(CALL_HANDOFF_TOOL);
188
+ if (moves) {
183
189
  parts.push(HANDOFF_WHEN, HANDOFF_NEVER);
184
190
  }
185
191
  else {
186
- parts.push('The call cannot be moved to another device from this turn. ' +
192
+ parts.push(
193
+ // The turn can move the call, and this step cannot: a later step may.
194
+ `The call cannot be moved to another device ${canHandoff(handoff) ? 'at this step' : 'from this turn'}. ` +
187
195
  'While the call moves you receive device updates: answer each with one short sentence, or with nothing, and never read out a code or a link.', HANDOFF_NEVER);
188
196
  }
189
197
  if (handoff.device) {
@@ -196,7 +204,7 @@ export function handoffText(handoff) {
196
204
  }
197
205
  if (handoff.offer) {
198
206
  parts.push(`A QR code to continue on their phone ${PURPOSE_WORDS[handoff.offer.purpose]} is on their screen now, until ${handoff.offer.expiresAt}. ` +
199
- (canHandoff(handoff) ? 'Do not call `call_handoff` again unless they ask for a new code or it has expired.' : ''));
207
+ (moves ? 'Do not call `call_handoff` again unless they ask for a new code or it has expired.' : ''));
200
208
  }
201
209
  if (handoff.update) {
202
210
  parts.push(`<device_update>${escapeTagText(handoff.update)}</device_update> is what just happened to the caller’s devices: ` +
@@ -1 +1 @@
1
- {"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../src/prompt/handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,+EAA+E;AAC/E,gGAAgG;AAChG,+EAA+E;AAC/E,mEAAmE;AAEnE,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAU,CAAC;AAGlF,4FAA4F;AAC5F,MAAM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AE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAC;AACJ,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * The SDK handles generic behavioral intelligence (anti-hallucination, communication style,
6
6
  * tool strategy, UI control protocol).
7
7
  */
8
- export { buildAgentSystemPrompt } from './builder.js';
8
+ export { buildAgentSystemPrompt, systemPromptForTools } from './builder.js';
9
9
  export type { AgentPersonaConfig, AgentKnowledgeEntry, AgentWorkflow, AgentFewShotExample, AgentPersonaOverrides, PromptBuildContext, } from './types.js';
10
10
  export { getBaseRules } from './rules/base.js';
11
11
  export { getCommunicationRules, resolveCommunicationStyle, COMMUNICATION_STYLES, COMMUNICATION_FORMATS } from './rules/communication.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzI,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC5E,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzI,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * The SDK handles generic behavioral intelligence (anti-hallucination, communication style,
6
6
  * tool strategy, UI control protocol).
7
7
  */
8
- export { buildAgentSystemPrompt } from './builder.js';
8
+ export { buildAgentSystemPrompt, systemPromptForTools } from './builder.js';
9
9
  export { getBaseRules } from './rules/base.js';
10
10
  export { getCommunicationRules, resolveCommunicationStyle, COMMUNICATION_STYLES, COMMUNICATION_FORMATS } from './rules/communication.js';
11
11
  export { getToolStrategyRules } from './rules/tool-strategy.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAStD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAQzI,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAS5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAQzI,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,6 +1,6 @@
1
- /**
2
- * Tool strategy rules — discovery-first patterns, error handling,
3
- * multi-round behavior, and options presentation.
4
- */
5
- export declare function getToolStrategyRules(): string;
1
+ import { type OfferedTools, type ToolRule } from '../step-tools.js';
2
+ /** The tool strategy rules' rules that name tools: what a step is not told when it does not offer them. */
3
+ export declare const TOOL_STRATEGY_TOOL_RULES: readonly ToolRule[];
4
+ /** The tool strategy rules, as a step offering `offered` is told them (every tool by default). */
5
+ export declare function getToolStrategyRules(offered?: OfferedTools): string;
6
6
  //# sourceMappingURL=tool-strategy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-strategy.d.ts","sourceRoot":"","sources":["../../../src/prompt/rules/tool-strategy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,oBAAoB,IAAI,MAAM,CAuC7C"}
1
+ {"version":3,"file":"tool-strategy.d.ts","sourceRoot":"","sources":["../../../src/prompt/rules/tool-strategy.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqC,KAAK,YAAY,EAAoB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAqDzH,2GAA2G;AAC3G,eAAO,MAAM,wBAAwB,EAAE,SAAS,QAAQ,EAA2B,CAAC;AAEpF,kGAAkG;AAClG,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,YAAyB,GAAG,MAAM,CAE/E"}
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * Tool strategy rules — discovery-first patterns, error handling,
3
3
  * multi-round behavior, and options presentation.
4
+ *
5
+ * Every rule that names a tool is a `ToolRule` (prompt/step-tools.ts): a step
6
+ * that does not offer `present_options` is never told to use it.
4
7
  */
5
- export function getToolStrategyRules() {
6
- return `## TOOL STRATEGY
8
+ import { PRESENT_OPTIONS_TOOL } from '../../tools/sdk-tool-names.js';
9
+ import { EVERY_TOOL, renderPieces, rulesOf } from '../step-tools.js';
10
+ const TOOL_STRATEGY = [
11
+ `## TOOL STRATEGY
7
12
 
8
13
  ### Discovery First
9
14
  When the user asks an exploratory question ("What do you have?", "Show me my stuff"), use explore/list tools FIRST for a dimensional summary. Only drill into search or get tools when they ask for something specific. Never dump raw data.
@@ -28,18 +33,34 @@ Granularity levels:
28
33
  - Never retry the exact same operation more than twice.
29
34
 
30
35
  ### Answering Questions
31
- A question the user asks — what something is, how it works, why it happened, what their options are — is answered in your reply, in words, before anything else. A card is never the answer: its context only leads into a choice, and a user who asks what something is and gets "Want me to set it up?" has not been answered. Answer from what the page and its knowledge say, in your own words; then, only if a choice really follows from the answer, offer it with present_options. A question asked again means your last reply did not answer it: answer it now, in words, and offer nothing new.
36
+ A question the user asks — what something is, how it works, why it happened, what their options are — is answered in your reply, in words, before anything else. A card is never the answer: its context only leads into a choice, and a user who asks what something is and gets "Want me to set it up?" has not been answered. Answer from what the page and its knowledge say, in your own words`,
37
+ {
38
+ tools: [PRESENT_OPTIONS_TOOL],
39
+ text: `; then, only if a choice really follows from the answer, offer it with ${PRESENT_OPTIONS_TOOL}`,
40
+ },
41
+ `. A question asked again means your last reply did not answer it: answer it now, in words, and offer nothing new.`,
42
+ {
43
+ tools: [PRESENT_OPTIONS_TOOL],
44
+ text: `
32
45
 
33
46
  ### Options Presentation
34
- When you need the user to pick from choices, use the present_options tool with a structured options array. Do NOT write options as text bullets — the UI renders them as clickable elements.
47
+ When you need the user to pick from choices, use the ${PRESENT_OPTIONS_TOOL} tool with a structured options array. Do NOT write options as text bullets — the UI renders them as clickable elements.
35
48
  - Set allowCustom:true when the user might want to type their own answer.
36
49
  - Use style:"cards" or style:"list" when options have descriptions, and style:"buttons" for simple labels.
37
- - Asking the user ends your response: their answer arrives as their next message. Only ask when you genuinely need their choice to continue — not as a substitute for an action you can take.
50
+ - Asking the user ends your response: their answer arrives as their next message. Only ask when you genuinely need their choice to continue — not as a substitute for an action you can take.`,
51
+ },
52
+ `
38
53
 
39
54
  ### Approvals
40
55
  - A tool marked "Needs the user's approval" (an order, a payment, a send, a publish, a permanent deletion) shows the user an approval card with exactly the arguments you called it with, and runs only if 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 yes as an approval.
41
56
  - Calling one ends your response: you are told the outcome in the next turn. Only one such action is approved at a time.
42
57
  - A message may carry an <approval> block: what the user decided on the card and whether the action ran. Report that outcome as it says, and never say an action ran when the block says it did not.
43
- - For anything else that is significant or expensive but needs no approval (a long generation, say), a brief check is enough: "Ready to generate?"`;
58
+ - For anything else that is significant or expensive but needs no approval (a long generation, say), a brief check is enough: "Ready to generate?"`,
59
+ ];
60
+ /** The tool strategy rules' rules that name tools: what a step is not told when it does not offer them. */
61
+ export const TOOL_STRATEGY_TOOL_RULES = rulesOf(TOOL_STRATEGY);
62
+ /** The tool strategy rules, as a step offering `offered` is told them (every tool by default). */
63
+ export function getToolStrategyRules(offered = EVERY_TOOL) {
64
+ return renderPieces(TOOL_STRATEGY, offered);
44
65
  }
45
66
  //# sourceMappingURL=tool-strategy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-strategy.js","sourceRoot":"","sources":["../../../src/prompt/rules/tool-strategy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,oBAAoB;IAClC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mJAqC0I,CAAC;AACpJ,CAAC"}
1
+ {"version":3,"file":"tool-strategy.js","sourceRoot":"","sources":["../../../src/prompt/rules/tool-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAsD,MAAM,kBAAkB,CAAC;AAEzH,MAAM,aAAa,GAA2B;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;oYAyBkY;IAClY;QACE,KAAK,EAAE,CAAC,oBAAoB,CAAC;QAC7B,IAAI,EAAE,0EAA0E,oBAAoB,EAAE;KACvG;IACD,mHAAmH;IACnH;QACE,KAAK,EAAE,CAAC,oBAAoB,CAAC;QAC7B,IAAI,EAAE;;;uDAG6C,oBAAoB;;;8LAGmH;KAC3L;IACD;;;;;;mJAMiJ;CAClJ,CAAC;AAEF,2GAA2G;AAC3G,MAAM,CAAC,MAAM,wBAAwB,GAAwB,OAAO,CAAC,aAAa,CAAC,CAAC;AAEpF,kGAAkG;AAClG,MAAM,UAAU,oBAAoB,CAAC,UAAwB,UAAU;IACrE,OAAO,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,10 +1,6 @@
1
- /**
2
- * UI rules — how the agent works in the client's UI through OUI: the page sends
3
- * an index of its actions, every action returns what
4
- * really happened, and the index follows the page.
5
- *
6
- * Product-neutral by design: no tool, route or page is named here. Which UI
7
- * exists is the client's to say, at runtime, as tools.
8
- */
9
- export declare function getUIControlRules(): string;
1
+ import { type OfferedTools, type ToolRule } from '../step-tools.js';
2
+ /** The UI rules' rules that name tools: what a step is not told when it does not offer them. */
3
+ export declare const UI_CONTROL_TOOL_RULES: readonly ToolRule[];
4
+ /** The UI rules, as a step offering `offered` is told them (every tool by default). */
5
+ export declare function getUIControlRules(offered?: OfferedTools): string;
10
6
  //# sourceMappingURL=ui-control.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui-control.d.ts","sourceRoot":"","sources":["../../../src/prompt/rules/ui-control.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,iBAAiB,IAAI,MAAM,CAyD1C"}
1
+ {"version":3,"file":"ui-control.d.ts","sourceRoot":"","sources":["../../../src/prompt/rules/ui-control.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqC,KAAK,YAAY,EAAoB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAsFzH,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,EAAE,SAAS,QAAQ,EAAwB,CAAC;AAE9E,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,YAAyB,GAAG,MAAM,CAE5E"}
@@ -3,25 +3,47 @@
3
3
  * an index of its actions, every action returns what
4
4
  * really happened, and the index follows the page.
5
5
  *
6
- * Product-neutral by design: no tool, route or page is named here. Which UI
7
- * exists is the client's to say, at runtime, as tools.
6
+ * Product-neutral by design: no route or page is named here. Which UI
7
+ * exists is the client's to say, at runtime, as tools. The tools that work
8
+ * the page (`ui_act`, `ui_describe`, `ui_read`) are named only in `ToolRule`s
9
+ * (prompt/step-tools.ts), so a step that does not offer one is never told to
10
+ * use it.
8
11
  */
9
- export function getUIControlRules() {
10
- return `## THE USER'S UI
12
+ import { AGENT_UI_TOOLS } from '@ouispec/agent-core';
13
+ import { EVERY_TOOL, renderPieces, rulesOf } from '../step-tools.js';
14
+ const ACT = AGENT_UI_TOOLS.act;
15
+ const DESCRIBE = AGENT_UI_TOOLS.describe;
16
+ const READ = AGENT_UI_TOOLS.read;
17
+ const UI_CONTROL = [
18
+ `## THE USER'S UI
11
19
 
12
20
  You act in the user's UI, as the user would, through what is on their screen right now.
13
21
 
14
22
  ### What you can do
15
23
  - The page's index lists every action the screen offers, a line each: its id, what it does, and what it takes in outline. It follows this prompt, in a <page_index> block. The page's values come at the end of what you read, in a <page_state> block: the page as it is now, from the newest answer, or as the user's screen was when they sent their message.
16
24
  - Your abilities in the UI are exactly the actions in the index, as it is now. If a request needs something no action does, you cannot do it from here: say so plainly. If an action leads to a page that offers it, run that action first.
17
- - Never say you are doing something in the UI ("Let me take you there", "I'll open that") unless you run the action for it in the same response. Never describe an action as done before its result says so.
25
+ - Never say you are doing something in the UI ("Let me take you there", "I'll open that") unless you run the action for it in the same response. Never describe an action as done before its result says so.`,
26
+ {
27
+ tools: [ACT],
28
+ text: `
18
29
 
19
30
  ### Working from the index
20
- - Run an action with ui_act: its id exactly as the index gives it, and its input.
21
- - An index line says what an action takes only in outline. When the line names everything you need (it takes nothing, or one plain value), run it. Otherwise call ui_describe first: it gives the action's full description and its input.
22
- - A large input comes back as an outline: each property on a line, each part that holds more with the path that opens it. Open only the parts you will set, by calling ui_describe again with that one action and the path. Never guess a part you have not opened.
23
- - If ui_act says the input was wrong, its answer says what the action takes: correct the call from that, not from memory.
24
- - Describe once: what an action takes does not change while the page offers it.
31
+ - Run an action with ${ACT}: its id exactly as the index gives it, and its input.
32
+ - An index line says what an action takes only in outline. When the line names everything you need (it takes nothing, or one plain value), run it.`,
33
+ within: [
34
+ { tools: [DESCRIBE], text: ` Otherwise call ${DESCRIBE} first: it gives the action's full description and its input.` },
35
+ {
36
+ tools: [DESCRIBE],
37
+ text: `
38
+ - A large input comes back as an outline: each property on a line, each part that holds more with the path that opens it. Open only the parts you will set, by calling ${DESCRIBE} again with that one action and the path. Never guess a part you have not opened.`,
39
+ },
40
+ `
41
+ - If ${ACT} says the input was wrong, its answer says what the action takes: correct the call from that, not from memory.`,
42
+ { tools: [DESCRIBE], text: `
43
+ - Describe once: what an action takes does not change while the page offers it.` },
44
+ ],
45
+ },
46
+ `
25
47
 
26
48
  ### How actions behave
27
49
  - An action runs in the user's browser and returns what really happened: its result or error, and the page's current state. Read it before your next step.
@@ -31,7 +53,9 @@ You act in the user's UI, as the user would, through what is on their screen rig
31
53
 
32
54
  ### When you cannot see the page
33
55
  - An answer can arrive without the page's state, or not arrive at all. Then you do not know what the screen shows, and nothing that changes the page will run until you have read it.
34
- - Read it: ui_read returns an observation of a surface, or a surface's own read actions return its rows. Then carry on from what you read.
56
+ - Read it: `,
57
+ { tools: [READ], text: `${READ} returns an observation of a surface, or a surface's own read actions return its rows.`, otherwise: `a surface's own read actions return its rows.` },
58
+ ` Then carry on from what you read.
35
59
  - Never change the page to find out what it shows. If you still cannot read it, stop: tell the user what you did, what you could not confirm, and what they can check.
36
60
 
37
61
  ### Reading what the page holds
@@ -53,8 +77,13 @@ You act in the user's UI, as the user would, through what is on their screen rig
53
77
 
54
78
  ### Offering what comes next
55
79
  - Only suggest a next step, or offer it as an option, when an action in the page's index or a tool in your list can carry it out, or leads to a page that can. Never offer something no tool can do.
56
- - A request is something no tool can do when no action does that very thing: an effect, material, style or result that no action's description names, even if other actions could imitate it.
57
- - When an action takes one of a list of kinds (its line says "one of"), the kinds are in its description, not in the index. Look them up with ui_describe before you decide: a kind in the list can be done, and a kind that is not in it is something no tool can do. Looking up is not acting.
80
+ - A request is something no tool can do when no action does that very thing: an effect, material, style or result that no action's description names, even if other actions could imitate it.`,
81
+ {
82
+ tools: [DESCRIBE],
83
+ text: `
84
+ - When an action takes one of a list of kinds (its line says "one of"), the kinds are in its description, not in the index. Look them up with ${DESCRIBE} before you decide: a kind in the list can be done, and a kind that is not in it is something no tool can do. Looking up is not acting.`,
85
+ },
86
+ `
58
87
  - When the user asks for something no tool can do, your reply opens with that: the first sentence says it cannot be done here, with no praise or preamble before it, and comes before any action that changes the page. Then offer what the page can do instead.
59
88
  - Build a substitute only after the user says yes to it, and call it a substitute when you describe it. Never present an imitation as the thing asked for, and never promise it for later.
60
89
 
@@ -62,6 +91,12 @@ You act in the user's UI, as the user would, through what is on their screen rig
62
91
  1. Prefer an action of the page over any other tool that does the same job: the screen then shows what you did.
63
92
  2. Only run actions that are in the index as it is now, and only call tools in your list. Never invent action ids, tool names, routes or ids.
64
93
  3. Do not name tools or action ids in your text. The user sees the result on screen.
65
- 4. An action marked "needs approval" shows the user an approval card when you run it, and runs only once they approve it. In their UI only their click on the card approves it: a yes typed in chat does not. On a call, or in a conversation where the action is read back to them, their confirmation of that readback approves it too; its result tells you which. Run it directly when they ask for it, and never treat a yes given before you ran it as an approval.`;
94
+ 4. An action marked "needs approval" shows the user an approval card when you run it, and runs only once they approve it. In their UI only their click on the card approves it: a yes typed in chat does not. On a call, or in a conversation where the action is read back to them, their confirmation of that readback approves it too; its result tells you which. Run it directly when they ask for it, and never treat a yes given before you ran it as an approval.`,
95
+ ];
96
+ /** The UI rules' rules that name tools: what a step is not told when it does not offer them. */
97
+ export const UI_CONTROL_TOOL_RULES = rulesOf(UI_CONTROL);
98
+ /** The UI rules, as a step offering `offered` is told them (every tool by default). */
99
+ export function getUIControlRules(offered = EVERY_TOOL) {
100
+ return renderPieces(UI_CONTROL, offered);
66
101
  }
67
102
  //# sourceMappingURL=ui-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui-control.js","sourceRoot":"","sources":["../../../src/prompt/rules/ui-control.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0cAuDic,CAAC;AAC3c,CAAC"}
1
+ {"version":3,"file":"ui-control.js","sourceRoot":"","sources":["../../../src/prompt/rules/ui-control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAsD,MAAM,kBAAkB,CAAC;AAEzH,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC;AAC/B,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;AACzC,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;AAEjC,MAAM,UAAU,GAA2B;IACzC;;;;;;;6MAO2M;IAC3M;QACE,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE;;;uBAGa,GAAG;mJACyH;QAC/I,MAAM,EAAE;YACN,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,mBAAmB,QAAQ,+DAA+D,EAAE;YACvH;gBACE,KAAK,EAAE,CAAC,QAAQ,CAAC;gBACjB,IAAI,EAAE;yKAC2J,QAAQ,mFAAmF;aAC7P;YACD;OACC,GAAG,gHAAgH;YACpH,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE;gFAC+C,EAAE;SAC7E;KACF;IACD;;;;;;;;;;YAUU;IACV,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,wFAAwF,EAAE,SAAS,EAAE,+CAA+C,EAAE;IACpL;;;;;;;;;;;;;;;;;;;;;;8LAsB4L;IAC5L;QACE,KAAK,EAAE,CAAC,QAAQ,CAAC;QACjB,IAAI,EAAE;gJACsI,QAAQ,yIAAyI;KAC9R;IACD;;;;;;;;0cAQwc;CACzc,CAAC;AAEF,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAwB,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9E,uFAAuF;AACvF,MAAM,UAAU,iBAAiB,CAAC,UAAwB,UAAU;IAClE,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * What the SDK tells the model names only the tools its step offers.
3
+ *
4
+ * A host's turn policy can hold a step to some of the turn's tools
5
+ * (`activeTools`), or to none (`toolChoice: 'none'`), or make it call one.
6
+ * The SDK's own words about tools (its rules in the system prompt, the
7
+ * page's index, the turn's context lines, a step's notes) used to name every
8
+ * tool the SDK knows whatever the step offered. A step limited to one tool
9
+ * still read "offer it with present_options", and the model sometimes called
10
+ * `present_options` beside the tool it was given: the call failed
11
+ * (`AI_NoSuchToolError`), and the turn ended with no reply (Nova, 2026-11-19).
12
+ *
13
+ * So every piece of the SDK's prompt that names a tool is a `ToolRule`: it
14
+ * says which tools it names, and it is said only when the step offers every
15
+ * one of them, or else its `otherwise` (often nothing). What a step offers is
16
+ * one value, `OfferedTools`, worked out once per step by the orchestrator and
17
+ * handed to everything that writes the step's prompt. The SDK's rules that a
18
+ * host renders into its own prompt (`getToolStrategyRules`,
19
+ * `getUIControlRules`, through `buildAgentSystemPrompt`) are filtered out of
20
+ * that prompt by the same rules (`promptForTools`), so a host never passes
21
+ * the step's tools anywhere.
22
+ *
23
+ * A limited step already sends the provider a different tool list, and the
24
+ * tools come first in the cached prefix, so saying less on it costs no cache
25
+ * that the limit had not already cost. Steps that offer the same tools are
26
+ * told exactly the same words.
27
+ */
28
+ /** The tools one step of a turn offers the model, by the names the model calls them. */
29
+ export interface OfferedTools {
30
+ /** Whether the step offers a tool of this name. */
31
+ has(name: string): boolean;
32
+ /** One key per set: the names in order, or `*` for every tool. */
33
+ readonly key: string;
34
+ }
35
+ /** The tools a step offers: exactly these. */
36
+ export declare function offeredTools(names: Iterable<string>): OfferedTools;
37
+ /** Every tool: what the SDK's rules are written for when nothing limits them (a host's prompt, a rule's full text). */
38
+ export declare const EVERY_TOOL: OfferedTools;
39
+ /** A piece of the SDK's prompt: words said as they are, or a rule said only when its tools are offered. */
40
+ export type PromptPiece = string | ToolRule;
41
+ /** Words of the SDK's prompt that name tools: said only when the step offers every tool they name. */
42
+ export interface ToolRule {
43
+ /** The tools the words name. The rule is said when the step offers all of them. */
44
+ readonly tools: readonly string[];
45
+ /** What is said when it offers them, before what is `within` it. */
46
+ readonly text: string;
47
+ /** Pieces said after `text`, only when the rule itself is: a narrower rule inside a broader one. */
48
+ readonly within?: readonly PromptPiece[];
49
+ /** What is said in its place when the step does not offer them. Nothing by default. */
50
+ readonly otherwise?: string;
51
+ }
52
+ /** Whether a step offers every tool the rule names. */
53
+ export declare const offersAll: (offered: OfferedTools, tools: readonly string[]) => boolean;
54
+ /** The pieces as the step is told them. */
55
+ export declare function renderPieces(pieces: readonly PromptPiece[], offered: OfferedTools): string;
56
+ /** A rule as the step is told it: its words, or what is said in their place. */
57
+ export declare function renderRule(rule: ToolRule, offered: OfferedTools): string;
58
+ /** A rule's words when every tool is offered: what a host's prompt carries. */
59
+ export declare function fullText(rule: ToolRule): string;
60
+ /** The rules among the pieces, outermost only: the ones a prompt carries whole. */
61
+ export declare function rulesOf(pieces: readonly PromptPiece[]): ToolRule[];
62
+ /**
63
+ * A prompt as a step that offers `offered` is told it: every rule of `rules`
64
+ * the prompt carries in full is replaced by what the step is told of it.
65
+ * Everything else in the prompt (the host's own words) is left as it is.
66
+ */
67
+ export declare function promptForTools(prompt: string, rules: readonly ToolRule[], offered: OfferedTools): string;
68
+ //# sourceMappingURL=step-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-tools.d.ts","sourceRoot":"","sources":["../../src/prompt/step-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,wFAAwF;AACxF,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,8CAA8C;AAC9C,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,YAAY,CAGlE;AAED,uHAAuH;AACvH,eAAO,MAAM,UAAU,EAAE,YAA4C,CAAC;AAEtE,2GAA2G;AAC3G,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5C,sGAAsG;AACtG,MAAM,WAAW,QAAQ;IACvB,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oGAAoG;IACpG,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,WAAW,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