glimmervoid 0.29.1 → 0.30.0

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 (41) hide show
  1. package/README.md +7 -9
  2. package/dist/bin/glimmervoid.js +28 -12
  3. package/dist/chunks/{adapters-DIavI9-i.js → adapters-Dho1VSY5.js} +1 -1
  4. package/dist/chunks/{adapters-Dlvu1FVB.js → adapters-zPDx1Xox.js} +23 -14
  5. package/dist/chunks/{agent-api-cli-ClOzm28U.js → agent-api-cli-D0MmtEdz.js} +2 -2
  6. package/dist/chunks/{agent-api-core-D6LHrpSL.js → agent-api-core-Dz0r21y9.js} +1 -1
  7. package/dist/chunks/{agent-setup-cli-C1CQ8Nkk.js → agent-setup-cli-B5Atxr3F.js} +5 -3
  8. package/dist/chunks/{child-process-safe-Cz22RwlG.js → child-process-safe-DRGsp0TE.js} +1 -1
  9. package/dist/chunks/child-process-safe-DvQjXsgz.js +2 -0
  10. package/dist/chunks/config-store-CC8T3okC.js +2 -0
  11. package/dist/chunks/{config-store-DtPUFVaO.js → config-store-mm7MgzoL.js} +13 -1
  12. package/dist/chunks/{contracts-JKChPhZ0.js → contracts-DGkKNh9W.js} +25 -3
  13. package/dist/chunks/{grok-COekzawt.js → grok-DuU8xVLZ.js} +54 -25
  14. package/dist/chunks/hook-command-core-DclEoE9e.js +14 -0
  15. package/dist/chunks/hook-tools-pSJia7ks.js +74 -0
  16. package/dist/chunks/{main-BVDjy7vH.js → main-CuIZQPhZ.js} +975 -156
  17. package/dist/chunks/{pair-cli-BQQnhkkc.js → pair-cli-w-gCAF-1.js} +2 -2
  18. package/dist/chunks/{remote-config-BHoDFCpo.js → remote-config-C2ytQwrs.js} +8 -4
  19. package/dist/chunks/rtk-hook-core-Bl6gYHPN.js +133 -0
  20. package/dist/chunks/rtk-resolver-CLo-gZzw.js +21 -0
  21. package/dist/chunks/rtk-resolver-CMQAidlI.js +2 -0
  22. package/dist/chunks/{runtime-paths-CVvq20A4.js → runtime-paths-Ci_ksSkj.js} +26 -2
  23. package/dist/chunks/runtime-paths-JLrZ3wyi.js +2 -0
  24. package/dist/chunks/{sandbox-deps-BwvbDBDl.js → sandbox-deps-Dd5-kZnf.js} +1 -1
  25. package/dist/chunks/{session-CJtOveHl.js → session-Cez8aIWg.js} +3 -1
  26. package/dist/chunks/{visions-cli-DUZnopGY.js → visions-cli-BXQFIBCX.js} +1 -1
  27. package/dist/chunks/{visions-setup-C_kJobsy.js → visions-setup-CvVnOe1r.js} +2 -2
  28. package/dist/client/assets/index-B1MFijjb.css +1 -0
  29. package/dist/client/assets/index-CU1iPPdn.js +249 -0
  30. package/dist/client/index.html +2 -2
  31. package/dist/scripts/postinstall-path-check.js +1 -1
  32. package/dist/server/index.js +2 -2
  33. package/dist/session/{rtk-relay.js → hook-tool-relay.js} +32 -15
  34. package/dist/session/statusline-relay.js +1 -1
  35. package/package.json +2 -1
  36. package/dist/chunks/config-store-DtUGwi4-.js +0 -2
  37. package/dist/chunks/rtk-hook-core-DRYrKwYP.js +0 -26
  38. package/dist/chunks/rtk-resolver-DDVVNRBT.js +0 -2
  39. package/dist/chunks/rtk-resolver-oGmO-ew7.js +0 -58
  40. package/dist/client/assets/index-BTwYgSAH.js +0 -248
  41. package/dist/client/assets/index-DgA708PE.css +0 -1
@@ -0,0 +1,14 @@
1
+ //#region session/core/hook-command-core.ts
2
+ var SAFE_PATH_RE = /^[A-Za-z0-9_.:/\\ -]+$/;
3
+ var SAFE_EVENT_RE = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
4
+ function buildHookCommand(relayPath, event, argvTail = []) {
5
+ const rawPath = String(relayPath);
6
+ const rawEvent = String(event);
7
+ if (!SAFE_PATH_RE.test(rawPath)) return null;
8
+ if (!SAFE_EVENT_RE.test(rawEvent)) return null;
9
+ if (argvTail.some((argument) => !/^[A-Za-z0-9_-]+$/.test(argument))) return null;
10
+ const forwardSlashedPath = rawPath.replace(/\\/g, "/");
11
+ return `node ${/\s/.test(forwardSlashedPath) ? `"${forwardSlashedPath}"` : forwardSlashedPath} ${rawEvent}${argvTail.length ? ` ${argvTail.join(" ")}` : ""}`;
12
+ }
13
+ //#endregion
14
+ export { buildHookCommand as t };
@@ -0,0 +1,74 @@
1
+ import { r as resolvePathCommandMatches } from "./spawn-command-Cc40FiZI.js";
2
+ import { a as SANE_YOLO_PATH_ENV, n as RTK_PATH_ENV, o as saneYoloEnv } from "./rtk-hook-core-Bl6gYHPN.js";
3
+ import { t as buildHookCommand } from "./hook-command-core-DclEoE9e.js";
4
+ import path from "node:path";
5
+ //#region session/core/hook-tools.ts
6
+ function firstExistingFile(candidates, fsApi) {
7
+ for (const candidate of candidates) try {
8
+ if (fsApi.statSync(candidate).isFile()) return path.resolve(candidate);
9
+ } catch {}
10
+ return null;
11
+ }
12
+ function resolveRtkPath({ glimmervoidHome, platform, exec, fsApi }) {
13
+ const bundled = firstExistingFile([path.join(glimmervoidHome, "bin", "rtk.exe"), path.join(glimmervoidHome, "bin", "rtk")], fsApi);
14
+ if (bundled) return bundled;
15
+ const matches = resolvePathCommandMatches("rtk", {
16
+ platform,
17
+ exec
18
+ });
19
+ if (matches.length === 0) return null;
20
+ const firstMatch = matches[0];
21
+ if (!firstMatch) return null;
22
+ return path.resolve(firstMatch);
23
+ }
24
+ function quoteCommandPath(commandPath) {
25
+ if (!/\s/.test(commandPath)) return commandPath;
26
+ return `"${commandPath}"`;
27
+ }
28
+ function toForwardSlashes(commandPath) {
29
+ return commandPath.replace(/\\/g, "/");
30
+ }
31
+ function buildRtkHookEntry(rtkPath) {
32
+ return {
33
+ matcher: "Bash",
34
+ hooks: [{
35
+ type: "command",
36
+ command: `${quoteCommandPath(toForwardSlashes(rtkPath))} hook claude`
37
+ }]
38
+ };
39
+ }
40
+ function codexGroup(command) {
41
+ if (!command) return null;
42
+ return `{matcher='Bash',hooks=[{type='command',command='${command}'}]}`;
43
+ }
44
+ var HOOK_TOOLS = {
45
+ rtk: {
46
+ capability: "rtk",
47
+ purpose: "rtk command rewriting",
48
+ env: (tool) => ({ [RTK_PATH_ENV]: tool.binPath }),
49
+ claudeEntry: (tool) => buildRtkHookEntry(tool.binPath),
50
+ codexGroup: (_tool, relayPath) => codexGroup(buildHookCommand(relayPath, "rtk"))
51
+ },
52
+ saneYolo: {
53
+ capability: "saneYolo",
54
+ purpose: "Sane YOLO catastrophic command protection",
55
+ env: (tool, homeDir) => ({
56
+ [SANE_YOLO_PATH_ENV]: tool.binPath,
57
+ ...saneYoloEnv(homeDir)
58
+ }),
59
+ claudeEntry: (tool) => ({
60
+ matcher: "Bash|PowerShell|Monitor",
61
+ hooks: [{
62
+ type: "command",
63
+ command: `node "${toForwardSlashes(tool.binPath)}" hook --coding-cli`
64
+ }]
65
+ }),
66
+ codexGroup: (tool) => codexGroup(buildHookCommand(tool.binPath, "hook", ["--codex"]))
67
+ }
68
+ };
69
+ function mergeCodexPreToolUse(groups) {
70
+ if (groups.length === 0) return [];
71
+ return ["-c", `hooks.PreToolUse=[${groups.join(",")}]`];
72
+ }
73
+ //#endregion
74
+ export { mergeCodexPreToolUse as n, resolveRtkPath as r, HOOK_TOOLS as t };