glimmervoid 0.52.2-next.707 → 0.52.2-next.709
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/bin/glimmervoid.js +9 -9
- package/dist/chunks/{adapters-C3cStG7e.js → adapters-BX-ML3PF.js} +1 -1
- package/dist/chunks/{adapters-D2xPiTlw.js → adapters-Bk606HYU.js} +1 -0
- package/dist/chunks/agent-api-cli-CN904-o8.js +1 -0
- package/dist/chunks/{agent-api-cli-DESEfE_W.js → agent-api-cli-D5i6Aaxk.js} +1 -1
- package/dist/chunks/{agent-api-core-D-arrmpa.js → agent-api-core-Bxc1V6IS.js} +6 -1
- package/dist/chunks/{main-ee7YDYHf.js → main-fJ2P1CXK.js} +54 -8
- package/dist/chunks/packs-cli-BGjPjwjC.js +1 -0
- package/dist/chunks/{packs-cli-BfX06xxY.js → packs-cli-wE9e0PRp.js} +1 -1
- package/dist/chunks/{pr-flows-cli-C0M4hklq.js → pr-flows-cli-CC5XrR6y.js} +3 -3
- package/dist/chunks/{settings-cli-D_soJdDi.js → settings-cli-DDupUmFE.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-BTrHO7Zw.js → ssh-sign-cli-DSCqRc-5.js} +1 -1
- package/dist/client/assets/{arena-panel-Btp9l0kJ.js → arena-panel-DVBXd_d7.js} +2 -2
- package/dist/client/assets/arena-panel-DVBXd_d7.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-bmD8zwiZ.js → benchmark-panel-DgvEY_-r.js} +1 -1
- package/dist/client/assets/benchmark-panel-DgvEY_-r.js.br +0 -0
- package/dist/client/assets/{boards-view-dVxUt_ij.js → boards-view-tu_0ruzX.js} +1 -1
- package/dist/client/assets/boards-view-tu_0ruzX.js.br +0 -0
- package/dist/client/assets/{community-panel-CTlfTEjN.js → community-panel-DpTcrKba.js} +1 -1
- package/dist/client/assets/community-panel-DpTcrKba.js.br +0 -0
- package/dist/client/assets/{dialogs-58-5mJbh.js → dialogs-DvJZvhKh.js} +1 -1
- package/dist/client/assets/dialogs-DvJZvhKh.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-DJIOuOjJ.js → doc-editor-ui-Dbg1wxN6.js} +1 -1
- package/dist/client/assets/doc-editor-ui-Dbg1wxN6.js.br +0 -0
- package/dist/client/assets/{feature-hint-gXmutm6v.js → feature-hint-DANNbQfn.js} +1 -1
- package/dist/client/assets/feature-hint-DANNbQfn.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-CnUh98nM.js → first-run-checklist-Chr-IvoV.js} +1 -1
- package/dist/client/assets/first-run-checklist-Chr-IvoV.js.br +0 -0
- package/dist/client/assets/{hooks-panel-Dk9IXA3Y.js → hooks-panel-D7RoKnj_.js} +1 -1
- package/dist/client/assets/hooks-panel-D7RoKnj_.js.br +0 -0
- package/dist/client/assets/{index-D1rSKJEg.js → index-Xfokg9h-.js} +5 -5
- package/dist/client/assets/index-Xfokg9h-.js.br +0 -0
- package/dist/client/assets/{issues-panel-BNvZI9C8.js → issues-panel-CfYrRmyh.js} +1 -1
- package/dist/client/assets/issues-panel-CfYrRmyh.js.br +0 -0
- package/dist/client/assets/{lane-read-token-step-EZJ80NxE.js → lane-read-token-step-aJOK0jUS.js} +1 -1
- package/dist/client/assets/lane-read-token-step-aJOK0jUS.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-D4Mwssgi.js → my-prs-panel-Bh2N-v8o.js} +1 -1
- package/dist/client/assets/my-prs-panel-Bh2N-v8o.js.br +0 -0
- package/dist/client/assets/{nyan-cat-CQrVjaml.js → nyan-cat-C9A2ZADZ.js} +1 -1
- package/dist/client/assets/nyan-cat-C9A2ZADZ.js.br +0 -0
- package/dist/client/assets/{phone-shell-BnUVkZu_.js → phone-shell-beVDQtfA.js} +1 -1
- package/dist/client/assets/phone-shell-beVDQtfA.js.br +0 -0
- package/dist/client/assets/{plan-face-BkOYrRkS.js → plan-face-TixBqcS6.js} +1 -1
- package/dist/client/assets/plan-face-TixBqcS6.js.br +0 -0
- package/dist/client/assets/{plan-render-CnuIySGa.js → plan-render-vgHEu0TD.js} +1 -1
- package/dist/client/assets/plan-render-vgHEu0TD.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-DwTprGe6.js → pr-queue-columns-BuSmGIXt.js} +1 -1
- package/dist/client/assets/pr-queue-columns-BuSmGIXt.js.br +0 -0
- package/dist/client/assets/{radar-panel-DACeGtwh.js → radar-panel-DxjzUFh9.js} +1 -1
- package/dist/client/assets/radar-panel-DxjzUFh9.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-jFZn-4O8.js → repo-roots-adder-B34_Ri9Q.js} +1 -1
- package/dist/client/assets/repo-roots-adder-B34_Ri9Q.js.br +0 -0
- package/dist/client/assets/{resume-dialog-C_CHNy5T.js → resume-dialog-tyq7oqJw.js} +1 -1
- package/dist/client/assets/resume-dialog-tyq7oqJw.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-CCdnDOPU.js → review-queue-panel-ps-6SgCW.js} +1 -1
- package/dist/client/assets/review-queue-panel-ps-6SgCW.js.br +0 -0
- package/dist/client/assets/{session-actions-Bub2ltc2.js → session-actions-ypIyMEo7.js} +2 -2
- package/dist/client/assets/session-actions-ypIyMEo7.js.br +0 -0
- package/dist/client/assets/{session-row-Df0T76cY.js → session-row-CbHGQ5eG.js} +1 -1
- package/dist/client/assets/session-row-CbHGQ5eG.js.br +0 -0
- package/dist/client/assets/{settings-panel-_XUIymvZ.js → settings-panel-CkNUKRJX.js} +2 -2
- package/dist/client/assets/settings-panel-CkNUKRJX.js.br +0 -0
- package/dist/client/assets/{shown-face-BMa5JLIB.js → shown-face-suZaDJ3Z.js} +1 -1
- package/dist/client/assets/shown-face-suZaDJ3Z.js.br +0 -0
- package/dist/client/assets/{trace-panel-wx2Kqqav.js → trace-panel-C3lbzi8d.js} +1 -1
- package/dist/client/assets/trace-panel-C3lbzi8d.js.br +0 -0
- package/dist/client/assets/{usage-panel-BS0KkRJJ.js → usage-panel-BFO8Kh0C.js} +1 -1
- package/dist/client/assets/usage-panel-BFO8Kh0C.js.br +0 -0
- package/dist/client/assets/{your-day-tip-GQc49fcX.js → your-day-tip-0Xbg2Kdf.js} +1 -1
- package/dist/client/assets/your-day-tip-0Xbg2Kdf.js.br +0 -0
- package/dist/client/index.html +3 -3
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/agent-api-cli-CAMV-N8o.js +0 -1
- package/dist/chunks/packs-cli-BzWROst6.js +0 -1
- package/dist/client/assets/arena-panel-Btp9l0kJ.js.br +0 -0
- package/dist/client/assets/benchmark-panel-bmD8zwiZ.js.br +0 -0
- package/dist/client/assets/boards-view-dVxUt_ij.js.br +0 -0
- package/dist/client/assets/community-panel-CTlfTEjN.js.br +0 -0
- package/dist/client/assets/dialogs-58-5mJbh.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-DJIOuOjJ.js.br +0 -0
- package/dist/client/assets/feature-hint-gXmutm6v.js.br +0 -0
- package/dist/client/assets/first-run-checklist-CnUh98nM.js.br +0 -0
- package/dist/client/assets/hooks-panel-Dk9IXA3Y.js.br +0 -0
- package/dist/client/assets/index-D1rSKJEg.js.br +0 -0
- package/dist/client/assets/issues-panel-BNvZI9C8.js.br +0 -0
- package/dist/client/assets/lane-read-token-step-EZJ80NxE.js.br +0 -0
- package/dist/client/assets/my-prs-panel-D4Mwssgi.js.br +0 -0
- package/dist/client/assets/nyan-cat-CQrVjaml.js.br +0 -0
- package/dist/client/assets/phone-shell-BnUVkZu_.js.br +0 -0
- package/dist/client/assets/plan-face-BkOYrRkS.js.br +0 -0
- package/dist/client/assets/plan-render-CnuIySGa.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-DwTprGe6.js.br +0 -0
- package/dist/client/assets/radar-panel-DACeGtwh.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-jFZn-4O8.js.br +0 -0
- package/dist/client/assets/resume-dialog-C_CHNy5T.js.br +0 -0
- package/dist/client/assets/review-queue-panel-CCdnDOPU.js.br +0 -0
- package/dist/client/assets/session-actions-Bub2ltc2.js.br +0 -0
- package/dist/client/assets/session-row-Df0T76cY.js.br +0 -0
- package/dist/client/assets/settings-panel-_XUIymvZ.js.br +0 -0
- package/dist/client/assets/shown-face-BMa5JLIB.js.br +0 -0
- package/dist/client/assets/trace-panel-wx2Kqqav.js.br +0 -0
- package/dist/client/assets/usage-panel-BS0KkRJJ.js.br +0 -0
- package/dist/client/assets/your-day-tip-GQc49fcX.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -5,7 +5,7 @@ import { o as packageRoot } from "../chunks/runtime-paths-DfoHzN15.js";
|
|
|
5
5
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
|
|
6
6
|
import { t as AGENT_API_VERBS } from "../chunks/session-Ctzyy3sF.js";
|
|
7
7
|
import { a as execSync } from "../chunks/child-process-safe-BIh8yQ0I.js";
|
|
8
|
-
import {
|
|
8
|
+
import { it as parseCommand, nt as OWNED_COMMAND_SPECS, r as agentCommandHelpLines, rt as isOwnedCommandName } from "../chunks/agent-api-core-Bxc1V6IS.js";
|
|
9
9
|
import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
|
|
10
10
|
import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-BfOQqktJ.js";
|
|
11
11
|
import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
|
|
@@ -76,23 +76,23 @@ var OWNED_COMMAND_RUNNERS = {
|
|
|
76
76
|
return runAgentSetupCli();
|
|
77
77
|
},
|
|
78
78
|
settings: async (parsed) => {
|
|
79
|
-
const { runParsedSettingsCli } = await import("../chunks/settings-cli-
|
|
79
|
+
const { runParsedSettingsCli } = await import("../chunks/settings-cli-DDupUmFE.js");
|
|
80
80
|
return runParsedSettingsCli(parsed);
|
|
81
81
|
},
|
|
82
82
|
"pr-flows": async (parsed) => {
|
|
83
|
-
const { runPrFlowsCheckCli } = await import("../chunks/pr-flows-cli-
|
|
83
|
+
const { runPrFlowsCheckCli } = await import("../chunks/pr-flows-cli-CC5XrR6y.js");
|
|
84
84
|
return runPrFlowsCheckCli(parsed);
|
|
85
85
|
},
|
|
86
86
|
packs: async (parsed) => {
|
|
87
|
-
const { runPacksCli } = await import("../chunks/packs-cli-
|
|
87
|
+
const { runPacksCli } = await import("../chunks/packs-cli-BGjPjwjC.js");
|
|
88
88
|
return runPacksCli(parsed);
|
|
89
89
|
},
|
|
90
90
|
"pr-action": async (parsed) => {
|
|
91
|
-
const { runPrActionReportCli } = await import("../chunks/pr-flows-cli-
|
|
91
|
+
const { runPrActionReportCli } = await import("../chunks/pr-flows-cli-CC5XrR6y.js");
|
|
92
92
|
return runPrActionReportCli(parsed);
|
|
93
93
|
},
|
|
94
94
|
"ssh-sign": async ({ rawArgs }) => {
|
|
95
|
-
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-
|
|
95
|
+
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-DSCqRc-5.js");
|
|
96
96
|
return runSshSignCli(rawArgs);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
@@ -114,7 +114,7 @@ async function runOwnedCommand(name, subcommandArgs) {
|
|
|
114
114
|
return OWNED_COMMAND_RUNNERS[name](parsed);
|
|
115
115
|
}
|
|
116
116
|
var SUBCOMMAND_RUNNERS = new Map([...Object.keys(OWNED_COMMAND_SPECS).filter(isOwnedCommandName).map((name) => [name, (subcommandArgs) => runOwnedCommand(name, subcommandArgs)]), ...AGENT_API_VERBS.filter((verb) => !isOwnedCommandName(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
|
|
117
|
-
const { runAgentApiCli } = await import("../chunks/agent-api-cli-
|
|
117
|
+
const { runAgentApiCli } = await import("../chunks/agent-api-cli-CN904-o8.js");
|
|
118
118
|
return runAgentApiCli([subcommandName, ...subcommandArgs]);
|
|
119
119
|
}])]);
|
|
120
120
|
var AGENT_INSTALL_COMMAND_BY_ID = {
|
|
@@ -128,7 +128,7 @@ function missingAgentText(agentId) {
|
|
|
128
128
|
}
|
|
129
129
|
async function printSessionLimits() {
|
|
130
130
|
if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
|
|
131
|
-
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-
|
|
131
|
+
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-CN904-o8.js");
|
|
132
132
|
const limitsLines = await sessionLimitsHelpLines();
|
|
133
133
|
console.log(`\n${limitsLines.join("\n")}`);
|
|
134
134
|
}
|
|
@@ -261,7 +261,7 @@ async function runDoctor() {
|
|
|
261
261
|
}
|
|
262
262
|
switchSection("Agents");
|
|
263
263
|
try {
|
|
264
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
264
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-BX-ML3PF.js");
|
|
265
265
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
266
266
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
267
267
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-
|
|
1
|
+
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-Bk606HYU.js";
|
|
@@ -927,6 +927,7 @@ function mapHookToSignal$1(event, payload) {
|
|
|
927
927
|
if (tool === "CronCreate") return "cron-created";
|
|
928
928
|
if (tool === "CronDelete") return "cron-deleted";
|
|
929
929
|
if (tool === "AskUserQuestion") return "working";
|
|
930
|
+
if (isRecord(payload?.tool_response) && typeof payload.tool_response.backgroundTaskId === "string") return "background-task-launched";
|
|
930
931
|
return null;
|
|
931
932
|
}
|
|
932
933
|
case "notification": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as askAgentApi, n as postToAgentIngress, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-D5i6Aaxk.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { at as WhiteboardAgentReply, r as AGENT_URL_ENV, tt as UNIT_STATUSES, u as AgentLimitsReply } from "./session-Ctzyy3sF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Y as formatSessionLimits, i as agentCommandSpec, it as parseCommand, m as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-Bxc1V6IS.js";
|
|
3
3
|
import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
|
|
4
4
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
5
5
|
import { h as layoutBoard, i as describeOverCap, p as boardSvgDocument, v as planSteps } from "./shown-files-core-AKNIXRfL.js";
|
|
@@ -1102,6 +1102,11 @@ function isSelfWakePrompt(prompt) {
|
|
|
1102
1102
|
if (typeof prompt !== "string") return false;
|
|
1103
1103
|
return prompt.replace(TASK_NOTIFICATION_ENVELOPE_PATTERN, " ").trim() === "" && prompt.trim() !== "";
|
|
1104
1104
|
}
|
|
1105
|
+
var NOTIFIED_TASK_ID_PATTERN = /<task-id>\s*([^<\s]+)\s*<\/task-id>/gi;
|
|
1106
|
+
function extractNotifiedTaskIds(prompt) {
|
|
1107
|
+
if (typeof prompt !== "string") return [];
|
|
1108
|
+
return (prompt.match(TASK_NOTIFICATION_ENVELOPE_PATTERN) ?? []).flatMap((envelope) => [...envelope.matchAll(NOTIFIED_TASK_ID_PATTERN)].map((match) => match[1]));
|
|
1109
|
+
}
|
|
1105
1110
|
function isSubstantivePrompt(prompt) {
|
|
1106
1111
|
if (typeof prompt !== "string") return false;
|
|
1107
1112
|
const cleanedPrompt = cleanTaskPrompt(prompt);
|
|
@@ -1860,4 +1865,4 @@ function agentCommandSpec(verb) {
|
|
|
1860
1865
|
};
|
|
1861
1866
|
}
|
|
1862
1867
|
//#endregion
|
|
1863
|
-
export {
|
|
1868
|
+
export { routeAgentNotes as $, isSubstantivePrompt as A, resolveResumeTarget as B, decideTaskTitleRefinement as C, extractOscTaskTitle as D, extractNotifiedTaskIds as E, seedTaskTitleSources as F, listRepoWorktreePaths as G, shouldAdoptReportedResumeId as H, AUTO_CONTINUE_PROMPT as I, describeSessionLimits as J, isAutoNameOf as K, RESUME_ID_RE as L, parseRefinedTaskTitle as M, resolveRefocusTaskTitle as N, extractPromptTaskTitle as O, resolveTaskTitle as P, promptHintFor as Q, isConversationReplacedAtStartup as R, cleanTaskPrompt as S, extractHookTaskTitle as T, claudeProjectsDir as U, resumePromptFor as V, listRepoConversations as W, hintFor as X, formatSessionLimits as Y, permitsHelpCommand as Z, projectReviewDetail as _, checkAgentReply as a, buildTaskTitleRefinementPrompt as b, deriveChildSessionName as c, describePushLanding as d, supervisionLine as et, describeRoleRefusal as f, projectMyPrs as g, parseAgentVerb as h, agentCommandSpec as i, parseCommand as it, parseRefinedSessionName as j, isSelfWakePrompt as k, describeChildEndNote as l, isAgentApiVerb as m, REFUSAL_REASON as n, OWNED_COMMAND_SPECS as nt, decideAgentRequest as o, describeUnpushedCloseRefusal as p, nextSuggestedName as q, agentCommandHelpLines as r, isOwnedCommandName as rt, decideSpawnAllowance as s, AGENT_COMMAND_HELP as t, toolHookFactsOf as tt, describeKeptChildAttention as u, projectReviews as v, extractAiTitle as w, chooseRefinedSessionName as x, buildPersistedTaskTitle as y, pickAutoResume as z };
|
|
@@ -5,7 +5,7 @@ import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfi
|
|
|
5
5
|
import { $ as Op, $n as STATES, $t as TeamReviewStateEntry, A as SESSION_NAME_PATTERN, B as SshSignRequest, Bn as shortSha, Bt as PostingPlan, C as CONVERSATION_TOOL_RESULT_HOOK_EVENT, Dt as MyPrsSnapshot, Et as MyPrThreadsResponse, Fn as prActionReportPath, Ft as EarlierReview, Gt as ReviewFinding, H as TaskTitle, Hn as NODE_ID_RE, It as FindingSeverity, Jt as ReviewVerdict, K as Board, Kt as ReviewResult, M as SHOWN_FILE_CAP_BYTES, Mn as PrThreadUnresolveResponse, N as SIGN_URL_ENV, Nt as CommitSha$1, O as SESSION_DOC_BODY_CAP_BYTES, On as PrFlowsSettings, Ot as MyPrsState, P as SSH_SIGN_BODY_CAP_BYTES, Pt as DECIDING_REVIEW_STATES, Q as Note, Qn as RESTARTABLE_STATES, Qt as TeamReviewResolveResponse, R as ShownFile, Rt as GithubReviewState, S as CONVERSATION_PERMISSION_HOOK_EVENT, St as MyPrMergeWhenReadyRequest, T as ConversationQuestion, Tn as PrFlowSaveRuleRequest, Tt as MyPrThreadNode, Un as REPO_SLUG_RE, Ut as ReviewComment, Vn as GH_SEGMENT, Vt as PrDetail, W as BOARD_MEDIA_MAX_EDGE_PX, Wn as repoParts, Wt as ReviewDraft, X as Box, Xn as KILLABLE_STATES, Yn as BADGE_LABELS, Yt as TeamReviewActionRequest, Z as Frame, Zn as MERGEABLE_LIVE_STATES, Zt as TeamReviewCompareFiles, _ as AgentSettingsRequest, _n as PrFlowDisposeRequest, _t as MyPrLaneEntry, an as decisionAsIfApprovalRequired, b as COHERENCE_HOOKS_INACTIVE, bn as PrFlowItemRequest, c as AgentCloseRequest, cn as PR_ACTION_REPORT_BODY_CAP_BYTES, ct as sparseBoardRecord, d as AgentPacksRequest, dn as PR_ACTION_TOKEN_ENV, dt as MyPr, en as TeamReviewStatus, et as Panel, f as AgentPullRequestRequest, ft as MyPrAutoRebase, hn as PrFlowApproveRequest, ht as MyPrKeepMergeableRequest, i as ASK_USER_QUESTION_TOOL_NAME, in as canApproveAfterComment, it as WHITEBOARD_LIMITS, j as SESSION_NAME_RULE_TEXT, jn as PrThreadReplyResponse, kn as PrFlowsState, l as AgentEditRequest, ln as PR_ACTION_REPORT_ROUTE, lt as sparseBoardReply, mn as PrActionRunRequest, mt as MyPrCheckContextsResponse, nn as TeamReviewThreadResult, nt as Unit, o as AgentAttentionRequest, pn as PrActionReportBody, pt as MyPrCheckContext, q as BoardRecord, qt as ReviewThreadId, r as AGENT_URL_ENV, rn as TeamReviewThreadsRepository, rt as WHITEBOARD_ASSET_ROUTE, sn as hasStandingViewerApproval, st as Wire, tn as TeamReviewThreadCommentsResponse, un as PR_ACTION_REPORT_URL_ENV, ut as LinkedPr, v as AgentSpawnRequest, vt as MyPrMergeMethod, wn as PrFlowRule, x as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, xt as MyPrMergeStateResponse, y as AgentWhyRequest, yt as MyPrMergeRequest, zn as HEX_SHA_RE, zt as PostedReviewEvent } from "./session-Ctzyy3sF.js";
|
|
6
6
|
import { c as runCommandSafely$1, i as execFileSync, l as spawn, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BIh8yQ0I.js";
|
|
7
7
|
import { $ as WorkflowsSettings, A as BenchmarkId, At as IssuesStatus, B as CommunityDraft, Bt as changeMapFactId, C as RaceRecord, D as EFFORT_OPTION_ID, Dt as IssueUpdate, E as DEFAULT_MODELS, Et as IssueKey, F as CommitComparison, Ft as MAX_RAW_LINE_CHARS, G as SKILL_NAME_RE, H as CommunityState, I as MergedPrListing, It as TraceCheckpoint, J as GithubPrLightSearchNode, K as GithubPrDetailNode, Kt as GithubTeam, L as MinedPrReviewData, Lt as TraceRecord, M as BenchmarkRun, N as BenchmarkStatus, Nt as HookEnvelope, O as BenchmarkActionRequest, Ot as IssuesSearchResponse, P as BenchmarkSuite, Pt as SessionSetup, Q as WorkflowLabelName, Qt as pullRequestKeyFromReference, R as PrCheckoutCaseInput, Rt as CoherenceJournalOutput, T as CATALOG_AGENT_IDS, Tt as GithubIssueResponse, U as CommunityVerdict, Ut as CLIENT_LOG_TEXT_MAX_CHARS, V as CommunityItem, Vt as CHANGES_POLL_INTERVAL_MS, W as DISCORD_CHANNEL_NAME_RE, Wt as CONTROL_FRAME_MAX_BYTES, X as comparablePrKey, Y as GithubPrsFrame, Z as WorkflowCommentBody, _ as FeatureHintState, a as ConfigUpdate, an as PLAN_RESULT_HOOK_EVENT, c as SHELL_AGENT_ID, cn as PlanRevision, et as WorkflowsState, f as USAGE_COST_MODES, g as PackApproveRequest, h as ClientMessage, in as PLAN_HOOK_OUTPUT_MAX_CHARS, j as BenchmarkJudgement, jt as issuePullRequestStateFromGithub, k as BenchmarkCase, kt as IssuesState, ln as parseExitPlanModeHookPayload, n as BUILTIN_AGENT_IDS, nn as PLAN_BODY_CAP_BYTES, on as PLAN_TOOL_NAME, ot as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, p as USAGE_VENDOR_KEYS, q as GithubPrKey, r as BrowserConfig, rn as PLAN_HOOK_EVENT, s as RUNTIME_CONFIG_SCALAR_KEYS, sn as PlanDecision, tn as UpdateJournal, u as configIssueMessage, un as planTitle, v as HINT_FEATURES, w as RaceSpec, wt as GithubIssuePullRequestsRepository, x as JudgeResult, y as HINT_VIEW_BY_FEATURE, yt as USAGE_INTEGER_RANGES, z as CommunityActionRequest, zt as ChangeMap } from "./config-BmJ9RqVi.js";
|
|
8
|
-
import { $ as
|
|
8
|
+
import { $ as routeAgentNotes, A as isSubstantivePrompt, B as resolveResumeTarget, C as decideTaskTitleRefinement, D as extractOscTaskTitle, E as extractNotifiedTaskIds, F as seedTaskTitleSources, G as listRepoWorktreePaths, H as shouldAdoptReportedResumeId, I as AUTO_CONTINUE_PROMPT, J as describeSessionLimits, K as isAutoNameOf, L as RESUME_ID_RE, M as parseRefinedTaskTitle, N as resolveRefocusTaskTitle, O as extractPromptTaskTitle, P as resolveTaskTitle, Q as promptHintFor, R as isConversationReplacedAtStartup, S as cleanTaskPrompt, T as extractHookTaskTitle, U as claudeProjectsDir, V as resumePromptFor, W as listRepoConversations, X as hintFor, Z as permitsHelpCommand, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, et as supervisionLine, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedSessionName, k as isSelfWakePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as nextSuggestedName, s as decideSpawnAllowance, tt as toolHookFactsOf, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as pickAutoResume } from "./agent-api-core-Bxc1V6IS.js";
|
|
9
9
|
import { a as rawTextOr, i as positiveNumberOr, n as isRecord$2, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
|
|
10
10
|
import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-BfOQqktJ.js";
|
|
11
11
|
import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
|
|
@@ -19,7 +19,7 @@ import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
|
|
|
19
19
|
import { C as parseCgroupBytes, D as DEFAULT_MAX_MS, E as DEFAULT_BASE_MS, O as nextBackoffMs, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, f as writeTextAtomic, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-AKRVPqG1.js";
|
|
20
20
|
import { $ as buildAiGenerationEvents, Ct as isSameDirectoryPath, D as settingsBlockSpecFor, E as mergeSettingsBlock, G as LOGGED_FAST_CLOSE_COUNTS, H as isExperimentalSetting, J as parseDataClientMessage, K as describeDataAttach, O as validateSettingsBlock, Q as adapterBucket, St as comparableDirectoryPath, U as DEEP_HISTORY_SCROLLBACK_LINES, X as TELEMETRY_BATCH_URL, Y as FIRST_RUN_NOTICE, Z as TELEMETRY_FLAGS_URL, _ as sessionIdFromBranch, a as generateProjectId, at as codexUserIdOf, b as DEFAULT_TIMER_FNS, ct as decideTelemetryConsent, d as DEFAULT_CONFIG, dt as parsePosthogReleaseId, et as buildBrowserExceptionProperties, f as DEFAULT_BRANCH_GC_PREFIXES, ft as resolveProjectToken, g as planWorktreeGc, gt as TelemetryState, h as planBranchGc, ht as TELEMETRY_EVENT_SCHEMAS, i as ensureProjectIds, it as claudeAccountUuidOf, k as SETTINGS_INDEX, lt as exceptionFingerprint, m as matchedPrefix, mt as PendingCrashReport, n as createConfigStore, nt as buildPersonProperties, o as glimmervoidHomeDir$1, ot as decideIsDevInstall, p as isGcCandidateWorktree, pt as DashboardTelemetryReport, q as parseDataAttach, r as ABORT_CONFIG_SAVE, rt as classifySessionExit, st as decideRemoteTelemetryState, tt as buildExceptionProperties, ut as nodeMajorVersion, v as usablePrefixes, x as unrefTimer, xt as canonicalizePath, y as worktreeIntegrationTips, yt as stableConfigKey, z as valueAtPath } from "./config-store-6XipBvYu.js";
|
|
21
21
|
import { i as resolveArgvCommandMatches, t as kimi } from "./kimi-DU7pXLJd.js";
|
|
22
|
-
import { $ as grokHomes, A as decideUploadType, At as generateToken, B as containmentRefusalReason, Bt as readStoredHooks, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as HOOK_EVENTS, E as shortSha$1, Et as claudeCode, F as planUploadRetention, Ft as agentHookGroupOf, G as codexFallbackRoots, Gt as sweepOrphanedHostScratch, H as planContiguousRead, Ht as upsertHook, I as MAX_TRANSCRIPT_READ_BYTES, It as appendUserHooks, J as codexSessionIdFromPath, Jt as recordSweptPath, K as codexHomes, Kt as appendRemovalRecord, L as TRACE_TAIL_SCAN_BYTES, Lt as hooksForProject, M as framePathPaste, Mt as writeSessionSettings, N as imageMimeForUploadFilename, Nt as HOOK_EVENT_CATALOG, O as MAX_UPLOAD_BYTES, Ot as PLAN_HOLD_RELEASE_MS, P as isSafePathSegment, Pt as ID_RE, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, Rt as normalizeHook, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, Ut as HOOK_TOOLS, V as isOversizedPartialLine, Vt as removeHook, W as withCommittedOffset, Wt as makeHostScratchDirectory, X as decideFileRead, Y as continuationDelayMs, Yt as removalsJournalPath, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, jt as sweepOrphans, k as buildUploadFilename, kt as buildHookSettings, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, qt as appendRemovalRecordSync, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine$1, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-
|
|
22
|
+
import { $ as grokHomes, A as decideUploadType, At as generateToken, B as containmentRefusalReason, Bt as readStoredHooks, C as parseRegistryLatest, Ct as shouldReplace, D as openContainedFile, Dt as HOOK_EVENTS, E as shortSha$1, Et as claudeCode, F as planUploadRetention, Ft as agentHookGroupOf, G as codexFallbackRoots, Gt as sweepOrphanedHostScratch, H as planContiguousRead, Ht as upsertHook, I as MAX_TRANSCRIPT_READ_BYTES, It as appendUserHooks, J as codexSessionIdFromPath, Jt as recordSweptPath, K as codexHomes, Kt as appendRemovalRecord, L as TRACE_TAIL_SCAN_BYTES, Lt as hooksForProject, M as framePathPaste, Mt as writeSessionSettings, N as imageMimeForUploadFilename, Nt as HOOK_EVENT_CATALOG, O as MAX_UPLOAD_BYTES, Ot as PLAN_HOLD_RELEASE_MS, P as isSafePathSegment, Pt as ID_RE, Q as expandTilde, R as committedOffsetFromTraceTailOrNull, Rt as normalizeHook, S as parseRegistryDeprecation, St as parseUsageLine, T as pickNewestPublished, Tt as vendorUsageEntry, U as resumeOffsetFrom, Ut as HOOK_TOOLS, V as isOversizedPartialLine, Vt as removeHook, W as withCommittedOffset, Wt as makeHostScratchDirectory, X as decideFileRead, Y as continuationDelayMs, Yt as removalsJournalPath, Z as dedupeCodexFiles, _ as decideInstallFlavor, _t as foldReplacementIntoGenerationRollup, a as describeAgentResolvability, at as scopedClaudeRoots, b as normalizeSha, bt as mergeGenerationRollups, c as isKnownAgentId, ct as shouldPersistWarehouse, d as resolveAdapter, dt as parseKimiUsageLine, et as isUsageFile, f as setCustomAgents, ft as addEntryToTotals, g as NODE_PTY_INSTALL_SCRIPT_FLAG, gt as foldEntryIntoGenerationRollup, h as requestCodexAppServer, ht as expandAdvisorIterations, i as customAgentFingerprint, it as resolveProjectsDirs, j as exceedsUploadCap, jt as sweepOrphans, k as buildUploadFilename, kt as buildHookSettings, l as listAgentIds, lt as splitLines, m as readHostCodexVersion, mt as emptyTotals, n as cachedAgentResolvability, nt as passOutcome, o as getAdapter, ot as sessionsRootCandidates, p as codex, pt as dedupKeys, q as codexRootCandidates, qt as appendRemovalRecordSync, r as commandFor, rt as projectDirCandidates, s as hookProfileOf, st as shouldEvaluateDespiteIoFailures, t as DEFAULT_AGENT_ID$1, tt as kimiHomes, u as resetCommandCache, ut as kimiDedupIdentity, v as decideUpdateStatus, vt as identityFromRelPath, w as parseResolvedSha, wt as totalTokensOf$1, x as normalizeUpdateChannel, xt as parseJsonLine$1, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-Bk606HYU.js";
|
|
23
23
|
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-CbCN4fxx.js";
|
|
24
24
|
import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-UaqVWfqV.js";
|
|
25
25
|
import { A as prActionRunAfterExit, B as unknownActionWarnings, C as fixLocallyPrompt, D as packPathsOf, E as mergeItems, F as scopedToRepo, G as withPrActionRun, H as withHandled, I as shouldTellBranchMoved, J as decideHostAllowed, K as withReopened, L as sourceCandidates$1, M as prFlowRules, N as prFlowSetup, O as plannedActions, P as savedRuleFor, R as teammateThreadItems, T as itemLocation, U as withInterruptedRuns, V as visibleRun, W as withOnlyOpenPrs, _ as packRow, b as branchMovedNote, c as packsStatePath, d as PACK_FILE_NAME, f as PacksState, g as packFileHeaders, h as approvedPackThemes, m as approvedPackPanels, n as readPacksForAgent, o as PACKS_DIR_NAME, q as withRuleRun, s as packDirsUnder, u as readPackDir, v as pendingPackNote, w as flaggingReviewers, x as commandFingerprint, y as acceptReport, z as threadCandidates } from "./pack-agent-kPL1_C11.js";
|
|
@@ -17556,6 +17556,7 @@ var WEAK_TASK_TYPES = /* @__PURE__ */ new Set(["shell", "monitor"]);
|
|
|
17556
17556
|
var NON_GATING_TASK_TYPES = /* @__PURE__ */ new Set(["dream", "monitor"]);
|
|
17557
17557
|
var DEFAULT_SHELL_TASK_TTL_MS = 36e5;
|
|
17558
17558
|
var DEFAULT_TEAMMATE_TASK_TTL_MS = 9e4;
|
|
17559
|
+
var DEFAULT_NOTIFICATION_DELIVERY_WINDOW_MS = 1e4;
|
|
17559
17560
|
function declaredActiveCount(entries, idleIds, ageMs = 0, weakTtlMs = DEFAULT_SHELL_TASK_TTL_MS, idleNameCount = 0, teammateTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS, agentTtlMs = DEFAULT_AGENT_TTL_MS) {
|
|
17560
17561
|
if (!entries) return 0;
|
|
17561
17562
|
let activeCount = 0;
|
|
@@ -17586,13 +17587,14 @@ function declaredEntryAgeStartTs(entry, declaredTs, declaredFirstSeenTs) {
|
|
|
17586
17587
|
if (!WEAK_TASK_TYPES.has(entry.type) || !entry.id) return declaredTs;
|
|
17587
17588
|
return declaredFirstSeenTs?.get(entry.id) ?? declaredTs;
|
|
17588
17589
|
}
|
|
17589
|
-
function msUntilNextDrain({ countedAgents = null, declaredEntries = null, declaredTs = 0, declaredFirstSeenTs = void 0, idleIds = null, now = 0, agentTtlMs = DEFAULT_AGENT_TTL_MS, weakTtlMs = DEFAULT_SHELL_TASK_TTL_MS, teammateTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS } = {}) {
|
|
17590
|
+
function msUntilNextDrain({ countedAgents = null, declaredEntries = null, declaredTs = 0, declaredFirstSeenTs = void 0, idleIds = null, now = 0, agentTtlMs = DEFAULT_AGENT_TTL_MS, weakTtlMs = DEFAULT_SHELL_TASK_TTL_MS, teammateTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS, undeliveredSettledTasks = null, notificationDeliveryWindowMs = DEFAULT_NOTIFICATION_DELIVERY_WINDOW_MS } = {}) {
|
|
17590
17591
|
let earliestExpiry = null;
|
|
17591
17592
|
const consider = (expiresAt) => {
|
|
17592
17593
|
if (expiresAt <= now) return;
|
|
17593
17594
|
if (earliestExpiry === null || expiresAt < earliestExpiry) earliestExpiry = expiresAt;
|
|
17594
17595
|
};
|
|
17595
17596
|
if (countedAgents) for (const ts of countedAgents.values()) consider(ts + agentTtlMs);
|
|
17597
|
+
if (undeliveredSettledTasks) for (const settledTs of undeliveredSettledTasks.values()) consider(settledTs + notificationDeliveryWindowMs);
|
|
17596
17598
|
if (declaredEntries) for (const e of declaredEntries) {
|
|
17597
17599
|
if (e.id && idleIds && idleIds.has(e.id)) continue;
|
|
17598
17600
|
if (e.type && NON_GATING_TASK_TYPES.has(e.type)) continue;
|
|
@@ -17612,7 +17614,7 @@ function evictDepartedTeammateNames(idleTeammateNames, declaredTeammateIds, curr
|
|
|
17612
17614
|
}
|
|
17613
17615
|
return currentTeammateIds;
|
|
17614
17616
|
}
|
|
17615
|
-
function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs = DEFAULT_SHELL_TASK_TTL_MS, teammateTaskTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS, now = Date.now } = {}) {
|
|
17617
|
+
function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs = DEFAULT_SHELL_TASK_TTL_MS, teammateTaskTtlMs = DEFAULT_TEAMMATE_TASK_TTL_MS, notificationDeliveryWindowMs = DEFAULT_NOTIFICATION_DELIVERY_WINDOW_MS, now = Date.now } = {}) {
|
|
17616
17618
|
const countedAgents = /* @__PURE__ */ new Map();
|
|
17617
17619
|
const observedAgentIdsThisTurn = /* @__PURE__ */ new Set();
|
|
17618
17620
|
const orphanAgentStops = /* @__PURE__ */ new Map();
|
|
@@ -17622,6 +17624,8 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17622
17624
|
const idleTaskIds = /* @__PURE__ */ new Set();
|
|
17623
17625
|
const idleTeammateNames = /* @__PURE__ */ new Map();
|
|
17624
17626
|
let declaredTeammateIds = /* @__PURE__ */ new Set();
|
|
17627
|
+
const launchedBackgroundTasks = /* @__PURE__ */ new Map();
|
|
17628
|
+
const undeliveredSettledTasks = /* @__PURE__ */ new Map();
|
|
17625
17629
|
let breakdown = {
|
|
17626
17630
|
counted: 0,
|
|
17627
17631
|
declared: 0,
|
|
@@ -17635,6 +17639,8 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17635
17639
|
pruneAgents(countedAgents, at, agentTtlMs);
|
|
17636
17640
|
pruneAgents(orphanAgentStops, at, agentTtlMs);
|
|
17637
17641
|
pruneAgents(idleTeammateNames, at, agentTtlMs);
|
|
17642
|
+
pruneAgents(launchedBackgroundTasks, at, shellTaskTtlMs);
|
|
17643
|
+
pruneAgents(undeliveredSettledTasks, at, notificationDeliveryWindowMs);
|
|
17638
17644
|
if (declaredEntries === null) return;
|
|
17639
17645
|
if (declaredEntries.some((entry) => entryAgeMs(entry, at) < declaredEntryTtlMs(entry.type, shellTaskTtlMs, teammateTaskTtlMs, agentTtlMs))) return;
|
|
17640
17646
|
declaredEntries = null;
|
|
@@ -17673,6 +17679,11 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17673
17679
|
const declaredIds = new Set(entries.flatMap((e) => e.id ? [e.id] : []));
|
|
17674
17680
|
for (const id of declaredFirstSeenTs.keys()) if (!declaredIds.has(id)) declaredFirstSeenTs.delete(id);
|
|
17675
17681
|
for (const id of declaredIds) if (!declaredFirstSeenTs.has(id)) declaredFirstSeenTs.set(id, declaredTs);
|
|
17682
|
+
for (const id of launchedBackgroundTasks.keys()) {
|
|
17683
|
+
if (declaredIds.has(id)) continue;
|
|
17684
|
+
launchedBackgroundTasks.delete(id);
|
|
17685
|
+
undeliveredSettledTasks.set(id, declaredTs);
|
|
17686
|
+
}
|
|
17676
17687
|
for (const id of idleTaskIds) if (!declaredIds.has(id)) idleTaskIds.delete(id);
|
|
17677
17688
|
declaredTeammateIds = evictDepartedTeammateNames(idleTeammateNames, declaredTeammateIds, entries);
|
|
17678
17689
|
if (declaredActiveCount(entries, idleTaskIds, (entry) => entryAgeMs(entry, declaredTs), shellTaskTtlMs, 0, teammateTaskTtlMs, agentTtlMs) === 0 && countedAgents.size > 0) countedAgents.clear();
|
|
@@ -17706,6 +17717,16 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17706
17717
|
if (agentId.startsWith(prefix) && /^[0-9a-f]+$/i.test(agentId.slice(prefix.length))) idleTeammateNames.delete(name);
|
|
17707
17718
|
}
|
|
17708
17719
|
},
|
|
17720
|
+
noteBackgroundTaskLaunched(taskId) {
|
|
17721
|
+
undeliveredSettledTasks.delete(taskId);
|
|
17722
|
+
launchedBackgroundTasks.set(taskId, now());
|
|
17723
|
+
},
|
|
17724
|
+
noteTaskNotificationsDelivered(taskIds) {
|
|
17725
|
+
for (const taskId of taskIds) {
|
|
17726
|
+
launchedBackgroundTasks.delete(taskId);
|
|
17727
|
+
undeliveredSettledTasks.delete(taskId);
|
|
17728
|
+
}
|
|
17729
|
+
},
|
|
17709
17730
|
activeCount() {
|
|
17710
17731
|
const at = now();
|
|
17711
17732
|
reap(at);
|
|
@@ -17716,7 +17737,7 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17716
17737
|
idleNames: idleTeammateNames.size,
|
|
17717
17738
|
idleTasks: idleTaskIds.size
|
|
17718
17739
|
};
|
|
17719
|
-
return Math.max(countedAgents.size, declared);
|
|
17740
|
+
return Math.max(countedAgents.size, declared + undeliveredSettledTasks.size);
|
|
17720
17741
|
},
|
|
17721
17742
|
isOnlyBackgroundTasks() {
|
|
17722
17743
|
const at = now();
|
|
@@ -17742,7 +17763,9 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17742
17763
|
now: at,
|
|
17743
17764
|
agentTtlMs,
|
|
17744
17765
|
weakTtlMs: shellTaskTtlMs,
|
|
17745
|
-
teammateTtlMs: teammateTaskTtlMs
|
|
17766
|
+
teammateTtlMs: teammateTaskTtlMs,
|
|
17767
|
+
undeliveredSettledTasks,
|
|
17768
|
+
notificationDeliveryWindowMs
|
|
17746
17769
|
});
|
|
17747
17770
|
},
|
|
17748
17771
|
clear() {
|
|
@@ -17755,6 +17778,8 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17755
17778
|
idleTaskIds.clear();
|
|
17756
17779
|
idleTeammateNames.clear();
|
|
17757
17780
|
declaredTeammateIds.clear();
|
|
17781
|
+
launchedBackgroundTasks.clear();
|
|
17782
|
+
undeliveredSettledTasks.clear();
|
|
17758
17783
|
},
|
|
17759
17784
|
inspect() {
|
|
17760
17785
|
return {
|
|
@@ -17766,7 +17791,9 @@ function createTaskRegistry({ agentTtlMs = DEFAULT_AGENT_TTL_MS, shellTaskTtlMs
|
|
|
17766
17791
|
declaredFirstSeenTs: new Map(declaredFirstSeenTs),
|
|
17767
17792
|
idleTaskIds: new Set(idleTaskIds),
|
|
17768
17793
|
idleTeammateNames: new Map(idleTeammateNames),
|
|
17769
|
-
declaredTeammateIds: new Set(declaredTeammateIds)
|
|
17794
|
+
declaredTeammateIds: new Set(declaredTeammateIds),
|
|
17795
|
+
launchedBackgroundTasks: new Map(launchedBackgroundTasks),
|
|
17796
|
+
undeliveredSettledTasks: new Map(undeliveredSettledTasks)
|
|
17770
17797
|
};
|
|
17771
17798
|
}
|
|
17772
17799
|
};
|
|
@@ -21322,6 +21349,12 @@ function extractCronTaskId(payload) {
|
|
|
21322
21349
|
//#region session/session-background-tracking.ts
|
|
21323
21350
|
var SCHEDULED_WAKEUP_KEY = "scheduled-wakeup";
|
|
21324
21351
|
var MAX_TIMER_DELAY_MS = 2147483647;
|
|
21352
|
+
function launchedBackgroundTaskId(payload) {
|
|
21353
|
+
const toolResponse = payload.tool_response;
|
|
21354
|
+
if (!isRecord$2(toolResponse)) return null;
|
|
21355
|
+
const backgroundTaskId = toolResponse.backgroundTaskId;
|
|
21356
|
+
return typeof backgroundTaskId === "string" && backgroundTaskId ? backgroundTaskId : null;
|
|
21357
|
+
}
|
|
21325
21358
|
function createSessionBackgroundTracking({ detectBackgroundAgents, agentTtlMs, shellTaskTtlMs, teammateTaskTtlMs, gateReleaseSettleMs, detectScheduledWakeups, port }) {
|
|
21326
21359
|
const tasks = createTaskRegistry({
|
|
21327
21360
|
agentTtlMs,
|
|
@@ -21481,6 +21514,11 @@ function createSessionBackgroundTracking({ detectBackgroundAgents, agentTtlMs, s
|
|
|
21481
21514
|
const payload = raw.payload || {};
|
|
21482
21515
|
const taskId = typeof payload.task_id === "string" && payload.task_id ? payload.task_id : null;
|
|
21483
21516
|
const name = typeof payload.teammate_name === "string" ? payload.teammate_name : "";
|
|
21517
|
+
if (raw.signal === "background-task-launched") {
|
|
21518
|
+
const backgroundTaskId = launchedBackgroundTaskId(payload);
|
|
21519
|
+
if (backgroundTaskId) tasks.noteBackgroundTaskLaunched(backgroundTaskId);
|
|
21520
|
+
return;
|
|
21521
|
+
}
|
|
21484
21522
|
if (raw.signal === "task-created") {
|
|
21485
21523
|
clearGateHeldReady();
|
|
21486
21524
|
tasks.noteTaskCreated({
|
|
@@ -21499,6 +21537,12 @@ function createSessionBackgroundTracking({ detectBackgroundAgents, agentTtlMs, s
|
|
|
21499
21537
|
if (!name) return;
|
|
21500
21538
|
tasks.noteTeammateIdle(name, Date.now());
|
|
21501
21539
|
}
|
|
21540
|
+
function noteTaskNotificationsDelivered(prompt) {
|
|
21541
|
+
if (!detectBackgroundAgents) return;
|
|
21542
|
+
const deliveredTaskIds = extractNotifiedTaskIds(prompt);
|
|
21543
|
+
if (deliveredTaskIds.length === 0) return;
|
|
21544
|
+
withAgentCount(() => tasks.noteTaskNotificationsDelivered(deliveredTaskIds));
|
|
21545
|
+
}
|
|
21502
21546
|
function trackSubagent(raw) {
|
|
21503
21547
|
if (!detectBackgroundAgents) return;
|
|
21504
21548
|
const declaredAgentId = raw.payload?.agent_id;
|
|
@@ -21635,6 +21679,7 @@ function createSessionBackgroundTracking({ detectBackgroundAgents, agentTtlMs, s
|
|
|
21635
21679
|
applyBackgroundTasks,
|
|
21636
21680
|
clearBgDeclared,
|
|
21637
21681
|
trackTaskLifecycle,
|
|
21682
|
+
noteTaskNotificationsDelivered,
|
|
21638
21683
|
trackSubagent,
|
|
21639
21684
|
activeAgentCount,
|
|
21640
21685
|
awaitingBackgroundTasks,
|
|
@@ -22566,7 +22611,7 @@ var Session = class extends EventEmitter {
|
|
|
22566
22611
|
this.backgroundTracking.trackSubagent(raw);
|
|
22567
22612
|
return;
|
|
22568
22613
|
}
|
|
22569
|
-
if (raw && (raw.signal === "task-created" || raw.signal === "task-completed" || raw.signal === "teammate-idle")) {
|
|
22614
|
+
if (raw && (raw.signal === "task-created" || raw.signal === "task-completed" || raw.signal === "teammate-idle" || raw.signal === "background-task-launched")) {
|
|
22570
22615
|
this.backgroundTracking.trackTaskLifecycle(raw);
|
|
22571
22616
|
return;
|
|
22572
22617
|
}
|
|
@@ -22631,6 +22676,7 @@ var Session = class extends EventEmitter {
|
|
|
22631
22676
|
this._observeCompaction("resume");
|
|
22632
22677
|
this._titleQuiet = false;
|
|
22633
22678
|
this._setPendingPromptKind(null);
|
|
22679
|
+
this.backgroundTracking.noteTaskNotificationsDelivered(raw.payload?.prompt);
|
|
22634
22680
|
this.backgroundTracking.clearGateHeldReady();
|
|
22635
22681
|
this.backgroundTracking.resetTurnEvidence();
|
|
22636
22682
|
this.backgroundTracking.clearBgDeclared();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as runPacksCli } from "./packs-cli-wE9e0PRp.js";
|
|
@@ -398,7 +398,7 @@ async function runList() {
|
|
|
398
398
|
process.stderr.write("glimmervoid packs list reads the running Glimmervoid, so it works inside a Glimmervoid session; the operator sees the same list in Settings, Packs\n");
|
|
399
399
|
return 1;
|
|
400
400
|
}
|
|
401
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
401
|
+
const { askAgentApi } = await import("./agent-api-cli-CN904-o8.js");
|
|
402
402
|
const reply = AGENT_REPLY_SCHEMAS.packs.safeParse(await askAgentApi("packs", { command: "list" }));
|
|
403
403
|
if (!reply.success) {
|
|
404
404
|
process.stderr.write("glimmervoid packs list: Glimmervoid did not answer with a pack list\n");
|
|
@@ -5,7 +5,7 @@ import { c as runCommandSafely } from "./child-process-safe-BIh8yQ0I.js";
|
|
|
5
5
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
6
6
|
import { B as unknownActionWarnings, F as scopedToRepo, M as prFlowRules, S as expandPlaceholders, j as prFlowCommands, x as commandFingerprint } from "./pack-agent-kPL1_C11.js";
|
|
7
7
|
import { t as createPrFlowsExternal } from "./pr-flows-external-DoqZWZkV.js";
|
|
8
|
-
import { t as runPackCheckCli } from "./packs-cli-
|
|
8
|
+
import { t as runPackCheckCli } from "./packs-cli-wE9e0PRp.js";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import os from "node:os";
|
|
@@ -100,7 +100,7 @@ async function readServerConfig(askSetting) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
async function readConfigFromServer() {
|
|
103
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
103
|
+
const { askAgentApi } = await import("./agent-api-cli-CN904-o8.js");
|
|
104
104
|
return readServerConfig((settingPath) => askAgentApi("settings", {
|
|
105
105
|
command: "get",
|
|
106
106
|
path: settingPath
|
|
@@ -241,7 +241,7 @@ async function runPrActionReport({ outcome, message, env }, io) {
|
|
|
241
241
|
io.writeError("--outcome must be started, done, failed or refused, and --message at most 500 characters\n");
|
|
242
242
|
return 1;
|
|
243
243
|
}
|
|
244
|
-
const { postToAgentIngress } = await import("./agent-api-cli-
|
|
244
|
+
const { postToAgentIngress } = await import("./agent-api-cli-CN904-o8.js");
|
|
245
245
|
const reply = await postToAgentIngress({
|
|
246
246
|
endpoint: new URL(reportUrl),
|
|
247
247
|
token,
|
|
@@ -320,7 +320,7 @@ function runParsedSettingsCommand(parsed, io) {
|
|
|
320
320
|
async function runParsedSettingsCli(parsed, io = processIo()) {
|
|
321
321
|
const serverRequest = settingsRequestForServer(parsed, process.env);
|
|
322
322
|
if (!serverRequest) return runParsedSettingsCommand(parsed, io);
|
|
323
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
323
|
+
const { askAgentApi } = await import("./agent-api-cli-CN904-o8.js");
|
|
324
324
|
const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
|
|
325
325
|
ok: false,
|
|
326
326
|
error: errorMessage(error)
|
|
@@ -2,7 +2,7 @@ import { r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { N as SIGN_URL_ENV, z as SshSignReply } from "./session-Ctzyy3sF.js";
|
|
3
3
|
import { l as spawn, r as execFileAsync } from "./child-process-safe-BIh8yQ0I.js";
|
|
4
4
|
import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
|
|
5
|
-
import { n as postToAgentIngress } from "./agent-api-cli-
|
|
5
|
+
import { n as postToAgentIngress } from "./agent-api-cli-D5i6Aaxk.js";
|
|
6
6
|
import { l as parseSshPublicKey } from "./ssh-signing-core-BbhBpAhR.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/benchmark-panel-
|
|
2
|
-
import{d as e}from"./control-ws-CtahMJLs.js";import{It as t,Lt as n,Rt as r,Vt as i,t as a,zt as o}from"./button-D4yLJK3N.js";import{K as s,s as c}from"./dom-helpers-Bs-xZEnd.js";import{n as l}from"./modal-C1JTHud7.js";import{o as u}from"./card-registry-DY8mP3KR.js";import{t as d}from"./preload-helper-BLdHbfdN.js";import{n as f}from"./session-tick-BqAW_8XQ.js";import{Aa as p,Ma as m,Q as ee,et as h,nt as g,rt as _,tt as te,wa as ne}from"./index-D1rSKJEg.js";var v=[`agent`,`model`,`effort`],re={"claude-code":`Claude Code`,codex:`Codex`,kimi:`Kimi Code`};function y(e){return re[e]??e}function b(e,t){return e.agents.find(e=>e.agent===t)?.models??[]}function x(e){return o.filter(t=>b(e,t).length>0)}function S(e,t,n){return b(e,t).find(e=>e.id===n)?.options.find(e=>e.id===`effort`)?.choices??[]}function C(e){return e.options.find(e=>e.id===`effort`)?.value??null}function w(e,t){let n=e.options.filter(e=>e.id!==i);return{...e,options:t===null?n:[...n,{id:i,value:t}]}}function T(e,t){let n=b(e,t),r=n.find(e=>e.isDefault)??n[0]??null,i=r?.options.find(e=>e.id===`effort`)?.defaultChoice??null;return w({agent:t,model:r?.id??null,options:[],instructions:``},i)}function E(e,t,n){let r=S(e,t.agent,n),i=C(t),a=b(e,t.agent).find(e=>e.id===n),o=i!==null&&r.includes(i)?i:a?.options.find(e=>e.id===`effort`)?.defaultChoice??null;return w({...t,model:n},o)}function D(e,t){return w(e,t)}function O(e,t){let n=b(t,e.agent).find(t=>t.id===e.model)?.label??e.model??y(e.agent),r=C(e);return(r===null?n:`${n} ${r}`).slice(0,60)}function ie(e,t,n){return n===`agent`?x(e).map(e=>({value:e,label:y(e)})):n===`model`?b(e,t.agent).map(e=>({value:e.id,label:e.label})):S(e,t.agent,t.model).map(e=>({value:e,label:e}))}function ae(e,t,n,r){return n===`agent`?{...T(e,r),instructions:t.instructions}:n===`model`?E(e,t,r):w(t,r)}function k(e,t){let n=new Map;return t.slice(0,5).map((t,r)=>{let i=O(t,e),a=(n.get(i)??0)+1;return n.set(i,a),{id:`c${r+1}`,label:a===1?i:`${i} ${a}`.slice(0,60),setup:t}})}function A(e,t,n,r){return k(e,r.map(r=>ae(e,t,n,r)))}var j=12e4,M=6e4,oe=8,N=null,P=null,F={agents:[]},I={raceTitle:``,prompt:``,repoPath:``,contestants:[],judgeSetup:null},L=!1,R=new Map,z=new Map;function B(e){return Object.entries(s).find(([t])=>t===e)?.[1]??e}function V(e){let t=e?u.get(e):void 0;return t?t.currentState:g}function H(e,t){return`${e}:${t}`}function U(t,n){let r=H(t.id,n.id);R.has(r)?(R.delete(r),q()):(R.set(r,`Loading the diff.`),q(),e(`race-diff`,{raceId:t.id,contestantId:n.id},{timeoutMs:M}).then(e=>{e.type===`race-diff-result`&&R.set(r,e.ok?e.diff||`No changes.`:`Could not read the diff: ${e.error??`unknown error`}`)}).catch(e=>R.set(r,`Could not read the diff: ${e instanceof Error?e.message:String(e)}`)).finally(q))}function W(e,t){let n=c(`li`,`arena-contestant`),r=e.sessionIdByContestant[t.id],i=V(r),o=e.judge?.ranking.find(e=>e.contestantId===t.id)??null,s=e.diffStatsByContestant[t.id],l=c(`div`,`arena-contestant-head`);if(l.append(c(`span`,`arena-contestant-rank`,o?`#${o.rank}`:`-`)),l.append(c(`span`,`arena-contestant-label`,t.label)),l.append(c(`span`,`arena-contestant-state`,i===`removed`?`Removed`:B(i))),s&&l.append(c(`span`,`arena-contestant-stats`,`+${s.linesAdded} -${s.linesRemoved}, ${s.filesChanged} files`)),e.winnerContestantId===t.id&&l.append(c(`span`,`arena-contestant-winner`,`Winner`)),r&&i!==`removed`){l.append(a({variant:`quiet`,size:`small`,label:`Open`,onClick:()=>ee(r)})),(e.winnerContestantId===null||e.winnerContestantId===t.id)&&l.append(a({variant:`quiet`,size:`small`,label:`Pick winner`,onClick:()=>G(e,t)}));let n=a({variant:`quiet`,size:`small`,label:`Show diff`,onClick:()=>U(e,t)});n.setAttribute(`aria-expanded`,String(R.has(H(e.id,t.id)))),l.append(n)}n.append(l),o&&n.append(c(`p`,`arena-contestant-reason`,o.reason));let u=R.get(H(e.id,t.id));return u!==void 0&&n.append(c(`pre`,`arena-diff`,u)),n}function G(e,t){let{dialog:n,close:r,actions:i,btnCancel:o}=l({title:`Pick ${t.label} as the winner`}),s=e.spec.contestants.filter(n=>n.id!==t.id&&V(e.sessionIdByContestant[n.id])!==`removed`),u=s.length>0?`${s.map(e=>e.label).join(`, `)} will be stopped and removed with their worktrees and branches, without pushing. ${t.label} stays an ordinary session.`:`${t.label} stays an ordinary session. No other contestant is left to remove.`;n.append(c(`p`,`dialog-message`,u));let d=e.judge?.notes[t.id]??null,f=c(`input`);if(f.type=`checkbox`,d){let e=c(`label`,`arena-judge`);e.append(f,c(`span`,null,`Also send it the judge's notes`)),n.append(e,c(`pre`,`arena-diff`,d))}let p=a({variant:`danger`,label:`Pick winner`,onClick:()=>{r(),K(e,t,d!==null&&f.checked)}});i.append(p),n.append(i),o.addEventListener(`click`,r)}function K(t,n,r){z.set(t.id,`Picking ${n.label}.`),q(),e(`race-pick-winner`,{raceId:t.id,contestantId:n.id,sendNotes:r},{timeoutMs:j}).then(e=>{e.type===`race-pick-winner-result`&&z.set(t.id,e.ok?``:`Picked ${n.label} with problems: ${e.error??`unknown error`}`)}).catch(e=>z.set(t.id,`Could not pick the winner: ${e instanceof Error?e.message:String(e)}`)).finally(q)}function se(t){z.set(t.id,`Asking the judge.`),q(),e(`race-judge`,{raceId:t.id},{timeoutMs:M}).then(e=>{e.type===`race-judge-result`&&z.set(t.id,e.ok?``:`Could not judge: ${e.error??`unknown error`}`)}).catch(e=>z.set(t.id,`Could not judge: ${e instanceof Error?e.message:String(e)}`)).finally(q)}function ce(e){let t=_(Object.values(e.sessionIdByContestant),e=>V(e));return e.winnerContestantId?`Winner: ${e.spec.contestants.find(t=>t.id===e.winnerContestantId)?.label??e.winnerContestantId}.`:e.phase===`judging`?`Judging.`:e.phase===`judged`?[e.judge?`Judged.`:`Finished.`,e.judgeError].filter(Boolean).join(` `):`${t.settled} of ${t.total} settled.`}function le(e){let t=t=>e.judge?.ranking.find(e=>e.contestantId===t.id)?.rank??2**53-1;return[...e.spec.contestants].sort((e,n)=>t(e)-t(n))}function ue(e){let t=c(`article`,`arena-race`);t.append(c(`h3`,`arena-race-title`,e.spec.title)),t.append(c(`p`,`arena-race-meta`,`${e.baseBranch} at ${e.startSha.slice(0,oe)}, ${new Date(e.createdAt).toLocaleString()}`));let n=c(`div`,`arena-race-actions`),r=a({variant:`secondary`,size:`small`,label:`Judge now`,disabled:e.phase===`judging`,onClick:()=>se(e)}),i=c(`span`,`arena-status`,z.get(e.id)||ce(e));i.setAttribute(`role`,`status`),n.append(r,i),t.append(n);let o=c(`ul`,`arena-contestants`);for(let t of le(e))o.append(W(e,t));return t.append(o),t}function q(){if(!P)return;let e=h();if(P.replaceChildren(c(`h2`,`arena-section-title`,`Races`)),e.length===0)P.append(c(`p`,`arena-empty`,`No races yet.`));else for(let t of e)P.append(ue(t))}function J(e,t,n,r){let i=c(`select`,`arena-select`);i.setAttribute(`aria-label`,r);for(let n of e){let e=c(`option`,null,n.label);e.value=n.value,e.selected=n.value===t,i.append(e)}return i.addEventListener(`change`,()=>n(i.value)),i}function Y(e,t,n=null){let r=c(`div`,`arena-setup`),i=x(F).filter(e=>!n||n.includes(e)).map(e=>({value:e,label:y(e)}));r.append(J(i,e.agent,n=>t({...T(F,n),instructions:e.instructions}),`Agent`));let a=b(F,e.agent).map(e=>({value:e.id,label:e.label}));r.append(J(a,e.model,n=>t(E(F,e,n)),`Model`));let o=S(F,e.agent,e.model);return o.length>0&&r.append(J(o.map(e=>({value:e,label:e})),C(e),n=>t(D(e,n)),`Effort`)),r}function X(){return{version:1,title:I.raceTitle,prompt:I.prompt,repoPath:I.repoPath,contestants:I.contestants,judge:I.judgeSetup?{setup:I.judgeSetup}:null}}function Z(e,t,n,r=!1){let i=c(`label`,`arena-field`);i.append(c(`span`,`arena-field-label`,e));let a=r?c(`textarea`,`arena-input arena-prompt`):c(`input`,`arena-input`);return a.value=t,a.addEventListener(`input`,()=>n(a.value)),i.append(a),i}function Q(e){return k(F,e.map(e=>e.setup))}function de(e){let t=c(`div`,`arena-lineup`);return I.contestants.forEach((n,r)=>{let i=c(`div`,`arena-column`);i.append(c(`span`,`arena-column-label`,n.label)),i.append(Y(n.setup,t=>{I.contestants=Q(I.contestants.map((e,n)=>n===r?{...e,setup:t}:e)),e()}));let o=c(`textarea`,`arena-input arena-instructions`);o.placeholder=`Extra instructions for this contestant`,o.value=n.setup.instructions,o.addEventListener(`input`,()=>{I.contestants=I.contestants.map((e,t)=>t===r?{...e,setup:{...e.setup,instructions:o.value}}:e)}),i.append(o),i.append(a({variant:`quiet`,size:`small`,label:`Remove`,onClick:()=>{I.contestants=Q(I.contestants.filter((e,t)=>t!==r)),e()}})),t.append(i)}),t}function fe(e){let t=c(`div`,`arena-vary`),n=I.contestants[0]?.setup??T(F,x(F)[0]??`claude-code`),r=`model`,i=c(`div`,`arena-vary-choices`),o=()=>{i.replaceChildren();for(let e of ie(F,n,r)){let t=c(`label`,`arena-vary-choice`),n=c(`input`);n.type=`checkbox`,n.value=e.value,t.append(n,c(`span`,null,e.label)),i.append(t)}},s=c(`div`,`arena-vary-base`),l=()=>{s.replaceChildren(Y(n,e=>{n=e,l(),o()}))};return t.append(c(`span`,`arena-field-label`,`Start from`),s),t.append(c(`span`,`arena-field-label`,`Vary`),J(v.map(e=>({value:e,label:e})),r,e=>{r=v.find(t=>t===e)??`model`,o()},`Setting to vary`)),t.append(i),t.append(a({variant:`secondary`,size:`small`,label:`Use these`,onClick:()=>{let t=[...i.querySelectorAll(`input:checked`)].map(e=>e instanceof HTMLInputElement?e.value:``).filter(Boolean);I.contestants=A(F,n,r,t),e()}})),l(),o(),t}function $(e){try{return JSON.parse(e)}catch{return null}}function pe(e){let t=n.safeParse($(e));if(!t.success)return`The race file is not valid: ${t.error.issues.map(e=>`${e.path.join(`.`)||`file`}: ${e.message}`).join(`; `)}`;let r=t.data;return I={raceTitle:r.title,prompt:r.prompt,repoPath:r.repoPath,contestants:r.contestants,judgeSetup:r.judge?.setup??null},null}function me(){let n=c(`section`,`arena-new`),i=c(`div`,`arena-new-body`),o=c(`span`,`arena-status`);o.setAttribute(`role`,`status`);let s=c(`textarea`,`arena-input arena-file`);s.setAttribute(`aria-label`,`Race spec JSON`);let l=()=>{if(i.replaceChildren(),s.hidden=!L,L){s.value=JSON.stringify(X(),null,2),i.append(s);return}i.append(Z(`Title`,I.raceTitle,e=>{I.raceTitle=e}));let e=Z(`Repository folder`,I.repoPath,e=>{I.repoPath=e}),n=e.querySelector(`input`),r=c(`datalist`);r.id=`arena-repo-paths`;for(let e of new Set([...u.values()].map(e=>e.path))){let t=c(`option`);t.value=e,r.append(t)}n?.setAttribute(`list`,r.id),i.append(e,r),i.append(Z(`Prompt`,I.prompt,e=>{I.prompt=e},!0)),i.append(fe(l)),i.append(de(l));let o=a({variant:`quiet`,size:`small`,label:`Add contestant`,disabled:I.contestants.length>=5,onClick:()=>{let e=x(F)[0]??`claude-code`;I.contestants=Q([...I.contestants,{id:`new`,label:`new`,setup:I.contestants.at(-1)?.setup??T(F,e)}]),l()}}),d=c(`label`,`arena-judge`),f=c(`input`);f.type=`checkbox`,f.checked=I.judgeSetup!==null,f.addEventListener(`change`,()=>{I.judgeSetup=f.checked?T(F,t):null,l()}),d.append(f,c(`span`,null,`Judge the results`)),I.judgeSetup&&d.append(Y(I.judgeSetup,e=>{I.judgeSetup=e,l()},[t])),i.append(o,d)},d=a({variant:`quiet`,size:`small`,label:`Edit as file`,onClick:()=>{if(L){let e=pe(s.value);if(o.textContent=e??``,e)return}L=!L,d.setAttribute(`aria-pressed`,String(L)),l()}});d.setAttribute(`aria-pressed`,`false`);let f=a({variant:`primary`,label:`Start race`,onClick:()=>{let t=L?$(s.value):X();f.disabled=!0,o.textContent=`Starting the contestants.`,e(`race-start`,{spec:t},{timeoutMs:j}).then(e=>{e.type===`race-start-result`&&(o.textContent=e.ok?e.error??`Race started.`:`Could not start the race: ${e.error??`unknown error`}`)}).catch(e=>{o.textContent=`Could not start the race: ${e instanceof Error?e.message:String(e)}`}).finally(()=>{f.disabled=!1})}}),p=c(`div`,`arena-new-head`);p.append(c(`h2`,`arena-section-title`,`New race`),d);let m=c(`div`,`arena-actions`);return m.append(f,o),n.append(p,i,m),l(),e(`get-settings`,{}).then(e=>{if(e.type!==`settings`)return;let n=r.safeParse(e.settings.agentModels);n.success&&(F=n.data,I.judgeSetup??=T(F,t),I.contestants.length===0&&(I.contestants=A(F,T(F,x(F)[0]??`claude-code`),`agent`,x(F).slice(0,2))),l())}).catch(e=>{o.textContent=`Could not load the model list: ${e instanceof Error?e.message:String(e)}`}),n}function he(e){if(N)return;N=c(`div`,`arena-content`),P=c(`section`,`arena-races`),N.append(P),ne()||N.append(me());let t=c(`section`,`arena-bench`);N.append(t);let n=()=>{t.hidden=p().status?.configured!==!0};m(n),n(),e.append(N),te(q),f(q),q(),d(()=>import(`./benchmark-panel-bmD8zwiZ.js`).then(e=>e.view.mount(t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]))}var ge={mount:he};export{ge as view};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/benchmark-panel-DgvEY_-r.js","assets/button-D4yLJK3N.js","assets/zod-_N0uRWDY.js","assets/dom-helpers-Bs-xZEnd.js","assets/index-Xfokg9h-.js","assets/control-ws-CtahMJLs.js","assets/modal-C1JTHud7.js","assets/session-row-CbHGQ5eG.js","assets/card-registry-DY8mP3KR.js","assets/action-status-rxc5WGWV.js","assets/session-tick-BqAW_8XQ.js","assets/session-actions-ypIyMEo7.js","assets/ui-state-core-Nssh-6QJ.js","assets/preload-helper-BLdHbfdN.js","assets/ui-prefs-Dyka19fU.js","assets/local-store-CVQ5ByvB.js","assets/alert-sound-core-CmJhj4qI.js","assets/card-actions-DOYXIR7t.js","assets/menu-CHluFLPe.js","assets/roving-keys-core-BDobx2It.js","assets/pr-status-icon-CZbk4RGh.js","assets/http-url-B85DM2Ri.js","assets/index-CVchwl0e.css","assets/benchmark-panel-E7vrfppm.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as e}from"./control-ws-CtahMJLs.js";import{It as t,Lt as n,Rt as r,Vt as i,t as a,zt as o}from"./button-D4yLJK3N.js";import{K as s,s as c}from"./dom-helpers-Bs-xZEnd.js";import{n as l}from"./modal-C1JTHud7.js";import{o as u}from"./card-registry-DY8mP3KR.js";import{t as d}from"./preload-helper-BLdHbfdN.js";import{n as f}from"./session-tick-BqAW_8XQ.js";import{Aa as p,Ma as m,Q as ee,et as h,nt as g,rt as _,tt as te,wa as ne}from"./index-Xfokg9h-.js";var v=[`agent`,`model`,`effort`],re={"claude-code":`Claude Code`,codex:`Codex`,kimi:`Kimi Code`};function y(e){return re[e]??e}function b(e,t){return e.agents.find(e=>e.agent===t)?.models??[]}function x(e){return o.filter(t=>b(e,t).length>0)}function S(e,t,n){return b(e,t).find(e=>e.id===n)?.options.find(e=>e.id===`effort`)?.choices??[]}function C(e){return e.options.find(e=>e.id===`effort`)?.value??null}function w(e,t){let n=e.options.filter(e=>e.id!==i);return{...e,options:t===null?n:[...n,{id:i,value:t}]}}function T(e,t){let n=b(e,t),r=n.find(e=>e.isDefault)??n[0]??null,i=r?.options.find(e=>e.id===`effort`)?.defaultChoice??null;return w({agent:t,model:r?.id??null,options:[],instructions:``},i)}function E(e,t,n){let r=S(e,t.agent,n),i=C(t),a=b(e,t.agent).find(e=>e.id===n),o=i!==null&&r.includes(i)?i:a?.options.find(e=>e.id===`effort`)?.defaultChoice??null;return w({...t,model:n},o)}function D(e,t){return w(e,t)}function O(e,t){let n=b(t,e.agent).find(t=>t.id===e.model)?.label??e.model??y(e.agent),r=C(e);return(r===null?n:`${n} ${r}`).slice(0,60)}function ie(e,t,n){return n===`agent`?x(e).map(e=>({value:e,label:y(e)})):n===`model`?b(e,t.agent).map(e=>({value:e.id,label:e.label})):S(e,t.agent,t.model).map(e=>({value:e,label:e}))}function ae(e,t,n,r){return n===`agent`?{...T(e,r),instructions:t.instructions}:n===`model`?E(e,t,r):w(t,r)}function k(e,t){let n=new Map;return t.slice(0,5).map((t,r)=>{let i=O(t,e),a=(n.get(i)??0)+1;return n.set(i,a),{id:`c${r+1}`,label:a===1?i:`${i} ${a}`.slice(0,60),setup:t}})}function A(e,t,n,r){return k(e,r.map(r=>ae(e,t,n,r)))}var j=12e4,M=6e4,oe=8,N=null,P=null,F={agents:[]},I={raceTitle:``,prompt:``,repoPath:``,contestants:[],judgeSetup:null},L=!1,R=new Map,z=new Map;function B(e){return Object.entries(s).find(([t])=>t===e)?.[1]??e}function V(e){let t=e?u.get(e):void 0;return t?t.currentState:g}function H(e,t){return`${e}:${t}`}function U(t,n){let r=H(t.id,n.id);R.has(r)?(R.delete(r),q()):(R.set(r,`Loading the diff.`),q(),e(`race-diff`,{raceId:t.id,contestantId:n.id},{timeoutMs:M}).then(e=>{e.type===`race-diff-result`&&R.set(r,e.ok?e.diff||`No changes.`:`Could not read the diff: ${e.error??`unknown error`}`)}).catch(e=>R.set(r,`Could not read the diff: ${e instanceof Error?e.message:String(e)}`)).finally(q))}function W(e,t){let n=c(`li`,`arena-contestant`),r=e.sessionIdByContestant[t.id],i=V(r),o=e.judge?.ranking.find(e=>e.contestantId===t.id)??null,s=e.diffStatsByContestant[t.id],l=c(`div`,`arena-contestant-head`);if(l.append(c(`span`,`arena-contestant-rank`,o?`#${o.rank}`:`-`)),l.append(c(`span`,`arena-contestant-label`,t.label)),l.append(c(`span`,`arena-contestant-state`,i===`removed`?`Removed`:B(i))),s&&l.append(c(`span`,`arena-contestant-stats`,`+${s.linesAdded} -${s.linesRemoved}, ${s.filesChanged} files`)),e.winnerContestantId===t.id&&l.append(c(`span`,`arena-contestant-winner`,`Winner`)),r&&i!==`removed`){l.append(a({variant:`quiet`,size:`small`,label:`Open`,onClick:()=>ee(r)})),(e.winnerContestantId===null||e.winnerContestantId===t.id)&&l.append(a({variant:`quiet`,size:`small`,label:`Pick winner`,onClick:()=>G(e,t)}));let n=a({variant:`quiet`,size:`small`,label:`Show diff`,onClick:()=>U(e,t)});n.setAttribute(`aria-expanded`,String(R.has(H(e.id,t.id)))),l.append(n)}n.append(l),o&&n.append(c(`p`,`arena-contestant-reason`,o.reason));let u=R.get(H(e.id,t.id));return u!==void 0&&n.append(c(`pre`,`arena-diff`,u)),n}function G(e,t){let{dialog:n,close:r,actions:i,btnCancel:o}=l({title:`Pick ${t.label} as the winner`}),s=e.spec.contestants.filter(n=>n.id!==t.id&&V(e.sessionIdByContestant[n.id])!==`removed`),u=s.length>0?`${s.map(e=>e.label).join(`, `)} will be stopped and removed with their worktrees and branches, without pushing. ${t.label} stays an ordinary session.`:`${t.label} stays an ordinary session. No other contestant is left to remove.`;n.append(c(`p`,`dialog-message`,u));let d=e.judge?.notes[t.id]??null,f=c(`input`);if(f.type=`checkbox`,d){let e=c(`label`,`arena-judge`);e.append(f,c(`span`,null,`Also send it the judge's notes`)),n.append(e,c(`pre`,`arena-diff`,d))}let p=a({variant:`danger`,label:`Pick winner`,onClick:()=>{r(),K(e,t,d!==null&&f.checked)}});i.append(p),n.append(i),o.addEventListener(`click`,r)}function K(t,n,r){z.set(t.id,`Picking ${n.label}.`),q(),e(`race-pick-winner`,{raceId:t.id,contestantId:n.id,sendNotes:r},{timeoutMs:j}).then(e=>{e.type===`race-pick-winner-result`&&z.set(t.id,e.ok?``:`Picked ${n.label} with problems: ${e.error??`unknown error`}`)}).catch(e=>z.set(t.id,`Could not pick the winner: ${e instanceof Error?e.message:String(e)}`)).finally(q)}function se(t){z.set(t.id,`Asking the judge.`),q(),e(`race-judge`,{raceId:t.id},{timeoutMs:M}).then(e=>{e.type===`race-judge-result`&&z.set(t.id,e.ok?``:`Could not judge: ${e.error??`unknown error`}`)}).catch(e=>z.set(t.id,`Could not judge: ${e instanceof Error?e.message:String(e)}`)).finally(q)}function ce(e){let t=_(Object.values(e.sessionIdByContestant),e=>V(e));return e.winnerContestantId?`Winner: ${e.spec.contestants.find(t=>t.id===e.winnerContestantId)?.label??e.winnerContestantId}.`:e.phase===`judging`?`Judging.`:e.phase===`judged`?[e.judge?`Judged.`:`Finished.`,e.judgeError].filter(Boolean).join(` `):`${t.settled} of ${t.total} settled.`}function le(e){let t=t=>e.judge?.ranking.find(e=>e.contestantId===t.id)?.rank??2**53-1;return[...e.spec.contestants].sort((e,n)=>t(e)-t(n))}function ue(e){let t=c(`article`,`arena-race`);t.append(c(`h3`,`arena-race-title`,e.spec.title)),t.append(c(`p`,`arena-race-meta`,`${e.baseBranch} at ${e.startSha.slice(0,oe)}, ${new Date(e.createdAt).toLocaleString()}`));let n=c(`div`,`arena-race-actions`),r=a({variant:`secondary`,size:`small`,label:`Judge now`,disabled:e.phase===`judging`,onClick:()=>se(e)}),i=c(`span`,`arena-status`,z.get(e.id)||ce(e));i.setAttribute(`role`,`status`),n.append(r,i),t.append(n);let o=c(`ul`,`arena-contestants`);for(let t of le(e))o.append(W(e,t));return t.append(o),t}function q(){if(!P)return;let e=h();if(P.replaceChildren(c(`h2`,`arena-section-title`,`Races`)),e.length===0)P.append(c(`p`,`arena-empty`,`No races yet.`));else for(let t of e)P.append(ue(t))}function J(e,t,n,r){let i=c(`select`,`arena-select`);i.setAttribute(`aria-label`,r);for(let n of e){let e=c(`option`,null,n.label);e.value=n.value,e.selected=n.value===t,i.append(e)}return i.addEventListener(`change`,()=>n(i.value)),i}function Y(e,t,n=null){let r=c(`div`,`arena-setup`),i=x(F).filter(e=>!n||n.includes(e)).map(e=>({value:e,label:y(e)}));r.append(J(i,e.agent,n=>t({...T(F,n),instructions:e.instructions}),`Agent`));let a=b(F,e.agent).map(e=>({value:e.id,label:e.label}));r.append(J(a,e.model,n=>t(E(F,e,n)),`Model`));let o=S(F,e.agent,e.model);return o.length>0&&r.append(J(o.map(e=>({value:e,label:e})),C(e),n=>t(D(e,n)),`Effort`)),r}function X(){return{version:1,title:I.raceTitle,prompt:I.prompt,repoPath:I.repoPath,contestants:I.contestants,judge:I.judgeSetup?{setup:I.judgeSetup}:null}}function Z(e,t,n,r=!1){let i=c(`label`,`arena-field`);i.append(c(`span`,`arena-field-label`,e));let a=r?c(`textarea`,`arena-input arena-prompt`):c(`input`,`arena-input`);return a.value=t,a.addEventListener(`input`,()=>n(a.value)),i.append(a),i}function Q(e){return k(F,e.map(e=>e.setup))}function de(e){let t=c(`div`,`arena-lineup`);return I.contestants.forEach((n,r)=>{let i=c(`div`,`arena-column`);i.append(c(`span`,`arena-column-label`,n.label)),i.append(Y(n.setup,t=>{I.contestants=Q(I.contestants.map((e,n)=>n===r?{...e,setup:t}:e)),e()}));let o=c(`textarea`,`arena-input arena-instructions`);o.placeholder=`Extra instructions for this contestant`,o.value=n.setup.instructions,o.addEventListener(`input`,()=>{I.contestants=I.contestants.map((e,t)=>t===r?{...e,setup:{...e.setup,instructions:o.value}}:e)}),i.append(o),i.append(a({variant:`quiet`,size:`small`,label:`Remove`,onClick:()=>{I.contestants=Q(I.contestants.filter((e,t)=>t!==r)),e()}})),t.append(i)}),t}function fe(e){let t=c(`div`,`arena-vary`),n=I.contestants[0]?.setup??T(F,x(F)[0]??`claude-code`),r=`model`,i=c(`div`,`arena-vary-choices`),o=()=>{i.replaceChildren();for(let e of ie(F,n,r)){let t=c(`label`,`arena-vary-choice`),n=c(`input`);n.type=`checkbox`,n.value=e.value,t.append(n,c(`span`,null,e.label)),i.append(t)}},s=c(`div`,`arena-vary-base`),l=()=>{s.replaceChildren(Y(n,e=>{n=e,l(),o()}))};return t.append(c(`span`,`arena-field-label`,`Start from`),s),t.append(c(`span`,`arena-field-label`,`Vary`),J(v.map(e=>({value:e,label:e})),r,e=>{r=v.find(t=>t===e)??`model`,o()},`Setting to vary`)),t.append(i),t.append(a({variant:`secondary`,size:`small`,label:`Use these`,onClick:()=>{let t=[...i.querySelectorAll(`input:checked`)].map(e=>e instanceof HTMLInputElement?e.value:``).filter(Boolean);I.contestants=A(F,n,r,t),e()}})),l(),o(),t}function $(e){try{return JSON.parse(e)}catch{return null}}function pe(e){let t=n.safeParse($(e));if(!t.success)return`The race file is not valid: ${t.error.issues.map(e=>`${e.path.join(`.`)||`file`}: ${e.message}`).join(`; `)}`;let r=t.data;return I={raceTitle:r.title,prompt:r.prompt,repoPath:r.repoPath,contestants:r.contestants,judgeSetup:r.judge?.setup??null},null}function me(){let n=c(`section`,`arena-new`),i=c(`div`,`arena-new-body`),o=c(`span`,`arena-status`);o.setAttribute(`role`,`status`);let s=c(`textarea`,`arena-input arena-file`);s.setAttribute(`aria-label`,`Race spec JSON`);let l=()=>{if(i.replaceChildren(),s.hidden=!L,L){s.value=JSON.stringify(X(),null,2),i.append(s);return}i.append(Z(`Title`,I.raceTitle,e=>{I.raceTitle=e}));let e=Z(`Repository folder`,I.repoPath,e=>{I.repoPath=e}),n=e.querySelector(`input`),r=c(`datalist`);r.id=`arena-repo-paths`;for(let e of new Set([...u.values()].map(e=>e.path))){let t=c(`option`);t.value=e,r.append(t)}n?.setAttribute(`list`,r.id),i.append(e,r),i.append(Z(`Prompt`,I.prompt,e=>{I.prompt=e},!0)),i.append(fe(l)),i.append(de(l));let o=a({variant:`quiet`,size:`small`,label:`Add contestant`,disabled:I.contestants.length>=5,onClick:()=>{let e=x(F)[0]??`claude-code`;I.contestants=Q([...I.contestants,{id:`new`,label:`new`,setup:I.contestants.at(-1)?.setup??T(F,e)}]),l()}}),d=c(`label`,`arena-judge`),f=c(`input`);f.type=`checkbox`,f.checked=I.judgeSetup!==null,f.addEventListener(`change`,()=>{I.judgeSetup=f.checked?T(F,t):null,l()}),d.append(f,c(`span`,null,`Judge the results`)),I.judgeSetup&&d.append(Y(I.judgeSetup,e=>{I.judgeSetup=e,l()},[t])),i.append(o,d)},d=a({variant:`quiet`,size:`small`,label:`Edit as file`,onClick:()=>{if(L){let e=pe(s.value);if(o.textContent=e??``,e)return}L=!L,d.setAttribute(`aria-pressed`,String(L)),l()}});d.setAttribute(`aria-pressed`,`false`);let f=a({variant:`primary`,label:`Start race`,onClick:()=>{let t=L?$(s.value):X();f.disabled=!0,o.textContent=`Starting the contestants.`,e(`race-start`,{spec:t},{timeoutMs:j}).then(e=>{e.type===`race-start-result`&&(o.textContent=e.ok?e.error??`Race started.`:`Could not start the race: ${e.error??`unknown error`}`)}).catch(e=>{o.textContent=`Could not start the race: ${e instanceof Error?e.message:String(e)}`}).finally(()=>{f.disabled=!1})}}),p=c(`div`,`arena-new-head`);p.append(c(`h2`,`arena-section-title`,`New race`),d);let m=c(`div`,`arena-actions`);return m.append(f,o),n.append(p,i,m),l(),e(`get-settings`,{}).then(e=>{if(e.type!==`settings`)return;let n=r.safeParse(e.settings.agentModels);n.success&&(F=n.data,I.judgeSetup??=T(F,t),I.contestants.length===0&&(I.contestants=A(F,T(F,x(F)[0]??`claude-code`),`agent`,x(F).slice(0,2))),l())}).catch(e=>{o.textContent=`Could not load the model list: ${e instanceof Error?e.message:String(e)}`}),n}function he(e){if(N)return;N=c(`div`,`arena-content`),P=c(`section`,`arena-races`),N.append(P),ne()||N.append(me());let t=c(`section`,`arena-bench`);N.append(t);let n=()=>{t.hidden=p().status?.configured!==!0};m(n),n(),e.append(N),te(q),f(q),q(),d(()=>import(`./benchmark-panel-DgvEY_-r.js`).then(e=>e.view.mount(t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]))}var ge={mount:he};export{ge as view};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-D4yLJK3N.js";import{n as t,r as n,s as r}from"./dom-helpers-Bs-xZEnd.js";import{Aa as i,Ma as a,ja as o}from"./index-
|
|
1
|
+
import{t as e}from"./button-D4yLJK3N.js";import{n as t,r as n,s as r}from"./dom-helpers-Bs-xZEnd.js";import{Aa as i,Ma as a,ja as o}from"./index-Xfokg9h-.js";var s={mine:`Mine`,run:`Run`,cancel:`Cancel`},c=null;function l(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function u(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function d(t,n,r){return e({variant:n===`cancel`?`secondary`:`primary`,size:`small`,label:s[n],action:`benchmark-${n}`,disabled:r,onClick:()=>o(t.id,n)})}function f(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 p(e){let t=e&&e.invalid>0?` (${e.invalid} invalid)`:``,n=r(`td`,`bench-score`,`${l(e?.recall??null)}${t}`);return e&&e.degraded>0&&(n.dataset.degraded=`true`),n}function m(e){let t=e.armIds.filter(t=>t!==e.baselineArm),n=r(`table`,`bench-table`),i=r(`tr`);i.append(r(`th`,null,`Case`),...e.armIds.map(t=>r(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>r(`th`,null,`${e} vs baseline`))),n.append(i);for(let i of e.rows){let a=r(`tr`);a.append(r(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>p(i.arms[e]))),a.append(...t.map(e=>r(`td`,`bench-delta`,u(i.deltaVsBaseline[e]??null)))),n.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=r(`tr`,`bench-total`);o.append(r(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>p(e.totals[t]))),n.append(o);for(let t of a){let i=r(`tr`,`bench-total`);i.append(r(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(n=>r(`td`,`bench-score`,l(e.totals[n]?.recallByTag[t]??null)))),n.append(i)}return n}function h(e,t){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=r(`div`,`bench-suite`),l=e.inFlight?.suiteId===t.id,u=!!e.inFlight&&!l,p=o.has(t.id)||!a,h=r(`div`,`bench-summary`);h.append(r(`span`,`bench-suite-title`,t.title),n(`bench`,t.caseCount===1?`case`:`cases`,String(t.caseCount)),n(`bench`,t.candidateCount===1?`candidate`:`candidates`,String(t.candidateCount)),n(`bench`,`arms`,String(t.armIds.length))),c.append(h);let g=r(`div`,`bench-controls`),_=e.configured===!0&&t.error===null;g.append(d(t,`mine`,!_||p||l),d(t,`run`,!_||p||l||u||t.caseCount===0),d(t,`cancel`,p||!l));let v=r(`span`,`bench-status`,(a?``:`Not connected to the server. Reconnecting.`)||f(e,t)||s.get(t.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),t.error)return c.append(r(`p`,`bench-error`,t.error)),c;let y=t.latestReport;return y?(c.append(r(`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(m(y)),c):(c.append(r(`p`,`bench-empty`,t.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function g(){if(!c)return;c.textContent=``;let{status:e}=i(),n=t(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(c.append(n),!e)c.append(r(`p`,`bench-empty`,`Waiting for the server.`));else if(!e.configured)c.append(r(`p`,`bench-empty`,e.reason||`Benchmarks are off.`));else if(e.suites.length===0)c.append(r(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let t of e.suites)c.append(h(e,t))}function _(e){c||(c=r(`div`,`bench-content`),e.append(c),a(g),g())}var v={mount:_};export{v as view};
|
|
Binary file
|