@frontera-sdk/workflow 1.52.18 → 1.52.20
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/package.json +3 -3
- package/src/definition.ts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontera-sdk/workflow",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.20",
|
|
4
4
|
"description": "Typed headless client for starting, inspecting, waiting on and cancelling Frontera workflow runs from a script or backend.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontera",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"typecheck": "bunx tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@frontera-sdk/core": "1.52.
|
|
42
|
-
"@frontera-sdk/functions": "1.52.
|
|
41
|
+
"@frontera-sdk/core": "1.52.20",
|
|
42
|
+
"@frontera-sdk/functions": "1.52.20"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/bun": "^1.3.14",
|
package/src/definition.ts
CHANGED
|
@@ -38,6 +38,7 @@ export const NODE_KINDS = [
|
|
|
38
38
|
'forEach',
|
|
39
39
|
'parallel',
|
|
40
40
|
'wait',
|
|
41
|
+
'confirm',
|
|
41
42
|
'stop',
|
|
42
43
|
'respond',
|
|
43
44
|
] as const
|
|
@@ -345,6 +346,26 @@ export interface WaitRecordParams {
|
|
|
345
346
|
until?: never
|
|
346
347
|
}
|
|
347
348
|
export type WaitParams = WaitTimeParams | WaitRecordParams
|
|
349
|
+
/**
|
|
350
|
+
* Ask the person in the conversation that started the run (through an Agent)
|
|
351
|
+
* to confirm before the next steps act. They answer with the conversation's
|
|
352
|
+
* own buttons; the run waits for the answer. The step returns
|
|
353
|
+
* `{ answer: 'confirmed' | 'cancelled' | 'expired' | 'unavailable' }` and
|
|
354
|
+
* never fails on a no: branch on `$steps.<id>.answer`. `unavailable` when no
|
|
355
|
+
* Agent started the run from a conversation.
|
|
356
|
+
*/
|
|
357
|
+
export interface ConfirmParams {
|
|
358
|
+
/** What will be done, in one sentence the person can say yes to. */
|
|
359
|
+
summary: DataInput
|
|
360
|
+
/** Anything else they should see first, as plain text. */
|
|
361
|
+
details?: DataInput
|
|
362
|
+
/** The confirm button's label; "Confirm" by default. */
|
|
363
|
+
confirmLabel?: string
|
|
364
|
+
/** The cancel button's label; "Cancel" by default. */
|
|
365
|
+
cancelLabel?: string
|
|
366
|
+
/** How long the question stays open, in minutes (1 to 1440); 60 by default. */
|
|
367
|
+
timeoutMinutes?: number
|
|
368
|
+
}
|
|
348
369
|
export interface RespondParams {
|
|
349
370
|
status: number
|
|
350
371
|
headers?: Record<string, DataInput>
|
|
@@ -368,6 +389,7 @@ export type WorkflowNode =
|
|
|
368
389
|
| NodeOf<'forEach', ForEachParams>
|
|
369
390
|
| NodeOf<'parallel', ParallelParams>
|
|
370
391
|
| NodeOf<'wait', WaitParams>
|
|
392
|
+
| NodeOf<'confirm', ConfirmParams>
|
|
371
393
|
| NodeOf<'respond', RespondParams>
|
|
372
394
|
|
|
373
395
|
export interface WorkflowDefinition {
|