glimmervoid 0.46.2-next.171 → 0.46.2-next.172

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 (74) hide show
  1. package/dist/chunks/{main-C7gMpA96.js → main-Be-bJ9I6.js} +365 -81
  2. package/dist/client/assets/{alert-sound-Dq-enfpR.js → alert-sound-BgYd0ypF.js} +1 -1
  3. package/dist/client/assets/alert-sound-BgYd0ypF.js.br +0 -0
  4. package/dist/client/assets/{benchmark-panel-BikB-_FY.js → benchmark-panel-CK-gegL7.js} +1 -1
  5. package/dist/client/assets/benchmark-panel-CK-gegL7.js.br +0 -0
  6. package/dist/client/assets/{celebration-player-DvSoIWeX.js → celebration-player-Dq-R2Wcv.js} +1 -1
  7. package/dist/client/assets/celebration-player-Dq-R2Wcv.js.br +0 -0
  8. package/dist/client/assets/{dialogs-6ciKmSiB.js → dialogs-C4urfCX5.js} +1 -1
  9. package/dist/client/assets/dialogs-C4urfCX5.js.br +0 -0
  10. package/dist/client/assets/{doc-editor-ui-C2zcKusU.js → doc-editor-ui-BWALmn1j.js} +1 -1
  11. package/dist/client/assets/doc-editor-ui-BWALmn1j.js.br +0 -0
  12. package/dist/client/assets/{feature-hint-kHMR3HMg.js → feature-hint-7DZVKLnC.js} +1 -1
  13. package/dist/client/assets/feature-hint-7DZVKLnC.js.br +0 -0
  14. package/dist/client/assets/{first-run-checklist--8uSEF3q.js → first-run-checklist-BaLByGQ_.js} +1 -1
  15. package/dist/client/assets/first-run-checklist-BaLByGQ_.js.br +0 -0
  16. package/dist/client/assets/{hooks-panel-BNTBcSbC.js → hooks-panel-Dl1VF0JJ.js} +1 -1
  17. package/dist/client/assets/hooks-panel-Dl1VF0JJ.js.br +0 -0
  18. package/dist/client/assets/{index-kz72TdpI.js → index-CqQFS_Q3.js} +5 -5
  19. package/dist/client/assets/index-CqQFS_Q3.js.br +0 -0
  20. package/dist/client/assets/{issues-panel-DBC8Vskj.js → issues-panel-D3htmAvu.js} +1 -1
  21. package/dist/client/assets/issues-panel-D3htmAvu.js.br +0 -0
  22. package/dist/client/assets/{nyan-cat-BwFt-tby.js → nyan-cat-ZjB6TUA5.js} +1 -1
  23. package/dist/client/assets/nyan-cat-ZjB6TUA5.js.br +0 -0
  24. package/dist/client/assets/{phone-shell-OOBCrgwW.js → phone-shell-C8OI4l_f.js} +1 -1
  25. package/dist/client/assets/phone-shell-C8OI4l_f.js.br +0 -0
  26. package/dist/client/assets/{plan-face-BSuNTzAk.js → plan-face-3AAdtxb-.js} +1 -1
  27. package/dist/client/assets/plan-face-3AAdtxb-.js.br +0 -0
  28. package/dist/client/assets/{plan-render-VtKpijKn.js → plan-render-Cuafb6dS.js} +1 -1
  29. package/dist/client/assets/plan-render-Cuafb6dS.js.br +0 -0
  30. package/dist/client/assets/{pr-scope-tabs-CF_yd5tk.js → pr-scope-tabs-CZ49XA5T.js} +1 -1
  31. package/dist/client/assets/pr-scope-tabs-CZ49XA5T.js.br +0 -0
  32. package/dist/client/assets/{radar-panel-CaFgQmHA.js → radar-panel-BujAUNbW.js} +1 -1
  33. package/dist/client/assets/radar-panel-BujAUNbW.js.br +0 -0
  34. package/dist/client/assets/{resume-dialog-C8rDuOMu.js → resume-dialog-CQzhWvvS.js} +1 -1
  35. package/dist/client/assets/resume-dialog-CQzhWvvS.js.br +0 -0
  36. package/dist/client/assets/{review-queue-panel-Cvwz_EgS.js → review-queue-panel-DoFR1Vot.js} +1 -1
  37. package/dist/client/assets/review-queue-panel-DoFR1Vot.js.br +0 -0
  38. package/dist/client/assets/{settings-panel-rezdCJ7R.js → settings-panel-DlfybW7k.js} +2 -2
  39. package/dist/client/assets/settings-panel-DlfybW7k.js.br +0 -0
  40. package/dist/client/assets/{shown-lightbox-dkDHFWD-.js → shown-lightbox-DefsDlvD.js} +1 -1
  41. package/dist/client/assets/shown-lightbox-DefsDlvD.js.br +0 -0
  42. package/dist/client/assets/{trace-panel-BVTtXItR.js → trace-panel-ufbRf4Mu.js} +1 -1
  43. package/dist/client/assets/trace-panel-ufbRf4Mu.js.br +0 -0
  44. package/dist/client/assets/{usage-panel-C_xWpRSQ.js → usage-panel-B8d4L8l5.js} +1 -1
  45. package/dist/client/assets/usage-panel-B8d4L8l5.js.br +0 -0
  46. package/dist/client/assets/{visions-panel-8a_9hSv4.js → visions-panel-CK6VjHue.js} +1 -1
  47. package/dist/client/assets/visions-panel-CK6VjHue.js.br +0 -0
  48. package/dist/client/index.html +1 -1
  49. package/dist/client/index.html.br +0 -0
  50. package/dist/server/index.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/client/assets/alert-sound-Dq-enfpR.js.br +0 -0
  53. package/dist/client/assets/benchmark-panel-BikB-_FY.js.br +0 -0
  54. package/dist/client/assets/celebration-player-DvSoIWeX.js.br +0 -0
  55. package/dist/client/assets/dialogs-6ciKmSiB.js.br +0 -0
  56. package/dist/client/assets/doc-editor-ui-C2zcKusU.js.br +0 -0
  57. package/dist/client/assets/feature-hint-kHMR3HMg.js.br +0 -0
  58. package/dist/client/assets/first-run-checklist--8uSEF3q.js.br +0 -0
  59. package/dist/client/assets/hooks-panel-BNTBcSbC.js.br +0 -0
  60. package/dist/client/assets/index-kz72TdpI.js.br +0 -0
  61. package/dist/client/assets/issues-panel-DBC8Vskj.js.br +0 -0
  62. package/dist/client/assets/nyan-cat-BwFt-tby.js.br +0 -0
  63. package/dist/client/assets/phone-shell-OOBCrgwW.js.br +0 -0
  64. package/dist/client/assets/plan-face-BSuNTzAk.js.br +0 -0
  65. package/dist/client/assets/plan-render-VtKpijKn.js.br +0 -0
  66. package/dist/client/assets/pr-scope-tabs-CF_yd5tk.js.br +0 -0
  67. package/dist/client/assets/radar-panel-CaFgQmHA.js.br +0 -0
  68. package/dist/client/assets/resume-dialog-C8rDuOMu.js.br +0 -0
  69. package/dist/client/assets/review-queue-panel-Cvwz_EgS.js.br +0 -0
  70. package/dist/client/assets/settings-panel-rezdCJ7R.js.br +0 -0
  71. package/dist/client/assets/shown-lightbox-dkDHFWD-.js.br +0 -0
  72. package/dist/client/assets/trace-panel-BVTtXItR.js.br +0 -0
  73. package/dist/client/assets/usage-panel-C_xWpRSQ.js.br +0 -0
  74. package/dist/client/assets/visions-panel-8a_9hSv4.js.br +0 -0
@@ -26,7 +26,7 @@ import { $ as resolveProjectToken, B as buildAiGenerationEvents, G as claudeAcco
26
26
  import { _ as TelemetryState, a as DEEP_HISTORY_SCROLLBACK_LINES, c as describeDataAttach, d as DashboardTelemetryReport, h as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, l as parseDataAttach, m as PendingCrashReport, r as HTTP_URL_RE, s as LOGGED_FAST_CLOSE_COUNTS, u as parseDataClientMessage } from "./build-channel-DpjXts1H.js";
27
27
  import { $ as identityFromRelPath, A as decideFileRead, B as sessionsRootCandidates, C as pickNewestPublished, D as codexRootCandidates, E as codexHomes, F as kimiHomes, G as kimiSessionIdFromPath, H as shouldPersistWarehouse, I as passOutcome, J as dedupKeys, K as parseKimiUsageLine, L as projectDirCandidates, M as expandTilde, N as grokHomes, O as codexSessionIdFromPath, P as isUsageFile, Q as foldReplacementIntoGenerationRollup, R as resolveProjectsDirs, S as parseResolvedSha, T as codexFallbackRoots, U as splitLines$1, V as shouldEvaluateDespiteIoFailures, W as kimiDedupIdentity, X as expandAdvisorIterations, Y as emptyTotals, Z as foldEntryIntoGenerationRollup, _ as isCheckFresh, a as describeAgentResolvability, at as totalTokensOf$1, b as parseRegistryDeprecation, c as isKnownAgentId, d as resolveAdapter, et as isWithinGenerationRecencyWindow, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, it as shouldReplace, j as dedupeCodexFiles, k as continuationDelayMs, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, nt as parseJsonLine, o as getAdapter, ot as vendorUsageEntry, p as codex, q as addEntryToTotals, r as commandFor, rt as parseUsageLine, s as hookProfileOf, st as claudeCode, t as DEFAULT_AGENT_ID, tt as mergeGenerationRollups, u as resetCommandCache, v as normalizeSha, w as shortSha$1, x as parseRegistryLatest, y as normalizeUpdateChannel, z as scopedClaudeRoots } from "./adapters-DcwEFAL6.js";
28
28
  import { t as HOOK_TOOLS } from "./hook-tools-Cr97Vdap.js";
29
- import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldKimiHomeSecrets, n as generatedKimiHomePath, p as trashSessionTempFolderOnceUnheld, u as createHeldSessionTempFolder } from "./kimi-home-CYJpt82i.js";
29
+ import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldKimiHomeSecrets, n as generatedKimiHomePath, o as realKimiHome, p as trashSessionTempFolderOnceUnheld, u as createHeldSessionTempFolder } from "./kimi-home-CYJpt82i.js";
30
30
  import { t as kimi } from "./kimi-BiLAVDKd.js";
31
31
  import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
32
32
  import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-iLIA4R6l.js";
@@ -3371,6 +3371,12 @@ function blockedCredentialHomeEntries(role) {
3371
3371
  if (!isStandardLevel(role)) return credentialHomeEntries;
3372
3372
  return credentialHomeEntries.filter((entry) => !STANDARD_LEVEL_USABLE_CREDENTIAL_ENTRIES.includes(entry));
3373
3373
  }
3374
+ function describeRoleSandbox(role) {
3375
+ return {
3376
+ agentApiDomains: unique(role.vendors.flatMap((vendor) => VENDOR_PROFILES[vendor].apiDomains)),
3377
+ unreadableHomeEntries: blockedCredentialHomeEntries(role)
3378
+ };
3379
+ }
3374
3380
  function credentialWriteBlocks(role, host) {
3375
3381
  const credentialHomeEntries = blockedCredentialHomeEntries(role);
3376
3382
  return [...homePaths(host, credentialHomeEntries), ...relocatedXdgConfigPaths(host, credentialHomeEntries)];
@@ -28007,6 +28013,11 @@ var TEAM_REVIEW_EXTRA_DOMAINS = Object.freeze(["api.github.com"]);
28007
28013
  var TEAM_REVIEW_SHELL_ALLOW_RULE = "Bash";
28008
28014
  var SANDBOX_RUNTIME_UNSUPPORTED_PLATFORM = "win32";
28009
28015
  var LINKED_CHECKOUT_UNREADABLE_ENTRY = /^(?:\.env(?:\..*)?|\.claude)$/;
28016
+ var LINKED_CHECKOUT_UNREADABLE_NAMES = Object.freeze([
28017
+ ".env",
28018
+ ".env.*",
28019
+ ".claude"
28020
+ ]);
28010
28021
  var RESULT_MAX_BYTES$1 = 1048576;
28011
28022
  var EMPTY_GH_CONFIG_DIRNAME = "gh-config";
28012
28023
  var PUSH_DISABLED_URL = "https://push-disabled.invalid/";
@@ -28079,6 +28090,32 @@ function teamReviewRole(facts, { checkoutPath, cachedClone, unreadablePaths, san
28079
28090
  readDenied: [...unreadablePaths]
28080
28091
  };
28081
28092
  }
28093
+ function describeTeamReviewSandbox(sandbox) {
28094
+ const role = teamReviewRole({
28095
+ launchId: "",
28096
+ cwd: "",
28097
+ hookPort: null,
28098
+ readablePaths: [],
28099
+ writablePaths: [],
28100
+ agentSessionId: null
28101
+ }, {
28102
+ checkoutPath: "",
28103
+ cachedClone: "",
28104
+ unreadablePaths: [],
28105
+ sandbox
28106
+ });
28107
+ return {
28108
+ networkOpen: role.network.access === "open",
28109
+ networkDomains: role.network.access === "allowlist" ? [...role.network.domains] : [],
28110
+ ...describeRoleSandbox(role),
28111
+ mcpLoaded: sandbox.loadMcpServers,
28112
+ unreadableCheckoutEntries: [...LINKED_CHECKOUT_UNREADABLE_NAMES],
28113
+ githubTokenStripped: true,
28114
+ allowedTools: [TEAM_REVIEW_SHELL_ALLOW_RULE, "Read"],
28115
+ deniedTools: [...TEAM_REVIEW_SESSION_DENY_RULES],
28116
+ threadJudgeTools: [...THREAD_JUDGE_TOOLS]
28117
+ };
28118
+ }
28082
28119
  async function describeTeamReviewRole({ checkoutPath, cachedClone, linkedCheckout, sandbox = DEFAULT_SANDBOX }) {
28083
28120
  const unreadablePaths = await linkedCheckoutUnreadablePaths(linkedCheckout);
28084
28121
  return (facts) => teamReviewRole(facts, {
@@ -39693,7 +39730,7 @@ async function readSigningKeySetting(setting, cwd) {
39693
39730
  const keyPath = path.resolve(cwd, setting.replace(/^~(?=\/|$)/, os.homedir()));
39694
39731
  return parseSshPublicKey(await fs$1.readFile(keyPath, "utf8").catch(() => ""));
39695
39732
  }
39696
- function readTextOrNull(filePath) {
39733
+ function readTextOrNull$1(filePath) {
39697
39734
  try {
39698
39735
  return readFileSync(filePath, "utf8");
39699
39736
  } catch {
@@ -39708,7 +39745,7 @@ function installCommitSigningShim({ binDir, nodePath, cliPath, platform = proces
39708
39745
  cliPath
39709
39746
  });
39710
39747
  try {
39711
- if (readTextOrNull(shimPath) !== shimText) writeTextAtomicSync(shimPath, shimText, {
39748
+ if (readTextOrNull$1(shimPath) !== shimText) writeTextAtomicSync(shimPath, shimText, {
39712
39749
  mode: 493,
39713
39750
  mkdir: true,
39714
39751
  enforceMode: true
@@ -49236,7 +49273,7 @@ var TERMINAL_KINDS = /* @__PURE__ */ new Set([
49236
49273
  "dismissal",
49237
49274
  "acknowledgement"
49238
49275
  ]);
49239
- function textField(record, field) {
49276
+ function textField$1(record, field) {
49240
49277
  const value = Reflect.get(record, field);
49241
49278
  if (typeof value !== "string") return null;
49242
49279
  return sanitizeOneLine(value, 280);
@@ -49247,10 +49284,10 @@ function journalEntries(output, sessionId) {
49247
49284
  return [{
49248
49285
  id: record.id,
49249
49286
  kind: record.kind,
49250
- at: textField(record, "at"),
49251
- text: textField(record, "chose") ?? textField(record, "observation") ?? textField(record, "what") ?? textField(record, "expectation") ?? textField(record, "practice") ?? textField(record, "of") ?? record.kind,
49252
- detail: textField(record, "because") ?? textField(record, "evidence") ?? textField(record, "discriminatedBy") ?? textField(record, "outcome"),
49253
- supersedes: textField(record, "of")
49287
+ at: textField$1(record, "at"),
49288
+ text: textField$1(record, "chose") ?? textField$1(record, "observation") ?? textField$1(record, "what") ?? textField$1(record, "expectation") ?? textField$1(record, "practice") ?? textField$1(record, "of") ?? record.kind,
49289
+ detail: textField$1(record, "because") ?? textField$1(record, "evidence") ?? textField$1(record, "discriminatedBy") ?? textField$1(record, "outcome"),
49290
+ supersedes: textField$1(record, "of")
49254
49291
  }];
49255
49292
  });
49256
49293
  }
@@ -50253,6 +50290,323 @@ function planQuickSession({ live, project, sessionNames }) {
50253
50290
  };
50254
50291
  }
50255
50292
  //#endregion
50293
+ //#region server/core/codex-credentials-core.ts
50294
+ var CODEX_LOGIN_REFRESH_MARGIN_MS = 3e5;
50295
+ var StoredCodexAuth = z.object({ tokens: z.object({
50296
+ access_token: z.string().min(1),
50297
+ account_id: z.string().min(1)
50298
+ }) });
50299
+ var AccessTokenClaims = z.object({ exp: z.number().positive() });
50300
+ function accessTokenExpiryMs(accessToken) {
50301
+ const encodedClaims = accessToken.split(".")[1];
50302
+ if (!encodedClaims) return null;
50303
+ try {
50304
+ const claims = AccessTokenClaims.safeParse(JSON.parse(Buffer.from(encodedClaims, "base64url").toString("utf8")));
50305
+ return claims.success ? claims.data.exp * 1e3 : null;
50306
+ } catch {
50307
+ return null;
50308
+ }
50309
+ }
50310
+ function parseCodexAuth(text) {
50311
+ let decoded;
50312
+ try {
50313
+ decoded = JSON.parse(text);
50314
+ } catch {
50315
+ return null;
50316
+ }
50317
+ const parsed = StoredCodexAuth.safeParse(decoded);
50318
+ if (!parsed.success) return null;
50319
+ const { access_token: accessToken, account_id: accountId } = parsed.data.tokens;
50320
+ return {
50321
+ accessToken,
50322
+ accountId,
50323
+ expiresAtMs: accessTokenExpiryMs(accessToken)
50324
+ };
50325
+ }
50326
+ function codexHomeDir(env, homeDir) {
50327
+ const override = env.CODEX_HOME?.trim();
50328
+ return override ? path.resolve(override) : path.join(homeDir, ".codex");
50329
+ }
50330
+ function decideCodexLogin({ login, nowMs, hasRefreshed }) {
50331
+ if (!login) return {
50332
+ kind: "unavailable",
50333
+ reason: "no Codex login was found on this host; run codex login, or connect Codex from Glimmervoid"
50334
+ };
50335
+ if (login.expiresAtMs === null || login.expiresAtMs - nowMs >= CODEX_LOGIN_REFRESH_MARGIN_MS) return {
50336
+ kind: "use",
50337
+ login
50338
+ };
50339
+ if (!hasRefreshed) return { kind: "refresh" };
50340
+ if (login.expiresAtMs > nowMs) return {
50341
+ kind: "use",
50342
+ login
50343
+ };
50344
+ return {
50345
+ kind: "unavailable",
50346
+ reason: "the host Codex login has expired and a host refresh did not renew it; run codex login"
50347
+ };
50348
+ }
50349
+ function chatgptAuthTokensLogin(login) {
50350
+ return {
50351
+ type: "chatgptAuthTokens",
50352
+ accessToken: login.accessToken,
50353
+ chatgptAccountId: login.accountId
50354
+ };
50355
+ }
50356
+ function chatgptAuthTokensRefreshResult(login) {
50357
+ return {
50358
+ accessToken: login.accessToken,
50359
+ chatgptAccountId: login.accountId,
50360
+ chatgptPlanType: null
50361
+ };
50362
+ }
50363
+ //#endregion
50364
+ //#region server/github/core/team-review-environment-core.ts
50365
+ var CLAUDE_EFFORTS = Object.freeze([
50366
+ "low",
50367
+ "medium",
50368
+ "high",
50369
+ "xhigh",
50370
+ "max"
50371
+ ]);
50372
+ var CLAUDE_MODELS = Object.freeze([
50373
+ "opus",
50374
+ "sonnet",
50375
+ "haiku"
50376
+ ].map((alias) => ({
50377
+ id: alias,
50378
+ label: alias[0].toUpperCase() + alias.slice(1),
50379
+ efforts: null,
50380
+ defaultEffort: null
50381
+ })));
50382
+ var FRONTMATTER_FENCE = "---";
50383
+ var FOLDED_SCALAR = /^[>|][+-]?$/;
50384
+ var KIMI_MODEL_SECTION = /^\[models\."([^"]+)"\]\s*$/;
50385
+ var TOML_TABLE_HEADER = /^\[/;
50386
+ var TOML_KEY_VALUE = /^([A-Za-z0-9_]+)\s*=\s*(.+)$/;
50387
+ var TOML_STRING = /^"((?:[^"\\]|\\.)*)"/;
50388
+ var TOML_STRING_ITEM = /"((?:[^"\\]|\\.)*)"/g;
50389
+ function unquoteYamlScalar(raw) {
50390
+ const trimmed = raw.trim();
50391
+ return trimmed.length >= 2 && (trimmed[0] === "\"" || trimmed[0] === "'") && trimmed.at(-1) === trimmed[0] ? trimmed.slice(1, -1) : trimmed;
50392
+ }
50393
+ function frontmatterLines(markdown) {
50394
+ const lines = markdown.replace(/^/, "").split(/\r?\n/);
50395
+ if (lines[0]?.trim() !== FRONTMATTER_FENCE) return null;
50396
+ const closingIndex = lines.indexOf(FRONTMATTER_FENCE, 1);
50397
+ if (closingIndex === -1) return null;
50398
+ return lines.slice(1, closingIndex);
50399
+ }
50400
+ function readFrontmatterValue(lines, key) {
50401
+ const keyIndex = lines.findIndex((line) => line.startsWith(`${key}:`));
50402
+ if (keyIndex === -1) return null;
50403
+ const inlineValue = lines[keyIndex].slice(key.length + 1).trim();
50404
+ if (!FOLDED_SCALAR.test(inlineValue)) return unquoteYamlScalar(inlineValue);
50405
+ const continuation = [];
50406
+ for (const line of lines.slice(keyIndex + 1)) {
50407
+ if (!/^\s/.test(line) && line.trim() !== "") break;
50408
+ continuation.push(line.trim());
50409
+ }
50410
+ return continuation.join(" ").trim();
50411
+ }
50412
+ function parseSkillFrontmatter(markdown) {
50413
+ const lines = frontmatterLines(markdown);
50414
+ if (!lines) return null;
50415
+ const name = readFrontmatterValue(lines, "name");
50416
+ if (!name) return null;
50417
+ return {
50418
+ name,
50419
+ description: readFrontmatterValue(lines, "description") ?? ""
50420
+ };
50421
+ }
50422
+ function readTomlString(rawValue) {
50423
+ return TOML_STRING.exec(rawValue.trim())?.[1] ?? null;
50424
+ }
50425
+ function readTomlStringArray(rawValue) {
50426
+ if (!rawValue.trim().startsWith("[")) return null;
50427
+ return [...rawValue.matchAll(TOML_STRING_ITEM)].map((match) => match[1]);
50428
+ }
50429
+ function parseKimiModels(configToml) {
50430
+ const models = [];
50431
+ let current = null;
50432
+ for (const line of configToml.split(/\r?\n/).map((rawLine) => rawLine.trim())) {
50433
+ const sectionMatch = KIMI_MODEL_SECTION.exec(line);
50434
+ if (sectionMatch) {
50435
+ current = {
50436
+ id: sectionMatch[1],
50437
+ label: sectionMatch[1],
50438
+ efforts: null,
50439
+ defaultEffort: null
50440
+ };
50441
+ models.push(current);
50442
+ continue;
50443
+ }
50444
+ if (TOML_TABLE_HEADER.test(line)) {
50445
+ current = null;
50446
+ continue;
50447
+ }
50448
+ const keyValue = TOML_KEY_VALUE.exec(line);
50449
+ if (!current || !keyValue) continue;
50450
+ const [, key, rawValue] = keyValue;
50451
+ if (key === "display_name") current.label = readTomlString(rawValue) ?? current.label;
50452
+ if (key === "support_efforts") current.efforts = readTomlStringArray(rawValue);
50453
+ if (key === "default_effort") current.defaultEffort = readTomlString(rawValue);
50454
+ }
50455
+ return models;
50456
+ }
50457
+ function textField(record, key) {
50458
+ const value = record[key];
50459
+ return typeof value === "string" && value.trim() !== "" ? value.trim() : null;
50460
+ }
50461
+ function codexModelOffer(entry) {
50462
+ if (!entry || typeof entry !== "object") return null;
50463
+ const model = entry;
50464
+ const slug = textField(model, "slug");
50465
+ if (!slug || model.visibility !== "list") return null;
50466
+ const efforts = (Array.isArray(model.supported_reasoning_levels) ? model.supported_reasoning_levels : []).map((level) => level && typeof level === "object" ? textField(level, "effort") : null).filter((effort) => effort !== null);
50467
+ return {
50468
+ id: slug,
50469
+ label: textField(model, "display_name") ?? slug,
50470
+ efforts: efforts.length > 0 ? efforts : null,
50471
+ defaultEffort: textField(model, "default_reasoning_level")
50472
+ };
50473
+ }
50474
+ function parseCodexModelCatalog(catalog) {
50475
+ if (!catalog || typeof catalog !== "object") return [];
50476
+ const models = catalog.models;
50477
+ if (!Array.isArray(models)) return [];
50478
+ return models.map(codexModelOffer).filter((offer) => offer !== null);
50479
+ }
50480
+ function uniqueEfforts(models) {
50481
+ return [...new Set(models.flatMap((model) => model.efforts ?? []))];
50482
+ }
50483
+ function enabledClaudePluginInstalls(installedPlugins, settings) {
50484
+ const pluginsByKey = installedPlugins && typeof installedPlugins === "object" ? installedPlugins.plugins : null;
50485
+ const enabledByKey = settings && typeof settings === "object" ? settings.enabledPlugins : null;
50486
+ if (!pluginsByKey || typeof pluginsByKey !== "object" || !enabledByKey || typeof enabledByKey !== "object") return [];
50487
+ return Object.entries(pluginsByKey).flatMap(([pluginKey, installs]) => {
50488
+ if (enabledByKey[pluginKey] !== true || !Array.isArray(installs)) return [];
50489
+ const installPath = installs.map((install) => install && typeof install === "object" ? textField(install, "installPath") : null).find((candidate) => candidate !== null);
50490
+ if (!installPath) return [];
50491
+ return [{
50492
+ pluginName: pluginKey.split("@")[0],
50493
+ installPath
50494
+ }];
50495
+ });
50496
+ }
50497
+ //#endregion
50498
+ //#region server/github/team-review-environment.ts
50499
+ var SCAN_FRESH_FOR_MS = 6e4;
50500
+ var SKILL_FILE_NAME = "SKILL.md";
50501
+ var lastScan = [];
50502
+ var lastScanStartedAtMs = Number.NEGATIVE_INFINITY;
50503
+ var scanInFlight = null;
50504
+ async function readTextOrNull(filePath) {
50505
+ try {
50506
+ return await fs$1.readFile(filePath, "utf8");
50507
+ } catch {
50508
+ return null;
50509
+ }
50510
+ }
50511
+ async function readJsonOrNull(filePath) {
50512
+ const text = await readTextOrNull(filePath);
50513
+ if (text === null) return null;
50514
+ try {
50515
+ return JSON.parse(text);
50516
+ } catch {
50517
+ return null;
50518
+ }
50519
+ }
50520
+ async function scanSkillFolder(skillsFolder, source, namePrefix = "") {
50521
+ const entryNames = await fs$1.readdir(skillsFolder).catch(() => []);
50522
+ const skills = [];
50523
+ for (const entryName of entryNames) {
50524
+ const markdown = await readTextOrNull(path.join(skillsFolder, entryName, SKILL_FILE_NAME));
50525
+ const frontmatter = markdown === null ? null : parseSkillFrontmatter(markdown);
50526
+ if (frontmatter) skills.push({
50527
+ name: `${namePrefix}${frontmatter.name}`,
50528
+ description: frontmatter.description,
50529
+ source
50530
+ });
50531
+ }
50532
+ return skills;
50533
+ }
50534
+ async function scanClaude(homeDir, env) {
50535
+ const claudeHome = env.CLAUDE_CONFIG_DIR?.trim() || path.join(homeDir, ".claude");
50536
+ const [userSkills, installedPlugins, settings] = await Promise.all([
50537
+ scanSkillFolder(path.join(claudeHome, "skills"), "user"),
50538
+ readJsonOrNull(path.join(claudeHome, "plugins", "installed_plugins.json")),
50539
+ readJsonOrNull(path.join(claudeHome, "settings.json"))
50540
+ ]);
50541
+ const pluginSkills = await Promise.all(enabledClaudePluginInstalls(installedPlugins, settings).map(({ pluginName, installPath }) => scanSkillFolder(path.join(installPath, "skills"), "plugin", `${pluginName}:`)));
50542
+ return {
50543
+ id: "claude",
50544
+ models: [...CLAUDE_MODELS],
50545
+ efforts: [...CLAUDE_EFFORTS],
50546
+ skills: [...userSkills, ...pluginSkills.flat()]
50547
+ };
50548
+ }
50549
+ async function scanCodex(homeDir, env) {
50550
+ const codexHome = codexHomeDir(env, homeDir);
50551
+ const [catalog, codexSkills, codexSystemSkills, sharedAgentSkills] = await Promise.all([
50552
+ readJsonOrNull(path.join(codexHome, "models_cache.json")),
50553
+ scanSkillFolder(path.join(codexHome, "skills"), "user"),
50554
+ scanSkillFolder(path.join(codexHome, "skills", ".system"), "user"),
50555
+ scanSkillFolder(path.join(homeDir, ".agents", "skills"), "user")
50556
+ ]);
50557
+ const models = parseCodexModelCatalog(catalog);
50558
+ return {
50559
+ id: "codex",
50560
+ models,
50561
+ efforts: uniqueEfforts(models),
50562
+ skills: [
50563
+ ...codexSkills,
50564
+ ...codexSystemSkills,
50565
+ ...sharedAgentSkills
50566
+ ]
50567
+ };
50568
+ }
50569
+ async function scanKimi(homeDir, env) {
50570
+ const kimiHome = realKimiHome(env, homeDir);
50571
+ const [configToml, skills] = await Promise.all([readTextOrNull(path.join(kimiHome, "config.toml")), scanSkillFolder(path.join(kimiHome, "skills"), "user")]);
50572
+ const models = configToml === null ? [] : parseKimiModels(configToml);
50573
+ return {
50574
+ id: "kimi",
50575
+ models,
50576
+ efforts: uniqueEfforts(models),
50577
+ skills
50578
+ };
50579
+ }
50580
+ async function scanReviewAgents(homeDir, env) {
50581
+ lastScan = await Promise.all([
50582
+ scanClaude(homeDir, env),
50583
+ scanCodex(homeDir, env),
50584
+ scanKimi(homeDir, env)
50585
+ ]);
50586
+ }
50587
+ function refreshWhenStale(nowMs, homeDir, env) {
50588
+ if (scanInFlight || nowMs - lastScanStartedAtMs < SCAN_FRESH_FOR_MS) return;
50589
+ lastScanStartedAtMs = nowMs;
50590
+ scanInFlight = scanReviewAgents(homeDir, env).finally(() => {
50591
+ scanInFlight = null;
50592
+ });
50593
+ }
50594
+ function agentOffer(scan) {
50595
+ const { label, resolvable } = cachedAgentResolvability(scan.id);
50596
+ return {
50597
+ ...scan,
50598
+ label,
50599
+ installed: resolvable
50600
+ };
50601
+ }
50602
+ function currentTeamReviewEnvironment(settingsSource, { nowMs = Date.now(), homeDir = os.homedir(), env = process.env } = {}) {
50603
+ refreshWhenStale(nowMs, homeDir, env);
50604
+ return {
50605
+ agents: lastScan.map(agentOffer),
50606
+ sandbox: describeTeamReviewSandbox(readTeamReviewSettings(settingsSource).sandbox)
50607
+ };
50608
+ }
50609
+ //#endregion
50256
50610
  //#region server/settings-payload.ts
50257
50611
  function summarizeCustomAgents(declarations) {
50258
50612
  return declarations.map((declaration) => ({
@@ -50263,7 +50617,7 @@ function summarizeCustomAgents(declarations) {
50263
50617
  resolvable: cachedAgentResolvability(declaration.id).resolvable
50264
50618
  }));
50265
50619
  }
50266
- function buildSettingsPayload({ configStore, rtkInstallStatus = null, telegramDelivery = null, coderEnvironments = null, agentLogins = null, resolveRtk = getRtkPath }) {
50620
+ function buildSettingsPayload({ configStore, rtkInstallStatus = null, telegramDelivery = null, coderEnvironments = null, agentLogins = null, resolveRtk = getRtkPath, readTeamReviewEnvironment = currentTeamReviewEnvironment }) {
50267
50621
  return {
50268
50622
  ...configStore.getSettings(),
50269
50623
  isExperimentalBuild: configStore.isExperimentalBuild === true,
@@ -50273,7 +50627,8 @@ function buildSettingsPayload({ configStore, rtkInstallStatus = null, telegramDe
50273
50627
  customAgents: summarizeCustomAgents(configStore.config.customAgents ?? []),
50274
50628
  telegramDelivery,
50275
50629
  coderEnvironments,
50276
- agentLogins
50630
+ agentLogins,
50631
+ teamReviewEnvironment: readTeamReviewEnvironment(configStore.config)
50277
50632
  };
50278
50633
  }
50279
50634
  //#endregion
@@ -55616,77 +55971,6 @@ function createAgentConnect({ loginsRoot, loginSource, launchFor, onChange, ptyS
55616
55971
  };
55617
55972
  }
55618
55973
  //#endregion
55619
- //#region server/core/codex-credentials-core.ts
55620
- var CODEX_LOGIN_REFRESH_MARGIN_MS = 3e5;
55621
- var StoredCodexAuth = z.object({ tokens: z.object({
55622
- access_token: z.string().min(1),
55623
- account_id: z.string().min(1)
55624
- }) });
55625
- var AccessTokenClaims = z.object({ exp: z.number().positive() });
55626
- function accessTokenExpiryMs(accessToken) {
55627
- const encodedClaims = accessToken.split(".")[1];
55628
- if (!encodedClaims) return null;
55629
- try {
55630
- const claims = AccessTokenClaims.safeParse(JSON.parse(Buffer.from(encodedClaims, "base64url").toString("utf8")));
55631
- return claims.success ? claims.data.exp * 1e3 : null;
55632
- } catch {
55633
- return null;
55634
- }
55635
- }
55636
- function parseCodexAuth(text) {
55637
- let decoded;
55638
- try {
55639
- decoded = JSON.parse(text);
55640
- } catch {
55641
- return null;
55642
- }
55643
- const parsed = StoredCodexAuth.safeParse(decoded);
55644
- if (!parsed.success) return null;
55645
- const { access_token: accessToken, account_id: accountId } = parsed.data.tokens;
55646
- return {
55647
- accessToken,
55648
- accountId,
55649
- expiresAtMs: accessTokenExpiryMs(accessToken)
55650
- };
55651
- }
55652
- function codexHomeDir(env, homeDir) {
55653
- const override = env.CODEX_HOME?.trim();
55654
- return override ? path.resolve(override) : path.join(homeDir, ".codex");
55655
- }
55656
- function decideCodexLogin({ login, nowMs, hasRefreshed }) {
55657
- if (!login) return {
55658
- kind: "unavailable",
55659
- reason: "no Codex login was found on this host; run codex login, or connect Codex from Glimmervoid"
55660
- };
55661
- if (login.expiresAtMs === null || login.expiresAtMs - nowMs >= CODEX_LOGIN_REFRESH_MARGIN_MS) return {
55662
- kind: "use",
55663
- login
55664
- };
55665
- if (!hasRefreshed) return { kind: "refresh" };
55666
- if (login.expiresAtMs > nowMs) return {
55667
- kind: "use",
55668
- login
55669
- };
55670
- return {
55671
- kind: "unavailable",
55672
- reason: "the host Codex login has expired and a host refresh did not renew it; run codex login"
55673
- };
55674
- }
55675
- function chatgptAuthTokensLogin(login) {
55676
- return {
55677
- type: "chatgptAuthTokens",
55678
- accessToken: login.accessToken,
55679
- chatgptAccountId: login.accountId
55680
- };
55681
- }
55682
- function chatgptAuthTokensRefreshResult(login) {
55683
- return {
55684
- accessToken: login.accessToken,
55685
- chatgptAccountId: login.accountId,
55686
- chatgptPlanType: null
55687
- };
55688
- }
55689
- //#endregion
55690
55974
  //#region server/codex-credentials.ts
55691
55975
  var HOST_REFRESH_TIMEOUT_MS = 6e4;
55692
55976
  async function readTextFileOrNull$1(filePath) {
@@ -1 +1 @@
1
- import{Gi as e,Hi as t,Ji as n,Ki as r,Ui as i,Wi as a,Yi as o,qi as s}from"./index-kz72TdpI.js";var c=.3,l=null;function u(){return o(l)}function d(e){return n(e,l)}async function f(){try{let e=await fetch(t,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(a[e]??a.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(r(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(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
1
+ import{Gi as e,Hi as t,Ji as n,Ki as r,Ui as i,Wi as a,Yi as o,qi as s}from"./index-CqQFS_Q3.js";var c=.3,l=null;function u(){return o(l)}function d(e){return n(e,l)}async function f(){try{let e=await fetch(t,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(a[e]??a.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(r(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(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
@@ -1 +1 @@
1
- import"./updates-view-core-D1HrhoS5.js";import{n as e,o as t,r as n}from"./dom-helpers-C7P3_59O.js";import{J as r,Y as i,q as a}from"./index-kz72TdpI.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-D1HrhoS5.js";import{n as e,o as t,r as n}from"./dom-helpers-C7P3_59O.js";import{J as r,Y as i,q as a}from"./index-CqQFS_Q3.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-C7P3_59O.js";import{ta as r,yi as i}from"./index-kz72TdpI.js";import{playToneSequence as a}from"./alert-sound-Dq-enfpR.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:r[Math.floor(e()*r.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(i())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-C7P3_59O.js";import{ta as r,yi as i}from"./index-CqQFS_Q3.js";import{playToneSequence as a}from"./alert-sound-BgYd0ypF.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:r[Math.floor(e()*r.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(i())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,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-D1HrhoS5.js";import{h as o,m as s,o as c}from"./dom-helpers-C7P3_59O.js";import{d as l}from"./control-ws-H2e01_5q.js";import{n as u,r as d,t as f}from"./modal-Bh-cVr-I.js";import{n as p}from"./session-tick-D3Nw7wV5.js";import{Br as m,Lr as h,Rr as g,Tn as _,ii as v,m as y,ni as b,ri as x,ur as S,vr as C,yr as w}from"./index-kz72TdpI.js";import{d as T,l as E,t as D,u as ee}from"./repo-roots-adder-Blxoifau.js";import{t as O}from"./sandboxed-frame-C5WnwN5w.js";var te=`<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-D1HrhoS5.js";import{h as o,m as s,o as c}from"./dom-helpers-C7P3_59O.js";import{d as l}from"./control-ws-H2e01_5q.js";import{n as u,r as d,t as f}from"./modal-Bh-cVr-I.js";import{n as p}from"./session-tick-D3Nw7wV5.js";import{Br as m,Lr as h,Rr as g,Tn as _,ii as v,m as y,ni as b,ri as x,ur as S,vr as C,yr as w}from"./index-CqQFS_Q3.js";import{d as T,l as E,t as D,u as ee}from"./repo-roots-adder-Blxoifau.js";import{t as O}from"./sandboxed-frame-C5WnwN5w.js";var te=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
2
2
  <fieldset class="dialog-mode-controls" 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>