glimmervoid 0.48.1-next.296 → 0.48.1-next.298

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 (131) hide show
  1. package/dist/bin/glimmervoid.js +8 -8
  2. package/dist/chunks/{adapters-Cf5H7LSR.js → adapters-COaU8uYv.js} +1 -1
  3. package/dist/chunks/{adapters-vWkzbJvD.js → adapters-kpXFilus.js} +2 -2
  4. package/dist/chunks/{agent-api-cli-DPW5LSwB.js → agent-api-cli-BkD78g2M.js} +1 -1
  5. package/dist/chunks/{agent-api-cli-Bn-TPeGW.js → agent-api-cli-DHeoLIEd.js} +1 -1
  6. package/dist/chunks/{agent-api-core-R2Xy5gKg.js → agent-api-core-DW4NzWj7.js} +1 -1
  7. package/dist/chunks/{build-channel-DsxBw2tu.js → build-channel-YT-zpE4l.js} +1 -1
  8. package/dist/chunks/{config-Ck7bbVH9.js → config-oQuVGfGq.js} +2 -1
  9. package/dist/chunks/config-store-COPRAYU6.js +1 -0
  10. package/dist/chunks/{config-store-b8BqVlEn.js → config-store-CxBL4j_2.js} +2 -2
  11. package/dist/chunks/{main-ekmr9_8X.js → main-BNESurgS.js} +7 -7
  12. package/dist/chunks/{pair-cli-DetWtUZJ.js → pair-cli-CF7eExt2.js} +2 -2
  13. package/dist/chunks/{remote-config-NCM2tv4W.js → remote-config-COEtQZGX.js} +1 -1
  14. package/dist/chunks/{settings-cli-DHnNZtAn.js → settings-cli-NdMJL0k6.js} +4 -4
  15. package/dist/chunks/{settings-readout-core-BFHYCBgU.js → settings-readout-core-DdylubJR.js} +1 -1
  16. package/dist/chunks/{ssh-sign-cli-D9ZytL9F.js → ssh-sign-cli-pPyKFuSy.js} +1 -1
  17. package/dist/client/assets/{action-status-DCoIompd.js → action-status-RKlYXcNZ.js} +1 -1
  18. package/dist/client/assets/action-status-RKlYXcNZ.js.br +0 -0
  19. package/dist/client/assets/{benchmark-panel-Gw07gRw9.js → benchmark-panel-CTKPRbPl.js} +1 -1
  20. package/dist/client/assets/benchmark-panel-CTKPRbPl.js.br +0 -0
  21. package/dist/client/assets/{boards-view-DjsvfMfO.js → boards-view-N6AISQ23.js} +1 -1
  22. package/dist/client/assets/boards-view-N6AISQ23.js.br +0 -0
  23. package/dist/client/assets/{card-registry-HKhT_jZ9.js → card-registry-ClY5hV4m.js} +1 -1
  24. package/dist/client/assets/card-registry-ClY5hV4m.js.br +0 -0
  25. package/dist/client/assets/community-panel-BQFU1qNM.js +1 -0
  26. package/dist/client/assets/community-panel-BQFU1qNM.js.br +0 -0
  27. package/dist/client/assets/{control-ws-Bq1PaLFs.js → control-ws-BHhn6_gV.js} +1 -1
  28. package/dist/client/assets/control-ws-BHhn6_gV.js.br +0 -0
  29. package/dist/client/assets/dialogs-DR_dkh5R.js +74 -0
  30. package/dist/client/assets/dialogs-DR_dkh5R.js.br +0 -0
  31. package/dist/client/assets/{doc-editor-ui-BUFAbX8Q.js → doc-editor-ui-CfBFXZpu.js} +1 -1
  32. package/dist/client/assets/doc-editor-ui-CfBFXZpu.js.br +0 -0
  33. package/dist/client/assets/{feature-hint-CFCmHse-.js → feature-hint-UTSIczz8.js} +1 -1
  34. package/dist/client/assets/feature-hint-UTSIczz8.js.br +0 -0
  35. package/dist/client/assets/{first-run-checklist-CdZvymef.js → first-run-checklist-BUAyVI3G.js} +1 -1
  36. package/dist/client/assets/first-run-checklist-BUAyVI3G.js.br +0 -0
  37. package/dist/client/assets/{hooks-panel-DlvWQZa1.js → hooks-panel-B232Os-u.js} +1 -1
  38. package/dist/client/assets/hooks-panel-B232Os-u.js.br +0 -0
  39. package/dist/client/assets/{index-BNRAwZga.js → index-BEipwPAs.js} +5 -5
  40. package/dist/client/assets/index-BEipwPAs.js.br +0 -0
  41. package/dist/client/assets/issues-panel-gkUequFV.js +1 -0
  42. package/dist/client/assets/issues-panel-gkUequFV.js.br +0 -0
  43. package/dist/client/assets/my-prs-panel-Cvo3sk3c.js +1 -0
  44. package/dist/client/assets/my-prs-panel-Cvo3sk3c.js.br +0 -0
  45. package/dist/client/assets/{nyan-cat-CiHcmEep.js → nyan-cat-D2DhAmyl.js} +1 -1
  46. package/dist/client/assets/nyan-cat-D2DhAmyl.js.br +0 -0
  47. package/dist/client/assets/phone-shell-7sJ8ezW7.js +1 -0
  48. package/dist/client/assets/phone-shell-7sJ8ezW7.js.br +0 -0
  49. package/dist/client/assets/plan-face-BKRAezRk.js +3 -0
  50. package/dist/client/assets/plan-face-BKRAezRk.js.br +0 -0
  51. package/dist/client/assets/{plan-render-Mbe0O68x.js → plan-render-BF8gd4yB.js} +1 -1
  52. package/dist/client/assets/plan-render-BF8gd4yB.js.br +0 -0
  53. package/dist/client/assets/{pr-queue-columns-C7crGL3N.js → pr-queue-columns-CGSzvEMi.js} +1 -1
  54. package/dist/client/assets/pr-queue-columns-CGSzvEMi.js.br +0 -0
  55. package/dist/client/assets/{radar-panel-C-Gmg8w5.js → radar-panel-QAZ8yNz_.js} +1 -1
  56. package/dist/client/assets/radar-panel-QAZ8yNz_.js.br +0 -0
  57. package/dist/client/assets/{repo-roots-adder-cSwCz76g.js → repo-roots-adder-D1Pf7gcw.js} +1 -1
  58. package/dist/client/assets/repo-roots-adder-D1Pf7gcw.js.br +0 -0
  59. package/dist/client/assets/{resume-dialog-BB5_iAYS.js → resume-dialog-ryLE4AUl.js} +1 -1
  60. package/dist/client/assets/resume-dialog-ryLE4AUl.js.br +0 -0
  61. package/dist/client/assets/review-queue-panel-BkbMAmyh.js +1 -0
  62. package/dist/client/assets/review-queue-panel-BkbMAmyh.js.br +0 -0
  63. package/dist/client/assets/{session-tick-D7Mt551L.js → session-tick-Vjx5JUjd.js} +1 -1
  64. package/dist/client/assets/session-tick-Vjx5JUjd.js.br +0 -0
  65. package/dist/client/assets/settings-panel-czn5zYzu.js +4 -0
  66. package/dist/client/assets/settings-panel-czn5zYzu.js.br +0 -0
  67. package/dist/client/assets/{shown-lightbox-BYJvSN2G.js → shown-lightbox-hZs0E6lR.js} +1 -1
  68. package/dist/client/assets/shown-lightbox-hZs0E6lR.js.br +0 -0
  69. package/dist/client/assets/team-review-panel-DrfLKX-T.css +1 -0
  70. package/dist/client/assets/team-review-panel-DrfLKX-T.css.br +0 -0
  71. package/dist/client/assets/team-review-panel-vfsZ4UTc.js +10 -0
  72. package/dist/client/assets/team-review-panel-vfsZ4UTc.js.br +0 -0
  73. package/dist/client/assets/team-review-settings-core-DMHO8TWI.js +1 -0
  74. package/dist/client/assets/team-review-settings-core-DMHO8TWI.js.br +0 -0
  75. package/dist/client/assets/trace-panel-Dylc5sOS.js +2 -0
  76. package/dist/client/assets/trace-panel-Dylc5sOS.js.br +0 -0
  77. package/dist/client/assets/{updates-view-core-3KY1QJ76.js → updates-view-core-Cm8PSxnG.js} +1 -1
  78. package/dist/client/assets/updates-view-core-Cm8PSxnG.js.br +0 -0
  79. package/dist/client/assets/usage-panel-D2K7T1v2.js +1 -0
  80. package/dist/client/assets/usage-panel-D2K7T1v2.js.br +0 -0
  81. package/dist/client/assets/{your-day-tip-CdvGcG82.js → your-day-tip-DqfUw_AF.js} +1 -1
  82. package/dist/client/assets/your-day-tip-DqfUw_AF.js.br +0 -0
  83. package/dist/client/index.html +6 -6
  84. package/dist/client/index.html.br +0 -0
  85. package/dist/server/index.js +1 -1
  86. package/package.json +1 -1
  87. package/dist/chunks/config-store-Bo7S4J8B.js +0 -1
  88. package/dist/client/assets/action-status-DCoIompd.js.br +0 -0
  89. package/dist/client/assets/benchmark-panel-Gw07gRw9.js.br +0 -0
  90. package/dist/client/assets/boards-view-DjsvfMfO.js.br +0 -0
  91. package/dist/client/assets/card-registry-HKhT_jZ9.js.br +0 -0
  92. package/dist/client/assets/community-panel-BJYM_GKw.js +0 -1
  93. package/dist/client/assets/community-panel-BJYM_GKw.js.br +0 -0
  94. package/dist/client/assets/control-ws-Bq1PaLFs.js.br +0 -0
  95. package/dist/client/assets/dialogs-C6xGG5SL.js +0 -74
  96. package/dist/client/assets/dialogs-C6xGG5SL.js.br +0 -0
  97. package/dist/client/assets/doc-editor-ui-BUFAbX8Q.js.br +0 -0
  98. package/dist/client/assets/feature-hint-CFCmHse-.js.br +0 -0
  99. package/dist/client/assets/first-run-checklist-CdZvymef.js.br +0 -0
  100. package/dist/client/assets/hooks-panel-DlvWQZa1.js.br +0 -0
  101. package/dist/client/assets/index-BNRAwZga.js.br +0 -0
  102. package/dist/client/assets/issues-panel-ClpeMTH3.js +0 -1
  103. package/dist/client/assets/issues-panel-ClpeMTH3.js.br +0 -0
  104. package/dist/client/assets/my-prs-panel-DCeLwVB5.js +0 -1
  105. package/dist/client/assets/my-prs-panel-DCeLwVB5.js.br +0 -0
  106. package/dist/client/assets/nyan-cat-CiHcmEep.js.br +0 -0
  107. package/dist/client/assets/phone-shell-D4YguxFB.js +0 -1
  108. package/dist/client/assets/phone-shell-D4YguxFB.js.br +0 -0
  109. package/dist/client/assets/plan-face-BBVtSxr0.js +0 -3
  110. package/dist/client/assets/plan-face-BBVtSxr0.js.br +0 -0
  111. package/dist/client/assets/plan-render-Mbe0O68x.js.br +0 -0
  112. package/dist/client/assets/pr-queue-columns-C7crGL3N.js.br +0 -0
  113. package/dist/client/assets/radar-panel-C-Gmg8w5.js.br +0 -0
  114. package/dist/client/assets/repo-roots-adder-cSwCz76g.js.br +0 -0
  115. package/dist/client/assets/resume-dialog-BB5_iAYS.js.br +0 -0
  116. package/dist/client/assets/review-queue-panel-CgdpBzX3.js +0 -1
  117. package/dist/client/assets/review-queue-panel-CgdpBzX3.js.br +0 -0
  118. package/dist/client/assets/session-tick-D7Mt551L.js.br +0 -0
  119. package/dist/client/assets/settings-panel-7XlYZkXu.js +0 -4
  120. package/dist/client/assets/settings-panel-7XlYZkXu.js.br +0 -0
  121. package/dist/client/assets/shown-lightbox-BYJvSN2G.js.br +0 -0
  122. package/dist/client/assets/team-review-panel-Cs-qQMoa.js +0 -10
  123. package/dist/client/assets/team-review-panel-Cs-qQMoa.js.br +0 -0
  124. package/dist/client/assets/team-review-panel-Sd_Xfq5G.css +0 -1
  125. package/dist/client/assets/team-review-panel-Sd_Xfq5G.css.br +0 -0
  126. package/dist/client/assets/trace-panel-DwBBp0fI.js +0 -2
  127. package/dist/client/assets/trace-panel-DwBBp0fI.js.br +0 -0
  128. package/dist/client/assets/updates-view-core-3KY1QJ76.js.br +0 -0
  129. package/dist/client/assets/usage-panel-DQdL7lvl.js +0 -1
  130. package/dist/client/assets/usage-panel-DQdL7lvl.js.br +0 -0
  131. package/dist/client/assets/your-day-tip-CdvGcG82.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-DfOgGb2N.js";
7
7
  import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
8
- import { r as agentCommandHelpLines } from "../chunks/agent-api-core-R2Xy5gKg.js";
8
+ import { r as agentCommandHelpLines } from "../chunks/agent-api-core-DW4NzWj7.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-BeOjhVq9.js";
11
11
  import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
@@ -57,7 +57,7 @@ var OWN_SUBCOMMAND_RUNNERS = [
57
57
  return 0;
58
58
  }],
59
59
  ["pair", async (subcommandArgs) => {
60
- const { runPairCli } = await import("../chunks/pair-cli-DetWtUZJ.js");
60
+ const { runPairCli } = await import("../chunks/pair-cli-CF7eExt2.js");
61
61
  return runPairCli(subcommandArgs);
62
62
  }],
63
63
  ["agent", async (subcommandArgs) => {
@@ -65,17 +65,17 @@ var OWN_SUBCOMMAND_RUNNERS = [
65
65
  return runAgentSetupCli(subcommandArgs);
66
66
  }],
67
67
  ["settings", async (subcommandArgs) => {
68
- const { runSettingsCli } = await import("../chunks/settings-cli-DHnNZtAn.js");
68
+ const { runSettingsCli } = await import("../chunks/settings-cli-NdMJL0k6.js");
69
69
  return runSettingsCli(subcommandArgs);
70
70
  }],
71
71
  ["ssh-sign", async (subcommandArgs) => {
72
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-D9ZytL9F.js");
72
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-pPyKFuSy.js");
73
73
  return runSshSignCli(subcommandArgs);
74
74
  }]
75
75
  ];
76
76
  var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
77
77
  var SUBCOMMAND_RUNNERS = new Map([...OWN_SUBCOMMAND_RUNNERS, ...AGENT_API_VERBS.filter((verb) => !ownSubcommandNames.has(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
78
- const { runAgentApiCli } = await import("../chunks/agent-api-cli-Bn-TPeGW.js");
78
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-DHeoLIEd.js");
79
79
  return runAgentApiCli([subcommandName, ...subcommandArgs]);
80
80
  }])]);
81
81
  var AGENT_INSTALL_COMMAND_BY_ID = {
@@ -89,7 +89,7 @@ function missingAgentText(agentId) {
89
89
  }
90
90
  async function printSessionLimits() {
91
91
  if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
92
- const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-Bn-TPeGW.js");
92
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-DHeoLIEd.js");
93
93
  const limitsLines = await sessionLimitsHelpLines();
94
94
  console.log(`\n${limitsLines.join("\n")}`);
95
95
  }
@@ -146,7 +146,7 @@ async function readDeclaredCustomAgents() {
146
146
  declared: [],
147
147
  error: null
148
148
  };
149
- const { loadConfigFile } = await import("../chunks/config-store-Bo7S4J8B.js");
149
+ const { loadConfigFile } = await import("../chunks/config-store-COPRAYU6.js");
150
150
  try {
151
151
  const loaded = loadConfigFile(decided.path, { exitOnError: false });
152
152
  if (!loaded.config) return {
@@ -222,7 +222,7 @@ async function runDoctor() {
222
222
  }
223
223
  switchSection("Agents");
224
224
  try {
225
- const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-Cf5H7LSR.js");
225
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-COaU8uYv.js");
226
226
  const declaredCustomAgents = await readDeclaredCustomAgents();
227
227
  if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
228
228
  setCustomAgents(declaredCustomAgents.declared);
@@ -1 +1 @@
1
- export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-vWkzbJvD.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-kpXFilus.js";
@@ -2,7 +2,7 @@ import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { o as relayPath, u as isPathInside } from "./runtime-paths-D_ZjJLE0.js";
3
3
  import { Yt as FULL_SHA_RE, Zt as shortSha$1 } from "./session-DfOgGb2N.js";
4
4
  import { c as spawn, i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
5
- import { Ot as UpdateChannel, S as InstallFlavor, c as SHELL_AGENT_ID } from "./config-Ck7bbVH9.js";
5
+ import { Ot as UpdateChannel, S as InstallFlavor, c as SHELL_AGENT_ID } from "./config-oQuVGfGq.js";
6
6
  import { o as supervisionLine } from "./session-routes-D-8mGNXo.js";
7
7
  import { a as rawTextOr, o as textOr, r as numberOr } from "./coerce-oz_Z_6E7.js";
8
8
  import { n as parseJsonRecord } from "./json-core-If8h-Qgy.js";
@@ -11,7 +11,7 @@ import { t as buildAgentEnv } from "./spawn-env-D418d7G5.js";
11
11
  import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
12
12
  import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-CRZfS-M5.js";
13
13
  import { O as nextBackoffMs } from "./json-file-AKRVPqG1.js";
14
- import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-DsxBw2tu.js";
14
+ import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-YT-zpE4l.js";
15
15
  import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-Dzr2-y9R.js";
16
16
  import { c as CODEX_HOME_PROFILE, f as renderCodexHookTables, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHooksBlock } from "./agent-home-core-DgW3orTE.js";
17
17
  import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, s as realAgentHome } from "./agent-home-BzANIIVe.js";
@@ -1,6 +1,6 @@
1
1
  import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-DfOgGb2N.js";
2
2
  import { i as formatSessionLimits } from "./session-routes-D-8mGNXo.js";
3
- import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-R2Xy5gKg.js";
3
+ import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-DW4NzWj7.js";
4
4
  import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
5
5
  import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
6
6
  import { r as describeOverCap } from "./shown-files-core-Dji9dyEZ.js";
@@ -1 +1 @@
1
- export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-DPW5LSwB.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-BkD78g2M.js";
@@ -1,5 +1,5 @@
1
1
  import { C as RefinedTaskTitle, R as TASK_TITLE_CONTROL_CHARACTERS, Y as WhiteboardAgentRequest, a as AgentAnswerRequest, c as AgentEditRequest, d as AgentReadRequest, f as AgentReviewsRequest, g as AgentSpawnRequest, h as AgentSettingsRequest, n as AGENT_REPLY_SCHEMAS, o as AgentAttentionRequest, p as AgentSendRequest, s as AgentCloseRequest, t as AGENT_API_VERBS, u as AgentPullRequestRequest } from "./session-DfOgGb2N.js";
2
- import { D as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-Ck7bbVH9.js";
2
+ import { D as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-oQuVGfGq.js";
3
3
  import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-D-8mGNXo.js";
4
4
  import path from "node:path";
5
5
  import crypto from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  import "./session-DfOgGb2N.js";
2
- import { C as ONBOARDING_STEPS, E as OPERATOR_SURFACES, T as OPERATOR_ACTIONS_BY_SURFACE, b as DASHBOARD_VIEWS, j as HintFeature, n as BUILTIN_AGENT_IDS, w as ONBOARDING_STEP_STATES } from "./config-Ck7bbVH9.js";
2
+ import { C as ONBOARDING_STEPS, E as OPERATOR_SURFACES, T as OPERATOR_ACTIONS_BY_SURFACE, b as DASHBOARD_VIEWS, j as HintFeature, n as BUILTIN_AGENT_IDS, w as ONBOARDING_STEP_STATES } from "./config-oQuVGfGq.js";
3
3
  import { z } from "zod";
4
4
  //#region shared/contracts/telemetry.ts
5
5
  var TELEMETRY_ADAPTERS = Object.freeze([...BUILTIN_AGENT_IDS, "custom"]);
@@ -1637,7 +1637,8 @@ var OPERATOR_ACTIONS_BY_SURFACE = Object.freeze({
1637
1637
  "add-session",
1638
1638
  "open-shell",
1639
1639
  "check-github-again",
1640
- "save-github-teams"
1640
+ "save-github-teams",
1641
+ "save-review-skill"
1641
1642
  ],
1642
1643
  reviews: [
1643
1644
  "open-session",
@@ -0,0 +1 @@
1
+ export { c as loadConfigFile } from "./config-store-CxBL4j_2.js";
@@ -1,10 +1,10 @@
1
1
  import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { a as packageRoot, l as equalsIgnoringCaseOnWindows } from "./runtime-paths-D_ZjJLE0.js";
3
3
  import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
4
- import { $ as FLYING_ANIMALS_DEFAULTS, Dt as UPDATE_CHANNELS, Q as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_RETAIN_DAYS_RANGE, at as NON_NEGATIVE_NUMBER_RANGE, bt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, ct as POSTHOG_FIX_TIMEOUT_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, et as FLYING_ANIMALS_DURATION_RANGE, f as USAGE_COST_MODES, ft as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, gt as USAGE_INTEGER_RANGES, ht as USAGE_BUDGET_RANGE, i as Config, it as MEMORY_RESERVE_MB_RANGE, lt as POSTHOG_PROJECT_ID_RANGE, m as normalizeLegacyConfigNumbers, mt as TASK_TITLE_TIMEOUT_RANGE, n as BUILTIN_AGENT_IDS, nt as FLYING_ANIMALS_SCALE_RANGE, ot as PORT_RANGE, pt as REPLAY_BUFFER_KB_RANGE, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSITIVE_NUMBER_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_GAP_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_BASELINE_RANGE, vt as USAGE_SCAN_INTERVAL_RANGE, yt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE } from "./config-Ck7bbVH9.js";
4
+ import { $ as FLYING_ANIMALS_DEFAULTS, Dt as UPDATE_CHANNELS, Q as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_RETAIN_DAYS_RANGE, at as NON_NEGATIVE_NUMBER_RANGE, bt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, ct as POSTHOG_FIX_TIMEOUT_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, et as FLYING_ANIMALS_DURATION_RANGE, f as USAGE_COST_MODES, ft as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, gt as USAGE_INTEGER_RANGES, ht as USAGE_BUDGET_RANGE, i as Config, it as MEMORY_RESERVE_MB_RANGE, lt as POSTHOG_PROJECT_ID_RANGE, m as normalizeLegacyConfigNumbers, mt as TASK_TITLE_TIMEOUT_RANGE, n as BUILTIN_AGENT_IDS, nt as FLYING_ANIMALS_SCALE_RANGE, ot as PORT_RANGE, pt as REPLAY_BUFFER_KB_RANGE, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSITIVE_NUMBER_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_GAP_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_BASELINE_RANGE, vt as USAGE_SCAN_INTERVAL_RANGE, yt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE } from "./config-oQuVGfGq.js";
5
5
  import { n as isRecord } from "./coerce-oz_Z_6E7.js";
6
6
  import { d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-AKRVPqG1.js";
7
- import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-DsxBw2tu.js";
7
+ import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-YT-zpE4l.js";
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
10
10
  import os from "node:os";
@@ -4,9 +4,9 @@ import { a as packageRoot, c as caseFoldedPathKey, d as safePathSegment, f as sa
4
4
  import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
5
5
  import { $ as MyPrAutoRebase, $t as NODE_ID_RE, A as SIGN_URL_ENV, At as ReviewComment, Bt as TeamReviewStateEntry, Ct as FindingSeverity, D as SESSION_NAME_PATTERN, Dt as PostingPlan, Et as PostedReviewEvent, F as ShownFile, Ft as ReviewVerdict, G as Frame, Gt as canApproveAfterComment, H as BoardRecord, Ht as TeamReviewThreadCommentsResponse, It as TeamReviewActionRequest, J as WHITEBOARD_LIMITS, Jt as hasStandingViewerApproval, K as Note, Kt as decisionAsIfApprovalRequired, L as SshSignRequest, Mt as ReviewFinding, Nt as ReviewResult, O as SESSION_NAME_RULE_TEXT, Ot as PrDetail, Pt as ReviewThreadId, Q as MyPr, Qt as GH_SEGMENT, Rt as TeamReviewCompareFiles, S as ConversationQuestion, St as EarlierReview, T as SESSION_DOC_BODY_CAP_BYTES, Tt as GithubReviewState, Ut as TeamReviewThreadResult, Vt as TeamReviewStatus, W as Box, Wt as TeamReviewThreadsRepository, X as Wire, Xt as HEX_SHA_RE, Z as LinkedPr, Zt as shortSha, _ as COHERENCE_HOOKS_INACTIVE, at as MyPrMergeMethod, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as CommitSha, cn as MERGEABLE_LIVE_STATES, ct as MyPrMergeStateResponse, en as REPO_SLUG_RE, et as MyPrCheckContext, ft as MyPrThreadNode, ht as MyPrsState, i as ASK_USER_QUESTION_TOOL_NAME, it as MyPrLaneEntry, j as SSH_SIGN_BODY_CAP_BYTES, jt as ReviewDraft, k as SHOWN_FILE_CAP_BYTES, ln as RESTARTABLE_STATES, lt as MyPrMergeWhenReadyRequest, mt as MyPrsSnapshot, nt as MyPrKeepMergeableRequest, on as BADGE_LABELS, ot as MyPrMergeRequest, pt as MyPrThreadsResponse, r as AGENT_URL_ENV, sn as KILLABLE_STATES, tn as repoParts, tt as MyPrCheckContextsResponse, un as STATES, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, xt as DECIDING_REVIEW_STATES, y as CONVERSATION_PERMISSION_HOOK_EVENT, z as TaskTitle, zt as TeamReviewResolveResponse } from "./session-DfOgGb2N.js";
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
- 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, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as MAX_RAW_LINE_CHARS, k as HINT_FEATURES, kt as UpdateJournal, p as USAGE_VENDOR_KEYS, 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 CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_OUTPUT_MAX_CHARS } from "./config-Ck7bbVH9.js";
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, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as MAX_RAW_LINE_CHARS, k as HINT_FEATURES, kt as UpdateJournal, p as USAGE_VENDOR_KEYS, 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 CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_OUTPUT_MAX_CHARS } from "./config-oQuVGfGq.js";
8
8
  import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-D-8mGNXo.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 nextSuggestedName, H as listRepoConversations, I as isConversationReplacedAtStartup, 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 listRepoWorktreePaths, V as claudeProjectsDir, 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 resumePromptFor } from "./agent-api-core-R2Xy5gKg.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 nextSuggestedName, H as listRepoConversations, I as isConversationReplacedAtStartup, 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 listRepoWorktreePaths, V as claudeProjectsDir, 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 resumePromptFor } from "./agent-api-core-DW4NzWj7.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-BeOjhVq9.js";
12
12
  import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
@@ -17,15 +17,15 @@ import { r as knownWriteHookInput } from "./posthog-read-gate-core-CeSY56AB.js";
17
17
  import { a as readPageTitle, i as filesAfterRetention, n as decideShownKind, o as shownMimeForFilename, r as describeOverCap, t as SHOWN_SNIFF_BYTES } from "./shown-files-core-Dji9dyEZ.js";
18
18
  import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
19
19
  import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as nextBackoffMs, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-AKRVPqG1.js";
20
- 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, k as valueAtPath, 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-b8BqVlEn.js";
21
- 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-DsxBw2tu.js";
20
+ 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, k as valueAtPath, 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-CxBL4j_2.js";
21
+ 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-YT-zpE4l.js";
22
22
  import { i as resolveArgvCommandMatches } from "./kimi-Dzr2-y9R.js";
23
- import { $ as isUsageFile, A as exceedsUploadCap, B as isOversizedPartialLine, C as parseResolvedSha, Ct as totalTokensOf$1, D as MAX_UPLOAD_BYTES, E as openContainedFile, Et as claudeCode, F as MAX_TRANSCRIPT_READ_BYTES, G as codexHomes, H as resumeOffsetFrom, I as TRACE_TAIL_SCAN_BYTES, J as continuationDelayMs, K as codexRootCandidates, L as committedOffsetFromTraceTailOrNull, M as imageMimeForUploadFilename, N as isSafePathSegment, O as buildUploadFilename, P as planUploadRetention, Q as grokHomes, R as completeLineBytes, S as parseRegistryLatest, St as shouldReplace, T as shortSha$1, Tt as HOOK_TOOLS, U as withCommittedOffset, V as planContiguousRead, W as codexFallbackRoots, X as dedupeCodexFiles, Y as decideFileRead, Z as expandTilde, _ as decideUpdateStatus, _t as identityFromRelPath, a as describeAgentResolvability, at as sessionsRootCandidates, b as normalizeUpdateChannel, bt as parseJsonLine, c as isKnownAgentId, ct as splitLines, d as resolveAdapter, dt as addEntryToTotals, et as kimiHomes, f as setCustomAgents, ft as dedupKeys, g as decideInstallFlavor, gt as foldReplacementIntoGenerationRollup, h as requestCodexAppServer, ht as foldEntryIntoGenerationRollup, i as customAgentFingerprint, it as scopedClaudeRoots, j as framePathPaste, k as decideUploadType, l as listAgentIds, lt as kimiDedupIdentity, m as readHostCodexVersion, mt as expandAdvisorIterations, n as cachedAgentResolvability, nt as projectDirCandidates, o as getAdapter, ot as shouldEvaluateDespiteIoFailures, p as codex, pt as emptyTotals, q as codexSessionIdFromPath, r as commandFor, rt as resolveProjectsDirs, s as hookProfileOf, st as shouldPersistWarehouse, t as DEFAULT_AGENT_ID$1, tt as passOutcome, u as resetCommandCache, ut as parseKimiUsageLine, v as isCheckFresh, vt as isWithinGenerationRecencyWindow, w as pickNewestPublished, wt as vendorUsageEntry, x as parseRegistryDeprecation, xt as parseUsageLine, y as normalizeSha, yt as mergeGenerationRollups, z as containmentRefusalReason } from "./adapters-vWkzbJvD.js";
23
+ import { $ as isUsageFile, A as exceedsUploadCap, B as isOversizedPartialLine, C as parseResolvedSha, Ct as totalTokensOf$1, D as MAX_UPLOAD_BYTES, E as openContainedFile, Et as claudeCode, F as MAX_TRANSCRIPT_READ_BYTES, G as codexHomes, H as resumeOffsetFrom, I as TRACE_TAIL_SCAN_BYTES, J as continuationDelayMs, K as codexRootCandidates, L as committedOffsetFromTraceTailOrNull, M as imageMimeForUploadFilename, N as isSafePathSegment, O as buildUploadFilename, P as planUploadRetention, Q as grokHomes, R as completeLineBytes, S as parseRegistryLatest, St as shouldReplace, T as shortSha$1, Tt as HOOK_TOOLS, U as withCommittedOffset, V as planContiguousRead, W as codexFallbackRoots, X as dedupeCodexFiles, Y as decideFileRead, Z as expandTilde, _ as decideUpdateStatus, _t as identityFromRelPath, a as describeAgentResolvability, at as sessionsRootCandidates, b as normalizeUpdateChannel, bt as parseJsonLine, c as isKnownAgentId, ct as splitLines, d as resolveAdapter, dt as addEntryToTotals, et as kimiHomes, f as setCustomAgents, ft as dedupKeys, g as decideInstallFlavor, gt as foldReplacementIntoGenerationRollup, h as requestCodexAppServer, ht as foldEntryIntoGenerationRollup, i as customAgentFingerprint, it as scopedClaudeRoots, j as framePathPaste, k as decideUploadType, l as listAgentIds, lt as kimiDedupIdentity, m as readHostCodexVersion, mt as expandAdvisorIterations, n as cachedAgentResolvability, nt as projectDirCandidates, o as getAdapter, ot as shouldEvaluateDespiteIoFailures, p as codex, pt as emptyTotals, q as codexSessionIdFromPath, r as commandFor, rt as resolveProjectsDirs, s as hookProfileOf, st as shouldPersistWarehouse, t as DEFAULT_AGENT_ID$1, tt as passOutcome, u as resetCommandCache, ut as parseKimiUsageLine, v as isCheckFresh, vt as isWithinGenerationRecencyWindow, w as pickNewestPublished, wt as vendorUsageEntry, x as parseRegistryDeprecation, xt as parseUsageLine, y as normalizeSha, yt as mergeGenerationRollups, z as containmentRefusalReason } from "./adapters-kpXFilus.js";
24
24
  import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-DgW3orTE.js";
25
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-BzANIIVe.js";
26
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";
27
- 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-NCM2tv4W.js";
28
- import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-BFHYCBgU.js";
27
+ 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-COEtQZGX.js";
28
+ import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-DdylubJR.js";
29
29
  import { createRequire } from "node:module";
30
30
  import fs, { readFileSync } from "node:fs";
31
31
  import path, { join, resolve } from "node:path";
@@ -1,6 +1,6 @@
1
1
  import { r as errorMessage } from "./text-DoirglWV.js";
2
- import { l as resolveConfigPath } from "./config-store-b8BqVlEn.js";
3
- import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-NCM2tv4W.js";
2
+ import { l as resolveConfigPath } from "./config-store-CxBL4j_2.js";
3
+ import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-COEtQZGX.js";
4
4
  import fs from "node:fs";
5
5
  //#region server/text-format.ts
6
6
  function trimIso(iso) {
@@ -2,7 +2,7 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { l as equalsIgnoringCaseOnWindows } from "./runtime-paths-D_ZjJLE0.js";
3
3
  import { n as isRecord } from "./coerce-oz_Z_6E7.js";
4
4
  import { a as jsonStateLoadError, d as writeJsonAtomicSync, l as sleepSync, s as loadJsonStateFileSync, u as writeJsonAtomic } from "./json-file-AKRVPqG1.js";
5
- import { ct as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-b8BqVlEn.js";
5
+ import { ct as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-CxBL4j_2.js";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
8
8
  import crypto from "node:crypto";
@@ -1,11 +1,11 @@
1
1
  import { r as errorMessage, t as errorCode } from "./text-DoirglWV.js";
2
2
  import { n as glimmervoidHomeDir, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
3
3
  import { m as AgentSettingsReply } from "./session-DfOgGb2N.js";
4
- import { r as BrowserConfig } from "./config-Ck7bbVH9.js";
4
+ import { r as BrowserConfig } from "./config-oQuVGfGq.js";
5
5
  import { n as isRecord } from "./coerce-oz_Z_6E7.js";
6
6
  import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
7
- import { E as setValueAtPath, Q as readEnvSecrets, T as scoreSettingsSearch, Z as ENV_SECRET_BINDINGS, b as cloneValue, c as loadConfigFile, d as validateConfig, et as withEnvSecrets, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, w as parsePosthogProjectSelection, x as deleteValueAtPath } from "./config-store-b8BqVlEn.js";
8
- import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as availableSettings } from "./settings-readout-core-BFHYCBgU.js";
7
+ import { E as setValueAtPath, Q as readEnvSecrets, T as scoreSettingsSearch, Z as ENV_SECRET_BINDINGS, b as cloneValue, c as loadConfigFile, d as validateConfig, et as withEnvSecrets, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, w as parsePosthogProjectSelection, x as deleteValueAtPath } from "./config-store-CxBL4j_2.js";
8
+ import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as availableSettings } from "./settings-readout-core-DdylubJR.js";
9
9
  import fs from "node:fs";
10
10
  import os from "node:os";
11
11
  import { parseArgs } from "node:util";
@@ -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-Bn-TPeGW.js");
333
+ const { askAgentApi } = await import("./agent-api-cli-DHeoLIEd.js");
334
334
  const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
335
335
  ok: false,
336
336
  error: errorMessage(error)
@@ -1,6 +1,6 @@
1
1
  import { h as AgentSettingsRequest } from "./session-DfOgGb2N.js";
2
2
  import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
3
- import { A as FILE_ONLY_GROUPS, C as hasScaledUnit, D as settingsGroupOf, O as settingsOf, Q as readEnvSecrets, S as displayText, b as cloneValue, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, y as SETTINGS_INDEX } from "./config-store-b8BqVlEn.js";
3
+ import { A as FILE_ONLY_GROUPS, C as hasScaledUnit, D as settingsGroupOf, O as settingsOf, Q as readEnvSecrets, S as displayText, b as cloneValue, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, y as SETTINGS_INDEX } from "./config-store-CxBL4j_2.js";
4
4
  import { parseArgs } from "node:util";
5
5
  //#region server/core/settings-readout-core.ts
6
6
  var VALUE_COLUMN_WIDTH = 40;
@@ -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-DfOgGb2N.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-DPW5LSwB.js";
5
+ import { n as postToAgentIngress } from "./agent-api-cli-BkD78g2M.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{Q as e,Y as t,n}from"./updates-view-core-3KY1QJ76.js";import{o as r,x as i}from"./dom-helpers-I_SDCPvs.js";import{c as a,d as o,u as s}from"./control-ws-Bq1PaLFs.js";var c=`http://www.w3.org/2000/svg`;function l(e,t){let n=document.createElementNS(c,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function u(e,t){let n=document.createElementNS(c,`svg`);return n.setAttribute(`width`,String(e)),n.setAttribute(`height`,String(t)),n.setAttribute(`viewBox`,`0 0 ${e} ${t}`),n.setAttribute(`aria-hidden`,`true`),n}var d=`M4 4L12 12M12 4L4 12`,f=`M10 3L5 8L10 13`,p=`M3 8h0.01M8 8h0.01M13 8h0.01`,m=`M8 2.5v6M5 5.5h6M5 12.5h6`,h=`M4.5 12.5h7a3 3 0 0 0 0.4-5.97a4 4 0 0 0-7.7 0.57a2.7 2.7 0 0 0 0.3 5.4z`,g=`M8 1.8l5.2 2v4c0 3.2-2.2 5.4-5.2 6.4c-3-1-5.2-3.2-5.2-6.4v-4z`,_=`M9.2 1.5L3.5 9h4.3l-1 5.5L12.5 7H8.2z`,v=`M8.7 4.2L5.6 8.6h2.5l-.6 3.2l3.1-4.4H8.1z`,y=`M3 13V9M8 13V3M13 13V6.5`;function b(e,t=`2`){let n=u(16,16);return n.classList.add(`line-icon`),n.append(l(`path`,{d:e,fill:`none`,stroke:`currentColor`,"stroke-width":t,"stroke-linecap":`round`,"stroke-linejoin":`round`})),n}function x(e,t){let{class:n,...r}=t,i=u(16,16);return n!==void 0&&i.classList.add(n),i.append(l(e,r)),i}function S(e){let t=document.createElement(`span`);t.className=`status-icon`,t.dataset.icon=e;for(let n of i[e])t.append(x(n.tag,n.attributes));return t}function C(e,t){e.dataset.icon!==t&&(e.dataset.icon=t,e.replaceChildren(S(t)))}var w={busy:`text-text-muted`,ok:`text-state-done`,error:`text-state-failed`},T=15e3,E=`Something went wrong. Details are hidden in streamer mode.`;function D(e,t){return e!==`error`||t.startsWith(`Not connected to the server. Reconnecting.`)?t:document.documentElement.hasAttribute(`data-streamer`)?E:t}var O={busy:`working`,ok:`complete`,error:`failed`};function k(e){let t=e.querySelector(`:scope > .action-status-icon`),n=e.querySelector(`:scope > .action-status-text`);if(t&&n&&e.childNodes.length===2)return{iconElement:t,textElement:n};let i=r(`span`,`action-status-icon`);i.setAttribute(`aria-hidden`,`true`);let a=r(`span`,`action-status-text`);return e.replaceChildren(i,a),{iconElement:i,textElement:a}}function A(e){e.replaceChildren(),delete e.dataset.tone}function j(e,t,n){if(!n){A(e);return}if(!t){A(e),e.textContent=n;return}e.dataset.tone=t;let{iconElement:r,textElement:i}=k(e);C(r,O[t]),i.textContent=D(t,n)}function M(e=`action-status`){let t=r(`p`,e);return t.setAttribute(`role`,`status`),t.hidden=!0,{element:t,show:(n,r)=>{t.className=`${e} text-meta ${w[n]}`,j(t,n,r),t.hidden=!r},clear:()=>{t.hidden=!0,A(t)}}}function N(e,t){return s(e)?!0:(t.show(`error`,n),!1)}function P(e,t){let n=e instanceof Error?e.message:``;return n===`Request timed out`?`The server did not answer within ${Math.round(t/1e3)} s.`:n||`Not connected to the server. Reconnecting.`}async function F(e,t,n,{busyText:r,timeoutMs:i=T}={}){r&&n.show(`busy`,r);try{let r=await o(e,t,{timeoutMs:i});return n.clear(),r}catch(e){return n.show(`error`,P(e,i)),null}}var I=null,L=3e4,R=null;function z(){let e=document.getElementById(`header-status`),t=document.getElementById(`header-status-text`),n=document.getElementById(`header-status-age`),r=document.getElementById(`header-status-dismiss`);return!e||!t||!n||!r?null:(r.dataset.wired===void 0&&(r.dataset.wired=``,r.addEventListener(`click`,W)),{line:e,text:t,age:n})}function B(){let n=z();if(!n||!I)return;let r=e(Date.now()-I.raisedAt,{...t,justNowBelowSeconds:60});n.age.textContent!==r&&(n.age.textContent=r)}function V({source:e,sessionId:t,message:n,hidesInStreamerMode:i=!0}){a(e,n);let o=z();if(!o)return;let s=i?D(`error`,n):n,c=r(`strong`,`header-status-source`,e);o.text.replaceChildren(c,` ${s}`),o.text.title=`${e}: ${s}`,I={source:e,sessionId:t??null,raisedAt:Date.now()},B(),R??=window.setInterval(B,L),o.line.hidden=!1}function H(e,t){I?.source===e&&(t===void 0||I.sessionId===t)&&W()}function U(e){I?.sessionId===e&&W()}function W(){I=null,R!==null&&window.clearInterval(R),R=null;let e=z();e&&(e.line.hidden=!0,e.text.replaceChildren(),e.text.title=``,e.age.textContent=``)}export{l as S,v as _,j as a,b,F as c,f as d,_ as f,p as g,h,M as i,N as l,d as m,H as n,V as o,m as p,U as r,P as s,T as t,C as u,g as v,u as x,y};
1
+ import{Q as e,Y as t,n}from"./updates-view-core-Cm8PSxnG.js";import{o as r,x as i}from"./dom-helpers-I_SDCPvs.js";import{c as a,d as o,u as s}from"./control-ws-BHhn6_gV.js";var c=`http://www.w3.org/2000/svg`;function l(e,t){let n=document.createElementNS(c,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function u(e,t){let n=document.createElementNS(c,`svg`);return n.setAttribute(`width`,String(e)),n.setAttribute(`height`,String(t)),n.setAttribute(`viewBox`,`0 0 ${e} ${t}`),n.setAttribute(`aria-hidden`,`true`),n}var d=`M4 4L12 12M12 4L4 12`,f=`M10 3L5 8L10 13`,p=`M3 8h0.01M8 8h0.01M13 8h0.01`,m=`M8 2.5v6M5 5.5h6M5 12.5h6`,h=`M4.5 12.5h7a3 3 0 0 0 0.4-5.97a4 4 0 0 0-7.7 0.57a2.7 2.7 0 0 0 0.3 5.4z`,g=`M8 1.8l5.2 2v4c0 3.2-2.2 5.4-5.2 6.4c-3-1-5.2-3.2-5.2-6.4v-4z`,_=`M9.2 1.5L3.5 9h4.3l-1 5.5L12.5 7H8.2z`,v=`M8.7 4.2L5.6 8.6h2.5l-.6 3.2l3.1-4.4H8.1z`,y=`M3 13V9M8 13V3M13 13V6.5`;function b(e,t=`2`){let n=u(16,16);return n.classList.add(`line-icon`),n.append(l(`path`,{d:e,fill:`none`,stroke:`currentColor`,"stroke-width":t,"stroke-linecap":`round`,"stroke-linejoin":`round`})),n}function x(e,t){let{class:n,...r}=t,i=u(16,16);return n!==void 0&&i.classList.add(n),i.append(l(e,r)),i}function S(e){let t=document.createElement(`span`);t.className=`status-icon`,t.dataset.icon=e;for(let n of i[e])t.append(x(n.tag,n.attributes));return t}function C(e,t){e.dataset.icon!==t&&(e.dataset.icon=t,e.replaceChildren(S(t)))}var w={busy:`text-text-muted`,ok:`text-state-done`,error:`text-state-failed`},T=15e3,E=`Something went wrong. Details are hidden in streamer mode.`;function D(e,t){return e!==`error`||t.startsWith(`Not connected to the server. Reconnecting.`)?t:document.documentElement.hasAttribute(`data-streamer`)?E:t}var O={busy:`working`,ok:`complete`,error:`failed`};function k(e){let t=e.querySelector(`:scope > .action-status-icon`),n=e.querySelector(`:scope > .action-status-text`);if(t&&n&&e.childNodes.length===2)return{iconElement:t,textElement:n};let i=r(`span`,`action-status-icon`);i.setAttribute(`aria-hidden`,`true`);let a=r(`span`,`action-status-text`);return e.replaceChildren(i,a),{iconElement:i,textElement:a}}function A(e){e.replaceChildren(),delete e.dataset.tone}function j(e,t,n){if(!n){A(e);return}if(!t){A(e),e.textContent=n;return}e.dataset.tone=t;let{iconElement:r,textElement:i}=k(e);C(r,O[t]),i.textContent=D(t,n)}function M(e=`action-status`){let t=r(`p`,e);return t.setAttribute(`role`,`status`),t.hidden=!0,{element:t,show:(n,r)=>{t.className=`${e} text-meta ${w[n]}`,j(t,n,r),t.hidden=!r},clear:()=>{t.hidden=!0,A(t)}}}function N(e,t){return s(e)?!0:(t.show(`error`,n),!1)}function P(e,t){let n=e instanceof Error?e.message:``;return n===`Request timed out`?`The server did not answer within ${Math.round(t/1e3)} s.`:n||`Not connected to the server. Reconnecting.`}async function F(e,t,n,{busyText:r,timeoutMs:i=T}={}){r&&n.show(`busy`,r);try{let r=await o(e,t,{timeoutMs:i});return n.clear(),r}catch(e){return n.show(`error`,P(e,i)),null}}var I=null,L=3e4,R=null;function z(){let e=document.getElementById(`header-status`),t=document.getElementById(`header-status-text`),n=document.getElementById(`header-status-age`),r=document.getElementById(`header-status-dismiss`);return!e||!t||!n||!r?null:(r.dataset.wired===void 0&&(r.dataset.wired=``,r.addEventListener(`click`,W)),{line:e,text:t,age:n})}function B(){let n=z();if(!n||!I)return;let r=e(Date.now()-I.raisedAt,{...t,justNowBelowSeconds:60});n.age.textContent!==r&&(n.age.textContent=r)}function V({source:e,sessionId:t,message:n,hidesInStreamerMode:i=!0}){a(e,n);let o=z();if(!o)return;let s=i?D(`error`,n):n,c=r(`strong`,`header-status-source`,e);o.text.replaceChildren(c,` ${s}`),o.text.title=`${e}: ${s}`,I={source:e,sessionId:t??null,raisedAt:Date.now()},B(),R??=window.setInterval(B,L),o.line.hidden=!1}function H(e,t){I?.source===e&&(t===void 0||I.sessionId===t)&&W()}function U(e){I?.sessionId===e&&W()}function W(){I=null,R!==null&&window.clearInterval(R),R=null;let e=z();e&&(e.line.hidden=!0,e.text.replaceChildren(),e.text.title=``,e.age.textContent=``)}export{l as S,v as _,j as a,b,F as c,f as d,_ as f,p as g,h,M as i,N as l,d as m,H as n,V as o,m as p,U as r,P as s,T as t,C as u,g as v,u as x,y};
@@ -1 +1 @@
1
- import"./updates-view-core-3KY1QJ76.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-BNRAwZga.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-Cm8PSxnG.js";import{n as e,o as t,r as n}from"./dom-helpers-I_SDCPvs.js";import{J as r,X as i,Y as a}from"./index-BEipwPAs.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,r){let i=t(`button`,`bench-action-button`,o[n]);return i.type=`button`,i.disabled=r,i.addEventListener(`click`,()=>a(e.id,n)),i}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,i){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=r(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===i.id,f=!!e.inFlight&&!l,m=o.has(i.id)||!a,h=t(`div`,`bench-summary`);h.append(t(`span`,`bench-suite-title`,i.title),n(`bench`,i.caseCount===1?`case`:`cases`,String(i.caseCount)),n(`bench`,i.candidateCount===1?`candidate`:`candidates`,String(i.candidateCount)),n(`bench`,`arms`,String(i.armIds.length))),c.append(h);let g=t(`div`,`bench-controls`),_=e.configured===!0&&i.error===null;g.append(u(i,`mine`,!_||m||l),u(i,`run`,!_||m||l||f||i.caseCount===0),u(i,`cancel`,m||!l));let v=t(`span`,`bench-status`,(a?``:`Not connected to the server. Reconnecting.`)||d(e,i)||s.get(i.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),i.error)return c.append(t(`p`,`bench-error`,i.error)),c;let y=i.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`,i.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:n}=r(),i=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(i),!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 +1 @@
1
- import{Et as e}from"./updates-view-core-3KY1QJ76.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-HKhT_jZ9.js";import{i}from"./action-status-DCoIompd.js";import{a,n as o}from"./modal-BRwbyxA2.js";import{$r as s,ai as c,bi as l,ci as u,ei as d,ii as f,ni as p,oi as m,ri as h,si as g,ti as _,vi as v,yi as y}from"./index-BNRAwZga.js";var b=4,ee=200,te=2e4,ne=1.1,re=[`wire`,`note`,`frame`,`box`];function x(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function S(){return document.documentElement.dataset.layout===`phone`}function ie(e){let{svg:n,canvas:r,renderer:i}=e,a=new Map,o=new Set,s={x:0,y:0,width:1e3,height:600},c=null,l=null;function u(){n.setAttribute(`viewBox`,`${s.x} ${s.y} ${s.width} ${s.height}`)}function d(){let e=i.layout();if(!e)return;let{bounds:t}=e,r=n.clientWidth,a=n.clientHeight;if(r===0||a===0){s={...t},u();return}let o=Math.max(1,t.width/r,t.height/a);s={x:t.x,y:t.y,width:r*o,height:a*o},u()}function f(e,t){let r=n.getScreenCTM();if(!r)return{x:e,y:t};let i=new DOMPoint(e,t).matrixTransform(r.inverse());return{x:i.x,y:i.y}}function p(){let e=n.clientWidth||1,t=n.clientHeight||1;return Math.max(s.width/e,s.height/t)}function m(e,t){let n=Math.min(te,Math.max(ee,s.width*t)),r=n/s.width;s={x:e.x-(e.x-s.x)*r,y:e.y-(e.y-s.y)*r,width:n,height:s.height*r},u()}function h(e,t){let n=p();s={...s,x:s.x-e*n,y:s.y-t*n},u()}function g(t){o=t,i.setSelection(o),e.onSelectionChange(o)}function _(e,t){if(!t){g(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),g(n)}function v(e){let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&g(t)}function y(e){let t=i.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function x(){let[e,t]=[...a.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function ie(){c={kind:`pinch`,distance:x(),viewWidth:s.width}}function C(e){if(e.button!==0||l)return;if(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),n.setPointerCapture(e.pointerId),a.size===2){ie();return}let t=i.elementFromTarget(e.target),r=t?.kind===`box`&&!S()?y(t.id):null;if(t&&r){c={kind:`drag`,pointerId:e.pointerId,boxId:t.id,origin:f(e.clientX,e.clientY),start:r,hasMoved:!1,isAdditive:e.shiftKey};return}if(t&&!S()){_(t.id,e.shiftKey);return}let o=t?.kind===`box`?t.id:null;c={kind:`pan`,pointerId:e.pointerId,lastClient:{x:e.clientX,y:e.clientY},hasMoved:!1,tappedBoxId:o}}function w(e,t){let n=f(t.clientX,t.clientY),r=n.x-e.origin.x,a=n.y-e.origin.y;!e.hasMoved&&Math.hypot(r,a)<b*p()||(e.hasMoved=!0,i.nodeOf(e.boxId)?.setAttribute(`transform`,`translate(${r} ${a})`))}function ae(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<b||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},h(n,r))}function oe(e){let t=x();if(t<=0||e.distance<=0)return;let n=[...a.values()];m(f(n.reduce((e,t)=>e+t.x,0)/n.length,n.reduce((e,t)=>e+t.y,0)/n.length),e.viewWidth*(e.distance/t)/s.width)}function se(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?oe(c):c?.kind===`drag`&&c.pointerId===e.pointerId?w(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&ae(c,e))}async function ce(t,n){if(!t.hasMoved){_(t.boxId,t.isAdditive);return}let r=f(n.clientX,n.clientY),a={x:Math.round(t.start.x+r.x-t.origin.x),y:Math.round(t.start.y+r.y-t.origin.y)};await e.sendOps([{op:`set`,id:t.boxId,fields:{at:a}}])||i.nodeOf(t.boxId)?.removeAttribute(`transform`)}function le(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?ce(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&S()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||g(new Set)))}function ue(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function T(e){e.preventDefault(),e.ctrlKey||e.metaKey?m(f(e.clientX,e.clientY),e.deltaY>0?ne:1/ne):h(-e.deltaX,-e.deltaY)}function E(){let e=l;l=null,e?.remove()}function de(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;E();let c=r.getBoundingClientRect(),u=s.getBoundingClientRect(),d=t(`input`,`wb-title-input`);d.type=`text`,d.value=o.title,d.maxLength=80,d.setAttribute(`aria-label`,`Box title`),d.style.left=`${u.left-c.left}px`,d.style.top=`${u.top-c.top}px`,d.style.width=`${Math.max(160,u.width)}px`,l=d,r.append(d),d.addEventListener(`keydown`,t=>{if(t.key===`Escape`){t.preventDefault(),E(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();E(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,E),d.focus(),d.select()}function fe(e){if(S())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&de(t.id)}function pe(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=re.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));g(new Set),e.sendOps(r)}function me(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),pe()):e.key===`Escape`&&g(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,C),n.addEventListener(`pointermove`,se),n.addEventListener(`pointerup`,le),n.addEventListener(`pointercancel`,ue),n.addEventListener(`wheel`,T,{passive:!1}),n.addEventListener(`dblclick`,fe),n.addEventListener(`keydown`,me),{fit:d,selectedIds:()=>o,clearSelection:()=>g(new Set),pruneSelection:v,closeTitleInput:E}}var C=40,w=220,ae=90,oe=30,se=20,ce=18,le=20,ue=26,T=18,E=26,de=170,fe=21,pe=17,me=10,D=22,he=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function O(e,t){let n=e.split(/\s+/).filter(Boolean),r=[],i=``;for(let e of n){let n=e.match(RegExp(`.{1,${t}}`,`g`))??[e];for(let e of n){let n=i?`${i} ${e}`:e;n.length<=t?i=n:(r.push(i),i=e)}}return i&&r.push(i),r.length>0?r:[``]}function ge(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:he[n.color]}:null}function _e(e,t){let n=O(t.title,le),r=t.lines.flatMap(e=>O(e.text,ue-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ge(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*se+r.length*ce+(i?26:0)}}function k(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function A(e){return C+e*310}function ve(e){let t=new Map,n=new Map,r=k(e,`box`).map((e,t)=>({box:e,index:t})).sort((e,t)=>e.box.order-t.box.order||e.index-t.index);for(let{box:i}of r){let r=Math.max(0,e.columns.findIndex(e=>e.id===i.column)),a=_e(e,i),o=n.get(i.column)??84,s=i.at??{x:A(r),y:o};i.at||n.set(i.column,o+a.height+oe),t.set(i.id,{kind:`box`,id:i.id,x:s.x,y:s.y,width:w,height:a.height,titleLines:a.titleLines,bodyLines:a.bodyLines,lane:a.lane,isGhost:i.ghost})}return t}function ye(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}function be(e,t){return k(e,`frame`).flatMap(e=>{let n=ye(e.contains.flatMap(e=>t.get(e)??[]));return n?[{kind:`frame`,id:e.id,title:e.title,x:n.x-T,y:n.y-T-E,width:n.width+36,height:n.height+36+E}]:[]})}function xe(e,t){let n=e.x+e.width/2,r=t.x+t.width/2;if(Math.abs(r-n)>e.width/2){let i=r>n,a={x:i?e.x+e.width:e.x,y:e.y+Math.min(e.height/2,40)},o={x:i?t.x:t.x+t.width,y:t.y+Math.min(t.height/2,40)},s=(o.x-a.x)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x+s} ${a.y}, ${o.x-s} ${o.y}, ${o.x} ${o.y}`}}let i=t.y>e.y,a={x:n,y:i?e.y+e.height:e.y},o={x:r,y:i?t.y:t.y+t.height},s=(o.y-a.y)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x} ${a.y+s}, ${o.x} ${o.y-s}, ${o.x} ${o.y}`}}function Se(e,t){return k(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=xe(n,r);return[{kind:`wire`,id:e.id,path:i.path,start:i.start,end:i.end,label:e.label,labelAt:{x:(i.start.x+i.end.x)/2,y:(i.start.y+i.end.y)/2-6},isDashed:e.dashed,tone:e.tone,strokeHex:e.tone===`lane`?n.lane?.hex??null:null}]})}function Ce(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function we(e,t){let n=new Map;return k(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let i=O(e.text,fe),a=24+(i.length+1)*pe,o=n.get(e.on)??r.y-8;return n.set(e.on,o+a+me),[{kind:`note`,id:e.id,x:r.x+r.width-24,y:o,width:de,height:a,lines:i,byline:Ce(e),isResolved:e.resolvedBy!==null}]})}function Te(e,t){let n=e.flatMap(e=>e.kind===`wire`?[]:[e]),r=A(Math.max(1,t))-ae,i=ye([...n,{x:0,y:0,width:r,height:84}]);return i?{x:Math.min(0,i.x-C),y:Math.min(0,i.y-C),width:i.width+80,height:i.height+80}:{x:0,y:0,width:r+C,height:80}}function Ee(e){let t=ve(e),n=[...be(e,t),...Se(e,t),...t.values(),...we(e,t)],r=Te(n,e.columns.length),i=r.y+r.height,a=e.lanes.map((e,t)=>({label:e.label||e.id,hex:he[e.color],x:C,y:i+t*D})),o=i+a.length*D+(a.length>0?12:0),s=e.caption?{text:e.caption,x:C,y:o}:null,c=a.length*D+(s?30:0)+(a.length>0?12:0);return{columns:e.columns.map((e,t)=>({id:e.id,title:e.title,x:A(t),width:w})),elements:n,legend:a,caption:s,bounds:{...r,height:r.height+c}}}function De(e){return JSON.stringify(e)}var Oe=`http://www.w3.org/2000/svg`,j=12,ke=26,Ae=20,je=18,Me=17,Ne=14;function M(e,t={},n=``){let r=document.createElementNS(Oe,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return n&&r.setAttribute(`class`,n),r}function N(e,t,n,r){let i=M(`text`,{x:t,y:n},r);return i.textContent=e,i}function P(e,t){let n=M(`g`,{},`wb-element ${t}`);return n.dataset.elementId=e.id,n.dataset.elementKind=e.kind,n}function Pe(e){let t=P(e,e.isGhost?`wb-box wb-ghost`:`wb-box`),n=M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:8},`wb-box-outline`);e.lane&&(n.style.stroke=e.lane.hex),t.append(n),e.titleLines.forEach((n,r)=>{t.append(N(n,e.x+j,e.y+ke+r*Ae,`wb-box-title`))});let r=e.y+ke+e.titleLines.length*Ae;if(e.bodyLines.forEach((n,i)=>{let a=e.x+j+(n.muted?Ne:0);t.append(N(n.text,a,r+i*je,n.muted?`wb-box-line wb-muted`:`wb-box-line`))}),!e.lane)return t;let i=e.y+e.height-28,a=Math.min(e.width-24,16+e.lane.label.length*8),o=M(`rect`,{x:e.x+j,y:i,width:a,height:18,rx:9},`wb-lane-pill`);o.style.stroke=e.lane.hex;let s=N(e.lane.label,e.x+j+8,i+13,`wb-lane-pill-text`);return s.style.fill=e.lane.hex,t.append(o,s),t}function Fe(e){let t=P(e,`wb-frame`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12},`wb-frame-outline`),N(e.title,e.x+14,e.y+18,`wb-frame-title`)),t}function Ie(e){let t=P(e,`wb-wire wb-tone-${e.tone}`),n=M(`path`,{d:e.path},`wb-wire-hit`),r=M(`path`,{d:e.path,"marker-end":`url(#wb-arrow)`},e.isDashed?`wb-wire-line wb-dashed`:`wb-wire-line`);return e.strokeHex&&(r.style.stroke=e.strokeHex),t.append(n,r,M(`circle`,{cx:e.start.x,cy:e.start.y,r:3},`wb-wire-dot`)),e.label&&t.append(N(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),t}function Le(e){let t=P(e,e.isResolved?`wb-note wb-resolved`:`wb-note`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:4},`wb-note-card`)),e.lines.forEach((n,r)=>{t.append(N(n,e.x+10,e.y+22+r*Me,`wb-note-text`))}),e.byline&&t.append(N(e.byline,e.x+10,e.y+22+e.lines.length*Me,`wb-note-byline`)),t}var Re={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},ze=[`box`,`frame`,`wire`,`note`];function Be(e){switch(e.kind){case`box`:return Pe(e);case`frame`:return Fe(e);case`wire`:return Ie(e);case`note`:return Le(e)}}function Ve(e){let t=M(`g`,{},`wb-chrome`);for(let n of e.columns)n.title&&t.append(N(n.title,n.x,56,`wb-column-title`),M(`line`,{x1:n.x,y1:66,x2:n.x+n.width,y2:66},`wb-column-rule`));for(let n of e.legend){let e=M(`rect`,{x:n.x,y:n.y,width:14,height:14,rx:3},`wb-legend-swatch`);e.style.fill=n.hex,t.append(e,N(n.label,n.x+22,n.y+12,`wb-legend-text`))}return e.caption&&t.append(N(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),t}function He(){let e=M(`defs`),t=M(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`});return t.append(M(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})),e.append(t),e}function Ue(e){let t={frames:M(`g`,{},`wb-layer`),wires:M(`g`,{},`wb-layer`),boxes:M(`g`,{},`wb-layer`),notes:M(`g`,{},`wb-layer`)},n=M(`g`);e.replaceChildren(He(),n,t.frames,t.wires,t.boxes,t.notes);let r=new Map,i=null,a=new Set;function o(e,t){t.classList.toggle(`is-selected`,a.has(e))}function s(e){let a=Ee(e),s=Ve(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=De(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Be(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[Re[e.kind]].append(a),r.set(e.id,{signature:n,node:a})}for(let[e,t]of r)c.has(e)||(t.node.remove(),r.delete(e));return i=a,a}function c(e){if(!(e instanceof Element))return null;let t=e.closest(`.wb-element`),n=t?.dataset.elementId,r=ze.find(e=>e===t?.dataset.elementKind);return!n||!r?null:{id:n,kind:r}}function l(e){a=e;for(let[e,t]of r)o(e,t.node)}function u(){for(let e of r.values())e.node.remove();r.clear();let e=M(`g`);n.replaceWith(e),n=e,i=null}return{render:s,layout:()=>i,elementFromTarget:c,nodeOf:e=>r.get(e)?.node??null,setSelection:l,clear:u}}var We=`http://www.w3.org/2000/svg`,Ge=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Ke=`Pick a board above.`,F=null,I=null,L=null,R=null,qe=!0,z=null,B=i(`action-status wb-status`),V=i(`action-status wb-status`);function H(e){let{dialog:n,close:r,actions:i,btnCancel:a}=o({title:e.title}),s=t(`input`,`dialog-input`);s.type=`text`,s.placeholder=e.placeholder,s.maxLength=e.maxLength,s.value=e.initialValue??``,s.autocomplete=`off`,s.setAttribute(`aria-label`,e.label);let c=t(`div`,`dialog-error`);c.setAttribute(`role`,`alert`);let l=e.choices?t(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let n of e.choices.options){let e=t(`option`,null,n.text);e.value=n.value,l.append(e)}}let u=t(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,i.append(u),n.append(t(`label`,`dialog-label`,e.label),s,...l?[l]:[],c,i);async function d(){let t=s.value.trim();if(!t){c.textContent=`${e.label} is empty.`;return}u.disabled=!0;let n=await e.onSubmit(t,l?.value??null);u.disabled=!1,n?c.textContent=n:r()}a.addEventListener(`click`,r),u.addEventListener(`click`,()=>void d()),s.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>s.focus())}function U(){return F?m(F):null}function W(){return s().find(e=>e.id===F)??null}async function Je(e){if(!F||e.length===0)return!1;let t=await g(F,e);return t.ok?(B.clear(),!0):(B.show(`error`,t.error),!1)}async function G(e){if(!F)return`No board is open.`;let t=await g(F,e);return t.ok?null:t.error}function K(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=U();return[...R?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!I)return;let e=U(),t=q(`box`).length,n=R?.selectedIds().size??0;I.buttons.box.disabled=!e,I.buttons.wire.disabled=t!==2,I.buttons.note.disabled=t!==1,I.buttons.frame.disabled=t===0,I.buttons.fit.disabled=!e,I.buttons.remove.disabled=!e,I.toolbar.dataset.selectedCount=String(n)}function Y(){if(!I)return;let e=s();F&&!e.some(e=>e.id===F)&&(F=null),!F&&e[0]&&Q(e[0].id),I.list.replaceChildren(...e.map(e=>{let n=t(`button`,`wb-board-tab`,e.title);return n.type=`button`,n.setAttribute(`aria-pressed`,String(e.id===F)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Q(e.id)),n})),Ye()}function Ye(){if(!I)return;let e=W(),n=s().length>0;I.boardHead.hidden=!e,I.canvas.hidden=!e,I.empty.hidden=!!e,I.empty.textContent=n?Ke:Ge,e&&(I.boardTitle.textContent=e.title,I.boardMeta.textContent=`v${e.version}`,I.presence.replaceChildren(...e.connectedSessionIds.map(e=>t(`span`,`wb-presence-pill`,K(e)))),e.connectedSessionIds.length===0&&I.presence.append(t(`span`,`wb-presence-none`,`no sessions connected`)),J(),X())}function Xe(e,t){let n=K(t);if(!e?.connectedSessionIds.includes(t))return`${n} is not connected to this board`;let r=e.queuedBySessionId[t]??0;return r===0?`${n} has read every change`:`${r} board ${r===1?`edit`:`edits`} queued for ${n}`}function X(){if(!I||!z)return;let e=W();I.dockQueued.textContent=Xe(e,z),I.sendToAgent.disabled=!e?.connectedSessionIds.includes(z)}async function Ze(){if(!I||!F||!z)return;I.sendToAgent.disabled=!0,V.show(`busy`,`sending`);let e=await p(F,z);X(),e.ok?V.show(`ok`,`sent; the agent reads the board when it is ready`):V.show(`error`,e.error)}function Z(){if(!L)return;let e=U();e?(L.render(e),R?.pruneSelection(e),qe&&=(R?.fit(),!1),J()):L.clear()}function Q(e){F!==e&&(F=e,qe=!0,R?.clearSelection(),R?.closeTitleInput(),L?.clear(),B.clear(),Y(),c(e).then(Z))}function Qe(){let t=U();if(!t)return;let n=q(`box`)[0],r=t.columns.map(e=>({value:e.id,text:e.title||e.id})),i=n?.column;i&&r.sort((e,t)=>Number(t.value===i)-Number(e.value===i)),H({title:`Add a box`,label:`Box title`,placeholder:`parse the feed`,maxLength:e.title,confirmLabel:`Add box`,choices:r.length>1?{label:`Column`,options:r}:void 0,onSubmit:(e,t)=>G([{op:`add`,element:{kind:`box`,id:x(`box`),title:e,column:t??r[0]?.value??`main`,lines:[],lane:null,ghost:!1,order:0,at:null}}])})}function $e(t){H({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>G([{op:`add`,element:{kind:`note`,id:x(`note`),on:t,text:e,author:``,resolvedBy:null}}])})}function et(){let[e,t]=q(`box`);e&&t&&(R?.clearSelection(),Je([{op:`add`,element:{kind:`wire`,id:x(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function tt(){let t=q(`box`).map(e=>e.id);t.length!==0&&H({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await G([{op:`add`,element:{kind:`frame`,id:x(`frame`),title:e,contains:t}}]);return n||R?.clearSelection(),n}})}function nt(){let e=W();if(!e)return;let t=e.connectedSessionIds.map(K),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;a({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{_(e.id).then(e=>{e.ok||B.show(`error`,e.error)})}})}function rt(){H({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await d(e);return t.ok?(Q(t.boardId),null):t.error}})}function $(e,n,r=``){let i=t(`button`,`wb-button ${r}`.trim(),e);return i.type=`button`,i.addEventListener(`click`,n),i}function it(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,rt));let i=t(`div`,`wb-board-head`),a=t(`div`,`wb-title-row`),o=t(`h2`,`wb-board-title`),s=t(`span`,`wb-board-meta`),c=t(`div`,`wb-presence`);a.append(o,s,c);let l=t(`div`,`wb-toolbar`),u={box:$(`box`,Qe),wire:$(`wire`,et),note:$(`note`,()=>{let[e]=q(`box`);e&&$e(e.id)}),frame:$(`frame`,tt),fit:$(`fit`,()=>R?.fit()),remove:$(`delete board`,nt,`wb-button-danger`)};u.fit.dataset.phoneVisible=``,l.append(u.box,u.wire,u.note,u.frame,u.fit,u.remove,B.element),i.append(a,l);let d=t(`div`,`wb-canvas`),p=document.createElementNS(We,`svg`);p.setAttribute(`class`,`wb-svg`),p.setAttribute(`role`,`img`),p.setAttribute(`aria-label`,`Whiteboard`),p.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),d.append(p);let m=t(`p`,`wb-empty`,Ge),g=t(`div`,`wb-dock`);g.hidden=!0;let _=t(`span`,`wb-dock-queued`),v=$(`send to agent`,()=>void Ze()),y=t(`div`,`wb-dock-bar`);y.append(_,v,V.element),g.append(y),e.replaceChildren(n,i,d,m,g),I={list:r,boardHead:i,boardTitle:o,boardMeta:s,presence:c,toolbar:l,canvas:d,empty:m,dock:g,dockQueued:_,sendToAgent:v,buttons:u};let b=Ue(p);L=b,R=ie({svg:p,canvas:d,renderer:b,currentBoard:U,sendOps:Je,onSelectionChange:J,onPhoneTapBox:$e}),f(Y),h(e=>{e===F&&Z()}),Y()}function at(){return document.documentElement.dataset.layout===`phone`}function ot(){z&&y()===z&&l(),z=null,I&&(I.dock.hidden=!0)}function st(e){if(!I||at())return;let t=r(e);t&&(z=e,I.dock.hidden=!1,V.clear(),X(),v(t,e,I.dock,{className:`wb-docked-card`}))}function ct(){let e=u();e&&(Q(e.boardId),e.dockSessionId&&st(e.dockSessionId)),Y(),F&&c(F).then(Z)}var lt={mount:it,refresh:ct,deactivate:ot};export{lt as view};
1
+ import{Et as e}from"./updates-view-core-Cm8PSxnG.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-ClY5hV4m.js";import{i}from"./action-status-RKlYXcNZ.js";import{a,n as o}from"./modal-BRwbyxA2.js";import{ai as s,bi as c,ci as l,ei as u,ii as d,li as f,ni as p,oi as m,ri as h,si as g,ti as _,xi as v,yi as y}from"./index-BEipwPAs.js";var b=4,ee=200,te=2e4,ne=1.1,re=[`wire`,`note`,`frame`,`box`];function x(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function S(){return document.documentElement.dataset.layout===`phone`}function ie(e){let{svg:n,canvas:r,renderer:i}=e,a=new Map,o=new Set,s={x:0,y:0,width:1e3,height:600},c=null,l=null;function u(){n.setAttribute(`viewBox`,`${s.x} ${s.y} ${s.width} ${s.height}`)}function d(){let e=i.layout();if(!e)return;let{bounds:t}=e,r=n.clientWidth,a=n.clientHeight;if(r===0||a===0){s={...t},u();return}let o=Math.max(1,t.width/r,t.height/a);s={x:t.x,y:t.y,width:r*o,height:a*o},u()}function f(e,t){let r=n.getScreenCTM();if(!r)return{x:e,y:t};let i=new DOMPoint(e,t).matrixTransform(r.inverse());return{x:i.x,y:i.y}}function p(){let e=n.clientWidth||1,t=n.clientHeight||1;return Math.max(s.width/e,s.height/t)}function m(e,t){let n=Math.min(te,Math.max(ee,s.width*t)),r=n/s.width;s={x:e.x-(e.x-s.x)*r,y:e.y-(e.y-s.y)*r,width:n,height:s.height*r},u()}function h(e,t){let n=p();s={...s,x:s.x-e*n,y:s.y-t*n},u()}function g(t){o=t,i.setSelection(o),e.onSelectionChange(o)}function _(e,t){if(!t){g(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),g(n)}function v(e){let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&g(t)}function y(e){let t=i.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function x(){let[e,t]=[...a.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function ie(){c={kind:`pinch`,distance:x(),viewWidth:s.width}}function C(e){if(e.button!==0||l)return;if(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),n.setPointerCapture(e.pointerId),a.size===2){ie();return}let t=i.elementFromTarget(e.target),r=t?.kind===`box`&&!S()?y(t.id):null;if(t&&r){c={kind:`drag`,pointerId:e.pointerId,boxId:t.id,origin:f(e.clientX,e.clientY),start:r,hasMoved:!1,isAdditive:e.shiftKey};return}if(t&&!S()){_(t.id,e.shiftKey);return}let o=t?.kind===`box`?t.id:null;c={kind:`pan`,pointerId:e.pointerId,lastClient:{x:e.clientX,y:e.clientY},hasMoved:!1,tappedBoxId:o}}function w(e,t){let n=f(t.clientX,t.clientY),r=n.x-e.origin.x,a=n.y-e.origin.y;!e.hasMoved&&Math.hypot(r,a)<b*p()||(e.hasMoved=!0,i.nodeOf(e.boxId)?.setAttribute(`transform`,`translate(${r} ${a})`))}function ae(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<b||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},h(n,r))}function oe(e){let t=x();if(t<=0||e.distance<=0)return;let n=[...a.values()];m(f(n.reduce((e,t)=>e+t.x,0)/n.length,n.reduce((e,t)=>e+t.y,0)/n.length),e.viewWidth*(e.distance/t)/s.width)}function se(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?oe(c):c?.kind===`drag`&&c.pointerId===e.pointerId?w(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&ae(c,e))}async function ce(t,n){if(!t.hasMoved){_(t.boxId,t.isAdditive);return}let r=f(n.clientX,n.clientY),a={x:Math.round(t.start.x+r.x-t.origin.x),y:Math.round(t.start.y+r.y-t.origin.y)};await e.sendOps([{op:`set`,id:t.boxId,fields:{at:a}}])||i.nodeOf(t.boxId)?.removeAttribute(`transform`)}function le(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?ce(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&S()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||g(new Set)))}function ue(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function T(e){e.preventDefault(),e.ctrlKey||e.metaKey?m(f(e.clientX,e.clientY),e.deltaY>0?ne:1/ne):h(-e.deltaX,-e.deltaY)}function E(){let e=l;l=null,e?.remove()}function de(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;E();let c=r.getBoundingClientRect(),u=s.getBoundingClientRect(),d=t(`input`,`wb-title-input`);d.type=`text`,d.value=o.title,d.maxLength=80,d.setAttribute(`aria-label`,`Box title`),d.style.left=`${u.left-c.left}px`,d.style.top=`${u.top-c.top}px`,d.style.width=`${Math.max(160,u.width)}px`,l=d,r.append(d),d.addEventListener(`keydown`,t=>{if(t.key===`Escape`){t.preventDefault(),E(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();E(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,E),d.focus(),d.select()}function fe(e){if(S())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&de(t.id)}function pe(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=re.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));g(new Set),e.sendOps(r)}function me(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),pe()):e.key===`Escape`&&g(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,C),n.addEventListener(`pointermove`,se),n.addEventListener(`pointerup`,le),n.addEventListener(`pointercancel`,ue),n.addEventListener(`wheel`,T,{passive:!1}),n.addEventListener(`dblclick`,fe),n.addEventListener(`keydown`,me),{fit:d,selectedIds:()=>o,clearSelection:()=>g(new Set),pruneSelection:v,closeTitleInput:E}}var C=40,w=220,ae=90,oe=30,se=20,ce=18,le=20,ue=26,T=18,E=26,de=170,fe=21,pe=17,me=10,D=22,he=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function O(e,t){let n=e.split(/\s+/).filter(Boolean),r=[],i=``;for(let e of n){let n=e.match(RegExp(`.{1,${t}}`,`g`))??[e];for(let e of n){let n=i?`${i} ${e}`:e;n.length<=t?i=n:(r.push(i),i=e)}}return i&&r.push(i),r.length>0?r:[``]}function ge(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:he[n.color]}:null}function _e(e,t){let n=O(t.title,le),r=t.lines.flatMap(e=>O(e.text,ue-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ge(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*se+r.length*ce+(i?26:0)}}function k(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function A(e){return C+e*310}function ve(e){let t=new Map,n=new Map,r=k(e,`box`).map((e,t)=>({box:e,index:t})).sort((e,t)=>e.box.order-t.box.order||e.index-t.index);for(let{box:i}of r){let r=Math.max(0,e.columns.findIndex(e=>e.id===i.column)),a=_e(e,i),o=n.get(i.column)??84,s=i.at??{x:A(r),y:o};i.at||n.set(i.column,o+a.height+oe),t.set(i.id,{kind:`box`,id:i.id,x:s.x,y:s.y,width:w,height:a.height,titleLines:a.titleLines,bodyLines:a.bodyLines,lane:a.lane,isGhost:i.ghost})}return t}function ye(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}function be(e,t){return k(e,`frame`).flatMap(e=>{let n=ye(e.contains.flatMap(e=>t.get(e)??[]));return n?[{kind:`frame`,id:e.id,title:e.title,x:n.x-T,y:n.y-T-E,width:n.width+36,height:n.height+36+E}]:[]})}function xe(e,t){let n=e.x+e.width/2,r=t.x+t.width/2;if(Math.abs(r-n)>e.width/2){let i=r>n,a={x:i?e.x+e.width:e.x,y:e.y+Math.min(e.height/2,40)},o={x:i?t.x:t.x+t.width,y:t.y+Math.min(t.height/2,40)},s=(o.x-a.x)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x+s} ${a.y}, ${o.x-s} ${o.y}, ${o.x} ${o.y}`}}let i=t.y>e.y,a={x:n,y:i?e.y+e.height:e.y},o={x:r,y:i?t.y:t.y+t.height},s=(o.y-a.y)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x} ${a.y+s}, ${o.x} ${o.y-s}, ${o.x} ${o.y}`}}function Se(e,t){return k(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=xe(n,r);return[{kind:`wire`,id:e.id,path:i.path,start:i.start,end:i.end,label:e.label,labelAt:{x:(i.start.x+i.end.x)/2,y:(i.start.y+i.end.y)/2-6},isDashed:e.dashed,tone:e.tone,strokeHex:e.tone===`lane`?n.lane?.hex??null:null}]})}function Ce(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function we(e,t){let n=new Map;return k(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let i=O(e.text,fe),a=24+(i.length+1)*pe,o=n.get(e.on)??r.y-8;return n.set(e.on,o+a+me),[{kind:`note`,id:e.id,x:r.x+r.width-24,y:o,width:de,height:a,lines:i,byline:Ce(e),isResolved:e.resolvedBy!==null}]})}function Te(e,t){let n=e.flatMap(e=>e.kind===`wire`?[]:[e]),r=A(Math.max(1,t))-ae,i=ye([...n,{x:0,y:0,width:r,height:84}]);return i?{x:Math.min(0,i.x-C),y:Math.min(0,i.y-C),width:i.width+80,height:i.height+80}:{x:0,y:0,width:r+C,height:80}}function Ee(e){let t=ve(e),n=[...be(e,t),...Se(e,t),...t.values(),...we(e,t)],r=Te(n,e.columns.length),i=r.y+r.height,a=e.lanes.map((e,t)=>({label:e.label||e.id,hex:he[e.color],x:C,y:i+t*D})),o=i+a.length*D+(a.length>0?12:0),s=e.caption?{text:e.caption,x:C,y:o}:null,c=a.length*D+(s?30:0)+(a.length>0?12:0);return{columns:e.columns.map((e,t)=>({id:e.id,title:e.title,x:A(t),width:w})),elements:n,legend:a,caption:s,bounds:{...r,height:r.height+c}}}function De(e){return JSON.stringify(e)}var Oe=`http://www.w3.org/2000/svg`,j=12,ke=26,Ae=20,je=18,Me=17,Ne=14;function M(e,t={},n=``){let r=document.createElementNS(Oe,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return n&&r.setAttribute(`class`,n),r}function N(e,t,n,r){let i=M(`text`,{x:t,y:n},r);return i.textContent=e,i}function P(e,t){let n=M(`g`,{},`wb-element ${t}`);return n.dataset.elementId=e.id,n.dataset.elementKind=e.kind,n}function Pe(e){let t=P(e,e.isGhost?`wb-box wb-ghost`:`wb-box`),n=M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:8},`wb-box-outline`);e.lane&&(n.style.stroke=e.lane.hex),t.append(n),e.titleLines.forEach((n,r)=>{t.append(N(n,e.x+j,e.y+ke+r*Ae,`wb-box-title`))});let r=e.y+ke+e.titleLines.length*Ae;if(e.bodyLines.forEach((n,i)=>{let a=e.x+j+(n.muted?Ne:0);t.append(N(n.text,a,r+i*je,n.muted?`wb-box-line wb-muted`:`wb-box-line`))}),!e.lane)return t;let i=e.y+e.height-28,a=Math.min(e.width-24,16+e.lane.label.length*8),o=M(`rect`,{x:e.x+j,y:i,width:a,height:18,rx:9},`wb-lane-pill`);o.style.stroke=e.lane.hex;let s=N(e.lane.label,e.x+j+8,i+13,`wb-lane-pill-text`);return s.style.fill=e.lane.hex,t.append(o,s),t}function Fe(e){let t=P(e,`wb-frame`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12},`wb-frame-outline`),N(e.title,e.x+14,e.y+18,`wb-frame-title`)),t}function Ie(e){let t=P(e,`wb-wire wb-tone-${e.tone}`),n=M(`path`,{d:e.path},`wb-wire-hit`),r=M(`path`,{d:e.path,"marker-end":`url(#wb-arrow)`},e.isDashed?`wb-wire-line wb-dashed`:`wb-wire-line`);return e.strokeHex&&(r.style.stroke=e.strokeHex),t.append(n,r,M(`circle`,{cx:e.start.x,cy:e.start.y,r:3},`wb-wire-dot`)),e.label&&t.append(N(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),t}function Le(e){let t=P(e,e.isResolved?`wb-note wb-resolved`:`wb-note`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:4},`wb-note-card`)),e.lines.forEach((n,r)=>{t.append(N(n,e.x+10,e.y+22+r*Me,`wb-note-text`))}),e.byline&&t.append(N(e.byline,e.x+10,e.y+22+e.lines.length*Me,`wb-note-byline`)),t}var Re={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},ze=[`box`,`frame`,`wire`,`note`];function Be(e){switch(e.kind){case`box`:return Pe(e);case`frame`:return Fe(e);case`wire`:return Ie(e);case`note`:return Le(e)}}function Ve(e){let t=M(`g`,{},`wb-chrome`);for(let n of e.columns)n.title&&t.append(N(n.title,n.x,56,`wb-column-title`),M(`line`,{x1:n.x,y1:66,x2:n.x+n.width,y2:66},`wb-column-rule`));for(let n of e.legend){let e=M(`rect`,{x:n.x,y:n.y,width:14,height:14,rx:3},`wb-legend-swatch`);e.style.fill=n.hex,t.append(e,N(n.label,n.x+22,n.y+12,`wb-legend-text`))}return e.caption&&t.append(N(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),t}function He(){let e=M(`defs`),t=M(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`});return t.append(M(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})),e.append(t),e}function Ue(e){let t={frames:M(`g`,{},`wb-layer`),wires:M(`g`,{},`wb-layer`),boxes:M(`g`,{},`wb-layer`),notes:M(`g`,{},`wb-layer`)},n=M(`g`);e.replaceChildren(He(),n,t.frames,t.wires,t.boxes,t.notes);let r=new Map,i=null,a=new Set;function o(e,t){t.classList.toggle(`is-selected`,a.has(e))}function s(e){let a=Ee(e),s=Ve(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=De(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Be(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[Re[e.kind]].append(a),r.set(e.id,{signature:n,node:a})}for(let[e,t]of r)c.has(e)||(t.node.remove(),r.delete(e));return i=a,a}function c(e){if(!(e instanceof Element))return null;let t=e.closest(`.wb-element`),n=t?.dataset.elementId,r=ze.find(e=>e===t?.dataset.elementKind);return!n||!r?null:{id:n,kind:r}}function l(e){a=e;for(let[e,t]of r)o(e,t.node)}function u(){for(let e of r.values())e.node.remove();r.clear();let e=M(`g`);n.replaceWith(e),n=e,i=null}return{render:s,layout:()=>i,elementFromTarget:c,nodeOf:e=>r.get(e)?.node??null,setSelection:l,clear:u}}var We=`http://www.w3.org/2000/svg`,Ge=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Ke=`Pick a board above.`,F=null,I=null,L=null,R=null,qe=!0,z=null,B=i(`action-status wb-status`),V=i(`action-status wb-status`);function H(e){let{dialog:n,close:r,actions:i,btnCancel:a}=o({title:e.title}),s=t(`input`,`dialog-input`);s.type=`text`,s.placeholder=e.placeholder,s.maxLength=e.maxLength,s.value=e.initialValue??``,s.autocomplete=`off`,s.setAttribute(`aria-label`,e.label);let c=t(`div`,`dialog-error`);c.setAttribute(`role`,`alert`);let l=e.choices?t(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let n of e.choices.options){let e=t(`option`,null,n.text);e.value=n.value,l.append(e)}}let u=t(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,i.append(u),n.append(t(`label`,`dialog-label`,e.label),s,...l?[l]:[],c,i);async function d(){let t=s.value.trim();if(!t){c.textContent=`${e.label} is empty.`;return}u.disabled=!0;let n=await e.onSubmit(t,l?.value??null);u.disabled=!1,n?c.textContent=n:r()}a.addEventListener(`click`,r),u.addEventListener(`click`,()=>void d()),s.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>s.focus())}function U(){return F?g(F):null}function W(){return u().find(e=>e.id===F)??null}async function Je(e){if(!F||e.length===0)return!1;let t=await l(F,e);return t.ok?(B.clear(),!0):(B.show(`error`,t.error),!1)}async function G(e){if(!F)return`No board is open.`;let t=await l(F,e);return t.ok?null:t.error}function K(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=U();return[...R?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!I)return;let e=U(),t=q(`box`).length,n=R?.selectedIds().size??0;I.buttons.box.disabled=!e,I.buttons.wire.disabled=t!==2,I.buttons.note.disabled=t!==1,I.buttons.frame.disabled=t===0,I.buttons.fit.disabled=!e,I.buttons.remove.disabled=!e,I.toolbar.dataset.selectedCount=String(n)}function Y(){if(!I)return;let e=u();F&&!e.some(e=>e.id===F)&&(F=null),!F&&e[0]&&Q(e[0].id),I.list.replaceChildren(...e.map(e=>{let n=t(`button`,`wb-board-tab`,e.title);return n.type=`button`,n.setAttribute(`aria-pressed`,String(e.id===F)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Q(e.id)),n})),Ye()}function Ye(){if(!I)return;let e=W(),n=u().length>0;I.boardHead.hidden=!e,I.canvas.hidden=!e,I.empty.hidden=!!e,I.empty.textContent=n?Ke:Ge,e&&(I.boardTitle.textContent=e.title,I.boardMeta.textContent=`v${e.version}`,I.presence.replaceChildren(...e.connectedSessionIds.map(e=>t(`span`,`wb-presence-pill`,K(e)))),e.connectedSessionIds.length===0&&I.presence.append(t(`span`,`wb-presence-none`,`no sessions connected`)),J(),X())}function Xe(e,t){let n=K(t);if(!e?.connectedSessionIds.includes(t))return`${n} is not connected to this board`;let r=e.queuedBySessionId[t]??0;return r===0?`${n} has read every change`:`${r} board ${r===1?`edit`:`edits`} queued for ${n}`}function X(){if(!I||!z)return;let e=W();I.dockQueued.textContent=Xe(e,z),I.sendToAgent.disabled=!e?.connectedSessionIds.includes(z)}async function Ze(){if(!I||!F||!z)return;I.sendToAgent.disabled=!0,V.show(`busy`,`sending`);let e=await h(F,z);X(),e.ok?V.show(`ok`,`sent; the agent reads the board when it is ready`):V.show(`error`,e.error)}function Z(){if(!L)return;let e=U();e?(L.render(e),R?.pruneSelection(e),qe&&=(R?.fit(),!1),J()):L.clear()}function Q(e){F!==e&&(F=e,qe=!0,R?.clearSelection(),R?.closeTitleInput(),L?.clear(),B.clear(),Y(),m(e).then(Z))}function Qe(){let t=U();if(!t)return;let n=q(`box`)[0],r=t.columns.map(e=>({value:e.id,text:e.title||e.id})),i=n?.column;i&&r.sort((e,t)=>Number(t.value===i)-Number(e.value===i)),H({title:`Add a box`,label:`Box title`,placeholder:`parse the feed`,maxLength:e.title,confirmLabel:`Add box`,choices:r.length>1?{label:`Column`,options:r}:void 0,onSubmit:(e,t)=>G([{op:`add`,element:{kind:`box`,id:x(`box`),title:e,column:t??r[0]?.value??`main`,lines:[],lane:null,ghost:!1,order:0,at:null}}])})}function $e(t){H({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>G([{op:`add`,element:{kind:`note`,id:x(`note`),on:t,text:e,author:``,resolvedBy:null}}])})}function et(){let[e,t]=q(`box`);e&&t&&(R?.clearSelection(),Je([{op:`add`,element:{kind:`wire`,id:x(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function tt(){let t=q(`box`).map(e=>e.id);t.length!==0&&H({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await G([{op:`add`,element:{kind:`frame`,id:x(`frame`),title:e,contains:t}}]);return n||R?.clearSelection(),n}})}function nt(){let e=W();if(!e)return;let t=e.connectedSessionIds.map(K),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;a({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{p(e.id).then(e=>{e.ok||B.show(`error`,e.error)})}})}function rt(){H({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await _(e);return t.ok?(Q(t.boardId),null):t.error}})}function $(e,n,r=``){let i=t(`button`,`wb-button ${r}`.trim(),e);return i.type=`button`,i.addEventListener(`click`,n),i}function it(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,rt));let i=t(`div`,`wb-board-head`),a=t(`div`,`wb-title-row`),o=t(`h2`,`wb-board-title`),c=t(`span`,`wb-board-meta`),l=t(`div`,`wb-presence`);a.append(o,c,l);let u=t(`div`,`wb-toolbar`),f={box:$(`box`,Qe),wire:$(`wire`,et),note:$(`note`,()=>{let[e]=q(`box`);e&&$e(e.id)}),frame:$(`frame`,tt),fit:$(`fit`,()=>R?.fit()),remove:$(`delete board`,nt,`wb-button-danger`)};f.fit.dataset.phoneVisible=``,u.append(f.box,f.wire,f.note,f.frame,f.fit,f.remove,B.element),i.append(a,u);let p=t(`div`,`wb-canvas`),m=document.createElementNS(We,`svg`);m.setAttribute(`class`,`wb-svg`),m.setAttribute(`role`,`img`),m.setAttribute(`aria-label`,`Whiteboard`),m.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),p.append(m);let h=t(`p`,`wb-empty`,Ge),g=t(`div`,`wb-dock`);g.hidden=!0;let _=t(`span`,`wb-dock-queued`),v=$(`send to agent`,()=>void Ze()),y=t(`div`,`wb-dock-bar`);y.append(_,v,V.element),g.append(y),e.replaceChildren(n,i,p,h,g),I={list:r,boardHead:i,boardTitle:o,boardMeta:c,presence:l,toolbar:u,canvas:p,empty:h,dock:g,dockQueued:_,sendToAgent:v,buttons:f};let b=Ue(m);L=b,R=ie({svg:m,canvas:p,renderer:b,currentBoard:U,sendOps:Je,onSelectionChange:J,onPhoneTapBox:$e}),s(Y),d(e=>{e===F&&Z()}),Y()}function at(){return document.documentElement.dataset.layout===`phone`}function ot(){z&&c()===z&&v(),z=null,I&&(I.dock.hidden=!0)}function st(e){if(!I||at())return;let t=r(e);t&&(z=e,I.dock.hidden=!1,V.clear(),X(),y(t,e,I.dock,{className:`wb-docked-card`}))}function ct(){let e=f();e&&(Q(e.boardId),e.dockSessionId&&st(e.dockSessionId)),Y(),F&&m(F).then(Z)}var lt={mount:it,refresh:ct,deactivate:ot};export{lt as view};
@@ -1 +1 @@
1
- import{St as e}from"./updates-view-core-3KY1QJ76.js";import{E as t}from"./dom-helpers-I_SDCPvs.js";var n=new Map(Object.entries({WAITING:`now`,COMPLETE:`later`,FAILED:`resting`,IDLE:`resting`,RUNNING:`resting`,STARTING:`resting`,INITIALIZING:`resting`,DORMANT:`resting`,DONE:`resting`}));function r(e){return(typeof e.state==`string`?n.get(e.state):void 0)??`resting`}function i(e,n){return[...e].map(([e,r])=>{let i=r.currentState||t.DORMANT;return{id:e,ui:r,name:n(r),isDormant:i===t.DORMANT,state:i,unseenOutcome:r.unseenOutcome??null,ownerId:r.ownerId??null}})}function a(e){let t=new Set(e.map(({id:e})=>e)),n=e=>e.ownerId&&t.has(e.ownerId)?e.ownerId:null,r=new Map;for(let t of e){let e=n(t);e&&r.set(e,[...r.get(e)??[],t])}return e.flatMap(e=>n(e)?[]:[e,...r.get(e.id)??[]])}function o(e){return a([...e].sort((e,t)=>Number(e.isDormant===!0)-Number(t.isDormant===!0)))}function s({ownerName:e,ownedCount:t}){return e===null?t===1?`Owns 1 session`:t>1?`Owns ${t} sessions`:null:`Owned by ${e}`}function c(e,t,n){if(!e.length)return null;let r=n<0?-1:1,i=t==null?-1:e.indexOf(t);return e[((i===-1?r===1?-1:0:i)+r+e.length)%e.length]}function l({state:n,unseenOutcome:r}){if(n===t.WAITING)return`waiting`;let i=e.safeParse(r);return i.success?i.data:null}function u(e={}){return l(e)!==null}var d=new Map([[`failed`,0],[`waiting`,1],[`finished`,2]]);function f(e){let t=l(e);return t===null?void 0:d.get(t)}function p(e){return e.filter(e=>f(e)!==void 0).sort((e,t)=>(f(e)??0)-(f(t)??0)).map(({id:e})=>e)}function m(e,t){let n=new Map(e.map(e=>[e.id,e]));return p(e).flatMap(e=>{let r=n.get(e),i=r?l(r):null;return!r||i===null||e===t?[]:[{id:e,kind:i,name:r.name??``}]})}var h={headTile:32,tile:26,tileGap:4,overflowSlot:40};function g(e,t){if(t===0)return 0;let{headTile:n,tile:r,tileGap:i,overflowSlot:a}=h,o=r+i;if(n+(t-1)*o<=e)return t;let s=e-a-i-n,c=Math.floor(s/o);return Math.max(1,Math.min(t-1,1+c))}var _={waiting:`waitingCount`,failed:`failedCount`,finished:`finishedCount`};function v(e,t,n){let r=l(t||{});r!==null&&(e[_[r]]+=n)}function y(e){let t={waitingCount:0,finishedCount:0,failedCount:0};for(let n of e||[])v(t,n,1);return t}function b(){return{counts:{waitingCount:0,finishedCount:0,failedCount:0},ownedCountByOwnerId:new Map}}function x(e,t,n){if(v(e.counts,t,n),t.ownerId===null)return;let r=(e.ownedCountByOwnerId.get(t.ownerId)??0)+n;r>0?e.ownedCountByOwnerId.set(t.ownerId,r):e.ownedCountByOwnerId.delete(t.ownerId)}function S(e,t){x(e,t,1)}function C(e,t){x(e,t,-1)}function w({waitingCount:e,finishedCount:t,failedCount:n}){return e+n+t}function T({waitingCount:e,failedCount:t}){return e+t}function E({waitingCount:e,finishedCount:t,failedCount:n}){let r=[];return n>0&&r.push(`${n} FAILED`),e===1&&r.push(`1 NEEDS YOU`),e>1&&r.push(`${e} NEED YOU`),t>0&&r.push(`${t} FINISHED`),r.length===0?`ALL CLEAR`:r.join(`, `)}var D=new Map([[`hand`,2]]),O=1;function k(e){return e?typeof e==`string`&&D.get(e)||O:0}function A(e){let t=!1,n=0;for(let r of e||[]){let e=k(r);e<=n||(t=typeof r!=`string`||r,n=e)}return t}var j=new Map,M=b();function N(e){return e.card?.dataset.session||e.nameEl?.textContent||``}function P(e){return typeof e==`string`?e:String(e)}function F(e){return typeof e==`string`?j.get(e):void 0}var I=document.getElementById(`sessions-container`);export{T as S,c as _,N as a,S as b,E as c,s as d,g as f,o as g,m as h,P as i,i as l,u as m,I as n,j as o,w as p,F as r,h as s,M as t,y as u,A as v,C as x,r as y};
1
+ import{St as e}from"./updates-view-core-Cm8PSxnG.js";import{E as t}from"./dom-helpers-I_SDCPvs.js";var n=new Map(Object.entries({WAITING:`now`,COMPLETE:`later`,FAILED:`resting`,IDLE:`resting`,RUNNING:`resting`,STARTING:`resting`,INITIALIZING:`resting`,DORMANT:`resting`,DONE:`resting`}));function r(e){return(typeof e.state==`string`?n.get(e.state):void 0)??`resting`}function i(e,n){return[...e].map(([e,r])=>{let i=r.currentState||t.DORMANT;return{id:e,ui:r,name:n(r),isDormant:i===t.DORMANT,state:i,unseenOutcome:r.unseenOutcome??null,ownerId:r.ownerId??null}})}function a(e){let t=new Set(e.map(({id:e})=>e)),n=e=>e.ownerId&&t.has(e.ownerId)?e.ownerId:null,r=new Map;for(let t of e){let e=n(t);e&&r.set(e,[...r.get(e)??[],t])}return e.flatMap(e=>n(e)?[]:[e,...r.get(e.id)??[]])}function o(e){return a([...e].sort((e,t)=>Number(e.isDormant===!0)-Number(t.isDormant===!0)))}function s({ownerName:e,ownedCount:t}){return e===null?t===1?`Owns 1 session`:t>1?`Owns ${t} sessions`:null:`Owned by ${e}`}function c(e,t,n){if(!e.length)return null;let r=n<0?-1:1,i=t==null?-1:e.indexOf(t);return e[((i===-1?r===1?-1:0:i)+r+e.length)%e.length]}function l({state:n,unseenOutcome:r}){if(n===t.WAITING)return`waiting`;let i=e.safeParse(r);return i.success?i.data:null}function u(e={}){return l(e)!==null}var d=new Map([[`failed`,0],[`waiting`,1],[`finished`,2]]);function f(e){let t=l(e);return t===null?void 0:d.get(t)}function p(e){return e.filter(e=>f(e)!==void 0).sort((e,t)=>(f(e)??0)-(f(t)??0)).map(({id:e})=>e)}function m(e,t){let n=new Map(e.map(e=>[e.id,e]));return p(e).flatMap(e=>{let r=n.get(e),i=r?l(r):null;return!r||i===null||e===t?[]:[{id:e,kind:i,name:r.name??``}]})}var h={headTile:32,tile:26,tileGap:4,overflowSlot:40};function g(e,t){if(t===0)return 0;let{headTile:n,tile:r,tileGap:i,overflowSlot:a}=h,o=r+i;if(n+(t-1)*o<=e)return t;let s=e-a-i-n,c=Math.floor(s/o);return Math.max(1,Math.min(t-1,1+c))}var _={waiting:`waitingCount`,failed:`failedCount`,finished:`finishedCount`};function v(e,t,n){let r=l(t||{});r!==null&&(e[_[r]]+=n)}function y(e){let t={waitingCount:0,finishedCount:0,failedCount:0};for(let n of e||[])v(t,n,1);return t}function b(){return{counts:{waitingCount:0,finishedCount:0,failedCount:0},ownedCountByOwnerId:new Map}}function x(e,t,n){if(v(e.counts,t,n),t.ownerId===null)return;let r=(e.ownedCountByOwnerId.get(t.ownerId)??0)+n;r>0?e.ownedCountByOwnerId.set(t.ownerId,r):e.ownedCountByOwnerId.delete(t.ownerId)}function S(e,t){x(e,t,1)}function C(e,t){x(e,t,-1)}function w({waitingCount:e,finishedCount:t,failedCount:n}){return e+n+t}function T({waitingCount:e,failedCount:t}){return e+t}function E({waitingCount:e,finishedCount:t,failedCount:n}){let r=[];return n>0&&r.push(`${n} FAILED`),e===1&&r.push(`1 NEEDS YOU`),e>1&&r.push(`${e} NEED YOU`),t>0&&r.push(`${t} FINISHED`),r.length===0?`ALL CLEAR`:r.join(`, `)}var D=new Map([[`hand`,2]]),O=1;function k(e){return e?typeof e==`string`&&D.get(e)||O:0}function A(e){let t=!1,n=0;for(let r of e||[]){let e=k(r);e<=n||(t=typeof r!=`string`||r,n=e)}return t}var j=new Map,M=b();function N(e){return e.card?.dataset.session||e.nameEl?.textContent||``}function P(e){return typeof e==`string`?e:String(e)}function F(e){return typeof e==`string`?j.get(e):void 0}var I=document.getElementById(`sessions-container`);export{T as S,c as _,N as a,S as b,E as c,s as d,g as f,o as g,m as h,P as i,i as l,u as m,I as n,j as o,w as p,F as r,h as s,M as t,y as u,A as v,C as x,r as y};
@@ -0,0 +1 @@
1
+ import{d as e,o as t,u as n,y as r}from"./dom-helpers-I_SDCPvs.js";import{o as i}from"./card-registry-ClY5hV4m.js";import{c as a,i as o}from"./action-status-RKlYXcNZ.js";import{i as ee}from"./modal-BRwbyxA2.js";import{At as s,Ct as c,Dt as l,It as u,Lt as d,Nt as f,Pt as p,Qr as m,Zr as h,_t as g,at as te,bt as ne,cn as _,gt as v,ht as re,kt as y,m as ie,mt as ae,sn as oe,vt as b,yt as x}from"./index-BEipwPAs.js";import{t as S}from"./team-review-panel-vfsZ4UTc.js";import{t as C}from"./pr-queue-columns-CGSzvEMi.js";var w={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},se={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ce={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:w[e.verdict],tone:se[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:T.error,tone:`danger`}:{text:T[e.status],tone:`muted`}}function D(e){let t=ce[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function le(e){return e.status!==`running`&&e.status!==`queued`}function k(e){return e.status!==`aside`}function A(e){let t=e.find(e=>e.id===`working`)?.items.length??0;return t===0?`No community question needs you right now.`:`No community question needs you right now. ${t} ${t===1?`question is`:`questions are`} being researched.`}function j(e){return e?e.configured===!1?e.reason??`The community lane is not set up yet.`:`No community questions yet. New ones asked after you turned this on show up here.`:`Waiting for the community lane to report.`}function M(e){return e.filter(e=>!e.isWorkspace&&!e.isEphemeral).map(({id:e,name:t})=>({id:e,name:t})).toSorted((e,t)=>e.name.localeCompare(t.name))}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map;function W(){return M([...i].map(([e,t])=>({id:e,name:t.nameEl.textContent??e,isWorkspace:t.card.dataset.workspace!==void 0,isEphemeral:t.card.dataset.ephemeral!==void 0})))}function G(e,n){let r=t(`button`,`pr-action pr-action-ghost`,e);return r.type=`button`,r.disabled=!m(n),r.addEventListener(`click`,()=>h(n)),r}function K(e,n,r){let i=t(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!n,i.addEventListener(`click`,r),i}function q(e,n,r){let i=t(`ul`,e);i.setAttribute(`aria-label`,n);for(let e of r)i.append(t(`li`,null,e));return i}function ue(e){let n=t(`div`,`pr-detail-heading`),r=t(`div`,`pr-detail-title`);r.append(t(`h2`,null,e.item.title||`Untitled question`));let i=t(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(t(`span`,null,e.item.author),t(`span`,null,D(e))),Number.isNaN(a)||i.append(t(`span`,null,`Asked ${ie(a)}`)),n.append(r,i),n}function de(e){let n=t(`section`,`community-question`);return n.setAttribute(`aria-label`,`Question as asked`),n.append(t(`h3`,`pr-section-heading`,`Question as asked`),t(`p`,`community-question-body`,e.item.body)),n}function fe(e){let n=t(`section`,`pr-verdict-box`);n.setAttribute(`aria-label`,`Research`);let r=E(e),i=t(`div`,`pr-verdict-line`),a=t(`strong`,`community-badge`,r.text);if(a.dataset.tone=r.tone,i.append(a),n.append(i),e.error&&n.append(t(`p`,`pr-attention-detail`,e.error)),e.summary&&n.append(t(`p`,`pr-verdict-summary`,e.summary)),e.goal&&n.append(t(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&n.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return n;let o=t(`details`,`pr-verdict-checked`);return o.append(t(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),n.append(o),n}function pe(e){if(!e.draft)return null;let n=t(`section`,`community-draft`);n.setAttribute(`aria-label`,`Draft reply`),n.append(t(`h3`,`pr-section-heading`,`Draft reply`),t(`p`,`community-draft-body`,e.draft.body));let r=e.draft.publicLinks.filter(m);if(r.length===0)return n;let i=t(`ul`,`community-links`);for(let e of r){let n=t(`li`);n.append(G(e,e)),i.append(n)}return n.append(i),n}function me(e,t){let n=e.draft?r(e.draft.body):null;n?n.then(()=>t.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>t.show(`error`,`Copying failed. Select the draft text instead.`)):t.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function he(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await a(`open-community-session`,{key:e.item.key,projectId:H},t,{busyText:`Starting a session with the research.`});n?.type===`open-community-session-result`&&(n.ok?(t.show(`ok`,`Started ${n.sessionName??`a session`}.`),n.sessionId&&te()?.openTerminal(n.sessionId)):t.show(`error`,n.error??`The session did not start.`))}async function J(e,t,n){let r=t===`rerun`?`Queuing the research again.`:`Setting the question aside.`,i=await a(`community-action`,{key:e.item.key,action:t},n,{busyText:r});i?.type===`community-action-result`&&(i.ok||n.show(`error`,i.error??`The change did not apply.`))}function ge(){let e=t(`select`,`community-session-picker`);e.setAttribute(`aria-label`,`Session to start from`);let n=W();n.some(e=>e.id===H)||(H=n[0]?.id??``);for(let r of n){let n=t(`option`,null,r.name);n.value=r.id,n.selected=r.id===H,e.append(n)}return e.disabled=n.length===0,e.addEventListener(`change`,()=>{H=e.value}),e}function _e(e){let n=t(`div`,`community-actions`),r=o(`pr-action-status`),i=t(`div`,`community-action-buttons`);return i.append(K(`Copy draft`,e.draft!==null,()=>me(e,r)),G(`Open thread`,e.item.url),ge(),K(`Start session`,!0,()=>void he(e,r)),K(`Re-run`,le(e),()=>void J(e,`rerun`,r)),K(`Set aside`,k(e),()=>void J(e,`set-aside`,r))),n.append(i,r.element),n}function ve(e){let n=t(`article`,`pr-detail community-detail`),r=pe(e);return n.append(ue(e),_e(e),...r?[r]:[],fe(e),de(e)),n}function Y(){if(!F)return;let e=f(L,R),n=e?JSON.stringify(e.entry):`empty:${d(L).length}`;if(n===V)return;if(V=n,e){F.replaceChildren(ve(e.entry));return}let r=L.some(e=>e.items.length>0);F.replaceChildren(r?S({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(v())))}function ye(e,t){x(y(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=s(L,O);_(I,c(e),e.filter(e=>e.id!==R))}function Z(e){R=e;for(let[t,n]of U)n.setAttribute(`aria-current`,String(t===e));let t=f(L,e),n=U.get(e);t&&n&&ye(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function be(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=f(L,e);if(!t)return;L.find(e=>e.items.includes(t))?.id===`aside`&&(z=!0),R=e,$(),Z(e);let n=U.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function xe(t){if(t.repeat||t.defaultPrevented||!N||n(N)||ee()||e(t)||document.activeElement?.classList.contains(`xterm-helper-textarea`))return;let r=p(t);if(r!==`next-row`&&r!==`previous-row`)return;let i=u([...U.keys()],R,r===`next-row`?1:-1);i&&(t.preventDefault(),i!==R&&Q(i))}function Se(e,n){let r=t(`button`,`pr-queue-row pr-queue-row-quiet`);r.type=`button`,r.dataset.queueKey=e.key,r.setAttribute(`aria-current`,String(e.key===R));let i=E(e.entry),a=t(`span`,`review-queue-action community-badge`,i.text);a.dataset.tone=i.tone;let o=t(`span`,`pr-queue-top`);if(o.append(a,t(`span`,`pr-queue-title`,O(e))),r.append(o,t(`span`,`pr-queue-elapsed`,D(e.entry))),r.title=O(e),n&&b(y(e))){let e=t(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),r.append(e)}return r.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,r),r}function Ce(e){let n=t(`h3`,`pr-section-heading review-group-heading`),r=t(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return n.append(t(`span`,null,e.title),r),n;let i=t(`button`,`review-group-toggle`),a=t(`span`,`review-group-chevron`,`▸`);return a.setAttribute(`aria-hidden`,`true`),i.append(a,e.title),i.type=`button`,i.setAttribute(`aria-expanded`,String(z)),i.addEventListener(`click`,()=>{z=!z,B=null,$()}),n.append(i,r),n}function we(e){let n=t(`section`,`pr-queue-section`);if(n.dataset.group=e.id,n.append(Ce(e)),e.id===`aside`&&!z)return n;for(let t of e.items)n.append(Se(t,e.id===`turn`));return n}function $(){if(!P)return;L=re(),R=l(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,g(),v()?.error??null]);if(e!==B){B=e,U.clear();let n=v()?.error,r=n?[t(`p`,`my-pr-note`,n)]:[],i=L.filter(e=>e.items.length>0).map(we);P.replaceChildren(...r,...i.length>0?i:[t(`p`,`pr-empty`,j(v()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=C({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=r.queue,F=t(`div`,`review-queue-detail`);let i=t(`div`,`review-queue-phone-bar`),a=t(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,be),i.append(a),r.detail.append(i,F),I=oe({onJump:()=>{let e=s(L,O).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),r.queue.before(I),N.append(r.columns),N.dataset.detailOpen=`false`,ae(()=>!n(N)),ne(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
@@ -1,4 +1,4 @@
1
- import{ct as e,n as t,pt as n,st as r}from"./updates-view-core-3KY1QJ76.js";var i=32,a=/^\s*at .+:\d+:\d+\)?$|^[^@\s]*@.+:\d+:\d+$/;function o(e){let t=e.stack??``,n=String(e);return(t.startsWith(n)?t.slice(n.length):t).split(`
1
+ import{ct as e,n as t,pt as n,st as r}from"./updates-view-core-Cm8PSxnG.js";var i=32,a=/^\s*at .+:\d+:\d+\)?$|^[^@\s]*@.+:\d+:\d+$/;function o(e){let t=e.stack??``,n=String(e);return(t.startsWith(n)?t.slice(n.length):t).split(`
2
2
  `).filter(e=>a.test(e)).join(`
3
3
  `)}function s(e){return e==null?null:e instanceof Error?{name:(e.name||`Error`).slice(0,128),stack:o(e).slice(0,r)}:{name:`NonError`,stack:``}}function c(e,t,n){let r=new Set,i=!1;return(a,o)=>{r.has(a)||(r.size>=t?(i||n?.(),i=!0):e(o)&&r.add(a))}}function ee(e){let t=c(e,i);return e=>{let n=s(e);n&&t(`${n.name}\n${n.stack}`,{type:`client-error`,...n})}}function l(e){if(!(e instanceof Error))return`${typeof e}: ${String(e)}`;let t=o(e).split(`
4
4
  `)[0]?.trim()??``;return[`${e.name||`Error`}: ${e.message}`,t].filter(Boolean).join(` `)}function u(e){return e.slice(0,5).map(e=>`${e.path.map(String).join(`.`)||`(root)`}: ${e.message}`).join(`; `)}function te(e){return typeof e!=`object`||!e||!(`type`in e)?`(untyped)`:String(e.type)}function d(e){let t=[];return{sendOrHold(n){return e(n)||t.push(n),!0},flushUnsent(){for(;t.length>0;){let n=t[0];if(!n||!e(n))return;t.shift()}}}}function ne(t){let n=d(t),r=c(n.sendOrHold,i,()=>n.sendOrHold({type:`client-log`,scope:`client-log`,text:`More than ${i} distinct log lines on this page; later ones were not sent.`}));return{report(t,n){let i={scope:t.slice(0,64),text:n.slice(0,e)};r(`${i.scope}\n${i.text}`,{type:`client-log`,...i})},flushUnsent:n.flushUnsent}}function re(e){let t=d(e),n={source:`dashboard`,message:`More than ${i} distinct header errors on this page; later ones were not sent.`},r=c(t.sendOrHold,i,()=>t.sendOrHold({type:`dashboard-telemetry`,event:`header_error_shown`,properties:n}));return{report(e,t){let n={source:e.slice(0,512),message:t.slice(0,512)};r(`${n.source}\n${n.message}`,{type:`dashboard-telemetry`,event:`header_error_shown`,properties:n})},flushUnsent:t.flushUnsent}}var ie=6e4,ae=18e5,f=20;function p({attempt:e=1,baseMs:t=ie,maxMs:n=ae,retryAfterMs:r=null,random:i=Math.random,jitter:a=`full`}={}){if(typeof r==`number`&&Number.isFinite(r)&&r>0)return Math.min(r,n);let o=Math.max(0,Math.min(e,f)-1),s=Math.min(n,t*2**o);return a===`none`?s:Math.round(a===`half`?s*(.5+.5*i()):i()*s)}var m=500,h=3e4;function g(e,t=Math.random){return p({attempt:(typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):0)+1,baseMs:m,maxMs:h,random:t,jitter:`half`})}function oe(e){return e===`https:`?`wss:`:`ws:`}function _(e,t){return`${oe(e?.protocol)}//${e.host}${t}`}var se=1500,ce=15e3,v=3e3,y=2e3,b=[{kind:`reconnect-shown-terminals`},{kind:`replace-control`}];function x(e){return e.isReplacing?{state:e,actions:[]}:{state:{...e,isReplacing:!0},actions:b}}function S(e,t,n){if(e.isProbing||e.isReplacing)return{state:e,actions:[]};let r={kind:`probe-control`,deadlineMs:t,isAnnounced:n},i=n?[{kind:`hold-input`},r]:[r];return{state:{...e,isProbing:!0},actions:i}}function C(e){return e.isVisible?[{kind:`schedule-heartbeat`,inMs:ce}]:[]}function w(e,t){switch(t.kind){case`shown`:{let n={...e,isVisible:!0};return t.hiddenForMs>1e4?x(n):S(n,se,!0)}case`hidden`:return{state:{...e,isVisible:!1},actions:[{kind:`cancel-heartbeat`}]};case`frozen`:return{state:{...e,isFrozen:!0,isProbing:!1,isReplacing:!1},actions:[{kind:`cancel-heartbeat`},{kind:`close-sockets`}]};case`resumed`:return e.isFrozen?{state:{...e,isFrozen:!1,isReplacing:!0},actions:b}:x(e);case`network-changed`:return e.isVisible?S(e,v,!1):{state:e,actions:[]};case`heartbeat-due`:return e.isVisible?t.lateByMs>5e3?x(e):S(e,v,!1):{state:e,actions:[]};case`pong`:return e.isFrozen?{state:{...e,isProbing:!1},actions:[{kind:`release-input`}]}:{state:{...e,isProbing:!1},actions:[{kind:`release-input`},...C(e)]};case`pong-missed`:{if(e.isFrozen)return{state:{...e,isProbing:!1},actions:[{kind:`release-input`}]};let t=x({...e,isProbing:!1});return{state:t.state,actions:[...t.actions,{kind:`release-input`}]}}case`handshake-overdue`:return{state:{...e,isReplacing:!0},actions:[{kind:`replace-control`}]};case`control-opened`:return{state:{...e,isReplacing:!1},actions:C(e)};case`control-closed`:return{state:{...e,isReplacing:!1},actions:[{kind:`cancel-heartbeat`}]}}}var T=``,E=null;function D(){return T}function O(){return T?Promise.resolve(T):E||(E=fetch(`/control-token`,{credentials:`same-origin`,cache:`no-store`,signal:AbortSignal.timeout(y)}).then(e=>e.ok?e.json():null).then(e=>{let t=e?.token;return T=typeof t==`string`?t:``,T}).catch(()=>``).finally(()=>{E=null}),E)}function k(){T=``}function A(e){return T?`${e}${e.includes(`?`)?`&`:`?`}token=${encodeURIComponent(T)}`:e}var j=null,M=null,N=0,P=new Map,F=!1,I=0,L=0,R=null,z=null,B=null;function V(e){z=e}function H(e){B=e}function U(e){R=e}function W(e){return j?.readyState===WebSocket.OPEN&&(j.send(JSON.stringify(e)),!0)}var G=ne(W),K=re(W);function q(e,t){console.warn(`[${e}] ${t}`),G.report(e,t)}function le(e,t){G.report(`header error`,`${e}: ${t}`),K.report(e,t)}function J(e){return L+=1,`${e}-${L}`}function Y(e,n,{timeoutMs:r=5e3}={}){let i=J(e);return new Promise((a,o)=>{let s=setTimeout(()=>{P.delete(i),o(Error(`Request timed out`))},r);P.set(i,{resolve:a,reject:o,timer:s}),j?.readyState===WebSocket.OPEN?j.send(JSON.stringify({type:e,requestId:i,...n})):(clearTimeout(s),P.delete(i),o(Error(t)))})}function ue(e){if(typeof e!=`object`||!e||!(`requestId`in e))return;let t=e.requestId;if(typeof t!=`string`)return;let n=P.get(t);n&&(clearTimeout(n.timer),P.delete(t),n.reject(Error(`The server sent a reply this dashboard could not read. Reload the page to pick up the current version.`)))}function X(e){for(let t of P.values())clearTimeout(t.timer),t.reject(Error(e));P.clear()}function Z(){M!==null&&clearTimeout(M),M=null}function Q(){let e=j;j=null,Z(),X(t),z&&z(`disconnected`,`Reconnecting`),e?.close()}function de(){Q(),N=0,$()}function fe(e,t){return t&&z&&z(`connecting`,`Connecting`),Y(`ping`,{},{timeoutMs:e}).then(()=>(t&&z&&z(`verified`,`Connected`),!0),()=>!1)}function $(){if(Z(),!D()&&!F){F=!0,O().finally(()=>{F=!1,$()});return}if(F)return;let e=I>0?`?since=${I}`:``,r=_(location,A(`/control${e}`)),i=new WebSocket(r);j=i,B?.(`connecting`);let a=!1;i.addEventListener(`open`,()=>{j===i&&(a=!0,N=0,z&&z(`connected`,`Connected`),G.flushUnsent(),K.flushUnsent(),B?.(`opened`))}),i.addEventListener(`message`,e=>{if(j!==i)return;let t;try{t=JSON.parse(e.data)}catch{q(`control`,`dropped a server message that is not JSON`);return}let r=n.safeParse(t);if(!r.success){q(`control`,`dropped ${te(t)}: ${u(r.error.issues)}`),ue(t);return}let a=r.data;if(a.type===`snapshot`&&typeof a.seq!=`number`&&(I=0),typeof a.seq==`number`){if(a.seq<=I)return;I=a.seq}let o=typeof a.requestId==`string`?a.requestId:``,s=o?P.get(o):void 0;s?(clearTimeout(s.timer),P.delete(o),s.resolve(a)):R&&R(a)}),i.addEventListener(`close`,()=>{if(j!==i)return;j=null,X(t),a||k(),z&&z(`disconnected`,`Reconnecting`),B?.(`closed`);let e=g(N);N+=1,M=setTimeout($,e)})}export{u as C,l as S,y as _,H as a,g as b,le as c,Y as d,V as f,A as g,D as h,U as i,q as l,O as m,$ as n,fe as o,k as p,J as r,de as s,Q as t,W as u,w as v,ee as x,_ as y};