@botiverse/oar 0.21.2 → 0.22.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.
- package/README.md +11 -0
- package/dist/contracts/login.d.ts +91 -0
- package/dist/contracts/login.d.ts.map +1 -0
- package/dist/contracts/login.js +2 -0
- package/dist/contracts/login.js.map +1 -0
- package/dist/contracts/runtime.d.ts +5 -0
- package/dist/contracts/runtime.d.ts.map +1 -1
- package/dist/contracts/runtime.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runtimes/claude/auth-status.d.ts +10 -0
- package/dist/runtimes/claude/auth-status.d.ts.map +1 -0
- package/dist/runtimes/claude/auth-status.js +47 -0
- package/dist/runtimes/claude/auth-status.js.map +1 -0
- package/dist/runtimes/claude/index.d.ts +4 -0
- package/dist/runtimes/claude/index.d.ts.map +1 -1
- package/dist/runtimes/claude/index.js +4 -0
- package/dist/runtimes/claude/index.js.map +1 -1
- package/dist/runtimes/claude/login.d.ts +6 -0
- package/dist/runtimes/claude/login.d.ts.map +1 -0
- package/dist/runtimes/claude/login.js +209 -0
- package/dist/runtimes/claude/login.js.map +1 -0
- package/dist/runtimes/codex/app-server-client.d.ts +4 -1
- package/dist/runtimes/codex/app-server-client.d.ts.map +1 -1
- package/dist/runtimes/codex/app-server-client.js +4 -4
- package/dist/runtimes/codex/app-server-client.js.map +1 -1
- package/dist/runtimes/codex/index.d.ts +3 -0
- package/dist/runtimes/codex/index.d.ts.map +1 -1
- package/dist/runtimes/codex/index.js +3 -0
- package/dist/runtimes/codex/index.js.map +1 -1
- package/dist/runtimes/codex/login.d.ts +16 -0
- package/dist/runtimes/codex/login.d.ts.map +1 -0
- package/dist/runtimes/codex/login.js +241 -0
- package/dist/runtimes/codex/login.js.map +1 -0
- package/dist/shared/executable/index.d.ts +2 -2
- package/dist/shared/executable/index.d.ts.map +1 -1
- package/dist/shared/executable/index.js +1 -1
- package/dist/shared/executable/index.js.map +1 -1
- package/dist/shared/executable/isolated.d.ts.map +1 -1
- package/dist/shared/executable/isolated.js +2 -5
- package/dist/shared/executable/isolated.js.map +1 -1
- package/dist/shared/executable/process.d.ts +25 -8
- package/dist/shared/executable/process.d.ts.map +1 -1
- package/dist/shared/executable/process.js +25 -1
- package/dist/shared/executable/process.js.map +1 -1
- package/dist/shared/executable/run.d.ts +2 -0
- package/dist/shared/executable/run.d.ts.map +1 -1
- package/dist/shared/executable/run.js +1 -0
- package/dist/shared/executable/run.js.map +1 -1
- package/dist/shared/installation.d.ts +6 -0
- package/dist/shared/installation.d.ts.map +1 -1
- package/dist/shared/installation.js +7 -2
- package/dist/shared/installation.js.map +1 -1
- package/dist/shared/login.d.ts +80 -0
- package/dist/shared/login.d.ts.map +1 -0
- package/dist/shared/login.js +211 -0
- package/dist/shared/login.js.map +1 -0
- package/package.json +1 -1
|
@@ -7,6 +7,12 @@ export interface ExecutableInstallationOptions {
|
|
|
7
7
|
readonly readVersion?: VersionReader;
|
|
8
8
|
}
|
|
9
9
|
export type ExecutableFallbacks = readonly string[] | (() => readonly string[]);
|
|
10
|
+
/**
|
|
11
|
+
* Where an installation entry is, found without spawning anything: a pinned
|
|
12
|
+
* path must exist as given, a bare name resolves on PATH (and PATHEXT on
|
|
13
|
+
* Windows). Null when it is not there.
|
|
14
|
+
*/
|
|
15
|
+
export declare function locateExecutable(entry: string): string | null;
|
|
10
16
|
/**
|
|
11
17
|
* An installation probed from an executable: the env var pins one candidate
|
|
12
18
|
* exclusively; otherwise the command name and fallbacks are tried in order and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/shared/installation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAA2D,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKpH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,wEAAwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;CACtC;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,MAAM,EAAE,GAAG,CAAC,MAAM,SAAS,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/shared/installation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAA2D,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAKpH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,wEAAwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;CACtC;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,MAAM,EAAE,GAAG,CAAC,MAAM,SAAS,MAAM,EAAE,CAAC,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7D;AAYD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,mBAAwB,EACnC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,GAAE,6BAAkC,GAC1C,iBAAiB,CA0CnB"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { readExecutableVersion, resolveExecutable, runExecutable } from "./executable/index.js";
|
|
3
3
|
import { processFailure, stderrTail } from "./executable/diagnostics.js";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Where an installation entry is, found without spawning anything: a pinned
|
|
6
|
+
* path must exist as given, a bare name resolves on PATH (and PATHEXT on
|
|
7
|
+
* Windows). Null when it is not there.
|
|
8
|
+
*/
|
|
9
|
+
export function locateExecutable(entry) {
|
|
5
10
|
if (entry.includes("/") || entry.includes("\\")) {
|
|
6
11
|
return existsSync(entry) ? entry : null;
|
|
7
12
|
}
|
|
@@ -27,7 +32,7 @@ export function executableInstallation(envVar, command, fallbacks = [], readines
|
|
|
27
32
|
: [command, ...(typeof fallbacks === "function" ? fallbacks() : fallbacks)];
|
|
28
33
|
const found = [];
|
|
29
34
|
for (const entry of entries) {
|
|
30
|
-
const candidate =
|
|
35
|
+
const candidate = locateExecutable(entry);
|
|
31
36
|
if (candidate !== null && !found.includes(candidate)) {
|
|
32
37
|
found.push(candidate);
|
|
33
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/shared/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,aAAa,EAAsB,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAazE,
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../src/shared/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,aAAa,EAAsB,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAazE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KA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AAS,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;IAC1E,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { AvailableInstallation, ExecutableInstallation } from "../contracts/installation.js";
|
|
2
|
+
import type { LoginResult } from "../contracts/login.js";
|
|
3
|
+
/** Terminal escapes removed: colors, cursor movement, and OSC 8 hyperlinks (their visible text stays). */
|
|
4
|
+
export declare function stripTerminalEscapes(text: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Values that must never leave a login: the codes a person pasted, and any
|
|
7
|
+
* token-shaped text. Everything oar reports from runtime output goes through
|
|
8
|
+
* `redact`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class LoginSecrets {
|
|
11
|
+
#private;
|
|
12
|
+
/** Values too short to be secret on their own (a separator, a single word) are ignored. */
|
|
13
|
+
add(value: string): void;
|
|
14
|
+
redact(text: string): string;
|
|
15
|
+
/** The first non-blank line of `text`, redacted: a runtime's one-line reason, never a log tail. */
|
|
16
|
+
line(text: string): string;
|
|
17
|
+
}
|
|
18
|
+
export declare function errorMessage(error: unknown): string;
|
|
19
|
+
export type LoginStream = "stdout" | "stderr";
|
|
20
|
+
export interface LoginOutputHandlers {
|
|
21
|
+
/** One complete line from either stream, escapes stripped and trimmed; blank lines are skipped. */
|
|
22
|
+
readonly onLine: (line: string, stream: LoginStream) => void;
|
|
23
|
+
/** A stream's unterminated tail after each chunk, escapes stripped: a prompt printed with no newline. */
|
|
24
|
+
readonly onPartial?: (text: string, stream: LoginStream) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface LoginProcessExit {
|
|
27
|
+
readonly exitCode: number | null;
|
|
28
|
+
readonly signal: NodeJS.Signals | null;
|
|
29
|
+
/** The spawn error, when the command could not start. */
|
|
30
|
+
readonly error?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LoginProcess {
|
|
33
|
+
/** Settles once the command has exited (or failed to start). */
|
|
34
|
+
readonly exited: Promise<LoginProcessExit>;
|
|
35
|
+
/** Write to the command's stdin; a no-op once it has exited. */
|
|
36
|
+
write(text: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Stop the command and everything it started: SIGTERM to its process
|
|
39
|
+
* group, SIGKILL to the group after the grace period (the tree on
|
|
40
|
+
* Windows). Idempotent.
|
|
41
|
+
*/
|
|
42
|
+
stop(): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Run a login command over pipes (no terminal), in its own process group on
|
|
46
|
+
* POSIX, reading stdout and stderr alike. Nothing it prints is logged or
|
|
47
|
+
* forwarded except through `handlers`. Throws when the command cannot be
|
|
48
|
+
* spawned at all (an invalid path on Windows).
|
|
49
|
+
*/
|
|
50
|
+
export declare function spawnLoginProcess(command: string, args: readonly string[], env: NodeJS.ProcessEnv, handlers: LoginOutputHandlers): LoginProcess;
|
|
51
|
+
export type LoginStop = "timed_out" | "cancelled";
|
|
52
|
+
export interface LoginBounds {
|
|
53
|
+
/** Settles when the deadline passes or the caller aborts, whichever comes first. */
|
|
54
|
+
readonly stopped: Promise<LoginStop>;
|
|
55
|
+
dispose(): void;
|
|
56
|
+
}
|
|
57
|
+
/** The deadline and the caller's abort signal as one promise. */
|
|
58
|
+
export declare function loginBounds(signal: AbortSignal | undefined, timeoutMs: number): LoginBounds;
|
|
59
|
+
/** The result for a bounds stop: a timeout is a failure, an abort a cancellation. */
|
|
60
|
+
export declare function stoppedResult(stop: LoginStop, timeoutMs: number): LoginResult;
|
|
61
|
+
export type LoginExecutable = {
|
|
62
|
+
readonly kind: "executable";
|
|
63
|
+
readonly installation: ExecutableInstallation;
|
|
64
|
+
}
|
|
65
|
+
/** The login ends before anything runs. */
|
|
66
|
+
| {
|
|
67
|
+
readonly kind: "settled";
|
|
68
|
+
readonly result: LoginResult;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The executable to sign in, or the result that ends the login before
|
|
72
|
+
* anything runs: a bundled runtime or a version known to predate `floor` is
|
|
73
|
+
* unsupported, and an executable that is no longer there (found as the
|
|
74
|
+
* installation probe finds it, without spawning) fails alike on every
|
|
75
|
+
* platform, since a missing command started through a Windows shell would
|
|
76
|
+
* only exit. An unreadable version is tried, not refused: the login command
|
|
77
|
+
* itself then answers.
|
|
78
|
+
*/
|
|
79
|
+
export declare function loginExecutable(installation: AvailableInstallation, name: string, floor?: string): LoginExecutable;
|
|
80
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/shared/login.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAClG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAqBzD,0GAA0G;AAC1G,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AASD;;;;GAIG;AACH,qBAAa,YAAY;;IAGvB,2FAA2F;IAC3F,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMxB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAY5B,mGAAmG;IACnG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG3B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,mGAAmG;IACnG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7D,yGAAyG;IACzG,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAClE;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,C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C;AAE/D;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAelH"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { StringDecoder } from "node:string_decoder";
|
|
2
|
+
import spawn from "cross-spawn";
|
|
3
|
+
import { killGraceMs, killProcessTree, OWN_PROCESS_GROUP, signalProcessGroup } from "./executable/index.js";
|
|
4
|
+
import { locateExecutable } from "./installation.js";
|
|
5
|
+
import { releaseVersion, versionAtLeast } from "./update.js";
|
|
6
|
+
/*
|
|
7
|
+
* Mechanisms every login driver shares: running a vendor login command over
|
|
8
|
+
* pipes, reading what it prints, keeping secrets out of what oar reports,
|
|
9
|
+
* and the deadline and cancellation rules of the contract.
|
|
10
|
+
*/
|
|
11
|
+
const ESC = String.fromCodePoint(0x1B);
|
|
12
|
+
const BEL = String.fromCodePoint(0x07);
|
|
13
|
+
// OSC (hyperlinks, titles) ends with BEL or ESC \; CSI (colors, cursor moves)
|
|
14
|
+
// ends with a final byte in @-~; any other escape is ESC, optional
|
|
15
|
+
// intermediates (a charset choice: ESC ( B), and one final byte.
|
|
16
|
+
const TERMINAL_ESCAPES = new RegExp(`${ESC}\\][^${BEL}${ESC}]*(?:${BEL}|${ESC}\\\\)|${ESC}\\[[0-?]*[ -/]*[@-~]|${ESC}[ -/]*[0-~]`, "gu");
|
|
17
|
+
/** Terminal escapes removed: colors, cursor movement, and OSC 8 hyperlinks (their visible text stays). */
|
|
18
|
+
export function stripTerminalEscapes(text) {
|
|
19
|
+
return text.replace(TERMINAL_ESCAPES, "");
|
|
20
|
+
}
|
|
21
|
+
const TOKEN_SHAPES = [
|
|
22
|
+
/\bsk-[\w-]{16,}/gu, // Anthropic and OpenAI keys and OAuth tokens
|
|
23
|
+
/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu, // JWTs
|
|
24
|
+
];
|
|
25
|
+
const SECRET_MIN_LENGTH = 6;
|
|
26
|
+
const DETAIL_LIMIT = 500;
|
|
27
|
+
/**
|
|
28
|
+
* Values that must never leave a login: the codes a person pasted, and any
|
|
29
|
+
* token-shaped text. Everything oar reports from runtime output goes through
|
|
30
|
+
* `redact`.
|
|
31
|
+
*/
|
|
32
|
+
export class LoginSecrets {
|
|
33
|
+
#values = new Set();
|
|
34
|
+
/** Values too short to be secret on their own (a separator, a single word) are ignored. */
|
|
35
|
+
add(value) {
|
|
36
|
+
if (value.length >= SECRET_MIN_LENGTH) {
|
|
37
|
+
this.#values.add(value);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
redact(text) {
|
|
41
|
+
let redacted = text;
|
|
42
|
+
// Longest first, so a whole code is replaced before any of its parts.
|
|
43
|
+
for (const value of [...this.#values].toSorted((left, right) => right.length - left.length)) {
|
|
44
|
+
redacted = redacted.replaceAll(value, "[redacted]");
|
|
45
|
+
}
|
|
46
|
+
for (const shape of TOKEN_SHAPES) {
|
|
47
|
+
redacted = redacted.replace(shape, "[redacted]");
|
|
48
|
+
}
|
|
49
|
+
return redacted.length > DETAIL_LIMIT ? `${redacted.slice(0, DETAIL_LIMIT)}...` : redacted;
|
|
50
|
+
}
|
|
51
|
+
/** The first non-blank line of `text`, redacted: a runtime's one-line reason, never a log tail. */
|
|
52
|
+
line(text) {
|
|
53
|
+
return this.redact(text.split(/\r?\n/u).map((line) => line.trim()).find((line) => line !== "") ?? "");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export function errorMessage(error) {
|
|
57
|
+
return error instanceof Error ? error.message : String(error);
|
|
58
|
+
}
|
|
59
|
+
const PARTIAL_LIMIT = 64 * 1024;
|
|
60
|
+
/** After the command exits, how long something it started may keep the output pipes. */
|
|
61
|
+
const PIPE_DRAIN_MS = 2000;
|
|
62
|
+
function readStream(stream, name, handlers) {
|
|
63
|
+
if (stream === null) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const decoder = new StringDecoder("utf8");
|
|
67
|
+
let buffer = "";
|
|
68
|
+
stream.on("data", (chunk) => {
|
|
69
|
+
buffer += decoder.write(chunk);
|
|
70
|
+
const lines = buffer.split(/\r\n|\n|\r/u);
|
|
71
|
+
buffer = (lines.pop() ?? "").slice(-PARTIAL_LIMIT);
|
|
72
|
+
for (const raw of lines) {
|
|
73
|
+
const line = stripTerminalEscapes(raw).trim();
|
|
74
|
+
if (line !== "") {
|
|
75
|
+
handlers.onLine(line, name);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (buffer !== "") {
|
|
79
|
+
handlers.onPartial?.(stripTerminalEscapes(buffer), name);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
stream.on("end", () => {
|
|
83
|
+
const line = stripTerminalEscapes(buffer + decoder.end()).trim();
|
|
84
|
+
buffer = "";
|
|
85
|
+
if (line !== "") {
|
|
86
|
+
handlers.onLine(line, name);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function stopTree(child) {
|
|
91
|
+
if (process.platform === "win32") {
|
|
92
|
+
killProcessTree(child);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
signalProcessGroup(child, "SIGTERM");
|
|
96
|
+
// Kept after the command exits: what it started may outlive it in the group.
|
|
97
|
+
setTimeout(() => {
|
|
98
|
+
signalProcessGroup(child, "SIGKILL");
|
|
99
|
+
}, killGraceMs()).unref();
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Run a login command over pipes (no terminal), in its own process group on
|
|
103
|
+
* POSIX, reading stdout and stderr alike. Nothing it prints is logged or
|
|
104
|
+
* forwarded except through `handlers`. Throws when the command cannot be
|
|
105
|
+
* spawned at all (an invalid path on Windows).
|
|
106
|
+
*/
|
|
107
|
+
export function spawnLoginProcess(command, args, env, handlers) {
|
|
108
|
+
const child = spawn(command, [...args], {
|
|
109
|
+
env,
|
|
110
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
111
|
+
detached: OWN_PROCESS_GROUP,
|
|
112
|
+
windowsHide: true,
|
|
113
|
+
});
|
|
114
|
+
let running = true;
|
|
115
|
+
let stopped = false;
|
|
116
|
+
// A write racing the exit fails with EPIPE; the exit reports the outcome.
|
|
117
|
+
child.stdin?.on("error", () => { });
|
|
118
|
+
readStream(child.stdout, "stdout", handlers);
|
|
119
|
+
readStream(child.stderr, "stderr", handlers);
|
|
120
|
+
const exited = new Promise((resolve) => {
|
|
121
|
+
child.once("error", (error) => {
|
|
122
|
+
running = false;
|
|
123
|
+
resolve({ exitCode: null, signal: null, error: error.message });
|
|
124
|
+
});
|
|
125
|
+
child.once("exit", (exitCode, signal) => {
|
|
126
|
+
running = false;
|
|
127
|
+
// Something the command started may hold the output pipes open.
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
resolve({ exitCode, signal });
|
|
130
|
+
}, PIPE_DRAIN_MS).unref();
|
|
131
|
+
});
|
|
132
|
+
// `close` waits for the output pipes, so every line is read before the exit is reported.
|
|
133
|
+
child.once("close", (exitCode, signal) => {
|
|
134
|
+
running = false;
|
|
135
|
+
resolve({ exitCode, signal });
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
exited,
|
|
140
|
+
write(text) {
|
|
141
|
+
if (running && child.stdin?.writable === true) {
|
|
142
|
+
child.stdin.write(text);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
stop() {
|
|
146
|
+
if (stopped) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
stopped = true;
|
|
150
|
+
child.stdin?.end();
|
|
151
|
+
if (running) {
|
|
152
|
+
stopTree(child);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/** The deadline and the caller's abort signal as one promise. */
|
|
158
|
+
export function loginBounds(signal, timeoutMs) {
|
|
159
|
+
const { promise, resolve } = Promise.withResolvers();
|
|
160
|
+
const timer = setTimeout(() => {
|
|
161
|
+
resolve("timed_out");
|
|
162
|
+
}, timeoutMs);
|
|
163
|
+
// A deadline alone never keeps the host alive; the login process and the caller's prompt do.
|
|
164
|
+
timer.unref();
|
|
165
|
+
const onAbort = () => {
|
|
166
|
+
resolve("cancelled");
|
|
167
|
+
};
|
|
168
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
169
|
+
if (signal?.aborted === true) {
|
|
170
|
+
resolve("cancelled");
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
stopped: promise,
|
|
174
|
+
dispose() {
|
|
175
|
+
clearTimeout(timer);
|
|
176
|
+
signal?.removeEventListener("abort", onAbort);
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/** The result for a bounds stop: a timeout is a failure, an abort a cancellation. */
|
|
181
|
+
export function stoppedResult(stop, timeoutMs) {
|
|
182
|
+
return stop === "cancelled"
|
|
183
|
+
? { kind: "cancelled" }
|
|
184
|
+
: { kind: "failed", reason: "timed_out", detail: `no sign-in within ${String(timeoutMs)} ms` };
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The executable to sign in, or the result that ends the login before
|
|
188
|
+
* anything runs: a bundled runtime or a version known to predate `floor` is
|
|
189
|
+
* unsupported, and an executable that is no longer there (found as the
|
|
190
|
+
* installation probe finds it, without spawning) fails alike on every
|
|
191
|
+
* platform, since a missing command started through a Windows shell would
|
|
192
|
+
* only exit. An unreadable version is tried, not refused: the login command
|
|
193
|
+
* itself then answers.
|
|
194
|
+
*/
|
|
195
|
+
export function loginExecutable(installation, name, floor) {
|
|
196
|
+
if (installation.via !== "executable") {
|
|
197
|
+
return { kind: "settled", result: { kind: "unsupported", reason: "unsupported_installation", detail: "not a machine-installed executable" } };
|
|
198
|
+
}
|
|
199
|
+
const version = installation.version === undefined ? undefined : releaseVersion(installation.version);
|
|
200
|
+
if (floor !== undefined && version !== undefined && !versionAtLeast(version, floor)) {
|
|
201
|
+
return {
|
|
202
|
+
kind: "settled",
|
|
203
|
+
result: { kind: "unsupported", reason: "version_unsupported", detail: `${name} ${floor} or later is required; this is ${version}` },
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
if (locateExecutable(installation.command) === null) {
|
|
207
|
+
return { kind: "settled", result: { kind: "failed", reason: "process_failed", detail: `${name} executable not found: ${installation.command}` } };
|
|
208
|
+
}
|
|
209
|
+
return { kind: "executable", installation };
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/shared/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,MAAM,aAAa,CAAC;AAGhC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;GAIG;AAEH,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACvC,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACvC,8EAA8E;AAC9E,mEAAmE;AACnE,iEAAiE;AACjE,MAAM,gBAAgB,GAAG,IAAI,MAAM,CACjC,GAAG,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,GAAG,aAAa,EAC7F,IAAI,CACL,CAAC;AAEF,0GAA0G;AAC1G,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,YAAY,GAAG;IACnB,mBAAmB,EAAE,6CAA6C;IACl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{
|
|
2
2
|
"name": "@botiverse/oar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "A programming interface for all agent harnesses: provider-independent contracts for controlling and observing agent runtimes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|