glimmervoid 0.48.1-next.290 → 0.48.1-next.293
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 +8 -8
- package/dist/chunks/{adapters-3q49ufvw.js → adapters-DwmzoN1-.js} +1 -1
- package/dist/chunks/{adapters-D3AVM9Mh.js → adapters-Dzl0abk4.js} +2 -2
- package/dist/chunks/{agent-api-cli-DcJcPGC-.js → agent-api-cli-CdJWqyUb.js} +1 -1
- package/dist/chunks/{agent-api-cli-BJUX-ouG.js → agent-api-cli-Dmh4RjkC.js} +1 -1
- package/dist/chunks/{agent-api-core-CnRkmt_J.js → agent-api-core-CSSHlH64.js} +1 -1
- package/dist/chunks/{build-channel-Sv6Rreda.js → build-channel-ozDqnVz1.js} +1 -1
- package/dist/chunks/{config--vMYJSbq.js → config-CR-LBLlr.js} +0 -1
- package/dist/chunks/{config-store-DwFo7FVH.js → config-store-BEVvEOI4.js} +2 -2
- package/dist/chunks/config-store-vuAbT__e.js +1 -0
- package/dist/chunks/{main-DzVIoI6p.js → main-BVJLYLBG.js} +13 -32
- package/dist/chunks/{pair-cli-BxzdcV5E.js → pair-cli-D412YBSx.js} +2 -2
- package/dist/chunks/{remote-config-Dp7nAjfm.js → remote-config-CRRVJk9S.js} +1 -1
- package/dist/chunks/{settings-cli-Db0yNBIq.js → settings-cli-qVdBZuhT.js} +4 -4
- package/dist/chunks/{settings-readout-core-DDRpSPRb.js → settings-readout-core-ClSn4YF0.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-3sk71bPn.js → ssh-sign-cli-CLcaifFp.js} +1 -1
- package/dist/client/assets/{action-status-C_hxjBXy.js → action-status-ga4k204C.js} +1 -1
- package/dist/client/assets/action-status-ga4k204C.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-Bos_dpy6.js → benchmark-panel-BClnuTlB.js} +1 -1
- package/dist/client/assets/benchmark-panel-BClnuTlB.js.br +0 -0
- package/dist/client/assets/{boards-view-Cti1s0cM.js → boards-view-BlNC4HpY.js} +1 -1
- package/dist/client/assets/boards-view-BlNC4HpY.js.br +0 -0
- package/dist/client/assets/{card-registry-BXztZiPc.js → card-registry-B_-SHEPp.js} +1 -1
- package/dist/client/assets/card-registry-B_-SHEPp.js.br +0 -0
- package/dist/client/assets/{community-panel-CnylL5Et.js → community-panel-CEt1qZq8.js} +1 -1
- package/dist/client/assets/community-panel-CEt1qZq8.js.br +0 -0
- package/dist/client/assets/{control-ws-6Ix6WqG2.js → control-ws-MI1qU95m.js} +1 -1
- package/dist/client/assets/control-ws-MI1qU95m.js.br +0 -0
- package/dist/client/assets/{dialogs-BhrFb8wK.js → dialogs-BxE4-fNx.js} +1 -1
- package/dist/client/assets/dialogs-BxE4-fNx.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-CDBUHl-t.js → doc-editor-ui-BNFTKRrm.js} +1 -1
- package/dist/client/assets/doc-editor-ui-BNFTKRrm.js.br +0 -0
- package/dist/client/assets/{feature-hint-BH709sfM.js → feature-hint-DUIQN6zX.js} +1 -1
- package/dist/client/assets/feature-hint-DUIQN6zX.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-DdjCrE87.js → first-run-checklist-CZYW4Wqy.js} +1 -1
- package/dist/client/assets/first-run-checklist-CZYW4Wqy.js.br +0 -0
- package/dist/client/assets/{hooks-panel-Nzd-q9s8.js → hooks-panel-DJFUvR5T.js} +1 -1
- package/dist/client/assets/hooks-panel-DJFUvR5T.js.br +0 -0
- package/dist/client/assets/{index-C--3LY9q.js → index-BEci_NIV.js} +5 -5
- package/dist/client/assets/index-BEci_NIV.js.br +0 -0
- package/dist/client/assets/{issues-panel-Crj6Li5S.js → issues-panel-Jh-fD32b.js} +1 -1
- package/dist/client/assets/issues-panel-Jh-fD32b.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-CoexBS3F.js → my-prs-panel-DasU3wWM.js} +1 -1
- package/dist/client/assets/my-prs-panel-DasU3wWM.js.br +0 -0
- package/dist/client/assets/{nyan-cat-DZ91s381.js → nyan-cat-OnRrdQ94.js} +1 -1
- package/dist/client/assets/nyan-cat-OnRrdQ94.js.br +0 -0
- package/dist/client/assets/{phone-shell-DXa39DvP.js → phone-shell-CRbNVhUf.js} +1 -1
- package/dist/client/assets/phone-shell-CRbNVhUf.js.br +0 -0
- package/dist/client/assets/{plan-face-I954ta6d.js → plan-face-RQcdq_MU.js} +1 -1
- package/dist/client/assets/plan-face-RQcdq_MU.js.br +0 -0
- package/dist/client/assets/{plan-render-DIvRlGRy.js → plan-render-D2arXwy_.js} +1 -1
- package/dist/client/assets/plan-render-D2arXwy_.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-DcihGDZU.js → pr-queue-columns-OXj6qNnh.js} +1 -1
- package/dist/client/assets/pr-queue-columns-OXj6qNnh.js.br +0 -0
- package/dist/client/assets/{radar-panel-L3QJ_K5g.js → radar-panel-NBEwEXU1.js} +1 -1
- package/dist/client/assets/radar-panel-NBEwEXU1.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-EVJtoQUb.js → repo-roots-adder-DoaFMsXQ.js} +1 -1
- package/dist/client/assets/repo-roots-adder-DoaFMsXQ.js.br +0 -0
- package/dist/client/assets/{resume-dialog-BFuiPmde.js → resume-dialog-s3Wcwibh.js} +1 -1
- package/dist/client/assets/resume-dialog-s3Wcwibh.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-CDpCVpAS.js → review-queue-panel-D_c4ZxM0.js} +1 -1
- package/dist/client/assets/review-queue-panel-D_c4ZxM0.js.br +0 -0
- package/dist/client/assets/{session-tick-RnZFZ4n3.js → session-tick-C4vHGI0a.js} +1 -1
- package/dist/client/assets/session-tick-C4vHGI0a.js.br +0 -0
- package/dist/client/assets/{settings-panel-B_PEcNk8.js → settings-panel-BVjp3sEg.js} +2 -2
- package/dist/client/assets/settings-panel-BVjp3sEg.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-DjQzko3m.js → shown-lightbox-DR7HcMjB.js} +1 -1
- package/dist/client/assets/shown-lightbox-DR7HcMjB.js.br +0 -0
- package/dist/client/assets/{team-review-panel-BfxncS5k.js → team-review-panel-Dtzi3XOZ.js} +1 -1
- package/dist/client/assets/team-review-panel-Dtzi3XOZ.js.br +0 -0
- package/dist/client/assets/{trace-panel-CpZSMhTE.js → trace-panel-BfYcmEq5.js} +1 -1
- package/dist/client/assets/trace-panel-BfYcmEq5.js.br +0 -0
- package/dist/client/assets/{updates-view-core-DodtnH3A.js → updates-view-core-BRJGMQQv.js} +1 -1
- package/dist/client/assets/updates-view-core-BRJGMQQv.js.br +0 -0
- package/dist/client/assets/{usage-panel-DaQZOg41.js → usage-panel-9G63KTwB.js} +1 -1
- package/dist/client/assets/usage-panel-9G63KTwB.js.br +0 -0
- package/dist/client/assets/{your-day-tip-2WobA-WB.js → your-day-tip-DY3WRLhy.js} +1 -1
- package/dist/client/assets/your-day-tip-DY3WRLhy.js.br +0 -0
- package/dist/client/index.html +6 -6
- 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-DUhCiZ5P.js +0 -1
- package/dist/client/assets/action-status-C_hxjBXy.js.br +0 -0
- package/dist/client/assets/benchmark-panel-Bos_dpy6.js.br +0 -0
- package/dist/client/assets/boards-view-Cti1s0cM.js.br +0 -0
- package/dist/client/assets/card-registry-BXztZiPc.js.br +0 -0
- package/dist/client/assets/community-panel-CnylL5Et.js.br +0 -0
- package/dist/client/assets/control-ws-6Ix6WqG2.js.br +0 -0
- package/dist/client/assets/dialogs-BhrFb8wK.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-CDBUHl-t.js.br +0 -0
- package/dist/client/assets/feature-hint-BH709sfM.js.br +0 -0
- package/dist/client/assets/first-run-checklist-DdjCrE87.js.br +0 -0
- package/dist/client/assets/hooks-panel-Nzd-q9s8.js.br +0 -0
- package/dist/client/assets/index-C--3LY9q.js.br +0 -0
- package/dist/client/assets/issues-panel-Crj6Li5S.js.br +0 -0
- package/dist/client/assets/my-prs-panel-CoexBS3F.js.br +0 -0
- package/dist/client/assets/nyan-cat-DZ91s381.js.br +0 -0
- package/dist/client/assets/phone-shell-DXa39DvP.js.br +0 -0
- package/dist/client/assets/plan-face-I954ta6d.js.br +0 -0
- package/dist/client/assets/plan-render-DIvRlGRy.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-DcihGDZU.js.br +0 -0
- package/dist/client/assets/radar-panel-L3QJ_K5g.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-EVJtoQUb.js.br +0 -0
- package/dist/client/assets/resume-dialog-BFuiPmde.js.br +0 -0
- package/dist/client/assets/review-queue-panel-CDpCVpAS.js.br +0 -0
- package/dist/client/assets/session-tick-RnZFZ4n3.js.br +0 -0
- package/dist/client/assets/settings-panel-B_PEcNk8.js.br +0 -0
- package/dist/client/assets/shown-lightbox-DjQzko3m.js.br +0 -0
- package/dist/client/assets/team-review-panel-BfxncS5k.js.br +0 -0
- package/dist/client/assets/trace-panel-CpZSMhTE.js.br +0 -0
- package/dist/client/assets/updates-view-core-DodtnH3A.js.br +0 -0
- package/dist/client/assets/usage-panel-DaQZOg41.js.br +0 -0
- package/dist/client/assets/your-day-tip-2WobA-WB.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -5,7 +5,7 @@ import { a as packageRoot } from "../chunks/runtime-paths-D_ZjJLE0.js";
|
|
|
5
5
|
import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
|
|
6
6
|
import { t as AGENT_API_VERBS } from "../chunks/session-DfOgGb2N.js";
|
|
7
7
|
import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
|
|
8
|
-
import { r as agentCommandHelpLines } from "../chunks/agent-api-core-
|
|
8
|
+
import { r as agentCommandHelpLines } from "../chunks/agent-api-core-CSSHlH64.js";
|
|
9
9
|
import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
|
|
10
10
|
import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-BeOjhVq9.js";
|
|
11
11
|
import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
|
|
@@ -57,7 +57,7 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
57
57
|
return 0;
|
|
58
58
|
}],
|
|
59
59
|
["pair", async (subcommandArgs) => {
|
|
60
|
-
const { runPairCli } = await import("../chunks/pair-cli-
|
|
60
|
+
const { runPairCli } = await import("../chunks/pair-cli-D412YBSx.js");
|
|
61
61
|
return runPairCli(subcommandArgs);
|
|
62
62
|
}],
|
|
63
63
|
["agent", async (subcommandArgs) => {
|
|
@@ -65,17 +65,17 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
65
65
|
return runAgentSetupCli(subcommandArgs);
|
|
66
66
|
}],
|
|
67
67
|
["settings", async (subcommandArgs) => {
|
|
68
|
-
const { runSettingsCli } = await import("../chunks/settings-cli-
|
|
68
|
+
const { runSettingsCli } = await import("../chunks/settings-cli-qVdBZuhT.js");
|
|
69
69
|
return runSettingsCli(subcommandArgs);
|
|
70
70
|
}],
|
|
71
71
|
["ssh-sign", async (subcommandArgs) => {
|
|
72
|
-
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-
|
|
72
|
+
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-CLcaifFp.js");
|
|
73
73
|
return runSshSignCli(subcommandArgs);
|
|
74
74
|
}]
|
|
75
75
|
];
|
|
76
76
|
var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
|
|
77
77
|
var SUBCOMMAND_RUNNERS = new Map([...OWN_SUBCOMMAND_RUNNERS, ...AGENT_API_VERBS.filter((verb) => !ownSubcommandNames.has(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
|
|
78
|
-
const { runAgentApiCli } = await import("../chunks/agent-api-cli-
|
|
78
|
+
const { runAgentApiCli } = await import("../chunks/agent-api-cli-CdJWqyUb.js");
|
|
79
79
|
return runAgentApiCli([subcommandName, ...subcommandArgs]);
|
|
80
80
|
}])]);
|
|
81
81
|
var AGENT_INSTALL_COMMAND_BY_ID = {
|
|
@@ -89,7 +89,7 @@ function missingAgentText(agentId) {
|
|
|
89
89
|
}
|
|
90
90
|
async function printSessionLimits() {
|
|
91
91
|
if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
|
|
92
|
-
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-
|
|
92
|
+
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-CdJWqyUb.js");
|
|
93
93
|
const limitsLines = await sessionLimitsHelpLines();
|
|
94
94
|
console.log(`\n${limitsLines.join("\n")}`);
|
|
95
95
|
}
|
|
@@ -146,7 +146,7 @@ async function readDeclaredCustomAgents() {
|
|
|
146
146
|
declared: [],
|
|
147
147
|
error: null
|
|
148
148
|
};
|
|
149
|
-
const { loadConfigFile } = await import("../chunks/config-store-
|
|
149
|
+
const { loadConfigFile } = await import("../chunks/config-store-vuAbT__e.js");
|
|
150
150
|
try {
|
|
151
151
|
const loaded = loadConfigFile(decided.path, { exitOnError: false });
|
|
152
152
|
if (!loaded.config) return {
|
|
@@ -222,7 +222,7 @@ async function runDoctor() {
|
|
|
222
222
|
}
|
|
223
223
|
switchSection("Agents");
|
|
224
224
|
try {
|
|
225
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
225
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-DwmzoN1-.js");
|
|
226
226
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
227
227
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
228
228
|
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-Dzl0abk4.js";
|
|
@@ -2,7 +2,7 @@ import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { o as relayPath, u as isPathInside } from "./runtime-paths-D_ZjJLE0.js";
|
|
3
3
|
import { Yt as FULL_SHA_RE, Zt as shortSha$1 } from "./session-DfOgGb2N.js";
|
|
4
4
|
import { c as spawn, i as execFileSync, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
|
|
5
|
-
import { Dt as UpdateChannel, c as SHELL_AGENT_ID, x as InstallFlavor } from "./config
|
|
5
|
+
import { Dt as UpdateChannel, c as SHELL_AGENT_ID, x as InstallFlavor } from "./config-CR-LBLlr.js";
|
|
6
6
|
import { o as supervisionLine } from "./session-routes-D-8mGNXo.js";
|
|
7
7
|
import { a as rawTextOr, o as textOr, r as numberOr } from "./coerce-oz_Z_6E7.js";
|
|
8
8
|
import { n as parseJsonRecord } from "./json-core-If8h-Qgy.js";
|
|
@@ -11,7 +11,7 @@ import { t as buildAgentEnv } from "./spawn-env-D418d7G5.js";
|
|
|
11
11
|
import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
|
|
12
12
|
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, t as grok } from "./grok-CRZfS-M5.js";
|
|
13
13
|
import { O as nextBackoffMs } from "./json-file-AKRVPqG1.js";
|
|
14
|
-
import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-
|
|
14
|
+
import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-ozDqnVz1.js";
|
|
15
15
|
import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-Dzr2-y9R.js";
|
|
16
16
|
import { c as CODEX_HOME_PROFILE, f as renderCodexHookTables, n as AGENT_HOME_CONFIG_NAME, p as renderCodexHooksBlock } from "./agent-home-core-DgW3orTE.js";
|
|
17
17
|
import { c as releaseAgentHome, i as holdPreparedAgentHome, n as generatedAgentHomePath, s as realAgentHome } from "./agent-home-BzANIIVe.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-Dmh4RjkC.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-DfOgGb2N.js";
|
|
2
2
|
import { i as formatSessionLimits } from "./session-routes-D-8mGNXo.js";
|
|
3
|
-
import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-
|
|
3
|
+
import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-CSSHlH64.js";
|
|
4
4
|
import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
|
|
5
5
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
6
6
|
import { r as describeOverCap } from "./shown-files-core-Dji9dyEZ.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as RefinedTaskTitle, R as TASK_TITLE_CONTROL_CHARACTERS, Y as WhiteboardAgentRequest, 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, u as AgentPullRequestRequest } from "./session-DfOgGb2N.js";
|
|
2
|
-
import { E as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config
|
|
2
|
+
import { E as pullRequestKeyFromReference, l as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-CR-LBLlr.js";
|
|
3
3
|
import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-D-8mGNXo.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import crypto from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./session-DfOgGb2N.js";
|
|
2
|
-
import { A as HintFeature, C as ONBOARDING_STEP_STATES, S as ONBOARDING_STEPS, T as OPERATOR_SURFACES, b as DASHBOARD_VIEWS, n as BUILTIN_AGENT_IDS, w as OPERATOR_ACTIONS_BY_SURFACE } from "./config
|
|
2
|
+
import { A as HintFeature, C as ONBOARDING_STEP_STATES, S as ONBOARDING_STEPS, T as OPERATOR_SURFACES, b as DASHBOARD_VIEWS, n as BUILTIN_AGENT_IDS, w as OPERATOR_ACTIONS_BY_SURFACE } from "./config-CR-LBLlr.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region shared/contracts/telemetry.ts
|
|
5
5
|
var TELEMETRY_ADAPTERS = Object.freeze([...BUILTIN_AGENT_IDS, "custom"]);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
2
2
|
import { a as packageRoot, l as equalsIgnoringCaseOnWindows } from "./runtime-paths-D_ZjJLE0.js";
|
|
3
3
|
import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
4
|
-
import { $ as FLYING_ANIMALS_DURATION_RANGE, Et as UPDATE_CHANNELS, Q as FLYING_ANIMALS_DEFAULTS, Z as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_SCAN_INTERVAL_RANGE, at as PORT_RANGE, ct as POSTHOG_PROJECT_ID_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, et as FLYING_ANIMALS_GAP_RANGE, f as USAGE_COST_MODES, ft as REPLAY_BUFFER_KB_RANGE, gt as USAGE_RETAIN_DAYS_RANGE, ht as USAGE_INTEGER_RANGES, i as Config, it as NON_NEGATIVE_NUMBER_RANGE, lt as POSTHOG_TRAFFIC_BASELINE_RANGE, m as normalizeLegacyConfigNumbers, mt as USAGE_BUDGET_RANGE, n as BUILTIN_AGENT_IDS, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, ot as POSITIVE_NUMBER_RANGE, pt as TASK_TITLE_TIMEOUT_RANGE, rt as MEMORY_RESERVE_MB_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSTHOG_FIX_TIMEOUT_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_SCALE_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_MIN_USERS_RANGE, vt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, yt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE } from "./config
|
|
4
|
+
import { $ as FLYING_ANIMALS_DURATION_RANGE, Et as UPDATE_CHANNELS, Q as FLYING_ANIMALS_DEFAULTS, Z as COMMUNITY_INTERVAL_MINUTES_RANGE, _t as USAGE_SCAN_INTERVAL_RANGE, at as PORT_RANGE, ct as POSTHOG_PROJECT_ID_RANGE, d as BranchGcFileSettings, dt as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, et as FLYING_ANIMALS_GAP_RANGE, f as USAGE_COST_MODES, ft as REPLAY_BUFFER_KB_RANGE, gt as USAGE_RETAIN_DAYS_RANGE, ht as USAGE_INTEGER_RANGES, i as Config, it as NON_NEGATIVE_NUMBER_RANGE, lt as POSTHOG_TRAFFIC_BASELINE_RANGE, m as normalizeLegacyConfigNumbers, mt as USAGE_BUDGET_RANGE, n as BUILTIN_AGENT_IDS, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, ot as POSITIVE_NUMBER_RANGE, pt as TASK_TITLE_TIMEOUT_RANGE, rt as MEMORY_RESERVE_MB_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as POSTHOG_FIX_TIMEOUT_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as FLYING_ANIMALS_SCALE_RANGE, u as configIssueMessage, ut as POSTHOG_TRAFFIC_MIN_USERS_RANGE, vt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, yt as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE } from "./config-CR-LBLlr.js";
|
|
5
5
|
import { n as isRecord } from "./coerce-oz_Z_6E7.js";
|
|
6
6
|
import { d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-AKRVPqG1.js";
|
|
7
|
-
import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-
|
|
7
|
+
import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-ozDqnVz1.js";
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import os from "node:os";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c as loadConfigFile } from "./config-store-BEVvEOI4.js";
|
|
@@ -4,9 +4,9 @@ import { a as packageRoot, c as caseFoldedPathKey, d as safePathSegment, f as sa
|
|
|
4
4
|
import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
5
5
|
import { $ as MyPrAutoRebase, $t as NODE_ID_RE, A as SIGN_URL_ENV, At as ReviewComment, Bt as TeamReviewStateEntry, Ct as FindingSeverity, D as SESSION_NAME_PATTERN, Dt as PostingPlan, Et as PostedReviewEvent, F as ShownFile, Ft as ReviewVerdict, G as Frame, Gt as canApproveAfterComment, H as BoardRecord, Ht as TeamReviewThreadCommentsResponse, It as TeamReviewActionRequest, J as WHITEBOARD_LIMITS, Jt as hasStandingViewerApproval, K as Note, Kt as decisionAsIfApprovalRequired, L as SshSignRequest, Mt as ReviewFinding, Nt as ReviewResult, O as SESSION_NAME_RULE_TEXT, Ot as PrDetail, Pt as ReviewThreadId, Q as MyPr, Qt as GH_SEGMENT, Rt as TeamReviewCompareFiles, S as ConversationQuestion, St as EarlierReview, T as SESSION_DOC_BODY_CAP_BYTES, Tt as GithubReviewState, Ut as TeamReviewThreadResult, Vt as TeamReviewStatus, W as Box, Wt as TeamReviewThreadsRepository, X as Wire, Xt as HEX_SHA_RE, Z as LinkedPr, Zt as shortSha, _ as COHERENCE_HOOKS_INACTIVE, at as MyPrMergeMethod, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as CommitSha, cn as MERGEABLE_LIVE_STATES, ct as MyPrMergeStateResponse, en as REPO_SLUG_RE, et as MyPrCheckContext, ft as MyPrThreadNode, ht as MyPrsState, i as ASK_USER_QUESTION_TOOL_NAME, it as MyPrLaneEntry, j as SSH_SIGN_BODY_CAP_BYTES, jt as ReviewDraft, k as SHOWN_FILE_CAP_BYTES, ln as RESTARTABLE_STATES, lt as MyPrMergeWhenReadyRequest, mt as MyPrsSnapshot, nt as MyPrKeepMergeableRequest, on as BADGE_LABELS, ot as MyPrMergeRequest, pt as MyPrThreadsResponse, r as AGENT_URL_ENV, sn as KILLABLE_STATES, tn as repoParts, tt as MyPrCheckContextsResponse, un as STATES, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, xt as DECIDING_REVIEW_STATES, y as CONVERSATION_PERMISSION_HOOK_EVENT, z as TaskTitle, zt as TeamReviewResolveResponse } from "./session-DfOgGb2N.js";
|
|
6
6
|
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";
|
|
7
|
-
import { At as MAX_RAW_LINE_CHARS, B as MinedPrReviewData, Bt as PLAN_TOOL_NAME, Ct as CommunityState, D as FeatureHintState, E as pullRequestKeyFromReference, F as BenchmarkRun, Ft as changeMapFactId, G as GithubPrsFrame, Gt as GithubIssuePullRequestsRepository, H as GithubPrDetailNode, Ht as PlanRevision, I as BenchmarkStatus, It as PLAN_BODY_CAP_BYTES, J as WorkflowLabelName, Jt as IssueUpdate, K as comparablePrKey, Kt as GithubIssueResponse, L as BenchmarkSuite, Lt as PLAN_HOOK_EVENT, M as BenchmarkCase, Mt as TraceRecord, N as BenchmarkId, Nt as CoherenceJournalOutput, O as HINT_FEATURES, Ot as UpdateJournal, P as BenchmarkJudgement, Pt as ChangeMap, Qt as issuePullRequestStateFromGithub, R as CommitComparison, Rt as PLAN_HOOK_OUTPUT_MAX_CHARS, St as CommunityItem, Tt as DISCORD_CHANNEL_NAME_RE, U as GithubPrKey, Ut as parseExitPlanModeHookPayload, V as PrCheckoutCaseInput, Vt as PlanDecision, W as GithubPrLightSearchNode, Wt as planTitle, X as WorkflowsState, Xt as IssuesState, Y as WorkflowsSettings, Yt as IssuesSearchResponse, Zt as IssuesStatus, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, bt as CommunityActionRequest, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, h as CHANGES_POLL_INTERVAL_MS, ht as USAGE_INTEGER_RANGES, j as BenchmarkActionRequest, jt as TraceCheckpoint, k as HINT_VIEW_BY_FEATURE, kt as SessionSetup, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, p as USAGE_VENDOR_KEYS, q as WorkflowCommentBody, qt as IssueKey, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityVerdict, xt as CommunityDraft, y as ClientMessage, z as MergedPrListing, zt as PLAN_RESULT_HOOK_EVENT } from "./config
|
|
7
|
+
import { At as MAX_RAW_LINE_CHARS, B as MinedPrReviewData, Bt as PLAN_TOOL_NAME, Ct as CommunityState, D as FeatureHintState, E as pullRequestKeyFromReference, F as BenchmarkRun, Ft as changeMapFactId, G as GithubPrsFrame, Gt as GithubIssuePullRequestsRepository, H as GithubPrDetailNode, Ht as PlanRevision, I as BenchmarkStatus, It as PLAN_BODY_CAP_BYTES, J as WorkflowLabelName, Jt as IssueUpdate, K as comparablePrKey, Kt as GithubIssueResponse, L as BenchmarkSuite, Lt as PLAN_HOOK_EVENT, M as BenchmarkCase, Mt as TraceRecord, N as BenchmarkId, Nt as CoherenceJournalOutput, O as HINT_FEATURES, Ot as UpdateJournal, P as BenchmarkJudgement, Pt as ChangeMap, Qt as issuePullRequestStateFromGithub, R as CommitComparison, Rt as PLAN_HOOK_OUTPUT_MAX_CHARS, St as CommunityItem, Tt as DISCORD_CHANNEL_NAME_RE, U as GithubPrKey, Ut as parseExitPlanModeHookPayload, V as PrCheckoutCaseInput, Vt as PlanDecision, W as GithubPrLightSearchNode, Wt as planTitle, X as WorkflowsState, Xt as IssuesState, Y as WorkflowsSettings, Yt as IssuesSearchResponse, Zt as IssuesStatus, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, bt as CommunityActionRequest, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, h as CHANGES_POLL_INTERVAL_MS, ht as USAGE_INTEGER_RANGES, j as BenchmarkActionRequest, jt as TraceCheckpoint, k as HINT_VIEW_BY_FEATURE, kt as SessionSetup, nt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, p as USAGE_VENDOR_KEYS, q as WorkflowCommentBody, qt as IssueKey, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityVerdict, xt as CommunityDraft, y as ClientMessage, z as MergedPrListing, zt as PLAN_RESULT_HOOK_EVENT } from "./config-CR-LBLlr.js";
|
|
8
8
|
import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-D-8mGNXo.js";
|
|
9
|
-
import { A as parseRefinedTaskTitle, B as shouldAdoptReportedResumeId, C as extractAiTitle, D as isSelfWakePrompt, E as extractPromptTaskTitle, F as RESUME_ID_RE, G as nextSuggestedName, H as listRepoConversations, I as isConversationReplacedAtStartup, L as pickAutoResume, M as resolveTaskTitle, N as seedTaskTitleSources, O as isSubstantivePrompt, P as AUTO_CONTINUE_PROMPT, R as resolveResumeTarget, S as decideTaskTitleRefinement, T as extractOscTaskTitle, U as listRepoWorktreePaths, V as claudeProjectsDir, W as isAutoNameOf, _ as projectReviews, a as decideAgentRequest, b as chooseRefinedSessionName, c as describeChildEndNote, d as describeRoleRefusal, f as describeUnpushedCloseRefusal, g as projectReviewDetail, h as projectMyPrs, i as checkAgentReply, j as resolveRefocusTaskTitle, k as parseRefinedSessionName, l as describeKeptChildAttention, m as parseAgentVerb, n as REFUSAL_REASON, o as decideSpawnAllowance, s as deriveChildSessionName, u as describePushLanding, v as buildPersistedTaskTitle, w as extractHookTaskTitle, x as cleanTaskPrompt, y as buildTaskTitleRefinementPrompt, z as resumePromptFor } from "./agent-api-core-
|
|
9
|
+
import { A as parseRefinedTaskTitle, B as shouldAdoptReportedResumeId, C as extractAiTitle, D as isSelfWakePrompt, E as extractPromptTaskTitle, F as RESUME_ID_RE, G as nextSuggestedName, H as listRepoConversations, I as isConversationReplacedAtStartup, L as pickAutoResume, M as resolveTaskTitle, N as seedTaskTitleSources, O as isSubstantivePrompt, P as AUTO_CONTINUE_PROMPT, R as resolveResumeTarget, S as decideTaskTitleRefinement, T as extractOscTaskTitle, U as listRepoWorktreePaths, V as claudeProjectsDir, W as isAutoNameOf, _ as projectReviews, a as decideAgentRequest, b as chooseRefinedSessionName, c as describeChildEndNote, d as describeRoleRefusal, f as describeUnpushedCloseRefusal, g as projectReviewDetail, h as projectMyPrs, i as checkAgentReply, j as resolveRefocusTaskTitle, k as parseRefinedSessionName, l as describeKeptChildAttention, m as parseAgentVerb, n as REFUSAL_REASON, o as decideSpawnAllowance, s as deriveChildSessionName, u as describePushLanding, v as buildPersistedTaskTitle, w as extractHookTaskTitle, x as cleanTaskPrompt, y as buildTaskTitleRefinementPrompt, z as resumePromptFor } from "./agent-api-core-CSSHlH64.js";
|
|
10
10
|
import { a as rawTextOr, i as positiveNumberOr, n as isRecord, 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-BeOjhVq9.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 readPageTitle, i as filesAfterRetention, n as decideShownKind, o as shownMimeForFilename, r as describeOverCap, t as SHOWN_SNIFF_BYTES } from "./shown-files-core-Dji9dyEZ.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 stableConfigKey, B as buildPersonProperties, F as TELEMETRY_FLAGS_URL, G as decideRemoteTelemetryState, H as claudeAccountUuidOf, I as adapterBucket, J as nodeMajorVersion, K as decideTelemetryConsent, L as buildAiGenerationEvents, M as isExperimentalSetting, N as FIRST_RUN_NOTICE, P as TELEMETRY_BATCH_URL, R as buildBrowserExceptionProperties, U as codexUserIdOf, V as classifySessionExit, W as decideIsDevInstall, X as resolveProjectToken, Y as parsePosthogReleaseId, _ as settingsBlockSpecFor, a as ensureProjectIds, at as sessionIdFromBranch, ct as canonicalizePath, f as DEFAULT_TIMER_FNS, g as mergeSettingsBlock, i as createConfigStore, it as planWorktreeGc, k as valueAtPath, lt as comparableDirectoryPath, n as DEFAULT_CONFIG, nt as matchedPrefix, o as generateProjectId, ot as usablePrefixes, p as unrefTimer, q as exceptionFingerprint, rt as planBranchGc, s as glimmervoidHomeDir$1, st as worktreeIntegrationTips, t as ABORT_CONFIG_SAVE, tt as DEFAULT_BRANCH_GC_PREFIXES, ut as isSameDirectoryPath, v as validateSettingsBlock, y as SETTINGS_INDEX, z as buildExceptionProperties } from "./config-store-
|
|
21
|
-
import { _ as TelemetryState, a as DEEP_HISTORY_SCROLLBACK_LINES, c as describeDataAttach, d as DashboardTelemetryReport, h as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, l as parseDataAttach, m as PendingCrashReport, r as HTTP_URL_RE, s as LOGGED_FAST_CLOSE_COUNTS, u as parseDataClientMessage } from "./build-channel-
|
|
20
|
+
import { $ as stableConfigKey, B as buildPersonProperties, F as TELEMETRY_FLAGS_URL, G as decideRemoteTelemetryState, H as claudeAccountUuidOf, I as adapterBucket, J as nodeMajorVersion, K as decideTelemetryConsent, L as buildAiGenerationEvents, M as isExperimentalSetting, N as FIRST_RUN_NOTICE, P as TELEMETRY_BATCH_URL, R as buildBrowserExceptionProperties, U as codexUserIdOf, V as classifySessionExit, W as decideIsDevInstall, X as resolveProjectToken, Y as parsePosthogReleaseId, _ as settingsBlockSpecFor, a as ensureProjectIds, at as sessionIdFromBranch, ct as canonicalizePath, f as DEFAULT_TIMER_FNS, g as mergeSettingsBlock, i as createConfigStore, it as planWorktreeGc, k as valueAtPath, lt as comparableDirectoryPath, n as DEFAULT_CONFIG, nt as matchedPrefix, o as generateProjectId, ot as usablePrefixes, p as unrefTimer, q as exceptionFingerprint, rt as planBranchGc, s as glimmervoidHomeDir$1, st as worktreeIntegrationTips, t as ABORT_CONFIG_SAVE, tt as DEFAULT_BRANCH_GC_PREFIXES, ut as isSameDirectoryPath, v as validateSettingsBlock, y as SETTINGS_INDEX, z as buildExceptionProperties } from "./config-store-BEVvEOI4.js";
|
|
21
|
+
import { _ as TelemetryState, a as DEEP_HISTORY_SCROLLBACK_LINES, c as describeDataAttach, d as DashboardTelemetryReport, h as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, l as parseDataAttach, m as PendingCrashReport, r as HTTP_URL_RE, s as LOGGED_FAST_CLOSE_COUNTS, u as parseDataClientMessage } from "./build-channel-ozDqnVz1.js";
|
|
22
22
|
import { i as resolveArgvCommandMatches } from "./kimi-Dzr2-y9R.js";
|
|
23
|
-
import { $ as isUsageFile, A as exceedsUploadCap, B as isOversizedPartialLine, C as parseResolvedSha, Ct as totalTokensOf$1, D as MAX_UPLOAD_BYTES, E as openContainedFile, Et as claudeCode, F as MAX_TRANSCRIPT_READ_BYTES, G as codexHomes, H as resumeOffsetFrom, I as TRACE_TAIL_SCAN_BYTES, J as continuationDelayMs, K as codexRootCandidates, L as committedOffsetFromTraceTailOrNull, M as imageMimeForUploadFilename, N as isSafePathSegment, O as buildUploadFilename, P as planUploadRetention, Q as grokHomes, R as completeLineBytes, S as parseRegistryLatest, St as shouldReplace, T as shortSha$1, Tt as HOOK_TOOLS, U as withCommittedOffset, V as planContiguousRead, W as codexFallbackRoots, X as dedupeCodexFiles, Y as decideFileRead, Z as expandTilde, _ as decideUpdateStatus, _t as identityFromRelPath, a as describeAgentResolvability, at as sessionsRootCandidates, b as normalizeUpdateChannel, bt as parseJsonLine, c as isKnownAgentId, ct as splitLines, d as resolveAdapter, dt as addEntryToTotals, et as kimiHomes, f as setCustomAgents, ft as dedupKeys, g as decideInstallFlavor, gt as foldReplacementIntoGenerationRollup, h as requestCodexAppServer, ht as foldEntryIntoGenerationRollup, i as customAgentFingerprint, it as scopedClaudeRoots, j as framePathPaste, k as decideUploadType, l as listAgentIds, lt as kimiDedupIdentity, m as readHostCodexVersion, mt as expandAdvisorIterations, n as cachedAgentResolvability, nt as projectDirCandidates, o as getAdapter, ot as shouldEvaluateDespiteIoFailures, p as codex, pt as emptyTotals, q as codexSessionIdFromPath, r as commandFor, rt as resolveProjectsDirs, s as hookProfileOf, st as shouldPersistWarehouse, t as DEFAULT_AGENT_ID$1, tt as passOutcome, u as resetCommandCache, ut as parseKimiUsageLine, v as isCheckFresh, vt as isWithinGenerationRecencyWindow, w as pickNewestPublished, wt as vendorUsageEntry, x as parseRegistryDeprecation, xt as parseUsageLine, y as normalizeSha, yt as mergeGenerationRollups, z as containmentRefusalReason } from "./adapters-
|
|
23
|
+
import { $ as isUsageFile, A as exceedsUploadCap, B as isOversizedPartialLine, C as parseResolvedSha, Ct as totalTokensOf$1, D as MAX_UPLOAD_BYTES, E as openContainedFile, Et as claudeCode, F as MAX_TRANSCRIPT_READ_BYTES, G as codexHomes, H as resumeOffsetFrom, I as TRACE_TAIL_SCAN_BYTES, J as continuationDelayMs, K as codexRootCandidates, L as committedOffsetFromTraceTailOrNull, M as imageMimeForUploadFilename, N as isSafePathSegment, O as buildUploadFilename, P as planUploadRetention, Q as grokHomes, R as completeLineBytes, S as parseRegistryLatest, St as shouldReplace, T as shortSha$1, Tt as HOOK_TOOLS, U as withCommittedOffset, V as planContiguousRead, W as codexFallbackRoots, X as dedupeCodexFiles, Y as decideFileRead, Z as expandTilde, _ as decideUpdateStatus, _t as identityFromRelPath, a as describeAgentResolvability, at as sessionsRootCandidates, b as normalizeUpdateChannel, bt as parseJsonLine, c as isKnownAgentId, ct as splitLines, d as resolveAdapter, dt as addEntryToTotals, et as kimiHomes, f as setCustomAgents, ft as dedupKeys, g as decideInstallFlavor, gt as foldReplacementIntoGenerationRollup, h as requestCodexAppServer, ht as foldEntryIntoGenerationRollup, i as customAgentFingerprint, it as scopedClaudeRoots, j as framePathPaste, k as decideUploadType, l as listAgentIds, lt as kimiDedupIdentity, m as readHostCodexVersion, mt as expandAdvisorIterations, n as cachedAgentResolvability, nt as projectDirCandidates, o as getAdapter, ot as shouldEvaluateDespiteIoFailures, p as codex, pt as emptyTotals, q as codexSessionIdFromPath, r as commandFor, rt as resolveProjectsDirs, s as hookProfileOf, st as shouldPersistWarehouse, t as DEFAULT_AGENT_ID$1, tt as passOutcome, u as resetCommandCache, ut as parseKimiUsageLine, v as isCheckFresh, vt as isWithinGenerationRecencyWindow, w as pickNewestPublished, wt as vendorUsageEntry, x as parseRegistryDeprecation, xt as parseUsageLine, y as normalizeSha, yt as mergeGenerationRollups, z as containmentRefusalReason } from "./adapters-Dzl0abk4.js";
|
|
24
24
|
import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-core-DgW3orTE.js";
|
|
25
25
|
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-BzANIIVe.js";
|
|
26
26
|
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";
|
|
27
|
-
import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-
|
|
28
|
-
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-
|
|
27
|
+
import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-CRRVJk9S.js";
|
|
28
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-ClSn4YF0.js";
|
|
29
29
|
import { createRequire } from "node:module";
|
|
30
30
|
import fs, { readFileSync } from "node:fs";
|
|
31
31
|
import path, { join, resolve } from "node:path";
|
|
@@ -19679,7 +19679,8 @@ function everyTextBlockJoined(blocks) {
|
|
|
19679
19679
|
return blockTexts.join("\n");
|
|
19680
19680
|
}
|
|
19681
19681
|
function isTaskNotificationLine(line) {
|
|
19682
|
-
|
|
19682
|
+
const turnOriginKind = typeof line.turnOrigin === "string" ? line.turnOrigin : line.turnOrigin?.kind;
|
|
19683
|
+
return line.origin?.kind === "task-notification" || turnOriginKind === "task_notification";
|
|
19683
19684
|
}
|
|
19684
19685
|
function mapUserLine(rawLine, line, context) {
|
|
19685
19686
|
const base = baseRecord(line, context);
|
|
@@ -38082,9 +38083,9 @@ function tokensPerMinute(block) {
|
|
|
38082
38083
|
}
|
|
38083
38084
|
//#endregion
|
|
38084
38085
|
//#region server/usage/core/usage-blocks-core.ts
|
|
38085
|
-
var HOUR_MS
|
|
38086
|
+
var HOUR_MS = 36e5;
|
|
38086
38087
|
function buildBlocks(entriesAsc, { blockHours = 5, now = Date.now() } = {}) {
|
|
38087
|
-
const duration = blockHours * HOUR_MS
|
|
38088
|
+
const duration = blockHours * HOUR_MS;
|
|
38088
38089
|
const blocks = [];
|
|
38089
38090
|
let current = null;
|
|
38090
38091
|
let previousEntryTs = null;
|
|
@@ -38167,7 +38168,7 @@ function addEntry(block, entry) {
|
|
|
38167
38168
|
block.lastEntryTs = entry.timestampMs;
|
|
38168
38169
|
}
|
|
38169
38170
|
function hourFloor(timestampMs) {
|
|
38170
|
-
return Math.floor(timestampMs / HOUR_MS
|
|
38171
|
+
return Math.floor(timestampMs / HOUR_MS) * HOUR_MS;
|
|
38171
38172
|
}
|
|
38172
38173
|
//#endregion
|
|
38173
38174
|
//#region server/usage/core/usage-codex-core.ts
|
|
@@ -38355,19 +38356,16 @@ function normalizeGrokModel(model) {
|
|
|
38355
38356
|
//#endregion
|
|
38356
38357
|
//#region server/usage/core/usage-your-day-core.ts
|
|
38357
38358
|
var MINUTE_MS = 6e4;
|
|
38358
|
-
var
|
|
38359
|
-
var DAY_MS = 24 * HOUR_MS;
|
|
38359
|
+
var DAY_MS = 24 * (60 * MINUTE_MS);
|
|
38360
38360
|
var BREAK_MS = 15 * MINUTE_MS;
|
|
38361
38361
|
var BASELINE_DAYS = 14;
|
|
38362
38362
|
var MIN_ACTIVE_DAYS = 3;
|
|
38363
38363
|
var JUGGLING_WINDOW_MS = 30 * MINUTE_MS;
|
|
38364
|
-
var AFTER_HOURS_START_HOUR = 22;
|
|
38365
38364
|
var MIN_SAMPLES_PER_SIDE = 3;
|
|
38366
38365
|
var MIN_SAMPLES_PER_WINDOW = 5;
|
|
38367
38366
|
var SHARP_WINDOW_HOURS = 3;
|
|
38368
38367
|
var MIN_DEVIATION = 1.2;
|
|
38369
38368
|
var MIN_LONG_STRETCH_MS = 90 * MINUTE_MS;
|
|
38370
|
-
var MIN_AFTER_HOURS_MS = 20 * MINUTE_MS;
|
|
38371
38369
|
var MIN_JUGGLING_SESSIONS = 5;
|
|
38372
38370
|
var MAX_INSIGHTS = 3;
|
|
38373
38371
|
var LANE_OF_INTERACTIVE_SESSIONS = "interactive";
|
|
@@ -38447,9 +38445,6 @@ function startOfLocalDay(ts) {
|
|
|
38447
38445
|
const date = new Date(ts);
|
|
38448
38446
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
38449
38447
|
}
|
|
38450
|
-
function afterHoursStartOf(ts) {
|
|
38451
|
-
return startOfLocalDay(ts) + AFTER_HOURS_START_HOUR * HOUR_MS;
|
|
38452
|
-
}
|
|
38453
38448
|
function hourText(hour) {
|
|
38454
38449
|
return `${String((hour % 24 + 24) % 24).padStart(2, "0")}:00`;
|
|
38455
38450
|
}
|
|
@@ -38532,8 +38527,6 @@ function dayStatsOf(day, dayEvents) {
|
|
|
38532
38527
|
start: 0,
|
|
38533
38528
|
end: 0
|
|
38534
38529
|
});
|
|
38535
|
-
const afterHoursStart = prompts.length > 0 ? afterHoursStartOf(prompts[0].ts) : 0;
|
|
38536
|
-
const afterHoursMs = stretches.reduce((total, stretch) => total + Math.max(0, stretch.end - Math.max(stretch.start, afterHoursStart)), 0);
|
|
38537
38530
|
const replySamples = collectReplySamples(dayEvents, stretches);
|
|
38538
38531
|
const juggling = peakJugglingOf(prompts);
|
|
38539
38532
|
return {
|
|
@@ -38541,7 +38534,6 @@ function dayStatsOf(day, dayEvents) {
|
|
|
38541
38534
|
sessionCount: new Set(prompts.map((prompt) => prompt.sessionId)).size,
|
|
38542
38535
|
activeMs: stretches.reduce((total, stretch) => total + stretch.end - stretch.start, 0),
|
|
38543
38536
|
longestStretchMs: longest.end - longest.start,
|
|
38544
|
-
afterHoursMs,
|
|
38545
38537
|
peakWaiting: replySamples.reduce((peak, sample) => Math.max(peak, sample.waitingDepth), 0),
|
|
38546
38538
|
peakJuggling: juggling.count,
|
|
38547
38539
|
peakJugglingAt: juggling.at
|
|
@@ -38595,16 +38587,6 @@ function longestStretchInsight(yesterday, usualStretchMs) {
|
|
|
38595
38587
|
deviation
|
|
38596
38588
|
};
|
|
38597
38589
|
}
|
|
38598
|
-
function afterHoursInsight(yesterday, usualAfterHoursMs) {
|
|
38599
|
-
if (yesterday.afterHoursMs < MIN_AFTER_HOURS_MS) return null;
|
|
38600
|
-
const deviation = yesterday.afterHoursMs / Math.max(usualAfterHoursMs, MIN_AFTER_HOURS_MS);
|
|
38601
|
-
if (deviation < MIN_DEVIATION) return null;
|
|
38602
|
-
return {
|
|
38603
|
-
kind: "afterHours",
|
|
38604
|
-
text: `${durationText(yesterday.afterHoursMs)} after ${hourText(AFTER_HOURS_START_HOUR)}. Stop by ${hourText(AFTER_HOURS_START_HOUR)}.`,
|
|
38605
|
-
deviation
|
|
38606
|
-
};
|
|
38607
|
-
}
|
|
38608
38590
|
function jugglingInsight(yesterday, usualJuggling) {
|
|
38609
38591
|
if (yesterday.peakJuggling < MIN_JUGGLING_SESSIONS) return null;
|
|
38610
38592
|
const deviation = yesterday.peakJuggling / Math.max(usualJuggling, 1);
|
|
@@ -38640,7 +38622,6 @@ function buildYourDay(events, { now, laneByKey = null }) {
|
|
|
38640
38622
|
waitingThresholdInsight(replySamples),
|
|
38641
38623
|
sharpestHoursInsight(replySamples),
|
|
38642
38624
|
longestStretchInsight(yesterday, usualStretchMs),
|
|
38643
|
-
afterHoursInsight(yesterday, median(baselineDays.map((day) => day.afterHoursMs))),
|
|
38644
38625
|
jugglingInsight(yesterday, median(baselineDays.map((day) => day.peakJuggling)))
|
|
38645
38626
|
].filter((insight) => insight !== null).sort((left, right) => right.deviation - left.deviation).slice(0, MAX_INSIGHTS);
|
|
38646
38627
|
const latestStretch = allStretches.at(-1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import { l as resolveConfigPath } from "./config-store-
|
|
3
|
-
import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-
|
|
2
|
+
import { l as resolveConfigPath } from "./config-store-BEVvEOI4.js";
|
|
3
|
+
import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-CRRVJk9S.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region server/text-format.ts
|
|
6
6
|
function trimIso(iso) {
|
|
@@ -2,7 +2,7 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { l as equalsIgnoringCaseOnWindows } from "./runtime-paths-D_ZjJLE0.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 { ct as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-
|
|
5
|
+
import { ct as canonicalizePath, f as DEFAULT_TIMER_FNS, p as unrefTimer, s as glimmervoidHomeDir } from "./config-store-BEVvEOI4.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-DfOgGb2N.js";
|
|
4
|
-
import { r as BrowserConfig } from "./config
|
|
4
|
+
import { r as BrowserConfig } from "./config-CR-LBLlr.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 { E as setValueAtPath, Q as readEnvSecrets, T as scoreSettingsSearch, Z as ENV_SECRET_BINDINGS, b as cloneValue, c as loadConfigFile, d as validateConfig, et as withEnvSecrets, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, w as parsePosthogProjectSelection, x as deleteValueAtPath } 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 { E as setValueAtPath, Q as readEnvSecrets, T as scoreSettingsSearch, Z as ENV_SECRET_BINDINGS, b as cloneValue, c as loadConfigFile, d as validateConfig, et as withEnvSecrets, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, w as parsePosthogProjectSelection, x as deleteValueAtPath } from "./config-store-BEVvEOI4.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-ClSn4YF0.js";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import { parseArgs } from "node:util";
|
|
@@ -330,7 +330,7 @@ function processIo() {
|
|
|
330
330
|
async function runSettingsCli(commandArguments, io = processIo()) {
|
|
331
331
|
const serverRequest = settingsRequestForServer(commandArguments, process.env);
|
|
332
332
|
if (!serverRequest) return runSettingsCommand(commandArguments, io);
|
|
333
|
-
const { askAgentApi } = await import("./agent-api-cli-
|
|
333
|
+
const { askAgentApi } = await import("./agent-api-cli-CdJWqyUb.js");
|
|
334
334
|
const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
|
|
335
335
|
ok: false,
|
|
336
336
|
error: errorMessage(error)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as AgentSettingsRequest } from "./session-DfOgGb2N.js";
|
|
2
2
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
3
|
-
import { A as FILE_ONLY_GROUPS, C as hasScaledUnit, D as settingsGroupOf, O as settingsOf, Q as readEnvSecrets, S as displayText, b as cloneValue, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, y as SETTINGS_INDEX } from "./config-store-
|
|
3
|
+
import { A as FILE_ONLY_GROUPS, C as hasScaledUnit, D as settingsGroupOf, O as settingsOf, Q as readEnvSecrets, S as displayText, b as cloneValue, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, y as SETTINGS_INDEX } from "./config-store-BEVvEOI4.js";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
//#region server/core/settings-readout-core.ts
|
|
6
6
|
var VALUE_COLUMN_WIDTH = 40;
|
|
@@ -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-DfOgGb2N.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-Dmh4RjkC.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 +1 @@
|
|
|
1
|
-
import{Q as e,Y as t,n}from"./updates-view-core-
|
|
1
|
+
import{Q as e,Y as t,n}from"./updates-view-core-BRJGMQQv.js";import{o as r,x as i}from"./dom-helpers-I_SDCPvs.js";import{c as a,d as o,u as s}from"./control-ws-MI1qU95m.js";var c=`http://www.w3.org/2000/svg`;function l(e,t){let n=document.createElementNS(c,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function u(e,t){let n=document.createElementNS(c,`svg`);return n.setAttribute(`width`,String(e)),n.setAttribute(`height`,String(t)),n.setAttribute(`viewBox`,`0 0 ${e} ${t}`),n.setAttribute(`aria-hidden`,`true`),n}var d=`M4 4L12 12M12 4L4 12`,f=`M10 3L5 8L10 13`,p=`M3 8h0.01M8 8h0.01M13 8h0.01`,m=`M8 2.5v6M5 5.5h6M5 12.5h6`,h=`M4.5 12.5h7a3 3 0 0 0 0.4-5.97a4 4 0 0 0-7.7 0.57a2.7 2.7 0 0 0 0.3 5.4z`,g=`M8 1.8l5.2 2v4c0 3.2-2.2 5.4-5.2 6.4c-3-1-5.2-3.2-5.2-6.4v-4z`,_=`M9.2 1.5L3.5 9h4.3l-1 5.5L12.5 7H8.2z`,v=`M8.7 4.2L5.6 8.6h2.5l-.6 3.2l3.1-4.4H8.1z`,y=`M3 13V9M8 13V3M13 13V6.5`;function b(e,t=`2`){let n=u(16,16);return n.classList.add(`line-icon`),n.append(l(`path`,{d:e,fill:`none`,stroke:`currentColor`,"stroke-width":t,"stroke-linecap":`round`,"stroke-linejoin":`round`})),n}function x(e,t){let{class:n,...r}=t,i=u(16,16);return n!==void 0&&i.classList.add(n),i.append(l(e,r)),i}function S(e){let t=document.createElement(`span`);t.className=`status-icon`,t.dataset.icon=e;for(let n of i[e])t.append(x(n.tag,n.attributes));return t}function C(e,t){e.dataset.icon!==t&&(e.dataset.icon=t,e.replaceChildren(S(t)))}var w={busy:`text-text-muted`,ok:`text-state-done`,error:`text-state-failed`},T=15e3,E=`Something went wrong. Details are hidden in streamer mode.`;function D(e,t){return e!==`error`||t.startsWith(`Not connected to the server. Reconnecting.`)?t:document.documentElement.hasAttribute(`data-streamer`)?E:t}var O={busy:`working`,ok:`complete`,error:`failed`};function k(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 i=r(`span`,`action-status-icon`);i.setAttribute(`aria-hidden`,`true`);let a=r(`span`,`action-status-text`);return e.replaceChildren(i,a),{iconElement:i,textElement:a}}function A(e){e.replaceChildren(),delete e.dataset.tone}function j(e,t,n){if(!n){A(e);return}if(!t){A(e),e.textContent=n;return}e.dataset.tone=t;let{iconElement:r,textElement:i}=k(e);C(r,O[t]),i.textContent=D(t,n)}function M(e=`action-status`){let t=r(`p`,e);return t.setAttribute(`role`,`status`),t.hidden=!0,{element:t,show:(n,r)=>{t.className=`${e} text-meta ${w[n]}`,j(t,n,r),t.hidden=!r},clear:()=>{t.hidden=!0,A(t)}}}function N(e,t){return s(e)?!0:(t.show(`error`,n),!1)}function P(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 F(e,t,n,{busyText:r,timeoutMs:i=T}={}){r&&n.show(`busy`,r);try{let r=await o(e,t,{timeoutMs:i});return n.clear(),r}catch(e){return n.show(`error`,P(e,i)),null}}var I=null,L=3e4,R=null;function z(){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`,W)),{line:e,text:t,age:n})}function B(){let n=z();if(!n||!I)return;let r=e(Date.now()-I.raisedAt,{...t,justNowBelowSeconds:60});n.age.textContent!==r&&(n.age.textContent=r)}function V({source:e,sessionId:t,message:n,hidesInStreamerMode:i=!0}){a(e,n);let o=z();if(!o)return;let s=i?D(`error`,n):n,c=r(`strong`,`header-status-source`,e);o.text.replaceChildren(c,` ${s}`),o.text.title=`${e}: ${s}`,I={source:e,sessionId:t??null,raisedAt:Date.now()},B(),R??=window.setInterval(B,L),o.line.hidden=!1}function H(e,t){I?.source===e&&(t===void 0||I.sessionId===t)&&W()}function U(e){I?.sessionId===e&&W()}function W(){I=null,R!==null&&window.clearInterval(R),R=null;let e=z();e&&(e.line.hidden=!0,e.text.replaceChildren(),e.text.title=``,e.age.textContent=``)}export{l as S,v as _,j as a,b,F as c,f as d,_ as f,p as g,h,M as i,N as l,d as m,H as n,V as o,m as p,U as r,P as s,T as t,C as u,g as v,u as x,y};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-
|
|
1
|
+
import"./updates-view-core-BRJGMQQv.js";import{n as e,o as t,r as n}from"./dom-helpers-I_SDCPvs.js";import{J as r,Y as i,q as a}from"./index-BEci_NIV.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,n,i){let a=t(`button`,`bench-action-button`,o[n]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,n)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let n=t(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(n.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(n.dataset.degraded=`true`),n}function p(e){let n=e.armIds.filter(t=>t!==e.baselineArm),r=t(`table`,`bench-table`),i=t(`tr`);i.append(t(`th`,null,`Case`),...e.armIds.map(n=>t(`th`,null,n===e.baselineArm?`${n} (baseline)`:n))),i.append(...n.map(e=>t(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=t(`tr`);a.append(t(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...n.map(e=>t(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=t(`tr`,`bench-total`);o.append(t(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let n of a){let i=t(`tr`,`bench-total`);i.append(t(`td`,`bench-case`,`Recall, ${n}`),...e.armIds.map(r=>t(`td`,`bench-score`,c(e.totals[r]?.recallByTag[n]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:i,pendingActionBySuite:o,outcomeBySuite:s}=a(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!i,h=t(`div`,`bench-summary`);h.append(t(`span`,`bench-suite-title`,r.title),n(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),n(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),n(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=t(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=t(`span`,`bench-status`,(i?``:`Not connected to the server. Reconnecting.`)||d(e,r)||s.get(r.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),r.error)return c.append(t(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(t(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(t(`p`,`bench-empty`,r.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:n}=a(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!n)s.append(t(`p`,`bench-empty`,`Waiting for the server.`));else if(!n.configured)s.append(t(`p`,`bench-empty`,n.reason||`Benchmarks are off.`));else if(n.suites.length===0)s.append(t(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of n.suites)s.append(m(n,e))}function g(e){s||(s=t(`div`,`bench-content`),e.append(s),i(h),h())}var _={mount:g};export{_ as view};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Et as e}from"./updates-view-core-DodtnH3A.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-BXztZiPc.js";import{i}from"./action-status-C_hxjBXy.js";import{a,n as o}from"./modal-BRwbyxA2.js";import{$r as s,ai as c,bi as l,ci as u,ei as d,ii as f,ni as p,oi as m,ri as h,si as g,ti as _,vi as v,yi as y}from"./index-C--3LY9q.js";var b=4,ee=200,te=2e4,ne=1.1,re=[`wire`,`note`,`frame`,`box`];function x(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function S(){return document.documentElement.dataset.layout===`phone`}function ie(e){let{svg:n,canvas:r,renderer:i}=e,a=new Map,o=new Set,s={x:0,y:0,width:1e3,height:600},c=null,l=null;function u(){n.setAttribute(`viewBox`,`${s.x} ${s.y} ${s.width} ${s.height}`)}function d(){let e=i.layout();if(!e)return;let{bounds:t}=e,r=n.clientWidth,a=n.clientHeight;if(r===0||a===0){s={...t},u();return}let o=Math.max(1,t.width/r,t.height/a);s={x:t.x,y:t.y,width:r*o,height:a*o},u()}function f(e,t){let r=n.getScreenCTM();if(!r)return{x:e,y:t};let i=new DOMPoint(e,t).matrixTransform(r.inverse());return{x:i.x,y:i.y}}function p(){let e=n.clientWidth||1,t=n.clientHeight||1;return Math.max(s.width/e,s.height/t)}function m(e,t){let n=Math.min(te,Math.max(ee,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},u()}function h(e,t){let n=p();s={...s,x:s.x-e*n,y:s.y-t*n},u()}function g(t){o=t,i.setSelection(o),e.onSelectionChange(o)}function _(e,t){if(!t){g(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),g(n)}function v(e){let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&g(t)}function y(e){let t=i.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function x(){let[e,t]=[...a.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function ie(){c={kind:`pinch`,distance:x(),viewWidth:s.width}}function C(e){if(e.button!==0||l)return;if(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),n.setPointerCapture(e.pointerId),a.size===2){ie();return}let t=i.elementFromTarget(e.target),r=t?.kind===`box`&&!S()?y(t.id):null;if(t&&r){c={kind:`drag`,pointerId:e.pointerId,boxId:t.id,origin:f(e.clientX,e.clientY),start:r,hasMoved:!1,isAdditive:e.shiftKey};return}if(t&&!S()){_(t.id,e.shiftKey);return}let o=t?.kind===`box`?t.id:null;c={kind:`pan`,pointerId:e.pointerId,lastClient:{x:e.clientX,y:e.clientY},hasMoved:!1,tappedBoxId:o}}function w(e,t){let n=f(t.clientX,t.clientY),r=n.x-e.origin.x,a=n.y-e.origin.y;!e.hasMoved&&Math.hypot(r,a)<b*p()||(e.hasMoved=!0,i.nodeOf(e.boxId)?.setAttribute(`transform`,`translate(${r} ${a})`))}function ae(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<b||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},h(n,r))}function oe(e){let t=x();if(t<=0||e.distance<=0)return;let n=[...a.values()];m(f(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 se(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?oe(c):c?.kind===`drag`&&c.pointerId===e.pointerId?w(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&ae(c,e))}async function ce(t,n){if(!t.hasMoved){_(t.boxId,t.isAdditive);return}let r=f(n.clientX,n.clientY),a={x:Math.round(t.start.x+r.x-t.origin.x),y:Math.round(t.start.y+r.y-t.origin.y)};await e.sendOps([{op:`set`,id:t.boxId,fields:{at:a}}])||i.nodeOf(t.boxId)?.removeAttribute(`transform`)}function le(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?ce(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&S()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||g(new Set)))}function ue(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function T(e){e.preventDefault(),e.ctrlKey||e.metaKey?m(f(e.clientX,e.clientY),e.deltaY>0?ne:1/ne):h(-e.deltaX,-e.deltaY)}function E(){let e=l;l=null,e?.remove()}function de(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;E();let c=r.getBoundingClientRect(),u=s.getBoundingClientRect(),d=t(`input`,`wb-title-input`);d.type=`text`,d.value=o.title,d.maxLength=80,d.setAttribute(`aria-label`,`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,r.append(d),d.addEventListener(`keydown`,t=>{if(t.key===`Escape`){t.preventDefault(),E(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();E(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,E),d.focus(),d.select()}function fe(e){if(S())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&de(t.id)}function pe(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=re.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));g(new Set),e.sendOps(r)}function me(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),pe()):e.key===`Escape`&&g(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,C),n.addEventListener(`pointermove`,se),n.addEventListener(`pointerup`,le),n.addEventListener(`pointercancel`,ue),n.addEventListener(`wheel`,T,{passive:!1}),n.addEventListener(`dblclick`,fe),n.addEventListener(`keydown`,me),{fit:d,selectedIds:()=>o,clearSelection:()=>g(new Set),pruneSelection:v,closeTitleInput:E}}var C=40,w=220,ae=90,oe=30,se=20,ce=18,le=20,ue=26,T=18,E=26,de=170,fe=21,pe=17,me=10,D=22,he=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function O(e,t){let n=e.split(/\s+/).filter(Boolean),r=[],i=``;for(let e of n){let n=e.match(RegExp(`.{1,${t}}`,`g`))??[e];for(let e of n){let n=i?`${i} ${e}`:e;n.length<=t?i=n:(r.push(i),i=e)}}return i&&r.push(i),r.length>0?r:[``]}function ge(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:he[n.color]}:null}function _e(e,t){let n=O(t.title,le),r=t.lines.flatMap(e=>O(e.text,ue-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ge(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*se+r.length*ce+(i?26:0)}}function k(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function A(e){return C+e*310}function ve(e){let t=new Map,n=new Map,r=k(e,`box`).map((e,t)=>({box:e,index:t})).sort((e,t)=>e.box.order-t.box.order||e.index-t.index);for(let{box:i}of r){let r=Math.max(0,e.columns.findIndex(e=>e.id===i.column)),a=_e(e,i),o=n.get(i.column)??84,s=i.at??{x:A(r),y:o};i.at||n.set(i.column,o+a.height+oe),t.set(i.id,{kind:`box`,id:i.id,x:s.x,y:s.y,width:w,height:a.height,titleLines:a.titleLines,bodyLines:a.bodyLines,lane:a.lane,isGhost:i.ghost})}return t}function ye(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}function be(e,t){return k(e,`frame`).flatMap(e=>{let n=ye(e.contains.flatMap(e=>t.get(e)??[]));return n?[{kind:`frame`,id:e.id,title:e.title,x:n.x-T,y:n.y-T-E,width:n.width+36,height:n.height+36+E}]:[]})}function xe(e,t){let n=e.x+e.width/2,r=t.x+t.width/2;if(Math.abs(r-n)>e.width/2){let i=r>n,a={x:i?e.x+e.width:e.x,y:e.y+Math.min(e.height/2,40)},o={x:i?t.x:t.x+t.width,y:t.y+Math.min(t.height/2,40)},s=(o.x-a.x)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x+s} ${a.y}, ${o.x-s} ${o.y}, ${o.x} ${o.y}`}}let i=t.y>e.y,a={x:n,y:i?e.y+e.height:e.y},o={x:r,y:i?t.y:t.y+t.height},s=(o.y-a.y)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x} ${a.y+s}, ${o.x} ${o.y-s}, ${o.x} ${o.y}`}}function Se(e,t){return k(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=xe(n,r);return[{kind:`wire`,id:e.id,path:i.path,start:i.start,end:i.end,label:e.label,labelAt:{x:(i.start.x+i.end.x)/2,y:(i.start.y+i.end.y)/2-6},isDashed:e.dashed,tone:e.tone,strokeHex:e.tone===`lane`?n.lane?.hex??null:null}]})}function Ce(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function we(e,t){let n=new Map;return k(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let i=O(e.text,fe),a=24+(i.length+1)*pe,o=n.get(e.on)??r.y-8;return n.set(e.on,o+a+me),[{kind:`note`,id:e.id,x:r.x+r.width-24,y:o,width:de,height:a,lines:i,byline:Ce(e),isResolved:e.resolvedBy!==null}]})}function Te(e,t){let n=e.flatMap(e=>e.kind===`wire`?[]:[e]),r=A(Math.max(1,t))-ae,i=ye([...n,{x:0,y:0,width:r,height:84}]);return i?{x:Math.min(0,i.x-C),y:Math.min(0,i.y-C),width:i.width+80,height:i.height+80}:{x:0,y:0,width:r+C,height:80}}function Ee(e){let t=ve(e),n=[...be(e,t),...Se(e,t),...t.values(),...we(e,t)],r=Te(n,e.columns.length),i=r.y+r.height,a=e.lanes.map((e,t)=>({label:e.label||e.id,hex:he[e.color],x:C,y:i+t*D})),o=i+a.length*D+(a.length>0?12:0),s=e.caption?{text:e.caption,x:C,y:o}:null,c=a.length*D+(s?30:0)+(a.length>0?12:0);return{columns:e.columns.map((e,t)=>({id:e.id,title:e.title,x:A(t),width:w})),elements:n,legend:a,caption:s,bounds:{...r,height:r.height+c}}}function De(e){return JSON.stringify(e)}var Oe=`http://www.w3.org/2000/svg`,j=12,ke=26,Ae=20,je=18,Me=17,Ne=14;function M(e,t={},n=``){let r=document.createElementNS(Oe,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return n&&r.setAttribute(`class`,n),r}function N(e,t,n,r){let i=M(`text`,{x:t,y:n},r);return i.textContent=e,i}function P(e,t){let n=M(`g`,{},`wb-element ${t}`);return n.dataset.elementId=e.id,n.dataset.elementKind=e.kind,n}function Pe(e){let t=P(e,e.isGhost?`wb-box wb-ghost`:`wb-box`),n=M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:8},`wb-box-outline`);e.lane&&(n.style.stroke=e.lane.hex),t.append(n),e.titleLines.forEach((n,r)=>{t.append(N(n,e.x+j,e.y+ke+r*Ae,`wb-box-title`))});let r=e.y+ke+e.titleLines.length*Ae;if(e.bodyLines.forEach((n,i)=>{let a=e.x+j+(n.muted?Ne:0);t.append(N(n.text,a,r+i*je,n.muted?`wb-box-line wb-muted`:`wb-box-line`))}),!e.lane)return t;let i=e.y+e.height-28,a=Math.min(e.width-24,16+e.lane.label.length*8),o=M(`rect`,{x:e.x+j,y:i,width:a,height:18,rx:9},`wb-lane-pill`);o.style.stroke=e.lane.hex;let s=N(e.lane.label,e.x+j+8,i+13,`wb-lane-pill-text`);return s.style.fill=e.lane.hex,t.append(o,s),t}function Fe(e){let t=P(e,`wb-frame`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12},`wb-frame-outline`),N(e.title,e.x+14,e.y+18,`wb-frame-title`)),t}function Ie(e){let t=P(e,`wb-wire wb-tone-${e.tone}`),n=M(`path`,{d:e.path},`wb-wire-hit`),r=M(`path`,{d:e.path,"marker-end":`url(#wb-arrow)`},e.isDashed?`wb-wire-line wb-dashed`:`wb-wire-line`);return e.strokeHex&&(r.style.stroke=e.strokeHex),t.append(n,r,M(`circle`,{cx:e.start.x,cy:e.start.y,r:3},`wb-wire-dot`)),e.label&&t.append(N(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),t}function Le(e){let t=P(e,e.isResolved?`wb-note wb-resolved`:`wb-note`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:4},`wb-note-card`)),e.lines.forEach((n,r)=>{t.append(N(n,e.x+10,e.y+22+r*Me,`wb-note-text`))}),e.byline&&t.append(N(e.byline,e.x+10,e.y+22+e.lines.length*Me,`wb-note-byline`)),t}var Re={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},ze=[`box`,`frame`,`wire`,`note`];function Be(e){switch(e.kind){case`box`:return Pe(e);case`frame`:return Fe(e);case`wire`:return Ie(e);case`note`:return Le(e)}}function Ve(e){let t=M(`g`,{},`wb-chrome`);for(let n of e.columns)n.title&&t.append(N(n.title,n.x,56,`wb-column-title`),M(`line`,{x1:n.x,y1:66,x2:n.x+n.width,y2:66},`wb-column-rule`));for(let n of e.legend){let e=M(`rect`,{x:n.x,y:n.y,width:14,height:14,rx:3},`wb-legend-swatch`);e.style.fill=n.hex,t.append(e,N(n.label,n.x+22,n.y+12,`wb-legend-text`))}return e.caption&&t.append(N(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),t}function He(){let e=M(`defs`),t=M(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`});return t.append(M(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})),e.append(t),e}function Ue(e){let t={frames:M(`g`,{},`wb-layer`),wires:M(`g`,{},`wb-layer`),boxes:M(`g`,{},`wb-layer`),notes:M(`g`,{},`wb-layer`)},n=M(`g`);e.replaceChildren(He(),n,t.frames,t.wires,t.boxes,t.notes);let r=new Map,i=null,a=new Set;function o(e,t){t.classList.toggle(`is-selected`,a.has(e))}function s(e){let a=Ee(e),s=Ve(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=De(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Be(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[Re[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 c(e){if(!(e instanceof Element))return null;let t=e.closest(`.wb-element`),n=t?.dataset.elementId,r=ze.find(e=>e===t?.dataset.elementKind);return!n||!r?null:{id:n,kind:r}}function l(e){a=e;for(let[e,t]of r)o(e,t.node)}function u(){for(let e of r.values())e.node.remove();r.clear();let e=M(`g`);n.replaceWith(e),n=e,i=null}return{render:s,layout:()=>i,elementFromTarget:c,nodeOf:e=>r.get(e)?.node??null,setSelection:l,clear:u}}var We=`http://www.w3.org/2000/svg`,Ge=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Ke=`Pick a board above.`,F=null,I=null,L=null,R=null,qe=!0,z=null,B=i(`action-status wb-status`),V=i(`action-status wb-status`);function H(e){let{dialog:n,close:r,actions:i,btnCancel:a}=o({title:e.title}),s=t(`input`,`dialog-input`);s.type=`text`,s.placeholder=e.placeholder,s.maxLength=e.maxLength,s.value=e.initialValue??``,s.autocomplete=`off`,s.setAttribute(`aria-label`,e.label);let c=t(`div`,`dialog-error`);c.setAttribute(`role`,`alert`);let l=e.choices?t(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let n of e.choices.options){let e=t(`option`,null,n.text);e.value=n.value,l.append(e)}}let u=t(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,i.append(u),n.append(t(`label`,`dialog-label`,e.label),s,...l?[l]:[],c,i);async function d(){let t=s.value.trim();if(!t){c.textContent=`${e.label} is empty.`;return}u.disabled=!0;let n=await e.onSubmit(t,l?.value??null);u.disabled=!1,n?c.textContent=n:r()}a.addEventListener(`click`,r),u.addEventListener(`click`,()=>void d()),s.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>s.focus())}function U(){return F?m(F):null}function W(){return s().find(e=>e.id===F)??null}async function Je(e){if(!F||e.length===0)return!1;let t=await g(F,e);return t.ok?(B.clear(),!0):(B.show(`error`,t.error),!1)}async function G(e){if(!F)return`No board is open.`;let t=await g(F,e);return t.ok?null:t.error}function K(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=U();return[...R?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!I)return;let e=U(),t=q(`box`).length,n=R?.selectedIds().size??0;I.buttons.box.disabled=!e,I.buttons.wire.disabled=t!==2,I.buttons.note.disabled=t!==1,I.buttons.frame.disabled=t===0,I.buttons.fit.disabled=!e,I.buttons.remove.disabled=!e,I.toolbar.dataset.selectedCount=String(n)}function Y(){if(!I)return;let e=s();F&&!e.some(e=>e.id===F)&&(F=null),!F&&e[0]&&Q(e[0].id),I.list.replaceChildren(...e.map(e=>{let n=t(`button`,`wb-board-tab`,e.title);return n.type=`button`,n.setAttribute(`aria-pressed`,String(e.id===F)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Q(e.id)),n})),Ye()}function Ye(){if(!I)return;let e=W(),n=s().length>0;I.boardHead.hidden=!e,I.canvas.hidden=!e,I.empty.hidden=!!e,I.empty.textContent=n?Ke:Ge,e&&(I.boardTitle.textContent=e.title,I.boardMeta.textContent=`v${e.version}`,I.presence.replaceChildren(...e.connectedSessionIds.map(e=>t(`span`,`wb-presence-pill`,K(e)))),e.connectedSessionIds.length===0&&I.presence.append(t(`span`,`wb-presence-none`,`no sessions connected`)),J(),X())}function Xe(e,t){let n=K(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 X(){if(!I||!z)return;let e=W();I.dockQueued.textContent=Xe(e,z),I.sendToAgent.disabled=!e?.connectedSessionIds.includes(z)}async function Ze(){if(!I||!F||!z)return;I.sendToAgent.disabled=!0,V.show(`busy`,`sending`);let e=await p(F,z);X(),e.ok?V.show(`ok`,`sent; the agent reads the board when it is ready`):V.show(`error`,e.error)}function Z(){if(!L)return;let e=U();e?(L.render(e),R?.pruneSelection(e),qe&&=(R?.fit(),!1),J()):L.clear()}function Q(e){F!==e&&(F=e,qe=!0,R?.clearSelection(),R?.closeTitleInput(),L?.clear(),B.clear(),Y(),c(e).then(Z))}function Qe(){let t=U();if(!t)return;let n=q(`box`)[0],r=t.columns.map(e=>({value:e.id,text:e.title||e.id})),i=n?.column;i&&r.sort((e,t)=>Number(t.value===i)-Number(e.value===i)),H({title:`Add a box`,label:`Box title`,placeholder:`parse the feed`,maxLength:e.title,confirmLabel:`Add box`,choices:r.length>1?{label:`Column`,options:r}:void 0,onSubmit:(e,t)=>G([{op:`add`,element:{kind:`box`,id:x(`box`),title:e,column:t??r[0]?.value??`main`,lines:[],lane:null,ghost:!1,order:0,at:null}}])})}function $e(t){H({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>G([{op:`add`,element:{kind:`note`,id:x(`note`),on:t,text:e,author:``,resolvedBy:null}}])})}function et(){let[e,t]=q(`box`);e&&t&&(R?.clearSelection(),Je([{op:`add`,element:{kind:`wire`,id:x(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function tt(){let t=q(`box`).map(e=>e.id);t.length!==0&&H({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await G([{op:`add`,element:{kind:`frame`,id:x(`frame`),title:e,contains:t}}]);return n||R?.clearSelection(),n}})}function nt(){let e=W();if(!e)return;let t=e.connectedSessionIds.map(K),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;a({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{_(e.id).then(e=>{e.ok||B.show(`error`,e.error)})}})}function rt(){H({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await d(e);return t.ok?(Q(t.boardId),null):t.error}})}function $(e,n,r=``){let i=t(`button`,`wb-button ${r}`.trim(),e);return i.type=`button`,i.addEventListener(`click`,n),i}function it(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,rt));let i=t(`div`,`wb-board-head`),a=t(`div`,`wb-title-row`),o=t(`h2`,`wb-board-title`),s=t(`span`,`wb-board-meta`),c=t(`div`,`wb-presence`);a.append(o,s,c);let l=t(`div`,`wb-toolbar`),u={box:$(`box`,Qe),wire:$(`wire`,et),note:$(`note`,()=>{let[e]=q(`box`);e&&$e(e.id)}),frame:$(`frame`,tt),fit:$(`fit`,()=>R?.fit()),remove:$(`delete board`,nt,`wb-button-danger`)};u.fit.dataset.phoneVisible=``,l.append(u.box,u.wire,u.note,u.frame,u.fit,u.remove,B.element),i.append(a,l);let d=t(`div`,`wb-canvas`),p=document.createElementNS(We,`svg`);p.setAttribute(`class`,`wb-svg`),p.setAttribute(`role`,`img`),p.setAttribute(`aria-label`,`Whiteboard`),p.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),d.append(p);let m=t(`p`,`wb-empty`,Ge),g=t(`div`,`wb-dock`);g.hidden=!0;let _=t(`span`,`wb-dock-queued`),v=$(`send to agent`,()=>void Ze()),y=t(`div`,`wb-dock-bar`);y.append(_,v,V.element),g.append(y),e.replaceChildren(n,i,d,m,g),I={list:r,boardHead:i,boardTitle:o,boardMeta:s,presence:c,toolbar:l,canvas:d,empty:m,dock:g,dockQueued:_,sendToAgent:v,buttons:u};let b=Ue(p);L=b,R=ie({svg:p,canvas:d,renderer:b,currentBoard:U,sendOps:Je,onSelectionChange:J,onPhoneTapBox:$e}),f(Y),h(e=>{e===F&&Z()}),Y()}function at(){return document.documentElement.dataset.layout===`phone`}function ot(){z&&y()===z&&l(),z=null,I&&(I.dock.hidden=!0)}function st(e){if(!I||at())return;let t=r(e);t&&(z=e,I.dock.hidden=!1,V.clear(),X(),v(t,e,I.dock,{className:`wb-docked-card`}))}function ct(){let e=u();e&&(Q(e.boardId),e.dockSessionId&&st(e.dockSessionId)),Y(),F&&c(F).then(Z)}var lt={mount:it,refresh:ct,deactivate:ot};export{lt as view};
|
|
1
|
+
import{Et as e}from"./updates-view-core-BRJGMQQv.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-B_-SHEPp.js";import{i}from"./action-status-ga4k204C.js";import{a,n as o}from"./modal-BRwbyxA2.js";import{$r as s,ai as c,bi as l,ci as u,ei as d,ii as f,ni as p,oi as m,ri as h,si as g,ti as _,vi as v,yi as y}from"./index-BEci_NIV.js";var b=4,ee=200,te=2e4,ne=1.1,re=[`wire`,`note`,`frame`,`box`];function x(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function S(){return document.documentElement.dataset.layout===`phone`}function ie(e){let{svg:n,canvas:r,renderer:i}=e,a=new Map,o=new Set,s={x:0,y:0,width:1e3,height:600},c=null,l=null;function u(){n.setAttribute(`viewBox`,`${s.x} ${s.y} ${s.width} ${s.height}`)}function d(){let e=i.layout();if(!e)return;let{bounds:t}=e,r=n.clientWidth,a=n.clientHeight;if(r===0||a===0){s={...t},u();return}let o=Math.max(1,t.width/r,t.height/a);s={x:t.x,y:t.y,width:r*o,height:a*o},u()}function f(e,t){let r=n.getScreenCTM();if(!r)return{x:e,y:t};let i=new DOMPoint(e,t).matrixTransform(r.inverse());return{x:i.x,y:i.y}}function p(){let e=n.clientWidth||1,t=n.clientHeight||1;return Math.max(s.width/e,s.height/t)}function m(e,t){let n=Math.min(te,Math.max(ee,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},u()}function h(e,t){let n=p();s={...s,x:s.x-e*n,y:s.y-t*n},u()}function g(t){o=t,i.setSelection(o),e.onSelectionChange(o)}function _(e,t){if(!t){g(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),g(n)}function v(e){let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&g(t)}function y(e){let t=i.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function x(){let[e,t]=[...a.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function ie(){c={kind:`pinch`,distance:x(),viewWidth:s.width}}function C(e){if(e.button!==0||l)return;if(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),n.setPointerCapture(e.pointerId),a.size===2){ie();return}let t=i.elementFromTarget(e.target),r=t?.kind===`box`&&!S()?y(t.id):null;if(t&&r){c={kind:`drag`,pointerId:e.pointerId,boxId:t.id,origin:f(e.clientX,e.clientY),start:r,hasMoved:!1,isAdditive:e.shiftKey};return}if(t&&!S()){_(t.id,e.shiftKey);return}let o=t?.kind===`box`?t.id:null;c={kind:`pan`,pointerId:e.pointerId,lastClient:{x:e.clientX,y:e.clientY},hasMoved:!1,tappedBoxId:o}}function w(e,t){let n=f(t.clientX,t.clientY),r=n.x-e.origin.x,a=n.y-e.origin.y;!e.hasMoved&&Math.hypot(r,a)<b*p()||(e.hasMoved=!0,i.nodeOf(e.boxId)?.setAttribute(`transform`,`translate(${r} ${a})`))}function ae(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<b||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},h(n,r))}function oe(e){let t=x();if(t<=0||e.distance<=0)return;let n=[...a.values()];m(f(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 se(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?oe(c):c?.kind===`drag`&&c.pointerId===e.pointerId?w(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&ae(c,e))}async function ce(t,n){if(!t.hasMoved){_(t.boxId,t.isAdditive);return}let r=f(n.clientX,n.clientY),a={x:Math.round(t.start.x+r.x-t.origin.x),y:Math.round(t.start.y+r.y-t.origin.y)};await e.sendOps([{op:`set`,id:t.boxId,fields:{at:a}}])||i.nodeOf(t.boxId)?.removeAttribute(`transform`)}function le(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?ce(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&S()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||g(new Set)))}function ue(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function T(e){e.preventDefault(),e.ctrlKey||e.metaKey?m(f(e.clientX,e.clientY),e.deltaY>0?ne:1/ne):h(-e.deltaX,-e.deltaY)}function E(){let e=l;l=null,e?.remove()}function de(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;E();let c=r.getBoundingClientRect(),u=s.getBoundingClientRect(),d=t(`input`,`wb-title-input`);d.type=`text`,d.value=o.title,d.maxLength=80,d.setAttribute(`aria-label`,`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,r.append(d),d.addEventListener(`keydown`,t=>{if(t.key===`Escape`){t.preventDefault(),E(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();E(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,E),d.focus(),d.select()}function fe(e){if(S())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&de(t.id)}function pe(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=re.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));g(new Set),e.sendOps(r)}function me(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),pe()):e.key===`Escape`&&g(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,C),n.addEventListener(`pointermove`,se),n.addEventListener(`pointerup`,le),n.addEventListener(`pointercancel`,ue),n.addEventListener(`wheel`,T,{passive:!1}),n.addEventListener(`dblclick`,fe),n.addEventListener(`keydown`,me),{fit:d,selectedIds:()=>o,clearSelection:()=>g(new Set),pruneSelection:v,closeTitleInput:E}}var C=40,w=220,ae=90,oe=30,se=20,ce=18,le=20,ue=26,T=18,E=26,de=170,fe=21,pe=17,me=10,D=22,he=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function O(e,t){let n=e.split(/\s+/).filter(Boolean),r=[],i=``;for(let e of n){let n=e.match(RegExp(`.{1,${t}}`,`g`))??[e];for(let e of n){let n=i?`${i} ${e}`:e;n.length<=t?i=n:(r.push(i),i=e)}}return i&&r.push(i),r.length>0?r:[``]}function ge(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:he[n.color]}:null}function _e(e,t){let n=O(t.title,le),r=t.lines.flatMap(e=>O(e.text,ue-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ge(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*se+r.length*ce+(i?26:0)}}function k(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function A(e){return C+e*310}function ve(e){let t=new Map,n=new Map,r=k(e,`box`).map((e,t)=>({box:e,index:t})).sort((e,t)=>e.box.order-t.box.order||e.index-t.index);for(let{box:i}of r){let r=Math.max(0,e.columns.findIndex(e=>e.id===i.column)),a=_e(e,i),o=n.get(i.column)??84,s=i.at??{x:A(r),y:o};i.at||n.set(i.column,o+a.height+oe),t.set(i.id,{kind:`box`,id:i.id,x:s.x,y:s.y,width:w,height:a.height,titleLines:a.titleLines,bodyLines:a.bodyLines,lane:a.lane,isGhost:i.ghost})}return t}function ye(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}function be(e,t){return k(e,`frame`).flatMap(e=>{let n=ye(e.contains.flatMap(e=>t.get(e)??[]));return n?[{kind:`frame`,id:e.id,title:e.title,x:n.x-T,y:n.y-T-E,width:n.width+36,height:n.height+36+E}]:[]})}function xe(e,t){let n=e.x+e.width/2,r=t.x+t.width/2;if(Math.abs(r-n)>e.width/2){let i=r>n,a={x:i?e.x+e.width:e.x,y:e.y+Math.min(e.height/2,40)},o={x:i?t.x:t.x+t.width,y:t.y+Math.min(t.height/2,40)},s=(o.x-a.x)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x+s} ${a.y}, ${o.x-s} ${o.y}, ${o.x} ${o.y}`}}let i=t.y>e.y,a={x:n,y:i?e.y+e.height:e.y},o={x:r,y:i?t.y:t.y+t.height},s=(o.y-a.y)/2;return{start:a,end:o,path:`M ${a.x} ${a.y} C ${a.x} ${a.y+s}, ${o.x} ${o.y-s}, ${o.x} ${o.y}`}}function Se(e,t){return k(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=xe(n,r);return[{kind:`wire`,id:e.id,path:i.path,start:i.start,end:i.end,label:e.label,labelAt:{x:(i.start.x+i.end.x)/2,y:(i.start.y+i.end.y)/2-6},isDashed:e.dashed,tone:e.tone,strokeHex:e.tone===`lane`?n.lane?.hex??null:null}]})}function Ce(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function we(e,t){let n=new Map;return k(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let i=O(e.text,fe),a=24+(i.length+1)*pe,o=n.get(e.on)??r.y-8;return n.set(e.on,o+a+me),[{kind:`note`,id:e.id,x:r.x+r.width-24,y:o,width:de,height:a,lines:i,byline:Ce(e),isResolved:e.resolvedBy!==null}]})}function Te(e,t){let n=e.flatMap(e=>e.kind===`wire`?[]:[e]),r=A(Math.max(1,t))-ae,i=ye([...n,{x:0,y:0,width:r,height:84}]);return i?{x:Math.min(0,i.x-C),y:Math.min(0,i.y-C),width:i.width+80,height:i.height+80}:{x:0,y:0,width:r+C,height:80}}function Ee(e){let t=ve(e),n=[...be(e,t),...Se(e,t),...t.values(),...we(e,t)],r=Te(n,e.columns.length),i=r.y+r.height,a=e.lanes.map((e,t)=>({label:e.label||e.id,hex:he[e.color],x:C,y:i+t*D})),o=i+a.length*D+(a.length>0?12:0),s=e.caption?{text:e.caption,x:C,y:o}:null,c=a.length*D+(s?30:0)+(a.length>0?12:0);return{columns:e.columns.map((e,t)=>({id:e.id,title:e.title,x:A(t),width:w})),elements:n,legend:a,caption:s,bounds:{...r,height:r.height+c}}}function De(e){return JSON.stringify(e)}var Oe=`http://www.w3.org/2000/svg`,j=12,ke=26,Ae=20,je=18,Me=17,Ne=14;function M(e,t={},n=``){let r=document.createElementNS(Oe,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return n&&r.setAttribute(`class`,n),r}function N(e,t,n,r){let i=M(`text`,{x:t,y:n},r);return i.textContent=e,i}function P(e,t){let n=M(`g`,{},`wb-element ${t}`);return n.dataset.elementId=e.id,n.dataset.elementKind=e.kind,n}function Pe(e){let t=P(e,e.isGhost?`wb-box wb-ghost`:`wb-box`),n=M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:8},`wb-box-outline`);e.lane&&(n.style.stroke=e.lane.hex),t.append(n),e.titleLines.forEach((n,r)=>{t.append(N(n,e.x+j,e.y+ke+r*Ae,`wb-box-title`))});let r=e.y+ke+e.titleLines.length*Ae;if(e.bodyLines.forEach((n,i)=>{let a=e.x+j+(n.muted?Ne:0);t.append(N(n.text,a,r+i*je,n.muted?`wb-box-line wb-muted`:`wb-box-line`))}),!e.lane)return t;let i=e.y+e.height-28,a=Math.min(e.width-24,16+e.lane.label.length*8),o=M(`rect`,{x:e.x+j,y:i,width:a,height:18,rx:9},`wb-lane-pill`);o.style.stroke=e.lane.hex;let s=N(e.lane.label,e.x+j+8,i+13,`wb-lane-pill-text`);return s.style.fill=e.lane.hex,t.append(o,s),t}function Fe(e){let t=P(e,`wb-frame`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12},`wb-frame-outline`),N(e.title,e.x+14,e.y+18,`wb-frame-title`)),t}function Ie(e){let t=P(e,`wb-wire wb-tone-${e.tone}`),n=M(`path`,{d:e.path},`wb-wire-hit`),r=M(`path`,{d:e.path,"marker-end":`url(#wb-arrow)`},e.isDashed?`wb-wire-line wb-dashed`:`wb-wire-line`);return e.strokeHex&&(r.style.stroke=e.strokeHex),t.append(n,r,M(`circle`,{cx:e.start.x,cy:e.start.y,r:3},`wb-wire-dot`)),e.label&&t.append(N(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),t}function Le(e){let t=P(e,e.isResolved?`wb-note wb-resolved`:`wb-note`);return t.append(M(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:4},`wb-note-card`)),e.lines.forEach((n,r)=>{t.append(N(n,e.x+10,e.y+22+r*Me,`wb-note-text`))}),e.byline&&t.append(N(e.byline,e.x+10,e.y+22+e.lines.length*Me,`wb-note-byline`)),t}var Re={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},ze=[`box`,`frame`,`wire`,`note`];function Be(e){switch(e.kind){case`box`:return Pe(e);case`frame`:return Fe(e);case`wire`:return Ie(e);case`note`:return Le(e)}}function Ve(e){let t=M(`g`,{},`wb-chrome`);for(let n of e.columns)n.title&&t.append(N(n.title,n.x,56,`wb-column-title`),M(`line`,{x1:n.x,y1:66,x2:n.x+n.width,y2:66},`wb-column-rule`));for(let n of e.legend){let e=M(`rect`,{x:n.x,y:n.y,width:14,height:14,rx:3},`wb-legend-swatch`);e.style.fill=n.hex,t.append(e,N(n.label,n.x+22,n.y+12,`wb-legend-text`))}return e.caption&&t.append(N(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),t}function He(){let e=M(`defs`),t=M(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`});return t.append(M(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})),e.append(t),e}function Ue(e){let t={frames:M(`g`,{},`wb-layer`),wires:M(`g`,{},`wb-layer`),boxes:M(`g`,{},`wb-layer`),notes:M(`g`,{},`wb-layer`)},n=M(`g`);e.replaceChildren(He(),n,t.frames,t.wires,t.boxes,t.notes);let r=new Map,i=null,a=new Set;function o(e,t){t.classList.toggle(`is-selected`,a.has(e))}function s(e){let a=Ee(e),s=Ve(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=De(e),i=r.get(e.id);if(i?.signature===n)continue;let a=Be(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[Re[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 c(e){if(!(e instanceof Element))return null;let t=e.closest(`.wb-element`),n=t?.dataset.elementId,r=ze.find(e=>e===t?.dataset.elementKind);return!n||!r?null:{id:n,kind:r}}function l(e){a=e;for(let[e,t]of r)o(e,t.node)}function u(){for(let e of r.values())e.node.remove();r.clear();let e=M(`g`);n.replaceWith(e),n=e,i=null}return{render:s,layout:()=>i,elementFromTarget:c,nodeOf:e=>r.get(e)?.node??null,setSelection:l,clear:u}}var We=`http://www.w3.org/2000/svg`,Ge=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Ke=`Pick a board above.`,F=null,I=null,L=null,R=null,qe=!0,z=null,B=i(`action-status wb-status`),V=i(`action-status wb-status`);function H(e){let{dialog:n,close:r,actions:i,btnCancel:a}=o({title:e.title}),s=t(`input`,`dialog-input`);s.type=`text`,s.placeholder=e.placeholder,s.maxLength=e.maxLength,s.value=e.initialValue??``,s.autocomplete=`off`,s.setAttribute(`aria-label`,e.label);let c=t(`div`,`dialog-error`);c.setAttribute(`role`,`alert`);let l=e.choices?t(`select`,`dialog-input wb-dialog-select`):null;if(l&&e.choices){l.setAttribute(`aria-label`,e.choices.label);for(let n of e.choices.options){let e=t(`option`,null,n.text);e.value=n.value,l.append(e)}}let u=t(`button`,`btn-dialog btn-dialog-confirm`,e.confirmLabel);u.type=`button`,i.append(u),n.append(t(`label`,`dialog-label`,e.label),s,...l?[l]:[],c,i);async function d(){let t=s.value.trim();if(!t){c.textContent=`${e.label} is empty.`;return}u.disabled=!0;let n=await e.onSubmit(t,l?.value??null);u.disabled=!1,n?c.textContent=n:r()}a.addEventListener(`click`,r),u.addEventListener(`click`,()=>void d()),s.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),d())}),requestAnimationFrame(()=>s.focus())}function U(){return F?m(F):null}function W(){return s().find(e=>e.id===F)??null}async function Je(e){if(!F||e.length===0)return!1;let t=await g(F,e);return t.ok?(B.clear(),!0):(B.show(`error`,t.error),!1)}async function G(e){if(!F)return`No board is open.`;let t=await g(F,e);return t.ok?null:t.error}function K(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=U();return[...R?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!I)return;let e=U(),t=q(`box`).length,n=R?.selectedIds().size??0;I.buttons.box.disabled=!e,I.buttons.wire.disabled=t!==2,I.buttons.note.disabled=t!==1,I.buttons.frame.disabled=t===0,I.buttons.fit.disabled=!e,I.buttons.remove.disabled=!e,I.toolbar.dataset.selectedCount=String(n)}function Y(){if(!I)return;let e=s();F&&!e.some(e=>e.id===F)&&(F=null),!F&&e[0]&&Q(e[0].id),I.list.replaceChildren(...e.map(e=>{let n=t(`button`,`wb-board-tab`,e.title);return n.type=`button`,n.setAttribute(`aria-pressed`,String(e.id===F)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Q(e.id)),n})),Ye()}function Ye(){if(!I)return;let e=W(),n=s().length>0;I.boardHead.hidden=!e,I.canvas.hidden=!e,I.empty.hidden=!!e,I.empty.textContent=n?Ke:Ge,e&&(I.boardTitle.textContent=e.title,I.boardMeta.textContent=`v${e.version}`,I.presence.replaceChildren(...e.connectedSessionIds.map(e=>t(`span`,`wb-presence-pill`,K(e)))),e.connectedSessionIds.length===0&&I.presence.append(t(`span`,`wb-presence-none`,`no sessions connected`)),J(),X())}function Xe(e,t){let n=K(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 X(){if(!I||!z)return;let e=W();I.dockQueued.textContent=Xe(e,z),I.sendToAgent.disabled=!e?.connectedSessionIds.includes(z)}async function Ze(){if(!I||!F||!z)return;I.sendToAgent.disabled=!0,V.show(`busy`,`sending`);let e=await p(F,z);X(),e.ok?V.show(`ok`,`sent; the agent reads the board when it is ready`):V.show(`error`,e.error)}function Z(){if(!L)return;let e=U();e?(L.render(e),R?.pruneSelection(e),qe&&=(R?.fit(),!1),J()):L.clear()}function Q(e){F!==e&&(F=e,qe=!0,R?.clearSelection(),R?.closeTitleInput(),L?.clear(),B.clear(),Y(),c(e).then(Z))}function Qe(){let t=U();if(!t)return;let n=q(`box`)[0],r=t.columns.map(e=>({value:e.id,text:e.title||e.id})),i=n?.column;i&&r.sort((e,t)=>Number(t.value===i)-Number(e.value===i)),H({title:`Add a box`,label:`Box title`,placeholder:`parse the feed`,maxLength:e.title,confirmLabel:`Add box`,choices:r.length>1?{label:`Column`,options:r}:void 0,onSubmit:(e,t)=>G([{op:`add`,element:{kind:`box`,id:x(`box`),title:e,column:t??r[0]?.value??`main`,lines:[],lane:null,ghost:!1,order:0,at:null}}])})}function $e(t){H({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>G([{op:`add`,element:{kind:`note`,id:x(`note`),on:t,text:e,author:``,resolvedBy:null}}])})}function et(){let[e,t]=q(`box`);e&&t&&(R?.clearSelection(),Je([{op:`add`,element:{kind:`wire`,id:x(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function tt(){let t=q(`box`).map(e=>e.id);t.length!==0&&H({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await G([{op:`add`,element:{kind:`frame`,id:x(`frame`),title:e,contains:t}}]);return n||R?.clearSelection(),n}})}function nt(){let e=W();if(!e)return;let t=e.connectedSessionIds.map(K),n=t.length>0?` ${t.join(`, `)} ${t.length===1?`is`:`are`} connected and will lose it.`:``;a({title:`Delete board`,message:`Delete "${e.title}" for good?${n}`,confirmLabel:`Delete board`,danger:!0,onConfirm:()=>{_(e.id).then(e=>{e.ok||B.show(`error`,e.error)})}})}function rt(){H({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await d(e);return t.ok?(Q(t.boardId),null):t.error}})}function $(e,n,r=``){let i=t(`button`,`wb-button ${r}`.trim(),e);return i.type=`button`,i.addEventListener(`click`,n),i}function it(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,rt));let i=t(`div`,`wb-board-head`),a=t(`div`,`wb-title-row`),o=t(`h2`,`wb-board-title`),s=t(`span`,`wb-board-meta`),c=t(`div`,`wb-presence`);a.append(o,s,c);let l=t(`div`,`wb-toolbar`),u={box:$(`box`,Qe),wire:$(`wire`,et),note:$(`note`,()=>{let[e]=q(`box`);e&&$e(e.id)}),frame:$(`frame`,tt),fit:$(`fit`,()=>R?.fit()),remove:$(`delete board`,nt,`wb-button-danger`)};u.fit.dataset.phoneVisible=``,l.append(u.box,u.wire,u.note,u.frame,u.fit,u.remove,B.element),i.append(a,l);let d=t(`div`,`wb-canvas`),p=document.createElementNS(We,`svg`);p.setAttribute(`class`,`wb-svg`),p.setAttribute(`role`,`img`),p.setAttribute(`aria-label`,`Whiteboard`),p.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),d.append(p);let m=t(`p`,`wb-empty`,Ge),g=t(`div`,`wb-dock`);g.hidden=!0;let _=t(`span`,`wb-dock-queued`),v=$(`send to agent`,()=>void Ze()),y=t(`div`,`wb-dock-bar`);y.append(_,v,V.element),g.append(y),e.replaceChildren(n,i,d,m,g),I={list:r,boardHead:i,boardTitle:o,boardMeta:s,presence:c,toolbar:l,canvas:d,empty:m,dock:g,dockQueued:_,sendToAgent:v,buttons:u};let b=Ue(p);L=b,R=ie({svg:p,canvas:d,renderer:b,currentBoard:U,sendOps:Je,onSelectionChange:J,onPhoneTapBox:$e}),f(Y),h(e=>{e===F&&Z()}),Y()}function at(){return document.documentElement.dataset.layout===`phone`}function ot(){z&&y()===z&&l(),z=null,I&&(I.dock.hidden=!0)}function st(e){if(!I||at())return;let t=r(e);t&&(z=e,I.dock.hidden=!1,V.clear(),X(),v(t,e,I.dock,{className:`wb-docked-card`}))}function ct(){let e=u();e&&(Q(e.boardId),e.dockSessionId&&st(e.dockSessionId)),Y(),F&&c(F).then(Z)}var lt={mount:it,refresh:ct,deactivate:ot};export{lt as view};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e}from"./updates-view-core-
|
|
1
|
+
import{St as e}from"./updates-view-core-BRJGMQQv.js";import{E as t}from"./dom-helpers-I_SDCPvs.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
|