glimmervoid 0.0.0-stage → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +48 -0
- package/README.md +195 -2
- package/dist/bin/glimmervoid.js +275 -0
- package/dist/chunks/adapters-Dho1VSY5.js +2 -0
- package/dist/chunks/adapters-zPDx1Xox.js +575 -0
- package/dist/chunks/agent-api-cli-D0MmtEdz.js +71 -0
- package/dist/chunks/agent-api-core-Dz0r21y9.js +103 -0
- package/dist/chunks/agent-setup-cli-B5Atxr3F.js +139 -0
- package/dist/chunks/ascii-figure-core-pDAwtlKO.js +45 -0
- package/dist/chunks/child-process-safe-DRGsp0TE.js +69 -0
- package/dist/chunks/child-process-safe-DvQjXsgz.js +2 -0
- package/dist/chunks/config-path-core-DFt-TemS.js +38 -0
- package/dist/chunks/config-store-CC8T3okC.js +2 -0
- package/dist/chunks/config-store-mm7MgzoL.js +1412 -0
- package/dist/chunks/contracts-DGkKNh9W.js +3020 -0
- package/dist/chunks/grok-DuU8xVLZ.js +436 -0
- package/dist/chunks/hook-command-core-DclEoE9e.js +14 -0
- package/dist/chunks/hook-relay-core-BHfYFnYV.js +88 -0
- package/dist/chunks/hook-tools-pSJia7ks.js +74 -0
- package/dist/chunks/ingest-core-DWI1Mbu4.js +342 -0
- package/dist/chunks/ingest-editor-core-BuI1gMF_.js +445 -0
- package/dist/chunks/loopback-post-C7C22eYi.js +79 -0
- package/dist/chunks/main-CuIZQPhZ.js +43559 -0
- package/dist/chunks/node-pty-preflight-CK1knGIR.js +162 -0
- package/dist/chunks/pair-cli-w-gCAF-1.js +110 -0
- package/dist/chunks/path-doctor-C23VAqeu.js +63 -0
- package/dist/chunks/refocus-core-BKQKllq7.js +38 -0
- package/dist/chunks/relay-stdin-CpHvLu6M.js +20 -0
- package/dist/chunks/remote-config-C2ytQwrs.js +525 -0
- package/dist/chunks/rtk-hook-core-Bl6gYHPN.js +133 -0
- package/dist/chunks/rtk-resolver-CLo-gZzw.js +21 -0
- package/dist/chunks/rtk-resolver-CMQAidlI.js +2 -0
- package/dist/chunks/runtime-paths-Ci_ksSkj.js +75 -0
- package/dist/chunks/runtime-paths-JLrZ3wyi.js +2 -0
- package/dist/chunks/sandbox-deps-Dd5-kZnf.js +67 -0
- package/dist/chunks/session-Cez8aIWg.js +164 -0
- package/dist/chunks/spawn-command-Cc40FiZI.js +134 -0
- package/dist/chunks/visions-cli-BXQFIBCX.js +98 -0
- package/dist/chunks/visions-setup-CvVnOe1r.js +1753 -0
- package/dist/client/assets/favicon-CKygeLwW.svg +7 -0
- package/dist/client/assets/index-B1MFijjb.css +1 -0
- package/dist/client/assets/index-CU1iPPdn.js +249 -0
- package/dist/client/index.html +108 -0
- package/dist/package.json +3 -0
- package/dist/scripts/postinstall-path-check.js +36 -0
- package/dist/server/index.js +92 -0
- package/dist/session/command-hook-relay.js +16 -0
- package/dist/session/hook-relay.js +24 -0
- package/dist/session/hook-tool-relay.js +107 -0
- package/dist/session/statusline-relay.js +82 -0
- package/dist/session/visions-relay.js +627 -0
- package/dist/tools/vscode-visions/extension.js +289 -0
- package/dist/tools/vscode-visions/lsp-convert.js +80 -0
- package/dist/tools/vscode-visions/package.json +32 -0
- package/dist/tools/vscode-visions/visions-lsp-core.js +112 -0
- package/package.json +96 -4
- package/scripts/postinstall.mjs +4 -0
- package/scripts/prepare-build.js +38 -0
- package/scripts/recover-handoff.mjs +82 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const PREVIOUS_DIST_BACKUP_NAME = 'prev-dist';
|
|
6
|
+
const PREVIOUS_DEPENDENCIES_BACKUP_NAME = 'prev-node_modules';
|
|
7
|
+
const QUARANTINE_NAME_PREFIX = 'broken-';
|
|
8
|
+
|
|
9
|
+
function isRestoreEntry(entry) {
|
|
10
|
+
if (!entry || typeof entry !== 'object') return false;
|
|
11
|
+
if (typeof entry.from !== 'string') return false;
|
|
12
|
+
if (entry.to !== 'dist' && entry.to !== 'node_modules') return false;
|
|
13
|
+
if (!entry.from || path.dirname(entry.from) !== '.') return false;
|
|
14
|
+
return entry.from !== '.' && entry.from !== '..';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function restore(updatePath, root, fromName, toName) {
|
|
18
|
+
const sourcePath = path.join(updatePath, fromName);
|
|
19
|
+
const targetPath = path.join(root, toName);
|
|
20
|
+
if (fs.existsSync(targetPath) || !fs.existsSync(sourcePath)) return;
|
|
21
|
+
fs.renameSync(sourcePath, targetPath);
|
|
22
|
+
console.log(`restored ${fromName} to ${toName}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function restoreOverBrokenTarget(updatePath, root, fromName, toName) {
|
|
26
|
+
const sourcePath = path.join(updatePath, fromName);
|
|
27
|
+
const targetPath = path.join(root, toName);
|
|
28
|
+
if (!fs.existsSync(sourcePath)) return fs.existsSync(targetPath);
|
|
29
|
+
if (fs.existsSync(targetPath)) {
|
|
30
|
+
const quarantinePath = path.join(updatePath, `${QUARANTINE_NAME_PREFIX}${toName}`);
|
|
31
|
+
fs.rmSync(quarantinePath, { recursive: true, force: true });
|
|
32
|
+
fs.renameSync(targetPath, quarantinePath);
|
|
33
|
+
console.log(`quarantined ${toName} as ${QUARANTINE_NAME_PREFIX}${toName}`);
|
|
34
|
+
}
|
|
35
|
+
fs.renameSync(sourcePath, targetPath);
|
|
36
|
+
console.log(`restored ${fromName} to ${toName}`);
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function restoreEverythingHandedOff(root) {
|
|
41
|
+
const updatePath = path.join(root, '.glimmervoid', 'update');
|
|
42
|
+
restore(updatePath, root, PREVIOUS_DEPENDENCIES_BACKUP_NAME, 'node_modules');
|
|
43
|
+
restore(updatePath, root, PREVIOUS_DIST_BACKUP_NAME, 'dist');
|
|
44
|
+
|
|
45
|
+
const markerPath = path.join(updatePath, 'restore.json');
|
|
46
|
+
if (!fs.existsSync(markerPath)) return;
|
|
47
|
+
const marker = JSON.parse(fs.readFileSync(markerPath, 'utf8'));
|
|
48
|
+
const entries = Array.isArray(marker?.restore) ? marker.restore : [];
|
|
49
|
+
let everyEntryApplied = true;
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
if (!isRestoreEntry(entry)) continue;
|
|
52
|
+
if (restoreOverBrokenTarget(updatePath, root, entry.from, entry.to)) continue;
|
|
53
|
+
everyEntryApplied = false;
|
|
54
|
+
console.log(`could not restore ${entry.from} to ${entry.to}`);
|
|
55
|
+
}
|
|
56
|
+
if (!everyEntryApplied) return;
|
|
57
|
+
fs.rmSync(markerPath, { force: true });
|
|
58
|
+
console.log('removed restore marker');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function recoverHandoff(root) {
|
|
62
|
+
try {
|
|
63
|
+
restoreEverythingHandedOff(root);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
66
|
+
console.log(`handoff recovery could not finish: ${message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function wasRunAsTheRecoveryScript() {
|
|
71
|
+
const entryPath = process.argv[1];
|
|
72
|
+
if (!entryPath) return false;
|
|
73
|
+
if (path.basename(entryPath) !== 'recover-handoff.mjs') return false;
|
|
74
|
+
return pathToFileURL(entryPath).href === import.meta.url;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (wasRunAsTheRecoveryScript()) {
|
|
78
|
+
recoverHandoff(path.resolve(process.argv[2] || path.join(import.meta.dirname, '..')));
|
|
79
|
+
process.exitCode = 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { PREVIOUS_DEPENDENCIES_BACKUP_NAME, PREVIOUS_DIST_BACKUP_NAME, recoverHandoff };
|