@octonodes/sdk 0.2.13 → 0.2.26
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/README.md +36 -0
- package/dist/data-tables/table.d.ts +90 -0
- package/dist/data-tables/table.d.ts.map +1 -0
- package/dist/data-tables/table.js +44 -0
- package/dist/data-tables/table.js.map +1 -0
- package/dist/data-tables/types.d.ts +24 -0
- package/dist/data-tables/types.d.ts.map +1 -0
- package/dist/data-tables/types.js +3 -0
- package/dist/data-tables/types.js.map +1 -0
- package/dist/gen/types.gen.d.ts +129 -2
- package/dist/gen/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/octonode-client.d.ts +87 -0
- package/dist/octonode-client.d.ts.map +1 -1
- package/dist/octonode-client.js +4 -0
- package/dist/octonode-client.js.map +1 -1
- package/dist/plugins/schema/app/contributions.d.ts +355 -0
- package/dist/plugins/schema/app/contributions.d.ts.map +1 -0
- package/dist/plugins/schema/app/contributions.js +179 -0
- package/dist/plugins/schema/app/contributions.js.map +1 -0
- package/dist/plugins/schema/app-contributions.d.ts +355 -0
- package/dist/plugins/schema/app-contributions.d.ts.map +1 -0
- package/dist/plugins/schema/app-contributions.js +179 -0
- package/dist/plugins/schema/app-contributions.js.map +1 -0
- package/dist/plugins/schema/app.d.ts +506 -1
- package/dist/plugins/schema/app.d.ts.map +1 -1
- package/dist/plugins/schema/app.js +59 -5
- package/dist/plugins/schema/app.js.map +1 -1
- package/dist/plugins/schema/constants.d.ts +2 -1
- package/dist/plugins/schema/constants.d.ts.map +1 -1
- package/dist/plugins/schema/constants.js +3 -1
- package/dist/plugins/schema/constants.js.map +1 -1
- package/dist/plugins/schema/icons.d.ts +4 -0
- package/dist/plugins/schema/icons.d.ts.map +1 -1
- package/dist/plugins/schema/icons.js +20 -1
- package/dist/plugins/schema/icons.js.map +1 -1
- package/dist/plugins/schema/ipc/envelope.d.ts +923 -0
- package/dist/plugins/schema/ipc/envelope.d.ts.map +1 -0
- package/dist/plugins/schema/ipc/envelope.js +210 -0
- package/dist/plugins/schema/ipc/envelope.js.map +1 -0
- package/dist/plugins/schema/ipc-envelope.d.ts +55 -55
- package/dist/plugins/schema/ipc-envelope.js +1 -1
- package/dist/plugins/schema/ipc-envelope.js.map +1 -1
- package/dist/plugins/schema/personal/layout.d.ts +52 -0
- package/dist/plugins/schema/personal/layout.d.ts.map +1 -0
- package/dist/plugins/schema/personal/layout.js +26 -0
- package/dist/plugins/schema/personal/layout.js.map +1 -0
- package/dist/plugins/schema/personal-layout.d.ts +52 -0
- package/dist/plugins/schema/personal-layout.d.ts.map +1 -0
- package/dist/plugins/schema/personal-layout.js +26 -0
- package/dist/plugins/schema/personal-layout.js.map +1 -0
- package/dist/plugins/schema/plugin/execution.d.ts +843 -44
- package/dist/plugins/schema/plugin/execution.d.ts.map +1 -1
- package/dist/plugins/schema/plugin/execution.js +2 -2
- package/dist/plugins/schema/plugin/execution.js.map +1 -1
- package/dist/plugins/schema/plugin/plugin.d.ts +802 -39
- package/dist/plugins/schema/plugin/plugin.d.ts.map +1 -1
- package/dist/plugins/schema/plugin/plugin.js +82 -6
- package/dist/plugins/schema/plugin/plugin.js.map +1 -1
- package/dist/plugins/schema/plugin/publishing.d.ts +121 -68
- package/dist/plugins/schema/plugin/publishing.d.ts.map +1 -1
- package/dist/plugins/schema/plugin/publishing.js +2 -0
- package/dist/plugins/schema/plugin/publishing.js.map +1 -1
- package/dist/plugins/schema/plugin-publishing.d.ts +68 -68
- package/dist/plugins/schema/plugin-sdk/index.d.ts +2 -1
- package/dist/plugins/schema/plugin-sdk/index.d.ts.map +1 -1
- package/dist/plugins/schema/plugin-sdk/index.js +2 -1
- package/dist/plugins/schema/plugin-sdk/index.js.map +1 -1
- package/dist/plugins/schema/plugin.d.ts +36 -36
- package/dist/plugins/sdk/constants.d.ts +2 -0
- package/dist/plugins/sdk/constants.d.ts.map +1 -0
- package/dist/plugins/sdk/constants.js +6 -0
- package/dist/plugins/sdk/constants.js.map +1 -0
- package/dist/plugins/sdk/define/node.d.ts +15 -0
- package/dist/plugins/sdk/define/node.d.ts.map +1 -0
- package/dist/plugins/sdk/define/node.js +58 -0
- package/dist/plugins/sdk/define/node.js.map +1 -0
- package/dist/plugins/sdk/define-node.d.ts +5 -0
- package/dist/plugins/sdk/define-node.d.ts.map +1 -1
- package/dist/plugins/sdk/define-node.js +1 -1
- package/dist/plugins/sdk/define-node.js.map +1 -1
- package/dist/plugins/sdk/definitions/clients/output.d.ts +3 -0
- package/dist/plugins/sdk/definitions/clients/output.d.ts.map +1 -0
- package/dist/plugins/sdk/definitions/clients/output.js +47 -0
- package/dist/plugins/sdk/definitions/clients/output.js.map +1 -0
- package/dist/plugins/sdk/definitions/compiler/catalog.d.ts.map +1 -1
- package/dist/plugins/sdk/definitions/compiler/catalog.js +9 -0
- package/dist/plugins/sdk/definitions/compiler/catalog.js.map +1 -1
- package/dist/plugins/sdk/definitions/compiler/index.d.ts.map +1 -1
- package/dist/plugins/sdk/definitions/compiler/index.js +59 -2
- package/dist/plugins/sdk/definitions/compiler/index.js.map +1 -1
- package/dist/plugins/sdk/definitions/npm/emit/js.d.ts.map +1 -1
- package/dist/plugins/sdk/definitions/npm/emit/js.js +7 -3
- package/dist/plugins/sdk/definitions/npm/emit/js.js.map +1 -1
- package/dist/plugins/sdk/definitions/npm/types.d.ts +35 -2
- package/dist/plugins/sdk/definitions/npm/types.d.ts.map +1 -1
- package/dist/plugins/sdk/definitions/types.d.ts +10 -3
- package/dist/plugins/sdk/definitions/types.d.ts.map +1 -1
- package/dist/plugins/sdk/json/schema.d.ts +13 -0
- package/dist/plugins/sdk/json/schema.d.ts.map +1 -0
- package/dist/plugins/sdk/json/schema.js +102 -0
- package/dist/plugins/sdk/json/schema.js.map +1 -0
- package/dist/plugins/sdk/json-schema.js +13 -0
- package/dist/plugins/sdk/json-schema.js.map +1 -1
- package/dist/plugins/sdk/nodes/index.d.ts +3 -1
- package/dist/plugins/sdk/nodes/index.d.ts.map +1 -1
- package/dist/plugins/sdk/nodes/index.js +5 -0
- package/dist/plugins/sdk/nodes/index.js.map +1 -1
- package/dist/plugins/sdk/plugin/index.d.ts +1 -0
- package/dist/plugins/sdk/plugin/index.d.ts.map +1 -1
- package/dist/plugins/sdk/plugin.d.ts +1 -1
- package/dist/plugins/sdk/plugin.d.ts.map +1 -1
- package/dist/plugins/sdk/plugin.js +2 -2
- package/dist/plugins/sdk/plugin.js.map +1 -1
- package/dist/plugins/sdk/plugins/define/node.d.ts +29 -0
- package/dist/plugins/sdk/plugins/define/node.d.ts.map +1 -0
- package/dist/plugins/sdk/plugins/define/node.js +16 -0
- package/dist/plugins/sdk/plugins/define/node.js.map +1 -0
- package/dist/plugins/sdk/plugins/index.d.ts +5 -4
- package/dist/plugins/sdk/plugins/index.d.ts.map +1 -1
- package/dist/plugins/sdk/plugins/index.js +21 -15
- package/dist/plugins/sdk/plugins/index.js.map +1 -1
- package/dist/plugins/sdk/plugins/types.d.ts +1 -1
- package/dist/plugins/sdk/plugins/types.d.ts.map +1 -1
- package/dist/plugins/sdk/runner.d.ts +3 -7
- package/dist/plugins/sdk/runner.d.ts.map +1 -1
- package/dist/plugins/sdk/runner.js +61 -18
- package/dist/plugins/sdk/runner.js.map +1 -1
- package/dist/plugins/sdk/types.d.ts +115 -0
- package/dist/plugins/sdk/types.d.ts.map +1 -0
- package/dist/plugins/sdk/types.js +3 -0
- package/dist/plugins/sdk/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,923 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The IPC protocol version. Every envelope carries this in its `octonode`
|
|
4
|
+
* field so the wire format can evolve without ambiguity. Bump only on a
|
|
5
|
+
* breaking change to the envelope shape.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PROTOCOL_VERSION: "1";
|
|
8
|
+
/**
|
|
9
|
+
* A JSON Schema object, kept deliberately loose. It is the lowest common
|
|
10
|
+
* denominator every language can emit and validate against, which is what
|
|
11
|
+
* makes "a node in any language" tractable: contracts travel as plain JSON
|
|
12
|
+
* Schema, not as language-specific type objects.
|
|
13
|
+
*/
|
|
14
|
+
export declare const JsonSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
15
|
+
export type JsonSchema = Record<string, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Structured error codes a node (or the engine) can report. `retryable` on the
|
|
18
|
+
* error object — not the code alone — is what the DAG executor consults in
|
|
19
|
+
* later phases, but the code gives callers a stable taxonomy.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ErrorCode: z.ZodEnum<["VALIDATION_ERROR", "RUNTIME_ERROR", "TIMEOUT", "NON_RETRYABLE"]>;
|
|
22
|
+
export type ErrorCode = z.infer<typeof ErrorCode>;
|
|
23
|
+
/**
|
|
24
|
+
* Per-invocation context handed to the node. In Phase 1/2 only `config`/`attempt`
|
|
25
|
+
* are meaningful; `runId`/`env`/`deadlineMs` are populated once the config and
|
|
26
|
+
* DAG layers land, but they are part of the contract from day one.
|
|
27
|
+
*/
|
|
28
|
+
export declare const InvocationContext: z.ZodObject<{
|
|
29
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
env: z.ZodOptional<z.ZodString>;
|
|
31
|
+
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
32
|
+
attempt: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
deadlineMs: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
config: Record<string, unknown>;
|
|
36
|
+
attempt: number;
|
|
37
|
+
runId?: string | undefined;
|
|
38
|
+
env?: string | undefined;
|
|
39
|
+
deadlineMs?: number | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
config?: Record<string, unknown> | undefined;
|
|
42
|
+
runId?: string | undefined;
|
|
43
|
+
env?: string | undefined;
|
|
44
|
+
attempt?: number | undefined;
|
|
45
|
+
deadlineMs?: number | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export type InvocationContext = z.infer<typeof InvocationContext>;
|
|
48
|
+
/** Engine → node: a request to execute the node with the given inputs. */
|
|
49
|
+
export declare const InvokeRequest: z.ZodObject<{
|
|
50
|
+
octonode: z.ZodLiteral<"1">;
|
|
51
|
+
type: z.ZodLiteral<"invoke">;
|
|
52
|
+
invocationId: z.ZodString;
|
|
53
|
+
/** Optional node id — useful once one process can host multiple nodes. */
|
|
54
|
+
node: z.ZodOptional<z.ZodString>;
|
|
55
|
+
inputs: z.ZodUnknown;
|
|
56
|
+
context: z.ZodDefault<z.ZodObject<{
|
|
57
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
58
|
+
env: z.ZodOptional<z.ZodString>;
|
|
59
|
+
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
60
|
+
attempt: z.ZodDefault<z.ZodNumber>;
|
|
61
|
+
deadlineMs: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
config: Record<string, unknown>;
|
|
64
|
+
attempt: number;
|
|
65
|
+
runId?: string | undefined;
|
|
66
|
+
env?: string | undefined;
|
|
67
|
+
deadlineMs?: number | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
config?: Record<string, unknown> | undefined;
|
|
70
|
+
runId?: string | undefined;
|
|
71
|
+
env?: string | undefined;
|
|
72
|
+
attempt?: number | undefined;
|
|
73
|
+
deadlineMs?: number | undefined;
|
|
74
|
+
}>>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
type: "invoke";
|
|
77
|
+
octonode: "1";
|
|
78
|
+
invocationId: string;
|
|
79
|
+
context: {
|
|
80
|
+
config: Record<string, unknown>;
|
|
81
|
+
attempt: number;
|
|
82
|
+
runId?: string | undefined;
|
|
83
|
+
env?: string | undefined;
|
|
84
|
+
deadlineMs?: number | undefined;
|
|
85
|
+
};
|
|
86
|
+
node?: string | undefined;
|
|
87
|
+
inputs?: unknown;
|
|
88
|
+
}, {
|
|
89
|
+
type: "invoke";
|
|
90
|
+
octonode: "1";
|
|
91
|
+
invocationId: string;
|
|
92
|
+
node?: string | undefined;
|
|
93
|
+
inputs?: unknown;
|
|
94
|
+
context?: {
|
|
95
|
+
config?: Record<string, unknown> | undefined;
|
|
96
|
+
runId?: string | undefined;
|
|
97
|
+
env?: string | undefined;
|
|
98
|
+
attempt?: number | undefined;
|
|
99
|
+
deadlineMs?: number | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
export type InvokeRequest = z.infer<typeof InvokeRequest>;
|
|
103
|
+
/**
|
|
104
|
+
* Engine → node: a request for the node to self-report its manifest instead of
|
|
105
|
+
* executing. This is the universal discovery mechanism — every language that
|
|
106
|
+
* can answer `describe` can be scanned into `.octonode`, no AST tooling needed.
|
|
107
|
+
*/
|
|
108
|
+
export declare const DescribeRequest: z.ZodObject<{
|
|
109
|
+
octonode: z.ZodLiteral<"1">;
|
|
110
|
+
type: z.ZodLiteral<"describe">;
|
|
111
|
+
invocationId: z.ZodString;
|
|
112
|
+
node: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
type: "describe";
|
|
115
|
+
octonode: "1";
|
|
116
|
+
invocationId: string;
|
|
117
|
+
node?: string | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
type: "describe";
|
|
120
|
+
octonode: "1";
|
|
121
|
+
invocationId: string;
|
|
122
|
+
node?: string | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
export type DescribeRequest = z.infer<typeof DescribeRequest>;
|
|
125
|
+
/** Any engine → node request. */
|
|
126
|
+
export declare const RequestEnvelope: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
127
|
+
octonode: z.ZodLiteral<"1">;
|
|
128
|
+
type: z.ZodLiteral<"invoke">;
|
|
129
|
+
invocationId: z.ZodString;
|
|
130
|
+
/** Optional node id — useful once one process can host multiple nodes. */
|
|
131
|
+
node: z.ZodOptional<z.ZodString>;
|
|
132
|
+
inputs: z.ZodUnknown;
|
|
133
|
+
context: z.ZodDefault<z.ZodObject<{
|
|
134
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
135
|
+
env: z.ZodOptional<z.ZodString>;
|
|
136
|
+
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
attempt: z.ZodDefault<z.ZodNumber>;
|
|
138
|
+
deadlineMs: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
config: Record<string, unknown>;
|
|
141
|
+
attempt: number;
|
|
142
|
+
runId?: string | undefined;
|
|
143
|
+
env?: string | undefined;
|
|
144
|
+
deadlineMs?: number | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
config?: Record<string, unknown> | undefined;
|
|
147
|
+
runId?: string | undefined;
|
|
148
|
+
env?: string | undefined;
|
|
149
|
+
attempt?: number | undefined;
|
|
150
|
+
deadlineMs?: number | undefined;
|
|
151
|
+
}>>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
type: "invoke";
|
|
154
|
+
octonode: "1";
|
|
155
|
+
invocationId: string;
|
|
156
|
+
context: {
|
|
157
|
+
config: Record<string, unknown>;
|
|
158
|
+
attempt: number;
|
|
159
|
+
runId?: string | undefined;
|
|
160
|
+
env?: string | undefined;
|
|
161
|
+
deadlineMs?: number | undefined;
|
|
162
|
+
};
|
|
163
|
+
node?: string | undefined;
|
|
164
|
+
inputs?: unknown;
|
|
165
|
+
}, {
|
|
166
|
+
type: "invoke";
|
|
167
|
+
octonode: "1";
|
|
168
|
+
invocationId: string;
|
|
169
|
+
node?: string | undefined;
|
|
170
|
+
inputs?: unknown;
|
|
171
|
+
context?: {
|
|
172
|
+
config?: Record<string, unknown> | undefined;
|
|
173
|
+
runId?: string | undefined;
|
|
174
|
+
env?: string | undefined;
|
|
175
|
+
attempt?: number | undefined;
|
|
176
|
+
deadlineMs?: number | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
}>, z.ZodObject<{
|
|
179
|
+
octonode: z.ZodLiteral<"1">;
|
|
180
|
+
type: z.ZodLiteral<"describe">;
|
|
181
|
+
invocationId: z.ZodString;
|
|
182
|
+
node: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
type: "describe";
|
|
185
|
+
octonode: "1";
|
|
186
|
+
invocationId: string;
|
|
187
|
+
node?: string | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
type: "describe";
|
|
190
|
+
octonode: "1";
|
|
191
|
+
invocationId: string;
|
|
192
|
+
node?: string | undefined;
|
|
193
|
+
}>]>;
|
|
194
|
+
export type RequestEnvelope = z.infer<typeof RequestEnvelope>;
|
|
195
|
+
/** Errors are data, not just exceptions — they cross the process boundary as JSON. */
|
|
196
|
+
export declare const NodeError: z.ZodObject<{
|
|
197
|
+
code: z.ZodEnum<["VALIDATION_ERROR", "RUNTIME_ERROR", "TIMEOUT", "NON_RETRYABLE"]>;
|
|
198
|
+
message: z.ZodString;
|
|
199
|
+
retryable: z.ZodDefault<z.ZodBoolean>;
|
|
200
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
201
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
204
|
+
message: string;
|
|
205
|
+
retryable: boolean;
|
|
206
|
+
details?: unknown;
|
|
207
|
+
stack?: string | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
210
|
+
message: string;
|
|
211
|
+
retryable?: boolean | undefined;
|
|
212
|
+
details?: unknown;
|
|
213
|
+
stack?: string | undefined;
|
|
214
|
+
}>;
|
|
215
|
+
export type NodeError = z.infer<typeof NodeError>;
|
|
216
|
+
declare const ResultOk: z.ZodObject<{
|
|
217
|
+
octonode: z.ZodLiteral<"1">;
|
|
218
|
+
type: z.ZodLiteral<"result">;
|
|
219
|
+
invocationId: z.ZodString;
|
|
220
|
+
status: z.ZodLiteral<"ok">;
|
|
221
|
+
outputs: z.ZodUnknown;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
type: "result";
|
|
224
|
+
octonode: "1";
|
|
225
|
+
status: "ok";
|
|
226
|
+
invocationId: string;
|
|
227
|
+
outputs?: unknown;
|
|
228
|
+
}, {
|
|
229
|
+
type: "result";
|
|
230
|
+
octonode: "1";
|
|
231
|
+
status: "ok";
|
|
232
|
+
invocationId: string;
|
|
233
|
+
outputs?: unknown;
|
|
234
|
+
}>;
|
|
235
|
+
declare const ResultErr: z.ZodObject<{
|
|
236
|
+
octonode: z.ZodLiteral<"1">;
|
|
237
|
+
type: z.ZodLiteral<"result">;
|
|
238
|
+
invocationId: z.ZodString;
|
|
239
|
+
status: z.ZodLiteral<"error">;
|
|
240
|
+
error: z.ZodObject<{
|
|
241
|
+
code: z.ZodEnum<["VALIDATION_ERROR", "RUNTIME_ERROR", "TIMEOUT", "NON_RETRYABLE"]>;
|
|
242
|
+
message: z.ZodString;
|
|
243
|
+
retryable: z.ZodDefault<z.ZodBoolean>;
|
|
244
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
245
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
248
|
+
message: string;
|
|
249
|
+
retryable: boolean;
|
|
250
|
+
details?: unknown;
|
|
251
|
+
stack?: string | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
254
|
+
message: string;
|
|
255
|
+
retryable?: boolean | undefined;
|
|
256
|
+
details?: unknown;
|
|
257
|
+
stack?: string | undefined;
|
|
258
|
+
}>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
error: {
|
|
261
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
262
|
+
message: string;
|
|
263
|
+
retryable: boolean;
|
|
264
|
+
details?: unknown;
|
|
265
|
+
stack?: string | undefined;
|
|
266
|
+
};
|
|
267
|
+
type: "result";
|
|
268
|
+
octonode: "1";
|
|
269
|
+
status: "error";
|
|
270
|
+
invocationId: string;
|
|
271
|
+
}, {
|
|
272
|
+
error: {
|
|
273
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
274
|
+
message: string;
|
|
275
|
+
retryable?: boolean | undefined;
|
|
276
|
+
details?: unknown;
|
|
277
|
+
stack?: string | undefined;
|
|
278
|
+
};
|
|
279
|
+
type: "result";
|
|
280
|
+
octonode: "1";
|
|
281
|
+
status: "error";
|
|
282
|
+
invocationId: string;
|
|
283
|
+
}>;
|
|
284
|
+
/** Node → engine: the outcome of an invocation. */
|
|
285
|
+
export declare const ResultEnvelope: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
286
|
+
octonode: z.ZodLiteral<"1">;
|
|
287
|
+
type: z.ZodLiteral<"result">;
|
|
288
|
+
invocationId: z.ZodString;
|
|
289
|
+
status: z.ZodLiteral<"ok">;
|
|
290
|
+
outputs: z.ZodUnknown;
|
|
291
|
+
}, "strip", z.ZodTypeAny, {
|
|
292
|
+
type: "result";
|
|
293
|
+
octonode: "1";
|
|
294
|
+
status: "ok";
|
|
295
|
+
invocationId: string;
|
|
296
|
+
outputs?: unknown;
|
|
297
|
+
}, {
|
|
298
|
+
type: "result";
|
|
299
|
+
octonode: "1";
|
|
300
|
+
status: "ok";
|
|
301
|
+
invocationId: string;
|
|
302
|
+
outputs?: unknown;
|
|
303
|
+
}>, z.ZodObject<{
|
|
304
|
+
octonode: z.ZodLiteral<"1">;
|
|
305
|
+
type: z.ZodLiteral<"result">;
|
|
306
|
+
invocationId: z.ZodString;
|
|
307
|
+
status: z.ZodLiteral<"error">;
|
|
308
|
+
error: z.ZodObject<{
|
|
309
|
+
code: z.ZodEnum<["VALIDATION_ERROR", "RUNTIME_ERROR", "TIMEOUT", "NON_RETRYABLE"]>;
|
|
310
|
+
message: z.ZodString;
|
|
311
|
+
retryable: z.ZodDefault<z.ZodBoolean>;
|
|
312
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
313
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
314
|
+
}, "strip", z.ZodTypeAny, {
|
|
315
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
316
|
+
message: string;
|
|
317
|
+
retryable: boolean;
|
|
318
|
+
details?: unknown;
|
|
319
|
+
stack?: string | undefined;
|
|
320
|
+
}, {
|
|
321
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
322
|
+
message: string;
|
|
323
|
+
retryable?: boolean | undefined;
|
|
324
|
+
details?: unknown;
|
|
325
|
+
stack?: string | undefined;
|
|
326
|
+
}>;
|
|
327
|
+
}, "strip", z.ZodTypeAny, {
|
|
328
|
+
error: {
|
|
329
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
330
|
+
message: string;
|
|
331
|
+
retryable: boolean;
|
|
332
|
+
details?: unknown;
|
|
333
|
+
stack?: string | undefined;
|
|
334
|
+
};
|
|
335
|
+
type: "result";
|
|
336
|
+
octonode: "1";
|
|
337
|
+
status: "error";
|
|
338
|
+
invocationId: string;
|
|
339
|
+
}, {
|
|
340
|
+
error: {
|
|
341
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
342
|
+
message: string;
|
|
343
|
+
retryable?: boolean | undefined;
|
|
344
|
+
details?: unknown;
|
|
345
|
+
stack?: string | undefined;
|
|
346
|
+
};
|
|
347
|
+
type: "result";
|
|
348
|
+
octonode: "1";
|
|
349
|
+
status: "error";
|
|
350
|
+
invocationId: string;
|
|
351
|
+
}>]>;
|
|
352
|
+
export type ResultEnvelope = z.infer<typeof ResultEnvelope>;
|
|
353
|
+
export type OkResult = z.infer<typeof ResultOk>;
|
|
354
|
+
export type ErrorResult = z.infer<typeof ResultErr>;
|
|
355
|
+
/**
|
|
356
|
+
* What a node declares about itself: a stable id, its language, the JSON Schema
|
|
357
|
+
* for its inputs and outputs, and optional presentation/runtime seeds. This is
|
|
358
|
+
* the payload `octonode scan` collects (Phase 3) to populate `.octonode`.
|
|
359
|
+
*/
|
|
360
|
+
export declare const NodeManifest: z.ZodObject<{
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
label: z.ZodOptional<z.ZodString>;
|
|
363
|
+
description: z.ZodOptional<z.ZodString>;
|
|
364
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
365
|
+
defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
366
|
+
/** A workflow wrapper receives the current execution config through its invocation context. */
|
|
367
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
368
|
+
language: z.ZodString;
|
|
369
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
370
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
371
|
+
/**
|
|
372
|
+
* What this node is: `function` (default), `class`, `service`, or `const`.
|
|
373
|
+
* Set by the setup-time SDK helpers (defineService/defineClass/defineConst)
|
|
374
|
+
* so `scan` writes it to `.octonode`.
|
|
375
|
+
*/
|
|
376
|
+
kind: z.ZodOptional<z.ZodEnum<["function", "class", "service", "const"]>>;
|
|
377
|
+
/** Setup params for non-function kinds (constructor/config shape). */
|
|
378
|
+
setup: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
379
|
+
/** Advisory default icon — a one-time seed; config owns it thereafter. */
|
|
380
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["arrow-up-down", "binary", "bomb", "boxes", "braces", "calculator", "calendar", "camera", "clock", "code", "copy-x", "database", "dices", "filter", "flag", "flask", "function", "git-branch", "git-merge", "group", "hook", "list-filter", "merge", "octagon-x", "package", "package-x", "pencil", "play", "regex", "repeat", "replace", "ruler", "scan-eye", "scissors", "search", "server-cog", "settings", "sigma", "split", "terminal", "test-tube", "text-cursor-input", "ticket", "truck", "type", "typescript", "ungroup", "variable", "wand", "wave", "webhook", "workflow", "x"]>, z.ZodEffects<z.ZodString, string, string>]>>;
|
|
381
|
+
/** Advisory default config — a one-time seed; config owns it thereafter. */
|
|
382
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
383
|
+
/** Explicit service exposure. Plain classes never populate this field. */
|
|
384
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
lifecycle: z.ZodEnum<["invocation", "workflow-run", "worker"]>;
|
|
386
|
+
methods: z.ZodArray<z.ZodObject<{
|
|
387
|
+
name: z.ZodString;
|
|
388
|
+
params: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
389
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
390
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
391
|
+
}, "strip", z.ZodTypeAny, {
|
|
392
|
+
name: string;
|
|
393
|
+
params: string[];
|
|
394
|
+
inputs?: Record<string, unknown> | undefined;
|
|
395
|
+
outputs?: Record<string, unknown> | undefined;
|
|
396
|
+
}, {
|
|
397
|
+
name: string;
|
|
398
|
+
params?: string[] | undefined;
|
|
399
|
+
inputs?: Record<string, unknown> | undefined;
|
|
400
|
+
outputs?: Record<string, unknown> | undefined;
|
|
401
|
+
}>, "many">;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
404
|
+
methods: {
|
|
405
|
+
name: string;
|
|
406
|
+
params: string[];
|
|
407
|
+
inputs?: Record<string, unknown> | undefined;
|
|
408
|
+
outputs?: Record<string, unknown> | undefined;
|
|
409
|
+
}[];
|
|
410
|
+
}, {
|
|
411
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
412
|
+
methods: {
|
|
413
|
+
name: string;
|
|
414
|
+
params?: string[] | undefined;
|
|
415
|
+
inputs?: Record<string, unknown> | undefined;
|
|
416
|
+
outputs?: Record<string, unknown> | undefined;
|
|
417
|
+
}[];
|
|
418
|
+
}>>;
|
|
419
|
+
}, "strip", z.ZodTypeAny, {
|
|
420
|
+
id: string;
|
|
421
|
+
language: string;
|
|
422
|
+
symbol?: string | undefined;
|
|
423
|
+
config?: Record<string, unknown> | undefined;
|
|
424
|
+
service?: {
|
|
425
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
426
|
+
methods: {
|
|
427
|
+
name: string;
|
|
428
|
+
params: string[];
|
|
429
|
+
inputs?: Record<string, unknown> | undefined;
|
|
430
|
+
outputs?: Record<string, unknown> | undefined;
|
|
431
|
+
}[];
|
|
432
|
+
} | undefined;
|
|
433
|
+
label?: string | undefined;
|
|
434
|
+
workflowId?: string | undefined;
|
|
435
|
+
inputs?: Record<string, unknown> | undefined;
|
|
436
|
+
outputs?: Record<string, unknown> | undefined;
|
|
437
|
+
description?: string | undefined;
|
|
438
|
+
defaults?: Record<string, unknown> | undefined;
|
|
439
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
440
|
+
setup?: Record<string, unknown> | undefined;
|
|
441
|
+
icon?: string | undefined;
|
|
442
|
+
}, {
|
|
443
|
+
id: string;
|
|
444
|
+
language: string;
|
|
445
|
+
symbol?: string | undefined;
|
|
446
|
+
config?: Record<string, unknown> | undefined;
|
|
447
|
+
service?: {
|
|
448
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
449
|
+
methods: {
|
|
450
|
+
name: string;
|
|
451
|
+
params?: string[] | undefined;
|
|
452
|
+
inputs?: Record<string, unknown> | undefined;
|
|
453
|
+
outputs?: Record<string, unknown> | undefined;
|
|
454
|
+
}[];
|
|
455
|
+
} | undefined;
|
|
456
|
+
label?: string | undefined;
|
|
457
|
+
workflowId?: string | undefined;
|
|
458
|
+
inputs?: Record<string, unknown> | undefined;
|
|
459
|
+
outputs?: Record<string, unknown> | undefined;
|
|
460
|
+
description?: string | undefined;
|
|
461
|
+
defaults?: Record<string, unknown> | undefined;
|
|
462
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
463
|
+
setup?: Record<string, unknown> | undefined;
|
|
464
|
+
icon?: string | undefined;
|
|
465
|
+
}>;
|
|
466
|
+
export type NodeManifest = z.infer<typeof NodeManifest>;
|
|
467
|
+
declare const ManifestOk: z.ZodObject<{
|
|
468
|
+
octonode: z.ZodLiteral<"1">;
|
|
469
|
+
type: z.ZodLiteral<"manifest">;
|
|
470
|
+
invocationId: z.ZodString;
|
|
471
|
+
status: z.ZodLiteral<"ok">;
|
|
472
|
+
manifest: z.ZodObject<{
|
|
473
|
+
id: z.ZodString;
|
|
474
|
+
label: z.ZodOptional<z.ZodString>;
|
|
475
|
+
description: z.ZodOptional<z.ZodString>;
|
|
476
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
477
|
+
defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
478
|
+
/** A workflow wrapper receives the current execution config through its invocation context. */
|
|
479
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
480
|
+
language: z.ZodString;
|
|
481
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
482
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
483
|
+
/**
|
|
484
|
+
* What this node is: `function` (default), `class`, `service`, or `const`.
|
|
485
|
+
* Set by the setup-time SDK helpers (defineService/defineClass/defineConst)
|
|
486
|
+
* so `scan` writes it to `.octonode`.
|
|
487
|
+
*/
|
|
488
|
+
kind: z.ZodOptional<z.ZodEnum<["function", "class", "service", "const"]>>;
|
|
489
|
+
/** Setup params for non-function kinds (constructor/config shape). */
|
|
490
|
+
setup: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
491
|
+
/** Advisory default icon — a one-time seed; config owns it thereafter. */
|
|
492
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["arrow-up-down", "binary", "bomb", "boxes", "braces", "calculator", "calendar", "camera", "clock", "code", "copy-x", "database", "dices", "filter", "flag", "flask", "function", "git-branch", "git-merge", "group", "hook", "list-filter", "merge", "octagon-x", "package", "package-x", "pencil", "play", "regex", "repeat", "replace", "ruler", "scan-eye", "scissors", "search", "server-cog", "settings", "sigma", "split", "terminal", "test-tube", "text-cursor-input", "ticket", "truck", "type", "typescript", "ungroup", "variable", "wand", "wave", "webhook", "workflow", "x"]>, z.ZodEffects<z.ZodString, string, string>]>>;
|
|
493
|
+
/** Advisory default config — a one-time seed; config owns it thereafter. */
|
|
494
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
495
|
+
/** Explicit service exposure. Plain classes never populate this field. */
|
|
496
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
497
|
+
lifecycle: z.ZodEnum<["invocation", "workflow-run", "worker"]>;
|
|
498
|
+
methods: z.ZodArray<z.ZodObject<{
|
|
499
|
+
name: z.ZodString;
|
|
500
|
+
params: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
501
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
502
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
503
|
+
}, "strip", z.ZodTypeAny, {
|
|
504
|
+
name: string;
|
|
505
|
+
params: string[];
|
|
506
|
+
inputs?: Record<string, unknown> | undefined;
|
|
507
|
+
outputs?: Record<string, unknown> | undefined;
|
|
508
|
+
}, {
|
|
509
|
+
name: string;
|
|
510
|
+
params?: string[] | undefined;
|
|
511
|
+
inputs?: Record<string, unknown> | undefined;
|
|
512
|
+
outputs?: Record<string, unknown> | undefined;
|
|
513
|
+
}>, "many">;
|
|
514
|
+
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
516
|
+
methods: {
|
|
517
|
+
name: string;
|
|
518
|
+
params: string[];
|
|
519
|
+
inputs?: Record<string, unknown> | undefined;
|
|
520
|
+
outputs?: Record<string, unknown> | undefined;
|
|
521
|
+
}[];
|
|
522
|
+
}, {
|
|
523
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
524
|
+
methods: {
|
|
525
|
+
name: string;
|
|
526
|
+
params?: string[] | undefined;
|
|
527
|
+
inputs?: Record<string, unknown> | undefined;
|
|
528
|
+
outputs?: Record<string, unknown> | undefined;
|
|
529
|
+
}[];
|
|
530
|
+
}>>;
|
|
531
|
+
}, "strip", z.ZodTypeAny, {
|
|
532
|
+
id: string;
|
|
533
|
+
language: string;
|
|
534
|
+
symbol?: string | undefined;
|
|
535
|
+
config?: Record<string, unknown> | undefined;
|
|
536
|
+
service?: {
|
|
537
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
538
|
+
methods: {
|
|
539
|
+
name: string;
|
|
540
|
+
params: string[];
|
|
541
|
+
inputs?: Record<string, unknown> | undefined;
|
|
542
|
+
outputs?: Record<string, unknown> | undefined;
|
|
543
|
+
}[];
|
|
544
|
+
} | undefined;
|
|
545
|
+
label?: string | undefined;
|
|
546
|
+
workflowId?: string | undefined;
|
|
547
|
+
inputs?: Record<string, unknown> | undefined;
|
|
548
|
+
outputs?: Record<string, unknown> | undefined;
|
|
549
|
+
description?: string | undefined;
|
|
550
|
+
defaults?: Record<string, unknown> | undefined;
|
|
551
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
552
|
+
setup?: Record<string, unknown> | undefined;
|
|
553
|
+
icon?: string | undefined;
|
|
554
|
+
}, {
|
|
555
|
+
id: string;
|
|
556
|
+
language: string;
|
|
557
|
+
symbol?: string | undefined;
|
|
558
|
+
config?: Record<string, unknown> | undefined;
|
|
559
|
+
service?: {
|
|
560
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
561
|
+
methods: {
|
|
562
|
+
name: string;
|
|
563
|
+
params?: string[] | undefined;
|
|
564
|
+
inputs?: Record<string, unknown> | undefined;
|
|
565
|
+
outputs?: Record<string, unknown> | undefined;
|
|
566
|
+
}[];
|
|
567
|
+
} | undefined;
|
|
568
|
+
label?: string | undefined;
|
|
569
|
+
workflowId?: string | undefined;
|
|
570
|
+
inputs?: Record<string, unknown> | undefined;
|
|
571
|
+
outputs?: Record<string, unknown> | undefined;
|
|
572
|
+
description?: string | undefined;
|
|
573
|
+
defaults?: Record<string, unknown> | undefined;
|
|
574
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
575
|
+
setup?: Record<string, unknown> | undefined;
|
|
576
|
+
icon?: string | undefined;
|
|
577
|
+
}>;
|
|
578
|
+
}, "strip", z.ZodTypeAny, {
|
|
579
|
+
type: "manifest";
|
|
580
|
+
octonode: "1";
|
|
581
|
+
status: "ok";
|
|
582
|
+
invocationId: string;
|
|
583
|
+
manifest: {
|
|
584
|
+
id: string;
|
|
585
|
+
language: string;
|
|
586
|
+
symbol?: string | undefined;
|
|
587
|
+
config?: Record<string, unknown> | undefined;
|
|
588
|
+
service?: {
|
|
589
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
590
|
+
methods: {
|
|
591
|
+
name: string;
|
|
592
|
+
params: string[];
|
|
593
|
+
inputs?: Record<string, unknown> | undefined;
|
|
594
|
+
outputs?: Record<string, unknown> | undefined;
|
|
595
|
+
}[];
|
|
596
|
+
} | undefined;
|
|
597
|
+
label?: string | undefined;
|
|
598
|
+
workflowId?: string | undefined;
|
|
599
|
+
inputs?: Record<string, unknown> | undefined;
|
|
600
|
+
outputs?: Record<string, unknown> | undefined;
|
|
601
|
+
description?: string | undefined;
|
|
602
|
+
defaults?: Record<string, unknown> | undefined;
|
|
603
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
604
|
+
setup?: Record<string, unknown> | undefined;
|
|
605
|
+
icon?: string | undefined;
|
|
606
|
+
};
|
|
607
|
+
}, {
|
|
608
|
+
type: "manifest";
|
|
609
|
+
octonode: "1";
|
|
610
|
+
status: "ok";
|
|
611
|
+
invocationId: string;
|
|
612
|
+
manifest: {
|
|
613
|
+
id: string;
|
|
614
|
+
language: string;
|
|
615
|
+
symbol?: string | undefined;
|
|
616
|
+
config?: Record<string, unknown> | undefined;
|
|
617
|
+
service?: {
|
|
618
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
619
|
+
methods: {
|
|
620
|
+
name: string;
|
|
621
|
+
params?: string[] | undefined;
|
|
622
|
+
inputs?: Record<string, unknown> | undefined;
|
|
623
|
+
outputs?: Record<string, unknown> | undefined;
|
|
624
|
+
}[];
|
|
625
|
+
} | undefined;
|
|
626
|
+
label?: string | undefined;
|
|
627
|
+
workflowId?: string | undefined;
|
|
628
|
+
inputs?: Record<string, unknown> | undefined;
|
|
629
|
+
outputs?: Record<string, unknown> | undefined;
|
|
630
|
+
description?: string | undefined;
|
|
631
|
+
defaults?: Record<string, unknown> | undefined;
|
|
632
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
633
|
+
setup?: Record<string, unknown> | undefined;
|
|
634
|
+
icon?: string | undefined;
|
|
635
|
+
};
|
|
636
|
+
}>;
|
|
637
|
+
declare const ManifestErr: z.ZodObject<{
|
|
638
|
+
octonode: z.ZodLiteral<"1">;
|
|
639
|
+
type: z.ZodLiteral<"manifest">;
|
|
640
|
+
invocationId: z.ZodString;
|
|
641
|
+
status: z.ZodLiteral<"error">;
|
|
642
|
+
error: z.ZodObject<{
|
|
643
|
+
code: z.ZodEnum<["VALIDATION_ERROR", "RUNTIME_ERROR", "TIMEOUT", "NON_RETRYABLE"]>;
|
|
644
|
+
message: z.ZodString;
|
|
645
|
+
retryable: z.ZodDefault<z.ZodBoolean>;
|
|
646
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
647
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
648
|
+
}, "strip", z.ZodTypeAny, {
|
|
649
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
650
|
+
message: string;
|
|
651
|
+
retryable: boolean;
|
|
652
|
+
details?: unknown;
|
|
653
|
+
stack?: string | undefined;
|
|
654
|
+
}, {
|
|
655
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
656
|
+
message: string;
|
|
657
|
+
retryable?: boolean | undefined;
|
|
658
|
+
details?: unknown;
|
|
659
|
+
stack?: string | undefined;
|
|
660
|
+
}>;
|
|
661
|
+
}, "strip", z.ZodTypeAny, {
|
|
662
|
+
error: {
|
|
663
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
664
|
+
message: string;
|
|
665
|
+
retryable: boolean;
|
|
666
|
+
details?: unknown;
|
|
667
|
+
stack?: string | undefined;
|
|
668
|
+
};
|
|
669
|
+
type: "manifest";
|
|
670
|
+
octonode: "1";
|
|
671
|
+
status: "error";
|
|
672
|
+
invocationId: string;
|
|
673
|
+
}, {
|
|
674
|
+
error: {
|
|
675
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
676
|
+
message: string;
|
|
677
|
+
retryable?: boolean | undefined;
|
|
678
|
+
details?: unknown;
|
|
679
|
+
stack?: string | undefined;
|
|
680
|
+
};
|
|
681
|
+
type: "manifest";
|
|
682
|
+
octonode: "1";
|
|
683
|
+
status: "error";
|
|
684
|
+
invocationId: string;
|
|
685
|
+
}>;
|
|
686
|
+
/** Node → engine: the response to a `describe` request. */
|
|
687
|
+
export declare const ManifestEnvelope: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
688
|
+
octonode: z.ZodLiteral<"1">;
|
|
689
|
+
type: z.ZodLiteral<"manifest">;
|
|
690
|
+
invocationId: z.ZodString;
|
|
691
|
+
status: z.ZodLiteral<"ok">;
|
|
692
|
+
manifest: z.ZodObject<{
|
|
693
|
+
id: z.ZodString;
|
|
694
|
+
label: z.ZodOptional<z.ZodString>;
|
|
695
|
+
description: z.ZodOptional<z.ZodString>;
|
|
696
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
697
|
+
defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
698
|
+
/** A workflow wrapper receives the current execution config through its invocation context. */
|
|
699
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
700
|
+
language: z.ZodString;
|
|
701
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
702
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
703
|
+
/**
|
|
704
|
+
* What this node is: `function` (default), `class`, `service`, or `const`.
|
|
705
|
+
* Set by the setup-time SDK helpers (defineService/defineClass/defineConst)
|
|
706
|
+
* so `scan` writes it to `.octonode`.
|
|
707
|
+
*/
|
|
708
|
+
kind: z.ZodOptional<z.ZodEnum<["function", "class", "service", "const"]>>;
|
|
709
|
+
/** Setup params for non-function kinds (constructor/config shape). */
|
|
710
|
+
setup: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
711
|
+
/** Advisory default icon — a one-time seed; config owns it thereafter. */
|
|
712
|
+
icon: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["arrow-up-down", "binary", "bomb", "boxes", "braces", "calculator", "calendar", "camera", "clock", "code", "copy-x", "database", "dices", "filter", "flag", "flask", "function", "git-branch", "git-merge", "group", "hook", "list-filter", "merge", "octagon-x", "package", "package-x", "pencil", "play", "regex", "repeat", "replace", "ruler", "scan-eye", "scissors", "search", "server-cog", "settings", "sigma", "split", "terminal", "test-tube", "text-cursor-input", "ticket", "truck", "type", "typescript", "ungroup", "variable", "wand", "wave", "webhook", "workflow", "x"]>, z.ZodEffects<z.ZodString, string, string>]>>;
|
|
713
|
+
/** Advisory default config — a one-time seed; config owns it thereafter. */
|
|
714
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
715
|
+
/** Explicit service exposure. Plain classes never populate this field. */
|
|
716
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
717
|
+
lifecycle: z.ZodEnum<["invocation", "workflow-run", "worker"]>;
|
|
718
|
+
methods: z.ZodArray<z.ZodObject<{
|
|
719
|
+
name: z.ZodString;
|
|
720
|
+
params: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
721
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
722
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
723
|
+
}, "strip", z.ZodTypeAny, {
|
|
724
|
+
name: string;
|
|
725
|
+
params: string[];
|
|
726
|
+
inputs?: Record<string, unknown> | undefined;
|
|
727
|
+
outputs?: Record<string, unknown> | undefined;
|
|
728
|
+
}, {
|
|
729
|
+
name: string;
|
|
730
|
+
params?: string[] | undefined;
|
|
731
|
+
inputs?: Record<string, unknown> | undefined;
|
|
732
|
+
outputs?: Record<string, unknown> | undefined;
|
|
733
|
+
}>, "many">;
|
|
734
|
+
}, "strip", z.ZodTypeAny, {
|
|
735
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
736
|
+
methods: {
|
|
737
|
+
name: string;
|
|
738
|
+
params: string[];
|
|
739
|
+
inputs?: Record<string, unknown> | undefined;
|
|
740
|
+
outputs?: Record<string, unknown> | undefined;
|
|
741
|
+
}[];
|
|
742
|
+
}, {
|
|
743
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
744
|
+
methods: {
|
|
745
|
+
name: string;
|
|
746
|
+
params?: string[] | undefined;
|
|
747
|
+
inputs?: Record<string, unknown> | undefined;
|
|
748
|
+
outputs?: Record<string, unknown> | undefined;
|
|
749
|
+
}[];
|
|
750
|
+
}>>;
|
|
751
|
+
}, "strip", z.ZodTypeAny, {
|
|
752
|
+
id: string;
|
|
753
|
+
language: string;
|
|
754
|
+
symbol?: string | undefined;
|
|
755
|
+
config?: Record<string, unknown> | undefined;
|
|
756
|
+
service?: {
|
|
757
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
758
|
+
methods: {
|
|
759
|
+
name: string;
|
|
760
|
+
params: string[];
|
|
761
|
+
inputs?: Record<string, unknown> | undefined;
|
|
762
|
+
outputs?: Record<string, unknown> | undefined;
|
|
763
|
+
}[];
|
|
764
|
+
} | undefined;
|
|
765
|
+
label?: string | undefined;
|
|
766
|
+
workflowId?: string | undefined;
|
|
767
|
+
inputs?: Record<string, unknown> | undefined;
|
|
768
|
+
outputs?: Record<string, unknown> | undefined;
|
|
769
|
+
description?: string | undefined;
|
|
770
|
+
defaults?: Record<string, unknown> | undefined;
|
|
771
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
772
|
+
setup?: Record<string, unknown> | undefined;
|
|
773
|
+
icon?: string | undefined;
|
|
774
|
+
}, {
|
|
775
|
+
id: string;
|
|
776
|
+
language: string;
|
|
777
|
+
symbol?: string | undefined;
|
|
778
|
+
config?: Record<string, unknown> | undefined;
|
|
779
|
+
service?: {
|
|
780
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
781
|
+
methods: {
|
|
782
|
+
name: string;
|
|
783
|
+
params?: string[] | undefined;
|
|
784
|
+
inputs?: Record<string, unknown> | undefined;
|
|
785
|
+
outputs?: Record<string, unknown> | undefined;
|
|
786
|
+
}[];
|
|
787
|
+
} | undefined;
|
|
788
|
+
label?: string | undefined;
|
|
789
|
+
workflowId?: string | undefined;
|
|
790
|
+
inputs?: Record<string, unknown> | undefined;
|
|
791
|
+
outputs?: Record<string, unknown> | undefined;
|
|
792
|
+
description?: string | undefined;
|
|
793
|
+
defaults?: Record<string, unknown> | undefined;
|
|
794
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
795
|
+
setup?: Record<string, unknown> | undefined;
|
|
796
|
+
icon?: string | undefined;
|
|
797
|
+
}>;
|
|
798
|
+
}, "strip", z.ZodTypeAny, {
|
|
799
|
+
type: "manifest";
|
|
800
|
+
octonode: "1";
|
|
801
|
+
status: "ok";
|
|
802
|
+
invocationId: string;
|
|
803
|
+
manifest: {
|
|
804
|
+
id: string;
|
|
805
|
+
language: string;
|
|
806
|
+
symbol?: string | undefined;
|
|
807
|
+
config?: Record<string, unknown> | undefined;
|
|
808
|
+
service?: {
|
|
809
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
810
|
+
methods: {
|
|
811
|
+
name: string;
|
|
812
|
+
params: string[];
|
|
813
|
+
inputs?: Record<string, unknown> | undefined;
|
|
814
|
+
outputs?: Record<string, unknown> | undefined;
|
|
815
|
+
}[];
|
|
816
|
+
} | undefined;
|
|
817
|
+
label?: string | undefined;
|
|
818
|
+
workflowId?: string | undefined;
|
|
819
|
+
inputs?: Record<string, unknown> | undefined;
|
|
820
|
+
outputs?: Record<string, unknown> | undefined;
|
|
821
|
+
description?: string | undefined;
|
|
822
|
+
defaults?: Record<string, unknown> | undefined;
|
|
823
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
824
|
+
setup?: Record<string, unknown> | undefined;
|
|
825
|
+
icon?: string | undefined;
|
|
826
|
+
};
|
|
827
|
+
}, {
|
|
828
|
+
type: "manifest";
|
|
829
|
+
octonode: "1";
|
|
830
|
+
status: "ok";
|
|
831
|
+
invocationId: string;
|
|
832
|
+
manifest: {
|
|
833
|
+
id: string;
|
|
834
|
+
language: string;
|
|
835
|
+
symbol?: string | undefined;
|
|
836
|
+
config?: Record<string, unknown> | undefined;
|
|
837
|
+
service?: {
|
|
838
|
+
lifecycle: "invocation" | "workflow-run" | "worker";
|
|
839
|
+
methods: {
|
|
840
|
+
name: string;
|
|
841
|
+
params?: string[] | undefined;
|
|
842
|
+
inputs?: Record<string, unknown> | undefined;
|
|
843
|
+
outputs?: Record<string, unknown> | undefined;
|
|
844
|
+
}[];
|
|
845
|
+
} | undefined;
|
|
846
|
+
label?: string | undefined;
|
|
847
|
+
workflowId?: string | undefined;
|
|
848
|
+
inputs?: Record<string, unknown> | undefined;
|
|
849
|
+
outputs?: Record<string, unknown> | undefined;
|
|
850
|
+
description?: string | undefined;
|
|
851
|
+
defaults?: Record<string, unknown> | undefined;
|
|
852
|
+
kind?: "function" | "class" | "service" | "const" | undefined;
|
|
853
|
+
setup?: Record<string, unknown> | undefined;
|
|
854
|
+
icon?: string | undefined;
|
|
855
|
+
};
|
|
856
|
+
}>, z.ZodObject<{
|
|
857
|
+
octonode: z.ZodLiteral<"1">;
|
|
858
|
+
type: z.ZodLiteral<"manifest">;
|
|
859
|
+
invocationId: z.ZodString;
|
|
860
|
+
status: z.ZodLiteral<"error">;
|
|
861
|
+
error: z.ZodObject<{
|
|
862
|
+
code: z.ZodEnum<["VALIDATION_ERROR", "RUNTIME_ERROR", "TIMEOUT", "NON_RETRYABLE"]>;
|
|
863
|
+
message: z.ZodString;
|
|
864
|
+
retryable: z.ZodDefault<z.ZodBoolean>;
|
|
865
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
866
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
867
|
+
}, "strip", z.ZodTypeAny, {
|
|
868
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
869
|
+
message: string;
|
|
870
|
+
retryable: boolean;
|
|
871
|
+
details?: unknown;
|
|
872
|
+
stack?: string | undefined;
|
|
873
|
+
}, {
|
|
874
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
875
|
+
message: string;
|
|
876
|
+
retryable?: boolean | undefined;
|
|
877
|
+
details?: unknown;
|
|
878
|
+
stack?: string | undefined;
|
|
879
|
+
}>;
|
|
880
|
+
}, "strip", z.ZodTypeAny, {
|
|
881
|
+
error: {
|
|
882
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
883
|
+
message: string;
|
|
884
|
+
retryable: boolean;
|
|
885
|
+
details?: unknown;
|
|
886
|
+
stack?: string | undefined;
|
|
887
|
+
};
|
|
888
|
+
type: "manifest";
|
|
889
|
+
octonode: "1";
|
|
890
|
+
status: "error";
|
|
891
|
+
invocationId: string;
|
|
892
|
+
}, {
|
|
893
|
+
error: {
|
|
894
|
+
code: "VALIDATION_ERROR" | "RUNTIME_ERROR" | "TIMEOUT" | "NON_RETRYABLE";
|
|
895
|
+
message: string;
|
|
896
|
+
retryable?: boolean | undefined;
|
|
897
|
+
details?: unknown;
|
|
898
|
+
stack?: string | undefined;
|
|
899
|
+
};
|
|
900
|
+
type: "manifest";
|
|
901
|
+
octonode: "1";
|
|
902
|
+
status: "error";
|
|
903
|
+
invocationId: string;
|
|
904
|
+
}>]>;
|
|
905
|
+
export type ManifestEnvelope = z.infer<typeof ManifestEnvelope>;
|
|
906
|
+
export type ManifestResult = z.infer<typeof ManifestOk>;
|
|
907
|
+
export type ManifestError = z.infer<typeof ManifestErr>;
|
|
908
|
+
export declare function makeInvokeRequest(args: {
|
|
909
|
+
invocationId: string;
|
|
910
|
+
inputs: unknown;
|
|
911
|
+
node?: string;
|
|
912
|
+
context?: Partial<InvocationContext>;
|
|
913
|
+
}): InvokeRequest;
|
|
914
|
+
export declare function makeDescribeRequest(args: {
|
|
915
|
+
invocationId: string;
|
|
916
|
+
node?: string;
|
|
917
|
+
}): DescribeRequest;
|
|
918
|
+
export declare function makeOkResult(invocationId: string, outputs: unknown): OkResult;
|
|
919
|
+
export declare function makeErrorResult(invocationId: string, error: NodeError): ErrorResult;
|
|
920
|
+
export declare function makeManifestResult(invocationId: string, manifest: NodeManifest): ManifestResult;
|
|
921
|
+
export declare function makeManifestError(invocationId: string, error: NodeError): ManifestError;
|
|
922
|
+
export {};
|
|
923
|
+
//# sourceMappingURL=envelope.d.ts.map
|