glimmervoid 0.46.2-next.170 → 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.
- package/dist/chunks/{main-C9Ej-cPp.js → main-Be-bJ9I6.js} +371 -84
- package/dist/client/assets/{alert-sound-hKiyMz7q.js → alert-sound-BgYd0ypF.js} +1 -1
- package/dist/client/assets/alert-sound-BgYd0ypF.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-CD1a1_9I.js → benchmark-panel-CK-gegL7.js} +1 -1
- package/dist/client/assets/benchmark-panel-CK-gegL7.js.br +0 -0
- package/dist/client/assets/{celebration-player-VUim5k1-.js → celebration-player-Dq-R2Wcv.js} +1 -1
- package/dist/client/assets/celebration-player-Dq-R2Wcv.js.br +0 -0
- package/dist/client/assets/{dialogs-BVkb5CXY.js → dialogs-C4urfCX5.js} +1 -1
- package/dist/client/assets/dialogs-C4urfCX5.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-8o6V0GJ6.js → doc-editor-ui-BWALmn1j.js} +1 -1
- package/dist/client/assets/doc-editor-ui-BWALmn1j.js.br +0 -0
- package/dist/client/assets/{feature-hint-YoKuhOeg.js → feature-hint-7DZVKLnC.js} +1 -1
- package/dist/client/assets/feature-hint-7DZVKLnC.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-DKalFwBC.js → first-run-checklist-BaLByGQ_.js} +1 -1
- package/dist/client/assets/first-run-checklist-BaLByGQ_.js.br +0 -0
- package/dist/client/assets/{hooks-panel-DwcWi9fo.js → hooks-panel-Dl1VF0JJ.js} +1 -1
- package/dist/client/assets/hooks-panel-Dl1VF0JJ.js.br +0 -0
- package/dist/client/assets/{index-1p-_rN2a.js → index-CqQFS_Q3.js} +5 -5
- package/dist/client/assets/index-CqQFS_Q3.js.br +0 -0
- package/dist/client/assets/{issues-panel-4mPgvfNa.js → issues-panel-D3htmAvu.js} +1 -1
- package/dist/client/assets/issues-panel-D3htmAvu.js.br +0 -0
- package/dist/client/assets/{nyan-cat-C87v_sq2.js → nyan-cat-ZjB6TUA5.js} +1 -1
- package/dist/client/assets/nyan-cat-ZjB6TUA5.js.br +0 -0
- package/dist/client/assets/{phone-shell-cT95GI-7.js → phone-shell-C8OI4l_f.js} +1 -1
- package/dist/client/assets/phone-shell-C8OI4l_f.js.br +0 -0
- package/dist/client/assets/{plan-face-B-_3lCAP.js → plan-face-3AAdtxb-.js} +1 -1
- package/dist/client/assets/plan-face-3AAdtxb-.js.br +0 -0
- package/dist/client/assets/{plan-render-D-SGQmXs.js → plan-render-Cuafb6dS.js} +1 -1
- package/dist/client/assets/plan-render-Cuafb6dS.js.br +0 -0
- package/dist/client/assets/{pr-scope-tabs-kTTauSJm.js → pr-scope-tabs-CZ49XA5T.js} +1 -1
- package/dist/client/assets/pr-scope-tabs-CZ49XA5T.js.br +0 -0
- package/dist/client/assets/{radar-panel-BLJQ35z9.js → radar-panel-BujAUNbW.js} +1 -1
- package/dist/client/assets/radar-panel-BujAUNbW.js.br +0 -0
- package/dist/client/assets/{resume-dialog-C0vV-LpT.js → resume-dialog-CQzhWvvS.js} +1 -1
- package/dist/client/assets/resume-dialog-CQzhWvvS.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-BK8wbKUT.js → review-queue-panel-DoFR1Vot.js} +1 -1
- package/dist/client/assets/review-queue-panel-DoFR1Vot.js.br +0 -0
- package/dist/client/assets/{settings-panel-BImi9s8u.js → settings-panel-DlfybW7k.js} +2 -2
- package/dist/client/assets/settings-panel-DlfybW7k.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-oVrT3f9w.js → shown-lightbox-DefsDlvD.js} +1 -1
- package/dist/client/assets/shown-lightbox-DefsDlvD.js.br +0 -0
- package/dist/client/assets/{trace-panel-T2LGj5gj.js → trace-panel-ufbRf4Mu.js} +1 -1
- package/dist/client/assets/trace-panel-ufbRf4Mu.js.br +0 -0
- package/dist/client/assets/{usage-panel-D8E_1blN.js → usage-panel-B8d4L8l5.js} +1 -1
- package/dist/client/assets/usage-panel-B8d4L8l5.js.br +0 -0
- package/dist/client/assets/{visions-panel-C8FS82M4.js → visions-panel-CK6VjHue.js} +1 -1
- package/dist/client/assets/visions-panel-CK6VjHue.js.br +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/alert-sound-hKiyMz7q.js.br +0 -0
- package/dist/client/assets/benchmark-panel-CD1a1_9I.js.br +0 -0
- package/dist/client/assets/celebration-player-VUim5k1-.js.br +0 -0
- package/dist/client/assets/dialogs-BVkb5CXY.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-8o6V0GJ6.js.br +0 -0
- package/dist/client/assets/feature-hint-YoKuhOeg.js.br +0 -0
- package/dist/client/assets/first-run-checklist-DKalFwBC.js.br +0 -0
- package/dist/client/assets/hooks-panel-DwcWi9fo.js.br +0 -0
- package/dist/client/assets/index-1p-_rN2a.js.br +0 -0
- package/dist/client/assets/issues-panel-4mPgvfNa.js.br +0 -0
- package/dist/client/assets/nyan-cat-C87v_sq2.js.br +0 -0
- package/dist/client/assets/phone-shell-cT95GI-7.js.br +0 -0
- package/dist/client/assets/plan-face-B-_3lCAP.js.br +0 -0
- package/dist/client/assets/plan-render-D-SGQmXs.js.br +0 -0
- package/dist/client/assets/pr-scope-tabs-kTTauSJm.js.br +0 -0
- package/dist/client/assets/radar-panel-BLJQ35z9.js.br +0 -0
- package/dist/client/assets/resume-dialog-C0vV-LpT.js.br +0 -0
- package/dist/client/assets/review-queue-panel-BK8wbKUT.js.br +0 -0
- package/dist/client/assets/settings-panel-BImi9s8u.js.br +0 -0
- package/dist/client/assets/shown-lightbox-oVrT3f9w.js.br +0 -0
- package/dist/client/assets/trace-panel-T2LGj5gj.js.br +0 -0
- package/dist/client/assets/usage-panel-D8E_1blN.js.br +0 -0
- package/dist/client/assets/visions-panel-C8FS82M4.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)];
|
|
@@ -22088,8 +22094,9 @@ async function readLaneResultFile(resultPath) {
|
|
|
22088
22094
|
//#region server/github/team-review-thread-judge.ts
|
|
22089
22095
|
var THREAD_JUDGE_TOOLS = Object.freeze(["Read", "Write"]);
|
|
22090
22096
|
var THREAD_JUDGE_TIMEOUT_MS = 12e4;
|
|
22091
|
-
function createThreadJudge(spawn, shutdownSignal) {
|
|
22097
|
+
function createThreadJudge(spawn, readReviewer, shutdownSignal) {
|
|
22092
22098
|
return async (prompt) => {
|
|
22099
|
+
const reviewer = readReviewer();
|
|
22093
22100
|
const workDir = await fs$1.mkdtemp(path.join(os.tmpdir(), "glimmervoid-thread-judge-"));
|
|
22094
22101
|
const controller = new AbortController();
|
|
22095
22102
|
const timeout = setTimeout(() => controller.abort(), THREAD_JUDGE_TIMEOUT_MS);
|
|
@@ -22103,7 +22110,9 @@ function createThreadJudge(spawn, shutdownSignal) {
|
|
|
22103
22110
|
name: "Review thread judgement",
|
|
22104
22111
|
cwd: workDir,
|
|
22105
22112
|
prompt: "Read thread-prompt.txt and follow its instructions",
|
|
22106
|
-
|
|
22113
|
+
agent: reviewer.agent,
|
|
22114
|
+
model: reviewer.model,
|
|
22115
|
+
extraArgs: reviewer.effort ? ["--effort", reviewer.effort] : [],
|
|
22107
22116
|
signal
|
|
22108
22117
|
});
|
|
22109
22118
|
if (signal.aborted) return null;
|
|
@@ -28004,6 +28013,11 @@ var TEAM_REVIEW_EXTRA_DOMAINS = Object.freeze(["api.github.com"]);
|
|
|
28004
28013
|
var TEAM_REVIEW_SHELL_ALLOW_RULE = "Bash";
|
|
28005
28014
|
var SANDBOX_RUNTIME_UNSUPPORTED_PLATFORM = "win32";
|
|
28006
28015
|
var LINKED_CHECKOUT_UNREADABLE_ENTRY = /^(?:\.env(?:\..*)?|\.claude)$/;
|
|
28016
|
+
var LINKED_CHECKOUT_UNREADABLE_NAMES = Object.freeze([
|
|
28017
|
+
".env",
|
|
28018
|
+
".env.*",
|
|
28019
|
+
".claude"
|
|
28020
|
+
]);
|
|
28007
28021
|
var RESULT_MAX_BYTES$1 = 1048576;
|
|
28008
28022
|
var EMPTY_GH_CONFIG_DIRNAME = "gh-config";
|
|
28009
28023
|
var PUSH_DISABLED_URL = "https://push-disabled.invalid/";
|
|
@@ -28076,6 +28090,32 @@ function teamReviewRole(facts, { checkoutPath, cachedClone, unreadablePaths, san
|
|
|
28076
28090
|
readDenied: [...unreadablePaths]
|
|
28077
28091
|
};
|
|
28078
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
|
+
}
|
|
28079
28119
|
async function describeTeamReviewRole({ checkoutPath, cachedClone, linkedCheckout, sandbox = DEFAULT_SANDBOX }) {
|
|
28080
28120
|
const unreadablePaths = await linkedCheckoutUnreadablePaths(linkedCheckout);
|
|
28081
28121
|
return (facts) => teamReviewRole(facts, {
|
|
@@ -29186,7 +29226,7 @@ function createTeamReviewWiring({ config, store, reviewSessions, closeSessionDat
|
|
|
29186
29226
|
replayBufferKB: config.replayBufferKB,
|
|
29187
29227
|
allowTools: THREAD_JUDGE_TOOLS,
|
|
29188
29228
|
guardrailsRefusal
|
|
29189
|
-
}), shutdownController.signal),
|
|
29229
|
+
}), () => readTeamReviewSettings(config).reviewer, shutdownController.signal),
|
|
29190
29230
|
guardrailsRefusal,
|
|
29191
29231
|
beforeStart: (keepPaths) => sweepLeftoverCheckouts({
|
|
29192
29232
|
worktreeRoot,
|
|
@@ -39690,7 +39730,7 @@ async function readSigningKeySetting(setting, cwd) {
|
|
|
39690
39730
|
const keyPath = path.resolve(cwd, setting.replace(/^~(?=\/|$)/, os.homedir()));
|
|
39691
39731
|
return parseSshPublicKey(await fs$1.readFile(keyPath, "utf8").catch(() => ""));
|
|
39692
39732
|
}
|
|
39693
|
-
function readTextOrNull(filePath) {
|
|
39733
|
+
function readTextOrNull$1(filePath) {
|
|
39694
39734
|
try {
|
|
39695
39735
|
return readFileSync(filePath, "utf8");
|
|
39696
39736
|
} catch {
|
|
@@ -39705,7 +39745,7 @@ function installCommitSigningShim({ binDir, nodePath, cliPath, platform = proces
|
|
|
39705
39745
|
cliPath
|
|
39706
39746
|
});
|
|
39707
39747
|
try {
|
|
39708
|
-
if (readTextOrNull(shimPath) !== shimText) writeTextAtomicSync(shimPath, shimText, {
|
|
39748
|
+
if (readTextOrNull$1(shimPath) !== shimText) writeTextAtomicSync(shimPath, shimText, {
|
|
39709
39749
|
mode: 493,
|
|
39710
39750
|
mkdir: true,
|
|
39711
39751
|
enforceMode: true
|
|
@@ -49233,7 +49273,7 @@ var TERMINAL_KINDS = /* @__PURE__ */ new Set([
|
|
|
49233
49273
|
"dismissal",
|
|
49234
49274
|
"acknowledgement"
|
|
49235
49275
|
]);
|
|
49236
|
-
function textField(record, field) {
|
|
49276
|
+
function textField$1(record, field) {
|
|
49237
49277
|
const value = Reflect.get(record, field);
|
|
49238
49278
|
if (typeof value !== "string") return null;
|
|
49239
49279
|
return sanitizeOneLine(value, 280);
|
|
@@ -49244,10 +49284,10 @@ function journalEntries(output, sessionId) {
|
|
|
49244
49284
|
return [{
|
|
49245
49285
|
id: record.id,
|
|
49246
49286
|
kind: record.kind,
|
|
49247
|
-
at: textField(record, "at"),
|
|
49248
|
-
text: textField(record, "chose") ?? textField(record, "observation") ?? textField(record, "what") ?? textField(record, "expectation") ?? textField(record, "practice") ?? textField(record, "of") ?? record.kind,
|
|
49249
|
-
detail: textField(record, "because") ?? textField(record, "evidence") ?? textField(record, "discriminatedBy") ?? textField(record, "outcome"),
|
|
49250
|
-
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")
|
|
49251
49291
|
}];
|
|
49252
49292
|
});
|
|
49253
49293
|
}
|
|
@@ -50250,6 +50290,323 @@ function planQuickSession({ live, project, sessionNames }) {
|
|
|
50250
50290
|
};
|
|
50251
50291
|
}
|
|
50252
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
|
|
50253
50610
|
//#region server/settings-payload.ts
|
|
50254
50611
|
function summarizeCustomAgents(declarations) {
|
|
50255
50612
|
return declarations.map((declaration) => ({
|
|
@@ -50260,7 +50617,7 @@ function summarizeCustomAgents(declarations) {
|
|
|
50260
50617
|
resolvable: cachedAgentResolvability(declaration.id).resolvable
|
|
50261
50618
|
}));
|
|
50262
50619
|
}
|
|
50263
|
-
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 }) {
|
|
50264
50621
|
return {
|
|
50265
50622
|
...configStore.getSettings(),
|
|
50266
50623
|
isExperimentalBuild: configStore.isExperimentalBuild === true,
|
|
@@ -50270,7 +50627,8 @@ function buildSettingsPayload({ configStore, rtkInstallStatus = null, telegramDe
|
|
|
50270
50627
|
customAgents: summarizeCustomAgents(configStore.config.customAgents ?? []),
|
|
50271
50628
|
telegramDelivery,
|
|
50272
50629
|
coderEnvironments,
|
|
50273
|
-
agentLogins
|
|
50630
|
+
agentLogins,
|
|
50631
|
+
teamReviewEnvironment: readTeamReviewEnvironment(configStore.config)
|
|
50274
50632
|
};
|
|
50275
50633
|
}
|
|
50276
50634
|
//#endregion
|
|
@@ -55613,77 +55971,6 @@ function createAgentConnect({ loginsRoot, loginSource, launchFor, onChange, ptyS
|
|
|
55613
55971
|
};
|
|
55614
55972
|
}
|
|
55615
55973
|
//#endregion
|
|
55616
|
-
//#region server/core/codex-credentials-core.ts
|
|
55617
|
-
var CODEX_LOGIN_REFRESH_MARGIN_MS = 3e5;
|
|
55618
|
-
var StoredCodexAuth = z.object({ tokens: z.object({
|
|
55619
|
-
access_token: z.string().min(1),
|
|
55620
|
-
account_id: z.string().min(1)
|
|
55621
|
-
}) });
|
|
55622
|
-
var AccessTokenClaims = z.object({ exp: z.number().positive() });
|
|
55623
|
-
function accessTokenExpiryMs(accessToken) {
|
|
55624
|
-
const encodedClaims = accessToken.split(".")[1];
|
|
55625
|
-
if (!encodedClaims) return null;
|
|
55626
|
-
try {
|
|
55627
|
-
const claims = AccessTokenClaims.safeParse(JSON.parse(Buffer.from(encodedClaims, "base64url").toString("utf8")));
|
|
55628
|
-
return claims.success ? claims.data.exp * 1e3 : null;
|
|
55629
|
-
} catch {
|
|
55630
|
-
return null;
|
|
55631
|
-
}
|
|
55632
|
-
}
|
|
55633
|
-
function parseCodexAuth(text) {
|
|
55634
|
-
let decoded;
|
|
55635
|
-
try {
|
|
55636
|
-
decoded = JSON.parse(text);
|
|
55637
|
-
} catch {
|
|
55638
|
-
return null;
|
|
55639
|
-
}
|
|
55640
|
-
const parsed = StoredCodexAuth.safeParse(decoded);
|
|
55641
|
-
if (!parsed.success) return null;
|
|
55642
|
-
const { access_token: accessToken, account_id: accountId } = parsed.data.tokens;
|
|
55643
|
-
return {
|
|
55644
|
-
accessToken,
|
|
55645
|
-
accountId,
|
|
55646
|
-
expiresAtMs: accessTokenExpiryMs(accessToken)
|
|
55647
|
-
};
|
|
55648
|
-
}
|
|
55649
|
-
function codexHomeDir(env, homeDir) {
|
|
55650
|
-
const override = env.CODEX_HOME?.trim();
|
|
55651
|
-
return override ? path.resolve(override) : path.join(homeDir, ".codex");
|
|
55652
|
-
}
|
|
55653
|
-
function decideCodexLogin({ login, nowMs, hasRefreshed }) {
|
|
55654
|
-
if (!login) return {
|
|
55655
|
-
kind: "unavailable",
|
|
55656
|
-
reason: "no Codex login was found on this host; run codex login, or connect Codex from Glimmervoid"
|
|
55657
|
-
};
|
|
55658
|
-
if (login.expiresAtMs === null || login.expiresAtMs - nowMs >= CODEX_LOGIN_REFRESH_MARGIN_MS) return {
|
|
55659
|
-
kind: "use",
|
|
55660
|
-
login
|
|
55661
|
-
};
|
|
55662
|
-
if (!hasRefreshed) return { kind: "refresh" };
|
|
55663
|
-
if (login.expiresAtMs > nowMs) return {
|
|
55664
|
-
kind: "use",
|
|
55665
|
-
login
|
|
55666
|
-
};
|
|
55667
|
-
return {
|
|
55668
|
-
kind: "unavailable",
|
|
55669
|
-
reason: "the host Codex login has expired and a host refresh did not renew it; run codex login"
|
|
55670
|
-
};
|
|
55671
|
-
}
|
|
55672
|
-
function chatgptAuthTokensLogin(login) {
|
|
55673
|
-
return {
|
|
55674
|
-
type: "chatgptAuthTokens",
|
|
55675
|
-
accessToken: login.accessToken,
|
|
55676
|
-
chatgptAccountId: login.accountId
|
|
55677
|
-
};
|
|
55678
|
-
}
|
|
55679
|
-
function chatgptAuthTokensRefreshResult(login) {
|
|
55680
|
-
return {
|
|
55681
|
-
accessToken: login.accessToken,
|
|
55682
|
-
chatgptAccountId: login.accountId,
|
|
55683
|
-
chatgptPlanType: null
|
|
55684
|
-
};
|
|
55685
|
-
}
|
|
55686
|
-
//#endregion
|
|
55687
55974
|
//#region server/codex-credentials.ts
|
|
55688
55975
|
var HOST_REFRESH_TIMEOUT_MS = 6e4;
|
|
55689
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-
|
|
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};
|
|
Binary file
|
|
@@ -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-
|
|
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};
|
|
Binary file
|
package/dist/client/assets/{celebration-player-VUim5k1-.js → celebration-player-Dq-R2Wcv.js}
RENAMED
|
@@ -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-1p-_rN2a.js";import{playToneSequence as a}from"./alert-sound-hKiyMz7q.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};
|
|
Binary file
|