@uipath/cli 1.204.0-preview.255 → 1.205.0-preview.256

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,22 +1,24 @@
1
1
  import {
2
2
  runWithAuthProfile
3
- } from "./index-zwnedwxc.js";
3
+ } from "./index-30618bjs.js";
4
4
  import {
5
5
  OUTPUT_FORMATS,
6
6
  catchError,
7
7
  collectCommands,
8
+ getExitCode,
8
9
  getOutputSink,
9
10
  logger,
11
+ resetExitCode,
10
12
  runWithSink,
11
13
  setGlobalSink
12
- } from "./index-trd07rnv.js";
14
+ } from "./index-pj3g8ftz.js";
13
15
  import"./index-g8ck9tv6.js";
14
16
  import {
15
17
  exports_external
16
18
  } from "./index-hrt7fpkk.js";
17
19
  import"./index-0gctz400.js";
18
20
  import"./index-qa9gftnj.js";
19
- import"./index-xdxr3ync.js";
21
+ import"./index-hdxtgckw.js";
20
22
  import"./index-yc4kw997.js";
21
23
  import {
22
24
  __require
@@ -63,9 +65,22 @@ class ExitError extends Error {
63
65
  async function executeCommand(command) {
64
66
  const args = command.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) || [];
65
67
  const cleanArgs = args.map((a) => a.replace(/^["']|["']$/g, ""));
68
+ return executeArgv([...cleanArgs, "--output", "json"]);
69
+ }
70
+ var queue = Promise.resolve();
71
+ function executeArgv(cleanArgs) {
72
+ const task = queue.then(() => runOne(cleanArgs));
73
+ queue = task.then(() => {
74
+ return;
75
+ }, () => {
76
+ return;
77
+ });
78
+ return task;
79
+ }
80
+ async function runOne(cleanArgs) {
66
81
  const sink = new BufferSink;
67
82
  let exitCode = 0;
68
- const syntheticArgv = ["node", "uip", ...cleanArgs, "--output", "json"];
83
+ const syntheticArgv = ["node", "uip", ...cleanArgs];
69
84
  const context = {
70
85
  args: syntheticArgv,
71
86
  output: {
@@ -82,9 +97,10 @@ async function executeCommand(command) {
82
97
  }
83
98
  };
84
99
  const previousSink = getOutputSink();
100
+ resetExitCode();
85
101
  setGlobalSink(sink);
86
102
  const [error] = await catchError(async () => {
87
- const { run } = await import("./cli-7xq6r3rc.js");
103
+ const { run } = await import("./cli-xekt99dc.js");
88
104
  await runWithAuthProfile(undefined, () => runWithSink(sink, () => run(context)));
89
105
  });
90
106
  if (error) {
@@ -94,7 +110,10 @@ async function executeCommand(command) {
94
110
  exitCode = 1;
95
111
  sink.writeErr(error instanceof Error ? error.message : String(error));
96
112
  }
113
+ } else {
114
+ exitCode = getExitCode();
97
115
  }
116
+ resetExitCode();
98
117
  setGlobalSink(previousSink);
99
118
  return { stdout: sink.stdout, stderr: sink.stderr, exitCode };
100
119
  }
@@ -132,7 +151,7 @@ function introspectCommands(program) {
132
151
  }
133
152
  }
134
153
  lines.push(`
135
- Global Options (can be used with any command):`, ` --output <${OUTPUT_FORMATS.join("|")}>: Output format (default: json)`, " --output-filter <expression>: JMESPath expression applied to the Data field of the response envelope", " --log-level <debug|info|warn|error>: Log level threshold (default: info)", " --log-file <path>: Write logs to file instead of stderr", " --profile <name>: Use a named login profile (~/.uipath/profiles/<name>/.auth)", `
154
+ Global Options (can be used with any command):`, ` --output <${OUTPUT_FORMATS.join("|")}>: Output format (default: json)`, " --output-filter <expression>: JMESPath expression applied to the Data field of the response envelope", " --log-level <debug|info|warn|error>: Log level threshold (default: warn)", " --log-file <path>: Write logs to file instead of stderr", " --profile <name>: Use a named login profile (~/.uipath/profiles/<name>/.auth)", `
136
155
  Pass the command without the 'uip' prefix. Example: "login status --output json"`, `Filter example: "tools list --output-filter 'Data[].name'"`);
137
156
  return lines.join(`
138
157
  `);
@@ -165,6 +184,28 @@ ${output}` : output
165
184
  isError
166
185
  };
167
186
  });
187
+ server.registerTool("run_argv", {
188
+ description: `Run one CLI command given as argv (without 'uip'), e.g. ["is", "connections", "list", "--output", "json"]. Each element is passed through verbatim, so values with spaces or quotes are safe. Nothing is appended: pass your own --output. Returns stdout, stderr and the exit code as separate fields.`,
189
+ inputSchema: {
190
+ args: exports_external.array(exports_external.string()).min(1).describe("The command's arguments, one per element, without the 'uip' prefix.")
191
+ },
192
+ outputSchema: {
193
+ stdout: exports_external.string(),
194
+ stderr: exports_external.string(),
195
+ exitCode: exports_external.number().int()
196
+ }
197
+ }, async ({ args }) => {
198
+ const result = await executeArgv(args);
199
+ return {
200
+ content: [
201
+ {
202
+ type: "text",
203
+ text: JSON.stringify(result)
204
+ }
205
+ ],
206
+ structuredContent: { ...result }
207
+ };
208
+ });
168
209
  const transport = new StdioServerTransport;
169
210
  await server.connect(transport);
170
211
  await new Promise((resolve) => {
@@ -192,4 +233,4 @@ export {
192
233
  startMcpServer
193
234
  };
194
235
 
195
- //# debugId=95A6EF0EC5E5518C64756E2164756E21
236
+ //# debugId=CF2C904DCB425A6764756E2164756E21
@@ -7,8 +7,8 @@ import {
7
7
  logger,
8
8
  releaseClaimedSpoolFile,
9
9
  sweepTelemetrySpool
10
- } from "./index-trd07rnv.js";
11
- import"./index-xdxr3ync.js";
10
+ } from "./index-pj3g8ftz.js";
11
+ import"./index-hdxtgckw.js";
12
12
  import"./index-1yh8g550.js";
13
13
 
14
14
  // src/services/telemetry-drain.ts
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  runUpdate
3
- } from "./index-p0f7rv7t.js";
4
- import"./index-trd07rnv.js";
3
+ } from "./index-yx2tptr8.js";
4
+ import"./index-pj3g8ftz.js";
5
5
  import"./index-g8ck9tv6.js";
6
6
  import"./index-hrt7fpkk.js";
7
7
  import"./index-d3w0wn6k.js";
8
- import"./index-xdxr3ync.js";
8
+ import"./index-hdxtgckw.js";
9
9
  import"./index-1yh8g550.js";
10
10
  export {
11
11
  runUpdate
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/cli",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.204.0-preview.255",
5
+ "version": "1.205.0-preview.256",
6
6
  "description": "Cross platform CLI for UiPath",
7
7
  "repository": {
8
8
  "type": "git",
@@ -36,5 +36,5 @@
36
36
  "kerberos": "7.0.0",
37
37
  "node-expose-sspi": "0.1.60"
38
38
  },
39
- "gitHead": "699c58dabb59414557755a8933bcbe40aa420df3"
39
+ "gitHead": "63740c6cbb7ff282fa9118cc16a148eb030b245f"
40
40
  }