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
|
@@ -2,10 +2,7 @@ import { cp, mkdir, rm } from "node:fs/promises";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { BaseBuilder, STEP_QUEUE_TRIGGER, WORKFLOW_QUEUE_TRIGGER } from "@workflow/builders";
|
|
4
4
|
import { resolvePackageSourceDirectoryPath } from "../application/package.js";
|
|
5
|
-
import { writeNitroWorkflowRouteShims } from "./nitro-route-shims.js";
|
|
6
|
-
import { rewriteGeneratedWorkflowImport, rewriteGeneratedWorkflowImports, rewriteGeneratedWorkflowImportsFile, } from "./rewrite-generated-imports.js";
|
|
7
5
|
import { bundleVercelFunctionFromBuildArtifact, prepareVercelFunctionDirectory, WORKFLOW_BUILDER_DEFERRED_PACKAGES, WORKFLOW_STEP_EXTERNAL_PACKAGES, } from "./vercel-workflow-output.js";
|
|
8
|
-
export { rewriteGeneratedWorkflowImport, rewriteGeneratedWorkflowImports };
|
|
9
6
|
/**
|
|
10
7
|
* Builds the package-owned workflow bundles used by the Nitro host.
|
|
11
8
|
*/
|
|
@@ -79,12 +76,10 @@ export class MessageWorkflowBuilder extends BaseBuilder {
|
|
|
79
76
|
},
|
|
80
77
|
},
|
|
81
78
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
rewriteGeneratedWorkflowImportsFile(join(this.#outDir, "workflows.mjs")),
|
|
87
|
-
]);
|
|
79
|
+
// NOTE: Workflow bundles use bare `workflow/*` specifiers. These are
|
|
80
|
+
// resolved by Nitro aliases at build time (prod) and by Node module
|
|
81
|
+
// resolution from the package root at runtime (dev). No import
|
|
82
|
+
// rewriting or route shim files are needed.
|
|
88
83
|
}
|
|
89
84
|
/**
|
|
90
85
|
* Emits standalone Vercel workflow functions so queue-triggered workflow runs
|
|
@@ -128,9 +123,6 @@ export class MessageWorkflowBuilder extends BaseBuilder {
|
|
|
128
123
|
}),
|
|
129
124
|
]);
|
|
130
125
|
await Promise.all([
|
|
131
|
-
rewriteGeneratedWorkflowImportsFile(join(stagedFlowFunctionDir, "index.js")),
|
|
132
|
-
rewriteGeneratedWorkflowImportsFile(join(stagedStepFunctionDir, "index.js")),
|
|
133
|
-
rewriteGeneratedWorkflowImportsFile(join(stagedWebhookFunctionDir, "index.js")),
|
|
134
126
|
this.createPackageJson(stagedFlowFunctionDir, "commonjs"),
|
|
135
127
|
this.createPackageJson(stagedStepFunctionDir, "commonjs"),
|
|
136
128
|
this.createPackageJson(stagedWebhookFunctionDir, "commonjs"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../src/internal/message/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../src/internal/message/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,qCAAqC,EACrC,8BAA8B,EAC9B,kCAAkC,EAClC,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IAC5C,+BAA+B,CAAS;IACxC,OAAO,CAAS;IAEzB,YAAY,OAAsC;QACh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AAE;gBAClB,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE,IAAI;aAChB,CAAC;YACF,EAAE,CAAC,kBAAkB,EAAE;gBACrB,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE,IAAI;aAChB,CAAC;SACH,CAAC,CAAC;QACH,MAAM,KAAK,CAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,EAAE,CAAC,qBAAqB,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YAC/D,EAAE,CAAC,qBAAqB,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YAC/D,EAAE,CAAC,wBAAwB,EAAE,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YACrE,EAAE,CACA,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,EACjD,IAAI,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAC5C;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9C,OAAO,CAAC,GAAG,UAAU,EAAE,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -4,5 +4,7 @@ import type { PreparedApplicationHost } from "./types.js";
|
|
|
4
4
|
* Wires Ash's package-owned health and workflow endpoints into one Nitro
|
|
5
5
|
* host instance, plus one Nitro handler per resolved channel.
|
|
6
6
|
*/
|
|
7
|
-
export declare function configureNitroForMessageHandling(nitro: Nitro, preparedHost: PreparedApplicationHost
|
|
7
|
+
export declare function configureNitroForMessageHandling(nitro: Nitro, preparedHost: PreparedApplicationHost, input: {
|
|
8
|
+
homePageHtml: string;
|
|
9
|
+
}): Promise<void>;
|
|
8
10
|
//# sourceMappingURL=configure-message-routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-message-routes.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/configure-message-routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"configure-message-routes.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/configure-message-routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAezC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AA8L1D;;;GAGG;AACH,wBAAsB,gCAAgC,CACpD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,uBAAuB,EACrC,KAAK,EAAE;IACL,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,OAAO,CAAC,IAAI,CAAC,CA2Gf"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { ASH_HEALTH_ROUTE_PATH, ASH_HOME_ROUTE_PATH } from "../../../protocol/routes.js";
|
|
2
3
|
import { getAllFrameworkChannelNames, getFrameworkChannelDefinitions, } from "../../../runtime/framework-channels/index.js";
|
|
3
4
|
import { resolvePackageRoot, resolvePackageSourceFilePath } from "../../application/package.js";
|
|
4
5
|
import { MessageWorkflowBuilder } from "../../message/builder.js";
|
|
6
|
+
import { WORKFLOW_RUN_EVENTS_ROUTE_PATTERN, WORKFLOW_RUN_ROUTE_PATTERN, WORKFLOW_RUN_STEPS_ROUTE_PATTERN, WORKFLOW_RUNS_API_ROUTE_PATH, } from "../routes/workflow-route-helpers.js";
|
|
5
7
|
function registerHandler(nitro, options) {
|
|
6
8
|
nitro.options.handlers.push({
|
|
7
9
|
handler: options.handlerPath,
|
|
@@ -36,7 +38,7 @@ function computeChannelRouteRegistrations(preparedHost) {
|
|
|
36
38
|
if (!allFrameworkNames.has(entry.name)) {
|
|
37
39
|
// The runtime resolver throws on this case — surface the same
|
|
38
40
|
// problem here so the dev server fails fast on bad disable files.
|
|
39
|
-
throw new Error(`agent/channels/${entry.name}.ts exports
|
|
41
|
+
throw new Error(`agent/channels/${entry.name}.ts exports disableRoute() but "${entry.name}" is not a framework channel. ` +
|
|
40
42
|
`Rename the file to one of: ${[...allFrameworkNames].sort().join(", ")}.`);
|
|
41
43
|
}
|
|
42
44
|
disabledNames.add(entry.name);
|
|
@@ -65,11 +67,72 @@ function computeChannelRouteRegistrations(preparedHost) {
|
|
|
65
67
|
}
|
|
66
68
|
return merged;
|
|
67
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Registers a virtual Nitro handler for one channel route that bakes in the
|
|
72
|
+
* route key (`"METHOD /path"`) and artifacts config so the dispatch function
|
|
73
|
+
* can look up the matching channel and resolve compiled artifacts directly.
|
|
74
|
+
* Nitro's router populates `event.context.params` for parameterized routes,
|
|
75
|
+
* so no custom URL matcher is needed.
|
|
76
|
+
*/
|
|
77
|
+
function addChannelVirtualHandler(nitro, input) {
|
|
78
|
+
const routeKey = `${input.method.toUpperCase()} ${input.route}`;
|
|
79
|
+
const virtualId = `#ash-channel/${routeKey}`;
|
|
80
|
+
const dispatchModulePath = JSON.stringify(resolvePackageSourceFilePath("src/internal/nitro/routes/channel-dispatch.ts"));
|
|
81
|
+
nitro.options.handlers.push({
|
|
82
|
+
handler: virtualId,
|
|
83
|
+
method: input.method,
|
|
84
|
+
route: input.route,
|
|
85
|
+
});
|
|
86
|
+
nitro.options.virtual[virtualId] = [
|
|
87
|
+
`import { dispatchChannelRequest } from ${dispatchModulePath};`,
|
|
88
|
+
`const config = ${JSON.stringify(input.artifactsConfig)};`,
|
|
89
|
+
`export default (event) => dispatchChannelRequest(event, ${JSON.stringify(routeKey)}, config);`,
|
|
90
|
+
].join("\n");
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Registers a virtual Nitro handler that adapts a pre-built workflow bundle's
|
|
94
|
+
* named `POST` export into Nitro's default-export handler contract.
|
|
95
|
+
*
|
|
96
|
+
* Follows the same pattern as `@workflow/nitro`'s `addVirtualHandler` — no
|
|
97
|
+
* physical handler files or generated shims on disk.
|
|
98
|
+
*/
|
|
99
|
+
function addWorkflowVirtualHandler(nitro, input) {
|
|
100
|
+
const virtualId = `#ash-workflow/${input.bundleName}`;
|
|
101
|
+
const bundlePath = JSON.stringify(join(input.buildDir, `${input.bundleName}.mjs`));
|
|
102
|
+
nitro.options.handlers.push({
|
|
103
|
+
handler: virtualId,
|
|
104
|
+
route: input.route,
|
|
105
|
+
});
|
|
106
|
+
nitro.options.virtual[virtualId] = [
|
|
107
|
+
`import ${bundlePath};`,
|
|
108
|
+
`import { POST } from ${bundlePath};`,
|
|
109
|
+
"export default async ({ req }) => {",
|
|
110
|
+
" return await POST(req);",
|
|
111
|
+
"};",
|
|
112
|
+
].join("\n");
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Registers a virtual Nitro handler for a framework route that needs
|
|
116
|
+
* build-time config values (e.g. homePageHtml, appRoot) baked in.
|
|
117
|
+
*/
|
|
118
|
+
function addFrameworkVirtualHandler(nitro, input) {
|
|
119
|
+
const virtualId = `#ash-route${input.route}`;
|
|
120
|
+
const modulePath = JSON.stringify(input.modulePath);
|
|
121
|
+
nitro.options.handlers.push({
|
|
122
|
+
handler: virtualId,
|
|
123
|
+
method: input.method,
|
|
124
|
+
route: input.route,
|
|
125
|
+
});
|
|
126
|
+
nitro.options.virtual[virtualId] = [
|
|
127
|
+
`import { ${input.handlerExport} } from ${modulePath};`,
|
|
128
|
+
`export default () => ${input.handlerExport}(${input.args});`,
|
|
129
|
+
].join("\n");
|
|
130
|
+
}
|
|
68
131
|
/**
|
|
69
132
|
* Wires Ash's package-owned health and workflow endpoints into one Nitro
|
|
70
133
|
* host instance, plus one Nitro handler per resolved channel.
|
|
71
134
|
*/
|
|
72
|
-
export function configureNitroForMessageHandling(nitro, preparedHost) {
|
|
135
|
+
export async function configureNitroForMessageHandling(nitro, preparedHost, input) {
|
|
73
136
|
const packageRoot = resolvePackageRoot();
|
|
74
137
|
const builder = new MessageWorkflowBuilder({
|
|
75
138
|
appRoot: preparedHost.appRoot,
|
|
@@ -79,53 +142,89 @@ export function configureNitroForMessageHandling(nitro, preparedHost) {
|
|
|
79
142
|
watch: nitro.options.dev,
|
|
80
143
|
});
|
|
81
144
|
let isInitialBuild = true;
|
|
145
|
+
await builder.build();
|
|
82
146
|
nitro.hooks.hook("build:before", async () => {
|
|
147
|
+
if (isInitialBuild) {
|
|
148
|
+
isInitialBuild = false;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
83
151
|
await builder.build();
|
|
84
152
|
});
|
|
85
153
|
if (nitro.options.dev) {
|
|
86
154
|
nitro.hooks.hook("dev:reload", async () => {
|
|
87
|
-
if (isInitialBuild) {
|
|
88
|
-
isInitialBuild = false;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
155
|
await builder.build();
|
|
92
156
|
});
|
|
93
157
|
}
|
|
94
|
-
|
|
95
|
-
|
|
158
|
+
const artifactsConfig = {
|
|
159
|
+
appRoot: preparedHost.appRoot,
|
|
160
|
+
dev: nitro.options.dev,
|
|
161
|
+
};
|
|
162
|
+
// Framework routes that need build-time config are registered as virtual
|
|
163
|
+
// handlers so the values are baked in — no global runtime config store.
|
|
164
|
+
addFrameworkVirtualHandler(nitro, {
|
|
165
|
+
args: JSON.stringify({ homePageHtml: input.homePageHtml }),
|
|
166
|
+
handlerExport: "handleHomePageRequest",
|
|
96
167
|
method: "GET",
|
|
168
|
+
modulePath: resolvePackageSourceFilePath("src/internal/nitro/routes/index.ts"),
|
|
97
169
|
route: "/",
|
|
98
170
|
});
|
|
171
|
+
addFrameworkVirtualHandler(nitro, {
|
|
172
|
+
args: JSON.stringify({ appRoot: artifactsConfig.appRoot }),
|
|
173
|
+
handlerExport: "handleHomePageDataRequest",
|
|
174
|
+
method: "GET",
|
|
175
|
+
modulePath: resolvePackageSourceFilePath("src/internal/nitro/routes/home.ts"),
|
|
176
|
+
route: ASH_HOME_ROUTE_PATH,
|
|
177
|
+
});
|
|
178
|
+
// Framework routes that need no config use physical handler files directly.
|
|
99
179
|
registerHandler(nitro, {
|
|
100
180
|
handlerPath: resolvePackageSourceFilePath("src/internal/nitro/routes/health.ts"),
|
|
101
181
|
method: "GET",
|
|
102
|
-
route:
|
|
182
|
+
route: ASH_HEALTH_ROUTE_PATH,
|
|
183
|
+
});
|
|
184
|
+
registerHandler(nitro, {
|
|
185
|
+
handlerPath: resolvePackageSourceFilePath("src/internal/nitro/routes/workflow-runs.ts"),
|
|
186
|
+
method: "GET",
|
|
187
|
+
route: WORKFLOW_RUNS_API_ROUTE_PATH,
|
|
188
|
+
});
|
|
189
|
+
registerHandler(nitro, {
|
|
190
|
+
handlerPath: resolvePackageSourceFilePath("src/internal/nitro/routes/workflow-run.ts"),
|
|
191
|
+
method: "GET",
|
|
192
|
+
route: WORKFLOW_RUN_ROUTE_PATTERN,
|
|
103
193
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
194
|
+
registerHandler(nitro, {
|
|
195
|
+
handlerPath: resolvePackageSourceFilePath("src/internal/nitro/routes/workflow-run-steps.ts"),
|
|
196
|
+
method: "GET",
|
|
197
|
+
route: WORKFLOW_RUN_STEPS_ROUTE_PATTERN,
|
|
198
|
+
});
|
|
199
|
+
registerHandler(nitro, {
|
|
200
|
+
handlerPath: resolvePackageSourceFilePath("src/internal/nitro/routes/workflow-run-events.ts"),
|
|
201
|
+
method: "GET",
|
|
202
|
+
route: WORKFLOW_RUN_EVENTS_ROUTE_PATTERN,
|
|
203
|
+
});
|
|
204
|
+
// Per-channel mounting: one virtual Nitro handler per (method, urlPath) in
|
|
205
|
+
// the merged channel set. Each handler bakes in its route key and artifacts
|
|
206
|
+
// config so the dispatch function can look up the channel and resolve
|
|
207
|
+
// compiled artifacts directly.
|
|
109
208
|
for (const channelRoute of computeChannelRouteRegistrations(preparedHost)) {
|
|
110
|
-
|
|
111
|
-
|
|
209
|
+
addChannelVirtualHandler(nitro, {
|
|
210
|
+
artifactsConfig,
|
|
112
211
|
method: channelRoute.method,
|
|
113
212
|
route: channelRoute.route,
|
|
114
213
|
});
|
|
115
214
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
215
|
+
addWorkflowVirtualHandler(nitro, {
|
|
216
|
+
buildDir: preparedHost.workflowBuildDir,
|
|
217
|
+
bundleName: "webhook",
|
|
119
218
|
route: "/.well-known/workflow/v1/webhook/:token",
|
|
120
219
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
220
|
+
addWorkflowVirtualHandler(nitro, {
|
|
221
|
+
buildDir: preparedHost.workflowBuildDir,
|
|
222
|
+
bundleName: "steps",
|
|
124
223
|
route: "/.well-known/workflow/v1/step",
|
|
125
224
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
225
|
+
addWorkflowVirtualHandler(nitro, {
|
|
226
|
+
buildDir: preparedHost.workflowBuildDir,
|
|
227
|
+
bundleName: "workflows",
|
|
129
228
|
route: "/.well-known/workflow/v1/flow",
|
|
130
229
|
});
|
|
131
230
|
nitro.routing.sync();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-message-routes.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/configure-message-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"configure-message-routes.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/configure-message-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEzF,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,kBAA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file":"create-application-nitro.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/create-application-nitro.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-application-nitro.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/create-application-nitro.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAYzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AA2C1D;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,uBAAuB,EACrC,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,KAAK,CAAC,CAqFhB"}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
import { realpath, writeFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
1
|
import { createNitro } from "nitro/builder";
|
|
4
2
|
import { ASH_PACKAGE_NAME } from "../../../package-name.js";
|
|
3
|
+
import { ASH_HOME_PAGE_UI_ROUTE_PREFIX } from "../../../protocol/routes.js";
|
|
5
4
|
import { registerScheduleTasks } from "../../../runtime/schedules/register.js";
|
|
6
|
-
import { resolvePackageSourceFilePath } from "../../application/package.js";
|
|
5
|
+
import { resolvePackageSourceFilePath, resolveWorkflowModulePath, } from "../../application/package.js";
|
|
7
6
|
import { resolveNitroBuildDirectory } from "../../application/paths.js";
|
|
8
|
-
import { loadHomePageTemplate } from "../routes/home-page/render-home-page.js";
|
|
9
|
-
import { createRuntimeConfigurationPluginSource } from "../shims/runtime-configuration-plugin.js";
|
|
10
7
|
import { createCompiledSandboxBackendPrunePlugin } from "./compiled-sandbox-backend-prune-plugin.js";
|
|
11
8
|
import { configureNitroForMessageHandling } from "./configure-message-routes.js";
|
|
9
|
+
import { loadHomePageWebAssets } from "./load-home-page-web-assets.js";
|
|
10
|
+
/**
|
|
11
|
+
* Bare `workflow/*` specifiers that appear in pre-built workflow bundles.
|
|
12
|
+
* Nitro's alias system resolves these at Rollup build time for production,
|
|
13
|
+
* replacing the import-rewriting post-processing that previously ran after
|
|
14
|
+
* each builder invocation.
|
|
15
|
+
*/
|
|
16
|
+
const WORKFLOW_ALIAS_SPECIFIERS = [
|
|
17
|
+
"workflow",
|
|
18
|
+
"workflow/api",
|
|
19
|
+
"workflow/internal/private",
|
|
20
|
+
"workflow/runtime",
|
|
21
|
+
];
|
|
22
|
+
function resolveWorkflowAliases() {
|
|
23
|
+
const aliases = {};
|
|
24
|
+
for (const specifier of WORKFLOW_ALIAS_SPECIFIERS) {
|
|
25
|
+
aliases[specifier] = resolveWorkflowModulePath(specifier);
|
|
26
|
+
}
|
|
27
|
+
return aliases;
|
|
28
|
+
}
|
|
12
29
|
function resolveNitroPreset(dev) {
|
|
13
30
|
if (!dev && process.env.VERCEL) {
|
|
14
31
|
return "vercel";
|
|
@@ -25,25 +42,12 @@ function collectHostedTraceDependencies(preparedHost) {
|
|
|
25
42
|
]),
|
|
26
43
|
].filter((dependencyName) => dependencyName !== ASH_PACKAGE_NAME);
|
|
27
44
|
}
|
|
28
|
-
async function writeRuntimeConfigurationPlugin(preparedHost, input) {
|
|
29
|
-
const pluginPath = join(preparedHost.compileResult.paths.compileDirectoryPath, "runtime-configuration-plugin.mjs");
|
|
30
|
-
await writeFile(pluginPath, createRuntimeConfigurationPluginSource({
|
|
31
|
-
appRoot: preparedHost.appRoot,
|
|
32
|
-
dev: input.dev,
|
|
33
|
-
homePageTemplate: input.homePageTemplate,
|
|
34
|
-
}));
|
|
35
|
-
return await realpath(pluginPath);
|
|
36
|
-
}
|
|
37
45
|
/**
|
|
38
46
|
* Creates one configured Nitro instance for either production build or dev
|
|
39
47
|
* hosting of an Ash application.
|
|
40
48
|
*/
|
|
41
49
|
export async function createApplicationNitro(preparedHost, dev) {
|
|
42
|
-
const
|
|
43
|
-
const runtimeConfigurationPluginPath = await writeRuntimeConfigurationPlugin(preparedHost, {
|
|
44
|
-
dev,
|
|
45
|
-
homePageTemplate,
|
|
46
|
-
});
|
|
50
|
+
const homePageWebAssets = await loadHomePageWebAssets();
|
|
47
51
|
const scheduleTaskHandlerPath = preparedHost.scheduleRegistrations.length > 0
|
|
48
52
|
? resolvePackageSourceFilePath("src/internal/nitro/routes/schedule-task.ts")
|
|
49
53
|
: null;
|
|
@@ -58,7 +62,8 @@ export async function createApplicationNitro(preparedHost, dev) {
|
|
|
58
62
|
dev,
|
|
59
63
|
logLevel: dev ? 1 : undefined,
|
|
60
64
|
preset,
|
|
61
|
-
plugins: Array.of(
|
|
65
|
+
plugins: Array.of(preparedHost.compiledArtifacts.bootstrapPath),
|
|
66
|
+
publicAssets: createHomePagePublicAssetEntries(homePageWebAssets),
|
|
62
67
|
rolldownConfig: compiledSandboxBackendPrunePlugin === null
|
|
63
68
|
? undefined
|
|
64
69
|
: {
|
|
@@ -77,13 +82,50 @@ export async function createApplicationNitro(preparedHost, dev) {
|
|
|
77
82
|
watch: true,
|
|
78
83
|
}
|
|
79
84
|
: undefined);
|
|
85
|
+
// Resolve bare `workflow/*` specifiers during Nitro's Rollup bundling so
|
|
86
|
+
// pre-built workflow modules (whose imports target Ash's installed copies)
|
|
87
|
+
// resolve correctly in production builds where Node resolution from the
|
|
88
|
+
// workflow cache directory is not available.
|
|
89
|
+
const workflowAliases = resolveWorkflowAliases();
|
|
90
|
+
for (const [specifier, resolvedPath] of Object.entries(workflowAliases)) {
|
|
91
|
+
nitro.options.alias[specifier] = resolvedPath;
|
|
92
|
+
}
|
|
93
|
+
// Prevent Nitro from re-bundling pre-built workflow modules in dev mode.
|
|
94
|
+
// The modules are already processed by MessageWorkflowBuilder and should
|
|
95
|
+
// be loaded as-is at runtime via dynamic import.
|
|
96
|
+
if (dev) {
|
|
97
|
+
const workflowBuildDir = preparedHost.workflowBuildDir;
|
|
98
|
+
nitro.hooks.hook("rollup:before", (_nitro, config) => {
|
|
99
|
+
const existingExternal = config.external;
|
|
100
|
+
config.external = (id, ...rest) => {
|
|
101
|
+
if (id.startsWith(workflowBuildDir)) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (typeof existingExternal === "function") {
|
|
105
|
+
return existingExternal(id, ...rest);
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
}
|
|
80
111
|
if (scheduleTaskHandlerPath !== null) {
|
|
81
112
|
registerScheduleTasks(nitro, {
|
|
82
113
|
handlerPath: scheduleTaskHandlerPath,
|
|
83
114
|
registrations: preparedHost.scheduleRegistrations,
|
|
84
115
|
});
|
|
85
116
|
}
|
|
86
|
-
configureNitroForMessageHandling(nitro, preparedHost
|
|
117
|
+
await configureNitroForMessageHandling(nitro, preparedHost, {
|
|
118
|
+
homePageHtml: homePageWebAssets.homePageHtml,
|
|
119
|
+
});
|
|
87
120
|
return nitro;
|
|
88
121
|
}
|
|
122
|
+
function createHomePagePublicAssetEntries(homePageWebAssets) {
|
|
123
|
+
return [
|
|
124
|
+
{
|
|
125
|
+
baseURL: ASH_HOME_PAGE_UI_ROUTE_PREFIX,
|
|
126
|
+
dir: homePageWebAssets.assetsDirectoryPath,
|
|
127
|
+
maxAge: 60 * 60 * 24 * 365,
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
89
131
|
//# sourceMappingURL=create-application-nitro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-application-nitro.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/create-application-nitro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-application-nitro.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/create-application-nitro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE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CAAC;IACD,MAAM,gCAAgC,CAAC,KAAK,EAAE,YAAY,EAAE;QAC1D,YAAY,EAAE,iBAAiB,CAAC,YAAY;KAC7C,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gCAAgC,CAAC,iBAAoC;IAK5E,OAAO;QACL;YACE,OAAO,EAAE,6BAA6B;YACtC,GAAG,EAAE,iBAAiB,CAAC,mBAAmB;YAC1C,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;SAC3B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built home-page UI assets consumed by the Nitro host.
|
|
3
|
+
*/
|
|
4
|
+
export interface HomePageWebAssets {
|
|
5
|
+
readonly assetsDirectoryPath: string;
|
|
6
|
+
readonly homePageHtml: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolves and reads the built web UI artifacts used by Ash's package-owned
|
|
10
|
+
* home page.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadHomePageWebAssets(): Promise<HomePageWebAssets>;
|
|
13
|
+
//# sourceMappingURL=load-home-page-web-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-home-page-web-assets.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/load-home-page-web-assets.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAWD;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAyBxE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { access, readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { resolvePackageRoot, resolvePackageSourceDirectoryPath, } from "../../application/package.js";
|
|
4
|
+
async function doesPathExist(path) {
|
|
5
|
+
try {
|
|
6
|
+
await access(path);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves and reads the built web UI artifacts used by Ash's package-owned
|
|
15
|
+
* home page.
|
|
16
|
+
*/
|
|
17
|
+
export async function loadHomePageWebAssets() {
|
|
18
|
+
const packageManagedAssetsDirectoryPath = resolvePackageSourceDirectoryPath("src/internal/nitro/routes/web-ui");
|
|
19
|
+
const workspaceAssetsDirectoryPath = join(resolvePackageRoot(), "..", "web", "dist");
|
|
20
|
+
for (const assetsDirectoryPath of [
|
|
21
|
+
packageManagedAssetsDirectoryPath,
|
|
22
|
+
workspaceAssetsDirectoryPath,
|
|
23
|
+
]) {
|
|
24
|
+
const indexHtmlPath = join(assetsDirectoryPath, "index.html");
|
|
25
|
+
if (!(await doesPathExist(indexHtmlPath))) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
assetsDirectoryPath,
|
|
30
|
+
homePageHtml: await readFile(indexHtmlPath, "utf8"),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
throw new Error("Missing built Ash web UI assets. Run `pnpm --filter @ash/web build` and rebuild `experimental-ash`.");
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=load-home-page-web-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-home-page-web-assets.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/load-home-page-web-assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,iCAAiC,GAClC,MAAM,8BAA8B,CAAC;AAUtC,KAAK,UAAU,aAAa,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,MAAM,iCAAiC,GAAG,iCAAiC,CACzE,kCAAkC,CACnC,CAAC;IACF,MAAM,4BAA4B,GAAG,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAErF,KAAK,MAAM,mBAAmB,IAAI;QAChC,iCAAiC;QACjC,4BAA4B;KAC7B,EAAE,CAAC;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;QAE9D,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;YAC1C,SAAS;QACX,CAAC;QAED,OAAO;YACL,mBAAmB;YACnB,YAAY,EAAE,MAAM,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;SACpD,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CACb,qGAAqG,CACtG,CAAC;AACJ,CAAC"}
|
|
@@ -20,7 +20,7 @@ export async function prepareApplicationHost(startPath) {
|
|
|
20
20
|
const workflowBuildDir = resolveWorkflowBuildDirectory(compileResult.project.appRoot);
|
|
21
21
|
const compiledArtifacts = await writeCompiledArtifactsFiles({
|
|
22
22
|
compileResult,
|
|
23
|
-
outDir:
|
|
23
|
+
outDir: compileResult.paths.compileDirectoryPath,
|
|
24
24
|
});
|
|
25
25
|
return {
|
|
26
26
|
appRoot: compileResult.project.appRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-application-host.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/prepare-application-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,+CAA+C,CAAC;AACzG,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAG3E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,SAAiB;IAC5D,MAAM,aAAa,GAAG,MAAM,YAAY,CAAC;QACvC,SAAS;KACV,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,MAAM,6BAA6B,CAAC;QACpD,uBAAuB,EAAE,wCAAwC,CAC/D,aAAa,CAAC,OAAO,CAAC,OAAO,CAC9B;KACF,CAAC,CAAC;IACH,MAAM,qBAAqB,GAAG,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACrE,MAAM,gBAAgB,GAAG,6BAA6B,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtF,MAAM,iBAAiB,GAAG,MAAM,2BAA2B,CAAC;QAC1D,aAAa;QACb,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"prepare-application-host.js","sourceRoot":"","sources":["../../../../../src/internal/nitro/host/prepare-application-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,+CAA+C,CAAC;AACzG,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAG3E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,SAAiB;IAC5D,MAAM,aAAa,GAAG,MAAM,YAAY,CAAC;QACvC,SAAS;KACV,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,MAAM,6BAA6B,CAAC;QACpD,uBAAuB,EAAE,wCAAwC,CAC/D,aAAa,CAAC,OAAO,CAAC,OAAO,CAC9B;KACF,CAAC,CAAC;IACH,MAAM,qBAAqB,GAAG,2BAA2B,CAAC,SAAS,CAAC,CAAC;IACrE,MAAM,gBAAgB,GAAG,6BAA6B,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtF,MAAM,iBAAiB,GAAG,MAAM,2BAA2B,CAAC;QAC1D,aAAa;QACb,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,oBAAoB;KACjD,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO;QACtC,sBAAsB,EAAE,qCAAqC,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC;QAC5F,aAAa;QACb,iBAAiB;QACjB,qBAAqB;QACrB,SAAS;QACT,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import type { H3Event } from "nitro";
|
|
2
|
+
import type { NitroArtifactsConfig } from "./runtime-artifacts.js";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
* channels. Registered N times in `configure-message-routes.ts` — once per
|
|
5
|
-
* channel — but uses the same handler file because Nitro can't pass
|
|
6
|
-
* channel identity into a handler module from the registration site.
|
|
4
|
+
* Dispatches one channel request identified by `routeKey`.
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* params.
|
|
16
|
-
* 4. Calls the matched channel's `fetch` and awaits any pending
|
|
17
|
-
* background tasks before returning the response so serverless
|
|
18
|
-
* invocations stay alive long enough to drive `runtime.run()` to
|
|
19
|
-
* completion.
|
|
6
|
+
* Each channel route is mounted as its own virtual Nitro handler with the
|
|
7
|
+
* route key and artifacts config baked in. Nitro's router matches the URL
|
|
8
|
+
* and populates `event.context.params`, so no custom URL matching is
|
|
9
|
+
* needed — the handler looks up the channel by its `(method, urlPath)` key
|
|
10
|
+
* directly. When routes register background work through `ctx.waitUntil`,
|
|
11
|
+
* Nitro forwards that work to `event.waitUntil()` so webhook
|
|
12
|
+
* acknowledgements can return immediately.
|
|
20
13
|
*/
|
|
21
|
-
declare
|
|
22
|
-
export default _default;
|
|
14
|
+
export declare function dispatchChannelRequest(event: H3Event, routeKey: string, config: NitroArtifactsConfig): Promise<Response>;
|
|
23
15
|
//# sourceMappingURL=channel-dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-dispatch.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/channel-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"channel-dispatch.d.ts","sourceRoot":"","sources":["../../../../../src/internal/nitro/routes/channel-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,QAAQ,CAAC,CAiCnB"}
|