@aikdna/kdna-studio-cli 0.3.1 → 0.3.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/README.md +1 -1
- package/bin/kdna-studio.js +28 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ kdna-studio create migrated --from-folder ./old-domain-json --name @scope/migrat
|
|
|
82
82
|
|
|
83
83
|
## Related
|
|
84
84
|
|
|
85
|
-
- [KDNA
|
|
85
|
+
- [KDNA Core](https://github.com/aikdna/kdna) — Official format specification
|
|
86
86
|
- [kdna-cli](https://github.com/aikdna/kdna-cli) — runtime CLI for verify, install, load, publish
|
|
87
87
|
- [kdna-studio-core](https://github.com/aikdna/kdna-studio-core) — authoring SDK used by this CLI
|
|
88
88
|
- [kdna-studio-swift](https://github.com/aikdna/kdna-studio-swift) — native Swift counterpart
|
package/bin/kdna-studio.js
CHANGED
|
@@ -710,6 +710,27 @@ function cmdMigrate(args) {
|
|
|
710
710
|
try { creatorIdentity = creatorApi.loadIdentity(); } catch { /* proceed without */ }
|
|
711
711
|
const { project } = importFromFolder(sourceDir, tmpDir, name, creatorIdentity);
|
|
712
712
|
|
|
713
|
+
// Reject if critical judgment fields are missing from axioms
|
|
714
|
+
const criticalMissing = [];
|
|
715
|
+
for (const card of (project.cards || [])) {
|
|
716
|
+
if (card.type !== 'axiom') continue;
|
|
717
|
+
for (const field of ['applies_when', 'does_not_apply_when', 'failure_risk']) {
|
|
718
|
+
const val = card.fields && card.fields[field];
|
|
719
|
+
if (!val || (Array.isArray(val) && val.length === 0) || val === '') {
|
|
720
|
+
criticalMissing.push(`${card.id}: missing ${field}`);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (criticalMissing.length > 0) {
|
|
725
|
+
fail(
|
|
726
|
+
`Cannot migrate: ${criticalMissing.length} critical fields missing from axioms.\n` +
|
|
727
|
+
` These fields are required for domain routing (kdna-loader uses them to\n` +
|
|
728
|
+
` decide when to load this domain). Add them to your source files first.\n` +
|
|
729
|
+
` Missing:\n ` + criticalMissing.slice(0, 10).join('\n ') +
|
|
730
|
+
(criticalMissing.length > 10 ? `\n ... and ${criticalMissing.length - 10} more` : '')
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
|
|
713
734
|
// Step 2: approve and Human Lock all cards
|
|
714
735
|
let locked = 0;
|
|
715
736
|
for (let i = 0; i < (project.cards || []).length; i++) {
|
|
@@ -760,7 +781,13 @@ function cmdMigrate(args) {
|
|
|
760
781
|
|
|
761
782
|
if (args.includes('--sign')) applySignature(files, option(args, '--passphrase'));
|
|
762
783
|
const absOut = path.resolve(out);
|
|
763
|
-
|
|
784
|
+
const entries = [['mimetype', files.mimetype]];
|
|
785
|
+
for (const name of Object.keys(files).filter(k => k !== 'mimetype').sort()) {
|
|
786
|
+
entries.push([name, files[name]]);
|
|
787
|
+
}
|
|
788
|
+
const zip = buildZip(entries);
|
|
789
|
+
fs.mkdirSync(path.dirname(absOut), { recursive: true });
|
|
790
|
+
fs.writeFileSync(absOut, zip);
|
|
764
791
|
console.log(`Exported: ${absOut}`);
|
|
765
792
|
console.log(` Name: ${name}`);
|
|
766
793
|
console.log(` Cards: ${project.cards.length} (${locked} locked)`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-studio-cli",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Official KDNA Studio command-line authoring entry for creating, locking, compiling, and exporting
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"description": "Official KDNA Studio command-line authoring entry for creating, locking, compiling, and exporting .kdna judgment assets through the KDNA toolchain.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"kdna-studio": "bin/kdna-studio.js"
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
"@aikdna/kdna-studio-core": "^1.5.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@aikdna/kdna-core": "^0.
|
|
44
|
+
"@aikdna/kdna-core": "^0.9.1"
|
|
45
45
|
}
|
|
46
46
|
}
|