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.
- package/README.md +8 -10
- package/dist/bin/glimmervoid.js +152 -53
- package/dist/chunks/{adapters-DIavI9-i.js → adapters-ClA_GbtA.js} +1 -1
- package/dist/chunks/{adapters-Dlvu1FVB.js → adapters-gn7ulNO4.js} +49 -20
- package/dist/chunks/agent-api-cli-DAA7Jx8N.js +135 -0
- package/dist/chunks/{agent-api-core-D6LHrpSL.js → agent-api-core-hVcT26JW.js} +10 -1
- package/dist/chunks/{agent-setup-cli-C1CQ8Nkk.js → agent-setup-cli-CiJSDWSo.js} +15 -30
- package/dist/chunks/backoff-DjVpfHk7.js +14 -0
- package/dist/chunks/child-process-safe-BKPZ-5qQ.js +2 -0
- package/dist/chunks/{child-process-safe-Cz22RwlG.js → child-process-safe-Ch-Zgxqs.js} +2 -2
- package/dist/chunks/coerce-NSst8oRP.js +32 -0
- package/dist/chunks/{contracts-JKChPhZ0.js → config-W1Sv-iPK.js} +380 -1682
- package/dist/chunks/{config-store-DtPUFVaO.js → config-store-BCy4FHNG.js} +595 -327
- package/dist/chunks/config-store-DbBp7LJZ.js +2 -0
- package/dist/chunks/contracts-3LkrilQX.js +2078 -0
- package/dist/chunks/{grok-COekzawt.js → grok-CXKeSt2z.js} +69 -36
- package/dist/chunks/hook-command-core-DclEoE9e.js +14 -0
- package/dist/chunks/{hook-relay-core-BHfYFnYV.js → hook-relay-core-DA_bz2KA.js} +10 -5
- package/dist/chunks/hook-tools-UX2fmt81.js +72 -0
- 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-BVDjy7vH.js → main-DyTCWIu2.js} +28881 -20693
- package/dist/chunks/{node-pty-preflight-CK1knGIR.js → node-pty-preflight-C8QIlrtU.js} +4 -6
- package/dist/chunks/{pair-cli-BQQnhkkc.js → pair-cli-BbCBfd6l.js} +4 -3
- package/dist/chunks/paths-CeJl2Vcg.js +55 -0
- package/dist/chunks/{remote-config-BHoDFCpo.js → remote-config-DKIH_VxM.js} +43 -43
- package/dist/chunks/rtk-hook-core-BmEz2aq9.js +131 -0
- package/dist/chunks/rtk-resolver-BGDzw5XK.js +21 -0
- package/dist/chunks/rtk-resolver-D4Nke1Fr.js +2 -0
- package/dist/chunks/{runtime-paths-CVvq20A4.js → runtime-paths-BPoxENmK.js} +28 -8
- package/dist/chunks/runtime-paths-DU5jBEEO.js +2 -0
- package/dist/chunks/{sandbox-deps-BwvbDBDl.js → sandbox-deps-BPKE-ylr.js} +16 -13
- package/dist/chunks/sandbox-proxy-core-hnQgKR0T.js +27 -0
- package/dist/chunks/{session-CJtOveHl.js → session-fc4pFbon.js} +10 -2
- package/dist/chunks/text-DoirglWV.js +21 -0
- package/dist/chunks/timer-deps-u2DAQLok.js +15 -0
- package/dist/chunks/{visions-cli-DUZnopGY.js → visions-cli-CT5rjiwf.js} +1 -1
- package/dist/chunks/{visions-setup-C_kJobsy.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/{rtk-relay.js → hook-tool-relay.js} +32 -15
- 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 +5 -1
- package/dist/chunks/agent-api-cli-ClOzm28U.js +0 -71
- package/dist/chunks/config-store-DtUGwi4-.js +0 -2
- package/dist/chunks/ingest-core-DWI1Mbu4.js +0 -342
- package/dist/chunks/rtk-hook-core-DRYrKwYP.js +0 -26
- package/dist/chunks/rtk-resolver-DDVVNRBT.js +0 -2
- package/dist/chunks/rtk-resolver-oGmO-ew7.js +0 -58
- package/dist/client/assets/index-BTwYgSAH.js +0 -248
- package/dist/client/assets/index-DgA708PE.css +0 -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,28 +437,32 @@ 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() : "";
|
|
444
|
+
const ownerLogin = typeof src.ownerLogin === "string" ? src.ownerLogin.trim().toLowerCase() : "";
|
|
448
445
|
if (!enabled) return {
|
|
449
446
|
enabled,
|
|
450
447
|
port,
|
|
451
448
|
publicHost,
|
|
452
|
-
allowedOrigins: []
|
|
449
|
+
allowedOrigins: [],
|
|
450
|
+
ownerLogin
|
|
453
451
|
};
|
|
454
452
|
const listed = Array.isArray(src.allowedOrigins) ? src.allowedOrigins.filter((o) => typeof o === "string" && o.trim() !== "").map((o) => o.trim()) : [];
|
|
455
453
|
if (listed.length === 0 && publicHost !== "") return {
|
|
456
454
|
enabled,
|
|
457
455
|
port,
|
|
458
456
|
publicHost,
|
|
459
|
-
allowedOrigins: [`https://${publicHost}`]
|
|
457
|
+
allowedOrigins: [`https://${publicHost}`],
|
|
458
|
+
ownerLogin
|
|
460
459
|
};
|
|
461
460
|
return {
|
|
462
461
|
enabled,
|
|
463
462
|
port,
|
|
464
463
|
publicHost,
|
|
465
|
-
allowedOrigins: listed
|
|
464
|
+
allowedOrigins: listed,
|
|
465
|
+
ownerLogin
|
|
466
466
|
};
|
|
467
467
|
}
|
|
468
468
|
function validateRemoteConfig(remote, localPort) {
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
2
|
+
//#region session/core/sane-yolo.ts
|
|
3
|
+
var SANE_YOLO_PATH_ENV = "GLIMMERVOID_SANE_YOLO_PATH";
|
|
4
|
+
var SANE_YOLO_POLICY = {
|
|
5
|
+
version: 1,
|
|
6
|
+
destructive_command_protection: {
|
|
7
|
+
enabled: true,
|
|
8
|
+
overrides: {
|
|
9
|
+
"git.branch-force-delete": "off",
|
|
10
|
+
"git.merge-abort": "off",
|
|
11
|
+
"git.rebase-abort": "off",
|
|
12
|
+
"rm.recursive-force-dynamic-target": "on"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
secret_protection: { enabled: false }
|
|
16
|
+
};
|
|
17
|
+
var SANE_YOLO_RULES = {
|
|
18
|
+
version: 1,
|
|
19
|
+
rules: ["infra"],
|
|
20
|
+
overrides: {},
|
|
21
|
+
transparent_wrappers: ["rtk", "npx"]
|
|
22
|
+
};
|
|
23
|
+
var INFRA_REASON = "Sane YOLO blocks infrastructure teardown; run this command by hand.";
|
|
24
|
+
var TERRAFORM_DESTROY_FLAGS = [
|
|
25
|
+
"-destroy",
|
|
26
|
+
"--destroy",
|
|
27
|
+
"-destroy=true",
|
|
28
|
+
"--destroy=true"
|
|
29
|
+
];
|
|
30
|
+
var SANE_YOLO_FILES = {
|
|
31
|
+
"policy.json": SANE_YOLO_POLICY,
|
|
32
|
+
"rules/rule.json": SANE_YOLO_RULES,
|
|
33
|
+
"rules/infra/rulebook.json": {
|
|
34
|
+
rulebook_version: 1,
|
|
35
|
+
name: "infra",
|
|
36
|
+
version: "1.1.0",
|
|
37
|
+
allowed_commands: [
|
|
38
|
+
"terraform",
|
|
39
|
+
"tofu",
|
|
40
|
+
"pulumi",
|
|
41
|
+
"kubectl"
|
|
42
|
+
],
|
|
43
|
+
rules: [
|
|
44
|
+
{
|
|
45
|
+
name: "terraform-destroy",
|
|
46
|
+
command: "terraform",
|
|
47
|
+
subcommand: "destroy",
|
|
48
|
+
block_args: ["destroy"],
|
|
49
|
+
reason: INFRA_REASON
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "terraform-apply-destroy",
|
|
53
|
+
command: "terraform",
|
|
54
|
+
subcommand: "apply",
|
|
55
|
+
block_args: TERRAFORM_DESTROY_FLAGS,
|
|
56
|
+
reason: INFRA_REASON
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "tofu-destroy",
|
|
60
|
+
command: "tofu",
|
|
61
|
+
subcommand: "destroy",
|
|
62
|
+
block_args: ["destroy"],
|
|
63
|
+
reason: INFRA_REASON
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "tofu-apply-destroy",
|
|
67
|
+
command: "tofu",
|
|
68
|
+
subcommand: "apply",
|
|
69
|
+
block_args: TERRAFORM_DESTROY_FLAGS,
|
|
70
|
+
reason: INFRA_REASON
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "pulumi-destroy",
|
|
74
|
+
command: "pulumi",
|
|
75
|
+
subcommand: "destroy",
|
|
76
|
+
block_args: ["destroy"],
|
|
77
|
+
reason: INFRA_REASON
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "pulumi-down",
|
|
81
|
+
command: "pulumi",
|
|
82
|
+
subcommand: "down",
|
|
83
|
+
block_args: ["down"],
|
|
84
|
+
reason: INFRA_REASON
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "kubectl-delete-namespace",
|
|
88
|
+
command: "kubectl",
|
|
89
|
+
subcommand: "delete",
|
|
90
|
+
block_args: [
|
|
91
|
+
"ns",
|
|
92
|
+
"namespace",
|
|
93
|
+
"namespaces"
|
|
94
|
+
],
|
|
95
|
+
reason: INFRA_REASON
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function saneYoloEnv(homeDir) {
|
|
101
|
+
return {
|
|
102
|
+
CC_SAFETY_NET_HOME: homeDir,
|
|
103
|
+
CC_SAFETY_NET_PROJECT_TIGHTEN_ONLY: "1",
|
|
104
|
+
CC_SAFETY_NET_AUDIT_HOME: homeDir,
|
|
105
|
+
CC_SAFETY_NET_AUDIT_SCOPE: "blocked"
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region session/core/rtk-hook-core.ts
|
|
110
|
+
var RTK_PATH_ENV = "GLIMMERVOID_RTK_PATH";
|
|
111
|
+
var MAX_RTK_STDOUT_BYTES = 65536;
|
|
112
|
+
function normalizeRtkHookResponse(stdoutText) {
|
|
113
|
+
if (typeof stdoutText !== "string") return "";
|
|
114
|
+
const trimmed = stdoutText.trim();
|
|
115
|
+
if (!trimmed) return "";
|
|
116
|
+
if (Buffer.byteLength(trimmed) > 65536) return "";
|
|
117
|
+
let parsed = null;
|
|
118
|
+
try {
|
|
119
|
+
parsed = JSON.parse(trimmed);
|
|
120
|
+
} catch {
|
|
121
|
+
return "";
|
|
122
|
+
}
|
|
123
|
+
if (!isRecord(parsed)) return "";
|
|
124
|
+
const hookSpecificOutput = parsed.hookSpecificOutput;
|
|
125
|
+
if (isRecord(hookSpecificOutput) && isRecord(hookSpecificOutput.updatedInput)) {
|
|
126
|
+
if (typeof hookSpecificOutput.permissionDecision !== "string") hookSpecificOutput.permissionDecision = "allow";
|
|
127
|
+
}
|
|
128
|
+
return JSON.stringify(parsed);
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { SANE_YOLO_PATH_ENV as a, SANE_YOLO_FILES as i, RTK_PATH_ENV as n, saneYoloEnv as o, normalizeRtkHookResponse as r, MAX_RTK_STDOUT_BYTES as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { i as execSync } from "./child-process-safe-Ch-Zgxqs.js";
|
|
2
|
+
import { n as glimmervoidHomeDir } from "./config-path-core-DFt-TemS.js";
|
|
3
|
+
import { r as resolveRtkPath } from "./hook-tools-UX2fmt81.js";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import os from "node:os";
|
|
6
|
+
//#region server/rtk-resolver.ts
|
|
7
|
+
function resolveRtkPathFromSystem() {
|
|
8
|
+
return resolveRtkPath({
|
|
9
|
+
glimmervoidHome: glimmervoidHomeDir(os.homedir(), process.env),
|
|
10
|
+
platform: process.platform,
|
|
11
|
+
exec: execSync,
|
|
12
|
+
fsApi: fs
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
var cachedRtkPath = null;
|
|
16
|
+
function getRtkPath(resolve = resolveRtkPathFromSystem) {
|
|
17
|
+
if (!cachedRtkPath) cachedRtkPath = resolve();
|
|
18
|
+
return cachedRtkPath;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { getRtkPath as t };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { a as isPathInside } from "./paths-CeJl2Vcg.js";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
1
3
|
import fs from "node:fs";
|
|
2
4
|
import path from "node:path";
|
|
3
5
|
import { fileURLToPath } from "node:url";
|
|
4
6
|
//#region server/core/runtime-paths.ts
|
|
5
|
-
function isUnder(candidate, parent) {
|
|
6
|
-
const relative = path.relative(parent, candidate);
|
|
7
|
-
if (relative === "" || relative.startsWith("..")) return false;
|
|
8
|
-
return !path.isAbsolute(relative);
|
|
9
|
-
}
|
|
10
7
|
function findPackageRoot(startDirectory, hasPackageJson) {
|
|
11
8
|
let directory = startDirectory;
|
|
12
9
|
for (;;) {
|
|
@@ -19,7 +16,7 @@ function findPackageRoot(startDirectory, hasPackageJson) {
|
|
|
19
16
|
function computeRuntimePaths({ moduleFile, hasPackageJson }) {
|
|
20
17
|
const packageRoot = findPackageRoot(path.dirname(path.resolve(moduleFile)), hasPackageJson);
|
|
21
18
|
const distDir = path.join(packageRoot, "dist");
|
|
22
|
-
const bundled =
|
|
19
|
+
const bundled = isPathInside(distDir, path.resolve(moduleFile), { allowEqual: false });
|
|
23
20
|
const assetRoot = bundled ? distDir : packageRoot;
|
|
24
21
|
const sourceExtension = bundled ? ".js" : ".ts";
|
|
25
22
|
return {
|
|
@@ -43,9 +40,32 @@ function hasPackageManifest(directory) {
|
|
|
43
40
|
return false;
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
|
-
var
|
|
43
|
+
var runtimePaths = computeRuntimePaths({
|
|
47
44
|
moduleFile: fileURLToPath(import.meta.url),
|
|
48
45
|
hasPackageJson: hasPackageManifest
|
|
49
46
|
});
|
|
47
|
+
var { assetRoot, bundled, cliPath, clientDir, extensionDir, packageRoot, relayPath } = runtimePaths;
|
|
48
|
+
var packageBins = /* @__PURE__ */ new Map();
|
|
49
|
+
function resolvePackageBin(packageName, binName) {
|
|
50
|
+
const cacheKey = `${packageName}:${binName}`;
|
|
51
|
+
if (packageBins.has(cacheKey)) return packageBins.get(cacheKey) ?? null;
|
|
52
|
+
const resolvedBin = readPackageBin(packageName, binName);
|
|
53
|
+
packageBins.set(cacheKey, resolvedBin);
|
|
54
|
+
return resolvedBin;
|
|
55
|
+
}
|
|
56
|
+
function readPackageBin(packageName, binName) {
|
|
57
|
+
try {
|
|
58
|
+
const manifestPath = createRequire(path.join(packageRoot, "package.json")).resolve(`${packageName}/package.json`);
|
|
59
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
60
|
+
if (!manifest || typeof manifest !== "object" || !("bin" in manifest)) return null;
|
|
61
|
+
const bins = manifest.bin;
|
|
62
|
+
const relativeBin = typeof bins === "string" ? bins : bins && typeof bins === "object" ? Reflect.get(bins, binName) : null;
|
|
63
|
+
if (typeof relativeBin !== "string") return null;
|
|
64
|
+
const binPath = path.join(path.dirname(manifestPath), relativeBin);
|
|
65
|
+
return fs.statSync(binPath).isFile() ? binPath : null;
|
|
66
|
+
} catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
50
70
|
//#endregion
|
|
51
|
-
export { packageRoot as a, extensionDir as i, cliPath as n, relayPath as o, clientDir as r, bundled as t };
|
|
71
|
+
export { packageRoot as a, runtimePaths as c, extensionDir as i, cliPath as n, relayPath as o, clientDir as r, resolvePackageBin as s, bundled as t };
|
|
@@ -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 };
|
|
@@ -81,6 +81,7 @@ function toolDetailLine(toolName, toolInput) {
|
|
|
81
81
|
var TASK_TITLE_CONTROL_CHARACTERS = /[\x00-\x1f\x7f-\x9f]/;
|
|
82
82
|
var PROMPT_DETAIL_HIDDEN_CHARACTERS = new RegExp(`${TASK_TITLE_CONTROL_CHARACTERS.source}|[\\p{Cf}\\u2028\\u2029]`, "u");
|
|
83
83
|
var TaskTitle = z.string().refine((title) => !TASK_TITLE_CONTROL_CHARACTERS.test(title)).trim().max(120);
|
|
84
|
+
var RefinedTaskTitle = z.object({ title: z.string().nullable() }).strict();
|
|
84
85
|
var SessionState = z.enum(STATES);
|
|
85
86
|
var PendingWakeup = z.object({
|
|
86
87
|
at: z.number().finite().nullable(),
|
|
@@ -111,12 +112,14 @@ var SessionSnapshot = z.object({
|
|
|
111
112
|
stateSince: z.number(),
|
|
112
113
|
sleeping: z.boolean(),
|
|
113
114
|
dangerouslySkipPermissions: z.boolean(),
|
|
115
|
+
saneYolo: z.boolean().default(false),
|
|
114
116
|
ephemeral: z.boolean(),
|
|
115
117
|
isWorktree: z.boolean(),
|
|
116
118
|
isWorkspace: z.boolean().default(false),
|
|
117
119
|
resumeSessionId: z.string().nullable(),
|
|
118
120
|
activeAgents: z.number().int().nonnegative(),
|
|
119
121
|
awaitingBackgroundTasks: z.boolean(),
|
|
122
|
+
isCompacting: z.boolean().default(false),
|
|
120
123
|
hasEndedTurn: z.boolean().default(false),
|
|
121
124
|
pendingWakeup: PendingWakeup.nullable(),
|
|
122
125
|
pendingPromptKind: z.string().nullable(),
|
|
@@ -136,7 +139,8 @@ var AGENT_URL_ENV = "GLIMMERVOID_AGENT_URL";
|
|
|
136
139
|
var AGENT_API_VERBS = [
|
|
137
140
|
"spawn",
|
|
138
141
|
"attention",
|
|
139
|
-
"board"
|
|
142
|
+
"board",
|
|
143
|
+
"dispatch"
|
|
140
144
|
];
|
|
141
145
|
var AgentSpawnRequest = z.object({
|
|
142
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" }),
|
|
@@ -158,5 +162,9 @@ z.object({
|
|
|
158
162
|
state: SessionSnapshot.shape.state,
|
|
159
163
|
ephemeral: SessionSnapshot.shape.ephemeral
|
|
160
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");
|
|
161
169
|
//#endregion
|
|
162
|
-
export {
|
|
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) {
|