@uipath/codedagent-tool 1.0.4 → 1.195.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,38 @@
1
+ import { type RunUipathPythonCommandFailureReason } from "@uipath/uipath-python-bridge";
2
+ /** Pass-through of the bridge's {@link RunUipathPythonCommandFailureReason} — keeps both consumers in lockstep on one taxonomy. */
3
+ export type CodedagentInitFailureReason = RunUipathPythonCommandFailureReason;
4
+ export interface CodedagentInitOptions {
5
+ /** Working dir for the Python spawn. Required — `uipath init` writes `.uipath/` + `uipath.json` under cwd. */
6
+ cwd: string;
7
+ /** Extra args forwarded after `init`. Matches `uip codedagent init <args...>`. */
8
+ args?: string[];
9
+ /** Cancel the spawn from the host (e.g. the user dismisses a progress UI). */
10
+ signal?: AbortSignal;
11
+ }
12
+ export interface CodedagentInitSuccess {
13
+ ok: true;
14
+ /** Absolute path to the Python `uipath` executable invoked (resolved from the cache). Useful for "[ok] ran <path>" logging. */
15
+ pythonExePath: string;
16
+ /** Captured stdout from the Python process (empty when the binary writes only to its own stdio). */
17
+ stdout: string;
18
+ }
19
+ export interface CodedagentInitFailure {
20
+ ok: false;
21
+ reason: CodedagentInitFailureReason;
22
+ /** Short single-line summary suitable for top-level surfacing. */
23
+ message: string;
24
+ /** Remediation guidance. For `python_not_configured` / `uipath_exe_missing` this is `"Run 'uip codedagent setup' first to configure environment."`. */
25
+ instructions: string;
26
+ /** Recommended exit code. `1` default; `3` for `command_disabled`; Python's exit code for `command_failed`. */
27
+ exitCode: number;
28
+ /** Captured stderr — populated for `spawn_failed` / `command_failed` so callers can show the user the real error without re-spawning. */
29
+ stderr?: string;
30
+ }
31
+ export type CodedagentInitResult = CodedagentInitSuccess | CodedagentInitFailure;
32
+ /**
33
+ * Programmatic core of `uip codedagent init`. Thin adapter over {@link runUipathPythonCommand} —
34
+ * shares the same cache/auth/preflight pipeline with the CLI path. Library-friendly:
35
+ * `stdio: "pipe"` captures Python's output into the result; does not touch
36
+ * `OutputFormatter`/`processContext`.
37
+ */
38
+ export declare function codedagentInitAsync(options: CodedagentInitOptions): Promise<CodedagentInitResult>;