experimental-ash 0.2.0-alpha.2 → 0.2.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/channel/http-channel.d.ts +26 -0
- package/dist/src/channel/http-channel.d.ts.map +1 -0
- package/dist/src/channel/http-channel.js +24 -0
- package/dist/src/channel/http-channel.js.map +1 -0
- package/dist/src/channel/resolve-text.d.ts +20 -0
- package/dist/src/channel/resolve-text.d.ts.map +1 -0
- package/dist/src/channel/resolve-text.js +60 -0
- package/dist/src/channel/resolve-text.js.map +1 -0
- package/dist/src/channel/schedule-channel.d.ts +16 -0
- package/dist/src/channel/schedule-channel.d.ts.map +1 -0
- package/dist/src/channel/schedule-channel.js +20 -0
- package/dist/src/channel/schedule-channel.js.map +1 -0
- package/dist/src/channel/schedule.d.ts +4 -6
- package/dist/src/channel/schedule.d.ts.map +1 -1
- package/dist/src/channel/schedule.js +6 -9
- package/dist/src/channel/schedule.js.map +1 -1
- package/dist/src/channel/slack-channel.d.ts +125 -0
- package/dist/src/channel/slack-channel.d.ts.map +1 -0
- package/dist/src/channel/slack-channel.js +320 -0
- package/dist/src/channel/slack-channel.js.map +1 -0
- package/dist/src/channel/subagent-channel.d.ts +41 -0
- package/dist/src/channel/subagent-channel.d.ts.map +1 -0
- package/dist/src/channel/{subagent-emitter.js → subagent-channel.js} +15 -19
- package/dist/src/channel/subagent-channel.js.map +1 -0
- package/dist/src/channel/types.d.ts +157 -90
- package/dist/src/channel/types.d.ts.map +1 -1
- package/dist/src/channel/types.js +64 -1
- package/dist/src/channel/types.js.map +1 -1
- package/dist/src/cli/dev/input-requests.d.ts +4 -4
- package/dist/src/cli/dev/input-requests.d.ts.map +1 -1
- package/dist/src/cli/dev/input-requests.js +34 -65
- package/dist/src/cli/dev/input-requests.js.map +1 -1
- package/dist/src/cli/dev/repl.d.ts.map +1 -1
- package/dist/src/cli/dev/repl.js +41 -24
- package/dist/src/cli/dev/repl.js.map +1 -1
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.d.ts.map +1 -1
- package/dist/src/client/index.js +1 -0
- package/dist/src/client/index.js.map +1 -1
- package/dist/src/client/message-response.d.ts +5 -5
- package/dist/src/client/message-response.d.ts.map +1 -1
- package/dist/src/client/message-response.js +6 -6
- package/dist/src/client/message-response.js.map +1 -1
- package/dist/src/client/open-stream.d.ts +1 -1
- package/dist/src/client/open-stream.d.ts.map +1 -1
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/open-stream.js.map +1 -1
- package/dist/src/client/session-utils.d.ts +3 -3
- package/dist/src/client/session-utils.d.ts.map +1 -1
- package/dist/src/client/session-utils.js +4 -4
- package/dist/src/client/session-utils.js.map +1 -1
- package/dist/src/client/session.d.ts +5 -5
- package/dist/src/client/session.js +28 -28
- package/dist/src/client/session.js.map +1 -1
- package/dist/src/client/types.d.ts +8 -8
- package/dist/src/client/types.d.ts.map +1 -1
- package/dist/src/compiler/channel-url.d.ts +1 -1
- package/dist/src/compiler/channel-url.js +1 -1
- package/dist/src/compiler/manifest.d.ts +38 -5
- package/dist/src/compiler/manifest.d.ts.map +1 -1
- package/dist/src/compiler/manifest.js +15 -1
- package/dist/src/compiler/manifest.js.map +1 -1
- package/dist/src/compiler/module-map.js +8 -0
- package/dist/src/compiler/module-map.js.map +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +1 -1
- package/dist/src/compiler/normalize-channel.js +3 -3
- package/dist/src/compiler/normalize-channel.js.map +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +14 -0
- package/dist/src/compiler/normalize-connection.d.ts.map +1 -0
- package/dist/src/compiler/normalize-connection.js +29 -0
- package/dist/src/compiler/normalize-connection.js.map +1 -0
- package/dist/src/compiler/normalize-manifest.d.ts.map +1 -1
- package/dist/src/compiler/normalize-manifest.js +2 -0
- package/dist/src/compiler/normalize-manifest.js.map +1 -1
- package/dist/src/context/accessors.d.ts +13 -12
- package/dist/src/context/accessors.d.ts.map +1 -1
- package/dist/src/context/accessors.js +16 -17
- package/dist/src/context/accessors.js.map +1 -1
- package/dist/src/context/container.d.ts +17 -19
- package/dist/src/context/container.d.ts.map +1 -1
- package/dist/src/context/container.js +21 -14
- package/dist/src/context/container.js.map +1 -1
- package/dist/src/context/durable-context.d.ts +18 -0
- package/dist/src/context/durable-context.d.ts.map +1 -0
- package/dist/src/context/durable-context.js +49 -0
- package/dist/src/context/durable-context.js.map +1 -0
- package/dist/src/context/key.d.ts +43 -83
- package/dist/src/context/key.d.ts.map +1 -1
- package/dist/src/context/key.js +58 -80
- package/dist/src/context/key.js.map +1 -1
- package/dist/src/context/keys.d.ts +8 -20
- package/dist/src/context/keys.d.ts.map +1 -1
- package/dist/src/context/keys.js +20 -34
- package/dist/src/context/keys.js.map +1 -1
- package/dist/src/context/provider.d.ts +2 -2
- package/dist/src/context/provider.d.ts.map +1 -1
- package/dist/src/context/providers/connection.d.ts +4 -0
- package/dist/src/context/providers/connection.d.ts.map +1 -0
- package/dist/src/context/providers/connection.js +18 -0
- package/dist/src/context/providers/connection.js.map +1 -0
- package/dist/src/context/providers/session.d.ts.map +1 -1
- package/dist/src/context/providers/session.js +1 -2
- package/dist/src/context/providers/session.js.map +1 -1
- package/dist/src/context/providers/skill.d.ts.map +1 -1
- package/dist/src/context/providers/skill.js +2 -15
- package/dist/src/context/providers/skill.js.map +1 -1
- package/dist/src/context/run-step.d.ts +6 -8
- package/dist/src/context/run-step.d.ts.map +1 -1
- package/dist/src/context/run-step.js +15 -17
- package/dist/src/context/run-step.js.map +1 -1
- package/dist/src/context/seed-keys.d.ts +21 -0
- package/dist/src/context/seed-keys.d.ts.map +1 -0
- package/dist/src/context/seed-keys.js +31 -0
- package/dist/src/context/seed-keys.js.map +1 -0
- package/dist/src/context/serialize.d.ts +8 -9
- package/dist/src/context/serialize.d.ts.map +1 -1
- package/dist/src/context/serialize.js +38 -15
- package/dist/src/context/serialize.js.map +1 -1
- package/dist/src/discover/connections.d.ts +48 -0
- package/dist/src/discover/connections.d.ts.map +1 -0
- package/dist/src/discover/connections.js +169 -0
- package/dist/src/discover/connections.js.map +1 -0
- package/dist/src/discover/discover-agent.d.ts +1 -0
- package/dist/src/discover/discover-agent.d.ts.map +1 -1
- package/dist/src/discover/discover-agent.js +8 -0
- package/dist/src/discover/discover-agent.js.map +1 -1
- package/dist/src/discover/discover-subagent.js +7 -0
- package/dist/src/discover/discover-subagent.js.map +1 -1
- package/dist/src/discover/filesystem.d.ts +3 -3
- package/dist/src/discover/filesystem.d.ts.map +1 -1
- package/dist/src/discover/filesystem.js +7 -0
- package/dist/src/discover/filesystem.js.map +1 -1
- package/dist/src/discover/grammar.d.ts +20 -4
- package/dist/src/discover/grammar.d.ts.map +1 -1
- package/dist/src/discover/grammar.js +31 -5
- package/dist/src/discover/grammar.js.map +1 -1
- package/dist/src/discover/manifest.d.ts +28 -1
- package/dist/src/discover/manifest.d.ts.map +1 -1
- package/dist/src/discover/manifest.js +11 -1
- package/dist/src/discover/manifest.js.map +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/artifacts.js.map +1 -1
- package/dist/src/evals/runner/derive-run-facts.js +5 -5
- package/dist/src/evals/runner/derive-run-facts.js.map +1 -1
- package/dist/src/evals/runner/execute-case.js +4 -4
- package/dist/src/evals/runner/execute-case.js.map +1 -1
- package/dist/src/evals/runner/execute-suite.js +1 -1
- package/dist/src/evals/runner/execute-suite.js.map +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +2 -2
- package/dist/src/evals/runner/reporters/braintrust.js.map +1 -1
- package/dist/src/evals/types.d.ts +4 -4
- package/dist/src/evals/types.d.ts.map +1 -1
- package/dist/src/execution/continuous-entry.d.ts +18 -9
- package/dist/src/execution/continuous-entry.d.ts.map +1 -1
- package/dist/src/execution/continuous-entry.js +62 -18
- package/dist/src/execution/continuous-entry.js.map +1 -1
- package/dist/src/execution/continuous-runtime.d.ts +1 -1
- package/dist/src/execution/continuous-runtime.d.ts.map +1 -1
- package/dist/src/execution/continuous-runtime.js +14 -10
- package/dist/src/execution/continuous-runtime.js.map +1 -1
- package/dist/src/execution/node-step.d.ts +1 -2
- package/dist/src/execution/node-step.d.ts.map +1 -1
- package/dist/src/execution/node-step.js +42 -55
- package/dist/src/execution/node-step.js.map +1 -1
- package/dist/src/execution/runtime-context.d.ts +3 -0
- package/dist/src/execution/runtime-context.d.ts.map +1 -1
- package/dist/src/execution/runtime-context.js +6 -4
- package/dist/src/execution/runtime-context.js.map +1 -1
- package/dist/src/execution/session.d.ts +2 -1
- package/dist/src/execution/session.d.ts.map +1 -1
- package/dist/src/execution/session.js +1 -0
- package/dist/src/execution/session.js.map +1 -1
- package/dist/src/execution/skills/access.d.ts.map +1 -1
- package/dist/src/execution/skills/instructions.d.ts +6 -6
- package/dist/src/execution/skills/instructions.d.ts.map +1 -1
- package/dist/src/execution/skills/instructions.js +15 -15
- package/dist/src/execution/skills/instructions.js.map +1 -1
- package/dist/src/execution/skills/types.d.ts +4 -4
- package/dist/src/execution/skills/types.d.ts.map +1 -1
- package/dist/src/execution/step-context.d.ts +27 -0
- package/dist/src/execution/step-context.d.ts.map +1 -0
- package/dist/src/execution/step-context.js +54 -0
- package/dist/src/execution/step-context.js.map +1 -0
- package/dist/src/execution/subagent-tool.d.ts +1 -1
- package/dist/src/execution/subagent-tool.d.ts.map +1 -1
- package/dist/src/execution/subagent-tool.js +3 -4
- package/dist/src/execution/subagent-tool.js.map +1 -1
- package/dist/src/execution/tool-compaction.d.ts +1 -3
- package/dist/src/execution/tool-compaction.d.ts.map +1 -1
- package/dist/src/execution/tool-compaction.js +6 -20
- package/dist/src/execution/tool-compaction.js.map +1 -1
- package/dist/src/execution/types.d.ts +1 -1
- package/dist/src/execution/types.d.ts.map +1 -1
- package/dist/src/execution/workflow-entry.d.ts +4 -5
- package/dist/src/execution/workflow-entry.d.ts.map +1 -1
- package/dist/src/execution/workflow-entry.js +7 -2
- package/dist/src/execution/workflow-entry.js.map +1 -1
- package/dist/src/execution/workflow-runtime.d.ts.map +1 -1
- package/dist/src/execution/workflow-runtime.js +10 -5
- package/dist/src/execution/workflow-runtime.js.map +1 -1
- package/dist/src/execution/workflow-steps.d.ts +13 -6
- package/dist/src/execution/workflow-steps.d.ts.map +1 -1
- package/dist/src/execution/workflow-steps.js +24 -19
- package/dist/src/execution/workflow-steps.js.map +1 -1
- package/dist/src/harness/emission.d.ts +36 -27
- package/dist/src/harness/emission.d.ts.map +1 -1
- package/dist/src/harness/emission.js +130 -84
- package/dist/src/harness/emission.js.map +1 -1
- package/dist/src/harness/execute-tool.d.ts +52 -0
- package/dist/src/harness/execute-tool.d.ts.map +1 -0
- package/dist/src/harness/execute-tool.js +59 -0
- package/dist/src/harness/execute-tool.js.map +1 -0
- package/dist/src/harness/input-extraction.d.ts +3 -3
- package/dist/src/harness/input-extraction.d.ts.map +1 -1
- package/dist/src/harness/input-extraction.js +15 -8
- package/dist/src/harness/input-extraction.js.map +1 -1
- package/dist/src/harness/input-requests.d.ts +46 -40
- package/dist/src/harness/input-requests.d.ts.map +1 -1
- package/dist/src/harness/input-requests.js +169 -245
- package/dist/src/harness/input-requests.js.map +1 -1
- package/dist/src/harness/messages.d.ts +10 -9
- package/dist/src/harness/messages.d.ts.map +1 -1
- package/dist/src/harness/messages.js +23 -20
- package/dist/src/harness/messages.js.map +1 -1
- package/dist/src/harness/provider-tools.d.ts +2 -2
- package/dist/src/harness/provider-tools.d.ts.map +1 -1
- package/dist/src/harness/provider-tools.js +7 -3
- package/dist/src/harness/provider-tools.js.map +1 -1
- package/dist/src/harness/step-hooks.d.ts +77 -0
- package/dist/src/harness/step-hooks.d.ts.map +1 -0
- package/dist/src/harness/step-hooks.js +192 -0
- package/dist/src/harness/step-hooks.js.map +1 -0
- package/dist/src/harness/tool-loop.d.ts +4 -2
- package/dist/src/harness/tool-loop.d.ts.map +1 -1
- package/dist/src/harness/tool-loop.js +130 -181
- package/dist/src/harness/tool-loop.js.map +1 -1
- package/dist/src/harness/tools.d.ts +12 -16
- package/dist/src/harness/tools.d.ts.map +1 -1
- package/dist/src/harness/tools.js +39 -33
- package/dist/src/harness/tools.js.map +1 -1
- package/dist/src/harness/types.d.ts +44 -28
- package/dist/src/harness/types.d.ts.map +1 -1
- package/dist/src/harness/types.js +6 -1
- package/dist/src/harness/types.js.map +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +5 -3
- package/dist/src/internal/application/compiled-artifacts.d.ts.map +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +19 -40
- package/dist/src/internal/application/compiled-artifacts.js.map +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/channel.d.ts +3 -3
- package/dist/src/internal/authored-definition/channel.d.ts.map +1 -1
- package/dist/src/internal/authored-definition/channel.js +28 -4
- package/dist/src/internal/authored-definition/channel.js.map +1 -1
- package/dist/src/internal/authored-definition/connection.d.ts +10 -0
- package/dist/src/internal/authored-definition/connection.d.ts.map +1 -0
- package/dist/src/internal/authored-definition/connection.js +134 -0
- package/dist/src/internal/authored-definition/connection.js.map +1 -0
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/authored-module.js.map +1 -1
- package/dist/src/internal/message/builder.d.ts +1 -2
- package/dist/src/internal/message/builder.d.ts.map +1 -1
- package/dist/src/internal/message/builder.js +4 -12
- package/dist/src/internal/message/builder.js.map +1 -1
- package/dist/src/internal/nitro/host/configure-message-routes.d.ts +3 -1
- package/dist/src/internal/nitro/host/configure-message-routes.d.ts.map +1 -1
- package/dist/src/internal/nitro/host/configure-message-routes.js +124 -25
- package/dist/src/internal/nitro/host/configure-message-routes.js.map +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts.map +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +63 -21
- package/dist/src/internal/nitro/host/create-application-nitro.js.map +1 -1
- package/dist/src/internal/nitro/host/load-home-page-web-assets.d.ts +13 -0
- package/dist/src/internal/nitro/host/load-home-page-web-assets.d.ts.map +1 -0
- package/dist/src/internal/nitro/host/load-home-page-web-assets.js +35 -0
- package/dist/src/internal/nitro/host/load-home-page-web-assets.js.map +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.js.map +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +10 -18
- package/dist/src/internal/nitro/routes/channel-dispatch.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +16 -45
- package/dist/src/internal/nitro/routes/channel-dispatch.js.map +1 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts +88 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js +175 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js.map +1 -0
- package/dist/src/internal/nitro/routes/home.d.ts +7 -0
- package/dist/src/internal/nitro/routes/home.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/home.js +22 -0
- package/dist/src/internal/nitro/routes/home.js.map +1 -0
- package/dist/src/internal/nitro/routes/index.d.ts +3 -8
- package/dist/src/internal/nitro/routes/index.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/index.js +18 -36
- package/dist/src/internal/nitro/routes/index.js.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +10 -3
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +2 -9
- package/dist/src/internal/nitro/routes/runtime-artifacts.js.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +8 -7
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.js +10 -10
- package/dist/src/internal/nitro/routes/runtime-stack.js.map +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.d.ts +7 -7
- package/dist/src/internal/nitro/routes/schedule-task.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.js +22 -30
- package/dist/src/internal/nitro/routes/schedule-task.js.map +1 -1
- package/dist/src/internal/nitro/routes/web-ui/assets/index.js +10 -0
- package/dist/src/internal/nitro/routes/web-ui/assets/style.css +2 -0
- package/dist/src/internal/nitro/routes/web-ui/index.html +17 -0
- package/dist/src/internal/nitro/routes/workflow-data.d.ts +32 -0
- package/dist/src/internal/nitro/routes/workflow-data.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-data.js +142 -0
- package/dist/src/internal/nitro/routes/workflow-data.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts +46 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.js +137 -0
- package/dist/src/internal/nitro/routes/workflow-route-helpers.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.d.ts +14 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.js +42 -0
- package/dist/src/internal/nitro/routes/workflow-run-events.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts +14 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.js +42 -0
- package/dist/src/internal/nitro/routes/workflow-run-steps.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run.d.ts +13 -0
- package/dist/src/internal/nitro/routes/workflow-run.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-run.js +35 -0
- package/dist/src/internal/nitro/routes/workflow-run.js.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-runs.d.ts +11 -0
- package/dist/src/internal/nitro/routes/workflow-runs.d.ts.map +1 -0
- package/dist/src/internal/nitro/routes/workflow-runs.js +29 -0
- package/dist/src/internal/nitro/routes/workflow-runs.js.map +1 -0
- package/dist/src/protocol/message.d.ts +160 -76
- package/dist/src/protocol/message.d.ts.map +1 -1
- package/dist/src/protocol/message.js +92 -36
- package/dist/src/protocol/message.js.map +1 -1
- package/dist/src/protocol/routes.d.ts +11 -3
- package/dist/src/protocol/routes.d.ts.map +1 -1
- package/dist/src/protocol/routes.js +12 -4
- package/dist/src/protocol/routes.js.map +1 -1
- package/dist/src/public/channels/auth.d.ts +32 -81
- package/dist/src/public/channels/auth.d.ts.map +1 -1
- package/dist/src/public/channels/auth.js +23 -86
- package/dist/src/public/channels/auth.js.map +1 -1
- package/dist/src/public/channels/http.d.ts +66 -26
- package/dist/src/public/channels/http.d.ts.map +1 -1
- package/dist/src/public/channels/http.js +88 -78
- package/dist/src/public/channels/http.js.map +1 -1
- package/dist/src/public/channels/index.d.ts +9 -10
- package/dist/src/public/channels/index.d.ts.map +1 -1
- package/dist/src/public/channels/index.js +9 -9
- package/dist/src/public/channels/index.js.map +1 -1
- package/dist/src/public/channels/slack/index.d.ts +104 -37
- package/dist/src/public/channels/slack/index.d.ts.map +1 -1
- package/dist/src/public/channels/slack/index.js +168 -47
- package/dist/src/public/channels/slack/index.js.map +1 -1
- package/dist/src/public/channels/slack/lowlevel.d.ts +5 -5
- package/dist/src/public/channels/slack/lowlevel.d.ts.map +1 -1
- package/dist/src/public/channels/slack/lowlevel.js +4 -4
- package/dist/src/public/channels/slack/lowlevel.js.map +1 -1
- package/dist/src/public/connections/index.d.ts +25 -0
- package/dist/src/public/connections/index.d.ts.map +1 -0
- package/dist/src/public/connections/index.js +24 -0
- package/dist/src/public/connections/index.js.map +1 -0
- package/dist/src/public/definitions/channel.d.ts +89 -60
- package/dist/src/public/definitions/channel.d.ts.map +1 -1
- package/dist/src/public/definitions/channel.js +42 -24
- package/dist/src/public/definitions/channel.js.map +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +60 -0
- package/dist/src/public/definitions/connections/mcp.d.ts.map +1 -0
- package/dist/src/public/definitions/connections/mcp.js +7 -0
- package/dist/src/public/definitions/connections/mcp.js.map +1 -0
- package/dist/src/public/definitions/tool.d.ts +14 -7
- package/dist/src/public/definitions/tool.d.ts.map +1 -1
- package/dist/src/public/definitions/tool.js.map +1 -1
- package/dist/src/public/index.d.ts +10 -9
- package/dist/src/public/index.d.ts.map +1 -1
- package/dist/src/public/index.js +7 -6
- package/dist/src/public/index.js.map +1 -1
- package/dist/src/public/sandboxes/internal.d.ts +1 -1
- package/dist/src/public/sandboxes/internal.js +1 -1
- package/dist/src/public/tools/defaults.d.ts +6 -6
- package/dist/src/public/tools/defaults.d.ts.map +1 -1
- package/dist/src/public/tools/defaults.js +6 -6
- package/dist/src/public/tools/defaults.js.map +1 -1
- package/dist/src/public/tools/internal.d.ts +1 -1
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/actions/types.d.ts +21 -18
- package/dist/src/runtime/actions/types.d.ts.map +1 -1
- package/dist/src/runtime/actions/types.js +22 -19
- package/dist/src/runtime/actions/types.js.map +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +37 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts.map +1 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.js +149 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.js.map +1 -0
- package/dist/src/runtime/agent/bootstrap-model.d.ts.map +1 -1
- package/dist/src/runtime/agent/bootstrap-model.js +11 -80
- package/dist/src/runtime/agent/bootstrap-model.js.map +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts.map +1 -1
- package/dist/src/runtime/agent/bootstrap.js +4 -1
- package/dist/src/runtime/agent/bootstrap.js.map +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.d.ts.map +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +72 -134
- package/dist/src/runtime/agent/mock-model-adapter.js.map +1 -1
- package/dist/src/runtime/channels/registry.d.ts +21 -0
- package/dist/src/runtime/channels/registry.d.ts.map +1 -0
- package/dist/src/runtime/channels/registry.js +65 -0
- package/dist/src/runtime/channels/registry.js.map +1 -0
- package/dist/src/runtime/connections/mcp-client.d.ts +48 -0
- package/dist/src/runtime/connections/mcp-client.d.ts.map +1 -0
- package/dist/src/runtime/connections/mcp-client.js +182 -0
- package/dist/src/runtime/connections/mcp-client.js.map +1 -0
- package/dist/src/runtime/connections/registry.d.ts +33 -0
- package/dist/src/runtime/connections/registry.d.ts.map +1 -0
- package/dist/src/runtime/connections/registry.js +54 -0
- package/dist/src/runtime/connections/registry.js.map +1 -0
- package/dist/src/runtime/connections/types.d.ts +75 -0
- package/dist/src/runtime/connections/types.d.ts.map +1 -0
- package/dist/src/runtime/connections/types.js +9 -0
- package/dist/src/runtime/connections/types.js.map +1 -0
- package/dist/src/runtime/framework-channels/index.d.ts +6 -6
- package/dist/src/runtime/framework-channels/index.d.ts.map +1 -1
- package/dist/src/runtime/framework-channels/index.js +16 -14
- package/dist/src/runtime/framework-channels/index.js.map +1 -1
- package/dist/src/runtime/framework-tools/ask-question.js +4 -4
- package/dist/src/runtime/framework-tools/ask-question.js.map +1 -1
- package/dist/src/runtime/framework-tools/connection-execute.d.ts +10 -0
- package/dist/src/runtime/framework-tools/connection-execute.d.ts.map +1 -0
- package/dist/src/runtime/framework-tools/connection-execute.js +50 -0
- package/dist/src/runtime/framework-tools/connection-execute.js.map +1 -0
- package/dist/src/runtime/framework-tools/connection-search.d.ts +43 -0
- package/dist/src/runtime/framework-tools/connection-search.d.ts.map +1 -0
- package/dist/src/runtime/framework-tools/connection-search.js +135 -0
- package/dist/src/runtime/framework-tools/connection-search.js.map +1 -0
- package/dist/src/runtime/framework-tools/file-state.d.ts +5 -5
- package/dist/src/runtime/framework-tools/file-state.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/file-state.js +6 -8
- package/dist/src/runtime/framework-tools/file-state.js.map +1 -1
- package/dist/src/runtime/framework-tools/index.d.ts +3 -1
- package/dist/src/runtime/framework-tools/index.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/index.js +10 -1
- package/dist/src/runtime/framework-tools/index.js.map +1 -1
- package/dist/src/runtime/framework-tools/skill.d.ts +4 -4
- package/dist/src/runtime/framework-tools/skill.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/skill.js +14 -11
- package/dist/src/runtime/framework-tools/skill.js.map +1 -1
- package/dist/src/runtime/framework-tools/todo.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/todo.js +2 -4
- package/dist/src/runtime/framework-tools/todo.js.map +1 -1
- package/dist/src/runtime/input/types.d.ts +40 -115
- package/dist/src/runtime/input/types.d.ts.map +1 -1
- package/dist/src/runtime/input/types.js +28 -66
- package/dist/src/runtime/input/types.js.map +1 -1
- package/dist/src/runtime/loaders/module-map.js +8 -0
- package/dist/src/runtime/loaders/module-map.js.map +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +4 -1
- package/dist/src/runtime/prompt/compose.d.ts.map +1 -1
- package/dist/src/runtime/prompt/compose.js +18 -1
- package/dist/src/runtime/prompt/compose.js.map +1 -1
- package/dist/src/runtime/prompt/connections.d.ts +10 -0
- package/dist/src/runtime/prompt/connections.d.ts.map +1 -0
- package/dist/src/runtime/prompt/connections.js +25 -0
- package/dist/src/runtime/prompt/connections.js.map +1 -0
- package/dist/src/runtime/resolve-agent-graph.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +29 -7
- package/dist/src/runtime/resolve-agent-graph.js.map +1 -1
- package/dist/src/runtime/resolve-agent.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent.js +3 -0
- package/dist/src/runtime/resolve-agent.js.map +1 -1
- package/dist/src/runtime/resolve-channel.d.ts.map +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -0
- package/dist/src/runtime/resolve-channel.js.map +1 -1
- package/dist/src/runtime/resolve-connection.d.ts +16 -0
- package/dist/src/runtime/resolve-connection.d.ts.map +1 -0
- package/dist/src/runtime/resolve-connection.js +69 -0
- package/dist/src/runtime/resolve-connection.js.map +1 -0
- package/dist/src/runtime/resolve-tool.d.ts.map +1 -1
- package/dist/src/runtime/resolve-tool.js +8 -0
- package/dist/src/runtime/resolve-tool.js.map +1 -1
- package/dist/src/runtime/sessions/auth.d.ts +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +2 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts.map +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +14 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.js.map +1 -1
- package/dist/src/runtime/skills/fragment-context.d.ts +2 -2
- package/dist/src/runtime/skills/fragment-context.d.ts.map +1 -1
- package/dist/src/runtime/skills/fragment-context.js +2 -2
- package/dist/src/runtime/skills/fragment-context.js.map +1 -1
- package/dist/src/runtime/standard-schema.d.ts +28 -0
- package/dist/src/runtime/standard-schema.d.ts.map +1 -0
- package/dist/src/runtime/standard-schema.js +65 -0
- package/dist/src/runtime/standard-schema.js.map +1 -0
- package/dist/src/runtime/types.d.ts +29 -3
- package/dist/src/runtime/types.d.ts.map +1 -1
- package/dist/src/services/dev-client/send-message.d.ts +2 -2
- package/dist/src/services/dev-client/send-message.d.ts.map +1 -1
- package/dist/src/services/dev-client/send-message.js +21 -22
- package/dist/src/services/dev-client/send-message.js.map +1 -1
- package/dist/src/services/dev-client/session.d.ts +5 -5
- package/dist/src/services/dev-client/session.d.ts.map +1 -1
- package/dist/src/services/dev-client/session.js +2 -2
- package/dist/src/services/dev-client/session.js.map +1 -1
- package/dist/src/services/dev-client.d.ts +6 -6
- package/dist/src/services/dev-client.d.ts.map +1 -1
- package/dist/src/services/dev-client.js +3 -3
- package/dist/src/services/dev-client.js.map +1 -1
- package/docs/external-agent-protocol.md +37 -34
- package/docs/internals/channels.md +15 -12
- package/docs/internals/context.md +81 -161
- package/docs/internals/message-runtime.md +28 -26
- package/docs/public/README.md +22 -20
- package/docs/public/auth-and-route-protection.md +15 -12
- package/docs/public/channels/README.md +16 -11
- package/docs/public/cli-build-and-debugging.md +1 -1
- package/docs/public/context-control.md +7 -3
- package/docs/public/evals.md +3 -3
- package/docs/public/getting-started.md +15 -12
- package/docs/public/human-in-the-loop.md +45 -57
- package/docs/public/migration-guide.md +71 -0
- package/docs/public/project-layout.md +5 -0
- package/docs/public/runs-and-streaming.md +32 -25
- package/docs/public/schedules.md +4 -4
- package/docs/public/session-context.md +131 -15
- package/docs/public/skills.md +27 -3
- package/docs/public/subagents.md +2 -2
- package/docs/public/tools.md +23 -30
- package/docs/public/typescript-api.md +16 -12
- package/docs/public/vercel-deployment.md +3 -4
- package/docs/public/workspace.md +11 -11
- package/package.json +18 -11
- package/dist/src/channel/emitter-registry.d.ts +0 -34
- package/dist/src/channel/emitter-registry.d.ts.map +0 -1
- package/dist/src/channel/emitter-registry.js +0 -63
- package/dist/src/channel/emitter-registry.js.map +0 -1
- package/dist/src/channel/http-emitter.d.ts +0 -16
- package/dist/src/channel/http-emitter.d.ts.map +0 -1
- package/dist/src/channel/http-emitter.js +0 -22
- package/dist/src/channel/http-emitter.js.map +0 -1
- package/dist/src/channel/schedule-emitter.d.ts +0 -15
- package/dist/src/channel/schedule-emitter.d.ts.map +0 -1
- package/dist/src/channel/schedule-emitter.js +0 -21
- package/dist/src/channel/schedule-emitter.js.map +0 -1
- package/dist/src/channel/slack-emitter.d.ts +0 -56
- package/dist/src/channel/slack-emitter.d.ts.map +0 -1
- package/dist/src/channel/slack-emitter.js +0 -235
- package/dist/src/channel/slack-emitter.js.map +0 -1
- package/dist/src/channel/subagent-emitter.d.ts +0 -41
- package/dist/src/channel/subagent-emitter.d.ts.map +0 -1
- package/dist/src/channel/subagent-emitter.js.map +0 -1
- package/dist/src/context/state.d.ts +0 -27
- package/dist/src/context/state.d.ts.map +0 -1
- package/dist/src/context/state.js +0 -53
- package/dist/src/context/state.js.map +0 -1
- package/dist/src/internal/message/nitro-route-shims.d.ts +0 -6
- package/dist/src/internal/message/nitro-route-shims.d.ts.map +0 -1
- package/dist/src/internal/message/nitro-route-shims.js +0 -38
- package/dist/src/internal/message/nitro-route-shims.js.map +0 -1
- package/dist/src/internal/message/rewrite-generated-imports.d.ts +0 -15
- package/dist/src/internal/message/rewrite-generated-imports.d.ts.map +0 -1
- package/dist/src/internal/message/rewrite-generated-imports.js +0 -59
- package/dist/src/internal/message/rewrite-generated-imports.js.map +0 -1
- package/dist/src/internal/nitro/host/channel-url-matcher.d.ts +0 -35
- package/dist/src/internal/nitro/host/channel-url-matcher.d.ts.map +0 -1
- package/dist/src/internal/nitro/host/channel-url-matcher.js +0 -57
- package/dist/src/internal/nitro/host/channel-url-matcher.js.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.d.ts +0 -11
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.d.ts.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.js +0 -264
- package/dist/src/internal/nitro/routes/home-page/build-home-page-view-model.js.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/render-home-page.d.ts +0 -9
- package/dist/src/internal/nitro/routes/home-page/render-home-page.d.ts.map +0 -1
- package/dist/src/internal/nitro/routes/home-page/render-home-page.js +0 -15
- package/dist/src/internal/nitro/routes/home-page/render-home-page.js.map +0 -1
- package/dist/src/internal/nitro/routes/index.html +0 -525
- package/dist/src/internal/nitro/runtime-configuration.d.ts +0 -16
- package/dist/src/internal/nitro/runtime-configuration.d.ts.map +0 -1
- package/dist/src/internal/nitro/runtime-configuration.js +0 -23
- package/dist/src/internal/nitro/runtime-configuration.js.map +0 -1
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts +0 -10
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.d.ts.map +0 -1
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js +0 -17
- package/dist/src/internal/nitro/shims/runtime-configuration-plugin.js.map +0 -1
- package/dist/src/runtime/tools/execute-tool.d.ts +0 -20
- package/dist/src/runtime/tools/execute-tool.d.ts.map +0 -1
- package/dist/src/runtime/tools/execute-tool.js +0 -69
- package/dist/src/runtime/tools/execute-tool.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lower-level Slack channel primitives for users who write their own
|
|
3
|
-
* `fetch` handler instead of using the {@link
|
|
3
|
+
* `fetch` handler instead of using the {@link slackRoute} convenience
|
|
4
4
|
* factory.
|
|
5
5
|
*
|
|
6
6
|
* Today this just re-exports the framework's default
|
|
7
|
-
* {@link
|
|
7
|
+
* {@link SlackChannel} so handcrafted Slack routes can still rely
|
|
8
8
|
* on the standard reply behavior. Future additions
|
|
9
9
|
* (`verifySlackSignature`, `parseSlackEvent`, typed `SlackEvent` unions)
|
|
10
|
-
* will live alongside the
|
|
10
|
+
* will live alongside the channel and remain Ash-owned implementations
|
|
11
11
|
* rather than re-exports of `@chat-adapter/slack` (CLAUDE.md item 8).
|
|
12
12
|
*/
|
|
13
|
-
export {
|
|
13
|
+
export { SlackChannel } from "../../../channel/slack-channel.js";
|
|
14
14
|
//# sourceMappingURL=lowlevel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowlevel.js","sourceRoot":"","sources":["../../../../../src/public/channels/slack/lowlevel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"lowlevel.js","sourceRoot":"","sources":["../../../../../src/public/channels/slack/lowlevel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection authoring helpers used inside `agent/connections/*.ts` files.
|
|
3
|
+
*
|
|
4
|
+
* This subpath collects everything related to authoring connections to
|
|
5
|
+
* external services via the Model Context Protocol (MCP).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // agent/connections/linear.ts
|
|
10
|
+
* import { defineMcpClientConnection } from "experimental-ash/connections";
|
|
11
|
+
*
|
|
12
|
+
* export default defineMcpClientConnection({
|
|
13
|
+
* url: "https://mcp.linear.app/mcp",
|
|
14
|
+
* description:
|
|
15
|
+
* "Linear issue tracking and project management. Tools can find, create, " +
|
|
16
|
+
* "and update issues, projects, comments, and teams.",
|
|
17
|
+
* authorization: {
|
|
18
|
+
* token: () => process.env.LINEAR_API_KEY!,
|
|
19
|
+
* },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export type { AuthorizationDefinition, HeadersDefinition, ToolFilterDefinition, } from "../../runtime/connections/types.js";
|
|
24
|
+
export { defineMcpClientConnection, type McpAuthorizationDefinition, type McpClientConnectionDefinition, } from "../definitions/connections/mcp.js";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/public/connections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,yBAAyB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,GACnC,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection authoring helpers used inside `agent/connections/*.ts` files.
|
|
3
|
+
*
|
|
4
|
+
* This subpath collects everything related to authoring connections to
|
|
5
|
+
* external services via the Model Context Protocol (MCP).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // agent/connections/linear.ts
|
|
10
|
+
* import { defineMcpClientConnection } from "experimental-ash/connections";
|
|
11
|
+
*
|
|
12
|
+
* export default defineMcpClientConnection({
|
|
13
|
+
* url: "https://mcp.linear.app/mcp",
|
|
14
|
+
* description:
|
|
15
|
+
* "Linear issue tracking and project management. Tools can find, create, " +
|
|
16
|
+
* "and update issues, projects, comments, and teams.",
|
|
17
|
+
* authorization: {
|
|
18
|
+
* token: () => process.env.LINEAR_API_KEY!,
|
|
19
|
+
* },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export { defineMcpClientConnection, } from "../definitions/connections/mcp.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/public/connections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,OAAO,EACL,yBAAyB,GAG1B,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ChannelClass, type DeliverInput, type GetEventStreamOptions, type RunHandle, type RunInput } from "../../channel/types.js";
|
|
2
2
|
import type { HandleMessageStreamEvent } from "../../protocol/message.js";
|
|
3
3
|
export type { GetEventStreamOptions } from "../../channel/types.js";
|
|
4
4
|
/**
|
|
5
|
-
* HTTP method a
|
|
6
|
-
* is a webhook. Override only when authoring a non-webhook
|
|
5
|
+
* HTTP method a route handles. Defaults to `"POST"` — almost every route
|
|
6
|
+
* is a webhook. Override only when authoring a non-webhook route such as a
|
|
7
7
|
* long-poll endpoint or an event-stream reader.
|
|
8
8
|
*/
|
|
9
9
|
export type ChannelMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
10
10
|
/**
|
|
11
|
-
* Per-request surface exposed to a
|
|
11
|
+
* Per-request surface exposed to a route's `fetch` handler. The
|
|
12
12
|
* framework constructs this per request and passes it as the second
|
|
13
13
|
* argument.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* Routes call into the agent to start new sessions (`agent.run`),
|
|
16
16
|
* deliver follow-up messages to existing sessions (`agent.deliver`), or
|
|
17
|
-
* read events from a previously-started
|
|
17
|
+
* read events from a previously-started session (`agent.getEventStream`).
|
|
18
18
|
*/
|
|
19
|
-
export interface
|
|
19
|
+
export interface RouteContext {
|
|
20
20
|
/**
|
|
21
|
-
* Handle to the agent that this
|
|
22
|
-
* Conceptually the runtime + harness combined:
|
|
21
|
+
* Handle to the agent that this route sends inbound requests to.
|
|
22
|
+
* Conceptually the runtime + harness combined: routes call `run`,
|
|
23
23
|
* `deliver`, and `getEventStream` to drive sessions of this agent
|
|
24
24
|
* without knowing about the workflow runtime, the harness, or any
|
|
25
25
|
* other execution-layer detail.
|
|
26
26
|
*
|
|
27
|
-
* Every
|
|
27
|
+
* Every route speaks the same `RunInput` shape regardless of which
|
|
28
28
|
* webhook it serves — `agent` is platform-agnostic.
|
|
29
29
|
*/
|
|
30
30
|
readonly agent: Agent;
|
|
31
31
|
/**
|
|
32
32
|
* Hands a background promise to the request host so the serverless
|
|
33
33
|
* invocation stays alive until the promise resolves. Use this when the
|
|
34
|
-
*
|
|
34
|
+
* route responds to the platform immediately (e.g. a Slack `200 OK`
|
|
35
35
|
* acknowledgement) but still needs to drive an `agent.run()` call to
|
|
36
36
|
* completion.
|
|
37
37
|
*/
|
|
38
38
|
readonly waitUntil: (task: Promise<unknown>) => void;
|
|
39
39
|
/**
|
|
40
|
-
* Path parameter values extracted from `[name]` segments in the
|
|
41
|
-
* filesystem path. For `agent/channels/
|
|
42
|
-
* `GET /
|
|
43
|
-
*
|
|
40
|
+
* Path parameter values extracted from `[name]` segments in the route's
|
|
41
|
+
* filesystem path. For `agent/channels/sessions/[sessionId]/stream.ts`
|
|
42
|
+
* mounted at `GET /sessions/:sessionId/stream`, the matched value lives at
|
|
43
|
+
* `params.sessionId`.
|
|
44
|
+
* Empty for routes with no path parameters.
|
|
44
45
|
*/
|
|
45
46
|
readonly params: Readonly<Record<string, string>>;
|
|
46
47
|
/**
|
|
47
48
|
* Trusted peer IP for this request, extracted by the host transport
|
|
48
|
-
* before the
|
|
49
|
-
* peer address (e.g. unit tests calling `
|
|
49
|
+
* before the route handler runs. `null` when the host can't observe a
|
|
50
|
+
* peer address (e.g. unit tests calling `route.fetch` directly).
|
|
50
51
|
*
|
|
51
52
|
* Pass this to {@link isIpAllowed} from `experimental-ash/channels/auth`
|
|
52
|
-
* when implementing IP allowlisting in a
|
|
53
|
+
* when implementing IP allowlisting in a route.
|
|
53
54
|
*/
|
|
54
55
|
readonly requestIp: string | null;
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
|
-
*
|
|
58
|
+
* Route-facing handle to the agent that owns this request.
|
|
58
59
|
*
|
|
59
60
|
* `Agent` is conceptually the workflow runtime plus the tool-loop harness:
|
|
60
|
-
*
|
|
61
|
+
* routes call `run` to start a new session of the agent, `deliver` to
|
|
61
62
|
* send a follow-up to a parked session, and `getEventStream` to read events
|
|
62
|
-
* from a previously-started
|
|
63
|
+
* from a previously-started session. The framework's internal `Runtime`
|
|
63
64
|
* interface (in `channel/types.ts`) is the underlying primitive — `Agent`
|
|
64
|
-
* is the *public* shape exposed on `
|
|
65
|
+
* is the *public* shape exposed on `RouteContext` so route authors
|
|
65
66
|
* speak in terms of the agent rather than the runtime.
|
|
66
67
|
*/
|
|
67
68
|
export interface Agent {
|
|
@@ -74,24 +75,24 @@ export interface Agent {
|
|
|
74
75
|
/**
|
|
75
76
|
* Sends a follow-up message to a session that is currently parked waiting
|
|
76
77
|
* for input. Throws if no parked session exists for the supplied
|
|
77
|
-
* `continuationToken` —
|
|
78
|
+
* `continuationToken` — routes typically catch the failure and fall back
|
|
78
79
|
* to `run()` to start a new session.
|
|
79
80
|
*/
|
|
80
81
|
deliver(input: DeliverInput): Promise<void>;
|
|
81
82
|
/**
|
|
82
83
|
* Returns a readable NDJSON-style stream of lifecycle events for an
|
|
83
|
-
* existing
|
|
84
|
-
* any user-authored
|
|
84
|
+
* existing session. Used by the framework's HTTP session-stream route and by
|
|
85
|
+
* any user-authored route that exposes an event-streaming endpoint.
|
|
85
86
|
*
|
|
86
87
|
* Pass `options.startIndex` to skip events the caller has already
|
|
87
|
-
* consumed — the framework HTTP
|
|
88
|
+
* consumed — the framework HTTP session-stream route uses this to forward
|
|
88
89
|
* the `startIndex` query parameter so reconnecting clients resume from
|
|
89
|
-
* the next unread event instead of replaying the
|
|
90
|
+
* the next unread event instead of replaying the session from the start.
|
|
90
91
|
*/
|
|
91
|
-
getEventStream(
|
|
92
|
+
getEventStream(sessionId: string, options?: GetEventStreamOptions): Promise<ReadableStream<HandleMessageStreamEvent>>;
|
|
92
93
|
}
|
|
93
94
|
/**
|
|
94
|
-
* Public authored
|
|
95
|
+
* Public authored route definition. A route is a Web-standard
|
|
95
96
|
* `(Request, ctx) => Response` handler whose URL path is derived from the
|
|
96
97
|
* file's location under `agent/channels/`.
|
|
97
98
|
*
|
|
@@ -99,14 +100,32 @@ export interface Agent {
|
|
|
99
100
|
* Nested directories produce nested URL segments
|
|
100
101
|
* (`agent/channels/api/inbound.ts` → `POST /api/inbound`). Path parameters
|
|
101
102
|
* use the Nitro `[name]` convention
|
|
102
|
-
* (`agent/channels/
|
|
103
|
+
* (`agent/channels/sessions/[sessionId]/stream.ts` → `GET /sessions/:sessionId/stream`).
|
|
103
104
|
*
|
|
104
105
|
* @example
|
|
105
106
|
* ```ts
|
|
106
107
|
* // agent/channels/slack.ts → POST /slack
|
|
107
|
-
* import {
|
|
108
|
+
* import { Channel, defineRoute } from "experimental-ash";
|
|
108
109
|
*
|
|
109
|
-
*
|
|
110
|
+
* class MyChannel extends Channel {
|
|
111
|
+
* static kind = "my-channel";
|
|
112
|
+
*
|
|
113
|
+
* constructor(state = {}) {
|
|
114
|
+
* super();
|
|
115
|
+
* }
|
|
116
|
+
* async onEvent(event) {
|
|
117
|
+
* return event;
|
|
118
|
+
* }
|
|
119
|
+
* async onDeliver(_ctx, payload) {
|
|
120
|
+
* return payload;
|
|
121
|
+
* }
|
|
122
|
+
* serialize() {
|
|
123
|
+
* return {};
|
|
124
|
+
* }
|
|
125
|
+
* }
|
|
126
|
+
*
|
|
127
|
+
* export default defineRoute({
|
|
128
|
+
* serializableChannels: [MyChannel],
|
|
110
129
|
* async fetch(request, { agent, waitUntil }) {
|
|
111
130
|
* const body = await request.json();
|
|
112
131
|
* waitUntil(
|
|
@@ -115,7 +134,7 @@ export interface Agent {
|
|
|
115
134
|
* input: { message: body.text },
|
|
116
135
|
* mode: "conversation",
|
|
117
136
|
* sessionId: crypto.randomUUID(),
|
|
118
|
-
*
|
|
137
|
+
* channel: new MyChannel(),
|
|
119
138
|
* }).then((handle) => handle.result),
|
|
120
139
|
* );
|
|
121
140
|
* return new Response("ok");
|
|
@@ -123,27 +142,37 @@ export interface Agent {
|
|
|
123
142
|
* });
|
|
124
143
|
* ```
|
|
125
144
|
*/
|
|
126
|
-
export interface
|
|
145
|
+
export interface Route {
|
|
127
146
|
/**
|
|
128
|
-
* HTTP method this
|
|
147
|
+
* HTTP method this route handles. Optional — defaults to `"POST"`.
|
|
129
148
|
*/
|
|
130
149
|
readonly method?: ChannelMethod;
|
|
150
|
+
/**
|
|
151
|
+
* Optional set of serializable channel classes this route may persist on a
|
|
152
|
+
* session it starts.
|
|
153
|
+
*
|
|
154
|
+
* Declare custom channel classes here so the runtime can rehydrate them
|
|
155
|
+
* after workflow step boundaries without relying on import-time global
|
|
156
|
+
* registration. Entries must extend {@link Channel}. Framework-built
|
|
157
|
+
* channels are already known to the runtime and do not need to be listed.
|
|
158
|
+
*/
|
|
159
|
+
readonly serializableChannels?: readonly ChannelClass[];
|
|
131
160
|
/**
|
|
132
161
|
* The request handler. Receives the inbound `Request` and a
|
|
133
|
-
* {@link
|
|
162
|
+
* {@link RouteContext} carrying the agent handle and host helpers.
|
|
134
163
|
*/
|
|
135
|
-
fetch(request: Request, ctx:
|
|
164
|
+
fetch(request: Request, ctx: RouteContext): Promise<Response>;
|
|
136
165
|
}
|
|
137
166
|
/**
|
|
138
|
-
* Defines an authored Ash
|
|
167
|
+
* Defines an authored Ash route. Validates the shape and returns the
|
|
139
168
|
* definition unchanged so the value can be exported as the file's default.
|
|
140
169
|
*
|
|
141
170
|
* @example
|
|
142
171
|
* ```ts
|
|
143
172
|
* // agent/channels/healthz.ts → GET /healthz
|
|
144
|
-
* import {
|
|
173
|
+
* import { defineRoute } from "experimental-ash";
|
|
145
174
|
*
|
|
146
|
-
* export default
|
|
175
|
+
* export default defineRoute({
|
|
147
176
|
* method: "GET",
|
|
148
177
|
* async fetch() {
|
|
149
178
|
* return new Response("ok");
|
|
@@ -151,48 +180,48 @@ export interface Channel {
|
|
|
151
180
|
* });
|
|
152
181
|
* ```
|
|
153
182
|
*/
|
|
154
|
-
export declare function
|
|
183
|
+
export declare function defineRoute(route: Route): Route;
|
|
155
184
|
/**
|
|
156
|
-
* Marker discriminator written into every {@link
|
|
185
|
+
* Marker discriminator written into every {@link DisabledRouteSentinel}.
|
|
157
186
|
*/
|
|
158
|
-
export declare const
|
|
187
|
+
export declare const DISABLED_ROUTE_SENTINEL_KIND = "ash:disabled-channel";
|
|
159
188
|
/**
|
|
160
|
-
* Marker value returned from {@link
|
|
189
|
+
* Marker value returned from {@link disableRoute}. Export this as the
|
|
161
190
|
* default export of a file in `agent/channels/` to remove the framework
|
|
162
|
-
* default
|
|
191
|
+
* default route whose logical name matches the file's slug path.
|
|
163
192
|
*/
|
|
164
|
-
export interface
|
|
165
|
-
readonly kind: typeof
|
|
193
|
+
export interface DisabledRouteSentinel {
|
|
194
|
+
readonly kind: typeof DISABLED_ROUTE_SENTINEL_KIND;
|
|
166
195
|
}
|
|
167
196
|
/**
|
|
168
|
-
* Returns a sentinel that disables the framework
|
|
197
|
+
* Returns a sentinel that disables the framework route whose logical name
|
|
169
198
|
* matches the containing file's slug path.
|
|
170
199
|
*
|
|
171
200
|
* Export the result as the default export of a file in `agent/channels/`.
|
|
172
|
-
* The compiler reads the filename to determine which framework
|
|
201
|
+
* The compiler reads the filename to determine which framework route the
|
|
173
202
|
* sentinel targets — there is no name argument because the file *is* the
|
|
174
203
|
* name. It is an error to place this in a file whose slug does not match a
|
|
175
|
-
* known framework
|
|
204
|
+
* known framework route name.
|
|
176
205
|
*
|
|
177
206
|
* @example
|
|
178
207
|
* ```ts
|
|
179
208
|
* // apps/my-agent/agent/channels/.well-known/ash/v1/message.ts
|
|
180
|
-
* import {
|
|
209
|
+
* import { disableRoute } from "experimental-ash";
|
|
181
210
|
*
|
|
182
|
-
* export default
|
|
211
|
+
* export default disableRoute();
|
|
183
212
|
* ```
|
|
184
213
|
*/
|
|
185
|
-
export declare function
|
|
214
|
+
export declare function disableRoute(): DisabledRouteSentinel;
|
|
186
215
|
/**
|
|
187
|
-
* Type guard: returns whether `value` is a {@link
|
|
188
|
-
* produced by {@link
|
|
216
|
+
* Type guard: returns whether `value` is a {@link DisabledRouteSentinel}
|
|
217
|
+
* produced by {@link disableRoute}.
|
|
189
218
|
*/
|
|
190
|
-
export declare function
|
|
219
|
+
export declare function isDisabledRouteSentinel(value: unknown): value is DisabledRouteSentinel;
|
|
191
220
|
/**
|
|
192
|
-
* Type guard: returns whether `value` looks like a {@link
|
|
221
|
+
* Type guard: returns whether `value` looks like a {@link Route}.
|
|
193
222
|
*
|
|
194
|
-
* Used by the compiler to distinguish authored `
|
|
195
|
-
* `
|
|
223
|
+
* Used by the compiler to distinguish authored `Route` exports from
|
|
224
|
+
* `DisabledRouteSentinel` exports.
|
|
196
225
|
*/
|
|
197
|
-
export declare function
|
|
226
|
+
export declare function isRouteDefinition(value: unknown): value is Route;
|
|
198
227
|
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../src/public/definitions/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../src/public/definitions/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,KAAK;IACpB;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C;;;;;;;;;OASG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC;CACtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC;;;;;;;;OAQG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IACxD;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAiC/C;AAED;;GAEG;AACH,eAAO,MAAM,4BAA4B,yBAAyB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,4BAA4B,CAAC;CACpD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,IAAI,qBAAqB,CAIpD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAMtF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAMhE"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { CHANNEL_CLASS_BRAND, CHANNEL_PROTOTYPE_BRAND, Channel, } from "../../channel/types.js";
|
|
1
2
|
/**
|
|
2
|
-
* Defines an authored Ash
|
|
3
|
+
* Defines an authored Ash route. Validates the shape and returns the
|
|
3
4
|
* definition unchanged so the value can be exported as the file's default.
|
|
4
5
|
*
|
|
5
6
|
* @example
|
|
6
7
|
* ```ts
|
|
7
8
|
* // agent/channels/healthz.ts → GET /healthz
|
|
8
|
-
* import {
|
|
9
|
+
* import { defineRoute } from "experimental-ash";
|
|
9
10
|
*
|
|
10
|
-
* export default
|
|
11
|
+
* export default defineRoute({
|
|
11
12
|
* method: "GET",
|
|
12
13
|
* async fetch() {
|
|
13
14
|
* return new Response("ok");
|
|
@@ -15,55 +16,72 @@
|
|
|
15
16
|
* });
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
|
-
export function
|
|
19
|
-
if (typeof
|
|
20
|
-
throw new TypeError("
|
|
19
|
+
export function defineRoute(route) {
|
|
20
|
+
if (typeof route.fetch !== "function") {
|
|
21
|
+
throw new TypeError("defineRoute: `fetch` must be a function.");
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
if (route.serializableChannels !== undefined) {
|
|
24
|
+
if (!Array.isArray(route.serializableChannels)) {
|
|
25
|
+
throw new TypeError("defineRoute: `serializableChannels` must be an array when provided.");
|
|
26
|
+
}
|
|
27
|
+
for (const channelClass of route.serializableChannels) {
|
|
28
|
+
if (typeof channelClass !== "function") {
|
|
29
|
+
throw new TypeError("defineRoute: each `serializableChannels` entry must be a channel class.");
|
|
30
|
+
}
|
|
31
|
+
if (channelClass[CHANNEL_CLASS_BRAND] !== true ||
|
|
32
|
+
channelClass.prototype[CHANNEL_PROTOTYPE_BRAND] !== true) {
|
|
33
|
+
throw new TypeError("defineRoute: each `serializableChannels` entry must extend `Channel`.");
|
|
34
|
+
}
|
|
35
|
+
if (typeof channelClass.kind !== "string" || channelClass.kind.length === 0) {
|
|
36
|
+
throw new TypeError("defineRoute: each `serializableChannels` entry must declare a non-empty static `kind` field.");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return route;
|
|
23
41
|
}
|
|
24
42
|
/**
|
|
25
|
-
* Marker discriminator written into every {@link
|
|
43
|
+
* Marker discriminator written into every {@link DisabledRouteSentinel}.
|
|
26
44
|
*/
|
|
27
|
-
export const
|
|
45
|
+
export const DISABLED_ROUTE_SENTINEL_KIND = "ash:disabled-channel";
|
|
28
46
|
/**
|
|
29
|
-
* Returns a sentinel that disables the framework
|
|
47
|
+
* Returns a sentinel that disables the framework route whose logical name
|
|
30
48
|
* matches the containing file's slug path.
|
|
31
49
|
*
|
|
32
50
|
* Export the result as the default export of a file in `agent/channels/`.
|
|
33
|
-
* The compiler reads the filename to determine which framework
|
|
51
|
+
* The compiler reads the filename to determine which framework route the
|
|
34
52
|
* sentinel targets — there is no name argument because the file *is* the
|
|
35
53
|
* name. It is an error to place this in a file whose slug does not match a
|
|
36
|
-
* known framework
|
|
54
|
+
* known framework route name.
|
|
37
55
|
*
|
|
38
56
|
* @example
|
|
39
57
|
* ```ts
|
|
40
58
|
* // apps/my-agent/agent/channels/.well-known/ash/v1/message.ts
|
|
41
|
-
* import {
|
|
59
|
+
* import { disableRoute } from "experimental-ash";
|
|
42
60
|
*
|
|
43
|
-
* export default
|
|
61
|
+
* export default disableRoute();
|
|
44
62
|
* ```
|
|
45
63
|
*/
|
|
46
|
-
export function
|
|
64
|
+
export function disableRoute() {
|
|
47
65
|
return {
|
|
48
|
-
kind:
|
|
66
|
+
kind: DISABLED_ROUTE_SENTINEL_KIND,
|
|
49
67
|
};
|
|
50
68
|
}
|
|
51
69
|
/**
|
|
52
|
-
* Type guard: returns whether `value` is a {@link
|
|
53
|
-
* produced by {@link
|
|
70
|
+
* Type guard: returns whether `value` is a {@link DisabledRouteSentinel}
|
|
71
|
+
* produced by {@link disableRoute}.
|
|
54
72
|
*/
|
|
55
|
-
export function
|
|
73
|
+
export function isDisabledRouteSentinel(value) {
|
|
56
74
|
return (typeof value === "object" &&
|
|
57
75
|
value !== null &&
|
|
58
|
-
value.kind ===
|
|
76
|
+
value.kind === DISABLED_ROUTE_SENTINEL_KIND);
|
|
59
77
|
}
|
|
60
78
|
/**
|
|
61
|
-
* Type guard: returns whether `value` looks like a {@link
|
|
79
|
+
* Type guard: returns whether `value` looks like a {@link Route}.
|
|
62
80
|
*
|
|
63
|
-
* Used by the compiler to distinguish authored `
|
|
64
|
-
* `
|
|
81
|
+
* Used by the compiler to distinguish authored `Route` exports from
|
|
82
|
+
* `DisabledRouteSentinel` exports.
|
|
65
83
|
*/
|
|
66
|
-
export function
|
|
84
|
+
export function isRouteDefinition(value) {
|
|
67
85
|
return (typeof value === "object" &&
|
|
68
86
|
value !== null &&
|
|
69
87
|
typeof value.fetch === "function");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../../src/public/definitions/channel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../../src/public/definitions/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,OAAO,GAMR,MAAM,wBAAwB,CAAC;AA8KhC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QACtC,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,KAAK,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,SAAS,CAAC,qEAAqE,CAAC,CAAC;QAC7F,CAAC;QAED,KAAK,MAAM,YAAY,IAAI,KAAK,CAAC,oBAAoB,EAAE,CAAC;YACtD,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;gBACvC,MAAM,IAAI,SAAS,CACjB,yEAAyE,CAC1E,CAAC;YACJ,CAAC;YACD,IACG,YAA0D,CAAC,mBAAmB,CAAC,KAAK,IAAI;gBACxF,YAAY,CAAC,SAA2D,CACvE,uBAAuB,CACxB,KAAK,IAAI,EACV,CAAC;gBACD,MAAM,IAAI,SAAS,CACjB,uEAAuE,CACxE,CAAC;YACJ,CAAC;YACD,IAAI,OAAO,YAAY,CAAC,IAAI,KAAK,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC5E,MAAM,IAAI,SAAS,CACjB,8FAA8F,CAC/F,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAWnE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,IAAI,EAAE,4BAA4B;KACnC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAA4B,CAAC,IAAI,KAAK,4BAA4B,CACpE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAA6B,CAAC,KAAK,KAAK,UAAU,CAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AuthorizationDefinition, HeadersDefinition, ToolFilterDefinition } from "../../../runtime/connections/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Re-export `AuthorizationDefinition` under the MCP-specific alias for
|
|
4
|
+
* backwards compatibility. New code should prefer `AuthorizationDefinition`.
|
|
5
|
+
*/
|
|
6
|
+
export type McpAuthorizationDefinition = AuthorizationDefinition;
|
|
7
|
+
/**
|
|
8
|
+
* Public definition for an MCP client connection authored in
|
|
9
|
+
* `connections/*.ts`.
|
|
10
|
+
*
|
|
11
|
+
* The connection's runtime name is derived from its filename (the slug
|
|
12
|
+
* under `agent/connections/`, without the extension). A connection
|
|
13
|
+
* authored at `agent/connections/linear.ts` is registered as `"linear"`.
|
|
14
|
+
*
|
|
15
|
+
* Both `authorization` and `headers` are optional — omit both for
|
|
16
|
+
* servers that require no authentication (e.g. localhost).
|
|
17
|
+
*/
|
|
18
|
+
export interface McpClientConnectionDefinition {
|
|
19
|
+
/**
|
|
20
|
+
* The MCP server's HTTP endpoint URL.
|
|
21
|
+
*
|
|
22
|
+
* Must support Streamable HTTP or SSE transport.
|
|
23
|
+
*/
|
|
24
|
+
url: string;
|
|
25
|
+
/**
|
|
26
|
+
* Human-readable summary of the connection and the tools it provides.
|
|
27
|
+
*
|
|
28
|
+
* Used in the system prompt layer to describe the connection to the model,
|
|
29
|
+
* and in `connection_search` results so the model can choose which
|
|
30
|
+
* connection to query.
|
|
31
|
+
*/
|
|
32
|
+
description: string;
|
|
33
|
+
/**
|
|
34
|
+
* Bearer token credentials for the MCP server. The `token` field is
|
|
35
|
+
* sent as `Authorization: Bearer <token>`.
|
|
36
|
+
*
|
|
37
|
+
* Optional when `headers` is provided for non-Bearer auth schemes.
|
|
38
|
+
*/
|
|
39
|
+
authorization?: AuthorizationDefinition;
|
|
40
|
+
/**
|
|
41
|
+
* Arbitrary HTTP headers sent with every request to the MCP server.
|
|
42
|
+
*
|
|
43
|
+
* Use for non-Bearer auth (e.g. API key headers) or server-level
|
|
44
|
+
* configuration headers. Can be combined with `authorization`.
|
|
45
|
+
*/
|
|
46
|
+
headers?: HeadersDefinition;
|
|
47
|
+
/**
|
|
48
|
+
* Client-side tool filter. When set, only tools whose names pass
|
|
49
|
+
* the filter are surfaced to the model. All other tools are silently
|
|
50
|
+
* excluded from `connection_search` and `connection_execute`.
|
|
51
|
+
*
|
|
52
|
+
* Specify exactly one of `allow` or `block`.
|
|
53
|
+
*/
|
|
54
|
+
tools?: ToolFilterDefinition;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Defines an MCP client connection.
|
|
58
|
+
*/
|
|
59
|
+
export declare function defineMcpClientConnection(definition: McpClientConnectionDefinition): McpClientConnectionDefinition;
|
|
60
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../../src/public/definitions/connections/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,6BAA6B,GACxC,6BAA6B,CAE/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../../src/public/definitions/connections/mcp.ts"],"names":[],"mappings":"AA8DA;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAAyC;IAEzC,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -19,13 +19,12 @@ export interface CompactionHookInput {
|
|
|
19
19
|
* Result returned by a tool's {@link ToolDefinition.onCompact} hook.
|
|
20
20
|
*
|
|
21
21
|
* `messages` are appended to the compacted history in tool registration
|
|
22
|
-
* order.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* order. Hooks should mutate durable context directly through {@link ctx}
|
|
23
|
+
* when they need to preserve or reset context values. Returning `void` is
|
|
24
|
+
* equivalent to returning `{}`.
|
|
25
25
|
*/
|
|
26
26
|
export interface CompactionHookResult {
|
|
27
27
|
readonly messages?: readonly ModelMessage[];
|
|
28
|
-
readonly sessionPatch?: Readonly<Record<string, unknown>>;
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
30
|
* Context passed to a tool's {@link ToolDefinition.needsApproval} function.
|
|
@@ -51,7 +50,15 @@ export interface NeedsApprovalContext {
|
|
|
51
50
|
*/
|
|
52
51
|
export interface ToolDefinition<TInput = unknown, TResult = unknown> {
|
|
53
52
|
description: string;
|
|
54
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Model-visible input schema for this tool.
|
|
55
|
+
*
|
|
56
|
+
* When the schema also exposes the Standard Schema `validate()` hook
|
|
57
|
+
* (for example a Zod schema), Ash validates raw tool-call arguments at
|
|
58
|
+
* runtime and passes the parsed/defaulted output into {@link execute}.
|
|
59
|
+
* Plain JSON Schema objects remain supported for declaration-only use.
|
|
60
|
+
*/
|
|
61
|
+
inputSchema?: StandardJSONSchemaV1<unknown, TInput>;
|
|
55
62
|
execute(input: TInput): Promise<TResult> | TResult;
|
|
56
63
|
/**
|
|
57
64
|
* Optional per-tool approval gate. When set, the function's return value
|
|
@@ -85,11 +92,11 @@ export interface ToolDefinition<TInput = unknown, TResult = unknown> {
|
|
|
85
92
|
export declare function defineTool<TSchema extends StandardJSONSchemaV1<unknown, unknown>, TResult>(definition: {
|
|
86
93
|
description: string;
|
|
87
94
|
inputSchema: TSchema;
|
|
88
|
-
execute(input: StandardJSONSchemaV1.
|
|
95
|
+
execute(input: StandardJSONSchemaV1.InferOutput<TSchema>): Promise<TResult> | TResult;
|
|
89
96
|
needsApproval?: (ctx: NeedsApprovalContext) => boolean;
|
|
90
97
|
name?: string;
|
|
91
98
|
onCompact?(input: CompactionHookInput): CompactionHookResult | Promise<CompactionHookResult> | void | Promise<void>;
|
|
92
|
-
}): ToolDefinition<StandardJSONSchemaV1.
|
|
99
|
+
}): ToolDefinition<StandardJSONSchemaV1.InferOutput<TSchema>, TResult>;
|
|
93
100
|
export declare function defineTool<TInput = unknown, TResult = unknown>(definition: ToolDefinition<TInput, TResult>): ToolDefinition<TInput, TResult>;
|
|
94
101
|
/**
|
|
95
102
|
* Marker discriminator written into every {@link DisabledToolSentinel}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/public/definitions/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../src/public/definitions/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACnD;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,OAAO,CAAC;IACvD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,SAAS,CAAC,CACR,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACtD,OAAO,EACP,UAAU,EAAE;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,KAAK,EAAE,oBAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACtF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,OAAO,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,CACR,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF,GAAG,cAAc,CAAC,oBAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACvE,wBAAgB,UAAU,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAC5D,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,GAC1C,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAOnC;;GAEG;AACH,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,2BAA2B,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,IAAI,oBAAoB,CAIlD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAMpF"}
|