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,6 +1,14 @@
|
|
|
1
|
+
import type { ContextStoreKey } from "../context/key.js";
|
|
2
|
+
import type { StepInput } from "../harness/types.js";
|
|
1
3
|
import type { HandleMessageStreamEvent } from "../protocol/message.js";
|
|
2
4
|
import type { RunMode } from "../run-mode.js";
|
|
3
|
-
import type {
|
|
5
|
+
import type { InputResponse } from "../runtime/input/types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Global symbol brand used to recognize Ash channel classes across
|
|
8
|
+
* independently-loaded copies of the package during compile/runtime tests.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CHANNEL_CLASS_BRAND: unique symbol;
|
|
11
|
+
export declare const CHANNEL_PROTOTYPE_BRAND: unique symbol;
|
|
4
12
|
/**
|
|
5
13
|
* Identifies one turn within a session.
|
|
6
14
|
*/
|
|
@@ -13,16 +21,15 @@ export interface SessionTurn {
|
|
|
13
21
|
* delegated the current session.
|
|
14
22
|
*/
|
|
15
23
|
export interface SessionParent {
|
|
16
|
-
readonly runId: string;
|
|
17
24
|
readonly sessionId: string;
|
|
18
25
|
readonly turn: SessionTurn;
|
|
19
26
|
}
|
|
20
27
|
/**
|
|
21
28
|
* Authenticated caller principal attached to a request.
|
|
22
29
|
*
|
|
23
|
-
* Produced by
|
|
24
|
-
* and
|
|
25
|
-
*
|
|
30
|
+
* Produced by route-level auth strategies (JWT, OIDC, HTTP Basic, etc.)
|
|
31
|
+
* and passed to the runtime on {@link RunInput.auth} and
|
|
32
|
+
* {@link DeliverInput.auth}.
|
|
26
33
|
*/
|
|
27
34
|
export interface SessionAuthContext {
|
|
28
35
|
readonly attributes: Readonly<Record<string, string | readonly string[]>>;
|
|
@@ -32,121 +39,183 @@ export interface SessionAuthContext {
|
|
|
32
39
|
readonly principalType: string;
|
|
33
40
|
readonly subject?: string;
|
|
34
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Narrow accessor passed to {@link Channel.onDeliver} callbacks. Exposes only
|
|
44
|
+
* typed context operations — keeps channel code workflow-agnostic and
|
|
45
|
+
* prevents channels from depending on {@link AshContext} internals such as
|
|
46
|
+
* `entries()`.
|
|
47
|
+
*/
|
|
48
|
+
export interface ContextAccessor {
|
|
49
|
+
get<T>(key: ContextStoreKey<T>): T;
|
|
50
|
+
tryGet<T>(key: ContextStoreKey<T>): T | undefined;
|
|
51
|
+
has<T>(key: ContextStoreKey<T>): boolean;
|
|
52
|
+
set<T>(key: ContextStoreKey<T>, value: T): void;
|
|
53
|
+
ensure<T>(key: ContextStoreKey<T>, valueOrFactory: T | (() => T)): T;
|
|
54
|
+
}
|
|
35
55
|
/**
|
|
36
56
|
* Function provided by the runtime that writes one event to the event stream.
|
|
37
57
|
*
|
|
38
58
|
* Backed by `getWritable()` in the workflow runtime or a `TransformStream`
|
|
39
|
-
* in the continuous loop runtime.
|
|
59
|
+
* in the continuous loop runtime. Not part of the {@link Channel} interface —
|
|
60
|
+
* the runtime always writes events to the stream itself.
|
|
40
61
|
*/
|
|
41
62
|
export type EventEmitFn = (event: HandleMessageStreamEvent) => Promise<void>;
|
|
42
63
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
64
|
+
* Raw payload from a channel deliver call.
|
|
65
|
+
*
|
|
66
|
+
* For interactive channels (Slack button callbacks, HTTP clients), the
|
|
67
|
+
* payload may carry structured {@link InputResponse} objects alongside
|
|
68
|
+
* or instead of a text message. For text-only channels (Slack thread
|
|
69
|
+
* replies), only `message` is set.
|
|
70
|
+
*/
|
|
71
|
+
export interface DeliverPayload {
|
|
72
|
+
readonly inputResponses?: readonly InputResponse[];
|
|
73
|
+
readonly message?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Serializable payload sent through the workflow `resumeHook` on deliver.
|
|
45
77
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
78
|
+
* Wraps the raw {@link DeliverPayload} together with an optional auth
|
|
79
|
+
* update so deliver-time auth can cross the durable hook boundary
|
|
80
|
+
* without a process-local side-channel.
|
|
81
|
+
*/
|
|
82
|
+
export interface HookPayload {
|
|
83
|
+
readonly auth?: SessionAuthContext | null;
|
|
84
|
+
readonly payload: DeliverPayload;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Serializable conduit that owns the full lifecycle of one platform
|
|
88
|
+
* integration.
|
|
89
|
+
*
|
|
90
|
+
* A channel carries auth, renders outbound events to the platform,
|
|
91
|
+
* transforms inbound deliver payloads, and optionally sets custom
|
|
92
|
+
* context keys. It is serialized across workflow step boundaries via
|
|
93
|
+
* {@link serialize} plus constructor-based rehydration performed by the
|
|
94
|
+
* runtime-owned channel registry.
|
|
51
95
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
96
|
+
* Channels are class-based durable values. Authors define a concrete
|
|
97
|
+
* subclass, declare a unique static `kind`, and pass an instance on
|
|
98
|
+
* {@link RunInput.channel}. The runtime invokes {@link onEvent} /
|
|
99
|
+
* {@link onDeliver} during the step loop. Auth is separate from the
|
|
100
|
+
* channel — it lives on {@link RunInput.auth} and
|
|
101
|
+
* {@link DeliverInput.auth}.
|
|
57
102
|
*/
|
|
58
|
-
export
|
|
103
|
+
export declare abstract class Channel {
|
|
59
104
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
105
|
+
* Runtime marker inherited by every channel subclass constructor.
|
|
106
|
+
* Used by route-definition validation without relying on `instanceof`
|
|
107
|
+
* across multiple loaded copies of the package.
|
|
62
108
|
*/
|
|
63
|
-
readonly
|
|
109
|
+
static readonly [CHANNEL_CLASS_BRAND] = true;
|
|
110
|
+
/**
|
|
111
|
+
* Runtime marker inherited by every channel subclass prototype.
|
|
112
|
+
* Route-definition validation reads this through the subclass prototype
|
|
113
|
+
* chain so authored channels from another loaded package copy still
|
|
114
|
+
* register correctly.
|
|
115
|
+
*/
|
|
116
|
+
protected get [CHANNEL_PROTOTYPE_BRAND](): true;
|
|
64
117
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* additionally perform platform-specific side effects.
|
|
118
|
+
* Nominal marker that prevents plain object literals from satisfying
|
|
119
|
+
* the channel contract. Durable channels must be real class instances.
|
|
68
120
|
*/
|
|
69
|
-
|
|
121
|
+
protected readonly __channelBrand: undefined;
|
|
70
122
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
123
|
+
* Stable identifier for this channel instance, derived from the
|
|
124
|
+
* subclass's static {@link ChannelClass.kind} field.
|
|
125
|
+
*/
|
|
126
|
+
get kind(): string;
|
|
127
|
+
/**
|
|
128
|
+
* Outbound: called by the runtime for every lifecycle event. Returns
|
|
129
|
+
* the event to write to the stream — usually the same event passed
|
|
130
|
+
* in, but channels may transform it (e.g. the subagent channel wraps
|
|
131
|
+
* events in `subagent.event` envelopes).
|
|
73
132
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
133
|
+
* Platform-specific side effects (Slack typing indicators, message
|
|
134
|
+
* posting, etc.) happen inside this method before returning.
|
|
135
|
+
*/
|
|
136
|
+
abstract onEvent(event: HandleMessageStreamEvent): Promise<HandleMessageStreamEvent>;
|
|
137
|
+
/**
|
|
138
|
+
* Called once per turn — both the initial `run()` and each
|
|
139
|
+
* `deliver()` — after auth keys have been seeded on the context.
|
|
80
140
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
141
|
+
* The channel receives a context accessor and the inbound payload.
|
|
142
|
+
* It can set custom context keys (e.g. thread history for tools to
|
|
143
|
+
* read) and transform the payload (e.g. resolve text against pending
|
|
144
|
+
* input request options). Returns the resolved step input that the
|
|
145
|
+
* harness will see.
|
|
146
|
+
*
|
|
147
|
+
* Async so channels can fetch platform data (thread history, user
|
|
148
|
+
* profiles, etc.) before the step runs.
|
|
83
149
|
*/
|
|
84
|
-
|
|
85
|
-
readonly message: string;
|
|
86
|
-
readonly requests: readonly RuntimeInputRequest[];
|
|
87
|
-
}): readonly RuntimeInputResult[] | undefined;
|
|
150
|
+
abstract onDeliver(ctx: ContextAccessor, payload: DeliverPayload): Promise<StepInput>;
|
|
88
151
|
/**
|
|
89
|
-
* Returns the JSON-serializable state needed to reconstruct this
|
|
90
|
-
* after a workflow step boundary. The framework wraps the
|
|
91
|
-
* `{ kind, state }` and stores it on the durable workflow
|
|
152
|
+
* Returns the JSON-serializable state needed to reconstruct this
|
|
153
|
+
* channel after a workflow step boundary. The framework wraps the
|
|
154
|
+
* result in `{ kind, state }` and stores it on the durable workflow
|
|
155
|
+
* context.
|
|
92
156
|
*/
|
|
93
|
-
serialize(): Record<string, unknown>;
|
|
157
|
+
abstract serialize(): Record<string, unknown>;
|
|
94
158
|
}
|
|
95
159
|
/**
|
|
96
|
-
* Static interface implemented by every {@link
|
|
97
|
-
* the channel
|
|
98
|
-
* instance from previously-serialized state.
|
|
160
|
+
* Static interface implemented by every {@link Channel} class. Used by
|
|
161
|
+
* the runtime-owned channel registry to look up a class by `kind` and
|
|
162
|
+
* rebuild an instance from previously-serialized state.
|
|
99
163
|
*/
|
|
100
|
-
export interface
|
|
164
|
+
export interface ChannelClass<C extends Channel = Channel> {
|
|
165
|
+
/**
|
|
166
|
+
* Stable durable identifier for the channel subclass. Must be unique
|
|
167
|
+
* across all serializable channel classes visible to one runtime bundle.
|
|
168
|
+
*/
|
|
101
169
|
readonly kind: string;
|
|
102
170
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
171
|
+
* Constructs a channel instance. Specific route helpers may constrain the
|
|
172
|
+
* constructor input shape further (for example Slack channel classes accept
|
|
173
|
+
* {@link import("./slack-channel.js").SlackChannelState}).
|
|
105
174
|
*/
|
|
106
|
-
|
|
175
|
+
new (...args: never[]): C;
|
|
107
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Returns the static durable kind for a channel class.
|
|
179
|
+
*/
|
|
180
|
+
export declare function getChannelClassKind(channelClass: ChannelClass): string;
|
|
108
181
|
/**
|
|
109
182
|
* Single input shape consumed by {@link Runtime.run} for both root runs
|
|
110
|
-
* (started by
|
|
183
|
+
* (started by routes) and delegated child runs (started by the
|
|
111
184
|
* subagent tool wrapper).
|
|
112
185
|
*
|
|
113
|
-
*
|
|
186
|
+
* Routes build the platform-facing fields (`auth`, `channel`,
|
|
114
187
|
* `continuationToken`, `input`, `mode`, `sessionId`) from inbound
|
|
115
188
|
* platform input and call `runtime.run(input)` directly. The subagent
|
|
116
189
|
* tool wrapper builds the same shape and additionally sets
|
|
117
190
|
* `initiatorAuth` and `parent` to forward the audit chain and record
|
|
118
|
-
* lineage.
|
|
119
|
-
* into a fully-seeded {@link AshContext} — channels and the wrapper
|
|
120
|
-
* stay free of any compiled-bundle or context-building knowledge.
|
|
191
|
+
* lineage.
|
|
121
192
|
*
|
|
122
|
-
* `input.message` is the first user-visible message for this
|
|
193
|
+
* `input.message` is the first user-visible message for this session.
|
|
123
194
|
* Subsequent deliveries via {@link Runtime.deliver} carry their own
|
|
124
|
-
* messages, so the field is per-call rather than
|
|
195
|
+
* messages, so the field is per-call rather than session-wide state.
|
|
125
196
|
*/
|
|
126
197
|
export interface RunInput {
|
|
127
198
|
/**
|
|
128
|
-
* Authenticated caller principal for this
|
|
129
|
-
*
|
|
130
|
-
* runs this is the auth of whoever called the parent step that
|
|
131
|
-
* triggered the delegation.
|
|
199
|
+
* Authenticated caller principal for this session. `null` means the
|
|
200
|
+
* request was accepted with no credentials.
|
|
132
201
|
*/
|
|
133
|
-
readonly auth
|
|
202
|
+
readonly auth: SessionAuthContext | null;
|
|
134
203
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
204
|
+
* The channel conduit for this session. Owns event delivery policy
|
|
205
|
+
* and is serialized across workflow step boundaries.
|
|
137
206
|
*/
|
|
138
|
-
readonly
|
|
207
|
+
readonly channel: Channel;
|
|
139
208
|
readonly continuationToken: string;
|
|
140
|
-
readonly input: {
|
|
141
|
-
readonly message: string;
|
|
142
|
-
};
|
|
143
209
|
/**
|
|
144
210
|
* The original (top-level) caller's auth, forwarded down the
|
|
145
211
|
* delegation chain so the child's `session.auth.initiator` always
|
|
146
|
-
* resolves back to whoever started the root
|
|
147
|
-
* when omitted (root
|
|
212
|
+
* resolves back to whoever started the root session. Defaults to
|
|
213
|
+
* {@link auth} when omitted (root session behavior).
|
|
148
214
|
*/
|
|
149
215
|
readonly initiatorAuth?: SessionAuthContext | null;
|
|
216
|
+
readonly input: {
|
|
217
|
+
readonly message: string;
|
|
218
|
+
};
|
|
150
219
|
/**
|
|
151
220
|
* Execution mode for the run.
|
|
152
221
|
*
|
|
@@ -157,7 +226,7 @@ export interface RunInput {
|
|
|
157
226
|
readonly mode: RunMode;
|
|
158
227
|
/**
|
|
159
228
|
* Lineage metadata describing the immediate parent execution that
|
|
160
|
-
* delegated this run. Absent on root runs started by
|
|
229
|
+
* delegated this run. Absent on root runs started by routes.
|
|
161
230
|
*/
|
|
162
231
|
readonly parent?: SessionParent;
|
|
163
232
|
/**
|
|
@@ -173,15 +242,13 @@ export interface RunInput {
|
|
|
173
242
|
export interface DeliverInput {
|
|
174
243
|
/**
|
|
175
244
|
* Authenticated caller principal for this follow-up message.
|
|
176
|
-
* May differ from the session initiator when different users send
|
|
177
|
-
* to the same session.
|
|
245
|
+
* May differ from the session initiator when different users send
|
|
246
|
+
* messages to the same session. The runtime updates `AuthKey` from
|
|
247
|
+
* this field before calling the channel's hooks.
|
|
178
248
|
*/
|
|
179
249
|
readonly auth?: SessionAuthContext | null;
|
|
180
250
|
readonly continuationToken: string;
|
|
181
|
-
readonly payload:
|
|
182
|
-
readonly inputResults?: readonly RuntimeInputResult[];
|
|
183
|
-
readonly message?: string;
|
|
184
|
-
};
|
|
251
|
+
readonly payload: DeliverPayload;
|
|
185
252
|
}
|
|
186
253
|
/**
|
|
187
254
|
* Terminal outcome of a runtime turn, resolved via `RunHandle.result`.
|
|
@@ -206,14 +273,14 @@ export interface RunHandle {
|
|
|
206
273
|
readonly sessionId: string;
|
|
207
274
|
}
|
|
208
275
|
/**
|
|
209
|
-
* Runtime interface consumed by
|
|
276
|
+
* Runtime interface consumed by routes and the subagent tool wrapper.
|
|
210
277
|
*
|
|
211
278
|
* The runtime owns the compiled-bundle source and an optional node
|
|
212
279
|
* selector (both passed at construction time). It is the only place
|
|
213
280
|
* that knows how to load the compiled bundle, build a fully-seeded
|
|
214
281
|
* {@link AshContext}, and drive the step loop.
|
|
215
282
|
*
|
|
216
|
-
*
|
|
283
|
+
* Routes construct a root runtime (no node selector) and call
|
|
217
284
|
* `runtime.run(input)` with flat platform-shape input. The subagent
|
|
218
285
|
* tool wrapper creates a child runtime pre-configured for the target
|
|
219
286
|
* node via the `createChildRuntime` factory, then calls
|
|
@@ -233,19 +300,19 @@ export interface Runtime {
|
|
|
233
300
|
*/
|
|
234
301
|
deliver(input: DeliverInput): Promise<void>;
|
|
235
302
|
/**
|
|
236
|
-
* Returns a readable stream of lifecycle events for an existing
|
|
303
|
+
* Returns a readable stream of lifecycle events for an existing session.
|
|
237
304
|
*
|
|
238
|
-
* Used by the framework's HTTP
|
|
239
|
-
*
|
|
240
|
-
* workflow API's per-
|
|
305
|
+
* Used by the framework's HTTP session-stream route and any
|
|
306
|
+
* user-authored route that exposes an event-streaming endpoint.
|
|
307
|
+
* Backed by the workflow API's per-session durable stream.
|
|
241
308
|
*
|
|
242
|
-
* `options.startIndex` selects the zero-based position of the first
|
|
243
|
-
* to yield, dropping any earlier events. The framework HTTP
|
|
244
|
-
*
|
|
245
|
-
* reconnecting client can resume after the
|
|
246
|
-
* consumed without replaying the prior turn.
|
|
309
|
+
* `options.startIndex` selects the zero-based position of the first
|
|
310
|
+
* event to yield, dropping any earlier events. The framework HTTP
|
|
311
|
+
* session-stream route forwards the value from the `startIndex`
|
|
312
|
+
* query parameter so a reconnecting client can resume after the
|
|
313
|
+
* events it has already consumed without replaying the prior turn.
|
|
247
314
|
*/
|
|
248
|
-
getEventStream(
|
|
315
|
+
getEventStream(sessionId: string, options?: GetEventStreamOptions): Promise<ReadableStream<HandleMessageStreamEvent>>;
|
|
249
316
|
}
|
|
250
317
|
/**
|
|
251
318
|
* Options accepted by {@link Runtime.getEventStream}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channel/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Global symbol brand used to recognize Ash channel classes across
|
|
3
|
+
* independently-loaded copies of the package during compile/runtime tests.
|
|
4
|
+
*/
|
|
5
|
+
export const CHANNEL_CLASS_BRAND = Symbol.for("ash.channel.class");
|
|
6
|
+
export const CHANNEL_PROTOTYPE_BRAND = Symbol.for("ash.channel.prototype");
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Channel
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
/**
|
|
11
|
+
* Serializable conduit that owns the full lifecycle of one platform
|
|
12
|
+
* integration.
|
|
13
|
+
*
|
|
14
|
+
* A channel carries auth, renders outbound events to the platform,
|
|
15
|
+
* transforms inbound deliver payloads, and optionally sets custom
|
|
16
|
+
* context keys. It is serialized across workflow step boundaries via
|
|
17
|
+
* {@link serialize} plus constructor-based rehydration performed by the
|
|
18
|
+
* runtime-owned channel registry.
|
|
19
|
+
*
|
|
20
|
+
* Channels are class-based durable values. Authors define a concrete
|
|
21
|
+
* subclass, declare a unique static `kind`, and pass an instance on
|
|
22
|
+
* {@link RunInput.channel}. The runtime invokes {@link onEvent} /
|
|
23
|
+
* {@link onDeliver} during the step loop. Auth is separate from the
|
|
24
|
+
* channel — it lives on {@link RunInput.auth} and
|
|
25
|
+
* {@link DeliverInput.auth}.
|
|
26
|
+
*/
|
|
27
|
+
export class Channel {
|
|
28
|
+
/**
|
|
29
|
+
* Runtime marker inherited by every channel subclass constructor.
|
|
30
|
+
* Used by route-definition validation without relying on `instanceof`
|
|
31
|
+
* across multiple loaded copies of the package.
|
|
32
|
+
*/
|
|
33
|
+
static [CHANNEL_CLASS_BRAND] = true;
|
|
34
|
+
/**
|
|
35
|
+
* Runtime marker inherited by every channel subclass prototype.
|
|
36
|
+
* Route-definition validation reads this through the subclass prototype
|
|
37
|
+
* chain so authored channels from another loaded package copy still
|
|
38
|
+
* register correctly.
|
|
39
|
+
*/
|
|
40
|
+
get [CHANNEL_PROTOTYPE_BRAND]() {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Nominal marker that prevents plain object literals from satisfying
|
|
45
|
+
* the channel contract. Durable channels must be real class instances.
|
|
46
|
+
*/
|
|
47
|
+
__channelBrand;
|
|
48
|
+
/**
|
|
49
|
+
* Stable identifier for this channel instance, derived from the
|
|
50
|
+
* subclass's static {@link ChannelClass.kind} field.
|
|
51
|
+
*/
|
|
52
|
+
get kind() {
|
|
53
|
+
return getChannelClassKind(this.constructor);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns the static durable kind for a channel class.
|
|
58
|
+
*/
|
|
59
|
+
export function getChannelClassKind(channelClass) {
|
|
60
|
+
if (typeof channelClass.kind !== "string" || channelClass.kind.length === 0) {
|
|
61
|
+
throw new TypeError("Channel classes must declare a non-empty static `kind` field.");
|
|
62
|
+
}
|
|
63
|
+
return channelClass.kind;
|
|
64
|
+
}
|
|
2
65
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/channel/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/channel/types.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAuG3E,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAgB,OAAO;IAC3B;;;;OAIG;IACH,MAAM,CAAU,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,IAAc,CAAC,uBAAuB,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD;;;OAGG;IACgB,cAAc,CAAa;IAE9C;;;OAGG;IACH,IAAI,IAAI;QACN,OAAO,mBAAmB,CAAC,IAAI,CAAC,WAA2B,CAAC,CAAC;IAC/D,CAAC;;AAqDH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAA0B;IAC5D,IAAI,OAAO,YAAY,CAAC,IAAI,KAAK,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,SAAS,CAAC,+DAA+D,CAAC,CAAC;IACvF,CAAC;IAED,OAAO,YAAY,CAAC,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HandleMessageStreamEvent } from "../../protocol/message.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { InputRequest, InputResponse } from "../../runtime/input/types.js";
|
|
3
3
|
import { type CliTheme } from "../ui/output.js";
|
|
4
4
|
/**
|
|
5
5
|
* Sentinel returned when the CLI user pressed Escape while responding to a
|
|
@@ -15,7 +15,7 @@ export type RuntimeInputPromptValue = string | typeof ESCAPED_RUNTIME_INPUT_PROM
|
|
|
15
15
|
* Outcome of one interactive CLI prompt pass for pending runtime input.
|
|
16
16
|
*/
|
|
17
17
|
export type RuntimeInputPromptResult = {
|
|
18
|
-
readonly
|
|
18
|
+
readonly inputResponses: readonly InputResponse[];
|
|
19
19
|
readonly kind: "submitted";
|
|
20
20
|
} | {
|
|
21
21
|
readonly kind: "deferred";
|
|
@@ -25,7 +25,7 @@ export type RuntimeInputPromptResult = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Returns the last pending runtime-input batch emitted in one turn, if any.
|
|
27
27
|
*/
|
|
28
|
-
export declare function extractPendingRuntimeInputRequests(events: readonly HandleMessageStreamEvent[]): readonly
|
|
28
|
+
export declare function extractPendingRuntimeInputRequests(events: readonly HandleMessageStreamEvent[]): readonly InputRequest[];
|
|
29
29
|
/**
|
|
30
30
|
* Interactively collects CLI-native responses for pending runtime input
|
|
31
31
|
* requests.
|
|
@@ -33,7 +33,7 @@ export declare function extractPendingRuntimeInputRequests(events: readonly Hand
|
|
|
33
33
|
export declare function promptForRuntimeInputRequests(input: {
|
|
34
34
|
ask(prompt: string): Promise<RuntimeInputPromptValue>;
|
|
35
35
|
print(message: string): void;
|
|
36
|
-
requests: readonly
|
|
36
|
+
requests: readonly InputRequest[];
|
|
37
37
|
theme: CliTheme;
|
|
38
38
|
}): Promise<RuntimeInputPromptResult>;
|
|
39
39
|
//# sourceMappingURL=input-requests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-requests.d.ts","sourceRoot":"","sources":["../../../../src/cli/dev/input-requests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-requests.d.ts","sourceRoot":"","sources":["../../../../src/cli/dev/input-requests.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAuB,MAAM,iBAAiB,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,eAA0C,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,OAAO,4BAA4B,GAAG,SAAS,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC;IACE,QAAQ,CAAC,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEN;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,SAAS,wBAAwB,EAAE,GAC1C,SAAS,YAAY,EAAE,CAUzB;AAED;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,KAAK,EAAE;IACzD,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtD,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,KAAK,EAAE,QAAQ,CAAC;CACjB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA8BpC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveTextToResponse } from "../../channel/resolve-text.js";
|
|
1
2
|
import { renderCliTaggedLine } from "../ui/output.js";
|
|
2
3
|
/**
|
|
3
4
|
* Sentinel returned when the CLI user pressed Escape while responding to a
|
|
@@ -21,7 +22,7 @@ export function extractPendingRuntimeInputRequests(events) {
|
|
|
21
22
|
* requests.
|
|
22
23
|
*/
|
|
23
24
|
export async function promptForRuntimeInputRequests(input) {
|
|
24
|
-
const
|
|
25
|
+
const responses = [];
|
|
25
26
|
input.print(renderCliTaggedLine(input.theme, {
|
|
26
27
|
message: `pending input request${input.requests.length === 1 ? "" : "s"}: reply now, press Escape, or type "skip" to return to the normal prompt`,
|
|
27
28
|
tag: "input",
|
|
@@ -37,34 +38,38 @@ export async function promptForRuntimeInputRequests(input) {
|
|
|
37
38
|
if (result.kind !== "submitted") {
|
|
38
39
|
return result;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
responses.push(result.inputResponse);
|
|
41
42
|
}
|
|
42
43
|
return {
|
|
43
|
-
|
|
44
|
+
inputResponses: responses,
|
|
44
45
|
kind: "submitted",
|
|
45
46
|
};
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Returns true when the request represents a tool approval (confirmation).
|
|
50
|
+
*/
|
|
51
|
+
function isApprovalRequest(request) {
|
|
52
|
+
return request.display === "confirmation";
|
|
53
|
+
}
|
|
47
54
|
async function promptForRuntimeInputRequest(input) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
case "tool-approval":
|
|
57
|
-
return await promptForToolApprovalInputRequest({
|
|
58
|
-
ask: input.ask,
|
|
59
|
-
print: input.print,
|
|
60
|
-
request: input.request,
|
|
61
|
-
theme: input.theme,
|
|
62
|
-
});
|
|
55
|
+
if (isApprovalRequest(input.request)) {
|
|
56
|
+
return await promptForApprovalInputRequest({
|
|
57
|
+
ask: input.ask,
|
|
58
|
+
print: input.print,
|
|
59
|
+
request: input.request,
|
|
60
|
+
theme: input.theme,
|
|
61
|
+
});
|
|
63
62
|
}
|
|
63
|
+
return await promptForQuestionInputRequest({
|
|
64
|
+
ask: input.ask,
|
|
65
|
+
print: input.print,
|
|
66
|
+
request: input.request,
|
|
67
|
+
theme: input.theme,
|
|
68
|
+
});
|
|
64
69
|
}
|
|
65
|
-
async function
|
|
70
|
+
async function promptForApprovalInputRequest(input) {
|
|
66
71
|
input.print(renderCliTaggedLine(input.theme, {
|
|
67
|
-
message: `approve tool "${input.request.toolName}"
|
|
72
|
+
message: `approve tool "${input.request.action.toolName}"? (yes/no)`,
|
|
68
73
|
tag: "approval",
|
|
69
74
|
tone: "warning",
|
|
70
75
|
}));
|
|
@@ -90,20 +95,18 @@ async function promptForToolApprovalInputRequest(input) {
|
|
|
90
95
|
normalized === "y" ||
|
|
91
96
|
normalized === "yes") {
|
|
92
97
|
return {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
kind: "tool-approval-result",
|
|
98
|
+
inputResponse: {
|
|
99
|
+
optionId: "approve",
|
|
100
|
+
requestId: input.request.requestId,
|
|
97
101
|
},
|
|
98
102
|
kind: "submitted",
|
|
99
103
|
};
|
|
100
104
|
}
|
|
101
105
|
if (normalized === "d" || normalized === "deny" || normalized === "n" || normalized === "no") {
|
|
102
106
|
return {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
kind: "tool-approval-result",
|
|
107
|
+
inputResponse: {
|
|
108
|
+
optionId: "deny",
|
|
109
|
+
requestId: input.request.requestId,
|
|
107
110
|
},
|
|
108
111
|
kind: "submitted",
|
|
109
112
|
};
|
|
@@ -141,33 +144,10 @@ async function promptForQuestionInputRequest(input) {
|
|
|
141
144
|
if (trimmedValue === "skip" || trimmedValue === "/skip") {
|
|
142
145
|
return { kind: "deferred" };
|
|
143
146
|
}
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
value: trimmedValue,
|
|
147
|
-
});
|
|
148
|
-
if (selectedOption !== undefined) {
|
|
147
|
+
const response = resolveTextToResponse(trimmedValue, input.request);
|
|
148
|
+
if (response !== undefined) {
|
|
149
149
|
return {
|
|
150
|
-
|
|
151
|
-
callId: input.request.action.callId,
|
|
152
|
-
kind: "question-result",
|
|
153
|
-
output: {
|
|
154
|
-
optionId: selectedOption.id,
|
|
155
|
-
status: "answered",
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
kind: "submitted",
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
if (acceptsFreeform && trimmedValue.length > 0) {
|
|
162
|
-
return {
|
|
163
|
-
inputResult: {
|
|
164
|
-
callId: input.request.action.callId,
|
|
165
|
-
kind: "question-result",
|
|
166
|
-
output: {
|
|
167
|
-
status: "answered",
|
|
168
|
-
text: trimmedValue,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
150
|
+
inputResponse: response,
|
|
171
151
|
kind: "submitted",
|
|
172
152
|
};
|
|
173
153
|
}
|
|
@@ -182,15 +162,4 @@ async function promptForQuestionInputRequest(input) {
|
|
|
182
162
|
}));
|
|
183
163
|
}
|
|
184
164
|
}
|
|
185
|
-
function resolveQuestionOption(input) {
|
|
186
|
-
if (input.options === undefined || input.options.length === 0) {
|
|
187
|
-
return undefined;
|
|
188
|
-
}
|
|
189
|
-
const numericIndex = Number(input.value);
|
|
190
|
-
if (Number.isInteger(numericIndex) && numericIndex > 0) {
|
|
191
|
-
return input.options[numericIndex - 1];
|
|
192
|
-
}
|
|
193
|
-
const normalizedValue = input.value.toLowerCase();
|
|
194
|
-
return input.options.find((option) => option.id.toLowerCase() === normalizedValue || option.label.toLowerCase() === normalizedValue);
|
|
195
|
-
}
|
|
196
165
|
//# sourceMappingURL=input-requests.js.map
|