glimmervoid 0.49.1-next.508 → 0.49.1-next.509
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 +7 -7
- package/dist/chunks/{adapters-cjLKUasU.js → adapters-BfxRpFYw.js} +1 -1
- package/dist/chunks/{adapters-D-SMUfJi.js → adapters-Bq39QRBp.js} +6 -6
- package/dist/chunks/{agent-home-BHtmhtJA.js → agent-home-Bq9uFynU.js} +12 -3
- package/dist/chunks/{agent-home-core-gp8KlW8i.js → agent-home-core-CIw3YqAH.js} +4 -2
- package/dist/chunks/agent-home-core-e4wxswLi.js +1 -0
- package/dist/chunks/agent-home-zydcIQ-p.js +1 -0
- package/dist/chunks/{agent-setup-cli-BvMppMtM.js → agent-setup-cli-CsmzaPAu.js} +1 -1
- package/dist/chunks/{grok-DrF9dLgS.js → grok-ChYjLvrR.js} +2 -2
- package/dist/chunks/hook-command-core-CG5D9iou.js +147 -0
- package/dist/chunks/kimi-B2tDIaSf.js +1 -0
- package/dist/chunks/{kimi-B8Yf_DIB.js → kimi-CjHEGrF1.js} +30 -5
- package/dist/chunks/{main-CR3PXWUN.js → main-3pLS90YV.js} +6 -7
- package/dist/chunks/{spawn-env-CDazYoWp.js → spawn-env-xtzWf6ru.js} +2 -53
- package/dist/client/assets/{benchmark-panel-CDhcgj8z.js → benchmark-panel-Dn732v0a.js} +1 -1
- package/dist/client/assets/benchmark-panel-Dn732v0a.js.br +0 -0
- package/dist/client/assets/{boards-view-CNgYfri6.js → boards-view-VfWpNyIm.js} +1 -1
- package/dist/client/assets/boards-view-VfWpNyIm.js.br +0 -0
- package/dist/client/assets/{community-panel-DxIZcu7N.js → community-panel-pUyOGrUR.js} +1 -1
- package/dist/client/assets/community-panel-pUyOGrUR.js.br +0 -0
- package/dist/client/assets/{dialogs-DlMtvGSV.js → dialogs-B2jQfTRh.js} +1 -1
- package/dist/client/assets/dialogs-B2jQfTRh.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-cIK-nOb0.js → doc-editor-ui-ULV2xreQ.js} +1 -1
- package/dist/client/assets/doc-editor-ui-ULV2xreQ.js.br +0 -0
- package/dist/client/assets/{feature-hint-wyjSUpzW.js → feature-hint-3E_VeNPb.js} +1 -1
- package/dist/client/assets/feature-hint-3E_VeNPb.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-BlqxVK_o.js → first-run-checklist-BEJLzy29.js} +1 -1
- package/dist/client/assets/first-run-checklist-BEJLzy29.js.br +0 -0
- package/dist/client/assets/{hooks-panel-DZQrLyWw.js → hooks-panel-BoiOxrxY.js} +1 -1
- package/dist/client/assets/hooks-panel-BoiOxrxY.js.br +0 -0
- package/dist/client/assets/{index-pqItVUwb.js → index-0x2w0FO-.js} +5 -5
- package/dist/client/assets/index-0x2w0FO-.js.br +0 -0
- package/dist/client/assets/{issues-panel-1d33xVLA.js → issues-panel-BrSKPP5C.js} +1 -1
- package/dist/client/assets/issues-panel-BrSKPP5C.js.br +0 -0
- package/dist/client/assets/{my-prs-panel--xxhzkjZ.js → my-prs-panel-UKuxBNn6.js} +1 -1
- package/dist/client/assets/my-prs-panel-UKuxBNn6.js.br +0 -0
- package/dist/client/assets/{nyan-cat-BPgDQR25.js → nyan-cat-BR9G3PMX.js} +1 -1
- package/dist/client/assets/nyan-cat-BR9G3PMX.js.br +0 -0
- package/dist/client/assets/{phone-shell-BpP2o_V7.js → phone-shell-iFBhy8Nz.js} +1 -1
- package/dist/client/assets/phone-shell-iFBhy8Nz.js.br +0 -0
- package/dist/client/assets/{plan-face-CFnEkT2w.js → plan-face-DYryiXbx.js} +1 -1
- package/dist/client/assets/plan-face-DYryiXbx.js.br +0 -0
- package/dist/client/assets/{plan-render-DgqCpMLy.js → plan-render-Cj3nLSRn.js} +1 -1
- package/dist/client/assets/plan-render-Cj3nLSRn.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-BkGXPjaK.js → pr-queue-columns-Dd_iIPc4.js} +1 -1
- package/dist/client/assets/pr-queue-columns-Dd_iIPc4.js.br +0 -0
- package/dist/client/assets/{radar-panel-DgHsTnJE.js → radar-panel-BRLjLt50.js} +1 -1
- package/dist/client/assets/radar-panel-BRLjLt50.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-C3EOOMj_.js → repo-roots-adder-DVA4xzhT.js} +1 -1
- package/dist/client/assets/repo-roots-adder-DVA4xzhT.js.br +0 -0
- package/dist/client/assets/{resume-dialog-D_jBebJC.js → resume-dialog-C4F4UCKo.js} +1 -1
- package/dist/client/assets/resume-dialog-C4F4UCKo.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-Df0NvLme.js → review-queue-panel-DZr6gIrF.js} +1 -1
- package/dist/client/assets/review-queue-panel-DZr6gIrF.js.br +0 -0
- package/dist/client/assets/{settings-panel-B1euTGwK.js → settings-panel-CNRBx_9O.js} +2 -2
- package/dist/client/assets/settings-panel-CNRBx_9O.js.br +0 -0
- package/dist/client/assets/{shown-face-CZh-Db7M.js → shown-face-DpPIVpGF.js} +1 -1
- package/dist/client/assets/shown-face-DpPIVpGF.js.br +0 -0
- package/dist/client/assets/{team-review-panel-DW5-d1ML.js → team-review-panel-BmeUu-bO.js} +1 -1
- package/dist/client/assets/team-review-panel-BmeUu-bO.js.br +0 -0
- package/dist/client/assets/{trace-panel-DM_F2-zX.js → trace-panel-BmHltGhj.js} +1 -1
- package/dist/client/assets/trace-panel-BmHltGhj.js.br +0 -0
- package/dist/client/assets/{usage-panel-NPwBCO5C.js → usage-panel-377FVUBL.js} +1 -1
- package/dist/client/assets/usage-panel-377FVUBL.js.br +0 -0
- package/dist/client/assets/{your-day-tip-BlvkGljf.js → your-day-tip-fNFXMQ2L.js} +1 -1
- package/dist/client/assets/your-day-tip-fNFXMQ2L.js.br +3 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/agent-home-DHteh_iQ.js +0 -1
- package/dist/chunks/agent-home-core-DO3oucw-.js +0 -1
- package/dist/chunks/hook-command-core-qTNK-xMF.js +0 -17
- package/dist/chunks/kimi-BhfVJaz7.js +0 -1
- package/dist/client/assets/benchmark-panel-CDhcgj8z.js.br +0 -0
- package/dist/client/assets/boards-view-CNgYfri6.js.br +0 -0
- package/dist/client/assets/community-panel-DxIZcu7N.js.br +0 -0
- package/dist/client/assets/dialogs-DlMtvGSV.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-cIK-nOb0.js.br +0 -0
- package/dist/client/assets/feature-hint-wyjSUpzW.js.br +0 -0
- package/dist/client/assets/first-run-checklist-BlqxVK_o.js.br +0 -0
- package/dist/client/assets/hooks-panel-DZQrLyWw.js.br +0 -0
- package/dist/client/assets/index-pqItVUwb.js.br +0 -0
- package/dist/client/assets/issues-panel-1d33xVLA.js.br +0 -0
- package/dist/client/assets/my-prs-panel--xxhzkjZ.js.br +0 -0
- package/dist/client/assets/nyan-cat-BPgDQR25.js.br +0 -0
- package/dist/client/assets/phone-shell-BpP2o_V7.js.br +0 -0
- package/dist/client/assets/plan-face-CFnEkT2w.js.br +0 -0
- package/dist/client/assets/plan-render-DgqCpMLy.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-BkGXPjaK.js.br +0 -0
- package/dist/client/assets/radar-panel-DgHsTnJE.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-C3EOOMj_.js.br +0 -0
- package/dist/client/assets/resume-dialog-D_jBebJC.js.br +0 -0
- package/dist/client/assets/review-queue-panel-Df0NvLme.js.br +0 -0
- package/dist/client/assets/settings-panel-B1euTGwK.js.br +0 -0
- package/dist/client/assets/shown-face-CZh-Db7M.js.br +0 -0
- package/dist/client/assets/team-review-panel-DW5-d1ML.js.br +0 -0
- package/dist/client/assets/trace-panel-DM_F2-zX.js.br +0 -0
- package/dist/client/assets/usage-panel-NPwBCO5C.js.br +0 -0
- package/dist/client/assets/your-day-tip-BlvkGljf.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -71,7 +71,7 @@ var OWNED_COMMAND_RUNNERS = {
|
|
|
71
71
|
});
|
|
72
72
|
},
|
|
73
73
|
agent: async () => {
|
|
74
|
-
const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-
|
|
74
|
+
const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-CsmzaPAu.js");
|
|
75
75
|
return runAgentSetupCli();
|
|
76
76
|
},
|
|
77
77
|
settings: async (parsed) => {
|
|
@@ -252,7 +252,7 @@ async function runDoctor() {
|
|
|
252
252
|
}
|
|
253
253
|
switchSection("Agents");
|
|
254
254
|
try {
|
|
255
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
255
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-BfxRpFYw.js");
|
|
256
256
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
257
257
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
258
258
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -260,12 +260,12 @@ async function runDoctor() {
|
|
|
260
260
|
const { label, path: resolvedPath } = describeAgentResolvability(id);
|
|
261
261
|
line(`${id} (${label})`, resolvedPath ?? missingAgentText(id));
|
|
262
262
|
}
|
|
263
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
263
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-CsmzaPAu.js");
|
|
264
264
|
const grokSetup = inspectGrokAgentSetup();
|
|
265
265
|
line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
|
|
266
|
-
const { default: kimi } = await import("../chunks/kimi-
|
|
267
|
-
const { describeAgentHome } = await import("../chunks/agent-home-
|
|
268
|
-
const { KIMI_HOME_PROFILE } = await import("../chunks/agent-home-core-
|
|
266
|
+
const { default: kimi } = await import("../chunks/kimi-B2tDIaSf.js");
|
|
267
|
+
const { describeAgentHome } = await import("../chunks/agent-home-zydcIQ-p.js");
|
|
268
|
+
const { KIMI_HOME_PROFILE } = await import("../chunks/agent-home-core-e4wxswLi.js");
|
|
269
269
|
line("kimi home", describeAgentHome(KIMI_HOME_PROFILE, kimi.expectedHooksBlock()));
|
|
270
270
|
} catch (err) {
|
|
271
271
|
line("agents", `probe failed: ${firstLine(errorText(err))}`);
|
|
@@ -274,7 +274,7 @@ async function runDoctor() {
|
|
|
274
274
|
try {
|
|
275
275
|
const { resolvePackageBin } = await import("../chunks/runtime-paths-CKqE4LXP.js");
|
|
276
276
|
const { execFileSync } = await import("../chunks/child-process-safe-BKjzSEYd.js");
|
|
277
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
277
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-CsmzaPAu.js");
|
|
278
278
|
const binPath = resolvePackageBin("cc-safety-net", "cc-safety-net");
|
|
279
279
|
line("Sane YOLO", binPath || "not installed");
|
|
280
280
|
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-Bq39QRBp.js";
|
|
@@ -6,14 +6,14 @@ import { Ht as PLAN_TOOL_NAME, S as InstallFlavor, Vt as PLAN_RESULT_HOOK_EVENT,
|
|
|
6
6
|
import { a as rawTextOr, n as isRecord, o as textOr, r as numberOr } from "./coerce-oz_Z_6E7.js";
|
|
7
7
|
import { n as parseJsonRecord } from "./json-core-If8h-Qgy.js";
|
|
8
8
|
import { i as saneYoloEnv, r as SANE_YOLO_PATH_ENV, t as CODEX_SANE_YOLO_FLAVOR } from "./sane-yolo-BjUkqIoH.js";
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-
|
|
9
|
+
import { n as shellQuote, t as buildHookCommand } from "./hook-command-core-CG5D9iou.js";
|
|
10
|
+
import { t as buildAgentEnv } from "./spawn-env-xtzWf6ru.js";
|
|
11
|
+
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-ChYjLvrR.js";
|
|
12
12
|
import { O as nextBackoffMs, c as loadedJsonValue, d as writeJsonAtomicSync, s as loadJsonStateFileSync, t as appendJsonLine } from "./json-file-AKRVPqG1.js";
|
|
13
13
|
import { h as isExperimentalBuild, m as compareReleaseVersions, s as glimmervoidHomeDir } from "./config-store-DdRVlBmt.js";
|
|
14
|
-
import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-
|
|
15
|
-
import { c as CODEX_HOME_PROFILE, f as renderCodexHookTables, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHooksBlock } from "./agent-home-core-
|
|
16
|
-
import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, s as realAgentHome } from "./agent-home-
|
|
14
|
+
import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-CjHEGrF1.js";
|
|
15
|
+
import { c as CODEX_HOME_PROFILE, f as renderCodexHookTables, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHooksBlock } from "./agent-home-core-CIw3YqAH.js";
|
|
16
|
+
import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, s as realAgentHome } from "./agent-home-Bq9uFynU.js";
|
|
17
17
|
import fs from "node:fs";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import os from "node:os";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { n as glimmervoidHomeDir } from "./config-path-core-DUWk0Lui.js";
|
|
3
3
|
import { p as writeTextAtomicSync } from "./json-file-AKRVPqG1.js";
|
|
4
|
-
import { a as AGENT_HOME_SOURCES_NAME, d as planAgentHome, i as AGENT_HOME_IN_USE_LOCK_NAME, n as AGENT_HOME_CONFIG_NAME, r as AGENT_HOME_CONFLICTS_NAME, t as AGENT_HOME_BASE_NAME, u as fileStampKey } from "./agent-home-core-
|
|
4
|
+
import { a as AGENT_HOME_SOURCES_NAME, d as planAgentHome, i as AGENT_HOME_IN_USE_LOCK_NAME, n as AGENT_HOME_CONFIG_NAME, r as AGENT_HOME_CONFLICTS_NAME, t as AGENT_HOME_BASE_NAME, u as fileStampKey } from "./agent-home-core-CIw3YqAH.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs, { closeSync, mkdirSync, openSync, readdirSync, renameSync, rmSync, unlinkSync } from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
@@ -448,6 +448,14 @@ function prepareAgentHome(profile, options) {
|
|
|
448
448
|
keptPrivateNames.add(step.name);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
+
for (const [name, text] of Object.entries(options.generatedFiles ?? {})) try {
|
|
452
|
+
writeTextAtomicSync(path.join(generatedHome, name), text, {
|
|
453
|
+
mode: GENERATED_FILE_MODE,
|
|
454
|
+
enforceMode: true
|
|
455
|
+
});
|
|
456
|
+
} catch (error) {
|
|
457
|
+
return { refusal: `${path.join(generatedHome, name)} cannot be written: ${errorMessage(error)}` };
|
|
458
|
+
}
|
|
451
459
|
const realHome = realAgentHome(profile, options.env, options.homeDir);
|
|
452
460
|
try {
|
|
453
461
|
writeTextAtomicSync(path.join(generatedHome, AGENT_HOME_SOURCES_NAME), `${JSON.stringify(realFileStamps(realHome), null, 2)}\n`, { mode: GENERATED_FILE_MODE });
|
|
@@ -456,7 +464,7 @@ function prepareAgentHome(profile, options) {
|
|
|
456
464
|
}
|
|
457
465
|
return { home: generatedHome };
|
|
458
466
|
}
|
|
459
|
-
function holdPreparedAgentHome(profile, env, renderBlock) {
|
|
467
|
+
function holdPreparedAgentHome(profile, env, renderBlock, renderGeneratedFiles = () => ({})) {
|
|
460
468
|
const generatedHome = generatedAgentHomePath(profile, env);
|
|
461
469
|
if (path.resolve(realAgentHome(profile, env)) === path.resolve(generatedHome)) return { refusal: `${profile.homeEnvName} already points at the generated home ${generatedHome}` };
|
|
462
470
|
const linkRefusal = agentHomeLinkRefusal(generatedHome);
|
|
@@ -464,7 +472,8 @@ function holdPreparedAgentHome(profile, env, renderBlock) {
|
|
|
464
472
|
holdAgentHome(generatedHome);
|
|
465
473
|
const prepared = prepareAgentHome(profile, {
|
|
466
474
|
env,
|
|
467
|
-
renderBlock
|
|
475
|
+
renderBlock,
|
|
476
|
+
generatedFiles: renderGeneratedFiles()
|
|
468
477
|
});
|
|
469
478
|
if ("refusal" in prepared) releaseAgentHome(generatedHome);
|
|
470
479
|
return prepared;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as buildHookCommand } from "./hook-command-core-
|
|
1
|
+
import { i as KIMI_MCP_CONFIG_NAME, r as KIMI_MCP_BASE_NAME, t as buildHookCommand } from "./hook-command-core-CG5D9iou.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region session/core/agent-home-core.ts
|
|
4
4
|
var BLOCK_START = "# >>> glimmervoid hooks (managed, inert outside Glimmervoid) >>>";
|
|
@@ -294,7 +294,7 @@ function planEntryLink(real, generated, inputs) {
|
|
|
294
294
|
return adoption === "private" ? adoption : [adoption, link];
|
|
295
295
|
}
|
|
296
296
|
function isKeptOutOfLinks(name, inputs) {
|
|
297
|
-
return GENERATED_ONLY_NAMES.has(name) || inputs.profile.isPrivateEntryName(name, inputs.platform);
|
|
297
|
+
return GENERATED_ONLY_NAMES.has(name) || inputs.profile.generatedFileNames.includes(name) || inputs.profile.isPrivateEntryName(name, inputs.platform);
|
|
298
298
|
}
|
|
299
299
|
function planAgentHome(inputs) {
|
|
300
300
|
const config = generatedAgentConfig(inputs);
|
|
@@ -341,6 +341,7 @@ var KIMI_HOME_PROFILE = Object.freeze({
|
|
|
341
341
|
defaultHomeFolderName: ".kimi-code",
|
|
342
342
|
hooksConflict: (operatorText) => definesHooksOutsideArrayTables(operatorText) ? "it defines hooks as a key or [hooks] table, which a [[hooks]] block cannot extend" : null,
|
|
343
343
|
sessionOnlyTablePrefixes: Object.freeze(["[[hooks#"]),
|
|
344
|
+
generatedFileNames: Object.freeze([KIMI_MCP_CONFIG_NAME, KIMI_MCP_BASE_NAME]),
|
|
344
345
|
isPrivateEntryName: () => false
|
|
345
346
|
});
|
|
346
347
|
var CODEX_HOOK_HANDLER_TABLE_HEADER_PATTERN = /^\s*\[(?!\[)\s*hooks\s*(?:\]|\.(?!\s*state\s*[\].]))/;
|
|
@@ -360,6 +361,7 @@ var CODEX_HOME_PROFILE = Object.freeze({
|
|
|
360
361
|
defaultHomeFolderName: ".codex",
|
|
361
362
|
hooksConflict: (operatorText) => definesCodexHooksOutsideArrayTables(operatorText) ? "it defines hooks as a key or a [hooks] table other than [hooks.state], which [[hooks.<event>]] tables cannot extend" : null,
|
|
362
363
|
sessionOnlyTablePrefixes: Object.freeze(["[[hooks.", "[hooks.state."]),
|
|
364
|
+
generatedFileNames: Object.freeze([]),
|
|
363
365
|
isPrivateEntryName: (name, platform) => platform === "win32" && CODEX_SQLITE_NAME_PATTERN.test(name)
|
|
364
366
|
});
|
|
365
367
|
function codexHookTables(hook) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { l as KIMI_HOME_PROFILE } from "./agent-home-core-CIw3YqAH.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as describeAgentHome } from "./agent-home-Bq9uFynU.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import { a as classifyGrokHooksFile, o as renderGrokHooksFile, t as grok } from "./grok-
|
|
2
|
+
import { a as classifyGrokHooksFile, o as renderGrokHooksFile, t as grok } from "./grok-ChYjLvrR.js";
|
|
3
3
|
import { p as writeTextAtomicSync } from "./json-file-AKRVPqG1.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { o as relayPath } from "./runtime-paths-CYwF658V.js";
|
|
3
3
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
4
|
+
import { t as buildHookCommand } from "./hook-command-core-CG5D9iou.js";
|
|
5
|
+
import { t as buildAgentEnv } from "./spawn-env-xtzWf6ru.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import os from "node:os";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
//#region mcp/core/credentials.ts
|
|
2
|
+
var CREDENTIAL_SEPARATOR = ".";
|
|
3
|
+
var BEARER_PREFIX = /^Bearer\s+/i;
|
|
4
|
+
function mcpCredentialFor(sessionId, secret) {
|
|
5
|
+
return `${sessionId}${CREDENTIAL_SEPARATOR}${secret}`;
|
|
6
|
+
}
|
|
7
|
+
function parsePresentedCredential(authorizationHeader) {
|
|
8
|
+
if (!authorizationHeader || !BEARER_PREFIX.test(authorizationHeader)) return null;
|
|
9
|
+
const credential = authorizationHeader.replace(BEARER_PREFIX, "").trim();
|
|
10
|
+
const separatorIndex = credential.indexOf(CREDENTIAL_SEPARATOR);
|
|
11
|
+
if (separatorIndex <= 0 || separatorIndex === credential.length - 1) return null;
|
|
12
|
+
return {
|
|
13
|
+
sessionId: credential.slice(0, separatorIndex),
|
|
14
|
+
secret: credential.slice(separatorIndex + 1)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region mcp/core/agent-config.ts
|
|
19
|
+
var MCP_CREDENTIAL_ENV = "GLIMMERVOID_MCP_TOKEN";
|
|
20
|
+
var MCP_SERVER_NAME = "glimmervoid";
|
|
21
|
+
var MCP_TOOL_TIMEOUT_SECONDS = 600;
|
|
22
|
+
var KIMI_MCP_CONFIG_NAME = "mcp.json";
|
|
23
|
+
var KIMI_MCP_BASE_NAME = ".glimmervoid-mcp-base.json";
|
|
24
|
+
var NO_MCP_LAUNCH = Object.freeze({
|
|
25
|
+
args: [],
|
|
26
|
+
env: {}
|
|
27
|
+
});
|
|
28
|
+
function mcpUrl(listenerPort) {
|
|
29
|
+
return `http://127.0.0.1:${listenerPort}/mcp`;
|
|
30
|
+
}
|
|
31
|
+
function claudeMcpArgs(url) {
|
|
32
|
+
return [
|
|
33
|
+
"--mcp-config",
|
|
34
|
+
JSON.stringify({ mcpServers: { [MCP_SERVER_NAME]: {
|
|
35
|
+
type: "http",
|
|
36
|
+
url,
|
|
37
|
+
headers: { Authorization: `Bearer \${${MCP_CREDENTIAL_ENV}}` }
|
|
38
|
+
} } }),
|
|
39
|
+
"--allowedTools",
|
|
40
|
+
`mcp__${MCP_SERVER_NAME}`
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
function codexMcpArgs(url) {
|
|
44
|
+
return [
|
|
45
|
+
`url=${JSON.stringify(url)}`,
|
|
46
|
+
`bearer_token_env_var=${JSON.stringify(MCP_CREDENTIAL_ENV)}`,
|
|
47
|
+
"default_tools_approval_mode=\"approve\"",
|
|
48
|
+
`tool_timeout_sec=${MCP_TOOL_TIMEOUT_SECONDS}`
|
|
49
|
+
].flatMap((setting) => ["-c", `mcp_servers.${MCP_SERVER_NAME}.${setting}`]);
|
|
50
|
+
}
|
|
51
|
+
function credentialOnly() {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
var ARGS_BY_AGENT = Object.freeze({
|
|
55
|
+
"claude-code": claudeMcpArgs,
|
|
56
|
+
codex: codexMcpArgs,
|
|
57
|
+
kimi: credentialOnly
|
|
58
|
+
});
|
|
59
|
+
function mcpServersOf(mcpJsonText) {
|
|
60
|
+
if (mcpJsonText === null) return null;
|
|
61
|
+
try {
|
|
62
|
+
const parsed = JSON.parse(mcpJsonText);
|
|
63
|
+
if (typeof parsed !== "object" || parsed === null || !("mcpServers" in parsed)) return {};
|
|
64
|
+
const servers = parsed.mcpServers;
|
|
65
|
+
return typeof servers === "object" && servers !== null && !Array.isArray(servers) ? { ...servers } : {};
|
|
66
|
+
} catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function withoutGlimmervoidServer(servers) {
|
|
71
|
+
return Object.fromEntries(Object.entries(servers).filter(([name]) => name !== MCP_SERVER_NAME));
|
|
72
|
+
}
|
|
73
|
+
function isSameServer(first, second) {
|
|
74
|
+
return JSON.stringify(first) === JSON.stringify(second);
|
|
75
|
+
}
|
|
76
|
+
function mergedServer(name, base, ours, theirs) {
|
|
77
|
+
if (isSameServer(theirs[name], base[name])) return ours[name];
|
|
78
|
+
return theirs[name];
|
|
79
|
+
}
|
|
80
|
+
function mergeOperatorServers(base, ours, theirs) {
|
|
81
|
+
if (ours === null) return theirs;
|
|
82
|
+
const baseServers = base ?? {};
|
|
83
|
+
const names = /* @__PURE__ */ new Set([
|
|
84
|
+
...Object.keys(baseServers),
|
|
85
|
+
...Object.keys(ours),
|
|
86
|
+
...Object.keys(theirs)
|
|
87
|
+
]);
|
|
88
|
+
const merged = {};
|
|
89
|
+
for (const name of names) {
|
|
90
|
+
const server = mergedServer(name, baseServers, ours, theirs);
|
|
91
|
+
if (server !== void 0) merged[name] = server;
|
|
92
|
+
}
|
|
93
|
+
return merged;
|
|
94
|
+
}
|
|
95
|
+
function serversFileText(servers) {
|
|
96
|
+
return `${JSON.stringify({ mcpServers: servers }, null, 2)}\n`;
|
|
97
|
+
}
|
|
98
|
+
function kimiMcpFiles({ realMcpJson, generatedMcpJson, baseMcpJson, listenerPort }) {
|
|
99
|
+
const realServers = mcpServersOf(realMcpJson);
|
|
100
|
+
const generatedServers = mcpServersOf(generatedMcpJson);
|
|
101
|
+
const ours = generatedServers === null ? null : withoutGlimmervoidServer(generatedServers);
|
|
102
|
+
const isRealFileUnreadable = realMcpJson !== null && realServers === null;
|
|
103
|
+
const theirs = withoutGlimmervoidServer(realServers ?? {});
|
|
104
|
+
const operatorServers = isRealFileUnreadable ? ours ?? {} : mergeOperatorServers(mcpServersOf(baseMcpJson), ours, theirs);
|
|
105
|
+
const glimmervoidServer = {
|
|
106
|
+
transport: "http",
|
|
107
|
+
url: mcpUrl(listenerPort),
|
|
108
|
+
bearerTokenEnvVar: MCP_CREDENTIAL_ENV,
|
|
109
|
+
toolTimeoutMs: MCP_TOOL_TIMEOUT_SECONDS * 1e3
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
[KIMI_MCP_CONFIG_NAME]: serversFileText({
|
|
113
|
+
...operatorServers,
|
|
114
|
+
[MCP_SERVER_NAME]: glimmervoidServer
|
|
115
|
+
}),
|
|
116
|
+
[KIMI_MCP_BASE_NAME]: isRealFileUnreadable ? baseMcpJson ?? serversFileText(operatorServers) : serversFileText(theirs)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function isBuiltinWithMcpArgs(agentId) {
|
|
120
|
+
return Object.hasOwn(ARGS_BY_AGENT, agentId);
|
|
121
|
+
}
|
|
122
|
+
function mcpLaunchFor({ agentId, listenerPort, sessionId, agentToken }) {
|
|
123
|
+
const buildArgs = isBuiltinWithMcpArgs(agentId) ? ARGS_BY_AGENT[agentId] : void 0;
|
|
124
|
+
if (!buildArgs || !listenerPort || !agentToken) return NO_MCP_LAUNCH;
|
|
125
|
+
return {
|
|
126
|
+
args: buildArgs(mcpUrl(listenerPort)),
|
|
127
|
+
env: { [MCP_CREDENTIAL_ENV]: mcpCredentialFor(sessionId, agentToken) }
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region session/core/hook-command-core.ts
|
|
132
|
+
var SAFE_PATH_RE = /^[A-Za-z0-9_.:/\\ -]+$/;
|
|
133
|
+
var SAFE_EVENT_RE = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
134
|
+
function buildHookCommand(relayPath, event, argvTail = []) {
|
|
135
|
+
const rawPath = String(relayPath);
|
|
136
|
+
const rawEvent = String(event);
|
|
137
|
+
if (!SAFE_PATH_RE.test(rawPath)) return null;
|
|
138
|
+
if (!SAFE_EVENT_RE.test(rawEvent)) return null;
|
|
139
|
+
if (argvTail.some((argument) => !/^[A-Za-z0-9_-]+$/.test(argument))) return null;
|
|
140
|
+
const forwardSlashedPath = rawPath.replace(/\\/g, "/");
|
|
141
|
+
return `node ${/\s/.test(forwardSlashedPath) ? `"${forwardSlashedPath}"` : forwardSlashedPath} ${rawEvent}${argvTail.length ? ` ${argvTail.join(" ")}` : ""}`;
|
|
142
|
+
}
|
|
143
|
+
function shellQuote(value) {
|
|
144
|
+
return `'${String(value).replace(/'/g, `'\\''`)}'`;
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { MCP_CREDENTIAL_ENV as a, parsePresentedCredential as c, KIMI_MCP_CONFIG_NAME as i, shellQuote as n, kimiMcpFiles as o, KIMI_MCP_BASE_NAME as r, mcpLaunchFor as s, buildHookCommand as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as default } from "./kimi-CjHEGrF1.js";
|
|
@@ -2,9 +2,10 @@ import { o as relayPath } from "./runtime-paths-CYwF658V.js";
|
|
|
2
2
|
import { i as ASK_USER_QUESTION_TOOL_NAME } from "./session-DUFWokKF.js";
|
|
3
3
|
import { i as execFileSync } from "./child-process-safe-BCOoKfxG.js";
|
|
4
4
|
import { n as KIMI_SANE_YOLO_FLAVOR } from "./sane-yolo-BjUkqIoH.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { i as KIMI_MCP_CONFIG_NAME, o as kimiMcpFiles, r as KIMI_MCP_BASE_NAME } from "./hook-command-core-CG5D9iou.js";
|
|
6
|
+
import { t as buildAgentEnv } from "./spawn-env-xtzWf6ru.js";
|
|
7
|
+
import { l as KIMI_HOME_PROFILE, m as renderKimiHooksBlock } from "./agent-home-core-CIw3YqAH.js";
|
|
8
|
+
import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, o as prepareScratchAgentHome, s as realAgentHome } from "./agent-home-Bq9uFynU.js";
|
|
8
9
|
import fs from "node:fs";
|
|
9
10
|
import path from "node:path";
|
|
10
11
|
import { createHash } from "node:crypto";
|
|
@@ -288,10 +289,34 @@ function describeInstalledHooks() {
|
|
|
288
289
|
]
|
|
289
290
|
};
|
|
290
291
|
}
|
|
291
|
-
function
|
|
292
|
+
function readTextOrNull(filePath) {
|
|
293
|
+
try {
|
|
294
|
+
return fs.readFileSync(filePath, "utf8");
|
|
295
|
+
} catch {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function isPlainFile(filePath) {
|
|
300
|
+
try {
|
|
301
|
+
return fs.lstatSync(filePath, { throwIfNoEntry: false })?.isFile() === true;
|
|
302
|
+
} catch {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function mcpFilesFor(env, listenerPort) {
|
|
307
|
+
const generatedHome = generatedAgentHomePath(KIMI_HOME_PROFILE, env);
|
|
308
|
+
const generatedMcpPath = path.join(generatedHome, KIMI_MCP_CONFIG_NAME);
|
|
309
|
+
return kimiMcpFiles({
|
|
310
|
+
realMcpJson: readTextOrNull(path.join(realAgentHome(KIMI_HOME_PROFILE, env), KIMI_MCP_CONFIG_NAME)),
|
|
311
|
+
generatedMcpJson: isPlainFile(generatedMcpPath) ? readTextOrNull(generatedMcpPath) : null,
|
|
312
|
+
baseMcpJson: readTextOrNull(path.join(generatedHome, KIMI_MCP_BASE_NAME)),
|
|
313
|
+
listenerPort
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function prepareHome(env, { listenerPort }) {
|
|
292
317
|
const hooksBlock = expectedHooksBlock();
|
|
293
318
|
if (hooksBlock === null) return { refusal: HOOKS_BLOCK_REFUSAL };
|
|
294
|
-
return holdPreparedAgentHome(KIMI_HOME_PROFILE, env, () => hooksBlock);
|
|
319
|
+
return holdPreparedAgentHome(KIMI_HOME_PROFILE, env, () => hooksBlock, () => mcpFilesFor(env, listenerPort));
|
|
295
320
|
}
|
|
296
321
|
function prepareScratchHome(env, scratch) {
|
|
297
322
|
const hooksBlock = expectedHooksBlock();
|
|
@@ -15,14 +15,13 @@ import { n as parseJsonRecord, t as parseJsonOrNull } from "./json-core-If8h-Qgy
|
|
|
15
15
|
import { a as saneYoloFiles } from "./sane-yolo-BjUkqIoH.js";
|
|
16
16
|
import { r as knownWriteHookInput } from "./posthog-read-gate-core-CeSY56AB.js";
|
|
17
17
|
import { _ as findDependencyCycle, a as filesAfterRetention, c as readPageTitle, d as thumbnailOwnerIdOf, f as thumbnailRecipeFor, g as cappedWarnings, h as layoutBoard, i as describeOverCap, l as shownMimeForFilename, m as escapeMarkup, n as SHOWN_SNIFF_BYTES, o as isShownPageMime, p as boardSvgDocument, r as decideShownKind, s as leavesVisibleRawTextOpen, t as SHOWN_PAGE_ZOOM_BRIDGE, u as thumbnailFilenameOf, v as planSteps$1, y as unitsOf } from "./shown-files-core-Dbzn7Pyl.js";
|
|
18
|
-
import { n as
|
|
19
|
-
import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
|
|
18
|
+
import { c as parsePresentedCredential, n as shellQuote, s as mcpLaunchFor } from "./hook-command-core-CG5D9iou.js";
|
|
20
19
|
import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as nextBackoffMs, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-AKRVPqG1.js";
|
|
21
20
|
import { $ as decideRemoteTelemetryState, B as parseDataClientMessage, F as DEEP_HISTORY_SCROLLBACK_LINES, G as buildAiGenerationEvents, H as TELEMETRY_BATCH_URL, J as buildPersonProperties, K as buildBrowserExceptionProperties, L as LOGGED_FAST_CLOSE_COUNTS, P as isExperimentalSetting, Q as decideIsDevInstall, R as describeDataAttach, St as isSameDirectoryPath, U as TELEMETRY_FLAGS_URL, V as FIRST_RUN_NOTICE, W as adapterBucket, X as claudeAccountUuidOf, Y as classifySessionExit, Z as codexUserIdOf, _t as sessionIdFromBranch, a as ensureProjectIds, at as DashboardTelemetryReport, b as validateSettingsBlock, bt as canonicalizePath, ct as TelemetryState, dt as stableConfigKey, et as decideTelemetryConsent, f as DEFAULT_TIMER_FNS, gt as planWorktreeGc, ht as planBranchGc, i as createConfigStore, it as resolveProjectToken, j as valueAtPath, mt as matchedPrefix, n as DEFAULT_CONFIG, nt as nodeMajorVersion, o as generateProjectId, ot as PendingCrashReport, p as unrefTimer, pt as DEFAULT_BRANCH_GC_PREFIXES, q as buildExceptionProperties, rt as parsePosthogReleaseId, s as glimmervoidHomeDir$1, st as TELEMETRY_EVENT_SCHEMAS, t as ABORT_CONFIG_SAVE, tt as exceptionFingerprint, v as mergeSettingsBlock, vt as usablePrefixes, x as SETTINGS_INDEX, xt as comparableDirectoryPath, y as settingsBlockSpecFor, yt as worktreeIntegrationTips, z as parseDataAttach } from "./config-store-DdRVlBmt.js";
|
|
22
|
-
import { i as resolveArgvCommandMatches } from "./kimi-
|
|
23
|
-
import { $ as grokHomes, A as decideUploadType, At as generateToken, B as containmentRefusalReason, Bt as readStoredHooks, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as HOOK_EVENTS, E as shortSha$1, Et as claudeCode, F as planUploadRetention, Ft as agentHookGroupOf, G as codexFallbackRoots, Gt as sweepOrphanedHostScratch, H as planContiguousRead, Ht as upsertHook, I as MAX_TRANSCRIPT_READ_BYTES, It as appendUserHooks, J as codexSessionIdFromPath, Jt as recordSweptPath, K as codexHomes, Kt as appendRemovalRecord, L as TRACE_TAIL_SCAN_BYTES, Lt as hooksForProject, M as framePathPaste, Mt as writeSessionSettings, N as imageMimeForUploadFilename, Nt as HOOK_EVENT_CATALOG, O as MAX_UPLOAD_BYTES, Ot as PLAN_HOLD_RELEASE_MS, P as isSafePathSegment, Pt as ID_RE, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, Rt as normalizeHook, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, Ut as HOOK_TOOLS, V as isOversizedPartialLine, Vt as removeHook, W as withCommittedOffset, Wt as makeHostScratchDirectory, X as decideFileRead, Y as continuationDelayMs, Yt as removalsJournalPath, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, jt as sweepOrphans, k as buildUploadFilename, kt as buildHookSettings, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, qt as appendRemovalRecordSync, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-
|
|
24
|
-
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-
|
|
25
|
-
import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-
|
|
21
|
+
import { i as resolveArgvCommandMatches } from "./kimi-CjHEGrF1.js";
|
|
22
|
+
import { $ as grokHomes, A as decideUploadType, At as generateToken, B as containmentRefusalReason, Bt as readStoredHooks, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as HOOK_EVENTS, E as shortSha$1, Et as claudeCode, F as planUploadRetention, Ft as agentHookGroupOf, G as codexFallbackRoots, Gt as sweepOrphanedHostScratch, H as planContiguousRead, Ht as upsertHook, I as MAX_TRANSCRIPT_READ_BYTES, It as appendUserHooks, J as codexSessionIdFromPath, Jt as recordSweptPath, K as codexHomes, Kt as appendRemovalRecord, L as TRACE_TAIL_SCAN_BYTES, Lt as hooksForProject, M as framePathPaste, Mt as writeSessionSettings, N as imageMimeForUploadFilename, Nt as HOOK_EVENT_CATALOG, O as MAX_UPLOAD_BYTES, Ot as PLAN_HOLD_RELEASE_MS, P as isSafePathSegment, Pt as ID_RE, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, Rt as normalizeHook, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, Ut as HOOK_TOOLS, V as isOversizedPartialLine, Vt as removeHook, W as withCommittedOffset, Wt as makeHostScratchDirectory, X as decideFileRead, Y as continuationDelayMs, Yt as removalsJournalPath, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, jt as sweepOrphans, k as buildUploadFilename, kt as buildHookSettings, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, qt as appendRemovalRecordSync, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-Bq39QRBp.js";
|
|
23
|
+
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-CIw3YqAH.js";
|
|
24
|
+
import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-Bq9uFynU.js";
|
|
26
25
|
import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
|
|
27
26
|
import { a as defaultPairingsPath, c as decideDeviceAuth, i as createSeenStore, l as deviceNameFromUserAgent, n as configSiblingPath, o as defaultSeenPath, r as createPairingsStore, s as DEFAULT_DEVICE_MAX_AGE_MS, u as hashSecret } from "./pairings-store-OtnvMpSP.js";
|
|
28
27
|
import { g as runGit, h as runGh, i as createCommitSessions, m as runCommand, p as gitCommandFailure, t as COMMIT_SESSIONS_FOLDER_NAME } from "./commit-sessions-DpOoG4ys.js";
|
|
@@ -16837,7 +16836,7 @@ function createSessionHookLifecycle(options) {
|
|
|
16837
16836
|
}
|
|
16838
16837
|
function injectGeneratedHomeHooks(port, injection) {
|
|
16839
16838
|
releaseGeneratedHome();
|
|
16840
|
-
const prepared = options.scratchAgentHome ? injection.prepareScratchHome(process.env, options.scratchAgentHome) : injection.prepareHome(process.env);
|
|
16839
|
+
const prepared = options.scratchAgentHome ? injection.prepareScratchHome(process.env, options.scratchAgentHome) : injection.prepareHome(process.env, { listenerPort: port });
|
|
16841
16840
|
if ("refusal" in prepared) return {
|
|
16842
16841
|
...NO_HOOK_INJECTION,
|
|
16843
16842
|
refusal: `${options.agentId} cannot start: ${prepared.refusal}`
|
|
@@ -1,59 +1,8 @@
|
|
|
1
1
|
import { A as SIGN_URL_ENV, r as AGENT_URL_ENV } from "./session-DUFWokKF.js";
|
|
2
2
|
import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
|
|
3
3
|
import { i as saneYoloEnv, r as SANE_YOLO_PATH_ENV } from "./sane-yolo-BjUkqIoH.js";
|
|
4
|
+
import { a as MCP_CREDENTIAL_ENV } from "./hook-command-core-CG5D9iou.js";
|
|
4
5
|
import path from "node:path";
|
|
5
|
-
//#region mcp/core/credentials.ts
|
|
6
|
-
var CREDENTIAL_SEPARATOR = ".";
|
|
7
|
-
var BEARER_PREFIX = /^Bearer\s+/i;
|
|
8
|
-
function mcpCredentialFor(sessionId, secret) {
|
|
9
|
-
return `${sessionId}${CREDENTIAL_SEPARATOR}${secret}`;
|
|
10
|
-
}
|
|
11
|
-
function parsePresentedCredential(authorizationHeader) {
|
|
12
|
-
if (!authorizationHeader || !BEARER_PREFIX.test(authorizationHeader)) return null;
|
|
13
|
-
const credential = authorizationHeader.replace(BEARER_PREFIX, "").trim();
|
|
14
|
-
const separatorIndex = credential.indexOf(CREDENTIAL_SEPARATOR);
|
|
15
|
-
if (separatorIndex <= 0 || separatorIndex === credential.length - 1) return null;
|
|
16
|
-
return {
|
|
17
|
-
sessionId: credential.slice(0, separatorIndex),
|
|
18
|
-
secret: credential.slice(separatorIndex + 1)
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region mcp/core/agent-config.ts
|
|
23
|
-
var MCP_CREDENTIAL_ENV = "GLIMMERVOID_MCP_TOKEN";
|
|
24
|
-
var MCP_SERVER_NAME = "glimmervoid";
|
|
25
|
-
var NO_MCP_LAUNCH = Object.freeze({
|
|
26
|
-
args: [],
|
|
27
|
-
env: {}
|
|
28
|
-
});
|
|
29
|
-
function mcpUrl(listenerPort) {
|
|
30
|
-
return `http://127.0.0.1:${listenerPort}/mcp`;
|
|
31
|
-
}
|
|
32
|
-
function claudeMcpArgs(url) {
|
|
33
|
-
return [
|
|
34
|
-
"--mcp-config",
|
|
35
|
-
JSON.stringify({ mcpServers: { [MCP_SERVER_NAME]: {
|
|
36
|
-
type: "http",
|
|
37
|
-
url,
|
|
38
|
-
headers: { Authorization: `Bearer \${${MCP_CREDENTIAL_ENV}}` }
|
|
39
|
-
} } }),
|
|
40
|
-
"--allowedTools",
|
|
41
|
-
`mcp__${MCP_SERVER_NAME}`
|
|
42
|
-
];
|
|
43
|
-
}
|
|
44
|
-
var ARGS_BY_AGENT = Object.freeze({ "claude-code": claudeMcpArgs });
|
|
45
|
-
function isBuiltinWithMcpArgs(agentId) {
|
|
46
|
-
return Object.hasOwn(ARGS_BY_AGENT, agentId);
|
|
47
|
-
}
|
|
48
|
-
function mcpLaunchFor({ agentId, listenerPort, sessionId, agentToken }) {
|
|
49
|
-
const buildArgs = isBuiltinWithMcpArgs(agentId) ? ARGS_BY_AGENT[agentId] : void 0;
|
|
50
|
-
if (!buildArgs || !listenerPort || !agentToken) return NO_MCP_LAUNCH;
|
|
51
|
-
return {
|
|
52
|
-
args: buildArgs(mcpUrl(listenerPort)),
|
|
53
|
-
env: { [MCP_CREDENTIAL_ENV]: mcpCredentialFor(sessionId, agentToken) }
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
//#endregion
|
|
57
6
|
//#region session/core/spawn-env.ts
|
|
58
7
|
var GLIMMERVOID_SCRUB_KEYS = [
|
|
59
8
|
"GLIMMERVOID_PORT",
|
|
@@ -130,4 +79,4 @@ function buildAgentEnv(baseEnv, extraEnv, profile, { prependPathDirs = [] } = {}
|
|
|
130
79
|
return env;
|
|
131
80
|
}
|
|
132
81
|
//#endregion
|
|
133
|
-
export {
|
|
82
|
+
export { buildAgentEnv as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-C1nXfl7Z.js";import{n as e,r as t,s as n}from"./dom-helpers-qjWTsLGI.js";import{Mi as r,Ni as i,Pi as a}from"./index-
|
|
1
|
+
import"./updates-view-core-C1nXfl7Z.js";import{n as e,r as t,s as n}from"./dom-helpers-qjWTsLGI.js";import{Mi as r,Ni as i,Pi as a}from"./index-0x2w0FO-.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,r){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=r,a.addEventListener(`click`,()=>i(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,i){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=r(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===i.id,f=!!e.inFlight&&!l,m=o.has(i.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,i.title),t(`bench`,i.caseCount===1?`case`:`cases`,String(i.caseCount)),t(`bench`,i.candidateCount===1?`candidate`:`candidates`,String(i.candidateCount)),t(`bench`,`arms`,String(i.armIds.length))),c.append(h);let g=n(`div`,`bench-controls`),_=e.configured===!0&&i.error===null;g.append(u(i,`mine`,!_||m||l),u(i,`run`,!_||m||l||f||i.caseCount===0),u(i,`cancel`,m||!l));let v=n(`span`,`bench-status`,(a?``:`Not connected to the server. Reconnecting.`)||d(e,i)||s.get(i.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),i.error)return c.append(n(`p`,`bench-error`,i.error)),c;let y=i.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,i.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:t}=r(),i=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(i),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};
|
|
Binary file
|