@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
package/dist/check.js
CHANGED
|
@@ -453,10 +453,6 @@ function checkFlow(built, ancestors, opts = {}) {
|
|
|
453
453
|
if (s.spec.kind === 'publishedFunction') {
|
|
454
454
|
checkPublishedFunction(s.name, s.spec.inputs, diags);
|
|
455
455
|
}
|
|
456
|
-
if (s.spec.kind === 'sendMessage' || s.spec.kind === 'waitForMessage'
|
|
457
|
-
|| s.spec.kind === 'conversationContext') {
|
|
458
|
-
checkConversational(s.name, s.spec.kind, s.spec.inputs, diags);
|
|
459
|
-
}
|
|
460
456
|
if (s.spec.kind === 'createOutgoingCall' || s.spec.kind === 'endCall' || s.spec.kind === 'voiceAgent') {
|
|
461
457
|
checkVoice(s.name, s.spec.kind, s.spec.inputs, diags);
|
|
462
458
|
}
|
|
@@ -2283,54 +2279,6 @@ function checkVoice(step, kind, inputs, diags) {
|
|
|
2283
2279
|
}
|
|
2284
2280
|
}
|
|
2285
2281
|
}
|
|
2286
|
-
/**
|
|
2287
|
-
* A conversational step (Phase 5C): send-message, wait-for-message, or
|
|
2288
|
-
* get-conversation-context.
|
|
2289
|
-
*
|
|
2290
|
-
* Everything here is decidable offline and invisible later: the node's own
|
|
2291
|
-
* schema requires `conversationId` (and `exchangeId`/`content` on send), and
|
|
2292
|
-
* the two numeric limits are range-checked by the designer but silently
|
|
2293
|
-
* clamped at run time.
|
|
2294
|
-
*/
|
|
2295
|
-
function checkConversational(step, kind, inputs, diags) {
|
|
2296
|
-
const at = (code, message, suggestion) => {
|
|
2297
|
-
diags.push({ level: 'error', code, message, step, ...(suggestion ? { suggestion } : {}) });
|
|
2298
|
-
};
|
|
2299
|
-
const blank = (v) => v === undefined || v === null || (typeof v === 'string' && v.trim() === '');
|
|
2300
|
-
const label = kind === 'sendMessage' ? 'sendMessage'
|
|
2301
|
-
: kind === 'waitForMessage' ? 'waitForMessage' : 'conversationContext';
|
|
2302
|
-
if (blank(inputs?.conversationId)) {
|
|
2303
|
-
at('CONVERSATION_NO_ID', `${label} step "${step}" has no \`conversationId\`, which the node's schema requires — every `
|
|
2304
|
-
+ `conversational step is keyed by the conversation it belongs to. The conversation trigger publishes `
|
|
2305
|
-
+ `it as out('start', 'conversationId').`, `conversationId: out('start', 'conversationId')`);
|
|
2306
|
-
}
|
|
2307
|
-
if (kind === 'sendMessage') {
|
|
2308
|
-
if (blank(inputs?.exchangeId)) {
|
|
2309
|
-
at('SEND_MESSAGE_NO_EXCHANGE', `sendMessage step "${step}" has no \`exchangeId\` — the node's schema requires it, because a message `
|
|
2310
|
-
+ `belongs to one exchange (a user turn and its answers). A wait step publishes it as `
|
|
2311
|
-
+ `out('<waitStep>', 'conversationContext.latestExchangeId').`, `exchangeId: out('<waitStep>', 'conversationContext.latestExchangeId')`);
|
|
2312
|
-
}
|
|
2313
|
-
if (blank(inputs?.content)) {
|
|
2314
|
-
at('SEND_MESSAGE_NO_CONTENT', `sendMessage step "${step}" has no \`content\` — the node's schema requires a non-empty message `
|
|
2315
|
-
+ `(Markdown), and an empty one posts a blank turn into the conversation.`, `content: 'Looking into it.'`);
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
const rangeCheck = (field, max) => {
|
|
2319
|
-
const raw = inputs?.[field];
|
|
2320
|
-
if (raw === undefined || raw instanceof Expr)
|
|
2321
|
-
return;
|
|
2322
|
-
const n = Number(raw);
|
|
2323
|
-
if (!Number.isFinite(n) || !Number.isInteger(n) || n < 1 || n > max) {
|
|
2324
|
-
at('CONVERSATION_RANGE', `${label} step "${step}"'s \`${field}\` is ${JSON.stringify(raw)}. The node accepts a whole number from `
|
|
2325
|
-
+ `1 to ${max} (the platform default is 20); anything else is clamped at run time, so the flow reads `
|
|
2326
|
-
+ `a different amount of history than it says.`, `${field}: 20`);
|
|
2327
|
-
}
|
|
2328
|
-
};
|
|
2329
|
-
if (kind === 'waitForMessage')
|
|
2330
|
-
rangeCheck('numExchanges', 40);
|
|
2331
|
-
if (kind === 'conversationContext')
|
|
2332
|
-
rangeCheck('exchangeLimit', 40);
|
|
2333
|
-
}
|
|
2334
2282
|
/**
|
|
2335
2283
|
* A published FUNCTION step (Phase 5B).
|
|
2336
2284
|
*
|
package/dist/core/actions.d.ts
CHANGED
|
@@ -354,43 +354,6 @@ export interface HitlInputs {
|
|
|
354
354
|
*/
|
|
355
355
|
document?: DocValidationInputs;
|
|
356
356
|
}
|
|
357
|
-
export interface SendMessageInputs {
|
|
358
|
-
/**
|
|
359
|
-
* The conversation to post into — from the conversation trigger
|
|
360
|
-
* (`out('start', 'conversationId')`) or a context read. Required.
|
|
361
|
-
*/
|
|
362
|
-
conversationId: string | Expr;
|
|
363
|
-
/**
|
|
364
|
-
* The exchange (one user turn plus its answers) the message belongs to —
|
|
365
|
-
* `out('<waitStep>', 'conversationContext.latestExchangeId')`, or the
|
|
366
|
-
* trigger's exchange for the first answer. Required by the node's schema.
|
|
367
|
-
*/
|
|
368
|
-
exchangeId: string | Expr;
|
|
369
|
-
/** What to say. Markdown — the node's only supported `mimeType`. Required. */
|
|
370
|
-
content: string | Expr;
|
|
371
|
-
/**
|
|
372
|
-
* Whether this message CLOSES the exchange. The platform's legacy default is
|
|
373
|
-
* to end it; pass `false` to keep the exchange open for another message.
|
|
374
|
-
*/
|
|
375
|
-
endExchange?: boolean;
|
|
376
|
-
}
|
|
377
|
-
export interface WaitForMessageInputs {
|
|
378
|
-
/** The conversation to wait on. Required. */
|
|
379
|
-
conversationId: string | Expr;
|
|
380
|
-
/**
|
|
381
|
-
* How many past exchanges the returned context carries. 1–40 in the
|
|
382
|
-
* designer; the platform default is 20.
|
|
383
|
-
*/
|
|
384
|
-
numExchanges?: number;
|
|
385
|
-
}
|
|
386
|
-
export interface ConversationContextInputs {
|
|
387
|
-
/** The conversation to read. Required. */
|
|
388
|
-
conversationId: string | Expr;
|
|
389
|
-
/**
|
|
390
|
-
* How many exchanges to return, 1–40. The platform default is 20.
|
|
391
|
-
*/
|
|
392
|
-
exchangeLimit?: number;
|
|
393
|
-
}
|
|
394
357
|
/**
|
|
395
358
|
* How a conversational agent gets its turn — the node's own
|
|
396
359
|
* `conversationalAgentSettings` sub-object.
|
|
@@ -536,62 +499,6 @@ export interface VoiceAgentInputs {
|
|
|
536
499
|
*/
|
|
537
500
|
source?: string;
|
|
538
501
|
}
|
|
539
|
-
export interface SummarizeInputs {
|
|
540
|
-
/**
|
|
541
|
-
* The document to summarize — a whole **Flow Attachment** object
|
|
542
|
-
* (`{ ID, FullName, MimeType, Metadata }`), not a path, id or URL.
|
|
543
|
-
*
|
|
544
|
-
* In practice that is a `file`-typed flow input:
|
|
545
|
-
*
|
|
546
|
-
* ```ts
|
|
547
|
-
* flow('SummarizeDemo')
|
|
548
|
-
* .input({ documentFile: types.file })
|
|
549
|
-
* .step('summarizeContract', summarize({ attachment: input('documentFile'), … }))
|
|
550
|
-
* ```
|
|
551
|
-
*
|
|
552
|
-
* `out('start', 'documentFile')` is the same value written the way the CANVAS
|
|
553
|
-
* writes it (`$vars.start.output.documentFile`, resolved through the input's
|
|
554
|
-
* `triggerNodeId` binding). Both forms run — measured on the real service —
|
|
555
|
-
* so prefer whichever the task asks for; `out('start', …)` is what a
|
|
556
|
-
* designer-made flow looks like.
|
|
557
|
-
*
|
|
558
|
-
* The service reads the file's CONTENT, and refuses one it cannot treat as a
|
|
559
|
-
* document: a PDF summarizes, a plain `.txt` comes back
|
|
560
|
-
* `[460005] … "No valid files to use for Summarization."`
|
|
561
|
-
*/
|
|
562
|
-
attachment: Expr;
|
|
563
|
-
/** What the summary should cover, e.g. `'Write a 5-bullet executive summary…'`. */
|
|
564
|
-
prompt: string | Expr;
|
|
565
|
-
/**
|
|
566
|
-
* Ask the service for per-claim citations. Each is
|
|
567
|
-
* `{ Ordinal, PageNumber, Source, Reference }` and lands in
|
|
568
|
-
* `out('<step>', 'content.Citations')`. Defaults to `false`.
|
|
569
|
-
*/
|
|
570
|
-
returnCitations?: boolean;
|
|
571
|
-
}
|
|
572
|
-
/** One column Batch Transform appends to the CSV. */
|
|
573
|
-
export interface OutputColumn {
|
|
574
|
-
/** The new column's header, e.g. `'Category'`. */
|
|
575
|
-
name: string;
|
|
576
|
-
/** What the model should put in it, e.g. `'One of: Utility, Software, Travel, Other'`. */
|
|
577
|
-
description: string;
|
|
578
|
-
}
|
|
579
|
-
export interface BatchTransformInputs {
|
|
580
|
-
/**
|
|
581
|
-
* The CSV to enrich — a whole **Flow Attachment** object, same shape and same
|
|
582
|
-
* two ways of referencing it as {@link SummarizeInputs.attachment}.
|
|
583
|
-
*/
|
|
584
|
-
attachment: Expr;
|
|
585
|
-
/** How to process each row, e.g. `'Classify each row and write a one-line summary.'`. */
|
|
586
|
-
prompt: string | Expr;
|
|
587
|
-
/**
|
|
588
|
-
* The columns to add, in order. The node's own field name — an array of
|
|
589
|
-
* `{ name, description }`, one per new column.
|
|
590
|
-
*/
|
|
591
|
-
outputColumns: OutputColumn[];
|
|
592
|
-
/** Let the model use web search while transforming. Defaults to `false`. */
|
|
593
|
-
enableWebSearchGrounding?: boolean;
|
|
594
|
-
}
|
|
595
502
|
/**
|
|
596
503
|
* Split an extractor's node type into the two GUIDs its tail packs.
|
|
597
504
|
*
|
|
@@ -1809,18 +1716,6 @@ export interface FlowActionSpecs {
|
|
|
1809
1716
|
publishedFunction: {
|
|
1810
1717
|
inputs: PublishedFunctionInputs;
|
|
1811
1718
|
};
|
|
1812
|
-
/** The spec {@link sendMessage} builds. */
|
|
1813
|
-
sendMessage: {
|
|
1814
|
-
inputs: SendMessageInputs;
|
|
1815
|
-
};
|
|
1816
|
-
/** The spec {@link waitForMessage} builds. */
|
|
1817
|
-
waitForMessage: {
|
|
1818
|
-
inputs: WaitForMessageInputs;
|
|
1819
|
-
};
|
|
1820
|
-
/** The spec {@link conversationContext} builds. */
|
|
1821
|
-
conversationContext: {
|
|
1822
|
-
inputs: ConversationContextInputs;
|
|
1823
|
-
};
|
|
1824
1719
|
/** The spec {@link createOutgoingCall} builds. */
|
|
1825
1720
|
createOutgoingCall: {
|
|
1826
1721
|
inputs: CreateOutgoingCallInputs;
|
|
@@ -1849,14 +1744,6 @@ export interface FlowActionSpecs {
|
|
|
1849
1744
|
inlineAgent: {
|
|
1850
1745
|
inputs: InlineAgentInputs;
|
|
1851
1746
|
};
|
|
1852
|
-
/** The spec {@link summarize} builds. */
|
|
1853
|
-
summarize: {
|
|
1854
|
-
inputs: SummarizeInputs;
|
|
1855
|
-
};
|
|
1856
|
-
/** The spec {@link batchTransform} builds. */
|
|
1857
|
-
batchTransform: {
|
|
1858
|
-
inputs: BatchTransformInputs;
|
|
1859
|
-
};
|
|
1860
1747
|
/** The spec {@link ixpExtract} builds. */
|
|
1861
1748
|
ixpExtract: {
|
|
1862
1749
|
inputs: IxpExtractInputs;
|
|
@@ -1972,82 +1859,6 @@ export declare function builtinTriggerSpec<S extends object>(spec: S): S;
|
|
|
1972
1859
|
* @example example-eval/GallerySubmission.flow.ts
|
|
1973
1860
|
*/
|
|
1974
1861
|
export declare function hitl(inputs: HitlInputs): ActionSpec;
|
|
1975
|
-
/**
|
|
1976
|
-
* Summarize a document with citations — the platform's **Summarize** node.
|
|
1977
|
-
*
|
|
1978
|
-
* @remarks
|
|
1979
|
-
* **The node type is `uipath.pattern.deep-rag`.** The canvas calls it
|
|
1980
|
-
* *Summarize*, its properties panel is titled *Summarize Configuration*, and
|
|
1981
|
-
* the wire type stays `deep-rag` — it is the same node, under the name the
|
|
1982
|
-
* backend service contract uses (`ECS.DeepRag`). There is no
|
|
1983
|
-
* `uipath.pattern.summarize`. (A same-named inline-agent TOOL,
|
|
1984
|
-
* `uipath.agent.resource.tool.builtin.summarize`, is a different family.)
|
|
1985
|
-
*
|
|
1986
|
-
* The answer's fields are **PascalCase** — `content.Text`,
|
|
1987
|
-
* `content.Citations[].{Ordinal, PageNumber, Source, Reference}`. Lowercase
|
|
1988
|
-
* `content.text` resolves to nothing at run time.
|
|
1989
|
-
*
|
|
1990
|
-
* A local run cannot reach the service: it returns the baked
|
|
1991
|
-
* fixture shape, and only a real platform run (`uip maestro flow debug
|
|
1992
|
-
* --attachment <var>=<file>`) calls the model.
|
|
1993
|
-
*
|
|
1994
|
-
* @example
|
|
1995
|
-
* **Summarize an attached contract, with citations**
|
|
1996
|
-
* ```ts
|
|
1997
|
-
* flow('SummarizeDemo')
|
|
1998
|
-
* .input({ documentFile: types.file })
|
|
1999
|
-
* .output({ summary: types.string, citations: types.array })
|
|
2000
|
-
* .step('summarizeContract', summarize({
|
|
2001
|
-
* attachment: out('start', 'documentFile'),
|
|
2002
|
-
* prompt: 'Write a 5-bullet executive summary covering scope, term and SLAs.',
|
|
2003
|
-
* returnCitations: true,
|
|
2004
|
-
* }))
|
|
2005
|
-
* .return({
|
|
2006
|
-
* summary: out('summarizeContract', 'content.Text'),
|
|
2007
|
-
* citations: out('summarizeContract', 'content.Citations'),
|
|
2008
|
-
* })
|
|
2009
|
-
* ```
|
|
2010
|
-
*
|
|
2011
|
-
* @param inputs - The document (`attachment`), the question to answer (`prompt`),
|
|
2012
|
-
* and whether to return citations.
|
|
2013
|
-
* @returns An action spec to pass to `.step(name, …)`.
|
|
2014
|
-
*/
|
|
2015
|
-
export declare function summarize(inputs: SummarizeInputs): ActionSpec;
|
|
2016
|
-
/**
|
|
2017
|
-
* Add AI-generated columns to a CSV — the platform's **Batch transform** node,
|
|
2018
|
-
* `uipath.pattern.batch-transform` (service contract `ECS.BatchTransform`).
|
|
2019
|
-
*
|
|
2020
|
-
* @remarks
|
|
2021
|
-
* The output is a **file handle for the enriched CSV**, not the rows:
|
|
2022
|
-
* `{ ID, FullName, MimeType }` — the service writes a new
|
|
2023
|
-
* `batch-transform-<uuid>.csv` and hands back its attachment. Note `ID`, two
|
|
2024
|
-
* capitals: that is what the platform returns.
|
|
2025
|
-
*
|
|
2026
|
-
* Same dispatch story as {@link summarize} — dry-run fixture locally, a real
|
|
2027
|
-
* model call only on a platform run.
|
|
2028
|
-
*
|
|
2029
|
-
* @example
|
|
2030
|
-
* **Categorize each CSV row with two generated columns**
|
|
2031
|
-
* ```ts
|
|
2032
|
-
* flow('BatchTransformDemo')
|
|
2033
|
-
* .input({ csvFile: types.file })
|
|
2034
|
-
* .output({ result: types.file })
|
|
2035
|
-
* .step('categorizeRows', batchTransform({
|
|
2036
|
-
* attachment: out('start', 'csvFile'),
|
|
2037
|
-
* prompt: 'Classify each row by category and write a one-line summary.',
|
|
2038
|
-
* outputColumns: [
|
|
2039
|
-
* { name: 'Category', description: 'One of: Utility, Software, Travel, Other' },
|
|
2040
|
-
* { name: 'Summary', description: 'Plain-English one-line summary of the row' },
|
|
2041
|
-
* ],
|
|
2042
|
-
* }))
|
|
2043
|
-
* .return({ result: out('categorizeRows') })
|
|
2044
|
-
* ```
|
|
2045
|
-
*
|
|
2046
|
-
* @param inputs - The CSV (`attachment`), the instruction (`prompt`), and the
|
|
2047
|
-
* `outputColumns` to add to each row.
|
|
2048
|
-
* @returns An action spec to pass to `.step(name, …)`.
|
|
2049
|
-
*/
|
|
2050
|
-
export declare function batchTransform(inputs: BatchTransformInputs): ActionSpec;
|
|
2051
1862
|
/**
|
|
2052
1863
|
* Extract fields from a document with a published IxP project — the platform's
|
|
2053
1864
|
* **Extract** node (`uipath.ixp.*`, service contract `IXP.Extraction`).
|
|
@@ -2208,57 +2019,6 @@ export declare function apiWorkflow(inputs: ApiWorkflowInputs): ActionSpec;
|
|
|
2208
2019
|
* @returns An action spec to pass to `.step(...)`.
|
|
2209
2020
|
*/
|
|
2210
2021
|
export declare function publishedFunction(inputs: PublishedFunctionInputs): ActionSpec;
|
|
2211
|
-
/**
|
|
2212
|
-
* Post an assistant message into a live conversation
|
|
2213
|
-
* (`uipath.conversational.send-message`).
|
|
2214
|
-
*
|
|
2215
|
-
* ```ts
|
|
2216
|
-
* .step('answer', sendMessage({
|
|
2217
|
-
* conversationId: out('start', 'conversationId'),
|
|
2218
|
-
* exchangeId: out('listen', 'conversationContext.latestExchangeId'),
|
|
2219
|
-
* content: 'Your order ships tomorrow.',
|
|
2220
|
-
* }))
|
|
2221
|
-
* ```
|
|
2222
|
-
*
|
|
2223
|
-
* The message is Markdown (`text/markdown` is the node's only supported type)
|
|
2224
|
-
* and the role is always `assistant` — a flow speaks as the assistant.
|
|
2225
|
-
*
|
|
2226
|
-
* @param inputs - The conversation, the exchange, and what to say.
|
|
2227
|
-
* @returns An action spec to pass to `.step(...)`.
|
|
2228
|
-
*/
|
|
2229
|
-
export declare function sendMessage(inputs: SendMessageInputs): ActionSpec;
|
|
2230
|
-
/**
|
|
2231
|
-
* PAUSE until the person sends their next message
|
|
2232
|
-
* (`uipath.conversational.wait-for-message`) — a catch event, like
|
|
2233
|
-
* `waitForEvent`, so the flow suspends rather than polling.
|
|
2234
|
-
*
|
|
2235
|
-
* ```ts
|
|
2236
|
-
* .step('listen', waitForMessage({ conversationId: out('start', 'conversationId') }))
|
|
2237
|
-
* ```
|
|
2238
|
-
*
|
|
2239
|
-
* It resumes with the conversation context:
|
|
2240
|
-
* `out('listen', 'conversationContext.messages')` is the transcript and
|
|
2241
|
-
* `…conversationContext.latestExchangeId` is the turn to answer.
|
|
2242
|
-
*
|
|
2243
|
-
* @param inputs - The conversation to wait on, and how much history to return.
|
|
2244
|
-
* @returns An action spec to pass to `.step(...)`.
|
|
2245
|
-
*/
|
|
2246
|
-
export declare function waitForMessage(inputs: WaitForMessageInputs): ActionSpec;
|
|
2247
|
-
/**
|
|
2248
|
-
* READ a conversation's transcript so far without waiting
|
|
2249
|
-
* (`uipath.conversational.get-conversation-context`) — the shape a
|
|
2250
|
-
* conversational agent takes as its turn context.
|
|
2251
|
-
*
|
|
2252
|
-
* ```ts
|
|
2253
|
-
* .step('history', conversationContext({
|
|
2254
|
-
* conversationId: out('start', 'conversationId'), exchangeLimit: 10,
|
|
2255
|
-
* }))
|
|
2256
|
-
* ```
|
|
2257
|
-
*
|
|
2258
|
-
* @param inputs - The conversation to read, and how many exchanges to return.
|
|
2259
|
-
* @returns An action spec to pass to `.step(...)`.
|
|
2260
|
-
*/
|
|
2261
|
-
export declare function conversationContext(inputs: ConversationContextInputs): ActionSpec;
|
|
2262
2022
|
/**
|
|
2263
2023
|
* Place an outgoing phone call
|
|
2264
2024
|
* (`uipath.conversational.voice.create-outgoing-call`) and get back the
|
package/dist/core/actions.js
CHANGED
|
@@ -142,86 +142,6 @@ export function builtinTriggerSpec(spec) {
|
|
|
142
142
|
export function hitl(inputs) {
|
|
143
143
|
return builtinActionSpec({ kind: 'hitl', inputs });
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Summarize a document with citations — the platform's **Summarize** node.
|
|
147
|
-
*
|
|
148
|
-
* @remarks
|
|
149
|
-
* **The node type is `uipath.pattern.deep-rag`.** The canvas calls it
|
|
150
|
-
* *Summarize*, its properties panel is titled *Summarize Configuration*, and
|
|
151
|
-
* the wire type stays `deep-rag` — it is the same node, under the name the
|
|
152
|
-
* backend service contract uses (`ECS.DeepRag`). There is no
|
|
153
|
-
* `uipath.pattern.summarize`. (A same-named inline-agent TOOL,
|
|
154
|
-
* `uipath.agent.resource.tool.builtin.summarize`, is a different family.)
|
|
155
|
-
*
|
|
156
|
-
* The answer's fields are **PascalCase** — `content.Text`,
|
|
157
|
-
* `content.Citations[].{Ordinal, PageNumber, Source, Reference}`. Lowercase
|
|
158
|
-
* `content.text` resolves to nothing at run time.
|
|
159
|
-
*
|
|
160
|
-
* A local run cannot reach the service: it returns the baked
|
|
161
|
-
* fixture shape, and only a real platform run (`uip maestro flow debug
|
|
162
|
-
* --attachment <var>=<file>`) calls the model.
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* **Summarize an attached contract, with citations**
|
|
166
|
-
* ```ts
|
|
167
|
-
* flow('SummarizeDemo')
|
|
168
|
-
* .input({ documentFile: types.file })
|
|
169
|
-
* .output({ summary: types.string, citations: types.array })
|
|
170
|
-
* .step('summarizeContract', summarize({
|
|
171
|
-
* attachment: out('start', 'documentFile'),
|
|
172
|
-
* prompt: 'Write a 5-bullet executive summary covering scope, term and SLAs.',
|
|
173
|
-
* returnCitations: true,
|
|
174
|
-
* }))
|
|
175
|
-
* .return({
|
|
176
|
-
* summary: out('summarizeContract', 'content.Text'),
|
|
177
|
-
* citations: out('summarizeContract', 'content.Citations'),
|
|
178
|
-
* })
|
|
179
|
-
* ```
|
|
180
|
-
*
|
|
181
|
-
* @param inputs - The document (`attachment`), the question to answer (`prompt`),
|
|
182
|
-
* and whether to return citations.
|
|
183
|
-
* @returns An action spec to pass to `.step(name, …)`.
|
|
184
|
-
*/
|
|
185
|
-
export function summarize(inputs) {
|
|
186
|
-
return builtinActionSpec({ kind: 'summarize', inputs });
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Add AI-generated columns to a CSV — the platform's **Batch transform** node,
|
|
190
|
-
* `uipath.pattern.batch-transform` (service contract `ECS.BatchTransform`).
|
|
191
|
-
*
|
|
192
|
-
* @remarks
|
|
193
|
-
* The output is a **file handle for the enriched CSV**, not the rows:
|
|
194
|
-
* `{ ID, FullName, MimeType }` — the service writes a new
|
|
195
|
-
* `batch-transform-<uuid>.csv` and hands back its attachment. Note `ID`, two
|
|
196
|
-
* capitals: that is what the platform returns.
|
|
197
|
-
*
|
|
198
|
-
* Same dispatch story as {@link summarize} — dry-run fixture locally, a real
|
|
199
|
-
* model call only on a platform run.
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* **Categorize each CSV row with two generated columns**
|
|
203
|
-
* ```ts
|
|
204
|
-
* flow('BatchTransformDemo')
|
|
205
|
-
* .input({ csvFile: types.file })
|
|
206
|
-
* .output({ result: types.file })
|
|
207
|
-
* .step('categorizeRows', batchTransform({
|
|
208
|
-
* attachment: out('start', 'csvFile'),
|
|
209
|
-
* prompt: 'Classify each row by category and write a one-line summary.',
|
|
210
|
-
* outputColumns: [
|
|
211
|
-
* { name: 'Category', description: 'One of: Utility, Software, Travel, Other' },
|
|
212
|
-
* { name: 'Summary', description: 'Plain-English one-line summary of the row' },
|
|
213
|
-
* ],
|
|
214
|
-
* }))
|
|
215
|
-
* .return({ result: out('categorizeRows') })
|
|
216
|
-
* ```
|
|
217
|
-
*
|
|
218
|
-
* @param inputs - The CSV (`attachment`), the instruction (`prompt`), and the
|
|
219
|
-
* `outputColumns` to add to each row.
|
|
220
|
-
* @returns An action spec to pass to `.step(name, …)`.
|
|
221
|
-
*/
|
|
222
|
-
export function batchTransform(inputs) {
|
|
223
|
-
return builtinActionSpec({ kind: 'batchTransform', inputs });
|
|
224
|
-
}
|
|
225
145
|
/**
|
|
226
146
|
* Extract fields from a document with a published IxP project — the platform's
|
|
227
147
|
* **Extract** node (`uipath.ixp.*`, service contract `IXP.Extraction`).
|
|
@@ -390,63 +310,6 @@ export function apiWorkflow(inputs) {
|
|
|
390
310
|
export function publishedFunction(inputs) {
|
|
391
311
|
return builtinActionSpec({ kind: 'publishedFunction', inputs });
|
|
392
312
|
}
|
|
393
|
-
/**
|
|
394
|
-
* Post an assistant message into a live conversation
|
|
395
|
-
* (`uipath.conversational.send-message`).
|
|
396
|
-
*
|
|
397
|
-
* ```ts
|
|
398
|
-
* .step('answer', sendMessage({
|
|
399
|
-
* conversationId: out('start', 'conversationId'),
|
|
400
|
-
* exchangeId: out('listen', 'conversationContext.latestExchangeId'),
|
|
401
|
-
* content: 'Your order ships tomorrow.',
|
|
402
|
-
* }))
|
|
403
|
-
* ```
|
|
404
|
-
*
|
|
405
|
-
* The message is Markdown (`text/markdown` is the node's only supported type)
|
|
406
|
-
* and the role is always `assistant` — a flow speaks as the assistant.
|
|
407
|
-
*
|
|
408
|
-
* @param inputs - The conversation, the exchange, and what to say.
|
|
409
|
-
* @returns An action spec to pass to `.step(...)`.
|
|
410
|
-
*/
|
|
411
|
-
export function sendMessage(inputs) {
|
|
412
|
-
return builtinActionSpec({ kind: 'sendMessage', inputs });
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* PAUSE until the person sends their next message
|
|
416
|
-
* (`uipath.conversational.wait-for-message`) — a catch event, like
|
|
417
|
-
* `waitForEvent`, so the flow suspends rather than polling.
|
|
418
|
-
*
|
|
419
|
-
* ```ts
|
|
420
|
-
* .step('listen', waitForMessage({ conversationId: out('start', 'conversationId') }))
|
|
421
|
-
* ```
|
|
422
|
-
*
|
|
423
|
-
* It resumes with the conversation context:
|
|
424
|
-
* `out('listen', 'conversationContext.messages')` is the transcript and
|
|
425
|
-
* `…conversationContext.latestExchangeId` is the turn to answer.
|
|
426
|
-
*
|
|
427
|
-
* @param inputs - The conversation to wait on, and how much history to return.
|
|
428
|
-
* @returns An action spec to pass to `.step(...)`.
|
|
429
|
-
*/
|
|
430
|
-
export function waitForMessage(inputs) {
|
|
431
|
-
return builtinActionSpec({ kind: 'waitForMessage', inputs });
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* READ a conversation's transcript so far without waiting
|
|
435
|
-
* (`uipath.conversational.get-conversation-context`) — the shape a
|
|
436
|
-
* conversational agent takes as its turn context.
|
|
437
|
-
*
|
|
438
|
-
* ```ts
|
|
439
|
-
* .step('history', conversationContext({
|
|
440
|
-
* conversationId: out('start', 'conversationId'), exchangeLimit: 10,
|
|
441
|
-
* }))
|
|
442
|
-
* ```
|
|
443
|
-
*
|
|
444
|
-
* @param inputs - The conversation to read, and how many exchanges to return.
|
|
445
|
-
* @returns An action spec to pass to `.step(...)`.
|
|
446
|
-
*/
|
|
447
|
-
export function conversationContext(inputs) {
|
|
448
|
-
return builtinActionSpec({ kind: 'conversationContext', inputs });
|
|
449
|
-
}
|
|
450
313
|
/**
|
|
451
314
|
* Place an outgoing phone call
|
|
452
315
|
* (`uipath.conversational.voice.create-outgoing-call`) and get back the
|
|
@@ -32,11 +32,8 @@ export const TYPED_FACTORIES = {
|
|
|
32
32
|
'uipath.agent.autonomous': { factory: 'inlineAgent()' },
|
|
33
33
|
'uipath.agent.conversational': { factory: 'conversationalAgent()' },
|
|
34
34
|
'uipath.agent.voice': { factory: 'voiceAgent()' },
|
|
35
|
-
'uipath.conversational.get-conversation-context': { factory: 'conversationContext()' },
|
|
36
|
-
'uipath.conversational.send-message': { factory: 'sendMessage()' },
|
|
37
35
|
'uipath.conversational.voice.create-outgoing-call': { factory: 'createOutgoingCall()' },
|
|
38
36
|
'uipath.conversational.voice.end-call': { factory: 'endCall()' },
|
|
39
|
-
'uipath.conversational.wait-for-message': { factory: 'waitForMessage()' },
|
|
40
37
|
'uipath.human-in-the-loop': { factory: 'hitl()' },
|
|
41
38
|
'uipath.human-in-the-loop.coded-action-app': {
|
|
42
39
|
factory: "hitl({ variant: 'action-app' })",
|
|
@@ -45,8 +42,6 @@ export const TYPED_FACTORIES = {
|
|
|
45
42
|
factory: "hitl({ variant: 'document-validation' })",
|
|
46
43
|
},
|
|
47
44
|
'uipath.human-in-the-loop.quick-form': { factory: "hitl({ variant: 'quick-form' })" },
|
|
48
|
-
'uipath.pattern.batch-transform': { factory: 'batchTransform()' },
|
|
49
|
-
'uipath.pattern.deep-rag': { factory: 'summarize()' },
|
|
50
45
|
};
|
|
51
46
|
/**
|
|
52
47
|
* A reminder, as a `warning`, that a `rawNode` stands in for a typed factory,
|
package/dist/decompile.js
CHANGED
|
@@ -229,11 +229,6 @@ const T = {
|
|
|
229
229
|
hitlQuickForm: 'uipath.human-in-the-loop.quick-form',
|
|
230
230
|
hitlActionApp: 'uipath.human-in-the-loop.coded-action-app',
|
|
231
231
|
hitlDocValidation: 'uipath.human-in-the-loop.document-validation',
|
|
232
|
-
summarize: 'uipath.pattern.deep-rag',
|
|
233
|
-
batchTransform: 'uipath.pattern.batch-transform',
|
|
234
|
-
sendMessage: 'uipath.conversational.send-message',
|
|
235
|
-
waitForMessage: 'uipath.conversational.wait-for-message',
|
|
236
|
-
conversationContext: 'uipath.conversational.get-conversation-context',
|
|
237
232
|
triggerVoice: 'core.trigger.voice',
|
|
238
233
|
createOutgoingCall: 'uipath.conversational.voice.create-outgoing-call',
|
|
239
234
|
endCall: 'uipath.conversational.voice.end-call',
|
|
@@ -637,7 +632,6 @@ function emitStepSpec(node, imp, inputNames, o, graph) {
|
|
|
637
632
|
const lifted = emitRegisteredSpec(node, imp, inputNames);
|
|
638
633
|
if (lifted !== undefined)
|
|
639
634
|
return lifted;
|
|
640
|
-
const inputs = node.inputs ?? {};
|
|
641
635
|
switch (node.type) {
|
|
642
636
|
case T.createOutgoingCall:
|
|
643
637
|
case T.endCall: {
|
|
@@ -662,71 +656,6 @@ function emitStepSpec(node, imp, inputNames, o, graph) {
|
|
|
662
656
|
case T.hitlActionApp:
|
|
663
657
|
case T.hitlDocValidation:
|
|
664
658
|
return emitHitl(node, imp, inputNames, graph);
|
|
665
|
-
case T.summarize:
|
|
666
|
-
case T.batchTransform: {
|
|
667
|
-
const attachment = emitVal(inputs.attachment, imp, inputNames);
|
|
668
|
-
const prompt = emitVal(inputs.prompt, imp, inputNames);
|
|
669
|
-
if (node.type === T.summarize) {
|
|
670
|
-
return `${imp.use('summarize')}(${opts([
|
|
671
|
-
['attachment', attachment],
|
|
672
|
-
['prompt', prompt],
|
|
673
|
-
// Both flags default to false in the emitted node; only `true` was authored.
|
|
674
|
-
['returnCitations', unwrapPlain(inputs.returnCitations) === true ? 'true' : undefined],
|
|
675
|
-
])})`;
|
|
676
|
-
}
|
|
677
|
-
const cols = Array.isArray(inputs.outputColumns) ? inputs.outputColumns : [];
|
|
678
|
-
const colSrc = `[${cols.map((c) => opts([
|
|
679
|
-
['name', emitVal(c.name, imp, inputNames)],
|
|
680
|
-
['description', emitVal(c.description, imp, inputNames)],
|
|
681
|
-
])).join(', ')}]`;
|
|
682
|
-
return `${imp.use('batchTransform')}(${opts([
|
|
683
|
-
['attachment', attachment],
|
|
684
|
-
['prompt', prompt],
|
|
685
|
-
['outputColumns', colSrc],
|
|
686
|
-
['enableWebSearchGrounding', unwrapPlain(inputs.enableWebSearchGrounding) === true ? 'true' : undefined],
|
|
687
|
-
])})`;
|
|
688
|
-
}
|
|
689
|
-
case T.sendMessage:
|
|
690
|
-
case T.waitForMessage:
|
|
691
|
-
case T.conversationContext: {
|
|
692
|
-
// The fixed enum fields (`role`/`mimeType`/`from`) come from the
|
|
693
|
-
// definition's defaults, so nothing of them is recovered — only what an
|
|
694
|
-
// author could have written.
|
|
695
|
-
const i = (node.inputs ?? {});
|
|
696
|
-
const v = (x) => {
|
|
697
|
-
const raw = typeof x === 'string' ? x : String(x?.expression ?? x ?? '');
|
|
698
|
-
return raw.startsWith('=js:') ? emitBareExpr(raw.slice(4), imp, inputNames)
|
|
699
|
-
: raw.startsWith('$vars.') ? emitBareExpr(raw, imp, inputNames)
|
|
700
|
-
: tsLiteral(raw);
|
|
701
|
-
};
|
|
702
|
-
const num = (x) => {
|
|
703
|
-
if (x === undefined || x === null)
|
|
704
|
-
return undefined;
|
|
705
|
-
const n = Number(x?.expression ?? x);
|
|
706
|
-
return Number.isFinite(n) ? String(n) : undefined;
|
|
707
|
-
};
|
|
708
|
-
const cid = ['conversationId', v(i.conversationId)];
|
|
709
|
-
if (node.type === T.sendMessage) {
|
|
710
|
-
return `${imp.use('sendMessage')}(${opts([
|
|
711
|
-
cid,
|
|
712
|
-
['exchangeId', v(i.exchangeId)],
|
|
713
|
-
['content', v(i.content)],
|
|
714
|
-
// The definition defaults `endExchange` to false; only a departure
|
|
715
|
-
// from the default is something the author wrote.
|
|
716
|
-
['endExchange', i.endExchange === true ? 'true' : undefined],
|
|
717
|
-
])})`;
|
|
718
|
-
}
|
|
719
|
-
if (node.type === T.waitForMessage) {
|
|
720
|
-
return `${imp.use('waitForMessage')}(${opts([
|
|
721
|
-
cid,
|
|
722
|
-
['numExchanges', num(i.numExchanges) === '20' ? undefined : num(i.numExchanges)],
|
|
723
|
-
])})`;
|
|
724
|
-
}
|
|
725
|
-
return `${imp.use('conversationContext')}(${opts([
|
|
726
|
-
cid,
|
|
727
|
-
['exchangeLimit', num(i.exchangeLimit) === '20' ? undefined : num(i.exchangeLimit)],
|
|
728
|
-
])})`;
|
|
729
|
-
}
|
|
730
659
|
default:
|
|
731
660
|
// A connector action node: `uipath.connector.<key>.<action>` (but NOT the
|
|
732
661
|
// event nodes `uipath.connector.event.*` / `.trigger.*`, which are triggers).
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { NodeTypeRegistry } from './core/nodes/registry.js';
|
|
10
10
|
import { hasBundledDefinition } from './flow-definitions.js';
|
|
11
|
+
import { aiPatternsFlowFamily } from './nodes/ai-patterns/flow/family.js';
|
|
12
|
+
import { conversationFlowFamily } from './nodes/conversation/flow/family.js';
|
|
11
13
|
import { dataFabricFlowFamily } from './nodes/data-fabric/flow/family.js';
|
|
12
14
|
import { delayFlowFamily } from './nodes/delay/flow/family.js';
|
|
13
15
|
import { documentFlowFamily } from './nodes/document/flow/family.js';
|
|
@@ -17,5 +19,5 @@ import { queueFlowFamily } from './nodes/queue/flow/family.js';
|
|
|
17
19
|
import { scriptFlowFamily } from './nodes/script/flow/family.js';
|
|
18
20
|
import { transformFlowFamily } from './nodes/transform/flow/family.js';
|
|
19
21
|
/** The families, in no significant order. Adding one is the whole of registering it. */
|
|
20
|
-
export const FLOW_NODE_FAMILIES = [dataFabricFlowFamily, delayFlowFamily, documentFlowFamily, httpFlowFamily, mockFlowFamily, queueFlowFamily, scriptFlowFamily, transformFlowFamily];
|
|
22
|
+
export const FLOW_NODE_FAMILIES = [aiPatternsFlowFamily, conversationFlowFamily, dataFabricFlowFamily, delayFlowFamily, documentFlowFamily, httpFlowFamily, mockFlowFamily, queueFlowFamily, scriptFlowFamily, transformFlowFamily];
|
|
21
23
|
export const FLOW_NODE_TYPES = new NodeTypeRegistry('flow', FLOW_NODE_FAMILIES, { hasBundledDefinition });
|
package/dist/flow-sdk.d.ts
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export * from './core/expr.js';
|
|
20
20
|
export * from './core/actions.js';
|
|
21
|
+
export * from './nodes/ai-patterns/flow/index.js';
|
|
22
|
+
export * from './nodes/conversation/flow/index.js';
|
|
21
23
|
export * from './nodes/data-fabric/flow/index.js';
|
|
22
24
|
export * from './nodes/delay/flow/index.js';
|
|
23
25
|
export * from './nodes/document/flow/index.js';
|
package/dist/flow-sdk.js
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
export * from './core/expr.js';
|
|
23
23
|
export * from './core/actions.js';
|
|
24
24
|
// Node families' public surfaces (docs/NODE_TYPE_ARCHITECTURE_DESIGN.md §8).
|
|
25
|
+
export * from './nodes/ai-patterns/flow/index.js';
|
|
26
|
+
export * from './nodes/conversation/flow/index.js';
|
|
25
27
|
export * from './nodes/data-fabric/flow/index.js';
|
|
26
28
|
export * from './nodes/delay/flow/index.js';
|
|
27
29
|
export * from './nodes/document/flow/index.js';
|