@nocobase/cli 2.1.4-test.6 → 2.1.5
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Command, Flags } from '@oclif/core';
|
|
10
10
|
import { confirm } from "../../lib/inquirer.js";
|
|
11
|
-
import { setVerboseMode
|
|
11
|
+
import { setVerboseMode } from '../../lib/ui.js';
|
|
12
12
|
import { installNocoBaseSkills } from '../../lib/skills-manager.js';
|
|
13
13
|
export default class SkillsInstall extends Command {
|
|
14
14
|
static summary = 'Install the NocoBase AI coding skills globally';
|
|
@@ -55,20 +55,9 @@ export default class SkillsInstall extends Command {
|
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const shouldShowLoading = !flags.json && !flags.verbose;
|
|
59
|
-
if (shouldShowLoading) {
|
|
60
|
-
startTask(flags.version
|
|
61
|
-
? `Installing NocoBase AI coding skills ${flags.version}...`
|
|
62
|
-
: 'Installing NocoBase AI coding skills...');
|
|
63
|
-
}
|
|
64
58
|
const result = await installNocoBaseSkills({
|
|
65
59
|
targetVersion: flags.version,
|
|
66
60
|
verbose: flags.verbose,
|
|
67
|
-
onProgress: shouldShowLoading ? updateTask : undefined,
|
|
68
|
-
}).finally(() => {
|
|
69
|
-
if (shouldShowLoading) {
|
|
70
|
-
stopTask();
|
|
71
|
-
}
|
|
72
61
|
});
|
|
73
62
|
if (flags.json) {
|
|
74
63
|
this.log(JSON.stringify({
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Command, Flags } from '@oclif/core';
|
|
10
10
|
import { confirm } from "../../lib/inquirer.js";
|
|
11
|
-
import { setVerboseMode, startTask, stopTask
|
|
11
|
+
import { setVerboseMode, startTask, stopTask } from '../../lib/ui.js';
|
|
12
12
|
import { updateNocoBaseSkills } from '../../lib/skills-manager.js';
|
|
13
13
|
export default class SkillsUpdate extends Command {
|
|
14
14
|
static summary = 'Update the globally installed NocoBase AI coding skills';
|
|
@@ -64,7 +64,6 @@ export default class SkillsUpdate extends Command {
|
|
|
64
64
|
const result = await updateNocoBaseSkills({
|
|
65
65
|
targetVersion: flags.version,
|
|
66
66
|
verbose: flags.verbose,
|
|
67
|
-
onProgress: shouldShowLoading ? updateTask : undefined,
|
|
68
67
|
}).finally(() => {
|
|
69
68
|
if (shouldShowLoading) {
|
|
70
69
|
stopTask();
|
|
@@ -21,8 +21,8 @@ const NOCOBASE_SKILLS_NAME_PREFIX = 'nocobase-';
|
|
|
21
21
|
// resolves and boots the package, even when the local skills installation is healthy.
|
|
22
22
|
const SKILLS_LIST_TIMEOUT_MS = 15000;
|
|
23
23
|
const SKILLS_NPM_VIEW_TIMEOUT_MS = 3000;
|
|
24
|
-
const SKILLS_PACK_TIMEOUT_MS =
|
|
25
|
-
const SKILLS_ADD_TIMEOUT_MS =
|
|
24
|
+
const SKILLS_PACK_TIMEOUT_MS = 30000;
|
|
25
|
+
const SKILLS_ADD_TIMEOUT_MS = 20000;
|
|
26
26
|
const NPM_REGISTRY_UNAVAILABLE_PATTERNS = [
|
|
27
27
|
'enotfound',
|
|
28
28
|
'eai_again',
|
|
@@ -279,7 +279,6 @@ async function prepareLocalSkillsPackage(globalRoot, options = {}, targetVersion
|
|
|
279
279
|
const cachedVersion = await readCachedSkillsVersion(cacheRoot);
|
|
280
280
|
await fsp.mkdir(cacheRoot, { recursive: true });
|
|
281
281
|
if (targetVersion && cachedVersion && compareVersions(cachedVersion, targetVersion) === 0) {
|
|
282
|
-
options.onProgress?.(`Using cached ${NOCOBASE_SKILLS_PACKAGE_NAME}@${targetVersion}...`);
|
|
283
282
|
return {
|
|
284
283
|
packageDir,
|
|
285
284
|
cleanup: async () => undefined,
|
|
@@ -288,14 +287,12 @@ async function prepareLocalSkillsPackage(globalRoot, options = {}, targetVersion
|
|
|
288
287
|
await fsp.rm(packRoot, { recursive: true, force: true });
|
|
289
288
|
await fsp.mkdir(packRoot, { recursive: true });
|
|
290
289
|
try {
|
|
291
|
-
options.
|
|
292
|
-
await (options.runFn ?? run)('npm', ['pack', ...(options.verbose ? [] : ['--silent']), packageSpec], {
|
|
290
|
+
await (options.runFn ?? run)('npm', ['pack', '--silent', packageSpec], {
|
|
293
291
|
cwd: packRoot,
|
|
294
292
|
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
295
293
|
errorName: 'npm pack',
|
|
296
294
|
timeoutMs: SKILLS_PACK_TIMEOUT_MS,
|
|
297
295
|
});
|
|
298
|
-
options.onProgress?.(`Extracting ${NOCOBASE_SKILLS_PACKAGE_NAME}...`);
|
|
299
296
|
const tarballPath = await resolvePackedSkillsTarball(packRoot);
|
|
300
297
|
await extractPackedSkillsTarball(tarballPath, cacheRoot, targetVersion);
|
|
301
298
|
}
|
|
@@ -388,7 +385,6 @@ async function persistManagedSkillsState(globalRoot, options = {}, installedVers
|
|
|
388
385
|
async function reinstallManagedSkills(globalRoot, options = {}, targetVersion) {
|
|
389
386
|
const prepared = await prepareLocalSkillsPackage(globalRoot, options, targetVersion);
|
|
390
387
|
try {
|
|
391
|
-
options.onProgress?.('Installing NocoBase AI coding skills globally...');
|
|
392
388
|
await (options.runFn ?? run)('npx', ['-y', 'skills', 'add', prepared.packageDir, '-g', '-y', '--skill', '*'], {
|
|
393
389
|
cwd: globalRoot,
|
|
394
390
|
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
@@ -411,7 +407,6 @@ async function removeObsoleteManagedSkills(globalRoot, installedSkillNames, opti
|
|
|
411
407
|
const packageSkillNames = await readCachedPackageSkillNames(globalRoot);
|
|
412
408
|
const obsoleteSkillNames = pickObsoleteManagedSkillNames(installedSkillNames, packageSkillNames);
|
|
413
409
|
for (const skillName of obsoleteSkillNames) {
|
|
414
|
-
options.onProgress?.(`Removing obsolete skill ${skillName}...`);
|
|
415
410
|
await (options.runFn ?? run)('npx', ['-y', 'skills', 'remove', skillName, '-g', '-y'], {
|
|
416
411
|
cwd: globalRoot,
|
|
417
412
|
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
@@ -421,7 +416,6 @@ async function removeObsoleteManagedSkills(globalRoot, installedSkillNames, opti
|
|
|
421
416
|
}
|
|
422
417
|
export async function installNocoBaseSkills(options = {}) {
|
|
423
418
|
const globalRoot = resolveSkillsRoot(options);
|
|
424
|
-
options.onProgress?.('Checking installed NocoBase AI coding skills...');
|
|
425
419
|
const status = await inspectSkillsStatus({
|
|
426
420
|
globalRoot,
|
|
427
421
|
commandOutputFn: options.commandOutputFn,
|
|
@@ -443,7 +437,6 @@ export async function installNocoBaseSkills(options = {}) {
|
|
|
443
437
|
await reinstallManagedSkills(globalRoot, options, installVersion);
|
|
444
438
|
}
|
|
445
439
|
await removeObsoleteManagedSkills(globalRoot, status.installedSkillNames, options);
|
|
446
|
-
options.onProgress?.('Verifying installed NocoBase AI coding skills...');
|
|
447
440
|
return {
|
|
448
441
|
action: 'installed',
|
|
449
442
|
status: await persistManagedSkillsState(globalRoot, options, targetVersion),
|
|
@@ -451,7 +444,6 @@ export async function installNocoBaseSkills(options = {}) {
|
|
|
451
444
|
}
|
|
452
445
|
export async function updateNocoBaseSkills(options = {}) {
|
|
453
446
|
const globalRoot = resolveSkillsRoot(options);
|
|
454
|
-
options.onProgress?.('Checking installed NocoBase AI coding skills...');
|
|
455
447
|
const status = await inspectSkillsStatus({
|
|
456
448
|
globalRoot,
|
|
457
449
|
commandOutputFn: options.commandOutputFn,
|
|
@@ -495,7 +487,6 @@ export async function updateNocoBaseSkills(options = {}) {
|
|
|
495
487
|
await reinstallManagedSkills(globalRoot, options, installVersion);
|
|
496
488
|
}
|
|
497
489
|
await removeObsoleteManagedSkills(globalRoot, status.installedSkillNames, options);
|
|
498
|
-
options.onProgress?.('Verifying installed NocoBase AI coding skills...');
|
|
499
490
|
return {
|
|
500
491
|
action: 'updated',
|
|
501
492
|
status: await persistManagedSkillsState(globalRoot, options, targetVersion),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "NocoBase Command Line Tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/generated/command-registry.js",
|
|
@@ -142,5 +142,6 @@
|
|
|
142
142
|
"repository": {
|
|
143
143
|
"type": "git",
|
|
144
144
|
"url": "git+https://github.com/nocobase/nocobase.git"
|
|
145
|
-
}
|
|
145
|
+
},
|
|
146
|
+
"gitHead": "fb6550c3c607ea45ce5389dafe9d98f17f201aad"
|
|
146
147
|
}
|