@su-record/vibe 4.2.34 → 4.2.36
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/dist/cli/common.js +4 -1
- package/dist/cli/common.js.map +1 -1
- package/dist/cli/heldout.js +10 -4
- package/dist/cli/heldout.js.map +1 -1
- package/dist/cli/human.js +8 -4
- package/dist/cli/human.js.map +1 -1
- package/dist/cli/internal.js +37 -24
- package/dist/cli/internal.js.map +1 -1
- package/dist/cli/ledger.js +67 -0
- package/dist/cli/ledger.js.map +1 -0
- package/dist/cli/map.js +5 -3
- package/dist/cli/map.js.map +1 -1
- package/dist/cli/memory.js +104 -74
- package/dist/cli/memory.js.map +1 -1
- package/dist/cli/risks.js +20 -3
- package/dist/cli/risks.js.map +1 -1
- package/dist/cli/session.js +4 -2
- package/dist/cli/session.js.map +1 -1
- package/dist/cli/setup.js +44 -13
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/verification.js +1 -1
- package/dist/cli/verification.js.map +1 -1
- package/dist/cli/work.js +75 -22
- package/dist/cli/work.js.map +1 -1
- package/dist/cli.js +18 -6
- package/dist/cli.js.map +1 -1
- package/dist/core/analyze.js +21 -7
- package/dist/core/analyze.js.map +1 -1
- package/dist/core/artifact-paths.js +14 -3
- package/dist/core/artifact-paths.js.map +1 -1
- package/dist/core/capabilities.js +69 -15
- package/dist/core/capabilities.js.map +1 -1
- package/dist/core/check-authorization.js +37 -0
- package/dist/core/check-authorization.js.map +1 -0
- package/dist/core/check-process.js +12 -4
- package/dist/core/check-process.js.map +1 -1
- package/dist/core/check-report.js +66 -0
- package/dist/core/check-report.js.map +1 -0
- package/dist/core/check-selection.js +4 -2
- package/dist/core/check-selection.js.map +1 -1
- package/dist/core/check.js +66 -130
- package/dist/core/check.js.map +1 -1
- package/dist/core/checks/changed.js +20 -6
- package/dist/core/checks/changed.js.map +1 -1
- package/dist/core/checks/eval.js +35 -10
- package/dist/core/checks/eval.js.map +1 -1
- package/dist/core/checks/file.js +26 -23
- package/dist/core/checks/file.js.map +1 -1
- package/dist/core/checks/fileRules.js +42 -16
- package/dist/core/checks/fileRules.js.map +1 -1
- package/dist/core/checks/http.js +35 -34
- package/dist/core/checks/http.js.map +1 -1
- package/dist/core/checks/packs.js +1 -1
- package/dist/core/checks/packs.js.map +1 -1
- package/dist/core/checks/review.js +75 -40
- package/dist/core/checks/review.js.map +1 -1
- package/dist/core/checks/run.js +5 -2
- package/dist/core/checks/run.js.map +1 -1
- package/dist/core/checks/schema.js +25 -0
- package/dist/core/checks/schema.js.map +1 -0
- package/dist/core/checks/source.js +11 -6
- package/dist/core/checks/source.js.map +1 -1
- package/dist/core/config.js +9 -2
- package/dist/core/config.js.map +1 -1
- package/dist/core/consent.js +24 -16
- package/dist/core/consent.js.map +1 -1
- package/dist/core/context-notes.js +15 -7
- package/dist/core/context-notes.js.map +1 -1
- package/dist/core/context.js +24 -12
- package/dist/core/context.js.map +1 -1
- package/dist/core/conventions.js +22 -9
- package/dist/core/conventions.js.map +1 -1
- package/dist/core/docs/cfb.js +81 -45
- package/dist/core/docs/cfb.js.map +1 -1
- package/dist/core/docs/html.js +14 -3
- package/dist/core/docs/html.js.map +1 -1
- package/dist/core/docs/hwp.js +44 -22
- package/dist/core/docs/hwp.js.map +1 -1
- package/dist/core/docs/office.js +20 -10
- package/dist/core/docs/office.js.map +1 -1
- package/dist/core/docs/pdf.js +10 -4
- package/dist/core/docs/pdf.js.map +1 -1
- package/dist/core/docs/read.js +32 -24
- package/dist/core/docs/read.js.map +1 -1
- package/dist/core/docs/zip.js +32 -15
- package/dist/core/docs/zip.js.map +1 -1
- package/dist/core/evidence.js +17 -7
- package/dist/core/evidence.js.map +1 -1
- package/dist/core/failure-message.js +35 -13
- package/dist/core/failure-message.js.map +1 -1
- package/dist/core/failure.js +49 -14
- package/dist/core/failure.js.map +1 -1
- package/dist/core/github.js +3 -1
- package/dist/core/github.js.map +1 -1
- package/dist/core/handoff.js +20 -7
- package/dist/core/handoff.js.map +1 -1
- package/dist/core/heldout-run.js +6 -3
- package/dist/core/heldout-run.js.map +1 -1
- package/dist/core/heldout.js +24 -13
- package/dist/core/heldout.js.map +1 -1
- package/dist/core/inbox.js +3 -1
- package/dist/core/inbox.js.map +1 -1
- package/dist/core/inputs.js +76 -0
- package/dist/core/inputs.js.map +1 -0
- package/dist/core/inspect.js +61 -20
- package/dist/core/inspect.js.map +1 -1
- package/dist/core/intent.js +50 -12
- package/dist/core/intent.js.map +1 -1
- package/dist/core/knowledge-find.js +31 -12
- package/dist/core/knowledge-find.js.map +1 -1
- package/dist/core/knowledge.js +22 -12
- package/dist/core/knowledge.js.map +1 -1
- package/dist/core/lang.js +5 -2
- package/dist/core/lang.js.map +1 -1
- package/dist/core/ledger.js +44 -20
- package/dist/core/ledger.js.map +1 -1
- package/dist/core/locations.js +12 -0
- package/dist/core/locations.js.map +1 -0
- package/dist/core/map/imports.js +20 -9
- package/dist/core/map/imports.js.map +1 -1
- package/dist/core/map/index.js +28 -13
- package/dist/core/map/index.js.map +1 -1
- package/dist/core/map/symbols.js +27 -12
- package/dist/core/map/symbols.js.map +1 -1
- package/dist/core/output-capture.js +7 -4
- package/dist/core/output-capture.js.map +1 -1
- package/dist/core/paths.js +2 -1
- package/dist/core/paths.js.map +1 -1
- package/dist/core/performance.js +43 -17
- package/dist/core/performance.js.map +1 -1
- package/dist/core/profile.js +6 -3
- package/dist/core/profile.js.map +1 -1
- package/dist/core/reader.js +32 -16
- package/dist/core/reader.js.map +1 -1
- package/dist/core/readerSession.js +34 -14
- package/dist/core/readerSession.js.map +1 -1
- package/dist/core/recent.js +20 -6
- package/dist/core/recent.js.map +1 -1
- package/dist/core/regress.js +21 -12
- package/dist/core/regress.js.map +1 -1
- package/dist/core/repair.js +22 -4
- package/dist/core/repair.js.map +1 -1
- package/dist/core/research-queries.js +85 -0
- package/dist/core/research-queries.js.map +1 -0
- package/dist/core/research.js +89 -88
- package/dist/core/research.js.map +1 -1
- package/dist/core/results.js +89 -0
- package/dist/core/results.js.map +1 -0
- package/dist/core/risk-signals.js +55 -16
- package/dist/core/risk-signals.js.map +1 -1
- package/dist/core/run-id.js +10 -6
- package/dist/core/run-id.js.map +1 -1
- package/dist/core/scenarios.js +97 -57
- package/dist/core/scenarios.js.map +1 -1
- package/dist/core/session.js +3 -2
- package/dist/core/session.js.map +1 -1
- package/dist/core/size-gate.js +57 -0
- package/dist/core/size-gate.js.map +1 -0
- package/dist/core/size.js +32 -10
- package/dist/core/size.js.map +1 -1
- package/dist/core/skills.js +66 -28
- package/dist/core/skills.js.map +1 -1
- package/dist/core/skillsmp.js +26 -12
- package/dist/core/skillsmp.js.map +1 -1
- package/dist/core/source-basis.js +21 -9
- package/dist/core/source-basis.js.map +1 -1
- package/dist/core/status.js +26 -13
- package/dist/core/status.js.map +1 -1
- package/dist/core/table.js +8 -1
- package/dist/core/table.js.map +1 -1
- package/dist/core/tokens.js +20 -10
- package/dist/core/tokens.js.map +1 -1
- package/dist/core/tree.js +26 -16
- package/dist/core/tree.js.map +1 -1
- package/dist/core/verification-plan.js +26 -10
- package/dist/core/verification-plan.js.map +1 -1
- package/dist/core/verification.js +14 -7
- package/dist/core/verification.js.map +1 -1
- package/dist/core/view.js +93 -44
- package/dist/core/view.js.map +1 -1
- package/dist/install/global.js +37 -18
- package/dist/install/global.js.map +1 -1
- package/dist/install/hooks.js +17 -8
- package/dist/install/hooks.js.map +1 -1
- package/dist/install/manifest.js +11 -0
- package/dist/install/manifest.js.map +1 -0
- package/dist/install/mcpb.js +52 -23
- package/dist/install/mcpb.js.map +1 -1
- package/dist/install/plugin.js +73 -33
- package/dist/install/plugin.js.map +1 -1
- package/dist/install/project.js +8 -7
- package/dist/install/project.js.map +1 -1
- package/dist/install/register.js +83 -48
- package/dist/install/register.js.map +1 -1
- package/dist/install/tree.js +27 -11
- package/dist/install/tree.js.map +1 -1
- package/dist/install/update.js +46 -20
- package/dist/install/update.js.map +1 -1
- package/hooks/code-map.cjs +22 -9
- package/hooks/file-size.cjs +83 -0
- package/hooks/journal.cjs +28 -18
- package/hooks/knowledge-auto.cjs +55 -21
- package/hooks/knowledge-journal.cjs +47 -20
- package/hooks/knowledge-projects.cjs +50 -21
- package/hooks/knowledge-recall.cjs +16 -6
- package/hooks/knowledge-upkeep.cjs +22 -5
- package/hooks/locations.cjs +35 -0
- package/hooks/notify.js +52 -24
- package/hooks/obsidian.cjs +17 -7
- package/hooks/private-store.cjs +25 -10
- package/hooks/retest.cjs +39 -16
- package/hooks/session-context.cjs +30 -13
- package/hooks/session-files.cjs +44 -21
- package/hooks/session-repair.cjs +26 -11
- package/hooks/session-state.cjs +78 -38
- package/hooks/session.js +19 -8
- package/hooks/slice-command.cjs +38 -17
- package/hooks/slice-guard.cjs +20 -6
- package/hooks/slice-store.cjs +25 -12
- package/internal/guides/code.md +17 -0
- package/mcpb/server/index.js +40 -12
- package/package.json +1 -1
package/dist/install/plugin.js
CHANGED
|
@@ -3,7 +3,10 @@ import os from 'node:os';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { packageRoot } from '../core/paths.js';
|
|
5
5
|
import { ensureDir, readJson, writeAtomic, writeJson } from '../core/store.js';
|
|
6
|
-
import {
|
|
6
|
+
import { packageVersion } from './manifest.js';
|
|
7
|
+
import { CODEX_HOOKS_FILE, CODEX_MANIFEST_FILE, MARKETPLACE_NAME, PLUGIN_NAME, pluginTree } from './tree.js';
|
|
8
|
+
export { MARKETPLACE_NAME };
|
|
9
|
+
import { vibeConfig, FOLDERS, AGENTS_DIR } from '../core/locations.js';
|
|
7
10
|
/**
|
|
8
11
|
* OpenAI plugin for Codex CLI and ChatGPT desktop — one tree, one personal marketplace.
|
|
9
12
|
*
|
|
@@ -11,25 +14,55 @@ import { pluginTree } from './tree.js';
|
|
|
11
14
|
* 300MB into the Codex cache because the whole package was the plugin; here the plugin is only the
|
|
12
15
|
* manifest, the single entry skill and the notification hooks.
|
|
13
16
|
*/
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
+
const MARKETPLACE_DISPLAY_NAME = 'Vibe (local)';
|
|
18
|
+
const SKILL_NAMES = [PLUGIN_NAME];
|
|
19
|
+
const SKILLS_DIR = 'skills';
|
|
20
|
+
const CARD_FILE = 'card.md';
|
|
21
|
+
const TREE_PACKAGE_JSON = 'package.json';
|
|
22
|
+
const README_FILE = 'README.md';
|
|
23
|
+
const LEGACY_STORE_DIR = '.vibe';
|
|
24
|
+
const TREE_DIR = 'vibe';
|
|
25
|
+
const LANGUAGE_PACK_PREFIX = 'antislop-';
|
|
26
|
+
const HOOK_FILES = [
|
|
27
|
+
'notify.js',
|
|
28
|
+
'session.js',
|
|
29
|
+
'code-map.cjs',
|
|
30
|
+
'private-store.cjs',
|
|
31
|
+
'session-files.cjs',
|
|
32
|
+
'session-state.cjs',
|
|
33
|
+
'session-context.cjs',
|
|
34
|
+
'session-repair.cjs',
|
|
35
|
+
'knowledge-auto.cjs',
|
|
36
|
+
'knowledge-projects.cjs',
|
|
37
|
+
'knowledge-lint.cjs',
|
|
38
|
+
'knowledge-upkeep.cjs',
|
|
39
|
+
'knowledge-journal.cjs',
|
|
40
|
+
'knowledge-recall.cjs',
|
|
41
|
+
'file-size.cjs',
|
|
42
|
+
'locations.cjs',
|
|
43
|
+
'retest.cjs',
|
|
44
|
+
'journal.cjs',
|
|
45
|
+
'obsidian.cjs',
|
|
46
|
+
'slice-command.cjs',
|
|
47
|
+
'slice-store.cjs',
|
|
48
|
+
'slice-guard.cjs',
|
|
49
|
+
];
|
|
17
50
|
/** The tree lives under ~/.config/vibe so that `.vibe/` keeps one meaning: a project's records. ≤ 4.1.7 put it at ~/.vibe/plugin. */
|
|
18
51
|
export function pluginPaths(home = os.homedir()) {
|
|
19
52
|
return {
|
|
20
53
|
home,
|
|
21
|
-
tree:
|
|
22
|
-
marketplace: path.join(home,
|
|
54
|
+
tree: vibeConfig(home, FOLDERS.plugin, TREE_DIR),
|
|
55
|
+
marketplace: path.join(home, AGENTS_DIR, 'plugins', 'marketplace.json'),
|
|
23
56
|
};
|
|
24
57
|
}
|
|
25
58
|
/** Remove the ≤ 4.1.7 store at ~/.vibe/plugin, and ~/.vibe itself once empty, so the home never looks like a project. */
|
|
26
59
|
export function sweepLegacyPluginStore(home = os.homedir()) {
|
|
27
|
-
const legacy = path.join(home,
|
|
60
|
+
const legacy = path.join(home, LEGACY_STORE_DIR, 'plugin');
|
|
28
61
|
if (!fs.existsSync(legacy))
|
|
29
62
|
return [];
|
|
30
63
|
fs.rmSync(legacy, { recursive: true, force: true });
|
|
31
64
|
const removed = [legacy];
|
|
32
|
-
const dotVibe = path.join(home,
|
|
65
|
+
const dotVibe = path.join(home, LEGACY_STORE_DIR);
|
|
33
66
|
if (fs.readdirSync(dotVibe).length === 0) {
|
|
34
67
|
fs.rmSync(dotVibe, { recursive: true, force: true });
|
|
35
68
|
removed.push(dotVibe);
|
|
@@ -39,18 +72,24 @@ export function sweepLegacyPluginStore(home = os.homedir()) {
|
|
|
39
72
|
/** Internal legacy language packs: `skills/antislop-*`, each with `reviewers/<lang>/` prompts. */
|
|
40
73
|
export function languagePacks() {
|
|
41
74
|
const dir = path.join(packageRoot(), 'internal', 'skills');
|
|
42
|
-
return fs.existsSync(dir) ? fs.readdirSync(dir).filter((n) => n.startsWith(
|
|
43
|
-
}
|
|
44
|
-
function packageVersion() {
|
|
45
|
-
return readJson(path.join(packageRoot(), 'package.json'))?.version ?? '0.0.0';
|
|
75
|
+
return fs.existsSync(dir) ? fs.readdirSync(dir).filter((n) => n.startsWith(LANGUAGE_PACK_PREFIX)).sort() : [];
|
|
46
76
|
}
|
|
47
77
|
function copyHookAssets(tree) {
|
|
48
78
|
const files = HOOK_FILES.map(file => `hooks/${file}`);
|
|
49
|
-
files.push(
|
|
79
|
+
files.push(CARD_FILE);
|
|
50
80
|
for (const file of files)
|
|
51
81
|
fs.copyFileSync(path.join(packageRoot(), file), path.join(tree, file));
|
|
52
|
-
writeJson(path.join(tree,
|
|
53
|
-
return [...files,
|
|
82
|
+
writeJson(path.join(tree, TREE_PACKAGE_JSON), { private: true, type: 'module' });
|
|
83
|
+
return [...files, TREE_PACKAGE_JSON];
|
|
84
|
+
}
|
|
85
|
+
function treeReadme(version) {
|
|
86
|
+
return [
|
|
87
|
+
`# vibe ${version}`,
|
|
88
|
+
'',
|
|
89
|
+
'Assembled by `vibe plugin install`. Do not edit — rerun the command instead.',
|
|
90
|
+
'SessionStart and Stop use packaged status readers. Run `vibe session bind` in the intended worktree; completion requires an explicit `vibe check`.',
|
|
91
|
+
'',
|
|
92
|
+
].join('\n');
|
|
54
93
|
}
|
|
55
94
|
/** Rebuild the tree from scratch — a stale file in the cache is worse than a slow install. */
|
|
56
95
|
export function assemblePlugin(tree) {
|
|
@@ -59,35 +98,35 @@ export function assemblePlugin(tree) {
|
|
|
59
98
|
const written = [];
|
|
60
99
|
const version = packageVersion();
|
|
61
100
|
const generated = pluginTree();
|
|
62
|
-
writeAtomic(path.join(tree,
|
|
63
|
-
written.push(
|
|
101
|
+
writeAtomic(path.join(tree, CODEX_MANIFEST_FILE), generated[CODEX_MANIFEST_FILE]);
|
|
102
|
+
written.push(CODEX_MANIFEST_FILE);
|
|
64
103
|
for (const name of SKILL_NAMES) {
|
|
65
|
-
const from = path.join(packageRoot(),
|
|
104
|
+
const from = path.join(packageRoot(), SKILLS_DIR, name);
|
|
66
105
|
if (!fs.existsSync(from))
|
|
67
106
|
continue;
|
|
68
|
-
fs.cpSync(from, path.join(tree,
|
|
69
|
-
written.push(
|
|
107
|
+
fs.cpSync(from, path.join(tree, SKILLS_DIR, name), { recursive: true });
|
|
108
|
+
written.push(`${SKILLS_DIR}/${name}`);
|
|
70
109
|
}
|
|
71
|
-
writeAtomic(path.join(tree,
|
|
72
|
-
written.push(
|
|
110
|
+
writeAtomic(path.join(tree, CODEX_HOOKS_FILE), generated[CODEX_HOOKS_FILE]);
|
|
111
|
+
written.push(CODEX_HOOKS_FILE);
|
|
73
112
|
written.push(...copyHookAssets(tree));
|
|
74
|
-
fs.writeFileSync(path.join(tree,
|
|
75
|
-
written.push(
|
|
113
|
+
fs.writeFileSync(path.join(tree, README_FILE), treeReadme(version), 'utf-8');
|
|
114
|
+
written.push(README_FILE);
|
|
76
115
|
return written;
|
|
77
116
|
}
|
|
78
117
|
/** Register the tree in the personal marketplace Codex and ChatGPT desktop both read. Other plugins are kept. */
|
|
79
118
|
export function writeMarketplace(paths) {
|
|
80
119
|
const doc = readJson(paths.marketplace) ?? {};
|
|
81
120
|
doc.name ??= MARKETPLACE_NAME;
|
|
82
|
-
doc.interface ??= { displayName:
|
|
121
|
+
doc.interface ??= { displayName: MARKETPLACE_DISPLAY_NAME };
|
|
83
122
|
const plugins = Array.isArray(doc.plugins) ? doc.plugins : [];
|
|
84
123
|
const entry = {
|
|
85
|
-
name:
|
|
124
|
+
name: PLUGIN_NAME,
|
|
86
125
|
source: { source: 'local', path: `./${path.relative(paths.home, paths.tree).replace(/\\/g, '/')}` },
|
|
87
126
|
policy: { installation: 'AVAILABLE', authentication: 'ON_INSTALL' },
|
|
88
127
|
category: 'Developer Tools',
|
|
89
128
|
};
|
|
90
|
-
const index = plugins.findIndex((p) => p?.name ===
|
|
129
|
+
const index = plugins.findIndex((p) => p?.name === PLUGIN_NAME);
|
|
91
130
|
if (index === -1)
|
|
92
131
|
plugins.push(entry);
|
|
93
132
|
else
|
|
@@ -109,7 +148,7 @@ export function installPlugin(home) {
|
|
|
109
148
|
version: packageVersion(),
|
|
110
149
|
next: [
|
|
111
150
|
`codex plugin marketplace add ${paths.home}`,
|
|
112
|
-
`codex plugin add
|
|
151
|
+
`codex plugin add ${PLUGIN_NAME}@${marketplaceName}`,
|
|
113
152
|
'ChatGPT desktop reads the same marketplace file — restart the app to see the plugin',
|
|
114
153
|
],
|
|
115
154
|
};
|
|
@@ -122,12 +161,13 @@ function marketplaceTarget(paths, entry) {
|
|
|
122
161
|
export function pluginStatus(home) {
|
|
123
162
|
const paths = pluginPaths(home);
|
|
124
163
|
const exists = fs.existsSync(paths.tree);
|
|
125
|
-
const manifestVersion = readJson(path.join(paths.tree,
|
|
164
|
+
const manifestVersion = readJson(path.join(paths.tree, CODEX_MANIFEST_FILE))?.version ?? null;
|
|
126
165
|
const version = packageVersion();
|
|
127
|
-
const skillsDir = path.join(paths.tree,
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
const
|
|
166
|
+
const skillsDir = path.join(paths.tree, SKILLS_DIR);
|
|
167
|
+
const isSkill = (n) => n === PLUGIN_NAME || n.startsWith(`${PLUGIN_NAME}-`);
|
|
168
|
+
const skills = fs.existsSync(skillsDir) ? fs.readdirSync(skillsDir).filter(isSkill).length : 0;
|
|
169
|
+
const hooks = [path.basename(CODEX_HOOKS_FILE), ...HOOK_FILES].every(file => fs.existsSync(path.join(paths.tree, 'hooks', file)));
|
|
170
|
+
const entry = readJson(paths.marketplace)?.plugins?.find((p) => p?.name === PLUGIN_NAME);
|
|
131
171
|
const registered = entry !== undefined;
|
|
132
172
|
const pointsAt = marketplaceTarget(paths, entry);
|
|
133
173
|
const drift = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/install/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/install/plugin.ts"],"names":[],"mappings":"AAAA,OAA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UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1E,IAAI,UAAU,IAAI,QAAQ,KAAK,KAAK,CAAC,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,yBAAyB,QAAQ,IAAI,SAAS,EAAE,CAAC,CAAC;IACxG,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAClH,CAAC"}
|
package/dist/install/project.js
CHANGED
|
@@ -8,6 +8,12 @@ import { record } from '../core/ledger.js';
|
|
|
8
8
|
import { isProjectDir, projectBoundaries, vibePath } from '../core/paths.js';
|
|
9
9
|
import { emptyState, readState, statePath } from '../core/state.js';
|
|
10
10
|
import { ensureDir, writeAtomic, writeJson } from '../core/store.js';
|
|
11
|
+
const PROJECT_DIRS = ['', 'evidence', 'knowledge', 'knowledge/research', 'regressions'];
|
|
12
|
+
const PROJECT_SEEDS = [
|
|
13
|
+
['intent.md', ''],
|
|
14
|
+
['scenarios.yaml', '[]\n'],
|
|
15
|
+
['results.json', '{}\n'],
|
|
16
|
+
];
|
|
11
17
|
/**
|
|
12
18
|
* `.vibe/` is the only thing vibe puts inside a repository: the state that is also the handoff.
|
|
13
19
|
* There is no init command — the first command that writes a record creates it.
|
|
@@ -23,19 +29,14 @@ export function ensureProject(root) {
|
|
|
23
29
|
}
|
|
24
30
|
const fresh = !hasProject(root);
|
|
25
31
|
const created = [];
|
|
26
|
-
for (const dir of
|
|
32
|
+
for (const dir of PROJECT_DIRS) {
|
|
27
33
|
const target = vibePath(root, dir);
|
|
28
34
|
if (!fs.existsSync(target)) {
|
|
29
35
|
ensureDir(target);
|
|
30
36
|
created.push(path.relative(root, target));
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
|
-
const
|
|
34
|
-
['intent.md', ''],
|
|
35
|
-
['scenarios.yaml', '[]\n'],
|
|
36
|
-
['results.json', '{}\n'],
|
|
37
|
-
];
|
|
38
|
-
for (const [name, body] of seeds) {
|
|
39
|
+
for (const [name, body] of PROJECT_SEEDS) {
|
|
39
40
|
const target = vibePath(root, name);
|
|
40
41
|
if (!fs.existsSync(target)) {
|
|
41
42
|
writeAtomic(target, body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/install/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IAAI,iBAAiB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5E,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,C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B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAAE,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9E,IAAI,KAAK;QAAE,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;IACzF,OAAO,OAAO,CAAC;AACjB,CAAC;AASD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxH,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/install/register.js
CHANGED
|
@@ -4,39 +4,59 @@ import os from 'node:os';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { packageRoot } from '../core/paths.js';
|
|
6
6
|
import { readJson, writeJson } from '../core/store.js';
|
|
7
|
+
import { PACKAGE_MANIFEST, packageVersion } from './manifest.js';
|
|
7
8
|
import { installPlugin, MARKETPLACE_NAME, pluginPaths, pluginStatus } from './plugin.js';
|
|
9
|
+
import { CODEX_HOOKS_FILE, CODEX_MANIFEST_FILE, PLUGIN_NAME } from './tree.js';
|
|
8
10
|
import { newer } from './update.js';
|
|
11
|
+
import { claudeHome, codexHome, codexConfig, codexHooks } from '../core/locations.js';
|
|
9
12
|
const MARKETPLACE = MARKETPLACE_NAME;
|
|
10
13
|
const PLUGIN_ID = `vibe@${MARKETPLACE}`;
|
|
11
14
|
const LEGACY_ID = 'vibe@vibe';
|
|
15
|
+
const LEGACY_MARKETPLACE = 'vibe';
|
|
16
|
+
const PLUGINS_DIR = 'plugins';
|
|
17
|
+
const PACKAGE_NAME = '@su-record/vibe';
|
|
18
|
+
const CLAUDE_CLI = 'claude';
|
|
19
|
+
const CODEX_CLI = 'codex';
|
|
20
|
+
const CLI_RUN_TIMEOUT_MS = 2 * 60 * 1000;
|
|
21
|
+
const CLI_PROBE_TIMEOUT_MS = 15 * 1000;
|
|
22
|
+
const ERROR_TAIL_CHARS = 200;
|
|
23
|
+
const VERSION_DIR = /^\d+\.\d+\.\d+/;
|
|
24
|
+
const INSTALLED_PLUGINS_FILE = 'installed_plugins.json';
|
|
25
|
+
const KNOWN_MARKETPLACES_FILE = 'known_marketplaces.json';
|
|
26
|
+
const CLAUDE_MANIFEST_DIR = '.claude-plugin';
|
|
27
|
+
const MARKETPLACE_FILE = 'marketplace.json';
|
|
28
|
+
const CODEX_HOOK_EVENTS = ['session_start', 'pre_tool_use', 'post_tool_use', 'stop'];
|
|
29
|
+
const CODEX_SNAPSHOT_PREFIX = 'vibe-codex-held-';
|
|
30
|
+
const CLAUDE_SNAPSHOT_PREFIX = 'vibe-claude-held-';
|
|
12
31
|
function run(cmd, args, home) {
|
|
13
|
-
const
|
|
32
|
+
const env = { ...process.env, HOME: home, USERPROFILE: home };
|
|
33
|
+
const r = spawnSync(cmd, args, { encoding: 'utf-8', timeout: CLI_RUN_TIMEOUT_MS, env, shell: process.platform === 'win32' });
|
|
14
34
|
return { ok: r.status === 0, out: `${r.stdout ?? ''}${r.stderr ?? ''}`.trim() };
|
|
15
35
|
}
|
|
16
36
|
export function cliAvailable(name) {
|
|
17
37
|
if (process.env['VIBE_NO_PLUGIN'])
|
|
18
38
|
return false;
|
|
19
|
-
const r = spawnSync(name, ['--version'], { encoding: 'utf-8', timeout:
|
|
39
|
+
const r = spawnSync(name, ['--version'], { encoding: 'utf-8', timeout: CLI_PROBE_TIMEOUT_MS, shell: process.platform === 'win32' });
|
|
20
40
|
return r.status === 0;
|
|
21
41
|
}
|
|
22
|
-
function packageVersion() {
|
|
23
|
-
return readJson(path.join(packageRoot(), 'package.json'))?.version ?? '0.0.0';
|
|
24
|
-
}
|
|
25
42
|
function claudeVersion(home, id) {
|
|
26
|
-
const doc = readJson(
|
|
43
|
+
const doc = readJson(claudeHome(home, PLUGINS_DIR, INSTALLED_PLUGINS_FILE));
|
|
27
44
|
return doc?.plugins?.[id]?.[0]?.version ?? null;
|
|
28
45
|
}
|
|
29
46
|
export function claudePluginVersion(home) {
|
|
30
47
|
return claudeVersion(home, PLUGIN_ID) ?? claudeVersion(home, LEGACY_ID);
|
|
31
48
|
}
|
|
32
49
|
export function claudeNeedsMigration(home) {
|
|
33
|
-
const doc = readJson(
|
|
50
|
+
const doc = readJson(claudeHome(home, PLUGINS_DIR, INSTALLED_PLUGINS_FILE));
|
|
34
51
|
return doc?.plugins?.[LEGACY_ID]?.some(p => p.scope === 'user') ?? false;
|
|
35
52
|
}
|
|
53
|
+
function isMarketplaceManifest(file) {
|
|
54
|
+
return path.basename(file) === MARKETPLACE_FILE && path.basename(path.dirname(file)) === CLAUDE_MANIFEST_DIR;
|
|
55
|
+
}
|
|
36
56
|
function claudeMarketplacePath(home, name = MARKETPLACE) {
|
|
37
|
-
const doc = readJson(
|
|
57
|
+
const doc = readJson(claudeHome(home, PLUGINS_DIR, KNOWN_MARKETPLACES_FILE));
|
|
38
58
|
const source = doc?.[name]?.source;
|
|
39
|
-
if (source?.source === 'file' && source.path &&
|
|
59
|
+
if (source?.source === 'file' && source.path && isMarketplaceManifest(source.path))
|
|
40
60
|
return path.dirname(path.dirname(source.path));
|
|
41
61
|
return source?.path ?? null;
|
|
42
62
|
}
|
|
@@ -44,8 +64,8 @@ function claudeMarketplacePath(home, name = MARKETPLACE) {
|
|
|
44
64
|
function vibeVersionAt(dir) {
|
|
45
65
|
if (!dir)
|
|
46
66
|
return null;
|
|
47
|
-
const pkg = readJson(path.join(dir,
|
|
48
|
-
return pkg?.name ===
|
|
67
|
+
const pkg = readJson(path.join(dir, PACKAGE_MANIFEST));
|
|
68
|
+
return pkg?.name === PACKAGE_NAME && typeof pkg.version === 'string' ? pkg.version : null;
|
|
49
69
|
}
|
|
50
70
|
/**
|
|
51
71
|
* Highest version wins: a marketplace that already points at another vibe install of a version
|
|
@@ -53,7 +73,7 @@ function vibeVersionAt(dir) {
|
|
|
53
73
|
* checkout and a global install stop re-registering each other on every command.
|
|
54
74
|
*/
|
|
55
75
|
export function claudeHeldElsewhere(home, root = packageRoot()) {
|
|
56
|
-
const at = claudeMarketplacePath(home) ?? claudeMarketplacePath(home,
|
|
76
|
+
const at = claudeMarketplacePath(home) ?? claudeMarketplacePath(home, LEGACY_MARKETPLACE);
|
|
57
77
|
if (!at || path.resolve(at) === path.resolve(root))
|
|
58
78
|
return null;
|
|
59
79
|
const theirs = vibeVersionAt(at);
|
|
@@ -63,6 +83,9 @@ export function claudeHeldElsewhere(home, root = packageRoot()) {
|
|
|
63
83
|
return null;
|
|
64
84
|
return claudePluginVersion(home) === theirs ? { at, version: theirs } : null;
|
|
65
85
|
}
|
|
86
|
+
function claudeFailure(home, detail, version = claudePluginVersion(home)) {
|
|
87
|
+
return { ok: false, mode: claudePluginVersion(home) ? 'plugin' : 'home', version, detail };
|
|
88
|
+
}
|
|
66
89
|
/** Point the `vibe-local` marketplace at this package and install/update the plugin. Idempotent: nothing runs when current. */
|
|
67
90
|
export function registerClaude(home, root = packageRoot()) {
|
|
68
91
|
const want = packageVersion();
|
|
@@ -71,39 +94,46 @@ export function registerClaude(home, root = packageRoot()) {
|
|
|
71
94
|
if (installed === want && at === root && !claudeNeedsMigration(home))
|
|
72
95
|
return { ok: true, mode: 'plugin', version: installed, detail: 'current' };
|
|
73
96
|
const elsewhere = claudeHeldElsewhere(home, root);
|
|
74
|
-
if (elsewhere && (!claudeNeedsMigration(home) || newer(elsewhere.version, want)))
|
|
97
|
+
if (elsewhere && (!claudeNeedsMigration(home) || newer(elsewhere.version, want))) {
|
|
75
98
|
return { ok: true, mode: 'plugin', version: elsewhere.version, detail: `current — ${elsewhere.version} at ${elsewhere.at}` };
|
|
99
|
+
}
|
|
76
100
|
if (at !== null && at !== root)
|
|
77
|
-
run(
|
|
101
|
+
run(CLAUDE_CLI, ['plugin', 'marketplace', 'remove', MARKETPLACE], home);
|
|
78
102
|
if (at !== root) {
|
|
79
103
|
// Claude deduplicates directory sources by path, retaining the former marketplace name.
|
|
80
104
|
// A manifest file is a distinct source; preserve the old registration and live caches.
|
|
81
|
-
const
|
|
82
|
-
const
|
|
105
|
+
const manifest = path.join(root, CLAUDE_MANIFEST_DIR, MARKETPLACE_FILE);
|
|
106
|
+
const source = claudeMarketplacePath(home, LEGACY_MARKETPLACE) === root ? manifest : root;
|
|
107
|
+
const add = run(CLAUDE_CLI, ['plugin', 'marketplace', 'add', source, '--scope', 'user'], home);
|
|
83
108
|
if (!add.ok)
|
|
84
|
-
return
|
|
109
|
+
return claudeFailure(home, `marketplace add failed: ${add.out.slice(-ERROR_TAIL_CHARS)}`);
|
|
85
110
|
}
|
|
86
|
-
const step = installed === want && at === root ? { ok: true, out: '' } :
|
|
111
|
+
const step = installed === want && at === root ? { ok: true, out: '' } : installClaudePlugin(home, installed);
|
|
87
112
|
if (!step.ok)
|
|
88
|
-
return
|
|
113
|
+
return claudeFailure(home, `plugin ${installed ? 'update' : 'install'} failed: ${step.out.slice(-ERROR_TAIL_CHARS)}`);
|
|
89
114
|
const now = claudeVersion(home, PLUGIN_ID);
|
|
90
115
|
if (now !== want)
|
|
91
|
-
return
|
|
116
|
+
return claudeFailure(home, `plugin verification failed: expected ${want}, found ${now ?? 'none'}`, now);
|
|
92
117
|
const error = retireLegacyClaude(home);
|
|
93
118
|
if (error)
|
|
94
119
|
return { ok: false, mode: 'plugin', version: now, detail: error };
|
|
95
120
|
return { ok: true, mode: 'plugin', version: now, detail: installed ? `updated ${installed} → ${now}` : `installed ${now}` };
|
|
96
121
|
}
|
|
122
|
+
function installClaudePlugin(home, installed) {
|
|
123
|
+
return installed
|
|
124
|
+
? run(CLAUDE_CLI, ['plugin', 'update', PLUGIN_ID], home)
|
|
125
|
+
: run(CLAUDE_CLI, ['plugin', 'install', PLUGIN_ID, '--scope', 'user'], home);
|
|
126
|
+
}
|
|
97
127
|
/** Keep old cached hook paths alive for sessions that started before the namespace changed. */
|
|
98
128
|
function retireLegacyClaude(home) {
|
|
99
129
|
if (claudeNeedsMigration(home)) {
|
|
100
|
-
const cache =
|
|
101
|
-
const snapshot = fs.existsSync(cache) ? fs.mkdtempSync(path.join(os.tmpdir(),
|
|
130
|
+
const cache = claudeHome(home, PLUGINS_DIR, 'cache', LEGACY_MARKETPLACE, PLUGIN_NAME);
|
|
131
|
+
const snapshot = fs.existsSync(cache) ? fs.mkdtempSync(path.join(os.tmpdir(), CLAUDE_SNAPSHOT_PREFIX)) : null;
|
|
102
132
|
if (snapshot)
|
|
103
133
|
fs.cpSync(cache, snapshot, { recursive: true });
|
|
104
134
|
let result;
|
|
105
135
|
try {
|
|
106
|
-
result = run(
|
|
136
|
+
result = run(CLAUDE_CLI, ['plugin', 'uninstall', LEGACY_ID, '--scope', 'user'], home);
|
|
107
137
|
}
|
|
108
138
|
finally {
|
|
109
139
|
if (snapshot) {
|
|
@@ -112,7 +142,7 @@ function retireLegacyClaude(home) {
|
|
|
112
142
|
}
|
|
113
143
|
}
|
|
114
144
|
if (!result.ok || claudeNeedsMigration(home))
|
|
115
|
-
return `legacy plugin removal failed: ${result.out.slice(-
|
|
145
|
+
return `legacy plugin removal failed: ${result.out.slice(-ERROR_TAIL_CHARS)}`;
|
|
116
146
|
}
|
|
117
147
|
// Leave the old marketplace registered: it may serve other plugins/scopes, and removing
|
|
118
148
|
// it may delete cached hooks still used by running sessions. It exposes no uninstalled skill.
|
|
@@ -121,10 +151,12 @@ function retireLegacyClaude(home) {
|
|
|
121
151
|
export function unregisterClaude(home) {
|
|
122
152
|
const removed = [];
|
|
123
153
|
for (const id of [PLUGIN_ID, LEGACY_ID]) {
|
|
124
|
-
|
|
154
|
+
const uninstalled = claudeVersion(home, id) !== null && run(CLAUDE_CLI, ['plugin', 'uninstall', id, '--scope', 'user'], home).ok;
|
|
155
|
+
if (uninstalled)
|
|
125
156
|
removed.push(`claude plugin ${id}`);
|
|
126
157
|
}
|
|
127
|
-
|
|
158
|
+
const unlisted = claudeMarketplacePath(home) !== null && run(CLAUDE_CLI, ['plugin', 'marketplace', 'remove', MARKETPLACE], home).ok;
|
|
159
|
+
if (unlisted)
|
|
128
160
|
removed.push(`claude marketplace ${MARKETPLACE}`);
|
|
129
161
|
return removed;
|
|
130
162
|
}
|
|
@@ -137,16 +169,15 @@ function marketplaceName(home) {
|
|
|
137
169
|
* the highest when several are present, null when Codex holds none — a reading, not the package version.
|
|
138
170
|
*/
|
|
139
171
|
export function codexPluginVersion(home) {
|
|
140
|
-
const dir =
|
|
172
|
+
const dir = codexHome(home, PLUGINS_DIR, 'cache', marketplaceName(home), PLUGIN_NAME);
|
|
141
173
|
if (!fs.existsSync(dir))
|
|
142
174
|
return null;
|
|
143
175
|
const versions = fs
|
|
144
176
|
.readdirSync(dir)
|
|
145
|
-
.filter((v) =>
|
|
177
|
+
.filter((v) => VERSION_DIR.test(v) && fs.existsSync(path.join(dir, v, CODEX_MANIFEST_FILE)))
|
|
146
178
|
.sort((a, b) => (newer(a, b) ? -1 : newer(b, a) ? 1 : 0));
|
|
147
179
|
return versions[0] ?? null;
|
|
148
180
|
}
|
|
149
|
-
/** An assembled tree alone does not prove Codex has installed it. */
|
|
150
181
|
/** Highest version wins for Codex too: a tree assembled by a newer install, which Codex holds, is not torn down by an older binary. */
|
|
151
182
|
export function codexHeldNewer(home) {
|
|
152
183
|
const s = pluginStatus(home);
|
|
@@ -164,7 +195,7 @@ export function codexHeldNewer(home) {
|
|
|
164
195
|
export function codexHooksTrusted(home) {
|
|
165
196
|
let toml = '';
|
|
166
197
|
try {
|
|
167
|
-
toml = fs.readFileSync(
|
|
198
|
+
toml = fs.readFileSync(codexConfig(home), 'utf-8');
|
|
168
199
|
}
|
|
169
200
|
catch {
|
|
170
201
|
return null;
|
|
@@ -172,9 +203,8 @@ export function codexHooksTrusted(home) {
|
|
|
172
203
|
const keys = [...toml.matchAll(/^\[hooks\.state\."([^"]+)"\]/gm)].map((m) => m[1] ?? '');
|
|
173
204
|
if (keys.length === 0)
|
|
174
205
|
return null;
|
|
175
|
-
const sources = [
|
|
176
|
-
|
|
177
|
-
return sources.some((src) => events.every((ev) => keys.some((k) => k.startsWith(`${src}:${ev}:`))));
|
|
206
|
+
const sources = [`${PLUGIN_NAME}@${marketplaceName(home)}:${CODEX_HOOKS_FILE}`, codexHooks(home)];
|
|
207
|
+
return sources.some((src) => CODEX_HOOK_EVENTS.every((ev) => keys.some((k) => k.startsWith(`${src}:${ev}:`))));
|
|
178
208
|
}
|
|
179
209
|
export function codexRegistered(home) {
|
|
180
210
|
if (codexHeldNewer(home))
|
|
@@ -185,7 +215,7 @@ export function codexRegistered(home) {
|
|
|
185
215
|
const held = codexPluginVersion(home);
|
|
186
216
|
return held === packageVersion();
|
|
187
217
|
}
|
|
188
|
-
const codexCacheDir = (home) =>
|
|
218
|
+
const codexCacheDir = (home) => codexHome(home, PLUGINS_DIR, 'cache', marketplaceName(home), PLUGIN_NAME);
|
|
189
219
|
/**
|
|
190
220
|
* A Codex or ChatGPT session resolves `${PLUGIN_ROOT}` once, at start, to the cache directory of the version it
|
|
191
221
|
* found; `codex plugin remove` deletes that directory, and every hook of a session still running under the old
|
|
@@ -204,9 +234,9 @@ function snapshotVersions(home) {
|
|
|
204
234
|
const from = codexCacheDir(home);
|
|
205
235
|
if (!fs.existsSync(from))
|
|
206
236
|
return null;
|
|
207
|
-
const to = fs.mkdtempSync(path.join(os.tmpdir(),
|
|
237
|
+
const to = fs.mkdtempSync(path.join(os.tmpdir(), CODEX_SNAPSHOT_PREFIX));
|
|
208
238
|
for (const version of fs.readdirSync(from)) {
|
|
209
|
-
if (
|
|
239
|
+
if (VERSION_DIR.test(version))
|
|
210
240
|
fs.cpSync(path.join(from, version), path.join(to, version), { recursive: true });
|
|
211
241
|
}
|
|
212
242
|
return to;
|
|
@@ -225,17 +255,18 @@ export function registerCodex(home) {
|
|
|
225
255
|
return { ok: true, mode: 'plugin', version: packageVersion(), detail: 'current' };
|
|
226
256
|
const held = codexPluginVersion(home);
|
|
227
257
|
const r = installPlugin(home);
|
|
228
|
-
const id =
|
|
229
|
-
const
|
|
258
|
+
const id = `${PLUGIN_NAME}@${r.marketplaceName}`;
|
|
259
|
+
const codexFailure = (detail) => ({ ok: false, mode: 'home', version: held, detail });
|
|
260
|
+
const add = run(CODEX_CLI, ['plugin', 'marketplace', 'add', home], home);
|
|
230
261
|
if (!add.ok && !/already/i.test(add.out))
|
|
231
|
-
return
|
|
262
|
+
return codexFailure(`codex marketplace add failed: ${add.out.slice(-ERROR_TAIL_CHARS)}`);
|
|
232
263
|
const snapshot = snapshotVersions(home);
|
|
233
264
|
let plug;
|
|
234
265
|
try {
|
|
235
266
|
if (held !== null)
|
|
236
|
-
run(
|
|
267
|
+
run(CODEX_CLI, ['plugin', 'remove', id], home);
|
|
237
268
|
restoreVersions(home, snapshot);
|
|
238
|
-
plug = run(
|
|
269
|
+
plug = run(CODEX_CLI, ['plugin', 'add', id], home);
|
|
239
270
|
}
|
|
240
271
|
finally {
|
|
241
272
|
restoreVersions(home, snapshot);
|
|
@@ -243,23 +274,27 @@ export function registerCodex(home) {
|
|
|
243
274
|
fs.rmSync(snapshot, { recursive: true, force: true });
|
|
244
275
|
}
|
|
245
276
|
if (!plug.ok)
|
|
246
|
-
return
|
|
277
|
+
return codexFailure(`codex plugin add failed: ${plug.out.slice(-ERROR_TAIL_CHARS)}`);
|
|
247
278
|
const observed = codexPluginVersion(home);
|
|
248
|
-
if (observed !== r.version)
|
|
249
|
-
|
|
250
|
-
|
|
279
|
+
if (observed !== r.version) {
|
|
280
|
+
const detail = `codex verification incomplete: expected ${r.version}, observed ${observed ?? 'unknown'}; `
|
|
281
|
+
+ 'inspect the client installation before retrying setup';
|
|
282
|
+
return { ok: false, mode: 'plugin', version: observed, detail };
|
|
283
|
+
}
|
|
284
|
+
const detail = held ? `updated ${held} → ${r.version}; a session started under ${held} keeps its hooks until it restarts` : `registered ${id}`;
|
|
285
|
+
return { ok: true, mode: 'plugin', version: r.version, detail };
|
|
251
286
|
}
|
|
252
287
|
export function unregisterCodex(home) {
|
|
253
288
|
const removed = [];
|
|
254
289
|
const paths = pluginPaths(home);
|
|
255
290
|
if (fs.existsSync(paths.tree)) {
|
|
256
|
-
run(
|
|
291
|
+
run(CODEX_CLI, ['plugin', 'remove', `${PLUGIN_NAME}@${marketplaceName(home)}`], home);
|
|
257
292
|
fs.rmSync(paths.tree, { recursive: true, force: true });
|
|
258
293
|
removed.push(paths.tree);
|
|
259
294
|
}
|
|
260
295
|
const doc = readJson(paths.marketplace);
|
|
261
|
-
if (doc?.plugins?.some((p) => p?.name ===
|
|
262
|
-
writeJson(paths.marketplace, { ...doc, plugins: doc.plugins.filter((p) => p?.name !==
|
|
296
|
+
if (doc?.plugins?.some((p) => p?.name === PLUGIN_NAME)) {
|
|
297
|
+
writeJson(paths.marketplace, { ...doc, plugins: doc.plugins.filter((p) => p?.name !== PLUGIN_NAME) });
|
|
263
298
|
removed.push(`${paths.marketplace} vibe entry`);
|
|
264
299
|
}
|
|
265
300
|
return removed;
|