glimmervoid 0.47.1-next.266 → 0.47.1-next.267

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 (94) hide show
  1. package/README.md +2 -2
  2. package/dist/bin/glimmervoid.js +6 -6
  3. package/dist/chunks/{adapters-Dx1U5sPa.js → adapters-CRTUz6uZ.js} +1 -1
  4. package/dist/chunks/{adapters-CkgywK6b.js → adapters-ChpRHvYd.js} +1 -1
  5. package/dist/chunks/{agent-api-cli-BgtBfEpE.js → agent-api-cli-DAp3d4NI.js} +1 -1
  6. package/dist/chunks/{agent-api-cli-BLNaCyCK.js → agent-api-cli-DosoxmZ5.js} +2 -2
  7. package/dist/chunks/{agent-api-core-B9Y8p1sI.js → agent-api-core-BaPhuKSP.js} +2 -2
  8. package/dist/chunks/{main-mJAz4Qsd.js → main-Wi6yKRUf.js} +3 -3
  9. package/dist/chunks/{session-routes-BTMSVce8.js → session-routes-EX1dLFlu.js} +1 -1
  10. package/dist/chunks/{settings-cli-Bb8uoBUd.js → settings-cli-BFcFyhrm.js} +2 -2
  11. package/dist/chunks/{ssh-sign-cli-CCRsXp-f.js → ssh-sign-cli-D64-uGur.js} +1 -1
  12. package/dist/client/assets/{alert-sound-DgoHlCku.js → alert-sound-4X0PJdN4.js} +1 -1
  13. package/dist/client/assets/alert-sound-4X0PJdN4.js.br +0 -0
  14. package/dist/client/assets/{benchmark-panel-DNgsmHl2.js → benchmark-panel-DEOp3uoX.js} +1 -1
  15. package/dist/client/assets/benchmark-panel-DEOp3uoX.js.br +0 -0
  16. package/dist/client/assets/{celebration-player-BHpV1Rf_.js → celebration-player-ClBYVjCG.js} +1 -1
  17. package/dist/client/assets/celebration-player-ClBYVjCG.js.br +0 -0
  18. package/dist/client/assets/{community-panel-Ba7Ppr-s.js → community-panel-oCPARPmF.js} +1 -1
  19. package/dist/client/assets/community-panel-oCPARPmF.js.br +0 -0
  20. package/dist/client/assets/{dialogs-eQXD58rA.js → dialogs-DtyZOaHx.js} +1 -1
  21. package/dist/client/assets/dialogs-DtyZOaHx.js.br +0 -0
  22. package/dist/client/assets/{doc-editor-ui-CbBWXbrp.js → doc-editor-ui-DUsM5TbP.js} +1 -1
  23. package/dist/client/assets/doc-editor-ui-DUsM5TbP.js.br +0 -0
  24. package/dist/client/assets/{feature-hint-BM_9juah.js → feature-hint-CgWUL_ph.js} +1 -1
  25. package/dist/client/assets/feature-hint-CgWUL_ph.js.br +0 -0
  26. package/dist/client/assets/{first-run-checklist-B0u3xzD5.js → first-run-checklist-CoN1UWZC.js} +1 -1
  27. package/dist/client/assets/first-run-checklist-CoN1UWZC.js.br +0 -0
  28. package/dist/client/assets/{hooks-panel-Cek00ZhO.js → hooks-panel-Co3S9K5P.js} +1 -1
  29. package/dist/client/assets/hooks-panel-Co3S9K5P.js.br +0 -0
  30. package/dist/client/assets/{index-CsZNHdJT.js → index-7X85zNIF.js} +5 -5
  31. package/dist/client/assets/index-7X85zNIF.js.br +0 -0
  32. package/dist/client/assets/{issues-panel-BOeYMzEs.js → issues-panel-CJRGP29T.js} +1 -1
  33. package/dist/client/assets/issues-panel-CJRGP29T.js.br +0 -0
  34. package/dist/client/assets/{my-prs-panel-d9RoNUfy.js → my-prs-panel-C_RDMGfW.js} +1 -1
  35. package/dist/client/assets/my-prs-panel-C_RDMGfW.js.br +0 -0
  36. package/dist/client/assets/{nyan-cat-BMsZXAWE.js → nyan-cat-B-3d24EX.js} +1 -1
  37. package/dist/client/assets/nyan-cat-B-3d24EX.js.br +0 -0
  38. package/dist/client/assets/{phone-shell-CBvfs5Q4.js → phone-shell-pmvc0YUt.js} +1 -1
  39. package/dist/client/assets/phone-shell-pmvc0YUt.js.br +0 -0
  40. package/dist/client/assets/{plan-face-Bmre1ipT.js → plan-face-BtEHddNo.js} +1 -1
  41. package/dist/client/assets/plan-face-BtEHddNo.js.br +0 -0
  42. package/dist/client/assets/{plan-render-CSgvT2MS.js → plan-render-SR5k81K9.js} +1 -1
  43. package/dist/client/assets/plan-render-SR5k81K9.js.br +0 -0
  44. package/dist/client/assets/{pr-queue-columns-PaYWyOTi.js → pr-queue-columns-CY9Fw_bp.js} +1 -1
  45. package/dist/client/assets/pr-queue-columns-CY9Fw_bp.js.br +0 -0
  46. package/dist/client/assets/{radar-panel-CsJwUtqX.js → radar-panel-GRxg52lA.js} +1 -1
  47. package/dist/client/assets/radar-panel-GRxg52lA.js.br +0 -0
  48. package/dist/client/assets/{repo-roots-adder-I_osQTym.js → repo-roots-adder-DfzP5J1y.js} +1 -1
  49. package/dist/client/assets/repo-roots-adder-DfzP5J1y.js.br +0 -0
  50. package/dist/client/assets/{resume-dialog-BoXngMc2.js → resume-dialog-UuqmW_J5.js} +1 -1
  51. package/dist/client/assets/resume-dialog-UuqmW_J5.js.br +0 -0
  52. package/dist/client/assets/{review-queue-panel-Dx4RTtN9.js → review-queue-panel-cwTxn3IP.js} +1 -1
  53. package/dist/client/assets/review-queue-panel-cwTxn3IP.js.br +0 -0
  54. package/dist/client/assets/{settings-panel-DCIkcVt_.js → settings-panel-C0BSeunI.js} +2 -2
  55. package/dist/client/assets/settings-panel-C0BSeunI.js.br +0 -0
  56. package/dist/client/assets/{shown-lightbox-CvQpDcpX.js → shown-lightbox-ajEZp3Oj.js} +1 -1
  57. package/dist/client/assets/shown-lightbox-ajEZp3Oj.js.br +0 -0
  58. package/dist/client/assets/{team-review-panel-D6mFydSP.js → team-review-panel-BbbaboFA.js} +1 -1
  59. package/dist/client/assets/team-review-panel-BbbaboFA.js.br +0 -0
  60. package/dist/client/assets/{trace-panel-Bfq4tBBH.js → trace-panel-C4OiQiGE.js} +1 -1
  61. package/dist/client/assets/trace-panel-C4OiQiGE.js.br +0 -0
  62. package/dist/client/assets/{usage-panel-CAHY96Ka.js → usage-panel-Db9XDHyB.js} +1 -1
  63. package/dist/client/assets/usage-panel-Db9XDHyB.js.br +0 -0
  64. package/dist/client/index.html +1 -1
  65. package/dist/client/index.html.br +0 -0
  66. package/dist/server/index.js +1 -1
  67. package/dist/session/remote-setup/SKILL.md +2 -21
  68. package/package.json +1 -1
  69. package/dist/client/assets/alert-sound-DgoHlCku.js.br +0 -0
  70. package/dist/client/assets/benchmark-panel-DNgsmHl2.js.br +0 -0
  71. package/dist/client/assets/celebration-player-BHpV1Rf_.js.br +0 -0
  72. package/dist/client/assets/community-panel-Ba7Ppr-s.js.br +0 -0
  73. package/dist/client/assets/dialogs-eQXD58rA.js.br +0 -0
  74. package/dist/client/assets/doc-editor-ui-CbBWXbrp.js.br +0 -0
  75. package/dist/client/assets/feature-hint-BM_9juah.js.br +0 -0
  76. package/dist/client/assets/first-run-checklist-B0u3xzD5.js.br +0 -0
  77. package/dist/client/assets/hooks-panel-Cek00ZhO.js.br +0 -0
  78. package/dist/client/assets/index-CsZNHdJT.js.br +0 -0
  79. package/dist/client/assets/issues-panel-BOeYMzEs.js.br +0 -0
  80. package/dist/client/assets/my-prs-panel-d9RoNUfy.js.br +0 -0
  81. package/dist/client/assets/nyan-cat-BMsZXAWE.js.br +0 -0
  82. package/dist/client/assets/phone-shell-CBvfs5Q4.js.br +0 -0
  83. package/dist/client/assets/plan-face-Bmre1ipT.js.br +0 -0
  84. package/dist/client/assets/plan-render-CSgvT2MS.js.br +0 -0
  85. package/dist/client/assets/pr-queue-columns-PaYWyOTi.js.br +0 -0
  86. package/dist/client/assets/radar-panel-CsJwUtqX.js.br +0 -0
  87. package/dist/client/assets/repo-roots-adder-I_osQTym.js.br +0 -0
  88. package/dist/client/assets/resume-dialog-BoXngMc2.js.br +0 -0
  89. package/dist/client/assets/review-queue-panel-Dx4RTtN9.js.br +0 -0
  90. package/dist/client/assets/settings-panel-DCIkcVt_.js.br +0 -0
  91. package/dist/client/assets/shown-lightbox-CvQpDcpX.js.br +0 -0
  92. package/dist/client/assets/team-review-panel-D6mFydSP.js.br +0 -0
  93. package/dist/client/assets/trace-panel-Bfq4tBBH.js.br +0 -0
  94. package/dist/client/assets/usage-panel-CAHY96Ka.js.br +0 -0
package/README.md CHANGED
@@ -61,7 +61,7 @@ To update, run `git pull --ff-only && npm ci && npm run build` and restart. The
61
61
  - **Windows 11, Linux or macOS.** CI runs the suite on Linux and installs and starts the package on Windows; macOS is tested by hand.
62
62
  - **An agent CLI** on PATH: Claude Code, Codex, Kimi Code, Grok or another terminal agent.
63
63
  - **git** on PATH, for per-session worktrees.
64
- - **Linux only:** `build-essential` and `python3` to compile node-pty, plus `bubblewrap`, `socat` and `ripgrep` for session guardrails (`sudo apt install bubblewrap socat ripgrep`).
64
+ - **Linux only:** `build-essential` and `python3` to compile node-pty.
65
65
 
66
66
  `glimmervoid doctor` checks all of these.
67
67
 
@@ -87,7 +87,7 @@ Declare another agent under `customAgents` in `config.json` with an `id`, `label
87
87
  - **Notifications.** Browser notifications when a session needs input, finishes or fails, with your own alert sounds if you like (drop `.ogg`, `.mp3`, `.wav`, `.m4a` or `.webm` files into `~/.glimmervoid/sounds/`). Telegram covers you when no dashboard is open.
88
88
  - **Phone layout.** Board, terminal and review screens, attention first, with a terminal that resizes around the keyboard.
89
89
  - **Plan review.** Read, edit and approve Claude Code plans from the dashboard or your phone.
90
- - **Guardrails.** Guarded Claude Code sessions on macOS and Linux (on unless a project or folder opts out) cannot touch credentials or Glimmervoid's own state, and Sane YOLO, once its hooks are installed and trusted, refuses commands like `git reset --hard` and `git push --force` in sessions that skip permission prompts.
90
+ - **Guardrails.** Sane YOLO runs in every session and lane whose agent supports it, refusing commands like `git reset --hard` and `git push --force` and reads of credentials such as SSH keys and `.env` files. It catches accidents; it is not a sandbox.
91
91
  - **Usage.** Tokens and estimated cost from local Claude Code, Codex, Kimi Code and Grok transcripts, with optional budgets.
92
92
  - **Auto-resume.** Sessions live when Glimmervoid stopped come back with their conversation resumed.
93
93
  - **Remote access** (opt-in). Reach the dashboard from another device through single-use pairing links.
@@ -5,7 +5,7 @@ import { a as packageRoot } from "../chunks/runtime-paths-D_ZjJLE0.js";
5
5
  import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
6
6
  import { t as AGENT_API_VERBS } from "../chunks/session-Bea8RPJ5.js";
7
7
  import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
8
- import { r as agentCommandHelpLines } from "../chunks/agent-api-core-B9Y8p1sI.js";
8
+ import { r as agentCommandHelpLines } from "../chunks/agent-api-core-BaPhuKSP.js";
9
9
  import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
10
10
  import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-BvibrGvo.js";
11
11
  import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
@@ -65,17 +65,17 @@ var OWN_SUBCOMMAND_RUNNERS = [
65
65
  return runAgentSetupCli(subcommandArgs);
66
66
  }],
67
67
  ["settings", async (subcommandArgs) => {
68
- const { runSettingsCli } = await import("../chunks/settings-cli-Bb8uoBUd.js");
68
+ const { runSettingsCli } = await import("../chunks/settings-cli-BFcFyhrm.js");
69
69
  return runSettingsCli(subcommandArgs);
70
70
  }],
71
71
  ["ssh-sign", async (subcommandArgs) => {
72
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-CCRsXp-f.js");
72
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-D64-uGur.js");
73
73
  return runSshSignCli(subcommandArgs);
74
74
  }]
75
75
  ];
76
76
  var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
77
77
  var SUBCOMMAND_RUNNERS = new Map([...OWN_SUBCOMMAND_RUNNERS, ...AGENT_API_VERBS.filter((verb) => !ownSubcommandNames.has(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
78
- const { runAgentApiCli } = await import("../chunks/agent-api-cli-BgtBfEpE.js");
78
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-DAp3d4NI.js");
79
79
  return runAgentApiCli([subcommandName, ...subcommandArgs]);
80
80
  }])]);
81
81
  var AGENT_INSTALL_COMMAND_BY_ID = {
@@ -89,7 +89,7 @@ function missingAgentText(agentId) {
89
89
  }
90
90
  async function printSessionLimits() {
91
91
  if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
92
- const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-BgtBfEpE.js");
92
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-DAp3d4NI.js");
93
93
  const limitsLines = await sessionLimitsHelpLines();
94
94
  console.log(`\n${limitsLines.join("\n")}`);
95
95
  }
@@ -222,7 +222,7 @@ async function runDoctor() {
222
222
  }
223
223
  switchSection("Agents");
224
224
  try {
225
- const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-CkgywK6b.js");
225
+ const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-ChpRHvYd.js");
226
226
  const declaredCustomAgents = await readDeclaredCustomAgents();
227
227
  if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
228
228
  setCustomAgents(declaredCustomAgents.declared);
@@ -3,7 +3,7 @@ import { o as relayPath, u as isPathInside } from "./runtime-paths-D_ZjJLE0.js";
3
3
  import { Jt as shortSha$1, Kt as FULL_SHA_RE } from "./session-Bea8RPJ5.js";
4
4
  import { c as spawn, i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
5
5
  import { Dt as UpdateChannel, c as SHELL_AGENT_ID, x as InstallFlavor } from "./config-Bf3aImLn.js";
6
- import { o as supervisionLine } from "./session-routes-BTMSVce8.js";
6
+ import { o as supervisionLine } from "./session-routes-EX1dLFlu.js";
7
7
  import { a as rawTextOr, o as textOr, r as numberOr } from "./coerce-oz_Z_6E7.js";
8
8
  import { n as parseJsonRecord } from "./json-core-If8h-Qgy.js";
9
9
  import { i as saneYoloEnv, r as SANE_YOLO_PATH_ENV, t as CODEX_SANE_YOLO_FLAVOR } from "./sane-yolo-BjUkqIoH.js";
@@ -1 +1 @@
1
- export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-Dx1U5sPa.js";
1
+ export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-CRTUz6uZ.js";
@@ -1 +1 @@
1
- export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-BLNaCyCK.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-DosoxmZ5.js";
@@ -1,6 +1,6 @@
1
1
  import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-Bea8RPJ5.js";
2
- import { i as formatSessionLimits } from "./session-routes-BTMSVce8.js";
3
- import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-B9Y8p1sI.js";
2
+ import { i as formatSessionLimits } from "./session-routes-EX1dLFlu.js";
3
+ import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-BaPhuKSP.js";
4
4
  import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
5
5
  import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
6
6
  import { r as describeOverCap } from "./shown-files-core-D2HvpYbu.js";
@@ -1,6 +1,6 @@
1
1
  import { C as RefinedTaskTitle, K as WhiteboardAgentRequest, R as TASK_TITLE_CONTROL_CHARACTERS, a as AgentAnswerRequest, c as AgentEditRequest, d as AgentReadRequest, f as AgentReviewsRequest, g as AgentSpawnRequest, h as AgentSettingsRequest, n as AGENT_REPLY_SCHEMAS, o as AgentAttentionRequest, p as AgentSendRequest, s as AgentCloseRequest, t as AGENT_API_VERBS, u as AgentPullRequestRequest } from "./session-Bea8RPJ5.js";
2
2
  import { E as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-Bf3aImLn.js";
3
- import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-BTMSVce8.js";
3
+ import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-EX1dLFlu.js";
4
4
  import path from "node:path";
5
5
  import crypto from "node:crypto";
6
6
  //#region shared/session-naming.ts
@@ -873,7 +873,7 @@ var AGENT_COMMAND_HELP = Object.freeze({
873
873
  },
874
874
  limits: {
875
875
  usage: "limits",
876
- summary: "List which of these commands answer here and what the guardrails block",
876
+ summary: "List which of these commands answer here and why the rest do not",
877
877
  missingArgumentHint: null
878
878
  }
879
879
  });
@@ -5,8 +5,8 @@ import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfi
5
5
  import { $ as MyPrKeepMergeableRequest, A as SIGN_URL_ENV, At as ReviewResult, Bt as TeamReviewThreadResult, Ct as PostedReviewEvent, D as SESSION_NAME_PATTERN, Dt as ReviewComment, F as ShownFile, Ft as TeamReviewCompareFiles, G as WHITEBOARD_LIMITS, Gt as hasStandingViewerApproval, H as Box, Ht as canApproveAfterComment, It as TeamReviewResolveResponse, J as LinkedPr, Jt as shortSha, L as SshSignRequest, Lt as TeamReviewStateEntry, Mt as ReviewVerdict, Nt as TeamReviewActionRequest, O as SESSION_NAME_RULE_TEXT, Ot as ReviewDraft, Q as MyPrCheckContextsResponse, Qt as repoParts, Rt as TeamReviewStatus, S as ConversationQuestion, St as GithubReviewState, T as SESSION_DOC_BODY_CAP_BYTES, Tt as PrDetail, U as Frame, Ut as decisionAsIfApprovalRequired, V as BoardRecord, Vt as TeamReviewThreadsRepository, W as Note, X as MyPrAutoRebase, Xt as NODE_ID_RE, Y as MyPr, Yt as GH_SEGMENT, Z as MyPrCheckContext, Zt as REPO_SLUG_RE, _ as COHERENCE_HOOKS_INACTIVE, _t as CommitSha, an as MERGEABLE_LIVE_STATES, at as MyPrMergeStateResponse, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as FindingSeverity, dt as MyPrsSnapshot, ft as MyPrsState, i as ASK_USER_QUESTION_TOOL_NAME, in as KILLABLE_STATES, j as SSH_SIGN_BODY_CAP_BYTES, jt as ReviewThreadId, k as SHOWN_FILE_CAP_BYTES, kt as ReviewFinding, lt as MyPrThreadNode, nt as MyPrMergeMethod, on as RESTARTABLE_STATES, ot as MyPrMergeWhenReadyRequest, q as Wire, qt as HEX_SHA_RE, r as AGENT_URL_ENV, rn as BADGE_LABELS, rt as MyPrMergeRequest, sn as STATES, tt as MyPrLaneEntry, ut as MyPrThreadsResponse, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, vt as DECIDING_REVIEW_STATES, wt as PostingPlan, y as CONVERSATION_PERMISSION_HOOK_EVENT, yt as EarlierReview, z as TaskTitle, zt as TeamReviewThreadCommentsResponse } from "./session-Bea8RPJ5.js";
6
6
  import { c as spawn, i as execFileSync, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BCOoKfxG.js";
7
7
  import { At as MAX_RAW_LINE_CHARS, B as MinedPrReviewData, Bt as PLAN_TOOL_NAME, Ct as CommunityState, D as FeatureHintState, E as pullRequestKeyFromReference, F as BenchmarkRun, Ft as changeMapFactId, G as GithubPrsFrame, Gt as GithubIssuePullRequestsRepository, H as GithubPrDetailNode, Ht as PlanRevision, I as BenchmarkStatus, It as PLAN_BODY_CAP_BYTES, J as WorkflowLabelName, Jt as IssueUpdate, K as comparablePrKey, Kt as GithubIssueResponse, L as BenchmarkSuite, Lt as PLAN_HOOK_EVENT, M as BenchmarkCase, Mt as TraceRecord, N as BenchmarkId, Nt as CoherenceJournalOutput, O as HINT_FEATURES, Ot as UpdateJournal, P as BenchmarkJudgement, Pt as ChangeMap, Qt as issuePullRequestStateFromGithub, R as CommitComparison, Rt as PLAN_HOOK_OUTPUT_MAX_CHARS, St as CommunityItem, Tt as DISCORD_CHANNEL_NAME_RE, U as GithubPrKey, Ut as parseExitPlanModeHookPayload, V as PrCheckoutCaseInput, Vt as PlanDecision, W as GithubPrLightSearchNode, Wt as planTitle, X as WorkflowsState, Xt as IssuesState, Y as WorkflowsSettings, Yt as IssuesSearchResponse, Zt as IssuesStatus, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, bt as CommunityActionRequest, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, h as CHANGES_POLL_INTERVAL_MS, ht as USAGE_INTEGER_RANGES, j as BenchmarkActionRequest, jt as TraceCheckpoint, k as HINT_VIEW_BY_FEATURE, kt as SessionSetup, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, p as USAGE_VENDOR_KEYS, q as WorkflowCommentBody, qt as IssueKey, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityVerdict, xt as CommunityDraft, y as ClientMessage, z as MergedPrListing, zt as PLAN_RESULT_HOOK_EVENT } from "./config-Bf3aImLn.js";
8
- import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-BTMSVce8.js";
9
- import { A as parseRefinedTaskTitle, B as shouldAdoptReportedResumeId, C as extractAiTitle, D as isSelfWakePrompt, E as extractPromptTaskTitle, F as RESUME_ID_RE, G as nextSuggestedName, H as listRepoConversations, I as isConversationReplacedAtStartup, L as pickAutoResume, M as resolveTaskTitle, N as seedTaskTitleSources, O as isSubstantivePrompt, P as AUTO_CONTINUE_PROMPT, R as resolveResumeTarget, S as decideTaskTitleRefinement, T as extractOscTaskTitle, U as listRepoWorktreePaths, V as claudeProjectsDir, W as isAutoNameOf, _ as projectReviews, a as decideAgentRequest, b as chooseRefinedSessionName, c as describeChildEndNote, d as describeRoleRefusal, f as describeUnpushedCloseRefusal, g as projectReviewDetail, h as projectMyPrs, i as checkAgentReply, j as resolveRefocusTaskTitle, k as parseRefinedSessionName, l as describeKeptChildAttention, m as parseAgentVerb, n as REFUSAL_REASON, o as decideSpawnAllowance, s as deriveChildSessionName, u as describePushLanding, v as buildPersistedTaskTitle, w as extractHookTaskTitle, x as cleanTaskPrompt, y as buildTaskTitleRefinementPrompt, z as resumePromptFor } from "./agent-api-core-B9Y8p1sI.js";
8
+ import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-EX1dLFlu.js";
9
+ import { A as parseRefinedTaskTitle, B as shouldAdoptReportedResumeId, C as extractAiTitle, D as isSelfWakePrompt, E as extractPromptTaskTitle, F as RESUME_ID_RE, G as nextSuggestedName, H as listRepoConversations, I as isConversationReplacedAtStartup, L as pickAutoResume, M as resolveTaskTitle, N as seedTaskTitleSources, O as isSubstantivePrompt, P as AUTO_CONTINUE_PROMPT, R as resolveResumeTarget, S as decideTaskTitleRefinement, T as extractOscTaskTitle, U as listRepoWorktreePaths, V as claudeProjectsDir, W as isAutoNameOf, _ as projectReviews, a as decideAgentRequest, b as chooseRefinedSessionName, c as describeChildEndNote, d as describeRoleRefusal, f as describeUnpushedCloseRefusal, g as projectReviewDetail, h as projectMyPrs, i as checkAgentReply, j as resolveRefocusTaskTitle, k as parseRefinedSessionName, l as describeKeptChildAttention, m as parseAgentVerb, n as REFUSAL_REASON, o as decideSpawnAllowance, s as deriveChildSessionName, u as describePushLanding, v as buildPersistedTaskTitle, w as extractHookTaskTitle, x as cleanTaskPrompt, y as buildTaskTitleRefinementPrompt, z as resumePromptFor } from "./agent-api-core-BaPhuKSP.js";
10
10
  import { a as rawTextOr, i as positiveNumberOr, n as isRecord, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
11
11
  import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-BvibrGvo.js";
12
12
  import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
@@ -20,7 +20,7 @@ import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as
20
20
  import { $ as stableConfigKey, B as buildPersonProperties, F as TELEMETRY_FLAGS_URL, G as decideRemoteTelemetryState, H as claudeAccountUuidOf, I as adapterBucket, J as nodeMajorVersion, K as decideTelemetryConsent, L as buildAiGenerationEvents, M as isExperimentalSetting, N as FIRST_RUN_NOTICE, P as TELEMETRY_BATCH_URL, R as buildBrowserExceptionProperties, U as codexUserIdOf, V as classifySessionExit, W as decideIsDevInstall, X as resolveProjectToken, Y as parsePosthogReleaseId, _ as settingsBlockSpecFor, a as ensureProjectIds, at as sessionIdFromBranch, ct as canonicalizePath, f as DEFAULT_TIMER_FNS, g as mergeSettingsBlock, i as createConfigStore, it as planWorktreeGc, k as valueAtPath, lt as comparableDirectoryPath, n as DEFAULT_CONFIG, nt as matchedPrefix, o as generateProjectId, ot as usablePrefixes, p as unrefTimer, q as exceptionFingerprint, rt as planBranchGc, s as glimmervoidHomeDir$1, st as worktreeIntegrationTips, t as ABORT_CONFIG_SAVE, tt as DEFAULT_BRANCH_GC_PREFIXES, ut as isSameDirectoryPath, v as validateSettingsBlock, y as SETTINGS_INDEX, z as buildExceptionProperties } from "./config-store-DPI2U_ec.js";
21
21
  import { _ as TelemetryState, a as DEEP_HISTORY_SCROLLBACK_LINES, c as describeDataAttach, d as DashboardTelemetryReport, h as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, l as parseDataAttach, m as PendingCrashReport, r as HTTP_URL_RE, s as LOGGED_FAST_CLOSE_COUNTS, u as parseDataClientMessage } from "./build-channel-5BUVzH7i.js";
22
22
  import { i as resolveArgvCommandMatches } from "./kimi-CXbdfj0T.js";
23
- import { $ as isUsageFile, A as exceedsUploadCap, B as isOversizedPartialLine, C as parseResolvedSha, Ct as totalTokensOf$1, D as MAX_UPLOAD_BYTES, E as openContainedFile, Et as claudeCode, F as MAX_TRANSCRIPT_READ_BYTES, G as codexHomes, H as resumeOffsetFrom, I as TRACE_TAIL_SCAN_BYTES, J as continuationDelayMs, K as codexRootCandidates, L as committedOffsetFromTraceTailOrNull, M as imageMimeForUploadFilename, N as isSafePathSegment, O as buildUploadFilename, P as planUploadRetention, Q as grokHomes, R as completeLineBytes, S as parseRegistryLatest, St as shouldReplace, T as shortSha$1, Tt as HOOK_TOOLS, U as withCommittedOffset, V as planContiguousRead, W as codexFallbackRoots, X as dedupeCodexFiles, Y as decideFileRead, Z as expandTilde, _ as decideUpdateStatus, _t as identityFromRelPath, a as describeAgentResolvability, at as sessionsRootCandidates, b as normalizeUpdateChannel, bt as parseJsonLine, c as isKnownAgentId, ct as splitLines, d as resolveAdapter, dt as addEntryToTotals, et as kimiHomes, f as setCustomAgents, ft as dedupKeys, g as decideInstallFlavor, gt as foldReplacementIntoGenerationRollup, h as requestCodexAppServer, ht as foldEntryIntoGenerationRollup, i as customAgentFingerprint, it as scopedClaudeRoots, j as framePathPaste, k as decideUploadType, l as listAgentIds, lt as kimiDedupIdentity, m as readHostCodexVersion, mt as expandAdvisorIterations, n as cachedAgentResolvability, nt as projectDirCandidates, o as getAdapter, ot as shouldEvaluateDespiteIoFailures, p as codex, pt as emptyTotals, q as codexSessionIdFromPath, r as commandFor, rt as resolveProjectsDirs, s as hookProfileOf, st as shouldPersistWarehouse, t as DEFAULT_AGENT_ID$1, tt as passOutcome, u as resetCommandCache, ut as parseKimiUsageLine, v as isCheckFresh, vt as isWithinGenerationRecencyWindow, w as pickNewestPublished, wt as vendorUsageEntry, x as parseRegistryDeprecation, xt as parseUsageLine, y as normalizeSha, yt as mergeGenerationRollups, z as containmentRefusalReason } from "./adapters-Dx1U5sPa.js";
23
+ import { $ as isUsageFile, A as exceedsUploadCap, B as isOversizedPartialLine, C as parseResolvedSha, Ct as totalTokensOf$1, D as MAX_UPLOAD_BYTES, E as openContainedFile, Et as claudeCode, F as MAX_TRANSCRIPT_READ_BYTES, G as codexHomes, H as resumeOffsetFrom, I as TRACE_TAIL_SCAN_BYTES, J as continuationDelayMs, K as codexRootCandidates, L as committedOffsetFromTraceTailOrNull, M as imageMimeForUploadFilename, N as isSafePathSegment, O as buildUploadFilename, P as planUploadRetention, Q as grokHomes, R as completeLineBytes, S as parseRegistryLatest, St as shouldReplace, T as shortSha$1, Tt as HOOK_TOOLS, U as withCommittedOffset, V as planContiguousRead, W as codexFallbackRoots, X as dedupeCodexFiles, Y as decideFileRead, Z as expandTilde, _ as decideUpdateStatus, _t as identityFromRelPath, a as describeAgentResolvability, at as sessionsRootCandidates, b as normalizeUpdateChannel, bt as parseJsonLine, c as isKnownAgentId, ct as splitLines, d as resolveAdapter, dt as addEntryToTotals, et as kimiHomes, f as setCustomAgents, ft as dedupKeys, g as decideInstallFlavor, gt as foldReplacementIntoGenerationRollup, h as requestCodexAppServer, ht as foldEntryIntoGenerationRollup, i as customAgentFingerprint, it as scopedClaudeRoots, j as framePathPaste, k as decideUploadType, l as listAgentIds, lt as kimiDedupIdentity, m as readHostCodexVersion, mt as expandAdvisorIterations, n as cachedAgentResolvability, nt as projectDirCandidates, o as getAdapter, ot as shouldEvaluateDespiteIoFailures, p as codex, pt as emptyTotals, q as codexSessionIdFromPath, r as commandFor, rt as resolveProjectsDirs, s as hookProfileOf, st as shouldPersistWarehouse, t as DEFAULT_AGENT_ID$1, tt as passOutcome, u as resetCommandCache, ut as parseKimiUsageLine, v as isCheckFresh, vt as isWithinGenerationRecencyWindow, w as pickNewestPublished, wt as vendorUsageEntry, x as parseRegistryDeprecation, xt as parseUsageLine, y as normalizeSha, yt as mergeGenerationRollups, z as containmentRefusalReason } from "./adapters-CRTUz6uZ.js";
24
24
  import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-DgW3orTE.js";
25
25
  import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-BzANIIVe.js";
26
26
  import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
@@ -48,7 +48,7 @@ function spawnRoute({ isEphemeral, isSpawnedChild }) {
48
48
  };
49
49
  if (isEphemeral) return {
50
50
  answers: false,
51
- reason: "only an operator session may spawn a session, because the new session gets an operator session's guardrails, which can be wider than this one's"
51
+ reason: "only an operator session may spawn a session, because the new session gets an operator session's tools and permissions, which can be wider than this one's"
52
52
  };
53
53
  return ANSWERS;
54
54
  }
@@ -131,7 +131,7 @@ function applyValidatedMutation(view, setting, mutate, checks = []) {
131
131
  return saved.config;
132
132
  }
133
133
  function unreadableHomeMessage(homeDir, error) {
134
- return `cannot read the Glimmervoid home at ${homeDir} (${errorCode(error) ?? errorMessage(error)}). A session with guardrails cannot read it; run this command from a shell outside the session`;
134
+ return `cannot read the Glimmervoid home at ${homeDir} (${errorCode(error) ?? errorMessage(error)})`;
135
135
  }
136
136
  function homeReadError(homeDir) {
137
137
  try {
@@ -330,7 +330,7 @@ function processIo() {
330
330
  async function runSettingsCli(commandArguments, io = processIo()) {
331
331
  const serverRequest = settingsRequestForServer(commandArguments, process.env);
332
332
  if (!serverRequest) return runSettingsCommand(commandArguments, io);
333
- const { askAgentApi } = await import("./agent-api-cli-BgtBfEpE.js");
333
+ const { askAgentApi } = await import("./agent-api-cli-DAp3d4NI.js");
334
334
  const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
335
335
  ok: false,
336
336
  error: errorMessage(error)
@@ -2,7 +2,7 @@ import { r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { A as SIGN_URL_ENV, I as SshSignReply } from "./session-Bea8RPJ5.js";
3
3
  import { c as spawn, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
4
4
  import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
5
- import { n as postToAgentIngress } from "./agent-api-cli-BLNaCyCK.js";
5
+ import { n as postToAgentIngress } from "./agent-api-cli-DosoxmZ5.js";
6
6
  import { l as parseSshPublicKey } from "./ssh-signing-core-CRhVVWNW.js";
7
7
  import path from "node:path";
8
8
  import fs from "node:fs/promises";
@@ -1 +1 @@
1
- import{Gi as e,Ji as t,Ki as n,Ui as r,Wi as i,Xi as a,Yi as o,qi as s}from"./index-CsZNHdJT.js";var c=.3,l=null;function u(){return a(l)}function d(e){return o(e,l)}async function f(){try{let e=await fetch(r,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=t(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(t){g(e[t]??e.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(s(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(i)}catch{}}function S(e){try{let t=d(e),r=n(t);if(!r){h(t);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
1
+ import{Gi as e,Ji as t,Ki as n,Ui as r,Wi as i,Xi as a,Yi as o,qi as s}from"./index-7X85zNIF.js";var c=.3,l=null;function u(){return a(l)}function d(e){return o(e,l)}async function f(){try{let e=await fetch(r,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=t(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(t){g(e[t]??e.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(s(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(i)}catch{}}function S(e){try{let t=d(e),r=n(t);if(!r){h(t);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-ChBcprFg.js";import{n as e,o as t,r as n}from"./dom-helpers-I_SDCPvs.js";import{J as r,Y as i,q as a}from"./index-CsZNHdJT.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-ChBcprFg.js";import{n as e,o as t,r as n}from"./dom-helpers-I_SDCPvs.js";import{J as r,Y as i,q as a}from"./index-7X85zNIF.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-I_SDCPvs.js";import{bi as r,na as i}from"./index-CsZNHdJT.js";import{playToneSequence as a}from"./alert-sound-DgoHlCku.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-I_SDCPvs.js";import{bi as r,na as i}from"./index-7X85zNIF.js";import{playToneSequence as a}from"./alert-sound-4X0PJdN4.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-I_SDCPvs.js";import{o as i}from"./card-registry-BY5hMgbI.js";import{i as a}from"./modal-BRwbyxA2.js";import{c as o,i as ee}from"./action-status-kYtKMGjN.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,Xr as p,Zr as m,_t as h,gt as ne,ht as g,it as _,kt as v,m as re,mt as ie,on as ae,pt as y,sn as b,vt as x,yt as S}from"./index-CsZNHdJT.js";import{t as C}from"./team-review-panel-D6mFydSP.js";import{t as w}from"./pr-queue-columns-PaYWyOTi.js";var oe={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},se={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ce={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:oe[e.verdict],tone:se[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:T.error,tone:`danger`}:{text:T[e.status],tone:`muted`}}function D(e){let t=ce[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function le(e){return e.status!==`running`&&e.status!==`queued`}function k(e){return e.status!==`aside`}function A(e){let t=e.find(e=>e.id===`working`)?.items.length??0;return t===0?`No community question needs you right now.`:`No community question needs you right now. ${t} ${t===1?`question is`:`questions are`} being researched.`}function j(e){return e?e.configured===!1?e.reason??`The community lane is not set up yet.`:`No community questions yet. New ones asked after you turned this on show up here.`:`Waiting for the community lane to report.`}function M(e){return e.filter(e=>!e.isWorkspace&&!e.isEphemeral).map(({id:e,name:t})=>({id:e,name:t})).toSorted((e,t)=>e.name.localeCompare(t.name))}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map;function W(){return M([...i].map(([e,t])=>({id:e,name:t.nameEl.textContent??e,isWorkspace:t.card.dataset.workspace!==void 0,isEphemeral:t.card.dataset.ephemeral!==void 0})))}function G(e,n){let r=t(`button`,`pr-action pr-action-ghost`,e);return r.type=`button`,r.disabled=!m(n),r.addEventListener(`click`,()=>p(n)),r}function K(e,n,r){let i=t(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!n,i.addEventListener(`click`,r),i}function q(e,n,r){let i=t(`ul`,e);i.setAttribute(`aria-label`,n);for(let e of r)i.append(t(`li`,null,e));return i}function ue(e){let n=t(`div`,`pr-detail-heading`),r=t(`div`,`pr-detail-title`);r.append(t(`h2`,null,e.item.title||`Untitled question`));let i=t(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(t(`span`,null,e.item.author),t(`span`,null,D(e))),Number.isNaN(a)||i.append(t(`span`,null,`Asked ${re(a)}`)),n.append(r,i),n}function de(e){let n=t(`section`,`community-question`);return n.setAttribute(`aria-label`,`Question as asked`),n.append(t(`h3`,`pr-section-heading`,`Question as asked`),t(`p`,`community-question-body`,e.item.body)),n}function fe(e){let n=t(`section`,`pr-verdict-box`);n.setAttribute(`aria-label`,`Research`);let r=E(e),i=t(`div`,`pr-verdict-line`),a=t(`strong`,`community-badge`,r.text);if(a.dataset.tone=r.tone,i.append(a),n.append(i),e.error&&n.append(t(`p`,`pr-attention-detail`,e.error)),e.summary&&n.append(t(`p`,`pr-verdict-summary`,e.summary)),e.goal&&n.append(t(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&n.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return n;let o=t(`details`,`pr-verdict-checked`);return o.append(t(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),n.append(o),n}function pe(e){if(!e.draft)return null;let n=t(`section`,`community-draft`);n.setAttribute(`aria-label`,`Draft reply`),n.append(t(`h3`,`pr-section-heading`,`Draft reply`),t(`p`,`community-draft-body`,e.draft.body));let r=e.draft.publicLinks.filter(m);if(r.length===0)return n;let i=t(`ul`,`community-links`);for(let e of r){let n=t(`li`);n.append(G(e,e)),i.append(n)}return n.append(i),n}function me(e,t){let n=e.draft?r(e.draft.body):null;n?n.then(()=>t.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>t.show(`error`,`Copying failed. Select the draft text instead.`)):t.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function he(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await 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&&_()?.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?C({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){x(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=v(L,O);b(I,f(e),e.filter(e=>e.id!==R))}function Z(e){R=e;for(let[t,n]of U)n.setAttribute(`aria-current`,String(t===e));let t=l(L,e),n=U.get(e);t&&n&&ye(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function be(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=l(L,e);if(!t)return;L.find(e=>e.items.includes(t))?.id===`aside`&&(z=!0),R=e,$(),Z(e);let n=U.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function xe(t){if(t.repeat||t.defaultPrevented||!N||n(N)||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&&h(d(e))){let e=t(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),r.append(e)}return r.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,r),r}function Ce(e){let n=t(`h3`,`pr-section-heading review-group-heading`),r=t(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return n.append(t(`span`,null,e.title),r),n;let i=t(`button`,`review-group-toggle`),a=t(`span`,`review-group-chevron`,`▸`);return a.setAttribute(`aria-hidden`,`true`),i.append(a,e.title),i.type=`button`,i.setAttribute(`aria-expanded`,String(z)),i.addEventListener(`click`,()=>{z=!z,B=null,$()}),n.append(i,r),n}function we(e){let n=t(`section`,`pr-queue-section`);if(n.dataset.group=e.id,n.append(Ce(e)),e.id===`aside`&&!z)return n;for(let t of e.items)n.append(Se(t,e.id===`turn`));return n}function $(){if(!P)return;L=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,ne(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.error,r=n?[t(`p`,`my-pr-note`,n)]:[],i=L.filter(e=>e.items.length>0).map(we);P.replaceChildren(...r,...i.length>0?i:[t(`p`,`pr-empty`,j(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=w({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=r.queue,F=t(`div`,`review-queue-detail`);let i=t(`div`,`review-queue-phone-bar`),a=t(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,be),i.append(a),r.detail.append(i,F),I=ae({onJump:()=>{let e=v(L,O).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),r.queue.before(I),N.append(r.columns),N.dataset.detailOpen=`false`,y(()=>!n(N)),S(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
1
+ import{d as e,o as t,u as n,y as r}from"./dom-helpers-I_SDCPvs.js";import{o as i}from"./card-registry-BY5hMgbI.js";import{i as a}from"./modal-BRwbyxA2.js";import{c as o,i as ee}from"./action-status-kYtKMGjN.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,Xr as p,Zr as m,_t as h,gt as ne,ht as g,it as _,kt as v,m as re,mt as ie,on as ae,pt as y,sn as b,vt as x,yt as S}from"./index-7X85zNIF.js";import{t as C}from"./team-review-panel-BbbaboFA.js";import{t as w}from"./pr-queue-columns-CY9Fw_bp.js";var oe={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},se={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ce={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:oe[e.verdict],tone:se[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:T.error,tone:`danger`}:{text:T[e.status],tone:`muted`}}function D(e){let t=ce[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function le(e){return e.status!==`running`&&e.status!==`queued`}function k(e){return e.status!==`aside`}function A(e){let t=e.find(e=>e.id===`working`)?.items.length??0;return t===0?`No community question needs you right now.`:`No community question needs you right now. ${t} ${t===1?`question is`:`questions are`} being researched.`}function j(e){return e?e.configured===!1?e.reason??`The community lane is not set up yet.`:`No community questions yet. New ones asked after you turned this on show up here.`:`Waiting for the community lane to report.`}function M(e){return e.filter(e=>!e.isWorkspace&&!e.isEphemeral).map(({id:e,name:t})=>({id:e,name:t})).toSorted((e,t)=>e.name.localeCompare(t.name))}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map;function W(){return M([...i].map(([e,t])=>({id:e,name:t.nameEl.textContent??e,isWorkspace:t.card.dataset.workspace!==void 0,isEphemeral:t.card.dataset.ephemeral!==void 0})))}function G(e,n){let r=t(`button`,`pr-action pr-action-ghost`,e);return r.type=`button`,r.disabled=!m(n),r.addEventListener(`click`,()=>p(n)),r}function K(e,n,r){let i=t(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!n,i.addEventListener(`click`,r),i}function q(e,n,r){let i=t(`ul`,e);i.setAttribute(`aria-label`,n);for(let e of r)i.append(t(`li`,null,e));return i}function ue(e){let n=t(`div`,`pr-detail-heading`),r=t(`div`,`pr-detail-title`);r.append(t(`h2`,null,e.item.title||`Untitled question`));let i=t(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(t(`span`,null,e.item.author),t(`span`,null,D(e))),Number.isNaN(a)||i.append(t(`span`,null,`Asked ${re(a)}`)),n.append(r,i),n}function de(e){let n=t(`section`,`community-question`);return n.setAttribute(`aria-label`,`Question as asked`),n.append(t(`h3`,`pr-section-heading`,`Question as asked`),t(`p`,`community-question-body`,e.item.body)),n}function fe(e){let n=t(`section`,`pr-verdict-box`);n.setAttribute(`aria-label`,`Research`);let r=E(e),i=t(`div`,`pr-verdict-line`),a=t(`strong`,`community-badge`,r.text);if(a.dataset.tone=r.tone,i.append(a),n.append(i),e.error&&n.append(t(`p`,`pr-attention-detail`,e.error)),e.summary&&n.append(t(`p`,`pr-verdict-summary`,e.summary)),e.goal&&n.append(t(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&n.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return n;let o=t(`details`,`pr-verdict-checked`);return o.append(t(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),n.append(o),n}function pe(e){if(!e.draft)return null;let n=t(`section`,`community-draft`);n.setAttribute(`aria-label`,`Draft reply`),n.append(t(`h3`,`pr-section-heading`,`Draft reply`),t(`p`,`community-draft-body`,e.draft.body));let r=e.draft.publicLinks.filter(m);if(r.length===0)return n;let i=t(`ul`,`community-links`);for(let e of r){let n=t(`li`);n.append(G(e,e)),i.append(n)}return n.append(i),n}function me(e,t){let n=e.draft?r(e.draft.body):null;n?n.then(()=>t.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>t.show(`error`,`Copying failed. Select the draft text instead.`)):t.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function he(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await 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&&_()?.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?C({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){x(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=v(L,O);b(I,f(e),e.filter(e=>e.id!==R))}function Z(e){R=e;for(let[t,n]of U)n.setAttribute(`aria-current`,String(t===e));let t=l(L,e),n=U.get(e);t&&n&&ye(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function be(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=l(L,e);if(!t)return;L.find(e=>e.items.includes(t))?.id===`aside`&&(z=!0),R=e,$(),Z(e);let n=U.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function xe(t){if(t.repeat||t.defaultPrevented||!N||n(N)||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&&h(d(e))){let e=t(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),r.append(e)}return r.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,r),r}function Ce(e){let n=t(`h3`,`pr-section-heading review-group-heading`),r=t(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return n.append(t(`span`,null,e.title),r),n;let i=t(`button`,`review-group-toggle`),a=t(`span`,`review-group-chevron`,`▸`);return a.setAttribute(`aria-hidden`,`true`),i.append(a,e.title),i.type=`button`,i.setAttribute(`aria-expanded`,String(z)),i.addEventListener(`click`,()=>{z=!z,B=null,$()}),n.append(i,r),n}function we(e){let n=t(`section`,`pr-queue-section`);if(n.dataset.group=e.id,n.append(Ce(e)),e.id===`aside`&&!z)return n;for(let t of e.items)n.append(Se(t,e.id===`turn`));return n}function $(){if(!P)return;L=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,ne(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.error,r=n?[t(`p`,`my-pr-note`,n)]:[],i=L.filter(e=>e.items.length>0).map(we);P.replaceChildren(...r,...i.length>0?i:[t(`p`,`pr-empty`,j(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=w({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=r.queue,F=t(`div`,`review-queue-detail`);let i=t(`div`,`review-queue-phone-bar`),a=t(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,be),i.append(a),r.detail.append(i,F),I=ae({onJump:()=>{let e=v(L,O).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),r.queue.before(I),N.append(r.columns),N.dataset.detailOpen=`false`,y(()=>!n(N)),S(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
@@ -1,4 +1,4 @@
1
- import{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-ChBcprFg.js";import{h as o,m as s,o as c}from"./dom-helpers-I_SDCPvs.js";import{d as l}from"./control-ws-DLYZcM_c.js";import{n as u,r as d,t as f}from"./modal-BRwbyxA2.js";import{i as p,s as m,t as h}from"./action-status-kYtKMGjN.js";import{n as g}from"./session-tick-Bn4vajhu.js";import{Ar as _,Dr as v,Er as y,Or as b,ai as x,gr as S,ii as C,jn as w,jr as T,kr as E,m as D,ri as O,wr as ee}from"./index-CsZNHdJT.js";import{t as te}from"./repo-roots-adder-I_osQTym.js";import{t as ne}from"./sandboxed-frame-qKHbOuc_.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
1
+ import{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-ChBcprFg.js";import{h as o,m as s,o as c}from"./dom-helpers-I_SDCPvs.js";import{d as l}from"./control-ws-DLYZcM_c.js";import{n as u,r as d,t as f}from"./modal-BRwbyxA2.js";import{i as p,s as m,t as h}from"./action-status-kYtKMGjN.js";import{n as g}from"./session-tick-Bn4vajhu.js";import{Ar as _,Dr as v,Er as y,Or as b,ai as x,gr as S,ii as C,jn as w,jr as T,kr as E,m as D,ri as O,wr as ee}from"./index-7X85zNIF.js";import{t as te}from"./repo-roots-adder-DfzP5J1y.js";import{t as ne}from"./sandboxed-frame-qKHbOuc_.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
2
2
  <fieldset class="dialog-mode-controls add-session-agent-only" aria-label="Session kind">
3
3
  <button type="button" class="dialog-mode-button" id="add-session-single-mode" aria-pressed="true">Single repo</button>
4
4
  <button type="button" class="dialog-mode-button" id="add-session-workspace-mode" aria-pressed="false">Workspace</button>
@@ -1 +1 @@
1
- import{o as e}from"./dom-helpers-I_SDCPvs.js";import{d as t}from"./control-ws-DLYZcM_c.js";import{a as n,r,t as i}from"./modal-BRwbyxA2.js";import{s as a,t as o}from"./action-status-kYtKMGjN.js";import{ti as s,yn as c}from"./index-CsZNHdJT.js";import{i as l,t as u}from"./plan-render-CSgvT2MS.js";var d=null;function f(t){let n=s(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=s(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){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=s(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:c()?`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),!s(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
1
+ import{o as e}from"./dom-helpers-I_SDCPvs.js";import{d as t}from"./control-ws-DLYZcM_c.js";import{a as n,r,t as i}from"./modal-BRwbyxA2.js";import{s as a,t as o}from"./action-status-kYtKMGjN.js";import{ti as s,yn as c}from"./index-7X85zNIF.js";import{i as l,t as u}from"./plan-render-SR5k81K9.js";var d=null;function f(t){let n=s(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=s(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){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=s(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:c()?`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),!s(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
@@ -1 +1 @@
1
- import{gt as e}from"./updates-view-core-ChBcprFg.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{u as n}from"./control-ws-DLYZcM_c.js";import{An as r,i,kn as a,na as o,oi as s,si as c}from"./index-CsZNHdJT.js";var l={teamReview:e=>`${e} pull requests reviewed this week. Reviews lines up every PR waiting on you, and it is off right now.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them, and it is off right now.`,usage:()=>`Keeping an eye on tokens? Usage tracks spend per session and warns before a limit hits, and it is off right now.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you, and it is off right now.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side, and it is off right now.`};function u(e){return`${l[e.feature](e.distinctTargetCount)} Show me takes you to its switch in Settings.`}function d(e){let t=i.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var f=null;function p(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function m(e){try{return r(localStorage,a(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function h(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=d(t);r&&n.openSetting(r.sectionId,r.settingId)}function g(e,n){if(f?.isConnected||!m(e))return;let 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 d=t(`div`,`feature-hint-actions`);d.append(l,a),i.append(t(`p`,`feature-hint-text`,u(e)),d);let g=c()??o[0];r.append(i,s(g,`feature-hint-animal`));function _(t){p(e.feature,t),r.remove(),f=null}a.addEventListener(`click`,()=>{_(`open`),h(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(r),f=r,p(e.feature,`shown`)}export{g as showFeatureHint};
1
+ import{gt as e}from"./updates-view-core-ChBcprFg.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{u as n}from"./control-ws-DLYZcM_c.js";import{An as r,i,kn as a,na as o,oi as s,si as c}from"./index-7X85zNIF.js";var l={teamReview:e=>`${e} pull requests reviewed this week. Reviews lines up every PR waiting on you, and it is off right now.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them, and it is off right now.`,usage:()=>`Keeping an eye on tokens? Usage tracks spend per session and warns before a limit hits, and it is off right now.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you, and it is off right now.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side, and it is off right now.`};function u(e){return`${l[e.feature](e.distinctTargetCount)} Show me takes you to its switch in Settings.`}function d(e){let t=i.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var f=null;function p(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function m(e){try{return r(localStorage,a(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function h(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=d(t);r&&n.openSetting(r.sectionId,r.settingId)}function g(e,n){if(f?.isConnected||!m(e))return;let 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 d=t(`div`,`feature-hint-actions`);d.append(l,a),i.append(t(`p`,`feature-hint-text`,u(e)),d);let g=c()??o[0];r.append(i,s(g,`feature-hint-animal`));function _(t){p(e.feature,t),r.remove(),f=null}a.addEventListener(`click`,()=>{_(`open`),h(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(r),f=r,p(e.feature,`shown`)}export{g as showFeatureHint};
@@ -1 +1 @@
1
- import{o as e,y as t}from"./dom-helpers-I_SDCPvs.js";import{d as n,u as r}from"./control-ws-DLYZcM_c.js";import{i,s as a,t as o}from"./action-status-kYtKMGjN.js";import{En as s,mr as c,vr as l,yr as u}from"./index-CsZNHdJT.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-I_osQTym.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=s();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 c()?`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`),u()}),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`),l()}),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-I_SDCPvs.js";import{d as n,u as r}from"./control-ws-DLYZcM_c.js";import{i,s as a,t as o}from"./action-status-kYtKMGjN.js";import{En as s,mr as c,vr as l,yr as u}from"./index-7X85zNIF.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-DfzP5J1y.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=s();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 c()?`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`),u()}),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`),l()}),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 +1 @@
1
- import{a as e,h as t,l as n,n as r,p as i,r as a,u as o,v as s}from"./zod-PTDW0N7l.js";import{n as c}from"./updates-view-core-ChBcprFg.js";import{n as l,o as u,p as d,r as f,u as p}from"./dom-helpers-I_SDCPvs.js";import{d as m}from"./control-ws-DLYZcM_c.js";import{a as h}from"./modal-BRwbyxA2.js";import{i as ee,s as g,t as _}from"./action-status-kYtKMGjN.js";import{an as v,in as y,rn as b}from"./index-CsZNHdJT.js";var te=i(t(),s());o({glimmervoidId:t().min(1),event:t().min(1),token:t().nullable().optional(),payload:te}),o({id:t().min(1),name:t().min(1),event:t().min(1),matcher:t().optional(),type:r([`command`,`http`]),command:t().optional(),url:t().optional(),timeout:n().int().positive().optional(),enabled:e(),projects:a(t()).optional()}).passthrough();var ne=`Claude Code hooks injected into every session Glimmervoid spawns.`,re=`Loading hooks`,ie=`No hooks yet. A hook runs a command, or calls a URL, when a Claude Code event fires in a Glimmervoid session. Start from one of these, or add your own.`,ae=`Start from`,oe=`Filter by name, event or command`,se=`Nothing matches that filter.`,ce=`Preview`,le=`The entry this becomes in the per-session settings file.`,ue=`Duplicate`,de=`Discard changes`,fe=`Close the editor and lose the unsaved changes?`,pe=`Esc cancels. Ctrl+Enter saves.`,me=4,he=`A change reaches a session at its next start or restart. Claude Code sessions only; Codex and Grok sessions do not read this file.`,ge=`Glimmervoid's own hooks`,_e=`Always present, read-only. Status detection depends on them.`,ve=`Your hooks`,ye=`New hook`,be=`Edit hook`,xe=`Saved to config.json.`,x=`All projects`,Se=`This event takes no matcher.`,Ce=`Blank uses Claude Code's default for the event.`,we=Object.freeze([{value:`command`,label:`Command`,hint:`Run a shell command. It receives the event JSON on stdin.`},{value:`http`,label:`HTTP`,hint:`POST the event JSON to a URL.`}]),Te=Object.freeze([{id:`lint`,label:`Lint after edits`,summary:`PostToolUse on Edit|Write`,draft:{name:`Lint after edits`,event:`PostToolUse`,matcher:`Edit|Write`,type:`command`,command:`npx biome check --write "$(jq -r .tool_input.file_path)"`}},{id:`notify`,label:`Notify on Stop`,summary:`Stop, command`,draft:{name:`Notify on Stop`,event:`Stop`,matcher:``,type:`command`,command:`command -v notify-send >/dev/null 2>&1 && notify-send "Claude finished a turn" || { command -v osascript >/dev/null 2>&1 && osascript -e 'display notification "Claude finished a turn" with title "Claude Code"'; }`}},{id:`guard`,label:`Guard destructive Bash`,summary:`PreToolUse on Bash, exit 2 blocks`,draft:{name:`Guard destructive Bash`,event:`PreToolUse`,matcher:`Bash`,type:`command`,command:`jq -r .tool_input.command | grep -Eq "rm -rf|git push --force" && exit 2 || exit 0`}},{id:`log`,label:`Log every prompt`,summary:`UserPromptSubmit, appends JSON`,draft:{name:`Log every prompt`,event:`UserPromptSubmit`,matcher:``,type:`command`,command:`cat >> ~/.claude/prompts.jsonl`}}]),Ee=Object.freeze({hooks:[],builtin:[],events:[]});function De(e){return!e||typeof e.error==`string`}function Oe(e){return!e||typeof e.error!=`string`?``:e.error}function S(e,t){let n=e?.[t];return Array.isArray(n)?n:Ee[t]}var C=e=>S(e,`hooks`),w=e=>S(e,`builtin`),T=e=>S(e,`events`);function E(e){let t=e?.limits?.maxTimeoutSec;return typeof t==`number`&&Number.isInteger(t)&&t>0?t:600}function ke(e){let t=C(e),n=t.filter(e=>e.enabled!==!1).length;return[{label:`yours`,value:String(t.length),tone:null},{label:`enabled`,value:String(n),tone:t.length>0&&n===0?`warn`:null},{label:`built in`,value:String(w(e).length),tone:null}]}function Ae(e,t){let n=new Map(t.map((e,t)=>[e.name,t])),r=e=>n.get(e.event)??t.length;return[...e].sort((e,t)=>{let n=r(e)-r(t);return n===0?String(e.name).localeCompare(String(t.name)):n})}function je(e,t){let n=String(t||``).trim().toLowerCase();return n?e.filter(e=>[e.name,e.event,e.matcher,e.command,e.url].some(e=>typeof e==`string`&&e.toLowerCase().includes(n))):e}function Me(e){return e.length>=me}function Ne(e){let t=[];for(let n of e){let e=t[t.length-1];e&&e.event===n.event?e.hooks.push(n):t.push({event:n.event,hooks:[n]})}return t}function Pe(e){let t=e.type===`http`?{type:`http`,url:e.url||``}:{type:`command`,command:e.command||``};Number.isInteger(e.timeout)&&Number(e.timeout)>0&&(t.timeout=e.timeout);let n=e.matcher?{matcher:e.matcher,hooks:[t]}:{hooks:[t]};return JSON.stringify({hooks:{[e.event]:[n]}},null,2)}function Fe(e){return`${e} copy`}function D(e,t){return e.find(e=>e.name===t)||null}function O(e,t){let n=D(e,t);return n?n.matcher?`Matches ${n.matcher}. Blank matches every ${n.name}.`:Se:``}function Ie(e){return e.type===`http`?e.url||``:e.command||``}function Le(e){let t=we.find(t=>t.value===e);return t?t.label:String(e||``)}function Re(e){return!Number.isInteger(e.timeout)||Number(e.timeout)<=0?``:`${e.timeout}s timeout`}function ze(e,t){let n=Array.isArray(e.projects)?e.projects:[];return n.length===0?x:n.map(e=>{let n=t.find(t=>t.id===e);return n?n.name:e}).join(`, `)}function Be(e){return e.matcher?`${e.event} / ${e.matcher}`:e.event}function Ve(e){return Be(e)}function He(e,t){let n=Array.isArray(e.projects)?e.projects:[],r=new Set(t.map(e=>e.id));return n.filter(e=>!r.has(e))}function k(e){let t=e[0];return{id:null,name:``,event:t?t.name:``,matcher:``,type:`command`,command:``,url:``,timeout:``,enabled:!0,projects:[]}}function A(e){return{id:e.id??null,name:e.name||``,event:e.event||``,matcher:e.matcher||``,type:e.type===`http`?`http`:`command`,command:e.command||``,url:e.url||``,timeout:Number.isInteger(e.timeout)?String(e.timeout):``,enabled:e.enabled!==!1,projects:Array.isArray(e.projects)?[...e.projects]:[]}}function Ue(e,t,n=600){if(!e.name.trim())return`Give the hook a name.`;let r=D(t,e.event);if(!r)return`Pick an event.`;if(e.matcher.trim()&&!r.matcher)return`${r.name} takes no matcher.`;if(e.type===`http`&&r.http===!1)return`${r.name} does not support HTTP hooks.`;if(e.type===`command`&&!e.command.trim())return`Enter the command to run.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter a URL starting with http:// or https://.`;if(e.timeout.trim()!==``){let t=Number(e.timeout);if(!Number.isInteger(t)||t<1||t>n)return`Timeout must be a whole number of seconds from 1 to ${n}.`}return null}function j(e){let t={name:e.name.trim(),event:e.event,type:e.type,enabled:e.enabled!==!1};return e.id&&(t.id=e.id),e.matcher.trim()&&(t.matcher=e.matcher.trim()),e.type===`command`&&(t.command=e.command.trim()),e.type===`http`&&(t.url=e.url.trim()),e.timeout.trim()!==``&&(t.timeout=Number(e.timeout)),e.projects.length>0&&(t.projects=[...e.projects]),t}function We(e,t){let n={...k(t),...e.draft};return D(t,n.event)||(n.event=k(t).event),n}function Ge(e,t){return JSON.stringify(j(e))!==JSON.stringify(t)}function Ke(e){return{...e,enabled:e.enabled===!1}}function qe(e){return`Delete the hook "${e.name}"? Sessions already running keep it until they restart.`}var M=b(),N=null,P=null,F=null,I=null,L=null,R=null,z=!1,B=``,V=new Set,H=new Set,U=new Map,W=!1,G=(e,t)=>l(`hooks`,e,t);function K(e,t,n){let r=u(`p`,e,t);return n&&(r.dataset.tone=n),r}function q(e,t,n,r){let i=u(`button`,e,t);return i.type=`button`,r&&i.setAttribute(`aria-label`,r),i.addEventListener(`click`,n),i}async function Je(e,t){try{let n=await m(e,t,{timeoutMs:_});if((n.type===`save-hook-result`||n.type===`delete-hook-result`)&&n.ok)return null;let r=e===`save-hook`?`Could not save the hook.`:`Could not delete the hook.`;return`error`in n&&typeof n.error==`string`&&n.error?n.error:r}catch(e){return g(e,_)}}async function Ye(e,t,n,r){H.add(e),U.set(e,{tone:`busy`,text:r}),$({force:!0});let i=await Je(t,n);H.delete(e),i&&U.set(e,{tone:`error`,text:i}),i||U.delete(e),$({force:!0}),y()}function J(e,t,n){let r=u(`label`,`hooks-field`);return r.append(u(`span`,`hooks-field-label`,e),t),n&&r.append(u(`span`,`hooks-field-hint`,n)),r}function Y(e,t,n){let r=u(`input`,`settings-view-input`);return r.type=`text`,r.value=e,r.autocomplete=`off`,r.spellcheck=!1,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value)),r}function Xe(e,t){let n=u(`textarea`,`settings-view-input hooks-command`);return n.rows=3,n.value=e,n.spellcheck=!1,n.addEventListener(`input`,()=>t(n.value)),n}function Ze(e,t,n){let r=u(`select`,`settings-view-input hooks-select`);for(let n of t){let t=u(`option`,null,n.name);t.value=n.name,t.title=n.description,n.name===e.event&&(t.selected=!0),r.append(t)}return r.addEventListener(`change`,()=>n(r.value)),r}function Qe(e,t){let n=u(`div`,`hooks-type-row`);n.setAttribute(`role`,`radiogroup`);for(let r of we){let i=u(`label`,`settings-view-toggle hooks-choice`),a=u(`input`,`settings-view-checkbox`);a.type=`radio`,a.name=`hooks-type`,a.value=r.value,a.checked=e.type===r.value,a.title=r.hint,a.addEventListener(`change`,()=>{a.checked&&t(r.value)}),i.append(a,u(`span`,null,r.label)),n.append(i)}return n}function $e(e,t){let n=u(`div`,`hooks-projects`);if(t.length===0)return n.append(u(`span`,`hooks-field-hint`,x)),n;let r=u(`label`,`settings-view-project-choice hooks-choice`),i=u(`input`,`settings-view-checkbox`);i.type=`checkbox`,i.checked=e.projects.length===0,r.append(i,u(`span`,null,x)),n.append(r);let a=[];for(let r of t){let t=u(`label`,`settings-view-project-choice hooks-choice`),o=u(`input`,`settings-view-checkbox`);o.type=`checkbox`,o.value=r.id,o.checked=e.projects.includes(r.id),o.addEventListener(`change`,()=>{e.projects=a.filter(e=>e.checked).map(e=>e.value),i.checked=e.projects.length===0}),a.push(o),t.append(o,u(`span`,null,r.name)),r.agent!==`claude-code`&&(t.append(u(`span`,`hooks-choice-note`,r.agent)),t.title=`Not a Claude Code project: this hook will not reach its sessions.`),n.append(t)}return i.addEventListener(`change`,()=>{if(!i.checked)i.checked=e.projects.length===0;else{for(let e of a)e.checked=!1;e.projects=[]}}),n}function et(e){let t=u(`div`,`hooks-templates`);t.append(u(`span`,`hooks-templates-label`,ae));for(let n of Te){let r=q(`hooks-chip`,n.label,()=>Z(null,We(n,e)));r.title=n.summary,t.append(r)}return t}function X(e){L&&(e?L.show(`error`,e):L.clear())}function tt(e){let t=T(M.report),n=d(M.report),r=G(e.id?be:ye,xe);r.classList.add(`hooks-editor`);let i=u(`form`,`hooks-form`);i.addEventListener(`submit`,e=>{e.preventDefault(),rt()}),i.addEventListener(`keydown`,e=>{e.key===`Escape`?(e.preventDefault(),nt()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),rt())}),e.id||i.append(et(t));let a=u(`span`,`hooks-field-hint`,O(t,e.event)),o=Y(e.matcher,``,t=>{e.matcher=t}),s=J(`Command`,Xe(e.command,t=>{e.command=t}),`Runs through the shell with the event JSON on stdin. Exit 2 blocks the action where the event allows it.`),c=J(`URL`,Y(e.url,`http://127.0.0.1:8080/hook`,t=>{e.url=t}),`Claude Code POSTs the event JSON to it.`),l=()=>{s.hidden=e.type!==`command`,c.hidden=e.type!==`http`};l();let f=J(`Matcher`,o,null);f.append(a);let p=()=>{let n=t.find(t=>t.name===e.event);a.textContent=O(t,e.event),o.disabled=!!n&&!n.matcher,o.disabled&&(o.value=``,e.matcher=``)};p();let m=u(`input`,`settings-view-input hooks-timeout`);m.type=`number`,m.inputMode=`numeric`,m.min=`1`,m.max=String(E(M.report)),m.value=e.timeout,m.addEventListener(`input`,()=>{e.timeout=m.value});let h=u(`label`,`settings-view-toggle hooks-choice`),g=u(`input`,`settings-view-checkbox`);g.type=`checkbox`,g.checked=e.enabled,g.addEventListener(`change`,()=>{e.enabled=g.checked}),h.append(g,u(`span`,null,`Enabled`)),i.append(J(`Name`,Y(e.name,`Lint after edits`,t=>{e.name=t}),null),J(`Event`,Ze(e,t,t=>{e.event=t,p()}),null),f,J(`Type`,Qe(e,t=>{e.type=t,l()}),null),s,c,J(`Timeout (seconds)`,m,Ce),J(`Projects`,$e(e,n),null),J(``,h,null)),L=ee(`hooks-editor-status`);let _=u(`div`,`hooks-editor-footer`),v=u(`span`,`hooks-editor-shortcut`,pe),y=q(`btn-dialog btn-dialog-cancel`,`Cancel`,nt),b=u(`button`,`btn-dialog btn-dialog-confirm`,e.id?`Save changes`:`Add hook`);return b.type=`submit`,R=b,_.append(L.element,v,y,b),i.append(_),r.append(i),r}function Z(e,t=null){P=t||(e?A(e):k(T(M.report))),F=j(e?A(e):k(T(M.report))),I=tt(P),$({force:!0}),I.scrollIntoView({block:`nearest`});let n=I.querySelector(`input[type=text]`);n instanceof HTMLInputElement&&n.focus()}function Q(){P=null,F=null,I=null,L=null,R=null,z=!1,W=!0,$({force:!0})}function nt(){!P||!F||!Ge(P,F)?Q():h({title:de,message:fe,confirmLabel:`Discard`,danger:!0,onConfirm:Q})}async function rt(){if(!P||z)return;let e=Ue(P,T(M.report),E(M.report));if(e){X(e);return}let t=L,n=R;z=!0,t?.show(`busy`,`Saving the hook.`),n&&(n.disabled=!0);let r=await Je(`save-hook`,{hook:j(P)});z=!1,n&&(n.disabled=!1),t===L&&(r?X(r):(Q(),y()))}function it(e){let t=u(`details`,`hooks-preview`);t.open=V.has(e.id),t.addEventListener(`toggle`,()=>{t.open?V.add(e.id):V.delete(e.id)});let n=u(`summary`,`hooks-preview-summary`,ce);n.title=le;let r=u(`pre`,`hooks-preview-code`,Pe(e));return t.append(n,r),t}function at(e,{grouped:t=!1}={}){let n=d(M.report),r=u(`article`,`hooks-row`);r.setAttribute(`aria-label`,e.name),e.enabled===!1&&(r.dataset.state=`off`);let i=u(`div`,`hooks-row-main`),a=u(`div`,`hooks-row-head`);a.append(u(`span`,`hooks-row-name`,e.name));let o=t?e.matcher||``:Be(e);o&&a.append(u(`span`,`hooks-row-event`,o));let s=u(`code`,`hooks-row-target`,Ie(e));s.title=Ie(e);let c=u(`p`,`hooks-row-meta`,[Le(e.type),Re(e),ze(e,n)].filter(Boolean).join(` / `));i.append(a,s,c);let l=He(e,n);l.length>0&&i.append(K(`hooks-row-meta`,`Scoped to a project no longer in config: ${l.join(`, `)}`,`warn`)),i.append(it(e));let f=U.get(e.id);if(f){let e=ee(`hooks-row-status`);e.show(f.tone,f.text),i.append(e.element)}let p=u(`div`,`hooks-row-actions`),m=u(`label`,`settings-view-toggle hooks-choice`),g=u(`input`,`settings-view-checkbox`);g.type=`checkbox`,g.checked=e.enabled!==!1,g.disabled=H.has(e.id),g.setAttribute(`aria-label`,`${e.name} enabled`),g.addEventListener(`change`,()=>{Ye(e.id,`save-hook`,{hook:Ke(e)},g.checked?`Turning the hook on.`:`Turning the hook off.`)}),m.append(g,u(`span`,null,`On`));let _=q(`hooks-btn`,`Edit`,()=>Z(e),`Edit ${e.name}`),v=q(`hooks-btn`,ue,()=>{let t=A({...e,name:Fe(e.name)});t.id=null,Z(null,t)},`Duplicate ${e.name}`),y=q(`hooks-btn hooks-btn-danger`,`Delete`,()=>{h({title:`Delete hook`,message:qe(e),confirmLabel:`Delete`,danger:!0,onConfirm:()=>{Ye(e.id,`delete-hook`,{id:e.id},`Deleting the hook.`)}})},`Delete ${e.name}`);return y.disabled=H.has(e.id),p.append(m,_,v,y),r.append(i,p),r}function ot(e){let t=u(`article`,`hooks-row hooks-row-builtin`),n=u(`div`,`hooks-row-main`);return n.append(u(`span`,`hooks-row-event`,Ve(e)),u(`p`,`hooks-row-meta`,e.purpose)),t.append(n),t}function st(){let e=G(`Hooks`,ne),t=u(`div`,`hooks-stats`);for(let e of ke(M.report))t.append(f(`hooks`,e.label,e.value,e.tone));return e.append(t,K(`hooks-meta`,he)),e}function ct(){let e=u(`input`,`settings-view-input hooks-filter`);return e.type=`search`,e.value=B,e.placeholder=oe,e.setAttribute(`aria-label`,oe),e.addEventListener(`input`,()=>{B=e.value;let t=N?.querySelector(`.hooks-list-yours`);t&&t.replaceWith(ut())}),e}function lt(){let e=u(`div`,`hooks-empty-state`);return e.append(K(`hooks-empty`,ie),et(T(M.report))),e}function ut(){let e=u(`div`,`hooks-list-yours`),t=C(M.report);if(t.length===0)return e.append(lt()),e;let n=je(Ae(t,T(M.report)),B);if(n.length===0)return e.append(K(`hooks-empty`,se)),e;for(let t of Ne(n)){let n=u(`div`,`hooks-group`);n.append(u(`h3`,`hooks-group-title`,t.event));let r=u(`div`,`hooks-list`);for(let e of t.hooks)r.append(at(e,{grouped:!0}));n.append(r),e.append(n)}return e}function dt(){let e=G(ve,null),t=q(`hooks-btn hooks-btn-add`,`+ New hook`,()=>Z(null));t.disabled=!!P;let n=e.querySelector(`.hooks-section-head`);return n&&n.append(t),Me(C(M.report))&&e.append(ct()),e.append(ut()),e}function ft(){let e=u(`details`,`hooks-builtin`),t=u(`summary`,`hooks-builtin-summary`);t.append(u(`span`,`hooks-section-title`,`${ge} (${w(M.report).length})`),u(`span`,`hooks-section-hint`,_e));let n=u(`div`,`hooks-list`);for(let e of w(M.report))n.append(ot(e));return e.append(t,n),e}function pt(){let e=u(`div`,`hooks-content`);return M.report?De(M.report)?(e.append(K(`hooks-warning`,Oe(M.report))),e):(e.append(st()),I&&e.append(I),e.append(dt(),ft()),e):(e.append(M.hasReportSendFailed?K(`hooks-warning`,c):K(`hooks-empty`,re)),e)}function $({force:e=!1}={}){if(!N||!e&&p(N)||(M=b(),N.replaceChildren(pt()),!W))return;W=!1;let t=N.querySelector(`.hooks-btn-add`);t instanceof HTMLButtonElement&&t.focus()}function mt(e){N||(N=u(`div`,`hooks-panel`),e.append(N),v(()=>$()),$({force:!0}))}function ht(e){e===`shown`&&$({force:!0}),y()}var gt={mount:mt,refresh:ht};export{gt as view};
1
+ import{a as e,h as t,l as n,n as r,p as i,r as a,u as o,v as s}from"./zod-PTDW0N7l.js";import{n as c}from"./updates-view-core-ChBcprFg.js";import{n as l,o as u,p as d,r as f,u as p}from"./dom-helpers-I_SDCPvs.js";import{d as m}from"./control-ws-DLYZcM_c.js";import{a as h}from"./modal-BRwbyxA2.js";import{i as ee,s as g,t as _}from"./action-status-kYtKMGjN.js";import{an as v,in as y,rn as b}from"./index-7X85zNIF.js";var te=i(t(),s());o({glimmervoidId:t().min(1),event:t().min(1),token:t().nullable().optional(),payload:te}),o({id:t().min(1),name:t().min(1),event:t().min(1),matcher:t().optional(),type:r([`command`,`http`]),command:t().optional(),url:t().optional(),timeout:n().int().positive().optional(),enabled:e(),projects:a(t()).optional()}).passthrough();var ne=`Claude Code hooks injected into every session Glimmervoid spawns.`,re=`Loading hooks`,ie=`No hooks yet. A hook runs a command, or calls a URL, when a Claude Code event fires in a Glimmervoid session. Start from one of these, or add your own.`,ae=`Start from`,oe=`Filter by name, event or command`,se=`Nothing matches that filter.`,ce=`Preview`,le=`The entry this becomes in the per-session settings file.`,ue=`Duplicate`,de=`Discard changes`,fe=`Close the editor and lose the unsaved changes?`,pe=`Esc cancels. Ctrl+Enter saves.`,me=4,he=`A change reaches a session at its next start or restart. Claude Code sessions only; Codex and Grok sessions do not read this file.`,ge=`Glimmervoid's own hooks`,_e=`Always present, read-only. Status detection depends on them.`,ve=`Your hooks`,ye=`New hook`,be=`Edit hook`,xe=`Saved to config.json.`,x=`All projects`,Se=`This event takes no matcher.`,Ce=`Blank uses Claude Code's default for the event.`,we=Object.freeze([{value:`command`,label:`Command`,hint:`Run a shell command. It receives the event JSON on stdin.`},{value:`http`,label:`HTTP`,hint:`POST the event JSON to a URL.`}]),Te=Object.freeze([{id:`lint`,label:`Lint after edits`,summary:`PostToolUse on Edit|Write`,draft:{name:`Lint after edits`,event:`PostToolUse`,matcher:`Edit|Write`,type:`command`,command:`npx biome check --write "$(jq -r .tool_input.file_path)"`}},{id:`notify`,label:`Notify on Stop`,summary:`Stop, command`,draft:{name:`Notify on Stop`,event:`Stop`,matcher:``,type:`command`,command:`command -v notify-send >/dev/null 2>&1 && notify-send "Claude finished a turn" || { command -v osascript >/dev/null 2>&1 && osascript -e 'display notification "Claude finished a turn" with title "Claude Code"'; }`}},{id:`guard`,label:`Guard destructive Bash`,summary:`PreToolUse on Bash, exit 2 blocks`,draft:{name:`Guard destructive Bash`,event:`PreToolUse`,matcher:`Bash`,type:`command`,command:`jq -r .tool_input.command | grep -Eq "rm -rf|git push --force" && exit 2 || exit 0`}},{id:`log`,label:`Log every prompt`,summary:`UserPromptSubmit, appends JSON`,draft:{name:`Log every prompt`,event:`UserPromptSubmit`,matcher:``,type:`command`,command:`cat >> ~/.claude/prompts.jsonl`}}]),Ee=Object.freeze({hooks:[],builtin:[],events:[]});function De(e){return!e||typeof e.error==`string`}function Oe(e){return!e||typeof e.error!=`string`?``:e.error}function S(e,t){let n=e?.[t];return Array.isArray(n)?n:Ee[t]}var C=e=>S(e,`hooks`),w=e=>S(e,`builtin`),T=e=>S(e,`events`);function E(e){let t=e?.limits?.maxTimeoutSec;return typeof t==`number`&&Number.isInteger(t)&&t>0?t:600}function ke(e){let t=C(e),n=t.filter(e=>e.enabled!==!1).length;return[{label:`yours`,value:String(t.length),tone:null},{label:`enabled`,value:String(n),tone:t.length>0&&n===0?`warn`:null},{label:`built in`,value:String(w(e).length),tone:null}]}function Ae(e,t){let n=new Map(t.map((e,t)=>[e.name,t])),r=e=>n.get(e.event)??t.length;return[...e].sort((e,t)=>{let n=r(e)-r(t);return n===0?String(e.name).localeCompare(String(t.name)):n})}function je(e,t){let n=String(t||``).trim().toLowerCase();return n?e.filter(e=>[e.name,e.event,e.matcher,e.command,e.url].some(e=>typeof e==`string`&&e.toLowerCase().includes(n))):e}function Me(e){return e.length>=me}function Ne(e){let t=[];for(let n of e){let e=t[t.length-1];e&&e.event===n.event?e.hooks.push(n):t.push({event:n.event,hooks:[n]})}return t}function Pe(e){let t=e.type===`http`?{type:`http`,url:e.url||``}:{type:`command`,command:e.command||``};Number.isInteger(e.timeout)&&Number(e.timeout)>0&&(t.timeout=e.timeout);let n=e.matcher?{matcher:e.matcher,hooks:[t]}:{hooks:[t]};return JSON.stringify({hooks:{[e.event]:[n]}},null,2)}function Fe(e){return`${e} copy`}function D(e,t){return e.find(e=>e.name===t)||null}function O(e,t){let n=D(e,t);return n?n.matcher?`Matches ${n.matcher}. Blank matches every ${n.name}.`:Se:``}function Ie(e){return e.type===`http`?e.url||``:e.command||``}function Le(e){let t=we.find(t=>t.value===e);return t?t.label:String(e||``)}function Re(e){return!Number.isInteger(e.timeout)||Number(e.timeout)<=0?``:`${e.timeout}s timeout`}function ze(e,t){let n=Array.isArray(e.projects)?e.projects:[];return n.length===0?x:n.map(e=>{let n=t.find(t=>t.id===e);return n?n.name:e}).join(`, `)}function Be(e){return e.matcher?`${e.event} / ${e.matcher}`:e.event}function Ve(e){return Be(e)}function He(e,t){let n=Array.isArray(e.projects)?e.projects:[],r=new Set(t.map(e=>e.id));return n.filter(e=>!r.has(e))}function k(e){let t=e[0];return{id:null,name:``,event:t?t.name:``,matcher:``,type:`command`,command:``,url:``,timeout:``,enabled:!0,projects:[]}}function A(e){return{id:e.id??null,name:e.name||``,event:e.event||``,matcher:e.matcher||``,type:e.type===`http`?`http`:`command`,command:e.command||``,url:e.url||``,timeout:Number.isInteger(e.timeout)?String(e.timeout):``,enabled:e.enabled!==!1,projects:Array.isArray(e.projects)?[...e.projects]:[]}}function Ue(e,t,n=600){if(!e.name.trim())return`Give the hook a name.`;let r=D(t,e.event);if(!r)return`Pick an event.`;if(e.matcher.trim()&&!r.matcher)return`${r.name} takes no matcher.`;if(e.type===`http`&&r.http===!1)return`${r.name} does not support HTTP hooks.`;if(e.type===`command`&&!e.command.trim())return`Enter the command to run.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter a URL starting with http:// or https://.`;if(e.timeout.trim()!==``){let t=Number(e.timeout);if(!Number.isInteger(t)||t<1||t>n)return`Timeout must be a whole number of seconds from 1 to ${n}.`}return null}function j(e){let t={name:e.name.trim(),event:e.event,type:e.type,enabled:e.enabled!==!1};return e.id&&(t.id=e.id),e.matcher.trim()&&(t.matcher=e.matcher.trim()),e.type===`command`&&(t.command=e.command.trim()),e.type===`http`&&(t.url=e.url.trim()),e.timeout.trim()!==``&&(t.timeout=Number(e.timeout)),e.projects.length>0&&(t.projects=[...e.projects]),t}function We(e,t){let n={...k(t),...e.draft};return D(t,n.event)||(n.event=k(t).event),n}function Ge(e,t){return JSON.stringify(j(e))!==JSON.stringify(t)}function Ke(e){return{...e,enabled:e.enabled===!1}}function qe(e){return`Delete the hook "${e.name}"? Sessions already running keep it until they restart.`}var M=b(),N=null,P=null,F=null,I=null,L=null,R=null,z=!1,B=``,V=new Set,H=new Set,U=new Map,W=!1,G=(e,t)=>l(`hooks`,e,t);function K(e,t,n){let r=u(`p`,e,t);return n&&(r.dataset.tone=n),r}function q(e,t,n,r){let i=u(`button`,e,t);return i.type=`button`,r&&i.setAttribute(`aria-label`,r),i.addEventListener(`click`,n),i}async function Je(e,t){try{let n=await m(e,t,{timeoutMs:_});if((n.type===`save-hook-result`||n.type===`delete-hook-result`)&&n.ok)return null;let r=e===`save-hook`?`Could not save the hook.`:`Could not delete the hook.`;return`error`in n&&typeof n.error==`string`&&n.error?n.error:r}catch(e){return g(e,_)}}async function Ye(e,t,n,r){H.add(e),U.set(e,{tone:`busy`,text:r}),$({force:!0});let i=await Je(t,n);H.delete(e),i&&U.set(e,{tone:`error`,text:i}),i||U.delete(e),$({force:!0}),y()}function J(e,t,n){let r=u(`label`,`hooks-field`);return r.append(u(`span`,`hooks-field-label`,e),t),n&&r.append(u(`span`,`hooks-field-hint`,n)),r}function Y(e,t,n){let r=u(`input`,`settings-view-input`);return r.type=`text`,r.value=e,r.autocomplete=`off`,r.spellcheck=!1,t&&(r.placeholder=t),r.addEventListener(`input`,()=>n(r.value)),r}function Xe(e,t){let n=u(`textarea`,`settings-view-input hooks-command`);return n.rows=3,n.value=e,n.spellcheck=!1,n.addEventListener(`input`,()=>t(n.value)),n}function Ze(e,t,n){let r=u(`select`,`settings-view-input hooks-select`);for(let n of t){let t=u(`option`,null,n.name);t.value=n.name,t.title=n.description,n.name===e.event&&(t.selected=!0),r.append(t)}return r.addEventListener(`change`,()=>n(r.value)),r}function Qe(e,t){let n=u(`div`,`hooks-type-row`);n.setAttribute(`role`,`radiogroup`);for(let r of we){let i=u(`label`,`settings-view-toggle hooks-choice`),a=u(`input`,`settings-view-checkbox`);a.type=`radio`,a.name=`hooks-type`,a.value=r.value,a.checked=e.type===r.value,a.title=r.hint,a.addEventListener(`change`,()=>{a.checked&&t(r.value)}),i.append(a,u(`span`,null,r.label)),n.append(i)}return n}function $e(e,t){let n=u(`div`,`hooks-projects`);if(t.length===0)return n.append(u(`span`,`hooks-field-hint`,x)),n;let r=u(`label`,`settings-view-project-choice hooks-choice`),i=u(`input`,`settings-view-checkbox`);i.type=`checkbox`,i.checked=e.projects.length===0,r.append(i,u(`span`,null,x)),n.append(r);let a=[];for(let r of t){let t=u(`label`,`settings-view-project-choice hooks-choice`),o=u(`input`,`settings-view-checkbox`);o.type=`checkbox`,o.value=r.id,o.checked=e.projects.includes(r.id),o.addEventListener(`change`,()=>{e.projects=a.filter(e=>e.checked).map(e=>e.value),i.checked=e.projects.length===0}),a.push(o),t.append(o,u(`span`,null,r.name)),r.agent!==`claude-code`&&(t.append(u(`span`,`hooks-choice-note`,r.agent)),t.title=`Not a Claude Code project: this hook will not reach its sessions.`),n.append(t)}return i.addEventListener(`change`,()=>{if(!i.checked)i.checked=e.projects.length===0;else{for(let e of a)e.checked=!1;e.projects=[]}}),n}function et(e){let t=u(`div`,`hooks-templates`);t.append(u(`span`,`hooks-templates-label`,ae));for(let n of Te){let r=q(`hooks-chip`,n.label,()=>Z(null,We(n,e)));r.title=n.summary,t.append(r)}return t}function X(e){L&&(e?L.show(`error`,e):L.clear())}function tt(e){let t=T(M.report),n=d(M.report),r=G(e.id?be:ye,xe);r.classList.add(`hooks-editor`);let i=u(`form`,`hooks-form`);i.addEventListener(`submit`,e=>{e.preventDefault(),rt()}),i.addEventListener(`keydown`,e=>{e.key===`Escape`?(e.preventDefault(),nt()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),rt())}),e.id||i.append(et(t));let a=u(`span`,`hooks-field-hint`,O(t,e.event)),o=Y(e.matcher,``,t=>{e.matcher=t}),s=J(`Command`,Xe(e.command,t=>{e.command=t}),`Runs through the shell with the event JSON on stdin. Exit 2 blocks the action where the event allows it.`),c=J(`URL`,Y(e.url,`http://127.0.0.1:8080/hook`,t=>{e.url=t}),`Claude Code POSTs the event JSON to it.`),l=()=>{s.hidden=e.type!==`command`,c.hidden=e.type!==`http`};l();let f=J(`Matcher`,o,null);f.append(a);let p=()=>{let n=t.find(t=>t.name===e.event);a.textContent=O(t,e.event),o.disabled=!!n&&!n.matcher,o.disabled&&(o.value=``,e.matcher=``)};p();let m=u(`input`,`settings-view-input hooks-timeout`);m.type=`number`,m.inputMode=`numeric`,m.min=`1`,m.max=String(E(M.report)),m.value=e.timeout,m.addEventListener(`input`,()=>{e.timeout=m.value});let h=u(`label`,`settings-view-toggle hooks-choice`),g=u(`input`,`settings-view-checkbox`);g.type=`checkbox`,g.checked=e.enabled,g.addEventListener(`change`,()=>{e.enabled=g.checked}),h.append(g,u(`span`,null,`Enabled`)),i.append(J(`Name`,Y(e.name,`Lint after edits`,t=>{e.name=t}),null),J(`Event`,Ze(e,t,t=>{e.event=t,p()}),null),f,J(`Type`,Qe(e,t=>{e.type=t,l()}),null),s,c,J(`Timeout (seconds)`,m,Ce),J(`Projects`,$e(e,n),null),J(``,h,null)),L=ee(`hooks-editor-status`);let _=u(`div`,`hooks-editor-footer`),v=u(`span`,`hooks-editor-shortcut`,pe),y=q(`btn-dialog btn-dialog-cancel`,`Cancel`,nt),b=u(`button`,`btn-dialog btn-dialog-confirm`,e.id?`Save changes`:`Add hook`);return b.type=`submit`,R=b,_.append(L.element,v,y,b),i.append(_),r.append(i),r}function Z(e,t=null){P=t||(e?A(e):k(T(M.report))),F=j(e?A(e):k(T(M.report))),I=tt(P),$({force:!0}),I.scrollIntoView({block:`nearest`});let n=I.querySelector(`input[type=text]`);n instanceof HTMLInputElement&&n.focus()}function Q(){P=null,F=null,I=null,L=null,R=null,z=!1,W=!0,$({force:!0})}function nt(){!P||!F||!Ge(P,F)?Q():h({title:de,message:fe,confirmLabel:`Discard`,danger:!0,onConfirm:Q})}async function rt(){if(!P||z)return;let e=Ue(P,T(M.report),E(M.report));if(e){X(e);return}let t=L,n=R;z=!0,t?.show(`busy`,`Saving the hook.`),n&&(n.disabled=!0);let r=await Je(`save-hook`,{hook:j(P)});z=!1,n&&(n.disabled=!1),t===L&&(r?X(r):(Q(),y()))}function it(e){let t=u(`details`,`hooks-preview`);t.open=V.has(e.id),t.addEventListener(`toggle`,()=>{t.open?V.add(e.id):V.delete(e.id)});let n=u(`summary`,`hooks-preview-summary`,ce);n.title=le;let r=u(`pre`,`hooks-preview-code`,Pe(e));return t.append(n,r),t}function at(e,{grouped:t=!1}={}){let n=d(M.report),r=u(`article`,`hooks-row`);r.setAttribute(`aria-label`,e.name),e.enabled===!1&&(r.dataset.state=`off`);let i=u(`div`,`hooks-row-main`),a=u(`div`,`hooks-row-head`);a.append(u(`span`,`hooks-row-name`,e.name));let o=t?e.matcher||``:Be(e);o&&a.append(u(`span`,`hooks-row-event`,o));let s=u(`code`,`hooks-row-target`,Ie(e));s.title=Ie(e);let c=u(`p`,`hooks-row-meta`,[Le(e.type),Re(e),ze(e,n)].filter(Boolean).join(` / `));i.append(a,s,c);let l=He(e,n);l.length>0&&i.append(K(`hooks-row-meta`,`Scoped to a project no longer in config: ${l.join(`, `)}`,`warn`)),i.append(it(e));let f=U.get(e.id);if(f){let e=ee(`hooks-row-status`);e.show(f.tone,f.text),i.append(e.element)}let p=u(`div`,`hooks-row-actions`),m=u(`label`,`settings-view-toggle hooks-choice`),g=u(`input`,`settings-view-checkbox`);g.type=`checkbox`,g.checked=e.enabled!==!1,g.disabled=H.has(e.id),g.setAttribute(`aria-label`,`${e.name} enabled`),g.addEventListener(`change`,()=>{Ye(e.id,`save-hook`,{hook:Ke(e)},g.checked?`Turning the hook on.`:`Turning the hook off.`)}),m.append(g,u(`span`,null,`On`));let _=q(`hooks-btn`,`Edit`,()=>Z(e),`Edit ${e.name}`),v=q(`hooks-btn`,ue,()=>{let t=A({...e,name:Fe(e.name)});t.id=null,Z(null,t)},`Duplicate ${e.name}`),y=q(`hooks-btn hooks-btn-danger`,`Delete`,()=>{h({title:`Delete hook`,message:qe(e),confirmLabel:`Delete`,danger:!0,onConfirm:()=>{Ye(e.id,`delete-hook`,{id:e.id},`Deleting the hook.`)}})},`Delete ${e.name}`);return y.disabled=H.has(e.id),p.append(m,_,v,y),r.append(i,p),r}function ot(e){let t=u(`article`,`hooks-row hooks-row-builtin`),n=u(`div`,`hooks-row-main`);return n.append(u(`span`,`hooks-row-event`,Ve(e)),u(`p`,`hooks-row-meta`,e.purpose)),t.append(n),t}function st(){let e=G(`Hooks`,ne),t=u(`div`,`hooks-stats`);for(let e of ke(M.report))t.append(f(`hooks`,e.label,e.value,e.tone));return e.append(t,K(`hooks-meta`,he)),e}function ct(){let e=u(`input`,`settings-view-input hooks-filter`);return e.type=`search`,e.value=B,e.placeholder=oe,e.setAttribute(`aria-label`,oe),e.addEventListener(`input`,()=>{B=e.value;let t=N?.querySelector(`.hooks-list-yours`);t&&t.replaceWith(ut())}),e}function lt(){let e=u(`div`,`hooks-empty-state`);return e.append(K(`hooks-empty`,ie),et(T(M.report))),e}function ut(){let e=u(`div`,`hooks-list-yours`),t=C(M.report);if(t.length===0)return e.append(lt()),e;let n=je(Ae(t,T(M.report)),B);if(n.length===0)return e.append(K(`hooks-empty`,se)),e;for(let t of Ne(n)){let n=u(`div`,`hooks-group`);n.append(u(`h3`,`hooks-group-title`,t.event));let r=u(`div`,`hooks-list`);for(let e of t.hooks)r.append(at(e,{grouped:!0}));n.append(r),e.append(n)}return e}function dt(){let e=G(ve,null),t=q(`hooks-btn hooks-btn-add`,`+ New hook`,()=>Z(null));t.disabled=!!P;let n=e.querySelector(`.hooks-section-head`);return n&&n.append(t),Me(C(M.report))&&e.append(ct()),e.append(ut()),e}function ft(){let e=u(`details`,`hooks-builtin`),t=u(`summary`,`hooks-builtin-summary`);t.append(u(`span`,`hooks-section-title`,`${ge} (${w(M.report).length})`),u(`span`,`hooks-section-hint`,_e));let n=u(`div`,`hooks-list`);for(let e of w(M.report))n.append(ot(e));return e.append(t,n),e}function pt(){let e=u(`div`,`hooks-content`);return M.report?De(M.report)?(e.append(K(`hooks-warning`,Oe(M.report))),e):(e.append(st()),I&&e.append(I),e.append(dt(),ft()),e):(e.append(M.hasReportSendFailed?K(`hooks-warning`,c):K(`hooks-empty`,re)),e)}function $({force:e=!1}={}){if(!N||!e&&p(N)||(M=b(),N.replaceChildren(pt()),!W))return;W=!1;let t=N.querySelector(`.hooks-btn-add`);t instanceof HTMLButtonElement&&t.focus()}function mt(e){N||(N=u(`div`,`hooks-panel`),e.append(N),v(()=>$()),$({force:!0}))}function ht(e){e===`shown`&&$({force:!0}),y()}var gt={mount:mt,refresh:ht};export{gt as view};