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,14 +1,14 @@
|
|
|
1
1
|
import type { RuntimeSkillSource } from "../../runtime/skills/source.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Formats the "Available skills" system prompt section.
|
|
4
4
|
*
|
|
5
5
|
* All skills are always listed regardless of activation state. Active skill
|
|
6
6
|
* instructions are never injected into the system prompt — the model already
|
|
7
|
-
* has them from the `
|
|
7
|
+
* has them from the `load_skill` tool result. This keeps the system
|
|
8
8
|
* prompt identical across the entire session, preserving prompt caching.
|
|
9
|
+
*
|
|
10
|
+
* Called at graph resolution time so the section is part of the turn
|
|
11
|
+
* agent's static instructions rather than injected per-step.
|
|
9
12
|
*/
|
|
10
|
-
export declare function
|
|
11
|
-
readonly baseSystem: string;
|
|
12
|
-
readonly skills: readonly RuntimeSkillSource[];
|
|
13
|
-
}): string;
|
|
13
|
+
export declare function formatAvailableSkillsSection(skills: readonly RuntimeSkillSource[]): string | null;
|
|
14
14
|
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAG,IAAI,CAejG"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
+
import { posix as pathPosix } from "node:path";
|
|
2
|
+
import { WORKSPACE_ROOT } from "../../runtime/workspace/types.js";
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Formats the "Available skills" system prompt section.
|
|
3
5
|
*
|
|
4
6
|
* All skills are always listed regardless of activation state. Active skill
|
|
5
7
|
* instructions are never injected into the system prompt — the model already
|
|
6
|
-
* has them from the `
|
|
8
|
+
* has them from the `load_skill` tool result. This keeps the system
|
|
7
9
|
* prompt identical across the entire session, preserving prompt caching.
|
|
10
|
+
*
|
|
11
|
+
* Called at graph resolution time so the section is part of the turn
|
|
12
|
+
* agent's static instructions rather than injected per-step.
|
|
8
13
|
*/
|
|
9
|
-
export function
|
|
10
|
-
if (config.skills.length === 0) {
|
|
11
|
-
return config.baseSystem;
|
|
12
|
-
}
|
|
13
|
-
const menu = formatAvailableSkillsSection(config.skills);
|
|
14
|
-
if (menu === null) {
|
|
15
|
-
return config.baseSystem;
|
|
16
|
-
}
|
|
17
|
-
return `${config.baseSystem}\n\n${menu}`;
|
|
18
|
-
}
|
|
19
|
-
function formatAvailableSkillsSection(skills) {
|
|
14
|
+
export function formatAvailableSkillsSection(skills) {
|
|
20
15
|
if (skills.length === 0) {
|
|
21
16
|
return null;
|
|
22
17
|
}
|
|
23
18
|
const lines = [
|
|
24
19
|
"Available skills",
|
|
25
|
-
"Use the activate_skill tool to load a skill by name or id before following its full instructions.",
|
|
26
20
|
"Listed skills are available in this run. Do not claim a listed skill is inaccessible unless activation or workspace inspection actually fails.",
|
|
21
|
+
"If the user names a skill or the request clearly matches one of the descriptions below, call load_skill before proceeding.",
|
|
22
|
+
"If multiple skills match, activate the minimal set that covers the task. After activation, follow the returned instructions instead of improvising around them.",
|
|
23
|
+
"If activation fails, say so briefly and continue with the best fallback. Packaged sibling files under a skill path can be inspected with bash or read_file when needed.",
|
|
27
24
|
...skills.map((skill) => formatAvailableSkillLine(skill)),
|
|
28
25
|
];
|
|
29
26
|
return lines.join("\n");
|
|
30
27
|
}
|
|
31
28
|
function formatAvailableSkillLine(skill) {
|
|
32
|
-
return `- ${skill.name}: ${skill.description}`;
|
|
29
|
+
return `- ${skill.name}: ${skill.description} (path: ${formatSkillWorkspacePath(skill.logicalPath)})`;
|
|
30
|
+
}
|
|
31
|
+
function formatSkillWorkspacePath(logicalPath) {
|
|
32
|
+
return pathPosix.join(WORKSPACE_ROOT, logicalPath);
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../../src/execution/skills/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAqC;IAChF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG;QACZ,kBAAkB;QAClB,gJAAgJ;QAChJ,4HAA4H;QAC5H,iKAAiK;QACjK,yKAAyK;QACzK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;KAC1D,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAyB;IACzD,OAAO,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,WAAW,WAAW,wBAAwB,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;AACxG,CAAC;AAED,SAAS,wBAAwB,CAAC,WAAmB;IACnD,OAAO,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -45,9 +45,9 @@ export interface SkillHandle {
|
|
|
45
45
|
semanticText(): Promise<string>;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Result of attempting to
|
|
48
|
+
* Result of attempting to load a skill through the framework tool.
|
|
49
49
|
*/
|
|
50
|
-
export type
|
|
50
|
+
export type LoadSkillResult = {
|
|
51
51
|
readonly activated: true;
|
|
52
52
|
readonly description: string;
|
|
53
53
|
readonly instructions: string;
|
|
@@ -61,14 +61,14 @@ export type ActivateSkillResult = {
|
|
|
61
61
|
* Mutable skill access layer for one step execution.
|
|
62
62
|
*
|
|
63
63
|
* Created by {@link createSkillAccess} and placed on the
|
|
64
|
-
* {@link AshContext} (via `SkillKey`) so the `
|
|
64
|
+
* {@link AshContext} (via `SkillKey`) so the `load_skill` tool executor
|
|
65
65
|
* can read the available skills and record activations.
|
|
66
66
|
*/
|
|
67
67
|
export interface SkillAccess {
|
|
68
68
|
/**
|
|
69
69
|
* Activates a skill by name or id. Returns the activation outcome.
|
|
70
70
|
*/
|
|
71
|
-
activate(identifier: string):
|
|
71
|
+
activate(identifier: string): LoadSkillResult;
|
|
72
72
|
/**
|
|
73
73
|
* Returns all active skill IDs including any activated during this step.
|
|
74
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/execution/skills/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,IAAI,E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AAa,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAAC;IAE5C;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,GACD;IAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAAC;IAE9C;;OAEG;IACH,iBAAiB,IAAI,SAAS,MAAM,EAAE,CAAC;IAEvC;;;OAGG;IACH,yBAAyB,IAAI,SAAS,MAAM,EAAE,CAAC;IAE/C;;OAEG;IACH,YAAY,IAAI,SAAS,kBAAkB,EAAE,CAAC;IAE9C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Channel, DeliverPayload, SessionAuthContext } from "../channel/types.js";
|
|
2
|
+
import type { AshContext } from "../context/container.js";
|
|
3
|
+
import type { HarnessSession, StepInput, StepResult } from "../harness/types.js";
|
|
4
|
+
export interface StepDeliveryInput {
|
|
5
|
+
readonly auth?: SessionAuthContext | null;
|
|
6
|
+
readonly payload: DeliverPayload;
|
|
7
|
+
}
|
|
8
|
+
export interface PreparedStepContext {
|
|
9
|
+
readonly channel: Channel;
|
|
10
|
+
readonly channelStateSnapshot: Record<string, unknown>;
|
|
11
|
+
readonly ctx: AshContext;
|
|
12
|
+
readonly input: StepInput | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function prepareStepContext(input: {
|
|
15
|
+
readonly delivery?: StepDeliveryInput;
|
|
16
|
+
readonly serializedRuntimeContext: Record<string, unknown>;
|
|
17
|
+
readonly session: HarnessSession;
|
|
18
|
+
}): Promise<PreparedStepContext>;
|
|
19
|
+
/**
|
|
20
|
+
* Runs one step inside the provider lifecycle and asserts that the
|
|
21
|
+
* channel's serialized state was not mutated during execution.
|
|
22
|
+
*
|
|
23
|
+
* Combines {@link runStep} with a post-step channel stability check so
|
|
24
|
+
* callers do not need to repeat the three-call sequence themselves.
|
|
25
|
+
*/
|
|
26
|
+
export declare function runStepWithChannelGuard(prepared: PreparedStepContext, session: HarnessSession, callback: (session: HarnessSession) => Promise<StepResult>): Promise<StepResult>;
|
|
27
|
+
//# sourceMappingURL=step-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-context.d.ts","sourceRoot":"","sources":["../../../src/execution/step-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM1D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA0B/B;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,UAAU,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,CAQrB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
import { hydrateDurableContext } from "../context/durable-context.js";
|
|
3
|
+
import { AuthKey, ChannelKey } from "../context/keys.js";
|
|
4
|
+
import { runStep } from "../context/run-step.js";
|
|
5
|
+
import { deserializeRuntimeContext } from "../context/serialize.js";
|
|
6
|
+
import { seedPendingInputRequestsContext } from "../harness/input-requests.js";
|
|
7
|
+
export async function prepareStepContext(input) {
|
|
8
|
+
const ctx = await deserializeRuntimeContext(input.serializedRuntimeContext);
|
|
9
|
+
await hydrateDurableContext(ctx, input.session);
|
|
10
|
+
seedPendingInputRequestsContext(ctx, input.session);
|
|
11
|
+
if (input.delivery?.auth !== undefined) {
|
|
12
|
+
ctx.set(AuthKey, input.delivery.auth ?? null);
|
|
13
|
+
}
|
|
14
|
+
const channel = ctx.get(ChannelKey);
|
|
15
|
+
const channelStateSnapshot = channel.serialize();
|
|
16
|
+
const resolved = input.delivery !== undefined ? await channel.onDeliver(ctx, input.delivery.payload) : undefined;
|
|
17
|
+
assertChannelStateIsStable({
|
|
18
|
+
channel,
|
|
19
|
+
phase: "onDeliver",
|
|
20
|
+
serializedState: channelStateSnapshot,
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
channel,
|
|
24
|
+
channelStateSnapshot,
|
|
25
|
+
ctx,
|
|
26
|
+
input: resolved,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runs one step inside the provider lifecycle and asserts that the
|
|
31
|
+
* channel's serialized state was not mutated during execution.
|
|
32
|
+
*
|
|
33
|
+
* Combines {@link runStep} with a post-step channel stability check so
|
|
34
|
+
* callers do not need to repeat the three-call sequence themselves.
|
|
35
|
+
*/
|
|
36
|
+
export async function runStepWithChannelGuard(prepared, session, callback) {
|
|
37
|
+
const stepResult = await runStep(prepared.ctx, session, callback);
|
|
38
|
+
assertChannelStateIsStable({
|
|
39
|
+
channel: prepared.channel,
|
|
40
|
+
phase: "step execution",
|
|
41
|
+
serializedState: prepared.channelStateSnapshot,
|
|
42
|
+
});
|
|
43
|
+
return stepResult;
|
|
44
|
+
}
|
|
45
|
+
function assertChannelStateIsStable(input) {
|
|
46
|
+
const currentState = input.channel.serialize();
|
|
47
|
+
if (isDeepStrictEqual(currentState, input.serializedState)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`Channel "${input.channel.kind}" mutated its serialized state during ${input.phase}. ` +
|
|
51
|
+
"Channel constructor state must stay immutable after the run starts. " +
|
|
52
|
+
"Move per-session mutable data into durable context or session.internal instead.");
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=step-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-context.js","sourceRoot":"","sources":["../../../src/execution/step-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI9C,OAAO,EAAE,qBAAqB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,uBAAuB,CAC3C,QAA6B,EAC7B,OAAuB,EACvB,QAA0D;IAE1D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAClE,0BAA0B,CAAC;QACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,KAAK,EAAE,gBAAgB;QACvB,eAAe,EAAE,QAAQ,CAAC,oBAAoB;KAC/C,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,0BAA0B,CAAC,KAInC;IACC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IAC/C,IAAI,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,MAAM,IAAI,KAAK,CACb,YAAY,KAAK,CAAC,OAAO,CAAC,IAAI,yCAAyC,KAAK,CAAC,KAAK,IAAI;QACpF,sEAAsE;QACtE,iFAAiF,CACpF,CAAC;AACJ,CAAC"}
|
|
@@ -16,7 +16,7 @@ export interface CreateSubagentToolExecutorInput {
|
|
|
16
16
|
* Parent harness emit function. Used to bracket the child run with
|
|
17
17
|
* `subagent.started` / `subagent.completed` lifecycle events and to
|
|
18
18
|
* forward each pre-wrapped `subagent.event` envelope produced by the
|
|
19
|
-
* child's {@link
|
|
19
|
+
* child's {@link SubagentChannel}.
|
|
20
20
|
*/
|
|
21
21
|
readonly parentEmit: HarnessEmitFn;
|
|
22
22
|
readonly subagentTool: PreparedRuntimeSubagentTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-tool.d.ts","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA8BpD;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,GACrC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"subagent-tool.d.ts","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA8BpD;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,+BAA+B,GACrC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAgErC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SubagentChannel } from "../channel/subagent-channel.js";
|
|
2
2
|
import { requireContext } from "../context/container.js";
|
|
3
3
|
import { AuthKey, BundleKey, InitiatorAuthKey, SessionKey } from "../context/keys.js";
|
|
4
4
|
import { mintSubagentContinuationToken } from "./session.js";
|
|
@@ -7,7 +7,7 @@ import { formatSubagentInvocation } from "./subagent-invocation.js";
|
|
|
7
7
|
* Drains every event from the child's run handle and forwards it
|
|
8
8
|
* verbatim to the parent's emit function.
|
|
9
9
|
*
|
|
10
|
-
* The child's {@link
|
|
10
|
+
* The child's {@link SubagentChannel} has already wrapped every
|
|
11
11
|
* event in a `subagent.event` envelope tagged with the child's call id
|
|
12
12
|
* and subagent name, so this pump has no envelope-construction logic —
|
|
13
13
|
* it is a literal forwarder.
|
|
@@ -59,7 +59,7 @@ export function createSubagentToolExecutor(input) {
|
|
|
59
59
|
}).message ?? "";
|
|
60
60
|
const handle = await childRuntime.run({
|
|
61
61
|
auth: parentAuth,
|
|
62
|
-
|
|
62
|
+
channel: new SubagentChannel({
|
|
63
63
|
callId,
|
|
64
64
|
subagentName: subagentTool.name,
|
|
65
65
|
}),
|
|
@@ -70,7 +70,6 @@ export function createSubagentToolExecutor(input) {
|
|
|
70
70
|
},
|
|
71
71
|
mode: "task",
|
|
72
72
|
parent: {
|
|
73
|
-
runId: parentSession.runId,
|
|
74
73
|
sessionId: parentSession.sessionId,
|
|
75
74
|
turn: parentSession.turn,
|
|
76
75
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-tool.js","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"subagent-tool.js","sourceRoot":"","sources":["../../../src/execution/subagent-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CA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,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE;SACzE,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -9,9 +9,7 @@ import type { ResolvedToolDefinition } from "../runtime/types.js";
|
|
|
9
9
|
* {@link CompactionCallbackResult}:
|
|
10
10
|
*
|
|
11
11
|
* - `messages` from each hook are concatenated in order.
|
|
12
|
-
* -
|
|
13
|
-
* later tools overwrite earlier on key collision.
|
|
14
|
-
* - Hooks may also mutate context directly via the {@link AshContext}
|
|
12
|
+
* - Hooks may mutate durable context directly via the {@link AshContext}
|
|
15
13
|
* handle they receive; later hooks observe the mutation.
|
|
16
14
|
* - A hook returning `void` is treated as a no-op.
|
|
17
15
|
* - Hooks are isolated: if one throws, the dispatcher logs the error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-compaction.d.ts","sourceRoot":"","sources":["../../../src/execution/tool-compaction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-compaction.d.ts","sourceRoot":"","sources":["../../../src/execution/tool-compaction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIlE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,sBAAsB,EAAE,GACvC,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAsChE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requireContext } from "../context/container.js";
|
|
2
|
+
const NEVER_ABORT_SIGNAL = new AbortController().signal;
|
|
2
3
|
/**
|
|
3
4
|
* Builds the harness compaction callback for a list of resolved tools.
|
|
4
5
|
*
|
|
@@ -8,9 +9,7 @@ import { requireContext } from "../context/container.js";
|
|
|
8
9
|
* {@link CompactionCallbackResult}:
|
|
9
10
|
*
|
|
10
11
|
* - `messages` from each hook are concatenated in order.
|
|
11
|
-
* -
|
|
12
|
-
* later tools overwrite earlier on key collision.
|
|
13
|
-
* - Hooks may also mutate context directly via the {@link AshContext}
|
|
12
|
+
* - Hooks may mutate durable context directly via the {@link AshContext}
|
|
14
13
|
* handle they receive; later hooks observe the mutation.
|
|
15
14
|
* - A hook returning `void` is treated as a no-op.
|
|
16
15
|
* - Hooks are isolated: if one throws, the dispatcher logs the error
|
|
@@ -32,38 +31,25 @@ export function createToolCompactionHandler(tools) {
|
|
|
32
31
|
// v1 has no real cancellation plumbing through the harness yet — pass
|
|
33
32
|
// a never-aborting signal so hooks can adopt the parameter without a
|
|
34
33
|
// breaking change later when a real signal is threaded through.
|
|
35
|
-
const signal =
|
|
34
|
+
const signal = NEVER_ABORT_SIGNAL;
|
|
36
35
|
const messages = [];
|
|
37
|
-
let state = session.state ?? {};
|
|
38
|
-
let mutated = false;
|
|
39
36
|
for (const tool of participants) {
|
|
40
|
-
const hook = tool.onCompact;
|
|
41
|
-
if (hook === undefined)
|
|
42
|
-
continue;
|
|
43
37
|
let result;
|
|
44
38
|
try {
|
|
45
|
-
|
|
39
|
+
// biome-ignore lint/style/noNonNullAssertion: participants filtered to only include tools with onCompact
|
|
40
|
+
result = (await tool.onCompact({ ctx, session, signal })) ?? {};
|
|
46
41
|
}
|
|
47
42
|
catch (error) {
|
|
48
|
-
// Isolate failures: a single broken hook should not block the
|
|
49
|
-
// remaining tools. Log enough context for the author to find the
|
|
50
|
-
// bug, then move on.
|
|
51
43
|
console.warn(`[ash] Compaction hook for tool "${tool.name}" threw and was skipped:`, error);
|
|
52
44
|
continue;
|
|
53
45
|
}
|
|
54
|
-
if (result === undefined)
|
|
55
|
-
continue;
|
|
56
46
|
if (result.messages !== undefined && result.messages.length > 0) {
|
|
57
47
|
messages.push(...result.messages);
|
|
58
48
|
}
|
|
59
|
-
if (result.sessionPatch !== undefined) {
|
|
60
|
-
state = { ...state, ...result.sessionPatch };
|
|
61
|
-
mutated = true;
|
|
62
|
-
}
|
|
63
49
|
}
|
|
64
50
|
return {
|
|
65
51
|
messages,
|
|
66
|
-
session
|
|
52
|
+
session,
|
|
67
53
|
};
|
|
68
54
|
};
|
|
69
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-compaction.js","sourceRoot":"","sources":["../../../src/execution/tool-compaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIzD
|
|
1
|
+
{"version":3,"file":"tool-compaction.js","sourceRoot":"","sources":["../../../src/execution/tool-compaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIzD,MAAM,kBAAkB,GAAG,IAAI,eAAe,EAAE,CAAC,MAAM,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAwC;IAExC,sEAAsE;IACtE,2DAA2D;IAC3D,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;IAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE;QACvB,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;QACnC,CAAC;QAED,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,sEAAsE;QACtE,qEAAqE;QACrE,gEAAgE;QAChE,MAAM,MAAM,GAAG,kBAAkB,CAAC;QAElC,MAAM,QAAQ,GAAmB,EAAE,CAAC;QAEpC,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;YAChC,IAAI,MAA6E,CAAC;YAClF,IAAI,CAAC;gBACH,yGAAyG;gBACzG,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,SAAU,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACnE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,mCAAmC,IAAI,CAAC,IAAI,0BAA0B,EAAE,KAAK,CAAC,CAAC;gBAC5F,SAAS;YACX,CAAC;YAED,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChE,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ;YACR,OAAO;SACR,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HarnessSession } from "../harness/types.js";
|
|
2
|
-
export type {
|
|
2
|
+
export type { Channel, DeliverInput, EventEmitFn, RunHandle, RunInput, RunResult, Runtime, SessionParent, SessionTurn, } from "../channel/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Serializable projection of a step result for workflow persistence.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EACV,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,aAAa,EACb,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Serializable input for the workflow entrypoint.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* by `
|
|
6
|
-
* each `"use step"` boundary.
|
|
7
|
-
*
|
|
8
|
-
* the serialized record.
|
|
4
|
+
* Runtime seed keys are carried inside `serializedContext`, which is produced
|
|
5
|
+
* by `serializeRuntimeContext(ctx)` in the workflow runtime and deserialized
|
|
6
|
+
* at each `"use step"` boundary. Durable authored context is stored
|
|
7
|
+
* separately on `session.context` and rehydrated before each step.
|
|
9
8
|
*/
|
|
10
9
|
export interface WorkflowEntryInput {
|
|
11
10
|
readonly input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-entry.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow-entry.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAsF3F"}
|
|
@@ -18,14 +18,16 @@ export async function workflowEntry(input) {
|
|
|
18
18
|
"use workflow";
|
|
19
19
|
const continuationToken = input.serializedContext["ash.continuationToken"];
|
|
20
20
|
const mode = input.serializedContext["ash.mode"];
|
|
21
|
+
const sessionId = input.serializedContext["ash.sessionId"];
|
|
21
22
|
const serializedBundle = input.serializedContext["ash.bundle"];
|
|
22
23
|
const session = await createSessionStep({
|
|
23
24
|
compiledArtifactsSource: serializedBundle.source,
|
|
24
25
|
continuationToken,
|
|
25
26
|
nodeSelector: serializedBundle.nodeSelector,
|
|
27
|
+
sessionId,
|
|
26
28
|
});
|
|
27
29
|
let currentSession = session;
|
|
28
|
-
const firstTurnResult = await runTurn(input.serializedContext, currentSession, { message: input.input.message }, mode);
|
|
30
|
+
const firstTurnResult = await runTurn(input.serializedContext, currentSession, { payload: { message: input.input.message } }, mode);
|
|
29
31
|
currentSession = firstTurnResult.session;
|
|
30
32
|
if (firstTurnResult.action === "done") {
|
|
31
33
|
return { output: firstTurnResult.output ?? "" };
|
|
@@ -58,7 +60,10 @@ export async function workflowEntry(input) {
|
|
|
58
60
|
if (ready.done) {
|
|
59
61
|
break;
|
|
60
62
|
}
|
|
61
|
-
coalesced =
|
|
63
|
+
coalesced = {
|
|
64
|
+
auth: ready.value.auth ?? coalesced.auth,
|
|
65
|
+
payload: coalesceTurnInputs(coalesced.payload, ready.value.payload),
|
|
66
|
+
};
|
|
62
67
|
}
|
|
63
68
|
const turnResult = await runTurn(input.serializedContext, currentSession, coalesced, mode);
|
|
64
69
|
currentSession = turnResult.session;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-entry.js","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-entry.js","sourceRoot":"","sources":["../../../src/execution/workflow-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAsBxE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAyB;IAC3D,cAAc,CAAC;IAEf,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,uBAAuB,CAAW,CAAC;IACrF,MAAM,IAAI,GAAG,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAY,CAAC;IAC5D,MAAM,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAW,CAAC;IACrE,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAG5D,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC;QACtC,uBAAuB,EAAE,gBAAgB,CAAC,MAAM;QAChD,iBAAiB;QACjB,YAAY,EAAE,gBAAgB,CAAC,YAAY;QAC3C,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,cAAc,GAAmB,OAAO,CAAC;IAE7C,MAAM,eAAe,GAAG,MAAM,OAAO,CACnC,KAAK,CAAC,iBAAiB,EACvB,cAAc,EACd,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAC7C,IAAI,CACL,CAAC;IACF,cAAc,GAAG,eAAe,CAAC,OAAO,CAAC;IAEzC,IAAI,eAAe,CAAC,MAAM,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AAC1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"workflow-runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAMV,OAAO,EACR,MAAM,qBAAqB,CAAC;AAO7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAQ9F;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;CAElC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,QAAQ,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;IACjE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CA8CV"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getRun, resumeHook, start } from "workflow/api";
|
|
2
|
-
import {
|
|
2
|
+
import { assertNoDurableContextInRuntimeSeed, serializeRuntimeContext, } from "../context/serialize.js";
|
|
3
3
|
import { resolveInstalledPackageInfo } from "../internal/application/package.js";
|
|
4
4
|
import { getCompiledRuntimeAgentBundle } from "../runtime/sessions/compiled-agent-cache.js";
|
|
5
5
|
import { buildRunContext } from "./runtime-context.js";
|
|
@@ -34,7 +34,8 @@ export function createWorkflowRuntime(config) {
|
|
|
34
34
|
nodeSelector: config.nodeSelector,
|
|
35
35
|
});
|
|
36
36
|
const ctx = buildRunContext({ bundle, run: input });
|
|
37
|
-
|
|
37
|
+
assertNoDurableContextInRuntimeSeed(ctx);
|
|
38
|
+
const serializedContext = serializeRuntimeContext(ctx);
|
|
38
39
|
const run = await start(workflowEntryReference, [
|
|
39
40
|
{
|
|
40
41
|
input: input.input,
|
|
@@ -53,10 +54,14 @@ export function createWorkflowRuntime(config) {
|
|
|
53
54
|
};
|
|
54
55
|
},
|
|
55
56
|
async deliver(input) {
|
|
56
|
-
|
|
57
|
+
const hookPayload = {
|
|
58
|
+
auth: input.auth,
|
|
59
|
+
payload: input.payload,
|
|
60
|
+
};
|
|
61
|
+
await resumeHook(input.continuationToken, hookPayload);
|
|
57
62
|
},
|
|
58
|
-
async getEventStream(
|
|
59
|
-
return parseNdjsonStream(getRun(
|
|
63
|
+
async getEventStream(sessionId, options) {
|
|
64
|
+
return parseNdjsonStream(getRun(sessionId).getReadable({ startIndex: options?.startIndex }));
|
|
60
65
|
},
|
|
61
66
|
};
|
|
62
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-runtime.js","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-runtime.js","sourceRoot":"","sources":["../../../src/execution/workflow-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAUzD,OAAO,EACL,mCAAmC,EACnC,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAGjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAC5C,MAAM,gBAAgB,GAAG,2BAA2B,EAAE,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,UAAU,EAAE,aAAa,gBAAgB,CAAC,IAAI,IAAI,gBAAgB,CAAC,OAAO,KAAK,mBAAmB,EAAE;CACrG,CAAC;AAEF;;;;;;;;;;;;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AY,CAAC,CAAC,IAAI,EAAE,CAAC;wBAClD,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;wBAExC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BACpB,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAA6B,CAAC,CAAC;wBACnE,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1B,CAAC;oBAAS,CAAC;gBACT,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HookPayload } from "../channel/types.js";
|
|
2
|
+
import { type HarnessSession } from "../harness/types.js";
|
|
2
3
|
import type { RuntimeCompiledArtifactsSource } from "../runtime/compiled-artifacts-source.js";
|
|
3
4
|
import type { DurableStepResult } from "./types.js";
|
|
4
5
|
/**
|
|
5
6
|
* Runs one atomic harness step inside a durable `"use step"` boundary.
|
|
6
7
|
*
|
|
7
8
|
* Receives a serialized context (plain JSON) and deserializes it at the
|
|
8
|
-
* top of the step so all seed keys (channel
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* top of the step so all seed keys (channel, bundle, etc.) are live
|
|
10
|
+
* instances. The deserialized bundle is already resolved to the correct
|
|
11
|
+
* node (root or subagent) via the BundleKey codec.
|
|
12
|
+
*
|
|
13
|
+
* When `input` is defined, the delivery goes through the channel's
|
|
14
|
+
* {@link Channel.onDeliver} and the runtime's pending-input resolution
|
|
15
|
+
* before the harness sees it. Deliver-time auth from the
|
|
16
|
+
* {@link HookPayload} is applied to the context before the step runs.
|
|
11
17
|
*/
|
|
12
|
-
export declare function durableRunStep(serializedContext: Record<string, unknown>, session: HarnessSession, input:
|
|
18
|
+
export declare function durableRunStep(serializedContext: Record<string, unknown>, session: HarnessSession, input: HookPayload | undefined): Promise<DurableStepResult>;
|
|
13
19
|
/**
|
|
14
|
-
* Creates the durable session
|
|
20
|
+
* Creates the durable harness session inside a step boundary before the
|
|
15
21
|
* workflow enters its long-lived turn loop.
|
|
16
22
|
*
|
|
17
23
|
* The optional `nodeSelector` targets a specific node in the compiled
|
|
@@ -22,5 +28,6 @@ export declare function createSessionStep(input: {
|
|
|
22
28
|
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
23
29
|
readonly continuationToken: string;
|
|
24
30
|
readonly nodeSelector?: string;
|
|
31
|
+
readonly sessionId: string;
|
|
25
32
|
}): Promise<HarnessSession>;
|
|
26
33
|
//# sourceMappingURL=workflow-steps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-steps.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-steps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow-steps.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow-steps.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,KAAK,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAEtE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAK9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,WAAW,GAAG,SAAS,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAkD5B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;IACjE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GAAG,OAAO,CAAC,cAAc,CAAC,CAgB1B"}
|