glimmervoid 0.30.0 → 0.32.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 (68) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/glimmervoid.js +144 -57
  3. package/dist/chunks/{adapters-Dho1VSY5.js → adapters-BU74M4QZ.js} +1 -1
  4. package/dist/chunks/{adapters-zPDx1Xox.js → adapters-CoC18rdt.js} +56 -31
  5. package/dist/chunks/agent-api-cli-V_BkYhBI.js +142 -0
  6. package/dist/chunks/agent-api-core-B3YI8SYs.js +192 -0
  7. package/dist/chunks/{agent-setup-cli-B5Atxr3F.js → agent-setup-cli-D4956BfN.js} +11 -28
  8. package/dist/chunks/backoff-DjVpfHk7.js +14 -0
  9. package/dist/chunks/child-process-safe-B3zcPdFM.js +2 -0
  10. package/dist/chunks/{child-process-safe-DRGsp0TE.js → child-process-safe-DDELk9XC.js} +3 -2
  11. package/dist/chunks/coerce-NSst8oRP.js +32 -0
  12. package/dist/chunks/{contracts-DGkKNh9W.js → config-CZ4H51D0.js} +374 -1684
  13. package/dist/chunks/{config-store-mm7MgzoL.js → config-store-BVtdHkDK.js} +594 -329
  14. package/dist/chunks/config-store-Cp62jN1O.js +2 -0
  15. package/dist/chunks/contracts-DXujp-Zn.js +2131 -0
  16. package/dist/chunks/git-version-CrLW4a6r.js +58 -0
  17. package/dist/chunks/{grok-DuU8xVLZ.js → grok-C4lzPFEg.js} +24 -21
  18. package/dist/chunks/{hook-relay-core-BHfYFnYV.js → hook-relay-core-DA_bz2KA.js} +10 -5
  19. package/dist/chunks/{hook-tools-pSJia7ks.js → hook-tools-UX2fmt81.js} +3 -5
  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-Bjy9_kv5.js +1354 -0
  24. package/dist/chunks/{loopback-post-C7C22eYi.js → loopback-post-DepQfdcM.js} +40 -26
  25. package/dist/chunks/{main-CuIZQPhZ.js → main-DSbpYn2Y.js} +27880 -19139
  26. package/dist/chunks/{node-pty-preflight-CK1knGIR.js → node-pty-preflight-C8QIlrtU.js} +4 -6
  27. package/dist/chunks/{pair-cli-w-gCAF-1.js → pair-cli-CKn-wUw9.js} +4 -3
  28. package/dist/chunks/paths-CeJl2Vcg.js +55 -0
  29. package/dist/chunks/{remote-config-C2ytQwrs.js → remote-config-DP44Ybt9.js} +37 -41
  30. package/dist/chunks/{rtk-hook-core-Bl6gYHPN.js → rtk-hook-core-BmEz2aq9.js} +3 -5
  31. package/dist/chunks/rtk-resolver-CIVLE_xk.js +2 -0
  32. package/dist/chunks/{rtk-resolver-CLo-gZzw.js → rtk-resolver-jJxy_Mrt.js} +2 -2
  33. package/dist/chunks/{runtime-paths-Ci_ksSkj.js → runtime-paths-BPoxENmK.js} +2 -6
  34. package/dist/chunks/runtime-paths-DU5jBEEO.js +2 -0
  35. package/dist/chunks/{sandbox-deps-Dd5-kZnf.js → sandbox-deps-DuaNFq7n.js} +16 -13
  36. package/dist/chunks/sandbox-proxy-core-hnQgKR0T.js +27 -0
  37. package/dist/chunks/{session-Cez8aIWg.js → session-B8fJb_Or.js} +25 -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-BXQFIBCX.js → visions-cli-BhFdym5n.js} +1 -1
  41. package/dist/chunks/{visions-setup-CvVnOe1r.js → visions-setup-CfgNHiG3.js} +20 -357
  42. package/dist/client/assets/index-C_XKsDFx.css +1 -0
  43. package/dist/client/assets/index-CoqWjYxP.js +254 -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/hook-tool-relay.js +2 -2
  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 +4 -1
  60. package/dist/chunks/agent-api-cli-D0MmtEdz.js +0 -71
  61. package/dist/chunks/agent-api-core-Dz0r21y9.js +0 -103
  62. package/dist/chunks/child-process-safe-DvQjXsgz.js +0 -2
  63. package/dist/chunks/config-store-CC8T3okC.js +0 -2
  64. package/dist/chunks/ingest-core-DWI1Mbu4.js +0 -342
  65. package/dist/chunks/rtk-resolver-CMQAidlI.js +0 -2
  66. package/dist/chunks/runtime-paths-JLrZ3wyi.js +0 -2
  67. package/dist/client/assets/index-B1MFijjb.css +0 -1
  68. package/dist/client/assets/index-CU1iPPdn.js +0 -249
@@ -1,3 +1,4 @@
1
+ import { r as errorMessage } from "./text-DoirglWV.js";
1
2
  import { createRequire } from "node:module";
2
3
  import fs from "node:fs";
3
4
  import path from "node:path";
@@ -62,14 +63,11 @@ function hostScope() {
62
63
  arch: process.arch
63
64
  };
64
65
  }
65
- function errorMessage(error) {
66
- return firstLine(error instanceof Error ? error.message : String(error));
67
- }
68
66
  function resolveNodePtyPackageDir() {
69
67
  try {
70
68
  return { packageDir: path.dirname(createRequire(import.meta.url).resolve("node-pty/package.json")) };
71
69
  } catch (err) {
72
- return { error: errorMessage(err) };
70
+ return { error: firstLine(errorMessage(err)) };
73
71
  }
74
72
  }
75
73
  var EXECUTABLE_MODE = 493;
@@ -98,7 +96,7 @@ function ensureSpawnHelperExecutable(packageDir, scope) {
98
96
  try {
99
97
  fs.chmodSync(helperPath, EXECUTABLE_MODE);
100
98
  } catch (err) {
101
- lastRepairError = `${helperPath}: ${errorMessage(err)}`;
99
+ lastRepairError = `${helperPath}: ${firstLine(errorMessage(err))}`;
102
100
  continue;
103
101
  }
104
102
  if (isExecutableByThisProcess(helperPath)) {
@@ -146,7 +144,7 @@ async function probeNodePty() {
146
144
  } catch (err) {
147
145
  return {
148
146
  ok: false,
149
- reason: errorMessage(err),
147
+ reason: firstLine(errorMessage(err)),
150
148
  packageDir: resolved.packageDir
151
149
  };
152
150
  }
@@ -1,5 +1,6 @@
1
- import { l as resolveConfigPath } from "./config-store-mm7MgzoL.js";
2
- import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-C2ytQwrs.js";
1
+ import { r as errorMessage } from "./text-DoirglWV.js";
2
+ import { l as resolveConfigPath } from "./config-store-BVtdHkDK.js";
3
+ import { c as defaultPairingsPath, i as REVOCATION_PROPAGATION_SECONDS, l as defaultSeenPath, n as normalizeRemoteConfig, o as createPairingsStore, s as createSeenStore } from "./remote-config-DP44Ybt9.js";
3
4
  import fs from "node:fs";
4
5
  //#region server/text-format.ts
5
6
  function trimIso(iso) {
@@ -21,7 +22,7 @@ function readConfig(configPath) {
21
22
  try {
22
23
  return JSON.parse(fs.readFileSync(configPath, "utf8"));
23
24
  } catch (err) {
24
- console.error(`Could not read ${configPath}: ${err instanceof Error ? err.message : String(err)}`);
25
+ console.error(`Could not read ${configPath}: ${errorMessage(err)}`);
25
26
  return null;
26
27
  }
27
28
  }
@@ -0,0 +1,55 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { promisify } from "node:util";
4
+ //#region shared/paths.ts
5
+ var realpathNative = promisify(fs.realpath.native);
6
+ function canonicalizePath(p) {
7
+ try {
8
+ return fs.realpathSync.native(p);
9
+ } catch {
10
+ return p;
11
+ }
12
+ }
13
+ function caseFoldedPathKey(value) {
14
+ return process.platform === "win32" ? value.toLowerCase() : value;
15
+ }
16
+ function equalsIgnoringCaseOnWindows(a, b) {
17
+ return caseFoldedPathKey(a) === caseFoldedPathKey(b);
18
+ }
19
+ function isSameDirectoryPath(a, b) {
20
+ const resolvedA = path.resolve(String(a || ""));
21
+ const resolvedB = path.resolve(String(b || ""));
22
+ if (equalsIgnoringCaseOnWindows(resolvedA, resolvedB)) return true;
23
+ if (process.platform !== "win32" && process.platform !== "darwin") return false;
24
+ return equalsIgnoringCaseOnWindows(canonicalizePath(resolvedA), canonicalizePath(resolvedB));
25
+ }
26
+ async function comparableDirectoryPath(candidatePath) {
27
+ const resolvedPath = path.resolve(String(candidatePath || ""));
28
+ let canonicalPath;
29
+ try {
30
+ canonicalPath = await realpathNative(resolvedPath);
31
+ } catch {
32
+ canonicalPath = resolvedPath;
33
+ }
34
+ if (process.platform !== "win32") return canonicalPath;
35
+ return canonicalPath.toLowerCase();
36
+ }
37
+ function isPathInside(parent, child, { allowEqual = true, foldCase = false } = {}) {
38
+ if (!parent || !child) return false;
39
+ const resolvedParent = path.resolve(parent);
40
+ const resolvedChild = path.resolve(child);
41
+ const from = foldCase ? resolvedParent.toLowerCase() : resolvedParent;
42
+ const to = foldCase ? resolvedChild.toLowerCase() : resolvedChild;
43
+ const relative = path.relative(from, to);
44
+ if (relative === "") return allowEqual;
45
+ if (path.isAbsolute(relative)) return false;
46
+ return relative !== ".." && !relative.startsWith(`..${path.sep}`);
47
+ }
48
+ function safePathSegment(value) {
49
+ return String(value).replace(/[<>:"/\\|?*\x00-\x1f]/g, "-").replace(/[. ]+$/, "") || "_";
50
+ }
51
+ function sanitizeWorktreeName(value) {
52
+ return String(value || "").replace(/[^\w.-]+/g, "-").replace(/^-+|-+$/g, "");
53
+ }
54
+ //#endregion
55
+ export { isPathInside as a, sanitizeWorktreeName as c, equalsIgnoringCaseOnWindows as i, caseFoldedPathKey as n, isSameDirectoryPath as o, comparableDirectoryPath as r, safePathSegment as s, canonicalizePath as t };
@@ -1,4 +1,9 @@
1
- import { X as equalsIgnoringCaseOnWindows, g as writeJsonAtomicSync, h as writeJsonAtomic, q as canonicalizePath, s as glimmervoidHomeDir } from "./config-store-mm7MgzoL.js";
1
+ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
2
+ import { i as equalsIgnoringCaseOnWindows, t as canonicalizePath } from "./paths-CeJl2Vcg.js";
3
+ import { n as isRecord } from "./coerce-NSst8oRP.js";
4
+ import { n as unrefTimer, t as DEFAULT_TIMER_FNS } from "./timer-deps-u2DAQLok.js";
5
+ import { a as jsonStateLoadError, d as writeJsonAtomicSync, l as sleepSync, s as loadJsonStateFileSync, u as writeJsonAtomic } from "./json-file-oEH9vt-0.js";
6
+ import { s as glimmervoidHomeDir } from "./config-store-BVtdHkDK.js";
2
7
  import fs from "node:fs";
3
8
  import path from "node:path";
4
9
  import crypto from "node:crypto";
@@ -89,16 +94,6 @@ var LOCK_SUFFIX = ".lock";
89
94
  var LOCK_RETRY_MS = 50;
90
95
  var LOCK_MAX_ATTEMPTS = 10;
91
96
  var LOCK_STALE_MS = 5e3;
92
- function errorLabel(err) {
93
- const failure = err ?? {};
94
- return String(failure.code || failure.message || err);
95
- }
96
- function errorMessage(err) {
97
- return err instanceof Error ? err.message : String(err);
98
- }
99
- function sleepSync(ms) {
100
- Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
101
- }
102
97
  function emptyDoc() {
103
98
  return {
104
99
  version: 1,
@@ -129,40 +124,41 @@ function pairingsSignature(doc) {
129
124
  const safe = coerceDoc(doc);
130
125
  return JSON.stringify(safe);
131
126
  }
132
- function createPairingsStore({ filePath = defaultPairingsPath(), now = Date.now, randomBytes, warn = console.warn, setIntervalFn = (fn, ms) => setInterval(fn, ms), clearIntervalFn = (handle) => clearInterval(handle) } = {}) {
127
+ function createPairingsStore({ filePath = defaultPairingsPath(), now = Date.now, randomBytes, warn = console.warn, setIntervalFn = DEFAULT_TIMER_FNS.setIntervalFn, clearIntervalFn = DEFAULT_TIMER_FNS.clearIntervalFn } = {}) {
133
128
  const pairingsPath = filePath;
134
129
  let snapshot = emptyDoc();
135
130
  function readDocSync() {
136
- let raw;
137
- try {
138
- raw = fs.readFileSync(pairingsPath, "utf8");
139
- } catch (err) {
140
- if (err?.code === "ENOENT") return {
141
- doc: emptyDoc(),
142
- missing: true,
143
- corrupt: false
144
- };
145
- warn(`[pairings] Failed to read ${pairingsPath}: ${errorLabel(err)}`);
146
- return {
147
- doc: emptyDoc(),
148
- missing: false,
149
- corrupt: true
150
- };
151
- }
152
- try {
153
- return {
154
- doc: coerceDoc(JSON.parse(raw)),
155
- missing: false,
156
- corrupt: false
157
- };
158
- } catch (err) {
159
- warn(`[pairings] Invalid JSON in ${pairingsPath}: ${errorMessage(err)} - treating as no paired devices`);
131
+ const outcome = loadJsonStateFileSync({
132
+ filePath: pairingsPath,
133
+ fsSync: fs,
134
+ parse: coerceDoc,
135
+ quarantine: false,
136
+ includeNotDir: false
137
+ });
138
+ if (outcome.status === "missing") return {
139
+ doc: emptyDoc(),
140
+ missing: true,
141
+ corrupt: false
142
+ };
143
+ if (outcome.status === "loaded") return {
144
+ doc: outcome.value,
145
+ missing: false,
146
+ corrupt: false
147
+ };
148
+ if (outcome.status === "corrupt") {
149
+ warn(`[pairings] Invalid JSON in ${pairingsPath}: ${errorMessage(outcome.error)} - treating as no paired devices`);
160
150
  return {
161
151
  doc: emptyDoc(),
162
152
  missing: false,
163
153
  corrupt: true
164
154
  };
165
155
  }
156
+ warn(`[pairings] Failed to read ${pairingsPath}: ${errorLabel(jsonStateLoadError(outcome))}`);
157
+ return {
158
+ doc: emptyDoc(),
159
+ missing: false,
160
+ corrupt: true
161
+ };
166
162
  }
167
163
  function load() {
168
164
  snapshot = readDocSync().doc;
@@ -365,14 +361,14 @@ function createPairingsStore({ filePath = defaultPairingsPath(), now = Date.now,
365
361
  if (onChange) onChange(snapshot);
366
362
  }
367
363
  const reloadInterval = setIntervalFn(refresh, SNAPSHOT_RELOAD_MS);
368
- if (reloadInterval.unref) reloadInterval.unref();
364
+ unrefTimer(reloadInterval);
369
365
  try {
370
366
  ensureDir();
371
367
  watcher = fs.watch(canonicalizePath(dir), (_event, filename) => {
372
368
  if (filename && !equalsIgnoringCaseOnWindows(path.basename(String(filename)), path.basename(pairingsPath))) return;
373
369
  if (timer) clearTimeout(timer);
374
370
  timer = setTimeout(refresh, 200);
375
- if (timer.unref) timer.unref();
371
+ unrefTimer(timer);
376
372
  });
377
373
  } catch (err) {
378
374
  warn(`[pairings] Failed to watch ${dir}: ${errorMessage(err)} - falling back to the ${REVOCATION_PROPAGATION_SECONDS}s reload interval`);
@@ -409,7 +405,7 @@ function createSeenStore({ filePath = defaultSeenPath(), throttleMs = 6e4, now =
409
405
  function readAll() {
410
406
  try {
411
407
  const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
412
- if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
408
+ if (isRecord(parsed)) return parsed;
413
409
  return {};
414
410
  } catch {
415
411
  return {};
@@ -423,7 +419,7 @@ function createSeenStore({ filePath = defaultSeenPath(), throttleMs = 6e4, now =
423
419
  if (last != null && at - last < throttleMs) return;
424
420
  lastWriteByDevice.set(deviceId, at);
425
421
  doc[deviceId] = at;
426
- pending = writeJsonAtomic(filePath, doc, { mode: 384 }).catch(() => {});
422
+ pending = (pending ?? Promise.resolve()).then(() => writeJsonAtomic(filePath, doc, { mode: 384 })).catch(() => {});
427
423
  }
428
424
  return {
429
425
  touch,
@@ -441,7 +437,7 @@ function toPort(value) {
441
437
  return null;
442
438
  }
443
439
  function normalizeRemoteConfig(raw) {
444
- const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
440
+ const src = isRecord(raw) ? raw : {};
445
441
  const enabled = src.enabled === true;
446
442
  const port = toPort(src.port);
447
443
  const publicHost = typeof src.publicHost === "string" ? src.publicHost.trim() : "";
@@ -1,3 +1,4 @@
1
+ import { n as isRecord } from "./coerce-NSst8oRP.js";
1
2
  //#region session/core/sane-yolo.ts
2
3
  var SANE_YOLO_PATH_ENV = "GLIMMERVOID_SANE_YOLO_PATH";
3
4
  var SANE_YOLO_POLICY = {
@@ -108,9 +109,6 @@ function saneYoloEnv(homeDir) {
108
109
  //#region session/core/rtk-hook-core.ts
109
110
  var RTK_PATH_ENV = "GLIMMERVOID_RTK_PATH";
110
111
  var MAX_RTK_STDOUT_BYTES = 65536;
111
- function isPlainObject(value) {
112
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
113
- }
114
112
  function normalizeRtkHookResponse(stdoutText) {
115
113
  if (typeof stdoutText !== "string") return "";
116
114
  const trimmed = stdoutText.trim();
@@ -122,9 +120,9 @@ function normalizeRtkHookResponse(stdoutText) {
122
120
  } catch {
123
121
  return "";
124
122
  }
125
- if (!isPlainObject(parsed)) return "";
123
+ if (!isRecord(parsed)) return "";
126
124
  const hookSpecificOutput = parsed.hookSpecificOutput;
127
- if (isPlainObject(hookSpecificOutput) && isPlainObject(hookSpecificOutput.updatedInput)) {
125
+ if (isRecord(hookSpecificOutput) && isRecord(hookSpecificOutput.updatedInput)) {
128
126
  if (typeof hookSpecificOutput.permissionDecision !== "string") hookSpecificOutput.permissionDecision = "allow";
129
127
  }
130
128
  return JSON.stringify(parsed);
@@ -0,0 +1,2 @@
1
+ import { t as getRtkPath } from "./rtk-resolver-jJxy_Mrt.js";
2
+ export { getRtkPath };
@@ -1,6 +1,6 @@
1
- import { i as execSync } from "./child-process-safe-DRGsp0TE.js";
1
+ import { i as execSync } from "./child-process-safe-DDELk9XC.js";
2
2
  import { n as glimmervoidHomeDir } from "./config-path-core-DFt-TemS.js";
3
- import { r as resolveRtkPath } from "./hook-tools-pSJia7ks.js";
3
+ import { r as resolveRtkPath } from "./hook-tools-UX2fmt81.js";
4
4
  import fs from "node:fs";
5
5
  import os from "node:os";
6
6
  //#region server/rtk-resolver.ts
@@ -1,13 +1,9 @@
1
+ import { a as isPathInside } from "./paths-CeJl2Vcg.js";
1
2
  import { createRequire } from "node:module";
2
3
  import fs from "node:fs";
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
5
6
  //#region server/core/runtime-paths.ts
6
- function isUnder(candidate, parent) {
7
- const relative = path.relative(parent, candidate);
8
- if (relative === "" || relative.startsWith("..")) return false;
9
- return !path.isAbsolute(relative);
10
- }
11
7
  function findPackageRoot(startDirectory, hasPackageJson) {
12
8
  let directory = startDirectory;
13
9
  for (;;) {
@@ -20,7 +16,7 @@ function findPackageRoot(startDirectory, hasPackageJson) {
20
16
  function computeRuntimePaths({ moduleFile, hasPackageJson }) {
21
17
  const packageRoot = findPackageRoot(path.dirname(path.resolve(moduleFile)), hasPackageJson);
22
18
  const distDir = path.join(packageRoot, "dist");
23
- const bundled = isUnder(path.resolve(moduleFile), distDir);
19
+ const bundled = isPathInside(distDir, path.resolve(moduleFile), { allowEqual: false });
24
20
  const assetRoot = bundled ? distDir : packageRoot;
25
21
  const sourceExtension = bundled ? ".js" : ".ts";
26
22
  return {
@@ -0,0 +1,2 @@
1
+ import { s as resolvePackageBin } from "./runtime-paths-BPoxENmK.js";
2
+ export { resolvePackageBin };
@@ -1,15 +1,14 @@
1
- import { i as execSync } from "./child-process-safe-DRGsp0TE.js";
1
+ import { i as execSync } from "./child-process-safe-DDELk9XC.js";
2
2
  import { r as resolvePathCommandMatches } from "./spawn-command-Cc40FiZI.js";
3
3
  //#region server/core/sandbox-deps-core.ts
4
- var LINUX_SANDBOX_BINARIES = Object.freeze(["bwrap", "socat"]);
5
- var NO_SANDBOX_BINARIES = Object.freeze([]);
6
- var SANDBOX_INSTALL_HINT = "Install bubblewrap and socat, for example: sudo apt install bubblewrap socat";
7
- var SANDBOXED_LANE_NAMES = Object.freeze([
8
- "team review",
9
- "Keep mergeable repairs",
10
- "workflow sessions",
11
- "benchmark runs"
4
+ var LINUX_SANDBOX_BINARIES = Object.freeze([
5
+ "bwrap",
6
+ "socat",
7
+ "rg"
12
8
  ]);
9
+ var NO_SANDBOX_BINARIES = Object.freeze([]);
10
+ var SANDBOX_INSTALL_HINT = "Install bubblewrap, socat and ripgrep, for example: sudo apt install bubblewrap socat ripgrep";
11
+ var SANDBOXED_WORK = "sandboxed sessions and factory checks";
13
12
  function requiredSandboxBinaries(platform) {
14
13
  return platform === "linux" ? LINUX_SANDBOX_BINARIES : NO_SANDBOX_BINARIES;
15
14
  }
@@ -23,16 +22,20 @@ function sandboxDependencyReport({ platform, binariesOnPath }) {
23
22
  installHint: missingBinaries.length > 0 ? SANDBOX_INSTALL_HINT : null
24
23
  };
25
24
  }
25
+ function namesList(names) {
26
+ if (names.length <= 1) return names.join("");
27
+ return `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`;
28
+ }
26
29
  function missingBinariesPhrase(report) {
27
- return `${report.missingBinaries.join(" and ")} ${report.missingBinaries.length === 1 ? "is" : "are"} not on PATH`;
30
+ return `${namesList(report.missingBinaries)} ${report.missingBinaries.length === 1 ? "is" : "are"} not on PATH`;
28
31
  }
29
32
  function sandboxSpawnRefusal(report) {
30
33
  if (report.missingBinaries.length === 0) return null;
31
- return `not started: the Claude Code sandbox needs ${report.requiredBinaries.join(" and ")}, and ${missingBinariesPhrase(report)}. ${report.installHint}`;
34
+ return `not started: the sandbox needs ${namesList(report.requiredBinaries)}, and ${missingBinariesPhrase(report)}. ${report.installHint}`;
32
35
  }
33
36
  function sandboxBootWarning(report) {
34
37
  if (report.missingBinaries.length === 0) return null;
35
- return `[sandbox] ${missingBinariesPhrase(report)}, so ${SANDBOXED_LANE_NAMES.join(", ")} will refuse to start sandboxed sessions. ${report.installHint}`;
38
+ return `[sandbox] ${missingBinariesPhrase(report)}, so ${SANDBOXED_WORK} will refuse to start. ${report.installHint}`;
36
39
  }
37
40
  function sandboxDoctorRows(report) {
38
41
  if (report.requiredBinaries.length === 0) return [["sandbox", `nothing to check on ${report.platform}`]];
@@ -42,7 +45,7 @@ function sandboxDoctorRows(report) {
42
45
  }
43
46
  function sandboxInstallNotice(report) {
44
47
  if (report.installHint === null) return null;
45
- return `glimmervoid: ${missingBinariesPhrase(report)}; team review, Keep mergeable, workflow sessions and benchmark runs need ${report.requiredBinaries.join(" and ")}. ${report.installHint}`;
48
+ return `glimmervoid: ${missingBinariesPhrase(report)}; ${SANDBOXED_WORK} need ${namesList(report.requiredBinaries)}. ${report.installHint}`;
46
49
  }
47
50
  //#endregion
48
51
  //#region server/sandbox-deps.ts
@@ -0,0 +1,27 @@
1
+ import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
2
+ //#region session/core/sandbox-proxy-core.ts
3
+ var HOOK_VIA_SANDBOX_PROXY_ENV = "GLIMMERVOID_HOOK_VIA_SANDBOX_PROXY";
4
+ function decodeProxyCredential(percentEncoded) {
5
+ try {
6
+ return decodeURIComponent(percentEncoded);
7
+ } catch {
8
+ return null;
9
+ }
10
+ }
11
+ function decideSandboxProxy(env) {
12
+ if (env.SANDBOX_RUNTIME !== "1") return null;
13
+ const rawProxyUrl = env.HTTP_PROXY || env.http_proxy || "";
14
+ if (!URL.canParse(rawProxyUrl)) return null;
15
+ const proxyUrl = new URL(rawProxyUrl);
16
+ if (proxyUrl.protocol !== "http:" || !proxyUrl.port || !isLoopbackHostname(proxyUrl.hostname)) return null;
17
+ const username = decodeProxyCredential(proxyUrl.username);
18
+ const password = decodeProxyCredential(proxyUrl.password);
19
+ if (username === null || password === null) return null;
20
+ return {
21
+ hostname: proxyUrl.hostname.replace(/^\[|\]$/g, ""),
22
+ port: Number(proxyUrl.port),
23
+ authorization: username ? `Basic ${Buffer.from(`${username}:${password}`, "utf8").toString("base64")}` : null
24
+ };
25
+ }
26
+ //#endregion
27
+ export { decideSandboxProxy as n, HOOK_VIA_SANDBOX_PROXY_ENV as t };
@@ -119,6 +119,7 @@ var SessionSnapshot = z.object({
119
119
  resumeSessionId: z.string().nullable(),
120
120
  activeAgents: z.number().int().nonnegative(),
121
121
  awaitingBackgroundTasks: z.boolean(),
122
+ isCompacting: z.boolean().default(false),
122
123
  hasEndedTurn: z.boolean().default(false),
123
124
  pendingWakeup: PendingWakeup.nullable(),
124
125
  pendingPromptKind: z.string().nullable(),
@@ -138,7 +139,16 @@ var AGENT_URL_ENV = "GLIMMERVOID_AGENT_URL";
138
139
  var AGENT_API_VERBS = [
139
140
  "spawn",
140
141
  "attention",
141
- "board"
142
+ "board",
143
+ "dispatch",
144
+ "reopen",
145
+ "cancel",
146
+ "push"
147
+ ];
148
+ var ORCHESTRATOR_AGENT_VERBS = [
149
+ "dispatch",
150
+ "reopen",
151
+ "cancel"
142
152
  ];
143
153
  var AgentSpawnRequest = z.object({
144
154
  prompt: z.string({ error: "prompt must be a string" }).min(1, { error: "prompt must not be empty" }).max(2e4, { error: "prompt must be at most 20000 characters" }).refine((prompt) => !prompt.trimStart().startsWith("-"), { message: "prompt must not start with a dash, which the agent CLI would read as an option" }),
@@ -160,5 +170,18 @@ z.object({
160
170
  state: SessionSnapshot.shape.state,
161
171
  ephemeral: SessionSnapshot.shape.ephemeral
162
172
  }).strict();
173
+ var AgentDispatchRequest = z.object({
174
+ workId: z.string().regex(/^wrk-[0-9a-f]{16}$/).optional(),
175
+ readyIntent: z.string().regex(/^wrk-[0-9a-f]{16}$/).optional()
176
+ }).strict().refine((request) => Boolean(request.workId) !== Boolean(request.readyIntent), "Expected exactly one work id or ready intent");
177
+ var AgentTicketRequest = z.object({ workId: z.string({ error: "workId must be a string" }).regex(/^wrk-[0-9a-f]{16}$/, { error: "workId must match wrk-[0-9a-f]{16}" }) }).strict();
178
+ z.discriminatedUnion("ok", [z.object({
179
+ ok: z.literal(true),
180
+ workId: z.string(),
181
+ state: z.enum(["open", "cancelled"])
182
+ }), z.object({
183
+ ok: z.literal(false),
184
+ reason: z.string()
185
+ })]);
163
186
  //#endregion
164
- export { STATES as S, toolDetailFieldValue as _, AgentSpawnRequest as a, MERGEABLE_LIVE_STATES as b, PendingPromptQuestion as c, SessionSnapshot as d, SessionState as f, firstDetailLine as g, isSamePromptQuestion as h, AgentAttentionRequest as i, PendingWakeup as l, TaskTitle as m, AGENT_URL_ENV as n, PROMPT_DETAIL_HIDDEN_CHARACTERS as o, TASK_TITLE_CONTROL_CHARACTERS as p, ASK_USER_QUESTION_TOOL_NAME as r, PendingPromptDetail as s, AGENT_API_VERBS as t, RefinedTaskTitle as u, toolDetailLine as v, RESTARTABLE_STATES as x, KILLABLE_STATES as y };
187
+ export { MERGEABLE_LIVE_STATES as C, KILLABLE_STATES as S, STATES as T, TaskTitle as _, AgentDispatchRequest as a, toolDetailFieldValue as b, ORCHESTRATOR_AGENT_VERBS as c, PendingPromptQuestion as d, PendingWakeup as f, TASK_TITLE_CONTROL_CHARACTERS as g, SessionState as h, AgentAttentionRequest as i, PROMPT_DETAIL_HIDDEN_CHARACTERS as l, SessionSnapshot as m, AGENT_URL_ENV as n, AgentSpawnRequest as o, RefinedTaskTitle as p, ASK_USER_QUESTION_TOOL_NAME as r, AgentTicketRequest as s, AGENT_API_VERBS as t, PendingPromptDetail as u, isSamePromptQuestion as v, RESTARTABLE_STATES as w, toolDetailLine as x, firstDetailLine as y };
@@ -0,0 +1,21 @@
1
+ //#region shared/text.ts
2
+ function errorMessage(error) {
3
+ return error instanceof Error ? error.message : String(error);
4
+ }
5
+ function errorText(error) {
6
+ const failure = error ?? {};
7
+ return failure.message ? String(failure.message) : String(error);
8
+ }
9
+ function errorCode(error) {
10
+ const code = error?.code;
11
+ return typeof code === "string" ? code : void 0;
12
+ }
13
+ function errorLabel(error) {
14
+ return errorCode(error) || errorText(error);
15
+ }
16
+ function isMissingFileError(error, { includeNotDir = true } = {}) {
17
+ const code = errorCode(error);
18
+ return code === "ENOENT" || includeNotDir && code === "ENOTDIR";
19
+ }
20
+ //#endregion
21
+ export { isMissingFileError as a, errorText as i, errorLabel as n, errorMessage as r, errorCode as t };
@@ -0,0 +1,15 @@
1
+ //#region shared/timer-deps.ts
2
+ var DEFAULT_TIMER_FNS = Object.freeze({
3
+ setTimeoutFn: (fn, ms) => setTimeout(fn, ms),
4
+ clearTimeoutFn: (handle) => clearTimeout(handle),
5
+ setIntervalFn: (fn, ms) => setInterval(fn, ms),
6
+ clearIntervalFn: (handle) => clearInterval(handle)
7
+ });
8
+ function unrefTimer(handle) {
9
+ if (typeof handle !== "object" || handle === null) return handle;
10
+ if (!("unref" in handle) || typeof handle.unref !== "function") return handle;
11
+ handle.unref();
12
+ return handle;
13
+ }
14
+ //#endregion
15
+ export { unrefTimer as n, DEFAULT_TIMER_FNS as t };
@@ -1,5 +1,5 @@
1
1
  import { t as renderTable } from "./ascii-figure-core-pDAwtlKO.js";
2
- import { a as relayInvocationOptions, c as unwireEverything, d as extensionIdOf, f as buildSetupGuide, h as isExtensionInstalled, i as packVsix, l as wireEverything, m as recipeIds, o as resolveRelayInvocation, p as commandLine, r as editorExtensions, s as resolvedEditorPaths, t as RELAY_PATH, u as editorTargets } from "./visions-setup-CvVnOe1r.js";
2
+ import { a as relayInvocationOptions, c as unwireEverything, d as extensionIdOf, f as buildSetupGuide, h as isExtensionInstalled, i as packVsix, l as wireEverything, m as recipeIds, o as resolveRelayInvocation, p as commandLine, r as editorExtensions, s as resolvedEditorPaths, t as RELAY_PATH, u as editorTargets } from "./visions-setup-CfgNHiG3.js";
3
3
  import fs from "node:fs";
4
4
  //#region server/visions-cli.ts
5
5
  function fileOutcomeRows(files) {