eve 0.17.0 → 0.17.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 +22 -0
- package/dist/src/channel/types.d.ts +11 -0
- package/dist/src/chunks/{use-eve-agent-BEOUv37s.js → use-eve-agent-Bh1NmXO9.js} +8 -5
- package/dist/src/chunks/{use-eve-agent-C25KOe9i.js → use-eve-agent-Dvy_Wjvq.js} +8 -5
- package/dist/src/cli/dev/tui/status-line.d.ts +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +2 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/url-target.d.ts +14 -0
- package/dist/src/cli/dev/url-target.js +1 -0
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/client.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +4 -4
- package/dist/src/compiled/@chat-adapter/slack/api.d.ts +132 -0
- package/dist/src/compiled/@chat-adapter/slack/api.js +1 -0
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/format.d.ts +33 -0
- package/dist/src/compiled/@chat-adapter/slack/format.js +1 -0
- package/dist/src/compiled/@chat-adapter/slack/index.js +28 -28
- package/dist/src/compiled/@chat-adapter/slack/types-AntsVifS.d.ts +187 -0
- package/dist/src/compiled/@chat-adapter/slack/webhook.d.ts +10 -0
- package/dist/src/compiled/@chat-adapter/slack/webhook.js +1 -0
- package/dist/src/compiled/@workflow/core/classify-error.d.ts +15 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/runtime.js +27 -27
- package/dist/src/compiled/@workflow/core/serialization.d.ts +12 -3
- package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +10 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-B__hKQV7.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-HFKBBKCJ-CWaVIQuL.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DUxG-Gic.js → attribute-changes-zAifvEhb.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-CUCPW67D.js → resume-hook-C15uJ2ik.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/run-BJUPZ0Ni.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{sleep-Dxuzj5to.js → sleep-C8B-TYir.js} +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/context/keys.js +1 -1
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/execution/create-session-step.d.ts +2 -0
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +3 -0
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/session.d.ts +6 -1
- package/dist/src/execution/session.js +3 -3
- package/dist/src/execution/subagent-invocation.d.ts +20 -5
- package/dist/src/execution/subagent-invocation.js +2 -2
- package/dist/src/execution/subagent-tool.d.ts +7 -0
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +33 -0
- package/dist/src/harness/advertised-tools.js +1 -0
- package/dist/src/harness/subagent-depth.d.ts +17 -0
- package/dist/src/harness/subagent-depth.js +1 -0
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +30 -22
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +28 -0
- package/dist/src/harness/workflow-continuation-security.d.ts +1 -0
- package/dist/src/harness/workflow-continuation-security.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/http/basic-auth.d.ts +1 -0
- package/dist/src/internal/http/basic-auth.js +1 -0
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +5 -0
- package/dist/src/internal/nitro/routes/channel-route-context.js +1 -0
- package/dist/src/internal/nitro/routes/info.d.ts +2 -6
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/protocol/routes.d.ts +2 -4
- package/dist/src/public/channels/eve.d.ts +5 -4
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/slack/api.d.ts +3 -6
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/inbound.d.ts +11 -9
- package/dist/src/public/channels/slack/inbound.js +1 -1
- package/dist/src/public/channels/slack/interactions.d.ts +2 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/mrkdwn.d.ts +3 -35
- package/dist/src/public/channels/slack/mrkdwn.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/slack/verify.d.ts +4 -42
- package/dist/src/public/channels/slack/verify.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +1 -1
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/services/dev-client/client-options.d.ts +5 -1
- package/dist/src/services/dev-client/client-options.js +1 -1
- package/dist/src/setup/boxes/preflight.js +1 -1
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/scaffold/create/project.d.ts +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +3 -0
- package/dist/src/setup/scaffold/create/web-template.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +37 -0
- package/dist/src/shared/default-agent-model.d.ts +1 -1
- package/dist/src/shared/default-agent-model.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +35 -8
- package/docs/channels/eve.mdx +3 -2
- package/docs/concepts/sessions-runs-and-streaming.md +2 -2
- package/docs/getting-started.mdx +5 -5
- package/docs/guides/dev-tui.md +7 -1
- package/docs/reference/cli.md +10 -1
- package/docs/reference/typescript-api.md +1 -1
- package/docs/subagents.mdx +19 -0
- package/package.json +5 -5
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-Csu8sG38.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-CVlF84yI.js +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
type SlackHeaderValue = readonly string[] | string | null | undefined;
|
|
2
|
+
type SlackHeaders = Headers | Iterable<readonly [string, string]> | Record<string, SlackHeaderValue>;
|
|
3
|
+
type SlackWebhookVerifier = (request: Request, body: string) => Promise<unknown> | unknown;
|
|
4
|
+
interface SlackVerifyOptions {
|
|
5
|
+
maxSkewSeconds?: number;
|
|
6
|
+
now?: () => number;
|
|
7
|
+
signingSecret?: string;
|
|
8
|
+
webhookVerifier?: SlackWebhookVerifier;
|
|
9
|
+
}
|
|
10
|
+
interface SlackParseOptions {
|
|
11
|
+
contentType?: string | null;
|
|
12
|
+
headers?: SlackHeaders;
|
|
13
|
+
}
|
|
14
|
+
interface SlackReadOptions extends SlackParseOptions, SlackVerifyOptions {
|
|
15
|
+
}
|
|
16
|
+
interface SlackRetry {
|
|
17
|
+
num: number;
|
|
18
|
+
reason?: string;
|
|
19
|
+
}
|
|
20
|
+
interface SlackContinuation {
|
|
21
|
+
channelId: string;
|
|
22
|
+
enterpriseId?: string;
|
|
23
|
+
teamId?: string;
|
|
24
|
+
threadTs: string;
|
|
25
|
+
}
|
|
26
|
+
interface SlackUser {
|
|
27
|
+
id: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
teamId?: string;
|
|
30
|
+
username?: string;
|
|
31
|
+
}
|
|
32
|
+
interface SlackFile {
|
|
33
|
+
downloadUrl?: string;
|
|
34
|
+
filetype?: string;
|
|
35
|
+
id: string;
|
|
36
|
+
mimeType?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
raw: Record<string, unknown>;
|
|
39
|
+
size?: number;
|
|
40
|
+
title?: string;
|
|
41
|
+
type: "audio" | "file" | "image" | "video";
|
|
42
|
+
url?: string;
|
|
43
|
+
}
|
|
44
|
+
type SlackWebhookPayload = SlackAppMentionPayload | SlackBlockActionsPayload | SlackBlockSuggestionPayload | SlackDirectMessagePayload | SlackSlashCommandPayload | SlackUnsupportedPayload | SlackUrlVerificationPayload | SlackViewClosedPayload | SlackViewSubmissionPayload;
|
|
45
|
+
interface SlackUrlVerificationPayload {
|
|
46
|
+
challenge: string;
|
|
47
|
+
kind: "url_verification";
|
|
48
|
+
raw: Record<string, unknown>;
|
|
49
|
+
retry?: SlackRetry;
|
|
50
|
+
}
|
|
51
|
+
interface SlackEventBasePayload {
|
|
52
|
+
apiAppId?: string;
|
|
53
|
+
channelId: string;
|
|
54
|
+
continuation: SlackContinuation;
|
|
55
|
+
enterpriseId?: string;
|
|
56
|
+
eventId?: string;
|
|
57
|
+
eventTime?: number;
|
|
58
|
+
files?: SlackFile[];
|
|
59
|
+
isExtSharedChannel?: boolean;
|
|
60
|
+
raw: Record<string, unknown>;
|
|
61
|
+
retry?: SlackRetry;
|
|
62
|
+
teamId?: string;
|
|
63
|
+
text: string;
|
|
64
|
+
threadTs: string;
|
|
65
|
+
ts: string;
|
|
66
|
+
userId?: string;
|
|
67
|
+
}
|
|
68
|
+
interface SlackAppMentionPayload extends SlackEventBasePayload {
|
|
69
|
+
eventType: "app_mention";
|
|
70
|
+
kind: "app_mention";
|
|
71
|
+
}
|
|
72
|
+
interface SlackDirectMessagePayload extends SlackEventBasePayload {
|
|
73
|
+
botId?: string;
|
|
74
|
+
eventType: "message";
|
|
75
|
+
kind: "direct_message";
|
|
76
|
+
subtype?: string;
|
|
77
|
+
}
|
|
78
|
+
interface SlackSlashCommandPayload {
|
|
79
|
+
channelId: string;
|
|
80
|
+
channelName?: string;
|
|
81
|
+
command: string;
|
|
82
|
+
enterpriseId?: string;
|
|
83
|
+
isEnterpriseInstall: boolean;
|
|
84
|
+
kind: "slash_command";
|
|
85
|
+
raw: Record<string, string>;
|
|
86
|
+
responseUrl?: string;
|
|
87
|
+
retry?: SlackRetry;
|
|
88
|
+
teamId?: string;
|
|
89
|
+
text: string;
|
|
90
|
+
triggerId?: string;
|
|
91
|
+
userId: string;
|
|
92
|
+
userName?: string;
|
|
93
|
+
}
|
|
94
|
+
interface SlackAction {
|
|
95
|
+
actionId: string;
|
|
96
|
+
blockId?: string;
|
|
97
|
+
label?: string;
|
|
98
|
+
raw: Record<string, unknown>;
|
|
99
|
+
selectedOptionLabel?: string;
|
|
100
|
+
selectedOptionValue?: string;
|
|
101
|
+
type: string;
|
|
102
|
+
user?: SlackUser;
|
|
103
|
+
value?: string;
|
|
104
|
+
}
|
|
105
|
+
interface SlackBlockActionsPayload {
|
|
106
|
+
actions: SlackAction[];
|
|
107
|
+
channelId?: string;
|
|
108
|
+
continuation?: SlackContinuation;
|
|
109
|
+
enterpriseId?: string;
|
|
110
|
+
isEnterpriseInstall?: boolean;
|
|
111
|
+
kind: "block_actions";
|
|
112
|
+
messageBlocks?: unknown[];
|
|
113
|
+
messagePromptBlock?: unknown;
|
|
114
|
+
messagePromptText?: string;
|
|
115
|
+
messageTs?: string;
|
|
116
|
+
raw: Record<string, unknown>;
|
|
117
|
+
responseUrl?: string;
|
|
118
|
+
retry?: SlackRetry;
|
|
119
|
+
teamId?: string;
|
|
120
|
+
threadTs?: string;
|
|
121
|
+
triggerId?: string;
|
|
122
|
+
user?: SlackUser;
|
|
123
|
+
userId: string;
|
|
124
|
+
userName?: string;
|
|
125
|
+
}
|
|
126
|
+
interface SlackBlockSuggestionPayload {
|
|
127
|
+
actionId: string;
|
|
128
|
+
blockId: string;
|
|
129
|
+
channelId?: string;
|
|
130
|
+
enterpriseId?: string;
|
|
131
|
+
kind: "block_suggestion";
|
|
132
|
+
raw: Record<string, unknown>;
|
|
133
|
+
retry?: SlackRetry;
|
|
134
|
+
teamId?: string;
|
|
135
|
+
userId: string;
|
|
136
|
+
value: string;
|
|
137
|
+
}
|
|
138
|
+
interface SlackViewSubmissionPayload {
|
|
139
|
+
callbackId?: string;
|
|
140
|
+
enterpriseId?: string;
|
|
141
|
+
kind: "view_submission";
|
|
142
|
+
privateMetadata?: string;
|
|
143
|
+
raw: Record<string, unknown>;
|
|
144
|
+
responseUrls?: unknown[];
|
|
145
|
+
retry?: SlackRetry;
|
|
146
|
+
teamId?: string;
|
|
147
|
+
user?: SlackUser;
|
|
148
|
+
userId: string;
|
|
149
|
+
values?: SlackViewStateValue[];
|
|
150
|
+
view: Record<string, unknown>;
|
|
151
|
+
}
|
|
152
|
+
interface SlackViewClosedPayload {
|
|
153
|
+
enterpriseId?: string;
|
|
154
|
+
kind: "view_closed";
|
|
155
|
+
raw: Record<string, unknown>;
|
|
156
|
+
retry?: SlackRetry;
|
|
157
|
+
teamId?: string;
|
|
158
|
+
user?: SlackUser;
|
|
159
|
+
userId: string;
|
|
160
|
+
view: Record<string, unknown>;
|
|
161
|
+
}
|
|
162
|
+
interface SlackViewStateValue {
|
|
163
|
+
actionId: string;
|
|
164
|
+
blockId: string;
|
|
165
|
+
raw: Record<string, unknown>;
|
|
166
|
+
selectedOptionLabel?: string;
|
|
167
|
+
selectedOptionValue?: string;
|
|
168
|
+
type?: string;
|
|
169
|
+
value?: string;
|
|
170
|
+
}
|
|
171
|
+
interface SlackUnsupportedPayload {
|
|
172
|
+
kind: "unsupported";
|
|
173
|
+
raw: unknown;
|
|
174
|
+
retry?: SlackRetry;
|
|
175
|
+
type: string;
|
|
176
|
+
}
|
|
177
|
+
declare class SlackWebhookError extends Error {
|
|
178
|
+
constructor(message: string);
|
|
179
|
+
}
|
|
180
|
+
declare class SlackWebhookVerificationError extends SlackWebhookError {
|
|
181
|
+
constructor(message: string);
|
|
182
|
+
}
|
|
183
|
+
declare class SlackWebhookParseError extends SlackWebhookError {
|
|
184
|
+
constructor(message: string);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export { type SlackAction as S, type SlackAppMentionPayload as a, type SlackBlockActionsPayload as b, type SlackBlockSuggestionPayload as c, type SlackContinuation as d, type SlackDirectMessagePayload as e, type SlackEventBasePayload as f, type SlackFile as g, type SlackHeaderValue as h, type SlackHeaders as i, type SlackParseOptions as j, type SlackReadOptions as k, type SlackRetry as l, type SlackSlashCommandPayload as m, type SlackUnsupportedPayload as n, type SlackUrlVerificationPayload as o, type SlackUser as p, type SlackVerifyOptions as q, type SlackViewClosedPayload as r, type SlackViewStateValue as s, type SlackViewSubmissionPayload as t, SlackWebhookError as u, SlackWebhookParseError as v, type SlackWebhookPayload as w, SlackWebhookVerificationError as x, type SlackWebhookVerifier as y };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { j as SlackParseOptions, w as SlackWebhookPayload, k as SlackReadOptions, q as SlackVerifyOptions, i as SlackHeaders } from './types-AntsVifS.js';
|
|
2
|
+
export { S as SlackAction, a as SlackAppMentionPayload, b as SlackBlockActionsPayload, c as SlackBlockSuggestionPayload, d as SlackContinuation, e as SlackDirectMessagePayload, f as SlackEventBasePayload, g as SlackFile, h as SlackHeaderValue, l as SlackRetry, m as SlackSlashCommandPayload, n as SlackUnsupportedPayload, o as SlackUrlVerificationPayload, p as SlackUser, r as SlackViewClosedPayload, s as SlackViewStateValue, t as SlackViewSubmissionPayload, u as SlackWebhookError, v as SlackWebhookParseError, x as SlackWebhookVerificationError, y as SlackWebhookVerifier } from './types-AntsVifS.js';
|
|
3
|
+
|
|
4
|
+
declare function parseSlackWebhookBody(body: string, options?: SlackParseOptions): SlackWebhookPayload;
|
|
5
|
+
|
|
6
|
+
declare function readSlackWebhook(request: Request, options: SlackReadOptions): Promise<SlackWebhookPayload>;
|
|
7
|
+
declare function verifySlackRequest(request: Request, options: SlackVerifyOptions): Promise<string>;
|
|
8
|
+
declare function verifySlackSignature(body: string, headers: SlackHeaders, options: SlackVerifyOptions): Promise<void>;
|
|
9
|
+
|
|
10
|
+
export { SlackHeaders, SlackParseOptions, SlackReadOptions, SlackVerifyOptions, SlackWebhookPayload, parseSlackWebhookBody, readSlackWebhook, verifySlackRequest, verifySlackSignature };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"../../_chunks/node/chunk-HFKBBKCJ-CWaVIQuL.js";export{o as SlackWebhookError,n as SlackWebhookParseError,i as SlackWebhookVerificationError,t as parseSlackWebhookBody,e as readSlackWebhook,r as verifySlackRequest,a as verifySlackSignature};
|
|
@@ -16,5 +16,20 @@ import { type RunErrorCode, WorkflowWorldError } from '#compiled/@workflow/error
|
|
|
16
16
|
* errors as user errors.
|
|
17
17
|
*/
|
|
18
18
|
export declare function isWorldContractError(err: unknown): err is WorkflowWorldError;
|
|
19
|
+
/**
|
|
20
|
+
* True when an error from a world (workflow-server) call is a transient
|
|
21
|
+
* infrastructure failure that should be retried by redelivering the queue
|
|
22
|
+
* message, rather than failing the run. A fresh invocation will likely
|
|
23
|
+
* succeed once the backend (or the firewall in front of it) recovers.
|
|
24
|
+
*
|
|
25
|
+
* - `ThrottleError` (429): rate limited / load shed
|
|
26
|
+
* - `WorkflowWorldError` with `status >= 500`: server-side error
|
|
27
|
+
* - `WorkflowWorldError` with a retryable transport `code` (`TRANSPORT` /
|
|
28
|
+
* `TIMEOUT`): the request never produced a usable response
|
|
29
|
+
*
|
|
30
|
+
* Uses `.is()` name-based duck checks (not `instanceof`) for the same
|
|
31
|
+
* cross-`vm`-realm reason described on `classifyRunError`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isRetryableWorldError(err: unknown): boolean;
|
|
19
34
|
export declare function classifyRunError(err: unknown): RunErrorCode;
|
|
20
35
|
//# sourceMappingURL=classify-error.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,i as t}from"../../_chunks/workflow/dist-Dxrjttr2.js";import{L as n,R as r,S as i,_n as a,bn as o,cn as s,dr as c,h as l,lr as u,on as d,sn as f,t as p,ur as m,vn as h,w as g,yn as _}from"../../_chunks/workflow/attribute-changes-
|
|
2
|
-
`)}`)}return await v(t,r.value)}}}async function C(e,n={}){let i=r.getStore(),o=i?.workflowMetadata?.workflowRunId;if(!o)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 s=p(e,n);s.length!==0
|
|
1
|
+
import{c as e,i as t}from"../../_chunks/workflow/dist-Dxrjttr2.js";import{L as n,R as r,S as i,_n as a,bn as o,cn as s,dr as c,h as l,lr as u,on as d,sn as f,t as p,ur as m,vn as h,w as g,yn as _}from"../../_chunks/workflow/attribute-changes-zAifvEhb.js";import{n as v}from"../../_chunks/workflow/resume-hook-C15uJ2ik.js";import{t as y}from"../../_chunks/workflow/sleep-C8B-TYir.js";function b(e){m(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,b)}function x(e){m(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,x)}function S({schema:e}={}){function t(e){m(`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 i=r.getStore(),o=i?.workflowMetadata?.workflowRunId;if(!o)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 s=p(e,n);if(s.length!==0){if(i.runReadyBarrier)try{await i.runReadyBarrier}catch{}await(await a()).events.create(o,{eventType:`attr_set`,specVersion:5,eventData:{changes:s,writer:{type:`step`,stepId:i.stepMetadata.stepId,attempt:i.stepMetadata.attempt},...n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}})}}function w(){let e=r.getStore();return e||u(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,w),e.stepMetadata}function T(){let e=r.getStore();return e||c(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,T),e.workflowMetadata}function E(e={}){let t=r.getStore();t||c(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,E);let{namespace:a}=e,u=t.workflowMetadata.workflowRunId,p=n(u,a),m=t.writables??=new Map,v=m.get(p);if(v)return v.writable;let y=g(i(globalThis,t.ops,u,t.encryptionKey,!0,t.runReadyBarrier),t.encryptionKey),b=new l(u,p,t.runReadyBarrier),x=h();return t.ops.push(x.promise),_(y.readable,b,x).catch(()=>{}),o(y.writable,x),Object.defineProperty(y.writable,d,{value:p,writable:!1}),Object.defineProperty(y.writable,s,{value:u,writable:!1}),t.workflowDeploymentId&&Object.defineProperty(y.writable,f,{value:t.workflowDeploymentId,writable:!1}),m.set(p,{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};
|