@aikdna/kdna-cli 0.22.0 → 0.22.2
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 +10 -6
- package/src/cli.js +6 -1
- package/src/cmds/demo.js +34 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-cli",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "KDNA CLI — runtime control plane for verifying, installing, loading, comparing, publishing, and auditing existing .kdna assets.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -23,19 +23,23 @@
|
|
|
23
23
|
"lint": "eslint src/ validators/ tests/",
|
|
24
24
|
"format": "prettier --write .",
|
|
25
25
|
"format:check": "prettier --check .",
|
|
26
|
-
"test": "npm run test:
|
|
26
|
+
"test": "npm run test:v1 && npm run test:smoke",
|
|
27
27
|
"test:integration": "node --test tests/integration.test.js",
|
|
28
|
-
"test:all": "npm run test:
|
|
28
|
+
"test:all": "npm run test:v1 && npm run test:smoke && npm run test:legacy",
|
|
29
29
|
"test:core-smoke": "node scripts/pretest-smoke.js",
|
|
30
|
-
"release:preflight": "node scripts/release-preflight.js"
|
|
30
|
+
"release:preflight": "node scripts/release-preflight.js",
|
|
31
|
+
"test:v1": "node --test tests/v1-global-cli.test.js",
|
|
32
|
+
"test:smoke": "npm run test:core-smoke",
|
|
33
|
+
"test:legacy": "node --test tests/v07-commands.test.js tests/v012-commands.test.js tests/asset-store.test.js"
|
|
31
34
|
},
|
|
32
35
|
"keywords": [
|
|
33
36
|
"kdna",
|
|
34
37
|
"kdna-cli",
|
|
35
38
|
"ai-agent",
|
|
36
39
|
"domain-judgment",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
40
|
+
"cli",
|
|
41
|
+
"judgment-asset",
|
|
42
|
+
"official-toolchain"
|
|
39
43
|
],
|
|
40
44
|
"license": "Apache-2.0",
|
|
41
45
|
"repository": {
|
package/src/cli.js
CHANGED
|
@@ -37,6 +37,7 @@ const {
|
|
|
37
37
|
} = require('./cmds/license');
|
|
38
38
|
const { cmdProtect, cmdUnlock, cmdRecover } = require('./cmds/protect');
|
|
39
39
|
const { cmdPreview, cmdProject, cmdEval, cmdExport, cmdDemo } = require('./cmds/legacy');
|
|
40
|
+
const { cmdDemo: cmdDemoMinimal } = require('./cmds/demo');
|
|
40
41
|
const { cmdCardsValidate, cmdLockVerify } = require('./cmds/studio');
|
|
41
42
|
const { cmdTestRun, cmdTestImport } = require('./cmds/test');
|
|
42
43
|
const { cmdChangelog } = require('./cmds/changelog');
|
|
@@ -570,7 +571,11 @@ switch (cmd) {
|
|
|
570
571
|
break;
|
|
571
572
|
}
|
|
572
573
|
case 'demo': {
|
|
573
|
-
|
|
574
|
+
if (args[1] === 'minimal') {
|
|
575
|
+
cmdDemoMinimal(args.slice(1));
|
|
576
|
+
} else {
|
|
577
|
+
cmdDemo();
|
|
578
|
+
}
|
|
574
579
|
break;
|
|
575
580
|
}
|
|
576
581
|
case 'explain': {
|
package/src/cmds/demo.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const { error, EXIT } = require('./_common');
|
|
4
|
+
|
|
5
|
+
function cmdDemo(args) {
|
|
6
|
+
const sub = args[0];
|
|
7
|
+
if (sub !== 'minimal') {
|
|
8
|
+
console.error('Usage: kdna demo minimal <output-dir>');
|
|
9
|
+
console.error(' Copies the minimal v1 fixture to the target directory for first-run testing.');
|
|
10
|
+
process.exit(2);
|
|
11
|
+
}
|
|
12
|
+
const dest = args[1];
|
|
13
|
+
if (!dest) {
|
|
14
|
+
console.error('Usage: kdna demo minimal <output-dir>');
|
|
15
|
+
process.exit(2);
|
|
16
|
+
}
|
|
17
|
+
const srcDir = path.join(__dirname, '..', '..', 'fixtures', 'v1-minimal');
|
|
18
|
+
const outDir = path.resolve(dest);
|
|
19
|
+
if (!fs.existsSync(srcDir)) {
|
|
20
|
+
error(`Fixture not found at ${srcDir}`, EXIT.INPUT_ERROR);
|
|
21
|
+
}
|
|
22
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
23
|
+
for (const f of fs.readdirSync(srcDir)) {
|
|
24
|
+
const s = path.join(srcDir, f);
|
|
25
|
+
const d = path.join(outDir, f);
|
|
26
|
+
if (fs.statSync(s).isFile()) {
|
|
27
|
+
fs.copyFileSync(s, d);
|
|
28
|
+
console.log(` ${f}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
console.log(`Minimal v1 fixture copied to: ${outDir}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = { cmdDemo };
|