glimmervoid 0.47.1-next.276 → 0.47.1-next.277

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 (100) hide show
  1. package/dist/bin/glimmervoid.js +8 -8
  2. package/dist/chunks/{adapters-BGt--hTG.js → adapters-3q49ufvw.js} +1 -1
  3. package/dist/chunks/{adapters-ebaQuX5t.js → adapters-D3AVM9Mh.js} +2 -2
  4. package/dist/chunks/{agent-api-cli-D6C5XiWP.js → agent-api-cli-BJUX-ouG.js} +1 -1
  5. package/dist/chunks/{agent-api-cli-DCdNBdTB.js → agent-api-cli-DcJcPGC-.js} +1 -1
  6. package/dist/chunks/{agent-api-core-BrL-9AXf.js → agent-api-core-CnRkmt_J.js} +1 -1
  7. package/dist/chunks/{build-channel-CpiozhgF.js → build-channel-Sv6Rreda.js} +1 -1
  8. package/dist/chunks/{config-CjmrOiyR.js → config--vMYJSbq.js} +1 -0
  9. package/dist/chunks/config-store-DUhCiZ5P.js +1 -0
  10. package/dist/chunks/{config-store-Chp11swJ.js → config-store-DwFo7FVH.js} +17 -2
  11. package/dist/chunks/{main-CVouOJVC.js → main-DJEKaWK4.js} +10 -7
  12. package/dist/chunks/{pair-cli-B6vZD7vE.js → pair-cli-BxzdcV5E.js} +2 -2
  13. package/dist/chunks/{remote-config-CaWpmAZ9.js → remote-config-Dp7nAjfm.js} +1 -1
  14. package/dist/chunks/{settings-cli-xWPId5N1.js → settings-cli-Db0yNBIq.js} +4 -4
  15. package/dist/chunks/{settings-readout-core-DxId8xWv.js → settings-readout-core-DDRpSPRb.js} +1 -1
  16. package/dist/chunks/{ssh-sign-cli-BMkyV9Pt.js → ssh-sign-cli-3sk71bPn.js} +1 -1
  17. package/dist/client/assets/{benchmark-panel-DzcXVc4K.js → benchmark-panel-D6E2qi32.js} +1 -1
  18. package/dist/client/assets/benchmark-panel-D6E2qi32.js.br +0 -0
  19. package/dist/client/assets/{boards-view-Cth5hfBW.js → boards-view-CAZ05lHM.js} +1 -1
  20. package/dist/client/assets/boards-view-CAZ05lHM.js.br +0 -0
  21. package/dist/client/assets/{community-panel-C6zRT7Fn.js → community-panel-C-w6KqGC.js} +1 -1
  22. package/dist/client/assets/community-panel-C-w6KqGC.js.br +0 -0
  23. package/dist/client/assets/{dialogs-CFIjFUD2.js → dialogs-BwC1PP3p.js} +1 -1
  24. package/dist/client/assets/dialogs-BwC1PP3p.js.br +0 -0
  25. package/dist/client/assets/{doc-editor-ui-DXdeBEpt.js → doc-editor-ui-Cnp1jm-z.js} +1 -1
  26. package/dist/client/assets/doc-editor-ui-Cnp1jm-z.js.br +0 -0
  27. package/dist/client/assets/{feature-hint-CR-ehiHc.js → feature-hint-DlG-nKGY.js} +1 -1
  28. package/dist/client/assets/feature-hint-DlG-nKGY.js.br +0 -0
  29. package/dist/client/assets/{first-run-checklist-HlUZunYq.js → first-run-checklist-x6PVrD3H.js} +1 -1
  30. package/dist/client/assets/first-run-checklist-x6PVrD3H.js.br +0 -0
  31. package/dist/client/assets/{hooks-panel-D6wh3iSH.js → hooks-panel-BnsZS3ps.js} +1 -1
  32. package/dist/client/assets/hooks-panel-BnsZS3ps.js.br +0 -0
  33. package/dist/client/assets/{index-cS813iUS.js → index-BkXoTulL.js} +5 -5
  34. package/dist/client/assets/index-BkXoTulL.js.br +0 -0
  35. package/dist/client/assets/{issues-panel-Botb4Y-M.js → issues-panel-CN0uPs1A.js} +1 -1
  36. package/dist/client/assets/issues-panel-CN0uPs1A.js.br +0 -0
  37. package/dist/client/assets/{my-prs-panel-B8qWAAkH.js → my-prs-panel-DCZkk8O0.js} +1 -1
  38. package/dist/client/assets/my-prs-panel-DCZkk8O0.js.br +0 -0
  39. package/dist/client/assets/{nyan-cat-DYnmlAyQ.js → nyan-cat-DZBktd08.js} +1 -1
  40. package/dist/client/assets/nyan-cat-DZBktd08.js.br +0 -0
  41. package/dist/client/assets/{phone-shell-BXr7_yeN.js → phone-shell-DRLyaCxj.js} +1 -1
  42. package/dist/client/assets/phone-shell-DRLyaCxj.js.br +0 -0
  43. package/dist/client/assets/{plan-face-Fg8XcwZr.js → plan-face-BXDqDVC8.js} +1 -1
  44. package/dist/client/assets/plan-face-BXDqDVC8.js.br +0 -0
  45. package/dist/client/assets/{plan-render-CnTGHfQr.js → plan-render-C5S7ifor.js} +1 -1
  46. package/dist/client/assets/plan-render-C5S7ifor.js.br +0 -0
  47. package/dist/client/assets/{pr-queue-columns-DZMx7R1-.js → pr-queue-columns-D_jk8p19.js} +1 -1
  48. package/dist/client/assets/pr-queue-columns-D_jk8p19.js.br +0 -0
  49. package/dist/client/assets/{radar-panel-CKktIxK8.js → radar-panel-n0vx2bLl.js} +1 -1
  50. package/dist/client/assets/radar-panel-n0vx2bLl.js.br +0 -0
  51. package/dist/client/assets/{repo-roots-adder-BCdJwyOP.js → repo-roots-adder-CsrFf2Wm.js} +1 -1
  52. package/dist/client/assets/repo-roots-adder-CsrFf2Wm.js.br +0 -0
  53. package/dist/client/assets/{resume-dialog-BDvn6SlL.js → resume-dialog-B-8hmMGM.js} +1 -1
  54. package/dist/client/assets/resume-dialog-B-8hmMGM.js.br +0 -0
  55. package/dist/client/assets/{review-queue-panel-zYO_oAM3.js → review-queue-panel-yVOuFUGn.js} +1 -1
  56. package/dist/client/assets/review-queue-panel-yVOuFUGn.js.br +0 -0
  57. package/dist/client/assets/{settings-panel-CJGhGNSf.js → settings-panel-CNoSoKpc.js} +2 -2
  58. package/dist/client/assets/settings-panel-CNoSoKpc.js.br +0 -0
  59. package/dist/client/assets/{shown-lightbox-BOje5wuh.js → shown-lightbox-CmHV5nJ1.js} +1 -1
  60. package/dist/client/assets/shown-lightbox-CmHV5nJ1.js.br +0 -0
  61. package/dist/client/assets/{team-review-panel-C-lrxA2I.js → team-review-panel-5O5HtBLh.js} +1 -1
  62. package/dist/client/assets/team-review-panel-5O5HtBLh.js.br +0 -0
  63. package/dist/client/assets/{trace-panel-BmWkxw_v.js → trace-panel-Dz4fDlx_.js} +1 -1
  64. package/dist/client/assets/trace-panel-Dz4fDlx_.js.br +0 -0
  65. package/dist/client/assets/usage-panel-DXNyE4Jz.js +1 -0
  66. package/dist/client/assets/usage-panel-DXNyE4Jz.js.br +0 -0
  67. package/dist/client/assets/{usage-panel-PSiRqSrz.css → usage-panel-DrnH15go.css} +1 -1
  68. package/dist/client/assets/usage-panel-DrnH15go.css.br +0 -0
  69. package/dist/client/index.html +1 -1
  70. package/dist/client/index.html.br +0 -0
  71. package/dist/server/index.js +1 -1
  72. package/package.json +1 -1
  73. package/dist/chunks/config-store-Ct-IE855.js +0 -1
  74. package/dist/client/assets/benchmark-panel-DzcXVc4K.js.br +0 -0
  75. package/dist/client/assets/boards-view-Cth5hfBW.js.br +0 -0
  76. package/dist/client/assets/community-panel-C6zRT7Fn.js.br +0 -0
  77. package/dist/client/assets/dialogs-CFIjFUD2.js.br +0 -0
  78. package/dist/client/assets/doc-editor-ui-DXdeBEpt.js.br +0 -0
  79. package/dist/client/assets/feature-hint-CR-ehiHc.js.br +0 -0
  80. package/dist/client/assets/first-run-checklist-HlUZunYq.js.br +0 -0
  81. package/dist/client/assets/hooks-panel-D6wh3iSH.js.br +0 -0
  82. package/dist/client/assets/index-cS813iUS.js.br +0 -0
  83. package/dist/client/assets/issues-panel-Botb4Y-M.js.br +0 -0
  84. package/dist/client/assets/my-prs-panel-B8qWAAkH.js.br +0 -0
  85. package/dist/client/assets/nyan-cat-DYnmlAyQ.js.br +0 -0
  86. package/dist/client/assets/phone-shell-BXr7_yeN.js.br +0 -0
  87. package/dist/client/assets/plan-face-Fg8XcwZr.js.br +0 -0
  88. package/dist/client/assets/plan-render-CnTGHfQr.js.br +0 -0
  89. package/dist/client/assets/pr-queue-columns-DZMx7R1-.js.br +0 -0
  90. package/dist/client/assets/radar-panel-CKktIxK8.js.br +0 -0
  91. package/dist/client/assets/repo-roots-adder-BCdJwyOP.js.br +0 -0
  92. package/dist/client/assets/resume-dialog-BDvn6SlL.js.br +0 -0
  93. package/dist/client/assets/review-queue-panel-zYO_oAM3.js.br +0 -0
  94. package/dist/client/assets/settings-panel-CJGhGNSf.js.br +0 -0
  95. package/dist/client/assets/shown-lightbox-BOje5wuh.js.br +0 -0
  96. package/dist/client/assets/team-review-panel-C-lrxA2I.js.br +0 -0
  97. package/dist/client/assets/trace-panel-BmWkxw_v.js.br +0 -0
  98. package/dist/client/assets/usage-panel-BRMUjaYt.js +0 -1
  99. package/dist/client/assets/usage-panel-BRMUjaYt.js.br +0 -0
  100. package/dist/client/assets/usage-panel-PSiRqSrz.css.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-BrL-9AXf.js";
8
+ import { r as agentCommandHelpLines } from "../chunks/agent-api-core-CnRkmt_J.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-B6vZD7vE.js");
60
+ const { runPairCli } = await import("../chunks/pair-cli-BxzdcV5E.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-xWPId5N1.js");
68
+ const { runSettingsCli } = await import("../chunks/settings-cli-Db0yNBIq.js");
69
69
  return runSettingsCli(subcommandArgs);
70
70
  }],
71
71
  ["ssh-sign", async (subcommandArgs) => {
72
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BMkyV9Pt.js");
72
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-3sk71bPn.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-DCdNBdTB.js");
78
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-DcJcPGC-.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-DCdNBdTB.js");
92
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-DcJcPGC-.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-Ct-IE855.js");
149
+ const { loadConfigFile } = await import("../chunks/config-store-DUhCiZ5P.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-BGt--hTG.js");
225
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-3q49ufvw.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-ebaQuX5t.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-D3AVM9Mh.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 { Dt as UpdateChannel, c as SHELL_AGENT_ID, x as InstallFlavor } from "./config-CjmrOiyR.js";
5
+ import { Dt as UpdateChannel, c as SHELL_AGENT_ID, x as InstallFlavor } from "./config--vMYJSbq.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-CpiozhgF.js";
14
+ import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-Sv6Rreda.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-BrL-9AXf.js";
3
+ import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-CnRkmt_J.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-D6C5XiWP.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-BJUX-ouG.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 { E as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-CjmrOiyR.js";
2
+ import { E as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config--vMYJSbq.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 { A as HintFeature, C as ONBOARDING_STEP_STATES, S as ONBOARDING_STEPS, T as OPERATOR_SURFACES, b as DASHBOARD_VIEWS, n as BUILTIN_AGENT_IDS, w as OPERATOR_ACTIONS_BY_SURFACE } from "./config-CjmrOiyR.js";
2
+ import { A as HintFeature, C as ONBOARDING_STEP_STATES, S as ONBOARDING_STEPS, T as OPERATOR_SURFACES, b as DASHBOARD_VIEWS, n as BUILTIN_AGENT_IDS, w as OPERATOR_ACTIONS_BY_SURFACE } from "./config--vMYJSbq.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"]);
@@ -2659,6 +2659,7 @@ var createUsageSettings = (isAbsolutePath) => optionalObject("usage", {
2659
2659
  enabled: optionalBoolean("usage.enabled"),
2660
2660
  fetchPricing: optionalBoolean("usage.fetchPricing"),
2661
2661
  planLimits: optionalBoolean("usage.planLimits"),
2662
+ yourDay: optionalBoolean("usage.yourDay"),
2662
2663
  scanIntervalMinutes: optionalInteger("usage.scanIntervalMinutes", USAGE_INTEGER_RANGES.scanIntervalMinutes),
2663
2664
  retainDays: optionalInteger("usage.retainDays", USAGE_INTEGER_RANGES.retainDays),
2664
2665
  warehouseRetainDays: optionalInteger("usage.warehouseRetainDays", USAGE_INTEGER_RANGES.warehouseRetainDays),
@@ -0,0 +1 @@
1
+ export { c as loadConfigFile } from "./config-store-DwFo7FVH.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_DURATION_RANGE, Et as UPDATE_CHANNELS, Q as FLYING_ANIMALS_DEFAULTS, Z as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_SCAN_INTERVAL_RANGE, at as PORT_RANGE, ct as POSTHOG_PROJECT_ID_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, et as FLYING_ANIMALS_GAP_RANGE, f as USAGE_COST_MODES, ft as REPLAY_BUFFER_KB_RANGE, gt as USAGE_RETAIN_DAYS_RANGE, ht as USAGE_INTEGER_RANGES, i as Config, it as NON_NEGATIVE_NUMBER_RANGE, lt as POSTHOG_TRAFFIC_BASELINE_RANGE, m as normalizeLegacyConfigNumbers, mt as USAGE_BUDGET_RANGE, n as BUILTIN_AGENT_IDS, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, ot as POSITIVE_NUMBER_RANGE, pt as TASK_TITLE_TIMEOUT_RANGE, rt as MEMORY_RESERVE_MB_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSTHOG_FIX_TIMEOUT_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_SCALE_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_MIN_USERS_RANGE, vt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, yt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE } from "./config-CjmrOiyR.js";
4
+ import { $ as FLYING_ANIMALS_DURATION_RANGE, Et as UPDATE_CHANNELS, Q as FLYING_ANIMALS_DEFAULTS, Z as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_SCAN_INTERVAL_RANGE, at as PORT_RANGE, ct as POSTHOG_PROJECT_ID_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, et as FLYING_ANIMALS_GAP_RANGE, f as USAGE_COST_MODES, ft as REPLAY_BUFFER_KB_RANGE, gt as USAGE_RETAIN_DAYS_RANGE, ht as USAGE_INTEGER_RANGES, i as Config, it as NON_NEGATIVE_NUMBER_RANGE, lt as POSTHOG_TRAFFIC_BASELINE_RANGE, m as normalizeLegacyConfigNumbers, mt as USAGE_BUDGET_RANGE, n as BUILTIN_AGENT_IDS, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, ot as POSITIVE_NUMBER_RANGE, pt as TASK_TITLE_TIMEOUT_RANGE, rt as MEMORY_RESERVE_MB_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSTHOG_FIX_TIMEOUT_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_SCALE_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_MIN_USERS_RANGE, vt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, yt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE } from "./config--vMYJSbq.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-CpiozhgF.js";
7
+ import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-Sv6Rreda.js";
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
10
10
  import os from "node:os";
@@ -1294,6 +1294,21 @@ var SECTIONS = Object.freeze([
1294
1294
  status: "usage-last-report",
1295
1295
  ...MACHINE_NOW
1296
1296
  },
1297
+ {
1298
+ id: "usage-your-day",
1299
+ path: "usage.yourDay",
1300
+ title: "Your day",
1301
+ description: "Recap yesterday and suggest a pace for today from when you prompted sessions. Needs token usage tracking.",
1302
+ control: "toggle",
1303
+ keywords: [
1304
+ "burnout",
1305
+ "breaks",
1306
+ "pace",
1307
+ "wellbeing"
1308
+ ],
1309
+ defaultValue: true,
1310
+ ...MACHINE_NOW
1311
+ },
1297
1312
  {
1298
1313
  id: "usage-retain-days",
1299
1314
  path: "usage.retainDays",
@@ -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 { At as MAX_RAW_LINE_CHARS, B as MinedPrReviewData, Bt as PLAN_TOOL_NAME, Ct as CommunityState, D as FeatureHintState, E as pullRequestKeyFromReference, F as BenchmarkRun, Ft as changeMapFactId, G as GithubPrsFrame, Gt as GithubIssuePullRequestsRepository, H as GithubPrDetailNode, Ht as PlanRevision, I as BenchmarkStatus, It as PLAN_BODY_CAP_BYTES, J as WorkflowLabelName, Jt as IssueUpdate, K as comparablePrKey, Kt as GithubIssueResponse, L as BenchmarkSuite, Lt as PLAN_HOOK_EVENT, M as BenchmarkCase, Mt as TraceRecord, N as BenchmarkId, Nt as CoherenceJournalOutput, O as HINT_FEATURES, Ot as UpdateJournal, P as BenchmarkJudgement, Pt as ChangeMap, Qt as issuePullRequestStateFromGithub, R as CommitComparison, Rt as PLAN_HOOK_OUTPUT_MAX_CHARS, St as CommunityItem, Tt as DISCORD_CHANNEL_NAME_RE, U as GithubPrKey, Ut as parseExitPlanModeHookPayload, V as PrCheckoutCaseInput, Vt as PlanDecision, W as GithubPrLightSearchNode, Wt as planTitle, X as WorkflowsState, Xt as IssuesState, Y as WorkflowsSettings, Yt as IssuesSearchResponse, Zt as IssuesStatus, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, bt as CommunityActionRequest, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, h as CHANGES_POLL_INTERVAL_MS, ht as USAGE_INTEGER_RANGES, j as BenchmarkActionRequest, jt as TraceCheckpoint, k as HINT_VIEW_BY_FEATURE, kt as SessionSetup, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, p as USAGE_VENDOR_KEYS, q as WorkflowCommentBody, qt as IssueKey, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityVerdict, xt as CommunityDraft, y as ClientMessage, z as MergedPrListing, zt as PLAN_RESULT_HOOK_EVENT } from "./config-CjmrOiyR.js";
7
+ import { At as MAX_RAW_LINE_CHARS, B as MinedPrReviewData, Bt as PLAN_TOOL_NAME, Ct as CommunityState, D as FeatureHintState, E as pullRequestKeyFromReference, F as BenchmarkRun, Ft as changeMapFactId, G as GithubPrsFrame, Gt as GithubIssuePullRequestsRepository, H as GithubPrDetailNode, Ht as PlanRevision, I as BenchmarkStatus, It as PLAN_BODY_CAP_BYTES, J as WorkflowLabelName, Jt as IssueUpdate, K as comparablePrKey, Kt as GithubIssueResponse, L as BenchmarkSuite, Lt as PLAN_HOOK_EVENT, M as BenchmarkCase, Mt as TraceRecord, N as BenchmarkId, Nt as CoherenceJournalOutput, O as HINT_FEATURES, Ot as UpdateJournal, P as BenchmarkJudgement, Pt as ChangeMap, Qt as issuePullRequestStateFromGithub, R as CommitComparison, Rt as PLAN_HOOK_OUTPUT_MAX_CHARS, St as CommunityItem, Tt as DISCORD_CHANNEL_NAME_RE, U as GithubPrKey, Ut as parseExitPlanModeHookPayload, V as PrCheckoutCaseInput, Vt as PlanDecision, W as GithubPrLightSearchNode, Wt as planTitle, X as WorkflowsState, Xt as IssuesState, Y as WorkflowsSettings, Yt as IssuesSearchResponse, Zt as IssuesStatus, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, bt as CommunityActionRequest, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, h as CHANGES_POLL_INTERVAL_MS, ht as USAGE_INTEGER_RANGES, j as BenchmarkActionRequest, jt as TraceCheckpoint, k as HINT_VIEW_BY_FEATURE, kt as SessionSetup, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, p as USAGE_VENDOR_KEYS, q as WorkflowCommentBody, qt as IssueKey, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityVerdict, xt as CommunityDraft, y as ClientMessage, z as MergedPrListing, zt as PLAN_RESULT_HOOK_EVENT } from "./config--vMYJSbq.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-BrL-9AXf.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-CnRkmt_J.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-Chp11swJ.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-CpiozhgF.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-DwFo7FVH.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-Sv6Rreda.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-ebaQuX5t.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-D3AVM9Mh.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-CaWpmAZ9.js";
28
- import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-DxId8xWv.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-Dp7nAjfm.js";
28
+ import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-DDRpSPRb.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";
@@ -39806,6 +39806,7 @@ var DEFAULT_USAGE_CONFIG = Object.freeze({
39806
39806
  enabled: true,
39807
39807
  fetchPricing: true,
39808
39808
  planLimits: true,
39809
+ yourDay: true,
39809
39810
  scanIntervalMinutes: 5,
39810
39811
  retainDays: 90,
39811
39812
  warehouseRetainDays: 365,
@@ -39855,6 +39856,7 @@ function resolveUsageConfig(usage) {
39855
39856
  enabled: typeof source.enabled === "boolean" ? source.enabled : DEFAULT_USAGE_CONFIG.enabled,
39856
39857
  fetchPricing: typeof source.fetchPricing === "boolean" ? source.fetchPricing : DEFAULT_USAGE_CONFIG.fetchPricing,
39857
39858
  planLimits: typeof source.planLimits === "boolean" ? source.planLimits : DEFAULT_USAGE_CONFIG.planLimits,
39859
+ yourDay: typeof source.yourDay === "boolean" ? source.yourDay : DEFAULT_USAGE_CONFIG.yourDay,
39858
39860
  scanIntervalMinutes: integerWithin(source.scanIntervalMinutes, INTEGER_RANGES.scanIntervalMinutes, DEFAULT_USAGE_CONFIG.scanIntervalMinutes),
39859
39861
  retainDays: integerWithin(source.retainDays, INTEGER_RANGES.retainDays, DEFAULT_USAGE_CONFIG.retainDays),
39860
39862
  warehouseRetainDays: integerWithin(source.warehouseRetainDays, INTEGER_RANGES.warehouseRetainDays, DEFAULT_USAGE_CONFIG.warehouseRetainDays),
@@ -40332,6 +40334,7 @@ function createUsageWiring({ config, sessions = /* @__PURE__ */ new Map(), broad
40332
40334
  budget: report.budget,
40333
40335
  savings,
40334
40336
  tokenLimit: report.tokenLimit,
40337
+ yourDay: cfg.yourDay ? report.yourDay : null,
40335
40338
  pricing: {
40336
40339
  source: pricing.source,
40337
40340
  fetchedAt: pricing.fetchedAt,
@@ -1,6 +1,6 @@
1
1
  import { r as errorMessage } from "./text-DoirglWV.js";
2
- import { l as resolveConfigPath } from "./config-store-Chp11swJ.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-CaWpmAZ9.js";
2
+ import { l as resolveConfigPath } from "./config-store-DwFo7FVH.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-Dp7nAjfm.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-Chp11swJ.js";
5
+ import { ct as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-DwFo7FVH.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-CjmrOiyR.js";
4
+ import { r as BrowserConfig } from "./config--vMYJSbq.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-Chp11swJ.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-DxId8xWv.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-DwFo7FVH.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-DDRpSPRb.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-DCdNBdTB.js");
333
+ const { askAgentApi } = await import("./agent-api-cli-DcJcPGC-.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-Chp11swJ.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-DwFo7FVH.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-D6C5XiWP.js";
5
+ import { n as postToAgentIngress } from "./agent-api-cli-BJUX-ouG.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"./updates-view-core-DodtnH3A.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-cS813iUS.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-DodtnH3A.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-BkXoTulL.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 +1 @@
1
- import{Et as e}from"./updates-view-core-DodtnH3A.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-BXztZiPc.js";import{i}from"./action-status-C_hxjBXy.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-cS813iUS.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-DodtnH3A.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-BXztZiPc.js";import{i}from"./action-status-C_hxjBXy.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-BkXoTulL.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 +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-BXztZiPc.js";import{c as a,i as o}from"./action-status-C_hxjBXy.js";import{i as ee}from"./modal-BRwbyxA2.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,Xr as p,Zr as m,_t as h,gt as ne,ht as g,it as _,kt as v,m as re,mt as ie,on as ae,pt as y,sn as b,vt as x,yt as S}from"./index-cS813iUS.js";import{t as C}from"./team-review-panel-C-lrxA2I.js";import{t as w}from"./pr-queue-columns-DZMx7R1-.js";var oe={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:oe[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`,()=>p(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 ${re(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&&_()?.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=l(L,R),n=e?JSON.stringify(e.entry):`empty:${c(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?C({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){x(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=v(L,O);b(I,f(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=l(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=l(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=u(t);if(r!==`next-row`&&r!==`previous-row`)return;let i=s([...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&&h(d(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=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,ne(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.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(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=w({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=ae({onJump:()=>{let e=v(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`,y(()=>!n(N)),S(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
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-BXztZiPc.js";import{c as a,i as o}from"./action-status-C_hxjBXy.js";import{i as ee}from"./modal-BRwbyxA2.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,Xr as p,Zr as m,_t as h,gt as ne,ht as g,it as _,kt as v,m as re,mt as ie,on as ae,pt as y,sn as b,vt as x,yt as S}from"./index-BkXoTulL.js";import{t as C}from"./team-review-panel-5O5HtBLh.js";import{t as w}from"./pr-queue-columns-D_jk8p19.js";var oe={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:oe[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`,()=>p(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 ${re(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&&_()?.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=l(L,R),n=e?JSON.stringify(e.entry):`empty:${c(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?C({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){x(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=v(L,O);b(I,f(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=l(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=l(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=u(t);if(r!==`next-row`&&r!==`previous-row`)return;let i=s([...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&&h(d(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=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,ne(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.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(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=w({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=ae({onJump:()=>{let e=v(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`,y(()=>!n(N)),S(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{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-DodtnH3A.js";import{h as o,m as s,o as c}from"./dom-helpers-I_SDCPvs.js";import{d as l}from"./control-ws-6Ix6WqG2.js";import{i as u,s as d,t as f}from"./action-status-C_hxjBXy.js";import{n as p,r as m,t as h}from"./modal-BRwbyxA2.js";import{n as g}from"./session-tick-RnZFZ4n3.js";import{Ar as _,Dr as v,Er as y,Or as b,gr as x,hi as S,jn as C,jr as w,kr as T,m as E,mi as D,pi as O,wr as ee}from"./index-cS813iUS.js";import{t as te}from"./repo-roots-adder-BCdJwyOP.js";import{t as ne}from"./sandboxed-frame-qKHbOuc_.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
1
+ import{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-DodtnH3A.js";import{h as o,m as s,o as c}from"./dom-helpers-I_SDCPvs.js";import{d as l}from"./control-ws-6Ix6WqG2.js";import{i as u,s as d,t as f}from"./action-status-C_hxjBXy.js";import{n as p,r as m,t as h}from"./modal-BRwbyxA2.js";import{n as g}from"./session-tick-RnZFZ4n3.js";import{Ar as _,Dr as v,Er as y,Or as b,gr as x,hi as S,jn as C,jr as w,kr as T,m as E,mi as D,pi as O,wr as ee}from"./index-BkXoTulL.js";import{t as te}from"./repo-roots-adder-CsrFf2Wm.js";import{t as ne}from"./sandboxed-frame-qKHbOuc_.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
2
2
  <fieldset class="dialog-mode-controls add-session-agent-only" aria-label="Session kind">
3
3
  <button type="button" class="dialog-mode-button" id="add-session-single-mode" aria-pressed="true">Single repo</button>
4
4
  <button type="button" class="dialog-mode-button" id="add-session-workspace-mode" aria-pressed="false">Workspace</button>
@@ -1 +1 @@
1
- import{o as e}from"./dom-helpers-I_SDCPvs.js";import{d as t}from"./control-ws-6Ix6WqG2.js";import{s as n,t as r}from"./action-status-C_hxjBXy.js";import{a as i,r as a,t as o}from"./modal-BRwbyxA2.js";import{di as s,yn as c}from"./index-cS813iUS.js";import{i as l,t as u}from"./plan-render-CnTGHfQr.js";var d=null;function f(t){let n=s(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=s(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){i({title:e,message:`Your unsaved edits will be lost.`,confirmLabel:`Discard`,danger:!0,onConfirm:t})}function _(e,t,n){e.hasUnsavedChanges?g(t,n):n()}async function v(e,i){try{return{reply:await t(e,i,{timeoutMs:r}),failureText:null}}catch(e){return{reply:null,failureText:n(e,r)}}}async function y(e,t){e.docPath=t,e.isBusy=!0,e.baseHash=null,e.textarea.readOnly=!0,f(e),m(e,`Loading`),p(e);let{reply:n,failureText:r}=await v(`session-doc-read`,{id:e.sessionId,path:t});if(d!==e||e.docPath!==t)return;e.isBusy=!1,e.textarea.readOnly=!1;let i=n?.type===`session-doc-response`?n:null;!i?.ok||i.text===void 0||i.hash===void 0?(m(e,i?.error||r||`Could not open this doc`,`warn`),p(e)):(e.textarea.value=i.text,e.baseHash=i.hash,e.hasUnsavedChanges=!1,e.mode===`preview`&&h(e),m(e,``),p(e))}async function b(e){if(e.btnSave.disabled||e.baseHash===null)return;e.isBusy=!0,m(e,`Saving`),p(e);let t=e.docPath,n=e.textarea.value,{reply:r,failureText:i}=await v(`session-doc-save`,{id:e.sessionId,path:t,text:n,baseHash:e.baseHash});if(d!==e||e.docPath!==t)return;e.isBusy=!1;let a=r?.type===`session-doc-save-result`?r:null;!a?.ok||a.hash===void 0?(m(e,a?.conflict?`The agent changed this file since you opened it. Reload to see its version.`:a?.error||i||`Save failed`,`warn`),p(e)):(e.baseHash=a.hash,e.hasUnsavedChanges=e.textarea.value!==n,m(e,e.hasUnsavedChanges?`Unsaved changes`:`Saved`),p(e))}function x(e,t){e.mode=t,t===`preview`&&h(e),p(e),t===`edit`&&e.textarea.focus()}function S(t,n){let r=e(`button`,`plan-control ${n}`,t);return r.type=`button`,r}function C(t){let n=s(t)[0];if(!n||d)return;let r=()=>_(M,`Close this doc?`,()=>M.close()),i=a({dialogClass:`doc-editor`,closeOnBackdrop:!1,onEscape:r}),l=`doc-editor-title-${t}`,u=e(`h3`,`doc-editor-title`,n.name);u.id=l;let f=e(`select`,`plan-control doc-editor-picker`);f.setAttribute(`aria-label`,`Doc`);let h=e(`span`,`doc-editor-status`);h.setAttribute(`role`,`status`);let g=S(`Edit`,`doc-editor-mode`),v=S(`Preview`,`doc-editor-mode`),C=S(`Reload`,`doc-editor-reload`),w=S(`Save`,`doc-editor-save`),T=S(`Close`,`doc-editor-close`),E=e(`div`,`doc-editor-modes`);E.append(g,v);let D=e(`div`,`doc-editor-actions`);D.append(h,C,w,T);let O=e(`div`,`doc-editor-header`);O.append(u,f,E,D);let k=e(`textarea`,`plan-editor doc-editor-text`);k.spellcheck=!0,k.setAttribute(`aria-labelledby`,l);let A=e(`div`,`doc-editor-preview`),j=e(`div`,`doc-editor-body`);j.append(k,A),i.dialog.append(O,j),o(i.dialog,l);let M={sessionId:t,docPath:n.path,baseHash:null,hasUnsavedChanges:!1,isBusy:!1,mode:c()?`preview`:`edit`,title:u,select:f,textarea:k,preview:A,status:h,btnEdit:g,btnPreview:v,btnReload:C,btnSave:w,close:()=>{d=null,i.close()}};d=M,k.addEventListener(`input`,()=>{M.hasUnsavedChanges||(M.hasUnsavedChanges=!0,m(M,`Unsaved changes`),p(M))}),k.addEventListener(`keydown`,e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),b(M))}),f.addEventListener(`change`,()=>{let e=f.value;f.value=M.docPath,_(M,`Open another doc?`,()=>{y(M,e)})}),g.addEventListener(`click`,()=>x(M,`edit`)),v.addEventListener(`click`,()=>x(M,`preview`)),C.addEventListener(`click`,()=>{_(M,`Reload this doc?`,()=>{y(M,M.docPath)})}),w.addEventListener(`click`,()=>{b(M)}),T.addEventListener(`click`,r),y(M,n.path),M.mode===`edit`&&k.focus()}function w(e){d&&d.sessionId===e&&(f(d),p(d),!s(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
1
+ import{o as e}from"./dom-helpers-I_SDCPvs.js";import{d as t}from"./control-ws-6Ix6WqG2.js";import{s as n,t as r}from"./action-status-C_hxjBXy.js";import{a as i,r as a,t as o}from"./modal-BRwbyxA2.js";import{di as s,yn as c}from"./index-BkXoTulL.js";import{i as l,t as u}from"./plan-render-C5S7ifor.js";var d=null;function f(t){let n=s(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=s(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){i({title:e,message:`Your unsaved edits will be lost.`,confirmLabel:`Discard`,danger:!0,onConfirm:t})}function _(e,t,n){e.hasUnsavedChanges?g(t,n):n()}async function v(e,i){try{return{reply:await t(e,i,{timeoutMs:r}),failureText:null}}catch(e){return{reply:null,failureText:n(e,r)}}}async function y(e,t){e.docPath=t,e.isBusy=!0,e.baseHash=null,e.textarea.readOnly=!0,f(e),m(e,`Loading`),p(e);let{reply:n,failureText:r}=await v(`session-doc-read`,{id:e.sessionId,path:t});if(d!==e||e.docPath!==t)return;e.isBusy=!1,e.textarea.readOnly=!1;let i=n?.type===`session-doc-response`?n:null;!i?.ok||i.text===void 0||i.hash===void 0?(m(e,i?.error||r||`Could not open this doc`,`warn`),p(e)):(e.textarea.value=i.text,e.baseHash=i.hash,e.hasUnsavedChanges=!1,e.mode===`preview`&&h(e),m(e,``),p(e))}async function b(e){if(e.btnSave.disabled||e.baseHash===null)return;e.isBusy=!0,m(e,`Saving`),p(e);let t=e.docPath,n=e.textarea.value,{reply:r,failureText:i}=await v(`session-doc-save`,{id:e.sessionId,path:t,text:n,baseHash:e.baseHash});if(d!==e||e.docPath!==t)return;e.isBusy=!1;let a=r?.type===`session-doc-save-result`?r:null;!a?.ok||a.hash===void 0?(m(e,a?.conflict?`The agent changed this file since you opened it. Reload to see its version.`:a?.error||i||`Save failed`,`warn`),p(e)):(e.baseHash=a.hash,e.hasUnsavedChanges=e.textarea.value!==n,m(e,e.hasUnsavedChanges?`Unsaved changes`:`Saved`),p(e))}function x(e,t){e.mode=t,t===`preview`&&h(e),p(e),t===`edit`&&e.textarea.focus()}function S(t,n){let r=e(`button`,`plan-control ${n}`,t);return r.type=`button`,r}function C(t){let n=s(t)[0];if(!n||d)return;let r=()=>_(M,`Close this doc?`,()=>M.close()),i=a({dialogClass:`doc-editor`,closeOnBackdrop:!1,onEscape:r}),l=`doc-editor-title-${t}`,u=e(`h3`,`doc-editor-title`,n.name);u.id=l;let f=e(`select`,`plan-control doc-editor-picker`);f.setAttribute(`aria-label`,`Doc`);let h=e(`span`,`doc-editor-status`);h.setAttribute(`role`,`status`);let g=S(`Edit`,`doc-editor-mode`),v=S(`Preview`,`doc-editor-mode`),C=S(`Reload`,`doc-editor-reload`),w=S(`Save`,`doc-editor-save`),T=S(`Close`,`doc-editor-close`),E=e(`div`,`doc-editor-modes`);E.append(g,v);let D=e(`div`,`doc-editor-actions`);D.append(h,C,w,T);let O=e(`div`,`doc-editor-header`);O.append(u,f,E,D);let k=e(`textarea`,`plan-editor doc-editor-text`);k.spellcheck=!0,k.setAttribute(`aria-labelledby`,l);let A=e(`div`,`doc-editor-preview`),j=e(`div`,`doc-editor-body`);j.append(k,A),i.dialog.append(O,j),o(i.dialog,l);let M={sessionId:t,docPath:n.path,baseHash:null,hasUnsavedChanges:!1,isBusy:!1,mode:c()?`preview`:`edit`,title:u,select:f,textarea:k,preview:A,status:h,btnEdit:g,btnPreview:v,btnReload:C,btnSave:w,close:()=>{d=null,i.close()}};d=M,k.addEventListener(`input`,()=>{M.hasUnsavedChanges||(M.hasUnsavedChanges=!0,m(M,`Unsaved changes`),p(M))}),k.addEventListener(`keydown`,e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),b(M))}),f.addEventListener(`change`,()=>{let e=f.value;f.value=M.docPath,_(M,`Open another doc?`,()=>{y(M,e)})}),g.addEventListener(`click`,()=>x(M,`edit`)),v.addEventListener(`click`,()=>x(M,`preview`)),C.addEventListener(`click`,()=>{_(M,`Reload this doc?`,()=>{y(M,M.docPath)})}),w.addEventListener(`click`,()=>{b(M)}),T.addEventListener(`click`,r),y(M,n.path),M.mode===`edit`&&k.focus()}function w(e){d&&d.sessionId===e&&(f(d),p(d),!s(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
@@ -1 +1 @@
1
- import{gt as e}from"./updates-view-core-DodtnH3A.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{u as n}from"./control-ws-6Ix6WqG2.js";import{bt as r}from"./ui-prefs-D3IzhnZj.js";import{An as i,_i as a,gi as o,i as s,kn as c}from"./index-cS813iUS.js";var l={teamReview:e=>`${e} pull requests reviewed this week. Reviews lines up every PR waiting on you, and it is off right now.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them, and it is off right now.`,usage:()=>`Keeping an eye on tokens? Usage tracks spend per session and warns before a limit hits, and it is off right now.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you, and it is off right now.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side, and it is off right now.`};function u(e){return`${l[e.feature](e.distinctTargetCount)} Show me takes you to its switch in Settings.`}function d(e){let t=s.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var f=null;function p(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function m(e){try{return i(localStorage,c(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function h(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=d(t);r&&n.openSetting(r.sectionId,r.settingId)}function g(e,n){if(f?.isConnected||!m(e))return;let i=t(`aside`,`feature-hint`);i.setAttribute(`aria-live`,`polite`),i.setAttribute(`aria-label`,`Feature tip`);let s=t(`div`,`feature-hint-bubble`),c=t(`button`,`btn-dialog btn-dialog-confirm`,`Show me`),l=t(`button`,`btn-dialog btn-dialog-cancel`,`Nah`);c.type=`button`,l.type=`button`;let d=t(`div`,`feature-hint-actions`);d.append(l,c),s.append(t(`p`,`feature-hint-text`,u(e)),d);let g=a()??r[0];i.append(s,o(g,`feature-hint-animal`));function _(t){p(e.feature,t),i.remove(),f=null}c.addEventListener(`click`,()=>{_(`open`),h(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(i),f=i,p(e.feature,`shown`)}export{g as showFeatureHint};
1
+ import{gt as e}from"./updates-view-core-DodtnH3A.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{u as n}from"./control-ws-6Ix6WqG2.js";import{bt as r}from"./ui-prefs-D3IzhnZj.js";import{An as i,_i as a,gi as o,i as s,kn as c}from"./index-BkXoTulL.js";var l={teamReview:e=>`${e} pull requests reviewed this week. Reviews lines up every PR waiting on you, and it is off right now.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them, and it is off right now.`,usage:()=>`Keeping an eye on tokens? Usage tracks spend per session and warns before a limit hits, and it is off right now.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you, and it is off right now.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side, and it is off right now.`};function u(e){return`${l[e.feature](e.distinctTargetCount)} Show me takes you to its switch in Settings.`}function d(e){let t=s.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var f=null;function p(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function m(e){try{return i(localStorage,c(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function h(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=d(t);r&&n.openSetting(r.sectionId,r.settingId)}function g(e,n){if(f?.isConnected||!m(e))return;let i=t(`aside`,`feature-hint`);i.setAttribute(`aria-live`,`polite`),i.setAttribute(`aria-label`,`Feature tip`);let s=t(`div`,`feature-hint-bubble`),c=t(`button`,`btn-dialog btn-dialog-confirm`,`Show me`),l=t(`button`,`btn-dialog btn-dialog-cancel`,`Nah`);c.type=`button`,l.type=`button`;let d=t(`div`,`feature-hint-actions`);d.append(l,c),s.append(t(`p`,`feature-hint-text`,u(e)),d);let g=a()??r[0];i.append(s,o(g,`feature-hint-animal`));function _(t){p(e.feature,t),i.remove(),f=null}c.addEventListener(`click`,()=>{_(`open`),h(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(i),f=i,p(e.feature,`shown`)}export{g as showFeatureHint};