experimental-ash 0.2.0-alpha.2 → 0.2.0-alpha.21
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/dist/src/channel/http-channel.d.ts +26 -0
- package/dist/src/channel/http-channel.d.ts.map +1 -0
- package/dist/src/channel/http-channel.js +24 -0
- package/dist/src/channel/http-channel.js.map +1 -0
- package/dist/src/channel/resolve-text.d.ts +20 -0
- package/dist/src/channel/resolve-text.d.ts.map +1 -0
- package/dist/src/channel/resolve-text.js +60 -0
- package/dist/src/channel/resolve-text.js.map +1 -0
- package/dist/src/channel/schedule-channel.d.ts +16 -0
- package/dist/src/channel/schedule-channel.d.ts.map +1 -0
- package/dist/src/channel/schedule-channel.js +20 -0
- package/dist/src/channel/schedule-channel.js.map +1 -0
- package/dist/src/channel/schedule.d.ts +4 -6
- package/dist/src/channel/schedule.d.ts.map +1 -1
- package/dist/src/channel/schedule.js +6 -9
- package/dist/src/channel/schedule.js.map +1 -1
- package/dist/src/channel/slack-channel.d.ts +125 -0
- package/dist/src/channel/slack-channel.d.ts.map +1 -0
- package/dist/src/channel/slack-channel.js +320 -0
- package/dist/src/channel/slack-channel.js.map +1 -0
- package/dist/src/channel/subagent-channel.d.ts +41 -0
- package/dist/src/channel/subagent-channel.d.ts.map +1 -0
- package/dist/src/channel/{subagent-emitter.js → subagent-channel.js} +15 -19
- package/dist/src/channel/subagent-channel.js.map +1 -0
- package/dist/src/channel/types.d.ts +157 -90
- package/dist/src/channel/types.d.ts.map +1 -1
- package/dist/src/channel/types.js +64 -1
- package/dist/src/channel/types.js.map +1 -1
- package/dist/src/cli/dev/input-requests.d.ts +4 -4
- package/dist/src/cli/dev/input-requests.d.ts.map +1 -1
- package/dist/src/cli/dev/input-requests.js +34 -65
- package/dist/src/cli/dev/input-requests.js.map +1 -1
- package/dist/src/cli/dev/repl.d.ts.map +1 -1
- package/dist/src/cli/dev/repl.js +41 -24
- package/dist/src/cli/dev/repl.js.map +1 -1
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.d.ts.map +1 -1
- package/dist/src/client/index.js +1 -0
- package/dist/src/client/index.js.map +1 -1
- package/dist/src/client/message-response.d.ts +5 -5
- package/dist/src/client/message-response.d.ts.map +1 -1
- package/dist/src/client/message-response.js +6 -6
- package/dist/src/client/message-response.js.map +1 -1
- package/dist/src/client/open-stream.d.ts +1 -1
- package/dist/src/client/open-stream.d.ts.map +1 -1
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/open-stream.js.map +1 -1
- package/dist/src/client/session-utils.d.ts +3 -3
- package/dist/src/client/session-utils.d.ts.map +1 -1
- package/dist/src/client/session-utils.js +4 -4
- package/dist/src/client/session-utils.js.map +1 -1
- package/dist/src/client/session.d.ts +5 -5
- package/dist/src/client/session.js +28 -28
- package/dist/src/client/session.js.map +1 -1
- package/dist/src/client/types.d.ts +8 -8
- package/dist/src/client/types.d.ts.map +1 -1
- package/dist/src/compiler/channel-url.d.ts +1 -1
- package/dist/src/compiler/channel-url.js +1 -1
- package/dist/src/compiler/manifest.d.ts +38 -5
- package/dist/src/compiler/manifest.d.ts.map +1 -1
- package/dist/src/compiler/manifest.js +15 -1
- package/dist/src/compiler/manifest.js.map +1 -1
- package/dist/src/compiler/module-map.js +8 -0
- package/dist/src/compiler/module-map.js.map +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +1 -1
- package/dist/src/compiler/normalize-channel.js +3 -3
- package/dist/src/compiler/normalize-channel.js.map +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +14 -0
- package/dist/src/compiler/normalize-connection.d.ts.map +1 -0
- package/dist/src/compiler/normalize-connection.js +29 -0
- package/dist/src/compiler/normalize-connection.js.map +1 -0
- package/dist/src/compiler/normalize-manifest.d.ts.map +1 -1
- package/dist/src/compiler/normalize-manifest.js +2 -0
- package/dist/src/compiler/normalize-manifest.js.map +1 -1
- package/dist/src/context/accessors.d.ts +13 -12
- package/dist/src/context/accessors.d.ts.map +1 -1
- package/dist/src/context/accessors.js +16 -17
- package/dist/src/context/accessors.js.map +1 -1
- package/dist/src/context/container.d.ts +17 -19
- package/dist/src/context/container.d.ts.map +1 -1
- package/dist/src/context/container.js +21 -14
- package/dist/src/context/container.js.map +1 -1
- package/dist/src/context/durable-context.d.ts +18 -0
- package/dist/src/context/durable-context.d.ts.map +1 -0
- package/dist/src/context/durable-context.js +49 -0
- package/dist/src/context/durable-context.js.map +1 -0
- package/dist/src/context/key.d.ts +43 -83
- package/dist/src/context/key.d.ts.map +1 -1
- package/dist/src/context/key.js +58 -80
- package/dist/src/context/key.js.map +1 -1
- package/dist/src/context/keys.d.ts +8 -20
- package/dist/src/context/keys.d.ts.map +1 -1
- package/dist/src/context/keys.js +20 -34
- package/dist/src/context/keys.js.map +1 -1
- package/dist/src/context/provider.d.ts +2 -2
- package/dist/src/context/provider.d.ts.map +1 -1
- package/dist/src/context/providers/connection.d.ts +4 -0
- package/dist/src/context/providers/connection.d.ts.map +1 -0
- package/dist/src/context/providers/connection.js +18 -0
- package/dist/src/context/providers/connection.js.map +1 -0
- package/dist/src/context/providers/session.d.ts.map +1 -1
- package/dist/src/context/providers/session.js +1 -2
- package/dist/src/context/providers/session.js.map +1 -1
- package/dist/src/context/providers/skill.d.ts.map +1 -1
- package/dist/src/context/providers/skill.js +2 -15
- package/dist/src/context/providers/skill.js.map +1 -1
- package/dist/src/context/run-step.d.ts +6 -8
- package/dist/src/context/run-step.d.ts.map +1 -1
- package/dist/src/context/run-step.js +15 -17
- package/dist/src/context/run-step.js.map +1 -1
- package/dist/src/context/seed-keys.d.ts +21 -0
- package/dist/src/context/seed-keys.d.ts.map +1 -0
- package/dist/src/context/seed-keys.js +31 -0
- package/dist/src/context/seed-keys.js.map +1 -0
- package/dist/src/context/serialize.d.ts +8 -9
- package/dist/src/context/serialize.d.ts.map +1 -1
- package/dist/src/context/serialize.js +38 -15
- package/dist/src/context/serialize.js.map +1 -1
- package/dist/src/discover/connections.d.ts +48 -0
- package/dist/src/discover/connections.d.ts.map +1 -0
- package/dist/src/discover/connections.js +169 -0
- package/dist/src/discover/connections.js.map +1 -0
- package/dist/src/discover/discover-agent.d.ts +1 -0
- package/dist/src/discover/discover-agent.d.ts.map +1 -1
- package/dist/src/discover/discover-agent.js +8 -0
- package/dist/src/discover/discover-agent.js.map +1 -1
- package/dist/src/discover/discover-subagent.js +7 -0
- package/dist/src/discover/discover-subagent.js.map +1 -1
- package/dist/src/discover/filesystem.d.ts +3 -3
- package/dist/src/discover/filesystem.d.ts.map +1 -1
- package/dist/src/discover/filesystem.js +7 -0
- package/dist/src/discover/filesystem.js.map +1 -1
- package/dist/src/discover/grammar.d.ts +20 -4
- package/dist/src/discover/grammar.d.ts.map +1 -1
- package/dist/src/discover/grammar.js +31 -5
- package/dist/src/discover/grammar.js.map +1 -1
- package/dist/src/discover/manifest.d.ts +28 -1
- package/dist/src/discover/manifest.d.ts.map +1 -1
- package/dist/src/discover/manifest.js +11 -1
- package/dist/src/discover/manifest.js.map +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/artifacts.js.map +1 -1
- package/dist/src/evals/runner/derive-run-facts.js +5 -5
- package/dist/src/evals/runner/derive-run-facts.js.map +1 -1
- package/dist/src/evals/runner/execute-case.js +4 -4
- package/dist/src/evals/runner/execute-case.js.map +1 -1
- package/dist/src/evals/runner/execute-suite.js +1 -1
- package/dist/src/evals/runner/execute-suite.js.map +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +2 -2
- package/dist/src/evals/runner/reporters/braintrust.js.map +1 -1
- package/dist/src/evals/types.d.ts +4 -4
- package/dist/src/evals/types.d.ts.map +1 -1
- package/dist/src/execution/continuous-entry.d.ts +18 -9
- package/dist/src/execution/continuous-entry.d.ts.map +1 -1
- package/dist/src/execution/continuous-entry.js +62 -18
- package/dist/src/execution/continuous-entry.js.map +1 -1
- package/dist/src/execution/continuous-runtime.d.ts +1 -1
- package/dist/src/execution/continuous-runtime.d.ts.map +1 -1
- package/dist/src/execution/continuous-runtime.js +14 -10
- package/dist/src/execution/continuous-runtime.js.map +1 -1
- package/dist/src/execution/node-step.d.ts +1 -2
- package/dist/src/execution/node-step.d.ts.map +1 -1
- package/dist/src/execution/node-step.js +42 -55
- package/dist/src/execution/node-step.js.map +1 -1
- package/dist/src/execution/runtime-context.d.ts +3 -0
- package/dist/src/execution/runtime-context.d.ts.map +1 -1
- package/dist/src/execution/runtime-context.js +6 -4
- package/dist/src/execution/runtime-context.js.map +1 -1
- package/dist/src/execution/session.d.ts +2 -1
- package/dist/src/execution/session.d.ts.map +1 -1
- package/dist/src/execution/session.js +1 -0
- package/dist/src/execution/session.js.map +1 -1
- package/dist/src/execution/skills/access.d.ts.map +1 -1
- package/dist/src/execution/skills/instructions.d.ts +6 -6
- package/dist/src/execution/skills/instructions.d.ts.map +1 -1
- package/dist/src/execution/skills/instructions.js +15 -15
- package/dist/src/execution/skills/instructions.js.map +1 -1
- package/dist/src/execution/skills/types.d.ts +4 -4
- package/dist/src/execution/skills/types.d.ts.map +1 -1
- package/dist/src/execution/step-context.d.ts +27 -0
- package/dist/src/execution/step-context.d.ts.map +1 -0
- package/dist/src/execution/step-context.js +54 -0
- package/dist/src/execution/step-context.js.map +1 -0
- package/dist/src/execution/subagent-tool.d.ts +1 -1
- package/dist/src/execution/subagent-tool.d.ts.map +1 -1
- package/dist/src/execution/subagent-tool.js +3 -4
- package/dist/src/execution/subagent-tool.js.map +1 -1
- package/dist/src/execution/tool-compaction.d.ts +1 -3
- package/dist/src/execution/tool-compaction.d.ts.map +1 -1
- package/dist/src/execution/tool-compaction.js +6 -20
- package/dist/src/execution/tool-compaction.js.map +1 -1
- package/dist/src/execution/types.d.ts +1 -1
- package/dist/src/execution/types.d.ts.map +1 -1
- package/dist/src/execution/workflow-entry.d.ts +4 -5
- package/dist/src/execution/workflow-entry.d.ts.map +1 -1
- package/dist/src/execution/workflow-entry.js +7 -2
- package/dist/src/execution/workflow-entry.js.map +1 -1
- package/dist/src/execution/workflow-runtime.d.ts.map +1 -1
- package/dist/src/execution/workflow-runtime.js +10 -5
- package/dist/src/execution/workflow-runtime.js.map +1 -1
- package/dist/src/execution/workflow-steps.d.ts +13 -6
- package/dist/src/execution/workflow-steps.d.ts.map +1 -1
- package/dist/src/execution/workflow-steps.js +24 -19
- package/dist/src/execution/workflow-steps.js.map +1 -1
- package/dist/src/harness/emission.d.ts +36 -27
- package/dist/src/harness/emission.d.ts.map +1 -1
- package/dist/src/harness/emission.js +130 -84
- package/dist/src/harness/emission.js.map +1 -1
- package/dist/src/harness/execute-tool.d.ts +52 -0
- package/dist/src/harness/execute-tool.d.ts.map +1 -0
- package/dist/src/harness/execute-tool.js +59 -0
- package/dist/src/harness/execute-tool.js.map +1 -0
- package/dist/src/harness/input-extraction.d.ts +3 -3
- package/dist/src/harness/input-extraction.d.ts.map +1 -1
- package/dist/src/harness/input-extraction.js +15 -8
- package/dist/src/harness/input-extraction.js.map +1 -1
- package/dist/src/harness/input-requests.d.ts +46 -40
- package/dist/src/harness/input-requests.d.ts.map +1 -1
- package/dist/src/harness/input-requests.js +169 -245
- package/dist/src/harness/input-requests.js.map +1 -1
- package/dist/src/harness/messages.d.ts +10 -9
- package/dist/src/harness/messages.d.ts.map +1 -1
- package/dist/src/harness/messages.js +23 -20
- package/dist/src/harness/messages.js.map +1 -1
- package/dist/src/harness/provider-tools.d.ts +2 -2
- package/dist/src/harness/provider-tools.d.ts.map +1 -1
- package/dist/src/harness/provider-tools.js +7 -3
- package/dist/src/harness/provider-tools.js.map +1 -1
- package/dist/src/harness/step-hooks.d.ts +77 -0
- package/dist/src/harness/step-hooks.d.ts.map +1 -0
- package/dist/src/harness/step-hooks.js +192 -0
- package/dist/src/harness/step-hooks.js.map +1 -0
- package/dist/src/harness/tool-loop.d.ts +4 -2
- package/dist/src/harness/tool-loop.d.ts.map +1 -1
- package/dist/src/harness/tool-loop.js +130 -181
- package/dist/src/harness/tool-loop.js.map +1 -1
- package/dist/src/harness/tools.d.ts +12 -16
- package/dist/src/harness/tools.d.ts.map +1 -1
- package/dist/src/harness/tools.js +39 -33
- package/dist/src/harness/tools.js.map +1 -1
- package/dist/src/harness/types.d.ts +44 -28
- package/dist/src/harness/types.d.ts.map +1 -1
- package/dist/src/harness/types.js +6 -1
- package/dist/src/harness/types.js.map +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +5 -3
- package/dist/src/internal/application/compiled-artifacts.d.ts.map +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +19 -40
- package/dist/src/internal/application/compiled-artifacts.js.map +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/channel.d.ts +3 -3
- package/dist/src/internal/authored-definition/channel.d.ts.map +1 -1
- package/dist/src/internal/authored-definition/channel.js +28 -4
- package/dist/src/internal/authored-definition/channel.js.map +1 -1
- package/dist/src/internal/authored-definition/connection.d.ts +10 -0
- package/dist/src/internal/authored-definition/connection.d.ts.map +1 -0
- package/dist/src/internal/authored-definition/connection.js +134 -0
- package/dist/src/internal/authored-definition/connection.js.map +1 -0
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/authored-module.js.map +1 -1
- package/dist/src/internal/message/builder.d.ts +1 -2
- package/dist/src/internal/message/builder.d.ts.map +1 -1
- package/dist/src/internal/message/builder.js +4 -12
- package/dist/src/internal/message/builder.js.map +1 -1
- package/dist/src/internal/nitro/host/configure-message-routes.d.ts +3 -1
- package/dist/src/internal/nitro/host/configure-message-routes.d.ts.map +1 -1
- package/dist/src/internal/nitro/host/configure-message-routes.js +124 -25
- package/dist/src/internal/nitro/host/configure-message-routes.js.map +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts.map +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +63 -21
- package/dist/src/internal/nitro/host/create-application-nitro.js.map +1 -1
- package/dist/src/internal/nitro/host/load-home-page-web-assets.d.ts +13 -0
- package/dist/src/internal/nitro/host/load-home-page-web-assets.d.ts.map +1 -0
- package/dist/src/internal/nitro/host/load-home-page-web-assets.js +35 -0
- package/dist/src/internal/nitro/host/load-home-page-web-assets.js.map +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.js.map +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +10 -18
- package/dist/src/internal/nitro/routes/channel-dispatch.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +16 -45
- package/dist/src/internal/nitro/routes/channel-dispatch.js.map +1 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts +88 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js +175 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js.map +1 -0
- package/dist/src/internal/nitro/routes/home.d.ts +7 -0
- package/dist/src/internal/nitro/routes/home.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/home.js +22 -0
- package/dist/src/internal/nitro/routes/home.js.map +1 -0
- package/dist/src/internal/nitro/routes/index.d.ts +3 -8
- package/dist/src/internal/nitro/routes/index.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/index.js +18 -36
- package/dist/src/internal/nitro/routes/index.js.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +10 -3
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +2 -9
- package/dist/src/internal/nitro/routes/runtime-artifacts.js.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +8 -7
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.js +10 -10
- package/dist/src/internal/nitro/routes/runtime-stack.js.map +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.d.ts +7 -7
- package/dist/src/internal/nitro/routes/schedule-task.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.js +22 -30
- package/dist/src/internal/nitro/routes/schedule-task.js.map +1 -1
- package/dist/src/internal/nitro/routes/web-ui/assets/index.js +10 -0
- package/dist/src/internal/nitro/routes/web-ui/assets/style.css +2 -0
- package/dist/src/internal/nitro/routes/web-ui/index.html +17 -0
- package/dist/src/internal/nitro/routes/workflow-data.d.ts +32 -0
- package/dist/src/internal/nitro/routes/workflow-data.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-data.js +142 -0
- package/dist/src/internal/nitro/routes/workflow-data.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts +46 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.js +137 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.d.ts +14 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.js +42 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts +14 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.js +42 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run.d.ts +13 -0
- package/dist/src/internal/nitro/routes/workflow-run.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run.js +35 -0
- package/dist/src/internal/nitro/routes/workflow-run.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-runs.d.ts +11 -0
- package/dist/src/internal/nitro/routes/workflow-runs.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-runs.js +29 -0
- package/dist/src/internal/nitro/routes/workflow-runs.js.map +1 -0
- package/dist/src/protocol/message.d.ts +160 -76
- package/dist/src/protocol/message.d.ts.map +1 -1
- package/dist/src/protocol/message.js +92 -36
- package/dist/src/protocol/message.js.map +1 -1
- package/dist/src/protocol/routes.d.ts +11 -3
- package/dist/src/protocol/routes.d.ts.map +1 -1
- package/dist/src/protocol/routes.js +12 -4
- package/dist/src/protocol/routes.js.map +1 -1
- package/dist/src/public/channels/auth.d.ts +32 -81
- package/dist/src/public/channels/auth.d.ts.map +1 -1
- package/dist/src/public/channels/auth.js +23 -86
- package/dist/src/public/channels/auth.js.map +1 -1
- package/dist/src/public/channels/http.d.ts +66 -26
- package/dist/src/public/channels/http.d.ts.map +1 -1
- package/dist/src/public/channels/http.js +88 -78
- package/dist/src/public/channels/http.js.map +1 -1
- package/dist/src/public/channels/index.d.ts +9 -10
- package/dist/src/public/channels/index.d.ts.map +1 -1
- package/dist/src/public/channels/index.js +9 -9
- package/dist/src/public/channels/index.js.map +1 -1
- package/dist/src/public/channels/slack/index.d.ts +104 -37
- package/dist/src/public/channels/slack/index.d.ts.map +1 -1
- package/dist/src/public/channels/slack/index.js +168 -47
- package/dist/src/public/channels/slack/index.js.map +1 -1
- package/dist/src/public/channels/slack/lowlevel.d.ts +5 -5
- package/dist/src/public/channels/slack/lowlevel.d.ts.map +1 -1
- package/dist/src/public/channels/slack/lowlevel.js +4 -4
- package/dist/src/public/channels/slack/lowlevel.js.map +1 -1
- package/dist/src/public/connections/index.d.ts +25 -0
- package/dist/src/public/connections/index.d.ts.map +1 -0
- package/dist/src/public/connections/index.js +24 -0
- package/dist/src/public/connections/index.js.map +1 -0
- package/dist/src/public/definitions/channel.d.ts +89 -60
- package/dist/src/public/definitions/channel.d.ts.map +1 -1
- package/dist/src/public/definitions/channel.js +42 -24
- package/dist/src/public/definitions/channel.js.map +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +60 -0
- package/dist/src/public/definitions/connections/mcp.d.ts.map +1 -0
- package/dist/src/public/definitions/connections/mcp.js +7 -0
- package/dist/src/public/definitions/connections/mcp.js.map +1 -0
- package/dist/src/public/definitions/tool.d.ts +14 -7
- package/dist/src/public/definitions/tool.d.ts.map +1 -1
- package/dist/src/public/definitions/tool.js.map +1 -1
- package/dist/src/public/index.d.ts +10 -9
- package/dist/src/public/index.d.ts.map +1 -1
- package/dist/src/public/index.js +7 -6
- package/dist/src/public/index.js.map +1 -1
- package/dist/src/public/sandboxes/internal.d.ts +1 -1
- package/dist/src/public/sandboxes/internal.js +1 -1
- package/dist/src/public/tools/defaults.d.ts +6 -6
- package/dist/src/public/tools/defaults.d.ts.map +1 -1
- package/dist/src/public/tools/defaults.js +6 -6
- package/dist/src/public/tools/defaults.js.map +1 -1
- package/dist/src/public/tools/internal.d.ts +1 -1
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/actions/types.d.ts +21 -18
- package/dist/src/runtime/actions/types.d.ts.map +1 -1
- package/dist/src/runtime/actions/types.js +22 -19
- package/dist/src/runtime/actions/types.js.map +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +37 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts.map +1 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.js +149 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.js.map +1 -0
- package/dist/src/runtime/agent/bootstrap-model.d.ts.map +1 -1
- package/dist/src/runtime/agent/bootstrap-model.js +11 -80
- package/dist/src/runtime/agent/bootstrap-model.js.map +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts.map +1 -1
- package/dist/src/runtime/agent/bootstrap.js +4 -1
- package/dist/src/runtime/agent/bootstrap.js.map +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.d.ts.map +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +72 -134
- package/dist/src/runtime/agent/mock-model-adapter.js.map +1 -1
- package/dist/src/runtime/channels/registry.d.ts +21 -0
- package/dist/src/runtime/channels/registry.d.ts.map +1 -0
- package/dist/src/runtime/channels/registry.js +65 -0
- package/dist/src/runtime/channels/registry.js.map +1 -0
- package/dist/src/runtime/connections/mcp-client.d.ts +48 -0
- package/dist/src/runtime/connections/mcp-client.d.ts.map +1 -0
- package/dist/src/runtime/connections/mcp-client.js +182 -0
- package/dist/src/runtime/connections/mcp-client.js.map +1 -0
- package/dist/src/runtime/connections/registry.d.ts +33 -0
- package/dist/src/runtime/connections/registry.d.ts.map +1 -0
- package/dist/src/runtime/connections/registry.js +54 -0
- package/dist/src/runtime/connections/registry.js.map +1 -0
- package/dist/src/runtime/connections/types.d.ts +75 -0
- package/dist/src/runtime/connections/types.d.ts.map +1 -0
- package/dist/src/runtime/connections/types.js +9 -0
- package/dist/src/runtime/connections/types.js.map +1 -0
- package/dist/src/runtime/framework-channels/index.d.ts +6 -6
- package/dist/src/runtime/framework-channels/index.d.ts.map +1 -1
- package/dist/src/runtime/framework-channels/index.js +16 -14
- package/dist/src/runtime/framework-channels/index.js.map +1 -1
- package/dist/src/runtime/framework-tools/ask-question.js +4 -4
- package/dist/src/runtime/framework-tools/ask-question.js.map +1 -1
- package/dist/src/runtime/framework-tools/connection-execute.d.ts +10 -0
- package/dist/src/runtime/framework-tools/connection-execute.d.ts.map +1 -0
- package/dist/src/runtime/framework-tools/connection-execute.js +50 -0
- package/dist/src/runtime/framework-tools/connection-execute.js.map +1 -0
- package/dist/src/runtime/framework-tools/connection-search.d.ts +43 -0
- package/dist/src/runtime/framework-tools/connection-search.d.ts.map +1 -0
- package/dist/src/runtime/framework-tools/connection-search.js +135 -0
- package/dist/src/runtime/framework-tools/connection-search.js.map +1 -0
- package/dist/src/runtime/framework-tools/file-state.d.ts +5 -5
- package/dist/src/runtime/framework-tools/file-state.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/file-state.js +6 -8
- package/dist/src/runtime/framework-tools/file-state.js.map +1 -1
- package/dist/src/runtime/framework-tools/index.d.ts +3 -1
- package/dist/src/runtime/framework-tools/index.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/index.js +10 -1
- package/dist/src/runtime/framework-tools/index.js.map +1 -1
- package/dist/src/runtime/framework-tools/skill.d.ts +4 -4
- package/dist/src/runtime/framework-tools/skill.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/skill.js +14 -11
- package/dist/src/runtime/framework-tools/skill.js.map +1 -1
- package/dist/src/runtime/framework-tools/todo.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/todo.js +2 -4
- package/dist/src/runtime/framework-tools/todo.js.map +1 -1
- package/dist/src/runtime/input/types.d.ts +40 -115
- package/dist/src/runtime/input/types.d.ts.map +1 -1
- package/dist/src/runtime/input/types.js +28 -66
- package/dist/src/runtime/input/types.js.map +1 -1
- package/dist/src/runtime/loaders/module-map.js +8 -0
- package/dist/src/runtime/loaders/module-map.js.map +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +4 -1
- package/dist/src/runtime/prompt/compose.d.ts.map +1 -1
- package/dist/src/runtime/prompt/compose.js +18 -1
- package/dist/src/runtime/prompt/compose.js.map +1 -1
- package/dist/src/runtime/prompt/connections.d.ts +10 -0
- package/dist/src/runtime/prompt/connections.d.ts.map +1 -0
- package/dist/src/runtime/prompt/connections.js +25 -0
- package/dist/src/runtime/prompt/connections.js.map +1 -0
- package/dist/src/runtime/resolve-agent-graph.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +29 -7
- package/dist/src/runtime/resolve-agent-graph.js.map +1 -1
- package/dist/src/runtime/resolve-agent.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent.js +3 -0
- package/dist/src/runtime/resolve-agent.js.map +1 -1
- package/dist/src/runtime/resolve-channel.d.ts.map +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -0
- package/dist/src/runtime/resolve-channel.js.map +1 -1
- package/dist/src/runtime/resolve-connection.d.ts +16 -0
- package/dist/src/runtime/resolve-connection.d.ts.map +1 -0
- package/dist/src/runtime/resolve-connection.js +69 -0
- package/dist/src/runtime/resolve-connection.js.map +1 -0
- package/dist/src/runtime/resolve-tool.d.ts.map +1 -1
- package/dist/src/runtime/resolve-tool.js +8 -0
- package/dist/src/runtime/resolve-tool.js.map +1 -1
- package/dist/src/runtime/sessions/auth.d.ts +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +2 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts.map +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +14 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.js.map +1 -1
- package/dist/src/runtime/skills/fragment-context.d.ts +2 -2
- package/dist/src/runtime/skills/fragment-context.d.ts.map +1 -1
- package/dist/src/runtime/skills/fragment-context.js +2 -2
- package/dist/src/runtime/skills/fragment-context.js.map +1 -1
- package/dist/src/runtime/standard-schema.d.ts +28 -0
- package/dist/src/runtime/standard-schema.d.ts.map +1 -0
- package/dist/src/runtime/standard-schema.js +65 -0
- package/dist/src/runtime/standard-schema.js.map +1 -0
- package/dist/src/runtime/types.d.ts +29 -3
- package/dist/src/runtime/types.d.ts.map +1 -1
- package/dist/src/services/dev-client/send-message.d.ts +2 -2
- package/dist/src/services/dev-client/send-message.d.ts.map +1 -1
- package/dist/src/services/dev-client/send-message.js +21 -22
- package/dist/src/services/dev-client/send-message.js.map +1 -1
- package/dist/src/services/dev-client/session.d.ts +5 -5
- package/dist/src/services/dev-client/session.d.ts.map +1 -1
- package/dist/src/services/dev-client/session.js +2 -2
- package/dist/src/services/dev-client/session.js.map +1 -1
- package/dist/src/services/dev-client.d.ts +6 -6
- package/dist/src/services/dev-client.d.ts.map +1 -1
- package/dist/src/services/dev-client.js +3 -3
- package/dist/src/services/dev-client.js.map +1 -1
- package/docs/external-agent-protocol.md +37 -34
- package/docs/internals/channels.md +15 -12
- package/docs/internals/context.md +81 -161
- package/docs/internals/message-runtime.md +28 -26
- package/docs/public/README.md +22 -20
- package/docs/public/auth-and-route-protection.md +15 -12
- package/docs/public/channels/README.md +16 -11
- package/docs/public/cli-build-and-debugging.md +1 -1
- package/docs/public/context-control.md +7 -3
- package/docs/public/evals.md +3 -3
- package/docs/public/getting-started.md +15 -12
- package/docs/public/human-in-the-loop.md +45 -57
- package/docs/public/migration-guide.md +71 -0
- package/docs/public/project-layout.md +5 -0
- package/docs/public/runs-and-streaming.md +32 -25
- package/docs/public/schedules.md +4 -4
- package/docs/public/session-context.md +131 -15
- package/docs/public/skills.md +27 -3
- package/docs/public/subagents.md +2 -2
- package/docs/public/tools.md +23 -30
- package/docs/public/typescript-api.md +16 -12
- package/docs/public/vercel-deployment.md +3 -4
- package/docs/public/workspace.md +11 -11
- package/package.json +18 -11
- package/dist/src/channel/emitter-registry.d.ts +0 -34
- package/dist/src/channel/emitter-registry.d.ts.map +0 -1
- package/dist/src/channel/emitter-registry.js +0 -63
- package/dist/src/channel/emitter-registry.js.map +0 -1
- package/dist/src/channel/http-emitter.d.ts +0 -16
- package/dist/src/channel/http-emitter.d.ts.map +0 -1
- package/dist/src/channel/http-emitter.js +0 -22
- package/dist/src/channel/http-emitter.js.map +0 -1
- package/dist/src/channel/schedule-emitter.d.ts +0 -15
- package/dist/src/channel/schedule-emitter.d.ts.map +0 -1
- package/dist/src/channel/schedule-emitter.js +0 -21
- package/dist/src/channel/schedule-emitter.js.map +0 -1
- package/dist/src/channel/slack-emitter.d.ts +0 -56
- package/dist/src/channel/slack-emitter.d.ts.map +0 -1
- package/dist/src/channel/slack-emitter.js +0 -235
- package/dist/src/channel/slack-emitter.js.map +0 -1
- package/dist/src/channel/subagent-emitter.d.ts +0 -41
- package/dist/src/channel/subagent-emitter.d.ts.map +0 -1
- package/dist/src/channel/subagent-emitter.js.map +0 -1
- package/dist/src/context/state.d.ts +0 -27
- package/dist/src/context/state.d.ts.map +0 -1
- package/dist/src/context/state.js +0 -53
- package/dist/src/context/state.js.map +0 -1
- package/dist/src/internal/message/nitro-route-shims.d.ts +0 -6
- package/dist/src/internal/message/nitro-route-shims.d.ts.map +0 -1
- package/dist/src/internal/message/nitro-route-shims.js +0 -38
- package/dist/src/internal/message/nitro-route-shims.js.map +0 -1
- package/dist/src/internal/message/rewrite-generated-imports.d.ts +0 -15
- package/dist/src/internal/message/rewrite-generated-imports.d.ts.map +0 -1
- package/dist/src/internal/message/rewrite-generated-imports.js +0 -59
- package/dist/src/internal/message/rewrite-generated-imports.js.map +0 -1
- package/dist/src/internal/nitro/host/channel-url-matcher.d.ts +0 -35
- package/dist/src/internal/nitro/host/channel-url-matcher.d.ts.map +0 -1
- package/dist/src/internal/nitro/host/channel-url-matcher.js +0 -57
- package/dist/src/internal/nitro/host/channel-url-matcher.js.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.d.ts +0 -11
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.d.ts.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.js +0 -264
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.js.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/render-home-page.d.ts +0 -9
- package/dist/src/internal/nitro/routes/home-page/render-home-page.d.ts.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/render-home-page.js +0 -15
- package/dist/src/internal/nitro/routes/home-page/render-home-page.js.map +0 -1
- package/dist/src/internal/nitro/routes/index.html +0 -525
- package/dist/src/internal/nitro/runtime-configuration.d.ts +0 -16
- package/dist/src/internal/nitro/runtime-configuration.d.ts.map +0 -1
- package/dist/src/internal/nitro/runtime-configuration.js +0 -23
- package/dist/src/internal/nitro/runtime-configuration.js.map +0 -1
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts +0 -10
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts.map +0 -1
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js +0 -17
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js.map +0 -1
- package/dist/src/runtime/tools/execute-tool.d.ts +0 -20
- package/dist/src/runtime/tools/execute-tool.d.ts.map +0 -1
- package/dist/src/runtime/tools/execute-tool.js +0 -69
- package/dist/src/runtime/tools/execute-tool.js.map +0 -1
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import { RuntimeContextKey } from "../context/key.js";
|
|
1
2
|
import { jsonObjectSchema } from "../runtime/json.js";
|
|
2
3
|
import { coalesceTurnInputs } from "./messages.js";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const PENDING_INPUT_BATCH_KEY = "ash.runtime.pendingInputBatch";
|
|
5
|
+
const APPROVED_TOOLS_KEY = "ash.runtime.hitl.approvedTools";
|
|
6
|
+
const DEFERRED_STEP_INPUT_KEY = "ash.runtime.deferredStepInput";
|
|
6
7
|
const IGNORED_INPUT_REASON = "Ignored because the user continued without responding.";
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
// Internal session slot helpers — avoid repeating the clone-and-update pattern
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
function setInternalSlot(session, key, value) {
|
|
12
|
+
return { ...session, internal: { ...session.internal, [key]: value } };
|
|
13
|
+
}
|
|
14
|
+
function clearInternalSlot(session, key) {
|
|
15
|
+
if (session.internal?.[key] === undefined) {
|
|
16
|
+
return session;
|
|
17
|
+
}
|
|
18
|
+
const internal = { ...session.internal };
|
|
19
|
+
delete internal[key];
|
|
20
|
+
return {
|
|
21
|
+
...session,
|
|
22
|
+
internal: Object.keys(internal).length > 0 ? internal : undefined,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export const PendingInputRequestsKey = new RuntimeContextKey("ash.runtime.pendingInputRequests");
|
|
7
26
|
/**
|
|
8
27
|
* Returns true when the step input carries user-facing turn input.
|
|
9
28
|
*/
|
|
@@ -11,11 +30,14 @@ export function hasStepInput(input) {
|
|
|
11
30
|
if (input === undefined) {
|
|
12
31
|
return false;
|
|
13
32
|
}
|
|
14
|
-
return input.message !== undefined || (input.
|
|
33
|
+
return input.message !== undefined || (input.inputResponses?.length ?? 0) > 0;
|
|
15
34
|
}
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Deferred step input
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
16
38
|
/**
|
|
17
39
|
* Merges any queued follow-up input into the current step input and clears it
|
|
18
|
-
* from session
|
|
40
|
+
* from the internal session bag.
|
|
19
41
|
*
|
|
20
42
|
* Used when the harness has to process a pending tool-approval response first
|
|
21
43
|
* and defer the user's new message to the next internal model step.
|
|
@@ -44,294 +66,196 @@ export function consumeDeferredStepInput(input) {
|
|
|
44
66
|
export function hasDeferredStepInput(session) {
|
|
45
67
|
return getDeferredStepInput(session) !== undefined;
|
|
46
68
|
}
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Pending input resolution
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
47
72
|
/**
|
|
48
|
-
*
|
|
49
|
-
* structured {@link RuntimeInputResult}s when the session has a pending
|
|
50
|
-
* input batch and the deliver payload carries only a message (no explicit
|
|
51
|
-
* `inputResults`).
|
|
73
|
+
* Resolves pending input at the start of a harness step.
|
|
52
74
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// Already has explicit inputResults — nothing to resolve.
|
|
64
|
-
if (stepInput.inputResults !== undefined && stepInput.inputResults.length > 0) {
|
|
65
|
-
return stepInput;
|
|
66
|
-
}
|
|
67
|
-
// No message to resolve from.
|
|
68
|
-
if (stepInput.message === undefined) {
|
|
69
|
-
return stepInput;
|
|
70
|
-
}
|
|
71
|
-
// Emitter doesn't support resolution.
|
|
72
|
-
if (channelEmitter?.resolveInput === undefined) {
|
|
73
|
-
return stepInput;
|
|
74
|
-
}
|
|
75
|
-
const pendingBatch = getPendingRuntimeInputBatch(session);
|
|
76
|
-
if (pendingBatch === undefined) {
|
|
77
|
-
return stepInput;
|
|
78
|
-
}
|
|
79
|
-
const resolved = channelEmitter.resolveInput({
|
|
80
|
-
message: stepInput.message,
|
|
81
|
-
requests: pendingBatch.requests,
|
|
82
|
-
});
|
|
83
|
-
if (resolved === undefined || resolved.length === 0) {
|
|
84
|
-
return stepInput;
|
|
85
|
-
}
|
|
86
|
-
// The message was consumed by resolution — don't forward it as a
|
|
87
|
-
// separate user message.
|
|
88
|
-
return { inputResults: resolved };
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Applies any pending HITL batch to the next turn's model messages.
|
|
75
|
+
* When the session has a pending input batch and the step input carries
|
|
76
|
+
* responses, this function matches responses to requests, builds tool
|
|
77
|
+
* result messages, appends them to the session history, records approved
|
|
78
|
+
* tools, and clears the batch.
|
|
79
|
+
*
|
|
80
|
+
* When the session has a pending batch but the step input has no
|
|
81
|
+
* responses (e.g. the emitter couldn't resolve text to options), returns
|
|
82
|
+
* `"unresolved"` -- the harness should stay parked.
|
|
83
|
+
*
|
|
84
|
+
* When there is no pending batch, passes the input through unchanged.
|
|
92
85
|
*
|
|
93
86
|
* When the pending batch contains tool-approval requests and the step input
|
|
94
87
|
* also carries a follow-up user message, the message is deferred to the next
|
|
95
88
|
* internal harness step rather than appended to the current turn. This is
|
|
96
89
|
* necessary because AI SDK cannot process tool-approval responses and a new
|
|
97
|
-
* user message in the same request
|
|
90
|
+
* user message in the same request -- the approval must be resolved in
|
|
98
91
|
* isolation first, and the user message replayed on the subsequent step via
|
|
99
92
|
* {@link consumeDeferredStepInput}.
|
|
100
93
|
*/
|
|
101
|
-
export function
|
|
94
|
+
export function resolvePendingInput(input) {
|
|
95
|
+
const { stepInput } = input;
|
|
102
96
|
let session = input.session;
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
97
|
+
const pendingBatch = getPendingInputBatch(session);
|
|
98
|
+
// No pending batch -- pass through to the model call.
|
|
99
|
+
if (pendingBatch === undefined) {
|
|
100
|
+
return { outcome: "continue", messages: [...session.history], session };
|
|
101
|
+
}
|
|
102
|
+
// Pending batch exists -- only resolve if we have actual responses.
|
|
103
|
+
const responses = stepInput?.inputResponses ?? [];
|
|
104
|
+
if (responses.length === 0 && stepInput?.message === undefined) {
|
|
105
|
+
return { outcome: "unresolved", messages: [...session.history], session };
|
|
106
|
+
}
|
|
107
|
+
if (responses.length === 0 && stepInput?.message !== undefined) {
|
|
108
|
+
// A follow-up message arrived but no explicit responses. Auto-deny
|
|
109
|
+
// all pending requests so the model can continue, and either defer
|
|
110
|
+
// the message (for approval batches) or pass it through.
|
|
111
|
+
const toolParts = buildToolResponseParts(pendingBatch, []);
|
|
112
|
+
const messages = [...session.history, ...pendingBatch.responseMessages];
|
|
113
|
+
if (toolParts.length > 0) {
|
|
114
|
+
messages.push({ content: toolParts, role: "tool" });
|
|
121
115
|
}
|
|
122
|
-
session =
|
|
123
|
-
|
|
124
|
-
// in the same request. Defer the message so the approval is resolved in
|
|
125
|
-
// isolation; `consumeDeferredStepInput` replays it on the next step.
|
|
126
|
-
if (nextMessage !== undefined &&
|
|
127
|
-
pendingBatch.requests.some((request) => request.kind === "tool-approval")) {
|
|
116
|
+
session = clearPendingInputBatch(session);
|
|
117
|
+
if (pendingBatch.requests.some((request) => isApprovalRequest(request))) {
|
|
128
118
|
session = queueDeferredStepInput(session, {
|
|
129
|
-
message:
|
|
119
|
+
message: stepInput.message,
|
|
130
120
|
});
|
|
131
|
-
|
|
121
|
+
return { deferredMessage: true, outcome: "resolved", messages, session };
|
|
132
122
|
}
|
|
123
|
+
return { outcome: "resolved", messages, session };
|
|
133
124
|
}
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
// Record approved tools before clearing the batch.
|
|
126
|
+
session = recordApprovedTools({ pendingBatch, responses, session });
|
|
127
|
+
// Build tool result messages from responses.
|
|
128
|
+
const toolParts = buildToolResponseParts(pendingBatch, responses);
|
|
129
|
+
const messages = [...session.history, ...pendingBatch.responseMessages];
|
|
130
|
+
if (toolParts.length > 0) {
|
|
131
|
+
messages.push({ content: toolParts, role: "tool" });
|
|
136
132
|
}
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
session = clearPendingInputBatch(session);
|
|
134
|
+
// AI SDK cannot process tool-approval responses and a new user message
|
|
135
|
+
// in the same request. Defer the message so the approval is resolved in
|
|
136
|
+
// isolation; `consumeDeferredStepInput` replays it on the next step.
|
|
137
|
+
if (stepInput?.message !== undefined &&
|
|
138
|
+
pendingBatch.requests.some((request) => isApprovalRequest(request))) {
|
|
139
|
+
session = queueDeferredStepInput(session, {
|
|
140
|
+
message: stepInput.message,
|
|
141
|
+
});
|
|
142
|
+
return { deferredMessage: true, outcome: "resolved", messages, session };
|
|
139
143
|
}
|
|
140
|
-
return {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
return { outcome: "resolved", messages, session };
|
|
145
|
+
}
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Pending batch management
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
function getPendingInputBatch(session) {
|
|
150
|
+
const value = session.internal?.[PENDING_INPUT_BATCH_KEY];
|
|
151
|
+
if (typeof value !== "object" || value === null) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
const batch = value;
|
|
155
|
+
if (!Array.isArray(batch.requests) || !Array.isArray(batch.responseMessages)) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
return batch;
|
|
159
|
+
}
|
|
160
|
+
export function seedPendingInputRequestsContext(ctx, session) {
|
|
161
|
+
const pendingBatch = getPendingInputBatch(session);
|
|
162
|
+
if (pendingBatch === undefined) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
ctx.set(PendingInputRequestsKey, pendingBatch.requests);
|
|
144
166
|
}
|
|
145
167
|
/**
|
|
146
|
-
* Stores one pending HITL batch on the session until the user responds
|
|
147
|
-
* ignores it.
|
|
168
|
+
* Stores one pending HITL batch on the session until the user responds.
|
|
148
169
|
*/
|
|
149
|
-
export function
|
|
150
|
-
|
|
151
|
-
state[PENDING_RUNTIME_INPUT_BATCH_STATE_KEY] = {
|
|
170
|
+
export function setPendingInputBatch(input) {
|
|
171
|
+
return setInternalSlot(input.session, PENDING_INPUT_BATCH_KEY, {
|
|
152
172
|
requests: [...input.requests],
|
|
153
173
|
responseMessages: [...input.responseMessages],
|
|
154
|
-
};
|
|
155
|
-
return {
|
|
156
|
-
...input.session,
|
|
157
|
-
state,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Returns the set of tool names that have been approved at least once during
|
|
162
|
-
* this session.
|
|
163
|
-
*/
|
|
164
|
-
export function getApprovedTools(session) {
|
|
165
|
-
return new Set(session.state?.[APPROVED_TOOLS_STATE_KEY] ?? []);
|
|
174
|
+
});
|
|
166
175
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
* subsequent steps can skip re-approval (used by per-tool `once()` overrides).
|
|
170
|
-
*
|
|
171
|
-
* Must be called before `applyStepInputToMessages`, which clears the pending
|
|
172
|
-
* batch from session state.
|
|
173
|
-
*/
|
|
174
|
-
export function recordApprovedTools(input) {
|
|
175
|
-
const pendingBatch = getPendingRuntimeInputBatch(input.session);
|
|
176
|
-
if (pendingBatch === undefined) {
|
|
177
|
-
return input.session;
|
|
178
|
-
}
|
|
179
|
-
const approvedResultIds = new Set();
|
|
180
|
-
for (const result of input.inputResults) {
|
|
181
|
-
if (result.kind === "tool-approval-result" && result.approved) {
|
|
182
|
-
approvedResultIds.add(result.approvalId);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
const newlyApproved = [];
|
|
186
|
-
for (const request of pendingBatch.requests) {
|
|
187
|
-
if (request.kind === "tool-approval" && approvedResultIds.has(request.approvalId)) {
|
|
188
|
-
newlyApproved.push(request.toolName);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (newlyApproved.length === 0) {
|
|
192
|
-
return input.session;
|
|
193
|
-
}
|
|
194
|
-
const existing = getApprovedTools(input.session);
|
|
195
|
-
const combined = [...new Set([...existing, ...newlyApproved])];
|
|
196
|
-
const state = { ...(input.session.state ?? {}) };
|
|
197
|
-
state[APPROVED_TOOLS_STATE_KEY] = combined;
|
|
198
|
-
return {
|
|
199
|
-
...input.session,
|
|
200
|
-
state,
|
|
201
|
-
};
|
|
176
|
+
function clearPendingInputBatch(session) {
|
|
177
|
+
return clearInternalSlot(session, PENDING_INPUT_BATCH_KEY);
|
|
202
178
|
}
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
// Deferred step input state
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
203
182
|
function getDeferredStepInput(session) {
|
|
204
|
-
return session.
|
|
183
|
+
return session.internal?.[DEFERRED_STEP_INPUT_KEY];
|
|
205
184
|
}
|
|
206
185
|
function queueDeferredStepInput(session, input) {
|
|
207
186
|
const existing = getDeferredStepInput(session);
|
|
208
187
|
const deferredInput = existing === undefined ? input : coalesceTurnInputs(existing, input);
|
|
209
|
-
|
|
210
|
-
state[DEFERRED_STEP_INPUT_STATE_KEY] = deferredInput;
|
|
211
|
-
return {
|
|
212
|
-
...session,
|
|
213
|
-
state,
|
|
214
|
-
};
|
|
188
|
+
return setInternalSlot(session, DEFERRED_STEP_INPUT_KEY, deferredInput);
|
|
215
189
|
}
|
|
216
190
|
function clearDeferredStepInput(session) {
|
|
217
|
-
|
|
218
|
-
return session;
|
|
219
|
-
}
|
|
220
|
-
const state = { ...(session.state ?? {}) };
|
|
221
|
-
delete state[DEFERRED_STEP_INPUT_STATE_KEY];
|
|
222
|
-
return {
|
|
223
|
-
...session,
|
|
224
|
-
state: Object.keys(state).length > 0 ? state : undefined,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
function getPendingRuntimeInputBatch(session) {
|
|
228
|
-
return session.state?.[PENDING_RUNTIME_INPUT_BATCH_STATE_KEY];
|
|
191
|
+
return clearInternalSlot(session, DEFERRED_STEP_INPUT_KEY);
|
|
229
192
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
// Approval tracking
|
|
195
|
+
// ---------------------------------------------------------------------------
|
|
196
|
+
/**
|
|
197
|
+
* Returns the set of tool names that have been approved at least once
|
|
198
|
+
* during this session.
|
|
199
|
+
*/
|
|
200
|
+
export function getApprovedTools(session) {
|
|
201
|
+
const value = session.internal?.[APPROVED_TOOLS_KEY];
|
|
202
|
+
if (!Array.isArray(value)) {
|
|
203
|
+
return new Set();
|
|
233
204
|
}
|
|
234
|
-
|
|
235
|
-
delete state[PENDING_RUNTIME_INPUT_BATCH_STATE_KEY];
|
|
236
|
-
return {
|
|
237
|
-
...session,
|
|
238
|
-
state: Object.keys(state).length > 0 ? state : undefined,
|
|
239
|
-
};
|
|
205
|
+
return new Set(value);
|
|
240
206
|
}
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
resultsByKey.set(key, result);
|
|
249
|
-
}
|
|
250
|
-
const toolResponses = [];
|
|
251
|
-
for (const request of input.requests) {
|
|
252
|
-
const key = getRuntimeInputRequestKey(request);
|
|
253
|
-
const result = resultsByKey.get(key) ?? createIgnoredRuntimeInputResult(request);
|
|
254
|
-
if (!matchesRuntimeInputRequest({ request, result })) {
|
|
255
|
-
throw new Error(`Runtime input result "${key}" does not match the pending request batch.`);
|
|
256
|
-
}
|
|
257
|
-
toolResponses.push(createToolResponsePart({ request, result }));
|
|
258
|
-
resultsByKey.delete(key);
|
|
259
|
-
}
|
|
260
|
-
if (resultsByKey.size > 0) {
|
|
261
|
-
throw new Error(`Received runtime input results for unknown request ids: ${[...resultsByKey.keys()].join(", ")}.`);
|
|
207
|
+
function recordApprovedTools(input) {
|
|
208
|
+
const approvedIds = new Set(input.responses.filter((r) => r.optionId === "approve").map((r) => r.requestId));
|
|
209
|
+
const newTools = input.pendingBatch.requests
|
|
210
|
+
.filter((r) => approvedIds.has(r.requestId))
|
|
211
|
+
.map((r) => r.action.toolName);
|
|
212
|
+
if (newTools.length === 0) {
|
|
213
|
+
return input.session;
|
|
262
214
|
}
|
|
263
|
-
|
|
215
|
+
const existing = getApprovedTools(input.session);
|
|
216
|
+
const combined = [...new Set([...existing, ...newTools])];
|
|
217
|
+
return setInternalSlot(input.session, APPROVED_TOOLS_KEY, combined);
|
|
264
218
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
case "tool-approval":
|
|
276
|
-
return {
|
|
277
|
-
approvalId: request.approvalId,
|
|
278
|
-
approved: false,
|
|
279
|
-
kind: "tool-approval-result",
|
|
280
|
-
reason: IGNORED_INPUT_REASON,
|
|
281
|
-
};
|
|
219
|
+
// ---------------------------------------------------------------------------
|
|
220
|
+
// Tool response building
|
|
221
|
+
// ---------------------------------------------------------------------------
|
|
222
|
+
function buildToolResponseParts(batch, responses) {
|
|
223
|
+
const responseMap = new Map(responses.map((r) => [r.requestId, r]));
|
|
224
|
+
const parts = [];
|
|
225
|
+
for (const request of batch.requests) {
|
|
226
|
+
parts.push(buildToolResponsePart(request, responseMap.get(request.requestId)));
|
|
282
227
|
}
|
|
228
|
+
return parts;
|
|
283
229
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return createToolApprovalResponsePart({
|
|
293
|
-
result: input.result,
|
|
294
|
-
});
|
|
230
|
+
function buildToolResponsePart(request, response) {
|
|
231
|
+
if (isApprovalRequest(request)) {
|
|
232
|
+
return {
|
|
233
|
+
approvalId: request.requestId,
|
|
234
|
+
approved: response?.optionId === "approve",
|
|
235
|
+
reason: response === undefined ? IGNORED_INPUT_REASON : undefined,
|
|
236
|
+
type: "tool-approval-response",
|
|
237
|
+
};
|
|
295
238
|
}
|
|
296
|
-
}
|
|
297
|
-
function createQuestionToolResponsePart(input) {
|
|
298
239
|
return {
|
|
299
240
|
output: {
|
|
300
241
|
type: "json",
|
|
301
|
-
value:
|
|
242
|
+
value: response !== undefined
|
|
243
|
+
? { optionId: response.optionId, text: response.text, status: "answered" }
|
|
244
|
+
: { status: "ignored" },
|
|
302
245
|
},
|
|
303
|
-
toolCallId:
|
|
304
|
-
toolName:
|
|
246
|
+
toolCallId: request.action.callId,
|
|
247
|
+
toolName: request.action.toolName,
|
|
305
248
|
type: "tool-result",
|
|
306
249
|
};
|
|
307
250
|
}
|
|
308
|
-
function
|
|
309
|
-
return
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
reason: input.result.reason,
|
|
313
|
-
type: "tool-approval-response",
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
function matchesRuntimeInputRequest(input) {
|
|
317
|
-
return getRuntimeInputRequestKey(input.request) === getRuntimeInputResultKey(input.result);
|
|
318
|
-
}
|
|
319
|
-
function getRuntimeInputRequestKey(request) {
|
|
320
|
-
switch (request.kind) {
|
|
321
|
-
case "question":
|
|
322
|
-
return `question:${request.action.callId}`;
|
|
323
|
-
case "tool-approval":
|
|
324
|
-
return `tool-approval:${request.approvalId}`;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
function getRuntimeInputResultKey(result) {
|
|
328
|
-
switch (result.kind) {
|
|
329
|
-
case "question-result":
|
|
330
|
-
return `question:${result.callId}`;
|
|
331
|
-
case "tool-approval-result":
|
|
332
|
-
return `tool-approval:${result.approvalId}`;
|
|
333
|
-
}
|
|
251
|
+
function isApprovalRequest(request) {
|
|
252
|
+
return (request.options?.length === 2 &&
|
|
253
|
+
request.options[0]?.id === "approve" &&
|
|
254
|
+
request.options[1]?.id === "deny");
|
|
334
255
|
}
|
|
256
|
+
// ---------------------------------------------------------------------------
|
|
257
|
+
// Tool call helpers
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
335
259
|
/**
|
|
336
260
|
* Creates a runtime tool-call action shape from an AI SDK tool call.
|
|
337
261
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-requests.js","sourceRoot":"","sources":["../../../src/harness/input-requests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-requests.js","sourceRoot":"","sources":["../../../src/harness/input-requests.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,uBAAuB,GAAG,+BAA+B,CAAC;AAChE,MAAM,kBAAkB,GAAG,gCAAgC,CAAC;AAC5D,MAAM,uBAAuB,GAAG,+BAA+B,CAAC;AAEhE,MAAM,oBAAoB,GAAG,wDAAwD,CAAC;AAEtF,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAE9E,SAAS,eAAe,CAAC,OAAuB,EAAE,GAAW,EAAE,KAAc;IAC3E,OAAO,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;AACzE,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAuB,EAAE,GAAW;IAC7D,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAG,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACzC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrB,O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;QACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ;KAClC,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { ModelMessage } from "ai";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DeliverPayload } from "../channel/types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Merges two queued
|
|
4
|
+
* Merges two queued deliver payloads into one.
|
|
5
5
|
*
|
|
6
|
-
* Used by the execution layer to coalesce follow-up
|
|
7
|
-
* a turn was in progress, so the next
|
|
6
|
+
* Used by the execution layer to coalesce follow-up deliveries that arrived
|
|
7
|
+
* while a turn was in progress, so the next runtime turn sees one consolidated
|
|
8
8
|
* payload.
|
|
9
9
|
*/
|
|
10
|
-
export declare function coalesceTurnInputs(a:
|
|
10
|
+
export declare function coalesceTurnInputs(a: DeliverPayload, b: DeliverPayload): DeliverPayload;
|
|
11
11
|
/**
|
|
12
|
-
* Extracts the
|
|
12
|
+
* Extracts the final visible assistant text from model response messages.
|
|
13
13
|
*
|
|
14
|
-
* Prefers text extracted from the
|
|
15
|
-
* raw `text` property from the AI SDK result when no
|
|
16
|
-
* Returns `null` when neither source contains
|
|
14
|
+
* Prefers text extracted from the last assistant message that contains visible
|
|
15
|
+
* text. Falls back to the raw `text` property from the AI SDK result when no
|
|
16
|
+
* assistant message contains text. Returns `null` when neither source contains
|
|
17
|
+
* text.
|
|
17
18
|
*/
|
|
18
19
|
export declare function resolveAssistantStepText(messages: readonly ModelMessage[], fallback: string | undefined): string | null;
|
|
19
20
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/harness/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/harness/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,GAAG,cAAc,CAwBvF;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,YAAY,EAAE,EACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,IAAI,CAkBf"}
|