glimmervoid 0.47.1-next.258 → 0.47.1-next.260
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/glimmervoid.js +8 -7
- package/dist/chunks/{adapters-wHjrsK41.js → adapters-B_uPE1Et.js} +1 -1
- package/dist/chunks/{adapters-CHah6aJ0.js → adapters-M-cwyHEu.js} +240 -14
- package/dist/chunks/{kimi-home-4-aMoqJC.js → agent-home-DMK9PkOo.js} +64 -375
- package/dist/chunks/agent-home-core-D0FRjVyC.js +1 -0
- package/dist/chunks/agent-home-core-DZ_zGHQJ.js +441 -0
- package/dist/chunks/agent-home-w7C50GTe.js +1 -0
- package/dist/chunks/{agent-setup-cli-BsEkZlRc.js → agent-setup-cli-C91eRDZ-.js} +1 -1
- package/dist/chunks/{grok-6_qW-UXZ.js → grok-wsZ9ME8i.js} +1 -1
- package/dist/chunks/kimi-DP651wx7.js +1 -0
- package/dist/chunks/{kimi-gqX-CtP3.js → kimi-suU2c93F.js} +8 -16
- package/dist/chunks/{main-fr5D_OG4.js → main-CFfuow_H.js} +59 -88
- package/dist/chunks/{sane-yolo-DHs0dZTW.js → sane-yolo-BjUkqIoH.js} +6 -2
- package/dist/chunks/{spawn-env-DoDREsO-.js → spawn-env-Dwzij9eE.js} +1 -1
- package/dist/client/assets/{alert-sound-nf3o3_wq.js → alert-sound-D1n5diFX.js} +1 -1
- package/dist/client/assets/alert-sound-D1n5diFX.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-CWYOnjDG.js → benchmark-panel-J5Jl7XAO.js} +1 -1
- package/dist/client/assets/benchmark-panel-J5Jl7XAO.js.br +0 -0
- package/dist/client/assets/{celebration-player-vRRn5MpO.js → celebration-player-ghUpbHyM.js} +1 -1
- package/dist/client/assets/celebration-player-ghUpbHyM.js.br +0 -0
- package/dist/client/assets/{community-panel-3bVIK6eq.js → community-panel-si57DlHN.js} +1 -1
- package/dist/client/assets/community-panel-si57DlHN.js.br +0 -0
- package/dist/client/assets/{dialogs-DL9A1wPJ.js → dialogs-CbHT1Ff3.js} +1 -1
- package/dist/client/assets/dialogs-CbHT1Ff3.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-DkiiztD-.js → doc-editor-ui-Bga5iZ_S.js} +1 -1
- package/dist/client/assets/doc-editor-ui-Bga5iZ_S.js.br +0 -0
- package/dist/client/assets/{feature-hint-CJElDiTQ.js → feature-hint-B5CcjCgp.js} +1 -1
- package/dist/client/assets/feature-hint-B5CcjCgp.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-BRRr6sOU.js → first-run-checklist-Dnr9YII7.js} +1 -1
- package/dist/client/assets/first-run-checklist-Dnr9YII7.js.br +0 -0
- package/dist/client/assets/{hooks-panel-CVSsMuW-.js → hooks-panel-CcUGxEnN.js} +1 -1
- package/dist/client/assets/hooks-panel-CcUGxEnN.js.br +0 -0
- package/dist/client/assets/{index-Cgs2aewN.js → index-Yc1Jxr4O.js} +5 -5
- package/dist/client/assets/index-Yc1Jxr4O.js.br +0 -0
- package/dist/client/assets/{issues-panel-UnV9EDiE.js → issues-panel-CPJTbpxB.js} +1 -1
- package/dist/client/assets/issues-panel-CPJTbpxB.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-DSfvvXjn.js → my-prs-panel-NZ65g5Pb.js} +1 -1
- package/dist/client/assets/my-prs-panel-NZ65g5Pb.js.br +0 -0
- package/dist/client/assets/{nyan-cat-R0kjqBLP.js → nyan-cat-DpEJHm8S.js} +1 -1
- package/dist/client/assets/nyan-cat-DpEJHm8S.js.br +0 -0
- package/dist/client/assets/{phone-shell-CkkBHjIW.js → phone-shell-Drcxnrxf.js} +1 -1
- package/dist/client/assets/phone-shell-Drcxnrxf.js.br +0 -0
- package/dist/client/assets/{plan-face-DHCMYHpa.js → plan-face-ClrJp3Xw.js} +1 -1
- package/dist/client/assets/plan-face-ClrJp3Xw.js.br +0 -0
- package/dist/client/assets/{plan-render-CEulKrG9.js → plan-render-BJcqCYcy.js} +1 -1
- package/dist/client/assets/plan-render-BJcqCYcy.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-BZeDNC8e.js → pr-queue-columns-CKwNQUVc.js} +1 -1
- package/dist/client/assets/pr-queue-columns-CKwNQUVc.js.br +0 -0
- package/dist/client/assets/{radar-panel-CaGYAYdt.js → radar-panel-BAiBZySi.js} +1 -1
- package/dist/client/assets/radar-panel-BAiBZySi.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-HMQi5ENo.js → repo-roots-adder-g805K6Ky.js} +1 -1
- package/dist/client/assets/repo-roots-adder-g805K6Ky.js.br +0 -0
- package/dist/client/assets/{resume-dialog-CH9jnJzS.js → resume-dialog-opMb2a3h.js} +1 -1
- package/dist/client/assets/resume-dialog-opMb2a3h.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-BUu9nIDI.js → review-queue-panel-BT-cSS1L.js} +1 -1
- package/dist/client/assets/review-queue-panel-BT-cSS1L.js.br +0 -0
- package/dist/client/assets/{settings-panel-B_D7EiHD.js → settings-panel-BwPh-7g7.js} +2 -2
- package/dist/client/assets/settings-panel-BwPh-7g7.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-C1FVlOGG.js → shown-lightbox-Bh7_WCcT.js} +1 -1
- package/dist/client/assets/shown-lightbox-Bh7_WCcT.js.br +0 -0
- package/dist/client/assets/{team-review-panel-Cv0tRI8P.js → team-review-panel-SHSiDoq0.js} +1 -1
- package/dist/client/assets/team-review-panel-SHSiDoq0.js.br +0 -0
- package/dist/client/assets/{trace-panel-46IAbw1m.js → trace-panel-Bn8Ix7Kw.js} +1 -1
- package/dist/client/assets/trace-panel-Bn8Ix7Kw.js.br +0 -0
- package/dist/client/assets/{usage-panel-DmfLxVPm.js → usage-panel-BWviwXWp.js} +1 -1
- package/dist/client/assets/usage-panel-BWviwXWp.js.br +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/dist/session/hook-tool-relay.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/kimi-Bv6AgPnN.js +0 -1
- package/dist/chunks/kimi-home-Czh-wcQ_.js +0 -1
- package/dist/client/assets/alert-sound-nf3o3_wq.js.br +0 -0
- package/dist/client/assets/benchmark-panel-CWYOnjDG.js.br +0 -0
- package/dist/client/assets/celebration-player-vRRn5MpO.js.br +0 -0
- package/dist/client/assets/community-panel-3bVIK6eq.js.br +0 -0
- package/dist/client/assets/dialogs-DL9A1wPJ.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-DkiiztD-.js.br +0 -0
- package/dist/client/assets/feature-hint-CJElDiTQ.js.br +0 -0
- package/dist/client/assets/first-run-checklist-BRRr6sOU.js.br +0 -0
- package/dist/client/assets/hooks-panel-CVSsMuW-.js.br +0 -0
- package/dist/client/assets/index-Cgs2aewN.js.br +0 -0
- package/dist/client/assets/issues-panel-UnV9EDiE.js.br +0 -0
- package/dist/client/assets/my-prs-panel-DSfvvXjn.js.br +0 -0
- package/dist/client/assets/nyan-cat-R0kjqBLP.js.br +0 -0
- package/dist/client/assets/phone-shell-CkkBHjIW.js.br +0 -0
- package/dist/client/assets/plan-face-DHCMYHpa.js.br +0 -0
- package/dist/client/assets/plan-render-CEulKrG9.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-BZeDNC8e.js.br +0 -0
- package/dist/client/assets/radar-panel-CaGYAYdt.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-HMQi5ENo.js.br +0 -0
- package/dist/client/assets/resume-dialog-CH9jnJzS.js.br +0 -0
- package/dist/client/assets/review-queue-panel-BUu9nIDI.js.br +0 -0
- package/dist/client/assets/settings-panel-B_D7EiHD.js.br +0 -0
- package/dist/client/assets/shown-lightbox-C1FVlOGG.js.br +0 -0
- package/dist/client/assets/team-review-panel-Cv0tRI8P.js.br +0 -0
- package/dist/client/assets/trace-panel-46IAbw1m.js.br +0 -0
- package/dist/client/assets/usage-panel-DmfLxVPm.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -62,7 +62,7 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
62
62
|
return runPairCli(subcommandArgs);
|
|
63
63
|
}],
|
|
64
64
|
["agent", async (subcommandArgs) => {
|
|
65
|
-
const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-
|
|
65
|
+
const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-C91eRDZ-.js");
|
|
66
66
|
return runAgentSetupCli(subcommandArgs);
|
|
67
67
|
}],
|
|
68
68
|
["settings", async (subcommandArgs) => {
|
|
@@ -223,7 +223,7 @@ async function runDoctor() {
|
|
|
223
223
|
}
|
|
224
224
|
switchSection("Agents");
|
|
225
225
|
try {
|
|
226
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
226
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-B_uPE1Et.js");
|
|
227
227
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
228
228
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
229
229
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -231,12 +231,13 @@ async function runDoctor() {
|
|
|
231
231
|
const { label, path: resolvedPath } = describeAgentResolvability(id);
|
|
232
232
|
line(`${id} (${label})`, resolvedPath ?? missingAgentText(id));
|
|
233
233
|
}
|
|
234
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
234
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C91eRDZ-.js");
|
|
235
235
|
const grokSetup = inspectGrokAgentSetup();
|
|
236
236
|
line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
|
|
237
|
-
const { default: kimi } = await import("../chunks/kimi-
|
|
238
|
-
const {
|
|
239
|
-
|
|
237
|
+
const { default: kimi } = await import("../chunks/kimi-DP651wx7.js");
|
|
238
|
+
const { describeAgentHome } = await import("../chunks/agent-home-w7C50GTe.js");
|
|
239
|
+
const { KIMI_HOME_PROFILE } = await import("../chunks/agent-home-core-D0FRjVyC.js");
|
|
240
|
+
line("kimi home", describeAgentHome(KIMI_HOME_PROFILE, kimi.expectedHooksBlock()));
|
|
240
241
|
} catch (err) {
|
|
241
242
|
line("agents", `probe failed: ${firstLine(errorText(err))}`);
|
|
242
243
|
}
|
|
@@ -244,7 +245,7 @@ async function runDoctor() {
|
|
|
244
245
|
try {
|
|
245
246
|
const { resolvePackageBin } = await import("../chunks/runtime-paths-DUfaYypN.js");
|
|
246
247
|
const { execFileSync } = await import("../chunks/child-process-safe-BKjzSEYd.js");
|
|
247
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
248
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C91eRDZ-.js");
|
|
248
249
|
const binPath = resolvePackageBin("cc-safety-net", "cc-safety-net");
|
|
249
250
|
line("Sane YOLO", binPath || "not installed");
|
|
250
251
|
if (binPath) line("cc-safety-net version", execFileSync(process.execPath, [binPath, "--version"], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-
|
|
1
|
+
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-M-cwyHEu.js";
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { a as isMissingFileError } from "./text-DoirglWV.js";
|
|
1
|
+
import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { o as relayPath, u as isPathInside } from "./runtime-paths-D_ZjJLE0.js";
|
|
3
3
|
import { Vt as shortSha$1, zt as FULL_SHA_RE } from "./session-BQaAlkib.js";
|
|
4
|
-
import { i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
|
|
4
|
+
import { c as spawn, i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
|
|
5
5
|
import { Dt as UpdateChannel, c as SHELL_AGENT_ID, x as InstallFlavor } from "./config-msD87zbt.js";
|
|
6
6
|
import { o as supervisionLine } from "./session-routes-CmWSbar1.js";
|
|
7
7
|
import { a as rawTextOr, o as textOr, r as numberOr } from "./coerce-oz_Z_6E7.js";
|
|
8
8
|
import { n as resolveAgentCommand, t as buildAgentSpawnCommand } from "./spawn-command-CQECOvjC.js";
|
|
9
9
|
import { n as parseJsonRecord } from "./json-core-If8h-Qgy.js";
|
|
10
|
-
import {
|
|
11
|
-
import { t as buildAgentEnv } from "./spawn-env-
|
|
10
|
+
import { i as saneYoloEnv, r as SANE_YOLO_PATH_ENV, t as CODEX_SANE_YOLO_FLAVOR } from "./sane-yolo-BjUkqIoH.js";
|
|
11
|
+
import { t as buildAgentEnv } from "./spawn-env-Dwzij9eE.js";
|
|
12
12
|
import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
|
|
13
|
-
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-
|
|
13
|
+
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-wsZ9ME8i.js";
|
|
14
14
|
import { O as nextBackoffMs } from "./json-file-AKRVPqG1.js";
|
|
15
15
|
import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-DQkyslls.js";
|
|
16
|
-
import {
|
|
16
|
+
import { c as CODEX_HOME_PROFILE, m as renderCodexHooksBlock, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHookTables } from "./agent-home-core-DZ_zGHQJ.js";
|
|
17
|
+
import { a as holdPreparedAgentHome, c as releaseAgentHome, r as generatedAgentHomePath, s as realAgentHome } from "./agent-home-DMK9PkOo.js";
|
|
18
|
+
import { t as kimi } from "./kimi-suU2c93F.js";
|
|
17
19
|
import fs from "node:fs";
|
|
18
20
|
import path from "node:path";
|
|
21
|
+
import os from "node:os";
|
|
19
22
|
import { z } from "zod";
|
|
23
|
+
import fs$1 from "node:fs/promises";
|
|
20
24
|
//#region session/adapters/claude-code.ts
|
|
21
25
|
var ID$1 = "claude-code";
|
|
22
26
|
var COMMAND_NAME$1 = "claude";
|
|
@@ -1370,6 +1374,139 @@ function codexHookPlanFor(installedVersion) {
|
|
|
1370
1374
|
};
|
|
1371
1375
|
}
|
|
1372
1376
|
//#endregion
|
|
1377
|
+
//#region server/codex-app-server-request.ts
|
|
1378
|
+
function requestCodexAppServer(command, env, request) {
|
|
1379
|
+
return new Promise((resolve) => {
|
|
1380
|
+
let child;
|
|
1381
|
+
try {
|
|
1382
|
+
child = spawn(command.file, [...command.argsBeforeAppServer, "app-server"], {
|
|
1383
|
+
env,
|
|
1384
|
+
stdio: [
|
|
1385
|
+
"pipe",
|
|
1386
|
+
"pipe",
|
|
1387
|
+
"ignore"
|
|
1388
|
+
]
|
|
1389
|
+
});
|
|
1390
|
+
} catch {
|
|
1391
|
+
resolve(null);
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
let bufferedOutput = "";
|
|
1395
|
+
let isSettled = false;
|
|
1396
|
+
const settle = (response) => {
|
|
1397
|
+
if (isSettled) return;
|
|
1398
|
+
isSettled = true;
|
|
1399
|
+
clearTimeout(timer);
|
|
1400
|
+
child.kill();
|
|
1401
|
+
resolve(response);
|
|
1402
|
+
};
|
|
1403
|
+
const timer = setTimeout(() => settle(null), request.timeoutMs);
|
|
1404
|
+
const send = (message) => {
|
|
1405
|
+
child.stdin?.write(`${JSON.stringify(message)}\n`);
|
|
1406
|
+
};
|
|
1407
|
+
const handleLine = (line) => {
|
|
1408
|
+
let message;
|
|
1409
|
+
try {
|
|
1410
|
+
message = JSON.parse(line);
|
|
1411
|
+
} catch {
|
|
1412
|
+
return;
|
|
1413
|
+
}
|
|
1414
|
+
if (message.id === 1) {
|
|
1415
|
+
if (message.error !== void 0) return settle(null);
|
|
1416
|
+
send({
|
|
1417
|
+
jsonrpc: "2.0",
|
|
1418
|
+
method: "initialized"
|
|
1419
|
+
});
|
|
1420
|
+
send({
|
|
1421
|
+
jsonrpc: "2.0",
|
|
1422
|
+
id: 2,
|
|
1423
|
+
method: request.method,
|
|
1424
|
+
params: request.params
|
|
1425
|
+
});
|
|
1426
|
+
return;
|
|
1427
|
+
}
|
|
1428
|
+
if (message.id === 2) settle(message.error === void 0 ? { result: message.result } : null);
|
|
1429
|
+
};
|
|
1430
|
+
child.on("error", () => settle(null));
|
|
1431
|
+
child.on("exit", () => settle(null));
|
|
1432
|
+
child.stdin?.on("error", () => settle(null));
|
|
1433
|
+
child.stdout?.setEncoding("utf8");
|
|
1434
|
+
child.stdout?.on("data", (chunk) => {
|
|
1435
|
+
const lines = (bufferedOutput + chunk).split("\n");
|
|
1436
|
+
bufferedOutput = lines.pop() ?? "";
|
|
1437
|
+
for (const line of lines) handleLine(line);
|
|
1438
|
+
});
|
|
1439
|
+
send({
|
|
1440
|
+
jsonrpc: "2.0",
|
|
1441
|
+
id: 1,
|
|
1442
|
+
method: "initialize",
|
|
1443
|
+
params: {
|
|
1444
|
+
clientInfo: {
|
|
1445
|
+
name: "glimmervoid",
|
|
1446
|
+
title: null,
|
|
1447
|
+
version: "0.1.0"
|
|
1448
|
+
},
|
|
1449
|
+
capabilities: null
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
//#endregion
|
|
1455
|
+
//#region session/codex-hook-trust.ts
|
|
1456
|
+
var HOOK_LIST_TIMEOUT_MS = 15e3;
|
|
1457
|
+
var listedHookSchema = z.object({
|
|
1458
|
+
eventName: z.string(),
|
|
1459
|
+
matcher: z.string().nullable().optional(),
|
|
1460
|
+
command: z.string().nullable().optional(),
|
|
1461
|
+
sourcePath: z.string(),
|
|
1462
|
+
currentHash: z.string()
|
|
1463
|
+
});
|
|
1464
|
+
var hooksListSchema = z.object({ data: z.array(z.object({ hooks: z.array(listedHookSchema) })) });
|
|
1465
|
+
function lowerCamelEventName(event) {
|
|
1466
|
+
return `${event.charAt(0).toLowerCase()}${event.slice(1)}`;
|
|
1467
|
+
}
|
|
1468
|
+
function isListingOf(hook, listed) {
|
|
1469
|
+
return listed.eventName === lowerCamelEventName(hook.event) && (listed.matcher ?? null) === hook.matcher && listed.command === hook.command;
|
|
1470
|
+
}
|
|
1471
|
+
function matchTrustedHashes(hooks, listedHooks) {
|
|
1472
|
+
const unclaimed = [...listedHooks];
|
|
1473
|
+
const hashes = [];
|
|
1474
|
+
for (const hook of hooks) {
|
|
1475
|
+
const listedIndex = unclaimed.findIndex((listed) => isListingOf(hook, listed));
|
|
1476
|
+
const listed = unclaimed[listedIndex];
|
|
1477
|
+
if (!listed) return null;
|
|
1478
|
+
unclaimed.splice(listedIndex, 1);
|
|
1479
|
+
hashes.push(listed.currentHash);
|
|
1480
|
+
}
|
|
1481
|
+
return hashes;
|
|
1482
|
+
}
|
|
1483
|
+
async function readCodexHookHashes(command, hooks, env = process.env) {
|
|
1484
|
+
const probeHome = await fs$1.realpath(await fs$1.mkdtemp(path.join(os.tmpdir(), "glimmervoid-codex-hooks-")));
|
|
1485
|
+
const probeConfigPath = path.join(probeHome, AGENT_HOME_CONFIG_NAME);
|
|
1486
|
+
try {
|
|
1487
|
+
await fs$1.writeFile(probeConfigPath, renderCodexHookTables(hooks), { mode: 384 });
|
|
1488
|
+
const response = await requestCodexAppServer(command, {
|
|
1489
|
+
...env,
|
|
1490
|
+
CODEX_HOME: probeHome
|
|
1491
|
+
}, {
|
|
1492
|
+
method: "hooks/list",
|
|
1493
|
+
params: { cwds: [probeHome] },
|
|
1494
|
+
timeoutMs: HOOK_LIST_TIMEOUT_MS
|
|
1495
|
+
});
|
|
1496
|
+
if (response === null) return { failure: "codex app-server did not answer hooks/list" };
|
|
1497
|
+
const listing = hooksListSchema.safeParse(response.result);
|
|
1498
|
+
if (!listing.success) return { failure: "codex app-server answered hooks/list in a shape Glimmervoid does not read" };
|
|
1499
|
+
const hashes = matchTrustedHashes(hooks, listing.data.data.flatMap((entry) => entry.hooks).filter((listed) => listed.sourcePath === probeConfigPath));
|
|
1500
|
+
if (hashes === null) return { failure: "codex app-server did not list every Glimmervoid hook" };
|
|
1501
|
+
return { hashes };
|
|
1502
|
+
} finally {
|
|
1503
|
+
await fs$1.rm(probeHome, {
|
|
1504
|
+
recursive: true,
|
|
1505
|
+
force: true
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
//#endregion
|
|
1373
1510
|
//#region session/adapters/codex.ts
|
|
1374
1511
|
var ID = "codex";
|
|
1375
1512
|
var COMMAND_NAME = "codex";
|
|
@@ -1431,7 +1568,8 @@ async function readTurnRolloutLines(handle, fileSize, turnId) {
|
|
|
1431
1568
|
return relevantLines;
|
|
1432
1569
|
}
|
|
1433
1570
|
async function readTurnRolloutLinesFromCodexHome(transcriptPath, turnId, agentEnv) {
|
|
1434
|
-
|
|
1571
|
+
const rolloutHomes = [...codexHomes(agentEnv, null), generatedAgentHomePath(CODEX_HOME_PROFILE, agentEnv)];
|
|
1572
|
+
for (const codexHome of rolloutHomes) {
|
|
1435
1573
|
const opened = await openContainedFile(path.resolve(transcriptPath), path.join(codexHome, "sessions"));
|
|
1436
1574
|
if (!opened.ok) continue;
|
|
1437
1575
|
const { handle, stat } = opened.file;
|
|
@@ -1502,12 +1640,15 @@ function userConfigFolders(env) {
|
|
|
1502
1640
|
return codexHomes(env, null);
|
|
1503
1641
|
}
|
|
1504
1642
|
var TOML_LITERAL_STRING_FORBIDDEN = /[\x00-\x08\x0a-\x1f\x27\x7f]/;
|
|
1505
|
-
function buildHookArgs({ relayPath = RELAY_PATH, events = HOOK_EVENTS, matchedRelayHooks = [], bypassHookTrust = false, gatesMcpToolCalls = false, hookTools = [], hookToolRelayPath = HOOK_TOOL_RELAY_PATH, userHooks = [], observeToolCalls = false } = {}) {
|
|
1643
|
+
function buildHookArgs({ relayPath = RELAY_PATH, events = HOOK_EVENTS, matchedRelayHooks = [], bypassHookTrust = false, gatesMcpToolCalls = false, hookTools = [], hookToolRelayPath = HOOK_TOOL_RELAY_PATH, userHooks = [], observeToolCalls = false, hasHomeHooks = false } = {}) {
|
|
1506
1644
|
const args = bypassHookTrust ? [TRUST_BYPASS_FLAG] : [];
|
|
1507
1645
|
const preToolUseGroups = [];
|
|
1508
1646
|
const groupsByEvent = /* @__PURE__ */ new Map();
|
|
1509
|
-
const
|
|
1510
|
-
const
|
|
1647
|
+
const argvEvents = hasHomeHooks ? [] : events;
|
|
1648
|
+
const argvMatchedHooks = hasHomeHooks ? [] : matchedRelayHooks;
|
|
1649
|
+
const argvHookTools = hasHomeHooks ? hookTools.filter((tool) => tool.id !== "saneYolo") : hookTools;
|
|
1650
|
+
const relayedEvents = observeToolCalls && !argvEvents.includes("PreToolUse") ? [...argvEvents, "PreToolUse"] : argvEvents;
|
|
1651
|
+
const relayedMatchedHooks = observeToolCalls ? argvMatchedHooks.filter(({ event }) => event !== "PreToolUse") : argvMatchedHooks;
|
|
1511
1652
|
for (const event of relayedEvents) {
|
|
1512
1653
|
const command = buildHookCommand(relayPath, event);
|
|
1513
1654
|
if (!command) return null;
|
|
@@ -1527,7 +1668,7 @@ function buildHookArgs({ relayPath = RELAY_PATH, events = HOOK_EVENTS, matchedRe
|
|
|
1527
1668
|
}
|
|
1528
1669
|
groupsByEvent.set(event, [...groupsByEvent.get(event) ?? [], group]);
|
|
1529
1670
|
}
|
|
1530
|
-
const groups =
|
|
1671
|
+
const groups = argvHookTools.flatMap((tool) => {
|
|
1531
1672
|
const group = HOOK_TOOLS[tool.id].codexGroup(tool, hookToolRelayPath);
|
|
1532
1673
|
return group ? [group] : [];
|
|
1533
1674
|
});
|
|
@@ -1549,7 +1690,7 @@ function buildHookArgs({ relayPath = RELAY_PATH, events = HOOK_EVENTS, matchedRe
|
|
|
1549
1690
|
}
|
|
1550
1691
|
for (const [event, eventGroups] of groupsByEvent) args.push("-c", `hooks.${event}=[${eventGroups.join(",")}]`);
|
|
1551
1692
|
args.push(...mergeCodexPreToolUse(preToolUseGroups));
|
|
1552
|
-
if (bypassHookTrust && gatesMcpToolCalls) args.push(...
|
|
1693
|
+
if (bypassHookTrust && gatesMcpToolCalls) args.push(...argvHookTools.flatMap((tool) => HOOK_TOOLS[tool.id].codexTrustedArgs(tool)));
|
|
1553
1694
|
return args;
|
|
1554
1695
|
}
|
|
1555
1696
|
var installedHookPlan = null;
|
|
@@ -1596,6 +1737,85 @@ function buildInstalledHookArgs(options = {}) {
|
|
|
1596
1737
|
...options
|
|
1597
1738
|
});
|
|
1598
1739
|
}
|
|
1740
|
+
function codexHomeHooks(plan = hookPlanForInstalledCodex()) {
|
|
1741
|
+
const hooks = [];
|
|
1742
|
+
for (const event of plan.events) {
|
|
1743
|
+
const command = buildHookCommand(RELAY_PATH, event);
|
|
1744
|
+
if (!command) return null;
|
|
1745
|
+
hooks.push({
|
|
1746
|
+
event,
|
|
1747
|
+
matcher: null,
|
|
1748
|
+
command
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
for (const { event, matcher } of plan.matchedRelayHooks) {
|
|
1752
|
+
const command = buildHookCommand(RELAY_PATH, event);
|
|
1753
|
+
if (!command) return null;
|
|
1754
|
+
hooks.push({
|
|
1755
|
+
event,
|
|
1756
|
+
matcher,
|
|
1757
|
+
command
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
const saneYoloCommand = buildHookCommand(HOOK_TOOL_RELAY_PATH, "saneYolo", [CODEX_SANE_YOLO_FLAVOR]);
|
|
1761
|
+
if (!saneYoloCommand) return null;
|
|
1762
|
+
hooks.push({
|
|
1763
|
+
event: "PreToolUse",
|
|
1764
|
+
matcher: "Bash",
|
|
1765
|
+
command: saneYoloCommand
|
|
1766
|
+
});
|
|
1767
|
+
return hooks;
|
|
1768
|
+
}
|
|
1769
|
+
var trustedHashesByHookTables = /* @__PURE__ */ new Map();
|
|
1770
|
+
var pendingTrustReading = null;
|
|
1771
|
+
function installedAppServerCommand() {
|
|
1772
|
+
const command = buildSpawnCommand$1({
|
|
1773
|
+
platform: process.platform,
|
|
1774
|
+
resolved: resolveCommand$1(),
|
|
1775
|
+
agentArgs: []
|
|
1776
|
+
});
|
|
1777
|
+
return {
|
|
1778
|
+
file: command.file,
|
|
1779
|
+
argsBeforeAppServer: command.args
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
async function readHomeHookTrust(hooks, hookTables) {
|
|
1783
|
+
const reading = await Promise.resolve().then(() => readCodexHookHashes(installedAppServerCommand(), hooks)).catch((error) => ({ failure: errorMessage(error) }));
|
|
1784
|
+
if ("failure" in reading) {
|
|
1785
|
+
console.warn(`[codex] Glimmervoid's hooks stay untrusted in the generated Codex home, so Sane YOLO is off for this launch: ${reading.failure}`);
|
|
1786
|
+
return;
|
|
1787
|
+
}
|
|
1788
|
+
trustedHashesByHookTables.set(hookTables, reading.hashes);
|
|
1789
|
+
}
|
|
1790
|
+
function readTrust() {
|
|
1791
|
+
const hooks = codexHomeHooks();
|
|
1792
|
+
if (!hooks) return Promise.resolve();
|
|
1793
|
+
const hookTables = renderCodexHookTables(hooks);
|
|
1794
|
+
if (trustedHashesByHookTables.has(hookTables)) return Promise.resolve();
|
|
1795
|
+
pendingTrustReading ??= readHomeHookTrust(hooks, hookTables).finally(() => {
|
|
1796
|
+
pendingTrustReading = null;
|
|
1797
|
+
});
|
|
1798
|
+
return pendingTrustReading;
|
|
1799
|
+
}
|
|
1800
|
+
function prepareHome(env) {
|
|
1801
|
+
const hooks = codexHomeHooks();
|
|
1802
|
+
if (!hooks) return { refusal: "the hook relay path cannot be written into a codex hooks block" };
|
|
1803
|
+
const trustedHashes = trustedHashesByHookTables.get(renderCodexHookTables(hooks)) ?? null;
|
|
1804
|
+
const realHome = realAgentHome(CODEX_HOME_PROFILE, env);
|
|
1805
|
+
const generatedHome = generatedAgentHomePath(CODEX_HOME_PROFILE, env);
|
|
1806
|
+
const prepared = holdPreparedAgentHome(CODEX_HOME_PROFILE, env, (operatorText) => renderCodexHooksBlock({
|
|
1807
|
+
hooks,
|
|
1808
|
+
trustedHashes,
|
|
1809
|
+
operatorText,
|
|
1810
|
+
realHome,
|
|
1811
|
+
generatedHome
|
|
1812
|
+
}));
|
|
1813
|
+
if ("refusal" in prepared) return prepared;
|
|
1814
|
+
return {
|
|
1815
|
+
home: prepared.home,
|
|
1816
|
+
isTrusted: trustedHashes !== null
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1599
1819
|
var hooks = {
|
|
1600
1820
|
mapSignal: mapHookToSignal,
|
|
1601
1821
|
mapConfidence: mapHookConfidence,
|
|
@@ -1608,7 +1828,13 @@ var hooks = {
|
|
|
1608
1828
|
buildHookArgs: buildInstalledHookArgs,
|
|
1609
1829
|
projectConfigCandidates: PROJECT_CONFIG_CANDIDATES,
|
|
1610
1830
|
userConfigFolders,
|
|
1611
|
-
mayContributeHooks
|
|
1831
|
+
mayContributeHooks,
|
|
1832
|
+
home: {
|
|
1833
|
+
homeEnvName: CODEX_HOME_PROFILE.homeEnvName,
|
|
1834
|
+
readTrust,
|
|
1835
|
+
prepareHome,
|
|
1836
|
+
releaseHome: releaseAgentHome
|
|
1837
|
+
}
|
|
1612
1838
|
}
|
|
1613
1839
|
};
|
|
1614
1840
|
function resolveCommand$1({ platform, execFile = execFileSync, pathExists = fs.existsSync } = {}) {
|
|
@@ -1964,4 +2190,4 @@ function resetCommandCache() {
|
|
|
1964
2190
|
resolvedCommands.clear();
|
|
1965
2191
|
}
|
|
1966
2192
|
//#endregion
|
|
1967
|
-
export {
|
|
2193
|
+
export { isUsageFile as $, exceedsUploadCap as A, isOversizedPartialLine as B, parseResolvedSha as C, totalTokensOf as Ct, MAX_UPLOAD_BYTES as D, openContainedFile as E, claudeCode as Et, MAX_TRANSCRIPT_READ_BYTES as F, codexHomes as G, resumeOffsetFrom as H, TRACE_TAIL_SCAN_BYTES as I, continuationDelayMs as J, codexRootCandidates as K, committedOffsetFromTraceTailOrNull as L, imageMimeForUploadFilename as M, isSafePathSegment as N, buildUploadFilename as O, planUploadRetention as P, grokHomes as Q, completeLineBytes as R, parseRegistryLatest as S, shouldReplace as St, shortSha as T, HOOK_TOOLS as Tt, withCommittedOffset as U, planContiguousRead as V, codexFallbackRoots as W, dedupeCodexFiles as X, decideFileRead as Y, expandTilde as Z, decideUpdateStatus as _, identityFromRelPath as _t, describeAgentResolvability as a, sessionsRootCandidates as at, normalizeUpdateChannel as b, parseJsonLine as bt, isKnownAgentId as c, splitLines as ct, resolveAdapter as d, addEntryToTotals as dt, kimiHomes as et, setCustomAgents as f, dedupKeys as ft, decideInstallFlavor as g, foldReplacementIntoGenerationRollup as gt, requestCodexAppServer as h, foldEntryIntoGenerationRollup as ht, customAgentFingerprint as i, scopedClaudeRoots as it, framePathPaste as j, decideUploadType as k, listAgentIds as l, kimiDedupIdentity as lt, readHostCodexVersion as m, expandAdvisorIterations as mt, cachedAgentResolvability as n, projectDirCandidates as nt, getAdapter as o, shouldEvaluateDespiteIoFailures as ot, codex as p, emptyTotals as pt, codexSessionIdFromPath as q, commandFor as r, resolveProjectsDirs as rt, hookProfileOf as s, shouldPersistWarehouse as st, DEFAULT_AGENT_ID as t, passOutcome as tt, resetCommandCache as u, parseKimiUsageLine as ut, isCheckFresh as v, isWithinGenerationRecencyWindow as vt, pickNewestPublished as w, vendorUsageEntry as wt, parseRegistryDeprecation as x, parseUsageLine as xt, normalizeSha as y, mergeGenerationRollups as yt, containmentRefusalReason as z };
|