@uipath/maestro-builder-sdk 6.22.0 → 6.23.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.
@@ -536,62 +536,6 @@ export interface VoiceAgentInputs {
536
536
  */
537
537
  source?: string;
538
538
  }
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
539
  /**
596
540
  * Split an extractor's node type into the two GUIDs its tail packs.
597
541
  *
@@ -1849,14 +1793,6 @@ export interface FlowActionSpecs {
1849
1793
  inlineAgent: {
1850
1794
  inputs: InlineAgentInputs;
1851
1795
  };
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
1796
  /** The spec {@link ixpExtract} builds. */
1861
1797
  ixpExtract: {
1862
1798
  inputs: IxpExtractInputs;
@@ -1972,82 +1908,6 @@ export declare function builtinTriggerSpec<S extends object>(spec: S): S;
1972
1908
  * @example example-eval/GallerySubmission.flow.ts
1973
1909
  */
1974
1910
  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
1911
  /**
2052
1912
  * Extract fields from a document with a published IxP project — the platform's
2053
1913
  * **Extract** node (`uipath.ixp.*`, service contract `IXP.Extraction`).
@@ -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`).
@@ -45,8 +45,6 @@ export const TYPED_FACTORIES = {
45
45
  factory: "hitl({ variant: 'document-validation' })",
46
46
  },
47
47
  '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
48
  };
51
49
  /**
52
50
  * A reminder, as a `warning`, that a `rawNode` stands in for a typed factory,
package/dist/decompile.js CHANGED
@@ -229,8 +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
232
  sendMessage: 'uipath.conversational.send-message',
235
233
  waitForMessage: 'uipath.conversational.wait-for-message',
236
234
  conversationContext: 'uipath.conversational.get-conversation-context',
@@ -637,7 +635,6 @@ function emitStepSpec(node, imp, inputNames, o, graph) {
637
635
  const lifted = emitRegisteredSpec(node, imp, inputNames);
638
636
  if (lifted !== undefined)
639
637
  return lifted;
640
- const inputs = node.inputs ?? {};
641
638
  switch (node.type) {
642
639
  case T.createOutgoingCall:
643
640
  case T.endCall: {
@@ -662,30 +659,6 @@ function emitStepSpec(node, imp, inputNames, o, graph) {
662
659
  case T.hitlActionApp:
663
660
  case T.hitlDocValidation:
664
661
  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
662
  case T.sendMessage:
690
663
  case T.waitForMessage:
691
664
  case T.conversationContext: {
@@ -8,6 +8,7 @@
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';
11
12
  import { dataFabricFlowFamily } from './nodes/data-fabric/flow/family.js';
12
13
  import { delayFlowFamily } from './nodes/delay/flow/family.js';
13
14
  import { documentFlowFamily } from './nodes/document/flow/family.js';
@@ -17,5 +18,5 @@ import { queueFlowFamily } from './nodes/queue/flow/family.js';
17
18
  import { scriptFlowFamily } from './nodes/script/flow/family.js';
18
19
  import { transformFlowFamily } from './nodes/transform/flow/family.js';
19
20
  /** 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];
21
+ export const FLOW_NODE_FAMILIES = [aiPatternsFlowFamily, dataFabricFlowFamily, delayFlowFamily, documentFlowFamily, httpFlowFamily, mockFlowFamily, queueFlowFamily, scriptFlowFamily, transformFlowFamily];
21
22
  export const FLOW_NODE_TYPES = new NodeTypeRegistry('flow', FLOW_NODE_FAMILIES, { hasBundledDefinition });
@@ -18,6 +18,7 @@
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';
21
22
  export * from './nodes/data-fabric/flow/index.js';
22
23
  export * from './nodes/delay/flow/index.js';
23
24
  export * from './nodes/document/flow/index.js';
package/dist/flow-sdk.js CHANGED
@@ -22,6 +22,7 @@
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';
25
26
  export * from './nodes/data-fabric/flow/index.js';
26
27
  export * from './nodes/delay/flow/index.js';
27
28
  export * from './nodes/document/flow/index.js';
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The AI-pattern factories, `summarize()` and `batchTransform()`. Moved from
3
+ * core/actions.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the
4
+ * package entry re-exports them.
5
+ */
6
+ import { type ActionSpec } from '../../../core/actions.js';
7
+ import type { BatchTransformInputs, SummarizeInputs } from './spec.js';
8
+ /**
9
+ * Summarize a document with citations — the platform's **Summarize** node.
10
+ *
11
+ * @remarks
12
+ * **The node type is `uipath.pattern.deep-rag`.** The canvas calls it
13
+ * *Summarize*, its properties panel is titled *Summarize Configuration*, and
14
+ * the wire type stays `deep-rag` — it is the same node, under the name the
15
+ * backend service contract uses (`ECS.DeepRag`). There is no
16
+ * `uipath.pattern.summarize`. (A same-named inline-agent TOOL,
17
+ * `uipath.agent.resource.tool.builtin.summarize`, is a different family.)
18
+ *
19
+ * The answer's fields are **PascalCase** — `content.Text`,
20
+ * `content.Citations[].{Ordinal, PageNumber, Source, Reference}`. Lowercase
21
+ * `content.text` resolves to nothing at run time.
22
+ *
23
+ * A local run cannot reach the service: it returns the baked
24
+ * fixture shape, and only a real platform run (`uip maestro flow debug
25
+ * --attachment <var>=<file>`) calls the model.
26
+ *
27
+ * @example
28
+ * **Summarize an attached contract, with citations**
29
+ * ```ts
30
+ * flow('SummarizeDemo')
31
+ * .input({ documentFile: types.file })
32
+ * .output({ summary: types.string, citations: types.array })
33
+ * .step('summarizeContract', summarize({
34
+ * attachment: out('start', 'documentFile'),
35
+ * prompt: 'Write a 5-bullet executive summary covering scope, term and SLAs.',
36
+ * returnCitations: true,
37
+ * }))
38
+ * .return({
39
+ * summary: out('summarizeContract', 'content.Text'),
40
+ * citations: out('summarizeContract', 'content.Citations'),
41
+ * })
42
+ * ```
43
+ *
44
+ * @param inputs - The document (`attachment`), the question to answer (`prompt`),
45
+ * and whether to return citations.
46
+ * @returns An action spec to pass to `.step(name, …)`.
47
+ */
48
+ export declare function summarize(inputs: SummarizeInputs): ActionSpec;
49
+ /**
50
+ * Add AI-generated columns to a CSV — the platform's **Batch transform** node,
51
+ * `uipath.pattern.batch-transform` (service contract `ECS.BatchTransform`).
52
+ *
53
+ * @remarks
54
+ * The output is a **file handle for the enriched CSV**, not the rows:
55
+ * `{ ID, FullName, MimeType }` — the service writes a new
56
+ * `batch-transform-<uuid>.csv` and hands back its attachment. Note `ID`, two
57
+ * capitals: that is what the platform returns.
58
+ *
59
+ * Same dispatch story as {@link summarize} — dry-run fixture locally, a real
60
+ * model call only on a platform run.
61
+ *
62
+ * @example
63
+ * **Categorize each CSV row with two generated columns**
64
+ * ```ts
65
+ * flow('BatchTransformDemo')
66
+ * .input({ csvFile: types.file })
67
+ * .output({ result: types.file })
68
+ * .step('categorizeRows', batchTransform({
69
+ * attachment: out('start', 'csvFile'),
70
+ * prompt: 'Classify each row by category and write a one-line summary.',
71
+ * outputColumns: [
72
+ * { name: 'Category', description: 'One of: Utility, Software, Travel, Other' },
73
+ * { name: 'Summary', description: 'Plain-English one-line summary of the row' },
74
+ * ],
75
+ * }))
76
+ * .return({ result: out('categorizeRows') })
77
+ * ```
78
+ *
79
+ * @param inputs - The CSV (`attachment`), the instruction (`prompt`), and the
80
+ * `outputColumns` to add to each row.
81
+ * @returns An action spec to pass to `.step(name, …)`.
82
+ */
83
+ export declare function batchTransform(inputs: BatchTransformInputs): ActionSpec;
@@ -0,0 +1,86 @@
1
+ /**
2
+ * The AI-pattern factories, `summarize()` and `batchTransform()`. Moved from
3
+ * core/actions.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md; the
4
+ * package entry re-exports them.
5
+ */
6
+ import { builtinActionSpec } from '../../../core/actions.js';
7
+ /**
8
+ * Summarize a document with citations — the platform's **Summarize** node.
9
+ *
10
+ * @remarks
11
+ * **The node type is `uipath.pattern.deep-rag`.** The canvas calls it
12
+ * *Summarize*, its properties panel is titled *Summarize Configuration*, and
13
+ * the wire type stays `deep-rag` — it is the same node, under the name the
14
+ * backend service contract uses (`ECS.DeepRag`). There is no
15
+ * `uipath.pattern.summarize`. (A same-named inline-agent TOOL,
16
+ * `uipath.agent.resource.tool.builtin.summarize`, is a different family.)
17
+ *
18
+ * The answer's fields are **PascalCase** — `content.Text`,
19
+ * `content.Citations[].{Ordinal, PageNumber, Source, Reference}`. Lowercase
20
+ * `content.text` resolves to nothing at run time.
21
+ *
22
+ * A local run cannot reach the service: it returns the baked
23
+ * fixture shape, and only a real platform run (`uip maestro flow debug
24
+ * --attachment <var>=<file>`) calls the model.
25
+ *
26
+ * @example
27
+ * **Summarize an attached contract, with citations**
28
+ * ```ts
29
+ * flow('SummarizeDemo')
30
+ * .input({ documentFile: types.file })
31
+ * .output({ summary: types.string, citations: types.array })
32
+ * .step('summarizeContract', summarize({
33
+ * attachment: out('start', 'documentFile'),
34
+ * prompt: 'Write a 5-bullet executive summary covering scope, term and SLAs.',
35
+ * returnCitations: true,
36
+ * }))
37
+ * .return({
38
+ * summary: out('summarizeContract', 'content.Text'),
39
+ * citations: out('summarizeContract', 'content.Citations'),
40
+ * })
41
+ * ```
42
+ *
43
+ * @param inputs - The document (`attachment`), the question to answer (`prompt`),
44
+ * and whether to return citations.
45
+ * @returns An action spec to pass to `.step(name, …)`.
46
+ */
47
+ export function summarize(inputs) {
48
+ return builtinActionSpec({ kind: 'summarize', inputs });
49
+ }
50
+ /**
51
+ * Add AI-generated columns to a CSV — the platform's **Batch transform** node,
52
+ * `uipath.pattern.batch-transform` (service contract `ECS.BatchTransform`).
53
+ *
54
+ * @remarks
55
+ * The output is a **file handle for the enriched CSV**, not the rows:
56
+ * `{ ID, FullName, MimeType }` — the service writes a new
57
+ * `batch-transform-<uuid>.csv` and hands back its attachment. Note `ID`, two
58
+ * capitals: that is what the platform returns.
59
+ *
60
+ * Same dispatch story as {@link summarize} — dry-run fixture locally, a real
61
+ * model call only on a platform run.
62
+ *
63
+ * @example
64
+ * **Categorize each CSV row with two generated columns**
65
+ * ```ts
66
+ * flow('BatchTransformDemo')
67
+ * .input({ csvFile: types.file })
68
+ * .output({ result: types.file })
69
+ * .step('categorizeRows', batchTransform({
70
+ * attachment: out('start', 'csvFile'),
71
+ * prompt: 'Classify each row by category and write a one-line summary.',
72
+ * outputColumns: [
73
+ * { name: 'Category', description: 'One of: Utility, Software, Travel, Other' },
74
+ * { name: 'Summary', description: 'Plain-English one-line summary of the row' },
75
+ * ],
76
+ * }))
77
+ * .return({ result: out('categorizeRows') })
78
+ * ```
79
+ *
80
+ * @param inputs - The CSV (`attachment`), the instruction (`prompt`), and the
81
+ * `outputColumns` to add to each row.
82
+ * @returns An action spec to pass to `.step(name, …)`.
83
+ */
84
+ export function batchTransform(inputs) {
85
+ return builtinActionSpec({ kind: 'batchTransform', inputs });
86
+ }
@@ -0,0 +1,3 @@
1
+ /** The AI-pattern node family, as flow-node-registry.ts lists it: `uipath.pattern.deep-rag` and `uipath.pattern.batch-transform`. */
2
+ import type { FlowNodeFamily } from '../../../flow-node-type.js';
3
+ export declare const aiPatternsFlowFamily: FlowNodeFamily;
@@ -0,0 +1,8 @@
1
+ import { aiPatternNodeTypes } from './node-type.js';
2
+ export const aiPatternsFlowFamily = {
3
+ id: 'ai-patterns',
4
+ title: 'AI patterns',
5
+ types: aiPatternNodeTypes,
6
+ // No node-local rules: what an AI-pattern step could get wrong is the service's to say.
7
+ diagnostics: {},
8
+ };
@@ -0,0 +1,3 @@
1
+ /** The AI-pattern family's public surface, which the package entry re-exports. */
2
+ export * from './spec.js';
3
+ export * from './factories.js';
@@ -0,0 +1,3 @@
1
+ /** The AI-pattern family's public surface, which the package entry re-exports. */
2
+ export * from './spec.js';
3
+ export * from './factories.js';
@@ -0,0 +1,11 @@
1
+ import type { FlowNodeType } from '../../../flow-node-type.js';
2
+ import type { BatchTransformInputs, SummarizeInputs } from './spec.js';
3
+ export type SummarizeSpec = {
4
+ kind: 'summarize';
5
+ inputs: SummarizeInputs;
6
+ };
7
+ export type BatchTransformSpec = {
8
+ kind: 'batchTransform';
9
+ inputs: BatchTransformInputs;
10
+ };
11
+ export declare const aiPatternNodeTypes: (FlowNodeType<SummarizeSpec> | FlowNodeType<BatchTransformSpec>)[];
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The two AI-pattern node types: `uipath.pattern.deep-rag` (Summarize) and
3
+ * `uipath.pattern.batch-transform`, each bundled at 1.0. Moved from
4
+ * serialize.ts / decompile.ts in Phase 4 of docs/NODE_TYPE_ARCHITECTURE_DESIGN.md;
5
+ * serialized output and printed source unchanged.
6
+ */
7
+ import { Expr } from '../../../core/expr.js';
8
+ /** A value as the author wrote it: an expression back to an Expr, a literal string as itself, any other JSON as is. */
9
+ function lifted(raw, ctx) {
10
+ const text = Array.isArray(raw) ? undefined : ctx.sourceText(raw);
11
+ if (text === undefined)
12
+ return raw;
13
+ return text.startsWith('=js:') ? ctx.expr(text) : text;
14
+ }
15
+ /** A spec value as source: an Expr as the helper an author writes, `undefined` as itself, anything else as data. */
16
+ function printed(v, ctx) {
17
+ if (v === undefined)
18
+ return 'undefined';
19
+ return v instanceof Expr ? ctx.value(v) : ctx.json(v);
20
+ }
21
+ // Neither node carries a node-level `model`: both are `bpmn:ServiceTask`s whose
22
+ // `serviceType` the platform resolves from `definitions[]`, and every deployed
23
+ // instance of either carries none — v1's own structural checker fails a flow
24
+ // that has one. The resource model stays on the DEFINITION only, as it does for
25
+ // the published families. Per call (`model: 'omit'`), so a `rawNode` of either
26
+ // type keeps what it has always written.
27
+ const summarizeType = {
28
+ kind: 'summarize', typeName: 'uipath.pattern.deep-rag', version: '1.0', factory: 'summarize', definition: 'bundled',
29
+ rawNode: { factory: 'summarize()' },
30
+ // Each field is written under the NODE's own name, so the surface and the
31
+ // emitted file read alike.
32
+ serialize: ({ inputs }, ctx) => ({
33
+ model: 'omit',
34
+ inputs: {
35
+ attachment: ctx.render(inputs.attachment),
36
+ prompt: ctx.render(inputs.prompt),
37
+ returnCitations: inputs.returnCitations ?? false,
38
+ },
39
+ port: 'output',
40
+ }),
41
+ deserialize: (node, ctx) => {
42
+ const i = (node.inputs ?? {});
43
+ return {
44
+ kind: 'summarize',
45
+ inputs: {
46
+ attachment: lifted(i.attachment, ctx),
47
+ prompt: lifted(i.prompt, ctx),
48
+ // The flag defaults to false in the emitted node; only `true` was authored.
49
+ ...(ctx.plainValue(i.returnCitations) === true ? { returnCitations: true } : {}),
50
+ },
51
+ };
52
+ },
53
+ print: ({ inputs }, ctx) => ({
54
+ factory: 'summarize',
55
+ options: [
56
+ ['attachment', printed(inputs.attachment, ctx)],
57
+ ['prompt', printed(inputs.prompt, ctx)],
58
+ ['returnCitations', inputs.returnCitations === true ? 'true' : undefined],
59
+ ],
60
+ }),
61
+ // Deliberately none: references in the prompt, the attachment and the columns are not checked.
62
+ expressions: () => [],
63
+ output: () => ({ kind: 'opaque' }),
64
+ };
65
+ const batchTransformType = {
66
+ kind: 'batchTransform', typeName: 'uipath.pattern.batch-transform', version: '1.0', factory: 'batchTransform',
67
+ definition: 'bundled',
68
+ rawNode: { factory: 'batchTransform()' },
69
+ serialize: ({ inputs }, ctx) => ({
70
+ model: 'omit',
71
+ inputs: {
72
+ attachment: ctx.render(inputs.attachment),
73
+ prompt: ctx.render(inputs.prompt),
74
+ enableWebSearchGrounding: inputs.enableWebSearchGrounding ?? false,
75
+ // Rendered per column, so an expression in a description renders like every other input.
76
+ outputColumns: inputs.outputColumns.map((c) => Object.fromEntries(Object.entries(c).map(([k, v]) => [k, ctx.render(v)]))),
77
+ },
78
+ port: 'output',
79
+ }),
80
+ deserialize: (node, ctx) => {
81
+ const i = (node.inputs ?? {});
82
+ const cols = Array.isArray(i.outputColumns) ? i.outputColumns : [];
83
+ return {
84
+ kind: 'batchTransform',
85
+ inputs: {
86
+ attachment: lifted(i.attachment, ctx),
87
+ prompt: lifted(i.prompt, ctx),
88
+ outputColumns: cols.map((c) => ({ name: lifted(c.name, ctx), description: lifted(c.description, ctx) })),
89
+ ...(ctx.plainValue(i.enableWebSearchGrounding) === true ? { enableWebSearchGrounding: true } : {}),
90
+ },
91
+ };
92
+ },
93
+ print: ({ inputs }, ctx) => ({
94
+ factory: 'batchTransform',
95
+ options: [
96
+ ['attachment', printed(inputs.attachment, ctx)],
97
+ ['prompt', printed(inputs.prompt, ctx)],
98
+ ['outputColumns', `[${inputs.outputColumns.map((c) => `{ name: ${printed(c.name, ctx)}, description: ${printed(c.description, ctx)} }`).join(', ')}]`],
99
+ ['enableWebSearchGrounding', inputs.enableWebSearchGrounding === true ? 'true' : undefined],
100
+ ],
101
+ }),
102
+ // Deliberately none, as for Summarize.
103
+ expressions: () => [],
104
+ output: () => ({ kind: 'opaque' }),
105
+ };
106
+ export const aiPatternNodeTypes = [summarizeType, batchTransformType];