@aikdna/kdna-cli 0.19.1 → 0.19.3
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 +2 -2
- package/src/cli.js +1 -1
- package/src/publish.js +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-cli",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.3",
|
|
4
4
|
"description": "KDNA CLI — create, validate, install, and manage domain judgment packages for AI agents.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lint": "eslint src/ validators/ tests/",
|
|
22
22
|
"format": "prettier --write .",
|
|
23
23
|
"format:check": "prettier --check .",
|
|
24
|
-
"test": "node --test tests/v07-commands.test.js tests/v012-commands.test.js",
|
|
24
|
+
"test": "node --test tests/v07-commands.test.js tests/v012-commands.test.js tests/asset-store.test.js",
|
|
25
25
|
"test:integration": "node --test tests/integration.test.js",
|
|
26
26
|
"test:all": "node --test tests/*.test.js",
|
|
27
27
|
"release:preflight": "node scripts/release-preflight.js",
|
package/src/cli.js
CHANGED
|
@@ -203,7 +203,7 @@ switch (cmd) {
|
|
|
203
203
|
let output = null;
|
|
204
204
|
let target = null;
|
|
205
205
|
for (let i = 2; i < args.length; i++) {
|
|
206
|
-
if (args[i] === '--output' || args[i] === '-o') {
|
|
206
|
+
if (args[i] === '--output' || args[i] === '--out' || args[i] === '-o') {
|
|
207
207
|
output = args[i + 1];
|
|
208
208
|
i++;
|
|
209
209
|
} else if (args[i].startsWith('-')) {
|
package/src/publish.js
CHANGED
|
@@ -540,7 +540,7 @@ function identityPaths() {
|
|
|
540
540
|
* before hashing). Digest self-reference fields are also excluded. All other files included as-is.
|
|
541
541
|
*/
|
|
542
542
|
function canonicalPayload(srcDir, opts = {}) {
|
|
543
|
-
const files = listPublishEntries(srcDir);
|
|
543
|
+
const files = listPublishEntries(srcDir).sort();
|
|
544
544
|
const parts = [];
|
|
545
545
|
for (const f of files) {
|
|
546
546
|
const full = f === 'mimetype' ? null : path.join(srcDir, f);
|
|
@@ -592,7 +592,7 @@ function manifestForContentDigest(manifest) {
|
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
function sourceContentDigest(srcDir) {
|
|
595
|
-
const files = listPublishEntries(srcDir);
|
|
595
|
+
const files = listPublishEntries(srcDir).sort();
|
|
596
596
|
const parts = [];
|
|
597
597
|
for (const f of files) {
|
|
598
598
|
let buf;
|
|
@@ -697,6 +697,14 @@ function sha256File(p) {
|
|
|
697
697
|
return crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex');
|
|
698
698
|
}
|
|
699
699
|
|
|
700
|
+
function outputDirFromArgs(args, fallback) {
|
|
701
|
+
for (const flag of ['--output', '--out', '-o']) {
|
|
702
|
+
const idx = args.indexOf(flag);
|
|
703
|
+
if (idx >= 0) return args[idx + 1];
|
|
704
|
+
}
|
|
705
|
+
return fallback;
|
|
706
|
+
}
|
|
707
|
+
|
|
700
708
|
/**
|
|
701
709
|
* kdna publish <path> — Full publish pipeline.
|
|
702
710
|
*
|
|
@@ -781,9 +789,7 @@ function cmdPublish(domainPath, args = []) {
|
|
|
781
789
|
|
|
782
790
|
// 3. Pack
|
|
783
791
|
const fileName = `${m[2]}-${manifest.version}.kdna`;
|
|
784
|
-
const outDir = args.
|
|
785
|
-
? args[args.indexOf('--output') + 1]
|
|
786
|
-
: path.join(abs, 'dist');
|
|
792
|
+
const outDir = outputDirFromArgs(args, path.join(abs, 'dist'));
|
|
787
793
|
fs.mkdirSync(outDir, { recursive: true });
|
|
788
794
|
const outPath = path.join(outDir, fileName);
|
|
789
795
|
packToFile(abs, outPath);
|