@uipath/coder-tool 1.199.0 → 1.201.0-preview.115

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/package.json CHANGED
@@ -1,29 +1,21 @@
1
1
  {
2
- "name": "@uipath/coder-tool",
3
- "license": "MIT",
4
- "version": "1.199.0",
5
- "description": "Interactive coding agent (Pi) with UiPath LLM Gateway and BYO provider support.",
6
- "type": "module",
7
- "main": "./dist/tool.js",
8
- "exports": {
9
- ".": "./dist/tool.js"
10
- },
11
- "bin": {
12
- "coder-tool": "./dist/index.js"
13
- },
14
- "dependencies": {
15
- "@earendil-works/pi-coding-agent": "^0.80.6"
16
- },
17
- "devDependencies": {
18
- "commander": "^14.0.3",
19
- "@uipath/common": "1.199.0",
20
- "@uipath/auth": "1.199.0",
21
- "@uipath/filesystem": "1.199.0",
22
- "@types/node": "^25.5.2",
23
- "typescript": "^6.0.2"
24
- },
25
- "publishConfig": {
26
- "registry": "https://registry.npmjs.org/"
27
- },
28
- "gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
2
+ "name": "@uipath/coder-tool",
3
+ "license": "MIT",
4
+ "version": "1.201.0-preview.115",
5
+ "description": "Interactive coding agent (Pi) with UiPath LLM Gateway and BYO provider support.",
6
+ "type": "module",
7
+ "main": "./dist/tool.js",
8
+ "exports": {
9
+ ".": "./dist/tool.js"
10
+ },
11
+ "bin": {
12
+ "coder-tool": "./dist/index.js"
13
+ },
14
+ "dependencies": {
15
+ "@earendil-works/pi-coding-agent": "^0.80.6"
16
+ },
17
+ "publishConfig": {
18
+ "registry": "https://registry.npmjs.org/"
19
+ },
20
+ "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
29
21
  }
@@ -0,0 +1,32 @@
1
+ import { describe, it } from "vitest";
2
+ import {
3
+ type E2EManifest,
4
+ MANIFEST_PATH,
5
+ } from "../../../tests/e2e-shared/global-setup";
6
+ import {
7
+ assertHelpCommandDuration,
8
+ EXEC_TIMEOUT,
9
+ readManifest,
10
+ } from "../../../tests/e2e-shared/helpers";
11
+
12
+ const HELP_BUDGET_MS = 1_000;
13
+
14
+ const manifest = readManifest<E2EManifest>(MANIFEST_PATH);
15
+ const projectDir = manifest.sharedInstall.tempDir;
16
+
17
+ // Performance budgets are unreliable on Windows CI runners; skip there.
18
+ describe.skipIf(process.platform === "win32")("coder performance", () => {
19
+ it(
20
+ `uip coder -h completes within ${HELP_BUDGET_MS}ms`,
21
+ () => {
22
+ assertHelpCommandDuration({
23
+ projectDir,
24
+ packageName: "@uipath/coder-tool",
25
+ args: "coder -h",
26
+ thresholdMs: HELP_BUDGET_MS,
27
+ testFileUrl: import.meta.url,
28
+ });
29
+ },
30
+ EXEC_TIMEOUT,
31
+ );
32
+ });
@@ -1,16 +0,0 @@
1
- import{f as $}from"./tool-9pd3s4a8.js";import{q as Z}from"./tool-jjb10rbq.js";class w{async execute(k,x,y,I){let z=$();if(!z?.window)throw Error("Browser environment required for authentication");let G=z.window.screen?.width??1024,M=z.window.screen?.height??768,V=600,X=700,N=G/2-V/2,P=M/2-X/2;if(!z.window.open)throw Error("window.open is not available");let B=z.window.open(k,"uip_auth",`width=${V},height=${X},left=${N},top=${P},resizable=yes,scrollbars=yes,status=yes`);if(!B)throw Error(`Authentication popup was blocked by your browser.
2
-
3
- To continue:
4
- 1. Look for a popup blocker icon in your address bar
5
- 2. Allow popups for this site
6
- 3. Try logging in again
7
-
8
- If using an ad blocker, you may need to temporarily disable it.`);return new Promise((U,J)=>{let K,Y=(q)=>{if(q.data?.type==="UIP_AUTH_CODE"&&q.data.code){if(q.data.state!==y){F(),J(Error("OAuth state mismatch — the callback state does not match the expected value. "+"This may indicate a CSRF attack. Please try signing in again.")),B.close();return}F(),U(q.data.code),B.close()}else if(q.data?.type==="UIP_AUTH_ERROR"){F();let W=q.data.error||"Authentication failed";J(Error(`Authentication failed: ${W}
9
-
10
- Please check your credentials and try again. If the problem persists, verify your UiPath account is active.`)),B.close()}},F=()=>{if(z.window?.removeEventListener?.("message",Y),I?.signal?.removeEventListener("abort",Q),K)clearInterval(K)},Q=()=>{F();let q=Error(`Authentication was cancelled.
11
-
12
- The sign-in was cancelled before completing the login process. Please try again and complete the authentication flow.`);q.code=Z,J(q),B.close()};if(I?.signal){if(I.signal.aborted){Q();return}I.signal.addEventListener("abort",Q,{once:!0})}if(z.window?.addEventListener)z.window.addEventListener("message",Y);K=setInterval(()=>{if(B.closed)F(),J(Error(`Authentication was cancelled.
13
-
14
- The authentication popup was closed before completing the login process. Please try again and complete the authentication flow.`))},1000)})}}export{w as BrowserAuthStrategy};
15
-
16
- //# debugId=929353797044A3D264756E2164756E21
@@ -1,62 +0,0 @@
1
- import {
2
- catchError,
3
- getFileSystem,
4
- startServer
5
- } from "./tool-nvhfxv67.js";
6
- import"./tool-vc9mne6b.js";
7
-
8
- // ../auth/src/strategies/node-strategy.ts
9
- class NodeAuthStrategy {
10
- async execute(url, redirectUri, expectedState, opts) {
11
- const fs = getFileSystem();
12
- const callbackUrl = await startServer({
13
- redirectUri,
14
- timeoutMs: opts?.timeoutMs,
15
- signal: opts?.signal,
16
- onListening: async () => {
17
- let safeUrl = "";
18
- for (const ch of url) {
19
- const c = ch.charCodeAt(0);
20
- if (c > 31 && (c < 128 || c > 159))
21
- safeUrl += ch;
22
- }
23
- if (opts?.noBrowser) {
24
- if (!opts.onAuthUrl) {
25
- throw new Error("Headless login (noBrowser) requires an onAuthUrl handler " + "to surface the authorize URL, but none was provided.");
26
- }
27
- opts.onAuthUrl(safeUrl);
28
- return;
29
- }
30
- const [openError] = await catchError(fs.utils.open(url));
31
- if (!openError)
32
- return;
33
- const isSpawnError = "code" in openError && openError.code === "ENOENT";
34
- if (isSpawnError) {
35
- throw new Error("Could not open a browser. No supported browser launcher was found. " + `On a headless or minimal system, use non-interactive login instead:
36
-
37
- ` + ` uip login --client-id <id> --client-secret <secret> -t <tenant>
38
-
39
- ` + "Or install a browser opener for your OS (e.g. xdg-utils on Linux).", { cause: openError });
40
- }
41
- throw new Error("Could not open the browser automatically. " + `Visit this URL to authenticate:
42
-
43
- ${safeUrl}
44
- `, { cause: openError });
45
- }
46
- });
47
- const returnedState = callbackUrl.searchParams.get("state");
48
- if (returnedState !== expectedState) {
49
- throw new Error("OAuth state mismatch — the callback state does not match the expected value. " + "This may indicate a CSRF attack. Please try signing in again.");
50
- }
51
- const code = callbackUrl.searchParams.get("code");
52
- if (!code) {
53
- throw new Error("No authorization code received");
54
- }
55
- return code;
56
- }
57
- }
58
- export {
59
- NodeAuthStrategy
60
- };
61
-
62
- //# debugId=A474411E22F056AC64756E2164756E21
@@ -1,10 +0,0 @@
1
- import{g as H,h as I,i as J}from"./tool-eqyd37dw.js";import"./tool-jjb10rbq.js";class N{async execute(B,K,L,j){let M=H(),C=await J({redirectUri:K,timeoutMs:j?.timeoutMs,signal:j?.signal,onListening:async()=>{let z="";for(let G of B){let A=G.charCodeAt(0);if(A>31&&(A<128||A>159))z+=G}if(j?.noBrowser){if(!j.onAuthUrl)throw Error("Headless login (noBrowser) requires an onAuthUrl handler to surface the authorize URL, but none was provided.");j.onAuthUrl(z);return}let[q]=await I(M.utils.open(B));if(!q)return;if("code"in q&&q.code==="ENOENT")throw Error(`Could not open a browser. No supported browser launcher was found. On a headless or minimal system, use non-interactive login instead:
2
-
3
- uip login --client-id <id> --client-secret <secret> -t <tenant>
4
-
5
- Or install a browser opener for your OS (e.g. xdg-utils on Linux).`,{cause:q});throw Error(`Could not open the browser automatically. Visit this URL to authenticate:
6
-
7
- ${z}
8
- `,{cause:q})}});if(C.searchParams.get("state")!==L)throw Error("OAuth state mismatch — the callback state does not match the expected value. "+"This may indicate a CSRF attack. Please try signing in again.");let D=C.searchParams.get("code");if(!D)throw Error("No authorization code received");return D}}export{N as NodeAuthStrategy};
9
-
10
- //# debugId=A2A1CBCD1F751D6264756E2164756E21