glimmervoid 0.49.1-next.504 → 0.49.1-next.507

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.
Files changed (92) hide show
  1. package/dist/bin/glimmervoid.js +5 -5
  2. package/dist/chunks/{adapters-BCzX13NB.js → adapters-D-SMUfJi.js} +3 -3
  3. package/dist/chunks/{adapters--mFzBNAs.js → adapters-cjLKUasU.js} +1 -1
  4. package/dist/chunks/{agent-setup-cli-UjxzgUCz.js → agent-setup-cli-BvMppMtM.js} +1 -1
  5. package/dist/chunks/{grok-BeRuWXFn.js → grok-DrF9dLgS.js} +1 -1
  6. package/dist/chunks/{kimi-CSByGhDL.js → kimi-B8Yf_DIB.js} +1 -1
  7. package/dist/chunks/kimi-BhfVJaz7.js +1 -0
  8. package/dist/chunks/{main-CNGBjHoZ.js → main-w4qYQZnc.js} +462 -4
  9. package/dist/chunks/{spawn-env-POxyFuJA.js → spawn-env-CDazYoWp.js} +54 -1
  10. package/dist/client/assets/{benchmark-panel-CZA9bVAy.js → benchmark-panel-BEqoWawW.js} +1 -1
  11. package/dist/client/assets/benchmark-panel-BEqoWawW.js.br +0 -0
  12. package/dist/client/assets/{boards-view-IHWbw7On.js → boards-view-B5zlhqPq.js} +1 -1
  13. package/dist/client/assets/boards-view-B5zlhqPq.js.br +0 -0
  14. package/dist/client/assets/{community-panel-D3cF0N9D.js → community-panel-Tt6kivkQ.js} +1 -1
  15. package/dist/client/assets/community-panel-Tt6kivkQ.js.br +0 -0
  16. package/dist/client/assets/{dialogs-CruMbo-L.js → dialogs-CBag6vU5.js} +1 -1
  17. package/dist/client/assets/dialogs-CBag6vU5.js.br +0 -0
  18. package/dist/client/assets/{doc-editor-ui-DxXk5_OW.js → doc-editor-ui-NfjCtcrC.js} +1 -1
  19. package/dist/client/assets/doc-editor-ui-NfjCtcrC.js.br +0 -0
  20. package/dist/client/assets/{feature-hint-C9OsodpO.js → feature-hint-BflYZVMw.js} +1 -1
  21. package/dist/client/assets/feature-hint-BflYZVMw.js.br +0 -0
  22. package/dist/client/assets/{first-run-checklist-ZuNQB3cI.js → first-run-checklist-B3dDH6Vq.js} +1 -1
  23. package/dist/client/assets/first-run-checklist-B3dDH6Vq.js.br +0 -0
  24. package/dist/client/assets/{hooks-panel-DTwytDEm.js → hooks-panel-DAQ0BWlw.js} +1 -1
  25. package/dist/client/assets/hooks-panel-DAQ0BWlw.js.br +0 -0
  26. package/dist/client/assets/{index-dsf9cQsn.js → index-B_s3KLcn.js} +5 -5
  27. package/dist/client/assets/index-B_s3KLcn.js.br +0 -0
  28. package/dist/client/assets/{issues-panel-iiDa-yu6.js → issues-panel-CXpJlaAG.js} +1 -1
  29. package/dist/client/assets/issues-panel-CXpJlaAG.js.br +0 -0
  30. package/dist/client/assets/{my-prs-panel-fKSAadty.js → my-prs-panel-Cbs34_2c.js} +1 -1
  31. package/dist/client/assets/my-prs-panel-Cbs34_2c.js.br +0 -0
  32. package/dist/client/assets/{nyan-cat-40EpIYdF.js → nyan-cat-meo2tUad.js} +1 -1
  33. package/dist/client/assets/nyan-cat-meo2tUad.js.br +0 -0
  34. package/dist/client/assets/{phone-shell-dpLIvcsz.js → phone-shell-czZzIUpK.js} +1 -1
  35. package/dist/client/assets/phone-shell-czZzIUpK.js.br +0 -0
  36. package/dist/client/assets/{plan-face-h6Y0Tb26.js → plan-face-CwrI6EoN.js} +1 -1
  37. package/dist/client/assets/plan-face-CwrI6EoN.js.br +0 -0
  38. package/dist/client/assets/{plan-render-Dx2mUuxK.js → plan-render-BoWpxBqk.js} +1 -1
  39. package/dist/client/assets/plan-render-BoWpxBqk.js.br +0 -0
  40. package/dist/client/assets/{pr-queue-columns-V81vbb3h.js → pr-queue-columns-CgTEE4vF.js} +1 -1
  41. package/dist/client/assets/pr-queue-columns-CgTEE4vF.js.br +0 -0
  42. package/dist/client/assets/{radar-panel-ByuU26KF.js → radar-panel-tQ6gg3IL.js} +1 -1
  43. package/dist/client/assets/radar-panel-tQ6gg3IL.js.br +0 -0
  44. package/dist/client/assets/{repo-roots-adder-hHJRjYCg.js → repo-roots-adder-DeTVTMR8.js} +1 -1
  45. package/dist/client/assets/repo-roots-adder-DeTVTMR8.js.br +0 -0
  46. package/dist/client/assets/{resume-dialog-Cc5WGm3r.js → resume-dialog-CqMwg5lD.js} +1 -1
  47. package/dist/client/assets/resume-dialog-CqMwg5lD.js.br +0 -0
  48. package/dist/client/assets/{review-queue-panel-BX-A7v4Q.js → review-queue-panel-TXMbPDRB.js} +1 -1
  49. package/dist/client/assets/review-queue-panel-TXMbPDRB.js.br +0 -0
  50. package/dist/client/assets/{settings-panel-DQTMuSuk.js → settings-panel-DN72eCIu.js} +2 -2
  51. package/dist/client/assets/settings-panel-DN72eCIu.js.br +0 -0
  52. package/dist/client/assets/{shown-face-Bg9nvVsj.js → shown-face-CdGiglI_.js} +1 -1
  53. package/dist/client/assets/shown-face-CdGiglI_.js.br +0 -0
  54. package/dist/client/assets/{team-review-panel-OJfrP57g.js → team-review-panel-CzngC3iy.js} +1 -1
  55. package/dist/client/assets/team-review-panel-CzngC3iy.js.br +0 -0
  56. package/dist/client/assets/{trace-panel-D9VOLGHS.js → trace-panel-DcyTn3du.js} +1 -1
  57. package/dist/client/assets/trace-panel-DcyTn3du.js.br +0 -0
  58. package/dist/client/assets/{usage-panel-BtVQ_Iti.js → usage-panel-DA1LYw7p.js} +1 -1
  59. package/dist/client/assets/usage-panel-DA1LYw7p.js.br +0 -0
  60. package/dist/client/assets/{your-day-tip-CJXY8R4U.js → your-day-tip-DId8pS5F.js} +1 -1
  61. package/dist/client/assets/your-day-tip-DId8pS5F.js.br +0 -0
  62. package/dist/client/index.html +1 -1
  63. package/dist/client/index.html.br +0 -0
  64. package/dist/server/index.js +1 -1
  65. package/package.json +3 -1
  66. package/dist/chunks/kimi-D1kokaLt.js +0 -1
  67. package/dist/client/assets/benchmark-panel-CZA9bVAy.js.br +0 -0
  68. package/dist/client/assets/boards-view-IHWbw7On.js.br +0 -0
  69. package/dist/client/assets/community-panel-D3cF0N9D.js.br +0 -0
  70. package/dist/client/assets/dialogs-CruMbo-L.js.br +0 -0
  71. package/dist/client/assets/doc-editor-ui-DxXk5_OW.js.br +0 -0
  72. package/dist/client/assets/feature-hint-C9OsodpO.js.br +0 -0
  73. package/dist/client/assets/first-run-checklist-ZuNQB3cI.js.br +0 -0
  74. package/dist/client/assets/hooks-panel-DTwytDEm.js.br +0 -0
  75. package/dist/client/assets/index-dsf9cQsn.js.br +0 -0
  76. package/dist/client/assets/issues-panel-iiDa-yu6.js.br +0 -0
  77. package/dist/client/assets/my-prs-panel-fKSAadty.js.br +0 -0
  78. package/dist/client/assets/nyan-cat-40EpIYdF.js.br +0 -0
  79. package/dist/client/assets/phone-shell-dpLIvcsz.js.br +0 -0
  80. package/dist/client/assets/plan-face-h6Y0Tb26.js.br +0 -0
  81. package/dist/client/assets/plan-render-Dx2mUuxK.js.br +0 -0
  82. package/dist/client/assets/pr-queue-columns-V81vbb3h.js.br +0 -0
  83. package/dist/client/assets/radar-panel-ByuU26KF.js.br +0 -0
  84. package/dist/client/assets/repo-roots-adder-hHJRjYCg.js.br +0 -0
  85. package/dist/client/assets/resume-dialog-Cc5WGm3r.js.br +0 -0
  86. package/dist/client/assets/review-queue-panel-BX-A7v4Q.js.br +0 -0
  87. package/dist/client/assets/settings-panel-DQTMuSuk.js.br +0 -0
  88. package/dist/client/assets/shown-face-Bg9nvVsj.js.br +0 -0
  89. package/dist/client/assets/team-review-panel-OJfrP57g.js.br +0 -0
  90. package/dist/client/assets/trace-panel-D9VOLGHS.js.br +0 -0
  91. package/dist/client/assets/usage-panel-BtVQ_Iti.js.br +0 -0
  92. package/dist/client/assets/your-day-tip-CJXY8R4U.js.br +0 -0
@@ -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-UjxzgUCz.js");
74
+ const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-BvMppMtM.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--mFzBNAs.js");
255
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-cjLKUasU.js");
256
256
  const declaredCustomAgents = await readDeclaredCustomAgents();
257
257
  if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
258
258
  setCustomAgents(declaredCustomAgents.declared);
@@ -260,10 +260,10 @@ 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-UjxzgUCz.js");
263
+ const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-BvMppMtM.js");
264
264
  const grokSetup = inspectGrokAgentSetup();
265
265
  line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
266
- const { default: kimi } = await import("../chunks/kimi-D1kokaLt.js");
266
+ const { default: kimi } = await import("../chunks/kimi-BhfVJaz7.js");
267
267
  const { describeAgentHome } = await import("../chunks/agent-home-DHteh_iQ.js");
268
268
  const { KIMI_HOME_PROFILE } = await import("../chunks/agent-home-core-DO3oucw-.js");
269
269
  line("kimi home", describeAgentHome(KIMI_HOME_PROFILE, kimi.expectedHooksBlock()));
@@ -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-UjxzgUCz.js");
277
+ const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-BvMppMtM.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"], {
@@ -6,12 +6,12 @@ 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 buildAgentEnv } from "./spawn-env-POxyFuJA.js";
9
+ import { t as buildAgentEnv } from "./spawn-env-CDazYoWp.js";
10
10
  import { n as shellQuote, t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
11
- import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-BeRuWXFn.js";
11
+ import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-DrF9dLgS.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-CSByGhDL.js";
14
+ import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-B8Yf_DIB.js";
15
15
  import { c as CODEX_HOME_PROFILE, f as renderCodexHookTables, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHooksBlock } from "./agent-home-core-gp8KlW8i.js";
16
16
  import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, s as realAgentHome } from "./agent-home-BHtmhtJA.js";
17
17
  import fs from "node:fs";
@@ -1 +1 @@
1
- export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-BCzX13NB.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-D-SMUfJi.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-BeRuWXFn.js";
2
+ import { a as classifyGrokHooksFile, o as renderGrokHooksFile, t as grok } from "./grok-DrF9dLgS.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,7 +1,7 @@
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 buildAgentEnv } from "./spawn-env-POxyFuJA.js";
4
+ import { t as buildAgentEnv } from "./spawn-env-CDazYoWp.js";
5
5
  import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
@@ -2,7 +2,7 @@ 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 { t as buildAgentEnv } from "./spawn-env-POxyFuJA.js";
5
+ import { t as buildAgentEnv } from "./spawn-env-CDazYoWp.js";
6
6
  import { l as KIMI_HOME_PROFILE, m as renderKimiHooksBlock } from "./agent-home-core-gp8KlW8i.js";
7
7
  import { c as releaseAgentHome, i as holdPreparedAgentHome, o as prepareScratchAgentHome, s as realAgentHome } from "./agent-home-BHtmhtJA.js";
8
8
  import fs from "node:fs";
@@ -0,0 +1 @@
1
+ export { t as default } from "./kimi-B8Yf_DIB.js";
@@ -3,7 +3,7 @@ import { n as sanitizeOneLine, r as showHomeAsTilde, t as firstLine$1 } from "./
3
3
  import { a as isMissingFileError, r as errorMessage, t as errorCode } from "./text-DoirglWV.js";
4
4
  import { a as packageRoot, c as resolvePackageBin, d as isPathInside, f as safePathSegment, i as clientDir, l as caseFoldedPathKey, n as bundled, o as relayPath, p as sanitizeWorktreeName, r as cliPath, s as resolveFfmpegPath, t as assetRoot, u as equalsIgnoringCaseOnWindows } from "./runtime-paths-CYwF658V.js";
5
5
  import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
6
- import { $ as WHITEBOARD_LIMITS, A as SIGN_URL_ENV, Bt as ReviewThreadId, D as SESSION_NAME_PATTERN, Dt as DECIDING_REVIEW_STATES, Et as CommitSha, F as ShownFile, Gt as TeamReviewResolveResponse, Ht as TeamReviewActionRequest, It as ReviewComment, J as Note, Jt as TeamReviewThreadCommentsResponse, K as Box, Kt as TeamReviewStateEntry, L as SshSignRequest, Lt as ReviewDraft, Mt as PostedReviewEvent, Nt as PostingPlan, O as SESSION_NAME_RULE_TEXT, Ot as EarlierReview, Pt as PrDetail, Q as Unit, Qt as decisionAsIfApprovalRequired, Rt as ReviewFinding, S as ConversationQuestion, T as SESSION_DOC_BODY_CAP_BYTES, U as BoardRecord, Vt as ReviewVerdict, Wt as TeamReviewCompareFiles, X as Panel, Xt as TeamReviewThreadsRepository, Yt as TeamReviewThreadResult, Zt as canApproveAfterComment, _ as COHERENCE_HOOKS_INACTIVE, an as NODE_ID_RE, at as MyPrAutoRebase, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as MyPrsSnapshot, ct as MyPrKeepMergeableRequest, dt as MyPrMergeMethod, en as hasStandingViewerApproval, fn as BADGE_LABELS, ft as MyPrMergeRequest, gn as STATES, hn as RESTARTABLE_STATES, ht as MyPrMergeWhenReadyRequest, i as ASK_USER_QUESTION_TOOL_NAME, in as GH_SEGMENT, it as MyPr, j as SSH_SIGN_BODY_CAP_BYTES, jt as GithubReviewState, k as SHOWN_FILE_CAP_BYTES, kt as FindingSeverity, mn as MERGEABLE_LIVE_STATES, mt as MyPrMergeStateResponse, nn as HEX_SHA_RE, nt as Wire, on as REPO_SLUG_RE, ot as MyPrCheckContext, pn as KILLABLE_STATES, q as Frame, qt as TeamReviewStatus, r as AGENT_URL_ENV, rn as shortSha, rt as LinkedPr, sn as repoParts, st as MyPrCheckContextsResponse, ut as MyPrLaneEntry, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, vt as MyPrThreadNode, xt as MyPrsState, y as CONVERSATION_PERMISSION_HOOK_EVENT, yt as MyPrThreadsResponse, z as TaskTitle, zt as ReviewResult } from "./session-DUFWokKF.js";
6
+ import { $ as WHITEBOARD_LIMITS, A as SIGN_URL_ENV, Bt as ReviewThreadId, D as SESSION_NAME_PATTERN, Dt as DECIDING_REVIEW_STATES, Et as CommitSha, F as ShownFile, Gt as TeamReviewResolveResponse, Ht as TeamReviewActionRequest, It as ReviewComment, J as Note, Jt as TeamReviewThreadCommentsResponse, K as Box, Kt as TeamReviewStateEntry, L as SshSignRequest, Lt as ReviewDraft, Mt as PostedReviewEvent, Nt as PostingPlan, O as SESSION_NAME_RULE_TEXT, Ot as EarlierReview, Pt as PrDetail, Q as Unit, Qt as decisionAsIfApprovalRequired, Rt as ReviewFinding, S as ConversationQuestion, T as SESSION_DOC_BODY_CAP_BYTES, U as BoardRecord, Vt as ReviewVerdict, Wt as TeamReviewCompareFiles, X as Panel, Xt as TeamReviewThreadsRepository, Y as Op, Yt as TeamReviewThreadResult, Zt as canApproveAfterComment, _ as COHERENCE_HOOKS_INACTIVE, an as NODE_ID_RE, at as MyPrAutoRebase, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as MyPrsSnapshot, c as AgentEditRequest, ct as MyPrKeepMergeableRequest, dt as MyPrMergeMethod, en as hasStandingViewerApproval, fn as BADGE_LABELS, ft as MyPrMergeRequest, g as AgentSpawnRequest, gn as STATES, h as AgentSettingsRequest, hn as RESTARTABLE_STATES, ht as MyPrMergeWhenReadyRequest, i as ASK_USER_QUESTION_TOOL_NAME, in as GH_SEGMENT, it as MyPr, j as SSH_SIGN_BODY_CAP_BYTES, jt as GithubReviewState, k as SHOWN_FILE_CAP_BYTES, kt as FindingSeverity, mn as MERGEABLE_LIVE_STATES, mt as MyPrMergeStateResponse, nn as HEX_SHA_RE, nt as Wire, o as AgentAttentionRequest, on as REPO_SLUG_RE, ot as MyPrCheckContext, pn as KILLABLE_STATES, q as Frame, qt as TeamReviewStatus, r as AGENT_URL_ENV, rn as shortSha, rt as LinkedPr, s as AgentCloseRequest, sn as repoParts, st as MyPrCheckContextsResponse, u as AgentPullRequestRequest, ut as MyPrLaneEntry, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, vt as MyPrThreadNode, xt as MyPrsState, y as CONVERSATION_PERMISSION_HOOK_EVENT, yt as MyPrThreadsResponse, z as TaskTitle, zt as ReviewResult } from "./session-DUFWokKF.js";
7
7
  import { c as spawn, i as execFileSync, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BCOoKfxG.js";
8
8
  import { $t as IssuesSearchResponse, A as HINT_VIEW_BY_FEATURE, At as UpdateJournal, B as MergedPrListing, Bt as PLAN_HOOK_OUTPUT_MAX_CHARS, Ct as CommunityItem, D as pullRequestKeyFromReference, Dt as SKILL_NAME_RE, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as CoherenceJournalOutput, G as GithubPrLightSearchNode, Gt as parseExitPlanModeHookPayload, H as PrCheckoutCaseInput, Ht as PLAN_TOOL_NAME, I as BenchmarkRun, It as ChangeMap, J as WorkflowCommentBody, Jt as HookEnvelope, K as GithubPrsFrame, Kt as planTitle, L as BenchmarkStatus, Lt as changeMapFactId, M as BenchmarkActionRequest, Mt as MAX_RAW_LINE_CHARS, N as BenchmarkCase, Nt as TraceCheckpoint, O as FeatureHintState, P as BenchmarkId, Pt as TraceRecord, Qt as IssueUpdate, R as BenchmarkSuite, Rt as PLAN_BODY_CAP_BYTES, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanDecision, V as MinedPrReviewData, Vt as PLAN_RESULT_HOOK_EVENT, W as GithubPrKey, Wt as PlanRevision, X as WorkflowsSettings, Xt as GithubIssueResponse, Y as WorkflowLabelName, Yt as GithubIssuePullRequestsRepository, Z as WorkflowsState, Zt as IssueKey, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, en as IssuesState, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as SessionSetup, k as HINT_FEATURES, nn as issuePullRequestStateFromGithub, p as USAGE_VENDOR_KEYS, q as comparablePrKey, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, tn as IssuesStatus, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_EVENT } from "./config-Cq5ButJ9.js";
9
9
  import { $ as supervisionLine, A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, Q as routeAgentNotes, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, X as permitsHelpCommand, Y as hintFor, Z as promptHintFor, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, et as toolHookFactsOf, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as describeSessionLimits, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-BCRpZ3sc.js";
@@ -15,11 +15,12 @@ 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 { a as filesAfterRetention, c as readPageTitle, d as thumbnailOwnerIdOf, f as thumbnailRecipeFor, g as findDependencyCycle, h as cappedWarnings, i as describeOverCap, l as shownMimeForFilename, m as layoutBoard, n as SHOWN_SNIFF_BYTES, o as isShownPageMime, p as escapeMarkup, r as decideShownKind, s as leavesVisibleRawTextOpen, t as SHOWN_PAGE_ZOOM_BRIDGE, u as thumbnailFilenameOf, v as unitsOf } from "./shown-files-core-CiEXUXvy.js";
18
+ import { n as mcpLaunchFor, r as parsePresentedCredential } from "./spawn-env-CDazYoWp.js";
18
19
  import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
19
20
  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";
20
21
  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";
21
- import { i as resolveArgvCommandMatches } from "./kimi-CSByGhDL.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-BCzX13NB.js";
22
+ import { i as resolveArgvCommandMatches } from "./kimi-B8Yf_DIB.js";
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-D-SMUfJi.js";
23
24
  import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-gp8KlW8i.js";
24
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-BHtmhtJA.js";
25
26
  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";
@@ -38,6 +39,9 @@ import { pipeline } from "node:stream";
38
39
  import net, { isIPv6 } from "node:net";
39
40
  import fs$1, { chmod, copyFile, lstat, mkdir, mkdtemp, open, readFile, readdir, readlink, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
40
41
  import express from "express";
42
+ import { toNodeHandler } from "@modelcontextprotocol/node";
43
+ import { McpServer, createMcpHandler } from "@modelcontextprotocol/server";
44
+ import { pipeline as pipeline$1 } from "node:stream/promises";
41
45
  import WebSocket$1, { WebSocket, WebSocketServer } from "ws";
42
46
  import { EventEmitter } from "node:events";
43
47
  import pty from "node-pty";
@@ -534,6 +538,443 @@ function createLifecycle({ shutdown, httpServer, extraServers = [], onRestart =
534
538
  };
535
539
  }
536
540
  //#endregion
541
+ //#region mcp/core/instructions.ts
542
+ var SERVER_INSTRUCTIONS = [
543
+ "Glimmervoid supervises this session and shows it to the operator on a dashboard.",
544
+ "Use the session tool to spawn work that edits files or runs long: the spawned session gets its own dashboard card the operator can watch, where an in-process subagent stays fine only for a quick read-only lookup.",
545
+ "Use the whiteboard tool to draw a diagram, architecture map or plan the operator can see and edit, rather than drawing one in chat.",
546
+ "Use push to land this session's commits when a plain git push is refused, attention to ask the operator for a decision, review for team pull request reviews, and settings to read Glimmervoid's settings.",
547
+ "session limits reports what this session may do."
548
+ ].join(" ");
549
+ //#endregion
550
+ //#region mcp/show.ts
551
+ var OPEN_WITHOUT_BLOCKING_ON_A_PIPE = fs.constants.O_RDONLY | (fs.constants.O_NONBLOCK ?? 0);
552
+ function refusal$2(status, error) {
553
+ return {
554
+ status,
555
+ body: {
556
+ ok: false,
557
+ error
558
+ }
559
+ };
560
+ }
561
+ function remoteRefusal(workspace) {
562
+ return refusal$2(409, `show reads files on the Glimmervoid machine, and this session runs in the Coder workspace ${workspace}, so its files are not there`);
563
+ }
564
+ async function copyCapped(handle, incomingPath) {
565
+ let copiedBytes = 0;
566
+ const source = handle.createReadStream({
567
+ start: 0,
568
+ end: SHOWN_FILE_CAP_BYTES,
569
+ autoClose: false
570
+ });
571
+ source.on("data", (chunk) => {
572
+ copiedBytes += chunk.length;
573
+ });
574
+ await pipeline$1(source, fs.createWriteStream(incomingPath, { mode: 384 }));
575
+ return copiedBytes > 209715200 ? null : copiedBytes;
576
+ }
577
+ async function openRegularFile(absolutePath) {
578
+ if (!(await fs$1.stat(absolutePath).catch(() => null))?.isFile()) return null;
579
+ const handle = await fs$1.open(absolutePath, OPEN_WITHOUT_BLOCKING_ON_A_PIPE).catch(() => null);
580
+ if (!handle) return null;
581
+ if ((await handle.stat().catch(() => null))?.isFile()) return handle;
582
+ await handle.close();
583
+ return null;
584
+ }
585
+ async function storeAndAdmit(session, shownFiles, handle, name, caption) {
586
+ const incomingPath = await shownFiles.reserveIncomingPath(session.id);
587
+ const copiedBytes = await copyCapped(handle, incomingPath).catch(() => void 0);
588
+ if (copiedBytes === void 0 || copiedBytes === null) {
589
+ await fs$1.unlink(incomingPath).catch(() => {});
590
+ if (copiedBytes === null) return refusal$2(413, describeOverCap(name, null));
591
+ return refusal$2(500, `could not read ${name}`);
592
+ }
593
+ const admitted = await shownFiles.admit(session, {
594
+ incomingPath,
595
+ name,
596
+ caption,
597
+ sizeBytes: copiedBytes
598
+ });
599
+ if (!admitted.ok) return refusal$2(admitted.status, admitted.error);
600
+ return {
601
+ status: 200,
602
+ body: {
603
+ ok: true,
604
+ shown: {
605
+ name: admitted.file.name,
606
+ kind: admitted.file.kind
607
+ }
608
+ }
609
+ };
610
+ }
611
+ async function showByPath(session, agentApi, shownFiles, request) {
612
+ const roleRefusal = agentApi.refuseRole(session, "show");
613
+ if (roleRefusal) return roleRefusal;
614
+ if (session.remoteWorkspace !== null) return remoteRefusal(session.remoteWorkspace);
615
+ if (!shownFiles) return refusal$2(503, "show is not available right now");
616
+ const absolutePath = path.resolve(session.effectiveCwd(), request.requestedPath);
617
+ const name = path.basename(absolutePath);
618
+ const handle = await openRegularFile(absolutePath);
619
+ if (!handle) return refusal$2(404, `${request.requestedPath} is not a file this session can read`);
620
+ try {
621
+ const { size } = await handle.stat();
622
+ if (size > 209715200) return refusal$2(413, describeOverCap(request.requestedPath, size));
623
+ session.noteCommandRan("show");
624
+ return await storeAndAdmit(session, shownFiles, handle, name, request.caption?.trim().slice(0, 500) || null);
625
+ } finally {
626
+ await handle.close();
627
+ }
628
+ }
629
+ //#endregion
630
+ //#region mcp/core/tool-result.ts
631
+ function errorTextOf(body) {
632
+ return typeof body.error === "string" && body.error ? body.error : "Glimmervoid refused the request";
633
+ }
634
+ function toolResultFromReply(reply) {
635
+ if (reply.body.ok !== true) return {
636
+ content: [{
637
+ type: "text",
638
+ text: errorTextOf(reply.body)
639
+ }],
640
+ isError: true
641
+ };
642
+ return {
643
+ content: [{
644
+ type: "text",
645
+ text: JSON.stringify(reply.body)
646
+ }],
647
+ structuredContent: reply.body
648
+ };
649
+ }
650
+ function toolErrorResult(message) {
651
+ return {
652
+ content: [{
653
+ type: "text",
654
+ text: message
655
+ }],
656
+ isError: true
657
+ };
658
+ }
659
+ //#endregion
660
+ //#region mcp/core/tools.ts
661
+ var ChildField = z.string().min(1).max(300).describe("The spawned session, by the id or name spawn returned");
662
+ var BoardField = z.string().min(1).max(200).describe("The board, by id or title");
663
+ function definedEntries(source, keys) {
664
+ return Object.fromEntries(keys.filter((key) => source[key] !== void 0).map((key) => [key, source[key]]));
665
+ }
666
+ function routeTo(verb, keys = []) {
667
+ return {
668
+ verb,
669
+ toPayload: (toolArguments) => definedEntries(toolArguments, keys)
670
+ };
671
+ }
672
+ function sendPayload(toolArguments) {
673
+ const text = typeof toolArguments.text === "string" ? toolArguments.text : "";
674
+ const child = typeof toolArguments.child === "string" ? toolArguments.child : null;
675
+ return { words: child === null ? [text] : [child, text] };
676
+ }
677
+ function answerPayload(toolArguments) {
678
+ if (toolArguments.toOperator === true) return definedEntries(toolArguments, ["child", "toOperator"]);
679
+ return definedEntries(toolArguments, ["child", "answers"]);
680
+ }
681
+ function editPayload(toolArguments, context) {
682
+ if (typeof toolArguments.path !== "string") return {};
683
+ return { path: context.resolveSessionPath(toolArguments.path) };
684
+ }
685
+ function whiteboardRoute(sub, keys) {
686
+ return {
687
+ verb: "whiteboard",
688
+ toPayload: (toolArguments) => ({
689
+ sub,
690
+ ...definedEntries(toolArguments, keys)
691
+ })
692
+ };
693
+ }
694
+ var SESSION_TOOL = {
695
+ name: "session",
696
+ title: "Glimmervoid sessions",
697
+ description: "Spawn, message and manage Glimmervoid sessions. spawn starts a new supervised session with its own dashboard card and worktree for work that edits files or runs long; prefer it to an in-process subagent, which stays fine for a quick read-only lookup. send and read talk with a spawned child (or, from a child, its parent); answer replies to a question a child asked; close ends a child; board lists every live session; edit opens a file for the operator to write or correct, such as a plan or a prompt; limits reports what this session may do.",
698
+ annotations: {
699
+ readOnlyHint: false,
700
+ destructiveHint: true,
701
+ openWorldHint: false
702
+ },
703
+ loadsUpfront: true,
704
+ fields: {
705
+ prompt: AgentSpawnRequest.shape.prompt.optional().describe("spawn: the task for the new session"),
706
+ name: AgentSpawnRequest.shape.name.describe("spawn: a display name for the new session"),
707
+ agent: AgentSpawnRequest.shape.agent.describe("spawn: the agent CLI to run, such as claude, codex or kimi; defaults to this session's"),
708
+ child: ChildField.optional(),
709
+ text: z.string().min(1).max(2e4).optional().describe("send: the message"),
710
+ discard: AgentCloseRequest.shape.discard.describe("close: drop the child's unpushed work instead of refusing"),
711
+ answers: z.record(z.string(), z.string().min(1)).optional().describe("answer: each question text mapped to the chosen answer"),
712
+ toOperator: z.literal(true).optional().describe("answer: pass the child's question to the operator instead"),
713
+ path: AgentEditRequest.shape.path.optional().describe("edit: the file, absolute or relative to this session's directory")
714
+ },
715
+ actions: {
716
+ spawn: routeTo("spawn", [
717
+ "prompt",
718
+ "name",
719
+ "agent"
720
+ ]),
721
+ send: {
722
+ verb: "send",
723
+ toPayload: sendPayload
724
+ },
725
+ read: routeTo("read", ["child"]),
726
+ close: routeTo("close", ["child", "discard"]),
727
+ answer: {
728
+ verb: "answer",
729
+ toPayload: answerPayload
730
+ },
731
+ board: routeTo("board"),
732
+ edit: {
733
+ verb: "edit",
734
+ toPayload: editPayload
735
+ },
736
+ limits: routeTo("limits")
737
+ }
738
+ };
739
+ var WHITEBOARD_TOOL = {
740
+ name: "whiteboard",
741
+ title: "Glimmervoid whiteboards",
742
+ description: "Draw diagrams, architecture maps and plans on a shared whiteboard the operator sees and edits on the dashboard; prefer it to a diagram in chat. new creates a board, list names them, get reads one with what changed since this session last read it, put applies element ops (add, set, remove; a unit element is a plan step), connect and disconnect follow a board's changes, resolve closes a note, delete removes a board this session created.",
743
+ annotations: {
744
+ readOnlyHint: false,
745
+ destructiveHint: true,
746
+ openWorldHint: false
747
+ },
748
+ loadsUpfront: true,
749
+ fields: {
750
+ board: BoardField.optional(),
751
+ title: z.string().min(1).max(200).optional().describe("new: the board title"),
752
+ ops: z.array(Op).min(1).optional().describe("put: the element ops to apply"),
753
+ note: z.string().min(1).max(200).optional().describe("resolve: the note element id"),
754
+ peek: z.boolean().optional().describe("get: read without marking changes as seen"),
755
+ review: z.boolean().optional().describe("get: include the plan review against the code session")
756
+ },
757
+ actions: {
758
+ list: whiteboardRoute("list", []),
759
+ new: whiteboardRoute("new", ["title"]),
760
+ get: whiteboardRoute("get", [
761
+ "board",
762
+ "peek",
763
+ "review"
764
+ ]),
765
+ put: whiteboardRoute("put", ["board", "ops"]),
766
+ connect: whiteboardRoute("connect", ["board"]),
767
+ disconnect: whiteboardRoute("disconnect", ["board"]),
768
+ resolve: whiteboardRoute("resolve", ["board", "note"]),
769
+ delete: whiteboardRoute("delete", ["board"])
770
+ }
771
+ };
772
+ var REVIEW_TOOL = {
773
+ name: "review",
774
+ title: "Glimmervoid pull request reviews",
775
+ description: "Team pull request reviews. review queues a review of a pull request whose draft waits in the Reviews tab for the operator to post; reviews lists queued and finished reviews, or one review's detail; prs lists the operator's own open pull requests; link-pr links a pull request to this session's card.",
776
+ annotations: {
777
+ readOnlyHint: false,
778
+ destructiveHint: false,
779
+ openWorldHint: true
780
+ },
781
+ loadsUpfront: false,
782
+ fields: { pr: AgentPullRequestRequest.shape.pr.optional().describe("A GitHub pull request url or owner/repo#number") },
783
+ actions: {
784
+ review: routeTo("review", ["pr"]),
785
+ reviews: routeTo("reviews", ["pr"]),
786
+ prs: routeTo("prs"),
787
+ "link-pr": routeTo("link-pr", ["pr"])
788
+ }
789
+ };
790
+ var PUSH_TOOL = {
791
+ name: "push",
792
+ title: "Glimmervoid push",
793
+ description: "Land this session's commits on the integration branch and push it. Use it instead of git push when a plain push is refused.",
794
+ annotations: {
795
+ readOnlyHint: false,
796
+ destructiveHint: false,
797
+ openWorldHint: true
798
+ },
799
+ loadsUpfront: false,
800
+ fields: {},
801
+ actions: { push: routeTo("push") }
802
+ };
803
+ var ATTENTION_TOOL = {
804
+ name: "attention",
805
+ title: "Glimmervoid attention",
806
+ description: "Ask the operator for attention with a short note shown on the dashboard and in notifications, when this session needs a decision but is not stopping.",
807
+ annotations: {
808
+ readOnlyHint: false,
809
+ destructiveHint: false,
810
+ openWorldHint: false
811
+ },
812
+ loadsUpfront: false,
813
+ fields: { note: AgentAttentionRequest.shape.note.optional().describe("What the operator should look at") },
814
+ actions: { attention: routeTo("attention", ["note"]) }
815
+ };
816
+ var SHOW_TOOL = {
817
+ name: "show",
818
+ title: "Glimmervoid show",
819
+ description: "Put an image, video, PDF or HTML page on this session's dashboard card so the operator can see it, such as a screenshot, a rendered chart or a report. Glimmervoid reads the file by its path, so it must be on this machine and under 200 MB.",
820
+ annotations: {
821
+ readOnlyHint: false,
822
+ destructiveHint: false,
823
+ openWorldHint: false
824
+ },
825
+ loadsUpfront: false,
826
+ fields: {
827
+ path: z.string().min(1).max(4096).describe("The file, absolute or relative to this session's directory"),
828
+ caption: z.string().min(1).max(500).optional().describe("A short line shown with the file")
829
+ },
830
+ actions: { show: routeTo("show", ["path", "caption"]) }
831
+ };
832
+ var SETTINGS_TOOL = {
833
+ name: "settings",
834
+ title: "Glimmervoid settings",
835
+ description: "Read Glimmervoid's own settings without opening config.json. list names every setting; get reads one by its dotted path.",
836
+ annotations: {
837
+ readOnlyHint: true,
838
+ destructiveHint: false,
839
+ openWorldHint: false
840
+ },
841
+ loadsUpfront: false,
842
+ fields: { path: AgentSettingsRequest.shape.path.describe("get: the dotted setting path") },
843
+ actions: {
844
+ list: {
845
+ verb: "settings",
846
+ toPayload: () => ({ command: "list" })
847
+ },
848
+ get: {
849
+ verb: "settings",
850
+ toPayload: (toolArguments) => ({
851
+ command: "get",
852
+ ...definedEntries(toolArguments, ["path"])
853
+ })
854
+ }
855
+ }
856
+ };
857
+ var GROUPED_TOOLS = Object.freeze([
858
+ SESSION_TOOL,
859
+ WHITEBOARD_TOOL,
860
+ REVIEW_TOOL,
861
+ SHOW_TOOL,
862
+ PUSH_TOOL,
863
+ ATTENTION_TOOL,
864
+ SETTINGS_TOOL
865
+ ]);
866
+ function allowedActionNames(tool, isVerbAllowed) {
867
+ return Object.entries(tool.actions).filter(([, route]) => isVerbAllowed(route.verb)).map(([actionName]) => actionName);
868
+ }
869
+ function inputSchemaFor(tool, actionNames) {
870
+ const [firstAction, ...otherActions] = actionNames;
871
+ if (firstAction === void 0 || Object.keys(tool.actions).length === 1) return z.object(tool.fields);
872
+ return z.object({
873
+ action: z.enum([firstAction, ...otherActions]).describe("What to do"),
874
+ ...tool.fields
875
+ });
876
+ }
877
+ function routeToolCall(tool, toolArguments, context) {
878
+ const actionNames = Object.keys(tool.actions);
879
+ const requestedAction = actionNames.length === 1 ? actionNames[0] : toolArguments.action;
880
+ if (typeof requestedAction !== "string" || !Object.hasOwn(tool.actions, requestedAction)) return {
881
+ ok: false,
882
+ error: `${tool.name} takes action ${actionNames.join(", ")}`
883
+ };
884
+ const route = tool.actions[requestedAction];
885
+ if (route === void 0) return {
886
+ ok: false,
887
+ error: `${tool.name} takes action ${actionNames.join(", ")}`
888
+ };
889
+ return {
890
+ ok: true,
891
+ verb: route.verb,
892
+ payload: route.toPayload(toolArguments, context)
893
+ };
894
+ }
895
+ //#endregion
896
+ //#region mcp/server.ts
897
+ var MCP_ROUTE = "/mcp";
898
+ var SERVER_NAME = "glimmervoid";
899
+ var TOOL_SURFACE_VERSION = "1";
900
+ var LOADS_UPFRONT_META_KEY = "anthropic/alwaysLoad";
901
+ function refuse$1(res) {
902
+ res.status(404).json({
903
+ ok: false,
904
+ error: REFUSAL_REASON
905
+ });
906
+ }
907
+ function callContextFor(session) {
908
+ return { resolveSessionPath: (requestedPath) => path.resolve(session.effectiveCwd(), requestedPath) };
909
+ }
910
+ function runRoutedVerb(session, agentApi, getShownFiles, verb, payload) {
911
+ if (verb !== "show") return agentApi.handle(session, verb, payload);
912
+ const requestedPath = typeof payload.path === "string" ? payload.path : "";
913
+ const caption = typeof payload.caption === "string" ? payload.caption : null;
914
+ return showByPath(session, agentApi, getShownFiles(), {
915
+ requestedPath,
916
+ caption
917
+ });
918
+ }
919
+ function registerGroupedTool(server, tool, session, agentApi, getShownFiles) {
920
+ const actionNames = allowedActionNames(tool, (verb) => agentApi.refuseRole(session, verb) === null);
921
+ if (actionNames.length === 0) return;
922
+ server.registerTool(tool.name, {
923
+ title: tool.title,
924
+ description: tool.description,
925
+ inputSchema: inputSchemaFor(tool, actionNames),
926
+ annotations: tool.annotations,
927
+ _meta: { [LOADS_UPFRONT_META_KEY]: tool.loadsUpfront }
928
+ }, async (toolArguments) => {
929
+ const route = routeToolCall(tool, toolArguments, callContextFor(session));
930
+ if (!route.ok) return toolErrorResult(route.error);
931
+ return toolResultFromReply(await runRoutedVerb(session, agentApi, getShownFiles, route.verb, route.payload));
932
+ });
933
+ }
934
+ function buildSessionServer(session, agentApi, getShownFiles) {
935
+ const server = new McpServer({
936
+ name: SERVER_NAME,
937
+ version: TOOL_SURFACE_VERSION
938
+ }, { instructions: SERVER_INSTRUCTIONS });
939
+ for (const tool of GROUPED_TOOLS) registerGroupedTool(server, tool, session, agentApi, getShownFiles);
940
+ return server;
941
+ }
942
+ function authenticatedSession(req, dependencies) {
943
+ const credential = parsePresentedCredential(req.headers.authorization);
944
+ const session = credential ? dependencies.getSession(credential.sessionId) : null;
945
+ return decideAgentRequest({
946
+ sessionId: credential?.sessionId ?? null,
947
+ presentedToken: credential?.secret ?? null,
948
+ expectedToken: session?.agentToken ?? null,
949
+ isLoopback: dependencies.isLoopback(req)
950
+ }).ok ? session : null;
951
+ }
952
+ function mountAgentMcp(app, dependencies) {
953
+ const handler = createMcpHandler(({ authInfo }) => {
954
+ const session = authInfo ? dependencies.getSession(authInfo.clientId) : null;
955
+ const agentApi = dependencies.getAgentApi();
956
+ if (!session || !agentApi) throw new Error("the MCP request lost its session");
957
+ return buildSessionServer(session, agentApi, dependencies.getShownFiles);
958
+ }, { onerror: (error) => dependencies.logger.warn(`[mcp] ${error.message}`) });
959
+ const nodeHandler = toNodeHandler(handler, { onerror: (error) => dependencies.logger.warn(`[mcp] ${error.message}`) });
960
+ const answer = (req, res) => {
961
+ const session = authenticatedSession(req, dependencies);
962
+ if (!session || !dependencies.getAgentApi()) {
963
+ req.resume();
964
+ refuse$1(res);
965
+ return;
966
+ }
967
+ req.auth = {
968
+ token: session.id,
969
+ clientId: session.id,
970
+ scopes: []
971
+ };
972
+ nodeHandler(req, res);
973
+ };
974
+ app.post(MCP_ROUTE, answer);
975
+ app.get(MCP_ROUTE, answer);
976
+ }
977
+ //#endregion
537
978
  //#region server/core/host-policy.ts
538
979
  var LOOPBACK_HOST_RE = /^(?:localhost|127(?:\.\d{1,3}){3}|\[::1\]|\[::ffff:127(?:\.\d{1,3}){3}\])$/;
539
980
  function hostOnly(value) {
@@ -1513,6 +1954,13 @@ function mountAgentIngressRoutes(app, dependencies) {
1513
1954
  });
1514
1955
  });
1515
1956
  });
1957
+ mountAgentMcp(app, {
1958
+ getSession,
1959
+ getAgentApi,
1960
+ getShownFiles,
1961
+ isLoopback: isLoopbackRequest,
1962
+ logger
1963
+ });
1516
1964
  app.post("/agent/:glimmervoidId/show", (req, res) => {
1517
1965
  const agentApi = getAgentApi();
1518
1966
  const shownFiles = getShownFiles();
@@ -20145,13 +20593,23 @@ var Session = class extends EventEmitter {
20145
20593
  return;
20146
20594
  }
20147
20595
  this._isSaneYoloActive = remoteLaunch === null && hookInjection.isSaneYoloActive;
20148
- const settingsArgs = [...hookInjection.args];
20596
+ const mcpLaunch = remoteLaunch === null ? mcpLaunchFor({
20597
+ agentId: this.agentId,
20598
+ listenerPort: this._hooks.listenerPort(),
20599
+ sessionId: this.id,
20600
+ agentToken: this._agentToken
20601
+ }) : {
20602
+ args: [],
20603
+ env: {}
20604
+ };
20605
+ const settingsArgs = [...hookInjection.args, ...mcpLaunch.args];
20149
20606
  this._titleQuiet = this._adapter.titleProfile.quietUntilFirstPrompt === true && this._hooks.hasInjection() && !isRemoteCodex;
20150
20607
  this._armTitleQuietFallback();
20151
20608
  this._titleSource.setContext({ cwdBasename: path.basename(this.effectiveCwd()) });
20152
20609
  const injectedEnv = {
20153
20610
  ...hookInjection.env,
20154
20611
  ...this._agentApiEnv(),
20612
+ ...mcpLaunch.env,
20155
20613
  ...this._commitSigningEnv()
20156
20614
  };
20157
20615
  const spawnExtraEnv = Object.keys(injectedEnv).length > 0 ? {