@uipath/maestro-builder-sdk 6.87.4 → 6.88.1
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/api-index.md +42 -40
- package/dist/api-members.md +136 -128
- package/dist/bpmn/bpmn-sdk.d.ts +40 -15
- package/dist/bpmn/bpmn-sdk.js +29 -8
- package/dist/bpmn/check-cli.js +13 -6
- package/dist/bpmn/check.js +24 -9
- package/dist/bpmn/compile-cli.js +13 -2
- package/dist/bpmn/decompile.js +73 -2
- package/dist/bpmn/graph.js +2 -2
- package/dist/bpmn/serialize.js +3 -1
- package/dist/bpmn-api.md +7 -6
- package/dist/cli-result.d.ts +4 -2
- package/dist/cli-result.js +4 -3
- package/dist/cli-run.js +17 -2
- package/dist/core/refusals.d.ts +3 -0
- package/dist/core/refusals.js +3 -0
- package/dist/core-definitions.json +154 -0
- package/dist/flow-node-type.d.ts +2 -0
- package/dist/nodes/trigger/flow/check.d.ts +10 -4
- package/dist/nodes/trigger/flow/check.js +15 -0
- package/dist/nodes/trigger/flow/factories.d.ts +22 -6
- package/dist/nodes/trigger/flow/factories.js +22 -6
- package/dist/nodes/trigger/flow/node-type.d.ts +2 -1
- package/dist/nodes/trigger/flow/node-type.js +95 -5
- package/dist/nodes/trigger/flow/spec.d.ts +30 -0
- package/dist/serialize.js +1 -0
- package/package.json +2 -2
|
@@ -11361,6 +11361,160 @@
|
|
|
11361
11361
|
}
|
|
11362
11362
|
}
|
|
11363
11363
|
},
|
|
11364
|
+
"core.trigger.conversation@1.3": {
|
|
11365
|
+
"nodeType": "core.trigger.conversation",
|
|
11366
|
+
"version": "1.3",
|
|
11367
|
+
"category": "trigger",
|
|
11368
|
+
"description": "Start this process when a new conversation is created",
|
|
11369
|
+
"tags": [
|
|
11370
|
+
"trigger",
|
|
11371
|
+
"conversation",
|
|
11372
|
+
"start"
|
|
11373
|
+
],
|
|
11374
|
+
"sortOrder": 88,
|
|
11375
|
+
"display": {
|
|
11376
|
+
"label": "Conversation trigger",
|
|
11377
|
+
"icon": "messagesSquare",
|
|
11378
|
+
"shape": "circle"
|
|
11379
|
+
},
|
|
11380
|
+
"handleConfiguration": [
|
|
11381
|
+
{
|
|
11382
|
+
"position": "right",
|
|
11383
|
+
"handles": [
|
|
11384
|
+
{
|
|
11385
|
+
"id": "output",
|
|
11386
|
+
"type": "source",
|
|
11387
|
+
"handleType": "output",
|
|
11388
|
+
"showButton": true,
|
|
11389
|
+
"constraints": {
|
|
11390
|
+
"forbiddenTargetCategories": [
|
|
11391
|
+
"trigger"
|
|
11392
|
+
]
|
|
11393
|
+
}
|
|
11394
|
+
}
|
|
11395
|
+
],
|
|
11396
|
+
"visible": true
|
|
11397
|
+
}
|
|
11398
|
+
],
|
|
11399
|
+
"model": {
|
|
11400
|
+
"type": "bpmn:StartEvent",
|
|
11401
|
+
"entryPointId": true
|
|
11402
|
+
},
|
|
11403
|
+
"inputDefinition": {
|
|
11404
|
+
"type": "object",
|
|
11405
|
+
"properties": {
|
|
11406
|
+
"appearance": {
|
|
11407
|
+
"type": "object",
|
|
11408
|
+
"properties": {
|
|
11409
|
+
"welcomeTitle": {
|
|
11410
|
+
"type": "string"
|
|
11411
|
+
},
|
|
11412
|
+
"welcomeDescription": {
|
|
11413
|
+
"type": "string"
|
|
11414
|
+
},
|
|
11415
|
+
"startingPrompts": {
|
|
11416
|
+
"type": "array",
|
|
11417
|
+
"items": {
|
|
11418
|
+
"type": "object",
|
|
11419
|
+
"properties": {
|
|
11420
|
+
"id": {
|
|
11421
|
+
"type": "string"
|
|
11422
|
+
},
|
|
11423
|
+
"displayPrompt": {
|
|
11424
|
+
"type": "string"
|
|
11425
|
+
},
|
|
11426
|
+
"actualPrompt": {
|
|
11427
|
+
"type": "string"
|
|
11428
|
+
}
|
|
11429
|
+
},
|
|
11430
|
+
"required": [
|
|
11431
|
+
"id",
|
|
11432
|
+
"displayPrompt",
|
|
11433
|
+
"actualPrompt"
|
|
11434
|
+
]
|
|
11435
|
+
}
|
|
11436
|
+
},
|
|
11437
|
+
"personalWorkspaceConnectionsOnly": {
|
|
11438
|
+
"type": "boolean"
|
|
11439
|
+
}
|
|
11440
|
+
}
|
|
11441
|
+
}
|
|
11442
|
+
}
|
|
11443
|
+
},
|
|
11444
|
+
"inputDefaults": {
|
|
11445
|
+
"appearance": {
|
|
11446
|
+
"personalWorkspaceConnectionsOnly": true
|
|
11447
|
+
}
|
|
11448
|
+
},
|
|
11449
|
+
"outputDefinition": {
|
|
11450
|
+
"output": {
|
|
11451
|
+
"type": "object",
|
|
11452
|
+
"description": "Data passed when this conversation trigger starts the process.",
|
|
11453
|
+
"source": "null",
|
|
11454
|
+
"var": "output",
|
|
11455
|
+
"schema": {
|
|
11456
|
+
"type": "object",
|
|
11457
|
+
"properties": {
|
|
11458
|
+
"conversationId": {
|
|
11459
|
+
"type": "string",
|
|
11460
|
+
"format": "uuid",
|
|
11461
|
+
"description": "Identifier of the conversation that started this flow"
|
|
11462
|
+
}
|
|
11463
|
+
},
|
|
11464
|
+
"required": [
|
|
11465
|
+
"conversationId"
|
|
11466
|
+
]
|
|
11467
|
+
}
|
|
11468
|
+
}
|
|
11469
|
+
},
|
|
11470
|
+
"form": {
|
|
11471
|
+
"id": "conversation-trigger-properties",
|
|
11472
|
+
"title": "Conversation trigger",
|
|
11473
|
+
"sections": [
|
|
11474
|
+
{
|
|
11475
|
+
"id": "appearance",
|
|
11476
|
+
"title": "Appearance",
|
|
11477
|
+
"collapsible": true,
|
|
11478
|
+
"defaultExpanded": true,
|
|
11479
|
+
"fields": [
|
|
11480
|
+
{
|
|
11481
|
+
"name": "inputs.appearance.welcomeTitle",
|
|
11482
|
+
"type": "text",
|
|
11483
|
+
"label": "Welcome title"
|
|
11484
|
+
},
|
|
11485
|
+
{
|
|
11486
|
+
"name": "inputs.appearance.welcomeDescription",
|
|
11487
|
+
"type": "text",
|
|
11488
|
+
"label": "Welcome description"
|
|
11489
|
+
},
|
|
11490
|
+
{
|
|
11491
|
+
"name": "inputs.appearance.startingPrompts",
|
|
11492
|
+
"type": "custom",
|
|
11493
|
+
"component": "starting-prompts-editor",
|
|
11494
|
+
"label": "Starting prompts"
|
|
11495
|
+
},
|
|
11496
|
+
{
|
|
11497
|
+
"name": "inputs.appearance.personalWorkspaceConnectionsOnly",
|
|
11498
|
+
"type": "switch",
|
|
11499
|
+
"label": "Display personal workspace connections only",
|
|
11500
|
+
"description": "Displays only personal workspace connections in the chat's connection settings menu"
|
|
11501
|
+
}
|
|
11502
|
+
]
|
|
11503
|
+
}
|
|
11504
|
+
]
|
|
11505
|
+
},
|
|
11506
|
+
"toolbarExtensions": {
|
|
11507
|
+
"design": {
|
|
11508
|
+
"actions": [
|
|
11509
|
+
{
|
|
11510
|
+
"id": "change-trigger-type",
|
|
11511
|
+
"icon": "square-mouse-pointer",
|
|
11512
|
+
"label": "Change trigger type"
|
|
11513
|
+
}
|
|
11514
|
+
]
|
|
11515
|
+
}
|
|
11516
|
+
}
|
|
11517
|
+
},
|
|
11364
11518
|
"uipath.agent.conversational@1.6": {
|
|
11365
11519
|
"nodeType": "uipath.agent.conversational",
|
|
11366
11520
|
"version": "1.6",
|
package/dist/flow-node-type.d.ts
CHANGED
|
@@ -654,6 +654,8 @@ export interface FlowTriggerSerializeContext {
|
|
|
654
654
|
* wrote none.
|
|
655
655
|
*/
|
|
656
656
|
entryPointId(seed?: string): string;
|
|
657
|
+
/** A GUID minted from the flow's id, the root's id and `key`: stable across compiles, unlike the designer's random ones. */
|
|
658
|
+
stableId(key: string): string;
|
|
657
659
|
/** The connector library serialize was given, for a trigger that resolves a connector event. */
|
|
658
660
|
readonly library: SerializeOpts['library'];
|
|
659
661
|
/** What an event subscription's shared emission needs, as `FlowSerializeContext.events`. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The trigger family's rules: a schedule's interval,
|
|
3
|
-
* inputs decide (a form with no fields, a
|
|
4
|
-
* none). Moved from check.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md;
|
|
2
|
+
* The trigger family's rules: a schedule's interval, a conversation's starting
|
|
3
|
+
* prompts, and the rules a root's inputs decide (a form with no fields, a
|
|
4
|
+
* conversation or call that is passed none). Moved from check.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md;
|
|
5
5
|
* codes and messages unchanged.
|
|
6
6
|
*/
|
|
7
7
|
import type { DiagnosticCatalog } from '../../../core/nodes/family.js';
|
|
8
8
|
import type { FlowTriggerCheckContext } from '../../../flow-node-type.js';
|
|
9
|
-
import { type ScheduledInputs } from './spec.js';
|
|
9
|
+
import { type ScheduledInputs, type StartingPrompt } from './spec.js';
|
|
10
10
|
export declare const TRIGGER_DIAGNOSTICS: DiagnosticCatalog;
|
|
11
11
|
/**
|
|
12
12
|
* The ISO-8601 repeating-interval pattern, copied VERBATIM from the
|
|
@@ -57,3 +57,9 @@ export declare function fitsScheduleV12(every: string): boolean;
|
|
|
57
57
|
export declare function checkSchedule(spec: {
|
|
58
58
|
inputs?: ScheduledInputs;
|
|
59
59
|
} | undefined, ctx: FlowTriggerCheckContext): void;
|
|
60
|
+
/**
|
|
61
|
+
* A starting prompt the chat would drop: one with no display prompt has no chip
|
|
62
|
+
* label. The code is the designer's own validation rule's, so `check` and
|
|
63
|
+
* `validate` name the problem the same way.
|
|
64
|
+
*/
|
|
65
|
+
export declare function checkStartingPrompts(prompts: ReadonlyArray<string | StartingPrompt> | undefined, ctx: FlowTriggerCheckContext): void;
|
|
@@ -6,6 +6,7 @@ export const TRIGGER_DIAGNOSTICS = {
|
|
|
6
6
|
FORM_TRIGGER_NO_INPUTS: { severity: 'error', summary: 'a form trigger on a root with no inputs, so the form has no fields' },
|
|
7
7
|
TRIGGER_INPUTS_IGNORED: { severity: 'warning', summary: 'an entry point declares inputs its trigger never passes' },
|
|
8
8
|
SINGLE_CONVERSATION_TRIGGER: { severity: 'error', summary: 'a second root started by a conversation' },
|
|
9
|
+
CONVERSATION_TRIGGER_DISPLAY_PROMPT_REQUIRED: { severity: 'error', summary: 'a starting prompt with no display prompt, which the chat drops' },
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* The ISO-8601 repeating-interval pattern, copied VERBATIM from the
|
|
@@ -119,3 +120,17 @@ function nearestInterval(every) {
|
|
|
119
120
|
const word = INTERVAL_WORDS.find(([w]) => lower.includes(w));
|
|
120
121
|
return word ? `every: '${word[1]}'` : undefined;
|
|
121
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* A starting prompt the chat would drop: one with no display prompt has no chip
|
|
125
|
+
* label. The code is the designer's own validation rule's, so `check` and
|
|
126
|
+
* `validate` name the problem the same way.
|
|
127
|
+
*/
|
|
128
|
+
export function checkStartingPrompts(prompts, ctx) {
|
|
129
|
+
(prompts ?? []).forEach((prompt, index) => {
|
|
130
|
+
const display = typeof prompt === 'string' ? prompt : prompt?.displayPrompt;
|
|
131
|
+
if (typeof display === 'string' && display.trim() !== '')
|
|
132
|
+
return;
|
|
133
|
+
ctx.report('CONVERSATION_TRIGGER_DISPLAY_PROMPT_REQUIRED', `conversationTrigger(): starting prompt ${index + 1} has no display prompt, the label the chat shows on it, `
|
|
134
|
+
+ 'so the chat drops it. Give it a displayPrompt.', "startingPrompts: [{ displayPrompt: 'Renew my loans', actualPrompt: 'Renew every loan due this week.' }]");
|
|
135
|
+
});
|
|
136
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScheduledInputs, TriggerSpec } from './spec.js';
|
|
1
|
+
import type { ConversationAppearance, ScheduledInputs, TriggerSpec } from './spec.js';
|
|
2
2
|
/**
|
|
3
3
|
* The manual trigger, explicitly. Omitting `.trigger(...)` means exactly this —
|
|
4
4
|
* the factory exists so decompiled source can carry the trigger's exact
|
|
@@ -76,15 +76,31 @@ export declare function formTrigger(): TriggerSpec;
|
|
|
76
76
|
*
|
|
77
77
|
* The trigger publishes the conversation it started —
|
|
78
78
|
* `out('start', 'conversationId')` — which is what every conversational step
|
|
79
|
-
* is keyed by.
|
|
79
|
+
* is keyed by.
|
|
80
80
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
81
|
+
* What the chat looks like before the user types is the trigger's appearance:
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* .trigger(conversationTrigger({
|
|
85
|
+
* welcomeTitle: 'Library desk',
|
|
86
|
+
* welcomeDescription: 'Ask about loans, renewals and holds.',
|
|
87
|
+
* startingPrompts: ['Renew my loans', { displayPrompt: 'Place a hold', actualPrompt: 'I want to place a hold on a book.' }],
|
|
88
|
+
* }))
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* The trigger is written at 1.3, the platform's current version, which also
|
|
92
|
+
* writes `personalWorkspaceConnectionsOnly: true` as the designer does on a new
|
|
93
|
+
* trigger. A trigger pinned to 1.0 (`{ version: '1.0' }`, what decompile keeps
|
|
94
|
+
* for an older flow) has no appearance, and compile refuses one there
|
|
95
|
+
* (`CONVERSATION_TRIGGER_APPEARANCE_VERSION`). SDK releases before this one wrote
|
|
96
|
+
* 1.0 for an unpinned `conversationTrigger()`, so a source written against them
|
|
97
|
+
* now compiles to 1.3 with the switch on; pin `{ version: '1.0' }` to keep the
|
|
98
|
+
* old node.
|
|
84
99
|
*
|
|
100
|
+
* @param appearance - How the chat that starts the flow looks. Optional.
|
|
85
101
|
* @returns A trigger spec to pass to `.trigger(...)`.
|
|
86
102
|
*/
|
|
87
|
-
export declare function conversationTrigger(): TriggerSpec;
|
|
103
|
+
export declare function conversationTrigger(appearance?: ConversationAppearance): TriggerSpec;
|
|
88
104
|
/**
|
|
89
105
|
* Start the flow when a phone call comes IN (`core.trigger.voice`).
|
|
90
106
|
*
|
|
@@ -87,16 +87,32 @@ export function formTrigger() {
|
|
|
87
87
|
*
|
|
88
88
|
* The trigger publishes the conversation it started —
|
|
89
89
|
* `out('start', 'conversationId')` — which is what every conversational step
|
|
90
|
-
* is keyed by.
|
|
90
|
+
* is keyed by.
|
|
91
91
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* What the chat looks like before the user types is the trigger's appearance:
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* .trigger(conversationTrigger({
|
|
96
|
+
* welcomeTitle: 'Library desk',
|
|
97
|
+
* welcomeDescription: 'Ask about loans, renewals and holds.',
|
|
98
|
+
* startingPrompts: ['Renew my loans', { displayPrompt: 'Place a hold', actualPrompt: 'I want to place a hold on a book.' }],
|
|
99
|
+
* }))
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* The trigger is written at 1.3, the platform's current version, which also
|
|
103
|
+
* writes `personalWorkspaceConnectionsOnly: true` as the designer does on a new
|
|
104
|
+
* trigger. A trigger pinned to 1.0 (`{ version: '1.0' }`, what decompile keeps
|
|
105
|
+
* for an older flow) has no appearance, and compile refuses one there
|
|
106
|
+
* (`CONVERSATION_TRIGGER_APPEARANCE_VERSION`). SDK releases before this one wrote
|
|
107
|
+
* 1.0 for an unpinned `conversationTrigger()`, so a source written against them
|
|
108
|
+
* now compiles to 1.3 with the switch on; pin `{ version: '1.0' }` to keep the
|
|
109
|
+
* old node.
|
|
95
110
|
*
|
|
111
|
+
* @param appearance - How the chat that starts the flow looks. Optional.
|
|
96
112
|
* @returns A trigger spec to pass to `.trigger(...)`.
|
|
97
113
|
*/
|
|
98
|
-
export function conversationTrigger() {
|
|
99
|
-
return builtinTriggerSpec({ kind: 'conversation' });
|
|
114
|
+
export function conversationTrigger(appearance) {
|
|
115
|
+
return builtinTriggerSpec(appearance === undefined ? { kind: 'conversation' } : { kind: 'conversation', appearance });
|
|
100
116
|
}
|
|
101
117
|
/**
|
|
102
118
|
* Start the flow when a phone call comes IN (`core.trigger.voice`).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FlowTriggerType } from '../../../flow-node-type.js';
|
|
2
|
-
import { type ScheduledInputs } from './spec.js';
|
|
2
|
+
import { type ConversationAppearance, type ScheduledInputs } from './spec.js';
|
|
3
3
|
export type ManualTriggerSpec = {
|
|
4
4
|
kind: 'manual';
|
|
5
5
|
};
|
|
@@ -12,6 +12,7 @@ export type FormTriggerSpec = {
|
|
|
12
12
|
};
|
|
13
13
|
export type ConversationTriggerSpec = {
|
|
14
14
|
kind: 'conversation';
|
|
15
|
+
appearance?: ConversationAppearance;
|
|
15
16
|
};
|
|
16
17
|
export type VoiceTriggerSpec = {
|
|
17
18
|
kind: 'voice';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* The five built-in start triggers, one node type each: `manual()`
|
|
3
3
|
* (`core.trigger.manual`, the default), `scheduled()`, `formTrigger()`,
|
|
4
4
|
* `conversationTrigger()` and `voiceTrigger()`. All are bundled.
|
|
5
|
+
* A schedule and a conversation pick their version when the author pinned none.
|
|
5
6
|
*
|
|
6
7
|
* A trigger type owns its node's `inputs` and how it reads back. The pipeline
|
|
7
8
|
* owns the root: the node's id and label, the version it resolves, the edge to
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
16
17
|
*/
|
|
17
18
|
import { CompileRefusal } from '../../../core/compile-refusal.js';
|
|
18
|
-
import { checkSchedule, fitsScheduleV12, isIsoInterval } from './check.js';
|
|
19
|
+
import { checkSchedule, checkStartingPrompts, fitsScheduleV12, isIsoInterval } from './check.js';
|
|
19
20
|
import { SCHEDULE_PRESETS } from './spec.js';
|
|
20
21
|
/** A Quartz cron expression: 6–7 whitespace-separated fields, none of them an ISO `R/` interval. */
|
|
21
22
|
function isQuartz(every) {
|
|
@@ -223,13 +224,102 @@ export const formTriggerType = {
|
|
|
223
224
|
function platformStartedInputs(ctx) {
|
|
224
225
|
return { inputs: { entryPointId: ctx.root.isDefault ? ctx.root.id : ctx.entryPointId() } };
|
|
225
226
|
}
|
|
227
|
+
/** The conversation-trigger version an unpinned `conversationTrigger()` writes: the platform's current one, which has an appearance. */
|
|
228
|
+
const CONVERSATION_DEFAULT_VERSION = '1.3';
|
|
229
|
+
/** The only bundled conversation-trigger version with no `appearance` input. */
|
|
230
|
+
const CONVERSATION_NO_APPEARANCE_VERSION = '1.0';
|
|
231
|
+
/**
|
|
232
|
+
* The prompts as the designer stores them; a string is one whose label and text
|
|
233
|
+
* are the same. A minted id is keyed by the label, so reordering the prompts
|
|
234
|
+
* keeps each one's id; a repeated label is told apart by its occurrence.
|
|
235
|
+
*/
|
|
236
|
+
function startingPrompts(prompts, ctx) {
|
|
237
|
+
const seen = new Map();
|
|
238
|
+
return prompts.map((prompt) => {
|
|
239
|
+
const p = typeof prompt === 'string' ? { displayPrompt: prompt } : prompt;
|
|
240
|
+
const n = seen.get(p.displayPrompt) ?? 0;
|
|
241
|
+
seen.set(p.displayPrompt, n + 1);
|
|
242
|
+
return {
|
|
243
|
+
id: p.id ?? ctx.stableId(`startingPrompt:${JSON.stringify(p.displayPrompt)}:${n}`),
|
|
244
|
+
displayPrompt: p.displayPrompt,
|
|
245
|
+
actualPrompt: p.actualPrompt ?? p.displayPrompt,
|
|
246
|
+
};
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* The `appearance` input, in the definition's field order. The switch is always
|
|
251
|
+
* written: the designer seeds a new 1.3 trigger with its `inputDefaults`
|
|
252
|
+
* (`personalWorkspaceConnectionsOnly: true`).
|
|
253
|
+
*/
|
|
254
|
+
function appearanceInput(a, ctx) {
|
|
255
|
+
return {
|
|
256
|
+
...(a.welcomeTitle !== undefined ? { welcomeTitle: a.welcomeTitle } : {}),
|
|
257
|
+
...(a.welcomeDescription !== undefined ? { welcomeDescription: a.welcomeDescription } : {}),
|
|
258
|
+
...(a.startingPrompts !== undefined ? { startingPrompts: startingPrompts(a.startingPrompts, ctx) } : {}),
|
|
259
|
+
personalWorkspaceConnectionsOnly: a.personalWorkspaceConnectionsOnly ?? true,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* The appearance a node carries, as the spec spells it. A 1.0 node has none. A
|
|
264
|
+
* switch the node does not carry lifts as `false`, and so does a later node
|
|
265
|
+
* with no appearance at all: the designer adds the switch to new triggers only,
|
|
266
|
+
* so an older trigger moved to 1.3 still shows every connection, and leaving
|
|
267
|
+
* the switch out would recompile as `true`.
|
|
268
|
+
*/
|
|
269
|
+
function liftAppearance(node) {
|
|
270
|
+
const n = node;
|
|
271
|
+
const a = n.inputs?.appearance;
|
|
272
|
+
if (a === null || typeof a !== 'object') {
|
|
273
|
+
return n.typeVersion === CONVERSATION_NO_APPEARANCE_VERSION ? undefined : { personalWorkspaceConnectionsOnly: false };
|
|
274
|
+
}
|
|
275
|
+
const { welcomeTitle, welcomeDescription, startingPrompts, personalWorkspaceConnectionsOnly } = a;
|
|
276
|
+
const prompts = Array.isArray(startingPrompts)
|
|
277
|
+
? startingPrompts.filter((p) => p !== null && typeof p === 'object').map((p) => ({
|
|
278
|
+
...(typeof p.id === 'string' ? { id: p.id } : {}),
|
|
279
|
+
displayPrompt: typeof p.displayPrompt === 'string' ? p.displayPrompt : '',
|
|
280
|
+
...(typeof p.actualPrompt === 'string' && p.actualPrompt !== p.displayPrompt ? { actualPrompt: p.actualPrompt } : {}),
|
|
281
|
+
}))
|
|
282
|
+
: undefined;
|
|
283
|
+
return {
|
|
284
|
+
...(typeof welcomeTitle === 'string' ? { welcomeTitle } : {}),
|
|
285
|
+
...(typeof welcomeDescription === 'string' ? { welcomeDescription } : {}),
|
|
286
|
+
...(prompts !== undefined ? { startingPrompts: prompts } : {}),
|
|
287
|
+
personalWorkspaceConnectionsOnly: personalWorkspaceConnectionsOnly === true,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
226
290
|
export const conversationTriggerType = {
|
|
227
291
|
kind: 'conversation', typeName: 'core.trigger.conversation', factory: 'conversationTrigger',
|
|
228
292
|
onePerFlow: 'SINGLE_CONVERSATION_TRIGGER',
|
|
229
|
-
serialize: (
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
293
|
+
serialize: (spec, ctx) => {
|
|
294
|
+
const version = ctx.version ?? CONVERSATION_DEFAULT_VERSION;
|
|
295
|
+
if (version === CONVERSATION_NO_APPEARANCE_VERSION) {
|
|
296
|
+
if (spec.appearance !== undefined) {
|
|
297
|
+
throw new CompileRefusal('CONVERSATION_TRIGGER_APPEARANCE_VERSION', "conversationTrigger(): an appearance needs the trigger's 1.3 definition, but { version: '1.0' } was "
|
|
298
|
+
+ 'requested, and 1.0 has no appearance. Drop the version to write 1.3, or drop the appearance.');
|
|
299
|
+
}
|
|
300
|
+
return { version, ...platformStartedInputs(ctx) };
|
|
301
|
+
}
|
|
302
|
+
const { inputs } = platformStartedInputs(ctx);
|
|
303
|
+
return { version, inputs: { ...inputs, appearance: appearanceInput(spec.appearance ?? {}, ctx) } };
|
|
304
|
+
},
|
|
305
|
+
deserialize: (node) => {
|
|
306
|
+
const appearance = liftAppearance(node);
|
|
307
|
+
return appearance === undefined ? { kind: 'conversation' } : { kind: 'conversation', appearance };
|
|
308
|
+
},
|
|
309
|
+
// The switch's default is left out, so a trigger the designer just made prints as `conversationTrigger()`.
|
|
310
|
+
print: (spec, ctx) => {
|
|
311
|
+
const a = spec.appearance;
|
|
312
|
+
if (a === undefined)
|
|
313
|
+
return { factory: 'conversationTrigger' };
|
|
314
|
+
const options = Object.entries(a)
|
|
315
|
+
.filter(([k, v]) => v !== undefined && !(k === 'personalWorkspaceConnectionsOnly' && v === true))
|
|
316
|
+
.map(([k, v]) => [k, ctx.value(v)]);
|
|
317
|
+
return options.length === 0 ? { factory: 'conversationTrigger' } : { factory: 'conversationTrigger', options };
|
|
318
|
+
},
|
|
319
|
+
check: (spec, ctx) => {
|
|
320
|
+
inputsIgnored('conversation', 'conversationId', ctx);
|
|
321
|
+
checkStartingPrompts(spec.appearance?.startingPrompts, ctx);
|
|
322
|
+
},
|
|
233
323
|
};
|
|
234
324
|
export const voiceTriggerType = {
|
|
235
325
|
kind: 'voice', typeName: 'core.trigger.voice', factory: 'voiceTrigger',
|
|
@@ -40,6 +40,35 @@ export interface ScheduledInputs {
|
|
|
40
40
|
*/
|
|
41
41
|
every: ScheduleEvery;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* One suggestion the chat shows before the user types: a chip labelled
|
|
45
|
+
* `displayPrompt` that sends `actualPrompt` to the agent.
|
|
46
|
+
*/
|
|
47
|
+
export interface StartingPrompt {
|
|
48
|
+
/** The chip's label, what the user sees. Required: the chat drops a prompt without one. */
|
|
49
|
+
displayPrompt: string;
|
|
50
|
+
/** What the agent receives when the chip is clicked. Defaults to `displayPrompt`, as the designer does. */
|
|
51
|
+
actualPrompt?: string;
|
|
52
|
+
/** The prompt's identity in the designer. Minted from the flow and root when omitted; decompile spells it out. */
|
|
53
|
+
id?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* How the chat that starts a conversation-triggered flow looks: the
|
|
57
|
+
* conversation trigger's `appearance` (1.3), the same shape as an agent's.
|
|
58
|
+
*/
|
|
59
|
+
export interface ConversationAppearance {
|
|
60
|
+
/** The heading shown in an empty chat. */
|
|
61
|
+
welcomeTitle?: string;
|
|
62
|
+
/** The text under the heading. */
|
|
63
|
+
welcomeDescription?: string;
|
|
64
|
+
/** Suggestions shown before the user types. A string is a prompt whose label and text are the same. */
|
|
65
|
+
startingPrompts?: Array<string | StartingPrompt>;
|
|
66
|
+
/**
|
|
67
|
+
* Show only personal workspace connections in the chat's connection settings
|
|
68
|
+
* menu. Defaults to `true`, what the designer writes on a new trigger.
|
|
69
|
+
*/
|
|
70
|
+
personalWorkspaceConnectionsOnly?: boolean;
|
|
71
|
+
}
|
|
43
72
|
/**
|
|
44
73
|
* What starts the flow. Three options: the manual trigger (the default — omit
|
|
45
74
|
* `.trigger()`), a schedule, or a CONNECTOR EVENT.
|
|
@@ -56,6 +85,7 @@ export type TriggerSpec = {
|
|
|
56
85
|
kind: 'form';
|
|
57
86
|
} | {
|
|
58
87
|
kind: 'conversation';
|
|
88
|
+
appearance?: ConversationAppearance;
|
|
59
89
|
} | {
|
|
60
90
|
kind: 'voice';
|
|
61
91
|
};
|
package/dist/serialize.js
CHANGED
|
@@ -2608,6 +2608,7 @@ function serializeFlow(built, opts) {
|
|
|
2608
2608
|
root: at,
|
|
2609
2609
|
version: pin,
|
|
2610
2610
|
entryPointId: (seed = at.id) => stableId(`${built.id}:${seed}:entryPoint`),
|
|
2611
|
+
stableId: (key) => stableId(`${built.id}:${at.id}:${key}`),
|
|
2611
2612
|
library: opts.library,
|
|
2612
2613
|
events: eventEnv(opts),
|
|
2613
2614
|
resolveBinding: (name, attribute, where, target) => resolveBinding(opts, name, attribute, where, target),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.88.1",
|
|
4
4
|
"description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://docs.uipath.com/maestro",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"@types/node": "^22.7.0",
|
|
111
111
|
"esbuild": "^0.28.1"
|
|
112
112
|
},
|
|
113
|
-
"gitref": "
|
|
113
|
+
"gitref": "e607cf4e8792ff6639ffd7130a2c2c9f0a777197"
|
|
114
114
|
}
|