glimmervoid 0.46.2-next.196 → 0.46.2-next.197
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-BkzH4p-J.js → main-GdyUnH7l.js} +136 -94
- package/dist/client/assets/{alert-sound-BMJ32avL.js → alert-sound-DukgawED.js} +1 -1
- package/dist/client/assets/alert-sound-DukgawED.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-DuwChZkd.js → benchmark-panel-CKmp520P.js} +1 -1
- package/dist/client/assets/benchmark-panel-CKmp520P.js.br +0 -0
- package/dist/client/assets/{celebration-player-BQ3psRIL.js → celebration-player-DUpqy8a2.js} +1 -1
- package/dist/client/assets/celebration-player-DUpqy8a2.js.br +0 -0
- package/dist/client/assets/{community-panel-CBUYjzwo.js → community-panel-COyyVu8L.js} +1 -1
- package/dist/client/assets/community-panel-COyyVu8L.js.br +0 -0
- package/dist/client/assets/{dialogs-Cochotrf.js → dialogs-CizB03JW.js} +1 -1
- package/dist/client/assets/dialogs-CizB03JW.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-BL8T0J6b.js → doc-editor-ui-JRD44xX4.js} +1 -1
- package/dist/client/assets/doc-editor-ui-JRD44xX4.js.br +0 -0
- package/dist/client/assets/{feature-hint-DMKskeoV.js → feature-hint-DQq86c0V.js} +1 -1
- package/dist/client/assets/feature-hint-DQq86c0V.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-BDLuPDpP.js → first-run-checklist-Cw7EDT2O.js} +1 -1
- package/dist/client/assets/first-run-checklist-Cw7EDT2O.js.br +0 -0
- package/dist/client/assets/{hooks-panel-qaBBVoiG.js → hooks-panel-D_V7VvIo.js} +1 -1
- package/dist/client/assets/hooks-panel-D_V7VvIo.js.br +0 -0
- package/dist/client/assets/{index-CQ2WEnEd.js → index-vCVa1R-5.js} +5 -5
- package/dist/client/assets/index-vCVa1R-5.js.br +0 -0
- package/dist/client/assets/{issues-panel-rZ2itUrB.js → issues-panel-CfsCG19K.js} +1 -1
- package/dist/client/assets/issues-panel-CfsCG19K.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-BvIoi8Eg.js → my-prs-panel-DUM6NnBF.js} +1 -1
- package/dist/client/assets/my-prs-panel-DUM6NnBF.js.br +0 -0
- package/dist/client/assets/{nyan-cat-ChruuGpK.js → nyan-cat-0ScZnB_Z.js} +1 -1
- package/dist/client/assets/nyan-cat-0ScZnB_Z.js.br +0 -0
- package/dist/client/assets/{phone-shell-D8NZ_6Bw.js → phone-shell-B5GjXYNu.js} +1 -1
- package/dist/client/assets/phone-shell-B5GjXYNu.js.br +0 -0
- package/dist/client/assets/{plan-face-DkTs_-X9.js → plan-face-DnOFwXGN.js} +1 -1
- package/dist/client/assets/plan-face-DnOFwXGN.js.br +0 -0
- package/dist/client/assets/{plan-render-TF9Hl__r.js → plan-render-B2ZtlVAu.js} +1 -1
- package/dist/client/assets/plan-render-B2ZtlVAu.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-CQtcEkbg.js → pr-queue-columns-CAnPPfn8.js} +1 -1
- package/dist/client/assets/pr-queue-columns-CAnPPfn8.js.br +0 -0
- package/dist/client/assets/{radar-panel-Bw_uDWC9.js → radar-panel-R2AfWaTc.js} +1 -1
- package/dist/client/assets/radar-panel-R2AfWaTc.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-CVP7rBHB.js → repo-roots-adder-BVBmRRa_.js} +1 -1
- package/dist/client/assets/repo-roots-adder-BVBmRRa_.js.br +0 -0
- package/dist/client/assets/{resume-dialog-C6_q1zD4.js → resume-dialog-BDextQf_.js} +1 -1
- package/dist/client/assets/resume-dialog-BDextQf_.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-CvR_gZ9O.js → review-queue-panel-DOUFeWEY.js} +1 -1
- package/dist/client/assets/review-queue-panel-DOUFeWEY.js.br +0 -0
- package/dist/client/assets/{settings-panel-B50cGQ7H.js → settings-panel-CYMJkrhi.js} +2 -2
- package/dist/client/assets/settings-panel-CYMJkrhi.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-BK7r8EDy.js → shown-lightbox-J8Y1TFRc.js} +1 -1
- package/dist/client/assets/shown-lightbox-J8Y1TFRc.js.br +0 -0
- package/dist/client/assets/{team-review-panel-95hFsCxY.js → team-review-panel-BdZhpNwA.js} +1 -1
- package/dist/client/assets/team-review-panel-BdZhpNwA.js.br +0 -0
- package/dist/client/assets/{trace-panel-BpXuEzPg.js → trace-panel-Cnfu4iXJ.js} +1 -1
- package/dist/client/assets/trace-panel-Cnfu4iXJ.js.br +0 -0
- package/dist/client/assets/{usage-panel-DJgzE9RO.js → usage-panel-C0ebghX1.js} +1 -1
- package/dist/client/assets/usage-panel-C0ebghX1.js.br +0 -0
- package/dist/client/assets/{visions-panel-CHmDGBve.js → visions-panel-CAyAq9iC.js} +1 -1
- package/dist/client/assets/visions-panel-CAyAq9iC.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-BMJ32avL.js.br +0 -0
- package/dist/client/assets/benchmark-panel-DuwChZkd.js.br +0 -0
- package/dist/client/assets/celebration-player-BQ3psRIL.js.br +0 -0
- package/dist/client/assets/community-panel-CBUYjzwo.js.br +0 -0
- package/dist/client/assets/dialogs-Cochotrf.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-BL8T0J6b.js.br +0 -0
- package/dist/client/assets/feature-hint-DMKskeoV.js.br +0 -0
- package/dist/client/assets/first-run-checklist-BDLuPDpP.js.br +0 -0
- package/dist/client/assets/hooks-panel-qaBBVoiG.js.br +0 -0
- package/dist/client/assets/index-CQ2WEnEd.js.br +0 -0
- package/dist/client/assets/issues-panel-rZ2itUrB.js.br +0 -0
- package/dist/client/assets/my-prs-panel-BvIoi8Eg.js.br +0 -0
- package/dist/client/assets/nyan-cat-ChruuGpK.js.br +0 -0
- package/dist/client/assets/phone-shell-D8NZ_6Bw.js.br +0 -0
- package/dist/client/assets/plan-face-DkTs_-X9.js.br +0 -0
- package/dist/client/assets/plan-render-TF9Hl__r.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-CQtcEkbg.js.br +0 -0
- package/dist/client/assets/radar-panel-Bw_uDWC9.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-CVP7rBHB.js.br +0 -0
- package/dist/client/assets/resume-dialog-C6_q1zD4.js.br +0 -0
- package/dist/client/assets/review-queue-panel-CvR_gZ9O.js.br +0 -0
- package/dist/client/assets/settings-panel-B50cGQ7H.js.br +0 -0
- package/dist/client/assets/shown-lightbox-BK7r8EDy.js.br +0 -0
- package/dist/client/assets/team-review-panel-95hFsCxY.js.br +0 -0
- package/dist/client/assets/trace-panel-BpXuEzPg.js.br +0 -0
- package/dist/client/assets/usage-panel-DJgzE9RO.js.br +0 -0
- package/dist/client/assets/visions-panel-CHmDGBve.js.br +0 -0
|
@@ -39165,6 +39165,8 @@ var DISCORD_SNOWFLAKE_RE = /^\d{1,30}$/;
|
|
|
39165
39165
|
var DISCORD_CHANNEL_URL = "https://discord.com/channels/";
|
|
39166
39166
|
var DISCORD_AUTHOR = "Discord member";
|
|
39167
39167
|
var DISCORD_TITLE_CHARS = 120;
|
|
39168
|
+
var NOTIFICATION_TITLE_CHARS = 120;
|
|
39169
|
+
var NOTIFICATION_CATEGORY = "community";
|
|
39168
39170
|
var MAX_DISCORD_CHANNELS = 50;
|
|
39169
39171
|
var JUDGE_PROMPT_FILENAME = "judge-prompt.txt";
|
|
39170
39172
|
var JUDGE_RESULT_FILENAME = "judge-result.json";
|
|
@@ -39198,6 +39200,13 @@ function readPosthogConnection(config) {
|
|
|
39198
39200
|
apiKey
|
|
39199
39201
|
};
|
|
39200
39202
|
}
|
|
39203
|
+
function readTelegramTarget(config) {
|
|
39204
|
+
const block = recordOf(config.telegram);
|
|
39205
|
+
return {
|
|
39206
|
+
botToken: typeof block.botToken === "string" ? block.botToken : "",
|
|
39207
|
+
chatId: typeof block.chatId === "string" ? block.chatId : ""
|
|
39208
|
+
};
|
|
39209
|
+
}
|
|
39201
39210
|
function communityGate(config) {
|
|
39202
39211
|
if (!readCommunitySettings(config).enabled) return { start: false };
|
|
39203
39212
|
if (!readPosthogConnection(config)) return {
|
|
@@ -39402,6 +39411,13 @@ function parseJudgeResult(raw, candidateKeys) {
|
|
|
39402
39411
|
const candidates = new Set(candidateKeys);
|
|
39403
39412
|
return new Set(questions.filter((key) => typeof key === "string" && candidates.has(key)));
|
|
39404
39413
|
}
|
|
39414
|
+
function shouldNotifyDraft(finished) {
|
|
39415
|
+
return finished.status === "ready" && finished.verdict === "HIGH" && (finished.draft?.body.trim() ?? "") !== "";
|
|
39416
|
+
}
|
|
39417
|
+
function draftNotificationText(entry) {
|
|
39418
|
+
const title = entry.item.title.trim() || "Untitled question";
|
|
39419
|
+
return `High confidence community draft ready: ${title.length > NOTIFICATION_TITLE_CHARS ? `${title.slice(0, 117)}...` : title}`;
|
|
39420
|
+
}
|
|
39405
39421
|
function shouldPruneEntry(entry, nowMs, retentionMs = ENTRY_RETENTION_MS) {
|
|
39406
39422
|
if (entry.status === "queued" || entry.status === "running") return false;
|
|
39407
39423
|
const lastTouched = Date.parse(entry.finishedAt ?? entry.seenAt);
|
|
@@ -39649,7 +39665,7 @@ function parseCommunityState(raw, warn) {
|
|
|
39649
39665
|
}
|
|
39650
39666
|
//#endregion
|
|
39651
39667
|
//#region server/community/community-poller.ts
|
|
39652
|
-
function createCommunityPoller({ intervalMinutes, queryForum, discord = null, readState, writeState, runItem, maxConcurrentRuns = 1, onTickComplete = () => {}, firstTickDelayMs, now = Date.now, log = console }) {
|
|
39668
|
+
function createCommunityPoller({ intervalMinutes, queryForum, discord = null, readState, writeState, runItem, maxConcurrentRuns = 1, onTickComplete = () => {}, onDraftReady = () => {}, firstTickDelayMs, now = Date.now, log = console }) {
|
|
39653
39669
|
let state = emptyCommunityState();
|
|
39654
39670
|
const runAborts = /* @__PURE__ */ new Map();
|
|
39655
39671
|
const loop = createTickLoop({
|
|
@@ -39722,6 +39738,7 @@ function createCommunityPoller({ intervalMinutes, queryForum, discord = null, re
|
|
|
39722
39738
|
const finished = entryFromRun(entry, run, new Date(now()).toISOString());
|
|
39723
39739
|
if (finished.warning) log.warn(`[${COMMUNITY_LANE_ID}] ${finished.warning}`);
|
|
39724
39740
|
replaceEntry(finished.entry);
|
|
39741
|
+
if (shouldNotifyDraft(finished.entry)) onDraftReady(finished.entry);
|
|
39725
39742
|
dispatchRuns();
|
|
39726
39743
|
await loop.persist();
|
|
39727
39744
|
publishStatus(null);
|
|
@@ -39838,6 +39855,98 @@ function createCommunityJudge(spawn, shutdownSignal) {
|
|
|
39838
39855
|
};
|
|
39839
39856
|
}
|
|
39840
39857
|
//#endregion
|
|
39858
|
+
//#region server/core/client-presence.ts
|
|
39859
|
+
function decideFocusSuppression(focusStates) {
|
|
39860
|
+
if (!Array.isArray(focusStates) || focusStates.length === 0) return false;
|
|
39861
|
+
return focusStates.every(Boolean);
|
|
39862
|
+
}
|
|
39863
|
+
function decideOffDashboardDelivery(connectionCount) {
|
|
39864
|
+
return connectionCount === 0;
|
|
39865
|
+
}
|
|
39866
|
+
function createClientPresence() {
|
|
39867
|
+
const focusedByConnection = /* @__PURE__ */ new Map();
|
|
39868
|
+
function connect(key) {
|
|
39869
|
+
if (focusedByConnection.has(key)) return;
|
|
39870
|
+
focusedByConnection.set(key, false);
|
|
39871
|
+
}
|
|
39872
|
+
function disconnect(key) {
|
|
39873
|
+
focusedByConnection.delete(key);
|
|
39874
|
+
}
|
|
39875
|
+
function setFocus(key, focused) {
|
|
39876
|
+
focusedByConnection.set(key, !!focused);
|
|
39877
|
+
}
|
|
39878
|
+
return {
|
|
39879
|
+
connect,
|
|
39880
|
+
disconnect,
|
|
39881
|
+
setFocus,
|
|
39882
|
+
connectionCount: () => focusedByConnection.size,
|
|
39883
|
+
shouldSuppress: () => decideFocusSuppression([...focusedByConnection.values()])
|
|
39884
|
+
};
|
|
39885
|
+
}
|
|
39886
|
+
//#endregion
|
|
39887
|
+
//#region notifications/channels/telegram.ts
|
|
39888
|
+
function decideTelegramNotification({ enabled, botToken, chatId, connectionCount, phoneEscalation = false, category = null, activeAgents = 0 }) {
|
|
39889
|
+
if (enabled !== true) return {
|
|
39890
|
+
send: false,
|
|
39891
|
+
reason: "disabled"
|
|
39892
|
+
};
|
|
39893
|
+
if (!botToken || !chatId) return {
|
|
39894
|
+
send: false,
|
|
39895
|
+
reason: "not-configured"
|
|
39896
|
+
};
|
|
39897
|
+
if (category === "complete" && activeAgents > 0) return {
|
|
39898
|
+
send: false,
|
|
39899
|
+
reason: "active-agents"
|
|
39900
|
+
};
|
|
39901
|
+
if (phoneEscalation === true) return {
|
|
39902
|
+
send: true,
|
|
39903
|
+
reason: "unacknowledged-escalation"
|
|
39904
|
+
};
|
|
39905
|
+
if (!decideOffDashboardDelivery(connectionCount)) return {
|
|
39906
|
+
send: false,
|
|
39907
|
+
reason: "dashboard-open"
|
|
39908
|
+
};
|
|
39909
|
+
return {
|
|
39910
|
+
send: true,
|
|
39911
|
+
reason: "no-dashboard-audience"
|
|
39912
|
+
};
|
|
39913
|
+
}
|
|
39914
|
+
function formatTelegramText(sessionName, message) {
|
|
39915
|
+
return message || `${sessionName} needs attention`;
|
|
39916
|
+
}
|
|
39917
|
+
function createTelegramChannel({ getConfig, getConnectionCount, getActiveAgentCount = () => 0, getSessionName = () => void 0, outbox = null, send = sendTelegramMessage }) {
|
|
39918
|
+
return function telegramChannel(sessionId, category, message, context) {
|
|
39919
|
+
const config = getConfig() || {};
|
|
39920
|
+
const telegram = config.telegram || {};
|
|
39921
|
+
const botToken = telegram.botToken;
|
|
39922
|
+
const chatId = telegram.chatId;
|
|
39923
|
+
const activeAgents = category === "complete" ? getActiveAgentCount(sessionId) : 0;
|
|
39924
|
+
const decision = decideTelegramNotification({
|
|
39925
|
+
enabled: config.telegramNotifications === true,
|
|
39926
|
+
botToken,
|
|
39927
|
+
chatId,
|
|
39928
|
+
connectionCount: getConnectionCount(),
|
|
39929
|
+
phoneEscalation: context?.phoneEscalation === true,
|
|
39930
|
+
category,
|
|
39931
|
+
activeAgents
|
|
39932
|
+
});
|
|
39933
|
+
if (!decision.send) return decision;
|
|
39934
|
+
if (!botToken || !chatId) return decision;
|
|
39935
|
+
const text = formatTelegramText(getSessionName(sessionId) || sessionId, message);
|
|
39936
|
+
if (outbox) {
|
|
39937
|
+
outbox.deliver(text);
|
|
39938
|
+
return decision;
|
|
39939
|
+
}
|
|
39940
|
+
send({
|
|
39941
|
+
botToken,
|
|
39942
|
+
chatId,
|
|
39943
|
+
text,
|
|
39944
|
+
tag: "channel:telegram"
|
|
39945
|
+
});
|
|
39946
|
+
return decision;
|
|
39947
|
+
};
|
|
39948
|
+
}
|
|
39949
|
+
//#endregion
|
|
39841
39950
|
//#region server/community/community-wiring.ts
|
|
39842
39951
|
var COMMUNITY_WORK_DIRNAME = "community-work";
|
|
39843
39952
|
var RESULT_MAX_BYTES = 1048576;
|
|
@@ -40044,13 +40153,36 @@ function createDiscordSource(api, settings, spawnDependencies) {
|
|
|
40044
40153
|
judgeQuestions: createCommunityJudge(judgeSpawn)
|
|
40045
40154
|
};
|
|
40046
40155
|
}
|
|
40047
|
-
function createCommunityWiring({ config, broadcast = () => {}, homeDir = glimmervoidHomeDir$1(), createApi = (connection) => createPosthogApi(connection), spawnDependencies = null, log = console }) {
|
|
40156
|
+
function createCommunityWiring({ config, broadcast = () => {}, homeDir = glimmervoidHomeDir$1(), createApi = (connection) => createPosthogApi(connection), spawnDependencies = null, controlClientCount = () => 0, sendTelegram = sendTelegramMessage, log = console }) {
|
|
40048
40157
|
const stateIo = createCommunityStateIo(path.join(homeDir, COMMUNITY_STATE_FILENAME), log);
|
|
40049
40158
|
const runItem = spawnDependencies ? createCommunityRunner({
|
|
40050
40159
|
spawnDependencies,
|
|
40051
40160
|
homeDir,
|
|
40052
40161
|
getSettings: () => readCommunitySettings(config)
|
|
40053
40162
|
}) : void 0;
|
|
40163
|
+
function notifyDraftReady(entry) {
|
|
40164
|
+
const message = draftNotificationText(entry);
|
|
40165
|
+
broadcast({
|
|
40166
|
+
type: "notify",
|
|
40167
|
+
session: entry.item.key,
|
|
40168
|
+
category: NOTIFICATION_CATEGORY,
|
|
40169
|
+
message,
|
|
40170
|
+
escalationCount: 0
|
|
40171
|
+
});
|
|
40172
|
+
const { botToken, chatId } = readTelegramTarget(config);
|
|
40173
|
+
if (!decideTelegramNotification({
|
|
40174
|
+
enabled: config.telegramNotifications === true,
|
|
40175
|
+
botToken,
|
|
40176
|
+
chatId,
|
|
40177
|
+
connectionCount: controlClientCount()
|
|
40178
|
+
}).send) return;
|
|
40179
|
+
sendTelegram({
|
|
40180
|
+
botToken,
|
|
40181
|
+
chatId,
|
|
40182
|
+
text: message,
|
|
40183
|
+
tag: COMMUNITY_LANE_ID
|
|
40184
|
+
});
|
|
40185
|
+
}
|
|
40054
40186
|
const runner = createLaneRunner({
|
|
40055
40187
|
tag: COMMUNITY_LANE_ID,
|
|
40056
40188
|
gate: () => communityGate(config),
|
|
@@ -40076,6 +40208,7 @@ function createCommunityWiring({ config, broadcast = () => {}, homeDir = glimmer
|
|
|
40076
40208
|
writeState: stateIo.writeState,
|
|
40077
40209
|
runItem,
|
|
40078
40210
|
onTickComplete,
|
|
40211
|
+
onDraftReady: notifyDraftReady,
|
|
40079
40212
|
firstTickDelayMs: bootStaggerDelay,
|
|
40080
40213
|
log
|
|
40081
40214
|
});
|
|
@@ -42864,98 +42997,6 @@ function createGithubStatus({ fetchFn = fetch, now = Date.now, log }) {
|
|
|
42864
42997
|
};
|
|
42865
42998
|
}
|
|
42866
42999
|
//#endregion
|
|
42867
|
-
//#region server/core/client-presence.ts
|
|
42868
|
-
function decideFocusSuppression(focusStates) {
|
|
42869
|
-
if (!Array.isArray(focusStates) || focusStates.length === 0) return false;
|
|
42870
|
-
return focusStates.every(Boolean);
|
|
42871
|
-
}
|
|
42872
|
-
function decideOffDashboardDelivery(connectionCount) {
|
|
42873
|
-
return connectionCount === 0;
|
|
42874
|
-
}
|
|
42875
|
-
function createClientPresence() {
|
|
42876
|
-
const focusedByConnection = /* @__PURE__ */ new Map();
|
|
42877
|
-
function connect(key) {
|
|
42878
|
-
if (focusedByConnection.has(key)) return;
|
|
42879
|
-
focusedByConnection.set(key, false);
|
|
42880
|
-
}
|
|
42881
|
-
function disconnect(key) {
|
|
42882
|
-
focusedByConnection.delete(key);
|
|
42883
|
-
}
|
|
42884
|
-
function setFocus(key, focused) {
|
|
42885
|
-
focusedByConnection.set(key, !!focused);
|
|
42886
|
-
}
|
|
42887
|
-
return {
|
|
42888
|
-
connect,
|
|
42889
|
-
disconnect,
|
|
42890
|
-
setFocus,
|
|
42891
|
-
connectionCount: () => focusedByConnection.size,
|
|
42892
|
-
shouldSuppress: () => decideFocusSuppression([...focusedByConnection.values()])
|
|
42893
|
-
};
|
|
42894
|
-
}
|
|
42895
|
-
//#endregion
|
|
42896
|
-
//#region notifications/channels/telegram.ts
|
|
42897
|
-
function decideTelegramNotification({ enabled, botToken, chatId, connectionCount, phoneEscalation = false, category = null, activeAgents = 0 }) {
|
|
42898
|
-
if (enabled !== true) return {
|
|
42899
|
-
send: false,
|
|
42900
|
-
reason: "disabled"
|
|
42901
|
-
};
|
|
42902
|
-
if (!botToken || !chatId) return {
|
|
42903
|
-
send: false,
|
|
42904
|
-
reason: "not-configured"
|
|
42905
|
-
};
|
|
42906
|
-
if (category === "complete" && activeAgents > 0) return {
|
|
42907
|
-
send: false,
|
|
42908
|
-
reason: "active-agents"
|
|
42909
|
-
};
|
|
42910
|
-
if (phoneEscalation === true) return {
|
|
42911
|
-
send: true,
|
|
42912
|
-
reason: "unacknowledged-escalation"
|
|
42913
|
-
};
|
|
42914
|
-
if (!decideOffDashboardDelivery(connectionCount)) return {
|
|
42915
|
-
send: false,
|
|
42916
|
-
reason: "dashboard-open"
|
|
42917
|
-
};
|
|
42918
|
-
return {
|
|
42919
|
-
send: true,
|
|
42920
|
-
reason: "no-dashboard-audience"
|
|
42921
|
-
};
|
|
42922
|
-
}
|
|
42923
|
-
function formatTelegramText(sessionName, message) {
|
|
42924
|
-
return message || `${sessionName} needs attention`;
|
|
42925
|
-
}
|
|
42926
|
-
function createTelegramChannel({ getConfig, getConnectionCount, getActiveAgentCount = () => 0, getSessionName = () => void 0, outbox = null, send = sendTelegramMessage }) {
|
|
42927
|
-
return function telegramChannel(sessionId, category, message, context) {
|
|
42928
|
-
const config = getConfig() || {};
|
|
42929
|
-
const telegram = config.telegram || {};
|
|
42930
|
-
const botToken = telegram.botToken;
|
|
42931
|
-
const chatId = telegram.chatId;
|
|
42932
|
-
const activeAgents = category === "complete" ? getActiveAgentCount(sessionId) : 0;
|
|
42933
|
-
const decision = decideTelegramNotification({
|
|
42934
|
-
enabled: config.telegramNotifications === true,
|
|
42935
|
-
botToken,
|
|
42936
|
-
chatId,
|
|
42937
|
-
connectionCount: getConnectionCount(),
|
|
42938
|
-
phoneEscalation: context?.phoneEscalation === true,
|
|
42939
|
-
category,
|
|
42940
|
-
activeAgents
|
|
42941
|
-
});
|
|
42942
|
-
if (!decision.send) return decision;
|
|
42943
|
-
if (!botToken || !chatId) return decision;
|
|
42944
|
-
const text = formatTelegramText(getSessionName(sessionId) || sessionId, message);
|
|
42945
|
-
if (outbox) {
|
|
42946
|
-
outbox.deliver(text);
|
|
42947
|
-
return decision;
|
|
42948
|
-
}
|
|
42949
|
-
send({
|
|
42950
|
-
botToken,
|
|
42951
|
-
chatId,
|
|
42952
|
-
text,
|
|
42953
|
-
tag: "channel:telegram"
|
|
42954
|
-
});
|
|
42955
|
-
return decision;
|
|
42956
|
-
};
|
|
42957
|
-
}
|
|
42958
|
-
//#endregion
|
|
42959
43000
|
//#region server/usage/core/usage-budget-core.ts
|
|
42960
43001
|
var BUDGET_THRESHOLDS = Object.freeze([
|
|
42961
43002
|
50,
|
|
@@ -48547,6 +48588,7 @@ function createBackendLanes(dependencies) {
|
|
|
48547
48588
|
broadcast: broadcastControl,
|
|
48548
48589
|
homeDir: glimmervoidHomeDir$1(),
|
|
48549
48590
|
log: logger,
|
|
48591
|
+
controlClientCount: () => controlWss.clients.size,
|
|
48550
48592
|
spawnDependencies: {
|
|
48551
48593
|
investigationSessions,
|
|
48552
48594
|
closeSessionDataClients,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$i as e,Qi as t,Xi as n,Zi as r,ea as i,na as a,ra as o,ta as s}from"./index-
|
|
1
|
+
import{$i as e,Qi as t,Xi as n,Zi as r,ea as i,na as a,ra as o,ta as s}from"./index-vCVa1R-5.js";var c=.3,l=null;function u(){return o(l)}function d(e){return a(e,l)}async function f(){try{let e=await fetch(n,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=s(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(e){g(t[e]??t.chime)}function g(e){let t=p(),n=t.createGain();n.gain.value=e.peakGain,n.connect(t.destination);let r=t.currentTime,i=0;for(let a of e.tones){let e=r+a.startSeconds,o=e+a.durationSeconds,s=t.createOscillator(),c=t.createGain();s.type=a.waveform,s.frequency.setValueAtTime(a.frequency,e),a.endFrequency&&s.frequency.exponentialRampToValueAtTime(a.endFrequency,o),c.gain.setValueAtTime(.001,e),c.gain.exponentialRampToValueAtTime(a.gain??1,e+.01),c.gain.exponentialRampToValueAtTime(.001,o),s.connect(c),c.connect(n),s.start(e),s.stop(o),i=Math.max(i,a.startSeconds+a.durationSeconds)}m(t,i)}async function _(e){try{let t=await fetch(i(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(r)}catch{}}function S(t){try{let n=d(t),r=e(n);if(!r){h(n);return}v(r).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-CqTQW6Ft.js";import{n as e,o as t,r as n}from"./dom-helpers-ScgOMqDW.js";import{J as r,Y as i,q as a}from"./index-
|
|
1
|
+
import"./updates-view-core-CqTQW6Ft.js";import{n as e,o as t,r as n}from"./dom-helpers-ScgOMqDW.js";import{J as r,Y as i,q as a}from"./index-vCVa1R-5.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-BQ3psRIL.js → celebration-player-DUpqy8a2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,o as t,s as n}from"./dom-helpers-ScgOMqDW.js";import{Di as r,la as i}from"./index-CQ2WEnEd.js";import{playToneSequence as a}from"./alert-sound-BMJ32avL.js";var o=1.2,s=1.55,c=.12,l=523.25,u=2,d=8,f=(e,t,n)=>({semitone:e,startBeat:t,beats:n}),p={melody:[f(7,4,.5),f(11,4.5,.5),f(12,5,3)],bass:[f(-5,4,1),f(-12,5,3)]},m=[{melody:[f(0,0,1),f(4,1,1),f(7,2,1),f(9,3,1)],bass:[f(-12,0,2),f(-8,2,2)]},{melody:[f(7,0,.67),f(7,.67,.67),f(7,1.33,.67),f(9,2,1),f(5,3,1)],bass:[f(-12,0,2),f(-7,2,2)]},{melody:[f(5,0,1),f(9,1,1),f(7,2,1),f(4,3,1)],bass:[f(-7,0,2),f(-12,2,2)]},{melody:[f(12,0,.5),f(7,.5,.5),f(12,1,.5),f(16,1.5,.5),f(16,2,1),f(14,3,1)],bass:[f(-12,0,2),f(-3,2,2)]},{melody:[f(4,0,1),f(7,1,1),f(4,2,.5),f(5,2.5,.5),f(7,3,.5),f(4,3.5,.5)],bass:[f(-8,0,2),f(-12,2,2)]}].map(e=>({melody:[...e.melody,...p.melody],bass:[...e.bass,...p.bass]}));function h(e,t){return l*2**((e+t)/12)}function g(e,t){let n=(e,n,r)=>e.map(e=>({frequency:h(e.semitone,t),startSeconds:s+e.startBeat*c,durationSeconds:e.beats*c,waveform:n,gain:r}));return[...n(e.melody,`square`,.2),...n(e.melody,`triangle`,.5),...n(e.bass,`triangle`,.6)]}var ee=[{frequency:220,endFrequency:880,startSeconds:0,durationSeconds:.32,waveform:`triangle`,gain:.25},{frequency:160,endFrequency:45,startSeconds:o,durationSeconds:.28,waveform:`sine`,gain:1},{frequency:1400,endFrequency:380,startSeconds:o,durationSeconds:.06,waveform:`square`,gain:.12}];function te(e){let t=m[e%m.length],n=Math.min(e*u,d);return{peakGain:.1,tones:[...ee,...g(t,n)]}}function _(e){return Math.round(Math.sqrt(2*e/780)*1e3)}function v(e,t,n=Math.random){return Math.round(e+n()*(t-e))}function y(e,t=Math.random){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}var ne=.6,re=.25,ie=1.6;function ae(e){return Math.min(ne+e*re,ie)}var b=[`var(--accent)`,`var(--state-running)`,`var(--state-idle)`,`var(--state-waiting)`,`var(--state-failed)`];function oe(e,t=Math.random){let n=v(320,520,t),r=v(1800,2800,t);return[[`--confetti-start-x`,`${v(4,96,t)}%`],[`--confetti-x`,`${v(-140,140,t)}px`],[`--confetti-rise`,`${-v(20,55,t)}px`],[`--confetti-fall`,`${v(45,70,t)}vh`],[`--confetti-rise-ms`,`${n}ms`],[`--confetti-fall-ms`,`${r}ms`],[`--confetti-flight-ms`,`${n+r}ms`],[`--confetti-tilt`,`${v(0,180,t)}deg`],[`--confetti-spin`,`${v(-360,360,t)}deg`],[`--confetti-flutter-ms`,`${v(160,340,t)}ms`],[`--confetti-delay`,`${v(0,160,t)}ms`],[`--confetti-color`,b[e%b.length]]]}var se=`<svg viewBox="0 0 36 36" aria-hidden="true"><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="17"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="13"/><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="9"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="5"/></svg>`,ce=`<svg viewBox="0 0 26 8" aria-hidden="true"><path class="merge-bullseye-dart-flight" d="M0 0L7 3V5L0 8L2 4Z"/><rect class="merge-bullseye-dart-shaft" x="6" y="3.3" width="8" height="1.4"/><rect class="merge-bullseye-dart-barrel" x="13" y="2.5" width="7" height="3" rx="1"/><path class="merge-bullseye-dart-tip" d="M20 3L26 4L20 5Z"/></svg>`;function le(){let e=n(`div`,`merge-bullseye-target`,se);return e.append(t(`span`,`merge-bullseye-ripple`)),e}function ue(){let e=t(`div`,`merge-bullseye-dart-drift`),r=t(`div`,`merge-bullseye-dart-arc`),i=t(`div`,`merge-bullseye-dart-aim`);return i.append(n(`div`,`merge-bullseye-dart`,ce)),r.append(i),e.append(r),e}function de(){let e=t(`div`,`merge-bullseye-range`),n=t(`div`,`merge-bullseye-track`);return n.append(ue()),e.append(le(),n),e}var fe={title:`BULLSEYE!`,buildScene:de},pe=6,x=30,S=-14,C=16;function w(e=Math.random){return[[`--crosshair-start-left`,`${v(pe,x,e)}%`],[`--crosshair-start-offset-y`,`${v(S,C,e)}px`]]}var T=`<svg viewBox="0 0 26 40" aria-hidden="true"><path class="merge-headshot-target-body" d="M9 13H17L18 16Q25 18 25 24V40H1V24Q1 18 8 16Z"/><circle class="merge-headshot-target-head" cx="13" cy="7" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="7" r="3"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="2.5"/></svg>`,E=`<svg viewBox="0 0 22 22" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M11 0V5M11 17V22M0 11H5M17 11H22"/><circle class="merge-headshot-crosshair-dot" cx="11" cy="11" r="1"/></svg>`,D=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 3L8 8M21 3L16 8M3 21L8 16M21 21L16 16"/></svg>`;function O(){let r=t(`div`,`merge-headshot-sweep`);e(r,w());let i=t(`div`,`merge-headshot-aim`);i.append(n(`div`,`merge-headshot-crosshair`,E));let a=t(`div`,`merge-headshot-bob`);return a.append(i,n(`div`,`merge-headshot-hitmarker`,D)),r.append(a),r}function k(){let e=t(`div`,`merge-headshot-range`),r=t(`div`,`merge-headshot-track`);return r.append(O()),e.append(n(`div`,`merge-headshot-target`,T),r),e}var A={title:`HEADSHOT!`,buildScene:k},j=[`10`,`J`,`Q`,`K`,`A`],M=160,N=19,P=5,F=9,I=780,L=70,R=70,z=35;function B(e){let t=j.length-1,n=e-t/2;return{offsetPx:n*N,titleSpreadFraction:n/t,tiltDegrees:n*P,bottomPx:F-n**2,dealLeadMs:I-e*L,flipLeadMs:M+(t-e)*R,waveDelayMs:e*z}}function me(e){return[[`--card-offset`,`${e.offsetPx}px`],[`--card-title-spread`,String(e.titleSpreadFraction)],[`--card-tilt`,`${e.tiltDegrees}deg`],[`--card-bottom`,`${e.bottomPx}px`],[`--card-deal-lead-ms`,`${e.dealLeadMs}ms`],[`--card-flip-lead-ms`,`${e.flipLeadMs}ms`],[`--card-wave-delay-ms`,`${e.waveDelayMs}ms`]]}function he(){return[[`--card-flip-ms`,`${M}ms`]]}var ge=`<svg viewBox="0 0 10 9" aria-hidden="true"><path d="M5 8.5C5 8.5 0 5.3 0 2.6C0 1.1 1.2 0 2.6 0C3.6 0 4.5 .6 5 1.4C5.5 .6 6.4 0 7.4 0C8.8 0 10 1.1 10 2.6C10 5.3 5 8.5 5 8.5Z"/></svg>`;function _e(n,r){let i=t(`div`,`merge-flush-deal`);e(i,me(B(r)));let a=t(`div`,`merge-flush-hop`),o=t(`div`,`merge-flush-card`),s=t(`div`,`merge-flush-face`);return s.append(t(`span`,`merge-flush-rank`,n)),s.insertAdjacentHTML(`beforeend`,ge),o.append(t(`div`,`merge-flush-back`),s),a.append(o),i.append(a),i}function ve(){let n=t(`div`,`merge-flush-table`);return e(n,he()),n.append(...j.map(_e)),n}var ye={title:`ROYAL FLUSH!`,buildScene:ve},be=[1,2,3,4],xe=14,Se=3,Ce=3,V=10,we=20,Te=2,H=28,U=18,Ee=.01,De=1.5,Oe=2200,ke=1,W=120,G=.35,Ae=15,je=105,Me=4,Ne=65,Pe=145;function Fe(e){return Math.round(e/(Math.PI*U)*360)}function K(e){return we-e*Te}function q(e){return e.rowIndex*xe+e.depthIndex*Se}function J(e,t,n){return Array.from({length:n},(r,i)=>e+(t-e)*i/(n-1))}function Y(){return be.flatMap((e,t)=>Array.from({length:e},(n,r)=>({rowIndex:t,depthIndex:e-1-r})))}function Ie(e,t){let n=y(J(Ae,je,e),t),r=y(J(Ne,Pe,e),t);return n.map((e,n)=>({angleDegrees:e+v(-4,Me,t),depthScalePercent:Math.round(r[n])}))}function Le(e,t,n){let r=v(240,380,n),i=t.angleDegrees*Math.PI/180,a=r*Math.cos(i),o=(r*Math.sin(i))**2/1560,s=v(15,45,n),c=_(o),l=_(o+s),u=c+l,d=v(540,1080,n),f=a>=0?1:-1,p=q(e);return{depthIndex:e.depthIndex,launchAngleDegrees:t.angleDegrees,distanceFromHeadPinPx:p,layer:K(e.depthIndex),flyXPx:Math.round(a*u/1e3),peakRisePx:Math.round(o),landingDropPx:s,riseMs:c,fallMs:l,flightMs:u,spinDegrees:Math.round(f*d*u/1e3),glintMs:Math.round(180/d*1e3),depthScalePercent:t.depthScalePercent,delayMs:Math.round(p/G)}}function Re(e=Math.random){let t=Y(),n=Ie(t.length,e);return t.map((t,r)=>Le(t,n[r],e))}function ze(e){return[[`--pin-left`,`${e.distanceFromHeadPinPx}px`],[`--pin-raise`,`${e.depthIndex*Ce}px`],[`--pin-shade`,`${100-e.depthIndex*12}%`],[`--pin-fly-x`,`${e.flyXPx}px`],[`--pin-peak-y`,`${-e.peakRisePx}px`],[`--pin-land-y`,`${e.landingDropPx}px`],[`--pin-rise-ms`,`${e.riseMs}ms`],[`--pin-fall-ms`,`${e.fallMs}ms`],[`--pin-flight-ms`,`${e.flightMs}ms`],[`--pin-spin`,`${e.spinDegrees}deg`],[`--pin-glint-ms`,`${e.glintMs}ms`],[`--pin-depth-scale`,`${e.depthScalePercent}%`],[`--pin-depth-shade`,`${e.depthScalePercent-10}%`],[`--pin-delay`,`${e.delayMs}ms`],[`--pin-layer`,String(e.layer)]]}function Be(){return K(De)}function Ve(){return Math.max(...Y().map(q))+V}function He(){let e=Ve(),t=H+e+U-ke;return[[`--ball-follow-px`,`${W}px`],[`--ball-follow-ms`,`${Math.round(W/G)}ms`],[`--ball-follow-spin`,`${Fe(W)}deg`],[`--ball-size`,`${U}px`],[`--ball-approach-spin`,`${Oe}deg`],[`--ball-impact-inset`,`${t}px`],[`--ball-layer`,String(Be())],[`--rack-right`,`${H}px`],[`--rack-width`,`${e}px`],[`--pin-width`,`${V}px`]]}function Ue(e=Math.random){return e()>=Ee?null:i[Math.floor(e()*i.length)].sprite}var We=`<svg viewBox="0 0 10 24" aria-hidden="true"><path class="merge-strike-pin-body" d="M5 0C7 0 7.6 2 7.2 4C6.9 5.6 6.3 6.6 6.4 8C6.6 10 9.6 12 9.6 16C9.6 19.5 8.4 22 7.6 24H2.4C1.6 22 .4 19.5 .4 16C.4 12 3.4 10 3.6 8C3.7 6.6 3.1 5.6 2.8 4C2.4 2 3 0 5 0Z"/><path class="merge-strike-pin-stripe" d="M3.1 5.2H6.9V6.2H3.1ZM3.4 7H6.6V8H3.4Z"/></svg>`;function Ge(r){let i=t(`span`,`merge-strike-pin`);return i.append(n(`span`,`merge-strike-pin-arc`,We)),e(i,ze(r)),i}function Ke(){let e=Ue();if(!e)return t(`span`,`merge-strike-ball`);let n=t(`span`,`merge-strike-ball is-animal`);return n.append(t(`span`,`nyan-sprite ${e}`)),n}function qe(){let n=t(`div`,`merge-strike-lane`);e(n,He());let r=t(`div`,`merge-strike-rack`);r.append(...Re().map(Ge));let i=t(`div`,`merge-strike-track`);return i.append(Ke()),n.append(r,i),n}var Je={title:`STRIKE!`,buildScene:qe},Ye=20,Xe=92,Ze=23,Qe=7,$e=-40;function et(){let e=_(72),t=_(69),n=780*t/1e3;return{launchHeightPx:Ye,peakHeightPx:Xe,heightThroughRimPx:Ze,heightLeavingNetPx:Qe,heightOutOfCardPx:$e,riseMs:e,fallToRimMs:t,speedThroughRimPxPerSecond:n,netCatchMs:Math.round(32/n*1e3),dropMs:_(47)}}function tt(e=et()){return[[`--ball-launch-y`,`${-e.launchHeightPx}px`],[`--ball-peak-y`,`${-e.peakHeightPx}px`],[`--ball-rim-y`,`${-e.heightThroughRimPx}px`],[`--ball-net-exit-y`,`${-e.heightLeavingNetPx}px`],[`--ball-drop-out-y`,`${-e.heightOutOfCardPx}px`],[`--ball-rise-ms`,`${e.riseMs}ms`],[`--ball-fall-to-rim-ms`,`${e.fallToRimMs}ms`],[`--ball-to-rim-ms`,`${e.riseMs+e.fallToRimMs}ms`],[`--ball-net-catch-ms`,`${e.netCatchMs}ms`],[`--ball-drop-ms`,`${e.dropMs}ms`]]}var nt=`<svg viewBox="0 0 40 48" aria-hidden="true"><rect class="merge-swish-pole" x="36" y="28" width="2" height="20"/><rect class="merge-swish-backboard" x="35" y="2" width="3" height="26" rx="1"/><path class="merge-swish-rim" d="M31 18H35M7 18A12 2.5 0 0 1 31 18"/></svg>`,rt=`<svg viewBox="0 0 40 48" aria-hidden="true"><g class="merge-swish-net"><path d="M8 18L12 32M13.5 18L15.5 32M19 18V32M24.5 18L22.5 32M30 18L26 32M9.5 23Q19 25 28.5 23M11 28Q19 29.5 27 28"/></g><path class="merge-swish-rim" d="M7 18A12 2.5 0 0 0 31 18"/></svg>`;function it(){let e=t(`div`,`merge-swish-ball-drift`),n=t(`div`,`merge-swish-ball-arc`);return n.append(t(`span`,`merge-swish-ball`)),e.append(n),e}function X(){let r=t(`div`,`merge-swish-court`);e(r,tt());let i=t(`div`,`merge-swish-track`);return i.append(it()),r.append(n(`div`,`merge-swish-hoop-back`,nt),i,n(`div`,`merge-swish-hoop-front`,rt)),r}var Z=[Je,{title:`SWISH!`,buildScene:X},fe,A,ye],at=48,Q=5600,$=null;function ot(n){let r=t(`span`,`merge-confetti-piece`),i=t(`span`,`merge-confetti-arc`);return i.append(t(`span`,`merge-confetti-paper`)),r.append(i),e(r,oe(n)),r}function st(e){let n=t(`p`,`merge-celebration-title`);return n.setAttribute(`aria-hidden`,`true`),Array.from(e).forEach((e,r)=>{let i=t(`span`,`merge-celebration-letter`,e);i.style.setProperty(`--letter-delay`,`${r*45}ms`),n.append(i)}),n}function ct(e,t,n){let r=t.firstElementChild,i=t.lastElementChild;r instanceof HTMLElement&&i instanceof HTMLElement&&(e.style.setProperty(`--celebration-title-width`,`${i.offsetLeft+i.offsetWidth-r.offsetLeft}px`),e.style.setProperty(`--celebration-title-center-y`,`${t.offsetTop+t.offsetHeight/2-n.offsetTop}px`))}function lt(e){let n=t(`div`,`merge-celebration-scene`);return n.setAttribute(`aria-hidden`,`true`),n.append(e.buildScene()),n}function ut(){return Z[Math.floor(Math.random()*Z.length)]}function dt(e){if(r())try{a(te(e))}catch{}}function ft(e){let n=t(`ul`,`merge-celebration-details`);for(let r of e)n.append(t(`li`,`merge-celebration-detail`,r));return n}function pt(e,n){let r=ut();$?.remove(),dt(n);let i=t(`div`,`merge-celebration`);i.setAttribute(`role`,`status`);let a=t(`div`,`merge-celebration-card`),o=t(`div`,`merge-celebration-stage`),s=st(r.title),c=lt(r);o.append(s,t(`p`,`merge-celebration-message`,e.message),ft(e.detailLines),c);let l=t(`div`,`merge-confetti`);l.style.setProperty(`--confetti-scale`,String(ae(n)));for(let e=0;e<at;e+=1)l.append(ot(e));a.append(l,o),i.append(a),document.body.append(i),ct(o,s,c),$=i,window.setTimeout(()=>{i.remove(),$===i&&($=null)},Q)}export{Q as CELEBRATION_DURATION_MS,pt as playCelebration};
|
|
1
|
+
import{_ as e,o as t,s as n}from"./dom-helpers-ScgOMqDW.js";import{Di as r,la as i}from"./index-vCVa1R-5.js";import{playToneSequence as a}from"./alert-sound-DukgawED.js";var o=1.2,s=1.55,c=.12,l=523.25,u=2,d=8,f=(e,t,n)=>({semitone:e,startBeat:t,beats:n}),p={melody:[f(7,4,.5),f(11,4.5,.5),f(12,5,3)],bass:[f(-5,4,1),f(-12,5,3)]},m=[{melody:[f(0,0,1),f(4,1,1),f(7,2,1),f(9,3,1)],bass:[f(-12,0,2),f(-8,2,2)]},{melody:[f(7,0,.67),f(7,.67,.67),f(7,1.33,.67),f(9,2,1),f(5,3,1)],bass:[f(-12,0,2),f(-7,2,2)]},{melody:[f(5,0,1),f(9,1,1),f(7,2,1),f(4,3,1)],bass:[f(-7,0,2),f(-12,2,2)]},{melody:[f(12,0,.5),f(7,.5,.5),f(12,1,.5),f(16,1.5,.5),f(16,2,1),f(14,3,1)],bass:[f(-12,0,2),f(-3,2,2)]},{melody:[f(4,0,1),f(7,1,1),f(4,2,.5),f(5,2.5,.5),f(7,3,.5),f(4,3.5,.5)],bass:[f(-8,0,2),f(-12,2,2)]}].map(e=>({melody:[...e.melody,...p.melody],bass:[...e.bass,...p.bass]}));function h(e,t){return l*2**((e+t)/12)}function g(e,t){let n=(e,n,r)=>e.map(e=>({frequency:h(e.semitone,t),startSeconds:s+e.startBeat*c,durationSeconds:e.beats*c,waveform:n,gain:r}));return[...n(e.melody,`square`,.2),...n(e.melody,`triangle`,.5),...n(e.bass,`triangle`,.6)]}var ee=[{frequency:220,endFrequency:880,startSeconds:0,durationSeconds:.32,waveform:`triangle`,gain:.25},{frequency:160,endFrequency:45,startSeconds:o,durationSeconds:.28,waveform:`sine`,gain:1},{frequency:1400,endFrequency:380,startSeconds:o,durationSeconds:.06,waveform:`square`,gain:.12}];function te(e){let t=m[e%m.length],n=Math.min(e*u,d);return{peakGain:.1,tones:[...ee,...g(t,n)]}}function _(e){return Math.round(Math.sqrt(2*e/780)*1e3)}function v(e,t,n=Math.random){return Math.round(e+n()*(t-e))}function y(e,t=Math.random){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}var ne=.6,re=.25,ie=1.6;function ae(e){return Math.min(ne+e*re,ie)}var b=[`var(--accent)`,`var(--state-running)`,`var(--state-idle)`,`var(--state-waiting)`,`var(--state-failed)`];function oe(e,t=Math.random){let n=v(320,520,t),r=v(1800,2800,t);return[[`--confetti-start-x`,`${v(4,96,t)}%`],[`--confetti-x`,`${v(-140,140,t)}px`],[`--confetti-rise`,`${-v(20,55,t)}px`],[`--confetti-fall`,`${v(45,70,t)}vh`],[`--confetti-rise-ms`,`${n}ms`],[`--confetti-fall-ms`,`${r}ms`],[`--confetti-flight-ms`,`${n+r}ms`],[`--confetti-tilt`,`${v(0,180,t)}deg`],[`--confetti-spin`,`${v(-360,360,t)}deg`],[`--confetti-flutter-ms`,`${v(160,340,t)}ms`],[`--confetti-delay`,`${v(0,160,t)}ms`],[`--confetti-color`,b[e%b.length]]]}var se=`<svg viewBox="0 0 36 36" aria-hidden="true"><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="17"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="13"/><circle class="merge-bullseye-ring-light" cx="18" cy="18" r="9"/><circle class="merge-bullseye-ring-red" cx="18" cy="18" r="5"/></svg>`,ce=`<svg viewBox="0 0 26 8" aria-hidden="true"><path class="merge-bullseye-dart-flight" d="M0 0L7 3V5L0 8L2 4Z"/><rect class="merge-bullseye-dart-shaft" x="6" y="3.3" width="8" height="1.4"/><rect class="merge-bullseye-dart-barrel" x="13" y="2.5" width="7" height="3" rx="1"/><path class="merge-bullseye-dart-tip" d="M20 3L26 4L20 5Z"/></svg>`;function le(){let e=n(`div`,`merge-bullseye-target`,se);return e.append(t(`span`,`merge-bullseye-ripple`)),e}function ue(){let e=t(`div`,`merge-bullseye-dart-drift`),r=t(`div`,`merge-bullseye-dart-arc`),i=t(`div`,`merge-bullseye-dart-aim`);return i.append(n(`div`,`merge-bullseye-dart`,ce)),r.append(i),e.append(r),e}function de(){let e=t(`div`,`merge-bullseye-range`),n=t(`div`,`merge-bullseye-track`);return n.append(ue()),e.append(le(),n),e}var fe={title:`BULLSEYE!`,buildScene:de},pe=6,x=30,S=-14,C=16;function w(e=Math.random){return[[`--crosshair-start-left`,`${v(pe,x,e)}%`],[`--crosshair-start-offset-y`,`${v(S,C,e)}px`]]}var T=`<svg viewBox="0 0 26 40" aria-hidden="true"><path class="merge-headshot-target-body" d="M9 13H17L18 16Q25 18 25 24V40H1V24Q1 18 8 16Z"/><circle class="merge-headshot-target-head" cx="13" cy="7" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="7" r="3"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="6"/><circle class="merge-headshot-target-ring" cx="13" cy="27" r="2.5"/></svg>`,E=`<svg viewBox="0 0 22 22" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M11 0V5M11 17V22M0 11H5M17 11H22"/><circle class="merge-headshot-crosshair-dot" cx="11" cy="11" r="1"/></svg>`,D=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 3L8 8M21 3L16 8M3 21L8 16M21 21L16 16"/></svg>`;function O(){let r=t(`div`,`merge-headshot-sweep`);e(r,w());let i=t(`div`,`merge-headshot-aim`);i.append(n(`div`,`merge-headshot-crosshair`,E));let a=t(`div`,`merge-headshot-bob`);return a.append(i,n(`div`,`merge-headshot-hitmarker`,D)),r.append(a),r}function k(){let e=t(`div`,`merge-headshot-range`),r=t(`div`,`merge-headshot-track`);return r.append(O()),e.append(n(`div`,`merge-headshot-target`,T),r),e}var A={title:`HEADSHOT!`,buildScene:k},j=[`10`,`J`,`Q`,`K`,`A`],M=160,N=19,P=5,F=9,I=780,L=70,R=70,z=35;function B(e){let t=j.length-1,n=e-t/2;return{offsetPx:n*N,titleSpreadFraction:n/t,tiltDegrees:n*P,bottomPx:F-n**2,dealLeadMs:I-e*L,flipLeadMs:M+(t-e)*R,waveDelayMs:e*z}}function me(e){return[[`--card-offset`,`${e.offsetPx}px`],[`--card-title-spread`,String(e.titleSpreadFraction)],[`--card-tilt`,`${e.tiltDegrees}deg`],[`--card-bottom`,`${e.bottomPx}px`],[`--card-deal-lead-ms`,`${e.dealLeadMs}ms`],[`--card-flip-lead-ms`,`${e.flipLeadMs}ms`],[`--card-wave-delay-ms`,`${e.waveDelayMs}ms`]]}function he(){return[[`--card-flip-ms`,`${M}ms`]]}var ge=`<svg viewBox="0 0 10 9" aria-hidden="true"><path d="M5 8.5C5 8.5 0 5.3 0 2.6C0 1.1 1.2 0 2.6 0C3.6 0 4.5 .6 5 1.4C5.5 .6 6.4 0 7.4 0C8.8 0 10 1.1 10 2.6C10 5.3 5 8.5 5 8.5Z"/></svg>`;function _e(n,r){let i=t(`div`,`merge-flush-deal`);e(i,me(B(r)));let a=t(`div`,`merge-flush-hop`),o=t(`div`,`merge-flush-card`),s=t(`div`,`merge-flush-face`);return s.append(t(`span`,`merge-flush-rank`,n)),s.insertAdjacentHTML(`beforeend`,ge),o.append(t(`div`,`merge-flush-back`),s),a.append(o),i.append(a),i}function ve(){let n=t(`div`,`merge-flush-table`);return e(n,he()),n.append(...j.map(_e)),n}var ye={title:`ROYAL FLUSH!`,buildScene:ve},be=[1,2,3,4],xe=14,Se=3,Ce=3,V=10,we=20,Te=2,H=28,U=18,Ee=.01,De=1.5,Oe=2200,ke=1,W=120,G=.35,Ae=15,je=105,Me=4,Ne=65,Pe=145;function Fe(e){return Math.round(e/(Math.PI*U)*360)}function K(e){return we-e*Te}function q(e){return e.rowIndex*xe+e.depthIndex*Se}function J(e,t,n){return Array.from({length:n},(r,i)=>e+(t-e)*i/(n-1))}function Y(){return be.flatMap((e,t)=>Array.from({length:e},(n,r)=>({rowIndex:t,depthIndex:e-1-r})))}function Ie(e,t){let n=y(J(Ae,je,e),t),r=y(J(Ne,Pe,e),t);return n.map((e,n)=>({angleDegrees:e+v(-4,Me,t),depthScalePercent:Math.round(r[n])}))}function Le(e,t,n){let r=v(240,380,n),i=t.angleDegrees*Math.PI/180,a=r*Math.cos(i),o=(r*Math.sin(i))**2/1560,s=v(15,45,n),c=_(o),l=_(o+s),u=c+l,d=v(540,1080,n),f=a>=0?1:-1,p=q(e);return{depthIndex:e.depthIndex,launchAngleDegrees:t.angleDegrees,distanceFromHeadPinPx:p,layer:K(e.depthIndex),flyXPx:Math.round(a*u/1e3),peakRisePx:Math.round(o),landingDropPx:s,riseMs:c,fallMs:l,flightMs:u,spinDegrees:Math.round(f*d*u/1e3),glintMs:Math.round(180/d*1e3),depthScalePercent:t.depthScalePercent,delayMs:Math.round(p/G)}}function Re(e=Math.random){let t=Y(),n=Ie(t.length,e);return t.map((t,r)=>Le(t,n[r],e))}function ze(e){return[[`--pin-left`,`${e.distanceFromHeadPinPx}px`],[`--pin-raise`,`${e.depthIndex*Ce}px`],[`--pin-shade`,`${100-e.depthIndex*12}%`],[`--pin-fly-x`,`${e.flyXPx}px`],[`--pin-peak-y`,`${-e.peakRisePx}px`],[`--pin-land-y`,`${e.landingDropPx}px`],[`--pin-rise-ms`,`${e.riseMs}ms`],[`--pin-fall-ms`,`${e.fallMs}ms`],[`--pin-flight-ms`,`${e.flightMs}ms`],[`--pin-spin`,`${e.spinDegrees}deg`],[`--pin-glint-ms`,`${e.glintMs}ms`],[`--pin-depth-scale`,`${e.depthScalePercent}%`],[`--pin-depth-shade`,`${e.depthScalePercent-10}%`],[`--pin-delay`,`${e.delayMs}ms`],[`--pin-layer`,String(e.layer)]]}function Be(){return K(De)}function Ve(){return Math.max(...Y().map(q))+V}function He(){let e=Ve(),t=H+e+U-ke;return[[`--ball-follow-px`,`${W}px`],[`--ball-follow-ms`,`${Math.round(W/G)}ms`],[`--ball-follow-spin`,`${Fe(W)}deg`],[`--ball-size`,`${U}px`],[`--ball-approach-spin`,`${Oe}deg`],[`--ball-impact-inset`,`${t}px`],[`--ball-layer`,String(Be())],[`--rack-right`,`${H}px`],[`--rack-width`,`${e}px`],[`--pin-width`,`${V}px`]]}function Ue(e=Math.random){return e()>=Ee?null:i[Math.floor(e()*i.length)].sprite}var We=`<svg viewBox="0 0 10 24" aria-hidden="true"><path class="merge-strike-pin-body" d="M5 0C7 0 7.6 2 7.2 4C6.9 5.6 6.3 6.6 6.4 8C6.6 10 9.6 12 9.6 16C9.6 19.5 8.4 22 7.6 24H2.4C1.6 22 .4 19.5 .4 16C.4 12 3.4 10 3.6 8C3.7 6.6 3.1 5.6 2.8 4C2.4 2 3 0 5 0Z"/><path class="merge-strike-pin-stripe" d="M3.1 5.2H6.9V6.2H3.1ZM3.4 7H6.6V8H3.4Z"/></svg>`;function Ge(r){let i=t(`span`,`merge-strike-pin`);return i.append(n(`span`,`merge-strike-pin-arc`,We)),e(i,ze(r)),i}function Ke(){let e=Ue();if(!e)return t(`span`,`merge-strike-ball`);let n=t(`span`,`merge-strike-ball is-animal`);return n.append(t(`span`,`nyan-sprite ${e}`)),n}function qe(){let n=t(`div`,`merge-strike-lane`);e(n,He());let r=t(`div`,`merge-strike-rack`);r.append(...Re().map(Ge));let i=t(`div`,`merge-strike-track`);return i.append(Ke()),n.append(r,i),n}var Je={title:`STRIKE!`,buildScene:qe},Ye=20,Xe=92,Ze=23,Qe=7,$e=-40;function et(){let e=_(72),t=_(69),n=780*t/1e3;return{launchHeightPx:Ye,peakHeightPx:Xe,heightThroughRimPx:Ze,heightLeavingNetPx:Qe,heightOutOfCardPx:$e,riseMs:e,fallToRimMs:t,speedThroughRimPxPerSecond:n,netCatchMs:Math.round(32/n*1e3),dropMs:_(47)}}function tt(e=et()){return[[`--ball-launch-y`,`${-e.launchHeightPx}px`],[`--ball-peak-y`,`${-e.peakHeightPx}px`],[`--ball-rim-y`,`${-e.heightThroughRimPx}px`],[`--ball-net-exit-y`,`${-e.heightLeavingNetPx}px`],[`--ball-drop-out-y`,`${-e.heightOutOfCardPx}px`],[`--ball-rise-ms`,`${e.riseMs}ms`],[`--ball-fall-to-rim-ms`,`${e.fallToRimMs}ms`],[`--ball-to-rim-ms`,`${e.riseMs+e.fallToRimMs}ms`],[`--ball-net-catch-ms`,`${e.netCatchMs}ms`],[`--ball-drop-ms`,`${e.dropMs}ms`]]}var nt=`<svg viewBox="0 0 40 48" aria-hidden="true"><rect class="merge-swish-pole" x="36" y="28" width="2" height="20"/><rect class="merge-swish-backboard" x="35" y="2" width="3" height="26" rx="1"/><path class="merge-swish-rim" d="M31 18H35M7 18A12 2.5 0 0 1 31 18"/></svg>`,rt=`<svg viewBox="0 0 40 48" aria-hidden="true"><g class="merge-swish-net"><path d="M8 18L12 32M13.5 18L15.5 32M19 18V32M24.5 18L22.5 32M30 18L26 32M9.5 23Q19 25 28.5 23M11 28Q19 29.5 27 28"/></g><path class="merge-swish-rim" d="M7 18A12 2.5 0 0 0 31 18"/></svg>`;function it(){let e=t(`div`,`merge-swish-ball-drift`),n=t(`div`,`merge-swish-ball-arc`);return n.append(t(`span`,`merge-swish-ball`)),e.append(n),e}function X(){let r=t(`div`,`merge-swish-court`);e(r,tt());let i=t(`div`,`merge-swish-track`);return i.append(it()),r.append(n(`div`,`merge-swish-hoop-back`,nt),i,n(`div`,`merge-swish-hoop-front`,rt)),r}var Z=[Je,{title:`SWISH!`,buildScene:X},fe,A,ye],at=48,Q=5600,$=null;function ot(n){let r=t(`span`,`merge-confetti-piece`),i=t(`span`,`merge-confetti-arc`);return i.append(t(`span`,`merge-confetti-paper`)),r.append(i),e(r,oe(n)),r}function st(e){let n=t(`p`,`merge-celebration-title`);return n.setAttribute(`aria-hidden`,`true`),Array.from(e).forEach((e,r)=>{let i=t(`span`,`merge-celebration-letter`,e);i.style.setProperty(`--letter-delay`,`${r*45}ms`),n.append(i)}),n}function ct(e,t,n){let r=t.firstElementChild,i=t.lastElementChild;r instanceof HTMLElement&&i instanceof HTMLElement&&(e.style.setProperty(`--celebration-title-width`,`${i.offsetLeft+i.offsetWidth-r.offsetLeft}px`),e.style.setProperty(`--celebration-title-center-y`,`${t.offsetTop+t.offsetHeight/2-n.offsetTop}px`))}function lt(e){let n=t(`div`,`merge-celebration-scene`);return n.setAttribute(`aria-hidden`,`true`),n.append(e.buildScene()),n}function ut(){return Z[Math.floor(Math.random()*Z.length)]}function dt(e){if(r())try{a(te(e))}catch{}}function ft(e){let n=t(`ul`,`merge-celebration-details`);for(let r of e)n.append(t(`li`,`merge-celebration-detail`,r));return n}function pt(e,n){let r=ut();$?.remove(),dt(n);let i=t(`div`,`merge-celebration`);i.setAttribute(`role`,`status`);let a=t(`div`,`merge-celebration-card`),o=t(`div`,`merge-celebration-stage`),s=st(r.title),c=lt(r);o.append(s,t(`p`,`merge-celebration-message`,e.message),ft(e.detailLines),c);let l=t(`div`,`merge-confetti`);l.style.setProperty(`--confetti-scale`,String(ae(n)));for(let e=0;e<at;e+=1)l.append(ot(e));a.append(l,o),i.append(a),document.body.append(i),ct(o,s,c),$=i,window.setTimeout(()=>{i.remove(),$===i&&($=null)},Q)}export{Q as CELEBRATION_DURATION_MS,pt as playCelebration};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,o as t,u as n,y as r}from"./dom-helpers-ScgOMqDW.js";import{o as i}from"./card-registry-Dbt9rUrq.js";import{i as a}from"./modal-KRdHzhQs.js";import{c as o,i as ee}from"./action-status-CaRwKdTD.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,_t as p,gt as m,hn as h,ht as g,ii as _,it as v,kt as y,m as ne,mn as re,mt as ie,pt as b,ri as x,vt as S,yt as C}from"./index-
|
|
1
|
+
import{d as e,o as t,u as n,y as r}from"./dom-helpers-ScgOMqDW.js";import{o as i}from"./card-registry-Dbt9rUrq.js";import{i as a}from"./modal-KRdHzhQs.js";import{c as o,i as ee}from"./action-status-CaRwKdTD.js";import{Et as te,Ft as s,It as c,Mt as l,Nt as u,Ot as d,St as f,_t as p,gt as m,hn as h,ht as g,ii as _,it as v,kt as y,m as ne,mn as re,mt as ie,pt as b,ri as x,vt as S,yt as C}from"./index-vCVa1R-5.js";import{t as w}from"./team-review-panel-BdZhpNwA.js";import{t as ae}from"./pr-queue-columns-CAnPPfn8.js";var oe={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},se={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ce={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:oe[e.verdict],tone:se[e.verdict]}:e.status===`ready`?{text:`Researched`,tone:`muted`}:e.status===`error`?{text:T.error,tone:`danger`}:{text:T[e.status],tone:`muted`}}function D(e){let t=ce[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function le(e){return e.status!==`running`&&e.status!==`queued`}function k(e){return e.status!==`aside`}function A(e){let t=e.find(e=>e.id===`working`)?.items.length??0;return t===0?`No community question needs you right now.`:`No community question needs you right now. ${t} ${t===1?`question is`:`questions are`} being researched.`}function j(e){return e?e.configured===!1?e.reason??`The community lane is not set up yet.`:`No community questions yet. New ones asked after you turned this on show up here.`:`Waiting for the community lane to report.`}function M(e){return e.filter(e=>!e.isWorkspace&&!e.isEphemeral).map(({id:e,name:t})=>({id:e,name:t})).toSorted((e,t)=>e.name.localeCompare(t.name))}var N=null,P=null,F=null,I=null,L=[],R=null,z=!1,B=null,V=null,H=``,U=new Map;function W(){return M([...i].map(([e,t])=>({id:e,name:t.nameEl.textContent??e,isWorkspace:t.card.dataset.workspace!==void 0,isEphemeral:t.card.dataset.ephemeral!==void 0})))}function G(e,n){let r=t(`button`,`pr-action pr-action-ghost`,e);return r.type=`button`,r.disabled=!_(n),r.addEventListener(`click`,()=>x(n)),r}function K(e,n,r){let i=t(`button`,`pr-action`,e);return i.type=`button`,i.disabled=!n,i.addEventListener(`click`,r),i}function q(e,n,r){let i=t(`ul`,e);i.setAttribute(`aria-label`,n);for(let e of r)i.append(t(`li`,null,e));return i}function ue(e){let n=t(`div`,`pr-detail-heading`),r=t(`div`,`pr-detail-title`);r.append(t(`h2`,null,e.item.title||`Untitled question`));let i=t(`div`,`pr-detail-meta`),a=Date.parse(e.item.createdAt);return i.append(t(`span`,null,e.item.author),t(`span`,null,D(e))),Number.isNaN(a)||i.append(t(`span`,null,`Asked ${ne(a)}`)),n.append(r,i),n}function de(e){let n=t(`section`,`community-question`);return n.setAttribute(`aria-label`,`Question as asked`),n.append(t(`h3`,`pr-section-heading`,`Question as asked`),t(`p`,`community-question-body`,e.item.body)),n}function fe(e){let n=t(`section`,`pr-verdict-box`);n.setAttribute(`aria-label`,`Research`);let r=E(e),i=t(`div`,`pr-verdict-line`),a=t(`strong`,`community-badge`,r.text);if(a.dataset.tone=r.tone,i.append(a),n.append(i),e.error&&n.append(t(`p`,`pr-attention-detail`,e.error)),e.summary&&n.append(t(`p`,`pr-verdict-summary`,e.summary)),e.goal&&n.append(t(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&n.append(q(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return n;let o=t(`details`,`pr-verdict-checked`);return o.append(t(`summary`,null,`What it checked (${e.checked.length})`),q(`community-checked`,`What it checked`,e.checked)),n.append(o),n}function pe(e){if(!e.draft)return null;let n=t(`section`,`community-draft`);n.setAttribute(`aria-label`,`Draft reply`),n.append(t(`h3`,`pr-section-heading`,`Draft reply`),t(`p`,`community-draft-body`,e.draft.body));let r=e.draft.publicLinks.filter(_);if(r.length===0)return n;let i=t(`ul`,`community-links`);for(let e of r){let n=t(`li`);n.append(G(e,e)),i.append(n)}return n.append(i),n}function me(e,t){let n=e.draft?r(e.draft.body):null;n?n.then(()=>t.show(`ok`,`Draft copied. Post it yourself where the question was asked.`),()=>t.show(`error`,`Copying failed. Select the draft text instead.`)):t.show(`error`,`This browser does not allow copying here. Select the draft text instead.`)}async function he(e,t){if(!H){t.show(`error`,`Pick a session to start from first.`);return}let n=await o(`open-community-session`,{key:e.item.key,projectId:H},t,{busyText:`Starting a session with the research.`});n?.type===`open-community-session-result`&&(n.ok?(t.show(`ok`,`Started ${n.sessionName??`a session`}.`),n.sessionId&&v()?.openTerminal(n.sessionId)):t.show(`error`,n.error??`The session did not start.`))}async function J(e,t,n){let r=t===`rerun`?`Queuing the research again.`:`Setting the question aside.`,i=await o(`community-action`,{key:e.item.key,action:t},n,{busyText:r});i?.type===`community-action-result`&&(i.ok||n.show(`error`,i.error??`The change did not apply.`))}function ge(){let e=t(`select`,`community-session-picker`);e.setAttribute(`aria-label`,`Session to start from`);let n=W();n.some(e=>e.id===H)||(H=n[0]?.id??``);for(let r of n){let n=t(`option`,null,r.name);n.value=r.id,n.selected=r.id===H,e.append(n)}return e.disabled=n.length===0,e.addEventListener(`change`,()=>{H=e.value}),e}function _e(e){let n=t(`div`,`community-actions`),r=ee(`pr-action-status`),i=t(`div`,`community-action-buttons`);return i.append(K(`Copy draft`,e.draft!==null,()=>me(e,r)),G(`Open thread`,e.item.url),ge(),K(`Start session`,!0,()=>void he(e,r)),K(`Re-run`,le(e),()=>void J(e,`rerun`,r)),K(`Set aside`,k(e),()=>void J(e,`set-aside`,r))),n.append(i,r.element),n}function ve(e){let n=t(`article`,`pr-detail community-detail`),r=pe(e);return n.append(ue(e),_e(e),...r?[r]:[],fe(e),de(e)),n}function Y(){if(!F)return;let e=l(L,R),n=e?JSON.stringify(e.entry):`empty:${c(L).length}`;if(n===V)return;if(V=n,e){F.replaceChildren(ve(e.entry));return}let r=L.some(e=>e.items.length>0);F.replaceChildren(r?w({title:`All caught up`,detail:A(L)}):t(`p`,`pr-empty`,j(g())))}function ye(e,t){S(d(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function X(){if(!I)return;let e=y(L,O);h(I,f(e),e.filter(e=>e.id!==R))}function Z(e){R=e;for(let[t,n]of U)n.setAttribute(`aria-current`,String(t===e));let t=l(L,e),n=U.get(e);t&&n&&ye(t,n),Y(),X(),N&&(N.dataset.detailOpen=`true`)}function be(){N&&(N.dataset.detailOpen=`false`),R&&U.get(R)?.focus({preventScroll:!0})}function Q(e){let t=l(L,e);if(!t)return;L.find(e=>e.items.includes(t))?.id===`aside`&&(z=!0),R=e,$(),Z(e);let n=U.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function xe(t){if(t.repeat||t.defaultPrevented||!N||n(N)||a()||e(t)||document.activeElement?.classList.contains(`xterm-helper-textarea`))return;let r=u(t);if(r!==`next-row`&&r!==`previous-row`)return;let i=s([...U.keys()],R,r===`next-row`?1:-1);i&&(t.preventDefault(),i!==R&&Q(i))}function Se(e,n){let r=t(`button`,`pr-queue-row pr-queue-row-quiet`);r.type=`button`,r.dataset.queueKey=e.key,r.setAttribute(`aria-current`,String(e.key===R));let i=E(e.entry),a=t(`span`,`review-queue-action community-badge`,i.text);a.dataset.tone=i.tone;let o=t(`span`,`pr-queue-top`);if(o.append(a,t(`span`,`pr-queue-title`,O(e))),r.append(o,t(`span`,`pr-queue-elapsed`,D(e.entry))),r.title=O(e),n&&p(d(e))){let e=t(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),r.append(e)}return r.addEventListener(`click`,()=>Z(e.key)),U.set(e.key,r),r}function Ce(e){let n=t(`h3`,`pr-section-heading review-group-heading`),r=t(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return n.append(t(`span`,null,e.title),r),n;let i=t(`button`,`review-group-toggle`),a=t(`span`,`review-group-chevron`,`▸`);return a.setAttribute(`aria-hidden`,`true`),i.append(a,e.title),i.type=`button`,i.setAttribute(`aria-expanded`,String(z)),i.addEventListener(`click`,()=>{z=!z,B=null,$()}),n.append(i,r),n}function we(e){let n=t(`section`,`pr-queue-section`);if(n.dataset.group=e.id,n.append(Ce(e)),e.id===`aside`&&!z)return n;for(let t of e.items)n.append(Se(t,e.id===`turn`));return n}function $(){if(!P)return;L=ie(),R=te(L.filter(e=>e.id!==`aside`||z),R),X();let e=JSON.stringify([L,R,z,m(),g()?.error??null]);if(e!==B){B=e,U.clear();let n=g()?.error,r=n?[t(`p`,`my-pr-note`,n)]:[],i=L.filter(e=>e.items.length>0).map(we);P.replaceChildren(...r,...i.length>0?i:[t(`p`,`pr-empty`,j(g()))])}Y()}function Te(e){if(N)return;N=t(`div`,`pr-content review-queue community-queue`),e.append(N);let r=ae({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});P=r.queue,F=t(`div`,`review-queue-detail`);let i=t(`div`,`review-queue-phone-bar`),a=t(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);a.type=`button`,a.addEventListener(`click`,be),i.append(a),r.detail.append(i,F),I=re({onJump:()=>{let e=y(L,O).find(e=>e.id!==R)?.id;e&&Q(e)},rowFor:e=>U.get(e)}),I.classList.add(`review-queue-banner`),r.queue.before(I),N.append(r.columns),N.dataset.detailOpen=`false`,b(()=>!n(N)),C(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,xe),$()}var Ee={mount:Te,refresh:()=>{V=null,$()}};export{Ee as view};
|
|
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-CqTQW6Ft.js";import{h as o,m as s,o as c}from"./dom-helpers-ScgOMqDW.js";import{d as l}from"./control-ws-nj9Lq91R.js";import{n as u,r as d,t as f}from"./modal-KRdHzhQs.js";import{i as p,s as m,t as h}from"./action-status-CaRwKdTD.js";import{n as g}from"./session-tick-Bpw_34Bq.js";import{Fr as _,Ir as v,Lr as y,Nr as b,Pr as x,Rr as S,di as C,fi as w,m as T,ui as E,wr as D,zn as ee}from"./index-
|
|
1
|
+
import{G as e,U as t,W as n,dt as r,ft as i,x as a}from"./updates-view-core-CqTQW6Ft.js";import{h as o,m as s,o as c}from"./dom-helpers-ScgOMqDW.js";import{d as l}from"./control-ws-nj9Lq91R.js";import{n as u,r as d,t as f}from"./modal-KRdHzhQs.js";import{i as p,s as m,t as h}from"./action-status-CaRwKdTD.js";import{n as g}from"./session-tick-Bpw_34Bq.js";import{Fr as _,Ir as v,Lr as y,Nr as b,Pr as x,Rr as S,di as C,fi as w,m as T,ui as E,wr as D,zn as ee}from"./index-vCVa1R-5.js";import{t as te}from"./repo-roots-adder-BVBmRRa_.js";import{t as ne}from"./sandboxed-frame-DT7MIpqw.js";var re=`<h2 class="dialog-title" id="add-session-title">Add Session</h2>
|
|
2
2
|
<fieldset class="dialog-mode-controls add-session-agent-only" aria-label="Session kind">
|
|
3
3
|
<button type="button" class="dialog-mode-button" id="add-session-single-mode" aria-pressed="true">Single repo</button>
|
|
4
4
|
<button type="button" class="dialog-mode-button" id="add-session-workspace-mode" aria-pressed="false">Workspace</button>
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./dom-helpers-ScgOMqDW.js";import{d as t}from"./control-ws-nj9Lq91R.js";import{a as n,r,t as i}from"./modal-KRdHzhQs.js";import{s as a,t as o}from"./action-status-CaRwKdTD.js";import{Dn as s,ci as c}from"./index-
|
|
1
|
+
import{o as e}from"./dom-helpers-ScgOMqDW.js";import{d as t}from"./control-ws-nj9Lq91R.js";import{a as n,r,t as i}from"./modal-KRdHzhQs.js";import{s as a,t as o}from"./action-status-CaRwKdTD.js";import{Dn as s,ci as c}from"./index-vCVa1R-5.js";import{i as l,t as u}from"./plan-render-B2ZtlVAu.js";var d=null;function f(t){let n=c(t.sessionId);t.select.replaceChildren(...n.map(n=>{let r=e(`option`,null,n.name);return r.value=n.path,r.selected=n.path===t.docPath,r})),t.select.hidden=n.length<2,t.title.textContent=n.find(e=>e.path===t.docPath)?.name??t.title.textContent}function p(e){let t=c(e.sessionId).some(t=>t.path===e.docPath);e.btnEdit.setAttribute(`aria-pressed`,String(e.mode===`edit`)),e.btnPreview.setAttribute(`aria-pressed`,String(e.mode===`preview`)),e.textarea.hidden=e.mode!==`edit`,e.preview.hidden=e.mode!==`preview`,e.select.disabled=e.isBusy,e.btnReload.disabled=e.isBusy||!t,e.btnSave.disabled=e.isBusy||!t||e.baseHash===null||!e.hasUnsavedChanges}function m(e,t,n=`quiet`){e.status.textContent=t,e.status.dataset.tone=n}function h(e){e.preview.replaceChildren(u(l(e.textarea.value)))}function g(e,t){n({title:e,message:`Your unsaved edits will be lost.`,confirmLabel:`Discard`,danger:!0,onConfirm:t})}function _(e,t,n){e.hasUnsavedChanges?g(t,n):n()}async function v(e,n){try{return{reply:await t(e,n,{timeoutMs:o}),failureText:null}}catch(e){return{reply:null,failureText:a(e,o)}}}async function y(e,t){e.docPath=t,e.isBusy=!0,e.baseHash=null,e.textarea.readOnly=!0,f(e),m(e,`Loading`),p(e);let{reply:n,failureText:r}=await v(`session-doc-read`,{id:e.sessionId,path:t});if(d!==e||e.docPath!==t)return;e.isBusy=!1,e.textarea.readOnly=!1;let i=n?.type===`session-doc-response`?n:null;!i?.ok||i.text===void 0||i.hash===void 0?(m(e,i?.error||r||`Could not open this doc`,`warn`),p(e)):(e.textarea.value=i.text,e.baseHash=i.hash,e.hasUnsavedChanges=!1,e.mode===`preview`&&h(e),m(e,``),p(e))}async function b(e){if(e.btnSave.disabled||e.baseHash===null)return;e.isBusy=!0,m(e,`Saving`),p(e);let t=e.docPath,n=e.textarea.value,{reply:r,failureText:i}=await v(`session-doc-save`,{id:e.sessionId,path:t,text:n,baseHash:e.baseHash});if(d!==e||e.docPath!==t)return;e.isBusy=!1;let a=r?.type===`session-doc-save-result`?r:null;!a?.ok||a.hash===void 0?(m(e,a?.conflict?`The agent changed this file since you opened it. Reload to see its version.`:a?.error||i||`Save failed`,`warn`),p(e)):(e.baseHash=a.hash,e.hasUnsavedChanges=e.textarea.value!==n,m(e,e.hasUnsavedChanges?`Unsaved changes`:`Saved`),p(e))}function x(e,t){e.mode=t,t===`preview`&&h(e),p(e),t===`edit`&&e.textarea.focus()}function S(t,n){let r=e(`button`,`plan-control ${n}`,t);return r.type=`button`,r}function C(t){let n=c(t)[0];if(!n||d)return;let a=()=>_(M,`Close this doc?`,()=>M.close()),o=r({dialogClass:`doc-editor`,closeOnBackdrop:!1,onEscape:a}),l=`doc-editor-title-${t}`,u=e(`h3`,`doc-editor-title`,n.name);u.id=l;let f=e(`select`,`plan-control doc-editor-picker`);f.setAttribute(`aria-label`,`Doc`);let h=e(`span`,`doc-editor-status`);h.setAttribute(`role`,`status`);let g=S(`Edit`,`doc-editor-mode`),v=S(`Preview`,`doc-editor-mode`),C=S(`Reload`,`doc-editor-reload`),w=S(`Save`,`doc-editor-save`),T=S(`Close`,`doc-editor-close`),E=e(`div`,`doc-editor-modes`);E.append(g,v);let D=e(`div`,`doc-editor-actions`);D.append(h,C,w,T);let O=e(`div`,`doc-editor-header`);O.append(u,f,E,D);let k=e(`textarea`,`plan-editor doc-editor-text`);k.spellcheck=!0,k.setAttribute(`aria-labelledby`,l);let A=e(`div`,`doc-editor-preview`),j=e(`div`,`doc-editor-body`);j.append(k,A),o.dialog.append(O,j),i(o.dialog,l);let M={sessionId:t,docPath:n.path,baseHash:null,hasUnsavedChanges:!1,isBusy:!1,mode:s()?`preview`:`edit`,title:u,select:f,textarea:k,preview:A,status:h,btnEdit:g,btnPreview:v,btnReload:C,btnSave:w,close:()=>{d=null,o.close()}};d=M,k.addEventListener(`input`,()=>{M.hasUnsavedChanges||(M.hasUnsavedChanges=!0,m(M,`Unsaved changes`),p(M))}),k.addEventListener(`keydown`,e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),b(M))}),f.addEventListener(`change`,()=>{let e=f.value;f.value=M.docPath,_(M,`Open another doc?`,()=>{y(M,e)})}),g.addEventListener(`click`,()=>x(M,`edit`)),v.addEventListener(`click`,()=>x(M,`preview`)),C.addEventListener(`click`,()=>{_(M,`Reload this doc?`,()=>{y(M,M.docPath)})}),w.addEventListener(`click`,()=>{b(M)}),T.addEventListener(`click`,a),y(M,n.path),M.mode===`edit`&&k.focus()}function w(e){d&&d.sessionId===e&&(f(d),p(d),!c(e).some(e=>e.path===d?.docPath)&&m(d,`This doc is no longer surfaced, so it cannot be saved.`,`warn`))}export{w as applyDocsToOpenEditor,C as openDocEditor};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gt as e}from"./updates-view-core-CqTQW6Ft.js";import{o as t}from"./dom-helpers-ScgOMqDW.js";import{u as n}from"./control-ws-nj9Lq91R.js";import{Ln as r,Rn as i,i as a,la as o,mi as s,pi as c}from"./index-
|
|
1
|
+
import{gt as e}from"./updates-view-core-CqTQW6Ft.js";import{o as t}from"./dom-helpers-ScgOMqDW.js";import{u as n}from"./control-ws-nj9Lq91R.js";import{Ln as r,Rn as i,i as a,la as o,mi as s,pi as c}from"./index-vCVa1R-5.js";var l={teamReview:e=>`${e} pull requests reviewed this week, and Reviews has not been open lately? It lines up every PR waiting on you.`,issues:e=>`${e} issues touched this week. The Issues tab keeps them in one list and starts a session on any of them.`,usage:()=>`Keeping an eye on tokens? The Usage tab tracks spend per session and warns before a limit hits.`,posthog:()=>`Hunting errors again? Radar watches PostHog error tracking and can investigate an issue for you.`,visions:()=>`Pointing agents at files in your editor? Visions reads your open editor and comments right on the code.`,benchmarks:()=>`Comparing agents by hand? Bench runs the same review cases across agent setups side by side.`},u=` It is off right now, so Show me takes you to its switch in Settings.`;function d(e,t){let n=l[e.feature](e.distinctTargetCount);return t?n:`${n}${u}`}function f(e){let t=a.find(t=>t.rule===e);return t?{sectionId:t.sectionId,settingId:t.settingId}:null}var p=null;function m(e,t){n({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`hints`,action:t,feature:e}})}function h(e){try{return i(localStorage,r(`feature-hint`,`${e.feature}-${e.raisedAt}`),Date.now())}catch{return!0}}function g(t,n){if(n.isFeatureEnabled(t)){n.openView(e[t]);return}let r=f(t);r&&n.openSetting(r.sectionId,r.settingId)}function _(e,n){if(p?.isConnected||!h(e))return;let r=t(`aside`,`feature-hint`);r.setAttribute(`aria-live`,`polite`),r.setAttribute(`aria-label`,`Feature tip`);let i=t(`div`,`feature-hint-bubble`),a=t(`button`,`btn-dialog btn-dialog-confirm`,`Show me`),l=t(`button`,`btn-dialog btn-dialog-cancel`,`Nah`);a.type=`button`,l.type=`button`;let u=t(`div`,`feature-hint-actions`);u.append(l,a),i.append(t(`p`,`feature-hint-text`,d(e,n.isFeatureEnabled(e.feature))),u);let f=s()??o[0];r.append(i,c(f,`feature-hint-animal`));function _(t){m(e.feature,t),r.remove(),p=null}a.addEventListener(`click`,()=>{_(`open`),g(e.feature,n)}),l.addEventListener(`click`,()=>_(`dismiss`)),document.body.append(r),p=r,m(e.feature,`shown`)}export{_ as showFeatureHint};
|
|
Binary file
|
package/dist/client/assets/{first-run-checklist-BDLuPDpP.js → first-run-checklist-Cw7EDT2O.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,y as t}from"./dom-helpers-ScgOMqDW.js";import{d as n,u as r}from"./control-ws-nj9Lq91R.js";import{i,s as a,t as o}from"./action-status-CaRwKdTD.js";import{Dr as s,Er as c,Pn as l,Sr as u}from"./index-
|
|
1
|
+
import{o as e,y as t}from"./dom-helpers-ScgOMqDW.js";import{d as n,u as r}from"./control-ws-nj9Lq91R.js";import{i,s as a,t as o}from"./action-status-CaRwKdTD.js";import{Dr as s,Er as c,Pn as l,Sr as u}from"./index-vCVa1R-5.js";import{a as d,c as f,i as p,l as m,n as h,o as g,r as _,s as v,t as y}from"./repo-roots-adder-BVBmRRa_.js";var b=`npm install -g @anthropic-ai/claude-code`,x={done:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img" aria-label="Done"><circle cx="12" cy="12" r="10"></circle><path d="M7.5 12.5l3 3 6-6.5"></path></svg>`,current:`<svg width="18" height="18" viewBox="0 0 24 24" role="img" aria-label="Needed"><path d="M12 3l9 9-9 9-9-9z" fill="currentColor"></path></svg>`,upcoming:`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" role="img" aria-label="Not started"><circle cx="12" cy="12" r="10"></circle></svg>`},S=null,C=null,w=null,T=null,E={steps:_,agentSummary:``,repoRoots:[],isShellAvailable:!1},D=0,O=!1,k=!1,A=new Set,j=i(`first-run-load-status`),M=l();function N(e){r({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`onboarding`,action:e}})}function P(e){for(let t of v(A,e))r({type:`dashboard-telemetry`,event:`onboarding_step`,properties:t})&&A.add(f(t))}function F({title:t,state:n,summary:r,badge:i,body:a}){let o=e(`li`,`first-run-step`);o.dataset.state=n,n===`current`&&o.setAttribute(`aria-current`,`step`);let s=e(`div`,`first-run-step-head`),c=e(`span`,`first-run-step-icon`);if(c.innerHTML=x[n],s.append(c,e(`span`,`first-run-step-title`,t)),n===`done`&&r&&s.append(e(`span`,`first-run-step-summary`,r)),n===`current`&&i&&s.append(e(`span`,`first-run-step-badge`,i)),o.append(s),n!==`current`)return o;let l=e(`div`,`first-run-step-body`);return l.append(...a()),o.append(l),o}function I(){return u()?`No supported agent is on PATH of the machine running Glimmervoid. Install Claude Code, Codex or Grok there, then rescan.`:`No supported agent is on PATH. Install Claude Code, Codex or Grok, then rescan.`}function L(){let n=e(`div`,`first-run-command-row`);if(n.append(e(`code`,`first-run-command`,b)),!navigator.clipboard?.writeText)return n;let r=e(`button`,`btn-dialog btn-dialog-cancel`,`Copy`);r.type=`button`;let i=e(`span`,`first-run-copy-status`);return i.setAttribute(`role`,`status`),r.addEventListener(`click`,async()=>{let e=t(b);i.textContent=e?await e.then(()=>`Copied`,()=>`Copy failed`):`Copy failed`}),n.append(r,i),n}function R(){let t=e(`button`,`btn-dialog btn-dialog-cancel`,`Open shell`);return t.type=`button`,t.addEventListener(`click`,()=>{N(`open-shell`),s()}),t}function z(){let t=e(`div`,`first-run-step-actions`);w=e(`button`,`btn-dialog btn-dialog-cancel`,`Rescan`),w.type=`button`,w.addEventListener(`click`,()=>{N(`rescan`),U({rescanAgents:!0})}),t.append(w),E.isShellAvailable&&t.append(R());let n=[e(`p`,`first-run-step-text`,I()),L(),t];return O?[...n,e(`p`,`first-run-step-hint`,`Still missing after a rescan? Restart Glimmervoid from a terminal where the command runs. Other terminal agents go under customAgents.`)]:n}function B(){let t=T??y({onAdded:e=>{N(e===`typed`?`add-root-typed`:`add-root-suggested`),U({rescanAgents:!1})}});return T=t,[e(`p`,`first-run-step-text`,`The folder that holds your git checkouts. Each subfolder becomes a project you can start a session in.`),t.element]}function V(){let t=e(`div`,`first-run-step-actions`),n=e(`button`,`btn-dialog btn-dialog-confirm`,`+ Session`);return n.type=`button`,n.addEventListener(`click`,()=>{N(`add-session`),c()}),t.append(n),[e(`p`,`first-run-step-text`,`Pick a project and an agent. The session runs in its own git worktree, so your checkout is never touched.`),t]}function H(){if(!C)return;let{steps:e,agentSummary:t,repoRoots:n}=E;C.replaceChildren(F({title:`1. Agent CLI`,state:e.agent,summary:t,badge:`MISSING`,body:z}),F({title:`2. Repository roots`,state:e.repoRoots,summary:n.join(`, `),badge:`NEEDED`,body:B}),F({title:`3. First session`,state:e.firstSession,summary:``,badge:``,body:V}))}async function U({rescanAgents:e}){D+=1;let t=D;w&&(w.disabled=!0);try{let[r,i]=await Promise.all([n(`list-agents`,e?{rescan:!0}:{},{timeoutMs:o}),n(`scan-repo-roots`,{includeSuggestions:!0},{timeoutMs:o})]);if(t!==D)return;let a=i.type===`repo-roots-scanned`,s=a?i.directories.map(e=>e.root):[],c=a?i.suggestions??[]:[],l=m(s,c);if(l.length>0&&!k){k=!0;let e=await h(l).catch(e=>String(e));if(t!==D)return;if(!e){U({rescanAgents:!1});return}}let u=g({agentListing:r,repoRoots:s});e&&(O=u.agent===`current`),E={steps:u,agentSummary:p(r),repoRoots:s,isShellAvailable:d(r)},j.clear(),H(),P(E.steps),T?.setSuggestions(c)}catch(e){if(w&&(w.disabled=!1),t!==D)return;j.show(`error`,`The checklist could not load: ${a(e,o)} It loads again once the server answers. If it stays like this, check the terminal running Glimmervoid, or run glimmervoid doctor.`)}}function W(){if(S)return S;let t=e(`section`,`first-run-checklist`);t.setAttribute(`aria-labelledby`,`first-run-title`);let n=e(`h2`,`first-run-title`,`Get to your first session`);n.id=`first-run-title`,C=e(`ol`,`first-run-steps`);let r=e(`div`,`first-run-optional`);return r.append(e(`span`,`first-run-eyebrow`,`OPTIONAL`),M.element),t.append(e(`span`,`first-run-eyebrow`,`FIRST RUN`),n,C,j.element,r),S=t,H(),t}function G(e,t){if(!t){S?.parentElement===e&&!S.hidden&&(S.hidden=!0);return}let n=W(),r=!n.hidden&&n.parentElement===e;n.parentElement!==e&&e.append(n),n.hidden=!1,M.refresh(),r||U({rescanAgents:!1})}function K(){S&&!S.hidden&&S.isConnected&&U({rescanAgents:!1})}export{K as refreshFirstRunChecklist,G as showFirstRunChecklist};
|
|
Binary file
|