@uipath/solution-tool 1.1.0 → 1.196.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 (41) hide show
  1. package/README.md +32 -0
  2. package/dist/deploy.d.ts +27 -0
  3. package/dist/deploy.js +43244 -0
  4. package/dist/init.d.ts +6 -0
  5. package/dist/init.js +10381 -0
  6. package/dist/models/index.d.ts +1 -0
  7. package/dist/models/pack-command-types.d.ts +28 -0
  8. package/dist/pack.d.ts +6 -0
  9. package/dist/pack.js +234469 -0
  10. package/dist/providers/file-storage-provider.d.ts +11 -0
  11. package/dist/providers/resource-builder-init.d.ts +12 -0
  12. package/dist/providers/solution-access-provider.d.ts +18 -0
  13. package/dist/publish.d.ts +7 -0
  14. package/dist/publish.js +33430 -0
  15. package/dist/resource.d.ts +7 -0
  16. package/dist/resource.js +47215 -0
  17. package/dist/services/activation.d.ts +51 -0
  18. package/dist/services/auth-helper.d.ts +13 -0
  19. package/dist/services/deploy-activate-service.d.ts +47 -0
  20. package/dist/services/deploy-list-service.d.ts +59 -0
  21. package/dist/services/deploy-run-service.d.ts +102 -0
  22. package/dist/services/deploy-uninstall-service.d.ts +47 -0
  23. package/dist/services/deployment-search.d.ts +77 -0
  24. package/dist/services/emit-runtime-dependencies.d.ts +37 -0
  25. package/dist/services/entry-point-spec-enhancer.d.ts +31 -0
  26. package/dist/services/folder-helper.d.ts +24 -0
  27. package/dist/services/pack-command-service.d.ts +24 -0
  28. package/dist/services/pack-service.d.ts +32 -0
  29. package/dist/services/packager-tool-resolver.d.ts +6 -0
  30. package/dist/services/packages-list-service.d.ts +56 -0
  31. package/dist/services/personal-workspace-deploy.d.ts +28 -0
  32. package/dist/services/personal-workspace-resolver.d.ts +28 -0
  33. package/dist/services/publish-service.d.ts +61 -0
  34. package/dist/services/resource-refresh-service.d.ts +34 -0
  35. package/dist/services/solution-init-service.d.ts +37 -0
  36. package/dist/services/solution-manifest.d.ts +9 -0
  37. package/dist/services/sync-resources-from-bindings.d.ts +132 -0
  38. package/dist/templates/AGENTS.md +25 -16
  39. package/dist/tool.js +20953 -43671
  40. package/dist/utils/deployment-errors.d.ts +39 -0
  41. package/package.json +44 -43
@@ -0,0 +1,51 @@
1
+ import { type PollUntilResult } from "@uipath/common";
2
+ import type { DeploymentStatus } from "@uipath/pipelines-sdk";
3
+ import type { DeploymentSearchItemDto2 } from "@uipath/solution-sdk";
4
+ import type { SolutionAuthContext } from "./auth-helper";
5
+ export type ActivationOptions = {
6
+ timeoutSeconds: number;
7
+ pollIntervalMs: number;
8
+ /** Host-side cancellation. Falls back to `processContext.pollSignal` (CLI's Ctrl-C) when omitted. */
9
+ signal?: AbortSignal;
10
+ };
11
+ export type ActivationResult =
12
+ /** Pre-activate steps lookup or activate call failed. */
13
+ {
14
+ kind: "RequestFailed";
15
+ phase: "preActivateSteps" | "activate";
16
+ message: string;
17
+ details: string;
18
+ deployment?: DeploymentSearchItemDto2;
19
+ }
20
+ /** Activation API returned no instance id — completed without polling. */
21
+ | {
22
+ kind: "NoInstance";
23
+ }
24
+ /** Polling did not complete (timeout/failed/interrupted/aborted). */
25
+ | {
26
+ kind: "PollFailed";
27
+ poll: PollUntilResult<unknown>;
28
+ }
29
+ /** Polled to a terminal non-success status. */
30
+ | {
31
+ kind: "ActivationFailed";
32
+ status: DeploymentStatus;
33
+ instanceId: string;
34
+ errorMessage: string;
35
+ }
36
+ /** Activation succeeded. */
37
+ | {
38
+ kind: "Success";
39
+ status: DeploymentStatus;
40
+ instanceId: string;
41
+ };
42
+ /**
43
+ * Run the full activation flow for a deployment:
44
+ * preActivateSteps lookup -> pipelinesActivate -> poll instance status.
45
+ *
46
+ * Returns a discriminated result so callers can decide how to render output
47
+ * (the standalone `activate` command emits its own success/error payload;
48
+ * `deploy run --activate` merges activation info into the deploy success
49
+ * payload).
50
+ */
51
+ export declare function activateDeployment(auth: SolutionAuthContext, deploymentName: string, options: ActivationOptions): Promise<ActivationResult>;
@@ -0,0 +1,13 @@
1
+ export interface SolutionAuthContext {
2
+ accessToken: string;
3
+ basePath: string;
4
+ organizationId: string;
5
+ tenantName: string;
6
+ }
7
+ export declare function getSolutionAuthContext(options: {
8
+ tenant?: string;
9
+ loginValidity?: number;
10
+ /** Pin auth to this exact `.uipath/.auth` path (forwarded to
11
+ * `getAuthContext`) instead of resolving from `process.cwd()`. */
12
+ envFilePath?: string;
13
+ }): Promise<SolutionAuthContext>;
@@ -0,0 +1,47 @@
1
+ export type ActivateDeploymentFailureReason = "auth_failed"
2
+ /** Activation HTTP request failed (e.g. unknown deployment name). */
3
+ | "request_failed"
4
+ /** Activation poll didn't reach a terminal state — recommended exit 2 (CI distinguishability). */
5
+ | "poll_timeout" | "poll_failed" | "poll_aborted"
6
+ /** Activation reached a terminal state but was a failure. */
7
+ | "activation_failed";
8
+ export interface ActivateDeploymentOptions {
9
+ /**
10
+ * Override the active tenant for auth resolution. The CLI's deprecated
11
+ * `--tenant` flag flows through here; library callers usually omit it.
12
+ */
13
+ tenant?: string;
14
+ /** Pin auth to this exact `.uipath/.auth` path. */
15
+ envFilePath?: string;
16
+ /** Timeout in seconds for activation polling. Default 360. */
17
+ timeout?: number;
18
+ /** Milliseconds between activation status polls. Default 5000. */
19
+ pollInterval?: number;
20
+ /** Minimum minutes before token expiration to trigger a refresh. Default 10. */
21
+ loginValidity?: number;
22
+ /** Host-side cancellation for the activation poll. */
23
+ signal?: AbortSignal;
24
+ }
25
+ export interface ActivateDeploymentSuccess {
26
+ ok: true;
27
+ /** `"SuccessfulActivate"` for terminal success, or `"Activation completed (no instance to poll)"` for the NoInstance short-circuit. */
28
+ status: string;
29
+ deploymentName: string;
30
+ /** Allows `null` so `"InstanceId": null` reaches JSON output when the SDK reports null. */
31
+ instanceId?: string | null;
32
+ }
33
+ export interface ActivateDeploymentFailure {
34
+ ok: false;
35
+ reason: ActivateDeploymentFailureReason;
36
+ message: string;
37
+ instructions: string;
38
+ exitCode: number;
39
+ }
40
+ export type ActivateDeploymentResult = ActivateDeploymentSuccess | ActivateDeploymentFailure;
41
+ /**
42
+ * Programmatic core of `uip solution deploy activate`. Wraps the shared
43
+ * `activateDeployment(...)` helper and maps its 5 outcomes (RequestFailed,
44
+ * NoInstance, PollFailed, ActivationFailed, Success) to {@link ActivateDeploymentResult}.
45
+ * Does not touch `OutputFormatter`/`processContext`.
46
+ */
47
+ export declare function activateDeploymentAsync(deploymentName: string, options?: ActivateDeploymentOptions): Promise<ActivateDeploymentResult>;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Per-deployment row in {@link ListDeploymentsSuccess.deployments}. Mirrors
3
+ * the 10 SDK fields the CLI emits; string-enums widened to `string` so the
4
+ * published `.d.ts` stays off the SDK's const-enum types.
5
+ */
6
+ export interface DeploymentSummary {
7
+ key: string;
8
+ installDeploymentKey: string;
9
+ name: string;
10
+ packageName: string;
11
+ packageVersion: string;
12
+ operationStatus: string;
13
+ activationStatus: string;
14
+ folderPath?: string | null;
15
+ installedRootFolderKey?: string | null;
16
+ deploymentCreationTime: Date;
17
+ }
18
+ export type ListDeploymentsFailureReason = "auth_failed" | "folder_resolution_failed" | "list_request_failed";
19
+ /** Local mirror of solution-sdk's `OrderByDirection`; declared here so the `.d.ts` stays off the SDK type. */
20
+ export type SortDirection = "Ascending" | "Descending";
21
+ export interface ListDeploymentsOptions {
22
+ /** Override the active tenant for auth + folder-lookup. The CLI's deprecated `--tenant` flag flows through here. */
23
+ tenant?: string;
24
+ /** Pin auth (+ folder lookup) to this exact `.uipath/.auth` path. */
25
+ envFilePath?: string;
26
+ /** Filter by parent folder path (e.g., `"Shared"`). Post-fetch substring match. */
27
+ folderPath?: string;
28
+ /** Filter by parent folder key (GUID). Alternative to {@link folderPath}. */
29
+ folderKey?: string;
30
+ /** Max deployments to fetch. Default `DEFAULT_PAGE_SIZE`. */
31
+ limit?: number;
32
+ /** Column to sort by. Default `"startTime"`. */
33
+ sortBy?: string;
34
+ /** Sort direction. Default `"Descending"`. */
35
+ sortOrder?: SortDirection;
36
+ /** Minimum minutes before token expiration to trigger a refresh. Default 10. */
37
+ loginValidity?: number;
38
+ }
39
+ export interface ListDeploymentsSuccess {
40
+ ok: true;
41
+ deployments: DeploymentSummary[];
42
+ /** Echo of the request limit so callers can render pagination UI without re-deriving. */
43
+ limit: number;
44
+ }
45
+ export interface ListDeploymentsFailure {
46
+ ok: false;
47
+ reason: ListDeploymentsFailureReason;
48
+ message: string;
49
+ instructions: string;
50
+ exitCode: number;
51
+ }
52
+ export type ListDeploymentsResult = ListDeploymentsSuccess | ListDeploymentsFailure;
53
+ /**
54
+ * Programmatic core of `uip solution deploy list`. Returns a tagged
55
+ * {@link ListDeploymentsResult}; does not touch `OutputFormatter`/`processContext`.
56
+ * Folder filtering is post-fetch (search API has no folder filter), so
57
+ * `deployments.length` may be less than `limit`.
58
+ */
59
+ export declare function listDeploymentsAsync(options?: ListDeploymentsOptions): Promise<ListDeploymentsResult>;
@@ -0,0 +1,102 @@
1
+ /** Discriminator for {@link DeployFailure}; library callers can ignore the tag and read `.message`/`.instructions`. */
2
+ export type DeployFailureReason = "auth_failed" | "folder_resolution_failed" | "config_file_not_found" | "config_file_read_failed" | "config_file_parse_failed" | "install_request_failed"
3
+ /** Personal Workspace deploy via AS auto-deploy failed (publish first, then retry). */
4
+ | "personal_workspace_deploy_failed"
5
+ /** Recovery: deployment completed but flagged "Needs Setup" — manual config required before activation. */
6
+ | "needs_setup_to_activate"
7
+ /** Recovery: deployment completed, ready to activate — auto-activation didn't run. */
8
+ | "ready_to_activate"
9
+ /** Recovery: deployment completed but activation failed (terminal). */
10
+ | "activation_failed_post_deploy"
11
+ /** Recovery or final-status: the deploy itself failed (e.g. ValidationFailed). */
12
+ | "deploy_failed"
13
+ /** Poll completed with `outcome === Completed` but `data` is undefined (defensive). */
14
+ | "no_final_status"
15
+ /** Poll loop didn't complete cleanly AND the search service had no recovery to surface. */
16
+ | "poll_timeout" | "poll_failed" | "poll_aborted"
17
+ /** Activation HTTP request failed (post-deploy path). */
18
+ | "activation_request_failed"
19
+ /** Activation poll didn't reach a terminal state. */
20
+ | "activation_poll_failed"
21
+ /** Activation reached a terminal state but it was a failure. */
22
+ | "activation_failed";
23
+ export interface DeployOptions {
24
+ /** Override the active tenant for auth + folder-lookup. The CLI's deprecated `--tenant` flag flows through here. */
25
+ tenant?: string;
26
+ /** Pin auth (+ folder lookup) to this exact `.uipath/.auth` path. */
27
+ envFilePath?: string;
28
+ /** Name for the deployment (`uip solution deploy run -n`). */
29
+ deploymentName: string;
30
+ /** Package name to deploy. */
31
+ packageName: string;
32
+ /** Package version (semver) to deploy. */
33
+ packageVersion: string;
34
+ /** Name of the new Orchestrator folder created for this deployment. */
35
+ folderName: string;
36
+ /** Mutually exclusive with `parentFolderKey` and `personalWorkspace`. */
37
+ parentFolderPath?: string;
38
+ /** Mutually exclusive with `parentFolderPath` and `personalWorkspace`. */
39
+ parentFolderKey?: string;
40
+ /** Deploy into the user's Personal Workspace; resolves the workspace name automatically. */
41
+ personalWorkspace?: boolean;
42
+ /** Path to a JSON / YAML configuration file. */
43
+ configFile?: string;
44
+ /** Per-poll-phase timeout in seconds (deploy and, when not skipped, activate). Default 360. */
45
+ timeout?: number;
46
+ /** Milliseconds between polls. Default 5000. */
47
+ pollInterval?: number;
48
+ /** Minimum minutes before token expiration to trigger a refresh. Default 10. */
49
+ loginValidity?: number;
50
+ /** Skip auto-activation; leave deployment in "Inactive (Ready to activate)" state. */
51
+ skipActivate?: boolean;
52
+ /** Host-side cancellation for both poll loops (e.g. VS Code's cancel button); replaces `processContext.pollSignal`. */
53
+ signal?: AbortSignal;
54
+ }
55
+ export interface DeploySuccess {
56
+ ok: true;
57
+ /**
58
+ * Tenant path: `"DeploymentSucceeded"` after polling reaches terminal.
59
+ * PW path: `"DeploymentStarted"` — the AS auto-deploy endpoint returns
60
+ * at request acceptance, before terminal state is observable.
61
+ */
62
+ status: string;
63
+ /** Tenant only — populated from Pipelines install result. PW returns no key. */
64
+ deploymentKey?: string | null;
65
+ /** Tenant only — Pipelines deployment id. Undefined for PW (no Pipelines call). */
66
+ pipelineDeploymentId?: string;
67
+ /** Allows `null` so `"InstanceId": null` reaches JSON output when the SDK reports null. */
68
+ instanceId?: string | null;
69
+ folderName: string;
70
+ folderPath: string;
71
+ /** "SuccessfulActivate" | "Skipped" | "NoInstance" — short canonical token. PW path emits `"Auto"`. */
72
+ activationStatus: string;
73
+ /** PW only — server-assigned auto-name (`AutoDeploy-<solution>`). */
74
+ deploymentName?: string;
75
+ /** PW only — package name as deployed. */
76
+ packageName?: string;
77
+ /** PW only — package version as deployed. */
78
+ packageVersion?: string;
79
+ /** PW only — future-tense human guidance ("Check status with..."). */
80
+ nextSteps?: string;
81
+ }
82
+ export interface DeployFailure {
83
+ ok: false;
84
+ reason: DeployFailureReason;
85
+ /** OutputFormatter.error Message: short summary. */
86
+ message: string;
87
+ /** OutputFormatter.error Instructions: remediation guidance. */
88
+ instructions: string;
89
+ /** Recommended exit code (1 default; 2 reserved for `poll_timeout` — CI distinguishability). */
90
+ exitCode: number;
91
+ /** Set whenever an install was initiated (post-`pipelinesInstall` paths). */
92
+ pipelineDeploymentId?: string;
93
+ }
94
+ export type DeployResult = DeploySuccess | DeployFailure;
95
+ /**
96
+ * Programmatic core of `uip solution deploy run`: auth → folder → optional
97
+ * config file → install → poll (with 404 → search-service fallback) →
98
+ * optional auto-activate. Returns a tagged {@link DeployResult}; re-throws
99
+ * only on unexpected SDK errors. Threads `options.signal` through both polls.
100
+ * Does not touch `OutputFormatter`/`processContext`.
101
+ */
102
+ export declare function deployRunAsync(options: DeployOptions): Promise<DeployResult>;
@@ -0,0 +1,47 @@
1
+ export type UninstallDeploymentFailureReason = "auth_failed" | "uninstall_request_failed"
2
+ /** Uninstall poll didn't reach a terminal state — recommended exit 2 (CI distinguishability). */
3
+ | "poll_timeout" | "poll_failed" | "poll_aborted"
4
+ /** Uninstall reached a terminal state but it was `FailedUninstall`. */
5
+ | "uninstall_failed";
6
+ export interface UninstallDeploymentOptions {
7
+ /**
8
+ * Override the active tenant for auth resolution. The CLI's deprecated
9
+ * `--tenant` flag flows through here; library callers usually omit it.
10
+ */
11
+ tenant?: string;
12
+ /** Pin auth to this exact `.uipath/.auth` path. */
13
+ envFilePath?: string;
14
+ /** Timeout in seconds for uninstall polling. Default 360. */
15
+ timeout?: number;
16
+ /** Milliseconds between uninstall status polls. Default 5000. */
17
+ pollInterval?: number;
18
+ /** Minimum minutes before token expiration to trigger a refresh. Default 10. */
19
+ loginValidity?: number;
20
+ /** Host-side cancellation for the poll loop; replaces `processContext.pollSignal`. */
21
+ signal?: AbortSignal;
22
+ }
23
+ export interface UninstallDeploymentSuccess {
24
+ ok: true;
25
+ /** `"SuccessfulUninstall"`, `"Uninstall completed immediately"`, or `"Uninstall scheduled"`. */
26
+ status: string;
27
+ deploymentName: string;
28
+ /** Polled instance id when present; preserves the SDK nullable so `"InstanceId": null` reaches JSON output. */
29
+ instanceId?: string | null;
30
+ /** Set only on the "scheduled" branch — surfaces `Scheduled` in JSON output. */
31
+ scheduled?: unknown;
32
+ }
33
+ export interface UninstallDeploymentFailure {
34
+ ok: false;
35
+ reason: UninstallDeploymentFailureReason;
36
+ message: string;
37
+ instructions: string;
38
+ exitCode: number;
39
+ }
40
+ export type UninstallDeploymentResult = UninstallDeploymentSuccess | UninstallDeploymentFailure;
41
+ /**
42
+ * Programmatic core of `uip solution deploy uninstall`: three success shapes
43
+ * (immediate-complete / scheduled / polled-to-`SuccessfulUninstall`) and the
44
+ * usual failure taxonomy. `poll_timeout` → exit 2. Does not touch
45
+ * `OutputFormatter`/`processContext`.
46
+ */
47
+ export declare function uninstallDeploymentAsync(deploymentName: string, options?: UninstallDeploymentOptions): Promise<UninstallDeploymentResult>;
@@ -0,0 +1,77 @@
1
+ import type { PipelineDeploymentResult, PipelineDeploymentStatus } from "@uipath/pipelines-sdk";
2
+ import type { DeploymentOperationStatus, DeploymentSearchItemDto2 } from "@uipath/solution-sdk";
3
+ import type { SolutionAuthContext } from "./auth-helper";
4
+ /**
5
+ * Look up a deployment by name in the persistent search/list service.
6
+ * Returns the matching record, or undefined when no deployment with that
7
+ * exact name exists.
8
+ *
9
+ * Throws on transport / server errors. Use {@link findDeploymentForError}
10
+ * when you want a best-effort lookup that swallows failures.
11
+ */
12
+ export declare function findDeploymentByName(auth: SolutionAuthContext, deploymentName: string): Promise<DeploymentSearchItemDto2 | undefined>;
13
+ /**
14
+ * Best-effort lookup for use in error-handling paths — returns undefined on
15
+ * any failure instead of propagating, so it never masks the original error.
16
+ */
17
+ export declare function findDeploymentForError(auth: SolutionAuthContext, deploymentName: string): Promise<DeploymentSearchItemDto2 | undefined>;
18
+ /**
19
+ * Append a hint to error instructions when the deployment in question is
20
+ * stuck in `Draft` state — that condition has a specific remediation that
21
+ * generic instructions don't cover.
22
+ */
23
+ export declare function appendDraftDeploymentInstructions(instructions: string, deployment?: DeploymentSearchItemDto2): string;
24
+ /**
25
+ * The pipelines service `pipelinesGetPipelineDeploymentStatus` endpoint
26
+ * returns 404 with errorCode `PipelineDeploymentNotFound` once a deployment
27
+ * reaches a terminal state — the in-flight tracking record is recycled and
28
+ * final state lives in the search/list service instead.
29
+ *
30
+ * This helper detects that specific signal so callers can fall back to
31
+ * {@link findDeploymentByName} for the persistent record instead of treating
32
+ * the 404 as a fatal poll error.
33
+ */
34
+ export declare function isPipelineDeploymentNotFoundError(error: unknown): Promise<boolean>;
35
+ /**
36
+ * When the deploy poll exhausts consecutive errors, the deployment may still
37
+ * have reached a terminal state on the server — the search service is the
38
+ * source of truth. Turn the search record into a verdict the caller can use
39
+ * to render a specific message instead of the generic "polling failed" line.
40
+ *
41
+ * `undefined` means the record is missing or in a non-terminal/unknown state,
42
+ * and the caller should fall through to the generic poll-failure path.
43
+ */
44
+ export type DeployPollRecovery = {
45
+ kind: "Active";
46
+ instanceId: string | null | undefined;
47
+ } | {
48
+ kind: "NeedsSetupToActivate";
49
+ } | {
50
+ kind: "ReadyToActivate";
51
+ } | {
52
+ kind: "ActivationFailed";
53
+ } | {
54
+ kind: "DeployFailed";
55
+ operationStatus: DeploymentOperationStatus;
56
+ };
57
+ export declare function interpretFailedDeployPoll(deployment: DeploymentSearchItemDto2 | undefined): DeployPollRecovery | undefined;
58
+ /**
59
+ * Map a search-service `DeploymentOperationStatus` onto the corresponding
60
+ * terminal `PipelineDeploymentStatus`. Returns undefined for non-terminal
61
+ * states (caller should keep polling).
62
+ */
63
+ export declare function mapOperationStatusToPipelineStatus(operationStatus: DeploymentOperationStatus | undefined | null): PipelineDeploymentStatus | undefined;
64
+ /**
65
+ * Build a synthesized terminal `PipelineDeploymentResult` from a deployment
66
+ * record fetched via the search API. Used as a fallback when the pipelines
67
+ * service has already cleaned up its in-flight record (404).
68
+ *
69
+ * Returns undefined when the deployment is in a non-terminal state — caller
70
+ * should keep polling the original endpoint.
71
+ *
72
+ * The synthesized result only has the fields the search record exposes;
73
+ * validation/error details from the pipelines service are not available.
74
+ * Callers should treat fallback failures as a generic "Deployment failed"
75
+ * and direct users to `solution deploy list` for richer state.
76
+ */
77
+ export declare function deploymentToTerminalPipelineResult(deployment: DeploymentSearchItemDto2): PipelineDeploymentResult | undefined;
@@ -0,0 +1,37 @@
1
+ export interface EmitRuntimeDependenciesResult {
2
+ processed: number;
3
+ warnings: string[];
4
+ }
5
+ /**
6
+ * Pack-time mirror of Orchestrator BE's
7
+ * `ProcessesExportHandlerBase.GetRuntimeDependenciesAsync`. For each process
8
+ * resource that originates from a `.uipx` project (signalled by a non-empty
9
+ * `projectKey`), build a `runtimeDependencies` list from the project's
10
+ * `bindings_v2.json`, enriching each entry with the matching solution
11
+ * resource's key/name. Without this Orchestrator's `RuntimeDependencyService`
12
+ * has no per-process binding context at deploy time and falls back to lossy
13
+ * heuristics.
14
+ *
15
+ * Per Gabriel Raducu's spec the entries are entirely solution-side:
16
+ * resourceKey ← solution resource key (= debug_overwrites.solutionResourceKey)
17
+ * resourceName ← solution resource name (post-AddOrUpdate)
18
+ * folderKey ← `solution_folder.key` (deterministic
19
+ * `GuidGenerator.From("solution_folder")`, generated by
20
+ * Automation Solutions on import; mirrored here so the
21
+ * pack output is stable without a server round-trip).
22
+ *
23
+ * Emits one entry per declared binding only — no transitive dependency
24
+ * walking. The C# producer has the same contract (1 binding ⇒ 1 runtime
25
+ * dep). Resources that are dependencies of a binding (e.g. an index's
26
+ * storage bucket) are handled by Orchestrator's deploy pipeline through
27
+ * the resource graph, not via the parent process's runtimeDependencies.
28
+ *
29
+ * Round-trips through `builder.context.saveAsync(solution)`. The SDK's
30
+ * `ResourceDefinition.isOverridable` field is currently optional in TS but
31
+ * non-nullable with default `true` in C# (see SOL-7012) — `saveAsync` strips
32
+ * it when undefined, which Studio Web reads to decide whether bindings can
33
+ * be linked. We defensively force `isOverridable = true` on every resource
34
+ * that doesn't have it set before save; that workaround can come out once
35
+ * SOL-7012 lands (cleanup tracked under SOL-7013).
36
+ */
37
+ export declare function emitRuntimeDependenciesForProcesses(solutionDir: string): Promise<EmitRuntimeDependenciesResult>;
@@ -0,0 +1,31 @@
1
+ import { type IFileSystem } from "@uipath/filesystem";
2
+ import type { IArtifactResourceSpecEnhancer, ISolutionContext, ResourceDefinition, ResourcePropertyMetadata } from "@uipath/resource-builder-sdk";
3
+ /**
4
+ * Reads the project's `entry-points.json` at GET time and projects the primary
5
+ * entry points onto the resource spec, so consumers see the current on-disk
6
+ * state — not the snapshot captured at `solution project add`.
7
+ *
8
+ * Mirrors the shape Studio Web returns from its process configuration
9
+ * endpoint: `entryPoints` always carries the raw `entry-points.json` text;
10
+ * `entryPointName` / `entryPointUniqueId` are populated only when the project
11
+ * has exactly one entry, and are explicit `null` for multi-entry or empty
12
+ * projects.
13
+ *
14
+ * Read-only by design: never mutates the on-disk resource JSON. Spec
15
+ * degradation (missing/malformed file) is swallowed so `resource get` stays
16
+ * functional.
17
+ */
18
+ export declare class EntryPointSpecEnhancer implements IArtifactResourceSpecEnhancer {
19
+ private readonly fs;
20
+ constructor(fs?: IFileSystem);
21
+ enhanceSpecAsync(context: ISolutionContext, resource: ResourceDefinition, _propertiesMetadata: Map<string, ResourcePropertyMetadata>, spec: Map<string, unknown>, _cancellationToken?: AbortSignal): Promise<void>;
22
+ private applyEntryPointAsync;
23
+ private findSolutionFileAsync;
24
+ }
25
+ /**
26
+ * Applies `EntryPointSpecEnhancer` against a plain-object spec returned by the
27
+ * SDK's `getConfigurationAsync` path. Used by `resource get` until the SDK
28
+ * invokes `enhanceSpecAsync` itself from `GetMappedResourceConfigurationRequestHandler`;
29
+ * once that lands this becomes a redundant no-op for the same on-disk state.
30
+ */
31
+ export declare function applyEntryPointEnhancementAsync(context: ISolutionContext, resource: ResourceDefinition, spec: Record<string, unknown>): Promise<Record<string, unknown>>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Resolve parent folder from --parent-folder-path, --parent-folder-key, or
3
+ * --personal-workspace options.
4
+ *
5
+ * Returns the fully qualified folder path string the deploy endpoint expects
6
+ * as `folderFullyQualifiedName`, or undefined if none of the three options
7
+ * was provided.
8
+ *
9
+ * Mutual exclusivity is enforced at parse time by Commander via
10
+ * `Option#conflicts()` in the calling command — see `deploy-run.ts`.
11
+ * Personal Workspace is resolved via Orchestrator's `GetPersonalWorkspace`
12
+ * endpoint using the current auth context — see
13
+ * {@link resolvePersonalWorkspace} for the contract.
14
+ */
15
+ export declare function resolveParentFolder(options: {
16
+ folderPath?: string;
17
+ folderKey?: string;
18
+ personalWorkspace?: boolean;
19
+ tenant?: string;
20
+ loginValidity?: number;
21
+ /** Pin folder-lookup auth to this exact `.uipath/.auth` path, forwarded to
22
+ * `resolvePersonalWorkspace`/`resolveFolder` so it matches the deploy auth. */
23
+ envFilePath?: string;
24
+ }): Promise<string | undefined>;
@@ -0,0 +1,24 @@
1
+ import { type CommandContext } from "@uipath/common";
2
+ import { ToolResult } from "@uipath/solutionpackager-tool-core";
3
+ import type { PackCommandOptions } from "../models";
4
+ /**
5
+ * Service for packing UiPath solutions from folders or .uis files
6
+ */
7
+ export declare class PackCommandService {
8
+ private packager;
9
+ private readonly fs;
10
+ constructor();
11
+ /**
12
+ * Execute the pack command with formatted CLI output and process exit handling.
13
+ * When `options.dryRun` is true, the pipeline writes to a temporary directory
14
+ * which is discarded on exit — useful as a pre-deploy validation gate.
15
+ */
16
+ execute(solutionPath: string, options: PackCommandOptions, context: CommandContext): Promise<void>;
17
+ /**
18
+ * Execute the pack command and return result (for programmatic usage and testing)
19
+ */
20
+ executeAsync(solutionPath: string, options: PackCommandOptions): Promise<ToolResult>;
21
+ private ensurePackagerAsync;
22
+ private readFileAsUint8Array;
23
+ private createPackOptions;
24
+ }
@@ -0,0 +1,32 @@
1
+ import "@uipath/packager-tool-apiworkflow";
2
+ import "@uipath/packager-tool-bpmn";
3
+ import "@uipath/packager-tool-case";
4
+ import "@uipath/packager-tool-connector";
5
+ import "@uipath/packager-tool-flow";
6
+ import "@uipath/packager-tool-functions";
7
+ import "@uipath/packager-tool-webapp";
8
+ import "@uipath/packager-tool-workflowcompiler";
9
+ import "@uipath/resource-builder-tool";
10
+ import "@uipath/tool-agent";
11
+ import type { PackCommandOptions } from "../models/pack-command-types";
12
+ export type { PackCommandOptions };
13
+ /**
14
+ * Inlined mirror of solutionpackager-tool-core's `ToolResult`, kept local so
15
+ * the published `pack.d.ts` stays free of the private SDK type.
16
+ */
17
+ export interface PackResult {
18
+ /** True iff `errorCode === "SUCCESS"`. */
19
+ ok: boolean;
20
+ /** Packager error code; `"SUCCESS"`, `"INTERNAL_ERROR"`, `"CANCELED"`, or a tool-specific code. */
21
+ errorCode: string;
22
+ /** Human-readable message; populated on failure. */
23
+ message: string;
24
+ /** Absolute paths to the produced `.zip` package(s). */
25
+ packages: string[];
26
+ }
27
+ /**
28
+ * Programmatic core of `uip solution pack`: packs a UiPath solution into a
29
+ * deployable `.zip`. Returns `{ ok: false, … }` on pack failure (does not
30
+ * throw); only propagates unexpected JS errors.
31
+ */
32
+ export declare function packSolutionAsync(solutionPath: string, options: PackCommandOptions): Promise<PackResult>;
@@ -0,0 +1,6 @@
1
+ import type { IFileSystem } from "@uipath/filesystem";
2
+ /**
3
+ * Reads project types from the .uipx, checks toolsFactoryRepository for
4
+ * unhandled types, and installs the corresponding CLI tools.
5
+ */
6
+ export declare function ensurePackagerTools(solutionDir: string, fs: IFileSystem): Promise<void>;
@@ -0,0 +1,56 @@
1
+ import type { SortDirection } from "./deploy-list-service";
2
+ /**
3
+ * Per-package row in {@link ListPackagesSuccess.packages}. Mirrors solution-sdk's
4
+ * `PackageInfo` field-for-field; `state` widened to `string` so the published
5
+ * `.d.ts` stays off the SDK's const-enum.
6
+ */
7
+ export interface PackageSummary {
8
+ key: string;
9
+ name: string;
10
+ latestVersion: string;
11
+ packageVersionKey: string;
12
+ authorName: string;
13
+ authorEmail?: string | null;
14
+ publishDate: Date;
15
+ description?: string | null;
16
+ releaseNotes?: string | null;
17
+ state: string;
18
+ solutionRootFolderName: string;
19
+ hasUpgradeableDeployments: boolean;
20
+ }
21
+ export type ListPackagesFailureReason = "auth_failed" | "list_request_failed";
22
+ export interface ListPackagesOptions {
23
+ /** Override the active tenant for auth. The CLI's deprecated `--tenant` flag flows through here. */
24
+ tenant?: string;
25
+ /** Pin auth to this exact `.uipath/.auth` path. */
26
+ envFilePath?: string;
27
+ /** Max packages to fetch. Default `DEFAULT_PAGE_SIZE`. */
28
+ limit?: number;
29
+ /** Column to sort by. Default `"publishDate"`. */
30
+ sortBy?: string;
31
+ /** Sort direction. Default `"Descending"`. */
32
+ sortOrder?: SortDirection;
33
+ /** Server-side substring match against the package name. */
34
+ name?: string;
35
+ /** Minimum minutes before token expiration to trigger a refresh. Default 10. */
36
+ loginValidity?: number;
37
+ }
38
+ export interface ListPackagesSuccess {
39
+ ok: true;
40
+ packages: PackageSummary[];
41
+ /** Echo of the request limit so callers can render pagination UI without re-deriving. */
42
+ limit: number;
43
+ }
44
+ export interface ListPackagesFailure {
45
+ ok: false;
46
+ reason: ListPackagesFailureReason;
47
+ message: string;
48
+ instructions: string;
49
+ exitCode: number;
50
+ }
51
+ export type ListPackagesResult = ListPackagesSuccess | ListPackagesFailure;
52
+ /**
53
+ * Programmatic core of `uip solution packages list`. Returns a tagged
54
+ * {@link ListPackagesResult}; does not touch `OutputFormatter`/`processContext`.
55
+ */
56
+ export declare function listPackagesAsync(options?: ListPackagesOptions): Promise<ListPackagesResult>;
@@ -0,0 +1,28 @@
1
+ import type { SolutionAuthContext } from "./auth-helper";
2
+ export interface PersonalWorkspaceDeployResult {
3
+ deploymentName: string;
4
+ packageName: string;
5
+ packageVersion: string;
6
+ folderFQN: string;
7
+ }
8
+ /**
9
+ * Deploy a Personal-Workspace-feed solution package via the Automation
10
+ * Solutions auto-deploy endpoint.
11
+ *
12
+ * The tenant `deploy run` path (Pipelines `deploy-from-package`) resolves the
13
+ * package from the tenant feed and cannot see a PW-feed package. This path
14
+ * uses the feed-aware `POST /api/deployments/deploy` endpoint instead:
15
+ * - the PW folder key scopes both the package lookup and the deploy (header
16
+ * `X-UIPATH-FolderKey`);
17
+ * - `overwrites: []` lets the server apply the package's default resource
18
+ * configuration (no caller-side overwrite computation);
19
+ * - the endpoint auto-names the deployment `AutoDeploy-<solution>` and
20
+ * auto-activates — matching Studio Web's PW autoDeploy behavior.
21
+ */
22
+ export declare function deployToPersonalWorkspace(auth: SolutionAuthContext, params: {
23
+ packageName: string;
24
+ packageVersion: string;
25
+ }, options?: {
26
+ tenant?: string;
27
+ loginValidity?: number;
28
+ }): Promise<PersonalWorkspaceDeployResult>;