glimmervoid 0.47.1-next.243 → 0.47.1-next.245

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 (97) hide show
  1. package/dist/bin/glimmervoid.js +8 -8
  2. package/dist/chunks/{adapters-BGDeF1ky.js → adapters-CCDF7Syx.js} +1 -1
  3. package/dist/chunks/{adapters-But0dkwF.js → adapters-DWwTuF0s.js} +1 -1
  4. package/dist/chunks/{agent-api-cli-CdXb9Hc2.js → agent-api-cli-B0ieP9eA.js} +1 -1
  5. package/dist/chunks/{agent-api-cli-Debf1A26.js → agent-api-cli-IoqBx-CB.js} +1 -1
  6. package/dist/chunks/{agent-api-core-C97UZdMF.js → agent-api-core-B6qKzhLC.js} +6 -1
  7. package/dist/chunks/{kimi-CyIJoMgO.js → kimi-B35I7Rlu.js} +1 -1
  8. package/dist/chunks/kimi-BhmoA__R.js +1 -0
  9. package/dist/chunks/{kimi-home-D7RE58XY.js → kimi-home-4-aMoqJC.js} +1 -1
  10. package/dist/chunks/kimi-home-Czh-wcQ_.js +1 -0
  11. package/dist/chunks/{main-DVFtwIRS.js → main-CZvcxpzl.js} +142 -24
  12. package/dist/chunks/{settings-cli-wqzx8Jw4.js → settings-cli-BZxQLN19.js} +1 -1
  13. package/dist/chunks/{ssh-sign-cli-BuJ8lOKg.js → ssh-sign-cli-lDMPpcmo.js} +1 -1
  14. package/dist/client/assets/{alert-sound-CT_6F7Xp.js → alert-sound-IUGDkk0H.js} +1 -1
  15. package/dist/client/assets/alert-sound-IUGDkk0H.js.br +0 -0
  16. package/dist/client/assets/{benchmark-panel-RJucS21L.js → benchmark-panel-C9FjUnZ0.js} +1 -1
  17. package/dist/client/assets/benchmark-panel-C9FjUnZ0.js.br +0 -0
  18. package/dist/client/assets/{celebration-player-CagLMZKS.js → celebration-player-BWWzx4qk.js} +1 -1
  19. package/dist/client/assets/celebration-player-BWWzx4qk.js.br +0 -0
  20. package/dist/client/assets/{community-panel-CL_ZMtN5.js → community-panel-DE5-X44B.js} +1 -1
  21. package/dist/client/assets/community-panel-DE5-X44B.js.br +0 -0
  22. package/dist/client/assets/{dialogs-Tvkk8IR0.js → dialogs-jouH2xHX.js} +1 -1
  23. package/dist/client/assets/dialogs-jouH2xHX.js.br +0 -0
  24. package/dist/client/assets/{doc-editor-ui-Dm4QJQdw.js → doc-editor-ui-5jO1SqrI.js} +1 -1
  25. package/dist/client/assets/doc-editor-ui-5jO1SqrI.js.br +0 -0
  26. package/dist/client/assets/{feature-hint-B0iEDIAh.js → feature-hint-FdyOo3tn.js} +1 -1
  27. package/dist/client/assets/feature-hint-FdyOo3tn.js.br +0 -0
  28. package/dist/client/assets/{first-run-checklist-D39N7iLA.js → first-run-checklist-DleNgATG.js} +1 -1
  29. package/dist/client/assets/first-run-checklist-DleNgATG.js.br +0 -0
  30. package/dist/client/assets/{hooks-panel-CQbqanHf.js → hooks-panel-0BLnIPEp.js} +1 -1
  31. package/dist/client/assets/hooks-panel-0BLnIPEp.js.br +0 -0
  32. package/dist/client/assets/{index-BYYC8NYG.js → index-DZdUH4E2.js} +5 -5
  33. package/dist/client/assets/index-DZdUH4E2.js.br +0 -0
  34. package/dist/client/assets/{issues-panel-Dkf42TO2.js → issues-panel-CCnukiGt.js} +1 -1
  35. package/dist/client/assets/issues-panel-CCnukiGt.js.br +0 -0
  36. package/dist/client/assets/{my-prs-panel-ClmwYbH3.js → my-prs-panel-BoO1P_5-.js} +1 -1
  37. package/dist/client/assets/my-prs-panel-BoO1P_5-.js.br +0 -0
  38. package/dist/client/assets/{nyan-cat-DgzvWbPy.js → nyan-cat-CFJNMz9Q.js} +1 -1
  39. package/dist/client/assets/nyan-cat-CFJNMz9Q.js.br +0 -0
  40. package/dist/client/assets/{phone-shell-BbfuHsGM.js → phone-shell-BQMc1mK5.js} +1 -1
  41. package/dist/client/assets/phone-shell-BQMc1mK5.js.br +0 -0
  42. package/dist/client/assets/{plan-face-DD5HjZco.js → plan-face-DegkRPdZ.js} +1 -1
  43. package/dist/client/assets/plan-face-DegkRPdZ.js.br +0 -0
  44. package/dist/client/assets/{plan-render-CCy8EqIk.js → plan-render-CphtmdLq.js} +1 -1
  45. package/dist/client/assets/plan-render-CphtmdLq.js.br +0 -0
  46. package/dist/client/assets/{pr-queue-columns-DQYZZC4n.js → pr-queue-columns-orYmxeyG.js} +1 -1
  47. package/dist/client/assets/pr-queue-columns-orYmxeyG.js.br +0 -0
  48. package/dist/client/assets/{radar-panel-BYZGDZKT.js → radar-panel-CBKQuioA.js} +1 -1
  49. package/dist/client/assets/radar-panel-CBKQuioA.js.br +0 -0
  50. package/dist/client/assets/{repo-roots-adder-BdbnyXjf.js → repo-roots-adder-zrj2fDW7.js} +1 -1
  51. package/dist/client/assets/repo-roots-adder-zrj2fDW7.js.br +0 -0
  52. package/dist/client/assets/{resume-dialog-8aoolC0Q.js → resume-dialog-6Qq7wfNs.js} +1 -1
  53. package/dist/client/assets/resume-dialog-6Qq7wfNs.js.br +0 -0
  54. package/dist/client/assets/{review-queue-panel-Cdmjz2q6.js → review-queue-panel--eBML0bS.js} +1 -1
  55. package/dist/client/assets/review-queue-panel--eBML0bS.js.br +0 -0
  56. package/dist/client/assets/{settings-panel-D3sRBRiD.js → settings-panel-C_7p6jQq.js} +2 -2
  57. package/dist/client/assets/settings-panel-C_7p6jQq.js.br +0 -0
  58. package/dist/client/assets/{shown-lightbox-Ba7I2Xqy.js → shown-lightbox-B1c4XB8n.js} +1 -1
  59. package/dist/client/assets/shown-lightbox-B1c4XB8n.js.br +0 -0
  60. package/dist/client/assets/{team-review-panel-BqTBK6fj.js → team-review-panel-DMpqUgx2.js} +1 -1
  61. package/dist/client/assets/team-review-panel-DMpqUgx2.js.br +0 -0
  62. package/dist/client/assets/{trace-panel-CKPNRMrd.js → trace-panel-9ijgGX21.js} +1 -1
  63. package/dist/client/assets/trace-panel-9ijgGX21.js.br +0 -0
  64. package/dist/client/assets/{usage-panel-BpgQwvn6.js → usage-panel-DI2f9WMx.js} +1 -1
  65. package/dist/client/assets/usage-panel-DI2f9WMx.js.br +0 -0
  66. package/dist/client/index.html +1 -1
  67. package/dist/client/index.html.br +0 -0
  68. package/dist/server/index.js +1 -1
  69. package/package.json +1 -1
  70. package/dist/chunks/kimi-CnRiVzTi.js +0 -1
  71. package/dist/chunks/kimi-home-BvT2PKvb.js +0 -1
  72. package/dist/client/assets/alert-sound-CT_6F7Xp.js.br +0 -0
  73. package/dist/client/assets/benchmark-panel-RJucS21L.js.br +0 -0
  74. package/dist/client/assets/celebration-player-CagLMZKS.js.br +0 -0
  75. package/dist/client/assets/community-panel-CL_ZMtN5.js.br +0 -0
  76. package/dist/client/assets/dialogs-Tvkk8IR0.js.br +0 -0
  77. package/dist/client/assets/doc-editor-ui-Dm4QJQdw.js.br +0 -0
  78. package/dist/client/assets/feature-hint-B0iEDIAh.js.br +0 -0
  79. package/dist/client/assets/first-run-checklist-D39N7iLA.js.br +0 -0
  80. package/dist/client/assets/hooks-panel-CQbqanHf.js.br +0 -0
  81. package/dist/client/assets/index-BYYC8NYG.js.br +0 -0
  82. package/dist/client/assets/issues-panel-Dkf42TO2.js.br +0 -0
  83. package/dist/client/assets/my-prs-panel-ClmwYbH3.js.br +0 -0
  84. package/dist/client/assets/nyan-cat-DgzvWbPy.js.br +0 -0
  85. package/dist/client/assets/phone-shell-BbfuHsGM.js.br +0 -0
  86. package/dist/client/assets/plan-face-DD5HjZco.js.br +0 -0
  87. package/dist/client/assets/plan-render-CCy8EqIk.js.br +0 -0
  88. package/dist/client/assets/pr-queue-columns-DQYZZC4n.js.br +0 -0
  89. package/dist/client/assets/radar-panel-BYZGDZKT.js.br +0 -0
  90. package/dist/client/assets/repo-roots-adder-BdbnyXjf.js.br +0 -0
  91. package/dist/client/assets/resume-dialog-8aoolC0Q.js.br +0 -0
  92. package/dist/client/assets/review-queue-panel-Cdmjz2q6.js.br +0 -0
  93. package/dist/client/assets/settings-panel-D3sRBRiD.js.br +0 -0
  94. package/dist/client/assets/shown-lightbox-Ba7I2Xqy.js.br +0 -0
  95. package/dist/client/assets/team-review-panel-BqTBK6fj.js.br +0 -0
  96. package/dist/client/assets/trace-panel-CKPNRMrd.js.br +0 -0
  97. package/dist/client/assets/usage-panel-BpgQwvn6.js.br +0 -0
@@ -5,7 +5,7 @@ import { a as packageRoot } from "../chunks/runtime-paths-D_ZjJLE0.js";
5
5
  import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
6
6
  import { t as AGENT_API_VERBS } from "../chunks/session-BQaAlkib.js";
7
7
  import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
8
- import { r as agentCommandHelpLines } from "../chunks/agent-api-core-C97UZdMF.js";
8
+ import { r as agentCommandHelpLines } from "../chunks/agent-api-core-B6qKzhLC.js";
9
9
  import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
10
10
  import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-D4rz3ygs.js";
11
11
  import { i as guardrailsDoctorRows, r as probeGuardrailsDependencies } from "../chunks/guardrails-deps-BfZSPpNs.js";
@@ -66,17 +66,17 @@ var OWN_SUBCOMMAND_RUNNERS = [
66
66
  return runAgentSetupCli(subcommandArgs);
67
67
  }],
68
68
  ["settings", async (subcommandArgs) => {
69
- const { runSettingsCli } = await import("../chunks/settings-cli-wqzx8Jw4.js");
69
+ const { runSettingsCli } = await import("../chunks/settings-cli-BZxQLN19.js");
70
70
  return runSettingsCli(subcommandArgs);
71
71
  }],
72
72
  ["ssh-sign", async (subcommandArgs) => {
73
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BuJ8lOKg.js");
73
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-lDMPpcmo.js");
74
74
  return runSshSignCli(subcommandArgs);
75
75
  }]
76
76
  ];
77
77
  var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
78
78
  var SUBCOMMAND_RUNNERS = new Map([...OWN_SUBCOMMAND_RUNNERS, ...AGENT_API_VERBS.filter((verb) => !ownSubcommandNames.has(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
79
- const { runAgentApiCli } = await import("../chunks/agent-api-cli-CdXb9Hc2.js");
79
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-B0ieP9eA.js");
80
80
  return runAgentApiCli([subcommandName, ...subcommandArgs]);
81
81
  }])]);
82
82
  var AGENT_INSTALL_COMMAND_BY_ID = {
@@ -90,7 +90,7 @@ function missingAgentText(agentId) {
90
90
  }
91
91
  async function printSessionLimits() {
92
92
  if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
93
- const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-CdXb9Hc2.js");
93
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-B0ieP9eA.js");
94
94
  const limitsLines = await sessionLimitsHelpLines();
95
95
  console.log(`\n${limitsLines.join("\n")}`);
96
96
  }
@@ -223,7 +223,7 @@ async function runDoctor() {
223
223
  }
224
224
  switchSection("Agents");
225
225
  try {
226
- const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-But0dkwF.js");
226
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-DWwTuF0s.js");
227
227
  const declaredCustomAgents = await readDeclaredCustomAgents();
228
228
  if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
229
229
  setCustomAgents(declaredCustomAgents.declared);
@@ -234,8 +234,8 @@ async function runDoctor() {
234
234
  const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-BvHppwtG.js");
235
235
  const grokSetup = inspectGrokAgentSetup();
236
236
  line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
237
- const { default: kimi } = await import("../chunks/kimi-CnRiVzTi.js");
238
- const { describeKimiHome } = await import("../chunks/kimi-home-BvT2PKvb.js");
237
+ const { default: kimi } = await import("../chunks/kimi-BhmoA__R.js");
238
+ const { describeKimiHome } = await import("../chunks/kimi-home-Czh-wcQ_.js");
239
239
  line("kimi home", describeKimiHome(kimi.expectedHooksBlock()));
240
240
  } catch (err) {
241
241
  line("agents", `probe failed: ${firstLine(errorText(err))}`);
@@ -13,7 +13,7 @@ import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
13
13
  import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-Co0r53k-.js";
14
14
  import { O as nextBackoffMs } from "./json-file-AKRVPqG1.js";
15
15
  import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-CUO-Zbyn.js";
16
- import { t as kimi } from "./kimi-CyIJoMgO.js";
16
+ import { t as kimi } from "./kimi-B35I7Rlu.js";
17
17
  import fs from "node:fs";
18
18
  import path from "node:path";
19
19
  import { z } from "zod";
@@ -1 +1 @@
1
- export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-BGDeF1ky.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-CCDF7Syx.js";
@@ -1 +1 @@
1
- export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-Debf1A26.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-IoqBx-CB.js";
@@ -1,7 +1,7 @@
1
1
  import { t as errorCode } from "./text-DoirglWV.js";
2
2
  import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-BQaAlkib.js";
3
3
  import { i as formatSessionLimits } from "./session-routes-CmWSbar1.js";
4
- import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-C97UZdMF.js";
4
+ import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-B6qKzhLC.js";
5
5
  import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
6
6
  import { n as decideGuardrailsProxy } from "./guardrails-proxy-core-BI3rdY-m.js";
7
7
  import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
@@ -228,6 +228,11 @@ function shouldAdoptReportedResumeId({ currentResumeSessionId, reportedId, signa
228
228
  if (signal === "session-end") return false;
229
229
  return true;
230
230
  }
231
+ function isConversationReplacedAtStartup({ hasPromptSinceSpawn, currentResumeSessionId, reportedId, sessionStartSource }) {
232
+ if (!hasPromptSinceSpawn) return false;
233
+ if (String(sessionStartSource || "").toLowerCase() !== "startup") return false;
234
+ return !!currentResumeSessionId && reportedId !== currentResumeSessionId;
235
+ }
231
236
  function resumePromptFor(project) {
232
237
  return project?.wasWorking === true ? AUTO_CONTINUE_PROMPT : null;
233
238
  }
@@ -870,4 +875,4 @@ function agentCommandHelpLines() {
870
875
  return Object.values(AGENT_COMMAND_HELP).map(({ usage, summary }) => ` ${usage.padEnd(Math.max(USAGE_COLUMN_WIDTH, usage.length + 1))}${summary}`);
871
876
  }
872
877
  //#endregion
873
- export { parseRefinedTaskTitle as A, claudeProjectsDir as B, extractAiTitle as C, isSelfWakePrompt as D, extractPromptTaskTitle as E, RESUME_ID_RE as F, nextSuggestedName as G, listRepoConversations as H, pickAutoResume as I, resolveResumeTarget as L, resolveTaskTitle as M, seedTaskTitleSources as N, isSubstantivePrompt as O, AUTO_CONTINUE_PROMPT as P, resumePromptFor as R, decideTaskTitleRefinement as S, extractOscTaskTitle as T, listRepoWorktreePaths as U, encodeProjectDir as V, isAutoNameOf as W, projectReviews as _, decideAgentRequest as a, chooseRefinedSessionName as b, describeChildEndNote as c, describeRoleRefusal as d, describeUnpushedCloseRefusal as f, projectReviewDetail as g, projectMyPrs as h, checkAgentReply as i, resolveRefocusTaskTitle as j, parseRefinedSessionName as k, describeKeptChildAttention as l, parseAgentVerb as m, REFUSAL_REASON as n, decideSpawnAllowance as o, isAgentApiVerb as p, agentCommandHelpLines as r, deriveChildSessionName as s, AGENT_COMMAND_HELP as t, describePushLanding as u, buildPersistedTaskTitle as v, extractHookTaskTitle as w, cleanTaskPrompt as x, buildTaskTitleRefinementPrompt as y, shouldAdoptReportedResumeId as z };
878
+ export { parseRefinedTaskTitle as A, shouldAdoptReportedResumeId as B, extractAiTitle as C, isSelfWakePrompt as D, extractPromptTaskTitle as E, RESUME_ID_RE as F, isAutoNameOf as G, encodeProjectDir as H, isConversationReplacedAtStartup as I, nextSuggestedName as K, pickAutoResume as L, resolveTaskTitle as M, seedTaskTitleSources as N, isSubstantivePrompt as O, AUTO_CONTINUE_PROMPT as P, resolveResumeTarget as R, decideTaskTitleRefinement as S, extractOscTaskTitle as T, listRepoConversations as U, claudeProjectsDir as V, listRepoWorktreePaths as W, projectReviews as _, decideAgentRequest as a, chooseRefinedSessionName as b, describeChildEndNote as c, describeRoleRefusal as d, describeUnpushedCloseRefusal as f, projectReviewDetail as g, projectMyPrs as h, checkAgentReply as i, resolveRefocusTaskTitle as j, parseRefinedSessionName as k, describeKeptChildAttention as l, parseAgentVerb as m, REFUSAL_REASON as n, decideSpawnAllowance as o, isAgentApiVerb as p, agentCommandHelpLines as r, deriveChildSessionName as s, AGENT_COMMAND_HELP as t, describePushLanding as u, buildPersistedTaskTitle as v, extractHookTaskTitle as w, cleanTaskPrompt as x, buildTaskTitleRefinementPrompt as y, resumePromptFor as z };
@@ -4,7 +4,7 @@ import { i as execFileSync } from "./child-process-safe-BCOoKfxG.js";
4
4
  import { n as resolveAgentCommand, t as buildAgentSpawnCommand } from "./spawn-command-CQECOvjC.js";
5
5
  import { t as KIMI_SANE_YOLO_FLAVOR } from "./sane-yolo-DSyFqbVE.js";
6
6
  import { t as buildAgentEnv } from "./spawn-env-Dh1MZR4M.js";
7
- import { a as prepareKimiHome, i as kimiHomeLinkRefusal, n as generatedKimiHomePath, o as realKimiHome, p as renderKimiHooksBlock, r as holdKimiHome, s as releaseKimiHome } from "./kimi-home-D7RE58XY.js";
7
+ import { a as prepareKimiHome, i as kimiHomeLinkRefusal, m as renderKimiHooksBlock, n as generatedKimiHomePath, o as realKimiHome, r as holdKimiHome, s as releaseKimiHome } from "./kimi-home-4-aMoqJC.js";
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
10
10
  import { createHash } from "node:crypto";
@@ -0,0 +1 @@
1
+ export { t as default } from "./kimi-B35I7Rlu.js";
@@ -870,4 +870,4 @@ function releaseUnheldKimiHomeSecrets(generatedHome) {
870
870
  releaseSecretsUnlessHeldElsewhere(generatedHome, { whenLocksMissing: "keep" });
871
871
  }
872
872
  //#endregion
873
- export { prepareKimiHome as a, releaseUnheldKimiHomeSecrets as c, sessionIdOfLockFile as d, trashSessionTempFolderOnceUnheld as f, kimiHomeLinkRefusal as i, createHeldSessionTempFolder as l, generatedKimiHomePath as n, realKimiHome as o, renderKimiHooksBlock as p, holdKimiHome as r, releaseKimiHome as s, describeKimiHome as t, releaseSessionLock as u };
873
+ export { prepareKimiHome as a, releaseUnheldKimiHomeSecrets as c, sessionIdOfLockFile as d, trashSessionTempFolderOnceUnheld as f, kimiHomeLinkRefusal as i, createHeldSessionTempFolder as l, renderKimiHooksBlock as m, generatedKimiHomePath as n, realKimiHome as o, definesHooksOutsideArrayTables as p, holdKimiHome as r, releaseKimiHome as s, describeKimiHome as t, releaseSessionLock as u };
@@ -0,0 +1 @@
1
+ export { t as describeKimiHome } from "./kimi-home-4-aMoqJC.js";
@@ -6,7 +6,7 @@ import { $ as MyPrMergeWhenReadyRequest, $t as RESTARTABLE_STATES, A as SIGN_URL
6
6
  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";
7
7
  import { $t as issuePullRequestStateFromGithub, A as HINT_VIEW_BY_FEATURE, At as SessionSetup, B as MergedPrListing, Bt as PLAN_RESULT_HOOK_EVENT, Ct as CommunityItem, D as pullRequestKeyFromReference, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as ChangeMap, G as GithubPrLightSearchNode, Gt as planTitle, H as PrCheckoutCaseInput, Ht as PlanDecision, I as BenchmarkRun, It as changeMapFactId, J as WorkflowCommentBody, Jt as IssueKey, K as GithubPrsFrame, Kt as GithubIssuePullRequestsRepository, L as BenchmarkStatus, Lt as PLAN_BODY_CAP_BYTES, M as BenchmarkActionRequest, Mt as TraceCheckpoint, N as BenchmarkCase, Nt as TraceRecord, O as FeatureHintState, P as BenchmarkId, Pt as CoherenceJournalOutput, Qt as IssuesStatus, R as BenchmarkSuite, Rt as PLAN_HOOK_EVENT, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanRevision, V as MinedPrReviewData, Vt as PLAN_TOOL_NAME, W as GithubPrKey, Wt as parseExitPlanModeHookPayload, X as WorkflowsSettings, Xt as IssuesSearchResponse, Y as WorkflowLabelName, Yt as IssueUpdate, Z as WorkflowsState, Zt as IssuesState, a as ConfigUpdate, b as ClientMessage, c as SHELL_AGENT_ID, f as ReviewAgentId, g as CHANGES_POLL_INTERVAL_MS, gt as USAGE_INTEGER_RANGES, jt as MAX_RAW_LINE_CHARS, k as HINT_FEATURES, kt as UpdateJournal, m as USAGE_VENDOR_KEYS, p as USAGE_COST_MODES, q as comparablePrKey, qt as GithubIssueResponse, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CLIENT_LOG_TEXT_MAX_CHARS, wt as CommunityState, xt as CommunityActionRequest, y as CONTROL_FRAME_MAX_BYTES, z as CommitComparison, zt as PLAN_HOOK_OUTPUT_MAX_CHARS } from "./config-DtB-yGnd.js";
8
8
  import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-CmWSbar1.js";
9
- import { A as parseRefinedTaskTitle, B as claudeProjectsDir, C as extractAiTitle, D as isSelfWakePrompt, E as extractPromptTaskTitle, F as RESUME_ID_RE, G as nextSuggestedName, H as listRepoConversations, I as pickAutoResume, L as resolveResumeTarget, M as resolveTaskTitle, N as seedTaskTitleSources, O as isSubstantivePrompt, P as AUTO_CONTINUE_PROMPT, R as resumePromptFor, S as decideTaskTitleRefinement, T as extractOscTaskTitle, U as listRepoWorktreePaths, V as encodeProjectDir, W as isAutoNameOf, _ as projectReviews, a as decideAgentRequest, b as chooseRefinedSessionName, c as describeChildEndNote, d as describeRoleRefusal, f as describeUnpushedCloseRefusal, g as projectReviewDetail, h as projectMyPrs, i as checkAgentReply, j as resolveRefocusTaskTitle, k as parseRefinedSessionName, l as describeKeptChildAttention, m as parseAgentVerb, n as REFUSAL_REASON, o as decideSpawnAllowance, s as deriveChildSessionName, u as describePushLanding, v as buildPersistedTaskTitle, w as extractHookTaskTitle, x as cleanTaskPrompt, y as buildTaskTitleRefinementPrompt, z as shouldAdoptReportedResumeId } from "./agent-api-core-C97UZdMF.js";
9
+ import { A as parseRefinedTaskTitle, B as shouldAdoptReportedResumeId, C as extractAiTitle, D as isSelfWakePrompt, E as extractPromptTaskTitle, F as RESUME_ID_RE, G as isAutoNameOf, H as encodeProjectDir, I as isConversationReplacedAtStartup, K as nextSuggestedName, L as pickAutoResume, M as resolveTaskTitle, N as seedTaskTitleSources, O as isSubstantivePrompt, P as AUTO_CONTINUE_PROMPT, R as resolveResumeTarget, S as decideTaskTitleRefinement, T as extractOscTaskTitle, U as listRepoConversations, V as claudeProjectsDir, W as listRepoWorktreePaths, _ as projectReviews, a as decideAgentRequest, b as chooseRefinedSessionName, c as describeChildEndNote, d as describeRoleRefusal, f as describeUnpushedCloseRefusal, g as projectReviewDetail, h as projectMyPrs, i as checkAgentReply, j as resolveRefocusTaskTitle, k as parseRefinedSessionName, l as describeKeptChildAttention, m as parseAgentVerb, n as REFUSAL_REASON, o as decideSpawnAllowance, s as deriveChildSessionName, u as describePushLanding, v as buildPersistedTaskTitle, w as extractHookTaskTitle, x as cleanTaskPrompt, y as buildTaskTitleRefinementPrompt, z as resumePromptFor } from "./agent-api-core-B6qKzhLC.js";
10
10
  import { a as rawTextOr, i as positiveNumberOr, n as isRecord, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
11
11
  import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-D4rz3ygs.js";
12
12
  import { n as checkGuardrailsDependencies, t as allowGuardedSpawn } from "./guardrails-deps-BfZSPpNs.js";
@@ -22,9 +22,9 @@ import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
22
22
  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, f as writeTextAtomic, 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";
23
23
  import { $ as stableConfigKey, B as buildPersonProperties, F as TELEMETRY_FLAGS_URL, G as decideRemoteTelemetryState, H as claudeAccountUuidOf, I as adapterBucket, J as nodeMajorVersion, K as decideTelemetryConsent, L as buildAiGenerationEvents, M as isExperimentalSetting, N as FIRST_RUN_NOTICE, P as TELEMETRY_BATCH_URL, R as buildBrowserExceptionProperties, U as codexUserIdOf, V as classifySessionExit, W as decideIsDevInstall, X as resolveProjectToken, Y as parsePosthogReleaseId, _ as settingsBlockSpecFor, a as ensureProjectIds, at as sessionIdFromBranch, ct as canonicalizePath, f as DEFAULT_TIMER_FNS, g as mergeSettingsBlock, i as createConfigStore, it as planWorktreeGc, lt as comparableDirectoryPath, n as DEFAULT_CONFIG, nt as matchedPrefix, o as generateProjectId, ot as usablePrefixes, p as unrefTimer, q as exceptionFingerprint, rt as planBranchGc, s as glimmervoidHomeDir$1, st as worktreeIntegrationTips, t as ABORT_CONFIG_SAVE, tt as DEFAULT_BRANCH_GC_PREFIXES, ut as isSameDirectoryPath, v as validateSettingsBlock, y as SETTINGS_INDEX, z as buildExceptionProperties } from "./config-store-DjEQZsHV.js";
24
24
  import { _ as TelemetryState, a as DEEP_HISTORY_SCROLLBACK_LINES, c as describeDataAttach, d as DashboardTelemetryReport, h as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, l as parseDataAttach, m as PendingCrashReport, r as HTTP_URL_RE, s as LOGGED_FAST_CLOSE_COUNTS, u as parseDataClientMessage } from "./build-channel-CUO-Zbyn.js";
25
- import { $ as kimiHomes, A as framePathPaste, B as planContiguousRead, C as pickNewestPublished, Ct as vendorUsageEntry, D as buildUploadFilename, E as MAX_UPLOAD_BYTES, F as TRACE_TAIL_SCAN_BYTES, G as codexRootCandidates, H as withCommittedOffset, I as committedOffsetFromTraceTailOrNull, J as decideFileRead, K as codexSessionIdFromPath, L as completeLineBytes, M as isSafePathSegment, N as planUploadRetention, O as decideUploadType, P as MAX_TRANSCRIPT_READ_BYTES, Q as isUsageFile, R as containmentRefusalReason, S as parseResolvedSha, St as totalTokensOf$1, T as openContainedFile, Tt as claudeCode, U as codexFallbackRoots, V as resumeOffsetFrom, W as codexHomes, X as expandTilde, Y as dedupeCodexFiles, Z as grokHomes, _ as isCheckFresh, _t as isWithinGenerationRecencyWindow, a as describeAgentResolvability, at as shouldEvaluateDespiteIoFailures, b as parseRegistryDeprecation, bt as parseUsageLine, c as isKnownAgentId, ct as kimiDedupIdentity, d as resolveAdapter, dt as dedupKeys, et as passOutcome, f as setCustomAgents, ft as emptyTotals, g as decideUpdateStatus, gt as identityFromRelPath, h as decideInstallFlavor, ht as foldReplacementIntoGenerationRollup, i as customAgentFingerprint, it as sessionsRootCandidates, j as imageMimeForUploadFilename, k as exceedsUploadCap, l as listAgentIds, lt as parseKimiUsageLine, m as readHostCodexVersion, mt as foldEntryIntoGenerationRollup, n as cachedAgentResolvability, nt as resolveProjectsDirs, o as getAdapter, ot as shouldPersistWarehouse, p as codex, pt as expandAdvisorIterations, q as continuationDelayMs, r as commandFor, rt as scopedClaudeRoots, s as hookProfileOf, st as splitLines, t as DEFAULT_AGENT_ID, tt as projectDirCandidates, u as resetCommandCache, ut as addEntryToTotals, v as normalizeSha, vt as mergeGenerationRollups, w as shortSha$1, wt as HOOK_TOOLS, x as parseRegistryLatest, xt as shouldReplace, y as normalizeUpdateChannel, yt as parseJsonLine, z as isOversizedPartialLine } from "./adapters-BGDeF1ky.js";
26
- import { c as releaseUnheldKimiHomeSecrets, d as sessionIdOfLockFile, f as trashSessionTempFolderOnceUnheld, i as kimiHomeLinkRefusal, l as createHeldSessionTempFolder, n as generatedKimiHomePath, o as realKimiHome, u as releaseSessionLock } from "./kimi-home-D7RE58XY.js";
27
- import { t as kimi } from "./kimi-CyIJoMgO.js";
25
+ import { $ as kimiHomes, A as framePathPaste, B as planContiguousRead, C as pickNewestPublished, Ct as vendorUsageEntry, D as buildUploadFilename, E as MAX_UPLOAD_BYTES, F as TRACE_TAIL_SCAN_BYTES, G as codexRootCandidates, H as withCommittedOffset, I as committedOffsetFromTraceTailOrNull, J as decideFileRead, K as codexSessionIdFromPath, L as completeLineBytes, M as isSafePathSegment, N as planUploadRetention, O as decideUploadType, P as MAX_TRANSCRIPT_READ_BYTES, Q as isUsageFile, R as containmentRefusalReason, S as parseResolvedSha, St as totalTokensOf$1, T as openContainedFile, Tt as claudeCode, U as codexFallbackRoots, V as resumeOffsetFrom, W as codexHomes, X as expandTilde, Y as dedupeCodexFiles, Z as grokHomes, _ as isCheckFresh, _t as isWithinGenerationRecencyWindow, a as describeAgentResolvability, at as shouldEvaluateDespiteIoFailures, b as parseRegistryDeprecation, bt as parseUsageLine, c as isKnownAgentId, ct as kimiDedupIdentity, d as resolveAdapter, dt as dedupKeys, et as passOutcome, f as setCustomAgents, ft as emptyTotals, g as decideUpdateStatus, gt as identityFromRelPath, h as decideInstallFlavor, ht as foldReplacementIntoGenerationRollup, i as customAgentFingerprint, it as sessionsRootCandidates, j as imageMimeForUploadFilename, k as exceedsUploadCap, l as listAgentIds, lt as parseKimiUsageLine, m as readHostCodexVersion, mt as foldEntryIntoGenerationRollup, n as cachedAgentResolvability, nt as resolveProjectsDirs, o as getAdapter, ot as shouldPersistWarehouse, p as codex, pt as expandAdvisorIterations, q as continuationDelayMs, r as commandFor, rt as scopedClaudeRoots, s as hookProfileOf, st as splitLines, t as DEFAULT_AGENT_ID$1, tt as projectDirCandidates, u as resetCommandCache, ut as addEntryToTotals, v as normalizeSha, vt as mergeGenerationRollups, w as shortSha$1, wt as HOOK_TOOLS, x as parseRegistryLatest, xt as shouldReplace, y as normalizeUpdateChannel, yt as parseJsonLine, z as isOversizedPartialLine } from "./adapters-CCDF7Syx.js";
26
+ import { c as releaseUnheldKimiHomeSecrets, d as sessionIdOfLockFile, f as trashSessionTempFolderOnceUnheld, i as kimiHomeLinkRefusal, l as createHeldSessionTempFolder, n as generatedKimiHomePath, o as realKimiHome, p as definesHooksOutsideArrayTables, u as releaseSessionLock } from "./kimi-home-4-aMoqJC.js";
27
+ import { t as kimi } from "./kimi-B35I7Rlu.js";
28
28
  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";
29
29
  import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-Bx7gnshJ.js";
30
30
  import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-_JfFhnxs.js";
@@ -3261,9 +3261,10 @@ function launchPrivateFolders(role, host) {
3261
3261
  function launchHomeLinkCandidates(role, host) {
3262
3262
  return vendorsWithLaunchHome(role).flatMap((vendor) => {
3263
3263
  const { configEntries, loginFiles } = VENDOR_PROFILES[vendor];
3264
+ const laneFileByEntry = role.launchHomeFiles?.[vendor] ?? {};
3264
3265
  const linkFor = (entry, isLogin) => ({
3265
3266
  linkPath: path.join(launchHomeOf(host, vendor), entry),
3266
- targetPath: path.join(host.vendorLocations[vendor].stateFolder, entry),
3267
+ targetPath: laneFileByEntry[entry] ?? path.join(host.vendorLocations[vendor].stateFolder, entry),
3267
3268
  isLogin
3268
3269
  });
3269
3270
  return [...configEntries.map((entry) => linkFor(entry, false)), ...loginFiles.map((entry) => linkFor(entry, true))];
@@ -9413,6 +9414,7 @@ var POSTHOG_MCP_HOST = "mcp.posthog.com";
9413
9414
  var POSTHOG_OAUTH_HOST = "oauth.posthog.com";
9414
9415
  var MCP_SERVER_NAME_RE = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
9415
9416
  var CODEX_MCP_SERVER_NAME_RE = /^[A-Za-z0-9_-]+$/;
9417
+ var KIMI_QUALIFIED_TOOL_NAME_MAX_LENGTH = 64;
9416
9418
  var STRICT_MCP_CONFIG_ARG = "--strict-mcp-config";
9417
9419
  var HOOK_COMMAND_SAFE_PATH_RE = /^[A-Za-z0-9_.:/\\ -]+$/;
9418
9420
  function urlHostname(value) {
@@ -9463,7 +9465,8 @@ function laneMcpPosture({ server, mcpConfigPath, gatePath, interpreterPath, lane
9463
9465
  allowRules: [`mcp__${server.name}__exec`],
9464
9466
  hookTool,
9465
9467
  networkDomains: [POSTHOG_MCP_HOST, POSTHOG_OAUTH_HOST],
9466
- bypassHookTrust: false
9468
+ bypassHookTrust: false,
9469
+ launchHomeFiles: {}
9467
9470
  };
9468
9471
  }
9469
9472
  function codexLaneMcpPosture({ server, otherServerNames, gatePath, interpreterPath }) {
@@ -9483,7 +9486,41 @@ function codexLaneMcpPosture({ server, otherServerNames, gatePath, interpreterPa
9483
9486
  allowRules: [],
9484
9487
  hookTool,
9485
9488
  networkDomains: [POSTHOG_MCP_HOST, POSTHOG_OAUTH_HOST],
9486
- bypassHookTrust: true
9489
+ bypassHookTrust: true,
9490
+ launchHomeFiles: {}
9491
+ };
9492
+ }
9493
+ function kimiLaneMcpConfig(server) {
9494
+ return { mcpServers: { [server.name]: {
9495
+ ...server.entry,
9496
+ enabledTools: ["exec"]
9497
+ } } };
9498
+ }
9499
+ function kimiLaneConfigText(operatorConfigText, gateHook) {
9500
+ if (definesHooksOutsideArrayTables(operatorConfigText) || /['\r\n]/.test(gateHook.command)) return null;
9501
+ return `${operatorConfigText}${operatorConfigText === "" || operatorConfigText.endsWith("\n") ? "" : "\n"}\n[[hooks]]\nevent = "PreToolUse"\nmatcher = '${gateHook.matcher}'\ncommand = '${gateHook.command}'\n`;
9502
+ }
9503
+ function keepsKimiToolName(serverName) {
9504
+ return !serverName.includes("__") && `mcp__${serverName}__exec`.length <= KIMI_QUALIFIED_TOOL_NAME_MAX_LENGTH;
9505
+ }
9506
+ function kimiLaneMcpPosture({ server, mcpConfigPath, configPath, gatePath, interpreterPath }) {
9507
+ if (!keepsKimiToolName(server.name)) return null;
9508
+ const hookTool = gatedPosthogTool({
9509
+ server,
9510
+ gatePath,
9511
+ interpreterPath
9512
+ });
9513
+ if (!hookTool) return null;
9514
+ return {
9515
+ args: [],
9516
+ allowRules: [],
9517
+ hookTool,
9518
+ networkDomains: [POSTHOG_MCP_HOST, POSTHOG_OAUTH_HOST],
9519
+ bypassHookTrust: false,
9520
+ launchHomeFiles: { kimi: {
9521
+ "mcp.json": mcpConfigPath,
9522
+ "config.toml": configPath
9523
+ } }
9487
9524
  };
9488
9525
  }
9489
9526
  function withNetworkDomains(role, domains) {
@@ -9496,6 +9533,16 @@ function withNetworkDomains(role, domains) {
9496
9533
  }
9497
9534
  };
9498
9535
  }
9536
+ function withLaneMcp(role, posture) {
9537
+ if (!posture) return role;
9538
+ return {
9539
+ ...withNetworkDomains(role, posture.networkDomains),
9540
+ launchHomeFiles: {
9541
+ ...role.launchHomeFiles,
9542
+ ...posture.launchHomeFiles
9543
+ }
9544
+ };
9545
+ }
9499
9546
  function withAllowRules(permissions, allowRules) {
9500
9547
  if (allowRules.length === 0) return permissions;
9501
9548
  const existingAllowRules = Array.isArray(permissions.allow) ? permissions.allow : [];
@@ -14442,7 +14489,7 @@ function createSessionObservability({ agentId, getRecorder }) {
14442
14489
  auditLog.splice(0, auditLog.length - AUDIT_LOG_MAX);
14443
14490
  }
14444
14491
  function recordDecision(entry) {
14445
- const stamped = agentId === DEFAULT_AGENT_ID ? entry : {
14492
+ const stamped = agentId === DEFAULT_AGENT_ID$1 ? entry : {
14446
14493
  ...entry,
14447
14494
  agent: agentId
14448
14495
  };
@@ -17770,6 +17817,7 @@ var Session = class extends EventEmitter {
17770
17817
  backgroundTracking;
17771
17818
  worktreeLifecycle;
17772
17819
  _receivedFirstOutput;
17820
+ _hasPromptSinceSpawn;
17773
17821
  _killPollTimer;
17774
17822
  _killReapTimer;
17775
17823
  _titleQuietFallbackTimer;
@@ -17835,7 +17883,7 @@ var Session = class extends EventEmitter {
17835
17883
  _resizeSeq;
17836
17884
  _titleSource;
17837
17885
  _statusSource;
17838
- constructor({ customTitle, id, name, path: projectPath, dangerouslySkipPermissions = false, replayBufferKB = 512, hookRouter = null, getHookPort = null, hooksBaseDir = void 0, titleStabilizationMs = 1500, statusConflictMs = void 0, statusDedupMs = void 0, detectBackgroundAgents = true, agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs = DEFAULT_SHELL_TASK_TTL_MS, teammateTaskTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS, gateReleaseSettleMs = DEFAULT_GATE_RELEASE_SETTLE_MS, detectScheduledWakeups = true, observeToolCalls = false, agent = DEFAULT_AGENT_ID, adapter = null, bypassHookTrust = false, isMarkedUnguarded = false, isGuardrailsReleased = false, holdsQuestionsForParent = false, startCodexBridge = startCodexAppServerBridge, titleQuietFallbackMs = 3e4, spawnCommand = null, initialPrompt = null, extraClaudeArgs = [], ephemeral = false, resumeSessionId = null, taskTitleState = void 0, prLinks = void 0, settingsPermissions = null, settingsGuardrails = null, prepareGuardrails = null, getRemoteLaunch = null, spawnEnv = null, prependPathDirs = [], enableProjectMcp = false, hookTools = [], planReviewPort = null, planLimits = false, getUserHooks = null, extraUserHooks = [], prepareCoherence = null, ptySpawn = null, requireWorktree = false, screenKeeperFactory = null, killProc = null, signalProc = null, platform = process.platform, gitWorkspace = null, integrationBranch = null, autoRebase = true, syncOnStart = true, liveWorktreeReview = true, worktreeRoot = null, worktreeShare = null, workspaceRepos = void 0, agentDepth = 0, ownerId = null, commitSigningProgram = null }) {
17886
+ constructor({ customTitle, id, name, path: projectPath, dangerouslySkipPermissions = false, replayBufferKB = 512, hookRouter = null, getHookPort = null, hooksBaseDir = void 0, titleStabilizationMs = 1500, statusConflictMs = void 0, statusDedupMs = void 0, detectBackgroundAgents = true, agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs = DEFAULT_SHELL_TASK_TTL_MS, teammateTaskTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS, gateReleaseSettleMs = DEFAULT_GATE_RELEASE_SETTLE_MS, detectScheduledWakeups = true, observeToolCalls = false, agent = DEFAULT_AGENT_ID$1, adapter = null, bypassHookTrust = false, isMarkedUnguarded = false, isGuardrailsReleased = false, holdsQuestionsForParent = false, startCodexBridge = startCodexAppServerBridge, titleQuietFallbackMs = 3e4, spawnCommand = null, initialPrompt = null, extraClaudeArgs = [], ephemeral = false, resumeSessionId = null, taskTitleState = void 0, prLinks = void 0, settingsPermissions = null, settingsGuardrails = null, prepareGuardrails = null, getRemoteLaunch = null, spawnEnv = null, prependPathDirs = [], enableProjectMcp = false, hookTools = [], planReviewPort = null, planLimits = false, getUserHooks = null, extraUserHooks = [], prepareCoherence = null, ptySpawn = null, requireWorktree = false, screenKeeperFactory = null, killProc = null, signalProc = null, platform = process.platform, gitWorkspace = null, integrationBranch = null, autoRebase = true, syncOnStart = true, liveWorktreeReview = true, worktreeRoot = null, worktreeShare = null, workspaceRepos = void 0, agentDepth = 0, ownerId = null, commitSigningProgram = null }) {
17839
17887
  super();
17840
17888
  this.id = id;
17841
17889
  this.ownerId = ownerId;
@@ -17863,6 +17911,7 @@ var Session = class extends EventEmitter {
17863
17911
  this.failureReason = null;
17864
17912
  this.unseenOutcome = null;
17865
17913
  this._receivedFirstOutput = false;
17914
+ this._hasPromptSinceSpawn = false;
17866
17915
  this._killPollTimer = null;
17867
17916
  this._killReapTimer = null;
17868
17917
  this._resolveKillReap = null;
@@ -18173,6 +18222,16 @@ var Session = class extends EventEmitter {
18173
18222
  });
18174
18223
  return;
18175
18224
  }
18225
+ if (this._isConversationReplacedAtStartup(raw)) {
18226
+ this.ingestHookSignal({
18227
+ ...raw,
18228
+ payload: {
18229
+ ...raw.payload,
18230
+ source: "clear"
18231
+ }
18232
+ });
18233
+ return;
18234
+ }
18176
18235
  if (raw?.signal === "ready" && String(raw.event || "").toLowerCase() === "stop") this._hasRespawnedForAuth = false;
18177
18236
  this._hookSeen = true;
18178
18237
  if (this._recorder && raw?.event) this._recorder.writeHook(raw.event, raw.payload);
@@ -18201,8 +18260,7 @@ var Session = class extends EventEmitter {
18201
18260
  return;
18202
18261
  }
18203
18262
  if (raw?.payload) {
18204
- const sessionIdOf = typeof this._adapter.sessionIdOf === "function" ? this._adapter.sessionIdOf : (payload) => payload?.session_id;
18205
- this._captureClaudeSessionId(sessionIdOf(raw.payload), raw.payload.source, raw.payload.transcript_path, raw.signal, raw.confidence);
18263
+ this._captureClaudeSessionId(this._reportedSessionIdOf(raw.payload), raw.payload.source, raw.payload.transcript_path, raw.signal, raw.confidence);
18206
18264
  const hookTitle = extractHookTaskTitle(raw.payload, path.basename(this.effectiveCwd()), this._adapter.titleProfile.taskTitle);
18207
18265
  if (hookTitle && hookTitle !== this._taskTitleSources.aiTitle) {
18208
18266
  this._taskTitleSources.aiTitle = hookTitle;
@@ -18241,6 +18299,7 @@ var Session = class extends EventEmitter {
18241
18299
  }
18242
18300
  if (raw && raw.signal === "session-start") this._onSessionStartHook(raw);
18243
18301
  if (raw && raw.signal === "resume") {
18302
+ this._hasPromptSinceSpawn = true;
18244
18303
  this._observeCompaction("resume");
18245
18304
  this._titleQuiet = false;
18246
18305
  this._setPendingPromptKind(null);
@@ -18257,6 +18316,20 @@ var Session = class extends EventEmitter {
18257
18316
  if (raw && raw.signal === "ready" && raw.source === "hook") this.backgroundTracking.applyBackgroundTasks(raw.payload);
18258
18317
  this._statusSource.ingest(raw);
18259
18318
  }
18319
+ _reportedSessionIdOf(payload) {
18320
+ return typeof this._adapter.sessionIdOf === "function" ? this._adapter.sessionIdOf(payload) : payload?.session_id;
18321
+ }
18322
+ _isConversationReplacedAtStartup(raw) {
18323
+ if (raw?.signal !== "session-start" || !raw.payload) return false;
18324
+ const reportedId = this._reportedSessionIdOf(raw.payload);
18325
+ if (typeof reportedId !== "string") return false;
18326
+ return isConversationReplacedAtStartup({
18327
+ hasPromptSinceSpawn: this._hasPromptSinceSpawn,
18328
+ currentResumeSessionId: this._resumeSessionId,
18329
+ reportedId,
18330
+ sessionStartSource: raw.payload.source
18331
+ });
18332
+ }
18260
18333
  _onSessionStartHook(raw) {
18261
18334
  const payload = raw.payload || {};
18262
18335
  const src = String(payload.source || "").toLowerCase();
@@ -18850,12 +18923,13 @@ var Session = class extends EventEmitter {
18850
18923
  if (this.mergeStatus === "pending-review") this.worktreeLifecycle.scheduleCheck();
18851
18924
  }
18852
18925
  this._receivedFirstOutput = false;
18926
+ this._hasPromptSinceSpawn = false;
18853
18927
  this._clearDetectionTracking();
18854
18928
  this._output.reset();
18855
18929
  this.emit("rebaseline");
18856
18930
  this._resetDetectionSources({ quiet: false });
18857
18931
  const remoteLaunch = this._getRemoteLaunch();
18858
- if (remoteLaunch !== null && this.agentId !== DEFAULT_AGENT_ID && this.agentId !== "codex") {
18932
+ if (remoteLaunch !== null && this.agentId !== DEFAULT_AGENT_ID$1 && this.agentId !== "codex") {
18859
18933
  this._abandonSpawn(/* @__PURE__ */ new Error("A Coder workspace session runs Claude Code or Codex only"));
18860
18934
  return;
18861
18935
  }
@@ -20148,6 +20222,8 @@ var LANE_MCP_DIR_PREFIX = "glimmervoid-lane-settings-";
20148
20222
  var GATE_SELF_TEST_TIMEOUT_MS = 5e3;
20149
20223
  var CODEX_MCP_LIST_TIMEOUT_MS = 1e4;
20150
20224
  var CODEX_AGENT_ID = "codex";
20225
+ var KIMI_AGENT_ID$2 = "kimi";
20226
+ var DEFAULT_AGENT_ID = "claude";
20151
20227
  var HOOK_SHELL = "/bin/sh";
20152
20228
  var BLOCKING_EXIT_CODE = 2;
20153
20229
  async function readOperatorClaudeConfig() {
@@ -20201,8 +20277,51 @@ async function prepareCodexLaneMcp(listCodexServers, gatePath) {
20201
20277
  cleanup: async () => {}
20202
20278
  };
20203
20279
  }
20204
- async function prepareLaneMcp({ laneArgs, agent }, { readClaudeConfig = readOperatorClaudeConfig, listCodexServers = listOperatorCodexServers, gatePath = relayPath("posthog-read-gate") } = {}) {
20280
+ async function readOptionalText(filePath) {
20281
+ return fs$1.readFile(filePath, "utf8").catch((error) => error.code === "ENOENT" ? "" : null);
20282
+ }
20283
+ async function prepareKimiLaneMcp(kimiHome, gatePath) {
20284
+ const kimiMcpConfig = await fs$1.readFile(path.join(kimiHome, "mcp.json"), "utf8").then(JSON.parse, () => null);
20285
+ const server = findPosthogServer(isRecord(kimiMcpConfig) ? kimiMcpConfig.mcpServers : null);
20286
+ const operatorConfigText = await readOptionalText(path.join(kimiHome, "config.toml"));
20287
+ if (!server || operatorConfigText === null) return null;
20288
+ const configDirectory = await makeHostScratchDirectory(LANE_MCP_DIR_PREFIX);
20289
+ const removeConfigDirectory = () => fs$1.rm(configDirectory, {
20290
+ recursive: true,
20291
+ force: true
20292
+ }).catch(() => {});
20293
+ const mcpConfigPath = path.join(configDirectory, "mcp.json");
20294
+ const configPath = path.join(configDirectory, "config.toml");
20295
+ const posture = kimiLaneMcpPosture({
20296
+ server,
20297
+ mcpConfigPath,
20298
+ configPath,
20299
+ gatePath,
20300
+ interpreterPath: process.execPath
20301
+ });
20302
+ const gateHook = posture ? HOOK_TOOLS.posthogReadGate.claudeEntry(posture.hookTool, "") : null;
20303
+ const configText = gateHook ? kimiLaneConfigText(operatorConfigText, {
20304
+ matcher: gateHook.matcher,
20305
+ command: gateHook.hooks[0]?.command ?? ""
20306
+ }) : null;
20307
+ try {
20308
+ if (!posture || configText === null || !await gateDeniesKnownWrite(posture.hookTool)) throw new Error("no gated PostHog for this lane");
20309
+ await writeJsonAtomic(mcpConfigPath, kimiLaneMcpConfig(server), { mode: 384 });
20310
+ await fs$1.writeFile(configPath, configText, { mode: 384 });
20311
+ return {
20312
+ posture,
20313
+ readablePaths: [configDirectory, process.execPath],
20314
+ cleanup: removeConfigDirectory
20315
+ };
20316
+ } catch {
20317
+ await removeConfigDirectory();
20318
+ return null;
20319
+ }
20320
+ }
20321
+ async function prepareLaneMcp({ laneArgs, agent }, { readClaudeConfig = readOperatorClaudeConfig, listCodexServers = listOperatorCodexServers, kimiHome = realKimiHome(), gatePath = relayPath("posthog-read-gate") } = {}) {
20205
20322
  if (agent === CODEX_AGENT_ID) return prepareCodexLaneMcp(listCodexServers, gatePath);
20323
+ if (agent === KIMI_AGENT_ID$2) return prepareKimiLaneMcp(kimiHome, gatePath);
20324
+ if (agent !== void 0 && agent !== DEFAULT_AGENT_ID) return null;
20206
20325
  const claudeConfig = await readClaudeConfig().catch(() => null);
20207
20326
  const server = findPosthogServer(isRecord(claudeConfig) ? claudeConfig.mcpServers : null);
20208
20327
  if (!server) return null;
@@ -20299,7 +20418,7 @@ function laneAgentArgs({ isClaude, isWrapped, isCodex, extraArgs, model, posture
20299
20418
  return [...extraArgs];
20300
20419
  }
20301
20420
  function createLaneSpawn({ sessions = /* @__PURE__ */ new Map(), closeSessionDataClients = () => {}, hookRouter = null, getHookPort = null, spawnGate = null, replayBufferKB = void 0, recordLane = null, laneName, allowTools = [], createSession = (options) => new Session(options), settingsPermissions, spawnEnv = null, prepareGuardrails = prepareGuardrailsLaunch, guardrailsRefusal = allowGuardedSpawn, prepareMcp = prepareLaneMcp, platform = process.platform }) {
20302
- return async function spawnLaneSession({ id, name, prompt, cwd, agent = DEFAULT_AGENT_ID, extraArgs = [], model = null, signal = null, onOutput, readablePaths = [] }) {
20421
+ return async function spawnLaneSession({ id, name, prompt, cwd, agent = DEFAULT_AGENT_ID$1, extraArgs = [], model = null, signal = null, onOutput, readablePaths = [] }) {
20303
20422
  const isCodex = agent === "codex";
20304
20423
  const isKimi = agent === KIMI_AGENT_ID$1;
20305
20424
  const isClaude = !isCodex && !isKimi;
@@ -20317,7 +20436,7 @@ function createLaneSpawn({ sessions = /* @__PURE__ */ new Map(), closeSessionDat
20317
20436
  allowTools
20318
20437
  }) : null;
20319
20438
  const basePermissions = settingsPermissions ?? posture?.permissions ?? null;
20320
- const laneMcp = (isClaude || isCodex) && hookRouter ? await prepareMcp({
20439
+ const laneMcp = hookRouter ? await prepareMcp({
20321
20440
  laneArgs: posture?.args ?? [],
20322
20441
  agent
20323
20442
  }) : null;
@@ -20356,7 +20475,7 @@ function createLaneSpawn({ sessions = /* @__PURE__ */ new Map(), closeSessionDat
20356
20475
  hookRouter,
20357
20476
  getHookPort,
20358
20477
  prepareGuardrails: isWrapped ? (facts) => prepareGuardrails({
20359
- role: withNetworkDomains(judgeRole({
20478
+ role: withLaneMcp(judgeRole({
20360
20479
  vendor: laneVendor(agent),
20361
20480
  cwd: facts.cwd,
20362
20481
  hookPort: facts.hookPort,
@@ -20366,7 +20485,7 @@ function createLaneSpawn({ sessions = /* @__PURE__ */ new Map(), closeSessionDat
20366
20485
  ...readablePaths,
20367
20486
  ...laneMcp?.readablePaths ?? []
20368
20487
  ]
20369
- }), laneMcp?.posture.networkDomains ?? []),
20488
+ }), laneMcp?.posture),
20370
20489
  launchId: facts.launchId
20371
20490
  }) : null
20372
20491
  };
@@ -27086,10 +27205,9 @@ function createTeamReviewSpawn({ reviewSessions, closeSessionDataClients, hookRo
27086
27205
  return async function spawnTeamReviewSession({ id, name, cwd, spawnEnv, extraClaudeArgs, settingsPermissions, settingsGuardrails, guardrailsRole, signal, onToolStep, onSessionId, resumeSessionId, initialPrompt, agent, extraUserHooks, prependPathDirs }) {
27087
27206
  if (guardrailsRole !== void 0 && platform === SANDBOX_RUNTIME_UNSUPPORTED_PLATFORM) throw new Error(`${laneName} lane needs the sandbox runtime, which does not run on ${platform}`);
27088
27207
  const skipPermissions = settingsPermissions.defaultMode === "bypassPermissions";
27089
- const laneAgent = agent ?? DEFAULT_AGENT_ID;
27090
- const laneMcp = hookRouter && (laneAgent === DEFAULT_AGENT_ID || laneAgent === "codex") ? await prepareMcp({
27208
+ const laneMcp = hookRouter ? await prepareMcp({
27091
27209
  laneArgs: extraClaudeArgs,
27092
- agent: laneAgent
27210
+ agent: agent ?? DEFAULT_AGENT_ID$1
27093
27211
  }) : null;
27094
27212
  const sharedHookTools = hookToolConfig ? resolveHookTools$2({ saneYolo: hookToolConfig.saneYolo }, { skipPermissions }) : [];
27095
27213
  const sess = makeSession({
@@ -27111,10 +27229,10 @@ function createTeamReviewSpawn({ reviewSessions, closeSessionDataClients, hookRo
27111
27229
  settingsPermissions: laneMcp ? withAllowRules(settingsPermissions, laneMcp.posture.allowRules) : settingsPermissions,
27112
27230
  settingsGuardrails: settingsGuardrails ?? null,
27113
27231
  prepareGuardrails: guardrailsRole === void 0 ? null : (facts) => prepareGuardrails({
27114
- role: withNetworkDomains(guardrailsRole({
27232
+ role: withLaneMcp(guardrailsRole({
27115
27233
  ...facts,
27116
27234
  readablePaths: [...facts.readablePaths, ...laneMcp?.readablePaths ?? []]
27117
- }), laneMcp?.posture.networkDomains ?? []),
27235
+ }), laneMcp?.posture),
27118
27236
  launchId: facts.launchId
27119
27237
  }),
27120
27238
  replayBufferKB,
@@ -46573,7 +46691,7 @@ function registerControlHandlers(controlWss, deps) {
46573
46691
  name,
46574
46692
  path: projectPath,
46575
46693
  repos,
46576
- agent: requestedAgent && requestedAgent !== DEFAULT_AGENT_ID ? requestedAgent : void 0,
46694
+ agent: requestedAgent && requestedAgent !== DEFAULT_AGENT_ID$1 ? requestedAgent : void 0,
46577
46695
  dangerouslySkipPermissions: skipPerms,
46578
46696
  saneYolo: skipPerms && msg.saneYolo === true,
46579
46697
  unguarded: msg.unguarded === true,
@@ -48027,7 +48145,7 @@ function registerControlHandlers(controlWss, deps) {
48027
48145
  return (config.projects || []).filter((project) => typeof project?.id === "string" && typeof project?.name === "string").map((project) => ({
48028
48146
  id: project.id,
48029
48147
  name: project.name,
48030
- agent: typeof project.agent === "string" ? project.agent : DEFAULT_AGENT_ID
48148
+ agent: typeof project.agent === "string" ? project.agent : DEFAULT_AGENT_ID$1
48031
48149
  }));
48032
48150
  }
48033
48151
  function handleRequestHooksReport(msg, ws) {
@@ -330,7 +330,7 @@ function processIo() {
330
330
  async function runSettingsCli(commandArguments, io = processIo()) {
331
331
  const serverRequest = settingsRequestForServer(commandArguments, process.env);
332
332
  if (!serverRequest) return runSettingsCommand(commandArguments, io);
333
- const { askAgentApi } = await import("./agent-api-cli-CdXb9Hc2.js");
333
+ const { askAgentApi } = await import("./agent-api-cli-B0ieP9eA.js");
334
334
  const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
335
335
  ok: false,
336
336
  error: errorMessage(error)
@@ -2,7 +2,7 @@ import { r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { A as SIGN_URL_ENV, I as SshSignReply } from "./session-BQaAlkib.js";
3
3
  import { c as spawn, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
4
4
  import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
5
- import { n as postToAgentIngress } from "./agent-api-cli-Debf1A26.js";
5
+ import { n as postToAgentIngress } from "./agent-api-cli-IoqBx-CB.js";
6
6
  import { l as parseSshPublicKey } from "./ssh-signing-core-CRhVVWNW.js";
7
7
  import path from "node:path";
8
8
  import fs from "node:fs/promises";
@@ -1 +1 @@
1
- import{Gi as e,Hi as t,Ji as n,Ki as r,Ui as i,Wi as a,Yi as o,qi as s}from"./index-BYYC8NYG.js";var c=.3,l=null;function u(){return o(l)}function d(e){return n(e,l)}async function f(){try{let e=await fetch(t,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(a[e]??a.chime)}function g(e){let t=p(),n=t.createGain();n.gain.value=e.peakGain,n.connect(t.destination);let r=t.currentTime,i=0;for(let a of e.tones){let e=r+a.startSeconds,o=e+a.durationSeconds,s=t.createOscillator(),c=t.createGain();s.type=a.waveform,s.frequency.setValueAtTime(a.frequency,e),a.endFrequency&&s.frequency.exponentialRampToValueAtTime(a.endFrequency,o),c.gain.setValueAtTime(.001,e),c.gain.exponentialRampToValueAtTime(a.gain??1,e+.01),c.gain.exponentialRampToValueAtTime(.001,o),s.connect(c),c.connect(n),s.start(e),s.stop(o),i=Math.max(i,a.startSeconds+a.durationSeconds)}m(t,i)}async function _(e){try{let t=await fetch(r(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(i)}catch{}}function S(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
1
+ import{Gi as e,Hi as t,Ji as n,Ki as r,Ui as i,Wi as a,Yi as o,qi as s}from"./index-DZdUH4E2.js";var c=.3,l=null;function u(){return o(l)}function d(e){return n(e,l)}async function f(){try{let e=await fetch(t,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(a[e]??a.chime)}function g(e){let t=p(),n=t.createGain();n.gain.value=e.peakGain,n.connect(t.destination);let r=t.currentTime,i=0;for(let a of e.tones){let e=r+a.startSeconds,o=e+a.durationSeconds,s=t.createOscillator(),c=t.createGain();s.type=a.waveform,s.frequency.setValueAtTime(a.frequency,e),a.endFrequency&&s.frequency.exponentialRampToValueAtTime(a.endFrequency,o),c.gain.setValueAtTime(.001,e),c.gain.exponentialRampToValueAtTime(a.gain??1,e+.01),c.gain.exponentialRampToValueAtTime(.001,o),s.connect(c),c.connect(n),s.start(e),s.stop(o),i=Math.max(i,a.startSeconds+a.durationSeconds)}m(t,i)}async function _(e){try{let t=await fetch(r(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(i)}catch{}}function S(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
@@ -1 +1 @@
1
- import"./updates-view-core-B_ik1cqt.js";import{n as e,o as t,r as n}from"./dom-helpers-I_SDCPvs.js";import{J as r,Y as i,q as a}from"./index-BYYC8NYG.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,n,i){let a=t(`button`,`bench-action-button`,o[n]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,n)),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 n=t(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(n.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(n.dataset.degraded=`true`),n}function p(e){let n=e.armIds.filter(t=>t!==e.baselineArm),r=t(`table`,`bench-table`),i=t(`tr`);i.append(t(`th`,null,`Case`),...e.armIds.map(n=>t(`th`,null,n===e.baselineArm?`${n} (baseline)`:n))),i.append(...n.map(e=>t(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=t(`tr`);a.append(t(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...n.map(e=>t(`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=t(`tr`,`bench-total`);o.append(t(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let n of a){let i=t(`tr`,`bench-total`);i.append(t(`td`,`bench-case`,`Recall, ${n}`),...e.armIds.map(r=>t(`td`,`bench-score`,c(e.totals[r]?.recallByTag[n]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:i,pendingActionBySuite:o,outcomeBySuite:s}=a(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!i,h=t(`div`,`bench-summary`);h.append(t(`span`,`bench-suite-title`,r.title),n(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),n(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),n(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=t(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=t(`span`,`bench-status`,(i?``:`Not connected to the server. Reconnecting.`)||d(e,r)||s.get(r.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),r.error)return c.append(t(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(t(`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(t(`p`,`bench-empty`,r.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:n}=a(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!n)s.append(t(`p`,`bench-empty`,`Waiting for the server.`));else if(!n.configured)s.append(t(`p`,`bench-empty`,n.reason||`Benchmarks are off.`));else if(n.suites.length===0)s.append(t(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of n.suites)s.append(m(n,e))}function g(e){s||(s=t(`div`,`bench-content`),e.append(s),i(h),h())}var _={mount:g};export{_ as view};
1
+ import"./updates-view-core-B_ik1cqt.js";import{n as e,o as t,r as n}from"./dom-helpers-I_SDCPvs.js";import{J as r,Y as i,q as a}from"./index-DZdUH4E2.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,n,i){let a=t(`button`,`bench-action-button`,o[n]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,n)),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 n=t(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(n.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(n.dataset.degraded=`true`),n}function p(e){let n=e.armIds.filter(t=>t!==e.baselineArm),r=t(`table`,`bench-table`),i=t(`tr`);i.append(t(`th`,null,`Case`),...e.armIds.map(n=>t(`th`,null,n===e.baselineArm?`${n} (baseline)`:n))),i.append(...n.map(e=>t(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=t(`tr`);a.append(t(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...n.map(e=>t(`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=t(`tr`,`bench-total`);o.append(t(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let n of a){let i=t(`tr`,`bench-total`);i.append(t(`td`,`bench-case`,`Recall, ${n}`),...e.armIds.map(r=>t(`td`,`bench-score`,c(e.totals[r]?.recallByTag[n]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:i,pendingActionBySuite:o,outcomeBySuite:s}=a(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!i,h=t(`div`,`bench-summary`);h.append(t(`span`,`bench-suite-title`,r.title),n(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),n(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),n(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=t(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=t(`span`,`bench-status`,(i?``:`Not connected to the server. Reconnecting.`)||d(e,r)||s.get(r.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),r.error)return c.append(t(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(t(`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(t(`p`,`bench-empty`,r.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:n}=a(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!n)s.append(t(`p`,`bench-empty`,`Waiting for the server.`));else if(!n.configured)s.append(t(`p`,`bench-empty`,n.reason||`Benchmarks are off.`));else if(n.suites.length===0)s.append(t(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of n.suites)s.append(m(n,e))}function g(e){s||(s=t(`div`,`bench-content`),e.append(s),i(h),h())}var _={mount:g};export{_ as view};