glimmervoid 0.47.1-next.272 → 0.47.1-next.273
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-DITfORRS.js → adapters-DcwRo2fV.js} +2 -2
- package/dist/chunks/{adapters-BAeNn1N8.js → adapters-QUBXYjbH.js} +1 -1
- package/dist/chunks/{agent-api-cli-CDlBEZ-m.js → agent-api-cli--nJMofLP.js} +1 -1
- package/dist/chunks/{agent-api-cli-CPFPWGYG.js → agent-api-cli-B_OTr5Cp.js} +1 -1
- package/dist/chunks/{agent-api-core-CdeCJSCl.js → agent-api-core-BipDiqDd.js} +1 -1
- package/dist/chunks/{build-channel-DUJlHlln.js → build-channel-Bb1UxirK.js} +1 -1
- package/dist/chunks/{config-Byp_kTrB.js → config-dOHB_JFL.js} +10 -0
- package/dist/chunks/config-store--tbftl7x.js +1 -0
- package/dist/chunks/{config-store-DRnRNAu2.js → config-store-C9Lzp45n.js} +2 -2
- package/dist/chunks/{main-BegbId4v.js → main-DeTCq5B-.js} +62 -25
- package/dist/chunks/{pair-cli-Dea77yxA.js → pair-cli-M6AiZRrZ.js} +2 -2
- package/dist/chunks/{remote-config-xPfBcgxJ.js → remote-config-CNYblswW.js} +1 -1
- package/dist/chunks/{settings-cli-CJAc4b46.js → settings-cli-DzFabgtv.js} +4 -4
- package/dist/chunks/{settings-readout-core-CAjbpFN9.js → settings-readout-core-D8BsUdQv.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-Df8iuzoP.js → ssh-sign-cli-DxC8c7i0.js} +1 -1
- package/dist/client/assets/{action-status-Q3My48SZ.js → action-status-CFs1QbL1.js} +1 -1
- package/dist/client/assets/action-status-CFs1QbL1.js.br +0 -0
- package/dist/client/assets/{alert-sound-sQwltUHs.js → alert-sound-BhXP7za7.js} +1 -1
- package/dist/client/assets/alert-sound-BhXP7za7.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-ClkzB5J_.js → benchmark-panel-ClJfbjsT.js} +1 -1
- package/dist/client/assets/benchmark-panel-ClJfbjsT.js.br +0 -0
- package/dist/client/assets/{boards-view-DjxRAvJv.js → boards-view-W_j0tZ9i.js} +1 -1
- package/dist/client/assets/boards-view-W_j0tZ9i.js.br +0 -0
- package/dist/client/assets/{card-registry-6swWMEbb.js → card-registry-CAKEvh7s.js} +1 -1
- package/dist/client/assets/card-registry-CAKEvh7s.js.br +0 -0
- package/dist/client/assets/{celebration-player-CJjOTEfD.js → celebration-player-Bsf_0S82.js} +1 -1
- package/dist/client/assets/celebration-player-Bsf_0S82.js.br +0 -0
- package/dist/client/assets/{community-panel-C63ySar_.js → community-panel-CmFBW41c.js} +1 -1
- package/dist/client/assets/community-panel-CmFBW41c.js.br +0 -0
- package/dist/client/assets/{control-ws-DlAuOMSj.js → control-ws-JQwKvf3M.js} +1 -1
- package/dist/client/assets/control-ws-JQwKvf3M.js.br +0 -0
- package/dist/client/assets/{dialogs-BwUabV94.js → dialogs-K3f_w-z8.js} +1 -1
- package/dist/client/assets/dialogs-K3f_w-z8.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-DzanvPdY.js → doc-editor-ui-B5ZTre9I.js} +1 -1
- package/dist/client/assets/doc-editor-ui-B5ZTre9I.js.br +0 -0
- package/dist/client/assets/{feature-hint-f-SPi6VY.js → feature-hint-Bam3yyYA.js} +1 -1
- package/dist/client/assets/feature-hint-Bam3yyYA.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-BXUeIwOs.js → first-run-checklist-CJAAZ-sv.js} +1 -1
- package/dist/client/assets/first-run-checklist-CJAAZ-sv.js.br +0 -0
- package/dist/client/assets/{hooks-panel-CeMaQH3Q.js → hooks-panel-CpSUbwsV.js} +1 -1
- package/dist/client/assets/hooks-panel-CpSUbwsV.js.br +0 -0
- package/dist/client/assets/{index-DM-gGzvj.js → index-9rftyVvQ.js} +5 -5
- package/dist/client/assets/index-9rftyVvQ.js.br +0 -0
- package/dist/client/assets/{issues-panel-Cw11Qq7L.js → issues-panel-DgqQXEcw.js} +1 -1
- package/dist/client/assets/issues-panel-DgqQXEcw.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-DeTV3dg1.js → my-prs-panel-Aq9Kd_y4.js} +1 -1
- package/dist/client/assets/my-prs-panel-Aq9Kd_y4.js.br +0 -0
- package/dist/client/assets/{nyan-cat-DbtMS6gP.js → nyan-cat-C5mNxOmJ.js} +1 -1
- package/dist/client/assets/nyan-cat-C5mNxOmJ.js.br +0 -0
- package/dist/client/assets/{phone-shell-Bv0ffBXT.js → phone-shell-D4AjC8Ar.js} +1 -1
- package/dist/client/assets/phone-shell-D4AjC8Ar.js.br +0 -0
- package/dist/client/assets/{plan-face-CR3CvO6c.js → plan-face-BtfNqk8S.js} +1 -1
- package/dist/client/assets/plan-face-BtfNqk8S.js.br +0 -0
- package/dist/client/assets/{plan-render-7_E-Oicq.js → plan-render-BnvLPI0_.js} +1 -1
- package/dist/client/assets/plan-render-BnvLPI0_.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-wuLFnqa3.js → pr-queue-columns-Cd2eCXsi.js} +1 -1
- package/dist/client/assets/pr-queue-columns-Cd2eCXsi.js.br +0 -0
- package/dist/client/assets/{radar-panel-qNF-RdbV.js → radar-panel-CKCQyiSO.js} +1 -1
- package/dist/client/assets/radar-panel-CKCQyiSO.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-Cg_Y-RMO.js → repo-roots-adder-DvAu4J4p.js} +1 -1
- package/dist/client/assets/repo-roots-adder-DvAu4J4p.js.br +0 -0
- package/dist/client/assets/{resume-dialog-rrgCY9BN.js → resume-dialog-DUBKheLe.js} +1 -1
- package/dist/client/assets/resume-dialog-DUBKheLe.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-BQ8PIfe0.js → review-queue-panel-8eoAI6JG.js} +1 -1
- package/dist/client/assets/review-queue-panel-8eoAI6JG.js.br +0 -0
- package/dist/client/assets/{session-tick-APifklqr.js → session-tick-WymMvq8f.js} +1 -1
- package/dist/client/assets/session-tick-WymMvq8f.js.br +0 -0
- package/dist/client/assets/{settings-panel-DZvd2v9t.js → settings-panel-Bi_u_Bb5.js} +2 -2
- package/dist/client/assets/settings-panel-Bi_u_Bb5.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-DTMRCR2g.js → shown-lightbox-DFzVd-Hy.js} +1 -1
- package/dist/client/assets/shown-lightbox-DFzVd-Hy.js.br +0 -0
- package/dist/client/assets/{team-review-panel-Ypb-G0xF.js → team-review-panel-BztgJRoJ.js} +1 -1
- package/dist/client/assets/team-review-panel-BztgJRoJ.js.br +0 -0
- package/dist/client/assets/{trace-panel-CHQz9e3S.js → trace-panel-ZOL3D2-z.js} +1 -1
- package/dist/client/assets/trace-panel-ZOL3D2-z.js.br +0 -0
- package/dist/client/assets/{updates-view-core-CMBoSmN6.js → updates-view-core-C0bHpz-K.js} +1 -1
- package/dist/client/assets/updates-view-core-C0bHpz-K.js.br +0 -0
- package/dist/client/assets/{usage-panel-DGACjttt.js → usage-panel-CtEMtAdC.js} +1 -1
- package/dist/client/assets/usage-panel-CtEMtAdC.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-CE9Vyqpb.js +0 -1
- package/dist/client/assets/action-status-Q3My48SZ.js.br +0 -0
- package/dist/client/assets/alert-sound-sQwltUHs.js.br +0 -0
- package/dist/client/assets/benchmark-panel-ClkzB5J_.js.br +0 -0
- package/dist/client/assets/boards-view-DjxRAvJv.js.br +0 -0
- package/dist/client/assets/card-registry-6swWMEbb.js.br +0 -0
- package/dist/client/assets/celebration-player-CJjOTEfD.js.br +0 -0
- package/dist/client/assets/community-panel-C63ySar_.js.br +0 -0
- package/dist/client/assets/control-ws-DlAuOMSj.js.br +0 -0
- package/dist/client/assets/dialogs-BwUabV94.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-DzanvPdY.js.br +0 -0
- package/dist/client/assets/feature-hint-f-SPi6VY.js.br +0 -0
- package/dist/client/assets/first-run-checklist-BXUeIwOs.js.br +0 -0
- package/dist/client/assets/hooks-panel-CeMaQH3Q.js.br +0 -0
- package/dist/client/assets/index-DM-gGzvj.js.br +0 -0
- package/dist/client/assets/issues-panel-Cw11Qq7L.js.br +0 -0
- package/dist/client/assets/my-prs-panel-DeTV3dg1.js.br +0 -0
- package/dist/client/assets/nyan-cat-DbtMS6gP.js.br +0 -0
- package/dist/client/assets/phone-shell-Bv0ffBXT.js.br +0 -0
- package/dist/client/assets/plan-face-CR3CvO6c.js.br +0 -0
- package/dist/client/assets/plan-render-7_E-Oicq.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-wuLFnqa3.js.br +0 -0
- package/dist/client/assets/radar-panel-qNF-RdbV.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-Cg_Y-RMO.js.br +0 -0
- package/dist/client/assets/resume-dialog-rrgCY9BN.js.br +0 -0
- package/dist/client/assets/review-queue-panel-BQ8PIfe0.js.br +0 -0
- package/dist/client/assets/session-tick-APifklqr.js.br +0 -0
- package/dist/client/assets/settings-panel-DZvd2v9t.js.br +0 -0
- package/dist/client/assets/shown-lightbox-DTMRCR2g.js.br +0 -0
- package/dist/client/assets/team-review-panel-Ypb-G0xF.js.br +0 -0
- package/dist/client/assets/trace-panel-CHQz9e3S.js.br +0 -0
- package/dist/client/assets/updates-view-core-CMBoSmN6.js.br +0 -0
- package/dist/client/assets/usage-panel-DGACjttt.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-LaezpMjH.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-BipDiqDd.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-mgNrPS_T.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-M6AiZRrZ.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-DzFabgtv.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-DxC8c7i0.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--nJMofLP.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--nJMofLP.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--tbftl7x.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-QUBXYjbH.js");
|
|
226
226
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
227
227
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
228
228
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -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-LaezpMjH.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-dOHB_JFL.js";
|
|
6
6
|
import { o as supervisionLine } from "./session-routes-BI0tGQK3.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-_6BJOcD7.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-CSv-mF18.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-Bb1UxirK.js";
|
|
15
15
|
import { n as buildAgentSpawnCommand, r as resolveAgentCommand, t as kimi } from "./kimi-BzThbk8K.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 { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-
|
|
1
|
+
export { a as describeAgentResolvability, l as listAgentIds, f as setCustomAgents } from "./adapters-DcwRo2fV.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-B_OTr5Cp.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-LaezpMjH.js";
|
|
2
2
|
import { i as formatSessionLimits } from "./session-routes-BI0tGQK3.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-BipDiqDd.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-CcqYb-Ge.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-LaezpMjH.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-dOHB_JFL.js";
|
|
3
3
|
import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-BI0tGQK3.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import crypto from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./session-LaezpMjH.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-dOHB_JFL.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"]);
|
|
@@ -1860,6 +1860,16 @@ var clientVariants = [
|
|
|
1860
1860
|
boardId: Board.shape.id,
|
|
1861
1861
|
requestId
|
|
1862
1862
|
}),
|
|
1863
|
+
loose("whiteboard-connect", {
|
|
1864
|
+
boardId: Board.shape.id,
|
|
1865
|
+
sessionId: z.string().min(1),
|
|
1866
|
+
requestId
|
|
1867
|
+
}),
|
|
1868
|
+
loose("whiteboard-disconnect", {
|
|
1869
|
+
boardId: Board.shape.id,
|
|
1870
|
+
sessionId: z.string().min(1),
|
|
1871
|
+
requestId
|
|
1872
|
+
}),
|
|
1863
1873
|
loose("save-hook", {
|
|
1864
1874
|
hook: z.record(z.string(), z.unknown()),
|
|
1865
1875
|
requestId
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c as loadConfigFile } from "./config-store-C9Lzp45n.js";
|
|
@@ -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-dOHB_JFL.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-Bb1UxirK.js";
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import os from "node:os";
|
|
@@ -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-LaezpMjH.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-dOHB_JFL.js";
|
|
8
8
|
import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-BI0tGQK3.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-BipDiqDd.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-mgNrPS_T.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-CcqYb-Ge.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-C9Lzp45n.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-Bb1UxirK.js";
|
|
22
22
|
import { i as resolveArgvCommandMatches } from "./kimi-BzThbk8K.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-DcwRo2fV.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-CNYblswW.js";
|
|
28
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-D8BsUdQv.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";
|
|
@@ -4386,6 +4386,26 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
|
|
|
4386
4386
|
}
|
|
4387
4387
|
};
|
|
4388
4388
|
}
|
|
4389
|
+
function connectBoard(boardId, sessionId) {
|
|
4390
|
+
return changeRecord(boardId, (record) => {
|
|
4391
|
+
const next = connectSession(record, sessionId);
|
|
4392
|
+
return {
|
|
4393
|
+
ok: true,
|
|
4394
|
+
record: next,
|
|
4395
|
+
reply: connectionReply(next, PUT_GUIDE)
|
|
4396
|
+
};
|
|
4397
|
+
});
|
|
4398
|
+
}
|
|
4399
|
+
function disconnectBoard(boardId, sessionId) {
|
|
4400
|
+
return changeRecord(boardId, (record) => {
|
|
4401
|
+
const next = disconnectSession(record, sessionId);
|
|
4402
|
+
return {
|
|
4403
|
+
ok: true,
|
|
4404
|
+
record: next,
|
|
4405
|
+
reply: connectionReply(next, "this session no longer gets summaries of changes to this board")
|
|
4406
|
+
};
|
|
4407
|
+
});
|
|
4408
|
+
}
|
|
4389
4409
|
function removeBoard(boardId) {
|
|
4390
4410
|
return writeQueue.run(boardId, async () => {
|
|
4391
4411
|
const current = recordsByBoardId.get(boardId);
|
|
@@ -4436,8 +4456,15 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
|
|
|
4436
4456
|
changes: []
|
|
4437
4457
|
}
|
|
4438
4458
|
};
|
|
4439
|
-
})
|
|
4459
|
+
}),
|
|
4460
|
+
connect: (boardId, sessionId) => operatorBoardCommand(boardId, (foundBoardId) => connectBoard(foundBoardId, sessionId)),
|
|
4461
|
+
disconnect: (boardId, sessionId) => operatorBoardCommand(boardId, (foundBoardId) => disconnectBoard(foundBoardId, sessionId))
|
|
4440
4462
|
};
|
|
4463
|
+
async function forgetSession(sessionId) {
|
|
4464
|
+
await loaded;
|
|
4465
|
+
const connectedBoardIds = [...recordsByBoardId].filter(([, record]) => sessionId in record.cursorBySessionId).map(([boardId]) => boardId);
|
|
4466
|
+
await Promise.all(connectedBoardIds.map((boardId) => disconnectBoard(boardId, sessionId)));
|
|
4467
|
+
}
|
|
4441
4468
|
async function handleAgent(caller, request) {
|
|
4442
4469
|
await loaded;
|
|
4443
4470
|
if (request.sub === "new") return createBoardFor(caller, request.title);
|
|
@@ -4455,22 +4482,8 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
|
|
|
4455
4482
|
name: caller.name
|
|
4456
4483
|
};
|
|
4457
4484
|
switch (request.sub) {
|
|
4458
|
-
case "connect": return
|
|
4459
|
-
|
|
4460
|
-
return {
|
|
4461
|
-
ok: true,
|
|
4462
|
-
record: next,
|
|
4463
|
-
reply: connectionReply(next, PUT_GUIDE)
|
|
4464
|
-
};
|
|
4465
|
-
});
|
|
4466
|
-
case "disconnect": return changeRecord(found.boardId, (record) => {
|
|
4467
|
-
const next = disconnectSession(record, caller.id);
|
|
4468
|
-
return {
|
|
4469
|
-
ok: true,
|
|
4470
|
-
record: next,
|
|
4471
|
-
reply: connectionReply(next, "this session no longer gets summaries of changes to this board")
|
|
4472
|
-
};
|
|
4473
|
-
});
|
|
4485
|
+
case "connect": return connectBoard(found.boardId, caller.id);
|
|
4486
|
+
case "disconnect": return disconnectBoard(found.boardId, caller.id);
|
|
4474
4487
|
case "get": return readBoard(found.boardId, caller.id);
|
|
4475
4488
|
case "put": return putOps(found.boardId, request.ops, author);
|
|
4476
4489
|
case "resolve": return putOps(found.boardId, [{
|
|
@@ -4483,6 +4496,7 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
|
|
|
4483
4496
|
loaded,
|
|
4484
4497
|
handleAgent,
|
|
4485
4498
|
handleOperator,
|
|
4499
|
+
forgetSession,
|
|
4486
4500
|
snapshotMessage
|
|
4487
4501
|
};
|
|
4488
4502
|
}
|
|
@@ -44727,6 +44741,18 @@ function requestValidationErrorReply(msg, message) {
|
|
|
44727
44741
|
ok: false,
|
|
44728
44742
|
error: message
|
|
44729
44743
|
}),
|
|
44744
|
+
"whiteboard-connect": () => ({
|
|
44745
|
+
type: "whiteboard-result",
|
|
44746
|
+
requestId,
|
|
44747
|
+
ok: false,
|
|
44748
|
+
error: message
|
|
44749
|
+
}),
|
|
44750
|
+
"whiteboard-disconnect": () => ({
|
|
44751
|
+
type: "whiteboard-result",
|
|
44752
|
+
requestId,
|
|
44753
|
+
ok: false,
|
|
44754
|
+
error: message
|
|
44755
|
+
}),
|
|
44730
44756
|
"save-hook": () => ({
|
|
44731
44757
|
type: "save-hook-result",
|
|
44732
44758
|
requestId,
|
|
@@ -46585,6 +46611,14 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
46585
46611
|
"whiteboard-op": (msg, ws) => answerWhiteboard(ws, msg, (port) => port.put(msg.boardId, msg.ops)),
|
|
46586
46612
|
"whiteboard-delete": (msg, ws) => answerWhiteboard(ws, msg, (port) => port.remove(msg.boardId)),
|
|
46587
46613
|
"whiteboard-get": (msg, ws) => answerWhiteboard(ws, msg, (port) => port.get(msg.boardId)),
|
|
46614
|
+
"whiteboard-connect": (msg, ws) => answerWhiteboard(ws, msg, async (port) => {
|
|
46615
|
+
if (!findSession({ id: msg.sessionId })) return {
|
|
46616
|
+
ok: false,
|
|
46617
|
+
error: "That session is no longer on the dashboard."
|
|
46618
|
+
};
|
|
46619
|
+
return port.connect(msg.boardId, msg.sessionId);
|
|
46620
|
+
}),
|
|
46621
|
+
"whiteboard-disconnect": (msg, ws) => answerWhiteboard(ws, msg, (port) => port.disconnect(msg.boardId, msg.sessionId)),
|
|
46588
46622
|
"delete-hook": handleDeleteHook,
|
|
46589
46623
|
"kill": (msg) => {
|
|
46590
46624
|
const s = findSession(msg);
|
|
@@ -51663,7 +51697,10 @@ function createBackend(httpServer, options = {}) {
|
|
|
51663
51697
|
logger: console
|
|
51664
51698
|
});
|
|
51665
51699
|
const { controlWss, dataWss, controlReplayLog, sessionDataClients, broadcastControl: broadcastControlFromWebSockets, closeSessionDataClients } = webSockets;
|
|
51666
|
-
broadcastControl =
|
|
51700
|
+
broadcastControl = (message) => {
|
|
51701
|
+
broadcastControlFromWebSockets(message);
|
|
51702
|
+
if (message.type === "session-removed" && typeof message.id === "string") whiteboards.forgetSession(message.id);
|
|
51703
|
+
};
|
|
51667
51704
|
const sessionDocs = createSessionDocsWiring({ broadcastControl: broadcastControlFromWebSockets });
|
|
51668
51705
|
const shownFilesWiring = createShownFilesWiring({
|
|
51669
51706
|
shownRoot: configSiblingPath(configStore.configPath, SHOWN_FOLDER_NAME),
|
|
@@ -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-C9Lzp45n.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-CNYblswW.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-C9Lzp45n.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-LaezpMjH.js";
|
|
4
|
-
import { r as BrowserConfig } from "./config-
|
|
4
|
+
import { r as BrowserConfig } from "./config-dOHB_JFL.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-C9Lzp45n.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-D8BsUdQv.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--nJMofLP.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-LaezpMjH.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-C9Lzp45n.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-LaezpMjH.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-B_OTr5Cp.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-C0bHpz-K.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-JQwKvf3M.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{$i as e,Qi as t,Zi as n,ea as r,ia as i,na as a,ra as o,ta as s}from"./index-
|
|
1
|
+
import{$i as e,Qi as t,Zi as n,ea as r,ia as i,na as a,ra as o,ta as s}from"./index-9rftyVvQ.js";var c=.3,l=null;function u(){return i(l)}function d(e){return o(e,l)}async function f(){try{let e=await fetch(n,{credentials:`same-origin`,cache:`no-store`});e.ok&&(l=a(await e.json()))}catch{}}function p(){let e=new AudioContext;return e.state===`suspended`&&e.resume(),e}function m(e,t){setTimeout(()=>e.close().catch(()=>{}),(t+.1)*1e3)}function h(t){g(e[t]??e.chime)}function g(e){let t=p(),n=t.createGain();n.gain.value=e.peakGain,n.connect(t.destination);let r=t.currentTime,i=0;for(let a of e.tones){let e=r+a.startSeconds,o=e+a.durationSeconds,s=t.createOscillator(),c=t.createGain();s.type=a.waveform,s.frequency.setValueAtTime(a.frequency,e),a.endFrequency&&s.frequency.exponentialRampToValueAtTime(a.endFrequency,o),c.gain.setValueAtTime(.001,e),c.gain.exponentialRampToValueAtTime(a.gain??1,e+.01),c.gain.exponentialRampToValueAtTime(.001,o),s.connect(c),c.connect(n),s.start(e),s.stop(o),i=Math.max(i,a.startSeconds+a.durationSeconds)}m(t,i)}async function _(e){try{let t=await fetch(s(e),{credentials:`same-origin`});return t.ok?await t.arrayBuffer():null}catch{return null}}async function v(e){let t=await _(e);if(!t)return!1;let n=p();try{let e=await n.decodeAudioData(t),r=n.createGain();r.gain.value=c,r.connect(n.destination);let i=n.createBufferSource();return i.buffer=e,i.connect(r),i.start(),m(n,e.duration),!0}catch{return n.close().catch(()=>{}),!1}}var y=[659.25,830.61,987.77,1108.73,987.77,830.61,739.99,659.25,739.99,830.61,987.77,1108.73,987.77,830.61];function b(){try{let e=new AudioContext;if(e.state===`suspended`&&e.resume(),e.state===`suspended`)return;let t=e.createGain();t.gain.value=.05,t.connect(e.destination);let n=.125,r=e.currentTime;for(let i=0;i<y.length;i++){let a=r+i*n,o=e.createOscillator(),s=e.createGain();o.type=`square`,o.frequency.value=y[i],s.gain.setValueAtTime(.001,a),s.gain.exponentialRampToValueAtTime(1,a+.01),s.gain.exponentialRampToValueAtTime(.001,a+n*.9),o.connect(s),s.connect(t),o.start(a),o.stop(a+n)}let i=r+y.length*n;t.gain.setValueAtTime(.05,i-.05),t.gain.exponentialRampToValueAtTime(.001,i),setTimeout(()=>e.close().catch(()=>{}),(i-r+.1)*1e3)}catch{}}function x(){try{h(t)}catch{}}function S(e){try{let t=d(e),n=r(t);if(!n){h(t);return}v(n).then(e=>{e||x()})}catch{}}export{f as loadCustomSounds,S as playAlertSound,b as playNyanJingle,g as playToneSequence,d as resolveSoundId,u as soundOptions};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-
|
|
1
|
+
import"./updates-view-core-C0bHpz-K.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-9rftyVvQ.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-CMBoSmN6.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-6swWMEbb.js";import{i}from"./action-status-Q3My48SZ.js";import{a,n as o}from"./modal-BRwbyxA2.js";import{$r as s,ai as c,ei as l,ii as u,ni as d,oi as f,ri as p,ti as m}from"./index-DM-gGzvj.js";var h=4,g=200,ee=2e4,_=1.1,te=[`wire`,`note`,`frame`,`box`];function v(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function y(){return document.documentElement.dataset.layout===`phone`}function b(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(ee,Math.max(g,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 v(e,t){let n=p();s={...s,x:s.x-e*n,y:s.y-t*n},u()}function b(t){o=t,i.setSelection(o),e.onSelectionChange(o)}function x(e,t){if(!t){b(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),b(n)}function S(e){let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&b(t)}function ne(e){let t=i.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function C(){let[e,t]=[...a.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function re(){c={kind:`pinch`,distance:C(),viewWidth:s.width}}function ie(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){re();return}let t=i.elementFromTarget(e.target),r=t?.kind===`box`&&!y()?ne(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&&!y()){x(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 ae(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)<h*p()||(e.hasMoved=!0,i.nodeOf(e.boxId)?.setAttribute(`transform`,`translate(${r} ${a})`))}function w(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<h||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},v(n,r))}function T(e){let t=C();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 E(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?T(c):c?.kind===`drag`&&c.pointerId===e.pointerId?ae(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&w(c,e))}async function oe(t,n){if(!t.hasMoved){x(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 se(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?oe(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&y()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||b(new Set)))}function ce(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function le(e){e.preventDefault(),e.ctrlKey||e.metaKey?m(f(e.clientX,e.clientY),e.deltaY>0?_:1/_):v(-e.deltaX,-e.deltaY)}function D(){let e=l;l=null,e?.remove()}function O(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;D();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(),D(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();D(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,D),d.focus(),d.select()}function k(e){if(y())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&O(t.id)}function ue(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=te.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));b(new Set),e.sendOps(r)}function de(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),ue()):e.key===`Escape`&&b(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,ie),n.addEventListener(`pointermove`,E),n.addEventListener(`pointerup`,se),n.addEventListener(`pointercancel`,ce),n.addEventListener(`wheel`,le,{passive:!1}),n.addEventListener(`dblclick`,k),n.addEventListener(`keydown`,de),{fit:d,selectedIds:()=>o,clearSelection:()=>b(new Set),pruneSelection:S,closeTitleInput:D}}var x=40,S=220,ne=90,C=30,re=20,ie=18,ae=20,w=26,T=18,E=26,oe=170,se=21,ce=17,le=10,D=22,O=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function k(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 ue(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:O[n.color]}:null}function de(e,t){let n=k(t.title,ae),r=t.lines.flatMap(e=>k(e.text,w-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ue(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*re+r.length*ie+(i?26:0)}}function A(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function j(e){return x+e*310}function fe(e){let t=new Map,n=new Map,r=A(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=de(e,i),o=n.get(i.column)??84,s=i.at??{x:j(r),y:o};i.at||n.set(i.column,o+a.height+C),t.set(i.id,{kind:`box`,id:i.id,x:s.x,y:s.y,width:S,height:a.height,titleLines:a.titleLines,bodyLines:a.bodyLines,lane:a.lane,isGhost:i.ghost})}return t}function pe(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 me(e,t){return A(e,`frame`).flatMap(e=>{let n=pe(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 he(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 ge(e,t){return A(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=he(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 _e(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function ve(e,t){let n=new Map;return A(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let i=k(e.text,se),a=24+(i.length+1)*ce,o=n.get(e.on)??r.y-8;return n.set(e.on,o+a+le),[{kind:`note`,id:e.id,x:r.x+r.width-24,y:o,width:oe,height:a,lines:i,byline:_e(e),isResolved:e.resolvedBy!==null}]})}function ye(e,t){let n=e.flatMap(e=>e.kind===`wire`?[]:[e]),r=j(Math.max(1,t))-ne,i=pe([...n,{x:0,y:0,width:r,height:84}]);return i?{x:Math.min(0,i.x-x),y:Math.min(0,i.y-x),width:i.width+80,height:i.height+80}:{x:0,y:0,width:r+x,height:80}}function be(e){let t=fe(e),n=[...me(e,t),...ge(e,t),...t.values(),...ve(e,t)],r=ye(n,e.columns.length),i=r.y+r.height,a=e.lanes.map((e,t)=>({label:e.label||e.id,hex:O[e.color],x,y:i+t*D})),o=i+a.length*D+(a.length>0?12:0),s=e.caption?{text:e.caption,x,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:j(t),width:S})),elements:n,legend:a,caption:s,bounds:{...r,height:r.height+c}}}function xe(e){return JSON.stringify(e)}var Se=`http://www.w3.org/2000/svg`,M=12,N=26,P=20,Ce=18,F=17,we=14;function I(e,t={},n=``){let r=document.createElementNS(Se,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return n&&r.setAttribute(`class`,n),r}function L(e,t,n,r){let i=I(`text`,{x:t,y:n},r);return i.textContent=e,i}function R(e,t){let n=I(`g`,{},`wb-element ${t}`);return n.dataset.elementId=e.id,n.dataset.elementKind=e.kind,n}function Te(e){let t=R(e,e.isGhost?`wb-box wb-ghost`:`wb-box`),n=I(`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(L(n,e.x+M,e.y+N+r*P,`wb-box-title`))});let r=e.y+N+e.titleLines.length*P;if(e.bodyLines.forEach((n,i)=>{let a=e.x+M+(n.muted?we:0);t.append(L(n.text,a,r+i*Ce,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=I(`rect`,{x:e.x+M,y:i,width:a,height:18,rx:9},`wb-lane-pill`);o.style.stroke=e.lane.hex;let s=L(e.lane.label,e.x+M+8,i+13,`wb-lane-pill-text`);return s.style.fill=e.lane.hex,t.append(o,s),t}function Ee(e){let t=R(e,`wb-frame`);return t.append(I(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12},`wb-frame-outline`),L(e.title,e.x+14,e.y+18,`wb-frame-title`)),t}function De(e){let t=R(e,`wb-wire wb-tone-${e.tone}`),n=I(`path`,{d:e.path},`wb-wire-hit`),r=I(`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,I(`circle`,{cx:e.start.x,cy:e.start.y,r:3},`wb-wire-dot`)),e.label&&t.append(L(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),t}function Oe(e){let t=R(e,e.isResolved?`wb-note wb-resolved`:`wb-note`);return t.append(I(`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(L(n,e.x+10,e.y+22+r*F,`wb-note-text`))}),e.byline&&t.append(L(e.byline,e.x+10,e.y+22+e.lines.length*F,`wb-note-byline`)),t}var ke={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},Ae=[`box`,`frame`,`wire`,`note`];function je(e){switch(e.kind){case`box`:return Te(e);case`frame`:return Ee(e);case`wire`:return De(e);case`note`:return Oe(e)}}function Me(e){let t=I(`g`,{},`wb-chrome`);for(let n of e.columns)n.title&&t.append(L(n.title,n.x,56,`wb-column-title`),I(`line`,{x1:n.x,y1:66,x2:n.x+n.width,y2:66},`wb-column-rule`));for(let n of e.legend){let e=I(`rect`,{x:n.x,y:n.y,width:14,height:14,rx:3},`wb-legend-swatch`);e.style.fill=n.hex,t.append(e,L(n.label,n.x+22,n.y+12,`wb-legend-text`))}return e.caption&&t.append(L(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),t}function Ne(){let e=I(`defs`),t=I(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`});return t.append(I(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})),e.append(t),e}function Pe(e){let t={frames:I(`g`,{},`wb-layer`),wires:I(`g`,{},`wb-layer`),boxes:I(`g`,{},`wb-layer`),notes:I(`g`,{},`wb-layer`)},n=I(`g`);e.replaceChildren(Ne(),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=be(e),s=Me(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=xe(e),i=r.get(e.id);if(i?.signature===n)continue;let a=je(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[ke[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=Ae.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=I(`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 Fe=`http://www.w3.org/2000/svg`,Ie=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Le=`Pick a board above.`,z=null,B=null,V=null,H=null,Re=!0,U=i(`action-status wb-status`);function W(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 G(){return z?c(z):null}function ze(){return s().find(e=>e.id===z)??null}async function Be(e){if(!z||e.length===0)return!1;let t=await f(z,e);return t.ok?(U.clear(),!0):(U.show(`error`,t.error),!1)}async function K(e){if(!z)return`No board is open.`;let t=await f(z,e);return t.ok?null:t.error}function Ve(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=G();return[...H?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!B)return;let e=G(),t=q(`box`).length,n=H?.selectedIds().size??0;B.buttons.box.disabled=!e,B.buttons.wire.disabled=t!==2,B.buttons.note.disabled=t!==1,B.buttons.frame.disabled=t===0,B.buttons.fit.disabled=!e,B.buttons.remove.disabled=!e,B.toolbar.dataset.selectedCount=String(n)}function Y(){if(!B)return;let e=s();z&&!e.some(e=>e.id===z)&&(z=null),!z&&e[0]&&Z(e[0].id),B.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===z)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Z(e.id)),n})),He()}function He(){if(!B)return;let e=ze(),n=s().length>0;B.boardHead.hidden=!e,B.canvas.hidden=!e,B.empty.hidden=!!e,B.empty.textContent=n?Le:Ie,e&&(B.boardTitle.textContent=e.title,B.boardMeta.textContent=`v${e.version}`,B.presence.replaceChildren(...e.connectedSessionIds.map(e=>t(`span`,`wb-presence-pill`,Ve(e)))),e.connectedSessionIds.length===0&&B.presence.append(t(`span`,`wb-presence-none`,`no sessions connected`)),J())}function X(){if(!V)return;let e=G();e?(V.render(e),H?.pruneSelection(e),Re&&=(H?.fit(),!1),J()):V.clear()}function Z(e){z!==e&&(z=e,Re=!0,H?.clearSelection(),H?.closeTitleInput(),V?.clear(),U.clear(),Y(),u(e).then(X))}function Ue(){let t=G();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)),W({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)=>K([{op:`add`,element:{kind:`box`,id:v(`box`),title:e,column:t??r[0]?.value??`main`,lines:[],lane:null,ghost:!1,order:0,at:null}}])})}function Q(t){W({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>K([{op:`add`,element:{kind:`note`,id:v(`note`),on:t,text:e,author:``,resolvedBy:null}}])})}function We(){let[e,t]=q(`box`);e&&t&&(H?.clearSelection(),Be([{op:`add`,element:{kind:`wire`,id:v(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function Ge(){let t=q(`box`).map(e=>e.id);t.length!==0&&W({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await K([{op:`add`,element:{kind:`frame`,id:v(`frame`),title:e,contains:t}}]);return n||H?.clearSelection(),n}})}function Ke(){let e=ze();if(!e)return;let t=e.connectedSessionIds.map(Ve),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:()=>{m(e.id).then(e=>{e.ok||U.show(`error`,e.error)})}})}function qe(){W({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await l(e);return t.ok?(Z(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 Je(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,qe));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`,Ue),wire:$(`wire`,We),note:$(`note`,()=>{let[e]=q(`box`);e&&Q(e.id)}),frame:$(`frame`,Ge),fit:$(`fit`,()=>H?.fit()),remove:$(`delete board`,Ke,`wb-button-danger`)};u.fit.dataset.phoneVisible=``,l.append(u.box,u.wire,u.note,u.frame,u.fit,u.remove,U.element),i.append(a,l);let f=t(`div`,`wb-canvas`),m=document.createElementNS(Fe,`svg`);m.setAttribute(`class`,`wb-svg`),m.setAttribute(`role`,`img`),m.setAttribute(`aria-label`,`Whiteboard`),m.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),f.append(m);let h=t(`p`,`wb-empty`,Ie);e.replaceChildren(n,i,f,h),B={list:r,boardHead:i,boardTitle:o,boardMeta:s,presence:c,toolbar:l,canvas:f,empty:h,buttons:u};let g=Pe(m);V=g,H=b({svg:m,canvas:f,renderer:g,currentBoard:G,sendOps:Be,onSelectionChange:J,onPhoneTapBox:Q}),p(Y),d(e=>{e===z&&X()}),Y()}function Ye(){Y(),z&&u(z).then(X)}var Xe={mount:Je,refresh:Ye};export{Xe as view};
|
|
1
|
+
import{Et as e}from"./updates-view-core-C0bHpz-K.js";import{o as t}from"./dom-helpers-I_SDCPvs.js";import{a as n,r}from"./card-registry-CAKEvh7s.js";import{i}from"./action-status-CFs1QbL1.js";import{a,n as o}from"./modal-BRwbyxA2.js";import{$r as s,ai as c,ei as l,ii as u,ni as d,oi as f,ri as p,ti as m}from"./index-9rftyVvQ.js";var h=4,g=200,ee=2e4,_=1.1,te=[`wire`,`note`,`frame`,`box`];function v(e){let t=Math.random().toString(36).slice(2,8);return`${e}-${Date.now().toString(36)}${t}`}function y(){return document.documentElement.dataset.layout===`phone`}function b(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(ee,Math.max(g,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 v(e,t){let n=p();s={...s,x:s.x-e*n,y:s.y-t*n},u()}function b(t){o=t,i.setSelection(o),e.onSelectionChange(o)}function x(e,t){if(!t){b(o.has(e)&&o.size===1?new Set:new Set([e]));return}let n=new Set(o);n.delete(e)||n.add(e),b(n)}function S(e){let t=new Set([...o].filter(t=>e?.elements[t]));t.size!==o.size&&b(t)}function ne(e){let t=i.layout()?.elements.find(t=>t.id===e);return t?.kind===`box`?t:null}function C(){let[e,t]=[...a.values()];return!e||!t?0:Math.hypot(e.x-t.x,e.y-t.y)}function re(){c={kind:`pinch`,distance:C(),viewWidth:s.width}}function ie(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){re();return}let t=i.elementFromTarget(e.target),r=t?.kind===`box`&&!y()?ne(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&&!y()){x(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 ae(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)<h*p()||(e.hasMoved=!0,i.nodeOf(e.boxId)?.setAttribute(`transform`,`translate(${r} ${a})`))}function w(e,t){let n=t.clientX-e.lastClient.x,r=t.clientY-e.lastClient.y;!e.hasMoved&&Math.hypot(n,r)<h||(e.hasMoved=!0,e.lastClient={x:t.clientX,y:t.clientY},v(n,r))}function T(e){let t=C();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 E(e){a.has(e.pointerId)&&(a.set(e.pointerId,{x:e.clientX,y:e.clientY}),c?.kind===`pinch`?T(c):c?.kind===`drag`&&c.pointerId===e.pointerId?ae(c,e):c?.kind===`pan`&&c.pointerId===e.pointerId&&w(c,e))}async function oe(t,n){if(!t.hasMoved){x(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 se(t){if(!a.delete(t.pointerId))return;let n=c;n?.kind===`pinch`?c=null:(c=null,n?.kind===`drag`&&n.pointerId===t.pointerId?oe(n,t):n?.kind!==`pan`||n.hasMoved||(n.tappedBoxId&&y()?e.onPhoneTapBox(n.tappedBoxId):n.tappedBoxId||b(new Set)))}function ce(e){a.delete(e.pointerId),c?.kind===`drag`&&i.nodeOf(c.boxId)?.removeAttribute(`transform`),c=null}function le(e){e.preventDefault(),e.ctrlKey||e.metaKey?m(f(e.clientX,e.clientY),e.deltaY>0?_:1/_):v(-e.deltaX,-e.deltaY)}function D(){let e=l;l=null,e?.remove()}function O(a){let o=e.currentBoard()?.elements[a],s=i.nodeOf(a);if(o?.kind!==`box`||!s)return;D();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(),D(),n.focus();return}if(t.key!==`Enter`)return;t.preventDefault();let r=d.value.trim();D(),n.focus(),r&&r!==o.title&&e.sendOps([{op:`set`,id:a,fields:{title:r}}])}),d.addEventListener(`blur`,D),d.focus(),d.select()}function k(e){if(y())return;let t=i.elementFromTarget(document.elementFromPoint(e.clientX,e.clientY));t?.kind===`box`&&O(t.id)}function ue(){let t=e.currentBoard();if(!t||o.size===0)return;let n=[...o].flatMap(e=>t.elements[e]??[]),r=te.flatMap(e=>n.filter(t=>t.kind===e)).map(e=>({op:`remove`,id:e.id}));b(new Set),e.sendOps(r)}function de(e){e.target===n&&(e.key===`Delete`||e.key===`Backspace`?(e.preventDefault(),ue()):e.key===`Escape`&&b(new Set))}return n.tabIndex=0,n.addEventListener(`pointerdown`,ie),n.addEventListener(`pointermove`,E),n.addEventListener(`pointerup`,se),n.addEventListener(`pointercancel`,ce),n.addEventListener(`wheel`,le,{passive:!1}),n.addEventListener(`dblclick`,k),n.addEventListener(`keydown`,de),{fit:d,selectedIds:()=>o,clearSelection:()=>b(new Set),pruneSelection:S,closeTitleInput:D}}var x=40,S=220,ne=90,C=30,re=20,ie=18,ae=20,w=26,T=18,E=26,oe=170,se=21,ce=17,le=10,D=22,O=Object.freeze({blue:`#60a5fa`,green:`#4ade80`,orange:`#fb923c`,pink:`#f472b6`,cyan:`#22d3ee`,yellow:`#facc15`});function k(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 ue(e,t){let n=e.lanes.find(e=>e.id===t.lane);return n?{label:n.label||n.id,hex:O[n.color]}:null}function de(e,t){let n=k(t.title,ae),r=t.lines.flatMap(e=>k(e.text,w-(e.muted?2:0)).map(t=>({text:t,muted:e.muted}))),i=ue(e,t);return{titleLines:n,bodyLines:r,lane:i,height:24+n.length*re+r.length*ie+(i?26:0)}}function A(e,t){return Object.values(e.elements).filter(e=>e.kind===t)}function j(e){return x+e*310}function fe(e){let t=new Map,n=new Map,r=A(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=de(e,i),o=n.get(i.column)??84,s=i.at??{x:j(r),y:o};i.at||n.set(i.column,o+a.height+C),t.set(i.id,{kind:`box`,id:i.id,x:s.x,y:s.y,width:S,height:a.height,titleLines:a.titleLines,bodyLines:a.bodyLines,lane:a.lane,isGhost:i.ghost})}return t}function pe(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 me(e,t){return A(e,`frame`).flatMap(e=>{let n=pe(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 he(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 ge(e,t){return A(e,`wire`).flatMap(e=>{let n=t.get(e.from),r=t.get(e.to);if(!n||!r)return[];let i=he(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 _e(e){return e.resolvedBy?`resolved by ${e.resolvedBy}`:e.author?`from ${e.author}`:``}function ve(e,t){let n=new Map;return A(e,`note`).flatMap(e=>{let r=t.get(e.on);if(!r)return[];let i=k(e.text,se),a=24+(i.length+1)*ce,o=n.get(e.on)??r.y-8;return n.set(e.on,o+a+le),[{kind:`note`,id:e.id,x:r.x+r.width-24,y:o,width:oe,height:a,lines:i,byline:_e(e),isResolved:e.resolvedBy!==null}]})}function ye(e,t){let n=e.flatMap(e=>e.kind===`wire`?[]:[e]),r=j(Math.max(1,t))-ne,i=pe([...n,{x:0,y:0,width:r,height:84}]);return i?{x:Math.min(0,i.x-x),y:Math.min(0,i.y-x),width:i.width+80,height:i.height+80}:{x:0,y:0,width:r+x,height:80}}function be(e){let t=fe(e),n=[...me(e,t),...ge(e,t),...t.values(),...ve(e,t)],r=ye(n,e.columns.length),i=r.y+r.height,a=e.lanes.map((e,t)=>({label:e.label||e.id,hex:O[e.color],x,y:i+t*D})),o=i+a.length*D+(a.length>0?12:0),s=e.caption?{text:e.caption,x,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:j(t),width:S})),elements:n,legend:a,caption:s,bounds:{...r,height:r.height+c}}}function xe(e){return JSON.stringify(e)}var Se=`http://www.w3.org/2000/svg`,M=12,N=26,P=20,Ce=18,F=17,we=14;function I(e,t={},n=``){let r=document.createElementNS(Se,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return n&&r.setAttribute(`class`,n),r}function L(e,t,n,r){let i=I(`text`,{x:t,y:n},r);return i.textContent=e,i}function R(e,t){let n=I(`g`,{},`wb-element ${t}`);return n.dataset.elementId=e.id,n.dataset.elementKind=e.kind,n}function Te(e){let t=R(e,e.isGhost?`wb-box wb-ghost`:`wb-box`),n=I(`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(L(n,e.x+M,e.y+N+r*P,`wb-box-title`))});let r=e.y+N+e.titleLines.length*P;if(e.bodyLines.forEach((n,i)=>{let a=e.x+M+(n.muted?we:0);t.append(L(n.text,a,r+i*Ce,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=I(`rect`,{x:e.x+M,y:i,width:a,height:18,rx:9},`wb-lane-pill`);o.style.stroke=e.lane.hex;let s=L(e.lane.label,e.x+M+8,i+13,`wb-lane-pill-text`);return s.style.fill=e.lane.hex,t.append(o,s),t}function Ee(e){let t=R(e,`wb-frame`);return t.append(I(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:12},`wb-frame-outline`),L(e.title,e.x+14,e.y+18,`wb-frame-title`)),t}function De(e){let t=R(e,`wb-wire wb-tone-${e.tone}`),n=I(`path`,{d:e.path},`wb-wire-hit`),r=I(`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,I(`circle`,{cx:e.start.x,cy:e.start.y,r:3},`wb-wire-dot`)),e.label&&t.append(L(e.label,e.labelAt.x,e.labelAt.y,`wb-wire-label`)),t}function Oe(e){let t=R(e,e.isResolved?`wb-note wb-resolved`:`wb-note`);return t.append(I(`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(L(n,e.x+10,e.y+22+r*F,`wb-note-text`))}),e.byline&&t.append(L(e.byline,e.x+10,e.y+22+e.lines.length*F,`wb-note-byline`)),t}var ke={frame:`frames`,wire:`wires`,box:`boxes`,note:`notes`},Ae=[`box`,`frame`,`wire`,`note`];function je(e){switch(e.kind){case`box`:return Te(e);case`frame`:return Ee(e);case`wire`:return De(e);case`note`:return Oe(e)}}function Me(e){let t=I(`g`,{},`wb-chrome`);for(let n of e.columns)n.title&&t.append(L(n.title,n.x,56,`wb-column-title`),I(`line`,{x1:n.x,y1:66,x2:n.x+n.width,y2:66},`wb-column-rule`));for(let n of e.legend){let e=I(`rect`,{x:n.x,y:n.y,width:14,height:14,rx:3},`wb-legend-swatch`);e.style.fill=n.hex,t.append(e,L(n.label,n.x+22,n.y+12,`wb-legend-text`))}return e.caption&&t.append(L(e.caption.text,e.caption.x,e.caption.y+16,`wb-caption`)),t}function Ne(){let e=I(`defs`),t=I(`marker`,{id:`wb-arrow`,viewBox:`0 0 10 10`,refX:9,refY:5,markerWidth:8,markerHeight:8,orient:`auto-start-reverse`});return t.append(I(`path`,{d:`M 0 1 L 10 5 L 0 9 z`,fill:`context-stroke`})),e.append(t),e}function Pe(e){let t={frames:I(`g`,{},`wb-layer`),wires:I(`g`,{},`wb-layer`),boxes:I(`g`,{},`wb-layer`),notes:I(`g`,{},`wb-layer`)},n=I(`g`);e.replaceChildren(Ne(),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=be(e),s=Me(a);n.replaceWith(s),n=s;let c=new Set;for(let e of a.elements){c.add(e.id);let n=xe(e),i=r.get(e.id);if(i?.signature===n)continue;let a=je(e);o(e.id,a),i&&i.node.replaceWith(a),i||t[ke[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=Ae.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=I(`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 Fe=`http://www.w3.org/2000/svg`,Ie=`No boards yet. Make one here, or have an agent run glimmervoid whiteboard new <title>.`,Le=`Pick a board above.`,z=null,B=null,V=null,H=null,Re=!0,U=i(`action-status wb-status`);function W(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 G(){return z?c(z):null}function ze(){return s().find(e=>e.id===z)??null}async function Be(e){if(!z||e.length===0)return!1;let t=await f(z,e);return t.ok?(U.clear(),!0):(U.show(`error`,t.error),!1)}async function K(e){if(!z)return`No board is open.`;let t=await f(z,e);return t.ok?null:t.error}function Ve(e){let t=r(e);return t?n(t):`closed session`}function q(e){let t=G();return[...H?.selectedIds()??new Set].flatMap(e=>t?.elements[e]??[]).filter(t=>t.kind===e)}function J(){if(!B)return;let e=G(),t=q(`box`).length,n=H?.selectedIds().size??0;B.buttons.box.disabled=!e,B.buttons.wire.disabled=t!==2,B.buttons.note.disabled=t!==1,B.buttons.frame.disabled=t===0,B.buttons.fit.disabled=!e,B.buttons.remove.disabled=!e,B.toolbar.dataset.selectedCount=String(n)}function Y(){if(!B)return;let e=s();z&&!e.some(e=>e.id===z)&&(z=null),!z&&e[0]&&Z(e[0].id),B.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===z)),e.connectedSessionIds.length>0&&n.append(t(`span`,`wb-board-tab-count`,String(e.connectedSessionIds.length))),n.addEventListener(`click`,()=>Z(e.id)),n})),He()}function He(){if(!B)return;let e=ze(),n=s().length>0;B.boardHead.hidden=!e,B.canvas.hidden=!e,B.empty.hidden=!!e,B.empty.textContent=n?Le:Ie,e&&(B.boardTitle.textContent=e.title,B.boardMeta.textContent=`v${e.version}`,B.presence.replaceChildren(...e.connectedSessionIds.map(e=>t(`span`,`wb-presence-pill`,Ve(e)))),e.connectedSessionIds.length===0&&B.presence.append(t(`span`,`wb-presence-none`,`no sessions connected`)),J())}function X(){if(!V)return;let e=G();e?(V.render(e),H?.pruneSelection(e),Re&&=(H?.fit(),!1),J()):V.clear()}function Z(e){z!==e&&(z=e,Re=!0,H?.clearSelection(),H?.closeTitleInput(),V?.clear(),U.clear(),Y(),u(e).then(X))}function Ue(){let t=G();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)),W({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)=>K([{op:`add`,element:{kind:`box`,id:v(`box`),title:e,column:t??r[0]?.value??`main`,lines:[],lane:null,ghost:!1,order:0,at:null}}])})}function Q(t){W({title:`Pin a note`,label:`Note`,placeholder:`what about retries?`,maxLength:e.noteText,confirmLabel:`Pin note`,onSubmit:e=>K([{op:`add`,element:{kind:`note`,id:v(`note`),on:t,text:e,author:``,resolvedBy:null}}])})}function We(){let[e,t]=q(`box`);e&&t&&(H?.clearSelection(),Be([{op:`add`,element:{kind:`wire`,id:v(`wire`),from:e.id,to:t.id,dashed:!1,tone:`plain`,label:null}}]))}function Ge(){let t=q(`box`).map(e=>e.id);t.length!==0&&W({title:`Frame the selected boxes`,label:`Frame title`,placeholder:`intake`,maxLength:e.title,confirmLabel:`Add frame`,onSubmit:async e=>{let n=await K([{op:`add`,element:{kind:`frame`,id:v(`frame`),title:e,contains:t}}]);return n||H?.clearSelection(),n}})}function Ke(){let e=ze();if(!e)return;let t=e.connectedSessionIds.map(Ve),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:()=>{m(e.id).then(e=>{e.ok||U.show(`error`,e.error)})}})}function qe(){W({title:`New board`,label:`Board title`,placeholder:`knowledge writer`,maxLength:e.title,confirmLabel:`Create board`,onSubmit:async e=>{let t=await l(e);return t.ok?(Z(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 Je(e){let n=t(`div`,`wb-top`),r=t(`div`,`wb-board-list`);r.setAttribute(`aria-label`,`Boards`),n.append(r,$(`new board`,qe));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`,Ue),wire:$(`wire`,We),note:$(`note`,()=>{let[e]=q(`box`);e&&Q(e.id)}),frame:$(`frame`,Ge),fit:$(`fit`,()=>H?.fit()),remove:$(`delete board`,Ke,`wb-button-danger`)};u.fit.dataset.phoneVisible=``,l.append(u.box,u.wire,u.note,u.frame,u.fit,u.remove,U.element),i.append(a,l);let f=t(`div`,`wb-canvas`),m=document.createElementNS(Fe,`svg`);m.setAttribute(`class`,`wb-svg`),m.setAttribute(`role`,`img`),m.setAttribute(`aria-label`,`Whiteboard`),m.setAttribute(`preserveAspectRatio`,`xMidYMin meet`),f.append(m);let h=t(`p`,`wb-empty`,Ie);e.replaceChildren(n,i,f,h),B={list:r,boardHead:i,boardTitle:o,boardMeta:s,presence:c,toolbar:l,canvas:f,empty:h,buttons:u};let g=Pe(m);V=g,H=b({svg:m,canvas:f,renderer:g,currentBoard:G,sendOps:Be,onSelectionChange:J,onPhoneTapBox:Q}),p(Y),d(e=>{e===z&&X()}),Y()}function Ye(){Y(),z&&u(z).then(X)}var Xe={mount:Je,refresh:Ye};export{Xe as view};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e}from"./updates-view-core-
|
|
1
|
+
import{St as e}from"./updates-view-core-C0bHpz-K.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
|