@superdurable/dex-agents 0.3.0 → 0.5.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.
Files changed (139) hide show
  1. package/README.md +598 -45
  2. package/dist/src/agent-context-compaction.d.ts +1 -1
  3. package/dist/src/agent-framework-runner.d.ts +210 -10
  4. package/dist/src/agent-framework-runner.js +30 -0
  5. package/dist/src/agent-framework-runner.js.map +1 -1
  6. package/dist/src/agent-local-directory-media-store.d.ts +111 -0
  7. package/dist/src/agent-local-directory-media-store.js +417 -0
  8. package/dist/src/agent-local-directory-media-store.js.map +1 -0
  9. package/dist/src/agent-media.d.ts +279 -0
  10. package/dist/src/agent-media.js +457 -0
  11. package/dist/src/agent-media.js.map +1 -0
  12. package/dist/src/agent-session-codecs.d.ts +3 -1
  13. package/dist/src/agent-session-codecs.js +53 -4
  14. package/dist/src/agent-session-codecs.js.map +1 -1
  15. package/dist/src/agent-session-failure.d.ts +4 -2
  16. package/dist/src/agent-session-failure.js +6 -2
  17. package/dist/src/agent-session-failure.js.map +1 -1
  18. package/dist/src/agent-session-flow-graph.d.ts +46 -0
  19. package/dist/src/agent-session-flow-graph.js +51 -0
  20. package/dist/src/agent-session-flow-graph.js.map +1 -1
  21. package/dist/src/agent-session-flow-graph.json +98 -81
  22. package/dist/src/agent-session-flow.d.ts +5 -3
  23. package/dist/src/agent-session-flow.js +10 -1
  24. package/dist/src/agent-session-flow.js.map +1 -1
  25. package/dist/src/agent-session-start.d.ts +1 -1
  26. package/dist/src/agent-session-start.js +2 -2
  27. package/dist/src/agent-session-start.js.map +1 -1
  28. package/dist/src/agent-session-steps.d.ts +9 -0
  29. package/dist/src/agent-session-steps.js +219 -34
  30. package/dist/src/agent-session-steps.js.map +1 -1
  31. package/dist/src/agent-session-tracer.js +1 -1
  32. package/dist/src/agent-session-tracer.js.map +1 -1
  33. package/dist/src/agent-session-transitions.d.ts +4 -0
  34. package/dist/src/agent-session-transitions.js +29 -1
  35. package/dist/src/agent-session-transitions.js.map +1 -1
  36. package/dist/src/agent-session-values.d.ts +112 -1
  37. package/dist/src/agent-session-values.js +6 -0
  38. package/dist/src/agent-session-values.js.map +1 -1
  39. package/dist/src/agent-session-wait-steps.js +17 -5
  40. package/dist/src/agent-session-wait-steps.js.map +1 -1
  41. package/dist/src/ai-sdk/ai-sdk-model-client.d.ts +15 -3
  42. package/dist/src/ai-sdk/ai-sdk-model-client.js +36 -7
  43. package/dist/src/ai-sdk/ai-sdk-model-client.js.map +1 -1
  44. package/dist/src/ai-sdk/index.d.ts +1 -1
  45. package/dist/src/ai-sdk/index.js +1 -1
  46. package/dist/src/ai-sdk/index.js.map +1 -1
  47. package/dist/src/{stepwise → builtin-loop}/agent-definition.d.ts +120 -5
  48. package/dist/src/builtin-loop/agent-definition.js.map +1 -0
  49. package/dist/src/builtin-loop/builtin-agent-session-flow.d.ts +69 -0
  50. package/dist/src/{stepwise/stepwise-agent-session-flow.js → builtin-loop/builtin-agent-session-flow.js} +15 -9
  51. package/dist/src/builtin-loop/builtin-agent-session-flow.js.map +1 -0
  52. package/dist/src/{stepwise/stepwise-agent-runner.d.ts → builtin-loop/builtin-loop-agent-runner.d.ts} +85 -26
  53. package/dist/src/{stepwise/stepwise-agent-runner.js → builtin-loop/builtin-loop-agent-runner.js} +320 -213
  54. package/dist/src/builtin-loop/builtin-loop-agent-runner.js.map +1 -0
  55. package/dist/src/{stepwise/stepwise-input-items.d.ts → builtin-loop/builtin-loop-input-items.d.ts} +7 -3
  56. package/dist/src/{stepwise/stepwise-input-items.js → builtin-loop/builtin-loop-input-items.js} +57 -10
  57. package/dist/src/builtin-loop/builtin-loop-input-items.js.map +1 -0
  58. package/dist/src/builtin-loop/function-tool.d.ts +282 -0
  59. package/dist/src/{stepwise → builtin-loop}/function-tool.js +63 -3
  60. package/dist/src/builtin-loop/function-tool.js.map +1 -0
  61. package/dist/src/builtin-loop/index.d.ts +8 -0
  62. package/dist/src/builtin-loop/index.js +13 -0
  63. package/dist/src/builtin-loop/index.js.map +1 -0
  64. package/dist/src/builtin-loop/json-schema-validation.js.map +1 -0
  65. package/dist/src/{stepwise → builtin-loop}/model-client.d.ts +36 -7
  66. package/dist/src/builtin-loop/model-client.js.map +1 -0
  67. package/dist/src/{stepwise → builtin-loop}/scripted-model-client.d.ts +8 -5
  68. package/dist/src/{stepwise → builtin-loop}/scripted-model-client.js +8 -5
  69. package/dist/src/builtin-loop/scripted-model-client.js.map +1 -0
  70. package/dist/src/{stepwise → builtin-loop}/tool-source.d.ts +13 -3
  71. package/dist/src/builtin-loop/tool-source.js.map +1 -0
  72. package/dist/src/connectors/connector-input-schema.d.ts +19 -0
  73. package/dist/src/connectors/connector-input-schema.js +228 -0
  74. package/dist/src/connectors/connector-input-schema.js.map +1 -0
  75. package/dist/src/connectors/connector-step-context.d.ts +94 -0
  76. package/dist/src/connectors/connector-step-context.js +180 -0
  77. package/dist/src/connectors/connector-step-context.js.map +1 -0
  78. package/dist/src/connectors/connector-tool-source.d.ts +401 -0
  79. package/dist/src/connectors/connector-tool-source.js +628 -0
  80. package/dist/src/connectors/connector-tool-source.js.map +1 -0
  81. package/dist/src/connectors/index.d.ts +3 -0
  82. package/dist/src/connectors/index.js +11 -0
  83. package/dist/src/connectors/index.js.map +1 -0
  84. package/dist/src/index.d.ts +7 -3
  85. package/dist/src/index.js +6 -3
  86. package/dist/src/index.js.map +1 -1
  87. package/dist/src/mcp/index.d.ts +1 -0
  88. package/dist/src/mcp/index.js +1 -0
  89. package/dist/src/mcp/index.js.map +1 -1
  90. package/dist/src/mcp/mcp-dex-conventions.d.ts +57 -0
  91. package/dist/src/mcp/mcp-dex-conventions.js +90 -0
  92. package/dist/src/mcp/mcp-dex-conventions.js.map +1 -0
  93. package/dist/src/mcp/mcp-image-content.d.ts +20 -0
  94. package/dist/src/mcp/mcp-image-content.js +82 -0
  95. package/dist/src/mcp/mcp-image-content.js.map +1 -0
  96. package/dist/src/mcp/mcp-tool-source.d.ts +178 -17
  97. package/dist/src/mcp/mcp-tool-source.js +237 -34
  98. package/dist/src/mcp/mcp-tool-source.js.map +1 -1
  99. package/dist/src/s3/index.d.ts +1 -0
  100. package/dist/src/s3/index.js +9 -0
  101. package/dist/src/s3/index.js.map +1 -0
  102. package/dist/src/s3/s3-media-store.d.ts +138 -0
  103. package/dist/src/s3/s3-media-store.js +255 -0
  104. package/dist/src/s3/s3-media-store.js.map +1 -0
  105. package/dist/src/stepwise/index.d.ts +41 -8
  106. package/dist/src/stepwise/index.js +35 -5
  107. package/dist/src/stepwise/index.js.map +1 -1
  108. package/dist/src/testing/agent-session-test-client.d.ts +6 -3
  109. package/dist/src/testing/agent-session-test-client.js +10 -3
  110. package/dist/src/testing/agent-session-test-client.js.map +1 -1
  111. package/dist/src/testing/scripted-model-client.d.ts +1 -1
  112. package/dist/src/testing/scripted-model-client.js +2 -2
  113. package/dist/src/testing/scripted-model-client.js.map +1 -1
  114. package/dist/src/tool-source-router.d.ts +211 -0
  115. package/dist/src/tool-source-router.js +380 -0
  116. package/dist/src/tool-source-router.js.map +1 -0
  117. package/dist/src/ui-stream/agent-event-json.d.ts +2 -1
  118. package/dist/src/ui-stream/agent-event-json.js +3 -1
  119. package/dist/src/ui-stream/agent-event-json.js.map +1 -1
  120. package/dist/src/ui-stream/agent-ui-messages.d.ts +11 -3
  121. package/dist/src/ui-stream/agent-ui-messages.js +29 -5
  122. package/dist/src/ui-stream/agent-ui-messages.js.map +1 -1
  123. package/package.json +25 -3
  124. package/dist/src/stepwise/agent-definition.js.map +0 -1
  125. package/dist/src/stepwise/function-tool.d.ts +0 -130
  126. package/dist/src/stepwise/function-tool.js.map +0 -1
  127. package/dist/src/stepwise/json-schema-validation.js.map +0 -1
  128. package/dist/src/stepwise/model-client.js.map +0 -1
  129. package/dist/src/stepwise/scripted-model-client.js.map +0 -1
  130. package/dist/src/stepwise/stepwise-agent-runner.js.map +0 -1
  131. package/dist/src/stepwise/stepwise-agent-session-flow.d.ts +0 -35
  132. package/dist/src/stepwise/stepwise-agent-session-flow.js.map +0 -1
  133. package/dist/src/stepwise/stepwise-input-items.js.map +0 -1
  134. package/dist/src/stepwise/tool-source.js.map +0 -1
  135. /package/dist/src/{stepwise → builtin-loop}/agent-definition.js +0 -0
  136. /package/dist/src/{stepwise → builtin-loop}/json-schema-validation.d.ts +0 -0
  137. /package/dist/src/{stepwise → builtin-loop}/json-schema-validation.js +0 -0
  138. /package/dist/src/{stepwise → builtin-loop}/model-client.js +0 -0
  139. /package/dist/src/{stepwise → builtin-loop}/tool-source.js +0 -0
@@ -1,8 +1,41 @@
1
- export { type AgentDefinition, type InstructionContext, type PlanningToolChoice } from "./agent-definition.js";
2
- export { functionTool, type FunctionTool, type FunctionToolDefinition, type ToolCallContext, } from "./function-tool.js";
3
- export { type ModelClient, type ModelInputItem, type ModelOutputItem, type ModelOutputWriter, type ModelRequest, type ModelRequestMetadata, type ModelResponse, type ModelSettings, type ModelToolCall, type ModelToolChoice, type ModelToolDefinition, type ModelToolResultItem, type ModelUserTextItem, } from "./model-client.js";
4
- export { ScriptedModelClient, defaultMaxRecordedRequests, scriptedModelApi, scriptedModelProvider, type ScriptedModelReply, type ScriptedModelResponder, type ScriptedToolCall, } from "./scripted-model-client.js";
5
- export { createStepwiseAgentSessionFlow } from "./stepwise-agent-session-flow.js";
6
- export { buildContextSummaryNote, buildContextSummaryOmissionNote, contextSummaryInstructions, contextSummaryNoteHeader, contextSummaryRequest, } from "../agent-context-compaction.js";
7
- export { StepwiseAgentRunner, defaultToolSourceListingTimeoutMs } from "./stepwise-agent-runner.js";
8
- export { type SourceToolDefinition, type ToolSource } from "./tool-source.js";
1
+ /**
2
+ * Deprecated alias of `@superdurable/dex-agents/builtin-loop`, the built-in agent loop.
3
+ *
4
+ * Every name it exported still works and refers to the same value. Two names changed:
5
+ * `StepwiseAgentRunner` is `BuiltinLoopAgentRunner`, and `createStepwiseAgentSessionFlow` is
6
+ * `createBuiltinAgentSessionFlow`.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // Before
11
+ * import { createStepwiseAgentSessionFlow } from "@superdurable/dex-agents/stepwise";
12
+ * // After
13
+ * import { createBuiltinAgentSessionFlow } from "@superdurable/dex-agents/builtin-loop";
14
+ * ```
15
+ *
16
+ * @deprecated Since 0.5.0. Import from `@superdurable/dex-agents/builtin-loop` instead.
17
+ * @module
18
+ */
19
+ import { createBuiltinAgentSessionFlow } from "../builtin-loop/builtin-agent-session-flow.js";
20
+ import { BuiltinLoopAgentRunner } from "../builtin-loop/builtin-loop-agent-runner.js";
21
+ export * from "../builtin-loop/index.js";
22
+ /**
23
+ * The {@link BuiltinLoopAgentRunner} under its old name.
24
+ *
25
+ * @deprecated Since 0.5.0. Use `BuiltinLoopAgentRunner` from `@superdurable/dex-agents/builtin-loop`; it is the
26
+ * same class.
27
+ */
28
+ export declare const StepwiseAgentRunner: typeof BuiltinLoopAgentRunner;
29
+ /**
30
+ * The {@link BuiltinLoopAgentRunner} type under its old name.
31
+ *
32
+ * @deprecated Since 0.5.0. Use `BuiltinLoopAgentRunner` from `@superdurable/dex-agents/builtin-loop`.
33
+ */
34
+ export type StepwiseAgentRunner = BuiltinLoopAgentRunner;
35
+ /**
36
+ * {@link createBuiltinAgentSessionFlow} under its old name.
37
+ *
38
+ * @deprecated Since 0.5.0. Use `createBuiltinAgentSessionFlow` from `@superdurable/dex-agents/builtin-loop`; it
39
+ * is the same function.
40
+ */
41
+ export declare const createStepwiseAgentSessionFlow: typeof createBuiltinAgentSessionFlow;
@@ -5,9 +5,39 @@
5
5
  // See the LICENSE file in the repository root.
6
6
  //
7
7
  // SPDX-License-Identifier: LicenseRef-Sustainable-Use-1.0
8
- export { functionTool, } from "./function-tool.js";
9
- export { ScriptedModelClient, defaultMaxRecordedRequests, scriptedModelApi, scriptedModelProvider, } from "./scripted-model-client.js";
10
- export { createStepwiseAgentSessionFlow } from "./stepwise-agent-session-flow.js";
11
- export { buildContextSummaryNote, buildContextSummaryOmissionNote, contextSummaryInstructions, contextSummaryNoteHeader, contextSummaryRequest, } from "../agent-context-compaction.js";
12
- export { StepwiseAgentRunner, defaultToolSourceListingTimeoutMs } from "./stepwise-agent-runner.js";
8
+ /**
9
+ * Deprecated alias of `@superdurable/dex-agents/builtin-loop`, the built-in agent loop.
10
+ *
11
+ * Every name it exported still works and refers to the same value. Two names changed:
12
+ * `StepwiseAgentRunner` is `BuiltinLoopAgentRunner`, and `createStepwiseAgentSessionFlow` is
13
+ * `createBuiltinAgentSessionFlow`.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // Before
18
+ * import { createStepwiseAgentSessionFlow } from "@superdurable/dex-agents/stepwise";
19
+ * // After
20
+ * import { createBuiltinAgentSessionFlow } from "@superdurable/dex-agents/builtin-loop";
21
+ * ```
22
+ *
23
+ * @deprecated Since 0.5.0. Import from `@superdurable/dex-agents/builtin-loop` instead.
24
+ * @module
25
+ */
26
+ import { createBuiltinAgentSessionFlow } from "../builtin-loop/builtin-agent-session-flow.js";
27
+ import { BuiltinLoopAgentRunner } from "../builtin-loop/builtin-loop-agent-runner.js";
28
+ export * from "../builtin-loop/index.js";
29
+ /**
30
+ * The {@link BuiltinLoopAgentRunner} under its old name.
31
+ *
32
+ * @deprecated Since 0.5.0. Use `BuiltinLoopAgentRunner` from `@superdurable/dex-agents/builtin-loop`; it is the
33
+ * same class.
34
+ */
35
+ export const StepwiseAgentRunner = BuiltinLoopAgentRunner;
36
+ /**
37
+ * {@link createBuiltinAgentSessionFlow} under its old name.
38
+ *
39
+ * @deprecated Since 0.5.0. Use `createBuiltinAgentSessionFlow` from `@superdurable/dex-agents/builtin-loop`; it
40
+ * is the same function.
41
+ */
42
+ export const createStepwiseAgentSessionFlow = createBuiltinAgentSessionFlow;
13
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stepwise/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAG1D,OAAO,EACL,YAAY,GAIb,MAAM,oBAAoB,CAAC;AAgB5B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,GAItB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stepwise/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAEtF,cAAc,0BAA0B,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAS1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,6BAA6B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { type Client, type StartFlowOptions } from "@superdurable/dex";
2
2
  import type { AgentFrameworkRunner, DeferredToolOutcome } from "../agent-framework-runner.js";
3
3
  import type { AgentSessionFlow } from "../agent-session-flow.js";
4
- import type { AgentEvent, AgentInterrupt, AgentMessagesPage, AgentSnapshot, AgentState, AgentToolCallRecord, SessionSettings } from "../agent-session-values.js";
4
+ import type { AgentEvent, AgentImageReference, AgentInterrupt, AgentMessagesPage, AgentSnapshot, AgentState, AgentToolCallRecord, SessionSettings } from "../agent-session-values.js";
5
5
  /** Options of the `waitFor*` methods of {@link AgentSessionTestClient}. */
6
6
  export interface AgentSessionWaitOptions {
7
7
  /** Total milliseconds to wait. Defaults to 60,000. */
@@ -60,9 +60,12 @@ export declare class AgentSessionTestClient {
60
60
  * @param sessionId - Session Flow ID.
61
61
  * @param text - Message text.
62
62
  * @param planMode - Whether the message starts a planning turn. Defaults to `false`.
63
- * @returns The RPC result: `false` for blank text, or for a `planMode` message when plan mode is off.
63
+ * @param images - Images of the message, uploaded first; none by default. The client does not check them, so a
64
+ * test can send references that the session refuses. Since 0.5.0.
65
+ * @returns The RPC result: `false` for blank text, for a `planMode` message when plan mode is off, or for images
66
+ * that the session refuses.
64
67
  */
65
- sendUserMessage(sessionId: string, text: string, planMode?: boolean): Promise<boolean>;
68
+ sendUserMessage(sessionId: string, text: string, planMode?: boolean, images?: readonly AgentImageReference[]): Promise<boolean>;
66
69
  /**
67
70
  * Calls `execute_plan`, retrying an `RpcLockConflictError` for up to 30 seconds.
68
71
  * @param sessionId - Session Flow ID.
@@ -70,10 +70,17 @@ export class AgentSessionTestClient {
70
70
  * @param sessionId - Session Flow ID.
71
71
  * @param text - Message text.
72
72
  * @param planMode - Whether the message starts a planning turn. Defaults to `false`.
73
- * @returns The RPC result: `false` for blank text, or for a `planMode` message when plan mode is off.
73
+ * @param images - Images of the message, uploaded first; none by default. The client does not check them, so a
74
+ * test can send references that the session refuses. Since 0.5.0.
75
+ * @returns The RPC result: `false` for blank text, for a `planMode` message when plan mode is off, or for images
76
+ * that the session refuses.
74
77
  */
75
- sendUserMessage(sessionId, text, planMode = false) {
76
- return this.client.invokeRPC(this.flow.sendUserMessage, sessionId, { text, planMode });
78
+ sendUserMessage(sessionId, text, planMode = false, images = []) {
79
+ return this.client.invokeRPC(this.flow.sendUserMessage, sessionId, {
80
+ text,
81
+ planMode,
82
+ ...(images.length > 0 ? { images } : {}),
83
+ });
77
84
  }
78
85
  /**
79
86
  * Calls `execute_plan`, retrying an `RpcLockConflictError` for up to 30 seconds.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session-test-client.js","sourceRoot":"","sources":["../../../src/testing/agent-session-test-client.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAE1D,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAsC,MAAM,mBAAmB,CAAC;AAc7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAC1C,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,cAAc,GAAG,GAAG,CAAC;AAQ3B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,sBAAsB;IAQf;IAEA;IATlB;;;;OAIG;IACH;IACE,kCAAkC;IAClB,MAAc;IAC9B,8CAA8C;IAC9B,IAAiE;QAFjE,WAAM,GAAN,MAAM,CAAQ;QAEd,SAAI,GAAJ,IAAI,CAA6D;IAChF,CAAC;IAEJ;;;;;;;;OAQG;IACI,KAAK,CAAC,YAAY,CACvB,SAAiB,EACjB,iBAAgC,IAAI,EACpC,mBAAqC,EAAE,EACvC,kBAA0C,IAAI;QAE9C,MAAM,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACpH,CAAC;IAED;;;;;OAKG;IACI,qBAAqB,CAAC,SAAiB,EAAE,eAAgC;QAC9E,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,SAAS,EAAE,EAAE,eAAe,EAAE,CAAC,CAA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,UAAU,eAAe,SAAS,EAAE,EAAE,GAAG,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,SAAiB;QAC5C,MAAM,WAAW,GAAiB,EAAE,CAAC;QACrC,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAC/C,SAAS,EACT,IAAI,CAAC,IAAI,CAAC,WAAW,EACrB,cAAc,EACd,SAAS,CACV,CAAC;YACF,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YACnE,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC;QACjC,CAAC,QAAQ,SAAS,KAAK,EAAE,EAAE;QAC3B,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF;AAED,KAAK,UAAU,kBAAkB,CAAC,MAA8B;IAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,0BAA0B,CAAC;IACzD,SAAS,CAAC;QACR,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,EAAE,CAAC;QACxB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,CAAC,CAAC,KAAK,YAAY,oBAAoB,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ,EAAE,CAAC;gBACvE,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"agent-session-test-client.js","sourceRoot":"","sources":["../../../src/testing/agent-session-test-client.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACn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,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,SAAiB;QAC5C,MAAM,WAAW,GAAiB,EAAE,CAAC;QACrC,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAC/C,SAAS,EACT,IAAI,CAAC,IAAI,CAAC,WAAW,EACrB,cAAc,EACd,SAAS,CACV,CAAC;YACF,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YACnE,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC;QACjC,CAAC,QAAQ,SAAS,KAAK,EAAE,EAAE;QAC3B,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;CACF;AAED,KAAK,UAAU,kBAAkB,CAAC,MAA8B;IAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,0BAA0B,CAAC;IACzD,SAAS,CAAC;QACR,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,EAAE,CAAC;QACxB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,CAAC,CAAC,KAAK,YAAY,oBAAoB,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ,EAAE,CAAC;gBACvE,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- export { ScriptedModelClient, scriptedModelApi, scriptedModelProvider, type ScriptedModelReply, type ScriptedModelResponder, type ScriptedToolCall, } from "../stepwise/scripted-model-client.js";
1
+ export { ScriptedModelClient, scriptedModelApi, scriptedModelProvider, type ScriptedModelReply, type ScriptedModelResponder, type ScriptedToolCall, } from "../builtin-loop/scripted-model-client.js";
@@ -5,6 +5,6 @@
5
5
  // See the LICENSE file in the repository root.
6
6
  //
7
7
  // SPDX-License-Identifier: LicenseRef-Sustainable-Use-1.0
8
- // The scripted model client lives in the stepwise entry point; this path keeps the 0.1.0 module.
9
- export { ScriptedModelClient, scriptedModelApi, scriptedModelProvider, } from "../stepwise/scripted-model-client.js";
8
+ // The scripted model client lives in the builtin-loop entry point; this path keeps the 0.1.0 module.
9
+ export { ScriptedModelClient, scriptedModelApi, scriptedModelProvider, } from "../builtin-loop/scripted-model-client.js";
10
10
  //# sourceMappingURL=scripted-model-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scripted-model-client.js","sourceRoot":"","sources":["../../../src/testing/scripted-model-client.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAG1D,iGAAiG;AACjG,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GAItB,MAAM,sCAAsC,CAAC"}
1
+ {"version":3,"file":"scripted-model-client.js","sourceRoot":"","sources":["../../../src/testing/scripted-model-client.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kDAAkD;AAClD,mEAAmE;AACnE,+CAA+C;AAC/C,EAAE;AACF,0DAA0D;AAG1D,qGAAqG;AACrG,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,GAItB,MAAM,0CAA0C,CAAC"}
@@ -0,0 +1,211 @@
1
+ import { type AgentTurnContext, type DeferredToolCall, type DeferredToolExecution, type DeferredToolOutcome, type ToolCallStepOptions, type ToolExecutionResult, type ToolTaskCancellation, type ToolTaskPoll, type ToolTaskPollOutcome } from "./agent-framework-runner.js";
2
+ import type { AgentToolCall } from "./agent-session-values.js";
3
+ import type { SourceToolDefinition, ToolSource } from "./builtin-loop/tool-source.js";
4
+ /**
5
+ * Default `AgentDefinition.toolSourceListingTimeoutMs`: 10 seconds. It is also the default time one model call of a
6
+ * framework adapter waits for each tool source's listing. Exported from the package root since 0.4.0.
7
+ */
8
+ export declare const defaultToolSourceListingTimeoutMs = 10000;
9
+ /**
10
+ * One tool that a {@link ToolSource} listed for a model call, with the source that listed it.
11
+ * @since 0.4.0
12
+ */
13
+ export interface ListedSourceTool {
14
+ /** The source that listed the tool. */
15
+ readonly source: ToolSource;
16
+ /** The tool definition as the source listed it. */
17
+ readonly tool: SourceToolDefinition;
18
+ }
19
+ /**
20
+ * Options of a {@link ToolSourceRouter}.
21
+ * @since 0.4.0
22
+ */
23
+ export interface ToolSourceRouterOptions {
24
+ /**
25
+ * JSON key under which the router stores the building source's name in each call's `toolSourceReference`,
26
+ * such as `"vercel_ai_tool_source"`. Keep it fixed: stored calls are routed by it.
27
+ */
28
+ readonly sourceNameKey: string;
29
+ /** Names of the runner's own tools, which no source tool may repeat. Defaults to none. */
30
+ readonly localToolNames?: ReadonlySet<string>;
31
+ /**
32
+ * What the runner's own tools are, for the collision error, such as `"a function tool"`. Defaults to
33
+ * `"a tool of the agent"`.
34
+ */
35
+ readonly localToolDescription?: string;
36
+ /** Names of the built-in tools enabled for every session, which no source tool may repeat. Defaults to none. */
37
+ readonly builtInToolNames?: ReadonlySet<string>;
38
+ /**
39
+ * How long one {@link ToolSourceRouter.listSourceTools} waits for each source, in milliseconds. Defaults to
40
+ * {@link defaultToolSourceListingTimeoutMs}.
41
+ */
42
+ readonly listingTimeoutMs?: number;
43
+ }
44
+ /**
45
+ * Serves {@link ToolSource}s from a framework runner, so their calls run in tool Steps as the built-in loop runner runs
46
+ * them.
47
+ *
48
+ * A framework adapter that implements {@link AgentFrameworkRunner} builds one router from its `toolSources`. In each
49
+ * `RunModel` it awaits {@link listSourceTools} and offers every listed tool to its framework as a native tool that
50
+ * never runs inside the model call. When the model calls one, the adapter returns {@link buildDeferredToolCall}, so
51
+ * the source picks the effect, the approval, and whether the call is an ordered write, and the router stores the
52
+ * source's name with the source's own `toolSourceReference`. The tool Step then reaches that source through
53
+ * {@link executeDeferredToolCall} on any Worker, with the full execution: the Step context, the heartbeat
54
+ * checkpoint, and the attempt. {@link toolCallStepOptions}, {@link pollToolTask}, and {@link cancelToolTask} route
55
+ * the same way. A runner whose `executeDeferredToolCall` returns only results, and so polls no tool tasks, uses
56
+ * {@link executeDeferredToolCallForResult} instead. `BuiltinLoopAgentRunner` uses a router too.
57
+ *
58
+ * Construction refuses a source without a {@link ToolSource} method or a non-blank, unique `sourceName`, and a
59
+ * name that a source declares through `declaredToolNames` when it repeats a local tool, a built-in tool, or another
60
+ * source's tool. Each listing refuses the same collisions among the listed names.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const toolSources = new ToolSourceRouter([new ConnectorToolSource([refund])], {
65
+ * sourceNameKey: "my_framework_tool_source",
66
+ * localToolNames: new Set(Object.keys(frameworkTools)),
67
+ * });
68
+ * const listed = await toolSources.listSourceTools();
69
+ * const call = toolSources.buildDeferredToolCall(turn, listed.get("refund")!, modelCall);
70
+ * ```
71
+ * @since 0.4.0
72
+ */
73
+ export declare class ToolSourceRouter {
74
+ private readonly toolSources;
75
+ private readonly toolSourcesByName;
76
+ private readonly sourceNameKey;
77
+ private readonly localToolNames;
78
+ private readonly localToolDescription;
79
+ private readonly listingTimeoutMs;
80
+ /** The last listing of each source, so estimates count its tools without listing again. */
81
+ private readonly lastListings;
82
+ /**
83
+ * Creates the router and checks the sources.
84
+ * @param toolSources - The sources, in the order the model sees their tools.
85
+ * @param options - The envelope key, the names source tools must not repeat, and the listing timeout.
86
+ * @throws {TypeError} When a source lacks a {@link ToolSource} method or a non-blank `sourceName`, two sources
87
+ * share a `sourceName`, `sourceNameKey` is blank, or a declared tool name repeats a local tool, a built-in tool, or
88
+ * another source's tool.
89
+ * @throws {RangeError} When `listingTimeoutMs` is not positive.
90
+ */
91
+ constructor(toolSources: readonly ToolSource[], options: ToolSourceRouterOptions);
92
+ /** Whether the router has at least one source. */
93
+ get hasToolSources(): boolean;
94
+ /**
95
+ * Returns the names the sources always list, from their optional `declaredToolNames`.
96
+ * @returns The names.
97
+ */
98
+ declaredToolNames(): ReadonlySet<string>;
99
+ /**
100
+ * Lists every source's tools for one model call, in source order.
101
+ *
102
+ * A source whose listing throws or takes longer than the listing timeout offers no tools in this call, with a
103
+ * warning, so a down server never fails a turn.
104
+ * @param builtInToolNames - The built-in tools enabled for this turn. Defaults to none.
105
+ * @returns The listed tools by name.
106
+ * @throws {TypeError} When a listed name repeats a local tool, an enabled built-in tool, or another source's tool.
107
+ */
108
+ listSourceTools(builtInToolNames?: ReadonlySet<string>): Promise<ReadonlyMap<string, ListedSourceTool>>;
109
+ /**
110
+ * Returns each source's tools without I/O: its `cachedTools` when it has them, else this router's last listing.
111
+ * A name listed twice keeps its first source. Use it to estimate the model input.
112
+ * @returns The cached tools by name.
113
+ */
114
+ readCachedSourceTools(): ReadonlyMap<string, ListedSourceTool>;
115
+ /**
116
+ * Builds the deferred call for one model call of a listed source tool.
117
+ *
118
+ * The source's `deferredToolCall` decides the policy, the `ordered` flag, and its own reference. The router
119
+ * keeps all of it and wraps the reference with the source's name.
120
+ * @param turn - The `RunModel` context.
121
+ * @param listedTool - The listed tool the model called, from {@link listSourceTools} of this model call.
122
+ * @param modelCall - The model's tool call ID and its arguments as JSON text.
123
+ * @returns The deferred call to return in `ToolCallsRequested`.
124
+ */
125
+ buildDeferredToolCall(turn: AgentTurnContext, listedTool: ListedSourceTool, modelCall: {
126
+ readonly toolCallId: string;
127
+ readonly arguments: string;
128
+ }): DeferredToolCall;
129
+ /**
130
+ * Whether a source built this call, so its tool Step and polls go to a source. It reads only the record, so it
131
+ * answers even when that source is not configured on this Worker; {@link executeDeferredToolCall} then throws.
132
+ * @param toolCall - The call's record.
133
+ * @returns `true` when the record holds this router's envelope, or a reference while the router has sources.
134
+ */
135
+ isSourceToolCall(toolCall: {
136
+ readonly toolName: string;
137
+ readonly toolSourceReference?: string;
138
+ }): boolean;
139
+ /**
140
+ * Runs one call in its tool Step through the source that built it, with the source's own reference and every
141
+ * other field of `call` unchanged, such as the Step context, the heartbeat checkpoint, and the attempt.
142
+ * @param call - The deferred execution from the tool Step.
143
+ * @returns The source's outcome.
144
+ * @throws {RangeError} When no source built the call, or its source is not configured on this Worker, so the
145
+ * effect decides the outcome.
146
+ * @throws Any error of the source, such as `ToolExecutionError` or `ToolOutcomeUnknownError`.
147
+ */
148
+ executeDeferredToolCall(call: DeferredToolExecution): Promise<DeferredToolOutcome>;
149
+ /**
150
+ * Runs one call as {@link executeDeferredToolCall} does, for a runner that polls no tool tasks and asks no tool
151
+ * questions, so its `executeDeferredToolCall` returns only a `ToolExecutionResult`. Such a runner has no
152
+ * `pollToolTask`, so the session tells the source that it cannot start tasks. `ConnectorToolSource` returns only
153
+ * results.
154
+ * @param call - The deferred execution from the tool Step.
155
+ * @returns The source's result.
156
+ * @throws {ToolExecutionError} When the source asked the user a question. A question comes before any effect, so
157
+ * the call records `failed` and the model reads why.
158
+ * @throws {Error} When the source started a tool task anyway. The task may run, so the effect decides the outcome.
159
+ * @throws Any error of {@link executeDeferredToolCall}.
160
+ */
161
+ executeDeferredToolCallForResult(call: DeferredToolExecution): Promise<ToolExecutionResult>;
162
+ /**
163
+ * Polls a source's tool task once, through the source that built the call.
164
+ * @param poll - The call's record from `PollToolTask`.
165
+ * @returns The source's outcome.
166
+ * @throws {RangeError} When no source built the call. The task may still run, so `PollToolTask` retries and then
167
+ * records the call by its effect.
168
+ * @throws Any error of the source.
169
+ */
170
+ pollToolTask(poll: ToolTaskPoll): Promise<ToolTaskPollOutcome>;
171
+ /**
172
+ * Cancels a source's task through the source that built the call; a source without `cancelToolTask` leaves its
173
+ * task running.
174
+ * @param cancellation - The abandoned call's record from `CancelToolTask`.
175
+ * @returns A Promise that resolves once the source took the cancellation.
176
+ * @throws {RangeError} When no source built the call.
177
+ * @throws Any error of the source.
178
+ */
179
+ cancelToolTask(cancellation: ToolTaskCancellation): Promise<void>;
180
+ /**
181
+ * Returns the source's options for one call's tool Step.
182
+ * @param toolCall - The record whose tool Step starts.
183
+ * @returns The source's options, or `undefined` when no source built the call or its source defines none.
184
+ * @throws {RangeError} When a source built the call but it is not configured on this Worker; the session then
185
+ * uses the defaults.
186
+ */
187
+ toolCallStepOptions(toolCall: AgentToolCall): ToolCallStepOptions | undefined;
188
+ private refuseDeclaredToolNameCollisions;
189
+ private refuseSourceToolName;
190
+ private listOneSource;
191
+ private requireToolSource;
192
+ private routeToToolSource;
193
+ }
194
+ /**
195
+ * The router's `toolSourceReference`: the source's name under `sourceNameKey` and its own reference, as JSON text.
196
+ * @param sourceNameKey - The envelope key of the runner.
197
+ * @param sourceName - The building source's name.
198
+ * @param reference - The source's own reference, or `undefined`.
199
+ * @returns The envelope text.
200
+ */
201
+ export declare function writeToolSourceEnvelope(sourceNameKey: string, sourceName: string, reference: string | undefined): string;
202
+ /**
203
+ * Reads an envelope that {@link writeToolSourceEnvelope} wrote with the same key.
204
+ * @param sourceNameKey - The envelope key of the runner.
205
+ * @param toolSourceReference - A record's `toolSourceReference`.
206
+ * @returns The source's name and its own reference, or `undefined` when the text is no such envelope.
207
+ */
208
+ export declare function readToolSourceEnvelope(sourceNameKey: string, toolSourceReference: string | undefined): {
209
+ readonly sourceName: string;
210
+ readonly reference: string | undefined;
211
+ } | undefined;