@oxagen/cli 3.0.1-803 → 3.0.1-817
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/oxagen.mjs +1073 -508
- package/package.json +1 -1
package/oxagen.mjs
CHANGED
|
@@ -11275,8 +11275,8 @@ var init_mcp_config_writer = __esm({
|
|
|
11275
11275
|
|
|
11276
11276
|
// ../../packages/tacho/src/host/claude-desktop-writer.ts
|
|
11277
11277
|
import { join as join3 } from "node:path";
|
|
11278
|
-
function claudeDesktopConfigPath(
|
|
11279
|
-
if (
|
|
11278
|
+
function claudeDesktopConfigPath(platform2, home, env = {}) {
|
|
11279
|
+
if (platform2 === "darwin") {
|
|
11280
11280
|
return join3(
|
|
11281
11281
|
home,
|
|
11282
11282
|
"Library",
|
|
@@ -11285,7 +11285,7 @@ function claudeDesktopConfigPath(platform, home, env = {}) {
|
|
|
11285
11285
|
"claude_desktop_config.json"
|
|
11286
11286
|
);
|
|
11287
11287
|
}
|
|
11288
|
-
if (
|
|
11288
|
+
if (platform2 === "win32") {
|
|
11289
11289
|
const appData = env["APPDATA"] ?? join3(home, "AppData", "Roaming");
|
|
11290
11290
|
return join3(appData, "Claude", "claude_desktop_config.json");
|
|
11291
11291
|
}
|
|
@@ -11554,16 +11554,16 @@ var init_cursor_adapter = __esm({
|
|
|
11554
11554
|
|
|
11555
11555
|
// ../../packages/tacho/src/host/cursor-writer.ts
|
|
11556
11556
|
import { join as join4 } from "node:path";
|
|
11557
|
-
function cursorConfigDir(home,
|
|
11557
|
+
function cursorConfigDir(home, platform2, env = {}) {
|
|
11558
11558
|
const explicit = env["CURSOR_CONFIG_DIR"];
|
|
11559
11559
|
if (explicit !== void 0 && explicit.length > 0) return explicit;
|
|
11560
11560
|
const xdg = env["XDG_CONFIG_HOME"];
|
|
11561
|
-
if (
|
|
11561
|
+
if (platform2 !== "darwin" && platform2 !== "win32" && xdg !== void 0 && xdg.length > 0)
|
|
11562
11562
|
return join4(xdg, "cursor");
|
|
11563
11563
|
return join4(home, ".cursor");
|
|
11564
11564
|
}
|
|
11565
|
-
function cursorHooksPaths(home,
|
|
11566
|
-
const resolved = join4(cursorConfigDir(home,
|
|
11565
|
+
function cursorHooksPaths(home, platform2, env = {}) {
|
|
11566
|
+
const resolved = join4(cursorConfigDir(home, platform2, env), "hooks.json");
|
|
11567
11567
|
const fallback = join4(home, ".cursor", "hooks.json");
|
|
11568
11568
|
return resolved === fallback ? [resolved] : [resolved, fallback];
|
|
11569
11569
|
}
|
|
@@ -11700,7 +11700,7 @@ function harnessConfigDirs(home, env = process.env, ownHome = homedir()) {
|
|
|
11700
11700
|
codexHome: codexHomeFor(own, home)
|
|
11701
11701
|
};
|
|
11702
11702
|
}
|
|
11703
|
-
function tachoHome(env = process.env, home = homedir(),
|
|
11703
|
+
function tachoHome(env = process.env, home = homedir(), platform2 = process.platform) {
|
|
11704
11704
|
const tachoDir = env["TACHO_HOME"] ?? join5(home, ".config", "oxagen", "tacho");
|
|
11705
11705
|
const claudeConfigDir = claudeConfigDirFor(env, home);
|
|
11706
11706
|
const codexHome = codexHomeFor(env, home);
|
|
@@ -11715,10 +11715,10 @@ function tachoHome(env = process.env, home = homedir(), platform = process.platf
|
|
|
11715
11715
|
claudeUserConfig: claudeUserConfigFor(env, home),
|
|
11716
11716
|
claudeProjects: join5(claudeConfigDir, "projects"),
|
|
11717
11717
|
codexHooks: join5(codexHome, "hooks.json"),
|
|
11718
|
-
cursorHooks: cursorHooksPaths(home,
|
|
11718
|
+
cursorHooks: cursorHooksPaths(home, platform2, env),
|
|
11719
11719
|
stellaToml: join5(stellaHome, "stella.toml"),
|
|
11720
11720
|
stellaSettingsJson: join5(stellaHome, "settings.json"),
|
|
11721
|
-
claudeDesktopConfig: claudeDesktopConfigPath(
|
|
11721
|
+
claudeDesktopConfig: claudeDesktopConfigPath(platform2, home, env)
|
|
11722
11722
|
};
|
|
11723
11723
|
}
|
|
11724
11724
|
function homeOf(paths) {
|
|
@@ -13061,19 +13061,19 @@ function psStartCommand(pids) {
|
|
|
13061
13061
|
[...PS_ZONE, "ps", "-o", "pid=,lstart=", "-p", pids.join(",")]
|
|
13062
13062
|
];
|
|
13063
13063
|
}
|
|
13064
|
-
function readProcessStarts(pids, exec4 = psExec,
|
|
13065
|
-
if (
|
|
13066
|
-
if (
|
|
13064
|
+
function readProcessStarts(pids, exec4 = psExec, platform2 = process.platform, read2 = readText) {
|
|
13065
|
+
if (platform2 === "win32" || pids.length === 0) return void 0;
|
|
13066
|
+
if (platform2 === "linux") return readProcStarts(pids, read2);
|
|
13067
13067
|
return parsePsStarts(pids, exec4(...psStartCommand(pids)));
|
|
13068
13068
|
}
|
|
13069
|
-
async function readProcessStartsAsync(pids, exec4 = psExecAsync,
|
|
13070
|
-
if (
|
|
13071
|
-
if (
|
|
13069
|
+
async function readProcessStartsAsync(pids, exec4 = psExecAsync, platform2 = process.platform, read2 = readText) {
|
|
13070
|
+
if (platform2 === "win32" || pids.length === 0) return void 0;
|
|
13071
|
+
if (platform2 === "linux") return readProcStarts(pids, read2);
|
|
13072
13072
|
return parsePsStarts(pids, await exec4(...psStartCommand(pids)));
|
|
13073
13073
|
}
|
|
13074
|
-
function readProcessStartsNoWait(pids, exec4 = psExecAsync,
|
|
13075
|
-
if (
|
|
13076
|
-
if (
|
|
13074
|
+
function readProcessStartsNoWait(pids, exec4 = psExecAsync, platform2 = process.platform, read2 = readText) {
|
|
13075
|
+
if (platform2 === "win32" || pids.length === 0) return void 0;
|
|
13076
|
+
if (platform2 === "linux") return readProcStarts(pids, read2);
|
|
13077
13077
|
return exec4(...psStartCommand(pids)).then(
|
|
13078
13078
|
(result2) => parsePsStarts(pids, result2),
|
|
13079
13079
|
() => void 0
|
|
@@ -13352,8 +13352,8 @@ function psLookup(pid, timeoutMs = 2e3) {
|
|
|
13352
13352
|
return void 0;
|
|
13353
13353
|
return parsePsLine(result2.stdout);
|
|
13354
13354
|
}
|
|
13355
|
-
function stellaHarnessPid(parentPid,
|
|
13356
|
-
if (
|
|
13355
|
+
function stellaHarnessPid(parentPid, platform2, lookup = psLookup) {
|
|
13356
|
+
if (platform2 === "win32") return parentPid;
|
|
13357
13357
|
const parent = lookup(parentPid);
|
|
13358
13358
|
if (parent === void 0) return parentPid;
|
|
13359
13359
|
return isShellWithParent(parent) ? parent.ppid : parentPid;
|
|
@@ -13368,8 +13368,8 @@ function stellaExportedPid(value) {
|
|
|
13368
13368
|
const pid = Number(text6);
|
|
13369
13369
|
return Number.isSafeInteger(pid) && pid > 1 ? pid : void 0;
|
|
13370
13370
|
}
|
|
13371
|
-
function procLookupFor(
|
|
13372
|
-
if (
|
|
13371
|
+
function procLookupFor(platform2) {
|
|
13372
|
+
if (platform2 !== "linux") return () => void 0;
|
|
13373
13373
|
return (pid) => readProcParent(pid);
|
|
13374
13374
|
}
|
|
13375
13375
|
function cachePath(cacheDir, pid) {
|
|
@@ -13425,16 +13425,16 @@ function confirmsCached(cached4, current, legacy) {
|
|
|
13425
13425
|
return cached4.instance === current || cached4.instance === legacy();
|
|
13426
13426
|
}
|
|
13427
13427
|
function resolveStellaIdentity(options) {
|
|
13428
|
-
const { parentPid, platform, cacheDir, now } = options;
|
|
13428
|
+
const { parentPid, platform: platform2, cacheDir, now } = options;
|
|
13429
13429
|
const isAlive = options.isAlive ?? processAlive;
|
|
13430
13430
|
const exported = options.exportedPid !== void 0 && isAlive(options.exportedPid) ? options.exportedPid : void 0;
|
|
13431
|
-
if (
|
|
13431
|
+
if (platform2 === "win32") return { pid: exported ?? parentPid };
|
|
13432
13432
|
const clock2 = options.clock ?? Date.now;
|
|
13433
13433
|
const deadline = clock2() + STELLA_PS_BUDGET_MS;
|
|
13434
13434
|
const left = () => Math.max(STELLA_PS_FLOOR_MS, deadline - clock2());
|
|
13435
|
-
const procLookup = options.procLookup ?? procLookupFor(
|
|
13435
|
+
const procLookup = options.procLookup ?? procLookupFor(platform2);
|
|
13436
13436
|
const lookup = (pid) => procLookup(pid) ?? (options.lookup ?? psLookup)(pid, left());
|
|
13437
|
-
const startInstance = (pid) => options.startInstance !== void 0 ? options.startInstance(pid, left()) : processStartInstance(pid, left(),
|
|
13437
|
+
const startInstance = (pid) => options.startInstance !== void 0 ? options.startInstance(pid, left()) : processStartInstance(pid, left(), platform2);
|
|
13438
13438
|
const legacyStartInstance = (pid) => (options.legacyStartInstance ?? lstartInstance)(pid, left());
|
|
13439
13439
|
const starting = options.event === "SessionStart";
|
|
13440
13440
|
const key = exported ?? parentPid;
|
|
@@ -13494,8 +13494,8 @@ function startInstanceToken(started) {
|
|
|
13494
13494
|
if (text6.length === 0) return void 0;
|
|
13495
13495
|
return digestJcs(text6).slice("sha256:".length, "sha256:".length + 12);
|
|
13496
13496
|
}
|
|
13497
|
-
function processStartInstance(pid, timeoutMs = 2e3,
|
|
13498
|
-
const started = readProcessStarts([pid], exec4,
|
|
13497
|
+
function processStartInstance(pid, timeoutMs = 2e3, platform2 = process.platform, exec4 = psExecWithin(timeoutMs), read2) {
|
|
13498
|
+
const started = readProcessStarts([pid], exec4, platform2, read2)?.get(pid);
|
|
13499
13499
|
return started === void 0 ? void 0 : startInstanceToken(started);
|
|
13500
13500
|
}
|
|
13501
13501
|
function lstartInstance(pid, timeoutMs = 2e3) {
|
|
@@ -13673,8 +13673,8 @@ function psArgs(pid, timeoutMs = 2e3) {
|
|
|
13673
13673
|
const line = result2.stdout.trim();
|
|
13674
13674
|
return line.length > 0 ? line : void 0;
|
|
13675
13675
|
}
|
|
13676
|
-
function codexHarnessPid(parentPid,
|
|
13677
|
-
if (
|
|
13676
|
+
function codexHarnessPid(parentPid, platform2, lookup = psLookup, argsOf = psArgs, now = Date.now) {
|
|
13677
|
+
if (platform2 === "win32") return void 0;
|
|
13678
13678
|
const deadline = now() + WALK_BUDGET_MS;
|
|
13679
13679
|
const left = () => {
|
|
13680
13680
|
const ms = deadline - now();
|
|
@@ -15652,7 +15652,7 @@ async function runTachoHook(deps) {
|
|
|
15652
15652
|
const now = deps.now ?? (() => Date.now());
|
|
15653
15653
|
const hookId = deps.hookId ?? ulid(now());
|
|
15654
15654
|
const receivedAt = toProtocolTimestamp(now());
|
|
15655
|
-
const
|
|
15655
|
+
const platform2 = deps.platform ?? process.platform;
|
|
15656
15656
|
const agent = deps.agent;
|
|
15657
15657
|
const agentProblem = agent !== void 0 ? customAgentNameProblem(agent) : void 0;
|
|
15658
15658
|
if (agentProblem !== void 0) {
|
|
@@ -15705,8 +15705,8 @@ async function runTachoHook(deps) {
|
|
|
15705
15705
|
if (stella) {
|
|
15706
15706
|
let identity;
|
|
15707
15707
|
if (deps.harnessPid !== void 0 || deps.harnessInstance !== void 0) {
|
|
15708
|
-
const pid = deps.harnessPid?.() ?? stellaHarnessPid(process.ppid,
|
|
15709
|
-
const instance = (deps.harnessInstance ?? ((pid2) => processStartInstance(pid2, void 0,
|
|
15708
|
+
const pid = deps.harnessPid?.() ?? stellaHarnessPid(process.ppid, platform2);
|
|
15709
|
+
const instance = (deps.harnessInstance ?? ((pid2) => processStartInstance(pid2, void 0, platform2)))(pid);
|
|
15710
15710
|
identity = { pid, ...instance !== void 0 ? { instance } : {} };
|
|
15711
15711
|
} else if (host === void 0 && hostReadError === void 0) {
|
|
15712
15712
|
identity = { pid: process.ppid };
|
|
@@ -15715,7 +15715,7 @@ async function runTachoHook(deps) {
|
|
|
15715
15715
|
const exportedPid = stellaExportedPid(deps.env[STELLA_PID_ENV]);
|
|
15716
15716
|
identity = resolveStellaIdentity({
|
|
15717
15717
|
parentPid: process.ppid,
|
|
15718
|
-
platform,
|
|
15718
|
+
platform: platform2,
|
|
15719
15719
|
cacheDir: deps.paths.stellaIdentity,
|
|
15720
15720
|
now: now(),
|
|
15721
15721
|
...exportedPid !== void 0 ? { exportedPid } : {},
|
|
@@ -15772,7 +15772,7 @@ async function runTachoHook(deps) {
|
|
|
15772
15772
|
}
|
|
15773
15773
|
const input = parsed2.data;
|
|
15774
15774
|
if (codex && CODEX_PID_EVENTS.has(input.hook_event_name) && (host !== void 0 || hostReadError !== void 0))
|
|
15775
|
-
harnessPid = (deps.harnessPid ?? (() => codexHarnessPid(process.ppid,
|
|
15775
|
+
harnessPid = (deps.harnessPid ?? (() => codexHarnessPid(process.ppid, platform2)))();
|
|
15776
15776
|
if (codex && (host !== void 0 || hostReadError !== void 0))
|
|
15777
15777
|
raw = withCodexPromptSource(raw);
|
|
15778
15778
|
const answer = (response) => stella ? stellaAnswer(response, input.hook_event_name) : cursor ? cursorAnswer(response, input.hook_event_name) : `${JSON.stringify(codex ? codexAnswer(response, input.hook_event_name) : response)}
|
|
@@ -15796,8 +15796,8 @@ async function runTachoHook(deps) {
|
|
|
15796
15796
|
...harnessPid !== void 0 ? { TACHO_HARNESS_PID: String(harnessPid) } : {},
|
|
15797
15797
|
...workOrder !== void 0 ? { [WORK_ORDER_ENV]: workOrder } : {}
|
|
15798
15798
|
};
|
|
15799
|
-
const
|
|
15800
|
-
const useTcp =
|
|
15799
|
+
const post3 = deps.post ?? postUnix;
|
|
15800
|
+
const useTcp = platform2 === "win32";
|
|
15801
15801
|
const label = agent !== void 0 ? { agent } : { harness };
|
|
15802
15802
|
const enrollment = deps.enrollment ?? enrollmentFromArgv(process.argv);
|
|
15803
15803
|
const staleEntry = (current) => enrollment !== void 0 && enrollment !== current ? {
|
|
@@ -15818,7 +15818,7 @@ async function runTachoHook(deps) {
|
|
|
15818
15818
|
const port = routing.port;
|
|
15819
15819
|
if (!useTcp || port !== void 0) {
|
|
15820
15820
|
try {
|
|
15821
|
-
const result2 = await
|
|
15821
|
+
const result2 = await post3({
|
|
15822
15822
|
...useTcp ? { loopbackPort: port } : { socketPath: deps.paths.socket },
|
|
15823
15823
|
path: `/hook/${routing.host_enrollment_id}`,
|
|
15824
15824
|
headers: {
|
|
@@ -15871,7 +15871,7 @@ async function runTachoHook(deps) {
|
|
|
15871
15871
|
const stale = staleEntry(host.host_enrollment_id);
|
|
15872
15872
|
if (stale !== void 0) return stale;
|
|
15873
15873
|
try {
|
|
15874
|
-
const result2 = await
|
|
15874
|
+
const result2 = await post3({
|
|
15875
15875
|
...useTcp ? { loopbackPort: host.port } : { socketPath: deps.paths.socket },
|
|
15876
15876
|
path: `/hook/${host.host_enrollment_id}`,
|
|
15877
15877
|
headers: {
|
|
@@ -16051,7 +16051,7 @@ function readAnswer(body2) {
|
|
|
16051
16051
|
async function runSteerWait(deps) {
|
|
16052
16052
|
const now = deps.now ?? (() => Date.now());
|
|
16053
16053
|
const sleep2 = deps.sleep ?? ((ms) => new Promise((resolve29) => setTimeout(resolve29, ms)));
|
|
16054
|
-
const
|
|
16054
|
+
const post3 = deps.post ?? postUnix;
|
|
16055
16055
|
const sessionId = sessionOf(deps.stdin);
|
|
16056
16056
|
if (sessionId === void 0) return DONE;
|
|
16057
16057
|
const useTcp = deps.platform === "win32";
|
|
@@ -16079,7 +16079,7 @@ async function runSteerWait(deps) {
|
|
|
16079
16079
|
const askedAt = now();
|
|
16080
16080
|
let result2;
|
|
16081
16081
|
try {
|
|
16082
|
-
result2 = await
|
|
16082
|
+
result2 = await post3({
|
|
16083
16083
|
...useTcp ? { loopbackPort: routing.port } : { socketPath: deps.paths.socket },
|
|
16084
16084
|
path: `/steer-wait/${routing.host_enrollment_id}`,
|
|
16085
16085
|
headers: { Authorization: `Bearer ${routing.local_token}` },
|
|
@@ -16769,8 +16769,8 @@ var init_backfill = __esm({
|
|
|
16769
16769
|
this.parentMs = ms;
|
|
16770
16770
|
this.clock.ms = ms;
|
|
16771
16771
|
}
|
|
16772
|
-
const
|
|
16773
|
-
return { events: this.mappedLine(parsed2, text6, offset,
|
|
16772
|
+
const spawn10 = [];
|
|
16773
|
+
return { events: this.mappedLine(parsed2, text6, offset, spawn10), spawn: spawn10 };
|
|
16774
16774
|
}
|
|
16775
16775
|
/**
|
|
16776
16776
|
* Begin a session still waiting for its facts once its last line is read:
|
|
@@ -16796,28 +16796,28 @@ var init_backfill = __esm({
|
|
|
16796
16796
|
this.parentMs = timestampOf(first) ?? 0;
|
|
16797
16797
|
this.clock.ms = this.parentMs;
|
|
16798
16798
|
const events = this.collect(this.start(first, facts, permissionMode));
|
|
16799
|
-
const
|
|
16799
|
+
const spawn10 = [];
|
|
16800
16800
|
for (const item of early) {
|
|
16801
16801
|
const ms = timestampOf(item.record);
|
|
16802
16802
|
if (ms !== void 0) this.parentMs = Math.max(this.parentMs, ms);
|
|
16803
16803
|
this.clock.ms = ms ?? this.parentMs;
|
|
16804
16804
|
events.push(
|
|
16805
|
-
...this.mappedLine(item.record, item.text, item.offset,
|
|
16805
|
+
...this.mappedLine(item.record, item.text, item.offset, spawn10)
|
|
16806
16806
|
);
|
|
16807
16807
|
}
|
|
16808
16808
|
this.clock.ms = this.parentMs;
|
|
16809
|
-
return { events, spawn:
|
|
16809
|
+
return { events, spawn: spawn10 };
|
|
16810
16810
|
}
|
|
16811
16811
|
/** One parent line through the mapping, guarded. */
|
|
16812
|
-
mappedLine(record2, text6, offset,
|
|
16812
|
+
mappedLine(record2, text6, offset, spawn10) {
|
|
16813
16813
|
const spawnedBefore = this.spawned.size;
|
|
16814
|
-
const spawnLength =
|
|
16814
|
+
const spawnLength = spawn10.length;
|
|
16815
16815
|
return this.guarded(
|
|
16816
16816
|
offset,
|
|
16817
16817
|
void 0,
|
|
16818
|
-
() => this.mapped(record2, text6,
|
|
16818
|
+
() => this.mapped(record2, text6, spawn10),
|
|
16819
16819
|
() => {
|
|
16820
|
-
|
|
16820
|
+
spawn10.length = spawnLength;
|
|
16821
16821
|
for (const toolUseId of [...this.spawned.keys()].slice(spawnedBefore))
|
|
16822
16822
|
this.spawned.delete(toolUseId);
|
|
16823
16823
|
}
|
|
@@ -17034,7 +17034,7 @@ var init_backfill = __esm({
|
|
|
17034
17034
|
})
|
|
17035
17035
|
);
|
|
17036
17036
|
}
|
|
17037
|
-
mapped(record2, text6,
|
|
17037
|
+
mapped(record2, text6, spawn10) {
|
|
17038
17038
|
const type = nonEmptyString(record2["type"]);
|
|
17039
17039
|
const ms = timestampOf(record2);
|
|
17040
17040
|
const events = [];
|
|
@@ -17167,7 +17167,7 @@ var init_backfill = __esm({
|
|
|
17167
17167
|
ms
|
|
17168
17168
|
)
|
|
17169
17169
|
);
|
|
17170
|
-
|
|
17170
|
+
spawn10.push(subagent.agentId);
|
|
17171
17171
|
}
|
|
17172
17172
|
return events;
|
|
17173
17173
|
}
|
|
@@ -21051,14 +21051,14 @@ var init_recorder = __esm({
|
|
|
21051
21051
|
const parent = this.options.parent;
|
|
21052
21052
|
if (parent === void 0) return;
|
|
21053
21053
|
const type = parent.subagentType === void 0 ? subagentType : void 0;
|
|
21054
|
-
const
|
|
21055
|
-
if (type === void 0 &&
|
|
21054
|
+
const spawn10 = parent.spawnToolUseId === void 0 ? spawnToolUseId : void 0;
|
|
21055
|
+
if (type === void 0 && spawn10 === void 0) return;
|
|
21056
21056
|
this.options = {
|
|
21057
21057
|
...this.options,
|
|
21058
21058
|
parent: {
|
|
21059
21059
|
...parent,
|
|
21060
21060
|
...type !== void 0 ? { subagentType: type } : {},
|
|
21061
|
-
...
|
|
21061
|
+
...spawn10 !== void 0 ? { spawnToolUseId: spawn10 } : {}
|
|
21062
21062
|
}
|
|
21063
21063
|
};
|
|
21064
21064
|
}
|
|
@@ -24774,12 +24774,12 @@ async function sealTranscript(candidate, deps, pass2) {
|
|
|
24774
24774
|
const read2 = await readSlices(candidate.path, sliceBytes, async (lines) => {
|
|
24775
24775
|
let index = 0;
|
|
24776
24776
|
while (index < lines.length) {
|
|
24777
|
-
const
|
|
24777
|
+
const spawn10 = [];
|
|
24778
24778
|
await deps.exclusive(candidate.sessionId, () => {
|
|
24779
24779
|
if (deps.heldLocally(candidate.sessionId)) throw new TakenLive();
|
|
24780
24780
|
const out = [];
|
|
24781
24781
|
let next = readTo;
|
|
24782
|
-
while (
|
|
24782
|
+
while (spawn10.length === 0) {
|
|
24783
24783
|
const line = lines[index];
|
|
24784
24784
|
if (line === void 0) break;
|
|
24785
24785
|
index += 1;
|
|
@@ -24790,7 +24790,7 @@ async function sealTranscript(candidate, deps, pass2) {
|
|
|
24790
24790
|
}
|
|
24791
24791
|
const sealed = driver.line(line.text, line.offset);
|
|
24792
24792
|
out.push(...sealed.events);
|
|
24793
|
-
|
|
24793
|
+
spawn10.push(...sealed.spawn);
|
|
24794
24794
|
}
|
|
24795
24795
|
emit(out);
|
|
24796
24796
|
if (driver.hasChain) {
|
|
@@ -24798,7 +24798,7 @@ async function sealTranscript(candidate, deps, pass2) {
|
|
|
24798
24798
|
partial2(readTo, { status: "partial" });
|
|
24799
24799
|
}
|
|
24800
24800
|
});
|
|
24801
|
-
for (const agentId of
|
|
24801
|
+
for (const agentId of spawn10) await feedSubagent(agentId);
|
|
24802
24802
|
}
|
|
24803
24803
|
await between();
|
|
24804
24804
|
});
|
|
@@ -26724,20 +26724,20 @@ function findHarnessBinary(name2, env, home) {
|
|
|
26724
26724
|
}
|
|
26725
26725
|
return void 0;
|
|
26726
26726
|
}
|
|
26727
|
-
function setupTokenCommand(claude,
|
|
26727
|
+
function setupTokenCommand(claude, platform2) {
|
|
26728
26728
|
const quoted3 = `'${claude.replace(/'/g, `'\\''`)}'`;
|
|
26729
26729
|
const inner = `stty cols 1000 2>/dev/null; exec ${quoted3} setup-token`;
|
|
26730
|
-
if (
|
|
26730
|
+
if (platform2 === "darwin")
|
|
26731
26731
|
return { file: "script", args: ["-q", "/dev/null", "sh", "-c", inner] };
|
|
26732
|
-
if (
|
|
26732
|
+
if (platform2 === "linux")
|
|
26733
26733
|
return { file: "script", args: ["-q", "-e", "-c", inner, "/dev/null"] };
|
|
26734
26734
|
return void 0;
|
|
26735
26735
|
}
|
|
26736
26736
|
function shellQuote(value) {
|
|
26737
26737
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
26738
26738
|
}
|
|
26739
|
-
function setupTokenShellLine(claude,
|
|
26740
|
-
const command2 = setupTokenCommand(claude,
|
|
26739
|
+
function setupTokenShellLine(claude, platform2) {
|
|
26740
|
+
const command2 = setupTokenCommand(claude, platform2);
|
|
26741
26741
|
if (command2 === void 0) return void 0;
|
|
26742
26742
|
const script = [command2.file, ...command2.args].map(shellQuote).join(" ");
|
|
26743
26743
|
return `sleep 2147483647 | { ${script}; echo "${SETUP_TOKEN_EXIT_MARK}$?"; }`;
|
|
@@ -27117,17 +27117,17 @@ function stellaValue(file, text6) {
|
|
|
27117
27117
|
const found = findStellaBaseUrl(splitLines(text6));
|
|
27118
27118
|
return found.kind === "table" ? found.value : null;
|
|
27119
27119
|
}
|
|
27120
|
-
function claudeManagedSettingsPath(
|
|
27121
|
-
if (
|
|
27120
|
+
function claudeManagedSettingsPath(platform2 = process.platform) {
|
|
27121
|
+
if (platform2 === "darwin")
|
|
27122
27122
|
return "/Library/Application Support/ClaudeCode/managed-settings.json";
|
|
27123
|
-
if (
|
|
27123
|
+
if (platform2 === "win32")
|
|
27124
27124
|
return "C:\\Program Files\\ClaudeCode\\managed-settings.json";
|
|
27125
27125
|
return "/etc/claude-code/managed-settings.json";
|
|
27126
27126
|
}
|
|
27127
|
-
function stellaManagedSettingsPath(
|
|
27127
|
+
function stellaManagedSettingsPath(platform2 = process.platform, env = process.env) {
|
|
27128
27128
|
const named = env["STELLA_MANAGED_SETTINGS"];
|
|
27129
27129
|
if (named !== void 0 && named.length > 0) return named;
|
|
27130
|
-
const dir =
|
|
27130
|
+
const dir = platform2 === "darwin" ? "/Library/Application Support/stella" : "/etc/stella";
|
|
27131
27131
|
const toml = join15(dir, "stella.toml");
|
|
27132
27132
|
const json2 = join15(dir, "settings.json");
|
|
27133
27133
|
return !existsSync6(toml) && existsSync6(json2) ? json2 : toml;
|
|
@@ -29161,8 +29161,8 @@ function cmdArgument(value) {
|
|
|
29161
29161
|
quoted3 = `"${quoted3}${"\\".repeat(slashes * 2)}"`;
|
|
29162
29162
|
return quoted3.replace(CMD_META, "^$1").replace(CMD_META, "^$1");
|
|
29163
29163
|
}
|
|
29164
|
-
function spawnInvocation(command2, args,
|
|
29165
|
-
if (
|
|
29164
|
+
function spawnInvocation(command2, args, platform2 = process.platform, env = process.env) {
|
|
29165
|
+
if (platform2 !== "win32" || !/\.(cmd|bat)$/i.test(command2))
|
|
29166
29166
|
return { command: command2, args: [...args] };
|
|
29167
29167
|
const line = [command2.replace(CMD_META, "^$1"), ...args.map(cmdArgument)];
|
|
29168
29168
|
return {
|
|
@@ -29915,7 +29915,7 @@ import { readFileSync as readFileSync10 } from "node:fs";
|
|
|
29915
29915
|
import { dirname as dirname9, resolve as resolve3 } from "node:path";
|
|
29916
29916
|
import { fileURLToPath } from "node:url";
|
|
29917
29917
|
function readVersion() {
|
|
29918
|
-
if (true) return "3.0.1-
|
|
29918
|
+
if (true) return "3.0.1-817";
|
|
29919
29919
|
try {
|
|
29920
29920
|
const here = dirname9(fileURLToPath(import.meta.url));
|
|
29921
29921
|
const pkg = JSON.parse(
|
|
@@ -30000,9 +30000,9 @@ function transientBinDir(binDir, env = process.env) {
|
|
|
30000
30000
|
return "an AppImage mount";
|
|
30001
30001
|
return void 0;
|
|
30002
30002
|
}
|
|
30003
|
-
function shellQuote2(value,
|
|
30003
|
+
function shellQuote2(value, platform2 = process.platform) {
|
|
30004
30004
|
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(value)) return value;
|
|
30005
|
-
if (
|
|
30005
|
+
if (platform2 === "win32") return `"${value}"`;
|
|
30006
30006
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
30007
30007
|
}
|
|
30008
30008
|
function isNativeBuild() {
|
|
@@ -30013,11 +30013,11 @@ function isNativeBuild() {
|
|
|
30013
30013
|
return false;
|
|
30014
30014
|
}
|
|
30015
30015
|
}
|
|
30016
|
-
function exeName(name2,
|
|
30017
|
-
return
|
|
30016
|
+
function exeName(name2, platform2) {
|
|
30017
|
+
return platform2 === "win32" ? `${name2}.exe` : name2;
|
|
30018
30018
|
}
|
|
30019
|
-
function stableExecutablePath(executable,
|
|
30020
|
-
const stable =
|
|
30019
|
+
function stableExecutablePath(executable, platform2, exists = existsSync10) {
|
|
30020
|
+
const stable = platform2 === "win32" ? executable.replace(
|
|
30021
30021
|
/^(.*\\apps\\[^\\]+\\)(?!current\\)[^\\]+(\\.*)$/i,
|
|
30022
30022
|
"$1current$2"
|
|
30023
30023
|
) : executable.replace(
|
|
@@ -30026,12 +30026,12 @@ function stableExecutablePath(executable, platform, exists = existsSync10) {
|
|
|
30026
30026
|
);
|
|
30027
30027
|
return stable !== executable && exists(stable) ? stable : executable;
|
|
30028
30028
|
}
|
|
30029
|
-
function isRecorderExecutable(fileName,
|
|
30030
|
-
const name2 =
|
|
30029
|
+
function isRecorderExecutable(fileName, platform2) {
|
|
30030
|
+
const name2 = platform2 === "win32" ? fileName.toLowerCase() : fileName;
|
|
30031
30031
|
return name2.startsWith(EXECUTABLE_NAMES.current.native) || name2.startsWith(EXECUTABLE_NAMES.legacy.native);
|
|
30032
30032
|
}
|
|
30033
|
-
function runtimeCommands(entry2 = process.argv[1], env = process.env, nodePath = process.execPath,
|
|
30034
|
-
const P =
|
|
30033
|
+
function runtimeCommands(entry2 = process.argv[1], env = process.env, nodePath = process.execPath, platform2 = process.platform, native = isNativeBuild(), exists = existsSync10) {
|
|
30034
|
+
const P = platform2 === "win32" ? win323 : posix3;
|
|
30035
30035
|
const { current, legacy } = EXECUTABLE_NAMES;
|
|
30036
30036
|
const holdsBundle = (dir) => exists(P.join(dir, current.daemon)) || exists(P.join(dir, legacy.daemon));
|
|
30037
30037
|
const named = env["TACHO_BIN_DIR"];
|
|
@@ -30046,19 +30046,19 @@ function runtimeCommands(entry2 = process.argv[1], env = process.env, nodePath =
|
|
|
30046
30046
|
else binDir = resolve4(here, "..", "..", "bin");
|
|
30047
30047
|
}
|
|
30048
30048
|
}
|
|
30049
|
-
const nativeCurrent = P.join(binDir, exeName(current.native,
|
|
30050
|
-
const nativeLegacy = P.join(binDir, exeName(legacy.native,
|
|
30049
|
+
const nativeCurrent = P.join(binDir, exeName(current.native, platform2));
|
|
30050
|
+
const nativeLegacy = P.join(binDir, exeName(legacy.native, platform2));
|
|
30051
30051
|
const nativeLayout = native || (exists(nativeCurrent) || exists(nativeLegacy)) && !holdsBundle(binDir);
|
|
30052
30052
|
if (nativeLayout) {
|
|
30053
30053
|
const running = P.basename(nodePath);
|
|
30054
|
-
const found = exists(nativeCurrent) ? nativeCurrent : exists(nativeLegacy) ? nativeLegacy : native && isRecorderExecutable(running,
|
|
30055
|
-
const recorder = found !== void 0 ? stableExecutablePath(found,
|
|
30054
|
+
const found = exists(nativeCurrent) ? nativeCurrent : exists(nativeLegacy) ? nativeLegacy : native && isRecorderExecutable(running, platform2) && named === void 0 ? nodePath : void 0;
|
|
30055
|
+
const recorder = found !== void 0 ? stableExecutablePath(found, platform2, exists) : nativeCurrent;
|
|
30056
30056
|
const dir = P.dirname(recorder);
|
|
30057
30057
|
const transient2 = transientBinDir(dir, env);
|
|
30058
|
-
const missing = exeName(current.native,
|
|
30058
|
+
const missing = exeName(current.native, platform2);
|
|
30059
30059
|
return {
|
|
30060
|
-
hookCommand: `${shellQuote2(recorder,
|
|
30061
|
-
credentialHelperCommand: helperCommandFor(shellQuote2(recorder,
|
|
30060
|
+
hookCommand: `${shellQuote2(recorder, platform2)} hook`,
|
|
30061
|
+
credentialHelperCommand: helperCommandFor(shellQuote2(recorder, platform2)),
|
|
30062
30062
|
daemonCommand: [recorder, "daemon"],
|
|
30063
30063
|
mcpStdioCommand: [recorder, "mcp-stdio"],
|
|
30064
30064
|
binDir: dir,
|
|
@@ -30071,11 +30071,11 @@ function runtimeCommands(entry2 = process.argv[1], env = process.env, nodePath =
|
|
|
30071
30071
|
const files2 = exists(P.join(binDir, legacy.daemon)) && !exists(P.join(binDir, current.daemon)) ? legacy : current;
|
|
30072
30072
|
const transient = transientBinDir(binDir, env);
|
|
30073
30073
|
const flagged = transient !== void 0 ? { transient } : {};
|
|
30074
|
-
const node2 = stableExecutablePath(nodePath,
|
|
30074
|
+
const node2 = stableExecutablePath(nodePath, platform2, exists);
|
|
30075
30075
|
return {
|
|
30076
|
-
hookCommand: `${shellQuote2(node2,
|
|
30076
|
+
hookCommand: `${shellQuote2(node2, platform2)} ${shellQuote2(P.join(binDir, files2.hook), platform2)}`,
|
|
30077
30077
|
credentialHelperCommand: helperCommandFor(
|
|
30078
|
-
`${shellQuote2(node2,
|
|
30078
|
+
`${shellQuote2(node2, platform2)} ${shellQuote2(P.join(binDir, files2.cli), platform2)}`
|
|
30079
30079
|
),
|
|
30080
30080
|
daemonCommand: [node2, P.join(binDir, files2.daemon)],
|
|
30081
30081
|
mcpStdioCommand: [node2, P.join(binDir, files2.cli), "mcp-stdio"],
|
|
@@ -30083,27 +30083,27 @@ function runtimeCommands(entry2 = process.argv[1], env = process.env, nodePath =
|
|
|
30083
30083
|
...flagged
|
|
30084
30084
|
};
|
|
30085
30085
|
}
|
|
30086
|
-
function oxagenRuntimeCommands(entry2 = process.argv[1], env = process.env, nodePath = process.execPath,
|
|
30087
|
-
const P =
|
|
30086
|
+
function oxagenRuntimeCommands(entry2 = process.argv[1], env = process.env, nodePath = process.execPath, platform2 = process.platform, native = isNativeBuild(), exists = existsSync10) {
|
|
30087
|
+
const P = platform2 === "win32" ? win323 : posix3;
|
|
30088
30088
|
const named = env["TACHO_BIN_DIR"];
|
|
30089
30089
|
let prefix;
|
|
30090
30090
|
let executableProblem;
|
|
30091
30091
|
if (named !== void 0) {
|
|
30092
|
-
const executable = P.join(named, exeName("oxagen",
|
|
30092
|
+
const executable = P.join(named, exeName("oxagen", platform2));
|
|
30093
30093
|
prefix = [executable];
|
|
30094
30094
|
if (!exists(executable))
|
|
30095
|
-
executableProblem = `TACHO_BIN_DIR names ${named}, which holds no ${exeName("oxagen",
|
|
30095
|
+
executableProblem = `TACHO_BIN_DIR names ${named}, which holds no ${exeName("oxagen", platform2)}`;
|
|
30096
30096
|
} else if (native) {
|
|
30097
|
-
prefix = [stableExecutablePath(nodePath,
|
|
30097
|
+
prefix = [stableExecutablePath(nodePath, platform2, exists)];
|
|
30098
30098
|
} else if (entry2 !== void 0 && !/\.[cm]?tsx?$/.test(entry2)) {
|
|
30099
30099
|
prefix = [
|
|
30100
|
-
stableExecutablePath(nodePath,
|
|
30100
|
+
stableExecutablePath(nodePath, platform2, exists),
|
|
30101
30101
|
P.resolve(entry2)
|
|
30102
30102
|
];
|
|
30103
30103
|
} else {
|
|
30104
|
-
return runtimeCommands(void 0, env, nodePath,
|
|
30104
|
+
return runtimeCommands(void 0, env, nodePath, platform2, false, exists);
|
|
30105
30105
|
}
|
|
30106
|
-
const line = prefix.map((word2) => shellQuote2(word2,
|
|
30106
|
+
const line = prefix.map((word2) => shellQuote2(word2, platform2)).join(" ");
|
|
30107
30107
|
const binDir = P.dirname(prefix[prefix.length - 1]);
|
|
30108
30108
|
const transient = transientBinDir(binDir, env);
|
|
30109
30109
|
return {
|
|
@@ -30137,8 +30137,8 @@ function realExec(command2, args) {
|
|
|
30137
30137
|
function realExecLong(command2, args) {
|
|
30138
30138
|
return spawnCapture(command2, args, EXEC_LONG_TIMEOUT_MS);
|
|
30139
30139
|
}
|
|
30140
|
-
function wellKnownBinDirs(home,
|
|
30141
|
-
if (
|
|
30140
|
+
function wellKnownBinDirs(home, platform2, env = {}) {
|
|
30141
|
+
if (platform2 === "win32") {
|
|
30142
30142
|
const appData = env["APPDATA"] ?? `${home}\\AppData\\Roaming`;
|
|
30143
30143
|
const local = env["LOCALAPPDATA"] ?? `${home}\\AppData\\Local`;
|
|
30144
30144
|
return [
|
|
@@ -30173,9 +30173,9 @@ function whereExecutable(result2) {
|
|
|
30173
30173
|
function shellExecutable(result2) {
|
|
30174
30174
|
return outputLines(result2).reverse().find((line) => line.startsWith("/"));
|
|
30175
30175
|
}
|
|
30176
|
-
function harnessFacts(exec4, name2,
|
|
30176
|
+
function harnessFacts(exec4, name2, platform2 = process.platform, env = process.env, home = env["HOME"] ?? env["USERPROFILE"] ?? "", exists = existsSync10) {
|
|
30177
30177
|
let path2;
|
|
30178
|
-
if (
|
|
30178
|
+
if (platform2 === "win32") {
|
|
30179
30179
|
path2 = whereExecutable(exec4("where", [name2]));
|
|
30180
30180
|
} else {
|
|
30181
30181
|
const shell = env["SHELL"];
|
|
@@ -30184,9 +30184,9 @@ function harnessFacts(exec4, name2, platform = process.platform, env = process.e
|
|
|
30184
30184
|
path2 ??= shellExecutable(exec4("sh", ["-lc", `command -v ${name2}`]));
|
|
30185
30185
|
}
|
|
30186
30186
|
if (path2 === void 0) {
|
|
30187
|
-
const sep14 =
|
|
30188
|
-
const names2 =
|
|
30189
|
-
outer: for (const dir of wellKnownBinDirs(home,
|
|
30187
|
+
const sep14 = platform2 === "win32" ? "\\" : "/";
|
|
30188
|
+
const names2 = platform2 === "win32" ? [`${name2}.exe`, `${name2}.cmd`] : [name2];
|
|
30189
|
+
outer: for (const dir of wellKnownBinDirs(home, platform2, env)) {
|
|
30190
30190
|
for (const file of names2) {
|
|
30191
30191
|
const candidate = `${dir}${sep14}${file}`;
|
|
30192
30192
|
if (exists(candidate)) {
|
|
@@ -30201,8 +30201,8 @@ function harnessFacts(exec4, name2, platform = process.platform, env = process.e
|
|
|
30201
30201
|
const match = /(\d+\.\d+\.\d+)/.exec(version3.stdout);
|
|
30202
30202
|
return { path: path2, ...match?.[1] !== void 0 ? { version: match[1] } : {} };
|
|
30203
30203
|
}
|
|
30204
|
-
function claudeDesktopFacts(
|
|
30205
|
-
const candidates =
|
|
30204
|
+
function claudeDesktopFacts(platform2 = process.platform, home = homedir3(), env = process.env, exists = existsSync10) {
|
|
30205
|
+
const candidates = platform2 === "darwin" ? ["/Applications/Claude.app", `${home}/Applications/Claude.app`] : platform2 === "win32" ? [
|
|
30206
30206
|
`${env["LOCALAPPDATA"] ?? `${home}\\AppData\\Local`}\\AnthropicClaude`,
|
|
30207
30207
|
`${env["LOCALAPPDATA"] ?? `${home}\\AppData\\Local`}\\Programs\\Claude`
|
|
30208
30208
|
] : [];
|
|
@@ -30211,26 +30211,26 @@ function claudeDesktopFacts(platform = process.platform, home = homedir3(), env
|
|
|
30211
30211
|
}
|
|
30212
30212
|
return { installed: false };
|
|
30213
30213
|
}
|
|
30214
|
-
function cursorAppFacts(
|
|
30214
|
+
function cursorAppFacts(platform2 = process.platform, home = homedir3(), env = process.env, exists = existsSync10) {
|
|
30215
30215
|
const local = env["LOCALAPPDATA"] ?? `${home}\\AppData\\Local`;
|
|
30216
30216
|
const programs = env["PROGRAMFILES"] ?? "C:\\Program Files";
|
|
30217
|
-
const candidates =
|
|
30217
|
+
const candidates = platform2 === "darwin" ? ["/Applications/Cursor.app", `${home}/Applications/Cursor.app`] : platform2 === "win32" ? [`${local}\\Programs\\cursor`, `${programs}\\Cursor`] : [];
|
|
30218
30218
|
for (const candidate of candidates) {
|
|
30219
30219
|
if (exists(candidate)) return { installed: true, path: candidate };
|
|
30220
30220
|
}
|
|
30221
30221
|
return { installed: false };
|
|
30222
30222
|
}
|
|
30223
|
-
function cursorFacts(exec4,
|
|
30224
|
-
const app = exists === void 0 ? cursorAppFacts(
|
|
30223
|
+
function cursorFacts(exec4, platform2 = process.platform, env = process.env, home, exists) {
|
|
30224
|
+
const app = exists === void 0 ? cursorAppFacts(platform2, home, env) : cursorAppFacts(platform2, home ?? homedir3(), env, exists);
|
|
30225
30225
|
const found = app.installed ? { app } : {};
|
|
30226
30226
|
for (const name2 of CURSOR_CLI_NAMES) {
|
|
30227
|
-
const facts = exists === void 0 ? harnessFacts(exec4, name2,
|
|
30227
|
+
const facts = exists === void 0 ? harnessFacts(exec4, name2, platform2, env, home) : harnessFacts(exec4, name2, platform2, env, home, exists);
|
|
30228
30228
|
if (facts.version !== void 0) return { ...facts, ...found };
|
|
30229
30229
|
}
|
|
30230
30230
|
return found;
|
|
30231
30231
|
}
|
|
30232
|
-
function claudeFacts(exec4,
|
|
30233
|
-
return harnessFacts(exec4, "claude",
|
|
30232
|
+
function claudeFacts(exec4, platform2 = process.platform, env = process.env, home) {
|
|
30233
|
+
return harnessFacts(exec4, "claude", platform2, env, home);
|
|
30234
30234
|
}
|
|
30235
30235
|
function settleOrThrow(harnessFiles) {
|
|
30236
30236
|
const outcomes = harnessFiles.settle();
|
|
@@ -30306,14 +30306,14 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30306
30306
|
const env = overrides.env ?? process.env;
|
|
30307
30307
|
const home = overrides.home ?? homedir3();
|
|
30308
30308
|
const exec4 = overrides.exec ?? realExec;
|
|
30309
|
-
const
|
|
30310
|
-
const claudeManaged = managed.claude ?? claudeManagedSettingsPath(
|
|
30309
|
+
const platform2 = overrides.platform ?? process.platform;
|
|
30310
|
+
const claudeManaged = managed.claude ?? claudeManagedSettingsPath(platform2);
|
|
30311
30311
|
const baseUrlInternals = {
|
|
30312
30312
|
managedSettingsFile: claudeManaged,
|
|
30313
30313
|
...managed.stella !== void 0 ? { stellaManagedSettingsFile: managed.stella } : {}
|
|
30314
30314
|
};
|
|
30315
30315
|
const credentialInternals = { managedSettingsFile: claudeManaged };
|
|
30316
|
-
const paths = overrides.paths ?? defaultAgentPaths(tachoHome(env, home,
|
|
30316
|
+
const paths = overrides.paths ?? defaultAgentPaths(tachoHome(env, home, platform2));
|
|
30317
30317
|
const harnessFiles = new HarnessFiles(paths.dir);
|
|
30318
30318
|
const harnessDirs = {
|
|
30319
30319
|
claudeConfigDir: dirname10(paths.claudeSettings),
|
|
@@ -30367,7 +30367,7 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30367
30367
|
paths,
|
|
30368
30368
|
env,
|
|
30369
30369
|
home,
|
|
30370
|
-
platform,
|
|
30370
|
+
platform: platform2,
|
|
30371
30371
|
fetch: async (input, init) => {
|
|
30372
30372
|
const response = await fetch(input, init);
|
|
30373
30373
|
return {
|
|
@@ -30383,7 +30383,7 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30383
30383
|
// Resolved per call: `codex` may be installed between one command and
|
|
30384
30384
|
// the next, and the probe is cheap next to spawning the server.
|
|
30385
30385
|
codexAppServerClient({
|
|
30386
|
-
binary: harnessFacts(exec4, "codex",
|
|
30386
|
+
binary: harnessFacts(exec4, "codex", platform2, env, home).path ?? "codex",
|
|
30387
30387
|
cwd: process.cwd(),
|
|
30388
30388
|
env,
|
|
30389
30389
|
// The name sent in the app server's `initialize` request. Another
|
|
@@ -30393,7 +30393,7 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30393
30393
|
})(requests)
|
|
30394
30394
|
),
|
|
30395
30395
|
serviceManager: serviceManagerFor({
|
|
30396
|
-
platform,
|
|
30396
|
+
platform: platform2,
|
|
30397
30397
|
home,
|
|
30398
30398
|
exec: exec4,
|
|
30399
30399
|
launcherPath: paths.daemonLauncher,
|
|
@@ -30503,7 +30503,7 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30503
30503
|
const payload = JSON.stringify(body2);
|
|
30504
30504
|
try {
|
|
30505
30505
|
return await postUnix({
|
|
30506
|
-
...
|
|
30506
|
+
...platform2 === "win32" ? { loopbackPort: host.port } : { socketPath: paths.socket },
|
|
30507
30507
|
path: path2,
|
|
30508
30508
|
headers: { Authorization: `Bearer ${host.local_token}` },
|
|
30509
30509
|
body: payload,
|
|
@@ -30527,7 +30527,7 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30527
30527
|
};
|
|
30528
30528
|
const req = httpRequest(
|
|
30529
30529
|
{
|
|
30530
|
-
...
|
|
30530
|
+
...platform2 === "win32" ? { host: "127.0.0.1", port: host.port } : { socketPath: paths.socket },
|
|
30531
30531
|
path: path2,
|
|
30532
30532
|
method: "POST",
|
|
30533
30533
|
agent: false,
|
|
@@ -30561,13 +30561,13 @@ function defaultCliDeps(overrides = {}, managed = {}) {
|
|
|
30561
30561
|
req.end(payload);
|
|
30562
30562
|
});
|
|
30563
30563
|
},
|
|
30564
|
-
claude: () => claudeFacts(exec4,
|
|
30565
|
-
codex: () => harnessFacts(exec4, "codex",
|
|
30566
|
-
cursor: () => cursorFacts(exec4,
|
|
30567
|
-
cursorEditor: () => cursorAppFacts(
|
|
30568
|
-
stella: () => harnessFacts(exec4, "stella",
|
|
30569
|
-
claudeDesktop: () => claudeDesktopFacts(
|
|
30570
|
-
runtime: runtimeCommands(void 0, env, void 0,
|
|
30564
|
+
claude: () => claudeFacts(exec4, platform2, env, home),
|
|
30565
|
+
codex: () => harnessFacts(exec4, "codex", platform2, env, home),
|
|
30566
|
+
cursor: () => cursorFacts(exec4, platform2, env, home),
|
|
30567
|
+
cursorEditor: () => cursorAppFacts(platform2, home, env),
|
|
30568
|
+
stella: () => harnessFacts(exec4, "stella", platform2, env, home),
|
|
30569
|
+
claudeDesktop: () => claudeDesktopFacts(platform2, home, env),
|
|
30570
|
+
runtime: runtimeCommands(void 0, env, void 0, platform2),
|
|
30571
30571
|
daemonGet,
|
|
30572
30572
|
findFreePort: () => new Promise((resolvePromise, reject) => {
|
|
30573
30573
|
const server = createServer();
|
|
@@ -31297,7 +31297,7 @@ function createControlClient(options) {
|
|
|
31297
31297
|
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
31298
31298
|
const ingestTimeoutMs = options.ingestTimeoutMs ?? TACHO_INGEST_TIMEOUT_MS;
|
|
31299
31299
|
const nowMs = options.now ?? Date.now;
|
|
31300
|
-
async function
|
|
31300
|
+
async function post3(url2, body2, boundMs = timeoutMs, method = "POST", extraHeaders = {}) {
|
|
31301
31301
|
const controller = new AbortController();
|
|
31302
31302
|
const timer = setTimeout(() => controller.abort(), boundMs);
|
|
31303
31303
|
const signal = options.signal === void 0 ? controller.signal : AbortSignal.any([controller.signal, options.signal]);
|
|
@@ -31351,7 +31351,7 @@ function createControlClient(options) {
|
|
|
31351
31351
|
}
|
|
31352
31352
|
async function call2(url2, schema, body2, boundMs, method = "POST", extraHeaders) {
|
|
31353
31353
|
const parsed2 = schema.safeParse(
|
|
31354
|
-
await
|
|
31354
|
+
await post3(url2, body2, boundMs, method, extraHeaders)
|
|
31355
31355
|
);
|
|
31356
31356
|
if (!parsed2.success)
|
|
31357
31357
|
throw new ControlAnswerUnreadable(url2, zodIssues(parsed2.error));
|
|
@@ -36998,8 +36998,8 @@ async function abandonAddition(revoked, addition, options, deps, warnings) {
|
|
|
36998
36998
|
async function enrollSteps(options, deps, addition) {
|
|
36999
36999
|
const warnings = [];
|
|
37000
37000
|
const step = (n2, text6) => deps.out(`[${n2}/6] ${text6}`);
|
|
37001
|
-
const
|
|
37002
|
-
if (!
|
|
37001
|
+
const platform2 = tachoPlatformSchema.safeParse(deps.platform);
|
|
37002
|
+
if (!platform2.success) {
|
|
37003
37003
|
deps.err(
|
|
37004
37004
|
`Oxagen agents run on macOS, Linux and Windows, and this machine reports ${deps.platform}, so nothing was enrolled.`
|
|
37005
37005
|
);
|
|
@@ -37242,7 +37242,8 @@ ${problems.map((problem) => ` ${problem}`).join("\n")}`
|
|
|
37242
37242
|
token: options.enrollmentToken,
|
|
37243
37243
|
...facts,
|
|
37244
37244
|
deviceKeyProof,
|
|
37245
|
-
...remote !== void 0 ? { repositoryRemote: remote } : {}
|
|
37245
|
+
...remote !== void 0 ? { repositoryRemote: remote } : {},
|
|
37246
|
+
...options.machineId !== void 0 ? { machineId: options.machineId } : {}
|
|
37246
37247
|
});
|
|
37247
37248
|
response = answer;
|
|
37248
37249
|
agentId = answer.agentId;
|
|
@@ -37351,7 +37352,7 @@ ${problems.map((problem) => ` ${problem}`).join("\n")}`
|
|
|
37351
37352
|
local_token: existing?.local_token ?? deps.randomToken(),
|
|
37352
37353
|
hostname: deps.hostname,
|
|
37353
37354
|
os_user: deps.osUser,
|
|
37354
|
-
platform:
|
|
37355
|
+
platform: platform2.data,
|
|
37355
37356
|
harnesses,
|
|
37356
37357
|
managed,
|
|
37357
37358
|
claude_version: claude.version ?? null,
|
|
@@ -38985,10 +38986,10 @@ import {
|
|
|
38985
38986
|
unlinkSync as unlinkSync11
|
|
38986
38987
|
} from "node:fs";
|
|
38987
38988
|
import { dirname as dirname16, isAbsolute as isAbsolute2, join as join26, relative, resolve as resolve7, sep } from "node:path";
|
|
38988
|
-
function dataLocalDir(home, env,
|
|
38989
|
-
if (
|
|
38989
|
+
function dataLocalDir(home, env, platform2) {
|
|
38990
|
+
if (platform2 === "darwin")
|
|
38990
38991
|
return join26(home, "Library", "Application Support");
|
|
38991
|
-
if (
|
|
38992
|
+
if (platform2 === "win32")
|
|
38992
38993
|
return env["LOCALAPPDATA"] ?? join26(home, "AppData", "Local");
|
|
38993
38994
|
const xdg = env["XDG_DATA_HOME"];
|
|
38994
38995
|
return xdg !== void 0 && isAbsolute2(xdg) ? xdg : join26(home, ".local", "share");
|
|
@@ -39276,10 +39277,10 @@ function journaledCopies(journal, copies, tally2) {
|
|
|
39276
39277
|
}
|
|
39277
39278
|
return dirs;
|
|
39278
39279
|
}
|
|
39279
|
-
function removeSidecars(dir,
|
|
39280
|
-
const note =
|
|
39280
|
+
function removeSidecars(dir, platform2, tally2) {
|
|
39281
|
+
const note = platform2 === "win32" ? `. Windows keeps a running program's file, so delete ${dir} after this command exits` : "";
|
|
39281
39282
|
for (const name2 of ["oxagen", "recorder", "tacho", "codegraph"]) {
|
|
39282
|
-
const file = join26(dir,
|
|
39283
|
+
const file = join26(dir, platform2 === "win32" ? `${name2}.exe` : name2);
|
|
39283
39284
|
removeFile(file, tally2, note);
|
|
39284
39285
|
}
|
|
39285
39286
|
}
|
|
@@ -43344,7 +43345,7 @@ function createContainedRunner(options) {
|
|
|
43344
43345
|
...payload
|
|
43345
43346
|
}
|
|
43346
43347
|
});
|
|
43347
|
-
const
|
|
43348
|
+
const release3 = () => {
|
|
43348
43349
|
signal?.removeEventListener("abort", abort);
|
|
43349
43350
|
if (sessionUuid2) active2.delete(sessionUuid2);
|
|
43350
43351
|
if (launchedSessionId) {
|
|
@@ -43427,7 +43428,7 @@ function createContainedRunner(options) {
|
|
|
43427
43428
|
await end(sessionId, { reason: "other", exit_code: exitCode });
|
|
43428
43429
|
}
|
|
43429
43430
|
});
|
|
43430
|
-
return { ...run3, exited: run3.exited.finally(
|
|
43431
|
+
return { ...run3, exited: run3.exited.finally(release3) };
|
|
43431
43432
|
} catch (error2) {
|
|
43432
43433
|
if (opened && !ended && launchedSessionId !== void 0) {
|
|
43433
43434
|
try {
|
|
@@ -43438,7 +43439,7 @@ function createContainedRunner(options) {
|
|
|
43438
43439
|
);
|
|
43439
43440
|
}
|
|
43440
43441
|
}
|
|
43441
|
-
|
|
43442
|
+
release3();
|
|
43442
43443
|
throw error2;
|
|
43443
43444
|
}
|
|
43444
43445
|
}
|
|
@@ -50695,7 +50696,7 @@ function createGithubProxy(deps) {
|
|
|
50695
50696
|
host
|
|
50696
50697
|
);
|
|
50697
50698
|
}
|
|
50698
|
-
function
|
|
50699
|
+
function release3(token) {
|
|
50699
50700
|
leases.delete(hash(token));
|
|
50700
50701
|
}
|
|
50701
50702
|
async function mintInstallationToken(host, controller, res, path2, lease) {
|
|
@@ -51044,7 +51045,7 @@ function createGithubProxy(deps) {
|
|
|
51044
51045
|
}
|
|
51045
51046
|
}
|
|
51046
51047
|
}
|
|
51047
|
-
return { issue: issue2, issueForSession, release:
|
|
51048
|
+
return { issue: issue2, issueForSession, release: release3, handle };
|
|
51048
51049
|
}
|
|
51049
51050
|
var LIFE_MS, MAX_LEASES, MAX_REQUEST_BYTES, REPO, GITLAB_PATH, GITLAB_HOST, MAX_REFUSAL_CHARS, REFUSED, CONFIGURE_STEP;
|
|
51050
51051
|
var init_github_proxy = __esm({
|
|
@@ -53883,8 +53884,8 @@ async function whichOnPath(command2, pathValue, search) {
|
|
|
53883
53884
|
}
|
|
53884
53885
|
return void 0;
|
|
53885
53886
|
}
|
|
53886
|
-
function platformPathSearch(
|
|
53887
|
-
if (
|
|
53887
|
+
function platformPathSearch(platform2, env, isExecutable2) {
|
|
53888
|
+
if (platform2 !== "win32")
|
|
53888
53889
|
return { delimiter: ":", extensions: [""], isExecutable: isExecutable2 };
|
|
53889
53890
|
const pathExt = env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD";
|
|
53890
53891
|
return {
|
|
@@ -53953,8 +53954,8 @@ function createPackageDigester(deps) {
|
|
|
53953
53954
|
}
|
|
53954
53955
|
async function releaseFile(pkg, signal) {
|
|
53955
53956
|
const url2 = `${REGISTRY_URLS.pypi}/${encodeURIComponent(pkg.name)}/${encodeURIComponent(pkg.version)}/json`;
|
|
53956
|
-
const
|
|
53957
|
-
return pickPypiFile(
|
|
53957
|
+
const release3 = objectOf(await (await read2(url2, signal)).json());
|
|
53958
|
+
return pickPypiFile(release3?.urls) ?? null;
|
|
53958
53959
|
}
|
|
53959
53960
|
function fileDigest(url2, signal) {
|
|
53960
53961
|
const known = files2.get(url2);
|
|
@@ -54959,8 +54960,8 @@ async function isExecutable(path2) {
|
|
|
54959
54960
|
return false;
|
|
54960
54961
|
}
|
|
54961
54962
|
}
|
|
54962
|
-
function machineDigester(fetch2, env,
|
|
54963
|
-
const search = platformPathSearch(
|
|
54963
|
+
function machineDigester(fetch2, env, platform2) {
|
|
54964
|
+
const search = platformPathSearch(platform2, env, isExecutable);
|
|
54964
54965
|
return createPackageDigester({
|
|
54965
54966
|
fetch: fetch2,
|
|
54966
54967
|
readFile: (path2) => readFile2(path2),
|
|
@@ -55371,11 +55372,11 @@ import {
|
|
|
55371
55372
|
writeFileSync as writeFileSync5
|
|
55372
55373
|
} from "node:fs";
|
|
55373
55374
|
import { join as join49 } from "node:path";
|
|
55374
|
-
function codegraphTriple(
|
|
55375
|
-
if (
|
|
55376
|
-
if (
|
|
55377
|
-
if (
|
|
55378
|
-
if (
|
|
55375
|
+
function codegraphTriple(platform2, arch) {
|
|
55376
|
+
if (platform2 === "darwin" && arch === "arm64") return "aarch64-apple-darwin";
|
|
55377
|
+
if (platform2 === "darwin" && arch === "x64") return "x86_64-apple-darwin";
|
|
55378
|
+
if (platform2 === "linux" && arch === "x64") return "x86_64-unknown-linux-gnu";
|
|
55379
|
+
if (platform2 === "win32" && arch === "x64") return "x86_64-pc-windows-msvc";
|
|
55379
55380
|
return void 0;
|
|
55380
55381
|
}
|
|
55381
55382
|
function codegraphAssetName(triple) {
|
|
@@ -56271,7 +56272,7 @@ function serverEnvironment(env, settings) {
|
|
|
56271
56272
|
function createCodeGraphSupervisor(deps) {
|
|
56272
56273
|
const home = deps.home ?? homedir6();
|
|
56273
56274
|
const root = codegraphRoot(deps.env, home);
|
|
56274
|
-
const
|
|
56275
|
+
const spawn10 = deps.spawn ?? spawnChild;
|
|
56275
56276
|
const sleep2 = deps.sleep ?? ((ms) => new Promise((resolve29) => setTimeout(resolve29, ms)));
|
|
56276
56277
|
const localFetch = deps.localFetch ?? ((url2, init) => globalThis.fetch(url2, init));
|
|
56277
56278
|
const isExecutable2 = deps.isExecutable ?? defaultIsExecutable;
|
|
@@ -56324,7 +56325,7 @@ function createCodeGraphSupervisor(deps) {
|
|
|
56324
56325
|
}
|
|
56325
56326
|
function runOnce(bin, args) {
|
|
56326
56327
|
return new Promise((resolve29) => {
|
|
56327
|
-
const child =
|
|
56328
|
+
const child = spawn10(bin, args, {
|
|
56328
56329
|
env: serverEnvironment(deps.env, void 0),
|
|
56329
56330
|
stdio: ["ignore", "ignore", "pipe"]
|
|
56330
56331
|
});
|
|
@@ -56485,7 +56486,7 @@ function createCodeGraphSupervisor(deps) {
|
|
|
56485
56486
|
);
|
|
56486
56487
|
facts.memoryMb = memory.mb;
|
|
56487
56488
|
facts.memoryFrom = memory.from;
|
|
56488
|
-
const child =
|
|
56489
|
+
const child = spawn10(
|
|
56489
56490
|
bin,
|
|
56490
56491
|
[
|
|
56491
56492
|
"serve",
|
|
@@ -56921,9 +56922,9 @@ function sessionSkills(options) {
|
|
|
56921
56922
|
let tail = Promise.resolve();
|
|
56922
56923
|
async function inTurn(task) {
|
|
56923
56924
|
const before = tail;
|
|
56924
|
-
let
|
|
56925
|
+
let release3 = () => void 0;
|
|
56925
56926
|
const mine = new Promise((resolve29) => {
|
|
56926
|
-
|
|
56927
|
+
release3 = resolve29;
|
|
56927
56928
|
});
|
|
56928
56929
|
tail = before.then(() => mine);
|
|
56929
56930
|
const turn = await new Promise((resolve29) => {
|
|
@@ -56938,7 +56939,7 @@ function sessionSkills(options) {
|
|
|
56938
56939
|
await task();
|
|
56939
56940
|
return true;
|
|
56940
56941
|
} finally {
|
|
56941
|
-
|
|
56942
|
+
release3();
|
|
56942
56943
|
}
|
|
56943
56944
|
}
|
|
56944
56945
|
return {
|
|
@@ -59224,14 +59225,14 @@ function createModelProxy(deps) {
|
|
|
59224
59225
|
const calls = inFlight.get(sessionKey) ?? /* @__PURE__ */ new Set();
|
|
59225
59226
|
calls.add(entry2);
|
|
59226
59227
|
inFlight.set(sessionKey, calls);
|
|
59227
|
-
const
|
|
59228
|
+
const release3 = () => {
|
|
59228
59229
|
if (calls.delete(entry2) && calls.size === 0 && inFlight.get(sessionKey) === calls)
|
|
59229
59230
|
inFlight.delete(sessionKey);
|
|
59230
59231
|
};
|
|
59231
59232
|
const finish = (outcome) => {
|
|
59232
59233
|
if (done) return;
|
|
59233
59234
|
done = true;
|
|
59234
|
-
|
|
59235
|
+
release3();
|
|
59235
59236
|
resolve29(outcome);
|
|
59236
59237
|
};
|
|
59237
59238
|
try {
|
|
@@ -59315,7 +59316,7 @@ function createModelProxy(deps) {
|
|
|
59315
59316
|
const end = (errorClass2) => {
|
|
59316
59317
|
if (done || answered) return;
|
|
59317
59318
|
answered = true;
|
|
59318
|
-
|
|
59319
|
+
release3();
|
|
59319
59320
|
const encoding = response.headers["content-encoding"];
|
|
59320
59321
|
const decoding = over ? Promise.resolve(void 0) : readableModelBody(
|
|
59321
59322
|
Buffer.concat(chunks),
|
|
@@ -62839,11 +62840,11 @@ async function initializeDaemon(options, server, port, ready, clock2) {
|
|
|
62839
62840
|
const exec4 = options.exec ?? defaultExec;
|
|
62840
62841
|
const execAsync = options.execAsync ?? (options.exec !== void 0 ? async (command2, args) => exec4(command2, args) : defaultExecAsync);
|
|
62841
62842
|
const kill = options.kill ?? defaultKill;
|
|
62842
|
-
const
|
|
62843
|
+
const platform2 = options.platform ?? process.platform;
|
|
62843
62844
|
const injectedStarts = options.processStarts;
|
|
62844
|
-
const processStarts = injectedStarts ?? ((pids) => readProcessStarts(pids, options.exec,
|
|
62845
|
-
const processStartsAsync = async (pids) => injectedStarts !== void 0 ? injectedStarts(pids) : options.exec !== void 0 ? readProcessStarts(pids, options.exec,
|
|
62846
|
-
const hookProcessStarts = injectedStarts ?? ((pids) => readProcessStartsNoWait(pids, execAsync,
|
|
62845
|
+
const processStarts = injectedStarts ?? ((pids) => readProcessStarts(pids, options.exec, platform2));
|
|
62846
|
+
const processStartsAsync = async (pids) => injectedStarts !== void 0 ? injectedStarts(pids) : options.exec !== void 0 ? readProcessStarts(pids, options.exec, platform2) : readProcessStartsAsync(pids, void 0, platform2);
|
|
62847
|
+
const hookProcessStarts = injectedStarts ?? ((pids) => readProcessStartsNoWait(pids, execAsync, platform2));
|
|
62847
62848
|
const loaded = options.host;
|
|
62848
62849
|
let host = loaded.wrapper_version === TACHO_VERSION ? loaded : { ...loaded, wrapper_version: TACHO_VERSION };
|
|
62849
62850
|
const onDisk = readHostFileLenient(paths.hostFile).host;
|
|
@@ -63333,9 +63334,9 @@ async function initializeDaemon(options, server, port, ready, clock2) {
|
|
|
63333
63334
|
if (retention.proven) {
|
|
63334
63335
|
let released = false;
|
|
63335
63336
|
try {
|
|
63336
|
-
const
|
|
63337
|
-
written2 +=
|
|
63338
|
-
dropped +=
|
|
63337
|
+
const release3 = wal.releaseHeld(sessionUuid2, retention.mandate);
|
|
63338
|
+
written2 += release3.written;
|
|
63339
|
+
dropped += release3.dropped;
|
|
63339
63340
|
released = true;
|
|
63340
63341
|
} catch (error2) {
|
|
63341
63342
|
log(
|
|
@@ -72839,9 +72840,9 @@ import { posix as posix6, win32 as win326 } from "node:path";
|
|
|
72839
72840
|
function isLegacyName(value) {
|
|
72840
72841
|
return LEGACY_NAMES.some((name2) => name2 === value);
|
|
72841
72842
|
}
|
|
72842
|
-
function legacyNameOf(marker, argv0,
|
|
72843
|
+
function legacyNameOf(marker, argv0, platform2) {
|
|
72843
72844
|
if (isLegacyName(marker)) return marker;
|
|
72844
|
-
const name2 =
|
|
72845
|
+
const name2 = platform2 === "win32" ? win326.basename(argv0).toLowerCase().replace(/\.exe$/, "") : posix6.basename(argv0);
|
|
72845
72846
|
return isLegacyName(name2) ? name2 : void 0;
|
|
72846
72847
|
}
|
|
72847
72848
|
function invokedLegacyName() {
|
|
@@ -73447,7 +73448,7 @@ var init_package = __esm({
|
|
|
73447
73448
|
"package.json"() {
|
|
73448
73449
|
package_default = {
|
|
73449
73450
|
name: "@oxagen/cli",
|
|
73450
|
-
version: "3.0.1-
|
|
73451
|
+
version: "3.0.1-817",
|
|
73451
73452
|
description: "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
|
|
73452
73453
|
type: "module",
|
|
73453
73454
|
main: "./dist/index.js",
|
|
@@ -92470,6 +92471,7 @@ __export(host_exports, {
|
|
|
92470
92471
|
SCHTASKS_NAME: () => SCHTASKS_NAME,
|
|
92471
92472
|
SERVICE_LABEL: () => SERVICE_LABEL,
|
|
92472
92473
|
SESSION_END_TIMEOUT_S: () => SESSION_END_TIMEOUT_S,
|
|
92474
|
+
SETUP_TOKEN_EXIT_MARK: () => SETUP_TOKEN_EXIT_MARK,
|
|
92473
92475
|
SPOOLED_HOOK_EVENTS: () => SPOOLED_HOOK_EVENTS,
|
|
92474
92476
|
STATIC_TOKEN_HARNESSES: () => STATIC_TOKEN_HARNESSES,
|
|
92475
92477
|
STATIC_TOKEN_RENEW_WINDOW_MS: () => STATIC_TOKEN_RENEW_WINDOW_MS,
|
|
@@ -92534,7 +92536,10 @@ __export(host_exports, {
|
|
|
92534
92536
|
ensureDir: () => ensureDir,
|
|
92535
92537
|
envOf: () => envOf,
|
|
92536
92538
|
evaluatePreToolUse: () => evaluatePreToolUse,
|
|
92539
|
+
extractSetupToken: () => extractSetupToken,
|
|
92537
92540
|
fileVersion: () => fileVersion,
|
|
92541
|
+
findClaudeBinary: () => findClaudeBinary,
|
|
92542
|
+
findHarnessBinary: () => findHarnessBinary,
|
|
92538
92543
|
foldMcpServerCase: () => foldMcpServerCase,
|
|
92539
92544
|
formatDaemonPid: () => formatDaemonPid,
|
|
92540
92545
|
frameListLength: () => frameListLength,
|
|
@@ -92559,6 +92564,7 @@ __export(host_exports, {
|
|
|
92559
92564
|
isDaemonImage: () => isDaemonImage,
|
|
92560
92565
|
isModelProxyBaseUrl: () => isModelProxyBaseUrl,
|
|
92561
92566
|
isProcessAlive: () => isProcessAlive,
|
|
92567
|
+
isSubscriptionToken: () => isSubscriptionToken,
|
|
92562
92568
|
isTachoEntry: () => isTachoEntry,
|
|
92563
92569
|
isTachoGroup: () => isTachoGroup,
|
|
92564
92570
|
isTachoHelper: () => isTachoHelper,
|
|
@@ -92627,12 +92633,15 @@ __export(host_exports, {
|
|
|
92627
92633
|
restoreModelCredentials: () => restoreModelCredentials,
|
|
92628
92634
|
revokedSubjectDigest: () => revokedSubjectDigest,
|
|
92629
92635
|
ruleMatches: () => ruleMatches,
|
|
92636
|
+
runClaudeSetupToken: () => runClaudeSetupToken,
|
|
92630
92637
|
runTokenKeyFromHex: () => runTokenKeyFromHex,
|
|
92631
92638
|
serializeJsonLike: () => serializeJsonLike,
|
|
92632
92639
|
serviceManagerFor: () => serviceManagerFor,
|
|
92633
92640
|
sessionScopeForEnrollment: () => sessionScopeForEnrollment,
|
|
92634
92641
|
sessionScopeOf: () => sessionScopeOf,
|
|
92635
92642
|
settingsShapeProblem: () => settingsShapeProblem,
|
|
92643
|
+
setupTokenCommand: () => setupTokenCommand,
|
|
92644
|
+
setupTokenShellLine: () => setupTokenShellLine,
|
|
92636
92645
|
shellSegments: () => shellSegments,
|
|
92637
92646
|
sidecarBeside: () => sidecarBeside,
|
|
92638
92647
|
signBytes: () => signBytes,
|
|
@@ -92684,6 +92693,7 @@ var init_host = __esm({
|
|
|
92684
92693
|
"use strict";
|
|
92685
92694
|
init_agents();
|
|
92686
92695
|
init_bundle();
|
|
92696
|
+
init_claude_setup_token();
|
|
92687
92697
|
init_codex_writer();
|
|
92688
92698
|
init_control_client();
|
|
92689
92699
|
init_credential_store();
|
|
@@ -92728,16 +92738,16 @@ function isExecutableFile(path2) {
|
|
|
92728
92738
|
return false;
|
|
92729
92739
|
}
|
|
92730
92740
|
}
|
|
92731
|
-
function commandNames(command2,
|
|
92732
|
-
return
|
|
92741
|
+
function commandNames(command2, platform2) {
|
|
92742
|
+
return platform2 === "win32" ? [`${command2}.exe`, `${command2}.cmd`] : [command2];
|
|
92733
92743
|
}
|
|
92734
92744
|
async function detectHarnesses(deps = {}) {
|
|
92735
92745
|
const dirs = await (deps.searchDirs ?? terminalDirs)();
|
|
92736
92746
|
const isExecutable2 = deps.isExecutable ?? isExecutableFile;
|
|
92737
|
-
const
|
|
92747
|
+
const platform2 = deps.platform ?? process.platform;
|
|
92738
92748
|
const found = [];
|
|
92739
92749
|
for (const harness of WRAPPED_HARNESSES) {
|
|
92740
|
-
const names2 = commandNames(HARNESS_BINARY[harness],
|
|
92750
|
+
const names2 = commandNames(HARNESS_BINARY[harness], platform2);
|
|
92741
92751
|
const path2 = dirs.flatMap((dir) => names2.map((name2) => join65(dir, name2))).find(isExecutable2);
|
|
92742
92752
|
if (path2 !== void 0) {
|
|
92743
92753
|
found.push({ harness, label: harnessLabel(harness), path: path2 });
|
|
@@ -92778,6 +92788,493 @@ var init_harnesses = __esm({
|
|
|
92778
92788
|
}
|
|
92779
92789
|
});
|
|
92780
92790
|
|
|
92791
|
+
// src/lib/working-copy.ts
|
|
92792
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
92793
|
+
import { createHash as createHash27, randomBytes as randomBytes14 } from "node:crypto";
|
|
92794
|
+
import {
|
|
92795
|
+
existsSync as existsSync29,
|
|
92796
|
+
lstatSync as lstatSync13,
|
|
92797
|
+
mkdirSync as mkdirSync13,
|
|
92798
|
+
readFileSync as readFileSync30,
|
|
92799
|
+
readdirSync as readdirSync17,
|
|
92800
|
+
realpathSync as realpathSync10,
|
|
92801
|
+
writeFileSync as writeFileSync10
|
|
92802
|
+
} from "node:fs";
|
|
92803
|
+
import { homedir as homedir12, hostname as osHostname3 } from "node:os";
|
|
92804
|
+
import { join as join66, resolve as resolve24, sep as sep10 } from "node:path";
|
|
92805
|
+
function git3(cwd, args) {
|
|
92806
|
+
return new Promise((done) => {
|
|
92807
|
+
try {
|
|
92808
|
+
execFile6(
|
|
92809
|
+
"git",
|
|
92810
|
+
args,
|
|
92811
|
+
{ cwd, timeout: GIT_TIMEOUT_MS2, encoding: "utf8", windowsHide: true },
|
|
92812
|
+
(err2, stdout) => {
|
|
92813
|
+
if (err2) return done(null);
|
|
92814
|
+
const out = String(stdout).trim();
|
|
92815
|
+
done(out.length > 0 ? out : null);
|
|
92816
|
+
}
|
|
92817
|
+
);
|
|
92818
|
+
} catch {
|
|
92819
|
+
done(null);
|
|
92820
|
+
}
|
|
92821
|
+
});
|
|
92822
|
+
}
|
|
92823
|
+
async function projectRootFor(cwd) {
|
|
92824
|
+
const top = await git3(cwd, ["rev-parse", "--show-toplevel"]);
|
|
92825
|
+
return top ? resolve24(top) : resolve24(cwd);
|
|
92826
|
+
}
|
|
92827
|
+
function parseRemoteRepository(url2) {
|
|
92828
|
+
const raw = url2.trim();
|
|
92829
|
+
if (raw.length === 0) return null;
|
|
92830
|
+
let path2 = null;
|
|
92831
|
+
const scp = /^(?:[^@/\s]+@)?([^:/\s]+):(?!\/\/)(.+)$/.exec(raw);
|
|
92832
|
+
if (!raw.includes("://") && scp) {
|
|
92833
|
+
if (scp[1].length === 1) return null;
|
|
92834
|
+
path2 = scp[2];
|
|
92835
|
+
} else {
|
|
92836
|
+
try {
|
|
92837
|
+
const parsed2 = new URL(raw);
|
|
92838
|
+
if (parsed2.protocol === "file:") return null;
|
|
92839
|
+
path2 = decodeURIComponent(parsed2.pathname);
|
|
92840
|
+
} catch {
|
|
92841
|
+
return null;
|
|
92842
|
+
}
|
|
92843
|
+
}
|
|
92844
|
+
const segments = path2.replace(/\/+$/, "").replace(/\.git$/, "").split("/").filter((s2) => s2.length > 0);
|
|
92845
|
+
if (segments.length < 2) return null;
|
|
92846
|
+
const name2 = segments.join("/");
|
|
92847
|
+
return name2.length >= 3 && name2.length <= 512 ? name2 : null;
|
|
92848
|
+
}
|
|
92849
|
+
function oxagenPresent(root) {
|
|
92850
|
+
try {
|
|
92851
|
+
return readdirSync17(join66(root, ".oxagen")).some(
|
|
92852
|
+
(name2) => name2 !== "workspace.json"
|
|
92853
|
+
);
|
|
92854
|
+
} catch {
|
|
92855
|
+
return false;
|
|
92856
|
+
}
|
|
92857
|
+
}
|
|
92858
|
+
function symlinkState(root) {
|
|
92859
|
+
try {
|
|
92860
|
+
if (!lstatSync13(join66(root, ".stella")).isDirectory()) return "none";
|
|
92861
|
+
} catch {
|
|
92862
|
+
return "none";
|
|
92863
|
+
}
|
|
92864
|
+
let oxagenReal;
|
|
92865
|
+
try {
|
|
92866
|
+
oxagenReal = realpathSync10(join66(root, ".oxagen"));
|
|
92867
|
+
} catch {
|
|
92868
|
+
return "missing";
|
|
92869
|
+
}
|
|
92870
|
+
for (const link of STELLA_LINKS) {
|
|
92871
|
+
const at2 = join66(root, link);
|
|
92872
|
+
try {
|
|
92873
|
+
if (!lstatSync13(at2).isSymbolicLink()) return "missing";
|
|
92874
|
+
const target = realpathSync10(at2);
|
|
92875
|
+
if (target !== oxagenReal && !target.startsWith(oxagenReal + sep10)) {
|
|
92876
|
+
return "missing";
|
|
92877
|
+
}
|
|
92878
|
+
} catch {
|
|
92879
|
+
return "missing";
|
|
92880
|
+
}
|
|
92881
|
+
}
|
|
92882
|
+
return "linked";
|
|
92883
|
+
}
|
|
92884
|
+
function machineId(configDir = getConfigDir()) {
|
|
92885
|
+
const file = join66(configDir, MACHINE_ID_FILE);
|
|
92886
|
+
let secret = null;
|
|
92887
|
+
try {
|
|
92888
|
+
if (existsSync29(file)) {
|
|
92889
|
+
const stored = readFileSync30(file, "utf8").trim();
|
|
92890
|
+
if (/^[0-9a-f]{64}$/.test(stored)) secret = stored;
|
|
92891
|
+
}
|
|
92892
|
+
if (secret === null) {
|
|
92893
|
+
secret = randomBytes14(32).toString("hex");
|
|
92894
|
+
mkdirSync13(configDir, { recursive: true });
|
|
92895
|
+
writeFileSync10(file, `${secret}
|
|
92896
|
+
`, { encoding: "utf8", mode: 384 });
|
|
92897
|
+
}
|
|
92898
|
+
} catch {
|
|
92899
|
+
secret = `fallback:${osHostname3()}:${homedir12()}`;
|
|
92900
|
+
}
|
|
92901
|
+
return createHash27("sha256").update(secret).digest("hex");
|
|
92902
|
+
}
|
|
92903
|
+
function cliVersion() {
|
|
92904
|
+
const v = package_default.version;
|
|
92905
|
+
return typeof v === "string" && v.length > 0 ? v.slice(0, 64) : null;
|
|
92906
|
+
}
|
|
92907
|
+
async function probeWorkingCopy(opts) {
|
|
92908
|
+
const { root } = opts;
|
|
92909
|
+
const [remote, branch, head3] = await Promise.all([
|
|
92910
|
+
git3(root, ["remote", "get-url", "origin"]),
|
|
92911
|
+
git3(root, ["rev-parse", "--abbrev-ref", "HEAD"]),
|
|
92912
|
+
git3(root, ["rev-parse", "HEAD"])
|
|
92913
|
+
]);
|
|
92914
|
+
const host = (() => {
|
|
92915
|
+
try {
|
|
92916
|
+
return osHostname3().slice(0, 255);
|
|
92917
|
+
} catch {
|
|
92918
|
+
return "";
|
|
92919
|
+
}
|
|
92920
|
+
})();
|
|
92921
|
+
return {
|
|
92922
|
+
machineId: machineId(opts.configDir),
|
|
92923
|
+
hostname: host.length > 0 ? host : "unknown",
|
|
92924
|
+
directory: resolve24(root),
|
|
92925
|
+
repository: remote ? parseRemoteRepository(remote) : null,
|
|
92926
|
+
// `HEAD` is git's answer on a detached head.
|
|
92927
|
+
branch: branch && branch !== "HEAD" ? branch.slice(0, 255) : null,
|
|
92928
|
+
headCommit: head3 && COMMIT_SHA.test(head3) ? head3 : null,
|
|
92929
|
+
oxagenPresent: oxagenPresent(root),
|
|
92930
|
+
symlinks: symlinkState(root),
|
|
92931
|
+
pulledCommit: null,
|
|
92932
|
+
event: "init",
|
|
92933
|
+
cliVersion: cliVersion()
|
|
92934
|
+
};
|
|
92935
|
+
}
|
|
92936
|
+
async function reportWorkingCopy(opts) {
|
|
92937
|
+
try {
|
|
92938
|
+
const report = await probeWorkingCopy(opts);
|
|
92939
|
+
const recorded = await apiPostOrThrow(
|
|
92940
|
+
"working-copies",
|
|
92941
|
+
report,
|
|
92942
|
+
opts.scope,
|
|
92943
|
+
{ timeoutMs: REPORT_TIMEOUT_MS }
|
|
92944
|
+
);
|
|
92945
|
+
return {
|
|
92946
|
+
workingCopyId: recorded.workingCopyId,
|
|
92947
|
+
lastSeenAt: recorded.lastSeenAt
|
|
92948
|
+
};
|
|
92949
|
+
} catch (err2) {
|
|
92950
|
+
return { error: err2 instanceof Error ? err2.message : String(err2) };
|
|
92951
|
+
}
|
|
92952
|
+
}
|
|
92953
|
+
var GIT_TIMEOUT_MS2, REPORT_TIMEOUT_MS, MACHINE_ID_FILE, STELLA_LINKS, COMMIT_SHA;
|
|
92954
|
+
var init_working_copy = __esm({
|
|
92955
|
+
"src/lib/working-copy.ts"() {
|
|
92956
|
+
init_package();
|
|
92957
|
+
init_api();
|
|
92958
|
+
init_config();
|
|
92959
|
+
GIT_TIMEOUT_MS2 = 3e3;
|
|
92960
|
+
REPORT_TIMEOUT_MS = 8e3;
|
|
92961
|
+
MACHINE_ID_FILE = "machine-id";
|
|
92962
|
+
STELLA_LINKS = [
|
|
92963
|
+
".stella/rules",
|
|
92964
|
+
".stella/proposals",
|
|
92965
|
+
".stella/agents"
|
|
92966
|
+
];
|
|
92967
|
+
COMMIT_SHA = /^[0-9a-f]{7,64}$/;
|
|
92968
|
+
}
|
|
92969
|
+
});
|
|
92970
|
+
|
|
92971
|
+
// src/commands/agent-connect.ts
|
|
92972
|
+
var agent_connect_exports = {};
|
|
92973
|
+
__export(agent_connect_exports, {
|
|
92974
|
+
RequestRefused: () => RequestRefused,
|
|
92975
|
+
RequestUnreachable: () => RequestUnreachable,
|
|
92976
|
+
agentConnect: () => agentConnect
|
|
92977
|
+
});
|
|
92978
|
+
import { hostname, platform, release as release2 } from "node:os";
|
|
92979
|
+
async function post(apiUrl, path2, body2) {
|
|
92980
|
+
let response;
|
|
92981
|
+
try {
|
|
92982
|
+
response = await fetch(`${apiUrl.replace(/\/+$/, "")}${path2}`, {
|
|
92983
|
+
method: "POST",
|
|
92984
|
+
headers: { "content-type": "application/json" },
|
|
92985
|
+
body: JSON.stringify(body2),
|
|
92986
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
92987
|
+
});
|
|
92988
|
+
} catch (err2) {
|
|
92989
|
+
throw new RequestUnreachable(errorMessage3(err2));
|
|
92990
|
+
}
|
|
92991
|
+
const text6 = await response.text();
|
|
92992
|
+
let parsed2;
|
|
92993
|
+
try {
|
|
92994
|
+
parsed2 = text6.length === 0 ? {} : JSON.parse(text6);
|
|
92995
|
+
} catch {
|
|
92996
|
+
parsed2 = {};
|
|
92997
|
+
}
|
|
92998
|
+
if (!response.ok) {
|
|
92999
|
+
const error2 = parsed2.error;
|
|
93000
|
+
throw new RequestRefused(
|
|
93001
|
+
response.status,
|
|
93002
|
+
typeof error2?.reason === "string" ? error2.reason : void 0,
|
|
93003
|
+
typeof error2?.message === "string" ? error2.message : `Oxagen answered ${response.status}.`
|
|
93004
|
+
);
|
|
93005
|
+
}
|
|
93006
|
+
return parsed2;
|
|
93007
|
+
}
|
|
93008
|
+
function isPreview(value) {
|
|
93009
|
+
if (typeof value !== "object" || value === null) return false;
|
|
93010
|
+
const v = value;
|
|
93011
|
+
return typeof v["state"] === "string" && typeof v["connectedHere"] === "boolean" && typeof v["agent"] === "object" && typeof v["org"] === "object" && typeof v["workspace"] === "object";
|
|
93012
|
+
}
|
|
93013
|
+
async function defaultPreview(apiUrl, token, machineId2) {
|
|
93014
|
+
const answer = await post(apiUrl, "/v1/enrollment/request", {
|
|
93015
|
+
token,
|
|
93016
|
+
machineId: machineId2
|
|
93017
|
+
});
|
|
93018
|
+
if (!isPreview(answer))
|
|
93019
|
+
throw new RequestUnreachable("Oxagen's answer was not a request.");
|
|
93020
|
+
return answer;
|
|
93021
|
+
}
|
|
93022
|
+
async function defaultReject(apiUrl, token, code) {
|
|
93023
|
+
await post(apiUrl, "/v1/enrollment/request/reject", { token, code });
|
|
93024
|
+
}
|
|
93025
|
+
async function defaultEnroll(opts, writer) {
|
|
93026
|
+
const { defaultCliDeps: defaultCliDeps2, enroll: enroll2, oxagenRuntimeCommands: oxagenRuntimeCommands2 } = await Promise.resolve().then(() => (init_cli2(), cli_exports));
|
|
93027
|
+
const deps = {
|
|
93028
|
+
...defaultCliDeps2({
|
|
93029
|
+
out: (line) => writer.write(line),
|
|
93030
|
+
err: (line) => writer.writeErr(line),
|
|
93031
|
+
runtime: oxagenRuntimeCommands2()
|
|
93032
|
+
}),
|
|
93033
|
+
getuid: () => process.getuid?.()
|
|
93034
|
+
};
|
|
93035
|
+
const result2 = await enroll2(
|
|
93036
|
+
{
|
|
93037
|
+
enrollmentToken: opts.token,
|
|
93038
|
+
apiUrl: opts.apiUrl,
|
|
93039
|
+
harnesses: [opts.harness],
|
|
93040
|
+
machineId: opts.machineId
|
|
93041
|
+
},
|
|
93042
|
+
deps
|
|
93043
|
+
);
|
|
93044
|
+
return result2.ok && result2.shipping?.healthy !== false;
|
|
93045
|
+
}
|
|
93046
|
+
async function defaultConfirm(question) {
|
|
93047
|
+
const { createInterface: createInterface5 } = await import("node:readline/promises");
|
|
93048
|
+
const rl = createInterface5({ input: process.stdin, output: process.stdout });
|
|
93049
|
+
try {
|
|
93050
|
+
const answer = await rl.question(`${question} [y/N] `);
|
|
93051
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
93052
|
+
} finally {
|
|
93053
|
+
rl.close();
|
|
93054
|
+
}
|
|
93055
|
+
}
|
|
93056
|
+
function isDeviceHarness(harness) {
|
|
93057
|
+
return DEVICE_HARNESSES.includes(harness);
|
|
93058
|
+
}
|
|
93059
|
+
function closedMessage(state) {
|
|
93060
|
+
switch (state) {
|
|
93061
|
+
case "expired":
|
|
93062
|
+
return "This request expired. Create a new one on the page, then run the command it shows.";
|
|
93063
|
+
case "replaced":
|
|
93064
|
+
return "A newer request for this agent replaced this one. Run the command the page shows now.";
|
|
93065
|
+
case "type_changed":
|
|
93066
|
+
return "The agent's type changed after this request was made. Create a new request on the page.";
|
|
93067
|
+
default:
|
|
93068
|
+
return void 0;
|
|
93069
|
+
}
|
|
93070
|
+
}
|
|
93071
|
+
async function agentConnect(opts, writer = stdoutWriter, deps = {}) {
|
|
93072
|
+
const out = createOutput({ json: opts.json }, writer);
|
|
93073
|
+
const token = opts.request.trim();
|
|
93074
|
+
if (!REQUEST_TOKEN.test(token))
|
|
93075
|
+
return out.error(
|
|
93076
|
+
"That is not a connection request. Copy the whole command from the page, starting with oxagen agent connect.",
|
|
93077
|
+
"usage"
|
|
93078
|
+
);
|
|
93079
|
+
const apiUrl = opts.apiUrl ?? getApiUrl();
|
|
93080
|
+
const device = {
|
|
93081
|
+
hostname: (deps.hostname ?? hostname)(),
|
|
93082
|
+
platform: (deps.platform ?? platform)(),
|
|
93083
|
+
osVersion: (deps.osVersion ?? release2)(),
|
|
93084
|
+
machineId: (deps.machineId ?? (() => machineId()))()
|
|
93085
|
+
};
|
|
93086
|
+
const folder = opts.folder ?? (deps.cwd ?? (() => process.cwd()))();
|
|
93087
|
+
const reject = deps.reject ?? defaultReject;
|
|
93088
|
+
const refuse3 = async (code) => {
|
|
93089
|
+
try {
|
|
93090
|
+
await reject(apiUrl, token, code);
|
|
93091
|
+
} catch (err2) {
|
|
93092
|
+
out.warn(`Could not tell Oxagen why: ${errorMessage3(err2)}`);
|
|
93093
|
+
}
|
|
93094
|
+
};
|
|
93095
|
+
let preview;
|
|
93096
|
+
try {
|
|
93097
|
+
preview = await (deps.preview ?? defaultPreview)(
|
|
93098
|
+
apiUrl,
|
|
93099
|
+
token,
|
|
93100
|
+
device.machineId
|
|
93101
|
+
);
|
|
93102
|
+
} catch (err2) {
|
|
93103
|
+
if (err2 instanceof RequestRefused)
|
|
93104
|
+
return out.error(err2.message, err2.reason ?? "request_refused");
|
|
93105
|
+
return out.error(
|
|
93106
|
+
`Could not reach Oxagen at ${apiUrl}: ${errorMessage3(err2)}. Check this device's connection, then run the command again.`,
|
|
93107
|
+
"lost_connection"
|
|
93108
|
+
);
|
|
93109
|
+
}
|
|
93110
|
+
const ref = `${preview.org.slug}/${preview.workspace.slug}`;
|
|
93111
|
+
const label = isDeviceHarness(preview.agent.harness) ? harnessLabel(preview.agent.harness) : preview.agent.harness;
|
|
93112
|
+
if (preview.state === "connected") {
|
|
93113
|
+
if (!preview.connectedHere)
|
|
93114
|
+
return out.error(
|
|
93115
|
+
"Another device already answered this request. Create a new request on the page to connect this one.",
|
|
93116
|
+
"token_used"
|
|
93117
|
+
);
|
|
93118
|
+
if (out.isJson) {
|
|
93119
|
+
out.data({
|
|
93120
|
+
state: "connected",
|
|
93121
|
+
alreadyConnected: true,
|
|
93122
|
+
device,
|
|
93123
|
+
agent: preview.agent,
|
|
93124
|
+
workspace: ref
|
|
93125
|
+
});
|
|
93126
|
+
return;
|
|
93127
|
+
}
|
|
93128
|
+
writer.write(
|
|
93129
|
+
`${device.hostname} is already connected to ${ref} as ${preview.agent.name}. Nothing changed.`
|
|
93130
|
+
);
|
|
93131
|
+
return;
|
|
93132
|
+
}
|
|
93133
|
+
const closed2 = closedMessage(preview.state);
|
|
93134
|
+
if (closed2 !== void 0) return out.error(closed2, preview.state);
|
|
93135
|
+
if (!isDeviceHarness(preview.agent.harness)) {
|
|
93136
|
+
await refuse3("unsupported_type");
|
|
93137
|
+
return out.error(
|
|
93138
|
+
`A ${label} agent cannot run on a device. Pick Claude Code, Codex, Cursor, or Stella on the page.`,
|
|
93139
|
+
"unsupported_type"
|
|
93140
|
+
);
|
|
93141
|
+
}
|
|
93142
|
+
const harness = preview.agent.harness;
|
|
93143
|
+
let installed;
|
|
93144
|
+
try {
|
|
93145
|
+
installed = (await (deps.detect ?? detectHarnesses)()).find(
|
|
93146
|
+
(h) => h.harness === harness
|
|
93147
|
+
);
|
|
93148
|
+
} catch (err2) {
|
|
93149
|
+
return out.error(
|
|
93150
|
+
`Could not look for ${label} on this device: ${errorMessage3(err2)}`,
|
|
93151
|
+
"detect"
|
|
93152
|
+
);
|
|
93153
|
+
}
|
|
93154
|
+
if (installed === void 0) {
|
|
93155
|
+
await refuse3("adapter_missing");
|
|
93156
|
+
return out.error(
|
|
93157
|
+
`${label} is not installed on ${device.hostname}. Install it, then run the command again.`,
|
|
93158
|
+
"adapter_missing"
|
|
93159
|
+
);
|
|
93160
|
+
}
|
|
93161
|
+
const interactive = (deps.isTty ?? (() => process.stdin.isTTY === true))() && !out.isJson;
|
|
93162
|
+
const confirm = deps.confirm ?? defaultConfirm;
|
|
93163
|
+
const active2 = (deps.activeWorkspace ?? (() => {
|
|
93164
|
+
const org = getOrgId();
|
|
93165
|
+
const workspace = getWorkspaceId();
|
|
93166
|
+
return org && workspace ? `${org}/${workspace}` : void 0;
|
|
93167
|
+
}))();
|
|
93168
|
+
if (active2 !== void 0 && active2 !== ref && opts.yes !== true) {
|
|
93169
|
+
const proceed = interactive && await confirm(
|
|
93170
|
+
`This device works in ${active2}, and the request is for ${ref}. Connect it to ${ref} anyway?`
|
|
93171
|
+
);
|
|
93172
|
+
if (!proceed) {
|
|
93173
|
+
await refuse3("wrong_workspace");
|
|
93174
|
+
return out.error(
|
|
93175
|
+
`The request is for ${ref}, and this device works in ${active2}. Run \`oxagen workspace use ${ref}\`, then run this command again, or pass --yes to connect anyway.`,
|
|
93176
|
+
"wrong_workspace"
|
|
93177
|
+
);
|
|
93178
|
+
}
|
|
93179
|
+
}
|
|
93180
|
+
if (opts.yes !== true) {
|
|
93181
|
+
if (!interactive)
|
|
93182
|
+
return out.error(
|
|
93183
|
+
"Pass --yes to connect without a terminal to confirm in.",
|
|
93184
|
+
"usage"
|
|
93185
|
+
);
|
|
93186
|
+
const yes = await confirm(
|
|
93187
|
+
`Connect ${device.hostname} to ${preview.org.name} / ${preview.workspace.name} as ${preview.agent.name} (${label}), working in ${folder}?`
|
|
93188
|
+
);
|
|
93189
|
+
if (!yes) {
|
|
93190
|
+
await refuse3("declined");
|
|
93191
|
+
return out.error(
|
|
93192
|
+
"Nothing was connected. Run the command again when you are ready.",
|
|
93193
|
+
"declined"
|
|
93194
|
+
);
|
|
93195
|
+
}
|
|
93196
|
+
}
|
|
93197
|
+
const lines = [];
|
|
93198
|
+
const warnings = [];
|
|
93199
|
+
const captured = {
|
|
93200
|
+
write: (line) => void lines.push(line),
|
|
93201
|
+
writeErr: (line) => {
|
|
93202
|
+
lines.push(line);
|
|
93203
|
+
warnings.push(line);
|
|
93204
|
+
}
|
|
93205
|
+
};
|
|
93206
|
+
let ok;
|
|
93207
|
+
try {
|
|
93208
|
+
ok = await (deps.enroll ?? defaultEnroll)(
|
|
93209
|
+
{ apiUrl, token, harness, machineId: device.machineId },
|
|
93210
|
+
captured
|
|
93211
|
+
);
|
|
93212
|
+
} catch (err2) {
|
|
93213
|
+
lines.push(errorMessage3(err2));
|
|
93214
|
+
ok = false;
|
|
93215
|
+
}
|
|
93216
|
+
if (!ok) {
|
|
93217
|
+
for (const line of lines) if (line.trim() !== "") writer.writeErr(line);
|
|
93218
|
+
return out.error(
|
|
93219
|
+
`${device.hostname} could not connect to ${ref}. The lines above say why.`,
|
|
93220
|
+
"enroll"
|
|
93221
|
+
);
|
|
93222
|
+
}
|
|
93223
|
+
if (out.isJson) {
|
|
93224
|
+
out.data({
|
|
93225
|
+
state: "connected",
|
|
93226
|
+
alreadyConnected: false,
|
|
93227
|
+
device,
|
|
93228
|
+
agent: preview.agent,
|
|
93229
|
+
workspace: ref,
|
|
93230
|
+
adapter: { harness, path: installed.path },
|
|
93231
|
+
folder
|
|
93232
|
+
});
|
|
93233
|
+
return;
|
|
93234
|
+
}
|
|
93235
|
+
writer.write(
|
|
93236
|
+
`Connected ${device.hostname} to ${ref} as ${preview.agent.name}.`
|
|
93237
|
+
);
|
|
93238
|
+
writer.write(
|
|
93239
|
+
` Device: ${device.hostname} (${device.platform} ${device.osVersion})`
|
|
93240
|
+
);
|
|
93241
|
+
writer.write(` Machine id: ${device.machineId}`);
|
|
93242
|
+
writer.write(` Agent type: ${label}, at ${installed.path}`);
|
|
93243
|
+
writer.write(` Working folder: ${folder}`);
|
|
93244
|
+
for (const line of warnings)
|
|
93245
|
+
if (line.trim() !== "") writer.writeErr(` ${line}`);
|
|
93246
|
+
writer.write("The page shows this device now.");
|
|
93247
|
+
}
|
|
93248
|
+
var REQUEST_TOKEN, DEVICE_HARNESSES, REQUEST_TIMEOUT_MS, RequestUnreachable, RequestRefused;
|
|
93249
|
+
var init_agent_connect = __esm({
|
|
93250
|
+
"src/commands/agent-connect.ts"() {
|
|
93251
|
+
init_capture_writer();
|
|
93252
|
+
init_config();
|
|
93253
|
+
init_harnesses();
|
|
93254
|
+
init_output();
|
|
93255
|
+
init_working_copy();
|
|
93256
|
+
REQUEST_TOKEN = /^oxe_1time_[0-9a-hjkmnp-tv-z]{26}$/;
|
|
93257
|
+
DEVICE_HARNESSES = [
|
|
93258
|
+
"claude-code",
|
|
93259
|
+
"codex",
|
|
93260
|
+
"cursor",
|
|
93261
|
+
"stella"
|
|
93262
|
+
];
|
|
93263
|
+
REQUEST_TIMEOUT_MS = 15e3;
|
|
93264
|
+
RequestUnreachable = class extends Error {
|
|
93265
|
+
};
|
|
93266
|
+
RequestRefused = class extends Error {
|
|
93267
|
+
constructor(status2, reason3, message2) {
|
|
93268
|
+
super(message2);
|
|
93269
|
+
this.status = status2;
|
|
93270
|
+
this.reason = reason3;
|
|
93271
|
+
}
|
|
93272
|
+
status;
|
|
93273
|
+
reason;
|
|
93274
|
+
};
|
|
93275
|
+
}
|
|
93276
|
+
});
|
|
93277
|
+
|
|
92781
93278
|
// src/commands/agent-enroll.ts
|
|
92782
93279
|
var agent_enroll_exports = {};
|
|
92783
93280
|
__export(agent_enroll_exports, {
|
|
@@ -92828,7 +93325,7 @@ var machine_register_exports = {};
|
|
|
92828
93325
|
__export(machine_register_exports, {
|
|
92829
93326
|
machineRegister: () => machineRegister
|
|
92830
93327
|
});
|
|
92831
|
-
import { hostname } from "node:os";
|
|
93328
|
+
import { hostname as hostname2 } from "node:os";
|
|
92832
93329
|
function isMachineHarness(name2) {
|
|
92833
93330
|
return Object.keys(MACHINE_HARNESSES).includes(name2);
|
|
92834
93331
|
}
|
|
@@ -92860,7 +93357,7 @@ async function machineRegister(opts, writer = stdoutWriter, deps = {}) {
|
|
|
92860
93357
|
);
|
|
92861
93358
|
return refused2;
|
|
92862
93359
|
}
|
|
92863
|
-
const machineName = (opts.machineName ?? (deps.hostname ??
|
|
93360
|
+
const machineName = (opts.machineName ?? (deps.hostname ?? hostname2)()).trim();
|
|
92864
93361
|
if (machineName === "") {
|
|
92865
93362
|
out.error(
|
|
92866
93363
|
opts.machineName === void 0 ? "This machine reports no host name. Pass --machine-name <name>." : "--machine-name is empty. Pass the machine's host name.",
|
|
@@ -93152,7 +93649,7 @@ __export(workspace_exports, {
|
|
|
93152
93649
|
workspaceList: () => workspaceList,
|
|
93153
93650
|
workspaceUse: () => workspaceUse
|
|
93154
93651
|
});
|
|
93155
|
-
import { hostname as
|
|
93652
|
+
import { hostname as hostname3 } from "node:os";
|
|
93156
93653
|
function holdsHarness(enrollment, harness) {
|
|
93157
93654
|
return enrollment.harnesses.includes(harness);
|
|
93158
93655
|
}
|
|
@@ -93451,7 +93948,7 @@ async function workspaceConnect(argument, opts, writer = stdoutWriter, deps = {}
|
|
|
93451
93948
|
if (!await lookupWorkspace(target, out)) return;
|
|
93452
93949
|
const harnesses = await harnessesToConnect(opts, ref, interactive, deps, out);
|
|
93453
93950
|
if (!harnesses) return;
|
|
93454
|
-
const machineName = (opts.machineName ?? (deps.hostname ??
|
|
93951
|
+
const machineName = (opts.machineName ?? (deps.hostname ?? hostname3)()).trim();
|
|
93455
93952
|
const enrollments = await enrollmentsOrWarn(deps, out);
|
|
93456
93953
|
const register = deps.register ?? ((o, w) => machineRegister(o, w));
|
|
93457
93954
|
const results = [];
|
|
@@ -101337,7 +101834,7 @@ var init_json_text = __esm({
|
|
|
101337
101834
|
});
|
|
101338
101835
|
|
|
101339
101836
|
// ../../packages/run-evidence/src/digest.ts
|
|
101340
|
-
import { createHash as
|
|
101837
|
+
import { createHash as createHash28 } from "node:crypto";
|
|
101341
101838
|
function intrinsicHashMethod(name2) {
|
|
101342
101839
|
const method = Object.getOwnPropertyDescriptor(
|
|
101343
101840
|
intrinsicHashPrototype,
|
|
@@ -101360,7 +101857,7 @@ function sha256Digest(bytes) {
|
|
|
101360
101857
|
if (!(bytes instanceof intrinsicUint8ArrayConstructor)) {
|
|
101361
101858
|
throw new TypeError("sha256Digest requires exact bytes");
|
|
101362
101859
|
}
|
|
101363
|
-
const hash4 =
|
|
101860
|
+
const hash4 = createHash28("sha256");
|
|
101364
101861
|
Reflect.apply(intrinsicHashUpdate, hash4, [bytes]);
|
|
101365
101862
|
const hex = Reflect.apply(intrinsicHashDigest, hash4, ["hex"]);
|
|
101366
101863
|
return `sha256:${hex}`;
|
|
@@ -101379,7 +101876,7 @@ var init_digest3 = __esm({
|
|
|
101379
101876
|
intrinsicTextEncoderEncode = TextEncoder.prototype.encode;
|
|
101380
101877
|
intrinsicUint8ArrayConstructor = Uint8Array;
|
|
101381
101878
|
intrinsicHashPrototype = Object.getPrototypeOf(
|
|
101382
|
-
|
|
101879
|
+
createHash28("sha256")
|
|
101383
101880
|
);
|
|
101384
101881
|
intrinsicHashUpdate = intrinsicHashMethod("update");
|
|
101385
101882
|
intrinsicHashDigest = intrinsicHashMethod("digest");
|
|
@@ -106703,6 +107200,17 @@ function isHighEntropyBlob(token) {
|
|
|
106703
107200
|
if (!/^[A-Za-z0-9_\-+~]+$/.test(token)) return false;
|
|
106704
107201
|
return /[A-Z]/.test(token) && /[a-z]/.test(token) && /[0-9]/.test(token);
|
|
106705
107202
|
}
|
|
107203
|
+
function isVendorToken(token) {
|
|
107204
|
+
if (VENDOR_FORMATS.some((format) => format.test(token))) return true;
|
|
107205
|
+
return SECRET_PREFIXES.some((p) => {
|
|
107206
|
+
if (!token.startsWith(p)) return false;
|
|
107207
|
+
const tail = token.slice(p.length);
|
|
107208
|
+
return tail.length >= 16 && /[0-9]/.test(tail);
|
|
107209
|
+
});
|
|
107210
|
+
}
|
|
107211
|
+
function hasCredentialPiece(token) {
|
|
107212
|
+
return token.split(TOKEN_PIECES).some((piece) => isVendorToken(piece) || isJwt(piece));
|
|
107213
|
+
}
|
|
106706
107214
|
function isSecretToken(token) {
|
|
106707
107215
|
if (token.length < 8) return false;
|
|
106708
107216
|
if (SECRET_PREFIXES.some(
|
|
@@ -106731,7 +107239,7 @@ function findSecretsAndPii(text6) {
|
|
|
106731
107239
|
if (/-----BEGIN [A-Z ]*PRIVATE KEY-----/.test(text6))
|
|
106732
107240
|
findings.push("private key block");
|
|
106733
107241
|
for (const token of text6.match(TOKEN2) ?? []) {
|
|
106734
|
-
if (isSecretToken(token)) {
|
|
107242
|
+
if (isSecretToken(token) || hasCredentialPiece(token)) {
|
|
106735
107243
|
findings.push("credential token");
|
|
106736
107244
|
break;
|
|
106737
107245
|
}
|
|
@@ -106757,7 +107265,7 @@ function findSecretsAndPii(text6) {
|
|
|
106757
107265
|
}
|
|
106758
107266
|
return findings;
|
|
106759
107267
|
}
|
|
106760
|
-
var SECRET_PREFIXES, SENSITIVE_KEY_MARKERS, TOKEN2;
|
|
107268
|
+
var SECRET_PREFIXES, SENSITIVE_KEY_MARKERS, TOKEN2, TOKEN_PIECES, VENDOR_FORMATS;
|
|
106761
107269
|
var init_secrets2 = __esm({
|
|
106762
107270
|
"../../packages/steering-check/src/secrets.ts"() {
|
|
106763
107271
|
"use strict";
|
|
@@ -106809,6 +107317,23 @@ var init_secrets2 = __esm({
|
|
|
106809
107317
|
"client_secret"
|
|
106810
107318
|
];
|
|
106811
107319
|
TOKEN2 = /[A-Za-z0-9_\-./+~]+/g;
|
|
107320
|
+
TOKEN_PIECES = /\//;
|
|
107321
|
+
VENDOR_FORMATS = [
|
|
107322
|
+
// AWS access key ids.
|
|
107323
|
+
/^(?:AKIA|ASIA)[A-Z0-9]{16}(?![A-Za-z0-9])/,
|
|
107324
|
+
// GitHub classic tokens and fine-grained personal access tokens.
|
|
107325
|
+
/^gh[pousr]_[A-Za-z0-9]{36}(?![A-Za-z0-9])/,
|
|
107326
|
+
/^github_pat_[A-Za-z0-9_]{22,}/,
|
|
107327
|
+
// GitLab personal access tokens.
|
|
107328
|
+
/^glpat-[A-Za-z0-9_-]{20}(?![A-Za-z0-9_-])/,
|
|
107329
|
+
// Slack tokens.
|
|
107330
|
+
/^xox[abposr]-[A-Za-z0-9-]{10,}/,
|
|
107331
|
+
// Stripe live secret and restricted keys.
|
|
107332
|
+
/^(?:sk|rk)_live_[A-Za-z0-9]{16,}/,
|
|
107333
|
+
// Anthropic and OpenAI project keys.
|
|
107334
|
+
/^sk-ant-[A-Za-z0-9_-]{20,}/,
|
|
107335
|
+
/^sk-proj-[A-Za-z0-9_-]{20,}/
|
|
107336
|
+
];
|
|
106812
107337
|
}
|
|
106813
107338
|
});
|
|
106814
107339
|
|
|
@@ -107450,8 +107975,8 @@ import {
|
|
|
107450
107975
|
dirname as dirname35,
|
|
107451
107976
|
isAbsolute as isAbsolute18,
|
|
107452
107977
|
relative as relative8,
|
|
107453
|
-
resolve as
|
|
107454
|
-
sep as
|
|
107978
|
+
resolve as resolve25,
|
|
107979
|
+
sep as sep11
|
|
107455
107980
|
} from "node:path";
|
|
107456
107981
|
function inside(rel) {
|
|
107457
107982
|
return rel !== "" && !rel.startsWith("..") && !isAbsolute18(rel);
|
|
@@ -107459,9 +107984,9 @@ function inside(rel) {
|
|
|
107459
107984
|
function importFilename(path2, folder) {
|
|
107460
107985
|
let rel = relative8(process.cwd(), path2);
|
|
107461
107986
|
if (!inside(rel) && folder !== void 0) {
|
|
107462
|
-
rel = relative8(dirname35(
|
|
107987
|
+
rel = relative8(dirname35(resolve25(folder)), resolve25(path2));
|
|
107463
107988
|
}
|
|
107464
|
-
const name2 = inside(rel) ? rel.split(
|
|
107989
|
+
const name2 = inside(rel) ? rel.split(sep11).join("/") : basename10(path2);
|
|
107465
107990
|
return name2.length > 256 ? basename10(path2).slice(-256) : name2;
|
|
107466
107991
|
}
|
|
107467
107992
|
async function readImportDocuments(sources, target, writer) {
|
|
@@ -107753,43 +108278,43 @@ __export(steering_import_exports, {
|
|
|
107753
108278
|
harnessHome: () => harnessHome
|
|
107754
108279
|
});
|
|
107755
108280
|
import { readdir as readdir5, realpath as realpath3, stat as stat5 } from "node:fs/promises";
|
|
107756
|
-
import { homedir as
|
|
107757
|
-
import { basename as basename11, extname, join as
|
|
108281
|
+
import { homedir as homedir13 } from "node:os";
|
|
108282
|
+
import { basename as basename11, extname, join as join67, relative as relative9, sep as sep12 } from "node:path";
|
|
107758
108283
|
function envDir2(env, key) {
|
|
107759
108284
|
const value = env[key];
|
|
107760
108285
|
return value === void 0 || value.trim() === "" ? null : value;
|
|
107761
108286
|
}
|
|
107762
|
-
function harnessHome(harness, env = process.env, home =
|
|
108287
|
+
function harnessHome(harness, env = process.env, home = homedir13()) {
|
|
107763
108288
|
switch (harness) {
|
|
107764
108289
|
case "claude-code": {
|
|
107765
|
-
const config2 = envDir2(env, "CLAUDE_CONFIG_DIR") ??
|
|
108290
|
+
const config2 = envDir2(env, "CLAUDE_CONFIG_DIR") ?? join67(home, ".claude");
|
|
107766
108291
|
return {
|
|
107767
108292
|
harness,
|
|
107768
108293
|
folders: [
|
|
107769
108294
|
{
|
|
107770
|
-
dir: skillsRoot("claude-code", env, home) ??
|
|
108295
|
+
dir: skillsRoot("claude-code", env, home) ?? join67(config2, "skills"),
|
|
107771
108296
|
mount: ".claude/skills"
|
|
107772
108297
|
},
|
|
107773
|
-
{ dir:
|
|
107774
|
-
{ dir:
|
|
108298
|
+
{ dir: join67(config2, "commands"), mount: ".claude/commands" },
|
|
108299
|
+
{ dir: join67(config2, "agents"), mount: ".claude/agents" }
|
|
107775
108300
|
],
|
|
107776
108301
|
instructions: [
|
|
107777
|
-
{ file:
|
|
108302
|
+
{ file: join67(config2, "CLAUDE.md"), filename: ".claude/CLAUDE.md" }
|
|
107778
108303
|
]
|
|
107779
108304
|
};
|
|
107780
108305
|
}
|
|
107781
108306
|
case "codex": {
|
|
107782
|
-
const codexHome = envDir2(env, "CODEX_HOME") ??
|
|
108307
|
+
const codexHome = envDir2(env, "CODEX_HOME") ?? join67(home, ".codex");
|
|
107783
108308
|
return {
|
|
107784
108309
|
harness,
|
|
107785
108310
|
folders: [
|
|
107786
108311
|
{
|
|
107787
|
-
dir: skillsRoot("codex", env, home) ??
|
|
108312
|
+
dir: skillsRoot("codex", env, home) ?? join67(home, ".agents", "skills"),
|
|
107788
108313
|
mount: ".agents/skills"
|
|
107789
108314
|
}
|
|
107790
108315
|
],
|
|
107791
108316
|
instructions: ["AGENTS.override.md", "AGENTS.md"].map((name2) => ({
|
|
107792
|
-
file:
|
|
108317
|
+
file: join67(codexHome, name2),
|
|
107793
108318
|
filename: `.codex/${name2}`
|
|
107794
108319
|
}))
|
|
107795
108320
|
};
|
|
@@ -107798,8 +108323,8 @@ function harnessHome(harness, env = process.env, home = homedir12()) {
|
|
|
107798
108323
|
return {
|
|
107799
108324
|
harness,
|
|
107800
108325
|
folders: [
|
|
107801
|
-
{ dir:
|
|
107802
|
-
{ dir:
|
|
108326
|
+
{ dir: join67(home, ".cursor", "skills"), mount: ".cursor/skills" },
|
|
108327
|
+
{ dir: join67(home, ".cursor", "commands"), mount: ".cursor/commands" }
|
|
107803
108328
|
],
|
|
107804
108329
|
instructions: []
|
|
107805
108330
|
};
|
|
@@ -107809,7 +108334,7 @@ function byName(a, b3) {
|
|
|
107809
108334
|
return a.name < b3.name ? -1 : 1;
|
|
107810
108335
|
}
|
|
107811
108336
|
function under(root, path2) {
|
|
107812
|
-
return relative9(root, path2).split(
|
|
108337
|
+
return relative9(root, path2).split(sep12).join("/");
|
|
107813
108338
|
}
|
|
107814
108339
|
function isPersonal(rel) {
|
|
107815
108340
|
return classifyHarnessFile(rel)?.kind === "personal";
|
|
@@ -107845,7 +108370,7 @@ async function findMarkdownFiles(paths, harness) {
|
|
|
107845
108370
|
}
|
|
107846
108371
|
const found = [];
|
|
107847
108372
|
for (const entry2 of entries2.sort(byName)) {
|
|
107848
|
-
const path2 =
|
|
108373
|
+
const path2 = join67(dir, entry2.name);
|
|
107849
108374
|
if (entry2.isDirectory()) {
|
|
107850
108375
|
if (!entry2.name.startsWith(".") && entry2.name !== "node_modules")
|
|
107851
108376
|
found.push(...await filesUnder(path2, from));
|
|
@@ -107867,7 +108392,7 @@ async function findMarkdownFiles(paths, harness) {
|
|
|
107867
108392
|
const { folder } = frame2;
|
|
107868
108393
|
const named = (rel) => frame2.fixedNames ? { filename: rel } : {};
|
|
107869
108394
|
for (const entry2 of entries2) {
|
|
107870
|
-
const path2 =
|
|
108395
|
+
const path2 = join67(dir, entry2.name);
|
|
107871
108396
|
const rel = frame2.relOf(path2);
|
|
107872
108397
|
if (entry2.isDirectory()) {
|
|
107873
108398
|
if (entry2.name === "node_modules") continue;
|
|
@@ -107926,7 +108451,7 @@ async function findMarkdownFiles(paths, harness) {
|
|
|
107926
108451
|
}
|
|
107927
108452
|
if (folderGiven) {
|
|
107928
108453
|
const catalogue = CATALOGUE_FOLDERS.has(basename11(path2));
|
|
107929
|
-
const root = catalogue ?
|
|
108454
|
+
const root = catalogue ? join67(path2, "..") : path2;
|
|
107930
108455
|
await walk2(path2, {
|
|
107931
108456
|
relOf: (p) => under(root, p),
|
|
107932
108457
|
folder: path2,
|
|
@@ -107987,7 +108512,7 @@ function parseTarget(value, writer) {
|
|
|
107987
108512
|
writer
|
|
107988
108513
|
);
|
|
107989
108514
|
}
|
|
107990
|
-
async function handleSteeringImport(paths, opts, writer = stdoutWriter, env = process.env, home =
|
|
108515
|
+
async function handleSteeringImport(paths, opts, writer = stdoutWriter, env = process.env, home = homedir13()) {
|
|
107991
108516
|
const harness = parseHarness(opts.harness, writer);
|
|
107992
108517
|
if (paths.length === 0 && harness === void 0) {
|
|
107993
108518
|
failCommand(
|
|
@@ -108991,9 +109516,9 @@ __export(run_exports, {
|
|
|
108991
109516
|
runTurns: () => runTurns,
|
|
108992
109517
|
writeColumns: () => writeColumns
|
|
108993
109518
|
});
|
|
108994
|
-
import { createHash as
|
|
109519
|
+
import { createHash as createHash29 } from "node:crypto";
|
|
108995
109520
|
import { createWriteStream, renameSync as renameSync8, rmSync as rmSync13 } from "node:fs";
|
|
108996
|
-
import { resolve as
|
|
109521
|
+
import { resolve as resolve26 } from "node:path";
|
|
108997
109522
|
import { Readable as Readable2 } from "node:stream";
|
|
108998
109523
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
108999
109524
|
async function runExport(runId, opts = {}, writer = stdoutWriter) {
|
|
@@ -109091,9 +109616,9 @@ async function runDownload(exportId, opts = {}, writer = stdoutWriter) {
|
|
|
109091
109616
|
return;
|
|
109092
109617
|
}
|
|
109093
109618
|
const url2 = resolveDownloadUrl(status2.download.url, getApiUrl());
|
|
109094
|
-
const path2 =
|
|
109619
|
+
const path2 = resolve26(opts.out ?? `${status2.runId}-${exportId}.zip`);
|
|
109095
109620
|
const partial2 = `${path2}.${process.pid}.partial`;
|
|
109096
|
-
const hash4 =
|
|
109621
|
+
const hash4 = createHash29("sha256");
|
|
109097
109622
|
let size = 0;
|
|
109098
109623
|
let headerDigest;
|
|
109099
109624
|
const controller = new AbortController();
|
|
@@ -109938,14 +110463,21 @@ __export(credentials_exports, {
|
|
|
109938
110463
|
LOGIN_HARNESSES: () => LOGIN_HARNESSES,
|
|
109939
110464
|
PROVIDERS: () => PROVIDERS,
|
|
109940
110465
|
SecretAborted: () => SecretAborted,
|
|
109941
|
-
|
|
109942
|
-
|
|
110466
|
+
createBodyOf: () => createBodyOf,
|
|
110467
|
+
createSetupTokenHider: () => createSetupTokenHider,
|
|
110468
|
+
credentialsCreate: () => credentialsCreate,
|
|
109943
110469
|
credentialsList: () => credentialsList,
|
|
109944
110470
|
credentialsRemove: () => credentialsRemove,
|
|
109945
110471
|
credentialsRotate: () => credentialsRotate,
|
|
109946
110472
|
credentialsUpdate: () => credentialsUpdate,
|
|
109947
|
-
|
|
110473
|
+
hideSetupToken: () => hideSetupToken,
|
|
110474
|
+
readCodexAuthFile: () => readCodexAuthFile,
|
|
110475
|
+
readSecret: () => readSecret,
|
|
110476
|
+
runHarnessLogin: () => runHarnessLogin
|
|
109948
110477
|
});
|
|
110478
|
+
import { spawn as spawn8 } from "node:child_process";
|
|
110479
|
+
import { homedir as homedir14 } from "node:os";
|
|
110480
|
+
import { join as join68 } from "node:path";
|
|
109949
110481
|
function sharedBody(opts) {
|
|
109950
110482
|
return opts.shared ? { scope: "workspace" } : {};
|
|
109951
110483
|
}
|
|
@@ -110004,22 +110536,22 @@ function scopeFor(opts) {
|
|
|
110004
110536
|
const ws = namedWorkspace(opts.workspaceSlug) ?? getWorkspaceId();
|
|
110005
110537
|
if (!ws) {
|
|
110006
110538
|
return {
|
|
110007
|
-
error: "
|
|
110539
|
+
error: opts.shared ? "A workspace account belongs to one workspace. Run `oxagen workspace use <org/workspace>` to choose it, or name one with --workspace-slug <slug> or OXAGEN_WORKSPACE." : "Your credentials belong to you, not to a workspace, but the API still addresses them through one. Run `oxagen workspace use <org/workspace>` to choose the workspace this call goes through, or name one with --workspace-slug <slug> or OXAGEN_WORKSPACE."
|
|
110008
110540
|
};
|
|
110009
110541
|
}
|
|
110010
110542
|
const org = getOrgId();
|
|
110011
110543
|
if (!org) return { error: NO_ORG };
|
|
110012
110544
|
return { org, ws };
|
|
110013
110545
|
}
|
|
110014
|
-
function
|
|
110015
|
-
const
|
|
110546
|
+
function createBodyOf(opts) {
|
|
110547
|
+
const harness = opts.harness;
|
|
110548
|
+
const type = opts.type ?? (harness !== void 0 ? "subscription" : "api-key");
|
|
110016
110549
|
if (!(type in AUTH_TYPES)) {
|
|
110017
110550
|
return {
|
|
110018
110551
|
error: `Pass --type with one of: ${Object.keys(AUTH_TYPES).join(", ")}.`
|
|
110019
110552
|
};
|
|
110020
110553
|
}
|
|
110021
110554
|
const authType = AUTH_TYPES[type];
|
|
110022
|
-
const harness = opts.harness;
|
|
110023
110555
|
if (harness !== void 0 && !LOGIN_HARNESSES.includes(harness)) {
|
|
110024
110556
|
return {
|
|
110025
110557
|
error: harness === "cursor" ? "Cursor's model calls do not pass through the gateway, so Oxagen cannot use a Cursor login." : `Pass --harness with one of: ${LOGIN_HARNESSES.join(", ")}.`
|
|
@@ -110027,7 +110559,7 @@ function addBodyOf(opts) {
|
|
|
110027
110559
|
}
|
|
110028
110560
|
if (opts.baseUrl !== void 0 && opts.provider !== CUSTOM_ENDPOINT_PROVIDER) {
|
|
110029
110561
|
return {
|
|
110030
|
-
error: `Only --provider ${CUSTOM_ENDPOINT_PROVIDER} takes --base-url. Anthropic and
|
|
110562
|
+
error: `Only --provider ${CUSTOM_ENDPOINT_PROVIDER} takes --base-url. Anthropic, OpenAI, and OpenRouter keys use the vendor's own endpoint.`
|
|
110031
110563
|
};
|
|
110032
110564
|
}
|
|
110033
110565
|
if (authType === "subscription_token") {
|
|
@@ -110052,7 +110584,9 @@ function addBodyOf(opts) {
|
|
|
110052
110584
|
}
|
|
110053
110585
|
const provider = opts.provider;
|
|
110054
110586
|
if (!provider || !PROVIDERS.includes(provider)) {
|
|
110055
|
-
return {
|
|
110587
|
+
return {
|
|
110588
|
+
error: `Pass --provider with one of: ${PROVIDERS.join(", ")} to save a key, or --harness with one of: ${LOGIN_HARNESSES.join(", ")} to save a login.`
|
|
110589
|
+
};
|
|
110056
110590
|
}
|
|
110057
110591
|
if (provider === CUSTOM_ENDPOINT_PROVIDER) {
|
|
110058
110592
|
const baseUrl = opts.baseUrl?.trim();
|
|
@@ -110079,26 +110613,178 @@ function addBodyOf(opts) {
|
|
|
110079
110613
|
...opts.label ? { label: opts.label } : {}
|
|
110080
110614
|
};
|
|
110081
110615
|
}
|
|
110082
|
-
|
|
110616
|
+
function hideSetupToken(chunk) {
|
|
110617
|
+
return chunk.replace(SETUP_TOKEN_ON_SCREEN, "sk-ant-oat\u2026 (sent to Oxagen)");
|
|
110618
|
+
}
|
|
110619
|
+
function createSetupTokenHider(write) {
|
|
110620
|
+
let held = "";
|
|
110621
|
+
return {
|
|
110622
|
+
push(chunk) {
|
|
110623
|
+
const text6 = held + chunk;
|
|
110624
|
+
const tail = SETUP_TOKEN_TAIL.exec(text6);
|
|
110625
|
+
const cut = tail === null ? text6.length : tail.index;
|
|
110626
|
+
held = text6.slice(cut);
|
|
110627
|
+
if (cut > 0) write(hideSetupToken(text6.slice(0, cut)));
|
|
110628
|
+
},
|
|
110629
|
+
end() {
|
|
110630
|
+
if (held !== "") write(hideSetupToken(held));
|
|
110631
|
+
held = "";
|
|
110632
|
+
}
|
|
110633
|
+
};
|
|
110634
|
+
}
|
|
110635
|
+
function spawnCodexLogin(codex) {
|
|
110636
|
+
return new Promise((resolve29, reject) => {
|
|
110637
|
+
const child = spawn8(codex, ["login"], {
|
|
110638
|
+
stdio: ["inherit", 2, "inherit"],
|
|
110639
|
+
env: process.env
|
|
110640
|
+
});
|
|
110641
|
+
child.on("error", reject);
|
|
110642
|
+
child.on("close", (code) => resolve29(code ?? 1));
|
|
110643
|
+
});
|
|
110644
|
+
}
|
|
110645
|
+
async function runHarnessLogin(harness) {
|
|
110646
|
+
const host = await Promise.resolve().then(() => (init_host(), host_exports));
|
|
110647
|
+
if (harness === "claude-code") {
|
|
110648
|
+
const claude = host.findClaudeBinary(process.env, homedir14());
|
|
110649
|
+
if (claude === void 0) return { found: false };
|
|
110650
|
+
const screen = createSetupTokenHider((text6) => {
|
|
110651
|
+
process.stderr.write(text6);
|
|
110652
|
+
});
|
|
110653
|
+
const run3 = await host.runClaudeSetupToken({
|
|
110654
|
+
claude,
|
|
110655
|
+
interactive: true,
|
|
110656
|
+
write: screen.push
|
|
110657
|
+
});
|
|
110658
|
+
screen.end();
|
|
110659
|
+
return { found: true, code: run3.code, token: run3.token };
|
|
110660
|
+
}
|
|
110661
|
+
const codex = host.findHarnessBinary("codex", process.env, homedir14());
|
|
110662
|
+
if (codex === void 0) return { found: false };
|
|
110663
|
+
return { found: true, code: await spawnCodexLogin(codex), token: void 0 };
|
|
110664
|
+
}
|
|
110665
|
+
async function readCodexAuthFile() {
|
|
110666
|
+
const host = await Promise.resolve().then(() => (init_host(), host_exports));
|
|
110667
|
+
const path2 = join68(host.codexHomeFor(process.env, homedir14()), "auth.json");
|
|
110668
|
+
return { path: path2, text: host.readTextIfExists(path2) };
|
|
110669
|
+
}
|
|
110670
|
+
function keyFlagOf(key) {
|
|
110671
|
+
if (key === void 0) return { kind: "none" };
|
|
110672
|
+
const value = key.trim();
|
|
110673
|
+
if (value === "-") return { kind: "stdin" };
|
|
110674
|
+
if (value === "") {
|
|
110675
|
+
return {
|
|
110676
|
+
error: "--key needs the key, or - to read it from standard input."
|
|
110677
|
+
};
|
|
110678
|
+
}
|
|
110679
|
+
return { kind: "literal", value };
|
|
110680
|
+
}
|
|
110681
|
+
function whatOf(body2) {
|
|
110682
|
+
if (body2.authType === "subscription_token") return `${body2.harness} login`;
|
|
110683
|
+
if (body2.baseUrl !== void 0) return `key for ${body2.baseUrl}`;
|
|
110684
|
+
return `${body2.provider} credential`;
|
|
110685
|
+
}
|
|
110686
|
+
async function claudeLogin(out, read2, deps) {
|
|
110687
|
+
out.info("Running `claude setup-token`. Finish the sign-in in your browser.");
|
|
110688
|
+
const run3 = await (deps.runLogin ?? runHarnessLogin)("claude-code");
|
|
110689
|
+
if (!run3.found) {
|
|
110690
|
+
return {
|
|
110691
|
+
failure: "Claude Code is not installed, so `claude setup-token` cannot run. Install it, or pipe the token in: oxagen credentials create --harness claude-code --key -",
|
|
110692
|
+
code: "login"
|
|
110693
|
+
};
|
|
110694
|
+
}
|
|
110695
|
+
if (run3.code !== 0) {
|
|
110696
|
+
return {
|
|
110697
|
+
failure: `\`claude setup-token\` exited with ${run3.code}. Nothing was saved.`,
|
|
110698
|
+
code: "login"
|
|
110699
|
+
};
|
|
110700
|
+
}
|
|
110701
|
+
if (run3.token !== void 0) return { secret: run3.token };
|
|
110702
|
+
out.info(
|
|
110703
|
+
"The sign-in finished, but Oxagen could not read the token off its screen."
|
|
110704
|
+
);
|
|
110705
|
+
return { secret: await read2("Paste the token `claude setup-token` printed") };
|
|
110706
|
+
}
|
|
110707
|
+
async function codexLogin2(out, deps) {
|
|
110708
|
+
const readFile8 = deps.readCodexAuth ?? readCodexAuthFile;
|
|
110709
|
+
const saved = await readFile8();
|
|
110710
|
+
if (saved.text !== void 0) {
|
|
110711
|
+
out.info(`Using the Codex login in ${saved.path}.`);
|
|
110712
|
+
return { secret: saved.text.trim() };
|
|
110713
|
+
}
|
|
110714
|
+
out.info("Running `codex login`. Finish the sign-in in your browser.");
|
|
110715
|
+
const run3 = await (deps.runLogin ?? runHarnessLogin)("codex");
|
|
110716
|
+
if (!run3.found) {
|
|
110717
|
+
return {
|
|
110718
|
+
failure: `Codex is not installed, so \`codex login\` cannot run. Install it, or pipe a login in: ${CODEX_PIPE}`,
|
|
110719
|
+
code: "login"
|
|
110720
|
+
};
|
|
110721
|
+
}
|
|
110722
|
+
if (run3.code !== 0) {
|
|
110723
|
+
return {
|
|
110724
|
+
failure: `\`codex login\` exited with ${run3.code}. Nothing was saved.`,
|
|
110725
|
+
code: "login"
|
|
110726
|
+
};
|
|
110727
|
+
}
|
|
110728
|
+
const made = await readFile8();
|
|
110729
|
+
if (made.text === void 0) {
|
|
110730
|
+
return {
|
|
110731
|
+
failure: `\`codex login\` finished, but ${made.path} does not exist. Nothing was saved.`,
|
|
110732
|
+
code: "login"
|
|
110733
|
+
};
|
|
110734
|
+
}
|
|
110735
|
+
return { secret: made.text.trim() };
|
|
110736
|
+
}
|
|
110737
|
+
async function secretFor(body2, key, isTty, out, deps) {
|
|
110738
|
+
const read2 = deps.readSecret ?? readSecret;
|
|
110739
|
+
try {
|
|
110740
|
+
if (key.kind === "literal") return { secret: key.value };
|
|
110741
|
+
if (key.kind === "none" && isTty) {
|
|
110742
|
+
if (body2.harness === "claude-code") {
|
|
110743
|
+
return await claudeLogin(out, read2, deps);
|
|
110744
|
+
}
|
|
110745
|
+
if (body2.harness === "codex") return await codexLogin2(out, deps);
|
|
110746
|
+
}
|
|
110747
|
+
return { secret: await read2(`Paste the ${whatOf(body2)}`) };
|
|
110748
|
+
} catch (err2) {
|
|
110749
|
+
return {
|
|
110750
|
+
failure: err2,
|
|
110751
|
+
code: err2 instanceof SecretAborted ? "cancelled" : "input"
|
|
110752
|
+
};
|
|
110753
|
+
}
|
|
110754
|
+
}
|
|
110755
|
+
function notUsedYet(credential) {
|
|
110756
|
+
if (credential.authType === "subscription_token") {
|
|
110757
|
+
return credential.harness === "codex" ? "Codex runs don't use a ChatGPT login yet" : void 0;
|
|
110758
|
+
}
|
|
110759
|
+
return credential.provider === "openrouter" || credential.baseUrl ? "Sandbox runs don't use this key yet" : void 0;
|
|
110760
|
+
}
|
|
110761
|
+
function savedLine(credential, shared) {
|
|
110762
|
+
const what = credential.authType === "subscription_token" ? `the ${credential.harness ?? credential.provider} login` : credential.provider === "openrouter" ? "the openrouter key" : credential.baseUrl ? `the key for ${credential.baseUrl}` : `the ${credential.provider} key`;
|
|
110763
|
+
const saved = `Saved ${what} ending ${credential.hint} as ${credential.id}.`;
|
|
110764
|
+
const idle = notUsedYet(credential);
|
|
110765
|
+
if (shared) {
|
|
110766
|
+
return idle === void 0 ? `${saved} Runs whose account source names this workspace can use it.` : `${saved} It belongs to this workspace. ${idle}, and Oxagen keeps it until they do.`;
|
|
110767
|
+
}
|
|
110768
|
+
return idle === void 0 ? `${saved} Your runs in every workspace can use it.` : `${saved} It is yours in every workspace. ${idle}, and Oxagen keeps it until they do.`;
|
|
110769
|
+
}
|
|
110770
|
+
async function credentialsCreate(opts, writer = stdoutWriter, deps = {}) {
|
|
110083
110771
|
const out = createOutput({ json: opts.json }, writer);
|
|
110084
|
-
const body2 =
|
|
110772
|
+
const body2 = createBodyOf(opts);
|
|
110085
110773
|
if ("error" in body2) return out.error(body2.error, "usage");
|
|
110086
|
-
const
|
|
110087
|
-
if (
|
|
110774
|
+
const key = keyFlagOf(opts.key);
|
|
110775
|
+
if ("error" in key) return out.error(key.error, "usage");
|
|
110776
|
+
const isTty = (deps.isTty ?? (() => process.stdin.isTTY === true))();
|
|
110777
|
+
if (body2.harness === "codex" && (key.kind === "literal" || key.kind === "stdin" && isTty)) {
|
|
110088
110778
|
return out.error(
|
|
110089
|
-
|
|
110779
|
+
`A ChatGPT login is a file, so an argument or a prompt cannot carry it. Pipe it in: ${CODEX_PIPE}. To sign in on this terminal instead, leave out --key.`,
|
|
110090
110780
|
"usage"
|
|
110091
110781
|
);
|
|
110092
110782
|
}
|
|
110093
110783
|
const scope = scopeFor(opts);
|
|
110094
110784
|
if ("error" in scope) return out.error(scope.error, "usage");
|
|
110095
|
-
const
|
|
110096
|
-
|
|
110097
|
-
|
|
110098
|
-
secret = await (deps.readSecret ?? readSecret)(`Paste the ${what}`);
|
|
110099
|
-
} catch (err2) {
|
|
110100
|
-
return out.error(err2, err2 instanceof SecretAborted ? "cancelled" : "input");
|
|
110101
|
-
}
|
|
110785
|
+
const got = await secretFor(body2, key, isTty, out, deps);
|
|
110786
|
+
if ("failure" in got) return out.error(got.failure, got.code);
|
|
110787
|
+
const { secret } = got;
|
|
110102
110788
|
if (secret.length < MIN_SECRET || secret.length > MAX_SECRET) {
|
|
110103
110789
|
return out.error(
|
|
110104
110790
|
`A credential is ${MIN_SECRET} to ${MAX_SECRET} characters. Nothing was stored.`,
|
|
@@ -110111,16 +110797,15 @@ async function credentialsAdd(opts, writer = stdoutWriter, deps = {}) {
|
|
|
110111
110797
|
{ ...body2, ...sharedBody(opts), secret },
|
|
110112
110798
|
scope
|
|
110113
110799
|
);
|
|
110114
|
-
if (out.isJson) {
|
|
110115
|
-
|
|
110116
|
-
|
|
110117
|
-
}
|
|
110118
|
-
writer.write(
|
|
110119
|
-
credential.baseUrl ? `Stored the key ending ${credential.hint} for ${credential.baseUrl} as ${credential.id}. Sandbox runs don't use your own endpoint yet. Oxagen keeps the key until they do.` : opts.shared ? `Stored the ${credential.provider} account ending ${credential.hint} as ${credential.id}. Runs whose account source names this workspace can use it.` : `Stored the ${credential.provider} credential ending ${credential.hint} as ${credential.id}. Only your own runs use it.`
|
|
110120
|
-
);
|
|
110800
|
+
if (out.isJson) out.data({ credential });
|
|
110801
|
+
else writer.write(savedLine(credential, opts.shared === true));
|
|
110802
|
+
if (key.kind === "literal") writer.writeErr(KEY_IN_HISTORY);
|
|
110121
110803
|
} catch (err2) {
|
|
110122
110804
|
const refusal = refusalOf3(err2);
|
|
110123
|
-
out.error(
|
|
110805
|
+
out.error(
|
|
110806
|
+
refusal.reason === "model_credential_duplicate" ? `${refusal.message} Run \`oxagen credentials list\` to see your credentials.` : refusal.message,
|
|
110807
|
+
refusal.reason ?? "api"
|
|
110808
|
+
);
|
|
110124
110809
|
}
|
|
110125
110810
|
}
|
|
110126
110811
|
async function credentialsList(opts, writer = stdoutWriter) {
|
|
@@ -110139,7 +110824,7 @@ async function credentialsList(opts, writer = stdoutWriter) {
|
|
|
110139
110824
|
}
|
|
110140
110825
|
if (items.length === 0) {
|
|
110141
110826
|
writer.write(
|
|
110142
|
-
"You have no model credentials in Oxagen.
|
|
110827
|
+
"You have no model credentials in Oxagen. Save one with `oxagen credentials create --harness claude-code` or `oxagen credentials create --provider anthropic`."
|
|
110143
110828
|
);
|
|
110144
110829
|
return;
|
|
110145
110830
|
}
|
|
@@ -110261,7 +110946,7 @@ async function credentialsRotate(credentialId, opts, writer = stdoutWriter, deps
|
|
|
110261
110946
|
}
|
|
110262
110947
|
if (current.authType !== "api_key") {
|
|
110263
110948
|
return out.error(
|
|
110264
|
-
"This credential is a subscription login, so it has no key to rotate.
|
|
110949
|
+
"This credential is a subscription login, so it has no key to rotate. Create the new login, then remove this one.",
|
|
110265
110950
|
"model_credential_not_rotatable"
|
|
110266
110951
|
);
|
|
110267
110952
|
}
|
|
@@ -110331,7 +111016,7 @@ async function credentialsRemove(credentialId, opts, writer = stdoutWriter) {
|
|
|
110331
111016
|
out.error(refusal.message, refusal.reason ?? "api");
|
|
110332
111017
|
}
|
|
110333
111018
|
}
|
|
110334
|
-
var PROVIDERS, CUSTOM_ENDPOINT_PROVIDER, AUTH_TYPES, LOGIN_HARNESSES, LOGIN_PROVIDER, MIN_SECRET, MAX_SECRET, CREDENTIAL_ID, SecretAborted;
|
|
111019
|
+
var PROVIDERS, CUSTOM_ENDPOINT_PROVIDER, AUTH_TYPES, LOGIN_HARNESSES, LOGIN_PROVIDER, MIN_SECRET, MAX_SECRET, CREDENTIAL_ID, SecretAborted, SETUP_TOKEN_ON_SCREEN, SETUP_TOKEN_START, SETUP_TOKEN_TAIL, KEY_IN_HISTORY, CODEX_PIPE;
|
|
110335
111020
|
var init_credentials = __esm({
|
|
110336
111021
|
"src/commands/credentials.ts"() {
|
|
110337
111022
|
init_api();
|
|
@@ -110339,7 +111024,12 @@ var init_credentials = __esm({
|
|
|
110339
111024
|
init_capture_writer();
|
|
110340
111025
|
init_output();
|
|
110341
111026
|
init_sandbox_run();
|
|
110342
|
-
PROVIDERS = [
|
|
111027
|
+
PROVIDERS = [
|
|
111028
|
+
"anthropic",
|
|
111029
|
+
"openai",
|
|
111030
|
+
"openrouter",
|
|
111031
|
+
"openai_compatible"
|
|
111032
|
+
];
|
|
110343
111033
|
CUSTOM_ENDPOINT_PROVIDER = "openai_compatible";
|
|
110344
111034
|
AUTH_TYPES = {
|
|
110345
111035
|
"api-key": "api_key",
|
|
@@ -110356,6 +111046,16 @@ var init_credentials = __esm({
|
|
|
110356
111046
|
this.name = "SecretAborted";
|
|
110357
111047
|
}
|
|
110358
111048
|
};
|
|
111049
|
+
SETUP_TOKEN_ON_SCREEN = /sk-ant-oat[A-Za-z0-9_-]*/g;
|
|
111050
|
+
SETUP_TOKEN_START = "sk-ant-oat";
|
|
111051
|
+
SETUP_TOKEN_TAIL = new RegExp(
|
|
111052
|
+
`(?:${Array.from(
|
|
111053
|
+
{ length: SETUP_TOKEN_START.length - 1 },
|
|
111054
|
+
(_, i2) => SETUP_TOKEN_START.slice(0, i2 + 1)
|
|
111055
|
+
).join("|")}|${SETUP_TOKEN_START}[A-Za-z0-9_-]*)$`
|
|
111056
|
+
);
|
|
111057
|
+
KEY_IN_HISTORY = "The key you typed is in your shell history and visible in the process list. Next time, pass --key - to read it from standard input, or leave out --key for a hidden prompt.";
|
|
111058
|
+
CODEX_PIPE = "oxagen credentials create --harness codex --key - < ~/.codex/auth.json";
|
|
110359
111059
|
}
|
|
110360
111060
|
});
|
|
110361
111061
|
|
|
@@ -111055,10 +111755,10 @@ var init_esm2 = __esm({
|
|
|
111055
111755
|
};
|
|
111056
111756
|
deo = /* @__PURE__ */ new i322([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
|
|
111057
111757
|
et = /* @__PURE__ */ new u82(0);
|
|
111058
|
-
dflt = function(dat, lvl, plvl, pre,
|
|
111758
|
+
dflt = function(dat, lvl, plvl, pre, post3, st) {
|
|
111059
111759
|
var s2 = st.z || dat.length;
|
|
111060
|
-
var o = new u82(pre + s2 + 5 * (1 + Math.ceil(s2 / 7e3)) +
|
|
111061
|
-
var w = o.subarray(pre, o.length -
|
|
111760
|
+
var o = new u82(pre + s2 + 5 * (1 + Math.ceil(s2 / 7e3)) + post3);
|
|
111761
|
+
var w = o.subarray(pre, o.length - post3);
|
|
111062
111762
|
var lst = st.l;
|
|
111063
111763
|
var pos = (st.r || 0) & 7;
|
|
111064
111764
|
if (lvl) {
|
|
@@ -111154,7 +111854,7 @@ var init_esm2 = __esm({
|
|
|
111154
111854
|
}
|
|
111155
111855
|
st.i = s2;
|
|
111156
111856
|
}
|
|
111157
|
-
return slc(o, 0, pre + shft(pos) +
|
|
111857
|
+
return slc(o, 0, pre + shft(pos) + post3);
|
|
111158
111858
|
};
|
|
111159
111859
|
crct = /* @__PURE__ */ (function() {
|
|
111160
111860
|
var t = new Int32Array(256);
|
|
@@ -111180,7 +111880,7 @@ var init_esm2 = __esm({
|
|
|
111180
111880
|
}
|
|
111181
111881
|
};
|
|
111182
111882
|
};
|
|
111183
|
-
dopt = function(dat, opt, pre,
|
|
111883
|
+
dopt = function(dat, opt, pre, post3, st) {
|
|
111184
111884
|
if (!st) {
|
|
111185
111885
|
st = { l: 1 };
|
|
111186
111886
|
if (opt.dictionary) {
|
|
@@ -111192,7 +111892,7 @@ var init_esm2 = __esm({
|
|
|
111192
111892
|
st.w = dict.length;
|
|
111193
111893
|
}
|
|
111194
111894
|
}
|
|
111195
|
-
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre,
|
|
111895
|
+
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post3, st);
|
|
111196
111896
|
};
|
|
111197
111897
|
mrg = function(a, b3) {
|
|
111198
111898
|
var o = {};
|
|
@@ -111352,14 +112052,14 @@ __export(verify_exports, {
|
|
|
111352
112052
|
writeVerifier: () => writeVerifier
|
|
111353
112053
|
});
|
|
111354
112054
|
import {
|
|
111355
|
-
existsSync as
|
|
111356
|
-
mkdirSync as
|
|
111357
|
-
readdirSync as
|
|
111358
|
-
readFileSync as
|
|
112055
|
+
existsSync as existsSync30,
|
|
112056
|
+
mkdirSync as mkdirSync14,
|
|
112057
|
+
readdirSync as readdirSync18,
|
|
112058
|
+
readFileSync as readFileSync31,
|
|
111359
112059
|
statSync as statSync20,
|
|
111360
|
-
writeFileSync as
|
|
112060
|
+
writeFileSync as writeFileSync11
|
|
111361
112061
|
} from "node:fs";
|
|
111362
|
-
import { dirname as dirname36, join as
|
|
112062
|
+
import { dirname as dirname36, join as join69 } from "node:path";
|
|
111363
112063
|
function isBundleName(name2) {
|
|
111364
112064
|
return BUNDLE_FILES.has(name2) || isClaimBundleName(name2);
|
|
111365
112065
|
}
|
|
@@ -111370,8 +112070,8 @@ function underOneFolder(name2) {
|
|
|
111370
112070
|
function readDirectoryEntries(dir) {
|
|
111371
112071
|
const entries2 = /* @__PURE__ */ new Map();
|
|
111372
112072
|
const walk2 = (folder, prefix) => {
|
|
111373
|
-
for (const entry2 of
|
|
111374
|
-
const path2 =
|
|
112073
|
+
for (const entry2 of readdirSync18(folder)) {
|
|
112074
|
+
const path2 = join69(folder, entry2);
|
|
111375
112075
|
const name2 = `${prefix}${entry2}`;
|
|
111376
112076
|
if (statSync20(path2).isDirectory()) {
|
|
111377
112077
|
if (prefix === "" && (entry2 === "heads" || entry2 === "trust"))
|
|
@@ -111380,7 +112080,7 @@ function readDirectoryEntries(dir) {
|
|
|
111380
112080
|
} else {
|
|
111381
112081
|
entries2.set(
|
|
111382
112082
|
name2,
|
|
111383
|
-
isBundleName(name2) ? new Uint8Array(
|
|
112083
|
+
isBundleName(name2) ? new Uint8Array(readFileSync31(path2)) : UNREAD
|
|
111384
112084
|
);
|
|
111385
112085
|
}
|
|
111386
112086
|
}
|
|
@@ -111392,7 +112092,7 @@ function readZipEntries(path2) {
|
|
|
111392
112092
|
let raw;
|
|
111393
112093
|
const skipped2 = [];
|
|
111394
112094
|
try {
|
|
111395
|
-
raw = unzipSync(new Uint8Array(
|
|
112095
|
+
raw = unzipSync(new Uint8Array(readFileSync31(path2)), {
|
|
111396
112096
|
filter: (file) => {
|
|
111397
112097
|
const inner = underOneFolder(file.name);
|
|
111398
112098
|
const read2 = file.originalSize <= MAX_ENTRY_BYTES && (isBundleName(file.name) || inner !== null && isBundleName(inner));
|
|
@@ -111424,7 +112124,7 @@ function readZipEntries(path2) {
|
|
|
111424
112124
|
return entries2;
|
|
111425
112125
|
}
|
|
111426
112126
|
function readBundleEntries(path2) {
|
|
111427
|
-
if (!
|
|
112127
|
+
if (!existsSync30(path2)) {
|
|
111428
112128
|
throw new BundleReadError(`${path2} does not exist.`);
|
|
111429
112129
|
}
|
|
111430
112130
|
return statSync20(path2).isDirectory() ? readDirectoryEntries(path2) : readZipEntries(path2);
|
|
@@ -111593,8 +112293,8 @@ async function verifyBundle3(bundle2, opts = {}, writer = stdoutWriter) {
|
|
|
111593
112293
|
process.exitCode = unpinned ? 3 : 1;
|
|
111594
112294
|
}
|
|
111595
112295
|
async function writeVerifier(path2, writer = stdoutWriter) {
|
|
111596
|
-
|
|
111597
|
-
|
|
112296
|
+
mkdirSync14(dirname36(path2), { recursive: true });
|
|
112297
|
+
writeFileSync11(path2, CLAIM_VERIFIER_SCRIPT, { mode: 420 });
|
|
111598
112298
|
writer.write(
|
|
111599
112299
|
`Wrote the claim export verifier to ${path2}. Run it with: node ${path2} <export directory> [the same flags as oxagen verify]`
|
|
111600
112300
|
);
|
|
@@ -111603,16 +112303,16 @@ async function writeSampleBundle(dir, writer = stdoutWriter) {
|
|
|
111603
112303
|
const { files: files2, pins } = buildSampleClaimBundle();
|
|
111604
112304
|
const zipped = {};
|
|
111605
112305
|
for (const [name2, bytes] of files2) {
|
|
111606
|
-
const path2 =
|
|
111607
|
-
|
|
111608
|
-
|
|
112306
|
+
const path2 = join69(dir, name2);
|
|
112307
|
+
mkdirSync14(dirname36(path2), { recursive: true });
|
|
112308
|
+
writeFileSync11(path2, bytes);
|
|
111609
112309
|
zipped[name2] = bytes;
|
|
111610
112310
|
}
|
|
111611
112311
|
const base2 = dir.replace(/\/+$/, "");
|
|
111612
112312
|
const zipPath = `${base2}.zip`;
|
|
111613
112313
|
const verifierPath = `${base2}-verify.mjs`;
|
|
111614
|
-
|
|
111615
|
-
|
|
112314
|
+
writeFileSync11(zipPath, zipSync(zipped, { level: 6 }));
|
|
112315
|
+
writeFileSync11(verifierPath, CLAIM_VERIFIER_SCRIPT, { mode: 420 });
|
|
111616
112316
|
const pinArgs = [
|
|
111617
112317
|
...pins.issuerKeys.map((k) => `--issuer-key ${k}`),
|
|
111618
112318
|
...pins.tsKeys.map((k) => `--ts-key ${k}`),
|
|
@@ -112738,7 +113438,7 @@ function datetime(args) {
|
|
|
112738
113438
|
const timeRegex2 = `${time3}(?:${opts.join("|")})`;
|
|
112739
113439
|
return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
|
|
112740
113440
|
}
|
|
112741
|
-
var cuid, cuid2, ulid2, xid, ksuid, nanoid, duration2, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url,
|
|
113441
|
+
var cuid, cuid2, ulid2, xid, ksuid, nanoid, duration2, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, hostname4, e164, dateSource, date, string, bigint, integer2, number2, boolean, _null, lowercase, uppercase;
|
|
112742
113442
|
var init_regexes = __esm({
|
|
112743
113443
|
"../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js"() {
|
|
112744
113444
|
cuid = /^[cC][^\s-]{8,}$/;
|
|
@@ -112762,7 +113462,7 @@ var init_regexes = __esm({
|
|
|
112762
113462
|
cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
112763
113463
|
base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
112764
113464
|
base64url = /^[A-Za-z0-9_-]*$/;
|
|
112765
|
-
|
|
113465
|
+
hostname4 = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
|
|
112766
113466
|
e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
112767
113467
|
dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
112768
113468
|
date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
@@ -113576,7 +114276,7 @@ var init_schemas3 = __esm({
|
|
|
113576
114276
|
code: "invalid_format",
|
|
113577
114277
|
format: "url",
|
|
113578
114278
|
note: "Invalid hostname",
|
|
113579
|
-
pattern:
|
|
114279
|
+
pattern: hostname4.source,
|
|
113580
114280
|
input: payload.value,
|
|
113581
114281
|
inst,
|
|
113582
114282
|
continue: !def.abort
|
|
@@ -123177,9 +123877,9 @@ var require_json_schema_traverse = __commonJS({
|
|
|
123177
123877
|
cb = opts.cb || cb;
|
|
123178
123878
|
var pre = typeof cb == "function" ? cb : cb.pre || function() {
|
|
123179
123879
|
};
|
|
123180
|
-
var
|
|
123880
|
+
var post3 = cb.post || function() {
|
|
123181
123881
|
};
|
|
123182
|
-
_traverse(opts, pre,
|
|
123882
|
+
_traverse(opts, pre, post3, schema, "", schema);
|
|
123183
123883
|
};
|
|
123184
123884
|
traverse.keywords = {
|
|
123185
123885
|
additionalItems: true,
|
|
@@ -123225,7 +123925,7 @@ var require_json_schema_traverse = __commonJS({
|
|
|
123225
123925
|
maxProperties: true,
|
|
123226
123926
|
minProperties: true
|
|
123227
123927
|
};
|
|
123228
|
-
function _traverse(opts, pre,
|
|
123928
|
+
function _traverse(opts, pre, post3, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
123229
123929
|
if (schema && typeof schema == "object" && !Array.isArray(schema)) {
|
|
123230
123930
|
pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
123231
123931
|
for (var key in schema) {
|
|
@@ -123233,18 +123933,18 @@ var require_json_schema_traverse = __commonJS({
|
|
|
123233
123933
|
if (Array.isArray(sch)) {
|
|
123234
123934
|
if (key in traverse.arrayKeywords) {
|
|
123235
123935
|
for (var i2 = 0; i2 < sch.length; i2++)
|
|
123236
|
-
_traverse(opts, pre,
|
|
123936
|
+
_traverse(opts, pre, post3, sch[i2], jsonPtr + "/" + key + "/" + i2, rootSchema, jsonPtr, key, schema, i2);
|
|
123237
123937
|
}
|
|
123238
123938
|
} else if (key in traverse.propsKeywords) {
|
|
123239
123939
|
if (sch && typeof sch == "object") {
|
|
123240
123940
|
for (var prop in sch)
|
|
123241
|
-
_traverse(opts, pre,
|
|
123941
|
+
_traverse(opts, pre, post3, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
|
|
123242
123942
|
}
|
|
123243
123943
|
} else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
|
|
123244
|
-
_traverse(opts, pre,
|
|
123944
|
+
_traverse(opts, pre, post3, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
|
|
123245
123945
|
}
|
|
123246
123946
|
}
|
|
123247
|
-
|
|
123947
|
+
post3(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
123248
123948
|
}
|
|
123249
123949
|
}
|
|
123250
123950
|
function escapeJsonPtr(str3) {
|
|
@@ -125880,11 +126580,11 @@ var require_core = __commonJS({
|
|
|
125880
126580
|
}
|
|
125881
126581
|
function addRule(keyword, definition, dataType) {
|
|
125882
126582
|
var _a2;
|
|
125883
|
-
const
|
|
125884
|
-
if (dataType &&
|
|
126583
|
+
const post3 = definition === null || definition === void 0 ? void 0 : definition.post;
|
|
126584
|
+
if (dataType && post3)
|
|
125885
126585
|
throw new Error('keyword with "post" flag cannot have "type"');
|
|
125886
126586
|
const { RULES } = this;
|
|
125887
|
-
let ruleGroup =
|
|
126587
|
+
let ruleGroup = post3 ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
|
|
125888
126588
|
if (!ruleGroup) {
|
|
125889
126589
|
ruleGroup = { type: dataType, rules: [] };
|
|
125890
126590
|
RULES.rules.push(ruleGroup);
|
|
@@ -129714,7 +130414,7 @@ var init_conversation = __esm({
|
|
|
129714
130414
|
});
|
|
129715
130415
|
|
|
129716
130416
|
// src/auth/open-browser.ts
|
|
129717
|
-
import { spawn as
|
|
130417
|
+
import { spawn as spawn9 } from "node:child_process";
|
|
129718
130418
|
function openBrowser(url2) {
|
|
129719
130419
|
try {
|
|
129720
130420
|
let cmd;
|
|
@@ -129732,7 +130432,7 @@ function openBrowser(url2) {
|
|
|
129732
130432
|
cmd = "xdg-open";
|
|
129733
130433
|
args = [url2];
|
|
129734
130434
|
}
|
|
129735
|
-
const child =
|
|
130435
|
+
const child = spawn9(cmd, args, { detached: true, stdio: "ignore" });
|
|
129736
130436
|
child.on("error", () => {
|
|
129737
130437
|
});
|
|
129738
130438
|
child.unref();
|
|
@@ -129744,186 +130444,6 @@ var init_open_browser = __esm({
|
|
|
129744
130444
|
}
|
|
129745
130445
|
});
|
|
129746
130446
|
|
|
129747
|
-
// src/lib/working-copy.ts
|
|
129748
|
-
import { execFile as execFile6 } from "node:child_process";
|
|
129749
|
-
import { createHash as createHash29, randomBytes as randomBytes14 } from "node:crypto";
|
|
129750
|
-
import {
|
|
129751
|
-
existsSync as existsSync30,
|
|
129752
|
-
lstatSync as lstatSync13,
|
|
129753
|
-
mkdirSync as mkdirSync14,
|
|
129754
|
-
readFileSync as readFileSync31,
|
|
129755
|
-
readdirSync as readdirSync18,
|
|
129756
|
-
realpathSync as realpathSync10,
|
|
129757
|
-
writeFileSync as writeFileSync11
|
|
129758
|
-
} from "node:fs";
|
|
129759
|
-
import { homedir as homedir13, hostname as osHostname3 } from "node:os";
|
|
129760
|
-
import { join as join68, resolve as resolve26, sep as sep12 } from "node:path";
|
|
129761
|
-
function git3(cwd, args) {
|
|
129762
|
-
return new Promise((done) => {
|
|
129763
|
-
try {
|
|
129764
|
-
execFile6(
|
|
129765
|
-
"git",
|
|
129766
|
-
args,
|
|
129767
|
-
{ cwd, timeout: GIT_TIMEOUT_MS2, encoding: "utf8", windowsHide: true },
|
|
129768
|
-
(err2, stdout) => {
|
|
129769
|
-
if (err2) return done(null);
|
|
129770
|
-
const out = String(stdout).trim();
|
|
129771
|
-
done(out.length > 0 ? out : null);
|
|
129772
|
-
}
|
|
129773
|
-
);
|
|
129774
|
-
} catch {
|
|
129775
|
-
done(null);
|
|
129776
|
-
}
|
|
129777
|
-
});
|
|
129778
|
-
}
|
|
129779
|
-
async function projectRootFor(cwd) {
|
|
129780
|
-
const top = await git3(cwd, ["rev-parse", "--show-toplevel"]);
|
|
129781
|
-
return top ? resolve26(top) : resolve26(cwd);
|
|
129782
|
-
}
|
|
129783
|
-
function parseRemoteRepository(url2) {
|
|
129784
|
-
const raw = url2.trim();
|
|
129785
|
-
if (raw.length === 0) return null;
|
|
129786
|
-
let path2 = null;
|
|
129787
|
-
const scp = /^(?:[^@/\s]+@)?([^:/\s]+):(?!\/\/)(.+)$/.exec(raw);
|
|
129788
|
-
if (!raw.includes("://") && scp) {
|
|
129789
|
-
if (scp[1].length === 1) return null;
|
|
129790
|
-
path2 = scp[2];
|
|
129791
|
-
} else {
|
|
129792
|
-
try {
|
|
129793
|
-
const parsed2 = new URL(raw);
|
|
129794
|
-
if (parsed2.protocol === "file:") return null;
|
|
129795
|
-
path2 = decodeURIComponent(parsed2.pathname);
|
|
129796
|
-
} catch {
|
|
129797
|
-
return null;
|
|
129798
|
-
}
|
|
129799
|
-
}
|
|
129800
|
-
const segments = path2.replace(/\/+$/, "").replace(/\.git$/, "").split("/").filter((s2) => s2.length > 0);
|
|
129801
|
-
if (segments.length < 2) return null;
|
|
129802
|
-
const name2 = segments.join("/");
|
|
129803
|
-
return name2.length >= 3 && name2.length <= 512 ? name2 : null;
|
|
129804
|
-
}
|
|
129805
|
-
function oxagenPresent(root) {
|
|
129806
|
-
try {
|
|
129807
|
-
return readdirSync18(join68(root, ".oxagen")).some(
|
|
129808
|
-
(name2) => name2 !== "workspace.json"
|
|
129809
|
-
);
|
|
129810
|
-
} catch {
|
|
129811
|
-
return false;
|
|
129812
|
-
}
|
|
129813
|
-
}
|
|
129814
|
-
function symlinkState(root) {
|
|
129815
|
-
try {
|
|
129816
|
-
if (!lstatSync13(join68(root, ".stella")).isDirectory()) return "none";
|
|
129817
|
-
} catch {
|
|
129818
|
-
return "none";
|
|
129819
|
-
}
|
|
129820
|
-
let oxagenReal;
|
|
129821
|
-
try {
|
|
129822
|
-
oxagenReal = realpathSync10(join68(root, ".oxagen"));
|
|
129823
|
-
} catch {
|
|
129824
|
-
return "missing";
|
|
129825
|
-
}
|
|
129826
|
-
for (const link of STELLA_LINKS) {
|
|
129827
|
-
const at2 = join68(root, link);
|
|
129828
|
-
try {
|
|
129829
|
-
if (!lstatSync13(at2).isSymbolicLink()) return "missing";
|
|
129830
|
-
const target = realpathSync10(at2);
|
|
129831
|
-
if (target !== oxagenReal && !target.startsWith(oxagenReal + sep12)) {
|
|
129832
|
-
return "missing";
|
|
129833
|
-
}
|
|
129834
|
-
} catch {
|
|
129835
|
-
return "missing";
|
|
129836
|
-
}
|
|
129837
|
-
}
|
|
129838
|
-
return "linked";
|
|
129839
|
-
}
|
|
129840
|
-
function machineId(configDir = getConfigDir()) {
|
|
129841
|
-
const file = join68(configDir, MACHINE_ID_FILE);
|
|
129842
|
-
let secret = null;
|
|
129843
|
-
try {
|
|
129844
|
-
if (existsSync30(file)) {
|
|
129845
|
-
const stored = readFileSync31(file, "utf8").trim();
|
|
129846
|
-
if (/^[0-9a-f]{64}$/.test(stored)) secret = stored;
|
|
129847
|
-
}
|
|
129848
|
-
if (secret === null) {
|
|
129849
|
-
secret = randomBytes14(32).toString("hex");
|
|
129850
|
-
mkdirSync14(configDir, { recursive: true });
|
|
129851
|
-
writeFileSync11(file, `${secret}
|
|
129852
|
-
`, { encoding: "utf8", mode: 384 });
|
|
129853
|
-
}
|
|
129854
|
-
} catch {
|
|
129855
|
-
secret = `fallback:${osHostname3()}:${homedir13()}`;
|
|
129856
|
-
}
|
|
129857
|
-
return createHash29("sha256").update(secret).digest("hex");
|
|
129858
|
-
}
|
|
129859
|
-
function cliVersion() {
|
|
129860
|
-
const v = package_default.version;
|
|
129861
|
-
return typeof v === "string" && v.length > 0 ? v.slice(0, 64) : null;
|
|
129862
|
-
}
|
|
129863
|
-
async function probeWorkingCopy(opts) {
|
|
129864
|
-
const { root } = opts;
|
|
129865
|
-
const [remote, branch, head3] = await Promise.all([
|
|
129866
|
-
git3(root, ["remote", "get-url", "origin"]),
|
|
129867
|
-
git3(root, ["rev-parse", "--abbrev-ref", "HEAD"]),
|
|
129868
|
-
git3(root, ["rev-parse", "HEAD"])
|
|
129869
|
-
]);
|
|
129870
|
-
const host = (() => {
|
|
129871
|
-
try {
|
|
129872
|
-
return osHostname3().slice(0, 255);
|
|
129873
|
-
} catch {
|
|
129874
|
-
return "";
|
|
129875
|
-
}
|
|
129876
|
-
})();
|
|
129877
|
-
return {
|
|
129878
|
-
machineId: machineId(opts.configDir),
|
|
129879
|
-
hostname: host.length > 0 ? host : "unknown",
|
|
129880
|
-
directory: resolve26(root),
|
|
129881
|
-
repository: remote ? parseRemoteRepository(remote) : null,
|
|
129882
|
-
// `HEAD` is git's answer on a detached head.
|
|
129883
|
-
branch: branch && branch !== "HEAD" ? branch.slice(0, 255) : null,
|
|
129884
|
-
headCommit: head3 && COMMIT_SHA.test(head3) ? head3 : null,
|
|
129885
|
-
oxagenPresent: oxagenPresent(root),
|
|
129886
|
-
symlinks: symlinkState(root),
|
|
129887
|
-
pulledCommit: null,
|
|
129888
|
-
event: "init",
|
|
129889
|
-
cliVersion: cliVersion()
|
|
129890
|
-
};
|
|
129891
|
-
}
|
|
129892
|
-
async function reportWorkingCopy(opts) {
|
|
129893
|
-
try {
|
|
129894
|
-
const report = await probeWorkingCopy(opts);
|
|
129895
|
-
const recorded = await apiPostOrThrow(
|
|
129896
|
-
"working-copies",
|
|
129897
|
-
report,
|
|
129898
|
-
opts.scope,
|
|
129899
|
-
{ timeoutMs: REPORT_TIMEOUT_MS }
|
|
129900
|
-
);
|
|
129901
|
-
return {
|
|
129902
|
-
workingCopyId: recorded.workingCopyId,
|
|
129903
|
-
lastSeenAt: recorded.lastSeenAt
|
|
129904
|
-
};
|
|
129905
|
-
} catch (err2) {
|
|
129906
|
-
return { error: err2 instanceof Error ? err2.message : String(err2) };
|
|
129907
|
-
}
|
|
129908
|
-
}
|
|
129909
|
-
var GIT_TIMEOUT_MS2, REPORT_TIMEOUT_MS, MACHINE_ID_FILE, STELLA_LINKS, COMMIT_SHA;
|
|
129910
|
-
var init_working_copy = __esm({
|
|
129911
|
-
"src/lib/working-copy.ts"() {
|
|
129912
|
-
init_package();
|
|
129913
|
-
init_api();
|
|
129914
|
-
init_config();
|
|
129915
|
-
GIT_TIMEOUT_MS2 = 3e3;
|
|
129916
|
-
REPORT_TIMEOUT_MS = 8e3;
|
|
129917
|
-
MACHINE_ID_FILE = "machine-id";
|
|
129918
|
-
STELLA_LINKS = [
|
|
129919
|
-
".stella/rules",
|
|
129920
|
-
".stella/proposals",
|
|
129921
|
-
".stella/agents"
|
|
129922
|
-
];
|
|
129923
|
-
COMMIT_SHA = /^[0-9a-f]{7,64}$/;
|
|
129924
|
-
}
|
|
129925
|
-
});
|
|
129926
|
-
|
|
129927
130447
|
// src/commands/init.ts
|
|
129928
130448
|
var init_exports = {};
|
|
129929
130449
|
__export(init_exports, {
|
|
@@ -151246,7 +151766,7 @@ function sessionHeaders(session) {
|
|
|
151246
151766
|
function invalidResponse(detail, status2) {
|
|
151247
151767
|
return { ok: false, error: { title: "Invalid response", detail, status: status2 } };
|
|
151248
151768
|
}
|
|
151249
|
-
async function
|
|
151769
|
+
async function post2(session, message2) {
|
|
151250
151770
|
const { call: call2 } = session;
|
|
151251
151771
|
const context = call2.context;
|
|
151252
151772
|
const pending = settle3(
|
|
@@ -151384,7 +151904,7 @@ function rpcError2(error2) {
|
|
|
151384
151904
|
};
|
|
151385
151905
|
}
|
|
151386
151906
|
async function initialize(session) {
|
|
151387
|
-
const sent = await
|
|
151907
|
+
const sent = await post2(session, {
|
|
151388
151908
|
jsonrpc: "2.0",
|
|
151389
151909
|
id: INITIALIZE_ID,
|
|
151390
151910
|
method: "initialize",
|
|
@@ -151425,7 +151945,7 @@ async function initialize(session) {
|
|
|
151425
151945
|
return { ok: true, value: void 0 };
|
|
151426
151946
|
}
|
|
151427
151947
|
async function notifyInitialized(session) {
|
|
151428
|
-
const sent = await
|
|
151948
|
+
const sent = await post2(session, {
|
|
151429
151949
|
jsonrpc: "2.0",
|
|
151430
151950
|
method: "notifications/initialized"
|
|
151431
151951
|
});
|
|
@@ -151450,7 +151970,7 @@ function toolsCallMessage(template, args) {
|
|
|
151450
151970
|
}
|
|
151451
151971
|
async function callTool2(session) {
|
|
151452
151972
|
const { template, args } = session.call;
|
|
151453
|
-
const sent = await
|
|
151973
|
+
const sent = await post2(session, toolsCallMessage(template, args));
|
|
151454
151974
|
if (!sent.ok) return { attempt: sent, exchange: void 0 };
|
|
151455
151975
|
const response = sent.value;
|
|
151456
151976
|
if (response.status < 200 || response.status >= 300) {
|
|
@@ -155476,8 +155996,8 @@ var require_service_config = __commonJS({
|
|
|
155476
155996
|
}
|
|
155477
155997
|
if (Array.isArray(validatedConfig.clientHostname)) {
|
|
155478
155998
|
let hostnameMatched = false;
|
|
155479
|
-
for (const
|
|
155480
|
-
if (
|
|
155999
|
+
for (const hostname6 of validatedConfig.clientHostname) {
|
|
156000
|
+
if (hostname6 === os2.hostname()) {
|
|
155481
156001
|
hostnameMatched = true;
|
|
155482
156002
|
}
|
|
155483
156003
|
}
|
|
@@ -162314,8 +162834,8 @@ var require_single_subchannel_channel = __commonJS({
|
|
|
162314
162834
|
if (splitPath.length >= 2) {
|
|
162315
162835
|
serviceName = splitPath[1];
|
|
162316
162836
|
}
|
|
162317
|
-
const
|
|
162318
|
-
this.serviceUrl = `https://${
|
|
162837
|
+
const hostname6 = (_b2 = (_a2 = (0, uri_parser_1.splitHostPort)(this.options.host)) === null || _a2 === void 0 ? void 0 : _a2.host) !== null && _b2 !== void 0 ? _b2 : "localhost";
|
|
162838
|
+
this.serviceUrl = `https://${hostname6}/${serviceName}`;
|
|
162319
162839
|
const timeout = (0, deadline_1.getRelativeTimeout)(options.deadline);
|
|
162320
162840
|
if (timeout !== Infinity) {
|
|
162321
162841
|
if (timeout <= 0) {
|
|
@@ -162982,8 +163502,8 @@ var require_resolver_dns = __commonJS({
|
|
|
162982
163502
|
}
|
|
162983
163503
|
trace("Looking up DNS hostname " + this.dnsHostname);
|
|
162984
163504
|
this.latestLookupResult = null;
|
|
162985
|
-
const
|
|
162986
|
-
this.pendingLookupPromise = this.lookup(
|
|
163505
|
+
const hostname6 = this.dnsHostname;
|
|
163506
|
+
this.pendingLookupPromise = this.lookup(hostname6);
|
|
162987
163507
|
this.pendingLookupPromise.then((addressList) => {
|
|
162988
163508
|
if (this.pendingLookupPromise === null) {
|
|
162989
163509
|
return;
|
|
@@ -163006,7 +163526,7 @@ var require_resolver_dns = __commonJS({
|
|
|
163006
163526
|
this.listener((0, call_interface_1.statusOrFromError)(this.defaultResolutionError), {}, this.latestServiceConfigResult, "");
|
|
163007
163527
|
});
|
|
163008
163528
|
if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) {
|
|
163009
|
-
this.pendingTxtPromise = this.resolveTxt(
|
|
163529
|
+
this.pendingTxtPromise = this.resolveTxt(hostname6);
|
|
163010
163530
|
this.pendingTxtPromise.then((txtRecord) => {
|
|
163011
163531
|
if (this.pendingTxtPromise === null) {
|
|
163012
163532
|
return;
|
|
@@ -163048,12 +163568,12 @@ var require_resolver_dns = __commonJS({
|
|
|
163048
163568
|
this.continueResolving = true;
|
|
163049
163569
|
}
|
|
163050
163570
|
}
|
|
163051
|
-
async lookup(
|
|
163571
|
+
async lookup(hostname6) {
|
|
163052
163572
|
if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {
|
|
163053
163573
|
trace("Using alternative DNS resolver.");
|
|
163054
163574
|
const records = await Promise.allSettled([
|
|
163055
|
-
this.alternativeResolver.resolve4(
|
|
163056
|
-
this.alternativeResolver.resolve6(
|
|
163575
|
+
this.alternativeResolver.resolve4(hostname6),
|
|
163576
|
+
this.alternativeResolver.resolve6(hostname6)
|
|
163057
163577
|
]);
|
|
163058
163578
|
if (records.every((result2) => result2.status === "rejected")) {
|
|
163059
163579
|
throw new Error(records[0].reason);
|
|
@@ -163065,15 +163585,15 @@ var require_resolver_dns = __commonJS({
|
|
|
163065
163585
|
port: +this.port
|
|
163066
163586
|
}));
|
|
163067
163587
|
}
|
|
163068
|
-
const addressList = await dns_1.promises.lookup(
|
|
163588
|
+
const addressList = await dns_1.promises.lookup(hostname6, { all: true });
|
|
163069
163589
|
return addressList.map((addr) => ({ host: addr.address, port: +this.port }));
|
|
163070
163590
|
}
|
|
163071
|
-
async resolveTxt(
|
|
163591
|
+
async resolveTxt(hostname6) {
|
|
163072
163592
|
if (environment_1.GRPC_NODE_USE_ALTERNATIVE_RESOLVER) {
|
|
163073
163593
|
trace("Using alternative DNS resolver.");
|
|
163074
|
-
return this.alternativeResolver.resolveTxt(
|
|
163594
|
+
return this.alternativeResolver.resolveTxt(hostname6);
|
|
163075
163595
|
}
|
|
163076
|
-
return dns_1.promises.resolveTxt(
|
|
163596
|
+
return dns_1.promises.resolveTxt(hostname6);
|
|
163077
163597
|
}
|
|
163078
163598
|
startNextResolutionTimer() {
|
|
163079
163599
|
var _a2, _b2;
|
|
@@ -163201,13 +163721,13 @@ var require_http_proxy = __commonJS({
|
|
|
163201
163721
|
userCred = proxyUrl.username;
|
|
163202
163722
|
}
|
|
163203
163723
|
}
|
|
163204
|
-
const
|
|
163724
|
+
const hostname6 = proxyUrl.hostname;
|
|
163205
163725
|
let port = proxyUrl.port;
|
|
163206
163726
|
if (port === "") {
|
|
163207
163727
|
port = "80";
|
|
163208
163728
|
}
|
|
163209
163729
|
const result2 = {
|
|
163210
|
-
address: `${
|
|
163730
|
+
address: `${hostname6}:${port}`
|
|
163211
163731
|
};
|
|
163212
163732
|
if (userCred) {
|
|
163213
163733
|
result2.creds = userCred;
|
|
@@ -164611,8 +165131,8 @@ var require_load_balancing_call = __commonJS({
|
|
|
164611
165131
|
if (splitPath.length >= 2) {
|
|
164612
165132
|
serviceName = splitPath[1];
|
|
164613
165133
|
}
|
|
164614
|
-
const
|
|
164615
|
-
this.serviceUrl = `https://${
|
|
165134
|
+
const hostname6 = (_b2 = (_a2 = (0, uri_parser_1.splitHostPort)(this.host)) === null || _a2 === void 0 ? void 0 : _a2.host) !== null && _b2 !== void 0 ? _b2 : "localhost";
|
|
165135
|
+
this.serviceUrl = `https://${hostname6}/${serviceName}`;
|
|
164616
165136
|
this.startTime = /* @__PURE__ */ new Date();
|
|
164617
165137
|
}
|
|
164618
165138
|
getDeadlineInfo() {
|
|
@@ -174298,10 +174818,18 @@ async function mapBounded(items, limit, fn) {
|
|
|
174298
174818
|
if (failures.size > 0) throw failures.get(Math.min(...failures.keys()));
|
|
174299
174819
|
return results;
|
|
174300
174820
|
}
|
|
174301
|
-
var TreeReader, READ_CONCURRENCY;
|
|
174821
|
+
var FileUnreadableError, TreeReader, READ_CONCURRENCY;
|
|
174302
174822
|
var init_tree = __esm({
|
|
174303
174823
|
"../../packages/steering-bundle/src/tree.ts"() {
|
|
174304
174824
|
"use strict";
|
|
174825
|
+
FileUnreadableError = class extends Error {
|
|
174826
|
+
constructor(path2, message2) {
|
|
174827
|
+
super(message2);
|
|
174828
|
+
this.path = path2;
|
|
174829
|
+
this.name = "FileUnreadableError";
|
|
174830
|
+
}
|
|
174831
|
+
path;
|
|
174832
|
+
};
|
|
174305
174833
|
TreeReader = class _TreeReader {
|
|
174306
174834
|
constructor(tree, cache, paths) {
|
|
174307
174835
|
this.tree = tree;
|
|
@@ -174321,6 +174849,8 @@ var init_tree = __esm({
|
|
|
174321
174849
|
decoding = /* @__PURE__ */ new Map();
|
|
174322
174850
|
blobs = /* @__PURE__ */ new Map();
|
|
174323
174851
|
listed;
|
|
174852
|
+
/** Listed paths that hold no regular file, such as a symlink. */
|
|
174853
|
+
irregular = /* @__PURE__ */ new Set();
|
|
174324
174854
|
/** How many files this reader fetched from the host. */
|
|
174325
174855
|
reads = 0;
|
|
174326
174856
|
static async open(tree, cache) {
|
|
@@ -174332,9 +174862,18 @@ var init_tree = __esm({
|
|
|
174332
174862
|
);
|
|
174333
174863
|
for (const entry2 of entries2) {
|
|
174334
174864
|
if (entry2.blob !== void 0) reader.blobs.set(entry2.path, entry2.blob);
|
|
174865
|
+
if (entry2.regular === false) reader.irregular.add(entry2.path);
|
|
174335
174866
|
}
|
|
174336
174867
|
return reader;
|
|
174337
174868
|
}
|
|
174869
|
+
/** Throws FileUnreadableError for a listed path that holds no regular file. */
|
|
174870
|
+
assertRegular(path2) {
|
|
174871
|
+
if (this.irregular.has(path2))
|
|
174872
|
+
throw new FileUnreadableError(
|
|
174873
|
+
path2,
|
|
174874
|
+
`${path2} is a symlink or a submodule, so its content is not in the repository.`
|
|
174875
|
+
);
|
|
174876
|
+
}
|
|
174338
174877
|
has(path2) {
|
|
174339
174878
|
return this.listed.has(path2);
|
|
174340
174879
|
}
|
|
@@ -174353,6 +174892,7 @@ var init_tree = __esm({
|
|
|
174353
174892
|
* fetch, and a fetch that fails is not kept.
|
|
174354
174893
|
*/
|
|
174355
174894
|
async text(path2) {
|
|
174895
|
+
this.assertRegular(path2);
|
|
174356
174896
|
if (this.tree.readBytes === void 0) return this.read(path2);
|
|
174357
174897
|
const listed = this.blobs.get(path2);
|
|
174358
174898
|
const key = listed === void 0 ? `path:${path2}` : `blob:${listed}`;
|
|
@@ -174376,6 +174916,7 @@ var init_tree = __esm({
|
|
|
174376
174916
|
}
|
|
174377
174917
|
/** The file's text, from this reader, the cache, or the host. */
|
|
174378
174918
|
async read(path2) {
|
|
174919
|
+
this.assertRegular(path2);
|
|
174379
174920
|
const held = this.texts.get(path2);
|
|
174380
174921
|
if (held !== void 0) return held;
|
|
174381
174922
|
const inFlight = this.pending.get(path2);
|
|
@@ -174782,7 +175323,7 @@ import {
|
|
|
174782
175323
|
readlinkSync as readlinkSync4,
|
|
174783
175324
|
statSync as statSync21
|
|
174784
175325
|
} from "node:fs";
|
|
174785
|
-
import { dirname as dirname37, isAbsolute as isAbsolute19, join as
|
|
175326
|
+
import { dirname as dirname37, isAbsolute as isAbsolute19, join as join70, relative as relative10, resolve as resolve28, sep as sep13 } from "node:path";
|
|
174786
175327
|
function cloneRepoKind(root) {
|
|
174787
175328
|
const out = git4(root, ["remote", "get-url", "origin"]);
|
|
174788
175329
|
const url2 = out?.toString("utf8").trim() ?? "";
|
|
@@ -174822,7 +175363,7 @@ function commitOf(root, ref) {
|
|
|
174822
175363
|
return sha2.length > 0 ? sha2 : null;
|
|
174823
175364
|
}
|
|
174824
175365
|
function readWorkingFile(root, path2) {
|
|
174825
|
-
const abs =
|
|
175366
|
+
const abs = join70(root, ...path2.split("/"));
|
|
174826
175367
|
try {
|
|
174827
175368
|
const stat7 = lstatSync14(abs);
|
|
174828
175369
|
if (stat7.isSymbolicLink()) return readlinkSync4(abs, "utf8");
|
|
@@ -174916,7 +175457,7 @@ function isDir(path2) {
|
|
|
174916
175457
|
function findSteeringRoot(start) {
|
|
174917
175458
|
let dir = resolve28(start);
|
|
174918
175459
|
for (; ; ) {
|
|
174919
|
-
if (isFile(
|
|
175460
|
+
if (isFile(join70(dir, WORKSPACE_TOML_PATH)) || isFile(join70(dir, AGENTS_MD_PATH)) && isDir(join70(dir, STEERING_DIR))) {
|
|
174920
175461
|
return dir;
|
|
174921
175462
|
}
|
|
174922
175463
|
const parent = dirname37(dir);
|
|
@@ -174996,7 +175537,7 @@ function cacheFile(cacheDir, root) {
|
|
|
174996
175537
|
key: token === void 0 ? null : createHash31("sha256").update(token).digest("hex").slice(0, 16)
|
|
174997
175538
|
};
|
|
174998
175539
|
const key = createHash31("sha256").update(JSON.stringify([root, identity])).digest("hex").slice(0, 32);
|
|
174999
|
-
return
|
|
175540
|
+
return join70(cacheDir, `${key}.json`);
|
|
175000
175541
|
}
|
|
175001
175542
|
function readCache(file, now) {
|
|
175002
175543
|
let entry2;
|
|
@@ -175110,7 +175651,7 @@ function defaultDeps2() {
|
|
|
175110
175651
|
return {
|
|
175111
175652
|
fetchPublished: fetchSteeringIndex,
|
|
175112
175653
|
cedar: cedarHooks,
|
|
175113
|
-
cacheDir:
|
|
175654
|
+
cacheDir: join70(getConfigDir(), "cache", "steering-check"),
|
|
175114
175655
|
now: () => Date.now()
|
|
175115
175656
|
};
|
|
175116
175657
|
}
|
|
@@ -177396,6 +177937,17 @@ function addAgentLifecycleCommands(agent) {
|
|
|
177396
177937
|
resume: true
|
|
177397
177938
|
})
|
|
177398
177939
|
);
|
|
177940
|
+
agent.command("connect").description(
|
|
177941
|
+
"Connect this device to a new agent with the request the page shows, and report the device back to the page. Enrolls nothing until you confirm"
|
|
177942
|
+
).requiredOption(
|
|
177943
|
+
"--request <token>",
|
|
177944
|
+
"The request token from the page (oxe_1time_\u2026)"
|
|
177945
|
+
).option(
|
|
177946
|
+
"--folder <path>",
|
|
177947
|
+
"The folder the agent works in (default: this one)"
|
|
177948
|
+
).option("--yes", "Connect without asking").option("--json", "Output JSON").action(
|
|
177949
|
+
async (opts) => (await Promise.resolve().then(() => (init_agent_connect(), agent_connect_exports))).agentConnect(opts)
|
|
177950
|
+
);
|
|
177399
177951
|
agent.command("enroll-token").description(
|
|
177400
177952
|
"Mint a single-use enrollment token for an agent, and print the command that enrolls a machine with it. Owner only"
|
|
177401
177953
|
).argument("<agent>", "An agent id or slug").option(
|
|
@@ -178173,19 +178725,25 @@ function buildProgram() {
|
|
|
178173
178725
|
});
|
|
178174
178726
|
addRuntimeCommands(program2);
|
|
178175
178727
|
const credentialsCmd = program2.command("credentials").alias("keys").description(
|
|
178176
|
-
"Manage your
|
|
178728
|
+
"Manage your model credentials: API keys and Claude or ChatGPT logins. They belong to your account, so every workspace you work in can use them. The gateway attaches them to your runs and never puts one in a sandbox. Also named keys"
|
|
178177
178729
|
);
|
|
178178
|
-
credentialsCmd.command("add").description(
|
|
178179
|
-
"
|
|
178180
|
-
).option(
|
|
178730
|
+
credentialsCmd.command("create").alias("add").description(
|
|
178731
|
+
"Save a credential on your account. With --harness it runs the harness's own sign-in and saves the login. With --provider it saves an API key. Several for one harness or provider are fine. Also named add"
|
|
178732
|
+
).option(
|
|
178733
|
+
"--harness <name>",
|
|
178734
|
+
"Save the login of claude-code or codex. Runs the harness's own sign-in when no login is saved"
|
|
178735
|
+
).option(
|
|
178181
178736
|
"--provider <name>",
|
|
178182
|
-
"anthropic, openai, or openai_compatible for your own endpoint
|
|
178737
|
+
"Save an API key for anthropic, openai, openrouter, or openai_compatible for your own endpoint"
|
|
178738
|
+
).option(
|
|
178739
|
+
"--key <value>",
|
|
178740
|
+
"The API key. Use - to read it from standard input. A key typed here stays in your shell history, so leave it out for a hidden prompt"
|
|
178741
|
+
).option(
|
|
178742
|
+
"--type <type>",
|
|
178743
|
+
"api-key or subscription (default: subscription with --harness, otherwise api-key)"
|
|
178183
178744
|
).option(
|
|
178184
178745
|
"--base-url <url>",
|
|
178185
178746
|
"The https address of your own endpoint, with --provider openai_compatible"
|
|
178186
|
-
).option(
|
|
178187
|
-
"--harness <name>",
|
|
178188
|
-
"The harness a subscription login is for: claude-code or codex"
|
|
178189
178747
|
).option(
|
|
178190
178748
|
"--label <name>",
|
|
178191
178749
|
"A name for the credential, such as the account's email"
|
|
@@ -178196,7 +178754,7 @@ function buildProgram() {
|
|
|
178196
178754
|
"--shared",
|
|
178197
178755
|
"Act on this workspace's accounts instead of your own. Changing one needs a workspace Admin or an organization Owner"
|
|
178198
178756
|
).option("--json", "Output JSON").action(
|
|
178199
|
-
async (opts) => (await Promise.resolve().then(() => (init_credentials(), credentials_exports))).
|
|
178757
|
+
async (opts) => (await Promise.resolve().then(() => (init_credentials(), credentials_exports))).credentialsCreate(opts)
|
|
178200
178758
|
);
|
|
178201
178759
|
credentialsCmd.command("list").description("List your credentials in the order the gateway uses them").option(
|
|
178202
178760
|
"--workspace-slug <slug>",
|
|
@@ -178998,7 +179556,14 @@ var init_program = __esm({
|
|
|
178998
179556
|
({ version: version2 } = package_default);
|
|
178999
179557
|
ENROLLMENT_TOKEN_PREFIX = "oxe_1time_";
|
|
179000
179558
|
EXPORT_FORMATS2 = ["recorder", "trace", "otlp"];
|
|
179001
|
-
CREDENTIAL_FLAGS = /* @__PURE__ */ new Set([
|
|
179559
|
+
CREDENTIAL_FLAGS = /* @__PURE__ */ new Set([
|
|
179560
|
+
"--token",
|
|
179561
|
+
"--input",
|
|
179562
|
+
"--endpoint",
|
|
179563
|
+
"--key",
|
|
179564
|
+
// `oxagen agent connect --request <token>` carries an enrollment token.
|
|
179565
|
+
"--request"
|
|
179566
|
+
]);
|
|
179002
179567
|
WORKSPACE_SLUG_HELP = "The workspace to act in (or OXAGEN_WORKSPACE)";
|
|
179003
179568
|
}
|
|
179004
179569
|
});
|