glimmervoid 0.46.2-next.148 → 0.46.2-next.151
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 +14 -11
- package/dist/chunks/{adapters-B411QZPa.js → adapters-BGwt5loj.js} +5 -4
- package/dist/chunks/{adapters-Dy_a5IJ0.js → adapters-XOu0l469.js} +1 -1
- package/dist/chunks/{agent-api-cli-BzXb4vri.js → agent-api-cli-BSDYHgZR.js} +1 -1
- package/dist/chunks/{agent-api-cli-DFru4iHG.js → agent-api-cli-MZ90f4jg.js} +1 -1
- package/dist/chunks/{agent-api-core-CKJxZlWQ.js → agent-api-core-CKgp5EgK.js} +1 -1
- package/dist/chunks/{agent-setup-cli-DpYpnB6s.js → agent-setup-cli-CCVsedku.js} +86 -18
- package/dist/chunks/{build-channel-CSLUgL7D.js → build-channel-Cfr6JMdE.js} +1 -1
- package/dist/chunks/{config-CD0H36oJ.js → config-BOQu9rsc.js} +2 -1
- package/dist/chunks/{config-store-DWt1yeB_.js → config-store-BhiA04q3.js} +2 -2
- package/dist/chunks/config-store-BtazOb6G.js +1 -0
- package/dist/chunks/{grok-B0SXkBAj.js → kimi-Su5nIzXw.js} +312 -44
- package/dist/chunks/{main-BzRuLm8p.js → main-DIY4OUic.js} +12 -12
- package/dist/chunks/{pair-cli-D6nkYwvQ.js → pair-cli-B5oHJtT_.js} +2 -2
- package/dist/chunks/{remote-config-Cg2vcQMZ.js → remote-config-B3EMYIN8.js} +1 -1
- package/dist/chunks/{settings-cli-D_YyLonX.js → settings-cli-Df_djhIH.js} +4 -4
- package/dist/chunks/{settings-readout-core-ic6qSZkn.js → settings-readout-core-Cg24xDa1.js} +1 -1
- package/dist/chunks/{ssh-sign-cli-CJmnbkMc.js → ssh-sign-cli-D1Inrd9W.js} +1 -1
- package/dist/client/assets/{alert-sound-XMuKGl2H.js → alert-sound-Dofgzpeu.js} +1 -1
- package/dist/client/assets/alert-sound-Dofgzpeu.js.br +0 -0
- package/dist/client/assets/{benchmark-panel-LfPmYYkk.js → benchmark-panel-CgAeYUJN.js} +1 -1
- package/dist/client/assets/benchmark-panel-CgAeYUJN.js.br +0 -0
- package/dist/client/assets/{celebration-player-WhpTd3PS.js → celebration-player-BlZC4XC5.js} +1 -1
- package/dist/client/assets/celebration-player-BlZC4XC5.js.br +0 -0
- package/dist/client/assets/{dialogs-B_eWmzM5.js → dialogs-BEpHqqcP.js} +1 -1
- package/dist/client/assets/dialogs-BEpHqqcP.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-DGu8qeKd.js → doc-editor-ui-BAEFf4cK.js} +1 -1
- package/dist/client/assets/doc-editor-ui-BAEFf4cK.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-Qhl46C6Z.js → first-run-checklist-Mhu6okS6.js} +1 -1
- package/dist/client/assets/first-run-checklist-Mhu6okS6.js.br +0 -0
- package/dist/client/assets/{hooks-panel-1iElfKBZ.js → hooks-panel-e5dKaVLB.js} +1 -1
- package/dist/client/assets/hooks-panel-e5dKaVLB.js.br +0 -0
- package/dist/client/assets/index-DJ9D2Q4r.js +78 -0
- package/dist/client/assets/index-DJ9D2Q4r.js.br +0 -0
- package/dist/client/assets/{index-BoKsOaKD.css → index-DseTTDys.css} +1 -1
- package/dist/client/assets/index-DseTTDys.css.br +0 -0
- package/dist/client/assets/{issues-panel-CLm_sqRo.js → issues-panel-Bz3UUbNq.js} +1 -1
- package/dist/client/assets/issues-panel-Bz3UUbNq.js.br +0 -0
- package/dist/client/assets/{nyan-cat-Zjn-ylJ-.js → nyan-cat-a1QjJkrg.js} +1 -1
- package/dist/client/assets/nyan-cat-a1QjJkrg.js.br +0 -0
- package/dist/client/assets/phone-shell-BfEZpxrZ.js +1 -0
- package/dist/client/assets/phone-shell-BfEZpxrZ.js.br +0 -0
- package/dist/client/assets/{plan-face-M_7deGq3.js → plan-face-BliRbv-w.js} +1 -1
- package/dist/client/assets/plan-face-BliRbv-w.js.br +0 -0
- package/dist/client/assets/{plan-render-CY-MQU5r.js → plan-render-DKgTnb81.js} +1 -1
- package/dist/client/assets/plan-render-DKgTnb81.js.br +0 -0
- package/dist/client/assets/{pr-scope-tabs-Bi61oEp_.js → pr-scope-tabs-DHJqZnbx.js} +1 -1
- package/dist/client/assets/pr-scope-tabs-DHJqZnbx.js.br +0 -0
- package/dist/client/assets/{radar-panel-DRQuRnCq.js → radar-panel-CGuYIYeF.js} +1 -1
- package/dist/client/assets/radar-panel-CGuYIYeF.js.br +0 -0
- package/dist/client/assets/{resume-dialog-CUjDwimu.js → resume-dialog-CH6MxGds.js} +1 -1
- package/dist/client/assets/resume-dialog-CH6MxGds.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-Cb-Gc14b.js → review-queue-panel-RuYKyRc5.js} +1 -1
- package/dist/client/assets/review-queue-panel-RuYKyRc5.js.br +0 -0
- package/dist/client/assets/{settings-panel-Cc0_VXht.js → settings-panel-DQEOzt_w.js} +2 -2
- package/dist/client/assets/settings-panel-DQEOzt_w.js.br +0 -0
- package/dist/client/assets/{shown-lightbox-JmJiSAfe.js → shown-lightbox-Cqc62J93.js} +1 -1
- package/dist/client/assets/shown-lightbox-Cqc62J93.js.br +0 -0
- package/dist/client/assets/{trace-panel-CvhNNm_m.js → trace-panel-BA9XdJYt.js} +1 -1
- package/dist/client/assets/trace-panel-BA9XdJYt.js.br +0 -0
- package/dist/client/assets/{usage-panel-Crw2G-P0.js → usage-panel-BYXguRsb.js} +1 -1
- package/dist/client/assets/usage-panel-BYXguRsb.js.br +0 -0
- package/dist/client/assets/{visions-panel-K4XQSlL2.js → visions-panel-eIbga0ep.js} +1 -1
- package/dist/client/assets/visions-panel-eIbga0ep.js.br +0 -0
- package/dist/client/index.html +2 -2
- 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-DZpnt33l.js +0 -1
- package/dist/client/assets/alert-sound-XMuKGl2H.js.br +0 -0
- package/dist/client/assets/benchmark-panel-LfPmYYkk.js.br +0 -0
- package/dist/client/assets/celebration-player-WhpTd3PS.js.br +0 -0
- package/dist/client/assets/dialogs-B_eWmzM5.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-DGu8qeKd.js.br +0 -0
- package/dist/client/assets/first-run-checklist-Qhl46C6Z.js.br +0 -0
- package/dist/client/assets/hooks-panel-1iElfKBZ.js.br +0 -0
- package/dist/client/assets/index-BZbBg0oU.js +0 -78
- package/dist/client/assets/index-BZbBg0oU.js.br +0 -0
- package/dist/client/assets/index-BoKsOaKD.css.br +0 -0
- package/dist/client/assets/issues-panel-CLm_sqRo.js.br +0 -0
- package/dist/client/assets/nyan-cat-Zjn-ylJ-.js.br +0 -0
- package/dist/client/assets/phone-shell-DmdZA0T5.js +0 -1
- package/dist/client/assets/phone-shell-DmdZA0T5.js.br +0 -0
- package/dist/client/assets/plan-face-M_7deGq3.js.br +0 -0
- package/dist/client/assets/plan-render-CY-MQU5r.js.br +0 -0
- package/dist/client/assets/pr-scope-tabs-Bi61oEp_.js.br +0 -0
- package/dist/client/assets/radar-panel-DRQuRnCq.js.br +0 -0
- package/dist/client/assets/resume-dialog-CUjDwimu.js.br +0 -0
- package/dist/client/assets/review-queue-panel-Cb-Gc14b.js.br +0 -0
- package/dist/client/assets/settings-panel-Cc0_VXht.js.br +0 -0
- package/dist/client/assets/shown-lightbox-JmJiSAfe.js.br +0 -0
- package/dist/client/assets/trace-panel-CvhNNm_m.js.br +0 -0
- package/dist/client/assets/usage-panel-Crw2G-P0.js.br +0 -0
- package/dist/client/assets/visions-panel-K4XQSlL2.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-B2Wieg0a.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-CKgp5EgK.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-WyrLHANY.js";
|
|
11
11
|
import { i as guardrailsDoctorRows, r as probeGuardrailsDependencies } from "../chunks/guardrails-deps-BjPzk1rE.js";
|
|
@@ -27,6 +27,7 @@ Commands:
|
|
|
27
27
|
pair --list List paired devices
|
|
28
28
|
pair --revoke <id> Revoke a paired device
|
|
29
29
|
agent setup grok Install the Grok hook relay, which does nothing outside Glimmervoid
|
|
30
|
+
agent setup kimi Add the Kimi Code hook relay block to its config.toml, inert outside Glimmervoid
|
|
30
31
|
|
|
31
32
|
Editor integration (Visions):
|
|
32
33
|
visions install Install the Visions extension into every VS Code family editor on PATH
|
|
@@ -65,15 +66,15 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
65
66
|
return 0;
|
|
66
67
|
}],
|
|
67
68
|
["pair", async (subcommandArgs) => {
|
|
68
|
-
const { runPairCli } = await import("../chunks/pair-cli-
|
|
69
|
+
const { runPairCli } = await import("../chunks/pair-cli-B5oHJtT_.js");
|
|
69
70
|
return runPairCli(subcommandArgs);
|
|
70
71
|
}],
|
|
71
72
|
["agent", async (subcommandArgs) => {
|
|
72
|
-
const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-
|
|
73
|
+
const { runAgentSetupCli } = await import("../chunks/agent-setup-cli-CCVsedku.js");
|
|
73
74
|
return runAgentSetupCli(subcommandArgs);
|
|
74
75
|
}],
|
|
75
76
|
["settings", async (subcommandArgs) => {
|
|
76
|
-
const { runSettingsCli } = await import("../chunks/settings-cli-
|
|
77
|
+
const { runSettingsCli } = await import("../chunks/settings-cli-Df_djhIH.js");
|
|
77
78
|
return runSettingsCli(subcommandArgs);
|
|
78
79
|
}],
|
|
79
80
|
["visions", async (subcommandArgs) => {
|
|
@@ -81,13 +82,13 @@ var OWN_SUBCOMMAND_RUNNERS = [
|
|
|
81
82
|
return runVisionsCli(subcommandArgs);
|
|
82
83
|
}],
|
|
83
84
|
["ssh-sign", async (subcommandArgs) => {
|
|
84
|
-
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-
|
|
85
|
+
const { runSshSignCli } = await import("../chunks/ssh-sign-cli-D1Inrd9W.js");
|
|
85
86
|
return runSshSignCli(subcommandArgs);
|
|
86
87
|
}]
|
|
87
88
|
];
|
|
88
89
|
var ownSubcommandNames = new Set(OWN_SUBCOMMAND_RUNNERS.map(([name]) => name));
|
|
89
90
|
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-
|
|
91
|
+
const { runAgentApiCli } = await import("../chunks/agent-api-cli-BSDYHgZR.js");
|
|
91
92
|
return runAgentApiCli([subcommandName, ...subcommandArgs]);
|
|
92
93
|
}])]);
|
|
93
94
|
var AGENT_INSTALL_COMMAND_BY_ID = {
|
|
@@ -101,7 +102,7 @@ function missingAgentText(agentId) {
|
|
|
101
102
|
}
|
|
102
103
|
async function printSessionLimits() {
|
|
103
104
|
if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
|
|
104
|
-
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-
|
|
105
|
+
const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-BSDYHgZR.js");
|
|
105
106
|
const limitsLines = await sessionLimitsHelpLines();
|
|
106
107
|
console.log(`\n${limitsLines.join("\n")}`);
|
|
107
108
|
}
|
|
@@ -158,7 +159,7 @@ async function readDeclaredCustomAgents() {
|
|
|
158
159
|
declared: [],
|
|
159
160
|
error: null
|
|
160
161
|
};
|
|
161
|
-
const { loadConfigFile } = await import("../chunks/config-store-
|
|
162
|
+
const { loadConfigFile } = await import("../chunks/config-store-BtazOb6G.js");
|
|
162
163
|
try {
|
|
163
164
|
const loaded = loadConfigFile(decided.path, { exitOnError: false });
|
|
164
165
|
if (!loaded.config) return {
|
|
@@ -234,7 +235,7 @@ async function runDoctor() {
|
|
|
234
235
|
}
|
|
235
236
|
switchSection("Agents");
|
|
236
237
|
try {
|
|
237
|
-
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-
|
|
238
|
+
const { listAgentIds, describeAgentResolvability, setCustomAgents } = await import("../chunks/adapters-XOu0l469.js");
|
|
238
239
|
const declaredCustomAgents = await readDeclaredCustomAgents();
|
|
239
240
|
if (declaredCustomAgents.error) line("config", declaredCustomAgents.error);
|
|
240
241
|
setCustomAgents(declaredCustomAgents.declared);
|
|
@@ -242,9 +243,11 @@ async function runDoctor() {
|
|
|
242
243
|
const { label, path: resolvedPath } = describeAgentResolvability(id);
|
|
243
244
|
line(`${id} (${label})`, resolvedPath ?? missingAgentText(id));
|
|
244
245
|
}
|
|
245
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
246
|
+
const { inspectGrokAgentSetup, inspectKimiAgentSetup } = await import("../chunks/agent-setup-cli-CCVsedku.js");
|
|
246
247
|
const grokSetup = inspectGrokAgentSetup();
|
|
247
248
|
line("grok hook setup", `${grokSetup.classification}: ${grokSetup.filePath}`);
|
|
249
|
+
const kimiSetup = inspectKimiAgentSetup();
|
|
250
|
+
line("kimi hook setup", `${kimiSetup.classification}: ${kimiSetup.filePath}`);
|
|
248
251
|
} catch (err) {
|
|
249
252
|
line("agents", `probe failed: ${firstLine(errorText(err))}`);
|
|
250
253
|
}
|
|
@@ -259,7 +262,7 @@ async function runDoctor() {
|
|
|
259
262
|
try {
|
|
260
263
|
const { resolvePackageBin } = await import("../chunks/runtime-paths-Cc0_ZR6V.js");
|
|
261
264
|
const { execFileSync } = await import("../chunks/child-process-safe-CjVtRjDD.js");
|
|
262
|
-
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-
|
|
265
|
+
const { inspectGrokAgentSetup } = await import("../chunks/agent-setup-cli-CCVsedku.js");
|
|
263
266
|
const binPath = resolvePackageBin("cc-safety-net", "cc-safety-net");
|
|
264
267
|
line("Sane YOLO", binPath || "not installed");
|
|
265
268
|
if (binPath) line("cc-safety-net version", execFileSync(process.execPath, [binPath, "--version"], {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { s as relayPath } from "./runtime-paths-ghcH9CeW.js";
|
|
2
2
|
import { Lt as FULL_SHA_RE, zt as shortSha$1 } from "./session-B2Wieg0a.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-BOQu9rsc.js";
|
|
5
5
|
import { o as supervisionLine } from "./session-routes-Cr9S--Nf.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
|
-
import {
|
|
9
|
+
import { a as classifyAgentTitle, i as grok, o as isBrailleChar, s as isSpinnerChar, t as kimi, u as buildAgentEnv } from "./kimi-Su5nIzXw.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-Cfr6JMdE.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";
|
|
@@ -1012,7 +1012,8 @@ var DEFAULT_AGENT_ID = claudeCode.id;
|
|
|
1012
1012
|
var adapterEntries = [
|
|
1013
1013
|
[claudeCode.id, claudeCode],
|
|
1014
1014
|
[codex.id, codex],
|
|
1015
|
-
[grok.id, grok]
|
|
1015
|
+
[grok.id, grok],
|
|
1016
|
+
[kimi.id, kimi]
|
|
1016
1017
|
];
|
|
1017
1018
|
var ADAPTERS = new Map(adapterEntries);
|
|
1018
1019
|
var customAdapters = /* @__PURE__ */ new Map();
|
|
@@ -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-BGwt5loj.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-MZ90f4jg.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-B2Wieg0a.js";
|
|
3
3
|
import { i as formatSessionLimits } from "./session-routes-Cr9S--Nf.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-CKgp5EgK.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 { I as TASK_TITLE_CONTROL_CHARACTERS, 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, x as RefinedTaskTitle } from "./session-B2Wieg0a.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-BOQu9rsc.js";
|
|
3
3
|
import { n as NO_OWN_WORKTREE_REASON, t as COMMAND_ROUTES } from "./session-routes-Cr9S--Nf.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import crypto from "node:crypto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
-
import {
|
|
2
|
+
import { c as classifyGrokHooksFile, i as grok, l as renderGrokHooksFile, n as classifyKimiConfig, r as spliceKimiHooksBlock, t as kimi } from "./kimi-Su5nIzXw.js";
|
|
3
3
|
import { p as writeTextAtomicSync } from "./json-file-BjFK_eSH.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";
|
|
7
|
+
var USAGE = "Usage: glimmervoid agent setup <grok|kimi>";
|
|
8
8
|
function setupInputs(env = process.env) {
|
|
9
9
|
return {
|
|
10
10
|
filePath: grok.hooksFilePath(env),
|
|
@@ -38,8 +38,8 @@ function inspectGrokAgentSetup({ env = process.env, readFileSync = fs.readFileSy
|
|
|
38
38
|
}
|
|
39
39
|
function assertRealDirectory(directory, fileSystem, requireOwnership = true) {
|
|
40
40
|
const directoryStat = fileSystem.lstatSync(directory);
|
|
41
|
-
if (!directoryStat.isDirectory() || directoryStat.isSymbolicLink()) throw new Error(`refusing to write
|
|
42
|
-
if (requireOwnership && typeof process.getuid === "function" && directoryStat.uid !== process.getuid()) throw new Error(`refusing to write
|
|
41
|
+
if (!directoryStat.isDirectory() || directoryStat.isSymbolicLink()) throw new Error(`refusing to write agent hooks: ${directory} is not a real directory`);
|
|
42
|
+
if (requireOwnership && typeof process.getuid === "function" && directoryStat.uid !== process.getuid()) throw new Error(`refusing to write agent hooks: ${directory} is owned by another account`);
|
|
43
43
|
}
|
|
44
44
|
function ensureWritableHooksDirectory(directory, fileSystem) {
|
|
45
45
|
const resolvedDirectory = path.resolve(directory);
|
|
@@ -70,6 +70,19 @@ function replaceFileAtomically(filePath, contents, fileSystem) {
|
|
|
70
70
|
fsSync: fileSystem
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
function writeAgentHooksFile(filePath, contents, fileSystem) {
|
|
74
|
+
try {
|
|
75
|
+
ensureWritableHooksDirectory(path.dirname(filePath), fileSystem);
|
|
76
|
+
if (fileSystem.existsSync(filePath)) {
|
|
77
|
+
const targetStat = fileSystem.lstatSync(filePath);
|
|
78
|
+
if (!targetStat.isFile() || targetStat.isSymbolicLink()) return `Refusing to replace ${filePath}: the target is not a real file.`;
|
|
79
|
+
}
|
|
80
|
+
replaceFileAtomically(filePath, contents, fileSystem);
|
|
81
|
+
} catch (writeError) {
|
|
82
|
+
return `Could not write ${filePath}: ${errorMessage(writeError)}`;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
73
86
|
function runGrokSetup({ env, fileSystem, log, error }) {
|
|
74
87
|
const inputs = setupInputs(env);
|
|
75
88
|
const expectedContents = renderGrokHooksFile(inputs);
|
|
@@ -89,24 +102,73 @@ function runGrokSetup({ env, fileSystem, log, error }) {
|
|
|
89
102
|
error(`Refusing to replace ${inputs.filePath}: the existing file is ${inspection.classification}.`);
|
|
90
103
|
return 1;
|
|
91
104
|
}
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (fileSystem.existsSync(inputs.filePath)) {
|
|
96
|
-
const targetStat = fileSystem.lstatSync(inputs.filePath);
|
|
97
|
-
if (!targetStat.isFile() || targetStat.isSymbolicLink()) {
|
|
98
|
-
error(`Refusing to replace ${inputs.filePath}: the target is not a real file.`);
|
|
99
|
-
return 1;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
replaceFileAtomically(inputs.filePath, expectedContents, fileSystem);
|
|
103
|
-
} catch (writeError) {
|
|
104
|
-
error(`Could not write ${inputs.filePath}: ${errorMessage(writeError)}`);
|
|
105
|
+
const writeFailure = writeAgentHooksFile(inputs.filePath, expectedContents, fileSystem);
|
|
106
|
+
if (writeFailure) {
|
|
107
|
+
error(writeFailure);
|
|
105
108
|
return 1;
|
|
106
109
|
}
|
|
107
110
|
log(`Installed Grok hooks at ${inputs.filePath}`);
|
|
108
111
|
return 0;
|
|
109
112
|
}
|
|
113
|
+
var KIMI_REFUSAL_MESSAGES = {
|
|
114
|
+
foreign: (filePath) => `Refusing to edit ${filePath}: its glimmervoid hooks block was edited by hand. Delete the block between the glimmervoid markers and run setup again.`,
|
|
115
|
+
conflicting: (filePath) => `Refusing to edit ${filePath}: it defines hooks as a key or [hooks] table, which a [[hooks]] block would break. Rewrite those hooks as [[hooks]] tables and run setup again.`
|
|
116
|
+
};
|
|
117
|
+
function readKimiConfig(filePath, readFileSync) {
|
|
118
|
+
try {
|
|
119
|
+
return { contents: readFileSync(filePath, "utf8") };
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if (isMissingFileError(error, { includeNotDir: false })) return { contents: null };
|
|
122
|
+
return { reason: errorMessage(error) };
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function inspectKimiAgentSetup({ env = process.env, readFileSync = fs.readFileSync } = {}) {
|
|
126
|
+
const filePath = kimi.configFilePath(env);
|
|
127
|
+
const expectedBlock = kimi.expectedHooksBlock();
|
|
128
|
+
if (expectedBlock === null) return {
|
|
129
|
+
filePath,
|
|
130
|
+
classification: "unrenderable"
|
|
131
|
+
};
|
|
132
|
+
const config = readKimiConfig(filePath, readFileSync);
|
|
133
|
+
if ("reason" in config) return {
|
|
134
|
+
filePath,
|
|
135
|
+
classification: "unreadable",
|
|
136
|
+
reason: config.reason
|
|
137
|
+
};
|
|
138
|
+
return {
|
|
139
|
+
filePath,
|
|
140
|
+
classification: classifyKimiConfig(config.contents, expectedBlock)
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function runKimiSetup({ env, fileSystem, log, error }) {
|
|
144
|
+
const filePath = kimi.configFilePath(env);
|
|
145
|
+
const expectedBlock = kimi.expectedHooksBlock();
|
|
146
|
+
if (expectedBlock === null) {
|
|
147
|
+
error("Could not render the Kimi Code hooks block. Nothing was written.");
|
|
148
|
+
return 1;
|
|
149
|
+
}
|
|
150
|
+
const config = readKimiConfig(filePath, fileSystem.readFileSync);
|
|
151
|
+
if ("reason" in config) {
|
|
152
|
+
error(`Refusing to edit ${filePath}: the existing file is unreadable (${config.reason}).`);
|
|
153
|
+
return 1;
|
|
154
|
+
}
|
|
155
|
+
const splice = spliceKimiHooksBlock(config.contents, expectedBlock);
|
|
156
|
+
if ("refused" in splice) {
|
|
157
|
+
error(KIMI_REFUSAL_MESSAGES[splice.refused](filePath));
|
|
158
|
+
return 1;
|
|
159
|
+
}
|
|
160
|
+
if (!splice.changed) {
|
|
161
|
+
log(`Kimi Code hooks are already current in ${filePath}`);
|
|
162
|
+
return 0;
|
|
163
|
+
}
|
|
164
|
+
const writeFailure = writeAgentHooksFile(filePath, splice.contents, fileSystem);
|
|
165
|
+
if (writeFailure) {
|
|
166
|
+
error(writeFailure);
|
|
167
|
+
return 1;
|
|
168
|
+
}
|
|
169
|
+
log(`Installed Kimi Code hooks in ${filePath}`);
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
110
172
|
function runAgentSetupCli(args, deps = {}) {
|
|
111
173
|
const { env = process.env, fileSystem = fs, log = console.log, error = console.error } = deps;
|
|
112
174
|
if (args[0] === "setup" && args[1] === "grok" && args.length === 2) return runGrokSetup({
|
|
@@ -115,8 +177,14 @@ function runAgentSetupCli(args, deps = {}) {
|
|
|
115
177
|
log,
|
|
116
178
|
error
|
|
117
179
|
});
|
|
180
|
+
if (args[0] === "setup" && args[1] === "kimi" && args.length === 2) return runKimiSetup({
|
|
181
|
+
env,
|
|
182
|
+
fileSystem,
|
|
183
|
+
log,
|
|
184
|
+
error
|
|
185
|
+
});
|
|
118
186
|
error(USAGE);
|
|
119
187
|
return 1;
|
|
120
188
|
}
|
|
121
189
|
//#endregion
|
|
122
|
-
export { inspectGrokAgentSetup, runAgentSetupCli };
|
|
190
|
+
export { inspectGrokAgentSetup, inspectKimiAgentSetup, runAgentSetupCli };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./session-B2Wieg0a.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-BOQu9rsc.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"]);
|
|
@@ -2589,7 +2589,8 @@ var AGENT_ID_RE = /^[a-z][a-z0-9-]{1,31}$/;
|
|
|
2589
2589
|
var BUILTIN_AGENT_IDS = Object.freeze([
|
|
2590
2590
|
"claude-code",
|
|
2591
2591
|
"codex",
|
|
2592
|
-
"grok"
|
|
2592
|
+
"grok",
|
|
2593
|
+
"kimi"
|
|
2593
2594
|
]);
|
|
2594
2595
|
var AGENT_ID_SHAPE_MESSAGE = "an agent id of 2 to 32 characters of lowercase letters, digits and dashes, starting with a letter";
|
|
2595
2596
|
var AGENT_COMMAND_BASENAME_RE = /^[A-Za-z0-9._+-]+$/;
|
|
@@ -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-BOQu9rsc.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 FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-
|
|
9
|
+
import { f as FeatureFlagsResponse, g as TELEMETRY_KILL_SWITCH_FLAG, n as isExperimentalBuild, p as MAX_TEXT_LENGTH } from "./build-channel-Cfr6JMdE.js";
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import os from "node:os";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c as loadConfigFile } from "./config-store-BhiA04q3.js";
|