@uipath/packager-tool-workflowcompiler 1.198.0 → 1.199.0-preview.104

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.
package/dist/index.js CHANGED
@@ -656,6 +656,30 @@ import {
656
656
  translate as translate6
657
657
  } from "@uipath/solutionpackager-tool-core";
658
658
 
659
+ // src/workflow-compiler-config.ts
660
+ var DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.198-alpha.24031";
661
+ var DEFAULT_DOTNET_PATH = "dotnet";
662
+ var workflowCompilerConfig = {
663
+ workflowCompilerPath: undefined,
664
+ workflowCompilerVersion: DEFAULT_WORKFLOW_COMPILER_VERSION,
665
+ dotnetPath: DEFAULT_DOTNET_PATH,
666
+ dotnetEnv: undefined
667
+ };
668
+ function setupWorkflowCompiler(options) {
669
+ if (options.compilerPath !== undefined) {
670
+ workflowCompilerConfig.workflowCompilerPath = options.compilerPath;
671
+ }
672
+ if (options.version !== undefined) {
673
+ workflowCompilerConfig.workflowCompilerVersion = options.version;
674
+ }
675
+ if (options.dotnetPath !== undefined) {
676
+ workflowCompilerConfig.dotnetPath = options.dotnetPath;
677
+ }
678
+ if (options.dotnetEnv !== undefined) {
679
+ workflowCompilerConfig.dotnetEnv = options.dotnetEnv;
680
+ }
681
+ }
682
+
659
683
  // ../packager-orchestrator-client/dist/index.js
660
684
  import { I18nManager as I18nManager2 } from "@uipath/solutionpackager-tool-core";
661
685
  import {
@@ -765,7 +789,7 @@ function addSdkUserAgentHeader(headers, userAgent) {
765
789
  }
766
790
  var package_default = {
767
791
  name: "@uipath/packager-orchestrator-client",
768
- version: "1.198.0",
792
+ version: "1.199.0",
769
793
  description: "UiPath packager client for Orchestrator package-feed interaction (feed discovery + NuGet source composition)",
770
794
  type: "module",
771
795
  private: true,
@@ -968,23 +992,6 @@ import {
968
992
  TemporaryStorageService as TemporaryStorageService2,
969
993
  translate as translate3
970
994
  } from "@uipath/solutionpackager-tool-core";
971
-
972
- // src/workflow-compiler-config.ts
973
- var DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.196-cloud.23765";
974
- var workflowCompilerConfig = {
975
- workflowCompilerPath: undefined,
976
- workflowCompilerVersion: DEFAULT_WORKFLOW_COMPILER_VERSION
977
- };
978
- function setupWorkflowCompiler(options) {
979
- if (options.compilerPath !== undefined) {
980
- workflowCompilerConfig.workflowCompilerPath = options.compilerPath;
981
- }
982
- if (options.version !== undefined) {
983
- workflowCompilerConfig.workflowCompilerVersion = options.version;
984
- }
985
- }
986
-
987
- // src/workflow-compiler-path-resolver.ts
988
995
  var NUGET_FEED_URL = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json";
989
996
  var WORKFLOW_COMPILER_DLL_NAME = "UiPath.WorkflowCompiler.dll";
990
997
  var PLATFORM_PACKAGE_IDS = {
@@ -1136,7 +1143,6 @@ function camelCaseKeys(obj) {
1136
1143
 
1137
1144
  class WorkflowCompilerExecutor {
1138
1145
  logger;
1139
- static DOTNET_EXECUTABLE = "dotnet";
1140
1146
  pathResolver;
1141
1147
  constructor(logger, fileSystem) {
1142
1148
  this.logger = logger;
@@ -1145,13 +1151,13 @@ class WorkflowCompilerExecutor {
1145
1151
  async executeAsync(operation, args, cancellationToken) {
1146
1152
  const startTime = Date.now();
1147
1153
  const compilerPath = await this.pathResolver.getCompilerPathAsync();
1148
- const executable = WorkflowCompilerExecutor.DOTNET_EXECUTABLE;
1154
+ const executable = workflowCompilerConfig.dotnetPath;
1149
1155
  const commandArgs = [compilerPath, operation, ...args];
1150
1156
  this.logCommandStart(operation, executable, commandArgs);
1151
1157
  return new Promise((resolve) => {
1152
1158
  let result = null;
1153
1159
  const fallbackErrors = [];
1154
- const childProcess = this.spawnProcess(executable, commandArgs);
1160
+ const childProcess = this.spawnProcess(executable, commandArgs, workflowCompilerConfig.dotnetEnv);
1155
1161
  let stdoutEnded = false;
1156
1162
  let stderrEnded = false;
1157
1163
  let processExited = false;
@@ -1202,11 +1208,12 @@ class WorkflowCompilerExecutor {
1202
1208
  this.setupCancellationHandler(childProcess, cancellationToken, resolve);
1203
1209
  });
1204
1210
  }
1205
- spawnProcess(command, args) {
1211
+ spawnProcess(command, args, env) {
1206
1212
  return spawn(command, args, {
1207
1213
  stdio: ["ignore", "pipe", "pipe"],
1208
1214
  shell: false,
1209
- windowsHide: true
1215
+ windowsHide: true,
1216
+ env: env ? { ...process.env, ...env } : undefined
1210
1217
  });
1211
1218
  }
1212
1219
  logCommandStart(operation, executable, commandArgs) {
@@ -1631,11 +1638,14 @@ class WorkflowCompilerToolFactory {
1631
1638
  ProjectTypes.WebApp
1632
1639
  ];
1633
1640
  async createAsync(logger, fileSystem, context) {
1634
- if (!this.isDotnetAvailable()) {
1641
+ if (!this.isPinnedByCaller() && !this.isDotnetAvailable()) {
1635
1642
  throw new Error(translate6.t("toolWorkflowcompiler.errors.dotnetNotAvailable"));
1636
1643
  }
1637
1644
  return new WorkflowCompilerTool(fileSystem, logger, context);
1638
1645
  }
1646
+ isPinnedByCaller() {
1647
+ return workflowCompilerConfig.workflowCompilerPath !== undefined && workflowCompilerConfig.dotnetPath !== DEFAULT_DOTNET_PATH;
1648
+ }
1639
1649
  isDotnetAvailable() {
1640
1650
  if (WorkflowCompilerToolFactory.cachedDotnetAvailable !== undefined) {
1641
1651
  return WorkflowCompilerToolFactory.cachedDotnetAvailable;
@@ -1656,4 +1666,4 @@ export {
1656
1666
  WorkflowCompilerToolFactory
1657
1667
  };
1658
1668
 
1659
- //# debugId=34D4B1BF483A641664756E2164756E21
1669
+ //# debugId=D679068934126E3664756E2164756E21
@@ -1,23 +1,36 @@
1
- export declare const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.196-cloud.23765";
1
+ export declare const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.198-alpha.24031";
2
+ /** The dotnet host used when no consumer pins one: whatever `dotnet` PATH resolves to. */
3
+ export declare const DEFAULT_DOTNET_PATH = "dotnet";
2
4
  export declare const workflowCompilerConfig: {
3
5
  workflowCompilerPath: string | undefined;
4
6
  workflowCompilerVersion: string;
7
+ dotnetPath: string;
8
+ dotnetEnv: Record<string, string> | undefined;
5
9
  };
6
10
  /**
7
11
  * Configure the workflow compiler tool.
8
12
  *
9
13
  * @param options.compilerPath - Explicit path to UiPath.WorkflowCompiler.dll (skips all resolution logic).
10
14
  * @param options.version - NuGet package version to download. Defaults to {@link DEFAULT_WORKFLOW_COMPILER_VERSION}.
15
+ * @param options.dotnetPath - dotnet host to launch the compiler with. Defaults to `dotnet` on PATH.
16
+ * @param options.dotnetEnv - Extra env vars for the compiler process (merged over the inherited env).
11
17
  *
12
18
  * @example
13
19
  * ```ts
14
20
  * import { setupWorkflowCompiler } from "@uipath/packager-tool-workflowcompiler";
15
21
  *
16
22
  * setupWorkflowCompiler({ compilerPath: "/path/to/UiPath.WorkflowCompiler.dll" });
17
- * setupWorkflowCompiler({ version: "26.0.196-cloud.23765" });
23
+ * setupWorkflowCompiler({ version: "26.0.198-alpha.24031" });
24
+ * setupWorkflowCompiler({
25
+ * compilerPath: "/path/to/UiPath.WorkflowCompiler.dll",
26
+ * dotnetPath: "/path/to/bundled/dotnet",
27
+ * dotnetEnv: { DOTNET_ROOT: "/path/to/bundled", DOTNET_MULTILEVEL_LOOKUP: "0" },
28
+ * });
18
29
  * ```
19
30
  */
20
31
  export declare function setupWorkflowCompiler(options: {
21
32
  compilerPath?: string;
22
33
  version?: string;
34
+ dotnetPath?: string;
35
+ dotnetEnv?: Record<string, string>;
23
36
  }): void;
@@ -5,7 +5,6 @@ import { type IFileSystem, type IToolLogger, ToolResult } from "@uipath/solution
5
5
  */
6
6
  export declare class WorkflowCompilerExecutor {
7
7
  private readonly logger;
8
- private static readonly DOTNET_EXECUTABLE;
9
8
  private readonly pathResolver;
10
9
  constructor(logger: IToolLogger, fileSystem: IFileSystem);
11
10
  /**
@@ -16,7 +15,7 @@ export declare class WorkflowCompilerExecutor {
16
15
  * @returns Promise resolving to ToolResult
17
16
  */
18
17
  executeAsync(operation: string, args: string[], cancellationToken?: AbortSignal): Promise<ToolResult>;
19
- protected spawnProcess(command: string, args: string[]): import("node:child_process").ChildProcessByStdio<null, import("node:stream").Readable, import("node:stream").Readable>;
18
+ protected spawnProcess(command: string, args: string[], env?: Record<string, string>): import("node:child_process").ChildProcessByStdio<null, import("node:stream").Readable, import("node:stream").Readable>;
20
19
  private logCommandStart;
21
20
  private setupStdoutHandling;
22
21
  private processOutputLine;
@@ -12,5 +12,17 @@ export declare class WorkflowCompilerToolFactory implements IProjectToolFactory
12
12
  private static cachedDotnetAvailable;
13
13
  readonly supportedTypes: readonly ProjectType[];
14
14
  createAsync(logger: IToolLogger, fileSystem: IFileSystem, context?: ProjectOperationContext): Promise<ProjectTool>;
15
+ /**
16
+ * True when the caller has supplied both the compiler and the dotnet host to
17
+ * run it with — i.e. it resolved its own .NET and neither the NuGet-restore
18
+ * fallback nor a machine-wide install is involved.
19
+ *
20
+ * The preflight below asks PATH for an SDK. A pinned host is typically a
21
+ * runtime-only bundle (Studio/Robot ship the runtime, never the SDK), which
22
+ * cannot answer `dotnet --version` at all — that is an SDK verb. Probing it
23
+ * can therefore only reject a configuration that works, so a caller that has
24
+ * pinned both is trusted and the tool is created unconditionally.
25
+ */
26
+ private isPinnedByCaller;
15
27
  private isDotnetAvailable;
16
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/packager-tool-workflowcompiler",
3
- "version": "1.198.0",
3
+ "version": "1.199.0-preview.104",
4
4
  "description": "UiPath Workflow Compiler tool implementation",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,8 +25,8 @@
25
25
  "author": "",
26
26
  "license": "ISC",
27
27
  "peerDependencies": {
28
- "@uipath/solutionpackager-tool-core": "1.198.0"
28
+ "@uipath/solutionpackager-tool-core": "1.199.0"
29
29
  },
30
30
  "dependencies": {},
31
- "gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
31
+ "gitHead": "829a8ab8a25bce5b62c284bd1ddc674d2947f647"
32
32
  }
@@ -1,8 +1,18 @@
1
- export const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.196-cloud.23765";
1
+ export const DEFAULT_WORKFLOW_COMPILER_VERSION = "26.0.198-alpha.24031";
2
+
3
+ /** The dotnet host used when no consumer pins one: whatever `dotnet` PATH resolves to. */
4
+ export const DEFAULT_DOTNET_PATH = "dotnet";
2
5
 
3
6
  export const workflowCompilerConfig = {
4
7
  workflowCompilerPath: undefined as string | undefined,
5
8
  workflowCompilerVersion: DEFAULT_WORKFLOW_COMPILER_VERSION as string,
9
+ // The dotnet host used to launch `UiPath.WorkflowCompiler.dll`. Defaults to `dotnet` on PATH.
10
+ // Consumers that ship a bundled runtime (e.g. rpa-tool resolving Robot/Studio's .NET) point this
11
+ // at the bundled muxer so the compiler runs under that runtime instead of a machine-wide install.
12
+ dotnetPath: DEFAULT_DOTNET_PATH as string,
13
+ // Extra environment variables for the compiler process (e.g. DOTNET_ROOT / DOTNET_MULTILEVEL_LOOKUP).
14
+ // Merged over the inherited process env. Undefined means inherit the parent env unchanged.
15
+ dotnetEnv: undefined as Record<string, string> | undefined,
6
16
  };
7
17
 
8
18
  /**
@@ -10,18 +20,27 @@ export const workflowCompilerConfig = {
10
20
  *
11
21
  * @param options.compilerPath - Explicit path to UiPath.WorkflowCompiler.dll (skips all resolution logic).
12
22
  * @param options.version - NuGet package version to download. Defaults to {@link DEFAULT_WORKFLOW_COMPILER_VERSION}.
23
+ * @param options.dotnetPath - dotnet host to launch the compiler with. Defaults to `dotnet` on PATH.
24
+ * @param options.dotnetEnv - Extra env vars for the compiler process (merged over the inherited env).
13
25
  *
14
26
  * @example
15
27
  * ```ts
16
28
  * import { setupWorkflowCompiler } from "@uipath/packager-tool-workflowcompiler";
17
29
  *
18
30
  * setupWorkflowCompiler({ compilerPath: "/path/to/UiPath.WorkflowCompiler.dll" });
19
- * setupWorkflowCompiler({ version: "26.0.196-cloud.23765" });
31
+ * setupWorkflowCompiler({ version: "26.0.198-alpha.24031" });
32
+ * setupWorkflowCompiler({
33
+ * compilerPath: "/path/to/UiPath.WorkflowCompiler.dll",
34
+ * dotnetPath: "/path/to/bundled/dotnet",
35
+ * dotnetEnv: { DOTNET_ROOT: "/path/to/bundled", DOTNET_MULTILEVEL_LOOKUP: "0" },
36
+ * });
20
37
  * ```
21
38
  */
22
39
  export function setupWorkflowCompiler(options: {
23
40
  compilerPath?: string;
24
41
  version?: string;
42
+ dotnetPath?: string;
43
+ dotnetEnv?: Record<string, string>;
25
44
  }): void {
26
45
  if (options.compilerPath !== undefined) {
27
46
  workflowCompilerConfig.workflowCompilerPath = options.compilerPath;
@@ -29,4 +48,10 @@ export function setupWorkflowCompiler(options: {
29
48
  if (options.version !== undefined) {
30
49
  workflowCompilerConfig.workflowCompilerVersion = options.version;
31
50
  }
51
+ if (options.dotnetPath !== undefined) {
52
+ workflowCompilerConfig.dotnetPath = options.dotnetPath;
53
+ }
54
+ if (options.dotnetEnv !== undefined) {
55
+ workflowCompilerConfig.dotnetEnv = options.dotnetEnv;
56
+ }
32
57
  }
@@ -12,6 +12,7 @@ import type {
12
12
  IOutputProgress,
13
13
  IOutputResult,
14
14
  } from "./output-entry.js";
15
+ import { workflowCompilerConfig } from "./workflow-compiler-config.js";
15
16
  import {
16
17
  type IWorkflowCompilerPathResolver,
17
18
  WorkflowCompilerPathResolver,
@@ -44,7 +45,6 @@ function camelCaseKeys(obj: unknown): unknown {
44
45
  * Handles process spawning, output parsing, and logging.
45
46
  */
46
47
  export class WorkflowCompilerExecutor {
47
- private static readonly DOTNET_EXECUTABLE = "dotnet";
48
48
  private readonly pathResolver: IWorkflowCompilerPathResolver;
49
49
 
50
50
  constructor(
@@ -71,7 +71,10 @@ export class WorkflowCompilerExecutor {
71
71
  ): Promise<ToolResult> {
72
72
  const startTime = Date.now();
73
73
  const compilerPath = await this.pathResolver.getCompilerPathAsync();
74
- const executable = WorkflowCompilerExecutor.DOTNET_EXECUTABLE;
74
+ // The compiler ships as a managed .dll, so it always runs via a dotnet host. `dotnetPath`
75
+ // defaults to `dotnet` on PATH; consumers with a bundled runtime (rpa-tool) point it at that
76
+ // muxer so the compiler runs under the bundled .NET instead of requiring a machine-wide install.
77
+ const executable = workflowCompilerConfig.dotnetPath;
75
78
  const commandArgs = [compilerPath, operation, ...args];
76
79
 
77
80
  this.logCommandStart(operation, executable, commandArgs);
@@ -80,7 +83,11 @@ export class WorkflowCompilerExecutor {
80
83
  let result: IOutputResult | null = null;
81
84
  const fallbackErrors: string[] = [];
82
85
 
83
- const childProcess = this.spawnProcess(executable, commandArgs);
86
+ const childProcess = this.spawnProcess(
87
+ executable,
88
+ commandArgs,
89
+ workflowCompilerConfig.dotnetEnv,
90
+ );
84
91
 
85
92
  // Track stream completion
86
93
  let stdoutEnded = false;
@@ -175,11 +182,18 @@ export class WorkflowCompilerExecutor {
175
182
  });
176
183
  }
177
184
 
178
- protected spawnProcess(command: string, args: string[]) {
185
+ protected spawnProcess(
186
+ command: string,
187
+ args: string[],
188
+ env?: Record<string, string>,
189
+ ) {
179
190
  return spawn(command, args, {
180
191
  stdio: ["ignore", "pipe", "pipe"],
181
192
  shell: false,
182
193
  windowsHide: true,
194
+ // Undefined inherits the parent env; a provided env is merged over it (so DOTNET_ROOT
195
+ // et al. are added without dropping PATH and friends the child still needs).
196
+ env: env ? { ...process.env, ...env } : undefined,
183
197
  });
184
198
  }
185
199
 
@@ -9,6 +9,10 @@ import {
9
9
  ProjectTypes,
10
10
  translate,
11
11
  } from "@uipath/solutionpackager-tool-core";
12
+ import {
13
+ DEFAULT_DOTNET_PATH,
14
+ workflowCompilerConfig,
15
+ } from "./workflow-compiler-config.js";
12
16
  import { WorkflowCompilerTool } from "./workflow-compiler-tool.js";
13
17
 
14
18
  /**
@@ -35,7 +39,7 @@ export class WorkflowCompilerToolFactory implements IProjectToolFactory {
35
39
  fileSystem: IFileSystem,
36
40
  context?: ProjectOperationContext,
37
41
  ): Promise<ProjectTool> {
38
- if (!this.isDotnetAvailable()) {
42
+ if (!this.isPinnedByCaller() && !this.isDotnetAvailable()) {
39
43
  throw new Error(
40
44
  translate.t("toolWorkflowcompiler.errors.dotnetNotAvailable"),
41
45
  );
@@ -43,6 +47,24 @@ export class WorkflowCompilerToolFactory implements IProjectToolFactory {
43
47
  return new WorkflowCompilerTool(fileSystem, logger, context);
44
48
  }
45
49
 
50
+ /**
51
+ * True when the caller has supplied both the compiler and the dotnet host to
52
+ * run it with — i.e. it resolved its own .NET and neither the NuGet-restore
53
+ * fallback nor a machine-wide install is involved.
54
+ *
55
+ * The preflight below asks PATH for an SDK. A pinned host is typically a
56
+ * runtime-only bundle (Studio/Robot ship the runtime, never the SDK), which
57
+ * cannot answer `dotnet --version` at all — that is an SDK verb. Probing it
58
+ * can therefore only reject a configuration that works, so a caller that has
59
+ * pinned both is trusted and the tool is created unconditionally.
60
+ */
61
+ private isPinnedByCaller(): boolean {
62
+ return (
63
+ workflowCompilerConfig.workflowCompilerPath !== undefined &&
64
+ workflowCompilerConfig.dotnetPath !== DEFAULT_DOTNET_PATH
65
+ );
66
+ }
67
+
46
68
  private isDotnetAvailable(): boolean {
47
69
  if (WorkflowCompilerToolFactory.cachedDotnetAvailable !== undefined) {
48
70
  return WorkflowCompilerToolFactory.cachedDotnetAvailable;