eve 0.7.0 → 0.7.2
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 +15 -0
- package/dist/docs/public/README.md +16 -11
- package/dist/docs/public/agent-config.md +9 -9
- package/dist/docs/public/channels/custom.mdx +4 -4
- package/dist/docs/public/channels/discord.mdx +1 -1
- package/dist/docs/public/channels/eve.mdx +9 -9
- package/dist/docs/public/channels/github.mdx +1 -1
- package/dist/docs/public/channels/overview.mdx +21 -15
- package/dist/docs/public/channels/slack.mdx +2 -2
- package/dist/docs/public/channels/teams.mdx +1 -1
- package/dist/docs/public/channels/telegram.mdx +1 -1
- package/dist/docs/public/channels/twilio.mdx +1 -1
- package/dist/docs/public/{advanced → concepts}/context-control.md +3 -3
- package/dist/docs/public/{advanced → concepts}/default-harness.md +3 -3
- package/dist/docs/public/{advanced → concepts}/execution-model-and-durability.md +3 -1
- package/dist/docs/public/concepts/meta.json +10 -0
- package/dist/docs/public/{advanced → concepts}/security-model.md +2 -2
- package/dist/docs/public/{advanced → concepts}/sessions-runs-and-streaming.md +7 -7
- package/dist/docs/public/connections.mdx +3 -3
- package/dist/docs/public/evals/cases.mdx +1 -1
- package/dist/docs/public/evals/overview.mdx +2 -2
- package/dist/docs/public/evals/running.mdx +1 -1
- package/dist/docs/public/evals/targets.mdx +1 -1
- package/dist/docs/public/getting-started.mdx +28 -35
- package/dist/docs/public/{advanced → guides}/auth-and-route-protection.md +2 -2
- package/dist/docs/public/{client → guides/client}/continuations.mdx +2 -2
- package/dist/docs/public/{client → guides/client}/messages.mdx +1 -1
- package/dist/docs/public/{client → guides/client}/meta.json +1 -1
- package/dist/docs/public/{client → guides/client}/output-schema.mdx +2 -2
- package/dist/docs/public/{client → guides/client}/overview.mdx +5 -5
- package/dist/docs/public/{client → guides/client}/streaming.mdx +1 -1
- package/dist/docs/public/{advanced → guides}/deployment.md +9 -1
- package/dist/docs/public/{advanced → guides}/dynamic-capabilities.md +1 -1
- package/dist/docs/public/{advanced → guides}/dynamic-workflows.md +1 -1
- package/dist/docs/public/{frontend → guides/frontend}/nextjs.mdx +3 -3
- package/dist/docs/public/{frontend → guides/frontend}/nuxt.mdx +3 -3
- package/dist/docs/public/{frontend → guides/frontend}/overview.mdx +6 -6
- package/dist/docs/public/{frontend → guides/frontend}/sveltekit.mdx +3 -3
- package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-svelte.mdx +2 -2
- package/dist/docs/public/{frontend → guides/frontend}/use-eve-agent-vue.mdx +2 -2
- package/dist/docs/public/{advanced → guides}/hooks.md +2 -2
- package/dist/docs/public/{advanced → guides}/instrumentation.md +2 -0
- package/dist/docs/public/{advanced → guides}/meta.json +8 -11
- package/dist/docs/public/{advanced → guides}/session-context.md +2 -2
- package/dist/docs/public/{advanced → guides}/state.md +1 -1
- package/dist/docs/public/instructions.mdx +2 -2
- package/dist/docs/public/introduction.md +5 -2
- package/dist/docs/public/meta.json +3 -3
- package/dist/docs/public/reference/cli.md +3 -3
- package/dist/docs/public/reference/meta.json +1 -1
- package/dist/docs/public/reference/project-layout.md +5 -1
- package/dist/docs/public/reference/typescript-api.md +23 -23
- package/dist/docs/public/sandbox.mdx +1 -1
- package/dist/docs/public/schedules.mdx +2 -2
- package/dist/docs/public/skills.mdx +3 -3
- package/dist/docs/public/subagents.mdx +3 -3
- package/dist/docs/public/tools.mdx +4 -4
- package/dist/docs/public/tutorial/connect-a-warehouse.mdx +2 -2
- package/dist/docs/public/tutorial/first-agent.mdx +1 -1
- package/dist/docs/public/tutorial/guard-the-spend.mdx +1 -1
- package/dist/docs/public/tutorial/how-it-runs.mdx +2 -2
- package/dist/docs/public/tutorial/meta.json +1 -1
- package/dist/docs/public/tutorial/query-sample-data.mdx +1 -1
- package/dist/docs/public/tutorial/remember-definitions.mdx +3 -3
- package/dist/docs/public/tutorial/run-analysis.mdx +1 -1
- package/dist/docs/public/tutorial/ship-it.mdx +4 -4
- package/dist/docs/public/tutorial/team-playbooks.mdx +3 -3
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +2 -2
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +2 -2
- package/dist/src/compiled/@workflow/core/capabilities.d.ts +19 -1
- package/dist/src/compiled/@workflow/core/class-serialization.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +37 -0
- package/dist/src/compiled/@workflow/core/global.d.ts +11 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -2
- package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +84 -0
- package/dist/src/compiled/@workflow/core/runtime.js +27 -27
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +21 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +72 -6
- package/dist/src/compiled/@workflow/core/symbols.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/attribute-dispatcher.d.ts +6 -0
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +3 -4
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +48 -0
- package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/queue.d.ts +3 -0
- package/dist/src/compiled/@workflow/world/runs.d.ts +2 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +2 -1
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DGVGRGfw.js +59 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-DMSadN9o.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-BRdn7zy_.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-CpXfoXLF.js +1 -0
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -6
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/package.json +6 -6
- package/dist/docs/public/reference/faqs.md +0 -48
- package/dist/src/compiled/_chunks/workflow/resume-hook-CEAS3opc.js +0 -12
- package/dist/src/compiled/_chunks/workflow/sleep-Cup6vPoA.js +0 -1
- package/dist/src/compiled/_chunks/workflow/symbols-BUTtwS7j.js +0 -48
- /package/dist/docs/public/{advanced → guides}/dev-tui.md +0 -0
- /package/dist/docs/public/{frontend → guides/frontend}/meta.json +0 -0
- /package/dist/docs/public/{advanced → guides}/remote-agents.md +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,i as t}from"../../_chunks/workflow/dist-6a3viBXZ.js";import{
|
|
2
|
-
`)}`)}return await
|
|
1
|
+
import{c as e,i as t}from"../../_chunks/workflow/dist-6a3viBXZ.js";import{Jn as n,Jt as r,Kt as i,L as a,R as o,S as s,Xn as c,Yn as l,an as u,h as d,in as f,on as p,qt as m,rn as h,t as g,w as _}from"../../_chunks/workflow/attribute-changes-DGVGRGfw.js";import{n as v}from"../../_chunks/workflow/resume-hook-DMSadN9o.js";import{t as y}from"../../_chunks/workflow/sleep-CpXfoXLF.js";function b(e){l(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,b)}function x(e){l(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,x)}function S({schema:e}={}){function t(e){l(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await v(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
|
|
2
|
+
`)}`)}return await v(t,r.value)}}}async function C(e,n={}){let r=o.getStore(),i=r?.workflowMetadata?.workflowRunId;if(!i)throw new t(`experimental_setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let a=g(e,n);a.length!==0&&await(await h()).events.create(i,{eventType:`attr_set`,specVersion:4,eventData:{changes:a,writer:{type:`step`,stepId:r.stepMetadata.stepId,attempt:r.stepMetadata.attempt},...n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}})}function w(){let e=o.getStore();return e||n(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,w),e.stepMetadata}function T(){let e=o.getStore();return e||c(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,T),e.workflowMetadata}function E(e={}){let t=o.getStore();t||c(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,E);let{namespace:n}=e,l=t.workflowMetadata.workflowRunId,h=a(l,n),g=t.writables??=new Map,v=g.get(h);if(v)return v.writable;let y=_(s(globalThis,t.ops,l,t.encryptionKey,!0),t.encryptionKey),b=new d(l,h),x=f();return t.ops.push(x.promise),u(y.readable,b,x).catch(()=>{}),p(y.writable,x),Object.defineProperty(y.writable,i,{value:h,writable:!1}),Object.defineProperty(y.writable,r,{value:l,writable:!1}),t.workflowDeploymentId&&Object.defineProperty(y.writable,m,{value:t.workflowDeploymentId,writable:!1}),g.set(h,{writable:y.writable,state:x}),y.writable}export{t as FatalError,e as RetryableError,b as createHook,x as createWebhook,S as defineHook,C as experimental_setAttributes,w as getStepMetadata,T as getWorkflowMetadata,E as getWritable,y as sleep};
|
|
@@ -10,6 +10,12 @@ export interface StartOptionsBase {
|
|
|
10
10
|
* The spec version to use for the workflow run. Defaults to the latest version.
|
|
11
11
|
*/
|
|
12
12
|
specVersion?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Plaintext attributes to seed on the run as it is created.
|
|
15
|
+
*
|
|
16
|
+
* Available for native-attributes runs (spec version 4 and later).
|
|
17
|
+
*/
|
|
18
|
+
attributes?: Record<string, string>;
|
|
13
19
|
}
|
|
14
20
|
export interface StartOptionsWithDeploymentId extends StartOptionsBase {
|
|
15
21
|
/**
|
|
@@ -24,10 +24,23 @@ export interface SuspensionHandlerResult {
|
|
|
24
24
|
* into the same batch boundary.
|
|
25
25
|
*/
|
|
26
26
|
createdStepCorrelationIds: Set<string>;
|
|
27
|
-
/**
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The soonest pending wait, if any: seconds until it elapses and the
|
|
29
|
+
* correlationId of the wait that produced that timeout. The
|
|
30
|
+
* correlationId seeds the idempotency key for the wait-continuation
|
|
31
|
+
* queue message so that repeated suspension passes over the same
|
|
32
|
+
* pending wait collapse into a single delayed continuation.
|
|
33
|
+
*/
|
|
34
|
+
waitTimeout?: {
|
|
35
|
+
seconds: number;
|
|
36
|
+
correlationId: string;
|
|
37
|
+
};
|
|
29
38
|
/** Whether a hook conflict was detected (should re-invoke immediately) */
|
|
30
39
|
hasHookConflict: boolean;
|
|
40
|
+
/** Whether a `hook.getConflict()` awaiter needs the workflow to continue immediately */
|
|
41
|
+
hasAwaitedHookCreation: boolean;
|
|
42
|
+
/** Whether native workflow attribute events were written for replay. */
|
|
43
|
+
hasAttributeEvents: boolean;
|
|
31
44
|
}
|
|
32
45
|
/**
|
|
33
46
|
* Handles a workflow suspension by processing all pending operations (hooks, steps, waits).
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wait-continuation dispatch: delay + idempotency-key selection.
|
|
3
|
+
*
|
|
4
|
+
* When V2 suspension processing observes a pending wait, it enqueues a
|
|
5
|
+
* delayed "continuation" message that fires once the wait elapses and
|
|
6
|
+
* drives the next replay (which completes the wait via the "complete
|
|
7
|
+
* elapsed waits" pass). This module decides the message's `delaySeconds`
|
|
8
|
+
* and `idempotencyKey`.
|
|
9
|
+
*
|
|
10
|
+
* The continuation is keyed on the wait's correlationId: while a wait is
|
|
11
|
+
* pending, every replay pass over the run re-observes it (e.g., once per
|
|
12
|
+
* step completion in `Promise.all([steps..., sleep()])`), and without
|
|
13
|
+
* dedupe each pass would enqueue another delayed continuation — each one
|
|
14
|
+
* a spurious full replay when the wait elapses, and each a fresh message
|
|
15
|
+
* that resets the delivery-attempt runaway guard. A key is attached in
|
|
16
|
+
* all cases: some worlds (e.g. world-postgres) serialize key-less
|
|
17
|
+
* workflow messages per run, which would park the continuation behind
|
|
18
|
+
* the handler's own inline step execution and defeat the race semantics
|
|
19
|
+
* the continuation exists to provide.
|
|
20
|
+
*
|
|
21
|
+
* The bare correlationId cannot be the key in every case, though: world
|
|
22
|
+
* dedupe windows outlive the first delivery (VQS keeps idempotency
|
|
23
|
+
* records until message-retention TTL; world-postgres keeps a
|
|
24
|
+
* completed-keys cache), so once a key has been used, a later enqueue
|
|
25
|
+
* under the same key is silently dropped. Any situation where a
|
|
26
|
+
* continuation is delivered while its wait is still pending therefore
|
|
27
|
+
* needs a fresh key for the re-enqueue, or the wait's timer is lost and
|
|
28
|
+
* the run stalls until unrelated traffic happens to wake it. Two such
|
|
29
|
+
* situations exist, each with its own key variation:
|
|
30
|
+
*
|
|
31
|
+
* - Waits longer than the maximum queue delay are chained: the delay is
|
|
32
|
+
* clamped to `WAIT_CONTINUATION_MAX_DELAY_SECONDS` (23h — VQS messages
|
|
33
|
+
* have a 24h retention limit, and one hour of buffer matches
|
|
34
|
+
* world-vercel's own clamp for delayed re-enqueues), so the
|
|
35
|
+
* continuation intentionally fires early, re-observes the wait, and
|
|
36
|
+
* must enqueue the next hop. The key is suffixed with the hop index
|
|
37
|
+
* (`ceil(timeoutSeconds / maxDelay)`): stable for every re-observation
|
|
38
|
+
* within the same hop window (so passes dedupe), decremented at each
|
|
39
|
+
* hop delivery (so the chain always advances). Worlds without a delay
|
|
40
|
+
* limit (world-postgres, world-local) simply take the same ≤23h hops.
|
|
41
|
+
*
|
|
42
|
+
* - Near-elapsed waits (≤2s remaining) get a second-bucketed suffix. A
|
|
43
|
+
* continuation delivered marginally early (clock skew between the
|
|
44
|
+
* enqueuing and handling hosts; the ceil() on the delay can leave a ~0
|
|
45
|
+
* margin) re-observes the wait as pending with ~1s remaining and must
|
|
46
|
+
* be able to enqueue a fresh short-delay retry. The bucket suffix
|
|
47
|
+
* keeps that retry enqueueable (its ≥1s delay guarantees a later
|
|
48
|
+
* bucket) while still collapsing same-instant duplicates.
|
|
49
|
+
*
|
|
50
|
+
* Mid-range waits (more than the near-elapsed threshold, at most one
|
|
51
|
+
* hop) use the bare correlationId: every re-observation targets the same
|
|
52
|
+
* deadline, so deduping to the first message is semantically lossless.
|
|
53
|
+
* Host clock skew beyond the near-elapsed threshold could in principle
|
|
54
|
+
* deliver such a continuation early enough to re-observe its wait and
|
|
55
|
+
* lose the re-enqueue to the burnt key; the threshold is the skew
|
|
56
|
+
* tolerance we accept for the benefit of exactly-one continuation per
|
|
57
|
+
* wait.
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Maximum `delaySeconds` for a single wait-continuation message. Waits
|
|
61
|
+
* longer than this are chained across multiple hops. 23 hours: VQS
|
|
62
|
+
* messages have a 24h retention limit; the 1h buffer mirrors
|
|
63
|
+
* world-vercel's `MAX_DELAY_SECONDS`.
|
|
64
|
+
*/
|
|
65
|
+
export declare const WAIT_CONTINUATION_MAX_DELAY_SECONDS = 82800;
|
|
66
|
+
/**
|
|
67
|
+
* Waits with at most this many seconds remaining use a second-bucketed
|
|
68
|
+
* idempotency key so an early-delivered continuation can re-enqueue its
|
|
69
|
+
* short-delay retry. This is also the host clock-skew tolerance for
|
|
70
|
+
* mid-range waits keyed on the bare correlationId.
|
|
71
|
+
*/
|
|
72
|
+
export declare const NEAR_ELAPSED_WAIT_THRESHOLD_SECONDS = 2;
|
|
73
|
+
export interface WaitContinuationDispatch {
|
|
74
|
+
delaySeconds: number;
|
|
75
|
+
idempotencyKey: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Computes the queue delay and idempotency key for a wait-continuation
|
|
79
|
+
* message. `timeoutSeconds` is the time until the wait's `resumeAt`
|
|
80
|
+
* (floored at 1s by the suspension handler); `waitCorrelationId`
|
|
81
|
+
* identifies the wait so repeated suspension passes dedupe.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getWaitContinuationDispatch(timeoutSeconds: number, waitCorrelationId: string, now?: number): WaitContinuationDispatch;
|
|
84
|
+
//# sourceMappingURL=wait-continuation.d.ts.map
|