@uipath/maestro-builder-sdk 6.88.1 → 6.88.2

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.
@@ -7,9 +7,9 @@ import { FLAT_SEP, flatNameSegmentsOf } from '../../../core/expr.js';
7
7
  import { FORM_FIELD_TYPES, formFieldOptionsProblem, formFieldOptionsWhy, formFieldSettingProblems, formFieldTypeHint, formFieldTypeWhy, validFormFieldTypesText, } from '../../../core/form-field-type.js';
8
8
  import { ownEntry } from '../../../core/own-entry.js';
9
9
  export const AGENT_DIAGNOSTICS = {
10
- AGENT_CONTEXT_NO_FOLDER_PATH: { severity: 'warning', summary: 'a context index with no folderPath' },
11
- AGENT_CONTEXT_NO_ID: { severity: 'error', summary: 'a context index whose id is not a GUID' },
12
- AGENT_CONTEXT_QUERY_NOT_EXPRESSION: { severity: 'error', summary: 'a context index query that is neither a prompt nor an expression' },
10
+ FLOW_AGENT_CONTEXT_NO_FOLDER_PATH: { severity: 'warning', summary: 'a context index with no folderPath' },
11
+ FLOW_AGENT_CONTEXT_NO_ID: { severity: 'error', summary: 'a context index whose id is not a GUID' },
12
+ FLOW_AGENT_CONTEXT_QUERY_NOT_EXPRESSION: { severity: 'error', summary: 'a context index query that is neither a prompt nor an expression' },
13
13
  AGENT_MEMORY_NOT_AUTHORABLE: { severity: 'error', summary: 'an inline agent that attaches memory, which the platform does not serve' },
14
14
  CALL_NO_NUMBER: { severity: 'error', summary: 'a createOutgoingCall step with no from or to number' },
15
15
  CALL_NUMBER_NOT_E164: { severity: 'warning', summary: 'a createOutgoingCall number that is not E.164' },
@@ -27,17 +27,17 @@ export const AGENT_DIAGNOSTICS = {
27
27
  GUARDRAIL_TYPE_UNKNOWN: { severity: 'error', summary: 'a guardrail whose type is unknown' },
28
28
  INLINE_AGENT_COMPOSITE_INPUT: { severity: 'error', summary: 'an inline agent input bound to a computed expression' },
29
29
  INLINE_AGENT_EMPTY_RETURNS: { severity: 'warning', summary: 'an inline agent with returns: {}' },
30
- INLINE_AGENT_ESCALATION_APP_KEY_NOT_GUID: { severity: 'error', summary: 'an app escalation whose app key is not a GUID' },
31
- INLINE_AGENT_ESCALATION_APP_WITH_FIELDS: { severity: 'error', summary: 'an app escalation that also lists quick-form fields' },
32
- INLINE_AGENT_ESCALATION_FIELD_OPTIONS: { severity: 'error', summary: 'a quick-form escalation field whose options are invalid' },
33
- INLINE_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: { severity: 'warning', summary: 'a quick-form escalation field with options its type ignores' },
34
- INLINE_AGENT_ESCALATION_FIELD_SETTING_INVALID: { severity: 'error', summary: 'a quick-form escalation field with an invalid setting' },
35
- INLINE_AGENT_ESCALATION_FIELD_TYPE_UNKNOWN: { severity: 'error', summary: 'a quick-form escalation field of an unknown type' },
36
- INLINE_AGENT_ESCALATION_NO_APP: { severity: 'error', summary: 'an app escalation with no app' },
37
- INLINE_AGENT_ESCALATION_NO_FIELDS: { severity: 'error', summary: 'a quick-form escalation with no fields' },
38
- INLINE_AGENT_ESCALATION_NO_NAME: { severity: 'error', summary: 'an escalation with no name' },
39
- INLINE_AGENT_ESCALATION_QUICKFORM_WITH_APP: { severity: 'error', summary: 'a quick-form escalation that also names an app' },
40
- INLINE_AGENT_ESCALATION_VARIANT: { severity: 'error', summary: 'an escalation whose variant is unknown' },
30
+ FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID: { severity: 'error', summary: 'an app escalation whose app key is not a GUID' },
31
+ FLOW_AGENT_ESCALATION_APP_WITH_FIELDS: { severity: 'error', summary: 'an app escalation that also lists quick-form fields' },
32
+ FLOW_AGENT_ESCALATION_FIELD_OPTIONS: { severity: 'error', summary: 'a quick-form escalation field whose options are invalid' },
33
+ FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED: { severity: 'warning', summary: 'a quick-form escalation field with options its type ignores' },
34
+ FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID: { severity: 'error', summary: 'a quick-form escalation field with an invalid setting' },
35
+ FLOW_AGENT_ESCALATION_FIELD_TYPE_UNKNOWN: { severity: 'error', summary: 'a quick-form escalation field of an unknown type' },
36
+ FLOW_AGENT_ESCALATION_NO_APP: { severity: 'error', summary: 'an app escalation with no app' },
37
+ FLOW_AGENT_ESCALATION_NO_FIELDS: { severity: 'error', summary: 'a quick-form escalation with no fields' },
38
+ FLOW_AGENT_ESCALATION_NO_NAME: { severity: 'error', summary: 'an escalation with no name' },
39
+ FLOW_AGENT_ESCALATION_QUICKFORM_WITH_APP: { severity: 'error', summary: 'a quick-form escalation that also names an app' },
40
+ FLOW_AGENT_ESCALATION_VARIANT: { severity: 'error', summary: 'an escalation whose variant is unknown' },
41
41
  INLINE_AGENT_INPUT_NAME_AMBIGUOUS: { severity: 'warning', summary: 'two inline agent inputs that reach the platform under one name' },
42
42
  INLINE_AGENT_MEMORY_ID_NOT_GUID: { severity: 'error', summary: 'an agent memory whose id is not a GUID' },
43
43
  INLINE_AGENT_MEMORY_INCOMPLETE: { severity: 'error', summary: 'an agent memory missing its name or id' },
@@ -47,23 +47,24 @@ export const AGENT_DIAGNOSTICS = {
47
47
  INLINE_AGENT_PROMPT_JSON_TEXT: { severity: 'error', summary: 'an inline agent prompt that asks for JSON text' },
48
48
  INLINE_AGENT_READ_NOT_OUTPUT: { severity: 'error', summary: 'an inline agent read outside output' },
49
49
  INLINE_AGENT_READ_UNKNOWN_FIELD: { severity: 'error', summary: 'an inline agent read of a field returns does not declare' },
50
- INLINE_AGENT_RESOURCE_NODE_ID: { severity: 'error', summary: "an agent resource nodeId that is blank or another node's" },
51
- INLINE_AGENT_RESOURCE_SOURCE_DUP: { severity: 'error', summary: 'two agent resources, or two agents, with one source' },
52
- INLINE_AGENT_RESOURCE_SOURCE_NOT_GUID: { severity: 'error', summary: 'an agent resource source that is not a uuid' },
50
+ FLOW_AGENT_RESOURCE_NODE_ID: { severity: 'error', summary: "an agent resource nodeId that is blank or another node's" },
51
+ FLOW_AGENT_RESOURCE_SOURCE_DUP: { severity: 'error', summary: 'two agent resources, or two agents, with one source' },
52
+ FLOW_AGENT_RESOURCE_SOURCE_NOT_GUID: { severity: 'error', summary: 'an agent resource source that is not a uuid' },
53
53
  INLINE_AGENT_SCAFFOLD_MODEL: { severity: 'warning', summary: "an inline agent on the platform scaffold's model" },
54
54
  INLINE_AGENT_SOURCE_NOT_GUID: { severity: 'error', summary: 'an inline agent source that is not a uuid' },
55
- INLINE_AGENT_TOOL_A2A_INCOMPLETE: { severity: 'error', summary: 'an a2a tool missing its name, slug or key' },
56
- INLINE_AGENT_TOOL_CLIENTSIDE_NO_NAME: { severity: 'error', summary: 'a client-side tool with no name' },
57
- INLINE_AGENT_TOOL_CONNECTOR_NO_CONNECTION: { severity: 'error', summary: 'a connector tool with no connection or folder' },
58
- INLINE_AGENT_TOOL_HTTP_METHOD: { severity: 'error', summary: 'an HTTP-request tool with an unknown method' },
59
- INLINE_AGENT_TOOL_IXP_NO_NAME: { severity: 'error', summary: 'an IxP tool with no name' },
60
- INLINE_AGENT_TOOL_IXP_PROJECT_NOT_GUID: { severity: 'error', summary: 'an IxP tool whose projectId is not a uuid' },
61
- INLINE_AGENT_TOOL_KEY_NOT_GUID: { severity: 'error', summary: 'a process tool whose key is not a GUID' },
62
- INLINE_AGENT_TOOL_MCP_INCOMPLETE: { severity: 'error', summary: 'an MCP tool missing its name or key' },
63
- INLINE_AGENT_TOOL_NO_OPERATION: { severity: 'error', summary: 'a connector tool with no connector or operation' },
64
- INLINE_AGENT_TOOL_NO_RESOURCE_ID: { severity: 'error', summary: 'a process tool with no name or folderPath' },
65
- INLINE_AGENT_TOOL_UNKNOWN_BUILTIN: { severity: 'error', summary: 'a builtin tool that is not one of the three' },
66
- INLINE_AGENT_TOOL_UNKNOWN_KIND: { severity: 'error', summary: 'a tool of an unknown kind' },
55
+ FLOW_AGENT_TOOL_A2A_INCOMPLETE: { severity: 'error', summary: 'an a2a tool missing its name, slug or key' },
56
+ FLOW_AGENT_TOOL_CLIENTSIDE_NO_NAME: { severity: 'error', summary: 'a client-side tool with no name' },
57
+ FLOW_AGENT_TOOL_CLIENTSIDE_SCHEMA_TWICE: { severity: 'error', summary: 'a client-side tool given both inputs and inputSchema (or returns and outputSchema)' },
58
+ FLOW_AGENT_TOOL_CONNECTOR_NO_CONNECTION: { severity: 'error', summary: 'a connector tool with no connection or folder' },
59
+ FLOW_AGENT_TOOL_HTTP_METHOD: { severity: 'error', summary: 'an HTTP-request tool with an unknown method' },
60
+ FLOW_AGENT_TOOL_IXP_NO_NAME: { severity: 'error', summary: 'an IxP tool with no name' },
61
+ FLOW_AGENT_TOOL_IXP_PROJECT_NOT_GUID: { severity: 'error', summary: 'an IxP tool whose projectId is not a uuid' },
62
+ FLOW_AGENT_TOOL_KEY_NOT_GUID: { severity: 'error', summary: 'a process tool whose key is not a GUID' },
63
+ FLOW_AGENT_TOOL_MCP_INCOMPLETE: { severity: 'error', summary: 'an MCP tool missing its name or key' },
64
+ FLOW_AGENT_TOOL_NO_OPERATION: { severity: 'error', summary: 'a connector tool with no connector or operation' },
65
+ FLOW_AGENT_TOOL_NO_RESOURCE_ID: { severity: 'error', summary: 'a process tool with no name or folderPath' },
66
+ FLOW_AGENT_TOOL_UNKNOWN_BUILTIN: { severity: 'error', summary: 'a builtin tool that is not one of the three' },
67
+ FLOW_AGENT_TOOL_UNKNOWN_KIND: { severity: 'error', summary: 'a tool of an unknown kind' },
67
68
  INLINE_AGENT_UNDECLARED_PLACEHOLDER: { severity: 'error', summary: 'a prompt placeholder naming no declared input' },
68
69
  INLINE_AGENT_UNREFERENCED_INPUT: { severity: 'warning', summary: 'an inline agent input no prompt references' },
69
70
  VOICE_AGENT_ITERATIONS: { severity: 'error', summary: 'a voice agent whose maxIterations is outside 1 to 8' },
@@ -352,41 +353,6 @@ export function checkInlineAgent(inputs, ctx) {
352
353
  + `retrieval over a knowledge source use a context index instead (\`tools\`/context grounding). `
353
354
  + `On a tenant whose manifest does declare the handle, ignore this finding: \`compile\` does not run check.`);
354
355
  }
355
- // A context `query` is what the RUNTIME searches with, and it is not an
356
- // expression slot. A plain string is the model-invoked `dynamic` variant: the
357
- // text becomes the description the model reads before it writes its own query.
358
- // An expression renders as the `static` variant instead, whose `value` the
359
- // retriever is handed VERBATIM — there is no `$vars` scope inside the agent and
360
- // nothing templates it once `uip agent refresh` has stripped the node, so the
361
- // search runs on the literal text `=js:$vars…`. With the default `threshold: 0`
362
- // it still returns chunks, so it reads as working while retrieving on nonsense.
363
- // Refused rather than emitted until the argument-bound form is implemented
364
- // (`{ variant: 'argument' }`, which the runtime resolves from agent state).
365
- const contexts = inputs?.context === undefined ? []
366
- : Array.isArray(inputs.context) ? inputs.context : [inputs.context];
367
- for (const cx of contexts) {
368
- if (cx?.query !== undefined && typeof cx.query !== 'string') {
369
- at('AGENT_CONTEXT_QUERY_NOT_EXPRESSION', `Inline agent step "${step}" gives its context index "${cx.name ?? ''}" an EXPRESSION \`query\`. `
370
- + `The runtime searches with that value literally — it is not evaluated inside the agent — so `
371
- + `retrieval runs on the text of the expression and quietly returns unrelated chunks. Use a plain `
372
- + `string: it becomes the guidance the model reads before writing its own query, which is what a `
373
- + `run-dependent search needs.`);
374
- }
375
- }
376
- // A context index whose `id` is not a GUID is the serializer's AGENT_CONTEXT_NO_ID.
377
- // An index outside the deployment folder needs its folder named. The resource
378
- // file carries no `indexId`, so `indexName` + `folderPath` is the whole locator,
379
- // and `@uipath/tool-agent`'s `createIndexBinding` leaves the folder off the
380
- // binding when `folderPath` is empty. A WARNING, not an error: an index in the
381
- // deployment folder resolves without it.
382
- for (const cx of contexts) {
383
- if (cx != null && cx.folderPath === undefined) {
384
- warn('AGENT_CONTEXT_NO_FOLDER_PATH', `Inline agent step "${step}" grounds on context index "${cx.name ?? ''}" without a \`folderPath\`. `
385
- + `The emitted resource carries no index id, so the folder is half of how the runtime finds the `
386
- + `index, and the binding is written without one. Give the index's folder — `
387
- + `\`uip solution resources list --kind Index --source remote --search "<name>"\` returns it.`);
388
- }
389
- }
390
356
  // The definition's own `required`: systemPrompt, userPrompt, model — each with
391
357
  // `minLength: 1`, so a blank string is as invalid as a missing key.
392
358
  if (blank(inputs?.model)) {
@@ -407,27 +373,6 @@ export function checkInlineAgent(inputs, ctx) {
407
373
  + `and the one v1's smoke check for this node type FAILS a flow for keeping (it is the definition's `
408
374
  + `\`inputDefaults.model\`, not a choice). Pick a current model: \`uip agent model list\`.`);
409
375
  }
410
- // Where each resource node sits (`nodeId`, `source`): decompile writes them
411
- // for a node the canvas placed, and compile writes them as given. A blank or
412
- // taken `nodeId` and a `source` two of them share are the serializer's
413
- // INLINE_AGENT_RESOURCE_NODE_ID / INLINE_AGENT_RESOURCE_SOURCE_DUP; a `source`
414
- // that is not a uuid names a directory the platform does not expect (the
415
- // agent's own `source` has the same rule).
416
- const asList = (v) => (v === undefined ? [] : Array.isArray(v) ? v : [v]);
417
- const placed = [
418
- ...asList(inputs?.context).map((r) => ({ what: `context index "${r?.name ?? ''}"`, source: r?.source })),
419
- ...asList(inputs?.tools).map((r) => ({ what: `${r?.kind ?? ''} tool`, source: r?.source })),
420
- ...asList(inputs?.escalation).map((r) => ({ what: `escalation "${r?.name ?? ''}"`, source: r?.source })),
421
- ];
422
- for (const r of placed) {
423
- // Not trimmed: compile writes `source` as given, into `inputs.source` and the directory name.
424
- if (r.source !== undefined && !GUID_RE.test(String(r.source))) {
425
- at('INLINE_AGENT_RESOURCE_SOURCE_NOT_GUID', `Inline agent step "${step}" gives its ${r.what} the \`source\` ${JSON.stringify(r.source)}, which is not `
426
- + `a uuid${/^\s|\s$/.test(String(r.source)) ? ' (it has spaces around it)' : ''}. \`source\` is the resource's `
427
- + `directory under the agent's own (\`resources/<source>/resource.json\`) and the node's \`inputs.source\`. `
428
- + 'Omit it and one is derived from the flow id, the step and the resource.');
429
- }
430
- }
431
376
  if (inputs?.source !== undefined && !GUID_RE.test(String(inputs.source).trim())) {
432
377
  at('INLINE_AGENT_SOURCE_NOT_GUID', `Inline agent step "${step}"'s \`source\` is ${JSON.stringify(inputs.source)}, which is not a uuid. `
433
378
  + `\`source\` is the agent's own DIRECTORY name, and the platform resolves its configuration at `
@@ -576,6 +521,87 @@ export function checkInlineAgent(inputs, ctx) {
576
521
  }
577
522
  });
578
523
  }
524
+ // MEMORY (Phase 5A): identity is required — the node type is minted from it.
525
+ const mem = inputs?.memory;
526
+ if (mem !== undefined) {
527
+ if (blank(mem.name) || blank(mem.id)) {
528
+ at('INLINE_AGENT_MEMORY_INCOMPLETE', `Inline agent step "${step}"'s memory needs both \`name\` and \`id\` — the node type is minted from them `
529
+ + `(uipath.agent.resource.memory.<name>.<id>) and the runtime resolves the memory by id.`);
530
+ }
531
+ else if (!GUID_RE.test(String(mem.id).trim())) {
532
+ at('INLINE_AGENT_MEMORY_ID_NOT_GUID', `Inline agent step "${step}"'s memory \`id\` is ${JSON.stringify(mem.id)}, which is not a uuid. It is the `
533
+ + `memory's own id on the tenant, not its name.`);
534
+ }
535
+ }
536
+ checkAgentResources(inputs, ctx, 'Inline agent');
537
+ }
538
+ /**
539
+ * The resource rules an agent's `context`, `tools` and `escalation` share,
540
+ * whichever agent attaches them: the inline agent, and the voice and
541
+ * conversational agents, which attach the same resources (#1670). The codes are
542
+ * `FLOW_AGENT_*`, shared by all three; each message names the agent `who` is.
543
+ */
544
+ export function checkAgentResources(inputs, ctx, who) {
545
+ const step = ctx.step;
546
+ const at = (code, message, suggestion) => ctx.report(code, message, suggestion);
547
+ const warn = (code, message) => ctx.report(code, message);
548
+ const blank = (v) => v === undefined || v === null || (typeof v === 'string' && v.trim() === '');
549
+ // A context `query` is what the RUNTIME searches with, and it is not an
550
+ // expression slot. A plain string is the model-invoked `dynamic` variant: the
551
+ // text becomes the description the model reads before it writes its own query.
552
+ // An expression renders as the `static` variant instead, whose `value` the
553
+ // retriever is handed VERBATIM — there is no `$vars` scope inside the agent and
554
+ // nothing templates it once `uip agent refresh` has stripped the node, so the
555
+ // search runs on the literal text `=js:$vars…`. With the default `threshold: 0`
556
+ // it still returns chunks, so it reads as working while retrieving on nonsense.
557
+ // Refused rather than emitted until the argument-bound form is implemented
558
+ // (`{ variant: 'argument' }`, which the runtime resolves from agent state).
559
+ const contexts = inputs?.context === undefined ? []
560
+ : Array.isArray(inputs.context) ? inputs.context : [inputs.context];
561
+ for (const cx of contexts) {
562
+ if (cx?.query !== undefined && typeof cx.query !== 'string') {
563
+ at('FLOW_AGENT_CONTEXT_QUERY_NOT_EXPRESSION', `${who} step "${step}" gives its context index "${cx.name ?? ''}" an EXPRESSION \`query\`. `
564
+ + `The runtime searches with that value literally — it is not evaluated inside the agent — so `
565
+ + `retrieval runs on the text of the expression and quietly returns unrelated chunks. Use a plain `
566
+ + `string: it becomes the guidance the model reads before writing its own query, which is what a `
567
+ + `run-dependent search needs.`);
568
+ }
569
+ }
570
+ // A context index whose `id` is not a GUID is the serializer's FLOW_AGENT_CONTEXT_NO_ID.
571
+ // An index outside the deployment folder needs its folder named. The resource
572
+ // file carries no `indexId`, so `indexName` + `folderPath` is the whole locator,
573
+ // and `@uipath/tool-agent`'s `createIndexBinding` leaves the folder off the
574
+ // binding when `folderPath` is empty. A WARNING, not an error: an index in the
575
+ // deployment folder resolves without it.
576
+ for (const cx of contexts) {
577
+ if (cx != null && cx.folderPath === undefined) {
578
+ warn('FLOW_AGENT_CONTEXT_NO_FOLDER_PATH', `${who} step "${step}" grounds on context index "${cx.name ?? ''}" without a \`folderPath\`. `
579
+ + `The emitted resource carries no index id, so the folder is half of how the runtime finds the `
580
+ + `index, and the binding is written without one. Give the index's folder — `
581
+ + `\`uip solution resources list --kind Index --source remote --search "<name>"\` returns it.`);
582
+ }
583
+ }
584
+ // Where each resource node sits (`nodeId`, `source`): decompile writes them
585
+ // for a node the canvas placed, and compile writes them as given. A blank or
586
+ // taken `nodeId` and a `source` two of them share are the serializer's
587
+ // FLOW_AGENT_RESOURCE_NODE_ID / FLOW_AGENT_RESOURCE_SOURCE_DUP; a `source`
588
+ // that is not a uuid names a directory the platform does not expect (the
589
+ // agent's own `source` has the same rule).
590
+ const asList = (v) => (v === undefined ? [] : Array.isArray(v) ? v : [v]);
591
+ const placed = [
592
+ ...asList(inputs?.context).map((r) => ({ what: `context index "${r?.name ?? ''}"`, source: r?.source })),
593
+ ...asList(inputs?.tools).map((r) => ({ what: `${r?.kind ?? ''} tool`, source: r?.source })),
594
+ ...asList(inputs?.escalation).map((r) => ({ what: `escalation "${r?.name ?? ''}"`, source: r?.source })),
595
+ ];
596
+ for (const r of placed) {
597
+ // Not trimmed: compile writes `source` as given, into `inputs.source` and the directory name.
598
+ if (r.source !== undefined && !GUID_RE.test(String(r.source))) {
599
+ at('FLOW_AGENT_RESOURCE_SOURCE_NOT_GUID', `${who} step "${step}" gives its ${r.what} the \`source\` ${JSON.stringify(r.source)}, which is not `
600
+ + `a uuid${/^\s|\s$/.test(String(r.source)) ? ' (it has spaces around it)' : ''}. \`source\` is the resource's `
601
+ + `directory under the agent's own (\`resources/<source>/resource.json\`) and the node's \`inputs.source\`. `
602
+ + 'Omit it and one is derived from the flow id, the step and the resource.');
603
+ }
604
+ }
579
605
  // TOOLS and ESCALATION (card G16). Cheap identity checks only: a wrong KIND
580
606
  // or a non-uuid KEY emits a node type the tenant has never heard of, which
581
607
  // nothing downstream of the compiler can see — the resource is dropped from
@@ -586,11 +612,11 @@ export function checkInlineAgent(inputs, ctx) {
586
612
  for (const t of toolRefs) {
587
613
  const kind = t?.kind;
588
614
  // A builtin tool other than the three, and a kind no tool has, are the
589
- // serializer's INLINE_AGENT_TOOL_UNKNOWN_BUILTIN / INLINE_AGENT_TOOL_UNKNOWN_KIND.
615
+ // serializer's FLOW_AGENT_TOOL_UNKNOWN_BUILTIN / FLOW_AGENT_TOOL_UNKNOWN_KIND.
590
616
  if (kind === 'connector') {
591
617
  const c = t;
592
618
  if (blank(c.connector) || blank(c.operation)) {
593
- at('INLINE_AGENT_TOOL_NO_OPERATION', `Inline agent step "${step}" declares a connector tool without ${blank(c.connector) ? 'a `connector`' : 'an `operation`'}. `
619
+ at('FLOW_AGENT_TOOL_NO_OPERATION', `${who} step "${step}" declares a connector tool without ${blank(c.connector) ? 'a `connector`' : 'an `operation`'}. `
594
620
  + `Both name the curated-library entry the tool is resolved from — the same pair \`connector(…)\` takes.`, `{ kind: 'connector', connector: 'uipath-atlassian-jira', operation: 'create-issue' }`);
595
621
  }
596
622
  // A connector tool calls Integration Service on a CONNECTION, exactly as a
@@ -602,7 +628,7 @@ export function checkInlineAgent(inputs, ctx) {
602
628
  if (missing.length > 0) {
603
629
  const key = blank(c.connector) ? '<connector-key>' : String(c.connector);
604
630
  const op = blank(c.operation) ? '<operation>' : String(c.operation);
605
- at('INLINE_AGENT_TOOL_CONNECTOR_NO_CONNECTION', `Inline agent step "${step}"'s connector tool "${key}/${op}" has no ${missing.map((m) => `\`${m}\``).join(' or ')}. `
631
+ at('FLOW_AGENT_TOOL_CONNECTOR_NO_CONNECTION', `${who} step "${step}"'s connector tool "${key}/${op}" has no ${missing.map((m) => `\`${m}\``).join(' or ')}. `
606
632
  + `The tool calls Integration Service on a tenant connection: without one the agent's tool has no `
607
633
  + `connection binding, its resource.json carries none, and the solution's Resources never list it. `
608
634
  + `Name the bindings.json labels the same way \`connector()\` takes them — \`${prepareCommand(key, op)}\` `
@@ -613,13 +639,13 @@ export function checkInlineAgent(inputs, ctx) {
613
639
  else if (kind === 'ixp') {
614
640
  const x = t;
615
641
  if (blank(x.projectId) || !GUID_RE.test(String(x.projectId).trim())) {
616
- at('INLINE_AGENT_TOOL_IXP_PROJECT_NOT_GUID', `Inline agent step "${step}"'s IxP tool has \`projectId\` ${JSON.stringify(x.projectId)}, which is not a uuid. `
642
+ at('FLOW_AGENT_TOOL_IXP_PROJECT_NOT_GUID', `${who} step "${step}"'s IxP tool has \`projectId\` ${JSON.stringify(x.projectId)}, which is not a uuid. `
617
643
  + `It is the node type's tail (uipath.agent.resource.tool.ixp.<slug>.<projectId>), so a wrong one emits a `
618
644
  + `node type the tenant cannot resolve. Find it: uip maestro flow registry pull --force && `
619
645
  + `uip maestro flow registry search -f "type:startsWith=uipath.agent.resource.tool.ixp".`);
620
646
  }
621
647
  if (blank(x.name)) {
622
- at('INLINE_AGENT_TOOL_IXP_NO_NAME', `Inline agent step "${step}"'s IxP tool needs a \`name\` — the project's display name, which the definition `
648
+ at('FLOW_AGENT_TOOL_IXP_NO_NAME', `${who} step "${step}"'s IxP tool needs a \`name\` — the project's display name, which the definition `
623
649
  + `carries as both its label and \`inputDefaults.name\`.`);
624
650
  }
625
651
  }
@@ -627,19 +653,19 @@ export function checkInlineAgent(inputs, ctx) {
627
653
  || kind === 'maestro' || kind === 'function') {
628
654
  const p = t;
629
655
  if (blank(p.key) || !GUID_RE.test(String(p.key).trim())) {
630
- at('INLINE_AGENT_TOOL_KEY_NOT_GUID', `Inline agent step "${step}"'s '${String(kind)}' tool has \`key\` ${JSON.stringify(p.key)}, which is not a uuid. `
656
+ at('FLOW_AGENT_TOOL_KEY_NOT_GUID', `${who} step "${step}"'s '${String(kind)}' tool has \`key\` ${JSON.stringify(p.key)}, which is not a uuid. `
631
657
  + `The key IS the node type's tail (uipath.agent.resource.tool.…<key>), so a wrong one emits a node type `
632
658
  + `the tenant cannot resolve. Find it: uip maestro flow registry search "uipath.agent.resource.tool".`);
633
659
  }
634
660
  if (blank(p.name) || blank(p.folderPath)) {
635
- at('INLINE_AGENT_TOOL_NO_RESOURCE_ID', `Inline agent step "${step}"'s '${String(kind)}' tool needs both \`name\` and \`folderPath\` — they form the `
661
+ at('FLOW_AGENT_TOOL_NO_RESOURCE_ID', `${who} step "${step}"'s '${String(kind)}' tool needs both \`name\` and \`folderPath\` — they form the `
636
662
  + `binding's resourceKey ("<folderPath>.<name>"), which is how the deployed flow finds the resource.`);
637
663
  }
638
664
  }
639
665
  else if (kind === 'mcp') {
640
666
  const m = t;
641
667
  if (blank(m.name) || blank(m.key) || !GUID_RE.test(String(m.key).trim())) {
642
- at('INLINE_AGENT_TOOL_MCP_INCOMPLETE', `Inline agent step "${step}"'s MCP tool needs a \`name\` and a uuid \`key\` — the node type is minted `
668
+ at('FLOW_AGENT_TOOL_MCP_INCOMPLETE', `${who} step "${step}"'s MCP tool needs a \`name\` and a uuid \`key\` — the node type is minted `
643
669
  + `from them (uipath.agent.resource.tool.mcp.<name>.<key>) and the key is the reference the runtime `
644
670
  + `resolves.`);
645
671
  }
@@ -647,14 +673,14 @@ export function checkInlineAgent(inputs, ctx) {
647
673
  else if (kind === 'a2a') {
648
674
  const a = t;
649
675
  if (blank(a.name) || blank(a.key) || !GUID_RE.test(String(a.key).trim()) || blank(a.slug)) {
650
- at('INLINE_AGENT_TOOL_A2A_INCOMPLETE', `Inline agent step "${step}"'s remote-A2A tool needs \`name\`, a uuid \`key\`, and \`slug\` — the node `
676
+ at('FLOW_AGENT_TOOL_A2A_INCOMPLETE', `${who} step "${step}"'s remote-A2A tool needs \`name\`, a uuid \`key\`, and \`slug\` — the node `
651
677
  + `type is minted from name+key, and the runtime resolves the remote agent by slug (the platform's own `
652
678
  + `mapper refuses a blank one).`);
653
679
  }
654
680
  }
655
681
  else if (kind === 'clientside') {
656
682
  if (blank(t.name)) {
657
- at('INLINE_AGENT_TOOL_CLIENTSIDE_NO_NAME', `Inline agent step "${step}"'s client-side tool has no \`name\` — it is what the model calls, and the `
683
+ at('FLOW_AGENT_TOOL_CLIENTSIDE_NO_NAME', `${who} step "${step}"'s client-side tool has no \`name\` — it is what the model calls, and the `
658
684
  + `calling application dispatches on it.`);
659
685
  }
660
686
  }
@@ -662,7 +688,7 @@ export function checkInlineAgent(inputs, ctx) {
662
688
  const h = t;
663
689
  const m = h.method === undefined ? undefined : String(h.method).toUpperCase();
664
690
  if (m !== undefined && !['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].includes(m)) {
665
- at('INLINE_AGENT_TOOL_HTTP_METHOD', `Inline agent step "${step}"'s HTTP-request tool fixes the method to ${JSON.stringify(h.method)}. The `
691
+ at('FLOW_AGENT_TOOL_HTTP_METHOD', `${who} step "${step}"'s HTTP-request tool fixes the method to ${JSON.stringify(h.method)}. The `
666
692
  + `tool's contract allows GET, POST, PUT, PATCH, DELETE — anything else the runtime refuses at call time.`);
667
693
  }
668
694
  }
@@ -671,11 +697,11 @@ export function checkInlineAgent(inputs, ctx) {
671
697
  : Array.isArray(inputs.escalation) ? inputs.escalation : [inputs.escalation];
672
698
  for (const e of escalations) {
673
699
  if (blank(e?.name)) {
674
- at('INLINE_AGENT_ESCALATION_NO_NAME', `Inline agent step "${step}" declares an escalation without a \`name\`. The node's definition requires one `
700
+ at('FLOW_AGENT_ESCALATION_NO_NAME', `${who} step "${step}" declares an escalation without a \`name\`. The node's definition requires one `
675
701
  + `(\`minLength: 1\`).`);
676
702
  }
677
703
  // An unknown variant, a quick form naming an app, and an app task with
678
- // inline fields are the serializer's INLINE_AGENT_ESCALATION_VARIANT /
704
+ // inline fields are the serializer's FLOW_AGENT_ESCALATION_VARIANT /
679
705
  // _QUICKFORM_WITH_APP / _APP_WITH_FIELDS (`refuseLossyEscalation`,
680
706
  // inline-agent.ts): the emitter would rewrite or drop them. An unknown
681
707
  // variant has no rules of its own to check here.
@@ -684,53 +710,41 @@ export function checkInlineAgent(inputs, ctx) {
684
710
  if (e?.variant === 'quick-form') {
685
711
  // A form with nothing to fill in is a notification nobody can answer.
686
712
  if (!Array.isArray(e.fields) || e.fields.length === 0) {
687
- at('INLINE_AGENT_ESCALATION_NO_FIELDS', `Inline agent step "${step}"'s quick-form escalation declares no \`fields\` — the reviewer gets an `
713
+ at('FLOW_AGENT_ESCALATION_NO_FIELDS', `${who} step "${step}"'s quick-form escalation declares no \`fields\` — the reviewer gets an `
688
714
  + `empty form.`);
689
715
  }
690
716
  for (const f of Array.isArray(e.fields) ? e.fields : []) {
691
717
  if (!FORM_FIELD_TYPES.includes(String(f?.type))) {
692
- at('INLINE_AGENT_ESCALATION_FIELD_TYPE_UNKNOWN', `Inline agent step "${step}"'s quick-form escalation gives the field "${String(f?.id ?? '?')}" the type `
718
+ at('FLOW_AGENT_ESCALATION_FIELD_TYPE_UNKNOWN', `${who} step "${step}"'s quick-form escalation gives the field "${String(f?.id ?? '?')}" the type `
693
719
  + `${JSON.stringify(f?.type)}, ${formFieldTypeWhy(f?.type, `which the form does not recognize — it would `
694
720
  + `be published as a plain string`)}. Valid: ${validFormFieldTypesText()}.`, formFieldTypeHint(f?.type));
695
721
  }
696
722
  const optionsProblem = formFieldOptionsProblem(f);
697
723
  if (optionsProblem !== undefined) {
698
- const message = `Inline agent step "${step}"'s quick-form escalation field "${String(f?.id ?? '?')}" `
724
+ const message = `${who} step "${step}"'s quick-form escalation field "${String(f?.id ?? '?')}" `
699
725
  + `${formFieldOptionsWhy(optionsProblem, f?.type)}.`;
700
726
  if (optionsProblem === 'ignored')
701
- warn('INLINE_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED', message);
727
+ warn('FLOW_AGENT_ESCALATION_FIELD_OPTIONS_IGNORED', message);
702
728
  else {
703
- at('INLINE_AGENT_ESCALATION_FIELD_OPTIONS', message, `options: [{ id: 'opt-1', value: 'high', label: 'High' }, { id: 'opt-2', value: 'low', label: 'Low' }]`);
729
+ at('FLOW_AGENT_ESCALATION_FIELD_OPTIONS', message, `options: [{ id: 'opt-1', value: 'high', label: 'High' }, { id: 'opt-2', value: 'low', label: 'Low' }]`);
704
730
  }
705
731
  }
706
732
  for (const problem of formFieldSettingProblems(f)) {
707
- at('INLINE_AGENT_ESCALATION_FIELD_SETTING_INVALID', `Inline agent step "${step}"'s quick-form escalation gives the field "${String(f?.id ?? '?')}" `
733
+ at('FLOW_AGENT_ESCALATION_FIELD_SETTING_INVALID', `${who} step "${step}"'s quick-form escalation gives the field "${String(f?.id ?? '?')}" `
708
734
  + `${problem}. The platform refuses the form.`);
709
735
  }
710
736
  }
711
737
  continue;
712
738
  }
713
739
  if (blank(e?.app?.key) || blank(e?.app?.name)) {
714
- at('INLINE_AGENT_ESCALATION_NO_APP', `Inline agent step "${step}"'s escalation needs \`app.key\` and \`app.name\` — the deployed Action Center app `
740
+ at('FLOW_AGENT_ESCALATION_NO_APP', `${who} step "${step}"'s escalation needs \`app.key\` and \`app.name\` — the deployed Action Center app `
715
741
  + `that carries the review task. An escalation with no app is a task nobody can open.`);
716
742
  }
717
743
  else if (!GUID_RE.test(String(e.app.key).trim())) {
718
- at('INLINE_AGENT_ESCALATION_APP_KEY_NOT_GUID', `Inline agent step "${step}"'s escalation \`app.key\` is ${JSON.stringify(e.app.key)}, which is not a uuid. `
744
+ at('FLOW_AGENT_ESCALATION_APP_KEY_NOT_GUID', `${who} step "${step}"'s escalation \`app.key\` is ${JSON.stringify(e.app.key)}, which is not a uuid. `
719
745
  + `It is the app's own key on the tenant, not its name.`);
720
746
  }
721
747
  }
722
- // MEMORY (Phase 5A): identity is required — the node type is minted from it.
723
- const mem = inputs?.memory;
724
- if (mem !== undefined) {
725
- if (blank(mem.name) || blank(mem.id)) {
726
- at('INLINE_AGENT_MEMORY_INCOMPLETE', `Inline agent step "${step}"'s memory needs both \`name\` and \`id\` — the node type is minted from them `
727
- + `(uipath.agent.resource.memory.<name>.<id>) and the runtime resolves the memory by id.`);
728
- }
729
- else if (!GUID_RE.test(String(mem.id).trim())) {
730
- at('INLINE_AGENT_MEMORY_ID_NOT_GUID', `Inline agent step "${step}"'s memory \`id\` is ${JSON.stringify(mem.id)}, which is not a uuid. It is the `
731
- + `memory's own id on the tenant, not its name.`);
732
- }
733
- }
734
748
  }
735
749
  /**
736
750
  * A read of an inline agent's output: `out('<step>', '<field>')`.
@@ -37,6 +37,19 @@ export interface LiftedInlineAgent {
37
37
  * preserved exactly; only these logical names change.)
38
38
  */
39
39
  export declare function liftInlineAgent(node: FlowNode, ctx: FlowDeserializeContext): LiftedInlineAgent;
40
+ /**
41
+ * The resources on an agent's artifact handles, as the factory's `context`,
42
+ * `tools`, `escalation` and `memory` options in source: the inline agent's, and
43
+ * the voice and conversational agents', which take the same three
44
+ * resources but no memory. With `withMemory` false a `memory` edge is left
45
+ * unclaimed, so decompile reports it as an edge the source cannot spell.
46
+ */
47
+ export declare function liftAgentResources(node: FlowNode, ctx: FlowDeserializeContext, withMemory: boolean): {
48
+ context: string | undefined;
49
+ tools: string | undefined;
50
+ escalation: string | undefined;
51
+ memory: string | undefined;
52
+ };
40
53
  export declare function printInlineAgent(spec: LiftedInlineAgent, ctx: FlowPrintContext): {
41
54
  factory: string;
42
55
  options: (readonly [string, string | undefined])[];