@tyvm/knowhow 0.0.109-dev.38b1faa → 0.0.109-dev.ae8968c
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/package.json +1 -1
- package/src/commands/modules.ts +30 -365
- package/src/services/modules/index.ts +19 -24
- package/ts_build/package.json +1 -1
- package/ts_build/src/commands/modules.js +17 -297
- package/ts_build/src/commands/modules.js.map +1 -1
- package/ts_build/src/services/modules/index.js +13 -17
- package/ts_build/src/services/modules/index.js.map +1 -1
package/package.json
CHANGED
package/src/commands/modules.ts
CHANGED
|
@@ -4,7 +4,6 @@ import * as fs from "fs";
|
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import * as os from "os";
|
|
6
6
|
import { getConfig, getGlobalConfig, updateConfig, updateGlobalConfig } from "../config";
|
|
7
|
-
import * as readline from "readline";
|
|
8
7
|
|
|
9
8
|
// Default built-in modules that `knowhow modules setup` adds to the config.
|
|
10
9
|
export const BUILTIN_MODULES = [
|
|
@@ -50,234 +49,6 @@ function npmInstallToKnowhow(mod: string, knowhowDir: string): void {
|
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
/**
|
|
54
|
-
* Returns true if a module package is already installed in the given knowhow dir.
|
|
55
|
-
*/
|
|
56
|
-
function isModuleInstalled(mod: string, knowhowDir: string): boolean {
|
|
57
|
-
try {
|
|
58
|
-
require.resolve(mod, {
|
|
59
|
-
paths: [path.join(knowhowDir, "node_modules"), knowhowDir],
|
|
60
|
-
});
|
|
61
|
-
return true;
|
|
62
|
-
} catch {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface NpmRegistryInfo {
|
|
68
|
-
latestVersion: string;
|
|
69
|
-
publishedAt: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Fetch the latest version and publish time from the npm registry for a package.
|
|
74
|
-
* Returns null if the package info can't be fetched.
|
|
75
|
-
*/
|
|
76
|
-
async function fetchNpmRegistryInfo(mod: string): Promise<NpmRegistryInfo | null> {
|
|
77
|
-
try {
|
|
78
|
-
// npm view <pkg> version time --json returns either a single value or array
|
|
79
|
-
const output = execSync(`npm view ${mod} version time --json`, {
|
|
80
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
81
|
-
encoding: "utf-8",
|
|
82
|
-
});
|
|
83
|
-
const parsed = JSON.parse(output.trim());
|
|
84
|
-
let latestVersion: string;
|
|
85
|
-
let timestamps: Record<string, string> = {};
|
|
86
|
-
if (Array.isArray(parsed)) {
|
|
87
|
-
latestVersion = parsed[0];
|
|
88
|
-
timestamps = parsed[1] || {};
|
|
89
|
-
} else if (parsed && typeof parsed === "object") {
|
|
90
|
-
latestVersion = parsed["version"] || "";
|
|
91
|
-
timestamps = parsed["time"] || {};
|
|
92
|
-
} else {
|
|
93
|
-
latestVersion = String(parsed);
|
|
94
|
-
}
|
|
95
|
-
const publishedAt = timestamps[latestVersion] || timestamps["modified"] || "";
|
|
96
|
-
return { latestVersion, publishedAt };
|
|
97
|
-
} catch {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Simple engine range checker — handles the common cases:
|
|
104
|
-
* ">=22" ">=22.0.0" "^20" "20.x" "*" ""
|
|
105
|
-
* Returns true if the given nodeVersion satisfies the range.
|
|
106
|
-
* Falls back to true (permissive) for unsupported range syntax.
|
|
107
|
-
*/
|
|
108
|
-
function nodeSatisfiesRange(nodeVersion: string, range: string): boolean {
|
|
109
|
-
if (!range || range === "*" || range === "") return true;
|
|
110
|
-
|
|
111
|
-
// Parse "major.minor.patch" from e.g. "v20.17.0"
|
|
112
|
-
const vMatch = nodeVersion.replace(/^v/, "").match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
113
|
-
if (!vMatch) return true;
|
|
114
|
-
const vMajor = parseInt(vMatch[1], 10);
|
|
115
|
-
const vMinor = parseInt(vMatch[2] ?? "0", 10);
|
|
116
|
-
const vPatch = parseInt(vMatch[3] ?? "0", 10);
|
|
117
|
-
const vNum = vMajor * 1_000_000 + vMinor * 1_000 + vPatch;
|
|
118
|
-
|
|
119
|
-
function parseVersion(s: string): number {
|
|
120
|
-
const m = s.trim().match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
121
|
-
if (!m) return 0;
|
|
122
|
-
return parseInt(m[1], 10) * 1_000_000 + parseInt(m[2] ?? "0", 10) * 1_000 + parseInt(m[3] ?? "0", 10);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Handle " || " — any segment satisfying is fine
|
|
126
|
-
if (range.includes("||")) {
|
|
127
|
-
return range.split("||").some((r) => nodeSatisfiesRange(nodeVersion, r.trim()));
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Handle space-separated AND conditions e.g. ">=14 <18"
|
|
131
|
-
const parts = range.trim().split(/\s+/);
|
|
132
|
-
for (const part of parts) {
|
|
133
|
-
const gteMatch = part.match(/^>=(.+)/);
|
|
134
|
-
const gtMatch = part.match(/^>(?!=)(.+)/);
|
|
135
|
-
const lteMatch = part.match(/^<=(.+)/);
|
|
136
|
-
const ltMatch = part.match(/^<(?!=)(.+)/);
|
|
137
|
-
const caretMatch = part.match(/^\^(\d+)/);
|
|
138
|
-
const tildeMatch = part.match(/^~(\d+)(?:\.(\d+))?/);
|
|
139
|
-
const exactMatch = part.match(/^(\d+(?:\.\d+)*)/);
|
|
140
|
-
|
|
141
|
-
if (gteMatch) {
|
|
142
|
-
if (vNum < parseVersion(gteMatch[1])) return false;
|
|
143
|
-
} else if (gtMatch) {
|
|
144
|
-
if (vNum <= parseVersion(gtMatch[1])) return false;
|
|
145
|
-
} else if (lteMatch) {
|
|
146
|
-
if (vNum > parseVersion(lteMatch[1])) return false;
|
|
147
|
-
} else if (ltMatch) {
|
|
148
|
-
if (vNum >= parseVersion(ltMatch[1])) return false;
|
|
149
|
-
} else if (caretMatch) {
|
|
150
|
-
const base = parseVersion(caretMatch[1]);
|
|
151
|
-
const baseMajor = parseInt(caretMatch[1], 10);
|
|
152
|
-
if (vNum < base || vMajor !== baseMajor) return false;
|
|
153
|
-
} else if (tildeMatch) {
|
|
154
|
-
const baseMajor = parseInt(tildeMatch[1], 10);
|
|
155
|
-
const baseMinor = parseInt(tildeMatch[2] ?? "0", 10);
|
|
156
|
-
const base = parseVersion(`${baseMajor}.${baseMinor}`);
|
|
157
|
-
const nextMinor = parseVersion(`${baseMajor}.${baseMinor + 1}`);
|
|
158
|
-
if (vNum < base || vNum >= nextMinor) return false;
|
|
159
|
-
} else if (exactMatch && !part.startsWith("v")) {
|
|
160
|
-
// e.g. "20.x" or "20"
|
|
161
|
-
const xMatch = part.match(/^(\d+)(?:\.x)?$/);
|
|
162
|
-
if (xMatch) {
|
|
163
|
-
if (vMajor !== parseInt(xMatch[1], 10)) return false;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
// Unknown operators — fall through (permissive)
|
|
167
|
-
}
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Fetch the latest version of a package that is compatible with the current
|
|
173
|
-
* Node.js engine. Falls back to "@latest" if no engine info is available.
|
|
174
|
-
*
|
|
175
|
-
* Uses the npm registry API to get per-version engine requirements.
|
|
176
|
-
*/
|
|
177
|
-
async function fetchLatestCompatibleVersion(mod: string): Promise<string> {
|
|
178
|
-
const currentNode = process.version; // e.g. "v20.17.0"
|
|
179
|
-
try {
|
|
180
|
-
// Encode scoped package names for URL (e.g. @tyvm/pkg -> @tyvm%2Fpkg)
|
|
181
|
-
const encodedMod = mod.replace(/^@/, "").replace("/", "%2F");
|
|
182
|
-
const registryUrl = mod.startsWith("@")
|
|
183
|
-
? `https://registry.npmjs.org/@${encodedMod}`
|
|
184
|
-
: `https://registry.npmjs.org/${mod}`;
|
|
185
|
-
|
|
186
|
-
const response = await fetch(registryUrl);
|
|
187
|
-
if (!response.ok) throw new Error(`Registry returned ${response.status}`);
|
|
188
|
-
const pkgData = await response.json() as any;
|
|
189
|
-
|
|
190
|
-
// pkgData.versions is a map of version -> package metadata
|
|
191
|
-
const versionsMap: Record<string, any> = pkgData.versions ?? {};
|
|
192
|
-
const allVersions = Object.keys(versionsMap);
|
|
193
|
-
|
|
194
|
-
// Build per-version engine map from actual per-version metadata
|
|
195
|
-
const enginesByVersion: Record<string, string> = {};
|
|
196
|
-
for (const [v, meta] of Object.entries(versionsMap)) {
|
|
197
|
-
enginesByVersion[v] = (meta as any)?.engines?.node ?? "";
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (allVersions.length === 0) return `${mod}@latest`;
|
|
201
|
-
|
|
202
|
-
// Sort versions descending (simple semver numeric sort)
|
|
203
|
-
const sorted = [...allVersions].sort((a, b) => {
|
|
204
|
-
const pa = a.split(".").map(Number);
|
|
205
|
-
const pb = b.split(".").map(Number);
|
|
206
|
-
for (let i = 0; i < 3; i++) {
|
|
207
|
-
if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pb[i] ?? 0) - (pa[i] ?? 0);
|
|
208
|
-
}
|
|
209
|
-
return 0;
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
for (const v of sorted) {
|
|
213
|
-
const engineRange = enginesByVersion[v] ?? "";
|
|
214
|
-
if (nodeSatisfiesRange(currentNode, engineRange)) {
|
|
215
|
-
return `${mod}@${v}`;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// No compatible version found — warn and fall back to latest
|
|
220
|
-
console.warn(`⚠️ No version of ${mod} found compatible with Node ${currentNode}. Installing latest anyway.`);
|
|
221
|
-
return `${mod}@latest`;
|
|
222
|
-
} catch {
|
|
223
|
-
// Can't fetch registry info — fall back to latest
|
|
224
|
-
return `${mod}@latest`;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Get the currently installed version of a package in .knowhow/node_modules.
|
|
230
|
-
*/
|
|
231
|
-
function getInstalledVersion(mod: string, knowhowDir: string): string | null {
|
|
232
|
-
try {
|
|
233
|
-
const pkgJsonPath = path.join(knowhowDir, "node_modules", mod, "package.json");
|
|
234
|
-
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
235
|
-
return pkgJson.version ?? null;
|
|
236
|
-
} catch {
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Format a date string as a human-readable relative time (e.g. "2 days ago").
|
|
243
|
-
*/
|
|
244
|
-
function formatRelativeTime(isoDate: string): string {
|
|
245
|
-
if (!isoDate) return "unknown";
|
|
246
|
-
const then = new Date(isoDate).getTime();
|
|
247
|
-
if (isNaN(then)) return "unknown";
|
|
248
|
-
const diffMs = Date.now() - then;
|
|
249
|
-
const diffMins = Math.floor(diffMs / 60_000);
|
|
250
|
-
if (diffMins < 2) return "just now";
|
|
251
|
-
if (diffMins < 60) return `${diffMins} minutes ago`;
|
|
252
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
253
|
-
if (diffHours < 24) return `${diffHours} hour${diffHours !== 1 ? "s" : ""} ago`;
|
|
254
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
255
|
-
if (diffDays < 30) return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
|
|
256
|
-
const diffMonths = Math.floor(diffDays / 30);
|
|
257
|
-
if (diffMonths < 12) return `${diffMonths} month${diffMonths !== 1 ? "s" : ""} ago`;
|
|
258
|
-
const diffYears = Math.floor(diffMonths / 12);
|
|
259
|
-
return `${diffYears} year${diffYears !== 1 ? "s" : ""} ago`;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Prompt the user for a yes/no confirmation.
|
|
264
|
-
*/
|
|
265
|
-
function promptConfirm(question: string): Promise<boolean> {
|
|
266
|
-
return new Promise((resolve) => {
|
|
267
|
-
const rl = readline.createInterface({
|
|
268
|
-
input: process.stdin,
|
|
269
|
-
output: process.stdout,
|
|
270
|
-
});
|
|
271
|
-
rl.question(`${question} (y/N) `, (answer) => {
|
|
272
|
-
rl.close();
|
|
273
|
-
resolve(
|
|
274
|
-
answer.trim().toLowerCase() === "y" ||
|
|
275
|
-
answer.trim().toLowerCase() === "yes"
|
|
276
|
-
);
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
|
|
281
52
|
export function addModulesCommand(program: Command): void {
|
|
282
53
|
const modulesCmd = program
|
|
283
54
|
.command("modules")
|
|
@@ -299,39 +70,39 @@ export function addModulesCommand(program: Command): void {
|
|
|
299
70
|
|
|
300
71
|
if (!cfg.modules) cfg.modules = [];
|
|
301
72
|
|
|
73
|
+
const toAdd = BUILTIN_MODULES.filter(
|
|
74
|
+
(m) => !cfg.modules!.includes(m)
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
if (toAdd.length === 0) {
|
|
78
|
+
console.log(
|
|
79
|
+
`✅ All default modules are already in ${configLabel}. Nothing to do.`
|
|
80
|
+
);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
302
84
|
const knowhowDir = getKnowhowDir(isGlobal);
|
|
303
85
|
ensureKnowhowPackageJson(knowhowDir);
|
|
304
86
|
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
let anyChanges = false;
|
|
308
|
-
for (const mod of BUILTIN_MODULES) {
|
|
87
|
+
// Install packages that are not local file paths
|
|
88
|
+
for (const mod of toAdd) {
|
|
309
89
|
if (!mod.startsWith(".") && !mod.startsWith("/")) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
console.log(`📦 Installing ${installTarget}...`);
|
|
313
|
-
npmInstallToKnowhow(installTarget, knowhowDir);
|
|
314
|
-
console.log(`✅ Installed ${mod}`);
|
|
315
|
-
anyChanges = true;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
if (!cfg.modules.includes(mod)) {
|
|
319
|
-
cfg.modules.push(mod);
|
|
320
|
-
console.log(`✅ Added ${mod} to ${configLabel}`);
|
|
321
|
-
anyChanges = true;
|
|
90
|
+
console.log(`📦 Installing ${mod}...`);
|
|
91
|
+
npmInstallToKnowhow(mod, knowhowDir);
|
|
322
92
|
}
|
|
93
|
+
cfg.modules!.push(mod);
|
|
94
|
+
console.log(`✅ Added ${mod} to ${configLabel}`);
|
|
323
95
|
}
|
|
324
96
|
|
|
325
|
-
if (
|
|
326
|
-
|
|
327
|
-
`✅ All default modules are already in ${configLabel} and installed. Nothing to do.`
|
|
328
|
-
);
|
|
97
|
+
if (isGlobal) {
|
|
98
|
+
await updateGlobalConfig(cfg);
|
|
329
99
|
} else {
|
|
330
|
-
await
|
|
331
|
-
console.log(
|
|
332
|
-
`\n🎉 Setup complete! Modules ready in ${knowhowDir}/node_modules.`
|
|
333
|
-
);
|
|
100
|
+
await updateConfig(cfg);
|
|
334
101
|
}
|
|
102
|
+
|
|
103
|
+
console.log(
|
|
104
|
+
`\n🎉 Setup complete! ${toAdd.length} module(s) added to ${configLabel}`
|
|
105
|
+
);
|
|
335
106
|
} catch (error: any) {
|
|
336
107
|
console.error("Error during modules setup:", error.message ?? error);
|
|
337
108
|
process.exit(1);
|
|
@@ -345,7 +116,6 @@ export function addModulesCommand(program: Command): void {
|
|
|
345
116
|
"If no module name is given, installs all modules already in the config."
|
|
346
117
|
)
|
|
347
118
|
.option("--global", "Use the global config (~/.knowhow/knowhow.json)")
|
|
348
|
-
.option("--latest", "Force install the latest version (bypasses package-lock)")
|
|
349
119
|
.action(async (moduleName: string | undefined, opts) => {
|
|
350
120
|
try {
|
|
351
121
|
const isGlobal: boolean = opts.global ?? false;
|
|
@@ -365,7 +135,9 @@ export function addModulesCommand(program: Command): void {
|
|
|
365
135
|
(m) => !m.startsWith(".") && !m.startsWith("/")
|
|
366
136
|
);
|
|
367
137
|
if (installable.length === 0) {
|
|
368
|
-
console.log(
|
|
138
|
+
console.log(
|
|
139
|
+
`ℹ No installable modules found in ${configLabel}.`
|
|
140
|
+
);
|
|
369
141
|
return;
|
|
370
142
|
}
|
|
371
143
|
console.log(
|
|
@@ -373,8 +145,7 @@ export function addModulesCommand(program: Command): void {
|
|
|
373
145
|
);
|
|
374
146
|
for (const mod of installable) {
|
|
375
147
|
console.log(` 📦 Installing ${mod}...`);
|
|
376
|
-
|
|
377
|
-
npmInstallToKnowhow(installTarget, knowhowDir);
|
|
148
|
+
npmInstallToKnowhow(mod, knowhowDir);
|
|
378
149
|
console.log(` ✅ Installed ${mod}`);
|
|
379
150
|
}
|
|
380
151
|
console.log(`\n🎉 All modules installed!`);
|
|
@@ -382,9 +153,8 @@ export function addModulesCommand(program: Command): void {
|
|
|
382
153
|
}
|
|
383
154
|
|
|
384
155
|
// Install the specified module
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
npmInstallToKnowhow(installTarget, knowhowDir);
|
|
156
|
+
console.log(`📦 Installing ${moduleName} into ${knowhowDir}/node_modules...`);
|
|
157
|
+
npmInstallToKnowhow(moduleName, knowhowDir);
|
|
388
158
|
console.log(`✅ Installed ${moduleName}`);
|
|
389
159
|
|
|
390
160
|
// Add to config if not already there
|
|
@@ -444,109 +214,4 @@ export function addModulesCommand(program: Command): void {
|
|
|
444
214
|
process.exit(1);
|
|
445
215
|
}
|
|
446
216
|
});
|
|
447
|
-
|
|
448
|
-
modulesCmd
|
|
449
|
-
.command("update")
|
|
450
|
-
.description(
|
|
451
|
-
"Check for updates to all modules in your config and update them. " +
|
|
452
|
-
"Shows installed vs latest version with publish date before updating."
|
|
453
|
-
)
|
|
454
|
-
.option("--global", "Use the global config (~/.knowhow/knowhow.json)")
|
|
455
|
-
.option("-y, --yes", "Skip confirmation prompt and update all outdated modules automatically")
|
|
456
|
-
.action(async (opts) => {
|
|
457
|
-
try {
|
|
458
|
-
const isGlobal: boolean = opts.global ?? false;
|
|
459
|
-
const skipConfirm: boolean = opts.yes ?? false;
|
|
460
|
-
const cfg = isGlobal ? await getGlobalConfig() : await getConfig();
|
|
461
|
-
const configLabel = isGlobal
|
|
462
|
-
? "~/.knowhow/knowhow.json"
|
|
463
|
-
: ".knowhow/knowhow.json";
|
|
464
|
-
|
|
465
|
-
if (!cfg.modules || cfg.modules.length === 0) {
|
|
466
|
-
console.log(`ℹ No modules found in ${configLabel}.`);
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
const knowhowDir = getKnowhowDir(isGlobal);
|
|
471
|
-
ensureKnowhowPackageJson(knowhowDir);
|
|
472
|
-
|
|
473
|
-
// Only check npm packages (not local paths)
|
|
474
|
-
const installable = cfg.modules.filter(
|
|
475
|
-
(m) => !m.startsWith(".") && !m.startsWith("/")
|
|
476
|
-
);
|
|
477
|
-
|
|
478
|
-
if (installable.length === 0) {
|
|
479
|
-
console.log(`ℹ No npm modules found in ${configLabel}.`);
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
console.log(`🔍 Checking for updates to ${installable.length} module(s)...\n`);
|
|
484
|
-
|
|
485
|
-
interface UpdateInfo {
|
|
486
|
-
mod: string;
|
|
487
|
-
installed: string | null;
|
|
488
|
-
latest: string;
|
|
489
|
-
compatibleVersion: string; // e.g. "@tyvm/knowhow-module-script@0.0.4"
|
|
490
|
-
publishedAt: string;
|
|
491
|
-
needsUpdate: boolean;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
const updates: UpdateInfo[] = [];
|
|
495
|
-
|
|
496
|
-
for (const mod of installable) {
|
|
497
|
-
const registryInfo = await fetchNpmRegistryInfo(mod);
|
|
498
|
-
if (!registryInfo) {
|
|
499
|
-
console.log(` ⚠️ ${mod}: could not fetch registry info (skipping)`);
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
const installed = getInstalledVersion(mod, knowhowDir);
|
|
503
|
-
const { latestVersion, publishedAt } = registryInfo;
|
|
504
|
-
// Find the latest compatible version for the current Node.js engine
|
|
505
|
-
const compatibleInstallTarget = await fetchLatestCompatibleVersion(mod);
|
|
506
|
-
const compatibleVersion = compatibleInstallTarget.replace(/^[^@]+@/, ""); // strip "pkg@" prefix
|
|
507
|
-
const needsUpdate = installed !== compatibleVersion;
|
|
508
|
-
const timeAgo = formatRelativeTime(publishedAt);
|
|
509
|
-
|
|
510
|
-
if (needsUpdate) {
|
|
511
|
-
const installedStr = installed ?? "(not installed)";
|
|
512
|
-
const versionLabel = compatibleVersion !== latestVersion
|
|
513
|
-
? `${compatibleVersion} (latest compatible with Node ${process.version}; absolute latest: ${latestVersion})`
|
|
514
|
-
: compatibleVersion;
|
|
515
|
-
console.log(` 📦 ${mod}`);
|
|
516
|
-
console.log(` installed: ${installedStr} → latest: ${versionLabel} (published ${timeAgo})`);
|
|
517
|
-
} else {
|
|
518
|
-
console.log(` ✅ ${mod} v${compatibleVersion} (up to date, published ${timeAgo})`);
|
|
519
|
-
}
|
|
520
|
-
updates.push({ mod, installed, latest: compatibleVersion, compatibleVersion: compatibleInstallTarget, publishedAt, needsUpdate });
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
const toUpdate = updates.filter((u) => u.needsUpdate);
|
|
524
|
-
|
|
525
|
-
if (toUpdate.length === 0) {
|
|
526
|
-
console.log(`\n✅ All modules are up to date!`);
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
console.log(`\n${toUpdate.length} module(s) can be updated.`);
|
|
531
|
-
|
|
532
|
-
if (!skipConfirm) {
|
|
533
|
-
const confirmed = await promptConfirm(`Update ${toUpdate.length} module(s) now?`);
|
|
534
|
-
if (!confirmed) {
|
|
535
|
-
console.log("Cancelled.");
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
console.log("");
|
|
541
|
-
for (const { mod, compatibleVersion } of toUpdate) {
|
|
542
|
-
console.log(` 📦 Updating ${compatibleVersion}...`);
|
|
543
|
-
npmInstallToKnowhow(compatibleVersion, knowhowDir);
|
|
544
|
-
console.log(` ✅ Updated ${mod}`);
|
|
545
|
-
}
|
|
546
|
-
console.log(`\n🎉 Update complete! ${toUpdate.length} module(s) updated.`);
|
|
547
|
-
} catch (error: any) {
|
|
548
|
-
console.error("Error during modules update:", error.message ?? error);
|
|
549
|
-
process.exit(1);
|
|
550
|
-
}
|
|
551
|
-
});
|
|
552
217
|
}
|
|
@@ -31,10 +31,14 @@ export class ModulesService {
|
|
|
31
31
|
// puts packages), then cwd node_modules, then global node_modules.
|
|
32
32
|
// This allows modules installed via `knowhow modules install` to be found
|
|
33
33
|
// even when knowhow itself is installed globally.
|
|
34
|
+
const cwdPaths = (require as any).resolve
|
|
35
|
+
? require.resolve.paths?.("") || []
|
|
36
|
+
: [];
|
|
34
37
|
const resolvePaths = [
|
|
35
38
|
path.join(process.cwd(), ".knowhow", "node_modules"),
|
|
36
39
|
path.join(os.homedir(), ".knowhow", "node_modules"),
|
|
37
40
|
path.join(process.cwd(), "node_modules"),
|
|
41
|
+
...cwdPaths,
|
|
38
42
|
];
|
|
39
43
|
|
|
40
44
|
for (const modulePath of allModulePaths) {
|
|
@@ -53,31 +57,22 @@ export class ModulesService {
|
|
|
53
57
|
resolvedPath = modulePath; // fall back to normal require resolution
|
|
54
58
|
}
|
|
55
59
|
}
|
|
60
|
+
const rawModule = require(resolvedPath);
|
|
61
|
+
const importedModule = (rawModule.default || rawModule) as KnowhowModule;
|
|
62
|
+
context.Events?.log(
|
|
63
|
+
"ModulesService",
|
|
64
|
+
`🔌 Loading module: ${modulePath} (resolved: ${resolvedPath})`
|
|
65
|
+
);
|
|
66
|
+
await importedModule.init({
|
|
67
|
+
config,
|
|
68
|
+
cwd: process.cwd(),
|
|
69
|
+
context: context as ModuleContext,
|
|
70
|
+
});
|
|
71
|
+
context.Events?.log(
|
|
72
|
+
"ModulesService",
|
|
73
|
+
`✅ Module initialized: ${modulePath} (tools: ${importedModule.tools.length}, agents: ${importedModule.agents.length}, plugins: ${importedModule.plugins.length}, clients: ${importedModule.clients.length})`
|
|
74
|
+
);
|
|
56
75
|
|
|
57
|
-
let importedModule: KnowhowModule;
|
|
58
|
-
try {
|
|
59
|
-
const rawModule = require(resolvedPath);
|
|
60
|
-
importedModule = (rawModule.default || rawModule) as KnowhowModule;
|
|
61
|
-
context.Events?.log(
|
|
62
|
-
"ModulesService",
|
|
63
|
-
`🔌 Loading module: ${modulePath} (resolved: ${resolvedPath})`
|
|
64
|
-
);
|
|
65
|
-
await importedModule.init({
|
|
66
|
-
config,
|
|
67
|
-
cwd: process.cwd(),
|
|
68
|
-
context: context as ModuleContext,
|
|
69
|
-
});
|
|
70
|
-
context.Events?.log(
|
|
71
|
-
"ModulesService",
|
|
72
|
-
`✅ Module initialized: ${modulePath} (tools: ${importedModule.tools.length}, agents: ${importedModule.agents.length}, plugins: ${importedModule.plugins.length}, clients: ${importedModule.clients.length})`
|
|
73
|
-
);
|
|
74
|
-
} catch (err: any) {
|
|
75
|
-
process.stderr.write(
|
|
76
|
-
`\n⚠️ Failed to load module "${modulePath}": ${err.message}\n` +
|
|
77
|
-
` Run "knowhow modules setup --global" or "knowhow modules install ${modulePath} --global" to fix this.\n\n`
|
|
78
|
-
);
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
76
|
// Only register tools/agents/plugins/clients if the relevant services
|
|
82
77
|
// are available in context (they may not be during early CLI command registration)
|
|
83
78
|
if (context.Agents) {
|
package/ts_build/package.json
CHANGED
|
@@ -40,7 +40,6 @@ const fs = __importStar(require("fs"));
|
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const os = __importStar(require("os"));
|
|
42
42
|
const config_1 = require("../config");
|
|
43
|
-
const readline = __importStar(require("readline"));
|
|
44
43
|
exports.BUILTIN_MODULES = [
|
|
45
44
|
"@tyvm/knowhow-module-script",
|
|
46
45
|
"@tyvm/knowhow-module-terminal",
|
|
@@ -64,200 +63,6 @@ function npmInstallToKnowhow(mod, knowhowDir) {
|
|
|
64
63
|
encoding: "utf-8",
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
|
-
function isModuleInstalled(mod, knowhowDir) {
|
|
68
|
-
try {
|
|
69
|
-
require.resolve(mod, {
|
|
70
|
-
paths: [path.join(knowhowDir, "node_modules"), knowhowDir],
|
|
71
|
-
});
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async function fetchNpmRegistryInfo(mod) {
|
|
79
|
-
try {
|
|
80
|
-
const output = (0, child_process_1.execSync)(`npm view ${mod} version time --json`, {
|
|
81
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
82
|
-
encoding: "utf-8",
|
|
83
|
-
});
|
|
84
|
-
const parsed = JSON.parse(output.trim());
|
|
85
|
-
let latestVersion;
|
|
86
|
-
let timestamps = {};
|
|
87
|
-
if (Array.isArray(parsed)) {
|
|
88
|
-
latestVersion = parsed[0];
|
|
89
|
-
timestamps = parsed[1] || {};
|
|
90
|
-
}
|
|
91
|
-
else if (parsed && typeof parsed === "object") {
|
|
92
|
-
latestVersion = parsed["version"] || "";
|
|
93
|
-
timestamps = parsed["time"] || {};
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
latestVersion = String(parsed);
|
|
97
|
-
}
|
|
98
|
-
const publishedAt = timestamps[latestVersion] || timestamps["modified"] || "";
|
|
99
|
-
return { latestVersion, publishedAt };
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function nodeSatisfiesRange(nodeVersion, range) {
|
|
106
|
-
if (!range || range === "*" || range === "")
|
|
107
|
-
return true;
|
|
108
|
-
const vMatch = nodeVersion.replace(/^v/, "").match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
109
|
-
if (!vMatch)
|
|
110
|
-
return true;
|
|
111
|
-
const vMajor = parseInt(vMatch[1], 10);
|
|
112
|
-
const vMinor = parseInt(vMatch[2] ?? "0", 10);
|
|
113
|
-
const vPatch = parseInt(vMatch[3] ?? "0", 10);
|
|
114
|
-
const vNum = vMajor * 1_000_000 + vMinor * 1_000 + vPatch;
|
|
115
|
-
function parseVersion(s) {
|
|
116
|
-
const m = s.trim().match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
117
|
-
if (!m)
|
|
118
|
-
return 0;
|
|
119
|
-
return parseInt(m[1], 10) * 1_000_000 + parseInt(m[2] ?? "0", 10) * 1_000 + parseInt(m[3] ?? "0", 10);
|
|
120
|
-
}
|
|
121
|
-
if (range.includes("||")) {
|
|
122
|
-
return range.split("||").some((r) => nodeSatisfiesRange(nodeVersion, r.trim()));
|
|
123
|
-
}
|
|
124
|
-
const parts = range.trim().split(/\s+/);
|
|
125
|
-
for (const part of parts) {
|
|
126
|
-
const gteMatch = part.match(/^>=(.+)/);
|
|
127
|
-
const gtMatch = part.match(/^>(?!=)(.+)/);
|
|
128
|
-
const lteMatch = part.match(/^<=(.+)/);
|
|
129
|
-
const ltMatch = part.match(/^<(?!=)(.+)/);
|
|
130
|
-
const caretMatch = part.match(/^\^(\d+)/);
|
|
131
|
-
const tildeMatch = part.match(/^~(\d+)(?:\.(\d+))?/);
|
|
132
|
-
const exactMatch = part.match(/^(\d+(?:\.\d+)*)/);
|
|
133
|
-
if (gteMatch) {
|
|
134
|
-
if (vNum < parseVersion(gteMatch[1]))
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
else if (gtMatch) {
|
|
138
|
-
if (vNum <= parseVersion(gtMatch[1]))
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
else if (lteMatch) {
|
|
142
|
-
if (vNum > parseVersion(lteMatch[1]))
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
else if (ltMatch) {
|
|
146
|
-
if (vNum >= parseVersion(ltMatch[1]))
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
else if (caretMatch) {
|
|
150
|
-
const base = parseVersion(caretMatch[1]);
|
|
151
|
-
const baseMajor = parseInt(caretMatch[1], 10);
|
|
152
|
-
if (vNum < base || vMajor !== baseMajor)
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
else if (tildeMatch) {
|
|
156
|
-
const baseMajor = parseInt(tildeMatch[1], 10);
|
|
157
|
-
const baseMinor = parseInt(tildeMatch[2] ?? "0", 10);
|
|
158
|
-
const base = parseVersion(`${baseMajor}.${baseMinor}`);
|
|
159
|
-
const nextMinor = parseVersion(`${baseMajor}.${baseMinor + 1}`);
|
|
160
|
-
if (vNum < base || vNum >= nextMinor)
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
else if (exactMatch && !part.startsWith("v")) {
|
|
164
|
-
const xMatch = part.match(/^(\d+)(?:\.x)?$/);
|
|
165
|
-
if (xMatch) {
|
|
166
|
-
if (vMajor !== parseInt(xMatch[1], 10))
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
async function fetchLatestCompatibleVersion(mod) {
|
|
174
|
-
const currentNode = process.version;
|
|
175
|
-
try {
|
|
176
|
-
const encodedMod = mod.replace(/^@/, "").replace("/", "%2F");
|
|
177
|
-
const registryUrl = mod.startsWith("@")
|
|
178
|
-
? `https://registry.npmjs.org/@${encodedMod}`
|
|
179
|
-
: `https://registry.npmjs.org/${mod}`;
|
|
180
|
-
const response = await fetch(registryUrl);
|
|
181
|
-
if (!response.ok)
|
|
182
|
-
throw new Error(`Registry returned ${response.status}`);
|
|
183
|
-
const pkgData = await response.json();
|
|
184
|
-
const versionsMap = pkgData.versions ?? {};
|
|
185
|
-
const allVersions = Object.keys(versionsMap);
|
|
186
|
-
const enginesByVersion = {};
|
|
187
|
-
for (const [v, meta] of Object.entries(versionsMap)) {
|
|
188
|
-
enginesByVersion[v] = meta?.engines?.node ?? "";
|
|
189
|
-
}
|
|
190
|
-
if (allVersions.length === 0)
|
|
191
|
-
return `${mod}@latest`;
|
|
192
|
-
const sorted = [...allVersions].sort((a, b) => {
|
|
193
|
-
const pa = a.split(".").map(Number);
|
|
194
|
-
const pb = b.split(".").map(Number);
|
|
195
|
-
for (let i = 0; i < 3; i++) {
|
|
196
|
-
if ((pa[i] ?? 0) !== (pb[i] ?? 0))
|
|
197
|
-
return (pb[i] ?? 0) - (pa[i] ?? 0);
|
|
198
|
-
}
|
|
199
|
-
return 0;
|
|
200
|
-
});
|
|
201
|
-
for (const v of sorted) {
|
|
202
|
-
const engineRange = enginesByVersion[v] ?? "";
|
|
203
|
-
if (nodeSatisfiesRange(currentNode, engineRange)) {
|
|
204
|
-
return `${mod}@${v}`;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
console.warn(`⚠️ No version of ${mod} found compatible with Node ${currentNode}. Installing latest anyway.`);
|
|
208
|
-
return `${mod}@latest`;
|
|
209
|
-
}
|
|
210
|
-
catch {
|
|
211
|
-
return `${mod}@latest`;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
function getInstalledVersion(mod, knowhowDir) {
|
|
215
|
-
try {
|
|
216
|
-
const pkgJsonPath = path.join(knowhowDir, "node_modules", mod, "package.json");
|
|
217
|
-
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
218
|
-
return pkgJson.version ?? null;
|
|
219
|
-
}
|
|
220
|
-
catch {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
function formatRelativeTime(isoDate) {
|
|
225
|
-
if (!isoDate)
|
|
226
|
-
return "unknown";
|
|
227
|
-
const then = new Date(isoDate).getTime();
|
|
228
|
-
if (isNaN(then))
|
|
229
|
-
return "unknown";
|
|
230
|
-
const diffMs = Date.now() - then;
|
|
231
|
-
const diffMins = Math.floor(diffMs / 60_000);
|
|
232
|
-
if (diffMins < 2)
|
|
233
|
-
return "just now";
|
|
234
|
-
if (diffMins < 60)
|
|
235
|
-
return `${diffMins} minutes ago`;
|
|
236
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
237
|
-
if (diffHours < 24)
|
|
238
|
-
return `${diffHours} hour${diffHours !== 1 ? "s" : ""} ago`;
|
|
239
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
240
|
-
if (diffDays < 30)
|
|
241
|
-
return `${diffDays} day${diffDays !== 1 ? "s" : ""} ago`;
|
|
242
|
-
const diffMonths = Math.floor(diffDays / 30);
|
|
243
|
-
if (diffMonths < 12)
|
|
244
|
-
return `${diffMonths} month${diffMonths !== 1 ? "s" : ""} ago`;
|
|
245
|
-
const diffYears = Math.floor(diffMonths / 12);
|
|
246
|
-
return `${diffYears} year${diffYears !== 1 ? "s" : ""} ago`;
|
|
247
|
-
}
|
|
248
|
-
function promptConfirm(question) {
|
|
249
|
-
return new Promise((resolve) => {
|
|
250
|
-
const rl = readline.createInterface({
|
|
251
|
-
input: process.stdin,
|
|
252
|
-
output: process.stdout,
|
|
253
|
-
});
|
|
254
|
-
rl.question(`${question} (y/N) `, (answer) => {
|
|
255
|
-
rl.close();
|
|
256
|
-
resolve(answer.trim().toLowerCase() === "y" ||
|
|
257
|
-
answer.trim().toLowerCase() === "yes");
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
66
|
function addModulesCommand(program) {
|
|
262
67
|
const modulesCmd = program
|
|
263
68
|
.command("modules")
|
|
@@ -275,32 +80,28 @@ function addModulesCommand(program) {
|
|
|
275
80
|
: ".knowhow/knowhow.json";
|
|
276
81
|
if (!cfg.modules)
|
|
277
82
|
cfg.modules = [];
|
|
83
|
+
const toAdd = exports.BUILTIN_MODULES.filter((m) => !cfg.modules.includes(m));
|
|
84
|
+
if (toAdd.length === 0) {
|
|
85
|
+
console.log(`✅ All default modules are already in ${configLabel}. Nothing to do.`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
278
88
|
const knowhowDir = getKnowhowDir(isGlobal);
|
|
279
89
|
ensureKnowhowPackageJson(knowhowDir);
|
|
280
|
-
|
|
281
|
-
for (const mod of exports.BUILTIN_MODULES) {
|
|
90
|
+
for (const mod of toAdd) {
|
|
282
91
|
if (!mod.startsWith(".") && !mod.startsWith("/")) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
console.log(`📦 Installing ${installTarget}...`);
|
|
286
|
-
npmInstallToKnowhow(installTarget, knowhowDir);
|
|
287
|
-
console.log(`✅ Installed ${mod}`);
|
|
288
|
-
anyChanges = true;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
if (!cfg.modules.includes(mod)) {
|
|
292
|
-
cfg.modules.push(mod);
|
|
293
|
-
console.log(`✅ Added ${mod} to ${configLabel}`);
|
|
294
|
-
anyChanges = true;
|
|
92
|
+
console.log(`📦 Installing ${mod}...`);
|
|
93
|
+
npmInstallToKnowhow(mod, knowhowDir);
|
|
295
94
|
}
|
|
95
|
+
cfg.modules.push(mod);
|
|
96
|
+
console.log(`✅ Added ${mod} to ${configLabel}`);
|
|
296
97
|
}
|
|
297
|
-
if (
|
|
298
|
-
|
|
98
|
+
if (isGlobal) {
|
|
99
|
+
await (0, config_1.updateGlobalConfig)(cfg);
|
|
299
100
|
}
|
|
300
101
|
else {
|
|
301
|
-
await (
|
|
302
|
-
console.log(`\n🎉 Setup complete! Modules ready in ${knowhowDir}/node_modules.`);
|
|
102
|
+
await (0, config_1.updateConfig)(cfg);
|
|
303
103
|
}
|
|
104
|
+
console.log(`\n🎉 Setup complete! ${toAdd.length} module(s) added to ${configLabel}`);
|
|
304
105
|
}
|
|
305
106
|
catch (error) {
|
|
306
107
|
console.error("Error during modules setup:", error.message ?? error);
|
|
@@ -312,7 +113,6 @@ function addModulesCommand(program) {
|
|
|
312
113
|
.description("Install a module into .knowhow/node_modules and add it to your config. " +
|
|
313
114
|
"If no module name is given, installs all modules already in the config.")
|
|
314
115
|
.option("--global", "Use the global config (~/.knowhow/knowhow.json)")
|
|
315
|
-
.option("--latest", "Force install the latest version (bypasses package-lock)")
|
|
316
116
|
.action(async (moduleName, opts) => {
|
|
317
117
|
try {
|
|
318
118
|
const isGlobal = opts.global ?? false;
|
|
@@ -333,16 +133,14 @@ function addModulesCommand(program) {
|
|
|
333
133
|
console.log(`📦 Installing ${installable.length} module(s) from ${configLabel} into ${knowhowDir}/node_modules...`);
|
|
334
134
|
for (const mod of installable) {
|
|
335
135
|
console.log(` 📦 Installing ${mod}...`);
|
|
336
|
-
|
|
337
|
-
npmInstallToKnowhow(installTarget, knowhowDir);
|
|
136
|
+
npmInstallToKnowhow(mod, knowhowDir);
|
|
338
137
|
console.log(` ✅ Installed ${mod}`);
|
|
339
138
|
}
|
|
340
139
|
console.log(`\n🎉 All modules installed!`);
|
|
341
140
|
return;
|
|
342
141
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
npmInstallToKnowhow(installTarget, knowhowDir);
|
|
142
|
+
console.log(`📦 Installing ${moduleName} into ${knowhowDir}/node_modules...`);
|
|
143
|
+
npmInstallToKnowhow(moduleName, knowhowDir);
|
|
346
144
|
console.log(`✅ Installed ${moduleName}`);
|
|
347
145
|
if (!cfg.modules.includes(moduleName)) {
|
|
348
146
|
cfg.modules.push(moduleName);
|
|
@@ -405,83 +203,5 @@ function addModulesCommand(program) {
|
|
|
405
203
|
process.exit(1);
|
|
406
204
|
}
|
|
407
205
|
});
|
|
408
|
-
modulesCmd
|
|
409
|
-
.command("update")
|
|
410
|
-
.description("Check for updates to all modules in your config and update them. " +
|
|
411
|
-
"Shows installed vs latest version with publish date before updating.")
|
|
412
|
-
.option("--global", "Use the global config (~/.knowhow/knowhow.json)")
|
|
413
|
-
.option("-y, --yes", "Skip confirmation prompt and update all outdated modules automatically")
|
|
414
|
-
.action(async (opts) => {
|
|
415
|
-
try {
|
|
416
|
-
const isGlobal = opts.global ?? false;
|
|
417
|
-
const skipConfirm = opts.yes ?? false;
|
|
418
|
-
const cfg = isGlobal ? await (0, config_1.getGlobalConfig)() : await (0, config_1.getConfig)();
|
|
419
|
-
const configLabel = isGlobal
|
|
420
|
-
? "~/.knowhow/knowhow.json"
|
|
421
|
-
: ".knowhow/knowhow.json";
|
|
422
|
-
if (!cfg.modules || cfg.modules.length === 0) {
|
|
423
|
-
console.log(`ℹ No modules found in ${configLabel}.`);
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
const knowhowDir = getKnowhowDir(isGlobal);
|
|
427
|
-
ensureKnowhowPackageJson(knowhowDir);
|
|
428
|
-
const installable = cfg.modules.filter((m) => !m.startsWith(".") && !m.startsWith("/"));
|
|
429
|
-
if (installable.length === 0) {
|
|
430
|
-
console.log(`ℹ No npm modules found in ${configLabel}.`);
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
console.log(`🔍 Checking for updates to ${installable.length} module(s)...\n`);
|
|
434
|
-
const updates = [];
|
|
435
|
-
for (const mod of installable) {
|
|
436
|
-
const registryInfo = await fetchNpmRegistryInfo(mod);
|
|
437
|
-
if (!registryInfo) {
|
|
438
|
-
console.log(` ⚠️ ${mod}: could not fetch registry info (skipping)`);
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
const installed = getInstalledVersion(mod, knowhowDir);
|
|
442
|
-
const { latestVersion, publishedAt } = registryInfo;
|
|
443
|
-
const compatibleInstallTarget = await fetchLatestCompatibleVersion(mod);
|
|
444
|
-
const compatibleVersion = compatibleInstallTarget.replace(/^[^@]+@/, "");
|
|
445
|
-
const needsUpdate = installed !== compatibleVersion;
|
|
446
|
-
const timeAgo = formatRelativeTime(publishedAt);
|
|
447
|
-
if (needsUpdate) {
|
|
448
|
-
const installedStr = installed ?? "(not installed)";
|
|
449
|
-
const versionLabel = compatibleVersion !== latestVersion
|
|
450
|
-
? `${compatibleVersion} (latest compatible with Node ${process.version}; absolute latest: ${latestVersion})`
|
|
451
|
-
: compatibleVersion;
|
|
452
|
-
console.log(` 📦 ${mod}`);
|
|
453
|
-
console.log(` installed: ${installedStr} → latest: ${versionLabel} (published ${timeAgo})`);
|
|
454
|
-
}
|
|
455
|
-
else {
|
|
456
|
-
console.log(` ✅ ${mod} v${compatibleVersion} (up to date, published ${timeAgo})`);
|
|
457
|
-
}
|
|
458
|
-
updates.push({ mod, installed, latest: compatibleVersion, compatibleVersion: compatibleInstallTarget, publishedAt, needsUpdate });
|
|
459
|
-
}
|
|
460
|
-
const toUpdate = updates.filter((u) => u.needsUpdate);
|
|
461
|
-
if (toUpdate.length === 0) {
|
|
462
|
-
console.log(`\n✅ All modules are up to date!`);
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
console.log(`\n${toUpdate.length} module(s) can be updated.`);
|
|
466
|
-
if (!skipConfirm) {
|
|
467
|
-
const confirmed = await promptConfirm(`Update ${toUpdate.length} module(s) now?`);
|
|
468
|
-
if (!confirmed) {
|
|
469
|
-
console.log("Cancelled.");
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
console.log("");
|
|
474
|
-
for (const { mod, compatibleVersion } of toUpdate) {
|
|
475
|
-
console.log(` 📦 Updating ${compatibleVersion}...`);
|
|
476
|
-
npmInstallToKnowhow(compatibleVersion, knowhowDir);
|
|
477
|
-
console.log(` ✅ Updated ${mod}`);
|
|
478
|
-
}
|
|
479
|
-
console.log(`\n🎉 Update complete! ${toUpdate.length} module(s) updated.`);
|
|
480
|
-
}
|
|
481
|
-
catch (error) {
|
|
482
|
-
console.error("Error during modules update:", error.message ?? error);
|
|
483
|
-
process.exit(1);
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
206
|
}
|
|
487
207
|
//# sourceMappingURL=modules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../../src/commands/modules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwRA,8CA+QC;AAtiBD,iDAAyC;AACzC,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,sCAAyF;AACzF,mDAAqC;AAGxB,QAAA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,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -52,10 +52,14 @@ class ModulesService {
|
|
|
52
52
|
context = { ...(await this.getDefaultContext()) };
|
|
53
53
|
}
|
|
54
54
|
const allModulePaths = config.modules;
|
|
55
|
+
const cwdPaths = require.resolve
|
|
56
|
+
? require.resolve.paths?.("") || []
|
|
57
|
+
: [];
|
|
55
58
|
const resolvePaths = [
|
|
56
59
|
path.join(process.cwd(), ".knowhow", "node_modules"),
|
|
57
60
|
path.join(os.homedir(), ".knowhow", "node_modules"),
|
|
58
61
|
path.join(process.cwd(), "node_modules"),
|
|
62
|
+
...cwdPaths,
|
|
59
63
|
];
|
|
60
64
|
for (const modulePath of allModulePaths) {
|
|
61
65
|
let resolvedPath;
|
|
@@ -70,23 +74,15 @@ class ModulesService {
|
|
|
70
74
|
resolvedPath = modulePath;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
context.Events?.log("ModulesService", `✅ Module initialized: ${modulePath} (tools: ${importedModule.tools.length}, agents: ${importedModule.agents.length}, plugins: ${importedModule.plugins.length}, clients: ${importedModule.clients.length})`);
|
|
84
|
-
}
|
|
85
|
-
catch (err) {
|
|
86
|
-
process.stderr.write(`\n⚠️ Failed to load module "${modulePath}": ${err.message}\n` +
|
|
87
|
-
` Run "knowhow modules setup --global" or "knowhow modules install ${modulePath} --global" to fix this.\n\n`);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
77
|
+
const rawModule = require(resolvedPath);
|
|
78
|
+
const importedModule = (rawModule.default || rawModule);
|
|
79
|
+
context.Events?.log("ModulesService", `🔌 Loading module: ${modulePath} (resolved: ${resolvedPath})`);
|
|
80
|
+
await importedModule.init({
|
|
81
|
+
config,
|
|
82
|
+
cwd: process.cwd(),
|
|
83
|
+
context: context,
|
|
84
|
+
});
|
|
85
|
+
context.Events?.log("ModulesService", `✅ Module initialized: ${modulePath} (tools: ${importedModule.tools.length}, agents: ${importedModule.agents.length}, plugins: ${importedModule.plugins.length}, clients: ${importedModule.clients.length})`);
|
|
90
86
|
if (context.Agents) {
|
|
91
87
|
for (const agent of importedModule.agents) {
|
|
92
88
|
context.Agents.registerAgent(agent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,uCAAyB;AAEzB,yCAA0D;AAE1D,2BAA+B;AAC/B,uCAA4C;AAE5C,MAAa,cAAc;IACzB,KAAK,CAAC,iBAAiB;QACrB,OAAO,EAAE,GAAG,IAAA,YAAQ,GAAE,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,SAAiC;QAC5D,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACtD,OAAO,EAAE,GAAG,cAAc,EAAE,GAAG,SAAS,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,MAAmC,EACnC,OAAgC;QAGhC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC;QACpD,CAAC;QAED,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC;QAMtC,MAAM,YAAY,GAAG;YACnB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,cAAc,CAAC;YACpD,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,cAAc,CAAC;YACnD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC;
|
|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