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,33 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Framework-shipped HTTP
|
|
2
|
+
* Framework-shipped HTTP route factories.
|
|
3
3
|
*
|
|
4
|
-
* `
|
|
5
|
-
* HTTP entry point for starting and resuming agent
|
|
4
|
+
* `httpRoute()` returns the inbound message route — the public
|
|
5
|
+
* HTTP entry point for starting and resuming agent sessions. Authored at the
|
|
6
6
|
* logical filesystem path `agent/channels/.well-known/ash/v1/message.ts`,
|
|
7
7
|
* mounted at `POST /.well-known/ash/v1/message`.
|
|
8
8
|
*
|
|
9
|
-
* `
|
|
9
|
+
* `httpRunStreamRoute()` returns the outbound event stream route.
|
|
10
10
|
* Authored at the logical filesystem path
|
|
11
|
-
* `agent/channels/.well-known/ash/v1/
|
|
12
|
-
* `GET /.well-known/ash/v1/
|
|
11
|
+
* `agent/channels/.well-known/ash/v1/sessions/[sessionId]/stream.ts`, mounted at
|
|
12
|
+
* `GET /.well-known/ash/v1/sessions/:sessionId/stream`. Reads session events from the
|
|
13
13
|
* agent via {@link Agent.getEventStream}.
|
|
14
14
|
*
|
|
15
|
-
* Both
|
|
15
|
+
* Both routes are mounted automatically by the framework at their logical
|
|
16
16
|
* paths unless the user authors a file at the same path (override) or
|
|
17
|
-
* exports `
|
|
17
|
+
* exports `disableRoute()` from such a file (disable).
|
|
18
18
|
*
|
|
19
|
-
* Both factories require an `auth` argument — see {@link
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* Both factories require an `auth` argument — see {@link HttpRouteInput}
|
|
20
|
+
* and {@link HttpRunStreamRouteInput}.
|
|
21
|
+
* The common case is `httpRoute({ auth: vercelOidc() })`. Open
|
|
22
|
+
* routes are an explicit choice via `httpRoute({ auth: none() })`.
|
|
22
23
|
*/
|
|
23
|
-
import {
|
|
24
|
-
import { ASH_MESSAGE_STREAM_CONTENT_TYPE, ASH_MESSAGE_STREAM_FORMAT, ASH_MESSAGE_STREAM_VERSION,
|
|
24
|
+
import { HttpChannel } from "../../channel/http-channel.js";
|
|
25
|
+
import { ASH_MESSAGE_STREAM_CONTENT_TYPE, ASH_MESSAGE_STREAM_FORMAT, ASH_MESSAGE_STREAM_VERSION, ASH_SESSION_ID_HEADER, ASH_STREAM_FORMAT_HEADER, ASH_STREAM_VERSION_HEADER, } from "../../protocol/message.js";
|
|
25
26
|
import { createAshMessageStreamRoutePath } from "../../protocol/routes.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { createUnauthorizedResponse
|
|
27
|
+
import { isInputResponse } from "../../runtime/input/types.js";
|
|
28
|
+
import { defineRoute } from "../definitions/channel.js";
|
|
29
|
+
import { createUnauthorizedResponse } from "./auth.js";
|
|
30
|
+
export { HttpChannel };
|
|
29
31
|
/**
|
|
30
|
-
* Returns the framework-shipped HTTP message
|
|
32
|
+
* Returns the framework-shipped HTTP message route.
|
|
31
33
|
*
|
|
32
34
|
* Accepts JSON bodies of the form:
|
|
33
35
|
* ```json
|
|
@@ -35,23 +37,32 @@ import { createUnauthorizedResponse, withAuth } from "./auth.js";
|
|
|
35
37
|
* { "continuationToken": "...", "message": "..." } // resume an existing session
|
|
36
38
|
* ```
|
|
37
39
|
*
|
|
38
|
-
* Responds with `202 Accepted` on a new session, including the
|
|
39
|
-
* the `x-ash-
|
|
40
|
+
* Responds with `202 Accepted` on a new session, including the session id in
|
|
41
|
+
* the `x-ash-session-id` header and the stream URL in the `Location` header.
|
|
40
42
|
* Responds with `200 OK` on a successful resume.
|
|
41
43
|
*
|
|
42
44
|
* Inbound auth is mandatory: pass `auth: vercelOidc()` for the standard
|
|
43
45
|
* Vercel deployment, `auth: none()` for an explicit open route, or any
|
|
44
46
|
* other {@link AuthFn} (or hand-written function) for custom verification.
|
|
45
47
|
*/
|
|
46
|
-
export function
|
|
47
|
-
|
|
48
|
+
export function httpRoute(input) {
|
|
49
|
+
if (input.channel !== undefined && !(input.channel.prototype instanceof HttpChannel)) {
|
|
50
|
+
throw new TypeError("httpRoute: `channel` must extend `HttpChannel`.");
|
|
51
|
+
}
|
|
52
|
+
if (input.channel !== undefined &&
|
|
53
|
+
input.channel !== HttpChannel &&
|
|
54
|
+
input.channel.kind === HttpChannel.kind) {
|
|
55
|
+
throw new TypeError('httpRoute: custom channel classes must declare a unique static `kind` instead of inheriting "http".');
|
|
56
|
+
}
|
|
57
|
+
return defineRoute({
|
|
48
58
|
method: "POST",
|
|
59
|
+
serializableChannels: input.channel !== undefined ? [input.channel] : undefined,
|
|
49
60
|
async fetch(request, ctx) {
|
|
50
|
-
const authResult = await
|
|
61
|
+
const authResult = await runRouteAuth(input.auth, request, ctx);
|
|
51
62
|
if (authResult instanceof Response) {
|
|
52
63
|
return authResult;
|
|
53
64
|
}
|
|
54
|
-
const
|
|
65
|
+
const sessionAuth = authResult;
|
|
55
66
|
let payload;
|
|
56
67
|
try {
|
|
57
68
|
payload = await request.json();
|
|
@@ -66,26 +77,27 @@ export function httpMessageChannel(input) {
|
|
|
66
77
|
if (body instanceof Response) {
|
|
67
78
|
return body;
|
|
68
79
|
}
|
|
69
|
-
// Resume an existing session.
|
|
70
|
-
// injected into `ctx.agent` by `runChannelAuth` via `withAuth`, so
|
|
71
|
-
// `agent.deliver` carries it automatically.
|
|
80
|
+
// Resume an existing session. Pass auth directly to deliver.
|
|
72
81
|
if ("continuationToken" in body) {
|
|
73
82
|
const continuationToken = body.continuationToken;
|
|
74
|
-
await agent.deliver({
|
|
83
|
+
await ctx.agent.deliver({
|
|
84
|
+
auth: sessionAuth,
|
|
75
85
|
continuationToken,
|
|
76
86
|
payload: {
|
|
77
|
-
|
|
87
|
+
inputResponses: "inputResponses" in body ? body.inputResponses : undefined,
|
|
78
88
|
message: "message" in body ? body.message : undefined,
|
|
79
89
|
},
|
|
80
90
|
});
|
|
81
91
|
return Response.json({ continuationToken, ok: true }, { headers: { "cache-control": "no-store" }, status: 200 });
|
|
82
92
|
}
|
|
83
|
-
// Start a new session. The HTTP
|
|
84
|
-
// because outbound delivery happens via the
|
|
93
|
+
// Start a new session. The HTTP route uses a passthrough channel
|
|
94
|
+
// because outbound delivery happens via the session-stream route, not
|
|
85
95
|
// via an external API call.
|
|
86
96
|
const continuationToken = `http:${crypto.randomUUID()}`;
|
|
87
|
-
const
|
|
88
|
-
|
|
97
|
+
const channelClass = input.channel ?? HttpChannel;
|
|
98
|
+
const handle = await ctx.agent.run({
|
|
99
|
+
auth: sessionAuth,
|
|
100
|
+
channel: new channelClass({}),
|
|
89
101
|
continuationToken,
|
|
90
102
|
input: { message: body.message },
|
|
91
103
|
mode: "conversation",
|
|
@@ -99,7 +111,7 @@ export function httpMessageChannel(input) {
|
|
|
99
111
|
headers: {
|
|
100
112
|
"cache-control": "no-store",
|
|
101
113
|
location: createAshMessageStreamRoutePath(handle.sessionId),
|
|
102
|
-
[
|
|
114
|
+
[ASH_SESSION_ID_HEADER]: handle.sessionId,
|
|
103
115
|
},
|
|
104
116
|
status: 202,
|
|
105
117
|
});
|
|
@@ -111,31 +123,31 @@ function parseHandleMessageRequestBody(payload) {
|
|
|
111
123
|
? payload.continuationToken
|
|
112
124
|
: undefined;
|
|
113
125
|
const message = typeof payload.message === "string" && payload.message.length > 0 ? payload.message : undefined;
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
126
|
+
const inputResponses = parseInputResponses(payload.inputResponses);
|
|
127
|
+
if (inputResponses instanceof Response) {
|
|
128
|
+
return inputResponses;
|
|
117
129
|
}
|
|
118
130
|
if (continuationToken === undefined) {
|
|
119
131
|
if (message === undefined) {
|
|
120
132
|
return Response.json({ error: "Missing or empty 'message' field.", ok: false }, { status: 400 });
|
|
121
133
|
}
|
|
122
|
-
if (
|
|
123
|
-
return Response.json({ error: "'
|
|
134
|
+
if (inputResponses !== undefined) {
|
|
135
|
+
return Response.json({ error: "'inputResponses' may only be used with 'continuationToken'.", ok: false }, { status: 400 });
|
|
124
136
|
}
|
|
125
137
|
return {
|
|
126
138
|
message,
|
|
127
139
|
};
|
|
128
140
|
}
|
|
129
|
-
if (message === undefined &&
|
|
141
|
+
if (message === undefined && inputResponses === undefined) {
|
|
130
142
|
return Response.json({
|
|
131
|
-
error: "Expected a non-empty 'message', a non-empty '
|
|
143
|
+
error: "Expected a non-empty 'message', a non-empty 'inputResponses' array, or both.",
|
|
132
144
|
ok: false,
|
|
133
145
|
}, { status: 400 });
|
|
134
146
|
}
|
|
135
|
-
if (message !== undefined &&
|
|
147
|
+
if (message !== undefined && inputResponses !== undefined) {
|
|
136
148
|
return {
|
|
137
149
|
continuationToken,
|
|
138
|
-
|
|
150
|
+
inputResponses,
|
|
139
151
|
message,
|
|
140
152
|
};
|
|
141
153
|
}
|
|
@@ -147,57 +159,59 @@ function parseHandleMessageRequestBody(payload) {
|
|
|
147
159
|
}
|
|
148
160
|
return {
|
|
149
161
|
continuationToken,
|
|
150
|
-
|
|
162
|
+
inputResponses: inputResponses ?? [],
|
|
151
163
|
};
|
|
152
164
|
}
|
|
153
|
-
function
|
|
165
|
+
function parseInputResponses(value) {
|
|
154
166
|
if (value === undefined) {
|
|
155
167
|
return undefined;
|
|
156
168
|
}
|
|
157
169
|
if (!Array.isArray(value) || value.length === 0) {
|
|
158
|
-
return Response.json({ error: "Expected '
|
|
170
|
+
return Response.json({ error: "Expected 'inputResponses' to be a non-empty array.", ok: false }, { status: 400 });
|
|
159
171
|
}
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
return Response.json({
|
|
172
|
+
const inputResponses = value.filter(isInputResponse);
|
|
173
|
+
if (inputResponses.length !== value.length) {
|
|
174
|
+
return Response.json({
|
|
175
|
+
error: "Expected every 'inputResponses' entry to match the HITL response schema.",
|
|
176
|
+
ok: false,
|
|
177
|
+
}, { status: 400 });
|
|
163
178
|
}
|
|
164
|
-
return
|
|
179
|
+
return inputResponses;
|
|
165
180
|
}
|
|
166
181
|
/**
|
|
167
|
-
* Returns the framework-shipped HTTP
|
|
182
|
+
* Returns the framework-shipped HTTP session-stream route.
|
|
168
183
|
*
|
|
169
|
-
* Reads `
|
|
170
|
-
* `
|
|
171
|
-
* body is the durable workflow event stream for that
|
|
184
|
+
* Reads `sessionId` from the path parameter (filesystem path
|
|
185
|
+
* `sessions/[sessionId]/stream`) and returns a long-lived NDJSON `Response`
|
|
186
|
+
* whose body is the durable workflow event stream for that session.
|
|
172
187
|
*
|
|
173
188
|
* Honors a `startIndex` query parameter so a reconnecting or resuming
|
|
174
|
-
* client can skip events it already consumed for the current
|
|
189
|
+
* client can skip events it already consumed for the current session. Without
|
|
175
190
|
* this, follow-up turns would replay every event from the start of the
|
|
176
|
-
*
|
|
191
|
+
* session and the dev REPL would render the previous turn over and over.
|
|
177
192
|
*
|
|
178
193
|
* Inbound auth is mandatory: pass `auth: vercelOidc()` for the standard
|
|
179
194
|
* Vercel deployment, `auth: none()` for an explicit open route, or any
|
|
180
195
|
* other {@link AuthFn} for custom verification.
|
|
181
196
|
*/
|
|
182
|
-
export function
|
|
183
|
-
return
|
|
197
|
+
export function httpRunStreamRoute(input) {
|
|
198
|
+
return defineRoute({
|
|
184
199
|
method: "GET",
|
|
185
200
|
async fetch(request, ctx) {
|
|
186
|
-
const authResult = await
|
|
201
|
+
const authResult = await runRouteAuth(input.auth, request, ctx);
|
|
187
202
|
if (authResult instanceof Response) {
|
|
188
203
|
return authResult;
|
|
189
204
|
}
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return Response.json({ error: "Missing run id.", ok: false }, { status: 400 });
|
|
205
|
+
const sessionId = ctx.params.sessionId;
|
|
206
|
+
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
207
|
+
return Response.json({ error: "Missing session id.", ok: false }, { status: 400 });
|
|
194
208
|
}
|
|
195
209
|
const startIndex = parseRunStreamStartIndex(request);
|
|
196
210
|
if (startIndex instanceof Response) {
|
|
197
211
|
return startIndex;
|
|
198
212
|
}
|
|
199
213
|
try {
|
|
200
|
-
const events = await agent.getEventStream(
|
|
214
|
+
const events = await ctx.agent.getEventStream(sessionId, { startIndex });
|
|
201
215
|
// The runtime returns a parsed event stream; re-serialize each event
|
|
202
216
|
// back to NDJSON bytes for the wire protocol.
|
|
203
217
|
const ndjson = serializeEventStreamAsNdjson(events);
|
|
@@ -205,28 +219,28 @@ export function httpRunStreamChannel(input) {
|
|
|
205
219
|
headers: {
|
|
206
220
|
"cache-control": "no-store",
|
|
207
221
|
"content-type": ASH_MESSAGE_STREAM_CONTENT_TYPE,
|
|
208
|
-
[
|
|
222
|
+
[ASH_SESSION_ID_HEADER]: sessionId,
|
|
209
223
|
[ASH_STREAM_FORMAT_HEADER]: ASH_MESSAGE_STREAM_FORMAT,
|
|
210
224
|
[ASH_STREAM_VERSION_HEADER]: ASH_MESSAGE_STREAM_VERSION,
|
|
211
225
|
},
|
|
212
226
|
});
|
|
213
227
|
}
|
|
214
228
|
catch {
|
|
215
|
-
return Response.json({ error: "
|
|
229
|
+
return Response.json({ error: "Session not found.", ok: false }, { status: 404 });
|
|
216
230
|
}
|
|
217
231
|
},
|
|
218
232
|
});
|
|
219
233
|
}
|
|
220
234
|
/**
|
|
221
|
-
* Runs the
|
|
222
|
-
* {@link
|
|
235
|
+
* Runs the route-level {@link AuthFn} and returns either the resolved
|
|
236
|
+
* {@link SessionAuthContext} (or `null` for anonymous), or a `Response`
|
|
223
237
|
* the caller should return verbatim (a 401 on rejection).
|
|
224
238
|
*
|
|
225
|
-
* Encapsulates the verify → 401
|
|
226
|
-
*
|
|
227
|
-
*
|
|
239
|
+
* Encapsulates the verify → 401 flow shared by every framework-shipped
|
|
240
|
+
* HTTP route factory so each factory body stays focused on its own
|
|
241
|
+
* request shape and dispatch logic.
|
|
228
242
|
*/
|
|
229
|
-
async function
|
|
243
|
+
async function runRouteAuth(auth, request, _ctx) {
|
|
230
244
|
const result = await auth(request);
|
|
231
245
|
if (result === null) {
|
|
232
246
|
return createUnauthorizedResponse({
|
|
@@ -234,15 +248,11 @@ async function runChannelAuth(auth, request, ctx) {
|
|
|
234
248
|
});
|
|
235
249
|
}
|
|
236
250
|
// result is either a SessionAuthContext (authenticated) or undefined
|
|
237
|
-
// (anonymous, allowed through).
|
|
238
|
-
|
|
239
|
-
// verified principal (or explicit null) without the inner factory body
|
|
240
|
-
// having to know which path ran.
|
|
241
|
-
const sessionAuth = result ?? null;
|
|
242
|
-
return withAuth(ctx, sessionAuth);
|
|
251
|
+
// (anonymous, allowed through).
|
|
252
|
+
return result ?? null;
|
|
243
253
|
}
|
|
244
254
|
/**
|
|
245
|
-
* Parses the `startIndex` query parameter on a
|
|
255
|
+
* Parses the `startIndex` query parameter on a session-stream request.
|
|
246
256
|
*
|
|
247
257
|
* Returns the parsed value (or `undefined` when absent), or a `400`
|
|
248
258
|
* response when the value is not a non-negative integer. The framework
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../../src/public/channels/http.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../../src/public/channels/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAyB,MAAM,+BAA+B,CAAC;AAEnF,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAsB,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAiC,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAe,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAGpE,OAAO,EAAE,WAAW,EAAE,CAAC;AAyDvB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,CA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Aa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,IAAI,CAClB,EAAE,KAAK,EAAE,mDAAmD,EAAE,EAAE,EAAE,KAAK,EAAE,EACzE,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAS,4BAA4B,CAAC,MAA+B;IACnE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC,WAAW,CACvB,IAAI,eAAe,CAAsB;QACvC,SAAS,CAAC,KAAK,EAAE,UAAU;YACzB,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACnE,CAAC;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Route authoring helpers used inside `agent/channels/*.ts` files.
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
4
|
+
* A route is a Web-standard `(Request, ctx) => Response` handler whose
|
|
5
5
|
* URL path is derived from the file's location under `agent/channels/`.
|
|
6
|
-
* The framework mounts each authored
|
|
6
|
+
* The framework mounts each authored route as its own Nitro route.
|
|
7
7
|
*
|
|
8
8
|
* Filename is identity. `agent/channels/slack.ts` mounts at `POST /slack`.
|
|
9
9
|
* Nested directories produce nested URL segments
|
|
10
10
|
* (`agent/channels/api/inbound.ts` → `POST /api/inbound`). Path parameters
|
|
11
11
|
* use the Nitro `[name]` convention
|
|
12
|
-
* (`agent/channels/
|
|
12
|
+
* (`agent/channels/sessions/[sessionId]/stream.ts` → `GET /sessions/:sessionId/stream`).
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
16
|
* // agent/channels/slack.ts → POST /slack
|
|
17
|
-
* import {
|
|
17
|
+
* import { defineRoute } from "experimental-ash/channels";
|
|
18
18
|
*
|
|
19
|
-
* export default
|
|
20
|
-
* async fetch(request, {
|
|
19
|
+
* export default defineRoute({
|
|
20
|
+
* async fetch(request, { agent, waitUntil }) {
|
|
21
21
|
* // ...
|
|
22
22
|
* return new Response("ok");
|
|
23
23
|
* },
|
|
24
24
|
* });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
export {
|
|
28
|
-
export type
|
|
29
|
-
export { type Agent, type Channel, type ChannelContext, type ChannelMethod, type DisabledChannelSentinel, defineChannel, disableChannel, isChannelDefinition, isDisabledChannelSentinel, } from "../definitions/channel.js";
|
|
27
|
+
export { Channel, type ChannelClass, type EventEmitFn, } from "../../channel/types.js";
|
|
28
|
+
export { type Agent, type ChannelMethod, type DisabledRouteSentinel, defineRoute, disableRoute, isDisabledRouteSentinel, isRouteDefinition, type Route, type RouteContext, } from "../definitions/channel.js";
|
|
30
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/channels/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/channels/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,KAAK,EACV,KAAK,YAAY,GAClB,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Route authoring helpers used inside `agent/channels/*.ts` files.
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
4
|
+
* A route is a Web-standard `(Request, ctx) => Response` handler whose
|
|
5
5
|
* URL path is derived from the file's location under `agent/channels/`.
|
|
6
|
-
* The framework mounts each authored
|
|
6
|
+
* The framework mounts each authored route as its own Nitro route.
|
|
7
7
|
*
|
|
8
8
|
* Filename is identity. `agent/channels/slack.ts` mounts at `POST /slack`.
|
|
9
9
|
* Nested directories produce nested URL segments
|
|
10
10
|
* (`agent/channels/api/inbound.ts` → `POST /api/inbound`). Path parameters
|
|
11
11
|
* use the Nitro `[name]` convention
|
|
12
|
-
* (`agent/channels/
|
|
12
|
+
* (`agent/channels/sessions/[sessionId]/stream.ts` → `GET /sessions/:sessionId/stream`).
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
16
|
* // agent/channels/slack.ts → POST /slack
|
|
17
|
-
* import {
|
|
17
|
+
* import { defineRoute } from "experimental-ash/channels";
|
|
18
18
|
*
|
|
19
|
-
* export default
|
|
20
|
-
* async fetch(request, {
|
|
19
|
+
* export default defineRoute({
|
|
20
|
+
* async fetch(request, { agent, waitUntil }) {
|
|
21
21
|
* // ...
|
|
22
22
|
* return new Response("ok");
|
|
23
23
|
* },
|
|
24
24
|
* });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
27
|
+
export { Channel, } from "../../channel/types.js";
|
|
28
|
+
export { defineRoute, disableRoute, isDisabledRouteSentinel, isRouteDefinition, } from "../definitions/channel.js";
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/channels/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/channels/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,OAAO,GAGR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,GAGlB,MAAM,2BAA2B,CAAC"}
|