glimmervoid 0.29.1 → 0.31.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 (67) hide show
  1. package/README.md +8 -10
  2. package/dist/bin/glimmervoid.js +152 -53
  3. package/dist/chunks/{adapters-DIavI9-i.js → adapters-ClA_GbtA.js} +1 -1
  4. package/dist/chunks/{adapters-Dlvu1FVB.js → adapters-gn7ulNO4.js} +49 -20
  5. package/dist/chunks/agent-api-cli-DAA7Jx8N.js +135 -0
  6. package/dist/chunks/{agent-api-core-D6LHrpSL.js → agent-api-core-hVcT26JW.js} +10 -1
  7. package/dist/chunks/{agent-setup-cli-C1CQ8Nkk.js → agent-setup-cli-CiJSDWSo.js} +15 -30
  8. package/dist/chunks/backoff-DjVpfHk7.js +14 -0
  9. package/dist/chunks/child-process-safe-BKPZ-5qQ.js +2 -0
  10. package/dist/chunks/{child-process-safe-Cz22RwlG.js → child-process-safe-Ch-Zgxqs.js} +2 -2
  11. package/dist/chunks/coerce-NSst8oRP.js +32 -0
  12. package/dist/chunks/{contracts-JKChPhZ0.js → config-W1Sv-iPK.js} +380 -1682
  13. package/dist/chunks/{config-store-DtPUFVaO.js → config-store-BCy4FHNG.js} +595 -327
  14. package/dist/chunks/config-store-DbBp7LJZ.js +2 -0
  15. package/dist/chunks/contracts-3LkrilQX.js +2078 -0
  16. package/dist/chunks/{grok-COekzawt.js → grok-CXKeSt2z.js} +69 -36
  17. package/dist/chunks/hook-command-core-DclEoE9e.js +14 -0
  18. package/dist/chunks/{hook-relay-core-BHfYFnYV.js → hook-relay-core-DA_bz2KA.js} +10 -5
  19. package/dist/chunks/hook-tools-UX2fmt81.js +72 -0
  20. package/dist/chunks/{ingest-editor-core-BuI1gMF_.js → ingest-editor-core-vR6Wv6bP.js} +24 -13
  21. package/dist/chunks/json-core-dfa_7Fak.js +23 -0
  22. package/dist/chunks/json-file-oEH9vt-0.js +352 -0
  23. package/dist/chunks/knowledge-graph-cli-D2tt5hPn.js +1354 -0
  24. package/dist/chunks/{loopback-post-C7C22eYi.js → loopback-post-DepQfdcM.js} +40 -26
  25. package/dist/chunks/{main-BVDjy7vH.js → main-DyTCWIu2.js} +28881 -20693
  26. package/dist/chunks/{node-pty-preflight-CK1knGIR.js → node-pty-preflight-C8QIlrtU.js} +4 -6
  27. package/dist/chunks/{pair-cli-BQQnhkkc.js → pair-cli-BbCBfd6l.js} +4 -3
  28. package/dist/chunks/paths-CeJl2Vcg.js +55 -0
  29. package/dist/chunks/{remote-config-BHoDFCpo.js → remote-config-DKIH_VxM.js} +43 -43
  30. package/dist/chunks/rtk-hook-core-BmEz2aq9.js +131 -0
  31. package/dist/chunks/rtk-resolver-BGDzw5XK.js +21 -0
  32. package/dist/chunks/rtk-resolver-D4Nke1Fr.js +2 -0
  33. package/dist/chunks/{runtime-paths-CVvq20A4.js → runtime-paths-BPoxENmK.js} +28 -8
  34. package/dist/chunks/runtime-paths-DU5jBEEO.js +2 -0
  35. package/dist/chunks/{sandbox-deps-BwvbDBDl.js → sandbox-deps-BPKE-ylr.js} +16 -13
  36. package/dist/chunks/sandbox-proxy-core-hnQgKR0T.js +27 -0
  37. package/dist/chunks/{session-CJtOveHl.js → session-fc4pFbon.js} +10 -2
  38. package/dist/chunks/text-DoirglWV.js +21 -0
  39. package/dist/chunks/timer-deps-u2DAQLok.js +15 -0
  40. package/dist/chunks/{visions-cli-DUZnopGY.js → visions-cli-CT5rjiwf.js} +1 -1
  41. package/dist/chunks/{visions-setup-C_kJobsy.js → visions-setup-BmOkI-QE.js} +20 -357
  42. package/dist/client/assets/index-C6KD8lgZ.css +1 -0
  43. package/dist/client/assets/index-CThQEAEy.js +249 -0
  44. package/dist/client/fonts/CommitMono-OFL.txt +92 -0
  45. package/dist/client/fonts/commit-mono-400-italic.woff2 +0 -0
  46. package/dist/client/fonts/commit-mono-400-regular.woff2 +0 -0
  47. package/dist/client/fonts/commit-mono-700-italic.woff2 +0 -0
  48. package/dist/client/fonts/commit-mono-700-regular.woff2 +0 -0
  49. package/dist/client/index.html +7 -24
  50. package/dist/client/octicons-LICENSE.txt +21 -0
  51. package/dist/scripts/postinstall-path-check.js +1 -1
  52. package/dist/server/index.js +3 -3
  53. package/dist/session/command-hook-relay.js +1 -1
  54. package/dist/session/hook-relay.js +3 -3
  55. package/dist/session/{rtk-relay.js → hook-tool-relay.js} +32 -15
  56. package/dist/session/sandbox-open-launcher.js +79 -0
  57. package/dist/session/statusline-relay.js +8 -18
  58. package/dist/session/visions-relay.js +20 -11
  59. package/package.json +5 -1
  60. package/dist/chunks/agent-api-cli-ClOzm28U.js +0 -71
  61. package/dist/chunks/config-store-DtUGwi4-.js +0 -2
  62. package/dist/chunks/ingest-core-DWI1Mbu4.js +0 -342
  63. package/dist/chunks/rtk-hook-core-DRYrKwYP.js +0 -26
  64. package/dist/chunks/rtk-resolver-DDVVNRBT.js +0 -2
  65. package/dist/chunks/rtk-resolver-oGmO-ew7.js +0 -58
  66. package/dist/client/assets/index-BTwYgSAH.js +0 -248
  67. package/dist/client/assets/index-DgA708PE.css +0 -1
@@ -1,20 +1,15 @@
1
- import { a as classifyGrokHooksFile, o as renderGrokHooksFile, t as grok } from "./grok-COekzawt.js";
1
+ import { a as isMissingFileError, r as errorMessage } from "./text-DoirglWV.js";
2
+ import { a as classifyGrokHooksFile, o as renderGrokHooksFile, t as grok } from "./grok-CXKeSt2z.js";
3
+ import { p as writeTextAtomicSync } from "./json-file-oEH9vt-0.js";
2
4
  import fs from "node:fs";
3
5
  import path from "node:path";
4
- import crypto from "node:crypto";
5
6
  //#region server/agent-setup-cli.ts
6
7
  var USAGE = "Usage: glimmervoid agent setup grok";
7
- function errorCode(error) {
8
- const code = error?.code;
9
- return typeof code === "string" ? code : void 0;
10
- }
11
- function errorMessage(error) {
12
- return error instanceof Error ? error.message : String(error);
13
- }
14
8
  function setupInputs(env = process.env) {
15
9
  return {
16
10
  filePath: grok.hooksFilePath(env),
17
11
  relayPath: grok.RELAY_PATH,
12
+ hookToolRelayPath: grok.HOOK_TOOL_RELAY_PATH,
18
13
  events: grok.HOOK_EVENTS,
19
14
  managedEventSets: grok.MANAGED_HOOK_EVENT_SETS
20
15
  };
@@ -25,7 +20,7 @@ function inspectGrokAgentSetup({ env = process.env, readFileSync = fs.readFileSy
25
20
  try {
26
21
  contents = readFileSync(inputs.filePath, "utf8");
27
22
  } catch (error) {
28
- if (errorCode(error) === "ENOENT") return {
23
+ if (isMissingFileError(error, { includeNotDir: false })) return {
29
24
  filePath: inputs.filePath,
30
25
  classification: "absent"
31
26
  };
@@ -37,7 +32,8 @@ function inspectGrokAgentSetup({ env = process.env, readFileSync = fs.readFileSy
37
32
  }
38
33
  return {
39
34
  filePath: inputs.filePath,
40
- classification: classifyGrokHooksFile(contents, inputs)
35
+ classification: classifyGrokHooksFile(contents, inputs),
36
+ saneYoloReady: contents === renderGrokHooksFile(inputs)
41
37
  };
42
38
  }
43
39
  function assertRealDirectory(directory, fileSystem, requireOwnership = true) {
@@ -57,7 +53,7 @@ function ensureWritableHooksDirectory(directory, fileSystem) {
57
53
  assertRealDirectory(currentDirectory, fileSystem);
58
54
  continue;
59
55
  } catch (directoryError) {
60
- if (errorCode(directoryError) !== "ENOENT") throw directoryError;
56
+ if (!isMissingFileError(directoryError, { includeNotDir: false })) throw directoryError;
61
57
  }
62
58
  fileSystem.mkdirSync(currentDirectory, { mode: 448 });
63
59
  assertRealDirectory(currentDirectory, fileSystem);
@@ -67,23 +63,12 @@ function ensureWritableHooksDirectory(directory, fileSystem) {
67
63
  } catch {}
68
64
  }
69
65
  function replaceFileAtomically(filePath, contents, fileSystem) {
70
- const temporaryPath = `${filePath}.${process.pid}.${crypto.randomBytes(8).toString("hex")}.tmp`;
71
- try {
72
- fileSystem.writeFileSync(temporaryPath, contents, {
73
- encoding: "utf8",
74
- mode: 384,
75
- flag: "wx"
76
- });
77
- fileSystem.renameSync(temporaryPath, filePath);
78
- } catch (writeError) {
79
- try {
80
- fileSystem.rmSync(temporaryPath, { force: true });
81
- } catch {}
82
- throw writeError;
83
- }
84
- try {
85
- fileSystem.chmodSync(filePath, 384);
86
- } catch {}
66
+ writeTextAtomicSync(filePath, contents, {
67
+ mode: 384,
68
+ exclusive: true,
69
+ enforceMode: true,
70
+ fsSync: fileSystem
71
+ });
87
72
  }
88
73
  function runGrokSetup({ env, fileSystem, log, error }) {
89
74
  const inputs = setupInputs(env);
@@ -96,7 +81,7 @@ function runGrokSetup({ env, fileSystem, log, error }) {
96
81
  env,
97
82
  readFileSync: fileSystem.readFileSync
98
83
  });
99
- if (inspection.classification === "current") {
84
+ if (inspection.classification === "current" && inspection.saneYoloReady) {
100
85
  log(`Grok hooks are already current at ${inputs.filePath}`);
101
86
  return 0;
102
87
  }
@@ -0,0 +1,14 @@
1
+ //#region shared/backoff.ts
2
+ var DEFAULT_BASE_MS = 6e4;
3
+ var DEFAULT_MAX_MS = 18e5;
4
+ var MAX_DOUBLING_ATTEMPT = 20;
5
+ function nextBackoffMs({ attempt = 1, baseMs = DEFAULT_BASE_MS, maxMs = DEFAULT_MAX_MS, retryAfterMs = null, random = Math.random, jitter = "full" } = {}) {
6
+ if (typeof retryAfterMs === "number" && Number.isFinite(retryAfterMs) && retryAfterMs > 0) return Math.min(retryAfterMs, maxMs);
7
+ const exponent = Math.max(0, Math.min(attempt, MAX_DOUBLING_ATTEMPT) - 1);
8
+ const ceiling = Math.min(maxMs, baseMs * 2 ** exponent);
9
+ if (jitter === "none") return ceiling;
10
+ if (jitter === "half") return Math.round(ceiling * (.5 + .5 * random()));
11
+ return Math.round(random() * ceiling);
12
+ }
13
+ //#endregion
14
+ export { DEFAULT_MAX_MS as n, nextBackoffMs as r, DEFAULT_BASE_MS as t };
@@ -0,0 +1,2 @@
1
+ import { r as execFileSync } from "./child-process-safe-Ch-Zgxqs.js";
2
+ export { execFileSync };
@@ -1,5 +1,5 @@
1
- import cp from "node:child_process";
2
1
  import { promisify } from "node:util";
2
+ import cp from "node:child_process";
3
3
  //#region server/child-process-safe.ts
4
4
  function hide(options) {
5
5
  if (!options || typeof options !== "object") return { windowsHide: true };
@@ -66,4 +66,4 @@ function spawn(file, ...rest) {
66
66
  }
67
67
  var execFileAsync = promisify(execFile);
68
68
  //#endregion
69
- export { spawn as a, execSync as i, execFileAsync as n, execFileSync as r, execFile as t };
69
+ export { hide as a, execSync as i, execFileAsync as n, spawn as o, execFileSync as r, execFile as t };
@@ -0,0 +1,32 @@
1
+ //#region shared/coerce.ts
2
+ function isRecord(value) {
3
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4
+ }
5
+ function textOr(value, fallback) {
6
+ return typeof value === "string" && value.trim() ? value.trim() : fallback;
7
+ }
8
+ function rawTextOr(value, fallback) {
9
+ return typeof value === "string" && value.length > 0 ? value : fallback;
10
+ }
11
+ function numberOr(value, fallback) {
12
+ return typeof value === "number" && Number.isFinite(value) ? value : fallback;
13
+ }
14
+ function positiveNumberOr(value, fallback) {
15
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
16
+ }
17
+ function nonNegativeIntOr(value, fallback) {
18
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0) return fallback;
19
+ return Math.floor(value);
20
+ }
21
+ function coercedNumberOr(value, fallback) {
22
+ const number = Number(value);
23
+ if (!Number.isFinite(number)) return fallback;
24
+ return number;
25
+ }
26
+ function positiveIntOr(value, fallback) {
27
+ const number = Number(value);
28
+ if (!Number.isFinite(number) || number <= 0) return fallback;
29
+ return Math.floor(number);
30
+ }
31
+ //#endregion
32
+ export { positiveIntOr as a, textOr as c, numberOr as i, isRecord as n, positiveNumberOr as o, nonNegativeIntOr as r, rawTextOr as s, coercedNumberOr as t };