experimental-ash 0.22.2 → 0.23.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/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 +2 -2
- 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-d_35Mp8T.js} +1 -1
- package/dist/src/chunks/{host-DREC8e8Z.js → host-tji7W0Nn.js} +2 -2
- package/dist/src/chunks/paths-YoCQlavu.js +89 -0
- package/dist/src/chunks/{prewarm-hz8p2jlZ.js → prewarm-6duWvvb5.js} +1 -1
- 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 +1 -1
- 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 +19 -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 +45 -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/log-format.d.ts +25 -0
- package/dist/src/compiled/@workflow/core/logger.d.ts +29 -0
- package/dist/src/compiled/@workflow/core/private.d.ts +59 -10
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +4 -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/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/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 +201 -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 +329 -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 +20 -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/evals/cli/eval.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- 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 +1 -1
- package/dist/src/chunks/paths-C6sp4T2U.js +0 -88
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the serialization system.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* A format prefix is exactly 4 lowercase alphanumeric characters [a-z0-9].
|
|
6
|
+
*
|
|
7
|
+
* This is a branded string type — use `isFormatPrefix()` to validate
|
|
8
|
+
* at runtime. The `SerializationFormat` object provides well-known
|
|
9
|
+
* constants, but codecs may define additional prefixes.
|
|
10
|
+
*/
|
|
11
|
+
export type FormatPrefix = string & {
|
|
12
|
+
readonly __brand: 'FormatPrefix';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Runtime type guard for format prefix strings.
|
|
16
|
+
*
|
|
17
|
+
* Validates that a string is exactly 4 characters of [a-z0-9].
|
|
18
|
+
*/
|
|
19
|
+
export declare function isFormatPrefix(value: string): value is FormatPrefix;
|
|
20
|
+
/**
|
|
21
|
+
* Well-known format prefix constants. Codecs may define additional ones.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SerializationFormat: {
|
|
24
|
+
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
25
|
+
readonly DEVALUE_V1: FormatPrefix;
|
|
26
|
+
/** Encrypted payload (inner payload has its own format prefix) */
|
|
27
|
+
readonly ENCRYPTED: FormatPrefix;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Types that need specialized handling when serialized/deserialized.
|
|
31
|
+
* If a type is added here, it MUST also be added to the `Serializable`
|
|
32
|
+
* type in `schemas.ts`.
|
|
33
|
+
*/
|
|
34
|
+
export interface SerializableSpecial {
|
|
35
|
+
ArrayBuffer: string;
|
|
36
|
+
BigInt: string;
|
|
37
|
+
BigInt64Array: string;
|
|
38
|
+
BigUint64Array: string;
|
|
39
|
+
Date: string;
|
|
40
|
+
DOMException: {
|
|
41
|
+
message: string;
|
|
42
|
+
name: string;
|
|
43
|
+
stack?: string;
|
|
44
|
+
cause?: unknown;
|
|
45
|
+
};
|
|
46
|
+
FatalError: {
|
|
47
|
+
message: string;
|
|
48
|
+
stack?: string;
|
|
49
|
+
cause?: unknown;
|
|
50
|
+
};
|
|
51
|
+
Float32Array: string;
|
|
52
|
+
Float64Array: string;
|
|
53
|
+
Error: {
|
|
54
|
+
name: string;
|
|
55
|
+
message: string;
|
|
56
|
+
stack?: string;
|
|
57
|
+
cause?: unknown;
|
|
58
|
+
};
|
|
59
|
+
EvalError: {
|
|
60
|
+
message: string;
|
|
61
|
+
stack?: string;
|
|
62
|
+
cause?: unknown;
|
|
63
|
+
};
|
|
64
|
+
Headers: [string, string][];
|
|
65
|
+
Int8Array: string;
|
|
66
|
+
Int16Array: string;
|
|
67
|
+
Int32Array: string;
|
|
68
|
+
Map: [any, any][];
|
|
69
|
+
RangeError: {
|
|
70
|
+
message: string;
|
|
71
|
+
stack?: string;
|
|
72
|
+
cause?: unknown;
|
|
73
|
+
};
|
|
74
|
+
ReadableStream: {
|
|
75
|
+
name: string;
|
|
76
|
+
type?: 'bytes';
|
|
77
|
+
startIndex?: number;
|
|
78
|
+
} | {
|
|
79
|
+
bodyInit: any;
|
|
80
|
+
};
|
|
81
|
+
ReferenceError: {
|
|
82
|
+
message: string;
|
|
83
|
+
stack?: string;
|
|
84
|
+
cause?: unknown;
|
|
85
|
+
};
|
|
86
|
+
RegExp: {
|
|
87
|
+
source: string;
|
|
88
|
+
flags: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* `retryAfter` is serialized as a numeric epoch timestamp rather than a
|
|
92
|
+
* `Date` to be realm-safe. The Date reducer uses `instanceof global.Date`,
|
|
93
|
+
* which fails for Dates from a different VM realm.
|
|
94
|
+
*/
|
|
95
|
+
RetryableError: {
|
|
96
|
+
message: string;
|
|
97
|
+
stack?: string;
|
|
98
|
+
cause?: unknown;
|
|
99
|
+
retryAfter: number;
|
|
100
|
+
};
|
|
101
|
+
Request: {
|
|
102
|
+
method: string;
|
|
103
|
+
url: string;
|
|
104
|
+
headers: Headers;
|
|
105
|
+
body: Request['body'];
|
|
106
|
+
duplex: Request['duplex'];
|
|
107
|
+
responseWritable?: WritableStream<Response>;
|
|
108
|
+
signal?: AbortSignal;
|
|
109
|
+
};
|
|
110
|
+
Response: {
|
|
111
|
+
type: Response['type'];
|
|
112
|
+
url: string;
|
|
113
|
+
status: number;
|
|
114
|
+
statusText: string;
|
|
115
|
+
headers: Headers;
|
|
116
|
+
body: Response['body'];
|
|
117
|
+
redirected: boolean;
|
|
118
|
+
};
|
|
119
|
+
Class: {
|
|
120
|
+
classId: string;
|
|
121
|
+
};
|
|
122
|
+
Instance: {
|
|
123
|
+
classId: string;
|
|
124
|
+
data: unknown;
|
|
125
|
+
};
|
|
126
|
+
Set: any[];
|
|
127
|
+
SyntaxError: {
|
|
128
|
+
message: string;
|
|
129
|
+
stack?: string;
|
|
130
|
+
cause?: unknown;
|
|
131
|
+
};
|
|
132
|
+
StepFunction: {
|
|
133
|
+
stepId: string;
|
|
134
|
+
closureVars?: Record<string, any>;
|
|
135
|
+
/**
|
|
136
|
+
* Captured lexical `this` for step proxies that were created via
|
|
137
|
+
* `useStep(...).bind(thisArg)` (the SWC plugin emits this for nested
|
|
138
|
+
* arrow steps that close over their enclosing function's `this`).
|
|
139
|
+
* The reviver re-binds the freshly-created proxy to this value so the
|
|
140
|
+
* binding survives serialization round-trips.
|
|
141
|
+
*/
|
|
142
|
+
boundThis?: unknown;
|
|
143
|
+
/**
|
|
144
|
+
* Prefilled arguments captured when the user (rather than the SWC
|
|
145
|
+
* plugin) called `useStep(...).bind(thisArg, x, y)`. The reviver
|
|
146
|
+
* re-applies these alongside `boundThis` so partial application
|
|
147
|
+
* survives serialization. The SWC plugin only ever emits
|
|
148
|
+
* `.bind(this)` with no extra args today; this slot exists so a
|
|
149
|
+
* hand-written `.bind(thisArg, x)` doesn't silently lose `x` after
|
|
150
|
+
* round-tripping through the reducer/reviver.
|
|
151
|
+
*/
|
|
152
|
+
boundArgs?: unknown[];
|
|
153
|
+
};
|
|
154
|
+
TypeError: {
|
|
155
|
+
message: string;
|
|
156
|
+
stack?: string;
|
|
157
|
+
cause?: unknown;
|
|
158
|
+
};
|
|
159
|
+
URIError: {
|
|
160
|
+
message: string;
|
|
161
|
+
stack?: string;
|
|
162
|
+
cause?: unknown;
|
|
163
|
+
};
|
|
164
|
+
URL: string;
|
|
165
|
+
WorkflowFunction: {
|
|
166
|
+
workflowId: string;
|
|
167
|
+
};
|
|
168
|
+
URLSearchParams: string;
|
|
169
|
+
Uint8Array: string;
|
|
170
|
+
Uint8ClampedArray: string;
|
|
171
|
+
Uint16Array: string;
|
|
172
|
+
Uint32Array: string;
|
|
173
|
+
AggregateError: {
|
|
174
|
+
message: string;
|
|
175
|
+
stack?: string;
|
|
176
|
+
cause?: unknown;
|
|
177
|
+
errors: unknown[];
|
|
178
|
+
};
|
|
179
|
+
WritableStream: {
|
|
180
|
+
name: string;
|
|
181
|
+
};
|
|
182
|
+
AbortController: {
|
|
183
|
+
streamName: string;
|
|
184
|
+
hookToken: string;
|
|
185
|
+
aborted: boolean;
|
|
186
|
+
reason?: unknown;
|
|
187
|
+
};
|
|
188
|
+
AbortSignal: {
|
|
189
|
+
streamName: string;
|
|
190
|
+
hookToken: string;
|
|
191
|
+
aborted: boolean;
|
|
192
|
+
reason?: unknown;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export type Reducers = {
|
|
196
|
+
[K in keyof SerializableSpecial]: (value: any) => SerializableSpecial[K] | false;
|
|
197
|
+
};
|
|
198
|
+
export type Revivers = {
|
|
199
|
+
[K in keyof SerializableSpecial]: (value: SerializableSpecial[K]) => any;
|
|
200
|
+
};
|
|
201
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow mode serialization.
|
|
3
|
+
*
|
|
4
|
+
* Provides serialize/deserialize for use inside the workflow execution
|
|
5
|
+
* environment (QuickJS VM or Node.js vm). It is:
|
|
6
|
+
* - Synchronous (no async operations)
|
|
7
|
+
* - No encryption (encryption is handled outside the VM on the host side)
|
|
8
|
+
*
|
|
9
|
+
* Designed to be bundled into the workflow code by esbuild and executed
|
|
10
|
+
* inside the sandboxed VM.
|
|
11
|
+
*/
|
|
12
|
+
import type { CodecOptions } from './codec.js';
|
|
13
|
+
/**
|
|
14
|
+
* Serialize a value for storage/transmission from the workflow environment.
|
|
15
|
+
*
|
|
16
|
+
* @param value - The value to serialize
|
|
17
|
+
* @param options - Optional global, extra reducers/revivers for VM-context serialization
|
|
18
|
+
* @returns Format-prefixed serialized bytes
|
|
19
|
+
*/
|
|
20
|
+
export declare function serialize(value: unknown, options?: CodecOptions): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* Deserialize a value received in the workflow environment.
|
|
23
|
+
*
|
|
24
|
+
* @param data - Format-prefixed serialized bytes, or legacy data
|
|
25
|
+
* @param options - Optional global, extra revivers for VM-context deserialization
|
|
26
|
+
* @returns The deserialized value
|
|
27
|
+
*/
|
|
28
|
+
export declare function deserialize(data: Uint8Array | unknown, options?: CodecOptions): unknown;
|
|
29
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe serialization format utilities.
|
|
3
|
+
*
|
|
4
|
+
* This module contains the format prefix handling, generic hydrate/dehydrate
|
|
5
|
+
* dispatch, and shared types/classes used by all environments (runtime, web
|
|
6
|
+
* o11y, CLI o11y). It has NO Node.js dependencies.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SerializationFormat: {
|
|
9
|
+
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
10
|
+
readonly DEVALUE_V1: "devl";
|
|
11
|
+
/** Encrypted payload (inner payload has its own format prefix after decryption) */
|
|
12
|
+
readonly ENCRYPTED: "encr";
|
|
13
|
+
};
|
|
14
|
+
export type SerializationFormatType = (typeof SerializationFormat)[keyof typeof SerializationFormat];
|
|
15
|
+
/**
|
|
16
|
+
* Encode a payload with a format prefix.
|
|
17
|
+
*/
|
|
18
|
+
export declare function encodeWithFormatPrefix(format: SerializationFormatType, payload: Uint8Array | unknown): Uint8Array | unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Decode a format-prefixed payload.
|
|
21
|
+
*/
|
|
22
|
+
export declare function decodeFormatPrefix(data: Uint8Array | unknown): {
|
|
23
|
+
format: SerializationFormatType;
|
|
24
|
+
payload: Uint8Array;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Placeholder string displayed when data is encrypted and decryption
|
|
28
|
+
* has not been requested. Used by both CLI and web o11y.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ENCRYPTED_PLACEHOLDER = "\uD83D\uDD12 Encrypted";
|
|
31
|
+
/**
|
|
32
|
+
* Check if a hydrated value is an expired data stub from the server.
|
|
33
|
+
*
|
|
34
|
+
* The server replaces expired ref fields with a devalue-encoded stub
|
|
35
|
+
* (`makeExpiredStub`) that deserializes to `[{ expiredAt: "<ISO date>" }]`
|
|
36
|
+
* after `unflatten` (array-wrapped due to backwards-compatible encoding).
|
|
37
|
+
* Also matches the unwrapped `{ expiredAt: "..." }` form for robustness.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isExpiredStub(data: unknown): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if a binary value has the 'encr' format prefix indicating encryption.
|
|
42
|
+
* Browser-safe — does not depend on the full serialization module.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isEncryptedData(data: unknown): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* A map of type name → reviver function, used by devalue's `parse`/`unflatten`.
|
|
47
|
+
* Each environment (runtime, web, CLI) provides its own set.
|
|
48
|
+
*/
|
|
49
|
+
export type Revivers = Record<string, (value: any) => any>;
|
|
50
|
+
/**
|
|
51
|
+
* Hydrate (deserialize) a value that was stored in the database.
|
|
52
|
+
*
|
|
53
|
+
* Handles four data shapes:
|
|
54
|
+
* 1. `Uint8Array` with 'encr' prefix → returned as-is (encrypted, not yet decrypted)
|
|
55
|
+
* 2. `Uint8Array` with a format prefix (specVersion 2+) → decode prefix, parse
|
|
56
|
+
* 3. `Array` (legacy specVersion 1, "revived devalue") → unflatten
|
|
57
|
+
* 4. Other (already a plain JS value) → return as-is
|
|
58
|
+
*
|
|
59
|
+
* Encrypted data is intentionally left as a `Uint8Array` so that consumers
|
|
60
|
+
* (CLI, web UI) can detect it with `isEncryptedData()` and decide how to
|
|
61
|
+
* handle it — the CLI replaces it with a styled placeholder, the web UI
|
|
62
|
+
* renders an "Encrypted" card with a Decrypt button that triggers
|
|
63
|
+
* client-side decryption on demand.
|
|
64
|
+
*/
|
|
65
|
+
export declare function hydrateData(value: unknown, revivers: Revivers): unknown;
|
|
66
|
+
/**
|
|
67
|
+
* Hydrate a value, decrypting it first if an encryption key is provided.
|
|
68
|
+
*
|
|
69
|
+
* This is the async version of `hydrateData` that supports transparent
|
|
70
|
+
* decryption. Used by o11y tooling (web UI, CLI) when the user requests
|
|
71
|
+
* decryption.
|
|
72
|
+
*
|
|
73
|
+
* @param value - The value to hydrate (may be encrypted)
|
|
74
|
+
* @param revivers - Devalue revivers for deserialization
|
|
75
|
+
* @param key - AES-256 encryption key (if provided, encrypted data will be decrypted)
|
|
76
|
+
*/
|
|
77
|
+
export declare function hydrateDataWithKey(value: unknown, revivers: Revivers, key: import('./encryption.js').CryptoKey | undefined): Promise<unknown>;
|
|
78
|
+
/** Marker for stream reference objects rendered as links in the UI */
|
|
79
|
+
export declare const STREAM_REF_TYPE = "__workflow_stream_ref__";
|
|
80
|
+
/** A stream reference for UI display */
|
|
81
|
+
export interface StreamRef {
|
|
82
|
+
__type: typeof STREAM_REF_TYPE;
|
|
83
|
+
streamId: string;
|
|
84
|
+
}
|
|
85
|
+
/** Marker for Run reference objects rendered as links in the UI */
|
|
86
|
+
export declare const RUN_REF_TYPE = "__workflow_run_ref__";
|
|
87
|
+
/** A Run reference for UI display */
|
|
88
|
+
export interface RunRef {
|
|
89
|
+
__type: typeof RUN_REF_TYPE;
|
|
90
|
+
runId: string;
|
|
91
|
+
}
|
|
92
|
+
/** Check if a value is a RunRef object */
|
|
93
|
+
export declare const isRunRef: (value: unknown) => value is RunRef;
|
|
94
|
+
/** Convert a serialized Run value to a RunRef for display */
|
|
95
|
+
export declare const serializedRunToRunRef: (value: {
|
|
96
|
+
runId: string;
|
|
97
|
+
}) => RunRef;
|
|
98
|
+
/** Marker for custom class instance references */
|
|
99
|
+
export declare const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
|
|
100
|
+
/**
|
|
101
|
+
* A class instance reference for o11y display.
|
|
102
|
+
*
|
|
103
|
+
* Browser-safe base class — no `util.inspect.custom`. Environment-specific
|
|
104
|
+
* rendering (CLI inspect, web component) is handled by each consumer.
|
|
105
|
+
*/
|
|
106
|
+
export declare class ClassInstanceRef {
|
|
107
|
+
readonly className: string;
|
|
108
|
+
readonly classId: string;
|
|
109
|
+
readonly data: unknown;
|
|
110
|
+
readonly __type = "__workflow_class_instance_ref__";
|
|
111
|
+
constructor(className: string, classId: string, data: unknown);
|
|
112
|
+
toJSON(): {
|
|
113
|
+
__type: string;
|
|
114
|
+
className: string;
|
|
115
|
+
classId: string;
|
|
116
|
+
data: unknown;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** Check if a value is a ClassInstanceRef object */
|
|
120
|
+
export declare const isClassInstanceRef: (value: unknown) => value is ClassInstanceRef;
|
|
121
|
+
/** Check if a value is a stream ID string */
|
|
122
|
+
export declare const isStreamId: (value: unknown) => boolean;
|
|
123
|
+
/** Check if a value is a StreamRef object */
|
|
124
|
+
export declare const isStreamRef: (value: unknown) => value is StreamRef;
|
|
125
|
+
/**
|
|
126
|
+
* Convert a serialized stream value to a StreamRef for display.
|
|
127
|
+
*/
|
|
128
|
+
export declare const streamToStreamRef: (value: any) => StreamRef;
|
|
129
|
+
/** Convert a serialized step function to a display string */
|
|
130
|
+
export declare const serializedStepFunctionToString: (value: unknown) => string;
|
|
131
|
+
/** Extract the class name from a classId */
|
|
132
|
+
export declare const extractClassName: (classId: string) => string;
|
|
133
|
+
/** Convert a serialized class instance to a ClassInstanceRef for display.
|
|
134
|
+
* Run instances are special-cased to a RunRef for clickable rendering. */
|
|
135
|
+
export declare const serializedInstanceToRef: (value: {
|
|
136
|
+
classId: string;
|
|
137
|
+
data: unknown;
|
|
138
|
+
}) => ClassInstanceRef | RunRef;
|
|
139
|
+
/** Convert a serialized class reference to a display string */
|
|
140
|
+
export declare const serializedClassToString: (value: {
|
|
141
|
+
classId: string;
|
|
142
|
+
}) => string;
|
|
143
|
+
/**
|
|
144
|
+
* Standard o11y revivers that override runtime-specific types with
|
|
145
|
+
* display-friendly values. Used by both web and CLI hydration.
|
|
146
|
+
*/
|
|
147
|
+
export declare const observabilityRevivers: Revivers;
|
|
148
|
+
/**
|
|
149
|
+
* Hydrate the serialized data fields of any resource for o11y display.
|
|
150
|
+
*
|
|
151
|
+
* Dispatches by resource type (step, hook, event, workflow) and calls
|
|
152
|
+
* `hydrateData` with the provided revivers for each data field.
|
|
153
|
+
*
|
|
154
|
+
* Each environment (web, CLI) provides its own revivers — this function
|
|
155
|
+
* only handles the dispatch logic and field mapping.
|
|
156
|
+
*/
|
|
157
|
+
export declare function hydrateResourceIO<T extends {
|
|
158
|
+
stepId?: string;
|
|
159
|
+
hookId?: string;
|
|
160
|
+
eventId?: string;
|
|
161
|
+
input?: any;
|
|
162
|
+
output?: any;
|
|
163
|
+
metadata?: any;
|
|
164
|
+
eventData?: any;
|
|
165
|
+
executionContext?: any;
|
|
166
|
+
}>(resource: T, revivers: Revivers): T;
|
|
167
|
+
/** Extract all stream IDs from a value (recursively traverses objects/arrays) */
|
|
168
|
+
export declare function extractStreamIds(obj: unknown): string[];
|
|
169
|
+
/** Truncate a string to a maximum length, adding ellipsis if needed */
|
|
170
|
+
export declare function truncateId(id: string, maxLength?: number): string;
|
|
171
|
+
//# sourceMappingURL=serialization-format.d.ts.map
|