glimmervoid 0.48.2-next.320 → 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.
- package/dist/bin/glimmervoid.js +53 -28
- package/dist/chunks/{agent-api-cli-DD9EE5Ab.js → agent-api-cli-7a-qwVK2.js} +68 -75
- package/dist/chunks/{agent-api-cli-Wsuo3vry.js → agent-api-cli-IszLDyTY.js} +1 -1
- package/dist/chunks/{agent-api-core-CRjUWPzJ.js → agent-api-core-BHcWVTPO.js} +396 -14
- package/dist/chunks/{agent-setup-cli-C3R5_hr1.js → agent-setup-cli-C4VZliUA.js} +2 -5
- package/dist/chunks/{git-version-jHhRrdeV.js → git-version-xS1GFU8P.js} +51 -52
- package/dist/chunks/{main-BqEQOvDt.js → main-BsxukuSb.js} +3 -3
- package/dist/chunks/{pair-cli-KGg8V1HG.js → pair-cli-Bdn1AOva.js} +4 -16
- package/dist/chunks/{settings-cli-KJt7HSxn.js → settings-cli-H3UxJLZo.js} +27 -63
- package/dist/chunks/{settings-readout-core-d9Tj5jwO.js → settings-readout-core-CPPzHMNL.js} +3 -10
- package/dist/chunks/{ssh-sign-cli-CCE8l4Ed.js → ssh-sign-cli-BtTvxMEu.js} +1 -1
- package/dist/client/assets/{benchmark-panel-pFL_ZXRq.js → benchmark-panel-CiNkBRS4.js} +1 -1
- package/dist/client/assets/benchmark-panel-CiNkBRS4.js.br +0 -0
- package/dist/client/assets/{boards-view-B6XcY8Es.js → boards-view-D1d_Jeh2.js} +1 -1
- package/dist/client/assets/boards-view-D1d_Jeh2.js.br +0 -0
- package/dist/client/assets/{community-panel-CtG4tzFI.js → community-panel-Cm9HnXDd.js} +1 -1
- package/dist/client/assets/community-panel-Cm9HnXDd.js.br +0 -0
- package/dist/client/assets/{dialogs-CzpAY8Nq.js → dialogs-DWcur78f.js} +1 -1
- package/dist/client/assets/dialogs-DWcur78f.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-BYcNpH6-.js → doc-editor-ui-NGbnywAB.js} +1 -1
- package/dist/client/assets/doc-editor-ui-NGbnywAB.js.br +0 -0
- package/dist/client/assets/{feature-hint-BsCfpypK.js → feature-hint-BPITXLNF.js} +1 -1
- package/dist/client/assets/feature-hint-BPITXLNF.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-C82KMpwg.js → first-run-checklist-C_qQ8RA8.js} +1 -1
- package/dist/client/assets/first-run-checklist-C_qQ8RA8.js.br +0 -0
- package/dist/client/assets/{hooks-panel-DtiNBBaX.js → hooks-panel-B8s0WX5_.js} +1 -1
- package/dist/client/assets/hooks-panel-B8s0WX5_.js.br +0 -0
- package/dist/client/assets/{index-0vbw-xeU.js → index-CEACcf33.js} +5 -5
- package/dist/client/assets/index-CEACcf33.js.br +0 -0
- package/dist/client/assets/{issues-panel-YeHM4pir.js → issues-panel-Cc06Bgsi.js} +1 -1
- package/dist/client/assets/issues-panel-Cc06Bgsi.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-DQJ-zpBI.js → my-prs-panel-Ck43NtDT.js} +1 -1
- package/dist/client/assets/my-prs-panel-Ck43NtDT.js.br +0 -0
- package/dist/client/assets/{nyan-cat-D7Ygthre.js → nyan-cat-BWGtd4eG.js} +1 -1
- package/dist/client/assets/nyan-cat-BWGtd4eG.js.br +0 -0
- package/dist/client/assets/{phone-shell-gHLW4-Dr.js → phone-shell-BO3n6oG8.js} +1 -1
- package/dist/client/assets/phone-shell-BO3n6oG8.js.br +0 -0
- package/dist/client/assets/{plan-face-c0-JGSVu.js → plan-face-CRL-SLAn.js} +1 -1
- package/dist/client/assets/plan-face-CRL-SLAn.js.br +0 -0
- package/dist/client/assets/{plan-render-Dx_VJZGs.js → plan-render-BDtI7Wsb.js} +1 -1
- package/dist/client/assets/plan-render-BDtI7Wsb.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-DnRL1H6r.js → pr-queue-columns-C93KRGpe.js} +1 -1
- package/dist/client/assets/pr-queue-columns-C93KRGpe.js.br +0 -0
- package/dist/client/assets/{radar-panel-BQVEo5mr.js → radar-panel-CHn9u2qd.js} +1 -1
- package/dist/client/assets/radar-panel-CHn9u2qd.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-CFNNM2WJ.js → repo-roots-adder-CqiH197r.js} +1 -1
- package/dist/client/assets/repo-roots-adder-CqiH197r.js.br +0 -0
- package/dist/client/assets/{resume-dialog-DYzfPxV6.js → resume-dialog-BCbNwxkR.js} +1 -1
- package/dist/client/assets/resume-dialog-BCbNwxkR.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-C4v1whXA.js → review-queue-panel-ByaEF2nY.js} +1 -1
- package/dist/client/assets/review-queue-panel-ByaEF2nY.js.br +0 -0
- package/dist/client/assets/{settings-panel-Dnbb479q.js → settings-panel-BqCGzUKq.js} +2 -2
- package/dist/client/assets/settings-panel-BqCGzUKq.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-B9zPGrQP.js → shown-lightbox-C7i8y4gs.js} +1 -1
- package/dist/client/assets/shown-lightbox-C7i8y4gs.js.br +0 -0
- package/dist/client/assets/{team-review-panel-CIhBhZKT.js → team-review-panel-DZ4FF985.js} +1 -1
- package/dist/client/assets/team-review-panel-DZ4FF985.js.br +0 -0
- package/dist/client/assets/{trace-panel-BhXPkGsF.js → trace-panel-CAA0R9vJ.js} +1 -1
- package/dist/client/assets/trace-panel-CAA0R9vJ.js.br +0 -0
- package/dist/client/assets/{usage-panel-ChRf0OEC.js → usage-panel-B6DaIaan.js} +1 -1
- package/dist/client/assets/usage-panel-B6DaIaan.js.br +0 -0
- package/dist/client/assets/{your-day-tip-uAwBcPLp.js → your-day-tip-X3qp4x_t.js} +1 -1
- package/dist/client/assets/your-day-tip-X3qp4x_t.js.br +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/benchmark-panel-pFL_ZXRq.js.br +0 -0
- package/dist/client/assets/boards-view-B6XcY8Es.js.br +0 -0
- package/dist/client/assets/community-panel-CtG4tzFI.js.br +0 -0
- package/dist/client/assets/dialogs-CzpAY8Nq.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-BYcNpH6-.js.br +0 -0
- package/dist/client/assets/feature-hint-BsCfpypK.js.br +0 -0
- package/dist/client/assets/first-run-checklist-C82KMpwg.js.br +0 -0
- package/dist/client/assets/hooks-panel-DtiNBBaX.js.br +0 -0
- package/dist/client/assets/index-0vbw-xeU.js.br +0 -0
- package/dist/client/assets/issues-panel-YeHM4pir.js.br +0 -0
- package/dist/client/assets/my-prs-panel-DQJ-zpBI.js.br +0 -0
- package/dist/client/assets/nyan-cat-D7Ygthre.js.br +0 -0
- package/dist/client/assets/phone-shell-gHLW4-Dr.js.br +0 -0
- package/dist/client/assets/plan-face-c0-JGSVu.js.br +0 -0
- package/dist/client/assets/plan-render-Dx_VJZGs.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-DnRL1H6r.js.br +0 -0
- package/dist/client/assets/radar-panel-BQVEo5mr.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-CFNNM2WJ.js.br +0 -0
- package/dist/client/assets/resume-dialog-DYzfPxV6.js.br +0 -0
- package/dist/client/assets/review-queue-panel-C4v1whXA.js.br +0 -0
- package/dist/client/assets/settings-panel-Dnbb479q.js.br +0 -0
- package/dist/client/assets/shown-lightbox-B9zPGrQP.js.br +0 -0
- package/dist/client/assets/team-review-panel-CIhBhZKT.js.br +0 -0
- package/dist/client/assets/trace-panel-BhXPkGsF.js.br +0 -0
- package/dist/client/assets/usage-panel-ChRf0OEC.js.br +0 -0
- package/dist/client/assets/your-day-tip-uAwBcPLp.js.br +0 -5
package/dist/bin/glimmervoid.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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";
|
|
@@ -45,37 +45,62 @@ if (commandLine.kind === "help") {
|
|
|
45
45
|
await drainOutput();
|
|
46
46
|
process.exit(0);
|
|
47
47
|
}
|
|
48
|
+
if (commandLine.kind === "refused") {
|
|
49
|
+
console.error(commandLine.text);
|
|
50
|
+
await drainOutput();
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
48
53
|
if (commandLine.kind === "version") {
|
|
49
54
|
console.log(pkg.version);
|
|
50
55
|
process.exit(0);
|
|
51
56
|
}
|
|
52
57
|
if (commandLine.globalOptions.configPath) process.env.GLIMMERVOID_CONFIG = commandLine.globalOptions.configPath;
|
|
53
58
|
if (commandLine.globalOptions.port) process.env.GLIMMERVOID_PORT = commandLine.globalOptions.port;
|
|
54
|
-
var
|
|
55
|
-
|
|
59
|
+
var OWNED_COMMAND_RUNNERS = {
|
|
60
|
+
doctor: async () => {
|
|
56
61
|
await runDoctor();
|
|
57
62
|
return 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const { runPairCli } = await import("../chunks/pair-cli-
|
|
61
|
-
return runPairCli(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const {
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const {
|
|
73
|
-
return
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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");
|
|
79
104
|
return runAgentApiCli([subcommandName, ...subcommandArgs]);
|
|
80
105
|
}])]);
|
|
81
106
|
var AGENT_INSTALL_COMMAND_BY_ID = {
|
|
@@ -89,7 +114,7 @@ function missingAgentText(agentId) {
|
|
|
89
114
|
}
|
|
90
115
|
async function printSessionLimits() {
|
|
91
116
|
if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
|
|
92
|
-
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-
|
|
117
|
+
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-IszLDyTY.js");
|
|
93
118
|
const limitsLines = await sessionLimitsHelpLines();
|
|
94
119
|
console.log(`\n${limitsLines.join("\n")}`);
|
|
95
120
|
}
|
|
@@ -230,7 +255,7 @@ async function runDoctor() {
|
|
|
230
255
|
const { label, path: resolvedPath } = describeAgentResolvability(id);
|
|
231
256
|
line(`${id} (${label})`, resolvedPath ?? missingAgentText(id));
|
|
232
257
|
}
|
|
233
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
258
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C4VZliUA.js");
|
|
234
259
|
const grokSetup = inspectGrokAgentSetup();
|
|
235
260
|
line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
|
|
236
261
|
const { default: kimi } = await import("../chunks/kimi-CGoGWhyH.js");
|
|
@@ -244,7 +269,7 @@ async function runDoctor() {
|
|
|
244
269
|
try {
|
|
245
270
|
const { resolvePackageBin } = await import("../chunks/runtime-paths-DUfaYypN.js");
|
|
246
271
|
const { execFileSync } = await import("../chunks/child-process-safe-BKjzSEYd.js");
|
|
247
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
272
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-C4VZliUA.js");
|
|
248
273
|
const binPath = resolvePackageBin("cc-safety-net", "cc-safety-net");
|
|
249
274
|
line("Sane YOLO", binPath || "not installed");
|
|
250
275
|
if (binPath) line("cc-safety-net version", execFileSync(process.execPath, [binPath, "--version"], {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as AgentLimitsReply, r as AGENT_URL_ENV } from "./session-CcJLn3EZ.js";
|
|
2
|
+
import { Y as parseCommand, i as agentCommandSpec, m as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-BHcWVTPO.js";
|
|
2
3
|
import { i as formatSessionLimits } from "./session-routes-BGK07awr.js";
|
|
3
|
-
import { p as isAgentApiVerb, t as AGENT_COMMAND_HELP } from "./agent-api-core-CRjUWPzJ.js";
|
|
4
4
|
import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
|
|
5
5
|
import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
|
|
6
6
|
import { r as describeOverCap } from "./shown-files-core-hKeo7SMT.js";
|
|
@@ -12,33 +12,35 @@ import { pipeline } from "node:stream";
|
|
|
12
12
|
var AGENT_PATH_PREFIX = "/agent/";
|
|
13
13
|
var HELP_LIMITS_TIMEOUT_MS = 2e3;
|
|
14
14
|
var HELP_LIMITS_UNKNOWN_LINE = "This session: Glimmervoid did not report its limits, so run glimmervoid limits to see why";
|
|
15
|
-
function
|
|
16
|
-
|
|
15
|
+
function joinedText(words) {
|
|
16
|
+
return words.join(" ").trim();
|
|
17
|
+
}
|
|
18
|
+
function pullRequestBody({ positionals }) {
|
|
19
|
+
const pullRequest = joinedText(positionals);
|
|
17
20
|
return pullRequest ? { pr: pullRequest } : null;
|
|
18
21
|
}
|
|
19
22
|
function readOpsArgument(opsText) {
|
|
20
23
|
if (opsText === "-") return parseJsonOrNull(fs.readFileSync(0, "utf8"));
|
|
21
24
|
return parseJsonOrNull(opsText);
|
|
22
25
|
}
|
|
23
|
-
function whiteboardBody(
|
|
24
|
-
const
|
|
26
|
+
function whiteboardBody({ commandPath, positionals }) {
|
|
27
|
+
const subcommand = commandPath[1];
|
|
28
|
+
const joined = joinedText(positionals);
|
|
25
29
|
if (subcommand === "list") return { sub: "list" };
|
|
26
|
-
if (subcommand === "new"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
const [board, ...argumentWords] = rest;
|
|
30
|
+
if (subcommand === "new") return joined ? {
|
|
31
|
+
sub: "new",
|
|
32
|
+
title: joined
|
|
33
|
+
} : null;
|
|
34
|
+
if (subcommand === "connect" || subcommand === "disconnect" || subcommand === "get") return joined ? {
|
|
35
|
+
sub: subcommand,
|
|
36
|
+
board: joined
|
|
37
|
+
} : null;
|
|
38
|
+
const [board, ...argumentWords] = positionals;
|
|
37
39
|
if (!board || argumentWords.length === 0) return null;
|
|
38
40
|
if (subcommand === "resolve") return {
|
|
39
41
|
sub: "resolve",
|
|
40
42
|
board,
|
|
41
|
-
note: argumentWords
|
|
43
|
+
note: joinedText(argumentWords)
|
|
42
44
|
};
|
|
43
45
|
if (subcommand !== "put") return null;
|
|
44
46
|
const ops = readOpsArgument(argumentWords.join(" "));
|
|
@@ -49,55 +51,57 @@ function whiteboardBody([subcommand, ...rest]) {
|
|
|
49
51
|
ops: Array.isArray(ops) ? ops : [ops]
|
|
50
52
|
};
|
|
51
53
|
}
|
|
54
|
+
function answerBody({ values, positionals }) {
|
|
55
|
+
const [child, answerText, ...extra] = positionals;
|
|
56
|
+
if (!child?.trim() || extra.length > 0) return null;
|
|
57
|
+
if (values.operator === true) return answerText === void 0 ? {
|
|
58
|
+
child,
|
|
59
|
+
toOperator: true
|
|
60
|
+
} : null;
|
|
61
|
+
if (answerText === void 0) return null;
|
|
62
|
+
const answers = parseJsonOrNull(answerText);
|
|
63
|
+
if (typeof answers !== "object" || answers === null || Array.isArray(answers)) return null;
|
|
64
|
+
if (!Object.values(answers).every((answer) => typeof answer === "string")) return null;
|
|
65
|
+
return {
|
|
66
|
+
child,
|
|
67
|
+
answers
|
|
68
|
+
};
|
|
69
|
+
}
|
|
52
70
|
var BODY_BUILDERS = {
|
|
53
|
-
spawn: (
|
|
54
|
-
const prompt =
|
|
71
|
+
spawn: ({ positionals }) => {
|
|
72
|
+
const prompt = joinedText(positionals);
|
|
55
73
|
return prompt ? { prompt } : null;
|
|
56
74
|
},
|
|
57
|
-
send: (
|
|
58
|
-
read: (
|
|
59
|
-
const child =
|
|
75
|
+
send: ({ positionals }) => joinedText(positionals) ? { words: positionals } : null,
|
|
76
|
+
read: ({ positionals }) => {
|
|
77
|
+
const child = joinedText(positionals);
|
|
60
78
|
return child ? { child } : {};
|
|
61
79
|
},
|
|
62
|
-
close: (
|
|
63
|
-
const
|
|
64
|
-
const child = rest.filter((word) => word !== "--discard").join(" ").trim();
|
|
80
|
+
close: ({ values, positionals }) => {
|
|
81
|
+
const child = joinedText(positionals);
|
|
65
82
|
if (!child) return null;
|
|
66
|
-
return discard ? {
|
|
83
|
+
return values.discard === true ? {
|
|
67
84
|
child,
|
|
68
|
-
discard
|
|
85
|
+
discard: true
|
|
69
86
|
} : { child };
|
|
70
87
|
},
|
|
71
|
-
answer:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
child,
|
|
75
|
-
toOperator: true
|
|
76
|
-
};
|
|
77
|
-
const answers = parseJsonOrNull(answerText);
|
|
78
|
-
if (typeof answers !== "object" || answers === null || Array.isArray(answers)) return null;
|
|
79
|
-
if (!Object.values(answers).every((answer) => typeof answer === "string")) return null;
|
|
80
|
-
return {
|
|
81
|
-
child,
|
|
82
|
-
answers
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
attention: (rest) => {
|
|
86
|
-
const note = rest.join(" ").trim();
|
|
88
|
+
answer: answerBody,
|
|
89
|
+
attention: ({ positionals }) => {
|
|
90
|
+
const note = joinedText(positionals);
|
|
87
91
|
return note ? { note } : null;
|
|
88
92
|
},
|
|
89
93
|
board: () => ({}),
|
|
90
94
|
push: () => ({}),
|
|
91
|
-
edit: (
|
|
92
|
-
const docPath =
|
|
95
|
+
edit: ({ positionals }) => {
|
|
96
|
+
const docPath = joinedText(positionals);
|
|
93
97
|
return docPath ? { path: path.resolve(docPath) } : null;
|
|
94
98
|
},
|
|
95
99
|
limits: () => ({}),
|
|
96
100
|
review: pullRequestBody,
|
|
97
|
-
reviews: (
|
|
101
|
+
reviews: (parsed) => pullRequestBody(parsed) ?? {},
|
|
98
102
|
prs: () => ({}),
|
|
99
103
|
"link-pr": pullRequestBody,
|
|
100
|
-
settings: ([command, settingPath]) => ({
|
|
104
|
+
settings: ({ positionals: [command, settingPath] }) => ({
|
|
101
105
|
command,
|
|
102
106
|
...settingPath === void 0 ? {} : { path: settingPath }
|
|
103
107
|
}),
|
|
@@ -194,26 +198,10 @@ async function sessionLimitsHelpLines({ timeoutMs = HELP_LIMITS_TIMEOUT_MS } = {
|
|
|
194
198
|
return [HELP_LIMITS_UNKNOWN_LINE];
|
|
195
199
|
}
|
|
196
200
|
}
|
|
197
|
-
function
|
|
198
|
-
const filePaths = [];
|
|
199
|
-
let caption = null;
|
|
200
|
-
for (let index = 0; index < words.length; index += 1) {
|
|
201
|
-
const word = words[index];
|
|
202
|
-
if (word === "--caption") {
|
|
203
|
-
caption = words[index + 1] ?? "";
|
|
204
|
-
index += 1;
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
if (word.startsWith("--caption=")) {
|
|
208
|
-
caption = word.slice(10);
|
|
209
|
-
continue;
|
|
210
|
-
}
|
|
211
|
-
filePaths.push(word);
|
|
212
|
-
}
|
|
213
|
-
if (filePaths.length === 0) return null;
|
|
201
|
+
function showRequestOf({ values, positionals }) {
|
|
214
202
|
return {
|
|
215
|
-
filePaths,
|
|
216
|
-
caption: caption
|
|
203
|
+
filePaths: positionals,
|
|
204
|
+
caption: (typeof values.caption === "string" ? values.caption.trim().slice(0, 500) : "") || null
|
|
217
205
|
};
|
|
218
206
|
}
|
|
219
207
|
async function statFileToShow(filePath) {
|
|
@@ -258,12 +246,8 @@ function replyError(replyText) {
|
|
|
258
246
|
const error = typeof reply === "object" && reply !== null ? reply.error : null;
|
|
259
247
|
return typeof error === "string" ? error : `Glimmervoid answered ${replyText || "nothing"}`;
|
|
260
248
|
}
|
|
261
|
-
async function runShowCommand(
|
|
262
|
-
const request =
|
|
263
|
-
if (!request) {
|
|
264
|
-
console.error(AGENT_COMMAND_HELP.show.missingArgumentHint ?? "glimmervoid show: this command needs a file path");
|
|
265
|
-
return 1;
|
|
266
|
-
}
|
|
249
|
+
async function runShowCommand(parsed) {
|
|
250
|
+
const request = showRequestOf(parsed);
|
|
267
251
|
const target = sessionEndpoint("show");
|
|
268
252
|
if (!target.ok) {
|
|
269
253
|
console.error(target.error);
|
|
@@ -307,10 +291,19 @@ async function runAgentApiCli(args) {
|
|
|
307
291
|
console.error(`glimmervoid: ${verb || "that"} is not an agent command`);
|
|
308
292
|
return 1;
|
|
309
293
|
}
|
|
310
|
-
|
|
311
|
-
|
|
294
|
+
const parsed = parseCommand(agentCommandSpec(verb), args.slice(1));
|
|
295
|
+
if (parsed.kind === "help") {
|
|
296
|
+
console.log(parsed.text);
|
|
297
|
+
return 0;
|
|
298
|
+
}
|
|
299
|
+
if (parsed.kind === "refused") {
|
|
300
|
+
console.error(parsed.text);
|
|
301
|
+
return 1;
|
|
302
|
+
}
|
|
303
|
+
if (verb === "show") return runShowCommand(parsed);
|
|
304
|
+
const body = BODY_BUILDERS[verb](parsed);
|
|
312
305
|
if (!body) {
|
|
313
|
-
console.error(AGENT_COMMAND_HELP[verb].missingArgumentHint ??
|
|
306
|
+
console.error(`glimmervoid ${parsed.commandPath.join(" ")}: ${AGENT_COMMAND_HELP[verb].missingArgumentHint ?? "those arguments are not understood"}; run it with --help for its usage`);
|
|
314
307
|
return 1;
|
|
315
308
|
}
|
|
316
309
|
const target = sessionEndpoint(verb);
|
|
@@ -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-7a-qwVK2.js";
|