@ablehi/server-contract 0.2.1 → 0.2.3
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/dist/edge-BTl-jgfc.d.ts +949 -0
- package/dist/edge.d.ts +1 -934
- package/dist/edge.js +1 -1
- package/dist/index.d.ts +106 -83
- package/dist/index.js +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,949 @@
|
|
|
1
|
+
declare const SERVER_CONTRACT_VERSION = "0.2.3";
|
|
2
|
+
type ServerContractVersion = typeof SERVER_CONTRACT_VERSION;
|
|
3
|
+
|
|
4
|
+
declare const FLOW_IR_SCHEMA_VERSION = "flow.ir.v1";
|
|
5
|
+
type JsonObject = {
|
|
6
|
+
[key: string]: JsonValue;
|
|
7
|
+
};
|
|
8
|
+
type JsonArray = JsonValue[];
|
|
9
|
+
type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
|
|
10
|
+
type ValueExpression = JsonValue;
|
|
11
|
+
type Mapping = {
|
|
12
|
+
[key: string]: ValueExpression;
|
|
13
|
+
};
|
|
14
|
+
type Operand = string | number | boolean | null;
|
|
15
|
+
type Collection = JsonArray | string;
|
|
16
|
+
type BooleanExpression = {
|
|
17
|
+
and: BooleanExpression[];
|
|
18
|
+
} | {
|
|
19
|
+
or: BooleanExpression[];
|
|
20
|
+
} | {
|
|
21
|
+
not: BooleanExpression;
|
|
22
|
+
} | {
|
|
23
|
+
eq: [Operand, Operand];
|
|
24
|
+
} | {
|
|
25
|
+
ne: [Operand, Operand];
|
|
26
|
+
} | {
|
|
27
|
+
in: [Operand, Collection];
|
|
28
|
+
} | {
|
|
29
|
+
exists: Operand;
|
|
30
|
+
};
|
|
31
|
+
type TriggerBinding = ScheduleTriggerBinding | IntegrationTriggerBinding | ManualTriggerBinding;
|
|
32
|
+
type ScheduleTriggerBinding = {
|
|
33
|
+
id: string;
|
|
34
|
+
kind: "schedule";
|
|
35
|
+
cron: string;
|
|
36
|
+
timezone: string;
|
|
37
|
+
inputMapping?: Mapping;
|
|
38
|
+
};
|
|
39
|
+
type IntegrationTriggerBinding = {
|
|
40
|
+
id: string;
|
|
41
|
+
kind: "integration";
|
|
42
|
+
triggerRef: string;
|
|
43
|
+
connectionRef: string;
|
|
44
|
+
config?: JsonObject;
|
|
45
|
+
inputMapping?: Mapping;
|
|
46
|
+
dedupeKey?: ValueExpression;
|
|
47
|
+
};
|
|
48
|
+
type ManualTriggerBinding = {
|
|
49
|
+
id: string;
|
|
50
|
+
kind: "manual";
|
|
51
|
+
label?: string;
|
|
52
|
+
};
|
|
53
|
+
type NodeCommon = {
|
|
54
|
+
id: string;
|
|
55
|
+
runIf?: BooleanExpression;
|
|
56
|
+
dependsOn?: string[];
|
|
57
|
+
};
|
|
58
|
+
type ActionNode = NodeCommon & {
|
|
59
|
+
kind: "action";
|
|
60
|
+
toolRef: string;
|
|
61
|
+
connectionRef: string;
|
|
62
|
+
inputs: Mapping;
|
|
63
|
+
idempotent?: boolean;
|
|
64
|
+
retry?: {
|
|
65
|
+
on: string[];
|
|
66
|
+
limit: number;
|
|
67
|
+
backoff: "exponential" | "fixed";
|
|
68
|
+
};
|
|
69
|
+
timeout?: string;
|
|
70
|
+
};
|
|
71
|
+
type WaitEventNode = NodeCommon & {
|
|
72
|
+
kind: "wait_event";
|
|
73
|
+
eventType: string;
|
|
74
|
+
correlation: {
|
|
75
|
+
key: ValueExpression;
|
|
76
|
+
};
|
|
77
|
+
timeout: string;
|
|
78
|
+
onTimeout: "fail" | string;
|
|
79
|
+
};
|
|
80
|
+
type SleepNode = NodeCommon & {
|
|
81
|
+
kind: "sleep";
|
|
82
|
+
duration: string;
|
|
83
|
+
};
|
|
84
|
+
type HumanInputPrompt = {
|
|
85
|
+
title: TextExpression;
|
|
86
|
+
body?: TextExpression;
|
|
87
|
+
format?: "plain" | "markdown";
|
|
88
|
+
};
|
|
89
|
+
type HumanInputChoice = {
|
|
90
|
+
id: string;
|
|
91
|
+
label: string;
|
|
92
|
+
style?: "primary" | "secondary" | "danger";
|
|
93
|
+
};
|
|
94
|
+
type HumanChoiceInput = {
|
|
95
|
+
kind: "choice";
|
|
96
|
+
choices: HumanInputChoice[];
|
|
97
|
+
allowComment?: boolean;
|
|
98
|
+
};
|
|
99
|
+
type HumanTextInput = {
|
|
100
|
+
kind: "text";
|
|
101
|
+
multiline?: boolean;
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
required?: boolean;
|
|
104
|
+
};
|
|
105
|
+
type HumanFormField = {
|
|
106
|
+
id: string;
|
|
107
|
+
label: string;
|
|
108
|
+
type: "text" | "textarea" | "number" | "boolean" | "select";
|
|
109
|
+
required?: boolean;
|
|
110
|
+
options?: Array<{
|
|
111
|
+
id: string;
|
|
112
|
+
label: string;
|
|
113
|
+
}>;
|
|
114
|
+
};
|
|
115
|
+
type HumanFormInput = {
|
|
116
|
+
kind: "form";
|
|
117
|
+
fields: HumanFormField[];
|
|
118
|
+
};
|
|
119
|
+
type HumanInputSpec = HumanChoiceInput | HumanTextInput | HumanFormInput;
|
|
120
|
+
type HumanInputDeliveryAction = {
|
|
121
|
+
id: string;
|
|
122
|
+
toolRef: string;
|
|
123
|
+
connectionRef: string;
|
|
124
|
+
inputs: Mapping;
|
|
125
|
+
};
|
|
126
|
+
type HumanInputDelivery = {
|
|
127
|
+
actions?: HumanInputDeliveryAction[];
|
|
128
|
+
};
|
|
129
|
+
type HumanInputNode = NodeCommon & {
|
|
130
|
+
kind: "human_input";
|
|
131
|
+
prompt: HumanInputPrompt;
|
|
132
|
+
input: HumanInputSpec;
|
|
133
|
+
timeout: string;
|
|
134
|
+
delivery?: HumanInputDelivery;
|
|
135
|
+
};
|
|
136
|
+
type FlowNode = ActionNode | WaitEventNode | SleepNode | HumanInputNode;
|
|
137
|
+
type TextExpression = string;
|
|
138
|
+
type FlowCompositionSpec = {
|
|
139
|
+
title: TextExpression;
|
|
140
|
+
detail: {
|
|
141
|
+
format: "markdown";
|
|
142
|
+
body: TextExpression;
|
|
143
|
+
data?: Mapping;
|
|
144
|
+
};
|
|
145
|
+
report?: {
|
|
146
|
+
title?: TextExpression;
|
|
147
|
+
format: "markdown";
|
|
148
|
+
body: TextExpression;
|
|
149
|
+
data?: Mapping;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
type FlowDefinition = {
|
|
153
|
+
flow: string;
|
|
154
|
+
triggers?: TriggerBinding[];
|
|
155
|
+
inputSchema: JsonObject;
|
|
156
|
+
nodes: FlowNode[];
|
|
157
|
+
outputs?: Mapping;
|
|
158
|
+
composition: FlowCompositionSpec;
|
|
159
|
+
};
|
|
160
|
+
type FlowIrValidationCode = "INVALID_IR_SHAPE" | "INVALID_NODE_ID" | "INVALID_TRIGGER_ID" | "INVALID_TRIGGER_KIND" | "INVALID_CRON" | "INVALID_NODE_KIND" | "MISSING_NODE_FIELD" | "INVALID_EVENT_TYPE" | "INVALID_DURATION" | "INVALID_RETRY" | "INVALID_HUMAN_INPUT" | "DUPLICATE_NODE_ID" | "DUPLICATE_TRIGGER_ID" | "DANGLING_DEPENDS_ON" | "DATA_REF_TARGET_MISSING" | "DATA_REF_TARGET_NO_OUTPUT" | "DATA_REF_FORWARD_REFERENCE" | "CYCLE_DETECTED" | "INVALID_ON_TIMEOUT_TARGET" | "INVALID_DSL_OPERATOR" | "INVALID_DSL_OPERAND" | "INVALID_DSL_ARITY" | "TRIGGER_REF_SCOPE_VIOLATION" | "NODE_REF_SCOPE_VIOLATION" | "HUMAN_INPUT_REF_SCOPE_VIOLATION" | "NOW_REF_SCOPE_VIOLATION" | "UNKNOWN_REF_ROOT" | "MALFORMED_TEMPLATE_REFERENCE" | "MALFORMED_NOW_EXPR";
|
|
161
|
+
type FlowIrValidationIssue = {
|
|
162
|
+
code: FlowIrValidationCode;
|
|
163
|
+
message: string;
|
|
164
|
+
path: string;
|
|
165
|
+
};
|
|
166
|
+
type FlowIrValidationResult = {
|
|
167
|
+
valid: boolean;
|
|
168
|
+
issues: FlowIrValidationIssue[];
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
declare const FLOW_INTERPRETER_CONTRACT_VERSION = "flow.interp.v2";
|
|
172
|
+
type FlowInterpreterContractVersion = typeof FLOW_INTERPRETER_CONTRACT_VERSION;
|
|
173
|
+
|
|
174
|
+
type ContractParseResult<T> = {
|
|
175
|
+
ok: true;
|
|
176
|
+
value: T;
|
|
177
|
+
} | {
|
|
178
|
+
ok: false;
|
|
179
|
+
reason: string;
|
|
180
|
+
};
|
|
181
|
+
declare function contractParseOk<T>(value: T): ContractParseResult<T>;
|
|
182
|
+
declare function contractParseFail<T>(reason: string): ContractParseResult<T>;
|
|
183
|
+
declare function isJsonRecord(value: unknown): value is Record<string, unknown>;
|
|
184
|
+
|
|
185
|
+
type AblehiSuccess<T> = {
|
|
186
|
+
ok: true;
|
|
187
|
+
data: T;
|
|
188
|
+
};
|
|
189
|
+
type AblehiFailure = {
|
|
190
|
+
ok: false;
|
|
191
|
+
error: {
|
|
192
|
+
code: string;
|
|
193
|
+
message: string;
|
|
194
|
+
issues?: unknown;
|
|
195
|
+
retryable?: boolean;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
type AblehiEnvelope<T> = AblehiSuccess<T> | AblehiFailure;
|
|
199
|
+
|
|
200
|
+
declare const CONTEXT_STATE_CLEANUP_ROUTE_PATH = "/cleanup-state-scopes";
|
|
201
|
+
type ContextStateScope = {
|
|
202
|
+
kind: "webhook-trigger";
|
|
203
|
+
workspaceId: string;
|
|
204
|
+
triggerInstanceId: string;
|
|
205
|
+
} | {
|
|
206
|
+
kind: "polling-trigger";
|
|
207
|
+
workspaceId: string;
|
|
208
|
+
pollingInstanceId: string;
|
|
209
|
+
} | {
|
|
210
|
+
kind: "flow-action";
|
|
211
|
+
workspaceId: string;
|
|
212
|
+
flowId: string;
|
|
213
|
+
nodeId: string;
|
|
214
|
+
connectionId: string | null;
|
|
215
|
+
};
|
|
216
|
+
type ContextStateCleanupRequestBody = {
|
|
217
|
+
scopes: ContextStateScope[];
|
|
218
|
+
};
|
|
219
|
+
type ContextStateCleanupResponseData = {
|
|
220
|
+
deleted: number;
|
|
221
|
+
};
|
|
222
|
+
declare function parseContextStateScope(value: unknown): ContractParseResult<ContextStateScope>;
|
|
223
|
+
declare function parseContextStateCleanupRequestBody(body: unknown): ContractParseResult<ContextStateCleanupRequestBody>;
|
|
224
|
+
declare function parseContextStateCleanupResponseData(data: unknown): ContractParseResult<ContextStateCleanupResponseData>;
|
|
225
|
+
|
|
226
|
+
declare const INTERNAL_FLOW_RUNS_ROUTE_PREFIX = "/internal/flow-runs";
|
|
227
|
+
declare const EXECUTION_CONTEXT_ROUTE_SUBPATH = "/:flowRunId/execution-context";
|
|
228
|
+
declare function executionContextPath(flowRunId: string): string;
|
|
229
|
+
type ExecutionBindingConnection = {
|
|
230
|
+
installationId: string;
|
|
231
|
+
connectionRef: string;
|
|
232
|
+
connectionId: string;
|
|
233
|
+
authType: string;
|
|
234
|
+
connectionConfig?: Record<string, unknown>;
|
|
235
|
+
};
|
|
236
|
+
type ExecutionBinding<TToolDescriptor = Record<string, unknown>, TIntegrationDescriptor = Record<string, unknown>> = {
|
|
237
|
+
nodeId: string;
|
|
238
|
+
toolRef: string;
|
|
239
|
+
toolDescriptor: TToolDescriptor;
|
|
240
|
+
integrationDescriptor: TIntegrationDescriptor;
|
|
241
|
+
connection: ExecutionBindingConnection;
|
|
242
|
+
stateScope: ContextStateScope;
|
|
243
|
+
};
|
|
244
|
+
type FileRuntimeLimits = {
|
|
245
|
+
fileMaxBytes: number;
|
|
246
|
+
fileReadMaxBytes: number;
|
|
247
|
+
inlineMultipartBytesMax: number;
|
|
248
|
+
};
|
|
249
|
+
type FlowExecutionContextFileRuntime = {
|
|
250
|
+
limits: FileRuntimeLimits;
|
|
251
|
+
} | null;
|
|
252
|
+
type ExecutionContextCompiled = {
|
|
253
|
+
irSchemaVersion: string;
|
|
254
|
+
interpreterContractVersion: string;
|
|
255
|
+
ir: FlowDefinition;
|
|
256
|
+
compiledArtifactId: string;
|
|
257
|
+
};
|
|
258
|
+
type ExecutionContextData<TToolDescriptor = Record<string, unknown>, TIntegrationDescriptor = Record<string, unknown>> = {
|
|
259
|
+
flowRunId: string;
|
|
260
|
+
workspaceId: string;
|
|
261
|
+
input: Record<string, unknown>;
|
|
262
|
+
compiled: ExecutionContextCompiled;
|
|
263
|
+
executionBindings: Array<ExecutionBinding<TToolDescriptor, TIntegrationDescriptor>>;
|
|
264
|
+
fileRuntime: FlowExecutionContextFileRuntime;
|
|
265
|
+
};
|
|
266
|
+
declare function parseFileRuntimeLimits(value: unknown): ContractParseResult<FileRuntimeLimits>;
|
|
267
|
+
declare function parseExecutionContextData(data: unknown): ContractParseResult<ExecutionContextData>;
|
|
268
|
+
|
|
269
|
+
declare const STEP_RESULT_ROUTE_SUBPATH = "/:flowRunId/steps/:nodeId/result";
|
|
270
|
+
declare const FLOW_RUN_RESULT_ROUTE_SUBPATH = "/:flowRunId/result";
|
|
271
|
+
declare const EVENT_WAIT_ROUTE_SUBPATH = "/:flowRunId/event-waits/:nodeId";
|
|
272
|
+
declare function stepResultPath(flowRunId: string, nodeId: string): string;
|
|
273
|
+
declare function flowRunResultPath(flowRunId: string): string;
|
|
274
|
+
declare function eventWaitPath(flowRunId: string, nodeId: string): string;
|
|
275
|
+
type StepRecordResult = {
|
|
276
|
+
status: "succeeded";
|
|
277
|
+
output: unknown;
|
|
278
|
+
} | {
|
|
279
|
+
status: "failed";
|
|
280
|
+
errorCode: string;
|
|
281
|
+
issues?: unknown;
|
|
282
|
+
};
|
|
283
|
+
type StepRecordBody = {
|
|
284
|
+
attempt: number;
|
|
285
|
+
result: StepRecordResult;
|
|
286
|
+
durationMs?: number;
|
|
287
|
+
};
|
|
288
|
+
type StepRecordData = {
|
|
289
|
+
flowRunId: string;
|
|
290
|
+
nodeId: string;
|
|
291
|
+
recorded: "succeeded" | "failed";
|
|
292
|
+
};
|
|
293
|
+
type StepRecordBodyParseResult = {
|
|
294
|
+
ok: true;
|
|
295
|
+
value: StepRecordBody;
|
|
296
|
+
} | {
|
|
297
|
+
ok: false;
|
|
298
|
+
kind: "validation" | "step_result_invalid";
|
|
299
|
+
reason: string;
|
|
300
|
+
};
|
|
301
|
+
declare function parseStepRecordBody(body: unknown): StepRecordBodyParseResult;
|
|
302
|
+
declare function parseStepRecordData(data: unknown): ContractParseResult<StepRecordData>;
|
|
303
|
+
type RenderedFlowComposition = {
|
|
304
|
+
title: string;
|
|
305
|
+
detail: {
|
|
306
|
+
format: "markdown";
|
|
307
|
+
body: string;
|
|
308
|
+
data?: unknown;
|
|
309
|
+
};
|
|
310
|
+
report?: {
|
|
311
|
+
origin: "flow_node";
|
|
312
|
+
title?: string;
|
|
313
|
+
format: "markdown";
|
|
314
|
+
body: string;
|
|
315
|
+
data?: unknown;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
type FlowRunResultRequestBody = {
|
|
319
|
+
status: "succeeded";
|
|
320
|
+
output?: unknown;
|
|
321
|
+
composition?: RenderedFlowComposition;
|
|
322
|
+
} | {
|
|
323
|
+
status: "failed";
|
|
324
|
+
error: {
|
|
325
|
+
code: string;
|
|
326
|
+
message: string;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
type ParsedFlowRunResultBody = {
|
|
330
|
+
status: "succeeded" | "failed";
|
|
331
|
+
output?: unknown;
|
|
332
|
+
error?: {
|
|
333
|
+
code: string;
|
|
334
|
+
message: string;
|
|
335
|
+
};
|
|
336
|
+
composition?: unknown;
|
|
337
|
+
};
|
|
338
|
+
declare function parseFlowRunResultBody(body: unknown): ContractParseResult<ParsedFlowRunResultBody>;
|
|
339
|
+
type FlowRunResultData = {
|
|
340
|
+
run: unknown;
|
|
341
|
+
};
|
|
342
|
+
declare function parseFlowRunResultData(data: unknown): ContractParseResult<FlowRunResultData>;
|
|
343
|
+
type RegisterFlowRunWaitBody = {
|
|
344
|
+
eventType: string;
|
|
345
|
+
correlationKey: string;
|
|
346
|
+
};
|
|
347
|
+
type CompleteFlowRunWaitBody = {
|
|
348
|
+
eventType: string;
|
|
349
|
+
correlationKey: string;
|
|
350
|
+
outcome: "received" | "timed_out";
|
|
351
|
+
eventId?: string;
|
|
352
|
+
};
|
|
353
|
+
type RegisterFlowRunWaitData = {
|
|
354
|
+
registered: true;
|
|
355
|
+
};
|
|
356
|
+
type CompleteFlowRunWaitData = {
|
|
357
|
+
completed: true;
|
|
358
|
+
};
|
|
359
|
+
declare function parseRegisterFlowRunWaitBody(body: unknown): ContractParseResult<RegisterFlowRunWaitBody>;
|
|
360
|
+
declare function parseCompleteFlowRunWaitBody(body: unknown): ContractParseResult<CompleteFlowRunWaitBody>;
|
|
361
|
+
declare function parseRegisterFlowRunWaitData(data: unknown): ContractParseResult<RegisterFlowRunWaitData>;
|
|
362
|
+
|
|
363
|
+
declare const INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX = "/internal/flow-versions";
|
|
364
|
+
declare const HANDLER_BUNDLES_ROUTE_SUBPATH = "/:flowVersionId/handler-bundles";
|
|
365
|
+
declare const INTERNAL_INSTALLATIONS_ROUTE_PREFIX = "/internal/installations";
|
|
366
|
+
declare const TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH = "/:installationId/handler-bundles";
|
|
367
|
+
declare function handlerBundlesPath(flowVersionId: string, compiledArtifactId: string): string;
|
|
368
|
+
declare function toolHandlerBundlesPath(args: {
|
|
369
|
+
installationId: string;
|
|
370
|
+
workspaceId: string;
|
|
371
|
+
artifactDigest: string;
|
|
372
|
+
}): string;
|
|
373
|
+
type RuntimeNetworkModel = "managed_only" | "managed_plus_unmanaged_sdk";
|
|
374
|
+
type RuntimeNetwork = {
|
|
375
|
+
networkModel: RuntimeNetworkModel;
|
|
376
|
+
apiHosts: string[];
|
|
377
|
+
authHosts: string[];
|
|
378
|
+
httpsOnly: boolean;
|
|
379
|
+
};
|
|
380
|
+
type HandlerBundleModule = {
|
|
381
|
+
entry: string;
|
|
382
|
+
files: Record<string, string>;
|
|
383
|
+
};
|
|
384
|
+
type HandlerBundle = {
|
|
385
|
+
toolRef: string;
|
|
386
|
+
kind: "request";
|
|
387
|
+
runtimeNetwork: RuntimeNetwork;
|
|
388
|
+
} | {
|
|
389
|
+
toolRef: string;
|
|
390
|
+
kind: "handler";
|
|
391
|
+
module: HandlerBundleModule;
|
|
392
|
+
runtimeNetwork: RuntimeNetwork;
|
|
393
|
+
};
|
|
394
|
+
type HandlerBundlesData = {
|
|
395
|
+
flowVersionId: string;
|
|
396
|
+
compiledArtifactId: string;
|
|
397
|
+
bundles: HandlerBundle[];
|
|
398
|
+
};
|
|
399
|
+
type ToolHandlerBundlesData = {
|
|
400
|
+
installationId: string;
|
|
401
|
+
artifactDigest: string;
|
|
402
|
+
bundles: HandlerBundle[];
|
|
403
|
+
};
|
|
404
|
+
type HandlerBundlesParseResult<T> = {
|
|
405
|
+
ok: true;
|
|
406
|
+
value: T;
|
|
407
|
+
} | {
|
|
408
|
+
ok: false;
|
|
409
|
+
kind: "shape" | "runtime_network";
|
|
410
|
+
reason: string;
|
|
411
|
+
};
|
|
412
|
+
declare function parseRuntimeNetwork(value: unknown): HandlerBundlesParseResult<RuntimeNetwork>;
|
|
413
|
+
declare function parseHandlerBundlesData(data: unknown): HandlerBundlesParseResult<HandlerBundlesData>;
|
|
414
|
+
declare function parseToolHandlerBundlesData(data: unknown): HandlerBundlesParseResult<ToolHandlerBundlesData>;
|
|
415
|
+
declare function parseHandlerBundle(value: unknown): HandlerBundlesParseResult<HandlerBundle>;
|
|
416
|
+
|
|
417
|
+
declare const INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX = "/internal/webhook-trigger-instances";
|
|
418
|
+
declare const WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH = "/:triggerInstanceId/context";
|
|
419
|
+
declare const WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH = "/:triggerInstanceId/handler-bundles";
|
|
420
|
+
declare const WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH = "/:triggerInstanceId/deliveries/:deliveryId";
|
|
421
|
+
declare const WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH = "/:triggerInstanceId/events";
|
|
422
|
+
declare const WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH = "/:triggerInstanceId/rearm";
|
|
423
|
+
declare function webhookTriggerContextPath(triggerInstanceId: string, artifactDigest: string): string;
|
|
424
|
+
declare function webhookTriggerHandlerBundlesPath(triggerInstanceId: string, artifactDigest: string): string;
|
|
425
|
+
declare function webhookTriggerDeliveryPath(triggerInstanceId: string, deliveryId: string): string;
|
|
426
|
+
declare function webhookTriggerEventsPath(triggerInstanceId: string): string;
|
|
427
|
+
declare function webhookTriggerRearmPath(triggerInstanceId: string): string;
|
|
428
|
+
declare const WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH = "/:installationId/webhook-protocol-adapter-bundle";
|
|
429
|
+
declare function webhookProtocolAdapterBundlePath(args: {
|
|
430
|
+
installationId: string;
|
|
431
|
+
workspaceId: string;
|
|
432
|
+
artifactDigest: string;
|
|
433
|
+
}): string;
|
|
434
|
+
type WebhookTriggerVerificationMethod = "header_exact_match" | "hmac_sha256" | "hmac_sha1";
|
|
435
|
+
type PackageWebhookTriggerRuntimeDescriptor = {
|
|
436
|
+
trigger_id: string;
|
|
437
|
+
trigger_ref: string;
|
|
438
|
+
type: "webhook";
|
|
439
|
+
webhook: {
|
|
440
|
+
verification_method: WebhookTriggerVerificationMethod;
|
|
441
|
+
signature_header: string;
|
|
442
|
+
timestamp_header?: string;
|
|
443
|
+
tolerance_seconds?: number;
|
|
444
|
+
binding_policy: "per_instance";
|
|
445
|
+
endpoint_mode: "instance";
|
|
446
|
+
ack_mode: "platform_managed";
|
|
447
|
+
event_handler_module: string;
|
|
448
|
+
enable_handler_module: string;
|
|
449
|
+
disable_handler_module: string;
|
|
450
|
+
renew_handler_module?: string;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
type TriggerConnectionInfo = {
|
|
454
|
+
connectionId: string;
|
|
455
|
+
connectionRef: string;
|
|
456
|
+
integrationRef: string;
|
|
457
|
+
authType: "oauth2" | "oauth1" | "api_key" | "basic_auth" | "bearer" | "jwt" | "custom" | "two_step";
|
|
458
|
+
connectionConfig?: Record<string, unknown>;
|
|
459
|
+
};
|
|
460
|
+
type WebhookWatcherContext = {
|
|
461
|
+
artifactDigest: string;
|
|
462
|
+
triggerRef: string;
|
|
463
|
+
triggerName: string;
|
|
464
|
+
integrationRef: string;
|
|
465
|
+
inputs: Record<string, unknown>;
|
|
466
|
+
connection: TriggerConnectionInfo | null;
|
|
467
|
+
runtime: PackageWebhookTriggerRuntimeDescriptor;
|
|
468
|
+
stateScope: ContextStateScope;
|
|
469
|
+
watcher?: {
|
|
470
|
+
instanceId: string;
|
|
471
|
+
generation: number;
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
type WebhookDelivery = {
|
|
475
|
+
deliveryId: string;
|
|
476
|
+
receivedAt: string;
|
|
477
|
+
request: {
|
|
478
|
+
method: "POST";
|
|
479
|
+
headers: Record<string, string>;
|
|
480
|
+
rawBody: string;
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
type TriggerHandlerModule = {
|
|
484
|
+
specifier: string;
|
|
485
|
+
source: string;
|
|
486
|
+
};
|
|
487
|
+
type TriggerHandlerBundlesData = {
|
|
488
|
+
triggerRef: string;
|
|
489
|
+
artifactDigest: string;
|
|
490
|
+
modules: TriggerHandlerModule[];
|
|
491
|
+
runtimeNetwork: RuntimeNetwork;
|
|
492
|
+
};
|
|
493
|
+
type WebhookPublishEvent = {
|
|
494
|
+
eventId: string;
|
|
495
|
+
occurredAt: string;
|
|
496
|
+
dedupeKey?: string;
|
|
497
|
+
payload: Record<string, unknown>;
|
|
498
|
+
};
|
|
499
|
+
type WebhookPublishEventsBody = {
|
|
500
|
+
deliveryId: string;
|
|
501
|
+
events: WebhookPublishEvent[];
|
|
502
|
+
};
|
|
503
|
+
type WebhookPublishEventsData = {
|
|
504
|
+
deliveryId: string;
|
|
505
|
+
results: {
|
|
506
|
+
eventId: string;
|
|
507
|
+
flowRunId: string;
|
|
508
|
+
status: "dispatched" | "duplicate";
|
|
509
|
+
}[];
|
|
510
|
+
};
|
|
511
|
+
type WebhookRearmBody = {
|
|
512
|
+
expectedWatcherInstanceId: string;
|
|
513
|
+
};
|
|
514
|
+
type WebhookRearmData = {
|
|
515
|
+
rearmed: boolean;
|
|
516
|
+
};
|
|
517
|
+
type WebhookProtocolAdapterModule = {
|
|
518
|
+
specifier: string;
|
|
519
|
+
source: string;
|
|
520
|
+
};
|
|
521
|
+
declare const WEBHOOK_PROTOCOL_ADAPTER_MODULE = "modules/webhook/protocol-adapter.js";
|
|
522
|
+
type WebhookProtocolAdapterBundleData = {
|
|
523
|
+
protocolId: string;
|
|
524
|
+
artifactDigest: string;
|
|
525
|
+
module: typeof WEBHOOK_PROTOCOL_ADAPTER_MODULE;
|
|
526
|
+
modules: WebhookProtocolAdapterModule[];
|
|
527
|
+
};
|
|
528
|
+
declare function flowScriptProtocolAdapterModuleName(artifactDigest: string): string;
|
|
529
|
+
declare function parseWebhookWatcherContext(data: unknown): ContractParseResult<WebhookWatcherContext>;
|
|
530
|
+
declare function parseWebhookDelivery(data: unknown): ContractParseResult<WebhookDelivery>;
|
|
531
|
+
declare function parseTriggerHandlerBundlesData(data: unknown): HandlerBundlesParseResult<TriggerHandlerBundlesData>;
|
|
532
|
+
declare function parseWebhookPublishEventsBody(body: unknown): ContractParseResult<WebhookPublishEventsBody>;
|
|
533
|
+
declare function parseWebhookRearmBody(body: unknown): ContractParseResult<WebhookRearmBody>;
|
|
534
|
+
|
|
535
|
+
declare const INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX = "/internal/polling-trigger-instances";
|
|
536
|
+
declare const POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH = "/:pollingInstanceId/context";
|
|
537
|
+
declare const POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH = "/:pollingInstanceId/handler-bundles";
|
|
538
|
+
declare const POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH = "/:pollingInstanceId/ticks/:tickId/events";
|
|
539
|
+
declare function pollingTriggerContextPath(pollingInstanceId: string, artifactDigest: string, tickId: string): string;
|
|
540
|
+
declare function pollingTriggerHandlerBundlesPath(pollingInstanceId: string, artifactDigest: string): string;
|
|
541
|
+
declare function pollingTriggerTickEventsPath(pollingInstanceId: string, tickId: string): string;
|
|
542
|
+
type PackagePollingTriggerRuntimeDescriptor = {
|
|
543
|
+
trigger_id: string;
|
|
544
|
+
trigger_ref: string;
|
|
545
|
+
type: "polling";
|
|
546
|
+
polling: {
|
|
547
|
+
schedule: {
|
|
548
|
+
type: "interval";
|
|
549
|
+
every_seconds: number;
|
|
550
|
+
};
|
|
551
|
+
dedup: {
|
|
552
|
+
strategy: "cursor" | "hash" | "id_field";
|
|
553
|
+
cursor_field?: string;
|
|
554
|
+
id_field?: string;
|
|
555
|
+
};
|
|
556
|
+
run_handler_module: string;
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
type PollingTriggerContext = {
|
|
560
|
+
artifactDigest: string;
|
|
561
|
+
triggerRef: string;
|
|
562
|
+
triggerName: string;
|
|
563
|
+
integrationRef: string;
|
|
564
|
+
inputs: Record<string, unknown>;
|
|
565
|
+
connection: TriggerConnectionInfo | null;
|
|
566
|
+
runtime: PackagePollingTriggerRuntimeDescriptor;
|
|
567
|
+
stateScope: ContextStateScope;
|
|
568
|
+
tick: {
|
|
569
|
+
tickId: string;
|
|
570
|
+
scheduledAt: string;
|
|
571
|
+
attempt: number;
|
|
572
|
+
};
|
|
573
|
+
limits: {
|
|
574
|
+
maxEventsPerTick: number;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
type PollingPublishEvent = {
|
|
578
|
+
eventId: string;
|
|
579
|
+
occurredAt?: string;
|
|
580
|
+
dedupeKey?: string;
|
|
581
|
+
payload: Record<string, unknown>;
|
|
582
|
+
};
|
|
583
|
+
type PollingPublishBody = {
|
|
584
|
+
events: PollingPublishEvent[];
|
|
585
|
+
nextCursor?: string | null;
|
|
586
|
+
};
|
|
587
|
+
type PublishPollingTickEventResult = {
|
|
588
|
+
eventId: string;
|
|
589
|
+
dedupeKey: string;
|
|
590
|
+
duplicate: boolean;
|
|
591
|
+
flowRunId: string | null;
|
|
592
|
+
};
|
|
593
|
+
type PublishPollingTickEventsData = {
|
|
594
|
+
tickId: string;
|
|
595
|
+
cursorUpdated: boolean;
|
|
596
|
+
results: PublishPollingTickEventResult[];
|
|
597
|
+
};
|
|
598
|
+
declare function parsePollingTriggerContext(data: unknown): ContractParseResult<PollingTriggerContext>;
|
|
599
|
+
declare function parsePollingPublishBody(body: unknown): ContractParseResult<PollingPublishBody>;
|
|
600
|
+
declare function parsePublishPollingTickEventsData(data: unknown): ContractParseResult<PublishPollingTickEventsData>;
|
|
601
|
+
|
|
602
|
+
declare const INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX = "/internal/egress-grants";
|
|
603
|
+
declare const INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX = "/internal/tool-invocations";
|
|
604
|
+
declare const FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH = "/:flowRunId/egress-grant";
|
|
605
|
+
declare const TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH = "/:invocationId/egress-grant";
|
|
606
|
+
declare const POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH = "/:pollingInstanceId/egress-grant";
|
|
607
|
+
declare const WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH = "/:triggerInstanceId/egress-grant";
|
|
608
|
+
declare const EGRESS_GRANT_CONSUME_ROUTE_SUBPATH = "/:grantId/consume";
|
|
609
|
+
declare const EGRESS_GRANT_AUDIT_ROUTE_SUBPATH = "/:grantId/audit";
|
|
610
|
+
declare const flowRunEgressGrantPath: (flowRunId: string) => string;
|
|
611
|
+
declare const toolInvocationEgressGrantPath: (invocationId: string) => string;
|
|
612
|
+
declare const pollingTriggerEgressGrantPath: (pollingInstanceId: string) => string;
|
|
613
|
+
declare const webhookTriggerEgressGrantPath: (triggerInstanceId: string) => string;
|
|
614
|
+
declare const egressGrantConsumePath: (grantId: string) => string;
|
|
615
|
+
declare const egressGrantAuditPath: (grantId: string) => string;
|
|
616
|
+
declare const EGRESS_GRANT_SCOPE_KINDS: readonly ["flow_action", "single_tool", "polling_trigger", "webhook_trigger"];
|
|
617
|
+
type EgressGrantScopeKind = (typeof EGRESS_GRANT_SCOPE_KINDS)[number];
|
|
618
|
+
type EgressGrantFileRuntime = {
|
|
619
|
+
baseUrl: string;
|
|
620
|
+
token: string;
|
|
621
|
+
expiresAt: string;
|
|
622
|
+
limits: {
|
|
623
|
+
fileReadMaxBytes: number;
|
|
624
|
+
inlineMultipartBytesMax: number;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
type EgressGrant<TDescriptor = unknown> = {
|
|
628
|
+
grantId: string;
|
|
629
|
+
scopeKind: EgressGrantScopeKind;
|
|
630
|
+
scopeId: string;
|
|
631
|
+
workspaceId: string;
|
|
632
|
+
installationId: string;
|
|
633
|
+
connectionId: string | null;
|
|
634
|
+
artifactDigest: string;
|
|
635
|
+
descriptorHash: string;
|
|
636
|
+
requestDigest: string;
|
|
637
|
+
issuedAt: string;
|
|
638
|
+
expiresAt: string;
|
|
639
|
+
networkPolicy: unknown;
|
|
640
|
+
descriptor: TDescriptor;
|
|
641
|
+
connection: unknown | null;
|
|
642
|
+
credential: unknown | null;
|
|
643
|
+
fileRuntime?: EgressGrantFileRuntime;
|
|
644
|
+
signature: string;
|
|
645
|
+
};
|
|
646
|
+
type EgressGrantConsumeBody = {
|
|
647
|
+
scopeKind: EgressGrantScopeKind;
|
|
648
|
+
scopeId: string;
|
|
649
|
+
requestDigest: string;
|
|
650
|
+
};
|
|
651
|
+
type EgressGrantAuditBody = {
|
|
652
|
+
scopeKind: EgressGrantScopeKind;
|
|
653
|
+
scopeId: string;
|
|
654
|
+
providerHost: string;
|
|
655
|
+
status?: number;
|
|
656
|
+
durationMs: number;
|
|
657
|
+
requestBytes?: number;
|
|
658
|
+
responseBytes?: number;
|
|
659
|
+
errorCode?: string;
|
|
660
|
+
};
|
|
661
|
+
type FlowActionGrantBody = {
|
|
662
|
+
nodeId: string;
|
|
663
|
+
requestDigest: string;
|
|
664
|
+
requestHasMultipartFiles: boolean;
|
|
665
|
+
};
|
|
666
|
+
type SingleToolGrantBody = {
|
|
667
|
+
requestDigest: string;
|
|
668
|
+
};
|
|
669
|
+
type PollingTriggerGrantBody = {
|
|
670
|
+
tickId: string;
|
|
671
|
+
requestDigest: string;
|
|
672
|
+
};
|
|
673
|
+
type WebhookTriggerGrantBody = {
|
|
674
|
+
phase: "lifecycle" | "handler";
|
|
675
|
+
lifecycle?: "enable" | "disable" | "renew";
|
|
676
|
+
requestDigest: string;
|
|
677
|
+
};
|
|
678
|
+
declare function isValidRequestDigest(value: unknown): value is string;
|
|
679
|
+
declare function requestHasMultipartFileParts(request: unknown): boolean;
|
|
680
|
+
type EgressGrantBodyParseResult<T> = {
|
|
681
|
+
ok: true;
|
|
682
|
+
value: T;
|
|
683
|
+
} | {
|
|
684
|
+
ok: false;
|
|
685
|
+
kind: "shape" | "request_digest";
|
|
686
|
+
reason: string;
|
|
687
|
+
};
|
|
688
|
+
declare function parseFlowActionGrantBody(body: unknown): EgressGrantBodyParseResult<FlowActionGrantBody>;
|
|
689
|
+
declare function parseSingleToolGrantBody(body: unknown): EgressGrantBodyParseResult<SingleToolGrantBody>;
|
|
690
|
+
declare function parsePollingTriggerGrantBody(body: unknown): EgressGrantBodyParseResult<PollingTriggerGrantBody>;
|
|
691
|
+
declare function parseWebhookTriggerGrantBody(body: unknown): EgressGrantBodyParseResult<WebhookTriggerGrantBody>;
|
|
692
|
+
declare function parseEgressGrantConsumeBody(body: unknown): EgressGrantBodyParseResult<EgressGrantConsumeBody>;
|
|
693
|
+
declare function parseEgressGrantAuditBody(body: unknown): EgressGrantBodyParseResult<EgressGrantAuditBody>;
|
|
694
|
+
declare function parseEgressGrantData(data: unknown): ContractParseResult<EgressGrant<unknown>>;
|
|
695
|
+
declare function parseEgressGrantConsumeData(data: unknown): ContractParseResult<{
|
|
696
|
+
consumed: true;
|
|
697
|
+
}>;
|
|
698
|
+
|
|
699
|
+
declare const FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH = "/:flowRunId/runtime-credential";
|
|
700
|
+
declare const TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH = "/:invocationId/runtime-credential";
|
|
701
|
+
declare const POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH = "/:pollingInstanceId/runtime-credential";
|
|
702
|
+
declare const WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH = "/:triggerInstanceId/runtime-credential";
|
|
703
|
+
declare const flowRunRuntimeCredentialPath: (flowRunId: string) => string;
|
|
704
|
+
declare const toolInvocationRuntimeCredentialPath: (invocationId: string) => string;
|
|
705
|
+
declare const pollingTriggerRuntimeCredentialPath: (pollingInstanceId: string) => string;
|
|
706
|
+
declare const webhookTriggerRuntimeCredentialPath: (triggerInstanceId: string) => string;
|
|
707
|
+
declare const RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS: readonly ["flow_action", "tool_invoke", "polling_trigger", "webhook_trigger"];
|
|
708
|
+
type RuntimeCredentialSessionScopeKind = (typeof RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS)[number];
|
|
709
|
+
type RuntimeCredentialSessionNetwork = {
|
|
710
|
+
networkModel: "managed_plus_unmanaged_sdk";
|
|
711
|
+
apiHosts: string[];
|
|
712
|
+
authHosts: string[];
|
|
713
|
+
httpsOnly: true;
|
|
714
|
+
};
|
|
715
|
+
type RuntimeCredentialSession<TCredential = unknown> = {
|
|
716
|
+
sessionId: string;
|
|
717
|
+
scopeKind: RuntimeCredentialSessionScopeKind;
|
|
718
|
+
scopeId: string;
|
|
719
|
+
workspaceId: string;
|
|
720
|
+
installationId: string;
|
|
721
|
+
artifactDigest: string;
|
|
722
|
+
descriptorHash: string;
|
|
723
|
+
connectionId: string;
|
|
724
|
+
connectionRef: string;
|
|
725
|
+
authType: string;
|
|
726
|
+
credential: TCredential;
|
|
727
|
+
network: RuntimeCredentialSessionNetwork;
|
|
728
|
+
expiresAt: string;
|
|
729
|
+
};
|
|
730
|
+
type FlowRuntimeCredentialBody = {
|
|
731
|
+
nodeId: string;
|
|
732
|
+
};
|
|
733
|
+
type PollingRuntimeCredentialBody = {
|
|
734
|
+
tickId: string;
|
|
735
|
+
};
|
|
736
|
+
type WebhookRuntimeCredentialBody = {
|
|
737
|
+
executionKind: "event_handler" | "lifecycle";
|
|
738
|
+
deliveryId?: string;
|
|
739
|
+
lifecycleOperation?: "enable" | "disable" | "renew";
|
|
740
|
+
};
|
|
741
|
+
declare function parseFlowRuntimeCredentialBody(body: unknown): ContractParseResult<FlowRuntimeCredentialBody>;
|
|
742
|
+
declare function parseSingleToolRuntimeCredentialBody(body: unknown): ContractParseResult<null>;
|
|
743
|
+
declare function parsePollingRuntimeCredentialBody(body: unknown): ContractParseResult<PollingRuntimeCredentialBody>;
|
|
744
|
+
declare function parseWebhookRuntimeCredentialBody(body: unknown): ContractParseResult<WebhookRuntimeCredentialBody>;
|
|
745
|
+
declare function parseRuntimeCredentialSessionCredential(data: unknown): ContractParseResult<Record<string, unknown>>;
|
|
746
|
+
|
|
747
|
+
declare const INTERNAL_FILES_ROUTE_PREFIX = "/internal/files";
|
|
748
|
+
declare const FILE_STAT_ROUTE_SUBPATH = "/:fileId/stat";
|
|
749
|
+
declare const FILE_CONTENT_ROUTE_SUBPATH = "/:fileId/content";
|
|
750
|
+
type FileRuntimeScopeKind = "flow_run" | "tool_invocation";
|
|
751
|
+
type FileRuntimeScope = {
|
|
752
|
+
scopeKind: FileRuntimeScopeKind;
|
|
753
|
+
scopeId: string;
|
|
754
|
+
};
|
|
755
|
+
type FileRefData = {
|
|
756
|
+
file_id: string;
|
|
757
|
+
name: string;
|
|
758
|
+
mime_type?: string;
|
|
759
|
+
size_bytes: number;
|
|
760
|
+
created_at: string;
|
|
761
|
+
expires_at: string;
|
|
762
|
+
sha256?: string;
|
|
763
|
+
source?: string;
|
|
764
|
+
};
|
|
765
|
+
declare const internalFilesPath: () => string;
|
|
766
|
+
declare const internalFileStatPath: (fileId: string, scope: FileRuntimeScope) => string;
|
|
767
|
+
declare const internalFileContentPath: (fileId: string, scope: FileRuntimeScope) => string;
|
|
768
|
+
declare function parseFileRefData(data: unknown): ContractParseResult<FileRefData>;
|
|
769
|
+
|
|
770
|
+
declare const HUMAN_INPUTS_ROUTE_SUBPATH = "/:flowRunId/human-inputs";
|
|
771
|
+
declare const HUMAN_INPUT_REQUEST_ROUTE_SUBPATH = "/:flowRunId/human-inputs/:requestId";
|
|
772
|
+
declare const HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH = "/:flowRunId/human-inputs/:requestId/expire";
|
|
773
|
+
declare const HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH = "/:flowRunId/human-inputs/:requestId/acknowledge";
|
|
774
|
+
declare const humanInputsPath: (flowRunId: string) => string;
|
|
775
|
+
declare const humanInputRequestPath: (flowRunId: string, requestId: string) => string;
|
|
776
|
+
declare const humanInputExpirePath: (flowRunId: string, requestId: string) => string;
|
|
777
|
+
declare const humanInputAcknowledgePath: (flowRunId: string, requestId: string) => string;
|
|
778
|
+
declare const HUMAN_INPUT_RESOLVED_EVENT_PREFIX = "human_input_resolved";
|
|
779
|
+
declare function humanInputResolvedEventType(requestId: string): string;
|
|
780
|
+
type HumanInputResolvedEvent = {
|
|
781
|
+
requestId: string;
|
|
782
|
+
flowRunId: string;
|
|
783
|
+
nodeId: string;
|
|
784
|
+
status: "submitted" | "expired";
|
|
785
|
+
};
|
|
786
|
+
type RenderedHumanInputPrompt = {
|
|
787
|
+
title: string;
|
|
788
|
+
body?: string;
|
|
789
|
+
format?: "plain" | "markdown";
|
|
790
|
+
};
|
|
791
|
+
type PartiallyRenderedValue = {
|
|
792
|
+
kind: "literal";
|
|
793
|
+
value: unknown;
|
|
794
|
+
} | {
|
|
795
|
+
kind: "array";
|
|
796
|
+
items: PartiallyRenderedValue[];
|
|
797
|
+
} | {
|
|
798
|
+
kind: "object";
|
|
799
|
+
entries: Record<string, PartiallyRenderedValue>;
|
|
800
|
+
} | {
|
|
801
|
+
kind: "human_input_ref";
|
|
802
|
+
path: string;
|
|
803
|
+
} | {
|
|
804
|
+
kind: "template";
|
|
805
|
+
parts: PartiallyRenderedTemplatePart[];
|
|
806
|
+
};
|
|
807
|
+
type PartiallyRenderedTemplatePart = {
|
|
808
|
+
kind: "literal";
|
|
809
|
+
value: string;
|
|
810
|
+
} | {
|
|
811
|
+
kind: "human_input_ref";
|
|
812
|
+
path: string;
|
|
813
|
+
};
|
|
814
|
+
type PartiallyRenderedMapping = Record<string, PartiallyRenderedValue>;
|
|
815
|
+
type PartiallyRenderedHumanInputDelivery = {
|
|
816
|
+
actions?: Array<{
|
|
817
|
+
id: string;
|
|
818
|
+
inputs: PartiallyRenderedMapping;
|
|
819
|
+
}>;
|
|
820
|
+
};
|
|
821
|
+
type CreateHumanInputRequestBody = {
|
|
822
|
+
nodeId: string;
|
|
823
|
+
renderedPrompt: RenderedHumanInputPrompt;
|
|
824
|
+
input: HumanInputSpec;
|
|
825
|
+
partiallyRenderedDelivery?: PartiallyRenderedHumanInputDelivery;
|
|
826
|
+
timeout: string;
|
|
827
|
+
expiresAt: string;
|
|
828
|
+
};
|
|
829
|
+
type HumanInputResponse = {
|
|
830
|
+
kind: "choice";
|
|
831
|
+
choiceId: string;
|
|
832
|
+
comment?: string;
|
|
833
|
+
} | {
|
|
834
|
+
kind: "text";
|
|
835
|
+
text: string;
|
|
836
|
+
} | {
|
|
837
|
+
kind: "form";
|
|
838
|
+
values: Record<string, unknown>;
|
|
839
|
+
};
|
|
840
|
+
type HumanInputActor = {
|
|
841
|
+
type: "user";
|
|
842
|
+
userId: string;
|
|
843
|
+
} | {
|
|
844
|
+
type: "api_key";
|
|
845
|
+
apiKeyId: string;
|
|
846
|
+
} | {
|
|
847
|
+
type: "anonymous";
|
|
848
|
+
} | {
|
|
849
|
+
type: "provider";
|
|
850
|
+
provider: string;
|
|
851
|
+
providerActorId?: string;
|
|
852
|
+
} | {
|
|
853
|
+
type: "system";
|
|
854
|
+
};
|
|
855
|
+
type HumanInputOutput = {
|
|
856
|
+
status: "submitted";
|
|
857
|
+
response: HumanInputResponse;
|
|
858
|
+
actor: Exclude<HumanInputActor, {
|
|
859
|
+
type: "system";
|
|
860
|
+
}>;
|
|
861
|
+
submissionSource: string;
|
|
862
|
+
submittedAt: string;
|
|
863
|
+
} | {
|
|
864
|
+
status: "expired";
|
|
865
|
+
actor: {
|
|
866
|
+
type: "system";
|
|
867
|
+
};
|
|
868
|
+
expiredAt: string;
|
|
869
|
+
};
|
|
870
|
+
type HumanInputRequestView = {
|
|
871
|
+
id: string;
|
|
872
|
+
workspaceId: string;
|
|
873
|
+
flowRunId: string;
|
|
874
|
+
nodeId: string;
|
|
875
|
+
status: "pending" | "submitted" | "expired" | "cancelled";
|
|
876
|
+
inputKind: string;
|
|
877
|
+
timeout: string;
|
|
878
|
+
expiresAt: string;
|
|
879
|
+
createdAt: string;
|
|
880
|
+
updatedAt: string;
|
|
881
|
+
output: HumanInputOutput | null;
|
|
882
|
+
};
|
|
883
|
+
declare function parseCreateHumanInputBody(body: unknown): ContractParseResult<CreateHumanInputRequestBody>;
|
|
884
|
+
declare function parseHumanInputRequestViewData(data: unknown): ContractParseResult<HumanInputRequestView>;
|
|
885
|
+
declare function parseHumanInputCreateData(data: unknown): ContractParseResult<{
|
|
886
|
+
created: boolean;
|
|
887
|
+
request: HumanInputRequestView;
|
|
888
|
+
}>;
|
|
889
|
+
declare function parseHumanInputAcknowledgeData(data: unknown): ContractParseResult<{
|
|
890
|
+
acknowledged: true;
|
|
891
|
+
}>;
|
|
892
|
+
|
|
893
|
+
declare const WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION = "ablehi-wfp-user-runtime-manifest/v1";
|
|
894
|
+
type WfpUserRuntimeManifest = {
|
|
895
|
+
formatVersion: typeof WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION;
|
|
896
|
+
runtimeContractVersion: string;
|
|
897
|
+
sha256: string;
|
|
898
|
+
sourceRevision: string;
|
|
899
|
+
};
|
|
900
|
+
declare const WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION = "unknown";
|
|
901
|
+
declare function wfpUserRuntimeManifestPath(bundlePath: string): string;
|
|
902
|
+
|
|
903
|
+
declare const DEPLOYMENT_HANDSHAKE_ROUTE = "/internal/deployment-handshake";
|
|
904
|
+
type DeploymentHandshakeRequestBody = {
|
|
905
|
+
nonce: string;
|
|
906
|
+
timestamp: string;
|
|
907
|
+
contractVersion: string;
|
|
908
|
+
dispatchNamespace: string;
|
|
909
|
+
probe: string;
|
|
910
|
+
};
|
|
911
|
+
type DeploymentHandshakeData = {
|
|
912
|
+
nonce: string;
|
|
913
|
+
contractVersion: string;
|
|
914
|
+
dispatchNamespace: string;
|
|
915
|
+
capabilities: string[];
|
|
916
|
+
proof: string;
|
|
917
|
+
};
|
|
918
|
+
type DeploymentHandshakeResponse = {
|
|
919
|
+
ok: true;
|
|
920
|
+
data: DeploymentHandshakeData;
|
|
921
|
+
} | {
|
|
922
|
+
ok: false;
|
|
923
|
+
error: {
|
|
924
|
+
code: string;
|
|
925
|
+
message: string;
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
declare const DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES: readonly ["start", "terminate", "send-event", "start-webhook-watcher", "run-polling-tick", "invoke-tool", "invoke-trigger-handler", "invoke-webhook-protocol-adapter", "deployment-handshake"];
|
|
929
|
+
declare const DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES: readonly ["start", "terminate", "send-event", "start-webhook-watcher", "run-polling-tick", "invoke-tool", "invoke-trigger-handler", "invoke-webhook-protocol-adapter", "deployment-handshake"];
|
|
930
|
+
declare const HANDSHAKE_REQUEST_INVALID = "HANDSHAKE_REQUEST_INVALID";
|
|
931
|
+
declare const HANDSHAKE_SECRET_UNCONFIGURED = "HANDSHAKE_SECRET_UNCONFIGURED";
|
|
932
|
+
declare const HANDSHAKE_SECRET_MISMATCH = "HANDSHAKE_SECRET_MISMATCH";
|
|
933
|
+
declare const HANDSHAKE_CONTRACT_VERSION_MISMATCH = "HANDSHAKE_CONTRACT_VERSION_MISMATCH";
|
|
934
|
+
declare const HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH = "HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH";
|
|
935
|
+
declare const HANDSHAKE_CAPABILITY_MISSING = "HANDSHAKE_CAPABILITY_MISSING";
|
|
936
|
+
declare function deploymentHandshakeProbePayload(input: {
|
|
937
|
+
nonce: string;
|
|
938
|
+
timestamp: string;
|
|
939
|
+
contractVersion: string;
|
|
940
|
+
dispatchNamespace: string;
|
|
941
|
+
}): string;
|
|
942
|
+
declare function deploymentHandshakeResponseProofPayload(input: {
|
|
943
|
+
nonce: string;
|
|
944
|
+
contractVersion: string;
|
|
945
|
+
dispatchNamespace: string;
|
|
946
|
+
capabilities: string[];
|
|
947
|
+
}): string;
|
|
948
|
+
|
|
949
|
+
export { type FlowActionGrantBody as $, type AblehiEnvelope as A, type BooleanExpression as B, CONTEXT_STATE_CLEANUP_ROUTE_PATH as C, DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES as D, EGRESS_GRANT_AUDIT_ROUTE_SUBPATH as E, type FlowNode as F, type EgressGrantConsumeBody as G, type EgressGrantFileRuntime as H, type EgressGrantScopeKind as I, type JsonValue as J, type ExecutionBinding as K, type ExecutionBindingConnection as L, type Mapping as M, type ExecutionContextCompiled as N, type ExecutionContextData as O, FILE_CONTENT_ROUTE_SUBPATH as P, FILE_STAT_ROUTE_SUBPATH as Q, FLOW_INTERPRETER_CONTRACT_VERSION as R, FLOW_IR_SCHEMA_VERSION as S, type TriggerBinding as T, FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH as U, FLOW_RUN_RESULT_ROUTE_SUBPATH as V, FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as W, type FileRefData as X, type FileRuntimeLimits as Y, type FileRuntimeScope as Z, type FileRuntimeScopeKind as _, type FlowIrValidationResult as a, type PartiallyRenderedValue as a$, type FlowDefinition as a0, type FlowExecutionContextFileRuntime as a1, type FlowInterpreterContractVersion as a2, type FlowIrValidationCode as a3, type FlowIrValidationIssue as a4, type FlowRunResultData as a5, type FlowRunResultRequestBody as a6, type FlowRuntimeCredentialBody as a7, HANDLER_BUNDLES_ROUTE_SUBPATH as a8, HANDSHAKE_CAPABILITY_MISSING as a9, type HumanInputResponse as aA, type HumanInputSpec as aB, type HumanTextInput as aC, INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX as aD, INTERNAL_FILES_ROUTE_PREFIX as aE, INTERNAL_FLOW_RUNS_ROUTE_PREFIX as aF, INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX as aG, INTERNAL_INSTALLATIONS_ROUTE_PREFIX as aH, INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX as aI, INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX as aJ, INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX as aK, type IntegrationTriggerBinding as aL, type JsonArray as aM, type ManualTriggerBinding as aN, type NodeCommon as aO, type Operand as aP, POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH as aQ, POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH as aR, POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH as aS, POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as aT, POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH as aU, type PackagePollingTriggerRuntimeDescriptor as aV, type PackageWebhookTriggerRuntimeDescriptor as aW, type ParsedFlowRunResultBody as aX, type PartiallyRenderedHumanInputDelivery as aY, type PartiallyRenderedMapping as aZ, type PartiallyRenderedTemplatePart as a_, HANDSHAKE_CONTRACT_VERSION_MISMATCH as aa, HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH as ab, HANDSHAKE_REQUEST_INVALID as ac, HANDSHAKE_SECRET_MISMATCH as ad, HANDSHAKE_SECRET_UNCONFIGURED as ae, HUMAN_INPUTS_ROUTE_SUBPATH as af, HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH as ag, HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH as ah, HUMAN_INPUT_REQUEST_ROUTE_SUBPATH as ai, HUMAN_INPUT_RESOLVED_EVENT_PREFIX as aj, type HandlerBundle as ak, type HandlerBundleModule as al, type HandlerBundlesData as am, type HandlerBundlesParseResult as an, type HumanChoiceInput as ao, type HumanFormField as ap, type HumanFormInput as aq, type HumanInputActor as ar, type HumanInputChoice as as, type HumanInputDelivery as at, type HumanInputDeliveryAction as au, type HumanInputNode as av, type HumanInputOutput as aw, type HumanInputPrompt as ax, type HumanInputRequestView as ay, type HumanInputResolvedEvent as az, type JsonObject as b, deploymentHandshakeProbePayload as b$, type PollingPublishBody as b0, type PollingPublishEvent as b1, type PollingRuntimeCredentialBody as b2, type PollingTriggerContext as b3, type PollingTriggerGrantBody as b4, type PublishPollingTickEventResult as b5, type PublishPollingTickEventsData as b6, RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS as b7, type RegisterFlowRunWaitBody as b8, type RegisterFlowRunWaitData as b9, WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH as bA, WEBHOOK_PROTOCOL_ADAPTER_MODULE as bB, WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH as bC, WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH as bD, WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH as bE, WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH as bF, WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH as bG, WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH as bH, WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as bI, WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION as bJ, WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION as bK, type WaitEventNode as bL, type WebhookDelivery as bM, type WebhookProtocolAdapterBundleData as bN, type WebhookProtocolAdapterModule as bO, type WebhookPublishEvent as bP, type WebhookPublishEventsBody as bQ, type WebhookPublishEventsData as bR, type WebhookRearmBody as bS, type WebhookRearmData as bT, type WebhookRuntimeCredentialBody as bU, type WebhookTriggerGrantBody as bV, type WebhookTriggerVerificationMethod as bW, type WebhookWatcherContext as bX, type WfpUserRuntimeManifest as bY, contractParseFail as bZ, contractParseOk as b_, type RenderedFlowComposition as ba, type RenderedHumanInputPrompt as bb, type RuntimeCredentialSession as bc, type RuntimeCredentialSessionNetwork as bd, type RuntimeCredentialSessionScopeKind as be, type RuntimeNetwork as bf, type RuntimeNetworkModel as bg, SERVER_CONTRACT_VERSION as bh, STEP_RESULT_ROUTE_SUBPATH as bi, type ScheduleTriggerBinding as bj, type ServerContractVersion as bk, type SingleToolGrantBody as bl, type SleepNode as bm, type StepRecordBody as bn, type StepRecordBodyParseResult as bo, type StepRecordData as bp, type StepRecordResult as bq, TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH as br, TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH as bs, TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as bt, type TextExpression as bu, type ToolHandlerBundlesData as bv, type TriggerConnectionInfo as bw, type TriggerHandlerBundlesData as bx, type TriggerHandlerModule as by, type ValueExpression as bz, type FlowCompositionSpec as c, pollingTriggerEgressGrantPath as c$, deploymentHandshakeResponseProofPayload as c0, egressGrantAuditPath as c1, egressGrantConsumePath as c2, eventWaitPath as c3, executionContextPath as c4, flowRunEgressGrantPath as c5, flowRunResultPath as c6, flowRunRuntimeCredentialPath as c7, flowScriptProtocolAdapterModuleName as c8, handlerBundlesPath as c9, parseHandlerBundle as cA, parseHandlerBundlesData as cB, parseHumanInputAcknowledgeData as cC, parseHumanInputCreateData as cD, parseHumanInputRequestViewData as cE, parsePollingPublishBody as cF, parsePollingRuntimeCredentialBody as cG, parsePollingTriggerContext as cH, parsePollingTriggerGrantBody as cI, parsePublishPollingTickEventsData as cJ, parseRegisterFlowRunWaitBody as cK, parseRegisterFlowRunWaitData as cL, parseRuntimeCredentialSessionCredential as cM, parseRuntimeNetwork as cN, parseSingleToolGrantBody as cO, parseSingleToolRuntimeCredentialBody as cP, parseStepRecordBody as cQ, parseStepRecordData as cR, parseToolHandlerBundlesData as cS, parseTriggerHandlerBundlesData as cT, parseWebhookDelivery as cU, parseWebhookPublishEventsBody as cV, parseWebhookRearmBody as cW, parseWebhookRuntimeCredentialBody as cX, parseWebhookTriggerGrantBody as cY, parseWebhookWatcherContext as cZ, pollingTriggerContextPath as c_, humanInputAcknowledgePath as ca, humanInputExpirePath as cb, humanInputRequestPath as cc, humanInputResolvedEventType as cd, humanInputsPath as ce, internalFileContentPath as cf, internalFileStatPath as cg, internalFilesPath as ch, isJsonRecord as ci, isValidRequestDigest as cj, parseCompleteFlowRunWaitBody as ck, parseContextStateCleanupRequestBody as cl, parseContextStateCleanupResponseData as cm, parseContextStateScope as cn, parseCreateHumanInputBody as co, parseEgressGrantAuditBody as cp, parseEgressGrantConsumeBody as cq, parseEgressGrantConsumeData as cr, parseEgressGrantData as cs, parseExecutionContextData as ct, parseFileRefData as cu, parseFileRuntimeLimits as cv, parseFlowActionGrantBody as cw, parseFlowRunResultBody as cx, parseFlowRunResultData as cy, parseFlowRuntimeCredentialBody as cz, type AblehiFailure as d, pollingTriggerHandlerBundlesPath as d0, pollingTriggerRuntimeCredentialPath as d1, pollingTriggerTickEventsPath as d2, requestHasMultipartFileParts as d3, stepResultPath as d4, toolHandlerBundlesPath as d5, toolInvocationEgressGrantPath as d6, toolInvocationRuntimeCredentialPath as d7, webhookProtocolAdapterBundlePath as d8, webhookTriggerContextPath as d9, webhookTriggerDeliveryPath as da, webhookTriggerEgressGrantPath as db, webhookTriggerEventsPath as dc, webhookTriggerHandlerBundlesPath as dd, webhookTriggerRearmPath as de, webhookTriggerRuntimeCredentialPath as df, wfpUserRuntimeManifestPath as dg, type AblehiSuccess as e, type ActionNode as f, type Collection as g, type CompleteFlowRunWaitBody as h, type CompleteFlowRunWaitData as i, type ContextStateCleanupRequestBody as j, type ContextStateCleanupResponseData as k, type ContextStateScope as l, type ContractParseResult as m, type CreateHumanInputRequestBody as n, DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES as o, DEPLOYMENT_HANDSHAKE_ROUTE as p, type DeploymentHandshakeData as q, type DeploymentHandshakeRequestBody as r, type DeploymentHandshakeResponse as s, EGRESS_GRANT_CONSUME_ROUTE_SUBPATH as t, EGRESS_GRANT_SCOPE_KINDS as u, EVENT_WAIT_ROUTE_SUBPATH as v, EXECUTION_CONTEXT_ROUTE_SUBPATH as w, type EgressGrant as x, type EgressGrantAuditBody as y, type EgressGrantBodyParseResult as z };
|