@uipath/maestro-builder-sdk 6.107.0 → 6.109.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.
Files changed (35) hide show
  1. package/dist/api-index.md +10 -10
  2. package/dist/api-members.md +50 -45
  3. package/dist/check-cli.js +8 -3
  4. package/dist/check.d.ts +8 -0
  5. package/dist/check.js +10 -6
  6. package/dist/compile-cli.js +5 -0
  7. package/dist/core/nodes/node-type.d.ts +12 -2
  8. package/dist/core/refusals.d.ts +13 -0
  9. package/dist/core/refusals.js +13 -0
  10. package/dist/core/resource-resolution.d.ts +32 -0
  11. package/dist/core/resource-resolution.js +2 -0
  12. package/dist/core/solution-projects.d.ts +63 -0
  13. package/dist/core/solution-projects.js +37 -0
  14. package/dist/flow-node-type.d.ts +17 -0
  15. package/dist/merge-cli.js +8 -3
  16. package/dist/nodes/process/flow/check.js +36 -20
  17. package/dist/nodes/process/flow/contract.d.ts +81 -0
  18. package/dist/nodes/process/flow/contract.js +253 -0
  19. package/dist/nodes/process/flow/in-solution.d.ts +32 -0
  20. package/dist/nodes/process/flow/in-solution.js +169 -0
  21. package/dist/nodes/process/flow/node-type.js +37 -12
  22. package/dist/nodes/process/flow/refusals.d.ts +4 -1
  23. package/dist/nodes/process/flow/refusals.js +13 -1
  24. package/dist/nodes/process/flow/spec.d.ts +175 -20
  25. package/dist/registry/prepare/process-schema.d.ts +39 -0
  26. package/dist/registry/prepare/process-schema.js +90 -0
  27. package/dist/registry/prepare/resources.d.ts +2 -1
  28. package/dist/registry/prepare/resources.js +24 -3
  29. package/dist/registry/uip/commands.d.ts +8 -0
  30. package/dist/registry/uip/commands.js +10 -0
  31. package/dist/serialize.d.ts +9 -0
  32. package/dist/serialize.js +4 -2
  33. package/dist/solution-projects-files.d.ts +6 -0
  34. package/dist/solution-projects-files.js +163 -0
  35. package/package.json +2 -2
@@ -15,6 +15,8 @@ import { cliSpelling, shellArg } from './cli-spelling.js';
15
15
  import { CompileRefusal } from './compile-refusal.js';
16
16
  /** The kind a Data Fabric entity is catalogued under. */
17
17
  export const ENTITY_KIND = 'Entity';
18
+ /** The kind a published Orchestrator process (RPA, API workflow, function, agentic process, agent) is catalogued under. */
19
+ export const PROCESS_KIND = 'Process';
18
20
  /**
19
21
  * The kinds `uip solution resources list --kind` documents, by lower case, so
20
22
  * `asset` and `Asset` key one row. A kind not listed is kept as written: the
@@ -0,0 +1,63 @@
1
+ /**
2
+ * core/solution-projects — the sibling projects of the solution a flow is
3
+ * authored in, as `compile` and `check` read them off disk (#1978).
4
+ *
5
+ * A step that calls a sibling (`rpaWorkflow({ location: 'in-solution', project:
6
+ * 'CalculatePay' })`) needs that sibling's resource key, its project id and its
7
+ * argument contract. All three are files of the solution:
8
+ *
9
+ * - `resources/solution_folder/process/<type>/<Project>.json` holds the
10
+ * resource: `resource.key` (the node type's suffix), `resource.projectKey`
11
+ * (the step's `projectId`) and `resource.type`, the folder it sits in;
12
+ * - the project's `entry-points.json` holds the contract: the first entry
13
+ * point's `type`, and its `input` / `output` schemas.
14
+ *
15
+ * This module is the portable half: the shape the CLI hands in. Reading the
16
+ * files is `solution-projects-files.ts`, next to the CLIs that call it, so the
17
+ * flow core reaches no `node:` builtin (FB015).
18
+ */
19
+ /** One sibling project, as its resource file and entry points describe it. */
20
+ export interface SolutionProject {
21
+ /** The resource's name (`resource.name`), which is the project's name. */
22
+ readonly name: string;
23
+ /**
24
+ * The resource's type (`resource.type`), which is also the folder under
25
+ * `resources/solution_folder/process/` it sits in: `process`, `api`,
26
+ * `function`, `agent`, `flow`, `processOrchestration`, `caseManagement`, …
27
+ */
28
+ readonly resourceType: string;
29
+ /** The resource key (`resource.key`): the suffix of the node type. */
30
+ readonly key: string;
31
+ /** The project id (`resource.projectKey`): the step's `projectId`. */
32
+ readonly projectId: string;
33
+ /** The resource file, relative to the solution folder, for messages. */
34
+ readonly file: string;
35
+ /**
36
+ * The first entry point's `type` in the project's `entry-points.json`, as
37
+ * written (`agent`, `function`, `Api`, `Process`); undefined when the
38
+ * project has no readable entry points.
39
+ */
40
+ readonly entryPointType?: string;
41
+ /**
42
+ * The output fields the first entry point declares, each with its JSON
43
+ * schema `type`; undefined when no contract is on disk (an RPA project
44
+ * that was never built has none, #1042).
45
+ */
46
+ readonly outputs?: Readonly<Record<string, string>>;
47
+ }
48
+ /** The solution a flow is authored in, and its sibling projects. */
49
+ export interface SolutionProjects {
50
+ /** The folder holding the solution's `.uipx`, for messages. */
51
+ readonly dir: string;
52
+ /** Every project with a resource file under `resources/solution_folder/process/`. */
53
+ readonly projects: readonly SolutionProject[];
54
+ }
55
+ /** GUIDs compare case-insensitively: a `.uipx` id and a `projectKey` can differ in case. */
56
+ export declare function sameGuid(a: string, b: string): boolean;
57
+ /**
58
+ * The project named `name`: the exact name, else the only one that matches
59
+ * ignoring case. Undefined when none does, or when several do.
60
+ */
61
+ export declare function solutionProjectByName(solution: SolutionProjects, name: string): SolutionProject | undefined;
62
+ /** The project whose resource key is `key`, if any. */
63
+ export declare function solutionProjectByKey(solution: SolutionProjects, key: string): SolutionProject | undefined;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * core/solution-projects — the sibling projects of the solution a flow is
3
+ * authored in, as `compile` and `check` read them off disk (#1978).
4
+ *
5
+ * A step that calls a sibling (`rpaWorkflow({ location: 'in-solution', project:
6
+ * 'CalculatePay' })`) needs that sibling's resource key, its project id and its
7
+ * argument contract. All three are files of the solution:
8
+ *
9
+ * - `resources/solution_folder/process/<type>/<Project>.json` holds the
10
+ * resource: `resource.key` (the node type's suffix), `resource.projectKey`
11
+ * (the step's `projectId`) and `resource.type`, the folder it sits in;
12
+ * - the project's `entry-points.json` holds the contract: the first entry
13
+ * point's `type`, and its `input` / `output` schemas.
14
+ *
15
+ * This module is the portable half: the shape the CLI hands in. Reading the
16
+ * files is `solution-projects-files.ts`, next to the CLIs that call it, so the
17
+ * flow core reaches no `node:` builtin (FB015).
18
+ */
19
+ /** GUIDs compare case-insensitively: a `.uipx` id and a `projectKey` can differ in case. */
20
+ export function sameGuid(a, b) {
21
+ return a.trim().toLowerCase() === b.trim().toLowerCase();
22
+ }
23
+ /**
24
+ * The project named `name`: the exact name, else the only one that matches
25
+ * ignoring case. Undefined when none does, or when several do.
26
+ */
27
+ export function solutionProjectByName(solution, name) {
28
+ const exact = solution.projects.find((p) => p.name === name);
29
+ if (exact !== undefined)
30
+ return exact;
31
+ const folded = solution.projects.filter((p) => p.name.toLowerCase() === name.toLowerCase());
32
+ return folded.length === 1 ? folded[0] : undefined;
33
+ }
34
+ /** The project whose resource key is `key`, if any. */
35
+ export function solutionProjectByKey(solution, key) {
36
+ return solution.projects.find((p) => sameGuid(p.key, key));
37
+ }
@@ -9,6 +9,7 @@
9
9
  * owns the node's id, label, `typeVersion`, layout, edges and definition dedupe;
10
10
  * each context below is the whole of what a node type can see.
11
11
  */
12
+ import type { SolutionProjects } from './core/solution-projects.js';
12
13
  import type { ResourceResolutions } from './core/resource-resolution.js';
13
14
  import type { ArtifactContexts, FactoryCall, NodeType, OptionKeyLists } from './core/nodes/node-type.js';
14
15
  import type { VersionedNodeType } from './core/nodes/versioned.js';
@@ -159,6 +160,12 @@ export interface FlowSerializeContext {
159
160
  * (docs/ENTITY_RESOLUTION_DESIGN.md); undefined when the compile was given no ledger.
160
161
  */
161
162
  readonly resources: ResourceResolutions | undefined;
163
+ /**
164
+ * The solution the flow is compiled in, and its sibling projects, as the CLI
165
+ * read them (`SerializeOpts.solution`, #1978); undefined when the compile was
166
+ * given none.
167
+ */
168
+ readonly solution?: SolutionProjects;
162
169
  /**
163
170
  * The bundled definition `<typeName>@<version>`, else one the flow carries;
164
171
  * undefined when neither exists. When the node is emitted at a carried
@@ -673,6 +680,16 @@ export interface FlowNodeType<Spec> extends NodeType<Spec, FlowNodeContribution,
673
680
  typeName: string;
674
681
  version?: string;
675
682
  } | undefined;
683
+ /**
684
+ * The spec with what the solution on disk says filled in, for a type whose
685
+ * step can name a sibling project instead of copying its identifiers (an
686
+ * in-solution process step's `project`, #1978). `check` and `serialize` both
687
+ * call it before anything else reads the spec — the type's `check`,
688
+ * `serialize` and `output` see its result — so the two rungs judge the same
689
+ * spec. `solution` is undefined when the caller gave none. Omitted: the spec
690
+ * is used as authored.
691
+ */
692
+ withSolution?(spec: Spec, solution: SolutionProjects | undefined): Spec;
676
693
  }
677
694
  /** What decompile's graph reads off a saved node's exits (`FlowNodeType.savedExits`). */
678
695
  export interface FlowSavedExits {
package/dist/merge-cli.js CHANGED
@@ -81,6 +81,7 @@ import { writeJsonFile } from './core/json-file.js';
81
81
  import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
82
82
  import { inlineAgentResources, mergeBindingsV2, projectBindingRows, refreshInlineAgentRows } from './bindings-v2.js';
83
83
  import { readBindingsV2, readInlineAgentFiles } from './bindings-v2-files.js';
84
+ import { readSolutionProjects } from './solution-projects-files.js';
84
85
  import { basename, dirname, join, relative, resolve } from 'node:path';
85
86
  import { MergeRefusedError, mergeFlowWithSidecars } from './merge.js';
86
87
  import { sidecarSetFromList } from './merge-sidecars.js';
@@ -313,7 +314,11 @@ export async function run(argv) {
313
314
  const bindings = derivedFrom || editedIsSource ? new Bindings(flagValue(argv, '--bindings') ?? defaultBindingsFile()) : undefined;
314
315
  // The node registry cache a manifest-less `rawNode` resolves from (#1981), read on first use.
315
316
  const nodeCatalog = readNodeCatalog();
316
- const compileOpts = { library, bindings, nodeCatalog };
317
+ // The solution the edited source sits in, read as compile and check read it, so a
318
+ // step named by `project` merges as it compiles (#1978).
319
+ const solution = readSolutionProjects(dirname(resolve(editedPath)));
320
+ const compileOpts = { library, bindings, nodeCatalog, ...(solution !== undefined ? { solution } : {}) };
321
+ const checkOpts = { ...flowCheckOpts(library, bindings), nodeCatalog, ...(solution !== undefined ? { solution } : {}) };
317
322
  // Resolved as decompile resolves it, so a split `.flow` merges as the document the
318
323
  // source was decompiled from.
319
324
  const originalParts = [];
@@ -334,7 +339,7 @@ export async function run(argv) {
334
339
  editedSidecars = compiled.sidecars;
335
340
  drafts = compiled.drafts;
336
341
  lowering = compiled.lowering.map(onNode);
337
- diagnostics = checkEdited(compiled.built, edited, { ...flowCheckOpts(library, bindings), nodeCatalog });
342
+ diagnostics = checkEdited(compiled.built, edited, checkOpts);
338
343
  }
339
344
  else {
340
345
  edited = JSON.parse(readFileSync(editedPath, 'utf8'));
@@ -435,7 +440,7 @@ export async function run(argv) {
435
440
  const baselineFindings = baselineCompile === undefined ? undefined : findingCounts([
436
441
  ...baselineCompile.drafts,
437
442
  ...baselineCompile.lowering,
438
- ...checkEdited(baselineCompile.built, baselineCompile.flow, { ...flowCheckOpts(library, bindings), nodeCatalog }).filter((d) => d.level === 'error'),
443
+ ...checkEdited(baselineCompile.built, baselineCompile.flow, checkOpts).filter((d) => d.level === 'error'),
439
444
  ]);
440
445
  const unplacedDrafts = splitUnplaced(unplaced, baselineFindings);
441
446
  const unplacedChecks = splitUnplaced(checked.unplaced, baselineFindings);
@@ -3,6 +3,7 @@ import { GUID_RE } from '../../../core/binding-messages.js';
3
3
  import { nearestName } from '../../../core/edit-distance.js';
4
4
  import { ownEntry } from '../../../core/own-entry.js';
5
5
  import { blank } from '../../../core/process-resource.js';
6
+ import { returnsFromTenantHint } from './contract.js';
6
7
  export const PROCESS_DIAGNOSTICS = {
7
8
  AGENT_EMPTY_INPUT_FLOOR: { severity: 'warning', summary: 'an agent step that binds no inputs' },
8
9
  AGENT_EMPTY_RETURNS: { severity: 'warning', summary: 'an agent step with returns: {}' },
@@ -55,6 +56,19 @@ export const PROCESS_DIAGNOSTICS = {
55
56
  FUNCTION_READ_NOT_OUTPUT: { severity: 'error', summary: 'a function step read outside output' },
56
57
  FUNCTION_READ_UNKNOWN_FIELD: { severity: 'error', summary: 'a function step read of a field returns does not declare' },
57
58
  FUNCTION_READ_WITHOUT_RETURNS: { severity: 'error', summary: 'a function step field read with no returns' },
59
+ IN_SOLUTION_KEY_MISMATCH: { severity: 'error', summary: 'an in-solution process step whose key or projectId is not its project\'s' },
60
+ IN_SOLUTION_NO_SOLUTION: { severity: 'error', summary: 'an in-solution process step named by project, compiled outside a solution' },
61
+ IN_SOLUTION_PROJECT_NOT_FOUND: { severity: 'error', summary: 'an in-solution process step naming no project of the solution' },
62
+ IN_SOLUTION_PROJECT_PUBLISHED: { severity: 'error', summary: 'a process step naming a project with location published' },
63
+ IN_SOLUTION_WRONG_BUILDER: { severity: 'error', summary: 'an in-solution process step whose builder does not call its project\'s type' },
64
+ PROCESS_INPUT_MISSING: { severity: 'error', summary: 'a published process step that leaves out an input the recorded process requires' },
65
+ PROCESS_INPUT_TYPE: { severity: 'error', summary: 'a published process step input whose literal is not the recorded argument type' },
66
+ PROCESS_INPUT_UNKNOWN: { severity: 'error', summary: 'a published process step input the recorded process does not declare' },
67
+ PROCESS_KEY_MISMATCH: { severity: 'error', summary: 'a published process step whose key is not the one prepare recorded' },
68
+ PROCESS_RECORD_STALE: { severity: 'warning', summary: 'a published process step whose prepare record is more than 24 hours old' },
69
+ PROCESS_RETURNS_TYPE: { severity: 'warning', summary: 'a published process step returns field typed differently from the recorded output' },
70
+ PROCESS_RETURNS_UNKNOWN: { severity: 'error', summary: 'a published process step returns field the recorded process does not return' },
71
+ PROCESS_TYPE_MISMATCH: { severity: 'error', summary: 'a published process step whose factory is not for the recorded process type' },
58
72
  RPA_KEY_NOT_KEY: { severity: 'error', summary: 'an RPA step whose key is not a GUID' },
59
73
  RPA_LOCAL_HAS_FOLDER: { severity: 'error', summary: 'an RPA step in-solution, with a folderPath' },
60
74
  RPA_LOCAL_NO_PROJECT_ID: { severity: 'warning', summary: 'an RPA step in-solution, with no projectId' },
@@ -127,10 +141,12 @@ export function checkRpaWorkflow(inputs, ctx) {
127
141
  at('RPA_NO_FOLDER', `RPA step "${step}" has no \`folderPath\`. The runtime starts the job by name + folder, so the `
128
142
  + `Orchestrator folder holding the process is required.`, `folderPath: 'Shared/uipath-maestro-flow/ProjectEuler RPA'`);
129
143
  }
130
- if (inSolution && blank(inputs?.projectId)) {
144
+ // A step named by `project` has its projectId filled by `withSolution`, or the
145
+ // serializer's IN_SOLUTION_* refusal says why it could not be (in-solution.ts).
146
+ if (inSolution && blank(inputs?.projectId) && blank(inputs?.project)) {
131
147
  at('RPA_LOCAL_NO_PROJECT_ID', noProjectIdMessage('RPA', step, 'process'), `projectId: '<resource.projectKey>'`);
132
148
  }
133
- else if (inSolution && !GUID_RE.test(String(inputs.projectId).trim())) {
149
+ else if (inSolution && !blank(inputs?.projectId) && !GUID_RE.test(String(inputs.projectId).trim())) {
134
150
  at('RPA_LOCAL_PROJECT_ID_NOT_GUID', `In-solution RPA step "${step}" has projectId ${JSON.stringify(inputs.projectId)}, which is not `
135
151
  + `the sibling project's GUID. Read \`resource.projectKey\` from the generated resource file.`, `projectId: '<resource.projectKey>'`);
136
152
  }
@@ -184,10 +200,10 @@ export function checkApiWorkflow(inputs, ctx) {
184
200
  + `Orchestrator folder holding the workflow is required. For an API workflow in the SAME solution, set `
185
201
  + `\`location: 'in-solution'\` and its \`projectId\` instead.`, `folderPath: 'Shared'`);
186
202
  }
187
- if (inSolution && blank(inputs?.projectId)) {
203
+ if (inSolution && blank(inputs?.projectId) && blank(inputs?.project)) {
188
204
  at('APIWF_LOCAL_NO_PROJECT_ID', noProjectIdMessage('API workflow', step, 'api'), `projectId: '<resource.projectKey>'`);
189
205
  }
190
- else if (inSolution && !GUID_RE.test(String(inputs.projectId).trim())) {
206
+ else if (inSolution && !blank(inputs?.projectId) && !GUID_RE.test(String(inputs.projectId).trim())) {
191
207
  at('APIWF_LOCAL_PROJECT_ID_NOT_GUID', `In-solution API workflow step "${step}" has projectId ${JSON.stringify(inputs.projectId)}, which is not `
192
208
  + `the sibling project's GUID. Read \`resource.projectKey\` from the generated resource file.`, `projectId: '<resource.projectKey>'`);
193
209
  }
@@ -235,10 +251,10 @@ export function checkPublishedFunction(inputs, ctx) {
235
251
  + `than assuming 'Shared'. For a coded function in the SAME solution, set \`location: 'in-solution'\` `
236
252
  + `and its \`projectId\` instead.`, `folderPath: 'Shared/acme-echo'`);
237
253
  }
238
- if (inSolution && blank(inputs?.projectId)) {
254
+ if (inSolution && blank(inputs?.projectId) && blank(inputs?.project)) {
239
255
  at('FUNCTION_LOCAL_NO_PROJECT_ID', noProjectIdMessage('function', step, 'function'), `projectId: '<resource.projectKey>'`);
240
256
  }
241
- else if (inSolution && !GUID_RE.test(String(inputs.projectId).trim())) {
257
+ else if (inSolution && !blank(inputs?.projectId) && !GUID_RE.test(String(inputs.projectId).trim())) {
242
258
  at('FUNCTION_LOCAL_PROJECT_ID_NOT_GUID', `In-solution function step "${step}" has projectId ${JSON.stringify(inputs.projectId)}, which is not `
243
259
  + `the sibling project's GUID. Read \`resource.projectKey\` from the generated resource file.`, `projectId: '<resource.projectKey>'`);
244
260
  }
@@ -318,11 +334,11 @@ export function checkAgenticProcess(inputs, ctx) {
318
334
  + `published process instead (drop \`location\` and \`projectId\`, set \`folderPath\`), or use `
319
335
  + `\`form: 'flow'\` if the sibling is a Flow.`, `location: 'published', folderPath: 'Shared/<folder>'`);
320
336
  }
321
- if (inSolution && blank(inputs?.projectId)) {
337
+ if (inSolution && blank(inputs?.projectId) && blank(inputs?.project)) {
322
338
  const folder = (ownEntry(AGENTIC_PROCESS_FORMS, inputs?.form ?? 'bpmn') ?? AGENTIC_PROCESS_FORMS.bpmn).solutionFolder;
323
339
  at('AGENTIC_LOCAL_NO_PROJECT_ID', noProjectIdMessage('agentic process', step, folder), `projectId: '<resource.projectKey>'`);
324
340
  }
325
- else if (inSolution && !GUID_RE.test(String(inputs.projectId).trim())) {
341
+ else if (inSolution && !blank(inputs?.projectId) && !GUID_RE.test(String(inputs.projectId).trim())) {
326
342
  at('AGENTIC_LOCAL_PROJECT_ID_NOT_GUID', `In-solution agentic process step "${step}" has projectId ${JSON.stringify(inputs.projectId)}, which is not `
327
343
  + `the sibling project's GUID. Read \`resource.projectKey\` from the generated resource file.`, `projectId: '<resource.projectKey>'`);
328
344
  }
@@ -352,8 +368,8 @@ export function rpaWorkflowRead(spec) {
352
368
  codePrefix: 'RPA',
353
369
  label: 'RPA process',
354
370
  whenUndeclared: `The process's output arguments live on the tenant; declare the ones you read. `
355
- + `\`uip maestro flow registry get uipath.core.rpa-workflow.${spec?.key}\` shows what the platform `
356
- + `synthesizes for it.`,
371
+ + `\`uip maestro flow registry get uipath.core.rpa-workflow.${spec?.key ?? '<key>'}\` shows what the platform `
372
+ + `synthesizes for it.${returnsFromTenantHint(spec)}`,
357
373
  };
358
374
  }
359
375
  /** A read of a published function's result — the api-workflow rules, this family's codes. */
@@ -371,8 +387,8 @@ export function checkPublishedFunctionRead({ node: name, field, rest, reader: st
371
387
  report('FUNCTION_READ_WITHOUT_RETURNS', `"$vars.${name}.output.${wanted}" (read in "${step}") reads a field of function "${name}"'s `
372
388
  + `result, but the step declares no \`returns\` — so the node carries no output schema and nothing can `
373
389
  + `tell a real field from a typo. The function's output arguments live on the tenant; declare the ones `
374
- + `you read. \`uip maestro flow registry get uipath.core.function.${spec.key}\` shows what the platform `
375
- + `synthesizes for it.`, `returns: { ${wanted}: 'string' }`);
390
+ + `you read. \`uip maestro flow registry get uipath.core.function.${spec.key ?? '<key>'}\` shows what the platform `
391
+ + `synthesizes for it.${returnsFromTenantHint(spec)}`, `returns: { ${wanted}: 'string' }`);
376
392
  return;
377
393
  }
378
394
  if (declared.includes(wanted))
@@ -398,8 +414,8 @@ export function checkApiWorkflowRead({ node: name, field, rest, reader: step },
398
414
  report('APIWF_READ_WITHOUT_RETURNS', `"$vars.${name}.output.${wanted}" (read in "${step}") reads a field of API workflow "${name}"'s `
399
415
  + `result, but the step declares no \`returns\` — so the node carries no output schema and nothing `
400
416
  + `can tell a real field from a typo. The workflow's output arguments live on the tenant; declare `
401
- + `the ones you read. \`uip maestro flow registry get uipath.core.api-workflow.${spec.key}\` `
402
- + `shows what the platform synthesizes for it.`, `returns: { ${wanted}: 'string' }`);
417
+ + `the ones you read. \`uip maestro flow registry get uipath.core.api-workflow.${spec.key ?? '<key>'}\` `
418
+ + `shows what the platform synthesizes for it.${returnsFromTenantHint(spec)}`, `returns: { ${wanted}: 'string' }`);
403
419
  return;
404
420
  }
405
421
  if (declared.includes(wanted))
@@ -437,8 +453,8 @@ export function checkAgenticProcessRead({ node: name, field, rest, reader: step
437
453
  report('AGENTIC_READ_WITHOUT_RETURNS', `"$vars.${name}.output.${wanted}" (read in "${step}") reads a field of agentic process "${name}"'s `
438
454
  + `result, but the step declares no \`returns\` — so the node carries no output schema and nothing can `
439
455
  + `tell a real field from a typo. The process's output arguments live on the tenant; declare the ones `
440
- + `you read. \`uip maestro flow registry get uipath.core.agentic-process.${spec.key}\` shows what `
441
- + `the platform synthesizes for it.`, `returns: { ${wanted}: 'string' }`);
456
+ + `you read. \`uip maestro flow registry get uipath.core.agentic-process.${spec.key ?? '<key>'}\` shows what `
457
+ + `the platform synthesizes for it.${returnsFromTenantHint(spec)}`, `returns: { ${wanted}: 'string' }`);
442
458
  return;
443
459
  }
444
460
  if (declared.includes(wanted))
@@ -496,12 +512,12 @@ export function checkAgent(inputs, ctx) {
496
512
  + `two same-named agents: this tenant has \`CountLetters\` in both \`Shared\` and `
497
513
  + `\`Shared/uipath-maestro-flow/CountLetters CodedAgent\`.`, `folderPath: 'Shared/uipath-maestro-flow/CountLetters LowCode'`);
498
514
  }
499
- if (inSolution && blank(inputs?.projectId)) {
515
+ if (inSolution && blank(inputs?.projectId) && blank(inputs?.project)) {
500
516
  at('AGENT_LOCAL_NO_PROJECT_ID', `In-solution agent step "${step}" has no \`projectId\`. Read \`resource.projectKey\` from `
501
517
  + `\`resources/solution_folder/process/agent/<project>.json\` after registering the sibling `
502
518
  + `with \`uip solution projects add\`.`, `projectId: '<resource.projectKey>'`);
503
519
  }
504
- else if (inSolution && !GUID_RE.test(String(inputs.projectId).trim())) {
520
+ else if (inSolution && !blank(inputs?.projectId) && !GUID_RE.test(String(inputs.projectId).trim())) {
505
521
  at('AGENT_LOCAL_PROJECT_ID_NOT_GUID', `In-solution agent step "${step}" has projectId ${JSON.stringify(inputs.projectId)}, which is not `
506
522
  + `the registered sibling project's GUID. Read \`resource.projectKey\` from the generated resource file.`, `projectId: '<resource.projectKey>'`);
507
523
  }
@@ -563,8 +579,8 @@ export function checkAgentRead({ node: name, field, rest, reader: step }, spec,
563
579
  report('AGENT_READ_WITHOUT_RETURNS', `"$vars.${name}.output.${wanted}" (read in "${step}") reads a field of agent "${name}"'s result, but `
564
580
  + `the step declares no \`returns\` — so the node carries no output schema and nothing can tell a real `
565
581
  + `field from a typo. The agent's output fields live on the tenant; declare the ones you read. `
566
- + `\`uip maestro flow registry get uipath.core.agent.${spec.key}\` shows them under `
567
- + `outputDefinition.output.schema.properties.`, `returns: { ${wanted}: 'string' }`);
582
+ + `\`uip maestro flow registry get uipath.core.agent.${spec.key ?? '<key>'}\` shows them under `
583
+ + `outputDefinition.output.schema.properties.${returnsFromTenantHint(spec)}`, `returns: { ${wanted}: 'string' }`);
568
584
  return;
569
585
  }
570
586
  if (declared.includes(wanted))
@@ -0,0 +1,81 @@
1
+ /**
2
+ * A published process step against what `registry prepare` recorded for it
3
+ * (#1979): the release key, the Orchestrator `ProcessType`, and the argument
4
+ * contract in the process's `ArgumentsV2` (`registry/prepare/process-schema.ts`).
5
+ *
6
+ * The author names the process the way the runtime does, by `name` and
7
+ * `folderPath`; the ledger row for `['Process', name, folderPath]` then
8
+ *
9
+ * - fills in what the author left out: `key` (the node type's suffix) and,
10
+ * when nothing is declared, `returns` (the output schema);
11
+ * - checks what the author wrote: the key and the factory against the
12
+ * recorded process, each `inputs` name and literal against the input
13
+ * schema, the required inputs, and each `returns` field against the output
14
+ * schema.
15
+ *
16
+ * Without a row nothing changes, so a flow that types the key and `returns` by
17
+ * hand checks and compiles exactly as before. A row older than 24 hours still
18
+ * fills in (a release key does not change while the process exists), but is
19
+ * no longer checked against (`PROCESS_RECORD_STALE`). A side of `ArgumentsV2`
20
+ * Orchestrator left blank is unknown: neither checked nor filled in from. A process in the solution
21
+ * (`location: 'in-solution'`) is never looked up here.
22
+ *
23
+ * @example
24
+ * // prepare --kind Process --name NameToAgeFixed --folder-path Shared, then:
25
+ * apiWorkflow({ name: 'NameToAgeFixed', folderPath: 'Shared', inputs: { name: 'tomasz' } })
26
+ * // compiles with key 'ce857908-…' and returns { EstimatedAge: 'integer' }
27
+ */
28
+ import type { ReturnFieldType } from '../../../core/actions.js';
29
+ import { type ResourceRef, type ResourceResolutions } from '../../../core/resource-resolution.js';
30
+ import type { FlowCheckContext } from '../../../flow-node-type.js';
31
+ /**
32
+ * The ledger reference a published process step names: kind `Process`, its
33
+ * `name`, and its `folderPath` as the folder. Undefined for an in-solution step,
34
+ * or one missing either, which has nothing to look up.
35
+ */
36
+ export declare function processRef(inputs: unknown): ResourceRef | undefined;
37
+ /**
38
+ * The `returns` a recorded output schema declares, or undefined when it
39
+ * declares no field.
40
+ *
41
+ * @example
42
+ * recordedReturns({ type: 'object', properties: { EstimatedAge: { type: 'integer' } } }) // { EstimatedAge: 'integer' }
43
+ */
44
+ export declare function recordedReturns(output: Readonly<Record<string, unknown>> | undefined): Record<string, ReturnFieldType> | undefined;
45
+ /**
46
+ * The step's inputs with what `prepare` recorded filled in: a blank `key` from
47
+ * the row, and an omitted `returns` from its output schema when that side was
48
+ * recorded (not for a fire-and-forget dispatch, which publishes no output).
49
+ * Anything the author wrote is kept. A row of any age is used, so the same
50
+ * source and ledger compile the same `.flow`; without a row, the inputs as
51
+ * they are.
52
+ */
53
+ export declare function withRecordedProcess<T>(inputs: T, resources: ResourceResolutions | undefined): T;
54
+ /**
55
+ * Why a published step with no key has none, naming the `prepare` command that
56
+ * records it — a missing row and an old one read differently
57
+ * (`resolveRecordedResource`'s wording). Undefined when the step names no
58
+ * process to look up (no name or folder, or in-solution), or its row is usable.
59
+ *
60
+ * @example
61
+ * unrecordedKeyReason({ name: 'NameToAgeFixed', folderPath: 'Shared' }, undefined)
62
+ * // 'process "NameToAgeFixed" in folder "Shared" is not resolved. … registry prepare --kind Process --name NameToAgeFixed --folder-path Shared'
63
+ */
64
+ export declare function unrecordedKeyReason(inputs: unknown, resources: ResourceResolutions | undefined): string | undefined;
65
+ /**
66
+ * The sentence a `*_READ_WITHOUT_RETURNS` message ends with for a published
67
+ * step: the `prepare` command that records the output schema compile then
68
+ * writes. `''` when the step names no process to record.
69
+ */
70
+ export declare function returnsFromTenantHint(inputs: unknown): string;
71
+ /**
72
+ * Check a published process step against its recorded row: the key, the
73
+ * factory (`subType`, the binding subtype the step would be written with, is
74
+ * the `ProcessType` it starts), the inputs and the declared `returns`. A step
75
+ * with no fresh row is not checked here.
76
+ *
77
+ * @param inputs - The step's inputs as the author wrote them (not filled in).
78
+ * @param subType - The `resourceSubType` the step's definition carries, e.g. `'Api'`.
79
+ * @param label - How a message names the step's kind, e.g. `'API workflow'`.
80
+ */
81
+ export declare function checkRecordedProcess(inputs: unknown, ctx: FlowCheckContext, subType: string, label: string): void;