glimmervoid 0.46.2-next.162 → 0.46.2-next.164
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-BItJP6Kv.js → main-CDJ_G4MN.js} +170 -44
- package/dist/client/assets/{alert-sound-nSOtN9AU.js → alert-sound-BpSLIB7B.js} +1 -1
- package/dist/client/assets/alert-sound-BpSLIB7B.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-M9-_o_i9.js → benchmark-panel-CCGDqJr-.js} +1 -1
- package/dist/client/assets/benchmark-panel-CCGDqJr-.js.br +0 -0
- package/dist/client/assets/{celebration-player-DVQZn1nd.js → celebration-player-CXZ_7pBQ.js} +1 -1
- package/dist/client/assets/celebration-player-CXZ_7pBQ.js.br +0 -0
- package/dist/client/assets/{dialogs-Dc6HCB_A.js → dialogs-He8NLJ05.js} +1 -1
- package/dist/client/assets/dialogs-He8NLJ05.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-D8iFxbCA.js → doc-editor-ui-CTBMbMm-.js} +1 -1
- package/dist/client/assets/doc-editor-ui-CTBMbMm-.js.br +0 -0
- package/dist/client/assets/{feature-hint-DifKse4X.js → feature-hint-5AlbguSC.js} +1 -1
- package/dist/client/assets/feature-hint-5AlbguSC.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-C_Ex4Uoj.js → first-run-checklist-DXRRzQlR.js} +1 -1
- package/dist/client/assets/first-run-checklist-DXRRzQlR.js.br +0 -0
- package/dist/client/assets/{hooks-panel-fdKxV-a6.js → hooks-panel-EroOPQJe.js} +1 -1
- package/dist/client/assets/hooks-panel-EroOPQJe.js.br +0 -0
- package/dist/client/assets/{index-CSwvuDRU.js → index-Cb2I6OyB.js} +5 -5
- package/dist/client/assets/index-Cb2I6OyB.js.br +0 -0
- package/dist/client/assets/{issues-panel-C0Sw6I_3.js → issues-panel-wHP4NQtT.js} +1 -1
- package/dist/client/assets/issues-panel-wHP4NQtT.js.br +0 -0
- package/dist/client/assets/{nyan-cat-Oi-3LTai.js → nyan-cat-CWOvLOgY.js} +1 -1
- package/dist/client/assets/nyan-cat-CWOvLOgY.js.br +0 -0
- package/dist/client/assets/{phone-shell-D41ozESX.js → phone-shell-CHGFXoec.js} +1 -1
- package/dist/client/assets/phone-shell-CHGFXoec.js.br +0 -0
- package/dist/client/assets/{plan-face-Cv9PRpzN.js → plan-face-d6GCOLvG.js} +1 -1
- package/dist/client/assets/plan-face-d6GCOLvG.js.br +0 -0
- package/dist/client/assets/{plan-render-Dvfpqwe0.js → plan-render-Booa3Bo-.js} +1 -1
- package/dist/client/assets/plan-render-Booa3Bo-.js.br +0 -0
- package/dist/client/assets/{pr-scope-tabs-d4kNVDLA.js → pr-scope-tabs-ymgl1HSU.js} +1 -1
- package/dist/client/assets/pr-scope-tabs-ymgl1HSU.js.br +0 -0
- package/dist/client/assets/{radar-panel-BXWmBN3K.js → radar-panel-zPNaBZ3v.js} +1 -1
- package/dist/client/assets/radar-panel-zPNaBZ3v.js.br +0 -0
- package/dist/client/assets/{resume-dialog-DmK_zP3u.js → resume-dialog-DK_3xJpx.js} +1 -1
- package/dist/client/assets/resume-dialog-DK_3xJpx.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-VH3Gjc2M.js → review-queue-panel-CwPAHBMr.js} +1 -1
- package/dist/client/assets/review-queue-panel-CwPAHBMr.js.br +0 -0
- package/dist/client/assets/{settings-panel-Bi7EAW1v.js → settings-panel-DzT428RT.js} +2 -2
- package/dist/client/assets/settings-panel-DzT428RT.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-BGBlGsuF.js → shown-lightbox-uBt09HlZ.js} +1 -1
- package/dist/client/assets/shown-lightbox-uBt09HlZ.js.br +0 -0
- package/dist/client/assets/{trace-panel-Dhvs0oDx.js → trace-panel-0V0cammV.js} +1 -1
- package/dist/client/assets/trace-panel-0V0cammV.js.br +0 -0
- package/dist/client/assets/{usage-panel-B3CL5085.js → usage-panel-xp0GhpuL.js} +1 -1
- package/dist/client/assets/usage-panel-xp0GhpuL.js.br +0 -0
- package/dist/client/assets/{visions-panel-B3AHVPRD.js → visions-panel-CMckrSY3.js} +1 -1
- package/dist/client/assets/visions-panel-CMckrSY3.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-nSOtN9AU.js.br +0 -0
- package/dist/client/assets/benchmark-panel-M9-_o_i9.js.br +0 -0
- package/dist/client/assets/celebration-player-DVQZn1nd.js.br +0 -0
- package/dist/client/assets/dialogs-Dc6HCB_A.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-D8iFxbCA.js.br +0 -0
- package/dist/client/assets/feature-hint-DifKse4X.js.br +0 -0
- package/dist/client/assets/first-run-checklist-C_Ex4Uoj.js.br +0 -0
- package/dist/client/assets/hooks-panel-fdKxV-a6.js.br +0 -0
- package/dist/client/assets/index-CSwvuDRU.js.br +0 -0
- package/dist/client/assets/issues-panel-C0Sw6I_3.js.br +0 -0
- package/dist/client/assets/nyan-cat-Oi-3LTai.js.br +0 -0
- package/dist/client/assets/phone-shell-D41ozESX.js.br +0 -0
- package/dist/client/assets/plan-face-Cv9PRpzN.js.br +0 -0
- package/dist/client/assets/plan-render-Dvfpqwe0.js.br +0 -0
- package/dist/client/assets/pr-scope-tabs-d4kNVDLA.js.br +0 -0
- package/dist/client/assets/radar-panel-BXWmBN3K.js.br +0 -0
- package/dist/client/assets/resume-dialog-DmK_zP3u.js.br +0 -0
- package/dist/client/assets/review-queue-panel-VH3Gjc2M.js.br +0 -0
- package/dist/client/assets/settings-panel-Bi7EAW1v.js.br +0 -0
- package/dist/client/assets/shown-lightbox-BGBlGsuF.js.br +0 -0
- package/dist/client/assets/trace-panel-Dhvs0oDx.js.br +0 -0
- package/dist/client/assets/usage-panel-B3CL5085.js.br +0 -0
- package/dist/client/assets/visions-panel-B3AHVPRD.js.br +0 -0
|
@@ -21318,6 +21318,7 @@ var TOOL_TARGET_KEYS = Object.freeze([
|
|
|
21318
21318
|
"notebook_path",
|
|
21319
21319
|
"path",
|
|
21320
21320
|
"command",
|
|
21321
|
+
"cmd",
|
|
21321
21322
|
"pattern",
|
|
21322
21323
|
"url",
|
|
21323
21324
|
"query",
|
|
@@ -21364,11 +21365,15 @@ function parseTimestamp(value) {
|
|
|
21364
21365
|
if (!Number.isFinite(parsed)) return null;
|
|
21365
21366
|
return parsed;
|
|
21366
21367
|
}
|
|
21368
|
+
function commandWordsJoined(value) {
|
|
21369
|
+
if (!Array.isArray(value) || !value.every((word) => typeof word === "string")) return value;
|
|
21370
|
+
return value.join(" ");
|
|
21371
|
+
}
|
|
21367
21372
|
function toolTarget(input) {
|
|
21368
21373
|
if (!input || typeof input !== "object" || Array.isArray(input)) return "";
|
|
21369
21374
|
const record = input;
|
|
21370
21375
|
for (const key of TOOL_TARGET_KEYS) {
|
|
21371
|
-
const value = textOr(record[key], null);
|
|
21376
|
+
const value = textOr(commandWordsJoined(record[key]), null);
|
|
21372
21377
|
if (!value) continue;
|
|
21373
21378
|
return boundRaw(value);
|
|
21374
21379
|
}
|
|
@@ -21389,6 +21394,21 @@ function turnEvent({ ts, root, sessionId, vendor, text }) {
|
|
|
21389
21394
|
detail: { vendor }
|
|
21390
21395
|
};
|
|
21391
21396
|
}
|
|
21397
|
+
function promptEvent({ ts, root, sessionId, vendor, text }) {
|
|
21398
|
+
const prompt = boundRaw(text).trim();
|
|
21399
|
+
if (!prompt) return null;
|
|
21400
|
+
return {
|
|
21401
|
+
source: SOURCE$3,
|
|
21402
|
+
kind: "agent-prompt",
|
|
21403
|
+
ts,
|
|
21404
|
+
scope: {
|
|
21405
|
+
root,
|
|
21406
|
+
sessionId
|
|
21407
|
+
},
|
|
21408
|
+
summary: `${vendor}: ${prompt}`,
|
|
21409
|
+
detail: { vendor }
|
|
21410
|
+
};
|
|
21411
|
+
}
|
|
21392
21412
|
function toolEvent({ ts, root, sessionId, vendor, name, target }) {
|
|
21393
21413
|
const tool = boundRaw(textOr(name, null) || "tool");
|
|
21394
21414
|
const suffix = target ? ` ${target}` : "";
|
|
@@ -21423,7 +21443,40 @@ function firstTextBlock(content) {
|
|
|
21423
21443
|
}
|
|
21424
21444
|
return null;
|
|
21425
21445
|
}
|
|
21446
|
+
var SLASH_COMMAND_ENVELOPE = /<command-name>\s*([^<]*?)\s*<\/command-name>/i;
|
|
21447
|
+
var SLASH_COMMAND_ARGS = /<command-args>([\s\S]*?)<\/command-args>/i;
|
|
21448
|
+
var HARNESS_RECORD = /^\s*(?:<local-command-(?:caveat|stdout|stderr)>|<task-notification>|<bash-(?:input|stdout|stderr)>|\[Request interrupted by user)/i;
|
|
21449
|
+
function claudePromptText(content) {
|
|
21450
|
+
if (typeof content === "string") return content;
|
|
21451
|
+
if (!Array.isArray(content)) return null;
|
|
21452
|
+
if (content.some((block) => block?.type === "tool_result")) return null;
|
|
21453
|
+
return firstTextBlock(content);
|
|
21454
|
+
}
|
|
21455
|
+
function unwrapSlashCommand(text) {
|
|
21456
|
+
if (HARNESS_RECORD.test(text)) return null;
|
|
21457
|
+
const commandName = SLASH_COMMAND_ENVELOPE.exec(text)?.[1];
|
|
21458
|
+
if (!commandName) return text;
|
|
21459
|
+
const commandArgs = SLASH_COMMAND_ARGS.exec(text)?.[1]?.trim() ?? "";
|
|
21460
|
+
return commandArgs ? `${commandName} ${commandArgs}` : commandName;
|
|
21461
|
+
}
|
|
21462
|
+
function mapClaudePromptLine(line, ctx) {
|
|
21463
|
+
if (line.isMeta === true || line.isSidechain === true || line.isCompactSummary === true) return null;
|
|
21464
|
+
const text = claudePromptText(line.message?.content);
|
|
21465
|
+
const prompt = text ? unwrapSlashCommand(text) : null;
|
|
21466
|
+
if (!prompt) return null;
|
|
21467
|
+
const root = textOr(line.cwd, null) || ctx.root;
|
|
21468
|
+
const sessionId = textOr(line.sessionId, null) || ctx.sessionId;
|
|
21469
|
+
const event = promptEvent({
|
|
21470
|
+
ts: parseTimestamp(line.timestamp) || ctx.now,
|
|
21471
|
+
root,
|
|
21472
|
+
sessionId,
|
|
21473
|
+
vendor: "claude",
|
|
21474
|
+
text: prompt
|
|
21475
|
+
});
|
|
21476
|
+
return event ? result([event], root, sessionId, ctx.vendorState) : null;
|
|
21477
|
+
}
|
|
21426
21478
|
function mapClaudeLine(line, ctx) {
|
|
21479
|
+
if (line.type === "user") return mapClaudePromptLine(line, ctx);
|
|
21427
21480
|
if (line.type !== "assistant") return null;
|
|
21428
21481
|
const content = line.message?.content;
|
|
21429
21482
|
if (!Array.isArray(content)) return null;
|
|
@@ -21452,6 +21505,39 @@ function mapClaudeLine(line, ctx) {
|
|
|
21452
21505
|
}
|
|
21453
21506
|
return result(events, root, sessionId, ctx.vendorState);
|
|
21454
21507
|
}
|
|
21508
|
+
var EXEC_COMMAND_CALL = /exec_command\(/g;
|
|
21509
|
+
var EXEC_CMD_ARGUMENT = /\bcmd\s*:\s*("(?:[^"\\]|\\.)*"|`(?:[^`\\$]|\\.)*`)/;
|
|
21510
|
+
function parsedJsonString(literal) {
|
|
21511
|
+
try {
|
|
21512
|
+
const parsed = JSON.parse(literal);
|
|
21513
|
+
return typeof parsed === "string" ? parsed : null;
|
|
21514
|
+
} catch {
|
|
21515
|
+
return null;
|
|
21516
|
+
}
|
|
21517
|
+
}
|
|
21518
|
+
function commandLiteralValue(literal) {
|
|
21519
|
+
if (literal.startsWith("\"")) return parsedJsonString(literal);
|
|
21520
|
+
return literal.slice(1, -1).replace(/\\(.)/g, "$1");
|
|
21521
|
+
}
|
|
21522
|
+
function execCommandsOf(input) {
|
|
21523
|
+
if (typeof input !== "string") return [];
|
|
21524
|
+
const callStarts = [...input.matchAll(EXEC_COMMAND_CALL)].map((match) => match.index);
|
|
21525
|
+
return callStarts.map((callStart, callNumber) => {
|
|
21526
|
+
const callText = input.slice(callStart, callStarts[callNumber + 1] ?? input.length);
|
|
21527
|
+
const literal = EXEC_CMD_ARGUMENT.exec(callText)?.[1];
|
|
21528
|
+
const command = literal ? commandLiteralValue(literal) : null;
|
|
21529
|
+
return command ? boundRaw(command) : "";
|
|
21530
|
+
});
|
|
21531
|
+
}
|
|
21532
|
+
function codexPromptText(payload) {
|
|
21533
|
+
if (payload.type === "user_message") return textOr(payload.message, null);
|
|
21534
|
+
if (payload.type !== "item_completed") return null;
|
|
21535
|
+
const item = payload.item;
|
|
21536
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return null;
|
|
21537
|
+
const record = item;
|
|
21538
|
+
if (record.type !== "UserMessage" || !Array.isArray(record.content)) return null;
|
|
21539
|
+
return firstTextBlock(record.content);
|
|
21540
|
+
}
|
|
21455
21541
|
function mapCodexLine(line, ctx) {
|
|
21456
21542
|
const payload = line.payload;
|
|
21457
21543
|
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return null;
|
|
@@ -21471,6 +21557,22 @@ function mapCodexLine(line, ctx) {
|
|
|
21471
21557
|
if (!turn) return null;
|
|
21472
21558
|
return result([turn], ctx.root, ctx.sessionId, ctx.vendorState);
|
|
21473
21559
|
}
|
|
21560
|
+
const prompt = line.type === "event_msg" ? codexPromptText(payload) : null;
|
|
21561
|
+
if (prompt) {
|
|
21562
|
+
const event = promptEvent({
|
|
21563
|
+
...base,
|
|
21564
|
+
text: prompt
|
|
21565
|
+
});
|
|
21566
|
+
return event ? result([event], ctx.root, ctx.sessionId, ctx.vendorState) : null;
|
|
21567
|
+
}
|
|
21568
|
+
if (line.type === "response_item" && payload.type === "custom_tool_call" && payload.name === "exec") {
|
|
21569
|
+
const events = execCommandsOf(payload.input).map((command) => toolEvent({
|
|
21570
|
+
...base,
|
|
21571
|
+
name: "exec_command",
|
|
21572
|
+
target: command
|
|
21573
|
+
}));
|
|
21574
|
+
return events.length > 0 ? result(events, ctx.root, ctx.sessionId, ctx.vendorState) : null;
|
|
21575
|
+
}
|
|
21474
21576
|
if (line.type === "response_item" && payload.type === "function_call") {
|
|
21475
21577
|
const target = toolTarget(parseJsonRecord(payload.arguments));
|
|
21476
21578
|
return result([toolEvent({
|
|
@@ -21553,19 +21655,29 @@ function kimiToolEvents(toolCalls, base) {
|
|
|
21553
21655
|
target: toolTarget(parseJsonRecord(call?.arguments))
|
|
21554
21656
|
}));
|
|
21555
21657
|
}
|
|
21658
|
+
function mapKimiPrompt(line, content, base, ctx) {
|
|
21659
|
+
const originKind = line.message?.meta?.origin?.kind;
|
|
21660
|
+
if (originKind !== void 0 && originKind !== "user") return null;
|
|
21661
|
+
const event = promptEvent({
|
|
21662
|
+
...base,
|
|
21663
|
+
text: firstTextBlock(content)
|
|
21664
|
+
});
|
|
21665
|
+
return event ? result([event], ctx.root, ctx.sessionId, ctx.vendorState) : null;
|
|
21666
|
+
}
|
|
21556
21667
|
function mapKimiLine(line, ctx) {
|
|
21557
21668
|
const announcedRoot = kimiRootOf(line);
|
|
21558
21669
|
if (announcedRoot) return result([], announcedRoot, ctx.sessionId, ctx.vendorState);
|
|
21559
21670
|
if (line.type !== "agent.message.appended") return null;
|
|
21560
21671
|
const message = line.message?.message;
|
|
21561
|
-
if (message?.role !== "assistant") return null;
|
|
21562
21672
|
const base = {
|
|
21563
21673
|
ts: parseTimestamp(line.time) || ctx.now,
|
|
21564
21674
|
root: ctx.root,
|
|
21565
21675
|
sessionId: ctx.sessionId,
|
|
21566
21676
|
vendor: "kimi"
|
|
21567
21677
|
};
|
|
21568
|
-
const content = Array.isArray(message
|
|
21678
|
+
const content = Array.isArray(message?.content) ? message.content : [];
|
|
21679
|
+
if (message?.role === "user") return mapKimiPrompt(line, content, base, ctx);
|
|
21680
|
+
if (message?.role !== "assistant") return null;
|
|
21569
21681
|
const turn = turnEvent({
|
|
21570
21682
|
...base,
|
|
21571
21683
|
text: firstTextBlock(content)
|
|
@@ -32913,7 +33025,7 @@ function transcriptRootCandidates(env = process.env, wanted = {}, homeDir = os.h
|
|
|
32913
33025
|
});
|
|
32914
33026
|
return candidates;
|
|
32915
33027
|
}
|
|
32916
|
-
function createAgentLogIngest({ publish, sourceConfig = {}, laneMap = null, logger = console, env = process.env, homeDir = os.homedir(), fsPromises = fs.promises, watchFn = fs.watch, nowFn = Date.now, setIntervalFn = DEFAULT_TIMER_FNS.setIntervalFn, clearIntervalFn = DEFAULT_TIMER_FNS.clearIntervalFn, setTimeoutFn = DEFAULT_TIMER_FNS.setTimeoutFn, clearTimeoutFn = DEFAULT_TIMER_FNS.clearTimeoutFn, pollIntervalMs = DEFAULT_POLL_MS$2, discoverIntervalMs = DEFAULT_DISCOVER_MS$1, activeWithinMs = DEFAULT_ACTIVE_WITHIN_MS, maxActiveFiles = 32, maxTrackedFiles = 256, maxCachedDirs = 4096, maxWatchedDirs = 48, maxScanDirs = 2e3, maxStatsPerSweep = 400, maxLinesPerDrain = 200, maxCatchUpBytes = MAX_CATCH_UP_BYTES, vendors = null }) {
|
|
33028
|
+
function createAgentLogIngest({ publish, sourceConfig = {}, laneMap = null, logger = console, env = process.env, homeDir = os.homedir(), fsPromises = fs.promises, watchFn = fs.watch, nowFn = Date.now, setIntervalFn = DEFAULT_TIMER_FNS.setIntervalFn, clearIntervalFn = DEFAULT_TIMER_FNS.clearIntervalFn, setTimeoutFn = DEFAULT_TIMER_FNS.setTimeoutFn, clearTimeoutFn = DEFAULT_TIMER_FNS.clearTimeoutFn, pollIntervalMs = DEFAULT_POLL_MS$2, discoverIntervalMs = DEFAULT_DISCOVER_MS$1, activeWithinMs = DEFAULT_ACTIVE_WITHIN_MS, maxActiveFiles = 32, maxTrackedFiles = 256, maxCachedDirs = 4096, maxWatchedDirs = 48, maxScanDirs = 2e3, maxStatsPerSweep = 400, maxLinesPerDrain = 200, maxCatchUpBytes = MAX_CATCH_UP_BYTES, vendors = null, readsFilesBornAfterStart = false }) {
|
|
32917
33029
|
const pollMs = positiveIntOr(sourceConfig.pollMs, positiveIntOr(pollIntervalMs, DEFAULT_POLL_MS$2));
|
|
32918
33030
|
const wanted = vendors && typeof vendors === "object" ? vendors : {};
|
|
32919
33031
|
const tails = /* @__PURE__ */ new Map();
|
|
@@ -32931,6 +33043,7 @@ function createAgentLogIngest({ publish, sourceConfig = {}, laneMap = null, logg
|
|
|
32931
33043
|
let drainInFlight = null;
|
|
32932
33044
|
let sweepInFlight = null;
|
|
32933
33045
|
let startPromise = null;
|
|
33046
|
+
let startedAtMs = Number.POSITIVE_INFINITY;
|
|
32934
33047
|
let watchSupportChecked = false;
|
|
32935
33048
|
function alive() {
|
|
32936
33049
|
return running && !disabled;
|
|
@@ -33111,7 +33224,12 @@ function createAgentLogIngest({ publish, sourceConfig = {}, laneMap = null, logg
|
|
|
33111
33224
|
const scopeRoot = headRootReader ? await readHeadRoot(filePath, headRootReader, fsPromises) : rootFromPath(root.vendor, dir);
|
|
33112
33225
|
if (!alive()) return;
|
|
33113
33226
|
if (isDispatchWorkdir(scopeRoot)) return;
|
|
33114
|
-
|
|
33227
|
+
const tailState = createTailState(stat, { path: filePath });
|
|
33228
|
+
const isBornAfterStart = readsFilesBornAfterStart && stat.birthtimeMs >= startedAtMs;
|
|
33229
|
+
tails.set(filePath, isBornAfterStart ? {
|
|
33230
|
+
...tailState,
|
|
33231
|
+
offset: 0
|
|
33232
|
+
} : tailState);
|
|
33115
33233
|
contexts.set(filePath, {
|
|
33116
33234
|
vendor: root.vendor,
|
|
33117
33235
|
dir,
|
|
@@ -33274,7 +33392,7 @@ function createAgentLogIngest({ publish, sourceConfig = {}, laneMap = null, logg
|
|
|
33274
33392
|
if (isDispatchWorkdir(context.root)) continue;
|
|
33275
33393
|
for (const event of mapped.events) {
|
|
33276
33394
|
if (!event.scope.root) continue;
|
|
33277
|
-
if (droppedLines > 0) {
|
|
33395
|
+
if (droppedLines > 0 && event.kind !== "agent-prompt") {
|
|
33278
33396
|
event.summary = `${event.summary} [${droppedLines} earlier lines dropped]`;
|
|
33279
33397
|
event.detail = {
|
|
33280
33398
|
...event.detail,
|
|
@@ -33398,6 +33516,7 @@ function createAgentLogIngest({ publish, sourceConfig = {}, laneMap = null, logg
|
|
|
33398
33516
|
if (startPromise) return startPromise;
|
|
33399
33517
|
if (disabled) return Promise.resolve();
|
|
33400
33518
|
running = true;
|
|
33519
|
+
startedAtMs = nowFn();
|
|
33401
33520
|
pollTimer = unrefTimer(setIntervalFn(() => {
|
|
33402
33521
|
runGuarded(poll);
|
|
33403
33522
|
}, pollMs));
|
|
@@ -40779,21 +40898,35 @@ function noteViewShown(state, view, now) {
|
|
|
40779
40898
|
}
|
|
40780
40899
|
//#endregion
|
|
40781
40900
|
//#region server/feature-hints-wiring.ts
|
|
40782
|
-
|
|
40783
|
-
|
|
40784
|
-
|
|
40785
|
-
|
|
40786
|
-
|
|
40901
|
+
var SHELL_TOOLS = /* @__PURE__ */ new Set([
|
|
40902
|
+
"Bash",
|
|
40903
|
+
"exec_command",
|
|
40904
|
+
"shell"
|
|
40905
|
+
]);
|
|
40906
|
+
var HINTED_VENDORS = {
|
|
40907
|
+
claude: true,
|
|
40908
|
+
codex: true,
|
|
40909
|
+
kimi: true,
|
|
40910
|
+
grok: false
|
|
40911
|
+
};
|
|
40912
|
+
function textAfterPrefix(text, prefix) {
|
|
40913
|
+
return text.startsWith(prefix) ? text.slice(prefix.length) : null;
|
|
40914
|
+
}
|
|
40915
|
+
function toolCommandOf(event) {
|
|
40916
|
+
if (event.kind !== "agent-tool" || !SHELL_TOOLS.has(String(event.detail.tool))) return null;
|
|
40917
|
+
return textAfterPrefix(event.summary, `${event.detail.vendor}: ${event.detail.tool} `);
|
|
40918
|
+
}
|
|
40919
|
+
function promptOf(event) {
|
|
40920
|
+
if (event.kind !== "agent-prompt") return null;
|
|
40921
|
+
return textAfterPrefix(event.summary, `${event.detail.vendor}: `);
|
|
40787
40922
|
}
|
|
40788
40923
|
function shellCommandOf(event) {
|
|
40789
40924
|
if (event.kind !== "command") return null;
|
|
40790
|
-
|
|
40791
|
-
return event.summary.startsWith(shellPrefix) ? event.summary.slice(shellPrefix.length) : null;
|
|
40925
|
+
return textAfterPrefix(event.summary, `${event.detail.shell}: `);
|
|
40792
40926
|
}
|
|
40793
|
-
function createFeatureHintsWiring({ statePath, broadcast, log, now = Date.now, shellHistory = {} }) {
|
|
40927
|
+
function createFeatureHintsWiring({ statePath, broadcast, log, now = Date.now, shellHistory = {}, agentLogs = {} }) {
|
|
40794
40928
|
let state = emptyFeatureHintState();
|
|
40795
40929
|
let recentPrompts = [];
|
|
40796
|
-
const attachedSessions = /* @__PURE__ */ new WeakSet();
|
|
40797
40930
|
let isStopped = false;
|
|
40798
40931
|
const store = createJsonStateStore({
|
|
40799
40932
|
name: "feature hints",
|
|
@@ -40826,34 +40959,18 @@ function createFeatureHintsWiring({ statePath, broadcast, log, now = Date.now, s
|
|
|
40826
40959
|
if (signals.length === 0) return Promise.resolve();
|
|
40827
40960
|
return update((current) => recordSignals(current, signals, now()));
|
|
40828
40961
|
}
|
|
40829
|
-
function
|
|
40830
|
-
const
|
|
40831
|
-
if (
|
|
40832
|
-
|
|
40833
|
-
|
|
40834
|
-
}
|
|
40835
|
-
if (event !== "UserPromptSubmit" || typeof payload.prompt !== "string") return [];
|
|
40962
|
+
function signalsFromAgentEvent(event) {
|
|
40963
|
+
const command = toolCommandOf(event);
|
|
40964
|
+
if (command) return classifyCommand(command, "agent-command", event.ts);
|
|
40965
|
+
const prompt = promptOf(event);
|
|
40966
|
+
if (!prompt) return [];
|
|
40836
40967
|
const repeated = noteRecentPrompt(recentPrompts, {
|
|
40837
|
-
prompt
|
|
40838
|
-
sessionId:
|
|
40839
|
-
ts
|
|
40968
|
+
prompt,
|
|
40969
|
+
sessionId: event.scope.sessionId ?? "",
|
|
40970
|
+
ts: event.ts
|
|
40840
40971
|
});
|
|
40841
40972
|
recentPrompts = repeated.recentPrompts;
|
|
40842
|
-
return [...classifyPrompt(
|
|
40843
|
-
}
|
|
40844
|
-
function attachSession(session) {
|
|
40845
|
-
if (attachedSessions.has(session)) return;
|
|
40846
|
-
attachedSessions.add(session);
|
|
40847
|
-
function onHookEvent(notice) {
|
|
40848
|
-
recordSignals$1(signalsFromHookEvent(session, notice));
|
|
40849
|
-
}
|
|
40850
|
-
function detach() {
|
|
40851
|
-
attachedSessions.delete(session);
|
|
40852
|
-
session.off("hook-event", onHookEvent);
|
|
40853
|
-
session.off("teardown", detach);
|
|
40854
|
-
}
|
|
40855
|
-
session.on("hook-event", onHookEvent);
|
|
40856
|
-
session.on("teardown", detach);
|
|
40973
|
+
return [...classifyPrompt(prompt, event.ts), ...repeated.signals];
|
|
40857
40974
|
}
|
|
40858
40975
|
const shellHistoryIngest = shellHistory && createShellHistoryIngest({
|
|
40859
40976
|
logger: log,
|
|
@@ -40864,6 +40981,16 @@ function createFeatureHintsWiring({ statePath, broadcast, log, now = Date.now, s
|
|
|
40864
40981
|
}
|
|
40865
40982
|
});
|
|
40866
40983
|
shellHistoryIngest?.start();
|
|
40984
|
+
const agentLogIngest = agentLogs && createAgentLogIngest({
|
|
40985
|
+
logger: log,
|
|
40986
|
+
vendors: HINTED_VENDORS,
|
|
40987
|
+
readsFilesBornAfterStart: true,
|
|
40988
|
+
...agentLogs,
|
|
40989
|
+
publish: (event) => {
|
|
40990
|
+
recordSignals$1(signalsFromAgentEvent(event));
|
|
40991
|
+
}
|
|
40992
|
+
});
|
|
40993
|
+
agentLogIngest?.start();
|
|
40867
40994
|
function noteViewShown$1(view) {
|
|
40868
40995
|
return update((current) => noteViewShown(current, view, now()));
|
|
40869
40996
|
}
|
|
@@ -40880,12 +41007,11 @@ function createFeatureHintsWiring({ statePath, broadcast, log, now = Date.now, s
|
|
|
40880
41007
|
return loaded.then(() => store.idle());
|
|
40881
41008
|
}
|
|
40882
41009
|
async function stop() {
|
|
40883
|
-
await shellHistoryIngest?.stop();
|
|
41010
|
+
await Promise.all([shellHistoryIngest?.stop(), agentLogIngest?.stop()]);
|
|
40884
41011
|
isStopped = true;
|
|
40885
41012
|
await idle();
|
|
40886
41013
|
}
|
|
40887
41014
|
return {
|
|
40888
|
-
attachSession,
|
|
40889
41015
|
noteViewShown: noteViewShown$1,
|
|
40890
41016
|
settle,
|
|
40891
41017
|
pendingHintMessage,
|
|
@@ -47287,7 +47413,8 @@ function createBackendLanes(dependencies) {
|
|
|
47287
47413
|
const featureHints = createFeatureHintsWiring({
|
|
47288
47414
|
statePath: configSiblingPath(configStore.configPath, "feature-hints.json"),
|
|
47289
47415
|
broadcast: broadcastControl,
|
|
47290
|
-
log: logger
|
|
47416
|
+
log: logger,
|
|
47417
|
+
agentLogs: { laneMap: () => laneLedger.laneMap() }
|
|
47291
47418
|
});
|
|
47292
47419
|
const myPrsWorkRoot = path.join(glimmervoidHome, "my-prs-work");
|
|
47293
47420
|
const myPrs = createMyPrsWiring({
|
|
@@ -47525,7 +47652,6 @@ function createBackendLanes(dependencies) {
|
|
|
47525
47652
|
}
|
|
47526
47653
|
function tapIngestForSession(session) {
|
|
47527
47654
|
sessionPrLink.attachSession(session);
|
|
47528
|
-
featureHints.attachSession(session);
|
|
47529
47655
|
if (ingestLane?.terminalEnabled) ingestLane.attachSessionTap(session);
|
|
47530
47656
|
if (ingestLane?.fsEnabled) ingestLane.noteSessionRoots(session);
|
|
47531
47657
|
}
|
|
@@ -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-Cb2I6OyB.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-Cb2I6OyB.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-DVQZn1nd.js → celebration-player-CXZ_7pBQ.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-CSwvuDRU.js";import{playToneSequence as a}from"./alert-sound-nSOtN9AU.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-Cb2I6OyB.js";import{playToneSequence as a}from"./alert-sound-BpSLIB7B.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
|
|
@@ -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-
|
|
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-Cb2I6OyB.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>
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./dom-helpers-C7P3_59O.js";import{d as t}from"./control-ws-H2e01_5q.js";import{a as n,r,t as i}from"./modal-Bh-cVr-I.js";import{Br as a,Lr as o,ei as s,pn as c}from"./index-
|
|
1
|
+
import{o as e}from"./dom-helpers-C7P3_59O.js";import{d as t}from"./control-ws-H2e01_5q.js";import{a as n,r,t as i}from"./modal-Bh-cVr-I.js";import{Br as a,Lr as o,ei as s,pn as c}from"./index-Cb2I6OyB.js";import{i as l,t as u}from"./plan-render-Booa3Bo-.js";var d=null;function f(t){let n=s(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=s(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){n({title:e,message:`Your unsaved edits will be lost.`,confirmLabel:`Discard`,danger:!0,onConfirm:t})}function _(e,t,n){e.hasUnsavedChanges?g(t,n):n()}async function v(e,n){try{return{reply:await t(e,n,{timeoutMs:o}),failureText:null}}catch(e){return{reply:null,failureText:a(e,o)}}}async function y(e,t){e.docPath=t,e.isBusy=!0,e.baseHash=null,e.textarea.readOnly=!0,f(e),m(e,`Loading`),p(e);let{reply:n,failureText:r}=await v(`session-doc-read`,{id:e.sessionId,path:t});if(d!==e||e.docPath!==t)return;e.isBusy=!1,e.textarea.readOnly=!1;let i=n?.type===`session-doc-response`?n:null;!i?.ok||i.text===void 0||i.hash===void 0?(m(e,i?.error||r||`Could not open this doc`,`warn`),p(e)):(e.textarea.value=i.text,e.baseHash=i.hash,e.hasUnsavedChanges=!1,e.mode===`preview`&&h(e),m(e,``),p(e))}async function b(e){if(e.btnSave.disabled||e.baseHash===null)return;e.isBusy=!0,m(e,`Saving`),p(e);let t=e.docPath,n=e.textarea.value,{reply:r,failureText:i}=await v(`session-doc-save`,{id:e.sessionId,path:t,text:n,baseHash:e.baseHash});if(d!==e||e.docPath!==t)return;e.isBusy=!1;let a=r?.type===`session-doc-save-result`?r:null;!a?.ok||a.hash===void 0?(m(e,a?.conflict?`The agent changed this file since you opened it. Reload to see its version.`:a?.error||i||`Save failed`,`warn`),p(e)):(e.baseHash=a.hash,e.hasUnsavedChanges=e.textarea.value!==n,m(e,e.hasUnsavedChanges?`Unsaved changes`:`Saved`),p(e))}function x(e,t){e.mode=t,t===`preview`&&h(e),p(e),t===`edit`&&e.textarea.focus()}function S(t,n){let r=e(`button`,`plan-control ${n}`,t);return r.type=`button`,r}function C(t){let n=s(t)[0];if(!n||d)return;let a=()=>_(M,`Close this doc?`,()=>M.close()),o=r({dialogClass:`doc-editor`,closeOnBackdrop:!1,onEscape:a}),l=`doc-editor-title-${t}`,u=e(`h3`,`doc-editor-title`,n.name);u.id=l;let f=e(`select`,`plan-control doc-editor-picker`);f.setAttribute(`aria-label`,`Doc`);let h=e(`span`,`doc-editor-status`);h.setAttribute(`role`,`status`);let g=S(`Edit`,`doc-editor-mode`),v=S(`Preview`,`doc-editor-mode`),C=S(`Reload`,`doc-editor-reload`),w=S(`Save`,`doc-editor-save`),T=S(`Close`,`doc-editor-close`),E=e(`div`,`doc-editor-modes`);E.append(g,v);let D=e(`div`,`doc-editor-actions`);D.append(h,C,w,T);let O=e(`div`,`doc-editor-header`);O.append(u,f,E,D);let k=e(`textarea`,`plan-editor doc-editor-text`);k.spellcheck=!0,k.setAttribute(`aria-labelledby`,l);let A=e(`div`,`doc-editor-preview`),j=e(`div`,`doc-editor-body`);j.append(k,A),o.dialog.append(O,j),i(o.dialog,l);let M={sessionId:t,docPath:n.path,baseHash:null,hasUnsavedChanges:!1,isBusy:!1,mode:c()?`preview`:`edit`,title:u,select:f,textarea:k,preview:A,status:h,btnEdit:g,btnPreview:v,btnReload:C,btnSave:w,close:()=>{d=null,o.close()}};d=M,k.addEventListener(`input`,()=>{M.hasUnsavedChanges||(M.hasUnsavedChanges=!0,m(M,`Unsaved changes`),p(M))}),k.addEventListener(`keydown`,e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),b(M))}),f.addEventListener(`change`,()=>{let e=f.value;f.value=M.docPath,_(M,`Open another doc?`,()=>{y(M,e)})}),g.addEventListener(`click`,()=>x(M,`edit`)),v.addEventListener(`click`,()=>x(M,`preview`)),C.addEventListener(`click`,()=>{_(M,`Reload this doc?`,()=>{y(M,M.docPath)})}),w.addEventListener(`click`,()=>{b(M)}),T.addEventListener(`click`,a),y(M,n.path),M.mode===`edit`&&k.focus()}function w(e){d&&d.sessionId===e&&(f(d),p(d),!s(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gt as e}from"./updates-view-core-D1HrhoS5.js";import{o as t}from"./dom-helpers-C7P3_59O.js";import{u as n}from"./control-ws-H2e01_5q.js";import{Cn as r,ai as i,i as a,oi as o,ta as s,wn as c}from"./index-
|
|
1
|
+
import{gt as e}from"./updates-view-core-D1HrhoS5.js";import{o as t}from"./dom-helpers-C7P3_59O.js";import{u as n}from"./control-ws-H2e01_5q.js";import{Cn as r,ai as i,i as a,oi as o,ta as s,wn as c}from"./index-Cb2I6OyB.js";var l={teamReview:e=>`${e} pull requests reviewed this week, and Reviews has not been open lately? It lines up every PR waiting on you.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them.`,usage:()=>`Keeping an eye on tokens? The Usage tab tracks spend per session and warns before a limit hits.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you.`,visions:()=>`Pointing agents at files in your editor? Visions reads your open editor and comments right on the code.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side.`},u=` It is off right now, so Show me takes you to its switch in Settings.`;function d(e,t){let n=l[e.feature](e.distinctTargetCount);return t?n:`${n}${u}`}function f(e){let t=a.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var p=null;function m(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function h(e){try{return c(localStorage,r(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function g(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=f(t);r&&n.openSetting(r.sectionId,r.settingId)}function _(e,n){if(p?.isConnected||!h(e))return;let r=t(`aside`,`feature-hint`);r.setAttribute(`aria-live`,`polite`),r.setAttribute(`aria-label`,`Feature tip`);let a=t(`div`,`feature-hint-bubble`),c=t(`button`,`btn-dialog btn-dialog-confirm`,`Show me`),l=t(`button`,`btn-dialog btn-dialog-cancel`,`Nah`);c.type=`button`,l.type=`button`;let u=t(`div`,`feature-hint-actions`);u.append(l,c),a.append(t(`p`,`feature-hint-text`,d(e,n.isFeatureEnabled(e.feature))),u);let f=o()??s[0];r.append(a,i(f,`feature-hint-animal`));function _(t){m(e.feature,t),r.remove(),p=null}c.addEventListener(`click`,()=>{_(`open`),g(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(r),p=r,m(e.feature,`shown`)}export{_ as showFeatureHint};
|
|
Binary file
|
package/dist/client/assets/{first-run-checklist-C_Ex4Uoj.js → first-run-checklist-DXRRzQlR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,y as t}from"./dom-helpers-C7P3_59O.js";import{d as n,u as r}from"./control-ws-H2e01_5q.js";import{Br as i,Lr as a,Rr as o,bn as s,cr as c,fr as l}from"./index-
|
|
1
|
+
import{o as e,y as t}from"./dom-helpers-C7P3_59O.js";import{d as n,u as r}from"./control-ws-H2e01_5q.js";import{Br as i,Lr as a,Rr as o,bn as s,cr as c,fr as l}from"./index-Cb2I6OyB.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./repo-roots-adder-Blxoifau.js";var v=`npm install -g @anthropic-ai/claude-code`,y={done:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Done"><circle cx="12" cy="12" r="10"></circle><path d="M7.5 12.5l3 3 6-6.5"></path></svg>`,current:`<svg width="18" height="18" viewBox="0 0 24 24" role="img" aria-label="Needed"><path d="M12 3l9 9-9 9-9-9z" fill="currentColor"></path></svg>`,upcoming:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" role="img" aria-label="Not started"><circle cx="12" cy="12" r="10"></circle></svg>`},b=null,x=null,S=null,C=null,w={steps:h,agentSummary:``,repoRoots:[]},T=0,E=!1,D=!1,O=new Set,k=o(`first-run-load-status`),A=s();function j(e){r({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`onboarding`,action:e}})}function M(e){for(let t of m(O,e))r({type:`dashboard-telemetry`,event:`onboarding_step`,properties:t})&&O.add(g(t))}function N({title:t,state:n,summary:r,badge:i,body:a}){let o=e(`li`,`first-run-step`);o.dataset.state=n,n===`current`&&o.setAttribute(`aria-current`,`step`);let s=e(`div`,`first-run-step-head`),c=e(`span`,`first-run-step-icon`);if(c.innerHTML=y[n],s.append(c,e(`span`,`first-run-step-title`,t)),n===`done`&&r&&s.append(e(`span`,`first-run-step-summary`,r)),n===`current`&&i&&s.append(e(`span`,`first-run-step-badge`,i)),o.append(s),n!==`current`)return o;let l=e(`div`,`first-run-step-body`);return l.append(...a()),o.append(l),o}function P(){return c()?`No supported agent is on PATH of the machine running Glimmervoid. Install Claude Code, Codex or Grok there, then rescan.`:`No supported agent is on PATH. Install Claude Code, Codex or Grok, then rescan.`}function F(){let n=e(`div`,`first-run-command-row`);if(n.append(e(`code`,`first-run-command`,v)),!navigator.clipboard?.writeText)return n;let r=e(`button`,`btn-dialog btn-dialog-cancel`,`Copy`);r.type=`button`;let i=e(`span`,`first-run-copy-status`);return i.setAttribute(`role`,`status`),r.addEventListener(`click`,async()=>{let e=t(v);i.textContent=e?await e.then(()=>`Copied`,()=>`Copy failed`):`Copy failed`}),n.append(r,i),n}function I(){let t=e(`div`,`first-run-step-actions`);S=e(`button`,`btn-dialog btn-dialog-cancel`,`Rescan`),S.type=`button`,S.addEventListener(`click`,()=>{j(`rescan`),B({rescanAgents:!0})}),t.append(S);let n=[e(`p`,`first-run-step-text`,P()),F(),t];return E?[...n,e(`p`,`first-run-step-hint`,`Still missing after a rescan? Restart Glimmervoid from a terminal where the command runs. Other terminal agents go under customAgents.`)]:n}function L(){let t=C??_({onAdded:e=>{j(e===`typed`?`add-root-typed`:`add-root-suggested`),B({rescanAgents:!1})}});return C=t,[e(`p`,`first-run-step-text`,`The folder that holds your git checkouts. Each subfolder becomes a project you can start a session in.`),t.element]}function R(){let t=e(`div`,`first-run-step-actions`),n=e(`button`,`btn-dialog btn-dialog-confirm`,`+ Session`);return n.type=`button`,n.addEventListener(`click`,()=>{j(`add-session`),l()}),t.append(n),[e(`p`,`first-run-step-text`,`Pick a project and an agent. The session runs in its own git worktree, so your checkout is never touched.`),t]}function z(){if(!x)return;let{steps:e,agentSummary:t,repoRoots:n}=w;x.replaceChildren(N({title:`1. Agent CLI`,state:e.agent,summary:t,badge:`MISSING`,body:I}),N({title:`2. Repository roots`,state:e.repoRoots,summary:n.join(`, `),badge:`NEEDED`,body:L}),N({title:`3. First session`,state:e.firstSession,summary:``,badge:``,body:R}))}async function B({rescanAgents:e}){T+=1;let t=T;S&&(S.disabled=!0);try{let[r,i]=await Promise.all([n(`list-agents`,e?{rescan:!0}:{},{timeoutMs:a}),n(`scan-repo-roots`,{includeSuggestions:!0},{timeoutMs:a})]);if(t!==T)return;let o=i.type===`repo-roots-scanned`,s=o?i.directories.map(e=>e.root):[],c=o?i.suggestions??[]:[],l=d(s,c);if(l.length>0&&!D){D=!0;let e=await p(l).catch(e=>String(e));if(t!==T)return;if(!e){B({rescanAgents:!1});return}}let m=u({agentListing:r,repoRoots:s});e&&(E=m.agent===`current`),w={steps:m,agentSummary:f(r),repoRoots:s},k.clear(),z(),M(w.steps),C?.setSuggestions(c)}catch(e){if(S&&(S.disabled=!1),t!==T)return;k.show(`error`,`The checklist could not load: ${i(e,a)} It loads again once the server answers. If it stays like this, check the terminal running Glimmervoid, or run glimmervoid doctor.`)}}function V(){if(b)return b;let t=e(`section`,`first-run-checklist`);t.setAttribute(`aria-labelledby`,`first-run-title`);let n=e(`h2`,`first-run-title`,`Get to your first session`);n.id=`first-run-title`,x=e(`ol`,`first-run-steps`);let r=e(`div`,`first-run-optional`);return r.append(e(`span`,`first-run-eyebrow`,`OPTIONAL`),A.element),t.append(e(`span`,`first-run-eyebrow`,`FIRST RUN`),n,x,k.element,r),b=t,z(),t}function H(e,t){if(!t){b?.parentElement===e&&!b.hidden&&(b.hidden=!0);return}let n=V(),r=!n.hidden&&n.parentElement===e;n.parentElement!==e&&e.append(n),n.hidden=!1,A.refresh(),r||B({rescanAgents:!1})}function U(){b&&!b.hidden&&b.isConnected&&B({rescanAgents:!1})}export{U as refreshFirstRunChecklist,H as showFirstRunChecklist};
|
|
Binary file
|