glimmervoid 0.49.1-next.497 → 0.49.1-next.499
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-Dqo1gt2n.js → adapters--mFzBNAs.js} +1 -1
- package/dist/chunks/{adapters-BnvEnbm7.js → adapters-BCzX13NB.js} +2 -2
- package/dist/chunks/{agent-api-cli-DL0LtLb4.js → agent-api-cli-B4EhNVX4.js} +1 -1
- package/dist/chunks/{agent-api-cli-D9r9SgcA.js → agent-api-cli-DExpTVWL.js} +1 -1
- package/dist/chunks/{agent-api-core-BQQGuOAb.js → agent-api-core-BCRpZ3sc.js} +1 -1
- package/dist/chunks/{commit-sessions-C1uFt3sC.js → commit-sessions-DpOoG4ys.js} +1 -1
- package/dist/chunks/{config-CKoLM-n3.js → config-Cq5ButJ9.js} +1 -0
- package/dist/chunks/config-store-Cve35GWj.js +1 -0
- package/dist/chunks/{config-store-Cu8-ZMk7.js → config-store-DdRVlBmt.js} +1 -1
- package/dist/chunks/{main-BhBjSxml.js → main-CNGBjHoZ.js} +8 -7
- package/dist/chunks/{pair-cli-DRbEopCK.js → pair-cli-DJ2W325a.js} +2 -2
- package/dist/chunks/{pairings-store-lB-crdbm.js → pairings-store-OtnvMpSP.js} +1 -1
- package/dist/chunks/{settings-cli-Bqx24u1B.js → settings-cli-C3GFj1Ny.js} +4 -4
- package/dist/chunks/{settings-readout-core-CiohhavY.js → settings-readout-core-BfnxEEHx.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-C3z7XlGq.js → ssh-sign-cli-BSgXGArF.js} +1 -1
- package/dist/chunks/{why-cli-Col7KPKV.js → why-cli-CwnxoUgM.js} +2 -2
- package/dist/client/assets/{action-status-D7HyJ8Q5.js → action-status-RL7Vkog6.js} +1 -1
- package/dist/client/assets/action-status-RL7Vkog6.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-CRF-_aGS.js → benchmark-panel-B2fxRv2_.js} +1 -1
- package/dist/client/assets/benchmark-panel-B2fxRv2_.js.br +0 -0
- package/dist/client/assets/boards-view-COELoXPq.js +1 -0
- package/dist/client/assets/boards-view-COELoXPq.js.br +0 -0
- package/dist/client/assets/{card-registry-BaNcteKc.js → card-registry-BnVWc0v-.js} +1 -1
- package/dist/client/assets/card-registry-BnVWc0v-.js.br +0 -0
- package/dist/client/assets/community-panel-RbAuRc3r.js +1 -0
- package/dist/client/assets/community-panel-RbAuRc3r.js.br +0 -0
- package/dist/client/assets/{control-ws-UfWQiZyV.js → control-ws-iqtzInzE.js} +1 -1
- package/dist/client/assets/control-ws-iqtzInzE.js.br +0 -0
- package/dist/client/assets/dialogs-mLwqHdJG.js +74 -0
- package/dist/client/assets/dialogs-mLwqHdJG.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-CcyONto0.js → doc-editor-ui-CeFMLHBK.js} +1 -1
- package/dist/client/assets/doc-editor-ui-CeFMLHBK.js.br +0 -0
- package/dist/client/assets/{feature-hint-CgrqqvLv.js → feature-hint-B0QBRCmk.js} +1 -1
- package/dist/client/assets/feature-hint-B0QBRCmk.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-ChFiWa_k.js → first-run-checklist-CcCO1yuH.js} +1 -1
- package/dist/client/assets/first-run-checklist-CcCO1yuH.js.br +0 -0
- package/dist/client/assets/{hooks-panel-Cbur7dGc.js → hooks-panel-DAXoN_di.js} +1 -1
- package/dist/client/assets/hooks-panel-DAXoN_di.js.br +0 -0
- package/dist/client/assets/{index-BcY9Togg.css → index-Bj_DtV9f.css} +1 -1
- package/dist/client/assets/index-Bj_DtV9f.css.br +0 -0
- package/dist/client/assets/index-DxS6qp5l.js +78 -0
- package/dist/client/assets/index-DxS6qp5l.js.br +0 -0
- package/dist/client/assets/issues-panel-DCf34Vuo.js +1 -0
- package/dist/client/assets/issues-panel-DCf34Vuo.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-DtEdaTAw.js → my-prs-panel-B36TepXp.js} +1 -1
- package/dist/client/assets/my-prs-panel-B36TepXp.js.br +0 -0
- package/dist/client/assets/{nyan-cat-D3IyW9Zw.js → nyan-cat-D1vdsn7p.js} +1 -1
- package/dist/client/assets/nyan-cat-D1vdsn7p.js.br +0 -0
- package/dist/client/assets/phone-shell-C5tOIUul.js +1 -0
- package/dist/client/assets/phone-shell-C5tOIUul.js.br +0 -0
- package/dist/client/assets/{plan-face-DRYd_nIC.js → plan-face-CnETH6-0.js} +1 -1
- package/dist/client/assets/plan-face-CnETH6-0.js.br +0 -0
- package/dist/client/assets/{plan-render-DFOM8KCG.js → plan-render-BVxkFqqh.js} +1 -1
- package/dist/client/assets/plan-render-BVxkFqqh.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-Cq68sumi.js → pr-queue-columns-BakhgmkO.js} +1 -1
- package/dist/client/assets/pr-queue-columns-BakhgmkO.js.br +0 -0
- package/dist/client/assets/{radar-panel-BCZalsDz.js → radar-panel-9m42sphI.js} +1 -1
- package/dist/client/assets/radar-panel-9m42sphI.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-D56bYKJV.js → repo-roots-adder-Dt3A3V2l.js} +1 -1
- package/dist/client/assets/repo-roots-adder-Dt3A3V2l.js.br +0 -0
- package/dist/client/assets/{resume-dialog-DGZcZXSg.js → resume-dialog-DqHdac6b.js} +1 -1
- package/dist/client/assets/resume-dialog-DqHdac6b.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-D8sRk4_r.js → review-queue-panel-Bpn8_QU5.js} +1 -1
- package/dist/client/assets/review-queue-panel-Bpn8_QU5.js.br +0 -0
- package/dist/client/assets/{session-tick-BSsME8sk.js → session-tick-BfD3MVPz.js} +1 -1
- package/dist/client/assets/session-tick-BfD3MVPz.js.br +0 -0
- package/dist/client/assets/{settings-panel-DdbXxrzr.js → settings-panel-4yxvnVzm.js} +4 -4
- package/dist/client/assets/settings-panel-4yxvnVzm.js.br +0 -0
- package/dist/client/assets/{shown-face-DhGBjaAh.js → shown-face-D9rId_OR.js} +1 -1
- package/dist/client/assets/shown-face-D9rId_OR.js.br +0 -0
- package/dist/client/assets/team-review-panel-BHgA8FC-.js +10 -0
- package/dist/client/assets/team-review-panel-BHgA8FC-.js.br +0 -0
- package/dist/client/assets/{trace-panel-CeTOnQHZ.js → trace-panel-D4FKIeLK.js} +1 -1
- package/dist/client/assets/trace-panel-D4FKIeLK.js.br +0 -0
- package/dist/client/assets/{updates-view-core-DWODr1GQ.js → updates-view-core-C1nXfl7Z.js} +1 -1
- package/dist/client/assets/updates-view-core-C1nXfl7Z.js.br +0 -0
- package/dist/client/assets/{usage-panel-DsMr-ath.js → usage-panel-DUHLEt0P.js} +1 -1
- package/dist/client/assets/usage-panel-DUHLEt0P.js.br +0 -0
- package/dist/client/assets/{your-day-tip-ohaQd4M4.js → your-day-tip-BtJlprhz.js} +1 -1
- package/dist/client/assets/your-day-tip-BtJlprhz.js.br +0 -0
- package/dist/client/index.html +7 -7
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/config-store-1XauTDfS.js +0 -1
- package/dist/client/assets/action-status-D7HyJ8Q5.js.br +0 -0
- package/dist/client/assets/benchmark-panel-CRF-_aGS.js.br +0 -0
- package/dist/client/assets/boards-view-BoDscV1H.js +0 -1
- package/dist/client/assets/boards-view-BoDscV1H.js.br +0 -0
- package/dist/client/assets/card-registry-BaNcteKc.js.br +0 -0
- package/dist/client/assets/community-panel-Cwv6lFTO.js +0 -1
- package/dist/client/assets/community-panel-Cwv6lFTO.js.br +0 -0
- package/dist/client/assets/control-ws-UfWQiZyV.js.br +0 -0
- package/dist/client/assets/dialogs-C58eYv51.js +0 -74
- package/dist/client/assets/dialogs-C58eYv51.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-CcyONto0.js.br +0 -0
- package/dist/client/assets/feature-hint-CgrqqvLv.js.br +0 -0
- package/dist/client/assets/first-run-checklist-ChFiWa_k.js.br +0 -0
- package/dist/client/assets/hooks-panel-Cbur7dGc.js.br +0 -0
- package/dist/client/assets/index-B0i7N_6e.js +0 -78
- package/dist/client/assets/index-B0i7N_6e.js.br +0 -0
- package/dist/client/assets/index-BcY9Togg.css.br +0 -0
- package/dist/client/assets/issues-panel-Bn-3vi8n.js +0 -1
- package/dist/client/assets/issues-panel-Bn-3vi8n.js.br +0 -0
- package/dist/client/assets/my-prs-panel-DtEdaTAw.js.br +0 -0
- package/dist/client/assets/nyan-cat-D3IyW9Zw.js.br +0 -0
- package/dist/client/assets/phone-shell-B70R16im.js +0 -1
- package/dist/client/assets/phone-shell-B70R16im.js.br +0 -0
- package/dist/client/assets/plan-face-DRYd_nIC.js.br +0 -0
- package/dist/client/assets/plan-render-DFOM8KCG.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-Cq68sumi.js.br +0 -0
- package/dist/client/assets/radar-panel-BCZalsDz.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-D56bYKJV.js.br +0 -0
- package/dist/client/assets/resume-dialog-DGZcZXSg.js.br +0 -0
- package/dist/client/assets/review-queue-panel-D8sRk4_r.js.br +0 -0
- package/dist/client/assets/session-tick-BSsME8sk.js.br +0 -0
- package/dist/client/assets/settings-panel-DdbXxrzr.js.br +0 -0
- package/dist/client/assets/shown-face-DhGBjaAh.js.br +0 -0
- package/dist/client/assets/team-review-panel-DwTeCtb9.js +0 -10
- package/dist/client/assets/team-review-panel-DwTeCtb9.js.br +0 -0
- package/dist/client/assets/trace-panel-CeTOnQHZ.js.br +0 -0
- package/dist/client/assets/updates-view-core-DWODr1GQ.js.br +0 -0
- package/dist/client/assets/usage-panel-DsMr-ath.js.br +0 -0
- package/dist/client/assets/your-day-tip-ohaQd4M4.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -6,7 +6,7 @@ import { a as packageRoot } from "../chunks/runtime-paths-CYwF658V.js";
|
|
|
6
6
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
|
|
7
7
|
import { t as AGENT_API_VERBS } from "../chunks/session-DUFWokKF.js";
|
|
8
8
|
import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
|
|
9
|
-
import { nt as isOwnedCommandName, r as agentCommandHelpLines, rt as parseCommand, tt as OWNED_COMMAND_SPECS } from "../chunks/agent-api-core-
|
|
9
|
+
import { nt as isOwnedCommandName, r as agentCommandHelpLines, rt as parseCommand, tt as OWNED_COMMAND_SPECS } from "../chunks/agent-api-core-BCRpZ3sc.js";
|
|
10
10
|
import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
|
|
11
11
|
import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-xS1GFU8P.js";
|
|
12
12
|
import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
|
|
@@ -63,7 +63,7 @@ var OWNED_COMMAND_RUNNERS = {
|
|
|
63
63
|
return await runDoctor() ? 0 : 1;
|
|
64
64
|
},
|
|
65
65
|
pair: async ({ values }) => {
|
|
66
|
-
const { runPairCli } = await import("../chunks/pair-cli-
|
|
66
|
+
const { runPairCli } = await import("../chunks/pair-cli-DJ2W325a.js");
|
|
67
67
|
return runPairCli({
|
|
68
68
|
isListing: values.list === true,
|
|
69
69
|
revokeDeviceId: typeof values.revoke === "string" ? values.revoke : null,
|
|
@@ -75,15 +75,15 @@ var OWNED_COMMAND_RUNNERS = {
|
|
|
75
75
|
return runAgentSetupCli();
|
|
76
76
|
},
|
|
77
77
|
settings: async (parsed) => {
|
|
78
|
-
const { runParsedSettingsCli } = await import("../chunks/settings-cli-
|
|
78
|
+
const { runParsedSettingsCli } = await import("../chunks/settings-cli-C3GFj1Ny.js");
|
|
79
79
|
return runParsedSettingsCli(parsed);
|
|
80
80
|
},
|
|
81
81
|
why: async ({ positionals }) => {
|
|
82
|
-
const { runWhyCli } = await import("../chunks/why-cli-
|
|
82
|
+
const { runWhyCli } = await import("../chunks/why-cli-CwnxoUgM.js");
|
|
83
83
|
return runWhyCli({ targetArgument: positionals[0] ?? "" });
|
|
84
84
|
},
|
|
85
85
|
"ssh-sign": async ({ rawArgs }) => {
|
|
86
|
-
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-
|
|
86
|
+
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BSgXGArF.js");
|
|
87
87
|
return runSshSignCli(rawArgs);
|
|
88
88
|
}
|
|
89
89
|
};
|
|
@@ -105,7 +105,7 @@ async function runOwnedCommand(name, subcommandArgs) {
|
|
|
105
105
|
return OWNED_COMMAND_RUNNERS[name](parsed);
|
|
106
106
|
}
|
|
107
107
|
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) => {
|
|
108
|
-
const { runAgentApiCli } = await import("../chunks/agent-api-cli-
|
|
108
|
+
const { runAgentApiCli } = await import("../chunks/agent-api-cli-B4EhNVX4.js");
|
|
109
109
|
return runAgentApiCli([subcommandName, ...subcommandArgs]);
|
|
110
110
|
}])]);
|
|
111
111
|
var AGENT_INSTALL_COMMAND_BY_ID = {
|
|
@@ -119,7 +119,7 @@ function missingAgentText(agentId) {
|
|
|
119
119
|
}
|
|
120
120
|
async function printSessionLimits() {
|
|
121
121
|
if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
|
|
122
|
-
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-
|
|
122
|
+
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-B4EhNVX4.js");
|
|
123
123
|
const limitsLines = await sessionLimitsHelpLines();
|
|
124
124
|
console.log(`\n${limitsLines.join("\n")}`);
|
|
125
125
|
}
|
|
@@ -176,7 +176,7 @@ async function readDeclaredCustomAgents() {
|
|
|
176
176
|
declared: [],
|
|
177
177
|
error: null
|
|
178
178
|
};
|
|
179
|
-
const { loadConfigFile } = await import("../chunks/config-store-
|
|
179
|
+
const { loadConfigFile } = await import("../chunks/config-store-Cve35GWj.js");
|
|
180
180
|
try {
|
|
181
181
|
const loaded = loadConfigFile(decided.path, { exitOnError: false });
|
|
182
182
|
if (!loaded.config) return {
|
|
@@ -252,7 +252,7 @@ async function runDoctor() {
|
|
|
252
252
|
}
|
|
253
253
|
switchSection("Agents");
|
|
254
254
|
try {
|
|
255
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters
|
|
255
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters--mFzBNAs.js");
|
|
256
256
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
257
257
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
258
258
|
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-BCzX13NB.js";
|
|
@@ -2,7 +2,7 @@ import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { d as isPathInside, f as safePathSegment, o as relayPath } from "./runtime-paths-CYwF658V.js";
|
|
3
3
|
import { b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, i as ASK_USER_QUESTION_TOOL_NAME, rn as shortSha$1, tn as FULL_SHA_RE, y as CONVERSATION_PERMISSION_HOOK_EVENT } from "./session-DUFWokKF.js";
|
|
4
4
|
import { c as spawn, i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
|
|
5
|
-
import { Ht as PLAN_TOOL_NAME, S as InstallFlavor, Vt as PLAN_RESULT_HOOK_EVENT, c as SHELL_AGENT_ID, kt as UpdateChannel, qt as HTTP_URL_RE, zt as PLAN_HOOK_EVENT } from "./config-
|
|
5
|
+
import { Ht as PLAN_TOOL_NAME, S as InstallFlavor, Vt as PLAN_RESULT_HOOK_EVENT, c as SHELL_AGENT_ID, kt as UpdateChannel, qt as HTTP_URL_RE, zt as PLAN_HOOK_EVENT } from "./config-Cq5ButJ9.js";
|
|
6
6
|
import { a as rawTextOr, n as isRecord, o as textOr, r as numberOr } from "./coerce-oz_Z_6E7.js";
|
|
7
7
|
import { n as parseJsonRecord } from "./json-core-If8h-Qgy.js";
|
|
8
8
|
import { i as saneYoloEnv, r as SANE_YOLO_PATH_ENV, t as CODEX_SANE_YOLO_FLAVOR } from "./sane-yolo-BjUkqIoH.js";
|
|
@@ -10,7 +10,7 @@ import { t as buildAgentEnv } from "./spawn-env-POxyFuJA.js";
|
|
|
10
10
|
import { n as shellQuote, t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
|
|
11
11
|
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-BeRuWXFn.js";
|
|
12
12
|
import { O as nextBackoffMs, c as loadedJsonValue, d as writeJsonAtomicSync, s as loadJsonStateFileSync, t as appendJsonLine } from "./json-file-AKRVPqG1.js";
|
|
13
|
-
import { h as isExperimentalBuild, m as compareReleaseVersions, s as glimmervoidHomeDir } from "./config-store-
|
|
13
|
+
import { h as isExperimentalBuild, m as compareReleaseVersions, s as glimmervoidHomeDir } from "./config-store-DdRVlBmt.js";
|
|
14
14
|
import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-CSByGhDL.js";
|
|
15
15
|
import { c as CODEX_HOME_PROFILE, f as renderCodexHookTables, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHooksBlock } from "./agent-home-core-gp8KlW8i.js";
|
|
16
16
|
import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, s as realAgentHome } from "./agent-home-BHtmhtJA.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-
|
|
1
|
+
export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-DExpTVWL.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Z as UNIT_STATUSES, et as WhiteboardAgentReply, l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-DUFWokKF.js";
|
|
2
|
-
import { J as formatSessionLimits, i as agentCommandSpec, m as isAgentApiVerb, rt as parseCommand, t as AGENT_COMMAND_HELP } from "./agent-api-core-
|
|
2
|
+
import { J as formatSessionLimits, i as agentCommandSpec, m as isAgentApiVerb, rt as parseCommand, t as AGENT_COMMAND_HELP } from "./agent-api-core-BCRpZ3sc.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 { _ as planSteps, i as describeOverCap, m as layoutBoard, p as escapeMarkup } from "./shown-files-core-CiEXUXvy.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as RefinedTaskTitle, R as TASK_TITLE_CONTROL_CHARACTERS, a as AgentAnswerRequest, c as AgentEditRequest, d as AgentReadRequest, f as AgentReviewsRequest, g as AgentSpawnRequest, h as AgentSettingsRequest, n as AGENT_REPLY_SCHEMAS, o as AgentAttentionRequest, p as AgentSendRequest, s as AgentCloseRequest, t as AGENT_API_VERBS, tt as WhiteboardAgentRequest, u as AgentPullRequestRequest, w as SESSION_COMMANDS } from "./session-DUFWokKF.js";
|
|
2
|
-
import { D as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-
|
|
2
|
+
import { D as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-Cq5ButJ9.js";
|
|
3
3
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { parseArgs } from "node:util";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
|
|
3
|
-
import { Pt as TraceRecord } from "./config-
|
|
3
|
+
import { Pt as TraceRecord } from "./config-Cq5ButJ9.js";
|
|
4
4
|
import { m as createKeyedSerialQueue, n as appendJsonLines } from "./json-file-AKRVPqG1.js";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1781,6 +1781,7 @@ var clientVariants = [
|
|
|
1781
1781
|
loose("remove-session", {
|
|
1782
1782
|
id: sessionId,
|
|
1783
1783
|
force: z.unknown().optional(),
|
|
1784
|
+
checkOnly: z.boolean().optional(),
|
|
1784
1785
|
discardWork: z.boolean().optional(),
|
|
1785
1786
|
confirmedKeptPaths: z.array(z.string()).optional(),
|
|
1786
1787
|
requestId
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c as loadConfigFile } from "./config-store-DdRVlBmt.js";
|
|
@@ -2,7 +2,7 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { a as packageRoot, u as equalsIgnoringCaseOnWindows } from "./runtime-paths-CYwF658V.js";
|
|
3
3
|
import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
4
4
|
import { w as SESSION_COMMANDS } from "./session-DUFWokKF.js";
|
|
5
|
-
import { $ as FLYING_ANIMALS_DEFAULTS, C as ONBOARDING_STEPS, E as OPERATOR_SURFACES, Ot as UPDATE_CHANNELS, Q as COMMUNITY_INTERVAL_MINUTES_RANGE, T as OPERATOR_ACTIONS_BY_SURFACE, _t as USAGE_RETAIN_DAYS_RANGE, at as NON_NEGATIVE_NUMBER_RANGE, b as DASHBOARD_VIEWS, bt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, ct as POSTHOG_FIX_TIMEOUT_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, et as FLYING_ANIMALS_DURATION_RANGE, f as USAGE_COST_MODES, ft as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, gt as USAGE_INTEGER_RANGES, ht as USAGE_BUDGET_RANGE, i as Config, it as MEMORY_RESERVE_MB_RANGE, j as HintFeature, lt as POSTHOG_PROJECT_ID_RANGE, m as normalizeLegacyConfigNumbers, mt as TASK_TITLE_TIMEOUT_RANGE, n as BUILTIN_AGENT_IDS, nt as FLYING_ANIMALS_SCALE_RANGE, ot as PORT_RANGE, pt as REPLAY_BUFFER_KB_RANGE, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSITIVE_NUMBER_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_GAP_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_BASELINE_RANGE, vt as USAGE_SCAN_INTERVAL_RANGE, w as ONBOARDING_STEP_STATES, yt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE } from "./config-
|
|
5
|
+
import { $ as FLYING_ANIMALS_DEFAULTS, C as ONBOARDING_STEPS, E as OPERATOR_SURFACES, Ot as UPDATE_CHANNELS, Q as COMMUNITY_INTERVAL_MINUTES_RANGE, T as OPERATOR_ACTIONS_BY_SURFACE, _t as USAGE_RETAIN_DAYS_RANGE, at as NON_NEGATIVE_NUMBER_RANGE, b as DASHBOARD_VIEWS, bt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, ct as POSTHOG_FIX_TIMEOUT_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, et as FLYING_ANIMALS_DURATION_RANGE, f as USAGE_COST_MODES, ft as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, gt as USAGE_INTEGER_RANGES, ht as USAGE_BUDGET_RANGE, i as Config, it as MEMORY_RESERVE_MB_RANGE, j as HintFeature, lt as POSTHOG_PROJECT_ID_RANGE, m as normalizeLegacyConfigNumbers, mt as TASK_TITLE_TIMEOUT_RANGE, n as BUILTIN_AGENT_IDS, nt as FLYING_ANIMALS_SCALE_RANGE, ot as PORT_RANGE, pt as REPLAY_BUFFER_KB_RANGE, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSITIVE_NUMBER_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_GAP_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_BASELINE_RANGE, vt as USAGE_SCAN_INTERVAL_RANGE, w as ONBOARDING_STEP_STATES, yt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE } from "./config-Cq5ButJ9.js";
|
|
6
6
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
7
7
|
import { d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-AKRVPqG1.js";
|
|
8
8
|
import fs from "node:fs";
|
|
@@ -5,8 +5,8 @@ import { a as packageRoot, c as resolvePackageBin, d as isPathInside, f as safeP
|
|
|
5
5
|
import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
6
6
|
import { $ as WHITEBOARD_LIMITS, A as SIGN_URL_ENV, Bt as ReviewThreadId, D as SESSION_NAME_PATTERN, Dt as DECIDING_REVIEW_STATES, Et as CommitSha, F as ShownFile, Gt as TeamReviewResolveResponse, Ht as TeamReviewActionRequest, It as ReviewComment, J as Note, Jt as TeamReviewThreadCommentsResponse, K as Box, Kt as TeamReviewStateEntry, L as SshSignRequest, Lt as ReviewDraft, Mt as PostedReviewEvent, Nt as PostingPlan, O as SESSION_NAME_RULE_TEXT, Ot as EarlierReview, Pt as PrDetail, Q as Unit, Qt as decisionAsIfApprovalRequired, Rt as ReviewFinding, S as ConversationQuestion, T as SESSION_DOC_BODY_CAP_BYTES, U as BoardRecord, Vt as ReviewVerdict, Wt as TeamReviewCompareFiles, X as Panel, Xt as TeamReviewThreadsRepository, Yt as TeamReviewThreadResult, Zt as canApproveAfterComment, _ as COHERENCE_HOOKS_INACTIVE, an as NODE_ID_RE, at as MyPrAutoRebase, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as MyPrsSnapshot, ct as MyPrKeepMergeableRequest, dt as MyPrMergeMethod, en as hasStandingViewerApproval, fn as BADGE_LABELS, ft as MyPrMergeRequest, gn as STATES, hn as RESTARTABLE_STATES, ht as MyPrMergeWhenReadyRequest, i as ASK_USER_QUESTION_TOOL_NAME, in as GH_SEGMENT, it as MyPr, j as SSH_SIGN_BODY_CAP_BYTES, jt as GithubReviewState, k as SHOWN_FILE_CAP_BYTES, kt as FindingSeverity, mn as MERGEABLE_LIVE_STATES, mt as MyPrMergeStateResponse, nn as HEX_SHA_RE, nt as Wire, on as REPO_SLUG_RE, ot as MyPrCheckContext, pn as KILLABLE_STATES, q as Frame, qt as TeamReviewStatus, r as AGENT_URL_ENV, rn as shortSha, rt as LinkedPr, sn as repoParts, st as MyPrCheckContextsResponse, ut as MyPrLaneEntry, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, vt as MyPrThreadNode, xt as MyPrsState, y as CONVERSATION_PERMISSION_HOOK_EVENT, yt as MyPrThreadsResponse, z as TaskTitle, zt as ReviewResult } from "./session-DUFWokKF.js";
|
|
7
7
|
import { c as spawn, i as execFileSync, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BCOoKfxG.js";
|
|
8
|
-
import { $t as IssuesSearchResponse, A as HINT_VIEW_BY_FEATURE, At as UpdateJournal, B as MergedPrListing, Bt as PLAN_HOOK_OUTPUT_MAX_CHARS, Ct as CommunityItem, D as pullRequestKeyFromReference, Dt as SKILL_NAME_RE, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as CoherenceJournalOutput, G as GithubPrLightSearchNode, Gt as parseExitPlanModeHookPayload, H as PrCheckoutCaseInput, Ht as PLAN_TOOL_NAME, I as BenchmarkRun, It as ChangeMap, J as WorkflowCommentBody, Jt as HookEnvelope, K as GithubPrsFrame, Kt as planTitle, L as BenchmarkStatus, Lt as changeMapFactId, M as BenchmarkActionRequest, Mt as MAX_RAW_LINE_CHARS, N as BenchmarkCase, Nt as TraceCheckpoint, O as FeatureHintState, P as BenchmarkId, Pt as TraceRecord, Qt as IssueUpdate, R as BenchmarkSuite, Rt as PLAN_BODY_CAP_BYTES, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanDecision, V as MinedPrReviewData, Vt as PLAN_RESULT_HOOK_EVENT, W as GithubPrKey, Wt as PlanRevision, X as WorkflowsSettings, Xt as GithubIssueResponse, Y as WorkflowLabelName, Yt as GithubIssuePullRequestsRepository, Z as WorkflowsState, Zt as IssueKey, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, en as IssuesState, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as SessionSetup, k as HINT_FEATURES, nn as issuePullRequestStateFromGithub, p as USAGE_VENDOR_KEYS, q as comparablePrKey, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, tn as IssuesStatus, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_EVENT } from "./config-
|
|
9
|
-
import { $ as supervisionLine, A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, Q as routeAgentNotes, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, X as permitsHelpCommand, Y as hintFor, Z as promptHintFor, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, et as toolHookFactsOf, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as describeSessionLimits, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-
|
|
8
|
+
import { $t as IssuesSearchResponse, A as HINT_VIEW_BY_FEATURE, At as UpdateJournal, B as MergedPrListing, Bt as PLAN_HOOK_OUTPUT_MAX_CHARS, Ct as CommunityItem, D as pullRequestKeyFromReference, Dt as SKILL_NAME_RE, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as CoherenceJournalOutput, G as GithubPrLightSearchNode, Gt as parseExitPlanModeHookPayload, H as PrCheckoutCaseInput, Ht as PLAN_TOOL_NAME, I as BenchmarkRun, It as ChangeMap, J as WorkflowCommentBody, Jt as HookEnvelope, K as GithubPrsFrame, Kt as planTitle, L as BenchmarkStatus, Lt as changeMapFactId, M as BenchmarkActionRequest, Mt as MAX_RAW_LINE_CHARS, N as BenchmarkCase, Nt as TraceCheckpoint, O as FeatureHintState, P as BenchmarkId, Pt as TraceRecord, Qt as IssueUpdate, R as BenchmarkSuite, Rt as PLAN_BODY_CAP_BYTES, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanDecision, V as MinedPrReviewData, Vt as PLAN_RESULT_HOOK_EVENT, W as GithubPrKey, Wt as PlanRevision, X as WorkflowsSettings, Xt as GithubIssueResponse, Y as WorkflowLabelName, Yt as GithubIssuePullRequestsRepository, Z as WorkflowsState, Zt as IssueKey, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, en as IssuesState, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as SessionSetup, k as HINT_FEATURES, nn as issuePullRequestStateFromGithub, p as USAGE_VENDOR_KEYS, q as comparablePrKey, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, tn as IssuesStatus, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_EVENT } from "./config-Cq5ButJ9.js";
|
|
9
|
+
import { $ as supervisionLine, A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, Q as routeAgentNotes, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, X as permitsHelpCommand, Y as hintFor, Z as promptHintFor, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, et as toolHookFactsOf, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as describeSessionLimits, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-BCRpZ3sc.js";
|
|
10
10
|
import { a as rawTextOr, i as positiveNumberOr, n as isRecord$1, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
|
|
11
11
|
import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-xS1GFU8P.js";
|
|
12
12
|
import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
|
|
@@ -17,15 +17,15 @@ import { r as knownWriteHookInput } from "./posthog-read-gate-core-CeSY56AB.js";
|
|
|
17
17
|
import { a as filesAfterRetention, c as readPageTitle, d as thumbnailOwnerIdOf, f as thumbnailRecipeFor, g as findDependencyCycle, h as cappedWarnings, i as describeOverCap, l as shownMimeForFilename, m as layoutBoard, n as SHOWN_SNIFF_BYTES, o as isShownPageMime, p as escapeMarkup, r as decideShownKind, s as leavesVisibleRawTextOpen, t as SHOWN_PAGE_ZOOM_BRIDGE, u as thumbnailFilenameOf, v as unitsOf } from "./shown-files-core-CiEXUXvy.js";
|
|
18
18
|
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, 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
|
-
import { $ as decideRemoteTelemetryState, B as parseDataClientMessage, F as DEEP_HISTORY_SCROLLBACK_LINES, G as buildAiGenerationEvents, H as TELEMETRY_BATCH_URL, J as buildPersonProperties, K as buildBrowserExceptionProperties, L as LOGGED_FAST_CLOSE_COUNTS, P as isExperimentalSetting, Q as decideIsDevInstall, R as describeDataAttach, St as isSameDirectoryPath, U as TELEMETRY_FLAGS_URL, V as FIRST_RUN_NOTICE, W as adapterBucket, X as claudeAccountUuidOf, Y as classifySessionExit, Z as codexUserIdOf, _t as sessionIdFromBranch, a as ensureProjectIds, at as DashboardTelemetryReport, b as validateSettingsBlock, bt as canonicalizePath, ct as TelemetryState, dt as stableConfigKey, et as decideTelemetryConsent, f as DEFAULT_TIMER_FNS, gt as planWorktreeGc, ht as planBranchGc, i as createConfigStore, it as resolveProjectToken, j as valueAtPath, mt as matchedPrefix, n as DEFAULT_CONFIG, nt as nodeMajorVersion, o as generateProjectId, ot as PendingCrashReport, p as unrefTimer, pt as DEFAULT_BRANCH_GC_PREFIXES, q as buildExceptionProperties, rt as parsePosthogReleaseId, s as glimmervoidHomeDir$1, st as TELEMETRY_EVENT_SCHEMAS, t as ABORT_CONFIG_SAVE, tt as exceptionFingerprint, v as mergeSettingsBlock, vt as usablePrefixes, x as SETTINGS_INDEX, xt as comparableDirectoryPath, y as settingsBlockSpecFor, yt as worktreeIntegrationTips, z as parseDataAttach } from "./config-store-
|
|
20
|
+
import { $ as decideRemoteTelemetryState, B as parseDataClientMessage, F as DEEP_HISTORY_SCROLLBACK_LINES, G as buildAiGenerationEvents, H as TELEMETRY_BATCH_URL, J as buildPersonProperties, K as buildBrowserExceptionProperties, L as LOGGED_FAST_CLOSE_COUNTS, P as isExperimentalSetting, Q as decideIsDevInstall, R as describeDataAttach, St as isSameDirectoryPath, U as TELEMETRY_FLAGS_URL, V as FIRST_RUN_NOTICE, W as adapterBucket, X as claudeAccountUuidOf, Y as classifySessionExit, Z as codexUserIdOf, _t as sessionIdFromBranch, a as ensureProjectIds, at as DashboardTelemetryReport, b as validateSettingsBlock, bt as canonicalizePath, ct as TelemetryState, dt as stableConfigKey, et as decideTelemetryConsent, f as DEFAULT_TIMER_FNS, gt as planWorktreeGc, ht as planBranchGc, i as createConfigStore, it as resolveProjectToken, j as valueAtPath, mt as matchedPrefix, n as DEFAULT_CONFIG, nt as nodeMajorVersion, o as generateProjectId, ot as PendingCrashReport, p as unrefTimer, pt as DEFAULT_BRANCH_GC_PREFIXES, q as buildExceptionProperties, rt as parsePosthogReleaseId, s as glimmervoidHomeDir$1, st as TELEMETRY_EVENT_SCHEMAS, t as ABORT_CONFIG_SAVE, tt as exceptionFingerprint, v as mergeSettingsBlock, vt as usablePrefixes, x as SETTINGS_INDEX, xt as comparableDirectoryPath, y as settingsBlockSpecFor, yt as worktreeIntegrationTips, z as parseDataAttach } from "./config-store-DdRVlBmt.js";
|
|
21
21
|
import { i as resolveArgvCommandMatches } from "./kimi-CSByGhDL.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, 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, y as isCheckFresh, yt as isWithinGenerationRecencyWindow, z as completeLineBytes, zt as rawStoredHooks } from "./adapters-BCzX13NB.js";
|
|
23
23
|
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-gp8KlW8i.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-BHtmhtJA.js";
|
|
25
25
|
import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
|
|
26
|
-
import { a as defaultPairingsPath, c as decideDeviceAuth, i as createSeenStore, l as deviceNameFromUserAgent, n as configSiblingPath, o as defaultSeenPath, r as createPairingsStore, s as DEFAULT_DEVICE_MAX_AGE_MS, u as hashSecret } from "./pairings-store-
|
|
27
|
-
import { g as runGit, h as runGh, i as createCommitSessions, m as runCommand, p as gitCommandFailure, t as COMMIT_SESSIONS_FOLDER_NAME } from "./commit-sessions-
|
|
28
|
-
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-
|
|
26
|
+
import { a as defaultPairingsPath, c as decideDeviceAuth, i as createSeenStore, l as deviceNameFromUserAgent, n as configSiblingPath, o as defaultSeenPath, r as createPairingsStore, s as DEFAULT_DEVICE_MAX_AGE_MS, u as hashSecret } from "./pairings-store-OtnvMpSP.js";
|
|
27
|
+
import { g as runGit, h as runGh, i as createCommitSessions, m as runCommand, p as gitCommandFailure, t as COMMIT_SESSIONS_FOLDER_NAME } from "./commit-sessions-DpOoG4ys.js";
|
|
28
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-BfnxEEHx.js";
|
|
29
29
|
import { n as normalizeRemoteConfig, r as validateRemoteConfig, t as decideBindHost } from "./remote-config-Dcejfz01.js";
|
|
30
30
|
import { createRequire } from "node:module";
|
|
31
31
|
import fs, { readFileSync } from "node:fs";
|
|
@@ -46674,6 +46674,7 @@ function createSessionHandlers(context, deps) {
|
|
|
46674
46674
|
lastRemovalRefusalBySessionId.set(sess.id, refusal.error);
|
|
46675
46675
|
return refusal;
|
|
46676
46676
|
}
|
|
46677
|
+
if (msg.checkOnly === true) return { ok: true };
|
|
46677
46678
|
if (agentSessions.get(sess.id) === sess) {
|
|
46678
46679
|
if (isDiscardingWork) markChildWorktreeDiscard?.(sess.id);
|
|
46679
46680
|
lastRemovalRefusalBySessionId.delete(sess.id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import { l as resolveConfigPath } from "./config-store-
|
|
3
|
-
import { a as defaultPairingsPath, i as createSeenStore, o as defaultSeenPath, r as createPairingsStore, t as REVOCATION_PROPAGATION_SECONDS } from "./pairings-store-
|
|
2
|
+
import { l as resolveConfigPath } from "./config-store-DdRVlBmt.js";
|
|
3
|
+
import { a as defaultPairingsPath, i as createSeenStore, o as defaultSeenPath, r as createPairingsStore, t as REVOCATION_PROPAGATION_SECONDS } from "./pairings-store-OtnvMpSP.js";
|
|
4
4
|
import { n as normalizeRemoteConfig } from "./remote-config-Dcejfz01.js";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
//#region server/text-format.ts
|
|
@@ -2,7 +2,7 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { u as equalsIgnoringCaseOnWindows } from "./runtime-paths-CYwF658V.js";
|
|
3
3
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
4
4
|
import { a as jsonStateLoadError, d as writeJsonAtomicSync, l as sleepSync, s as loadJsonStateFileSync, u as writeJsonAtomic } from "./json-file-AKRVPqG1.js";
|
|
5
|
-
import { bt as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-
|
|
5
|
+
import { bt as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-DdRVlBmt.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import crypto from "node:crypto";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as errorMessage, t as errorCode } from "./text-DoirglWV.js";
|
|
2
2
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
3
3
|
import { m as AgentSettingsReply } from "./session-DUFWokKF.js";
|
|
4
|
-
import { r as BrowserConfig } from "./config-
|
|
4
|
+
import { r as BrowserConfig } from "./config-Cq5ButJ9.js";
|
|
5
5
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
6
6
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
7
|
-
import { C as deleteValueAtPath, D as scoreSettingsSearch, E as parsePosthogProjectSelection, N as SETTINGS_REGISTRY, O as setValueAtPath, S as cloneValue, c as loadConfigFile, d as validateConfig, ft as withEnvSecrets, g as isSettingAvailable, j as valueAtPath, lt as ENV_SECRET_BINDINGS, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, ut as readEnvSecrets } from "./config-store-
|
|
8
|
-
import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as availableSettings } from "./settings-readout-core-
|
|
7
|
+
import { C as deleteValueAtPath, D as scoreSettingsSearch, E as parsePosthogProjectSelection, N as SETTINGS_REGISTRY, O as setValueAtPath, S as cloneValue, c as loadConfigFile, d as validateConfig, ft as withEnvSecrets, g as isSettingAvailable, j as valueAtPath, lt as ENV_SECRET_BINDINGS, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, ut as readEnvSecrets } from "./config-store-DdRVlBmt.js";
|
|
8
|
+
import { a as fail, c as listSettings, d as renderSectionTables, f as requireConfigFileSetting, g as valueText, h as succeed, i as describeSetting, l as readSetting, m as settingsRequestForServer, n as configFileViewOf, o as fitColumn, p as sectionOf, r as defaultText, s as getSetting, t as availableSettings } from "./settings-readout-core-BfnxEEHx.js";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
//#region server/settings-cli.ts
|
|
@@ -303,7 +303,7 @@ function runParsedSettingsCommand(parsed, io) {
|
|
|
303
303
|
async function runParsedSettingsCli(parsed, io = processIo()) {
|
|
304
304
|
const serverRequest = settingsRequestForServer(parsed, process.env);
|
|
305
305
|
if (!serverRequest) return runParsedSettingsCommand(parsed, io);
|
|
306
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
306
|
+
const { askAgentApi } = await import("./agent-api-cli-B4EhNVX4.js");
|
|
307
307
|
const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
|
|
308
308
|
ok: false,
|
|
309
309
|
error: errorMessage(error)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as AgentSettingsRequest } from "./session-DUFWokKF.js";
|
|
2
2
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
3
|
-
import { A as settingsOf, M as FILE_ONLY_GROUPS, N as SETTINGS_REGISTRY, S as cloneValue, T as hasScaledUnit, g as isSettingAvailable, j as valueAtPath, k as settingsGroupOf, ut as readEnvSecrets, w as displayText, x as SETTINGS_INDEX } from "./config-store-
|
|
3
|
+
import { A as settingsOf, M as FILE_ONLY_GROUPS, N as SETTINGS_REGISTRY, S as cloneValue, T as hasScaledUnit, g as isSettingAvailable, j as valueAtPath, k as settingsGroupOf, ut as readEnvSecrets, w as displayText, x as SETTINGS_INDEX } from "./config-store-DdRVlBmt.js";
|
|
4
4
|
//#region server/core/settings-readout-core.ts
|
|
5
5
|
var VALUE_COLUMN_WIDTH = 40;
|
|
6
6
|
var SECTION_BY_SETTING_ID = new Map([...SETTINGS_REGISTRY.sections.flatMap((section) => section.settings.map((setting) => [setting.id, {
|
|
@@ -2,7 +2,7 @@ import { r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { A as SIGN_URL_ENV, I as SshSignReply } from "./session-DUFWokKF.js";
|
|
3
3
|
import { c as spawn, r as execFileAsync } from "./child-process-safe-BCOoKfxG.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-DExpTVWL.js";
|
|
6
6
|
import { l as parseSshPublicKey } from "./ssh-signing-core-CRhVVWNW.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as firstLine } from "./text-core-rXHoQWP9.js";
|
|
2
|
-
import { n as configSiblingPath } from "./pairings-store-
|
|
3
|
-
import { a as gitCommonDirectoryOf, c as findRecord, d as parseCommitLog, f as parseWhyTarget, g as runGit, l as formatWhy, n as GIT_MAX_BUFFER, o as patchIdsOfBatch, r as GIT_TIMEOUT_MS, s as storePathFor, t as COMMIT_SESSIONS_FOLDER_NAME, u as lastPromptBefore } from "./commit-sessions-
|
|
2
|
+
import { n as configSiblingPath } from "./pairings-store-OtnvMpSP.js";
|
|
3
|
+
import { a as gitCommonDirectoryOf, c as findRecord, d as parseCommitLog, f as parseWhyTarget, g as runGit, l as formatWhy, n as GIT_MAX_BUFFER, o as patchIdsOfBatch, r as GIT_TIMEOUT_MS, s as storePathFor, t as COMMIT_SESSIONS_FOLDER_NAME, u as lastPromptBefore } from "./commit-sessions-DpOoG4ys.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
//#region server/why-cli.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,u as n}from"./control-ws-
|
|
1
|
+
import{c as e,d as t,u as n}from"./control-ws-iqtzInzE.js";import{G as r,H as i,n as a}from"./updates-view-core-C1nXfl7Z.js";import{S as o,s}from"./dom-helpers-qjWTsLGI.js";import{C as c,w as l}from"./svg-dom-CQQ12iW3.js";var u=`cubic-bezier(0.22, 1, 0.36, 1)`,d=`cubic-bezier(0.4, 0, 0.2, 1)`,f=`cubic-bezier(0.1, 0.8, 0.3, 1)`,ee=`cubic-bezier(0.2, 0.9, 0.3, 1)`,te=460,p=`50% 87.5%`,m=90,h=window.matchMedia?.(`(prefers-reduced-motion: reduce)`),g=new WeakMap,_=new WeakMap,v=new WeakMap;function ne(e,t){let{class:n,...r}=t,i=c(16,16);return n!==void 0&&i.classList.add(n),i.append(l(e,r)),i}function y(e){return o[e].map(e=>ne(e.tag,e.attributes))}function b(e){let t=document.createElement(`span`);return t.className=`status-icon`,t.dataset.icon=e,t.append(...y(e)),t}function x(e){return e!==void 0&&Object.hasOwn(o,e)}function S(e,t,n){return e?e.animate(t,{fill:`both`,easing:u,...n}).finished.catch(()=>void 0):Promise.resolve()}function C(e,t,n){return Promise.all(e.map(e=>S(e,t,n)))}function w(e,t,n,r){let i=e?.firstElementChild;return i instanceof SVGElement?(i.setAttribute(`pathLength`,`1`),S(i,[{strokeDasharray:`1 3`,strokeDashoffset:t},{strokeDasharray:`1 3`,strokeDashoffset:n}],r)):Promise.resolve()}var T=(e,t)=>e.find(e=>e.classList.contains(t)),E=(e,t)=>e.find(e=>e.firstElementChild?.tagName===t),D=(e,t)=>e.filter(e=>!e.classList.contains(t));function O(e){let t=getComputedStyle(e).transform;if(!t||t===`none`)return 0;let n=new DOMMatrixReadOnly(t);return Math.atan2(n.b,n.a)*(180/Math.PI)}var re=(e,t)=>Promise.all([C(e,[{transform:`scale(1)`,opacity:1},{transform:`scale(0.6)`,opacity:0}],{duration:200,easing:`ease-in`}),C(t,[{transform:`scale(0.6)`,opacity:0},{transform:`scale(1)`,opacity:1}],{duration:280,delay:110})]),k=(e,t)=>S(e,[{transform:`scale(0.3)`,opacity:0},{transform:`scale(1.16)`,opacity:1,offset:.6},{transform:`scale(1)`,opacity:1}],{duration:350,delay:t}),A=e=>S(e,[{transform:`scale(1)`,opacity:1},{transform:`scale(0.2)`,opacity:0}],{duration:230,easing:`ease-in`});function ie(e,t){let n=e[0]?O(e[0]):0,r=Math.round(n/m)*m,i=e=>+!e.classList.contains(`status-icon-spin-blur`);for(let e of t)e.style.opacity=`0`;return Promise.all(e.map(e=>S(e,[{transform:`rotate(${n}deg)`,opacity:getComputedStyle(e).opacity},{transform:`rotate(${r}deg)`,opacity:i(e)}],{duration:240,easing:f}))).then(()=>{for(let e of t)e.style.opacity=``;return Promise.all([...e.map(e=>S(e,[{transform:`rotate(${r}deg) scale(1)`,opacity:i(e)},{transform:`rotate(${r}deg) scale(0.55)`,opacity:0}],{duration:300,easing:d})),C(t,[{transform:`scale(0.7, 0.25)`,opacity:0},{transform:`scale(1, 1.06)`,opacity:1,offset:.7},{transform:`scale(1)`,opacity:1}],{duration:340,delay:40,easing:ee})])})}var ae={"not-started>starting":(e,t)=>Promise.all([C(e,[{opacity:1},{opacity:0}],{duration:240,easing:`linear`}),C(D(t,`status-icon-spin-blur`),[{opacity:0},{opacity:1}],{duration:240,easing:`linear`})]),"not-started>idle":(e,t)=>Promise.all([C(e,[{transform:`scale(1)`,opacity:1},{transform:`scale(0.7)`,opacity:0}],{duration:340,easing:d}),C(t,[{transform:`scale(0.55)`,opacity:0},{transform:`scale(1)`,opacity:1}],{duration:340,delay:80,easing:d})]),"starting>idle":ie,"starting>working":(e,t)=>Promise.all([...e.map(e=>{let t=O(e);return S(e,[{transform:`rotate(${t}deg) scale(1)`,opacity:getComputedStyle(e).opacity},{transform:`rotate(${t}deg) scale(0.55)`,opacity:0}],{duration:260,easing:`ease-in`})}),k(T(t,`status-icon-beat`),160)]),"working>complete":(e,t)=>Promise.all([A(T(e,`status-icon-beat`)),w(t[0],1,0,{duration:320,delay:160})]),"working>failed":(e,t)=>Promise.all([A(T(e,`status-icon-beat`)),w(t[0],1,0,{duration:300,delay:150})]),"working>needs-input":(e,t)=>Promise.all([S(T(e,`status-icon-beat`),[{transform:`none`,opacity:1},{transform:`translateY(37.5%) scale(0.34)`,opacity:1,offset:.9},{transform:`translateY(37.5%) scale(0.34)`,opacity:0}],{duration:320}),S(E(t,`circle`),[{opacity:0},{opacity:0,offset:.85},{opacity:1}],{duration:320,easing:`linear`}),w(E(t,`path`),1,0,{duration:300,delay:260})]),"needs-input>working":(e,t)=>{let n=E(e,`circle`);return n&&(n.style.transformOrigin=p),Promise.all([w(E(e,`path`),0,1,{duration:200,easing:`ease-in`}),S(n,[{transform:`none`,opacity:1},{transform:`translateY(-37.5%) scale(2.95)`,opacity:1,offset:.95},{transform:`translateY(-37.5%) scale(2.95)`,opacity:0}],{duration:320,delay:140}),S(T(t,`status-icon-beat`),[{opacity:0},{opacity:0,offset:.9},{opacity:1}],{duration:470,easing:`linear`})])},"working>idle":(e,t)=>Promise.all([S(T(e,`status-icon-beat`),[{transform:`scale(1, 1)`,opacity:1},{transform:`scale(0.35, 1.15)`,opacity:0}],{duration:220,easing:`ease-in`}),C(t,[{transform:`scale(0.1, 0.8)`,opacity:0},{transform:`scale(1)`,opacity:1}],{duration:320,delay:120})]),"idle>working":(e,t)=>Promise.all([C(e,[{transform:`scale(1)`,opacity:1},{transform:`scale(0.1, 0.8)`,opacity:0}],{duration:220,easing:`ease-in`}),S(T(t,`status-icon-beat`),[{transform:`scale(0.35, 1.15)`,opacity:0},{transform:`scale(1.12, 1)`,opacity:1,offset:.6},{transform:`scale(1)`,opacity:1}],{duration:360,delay:120})]),"working>monitoring":(e,t)=>Promise.all([S(T(e,`status-icon-beat`),[{transform:`scale(1)`,opacity:1},{transform:`scale(1.3, 0.15)`,opacity:0}],{duration:220,easing:`ease-in`}),C(t,[{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:300,delay:160})]),"monitoring>working":(e,t)=>Promise.all([C(e,[{transform:`scaleY(1)`},{transform:`scaleY(0)`}],{duration:200,easing:`ease-in`}),k(T(t,`status-icon-beat`),170)]),"complete>exited":(e,t)=>Promise.all([w(e[0],0,-1,{duration:220,easing:`ease-in`}),w(t[0],1,0,{duration:380,delay:140})])};function j(e,t){v.get(t)?.cancel();let n=g.get(e);if(!n)return;t.style.setProperty(`--status-icon-from`,n);let r=t.animate([{"--status-icon-blend":`0%`},{"--status-icon-blend":`100%`}],{duration:te,easing:d});v.set(t,r),r.finished.then(()=>t.style.removeProperty(`--status-icon-from`),()=>void 0)}function M(e){e.isConnected&&g.set(e,getComputedStyle(e).color)}function N(e){for(let t of e.getAnimations({subtree:!0}))t instanceof CSSAnimation||t instanceof CSSTransition||t.cancel()}function P(e,t,n,r){_.get(t)?.();let i=[...t.children].filter(e=>e instanceof SVGSVGElement),a=y(r);for(let e of i)e.dataset.leaving=``;let o=T(i,`status-icon-ping`);o&&(N(o),o.style.opacity=`0`),t.dataset.icon=r,j(e,t),t.append(...a);let s=!1,c=()=>{if(!s){s=!0;for(let e of i)e.remove();for(let e of a)N(e),e.style.opacity=``;_.delete(t),M(e)}};_.set(t,c),(ae[`${n}>${r}`]??re)(i,a).then(c,c)}function F(e){return e.isConnected&&!document.hidden&&h?.matches!==!0&&typeof e.animate==`function`}function I(e,t){let n=e.dataset.icon;if(n===t)return;e.dataset.icon=t;let r=e.querySelector(`:scope > .status-icon`);!x(n)||!(r instanceof HTMLElement)||!F(e)?(r instanceof HTMLElement&&_.get(r)?.(),e.replaceChildren(b(t)),M(e)):P(e,r,n,t)}var L={busy:`text-text-muted`,ok:`text-state-done`,error:`text-state-failed`},R=15e3,z=`Something went wrong. Details are hidden in streamer mode.`;function B(e,t){return e!==`error`||t.startsWith(`Not connected to the server. Reconnecting.`)?t:document.documentElement.hasAttribute(`data-streamer`)?z:t}var V={busy:`working`,ok:`complete`,error:`failed`};function H(e){let t=e.querySelector(`:scope > .action-status-icon`),n=e.querySelector(`:scope > .action-status-text`);if(t&&n&&e.childNodes.length===2)return{iconElement:t,textElement:n};let r=s(`span`,`action-status-icon`);r.setAttribute(`aria-hidden`,`true`);let i=s(`span`,`action-status-text`);return e.replaceChildren(r,i),{iconElement:r,textElement:i}}function U(e){e.replaceChildren(),delete e.dataset.tone}function W(e,t,n){if(!n){U(e);return}if(!t){U(e),e.textContent=n;return}e.dataset.tone=t;let{iconElement:r,textElement:i}=H(e);I(r,V[t]),i.textContent=B(t,n)}function G(e=`action-status`){let t=s(`p`,e);return t.setAttribute(`role`,`status`),t.hidden=!0,{element:t,show:(n,r)=>{t.className=`${e} text-meta ${L[n]}`,W(t,n,r),t.hidden=!r},clear:()=>{t.hidden=!0,U(t)}}}function K(e,t){return n(e)?!0:(t.show(`error`,a),!1)}function q(e,t){let n=e instanceof Error?e.message:``;return n===`Request timed out`?`The server did not answer within ${Math.round(t/1e3)} s.`:n||`Not connected to the server. Reconnecting.`}async function oe(e,n,r,{busyText:i,timeoutMs:a=R}={}){i&&r.show(`busy`,i);try{let i=await t(e,n,{timeoutMs:a});return r.clear(),i}catch(e){return r.show(`error`,q(e,a)),null}}var J=null,se=3e4,Y=null;function X(){let e=document.getElementById(`header-status`),t=document.getElementById(`header-status-text`),n=document.getElementById(`header-status-age`),r=document.getElementById(`header-status-dismiss`);return!e||!t||!n||!r?null:(r.dataset.wired===void 0&&(r.dataset.wired=``,r.addEventListener(`click`,$)),{line:e,text:t,age:n})}function Z(){let e=X();if(!e||!J)return;let t=r(Date.now()-J.raisedAt,{...i,justNowBelowSeconds:60});e.age.textContent!==t&&(e.age.textContent=t)}function Q({source:t,sessionId:n,message:r,hidesInStreamerMode:i=!0}){e(t,r);let a=X();if(!a)return;let o=i?B(`error`,r):r,c=s(`strong`,`header-status-source`,t);a.text.replaceChildren(c,` ${o}`),a.text.title=`${t}: ${o}`,J={source:t,sessionId:n??null,raisedAt:Date.now()},Z(),Y??=window.setInterval(Z,se),a.line.hidden=!1}function ce(e,t){J?.source===e&&(t===void 0||J.sessionId===t)&&$()}function le(e){J?.sessionId===e&&$()}function $(){J=null,Y!==null&&window.clearInterval(Y),Y=null;let e=X();e&&(e.line.hidden=!0,e.text.replaceChildren(),e.text.title=``,e.age.textContent=``)}export{W as a,oe as c,G as i,K as l,ce as n,Q as o,le as r,q as s,R as t,I as u};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-
|
|
1
|
+
import"./updates-view-core-C1nXfl7Z.js";import{n as e,r as t,s as n}from"./dom-helpers-qjWTsLGI.js";import{Mi as r,Ni as i,ji as a}from"./index-DxS6qp5l.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,t,i){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,t)),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 t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`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=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:i,pendingActionBySuite:o,outcomeBySuite:s}=a(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!i,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,r.title),t(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),t(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),t(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=n(`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=n(`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(n(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(n(`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(n(`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:t}=a(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),i(h),h())}var _={mount:g};export{_ as view};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dt as e,Tt as t,bt as n,yt as r}from"./updates-view-core-C1nXfl7Z.js";import{f as i,s as a}from"./dom-helpers-qjWTsLGI.js";import{a as o,i as s,n as c}from"./modal-Dta3lhg0.js";import{S as l}from"./svg-dom-CQQ12iW3.js";import{i as u}from"./action-status-RL7Vkog6.js";import{a as d,r as f}from"./card-registry-BnVWc0v-.js";import{Kr as p,Ur as m,Wr as h,_t as ee,at as te,ct as g,dt as _,et as v,ft as ne,gt as y,ht as b,it as x,lt as S,mt as re,n as ie,nt as ae,ot as oe,pt as se,rt as C,st as ce,t as le,tt as ue,ui as de,ut as fe,vt as pe}from"./index-DxS6qp5l.js";Object.freeze({unitWarnings:[],uncoveredPaths:[],worthALookPaths:[],flaggedUnitIds:[],notChecked:null});var me=/^([^#\s]+)(?:#L([1-9]\d*)(?:-L([1-9]\d*))?)?$/;function he(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[A-Za-z]:/.test(e)}function ge(e){return e.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)}function _e(e){let t=me.exec(e);if(!t?.[1])return{error:`a ref is path, path#L12 or path#L12-L30`};let n=t[1];if(he(n))return{error:`an absolute path is never read; name the file relative to the code session worktree`};if(n.split(/[\\/]/).includes(`..`))return{error:`a path with .. is never read; name the file relative to the code session worktree`};let r=t[2]?Number(t[2]):null,i=t[3]?Number(t[3]):r;return r!==null&&i!==null&&i<r?{error:`the line range ends before it starts`}:{path:ge(n),startLine:r,endLine:i}}function ve(e,t,n){return n.flatMap((n,r)=>n.ref?[{elementId:t,ref:n.ref,where:`line ${r+1} of ${e}`}]:[])}function ye(e){let t=`${e.kind} ${e.id}`;switch(e.kind){case`box`:case`unit`:return[...e.refs.map(n=>({elementId:e.id,ref:n,where:t})),...ve(t,e.id,e.lines)];case`panel`:return ve(t,e.id,e.lines);case`note`:return e.ref?[{elementId:e.id,ref:e.ref,where:t}]:[];case`frame`:case`wire`:return[]}}function be(e){return[...new Set(ye(e).map(e=>e.ref))]}function xe(e){let t=_e(e);return`path`in t?t.path:null}var Se=4,Ce=200,we=2e4,Te=1.1,Ee=[`wire`,`note`,`frame`,`box`,`panel`,`unit`],De={v:`select`,r:`box`,d:`decision`,p:`panel`,a:`wire`};function w(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function T(){return document.documentElement.dataset.layout===`phone`}function Oe(e){return e instanceof SVGCircleElement&&e.classList.contains(`wb-port`)?e:null}function ke(e){return e===`box`||e===`decision`||e===`panel`}function Ae(e,t,n){if(e===`panel`){let e=Math.max(-1,...Object.values(t.elements).map(e=>e.kind===`panel`?e.order:-1));return{kind:`panel`,id:w(`panel`),title:`Panel`,lines:[],order:e+1}}let r=e===`decision`;return{kind:`box`,id:w(`box`),title:r?`Decision`:`Box`,lines:[],lane:null,refs:[],change:`none`,was:null,column:null,near:null,order:0,at:n,shape:r?`decision`:`box`,outputs:r?[{id:`yes`,label:`yes`},{id:`no`,label:`no`}]:[]}}function je(e){return e instanceof Element?e.closest(`[data-linked-board-id]`)?.dataset.linkedBoardId??null:null}function Me(e){let{svg:t,canvas:n,renderer:r}=e,i=new Map,o=new Set,s={x:0,y:0,width:1e3,height:600},c=null,l=null,u=null,d=`select`,f=null;function p(n){d=n,t.dataset.tool=n,e.onToolChange(n)}function m(){t.setAttribute(`viewBox`,`${s.x} ${s.y} ${s.width} ${s.height}`)}function h(e){let t=n.querySelector(e);return t?.checkVisibility()?t.getBoundingClientRect():null}function ee(){let e=t.getBoundingClientRect(),n=h(`.wb-island-board`),r=[`.wb-island-tools`,`.wb-bottom-left`].flatMap(e=>{let t=h(e);return t?[t.top]:[]}),i=n?Math.max(0,n.bottom-e.top):0,a=Math.min(e.height,...r.map(t=>t-e.top))-i;return a<e.height/2?{topPx:0,heightPx:e.height}:{topPx:i,heightPx:a}}function te(){let e=r.layout();if(!e)return;let{bounds:n}=e,i=t.clientWidth,a=t.clientHeight;if(i===0||a===0){s={...n},m();return}let o=ee(),c=Math.max(1,n.width/i,n.height/o.heightPx),l=i*c,u=n.y+n.height/2,d=o.topPx+o.heightPx/2;s={x:n.x-(l-n.width)/2,y:u-d*c,width:l,height:a*c},m()}function g(e,n){let r=t.getScreenCTM();if(!r)return{x:e,y:n};let i=new DOMPoint(e,n).matrixTransform(r.inverse());return{x:i.x,y:i.y}}function _(){let e=t.clientWidth||1,n=t.clientHeight||1;return Math.max(s.width/e,s.height/n)}function v(e,t){let n=Math.min(we,Math.max(Ce,s.width*t)),r=n/s.width;s={x:e.x-(e.x-s.x)*r,y:e.y-(e.y-s.y)*r,width:n,height:s.height*r},m()}function ne(e,t){let n=_();s={...s,x:s.x-e*n,y:s.y-t*n},m()}function y(t){o=t,r.setSelection(o),e.onSelectionChange(o)}function b(e,t){if(!t){y(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),y(n)}function x(e){return{x:Math.round(e.start.x+e.latest.x-e.origin.x),y:Math.round(e.start.y+e.latest.y-e.origin.y-e.pinnedOffsetY)}}function S(e,t,n){let r=e.elements[t];return r?.kind===`box`?{...e,elements:{...e.elements,[t]:{...r,at:n}}}:e}function re(e){return c?.kind!==`drag`||!c.hasMoved?e:S(e,c.boxId,x(c))}function ie(){u!==null&&cancelAnimationFrame(u),u=null}function ae(){ie();let t=e.currentBoard();t&&r.render(re(t))}function oe(){u===null&&(u=requestAnimationFrame(ae))}function se(e){c?.kind===`drag`&&e?.elements[c.boxId]?.kind!==`box`&&(c=null);let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&y(t)}function C(e){let t=r.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function ce(){let[e,t]=[...i.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function le(){c?.kind===`wire`&&ge(c,!1),c={kind:`pinch`,distance:ce(),viewWidth:s.width}}function ue(n){if(n.button!==0||l)return;let a=je(n.target);if(a){e.onOpenLinkedBoard(a);return}if(i.set(n.pointerId,{x:n.clientX,y:n.clientY}),t.setPointerCapture(n.pointerId),i.size===2){le();return}let o=r.elementFromTarget(n.target);if(ke(d)){de(d,g(n.clientX,n.clientY));return}let s=Oe(n.target);if(o?.kind===`box`&&s&&!T()){pe(n.pointerId,o.id,{x:s.cx.baseVal.value,y:s.cy.baseVal.value});return}let u=d===`wire`&&o?.kind===`box`?C(o.id):null;if(o&&u){pe(n.pointerId,o.id,{x:u.x+u.width/2,y:u.y+u.height/2});return}let f=o?.kind===`box`&&!T()?C(o.id):null;if(o&&f){let e=g(n.clientX,n.clientY),t=r.layout()?.pinnedOffsetY??0;c={kind:`drag`,pointerId:n.pointerId,boxId:o.id,origin:e,start:f,pinnedOffsetY:t,latest:e,hasMoved:!1,isAdditive:n.shiftKey};return}if(o&&!T()){b(o.id,n.shiftKey);return}let p=o?.kind===`box`?o.id:null;c={kind:`pan`,pointerId:n.pointerId,lastClient:{x:n.clientX,y:n.clientY},hasMoved:!1,tappedBoxId:p}}async function de(t,n){p(`select`);let i=e.currentBoard();if(!i)return;let a=r.layout()?.pinnedOffsetY??0,o=Ae(t,i,{x:Math.round(n.x),y:Math.round(n.y-a)});f=o.id;let s=await e.sendOps([{op:`add`,element:o}]);s||(f=null),s&&y(new Set([o.id])),fe()}function fe(){if(!f||!r.nodeOf(f))return;let e=f;f=null,Pe(e)}function pe(e,n,r){let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);i.setAttribute(`class`,`wb-wire-line wb-dashed wb-wire-draft`),i.setAttribute(`d`,`M ${r.x} ${r.y} L ${r.x} ${r.y}`),t.append(i),c={kind:`wire`,pointerId:e,fromBoxId:n,start:r,draftLine:i,targetBoxId:null}}function me(e,t){e.targetBoxId&&r.nodeOf(e.targetBoxId)?.classList.remove(`is-wire-target`),e.targetBoxId=t,t&&r.nodeOf(t)?.classList.add(`is-wire-target`)}function he(e,t){let n=g(t.clientX,t.clientY);e.draftLine.setAttribute(`d`,`M ${e.start.x} ${e.start.y} L ${n.x} ${n.y}`);let i=r.elementFromTarget(document.elementFromPoint(t.clientX,t.clientY));me(e,i?.kind===`box`&&i.id!==e.fromBoxId?i.id:null)}function ge(t,n){let r=t.targetBoxId;me(t,null),t.draftLine.remove(),n&&r&&e.onConnectBoxes(t.fromBoxId,r)}function _e(e,t){let n=g(t.clientX,t.clientY);!e.hasMoved&&Math.hypot(n.x-e.origin.x,n.y-e.origin.y)<Se*_()||(e.hasMoved=!0,e.latest=n,oe())}function ve(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<Se||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},ne(n,r))}function ye(e){let t=ce();if(t<=0||e.distance<=0)return;let n=[...i.values()];v(g(n.reduce((e,t)=>e+t.x,0)/n.length,n.reduce((e,t)=>e+t.y,0)/n.length),e.viewWidth*(e.distance/t)/s.width)}function be(e){i.has(e.pointerId)&&(i.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?ye(c):c?.kind===`drag`&&c.pointerId===e.pointerId?_e(c,e):c?.kind===`wire`&&c.pointerId===e.pointerId?he(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&ve(c,e))}async function xe(t,n){if(!t.hasMoved){b(t.boxId,t.isAdditive);return}ie(),t.latest=g(n.clientX,n.clientY);let i=x(t),a=e.currentBoard();a&&r.render(S(a,t.boxId,i)),await e.sendOps([{op:`set`,id:t.boxId,fields:{at:i}}])||ae()}function w(t){if(!i.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?xe(n,t):n?.kind===`wire`?(ge(n,n.pointerId===t.pointerId),d===`wire`&&p(`select`)):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&T()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||y(new Set)))}function Me(e){i.delete(e.pointerId);let t=c?.kind===`drag`;c?.kind===`wire`&&ge(c,!1),c=null,t&&ae()}function Ne(e){e.preventDefault(),e.ctrlKey||e.metaKey?v(g(e.clientX,e.clientY),e.deltaY>0?Te:1/Te):ne(-e.deltaX,-e.deltaY)}function E(){let e=l;l=null,e?.remove()}function Pe(i){let o=e.currentBoard()?.elements[i],s=r.nodeOf(i);if(o?.kind!==`box`&&o?.kind!==`panel`||!s)return;E();let c=n.getBoundingClientRect(),u=s.getBoundingClientRect(),d=a(`input`,`wb-title-input`);d.type=`text`,d.value=o.title,d.maxLength=80,d.setAttribute(`aria-label`,o.kind===`panel`?`Panel title`:`Box title`),d.style.left=`${u.left-c.left}px`,d.style.top=`${u.top-c.top}px`,d.style.width=`${Math.max(160,u.width)}px`,l=d,n.append(d),d.addEventListener(`keydown`,n=>{if(n.key===`Escape`){n.preventDefault(),E(),t.focus();return}if(n.key!==`Enter`)return;n.preventDefault();let r=d.value.trim();E(),t.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:i,fields:{title:r}}])}),d.addEventListener(`blur`,E),d.focus(),d.select()}function Fe(e){if(T())return;let t=r.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));(t?.kind===`box`||t?.kind===`panel`)&&Pe(t.id)}function D(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=Ee.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));y(new Set),e.sendOps(r)}function Ie(e){if(e.target!==t||e.metaKey||e.ctrlKey||e.altKey)return;if(e.key===`Delete`||e.key===`Backspace`){e.preventDefault(),D();return}let n=De[e.key.toLowerCase()];n&&!e.shiftKey?(e.preventDefault(),p(n)):e.key===`Escape`&&(y(new Set),p(`select`))}return t.tabIndex=0,t.addEventListener(`pointerdown`,ue),t.addEventListener(`pointermove`,be),t.addEventListener(`pointerup`,w),t.addEventListener(`pointercancel`,Me),t.addEventListener(`wheel`,Ne,{passive:!1}),t.addEventListener(`dblclick`,Fe),t.addEventListener(`keydown`,Ie),{fit:te,selectedIds:()=>o,clearSelection:()=>y(new Set),pruneSelection:se,previewOf:re,closeTitleInput:E,setTool:p,openPendingTitleEdit:fe,focusCanvas:()=>t.focus()}}var Ne=Object.freeze({undo:[],redo:[]}),E=new Set([`box`,`unit`,`panel`]),Pe=[`wire`,`note`,`frame`,`box`,`panel`,`unit`],Fe=new Set([`kind`,`id`]);function D(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Ie(e){return e.kind===`box`?e.near?[e.near.of]:[]:e.kind===`unit`?e.after:[]}function Le(e){let t=new Set(e.map(e=>e.id)),n=[];for(;t.size>0;){let r=e.filter(e=>t.has(e.id)&&Ie(e).every(e=>!t.has(e))),i=r.length>0?r:e.filter(e=>t.has(e.id));for(let e of i)t.delete(e.id);n.push(...i)}return n}function Re(e,t){let n={...e},r=Object.fromEntries(Object.entries(t).filter(([e,t])=>!Fe.has(e)&&!D(n[e],t)));return t.kind!==`note`||Object.keys(r).length===0?r:{...r,author:t.author,resolvedBy:t.resolvedBy}}function ze(e,t){let n={...e.title===t.title?{}:{title:t.title},...e.caption===t.caption?{}:{caption:t.caption},...D(e.legend,t.legend)?{}:{legend:t.legend},...e.codeSessionId===t.codeSessionId?{}:{codeSessionId:t.codeSessionId}};return Object.keys(n).length===0?[]:[{op:`board`,...n}]}function Be(e,t){if(D(e.columns,t.columns))return{widen:[],narrow:[]};let n=new Set(t.columns.map(e=>e.id));return{widen:[{op:`columns`,columns:[...t.columns,...e.columns.filter(e=>!n.has(e.id))],move:{}}],narrow:[{op:`columns`,columns:t.columns,move:{}}]}}function Ve(e,t){let n=Object.values(e.elements),r=Object.values(t.elements),i=Pe.flatMap(e=>n.filter(n=>n.kind===e&&!t.elements[n.id])),a=Le(r.filter(t=>!e.elements[t.id])),o=r.flatMap(t=>{let n=e.elements[t.id];if(!n)return[];let r=Re(n,t);return Object.keys(r).length===0?[]:[{op:`set`,id:t.id,fields:r}]}),{widen:s,narrow:c}=Be(e,t);return[...D(e.lanes,t.lanes)?[]:[{op:`lanes`,lanes:t.lanes}],...s,...i.map(e=>({op:`remove`,id:e.id})),...a.filter(e=>E.has(e.kind)).map(e=>({op:`add`,element:e})),...o,...a.filter(e=>!E.has(e.kind)).map(e=>({op:`add`,element:e})),...c,...ze(e,t)]}function He(e,t){let n=y(e,t,b,e.updatedAt);return n.ok?Ve(n.board,e):[]}function Ue(e,t){return t.length===0?[...e]:[...e,t].slice(-100)}function We(e,t){return t.length===0?e:{undo:Ue(e.undo,t),redo:[]}}function Ge(e,t){let n=e[t].at(-1);return n?{entry:n,history:{...e,[t]:e[t].slice(0,-1)}}:null}function Ke(e,t,n){let r=t===`undo`?`redo`:`undo`;return{...e,[r]:Ue(e[r],n)}}var qe=8,Je=12,Ye=30,Xe=40,Ze=40,Qe=400,$e=200,et=8,tt=`README.md`,nt=``,rt=[`text`,`code`,`item`,`numbered`,`kv`],it=[`plain`,`fail`,`join`,`lane`],at=O(rt),ot=O(it),st=O([`box`,`decision`]),ct=O(n),lt=O(t),ut=[{value:``,text:`auto`},...O([`left`,`right`,`top`,`bottom`])],dt=[{id:`yes`,label:`yes`},{id:`no`,label:`no`}];function O(e){return e.map(e=>({value:e,text:e}))}function k(e){return a(`h3`,`wb-inspect-heading`,e)}function A(e,t){let n=a(`label`,`wb-inspect-field`);return n.append(a(`span`,`wb-inspect-label`,e),t),n}function j(e,t,n,r,i){let o=a(`input`,`wb-inspect-input`);return o.type=`text`,o.value=t,o.maxLength=n,o.dataset.field=e,i&&o.setAttribute(`aria-label`,i),o.addEventListener(`change`,()=>r(o.value)),o}function M(e,t,n,r,i){let o=a(`select`,`wb-inspect-select`);return o.dataset.field=e,i&&o.setAttribute(`aria-label`,i),o.append(...t.map(e=>{let t=a(`option`,null,e.text);return t.value=e.value,t.selected=e.value===n,t})),o.addEventListener(`change`,()=>r(o.value)),o}function N(e,t,n,r){let i=a(`input`,`wb-inspect-check`);i.type=`checkbox`,i.checked=n,i.dataset.field=e,i.addEventListener(`change`,()=>r(i.checked));let o=a(`label`,`wb-inspect-toggle`);return o.append(i,a(`span`,null,t)),o}function P(e,t,n,r){let i=a(`button`,`wb-button wb-inspect-action`,t);return i.type=`button`,i.dataset.field=e,r&&i.setAttribute(`aria-label`,r),i.addEventListener(`click`,n),i}function ft(e,t,n){let r=a(`div`,`wb-inspect-list`);return r.append(a(`span`,`wb-inspect-label`,e),...t,n),r}function pt(e,t){return{edit(n,r){let i=e(),a=i?.[n];i&&a!==void 0&&t(i.map((e,t)=>t===n?r(a):e))},remove(n){let r=e();r&&t(r.filter((e,t)=>t!==n))},append(n){let r=e();r&&t([...r,n(r)])}}}function mt(e){let t=e.trim();return r.safeParse(t).success?t:null}function ht(e,t,n,r){let i=j(e,t??``,$e,e=>{if(!e.trim()){n(null);return}let t=mt(e);t&&n(t)},r);return i.placeholder=`ref: path#L12`,i}function gt(e,t,n,r){let i=pt(n,r),o=t.map((e,t)=>{let n=a(`div`,`wb-inspect-row`);return n.append(j(`ref-${t}`,e,$e,e=>{let n=mt(e);n&&i.edit(t,()=>n)},`Ref ${t+1}`),P(`ref-${t}-remove`,`remove`,()=>i.remove(t),`Remove ref ${e}`)),n}),s=P(`ref-add`,`add ref`,()=>i.append(()=>tt),`Add a ref to ${e}`);return s.disabled=t.length>=et,ft(`Refs`,o,s)}function _t(e,t){return t===`kv`?{...e,style:t,key:e.key||`key`}:{...e,style:t}}function vt(t,n,r,i){let o=pt(r,i),s=n.map((t,n)=>{let r=a(`div`,`wb-inspect-row`),i=n+1;return r.append(M(`line-${n}-style`,at,t.style,e=>{let t=rt.find(t=>t===e);t&&o.edit(n,e=>_t(e,t))},`Line ${i} style`)),t.style===`kv`&&r.append(j(`line-${n}-key`,t.key??``,Ze,e=>{e.trim()&&o.edit(n,t=>({...t,key:e.trim()}))},`Line ${i} key`)),r.append(j(`line-${n}-text`,t.text,e.line,e=>o.edit(n,t=>({...t,text:e})),`Line ${i} text`),ht(`line-${n}-ref`,t.ref,e=>o.edit(n,t=>({...t,ref:e})),`Line ${i} ref`),P(`line-${n}-remove`,`remove`,()=>o.remove(n),`Remove line ${i}`)),r}),c=P(`line-add`,`add line`,()=>o.append(()=>({text:`new line`,muted:!1,style:`text`,key:null,ref:null})),`Add a line to ${t}`);return c.disabled=n.length>=e.linesPerBox,ft(`Lines`,s,c)}function yt(e){let t=new Set(e.map(e=>e.id)),n=e.length+1;for(;t.has(`exit-${n}`);)n+=1;return`exit-${n}`}function bt(e,t,n){let r=pt(t,e=>n({outputs:e})),i=e.outputs.map((e,t)=>{let n=a(`div`,`wb-inspect-row`);return n.append(j(`output-${e.id}-label`,e.label,Ye,e=>{e.trim()&&r.edit(t,t=>({...t,label:e.trim()}))},`Output ${e.id} label`),P(`output-${e.id}-remove`,`remove`,()=>r.remove(t),`Remove output ${e.label}`)),n}),o=P(`output-add`,`add output`,()=>r.append(e=>({id:yt(e),label:`exit`})));return o.disabled=e.outputs.length>=qe,ft(`Outputs`,i,o)}function xt(e){return e.at===null&&e.near===null?e.column??nt:nt}function St(t,n,r,i,a){let o=()=>{let e=r();return e?.kind===`box`?e:null},s=[{value:nt,text:`free`},...t.columns.map(e=>({value:e.id,text:e.title||e.id}))],c=[{value:``,text:`none`},...t.lanes.map(e=>({value:e.id,text:e.label||e.id}))];return[k(n.shape===`decision`?`Decision`:`Box`),A(`Title`,j(`title`,n.title,e.title,e=>{e.trim()&&a({title:e.trim()})})),A(`Shape`,M(`shape`,st,n.shape,e=>{let t=o()?.outputs??[];e===`decision`&&a({shape:e,outputs:t.length>0?t:dt}),e===`box`&&a({shape:e,outputs:[]})})),A(`Column`,M(`column`,s,xt(n),e=>{if(e!==nt){a({column:e,at:null,near:null});return}let t=i?.elements.find(e=>e.id===n.id);i&&t?.kind===`box`&&a({at:{x:t.x,y:t.y-i.pinnedOffsetY},near:null})})),A(`Lane`,M(`lane`,c,n.lane??``,e=>a({lane:e||null}))),A(`Change`,M(`change`,ct,n.change,e=>{a(e===`relabeled`?{change:e,was:o()?.was??n.title}:{change:e,was:null})})),...n.change===`relabeled`?[A(`Was`,j(`was`,n.was??``,e.title,e=>{e.trim()&&a({was:e.trim()})}))]:[],...n.shape===`decision`?[bt(n,()=>o()?.outputs??null,a)]:[],gt(`this box`,n.refs,()=>o()?.refs??null,e=>a({refs:e})),vt(`this box`,n.lines,()=>o()?.lines??null,e=>a({lines:e}))]}function Ct(e,t,n){let r=e.elements[t.from],i=r?.kind===`box`&&r.shape===`decision`?[{value:``,text:`none`},...r.outputs.map(e=>({value:e.id,text:e.label}))]:[];return[k(`Wire`),A(`Label`,j(`label`,t.label??``,Xe,e=>n({label:e.trim()||null}))),A(`Tone`,M(`tone`,ot,t.tone,e=>n({tone:e}))),N(`dashed`,`dashed`,t.dashed,e=>n({dashed:e})),N(`back`,`returns to an earlier step`,t.back,e=>n({back:e})),A(`Leaves from`,M(`fromSide`,ut,t.fromSide??``,e=>n({fromSide:e||null}))),A(`Arrives at`,M(`toSide`,ut,t.toSide??``,e=>n({toSide:e||null}))),...i.length>0?[A(`From output`,M(`fromOutput`,i,t.fromOutput??``,e=>n({fromOutput:e||null})))]:[]]}function wt(t,n){return[k(`Frame`),A(`Title`,j(`title`,t.title,e.title,e=>n({title:e.trim()}))),N(`loop`,`repeats as a loop`,t.loop,e=>n({loop:e}))]}function Tt(t,n,r){return[k(`Panel`),A(`Title`,j(`title`,t.title,e.title,e=>{e.trim()&&r({title:e.trim()})})),vt(`this panel`,t.lines,()=>{let e=n();return e?.kind===`panel`?e.lines:null},e=>r({lines:e}))]}function Et(e,t,n){let r=pt(t,n),i=e.map((e,t)=>{let n=a(`div`,`wb-inspect-row wb-inspect-legend-row`),i=t+1;return n.append(M(`legend-${t}-tone`,ot,e.tone,e=>{let n=it.find(t=>t===e);n&&r.edit(t,e=>({...e,tone:n}))},`Legend entry ${i} tone`),j(`legend-${t}-label`,e.label,Xe,e=>{e.trim()&&r.edit(t,t=>({...t,label:e.trim()}))},`Legend entry ${i} label`),N(`legend-${t}-dashed`,`dashed`,e.dashed,e=>r.edit(t,t=>({...t,dashed:e}))),N(`legend-${t}-back`,`returns`,e.back,e=>r.edit(t,t=>({...t,back:e}))),P(`legend-${t}-remove`,`remove`,()=>r.remove(t),`Remove legend entry ${e.label}`)),n}),o=P(`legend-add`,`add entry`,()=>r.append(()=>({tone:`plain`,dashed:!1,back:!1,label:`meaning`})));return o.disabled=e.length>=Je,ft(`Legend`,i,o)}function Dt(e,t){return[k(`Note`),A(`Ref`,ht(`ref`,e.ref,e=>t({ref:e}),`Ref`)),a(`p`,`wb-inspect-hint`,`Edit a note from its box.`)]}function Ot(e,n,r){return[k(`Unit`),A(`Status`,M(`unit-status`,lt,e.status,e=>{let n=t.find(t=>t===e);n&&r({status:n})})),gt(`this unit`,e.refs,()=>{let e=n();return e?.kind===`unit`?e.refs:null},e=>r({refs:e})),a(`p`,`wb-inspect-hint`,`Agents edit units with glimmervoid whiteboard plan.`)]}function kt(t,n,r,i,a){let o=[{value:``,text:`none`},...i];return[k(`Board`),P(`board-settings-close`,`close`,a,`Close board settings`),A(`Title`,j(`board-title`,t.title,e.title,e=>{e.trim()&&r([{op:`board`,title:e.trim()}])})),A(`Caption`,j(`board-caption`,t.caption??``,Qe,e=>r([{op:`board`,caption:e.trim()||null}]))),A(`Code session`,M(`board-code-session`,o,t.codeSessionId??``,e=>r([{op:`board`,codeSessionId:e||null}]))),Et(t.legend,()=>n()?.legend??null,e=>r([{op:`board`,legend:e}]))]}function At(e,t,n,r,i){let a=e=>i([{op:`set`,id:t.id,fields:e}]),o=()=>n()?.elements[t.id];switch(t.kind){case`box`:return St(e,t,o,r,a);case`wire`:return Ct(e,t,a);case`frame`:return wt(t,a);case`panel`:return Tt(t,o,a);case`note`:return Dt(t,a);case`unit`:return Ot(t,o,a)}}function jt(e,t,n){let r=be(t);if(r.length===0)return[];let i=e.codeSessionId!==null,o=r.map((e,t)=>{let r=a(`div`,`wb-inspect-row wb-inspect-review-row`),o=P(`review-${t}`,`open in review`,()=>n(e),`Open ${e} in review`);return o.disabled=!i,r.append(a(`code`,`wb-inspect-ref`,e),o),r}),s=i?[]:[a(`p`,`wb-inspect-hint`,`Set the board code session to open refs in review.`)];return[k(`In review`),...o,...s]}function Mt(e,t,n){let r=a(`div`,`wb-inspect-review`);return r.append(...jt(e,t,n)),r}function Nt(e){let t=document.activeElement;return e.contains(t)&&t instanceof HTMLInputElement&&t.type===`text`}function Pt(e){let{container:t}=e;t.setAttribute(`aria-label`,`Properties`);let n=t=>void e.sendOps(t),r=new Set,i=!1,a=!1;function o(e,t){if(t.size!==1)return;let[n]=t;return n===void 0?void 0:e.elements[n]}function s(n,r){let i=o(n,r),a=t.querySelector(`.wb-inspect-review`);i&&a&&a.replaceChildren(...jt(n,i,e.openRef))}function c(t,r){if(r.size>1)return[k(`${r.size} selected`)];let i=o(t,r);return i?[...At(t,i,e.currentBoard,e.layout(),n),Mt(t,i,e.openRef)]:kt(t,e.currentBoard,n,e.codeSessionChoices(),d)}function l(n){r=n,n.size>0&&(a=!1);let o=e.currentBoard();if(t.hidden=!o||n.size===0&&!a,!o||t.hidden)return;if(Nt(t)){s(o,n);return}let l=document.activeElement,u=l instanceof HTMLElement&&t.contains(l)?l.dataset.field:void 0;i=!0,t.replaceChildren(...c(o,n)),u&&t.querySelector(`[data-field="${CSS.escape(u)}"]`)?.focus(),i=!1}function u(){a=!0,l(r),t.querySelector(`[data-field="board-caption"]`)?.focus()}function d(){a&&(a=!1,l(r))}return t.addEventListener(`keydown`,e=>{e.key===`Escape`&&a&&(e.preventDefault(),d())}),t.addEventListener(`focusout`,e=>{i||t.hidden||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||queueMicrotask(()=>l(r))}),{paint:l,openBoardSettings:u,closeBoardSettings:d}}var Ft=`http://www.w3.org/2000/svg`,F=12,It=26,I=20,Lt=18,Rt=17,zt=14,Bt=16,Vt=24,Ht=18,Ut=`Plan`,Wt=`open linked board`,Gt=5,Kt=17,qt=6,Jt=20,Yt=12,Xt=4,Zt=3,Qt=7.2,$t=13,en=17,tn=2.2,nn=28;function rn(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:[` ${e}="${p(t)}"`]).join(``)}function L(e,t,n=``){return`<${e}${rn(t)}>${n}</${e}>`}function R(e,t,n,r,i={}){return L(`text`,{x:t,y:n,class:r,...i},p(e))}function z(e,t,n){return L(`g`,{class:`wb-element ${t}`,"data-element-id":e.id,"data-element-kind":e.kind},n.join(``))}function an(e){return e?`stroke:${e}`:null}function on(e){let t=e.x+e.width,n=e.y+e.headerHeight/2,r=`M${e.x+Yt},${e.y} H${t-Yt} L${t},${n}`;return e.outputs.length===0?`${r} L${t-Yt},${e.y+e.height} H${e.x+Yt} L${e.x},${n} Z`:`${r} V${e.y+e.height} H${e.x} V${n} Z`}function sn(e){return e.outputs.flatMap(t=>{let n=(e.height-e.headerHeight)/e.outputs.length/2,r=t.port.y-n;return[L(`line`,{x1:e.x,y1:r,x2:e.x+e.width,y2:r,class:`wb-output-divider`}),R(t.label,e.x+F,t.port.y+Xt,`wb-output-label`),L(`circle`,{cx:t.port.x,cy:t.port.y,r:Zt,class:`wb-output-dot`})]})}function cn(e){return e.style===`code`?`wb-box-line wb-line-code`:e.muted?`wb-box-line wb-muted`:`wb-box-line`}function ln(e,t,n,r){let i=t+F+(e.muted?zt:0),a=[];return e.style===`code`&&a.push(L(`rect`,{x:i-4,y:r-$t,width:t+n-F+4-i+4,height:en,rx:3,class:`wb-code-band`})),e.style===`item`&&e.isFirstRow&&a.push(L(`circle`,{cx:i+4,cy:r-4,r:tn,class:`wb-item-dot`})),e.marker!==null&&a.push(R(e.marker,i,r,e.style===`kv`?`wb-line-key`:`wb-line-marker`)),e.text&&a.push(R(e.text,i+e.indentChars*Qt,r,cn(e))),a}function un(e,t,n,r){return e.flatMap((e,i)=>ln(e,t,n,r+i*Lt))}function dn(e){let t=[L(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:6,class:`wb-panel-outline`})];e.titleLines.forEach((n,r)=>{t.push(R(n,e.x+F,e.y+It+r*I,`wb-box-title`))});let n=e.y+It+e.titleLines.length*I;return e.bodyLines.length>0&&t.push(L(`line`,{x1:e.x+F,y1:n-12,x2:e.x+e.width-F,y2:n-12,class:`wb-panel-rule`})),t.push(...un(e.bodyLines,e.x,e.width,n)),z(e,`wb-panel`,t)}function fn(e){return e.shape===`decision`?L(`path`,{d:on(e),class:`wb-box-outline`,style:an(e.lane?.hex)}):L(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:8,class:`wb-box-outline`,style:an(e.lane?.hex)})}function pn(e){let t=[fn(e),...sn(e)],n=e.x+e.width/2,r=e.y+e.height/2;for(let[i,a]of[[n,e.y],[e.x+e.width,r],[n,e.y+e.height],[e.x,r]])t.push(L(`circle`,{cx:i,cy:a,r:Gt,class:`wb-port`}));e.wasLines.forEach((n,r)=>{t.push(R(n,e.x+F,e.y+It+r*I,`wb-box-was`))});let i=e.y+It+e.wasLines.length*I;e.titleLines.forEach((n,r)=>{t.push(R(n,e.x+F,i+r*I,`wb-box-title`))});let a=i+e.titleLines.length*I;if(t.push(...un(e.bodyLines,e.x,e.width,a)),e.lane&&e.showsLanePill){let n=e.y+e.headerHeight-28,r=Math.min(e.width-24,16+e.lane.label.length*8);t.push(L(`rect`,{x:e.x+F,y:n,width:r,height:18,rx:9,class:`wb-lane-pill`,style:an(e.lane.hex)}),R(e.lane.label,e.x+F+8,n+13,`wb-lane-pill-text`,{style:`fill:${e.lane.hex}`}))}return z(e,e.change===`none`?`wb-box`:`wb-box wb-change-${e.change}`,t)}function mn(e){let t=e.x+e.width-Jt,n=e.y+qt+6;return L(`path`,{d:`M ${t+qt} ${n} A ${qt} ${qt} 0 1 1 ${t} ${n-qt}`,"marker-end":`url(#wb-arrow)`,class:`wb-loop-badge`})}function hn(e){let t=[L(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12,class:`wb-frame-outline`}),R(e.title,e.x+14,e.y+18,`wb-frame-title`)];return e.isLoop&&t.push(mn(e)),z(e,e.isLoop?`wb-frame wb-loop`:`wb-frame`,t)}function gn(e){let t=[L(`path`,{d:e.path,class:`wb-wire-hit`}),L(`path`,{d:e.path,"marker-end":e.hasArrowhead?`url(#wb-arrow)`:null,class:e.isDashed?`wb-wire-line wb-dashed`:`wb-wire-line`,style:an(e.strokeHex??void 0)}),L(`circle`,{cx:e.start.x,cy:e.start.y,r:3,class:`wb-wire-dot`})];return e.joinAt&&t.push(L(`circle`,{cx:e.joinAt.x,cy:e.joinAt.y,r:3,class:`wb-wire-dot`})),e.label&&t.push(R(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),z(e,e.isBack?`wb-wire wb-back wb-tone-${e.tone}`:`wb-wire wb-tone-${e.tone}`,t)}function _n(e){let t=[L(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:4,class:`wb-note-card`})];return e.lines.forEach((n,r)=>{t.push(R(n,e.x+10,e.y+22+r*Rt,`wb-note-text`))}),e.byline&&t.push(R(e.byline,e.x+10,e.y+22+e.lines.length*Rt,`wb-note-byline`)),z(e,e.isResolved?`wb-note wb-resolved`:`wb-note`,t)}function vn(e){let t=[L(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:8,class:`wb-unit-outline`}),R(e.label,e.x+F,e.y+Vt,`wb-unit-label`),R(e.status,e.x+e.width-F,e.y+Vt,`wb-unit-status wb-unit-${e.status}`,{"text-anchor":`end`})],n=e.y+Vt+Ht;e.titleLines.forEach((r,i)=>{t.push(R(r,e.x+F,n+i*I,`wb-box-title`))});let r=n+e.titleLines.length*I;return t.push(...un(e.bodyLines,e.x,e.width,r)),e.linkedBoardId&&t.push(R(Wt,e.x+F,r+e.bodyLines.length*Lt,`wb-unit-link`,{"data-linked-board-id":e.linkedBoardId})),z(e,`wb-unit`,t)}function yn(e){switch(e.kind){case`box`:return pn(e);case`frame`:return hn(e);case`wire`:return gn(e);case`note`:return _n(e);case`unit`:return vn(e);case`panel`:return dn(e)}}function bn(e){let t=[];if(e.plan){t.push(R(Ut,e.plan.titleAt.x,e.plan.titleAt.y,`wb-column-title`));for(let n of e.plan.arrowPaths)t.push(L(`path`,{d:n,"marker-end":`url(#wb-arrow)`,class:`wb-wire-line`}))}for(let n of e.bands)t.push(L(`line`,{x1:n.x,y1:n.y,x2:n.x+n.width,y2:n.y,class:`wb-band-rule`})),n.label&&t.push(R(n.label,n.x,n.y+Kt,`wb-band-label`,{style:`fill:${n.hex}`}));for(let n of e.columns)n.titleLines.length!==0&&(n.titleLines.forEach((e,r)=>{t.push(R(e,n.x,n.titleBaselineY+r*Bt,`wb-column-title`))}),t.push(L(`line`,{x1:n.x,y1:n.ruleY,x2:n.x+n.width,y2:n.ruleY,class:`wb-column-rule`})));for(let n of e.legend)t.push(Sn(n));return e.caption&&t.push(R(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),L(`g`,{class:`wb-chrome`},t.join(``))}function xn(e){let{swatch:t}=e;if(t.kind===`lane`)return L(`rect`,{x:e.x,y:e.y,width:14,height:14,rx:3,class:`wb-legend-swatch`,style:`fill:${t.hex}`});if(t.kind===`change`)return L(`g`,{class:`wb-change-${t.change}`},L(`rect`,{x:e.x,y:e.y,width:nn,height:14,rx:3,class:`wb-legend-swatch wb-box-outline`}));let n=L(`path`,{d:`M${e.x},${e.y+7} H${e.x+nn}`,"marker-end":`url(#wb-arrow)`,class:t.isDashed?`wb-wire-line wb-dashed`:`wb-wire-line`});return L(`g`,{class:t.isBack?`wb-back wb-tone-${t.tone}`:`wb-tone-${t.tone}`},n)}function Sn(e){let t=e.x+(e.swatch.kind===`lane`?22:40);return xn(e)+R(e.label,t,e.y+12,`wb-legend-text`)}function Cn(){return L(`defs`,{},L(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`},L(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})))}var wn={worthALookIds:new Set,flaggedUnitIds:new Set},Tn=9;function B(e,t=``){let n=document.createElementNS(Ft,e);return t&&n.setAttribute(`class`,t),n}function En(e){let t=B(`g`);return t.innerHTML=e,[...t.children]}function Dn(e){let[t]=En(e);if(!(t instanceof SVGGElement))throw Error(`the whiteboard markup did not draw a group`);return t}var On={frame:`frames`,wire:`wires`,box:`boxes`,panel:`boxes`,note:`notes`,unit:`units`},kn=[`box`,`frame`,`wire`,`note`,`unit`,`panel`];function An(e){let t={frames:B(`g`,`wb-layer`),wires:B(`g`,`wb-layer`),boxes:B(`g`,`wb-layer`),notes:B(`g`,`wb-layer`),units:B(`g`,`wb-layer`)},n=B(`g`);e.replaceChildren(...En(Cn()),n,t.frames,t.wires,t.boxes,t.notes,t.units);let r=new Map,i=null,a=new Set,o=wn;function s(e,t){t.classList.toggle(`is-selected`,a.has(e))}function c(e){let t=B(`g`,`wb-look-marker`),n=e.x+e.width,r=e.y,i=B(`circle`);i.setAttribute(`cx`,String(n)),i.setAttribute(`cy`,String(r)),i.setAttribute(`r`,String(Tn));let a=B(`text`);a.setAttribute(`x`,String(n)),a.setAttribute(`y`,String(r+4)),a.setAttribute(`text-anchor`,`middle`),a.textContent=`!`;let o=B(`title`);return o.textContent=`worth a look in review`,t.append(o,i,a),t}function l(e,t){t.classList.toggle(`is-flagged`,o.flaggedUnitIds.has(e.id));let n=t.querySelector(`:scope > .wb-look-marker`);e.kind===`wire`||!o.worthALookIds.has(e.id)?n?.remove():n||t.append(c(e))}function u(e){let a=pe(e),o=Dn(bn(a));n.replaceWith(o),n=o;let c=new Set;for(let e of a.elements){c.add(e.id);let n=ee(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Dn(yn(e));s(e.id,a),l(e,a),i&&i.node.replaceWith(a),i||t[On[e.kind]].append(a),r.set(e.id,{signature:n,node:a})}for(let[e,t]of r)c.has(e)||(t.node.remove(),r.delete(e));return i=a,a}function d(e){if(!(e instanceof Element))return null;let t=e.closest(`.wb-element`),n=t?.dataset.elementId,r=kn.find(e=>e===t?.dataset.elementKind);return!n||!r?null:{id:n,kind:r}}function f(e){a=e;for(let[e,t]of r)s(e,t.node)}function p(e){o=e;for(let e of i?.elements??[]){let t=r.get(e.id)?.node;t&&l(e,t)}}function m(){for(let e of r.values())e.node.remove();r.clear();let e=B(`g`);n.replaceWith(e),n=e,i=null}return{render:u,layout:()=>i,elementFromTarget:d,nodeOf:e=>r.get(e)?.node??null,setSelection:f,setReviewMarks:p,clear:m}}var jn=`http://www.w3.org/2000/svg`,Mn=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Nn=`Pick a board above.`,Pn=`wb-board-title-rename`,Fn=`M2.5 4h11M2.5 8h11M2.5 12h11`,In=`M3 2.5h7l3 3v8H3z M10 2.5v3h3`,Ln=`M13.5 8H3 M7 4L3 8l4 4`,Rn=`M2.5 4.5h11v9h-11z M2.5 4.5v-2h5v2`,zn=`M6 4.5h7.5 M6 8h7.5 M6 11.5h7.5 M2.5 4.5h0.01 M2.5 8h0.01 M2.5 11.5h0.01`,Bn=`M2.5 6V2.5H6 M10 2.5h3.5V6 M13.5 10v3.5H10 M6 13.5H2.5V10`,Vn=`M5.5 3.5l-3 3l3 3 M2.5 6.5h7a3.5 3.5 0 0 1 0 7H7`,Hn=`M10.5 3.5l3 3l-3 3 M13.5 6.5h-7a3.5 3.5 0 0 0 0 7H9`,Un=[{tool:`select`,label:`select`,key:`V`,iconPath:`M4 2.5l8.5 5.8l-4 0.7l2.2 4.3l-1.5 0.8l-2.2-4.3L4 12.5z`},{tool:`box`,label:`box`,key:`R`,iconPath:`M2.5 4h11v8h-11z`},{tool:`decision`,label:`decision`,key:`D`,iconPath:`M8 2l6 6l-6 6l-6-6z`},{tool:`panel`,label:`panel`,key:`P`,iconPath:`M2.5 3h11v10h-11z M2.5 6h11`},{tool:`wire`,label:`wire`,key:`A`,iconPath:`M2.5 13.5L13 3 M8.5 3H13v4.5`}],V=null,H=null,U=null,W=null,Wn=null,Gn=!0,G=null,Kn=null,qn=null,K=null,q=u(`action-status wb-status`),J=u(`action-status wb-status`),Y=new Map,Jn=Promise.resolve();function Yn(e){let{dialog:t,close:n,actions:r,btnCancel:i}=c({title:e.title}),o=a(`input`,`dialog-input`);o.type=`text`,o.placeholder=e.placeholder,o.maxLength=e.maxLength,o.value=e.initialValue??``,o.autocomplete=`off`,o.setAttribute(`aria-label`,e.label);let s=a(`div`,`dialog-error`);s.setAttribute(`role`,`alert`);let l=e.choices?a(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let t of e.choices.options){let e=a(`option`,null,t.text);e.value=t.value,l.append(e)}}let u=a(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,r.append(u),t.append(a(`label`,`dialog-label`,e.label),o,...l?[l]:[],s,r);async function d(){let t=o.value.trim();if(!t){s.textContent=`${e.label} is empty.`;return}u.disabled=!0;let r=await e.onSubmit(t,l?.value??null);u.disabled=!1,r?s.textContent=r:n()}i.addEventListener(`click`,n),u.addEventListener(`click`,()=>void d()),o.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>o.focus())}function X(){return V?fe(V):null}function Z(){return C().find(e=>e.id===V)??null}function Xn(e){let t=Jn.then(e);return Jn=t.catch(()=>void 0),t}function Zn(e,t){return Xn(()=>Qn(e,t))}async function Qn(e,t){let n=X(),r=await se(e,t);return r.ok&&n?.id===e&&Y.set(e,We(Y.get(e)??Ne,He(n,t))),r}function $n(e){return Xn(()=>er(e))}async function er(e){let t=V,n=X();if(!t||!n)return;let r=Ge(Y.get(t)??Ne,e);if(!r)return;Y.set(t,r.history);let i=await se(t,r.entry);i.ok?(q.clear(),Y.set(t,Ke(Y.get(t)??Ne,e,He(n,r.entry)))):q.show(`error`,`could not ${e} that change, so it was dropped: ${i.error}`)}async function tr(e){if(!V||e.length===0)return!1;let t=await Zn(V,e);return t.ok?(q.clear(),!0):(q.show(`error`,t.error),!1)}async function nr(e){if(!V)return`No board is open.`;let t=await Zn(V,e);return t.ok?null:t.error}function rr(e){let t=f(e);return t?d(t):`closed session`}function ir(){let e=Z()?.connectedSessionIds??[],t=X()?.codeSessionId;return(t&&!e.includes(t)?[t,...e]:e).map(e=>({value:e,text:rr(e)}))}function ar(e){let t=X();return[...W?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function or(){if(!H)return;let e=X(),t=ar(`box`).length;for(let t of H.toolButtons.values())t.disabled=!e;H.buttons.note.disabled=t!==1,H.buttons.frame.disabled=t===0;for(let t of[H.buttons.unit,H.buttons.fit,H.buttons.undo,H.buttons.redo])t.disabled=!e;Wn?.paint(W?.selectedIds()??new Set)}function sr(){if(!H)return;let e=C();V&&!e.some(e=>e.id===V)&&(V=null),!V&&e[0]&&Q(e[0].id),H.boardMenu.paintBoards(e),fr()}function cr(){return!!H?.boardIsland.querySelector(`.${Pn}`)}function lr(){let t=Z();if(!H||!t||cr())return;let{boardTitle:n}=H,r=a(`input`,Pn);r.type=`text`,r.value=t.title,r.maxLength=e.title,r.setAttribute(`aria-label`,`Board title`),n.replaceWith(r),r.focus(),r.select();let i=!1;function o(e){if(i||!t)return;i=!0;let a=r.value.trim();r.replaceWith(n),fr(),e&&a&&a!==t.title&&tr([{op:`board`,title:a}])}r.addEventListener(`blur`,()=>o(!0)),r.addEventListener(`keydown`,e=>{e.stopPropagation(),(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),o(e.key===`Enter`))})}function ur(e){let t=m(e.title,`visible wb-board-menu-board`);t.setAttribute(`role`,`menuitemradio`),t.setAttribute(`aria-checked`,String(e.id===V));let n=e.connectedSessionIds.length;return n>0&&t.append(a(`span`,`wb-board-menu-count`,String(n))),t.addEventListener(`click`,()=>Q(e.id)),t}function dr(e){let t=a(`div`,`session-overflow wb-board-menu`),n=a(`div`,`popup-menu session-overflow-menu`);n.setAttribute(`role`,`menu`),n.setAttribute(`aria-label`,`Board menu`);let r=()=>n.classList.contains(`open`),i=e=>{l.classList.toggle(`visible`,!Fr()),n.classList.toggle(`open`,e),o.setAttribute(`aria-expanded`,String(e))},o=$(`board menu`,Fn,()=>i(!r()));o.setAttribute(`aria-haspopup`,`menu`),o.setAttribute(`aria-expanded`,`false`);let s=(e,t,n=``)=>{let r=m(e,`visible ${n}`.trim());return r.addEventListener(`click`,t),r},c=a(`div`,`menu-divider`);c.setAttribute(`role`,`separator`);let l=s(`board settings`,e),u=[c,s(`new board`,Dr),l,s(`delete board`,Er,`wb-board-menu-danger`)];return n.addEventListener(`click`,e=>{e.target instanceof HTMLElement&&e.target.closest(`[role^="menuitem"]`)&&i(!1)}),t.append(o,n),h({trigger:o,menu:n,menuItems:()=>[...n.querySelectorAll(`.visible[role^="menuitem"]`)],isOpen:r,open:()=>i(!0),close:()=>i(!1)}),document.addEventListener(`click`,e=>{r()&&e.target instanceof Node&&!t.contains(e.target)&&i(!1)}),{menuRoot:t,trigger:o,paintBoards:e=>n.replaceChildren(...e.map(ur),...u)}}function fr(){if(!H)return;let e=Z(),t=C().length>0;H.canvas.hidden=!e,H.empty.hidden=!!e,H.emptyText.textContent=t?Nn:Mn,e&&(H.boardTitle.textContent=e.title,H.boardMeta.textContent=`v${e.version}`,H.presence.replaceChildren(...e.connectedSessionIds.map(e=>a(`span`,`wb-presence-pill`,rr(e)))),e.connectedSessionIds.length===0&&H.presence.append(a(`span`,`wb-presence-none`,`no sessions connected`)),or(),mr())}function pr(e,t){let n=rr(t);if(!e?.connectedSessionIds.includes(t))return`${n} is not connected to this board`;let r=e.queuedBySessionId[t]??0;return r===0?`${n} has read every change`:`${r} board ${r===1?`edit`:`edits`} queued for ${n}`}function mr(){if(!H||!G)return;let e=Z();H.dockQueued.textContent=pr(e,G),H.sendToAgent.disabled=!e?.connectedSessionIds.includes(G)}async function hr(){if(!H||!V||!G)return;H.sendToAgent.disabled=!0,J.show(`busy`,`sending`);let e=await oe(V,G);mr(),e.ok?J.show(`ok`,`sent; the agent reads the board when it is ready`):J.show(`error`,e.error)}function gr(e,t){let n=new Set(t);return new Set(Object.values(e.elements).filter(e=>be(e).some(e=>n.has(xe(e)??``))).map(e=>e.id))}function _r(e){let t=X()?.codeSessionId,n=xe(e);t&&n&&_(t,n)}function vr(e,t){let n=a(`button`,`wb-uncovered-file`,t);return n.type=`button`,n.addEventListener(`click`,()=>_(e,t)),n}function yr(){if(!H||!U)return;let e=X(),t=e&&Kn?.boardId===e.id?Kn.review:null;U.setReviewMarks({worthALookIds:e&&t?gr(e,t.worthALookPaths):new Set,flaggedUnitIds:new Set(t?.flaggedUnitIds??[])});let n=(e&&qn?.boardId===e.id?`the board review could not be loaded: ${qn.error}`:null)??t?.notChecked??null,r=t?.codeSessionId??null,i=r?t?.uncoveredPaths??[]:[];H.uncovered.hidden=!n&&i.length===0;let o=n?[a(`p`,`wb-uncovered-notice`,`Not checked: ${n}`)]:[],s=r?i.map(e=>vr(r,e)):[];H.uncovered.replaceChildren(a(`h3`,`wb-uncovered-heading`,`Not on the board`),...o,...s)}function br(e){let t=`${e.id}@${e.version}`;K!==t&&(K=t,ne(e.id).then(n=>{K===t&&(n.ok?(qn=null,Kn={boardId:e.id,review:n.review},yr()):(K=null,qn={boardId:e.id,error:n.error},yr()))}))}function xr(){if(!U)return;let e=X();e?(br(e),W?.pruneSelection(e),U.render(W?.previewOf(e)??e),yr(),W?.openPendingTitleEdit(),Gn&&=(W?.fit(),!1),or()):U.clear()}function Q(e){V!==e&&(V=e,Gn=!0,W?.clearSelection(),W?.closeTitleInput(),Wn?.closeBoardSettings(),U?.clear(),q.clear(),sr(),S(e).then(xr))}function Sr(){let t=X();if(!t)return;let n=C().filter(e=>e.id!==t.id),r=[{value:``,text:`No linked board`},...n.map(e=>({value:e.id,text:e.title}))];Yn({title:`Add a unit`,label:`Unit title`,placeholder:`index the diffs`,maxLength:e.title,confirmLabel:`Add unit`,choices:n.length>0?{label:`Linked board`,options:r}:void 0,onSubmit:(e,t)=>nr([{op:`add`,element:{kind:`unit`,id:w(`unit`),title:e,lines:[],refs:[],status:`planned`,after:[],linkedBoardId:t||null}}])})}function Cr(t){Yn({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>nr([{op:`add`,element:{kind:`note`,id:w(`note`),on:t,text:e,ref:null,author:``,resolvedBy:null}}])})}function wr(e,t){let n=X();n&&e!==t&&(Object.values(n.elements).some(n=>n.kind===`wire`&&n.from===e&&n.to===t)||tr([{op:`add`,element:{kind:`wire`,id:w(`wire`),from:e,to:t,fromOutput:null,dashed:!1,tone:`plain`,label:null,fromSide:null,toSide:null,back:!1}}]))}function Tr(){let t=ar(`box`).map(e=>e.id);t.length!==0&&Yn({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await nr([{op:`add`,element:{kind:`frame`,id:w(`frame`),title:e,contains:t,loop:!1}}]);return n||W?.clearSelection(),n}})}function Er(){let e=Z();if(!e)return;let t=e.connectedSessionIds.map(rr),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;o({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{te(e.id).then(e=>{e.ok||q.show(`error`,e.error)})}})}function Dr(){Yn({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await x(e);return t.ok?(Q(t.boardId),null):t.error}})}function Or(e,t){let n=a(`button`,`wb-button`,e);return n.type=`button`,n.addEventListener(`click`,t),n}function $(e,t,n,r){let i=a(`button`,`wb-icon-button`);if(i.type=`button`,i.setAttribute(`aria-label`,e),i.title=r?`${e} (${r})`:e,i.append(l(t,`1.5`)),r){let e=a(`span`,`wb-tool-key`,r);e.setAttribute(`aria-hidden`,`true`),i.append(e),i.setAttribute(`aria-keyshortcuts`,r)}return i.addEventListener(`click`,n),i}function kr(e,t,n,r){let i=$(t,r,()=>{W?.setTool(e),W?.focusCanvas()},n);return i.classList.add(`wb-tool`),i.setAttribute(`aria-pressed`,String(e===`select`)),i}function Ar(e,t,...n){let r=a(`div`,`wb-island ${e}`);return r.setAttribute(`role`,`toolbar`),r.setAttribute(`aria-label`,t),r.append(...n),r}function jr(e){for(let[t,n]of H?.toolButtons??[])n.setAttribute(`aria-pressed`,String(t===e))}function Mr(e){return!(e.metaKey||e.ctrlKey)||e.altKey||e.code!==`KeyZ`?null:e.shiftKey?`redo`:`undo`}function Nr(e,t){let n=Mr(t);n&&e.checkVisibility()&&!s()&&!i(t)&&(document.activeElement?.classList.contains(`xterm-helper-textarea`)||(t.preventDefault(),$n(n)))}function Pr(e){let t=dr(()=>{W?.clearSelection(),Wn?.openBoardSettings()});t.trigger.dataset.phoneVisible=``;let n=a(`button`,`wb-board-title`);n.type=`button`,n.title=`Click to rename`,n.addEventListener(`click`,lr);let r=a(`span`,`wb-board-meta`),i=a(`div`,`wb-presence`),o=Ar(`wb-island-board`,`Board`,t.menuRoot,n,r,i,q.element),s=new Map(Un.map(({tool:e,label:t,key:n,iconPath:r})=>[e,kr(e,t,n,r)])),c=a(`div`,`wb-tools`);c.setAttribute(`role`,`group`),c.setAttribute(`aria-label`,`Drawing tools`),c.append(...s.values());let l={note:$(`note`,In,()=>{let[e]=ar(`box`);e&&Cr(e.id)}),frame:$(`frame`,Rn,Tr),unit:$(`unit`,zn,Sr),fit:$(`fit`,Bn,()=>W?.fit()),undo:$(`undo`,Vn,()=>void $n(`undo`)),redo:$(`redo`,Hn,()=>void $n(`redo`))};l.fit.dataset.phoneVisible=``;let u=Ar(`wb-island-tools`,`Board tools`,c,l.note,l.frame,l.unit),d=Ar(`wb-island-view`,`View`,l.fit,l.undo,l.redo),f=a(`div`,`wb-canvas`),p=document.createElementNS(jn,`svg`);p.setAttribute(`class`,`wb-svg`),p.setAttribute(`role`,`img`),p.setAttribute(`aria-label`,`Whiteboard`),p.setAttribute(`preserveAspectRatio`,`xMidYMin meet`);let m=a(`aside`,`wb-inspect`),h=a(`aside`,`wb-uncovered`);h.setAttribute(`aria-label`,`Not on the board`),h.hidden=!0;let ee=a(`span`,`wb-dock-queued`),te=$(`send to agent`,Ln,()=>void hr()),_=Ar(`wb-island-agent`,`Docked session`,te,ee,J.element);_.hidden=!0;let v=a(`div`,`wb-bottom-left`);v.append(h,_,d);let ne=a(`div`,`wb-top-right`);ne.append(le({dockedSessionId:()=>G,isBoardOpen:()=>V!==null,dockBesideOpenBoard:Rr}),m),f.append(p,ne,o,v,u);let y=a(`p`,`wb-empty-text`,Mn),b=a(`div`,`wb-empty`);b.append(y,Or(`new board`,Dr));let x=a(`div`,`wb-dock`);x.hidden=!0,e.replaceChildren(f,b,x),H={boardIsland:o,boardMenu:t,boardTitle:n,boardMeta:r,presence:i,canvas:f,empty:b,emptyText:y,dock:x,agentIsland:_,dockQueued:ee,sendToAgent:te,buttons:l,toolButtons:s,uncovered:h};let S=An(p);U=S,Wn=Pt({container:m,currentBoard:X,layout:()=>S.layout(),sendOps:tr,codeSessionChoices:ir,openRef:_r}),W=Me({svg:p,canvas:f,renderer:S,currentBoard:X,sendOps:tr,onSelectionChange:or,onPhoneTapBox:Cr,onOpenLinkedBoard:Q,onConnectBoxes:wr,onToolChange:jr}),document.addEventListener(`keydown`,t=>Nr(e,t)),g(sr),ce(e=>{e===V&&xr()}),sr()}function Fr(){return document.documentElement.dataset.layout===`phone`}function Ir(){G&&ue()===G&&ae(),G=null,H&&(H.dock.hidden=!0,H.agentIsland.hidden=!0,ie())}function Lr(e){if(!H||Fr())return;let t=f(e);t&&(G=e,H.dock.hidden=!1,H.agentIsland.hidden=!1,J.clear(),mr(),v(t,e,H.dock,{className:`wb-docked-card`}),de(t,e,!0),ie())}function Rr(e){return V?(Lr(e),G===e):!1}function zr(){let e=re();e&&(Q(e.boardId),e.dockSessionId&&Lr(e.dockSessionId)),sr(),K=null,V&&S(V).then(xr)}var Br={mount:Pr,refresh:zr,deactivate:Ir};export{Br as view};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{vt as e}from"./updates-view-core-
|
|
1
|
+
import{vt as e}from"./updates-view-core-C1nXfl7Z.js";import{X as t}from"./dom-helpers-qjWTsLGI.js";var n=new Map(Object.entries({WAITING:`now`,COMPLETE:`later`,FAILED:`resting`,IDLE:`resting`,RUNNING:`resting`,STARTING:`resting`,INITIALIZING:`resting`,DORMANT:`resting`,DONE:`resting`}));function r(e){return(typeof e.state==`string`?n.get(e.state):void 0)??`resting`}function i(e,n){return[...e].map(([e,r])=>{let i=r.currentState||t.DORMANT;return{id:e,ui:r,name:n(r),isDormant:i===t.DORMANT,state:i,unseenOutcome:r.unseenOutcome??null,ownerId:r.ownerId??null}})}function a(e){let t=new Set(e.map(({id:e})=>e)),n=e=>e.ownerId&&t.has(e.ownerId)?e.ownerId:null,r=new Map;for(let t of e){let e=n(t);e&&r.set(e,[...r.get(e)??[],t])}return e.flatMap(e=>n(e)?[]:[e,...r.get(e.id)??[]])}function o(e){return a([...e].sort((e,t)=>Number(e.isDormant===!0)-Number(t.isDormant===!0)))}function s({ownerName:e,ownedCount:t}){return e===null?t===1?`Owns 1 session`:t>1?`Owns ${t} sessions`:null:`Owned by ${e}`}function c(e,t,n){if(!e.length)return null;let r=n<0?-1:1,i=t==null?-1:e.indexOf(t);return e[((i===-1?r===1?-1:0:i)+r+e.length)%e.length]}function l({state:n,unseenOutcome:r}){if(n===t.WAITING)return`waiting`;let i=e.safeParse(r);return i.success?i.data:null}function u(e={}){return l(e)!==null}var d=new Map([[`failed`,0],[`waiting`,1],[`finished`,2]]);function f(e){let t=l(e);return t===null?void 0:d.get(t)}function p(e){return e.filter(e=>f(e)!==void 0).sort((e,t)=>(f(e)??0)-(f(t)??0)).map(({id:e})=>e)}function m(e,t){let n=new Map(e.map(e=>[e.id,e]));return p(e).flatMap(e=>{let r=n.get(e),i=r?l(r):null;return!r||i===null||e===t?[]:[{id:e,kind:i,name:r.name??``}]})}var h={headTile:32,tile:26,tileGap:4,overflowSlot:40};function g(e,t){if(t===0)return 0;let{headTile:n,tile:r,tileGap:i,overflowSlot:a}=h,o=r+i;if(n+(t-1)*o<=e)return t;let s=e-a-i-n,c=Math.floor(s/o);return Math.max(1,Math.min(t-1,1+c))}var _={waiting:`waitingCount`,failed:`failedCount`,finished:`finishedCount`};function v(e,t,n){let r=l(t||{});r!==null&&(e[_[r]]+=n)}function y(e){let t={waitingCount:0,finishedCount:0,failedCount:0};for(let n of e||[])v(t,n,1);return t}function b(){return{counts:{waitingCount:0,finishedCount:0,failedCount:0},ownedCountByOwnerId:new Map}}function x(e,t,n){if(v(e.counts,t,n),t.ownerId===null)return;let r=(e.ownedCountByOwnerId.get(t.ownerId)??0)+n;r>0?e.ownedCountByOwnerId.set(t.ownerId,r):e.ownedCountByOwnerId.delete(t.ownerId)}function S(e,t){x(e,t,1)}function C(e,t){x(e,t,-1)}function w({waitingCount:e,finishedCount:t,failedCount:n}){return e+n+t}function T({waitingCount:e,failedCount:t}){return e+t}function E({waitingCount:e,finishedCount:t,failedCount:n}){let r=[];return n>0&&r.push(`${n} FAILED`),e===1&&r.push(`1 NEEDS YOU`),e>1&&r.push(`${e} NEED YOU`),t>0&&r.push(`${t} FINISHED`),r.length===0?`ALL CLEAR`:r.join(`, `)}var D=new Map([[`hand`,2]]),O=1;function k(e){return e?typeof e==`string`&&D.get(e)||O:0}function A(e){let t=!1,n=0;for(let r of e||[]){let e=k(r);e<=n||(t=typeof r!=`string`||r,n=e)}return t}var j=new Map,M=b();function N(e){return e.card?.dataset.session||e.nameEl?.textContent||``}function P(e){return typeof e==`string`?e:String(e)}function F(e){return typeof e==`string`?j.get(e):void 0}var I=document.getElementById(`sessions-container`);export{T as S,c as _,N as a,S as b,E as c,s as d,g as f,o as g,m as h,P as i,i as l,u as m,I as n,j as o,w as p,F as r,h as s,M as t,y as u,A as v,C as x,r as y};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,u as t}from"./control-ws-iqtzInzE.js";import{b as n,d as r,f as i,s as a}from"./dom-helpers-qjWTsLGI.js";import{i as o}from"./modal-Dta3lhg0.js";import{c as s,i as c,s as ee,t as l}from"./action-status-RL7Vkog6.js";import{o as u}from"./card-registry-BnVWc0v-.js";import{Gn as d,H as f,Hn as p,Jn as m,On as h,Ot as g,P as _,Qn as v,Rn as y,V as b,Wn as x,Yn as te,Zn as ne,_i as re,b as ie,c as ae,d as oe,f as se,l as S,p as ce,s as le,u as ue,vi as C,w as de}from"./index-DxS6qp5l.js";import{t as fe}from"./team-review-panel-BHgA8FC-.js";import{t as pe}from"./pr-queue-columns-BakhgmkO.js";import{n as w}from"./setup-step-B3dmb7Uw.js";var me={HIGH:`High confidence`,MEDIUM:`Medium confidence`,LOW:`Low confidence`},he={HIGH:`ok`,MEDIUM:`warn`,LOW:`muted`},T={queued:`Waiting to be researched`,running:`Researching`,error:`Research failed`,aside:`Set aside`},ge={forum:`Forum`,discord:`Discord`};function E(e){return e.status===`ready`&&e.verdict?{text:me[e.verdict],tone:he[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=ge[e.item.source];return e.item.channel?`${t} #${e.item.channel}`:t}function O(e){return e.entry.item.title||`Untitled question`}function _e(e){return e.status!==`running`&&e.status!==`queued`}function ve(e){return e.status!==`aside`}function ye(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 k(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 be(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 A=[`key`,`project`,`skill`,`discord`];function xe(e){let t=e===`finished`?A.length:A.indexOf(e),n=e=>e<t?`done`:e===t?`current`:`upcoming`;return{key:n(0),project:n(1),skill:n(2),discord:n(3)}}function Se(e){let t=e.split(/[\s,]+/).map(e=>e.replace(/^#/,``)).filter(Boolean);return[...new Set(t)]}var j=2;function M(e){t({type:`dashboard-telemetry`,event:`operator_action`,properties:{surface:`onboarding`,action:e}})}function N(){let e=_().community,t=typeof e==`object`&&e?e:{},n=Array.isArray(t.discordChannels)?t.discordChannels.filter(e=>typeof e==`string`):[];return{projectId:typeof t.projectId==`number`?t.projectId:j,skill:typeof t.skill==`string`?t.skill:``,discordChannels:n}}function Ce(e,t,n,r){let i=a(`input`,`dialog-input repo-roots-adder-input`);return i.id=e,i.type=r,i.value=t,i.placeholder=n,i.autocomplete=`off`,i.spellcheck=!1,i}function P(e,t){let n=a(`button`,`btn-dialog btn-dialog-${t}`,e);return n.type=`button`,n}function we({onFinish:t}){let n=a(`section`,`first-run-checklist review-setup`);n.setAttribute(`aria-labelledby`,`community-setup-title`);let r=a(`h2`,`first-run-title`,`Answer community questions`);r.id=`community-setup-title`;let i=a(`ol`,`first-run-steps`),o=a(`p`,`first-run-step-hint review-setup-foot`,`Each question gets a researched draft reply. Nothing posts until you post it yourself. `);o.append(ie(`lanes-community`,`community-enabled`,`All community settings`));let s=a(`div`,`first-run-step-actions`),u=P(`Finish setup`,`confirm`);s.append(u),s.hidden=!0,n.append(a(`span`,`first-run-eyebrow`,`SET UP COMMUNITY`),r,i,s,o);let d=null;u.addEventListener(`click`,()=>{M(`finish-community-setup`),d=null,t()});function f(e){d=e,y(),(i.querySelector(`[aria-current="step"] input`)??(s.hidden?null:u))?.focus()}async function p(t,n,r,i){n.disabled=!0,r.show(`busy`,`Saving`);try{let n=await e(`update-settings`,{settings:t},{timeoutMs:l});if(n.type===`settings-error`){r.show(`error`,n.message);return}if(n.type!==`settings-updated`){r.show(`error`,`The server did not confirm the save.`);return}de(n.settings),f(i)}catch(e){r.show(`error`,ee(e,l))}finally{n.disabled=!1}}function m(e){let t=Ce(e.inputId,e.initialValue,e.placeholder,e.inputType),n=a(`label`,`repo-roots-adder-label`,e.label);n.htmlFor=t.id;let r=a(`div`,`first-run-step-actions`),i=c(),o=P(e.saveLabel,`confirm`),s=()=>{let n=e.settingsPatch(t.value);typeof n==`string`?i.show(`error`,n):(M(e.action),p(n,o,i,e.nextProgress))};if(o.addEventListener(`click`,s),t.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),s())}),r.append(o),e.isSkippable){let t=P(`Skip`,`cancel`);t.addEventListener(`click`,()=>f(e.nextProgress)),r.append(t)}return r.append(i.element),[a(`p`,`first-run-step-text`,e.advice),n,t,r]}let h=()=>m({advice:`Glimmervoid reads new forum and Discord questions through your PostHog personal API key. Create one in PostHog under Settings, Personal API keys. Community needs only the query:read scope on the project that holds the questions. PostHog error monitoring shares this key, so add error tracking read and write if you turn that on.`,label:`PERSONAL API KEY`,inputId:`community-setup-key`,inputType:`password`,initialValue:``,placeholder:`phx_`,saveLabel:`Save key`,action:`save-community-key`,nextProgress:`project`,isSkippable:!1,settingsPatch:e=>e.trim()?{posthog:{apiKey:e.trim()}}:`Paste a PostHog personal API key.`}),g=()=>m({advice:`The PostHog project that holds the synced community forum table and the Discord bot events. PostHog's own community lives in project 2.`,label:`PROJECT ID`,inputId:`community-setup-project`,inputType:`number`,initialValue:String(N().projectId),placeholder:String(j),saveLabel:`Use project`,action:`save-community-project`,nextProgress:`skill`,isSkippable:!1,settingsPatch:e=>{let t=Number(e.trim());return Number.isInteger(t)&&t>0?{community:{projectId:t}}:`Type the project id as a whole number, such as 2.`}}),_=()=>m({advice:`The Claude Code skill the research agent follows for each question, typed by name. A skill that knows your docs and support playbook gives the best drafts. Skip to research with whatever skills the agent has.`,label:`SKILL`,inputId:`community-setup-skill`,inputType:`text`,initialValue:N().skill,placeholder:`skill name`,saveLabel:`Save skill`,action:`save-community-skill`,nextProgress:`discord`,isSkippable:!0,settingsPatch:e=>({community:{skill:e.trim().replace(/^\//,``)}})}),v=()=>m({advice:`Discord questions come from a Discord bot that sends message_sent and thread_created events into the project above. With that bot in place, list the channels to watch by name, without the #. A cheap model picks out the real questions; only those are researched.`,label:`CHANNELS`,inputId:`community-setup-discord`,inputType:`text`,initialValue:N().discordChannels.join(`, `),placeholder:`community-questions, help`,saveLabel:`Save channels`,action:`save-community-discord`,nextProgress:`finished`,isSkippable:!0,settingsPatch:e=>{let t=Se(e);return t.length>0?{community:{discordChannels:t}}:`Type at least one channel, or skip.`}});function y(){if(!d)return;let e=xe(d);i.replaceChildren(w({title:`1. PostHog personal API key`,state:e.key,summary:`Key saved`,badge:`NEEDED`,body:h}),w({title:`2. PostHog project`,state:e.project,summary:`Project ${N().projectId}`,badge:``,body:g}),w({title:`3. Research skill (optional)`,state:e.skill,summary:N().skill||`No skill`,badge:``,body:_}),w({title:`4. Discord (optional)`,state:e.discord,summary:N().discordChannels.map(e=>`#${e}`).join(` `)||`Forum only`,badge:``,body:v})),s.hidden=d!==`finished`}function b(){d=`key`,y()}return{element:n,open:b,isOpen:()=>d!==null}}var F=null,I=null,L=null,R=null,z=[],B=null,V=!1,H=null,U=null,W=``,G=new Map,K=null;function Te(){return be([...u].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 q(e,t){let n=a(`button`,`pr-action pr-action-ghost`,e);return n.type=`button`,n.disabled=!C(t),n.addEventListener(`click`,()=>re(t)),n}function J(e,t,n){let r=a(`button`,`pr-action`,e);return r.type=`button`,r.disabled=!t,r.addEventListener(`click`,n),r}function Y(e,t,n){let r=a(`ul`,e);r.setAttribute(`aria-label`,t);for(let e of n)r.append(a(`li`,null,e));return r}function Ee(e){let t=a(`div`,`pr-detail-heading`),n=a(`div`,`pr-detail-title`);n.append(a(`h2`,null,e.item.title||`Untitled question`));let r=a(`div`,`pr-detail-meta`),i=Date.parse(e.item.createdAt);return r.append(a(`span`,null,e.item.author),a(`span`,null,D(e))),Number.isNaN(i)||r.append(a(`span`,null,`Asked ${g(i)}`)),t.append(n,r),t}function De(e){let t=a(`section`,`community-question`);return t.setAttribute(`aria-label`,`Question as asked`),t.append(a(`h3`,`pr-section-heading`,`Question as asked`),a(`p`,`community-question-body`,e.item.body)),t}function Oe(e){let t=a(`section`,`pr-verdict-box`);t.setAttribute(`aria-label`,`Research`);let n=E(e),r=a(`div`,`pr-verdict-line`),i=a(`strong`,`community-badge`,n.text);if(i.dataset.tone=n.tone,r.append(i),t.append(r),e.error&&t.append(a(`p`,`pr-attention-detail`,e.error)),e.summary&&t.append(a(`p`,`pr-verdict-summary`,e.summary)),e.goal&&t.append(a(`p`,`community-goal`,`Goal: ${e.goal}`)),e.gaps.length>0&&t.append(Y(`pr-verdict-gaps`,`Not covered`,e.gaps)),e.checked.length===0)return t;let o=a(`details`,`pr-verdict-checked`);return o.append(a(`summary`,null,`What it checked (${e.checked.length})`),Y(`community-checked`,`What it checked`,e.checked)),t.append(o),t}function ke(e){if(!e.draft)return null;let t=a(`section`,`community-draft`);t.setAttribute(`aria-label`,`Draft reply`),t.append(a(`h3`,`pr-section-heading`,`Draft reply`),a(`p`,`community-draft-body`,e.draft.body));let n=e.draft.publicLinks.filter(C);if(n.length===0)return t;let r=a(`ul`,`community-links`);for(let e of n){let t=a(`li`);t.append(q(e,e)),r.append(t)}return t.append(r),t}function Ae(e,t){let r=e.draft?n(e.draft.body):null;r?r.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 je(e,t){if(!W){t.show(`error`,`Pick a session to start from first.`);return}let n=await s(`open-community-session`,{key:e.item.key,projectId:W},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&&h()?.openTerminal(n.sessionId)):t.show(`error`,n.error??`The session did not start.`))}async function X(e,t,n){let r=t===`rerun`?`Queuing the research again.`:`Setting the question aside.`,i=await s(`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 Me(){let e=a(`select`,`community-session-picker`);e.setAttribute(`aria-label`,`Session to start from`);let t=Te();t.some(e=>e.id===W)||(W=t[0]?.id??``);for(let n of t){let t=a(`option`,null,n.name);t.value=n.id,t.selected=n.id===W,e.append(t)}return e.disabled=t.length===0,e.addEventListener(`change`,()=>{W=e.value}),e}function Ne(e){let t=a(`div`,`community-actions`),n=c(`pr-action-status`),r=a(`div`,`community-action-buttons`);return r.append(J(`Copy draft`,e.draft!==null,()=>Ae(e,n)),q(`Open thread`,e.item.url),Me(),J(`Start session`,!0,()=>void je(e,n)),J(`Re-run`,_e(e),()=>void X(e,`rerun`,n)),J(`Set aside`,ve(e),()=>void X(e,`set-aside`,n))),t.append(r,n.element),t}function Pe(e){let t=a(`article`,`pr-detail community-detail`),n=ke(e);return t.append(Ee(e),Ne(e),...n?[n]:[],Oe(e),De(e)),t}function Z(){if(!L)return;let e=m(z,B),t=e?JSON.stringify(e.entry):`empty:${v(z).length}`;if(t===U)return;if(U=t,e){L.replaceChildren(Pe(e.entry));return}let n=z.some(e=>e.items.length>0);L.replaceChildren(n?fe({title:`All caught up`,detail:ye(z)}):a(`p`,`pr-empty`,k(S())))}function Fe(e,t){se(x(e))&&t.querySelector(`.pr-queue-unseen`)?.remove()}function Q(){if(!R)return;let e=d(z,O);f(R,y(e),e.filter(e=>e.id!==B))}function Ie(e){B=e;for(let[t,n]of G)n.setAttribute(`aria-current`,String(t===e));let t=m(z,e),n=G.get(e);t&&n&&Fe(t,n),Z(),Q(),F&&(F.dataset.detailOpen=`true`)}function Le(){F&&(F.dataset.detailOpen=`false`),B&&G.get(B)?.focus({preventScroll:!0})}function Re(e){let t=m(z,e);if(!t)return;z.find(e=>e.items.includes(t))?.id===`aside`&&(V=!0),B=e,$(),Ie(e);let n=G.get(e);n?.focus({preventScroll:!0}),n?.scrollIntoView({block:`nearest`})}function ze(e){if(e.repeat||e.defaultPrevented||!F||r(F)||o()||i(e)||document.activeElement?.classList.contains(`xterm-helper-textarea`))return;let t=te(e);if(t!==`next-row`&&t!==`previous-row`)return;let n=ne([...G.keys()],B,t===`next-row`?1:-1);n&&(e.preventDefault(),n!==B&&Re(n))}function Be(e,t){let n=a(`button`,`pr-queue-row pr-queue-row-quiet`);n.type=`button`,n.dataset.queueKey=e.key,n.setAttribute(`aria-current`,String(e.key===B));let r=E(e.entry),i=a(`span`,`review-queue-action community-badge`,r.text);i.dataset.tone=r.tone;let o=a(`span`,`pr-queue-top`);if(o.append(i,a(`span`,`pr-queue-title`,O(e))),n.append(o,a(`span`,`pr-queue-elapsed`,D(e.entry))),n.title=O(e),t&&oe(x(e))){let e=a(`span`,`tab-activity active pr-queue-unseen`);e.setAttribute(`aria-hidden`,`true`),n.append(e)}return n.addEventListener(`click`,()=>Ie(e.key)),G.set(e.key,n),n}function Ve(e){let t=a(`h3`,`pr-section-heading review-group-heading`),n=a(`span`,`review-group-count`,String(e.items.length));if(e.id!==`aside`)return t.append(a(`span`,null,e.title),n),t;let r=a(`button`,`review-group-toggle`),i=a(`span`,`review-group-chevron`,`▸`);return i.setAttribute(`aria-hidden`,`true`),r.append(i,e.title),r.type=`button`,r.setAttribute(`aria-expanded`,String(V)),r.addEventListener(`click`,()=>{V=!V,H=null,$()}),t.append(r,n),t}function He(e){let t=a(`section`,`pr-queue-section`);if(t.dataset.group=e.id,t.append(Ve(e)),e.id===`aside`&&!V)return t;for(let n of e.items)t.append(Be(n,e.id===`turn`));return t}function Ue(){if(!F||!K)return!1;S()?.configured===!1&&!K.isOpen()&&K.open();let e=K.isOpen();return F.dataset.setup=String(e),K.element.hidden=!e,e}function $(){if(!I||Ue())return;z=ae(),B=p(z.filter(e=>e.id!==`aside`||V),B),Q();let e=JSON.stringify([z,B,V,ue(),S()?.error??null]);if(e!==H){H=e,G.clear();let t=S()?.error,n=t?[a(`p`,`my-pr-note`,t)]:[],r=z.filter(e=>e.items.length>0).map(He);I.replaceChildren(...n,...r.length>0?r:[a(`p`,`pr-empty`,k(S()))])}Z()}function We(e){if(F)return;F=a(`div`,`pr-content review-queue community-queue`),e.append(F);let t=pe({queueLabel:`Community questions`,scopeTabs:null,resizerLabel:`Resize community queue`});I=t.queue,L=a(`div`,`review-queue-detail`);let n=a(`div`,`review-queue-phone-bar`),i=a(`button`,`pr-action pr-action-ghost review-queue-back`,`Back to queue`);i.type=`button`,i.addEventListener(`click`,Le),n.append(i),t.detail.append(n,L),R=b({onJump:()=>{let e=d(z,O).find(e=>e.id!==B)?.id;e&&Re(e)},rowFor:e=>G.get(e)}),R.classList.add(`review-queue-banner`),t.queue.before(R),K=we({onFinish:$}),K.element.hidden=!0,F.append(K.element,t.columns),F.dataset.detailOpen=`false`,le(()=>!r(F)),ce(e=>{e.kind===`status`&&$()}),document.addEventListener(`keydown`,ze),$()}var Ge={mount:We,refresh:()=>{U=null,$()}};export{Ge as view};
|
|
Binary file
|