glimmervoid 0.48.2-next.327 → 0.48.2-next.329

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 (113) hide show
  1. package/dist/bin/glimmervoid.js +8 -8
  2. package/dist/chunks/{adapters-DHBg5a1U.js → adapters-BLwLbCbP.js} +2 -2
  3. package/dist/chunks/{adapters-ybe8U5A9.js → adapters-SWcaMeiS.js} +1 -1
  4. package/dist/chunks/{agent-api-cli-7nA6bFKo.js → agent-api-cli-C8Lt6Lke.js} +1 -1
  5. package/dist/chunks/{agent-api-cli-BujQi0eW.js → agent-api-cli-wZDMb0MI.js} +1 -1
  6. package/dist/chunks/{agent-api-core-CJNGGV_x.js → agent-api-core-DzpmMNi8.js} +1 -1
  7. package/dist/chunks/{build-channel-gWrx6n1v.js → build-channel-CuS5bnD6.js} +1 -1
  8. package/dist/chunks/{config-D3lqEm6E.js → config-BGRSF5X2.js} +3 -2
  9. package/dist/chunks/config-store-CNX_oZTd.js +1 -0
  10. package/dist/chunks/{config-store-CLi-efj8.js → config-store-D5RoJ_zB.js} +2 -2
  11. package/dist/chunks/{main-D_aeEHz4.js → main-C010jfJ0.js} +7 -8
  12. package/dist/chunks/{pair-cli-BzEL9ZmN.js → pair-cli-CEnZQWHm.js} +2 -2
  13. package/dist/chunks/{remote-config-D1QDGYt9.js → remote-config-Swfcj7a-.js} +1 -1
  14. package/dist/chunks/{settings-cli-B9ZQmURc.js → settings-cli-D8_UvDMg.js} +4 -4
  15. package/dist/chunks/{settings-readout-core-atYka8Qf.js → settings-readout-core-CQKHLWc6.js} +1 -1
  16. package/dist/chunks/{ssh-sign-cli-3-_rbQ2N.js → ssh-sign-cli-C1dOd8_x.js} +1 -1
  17. package/dist/client/assets/{benchmark-panel-C_Gse5iL.js → benchmark-panel-BAebHhl4.js} +1 -1
  18. package/dist/client/assets/benchmark-panel-BAebHhl4.js.br +0 -0
  19. package/dist/client/assets/{boards-view-CAcwqhHE.js → boards-view-LYNDs48E.js} +1 -1
  20. package/dist/client/assets/boards-view-LYNDs48E.js.br +0 -0
  21. package/dist/client/assets/{celebration-player-BV8Jvx23.js → celebration-player-D1BA5v2y.js} +1 -1
  22. package/dist/client/assets/celebration-player-D1BA5v2y.js.br +0 -0
  23. package/dist/client/assets/community-panel-Cbv_T15f.js +1 -0
  24. package/dist/client/assets/community-panel-Cbv_T15f.js.br +0 -0
  25. package/dist/client/assets/{dialogs-BZZIn-8v.js → dialogs-C-viI_l_.js} +1 -1
  26. package/dist/client/assets/dialogs-C-viI_l_.js.br +0 -0
  27. package/dist/client/assets/{doc-editor-ui-CdGIlor1.js → doc-editor-ui-_ObfPd5p.js} +1 -1
  28. package/dist/client/assets/doc-editor-ui-_ObfPd5p.js.br +0 -0
  29. package/dist/client/assets/{feature-hint-CC2fcnfq.js → feature-hint-DpVOUiwc.js} +1 -1
  30. package/dist/client/assets/feature-hint-DpVOUiwc.js.br +0 -0
  31. package/dist/client/assets/{first-run-checklist-Bzl1CNo7.js → first-run-checklist-DGkkbXiM.js} +1 -1
  32. package/dist/client/assets/first-run-checklist-DGkkbXiM.js.br +0 -0
  33. package/dist/client/assets/{hooks-panel-CG798WN5.js → hooks-panel-H_t9Gbii.js} +1 -1
  34. package/dist/client/assets/hooks-panel-H_t9Gbii.js.br +0 -0
  35. package/dist/client/assets/{index-BYFp_DgZ.js → index-BJ26BQYS.js} +7 -7
  36. package/dist/client/assets/index-BJ26BQYS.js.br +0 -0
  37. package/dist/client/assets/index-DHuCeA_8.css +2 -0
  38. package/dist/client/assets/index-DHuCeA_8.css.br +0 -0
  39. package/dist/client/assets/{issues-panel-ZAMT1H59.js → issues-panel-BZOT8YdE.js} +1 -1
  40. package/dist/client/assets/issues-panel-BZOT8YdE.js.br +0 -0
  41. package/dist/client/assets/{my-prs-panel-DLlIpt1A.js → my-prs-panel-BNeFaJRN.js} +1 -1
  42. package/dist/client/assets/my-prs-panel-BNeFaJRN.js.br +0 -0
  43. package/dist/client/assets/nyan-cat-CmmeLnLK.js +1 -0
  44. package/dist/client/assets/nyan-cat-CmmeLnLK.js.br +0 -0
  45. package/dist/client/assets/{phone-shell-CgOPfQJ_.js → phone-shell-DMWN85QP.js} +1 -1
  46. package/dist/client/assets/phone-shell-DMWN85QP.js.br +0 -0
  47. package/dist/client/assets/{plan-face-CKkZUTSA.js → plan-face-BmOL0gv9.js} +1 -1
  48. package/dist/client/assets/plan-face-BmOL0gv9.js.br +0 -0
  49. package/dist/client/assets/{plan-render-lfFoZt5H.js → plan-render-m6nfNau2.js} +1 -1
  50. package/dist/client/assets/plan-render-m6nfNau2.js.br +0 -0
  51. package/dist/client/assets/pr-queue-columns-DnhAnqNk.js +1 -0
  52. package/dist/client/assets/pr-queue-columns-DnhAnqNk.js.br +0 -0
  53. package/dist/client/assets/{radar-panel-DA99gsvm.js → radar-panel-CQS_lYWu.js} +1 -1
  54. package/dist/client/assets/radar-panel-CQS_lYWu.js.br +0 -0
  55. package/dist/client/assets/{repo-roots-adder-px00Suyi.js → repo-roots-adder-BGGYIVvP.js} +1 -1
  56. package/dist/client/assets/repo-roots-adder-BGGYIVvP.js.br +0 -0
  57. package/dist/client/assets/{resume-dialog-DM855VrQ.js → resume-dialog-C2zmUGtp.js} +1 -1
  58. package/dist/client/assets/resume-dialog-C2zmUGtp.js.br +0 -0
  59. package/dist/client/assets/{review-queue-panel-Bua5KOCl.js → review-queue-panel-CvUSpkP9.js} +1 -1
  60. package/dist/client/assets/review-queue-panel-CvUSpkP9.js.br +0 -0
  61. package/dist/client/assets/{settings-panel-B4BZDlCY.js → settings-panel-qKYysWfU.js} +3 -3
  62. package/dist/client/assets/settings-panel-qKYysWfU.js.br +0 -0
  63. package/dist/client/assets/{shown-lightbox-CiOMawcO.js → shown-lightbox-D91m8yJp.js} +1 -1
  64. package/dist/client/assets/shown-lightbox-D91m8yJp.js.br +0 -0
  65. package/dist/client/assets/team-review-panel-stCHoIyl.js +10 -0
  66. package/dist/client/assets/team-review-panel-stCHoIyl.js.br +0 -0
  67. package/dist/client/assets/{trace-panel-B8LZ8WnV.js → trace-panel-CrhOWt5N.js} +1 -1
  68. package/dist/client/assets/trace-panel-CrhOWt5N.js.br +0 -0
  69. package/dist/client/assets/{ui-prefs-DfBm2IRm.js → ui-prefs-CiiqXyOk.js} +1 -1
  70. package/dist/client/assets/ui-prefs-CiiqXyOk.js.br +0 -0
  71. package/dist/client/assets/{usage-panel-CsmyQYBI.js → usage-panel-DD68fNAx.js} +1 -1
  72. package/dist/client/assets/usage-panel-DD68fNAx.js.br +0 -0
  73. package/dist/client/assets/{your-day-tip-DUNJlCcH.js → your-day-tip-CJor8cga.js} +1 -1
  74. package/dist/client/assets/your-day-tip-CJor8cga.js.br +0 -0
  75. package/dist/client/index.html +3 -3
  76. package/dist/client/index.html.br +0 -0
  77. package/dist/server/index.js +1 -1
  78. package/package.json +1 -1
  79. package/dist/chunks/config-store-BCQO3eaR.js +0 -1
  80. package/dist/client/assets/benchmark-panel-C_Gse5iL.js.br +0 -0
  81. package/dist/client/assets/boards-view-CAcwqhHE.js.br +0 -0
  82. package/dist/client/assets/celebration-player-BV8Jvx23.js.br +0 -0
  83. package/dist/client/assets/community-panel-Dkg0SytX.js +0 -1
  84. package/dist/client/assets/community-panel-Dkg0SytX.js.br +0 -0
  85. package/dist/client/assets/dialogs-BZZIn-8v.js.br +0 -0
  86. package/dist/client/assets/doc-editor-ui-CdGIlor1.js.br +0 -0
  87. package/dist/client/assets/feature-hint-CC2fcnfq.js.br +0 -0
  88. package/dist/client/assets/first-run-checklist-Bzl1CNo7.js.br +0 -0
  89. package/dist/client/assets/hooks-panel-CG798WN5.js.br +0 -0
  90. package/dist/client/assets/index-BYFp_DgZ.js.br +0 -0
  91. package/dist/client/assets/index-tGQtcu5X.css +0 -2
  92. package/dist/client/assets/index-tGQtcu5X.css.br +0 -0
  93. package/dist/client/assets/issues-panel-ZAMT1H59.js.br +0 -0
  94. package/dist/client/assets/my-prs-panel-DLlIpt1A.js.br +0 -0
  95. package/dist/client/assets/nyan-cat-DjrvMyjI.js +0 -1
  96. package/dist/client/assets/nyan-cat-DjrvMyjI.js.br +0 -0
  97. package/dist/client/assets/phone-shell-CgOPfQJ_.js.br +0 -0
  98. package/dist/client/assets/plan-face-CKkZUTSA.js.br +0 -0
  99. package/dist/client/assets/plan-render-lfFoZt5H.js.br +0 -0
  100. package/dist/client/assets/pr-queue-columns-C5ZmQH_2.js +0 -1
  101. package/dist/client/assets/pr-queue-columns-C5ZmQH_2.js.br +0 -0
  102. package/dist/client/assets/radar-panel-DA99gsvm.js.br +0 -0
  103. package/dist/client/assets/repo-roots-adder-px00Suyi.js.br +0 -0
  104. package/dist/client/assets/resume-dialog-DM855VrQ.js.br +0 -0
  105. package/dist/client/assets/review-queue-panel-Bua5KOCl.js.br +0 -0
  106. package/dist/client/assets/settings-panel-B4BZDlCY.js.br +0 -0
  107. package/dist/client/assets/shown-lightbox-CiOMawcO.js.br +0 -0
  108. package/dist/client/assets/team-review-panel-DFbprUPS.js +0 -10
  109. package/dist/client/assets/team-review-panel-DFbprUPS.js.br +0 -0
  110. package/dist/client/assets/trace-panel-B8LZ8WnV.js.br +0 -0
  111. package/dist/client/assets/ui-prefs-DfBm2IRm.js.br +0 -0
  112. package/dist/client/assets/usage-panel-CsmyQYBI.js.br +0 -0
  113. package/dist/client/assets/your-day-tip-DUNJlCcH.js.br +0 -0
@@ -5,7 +5,7 @@ import { a as packageRoot } from "../chunks/runtime-paths-D_ZjJLE0.js";
5
5
  import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
6
6
  import { t as AGENT_API_VERBS } from "../chunks/session-Cc-HBJIZ.js";
7
7
  import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
8
- import { J as isOwnedCommandName, Y as parseCommand, q as OWNED_COMMAND_SPECS, r as agentCommandHelpLines } from "../chunks/agent-api-core-CJNGGV_x.js";
8
+ import { J as isOwnedCommandName, Y as parseCommand, q as OWNED_COMMAND_SPECS, r as agentCommandHelpLines } from "../chunks/agent-api-core-DzpmMNi8.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-xS1GFU8P.js";
11
11
  import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
@@ -62,7 +62,7 @@ var OWNED_COMMAND_RUNNERS = {
62
62
  return 0;
63
63
  },
64
64
  pair: async ({ values }) => {
65
- const { runPairCli } = await import("../chunks/pair-cli-BzEL9ZmN.js");
65
+ const { runPairCli } = await import("../chunks/pair-cli-CEnZQWHm.js");
66
66
  return runPairCli({
67
67
  isListing: values.list === true,
68
68
  revokeDeviceId: typeof values.revoke === "string" ? values.revoke : null,
@@ -74,11 +74,11 @@ var OWNED_COMMAND_RUNNERS = {
74
74
  return runAgentSetupCli();
75
75
  },
76
76
  settings: async (parsed) => {
77
- const { runParsedSettingsCli } = await import("../chunks/settings-cli-B9ZQmURc.js");
77
+ const { runParsedSettingsCli } = await import("../chunks/settings-cli-D8_UvDMg.js");
78
78
  return runParsedSettingsCli(parsed);
79
79
  },
80
80
  "ssh-sign": async ({ rawArgs }) => {
81
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-3-_rbQ2N.js");
81
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-C1dOd8_x.js");
82
82
  return runSshSignCli(rawArgs);
83
83
  }
84
84
  };
@@ -100,7 +100,7 @@ async function runOwnedCommand(name, subcommandArgs) {
100
100
  return OWNED_COMMAND_RUNNERS[name](parsed);
101
101
  }
102
102
  var SUBCOMMAND_RUNNERS = new Map([...Object.keys(OWNED_COMMAND_SPECS).filter(isOwnedCommandName).map((name) => [name, (subcommandArgs) => runOwnedCommand(name, subcommandArgs)]), ...AGENT_API_VERBS.filter((verb) => !isOwnedCommandName(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
103
- const { runAgentApiCli } = await import("../chunks/agent-api-cli-7nA6bFKo.js");
103
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-C8Lt6Lke.js");
104
104
  return runAgentApiCli([subcommandName, ...subcommandArgs]);
105
105
  }])]);
106
106
  var AGENT_INSTALL_COMMAND_BY_ID = {
@@ -114,7 +114,7 @@ function missingAgentText(agentId) {
114
114
  }
115
115
  async function printSessionLimits() {
116
116
  if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
117
- const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-7nA6bFKo.js");
117
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-C8Lt6Lke.js");
118
118
  const limitsLines = await sessionLimitsHelpLines();
119
119
  console.log(`\n${limitsLines.join("\n")}`);
120
120
  }
@@ -171,7 +171,7 @@ async function readDeclaredCustomAgents() {
171
171
  declared: [],
172
172
  error: null
173
173
  };
174
- const { loadConfigFile } = await import("../chunks/config-store-BCQO3eaR.js");
174
+ const { loadConfigFile } = await import("../chunks/config-store-CNX_oZTd.js");
175
175
  try {
176
176
  const loaded = loadConfigFile(decided.path, { exitOnError: false });
177
177
  if (!loaded.config) return {
@@ -247,7 +247,7 @@ async function runDoctor() {
247
247
  }
248
248
  switchSection("Agents");
249
249
  try {
250
- const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-ybe8U5A9.js");
250
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-SWcaMeiS.js");
251
251
  const declaredCustomAgents = await readDeclaredCustomAgents();
252
252
  if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
253
253
  setCustomAgents(declaredCustomAgents.declared);
@@ -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-Cc-HBJIZ.js";
4
4
  import { c as spawn, i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
5
- import { Ot as UpdateChannel, S as InstallFlavor, c as SHELL_AGENT_ID } from "./config-D3lqEm6E.js";
5
+ import { S as InstallFlavor, c as SHELL_AGENT_ID, kt as UpdateChannel } from "./config-BGRSF5X2.js";
6
6
  import { o as supervisionLine } from "./session-routes-CyZVo7KV.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-Bjy1iYqZ.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-B2RMzXN-.js";
13
13
  import { O as nextBackoffMs } from "./json-file-AKRVPqG1.js";
14
- import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-gWrx6n1v.js";
14
+ import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-CuS5bnD6.js";
15
15
  import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-BUCUWtAv.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 +1 @@
1
- export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-DHBg5a1U.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-BLwLbCbP.js";
@@ -1 +1 @@
1
- export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-BujQi0eW.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-wZDMb0MI.js";
@@ -1,5 +1,5 @@
1
1
  import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-Cc-HBJIZ.js";
2
- import { Y as parseCommand, i as agentCommandSpec, m as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-CJNGGV_x.js";
2
+ import { Y as parseCommand, i as agentCommandSpec, m as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-DzpmMNi8.js";
3
3
  import { i as formatSessionLimits } from "./session-routes-CyZVo7KV.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";
@@ -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-Cc-HBJIZ.js";
2
- import { D as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-D3lqEm6E.js";
2
+ import { D as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-BGRSF5X2.js";
3
3
  import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-CyZVo7KV.js";
4
4
  import path from "node:path";
5
5
  import { parseArgs } from "node:util";
@@ -1,5 +1,5 @@
1
1
  import "./session-Cc-HBJIZ.js";
2
- import { C as ONBOARDING_STEPS, E as OPERATOR_SURFACES, T as OPERATOR_ACTIONS_BY_SURFACE, b as DASHBOARD_VIEWS, j as HintFeature, n as BUILTIN_AGENT_IDS, w as ONBOARDING_STEP_STATES } from "./config-D3lqEm6E.js";
2
+ import { C as ONBOARDING_STEPS, E as OPERATOR_SURFACES, T as OPERATOR_ACTIONS_BY_SURFACE, b as DASHBOARD_VIEWS, j as HintFeature, n as BUILTIN_AGENT_IDS, w as ONBOARDING_STEP_STATES } from "./config-BGRSF5X2.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"]);
@@ -701,6 +701,7 @@ var CommunityVerdict = z.enum([
701
701
  ]);
702
702
  var COMMUNITY_ITEM_KEY_RE = /^(forum|discord):[A-Za-z0-9_-]{1,128}$/;
703
703
  var DISCORD_CHANNEL_NAME_RE = /^[a-z0-9_-]{1,100}$/;
704
+ var SKILL_NAME_RE = /^[A-Za-z0-9:._-]{1,100}$/;
704
705
  var CommunityItem = z.strictObject({
705
706
  key: z.string().regex(COMMUNITY_ITEM_KEY_RE),
706
707
  source: CommunitySource,
@@ -2655,7 +2656,7 @@ var BenchmarksSettings = optionalObject("benchmarks", { enabled: optionalBoolean
2655
2656
  var IssuesSettings = optionalObject("issues", { enabled: optionalBoolean("issues.enabled") });
2656
2657
  var CommunitySettings = optionalObject("community", {
2657
2658
  enabled: optionalBoolean("community.enabled"),
2658
- skill: optionalString("community.skill", true),
2659
+ skill: optionalString("community.skill", true).refine((value) => value == null || !value || SKILL_NAME_RE.test(value), { message: "community.skill must be a skill name like answering-questions, made of letters, digits, colons, dots, underscores or dashes, with no leading /" }),
2659
2660
  projectId: optionalInteger("community.projectId", POSTHOG_PROJECT_ID_RANGE),
2660
2661
  intervalMinutes: optionalInteger("community.intervalMinutes", COMMUNITY_INTERVAL_MINUTES_RANGE),
2661
2662
  discordChannels: z.array(z.string({ error: "community.discordChannels must be an array of channel names" }).trim().regex(DISCORD_CHANNEL_NAME_RE, { error: "community.discordChannels entries must be Discord channel names like community-questions, lowercase with no #" }), { error: "community.discordChannels must be an array of channel names" }).optional()
@@ -3012,4 +3013,4 @@ function configIssueMessage(error) {
3012
3013
  return error.issues[0]?.message || "settings are invalid";
3013
3014
  }
3014
3015
  //#endregion
3015
- export { FLYING_ANIMALS_DEFAULTS as $, issuePullRequestStateFromGithub as $t, HINT_VIEW_BY_FEATURE as A, SessionSetup as At, MergedPrListing as B, PLAN_RESULT_HOOK_EVENT as Bt, ONBOARDING_STEPS as C, CommunityItem as Ct, pullRequestKeyFromReference as D, UPDATE_CHANNELS as Dt, OPERATOR_SURFACES as E, DISCORD_CHANNEL_NAME_RE as Et, BenchmarkJudgement as F, ChangeMap as Ft, GithubPrLightSearchNode as G, planTitle as Gt, PrCheckoutCaseInput as H, PlanDecision as Ht, BenchmarkRun as I, changeMapFactId as It, WorkflowCommentBody as J, IssueKey as Jt, GithubPrsFrame as K, GithubIssuePullRequestsRepository as Kt, BenchmarkStatus as L, PLAN_BODY_CAP_BYTES as Lt, BenchmarkActionRequest as M, TraceCheckpoint as Mt, BenchmarkCase as N, TraceRecord as Nt, FeatureHintState as O, UpdateChannel as Ot, BenchmarkId as P, CoherenceJournalOutput as Pt, COMMUNITY_INTERVAL_MINUTES_RANGE as Q, IssuesStatus as Qt, BenchmarkSuite as R, PLAN_HOOK_EVENT as Rt, InstallFlavor as S, CommunityDraft as St, OPERATOR_ACTIONS_BY_SURFACE as T, CommunityVerdict as Tt, GithubPrDetailNode as U, PlanRevision as Ut, MinedPrReviewData as V, PLAN_TOOL_NAME as Vt, GithubPrKey as W, parseExitPlanModeHookPayload as Wt, WorkflowsSettings as X, IssuesSearchResponse as Xt, WorkflowLabelName as Y, IssueUpdate as Yt, WorkflowsState as Z, IssuesState as Zt, CLIENT_LOG_TEXT_MAX_CHARS as _, USAGE_RETAIN_DAYS_RANGE as _t, ConfigUpdate as a, NON_NEGATIVE_NUMBER_RANGE as at, DASHBOARD_VIEWS as b, WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE as bt, SHELL_AGENT_ID as c, POSTHOG_FIX_TIMEOUT_RANGE as ct, BranchGcFileSettings as d, POSTHOG_TRAFFIC_MIN_USERS_RANGE as dt, FLYING_ANIMALS_DURATION_RANGE as et, USAGE_COST_MODES as f, POSTHOG_TRAFFIC_MULTIPLIER_RANGE as ft, CHANGES_WATCH_LEASE_MS as g, USAGE_INTEGER_RANGES as gt, CHANGES_POLL_INTERVAL_MS as h, USAGE_BUDGET_RANGE as ht, Config as i, MEMORY_RESERVE_MB_RANGE as it, HintFeature as j, MAX_RAW_LINE_CHARS as jt, HINT_FEATURES as k, UpdateJournal as kt, TASK_TITLE_SOURCE_PRIORITY as l, POSTHOG_PROJECT_ID_RANGE as lt, normalizeLegacyConfigNumbers as m, TASK_TITLE_TIMEOUT_RANGE as mt, BUILTIN_AGENT_IDS as n, FLYING_ANIMALS_SCALE_RANGE as nt, PersistedTaskTitle as o, PORT_RANGE as ot, USAGE_VENDOR_KEYS as p, REPLAY_BUFFER_KB_RANGE as pt, comparablePrKey as q, GithubIssueResponse as qt, BrowserConfig as r, KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE as rt, RUNTIME_CONFIG_SCALAR_KEYS as s, POSITIVE_NUMBER_RANGE as st, AGENT_ID_SHAPE_MESSAGE as t, FLYING_ANIMALS_GAP_RANGE as tt, configIssueMessage as u, POSTHOG_TRAFFIC_BASELINE_RANGE as ut, CONTROL_FRAME_MAX_BYTES as v, USAGE_SCAN_INTERVAL_RANGE as vt, ONBOARDING_STEP_STATES as w, CommunityState as wt, GithubTeam as x, CommunityActionRequest as xt, ClientMessage as y, WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE as yt, CommitComparison as z, PLAN_HOOK_OUTPUT_MAX_CHARS as zt };
3016
+ export { FLYING_ANIMALS_DEFAULTS as $, IssuesStatus as $t, HINT_VIEW_BY_FEATURE as A, UpdateJournal as At, MergedPrListing as B, PLAN_HOOK_OUTPUT_MAX_CHARS as Bt, ONBOARDING_STEPS as C, CommunityItem as Ct, pullRequestKeyFromReference as D, SKILL_NAME_RE as Dt, OPERATOR_SURFACES as E, DISCORD_CHANNEL_NAME_RE as Et, BenchmarkJudgement as F, CoherenceJournalOutput as Ft, GithubPrLightSearchNode as G, parseExitPlanModeHookPayload as Gt, PrCheckoutCaseInput as H, PLAN_TOOL_NAME as Ht, BenchmarkRun as I, ChangeMap as It, WorkflowCommentBody as J, GithubIssueResponse as Jt, GithubPrsFrame as K, planTitle as Kt, BenchmarkStatus as L, changeMapFactId as Lt, BenchmarkActionRequest as M, MAX_RAW_LINE_CHARS as Mt, BenchmarkCase as N, TraceCheckpoint as Nt, FeatureHintState as O, UPDATE_CHANNELS as Ot, BenchmarkId as P, TraceRecord as Pt, COMMUNITY_INTERVAL_MINUTES_RANGE as Q, IssuesState as Qt, BenchmarkSuite as R, PLAN_BODY_CAP_BYTES as Rt, InstallFlavor as S, CommunityDraft as St, OPERATOR_ACTIONS_BY_SURFACE as T, CommunityVerdict as Tt, GithubPrDetailNode as U, PlanDecision as Ut, MinedPrReviewData as V, PLAN_RESULT_HOOK_EVENT as Vt, GithubPrKey as W, PlanRevision as Wt, WorkflowsSettings as X, IssueUpdate as Xt, WorkflowLabelName as Y, IssueKey as Yt, WorkflowsState as Z, IssuesSearchResponse as Zt, CLIENT_LOG_TEXT_MAX_CHARS as _, USAGE_RETAIN_DAYS_RANGE as _t, ConfigUpdate as a, NON_NEGATIVE_NUMBER_RANGE as at, DASHBOARD_VIEWS as b, WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE as bt, SHELL_AGENT_ID as c, POSTHOG_FIX_TIMEOUT_RANGE as ct, BranchGcFileSettings as d, POSTHOG_TRAFFIC_MIN_USERS_RANGE as dt, issuePullRequestStateFromGithub as en, FLYING_ANIMALS_DURATION_RANGE as et, USAGE_COST_MODES as f, POSTHOG_TRAFFIC_MULTIPLIER_RANGE as ft, CHANGES_WATCH_LEASE_MS as g, USAGE_INTEGER_RANGES as gt, CHANGES_POLL_INTERVAL_MS as h, USAGE_BUDGET_RANGE as ht, Config as i, MEMORY_RESERVE_MB_RANGE as it, HintFeature as j, SessionSetup as jt, HINT_FEATURES as k, UpdateChannel as kt, TASK_TITLE_SOURCE_PRIORITY as l, POSTHOG_PROJECT_ID_RANGE as lt, normalizeLegacyConfigNumbers as m, TASK_TITLE_TIMEOUT_RANGE as mt, BUILTIN_AGENT_IDS as n, FLYING_ANIMALS_SCALE_RANGE as nt, PersistedTaskTitle as o, PORT_RANGE as ot, USAGE_VENDOR_KEYS as p, REPLAY_BUFFER_KB_RANGE as pt, comparablePrKey as q, GithubIssuePullRequestsRepository as qt, BrowserConfig as r, KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE as rt, RUNTIME_CONFIG_SCALAR_KEYS as s, POSITIVE_NUMBER_RANGE as st, AGENT_ID_SHAPE_MESSAGE as t, FLYING_ANIMALS_GAP_RANGE as tt, configIssueMessage as u, POSTHOG_TRAFFIC_BASELINE_RANGE as ut, CONTROL_FRAME_MAX_BYTES as v, USAGE_SCAN_INTERVAL_RANGE as vt, ONBOARDING_STEP_STATES as w, CommunityState as wt, GithubTeam as x, CommunityActionRequest as xt, ClientMessage as y, WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE as yt, CommitComparison as z, PLAN_HOOK_EVENT as zt };
@@ -0,0 +1 @@
1
+ export { c as loadConfigFile } from "./config-store-D5RoJ_zB.js";
@@ -1,10 +1,10 @@
1
1
  import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { a as packageRoot, l as equalsIgnoringCaseOnWindows } from "./runtime-paths-D_ZjJLE0.js";
3
3
  import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
4
- import { $ as FLYING_ANIMALS_DEFAULTS, Dt as UPDATE_CHANNELS, Q as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_RETAIN_DAYS_RANGE, at as NON_NEGATIVE_NUMBER_RANGE, bt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, ct as POSTHOG_FIX_TIMEOUT_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, et as FLYING_ANIMALS_DURATION_RANGE, f as USAGE_COST_MODES, ft as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, gt as USAGE_INTEGER_RANGES, ht as USAGE_BUDGET_RANGE, i as Config, it as MEMORY_RESERVE_MB_RANGE, lt as POSTHOG_PROJECT_ID_RANGE, m as normalizeLegacyConfigNumbers, mt as TASK_TITLE_TIMEOUT_RANGE, n as BUILTIN_AGENT_IDS, nt as FLYING_ANIMALS_SCALE_RANGE, ot as PORT_RANGE, pt as REPLAY_BUFFER_KB_RANGE, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSITIVE_NUMBER_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_GAP_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_BASELINE_RANGE, vt as USAGE_SCAN_INTERVAL_RANGE, yt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE } from "./config-D3lqEm6E.js";
4
+ import { $ as FLYING_ANIMALS_DEFAULTS, Ot as UPDATE_CHANNELS, Q as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_RETAIN_DAYS_RANGE, at as NON_NEGATIVE_NUMBER_RANGE, bt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, ct as POSTHOG_FIX_TIMEOUT_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, et as FLYING_ANIMALS_DURATION_RANGE, f as USAGE_COST_MODES, ft as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, gt as USAGE_INTEGER_RANGES, ht as USAGE_BUDGET_RANGE, i as Config, it as MEMORY_RESERVE_MB_RANGE, lt as POSTHOG_PROJECT_ID_RANGE, m as normalizeLegacyConfigNumbers, mt as TASK_TITLE_TIMEOUT_RANGE, n as BUILTIN_AGENT_IDS, nt as FLYING_ANIMALS_SCALE_RANGE, ot as PORT_RANGE, pt as REPLAY_BUFFER_KB_RANGE, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSITIVE_NUMBER_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_GAP_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_BASELINE_RANGE, vt as USAGE_SCAN_INTERVAL_RANGE, yt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE } from "./config-BGRSF5X2.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-gWrx6n1v.js";
7
+ import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-CuS5bnD6.js";
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
10
10
  import os from "node:os";
@@ -4,8 +4,8 @@ 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-Cc-HBJIZ.js";
6
6
  import { c as spawn, i as execFileSync, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BCOoKfxG.js";
7
- import { $t as issuePullRequestStateFromGithub, A as HINT_VIEW_BY_FEATURE, At as SessionSetup, B as MergedPrListing, Bt as PLAN_RESULT_HOOK_EVENT, Ct as CommunityItem, D as pullRequestKeyFromReference, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as ChangeMap, G as GithubPrLightSearchNode, Gt as planTitle, H as PrCheckoutCaseInput, Ht as PlanDecision, I as BenchmarkRun, It as changeMapFactId, J as WorkflowCommentBody, Jt as IssueKey, K as GithubPrsFrame, Kt as GithubIssuePullRequestsRepository, L as BenchmarkStatus, Lt as PLAN_BODY_CAP_BYTES, M as BenchmarkActionRequest, Mt as TraceCheckpoint, N as BenchmarkCase, Nt as TraceRecord, O as FeatureHintState, P as BenchmarkId, Pt as CoherenceJournalOutput, Qt as IssuesStatus, R as BenchmarkSuite, Rt as PLAN_HOOK_EVENT, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanRevision, V as MinedPrReviewData, Vt as PLAN_TOOL_NAME, W as GithubPrKey, Wt as parseExitPlanModeHookPayload, X as WorkflowsSettings, Xt as IssuesSearchResponse, Y as WorkflowLabelName, Yt as IssueUpdate, Z as WorkflowsState, Zt as IssuesState, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as MAX_RAW_LINE_CHARS, k as HINT_FEATURES, kt as UpdateJournal, p as USAGE_VENDOR_KEYS, q as comparablePrKey, qt as GithubIssueResponse, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_OUTPUT_MAX_CHARS } from "./config-D3lqEm6E.js";
8
- import { A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-CJNGGV_x.js";
7
+ import { $t as IssuesStatus, A as HINT_VIEW_BY_FEATURE, At as UpdateJournal, B as MergedPrListing, Bt as PLAN_HOOK_OUTPUT_MAX_CHARS, Ct as CommunityItem, D as pullRequestKeyFromReference, Dt as SKILL_NAME_RE, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as CoherenceJournalOutput, G as GithubPrLightSearchNode, Gt as parseExitPlanModeHookPayload, H as PrCheckoutCaseInput, Ht as PLAN_TOOL_NAME, I as BenchmarkRun, It as ChangeMap, J as WorkflowCommentBody, Jt as GithubIssueResponse, K as GithubPrsFrame, Kt as planTitle, L as BenchmarkStatus, Lt as changeMapFactId, M as BenchmarkActionRequest, Mt as MAX_RAW_LINE_CHARS, N as BenchmarkCase, Nt as TraceCheckpoint, O as FeatureHintState, P as BenchmarkId, Pt as TraceRecord, Qt as IssuesState, R as BenchmarkSuite, Rt as PLAN_BODY_CAP_BYTES, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanDecision, V as MinedPrReviewData, Vt as PLAN_RESULT_HOOK_EVENT, W as GithubPrKey, Wt as PlanRevision, X as WorkflowsSettings, Xt as IssueUpdate, Y as WorkflowLabelName, Yt as IssueKey, Z as WorkflowsState, Zt as IssuesSearchResponse, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, en as issuePullRequestStateFromGithub, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as SessionSetup, k as HINT_FEATURES, p as USAGE_VENDOR_KEYS, q as comparablePrKey, qt as GithubIssuePullRequestsRepository, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_EVENT } from "./config-BGRSF5X2.js";
8
+ import { A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-DzpmMNi8.js";
9
9
  import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-CyZVo7KV.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-xS1GFU8P.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-CWrkgcoQ.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-CLi-efj8.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-gWrx6n1v.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-D5RoJ_zB.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-CuS5bnD6.js";
22
22
  import { i as resolveArgvCommandMatches } from "./kimi-BUCUWtAv.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-DHBg5a1U.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-BLwLbCbP.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-D1QDGYt9.js";
28
- import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-atYka8Qf.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-Swfcj7a-.js";
28
+ import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-CQKHLWc6.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";
@@ -33411,7 +33411,6 @@ var COMMUNITY_REPORT_HEADINGS = [
33411
33411
  var MAX_REPORT_TEXT_CHARS = 4e3;
33412
33412
  var MAX_REPORT_BULLETS = 50;
33413
33413
  var MAX_REPORT_BULLET_CHARS = 1e3;
33414
- var SKILL_NAME_RE = /^[A-Za-z0-9:._-]{1,100}$/;
33415
33414
  var DISCORD_SNOWFLAKE_RE = /^\d{1,30}$/;
33416
33415
  var DISCORD_CHANNEL_URL = "https://discord.com/channels/";
33417
33416
  var DISCORD_AUTHOR = "Discord member";
@@ -1,6 +1,6 @@
1
1
  import { r as errorMessage } from "./text-DoirglWV.js";
2
- import { l as resolveConfigPath } from "./config-store-CLi-efj8.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-D1QDGYt9.js";
2
+ import { l as resolveConfigPath } from "./config-store-D5RoJ_zB.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-Swfcj7a-.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-CLi-efj8.js";
5
+ import { ct as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-D5RoJ_zB.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-Cc-HBJIZ.js";
4
- import { r as BrowserConfig } from "./config-D3lqEm6E.js";
4
+ import { r as BrowserConfig } from "./config-BGRSF5X2.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-CLi-efj8.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-atYka8Qf.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-D5RoJ_zB.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-CQKHLWc6.js";
9
9
  import fs from "node:fs";
10
10
  import os from "node:os";
11
11
  //#region server/settings-cli.ts
@@ -303,7 +303,7 @@ function runParsedSettingsCommand(parsed, io) {
303
303
  async function runParsedSettingsCli(parsed, io = processIo()) {
304
304
  const serverRequest = settingsRequestForServer(parsed, process.env);
305
305
  if (!serverRequest) return runParsedSettingsCommand(parsed, io);
306
- const { askAgentApi } = await import("./agent-api-cli-7nA6bFKo.js");
306
+ const { askAgentApi } = await import("./agent-api-cli-C8Lt6Lke.js");
307
307
  const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
308
308
  ok: false,
309
309
  error: errorMessage(error)
@@ -1,6 +1,6 @@
1
1
  import { h as AgentSettingsRequest } from "./session-Cc-HBJIZ.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-CLi-efj8.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-D5RoJ_zB.js";
4
4
  //#region server/core/settings-readout-core.ts
5
5
  var VALUE_COLUMN_WIDTH = 40;
6
6
  var SECTION_BY_SETTING_ID = new Map([...SETTINGS_REGISTRY.sections.flatMap((section) => section.settings.map((setting) => [setting.id, {
@@ -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-Cc-HBJIZ.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-BujQi0eW.js";
5
+ import { n as postToAgentIngress } from "./agent-api-cli-wZDMb0MI.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-C8XDTgVm.js";import{n as e,r as t,s as n}from"./dom-helpers-DBbFg1c_.js";import{$ as r,Q as i,et as a}from"./index-BYFp_DgZ.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,i){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,r.title),t(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),t(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),t(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=n(`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=n(`span`,`bench-status`,(a?``:`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(n(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,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:t}=i(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};
1
+ import"./updates-view-core-C8XDTgVm.js";import{n as e,r as t,s as n}from"./dom-helpers-DBbFg1c_.js";import{$ as r,Q as i,et as a}from"./index-BJ26BQYS.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,i){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,r.title),t(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),t(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),t(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=n(`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=n(`span`,`bench-status`,(a?``:`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(n(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,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:t}=i(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};
@@ -1 +1 @@
1
- import{yt as e}from"./updates-view-core-C8XDTgVm.js";import{s as t}from"./dom-helpers-DBbFg1c_.js";import{a as n,r}from"./card-registry-D5FILlqB.js";import{i}from"./action-status-2TEW4EL2.js";import{a,n as o}from"./modal-USMHOKBI.js";import{ai as s,bi as c,ci as l,ei as u,ii as d,li as f,ni as p,oi as m,ri as h,si as g,ti as _,xi as v,yi as y}from"./index-BYFp_DgZ.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),c=r*o;s={x:t.x-(c-t.width)/2,y:t.y,width:c,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 T(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 ae(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 oe(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?ae(c):c?.kind===`drag`&&c.pointerId===e.pointerId?w(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&T(c,e))}async function se(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 ce(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?se(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&S()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||g(new Set)))}function le(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function E(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 D(){let e=l;l=null,e?.remove()}function ue(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;D();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(),D(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();D(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,D),d.focus(),d.select()}function de(e){if(S())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&ue(t.id)}function fe(){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 pe(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),fe()):e.key===`Escape`&&g(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,C),n.addEventListener(`pointermove`,oe),n.addEventListener(`pointerup`,ce),n.addEventListener(`pointercancel`,le),n.addEventListener(`wheel`,E,{passive:!1}),n.addEventListener(`dblclick`,de),n.addEventListener(`keydown`,pe),{fit:d,selectedIds:()=>o,clearSelection:()=>g(new Set),pruneSelection:v,closeTitleInput:D}}var C=40,w=220,T=90,ae=30,oe=20,se=18,ce=20,le=26,E=18,D=26,ue=170,de=21,fe=17,pe=10,O=22,me=24,he=16,ge=24,_e=8,ve=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function k(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 ye(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:ve[n.color]}:null}function be(e,t){let n=k(t.title,ce),r=t.lines.flatMap(e=>k(e.text,le-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ye(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*oe+r.length*se+(i?26:0)}}function A(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function xe(e){let t=k(e.text,de);return{lines:t,height:24+(t.length+1)*fe}}function Se(e){let t=new Map;for(let n of A(e,`note`)){let e=t.get(n.on),r=xe(n).height;t.set(n.on,e===void 0?r:e+pe+r)}return t}function Ce(e){return e.columns.map(e=>e.title?k(e.title,me):[])}function we(e){return(Math.max(1,...e.map(e=>e.length))-1)*he}function Te(e,t){let n=new Set(A(e,`box`).filter(e=>!e.at&&t.has(e.id)).map(e=>e.column)),r=[],i=C;for(let t of e.columns)r.push(i),i+=w+(n.has(t.id)?Math.max(T,186):T);return r}function Ee(e){let t=new Map;for(let n of A(e,`frame`))for(let e of n.contains)t.has(e)||t.set(e,n.id);return t}function De(e,t){return e===t?0:(e?E:0)+(t?44:0)}function Oe(e,t,n,r){let i=new Map,a=new Map,o=new Map,s=Ee(e),c=A(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:l}of c){let c=Math.max(0,e.columns.findIndex(e=>e.id===l.column)),u=be(e,l),d=s.get(l.id)??null,f=(a.get(l.column)??n)+De(o.get(l.column)??null,d),p=l.at??{x:t[c]??C,y:f};if(!l.at){let e=(r.get(l.id)??0)-_e;a.set(l.column,f+Math.max(u.height,e)+ae),o.set(l.column,d)}i.set(l.id,{kind:`box`,id:l.id,x:p.x,y:p.y,width:w,height:u.height,titleLines:u.titleLines,bodyLines:u.bodyLines,lane:u.lane,isGhost:l.ghost})}return i}function ke(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 Ae(e,t){return A(e,`frame`).flatMap(e=>{let n=ke(e.contains.flatMap(e=>t.get(e)??[]));return n?[{kind:`frame`,id:e.id,title:e.title,x:n.x-E,y:n.y-E-D,width:n.width+36,height:n.height+36+D}]:[]})}function je(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 Me(e,t){return A(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=je(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 Ne(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function Pe(e,t){let n=new Map;return A(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let{lines:i,height:a}=xe(e),o=n.get(e.on)??r.y-_e;return n.set(e.on,o+a+pe),[{kind:`note`,id:e.id,x:r.x+r.width-ge,y:o,width:ue,height:a,lines:i,byline:Ne(e),isResolved:e.resolvedBy!==null}]})}function Fe(e,t,n){let r=e.flatMap(e=>e.kind===`wire`?[]:[e]),i=(t.at(-1)??C)+w,a=ke([...r,{x:0,y:0,width:i,height:n}]);return a?{x:Math.min(0,a.x-C),y:Math.min(0,a.y-C),width:a.width+80,height:a.height+80}:{x:0,y:0,width:i+C,height:80}}function Ie(e){let t=Se(e),n=Te(e,t),r=Ce(e),i=we(r),a=84+i,o=Oe(e,n,a,t),s=[...Ae(e,o),...Me(e,o),...o.values(),...Pe(e,o)],c=Fe(s,n,a),l=c.y+c.height,u=e.lanes.map((e,t)=>({label:e.label||e.id,hex:ve[e.color],x:C,y:l+t*O})),d=l+u.length*O+(u.length>0?12:0),f=e.caption?{text:e.caption,x:C,y:d}:null,p=u.length*O+(f?30:0)+(u.length>0?12:0);return{columns:e.columns.map((e,t)=>({id:e.id,titleLines:r[t]??[],titleBaselineY:56,ruleY:66+i,x:n[t]??C,width:w})),elements:s,legend:u,caption:f,bounds:{...c,height:c.height+p}}}function Le(e){return JSON.stringify(e)}var Re=`http://www.w3.org/2000/svg`,j=12,ze=26,Be=20,Ve=18,He=17,Ue=14,We=16;function M(e,t={},n=``){let r=document.createElementNS(Re,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 Ge(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+ze+r*Be,`wb-box-title`))});let r=e.y+ze+e.titleLines.length*Be;if(e.bodyLines.forEach((n,i)=>{let a=e.x+j+(n.muted?Ue:0);t.append(N(n.text,a,r+i*Ve,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 Ke(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 qe(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 Je(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*He,`wb-note-text`))}),e.byline&&t.append(N(e.byline,e.x+10,e.y+22+e.lines.length*He,`wb-note-byline`)),t}var Ye={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},Xe=[`box`,`frame`,`wire`,`note`];function Ze(e){switch(e.kind){case`box`:return Ge(e);case`frame`:return Ke(e);case`wire`:return qe(e);case`note`:return Je(e)}}function Qe(e){let t=M(`g`,{},`wb-chrome`);for(let n of e.columns)n.titleLines.length!==0&&(n.titleLines.forEach((e,r)=>{t.append(N(e,n.x,n.titleBaselineY+r*We,`wb-column-title`))}),t.append(M(`line`,{x1:n.x,y1:n.ruleY,x2:n.x+n.width,y2:n.ruleY},`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 $e(){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 et(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($e(),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=Ie(e),s=Qe(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=Le(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Ze(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[Ye[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=Xe.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 tt=`http://www.w3.org/2000/svg`,nt=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,rt=`Pick a board above.`,F=null,I=null,L=null,R=null,it=!0,z=null,B=i(`action-status wb-status`),V=i(`action-status wb-status`);function H(e){let{dialog:n,close:r,actions:i,btnCancel:a}=o({title:e.title}),s=t(`input`,`dialog-input`);s.type=`text`,s.placeholder=e.placeholder,s.maxLength=e.maxLength,s.value=e.initialValue??``,s.autocomplete=`off`,s.setAttribute(`aria-label`,e.label);let c=t(`div`,`dialog-error`);c.setAttribute(`role`,`alert`);let l=e.choices?t(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let n of e.choices.options){let e=t(`option`,null,n.text);e.value=n.value,l.append(e)}}let u=t(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,i.append(u),n.append(t(`label`,`dialog-label`,e.label),s,...l?[l]:[],c,i);async function d(){let t=s.value.trim();if(!t){c.textContent=`${e.label} is empty.`;return}u.disabled=!0;let n=await e.onSubmit(t,l?.value??null);u.disabled=!1,n?c.textContent=n:r()}a.addEventListener(`click`,r),u.addEventListener(`click`,()=>void d()),s.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>s.focus())}function U(){return F?g(F):null}function W(){return u().find(e=>e.id===F)??null}async function at(e){if(!F||e.length===0)return!1;let t=await l(F,e);return t.ok?(B.clear(),!0):(B.show(`error`,t.error),!1)}async function G(e){if(!F)return`No board is open.`;let t=await l(F,e);return t.ok?null:t.error}function K(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=U();return[...R?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!I)return;let e=U(),t=q(`box`).length,n=R?.selectedIds().size??0;I.buttons.box.disabled=!e,I.buttons.wire.disabled=t!==2,I.buttons.note.disabled=t!==1,I.buttons.frame.disabled=t===0,I.buttons.fit.disabled=!e,I.buttons.remove.disabled=!e,I.toolbar.dataset.selectedCount=String(n)}function Y(){if(!I)return;let e=u();F&&!e.some(e=>e.id===F)&&(F=null),!F&&e[0]&&Q(e[0].id),I.list.replaceChildren(...e.map(e=>{let n=t(`button`,`wb-board-tab`,e.title);return n.type=`button`,n.setAttribute(`aria-pressed`,String(e.id===F)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Q(e.id)),n})),ot()}function ot(){if(!I)return;let e=W(),n=u().length>0;I.boardHead.hidden=!e,I.canvas.hidden=!e,I.empty.hidden=!!e,I.empty.textContent=n?rt:nt,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 st(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=st(e,z),I.sendToAgent.disabled=!e?.connectedSessionIds.includes(z)}async function ct(){if(!I||!F||!z)return;I.sendToAgent.disabled=!0,V.show(`busy`,`sending`);let e=await h(F,z);X(),e.ok?V.show(`ok`,`sent; the agent reads the board when it is ready`):V.show(`error`,e.error)}function Z(){if(!L)return;let e=U();e?(L.render(e),R?.pruneSelection(e),it&&=(R?.fit(),!1),J()):L.clear()}function Q(e){F!==e&&(F=e,it=!0,R?.clearSelection(),R?.closeTitleInput(),L?.clear(),B.clear(),Y(),m(e).then(Z))}function lt(){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 ut(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 dt(){let[e,t]=q(`box`);e&&t&&(R?.clearSelection(),at([{op:`add`,element:{kind:`wire`,id:x(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function ft(){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 pt(){let e=W();if(!e)return;let t=e.connectedSessionIds.map(K),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;a({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{p(e.id).then(e=>{e.ok||B.show(`error`,e.error)})}})}function mt(){H({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await _(e);return t.ok?(Q(t.boardId),null):t.error}})}function $(e,n,r=``){let i=t(`button`,`wb-button ${r}`.trim(),e);return i.type=`button`,i.addEventListener(`click`,n),i}function ht(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,mt));let i=t(`div`,`wb-board-head`),a=t(`div`,`wb-title-row`),o=t(`h2`,`wb-board-title`),c=t(`span`,`wb-board-meta`),l=t(`div`,`wb-presence`);a.append(o,c,l);let u=t(`div`,`wb-toolbar`),f={box:$(`box`,lt),wire:$(`wire`,dt),note:$(`note`,()=>{let[e]=q(`box`);e&&ut(e.id)}),frame:$(`frame`,ft),fit:$(`fit`,()=>R?.fit()),remove:$(`delete board`,pt,`wb-button-danger`)};f.fit.dataset.phoneVisible=``,u.append(f.box,f.wire,f.note,f.frame,f.fit,f.remove,B.element),i.append(a,u);let p=t(`div`,`wb-canvas`),m=document.createElementNS(tt,`svg`);m.setAttribute(`class`,`wb-svg`),m.setAttribute(`role`,`img`),m.setAttribute(`aria-label`,`Whiteboard`),m.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),p.append(m);let h=t(`p`,`wb-empty`,nt),g=t(`div`,`wb-dock`);g.hidden=!0;let _=t(`span`,`wb-dock-queued`),v=$(`send to agent`,()=>void ct()),y=t(`div`,`wb-dock-bar`);y.append(_,v,V.element),g.append(y),e.replaceChildren(n,i,p,h,g),I={list:r,boardHead:i,boardTitle:o,boardMeta:c,presence:l,toolbar:u,canvas:p,empty:h,dock:g,dockQueued:_,sendToAgent:v,buttons:f};let b=et(m);L=b,R=ie({svg:m,canvas:p,renderer:b,currentBoard:U,sendOps:at,onSelectionChange:J,onPhoneTapBox:ut}),s(Y),d(e=>{e===F&&Z()}),Y()}function gt(){return document.documentElement.dataset.layout===`phone`}function _t(){z&&c()===z&&v(),z=null,I&&(I.dock.hidden=!0)}function vt(e){if(!I||gt())return;let t=r(e);t&&(z=e,I.dock.hidden=!1,V.clear(),X(),y(t,e,I.dock,{className:`wb-docked-card`}))}function yt(){let e=f();e&&(Q(e.boardId),e.dockSessionId&&vt(e.dockSessionId)),Y(),F&&m(F).then(Z)}var bt={mount:ht,refresh:yt,deactivate:_t};export{bt as view};
1
+ import{yt as e}from"./updates-view-core-C8XDTgVm.js";import{s as t}from"./dom-helpers-DBbFg1c_.js";import{a as n,r}from"./card-registry-D5FILlqB.js";import{i}from"./action-status-2TEW4EL2.js";import{a,n as o}from"./modal-USMHOKBI.js";import{ai as s,bi as c,ci as l,ei as u,ii as d,li as f,ni as p,oi as m,ri as h,si as g,ti as _,xi as v,yi as y}from"./index-BJ26BQYS.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),c=r*o;s={x:t.x-(c-t.width)/2,y:t.y,width:c,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 T(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 ae(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 oe(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?ae(c):c?.kind===`drag`&&c.pointerId===e.pointerId?w(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&T(c,e))}async function se(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 ce(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?se(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&S()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||g(new Set)))}function le(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function E(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 D(){let e=l;l=null,e?.remove()}function ue(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;D();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(),D(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();D(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,D),d.focus(),d.select()}function de(e){if(S())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&ue(t.id)}function fe(){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 pe(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),fe()):e.key===`Escape`&&g(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,C),n.addEventListener(`pointermove`,oe),n.addEventListener(`pointerup`,ce),n.addEventListener(`pointercancel`,le),n.addEventListener(`wheel`,E,{passive:!1}),n.addEventListener(`dblclick`,de),n.addEventListener(`keydown`,pe),{fit:d,selectedIds:()=>o,clearSelection:()=>g(new Set),pruneSelection:v,closeTitleInput:D}}var C=40,w=220,T=90,ae=30,oe=20,se=18,ce=20,le=26,E=18,D=26,ue=170,de=21,fe=17,pe=10,O=22,me=24,he=16,ge=24,_e=8,ve=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function k(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 ye(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:ve[n.color]}:null}function be(e,t){let n=k(t.title,ce),r=t.lines.flatMap(e=>k(e.text,le-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ye(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*oe+r.length*se+(i?26:0)}}function A(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function xe(e){let t=k(e.text,de);return{lines:t,height:24+(t.length+1)*fe}}function Se(e){let t=new Map;for(let n of A(e,`note`)){let e=t.get(n.on),r=xe(n).height;t.set(n.on,e===void 0?r:e+pe+r)}return t}function Ce(e){return e.columns.map(e=>e.title?k(e.title,me):[])}function we(e){return(Math.max(1,...e.map(e=>e.length))-1)*he}function Te(e,t){let n=new Set(A(e,`box`).filter(e=>!e.at&&t.has(e.id)).map(e=>e.column)),r=[],i=C;for(let t of e.columns)r.push(i),i+=w+(n.has(t.id)?Math.max(T,186):T);return r}function Ee(e){let t=new Map;for(let n of A(e,`frame`))for(let e of n.contains)t.has(e)||t.set(e,n.id);return t}function De(e,t){return e===t?0:(e?E:0)+(t?44:0)}function Oe(e,t,n,r){let i=new Map,a=new Map,o=new Map,s=Ee(e),c=A(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:l}of c){let c=Math.max(0,e.columns.findIndex(e=>e.id===l.column)),u=be(e,l),d=s.get(l.id)??null,f=(a.get(l.column)??n)+De(o.get(l.column)??null,d),p=l.at??{x:t[c]??C,y:f};if(!l.at){let e=(r.get(l.id)??0)-_e;a.set(l.column,f+Math.max(u.height,e)+ae),o.set(l.column,d)}i.set(l.id,{kind:`box`,id:l.id,x:p.x,y:p.y,width:w,height:u.height,titleLines:u.titleLines,bodyLines:u.bodyLines,lane:u.lane,isGhost:l.ghost})}return i}function ke(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 Ae(e,t){return A(e,`frame`).flatMap(e=>{let n=ke(e.contains.flatMap(e=>t.get(e)??[]));return n?[{kind:`frame`,id:e.id,title:e.title,x:n.x-E,y:n.y-E-D,width:n.width+36,height:n.height+36+D}]:[]})}function je(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 Me(e,t){return A(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=je(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 Ne(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function Pe(e,t){let n=new Map;return A(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let{lines:i,height:a}=xe(e),o=n.get(e.on)??r.y-_e;return n.set(e.on,o+a+pe),[{kind:`note`,id:e.id,x:r.x+r.width-ge,y:o,width:ue,height:a,lines:i,byline:Ne(e),isResolved:e.resolvedBy!==null}]})}function Fe(e,t,n){let r=e.flatMap(e=>e.kind===`wire`?[]:[e]),i=(t.at(-1)??C)+w,a=ke([...r,{x:0,y:0,width:i,height:n}]);return a?{x:Math.min(0,a.x-C),y:Math.min(0,a.y-C),width:a.width+80,height:a.height+80}:{x:0,y:0,width:i+C,height:80}}function Ie(e){let t=Se(e),n=Te(e,t),r=Ce(e),i=we(r),a=84+i,o=Oe(e,n,a,t),s=[...Ae(e,o),...Me(e,o),...o.values(),...Pe(e,o)],c=Fe(s,n,a),l=c.y+c.height,u=e.lanes.map((e,t)=>({label:e.label||e.id,hex:ve[e.color],x:C,y:l+t*O})),d=l+u.length*O+(u.length>0?12:0),f=e.caption?{text:e.caption,x:C,y:d}:null,p=u.length*O+(f?30:0)+(u.length>0?12:0);return{columns:e.columns.map((e,t)=>({id:e.id,titleLines:r[t]??[],titleBaselineY:56,ruleY:66+i,x:n[t]??C,width:w})),elements:s,legend:u,caption:f,bounds:{...c,height:c.height+p}}}function Le(e){return JSON.stringify(e)}var Re=`http://www.w3.org/2000/svg`,j=12,ze=26,Be=20,Ve=18,He=17,Ue=14,We=16;function M(e,t={},n=``){let r=document.createElementNS(Re,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 Ge(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+ze+r*Be,`wb-box-title`))});let r=e.y+ze+e.titleLines.length*Be;if(e.bodyLines.forEach((n,i)=>{let a=e.x+j+(n.muted?Ue:0);t.append(N(n.text,a,r+i*Ve,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 Ke(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 qe(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 Je(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*He,`wb-note-text`))}),e.byline&&t.append(N(e.byline,e.x+10,e.y+22+e.lines.length*He,`wb-note-byline`)),t}var Ye={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},Xe=[`box`,`frame`,`wire`,`note`];function Ze(e){switch(e.kind){case`box`:return Ge(e);case`frame`:return Ke(e);case`wire`:return qe(e);case`note`:return Je(e)}}function Qe(e){let t=M(`g`,{},`wb-chrome`);for(let n of e.columns)n.titleLines.length!==0&&(n.titleLines.forEach((e,r)=>{t.append(N(e,n.x,n.titleBaselineY+r*We,`wb-column-title`))}),t.append(M(`line`,{x1:n.x,y1:n.ruleY,x2:n.x+n.width,y2:n.ruleY},`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 $e(){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 et(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($e(),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=Ie(e),s=Qe(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=Le(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Ze(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[Ye[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=Xe.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 tt=`http://www.w3.org/2000/svg`,nt=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,rt=`Pick a board above.`,F=null,I=null,L=null,R=null,it=!0,z=null,B=i(`action-status wb-status`),V=i(`action-status wb-status`);function H(e){let{dialog:n,close:r,actions:i,btnCancel:a}=o({title:e.title}),s=t(`input`,`dialog-input`);s.type=`text`,s.placeholder=e.placeholder,s.maxLength=e.maxLength,s.value=e.initialValue??``,s.autocomplete=`off`,s.setAttribute(`aria-label`,e.label);let c=t(`div`,`dialog-error`);c.setAttribute(`role`,`alert`);let l=e.choices?t(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let n of e.choices.options){let e=t(`option`,null,n.text);e.value=n.value,l.append(e)}}let u=t(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,i.append(u),n.append(t(`label`,`dialog-label`,e.label),s,...l?[l]:[],c,i);async function d(){let t=s.value.trim();if(!t){c.textContent=`${e.label} is empty.`;return}u.disabled=!0;let n=await e.onSubmit(t,l?.value??null);u.disabled=!1,n?c.textContent=n:r()}a.addEventListener(`click`,r),u.addEventListener(`click`,()=>void d()),s.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>s.focus())}function U(){return F?g(F):null}function W(){return u().find(e=>e.id===F)??null}async function at(e){if(!F||e.length===0)return!1;let t=await l(F,e);return t.ok?(B.clear(),!0):(B.show(`error`,t.error),!1)}async function G(e){if(!F)return`No board is open.`;let t=await l(F,e);return t.ok?null:t.error}function K(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=U();return[...R?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!I)return;let e=U(),t=q(`box`).length,n=R?.selectedIds().size??0;I.buttons.box.disabled=!e,I.buttons.wire.disabled=t!==2,I.buttons.note.disabled=t!==1,I.buttons.frame.disabled=t===0,I.buttons.fit.disabled=!e,I.buttons.remove.disabled=!e,I.toolbar.dataset.selectedCount=String(n)}function Y(){if(!I)return;let e=u();F&&!e.some(e=>e.id===F)&&(F=null),!F&&e[0]&&Q(e[0].id),I.list.replaceChildren(...e.map(e=>{let n=t(`button`,`wb-board-tab`,e.title);return n.type=`button`,n.setAttribute(`aria-pressed`,String(e.id===F)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Q(e.id)),n})),ot()}function ot(){if(!I)return;let e=W(),n=u().length>0;I.boardHead.hidden=!e,I.canvas.hidden=!e,I.empty.hidden=!!e,I.empty.textContent=n?rt:nt,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 st(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=st(e,z),I.sendToAgent.disabled=!e?.connectedSessionIds.includes(z)}async function ct(){if(!I||!F||!z)return;I.sendToAgent.disabled=!0,V.show(`busy`,`sending`);let e=await h(F,z);X(),e.ok?V.show(`ok`,`sent; the agent reads the board when it is ready`):V.show(`error`,e.error)}function Z(){if(!L)return;let e=U();e?(L.render(e),R?.pruneSelection(e),it&&=(R?.fit(),!1),J()):L.clear()}function Q(e){F!==e&&(F=e,it=!0,R?.clearSelection(),R?.closeTitleInput(),L?.clear(),B.clear(),Y(),m(e).then(Z))}function lt(){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 ut(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 dt(){let[e,t]=q(`box`);e&&t&&(R?.clearSelection(),at([{op:`add`,element:{kind:`wire`,id:x(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function ft(){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 pt(){let e=W();if(!e)return;let t=e.connectedSessionIds.map(K),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;a({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{p(e.id).then(e=>{e.ok||B.show(`error`,e.error)})}})}function mt(){H({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await _(e);return t.ok?(Q(t.boardId),null):t.error}})}function $(e,n,r=``){let i=t(`button`,`wb-button ${r}`.trim(),e);return i.type=`button`,i.addEventListener(`click`,n),i}function ht(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,mt));let i=t(`div`,`wb-board-head`),a=t(`div`,`wb-title-row`),o=t(`h2`,`wb-board-title`),c=t(`span`,`wb-board-meta`),l=t(`div`,`wb-presence`);a.append(o,c,l);let u=t(`div`,`wb-toolbar`),f={box:$(`box`,lt),wire:$(`wire`,dt),note:$(`note`,()=>{let[e]=q(`box`);e&&ut(e.id)}),frame:$(`frame`,ft),fit:$(`fit`,()=>R?.fit()),remove:$(`delete board`,pt,`wb-button-danger`)};f.fit.dataset.phoneVisible=``,u.append(f.box,f.wire,f.note,f.frame,f.fit,f.remove,B.element),i.append(a,u);let p=t(`div`,`wb-canvas`),m=document.createElementNS(tt,`svg`);m.setAttribute(`class`,`wb-svg`),m.setAttribute(`role`,`img`),m.setAttribute(`aria-label`,`Whiteboard`),m.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),p.append(m);let h=t(`p`,`wb-empty`,nt),g=t(`div`,`wb-dock`);g.hidden=!0;let _=t(`span`,`wb-dock-queued`),v=$(`send to agent`,()=>void ct()),y=t(`div`,`wb-dock-bar`);y.append(_,v,V.element),g.append(y),e.replaceChildren(n,i,p,h,g),I={list:r,boardHead:i,boardTitle:o,boardMeta:c,presence:l,toolbar:u,canvas:p,empty:h,dock:g,dockQueued:_,sendToAgent:v,buttons:f};let b=et(m);L=b,R=ie({svg:m,canvas:p,renderer:b,currentBoard:U,sendOps:at,onSelectionChange:J,onPhoneTapBox:ut}),s(Y),d(e=>{e===F&&Z()}),Y()}function gt(){return document.documentElement.dataset.layout===`phone`}function _t(){z&&c()===z&&v(),z=null,I&&(I.dock.hidden=!0)}function vt(e){if(!I||gt())return;let t=r(e);t&&(z=e,I.dock.hidden=!1,V.clear(),X(),y(t,e,I.dock,{className:`wb-docked-card`}))}function yt(){let e=f();e&&(Q(e.boardId),e.dockSessionId&&vt(e.dockSessionId)),Y(),F&&m(F).then(Z)}var bt={mount:ht,refresh:yt,deactivate:_t};export{bt as view};
@@ -1 +1 @@
1
- import{c as e,s as t,v as n}from"./dom-helpers-DBbFg1c_.js";import{E as r,bt as i}from"./ui-prefs-DfBm2IRm.js";import{playToneSequence as a}from"./alert-sound-Da6VQFBS.js";var o=1.2,s=1.55,c=.12,l=523.25,u=2,d=8,f=(e,t,n)=>({semitone:e,startBeat:t,beats:n}),p={melody:[f(7,4,.5),f(11,4.5,.5),f(12,5,3)],bass:[f(-5,4,1),f(-12,5,3)]},m=[{melody:[f(0,0,1),f(4,1,1),f(7,2,1),f(9,3,1)],bass:[f(-12,0,2),f(-8,2,2)]},{melody:[f(7,0,.67),f(7,.67,.67),f(7,1.33,.67),f(9,2,1),f(5,3,1)],bass:[f(-12,0,2),f(-7,2,2)]},{melody:[f(5,0,1),f(9,1,1),f(7,2,1),f(4,3,1)],bass:[f(-7,0,2),f(-12,2,2)]},{melody:[f(12,0,.5),f(7,.5,.5),f(12,1,.5),f(16,1.5,.5),f(16,2,1),f(14,3,1)],bass:[f(-12,0,2),f(-3,2,2)]},{melody:[f(4,0,1),f(7,1,1),f(4,2,.5),f(5,2.5,.5),f(7,3,.5),f(4,3.5,.5)],bass:[f(-8,0,2),f(-12,2,2)]}].map(e=>({melody:[...e.melody,...p.melody],bass:[...e.bass,...p.bass]}));function h(e,t){return l*2**((e+t)/12)}function g(e,t){let n=(e,n,r)=>e.map(e=>({frequency:h(e.semitone,t),startSeconds:s+e.startBeat*c,durationSeconds:e.beats*c,waveform:n,gain:r}));return[...n(e.melody,`square`,.2),...n(e.melody,`triangle`,.5),...n(e.bass,`triangle`,.6)]}var ee=[{frequency:220,endFrequency:880,startSeconds:0,durationSeconds:.32,waveform:`triangle`,gain:.25},{frequency:160,endFrequency:45,startSeconds:o,durationSeconds:.28,waveform:`sine`,gain:1},{frequency:1400,endFrequency:380,startSeconds:o,durationSeconds:.06,waveform:`square`,gain:.12}];function te(e){let t=m[e%m.length],n=Math.min(e*u,d);return{peakGain:.1,tones:[...ee,...g(t,n)]}}function _(e){return Math.round(Math.sqrt(2*e/780)*1e3)}function v(e,t,n=Math.random){return Math.round(e+n()*(t-e))}function y(e,t=Math.random){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}var ne=.6,re=.25,ie=1.6;function ae(e){return Math.min(ne+e*re,ie)}var b=[`var(--accent)`,`var(--state-running)`,`var(--state-idle)`,`var(--state-waiting)`,`var(--state-failed)`];function oe(e,t=Math.random){let n=v(320,520,t),r=v(1800,2800,t);return[[`--confetti-start-x`,`${v(4,96,t)}%`],[`--confetti-x`,`${v(-140,140,t)}px`],[`--confetti-rise`,`${-v(20,55,t)}px`],[`--confetti-fall`,`${v(45,70,t)}vh`],[`--confetti-rise-ms`,`${n}ms`],[`--confetti-fall-ms`,`${r}ms`],[`--confetti-flight-ms`,`${n+r}ms`],[`--confetti-tilt`,`${v(0,180,t)}deg`],[`--confetti-spin`,`${v(-360,360,t)}deg`],[`--confetti-flutter-ms`,`${v(160,340,t)}ms`],[`--confetti-delay`,`${v(0,160,t)}ms`],[`--confetti-color`,b[e%b.length]]]}var se=`<svg viewBox="0 0 36 36" aria-hidden="true"><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="17"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="13"/><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="9"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="5"/></svg>`,ce=`<svg viewBox="0 0 26 8" aria-hidden="true"><path class="merge-bullseye-dart-flight" d="M0 0L7 3V5L0 8L2 4Z"/><rect class="merge-bullseye-dart-shaft" x="6" y="3.3" width="8" height="1.4"/><rect class="merge-bullseye-dart-barrel" x="13" y="2.5" width="7" height="3" rx="1"/><path class="merge-bullseye-dart-tip" d="M20 3L26 4L20 5Z"/></svg>`;function le(){let n=e(`div`,`merge-bullseye-target`,se);return n.append(t(`span`,`merge-bullseye-ripple`)),n}function ue(){let n=t(`div`,`merge-bullseye-dart-drift`),r=t(`div`,`merge-bullseye-dart-arc`),i=t(`div`,`merge-bullseye-dart-aim`);return i.append(e(`div`,`merge-bullseye-dart`,ce)),r.append(i),n.append(r),n}function de(){let e=t(`div`,`merge-bullseye-range`),n=t(`div`,`merge-bullseye-track`);return n.append(ue()),e.append(le(),n),e}var fe={title:`BULLSEYE!`,buildScene:de},pe=6,x=30,S=-14,C=16;function w(e=Math.random){return[[`--crosshair-start-left`,`${v(pe,x,e)}%`],[`--crosshair-start-offset-y`,`${v(S,C,e)}px`]]}var T=`<svg viewBox="0 0 26 40" aria-hidden="true"><path class="merge-headshot-target-body" d="M9 13H17L18 16Q25 18 25 24V40H1V24Q1 18 8 16Z"/><circle class="merge-headshot-target-head" cx="13" cy="7" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="7" r="3"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="2.5"/></svg>`,E=`<svg viewBox="0 0 22 22" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M11 0V5M11 17V22M0 11H5M17 11H22"/><circle class="merge-headshot-crosshair-dot" cx="11" cy="11" r="1"/></svg>`,D=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 3L8 8M21 3L16 8M3 21L8 16M21 21L16 16"/></svg>`;function O(){let r=t(`div`,`merge-headshot-sweep`);n(r,w());let i=t(`div`,`merge-headshot-aim`);i.append(e(`div`,`merge-headshot-crosshair`,E));let a=t(`div`,`merge-headshot-bob`);return a.append(i,e(`div`,`merge-headshot-hitmarker`,D)),r.append(a),r}function k(){let n=t(`div`,`merge-headshot-range`),r=t(`div`,`merge-headshot-track`);return r.append(O()),n.append(e(`div`,`merge-headshot-target`,T),r),n}var A={title:`HEADSHOT!`,buildScene:k},j=[`10`,`J`,`Q`,`K`,`A`],M=160,N=19,P=5,F=9,I=780,L=70,R=70,z=35;function B(e){let t=j.length-1,n=e-t/2;return{offsetPx:n*N,titleSpreadFraction:n/t,tiltDegrees:n*P,bottomPx:F-n**2,dealLeadMs:I-e*L,flipLeadMs:M+(t-e)*R,waveDelayMs:e*z}}function me(e){return[[`--card-offset`,`${e.offsetPx}px`],[`--card-title-spread`,String(e.titleSpreadFraction)],[`--card-tilt`,`${e.tiltDegrees}deg`],[`--card-bottom`,`${e.bottomPx}px`],[`--card-deal-lead-ms`,`${e.dealLeadMs}ms`],[`--card-flip-lead-ms`,`${e.flipLeadMs}ms`],[`--card-wave-delay-ms`,`${e.waveDelayMs}ms`]]}function he(){return[[`--card-flip-ms`,`${M}ms`]]}var ge=`<svg viewBox="0 0 10 9" aria-hidden="true"><path d="M5 8.5C5 8.5 0 5.3 0 2.6C0 1.1 1.2 0 2.6 0C3.6 0 4.5 .6 5 1.4C5.5 .6 6.4 0 7.4 0C8.8 0 10 1.1 10 2.6C10 5.3 5 8.5 5 8.5Z"/></svg>`;function _e(e,r){let i=t(`div`,`merge-flush-deal`);n(i,me(B(r)));let a=t(`div`,`merge-flush-hop`),o=t(`div`,`merge-flush-card`),s=t(`div`,`merge-flush-face`);return s.append(t(`span`,`merge-flush-rank`,e)),s.insertAdjacentHTML(`beforeend`,ge),o.append(t(`div`,`merge-flush-back`),s),a.append(o),i.append(a),i}function ve(){let e=t(`div`,`merge-flush-table`);return n(e,he()),e.append(...j.map(_e)),e}var ye={title:`ROYAL FLUSH!`,buildScene:ve},be=[1,2,3,4],xe=14,Se=3,Ce=3,V=10,we=20,Te=2,H=28,U=18,Ee=.01,De=1.5,Oe=2200,ke=1,W=120,G=.35,Ae=15,je=105,Me=4,Ne=65,Pe=145;function Fe(e){return Math.round(e/(Math.PI*U)*360)}function K(e){return we-e*Te}function q(e){return e.rowIndex*xe+e.depthIndex*Se}function J(e,t,n){return Array.from({length:n},(r,i)=>e+(t-e)*i/(n-1))}function Y(){return be.flatMap((e,t)=>Array.from({length:e},(n,r)=>({rowIndex:t,depthIndex:e-1-r})))}function Ie(e,t){let n=y(J(Ae,je,e),t),r=y(J(Ne,Pe,e),t);return n.map((e,n)=>({angleDegrees:e+v(-4,Me,t),depthScalePercent:Math.round(r[n])}))}function Le(e,t,n){let r=v(240,380,n),i=t.angleDegrees*Math.PI/180,a=r*Math.cos(i),o=(r*Math.sin(i))**2/1560,s=v(15,45,n),c=_(o),l=_(o+s),u=c+l,d=v(540,1080,n),f=a>=0?1:-1,p=q(e);return{depthIndex:e.depthIndex,launchAngleDegrees:t.angleDegrees,distanceFromHeadPinPx:p,layer:K(e.depthIndex),flyXPx:Math.round(a*u/1e3),peakRisePx:Math.round(o),landingDropPx:s,riseMs:c,fallMs:l,flightMs:u,spinDegrees:Math.round(f*d*u/1e3),glintMs:Math.round(180/d*1e3),depthScalePercent:t.depthScalePercent,delayMs:Math.round(p/G)}}function Re(e=Math.random){let t=Y(),n=Ie(t.length,e);return t.map((t,r)=>Le(t,n[r],e))}function ze(e){return[[`--pin-left`,`${e.distanceFromHeadPinPx}px`],[`--pin-raise`,`${e.depthIndex*Ce}px`],[`--pin-shade`,`${100-e.depthIndex*12}%`],[`--pin-fly-x`,`${e.flyXPx}px`],[`--pin-peak-y`,`${-e.peakRisePx}px`],[`--pin-land-y`,`${e.landingDropPx}px`],[`--pin-rise-ms`,`${e.riseMs}ms`],[`--pin-fall-ms`,`${e.fallMs}ms`],[`--pin-flight-ms`,`${e.flightMs}ms`],[`--pin-spin`,`${e.spinDegrees}deg`],[`--pin-glint-ms`,`${e.glintMs}ms`],[`--pin-depth-scale`,`${e.depthScalePercent}%`],[`--pin-depth-shade`,`${e.depthScalePercent-10}%`],[`--pin-delay`,`${e.delayMs}ms`],[`--pin-layer`,String(e.layer)]]}function Be(){return K(De)}function Ve(){return Math.max(...Y().map(q))+V}function He(){let e=Ve(),t=H+e+U-ke;return[[`--ball-follow-px`,`${W}px`],[`--ball-follow-ms`,`${Math.round(W/G)}ms`],[`--ball-follow-spin`,`${Fe(W)}deg`],[`--ball-size`,`${U}px`],[`--ball-approach-spin`,`${Oe}deg`],[`--ball-impact-inset`,`${t}px`],[`--ball-layer`,String(Be())],[`--rack-right`,`${H}px`],[`--rack-width`,`${e}px`],[`--pin-width`,`${V}px`]]}function Ue(e=Math.random){return e()>=Ee?null:i[Math.floor(e()*i.length)].sprite}var We=`<svg viewBox="0 0 10 24" aria-hidden="true"><path class="merge-strike-pin-body" d="M5 0C7 0 7.6 2 7.2 4C6.9 5.6 6.3 6.6 6.4 8C6.6 10 9.6 12 9.6 16C9.6 19.5 8.4 22 7.6 24H2.4C1.6 22 .4 19.5 .4 16C.4 12 3.4 10 3.6 8C3.7 6.6 3.1 5.6 2.8 4C2.4 2 3 0 5 0Z"/><path class="merge-strike-pin-stripe" d="M3.1 5.2H6.9V6.2H3.1ZM3.4 7H6.6V8H3.4Z"/></svg>`;function Ge(r){let i=t(`span`,`merge-strike-pin`);return i.append(e(`span`,`merge-strike-pin-arc`,We)),n(i,ze(r)),i}function Ke(){let e=Ue();if(!e)return t(`span`,`merge-strike-ball`);let n=t(`span`,`merge-strike-ball is-animal`);return n.append(t(`span`,`nyan-sprite ${e}`)),n}function qe(){let e=t(`div`,`merge-strike-lane`);n(e,He());let r=t(`div`,`merge-strike-rack`);r.append(...Re().map(Ge));let i=t(`div`,`merge-strike-track`);return i.append(Ke()),e.append(r,i),e}var Je={title:`STRIKE!`,buildScene:qe},Ye=20,Xe=92,Ze=23,Qe=7,$e=-40;function et(){let e=_(72),t=_(69),n=780*t/1e3;return{launchHeightPx:Ye,peakHeightPx:Xe,heightThroughRimPx:Ze,heightLeavingNetPx:Qe,heightOutOfCardPx:$e,riseMs:e,fallToRimMs:t,speedThroughRimPxPerSecond:n,netCatchMs:Math.round(32/n*1e3),dropMs:_(47)}}function tt(e=et()){return[[`--ball-launch-y`,`${-e.launchHeightPx}px`],[`--ball-peak-y`,`${-e.peakHeightPx}px`],[`--ball-rim-y`,`${-e.heightThroughRimPx}px`],[`--ball-net-exit-y`,`${-e.heightLeavingNetPx}px`],[`--ball-drop-out-y`,`${-e.heightOutOfCardPx}px`],[`--ball-rise-ms`,`${e.riseMs}ms`],[`--ball-fall-to-rim-ms`,`${e.fallToRimMs}ms`],[`--ball-to-rim-ms`,`${e.riseMs+e.fallToRimMs}ms`],[`--ball-net-catch-ms`,`${e.netCatchMs}ms`],[`--ball-drop-ms`,`${e.dropMs}ms`]]}var nt=`<svg viewBox="0 0 40 48" aria-hidden="true"><rect class="merge-swish-pole" x="36" y="28" width="2" height="20"/><rect class="merge-swish-backboard" x="35" y="2" width="3" height="26" rx="1"/><path class="merge-swish-rim" d="M31 18H35M7 18A12 2.5 0 0 1 31 18"/></svg>`,rt=`<svg viewBox="0 0 40 48" aria-hidden="true"><g class="merge-swish-net"><path d="M8 18L12 32M13.5 18L15.5 32M19 18V32M24.5 18L22.5 32M30 18L26 32M9.5 23Q19 25 28.5 23M11 28Q19 29.5 27 28"/></g><path class="merge-swish-rim" d="M7 18A12 2.5 0 0 0 31 18"/></svg>`;function it(){let e=t(`div`,`merge-swish-ball-drift`),n=t(`div`,`merge-swish-ball-arc`);return n.append(t(`span`,`merge-swish-ball`)),e.append(n),e}function X(){let r=t(`div`,`merge-swish-court`);n(r,tt());let i=t(`div`,`merge-swish-track`);return i.append(it()),r.append(e(`div`,`merge-swish-hoop-back`,nt),i,e(`div`,`merge-swish-hoop-front`,rt)),r}var Z=[Je,{title:`SWISH!`,buildScene:X},fe,A,ye],at=48,Q=5600,$=null;function ot(e){let r=t(`span`,`merge-confetti-piece`),i=t(`span`,`merge-confetti-arc`);return i.append(t(`span`,`merge-confetti-paper`)),r.append(i),n(r,oe(e)),r}function st(e){let n=t(`p`,`merge-celebration-title`);return n.setAttribute(`aria-hidden`,`true`),Array.from(e).forEach((e,r)=>{let i=t(`span`,`merge-celebration-letter`,e);i.style.setProperty(`--letter-delay`,`${r*45}ms`),n.append(i)}),n}function ct(e,t,n){let r=t.firstElementChild,i=t.lastElementChild;r instanceof HTMLElement&&i instanceof HTMLElement&&(e.style.setProperty(`--celebration-title-width`,`${i.offsetLeft+i.offsetWidth-r.offsetLeft}px`),e.style.setProperty(`--celebration-title-center-y`,`${t.offsetTop+t.offsetHeight/2-n.offsetTop}px`))}function lt(e){let n=t(`div`,`merge-celebration-scene`);return n.setAttribute(`aria-hidden`,`true`),n.append(e.buildScene()),n}function ut(){return Z[Math.floor(Math.random()*Z.length)]}function dt(e){if(r())try{a(te(e))}catch{}}function ft(e){let n=t(`ul`,`merge-celebration-details`);for(let r of e)n.append(t(`li`,`merge-celebration-detail`,r));return n}function pt(e,n){let r=ut();$?.remove(),dt(n);let i=t(`div`,`merge-celebration`);i.setAttribute(`role`,`status`);let a=t(`div`,`merge-celebration-card`),o=t(`div`,`merge-celebration-stage`),s=st(r.title),c=lt(r);o.append(s,t(`p`,`merge-celebration-message`,e.message),ft(e.detailLines),c);let l=t(`div`,`merge-confetti`);l.style.setProperty(`--confetti-scale`,String(ae(n)));for(let e=0;e<at;e+=1)l.append(ot(e));a.append(l,o),i.append(a),document.body.append(i),ct(o,s,c),$=i,window.setTimeout(()=>{i.remove(),$===i&&($=null)},Q)}export{Q as CELEBRATION_DURATION_MS,pt as playCelebration};
1
+ import{c as e,s as t,v as n}from"./dom-helpers-DBbFg1c_.js";import{T as r,vt as i}from"./ui-prefs-CiiqXyOk.js";import{playToneSequence as a}from"./alert-sound-Da6VQFBS.js";var o=1.2,s=1.55,c=.12,l=523.25,u=2,d=8,f=(e,t,n)=>({semitone:e,startBeat:t,beats:n}),p={melody:[f(7,4,.5),f(11,4.5,.5),f(12,5,3)],bass:[f(-5,4,1),f(-12,5,3)]},m=[{melody:[f(0,0,1),f(4,1,1),f(7,2,1),f(9,3,1)],bass:[f(-12,0,2),f(-8,2,2)]},{melody:[f(7,0,.67),f(7,.67,.67),f(7,1.33,.67),f(9,2,1),f(5,3,1)],bass:[f(-12,0,2),f(-7,2,2)]},{melody:[f(5,0,1),f(9,1,1),f(7,2,1),f(4,3,1)],bass:[f(-7,0,2),f(-12,2,2)]},{melody:[f(12,0,.5),f(7,.5,.5),f(12,1,.5),f(16,1.5,.5),f(16,2,1),f(14,3,1)],bass:[f(-12,0,2),f(-3,2,2)]},{melody:[f(4,0,1),f(7,1,1),f(4,2,.5),f(5,2.5,.5),f(7,3,.5),f(4,3.5,.5)],bass:[f(-8,0,2),f(-12,2,2)]}].map(e=>({melody:[...e.melody,...p.melody],bass:[...e.bass,...p.bass]}));function h(e,t){return l*2**((e+t)/12)}function g(e,t){let n=(e,n,r)=>e.map(e=>({frequency:h(e.semitone,t),startSeconds:s+e.startBeat*c,durationSeconds:e.beats*c,waveform:n,gain:r}));return[...n(e.melody,`square`,.2),...n(e.melody,`triangle`,.5),...n(e.bass,`triangle`,.6)]}var ee=[{frequency:220,endFrequency:880,startSeconds:0,durationSeconds:.32,waveform:`triangle`,gain:.25},{frequency:160,endFrequency:45,startSeconds:o,durationSeconds:.28,waveform:`sine`,gain:1},{frequency:1400,endFrequency:380,startSeconds:o,durationSeconds:.06,waveform:`square`,gain:.12}];function te(e){let t=m[e%m.length],n=Math.min(e*u,d);return{peakGain:.1,tones:[...ee,...g(t,n)]}}function _(e){return Math.round(Math.sqrt(2*e/780)*1e3)}function v(e,t,n=Math.random){return Math.round(e+n()*(t-e))}function y(e,t=Math.random){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}var ne=.6,re=.25,ie=1.6;function ae(e){return Math.min(ne+e*re,ie)}var b=[`var(--accent)`,`var(--state-running)`,`var(--state-idle)`,`var(--state-waiting)`,`var(--state-failed)`];function oe(e,t=Math.random){let n=v(320,520,t),r=v(1800,2800,t);return[[`--confetti-start-x`,`${v(4,96,t)}%`],[`--confetti-x`,`${v(-140,140,t)}px`],[`--confetti-rise`,`${-v(20,55,t)}px`],[`--confetti-fall`,`${v(45,70,t)}vh`],[`--confetti-rise-ms`,`${n}ms`],[`--confetti-fall-ms`,`${r}ms`],[`--confetti-flight-ms`,`${n+r}ms`],[`--confetti-tilt`,`${v(0,180,t)}deg`],[`--confetti-spin`,`${v(-360,360,t)}deg`],[`--confetti-flutter-ms`,`${v(160,340,t)}ms`],[`--confetti-delay`,`${v(0,160,t)}ms`],[`--confetti-color`,b[e%b.length]]]}var se=`<svg viewBox="0 0 36 36" aria-hidden="true"><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="17"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="13"/><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="9"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="5"/></svg>`,ce=`<svg viewBox="0 0 26 8" aria-hidden="true"><path class="merge-bullseye-dart-flight" d="M0 0L7 3V5L0 8L2 4Z"/><rect class="merge-bullseye-dart-shaft" x="6" y="3.3" width="8" height="1.4"/><rect class="merge-bullseye-dart-barrel" x="13" y="2.5" width="7" height="3" rx="1"/><path class="merge-bullseye-dart-tip" d="M20 3L26 4L20 5Z"/></svg>`;function le(){let n=e(`div`,`merge-bullseye-target`,se);return n.append(t(`span`,`merge-bullseye-ripple`)),n}function ue(){let n=t(`div`,`merge-bullseye-dart-drift`),r=t(`div`,`merge-bullseye-dart-arc`),i=t(`div`,`merge-bullseye-dart-aim`);return i.append(e(`div`,`merge-bullseye-dart`,ce)),r.append(i),n.append(r),n}function de(){let e=t(`div`,`merge-bullseye-range`),n=t(`div`,`merge-bullseye-track`);return n.append(ue()),e.append(le(),n),e}var fe={title:`BULLSEYE!`,buildScene:de},pe=6,x=30,S=-14,C=16;function w(e=Math.random){return[[`--crosshair-start-left`,`${v(pe,x,e)}%`],[`--crosshair-start-offset-y`,`${v(S,C,e)}px`]]}var T=`<svg viewBox="0 0 26 40" aria-hidden="true"><path class="merge-headshot-target-body" d="M9 13H17L18 16Q25 18 25 24V40H1V24Q1 18 8 16Z"/><circle class="merge-headshot-target-head" cx="13" cy="7" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="7" r="3"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="2.5"/></svg>`,E=`<svg viewBox="0 0 22 22" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M11 0V5M11 17V22M0 11H5M17 11H22"/><circle class="merge-headshot-crosshair-dot" cx="11" cy="11" r="1"/></svg>`,D=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 3L8 8M21 3L16 8M3 21L8 16M21 21L16 16"/></svg>`;function O(){let r=t(`div`,`merge-headshot-sweep`);n(r,w());let i=t(`div`,`merge-headshot-aim`);i.append(e(`div`,`merge-headshot-crosshair`,E));let a=t(`div`,`merge-headshot-bob`);return a.append(i,e(`div`,`merge-headshot-hitmarker`,D)),r.append(a),r}function k(){let n=t(`div`,`merge-headshot-range`),r=t(`div`,`merge-headshot-track`);return r.append(O()),n.append(e(`div`,`merge-headshot-target`,T),r),n}var A={title:`HEADSHOT!`,buildScene:k},j=[`10`,`J`,`Q`,`K`,`A`],M=160,N=19,P=5,F=9,I=780,L=70,R=70,z=35;function B(e){let t=j.length-1,n=e-t/2;return{offsetPx:n*N,titleSpreadFraction:n/t,tiltDegrees:n*P,bottomPx:F-n**2,dealLeadMs:I-e*L,flipLeadMs:M+(t-e)*R,waveDelayMs:e*z}}function me(e){return[[`--card-offset`,`${e.offsetPx}px`],[`--card-title-spread`,String(e.titleSpreadFraction)],[`--card-tilt`,`${e.tiltDegrees}deg`],[`--card-bottom`,`${e.bottomPx}px`],[`--card-deal-lead-ms`,`${e.dealLeadMs}ms`],[`--card-flip-lead-ms`,`${e.flipLeadMs}ms`],[`--card-wave-delay-ms`,`${e.waveDelayMs}ms`]]}function he(){return[[`--card-flip-ms`,`${M}ms`]]}var ge=`<svg viewBox="0 0 10 9" aria-hidden="true"><path d="M5 8.5C5 8.5 0 5.3 0 2.6C0 1.1 1.2 0 2.6 0C3.6 0 4.5 .6 5 1.4C5.5 .6 6.4 0 7.4 0C8.8 0 10 1.1 10 2.6C10 5.3 5 8.5 5 8.5Z"/></svg>`;function _e(e,r){let i=t(`div`,`merge-flush-deal`);n(i,me(B(r)));let a=t(`div`,`merge-flush-hop`),o=t(`div`,`merge-flush-card`),s=t(`div`,`merge-flush-face`);return s.append(t(`span`,`merge-flush-rank`,e)),s.insertAdjacentHTML(`beforeend`,ge),o.append(t(`div`,`merge-flush-back`),s),a.append(o),i.append(a),i}function ve(){let e=t(`div`,`merge-flush-table`);return n(e,he()),e.append(...j.map(_e)),e}var ye={title:`ROYAL FLUSH!`,buildScene:ve},be=[1,2,3,4],xe=14,Se=3,Ce=3,V=10,we=20,Te=2,H=28,U=18,Ee=.01,De=1.5,Oe=2200,ke=1,W=120,G=.35,Ae=15,je=105,Me=4,Ne=65,Pe=145;function Fe(e){return Math.round(e/(Math.PI*U)*360)}function K(e){return we-e*Te}function q(e){return e.rowIndex*xe+e.depthIndex*Se}function J(e,t,n){return Array.from({length:n},(r,i)=>e+(t-e)*i/(n-1))}function Y(){return be.flatMap((e,t)=>Array.from({length:e},(n,r)=>({rowIndex:t,depthIndex:e-1-r})))}function Ie(e,t){let n=y(J(Ae,je,e),t),r=y(J(Ne,Pe,e),t);return n.map((e,n)=>({angleDegrees:e+v(-4,Me,t),depthScalePercent:Math.round(r[n])}))}function Le(e,t,n){let r=v(240,380,n),i=t.angleDegrees*Math.PI/180,a=r*Math.cos(i),o=(r*Math.sin(i))**2/1560,s=v(15,45,n),c=_(o),l=_(o+s),u=c+l,d=v(540,1080,n),f=a>=0?1:-1,p=q(e);return{depthIndex:e.depthIndex,launchAngleDegrees:t.angleDegrees,distanceFromHeadPinPx:p,layer:K(e.depthIndex),flyXPx:Math.round(a*u/1e3),peakRisePx:Math.round(o),landingDropPx:s,riseMs:c,fallMs:l,flightMs:u,spinDegrees:Math.round(f*d*u/1e3),glintMs:Math.round(180/d*1e3),depthScalePercent:t.depthScalePercent,delayMs:Math.round(p/G)}}function Re(e=Math.random){let t=Y(),n=Ie(t.length,e);return t.map((t,r)=>Le(t,n[r],e))}function ze(e){return[[`--pin-left`,`${e.distanceFromHeadPinPx}px`],[`--pin-raise`,`${e.depthIndex*Ce}px`],[`--pin-shade`,`${100-e.depthIndex*12}%`],[`--pin-fly-x`,`${e.flyXPx}px`],[`--pin-peak-y`,`${-e.peakRisePx}px`],[`--pin-land-y`,`${e.landingDropPx}px`],[`--pin-rise-ms`,`${e.riseMs}ms`],[`--pin-fall-ms`,`${e.fallMs}ms`],[`--pin-flight-ms`,`${e.flightMs}ms`],[`--pin-spin`,`${e.spinDegrees}deg`],[`--pin-glint-ms`,`${e.glintMs}ms`],[`--pin-depth-scale`,`${e.depthScalePercent}%`],[`--pin-depth-shade`,`${e.depthScalePercent-10}%`],[`--pin-delay`,`${e.delayMs}ms`],[`--pin-layer`,String(e.layer)]]}function Be(){return K(De)}function Ve(){return Math.max(...Y().map(q))+V}function He(){let e=Ve(),t=H+e+U-ke;return[[`--ball-follow-px`,`${W}px`],[`--ball-follow-ms`,`${Math.round(W/G)}ms`],[`--ball-follow-spin`,`${Fe(W)}deg`],[`--ball-size`,`${U}px`],[`--ball-approach-spin`,`${Oe}deg`],[`--ball-impact-inset`,`${t}px`],[`--ball-layer`,String(Be())],[`--rack-right`,`${H}px`],[`--rack-width`,`${e}px`],[`--pin-width`,`${V}px`]]}function Ue(e=Math.random){return e()>=Ee?null:i[Math.floor(e()*i.length)].sprite}var We=`<svg viewBox="0 0 10 24" aria-hidden="true"><path class="merge-strike-pin-body" d="M5 0C7 0 7.6 2 7.2 4C6.9 5.6 6.3 6.6 6.4 8C6.6 10 9.6 12 9.6 16C9.6 19.5 8.4 22 7.6 24H2.4C1.6 22 .4 19.5 .4 16C.4 12 3.4 10 3.6 8C3.7 6.6 3.1 5.6 2.8 4C2.4 2 3 0 5 0Z"/><path class="merge-strike-pin-stripe" d="M3.1 5.2H6.9V6.2H3.1ZM3.4 7H6.6V8H3.4Z"/></svg>`;function Ge(r){let i=t(`span`,`merge-strike-pin`);return i.append(e(`span`,`merge-strike-pin-arc`,We)),n(i,ze(r)),i}function Ke(){let e=Ue();if(!e)return t(`span`,`merge-strike-ball`);let n=t(`span`,`merge-strike-ball is-animal`);return n.append(t(`span`,`nyan-sprite ${e}`)),n}function qe(){let e=t(`div`,`merge-strike-lane`);n(e,He());let r=t(`div`,`merge-strike-rack`);r.append(...Re().map(Ge));let i=t(`div`,`merge-strike-track`);return i.append(Ke()),e.append(r,i),e}var Je={title:`STRIKE!`,buildScene:qe},Ye=20,Xe=92,Ze=23,Qe=7,$e=-40;function et(){let e=_(72),t=_(69),n=780*t/1e3;return{launchHeightPx:Ye,peakHeightPx:Xe,heightThroughRimPx:Ze,heightLeavingNetPx:Qe,heightOutOfCardPx:$e,riseMs:e,fallToRimMs:t,speedThroughRimPxPerSecond:n,netCatchMs:Math.round(32/n*1e3),dropMs:_(47)}}function tt(e=et()){return[[`--ball-launch-y`,`${-e.launchHeightPx}px`],[`--ball-peak-y`,`${-e.peakHeightPx}px`],[`--ball-rim-y`,`${-e.heightThroughRimPx}px`],[`--ball-net-exit-y`,`${-e.heightLeavingNetPx}px`],[`--ball-drop-out-y`,`${-e.heightOutOfCardPx}px`],[`--ball-rise-ms`,`${e.riseMs}ms`],[`--ball-fall-to-rim-ms`,`${e.fallToRimMs}ms`],[`--ball-to-rim-ms`,`${e.riseMs+e.fallToRimMs}ms`],[`--ball-net-catch-ms`,`${e.netCatchMs}ms`],[`--ball-drop-ms`,`${e.dropMs}ms`]]}var nt=`<svg viewBox="0 0 40 48" aria-hidden="true"><rect class="merge-swish-pole" x="36" y="28" width="2" height="20"/><rect class="merge-swish-backboard" x="35" y="2" width="3" height="26" rx="1"/><path class="merge-swish-rim" d="M31 18H35M7 18A12 2.5 0 0 1 31 18"/></svg>`,rt=`<svg viewBox="0 0 40 48" aria-hidden="true"><g class="merge-swish-net"><path d="M8 18L12 32M13.5 18L15.5 32M19 18V32M24.5 18L22.5 32M30 18L26 32M9.5 23Q19 25 28.5 23M11 28Q19 29.5 27 28"/></g><path class="merge-swish-rim" d="M7 18A12 2.5 0 0 0 31 18"/></svg>`;function it(){let e=t(`div`,`merge-swish-ball-drift`),n=t(`div`,`merge-swish-ball-arc`);return n.append(t(`span`,`merge-swish-ball`)),e.append(n),e}function X(){let r=t(`div`,`merge-swish-court`);n(r,tt());let i=t(`div`,`merge-swish-track`);return i.append(it()),r.append(e(`div`,`merge-swish-hoop-back`,nt),i,e(`div`,`merge-swish-hoop-front`,rt)),r}var Z=[Je,{title:`SWISH!`,buildScene:X},fe,A,ye],at=48,Q=5600,$=null;function ot(e){let r=t(`span`,`merge-confetti-piece`),i=t(`span`,`merge-confetti-arc`);return i.append(t(`span`,`merge-confetti-paper`)),r.append(i),n(r,oe(e)),r}function st(e){let n=t(`p`,`merge-celebration-title`);return n.setAttribute(`aria-hidden`,`true`),Array.from(e).forEach((e,r)=>{let i=t(`span`,`merge-celebration-letter`,e);i.style.setProperty(`--letter-delay`,`${r*45}ms`),n.append(i)}),n}function ct(e,t,n){let r=t.firstElementChild,i=t.lastElementChild;r instanceof HTMLElement&&i instanceof HTMLElement&&(e.style.setProperty(`--celebration-title-width`,`${i.offsetLeft+i.offsetWidth-r.offsetLeft}px`),e.style.setProperty(`--celebration-title-center-y`,`${t.offsetTop+t.offsetHeight/2-n.offsetTop}px`))}function lt(e){let n=t(`div`,`merge-celebration-scene`);return n.setAttribute(`aria-hidden`,`true`),n.append(e.buildScene()),n}function ut(){return Z[Math.floor(Math.random()*Z.length)]}function dt(e){if(r())try{a(te(e))}catch{}}function ft(e){let n=t(`ul`,`merge-celebration-details`);for(let r of e)n.append(t(`li`,`merge-celebration-detail`,r));return n}function pt(e,n){let r=ut();$?.remove(),dt(n);let i=t(`div`,`merge-celebration`);i.setAttribute(`role`,`status`);let a=t(`div`,`merge-celebration-card`),o=t(`div`,`merge-celebration-stage`),s=st(r.title),c=lt(r);o.append(s,t(`p`,`merge-celebration-message`,e.message),ft(e.detailLines),c);let l=t(`div`,`merge-confetti`);l.style.setProperty(`--confetti-scale`,String(ae(n)));for(let e=0;e<at;e+=1)l.append(ot(e));a.append(l,o),i.append(a),document.body.append(i),ct(o,s,c),$=i,window.setTimeout(()=>{i.remove(),$===i&&($=null)},Q)}export{Q as CELEBRATION_DURATION_MS,pt as playCelebration};
@@ -0,0 +1 @@
1
+ import{b as e,d as t,f as n,s as r}from"./dom-helpers-DBbFg1c_.js";import{d as i,u as a}from"./control-ws-CLjOEjA2.js";import{o}from"./card-registry-D5FILlqB.js";import{c as s,i as c,s as ee,t as l}from"./action-status-2TEW4EL2.js";import{i as u}from"./modal-USMHOKBI.js";import{Bt as d,Ct as f,Dt as p,Lt as m,Nt as h,Pt as g,Qr as _,Rt as v,St as y,Vt as b,Zr as te,_ as ne,bt as x,dn as re,fn as ie,j as ae,jt as oe,lt as se,m as ce,vt as le,wt as ue,x as de,xt as fe,yt as pe}from"./index-BJ26BQYS.js";import{t as me}from"./team-review-panel-stCHoIyl.js";import{t as he}from"./pr-queue-columns-DnhAnqNk.js";import{n as S}from"./setup-step-D0y3riKj.js";var ge={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},_e={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},C={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ve={forum:`Forum`,discord:`Discord`};function w(e){return e.status===`ready`&&e.verdict?{text:ge[e.verdict],tone:_e[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:C.error,tone:`danger`}:{text:C[e.status],tone:`muted`}}function T(e){let t=ve[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function E(e){return e.entry.item.title||`Untitled question`}function ye(e){return e.status!==`running`&&e.status!==`queued`}function be(e){return e.status!==`aside`}function xe(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 D(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 Se(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 O=[`key`,`project`,`skill`,`discord`];function Ce(e){let t=e===`finished`?O.length:O.indexOf(e),n=e=>e<t?`done`:e===t?`current`:`upcoming`;return{key:n(0),project:n(1),skill:n(2),discord:n(3)}}function we(e){let t=e.split(/[\s,]+/).map(e=>e.replace(/^#/,``)).filter(Boolean);return[...new Set(t)]}var k=2;function A(e){a({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`onboarding`,action:e}})}function j(){let e=ae().community,t=typeof e==`object`&&e?e:{},n=Array.isArray(t.discordChannels)?t.discordChannels.filter(e=>typeof e==`string`):[];return{projectId:typeof t.projectId==`number`?t.projectId:k,skill:typeof t.skill==`string`?t.skill:``,discordChannels:n}}function Te(e,t,n,i){let a=r(`input`,`dialog-input repo-roots-adder-input`);return a.id=e,a.type=i,a.value=t,a.placeholder=n,a.autocomplete=`off`,a.spellcheck=!1,a}function M(e,t){let n=r(`button`,`btn-dialog btn-dialog-${t}`,e);return n.type=`button`,n}function Ee({onFinish:e}){let t=r(`section`,`first-run-checklist review-setup`);t.setAttribute(`aria-labelledby`,`community-setup-title`);let n=r(`h2`,`first-run-title`,`Answer community questions`);n.id=`community-setup-title`;let a=r(`ol`,`first-run-steps`),o=r(`p`,`first-run-step-hint review-setup-foot`,`Each question gets a researched draft reply. Nothing posts until you post it yourself. `);o.append(ne(`lanes-community`,`community-enabled`,`All community settings`));let s=r(`div`,`first-run-step-actions`),u=M(`Finish setup`,`confirm`);s.append(u),s.hidden=!0,t.append(r(`span`,`first-run-eyebrow`,`SET UP COMMUNITY`),n,a,s,o);let d=null;u.addEventListener(`click`,()=>{A(`finish-community-setup`),d=null,e()});function f(e){d=e,y(),(a.querySelector(`[aria-current="step"] input`)??(s.hidden?null:u))?.focus()}async function p(e,t,n,r){t.disabled=!0,n.show(`busy`,`Saving`);try{let t=await i(`update-settings`,{settings:e},{timeoutMs:l});if(t.type===`settings-error`){n.show(`error`,t.message);return}if(t.type!==`settings-updated`){n.show(`error`,`The server did not confirm the save.`);return}de(t.settings),f(r)}catch(e){n.show(`error`,ee(e,l))}finally{t.disabled=!1}}function m(e){let t=Te(e.inputId,e.initialValue,e.placeholder,e.inputType),n=r(`label`,`repo-roots-adder-label`,e.label);n.htmlFor=t.id;let i=r(`div`,`first-run-step-actions`),a=c(),o=M(e.saveLabel,`confirm`),s=()=>{let n=e.settingsPatch(t.value);typeof n==`string`?a.show(`error`,n):(A(e.action),p(n,o,a,e.nextProgress))};if(o.addEventListener(`click`,s),t.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),s())}),i.append(o),e.isSkippable){let t=M(`Skip`,`cancel`);t.addEventListener(`click`,()=>f(e.nextProgress)),i.append(t)}return i.append(a.element),[r(`p`,`first-run-step-text`,e.advice),n,t,i]}let h=()=>m({advice:`Glimmervoid reads new forum and Discord questions through your PostHog personal API key. Create one in PostHog under Settings, Personal API keys. Community needs only the query:read scope on the project that holds the questions. PostHog error monitoring shares this key, so add error tracking read and write if you turn that on.`,label:`PERSONAL API KEY`,inputId:`community-setup-key`,inputType:`password`,initialValue:``,placeholder:`phx_`,saveLabel:`Save key`,action:`save-community-key`,nextProgress:`project`,isSkippable:!1,settingsPatch:e=>e.trim()?{posthog:{apiKey:e.trim()}}:`Paste a PostHog personal API key.`}),g=()=>m({advice:`The PostHog project that holds the synced community forum table and the Discord bot events. PostHog's own community lives in project 2.`,label:`PROJECT ID`,inputId:`community-setup-project`,inputType:`number`,initialValue:String(j().projectId),placeholder:String(k),saveLabel:`Use project`,action:`save-community-project`,nextProgress:`skill`,isSkippable:!1,settingsPatch:e=>{let t=Number(e.trim());return Number.isInteger(t)&&t>0?{community:{projectId:t}}:`Type the project id as a whole number, such as 2.`}}),_=()=>m({advice:`The Claude Code skill the research agent follows for each question, typed by name. A skill that knows your docs and support playbook gives the best drafts. Skip to research with whatever skills the agent has.`,label:`SKILL`,inputId:`community-setup-skill`,inputType:`text`,initialValue:j().skill,placeholder:`skill name`,saveLabel:`Save skill`,action:`save-community-skill`,nextProgress:`discord`,isSkippable:!0,settingsPatch:e=>({community:{skill:e.trim().replace(/^\//,``)}})}),v=()=>m({advice:`Discord questions come from a Discord bot that sends message_sent and thread_created events into the project above. With that bot in place, list the channels to watch by name, without the #. A cheap model picks out the real questions; only those are researched.`,label:`CHANNELS`,inputId:`community-setup-discord`,inputType:`text`,initialValue:j().discordChannels.join(`, `),placeholder:`community-questions, help`,saveLabel:`Save channels`,action:`save-community-discord`,nextProgress:`finished`,isSkippable:!0,settingsPatch:e=>{let t=we(e);return t.length>0?{community:{discordChannels:t}}:`Type at least one channel, or skip.`}});function y(){if(!d)return;let e=Ce(d);a.replaceChildren(S({title:`1. PostHog personal API key`,state:e.key,summary:`Key saved`,badge:`NEEDED`,body:h}),S({title:`2. PostHog project`,state:e.project,summary:`Project ${j().projectId}`,badge:``,body:g}),S({title:`3. Research skill (optional)`,state:e.skill,summary:j().skill||`No skill`,badge:``,body:_}),S({title:`4. Discord (optional)`,state:e.discord,summary:j().discordChannels.map(e=>`#${e}`).join(` `)||`Forum only`,badge:``,body:v})),s.hidden=d!==`finished`}function b(){d=`key`,y()}return{element:t,open:b,isOpen:()=>d!==null}}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map,W=null;function De(){return Se([...o].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,t){let n=r(`button`,`pr-action pr-action-ghost`,e);return n.type=`button`,n.disabled=!_(t),n.addEventListener(`click`,()=>te(t)),n}function K(e,t,n){let i=r(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!t,i.addEventListener(`click`,n),i}function q(e,t,n){let i=r(`ul`,e);i.setAttribute(`aria-label`,t);for(let e of n)i.append(r(`li`,null,e));return i}function Oe(e){let t=r(`div`,`pr-detail-heading`),n=r(`div`,`pr-detail-title`);n.append(r(`h2`,null,e.item.title||`Untitled question`));let i=r(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(r(`span`,null,e.item.author),r(`span`,null,T(e))),Number.isNaN(a)||i.append(r(`span`,null,`Asked ${ce(a)}`)),t.append(n,i),t}function ke(e){let t=r(`section`,`community-question`);return t.setAttribute(`aria-label`,`Question as asked`),t.append(r(`h3`,`pr-section-heading`,`Question as asked`),r(`p`,`community-question-body`,e.item.body)),t}function Ae(e){let t=r(`section`,`pr-verdict-box`);t.setAttribute(`aria-label`,`Research`);let n=w(e),i=r(`div`,`pr-verdict-line`),a=r(`strong`,`community-badge`,n.text);if(a.dataset.tone=n.tone,i.append(a),t.append(i),e.error&&t.append(r(`p`,`pr-attention-detail`,e.error)),e.summary&&t.append(r(`p`,`pr-verdict-summary`,e.summary)),e.goal&&t.append(r(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&t.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return t;let o=r(`details`,`pr-verdict-checked`);return o.append(r(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),t.append(o),t}function je(e){if(!e.draft)return null;let t=r(`section`,`community-draft`);t.setAttribute(`aria-label`,`Draft reply`),t.append(r(`h3`,`pr-section-heading`,`Draft reply`),r(`p`,`community-draft-body`,e.draft.body));let n=e.draft.publicLinks.filter(_);if(n.length===0)return t;let i=r(`ul`,`community-links`);for(let e of n){let t=r(`li`);t.append(G(e,e)),i.append(t)}return t.append(i),t}function Me(t,n){let r=t.draft?e(t.draft.body):null;r?r.then(()=>n.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>n.show(`error`,`Copying failed. Select the draft text instead.`)):n.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function Ne(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await s(`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&&se()?.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 s(`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 Pe(){let e=r(`select`,`community-session-picker`);e.setAttribute(`aria-label`,`Session to start from`);let t=De();t.some(e=>e.id===H)||(H=t[0]?.id??``);for(let n of t){let t=r(`option`,null,n.name);t.value=n.id,t.selected=n.id===H,e.append(t)}return e.disabled=t.length===0,e.addEventListener(`change`,()=>{H=e.value}),e}function Fe(e){let t=r(`div`,`community-actions`),n=c(`pr-action-status`),i=r(`div`,`community-action-buttons`);return i.append(K(`Copy draft`,e.draft!==null,()=>Me(e,n)),G(`Open thread`,e.item.url),Pe(),K(`Start session`,!0,()=>void Ne(e,n)),K(`Re-run`,ye(e),()=>void J(e,`rerun`,n)),K(`Set aside`,be(e),()=>void J(e,`set-aside`,n))),t.append(i,n.element),t}function Ie(e){let t=r(`article`,`pr-detail community-detail`),n=je(e);return t.append(Oe(e),Fe(e),...n?[n]:[],Ae(e),ke(e)),t}function Y(){if(!F)return;let e=m(L,R),t=e?JSON.stringify(e.entry):`empty:${b(L).length}`;if(t===V)return;if(V=t,e){F.replaceChildren(Ie(e.entry));return}let n=L.some(e=>e.items.length>0);F.replaceChildren(n?me({title:`All caught up`,detail:xe(L)}):r(`p`,`pr-empty`,D(x())))}function Le(e,t){f(h(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=g(L,E);ie(I,p(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=m(L,e),n=U.get(e);t&&n&&Le(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function Re(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=m(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 ze(e){if(e.repeat||e.defaultPrevented||!N||t(N)||u()||n(e)||document.activeElement?.classList.contains(`xterm-helper-textarea`))return;let r=v(e);if(r!==`next-row`&&r!==`previous-row`)return;let i=d([...U.keys()],R,r===`next-row`?1:-1);i&&(e.preventDefault(),i!==R&&Q(i))}function Be(e,t){let n=r(`button`,`pr-queue-row pr-queue-row-quiet`);n.type=`button`,n.dataset.queueKey=e.key,n.setAttribute(`aria-current`,String(e.key===R));let i=w(e.entry),a=r(`span`,`review-queue-action community-badge`,i.text);a.dataset.tone=i.tone;let o=r(`span`,`pr-queue-top`);if(o.append(a,r(`span`,`pr-queue-title`,E(e))),n.append(o,r(`span`,`pr-queue-elapsed`,T(e.entry))),n.title=E(e),t&&y(h(e))){let e=r(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),n.append(e)}return n.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,n),n}function Ve(e){let t=r(`h3`,`pr-section-heading review-group-heading`),n=r(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return t.append(r(`span`,null,e.title),n),t;let i=r(`button`,`review-group-toggle`),a=r(`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,$()}),t.append(i,n),t}function He(e){let t=r(`section`,`pr-queue-section`);if(t.dataset.group=e.id,t.append(Ve(e)),e.id===`aside`&&!z)return t;for(let n of e.items)t.append(Be(n,e.id===`turn`));return t}function Ue(){if(!N||!W)return!1;x()?.configured===!1&&!W.isOpen()&&W.open();let e=W.isOpen();return N.dataset.setup=String(e),W.element.hidden=!e,e}function $(){if(!P||Ue())return;L=pe(),R=oe(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,fe(),x()?.error??null]);if(e!==B){B=e,U.clear();let t=x()?.error,n=t?[r(`p`,`my-pr-note`,t)]:[],i=L.filter(e=>e.items.length>0).map(He);P.replaceChildren(...n,...i.length>0?i:[r(`p`,`pr-empty`,D(x()))])}Y()}function We(e){if(N)return;N=r(`div`,`pr-content review-queue community-queue`),e.append(N);let n=he({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=n.queue,F=r(`div`,`review-queue-detail`);let i=r(`div`,`review-queue-phone-bar`),a=r(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,Re),i.append(a),n.detail.append(i,F),I=re({onJump:()=>{let e=g(L,E).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),n.queue.before(I),W=Ee({onFinish:$}),W.element.hidden=!0,N.append(W.element,n.columns),N.dataset.detailOpen=`false`,le(()=>!t(N)),ue(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,ze),$()}var Ge={mount:We,refresh:()=>{V=null,$()}};export{Ge as view};
@@ -1,4 +1,4 @@
1
- import{C as e,F as t,I as n,L as r,at as i,it as a}from"./updates-view-core-C8XDTgVm.js";import{g as o,h as s,s as c}from"./dom-helpers-DBbFg1c_.js";import{d as l}from"./control-ws-CLjOEjA2.js";import{i as u,s as d,t as f}from"./action-status-2TEW4EL2.js";import{n as p,r as m,t as h}from"./modal-USMHOKBI.js";import{n as g}from"./session-tick-Bx-5Nn6w.js";import{Ar as _,Dr as v,In as y,Mr as b,Or as x,Tr as S,_r as C,gi as w,hi as T,jr as E,kr as D,m as O,mi as k}from"./index-BYFp_DgZ.js";import{t as ee}from"./repo-roots-adder-px00Suyi.js";import{t as te}from"./sandboxed-frame-D9MEfNuX.js";var ne=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
1
+ import{C as e,F as t,I as n,L as r,at as i,it as a}from"./updates-view-core-C8XDTgVm.js";import{g as o,h as s,s as c}from"./dom-helpers-DBbFg1c_.js";import{d as l}from"./control-ws-CLjOEjA2.js";import{i as u,s as d,t as f}from"./action-status-2TEW4EL2.js";import{n as p,r as m,t as h}from"./modal-USMHOKBI.js";import{n as g}from"./session-tick-Bx-5Nn6w.js";import{Ar as _,Dr as v,In as y,Mr as b,Or as x,Tr as S,_r as C,gi as w,hi as T,jr as E,kr as D,m as O,mi as k}from"./index-BJ26BQYS.js";import{t as ee}from"./repo-roots-adder-BGGYIVvP.js";import{t as te}from"./sandboxed-frame-D9MEfNuX.js";var ne=`<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>