@uipath/maestro-builder-sdk 6.22.0 → 6.24.0
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 +117 -117
- package/dist/api-members.md +346 -346
- package/dist/check.js +0 -52
- package/dist/core/actions.d.ts +0 -240
- package/dist/core/actions.js +0 -137
- package/dist/core/typed-raw-node.js +0 -5
- package/dist/decompile.js +0 -71
- package/dist/flow-node-registry.js +3 -1
- package/dist/flow-sdk.d.ts +2 -0
- package/dist/flow-sdk.js +2 -0
- package/dist/nodes/ai-patterns/flow/factories.d.ts +83 -0
- package/dist/nodes/ai-patterns/flow/factories.js +86 -0
- package/dist/nodes/ai-patterns/flow/family.d.ts +3 -0
- package/dist/nodes/ai-patterns/flow/family.js +8 -0
- package/dist/nodes/ai-patterns/flow/index.d.ts +3 -0
- package/dist/nodes/ai-patterns/flow/index.js +3 -0
- package/dist/nodes/ai-patterns/flow/node-type.d.ts +11 -0
- package/dist/nodes/ai-patterns/flow/node-type.js +106 -0
- package/dist/nodes/ai-patterns/flow/spec.d.ts +75 -0
- package/dist/nodes/ai-patterns/flow/spec.js +1 -0
- package/dist/nodes/conversation/flow/check.d.ts +17 -0
- package/dist/nodes/conversation/flow/check.js +54 -0
- package/dist/nodes/conversation/flow/factories.d.ts +58 -0
- package/dist/nodes/conversation/flow/factories.js +63 -0
- package/dist/nodes/conversation/flow/family.d.ts +3 -0
- package/dist/nodes/conversation/flow/family.js +8 -0
- package/dist/nodes/conversation/flow/index.d.ts +3 -0
- package/dist/nodes/conversation/flow/index.js +3 -0
- package/dist/nodes/conversation/flow/node-type.d.ts +14 -0
- package/dist/nodes/conversation/flow/node-type.js +117 -0
- package/dist/nodes/conversation/flow/spec.d.ts +60 -0
- package/dist/nodes/conversation/flow/spec.js +1 -0
- package/dist/serialize.js +0 -88
- package/package.json +2 -2
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three conversational node types: `uipath.conversational.send-message`
|
|
3
|
+
* (1.0, 1.1), `.wait-for-message` (1.0, 1.1) and `.get-conversation-context`
|
|
4
|
+
* (1.0). Moved from serialize.ts / check.ts / decompile.ts in Phase 4 of
|
|
5
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; serialized output, printed source,
|
|
6
|
+
* codes and messages unchanged.
|
|
7
|
+
*/
|
|
8
|
+
import { Expr, toExpr } from '../../../core/expr.js';
|
|
9
|
+
import { jsonClone } from '../../../core/json-file.js';
|
|
10
|
+
import { checkConversational } from './check.js';
|
|
11
|
+
/**
|
|
12
|
+
* The definition's `inputDefaults`, which supply the fixed fields the platform's
|
|
13
|
+
* schema requires (`role: 'assistant'` and `mimeType: 'text/markdown'` on send,
|
|
14
|
+
* `from: 'User'` on wait) — the author never writes a value the enum only allows
|
|
15
|
+
* one of. Always the 1.0 definition's, whatever version is emitted: that is what
|
|
16
|
+
* the pipeline wrote before the port (its `defByType` holds the first bundled
|
|
17
|
+
* copy), so a 1.1 step still carries 1.0's `endExchange` / `numExchanges` keys.
|
|
18
|
+
*/
|
|
19
|
+
function defaults(ctx, typeName) {
|
|
20
|
+
return jsonClone(ctx.definition(typeName, '1.0')?.inputDefaults ?? {});
|
|
21
|
+
}
|
|
22
|
+
/** A value rendered as the file stores it; a bare literal is wrapped first, as the pipeline did. */
|
|
23
|
+
const rendered = (ctx, v) => ctx.render(toExpr(v));
|
|
24
|
+
/**
|
|
25
|
+
* A serialized value as the author wrote it. Decompile's own reading: the text of
|
|
26
|
+
* a string, or of an envelope's `expression`; `=js:` and a bare `$vars.` path are
|
|
27
|
+
* references, anything else a literal string.
|
|
28
|
+
*/
|
|
29
|
+
function lifted(x, ctx) {
|
|
30
|
+
const raw = typeof x === 'string' ? x : String(x?.expression ?? x ?? '');
|
|
31
|
+
if (raw.startsWith('=js:'))
|
|
32
|
+
return ctx.expr(raw);
|
|
33
|
+
if (raw.startsWith('$vars.'))
|
|
34
|
+
return ctx.expr(`=js:${raw}`);
|
|
35
|
+
return raw;
|
|
36
|
+
}
|
|
37
|
+
/** A number, or undefined for an absent or non-finite one. */
|
|
38
|
+
function liftedNumber(x) {
|
|
39
|
+
if (x === undefined || x === null)
|
|
40
|
+
return undefined;
|
|
41
|
+
const n = Number(x?.expression ?? x);
|
|
42
|
+
return Number.isFinite(n) ? n : undefined;
|
|
43
|
+
}
|
|
44
|
+
const printed = (v, ctx) => (v instanceof Expr ? ctx.value(v) : ctx.string(String(v)));
|
|
45
|
+
function conversationAt(kind, typeName, version) {
|
|
46
|
+
return {
|
|
47
|
+
kind, typeName, version, factory: kind, definition: 'bundled',
|
|
48
|
+
rawNode: { factory: `${kind}()` },
|
|
49
|
+
serialize: (spec, ctx) => {
|
|
50
|
+
const i = spec.inputs;
|
|
51
|
+
const base = { ...defaults(ctx, typeName), conversationId: rendered(ctx, i.conversationId) };
|
|
52
|
+
const inputs = kind === 'sendMessage'
|
|
53
|
+
? {
|
|
54
|
+
...base,
|
|
55
|
+
exchangeId: rendered(ctx, i.exchangeId),
|
|
56
|
+
content: rendered(ctx, i.content),
|
|
57
|
+
...(i.endExchange !== undefined ? { endExchange: i.endExchange } : {}),
|
|
58
|
+
}
|
|
59
|
+
: kind === 'waitForMessage'
|
|
60
|
+
? { ...base, ...(i.numExchanges !== undefined ? { numExchanges: i.numExchanges } : {}) }
|
|
61
|
+
: { ...base, ...(i.exchangeLimit !== undefined ? { exchangeLimit: i.exchangeLimit } : {}) };
|
|
62
|
+
// The service model stays on the DEFINITION only: these are
|
|
63
|
+
// `bpmn:ServiceTask` / `bpmn:IntermediateCatchEvent` nodes whose
|
|
64
|
+
// serviceType the platform resolves from `definitions[]`.
|
|
65
|
+
return { model: 'omit', inputs, port: 'output' };
|
|
66
|
+
},
|
|
67
|
+
// The fixed enum fields come from the definition's defaults, so nothing of
|
|
68
|
+
// them is recovered — only what an author could have written.
|
|
69
|
+
deserialize: (node, ctx) => {
|
|
70
|
+
const i = (node.inputs ?? {});
|
|
71
|
+
const conversationId = lifted(i.conversationId, ctx);
|
|
72
|
+
if (kind === 'sendMessage') {
|
|
73
|
+
return {
|
|
74
|
+
kind,
|
|
75
|
+
inputs: {
|
|
76
|
+
conversationId,
|
|
77
|
+
exchangeId: lifted(i.exchangeId, ctx),
|
|
78
|
+
content: lifted(i.content, ctx),
|
|
79
|
+
// The definition defaults `endExchange` to false; only a departure was authored.
|
|
80
|
+
...(i.endExchange === true ? { endExchange: true } : {}),
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const field = kind === 'waitForMessage' ? 'numExchanges' : 'exchangeLimit';
|
|
85
|
+
const n = liftedNumber(i[field]);
|
|
86
|
+
return { kind, inputs: { conversationId, ...(n !== undefined && n !== 20 ? { [field]: n } : {}) } };
|
|
87
|
+
},
|
|
88
|
+
print: (spec, ctx) => {
|
|
89
|
+
const i = spec.inputs;
|
|
90
|
+
const cid = ['conversationId', printed(i.conversationId, ctx)];
|
|
91
|
+
if (kind === 'sendMessage') {
|
|
92
|
+
return {
|
|
93
|
+
factory: kind,
|
|
94
|
+
options: [cid, ['exchangeId', printed(i.exchangeId, ctx)], ['content', printed(i.content, ctx)],
|
|
95
|
+
['endExchange', i.endExchange === true ? 'true' : undefined]],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const field = kind === 'waitForMessage' ? 'numExchanges' : 'exchangeLimit';
|
|
99
|
+
return { factory: kind, options: [cid, [field, i[field] !== undefined ? ctx.json(i[field]) : undefined]] };
|
|
100
|
+
},
|
|
101
|
+
check: (spec, ctx) => checkConversational(kind, spec.inputs, ctx),
|
|
102
|
+
// check collected no expressions for a conversational step before the port; unchanged by it.
|
|
103
|
+
expressions: () => [],
|
|
104
|
+
output: () => ({ kind: 'opaque' }),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function conversationType(kind, typeName, versions) {
|
|
108
|
+
return {
|
|
109
|
+
kind, typeName, factory: kind, defaultVersion: '1.0',
|
|
110
|
+
versions: Object.fromEntries(versions.map((v) => [v, conversationAt(kind, typeName, v)])),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export const conversationNodeTypes = [
|
|
114
|
+
conversationType('sendMessage', 'uipath.conversational.send-message', ['1.0', '1.1']),
|
|
115
|
+
conversationType('waitForMessage', 'uipath.conversational.wait-for-message', ['1.0', '1.1']),
|
|
116
|
+
conversationType('conversationContext', 'uipath.conversational.get-conversation-context', ['1.0']),
|
|
117
|
+
];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversation family's authoring types (`uipath.conversational.send-message`,
|
|
3
|
+
* `.wait-for-message`, `.get-conversation-context`), and their kinds' entries in
|
|
4
|
+
* `FlowActionSpecs`. Moved from core/actions.ts in Phase 4 of
|
|
5
|
+
* docs/NODE_TYPE_ARCHITECTURE_DESIGN.md.
|
|
6
|
+
*/
|
|
7
|
+
import type { Expr } from '../../../core/expr.js';
|
|
8
|
+
export interface SendMessageInputs {
|
|
9
|
+
/**
|
|
10
|
+
* The conversation to post into — from the conversation trigger
|
|
11
|
+
* (`out('start', 'conversationId')`) or a context read. Required.
|
|
12
|
+
*/
|
|
13
|
+
conversationId: string | Expr;
|
|
14
|
+
/**
|
|
15
|
+
* The exchange (one user turn plus its answers) the message belongs to —
|
|
16
|
+
* `out('<waitStep>', 'conversationContext.latestExchangeId')`, or the
|
|
17
|
+
* trigger's exchange for the first answer. Required by the node's schema.
|
|
18
|
+
*/
|
|
19
|
+
exchangeId: string | Expr;
|
|
20
|
+
/** What to say. Markdown — the node's only supported `mimeType`. Required. */
|
|
21
|
+
content: string | Expr;
|
|
22
|
+
/**
|
|
23
|
+
* Whether this message CLOSES the exchange. The platform's legacy default is
|
|
24
|
+
* to end it; pass `false` to keep the exchange open for another message.
|
|
25
|
+
*/
|
|
26
|
+
endExchange?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface WaitForMessageInputs {
|
|
29
|
+
/** The conversation to wait on. Required. */
|
|
30
|
+
conversationId: string | Expr;
|
|
31
|
+
/**
|
|
32
|
+
* How many past exchanges the returned context carries. 1–40 in the
|
|
33
|
+
* designer; the platform default is 20.
|
|
34
|
+
*/
|
|
35
|
+
numExchanges?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ConversationContextInputs {
|
|
38
|
+
/** The conversation to read. Required. */
|
|
39
|
+
conversationId: string | Expr;
|
|
40
|
+
/**
|
|
41
|
+
* How many exchanges to return, 1–40. The platform default is 20.
|
|
42
|
+
*/
|
|
43
|
+
exchangeLimit?: number;
|
|
44
|
+
}
|
|
45
|
+
declare module '../../../core/actions.js' {
|
|
46
|
+
interface FlowActionSpecs {
|
|
47
|
+
/** The spec {@link sendMessage} builds. */
|
|
48
|
+
sendMessage: {
|
|
49
|
+
inputs: SendMessageInputs;
|
|
50
|
+
};
|
|
51
|
+
/** The spec {@link waitForMessage} builds. */
|
|
52
|
+
waitForMessage: {
|
|
53
|
+
inputs: WaitForMessageInputs;
|
|
54
|
+
};
|
|
55
|
+
/** The spec {@link conversationContext} builds. */
|
|
56
|
+
conversationContext: {
|
|
57
|
+
inputs: ConversationContextInputs;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/serialize.js
CHANGED
|
@@ -90,9 +90,6 @@ const NODE_TYPE = {
|
|
|
90
90
|
scheduledTrigger: 'core.trigger.scheduled',
|
|
91
91
|
formTrigger: 'core.trigger.form',
|
|
92
92
|
conversationTrigger: 'core.trigger.conversation',
|
|
93
|
-
sendMessage: 'uipath.conversational.send-message',
|
|
94
|
-
waitForMessage: 'uipath.conversational.wait-for-message',
|
|
95
|
-
conversationContext: 'uipath.conversational.get-conversation-context',
|
|
96
93
|
voiceTrigger: 'core.trigger.voice',
|
|
97
94
|
voiceAgent: 'uipath.agent.voice',
|
|
98
95
|
conversationalAgent: 'uipath.agent.conversational',
|
|
@@ -119,11 +116,6 @@ const NODE_TYPE = {
|
|
|
119
116
|
doWhile: 'core.logic.dowhile',
|
|
120
117
|
subflow: 'core.subflow',
|
|
121
118
|
terminate: 'core.logic.terminate',
|
|
122
|
-
// The two AI patterns. `summarize()` emits `deep-rag`: the canvas name is
|
|
123
|
-
// "Summarize", the wire type is the backend's (`ECS.DeepRag`), and there is
|
|
124
|
-
// no `uipath.pattern.summarize` node type at all.
|
|
125
|
-
summarize: 'uipath.pattern.deep-rag',
|
|
126
|
-
batchTransform: 'uipath.pattern.batch-transform',
|
|
127
119
|
end: 'core.control.end',
|
|
128
120
|
};
|
|
129
121
|
/**
|
|
@@ -3640,11 +3632,6 @@ export function bundledActionNodeType(spec) {
|
|
|
3640
3632
|
case 'hitl': return hitlNodeType(spec.inputs);
|
|
3641
3633
|
case 'inlineAgent': return INLINE_AGENT_TYPE;
|
|
3642
3634
|
case 'subflow':
|
|
3643
|
-
case 'summarize':
|
|
3644
|
-
case 'batchTransform':
|
|
3645
|
-
case 'sendMessage':
|
|
3646
|
-
case 'waitForMessage':
|
|
3647
|
-
case 'conversationContext':
|
|
3648
3635
|
case 'createOutgoingCall':
|
|
3649
3636
|
case 'endCall':
|
|
3650
3637
|
case 'voiceAgent':
|
|
@@ -6027,81 +6014,6 @@ export function serialize(built, opts = {}) {
|
|
|
6027
6014
|
addEdge(scope, t, id);
|
|
6028
6015
|
return [{ node: id, port: successPort(NODE_TYPE.voiceAgent) }];
|
|
6029
6016
|
}
|
|
6030
|
-
if (spec.kind === 'sendMessage' || spec.kind === 'waitForMessage' || spec.kind === 'conversationContext') {
|
|
6031
|
-
// One emit path for the three CONVERSATIONAL steps: they differ in their
|
|
6032
|
-
// definition and in which fields they carry. Each field is written under
|
|
6033
|
-
// the node's own name, and the definition's `inputDefaults` supply the
|
|
6034
|
-
// fixed ones the platform's schema requires (`role: 'assistant'` and
|
|
6035
|
-
// `mimeType: 'text/markdown'` on send, `from: 'User'` on wait) — the
|
|
6036
|
-
// author never writes a value the enum only allows one of.
|
|
6037
|
-
const type = spec.kind === 'sendMessage' ? NODE_TYPE.sendMessage
|
|
6038
|
-
: spec.kind === 'waitForMessage' ? NODE_TYPE.waitForMessage
|
|
6039
|
-
: NODE_TYPE.conversationContext;
|
|
6040
|
-
const id = stepUid(scope, step.name);
|
|
6041
|
-
const node = makeNode(type, id, step.name, { parentId, requestedVersion: step.options?.version });
|
|
6042
|
-
// The service model stays on the DEFINITION only, as it does for the AI
|
|
6043
|
-
// patterns and the published families: these are `bpmn:ServiceTask` /
|
|
6044
|
-
// `bpmn:IntermediateCatchEvent` nodes whose serviceType the platform
|
|
6045
|
-
// resolves from `definitions[]`.
|
|
6046
|
-
delete node.model;
|
|
6047
|
-
const defaults = jsonClone(defByType.get(type)?.inputDefaults ?? {});
|
|
6048
|
-
node.inputs = spec.kind === 'sendMessage'
|
|
6049
|
-
? {
|
|
6050
|
-
...defaults,
|
|
6051
|
-
conversationId: renderValue(toExpr(spec.inputs.conversationId), scope.rename),
|
|
6052
|
-
exchangeId: renderValue(toExpr(spec.inputs.exchangeId), scope.rename),
|
|
6053
|
-
content: renderValue(toExpr(spec.inputs.content), scope.rename),
|
|
6054
|
-
...(spec.inputs.endExchange !== undefined ? { endExchange: spec.inputs.endExchange } : {}),
|
|
6055
|
-
}
|
|
6056
|
-
: spec.kind === 'waitForMessage'
|
|
6057
|
-
? {
|
|
6058
|
-
...defaults,
|
|
6059
|
-
conversationId: renderValue(toExpr(spec.inputs.conversationId), scope.rename),
|
|
6060
|
-
...(spec.inputs.numExchanges !== undefined ? { numExchanges: spec.inputs.numExchanges } : {}),
|
|
6061
|
-
}
|
|
6062
|
-
: {
|
|
6063
|
-
...defaults,
|
|
6064
|
-
conversationId: renderValue(toExpr(spec.inputs.conversationId), scope.rename),
|
|
6065
|
-
...(spec.inputs.exchangeLimit !== undefined ? { exchangeLimit: spec.inputs.exchangeLimit } : {}),
|
|
6066
|
-
};
|
|
6067
|
-
scope.nodes.push(node);
|
|
6068
|
-
for (const t of tails)
|
|
6069
|
-
addEdge(scope, t, id);
|
|
6070
|
-
return [{ node: id, port: successPort(type) }];
|
|
6071
|
-
}
|
|
6072
|
-
if (spec.kind === 'summarize' || spec.kind === 'batchTransform') {
|
|
6073
|
-
// One emit path for both AI patterns: they differ in their definition and
|
|
6074
|
-
// in which input fields they carry, and in nothing else. Each field is
|
|
6075
|
-
// written under the NODE's own name, so the surface and the emitted file
|
|
6076
|
-
// read alike.
|
|
6077
|
-
const type = spec.kind === 'summarize' ? NODE_TYPE.summarize : NODE_TYPE.batchTransform;
|
|
6078
|
-
const id = stepUid(scope, step.name);
|
|
6079
|
-
const node = makeNode(type, id, step.name, { parentId, requestedVersion: step.options?.version });
|
|
6080
|
-
// The resource model stays on the DEFINITION only. Both node types are
|
|
6081
|
-
// `bpmn:ServiceTask`s whose `serviceType` the platform resolves from
|
|
6082
|
-
// `definitions[]`, and every deployed instance of either carries no
|
|
6083
|
-
// node-level `model` — v1's own structural checker fails a flow that has
|
|
6084
|
-
// one. Same reason the three process-resource families delete theirs.
|
|
6085
|
-
delete node.model;
|
|
6086
|
-
node.inputs = spec.kind === 'summarize'
|
|
6087
|
-
? {
|
|
6088
|
-
attachment: renderValue(spec.inputs.attachment, scope.rename),
|
|
6089
|
-
prompt: renderValue(spec.inputs.prompt, scope.rename),
|
|
6090
|
-
returnCitations: spec.inputs.returnCitations ?? false,
|
|
6091
|
-
}
|
|
6092
|
-
: {
|
|
6093
|
-
attachment: renderValue(spec.inputs.attachment, scope.rename),
|
|
6094
|
-
prompt: renderValue(spec.inputs.prompt, scope.rename),
|
|
6095
|
-
enableWebSearchGrounding: spec.inputs.enableWebSearchGrounding ?? false,
|
|
6096
|
-
// Written through renderMap per column so an expression in a
|
|
6097
|
-
// description renders like every other input.
|
|
6098
|
-
outputColumns: spec.inputs.outputColumns.map((c) => renderMap(c, scope.rename)),
|
|
6099
|
-
};
|
|
6100
|
-
scope.nodes.push(node);
|
|
6101
|
-
for (const t of tails)
|
|
6102
|
-
addEdge(scope, t, id);
|
|
6103
|
-
return [{ node: id, port: successPort(type) }];
|
|
6104
|
-
}
|
|
6105
6017
|
if (spec.kind === 'ixpExtract') {
|
|
6106
6018
|
const s = spec.inputs;
|
|
6107
6019
|
const def = perCallDefinition(spec); // ixpExtractDef: throws on an unparseable project
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-builder-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.24.0",
|
|
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",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"@types/node": "^22.7.0",
|
|
93
93
|
"esbuild": "^0.28.1"
|
|
94
94
|
},
|
|
95
|
-
"gitref": "
|
|
95
|
+
"gitref": "a3e8314b01bff6cf76316765840e31bd2e3860e5"
|
|
96
96
|
}
|