@uipath/maestro-sdk 1.207.0 → 1.208.0-preview.410

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.
@@ -12,7 +12,7 @@ export { BPMN_SPEC, toBpmnXmlElementName, } from "./manifest/bpmn-spec";
12
12
  export type { BpmnExtensionType, DiscoveredConnector, DiscoveredProcess, MaestroRegistry, RegistryMetadata, } from "./manifest/types";
13
13
  export { buildQueryString } from "./query-string";
14
14
  export type { CompactField, ConnectorInfo, ConnectorMethodInfo, ContextEntry, FieldReference, FilterCondition, FilterField, FilterOperator, ISField, ISFieldMethod, ISMetadata, ISMetadataParam, ParsedFilters, SolutionContext, SyncMetadata, TriggerField, TriggerFieldEvent, TriggerObjectMetadata, } from "./registry/index.js";
15
- export { ACTIVITY_VERSION_V4, type AgentProjectMetadataReader, applySavedFilterTree, assertActivityMetadataResolved, assertConnectionConnector, buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, ConnectionConnectorMismatchError, createConfiguredActivityClient, enrichConnectorNode, explainNodeTypeWithoutProcessResource, extractActivityFilterFields, extractMultipartParameters, extractTriggerEventParameters, extractTriggerFilterFields, FilterParseError, fetchConnectionInfo, fetchConnectorActivityMetadataV4, fetchConnectorMaxPageSize, fetchConnectorMetadata, fetchConnectorTriggerMetadata, filterNodes, findProjectsWithoutProcessResource, findSolutionFromCwd, gatedNodeFailure, getConnectorConfiguration, getConnectorInfo, getNode, getNodeEnriched, inlineMultipartFileValues, isConnectorNode, isConnectorTriggerNode, isKnownSdkNodeType, isTenantManifestInvalidError, isTenantManifestUnavailableError, isV4ActivityConfiguration, listKnownSdkNodes, listNodes, loadCurrentTenantNodes, loadIndexMetadata, loadResourceKeyMap, MANAGED_HTTP_CONNECTOR_KEY, parseFilterString, pullNodes, pullRemoteNodes, readSolutionAt, registerRegistryCommand, resolveNodeStorageDir, resourcesRefreshCommand, SUPPORTED_ACTIVITY_VERSIONS, searchNodes, searchNodesWithFilters, searchWithFilters, setAgentProjectMetadataReader, solutionSearchDirs, TenantManifestInvalidError, TenantManifestUnavailableError, } from "./registry/index.js";
15
+ export { ACTIVITY_VERSION_V4, type AgentProjectMetadataReader, applySavedFilterTree, assertActivityMetadataResolved, assertConnectionConnector, buildActivityEssentialConfiguration, buildInputMetadata, buildManagedHttpEssentialConfiguration, ConnectionConnectorMismatchError, createConfiguredActivityClient, currentNodeCacheScope, enrichConnectorNode, explainNodeTypeWithoutProcessResource, extractActivityFilterFields, extractMultipartParameters, extractTriggerEventParameters, extractTriggerFilterFields, FilterParseError, fetchConnectionInfo, fetchConnectorActivityMetadataV4, fetchConnectorMaxPageSize, fetchConnectorMetadata, fetchConnectorTriggerMetadata, filterNodes, findProjectsWithoutProcessResource, findSolutionFromCwd, gatedNodeFailure, getConnectorConfiguration, getConnectorInfo, getNode, getNodeEnriched, inlineMultipartFileValues, isConnectorNode, isConnectorTriggerNode, isKnownSdkNodeType, isTenantManifestInvalidError, isTenantManifestUnavailableError, isV4ActivityConfiguration, listKnownSdkNodes, listNodes, loadBundledNodes, loadCachedTenantNodes, loadCurrentTenantNodes, loadIndexMetadata, loadResourceKeyMap, MANAGED_HTTP_CONNECTOR_KEY, parseFilterString, pullNodes, pullRemoteNodes, readSolutionAt, registerRegistryCommand, resolveNodeStorageDir, resourcesRefreshCommand, SUPPORTED_ACTIVITY_VERSIONS, searchNodes, searchNodesWithFilters, searchWithFilters, setAgentProjectMetadataReader, solutionSearchDirs, TenantManifestInvalidError, TenantManifestUnavailableError, } from "./registry/index.js";
16
16
  export { countProcessesByType, type EnrichActivityOptions, getEnrichedActivityMetadata, getExtensionType, getRegistry, ORCHESTRATOR_RESOURCE_TYPES, type OrchestratorResourceType, pullRegistry, searchRegistry, } from "./registry/registry-service";
17
17
  export { CACHE_EXPIRATION_MS, loadRegistry, loadRegistryMetadata, saveRegistry, } from "./registry/storage";
18
18
  export type { DebugInstanceCommandsConfig } from "./shared-commands/debug-instances";
@@ -233,6 +233,12 @@ export interface MaestroRegistry {
233
233
  * caches written by older builds, which reads as stale.
234
234
  */
235
235
  staticFingerprint?: string;
236
+ /**
237
+ * Which tenant the discovered half was fetched for (`nodeCacheScope`).
238
+ * Absent on a registry built with no session, and on one written before
239
+ * the cache recorded its tenant; neither is served from the cache.
240
+ */
241
+ scope?: string;
236
242
  static: {
237
243
  extensionTypes: Record<string, BpmnExtensionType>;
238
244
  bpmnElements: Record<string, unknown>;
@@ -262,6 +268,8 @@ export interface RegistryMetadata {
262
268
  * `version` is hand-maintained and cannot be trusted to move.
263
269
  */
264
270
  staticFingerprint?: string;
271
+ /** The registry's {@link MaestroRegistry.scope}, for the `pull` fast path. */
272
+ scope?: string;
265
273
  extensionTypeCount: number;
266
274
  connectorCount: number;
267
275
  processCount: number;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Which login a local cache was fetched for, and whether a caller may serve
3
+ * it. Shared by every tenant cache under the home directory (the flow node
4
+ * cache, the BPMN registry, the case resource indexes) so they agree on one
5
+ * rule: a cache answers only for the login it was fetched for — the same
6
+ * platform URL, organization, tenant, identity and token scopes.
7
+ *
8
+ * A leaf on purpose: `@uipath/auth` and `@uipath/common` only, so a storage
9
+ * module can import it without pulling in the registry services.
10
+ */
11
+ import { type LoginStatus } from "@uipath/auth";
12
+ /**
13
+ * The cache key for a login's node manifest: platform URL, organization,
14
+ * tenant, who the token acts as, and the scopes it carries. The manifest
15
+ * request carries no folder (flow-core's `AuthContext` is org + tenant only),
16
+ * so the folder is not part of the key.
17
+ *
18
+ * The identity and scopes are in the key because they decide what the fetch
19
+ * can read: an application token gets 401 from the connector catalogue, so
20
+ * its index lacks every connector node. Keyed by tenant alone, that partial
21
+ * index and its miss-refresh record would answer a user's lookup on the same
22
+ * tenant with "not found".
23
+ *
24
+ * Returns `undefined` when the URL, organization or tenant is missing — an
25
+ * unauthenticated caller has no tenant, and must never read a logged-in
26
+ * tenant's nodes.
27
+ *
28
+ * @example
29
+ * nodeCacheScope({ baseUrl: "https://cloud.uipath.com/", organizationId: "Org-1", tenantId: "T-1", identity: { userId: "U-1" }, scopes: ["OR.Jobs", "IS"] })
30
+ * // => "https://cloud.uipath.com|org-1|t-1|u-1|is or.jobs"
31
+ */
32
+ export declare function nodeCacheScope(login: {
33
+ baseUrl?: string;
34
+ organizationId?: string;
35
+ tenantId?: string;
36
+ identity?: {
37
+ userId?: string;
38
+ clientId?: string;
39
+ };
40
+ scopes?: string[];
41
+ }): string | undefined;
42
+ /** The cache scope of the given login, or `undefined` when not logged in. */
43
+ export declare function loginScope(loginStatus: LoginStatus): string | undefined;
44
+ /**
45
+ * The node-cache scope of the current login
46
+ * (`<base URL>|<org id>|<tenant id>|<identity>|<scopes>`, as
47
+ * `index.meta.json` records it), or
48
+ * `undefined` when no one is logged in, the session has expired, or the
49
+ * tenant is not known locally. Makes no network request and writes nothing. `flow check` hands it to the SDK, which treats the cache as the
50
+ * current tenant's only when the cache records this scope.
51
+ *
52
+ * @example
53
+ * await currentNodeCacheScope(); // "https://cloud.uipath.com|org-1|tenant-1|user-1|or.jobs"
54
+ */
55
+ export declare function currentNodeCacheScope(): Promise<string | undefined>;
56
+ /**
57
+ * The scope of the session a command runs with, for a cache reader or writer
58
+ * that also talks to the tenant. Unlike {@link currentNodeCacheScope} it
59
+ * reads the login the way a request does, so a session whose access token
60
+ * can still be renewed counts as logged in. Unreadable auth state is the
61
+ * logged-out answer.
62
+ *
63
+ * @example
64
+ * await readLoginScope(); // "https://cloud.uipath.com|org-1|tenant-1|user-1|or.jobs"
65
+ */
66
+ export declare function readLoginScope(): Promise<string | undefined>;
67
+ /**
68
+ * Whether a cache record may be served to `scope` without refetching: fetched
69
+ * for that tenant and younger than `ttlMs`. A cache fetched for another
70
+ * tenant, or written before caches recorded their tenant, is a miss, and so
71
+ * is any cache when no one is logged in.
72
+ *
73
+ * @example
74
+ * isCacheFreshFor({ lastSync: Date.now(), scope: "a" }, "a", 60_000); // true
75
+ * isCacheFreshFor({ lastSync: Date.now(), scope: "a" }, "b", 60_000); // false
76
+ * isCacheFreshFor({ lastSync: Date.now() }, "a", 60_000); // false
77
+ */
78
+ export declare function isCacheFreshFor<T extends {
79
+ lastSync: number;
80
+ scope?: string;
81
+ }>(meta: T | null | undefined, scope: string | undefined, ttlMs: number): meta is T;
@@ -5,7 +5,7 @@ export { ACTIVITY_VERSION_V4, applySavedFilterTree, assertActivityMetadataResolv
5
5
  export type { CompactField, ConnectorInfo, ConnectorMethodInfo, ContextEntry, FieldReference, ISField, ISFieldMethod, ISMetadata, ISMetadataParam, TriggerField, TriggerFieldEvent, TriggerObjectMetadata, } from "./integration-service-metadata.types";
6
6
  export { isKnownSdkNodeType, listKnownSdkNodes } from "./known-types.js";
7
7
  export { areDerivedArtifactsCurrent, buildEssentialsIndex, buildSearchIndex, CACHE_FORMAT_VERSION, commitNodeIndex, type DerivedArtifact, isEssentialNodeType, loadIndexMetadata, loadScopedNodeIndex, type NodeSearchSummary, nodeCacheScope, rederiveNodeIndexArtifacts, resolveNodeStorageDir, type SearchableNode, type SyncMetadata, } from "./node-storage.js";
8
- export { type CurrentTenantNodesResult, filterNodesByKeyword, findNodeByType, gatedNodeFailure, getLocalNodeEnriched, getLocalSolutionSnapshot, getNode, getNodeEnriched, isTenantManifestInvalidError, isTenantManifestUnavailableError, listNodes, loadCurrentTenantNodes, localContractWarning, pullNodes, pullRemoteNodes, searchNodes, searchNodesWithFilters, TenantManifestInvalidError, TenantManifestUnavailableError, } from "./node-sync-service.js";
8
+ export { type CurrentTenantNodesResult, currentNodeCacheScope, filterNodesByKeyword, findNodeByType, gatedNodeFailure, getLocalNodeEnriched, getLocalSolutionSnapshot, getNode, getNodeEnriched, isTenantManifestInvalidError, isTenantManifestUnavailableError, listNodes, loadBundledNodes, loadCachedTenantNodes, loadCurrentTenantNodes, localContractWarning, pullNodes, pullRemoteNodes, searchNodes, searchNodesWithFilters, TenantManifestInvalidError, TenantManifestUnavailableError, } from "./node-sync-service.js";
9
9
  export type { SolutionContext } from "./solution-discovery.js";
10
10
  export { type AgentProjectMetadataReader, buildInSolutionNodes, type ContractState, explainNodeTypeWithoutProcessResource, findProjectsWithoutProcessResource, findSolutionFromCwd, type InSolutionNodes, loadResourceKeyMap, readSolutionAt, resolveProjectEntryPointIO, resourcesRefreshCommand, setAgentProjectMetadataReader, solutionSearchDirs, type UnknownContractProject, unknownContractWarning, } from "./solution-discovery.js";
11
11
  export type { FilterCondition, FilterField, FilterOperator, ParsedFilters, } from "./types";
@@ -1,5 +1,6 @@
1
1
  import type { NodeManifest } from "@uipath/flow-core";
2
2
  import type { ConnectorFetcherResult } from "@uipath/flow-core/manifest";
3
+ export { nodeCacheScope } from "./cache-scope.js";
3
4
  /**
4
5
  * Bump whenever a change alters which nodes a pull produces — a new manifest
5
6
  * flag the CLI starts asking for. Otherwise caches written before the change
@@ -58,41 +59,6 @@ export interface SyncMetadata {
58
59
  reason: string;
59
60
  }>;
60
61
  }
61
- /**
62
- * The cache key for a login's node manifest: platform URL, organization,
63
- * tenant, who the token acts as, and the scopes it carries. The manifest
64
- * request carries no folder (flow-core's `AuthContext` is org + tenant only),
65
- * so the folder is not part of the key.
66
- *
67
- * The identity and scopes are in the key because they decide what the fetch
68
- * can read: an application token gets 401 from the connector catalogue, so
69
- * its index lacks every connector node. Keyed by tenant alone, that partial
70
- * index and its miss-refresh record would answer a user's lookup on the same
71
- * tenant with "not found".
72
- * Opaque tokens carry no decoded identity: use their SHA-256 fingerprint
73
- * instead, so different credentials cannot share a cache and the token is
74
- * never written to disk. A renewed opaque token therefore starts a new cache.
75
- *
76
- * Returns `undefined` when the URL, organization or tenant is missing — an
77
- * unauthenticated caller has no tenant, and must never read a logged-in
78
- * tenant's nodes. Also returns `undefined` when neither a principal nor an
79
- * access token is available to identify the caller.
80
- *
81
- * @example
82
- * nodeCacheScope({ baseUrl: "https://cloud.uipath.com/", organizationId: "Org-1", tenantId: "T-1", identity: { userId: "U-1" }, scopes: ["OR.Jobs", "IS"] })
83
- * // => "https://cloud.uipath.com|org-1|t-1|u-1|is or.jobs"
84
- */
85
- export declare function nodeCacheScope(login: {
86
- baseUrl?: string;
87
- organizationId?: string;
88
- tenantId?: string;
89
- identity?: {
90
- userId?: string;
91
- clientId?: string;
92
- };
93
- scopes?: string[];
94
- accessToken?: string;
95
- }): string | undefined;
96
62
  /** Save the connector catalogue a pull fetched for `scope`. */
97
63
  export declare function saveConnectorFetch(scope: string, options: string, result: ConnectorFetcherResult): Promise<void>;
98
64
  /**
@@ -193,4 +159,3 @@ export declare function areDerivedArtifactsCurrent(): Promise<boolean>;
193
159
  * own, and the next one refetches.
194
160
  */
195
161
  export declare function rederiveNodeIndexArtifacts(): Promise<number>;
196
- export {};
@@ -1,6 +1,7 @@
1
1
  import { type LoginStatus } from "@uipath/auth";
2
2
  import { type CliErrorCode, type RetryHint } from "@uipath/common";
3
3
  import type { NodeManifest } from "@uipath/flow-core";
4
+ import { currentNodeCacheScope } from "./cache-scope.js";
4
5
  import { type NodeSearchSummary } from "./node-storage.js";
5
6
  import { type InSolutionNodes } from "./solution-discovery.js";
6
7
  import type { ParsedFilters } from "./types";
@@ -88,6 +89,7 @@ export declare class TenantManifestUnavailableError extends Error {
88
89
  }
89
90
  /** By `code`, not `instanceof`: the class can load twice across packages. */
90
91
  export declare function isTenantManifestUnavailableError(error: unknown): boolean;
92
+ export { currentNodeCacheScope };
91
93
  export interface GatedNodeFailure {
92
94
  message: string;
93
95
  instructions: string;
@@ -99,6 +101,22 @@ export interface GatedNodeFailure {
99
101
  * Shared by `registry get` and `node add`.
100
102
  */
101
103
  export declare function gatedNodeFailure(nodeType: string): Promise<GatedNodeFailure>;
104
+ /**
105
+ * The node cache's nodes for the tenant the CLI is logged in to, read-only:
106
+ * no request, no write, no refresh of the session. Empty when no one is
107
+ * logged in, the session has expired, or the cache is absent, older than the
108
+ * 30-minute TTL, pulled for another tenant, or does not match its metadata's
109
+ * hash (a write in flight).
110
+ *
111
+ * Interim, for `flow validate`'s stale-handle check on dynamic node types
112
+ * (connectors, processes, agent tools, IXP), whose handle templates flow-core
113
+ * does not export yet. It goes once `dynamicNodeHandles` from
114
+ * UiPath/flow-workbench#6323 ships in a flow-core release this CLI uses.
115
+ *
116
+ * @example
117
+ * const cached = await loadCachedTenantNodes(); // [] on a machine that never pulled
118
+ */
119
+ export declare function loadCachedTenantNodes(): Promise<NodeManifest[]>;
102
120
  /**
103
121
  * Pull and sync all node sources with smart caching
104
122
  *
@@ -111,6 +129,21 @@ export declare function gatedNodeFailure(nodeType: string): Promise<GatedNodeFai
111
129
  * @returns Result with sync count and cache status
112
130
  */
113
131
  export declare function pullNodes(options?: PullNodesOptions): Promise<PullNodesResult>;
132
+ /**
133
+ * The built-in node manifests this CLI ships, built locally with no request:
134
+ * the definitions bundled in `@uipath/flow-core`, filtered by the same flags
135
+ * ({@link ENABLED_MANIFEST_FLAGS}) and request options a `registry pull`
136
+ * uses, so for built-in nodes it is what a pull would cache.
137
+ *
138
+ * flow-core adds the inline agent nodes (`uipath.agent.autonomous`, …) only
139
+ * when an access token is present, so this passes a placeholder token with
140
+ * every dynamic fetcher stubbed to return nothing: no request is made.
141
+ *
142
+ * @example
143
+ * const nodes = await loadBundledNodes();
144
+ * nodes.find((n) => n.nodeType === "core.logic.decision")?.version; // "1.4"
145
+ */
146
+ export declare function loadBundledNodes(): Promise<NodeManifest[]>;
114
147
  interface PullRemoteNodesOptions {
115
148
  /**
116
149
  * Reuse the connector catalogue the last pull for this tenant saved, when
@@ -274,4 +307,3 @@ export declare function getLocalNodeEnriched(nodeType: string, connectionId?: st
274
307
  export declare function searchNodesWithFilters(keyword?: string, filters?: ParsedFilters, options?: {
275
308
  local?: boolean;
276
309
  }): Promise<NodeManifest[]>;
277
- export {};
@@ -56,13 +56,20 @@ export declare function countProcessesByType(processes: DiscoveredProcess[]): Re
56
56
  * Pull (or return cached) the full Maestro registry.
57
57
  *
58
58
  * Cache strategy mirrors the flow-tool:
59
- * - FRESH (< 30 min): return cache immediately
60
- * - EXPIRED or missing: fetch fresh, write to cache, return
59
+ * - FRESH (< 30 min) and fetched for the logged-in tenant: return cache
60
+ * - EXPIRED, missing, or fetched for another tenant: fetch fresh, write, return
61
61
  * - force=true: always fetch fresh
62
+ *
63
+ * With no session there is no tenant to match, so the built-in registry is
64
+ * rebuilt (no request) rather than a cached tenant's resources returned.
62
65
  */
63
66
  export declare function pullRegistry(options?: PullRegistryOptions): Promise<PullRegistryResult>;
64
67
  /**
65
- * List the cached registry. Auto-pulls if no cache exists.
68
+ * The registry for the logged-in tenant: the cache when it was fetched for
69
+ * that tenant within the last 30 minutes, a fresh build (written back)
70
+ * otherwise. A cache fetched for another tenant, or one that does not record
71
+ * its tenant, is never returned; with no session the result is the built-in
72
+ * registry only.
66
73
  *
67
74
  * A cache written by an older CLI holds that CLI's static half — extension
68
75
  * types, BPMN elements, serialization rules. Returning it as-is would let a
@@ -84,6 +91,11 @@ export declare function searchRegistry(keyword: string): Promise<{
84
91
  }>;
85
92
  /**
86
93
  * Get a single extension type by key (case-insensitive).
94
+ *
95
+ * Read from the bundled spec, not the cache: extension types are the static
96
+ * half, which {@link getRegistry} keeps equal to the bundled one anyway. Going
97
+ * through the cache would run a full tenant discovery, and need a session,
98
+ * for an answer that depends on neither.
87
99
  */
88
100
  export declare function getExtensionType(extensionType: string): Promise<BpmnExtensionType | null>;
89
101
  export interface EnrichActivityOptions {
@@ -5,7 +5,8 @@
5
5
  * ~/.uipath/maestro/registry.json — full registry
6
6
  * ~/.uipath/maestro/registry.meta.json — lightweight metadata (lastSync, hash, counts)
7
7
  *
8
- * 30-minute cache expiration is enforced by the caller (registry service).
8
+ * The 30-minute expiration and the tenant check are enforced by the caller
9
+ * (registry service); the files record the tenant they were fetched for.
9
10
  */
10
11
  import type { MaestroRegistry, RegistryMetadata } from "../manifest/types.js";
11
12
  /** Cache is considered fresh for 30 minutes. */
@@ -1,8 +1,14 @@
1
1
  export { readStdin } from "@uipath/common";
2
2
  export { toMillisecondIso } from "./timestamps";
3
- import { type FailureOutput } from "@uipath/common";
3
+ import { type ArgumentRule, type FailureOutput } from "@uipath/common";
4
4
  import type { Command } from "commander";
5
5
  export declare const VALID_PROJECT_NAME_REGEX: RegExp;
6
+ /**
7
+ * {@link VALID_PROJECT_NAME_REGEX} for the `<name>` of the commands that
8
+ * scaffold a project by name (`.argumentRules()`), so `--help --output json`
9
+ * tells a caller the rule the command applies.
10
+ */
11
+ export declare const PROJECT_NAME_ARGUMENT_RULES: readonly ArgumentRule[];
6
12
  export declare const VALID_PACKAGE_NAME_REGEX: RegExp;
7
13
  export { invalidBindingIdMessage, VALID_BINDING_ID_REGEX, } from "./binding-id.js";
8
14
  export interface TraceEvent {