glimmervoid 0.48.2-next.321 → 0.48.2-next.322

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.
Files changed (93) hide show
  1. package/dist/bin/glimmervoid.js +48 -28
  2. package/dist/chunks/{agent-api-cli-DGJ38W5Q.js → agent-api-cli-7a-qwVK2.js} +1 -1
  3. package/dist/chunks/{agent-api-cli-DIHuV81M.js → agent-api-cli-IszLDyTY.js} +1 -1
  4. package/dist/chunks/{agent-api-core-CVleheDx.js → agent-api-core-BHcWVTPO.js} +139 -5
  5. package/dist/chunks/{agent-setup-cli-C3R5_hr1.js → agent-setup-cli-C4VZliUA.js} +2 -5
  6. package/dist/chunks/{git-version-CkHaTbB0.js → git-version-xS1GFU8P.js} +3 -21
  7. package/dist/chunks/{main-jbvejCOW.js → main-BsxukuSb.js} +3 -3
  8. package/dist/chunks/{pair-cli-KGg8V1HG.js → pair-cli-Bdn1AOva.js} +4 -16
  9. package/dist/chunks/{settings-cli-Dzzh4V3t.js → settings-cli-H3UxJLZo.js} +27 -63
  10. package/dist/chunks/{settings-readout-core-d9Tj5jwO.js → settings-readout-core-CPPzHMNL.js} +3 -10
  11. package/dist/chunks/{ssh-sign-cli-upCmSfR0.js → ssh-sign-cli-BtTvxMEu.js} +1 -1
  12. package/dist/client/assets/{benchmark-panel-DGErp-9P.js → benchmark-panel-CiNkBRS4.js} +1 -1
  13. package/dist/client/assets/benchmark-panel-CiNkBRS4.js.br +0 -0
  14. package/dist/client/assets/{boards-view-zGGSvSeR.js → boards-view-D1d_Jeh2.js} +1 -1
  15. package/dist/client/assets/boards-view-D1d_Jeh2.js.br +0 -0
  16. package/dist/client/assets/{community-panel-7LNSI7f9.js → community-panel-Cm9HnXDd.js} +1 -1
  17. package/dist/client/assets/community-panel-Cm9HnXDd.js.br +0 -0
  18. package/dist/client/assets/{dialogs-BAiB8PAI.js → dialogs-DWcur78f.js} +1 -1
  19. package/dist/client/assets/dialogs-DWcur78f.js.br +0 -0
  20. package/dist/client/assets/{doc-editor-ui-C8jXl10R.js → doc-editor-ui-NGbnywAB.js} +1 -1
  21. package/dist/client/assets/doc-editor-ui-NGbnywAB.js.br +0 -0
  22. package/dist/client/assets/{feature-hint-e3hklcnu.js → feature-hint-BPITXLNF.js} +1 -1
  23. package/dist/client/assets/feature-hint-BPITXLNF.js.br +0 -0
  24. package/dist/client/assets/{first-run-checklist-DvbK1fFl.js → first-run-checklist-C_qQ8RA8.js} +1 -1
  25. package/dist/client/assets/first-run-checklist-C_qQ8RA8.js.br +0 -0
  26. package/dist/client/assets/{hooks-panel-BWOHyo2k.js → hooks-panel-B8s0WX5_.js} +1 -1
  27. package/dist/client/assets/hooks-panel-B8s0WX5_.js.br +0 -0
  28. package/dist/client/assets/{index-B1lOI6hU.js → index-CEACcf33.js} +5 -5
  29. package/dist/client/assets/index-CEACcf33.js.br +0 -0
  30. package/dist/client/assets/{issues-panel-DtNwqaue.js → issues-panel-Cc06Bgsi.js} +1 -1
  31. package/dist/client/assets/issues-panel-Cc06Bgsi.js.br +0 -0
  32. package/dist/client/assets/{my-prs-panel-n4G0PNue.js → my-prs-panel-Ck43NtDT.js} +1 -1
  33. package/dist/client/assets/my-prs-panel-Ck43NtDT.js.br +0 -0
  34. package/dist/client/assets/{nyan-cat-CP1vsKe1.js → nyan-cat-BWGtd4eG.js} +1 -1
  35. package/dist/client/assets/nyan-cat-BWGtd4eG.js.br +0 -0
  36. package/dist/client/assets/{phone-shell-BIkINQQQ.js → phone-shell-BO3n6oG8.js} +1 -1
  37. package/dist/client/assets/phone-shell-BO3n6oG8.js.br +0 -0
  38. package/dist/client/assets/{plan-face-DnLDMJy6.js → plan-face-CRL-SLAn.js} +1 -1
  39. package/dist/client/assets/plan-face-CRL-SLAn.js.br +0 -0
  40. package/dist/client/assets/{plan-render-BkviPv-c.js → plan-render-BDtI7Wsb.js} +1 -1
  41. package/dist/client/assets/plan-render-BDtI7Wsb.js.br +0 -0
  42. package/dist/client/assets/{pr-queue-columns-DOCENcbT.js → pr-queue-columns-C93KRGpe.js} +1 -1
  43. package/dist/client/assets/pr-queue-columns-C93KRGpe.js.br +0 -0
  44. package/dist/client/assets/{radar-panel-Btzp3-7Y.js → radar-panel-CHn9u2qd.js} +1 -1
  45. package/dist/client/assets/radar-panel-CHn9u2qd.js.br +0 -0
  46. package/dist/client/assets/{repo-roots-adder-2vUcylJi.js → repo-roots-adder-CqiH197r.js} +1 -1
  47. package/dist/client/assets/repo-roots-adder-CqiH197r.js.br +0 -0
  48. package/dist/client/assets/{resume-dialog-DWEQuftz.js → resume-dialog-BCbNwxkR.js} +1 -1
  49. package/dist/client/assets/resume-dialog-BCbNwxkR.js.br +0 -0
  50. package/dist/client/assets/{review-queue-panel-JpOe78JU.js → review-queue-panel-ByaEF2nY.js} +1 -1
  51. package/dist/client/assets/review-queue-panel-ByaEF2nY.js.br +0 -0
  52. package/dist/client/assets/{settings-panel-BxnlEQP9.js → settings-panel-BqCGzUKq.js} +2 -2
  53. package/dist/client/assets/settings-panel-BqCGzUKq.js.br +0 -0
  54. package/dist/client/assets/{shown-lightbox-C_Lyt9bP.js → shown-lightbox-C7i8y4gs.js} +1 -1
  55. package/dist/client/assets/shown-lightbox-C7i8y4gs.js.br +0 -0
  56. package/dist/client/assets/{team-review-panel-COM1WLXF.js → team-review-panel-DZ4FF985.js} +1 -1
  57. package/dist/client/assets/team-review-panel-DZ4FF985.js.br +0 -0
  58. package/dist/client/assets/{trace-panel-CQ3QE8RY.js → trace-panel-CAA0R9vJ.js} +1 -1
  59. package/dist/client/assets/trace-panel-CAA0R9vJ.js.br +0 -0
  60. package/dist/client/assets/{usage-panel-OJJDj-iW.js → usage-panel-B6DaIaan.js} +1 -1
  61. package/dist/client/assets/usage-panel-B6DaIaan.js.br +0 -0
  62. package/dist/client/assets/{your-day-tip-rN7N7ogp.js → your-day-tip-X3qp4x_t.js} +1 -1
  63. package/dist/client/assets/your-day-tip-X3qp4x_t.js.br +0 -0
  64. package/dist/client/index.html +1 -1
  65. package/dist/client/index.html.br +0 -0
  66. package/dist/server/index.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/client/assets/benchmark-panel-DGErp-9P.js.br +0 -0
  69. package/dist/client/assets/boards-view-zGGSvSeR.js.br +0 -0
  70. package/dist/client/assets/community-panel-7LNSI7f9.js.br +0 -0
  71. package/dist/client/assets/dialogs-BAiB8PAI.js.br +0 -0
  72. package/dist/client/assets/doc-editor-ui-C8jXl10R.js.br +0 -0
  73. package/dist/client/assets/feature-hint-e3hklcnu.js.br +0 -0
  74. package/dist/client/assets/first-run-checklist-DvbK1fFl.js.br +0 -0
  75. package/dist/client/assets/hooks-panel-BWOHyo2k.js.br +0 -0
  76. package/dist/client/assets/index-B1lOI6hU.js.br +0 -0
  77. package/dist/client/assets/issues-panel-DtNwqaue.js.br +0 -0
  78. package/dist/client/assets/my-prs-panel-n4G0PNue.js.br +0 -0
  79. package/dist/client/assets/nyan-cat-CP1vsKe1.js.br +0 -0
  80. package/dist/client/assets/phone-shell-BIkINQQQ.js.br +0 -0
  81. package/dist/client/assets/plan-face-DnLDMJy6.js.br +0 -0
  82. package/dist/client/assets/plan-render-BkviPv-c.js.br +0 -0
  83. package/dist/client/assets/pr-queue-columns-DOCENcbT.js.br +0 -0
  84. package/dist/client/assets/radar-panel-Btzp3-7Y.js.br +0 -0
  85. package/dist/client/assets/repo-roots-adder-2vUcylJi.js.br +0 -0
  86. package/dist/client/assets/resume-dialog-DWEQuftz.js.br +0 -0
  87. package/dist/client/assets/review-queue-panel-JpOe78JU.js.br +0 -0
  88. package/dist/client/assets/settings-panel-BxnlEQP9.js.br +0 -0
  89. package/dist/client/assets/shown-lightbox-C_Lyt9bP.js.br +0 -0
  90. package/dist/client/assets/team-review-panel-COM1WLXF.js.br +0 -0
  91. package/dist/client/assets/trace-panel-CQ3QE8RY.js.br +0 -0
  92. package/dist/client/assets/usage-panel-OJJDj-iW.js.br +0 -0
  93. package/dist/client/assets/your-day-tip-rN7N7ogp.js.br +0 -0
@@ -5,9 +5,9 @@ import { a as packageRoot } from "../chunks/runtime-paths-D_ZjJLE0.js";
5
5
  import { n as glimmervoidHomeDir, t as decideConfigPath } from "../chunks/config-path-core-DUWk0Lui.js";
6
6
  import { t as AGENT_API_VERBS } from "../chunks/session-CcJLn3EZ.js";
7
7
  import { a as execSync } from "../chunks/child-process-safe-BCOoKfxG.js";
8
- import { r as agentCommandHelpLines } from "../chunks/agent-api-core-CVleheDx.js";
8
+ import { J as isOwnedCommandName, Y as parseCommand, q as OWNED_COMMAND_SPECS, r as agentCommandHelpLines } from "../chunks/agent-api-core-BHcWVTPO.js";
9
9
  import { t as renderTable } from "../chunks/ascii-figure-core-pDAwtlKO.js";
10
- import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-CkHaTbB0.js";
10
+ import { i as parseCommandLine, r as gitDoctorRows, t as probeGitVersion } from "../chunks/git-version-xS1GFU8P.js";
11
11
  import { i as pnpmGlobalBinDir, n as npmGlobalBinDir, r as onPath, t as formatPathNotice } from "../chunks/path-doctor-C23VAqeu.js";
12
12
  import fs from "node:fs";
13
13
  import path from "node:path";
@@ -56,31 +56,51 @@ if (commandLine.kind === "version") {
56
56
  }
57
57
  if (commandLine.globalOptions.configPath) process.env.GLIMMERVOID_CONFIG = commandLine.globalOptions.configPath;
58
58
  if (commandLine.globalOptions.port) process.env.GLIMMERVOID_PORT = commandLine.globalOptions.port;
59
- var OWN_SUBCOMMAND_RUNNERS = [
60
- ["doctor", async () => {
59
+ var OWNED_COMMAND_RUNNERS = {
60
+ doctor: async () => {
61
61
  await runDoctor();
62
62
  return 0;
63
- }],
64
- ["pair", async (subcommandArgs) => {
65
- const { runPairCli } = await import("../chunks/pair-cli-KGg8V1HG.js");
66
- return runPairCli(subcommandArgs);
67
- }],
68
- ["agent", async (subcommandArgs) => {
69
- const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-C3R5_hr1.js");
70
- return runAgentSetupCli(subcommandArgs);
71
- }],
72
- ["settings", async (subcommandArgs) => {
73
- const { runSettingsCli } = await import("../chunks/settings-cli-Dzzh4V3t.js");
74
- return runSettingsCli(subcommandArgs);
75
- }],
76
- ["ssh-sign", async (subcommandArgs) => {
77
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-upCmSfR0.js");
78
- return runSshSignCli(subcommandArgs);
79
- }]
80
- ];
81
- var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
82
- var SUBCOMMAND_RUNNERS = new Map([...OWN_SUBCOMMAND_RUNNERS, ...AGENT_API_VERBS.filter((verb) => !ownSubcommandNames.has(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
83
- const { runAgentApiCli } = await import("../chunks/agent-api-cli-DIHuV81M.js");
63
+ },
64
+ pair: async ({ values }) => {
65
+ const { runPairCli } = await import("../chunks/pair-cli-Bdn1AOva.js");
66
+ return runPairCli({
67
+ isListing: values.list === true,
68
+ revokeDeviceId: typeof values.revoke === "string" ? values.revoke : null,
69
+ deviceName: typeof values.name === "string" ? values.name : null
70
+ });
71
+ },
72
+ agent: async () => {
73
+ const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-C4VZliUA.js");
74
+ return runAgentSetupCli();
75
+ },
76
+ settings: async (parsed) => {
77
+ const { runParsedSettingsCli } = await import("../chunks/settings-cli-H3UxJLZo.js");
78
+ return runParsedSettingsCli(parsed);
79
+ },
80
+ "ssh-sign": async ({ rawArgs }) => {
81
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BtTvxMEu.js");
82
+ return runSshSignCli(rawArgs);
83
+ }
84
+ };
85
+ function applyTrailingGlobalOptions({ values }) {
86
+ if (typeof values.config === "string") process.env.GLIMMERVOID_CONFIG = values.config;
87
+ if (typeof values.port === "string") process.env.GLIMMERVOID_PORT = values.port;
88
+ }
89
+ async function runOwnedCommand(name, subcommandArgs) {
90
+ const parsed = parseCommand(OWNED_COMMAND_SPECS[name], subcommandArgs);
91
+ if (parsed.kind === "help") {
92
+ console.log(parsed.text);
93
+ return 0;
94
+ }
95
+ if (parsed.kind === "refused") {
96
+ console.error(parsed.text);
97
+ return 1;
98
+ }
99
+ applyTrailingGlobalOptions(parsed);
100
+ return OWNED_COMMAND_RUNNERS[name](parsed);
101
+ }
102
+ var SUBCOMMAND_RUNNERS = new Map([...Object.keys(OWNED_COMMAND_SPECS).filter(isOwnedCommandName).map((name) => [name, (subcommandArgs) => runOwnedCommand(name, subcommandArgs)]), ...AGENT_API_VERBS.filter((verb) => !isOwnedCommandName(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
103
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-IszLDyTY.js");
84
104
  return runAgentApiCli([subcommandName, ...subcommandArgs]);
85
105
  }])]);
86
106
  var AGENT_INSTALL_COMMAND_BY_ID = {
@@ -94,7 +114,7 @@ function missingAgentText(agentId) {
94
114
  }
95
115
  async function printSessionLimits() {
96
116
  if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
97
- const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-DIHuV81M.js");
117
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-IszLDyTY.js");
98
118
  const limitsLines = await sessionLimitsHelpLines();
99
119
  console.log(`\n${limitsLines.join("\n")}`);
100
120
  }
@@ -235,7 +255,7 @@ async function runDoctor() {
235
255
  const { label, path: resolvedPath } = describeAgentResolvability(id);
236
256
  line(`${id} (${label})`, resolvedPath ?? missingAgentText(id));
237
257
  }
238
- const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C3R5_hr1.js");
258
+ const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C4VZliUA.js");
239
259
  const grokSetup = inspectGrokAgentSetup();
240
260
  line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
241
261
  const { default: kimi } = await import("../chunks/kimi-CGoGWhyH.js");
@@ -249,7 +269,7 @@ async function runDoctor() {
249
269
  try {
250
270
  const { resolvePackageBin } = await import("../chunks/runtime-paths-DUfaYypN.js");
251
271
  const { execFileSync } = await import("../chunks/child-process-safe-BKjzSEYd.js");
252
- const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C3R5_hr1.js");
272
+ const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C4VZliUA.js");
253
273
  const binPath = resolvePackageBin("cc-safety-net", "cc-safety-net");
254
274
  line("Sane YOLO", binPath || "not installed");
255
275
  if (binPath) line("cc-safety-net version", execFileSync(process.execPath, [binPath, "--version"], {
@@ -1,5 +1,5 @@
1
1
  import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-CcJLn3EZ.js";
2
- import { i as agentCommandSpec, m as isAgentApiVerb, q as parseCommand, t as AGENT_COMMAND_HELP } from "./agent-api-core-CVleheDx.js";
2
+ import { Y as parseCommand, i as agentCommandSpec, m as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-BHcWVTPO.js";
3
3
  import { i as formatSessionLimits } from "./session-routes-BGK07awr.js";
4
4
  import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
5
5
  import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
@@ -1 +1 @@
1
- export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-DGJ38W5Q.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-7a-qwVK2.js";
@@ -38,10 +38,12 @@ function renderHelp(spec, commandPath) {
38
38
  if (spec.subcommands) {
39
39
  sections.push(["Commands:", ...spec.subcommands.map(subcommandLine)].join("\n"));
40
40
  sections.push(`Run "${commandLabel(commandPath)} <command> --help" for a command's options.`);
41
- return sections.join("\n\n");
42
41
  }
43
- const options = [...spec.options ?? [], HELP_OPTION];
44
- sections.push(["Options:", ...options.map((option) => `${padColumn(optionLabel(option))}${option.summary}`)].join("\n"));
42
+ if (!spec.subcommands) {
43
+ const options = [...spec.options ?? [], HELP_OPTION];
44
+ sections.push(["Options:", ...options.map((option) => `${padColumn(optionLabel(option))}${option.summary}`)].join("\n"));
45
+ }
46
+ if (spec.notes) sections.push(spec.notes);
45
47
  return sections.join("\n\n");
46
48
  }
47
49
  function refusal(spec, commandPath, reason) {
@@ -87,6 +89,10 @@ function positionalCountProblem(spec, positionals) {
87
89
  if (bounds.max === 0) return `this command takes no arguments, so ${extraWords} is not understood`;
88
90
  return `this command takes ${bounds.usage}, so ${extraWords} is not understood`;
89
91
  }
92
+ function unknownOptionReason(spec, commandPath, unknownOption) {
93
+ if (!(spec.positionals !== void 0 && spec.positionals.max !== 0)) return `unknown option ${unknownOption}`;
94
+ return `unknown option ${unknownOption}. Text that starts with a dash goes after --, as in ${commandLabel(commandPath)} -- ${unknownOption}`;
95
+ }
90
96
  function strictlyParse(spec, args) {
91
97
  try {
92
98
  return parseArgs({
@@ -105,7 +111,7 @@ function parseLeaf(spec, args, commandPath) {
105
111
  text: renderHelp(spec, commandPath)
106
112
  };
107
113
  const unknownOption = firstUnknownOption(spec, args);
108
- if (unknownOption) return refusal(spec, commandPath, `unknown option ${unknownOption}. Quote text that starts with a dash, or put it after --.`);
114
+ if (unknownOption) return refusal(spec, commandPath, unknownOptionReason(spec, commandPath, unknownOption));
109
115
  const parsed = strictlyParse(spec, args);
110
116
  if ("error" in parsed) return refusal(spec, commandPath, parsed.error);
111
117
  const countProblem = positionalCountProblem(spec, parsed.positionals);
@@ -143,6 +149,134 @@ function parseCommand(spec, args, commandPath = [spec.name]) {
143
149
  };
144
150
  return parseCommand(subcommand, rest, [...commandPath, subcommand.name]);
145
151
  }
152
+ var CONFIG_OPTION = {
153
+ name: "config",
154
+ type: "string",
155
+ valueName: "path",
156
+ summary: "Config file (default: ~/.glimmervoid/config.json)"
157
+ };
158
+ var PORT_OPTION = {
159
+ name: "port",
160
+ type: "string",
161
+ valueName: "number",
162
+ summary: "Server port (default: 3000)"
163
+ };
164
+ var JSON_OPTION = {
165
+ name: "json",
166
+ type: "boolean",
167
+ summary: "Machine-readable output"
168
+ };
169
+ var SETTING_PATH = {
170
+ usage: "<path>",
171
+ min: 1,
172
+ max: 1
173
+ };
174
+ var OWNED_COMMAND_SPECS = {
175
+ doctor: {
176
+ name: "doctor",
177
+ summary: "Check the install, PATH, agent CLIs and native module, then exit",
178
+ options: [CONFIG_OPTION, PORT_OPTION]
179
+ },
180
+ pair: {
181
+ name: "pair",
182
+ summary: "Mint a single-use pairing link for a remote device, or list and revoke paired devices",
183
+ options: [
184
+ {
185
+ name: "name",
186
+ type: "string",
187
+ valueName: "label",
188
+ summary: "Name for the device being paired"
189
+ },
190
+ {
191
+ name: "list",
192
+ type: "boolean",
193
+ summary: "List paired devices"
194
+ },
195
+ {
196
+ name: "revoke",
197
+ type: "string",
198
+ valueName: "id",
199
+ summary: "Revoke a paired device"
200
+ },
201
+ CONFIG_OPTION,
202
+ PORT_OPTION
203
+ ]
204
+ },
205
+ agent: {
206
+ name: "agent",
207
+ summary: "Set up an agent CLI to report to Glimmervoid",
208
+ subcommands: [{
209
+ name: "setup",
210
+ summary: "Install an agent hook relay",
211
+ subcommands: [{
212
+ name: "grok",
213
+ summary: "Install the Grok hook relay, which does nothing outside Glimmervoid"
214
+ }]
215
+ }]
216
+ },
217
+ settings: {
218
+ name: "settings",
219
+ summary: "Read and change config.json from the command line",
220
+ notes: `<path> is a config.json key path such as posthog.trafficSpikeEnabled, or a setting id such as posthog-traffic-enabled.
221
+ <value> is true or false for a toggle, a number, text, a comma-separated or JSON list, or JSON for a structured value.
222
+ A number is in the unit config.json stores, as schema's Stored unit column names: set branchGc.intervalMs 21600000 means 21600000 ms.
223
+ Where the dashboard shows another unit, get, list and set add it in parentheses, such as 30000 (30 seconds).
224
+ A secret (a bot token or API key) is never set or unset here, since a value on the command line lands in shell history;
225
+ change it in the dashboard settings or through its environment variable.`,
226
+ subcommands: [
227
+ {
228
+ name: "list",
229
+ summary: "Every config.json setting with its value and where the value comes from",
230
+ options: [JSON_OPTION]
231
+ },
232
+ {
233
+ name: "get",
234
+ summary: "One setting; a secret shows as configured or not configured, never its value",
235
+ positionals: SETTING_PATH,
236
+ options: [JSON_OPTION]
237
+ },
238
+ {
239
+ name: "set",
240
+ summary: "Validate the whole file and write it; a running Glimmervoid reloads it",
241
+ positionals: {
242
+ usage: "<path> <value>",
243
+ min: 2,
244
+ max: 2
245
+ },
246
+ options: [JSON_OPTION]
247
+ },
248
+ {
249
+ name: "unset",
250
+ summary: "Remove the key from config.json so the default applies",
251
+ positionals: SETTING_PATH,
252
+ options: [JSON_OPTION]
253
+ },
254
+ {
255
+ name: "search",
256
+ summary: "Find settings by title, keyword, key path or section",
257
+ positionals: {
258
+ usage: "<text>",
259
+ min: 1,
260
+ max: null
261
+ },
262
+ options: [JSON_OPTION]
263
+ },
264
+ {
265
+ name: "schema",
266
+ summary: "Every setting: id, path, type, default, unit, effect and section (needs no config file)",
267
+ options: [JSON_OPTION]
268
+ }
269
+ ]
270
+ },
271
+ "ssh-sign": {
272
+ name: "ssh-sign",
273
+ summary: "Sign a commit with the operator's forwarded ssh agent (git runs this)",
274
+ isPassthrough: true
275
+ }
276
+ };
277
+ function isOwnedCommandName(name) {
278
+ return Object.hasOwn(OWNED_COMMAND_SPECS, name);
279
+ }
146
280
  function renderOverviewLine(usage, summary) {
147
281
  return `${padColumn(usage)}${summary}`;
148
282
  }
@@ -1129,4 +1263,4 @@ function agentCommandSpec(verb) {
1129
1263
  };
1130
1264
  }
1131
1265
  //#endregion
1132
- export { parseRefinedSessionName as A, resumePromptFor as B, decideTaskTitleRefinement as C, extractPromptTaskTitle as D, extractOscTaskTitle as E, AUTO_CONTINUE_PROMPT as F, isAutoNameOf as G, claudeProjectsDir as H, RESUME_ID_RE as I, nextSuggestedName as K, isConversationReplacedAtStartup as L, resolveRefocusTaskTitle as M, resolveTaskTitle as N, isSelfWakePrompt as O, seedTaskTitleSources as P, pickAutoResume as R, cleanTaskPrompt as S, extractHookTaskTitle as T, listRepoConversations as U, shouldAdoptReportedResumeId as V, listRepoWorktreePaths as W, projectReviewDetail as _, checkAgentReply as a, buildTaskTitleRefinementPrompt as b, deriveChildSessionName as c, describePushLanding as d, describeRoleRefusal as f, projectMyPrs as g, parseAgentVerb as h, agentCommandSpec as i, parseRefinedTaskTitle as j, isSubstantivePrompt as k, describeChildEndNote as l, isAgentApiVerb as m, REFUSAL_REASON as n, decideAgentRequest as o, describeUnpushedCloseRefusal as p, parseCommand as q, agentCommandHelpLines as r, decideSpawnAllowance as s, AGENT_COMMAND_HELP as t, describeKeptChildAttention as u, projectReviews as v, extractAiTitle as w, chooseRefinedSessionName as x, buildPersistedTaskTitle as y, resolveResumeTarget as z };
1266
+ export { parseRefinedSessionName as A, resumePromptFor as B, decideTaskTitleRefinement as C, extractPromptTaskTitle as D, extractOscTaskTitle as E, AUTO_CONTINUE_PROMPT as F, isAutoNameOf as G, claudeProjectsDir as H, RESUME_ID_RE as I, isOwnedCommandName as J, nextSuggestedName as K, isConversationReplacedAtStartup as L, resolveRefocusTaskTitle as M, resolveTaskTitle as N, isSelfWakePrompt as O, seedTaskTitleSources as P, pickAutoResume as R, cleanTaskPrompt as S, extractHookTaskTitle as T, listRepoConversations as U, shouldAdoptReportedResumeId as V, listRepoWorktreePaths as W, parseCommand as Y, projectReviewDetail as _, checkAgentReply as a, buildTaskTitleRefinementPrompt as b, deriveChildSessionName as c, describePushLanding as d, describeRoleRefusal as f, projectMyPrs as g, parseAgentVerb as h, agentCommandSpec as i, parseRefinedTaskTitle as j, isSubstantivePrompt as k, describeChildEndNote as l, isAgentApiVerb as m, REFUSAL_REASON as n, decideAgentRequest as o, describeUnpushedCloseRefusal as p, OWNED_COMMAND_SPECS as q, agentCommandHelpLines as r, decideSpawnAllowance as s, AGENT_COMMAND_HELP as t, describeKeptChildAttention as u, projectReviews as v, extractAiTitle as w, chooseRefinedSessionName as x, buildPersistedTaskTitle as y, resolveResumeTarget as z };
@@ -4,7 +4,6 @@ import { p as writeTextAtomicSync } from "./json-file-AKRVPqG1.js";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  //#region server/agent-setup-cli.ts
7
- var USAGE = "Usage: glimmervoid agent setup grok";
8
7
  function setupInputs(env = process.env) {
9
8
  return {
10
9
  filePath: grok.hooksFilePath(env),
@@ -110,16 +109,14 @@ function runGrokSetup({ env, fileSystem, log, error }) {
110
109
  log(`Installed Grok hooks at ${inputs.filePath}`);
111
110
  return 0;
112
111
  }
113
- function runAgentSetupCli(args, deps = {}) {
112
+ function runAgentSetupCli(deps = {}) {
114
113
  const { env = process.env, fileSystem = fs, log = console.log, error = console.error } = deps;
115
- if (args[0] === "setup" && args[1] === "grok" && args.length === 2) return runGrokSetup({
114
+ return runGrokSetup({
116
115
  env,
117
116
  fileSystem,
118
117
  log,
119
118
  error
120
119
  });
121
- error(USAGE);
122
- return 1;
123
120
  }
124
121
  //#endregion
125
122
  export { inspectGrokAgentSetup, runAgentSetupCli };
@@ -12,11 +12,6 @@ var GLOBAL_OPTIONS = {
12
12
  doctor: { type: "boolean" },
13
13
  "no-open": { type: "boolean" }
14
14
  };
15
- var SUBCOMMANDS_HONORING_TRAILING_GLOBAL_OPTIONS = /* @__PURE__ */ new Set(["doctor", "pair"]);
16
- var OPTIONS_TAKING_A_VALUE = {
17
- "--config": "configPath",
18
- "--port": "port"
19
- };
20
15
  function commandNameIndex(argv) {
21
16
  const { tokens } = parseArgs({
22
17
  args: [...argv],
@@ -28,17 +23,6 @@ function commandNameIndex(argv) {
28
23
  const firstPositional = tokens.find((token) => token.kind === "positional");
29
24
  return firstPositional ? firstPositional.index : argv.length;
30
25
  }
31
- function scanTrailingGlobalOptions(subcommandArgs, globalOptions) {
32
- const scanned = { ...globalOptions };
33
- for (let index = 0; index < subcommandArgs.length; index += 1) {
34
- const valueKey = OPTIONS_TAKING_A_VALUE[subcommandArgs[index]];
35
- const value = subcommandArgs[index + 1];
36
- if (!valueKey || value === void 0) continue;
37
- scanned[valueKey] = value;
38
- index += 1;
39
- }
40
- return scanned;
41
- }
42
26
  function parseGlobalValues(leadingArgs) {
43
27
  try {
44
28
  return {
@@ -67,14 +51,12 @@ function parseCommandLine(argv) {
67
51
  const { values } = parsedGlobals;
68
52
  const name = argv[nameIndex];
69
53
  const subcommandArgs = argv.slice(nameIndex + 1);
70
- const honorsTrailingGlobalOptions = name !== void 0 && SUBCOMMANDS_HONORING_TRAILING_GLOBAL_OPTIONS.has(name);
71
- if (values.help || honorsTrailingGlobalOptions && (subcommandArgs.includes("--help") || subcommandArgs.includes("-h"))) return { kind: "help" };
72
- if (values.version || honorsTrailingGlobalOptions && subcommandArgs.includes("--version")) return { kind: "version" };
73
- const leadingGlobalOptions = {
54
+ if (values.help) return { kind: "help" };
55
+ if (values.version) return { kind: "version" };
56
+ const globalOptions = {
74
57
  configPath: values.config ?? null,
75
58
  port: values.port ?? null
76
59
  };
77
- const globalOptions = honorsTrailingGlobalOptions ? scanTrailingGlobalOptions(subcommandArgs, leadingGlobalOptions) : leadingGlobalOptions;
78
60
  if (values.doctor) return {
79
61
  kind: "subcommand",
80
62
  name: "doctor",
@@ -5,10 +5,10 @@ import { n as glimmervoidHomeDir, r as isOperatorHomeUnderTest, t as decideConfi
5
5
  import { $ as MyPrAutoRebase, $t as NODE_ID_RE, A as SIGN_URL_ENV, At as ReviewComment, Bt as TeamReviewStateEntry, Ct as FindingSeverity, D as SESSION_NAME_PATTERN, Dt as PostingPlan, Et as PostedReviewEvent, F as ShownFile, Ft as ReviewVerdict, G as Frame, Gt as canApproveAfterComment, H as BoardRecord, Ht as TeamReviewThreadCommentsResponse, It as TeamReviewActionRequest, J as WHITEBOARD_LIMITS, Jt as hasStandingViewerApproval, K as Note, Kt as decisionAsIfApprovalRequired, L as SshSignRequest, Mt as ReviewFinding, Nt as ReviewResult, O as SESSION_NAME_RULE_TEXT, Ot as PrDetail, Pt as ReviewThreadId, Q as MyPr, Qt as GH_SEGMENT, Rt as TeamReviewCompareFiles, S as ConversationQuestion, St as EarlierReview, T as SESSION_DOC_BODY_CAP_BYTES, Tt as GithubReviewState, Ut as TeamReviewThreadResult, Vt as TeamReviewStatus, W as Box, Wt as TeamReviewThreadsRepository, X as Wire, Xt as HEX_SHA_RE, Z as LinkedPr, Zt as shortSha, _ as COHERENCE_HOOKS_INACTIVE, at as MyPrMergeMethod, b as CONVERSATION_TOOL_RESULT_HOOK_EVENT, bt as CommitSha, cn as MERGEABLE_LIVE_STATES, ct as MyPrMergeStateResponse, en as REPO_SLUG_RE, et as MyPrCheckContext, ft as MyPrThreadNode, ht as MyPrsState, i as ASK_USER_QUESTION_TOOL_NAME, it as MyPrLaneEntry, j as SSH_SIGN_BODY_CAP_BYTES, jt as ReviewDraft, k as SHOWN_FILE_CAP_BYTES, ln as RESTARTABLE_STATES, lt as MyPrMergeWhenReadyRequest, mt as MyPrsSnapshot, nt as MyPrKeepMergeableRequest, on as BADGE_LABELS, ot as MyPrMergeRequest, pt as MyPrThreadsResponse, r as AGENT_URL_ENV, sn as KILLABLE_STATES, tn as repoParts, tt as MyPrCheckContextsResponse, un as STATES, v as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, xt as DECIDING_REVIEW_STATES, y as CONVERSATION_PERMISSION_HOOK_EVENT, z as TaskTitle, zt as TeamReviewResolveResponse } from "./session-CcJLn3EZ.js";
6
6
  import { c as spawn, i as execFileSync, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-BCOoKfxG.js";
7
7
  import { $t as issuePullRequestStateFromGithub, A as HINT_VIEW_BY_FEATURE, At as SessionSetup, B as MergedPrListing, Bt as PLAN_RESULT_HOOK_EVENT, Ct as CommunityItem, D as pullRequestKeyFromReference, Et as DISCORD_CHANNEL_NAME_RE, F as BenchmarkJudgement, Ft as ChangeMap, G as GithubPrLightSearchNode, Gt as planTitle, H as PrCheckoutCaseInput, Ht as PlanDecision, I as BenchmarkRun, It as changeMapFactId, J as WorkflowCommentBody, Jt as IssueKey, K as GithubPrsFrame, Kt as GithubIssuePullRequestsRepository, L as BenchmarkStatus, Lt as PLAN_BODY_CAP_BYTES, M as BenchmarkActionRequest, Mt as TraceCheckpoint, N as BenchmarkCase, Nt as TraceRecord, O as FeatureHintState, P as BenchmarkId, Pt as CoherenceJournalOutput, Qt as IssuesStatus, R as BenchmarkSuite, Rt as PLAN_HOOK_EVENT, St as CommunityDraft, Tt as CommunityVerdict, U as GithubPrDetailNode, Ut as PlanRevision, V as MinedPrReviewData, Vt as PLAN_TOOL_NAME, W as GithubPrKey, Wt as parseExitPlanModeHookPayload, X as WorkflowsSettings, Xt as IssuesSearchResponse, Y as WorkflowLabelName, Yt as IssueUpdate, Z as WorkflowsState, Zt as IssuesState, _ as CLIENT_LOG_TEXT_MAX_CHARS, a as ConfigUpdate, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, gt as USAGE_INTEGER_RANGES, h as CHANGES_POLL_INTERVAL_MS, jt as MAX_RAW_LINE_CHARS, k as HINT_FEATURES, kt as UpdateJournal, p as USAGE_VENDOR_KEYS, q as comparablePrKey, qt as GithubIssueResponse, r as BrowserConfig, rt as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage, v as CONTROL_FRAME_MAX_BYTES, wt as CommunityState, x as GithubTeam, xt as CommunityActionRequest, y as ClientMessage, z as CommitComparison, zt as PLAN_HOOK_OUTPUT_MAX_CHARS } from "./config-BIVF12fQ.js";
8
- import { A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-CVleheDx.js";
8
+ import { A as parseRefinedSessionName, B as resumePromptFor, C as decideTaskTitleRefinement, D as extractPromptTaskTitle, E as extractOscTaskTitle, F as AUTO_CONTINUE_PROMPT, G as isAutoNameOf, H as claudeProjectsDir, I as RESUME_ID_RE, K as nextSuggestedName, L as isConversationReplacedAtStartup, M as resolveRefocusTaskTitle, N as resolveTaskTitle, O as isSelfWakePrompt, P as seedTaskTitleSources, R as pickAutoResume, S as cleanTaskPrompt, T as extractHookTaskTitle, U as listRepoConversations, V as shouldAdoptReportedResumeId, W as listRepoWorktreePaths, _ as projectReviewDetail, a as checkAgentReply, b as buildTaskTitleRefinementPrompt, c as deriveChildSessionName, d as describePushLanding, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as parseRefinedTaskTitle, k as isSubstantivePrompt, l as describeChildEndNote, n as REFUSAL_REASON, o as decideAgentRequest, p as describeUnpushedCloseRefusal, s as decideSpawnAllowance, u as describeKeptChildAttention, v as projectReviews, w as extractAiTitle, x as chooseRefinedSessionName, y as buildPersistedTaskTitle, z as resolveResumeTarget } from "./agent-api-core-BHcWVTPO.js";
9
9
  import { a as permitsHelpCommand, o as supervisionLine, r as describeSessionLimits } from "./session-routes-BGK07awr.js";
10
10
  import { a as rawTextOr, i as positiveNumberOr, n as isRecord, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-oz_Z_6E7.js";
11
- import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-CkHaTbB0.js";
11
+ import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-xS1GFU8P.js";
12
12
  import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
13
13
  import { r as refocusReplyFor, t as promptContextReplyOf } from "./refocus-core-zXihqRvU.js";
14
14
  import { n as parseJsonRecord, t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
@@ -25,7 +25,7 @@ import { c as CODEX_HOME_PROFILE, l as KIMI_HOME_PROFILE } from "./agent-home-co
25
25
  import { d as releaseSessionLock, f as sessionIdOfLockFile, l as releaseUnheldAgentHomeSecrets, n as generatedAgentHomePath, p as trashSessionTempFolderOnceUnheld, s as realAgentHome, u as createHeldSessionTempFolder } from "./agent-home-BzANIIVe.js";
26
26
  import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME } from "./ssh-signing-core-CRhVVWNW.js";
27
27
  import { a as configSiblingPath, c as defaultPairingsPath, d as decideDeviceAuth, f as deviceNameFromUserAgent, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, p as hashSecret, r as validateRemoteConfig, s as createSeenStore, t as decideBindHost, u as DEFAULT_DEVICE_MAX_AGE_MS } from "./remote-config-BmRf7ZgF.js";
28
- import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-d9Tj5jwO.js";
28
+ import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-CPPzHMNL.js";
29
29
  import { createRequire } from "node:module";
30
30
  import fs, { readFileSync } from "node:fs";
31
31
  import path, { join, resolve } from "node:path";
@@ -26,11 +26,6 @@ function readConfig(configPath) {
26
26
  return null;
27
27
  }
28
28
  }
29
- function argValue(args, flag) {
30
- const idx = args.indexOf(flag);
31
- if (idx === -1 || idx + 1 >= args.length) return null;
32
- return args[idx + 1];
33
- }
34
29
  function buildPairUrl(remote, token) {
35
30
  if (remote.publicHost) return `https://${remote.publicHost}/pair/${token}`;
36
31
  return `http://127.0.0.1:${remote.port}/pair/${token}`;
@@ -88,24 +83,17 @@ function runRevoke(store, id) {
88
83
  console.error("Failed to write the pairing file - nothing was revoked.");
89
84
  return 1;
90
85
  }
91
- function runPairCli(args) {
86
+ function runPairCli({ isListing, revokeDeviceId, deviceName }) {
92
87
  const configPath = resolveConfigPath();
93
88
  const config = readConfig(configPath);
94
89
  if (!config) return 1;
95
90
  const remote = normalizeRemoteConfig(config.remote);
96
91
  const store = createPairingsStore({ filePath: defaultPairingsPath(configPath) });
97
92
  const seenStore = createSeenStore({ filePath: defaultSeenPath(configPath) });
98
- if (args.includes("--list")) return runList(store, seenStore);
99
- if (args.includes("--revoke")) {
100
- const id = argValue(args, "--revoke");
101
- if (!id) {
102
- console.error("Usage: glimmervoid pair --revoke <device-id>");
103
- return 1;
104
- }
105
- return runRevoke(store, id);
106
- }
93
+ if (isListing) return runList(store, seenStore);
94
+ if (revokeDeviceId !== null) return runRevoke(store, revokeDeviceId);
107
95
  store.prunePending();
108
- return runMint(store, remote, argValue(args, "--name"));
96
+ return runMint(store, remote, deviceName);
109
97
  }
110
98
  //#endregion
111
99
  export { runPairCli };
@@ -5,27 +5,10 @@ import { r as BrowserConfig } from "./config-BIVF12fQ.js";
5
5
  import { n as isRecord } from "./coerce-oz_Z_6E7.js";
6
6
  import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
7
7
  import { E as setValueAtPath, Q as readEnvSecrets, T as scoreSettingsSearch, Z as ENV_SECRET_BINDINGS, b as cloneValue, c as loadConfigFile, d as validateConfig, et as withEnvSecrets, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, r as IS_EXPERIMENTAL_BUILD, u as saveConfigFileOnce, w as parsePosthogProjectSelection, x as deleteValueAtPath } from "./config-store-C-aX7XDc.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-d9Tj5jwO.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-CPPzHMNL.js";
9
9
  import fs from "node:fs";
10
10
  import os from "node:os";
11
- import { parseArgs } from "node:util";
12
11
  //#region server/settings-cli.ts
13
- var usage = `glimmervoid settings: read and change config.json from the command line
14
-
15
- glimmervoid settings list every config.json setting with its value and where the value comes from
16
- glimmervoid settings get <path> one setting; a secret shows as configured or not configured, never its value
17
- glimmervoid settings set <path> <value> validate the whole file and write it; a running Glimmervoid reloads it
18
- glimmervoid settings unset <path> remove the key from config.json so the default applies
19
- glimmervoid settings search <text> find settings by title, keyword, key path or section
20
- glimmervoid settings schema every setting: id, path, type, default, unit, effect and section (needs no config file)
21
-
22
- <path> is a config.json key path such as posthog.trafficSpikeEnabled, or a setting id such as posthog-traffic-enabled.
23
- <value> is true or false for a toggle, a number, text, a comma-separated or JSON list, or JSON for a structured value.
24
- A number is in the unit config.json stores, as schema's Stored unit column names: set branchGc.intervalMs 21600000 means 21600000 ms.
25
- Where the dashboard shows another unit, get, list and set add it in parentheses, such as 30000 (30 seconds).
26
- A secret (a bot token or API key) is never set or unset here, since a value on the command line lands in shell history;
27
- change it in the dashboard settings or through its environment variable.
28
- --json machine-readable output`;
29
12
  var EFFECT_NOTES = Object.freeze({
30
13
  now: "A running Glimmervoid applies it without a restart.",
31
14
  "new-sessions": "Sessions started after this change use it.",
@@ -34,7 +17,7 @@ var EFFECT_NOTES = Object.freeze({
34
17
  var HAND_EDITED_SETTING_REASONS = /* @__PURE__ */ new Map([["port", "a listener port that clashes with remote.port stops Glimmervoid from starting"]]);
35
18
  function requirePositional(positionals, index, name) {
36
19
  const value = positionals[index];
37
- if (value === void 0) throw new Error(`missing <${name}>\n\n${usage}`);
20
+ if (value === void 0) throw new Error(`missing <${name}>; run glimmervoid settings --help for the usage`);
38
21
  return value;
39
22
  }
40
23
  function parseListValue(path, raw) {
@@ -245,7 +228,7 @@ var commands = {
245
228
  },
246
229
  search: (context) => {
247
230
  const query = context.positionals.slice(1).join(" ");
248
- if (query.trim() === "") throw new Error(`missing <text>\n\n${usage}`);
231
+ if (query.trim() === "") throw new Error("missing <text>; run glimmervoid settings --help for the usage");
249
232
  const results = scoreSettingsSearch(SETTINGS_REGISTRY.sections, query, SETTINGS_REGISTRY.fileOnly).filter((result) => isSettingAvailable(result.setting, IS_EXPERIMENTAL_BUILD));
250
233
  const rows = results.map((result) => [
251
234
  result.setting.scope === "browser" ? `${result.setting.id} (browser preference)` : result.setting.path,
@@ -293,44 +276,34 @@ var commands = {
293
276
  ], rowOf));
294
277
  }
295
278
  };
296
- function runCommandLine(commandArguments, io) {
297
- const { values, positionals } = parseArgs({
298
- args: commandArguments,
299
- allowPositionals: true,
300
- options: {
301
- json: {
302
- type: "boolean",
303
- default: false
304
- },
305
- help: {
306
- type: "boolean",
307
- short: "h",
308
- default: false
309
- }
310
- }
311
- });
312
- const commandName = positionals[0];
313
- const command = commandName === void 0 ? void 0 : commands[commandName];
314
- if (values.help || commandName === void 0 || command === void 0) {
315
- io.writeOutput(`${usage}\n`);
316
- return values.help ? 0 : 1;
317
- }
318
- return command({
319
- positionals,
320
- isJson: values.json,
321
- writeOutput: io.writeOutput
322
- });
323
- }
324
279
  function processIo() {
325
280
  return {
326
281
  writeOutput: (text) => process.stdout.write(text),
327
282
  writeError: (text) => process.stderr.write(text)
328
283
  };
329
284
  }
330
- async function runSettingsCli(commandArguments, io = processIo()) {
331
- const serverRequest = settingsRequestForServer(commandArguments, process.env);
332
- if (!serverRequest) return runSettingsCommand(commandArguments, io);
333
- const { askAgentApi } = await import("./agent-api-cli-DIHuV81M.js");
285
+ function runParsedSettingsCommand(parsed, io) {
286
+ const commandName = parsed.commandPath[1] ?? "";
287
+ const command = commands[commandName];
288
+ if (!command) {
289
+ io.writeError(`settings: unknown command ${commandName}\n`);
290
+ return 1;
291
+ }
292
+ try {
293
+ return command({
294
+ positionals: [commandName, ...parsed.positionals],
295
+ isJson: parsed.values.json === true,
296
+ writeOutput: io.writeOutput
297
+ });
298
+ } catch (error) {
299
+ io.writeError(`settings: ${errorMessage(error)}\n`);
300
+ return 1;
301
+ }
302
+ }
303
+ async function runParsedSettingsCli(parsed, io = processIo()) {
304
+ const serverRequest = settingsRequestForServer(parsed, process.env);
305
+ if (!serverRequest) return runParsedSettingsCommand(parsed, io);
306
+ const { askAgentApi } = await import("./agent-api-cli-IszLDyTY.js");
334
307
  const reply = AgentSettingsReply.safeParse(await askAgentApi("settings", serverRequest).catch((error) => ({
335
308
  ok: false,
336
309
  error: errorMessage(error)
@@ -343,17 +316,8 @@ async function runSettingsCli(commandArguments, io = processIo()) {
343
316
  io.writeError(`settings: ${reply.data.error}\n`);
344
317
  return 1;
345
318
  }
346
- const isJson = commandArguments.includes("--json");
347
- io.writeOutput(`${isJson ? JSON.stringify(reply.data.readout, null, 2) : reply.data.text}\n`);
319
+ io.writeOutput(`${parsed.values.json === true ? JSON.stringify(reply.data.readout, null, 2) : reply.data.text}\n`);
348
320
  return 0;
349
321
  }
350
- function runSettingsCommand(commandArguments, io = processIo()) {
351
- try {
352
- return runCommandLine(commandArguments, io);
353
- } catch (error) {
354
- io.writeError(`settings: ${errorMessage(error)}\n`);
355
- return 1;
356
- }
357
- }
358
322
  //#endregion
359
- export { runSettingsCli };
323
+ export { runParsedSettingsCli };
@@ -1,7 +1,6 @@
1
1
  import { h as AgentSettingsRequest } from "./session-CcJLn3EZ.js";
2
2
  import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
3
3
  import { A as FILE_ONLY_GROUPS, C as hasScaledUnit, D as settingsGroupOf, O as settingsOf, Q as readEnvSecrets, S as displayText, b as cloneValue, j as SETTINGS_REGISTRY, k as valueAtPath, m as isSettingAvailable, y as SETTINGS_INDEX } from "./config-store-C-aX7XDc.js";
4
- import { parseArgs } from "node:util";
5
4
  //#region server/core/settings-readout-core.ts
6
5
  var VALUE_COLUMN_WIDTH = 40;
7
6
  var SECTION_BY_SETTING_ID = new Map([...SETTINGS_REGISTRY.sections.flatMap((section) => section.settings.map((setting) => [setting.id, {
@@ -189,17 +188,11 @@ function readSettingsForAgent({ command, path }, view) {
189
188
  ...getSetting(view, resolved.value)
190
189
  };
191
190
  }
192
- function settingsRequestForServer(commandArguments, env) {
191
+ function settingsRequestForServer({ commandPath, positionals }, env) {
193
192
  if (!env["GLIMMERVOID_AGENT_URL"]) return null;
194
- const { values, positionals } = parseArgs({
195
- args: [...commandArguments],
196
- allowPositionals: true,
197
- strict: false
198
- });
199
- if (values.help) return null;
200
193
  const parsed = AgentSettingsRequest.safeParse({
201
- command: positionals[0],
202
- ...positionals[1] === void 0 ? {} : { path: positionals[1] }
194
+ command: commandPath[1],
195
+ ...positionals[0] === void 0 ? {} : { path: positionals[0] }
203
196
  });
204
197
  return parsed.success ? parsed.data : null;
205
198
  }
@@ -2,7 +2,7 @@ import { r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { A as SIGN_URL_ENV, I as SshSignReply } from "./session-CcJLn3EZ.js";
3
3
  import { c as spawn, r as execFileAsync } from "./child-process-safe-BCOoKfxG.js";
4
4
  import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
5
- import { n as postToAgentIngress } from "./agent-api-cli-DGJ38W5Q.js";
5
+ import { n as postToAgentIngress } from "./agent-api-cli-7a-qwVK2.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"./updates-view-core-D9wi2i2r.js";import{n as e,r as t,s as n}from"./dom-helpers-DBbFg1c_.js";import{$ as r,Q as i,et as a}from"./index-B1lOI6hU.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,i){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,r.title),t(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),t(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),t(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=n(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=n(`span`,`bench-status`,(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(n(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,r.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:t}=i(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};
1
+ import"./updates-view-core-D9wi2i2r.js";import{n as e,r as t,s as n}from"./dom-helpers-DBbFg1c_.js";import{$ as r,Q as i,et as a}from"./index-CEACcf33.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,i){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=i,a.addEventListener(`click`,()=>r(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,r){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=i(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===r.id,f=!!e.inFlight&&!l,m=o.has(r.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,r.title),t(`bench`,r.caseCount===1?`case`:`cases`,String(r.caseCount)),t(`bench`,r.candidateCount===1?`candidate`:`candidates`,String(r.candidateCount)),t(`bench`,`arms`,String(r.armIds.length))),c.append(h);let g=n(`div`,`bench-controls`),_=e.configured===!0&&r.error===null;g.append(u(r,`mine`,!_||m||l),u(r,`run`,!_||m||l||f||r.caseCount===0),u(r,`cancel`,m||!l));let v=n(`span`,`bench-status`,(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(n(`p`,`bench-error`,r.error)),c;let y=r.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,r.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:t}=i(),r=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(r),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};