glimmervoid 0.47.1-next.222 → 0.47.1-next.224

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 (104) hide show
  1. package/dist/bin/glimmervoid.js +8 -8
  2. package/dist/chunks/{adapters-qo5HtCPL.js → adapters-CKVPSK_7.js} +2 -2
  3. package/dist/chunks/{adapters-gpGifyQW.js → adapters-CygniY1v.js} +1 -1
  4. package/dist/chunks/{child-process-safe-D4hyVIXj.js → child-process-safe-BCOoKfxG.js} +13 -1
  5. package/dist/chunks/child-process-safe-BKjzSEYd.js +1 -0
  6. package/dist/chunks/{git-version-WyrLHANY.js → git-version-CtTo5o6G.js} +1 -1
  7. package/dist/chunks/{guardrails-deps-CLtLD5Xx.js → guardrails-deps-BfZSPpNs.js} +1 -1
  8. package/dist/chunks/{kimi-0FpgtX6t.js → kimi-C0-lIyFc.js} +1 -1
  9. package/dist/chunks/kimi-CZzNBlEO.js +1 -0
  10. package/dist/chunks/{main-BUfRWSqY.js → main-CmqaH5TL.js} +10 -6
  11. package/dist/chunks/{ssh-sign-cli-CkZt77Yo.js → ssh-sign-cli-BMkCBbTf.js} +1 -1
  12. package/dist/chunks/{visions-cli-9Cuk2UW-.js → visions-cli-CjIyHGvh.js} +1 -1
  13. package/dist/chunks/{visions-setup-CI2vDR18.js → visions-setup-DVl9-SzU.js} +6 -2
  14. package/dist/client/assets/{alert-sound-B-cj5tsC.js → alert-sound-Cw8xVxsx.js} +1 -1
  15. package/dist/client/assets/alert-sound-Cw8xVxsx.js.br +0 -0
  16. package/dist/client/assets/{benchmark-panel-C27CsZwm.js → benchmark-panel-D7CsB7i5.js} +1 -1
  17. package/dist/client/assets/benchmark-panel-D7CsB7i5.js.br +0 -0
  18. package/dist/client/assets/{celebration-player-MP41G2HU.js → celebration-player-BXgbhz80.js} +1 -1
  19. package/dist/client/assets/celebration-player-BXgbhz80.js.br +0 -0
  20. package/dist/client/assets/{community-panel-DNbVhbz-.js → community-panel-z-8k-GDz.js} +1 -1
  21. package/dist/client/assets/community-panel-z-8k-GDz.js.br +0 -0
  22. package/dist/client/assets/{dialogs-ZIeglyEN.js → dialogs-BW50gUgh.js} +1 -1
  23. package/dist/client/assets/dialogs-BW50gUgh.js.br +0 -0
  24. package/dist/client/assets/{doc-editor-ui-RseYMJNd.js → doc-editor-ui-COh4UP8b.js} +1 -1
  25. package/dist/client/assets/doc-editor-ui-COh4UP8b.js.br +0 -0
  26. package/dist/client/assets/{feature-hint-CI8dT0ck.js → feature-hint-DKnoBMuR.js} +1 -1
  27. package/dist/client/assets/feature-hint-DKnoBMuR.js.br +0 -0
  28. package/dist/client/assets/{first-run-checklist-Dlu9Ugqf.js → first-run-checklist-DWvtgfnr.js} +1 -1
  29. package/dist/client/assets/first-run-checklist-DWvtgfnr.js.br +0 -0
  30. package/dist/client/assets/{hooks-panel-Ct1ripf1.js → hooks-panel-DrN2VuXj.js} +1 -1
  31. package/dist/client/assets/hooks-panel-DrN2VuXj.js.br +0 -0
  32. package/dist/client/assets/{index-Bye4joWG.js → index-DRLA5ds-.js} +5 -5
  33. package/dist/client/assets/index-DRLA5ds-.js.br +0 -0
  34. package/dist/client/assets/{issues-panel-B_G1UGeX.js → issues-panel-Bt_eKYgp.js} +1 -1
  35. package/dist/client/assets/issues-panel-Bt_eKYgp.js.br +0 -0
  36. package/dist/client/assets/{my-prs-panel-toGqR3Vo.js → my-prs-panel-DxGhVulR.js} +1 -1
  37. package/dist/client/assets/my-prs-panel-DxGhVulR.js.br +0 -0
  38. package/dist/client/assets/{nyan-cat-615DLGI7.js → nyan-cat-DTH2X4jx.js} +1 -1
  39. package/dist/client/assets/nyan-cat-DTH2X4jx.js.br +0 -0
  40. package/dist/client/assets/{phone-shell-C2_5FBYv.js → phone-shell-BQKCOwwF.js} +1 -1
  41. package/dist/client/assets/phone-shell-BQKCOwwF.js.br +0 -0
  42. package/dist/client/assets/{plan-face-Cgdvkjxs.js → plan-face-CYKRhKjo.js} +1 -1
  43. package/dist/client/assets/plan-face-CYKRhKjo.js.br +0 -0
  44. package/dist/client/assets/{plan-render-BTy-0au6.js → plan-render-S3XuSq5c.js} +1 -1
  45. package/dist/client/assets/plan-render-S3XuSq5c.js.br +0 -0
  46. package/dist/client/assets/{pr-queue-columns-nJpOvlEV.js → pr-queue-columns-Cwek98PT.js} +1 -1
  47. package/dist/client/assets/pr-queue-columns-Cwek98PT.js.br +0 -0
  48. package/dist/client/assets/{radar-panel-D8bpWu_m.js → radar-panel-BUCGPkiw.js} +1 -1
  49. package/dist/client/assets/radar-panel-BUCGPkiw.js.br +0 -0
  50. package/dist/client/assets/{repo-roots-adder-CNbhoJqy.js → repo-roots-adder-DRaj-PJ9.js} +1 -1
  51. package/dist/client/assets/repo-roots-adder-DRaj-PJ9.js.br +0 -0
  52. package/dist/client/assets/{resume-dialog-BzGiej6M.js → resume-dialog-B2Q9bWiI.js} +1 -1
  53. package/dist/client/assets/resume-dialog-B2Q9bWiI.js.br +0 -0
  54. package/dist/client/assets/{review-queue-panel-BrkF-Ssk.js → review-queue-panel-DMpEF9Pv.js} +1 -1
  55. package/dist/client/assets/review-queue-panel-DMpEF9Pv.js.br +0 -0
  56. package/dist/client/assets/{settings-panel-CAHUaaq_.js → settings-panel-gVtwe2cs.js} +2 -2
  57. package/dist/client/assets/settings-panel-gVtwe2cs.js.br +0 -0
  58. package/dist/client/assets/{shown-lightbox-Cz0gRsaS.js → shown-lightbox-D9NvJCnm.js} +1 -1
  59. package/dist/client/assets/shown-lightbox-D9NvJCnm.js.br +0 -0
  60. package/dist/client/assets/{team-review-panel-CWGX0ef4.js → team-review-panel-Cv-yFIFQ.js} +1 -1
  61. package/dist/client/assets/team-review-panel-Cv-yFIFQ.js.br +0 -0
  62. package/dist/client/assets/{trace-panel-DZMqJG9i.js → trace-panel-CzYKmt8L.js} +1 -1
  63. package/dist/client/assets/trace-panel-CzYKmt8L.js.br +0 -0
  64. package/dist/client/assets/{usage-panel-B6SE3XsE.js → usage-panel-C0Z_2kOp.js} +1 -1
  65. package/dist/client/assets/usage-panel-C0Z_2kOp.js.br +0 -0
  66. package/dist/client/assets/{visions-panel-CFA0uJXY.js → visions-panel-DKd0Mjx4.js} +1 -1
  67. package/dist/client/assets/visions-panel-DKd0Mjx4.js.br +0 -0
  68. package/dist/client/index.html +1 -1
  69. package/dist/client/index.html.br +0 -0
  70. package/dist/scripts/postinstall-path-check.js +1 -1
  71. package/dist/server/index.js +1 -1
  72. package/dist/session/guardrails-open-launcher.js +1 -1
  73. package/dist/session/hook-tool-relay.js +1 -1
  74. package/dist/session/statusline-relay.js +1 -1
  75. package/package.json +1 -1
  76. package/dist/chunks/child-process-safe-CjVtRjDD.js +0 -1
  77. package/dist/chunks/kimi-KfPIm796.js +0 -1
  78. package/dist/client/assets/alert-sound-B-cj5tsC.js.br +0 -0
  79. package/dist/client/assets/benchmark-panel-C27CsZwm.js.br +0 -0
  80. package/dist/client/assets/celebration-player-MP41G2HU.js.br +0 -0
  81. package/dist/client/assets/community-panel-DNbVhbz-.js.br +0 -0
  82. package/dist/client/assets/dialogs-ZIeglyEN.js.br +0 -0
  83. package/dist/client/assets/doc-editor-ui-RseYMJNd.js.br +0 -0
  84. package/dist/client/assets/feature-hint-CI8dT0ck.js.br +0 -0
  85. package/dist/client/assets/first-run-checklist-Dlu9Ugqf.js.br +0 -0
  86. package/dist/client/assets/hooks-panel-Ct1ripf1.js.br +0 -0
  87. package/dist/client/assets/index-Bye4joWG.js.br +0 -0
  88. package/dist/client/assets/issues-panel-B_G1UGeX.js.br +0 -0
  89. package/dist/client/assets/my-prs-panel-toGqR3Vo.js.br +0 -0
  90. package/dist/client/assets/nyan-cat-615DLGI7.js.br +0 -0
  91. package/dist/client/assets/phone-shell-C2_5FBYv.js.br +0 -0
  92. package/dist/client/assets/plan-face-Cgdvkjxs.js.br +0 -0
  93. package/dist/client/assets/plan-render-BTy-0au6.js.br +0 -0
  94. package/dist/client/assets/pr-queue-columns-nJpOvlEV.js.br +0 -0
  95. package/dist/client/assets/radar-panel-D8bpWu_m.js.br +0 -0
  96. package/dist/client/assets/repo-roots-adder-CNbhoJqy.js.br +0 -0
  97. package/dist/client/assets/resume-dialog-BzGiej6M.js.br +0 -0
  98. package/dist/client/assets/review-queue-panel-BrkF-Ssk.js.br +0 -0
  99. package/dist/client/assets/settings-panel-CAHUaaq_.js.br +0 -0
  100. package/dist/client/assets/shown-lightbox-Cz0gRsaS.js.br +0 -0
  101. package/dist/client/assets/team-review-panel-CWGX0ef4.js.br +0 -0
  102. package/dist/client/assets/trace-panel-DZMqJG9i.js.br +0 -0
  103. package/dist/client/assets/usage-panel-B6SE3XsE.js.br +0 -0
  104. package/dist/client/assets/visions-panel-CFA0uJXY.js.br +0 -0
@@ -4,11 +4,11 @@ import { i as errorText } from "../chunks/text-DoirglWV.js";
4
4
  import { o as packageRoot } from "../chunks/runtime-paths-ghcH9CeW.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-B2Wieg0a.js";
7
- import { i as execSync } from "../chunks/child-process-safe-D4hyVIXj.js";
7
+ import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
8
8
  import { r as agentCommandHelpLines } from "../chunks/agent-api-core-DRLkUcDo.js";
9
9
  import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
10
- import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-WyrLHANY.js";
11
- import { i as guardrailsDoctorRows, r as probeGuardrailsDependencies } from "../chunks/guardrails-deps-CLtLD5Xx.js";
10
+ import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-CtTo5o6G.js";
11
+ import { i as guardrailsDoctorRows, r as probeGuardrailsDependencies } from "../chunks/guardrails-deps-BfZSPpNs.js";
12
12
  import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
13
13
  import fs from "node:fs";
14
14
  import path from "node:path";
@@ -77,11 +77,11 @@ var OWN_SUBCOMMAND_RUNNERS = [
77
77
  return runSettingsCli(subcommandArgs);
78
78
  }],
79
79
  ["visions", async (subcommandArgs) => {
80
- const { runVisionsCli } = await import("../chunks/visions-cli-9Cuk2UW-.js");
80
+ const { runVisionsCli } = await import("../chunks/visions-cli-CjIyHGvh.js");
81
81
  return runVisionsCli(subcommandArgs);
82
82
  }],
83
83
  ["ssh-sign", async (subcommandArgs) => {
84
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-CkZt77Yo.js");
84
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BMkCBbTf.js");
85
85
  return runSshSignCli(subcommandArgs);
86
86
  }]
87
87
  ];
@@ -234,7 +234,7 @@ async function runDoctor() {
234
234
  }
235
235
  switchSection("Agents");
236
236
  try {
237
- const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-gpGifyQW.js");
237
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-CygniY1v.js");
238
238
  const declaredCustomAgents = await readDeclaredCustomAgents();
239
239
  if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
240
240
  setCustomAgents(declaredCustomAgents.declared);
@@ -245,7 +245,7 @@ async function runDoctor() {
245
245
  const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-CwjtzaC0.js");
246
246
  const grokSetup = inspectGrokAgentSetup();
247
247
  line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
248
- const { default: kimi } = await import("../chunks/kimi-KfPIm796.js");
248
+ const { default: kimi } = await import("../chunks/kimi-CZzNBlEO.js");
249
249
  const { describeKimiHome } = await import("../chunks/kimi-home-DEuu2e0l.js");
250
250
  line("kimi home", describeKimiHome(kimi.expectedHooksBlock()));
251
251
  } catch (err) {
@@ -254,7 +254,7 @@ async function runDoctor() {
254
254
  switchSection("Sane YOLO");
255
255
  try {
256
256
  const { resolvePackageBin } = await import("../chunks/runtime-paths-Cc0_ZR6V.js");
257
- const { execFileSync } = await import("../chunks/child-process-safe-CjVtRjDD.js");
257
+ const { execFileSync } = await import("../chunks/child-process-safe-BKjzSEYd.js");
258
258
  const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-CwjtzaC0.js");
259
259
  const binPath = resolvePackageBin("cc-safety-net", "cc-safety-net");
260
260
  line("Sane YOLO", binPath || "not installed");
@@ -1,6 +1,6 @@
1
1
  import { s as relayPath } from "./runtime-paths-ghcH9CeW.js";
2
2
  import { Lt as FULL_SHA_RE, zt as shortSha$1 } from "./session-B2Wieg0a.js";
3
- import { n as execFileAsync, r as execFileSync } from "./child-process-safe-D4hyVIXj.js";
3
+ import { i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
4
4
  import { Ot as UpdateChannel, S as InstallFlavor, c as SHELL_AGENT_ID } from "./config-B4X9G6EN.js";
5
5
  import { o as supervisionLine } from "./session-routes-Cr9S--Nf.js";
6
6
  import { c as textOr, i as numberOr, s as rawTextOr } from "./coerce-NSst8oRP.js";
@@ -12,7 +12,7 @@ import { t as buildAgentEnv } from "./spawn-env-C-PfRa2d.js";
12
12
  import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
13
13
  import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-z6bXbyuG.js";
14
14
  import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-DTsNiNtD.js";
15
- import { t as kimi } from "./kimi-0FpgtX6t.js";
15
+ import { t as kimi } from "./kimi-C0-lIyFc.js";
16
16
  import fs from "node:fs";
17
17
  import path from "node:path";
18
18
  //#region session/adapters/claude-code.ts
@@ -1 +1 @@
1
- export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-qo5HtCPL.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-CKVPSK_7.js";
@@ -1,6 +1,14 @@
1
1
  import cp from "node:child_process";
2
2
  import { promisify } from "node:util";
3
3
  //#region server/child-process-safe.ts
4
+ var refusedNodePath = null;
5
+ function refuseLaunchesOf(nodePath) {
6
+ refusedNodePath = nodePath;
7
+ }
8
+ function assertLaunchable(file) {
9
+ if (file !== refusedNodePath) return;
10
+ throw new Error(`[launch] refused ${file}: launch Node through stableNodePath from server/stable-node-path.ts, because a Node upgrade deletes this path under the running server`);
11
+ }
4
12
  function hide(options) {
5
13
  if (!options || typeof options !== "object") return { windowsHide: true };
6
14
  return {
@@ -25,10 +33,12 @@ function split(rest) {
25
33
  };
26
34
  }
27
35
  var execFile = Object.assign(function execFile(file, ...rest) {
36
+ assertLaunchable(file);
28
37
  const { args, options, callback } = split(rest);
29
38
  const execOptions = hide(options);
30
39
  return cp.execFile(file, args, execOptions, callback);
31
40
  }, { [promisify.custom]: (file, ...rest) => new Promise((resolve, reject) => {
41
+ assertLaunchable(file);
32
42
  const { args, options } = split(rest);
33
43
  const { input, ...commandOptions } = options ?? {};
34
44
  const execOptions = hide(commandOptions);
@@ -54,6 +64,7 @@ var execFile = Object.assign(function execFile(file, ...rest) {
54
64
  child.stdin.end(input);
55
65
  }) });
56
66
  function execFileSync(file, ...rest) {
67
+ assertLaunchable(file);
57
68
  const { args, options } = split(rest);
58
69
  const execOptions = hide(options);
59
70
  if (args) return cp.execFileSync(file, args, execOptions);
@@ -63,6 +74,7 @@ function execSync(command, options) {
63
74
  return cp.execSync(command, hide(options));
64
75
  }
65
76
  function spawn(file, ...rest) {
77
+ assertLaunchable(file);
66
78
  const { args, options } = split(rest);
67
79
  const spawnOptions = hide(options);
68
80
  if (args) return cp.spawn(file, args, spawnOptions);
@@ -70,4 +82,4 @@ function spawn(file, ...rest) {
70
82
  }
71
83
  var execFileAsync = promisify(execFile);
72
84
  //#endregion
73
- export { hide as a, execSync as i, execFileAsync as n, spawn as o, execFileSync as r, execFile as t };
85
+ export { execSync as a, spawn as c, execFileSync as i, execFile as n, hide as o, execFileAsync as r, refuseLaunchesOf as s, assertLaunchable as t };
@@ -0,0 +1 @@
1
+ export { i as execFileSync } from "./child-process-safe-BCOoKfxG.js";
@@ -1,5 +1,5 @@
1
1
  import { t as AGENT_API_VERBS } from "./session-B2Wieg0a.js";
2
- import { r as execFileSync } from "./child-process-safe-D4hyVIXj.js";
2
+ import { i as execFileSync } from "./child-process-safe-BCOoKfxG.js";
3
3
  //#region server/core/command-line-core.ts
4
4
  var SUBCOMMANDS_HONORING_TRAILING_GLOBAL_OPTIONS = /* @__PURE__ */ new Set([
5
5
  "doctor",
@@ -1,4 +1,4 @@
1
- import { i as execSync } from "./child-process-safe-D4hyVIXj.js";
1
+ import { a as execSync } from "./child-process-safe-BCOoKfxG.js";
2
2
  import { i as resolvePathCommandMatches } from "./spawn-command-CQECOvjC.js";
3
3
  //#region server/guardrails/core/guardrails-deps-core.ts
4
4
  var LINUX_GUARDRAILS_BINARIES = Object.freeze([
@@ -1,6 +1,6 @@
1
1
  import { s as relayPath } from "./runtime-paths-ghcH9CeW.js";
2
2
  import { r as ASK_USER_QUESTION_TOOL_NAME } from "./session-B2Wieg0a.js";
3
- import { r as execFileSync } from "./child-process-safe-D4hyVIXj.js";
3
+ import { i as execFileSync } from "./child-process-safe-BCOoKfxG.js";
4
4
  import { n as resolveAgentCommand, t as buildAgentSpawnCommand } from "./spawn-command-CQECOvjC.js";
5
5
  import { t as KIMI_SANE_YOLO_FLAVOR } from "./sane-yolo-DSyFqbVE.js";
6
6
  import { t as buildAgentEnv } from "./spawn-env-C-PfRa2d.js";
@@ -0,0 +1 @@
1
+ export { t as default } from "./kimi-C0-lIyFc.js";
@@ -4,13 +4,13 @@ import { a as sanitizeWorktreeName, i as safePathSegment, n as equalsIgnoringCas
4
4
  import { c as resolvePackageBin, i as clientDir, n as bundled, o as packageRoot, r as cliPath, s as relayPath, t as assetRoot } from "./runtime-paths-ghcH9CeW.js";
5
5
  import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
6
6
  import { At as TeamReviewThreadCommentsResponse, B as MyPr, Bt as GH_SEGMENT, C as SESSION_DOC_BODY_CAP_BYTES, Ct as ReviewVerdict, D as SHOWN_FILE_CAP_BYTES, Dt as TeamReviewResolveResponse, E as SESSION_NAME_RULE_TEXT, Et as TeamReviewCompareFiles, F as SshSignRequest, H as MyPrCheckContext, Ht as REPO_SLUG_RE, It as hasStandingViewerApproval, J as MyPrMergeRequest, Jt as BADGE_LABELS, K as MyPrLaneEntry, L as TaskTitle, Mt as TeamReviewThreadsRepository, N as ShownFile, Nt as canApproveAfterComment, O as SIGN_URL_ENV, Ot as TeamReviewStateEntry, Pt as decisionAsIfApprovalRequired, Qt as STATES, Rt as HEX_SHA_RE, St as ReviewThreadId, T as SESSION_NAME_PATTERN, U as MyPrCheckContextsResponse, Ut as repoParts, V as MyPrAutoRebase, Vt as NODE_ID_RE, W as MyPrKeepMergeableRequest, X as MyPrMergeStateResponse, Xt as MERGEABLE_LIVE_STATES, Yt as KILLABLE_STATES, Z as MyPrMergeWhenReadyRequest, Zt as RESTARTABLE_STATES, _ as CONVERSATION_PERMISSION_HOOK_EVENT, b as ConversationQuestion, bt as ReviewFinding, ct as CommitSha, dt as FindingSeverity, et as MyPrThreadNode, g as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, gt as PrDetail, h as COHERENCE_HOOKS_INACTIVE, ht as PostingPlan, jt as TeamReviewThreadResult, k as SSH_SIGN_BODY_CAP_BYTES, kt as TeamReviewStatus, lt as DECIDING_REVIEW_STATES, mt as PostedReviewEvent, n as AGENT_URL_ENV, nt as MyPrsSnapshot, pt as GithubReviewState, q as MyPrMergeMethod, r as ASK_USER_QUESTION_TOOL_NAME, rt as MyPrsState, tt as MyPrThreadsResponse, ut as EarlierReview, v as CONVERSATION_TOOL_RESULT_HOOK_EVENT, vt as ReviewComment, wt as TeamReviewActionRequest, xt as ReviewResult, yt as ReviewDraft, z as LinkedPr, zt as shortSha } from "./session-B2Wieg0a.js";
7
- import { n as execFileAsync, o as spawn, r as execFileSync, t as execFile } from "./child-process-safe-D4hyVIXj.js";
7
+ import { c as spawn, i as execFileSync, n as execFile, r as execFileAsync, t as assertLaunchable } from "./child-process-safe-BCOoKfxG.js";
8
8
  import { $t as issuePullRequestStateFromGithub, A as HINT_VIEW_BY_FEATURE, At as SessionSetup, B as MergedPrListing, Bt as PLAN_RESULT_HOOK_EVENT, Ct as CommunityItem, D as pullRequestKeyFromReference, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as ChangeMap, G as GithubPrLightSearchNode, Gt as planTitle, H as PrCheckoutCaseInput, Ht as PlanDecision, I as BenchmarkRun, It as changeMapFactId, J as WorkflowCommentBody, Jt as IssueKey, K as GithubPrsFrame, Kt as GithubIssuePullRequestsRepository, L as BenchmarkStatus, Lt as PLAN_BODY_CAP_BYTES, M as BenchmarkActionRequest, Mt as TraceCheckpoint, N as BenchmarkCase, Nt as TraceRecord, O as FeatureHintState, P as BenchmarkId, Pt as CoherenceJournalOutput, Qt as IssuesStatus, R as BenchmarkSuite, Rt as PLAN_HOOK_EVENT, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanRevision, V as MinedPrReviewData, Vt as PLAN_TOOL_NAME, W as GithubPrKey, Wt as parseExitPlanModeHookPayload, X as WorkflowsSettings, Xt as IssuesSearchResponse, Y as WorkflowLabelName, Yt as IssueUpdate, Z as WorkflowsState, Zt as IssuesState, a as ConfigUpdate, b as ClientMessage, c as SHELL_AGENT_ID, f as ReviewAgentId, g as CHANGES_POLL_INTERVAL_MS, gt as USAGE_INTEGER_RANGES, jt as MAX_RAW_LINE_CHARS, k as HINT_FEATURES, kt as UpdateJournal, m as USAGE_VENDOR_KEYS, p as USAGE_COST_MODES, q as comparablePrKey, qt as GithubIssueResponse, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CLIENT_LOG_TEXT_MAX_CHARS, wt as CommunityState, xt as CommunityActionRequest, y as CONTROL_FRAME_MAX_BYTES, z as CommitComparison, zt as PLAN_HOOK_OUTPUT_MAX_CHARS } from "./config-B4X9G6EN.js";
9
9
  import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-Cr9S--Nf.js";
10
10
  import { A as resolveTaskTitle, B as listRepoConversations, C as extractOscTaskTitle, D as parseRefinedSessionName, E as isSubstantivePrompt, F as resolveResumeTarget, H as isAutoNameOf, I as resumePromptFor, L as shouldAdoptReportedResumeId, M as AUTO_CONTINUE_PROMPT, N as RESUME_ID_RE, O as parseRefinedTaskTitle, P as pickAutoResume, R as claudeProjectsDir, S as extractHookTaskTitle, T as isSelfWakePrompt, U as nextSuggestedName, V as listRepoWorktreePaths, _ as buildTaskTitleRefinementPrompt, a as decideSpawnAllowance, b as decideTaskTitleRefinement, c as describeKeptChildAttention, d as describeUnpushedCloseRefusal, g as buildPersistedTaskTitle, h as projectReviews, i as decideAgentRequest, j as seedTaskTitleSources, k as resolveRefocusTaskTitle, l as describePushLanding, m as projectMyPrs, n as REFUSAL_REASON, o as deriveChildSessionName, p as parseAgentVerb, s as describeChildEndNote, u as describeRoleRefusal, v as chooseRefinedSessionName, w as extractPromptTaskTitle, x as extractAiTitle, y as cleanTaskPrompt, z as encodeProjectDir } from "./agent-api-core-DRLkUcDo.js";
11
11
  import { a as positiveIntOr, c as textOr, i as numberOr, n as isRecord, o as positiveNumberOr, r as nonNegativeIntOr, s as rawTextOr, t as coercedNumberOr } from "./coerce-NSst8oRP.js";
12
- import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-WyrLHANY.js";
13
- import { n as checkGuardrailsDependencies, t as allowGuardedSpawn } from "./guardrails-deps-CLtLD5Xx.js";
12
+ import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-CtTo5o6G.js";
13
+ import { n as checkGuardrailsDependencies, t as allowGuardedSpawn } from "./guardrails-deps-BfZSPpNs.js";
14
14
  import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
15
15
  import { t as HOOK_VIA_GUARDRAILS_PROXY_ENV } from "./guardrails-proxy-core-BI3rdY-m.js";
16
16
  import { n as refocusReplyFor } from "./refocus-core-CwP_KIcU.js";
@@ -24,10 +24,10 @@ import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
24
24
  import { C as parseCgroupBytes, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, f as writeTextAtomic, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-BjFK_eSH.js";
25
25
  import { $ as DEFAULT_BRANCH_GC_PREFIXES, A as isExperimentalSetting, B as claudeAccountUuidOf, F as buildAiGenerationEvents, G as exceptionFingerprint, H as decideIsDevInstall, I as buildBrowserExceptionProperties, J as resolveProjectToken, K as nodeMajorVersion, L as buildExceptionProperties, M as TELEMETRY_BATCH_URL, N as TELEMETRY_FLAGS_URL, P as adapterBucket, R as buildPersonProperties, U as decideRemoteTelemetryState, V as codexUserIdOf, W as decideTelemetryConsent, Z as stableConfigKey, _ as SETTINGS_INDEX, a as ensureProjectIds, at as worktreeIntegrationTips, ct as isSameDirectoryPath, et as matchedPrefix, g as validateSettingsBlock, h as settingsBlockSpecFor, i as createConfigStore, it as usablePrefixes, j as FIRST_RUN_NOTICE, m as mergeSettingsBlock, n as DEFAULT_CONFIG, nt as planWorktreeGc, o as generateProjectId, ot as canonicalizePath, q as parsePosthogReleaseId, rt as sessionIdFromBranch, s as glimmervoidHomeDir$1, st as comparableDirectoryPath, t as ABORT_CONFIG_SAVE, tt as planBranchGc, z as classifySessionExit } from "./config-store-CdZUjqvn.js";
26
26
  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-DTsNiNtD.js";
27
- import { $ as identityFromRelPath, A as decideFileRead, B as sessionsRootCandidates, C as pickNewestPublished, D as codexRootCandidates, E as codexHomes, F as kimiHomes, G as kimiSessionIdFromPath, H as shouldPersistWarehouse, I as passOutcome, J as dedupKeys, K as parseKimiUsageLine, L as projectDirCandidates, M as expandTilde, N as grokHomes, O as codexSessionIdFromPath, P as isUsageFile, Q as foldReplacementIntoGenerationRollup, R as resolveProjectsDirs, S as parseResolvedSha, T as codexFallbackRoots, U as splitLines$1, V as shouldEvaluateDespiteIoFailures, W as kimiDedupIdentity, X as expandAdvisorIterations, Y as emptyTotals, Z as foldEntryIntoGenerationRollup, _ as isCheckFresh, a as describeAgentResolvability, at as totalTokensOf$1, b as parseRegistryDeprecation, c as isKnownAgentId, ct as claudeCode, d as resolveAdapter, et as isWithinGenerationRecencyWindow, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, it as shouldReplace, j as dedupeCodexFiles, k as continuationDelayMs, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, nt as parseJsonLine, o as getAdapter, ot as vendorUsageEntry, p as codex, q as addEntryToTotals, r as commandFor, rt as parseUsageLine, s as hookProfileOf, st as HOOK_TOOLS, t as DEFAULT_AGENT_ID, tt as mergeGenerationRollups, u as resetCommandCache, v as normalizeSha, w as shortSha$1, x as parseRegistryLatest, y as normalizeUpdateChannel, z as scopedClaudeRoots } from "./adapters-qo5HtCPL.js";
27
+ import { $ as identityFromRelPath, A as decideFileRead, B as sessionsRootCandidates, C as pickNewestPublished, D as codexRootCandidates, E as codexHomes, F as kimiHomes, G as kimiSessionIdFromPath, H as shouldPersistWarehouse, I as passOutcome, J as dedupKeys, K as parseKimiUsageLine, L as projectDirCandidates, M as expandTilde, N as grokHomes, O as codexSessionIdFromPath, P as isUsageFile, Q as foldReplacementIntoGenerationRollup, R as resolveProjectsDirs, S as parseResolvedSha, T as codexFallbackRoots, U as splitLines$1, V as shouldEvaluateDespiteIoFailures, W as kimiDedupIdentity, X as expandAdvisorIterations, Y as emptyTotals, Z as foldEntryIntoGenerationRollup, _ as isCheckFresh, a as describeAgentResolvability, at as totalTokensOf$1, b as parseRegistryDeprecation, c as isKnownAgentId, ct as claudeCode, d as resolveAdapter, et as isWithinGenerationRecencyWindow, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, it as shouldReplace, j as dedupeCodexFiles, k as continuationDelayMs, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, nt as parseJsonLine, o as getAdapter, ot as vendorUsageEntry, p as codex, q as addEntryToTotals, r as commandFor, rt as parseUsageLine, s as hookProfileOf, st as HOOK_TOOLS, t as DEFAULT_AGENT_ID, tt as mergeGenerationRollups, u as resetCommandCache, v as normalizeSha, w as shortSha$1, x as parseRegistryLatest, y as normalizeUpdateChannel, z as scopedClaudeRoots } from "./adapters-CKVPSK_7.js";
28
28
  import { c as releaseUnheldKimiHomeSecrets, d as sessionIdOfLockFile, f as trashSessionTempFolderOnceUnheld, i as kimiHomeLinkRefusal, l as createHeldSessionTempFolder, n as generatedKimiHomePath, o as realKimiHome, u as releaseSessionLock } from "./kimi-home-WZ9E4f-u.js";
29
- import { t as kimi } from "./kimi-0FpgtX6t.js";
30
- import { _ as escapeMarkup, g as createLaneLog, n as createVisionsSetup, v as stableNodePath } from "./visions-setup-CI2vDR18.js";
29
+ import { t as kimi } from "./kimi-C0-lIyFc.js";
30
+ import { _ as escapeMarkup, g as createLaneLog, n as createVisionsSetup, v as refuseRunningNodeLaunches, y as stableNodePath } from "./visions-setup-DVl9-SzU.js";
31
31
  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";
32
32
  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-geigo1iu.js";
33
33
  import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-BWm0p8no.js";
@@ -19129,6 +19129,7 @@ var Session = class extends EventEmitter {
19129
19129
  this._agentSpawnsInFlight = 0;
19130
19130
  this._ptySpawn = ptySpawn || ((file, args, opts) => {
19131
19131
  requireExecutableSpawnHelper();
19132
+ assertLaunchable(file);
19132
19133
  return pty.spawn(file, args, opts);
19133
19134
  });
19134
19135
  this._prepareGuardrails = prepareGuardrails;
@@ -56946,6 +56947,7 @@ function decideConnectExit({ agent, exitCode, source, wasCancelled, hasTimedOut
56946
56947
  var CONNECTABLE_AGENTS = Object.freeze(["claude-code", "codex"]);
56947
56948
  function spawnConnectPty(file, args, options) {
56948
56949
  requireExecutableSpawnHelper();
56950
+ assertLaunchable(file);
56949
56951
  return pty.spawn(file, args, options);
56950
56952
  }
56951
56953
  async function makePrivateDir(directory) {
@@ -59029,10 +59031,12 @@ function createCoherenceSessionFeed({ broadcastControl, debounceMs = 1500, now =
59029
59031
  var AGENT_INGRESS_HOST = "127.0.0.1";
59030
59032
  function createBackend(httpServer, options = {}) {
59031
59033
  if (isOperatorHomeUnderTest(os.homedir(), process.env)) throw new Error("createBackend refused to boot on the operator's Glimmervoid home under node:test; run tests through npm test or npm run test:files, which isolate GLIMMERVOID_HOME");
59034
+ refuseRunningNodeLaunches();
59032
59035
  const { staticDir = "auto", settingsDefaults } = options;
59033
59036
  const packageJson = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"));
59034
59037
  const configStore = createConfigStore({
59035
59038
  settingsDefaults,
59039
+ isExperimentalBuild: options.isExperimentalBuild,
59036
59040
  readTelemetryInstallId: () => telemetry.currentInstallId()
59037
59041
  });
59038
59042
  const { config } = configStore;
@@ -1,6 +1,6 @@
1
1
  import { r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { O as SIGN_URL_ENV, P as SshSignReply } from "./session-B2Wieg0a.js";
3
- import { n as execFileAsync, o as spawn } from "./child-process-safe-D4hyVIXj.js";
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
5
  import { n as postToAgentIngress } from "./agent-api-cli-DIyFHMQ_.js";
6
6
  import { l as parseSshPublicKey } from "./ssh-signing-core-CRhVVWNW.js";
@@ -1,5 +1,5 @@
1
1
  import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
2
- import { a as relayInvocationOptions, c as unwireEverything, d as extensionIdOf, f as buildSetupGuide, h as isExtensionInstalled, i as packVsix, l as wireEverything, m as recipeIds, o as resolveRelayInvocation, p as commandLine, r as editorExtensions, s as resolvedEditorPaths, t as RELAY_PATH, u as editorTargets } from "./visions-setup-CI2vDR18.js";
2
+ import { a as relayInvocationOptions, c as unwireEverything, d as extensionIdOf, f as buildSetupGuide, h as isExtensionInstalled, i as packVsix, l as wireEverything, m as recipeIds, o as resolveRelayInvocation, p as commandLine, r as editorExtensions, s as resolvedEditorPaths, t as RELAY_PATH, u as editorTargets } from "./visions-setup-DVl9-SzU.js";
3
3
  import fs from "node:fs";
4
4
  //#region server/visions/visions-cli.ts
5
5
  function fileOutcomeRows(files) {
@@ -1,7 +1,7 @@
1
1
  import { r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { r as isPathInside } from "./paths-Bu4eH1Yd.js";
3
3
  import { a as extensionDir, n as bundled, o as packageRoot, r as cliPath, s as relayPath } from "./runtime-paths-ghcH9CeW.js";
4
- import { i as execSync, n as execFileAsync, r as execFileSync } from "./child-process-safe-D4hyVIXj.js";
4
+ import { a as execSync, i as execFileSync, r as execFileAsync, s as refuseLaunchesOf } from "./child-process-safe-BCOoKfxG.js";
5
5
  import { n as isRecord } from "./coerce-NSst8oRP.js";
6
6
  import { i as resolvePathCommandMatches, r as resolveArgvCommandMatches } from "./spawn-command-CQECOvjC.js";
7
7
  import { stripTypeScriptTypes } from "node:module";
@@ -25,6 +25,10 @@ function findStableNodePath() {
25
25
  }).find((candidate) => realpathOrNull(candidate) === runningNodeRealpath) ?? process.execPath;
26
26
  }
27
27
  var stableNodePath = findStableNodePath();
28
+ function refuseRunningNodeLaunches() {
29
+ if (stableNodePath === process.execPath) return;
30
+ refuseLaunchesOf(process.execPath);
31
+ }
28
32
  //#endregion
29
33
  //#region shared/escape-markup.ts
30
34
  function escapeMarkup(value) {
@@ -1431,4 +1435,4 @@ function createVisionsSetup({ getConfig = () => ({}), configStore = null, logger
1431
1435
  return { maybeApply };
1432
1436
  }
1433
1437
  //#endregion
1434
- export { escapeMarkup as _, relayInvocationOptions as a, unwireEverything as c, extensionIdOf as d, buildSetupGuide as f, createLaneLog as g, isExtensionInstalled as h, packVsix as i, wireEverything as l, recipeIds as m, createVisionsSetup as n, resolveRelayInvocation as o, commandLine as p, editorExtensions as r, resolvedEditorPaths as s, RELAY_PATH as t, editorTargets as u, stableNodePath as v };
1438
+ export { escapeMarkup as _, relayInvocationOptions as a, unwireEverything as c, extensionIdOf as d, buildSetupGuide as f, createLaneLog as g, isExtensionInstalled as h, packVsix as i, wireEverything as l, recipeIds as m, createVisionsSetup as n, resolveRelayInvocation as o, commandLine as p, editorExtensions as r, resolvedEditorPaths as s, RELAY_PATH as t, editorTargets as u, refuseRunningNodeLaunches as v, stableNodePath as y };
@@ -1 +1 @@
1
- import{$i as e,Qi as t,Xi as n,Zi as r,ea as i,na as a,ra as o,ta as s}from"./index-Bye4joWG.js";var c=.3,l=null;function u(){return o(l)}function d(e){return a(e,l)}async function f(){try{let e=await fetch(n,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(t[e]??t.chime)}function g(e){let t=p(),n=t.createGain();n.gain.value=e.peakGain,n.connect(t.destination);let r=t.currentTime,i=0;for(let a of e.tones){let e=r+a.startSeconds,o=e+a.durationSeconds,s=t.createOscillator(),c=t.createGain();s.type=a.waveform,s.frequency.setValueAtTime(a.frequency,e),a.endFrequency&&s.frequency.exponentialRampToValueAtTime(a.endFrequency,o),c.gain.setValueAtTime(.001,e),c.gain.exponentialRampToValueAtTime(a.gain??1,e+.01),c.gain.exponentialRampToValueAtTime(.001,o),s.connect(c),c.connect(n),s.start(e),s.stop(o),i=Math.max(i,a.startSeconds+a.durationSeconds)}m(t,i)}async function _(e){try{let t=await fetch(i(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(r)}catch{}}function S(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
1
+ import{$i as e,Qi as t,Xi as n,Zi as r,ea as i,na as a,ra as o,ta as s}from"./index-DRLA5ds-.js";var c=.3,l=null;function u(){return o(l)}function d(e){return a(e,l)}async function f(){try{let e=await fetch(n,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(t[e]??t.chime)}function g(e){let t=p(),n=t.createGain();n.gain.value=e.peakGain,n.connect(t.destination);let r=t.currentTime,i=0;for(let a of e.tones){let e=r+a.startSeconds,o=e+a.durationSeconds,s=t.createOscillator(),c=t.createGain();s.type=a.waveform,s.frequency.setValueAtTime(a.frequency,e),a.endFrequency&&s.frequency.exponentialRampToValueAtTime(a.endFrequency,o),c.gain.setValueAtTime(.001,e),c.gain.exponentialRampToValueAtTime(a.gain??1,e+.01),c.gain.exponentialRampToValueAtTime(.001,o),s.connect(c),c.connect(n),s.start(e),s.stop(o),i=Math.max(i,a.startSeconds+a.durationSeconds)}m(t,i)}async function _(e){try{let t=await fetch(i(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(r)}catch{}}function S(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
@@ -1 +1 @@
1
- import"./updates-view-core-Dxvxlb5s.js";import{n as e,o as t,r as n}from"./dom-helpers-ScgOMqDW.js";import{J as r,Y as i,q as a}from"./index-Bye4joWG.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,n,i){let a=t(`button`,`bench-action-button`,o[n]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,n)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let n=t(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(n.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(n.dataset.degraded=`true`),n}function p(e){let n=e.armIds.filter(t=>t!==e.baselineArm),r=t(`table`,`bench-table`),i=t(`tr`);i.append(t(`th`,null,`Case`),...e.armIds.map(n=>t(`th`,null,n===e.baselineArm?`${n} (baseline)`:n))),i.append(...n.map(e=>t(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=t(`tr`);a.append(t(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...n.map(e=>t(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=t(`tr`,`bench-total`);o.append(t(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let n of a){let i=t(`tr`,`bench-total`);i.append(t(`td`,`bench-case`,`Recall, ${n}`),...e.armIds.map(r=>t(`td`,`bench-score`,c(e.totals[r]?.recallByTag[n]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:i,pendingActionBySuite:o,outcomeBySuite:s}=a(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!i,h=t(`div`,`bench-summary`);h.append(t(`span`,`bench-suite-title`,r.title),n(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),n(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),n(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=t(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=t(`span`,`bench-status`,(i?``:`Not connected to the server. Reconnecting.`)||d(e,r)||s.get(r.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),r.error)return c.append(t(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(t(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(t(`p`,`bench-empty`,r.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:n}=a(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!n)s.append(t(`p`,`bench-empty`,`Waiting for the server.`));else if(!n.configured)s.append(t(`p`,`bench-empty`,n.reason||`Benchmarks are off.`));else if(n.suites.length===0)s.append(t(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of n.suites)s.append(m(n,e))}function g(e){s||(s=t(`div`,`bench-content`),e.append(s),i(h),h())}var _={mount:g};export{_ as view};
1
+ import"./updates-view-core-Dxvxlb5s.js";import{n as e,o as t,r as n}from"./dom-helpers-ScgOMqDW.js";import{J as r,Y as i,q as a}from"./index-DRLA5ds-.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,n,i){let a=t(`button`,`bench-action-button`,o[n]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,n)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let n=t(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(n.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(n.dataset.degraded=`true`),n}function p(e){let n=e.armIds.filter(t=>t!==e.baselineArm),r=t(`table`,`bench-table`),i=t(`tr`);i.append(t(`th`,null,`Case`),...e.armIds.map(n=>t(`th`,null,n===e.baselineArm?`${n} (baseline)`:n))),i.append(...n.map(e=>t(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=t(`tr`);a.append(t(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...n.map(e=>t(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=t(`tr`,`bench-total`);o.append(t(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let n of a){let i=t(`tr`,`bench-total`);i.append(t(`td`,`bench-case`,`Recall, ${n}`),...e.armIds.map(r=>t(`td`,`bench-score`,c(e.totals[r]?.recallByTag[n]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:i,pendingActionBySuite:o,outcomeBySuite:s}=a(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!i,h=t(`div`,`bench-summary`);h.append(t(`span`,`bench-suite-title`,r.title),n(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),n(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),n(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=t(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=t(`span`,`bench-status`,(i?``:`Not connected to the server. Reconnecting.`)||d(e,r)||s.get(r.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),r.error)return c.append(t(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(t(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(t(`p`,`bench-empty`,r.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:n}=a(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!n)s.append(t(`p`,`bench-empty`,`Waiting for the server.`));else if(!n.configured)s.append(t(`p`,`bench-empty`,n.reason||`Benchmarks are off.`));else if(n.suites.length===0)s.append(t(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of n.suites)s.append(m(n,e))}function g(e){s||(s=t(`div`,`bench-content`),e.append(s),i(h),h())}var _={mount:g};export{_ as view};
@@ -1 +1 @@
1
- import{_ as e,o as t,s as n}from"./dom-helpers-ScgOMqDW.js";import{Di as r,la as i}from"./index-Bye4joWG.js";import{playToneSequence as a}from"./alert-sound-B-cj5tsC.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 e=n(`div`,`merge-bullseye-target`,se);return e.append(t(`span`,`merge-bullseye-ripple`)),e}function ue(){let e=t(`div`,`merge-bullseye-dart-drift`),r=t(`div`,`merge-bullseye-dart-arc`),i=t(`div`,`merge-bullseye-dart-aim`);return i.append(n(`div`,`merge-bullseye-dart`,ce)),r.append(i),e.append(r),e}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`);e(r,w());let i=t(`div`,`merge-headshot-aim`);i.append(n(`div`,`merge-headshot-crosshair`,E));let a=t(`div`,`merge-headshot-bob`);return a.append(i,n(`div`,`merge-headshot-hitmarker`,D)),r.append(a),r}function k(){let e=t(`div`,`merge-headshot-range`),r=t(`div`,`merge-headshot-track`);return r.append(O()),e.append(n(`div`,`merge-headshot-target`,T),r),e}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(n,r){let i=t(`div`,`merge-flush-deal`);e(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`,n)),s.insertAdjacentHTML(`beforeend`,ge),o.append(t(`div`,`merge-flush-back`),s),a.append(o),i.append(a),i}function ve(){let n=t(`div`,`merge-flush-table`);return e(n,he()),n.append(...j.map(_e)),n}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(n(`span`,`merge-strike-pin-arc`,We)),e(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 n=t(`div`,`merge-strike-lane`);e(n,He());let r=t(`div`,`merge-strike-rack`);r.append(...Re().map(Ge));let i=t(`div`,`merge-strike-track`);return i.append(Ke()),n.append(r,i),n}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`);e(r,tt());let i=t(`div`,`merge-swish-track`);return i.append(it()),r.append(n(`div`,`merge-swish-hoop-back`,nt),i,n(`div`,`merge-swish-hoop-front`,rt)),r}var Z=[Je,{title:`SWISH!`,buildScene:X},fe,A,ye],at=48,Q=5600,$=null;function ot(n){let r=t(`span`,`merge-confetti-piece`),i=t(`span`,`merge-confetti-arc`);return i.append(t(`span`,`merge-confetti-paper`)),r.append(i),e(r,oe(n)),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{_ as e,o as t,s as n}from"./dom-helpers-ScgOMqDW.js";import{Di as r,la as i}from"./index-DRLA5ds-.js";import{playToneSequence as a}from"./alert-sound-Cw8xVxsx.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 e=n(`div`,`merge-bullseye-target`,se);return e.append(t(`span`,`merge-bullseye-ripple`)),e}function ue(){let e=t(`div`,`merge-bullseye-dart-drift`),r=t(`div`,`merge-bullseye-dart-arc`),i=t(`div`,`merge-bullseye-dart-aim`);return i.append(n(`div`,`merge-bullseye-dart`,ce)),r.append(i),e.append(r),e}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`);e(r,w());let i=t(`div`,`merge-headshot-aim`);i.append(n(`div`,`merge-headshot-crosshair`,E));let a=t(`div`,`merge-headshot-bob`);return a.append(i,n(`div`,`merge-headshot-hitmarker`,D)),r.append(a),r}function k(){let e=t(`div`,`merge-headshot-range`),r=t(`div`,`merge-headshot-track`);return r.append(O()),e.append(n(`div`,`merge-headshot-target`,T),r),e}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(n,r){let i=t(`div`,`merge-flush-deal`);e(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`,n)),s.insertAdjacentHTML(`beforeend`,ge),o.append(t(`div`,`merge-flush-back`),s),a.append(o),i.append(a),i}function ve(){let n=t(`div`,`merge-flush-table`);return e(n,he()),n.append(...j.map(_e)),n}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(n(`span`,`merge-strike-pin-arc`,We)),e(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 n=t(`div`,`merge-strike-lane`);e(n,He());let r=t(`div`,`merge-strike-rack`);r.append(...Re().map(Ge));let i=t(`div`,`merge-strike-track`);return i.append(Ke()),n.append(r,i),n}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`);e(r,tt());let i=t(`div`,`merge-swish-track`);return i.append(it()),r.append(n(`div`,`merge-swish-hoop-back`,nt),i,n(`div`,`merge-swish-hoop-front`,rt)),r}var Z=[Je,{title:`SWISH!`,buildScene:X},fe,A,ye],at=48,Q=5600,$=null;function ot(n){let r=t(`span`,`merge-confetti-piece`),i=t(`span`,`merge-confetti-arc`);return i.append(t(`span`,`merge-confetti-paper`)),r.append(i),e(r,oe(n)),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 +1 @@
1
- import{d as e,o as t,u as n,y as r}from"./dom-helpers-ScgOMqDW.js";import{o as i}from"./card-registry-TiXTLzQ_.js";import{i as a}from"./modal-KRdHzhQs.js";import{c as o,i as ee}from"./action-status-BmCLf994.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,_t as p,gt as m,hn as h,ht as g,ii as _,it as v,kt as y,m as ne,mn as re,mt as ie,pt as b,ri as x,vt as S,yt as C}from"./index-Bye4joWG.js";import{t as w}from"./team-review-panel-CWGX0ef4.js";import{t as ae}from"./pr-queue-columns-nJpOvlEV.js";var oe={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},se={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ce={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:oe[e.verdict],tone:se[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:T.error,tone:`danger`}:{text:T[e.status],tone:`muted`}}function D(e){let t=ce[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function le(e){return e.status!==`running`&&e.status!==`queued`}function k(e){return e.status!==`aside`}function A(e){let t=e.find(e=>e.id===`working`)?.items.length??0;return t===0?`No community question needs you right now.`:`No community question needs you right now. ${t} ${t===1?`question is`:`questions are`} being researched.`}function j(e){return e?e.configured===!1?e.reason??`The community lane is not set up yet.`:`No community questions yet. New ones asked after you turned this on show up here.`:`Waiting for the community lane to report.`}function M(e){return e.filter(e=>!e.isWorkspace&&!e.isEphemeral).map(({id:e,name:t})=>({id:e,name:t})).toSorted((e,t)=>e.name.localeCompare(t.name))}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map;function W(){return M([...i].map(([e,t])=>({id:e,name:t.nameEl.textContent??e,isWorkspace:t.card.dataset.workspace!==void 0,isEphemeral:t.card.dataset.ephemeral!==void 0})))}function G(e,n){let r=t(`button`,`pr-action pr-action-ghost`,e);return r.type=`button`,r.disabled=!_(n),r.addEventListener(`click`,()=>x(n)),r}function K(e,n,r){let i=t(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!n,i.addEventListener(`click`,r),i}function q(e,n,r){let i=t(`ul`,e);i.setAttribute(`aria-label`,n);for(let e of r)i.append(t(`li`,null,e));return i}function ue(e){let n=t(`div`,`pr-detail-heading`),r=t(`div`,`pr-detail-title`);r.append(t(`h2`,null,e.item.title||`Untitled question`));let i=t(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(t(`span`,null,e.item.author),t(`span`,null,D(e))),Number.isNaN(a)||i.append(t(`span`,null,`Asked ${ne(a)}`)),n.append(r,i),n}function de(e){let n=t(`section`,`community-question`);return n.setAttribute(`aria-label`,`Question as asked`),n.append(t(`h3`,`pr-section-heading`,`Question as asked`),t(`p`,`community-question-body`,e.item.body)),n}function fe(e){let n=t(`section`,`pr-verdict-box`);n.setAttribute(`aria-label`,`Research`);let r=E(e),i=t(`div`,`pr-verdict-line`),a=t(`strong`,`community-badge`,r.text);if(a.dataset.tone=r.tone,i.append(a),n.append(i),e.error&&n.append(t(`p`,`pr-attention-detail`,e.error)),e.summary&&n.append(t(`p`,`pr-verdict-summary`,e.summary)),e.goal&&n.append(t(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&n.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return n;let o=t(`details`,`pr-verdict-checked`);return o.append(t(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),n.append(o),n}function pe(e){if(!e.draft)return null;let n=t(`section`,`community-draft`);n.setAttribute(`aria-label`,`Draft reply`),n.append(t(`h3`,`pr-section-heading`,`Draft reply`),t(`p`,`community-draft-body`,e.draft.body));let r=e.draft.publicLinks.filter(_);if(r.length===0)return n;let i=t(`ul`,`community-links`);for(let e of r){let n=t(`li`);n.append(G(e,e)),i.append(n)}return n.append(i),n}function me(e,t){let n=e.draft?r(e.draft.body):null;n?n.then(()=>t.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>t.show(`error`,`Copying failed. Select the draft text instead.`)):t.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function he(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await o(`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&&v()?.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 o(`community-action`,{key:e.item.key,action:t},n,{busyText:r});i?.type===`community-action-result`&&(i.ok||n.show(`error`,i.error??`The change did not apply.`))}function ge(){let e=t(`select`,`community-session-picker`);e.setAttribute(`aria-label`,`Session to start from`);let n=W();n.some(e=>e.id===H)||(H=n[0]?.id??``);for(let r of n){let n=t(`option`,null,r.name);n.value=r.id,n.selected=r.id===H,e.append(n)}return e.disabled=n.length===0,e.addEventListener(`change`,()=>{H=e.value}),e}function _e(e){let n=t(`div`,`community-actions`),r=ee(`pr-action-status`),i=t(`div`,`community-action-buttons`);return i.append(K(`Copy draft`,e.draft!==null,()=>me(e,r)),G(`Open thread`,e.item.url),ge(),K(`Start session`,!0,()=>void he(e,r)),K(`Re-run`,le(e),()=>void J(e,`rerun`,r)),K(`Set aside`,k(e),()=>void J(e,`set-aside`,r))),n.append(i,r.element),n}function ve(e){let n=t(`article`,`pr-detail community-detail`),r=pe(e);return n.append(ue(e),_e(e),...r?[r]:[],fe(e),de(e)),n}function Y(){if(!F)return;let e=l(L,R),n=e?JSON.stringify(e.entry):`empty:${c(L).length}`;if(n===V)return;if(V=n,e){F.replaceChildren(ve(e.entry));return}let r=L.some(e=>e.items.length>0);F.replaceChildren(r?w({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){S(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=y(L,O);h(I,f(e),e.filter(e=>e.id!==R))}function Z(e){R=e;for(let[t,n]of U)n.setAttribute(`aria-current`,String(t===e));let t=l(L,e),n=U.get(e);t&&n&&ye(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function be(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=l(L,e);if(!t)return;L.find(e=>e.items.includes(t))?.id===`aside`&&(z=!0),R=e,$(),Z(e);let n=U.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function xe(t){if(t.repeat||t.defaultPrevented||!N||n(N)||a()||e(t)||document.activeElement?.classList.contains(`xterm-helper-textarea`))return;let r=u(t);if(r!==`next-row`&&r!==`previous-row`)return;let i=s([...U.keys()],R,r===`next-row`?1:-1);i&&(t.preventDefault(),i!==R&&Q(i))}function Se(e,n){let r=t(`button`,`pr-queue-row pr-queue-row-quiet`);r.type=`button`,r.dataset.queueKey=e.key,r.setAttribute(`aria-current`,String(e.key===R));let i=E(e.entry),a=t(`span`,`review-queue-action community-badge`,i.text);a.dataset.tone=i.tone;let o=t(`span`,`pr-queue-top`);if(o.append(a,t(`span`,`pr-queue-title`,O(e))),r.append(o,t(`span`,`pr-queue-elapsed`,D(e.entry))),r.title=O(e),n&&p(d(e))){let e=t(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),r.append(e)}return r.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,r),r}function Ce(e){let n=t(`h3`,`pr-section-heading review-group-heading`),r=t(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return n.append(t(`span`,null,e.title),r),n;let i=t(`button`,`review-group-toggle`),a=t(`span`,`review-group-chevron`,`▸`);return a.setAttribute(`aria-hidden`,`true`),i.append(a,e.title),i.type=`button`,i.setAttribute(`aria-expanded`,String(z)),i.addEventListener(`click`,()=>{z=!z,B=null,$()}),n.append(i,r),n}function we(e){let n=t(`section`,`pr-queue-section`);if(n.dataset.group=e.id,n.append(Ce(e)),e.id===`aside`&&!z)return n;for(let t of e.items)n.append(Se(t,e.id===`turn`));return n}function $(){if(!P)return;L=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,m(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.error,r=n?[t(`p`,`my-pr-note`,n)]:[],i=L.filter(e=>e.items.length>0).map(we);P.replaceChildren(...r,...i.length>0?i:[t(`p`,`pr-empty`,j(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=ae({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=r.queue,F=t(`div`,`review-queue-detail`);let i=t(`div`,`review-queue-phone-bar`),a=t(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,be),i.append(a),r.detail.append(i,F),I=re({onJump:()=>{let e=y(L,O).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),r.queue.before(I),N.append(r.columns),N.dataset.detailOpen=`false`,b(()=>!n(N)),C(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
1
+ import{d as e,o as t,u as n,y as r}from"./dom-helpers-ScgOMqDW.js";import{o as i}from"./card-registry-TiXTLzQ_.js";import{i as a}from"./modal-KRdHzhQs.js";import{c as o,i as ee}from"./action-status-BmCLf994.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,_t as p,gt as m,hn as h,ht as g,ii as _,it as v,kt as y,m as ne,mn as re,mt as ie,pt as b,ri as x,vt as S,yt as C}from"./index-DRLA5ds-.js";import{t as w}from"./team-review-panel-Cv-yFIFQ.js";import{t as ae}from"./pr-queue-columns-Cwek98PT.js";var oe={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},se={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ce={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:oe[e.verdict],tone:se[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:T.error,tone:`danger`}:{text:T[e.status],tone:`muted`}}function D(e){let t=ce[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function le(e){return e.status!==`running`&&e.status!==`queued`}function k(e){return e.status!==`aside`}function A(e){let t=e.find(e=>e.id===`working`)?.items.length??0;return t===0?`No community question needs you right now.`:`No community question needs you right now. ${t} ${t===1?`question is`:`questions are`} being researched.`}function j(e){return e?e.configured===!1?e.reason??`The community lane is not set up yet.`:`No community questions yet. New ones asked after you turned this on show up here.`:`Waiting for the community lane to report.`}function M(e){return e.filter(e=>!e.isWorkspace&&!e.isEphemeral).map(({id:e,name:t})=>({id:e,name:t})).toSorted((e,t)=>e.name.localeCompare(t.name))}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map;function W(){return M([...i].map(([e,t])=>({id:e,name:t.nameEl.textContent??e,isWorkspace:t.card.dataset.workspace!==void 0,isEphemeral:t.card.dataset.ephemeral!==void 0})))}function G(e,n){let r=t(`button`,`pr-action pr-action-ghost`,e);return r.type=`button`,r.disabled=!_(n),r.addEventListener(`click`,()=>x(n)),r}function K(e,n,r){let i=t(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!n,i.addEventListener(`click`,r),i}function q(e,n,r){let i=t(`ul`,e);i.setAttribute(`aria-label`,n);for(let e of r)i.append(t(`li`,null,e));return i}function ue(e){let n=t(`div`,`pr-detail-heading`),r=t(`div`,`pr-detail-title`);r.append(t(`h2`,null,e.item.title||`Untitled question`));let i=t(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(t(`span`,null,e.item.author),t(`span`,null,D(e))),Number.isNaN(a)||i.append(t(`span`,null,`Asked ${ne(a)}`)),n.append(r,i),n}function de(e){let n=t(`section`,`community-question`);return n.setAttribute(`aria-label`,`Question as asked`),n.append(t(`h3`,`pr-section-heading`,`Question as asked`),t(`p`,`community-question-body`,e.item.body)),n}function fe(e){let n=t(`section`,`pr-verdict-box`);n.setAttribute(`aria-label`,`Research`);let r=E(e),i=t(`div`,`pr-verdict-line`),a=t(`strong`,`community-badge`,r.text);if(a.dataset.tone=r.tone,i.append(a),n.append(i),e.error&&n.append(t(`p`,`pr-attention-detail`,e.error)),e.summary&&n.append(t(`p`,`pr-verdict-summary`,e.summary)),e.goal&&n.append(t(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&n.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return n;let o=t(`details`,`pr-verdict-checked`);return o.append(t(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),n.append(o),n}function pe(e){if(!e.draft)return null;let n=t(`section`,`community-draft`);n.setAttribute(`aria-label`,`Draft reply`),n.append(t(`h3`,`pr-section-heading`,`Draft reply`),t(`p`,`community-draft-body`,e.draft.body));let r=e.draft.publicLinks.filter(_);if(r.length===0)return n;let i=t(`ul`,`community-links`);for(let e of r){let n=t(`li`);n.append(G(e,e)),i.append(n)}return n.append(i),n}function me(e,t){let n=e.draft?r(e.draft.body):null;n?n.then(()=>t.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>t.show(`error`,`Copying failed. Select the draft text instead.`)):t.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function he(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await o(`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&&v()?.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 o(`community-action`,{key:e.item.key,action:t},n,{busyText:r});i?.type===`community-action-result`&&(i.ok||n.show(`error`,i.error??`The change did not apply.`))}function ge(){let e=t(`select`,`community-session-picker`);e.setAttribute(`aria-label`,`Session to start from`);let n=W();n.some(e=>e.id===H)||(H=n[0]?.id??``);for(let r of n){let n=t(`option`,null,r.name);n.value=r.id,n.selected=r.id===H,e.append(n)}return e.disabled=n.length===0,e.addEventListener(`change`,()=>{H=e.value}),e}function _e(e){let n=t(`div`,`community-actions`),r=ee(`pr-action-status`),i=t(`div`,`community-action-buttons`);return i.append(K(`Copy draft`,e.draft!==null,()=>me(e,r)),G(`Open thread`,e.item.url),ge(),K(`Start session`,!0,()=>void he(e,r)),K(`Re-run`,le(e),()=>void J(e,`rerun`,r)),K(`Set aside`,k(e),()=>void J(e,`set-aside`,r))),n.append(i,r.element),n}function ve(e){let n=t(`article`,`pr-detail community-detail`),r=pe(e);return n.append(ue(e),_e(e),...r?[r]:[],fe(e),de(e)),n}function Y(){if(!F)return;let e=l(L,R),n=e?JSON.stringify(e.entry):`empty:${c(L).length}`;if(n===V)return;if(V=n,e){F.replaceChildren(ve(e.entry));return}let r=L.some(e=>e.items.length>0);F.replaceChildren(r?w({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){S(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=y(L,O);h(I,f(e),e.filter(e=>e.id!==R))}function Z(e){R=e;for(let[t,n]of U)n.setAttribute(`aria-current`,String(t===e));let t=l(L,e),n=U.get(e);t&&n&&ye(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function be(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=l(L,e);if(!t)return;L.find(e=>e.items.includes(t))?.id===`aside`&&(z=!0),R=e,$(),Z(e);let n=U.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function xe(t){if(t.repeat||t.defaultPrevented||!N||n(N)||a()||e(t)||document.activeElement?.classList.contains(`xterm-helper-textarea`))return;let r=u(t);if(r!==`next-row`&&r!==`previous-row`)return;let i=s([...U.keys()],R,r===`next-row`?1:-1);i&&(t.preventDefault(),i!==R&&Q(i))}function Se(e,n){let r=t(`button`,`pr-queue-row pr-queue-row-quiet`);r.type=`button`,r.dataset.queueKey=e.key,r.setAttribute(`aria-current`,String(e.key===R));let i=E(e.entry),a=t(`span`,`review-queue-action community-badge`,i.text);a.dataset.tone=i.tone;let o=t(`span`,`pr-queue-top`);if(o.append(a,t(`span`,`pr-queue-title`,O(e))),r.append(o,t(`span`,`pr-queue-elapsed`,D(e.entry))),r.title=O(e),n&&p(d(e))){let e=t(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),r.append(e)}return r.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,r),r}function Ce(e){let n=t(`h3`,`pr-section-heading review-group-heading`),r=t(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return n.append(t(`span`,null,e.title),r),n;let i=t(`button`,`review-group-toggle`),a=t(`span`,`review-group-chevron`,`▸`);return a.setAttribute(`aria-hidden`,`true`),i.append(a,e.title),i.type=`button`,i.setAttribute(`aria-expanded`,String(z)),i.addEventListener(`click`,()=>{z=!z,B=null,$()}),n.append(i,r),n}function we(e){let n=t(`section`,`pr-queue-section`);if(n.dataset.group=e.id,n.append(Ce(e)),e.id===`aside`&&!z)return n;for(let t of e.items)n.append(Se(t,e.id===`turn`));return n}function $(){if(!P)return;L=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,m(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.error,r=n?[t(`p`,`my-pr-note`,n)]:[],i=L.filter(e=>e.items.length>0).map(we);P.replaceChildren(...r,...i.length>0?i:[t(`p`,`pr-empty`,j(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=ae({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=r.queue,F=t(`div`,`review-queue-detail`);let i=t(`div`,`review-queue-phone-bar`),a=t(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,be),i.append(a),r.detail.append(i,F),I=re({onJump:()=>{let e=y(L,O).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),r.queue.before(I),N.append(r.columns),N.dataset.detailOpen=`false`,b(()=>!n(N)),C(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
@@ -1,4 +1,4 @@
1
- import{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-Dxvxlb5s.js";import{h as o,m as s,o as c}from"./dom-helpers-ScgOMqDW.js";import{d as l}from"./control-ws-MHGZwhmZ.js";import{n as u,r as d,t as f}from"./modal-KRdHzhQs.js";import{i as p,s as m,t as h}from"./action-status-BmCLf994.js";import{n as g}from"./session-tick-DaSgyLUw.js";import{Fr as _,Ir as v,Lr as y,Nr as b,Pr as x,Rr as S,di as C,fi as w,m as T,ui as E,wr as D,zn as ee}from"./index-Bye4joWG.js";import{t as te}from"./repo-roots-adder-CNbhoJqy.js";import{t as ne}from"./sandboxed-frame-DT7MIpqw.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
1
+ import{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-Dxvxlb5s.js";import{h as o,m as s,o as c}from"./dom-helpers-ScgOMqDW.js";import{d as l}from"./control-ws-MHGZwhmZ.js";import{n as u,r as d,t as f}from"./modal-KRdHzhQs.js";import{i as p,s as m,t as h}from"./action-status-BmCLf994.js";import{n as g}from"./session-tick-DaSgyLUw.js";import{Fr as _,Ir as v,Lr as y,Nr as b,Pr as x,Rr as S,di as C,fi as w,m as T,ui as E,wr as D,zn as ee}from"./index-DRLA5ds-.js";import{t as te}from"./repo-roots-adder-DRaj-PJ9.js";import{t as ne}from"./sandboxed-frame-DT7MIpqw.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
2
2
  <fieldset class="dialog-mode-controls add-session-agent-only" aria-label="Session kind">
3
3
  <button type="button" class="dialog-mode-button" id="add-session-single-mode" aria-pressed="true">Single repo</button>
4
4
  <button type="button" class="dialog-mode-button" id="add-session-workspace-mode" aria-pressed="false">Workspace</button>
@@ -1 +1 @@
1
- import{o as e}from"./dom-helpers-ScgOMqDW.js";import{d as t}from"./control-ws-MHGZwhmZ.js";import{a as n,r,t as i}from"./modal-KRdHzhQs.js";import{s as a,t as o}from"./action-status-BmCLf994.js";import{Dn as s,ci as c}from"./index-Bye4joWG.js";import{i as l,t as u}from"./plan-render-BTy-0au6.js";var d=null;function f(t){let n=c(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=c(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){n({title:e,message:`Your unsaved edits will be lost.`,confirmLabel:`Discard`,danger:!0,onConfirm:t})}function _(e,t,n){e.hasUnsavedChanges?g(t,n):n()}async function v(e,n){try{return{reply:await t(e,n,{timeoutMs:o}),failureText:null}}catch(e){return{reply:null,failureText:a(e,o)}}}async function y(e,t){e.docPath=t,e.isBusy=!0,e.baseHash=null,e.textarea.readOnly=!0,f(e),m(e,`Loading`),p(e);let{reply:n,failureText:r}=await v(`session-doc-read`,{id:e.sessionId,path:t});if(d!==e||e.docPath!==t)return;e.isBusy=!1,e.textarea.readOnly=!1;let i=n?.type===`session-doc-response`?n:null;!i?.ok||i.text===void 0||i.hash===void 0?(m(e,i?.error||r||`Could not open this doc`,`warn`),p(e)):(e.textarea.value=i.text,e.baseHash=i.hash,e.hasUnsavedChanges=!1,e.mode===`preview`&&h(e),m(e,``),p(e))}async function b(e){if(e.btnSave.disabled||e.baseHash===null)return;e.isBusy=!0,m(e,`Saving`),p(e);let t=e.docPath,n=e.textarea.value,{reply:r,failureText:i}=await v(`session-doc-save`,{id:e.sessionId,path:t,text:n,baseHash:e.baseHash});if(d!==e||e.docPath!==t)return;e.isBusy=!1;let a=r?.type===`session-doc-save-result`?r:null;!a?.ok||a.hash===void 0?(m(e,a?.conflict?`The agent changed this file since you opened it. Reload to see its version.`:a?.error||i||`Save failed`,`warn`),p(e)):(e.baseHash=a.hash,e.hasUnsavedChanges=e.textarea.value!==n,m(e,e.hasUnsavedChanges?`Unsaved changes`:`Saved`),p(e))}function x(e,t){e.mode=t,t===`preview`&&h(e),p(e),t===`edit`&&e.textarea.focus()}function S(t,n){let r=e(`button`,`plan-control ${n}`,t);return r.type=`button`,r}function C(t){let n=c(t)[0];if(!n||d)return;let a=()=>_(M,`Close this doc?`,()=>M.close()),o=r({dialogClass:`doc-editor`,closeOnBackdrop:!1,onEscape:a}),l=`doc-editor-title-${t}`,u=e(`h3`,`doc-editor-title`,n.name);u.id=l;let f=e(`select`,`plan-control doc-editor-picker`);f.setAttribute(`aria-label`,`Doc`);let h=e(`span`,`doc-editor-status`);h.setAttribute(`role`,`status`);let g=S(`Edit`,`doc-editor-mode`),v=S(`Preview`,`doc-editor-mode`),C=S(`Reload`,`doc-editor-reload`),w=S(`Save`,`doc-editor-save`),T=S(`Close`,`doc-editor-close`),E=e(`div`,`doc-editor-modes`);E.append(g,v);let D=e(`div`,`doc-editor-actions`);D.append(h,C,w,T);let O=e(`div`,`doc-editor-header`);O.append(u,f,E,D);let k=e(`textarea`,`plan-editor doc-editor-text`);k.spellcheck=!0,k.setAttribute(`aria-labelledby`,l);let A=e(`div`,`doc-editor-preview`),j=e(`div`,`doc-editor-body`);j.append(k,A),o.dialog.append(O,j),i(o.dialog,l);let M={sessionId:t,docPath:n.path,baseHash:null,hasUnsavedChanges:!1,isBusy:!1,mode:s()?`preview`:`edit`,title:u,select:f,textarea:k,preview:A,status:h,btnEdit:g,btnPreview:v,btnReload:C,btnSave:w,close:()=>{d=null,o.close()}};d=M,k.addEventListener(`input`,()=>{M.hasUnsavedChanges||(M.hasUnsavedChanges=!0,m(M,`Unsaved changes`),p(M))}),k.addEventListener(`keydown`,e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),b(M))}),f.addEventListener(`change`,()=>{let e=f.value;f.value=M.docPath,_(M,`Open another doc?`,()=>{y(M,e)})}),g.addEventListener(`click`,()=>x(M,`edit`)),v.addEventListener(`click`,()=>x(M,`preview`)),C.addEventListener(`click`,()=>{_(M,`Reload this doc?`,()=>{y(M,M.docPath)})}),w.addEventListener(`click`,()=>{b(M)}),T.addEventListener(`click`,a),y(M,n.path),M.mode===`edit`&&k.focus()}function w(e){d&&d.sessionId===e&&(f(d),p(d),!c(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
1
+ import{o as e}from"./dom-helpers-ScgOMqDW.js";import{d as t}from"./control-ws-MHGZwhmZ.js";import{a as n,r,t as i}from"./modal-KRdHzhQs.js";import{s as a,t as o}from"./action-status-BmCLf994.js";import{Dn as s,ci as c}from"./index-DRLA5ds-.js";import{i as l,t as u}from"./plan-render-S3XuSq5c.js";var d=null;function f(t){let n=c(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=c(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){n({title:e,message:`Your unsaved edits will be lost.`,confirmLabel:`Discard`,danger:!0,onConfirm:t})}function _(e,t,n){e.hasUnsavedChanges?g(t,n):n()}async function v(e,n){try{return{reply:await t(e,n,{timeoutMs:o}),failureText:null}}catch(e){return{reply:null,failureText:a(e,o)}}}async function y(e,t){e.docPath=t,e.isBusy=!0,e.baseHash=null,e.textarea.readOnly=!0,f(e),m(e,`Loading`),p(e);let{reply:n,failureText:r}=await v(`session-doc-read`,{id:e.sessionId,path:t});if(d!==e||e.docPath!==t)return;e.isBusy=!1,e.textarea.readOnly=!1;let i=n?.type===`session-doc-response`?n:null;!i?.ok||i.text===void 0||i.hash===void 0?(m(e,i?.error||r||`Could not open this doc`,`warn`),p(e)):(e.textarea.value=i.text,e.baseHash=i.hash,e.hasUnsavedChanges=!1,e.mode===`preview`&&h(e),m(e,``),p(e))}async function b(e){if(e.btnSave.disabled||e.baseHash===null)return;e.isBusy=!0,m(e,`Saving`),p(e);let t=e.docPath,n=e.textarea.value,{reply:r,failureText:i}=await v(`session-doc-save`,{id:e.sessionId,path:t,text:n,baseHash:e.baseHash});if(d!==e||e.docPath!==t)return;e.isBusy=!1;let a=r?.type===`session-doc-save-result`?r:null;!a?.ok||a.hash===void 0?(m(e,a?.conflict?`The agent changed this file since you opened it. Reload to see its version.`:a?.error||i||`Save failed`,`warn`),p(e)):(e.baseHash=a.hash,e.hasUnsavedChanges=e.textarea.value!==n,m(e,e.hasUnsavedChanges?`Unsaved changes`:`Saved`),p(e))}function x(e,t){e.mode=t,t===`preview`&&h(e),p(e),t===`edit`&&e.textarea.focus()}function S(t,n){let r=e(`button`,`plan-control ${n}`,t);return r.type=`button`,r}function C(t){let n=c(t)[0];if(!n||d)return;let a=()=>_(M,`Close this doc?`,()=>M.close()),o=r({dialogClass:`doc-editor`,closeOnBackdrop:!1,onEscape:a}),l=`doc-editor-title-${t}`,u=e(`h3`,`doc-editor-title`,n.name);u.id=l;let f=e(`select`,`plan-control doc-editor-picker`);f.setAttribute(`aria-label`,`Doc`);let h=e(`span`,`doc-editor-status`);h.setAttribute(`role`,`status`);let g=S(`Edit`,`doc-editor-mode`),v=S(`Preview`,`doc-editor-mode`),C=S(`Reload`,`doc-editor-reload`),w=S(`Save`,`doc-editor-save`),T=S(`Close`,`doc-editor-close`),E=e(`div`,`doc-editor-modes`);E.append(g,v);let D=e(`div`,`doc-editor-actions`);D.append(h,C,w,T);let O=e(`div`,`doc-editor-header`);O.append(u,f,E,D);let k=e(`textarea`,`plan-editor doc-editor-text`);k.spellcheck=!0,k.setAttribute(`aria-labelledby`,l);let A=e(`div`,`doc-editor-preview`),j=e(`div`,`doc-editor-body`);j.append(k,A),o.dialog.append(O,j),i(o.dialog,l);let M={sessionId:t,docPath:n.path,baseHash:null,hasUnsavedChanges:!1,isBusy:!1,mode:s()?`preview`:`edit`,title:u,select:f,textarea:k,preview:A,status:h,btnEdit:g,btnPreview:v,btnReload:C,btnSave:w,close:()=>{d=null,o.close()}};d=M,k.addEventListener(`input`,()=>{M.hasUnsavedChanges||(M.hasUnsavedChanges=!0,m(M,`Unsaved changes`),p(M))}),k.addEventListener(`keydown`,e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),b(M))}),f.addEventListener(`change`,()=>{let e=f.value;f.value=M.docPath,_(M,`Open another doc?`,()=>{y(M,e)})}),g.addEventListener(`click`,()=>x(M,`edit`)),v.addEventListener(`click`,()=>x(M,`preview`)),C.addEventListener(`click`,()=>{_(M,`Reload this doc?`,()=>{y(M,M.docPath)})}),w.addEventListener(`click`,()=>{b(M)}),T.addEventListener(`click`,a),y(M,n.path),M.mode===`edit`&&k.focus()}function w(e){d&&d.sessionId===e&&(f(d),p(d),!c(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
@@ -1 +1 @@
1
- import{gt as e}from"./updates-view-core-Dxvxlb5s.js";import{o as t}from"./dom-helpers-ScgOMqDW.js";import{u as n}from"./control-ws-MHGZwhmZ.js";import{Ln as r,Rn as i,i as a,la as o,mi as s,pi as c}from"./index-Bye4joWG.js";var l={teamReview:e=>`${e} pull requests reviewed this week, and Reviews has not been open lately? It lines up every PR waiting on you.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them.`,usage:()=>`Keeping an eye on tokens? The Usage tab tracks spend per session and warns before a limit hits.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you.`,visions:()=>`Pointing agents at files in your editor? Visions reads your open editor and comments right on the code.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side.`},u=` It is off right now, so Show me takes you to its switch in Settings.`;function d(e,t){let n=l[e.feature](e.distinctTargetCount);return t?n:`${n}${u}`}function f(e){let t=a.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var p=null;function m(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function h(e){try{return i(localStorage,r(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function g(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=f(t);r&&n.openSetting(r.sectionId,r.settingId)}function _(e,n){if(p?.isConnected||!h(e))return;let r=t(`aside`,`feature-hint`);r.setAttribute(`aria-live`,`polite`),r.setAttribute(`aria-label`,`Feature tip`);let i=t(`div`,`feature-hint-bubble`),a=t(`button`,`btn-dialog btn-dialog-confirm`,`Show me`),l=t(`button`,`btn-dialog btn-dialog-cancel`,`Nah`);a.type=`button`,l.type=`button`;let u=t(`div`,`feature-hint-actions`);u.append(l,a),i.append(t(`p`,`feature-hint-text`,d(e,n.isFeatureEnabled(e.feature))),u);let f=s()??o[0];r.append(i,c(f,`feature-hint-animal`));function _(t){m(e.feature,t),r.remove(),p=null}a.addEventListener(`click`,()=>{_(`open`),g(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(r),p=r,m(e.feature,`shown`)}export{_ as showFeatureHint};
1
+ import{gt as e}from"./updates-view-core-Dxvxlb5s.js";import{o as t}from"./dom-helpers-ScgOMqDW.js";import{u as n}from"./control-ws-MHGZwhmZ.js";import{Ln as r,Rn as i,i as a,la as o,mi as s,pi as c}from"./index-DRLA5ds-.js";var l={teamReview:e=>`${e} pull requests reviewed this week, and Reviews has not been open lately? It lines up every PR waiting on you.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them.`,usage:()=>`Keeping an eye on tokens? The Usage tab tracks spend per session and warns before a limit hits.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you.`,visions:()=>`Pointing agents at files in your editor? Visions reads your open editor and comments right on the code.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side.`},u=` It is off right now, so Show me takes you to its switch in Settings.`;function d(e,t){let n=l[e.feature](e.distinctTargetCount);return t?n:`${n}${u}`}function f(e){let t=a.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var p=null;function m(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function h(e){try{return i(localStorage,r(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function g(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=f(t);r&&n.openSetting(r.sectionId,r.settingId)}function _(e,n){if(p?.isConnected||!h(e))return;let r=t(`aside`,`feature-hint`);r.setAttribute(`aria-live`,`polite`),r.setAttribute(`aria-label`,`Feature tip`);let i=t(`div`,`feature-hint-bubble`),a=t(`button`,`btn-dialog btn-dialog-confirm`,`Show me`),l=t(`button`,`btn-dialog btn-dialog-cancel`,`Nah`);a.type=`button`,l.type=`button`;let u=t(`div`,`feature-hint-actions`);u.append(l,a),i.append(t(`p`,`feature-hint-text`,d(e,n.isFeatureEnabled(e.feature))),u);let f=s()??o[0];r.append(i,c(f,`feature-hint-animal`));function _(t){m(e.feature,t),r.remove(),p=null}a.addEventListener(`click`,()=>{_(`open`),g(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(r),p=r,m(e.feature,`shown`)}export{_ as showFeatureHint};
@@ -1 +1 @@
1
- import{o as e,y as t}from"./dom-helpers-ScgOMqDW.js";import{d as n,u as r}from"./control-ws-MHGZwhmZ.js";import{i,s as a,t as o}from"./action-status-BmCLf994.js";import{Dr as s,Er as c,Pn as l,Sr as u}from"./index-Bye4joWG.js";import{a as d,c as f,i as p,l as m,n as h,o as g,r as _,s as v,t as y}from"./repo-roots-adder-CNbhoJqy.js";var b=`npm install -g @anthropic-ai/claude-code`,x={done:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Done"><circle cx="12" cy="12" r="10"></circle><path d="M7.5 12.5l3 3 6-6.5"></path></svg>`,current:`<svg width="18" height="18" viewBox="0 0 24 24" role="img" aria-label="Needed"><path d="M12 3l9 9-9 9-9-9z" fill="currentColor"></path></svg>`,upcoming:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" role="img" aria-label="Not started"><circle cx="12" cy="12" r="10"></circle></svg>`},S=null,C=null,w=null,T=null,E={steps:_,agentSummary:``,repoRoots:[],isShellAvailable:!1},D=0,O=!1,k=!1,A=new Set,j=i(`first-run-load-status`),M=l();function N(e){r({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`onboarding`,action:e}})}function P(e){for(let t of v(A,e))r({type:`dashboard-telemetry`,event:`onboarding_step`,properties:t})&&A.add(f(t))}function F({title:t,state:n,summary:r,badge:i,body:a}){let o=e(`li`,`first-run-step`);o.dataset.state=n,n===`current`&&o.setAttribute(`aria-current`,`step`);let s=e(`div`,`first-run-step-head`),c=e(`span`,`first-run-step-icon`);if(c.innerHTML=x[n],s.append(c,e(`span`,`first-run-step-title`,t)),n===`done`&&r&&s.append(e(`span`,`first-run-step-summary`,r)),n===`current`&&i&&s.append(e(`span`,`first-run-step-badge`,i)),o.append(s),n!==`current`)return o;let l=e(`div`,`first-run-step-body`);return l.append(...a()),o.append(l),o}function I(){return u()?`No supported agent is on PATH of the machine running Glimmervoid. Install Claude Code, Codex or Grok there, then rescan.`:`No supported agent is on PATH. Install Claude Code, Codex or Grok, then rescan.`}function L(){let n=e(`div`,`first-run-command-row`);if(n.append(e(`code`,`first-run-command`,b)),!navigator.clipboard?.writeText)return n;let r=e(`button`,`btn-dialog btn-dialog-cancel`,`Copy`);r.type=`button`;let i=e(`span`,`first-run-copy-status`);return i.setAttribute(`role`,`status`),r.addEventListener(`click`,async()=>{let e=t(b);i.textContent=e?await e.then(()=>`Copied`,()=>`Copy failed`):`Copy failed`}),n.append(r,i),n}function R(){let t=e(`button`,`btn-dialog btn-dialog-cancel`,`Open shell`);return t.type=`button`,t.addEventListener(`click`,()=>{N(`open-shell`),s()}),t}function z(){let t=e(`div`,`first-run-step-actions`);w=e(`button`,`btn-dialog btn-dialog-cancel`,`Rescan`),w.type=`button`,w.addEventListener(`click`,()=>{N(`rescan`),U({rescanAgents:!0})}),t.append(w),E.isShellAvailable&&t.append(R());let n=[e(`p`,`first-run-step-text`,I()),L(),t];return O?[...n,e(`p`,`first-run-step-hint`,`Still missing after a rescan? Restart Glimmervoid from a terminal where the command runs. Other terminal agents go under customAgents.`)]:n}function B(){let t=T??y({onAdded:e=>{N(e===`typed`?`add-root-typed`:`add-root-suggested`),U({rescanAgents:!1})}});return T=t,[e(`p`,`first-run-step-text`,`The folder that holds your git checkouts. Each subfolder becomes a project you can start a session in.`),t.element]}function V(){let t=e(`div`,`first-run-step-actions`),n=e(`button`,`btn-dialog btn-dialog-confirm`,`+ Session`);return n.type=`button`,n.addEventListener(`click`,()=>{N(`add-session`),c()}),t.append(n),[e(`p`,`first-run-step-text`,`Pick a project and an agent. The session runs in its own git worktree, so your checkout is never touched.`),t]}function H(){if(!C)return;let{steps:e,agentSummary:t,repoRoots:n}=E;C.replaceChildren(F({title:`1. Agent CLI`,state:e.agent,summary:t,badge:`MISSING`,body:z}),F({title:`2. Repository roots`,state:e.repoRoots,summary:n.join(`, `),badge:`NEEDED`,body:B}),F({title:`3. First session`,state:e.firstSession,summary:``,badge:``,body:V}))}async function U({rescanAgents:e}){D+=1;let t=D;w&&(w.disabled=!0);try{let[r,i]=await Promise.all([n(`list-agents`,e?{rescan:!0}:{},{timeoutMs:o}),n(`scan-repo-roots`,{includeSuggestions:!0},{timeoutMs:o})]);if(t!==D)return;let a=i.type===`repo-roots-scanned`,s=a?i.directories.map(e=>e.root):[],c=a?i.suggestions??[]:[],l=m(s,c);if(l.length>0&&!k){k=!0;let e=await h(l).catch(e=>String(e));if(t!==D)return;if(!e){U({rescanAgents:!1});return}}let u=g({agentListing:r,repoRoots:s});e&&(O=u.agent===`current`),E={steps:u,agentSummary:p(r),repoRoots:s,isShellAvailable:d(r)},j.clear(),H(),P(E.steps),T?.setSuggestions(c)}catch(e){if(w&&(w.disabled=!1),t!==D)return;j.show(`error`,`The checklist could not load: ${a(e,o)} It loads again once the server answers. If it stays like this, check the terminal running Glimmervoid, or run glimmervoid doctor.`)}}function W(){if(S)return S;let t=e(`section`,`first-run-checklist`);t.setAttribute(`aria-labelledby`,`first-run-title`);let n=e(`h2`,`first-run-title`,`Get to your first session`);n.id=`first-run-title`,C=e(`ol`,`first-run-steps`);let r=e(`div`,`first-run-optional`);return r.append(e(`span`,`first-run-eyebrow`,`OPTIONAL`),M.element),t.append(e(`span`,`first-run-eyebrow`,`FIRST RUN`),n,C,j.element,r),S=t,H(),t}function G(e,t){if(!t){S?.parentElement===e&&!S.hidden&&(S.hidden=!0);return}let n=W(),r=!n.hidden&&n.parentElement===e;n.parentElement!==e&&e.append(n),n.hidden=!1,M.refresh(),r||U({rescanAgents:!1})}function K(){S&&!S.hidden&&S.isConnected&&U({rescanAgents:!1})}export{K as refreshFirstRunChecklist,G as showFirstRunChecklist};
1
+ import{o as e,y as t}from"./dom-helpers-ScgOMqDW.js";import{d as n,u as r}from"./control-ws-MHGZwhmZ.js";import{i,s as a,t as o}from"./action-status-BmCLf994.js";import{Dr as s,Er as c,Pn as l,Sr as u}from"./index-DRLA5ds-.js";import{a as d,c as f,i as p,l as m,n as h,o as g,r as _,s as v,t as y}from"./repo-roots-adder-DRaj-PJ9.js";var b=`npm install -g @anthropic-ai/claude-code`,x={done:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Done"><circle cx="12" cy="12" r="10"></circle><path d="M7.5 12.5l3 3 6-6.5"></path></svg>`,current:`<svg width="18" height="18" viewBox="0 0 24 24" role="img" aria-label="Needed"><path d="M12 3l9 9-9 9-9-9z" fill="currentColor"></path></svg>`,upcoming:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" role="img" aria-label="Not started"><circle cx="12" cy="12" r="10"></circle></svg>`},S=null,C=null,w=null,T=null,E={steps:_,agentSummary:``,repoRoots:[],isShellAvailable:!1},D=0,O=!1,k=!1,A=new Set,j=i(`first-run-load-status`),M=l();function N(e){r({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`onboarding`,action:e}})}function P(e){for(let t of v(A,e))r({type:`dashboard-telemetry`,event:`onboarding_step`,properties:t})&&A.add(f(t))}function F({title:t,state:n,summary:r,badge:i,body:a}){let o=e(`li`,`first-run-step`);o.dataset.state=n,n===`current`&&o.setAttribute(`aria-current`,`step`);let s=e(`div`,`first-run-step-head`),c=e(`span`,`first-run-step-icon`);if(c.innerHTML=x[n],s.append(c,e(`span`,`first-run-step-title`,t)),n===`done`&&r&&s.append(e(`span`,`first-run-step-summary`,r)),n===`current`&&i&&s.append(e(`span`,`first-run-step-badge`,i)),o.append(s),n!==`current`)return o;let l=e(`div`,`first-run-step-body`);return l.append(...a()),o.append(l),o}function I(){return u()?`No supported agent is on PATH of the machine running Glimmervoid. Install Claude Code, Codex or Grok there, then rescan.`:`No supported agent is on PATH. Install Claude Code, Codex or Grok, then rescan.`}function L(){let n=e(`div`,`first-run-command-row`);if(n.append(e(`code`,`first-run-command`,b)),!navigator.clipboard?.writeText)return n;let r=e(`button`,`btn-dialog btn-dialog-cancel`,`Copy`);r.type=`button`;let i=e(`span`,`first-run-copy-status`);return i.setAttribute(`role`,`status`),r.addEventListener(`click`,async()=>{let e=t(b);i.textContent=e?await e.then(()=>`Copied`,()=>`Copy failed`):`Copy failed`}),n.append(r,i),n}function R(){let t=e(`button`,`btn-dialog btn-dialog-cancel`,`Open shell`);return t.type=`button`,t.addEventListener(`click`,()=>{N(`open-shell`),s()}),t}function z(){let t=e(`div`,`first-run-step-actions`);w=e(`button`,`btn-dialog btn-dialog-cancel`,`Rescan`),w.type=`button`,w.addEventListener(`click`,()=>{N(`rescan`),U({rescanAgents:!0})}),t.append(w),E.isShellAvailable&&t.append(R());let n=[e(`p`,`first-run-step-text`,I()),L(),t];return O?[...n,e(`p`,`first-run-step-hint`,`Still missing after a rescan? Restart Glimmervoid from a terminal where the command runs. Other terminal agents go under customAgents.`)]:n}function B(){let t=T??y({onAdded:e=>{N(e===`typed`?`add-root-typed`:`add-root-suggested`),U({rescanAgents:!1})}});return T=t,[e(`p`,`first-run-step-text`,`The folder that holds your git checkouts. Each subfolder becomes a project you can start a session in.`),t.element]}function V(){let t=e(`div`,`first-run-step-actions`),n=e(`button`,`btn-dialog btn-dialog-confirm`,`+ Session`);return n.type=`button`,n.addEventListener(`click`,()=>{N(`add-session`),c()}),t.append(n),[e(`p`,`first-run-step-text`,`Pick a project and an agent. The session runs in its own git worktree, so your checkout is never touched.`),t]}function H(){if(!C)return;let{steps:e,agentSummary:t,repoRoots:n}=E;C.replaceChildren(F({title:`1. Agent CLI`,state:e.agent,summary:t,badge:`MISSING`,body:z}),F({title:`2. Repository roots`,state:e.repoRoots,summary:n.join(`, `),badge:`NEEDED`,body:B}),F({title:`3. First session`,state:e.firstSession,summary:``,badge:``,body:V}))}async function U({rescanAgents:e}){D+=1;let t=D;w&&(w.disabled=!0);try{let[r,i]=await Promise.all([n(`list-agents`,e?{rescan:!0}:{},{timeoutMs:o}),n(`scan-repo-roots`,{includeSuggestions:!0},{timeoutMs:o})]);if(t!==D)return;let a=i.type===`repo-roots-scanned`,s=a?i.directories.map(e=>e.root):[],c=a?i.suggestions??[]:[],l=m(s,c);if(l.length>0&&!k){k=!0;let e=await h(l).catch(e=>String(e));if(t!==D)return;if(!e){U({rescanAgents:!1});return}}let u=g({agentListing:r,repoRoots:s});e&&(O=u.agent===`current`),E={steps:u,agentSummary:p(r),repoRoots:s,isShellAvailable:d(r)},j.clear(),H(),P(E.steps),T?.setSuggestions(c)}catch(e){if(w&&(w.disabled=!1),t!==D)return;j.show(`error`,`The checklist could not load: ${a(e,o)} It loads again once the server answers. If it stays like this, check the terminal running Glimmervoid, or run glimmervoid doctor.`)}}function W(){if(S)return S;let t=e(`section`,`first-run-checklist`);t.setAttribute(`aria-labelledby`,`first-run-title`);let n=e(`h2`,`first-run-title`,`Get to your first session`);n.id=`first-run-title`,C=e(`ol`,`first-run-steps`);let r=e(`div`,`first-run-optional`);return r.append(e(`span`,`first-run-eyebrow`,`OPTIONAL`),M.element),t.append(e(`span`,`first-run-eyebrow`,`FIRST RUN`),n,C,j.element,r),S=t,H(),t}function G(e,t){if(!t){S?.parentElement===e&&!S.hidden&&(S.hidden=!0);return}let n=W(),r=!n.hidden&&n.parentElement===e;n.parentElement!==e&&e.append(n),n.hidden=!1,M.refresh(),r||U({rescanAgents:!1})}function K(){S&&!S.hidden&&S.isConnected&&U({rescanAgents:!1})}export{K as refreshFirstRunChecklist,G as showFirstRunChecklist};