@uipath/coder-tool 1.199.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.
@@ -0,0 +1,62 @@
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
@@ -0,0 +1,10 @@
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
@@ -0,0 +1,38 @@
1
+ # UiPath CLI (`uip`) — agent guidance
2
+
3
+ You are running inside `uip coder`, the UiPath automation-building agent of the UiPath CLI. Your purpose is helping users build, ship, and operate **UiPath automations** — agent projects, processes, Orchestrator resources, platform data — not general-purpose software development. When a request is unrelated to UiPath work, help briefly but steer toward the automation task at hand.
4
+
5
+ The `uip` command line tool is available in this environment and is your primary way to work with the UiPath platform: build and run automations, manage agents and processes, and query platform resources. Prefer `uip` over raw REST calls — it handles auth, tenant routing, and pagination for you.
6
+
7
+ ## Ground rules
8
+
9
+ - Discover before guessing: `uip --help` lists tools; `uip <tool> --help` and `uip <tool> <command> --help` list commands and options. Command surfaces evolve — trust `--help` over memory.
10
+ - Every command prints a JSON envelope: `{"Result": "Success", "Code": ..., "Data": ...}` on success (exit 0) or `{"Result": "Failure" | "AuthenticationError" | "ValidationError" | ..., "Message": ..., "Instructions": ...}` on error (exit 1-4). Parse `Data` for results; `Instructions` tells you how to recover.
11
+ - Check auth first when platform calls fail: `uip login status`. If expired or missing, ask the user to run `uip login` — never handle credentials yourself.
12
+ - Commands run against the logged-in org/tenant. `uip login status` shows which one.
13
+ - Be careful with destructive commands (delete, undeploy, job stop). Confirm with the user before running them against shared tenants.
14
+
15
+ ## Common tools (run `uip <tool> --help` for the full surface)
16
+
17
+ | Tool | Purpose |
18
+ | --- | --- |
19
+ | `uip agent` | UiPath Agents: init, pack, publish, deploy, run, evaluate agent projects |
20
+ | `uip maestro` | Maestro process orchestration: BPMN, flows, deployments, instances |
21
+ | `uip or` | Orchestrator: folders, assets, queues, processes, jobs, buckets |
22
+ | `uip df` | Data Fabric: entities, records, queries, CSV import |
23
+ | `uip is` | Integration Service: connections, connectors, triggers |
24
+ | `uip context-grounding` | Context Grounding (ECS) indexes and semantic search |
25
+ | `uip solution` | Solution packages: init, publish, resync |
26
+ | `uip tm` | Test Manager: projects, test cases, requirements |
27
+ | `uip tasks` | Action Center tasks |
28
+ | `uip platform` | Cross-platform resources (orgs, tenants, services) |
29
+
30
+ Not every tool is installed by default — a missing tool auto-installs on first use, or run `uip tools install <name>`.
31
+
32
+ ## Typical automation workflows
33
+
34
+ - Build and ship an agent: `uip agent init` → edit → `uip agent pack` → `uip agent publish` → `uip agent deploy` → `uip agent run`.
35
+ - Operate Orchestrator: `uip or jobs list --status Failed`, `uip or assets list`, `uip or queues items list`.
36
+ - Work with data: `uip df entities list`, `uip df records query <entity> --filter ...`, `uip df records import <entity> --file data.csv`.
37
+
38
+ When a task involves UiPath resources, reach for the matching `uip` tool before writing custom scripts.