glimmervoid 0.30.0 → 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.
- package/README.md +1 -1
- package/dist/bin/glimmervoid.js +140 -57
- package/dist/chunks/{adapters-Dho1VSY5.js → adapters-ClA_GbtA.js} +1 -1
- package/dist/chunks/{adapters-zPDx1Xox.js → adapters-gn7ulNO4.js} +32 -12
- package/dist/chunks/agent-api-cli-DAA7Jx8N.js +135 -0
- package/dist/chunks/{agent-api-core-Dz0r21y9.js → agent-api-core-hVcT26JW.js} +10 -1
- package/dist/chunks/{agent-setup-cli-B5Atxr3F.js → agent-setup-cli-CiJSDWSo.js} +11 -28
- package/dist/chunks/backoff-DjVpfHk7.js +14 -0
- package/dist/chunks/child-process-safe-BKPZ-5qQ.js +2 -0
- package/dist/chunks/coerce-NSst8oRP.js +32 -0
- package/dist/chunks/{contracts-DGkKNh9W.js → config-W1Sv-iPK.js} +358 -1682
- package/dist/chunks/{config-store-mm7MgzoL.js → config-store-BCy4FHNG.js} +583 -327
- package/dist/chunks/config-store-DbBp7LJZ.js +2 -0
- package/dist/chunks/contracts-3LkrilQX.js +2078 -0
- package/dist/chunks/{grok-DuU8xVLZ.js → grok-CXKeSt2z.js} +24 -20
- package/dist/chunks/{hook-relay-core-BHfYFnYV.js → hook-relay-core-DA_bz2KA.js} +10 -5
- package/dist/chunks/{hook-tools-pSJia7ks.js → hook-tools-UX2fmt81.js} +3 -5
- package/dist/chunks/{ingest-editor-core-BuI1gMF_.js → ingest-editor-core-vR6Wv6bP.js} +24 -13
- package/dist/chunks/json-core-dfa_7Fak.js +23 -0
- package/dist/chunks/json-file-oEH9vt-0.js +352 -0
- package/dist/chunks/knowledge-graph-cli-D2tt5hPn.js +1354 -0
- package/dist/chunks/{loopback-post-C7C22eYi.js → loopback-post-DepQfdcM.js} +40 -26
- package/dist/chunks/{main-CuIZQPhZ.js → main-DyTCWIu2.js} +28498 -21129
- package/dist/chunks/{node-pty-preflight-CK1knGIR.js → node-pty-preflight-C8QIlrtU.js} +4 -6
- package/dist/chunks/{pair-cli-w-gCAF-1.js → pair-cli-BbCBfd6l.js} +4 -3
- package/dist/chunks/paths-CeJl2Vcg.js +55 -0
- package/dist/chunks/{remote-config-C2ytQwrs.js → remote-config-DKIH_VxM.js} +36 -40
- package/dist/chunks/{rtk-hook-core-Bl6gYHPN.js → rtk-hook-core-BmEz2aq9.js} +3 -5
- package/dist/chunks/{rtk-resolver-CLo-gZzw.js → rtk-resolver-BGDzw5XK.js} +2 -2
- package/dist/chunks/rtk-resolver-D4Nke1Fr.js +2 -0
- package/dist/chunks/{runtime-paths-Ci_ksSkj.js → runtime-paths-BPoxENmK.js} +2 -6
- package/dist/chunks/runtime-paths-DU5jBEEO.js +2 -0
- package/dist/chunks/{sandbox-deps-Dd5-kZnf.js → sandbox-deps-BPKE-ylr.js} +16 -13
- package/dist/chunks/sandbox-proxy-core-hnQgKR0T.js +27 -0
- package/dist/chunks/{session-Cez8aIWg.js → session-fc4pFbon.js} +8 -2
- package/dist/chunks/text-DoirglWV.js +21 -0
- package/dist/chunks/timer-deps-u2DAQLok.js +15 -0
- package/dist/chunks/{visions-cli-BXQFIBCX.js → visions-cli-CT5rjiwf.js} +1 -1
- package/dist/chunks/{visions-setup-CvVnOe1r.js → visions-setup-BmOkI-QE.js} +20 -357
- package/dist/client/assets/index-C6KD8lgZ.css +1 -0
- package/dist/client/assets/index-CThQEAEy.js +249 -0
- package/dist/client/fonts/CommitMono-OFL.txt +92 -0
- package/dist/client/fonts/commit-mono-400-italic.woff2 +0 -0
- package/dist/client/fonts/commit-mono-400-regular.woff2 +0 -0
- package/dist/client/fonts/commit-mono-700-italic.woff2 +0 -0
- package/dist/client/fonts/commit-mono-700-regular.woff2 +0 -0
- package/dist/client/index.html +7 -24
- package/dist/client/octicons-LICENSE.txt +21 -0
- package/dist/scripts/postinstall-path-check.js +1 -1
- package/dist/server/index.js +3 -3
- package/dist/session/command-hook-relay.js +1 -1
- package/dist/session/hook-relay.js +3 -3
- package/dist/session/hook-tool-relay.js +2 -2
- package/dist/session/sandbox-open-launcher.js +79 -0
- package/dist/session/statusline-relay.js +8 -18
- package/dist/session/visions-relay.js +20 -11
- package/package.json +4 -1
- package/dist/chunks/agent-api-cli-D0MmtEdz.js +0 -71
- package/dist/chunks/child-process-safe-DvQjXsgz.js +0 -2
- package/dist/chunks/config-store-CC8T3okC.js +0 -2
- package/dist/chunks/ingest-core-DWI1Mbu4.js +0 -342
- package/dist/chunks/rtk-resolver-CMQAidlI.js +0 -2
- package/dist/chunks/runtime-paths-JLrZ3wyi.js +0 -2
- package/dist/client/assets/index-B1MFijjb.css +0 -1
- package/dist/client/assets/index-CU1iPPdn.js +0 -249
- package/dist/chunks/{child-process-safe-DRGsp0TE.js → child-process-safe-Ch-Zgxqs.js} +1 -1
|
@@ -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 {
|
|
2
|
-
import {
|
|
1
|
+
import { r as errorMessage } from "./text-DoirglWV.js";
|
|
2
|
+
import { l as resolveConfigPath } from "./config-store-BCy4FHNG.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-DKIH_VxM.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}: ${
|
|
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 {
|
|
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-BCy4FHNG.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 =
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
408
|
+
if (isRecord(parsed)) return parsed;
|
|
413
409
|
return {};
|
|
414
410
|
} catch {
|
|
415
411
|
return {};
|
|
@@ -441,7 +437,7 @@ function toPort(value) {
|
|
|
441
437
|
return null;
|
|
442
438
|
}
|
|
443
439
|
function normalizeRemoteConfig(raw) {
|
|
444
|
-
const src =
|
|
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 (!
|
|
123
|
+
if (!isRecord(parsed)) return "";
|
|
126
124
|
const hookSpecificOutput = parsed.hookSpecificOutput;
|
|
127
|
-
if (
|
|
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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as execSync } from "./child-process-safe-
|
|
1
|
+
import { i as execSync } from "./child-process-safe-Ch-Zgxqs.js";
|
|
2
2
|
import { n as glimmervoidHomeDir } from "./config-path-core-DFt-TemS.js";
|
|
3
|
-
import { r as resolveRtkPath } from "./hook-tools-
|
|
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 =
|
|
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 {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { i as execSync } from "./child-process-safe-
|
|
1
|
+
import { i as execSync } from "./child-process-safe-Ch-Zgxqs.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([
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
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
|
|
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 ${
|
|
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)};
|
|
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,8 @@ 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"
|
|
142
144
|
];
|
|
143
145
|
var AgentSpawnRequest = z.object({
|
|
144
146
|
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 +162,9 @@ z.object({
|
|
|
160
162
|
state: SessionSnapshot.shape.state,
|
|
161
163
|
ephemeral: SessionSnapshot.shape.ephemeral
|
|
162
164
|
}).strict();
|
|
165
|
+
var AgentDispatchRequest = z.object({
|
|
166
|
+
workId: z.string().regex(/^wrk-[0-9a-f]{16}$/).optional(),
|
|
167
|
+
readyIntent: z.string().regex(/^wrk-[0-9a-f]{16}$/).optional()
|
|
168
|
+
}).strict().refine((request) => Boolean(request.workId) !== Boolean(request.readyIntent), "Expected exactly one work id or ready intent");
|
|
163
169
|
//#endregion
|
|
164
|
-
export { STATES as S,
|
|
170
|
+
export { STATES as C, RESTARTABLE_STATES as S, firstDetailLine as _, AgentDispatchRequest as a, KILLABLE_STATES as b, PendingPromptDetail as c, RefinedTaskTitle as d, SessionSnapshot as f, isSamePromptQuestion as g, TaskTitle as h, AgentAttentionRequest as i, PendingPromptQuestion as l, TASK_TITLE_CONTROL_CHARACTERS as m, AGENT_URL_ENV as n, AgentSpawnRequest as o, SessionState as p, ASK_USER_QUESTION_TOOL_NAME as r, PROMPT_DETAIL_HIDDEN_CHARACTERS as s, AGENT_API_VERBS as t, PendingWakeup as u, toolDetailFieldValue as v, MERGEABLE_LIVE_STATES as x, toolDetailLine 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-
|
|
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-BmOkI-QE.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
//#region server/visions-cli.ts
|
|
5
5
|
function fileOutcomeRows(files) {
|