@cannbot-ai/install-helper 0.0.2-beta.36 → 0.0.2-beta.37
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/dist/config/repository.yaml +2 -0
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -980,14 +980,17 @@ function loadScanConfig() {
|
|
|
980
980
|
const configPath = join7(__dirname3, "config", "repository.yaml");
|
|
981
981
|
try {
|
|
982
982
|
const config = parseYaml2(readFileSync5(configPath, "utf-8"));
|
|
983
|
+
const ttlHours = config.scanCacheTtlHours || 24;
|
|
983
984
|
return {
|
|
984
985
|
skillDirs: config.scanDirs || ["ops", "model", "graph", "infra", "ops-lab", "runtime"],
|
|
985
|
-
pluginDirs: config.pluginDirs || ["plugins-official", "plugins-community"]
|
|
986
|
+
pluginDirs: config.pluginDirs || ["plugins-official", "plugins-community"],
|
|
987
|
+
cacheTtlMs: ttlHours * 60 * 60 * 1e3
|
|
986
988
|
};
|
|
987
989
|
} catch {
|
|
988
990
|
return {
|
|
989
991
|
skillDirs: ["ops", "model", "graph", "infra", "ops-lab", "runtime"],
|
|
990
|
-
pluginDirs: ["plugins-official", "plugins-community"]
|
|
992
|
+
pluginDirs: ["plugins-official", "plugins-community"],
|
|
993
|
+
cacheTtlMs: 24 * 60 * 60 * 1e3
|
|
991
994
|
};
|
|
992
995
|
}
|
|
993
996
|
}
|
|
@@ -1099,7 +1102,7 @@ function readScanCache() {
|
|
|
1099
1102
|
const cache = JSON.parse(content);
|
|
1100
1103
|
if (!cache.skills || !cache.timestamp) return null;
|
|
1101
1104
|
const age = Date.now() - cache.timestamp;
|
|
1102
|
-
if (age >
|
|
1105
|
+
if (age > scanConfig.cacheTtlMs) return null;
|
|
1103
1106
|
return cache;
|
|
1104
1107
|
} catch {
|
|
1105
1108
|
return null;
|
|
@@ -3188,9 +3191,7 @@ async function updateCommand(pluginNames, options) {
|
|
|
3188
3191
|
const repoManager = createRepositoryManager();
|
|
3189
3192
|
const updateSpinner = createSpinner(t("update_updating") + "...");
|
|
3190
3193
|
updateSpinner.start();
|
|
3191
|
-
await repoManager.
|
|
3192
|
-
const repoPath = repoManager.getRepoPath();
|
|
3193
|
-
await repoManager.ensureRepoAndScan();
|
|
3194
|
+
const repoPath = await repoManager.ensureRepoAndScan();
|
|
3194
3195
|
updateSpinner.succeed(t("install_repo_ready"));
|
|
3195
3196
|
const allPlugins = getAllPlugins();
|
|
3196
3197
|
const results = [];
|
|
@@ -3244,7 +3245,8 @@ async function infoCommand(pluginName) {
|
|
|
3244
3245
|
return;
|
|
3245
3246
|
}
|
|
3246
3247
|
const installed = scanInstalled();
|
|
3247
|
-
const
|
|
3248
|
+
const inst = installed.find((p) => p.id === plugin.id);
|
|
3249
|
+
const isInstalled = !!inst;
|
|
3248
3250
|
const statusText = isInstalled ? chalk13.green(`\u2713 ${t("status_installed")}`) : chalk13.dim(`\u2014 ${t("status_not_installed")}`);
|
|
3249
3251
|
console.log();
|
|
3250
3252
|
console.log(chalk13.bold(` ${plugin.displayName}`));
|
|
@@ -3253,8 +3255,8 @@ async function infoCommand(pluginName) {
|
|
|
3253
3255
|
console.log(` ${chalk13.dim(t("info_description") + ":")} ${plugin.description}`);
|
|
3254
3256
|
console.log(` ${chalk13.dim("ID:")} ${plugin.id}`);
|
|
3255
3257
|
console.log(` ${chalk13.dim(t("info_status") + ":")} ${statusText}`);
|
|
3256
|
-
console.log(` ${chalk13.dim(t("info_skills") + ":")} ${plugin.skills}`);
|
|
3257
|
-
console.log(` ${chalk13.dim(t("info_agents") + ":")} ${plugin.agents}`);
|
|
3258
|
+
console.log(` ${chalk13.dim(t("info_skills") + ":")} ${inst ? inst.skillsCount : plugin.skills}`);
|
|
3259
|
+
console.log(` ${chalk13.dim(t("info_agents") + ":")} ${inst ? inst.agentsCount : plugin.agents}`);
|
|
3258
3260
|
console.log(` ${chalk13.dim(t("info_aliases") + ":")} ${plugin.aliases.join(", ")}`);
|
|
3259
3261
|
console.log();
|
|
3260
3262
|
try {
|