experimental-ash 0.22.2 → 0.24.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 +36 -0
- package/dist/docs/internals/hooks.md +13 -16
- package/dist/docs/internals/message-runtime.md +1 -1
- package/dist/docs/public/auth-and-route-protection.md +3 -3
- package/dist/docs/public/faqs.md +67 -0
- package/dist/docs/public/meta.json +1 -0
- package/dist/docs/public/schedules.md +11 -0
- package/dist/docs/public/session-context.md +46 -89
- package/dist/docs/public/skills.md +13 -0
- package/dist/docs/public/subagents.md +12 -6
- package/dist/docs/public/tools.md +9 -13
- package/dist/docs/public/typescript-api.md +4 -4
- package/dist/src/channel/types.d.ts +10 -12
- package/dist/src/chunks/{client-CKsU8Li3.js → client-nshDsWNF.js} +1 -1
- package/dist/src/chunks/{dev-authored-source-watcher-BLzYWh05.js → dev-authored-source-watcher-B4PaZGUr.js} +1 -1
- package/dist/src/chunks/host-DsW72Q-w.js +65 -0
- package/dist/src/chunks/paths-OknjaYR8.js +89 -0
- package/dist/src/chunks/prewarm-B4YblQ5m.js +6 -0
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/dev/repl.js +2 -2
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/session.js +8 -0
- package/dist/src/client/types.d.ts +12 -1
- package/dist/src/compiled/.vendor-stamp.json +3 -3
- package/dist/src/compiled/@workflow/core/_ms.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/_workflow-serde.d.ts +5 -0
- package/dist/src/compiled/@workflow/core/_workflow-utils.d.ts +8 -0
- package/dist/src/compiled/@workflow/core/_workflow-world.d.ts +59 -0
- package/dist/src/compiled/@workflow/core/capabilities.d.ts +45 -0
- package/dist/src/compiled/@workflow/core/capture-stack.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/class-serialization.d.ts +31 -0
- package/dist/src/compiled/@workflow/core/classify-error.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/context-errors.d.ts +27 -0
- package/dist/src/compiled/@workflow/core/context-violation-error.d.ts +97 -0
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +179 -0
- package/dist/src/compiled/@workflow/core/define-hook.d.ts +68 -0
- package/dist/src/compiled/@workflow/core/describe-error.d.ts +70 -0
- package/dist/src/compiled/@workflow/core/encryption.d.ts +51 -0
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +64 -0
- package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +82 -0
- package/dist/src/compiled/@workflow/core/global.d.ts +48 -0
- package/dist/src/compiled/@workflow/core/index.d.ts +19 -38
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/log-format.d.ts +25 -0
- package/dist/src/compiled/@workflow/core/logger.d.ts +29 -0
- package/dist/src/compiled/@workflow/core/package.json +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +59 -10
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +51 -0
- package/dist/src/compiled/@workflow/core/runtime/get-port-lazy.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/runtime/get-world-lazy.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +97 -0
- package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +98 -0
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +77 -0
- package/dist/src/compiled/@workflow/core/runtime/run.d.ts +134 -0
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +50 -0
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +59 -0
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +40 -0
- package/dist/src/compiled/@workflow/core/runtime/step-handler.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +42 -0
- package/dist/src/compiled/@workflow/core/runtime/world-init.d.ts +75 -0
- package/dist/src/compiled/@workflow/core/runtime/world.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/runtime.d.ts +22 -67
- package/dist/src/compiled/@workflow/core/runtime.js +27 -27
- package/dist/src/compiled/@workflow/core/schemas.d.ts +15 -0
- package/dist/src/compiled/@workflow/core/serialization/client.d.ts +17 -0
- package/dist/src/compiled/@workflow/core/serialization/codec-devalue.d.ts +14 -0
- package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +90 -0
- package/dist/src/compiled/@workflow/core/serialization/encryption.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/serialization/errors.d.ts +21 -0
- package/dist/src/compiled/@workflow/core/serialization/format.d.ts +60 -0
- package/dist/src/compiled/@workflow/core/serialization/index.d.ts +18 -0
- package/dist/src/compiled/@workflow/core/serialization/reducers/class.d.ts +11 -0
- package/dist/src/compiled/@workflow/core/serialization/reducers/common.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/serialization/reducers/step-function.d.ts +35 -0
- package/dist/src/compiled/@workflow/core/serialization/step.d.ts +17 -0
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +215 -0
- package/dist/src/compiled/@workflow/core/serialization/workflow.d.ts +29 -0
- package/dist/src/compiled/@workflow/core/serialization-format.d.ts +171 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +337 -0
- package/dist/src/compiled/@workflow/core/sleep.d.ts +33 -0
- package/dist/src/compiled/@workflow/core/source-map.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +13 -0
- package/dist/src/compiled/@workflow/core/step/get-closure-vars.d.ts +9 -0
- package/dist/src/compiled/@workflow/core/step/get-step-metadata.d.ts +42 -0
- package/dist/src/compiled/@workflow/core/step/get-workflow-metadata.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/step/writable-stream.d.ts +22 -0
- package/dist/src/compiled/@workflow/core/step.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/symbols.d.ts +36 -0
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +283 -0
- package/dist/src/compiled/@workflow/core/telemetry.d.ts +53 -0
- package/dist/src/compiled/@workflow/core/types.d.ts +14 -0
- package/dist/src/compiled/@workflow/core/util.d.ts +40 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/vm/index.d.ts +17 -0
- package/dist/src/compiled/@workflow/core/vm/uint8array-base64.d.ts +21 -0
- package/dist/src/compiled/@workflow/core/vm/uuid.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/workflow/abort-controller.d.ts +65 -0
- package/dist/src/compiled/@workflow/core/workflow/create-hook.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/workflow/define-hook.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/workflow/get-workflow-metadata.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/workflow/hook.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/workflow/index.d.ts +11 -0
- package/dist/src/compiled/@workflow/core/workflow/sleep.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/workflow/world-init-stub.d.ts +15 -0
- package/dist/src/compiled/@workflow/core/workflow/writable-stream.d.ts +3 -0
- package/dist/src/compiled/@workflow/core/workflow.d.ts +1 -38
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/error-codes.d.ts +5 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +15 -1
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/errors/package.json +1 -1
- package/dist/src/compiled/_chunks/workflow/{context-errors-zbKocOyk.js → context-errors-Bbvvp-li.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{dist-0iNBqPYp.js → dist-C7wPwOI9.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{dist-D774SUM4.js → dist-C_oiE-l7.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-C3VWUPii.js +12 -0
- package/dist/src/compiled/_chunks/workflow/sleep-QTkC1VFe.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{symbols-D-4tVV8x.js → symbols-QezhMuLg.js} +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/execution/await-authorization-orchestrator.d.ts +2 -1
- package/dist/src/execution/await-authorization-orchestrator.js +4 -0
- package/dist/src/execution/connection-auth-steps.d.ts +4 -0
- package/dist/src/execution/connection-auth-steps.js +9 -11
- package/dist/src/execution/node-step.d.ts +4 -5
- package/dist/src/execution/subagent-adapter.d.ts +0 -27
- package/dist/src/execution/subagent-adapter.js +2 -66
- package/dist/src/execution/subagent-hitl-proxy.d.ts +2 -2
- package/dist/src/execution/subagent-hitl-proxy.js +2 -2
- package/dist/src/execution/task-mode.d.ts +3 -3
- package/dist/src/execution/task-mode.js +3 -3
- package/dist/src/execution/turn-workflow.d.ts +41 -0
- package/dist/src/execution/turn-workflow.js +96 -0
- package/dist/src/execution/workflow-entry.js +77 -87
- package/dist/src/execution/workflow-errors.d.ts +14 -0
- package/dist/src/execution/workflow-errors.js +54 -0
- package/dist/src/execution/workflow-runtime.d.ts +34 -3
- package/dist/src/execution/workflow-runtime.js +52 -10
- package/dist/src/execution/workflow-steps.d.ts +27 -2
- package/dist/src/execution/workflow-steps.js +31 -26
- package/dist/src/harness/instrumentation-config.js +14 -7
- package/dist/src/harness/messages.d.ts +7 -7
- package/dist/src/harness/messages.js +4 -4
- package/dist/src/harness/runtime-actions.d.ts +4 -4
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +20 -8
- package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +13 -0
- package/dist/src/internal/workflow-bundle/workflow-transformer.js +10 -4
- package/dist/src/protocol/message.d.ts +6 -1
- package/dist/src/public/channels/ash.js +50 -3
- package/dist/src/public/context/index.d.ts +4 -7
- package/dist/src/public/context/index.js +4 -5
- package/dist/src/public/definitions/state.d.ts +33 -0
- package/dist/src/public/definitions/state.js +34 -0
- package/dist/src/public/next/index.d.ts +7 -0
- package/dist/src/public/next/index.js +2 -0
- package/dist/src/public/next/vercel-json.d.ts +1 -0
- package/dist/src/public/next/vercel-json.js +1 -0
- package/dist/src/react/index.d.ts +1 -1
- package/dist/src/react/use-ash-agent.d.ts +8 -0
- package/dist/src/react/use-ash-agent.js +26 -4
- package/dist/src/services/dev-client.d.ts +4 -1
- package/dist/src/services/dev-client.js +1 -0
- package/package.json +4 -4
- package/dist/src/chunks/host-DREC8e8Z.js +0 -65
- package/dist/src/chunks/paths-C6sp4T2U.js +0 -88
- package/dist/src/chunks/prewarm-hz8p2jlZ.js +0 -6
- package/dist/src/compiled/_chunks/workflow/resume-hook-CL8Ed91K.js +0 -12
- package/dist/src/compiled/_chunks/workflow/sleep-Dn3i9nxI.js +0 -1
- package/dist/src/execution/continuous-entry.d.ts +0 -59
- package/dist/src/execution/continuous-entry.js +0 -487
- package/dist/src/execution/continuous-runtime.d.ts +0 -17
- package/dist/src/execution/continuous-runtime.js +0 -123
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { World } from '../_workflow-world.js';
|
|
2
|
+
/**
|
|
3
|
+
* Create a new world instance based on environment variables.
|
|
4
|
+
* WORKFLOW_TARGET_WORLD is used to determine the target world.
|
|
5
|
+
*
|
|
6
|
+
* Note: WORKFLOW_VERCEL_* env vars (PROJECT, TEAM, AUTH_TOKEN, etc.) are
|
|
7
|
+
* intentionally NOT read here. Those are for CLI/observability tooling only
|
|
8
|
+
* and should not affect runtime behavior. The Vercel runtime provides
|
|
9
|
+
* authentication via OIDC tokens and project context via system env vars
|
|
10
|
+
* (VERCEL_DEPLOYMENT_ID, VERCEL_PROJECT_ID). Tooling that needs these env
|
|
11
|
+
* vars should call createVercelWorld() directly with an explicit config and
|
|
12
|
+
* use setWorld() to inject the instance.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createWorld: () => Promise<World>;
|
|
15
|
+
export type WorldHandlers = Pick<World, 'createQueueHandler' | 'specVersion'>;
|
|
16
|
+
/**
|
|
17
|
+
* Some functions from the world are needed at build time, but we do NOT want
|
|
18
|
+
* to cache the world in those instances for general use, since we don't have
|
|
19
|
+
* the correct environment variables set yet. This is a safe function to
|
|
20
|
+
* call at build time, that only gives access to non-environment-bound world
|
|
21
|
+
* functions. The only binding value should be the target world.
|
|
22
|
+
* Once we migrate to a file-based configuration (workflow.config.ts), we should
|
|
23
|
+
* be able to re-combine getWorld and getWorldHandlers into one singleton.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getWorldHandlers: () => Promise<WorldHandlers>;
|
|
26
|
+
export declare const getWorld: () => Promise<World>;
|
|
27
|
+
/**
|
|
28
|
+
* Reset the cached world instance. This should be called when environment
|
|
29
|
+
* variables change and you need to reinitialize the world with new config.
|
|
30
|
+
*/
|
|
31
|
+
export declare const setWorld: (world: World | undefined) => void;
|
|
32
|
+
//# sourceMappingURL=world.d.ts.map
|
|
@@ -1,67 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
export type WorkflowRun
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
get(params?: Record<string, any>, options?: Record<string, any>): Promise<any>;
|
|
24
|
-
list(
|
|
25
|
-
params?: Record<string, any>,
|
|
26
|
-
): Promise<{ cursor?: string | null; data: any[]; hasMore?: boolean }>;
|
|
27
|
-
}
|
|
28
|
-
export interface WorkflowWorld {
|
|
29
|
-
readonly events: WorkflowWorldCollection;
|
|
30
|
-
readonly hooks: WorkflowWorldCollection;
|
|
31
|
-
readonly runs: WorkflowWorldCollection;
|
|
32
|
-
readonly steps: WorkflowWorldCollection;
|
|
33
|
-
}
|
|
34
|
-
export declare class Run<T = any> {
|
|
35
|
-
readonly runId: string;
|
|
36
|
-
readonly readable: ReadableStream<Uint8Array>;
|
|
37
|
-
readonly returnValue: Promise<T>;
|
|
38
|
-
readonly status: Promise<string>;
|
|
39
|
-
cancel(): Promise<void>;
|
|
40
|
-
getReadable(options?: WorkflowReadableStreamOptions): ReadableStream<Uint8Array>;
|
|
41
|
-
}
|
|
42
|
-
export declare class WorkflowSuspension extends Error {}
|
|
43
|
-
export declare function cancelRun(...args: unknown[]): Promise<unknown>;
|
|
44
|
-
export declare function createWorld(...args: unknown[]): Promise<unknown>;
|
|
45
|
-
export declare function getHookByToken(...args: unknown[]): Promise<unknown>;
|
|
46
|
-
export declare function getRun<T = unknown>(runId: string): Run<T>;
|
|
47
|
-
export declare function getWorld(): Promise<WorkflowWorld>;
|
|
48
|
-
export declare function getWorldHandlers(): Promise<any>;
|
|
49
|
-
export declare function healthCheck(...args: unknown[]): Promise<HealthCheckResult>;
|
|
50
|
-
export declare function listStreams(...args: unknown[]): Promise<unknown>;
|
|
51
|
-
export declare function readStream<T = unknown>(
|
|
52
|
-
...args: unknown[]
|
|
53
|
-
): Promise<WorkflowReadableStream<T>>;
|
|
54
|
-
export declare function recreateRunFromExisting(...args: unknown[]): Promise<unknown>;
|
|
55
|
-
export declare function reenqueueRun(...args: unknown[]): Promise<unknown>;
|
|
56
|
-
export declare function resumeHook<T = unknown>(token: string, value?: T): Promise<void>;
|
|
57
|
-
export declare function resumeWebhook<T = unknown>(token: string, value?: T): Promise<Response>;
|
|
58
|
-
export declare function setWorld(world: unknown): void;
|
|
59
|
-
export declare function start<T = any>(
|
|
60
|
-
workflow: unknown,
|
|
61
|
-
args?: unknown[],
|
|
62
|
-
options?: StartOptions,
|
|
63
|
-
): Promise<Run<T>>;
|
|
64
|
-
export declare function wakeUpRun(...args: unknown[]): Promise<unknown>;
|
|
65
|
-
export declare function workflowEntrypoint(
|
|
66
|
-
workflowCode: string,
|
|
67
|
-
): (req: Request) => Promise<Response>;
|
|
1
|
+
import { type Event, type WorkflowRun } from './_workflow-world.js';
|
|
2
|
+
export type { Event, WorkflowRun };
|
|
3
|
+
export { WorkflowSuspension } from './global.js';
|
|
4
|
+
export { type HealthCheckEndpoint, type HealthCheckOptions, type HealthCheckResult, healthCheck, } from './runtime/helpers.js';
|
|
5
|
+
export { getHookByToken, resumeHook, resumeWebhook, } from './runtime/resume-hook.js';
|
|
6
|
+
export { getRun, Run, type WorkflowReadableStream, type WorkflowReadableStreamOptions, } from './runtime/run.js';
|
|
7
|
+
export { cancelRun, listStreams, type ReadStreamOptions, type RecreateRunOptions, readStream, recreateRunFromExisting, reenqueueRun, type StopSleepOptions, type StopSleepResult, wakeUpRun, } from './runtime/runs.js';
|
|
8
|
+
export { type StartOptions, type StartOptionsBase, type StartOptionsWithDeploymentId, type StartOptionsWithoutDeploymentId, start, } from './runtime/start.js';
|
|
9
|
+
export { createWorld, getWorld, getWorldHandlers, setWorld, } from './runtime/world.js';
|
|
10
|
+
/**
|
|
11
|
+
* Creates a single route which handles workflow execution requests,
|
|
12
|
+
* executing steps inline when possible to reduce function invocations
|
|
13
|
+
* and queue overhead.
|
|
14
|
+
*
|
|
15
|
+
* The handler loops: replay workflow → execute step inline → replay → ...
|
|
16
|
+
* until the workflow completes, times out, or encounters non-step suspensions.
|
|
17
|
+
*
|
|
18
|
+
* @param workflowCode - The workflow bundle code containing all workflow functions
|
|
19
|
+
* @returns A function that can be used as a Vercel API route
|
|
20
|
+
*/
|
|
21
|
+
export declare function workflowEntrypoint(workflowCode: string): (req: Request) => Promise<Response>;
|
|
22
|
+
//# sourceMappingURL=runtime.d.ts.map
|