@uipath/maestro-sdk 1.204.0 → 1.205.0-preview.258

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.
@@ -1,5 +1,7 @@
1
+ import { type LoginStatus } from "@uipath/auth";
1
2
  import type { NodeManifest } from "@uipath/flow-core";
2
3
  import { type NodeSearchSummary } from "./node-storage.js";
4
+ import { type InSolutionNodes } from "./solution-discovery.js";
3
5
  import type { ParsedFilters } from "./types";
4
6
  interface PullNodesOptions {
5
7
  force?: boolean;
@@ -11,13 +13,47 @@ interface PullNodesResult {
11
13
  source?: "ootb" | "authenticated";
12
14
  cacheWritten?: boolean;
13
15
  info?: string;
16
+ /**
17
+ * Set when the combined manifest failed validation and flow-core fell back
18
+ * to OOTB nodes only. The cache was not written.
19
+ */
20
+ failures?: PullFailure[];
21
+ /** Node sources missing from a manifest that was still cached. */
22
+ missingSources?: PullFailure[];
23
+ }
24
+ /** One node source flow-core could not include in the manifest. */
25
+ export interface PullFailure {
26
+ source: string;
27
+ reason: string;
14
28
  }
15
29
  interface PullRemoteNodesResult {
16
30
  nodes: NodeManifest[];
17
31
  source: "ootb" | "authenticated";
18
32
  cacheable: boolean;
33
+ /** Tenant the nodes were fetched for; set whenever `cacheable` is. */
34
+ scope?: string;
19
35
  info?: string;
36
+ /** Set for an OOTB-only fallback; such a result is never cacheable. */
37
+ failures?: PullFailure[];
38
+ /** Node sources missing from a result that is still cacheable. */
39
+ missingSources?: PullFailure[];
40
+ }
41
+ /** What a caller can do about a tenant manifest that failed validation. */
42
+ export declare const MANIFEST_VALIDATION_NEXT_STEP = "Fix or remove the tenant resource named in the validation error, then run 'registry pull' again.";
43
+ /**
44
+ * Thrown by a registry read when there is no cache and the tenant manifest
45
+ * failed validation, so only OOTB nodes exist. Callers that turn a failed
46
+ * lookup into their own message (`flow node add`) check
47
+ * {@link isTenantManifestInvalidError} and rethrow it instead.
48
+ */
49
+ export declare class TenantManifestInvalidError extends Error {
50
+ readonly code = "TenantManifestInvalid";
51
+ /** The OOTB nodes flow-core fell back to; `getNode` still serves these. */
52
+ readonly ootbNodes: NodeManifest[];
53
+ constructor(failures: PullFailure[], ootbNodes?: NodeManifest[]);
20
54
  }
55
+ /** By `code`, not `instanceof`: the class can load twice across packages. */
56
+ export declare function isTenantManifestInvalidError(error: unknown): boolean;
21
57
  /**
22
58
  * Pull and sync all node sources with smart caching
23
59
  *
@@ -30,7 +66,59 @@ interface PullRemoteNodesResult {
30
66
  * @returns Result with sync count and cache status
31
67
  */
32
68
  export declare function pullNodes(options?: PullNodesOptions): Promise<PullNodesResult>;
33
- export declare function pullRemoteNodes(): Promise<PullRemoteNodesResult>;
69
+ export declare function pullRemoteNodes(loginStatus?: LoginStatus): Promise<PullRemoteNodesResult>;
70
+ export interface CurrentTenantNodesResult {
71
+ nodes: NodeManifest[];
72
+ /** True when served from the local cache without any manifest request. */
73
+ fromCache: boolean;
74
+ source: "cache" | "ootb" | "authenticated";
75
+ info?: string;
76
+ }
77
+ /**
78
+ * The node manifest for the tenant the CLI is logged in to, served from the
79
+ * shared registry cache (`~/.uipath/nodes/`) when that cache is fresh and was
80
+ * fetched for this same tenant, and fetched (then cached) otherwise.
81
+ *
82
+ * This is the one reader for callers that need the *current* manifest rather
83
+ * than whatever was last pulled — `flow validate`'s stale-handle check. It
84
+ * shares the cache `registry pull` writes, so:
85
+ * - repeated validates within 30 minutes make no manifest requests;
86
+ * - `registry pull --force` refreshes what validate reads;
87
+ * - a validate on a miss leaves the cache warm for `registry get/search`.
88
+ *
89
+ * @param options.force - Skip the cache read and refetch (the fresh result is
90
+ * still written back, as `registry pull --force` does).
91
+ *
92
+ * @example
93
+ * await loadCurrentTenantNodes(); // 1st call: fetch + cache
94
+ * await loadCurrentTenantNodes(); // within 30 min: { fromCache: true }
95
+ * await loadCurrentTenantNodes({ force: true }); // always fetches
96
+ */
97
+ export declare function loadCurrentTenantNodes(options?: {
98
+ force?: boolean;
99
+ }): Promise<CurrentTenantNodesResult>;
100
+ /**
101
+ * Discover the in-solution nodes for the current working directory, with the
102
+ * siblings whose argument contract is unknown, from one read of each project.
103
+ * Throws if no .uipx solution is found (user explicitly requested --local).
104
+ */
105
+ export declare function getLocalSolutionSnapshot(): Promise<InSolutionNodes>;
106
+ /**
107
+ * The envelope `Warning` for a `--local` result: names each sibling project
108
+ * behind one of the `shown` nodes whose arguments are unknown, so an empty
109
+ * `inputDefinition` is not mistaken for "takes no arguments"
110
+ * (UiPath/builder-sdk#1043). Undefined when there is nothing to say. Pure:
111
+ * `snapshot` is the same {@link getLocalSolutionSnapshot} read the nodes came
112
+ * from, so the node and its warning describe the same files.
113
+ */
114
+ export declare function localContractWarning(snapshot: InSolutionNodes, shown: readonly Pick<NodeManifest, "nodeType">[]): string | undefined;
115
+ /**
116
+ * The nodes among `nodes` that match `keyword` in their type, category, tags,
117
+ * label or description (case-insensitive). The match {@link searchNodes} runs.
118
+ */
119
+ export declare function filterNodesByKeyword(nodes: NodeManifest[], keyword: string): NodeManifest[];
120
+ /** The node in `nodes` with `nodeType` (case-insensitive), or null. */
121
+ export declare function findNodeByType(nodes: NodeManifest[], nodeType: string): NodeManifest | null;
34
122
  /**
35
123
  * List cached nodes, falling back to live OOTB nodes if no cache exists.
36
124
  * With `--local`, returns only in-solution sibling project nodes and throws
@@ -70,6 +158,15 @@ export declare function getNode(nodeType: string, options?: {
70
158
  export declare function getNodeEnriched(nodeType: string, connectionId?: string, options?: {
71
159
  local?: boolean;
72
160
  }): Promise<NodeManifest | null>;
161
+ /**
162
+ * {@link getNodeEnriched} for `--local`, plus the envelope `Warning` for that
163
+ * node ({@link localContractWarning}), both from one
164
+ * {@link getLocalSolutionSnapshot} read.
165
+ */
166
+ export declare function getLocalNodeEnriched(nodeType: string, connectionId?: string): Promise<{
167
+ node: NodeManifest | null;
168
+ warning?: string;
169
+ }>;
73
170
  /**
74
171
  * Search nodes with advanced filtering
75
172
  * Supports both keyword search and structured filters
@@ -13,27 +13,24 @@ import type { BpmnExtensionType, DiscoveredConnector, DiscoveredProcess, Maestro
13
13
  /**
14
14
  * Single source of truth for the Orchestrator resource types surfaced by
15
15
  * discovery. Every type here corresponds to a bindable canvas node so an
16
- * authored BPMN element (e.g. Orchestrator.StartJob, Orchestrator.BusinessRules)
17
- * can resolve its `releaseKey`.
16
+ * authored BPMN element (e.g. Orchestrator.StartJob) can resolve its
17
+ * `releaseKey`.
18
18
  *
19
19
  * Values are PascalCase, consistent with flow-core's ManifestClient
20
20
  * `ORCHESTRATOR_RESOURCE_TYPES` and orchestrator-tool's `validProcessTypes`.
21
21
  * They map directly onto the `ProcessType` values of the Orchestrator
22
22
  * `ListReleases` API — there is no separate per-type release endpoint.
23
23
  *
24
- * This list is a deliberate SUPERSET of flow-core's
25
- * `ORCHESTRATOR_RESOURCE_TYPES` (`Process`, `Agent`, `ProcessOrchestration`,
26
- * `Flow`, `CaseManagement`, `Api`, `Function`): those seven mirror the
27
- * canvas/node-index exactly, and `BusinessRules` is the bindable extra the
28
- * canvas does not yet surface but Maestro authoring can reference.
29
- * orchestrator-tool's `processes list` command filters the same endpoint by
30
- * these same `ProcessType` values, so they are known-good filters.
24
+ * The list matches flow-core's `ORCHESTRATOR_RESOURCE_TYPES` exactly, so the
25
+ * registry returns the release set the canvas/node-index binds against.
26
+ * Business rules are not releases and are not discovered here: the
27
+ * `Orchestrator.BusinessRules` spec entry points agents at `uip rules list`.
31
28
  *
32
- * Whether `BusinessRules`/`CaseManagement` actually return releases depends on
33
- * tenant licensing and is only confirmable against a live tenant; an empty
34
- * result for those types is expected and not an error.
29
+ * Whether `CaseManagement` actually returns releases depends on tenant
30
+ * licensing and is only confirmable against a live tenant; an empty result is
31
+ * expected and not an error.
35
32
  */
36
- export declare const ORCHESTRATOR_RESOURCE_TYPES: readonly ["Process", "ProcessOrchestration", "Agent", "Flow", "Api", "Function", "CaseManagement", "BusinessRules"];
33
+ export declare const ORCHESTRATOR_RESOURCE_TYPES: readonly ["Process", "ProcessOrchestration", "Agent", "Flow", "Api", "Function", "CaseManagement"];
37
34
  export type OrchestratorResourceType = (typeof ORCHESTRATOR_RESOURCE_TYPES)[number];
38
35
  export interface PullRegistryOptions {
39
36
  force?: boolean;
@@ -30,7 +30,34 @@ export { type AgentProjectMetadataReader, setAgentProjectMetadataReader, } from
30
30
  * Walk CWD then its parent and grandparent (3 levels) looking for a .uipx file.
31
31
  * Returns null if not inside a solution.
32
32
  */
33
+ /**
34
+ * Where {@link findSolutionFromCwd} looks for a `.uipx`, nearest first: the
35
+ * working directory, its parent and its grandparent. Exported so a caller
36
+ * that has to tell "no solution" from "a solution it could not read" looks
37
+ * in the same places.
38
+ */
39
+ export declare function solutionSearchDirs(): string[];
40
+ /**
41
+ * The solution whose `.uipx` sits directly in `dir`, or null when there is
42
+ * none, it cannot be read, it is not JSON, or it has no `SolutionId`. The one
43
+ * place that rule lives: {@link findSolutionFromCwd} reads each folder it
44
+ * searches through it, and a caller that already knows the solution folder
45
+ * reads that folder through it too.
46
+ */
47
+ export declare function readSolutionAt(dir: string): Promise<SolutionContext | null>;
33
48
  export declare function findSolutionFromCwd(): Promise<SolutionContext | null>;
49
+ /**
50
+ * What is on disk for a project's argument contract.
51
+ * - `known`: a contract was read. It may be empty: a file that declares no
52
+ * entry points, or a Flow with no globals, really takes no arguments.
53
+ * - `missing`: no `entry-points.json` in any of the three places and no
54
+ * `.flow` file. The arguments are unknown, and the empty I/O is a
55
+ * placeholder. A project is in that state until its first build writes the
56
+ * file (UiPath/builder-sdk#1042).
57
+ * - `unreadable`: a contract file is there but could not be read or parsed,
58
+ * and nothing else gave a contract. Also unknown, for a different reason.
59
+ */
60
+ export type ContractState = "known" | "missing" | "unreadable";
34
61
  /**
35
62
  * Read entry-points.json from a project directory.
36
63
  * Tries flat layout first, then content/ subdirectory.
@@ -52,11 +79,96 @@ export declare function findSolutionFromCwd(): Promise<SolutionContext | null>;
52
79
  * root and has no `.flow` file. It is build output, so it comes after the
53
80
  * `.flow` source: a Flow sibling with a stale build copy under `.local/`
54
81
  * still reports its live variables.
82
+ *
83
+ * Also returns the {@link ContractState}: whether that contract is known
84
+ * (possibly empty), missing, or unreadable.
55
85
  */
56
- export declare function readProjectEntryPointIO(projectDir: string): Promise<ProjectEntryPointIO>;
86
+ export declare function resolveProjectEntryPointIO(projectDir: string): Promise<{
87
+ io: ProjectEntryPointIO;
88
+ contract: ContractState;
89
+ }>;
57
90
  /**
58
- * Build NodeManifest[] for all invokable sibling projects in the solution.
91
+ * Scan resources/solution_folder/process/ to build a map of projectKey → resource.key.
92
+ * Studio Web stores the Orchestrator process key in resource.key, linked to the
93
+ * .uipx project ID via resource.projectKey.
94
+ * Falls back gracefully if resources/ doesn't exist (e.g. fresh/unpublished solution).
95
+ *
96
+ * The map is keyed by the **lowercased** projectKey: these are GUIDs, which
97
+ * compare case-insensitively, and a `.uipx` id can differ in case from the
98
+ * `projectKey` naming the same project. Look up with
99
+ * `map.get(projectId.toLowerCase())`, or two readers disagree about whether a
100
+ * project has a resource.
101
+ */
102
+ export declare function loadResourceKeyMap(solutionDir: string): Promise<Map<string, string>>;
103
+ export interface ProjectWithoutProcessResource {
104
+ id: string;
105
+ name: string;
106
+ type: string;
107
+ }
108
+ export type MissingProcessResourceHint = {
109
+ Warning: string;
110
+ Instructions: string;
111
+ } | Record<string, never>;
112
+ type SiblingScope = Pick<SolutionContext, "solutionDir" | "projects" | "currentProjectId">;
113
+ /** A sibling project whose argument contract is not on disk, or not readable. */
114
+ export interface UnknownContractProject {
115
+ name: string;
116
+ type: string;
117
+ projectDir: string;
118
+ /**
119
+ * The `nodeType`s of the nodes built for it, exactly as the mapper emitted
120
+ * them. Each project type's mapper picks its own key (a Process node ends
121
+ * in the process resource key, an Agent node in the project id), so the
122
+ * warning matches these rather than guessing a suffix.
123
+ */
124
+ nodeTypes: string[];
125
+ /** Why the arguments are unknown. */
126
+ contract: Exclude<ContractState, "known">;
127
+ }
128
+ /**
129
+ * The in-solution nodes, and the sibling projects among them whose arguments
130
+ * are unknown rather than empty. Both come from one read of each project, so
131
+ * a node and its warning can never disagree about the same file.
132
+ */
133
+ export interface InSolutionNodes {
134
+ manifests: NodeManifest[];
135
+ /**
136
+ * Projects whose nodes carry `inputDefinition: {}` as a placeholder. That
137
+ * reads exactly like a project with no arguments, so the caller should
138
+ * say so (UiPath/builder-sdk#1043).
139
+ */
140
+ unknownContracts: UnknownContractProject[];
141
+ }
142
+ /**
143
+ * Build NodeManifest[] for all invokable sibling projects in the solution,
144
+ * plus the projects whose argument contract is unknown
145
+ * ({@link InSolutionNodes.unknownContracts}).
59
146
  * Non-invokable types (Library, Tests, Connector, etc.) are silently skipped.
60
- * The current project (ctx.currentProjectId) is excluded to prevent self-reference.
61
147
  */
62
- export declare function buildInSolutionNodeManifests(ctx: SolutionContext): Promise<NodeManifest[]>;
148
+ export declare function buildInSolutionNodes(ctx: SolutionContext): Promise<InSolutionNodes>;
149
+ /**
150
+ * The envelope `Warning` for `projects`, or undefined when there is nothing
151
+ * to say. Names no tool: how a project gets built is its own tool's
152
+ * business, and an SDK holds no project type's lifecycle (AGENTS.md Hard
153
+ * Rule 19). The type and folder it names are enough to pick the build.
154
+ */
155
+ export declare function unknownContractWarning(projects: readonly UnknownContractProject[]): string | undefined;
156
+ /**
157
+ * Invokable sibling projects that buildInSolutionNodes leaves out
158
+ * because the solution has no process resource for them yet. Their node type
159
+ * is keyed by that resource's key, which only exists once
160
+ * `uip solution resources refresh` writes it; a key offered before then
161
+ * changes on the next refresh.
162
+ */
163
+ export declare function findProjectsWithoutProcessResource(ctx: SiblingScope): Promise<ProjectWithoutProcessResource[]>;
164
+ export declare function describeProjectsWithoutProcessResource(projects: ProjectWithoutProcessResource[], solutionDir: string): MissingProcessResourceHint;
165
+ /**
166
+ * Explains a node type that ends in the id of a project with no process
167
+ * resource. Earlier builds offered that id as a stand-in key, so a Flow may
168
+ * still hold such a type; it never resolves.
169
+ */
170
+ export declare function explainNodeTypeWithoutProcessResource(nodeType: string): Promise<{
171
+ message: string;
172
+ instructions: string;
173
+ } | undefined>;
174
+ export declare function resourcesRefreshCommand(solutionDir: string): string;
@@ -0,0 +1,8 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * Give every leaf under `group` its example, by the trailing words of its
4
+ * path (`instance element cancel`, `process settings get`). A leaf the table
5
+ * does not name keeps none, so a new shared command shows up as missing on
6
+ * the scorecard rather than borrowing another's example.
7
+ */
8
+ export declare const attachSharedExamples: (group: Command) => void;
@@ -95,6 +95,13 @@ export interface MaestroProcessSummary {
95
95
  runningCount: number;
96
96
  faultedCount: number;
97
97
  }
98
+ /**
99
+ * What `GET /processes/summary` answers: the summaries under `processes`, not
100
+ * a bare array (the live response, alpha 2026-10-09).
101
+ */
102
+ export interface MaestroProcessSummaryPage {
103
+ processes?: MaestroProcessSummary[];
104
+ }
98
105
  export interface GoToTransition {
99
106
  sourceElementId: string;
100
107
  targetElementId: string;