experimental-ash 0.3.0-alpha.36 → 0.3.0-alpha.37
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/{docs → dist/docs}/internals/compiler-and-artifacts.md +1 -1
- package/{docs → dist/docs}/internals/message-runtime.md +0 -1
- package/{docs → dist/docs}/public/README.md +1 -1
- package/{docs → dist/docs}/public/agent-ts.md +1 -1
- package/{docs → dist/docs}/public/channels/README.md +3 -0
- package/dist/docs/public/channels/slack.md +142 -0
- package/{docs → dist/docs}/public/context-control.md +1 -1
- package/{docs → dist/docs}/public/meta.json +1 -1
- package/{docs → dist/docs}/public/project-layout.md +16 -16
- package/{docs → dist/docs}/public/runs-and-streaming.md +1 -4
- package/{docs/public/sandboxes.md → dist/docs/public/sandbox.md} +30 -19
- package/{docs → dist/docs}/public/session-context.md +1 -1
- package/{docs → dist/docs}/public/subagents.md +4 -4
- package/{docs → dist/docs}/public/tools.md +4 -4
- package/{docs → dist/docs}/public/typescript-api.md +6 -7
- package/{docs → dist/docs}/public/vercel-deployment.md +2 -2
- package/{docs → dist/docs}/public/workspace.md +3 -3
- package/dist/src/chunks/chunk-2BCVGULU.js +37 -0
- package/dist/src/chunks/chunk-2BCVGULU.js.map +7 -0
- package/dist/src/chunks/chunk-2R4UWV4G.js +592 -0
- package/dist/src/chunks/chunk-2R4UWV4G.js.map +7 -0
- package/dist/src/chunks/chunk-35LANRWR.js +87 -0
- package/dist/src/chunks/chunk-35LANRWR.js.map +7 -0
- package/dist/src/chunks/chunk-3G5VE3NT.js +3480 -0
- package/dist/src/chunks/chunk-3G5VE3NT.js.map +7 -0
- package/dist/src/chunks/chunk-3PI3EJGN.js +48 -0
- package/dist/src/chunks/chunk-3PI3EJGN.js.map +7 -0
- package/dist/src/chunks/chunk-5DCBVGNU.js +61 -0
- package/dist/src/chunks/chunk-5DCBVGNU.js.map +7 -0
- package/dist/src/chunks/chunk-5MZKUEVL.js +106 -0
- package/dist/src/chunks/chunk-5MZKUEVL.js.map +7 -0
- package/dist/src/chunks/chunk-5QAWKFQA.js +134 -0
- package/dist/src/chunks/chunk-5QAWKFQA.js.map +7 -0
- package/dist/src/chunks/chunk-A7Q4YIKU.js +203 -0
- package/dist/src/chunks/chunk-A7Q4YIKU.js.map +7 -0
- package/dist/src/chunks/chunk-AFK4DTZH.js +35 -0
- package/dist/src/chunks/chunk-AFK4DTZH.js.map +7 -0
- package/dist/src/chunks/chunk-AL5YANUC.js +89 -0
- package/dist/src/chunks/chunk-AL5YANUC.js.map +7 -0
- package/dist/src/chunks/chunk-APDYQG3O.js +15 -0
- package/dist/src/chunks/chunk-APDYQG3O.js.map +7 -0
- package/dist/src/chunks/chunk-BMHAGZOU.js +35 -0
- package/dist/src/chunks/chunk-BMHAGZOU.js.map +7 -0
- package/dist/src/chunks/chunk-DB7AV7FN.js +44 -0
- package/dist/src/chunks/chunk-DB7AV7FN.js.map +7 -0
- package/dist/src/chunks/chunk-E7IAIRUB.js +169 -0
- package/dist/src/chunks/chunk-E7IAIRUB.js.map +7 -0
- package/dist/src/chunks/chunk-GJL2PGSX.js +61 -0
- package/dist/src/chunks/chunk-GJL2PGSX.js.map +7 -0
- package/dist/src/chunks/chunk-HDY67XYG.js +34344 -0
- package/dist/src/chunks/chunk-HDY67XYG.js.map +7 -0
- package/dist/src/chunks/chunk-IJXFNYAN.js +193 -0
- package/dist/src/chunks/chunk-IJXFNYAN.js.map +7 -0
- package/dist/src/chunks/chunk-IM3GMMPU.js +29 -0
- package/dist/src/chunks/chunk-IM3GMMPU.js.map +7 -0
- package/dist/src/chunks/chunk-KCXGTLFG.js +229 -0
- package/dist/src/chunks/chunk-KCXGTLFG.js.map +7 -0
- package/dist/src/chunks/chunk-LCRB4QVX.js +27 -0
- package/dist/src/chunks/chunk-LCRB4QVX.js.map +7 -0
- package/dist/src/chunks/chunk-LHXJBQL7.js +71 -0
- package/dist/src/chunks/chunk-LHXJBQL7.js.map +7 -0
- package/dist/src/chunks/chunk-OOUH2UZR.js +546 -0
- package/dist/src/chunks/chunk-OOUH2UZR.js.map +7 -0
- package/dist/src/chunks/chunk-OR2PYMRV.js +35 -0
- package/dist/src/chunks/chunk-OR2PYMRV.js.map +7 -0
- package/dist/src/chunks/chunk-P22MMFUP.js +33 -0
- package/dist/src/chunks/chunk-P22MMFUP.js.map +7 -0
- package/dist/src/chunks/chunk-QP35EBQ7.js +131 -0
- package/dist/src/chunks/chunk-QP35EBQ7.js.map +7 -0
- package/dist/src/chunks/chunk-QUZBDAM5.js +76 -0
- package/dist/src/chunks/chunk-QUZBDAM5.js.map +7 -0
- package/dist/src/chunks/chunk-SILEFYT3.js +119 -0
- package/dist/src/chunks/chunk-SILEFYT3.js.map +7 -0
- package/dist/src/chunks/chunk-SQI7OWK2.js +184 -0
- package/dist/src/chunks/chunk-SQI7OWK2.js.map +7 -0
- package/dist/src/chunks/chunk-TY5REWC3.js +44 -0
- package/dist/src/chunks/chunk-TY5REWC3.js.map +7 -0
- package/dist/src/chunks/chunk-UQPZY6ZZ.js +3493 -0
- package/dist/src/chunks/chunk-UQPZY6ZZ.js.map +7 -0
- package/dist/src/chunks/chunk-V3ZR2VJX.js +81 -0
- package/dist/src/chunks/chunk-V3ZR2VJX.js.map +7 -0
- package/dist/src/chunks/chunk-VAOZLYCZ.js +738 -0
- package/dist/src/chunks/chunk-VAOZLYCZ.js.map +7 -0
- package/dist/src/chunks/chunk-XIS5VWUF.js +16 -0
- package/dist/src/chunks/chunk-XIS5VWUF.js.map +7 -0
- package/dist/src/chunks/chunk-XQMYWUU7.js +9726 -0
- package/dist/src/chunks/chunk-XQMYWUU7.js.map +7 -0
- package/dist/src/chunks/chunk-XZHB5N7B.js +2362 -0
- package/dist/src/chunks/chunk-XZHB5N7B.js.map +7 -0
- package/dist/src/chunks/chunk-YTRI464Y.js +15 -0
- package/dist/src/chunks/chunk-YTRI464Y.js.map +7 -0
- package/dist/src/chunks/chunk-ZCQU2IQJ.js +85 -0
- package/dist/src/chunks/chunk-ZCQU2IQJ.js.map +7 -0
- package/dist/src/chunks/dev-authored-source-watcher-Y56KM4VR.js +2968 -0
- package/dist/src/chunks/dev-authored-source-watcher-Y56KM4VR.js.map +7 -0
- package/dist/src/chunks/host-VLLCUGVL.js +20 -0
- package/dist/src/chunks/host-VLLCUGVL.js.map +7 -0
- package/dist/src/chunks/token-APS2CB5L.js +71 -0
- package/dist/src/chunks/token-APS2CB5L.js.map +7 -0
- package/dist/src/chunks/token-util-5UM65FIP.js +7 -0
- package/dist/src/chunks/token-util-5UM65FIP.js.map +7 -0
- package/dist/src/cli/commands/info.js +228 -160
- package/dist/src/cli/commands/info.js.map +7 -1
- package/dist/src/cli/commands/init.js +94 -76
- package/dist/src/cli/commands/init.js.map +7 -1
- package/dist/src/cli/dev/environment.js +12 -32
- package/dist/src/cli/dev/environment.js.map +7 -1
- package/dist/src/cli/dev/input-requests.js +15 -165
- package/dist/src/cli/dev/input-requests.js.map +7 -1
- package/dist/src/cli/dev/input.js +9 -31
- package/dist/src/cli/dev/input.js.map +7 -1
- package/dist/src/cli/dev/repl.d.ts.map +1 -1
- package/dist/src/cli/dev/repl.js +1049 -937
- package/dist/src/cli/dev/repl.js.map +7 -1
- package/dist/src/cli/dev/terminal.js +9 -180
- package/dist/src/cli/dev/terminal.js.map +7 -1
- package/dist/src/cli/dev/url.js +9 -27
- package/dist/src/cli/dev/url.js.map +7 -1
- package/dist/src/cli/run.js +217 -228
- package/dist/src/cli/run.js.map +7 -1
- package/dist/src/cli/templates/init-app/agent/agent.ts +1 -1
- package/dist/src/cli/templates/init-app/agent/system.md +1 -1
- package/dist/src/cli/templates/init-app/agent/tools/hello.ts +12 -0
- package/dist/src/cli/templates/init-app/package.json +1 -0
- package/dist/src/cli/ui/output.js +18 -93
- package/dist/src/cli/ui/output.js.map +7 -1
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/client/index.d.ts.map +1 -1
- package/dist/src/client/index.js.map +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +2 -2
- package/dist/src/compiler/compile-from-memory.d.ts.map +1 -1
- package/dist/src/compiler/compile-from-memory.js +2 -3
- package/dist/src/compiler/compile-from-memory.js.map +1 -1
- package/dist/src/compiler/manifest.d.ts +5 -12
- package/dist/src/compiler/manifest.d.ts.map +1 -1
- package/dist/src/compiler/manifest.js +3 -5
- package/dist/src/compiler/manifest.js.map +1 -1
- package/dist/src/compiler/model-catalog.d.ts.map +1 -1
- package/dist/src/compiler/model-catalog.js +7 -0
- package/dist/src/compiler/model-catalog.js.map +1 -1
- package/dist/src/compiler/module-map.js +5 -5
- package/dist/src/compiler/module-map.js.map +1 -1
- package/dist/src/compiler/normalize-agent-config.d.ts +11 -0
- package/dist/src/compiler/normalize-agent-config.d.ts.map +1 -1
- package/dist/src/compiler/normalize-agent-config.js +20 -2
- package/dist/src/compiler/normalize-agent-config.js.map +1 -1
- package/dist/src/compiler/normalize-manifest.js +3 -2
- package/dist/src/compiler/normalize-manifest.js.map +1 -1
- package/dist/src/compiler/normalize-sandbox.d.ts.map +1 -1
- package/dist/src/compiler/normalize-sandbox.js +0 -1
- package/dist/src/compiler/normalize-sandbox.js.map +1 -1
- package/dist/src/compiler/rich-model-catalog.d.ts +40 -0
- package/dist/src/compiler/rich-model-catalog.d.ts.map +1 -0
- package/dist/src/compiler/rich-model-catalog.js +66 -0
- package/dist/src/compiler/rich-model-catalog.js.map +1 -0
- package/dist/src/context/providers/sandbox.js +2 -2
- package/dist/src/context/providers/sandbox.js.map +1 -1
- package/dist/src/discover/discover-agent.d.ts +3 -3
- package/dist/src/discover/discover-agent.d.ts.map +1 -1
- package/dist/src/discover/discover-agent.js +5 -5
- package/dist/src/discover/discover-agent.js.map +1 -1
- package/dist/src/discover/discover-subagent.js +2 -2
- package/dist/src/discover/discover-subagent.js.map +1 -1
- package/dist/src/discover/filesystem.d.ts +2 -2
- package/dist/src/discover/filesystem.d.ts.map +1 -1
- package/dist/src/discover/filesystem.js +2 -2
- package/dist/src/discover/filesystem.js.map +1 -1
- package/dist/src/discover/grammar.d.ts +2 -2
- package/dist/src/discover/grammar.d.ts.map +1 -1
- package/dist/src/discover/grammar.js +2 -2
- package/dist/src/discover/grammar.js.map +1 -1
- package/dist/src/discover/manifest.d.ts +15 -33
- package/dist/src/discover/manifest.d.ts.map +1 -1
- package/dist/src/discover/manifest.js +2 -11
- package/dist/src/discover/manifest.js.map +1 -1
- package/dist/src/discover/{sandboxes.d.ts → sandbox.d.ts} +7 -2
- package/dist/src/discover/sandbox.d.ts.map +1 -0
- package/dist/src/discover/{sandboxes.js → sandbox.js} +55 -19
- package/dist/src/discover/sandbox.js.map +1 -0
- package/dist/src/evals/cli/eval.js +168 -183
- package/dist/src/evals/cli/eval.js.map +7 -1
- package/dist/src/evals/define-eval-suite.js +9 -44
- package/dist/src/evals/define-eval-suite.js.map +7 -1
- package/dist/src/evals/index.js +9 -5
- package/dist/src/evals/index.js.map +7 -1
- package/dist/src/evals/loaders/index.js +20 -27
- package/dist/src/evals/loaders/index.js.map +7 -1
- package/dist/src/evals/loaders/json.js +9 -19
- package/dist/src/evals/loaders/json.js.map +7 -1
- package/dist/src/evals/loaders/yaml.js +10 -26
- package/dist/src/evals/loaders/yaml.js.map +7 -1
- package/dist/src/evals/reporters/index.js +14 -14
- package/dist/src/evals/reporters/index.js.map +7 -1
- package/dist/src/evals/runner/artifacts.js +11 -84
- package/dist/src/evals/runner/artifacts.js.map +7 -1
- package/dist/src/evals/runner/derive-run-facts.js +9 -60
- package/dist/src/evals/runner/derive-run-facts.js.map +7 -1
- package/dist/src/evals/runner/discover.js +14 -82
- package/dist/src/evals/runner/discover.js.map +7 -1
- package/dist/src/evals/runner/execute-case.js +10 -89
- package/dist/src/evals/runner/execute-case.js.map +7 -1
- package/dist/src/evals/runner/execute-suite.js +14 -129
- package/dist/src/evals/runner/execute-suite.js.map +7 -1
- package/dist/src/evals/runner/reporters/braintrust.js +10 -141
- package/dist/src/evals/runner/reporters/braintrust.js.map +7 -1
- package/dist/src/evals/runner/reporters/console.js +10 -116
- package/dist/src/evals/runner/reporters/console.js.map +7 -1
- package/dist/src/evals/runner/reporters/types.js +2 -2
- package/dist/src/evals/runner/reporters/types.js.map +7 -1
- package/dist/src/evals/runner/resolve-git-metadata.js +9 -33
- package/dist/src/evals/runner/resolve-git-metadata.js.map +7 -1
- package/dist/src/evals/scorers/autoevals-client.js +10 -88
- package/dist/src/evals/scorers/autoevals-client.js.map +7 -1
- package/dist/src/evals/scorers/autoevals.js +18 -75
- package/dist/src/evals/scorers/autoevals.js.map +7 -1
- package/dist/src/evals/scorers/json.js +9 -32
- package/dist/src/evals/scorers/json.js.map +7 -1
- package/dist/src/evals/scorers/run.js +15 -53
- package/dist/src/evals/scorers/run.js.map +7 -1
- package/dist/src/evals/scorers/sql.js +9 -35
- package/dist/src/evals/scorers/sql.js.map +7 -1
- package/dist/src/evals/scorers/text.js +14 -40
- package/dist/src/evals/scorers/text.js.map +7 -1
- package/dist/src/evals/scores/index.js +35 -72
- package/dist/src/evals/scores/index.js.map +7 -1
- package/dist/src/evals/types.js +2 -2
- package/dist/src/evals/types.js.map +7 -1
- package/dist/src/execution/sandbox/bash-tool.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/bash-tool.js +2 -2
- package/dist/src/execution/sandbox/bash-tool.js.map +1 -0
- package/dist/src/execution/sandbox/bindings/local.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/bindings/local.js +3 -4
- package/dist/src/execution/sandbox/bindings/local.js.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/bindings/vercel.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/bindings/vercel.js +3 -4
- package/dist/src/execution/sandbox/bindings/vercel.js.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/ensure.d.ts +13 -15
- package/dist/src/execution/sandbox/ensure.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/ensure.js +36 -49
- package/dist/src/execution/sandbox/ensure.js.map +1 -0
- package/dist/src/execution/sandbox/glob-tool.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/glob-tool.js +4 -4
- package/dist/src/execution/sandbox/glob-tool.js.map +1 -0
- package/dist/src/execution/sandbox/grep-tool.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/grep-tool.js +4 -4
- package/dist/src/execution/sandbox/grep-tool.js.map +1 -0
- package/dist/src/execution/sandbox/prewarm.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/prewarm.js +59 -49
- package/dist/src/execution/sandbox/prewarm.js.map +1 -0
- package/dist/src/execution/sandbox/read-file-tool.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/read-file-tool.js +2 -2
- package/dist/src/execution/sandbox/read-file-tool.js.map +1 -0
- package/dist/src/execution/sandbox/require-sandbox.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/require-sandbox.js +3 -3
- package/dist/src/execution/sandbox/require-sandbox.js.map +1 -0
- package/dist/src/execution/sandbox/ripgrep-probe.d.ts.map +1 -0
- package/dist/src/execution/sandbox/ripgrep-probe.js.map +1 -0
- package/dist/src/execution/sandbox/session.d.ts.map +1 -0
- package/dist/src/execution/sandbox/session.js.map +1 -0
- package/dist/src/execution/sandbox/shell-quote.d.ts.map +1 -0
- package/dist/src/execution/sandbox/shell-quote.js.map +1 -0
- package/dist/src/execution/sandbox/truncate-output.d.ts.map +1 -0
- package/dist/src/execution/sandbox/truncate-output.js.map +1 -0
- package/dist/src/execution/sandbox/write-file-tool.d.ts.map +1 -0
- package/dist/src/execution/{sandboxes → sandbox}/write-file-tool.js +1 -1
- package/dist/src/execution/sandbox/write-file-tool.js.map +1 -0
- package/dist/src/execution/web-fetch/tool.js +1 -1
- package/dist/src/execution/web-fetch/tool.js.map +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.d.ts.map +1 -1
- package/dist/src/internal/authored-definition/core.js +3 -0
- package/dist/src/internal/authored-definition/core.js.map +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts.map +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +4 -3
- package/dist/src/internal/authored-definition/schema-backed.js.map +1 -1
- package/dist/src/internal/authored-module-loader.js +11 -1
- package/dist/src/internal/authored-module-loader.js.map +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-application.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 +2 -0
- package/dist/src/internal/nitro/host/create-application-nitro.js.map +1 -1
- package/dist/src/internal/nitro/host/{prewarm-vercel-sandboxes.d.ts → prewarm-vercel-sandbox.d.ts} +2 -2
- package/dist/src/internal/nitro/host/prewarm-vercel-sandbox.d.ts.map +1 -0
- package/dist/src/internal/nitro/host/{prewarm-vercel-sandboxes.js → prewarm-vercel-sandbox.js} +2 -2
- package/dist/src/internal/nitro/host/prewarm-vercel-sandbox.js.map +1 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +9 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts.map +1 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +15 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.js.map +1 -0
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts +1 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.d.ts.map +1 -1
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js +20 -19
- package/dist/src/internal/nitro/routes/home-page/build-home-page-response.js.map +1 -1
- package/dist/src/internal/nitro/routes/web-ui/assets/{index-BEQWswDI.js → index-BNNLLyx5.js} +3 -3
- package/dist/src/internal/nitro/routes/web-ui/index.html +1 -1
- package/dist/src/internal/runtime-model.d.ts +2 -8
- package/dist/src/internal/runtime-model.d.ts.map +1 -1
- package/dist/src/internal/runtime-model.js +1 -10
- package/dist/src/internal/runtime-model.js.map +1 -1
- package/dist/src/protocol/message.d.ts +1 -41
- package/dist/src/protocol/message.d.ts.map +1 -1
- package/dist/src/protocol/message.js.map +1 -1
- package/dist/src/public/definitions/sandbox-backend.d.ts +0 -2
- package/dist/src/public/definitions/sandbox-backend.d.ts.map +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +6 -3
- package/dist/src/public/definitions/sandbox.d.ts.map +1 -1
- package/dist/src/public/definitions/sandbox.js.map +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts.map +1 -0
- package/dist/src/public/{sandboxes → sandbox}/backends/default.js +2 -2
- package/dist/src/public/sandbox/backends/default.js.map +1 -0
- package/dist/src/public/sandbox/backends/local.d.ts.map +1 -0
- package/dist/src/public/{sandboxes → sandbox}/backends/local.js +1 -1
- package/dist/src/public/sandbox/backends/local.js.map +1 -0
- package/dist/src/public/{sandboxes → sandbox}/backends/vercel.d.ts +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts.map +1 -0
- package/dist/src/public/{sandboxes → sandbox}/backends/vercel.js +1 -1
- package/dist/src/public/sandbox/backends/vercel.js.map +1 -0
- package/dist/src/public/{sandboxes → sandbox}/index.d.ts +5 -4
- package/dist/src/public/sandbox/index.d.ts.map +1 -0
- package/dist/src/public/sandbox/index.js +10 -0
- package/dist/src/public/sandbox/index.js.map +1 -0
- package/dist/src/public/tools/define-bash-tool.js +1 -1
- package/dist/src/public/tools/define-bash-tool.js.map +1 -1
- package/dist/src/public/tools/define-glob-tool.js +1 -1
- package/dist/src/public/tools/define-glob-tool.js.map +1 -1
- package/dist/src/public/tools/define-grep-tool.js +1 -1
- package/dist/src/public/tools/define-grep-tool.js.map +1 -1
- package/dist/src/public/tools/define-read-file-tool.d.ts.map +1 -1
- package/dist/src/public/tools/define-read-file-tool.js +1 -1
- package/dist/src/public/tools/define-read-file-tool.js.map +1 -1
- package/dist/src/public/tools/define-write-file-tool.js +1 -1
- package/dist/src/public/tools/define-write-file-tool.js.map +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +0 -2
- package/dist/src/runtime/agent/bootstrap.d.ts.map +1 -1
- package/dist/src/runtime/agent/bootstrap.js +0 -2
- package/dist/src/runtime/agent/bootstrap.js.map +1 -1
- package/dist/src/runtime/framework-tools/bash.js +1 -1
- package/dist/src/runtime/framework-tools/bash.js.map +1 -1
- package/dist/src/runtime/framework-tools/glob.js +1 -1
- package/dist/src/runtime/framework-tools/glob.js.map +1 -1
- package/dist/src/runtime/framework-tools/grep.js +1 -1
- package/dist/src/runtime/framework-tools/grep.js.map +1 -1
- package/dist/src/runtime/framework-tools/read-file.d.ts.map +1 -1
- package/dist/src/runtime/framework-tools/read-file.js +1 -1
- package/dist/src/runtime/framework-tools/read-file.js.map +1 -1
- package/dist/src/runtime/framework-tools/write-file.js +1 -1
- package/dist/src/runtime/framework-tools/write-file.js.map +1 -1
- package/dist/src/runtime/graph.d.ts +1 -1
- package/dist/src/runtime/graph.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent-graph.d.ts.map +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +4 -5
- 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 +28 -35
- package/dist/src/runtime/resolve-agent.js.map +1 -1
- package/dist/src/runtime/resolve-sandbox.d.ts.map +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -2
- package/dist/src/runtime/resolve-sandbox.js.map +1 -1
- package/dist/src/runtime/{sandboxes → sandbox}/keys.d.ts +3 -6
- package/dist/src/runtime/sandbox/keys.d.ts.map +1 -0
- package/dist/src/runtime/{sandboxes → sandbox}/keys.js +6 -7
- package/dist/src/runtime/sandbox/keys.js.map +1 -0
- package/dist/src/runtime/sandbox/registry.d.ts +61 -0
- package/dist/src/runtime/sandbox/registry.d.ts.map +1 -0
- package/dist/src/runtime/sandbox/registry.js +43 -0
- package/dist/src/runtime/sandbox/registry.js.map +1 -0
- package/dist/src/runtime/types.d.ts +13 -13
- package/dist/src/runtime/types.d.ts.map +1 -1
- package/dist/src/sandbox/state.d.ts +8 -6
- package/dist/src/sandbox/state.d.ts.map +1 -1
- package/dist/src/services/inspect-application.d.ts.map +1 -1
- package/dist/src/services/inspect-application.js +8 -0
- package/dist/src/services/inspect-application.js.map +1 -1
- package/dist/src/shared/agent-definition.d.ts +1 -1
- package/dist/src/shared/agent-definition.d.ts.map +1 -1
- package/dist/src/shared/subagent-definition.d.ts +1 -1
- package/dist/src/shared/subagent-definition.d.ts.map +1 -1
- package/package.json +21 -26
- package/dist/src/cli/templates/init-app/agent/tools/get_weather.ts +0 -14
- package/dist/src/discover/sandboxes.d.ts.map +0 -1
- package/dist/src/discover/sandboxes.js.map +0 -1
- package/dist/src/execution/sandboxes/bash-tool.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/bash-tool.js.map +0 -1
- package/dist/src/execution/sandboxes/bindings/local.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/bindings/local.js.map +0 -1
- package/dist/src/execution/sandboxes/bindings/vercel.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/bindings/vercel.js.map +0 -1
- package/dist/src/execution/sandboxes/ensure.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/ensure.js.map +0 -1
- package/dist/src/execution/sandboxes/glob-tool.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/glob-tool.js.map +0 -1
- package/dist/src/execution/sandboxes/grep-tool.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/grep-tool.js.map +0 -1
- package/dist/src/execution/sandboxes/prewarm.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/prewarm.js.map +0 -1
- package/dist/src/execution/sandboxes/read-file-tool.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/read-file-tool.js.map +0 -1
- package/dist/src/execution/sandboxes/require-sandbox.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/require-sandbox.js.map +0 -1
- package/dist/src/execution/sandboxes/ripgrep-probe.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/ripgrep-probe.js.map +0 -1
- package/dist/src/execution/sandboxes/session.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/session.js.map +0 -1
- package/dist/src/execution/sandboxes/shell-quote.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/shell-quote.js.map +0 -1
- package/dist/src/execution/sandboxes/truncate-output.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/truncate-output.js.map +0 -1
- package/dist/src/execution/sandboxes/write-file-tool.d.ts.map +0 -1
- package/dist/src/execution/sandboxes/write-file-tool.js.map +0 -1
- package/dist/src/internal/nitro/host/prewarm-vercel-sandboxes.d.ts.map +0 -1
- package/dist/src/internal/nitro/host/prewarm-vercel-sandboxes.js.map +0 -1
- package/dist/src/public/sandboxes/backends/default.d.ts.map +0 -1
- package/dist/src/public/sandboxes/backends/default.js.map +0 -1
- package/dist/src/public/sandboxes/backends/local.d.ts.map +0 -1
- package/dist/src/public/sandboxes/backends/local.js.map +0 -1
- package/dist/src/public/sandboxes/backends/vercel.d.ts.map +0 -1
- package/dist/src/public/sandboxes/backends/vercel.js.map +0 -1
- package/dist/src/public/sandboxes/defaults.d.ts +0 -12
- package/dist/src/public/sandboxes/defaults.d.ts.map +0 -1
- package/dist/src/public/sandboxes/defaults.js +0 -17
- package/dist/src/public/sandboxes/defaults.js.map +0 -1
- package/dist/src/public/sandboxes/index.d.ts.map +0 -1
- package/dist/src/public/sandboxes/index.js +0 -9
- package/dist/src/public/sandboxes/index.js.map +0 -1
- package/dist/src/public/sandboxes/internal.d.ts +0 -14
- package/dist/src/public/sandboxes/internal.d.ts.map +0 -1
- package/dist/src/public/sandboxes/internal.js +0 -25
- package/dist/src/public/sandboxes/internal.js.map +0 -1
- package/dist/src/runtime/framework-sandboxes/default.d.ts +0 -29
- package/dist/src/runtime/framework-sandboxes/default.d.ts.map +0 -1
- package/dist/src/runtime/framework-sandboxes/default.js +0 -37
- package/dist/src/runtime/framework-sandboxes/default.js.map +0 -1
- package/dist/src/runtime/framework-sandboxes/index.d.ts +0 -2
- package/dist/src/runtime/framework-sandboxes/index.d.ts.map +0 -1
- package/dist/src/runtime/framework-sandboxes/index.js +0 -2
- package/dist/src/runtime/framework-sandboxes/index.js.map +0 -1
- package/dist/src/runtime/sandboxes/keys.d.ts.map +0 -1
- package/dist/src/runtime/sandboxes/keys.js.map +0 -1
- package/dist/src/runtime/sandboxes/registry.d.ts +0 -40
- package/dist/src/runtime/sandboxes/registry.d.ts.map +0 -1
- package/dist/src/runtime/sandboxes/registry.js +0 -41
- package/dist/src/runtime/sandboxes/registry.js.map +0 -1
- /package/{docs → dist/docs}/external-agent-protocol.md +0 -0
- /package/{docs → dist/docs}/internals/README.md +0 -0
- /package/{docs → dist/docs}/internals/context.md +0 -0
- /package/{docs → dist/docs}/internals/core-beliefs.md +0 -0
- /package/{docs → dist/docs}/internals/discovery.md +0 -0
- /package/{docs → dist/docs}/internals/hooks.md +0 -0
- /package/{docs → dist/docs}/internals/mechanical-invariants.md +0 -0
- /package/{docs → dist/docs}/internals/testing.md +0 -0
- /package/{docs → dist/docs}/public/auth-and-route-protection.md +0 -0
- /package/{docs → dist/docs}/public/channels/attachments.md +0 -0
- /package/{docs → dist/docs}/public/cli-build-and-debugging.md +0 -0
- /package/{docs → dist/docs}/public/connections.md +0 -0
- /package/{docs → dist/docs}/public/evals.md +0 -0
- /package/{docs → dist/docs}/public/getting-started.md +0 -0
- /package/{docs → dist/docs}/public/hooks.md +0 -0
- /package/{docs → dist/docs}/public/human-in-the-loop.md +0 -0
- /package/{docs → dist/docs}/public/instrumentation.md +0 -0
- /package/{docs → dist/docs}/public/schedules.md +0 -0
- /package/{docs → dist/docs}/public/skills.md +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/bash-tool.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/bindings/local.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/glob-tool.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/grep-tool.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/prewarm.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/read-file-tool.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/require-sandbox.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/ripgrep-probe.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/ripgrep-probe.js +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/session.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/session.js +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/shell-quote.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/shell-quote.js +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/truncate-output.d.ts +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/truncate-output.js +0 -0
- /package/dist/src/execution/{sandboxes → sandbox}/write-file-tool.d.ts +0 -0
- /package/dist/src/public/{sandboxes → sandbox}/backends/default.d.ts +0 -0
- /package/dist/src/public/{sandboxes → sandbox}/backends/local.d.ts +0 -0
|
@@ -31,7 +31,7 @@ Discovery avoids executing authored code. The module map is the handoff — it s
|
|
|
31
31
|
|
|
32
32
|
## Key Artifacts
|
|
33
33
|
|
|
34
|
-
**`compiled-agent-manifest.json`** — the normalized runtime-facing manifest. Preserves config, prompt, skill, sandbox, schedule, and tool metadata; flattened subagent nodes with explicit `subagentEdges`; manifest kind and version. `
|
|
34
|
+
**`compiled-agent-manifest.json`** — the normalized runtime-facing manifest. Preserves config, prompt, skill, sandbox, schedule, and tool metadata; flattened subagent nodes with explicit `subagentEdges`; manifest kind and version. `sandbox` is `null` or one entry, and `sandboxWorkspaces` is an array of size 0 or 1 (single-sandbox model).
|
|
35
35
|
|
|
36
36
|
**`compile-metadata.json`** — artifact paths, SHA-256 digests, diagnostics summary, compile status, generator version, and `sourceGraphHash`. The `sourceGraphHash` drives sandbox template cache invalidation — runtime and Vercel build-time prewarm both derive template keys from it.
|
|
37
37
|
|
|
@@ -35,7 +35,6 @@ session.started → turn.started → step.started →
|
|
|
35
35
|
message.appended / reasoning.appended →
|
|
36
36
|
actions.requested → action.result →
|
|
37
37
|
subagent.called / subagent.completed →
|
|
38
|
-
sandbox.initialized / sandbox.restored / sandbox.command →
|
|
39
38
|
step.completed → turn.completed → session.waiting / session.completed
|
|
40
39
|
```
|
|
41
40
|
|
|
@@ -24,7 +24,7 @@ Read in this order:
|
|
|
24
24
|
7. [tools.md](./tools.md)
|
|
25
25
|
8. [connections.md](./connections.md)
|
|
26
26
|
9. [workspace.md](./workspace.md)
|
|
27
|
-
10. [
|
|
27
|
+
10. [sandbox.md](./sandbox.md)
|
|
28
28
|
11. [channels/README.md](./channels/README.md)
|
|
29
29
|
12. [human-in-the-loop.md](./human-in-the-loop.md)
|
|
30
30
|
13. [session-context.md](./session-context.md)
|
|
@@ -123,7 +123,7 @@ server output instead of being bundled.
|
|
|
123
123
|
- `model` optionally overrides the model used for compaction summaries
|
|
124
124
|
|
|
125
125
|
The shared per-run workspace is configured on the sandbox, not on `agent.ts`. See
|
|
126
|
-
[`workspace.md`](./workspace.md) and [`
|
|
126
|
+
[`workspace.md`](./workspace.md) and [`sandbox.md`](./sandbox.md).
|
|
127
127
|
|
|
128
128
|
## `humanInTheLoop`
|
|
129
129
|
|
|
@@ -84,6 +84,8 @@ export default httpRoute({
|
|
|
84
84
|
## Slack And Other Authored Channels
|
|
85
85
|
|
|
86
86
|
Authored channels can wrap those helpers or build custom transport flows with `defineRoute(...)`.
|
|
87
|
+
For a Slack app backed by Vercel Connex, start with
|
|
88
|
+
[`./slack.md`](./slack.md) to create the Connex client and channel file.
|
|
87
89
|
|
|
88
90
|
Use a custom adapter when you want:
|
|
89
91
|
|
|
@@ -200,6 +202,7 @@ See [`./attachments.md`](./attachments.md) for the authoring guide.
|
|
|
200
202
|
|
|
201
203
|
## What To Read Next
|
|
202
204
|
|
|
205
|
+
- [`./slack.md`](./slack.md)
|
|
203
206
|
- [`./attachments.md`](./attachments.md)
|
|
204
207
|
- [`../project-layout.md`](../project-layout.md)
|
|
205
208
|
- [`../typescript-api.md`](../typescript-api.md)
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Slack channel setup"
|
|
3
|
+
description: "Create a Slack-backed Ash channel with Vercel Connex."
|
|
4
|
+
type: integration
|
|
5
|
+
related:
|
|
6
|
+
- /channels
|
|
7
|
+
- /connections
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Ash Slack channels can use Vercel Connex for both outbound Slack bot tokens and inbound webhook
|
|
11
|
+
verification. With Connex, you do not need to manage `SLACK_BOT_TOKEN` or `SLACK_SIGNING_SECRET`
|
|
12
|
+
environment variables yourself.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- A Vercel project for the agent.
|
|
17
|
+
- A Slack workspace where you can install the app.
|
|
18
|
+
- Access to Vercel Connex for your team.
|
|
19
|
+
|
|
20
|
+
For local development, link the project and pull Vercel OIDC env vars so Connex can authenticate to
|
|
21
|
+
the Vercel API:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
vercel link
|
|
25
|
+
vercel env pull
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Create The Connex Client
|
|
29
|
+
|
|
30
|
+
Create a Slack Connex client, then copy its UID. The UID is the value you pass to Ash, for example
|
|
31
|
+
`slack/my-agent`.
|
|
32
|
+
|
|
33
|
+
### Dashboard Path
|
|
34
|
+
|
|
35
|
+
Open [Connex in the Vercel dashboard](https://vercel.com/d?to=/%5Bteam%5D/~/connex&title=Go+to+Connex),
|
|
36
|
+
then:
|
|
37
|
+
|
|
38
|
+
1. Choose **Create Client**.
|
|
39
|
+
2. Choose **Slack**.
|
|
40
|
+
3. Choose **Install and Configure Client**.
|
|
41
|
+
4. Complete the Slack installation flow.
|
|
42
|
+
5. Choose **Continue**.
|
|
43
|
+
6. Copy the UID, for example `slack/test`.
|
|
44
|
+
|
|
45
|
+
### CLI Or Agent-Assisted Path
|
|
46
|
+
|
|
47
|
+
The `vercel connex` command is currently gated for allow-listed teams. If the command is missing,
|
|
48
|
+
update the Vercel CLI and enable the Connex flag in the terminal session where you will run the
|
|
49
|
+
commands:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm i -g vercel@latest
|
|
53
|
+
export FF_CONNEX_ENABLED=1
|
|
54
|
+
vercel connex --help
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The flag only applies to the current shell session. Export it again in new terminals, or add it to
|
|
58
|
+
your shell config while you are working with Connex.
|
|
59
|
+
|
|
60
|
+
Make sure the CLI is authenticated and scoped to the Vercel team that has Connex access:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
vercel login
|
|
64
|
+
vercel switch
|
|
65
|
+
vercel link
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If you are using an AI coding agent, install the Connex skill first:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx skills add https://github.com/vercel/connex --skill vercel-connex
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Then create the Slack client from the project or agent folder that will use it:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
vercel connex create slack
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Run Connex commands from the directory containing the agent's `package.json` or `vercel.json`.
|
|
81
|
+
Connex uses that project context to configure project access, webhooks, and triggers. The command may
|
|
82
|
+
open a browser for Slack installation or OAuth consent; finish that flow before continuing.
|
|
83
|
+
|
|
84
|
+
You can list existing clients with:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
vercel connex list
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Install Connex
|
|
91
|
+
|
|
92
|
+
Add the Connex SDK to the Ash project:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pnpm add @vercel/connex
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Add The Slack Channel File
|
|
99
|
+
|
|
100
|
+
Create `agent/channels/slack.ts`:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import { slackChannelCredentials } from "@vercel/connex/ash";
|
|
104
|
+
import { slackRoute } from "experimental-ash/channels/slack";
|
|
105
|
+
|
|
106
|
+
export default slackRoute({
|
|
107
|
+
credentials: slackChannelCredentials("slack/my-agent"),
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Replace `slack/my-agent` with the UID from the Connex client.
|
|
112
|
+
|
|
113
|
+
The helper returns a complete Slack credentials object:
|
|
114
|
+
|
|
115
|
+
- `botToken` resolves an app-scoped Slack token through Connex for outbound posts.
|
|
116
|
+
- `webhookVerifier` verifies Connex-forwarded Slack webhooks with Vercel OIDC.
|
|
117
|
+
|
|
118
|
+
That means token rotation, refresh, multi-workspace tenancy, and inbound request verification stay in
|
|
119
|
+
Connex instead of in your app environment.
|
|
120
|
+
|
|
121
|
+
## Customize Delivery
|
|
122
|
+
|
|
123
|
+
If you need custom Slack rendering or interaction handling, keep the same credentials and add an
|
|
124
|
+
adapter:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import { slackChannelCredentials } from "@vercel/connex/ash";
|
|
128
|
+
import { defineSlackAdapter, slackRoute } from "experimental-ash/channels/slack";
|
|
129
|
+
|
|
130
|
+
const adapter = defineSlackAdapter({
|
|
131
|
+
"turn.started": async (_data, ctx) => {
|
|
132
|
+
await ctx.thread.post({ markdown: "Working on it..." });
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export default slackRoute({
|
|
137
|
+
credentials: slackChannelCredentials("slack/my-agent"),
|
|
138
|
+
adapter,
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
See [Channels](/docs/channels) for the full Slack adapter surface.
|
|
@@ -97,7 +97,7 @@ Today that mainly means:
|
|
|
97
97
|
- skill files are available under the active runtime workspace root
|
|
98
98
|
- the model can inspect them with the shared `bash` tool
|
|
99
99
|
|
|
100
|
-
See [`workspace.md`](./workspace.md) and [`
|
|
100
|
+
See [`workspace.md`](./workspace.md) and [`sandbox.md`](./sandbox.md).
|
|
101
101
|
|
|
102
102
|
## 5. Delegate To A Specialist With A Subagent
|
|
103
103
|
|
|
@@ -32,21 +32,21 @@ my-agent/
|
|
|
32
32
|
|
|
33
33
|
## Slot Guide
|
|
34
34
|
|
|
35
|
-
| Path | Purpose
|
|
36
|
-
| -------------------------- |
|
|
37
|
-
| `system.md` or `system.ts` | Base system prompt
|
|
38
|
-
| `system/` | Additive always-on prompt layers
|
|
39
|
-
| `agent.ts` | Runtime config
|
|
40
|
-
| `instrumentation.ts` | Telemetry config
|
|
41
|
-
| `channels/` | HTTP or messaging entrypoints
|
|
42
|
-
| `connections/` | External service connections (MCP)
|
|
43
|
-
| `hooks/` | Lifecycle and stream-event subscribers
|
|
44
|
-
| `skills/` | On-demand procedures and capability packs
|
|
45
|
-
| `lib/` | Shared authored helper code
|
|
46
|
-
| `sandbox/`
|
|
47
|
-
| `tools/` | Typed executable integrations
|
|
48
|
-
| `schedules/` | Recurring jobs; each schedule is a directory with `schedule.ts` + `prompt.md`
|
|
49
|
-
| `subagents/` | Specialist child agents
|
|
35
|
+
| Path | Purpose | Notes |
|
|
36
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `system.md` or `system.ts` | Base system prompt | Exactly one system prompt is expected |
|
|
38
|
+
| `system/` | Additive always-on prompt layers | Loaded in deterministic path order. Module-backed layers are evaluated when a new session starts and then frozen for that session. |
|
|
39
|
+
| `agent.ts` | Runtime config | Model, name, metadata, workspace, build, compaction |
|
|
40
|
+
| `instrumentation.ts` | Telemetry config | OTel exporter setup and AI SDK span settings; auto-discovered and run before agent code |
|
|
41
|
+
| `channels/` | HTTP or messaging entrypoints | Root-only today |
|
|
42
|
+
| `connections/` | External service connections (MCP) | Each file defines one connection; name derived from filename |
|
|
43
|
+
| `hooks/` | Lifecycle and stream-event subscribers | Module-backed only. Recursive directories supported. See [`hooks.md`](./hooks.md). |
|
|
44
|
+
| `skills/` | On-demand procedures and capability packs | Flat markdown, module-backed skills, or packaged skills |
|
|
45
|
+
| `lib/` | Shared authored helper code | Import-only source, not mounted into the workspace |
|
|
46
|
+
| `sandbox/` or `sandbox.ts` | The agent's single sandbox. Use top-level `sandbox.ts` for a definition-only override; use `sandbox/sandbox.ts` + optional `sandbox/workspace/**` when you also want seeded files. Framework default applies when neither is authored. | Supported on the root agent and local subagents |
|
|
47
|
+
| `tools/` | Typed executable integrations | Module-backed only |
|
|
48
|
+
| `schedules/` | Recurring jobs; each schedule is a directory with `schedule.ts` + `prompt.md` | Root-only today |
|
|
49
|
+
| `subagents/` | Specialist child agents | Each child is its own local package |
|
|
50
50
|
|
|
51
51
|
## Root Agent Example
|
|
52
52
|
|
|
@@ -137,7 +137,7 @@ the sandbox workspace today:
|
|
|
137
137
|
- skill files under `skills/` are seeded into `/workspace/skills/...`
|
|
138
138
|
- files under `agent/sandbox/workspace/` are mirrored into `/workspace/...` at session bootstrap
|
|
139
139
|
|
|
140
|
-
See [`
|
|
140
|
+
See [`sandbox.md`](./sandbox.md#seeding-workspace-files) for the convention.
|
|
141
141
|
|
|
142
142
|
Important boundary:
|
|
143
143
|
|
|
@@ -40,9 +40,6 @@ Common stream events:
|
|
|
40
40
|
- `turn.started`
|
|
41
41
|
- `message.received`
|
|
42
42
|
- `step.started`
|
|
43
|
-
- `sandbox.initialized`
|
|
44
|
-
- `sandbox.restored`
|
|
45
|
-
- `sandbox.command`
|
|
46
43
|
- `actions.requested`
|
|
47
44
|
- `action.result`
|
|
48
45
|
- `subagent.called`
|
|
@@ -98,7 +95,7 @@ Ash uses three nested concepts:
|
|
|
98
95
|
- `turn`: one user-visible roundtrip inside that session
|
|
99
96
|
- `step`: one model call inside that turn
|
|
100
97
|
|
|
101
|
-
That is why tools,
|
|
98
|
+
That is why tools, the sandbox, and subagents feel synchronous from authored code even though the
|
|
102
99
|
overall session remains durable.
|
|
103
100
|
|
|
104
101
|
Important behavior:
|
|
@@ -22,21 +22,31 @@ If you never author a sandbox override, the framework default is what you get.
|
|
|
22
22
|
## Overriding The Sandbox
|
|
23
23
|
|
|
24
24
|
To customize the sandbox — to add backend options, bootstrap commands, or per-session setup —
|
|
25
|
-
|
|
25
|
+
author a sandbox definition module:
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
-
// agent/sandbox
|
|
29
|
-
import { defineSandbox } from "experimental-ash/
|
|
30
|
-
import { defaultSandbox } from "experimental-ash/sandboxes/defaults";
|
|
28
|
+
// agent/sandbox.ts
|
|
29
|
+
import { defineSandbox } from "experimental-ash/sandbox";
|
|
31
30
|
|
|
32
31
|
export default defineSandbox({
|
|
33
|
-
...defaultSandbox,
|
|
34
32
|
async bootstrap({ sandbox }) {
|
|
35
33
|
await sandbox.runCommand("apt-get install -y jq");
|
|
36
34
|
},
|
|
37
35
|
});
|
|
38
36
|
```
|
|
39
37
|
|
|
38
|
+
You don't need to spread anything: when `backend` is omitted, the runtime substitutes
|
|
39
|
+
`defaultBackend()` automatically (see [Backend Selection](#backend-selection) below).
|
|
40
|
+
|
|
41
|
+
Two layouts are supported. Pick whichever matches what you need:
|
|
42
|
+
|
|
43
|
+
- `agent/sandbox.ts` — top-level shorthand. Use this when you only need a definition module and
|
|
44
|
+
no seeded workspace files. The shorthand cannot carry a `workspace/` folder.
|
|
45
|
+
- `agent/sandbox/sandbox.ts` — folder layout. Use this when you also want to seed
|
|
46
|
+
`agent/sandbox/workspace/**` into the live sandbox cwd at session bootstrap.
|
|
47
|
+
|
|
48
|
+
When both are present, the folder layout wins and the top-level shorthand is ignored.
|
|
49
|
+
|
|
40
50
|
The public lifecycle surface is intentionally small:
|
|
41
51
|
|
|
42
52
|
- `bootstrap` — template-scoped setup (runs once when the template is built)
|
|
@@ -44,13 +54,12 @@ The public lifecycle surface is intentionally small:
|
|
|
44
54
|
- `sandbox.resolvePath(path)` — translate a logical `/workspace/...` path into the live filesystem
|
|
45
55
|
- `sandbox.runCommand(command)` — run a shell command inside the sandbox
|
|
46
56
|
|
|
47
|
-
`defineSandbox`
|
|
48
|
-
`experimental-ash/sandboxes/defaults`.
|
|
57
|
+
`defineSandbox` lives on `experimental-ash/sandbox`.
|
|
49
58
|
|
|
50
59
|
## Seeding Workspace Files
|
|
51
60
|
|
|
52
|
-
You can mount a folder of authored files into
|
|
53
|
-
putting them under `agent/sandbox/workspace/`:
|
|
61
|
+
Seeding workspace files requires the folder layout. You can mount a folder of authored files into
|
|
62
|
+
the sandbox filesystem at session bootstrap by putting them under `agent/sandbox/workspace/`:
|
|
54
63
|
|
|
55
64
|
```text
|
|
56
65
|
agent/sandbox/
|
|
@@ -67,7 +76,8 @@ Rules:
|
|
|
67
76
|
- The workspace folder is optional. An empty or missing `workspace/` is identical to today — no
|
|
68
77
|
mounts.
|
|
69
78
|
- `sandbox.ts` is also optional. You can author _just_ a `workspace/` folder and the framework
|
|
70
|
-
default definition still applies.
|
|
79
|
+
default definition still applies. (To author only a definition without seeded files, prefer the
|
|
80
|
+
top-level `agent/sandbox.ts` shorthand instead.)
|
|
71
81
|
- The workspace prompt section advertises the top-level entries to the model automatically.
|
|
72
82
|
|
|
73
83
|
### Reserved `skills/` Subtree
|
|
@@ -93,7 +103,7 @@ export default defineBashTool({
|
|
|
93
103
|
|
|
94
104
|
These share the executor core, input schema, and result shape of the framework `bash`, `read_file`,
|
|
95
105
|
and `write_file` tools. The runtime name comes from the file stem (here, `repo_shell`). There is no
|
|
96
|
-
`
|
|
106
|
+
`sandbox` option on these factories — every tool runs in the single sandbox.
|
|
97
107
|
|
|
98
108
|
## Using The Sandbox From Authored Code
|
|
99
109
|
|
|
@@ -101,7 +111,7 @@ Any authored runtime function (tool, step, or model callback) can bind a live sa
|
|
|
101
111
|
`getSandbox()`:
|
|
102
112
|
|
|
103
113
|
```ts
|
|
104
|
-
import { getSandbox } from "experimental-ash/
|
|
114
|
+
import { getSandbox } from "experimental-ash/sandbox";
|
|
105
115
|
import { defineTool } from "experimental-ash/tools";
|
|
106
116
|
import { z } from "zod";
|
|
107
117
|
|
|
@@ -154,7 +164,8 @@ from authored helpers.
|
|
|
154
164
|
Each subagent has its own sandbox, independent of its parent. This is intentional: subagents carry
|
|
155
165
|
different skills, so they should not inherit the parent's filesystem.
|
|
156
166
|
|
|
157
|
-
- If a subagent authors `subagents/<name>/sandbox
|
|
167
|
+
- If a subagent authors `subagents/<name>/sandbox.ts` (or `subagents/<name>/sandbox/sandbox.ts`),
|
|
168
|
+
that definition is used. The same shorthand-vs-folder rules apply as for the root agent.
|
|
158
169
|
- If a subagent authors only `subagents/<name>/sandbox/workspace/`, the framework default applies
|
|
159
170
|
with that workspace seeded in.
|
|
160
171
|
- If a subagent authors neither, the framework default is used as-is.
|
|
@@ -189,7 +200,7 @@ template:
|
|
|
189
200
|
|
|
190
201
|
```ts
|
|
191
202
|
import { getSession } from "experimental-ash/context";
|
|
192
|
-
import { defineSandbox } from "experimental-ash/
|
|
203
|
+
import { defineSandbox } from "experimental-ash/sandbox";
|
|
193
204
|
|
|
194
205
|
export default defineSandbox({
|
|
195
206
|
async onSession({ sandbox }) {
|
|
@@ -206,7 +217,7 @@ export default defineSandbox({
|
|
|
206
217
|
|
|
207
218
|
## Backend Selection
|
|
208
219
|
|
|
209
|
-
Ash ships two built-in backends, exposed as factory functions from `experimental-ash/
|
|
220
|
+
Ash ships two built-in backends, exposed as factory functions from `experimental-ash/sandbox`:
|
|
210
221
|
|
|
211
222
|
- `vercelBackend(options?)` — runs the sandbox on Vercel Sandbox via `@vercel/sandbox`.
|
|
212
223
|
- `localBackend()` — runs the sandbox locally via `just-bash`. Default for `pnpm ash dev`.
|
|
@@ -215,7 +226,7 @@ Attach a backend via `defineSandbox({ backend })`:
|
|
|
215
226
|
|
|
216
227
|
```ts
|
|
217
228
|
// agent/sandbox/sandbox.ts
|
|
218
|
-
import { defineSandbox, vercelBackend } from "experimental-ash/
|
|
229
|
+
import { defineSandbox, vercelBackend } from "experimental-ash/sandbox";
|
|
219
230
|
|
|
220
231
|
export default defineSandbox({
|
|
221
232
|
backend: vercelBackend({ runtime: "node24" }),
|
|
@@ -233,7 +244,7 @@ default; production builds on Vercel use the Vercel backend by default.
|
|
|
233
244
|
If you want the env-aware default explicitly, use `defaultBackend()`:
|
|
234
245
|
|
|
235
246
|
```ts
|
|
236
|
-
import { defaultBackend, defineSandbox } from "experimental-ash/
|
|
247
|
+
import { defaultBackend, defineSandbox } from "experimental-ash/sandbox";
|
|
237
248
|
|
|
238
249
|
export default defineSandbox({
|
|
239
250
|
backend: defaultBackend(),
|
|
@@ -270,7 +281,7 @@ share an Ash-owned key.
|
|
|
270
281
|
### Timeout
|
|
271
282
|
|
|
272
283
|
The `@vercel/sandbox` SDK shuts down idle VMs after a configurable timeout (default 5 minutes). Ash
|
|
273
|
-
raises this default to **30 minutes** so
|
|
284
|
+
raises this default to **30 minutes** so the sandbox survives across workflow step boundaries. You can
|
|
274
285
|
override it via `vercelBackend()`:
|
|
275
286
|
|
|
276
287
|
```ts
|
|
@@ -308,7 +319,7 @@ needs (e.g. `["registry.npmjs.org"]`) instead of using `deny-all`.
|
|
|
308
319
|
|
|
309
320
|
A `SandboxBackend` is just an object with a `name` and a `create` function (and optionally
|
|
310
321
|
`prewarm`). You can write your own and pass it to `defineSandbox({ backend })`. See
|
|
311
|
-
`experimental-ash/
|
|
322
|
+
`experimental-ash/sandbox` for the `SandboxBackend`, `SandboxBackendCreateInput`, and
|
|
312
323
|
`SandboxBackendPrewarmInput` interface types.
|
|
313
324
|
|
|
314
325
|
## Vercel Behavior
|
|
@@ -83,7 +83,7 @@ Important behavior:
|
|
|
83
83
|
backend-native path for a logical `/workspace/...` location before passing it to shell code or a
|
|
84
84
|
child process.
|
|
85
85
|
|
|
86
|
-
See [`
|
|
86
|
+
See [`sandbox.md`](./sandbox.md) for lifecycle details.
|
|
87
87
|
|
|
88
88
|
## `getSkill(identifier)`
|
|
89
89
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Subagents"
|
|
3
|
-
description: "Delegate specialized work to child agents with their own prompts, tools, and
|
|
3
|
+
description: "Delegate specialized work to child agents with their own prompts, tools, and sandbox."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Subagents let the root agent delegate specialized work to local child agents.
|
|
@@ -61,9 +61,9 @@ Subagent execution gets:
|
|
|
61
61
|
|
|
62
62
|
The subagent's sandbox does not inherit from the parent. Different agents generally have different
|
|
63
63
|
skills, so sharing a filesystem would be confusing. Each subagent gets the framework default
|
|
64
|
-
sandbox unless it authors its own override at `subagents/<name>/sandbox
|
|
65
|
-
|
|
66
|
-
definition.
|
|
64
|
+
sandbox unless it authors its own override at `subagents/<name>/sandbox.ts` (or
|
|
65
|
+
`subagents/<name>/sandbox/sandbox.ts` when paired with a `workspace/` folder). A subagent can also
|
|
66
|
+
author only `subagents/<name>/sandbox/workspace/` to seed files without overriding the definition.
|
|
67
67
|
|
|
68
68
|
## Stream Behavior
|
|
69
69
|
|
|
@@ -40,7 +40,7 @@ exposed to the model as `get_weather`; a file at `agent/tools/get-weather.ts` is
|
|
|
40
40
|
|
|
41
41
|
`defineTool`, `disableTool`, `defineBashTool`, `defineReadFileTool`, and `defineWriteFileTool` live on the `experimental-ash/tools` subpath.
|
|
42
42
|
Runtime context helpers (`getSession`, `getContext`, `requireContext`, `hasContext`, `setContext`, `ensureContext`) live on `experimental-ash/context`.
|
|
43
|
-
`getSandbox` lives on `experimental-ash/
|
|
43
|
+
`getSandbox` lives on `experimental-ash/sandbox` and `getSkill` lives on `experimental-ash/skills`.
|
|
44
44
|
|
|
45
45
|
## What A Tool Definition Needs
|
|
46
46
|
|
|
@@ -170,7 +170,7 @@ filenames fail at resolve time instead of silently doing nothing.
|
|
|
170
170
|
|
|
171
171
|
`defineBashTool`, `defineReadFileTool`, and `defineWriteFileTool` build additional model-visible
|
|
172
172
|
tools that share the executor core of the framework `bash`, `read_file`, and `write_file` tools. All
|
|
173
|
-
of them run in the agent's single sandbox — there is no `
|
|
173
|
+
of them run in the agent's single sandbox — there is no `sandbox` option to pass.
|
|
174
174
|
|
|
175
175
|
Use them whenever you want extra `bash`-shaped or file-shaped tools with narrower model-facing
|
|
176
176
|
descriptions:
|
|
@@ -263,7 +263,7 @@ unbounded text, cap it in the executor before returning:
|
|
|
263
263
|
|
|
264
264
|
```ts
|
|
265
265
|
import { defineTool } from "experimental-ash/tools";
|
|
266
|
-
import { truncateHead } from "experimental-ash/
|
|
266
|
+
import { truncateHead } from "experimental-ash/sandbox/truncate-output";
|
|
267
267
|
import { z } from "zod";
|
|
268
268
|
|
|
269
269
|
export default defineTool({
|
|
@@ -321,4 +321,4 @@ export default defineTool({
|
|
|
321
321
|
## What To Read Next
|
|
322
322
|
|
|
323
323
|
- [`session-context.md`](./session-context.md)
|
|
324
|
-
- [`
|
|
324
|
+
- [`sandbox.md`](./sandbox.md)
|
|
@@ -11,7 +11,7 @@ Source of truth:
|
|
|
11
11
|
- context subpath: [`../../packages/ash/src/public/context/index.ts`](../../packages/ash/src/public/context/index.ts)
|
|
12
12
|
- skills subpath: [`../../packages/ash/src/public/skills/index.ts`](../../packages/ash/src/public/skills/index.ts)
|
|
13
13
|
- tools subpath: [`../../packages/ash/src/public/tools/index.ts`](../../packages/ash/src/public/tools/index.ts)
|
|
14
|
-
-
|
|
14
|
+
- sandbox subpath: [`../../packages/ash/src/public/sandbox/index.ts`](../../packages/ash/src/public/sandbox/index.ts)
|
|
15
15
|
- channel subpaths: [`../../packages/ash/src/public/channels/index.ts`](../../packages/ash/src/public/channels/index.ts)
|
|
16
16
|
- evals subpath: [`../../packages/ash/src/evals/index.ts`](../../packages/ash/src/evals/index.ts)
|
|
17
17
|
|
|
@@ -19,14 +19,14 @@ Source of truth:
|
|
|
19
19
|
|
|
20
20
|
Use these to author the filesystem-backed surface. Each concern has its own subpath:
|
|
21
21
|
`experimental-ash/tools` for tools, `experimental-ash/hooks` for hooks,
|
|
22
|
-
`experimental-ash/
|
|
22
|
+
`experimental-ash/sandbox` for the sandbox, `experimental-ash/skills` for skills,
|
|
23
23
|
`experimental-ash/context` for context helpers, and the main `experimental-ash`
|
|
24
24
|
barrel for agent config, routes, schedules, and systems.
|
|
25
25
|
|
|
26
26
|
- `defineAgent(...)` - additive runtime config for `agent.ts`
|
|
27
27
|
- `defineHook(...)` - lifecycle and stream-event subscriber in `hooks/<slug>.ts` (`experimental-ash/hooks`)
|
|
28
28
|
- `defineRoute(...)` - messaging-platform or HTTP route entrypoints in `channels/`
|
|
29
|
-
- `defineSandbox(...)` - override the agent's single sandbox in `sandbox/sandbox.ts` (`experimental-ash/
|
|
29
|
+
- `defineSandbox(...)` - override the agent's single sandbox in `sandbox.ts` (or `sandbox/sandbox.ts` when paired with a `workspace/` folder) (`experimental-ash/sandbox`)
|
|
30
30
|
- `defineSchedule(...)` - recurring jobs in `schedules/<name>/schedule.ts`; requires `cron` and `channel`
|
|
31
31
|
- `defineSkill(...)` - module-authored skills (`experimental-ash/skills`)
|
|
32
32
|
- `defineSubagent(...)` - local subagent entrypoint in `subagents/<id>/subagent.ts`
|
|
@@ -42,7 +42,6 @@ barrel for agent config, routes, schedules, and systems.
|
|
|
42
42
|
Framework defaults reachable for spread/wrap composition:
|
|
43
43
|
|
|
44
44
|
- `bash`, `readFile`, `writeFile`, `webFetch`, `todo`, `loadSkill` (`experimental-ash/tools/defaults`)
|
|
45
|
-
- `defaultSandbox` (`experimental-ash/sandboxes/defaults`)
|
|
46
45
|
|
|
47
46
|
Most apps use `defineAgent`, `defineTool`, and `defineSandbox` the most.
|
|
48
47
|
|
|
@@ -51,7 +50,7 @@ Most apps use `defineAgent`, `defineTool`, and `defineSandbox` the most.
|
|
|
51
50
|
Each runtime accessor lives on the subpath that owns its concern:
|
|
52
51
|
|
|
53
52
|
- `getSession()` - current session, turn, auth, and optional parent lineage (`experimental-ash/context`)
|
|
54
|
-
- `getSandbox()` - live sandbox handle for the current agent (`experimental-ash/
|
|
53
|
+
- `getSandbox()` - live sandbox handle for the current agent (`experimental-ash/sandbox`)
|
|
55
54
|
- `getSkill(identifier)` - handle for a named skill visible to the current agent (`experimental-ash/skills`)
|
|
56
55
|
- `getContext(key)` / `requireContext(key)` / `hasContext(key)` / `setContext(key)` / `ensureContext(key, factory)` - unified context helpers (`experimental-ash/context`)
|
|
57
56
|
|
|
@@ -136,7 +135,7 @@ import { defineTool } from "experimental-ash/tools";
|
|
|
136
135
|
### Sandbox Access
|
|
137
136
|
|
|
138
137
|
```ts
|
|
139
|
-
import { getSandbox } from "experimental-ash/
|
|
138
|
+
import { getSandbox } from "experimental-ash/sandbox";
|
|
140
139
|
import { defineTool } from "experimental-ash/tools";
|
|
141
140
|
import { defineBashTool } from "experimental-ash/tools";
|
|
142
141
|
```
|
|
@@ -184,7 +183,7 @@ import { Braintrust } from "experimental-ash/evals/reporters";
|
|
|
184
183
|
- `defineRoute` and route/channel factories -> [`channels/README.md`](./channels/README.md)
|
|
185
184
|
- `defineTool`, `disableTool`, `defineBashTool`, `defineReadFileTool`, `defineWriteFileTool`, and `experimental-ash/tools/defaults` -> [`tools.md`](./tools.md)
|
|
186
185
|
- `defineHook`, `HookContext`, and lifecycle/event types -> [`hooks.md`](./hooks.md)
|
|
187
|
-
- `defineSandbox` and `getSandbox` -> [`
|
|
186
|
+
- `defineSandbox` and `getSandbox` -> [`sandbox.md`](./sandbox.md)
|
|
188
187
|
- `defineSkill` and `getSkill` -> [`skills.md`](./skills.md)
|
|
189
188
|
- `getSession` -> [`session-context.md`](./session-context.md)
|
|
190
189
|
- `defineSubagent` -> [`subagents.md`](./subagents.md)
|
|
@@ -42,7 +42,7 @@ Attach the backend on the sandbox definition:
|
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
44
|
// agent/sandbox/sandbox.ts
|
|
45
|
-
import { defineSandbox, vercelBackend } from "experimental-ash/
|
|
45
|
+
import { defineSandbox, vercelBackend } from "experimental-ash/sandbox";
|
|
46
46
|
|
|
47
47
|
export default defineSandbox({
|
|
48
48
|
backend: vercelBackend(),
|
|
@@ -104,5 +104,5 @@ This is useful for smoke tests against preview or production environments.
|
|
|
104
104
|
## What To Read Next
|
|
105
105
|
|
|
106
106
|
- [`workspace.md`](./workspace.md)
|
|
107
|
-
- [`
|
|
107
|
+
- [`sandbox.md`](./sandbox.md)
|
|
108
108
|
- [`auth-and-route-protection.md`](./auth-and-route-protection.md)
|
|
@@ -30,7 +30,7 @@ workspace today:
|
|
|
30
30
|
bring their skill package directory with them.
|
|
31
31
|
- **Sandbox workspace files** under `agent/sandbox/workspace/` are mirrored into the workspace
|
|
32
32
|
cwd, preserving subdirectory structure. See
|
|
33
|
-
[`
|
|
33
|
+
[`sandbox.md`](./sandbox.md#seeding-workspace-files) for the convention.
|
|
34
34
|
|
|
35
35
|
That means:
|
|
36
36
|
|
|
@@ -48,7 +48,7 @@ The backend (`localBackend()` or `vercelBackend()`) is configured on the sandbox
|
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
50
|
// agent/sandbox/sandbox.ts — pin the agent to the local just-bash backend
|
|
51
|
-
import { defineSandbox, localBackend } from "experimental-ash/
|
|
51
|
+
import { defineSandbox, localBackend } from "experimental-ash/sandbox";
|
|
52
52
|
|
|
53
53
|
export default defineSandbox({
|
|
54
54
|
backend: localBackend(),
|
|
@@ -98,5 +98,5 @@ Prefer tools when you need typed business logic or external API access.
|
|
|
98
98
|
|
|
99
99
|
## What To Read Next
|
|
100
100
|
|
|
101
|
-
- [`
|
|
101
|
+
- [`sandbox.md`](./sandbox.md)
|
|
102
102
|
- [`runs-and-streaming.md`](./runs-and-streaming.md)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRequire as __ashCreateRequire } from "node:module"; const require = __ashCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
isObject
|
|
4
|
+
} from "./chunk-APDYQG3O.js";
|
|
5
|
+
|
|
6
|
+
// src/shared/errors.ts
|
|
7
|
+
function toErrorMessage(error) {
|
|
8
|
+
if (error instanceof Error) {
|
|
9
|
+
return error.message;
|
|
10
|
+
}
|
|
11
|
+
if (typeof error === "string") {
|
|
12
|
+
return error;
|
|
13
|
+
}
|
|
14
|
+
if (error === null || error === void 0) {
|
|
15
|
+
return String(error);
|
|
16
|
+
}
|
|
17
|
+
if (isObject(error)) {
|
|
18
|
+
if (typeof error.message === "string" && error.message.length > 0) {
|
|
19
|
+
return error.message;
|
|
20
|
+
}
|
|
21
|
+
return safeJsonStringify(error);
|
|
22
|
+
}
|
|
23
|
+
return String(error);
|
|
24
|
+
}
|
|
25
|
+
function safeJsonStringify(value) {
|
|
26
|
+
try {
|
|
27
|
+
const stringified = JSON.stringify(value);
|
|
28
|
+
return stringified ?? String(value);
|
|
29
|
+
} catch {
|
|
30
|
+
return String(value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
toErrorMessage
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=chunk-2BCVGULU.js.map
|