glimmervoid 0.45.1-next.83 → 0.45.1-next.91
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-BpjX0djP.js → adapters-D8q7K0IN.js} +2 -2
- package/dist/chunks/{adapters-CPCQGdQP.js → adapters-DsUfBNt2.js} +1 -1
- package/dist/chunks/{agent-api-cli-Cpez-uww.js → agent-api-cli-BNP5jgzo.js} +1 -1
- package/dist/chunks/{agent-api-cli-LGGAxmEI.js → agent-api-cli-BghkyG7c.js} +1 -1
- package/dist/chunks/{agent-api-core-BSdwxYJs.js → agent-api-core-JTVlt1Pv.js} +1 -1
- package/dist/chunks/{build-channel-DGyhk8hO.js → build-channel-DNz_uA_k.js} +1 -1
- package/dist/chunks/{config-DqgKuhBG.js → config-BYsrGS5K.js} +2 -0
- package/dist/chunks/config-store-CaMEG7BR.js +1 -0
- package/dist/chunks/{config-store-GMSs3pKP.js → config-store-SeN0w6cD.js} +5 -4
- package/dist/chunks/{main-Cs1qK1Wt.js → main-BQubti_L.js} +25 -17
- package/dist/chunks/{pair-cli-2xpWEvAQ.js → pair-cli-DojX0sOi.js} +2 -2
- package/dist/chunks/{remote-config-Bt3ebJY1.js → remote-config-BQ0ggoxv.js} +1 -1
- package/dist/chunks/{settings-cli-DPK-xx4w.js → settings-cli-DP_NIdxV.js} +4 -4
- package/dist/chunks/{settings-readout-core-C3kVbO18.js → settings-readout-core-C1uJhry6.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-BOo44kJp.js → ssh-sign-cli-BYGncFQu.js} +1 -1
- package/dist/client/assets/{action-status-hJ8vrTK4.js → action-status-DmJCv-Ib.js} +1 -1
- package/dist/client/assets/action-status-DmJCv-Ib.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-Cgj-jlwg.js → benchmark-panel-C10yqatp.js} +1 -1
- package/dist/client/assets/benchmark-panel-C10yqatp.js.br +0 -0
- package/dist/client/assets/{card-dom-D4NvWM47.js → card-dom-pJx9ASHy.js} +1 -1
- package/dist/client/assets/card-dom-pJx9ASHy.js.br +0 -0
- package/dist/client/assets/{control-ws-6I4n2_Rl.js → control-ws-C8SS9PPx.js} +1 -1
- package/dist/client/assets/control-ws-C8SS9PPx.js.br +0 -0
- package/dist/client/assets/dialogs-Bakxg8en.js +84 -0
- package/dist/client/assets/dialogs-Bakxg8en.js.br +0 -0
- package/dist/client/assets/{dom-helpers-D7V9q-Y4.js → dom-helpers-B98sy9ep.js} +1 -1
- package/dist/client/assets/dom-helpers-B98sy9ep.js.br +0 -0
- package/dist/client/assets/{hooks-panel-Df7elfUo.js → hooks-panel-C0XvWYEF.js} +1 -1
- package/dist/client/assets/hooks-panel-C0XvWYEF.js.br +0 -0
- package/dist/client/assets/index-5oZZMqqg.js +84 -0
- package/dist/client/assets/index-5oZZMqqg.js.br +0 -0
- package/dist/client/assets/index-aMk1lj4J.css +2 -0
- package/dist/client/assets/index-aMk1lj4J.css.br +0 -0
- package/dist/client/assets/{issues-panel-PzrroUi1.js → issues-panel-Clog0jJX.js} +1 -1
- package/dist/client/assets/issues-panel-Clog0jJX.js.br +0 -0
- package/dist/client/assets/{modal-CpGyiWuk.js → modal-5t7_5VCF.js} +1 -1
- package/dist/client/assets/modal-5t7_5VCF.js.br +0 -0
- package/dist/client/assets/plan-face-Bk84I0_W.js +3 -0
- package/dist/client/assets/plan-face-Bk84I0_W.js.br +0 -0
- package/dist/client/assets/{poll-ago-jEMVa0Q3.js → poll-ago-DdlzkUaM.js} +1 -1
- package/dist/client/assets/poll-ago-DdlzkUaM.js.br +0 -0
- package/dist/client/assets/{pr-scope-tabs-1P0PDvDs.js → pr-scope-tabs-2NPVJWOQ.js} +1 -1
- package/dist/client/assets/pr-scope-tabs-2NPVJWOQ.js.br +0 -0
- package/dist/client/assets/radar-panel-CN5NysVm.js +1 -0
- package/dist/client/assets/radar-panel-CN5NysVm.js.br +0 -0
- package/dist/client/assets/review-queue-panel-BJ-WWgJ9.js +10 -0
- package/dist/client/assets/review-queue-panel-BJ-WWgJ9.js.br +0 -0
- package/dist/client/assets/settings-panel-C6_AHp24.js +4 -0
- package/dist/client/assets/settings-panel-C6_AHp24.js.br +0 -0
- package/dist/client/assets/trace-panel-mr3iXAET.js +2 -0
- package/dist/client/assets/trace-panel-mr3iXAET.js.br +0 -0
- package/dist/client/assets/{ui-prefs-Kmmz3DzP.js → ui-prefs-Dvsgw_ZF.js} +1 -1
- package/dist/client/assets/ui-prefs-Dvsgw_ZF.js.br +0 -0
- package/dist/client/assets/usage-panel-DJ8MsEV9.js +1 -0
- package/dist/client/assets/usage-panel-DJ8MsEV9.js.br +0 -0
- package/dist/client/assets/visions-panel-CeUfJNLo.js +1 -0
- package/dist/client/assets/visions-panel-CeUfJNLo.js.br +0 -0
- package/dist/client/index.html +9 -9
- 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-DDRtmgjN.js +0 -1
- package/dist/client/assets/action-status-hJ8vrTK4.js.br +0 -0
- package/dist/client/assets/benchmark-panel-Cgj-jlwg.js.br +0 -0
- package/dist/client/assets/card-dom-D4NvWM47.js.br +0 -0
- package/dist/client/assets/control-ws-6I4n2_Rl.js.br +0 -0
- package/dist/client/assets/dialogs-BMEa3xuu.js +0 -74
- package/dist/client/assets/dialogs-BMEa3xuu.js.br +0 -0
- package/dist/client/assets/dom-helpers-D7V9q-Y4.js.br +0 -0
- package/dist/client/assets/hooks-panel-Df7elfUo.js.br +0 -0
- package/dist/client/assets/index-C1GQzJGW.css +0 -2
- package/dist/client/assets/index-C1GQzJGW.css.br +0 -0
- package/dist/client/assets/index-y1O9VrV6.js +0 -84
- package/dist/client/assets/index-y1O9VrV6.js.br +0 -0
- package/dist/client/assets/issues-panel-PzrroUi1.js.br +0 -0
- package/dist/client/assets/modal-CpGyiWuk.js.br +0 -0
- package/dist/client/assets/plan-face-CqVtuY3w.js +0 -3
- package/dist/client/assets/plan-face-CqVtuY3w.js.br +0 -0
- package/dist/client/assets/poll-ago-jEMVa0Q3.js.br +0 -0
- package/dist/client/assets/pr-scope-tabs-1P0PDvDs.js.br +0 -0
- package/dist/client/assets/radar-panel-oKGY6s0c.js +0 -1
- package/dist/client/assets/radar-panel-oKGY6s0c.js.br +0 -0
- package/dist/client/assets/review-queue-panel-CiT3p9N1.js +0 -10
- package/dist/client/assets/review-queue-panel-CiT3p9N1.js.br +0 -0
- package/dist/client/assets/settings-panel-r14D3gaJ.js +0 -4
- package/dist/client/assets/settings-panel-r14D3gaJ.js.br +0 -0
- package/dist/client/assets/trace-panel-Dt6Et1k1.js +0 -2
- package/dist/client/assets/trace-panel-Dt6Et1k1.js.br +0 -0
- package/dist/client/assets/ui-prefs-Kmmz3DzP.js.br +0 -0
- package/dist/client/assets/usage-panel-BARU5jqH.js +0 -1
- package/dist/client/assets/usage-panel-BARU5jqH.js.br +0 -0
- package/dist/client/assets/visions-panel-DoOFZ5dt.js +0 -1
- package/dist/client/assets/visions-panel-DoOFZ5dt.js.br +0 -0
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -5,7 +5,7 @@ import { o as packageRoot } from "../chunks/runtime-paths-ghcH9CeW.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-BF6eF7dw.js";
|
|
7
7
|
import { i as execSync } from "../chunks/child-process-safe-D4hyVIXj.js";
|
|
8
|
-
import { r as agentCommandHelpLines } from "../chunks/agent-api-core-
|
|
8
|
+
import { r as agentCommandHelpLines } from "../chunks/agent-api-core-JTVlt1Pv.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-C-IkI4sr.js";
|
|
11
11
|
import { i as guardrailsDoctorRows, r as probeGuardrailsDependencies } from "../chunks/guardrails-deps-BjPzk1rE.js";
|
|
@@ -65,7 +65,7 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
65
65
|
return 0;
|
|
66
66
|
}],
|
|
67
67
|
["pair", async (subcommandArgs) => {
|
|
68
|
-
const { runPairCli } = await import("../chunks/pair-cli-
|
|
68
|
+
const { runPairCli } = await import("../chunks/pair-cli-DojX0sOi.js");
|
|
69
69
|
return runPairCli(subcommandArgs);
|
|
70
70
|
}],
|
|
71
71
|
["agent", async (subcommandArgs) => {
|
|
@@ -73,7 +73,7 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
73
73
|
return runAgentSetupCli(subcommandArgs);
|
|
74
74
|
}],
|
|
75
75
|
["settings", async (subcommandArgs) => {
|
|
76
|
-
const { runSettingsCli } = await import("../chunks/settings-cli-
|
|
76
|
+
const { runSettingsCli } = await import("../chunks/settings-cli-DP_NIdxV.js");
|
|
77
77
|
return runSettingsCli(subcommandArgs);
|
|
78
78
|
}],
|
|
79
79
|
["visions", async (subcommandArgs) => {
|
|
@@ -81,13 +81,13 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
81
81
|
return runVisionsCli(subcommandArgs);
|
|
82
82
|
}],
|
|
83
83
|
["ssh-sign", async (subcommandArgs) => {
|
|
84
|
-
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-
|
|
84
|
+
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BYGncFQu.js");
|
|
85
85
|
return runSshSignCli(subcommandArgs);
|
|
86
86
|
}]
|
|
87
87
|
];
|
|
88
88
|
var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
|
|
89
89
|
var SUBCOMMAND_RUNNERS = new Map([...OWN_SUBCOMMAND_RUNNERS, ...AGENT_API_VERBS.filter((verb) => !ownSubcommandNames.has(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
|
|
90
|
-
const { runAgentApiCli } = await import("../chunks/agent-api-cli-
|
|
90
|
+
const { runAgentApiCli } = await import("../chunks/agent-api-cli-BNP5jgzo.js");
|
|
91
91
|
return runAgentApiCli([subcommandName, ...subcommandArgs]);
|
|
92
92
|
}])]);
|
|
93
93
|
var AGENT_INSTALL_COMMAND_BY_ID = {
|
|
@@ -101,7 +101,7 @@ function missingAgentText(agentId) {
|
|
|
101
101
|
}
|
|
102
102
|
async function printSessionLimits() {
|
|
103
103
|
if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
|
|
104
|
-
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-
|
|
104
|
+
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-BNP5jgzo.js");
|
|
105
105
|
const limitsLines = await sessionLimitsHelpLines();
|
|
106
106
|
console.log(`\n${limitsLines.join("\n")}`);
|
|
107
107
|
}
|
|
@@ -158,7 +158,7 @@ async function readDeclaredCustomAgents() {
|
|
|
158
158
|
declared: [],
|
|
159
159
|
error: null
|
|
160
160
|
};
|
|
161
|
-
const { loadConfigFile } = await import("../chunks/config-store-
|
|
161
|
+
const { loadConfigFile } = await import("../chunks/config-store-CaMEG7BR.js");
|
|
162
162
|
try {
|
|
163
163
|
const loaded = loadConfigFile(decided.path, { exitOnError: false });
|
|
164
164
|
if (!loaded.config) return {
|
|
@@ -234,7 +234,7 @@ async function runDoctor() {
|
|
|
234
234
|
}
|
|
235
235
|
switchSection("Agents");
|
|
236
236
|
try {
|
|
237
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
237
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-DsUfBNt2.js");
|
|
238
238
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
239
239
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
240
240
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { s as relayPath } from "./runtime-paths-ghcH9CeW.js";
|
|
2
2
|
import { Bt as FULL_SHA_RE, Ht as shortSha$1 } from "./session-BF6eF7dw.js";
|
|
3
3
|
import { n as execFileAsync, r as execFileSync } from "./child-process-safe-D4hyVIXj.js";
|
|
4
|
-
import { b as InstallFlavor, mt as UpdateChannel } from "./config-
|
|
4
|
+
import { b as InstallFlavor, mt as UpdateChannel } from "./config-BYsrGS5K.js";
|
|
5
5
|
import { o as supervisionLine } from "./session-routes-gzOQJb1W.js";
|
|
6
6
|
import { c as textOr, s as rawTextOr } from "./coerce-NSst8oRP.js";
|
|
7
7
|
import { n as resolveAgentCommand, t as buildAgentSpawnCommand } from "./spawn-command-Cc40FiZI.js";
|
|
8
8
|
import { r as nextBackoffMs } from "./backoff-DjVpfHk7.js";
|
|
9
9
|
import { i as isSpinnerChar, n as classifyAgentTitle, r as isBrailleChar, s as buildAgentEnv, t as grok } from "./grok-B8DOqRB-.js";
|
|
10
10
|
import { t as buildHookCommand } from "./hook-command-core-qTNK-xMF.js";
|
|
11
|
-
import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-
|
|
11
|
+
import { n as isExperimentalBuild, t as compareReleaseVersions } from "./build-channel-DNz_uA_k.js";
|
|
12
12
|
import { n as mergeCodexPreToolUse, t as HOOK_TOOLS } from "./hook-tools-Dl7-r2Eb.js";
|
|
13
13
|
import fs from "node:fs";
|
|
14
14
|
import path from "node:path";
|
|
@@ -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-D8q7K0IN.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-BghkyG7c.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as errorCode } from "./text-DoirglWV.js";
|
|
2
2
|
import { c as AgentLimitsReply, n as AGENT_URL_ENV } from "./session-BF6eF7dw.js";
|
|
3
3
|
import { i as formatSessionLimits } from "./session-routes-gzOQJb1W.js";
|
|
4
|
-
import { f as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-
|
|
4
|
+
import { f as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-JTVlt1Pv.js";
|
|
5
5
|
import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
|
|
6
6
|
import { n as decideGuardrailsProxy } from "./guardrails-proxy-core-BI3rdY-m.js";
|
|
7
7
|
import { t as parseJsonOrNull } from "./json-core-dfa_7Fak.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as AgentAttentionRequest, d as AgentSendRequest, i as AgentAnswerRequest, l as AgentPullRequestRequest, m as AgentSpawnRequest, o as AgentCloseRequest, p as AgentSettingsRequest, s as AgentEditRequest, t as AGENT_API_VERBS, u as AgentReadRequest, w as RefinedTaskTitle, z as TASK_TITLE_CONTROL_CHARACTERS } from "./session-BF6eF7dw.js";
|
|
2
|
-
import { T as pullRequestKeyFromReference, c as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-
|
|
2
|
+
import { T as pullRequestKeyFromReference, c as TASK_TITLE_SOURCE_PRIORITY, o as PersistedTaskTitle } from "./config-BYsrGS5K.js";
|
|
3
3
|
import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-gzOQJb1W.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import crypto from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./session-BF6eF7dw.js";
|
|
2
|
-
import { C as OPERATOR_ACTIONS_BY_SURFACE, S as ONBOARDING_STEP_STATES, n as BUILTIN_AGENT_IDS, w as OPERATOR_SURFACES, x as ONBOARDING_STEPS, y as DASHBOARD_VIEWS } from "./config-
|
|
2
|
+
import { C as OPERATOR_ACTIONS_BY_SURFACE, S as ONBOARDING_STEP_STATES, n as BUILTIN_AGENT_IDS, w as OPERATOR_SURFACES, x as ONBOARDING_STEPS, y as DASHBOARD_VIEWS } from "./config-BYsrGS5K.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"]);
|
|
@@ -1535,6 +1535,7 @@ var clientVariants = [
|
|
|
1535
1535
|
repos: z.array(z.string()).optional(),
|
|
1536
1536
|
agent: z.string().optional(),
|
|
1537
1537
|
dangerouslySkipPermissions: z.boolean().optional(),
|
|
1538
|
+
saneYolo: z.boolean().optional(),
|
|
1538
1539
|
unguarded: z.boolean().optional(),
|
|
1539
1540
|
runInPlace: z.boolean().optional(),
|
|
1540
1541
|
environment: z.string().optional(),
|
|
@@ -2742,6 +2743,7 @@ var ProjectConfig = z.object({
|
|
|
2742
2743
|
conversationView: z.boolean({ error: "projects[].conversationView must be a boolean" }).optional(),
|
|
2743
2744
|
dangerouslySkipPermissions: z.boolean({ error: "projects[].dangerouslySkipPermissions must be a boolean" }).optional(),
|
|
2744
2745
|
unguarded: z.boolean({ error: "projects[].unguarded must be a boolean" }).optional(),
|
|
2746
|
+
saneYolo: z.boolean({ error: "projects[].saneYolo must be a boolean" }).optional(),
|
|
2745
2747
|
environment: ProjectEnvironment.optional()
|
|
2746
2748
|
}).passthrough();
|
|
2747
2749
|
var FILE_CONFIG_SHAPE = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c as loadConfigFile } from "./config-store-SeN0w6cD.js";
|
|
@@ -2,11 +2,11 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { n as equalsIgnoringCaseOnWindows } from "./paths-Bu4eH1Yd.js";
|
|
3
3
|
import { o as packageRoot } from "./runtime-paths-ghcH9CeW.js";
|
|
4
4
|
import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
5
|
-
import { $ as PORT_RANGE, J as FLYING_ANIMALS_GAP_RANGE, K as FLYING_ANIMALS_DEFAULTS, Q as NON_NEGATIVE_NUMBER_RANGE, X as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, Y as FLYING_ANIMALS_SCALE_RANGE, Z as MEMORY_RESERVE_MB_RANGE, at as REPLAY_BUFFER_KB_RANGE, ct as USAGE_INTEGER_RANGES, d as USAGE_COST_MODES, dt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, et as POSITIVE_NUMBER_RANGE, ft as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, i as Config, it as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, l as configIssueMessage, lt as USAGE_RETAIN_DAYS_RANGE, n as BUILTIN_AGENT_IDS, nt as POSTHOG_TRAFFIC_BASELINE_RANGE, ot as TASK_TITLE_TIMEOUT_RANGE, p as normalizeLegacyConfigNumbers, pt as UPDATE_CHANNELS, q as FLYING_ANIMALS_DURATION_RANGE, rt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as USAGE_BUDGET_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as POSTHOG_FIX_TIMEOUT_RANGE, u as BranchGcFileSettings, ut as USAGE_SCAN_INTERVAL_RANGE } from "./config-
|
|
5
|
+
import { $ as PORT_RANGE, J as FLYING_ANIMALS_GAP_RANGE, K as FLYING_ANIMALS_DEFAULTS, Q as NON_NEGATIVE_NUMBER_RANGE, X as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, Y as FLYING_ANIMALS_SCALE_RANGE, Z as MEMORY_RESERVE_MB_RANGE, at as REPLAY_BUFFER_KB_RANGE, ct as USAGE_INTEGER_RANGES, d as USAGE_COST_MODES, dt as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, et as POSITIVE_NUMBER_RANGE, ft as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, i as Config, it as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, l as configIssueMessage, lt as USAGE_RETAIN_DAYS_RANGE, n as BUILTIN_AGENT_IDS, nt as POSTHOG_TRAFFIC_BASELINE_RANGE, ot as TASK_TITLE_TIMEOUT_RANGE, p as normalizeLegacyConfigNumbers, pt as UPDATE_CHANNELS, q as FLYING_ANIMALS_DURATION_RANGE, rt as POSTHOG_TRAFFIC_MIN_USERS_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, st as USAGE_BUDGET_RANGE, t as AGENT_ID_SHAPE_MESSAGE, tt as POSTHOG_FIX_TIMEOUT_RANGE, u as BranchGcFileSettings, ut as USAGE_SCAN_INTERVAL_RANGE } from "./config-BYsrGS5K.js";
|
|
6
6
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
7
7
|
import { t as DEFAULT_TIMER_FNS } from "./timer-deps-u2DAQLok.js";
|
|
8
8
|
import { d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-BjFK_eSH.js";
|
|
9
|
-
import { f as TELEMETRY_KILL_SWITCH_FLAG, l as FeatureFlagsResponse, n as isExperimentalBuild } from "./build-channel-
|
|
9
|
+
import { f as TELEMETRY_KILL_SWITCH_FLAG, l as FeatureFlagsResponse, n as isExperimentalBuild } from "./build-channel-DNz_uA_k.js";
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import os from "node:os";
|
|
@@ -3509,6 +3509,7 @@ var DEFAULT_CONFIG = {
|
|
|
3509
3509
|
var DEFAULT_CONFIG_BY_KEY = DEFAULT_CONFIG;
|
|
3510
3510
|
var ABORT_CONFIG_SAVE = "abort-config-save";
|
|
3511
3511
|
var CONFIG_DIR_MODE = 448;
|
|
3512
|
+
var CONFIG_RELOAD_DEBOUNCE_MS = 500;
|
|
3512
3513
|
function glimmervoidHomeDir() {
|
|
3513
3514
|
return glimmervoidHomeDir$1(os.homedir(), process.env);
|
|
3514
3515
|
}
|
|
@@ -3969,7 +3970,7 @@ function createConfigStore({ settingsDefaults, readTelemetryInstallId, isExperim
|
|
|
3969
3970
|
config.hooks = Array.isArray(newConfig.hooks) ? newConfig.hooks : [];
|
|
3970
3971
|
if (newConfig.port != null && newConfig.port !== config.port) console.log(`[settings] Port changed to ${newConfig.port} - restart required to take effect`);
|
|
3971
3972
|
}
|
|
3972
|
-
function watchForChanges(callback) {
|
|
3973
|
+
function watchForChanges(callback, { reloadDebounceMs = CONFIG_RELOAD_DEBOUNCE_MS } = {}) {
|
|
3973
3974
|
let reloadTimer = null;
|
|
3974
3975
|
let watcher = null;
|
|
3975
3976
|
function handleConfigChange(err, data) {
|
|
@@ -4005,7 +4006,7 @@ function createConfigStore({ settingsDefaults, readTelemetryInstallId, isExperim
|
|
|
4005
4006
|
if (reloadTimer) clearTimeoutFn(reloadTimer);
|
|
4006
4007
|
reloadTimer = setTimeoutFn(() => {
|
|
4007
4008
|
fs.readFile(configPath, "utf8", handleConfigChange);
|
|
4008
|
-
},
|
|
4009
|
+
}, reloadDebounceMs);
|
|
4009
4010
|
});
|
|
4010
4011
|
console.log("[config] Watching config.json for changes");
|
|
4011
4012
|
} catch (watchErr) {
|
|
@@ -5,9 +5,9 @@ import { c as resolvePackageBin, i as clientDir, n as bundled, o as packageRoot,
|
|
|
5
5
|
import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-DUWk0Lui.js";
|
|
6
6
|
import { $ as MyPrMergeStateResponse, $t as MERGEABLE_LIVE_STATES, A as SHOWN_FILE_CAP_BYTES, At as TeamReviewResolveResponse, B as TaskTitle, C as ConversationQuestion, Ct as ReviewFinding, Dt as TeamReviewActionRequest, E as SESSION_DOC_BODY_CAP_BYTES, Et as ReviewVerdict, Ft as TeamReviewThreadsRepository, G as MyPrCheckContext, Gt as REPO_SLUG_RE, H as LinkedPr, Ht as shortSha, I as ShownFile, It as canApproveAfterComment, K as MyPrCheckContextsResponse, Kt as repoParts, Lt as decisionAsIfApprovalRequired, M as SSH_SIGN_BODY_CAP_BYTES, Mt as TeamReviewStatus, Nt as TeamReviewThreadCommentsResponse, O as SESSION_NAME_PATTERN, Pt as TeamReviewThreadResult, Qt as KILLABLE_STATES, R as SshSignRequest, St as ReviewDraft, Tt as ReviewThreadId, U as MyPr, Ut as GH_SEGMENT, Vt as HEX_SHA_RE, W as MyPrAutoRebase, Wt as NODE_ID_RE, X as MyPrMergeMethod, Y as MyPrLaneEntry, Z as MyPrMergeRequest, Zt as BADGE_LABELS, _ as CONVERSATION_PERMISSION_HOOK_EVENT, _t as PostedReviewEvent, at as MyPrsSnapshot, dt as CommitSha, en as RESTARTABLE_STATES, et as MyPrMergeWhenReadyRequest, ft as DECIDING_REVIEW_STATES, g as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, gt as GithubReviewState, h as COHERENCE_HOOKS_INACTIVE, it as MyPrThreadsResponse, j as SIGN_URL_ENV, jt as TeamReviewStateEntry, k as SESSION_NAME_RULE_TEXT, kt as TeamReviewCompareFiles, mt as FindingSeverity, n as AGENT_URL_ENV, ot as MyPrsState, pt as EarlierReview, q as MyPrKeepMergeableRequest, r as ASK_USER_QUESTION_TOOL_NAME, rt as MyPrThreadNode, tn as STATES, v as CONVERSATION_TOOL_RESULT_HOOK_EVENT, vt as PostingPlan, wt as ReviewResult, xt as ReviewComment, yt as PrDetail, zt as hasStandingViewerApproval } from "./session-BF6eF7dw.js";
|
|
7
7
|
import { n as execFileAsync, o as spawn, r as execFileSync, t as execFile } from "./child-process-safe-D4hyVIXj.js";
|
|
8
|
-
import { A as BenchmarkRun, At as parseExitPlanModeHookPayload, B as GithubPrsFrame, Ct as PLAN_BODY_CAP_BYTES, D as BenchmarkCase, Dt as PLAN_TOOL_NAME, E as BenchmarkActionRequest, Et as PLAN_RESULT_HOOK_EVENT, F as MinedPrReviewData, Ft as IssueUpdate, G as WorkflowsState, H as WorkflowCommentBody, I as PrCheckoutCaseInput, It as IssuesSearchResponse, L as GithubPrDetailNode, Lt as IssuesState, M as BenchmarkSuite, Mt as GithubIssuePullRequestsRepository, N as CommitComparison, Nt as GithubIssueResponse, O as BenchmarkId, Ot as PlanDecision, P as MergedPrListing, Pt as IssueKey, R as GithubPrKey, Rt as IssuesStatus, St as changeMapFactId, T as pullRequestKeyFromReference, Tt as PLAN_HOOK_OUTPUT_MAX_CHARS, U as WorkflowLabelName, V as comparablePrKey, W as WorkflowsSettings, X as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, _ as CONTROL_FRAME_MAX_BYTES, _t as MAX_RAW_LINE_CHARS, a as ConfigUpdate, bt as CoherenceJournalOutput, ct as USAGE_INTEGER_RANGES, d as USAGE_COST_MODES, f as USAGE_VENDOR_KEYS, g as CLIENT_LOG_TEXT_MAX_CHARS, gt as SessionSetup, ht as UpdateJournal, j as BenchmarkStatus, jt as planTitle, k as BenchmarkJudgement, kt as PlanRevision, l as configIssueMessage, m as CHANGES_POLL_INTERVAL_MS, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, v as ClientMessage, vt as TraceCheckpoint, wt as PLAN_HOOK_EVENT, xt as ChangeMap, yt as TraceRecord, z as GithubPrLightSearchNode, zt as issuePullRequestStateFromGithub } from "./config-
|
|
8
|
+
import { A as BenchmarkRun, At as parseExitPlanModeHookPayload, B as GithubPrsFrame, Ct as PLAN_BODY_CAP_BYTES, D as BenchmarkCase, Dt as PLAN_TOOL_NAME, E as BenchmarkActionRequest, Et as PLAN_RESULT_HOOK_EVENT, F as MinedPrReviewData, Ft as IssueUpdate, G as WorkflowsState, H as WorkflowCommentBody, I as PrCheckoutCaseInput, It as IssuesSearchResponse, L as GithubPrDetailNode, Lt as IssuesState, M as BenchmarkSuite, Mt as GithubIssuePullRequestsRepository, N as CommitComparison, Nt as GithubIssueResponse, O as BenchmarkId, Ot as PlanDecision, P as MergedPrListing, Pt as IssueKey, R as GithubPrKey, Rt as IssuesStatus, St as changeMapFactId, T as pullRequestKeyFromReference, Tt as PLAN_HOOK_OUTPUT_MAX_CHARS, U as WorkflowLabelName, V as comparablePrKey, W as WorkflowsSettings, X as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, _ as CONTROL_FRAME_MAX_BYTES, _t as MAX_RAW_LINE_CHARS, a as ConfigUpdate, bt as CoherenceJournalOutput, ct as USAGE_INTEGER_RANGES, d as USAGE_COST_MODES, f as USAGE_VENDOR_KEYS, g as CLIENT_LOG_TEXT_MAX_CHARS, gt as SessionSetup, ht as UpdateJournal, j as BenchmarkStatus, jt as planTitle, k as BenchmarkJudgement, kt as PlanRevision, l as configIssueMessage, m as CHANGES_POLL_INTERVAL_MS, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, v as ClientMessage, vt as TraceCheckpoint, wt as PLAN_HOOK_EVENT, xt as ChangeMap, yt as TraceRecord, z as GithubPrLightSearchNode, zt as issuePullRequestStateFromGithub } from "./config-BYsrGS5K.js";
|
|
9
9
|
import { a as permitsHelpCommand, r as describeSessionLimits } from "./session-routes-gzOQJb1W.js";
|
|
10
|
-
import { A as seedTaskTitleSources, B as listRepoWorktreePaths, C as extractPromptTaskTitle, D as parseRefinedTaskTitle, E as parseRefinedSessionName, F as resumePromptFor, H as nextSuggestedName, I as shouldAdoptReportedResumeId, L as claudeProjectsDir, M as RESUME_ID_RE, N as pickAutoResume, O as resolveRefocusTaskTitle, P as resolveResumeTarget, R as encodeProjectDir, S as extractOscTaskTitle, T as isSubstantivePrompt, V as isAutoNameOf, _ as buildTaskTitleRefinementPrompt, a as decideSpawnAllowance, b as decideTaskTitleRefinement, c as describeKeptChildAttention, d as describeUnpushedCloseRefusal, g as buildPersistedTaskTitle, h as projectReviews, i as decideAgentRequest, j as AUTO_CONTINUE_PROMPT, k as resolveTaskTitle, l as describePushLanding, m as projectMyPrs, n as REFUSAL_REASON, o as deriveChildSessionName, p as parseAgentVerb, s as describeChildEndNote, u as describeRoleRefusal, v as chooseRefinedSessionName, w as isSelfWakePrompt, x as extractAiTitle, y as cleanTaskPrompt, z as listRepoConversations } from "./agent-api-core-
|
|
10
|
+
import { A as seedTaskTitleSources, B as listRepoWorktreePaths, C as extractPromptTaskTitle, D as parseRefinedTaskTitle, E as parseRefinedSessionName, F as resumePromptFor, H as nextSuggestedName, I as shouldAdoptReportedResumeId, L as claudeProjectsDir, M as RESUME_ID_RE, N as pickAutoResume, O as resolveRefocusTaskTitle, P as resolveResumeTarget, R as encodeProjectDir, S as extractOscTaskTitle, T as isSubstantivePrompt, V as isAutoNameOf, _ as buildTaskTitleRefinementPrompt, a as decideSpawnAllowance, b as decideTaskTitleRefinement, c as describeKeptChildAttention, d as describeUnpushedCloseRefusal, g as buildPersistedTaskTitle, h as projectReviews, i as decideAgentRequest, j as AUTO_CONTINUE_PROMPT, k as resolveTaskTitle, l as describePushLanding, m as projectMyPrs, n as REFUSAL_REASON, o as deriveChildSessionName, p as parseAgentVerb, s as describeChildEndNote, u as describeRoleRefusal, v as chooseRefinedSessionName, w as isSelfWakePrompt, x as extractAiTitle, y as cleanTaskPrompt, z as listRepoConversations } from "./agent-api-core-JTVlt1Pv.js";
|
|
11
11
|
import { a as positiveIntOr, c as textOr, i as numberOr, n as isRecord, o as positiveNumberOr, r as nonNegativeIntOr, s as rawTextOr, t as coercedNumberOr } from "./coerce-NSst8oRP.js";
|
|
12
12
|
import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-C-IkI4sr.js";
|
|
13
13
|
import { n as checkGuardrailsDependencies, t as allowGuardedSpawn } from "./guardrails-deps-BjPzk1rE.js";
|
|
@@ -22,13 +22,13 @@ import { n as unrefTimer, t as DEFAULT_TIMER_FNS } from "./timer-deps-u2DAQLok.j
|
|
|
22
22
|
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-Bkuessu6.js";
|
|
23
23
|
import { n as shellQuote } from "./hook-command-core-qTNK-xMF.js";
|
|
24
24
|
import { C as parseCgroupBytes, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, f as writeTextAtomic, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-BjFK_eSH.js";
|
|
25
|
-
import { $ as resolveProjectToken, B as buildAiGenerationEvents, G as claudeAccountUuidOf, H as buildExceptionProperties, I as FIRST_RUN_NOTICE, J as decideRemoteTelemetryState, K as codexUserIdOf, L as TELEMETRY_BATCH_URL, Q as parsePosthogReleaseId, R as TELEMETRY_FLAGS_URL, S as validateSettingsBlock, U as buildPersonProperties, V as buildBrowserExceptionProperties, W as classifySessionExit, X as exceptionFingerprint, Y as decideTelemetryConsent, Z as nodeMajorVersion, _ as isRtkBinaryName, a as ensureProjectIds, at as matchedPrefix, b as mergeSettingsBlock, ct as sessionIdFromBranch, dt as canonicalizePath, ft as comparableDirectoryPath, g as installTargetPath, h as findEscapingArchiveMember, i as createConfigStore, it as DEFAULT_BRANCH_GC_PREFIXES, lt as usablePrefixes, m as decideRtkInstall, n as DEFAULT_CONFIG, nt as stableConfigKey, o as generateProjectId, ot as planBranchGc, p as assetForPlatform, pt as isSameDirectoryPath, q as decideIsDevInstall, s as glimmervoidHomeDir$1, st as planWorktreeGc, t as ABORT_CONFIG_SAVE, ut as worktreeIntegrationTips, v as verifyDigest, x as settingsBlockSpecFor, z as adapterBucket } from "./config-store-
|
|
26
|
-
import { a as DEEP_HISTORY_SCROLLBACK_LINES, c as DashboardTelemetryReport, d as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, o as parseDataAttach, p as TelemetryState, r as HTTP_URL_RE, s as parseDataClientMessage, u as PendingCrashReport } from "./build-channel-
|
|
27
|
-
import { A as decideFileRead, B as shouldEvaluateDespiteIoFailures, C as pickNewestPublished, D as codexRootCandidates, E as codexHomes, F as isUsageFile, H as splitLines$1, I as passOutcome, L as projectDirCandidates, M as expandTilde, N as grokHomes, O as codexSessionIdFromPath, P as grokRootCandidates, R as resolveProjectsDirs, S as parseResolvedSha, T as codexFallbackRoots, U as claudeCode, V as shouldPersistWarehouse, _ as isCheckFresh, a as describeAgentResolvability, b as parseRegistryDeprecation, c as isKnownAgentId, d as resolveAdapter, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, j as dedupeCodexFiles, k as continuationDelayMs, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, o as getAdapter, p as codex, r as commandFor, s as hookProfileOf, t as DEFAULT_AGENT_ID, u as resetCommandCache, v as normalizeSha, w as shortSha$1, x as parseRegistryLatest, y as normalizeUpdateChannel, z as scopedClaudeRoots } from "./adapters-
|
|
25
|
+
import { $ as resolveProjectToken, B as buildAiGenerationEvents, G as claudeAccountUuidOf, H as buildExceptionProperties, I as FIRST_RUN_NOTICE, J as decideRemoteTelemetryState, K as codexUserIdOf, L as TELEMETRY_BATCH_URL, Q as parsePosthogReleaseId, R as TELEMETRY_FLAGS_URL, S as validateSettingsBlock, U as buildPersonProperties, V as buildBrowserExceptionProperties, W as classifySessionExit, X as exceptionFingerprint, Y as decideTelemetryConsent, Z as nodeMajorVersion, _ as isRtkBinaryName, a as ensureProjectIds, at as matchedPrefix, b as mergeSettingsBlock, ct as sessionIdFromBranch, dt as canonicalizePath, ft as comparableDirectoryPath, g as installTargetPath, h as findEscapingArchiveMember, i as createConfigStore, it as DEFAULT_BRANCH_GC_PREFIXES, lt as usablePrefixes, m as decideRtkInstall, n as DEFAULT_CONFIG, nt as stableConfigKey, o as generateProjectId, ot as planBranchGc, p as assetForPlatform, pt as isSameDirectoryPath, q as decideIsDevInstall, s as glimmervoidHomeDir$1, st as planWorktreeGc, t as ABORT_CONFIG_SAVE, ut as worktreeIntegrationTips, v as verifyDigest, x as settingsBlockSpecFor, z as adapterBucket } from "./config-store-SeN0w6cD.js";
|
|
26
|
+
import { a as DEEP_HISTORY_SCROLLBACK_LINES, c as DashboardTelemetryReport, d as TELEMETRY_EVENT_SCHEMAS, i as HookEnvelope, o as parseDataAttach, p as TelemetryState, r as HTTP_URL_RE, s as parseDataClientMessage, u as PendingCrashReport } from "./build-channel-DNz_uA_k.js";
|
|
27
|
+
import { A as decideFileRead, B as shouldEvaluateDespiteIoFailures, C as pickNewestPublished, D as codexRootCandidates, E as codexHomes, F as isUsageFile, H as splitLines$1, I as passOutcome, L as projectDirCandidates, M as expandTilde, N as grokHomes, O as codexSessionIdFromPath, P as grokRootCandidates, R as resolveProjectsDirs, S as parseResolvedSha, T as codexFallbackRoots, U as claudeCode, V as shouldPersistWarehouse, _ as isCheckFresh, a as describeAgentResolvability, b as parseRegistryDeprecation, c as isKnownAgentId, d as resolveAdapter, f as setCustomAgents, g as decideUpdateStatus, h as decideInstallFlavor, i as customAgentFingerprint, j as dedupeCodexFiles, k as continuationDelayMs, l as listAgentIds, m as readHostCodexVersion, n as cachedAgentResolvability, o as getAdapter, p as codex, r as commandFor, s as hookProfileOf, t as DEFAULT_AGENT_ID, u as resetCommandCache, v as normalizeSha, w as shortSha$1, x as parseRegistryLatest, y as normalizeUpdateChannel, z as scopedClaudeRoots } from "./adapters-D8q7K0IN.js";
|
|
28
28
|
import { t as HOOK_TOOLS } from "./hook-tools-Dl7-r2Eb.js";
|
|
29
29
|
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";
|
|
30
|
-
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-
|
|
31
|
-
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-
|
|
30
|
+
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-BQ0ggoxv.js";
|
|
31
|
+
import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-C1uJhry6.js";
|
|
32
32
|
import { _ as escapeMarkup, g as createLaneLog, n as createVisionsSetup } from "./visions-setup-VMMyqOpl.js";
|
|
33
33
|
import { t as getRtkPath } from "./rtk-resolver-C_IReILP.js";
|
|
34
34
|
import { createRequire } from "node:module";
|
|
@@ -4701,6 +4701,7 @@ function createAgentApiWiring({ config, agentSessions, listAllSessions, listBoar
|
|
|
4701
4701
|
name,
|
|
4702
4702
|
path: parent.path,
|
|
4703
4703
|
dangerouslySkipPermissions: parent.dangerouslySkipPermissions,
|
|
4704
|
+
saneYolo: parent.saneYolo,
|
|
4704
4705
|
unguarded: !parent.isGuarded
|
|
4705
4706
|
};
|
|
4706
4707
|
let child = null;
|
|
@@ -39649,7 +39650,7 @@ async function forwardedSocketsIn(searchRoot, ownerUid) {
|
|
|
39649
39650
|
const socketPaths = (await Promise.all(agentDirs.map(async (agentDir) => (await readEntryNames(agentDir)).map((entryName) => path.join(agentDir, entryName))))).flat();
|
|
39650
39651
|
return (await Promise.all(socketPaths.map((socketPath) => ownedSocketAt(socketPath, ownerUid)))).filter((candidate) => candidate !== null);
|
|
39651
39652
|
}
|
|
39652
|
-
function createSshSigner({ env = process.env, agentSearchRoots = defaultAgentSearchRoots(), ownerUid = process.getuid?.() ?? null, agentWaitMs = FORWARDED_AGENT_RECONNECT_WAIT_MS } = {}) {
|
|
39653
|
+
function createSshSigner({ env = process.env, agentSearchRoots = defaultAgentSearchRoots(), ownerUid = process.getuid?.() ?? null, agentWaitMs = FORWARDED_AGENT_RECONNECT_WAIT_MS, agentRescanIntervalMs = AGENT_RESCAN_INTERVAL_MS } = {}) {
|
|
39653
39654
|
async function agentHolds(socketPath, publicKey) {
|
|
39654
39655
|
const listing = await execFileAsync("ssh-add", ["-L"], {
|
|
39655
39656
|
env: {
|
|
@@ -39674,7 +39675,7 @@ function createSshSigner({ env = process.env, agentSearchRoots = defaultAgentSea
|
|
|
39674
39675
|
const agentEnv = await agentEnvFor(publicKey);
|
|
39675
39676
|
if (agentEnv || Date.now() >= deadlineMs) return agentEnv;
|
|
39676
39677
|
await new Promise((resolve) => {
|
|
39677
|
-
setTimeout(resolve,
|
|
39678
|
+
setTimeout(resolve, agentRescanIntervalMs);
|
|
39678
39679
|
});
|
|
39679
39680
|
return agentEnvBefore(publicKey, deadlineMs);
|
|
39680
39681
|
}
|
|
@@ -44834,7 +44835,7 @@ async function pruneTraceFiles({ traceDirectory, now = Date.now(), isBoundSessio
|
|
|
44834
44835
|
isRetainedId: isBoundSessionId
|
|
44835
44836
|
})).length;
|
|
44836
44837
|
}
|
|
44837
|
-
function createTraceWiring({ configPath = null, logger = console, debug = false, nowFn = Date.now, setIntervalFn = DEFAULT_TIMER_FNS.setIntervalFn, clearIntervalFn = DEFAULT_TIMER_FNS.clearIntervalFn } = {}) {
|
|
44838
|
+
function createTraceWiring({ configPath = null, logger = console, debug = false, nowFn = Date.now, setIntervalFn = DEFAULT_TIMER_FNS.setIntervalFn, clearIntervalFn = DEFAULT_TIMER_FNS.clearIntervalFn, maxRememberedSubagents = 512 } = {}) {
|
|
44838
44839
|
const traceDirectory = configSiblingPath(configPath, "traces");
|
|
44839
44840
|
const emitter = new EventEmitter();
|
|
44840
44841
|
const bindingByGlimmervoidSessionId = /* @__PURE__ */ new Map();
|
|
@@ -45042,7 +45043,7 @@ function createTraceWiring({ configPath = null, logger = console, debug = false,
|
|
|
45042
45043
|
didFallbackToTranscriptEnd: resume.didFallbackToTranscriptEnd,
|
|
45043
45044
|
scannedBytes: traceTail.scannedBytes,
|
|
45044
45045
|
committedOffsetByTranscriptPath: checkpoint ? checkpoint.offsetByTranscriptPath : {},
|
|
45045
|
-
subagentPathsWithoutOffset: subagentPathsWithoutOffset.slice(-
|
|
45046
|
+
subagentPathsWithoutOffset: subagentPathsWithoutOffset.slice(-maxRememberedSubagents),
|
|
45046
45047
|
subagentOffsetByPath
|
|
45047
45048
|
};
|
|
45048
45049
|
}
|
|
@@ -45376,7 +45377,7 @@ function createTraceWiring({ configPath = null, logger = console, debug = false,
|
|
|
45376
45377
|
committedOffset = readEnd;
|
|
45377
45378
|
isSkippingOversizedLine = true;
|
|
45378
45379
|
}
|
|
45379
|
-
binding.subagentOffsetByPath = withCommittedOffset(binding.subagentOffsetByPath, subagentPath, committedOffset, { maxRemembered:
|
|
45380
|
+
binding.subagentOffsetByPath = withCommittedOffset(binding.subagentOffsetByPath, subagentPath, committedOffset, { maxRemembered: maxRememberedSubagents });
|
|
45380
45381
|
binding.subagentPathsWithoutOffset.delete(subagentPath);
|
|
45381
45382
|
} catch (error) {
|
|
45382
45383
|
laneLog.warn("subagent transcript read failed", { error: errorMessage(error) });
|
|
@@ -50065,7 +50066,11 @@ function createSessionFactory(dependencies) {
|
|
|
50065
50066
|
}
|
|
50066
50067
|
return function makeSession(project, config, overrides = {}) {
|
|
50067
50068
|
const skipPermissions = projectSkipsPermissions(project, machineSkipsPermissionsByDefault(config));
|
|
50068
|
-
const
|
|
50069
|
+
const hookToolConfig = (currentConfig) => project.saneYolo === true ? {
|
|
50070
|
+
...currentConfig,
|
|
50071
|
+
saneYolo: true
|
|
50072
|
+
} : currentConfig;
|
|
50073
|
+
const originalHookTools = dependencies.resolveHookTools(hookToolConfig(config), { skipPermissions });
|
|
50069
50074
|
const prepareCoherence = overrides.ephemeral ? null : (cwd, confine) => resolveCoherence({
|
|
50070
50075
|
worktree: cwd,
|
|
50071
50076
|
confine,
|
|
@@ -50102,7 +50107,7 @@ function createSessionFactory(dependencies) {
|
|
|
50102
50107
|
detectBackgroundAgents: config.detectBackgroundAgents,
|
|
50103
50108
|
detectScheduledWakeups: config.detectScheduledWakeups,
|
|
50104
50109
|
hookTools: originalHookTools,
|
|
50105
|
-
getHookTools: () => refreshRtkHookTools(originalHookTools, dependencies.resolveHookTools(dependencies.getConfig?.() ?? config, { skipPermissions })),
|
|
50110
|
+
getHookTools: () => refreshRtkHookTools(originalHookTools, dependencies.resolveHookTools(hookToolConfig(dependencies.getConfig?.() ?? config), { skipPermissions })),
|
|
50106
50111
|
resumeSessionId: project.resumeSessionId || null,
|
|
50107
50112
|
planReviewPort: dependencies.getPlanReviewPort(),
|
|
50108
50113
|
planLimits: planLimitsEnabled(config),
|
|
@@ -50161,7 +50166,8 @@ function deriveIssueSessionName(issue) {
|
|
|
50161
50166
|
var COPIED_RUN_SETTINGS = [
|
|
50162
50167
|
"baseBranch",
|
|
50163
50168
|
"codexBypassHookTrust",
|
|
50164
|
-
"conversationView"
|
|
50169
|
+
"conversationView",
|
|
50170
|
+
"saneYolo"
|
|
50165
50171
|
];
|
|
50166
50172
|
var AUTO_NAME_SUFFIX = / \(\d+\)$/;
|
|
50167
50173
|
function autoNameBase(name) {
|
|
@@ -51933,6 +51939,7 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
51933
51939
|
repos,
|
|
51934
51940
|
agent: requestedAgent && requestedAgent !== DEFAULT_AGENT_ID ? requestedAgent : void 0,
|
|
51935
51941
|
dangerouslySkipPermissions: skipPerms,
|
|
51942
|
+
saneYolo: skipPerms && msg.saneYolo === true,
|
|
51936
51943
|
unguarded: msg.unguarded === true,
|
|
51937
51944
|
requireExistingPath: !repos,
|
|
51938
51945
|
environment: remote?.environment,
|
|
@@ -52680,7 +52687,7 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
52680
52687
|
}
|
|
52681
52688
|
return entries;
|
|
52682
52689
|
}
|
|
52683
|
-
function createProjectSession({ id = generateProjectId(), name, path: projectPath, repos, baseBranch, agent, dangerouslySkipPermissions, unguarded, requireExistingPath, environment, runSettings }) {
|
|
52690
|
+
function createProjectSession({ id = generateProjectId(), name, path: projectPath, repos, baseBranch, agent, dangerouslySkipPermissions, saneYolo, unguarded, requireExistingPath, environment, runSettings }) {
|
|
52684
52691
|
for (const [, session] of sessions) {
|
|
52685
52692
|
if (session.name !== name) continue;
|
|
52686
52693
|
return {
|
|
@@ -52722,6 +52729,7 @@ function registerControlHandlers(controlWss, deps) {
|
|
|
52722
52729
|
if (workspaceRepos) project.repos = workspaceRepos;
|
|
52723
52730
|
if (baseBranch) project.baseBranch = baseBranch;
|
|
52724
52731
|
if (typeof dangerouslySkipPermissions === "boolean") project.dangerouslySkipPermissions = dangerouslySkipPermissions;
|
|
52732
|
+
if (saneYolo) project.saneYolo = true;
|
|
52725
52733
|
if (unguarded) project.unguarded = true;
|
|
52726
52734
|
if (agent) project.agent = agent;
|
|
52727
52735
|
if (environment) project.environment = environment;
|
|
@@ -58098,7 +58106,7 @@ function createBackend(httpServer, options = {}) {
|
|
|
58098
58106
|
stopConfigWatch = configStore.watchForChanges((newConfig) => {
|
|
58099
58107
|
applyConfigReload(newConfig);
|
|
58100
58108
|
broadcastSettings?.();
|
|
58101
|
-
});
|
|
58109
|
+
}, { reloadDebounceMs: options.configReloadDebounceMs });
|
|
58102
58110
|
updateCheck.start();
|
|
58103
58111
|
return {
|
|
58104
58112
|
shutdown,
|
|
@@ -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-SeN0w6cD.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-BQ0ggoxv.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region server/text-format.ts
|
|
6
6
|
function trimIso(iso) {
|
|
@@ -3,7 +3,7 @@ import { n as equalsIgnoringCaseOnWindows } from "./paths-Bu4eH1Yd.js";
|
|
|
3
3
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
4
4
|
import { n as unrefTimer, t as DEFAULT_TIMER_FNS } from "./timer-deps-u2DAQLok.js";
|
|
5
5
|
import { a as jsonStateLoadError, d as writeJsonAtomicSync, l as sleepSync, s as loadJsonStateFileSync, u as writeJsonAtomic } from "./json-file-BjFK_eSH.js";
|
|
6
|
-
import { dt as canonicalizePath, s as glimmervoidHomeDir } from "./config-store-
|
|
6
|
+
import { dt as canonicalizePath, s as glimmervoidHomeDir } from "./config-store-SeN0w6cD.js";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
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 { f as AgentSettingsReply } from "./session-BF6eF7dw.js";
|
|
4
|
-
import { r as BrowserConfig } from "./config-
|
|
4
|
+
import { r as BrowserConfig } from "./config-BYsrGS5K.js";
|
|
5
5
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
6
6
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
7
|
-
import { A as setValueAtPath, F as SETTINGS_REGISTRY, N as valueAtPath, O as parsePosthogProjectSelection, T as deleteValueAtPath, c as loadConfigFile, d as validateConfig, et as ENV_SECRET_BINDINGS, f as isSettingAvailable, k as scoreSettingsSearch, r as IS_EXPERIMENTAL_BUILD, rt as withEnvSecrets, tt as readEnvSecrets, u as saveConfigFileOnce, w as cloneValue } 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 { A as setValueAtPath, F as SETTINGS_REGISTRY, N as valueAtPath, O as parsePosthogProjectSelection, T as deleteValueAtPath, c as loadConfigFile, d as validateConfig, et as ENV_SECRET_BINDINGS, f as isSettingAvailable, k as scoreSettingsSearch, r as IS_EXPERIMENTAL_BUILD, rt as withEnvSecrets, tt as readEnvSecrets, u as saveConfigFileOnce, w as cloneValue } from "./config-store-SeN0w6cD.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-C1uJhry6.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-BNP5jgzo.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 { p as AgentSettingsRequest } from "./session-BF6eF7dw.js";
|
|
2
2
|
import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
|
|
3
|
-
import { C as SETTINGS_INDEX, D as hasScaledUnit, E as displayText, F as SETTINGS_REGISTRY, M as settingsOf, N as valueAtPath, P as FILE_ONLY_GROUPS, f as isSettingAvailable, j as settingsGroupOf, tt as readEnvSecrets, w as cloneValue } from "./config-store-
|
|
3
|
+
import { C as SETTINGS_INDEX, D as hasScaledUnit, E as displayText, F as SETTINGS_REGISTRY, M as settingsOf, N as valueAtPath, P as FILE_ONLY_GROUPS, f as isSettingAvailable, j as settingsGroupOf, tt as readEnvSecrets, w as cloneValue } from "./config-store-SeN0w6cD.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 { L as SshSignReply, j as SIGN_URL_ENV } from "./session-BF6eF7dw.js";
|
|
3
3
|
import { n as execFileAsync, o as spawn } from "./child-process-safe-D4hyVIXj.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-BghkyG7c.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{C as e,gt as t,o as n,x as r,yt as i}from"./dom-helpers-
|
|
1
|
+
import{C as e,gt as t,o as n,x as r,yt as i}from"./dom-helpers-B98sy9ep.js";import{l as a,u as o}from"./control-ws-C8SS9PPx.js";var s=`http://www.w3.org/2000/svg`;function c(e,t){let n=document.createElementNS(s,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function l(e,t){let n=document.createElementNS(s,`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 u=`M4 4L12 12M12 4L4 12`,d=`M12 8a4 4 0 1 1-8 0a4 4 0 1 1 8 0M8 1.5v2.5M8 12v2.5M1.5 8h2.5M12 8h2.5M3.4 3.4l1.77 1.77M10.83 10.83l1.77 1.77M3.4 12.6l1.77-1.77M10.83 5.17l1.77-1.77`,f=`M3 4h10M3 8h10M3 12h10`,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`,_=`${g}M2 2l12 12`,v=`M9.2 1.5L3.5 9h4.3l-1 5.5L12.5 7H8.2z`,y=`M8.7 4.2L5.6 8.6h2.5l-.6 3.2l3.1-4.4H8.1z`,b=`M3 13V9M8 13V3M13 13V6.5`;function x(e,t=`2`){let n=l(16,16);return n.classList.add(`line-icon`),n.append(c(`path`,{d:e,fill:`none`,stroke:`currentColor`,"stroke-width":t,"stroke-linecap":`round`,"stroke-linejoin":`round`})),n}function S(e,t){let{class:n,...r}=t,i=l(16,16);return n!==void 0&&i.classList.add(n),i.append(c(e,r)),i}function C(e){let t=document.createElement(`span`);t.className=`status-icon`,t.dataset.icon=e;for(let n of r[e])t.append(S(n.tag,n.attributes));return t}function w(e,t){e.dataset.icon!==t&&(e.dataset.icon=t,e.replaceChildren(C(t)))}var T={busy:`text-text-muted`,ok:`text-state-done`,error:`text-state-failed`},E=15e3,D=`Something went wrong. Details are hidden in streamer mode.`;function O(e,t){return e!==`error`||t.startsWith(`Not connected to the server. Reconnecting.`)?t:document.documentElement.hasAttribute(`data-streamer`)?D:t}var k={busy:`working`,ok:`complete`,error:`failed`};function A(e){let t=e.querySelector(`:scope > .action-status-icon`),r=e.querySelector(`:scope > .action-status-text`);if(t&&r&&e.childNodes.length===2)return{iconElement:t,textElement:r};let i=n(`span`,`action-status-icon`);i.setAttribute(`aria-hidden`,`true`);let a=n(`span`,`action-status-text`);return e.replaceChildren(i,a),{iconElement:i,textElement:a}}function j(e){e.replaceChildren(),delete e.dataset.tone}function M(e,t,n){if(!n){j(e);return}if(!t){j(e),e.textContent=n;return}e.dataset.tone=t;let{iconElement:r,textElement:i}=A(e);w(r,k[t]),i.textContent=O(t,n)}function N(e=`action-status`){let t=n(`p`,e);return t.setAttribute(`role`,`status`),t.hidden=!0,{element:t,show:(n,r)=>{t.className=`${e} text-xs ${T[n]}`,M(t,n,r),t.hidden=!r},clear:()=>{t.hidden=!0,j(t)}}}function P(t,n){return a(t)?!0:(n.show(`error`,e),!1)}function F(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 I(e,t,n,{busyText:r,timeoutMs:i=E}={}){r&&n.show(`busy`,r);try{let r=await o(e,t,{timeoutMs:i});return n.clear(),r}catch(e){return n.show(`error`,F(e,i)),null}}var L=null,R=3e4,z=null;function B(){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`,G)),{line:e,text:t,age:n})}function V(){let e=B();if(!e||!L)return;let n=i(Date.now()-L.raisedAt,{...t,justNowBelowSeconds:60});e.age.textContent!==n&&(e.age.textContent=n)}function H({source:e,sessionId:t,message:r,hidesInStreamerMode:i=!0}){let a=B();if(!a)return;let o=i?O(`error`,r):r,s=n(`strong`,`header-status-source`,e);a.text.replaceChildren(s,` ${o}`),a.text.title=`${e}: ${o}`,L={source:e,sessionId:t??null,raisedAt:Date.now()},V(),z??=window.setInterval(V,R),a.line.hidden=!1}function U(e,t){L?.source===e&&(t===void 0||L.sessionId===t)&&G()}function W(e){L?.sessionId===e&&G()}function G(){L=null,z!==null&&window.clearInterval(z),z=null;let e=B();e&&(e.line.hidden=!0,e.text.replaceChildren(),e.text.title=``,e.age.textContent=``)}export{l as C,x as S,y as _,M as a,f as b,I as c,v as d,m as f,d as g,p as h,N as i,P as l,h as m,U as n,H as o,u as p,W as r,F as s,E as t,w as u,g as v,c as w,b as x,_ as y};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,r as n}from"./dom-helpers-
|
|
1
|
+
import{n as e,o as t,r as n}from"./dom-helpers-B98sy9ep.js";import{J as r,K as i,q as a}from"./index-5oZZMqqg.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,r){let i=t(`button`,`bench-action-button`,o[n]);return i.type=`button`,i.disabled=r,i.addEventListener(`click`,()=>a(e.id,n)),i}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:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=t(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!a,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`,(a?``:`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}=i(),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),r(h),h())}var _={mount:g};export{_ as view};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bt as e,C as t,It as n,Kt as r,Vt as i,bt as a,o,zt as s}from"./dom-helpers-D7V9q-Y4.js";import{l as c}from"./control-ws-6I4n2_Rl.js";import{d as l,m as u}from"./poll-ago-jEMVa0Q3.js";import{C as d,S as f,_ as p,b as m,d as h,g,h as ee,i as _,l as v,p as te,v as y,w as b,x as ne,y as x}from"./action-status-hJ8vrTK4.js";import{t as S}from"./roving-keys-core-BDobx2It.js";import{i as C,n as w}from"./modal-CpGyiWuk.js";var T=new Map(Object.entries({WAITING:`now`,COMPLETE:`later`,FAILED:`resting`,IDLE:`resting`,RUNNING:`resting`,STARTING:`resting`,INITIALIZING:`resting`,DORMANT:`resting`,DONE:`resting`}));function E(e){return(typeof e.state==`string`?T.get(e.state):void 0)??`resting`}function D(e,t){return[...e].map(([e,n])=>{let i=n.currentState||r.DORMANT;return{id:e,ui:n,name:t(n),isDormant:i===r.DORMANT,state:i,unseenOutcome:n.unseenOutcome??null,ownerId:n.ownerId??null}})}function O(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 k(e){return O([...e].sort((e,t)=>Number(e.isDormant===!0)-Number(t.isDormant===!0)))}function A({ownerName:e,ownedCount:t}){return e===null?t===1?`Owns 1 session`:t>1?`Owns ${t} sessions`:null:`Owned by ${e}`}function j(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 M({state:e,unseenOutcome:t}){if(e===r.WAITING)return`waiting`;let n=i.safeParse(t);return n.success?n.data:null}function N(e={}){return M(e)!==null}var P=new Map([[`failed`,0],[`waiting`,1],[`finished`,2]]);function F(e){let t=M(e);return t===null?void 0:P.get(t)}function I(e){return e.filter(e=>F(e)!==void 0).sort((e,t)=>(F(e)??0)-(F(t)??0)).map(({id:e})=>e)}function L(e,t){let n=new Map(e.map(e=>[e.id,e]));return I(e).flatMap(e=>{let r=n.get(e),i=r?M(r):null;return!r||i===null||e===t?[]:[{id:e,kind:i,name:r.name??``}]})}var re={headTile:32,tile:26,tileGap:4,overflowSlot:40};function ie(e,t){if(t===0)return 0;let{headTile:n,tile:r,tileGap:i,overflowSlot:a}=re,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))}function ae(e){let t={waitingCount:0,finishedCount:0,failedCount:0};for(let n of e||[]){let e=M(n||{});e===`waiting`&&t.waitingCount++,e===`failed`&&t.failedCount++,e===`finished`&&t.finishedCount++}return t}function oe({waitingCount:e,finishedCount:t,failedCount:n}){return e+n+t}function se({waitingCount:e,failedCount:t}){return e+t}function ce({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 le=new Map([[`hand`,2]]),ue=1;function de(e){return e?typeof e==`string`&&le.get(e)||ue:0}function fe(e){let t=!1,n=0;for(let r of e||[]){let e=de(r);e<=n||(t=typeof r!=`string`||r,n=e)}return t}function R(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function z(e,t,n){let r=o(`button`,`popup-menu-item ${n}`);return r.type=`button`,r.setAttribute(`role`,`menuitem`),r.setAttribute(`aria-label`,e),r.append(o(`span`,`popup-menu-item-label`,e),o(`span`,`popup-menu-item-hint`,t)),r}function pe(e){return e.key===`ArrowDown`||e.key===`ArrowUp`}function me(e,t){let n=document.activeElement,r=n instanceof HTMLElement?e.indexOf(n):-1,i=S(t.key,r,e.length,`vertical`);i!==null&&e[i].focus()}function he(e){return e.key===`Home`||e.key===`End`}function B(e){return e.metaKey||e.altKey||e.ctrlKey}function ge(e,t,n){let r=e.relatedTarget;return r instanceof Node&&!t.contains(r)&&!n.contains(r)}function _e({trigger:e,menu:t,menuItems:n,isOpen:r,open:i,close:a,signal:o}){function s(e){e.preventDefault(),e.stopPropagation(),r()||i(),me(n(),e)}e.addEventListener(`keydown`,e=>{!B(e)&&pe(e)&&s(e)},{signal:o}),t.addEventListener(`keydown`,e=>{B(e)||(pe(e)||he(e))&&s(e)},{signal:o}),document.addEventListener(`keydown`,t=>{t.key!==`Escape`||t.defaultPrevented||!r()||C()||(t.preventDefault(),a(),e.focus())},{signal:o});for(let n of[e,t])n.addEventListener(`focusout`,n=>{r()&&ge(n,t,e)&&a()},{signal:o})}var ve=`hover-tip`,ye=`[data-tip-label]`,be=6,xe=8,V=null,H=null;function Se(e){return e instanceof Element?e.closest(ye):null}function Ce(){return V||(V=o(`div`,`hover-tip`),V.id=ve,V.setAttribute(`role`,`tooltip`),V.hidden=!0,document.body.append(V),V)}function we(e,t){let n=o(`span`,`hover-tip-text`);n.append(o(`b`,`hover-tip-label`,t.dataset.tipLabel??``));let r=t.dataset.tipDetail;r&&n.append(o(`span`,`hover-tip-detail`,r));let i=t.querySelector(`svg`)?.cloneNode(!0);e.replaceChildren(...i?[i]:[],n)}function Te(e,t){let n=t.getBoundingClientRect(),r=e.offsetWidth,i=window.innerWidth-r-xe,a=Math.max(xe,Math.min(n.right-r,i));e.style.left=`${a}px`,e.style.top=`${n.bottom+be}px`}function U(e){let t=Ce();H&&H!==e&&H.removeAttribute(`aria-describedby`),H=e,we(t,e),t.hidden=!1,Te(t,e),e.setAttribute(`aria-describedby`,ve)}function W(){H&&(H.removeAttribute(`aria-describedby`),H=null,V&&(V.hidden=!0))}function G(e){H===e&&(!e.dataset.tipLabel||!e.isConnected?W():U(e))}var Ee=!1;function De(){Ee||(Ee=!0,document.addEventListener(`pointerover`,e=>{let t=Se(e.target);t?U(t):W()}),document.addEventListener(`pointerout`,e=>{H&&(e.relatedTarget instanceof Node&&H.contains(e.relatedTarget)||W())}),document.addEventListener(`focusin`,e=>{let t=Se(e.target);t?U(t):W()}),document.addEventListener(`focusout`,W),document.addEventListener(`pointerdown`,W),document.addEventListener(`scroll`,W,!0),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&W()}))}var Oe=new WeakMap;function K(e){let t=Oe.get(e);if(t?.element.parentElement===e.card)return t;let n=t??_(`session-action-status m-0 px-3 py-1`);return e.termWrap.before(n.element),Oe.set(e,n),n}function q(e,t){let n=K(e);return v(t,n)?(n.clear(),!0):!1}var J=!1,Y=new Set;function ke(e){J=!!e,ot();for(let e of Y)e(J)}function Ae(e){return Y.add(e),()=>Y.delete(e)}function je(){return J}var Me=null;function Ne(e){Me=e}var X=null;function Pe(e){X=e}var Fe=null;function Ie(e){Fe=e}function Le(e,t){let n=o(`span`,`tag-icon ${e}`);return n.tabIndex=0,n.setAttribute(`role`,`img`),n.setAttribute(`aria-label`,t),n}function Re(e){let t=d(16,16);return t.classList.add(`line-icon`),t.append(b(`path`,{d:e,fill:`currentColor`})),t}function ze(){let e=f(y,`1.5`);return e.append(b(`path`,{d:p,fill:`currentColor`})),e}function Be(e){return`Runs in Coder workspace ${e}`}function Ve(e,t){let n=t?`Sane YOLO`:`YOLO`;e.setAttribute(`aria-label`,n),e.dataset.tipLabel=n,e.dataset.tipDetail=t?`Skips permission prompts; Sane YOLO blocks catastrophic commands`:`Running with --dangerously-skip-permissions`,e.replaceChildren(t?ze():Re(h)),G(e)}function He(e,t){t&&(e.dataset.saneYolo=``),t||delete e.dataset.saneYolo;let n=e.querySelector(`.perms-badge`);n&&Ve(n,t)}function Ue(e,t){let n=l(e);n&&He(n.card,t)}function We(e,t,n,i={}){let a=n||r.INITIALIZING,s=o(`div`,`session-card`);s.dataset.id=e,s.dataset.session=t,s.dataset.state=a,i.skipPerms&&(s.dataset.skipPerms=``),i.saneYolo&&(s.dataset.saneYolo=``),i.worktree&&(s.dataset.worktree=``),i.workspace&&(s.dataset.workspace=``),i.remoteWorkspace&&(s.dataset.remoteWorkspace=i.remoteWorkspace),i.guarded&&(s.dataset.guarded=``),i.guardrailsReleased&&(s.dataset.guardrailsReleased=``),i.ephemeral&&(s.dataset.ephemeral=``),i.path&&(s.dataset.path=String(i.path));let c=o(`div`,`session-card-header`),l=o(`span`,`session-name`,t);l.title=`Double-click or press F2 to rename`,l.tabIndex=0;let u=i.skipPerms?Le(`perms-badge`,`YOLO`):null;u&&Ve(u,i.saneYolo===!0);let d=o(`span`,`session-task-title`);Z(d,i.taskTitle);let p=o(`div`,`session-actions`),h=o(`div`,`session-overflow`),_=o(`button`,`btn-action btn-session-menu visible`);_.append(f(ee)),_.type=`button`,_.title=`Session actions`,_.setAttribute(`aria-label`,`Session actions`),_.setAttribute(`aria-haspopup`,`menu`),_.setAttribute(`aria-expanded`,`false`);let v=o(`div`,`popup-menu session-overflow-menu`);v.id=`session-menu-${e}`,v.setAttribute(`role`,`menu`),_.setAttribute(`aria-controls`,v.id);let y=z(`Restart...`,`Into this conversation, a fresh one, or an earlier one`,`overflow-restart`);y.setAttribute(`aria-haspopup`,`dialog`);let b=z(`Edit repositories...`,`Add or remove repositories in this workspace`,`overflow-workspace-repos`),x=z(`Link pull request...`,`Link or unlink pull requests for this session`,`overflow-link-pr visible`),S=z(`Conversation view`,`Show this session as messages (experimental)`,`overflow-conversation-view`);S.setAttribute(`role`,`menuitemcheckbox`),S.setAttribute(`aria-checked`,`false`);let C=o(`button`,`tag-icon guardrails-badge`);C.type=`button`,C.setAttribute(`aria-label`,`Guardrails`),Ke(C,s),x.onclick=()=>{v.classList.remove(`open`),_.setAttribute(`aria-expanded`,`false`),qe(e)};let w=z(`Coherence journal`,`Decisions and notes this session recorded`,`overflow-coherence-journal`);w.setAttribute(`aria-haspopup`,`dialog`);let T=()=>w.classList.toggle(`visible`,X?.isReadable(e)===!0);_.onclick=T,_.onkeydown=T,w.onclick=()=>{v.classList.remove(`open`),_.setAttribute(`aria-expanded`,`false`),X?.open(e)};let E=z(`Session setup`,`MCP servers, plugins and hooks this session loaded`,`overflow-session-setup visible`);E.setAttribute(`aria-haspopup`,`dialog`),E.onclick=()=>{v.classList.remove(`open`),_.setAttribute(`aria-expanded`,`false`),Fe?.(e)},v.append(y,b,S,w,E,x),h.append(_,v);let D=o(`button`,`btn-action btn-debug`);D.append(f(g)),D.title=`Debug state`,D.setAttribute(`aria-label`,`Debug session state`);let O=o(`button`,`btn-action btn-trace`);O.append(f(m)),O.type=`button`,O.title=`Trace`,O.setAttribute(`aria-label`,`Trace`);let k=o(`button`,`btn-action btn-remove visible`);k.append(f(te)),k.type=`button`,k.title=`Remove session`,k.setAttribute(`aria-label`,`Remove session`);let A=o(`button`,`btn-action btn-face-plan`,`Plan`);A.type=`button`,A.title=`Show plan`;let j=o(`button`,`btn-action btn-face-plan btn-docs`,`Docs`);j.type=`button`,j.title=`Open docs the agent surfaced`;let M=o(`button`,`btn-action btn-face-plan btn-shown`,`Shown`);M.type=`button`,M.title=`Open files the agent showed you`;let N=o(`span`,`shown-unopened-dot`);N.hidden=!0,N.title=`New shown file`,p.append(N,M,j,A,D,O,h,k);let P=o(`div`,`session-card-tags`),F=Le(`usage-badge`,`Usage`);F.append(f(ne,`2.2`)),u&&P.append(u),P.append(C,F),De();let I=o(`span`,`session-ownership`);I.hidden=!0,c.append(l,d,I,P,p);let L=o(`div`,`terminal-wrap`);return s.append(c,L),{card:s,header:c,nameEl:l,taskTitleEl:d,btnRestart:y,btnSessionMenu:_,btnWorkspaceRepos:b,btnConversationView:S,btnGuardrails:C,btnTrace:O,btnRemove:k,btnPlan:A,btnDocs:j,btnShown:M,shownUnopenedDot:N,btnDebug:D,sessionMenu:v,termWrap:L}}var Ge={on:`Credentials, Glimmervoid state and blocked folders are off-limits to this session.`,released:`This session can read, write and reach anything your account can.`};function Ke(e,t){let n=t.dataset.guarded!==void 0,r=t.dataset.ephemeral===void 0&&(n||t.dataset.guardrailsReleased!==void 0),i=n?` Click to release.`:` Click to restore.`;e.setAttribute(`aria-pressed`,String(n)),e.setAttribute(`aria-disabled`,String(!r)),e.dataset.tipLabel=n?`Guardrails on`:`Guardrails released`,e.dataset.tipDetail=`${n?Ge.on:Ge.released}${r?i:``}`,e.replaceChildren(f(n?y:x,`1.6`)),G(e)}function qe(e){let{dialog:r,close:i,actions:a,btnCancel:s}=w({title:`Link pull request`}),l=o(`p`,`dialog-message`,`Paste a GitHub pull request URL or owner/repo#number.`),u=o(`input`,`dialog-input`);u.type=`text`,u.placeholder=`owner/repo#123`,u.autocomplete=`off`,u.spellcheck=!1,u.setAttribute(`aria-label`,`Pull request URL or owner/repo#number`);let d=o(`div`,`dialog-error`);d.setAttribute(`role`,`alert`);let f=o(`div`,`session-pr-chips dialog-linked-prs`);f.hidden=!0,Me?.(f,e);let p=o(`button`,`btn-dialog btn-dialog-confirm`,`Link`);p.type=`button`,a.append(p),r.append(f,l,u,d,a);function m(){let r=n(u.value);r?c({type:`link-session-pr`,id:e,key:r})?i():d.textContent=t:d.textContent=`Enter a github.com pull request URL or owner/repo#number.`}s.addEventListener(`click`,i),p.addEventListener(`click`,m),u.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),m())}),requestAnimationFrame(()=>u.focus())}function Je(e,t){e.tabIndex=0,e.setAttribute(`role`,`button`),e.addEventListener(`click`,t),e.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())})}function Ye(e,t){let n=e.querySelector(`.session-ownership`);n&&(n.textContent=t??``,n.hidden=t===null)}function Z(e,t){e.title=t??``,t&&e.removeAttribute(`aria-label`),t||e.setAttribute(`aria-label`,`Describe the task`),!e.querySelector(`input`)&&(e.textContent=t??``)}function Xe(e,t){let n=e.titleTargetEl?.isConnected?e.titleTargetEl:e.taskTitleEl;if(n.querySelector(`input`))return;let r=document.createElement(`input`);r.type=`text`,r.className=`session-title-input`,r.setAttribute(`aria-label`,`Task`),r.value=e.taskTitleIsCustom?e.taskTitle??``:``,r.placeholder=e.taskTitle??`What is this session working on?`,r.maxLength=120;let i=n.getAttribute(`role`),a=n.getAttribute(`tabindex`);n.removeAttribute(`role`),n.removeAttribute(`tabindex`),n.replaceChildren(r),r.focus(),r.select();function o(o){r.removeEventListener(`blur`,s),r.removeEventListener(`keydown`,c),o&&q(e,{type:`set-session-title`,id:t,title:r.value.trim()}),n.replaceChildren(),i!==null&&n.setAttribute(`role`,i),a!==null&&n.setAttribute(`tabindex`,a),Z(n,e.taskTitle)}function s(){o(!0)}function c(e){e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),o(!0)),e.key===`Escape`&&(e.preventDefault(),o(!1))}r.addEventListener(`blur`,s),r.addEventListener(`keydown`,c)}var Ze=`session-rename-input`;function Qe(e){return!!e?.querySelector(`.${Ze}`)}function $e(t,n,{returnsFocusToTerminal:r=!0}={}){let i=t.renameTargetEl?.isConnected?t.renameTargetEl:t.nameEl;if(!i||Qe(i))return;let a=t.card?.dataset.session??i.textContent??``,o=document.createElement(`input`);o.type=`text`,o.className=Ze,o.value=a,o.maxLength=64,i.textContent=``,i.appendChild(o),o.focus(),o.select();let c=K(t);function l(n){return t.card.dataset.ephemeral===void 0?s.test(n)?[...u.values()].some(e=>e!==t&&e.card.dataset.session===n)?`Session "${n}" already exists.`:``:e:`This session cannot be renamed`}function d(e=t.card?.dataset.session??a){i.textContent=e,t.nameEl&&t.nameEl!==i&&(t.nameEl.textContent=e),r&&t.term?.focus()}function f(){let e=o.value.trim(),t=e&&e!==a?l(e):``;t?(c.show(`error`,t),o.select()):p()}function p(){let e=o.value.trim();if(h(),!e||e===a){d();return}let r=l(e);r?(c.show(`error`,r),d()):q(t,{type:`rename-session`,id:n,newName:e})?d(e):d()}function m(){h(),d()}function h(){o.removeEventListener(`blur`,p),o.removeEventListener(`keydown`,g)}function g(e){e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(e.preventDefault(),m()),e.stopPropagation()}o.addEventListener(`blur`,p),o.addEventListener(`keydown`,g)}function et(){let e=o(`button`,`debug-close`);return e.type=`button`,e.title=`Close`,e.setAttribute(`aria-label`,`Close debug overlay`),e.append(f(te)),e}function tt(e){return e?a(new Date(e)):`-`}function Q(e){return`${(Number(e||0)/1e3).toFixed(1)}s`}function nt(e){return e.decision===`gated`?`(${Number(e.active)||0} bg)`:e.decision===`wait`||e.decision===`release`?`(quiet ${Q(e.quietMs)})`:``}function rt(e){let t=`<span class="debug-dim">${tt(e.ts)}</span>`;if(e.kind===`signal`){let n=R([e.signal,e.source].filter(Boolean).join(`/`));return e.action===`transition`?`${t} ${n} → <span class="debug-label">${R(e.event||``)}</span>`:e.action===`gate-held`?`${t} ${n} → held <span class="debug-dim">(${Number(e.active)||0} bg)</span>`:`${t} ${n} → <span class="debug-dim">no-op</span>`}if(e.kind===`gate`){let n=(e.repeats??0)>1?` <span class="debug-dim">x${Number(e.repeats)}</span>`:``,r=nt(e),i=r?` <span class="debug-dim">${r}</span>`:``;return`${t} gate <span class="debug-label">${R(e.decision||`?`)}</span>${i}${n}`}if(e.kind===`notify`){let n=R(e.category||e.to||`?`);return e.category?`${t} notify <span class="debug-label">${n}</span>: fired`:`${t} notify ${n}: <span class="debug-dim">silent (${R(e.reason||``)})</span>`}return e.kind===`notify-state`?`${t} notify ${R(e.category||`?`)}: <span class="debug-dim">${R(e.from||`?`)} → ${R(e.to||`?`)}</span>`:`${t} <span class="debug-dim">${R(e.kind||`decision`)}</span>`}function it(e,t){if(!e.debugOverlay)return;let n=t,r=``;if(r+=`<div class="debug-section"><div class="debug-section-title">State</div>`,r+=`<div class="debug-field"><span class="debug-label">Current:</span> <span class="debug-value">${R(n.state)}</span></div>`,r+=`</div>`,r+=`<div class="debug-section"><div class="debug-section-title">Transitions (last ${n.transitions.length})</div>`,n.transitions.length===0&&(r+=`<div class="debug-field debug-dim">No transitions recorded</div>`),n.transitions.length>0)for(let e of n.transitions){let t=e.detail&&typeof e.detail==`object`?e.detail:null,n=t?[t.signal,t.source,t.deferred?`deferred`:null].filter(Boolean):[],i=n.length>0?` <span class="debug-dim">${R(n.join(`/`))}</span>`:``;r+=`<div class="debug-field"><span class="debug-dim">${tt(e.timestamp)}</span> ${R(e.from)} → ${R(e.to)} <span class="debug-label">${R(e.event)}</span>${i}</div>`}r+=`</div>`;let i=n.detection||{},a=i.lastSignal,o=i.titleState||{};r+=`<div class="debug-section"><div class="debug-section-title">Detection</div>`,r+=`<div class="debug-field"><span class="debug-label">Last signal:</span> <span class="debug-value">${a?`${R(a.signal)} (${R(a.source||`?`)}${a.confidence?`/${R(a.confidence)}`:``})`:`none`}</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Hooks injected:</span> <span class="debug-value">${i.hooksInjected?`yes`:`no`}</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Hook seen:</span> <span class="debug-value">${i.hookSeen?`yes`:`no (degraded → title)`}</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Title state:</span> <span class="debug-value">${R(o.lastKind||`none`)}${o.hasSeenSpinner?` · spun`:``}</span></div>`,r+=`</div>`;let s=i.agents||{},c=i.gate;r+=`<div class="debug-section"><div class="debug-section-title">Agents</div>`,r+=`<div class="debug-field"><span class="debug-label">Active:</span> <span class="debug-value">${Number(s.active)||0} (counted ${Number(s.counted)||0}, declared ${Number(s.declared)||0})</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Idle:</span> <span class="debug-value">${Number(s.idleNames)||0} names, ${Number(s.idleTasks)||0} tasks</span></div>`;let l=c?`held ${Q(c.heldForMs)} (seq ${Number(c.seq)||0}, lastActivity ${Number(c.lastActivitySeq)||0})`:`none`;r+=`<div class="debug-field"><span class="debug-label">Gate:</span> <span class="debug-value">${R(l)}</span></div>`,r+=`</div>`;let u=Array.isArray(n.decisions)?n.decisions:[];r+=`<div class="debug-section"><div class="debug-section-title">Decisions (last ${u.length})</div>`,u.length===0&&(r+=`<div class="debug-field debug-dim">No decisions recorded</div>`);for(let e of u)r+=`<div class="debug-field">${rt(e)}</div>`;r+=`</div>`,e.debugOverlay.innerHTML=r,e.debugOverlay.prepend(et())}function at(e,t){if(e.debugOpen){$(e);return}let n=document.createElement(`div`);n.className=`debug-overlay`,n.innerHTML=`<div class="debug-field debug-dim">Loading...</div>`,n.prepend(et()),e.card.appendChild(n),e.debugOverlay=n,e.debugOpen=!0,n.addEventListener(`click`,t=>{t.stopPropagation(),t.target instanceof Element&&t.target.closest(`.debug-close`)&&$(e)}),c({type:`debug-state`,id:t})}function $(e){e.debugOverlay&&=(e.debugOverlay.remove(),null),e.debugOpen=!1}function ot(){for(let[,e]of u)e.btnDebug.classList.toggle(`visible`,J),e.btnTrace.classList.toggle(`visible`,J),!J&&e.debugOpen&&$(e)}function st(e){let t=typeof e.id==`string`?u.get(e.id):void 0;t?.debugOpen&&it(t,e.payload)}function ct(e){l(e)?.debugOpen&&c({type:`debug-state`,id:e})}export{A,G as C,ce as D,re as E,k as F,j as I,fe as L,oe as M,N,D as O,L as P,E as R,Xe as S,R as T,Ie as _,je as a,Ue as b,Ae as c,Ke as d,Z as f,Pe as g,K as h,st as i,ie as j,ae as k,at as l,q as m,$ as n,Qe as o,Be as p,ct as r,Je as s,We as t,Ye as u,ke as v,_e as w,$e as x,Ne as y,se as z};
|
|
1
|
+
import{Bt as e,C as t,It as n,Kt as r,Vt as i,bt as a,o,zt as s}from"./dom-helpers-B98sy9ep.js";import{l as c}from"./control-ws-C8SS9PPx.js";import{d as l,m as u}from"./poll-ago-DdlzkUaM.js";import{C as d,S as f,_ as p,b as m,d as h,g,h as ee,i as _,l as v,p as te,v as y,w as b,x as ne,y as x}from"./action-status-DmJCv-Ib.js";import{t as S}from"./roving-keys-core-BDobx2It.js";import{i as C,n as w}from"./modal-5t7_5VCF.js";var T=new Map(Object.entries({WAITING:`now`,COMPLETE:`later`,FAILED:`resting`,IDLE:`resting`,RUNNING:`resting`,STARTING:`resting`,INITIALIZING:`resting`,DORMANT:`resting`,DONE:`resting`}));function E(e){return(typeof e.state==`string`?T.get(e.state):void 0)??`resting`}function D(e,t){return[...e].map(([e,n])=>{let i=n.currentState||r.DORMANT;return{id:e,ui:n,name:t(n),isDormant:i===r.DORMANT,state:i,unseenOutcome:n.unseenOutcome??null,ownerId:n.ownerId??null}})}function O(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 k(e){return O([...e].sort((e,t)=>Number(e.isDormant===!0)-Number(t.isDormant===!0)))}function A({ownerName:e,ownedCount:t}){return e===null?t===1?`Owns 1 session`:t>1?`Owns ${t} sessions`:null:`Owned by ${e}`}function j(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 M({state:e,unseenOutcome:t}){if(e===r.WAITING)return`waiting`;let n=i.safeParse(t);return n.success?n.data:null}function N(e={}){return M(e)!==null}var P=new Map([[`failed`,0],[`waiting`,1],[`finished`,2]]);function F(e){let t=M(e);return t===null?void 0:P.get(t)}function I(e){return e.filter(e=>F(e)!==void 0).sort((e,t)=>(F(e)??0)-(F(t)??0)).map(({id:e})=>e)}function L(e,t){let n=new Map(e.map(e=>[e.id,e]));return I(e).flatMap(e=>{let r=n.get(e),i=r?M(r):null;return!r||i===null||e===t?[]:[{id:e,kind:i,name:r.name??``}]})}var re={headTile:32,tile:26,tileGap:4,overflowSlot:40};function ie(e,t){if(t===0)return 0;let{headTile:n,tile:r,tileGap:i,overflowSlot:a}=re,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))}function ae(e){let t={waitingCount:0,finishedCount:0,failedCount:0};for(let n of e||[]){let e=M(n||{});e===`waiting`&&t.waitingCount++,e===`failed`&&t.failedCount++,e===`finished`&&t.finishedCount++}return t}function oe({waitingCount:e,finishedCount:t,failedCount:n}){return e+n+t}function se({waitingCount:e,failedCount:t}){return e+t}function ce({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 le=new Map([[`hand`,2]]),ue=1;function de(e){return e?typeof e==`string`&&le.get(e)||ue:0}function fe(e){let t=!1,n=0;for(let r of e||[]){let e=de(r);e<=n||(t=typeof r!=`string`||r,n=e)}return t}function R(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function z(e,t,n){let r=o(`button`,`popup-menu-item ${n}`);return r.type=`button`,r.setAttribute(`role`,`menuitem`),r.setAttribute(`aria-label`,e),r.append(o(`span`,`popup-menu-item-label`,e),o(`span`,`popup-menu-item-hint`,t)),r}function pe(e){return e.key===`ArrowDown`||e.key===`ArrowUp`}function me(e,t){let n=document.activeElement,r=n instanceof HTMLElement?e.indexOf(n):-1,i=S(t.key,r,e.length,`vertical`);i!==null&&e[i].focus()}function he(e){return e.key===`Home`||e.key===`End`}function B(e){return e.metaKey||e.altKey||e.ctrlKey}function ge(e,t,n){let r=e.relatedTarget;return r instanceof Node&&!t.contains(r)&&!n.contains(r)}function _e({trigger:e,menu:t,menuItems:n,isOpen:r,open:i,close:a,signal:o}){function s(e){e.preventDefault(),e.stopPropagation(),r()||i(),me(n(),e)}e.addEventListener(`keydown`,e=>{!B(e)&&pe(e)&&s(e)},{signal:o}),t.addEventListener(`keydown`,e=>{B(e)||(pe(e)||he(e))&&s(e)},{signal:o}),document.addEventListener(`keydown`,t=>{t.key!==`Escape`||t.defaultPrevented||!r()||C()||(t.preventDefault(),a(),e.focus())},{signal:o});for(let n of[e,t])n.addEventListener(`focusout`,n=>{r()&&ge(n,t,e)&&a()},{signal:o})}var ve=`hover-tip`,ye=`[data-tip-label]`,be=6,xe=8,V=null,H=null;function Se(e){return e instanceof Element?e.closest(ye):null}function Ce(){return V||(V=o(`div`,`hover-tip`),V.id=ve,V.setAttribute(`role`,`tooltip`),V.hidden=!0,document.body.append(V),V)}function we(e,t){let n=o(`span`,`hover-tip-text`);n.append(o(`b`,`hover-tip-label`,t.dataset.tipLabel??``));let r=t.dataset.tipDetail;r&&n.append(o(`span`,`hover-tip-detail`,r));let i=t.querySelector(`svg`)?.cloneNode(!0);e.replaceChildren(...i?[i]:[],n)}function Te(e,t){let n=t.getBoundingClientRect(),r=e.offsetWidth,i=window.innerWidth-r-xe,a=Math.max(xe,Math.min(n.right-r,i));e.style.left=`${a}px`,e.style.top=`${n.bottom+be}px`}function U(e){let t=Ce();H&&H!==e&&H.removeAttribute(`aria-describedby`),H=e,we(t,e),t.hidden=!1,Te(t,e),e.setAttribute(`aria-describedby`,ve)}function W(){H&&(H.removeAttribute(`aria-describedby`),H=null,V&&(V.hidden=!0))}function G(e){H===e&&(!e.dataset.tipLabel||!e.isConnected?W():U(e))}var Ee=!1;function De(){Ee||(Ee=!0,document.addEventListener(`pointerover`,e=>{let t=Se(e.target);t?U(t):W()}),document.addEventListener(`pointerout`,e=>{H&&(e.relatedTarget instanceof Node&&H.contains(e.relatedTarget)||W())}),document.addEventListener(`focusin`,e=>{let t=Se(e.target);t?U(t):W()}),document.addEventListener(`focusout`,W),document.addEventListener(`pointerdown`,W),document.addEventListener(`scroll`,W,!0),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&W()}))}var Oe=new WeakMap;function K(e){let t=Oe.get(e);if(t?.element.parentElement===e.card)return t;let n=t??_(`session-action-status m-0 px-3 py-1`);return e.termWrap.before(n.element),Oe.set(e,n),n}function q(e,t){let n=K(e);return v(t,n)?(n.clear(),!0):!1}var J=!1,Y=new Set;function ke(e){J=!!e,ot();for(let e of Y)e(J)}function Ae(e){return Y.add(e),()=>Y.delete(e)}function je(){return J}var Me=null;function Ne(e){Me=e}var X=null;function Pe(e){X=e}var Fe=null;function Ie(e){Fe=e}function Le(e,t){let n=o(`span`,`tag-icon ${e}`);return n.tabIndex=0,n.setAttribute(`role`,`img`),n.setAttribute(`aria-label`,t),n}function Re(e){let t=d(16,16);return t.classList.add(`line-icon`),t.append(b(`path`,{d:e,fill:`currentColor`})),t}function ze(){let e=f(y,`1.5`);return e.append(b(`path`,{d:p,fill:`currentColor`})),e}function Be(e){return`Runs in Coder workspace ${e}`}function Ve(e,t){let n=t?`Sane YOLO`:`YOLO`;e.setAttribute(`aria-label`,n),e.dataset.tipLabel=n,e.dataset.tipDetail=t?`Skips permission prompts; Sane YOLO blocks catastrophic commands`:`Running with --dangerously-skip-permissions`,e.replaceChildren(t?ze():Re(h)),G(e)}function He(e,t){t&&(e.dataset.saneYolo=``),t||delete e.dataset.saneYolo;let n=e.querySelector(`.perms-badge`);n&&Ve(n,t)}function Ue(e,t){let n=l(e);n&&He(n.card,t)}function We(e,t,n,i={}){let a=n||r.INITIALIZING,s=o(`div`,`session-card`);s.dataset.id=e,s.dataset.session=t,s.dataset.state=a,i.skipPerms&&(s.dataset.skipPerms=``),i.saneYolo&&(s.dataset.saneYolo=``),i.worktree&&(s.dataset.worktree=``),i.workspace&&(s.dataset.workspace=``),i.remoteWorkspace&&(s.dataset.remoteWorkspace=i.remoteWorkspace),i.guarded&&(s.dataset.guarded=``),i.guardrailsReleased&&(s.dataset.guardrailsReleased=``),i.ephemeral&&(s.dataset.ephemeral=``),i.path&&(s.dataset.path=String(i.path));let c=o(`div`,`session-card-header`),l=o(`span`,`session-name`,t);l.title=`Double-click or press F2 to rename`,l.tabIndex=0;let u=i.skipPerms?Le(`perms-badge`,`YOLO`):null;u&&Ve(u,i.saneYolo===!0);let d=o(`span`,`session-task-title`);Z(d,i.taskTitle);let p=o(`div`,`session-actions`),h=o(`div`,`session-overflow`),_=o(`button`,`btn-action btn-session-menu visible`);_.append(f(ee)),_.type=`button`,_.title=`Session actions`,_.setAttribute(`aria-label`,`Session actions`),_.setAttribute(`aria-haspopup`,`menu`),_.setAttribute(`aria-expanded`,`false`);let v=o(`div`,`popup-menu session-overflow-menu`);v.id=`session-menu-${e}`,v.setAttribute(`role`,`menu`),_.setAttribute(`aria-controls`,v.id);let y=z(`Restart...`,`Into this conversation, a fresh one, or an earlier one`,`overflow-restart`);y.setAttribute(`aria-haspopup`,`dialog`);let b=z(`Edit repositories...`,`Add or remove repositories in this workspace`,`overflow-workspace-repos`),x=z(`Link pull request...`,`Link or unlink pull requests for this session`,`overflow-link-pr visible`),S=z(`Conversation view`,`Show this session as messages (experimental)`,`overflow-conversation-view`);S.setAttribute(`role`,`menuitemcheckbox`),S.setAttribute(`aria-checked`,`false`);let C=o(`button`,`tag-icon guardrails-badge`);C.type=`button`,C.setAttribute(`aria-label`,`Guardrails`),Ke(C,s),x.onclick=()=>{v.classList.remove(`open`),_.setAttribute(`aria-expanded`,`false`),qe(e)};let w=z(`Coherence journal`,`Decisions and notes this session recorded`,`overflow-coherence-journal`);w.setAttribute(`aria-haspopup`,`dialog`);let T=()=>w.classList.toggle(`visible`,X?.isReadable(e)===!0);_.onclick=T,_.onkeydown=T,w.onclick=()=>{v.classList.remove(`open`),_.setAttribute(`aria-expanded`,`false`),X?.open(e)};let E=z(`Session setup`,`MCP servers, plugins and hooks this session loaded`,`overflow-session-setup visible`);E.setAttribute(`aria-haspopup`,`dialog`),E.onclick=()=>{v.classList.remove(`open`),_.setAttribute(`aria-expanded`,`false`),Fe?.(e)},v.append(y,b,S,w,E,x),h.append(_,v);let D=o(`button`,`btn-action btn-debug`);D.append(f(g)),D.title=`Debug state`,D.setAttribute(`aria-label`,`Debug session state`);let O=o(`button`,`btn-action btn-trace`);O.append(f(m)),O.type=`button`,O.title=`Trace`,O.setAttribute(`aria-label`,`Trace`);let k=o(`button`,`btn-action btn-remove visible`);k.append(f(te)),k.type=`button`,k.title=`Remove session`,k.setAttribute(`aria-label`,`Remove session`);let A=o(`button`,`btn-action btn-face-plan`,`Plan`);A.type=`button`,A.title=`Show plan`;let j=o(`button`,`btn-action btn-face-plan btn-docs`,`Docs`);j.type=`button`,j.title=`Open docs the agent surfaced`;let M=o(`button`,`btn-action btn-face-plan btn-shown`,`Shown`);M.type=`button`,M.title=`Open files the agent showed you`;let N=o(`span`,`shown-unopened-dot`);N.hidden=!0,N.title=`New shown file`,p.append(N,M,j,A,D,O,h,k);let P=o(`div`,`session-card-tags`),F=Le(`usage-badge`,`Usage`);F.append(f(ne,`2.2`)),u&&P.append(u),P.append(C,F),De();let I=o(`span`,`session-ownership`);I.hidden=!0,c.append(l,d,I,P,p);let L=o(`div`,`terminal-wrap`);return s.append(c,L),{card:s,header:c,nameEl:l,taskTitleEl:d,btnRestart:y,btnSessionMenu:_,btnWorkspaceRepos:b,btnConversationView:S,btnGuardrails:C,btnTrace:O,btnRemove:k,btnPlan:A,btnDocs:j,btnShown:M,shownUnopenedDot:N,btnDebug:D,sessionMenu:v,termWrap:L}}var Ge={on:`Credentials, Glimmervoid state and blocked folders are off-limits to this session.`,released:`This session can read, write and reach anything your account can.`};function Ke(e,t){let n=t.dataset.guarded!==void 0,r=t.dataset.ephemeral===void 0&&(n||t.dataset.guardrailsReleased!==void 0),i=n?` Click to release.`:` Click to restore.`;e.setAttribute(`aria-pressed`,String(n)),e.setAttribute(`aria-disabled`,String(!r)),e.dataset.tipLabel=n?`Guardrails on`:`Guardrails released`,e.dataset.tipDetail=`${n?Ge.on:Ge.released}${r?i:``}`,e.replaceChildren(f(n?y:x,`1.6`)),G(e)}function qe(e){let{dialog:r,close:i,actions:a,btnCancel:s}=w({title:`Link pull request`}),l=o(`p`,`dialog-message`,`Paste a GitHub pull request URL or owner/repo#number.`),u=o(`input`,`dialog-input`);u.type=`text`,u.placeholder=`owner/repo#123`,u.autocomplete=`off`,u.spellcheck=!1,u.setAttribute(`aria-label`,`Pull request URL or owner/repo#number`);let d=o(`div`,`dialog-error`);d.setAttribute(`role`,`alert`);let f=o(`div`,`session-pr-chips dialog-linked-prs`);f.hidden=!0,Me?.(f,e);let p=o(`button`,`btn-dialog btn-dialog-confirm`,`Link`);p.type=`button`,a.append(p),r.append(f,l,u,d,a);function m(){let r=n(u.value);r?c({type:`link-session-pr`,id:e,key:r})?i():d.textContent=t:d.textContent=`Enter a github.com pull request URL or owner/repo#number.`}s.addEventListener(`click`,i),p.addEventListener(`click`,m),u.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),m())}),requestAnimationFrame(()=>u.focus())}function Je(e,t){e.tabIndex=0,e.setAttribute(`role`,`button`),e.addEventListener(`click`,t),e.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())})}function Ye(e,t){let n=e.querySelector(`.session-ownership`);n&&(n.textContent=t??``,n.hidden=t===null)}function Z(e,t){e.title=t??``,t&&e.removeAttribute(`aria-label`),t||e.setAttribute(`aria-label`,`Describe the task`),!e.querySelector(`input`)&&(e.textContent=t??``)}function Xe(e,t){let n=e.titleTargetEl?.isConnected?e.titleTargetEl:e.taskTitleEl;if(n.querySelector(`input`))return;let r=document.createElement(`input`);r.type=`text`,r.className=`session-title-input`,r.setAttribute(`aria-label`,`Task`),r.value=e.taskTitleIsCustom?e.taskTitle??``:``,r.placeholder=e.taskTitle??`What is this session working on?`,r.maxLength=120;let i=n.getAttribute(`role`),a=n.getAttribute(`tabindex`);n.removeAttribute(`role`),n.removeAttribute(`tabindex`),n.replaceChildren(r),r.focus(),r.select();function o(o){r.removeEventListener(`blur`,s),r.removeEventListener(`keydown`,c),o&&q(e,{type:`set-session-title`,id:t,title:r.value.trim()}),n.replaceChildren(),i!==null&&n.setAttribute(`role`,i),a!==null&&n.setAttribute(`tabindex`,a),Z(n,e.taskTitle)}function s(){o(!0)}function c(e){e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),o(!0)),e.key===`Escape`&&(e.preventDefault(),o(!1))}r.addEventListener(`blur`,s),r.addEventListener(`keydown`,c)}var Ze=`session-rename-input`;function Qe(e){return!!e?.querySelector(`.${Ze}`)}function $e(t,n,{returnsFocusToTerminal:r=!0}={}){let i=t.renameTargetEl?.isConnected?t.renameTargetEl:t.nameEl;if(!i||Qe(i))return;let a=t.card?.dataset.session??i.textContent??``,o=document.createElement(`input`);o.type=`text`,o.className=Ze,o.value=a,o.maxLength=64,i.textContent=``,i.appendChild(o),o.focus(),o.select();let c=K(t);function l(n){return t.card.dataset.ephemeral===void 0?s.test(n)?[...u.values()].some(e=>e!==t&&e.card.dataset.session===n)?`Session "${n}" already exists.`:``:e:`This session cannot be renamed`}function d(e=t.card?.dataset.session??a){i.textContent=e,t.nameEl&&t.nameEl!==i&&(t.nameEl.textContent=e),r&&t.term?.focus()}function f(){let e=o.value.trim(),t=e&&e!==a?l(e):``;t?(c.show(`error`,t),o.select()):p()}function p(){let e=o.value.trim();if(h(),!e||e===a){d();return}let r=l(e);r?(c.show(`error`,r),d()):q(t,{type:`rename-session`,id:n,newName:e})?d(e):d()}function m(){h(),d()}function h(){o.removeEventListener(`blur`,p),o.removeEventListener(`keydown`,g)}function g(e){e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(e.preventDefault(),m()),e.stopPropagation()}o.addEventListener(`blur`,p),o.addEventListener(`keydown`,g)}function et(){let e=o(`button`,`debug-close`);return e.type=`button`,e.title=`Close`,e.setAttribute(`aria-label`,`Close debug overlay`),e.append(f(te)),e}function tt(e){return e?a(new Date(e)):`-`}function Q(e){return`${(Number(e||0)/1e3).toFixed(1)}s`}function nt(e){return e.decision===`gated`?`(${Number(e.active)||0} bg)`:e.decision===`wait`||e.decision===`release`?`(quiet ${Q(e.quietMs)})`:``}function rt(e){let t=`<span class="debug-dim">${tt(e.ts)}</span>`;if(e.kind===`signal`){let n=R([e.signal,e.source].filter(Boolean).join(`/`));return e.action===`transition`?`${t} ${n} → <span class="debug-label">${R(e.event||``)}</span>`:e.action===`gate-held`?`${t} ${n} → held <span class="debug-dim">(${Number(e.active)||0} bg)</span>`:`${t} ${n} → <span class="debug-dim">no-op</span>`}if(e.kind===`gate`){let n=(e.repeats??0)>1?` <span class="debug-dim">x${Number(e.repeats)}</span>`:``,r=nt(e),i=r?` <span class="debug-dim">${r}</span>`:``;return`${t} gate <span class="debug-label">${R(e.decision||`?`)}</span>${i}${n}`}if(e.kind===`notify`){let n=R(e.category||e.to||`?`);return e.category?`${t} notify <span class="debug-label">${n}</span>: fired`:`${t} notify ${n}: <span class="debug-dim">silent (${R(e.reason||``)})</span>`}return e.kind===`notify-state`?`${t} notify ${R(e.category||`?`)}: <span class="debug-dim">${R(e.from||`?`)} → ${R(e.to||`?`)}</span>`:`${t} <span class="debug-dim">${R(e.kind||`decision`)}</span>`}function it(e,t){if(!e.debugOverlay)return;let n=t,r=``;if(r+=`<div class="debug-section"><div class="debug-section-title">State</div>`,r+=`<div class="debug-field"><span class="debug-label">Current:</span> <span class="debug-value">${R(n.state)}</span></div>`,r+=`</div>`,r+=`<div class="debug-section"><div class="debug-section-title">Transitions (last ${n.transitions.length})</div>`,n.transitions.length===0&&(r+=`<div class="debug-field debug-dim">No transitions recorded</div>`),n.transitions.length>0)for(let e of n.transitions){let t=e.detail&&typeof e.detail==`object`?e.detail:null,n=t?[t.signal,t.source,t.deferred?`deferred`:null].filter(Boolean):[],i=n.length>0?` <span class="debug-dim">${R(n.join(`/`))}</span>`:``;r+=`<div class="debug-field"><span class="debug-dim">${tt(e.timestamp)}</span> ${R(e.from)} → ${R(e.to)} <span class="debug-label">${R(e.event)}</span>${i}</div>`}r+=`</div>`;let i=n.detection||{},a=i.lastSignal,o=i.titleState||{};r+=`<div class="debug-section"><div class="debug-section-title">Detection</div>`,r+=`<div class="debug-field"><span class="debug-label">Last signal:</span> <span class="debug-value">${a?`${R(a.signal)} (${R(a.source||`?`)}${a.confidence?`/${R(a.confidence)}`:``})`:`none`}</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Hooks injected:</span> <span class="debug-value">${i.hooksInjected?`yes`:`no`}</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Hook seen:</span> <span class="debug-value">${i.hookSeen?`yes`:`no (degraded → title)`}</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Title state:</span> <span class="debug-value">${R(o.lastKind||`none`)}${o.hasSeenSpinner?` · spun`:``}</span></div>`,r+=`</div>`;let s=i.agents||{},c=i.gate;r+=`<div class="debug-section"><div class="debug-section-title">Agents</div>`,r+=`<div class="debug-field"><span class="debug-label">Active:</span> <span class="debug-value">${Number(s.active)||0} (counted ${Number(s.counted)||0}, declared ${Number(s.declared)||0})</span></div>`,r+=`<div class="debug-field"><span class="debug-label">Idle:</span> <span class="debug-value">${Number(s.idleNames)||0} names, ${Number(s.idleTasks)||0} tasks</span></div>`;let l=c?`held ${Q(c.heldForMs)} (seq ${Number(c.seq)||0}, lastActivity ${Number(c.lastActivitySeq)||0})`:`none`;r+=`<div class="debug-field"><span class="debug-label">Gate:</span> <span class="debug-value">${R(l)}</span></div>`,r+=`</div>`;let u=Array.isArray(n.decisions)?n.decisions:[];r+=`<div class="debug-section"><div class="debug-section-title">Decisions (last ${u.length})</div>`,u.length===0&&(r+=`<div class="debug-field debug-dim">No decisions recorded</div>`);for(let e of u)r+=`<div class="debug-field">${rt(e)}</div>`;r+=`</div>`,e.debugOverlay.innerHTML=r,e.debugOverlay.prepend(et())}function at(e,t){if(e.debugOpen){$(e);return}let n=document.createElement(`div`);n.className=`debug-overlay`,n.innerHTML=`<div class="debug-field debug-dim">Loading...</div>`,n.prepend(et()),e.card.appendChild(n),e.debugOverlay=n,e.debugOpen=!0,n.addEventListener(`click`,t=>{t.stopPropagation(),t.target instanceof Element&&t.target.closest(`.debug-close`)&&$(e)}),c({type:`debug-state`,id:t})}function $(e){e.debugOverlay&&=(e.debugOverlay.remove(),null),e.debugOpen=!1}function ot(){for(let[,e]of u)e.btnDebug.classList.toggle(`visible`,J),e.btnTrace.classList.toggle(`visible`,J),!J&&e.debugOpen&&$(e)}function st(e){let t=typeof e.id==`string`?u.get(e.id):void 0;t?.debugOpen&&it(t,e.payload)}function ct(e){l(e)?.debugOpen&&c({type:`debug-state`,id:e})}export{A,G as C,ce as D,re as E,k as F,j as I,fe as L,oe as M,N,D as O,L as P,E as R,Xe as S,R as T,Ie as _,je as a,Ue as b,Ae as c,Ke as d,Z as f,Pe as g,K as h,st as i,ie as j,ae as k,at as l,q as m,$ as n,Qe as o,Be as p,ct as r,Je as s,We as t,Ye as u,ke as v,_e as w,$e as x,Ne as y,se as z};
|
|
Binary file
|