experimental-ash 0.18.2 → 0.19.0
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/CHANGELOG.md +14 -0
- package/dist/docs/internals/context.md +7 -0
- package/dist/docs/public/channels/README.md +5 -0
- package/dist/docs/public/channels/slack.md +58 -4
- package/dist/docs/public/hooks.md +4 -2
- package/dist/docs/public/sandbox.md +71 -49
- package/dist/docs/public/typescript-api.md +6 -1
- package/dist/src/channel/adapter.js +12 -2
- package/dist/src/channel/routes.d.ts +9 -1
- package/dist/src/channel/send.js +3 -3
- package/dist/src/channel/types.d.ts +3 -1
- package/dist/src/chunks/{dev-authored-source-watcher-j7YWh2Gx.js → dev-authored-source-watcher-L3_pagDa.js} +1 -1
- package/dist/src/chunks/{host-DkTSR6YJ.js → host-e2GUqnTr.js} +3 -3
- package/dist/src/chunks/{paths-Dwv0Eash.js → paths-BBleOGpa.js} +25 -25
- package/dist/src/chunks/{prewarm-CQYfka30.js → prewarm-DEymC5M-.js} +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +6 -1
- package/dist/src/context/hook-lifecycle.js +5 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/execution/sandbox/bindings/local.d.ts +14 -1
- package/dist/src/execution/sandbox/bindings/local.js +5 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +6 -0
- package/dist/src/execution/sandbox/bindings/vercel.js +12 -1
- package/dist/src/execution/sandbox/lazy-backend.d.ts +15 -0
- package/dist/src/execution/sandbox/lazy-backend.js +33 -0
- package/dist/src/execution/workflow-entry.d.ts +2 -4
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/harness/messages.js +15 -0
- package/dist/src/harness/types.d.ts +6 -7
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +8 -2
- package/dist/src/internal/authored-definition/sandbox.js +10 -2
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +0 -2
- package/dist/src/public/channels/slack/api.d.ts +2 -27
- package/dist/src/public/channels/slack/api.js +6 -82
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/hitl.js +6 -3
- package/dist/src/public/channels/slack/inbound.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +3 -0
- package/dist/src/public/channels/slack/index.js +2 -0
- package/dist/src/public/channels/slack/limits.d.ts +19 -0
- package/dist/src/public/channels/slack/limits.js +23 -0
- package/dist/src/public/channels/slack/mrkdwn.d.ts +38 -0
- package/dist/src/public/channels/slack/mrkdwn.js +89 -0
- package/dist/src/public/channels/slack/slackChannel.d.ts +12 -4
- package/dist/src/public/channels/slack/slackChannel.js +5 -8
- package/dist/src/public/channels/slack/thread.d.ts +26 -0
- package/dist/src/public/channels/slack/thread.js +45 -0
- package/dist/src/public/definitions/defineChannel.d.ts +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts +16 -1
- package/dist/src/public/sandbox/backends/default.js +7 -19
- package/dist/src/public/sandbox/backends/local.d.ts +7 -4
- package/dist/src/public/sandbox/backends/local.js +7 -5
- package/dist/src/public/sandbox/backends/vercel.d.ts +9 -3
- package/dist/src/public/sandbox/backends/vercel.js +9 -3
- package/dist/src/public/sandbox/index.d.ts +2 -1
- package/dist/src/public/sandbox/local-sandbox.d.ts +7 -0
- package/dist/src/public/sandbox/local-sandbox.js +1 -0
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +13 -1
- package/dist/src/runtime/resolve-sandbox.js +5 -1
- package/dist/src/runtime/types.d.ts +10 -1
- package/dist/src/shared/sandbox-definition.d.ts +16 -1
- package/package.json +1 -1
|
@@ -25,13 +25,28 @@ export interface SandboxDefinition<BO = Record<string, never>, SO = Record<strin
|
|
|
25
25
|
/**
|
|
26
26
|
* Backend that runs this sandbox.
|
|
27
27
|
*
|
|
28
|
+
* Accepts either a {@link SandboxBackend} value or a zero-arg factory
|
|
29
|
+
* function that returns one. The factory form is invoked lazily on
|
|
30
|
+
* first framework access and the result is memoized for the lifetime
|
|
31
|
+
* of the process, so backend-internal state (such as the Vercel
|
|
32
|
+
* backend's prewarmed-template cache) is preserved across every call.
|
|
33
|
+
* Use the factory form to defer evaluation — for example, when create
|
|
34
|
+
* options depend on environment variables that aren't set at module
|
|
35
|
+
* load time:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* defineSandbox({
|
|
39
|
+
* backend: () => vercelBackend({ env: { TOKEN: process.env.TOKEN ?? "" } }),
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
28
43
|
* When this field is omitted, Ash substitutes `defaultBackend()` at
|
|
29
44
|
* runtime, which delegates to `vercelBackend()` on hosted Vercel
|
|
30
45
|
* (where `process.env.VERCEL` is set) and to `localBackend()`
|
|
31
46
|
* everywhere else. Set `backend` explicitly to pin the sandbox to a
|
|
32
47
|
* specific backend regardless of environment.
|
|
33
48
|
*/
|
|
34
|
-
backend: SandboxBackend<BO, SO
|
|
49
|
+
backend: SandboxBackend<BO, SO> | (() => SandboxBackend<BO, SO>);
|
|
35
50
|
bootstrap?(input: SandboxBootstrapContext<BO>): Promise<void> | void;
|
|
36
51
|
onSession?(input: SandboxSessionContext<SO>): Promise<void> | void;
|
|
37
52
|
}
|