@claudexor/cli 3.6.0 → 3.8.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/dist/accounts-projection.d.ts +4 -2
- package/dist/accounts-projection.d.ts.map +1 -1
- package/dist/accounts-projection.js +49 -2
- package/dist/accounts-projection.js.map +1 -1
- package/dist/accounts-services.d.ts +7 -1
- package/dist/accounts-services.d.ts.map +1 -1
- package/dist/accounts-services.js +7 -2
- package/dist/accounts-services.js.map +1 -1
- package/dist/agy-quota-source.d.ts +1 -0
- package/dist/agy-quota-source.d.ts.map +1 -1
- package/dist/agy-quota-source.js +61 -108
- package/dist/agy-quota-source.js.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +6 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/claudexord-entry.d.ts +7 -2
- package/dist/claudexord-entry.d.ts.map +1 -1
- package/dist/claudexord-entry.js +33 -11
- package/dist/claudexord-entry.js.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +1 -0
- package/dist/command-flags.js.map +1 -1
- package/dist/control-services.d.ts +28 -14
- package/dist/control-services.d.ts.map +1 -1
- package/dist/control-services.js +16 -5
- package/dist/control-services.js.map +1 -1
- package/dist/credential-commands.d.ts +16 -0
- package/dist/credential-commands.d.ts.map +1 -1
- package/dist/credential-commands.js +47 -13
- package/dist/credential-commands.js.map +1 -1
- package/dist/credential-profile-mutations.d.ts +7 -0
- package/dist/credential-profile-mutations.d.ts.map +1 -1
- package/dist/credential-profile-mutations.js +63 -31
- package/dist/credential-profile-mutations.js.map +1 -1
- package/dist/delegation-belt-descriptor.d.ts +2 -1
- package/dist/delegation-belt-descriptor.d.ts.map +1 -1
- package/dist/delegation-belt-descriptor.js +2 -1
- package/dist/delegation-belt-descriptor.js.map +1 -1
- package/dist/harness-command-specs.d.ts.map +1 -1
- package/dist/harness-command-specs.js +4 -4
- package/dist/harness-command-specs.js.map +1 -1
- package/dist/harness-command.d.ts +5 -3
- package/dist/harness-command.d.ts.map +1 -1
- package/dist/harness-command.js +5 -3
- package/dist/harness-command.js.map +1 -1
- package/dist/harness-install-lease.d.ts +11 -0
- package/dist/harness-install-lease.d.ts.map +1 -0
- package/dist/harness-install-lease.js +98 -0
- package/dist/harness-install-lease.js.map +1 -0
- package/dist/harness-install-proof.d.ts +36 -0
- package/dist/harness-install-proof.d.ts.map +1 -0
- package/dist/harness-install-proof.js +148 -0
- package/dist/harness-install-proof.js.map +1 -0
- package/dist/harness-install-recipes.d.ts +80 -0
- package/dist/harness-install-recipes.d.ts.map +1 -0
- package/dist/harness-install-recipes.js +130 -0
- package/dist/harness-install-recipes.js.map +1 -0
- package/dist/harness-installer.d.ts +45 -46
- package/dist/harness-installer.d.ts.map +1 -1
- package/dist/harness-installer.js +248 -156
- package/dist/harness-installer.js.map +1 -1
- package/dist/native-login.d.ts +7 -0
- package/dist/native-login.d.ts.map +1 -1
- package/dist/native-login.js +29 -13
- package/dist/native-login.js.map +1 -1
- package/dist/profile-registration.d.ts +2 -0
- package/dist/profile-registration.d.ts.map +1 -1
- package/dist/profile-registration.js +48 -5
- package/dist/profile-registration.js.map +1 -1
- package/dist/quota-services.d.ts +2 -2
- package/dist/remote-command.d.ts +0 -2
- package/dist/remote-command.d.ts.map +1 -1
- package/dist/remote-command.js +3 -74
- package/dist/remote-command.js.map +1 -1
- package/dist/setup-attach-command.d.ts +30 -0
- package/dist/setup-attach-command.d.ts.map +1 -0
- package/dist/setup-attach-command.js +118 -0
- package/dist/setup-attach-command.js.map +1 -0
- package/dist/setup-job-store.d.ts +2 -2
- package/dist/setup-job-support.d.ts +23 -13
- package/dist/setup-job-support.d.ts.map +1 -1
- package/dist/setup-job-support.js +55 -13
- package/dist/setup-job-support.js.map +1 -1
- package/dist/setup-jobs.d.ts +4 -4
- package/dist/setup-jobs.d.ts.map +1 -1
- package/dist/setup-jobs.js +50 -47
- package/dist/setup-jobs.js.map +1 -1
- package/dist/setup-login-capability.d.ts +37 -0
- package/dist/setup-login-capability.d.ts.map +1 -0
- package/dist/setup-login-capability.js +96 -0
- package/dist/setup-login-capability.js.map +1 -0
- package/dist/setup-login-io.d.ts +4 -1
- package/dist/setup-login-io.d.ts.map +1 -1
- package/dist/setup-login-io.js +22 -3
- package/dist/setup-login-io.js.map +1 -1
- package/dist/setup-login-pty.d.ts +64 -22
- package/dist/setup-login-pty.d.ts.map +1 -1
- package/dist/setup-login-pty.js +289 -48
- package/dist/setup-login-pty.js.map +1 -1
- package/dist/setup-login-runner-support.d.ts +12 -0
- package/dist/setup-login-runner-support.d.ts.map +1 -0
- package/dist/setup-login-runner-support.js +65 -0
- package/dist/setup-login-runner-support.js.map +1 -0
- package/dist/setup-login-runner.d.ts +2 -0
- package/dist/setup-login-runner.d.ts.map +1 -1
- package/dist/setup-login-runner.js +119 -116
- package/dist/setup-login-runner.js.map +1 -1
- package/dist/setup-runner-outcome.d.ts +10 -0
- package/dist/setup-runner-outcome.d.ts.map +1 -0
- package/dist/setup-runner-outcome.js +49 -0
- package/dist/setup-runner-outcome.js.map +1 -0
- package/package.json +24 -24
package/dist/setup-login-pty.js
CHANGED
|
@@ -1,58 +1,299 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { access, lstat } from "node:fs/promises";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
export const CONPTY_HELPER_PROTOCOL = "claudexor-conpty-helper-v1";
|
|
6
|
+
export const CONPTY_HELPER_ARCHITECTURE = "x64";
|
|
7
|
+
const SAFE_DETAILS = {
|
|
8
|
+
unavailable: "terminal transport helper is unavailable on this host",
|
|
9
|
+
unsupported: "terminal transport is unsupported on this host",
|
|
10
|
+
probe_failed: "terminal transport capability probe failed",
|
|
11
|
+
};
|
|
6
12
|
/**
|
|
7
|
-
*
|
|
13
|
+
* Resolve and wrap a login command that needs a real terminal on stdin.
|
|
8
14
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* allocates the pty itself and relays plain pipes, and util-linux `script`
|
|
14
|
-
* accepts non-tty stdio where `expect` is usually not installed. Probing for
|
|
15
|
-
* the tool rather than branching on the platform therefore lands on the one
|
|
16
|
-
* that works on both, with a typed refusal when neither exists.
|
|
17
|
-
*
|
|
18
|
-
* The command is passed to Tcl brace-quoted; a word containing a brace or a
|
|
19
|
-
* backslash is REFUSED rather than escaped, because a mis-escaped word would
|
|
20
|
-
* become a different command than the manifest digest sealed.
|
|
15
|
+
* This is the single host-capability and spawn-spec owner used by setup
|
|
16
|
+
* admission, status projection, and the worker immediately before spawn. A
|
|
17
|
+
* Windows helper is never reported ready from file presence: its bounded
|
|
18
|
+
* `--probe` must create and close an HPCON and return the exact protocol marker.
|
|
21
19
|
*/
|
|
22
|
-
export function
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
29
|
-
const
|
|
20
|
+
export async function resolvePtyWrappedCommand(childBinary, childArgs, options = {}) {
|
|
21
|
+
const platform = options.platform ?? process.platform;
|
|
22
|
+
const inspect = options.inspectExecutable ?? inspectExecutable;
|
|
23
|
+
if (platform === "win32") {
|
|
24
|
+
const helper = await resolveWindowsHelper(options.helperPath, inspect);
|
|
25
|
+
if (helper.status !== "ready")
|
|
26
|
+
return helper;
|
|
27
|
+
const probe = await (options.probeConpty ?? probeConptyHelper)(helper.path);
|
|
28
|
+
if (probe === "unsupported") {
|
|
29
|
+
return {
|
|
30
|
+
status: "unsupported",
|
|
31
|
+
backend: "windows_conpty",
|
|
32
|
+
errorCode: "terminal_transport_unsupported",
|
|
33
|
+
detail: SAFE_DETAILS.unsupported,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (probe !== "ready") {
|
|
37
|
+
return {
|
|
38
|
+
status: "probe_failed",
|
|
39
|
+
backend: "windows_conpty",
|
|
40
|
+
errorCode: "terminal_transport_probe_failed",
|
|
41
|
+
detail: SAFE_DETAILS.probe_failed,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
30
44
|
return {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Everything after it exists because `interact` returns expect's OWN
|
|
36
|
-
// status, not the vendor's: without this an authentication that the
|
|
37
|
-
// vendor REJECTED would be recorded as a successful login, and its
|
|
38
|
-
// diagnostic tail would be dropped. `wait` yields the child's exit code,
|
|
39
|
-
// a signal death is reported as one, and a spawn that never started is
|
|
40
|
-
// 127 — the same shape a shell would give.
|
|
41
|
-
args: [
|
|
42
|
-
"-c",
|
|
43
|
-
`set timeout -1; if {[catch {spawn -noecho ${spawnCommand}}]} { exit 127 }; ` +
|
|
44
|
-
"set pid [exp_pid]; interact; catch {wait} r; " +
|
|
45
|
-
"if {[lsearch -exact $r CHILDKILLED] >= 0} { exit 129 }; " +
|
|
46
|
-
"catch {exec kill -TERM $pid}; exit [lindex $r 3]",
|
|
47
|
-
],
|
|
45
|
+
status: "ready",
|
|
46
|
+
backend: "windows_conpty",
|
|
47
|
+
command: { binary: helper.path, args: ["--", childBinary, ...childArgs] },
|
|
48
|
+
helperControlStderr: true,
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
const words = [childBinary, ...childArgs];
|
|
52
|
+
const expectPath = options.expectPath ?? "/usr/bin/expect";
|
|
53
|
+
const scriptPath = options.scriptPath ?? "/usr/bin/script";
|
|
54
|
+
const expect = await inspect(expectPath);
|
|
55
|
+
if (expect === "regular_executable") {
|
|
56
|
+
if (!words.some((word) => /[{}\\\n]/.test(word))) {
|
|
57
|
+
const spawnCommand = words.map((word) => `{${word}}`).join(" ");
|
|
58
|
+
return {
|
|
59
|
+
status: "ready",
|
|
60
|
+
backend: "expect",
|
|
61
|
+
command: {
|
|
62
|
+
binary: expectPath,
|
|
63
|
+
// `interact` relays our pipes for the whole login. `wait` is
|
|
64
|
+
// load-bearing: interact returns expect's status, not the vendor's.
|
|
65
|
+
args: [
|
|
66
|
+
"-c",
|
|
67
|
+
`set timeout -1; if {[catch {spawn -noecho ${spawnCommand}}]} { exit 127 }; ` +
|
|
68
|
+
"set pid [exp_pid]; interact; catch {wait} r; " +
|
|
69
|
+
"if {[lsearch -exact $r CHILDKILLED] >= 0} { exit 129 }; " +
|
|
70
|
+
"catch {exec kill -TERM $pid}; exit [lindex $r 3]",
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
helperControlStderr: false,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// Linux can still carry this exact argv through util-linux script. macOS
|
|
77
|
+
// script requires its own stdin to be a TTY and is not a daemon backend.
|
|
78
|
+
if (platform === "darwin") {
|
|
79
|
+
return {
|
|
80
|
+
status: "unsupported",
|
|
81
|
+
backend: "expect",
|
|
82
|
+
errorCode: "terminal_transport_unsupported",
|
|
83
|
+
detail: SAFE_DETAILS.unsupported,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (platform === "linux" && (await inspect(scriptPath)) === "regular_executable") {
|
|
51
88
|
const quoted = words.map((word) => `'${word.replaceAll("'", `'"'"'`)}'`).join(" ");
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
89
|
+
return {
|
|
90
|
+
status: "ready",
|
|
91
|
+
backend: "script",
|
|
92
|
+
command: { binary: scriptPath, args: ["-e", "-q", "-c", quoted, "/dev/null"] },
|
|
93
|
+
helperControlStderr: false,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
status: "unavailable",
|
|
98
|
+
backend: null,
|
|
99
|
+
errorCode: "terminal_transport_unavailable",
|
|
100
|
+
detail: SAFE_DETAILS.unavailable,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async function resolveWindowsHelper(explicitPath, inspect) {
|
|
104
|
+
const candidates = explicitPath
|
|
105
|
+
? [explicitPath]
|
|
106
|
+
: [
|
|
107
|
+
fileURLToPath(new URL("./native/claudexor-conpty-helper.exe", import.meta.url)),
|
|
108
|
+
fileURLToPath(new URL("../../core/dist/native/claudexor-conpty-helper.exe", import.meta.url)),
|
|
109
|
+
];
|
|
110
|
+
for (const candidate of candidates) {
|
|
111
|
+
const result = await inspect(candidate);
|
|
112
|
+
if (result === "missing")
|
|
113
|
+
continue;
|
|
114
|
+
if (result === "regular_executable")
|
|
115
|
+
return { status: "ready", path: candidate };
|
|
116
|
+
// A present non-regular adjacent entry is a fail-closed unavailable
|
|
117
|
+
// backend, never permission to search a less-authoritative fallback.
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
status: "unavailable",
|
|
122
|
+
backend: "windows_conpty",
|
|
123
|
+
errorCode: "terminal_transport_unavailable",
|
|
124
|
+
detail: SAFE_DETAILS.unavailable,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
async function inspectExecutable(path) {
|
|
128
|
+
try {
|
|
129
|
+
const info = await lstat(path);
|
|
130
|
+
if (!info.isFile() || info.isSymbolicLink())
|
|
131
|
+
return "invalid";
|
|
132
|
+
await access(path, constants.X_OK);
|
|
133
|
+
return "regular_executable";
|
|
55
134
|
}
|
|
56
|
-
|
|
135
|
+
catch (error) {
|
|
136
|
+
return error.code === "ENOENT" ? "missing" : "invalid";
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function probeConptyHelper(path) {
|
|
140
|
+
return await new Promise((resolveProbe) => {
|
|
141
|
+
const cap = 4_096;
|
|
142
|
+
const stdout = [];
|
|
143
|
+
const stderr = [];
|
|
144
|
+
let stdoutBytes = 0;
|
|
145
|
+
let stderrBytes = 0;
|
|
146
|
+
let settled = false;
|
|
147
|
+
let timer;
|
|
148
|
+
const settle = (result) => {
|
|
149
|
+
if (settled)
|
|
150
|
+
return;
|
|
151
|
+
settled = true;
|
|
152
|
+
if (timer)
|
|
153
|
+
clearTimeout(timer);
|
|
154
|
+
resolveProbe(result);
|
|
155
|
+
};
|
|
156
|
+
let child;
|
|
157
|
+
try {
|
|
158
|
+
child = spawn(path, ["--probe"], {
|
|
159
|
+
shell: false,
|
|
160
|
+
windowsHide: true,
|
|
161
|
+
detached: false,
|
|
162
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
settle("failed");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const overflow = () => {
|
|
170
|
+
try {
|
|
171
|
+
child.kill();
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
/* best effort */
|
|
175
|
+
}
|
|
176
|
+
settle("failed");
|
|
177
|
+
};
|
|
178
|
+
child.stdout?.on("data", (chunk) => {
|
|
179
|
+
stdoutBytes += chunk.length;
|
|
180
|
+
if (stdoutBytes > cap)
|
|
181
|
+
return overflow();
|
|
182
|
+
stdout.push(Buffer.from(chunk));
|
|
183
|
+
});
|
|
184
|
+
child.stderr?.on("data", (chunk) => {
|
|
185
|
+
stderrBytes += chunk.length;
|
|
186
|
+
if (stderrBytes > cap)
|
|
187
|
+
return overflow();
|
|
188
|
+
stderr.push(Buffer.from(chunk));
|
|
189
|
+
});
|
|
190
|
+
child.once("error", () => settle("failed"));
|
|
191
|
+
child.once("close", (code, signal) => {
|
|
192
|
+
if (settled)
|
|
193
|
+
return;
|
|
194
|
+
if (code === 3 && signal === null && isExactUnsupportedProbeFrame(stdoutBytes, stderr)) {
|
|
195
|
+
return settle("unsupported");
|
|
196
|
+
}
|
|
197
|
+
const marker = Buffer.concat(stdout);
|
|
198
|
+
settle(code === 0 &&
|
|
199
|
+
signal === null &&
|
|
200
|
+
stderrBytes === 0 &&
|
|
201
|
+
marker.equals(Buffer.from(`${CONPTY_HELPER_PROTOCOL}\t${CONPTY_HELPER_ARCHITECTURE}\n`, "ascii"))
|
|
202
|
+
? "ready"
|
|
203
|
+
: "failed");
|
|
204
|
+
});
|
|
205
|
+
timer = setTimeout(() => overflow(), 5_000);
|
|
206
|
+
timer.unref?.();
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/** Exit 3 is authoritative only when the owned helper reports the one API-load
|
|
210
|
+
* unsupported frame it can emit before creating an HPCON. No raw phase or
|
|
211
|
+
* Win32 error code crosses the resolver boundary. */
|
|
212
|
+
function isExactUnsupportedProbeFrame(stdoutBytes, stderr) {
|
|
213
|
+
if (stdoutBytes !== 0)
|
|
214
|
+
return false;
|
|
215
|
+
const frame = Buffer.concat(stderr);
|
|
216
|
+
const prefix = Buffer.from(`${CONPTY_HELPER_PROTOCOL}\terror\t1\t`, "ascii");
|
|
217
|
+
if (frame.length < prefix.length + 2 ||
|
|
218
|
+
!frame.subarray(0, prefix.length).equals(prefix) ||
|
|
219
|
+
frame[frame.length - 1] !== 0x0a) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
const codeBytes = frame.subarray(prefix.length, frame.length - 1);
|
|
223
|
+
if (codeBytes.length === 0 ||
|
|
224
|
+
(codeBytes.length > 1 && codeBytes[0] === 0x30) ||
|
|
225
|
+
codeBytes.some((byte) => byte < 0x30 || byte > 0x39)) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
const code = Number(codeBytes.toString("ascii"));
|
|
229
|
+
return Number.isSafeInteger(code) && code >= 0 && code <= 0xffff_ffff;
|
|
230
|
+
}
|
|
231
|
+
/** Bounded parser for helper-only stderr. It never returns raw bytes. */
|
|
232
|
+
export function createConptyControlParser(limit = 4_096) {
|
|
233
|
+
const chunks = [];
|
|
234
|
+
let bytes = 0;
|
|
235
|
+
let overflow = false;
|
|
236
|
+
return {
|
|
237
|
+
push(chunk) {
|
|
238
|
+
if (overflow)
|
|
239
|
+
return;
|
|
240
|
+
bytes += chunk.length;
|
|
241
|
+
if (bytes > limit) {
|
|
242
|
+
overflow = true;
|
|
243
|
+
chunks.length = 0;
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
chunks.push(Buffer.from(chunk));
|
|
247
|
+
},
|
|
248
|
+
finish() {
|
|
249
|
+
const state = {
|
|
250
|
+
started: false,
|
|
251
|
+
childPid: null,
|
|
252
|
+
error: null,
|
|
253
|
+
malformed: overflow,
|
|
254
|
+
};
|
|
255
|
+
if (overflow)
|
|
256
|
+
return state;
|
|
257
|
+
const text = Buffer.concat(chunks).toString("ascii");
|
|
258
|
+
for (const line of text.split(/\r?\n/).filter(Boolean)) {
|
|
259
|
+
const fields = line.split("\t");
|
|
260
|
+
if (fields[0] !== CONPTY_HELPER_PROTOCOL) {
|
|
261
|
+
state.malformed = true;
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (fields[1] === "started" && fields.length === 3) {
|
|
265
|
+
const pid = Number(fields[2]);
|
|
266
|
+
if (state.started || !Number.isSafeInteger(pid) || pid <= 0)
|
|
267
|
+
state.malformed = true;
|
|
268
|
+
else {
|
|
269
|
+
state.started = true;
|
|
270
|
+
state.childPid = pid;
|
|
271
|
+
}
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
if (fields[1] === "error" && fields.length === 4) {
|
|
275
|
+
const phase = Number(fields[2]);
|
|
276
|
+
const code = Number(fields[3]);
|
|
277
|
+
if (state.error !== null ||
|
|
278
|
+
!Number.isSafeInteger(phase) ||
|
|
279
|
+
phase < 1 ||
|
|
280
|
+
phase > 10 ||
|
|
281
|
+
!Number.isSafeInteger(code) ||
|
|
282
|
+
code < 0 ||
|
|
283
|
+
code > 0xffff_ffff) {
|
|
284
|
+
state.malformed = true;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
state.error = { phase, code };
|
|
288
|
+
}
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
state.malformed = true;
|
|
292
|
+
}
|
|
293
|
+
if (!state.started && state.error === null)
|
|
294
|
+
state.malformed = true;
|
|
295
|
+
return state;
|
|
296
|
+
},
|
|
297
|
+
};
|
|
57
298
|
}
|
|
58
299
|
//# sourceMappingURL=setup-login-pty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-login-pty.js","sourceRoot":"","sources":["../src/setup-login-pty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"setup-login-pty.js","sourceRoot":"","sources":["../src/setup-login-pty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAiDhD,MAAM,YAAY,GAAG;IACnB,WAAW,EAAE,uDAAuD;IACpE,WAAW,EAAE,gDAAgD;IAC7D,YAAY,EAAE,4CAA4C;CAClD,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,WAAmB,EACnB,SAA4B,EAC5B,OAAO,GAAqC,EAAE;IAE9C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,IAAI,iBAAiB,CAAC;IAE/D,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACvE,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO;YAAE,OAAO,MAAM,CAAC;QAC7C,MAAM,KAAK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E,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACnE,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
import { type SetupLoginManifest, type SetupLoginRunnerResult } from "./setup-login-protocol.js";
|
|
3
|
+
export declare function persistRunnerResult(manifest: SetupLoginManifest, result: Omit<SetupLoginRunnerResult, "version" | "jobId" | "executionId" | "commandDigest" | "manifestDigest">): void;
|
|
4
|
+
export declare function persistRunnerFailure(manifest: SetupLoginManifest, now: () => Date, permitIssuedAt: string | null, errorCode: NonNullable<SetupLoginRunnerResult["errorCode"]>, outputTail?: string): void;
|
|
5
|
+
export declare function persistRunnerCommandFailure(manifest: SetupLoginManifest, now: () => Date, permitIssuedAt: string | null, errorCode: NonNullable<SetupLoginRunnerResult["errorCode"]>, commandStarted: boolean, outputTail?: string): void;
|
|
6
|
+
export declare function waitForRunnerExit(child: ChildProcess): Promise<{
|
|
7
|
+
code: number | null;
|
|
8
|
+
signal: NodeJS.Signals | null;
|
|
9
|
+
}>;
|
|
10
|
+
/** The bootstrap itself never needs model/provider credentials. */
|
|
11
|
+
export declare function runnerBootstrapEnv(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
12
|
+
//# sourceMappingURL=setup-login-runner-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-login-runner-support.d.ts","sourceRoot":"","sources":["../src/setup-login-runner-support.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AAEnC,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,IAAI,CACV,sBAAsB,EACtB,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,eAAe,GAAG,gBAAgB,CACzE,GACA,IAAI,CASN;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,kBAAkB,EAC5B,GAAG,EAAE,MAAM,IAAI,EACf,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,SAAS,EAAE,WAAW,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,EAC3D,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,CAEN;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,kBAAkB,EAC5B,GAAG,EAAE,MAAM,IAAI,EACf,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,SAAS,EAAE,WAAW,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,EAC3D,cAAc,EAAE,OAAO,EACvB,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,CAUN;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;CAAE,CAAC,CAKjE;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CA8B7F"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { WINDOWS_RUNTIME_ENV_KEYS, pickAllowlistedEnv } from "@claudexor/core";
|
|
2
|
+
import { SETUP_LOGIN_PROTOCOL_VERSION, atomicPrivateJson, } from "./setup-login-protocol.js";
|
|
3
|
+
export function persistRunnerResult(manifest, result) {
|
|
4
|
+
atomicPrivateJson(manifest.resultPath, {
|
|
5
|
+
version: SETUP_LOGIN_PROTOCOL_VERSION,
|
|
6
|
+
jobId: manifest.jobId,
|
|
7
|
+
executionId: manifest.executionId,
|
|
8
|
+
commandDigest: manifest.commandDigest,
|
|
9
|
+
manifestDigest: manifest.manifestDigest,
|
|
10
|
+
...result,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export function persistRunnerFailure(manifest, now, permitIssuedAt, errorCode, outputTail) {
|
|
14
|
+
persistRunnerCommandFailure(manifest, now, permitIssuedAt, errorCode, false, outputTail);
|
|
15
|
+
}
|
|
16
|
+
export function persistRunnerCommandFailure(manifest, now, permitIssuedAt, errorCode, commandStarted, outputTail) {
|
|
17
|
+
persistRunnerResult(manifest, {
|
|
18
|
+
permitIssuedAt,
|
|
19
|
+
commandStarted,
|
|
20
|
+
errorCode,
|
|
21
|
+
exitCode: null,
|
|
22
|
+
signal: null,
|
|
23
|
+
finishedAt: now().toISOString(),
|
|
24
|
+
...(outputTail === undefined ? {} : { outputTail }),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function waitForRunnerExit(child) {
|
|
28
|
+
return new Promise((resolveExit, reject) => {
|
|
29
|
+
child.once("error", reject);
|
|
30
|
+
child.once("close", (code, signal) => resolveExit({ code, signal }));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** The bootstrap itself never needs model/provider credentials. */
|
|
34
|
+
export function runnerBootstrapEnv(source = process.env) {
|
|
35
|
+
return pickAllowlistedEnv(source, [
|
|
36
|
+
"PATH",
|
|
37
|
+
"HOME",
|
|
38
|
+
"TMPDIR",
|
|
39
|
+
"LANG",
|
|
40
|
+
"LC_ALL",
|
|
41
|
+
"LC_CTYPE",
|
|
42
|
+
"TERM",
|
|
43
|
+
"COLORTERM",
|
|
44
|
+
"NO_COLOR",
|
|
45
|
+
"SHELL",
|
|
46
|
+
"USER",
|
|
47
|
+
"LOGNAME",
|
|
48
|
+
"CLAUDEXOR_CONFIG_DIR",
|
|
49
|
+
"CLAUDEXOR_CODEX_NATIVE_HOME",
|
|
50
|
+
"CLAUDEXOR_CLAUDE_NATIVE_DIR",
|
|
51
|
+
"HTTP_PROXY",
|
|
52
|
+
"HTTPS_PROXY",
|
|
53
|
+
"NO_PROXY",
|
|
54
|
+
"ALL_PROXY",
|
|
55
|
+
"http_proxy",
|
|
56
|
+
"https_proxy",
|
|
57
|
+
"no_proxy",
|
|
58
|
+
"all_proxy",
|
|
59
|
+
"SSL_CERT_FILE",
|
|
60
|
+
"SSL_CERT_DIR",
|
|
61
|
+
"NODE_EXTRA_CA_CERTS",
|
|
62
|
+
...WINDOWS_RUNTIME_ENV_KEYS,
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=setup-login-runner-support.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-login-runner-support.js","sourceRoot":"","sources":["../src/setup-login-runner-support.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,GAGlB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,mBAAmB,CACjC,QAA4B,EAC5B,MAGC;IAED,iBAAiB,CAAC,QAAQ,CAAC,UAAU,EAAE;QACrC,OAAO,EAAE,4BAA4B;QACrC,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,GAAG,MAAM;KACuB,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,QAA4B,EAC5B,GAAe,EACf,cAA6B,EAC7B,SAA2D,EAC3D,UAAmB;IAEnB,2BAA2B,CAAC,QAAQ,EAAE,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,QAA4B,EAC5B,GAAe,EACf,cAA6B,EAC7B,SAA2D,EAC3D,cAAuB,EACvB,UAAmB;IAEnB,mBAAmB,CAAC,QAAQ,EAAE;QAC5B,cAAc;QACd,cAAc;QACd,SAAS;QACT,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;QAC/B,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC;KACpD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAmB;IAEnB,OAAO,IAAI,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE;QACzC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAAC,MAAM,GAAsB,OAAO,CAAC,GAAG;IACxE,OAAO,kBAAkB,CAAC,MAAM,EAAE;QAChC,MAAM;QACN,MAAM;QACN,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,UAAU;QACV,MAAM;QACN,WAAW;QACX,UAAU;QACV,OAAO;QACP,MAAM;QACN,SAAS;QACT,sBAAsB;QACtB,6BAA6B;QAC7B,6BAA6B;QAC7B,YAAY;QACZ,aAAa;QACb,UAAU;QACV,WAAW;QACX,YAAY;QACZ,aAAa;QACb,UAAU;QACV,WAAW;QACX,eAAe;QACf,cAAc;QACd,qBAAqB;QACrB,GAAG,wBAAwB;KAC5B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
3
|
import { processGroupServiceWithWindowsSupport } from "@claudexor/core";
|
|
4
4
|
export { terminateAppServerChild } from "./setup-login-child-lifecycle.js";
|
|
5
|
+
import { resolvePtyWrappedCommand } from "./setup-login-pty.js";
|
|
5
6
|
export { createOAuthUrlDetector, extractOAuthUrl } from "./setup-login-url.js";
|
|
6
7
|
export interface SetupLoginRunnerOptions {
|
|
7
8
|
now?: () => Date;
|
|
@@ -10,6 +11,7 @@ export interface SetupLoginRunnerOptions {
|
|
|
10
11
|
processGroupService?: ReturnType<typeof processGroupServiceWithWindowsSupport>;
|
|
11
12
|
selfPid?: number;
|
|
12
13
|
runnerPath?: string;
|
|
14
|
+
resolvePtyCommand?: typeof resolvePtyWrappedCommand;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Terminal-visible bootstrap. It creates a detached worker process group and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-login-runner.d.ts","sourceRoot":"","sources":["../src/setup-login-runner.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAwC,MAAM,oBAAoB,CAAC;AAKjF,OAAO,
|
|
1
|
+
{"version":3,"file":"setup-login-runner.d.ts","sourceRoot":"","sources":["../src/setup-login-runner.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAwC,MAAM,oBAAoB,CAAC;AAKjF,OAAO,EAAE,qCAAqC,EAAE,MAAM,iBAAiB,CAAC;AAOxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAEL,wBAAwB,EAEzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAoB/E,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,OAAO,KAAK,CAAC;IAC5B,mBAAmB,CAAC,EAAE,UAAU,CAAC,OAAO,qCAAqC,CAAC,CAAC;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,wBAAwB,CAAC;CACrD;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,gFAAgF;AAChF,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,CAAC,CAkPjB"}
|