overlord-cli 0.2606021930.0 → 0.2606041130.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/bin/_cli/launcher.mjs +66 -2
- package/bin/_cli/setup.mjs +3 -1
- package/package.json +1 -1
package/bin/_cli/launcher.mjs
CHANGED
|
@@ -17,6 +17,21 @@ import { runAttachCommand } from './attach.mjs';
|
|
|
17
17
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
18
18
|
const PACKAGE_CLAUDE_PLUGIN_DIR = path.resolve(__dirname, '..', '..', 'plugins', 'claude');
|
|
19
19
|
const REPO_CLAUDE_PLUGIN_DIR = path.resolve(__dirname, '..', '..', '..', '..', 'plugins', 'claude');
|
|
20
|
+
const CLAUDE_PLUGIN_CACHE_DIR = path.join(
|
|
21
|
+
os.homedir(),
|
|
22
|
+
'.claude',
|
|
23
|
+
'plugins',
|
|
24
|
+
'cache',
|
|
25
|
+
'overlord-local',
|
|
26
|
+
'overlord'
|
|
27
|
+
);
|
|
28
|
+
const CLAUDE_INSTALLED_PLUGINS_FILE = path.join(
|
|
29
|
+
os.homedir(),
|
|
30
|
+
'.claude',
|
|
31
|
+
'plugins',
|
|
32
|
+
'installed_plugins.json'
|
|
33
|
+
);
|
|
34
|
+
const CLAUDE_INSTALLED_PLUGIN_KEY = 'overlord@overlord-local';
|
|
20
35
|
|
|
21
36
|
function resolveLaunchScratchDir(workingDirectory, { explicit = false } = {}) {
|
|
22
37
|
const trimmed = typeof workingDirectory === 'string' ? workingDirectory.trim() : '';
|
|
@@ -47,6 +62,55 @@ function claudeSourcePluginDir() {
|
|
|
47
62
|
return null;
|
|
48
63
|
}
|
|
49
64
|
|
|
65
|
+
function readJsonFile(filePath) {
|
|
66
|
+
try {
|
|
67
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
68
|
+
} catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function claudeInstalledPluginDir() {
|
|
74
|
+
const installed = readJsonFile(CLAUDE_INSTALLED_PLUGINS_FILE);
|
|
75
|
+
const pluginEntries = installed?.plugins?.[CLAUDE_INSTALLED_PLUGIN_KEY];
|
|
76
|
+
|
|
77
|
+
if (Array.isArray(pluginEntries)) {
|
|
78
|
+
for (const entry of pluginEntries) {
|
|
79
|
+
const installPath = typeof entry?.installPath === 'string' ? entry.installPath.trim() : '';
|
|
80
|
+
if (installPath && fs.existsSync(path.join(installPath, '.claude-plugin', 'plugin.json'))) {
|
|
81
|
+
return installPath;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!fs.existsSync(CLAUDE_PLUGIN_CACHE_DIR)) return null;
|
|
87
|
+
|
|
88
|
+
const versionDirs = fs
|
|
89
|
+
.readdirSync(CLAUDE_PLUGIN_CACHE_DIR, { withFileTypes: true })
|
|
90
|
+
.filter(entry => entry.isDirectory())
|
|
91
|
+
.map(entry => path.join(CLAUDE_PLUGIN_CACHE_DIR, entry.name))
|
|
92
|
+
.filter(candidate => fs.existsSync(path.join(candidate, '.claude-plugin', 'plugin.json')))
|
|
93
|
+
.sort()
|
|
94
|
+
.reverse();
|
|
95
|
+
|
|
96
|
+
return versionDirs[0] ?? null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function envTruthy(value) {
|
|
100
|
+
return /^(1|true|yes|on)$/i.test(String(value ?? '').trim());
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function claudeLaunchPluginDir() {
|
|
104
|
+
const explicitPluginDir = process.env.OVERLORD_CLAUDE_PLUGIN_DIR?.trim();
|
|
105
|
+
if (explicitPluginDir) return explicitPluginDir;
|
|
106
|
+
|
|
107
|
+
if (envTruthy(process.env.OVERLORD_USE_CLAUDE_SOURCE_PLUGIN)) {
|
|
108
|
+
return claudeSourcePluginDir();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
|
|
50
114
|
function antigravityBundleInstalled() {
|
|
51
115
|
return fs.existsSync(
|
|
52
116
|
path.join(os.homedir(), '.gemini', 'antigravity-cli', 'plugins', 'plugin.json')
|
|
@@ -55,7 +119,7 @@ function antigravityBundleInstalled() {
|
|
|
55
119
|
|
|
56
120
|
function getInstructionMode(agent) {
|
|
57
121
|
if (agent === 'claude') {
|
|
58
|
-
return
|
|
122
|
+
return claudeInstalledPluginDir() || claudeLaunchPluginDir() ? 'bundle' : 'legacy';
|
|
59
123
|
}
|
|
60
124
|
|
|
61
125
|
if (agent === 'codex') {
|
|
@@ -474,7 +538,7 @@ async function runAgent(agent, mode = 'run', options = {}) {
|
|
|
474
538
|
|
|
475
539
|
try {
|
|
476
540
|
if (agent === 'claude') {
|
|
477
|
-
const pluginDir =
|
|
541
|
+
const pluginDir = claudeLaunchPluginDir();
|
|
478
542
|
if (mode === 'resume') {
|
|
479
543
|
const claudeSessionId = process.env.CLAUDE_SESSION_ID?.trim();
|
|
480
544
|
const args = claudeSessionId
|
package/bin/_cli/setup.mjs
CHANGED
|
@@ -1138,7 +1138,9 @@ function installClaude() {
|
|
|
1138
1138
|
} else {
|
|
1139
1139
|
console.log(' ✓ No v3.25 Claude connector files needed migration.');
|
|
1140
1140
|
}
|
|
1141
|
-
console.log(
|
|
1141
|
+
console.log(
|
|
1142
|
+
' ✓ `ovld launch claude` now uses the installed Claude local marketplace plugin by default.'
|
|
1143
|
+
);
|
|
1142
1144
|
|
|
1143
1145
|
const manifest = readManifest();
|
|
1144
1146
|
manifest.claude = {
|