@xyne/workflow-sdk 3.2.53 → 3.2.55
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/agents/host-agent-step.d.ts.map +1 -1
- package/dist/agents/host-agent-step.js +3 -0
- package/dist/agents/host-agent-step.js.map +1 -1
- package/dist/builder/index.d.ts +19 -2
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +17 -1
- package/dist/builder/index.js.map +1 -1
- package/dist/common/attachment.d.ts +9 -0
- package/dist/common/attachment.d.ts.map +1 -1
- package/dist/common/attachment.js +20 -0
- package/dist/common/attachment.js.map +1 -1
- package/dist/common/citation-ref.d.ts +4 -4
- package/dist/completion/address.d.ts +27 -0
- package/dist/completion/address.d.ts.map +1 -0
- package/dist/completion/address.js +62 -0
- package/dist/completion/address.js.map +1 -0
- package/dist/completion/attach.d.ts +32 -0
- package/dist/completion/attach.d.ts.map +1 -0
- package/dist/completion/attach.js +92 -0
- package/dist/completion/attach.js.map +1 -0
- package/dist/completion/index.d.ts +6 -0
- package/dist/completion/index.d.ts.map +1 -0
- package/dist/completion/index.js +4 -0
- package/dist/completion/index.js.map +1 -0
- package/dist/completion/types.d.ts +107 -0
- package/dist/completion/types.d.ts.map +1 -0
- package/dist/completion/types.js +35 -0
- package/dist/completion/types.js.map +1 -0
- package/dist/connectors/builtin/builtin-connector.d.ts.map +1 -1
- package/dist/connectors/builtin/builtin-connector.js +6 -2
- package/dist/connectors/builtin/builtin-connector.js.map +1 -1
- package/dist/connectors/builtin/steps/compute.step.d.ts +56 -0
- package/dist/connectors/builtin/steps/compute.step.d.ts.map +1 -0
- package/dist/connectors/builtin/steps/compute.step.js +48 -0
- package/dist/connectors/builtin/steps/compute.step.js.map +1 -0
- package/dist/connectors/builtin/steps/conditional.step.d.ts +2 -2
- package/dist/connectors/builtin/steps/conditional.step.js +1 -1
- package/dist/connectors/builtin/steps/conditional.step.js.map +1 -1
- package/dist/connectors/builtin/steps/cycle.step.d.ts +36 -7
- package/dist/connectors/builtin/steps/cycle.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/cycle.step.js +89 -8
- package/dist/connectors/builtin/steps/cycle.step.js.map +1 -1
- package/dist/connectors/builtin/steps/dedup.step.js +2 -2
- package/dist/connectors/builtin/steps/dedup.step.js.map +1 -1
- package/dist/connectors/builtin/steps/delay.step.d.ts +49 -0
- package/dist/connectors/builtin/steps/delay.step.d.ts.map +1 -0
- package/dist/connectors/builtin/steps/delay.step.js +40 -0
- package/dist/connectors/builtin/steps/delay.step.js.map +1 -0
- package/dist/connectors/builtin/steps/loop.step.d.ts +6 -6
- package/dist/connectors/builtin/steps/loop.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/loop.step.js +4 -2
- package/dist/connectors/builtin/steps/loop.step.js.map +1 -1
- package/dist/connectors/builtin/steps/map.step.d.ts +4 -4
- package/dist/connectors/builtin/steps/map.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/map.step.js +13 -4
- package/dist/connectors/builtin/steps/map.step.js.map +1 -1
- package/dist/connectors/builtin/steps/parallel.step.d.ts +2 -2
- package/dist/connectors/builtin/steps/parallel.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/parallel.step.js +9 -2
- package/dist/connectors/builtin/steps/parallel.step.js.map +1 -1
- package/dist/connectors/builtin/steps/switch.step.js +1 -1
- package/dist/connectors/builtin/steps/switch.step.js.map +1 -1
- package/dist/connectors/builtin/steps/wait-for-api-call.step.d.ts +80 -0
- package/dist/connectors/builtin/steps/wait-for-api-call.step.d.ts.map +1 -0
- package/dist/connectors/builtin/steps/wait-for-api-call.step.js +104 -0
- package/dist/connectors/builtin/steps/wait-for-api-call.step.js.map +1 -0
- package/dist/connectors/builtin/steps/wait-for-human.step.d.ts +1057 -0
- package/dist/connectors/builtin/steps/wait-for-human.step.d.ts.map +1 -0
- package/dist/connectors/builtin/steps/wait-for-human.step.js +222 -0
- package/dist/connectors/builtin/steps/wait-for-human.step.js.map +1 -0
- package/dist/connectors/builtin/steps/wait-for-webhook.step.d.ts +80 -0
- package/dist/connectors/builtin/steps/wait-for-webhook.step.d.ts.map +1 -0
- package/dist/connectors/builtin/steps/wait-for-webhook.step.js +104 -0
- package/dist/connectors/builtin/steps/wait-for-webhook.step.js.map +1 -0
- package/dist/connectors/builtin/steps/wait.step.d.ts +40 -59
- package/dist/connectors/builtin/steps/wait.step.d.ts.map +1 -1
- package/dist/connectors/builtin/steps/wait.step.js +29 -63
- package/dist/connectors/builtin/steps/wait.step.js.map +1 -1
- package/dist/conversational-flow/calls.d.ts +2 -2
- package/dist/conversational-flow/calls.d.ts.map +1 -1
- package/dist/conversational-flow/calls.js +40 -5
- package/dist/conversational-flow/calls.js.map +1 -1
- package/dist/conversational-flow/create.d.ts +2 -1
- package/dist/conversational-flow/create.d.ts.map +1 -1
- package/dist/conversational-flow/create.js +2 -2
- package/dist/conversational-flow/create.js.map +1 -1
- package/dist/conversational-flow/edit/build.js +1 -1
- package/dist/conversational-flow/edit/build.js.map +1 -1
- package/dist/conversational-flow/edit/calls.d.ts.map +1 -1
- package/dist/conversational-flow/edit/calls.js +8 -5
- package/dist/conversational-flow/edit/calls.js.map +1 -1
- package/dist/conversational-flow/edit/endings.d.ts +8 -3
- package/dist/conversational-flow/edit/endings.d.ts.map +1 -1
- package/dist/conversational-flow/edit/endings.js +17 -9
- package/dist/conversational-flow/edit/endings.js.map +1 -1
- package/dist/conversational-flow/edit/questions.d.ts +35 -0
- package/dist/conversational-flow/edit/questions.d.ts.map +1 -0
- package/dist/conversational-flow/edit/questions.js +188 -0
- package/dist/conversational-flow/edit/questions.js.map +1 -0
- package/dist/conversational-flow/edit/versions.d.ts.map +1 -1
- package/dist/conversational-flow/edit/versions.js +6 -7
- package/dist/conversational-flow/edit/versions.js.map +1 -1
- package/dist/conversational-flow/index.d.ts +2 -1
- package/dist/conversational-flow/index.d.ts.map +1 -1
- package/dist/conversational-flow/index.js +4 -0
- package/dist/conversational-flow/index.js.map +1 -1
- package/dist/conversational-flow/questions.d.ts +32 -0
- package/dist/conversational-flow/questions.d.ts.map +1 -0
- package/dist/conversational-flow/questions.js +122 -0
- package/dist/conversational-flow/questions.js.map +1 -0
- package/dist/conversational-flow/read.d.ts.map +1 -1
- package/dist/conversational-flow/read.js +20 -4
- package/dist/conversational-flow/read.js.map +1 -1
- package/dist/conversational-flow/settle.js +4 -7
- package/dist/conversational-flow/settle.js.map +1 -1
- package/dist/conversational-flow/types.d.ts +31 -8
- package/dist/conversational-flow/types.d.ts.map +1 -1
- package/dist/conversational-flow/types.js.map +1 -1
- package/dist/engine/condition-evaluator.d.ts +10 -2
- package/dist/engine/condition-evaluator.d.ts.map +1 -1
- package/dist/engine/condition-evaluator.js +36 -14
- package/dist/engine/condition-evaluator.js.map +1 -1
- package/dist/engine/config-validator.d.ts +64 -0
- package/dist/engine/config-validator.d.ts.map +1 -1
- package/dist/engine/config-validator.js +400 -30
- package/dist/engine/config-validator.js.map +1 -1
- package/dist/engine/pause-step.d.ts +21 -4
- package/dist/engine/pause-step.d.ts.map +1 -1
- package/dist/engine/pause-step.js +11 -2
- package/dist/engine/pause-step.js.map +1 -1
- package/dist/engine/read-config.d.ts +12 -0
- package/dist/engine/read-config.d.ts.map +1 -0
- package/dist/engine/read-config.js +50 -0
- package/dist/engine/read-config.js.map +1 -0
- package/dist/engine/resolve-expressions.d.ts +40 -0
- package/dist/engine/resolve-expressions.d.ts.map +1 -0
- package/dist/engine/resolve-expressions.js +186 -0
- package/dist/engine/resolve-expressions.js.map +1 -0
- package/dist/engine/variable-resolver.d.ts +27 -0
- package/dist/engine/variable-resolver.d.ts.map +1 -1
- package/dist/engine/variable-resolver.js +20 -3
- package/dist/engine/variable-resolver.js.map +1 -1
- package/dist/engine/workflow-executor.d.ts.map +1 -1
- package/dist/engine/workflow-executor.js +66 -56
- package/dist/engine/workflow-executor.js.map +1 -1
- package/dist/expression/catalogue.d.ts +36 -0
- package/dist/expression/catalogue.d.ts.map +1 -0
- package/dist/expression/catalogue.js +82 -0
- package/dist/expression/catalogue.js.map +1 -0
- package/dist/expression/form/model.d.ts +115 -0
- package/dist/expression/form/model.d.ts.map +1 -0
- package/dist/expression/form/model.js +61 -0
- package/dist/expression/form/model.js.map +1 -0
- package/dist/expression/form/read.d.ts +4 -0
- package/dist/expression/form/read.d.ts.map +1 -0
- package/dist/expression/form/read.js +283 -0
- package/dist/expression/form/read.js.map +1 -0
- package/dist/expression/form/write.d.ts +8 -0
- package/dist/expression/form/write.d.ts.map +1 -0
- package/dist/expression/form/write.js +124 -0
- package/dist/expression/form/write.js.map +1 -0
- package/dist/expression/format.d.ts +41 -0
- package/dist/expression/format.d.ts.map +1 -0
- package/dist/expression/format.js +84 -0
- package/dist/expression/format.js.map +1 -0
- package/dist/expression/index.d.ts +40 -0
- package/dist/expression/index.d.ts.map +1 -0
- package/dist/expression/index.js +35 -0
- package/dist/expression/index.js.map +1 -0
- package/dist/expression/infer.d.ts +40 -0
- package/dist/expression/infer.d.ts.map +1 -0
- package/dist/expression/infer.js +195 -0
- package/dist/expression/infer.js.map +1 -0
- package/dist/expression/parse.d.ts +60 -0
- package/dist/expression/parse.d.ts.map +1 -0
- package/dist/expression/parse.js +201 -0
- package/dist/expression/parse.js.map +1 -0
- package/dist/expression/signature.d.ts +41 -0
- package/dist/expression/signature.d.ts.map +1 -0
- package/dist/expression/signature.js +124 -0
- package/dist/expression/signature.js.map +1 -0
- package/dist/expression/signatures.d.ts +45 -0
- package/dist/expression/signatures.d.ts.map +1 -0
- package/dist/expression/signatures.js +113 -0
- package/dist/expression/signatures.js.map +1 -0
- package/dist/expression/types.d.ts +71 -0
- package/dist/expression/types.d.ts.map +1 -0
- package/dist/expression/types.js +139 -0
- package/dist/expression/types.js.map +1 -0
- package/dist/index.d.ts +32 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -3
- package/dist/index.js.map +1 -1
- package/dist/ingest/filter.d.ts +8 -2
- package/dist/ingest/filter.d.ts.map +1 -1
- package/dist/ingest/filter.js +8 -2
- package/dist/ingest/filter.js.map +1 -1
- package/dist/ingest/start-policy.d.ts +1 -1
- package/dist/ingest/start-policy.d.ts.map +1 -1
- package/dist/ingest/start-policy.js +12 -5
- package/dist/ingest/start-policy.js.map +1 -1
- package/dist/persistence/in-memory-adapter.d.ts +3 -18
- package/dist/persistence/in-memory-adapter.d.ts.map +1 -1
- package/dist/persistence/in-memory-adapter.js +9 -61
- package/dist/persistence/in-memory-adapter.js.map +1 -1
- package/dist/persistence/types.d.ts +29 -58
- package/dist/persistence/types.d.ts.map +1 -1
- package/dist/router/workflow-router.d.ts.map +1 -1
- package/dist/router/workflow-router.js +70 -28
- package/dist/router/workflow-router.js.map +1 -1
- package/dist/runtime/workflow-runtime.d.ts +22 -45
- package/dist/runtime/workflow-runtime.d.ts.map +1 -1
- package/dist/runtime/workflow-runtime.js +157 -125
- package/dist/runtime/workflow-runtime.js.map +1 -1
- package/dist/steps/base-step.d.ts +2 -4
- package/dist/steps/base-step.d.ts.map +1 -1
- package/dist/steps/base-step.js.map +1 -1
- package/dist/testing/test-connector.d.ts +1 -1
- package/dist/testing/test-connector.js +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/known-types.d.ts +51 -1
- package/dist/types/known-types.d.ts.map +1 -1
- package/dist/types/known-types.js +54 -1
- package/dist/types/known-types.js.map +1 -1
- package/dist/types/operators.d.ts +22 -0
- package/dist/types/operators.d.ts.map +1 -1
- package/dist/types/operators.js +6 -6
- package/dist/types/operators.js.map +1 -1
- package/dist/types/pause-state.d.ts +0 -8
- package/dist/types/pause-state.d.ts.map +1 -1
- package/dist/types/pause-state.js.map +1 -1
- package/dist/types/validation.d.ts +10 -1
- package/dist/types/validation.d.ts.map +1 -1
- package/dist/types/validation.js +9 -0
- package/dist/types/validation.js.map +1 -1
- package/dist/types/workflow-config.d.ts +4 -3
- package/dist/types/workflow-config.d.ts.map +1 -1
- package/dist/types/workflow-config.js +23 -8
- package/dist/types/workflow-config.js.map +1 -1
- package/dist/util/computed-value.d.ts +103 -0
- package/dist/util/computed-value.d.ts.map +1 -0
- package/dist/util/computed-value.js +453 -0
- package/dist/util/computed-value.js.map +1 -0
- package/dist/util/expression-format.d.ts +41 -0
- package/dist/util/expression-format.d.ts.map +1 -0
- package/dist/util/expression-format.js +84 -0
- package/dist/util/expression-format.js.map +1 -0
- package/dist/util/expression-functions.d.ts +35 -0
- package/dist/util/expression-functions.d.ts.map +1 -0
- package/dist/util/expression-functions.js +82 -0
- package/dist/util/expression-functions.js.map +1 -0
- package/dist/util/expression.d.ts +98 -0
- package/dist/util/expression.d.ts.map +1 -0
- package/dist/util/expression.js +395 -0
- package/dist/util/expression.js.map +1 -0
- package/dist/util/jsonata-signatures.d.ts +45 -0
- package/dist/util/jsonata-signatures.d.ts.map +1 -0
- package/dist/util/jsonata-signatures.js +113 -0
- package/dist/util/jsonata-signatures.js.map +1 -0
- package/dist/util/signature.d.ts +41 -0
- package/dist/util/signature.d.ts.map +1 -0
- package/dist/util/signature.js +124 -0
- package/dist/util/signature.js.map +1 -0
- package/dist/util/type-compat.d.ts +8 -28
- package/dist/util/type-compat.d.ts.map +1 -1
- package/dist/util/type-compat.js +22 -29
- package/dist/util/type-compat.js.map +1 -1
- package/dist/util/variable-ref.d.ts +24 -0
- package/dist/util/variable-ref.d.ts.map +1 -1
- package/dist/util/variable-ref.js +34 -9
- package/dist/util/variable-ref.js.map +1 -1
- package/package.json +6 -1
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WAIT step — pause execution and resume on a trigger.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* - `delay`: resume after a duration. Pauses with `statePatch.resumeAfter`
|
|
5
|
+
* for a host that schedules a delayed re-enqueue.
|
|
6
|
+
* - `approval`: resume when a person answers, through the resume API.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* can schedule a delayed re-enqueue.
|
|
9
|
-
*
|
|
10
|
-
* - `webhook`: Resume when an external system calls a callback URL.
|
|
11
|
-
* The step pauses with an `externalRef` that the host uses to
|
|
12
|
-
* route inbound callbacks to the correct execution.
|
|
13
|
-
*
|
|
14
|
-
* - `approval`: Resume when a user explicitly approves/rejects via the API.
|
|
15
|
-
* Supports compositional interactions: display data, editable form,
|
|
16
|
-
* and custom action buttons.
|
|
17
|
-
*
|
|
18
|
-
* All modes use `ctx.pause()`. The host runtime is responsible for
|
|
19
|
-
* scheduling delayed resumes (delay mode) or routing callbacks
|
|
20
|
-
* (webhook mode). The step itself is stateless — it pauses and
|
|
21
|
-
* trusts `onResume()` to receive whatever data the caller provides.
|
|
8
|
+
* Both pause through `ctx.pause()`; the step is stateless and trusts
|
|
9
|
+
* `onResume()` to receive whatever the caller provided.
|
|
22
10
|
*/
|
|
23
11
|
import { z } from 'zod';
|
|
24
12
|
import { BaseActionStep } from '../../../steps/base-step.js';
|
|
@@ -34,12 +22,6 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
34
22
|
}, {
|
|
35
23
|
mode: "delay";
|
|
36
24
|
delayMs: number;
|
|
37
|
-
}>, z.ZodObject<{
|
|
38
|
-
mode: z.ZodLiteral<"webhook">;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
mode: "webhook";
|
|
41
|
-
}, {
|
|
42
|
-
mode: "webhook";
|
|
43
25
|
}>, z.ZodObject<{
|
|
44
26
|
mode: z.ZodLiteral<"approval">;
|
|
45
27
|
reason: z.ZodString;
|
|
@@ -126,9 +108,9 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
126
108
|
label: string;
|
|
127
109
|
description?: string | undefined;
|
|
128
110
|
required?: boolean | undefined;
|
|
129
|
-
placeholder?: string | undefined;
|
|
130
|
-
min?: number | undefined;
|
|
131
111
|
max?: number | undefined;
|
|
112
|
+
min?: number | undefined;
|
|
113
|
+
placeholder?: string | undefined;
|
|
132
114
|
defaultValue?: number | undefined;
|
|
133
115
|
}, {
|
|
134
116
|
type: "number";
|
|
@@ -136,9 +118,9 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
136
118
|
label: string;
|
|
137
119
|
description?: string | undefined;
|
|
138
120
|
required?: boolean | undefined;
|
|
139
|
-
placeholder?: string | undefined;
|
|
140
|
-
min?: number | undefined;
|
|
141
121
|
max?: number | undefined;
|
|
122
|
+
min?: number | undefined;
|
|
123
|
+
placeholder?: string | undefined;
|
|
142
124
|
defaultValue?: number | undefined;
|
|
143
125
|
}>, z.ZodObject<{
|
|
144
126
|
type: z.ZodLiteral<"select">;
|
|
@@ -267,9 +249,9 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
267
249
|
label: string;
|
|
268
250
|
description?: string | undefined;
|
|
269
251
|
required?: boolean | undefined;
|
|
270
|
-
placeholder?: string | undefined;
|
|
271
|
-
min?: number | undefined;
|
|
272
252
|
max?: number | undefined;
|
|
253
|
+
min?: number | undefined;
|
|
254
|
+
placeholder?: string | undefined;
|
|
273
255
|
defaultValue?: number | undefined;
|
|
274
256
|
} | {
|
|
275
257
|
options: string | {
|
|
@@ -328,9 +310,9 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
328
310
|
label: string;
|
|
329
311
|
description?: string | undefined;
|
|
330
312
|
required?: boolean | undefined;
|
|
331
|
-
placeholder?: string | undefined;
|
|
332
|
-
min?: number | undefined;
|
|
333
313
|
max?: number | undefined;
|
|
314
|
+
min?: number | undefined;
|
|
315
|
+
placeholder?: string | undefined;
|
|
334
316
|
defaultValue?: number | undefined;
|
|
335
317
|
} | {
|
|
336
318
|
options: string | {
|
|
@@ -419,9 +401,9 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
419
401
|
label: string;
|
|
420
402
|
description?: string | undefined;
|
|
421
403
|
required?: boolean | undefined;
|
|
422
|
-
placeholder?: string | undefined;
|
|
423
|
-
min?: number | undefined;
|
|
424
404
|
max?: number | undefined;
|
|
405
|
+
min?: number | undefined;
|
|
406
|
+
placeholder?: string | undefined;
|
|
425
407
|
defaultValue?: number | undefined;
|
|
426
408
|
} | {
|
|
427
409
|
options: string | {
|
|
@@ -498,9 +480,9 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
498
480
|
label: string;
|
|
499
481
|
description?: string | undefined;
|
|
500
482
|
required?: boolean | undefined;
|
|
501
|
-
placeholder?: string | undefined;
|
|
502
|
-
min?: number | undefined;
|
|
503
483
|
max?: number | undefined;
|
|
484
|
+
min?: number | undefined;
|
|
485
|
+
placeholder?: string | undefined;
|
|
504
486
|
defaultValue?: number | undefined;
|
|
505
487
|
} | {
|
|
506
488
|
options: string | {
|
|
@@ -547,14 +529,14 @@ export declare const WaitStepConfigSchema: z.ZodDiscriminatedUnion<"mode", [z.Zo
|
|
|
547
529
|
export type WaitStepConfig = z.infer<typeof WaitStepConfigSchema>;
|
|
548
530
|
export interface WaitStepOutput extends Record<string, unknown> {
|
|
549
531
|
/** Which mode was used. */
|
|
550
|
-
mode: 'delay' | '
|
|
532
|
+
mode: 'delay' | 'approval';
|
|
551
533
|
/** Data provided by the resume call (empty for delay auto-resume). */
|
|
552
534
|
resumeData: Record<string, unknown>;
|
|
553
535
|
}
|
|
554
536
|
export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema, WaitStepOutput> {
|
|
555
537
|
readonly type = BuiltinStepType.WAIT;
|
|
556
538
|
readonly name = "Wait";
|
|
557
|
-
readonly description = "Pause execution and resume after a delay
|
|
539
|
+
readonly description = "Pause execution and resume after a delay or a person's answer";
|
|
558
540
|
readonly configSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
|
|
559
541
|
mode: z.ZodLiteral<"delay">;
|
|
560
542
|
delayMs: z.ZodNumber;
|
|
@@ -564,12 +546,6 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
564
546
|
}, {
|
|
565
547
|
mode: "delay";
|
|
566
548
|
delayMs: number;
|
|
567
|
-
}>, z.ZodObject<{
|
|
568
|
-
mode: z.ZodLiteral<"webhook">;
|
|
569
|
-
}, "strip", z.ZodTypeAny, {
|
|
570
|
-
mode: "webhook";
|
|
571
|
-
}, {
|
|
572
|
-
mode: "webhook";
|
|
573
549
|
}>, z.ZodObject<{
|
|
574
550
|
mode: z.ZodLiteral<"approval">;
|
|
575
551
|
reason: z.ZodString;
|
|
@@ -656,9 +632,9 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
656
632
|
label: string;
|
|
657
633
|
description?: string | undefined;
|
|
658
634
|
required?: boolean | undefined;
|
|
659
|
-
placeholder?: string | undefined;
|
|
660
|
-
min?: number | undefined;
|
|
661
635
|
max?: number | undefined;
|
|
636
|
+
min?: number | undefined;
|
|
637
|
+
placeholder?: string | undefined;
|
|
662
638
|
defaultValue?: number | undefined;
|
|
663
639
|
}, {
|
|
664
640
|
type: "number";
|
|
@@ -666,9 +642,9 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
666
642
|
label: string;
|
|
667
643
|
description?: string | undefined;
|
|
668
644
|
required?: boolean | undefined;
|
|
669
|
-
placeholder?: string | undefined;
|
|
670
|
-
min?: number | undefined;
|
|
671
645
|
max?: number | undefined;
|
|
646
|
+
min?: number | undefined;
|
|
647
|
+
placeholder?: string | undefined;
|
|
672
648
|
defaultValue?: number | undefined;
|
|
673
649
|
}>, z.ZodObject<{
|
|
674
650
|
type: z.ZodLiteral<"select">;
|
|
@@ -797,9 +773,9 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
797
773
|
label: string;
|
|
798
774
|
description?: string | undefined;
|
|
799
775
|
required?: boolean | undefined;
|
|
800
|
-
placeholder?: string | undefined;
|
|
801
|
-
min?: number | undefined;
|
|
802
776
|
max?: number | undefined;
|
|
777
|
+
min?: number | undefined;
|
|
778
|
+
placeholder?: string | undefined;
|
|
803
779
|
defaultValue?: number | undefined;
|
|
804
780
|
} | {
|
|
805
781
|
options: string | {
|
|
@@ -858,9 +834,9 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
858
834
|
label: string;
|
|
859
835
|
description?: string | undefined;
|
|
860
836
|
required?: boolean | undefined;
|
|
861
|
-
placeholder?: string | undefined;
|
|
862
|
-
min?: number | undefined;
|
|
863
837
|
max?: number | undefined;
|
|
838
|
+
min?: number | undefined;
|
|
839
|
+
placeholder?: string | undefined;
|
|
864
840
|
defaultValue?: number | undefined;
|
|
865
841
|
} | {
|
|
866
842
|
options: string | {
|
|
@@ -949,9 +925,9 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
949
925
|
label: string;
|
|
950
926
|
description?: string | undefined;
|
|
951
927
|
required?: boolean | undefined;
|
|
952
|
-
placeholder?: string | undefined;
|
|
953
|
-
min?: number | undefined;
|
|
954
928
|
max?: number | undefined;
|
|
929
|
+
min?: number | undefined;
|
|
930
|
+
placeholder?: string | undefined;
|
|
955
931
|
defaultValue?: number | undefined;
|
|
956
932
|
} | {
|
|
957
933
|
options: string | {
|
|
@@ -1028,9 +1004,9 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
1028
1004
|
label: string;
|
|
1029
1005
|
description?: string | undefined;
|
|
1030
1006
|
required?: boolean | undefined;
|
|
1031
|
-
placeholder?: string | undefined;
|
|
1032
|
-
min?: number | undefined;
|
|
1033
1007
|
max?: number | undefined;
|
|
1008
|
+
min?: number | undefined;
|
|
1009
|
+
placeholder?: string | undefined;
|
|
1034
1010
|
defaultValue?: number | undefined;
|
|
1035
1011
|
} | {
|
|
1036
1012
|
options: string | {
|
|
@@ -1075,13 +1051,13 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
1075
1051
|
}[] | undefined;
|
|
1076
1052
|
}>]>;
|
|
1077
1053
|
readonly outputSchema: z.ZodObject<{
|
|
1078
|
-
mode: z.ZodEnum<["delay", "
|
|
1054
|
+
mode: z.ZodEnum<["delay", "approval"]>;
|
|
1079
1055
|
resumeData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1080
1056
|
}, "strip", z.ZodTypeAny, {
|
|
1081
|
-
mode: "delay" | "
|
|
1057
|
+
mode: "delay" | "approval";
|
|
1082
1058
|
resumeData: Record<string, unknown>;
|
|
1083
1059
|
}, {
|
|
1084
|
-
mode: "delay" | "
|
|
1060
|
+
mode: "delay" | "approval";
|
|
1085
1061
|
resumeData: Record<string, unknown>;
|
|
1086
1062
|
}>;
|
|
1087
1063
|
readonly category: StepCategory;
|
|
@@ -1090,7 +1066,12 @@ export declare class WaitStep extends BaseActionStep<typeof WaitStepConfigSchema
|
|
|
1090
1066
|
execute(config: WaitStepConfig, ctx: StepExecutionContext): Promise<WaitStepOutput>;
|
|
1091
1067
|
onResume(rowData: Record<string, unknown>, _config: WaitStepConfig, _ctx: StepExecutionContext): Promise<WaitStepOutput>;
|
|
1092
1068
|
private executeDelay;
|
|
1093
|
-
|
|
1069
|
+
/**
|
|
1070
|
+
* Async only because an option's `when` condition may now compare a computed
|
|
1071
|
+
* value. It still never returns — `ctx.pause` throws — so the dispatch in
|
|
1072
|
+
* `execute` is unchanged; an async method returning `Promise<never>` is
|
|
1073
|
+
* assignable wherever the sync one was.
|
|
1074
|
+
*/
|
|
1094
1075
|
private executeApproval;
|
|
1095
1076
|
/**
|
|
1096
1077
|
* The form as this person sees it: a choice carrying a `when` is kept only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.step.d.ts","sourceRoot":"","sources":["../../../../src/connectors/builtin/steps/wait.step.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3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E,OAAO,CAAC,EAChC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,cAAc,CAAC;IAU1B,OAAO,CAAC,YAAY;IAcpB;;;;;OAKG;YACW,eAAe;IA6B7B;;;;;;;;OAQG;YACW,OAAO;CA0BtB"}
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WAIT step — pause execution and resume on a trigger.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* - `delay`: resume after a duration. Pauses with `statePatch.resumeAfter`
|
|
5
|
+
* for a host that schedules a delayed re-enqueue.
|
|
6
|
+
* - `approval`: resume when a person answers, through the resume API.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* can schedule a delayed re-enqueue.
|
|
9
|
-
*
|
|
10
|
-
* - `webhook`: Resume when an external system calls a callback URL.
|
|
11
|
-
* The step pauses with an `externalRef` that the host uses to
|
|
12
|
-
* route inbound callbacks to the correct execution.
|
|
13
|
-
*
|
|
14
|
-
* - `approval`: Resume when a user explicitly approves/rejects via the API.
|
|
15
|
-
* Supports compositional interactions: display data, editable form,
|
|
16
|
-
* and custom action buttons.
|
|
17
|
-
*
|
|
18
|
-
* All modes use `ctx.pause()`. The host runtime is responsible for
|
|
19
|
-
* scheduling delayed resumes (delay mode) or routing callbacks
|
|
20
|
-
* (webhook mode). The step itself is stateless — it pauses and
|
|
21
|
-
* trusts `onResume()` to receive whatever data the caller provides.
|
|
8
|
+
* Both pause through `ctx.pause()`; the step is stateless and trusts
|
|
9
|
+
* `onResume()` to receive whatever the caller provided.
|
|
22
10
|
*/
|
|
23
11
|
import { z } from 'zod';
|
|
24
12
|
import { BaseActionStep } from '../../../steps/base-step.js';
|
|
25
|
-
import { BuiltinStepType } from '../../../types/known-types.js';
|
|
13
|
+
import { BuiltinStepType, GateCategory } from '../../../types/known-types.js';
|
|
26
14
|
import { ConditionSchema } from '../../../types/workflow-config.js';
|
|
27
15
|
import { ConditionEvaluator } from '../../../engine/condition-evaluator.js';
|
|
28
16
|
import { ATTACHMENT_ARRAY_JSON_SCHEMA } from '../../../common/attachment.js';
|
|
@@ -121,11 +109,6 @@ const WaitDelayConfigSchema = z.object({
|
|
|
121
109
|
mode: z.literal('delay'),
|
|
122
110
|
delayMs: z.number().int().positive().describe('Duration to wait in milliseconds before auto-resuming'),
|
|
123
111
|
});
|
|
124
|
-
const WaitWebhookConfigSchema = z.object({
|
|
125
|
-
mode: z.literal('webhook'),
|
|
126
|
-
// No per-step config needed. The workflow's stable callback secret +
|
|
127
|
-
// this execution's ID together form the callback URL.
|
|
128
|
-
});
|
|
129
112
|
const WaitApprovalConfigSchema = z.object({
|
|
130
113
|
mode: z.literal('approval'),
|
|
131
114
|
reason: z.string().min(1).describe('Human-readable reason shown to the approver'),
|
|
@@ -137,18 +120,17 @@ const WaitApprovalConfigSchema = z.object({
|
|
|
137
120
|
});
|
|
138
121
|
export const WaitStepConfigSchema = z.discriminatedUnion('mode', [
|
|
139
122
|
WaitDelayConfigSchema,
|
|
140
|
-
WaitWebhookConfigSchema,
|
|
141
123
|
WaitApprovalConfigSchema,
|
|
142
124
|
]);
|
|
143
125
|
const WaitStepOutputSchema = z.object({
|
|
144
|
-
mode: z.enum(['delay', '
|
|
126
|
+
mode: z.enum(['delay', 'approval']),
|
|
145
127
|
resumeData: z.record(z.unknown()),
|
|
146
128
|
});
|
|
147
129
|
// ─── Step ───
|
|
148
130
|
export class WaitStep extends BaseActionStep {
|
|
149
131
|
type = BuiltinStepType.WAIT;
|
|
150
132
|
name = 'Wait';
|
|
151
|
-
description = 'Pause execution and resume after a delay
|
|
133
|
+
description = 'Pause execution and resume after a delay or a person\'s answer';
|
|
152
134
|
configSchema = WaitStepConfigSchema;
|
|
153
135
|
outputSchema = WaitStepOutputSchema;
|
|
154
136
|
category = 'flow';
|
|
@@ -173,7 +155,7 @@ export class WaitStep extends BaseActionStep {
|
|
|
173
155
|
return {
|
|
174
156
|
type: 'object',
|
|
175
157
|
properties: {
|
|
176
|
-
mode: { type: 'string', enum: ['delay', '
|
|
158
|
+
mode: { type: 'string', enum: ['delay', 'approval'] },
|
|
177
159
|
resumeData,
|
|
178
160
|
},
|
|
179
161
|
};
|
|
@@ -182,8 +164,6 @@ export class WaitStep extends BaseActionStep {
|
|
|
182
164
|
switch (config.mode) {
|
|
183
165
|
case 'delay':
|
|
184
166
|
return this.executeDelay(config, ctx);
|
|
185
|
-
case 'webhook':
|
|
186
|
-
return this.executeWebhook(config, ctx);
|
|
187
167
|
case 'approval':
|
|
188
168
|
return this.executeApproval(config, ctx);
|
|
189
169
|
}
|
|
@@ -198,6 +178,7 @@ export class WaitStep extends BaseActionStep {
|
|
|
198
178
|
}
|
|
199
179
|
executeDelay(config, ctx) {
|
|
200
180
|
ctx.pause(`Waiting for ${String(config.delayMs)}ms`, {
|
|
181
|
+
category: GateCategory.Delay,
|
|
201
182
|
statePatch: {
|
|
202
183
|
waitMode: 'delay',
|
|
203
184
|
delayMs: config.delayMs,
|
|
@@ -205,35 +186,13 @@ export class WaitStep extends BaseActionStep {
|
|
|
205
186
|
},
|
|
206
187
|
});
|
|
207
188
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// The UI surfaces the full URL by joining the workflow's stored secret
|
|
216
|
-
// with this execution's ID — the wait step itself only needs to
|
|
217
|
-
// identify which execution is paused.
|
|
218
|
-
ctx.pause('Waiting for webhook callback', {
|
|
219
|
-
statePatch: {
|
|
220
|
-
waitMode: 'webhook',
|
|
221
|
-
executionId: ctx.runtime.executionId,
|
|
222
|
-
pauseState: {
|
|
223
|
-
reason: 'Waiting for webhook callback',
|
|
224
|
-
category: 'input_required',
|
|
225
|
-
display: [
|
|
226
|
-
{ label: 'Execution ID', value: ctx.runtime.executionId },
|
|
227
|
-
{
|
|
228
|
-
label: 'Callback URL template',
|
|
229
|
-
value: `${ctx.runtime.baseUrl}/wait/callback/<workflow-secret>/${ctx.runtime.executionId}`,
|
|
230
|
-
},
|
|
231
|
-
],
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
executeApproval(config, ctx) {
|
|
189
|
+
/**
|
|
190
|
+
* Async only because an option's `when` condition may now compare a computed
|
|
191
|
+
* value. It still never returns — `ctx.pause` throws — so the dispatch in
|
|
192
|
+
* `execute` is unchanged; an async method returning `Promise<never>` is
|
|
193
|
+
* assignable wherever the sync one was.
|
|
194
|
+
*/
|
|
195
|
+
async executeApproval(config, ctx) {
|
|
237
196
|
// Build compositional PauseState from resolved config
|
|
238
197
|
const pauseState = {
|
|
239
198
|
reason: config.reason,
|
|
@@ -243,10 +202,11 @@ export class WaitStep extends BaseActionStep {
|
|
|
243
202
|
if (config.display)
|
|
244
203
|
pauseState.display = config.display;
|
|
245
204
|
if (config.form)
|
|
246
|
-
pauseState.form = this.offered(config.form, ctx);
|
|
205
|
+
pauseState.form = await this.offered(config.form, ctx);
|
|
247
206
|
if (config.actions)
|
|
248
207
|
pauseState.actions = config.actions;
|
|
249
208
|
ctx.pause(config.reason, {
|
|
209
|
+
category: GateCategory.WaitingOnHuman,
|
|
250
210
|
statePatch: {
|
|
251
211
|
waitMode: 'approval',
|
|
252
212
|
reason: config.reason,
|
|
@@ -269,17 +229,23 @@ export class WaitStep extends BaseActionStep {
|
|
|
269
229
|
* is the author's flow saying "under this data, there is nothing to pick here",
|
|
270
230
|
* and hiding the question instead would be this step inventing a rule.
|
|
271
231
|
*/
|
|
272
|
-
offered(form, ctx) {
|
|
232
|
+
async offered(form, ctx) {
|
|
273
233
|
const anyConditioned = form.fields.some((field) => field.type === 'select' && Array.isArray(field.options) && field.options.some((o) => o.when !== undefined));
|
|
274
234
|
if (!anyConditioned)
|
|
275
235
|
return form;
|
|
276
236
|
const evaluator = new ConditionEvaluator();
|
|
277
|
-
|
|
237
|
+
// Evaluating a condition is async now, so the keep/drop decision is made up
|
|
238
|
+
// front and the filter reads the answers. Options are independent of each
|
|
239
|
+
// other, so they resolve together.
|
|
240
|
+
const fields = await Promise.all(form.fields.map(async (field) => {
|
|
278
241
|
if (field.type !== 'select' || !Array.isArray(field.options))
|
|
279
242
|
return field;
|
|
280
|
-
const
|
|
243
|
+
const keep = await Promise.all(field.options.map((option) => option.when === undefined
|
|
244
|
+
? Promise.resolve(true)
|
|
245
|
+
: evaluator.evaluate(option.when, ctx.workflow)));
|
|
246
|
+
const options = field.options.filter((_, i) => keep[i]);
|
|
281
247
|
return options.length === field.options.length ? field : { ...field, options };
|
|
282
|
-
});
|
|
248
|
+
}));
|
|
283
249
|
return { ...form, fields };
|
|
284
250
|
}
|
|
285
251
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.step.js","sourceRoot":"","sources":["../../../../src/connectors/builtin/steps/wait.step.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wait.step.js","sourceRoot":"","sources":["../../../../src/connectors/builtin/steps/wait.step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,0DAA0D;AAE1D,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,8EAA8E;IAC9E,8EAA8E;IAC9E,gFAAgF;IAChF,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAA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AC;YACF,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACxD,OAAO,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC;QACjF,CAAC,CAAC,CACH,CAAC;QACF,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* inside that frame can quote.
|
|
4
4
|
*/
|
|
5
5
|
import { type Step } from './json.js';
|
|
6
|
-
import type { Call, CallScope } from './types.js';
|
|
6
|
+
import type { Call, CallScope, DeclaredField } from './types.js';
|
|
7
7
|
export declare function readCall(step: Step, scope: CallScope, onFail: string | undefined): Call;
|
|
8
8
|
/**
|
|
9
9
|
* The answer's fields, from the JSON Schema its author declared — written the
|
|
@@ -14,7 +14,7 @@ export declare function readCall(step: Step, scope: CallScope, onFail: string |
|
|
|
14
14
|
* can quote. The same walk serves a lookup's answer and what the conversation is
|
|
15
15
|
* started with, because they are the same promise: these names will be there.
|
|
16
16
|
*/
|
|
17
|
-
export declare function declaredFields(schema: unknown):
|
|
17
|
+
export declare function declaredFields(schema: unknown): DeclaredField[];
|
|
18
18
|
/** Whatever `steps` quote of a call's answer, so nothing is removed silently. */
|
|
19
19
|
export declare function quotedBy(steps: unknown, callId: string): boolean;
|
|
20
20
|
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../src/conversational-flow/calls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../src/conversational-flow/calls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiC,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAsBjE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAavF;AAED;;;GAGG;AACH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,EAAE,CAe/D;AA0BD,iFAAiF;AACjF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhE"}
|
|
@@ -3,9 +3,25 @@
|
|
|
3
3
|
* inside that frame can quote.
|
|
4
4
|
*/
|
|
5
5
|
import { asArray, asRec, str } from './json.js';
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* How deep and how wide a declared answer is described.
|
|
8
|
+
*
|
|
9
|
+
* Both were hit by a real payload: a ride lookup with 51 top-level keys wanted
|
|
10
|
+
* 79 quotable leaves and got 60, silently dropping `rideStatus`, `vehicleNo`
|
|
11
|
+
* and `tripCategory.tag` — fields an author had named and then could not find.
|
|
12
|
+
* Depth 3 was equally tight: `customerDropLocation.address.city` is already at
|
|
13
|
+
* the limit.
|
|
14
|
+
*
|
|
15
|
+
* A bigger number is not a real answer to an enormous response — it moves the
|
|
16
|
+
* cliff rather than removing it, and 200 fields is more than a picker can show
|
|
17
|
+
* usefully. The honest fix is to describe fields on demand instead of all at
|
|
18
|
+
* once; until then these are sized for the APIs this actually meets.
|
|
19
|
+
*
|
|
20
|
+
* Depth restarts inside a list's items, so an item may be described this deep
|
|
21
|
+
* again — which is what `price.value.amount` needs.
|
|
22
|
+
*/
|
|
23
|
+
const MAX_DEPTH = 6;
|
|
24
|
+
const MAX_FIELDS = 200;
|
|
9
25
|
export function readCall(step, scope, onFail) {
|
|
10
26
|
const config = asRec(step.config);
|
|
11
27
|
return {
|
|
@@ -34,11 +50,12 @@ export function declaredFields(schema) {
|
|
|
34
50
|
const descend = (node, path, depth) => {
|
|
35
51
|
if (out.length >= MAX_FIELDS)
|
|
36
52
|
return;
|
|
37
|
-
const
|
|
53
|
+
const rec = asRec(node);
|
|
54
|
+
const properties = asRec(rec['properties']);
|
|
38
55
|
const keys = Object.keys(properties);
|
|
39
56
|
if (keys.length === 0 || depth >= MAX_DEPTH) {
|
|
40
57
|
if (path)
|
|
41
|
-
out.push({ path, type: str(
|
|
58
|
+
out.push({ path, type: str(rec['type']), ...itemsOf(rec) });
|
|
42
59
|
return;
|
|
43
60
|
}
|
|
44
61
|
for (const key of keys)
|
|
@@ -47,6 +64,24 @@ export function declaredFields(schema) {
|
|
|
47
64
|
descend(schema, '', 0);
|
|
48
65
|
return out;
|
|
49
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* A list's item fields, when its items are objects that declare any.
|
|
69
|
+
*
|
|
70
|
+
* The list itself stays a leaf — `items` is not a step on a quotable path, and
|
|
71
|
+
* nothing may point at one element of it. What this adds is the vocabulary for
|
|
72
|
+
* saying something *about* the items, which is what filtering and totalling a
|
|
73
|
+
* list both need. The same `declaredFields` walk describes an item, so a list of
|
|
74
|
+
* objects of objects reads the same way one level down.
|
|
75
|
+
*
|
|
76
|
+
* Returned as a spreadable fragment so the key is simply absent when there is
|
|
77
|
+
* nothing to say, which `exactOptionalPropertyTypes` requires.
|
|
78
|
+
*/
|
|
79
|
+
function itemsOf(node) {
|
|
80
|
+
if (str(node['type']) !== 'array')
|
|
81
|
+
return {};
|
|
82
|
+
const fields = declaredFields(asRec(node['items']));
|
|
83
|
+
return fields.length > 0 ? { itemFields: fields } : {};
|
|
84
|
+
}
|
|
50
85
|
/** `fetch_refund` → `Fetch refund`, for a call whose author never named it. */
|
|
51
86
|
function humanise(id) {
|
|
52
87
|
const words = id.replace(/[_-]+/g, ' ').trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calls.js","sourceRoot":"","sources":["../../src/conversational-flow/calls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"calls.js","sourceRoot":"","sources":["../../src/conversational-flow/calls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAuB,MAAM,WAAW,CAAC;AAGrE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB,MAAM,UAAU,QAAQ,CAAC,IAAU,EAAE,KAAgB,EAAE,MAA0B;IAC/E,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,KAAK;QACL,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK;QACtC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;QAC7B,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC7C,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAC/D,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,MAAM,GAAG,GAAoB,EAAE,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,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACzD,CAAC;AAED,+EAA+E;AAC/E,SAAS,QAAQ,CAAC,EAAU;IAC1B,MAAM,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAE,MAAc;IACrD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* headings, where each jump is aimed — is left to `settle`.
|
|
19
19
|
*/
|
|
20
20
|
import type { WorkflowConfig } from '../types/workflow-config.js';
|
|
21
|
-
export
|
|
21
|
+
export { CONVERSATIONAL_FLOW_KIND } from '../types/known-types.js';
|
|
22
|
+
import { CONVERSATIONAL_FLOW_KIND } from '../types/known-types.js';
|
|
22
23
|
/** How typed messages are routed: a classifier model, or an agent asked for JSON. */
|
|
23
24
|
export type NewRouter = {
|
|
24
25
|
kind: 'classifier';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/conversational-flow/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAMlE,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/conversational-flow/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAMlE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,qFAAqF;AACrF,MAAM,MAAM,SAAS,GACjB;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,EAAE;QAAE,IAAI,EAAE,OAAO,wBAAwB,CAAA;KAAE,CAAC;CACrD;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE;IACP,2EAA2E;IAC3E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CACX,GACL,qBAAqB,CAyDvB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { refreshDerived } from './settle.js';
|
|
2
2
|
import { carrying, cycleStep, DEFAULT_ROUTE_KEY, finishStep, jumpStep, screenCase, switchStep } from './shape.js';
|
|
3
3
|
import { AGENT_STEP_TYPE, CLASSIFIER_STEP_TYPE } from './types.js';
|
|
4
|
-
export
|
|
4
|
+
export { CONVERSATIONAL_FLOW_KIND } from '../types/known-types.js';
|
|
5
|
+
import { CONVERSATIONAL_FLOW_KIND } from '../types/known-types.js';
|
|
5
6
|
export function createConversationalFlow(options = {}) {
|
|
6
7
|
const title = options.title?.trim() || 'Start';
|
|
7
8
|
const greeting = options.greeting?.trim() || 'Hi! How can I help?';
|
|
@@ -19,7 +20,6 @@ export function createConversationalFlow(options = {}) {
|
|
|
19
20
|
id: `ask_${first}`,
|
|
20
21
|
type: 'WAIT',
|
|
21
22
|
config: {
|
|
22
|
-
mode: 'approval',
|
|
23
23
|
reason: title,
|
|
24
24
|
prompt: [greeting],
|
|
25
25
|
form: {
|