@aikdna/kdna-studio-cli 0.8.11 → 0.8.13
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/NOTICE +12 -0
- package/README.md +10 -0
- package/bin/kdna-studio.js +70 -1
- package/package.json +3 -1
package/NOTICE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
kdna-studio-cli
|
|
2
|
+
Copyright 2026 KDNA Authors
|
|
3
|
+
|
|
4
|
+
This product includes software developed at
|
|
5
|
+
https://github.com/aikdna/kdna-studio-cli
|
|
6
|
+
|
|
7
|
+
kdna-studio-cli is the official command-line authoring tool for
|
|
8
|
+
creating, reviewing, compiling, and exporting `.kdna` judgment assets
|
|
9
|
+
through the KDNA toolchain.
|
|
10
|
+
|
|
11
|
+
See LICENSE for the full Apache 2.0 license text. See README.md
|
|
12
|
+
for the authoring guide and command reference.
|
package/README.md
CHANGED
|
@@ -135,6 +135,16 @@ Being part of the official toolchain means this package is maintained by the
|
|
|
135
135
|
KDNA project. It does not make any specific asset endorsed or suitable for
|
|
136
136
|
every use case.
|
|
137
137
|
|
|
138
|
+
## Consumption sidecars
|
|
139
|
+
|
|
140
|
+
Studio can export route-card and consumer-index drafts for applications that
|
|
141
|
+
use the consumption runtime. These files are separate from the `.kdna` export
|
|
142
|
+
and are disabled by default. They are review inputs, not claims that an asset
|
|
143
|
+
is automatically suitable for a task or ready for a production runtime.
|
|
144
|
+
|
|
145
|
+
Use the KDNA CLI review and evaluation commands before an application enables
|
|
146
|
+
a sidecar entry.
|
|
147
|
+
|
|
138
148
|
## Identity
|
|
139
149
|
|
|
140
150
|
```bash
|
package/bin/kdna-studio.js
CHANGED
|
@@ -98,6 +98,8 @@ Authoring:
|
|
|
98
98
|
kdna-studio card unlock <project> <card-id> --by <id> --statement <text>
|
|
99
99
|
kdna-studio compile <project> --out <dir>
|
|
100
100
|
kdna-studio export <project> --format v1 --out <file.kdna> [--allow-incomplete] [--password <pw>|--password-stdin]
|
|
101
|
+
kdna-studio export-route-card <domain-id> [--out=<path>] # Export route-card sidecar skeleton
|
|
102
|
+
kdna-studio export-consumer-index [--entries=<domain-ids>] [--out=<path>] # Export consumer-index skeleton
|
|
101
103
|
|
|
102
104
|
AI Authoring (requires LLM config: kdna-studio llm config):
|
|
103
105
|
kdna-studio distill <project> --ai # AI-driven candidate extraction from evidence
|
|
@@ -2393,7 +2395,7 @@ function cmdLlm(args) {
|
|
|
2393
2395
|
console.log(`Provider : ${cfg.provider || '(not set)'}`);
|
|
2394
2396
|
console.log(`Model : ${cfg.model || '(not set)'}`);
|
|
2395
2397
|
console.log(`Base URL : ${cfg.baseURL || '(not set)'}`);
|
|
2396
|
-
console.log(`API Key : ${cfg.apiKey ? '
|
|
2398
|
+
console.log(`API Key : ${cfg.apiKey ? '(set)' : '(not set)'}`);
|
|
2397
2399
|
return;
|
|
2398
2400
|
}
|
|
2399
2401
|
if (sub === 'config') {
|
|
@@ -3035,6 +3037,8 @@ try {
|
|
|
3035
3037
|
else if (cmd === 'audit-locks') cmdAuditLocks(args.slice(1));
|
|
3036
3038
|
else if (cmd === 'install') cmdStudioInstall(args.slice(1));
|
|
3037
3039
|
else if (cmd === 'update') cmdStudioUpdate(args.slice(1));
|
|
3040
|
+
else if (cmd === 'export-route-card') cmdExportRouteCard(args.slice(1));
|
|
3041
|
+
else if (cmd === 'export-consumer-index') cmdExportConsumerIndex(args.slice(1));
|
|
3038
3042
|
else {
|
|
3039
3043
|
usage();
|
|
3040
3044
|
fail(`Unknown command: ${cmd}`);
|
|
@@ -3043,3 +3047,68 @@ try {
|
|
|
3043
3047
|
fail(err.message || String(err));
|
|
3044
3048
|
}
|
|
3045
3049
|
})();
|
|
3050
|
+
|
|
3051
|
+
function cmdExportRouteCard(args) {
|
|
3052
|
+
const domainId = args[0];
|
|
3053
|
+
if (!domainId) fail('Usage: kdna-studio export-route-card <domain-id> [--out=<path>]');
|
|
3054
|
+
const outArg = option(args, '--out');
|
|
3055
|
+
const outPath = outArg || `${slugSegment(domainId, 'domain')}.route-card.json`;
|
|
3056
|
+
|
|
3057
|
+
const card = {
|
|
3058
|
+
route_card: "0.1.0",
|
|
3059
|
+
domain_id: domainId,
|
|
3060
|
+
role: "primary",
|
|
3061
|
+
boundaries: {
|
|
3062
|
+
applies_when: [],
|
|
3063
|
+
does_not_apply_when: [],
|
|
3064
|
+
},
|
|
3065
|
+
neighbors: [],
|
|
3066
|
+
advisor_edges: [],
|
|
3067
|
+
provenance: {
|
|
3068
|
+
generated_by: "kdna-studio",
|
|
3069
|
+
generated_at: new Date().toISOString(),
|
|
3070
|
+
input_hash: crypto.createHash("sha256").update(domainId).digest("hex").slice(0, 12),
|
|
3071
|
+
review_status: "draft_generated",
|
|
3072
|
+
},
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
const absOut = path.resolve(outPath);
|
|
3076
|
+
fs.mkdirSync(path.dirname(absOut), { recursive: true });
|
|
3077
|
+
fs.writeFileSync(absOut, JSON.stringify(card, null, 2) + "\n");
|
|
3078
|
+
console.log(`Route card skeleton written: ${absOut}`);
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
function cmdExportConsumerIndex(args) {
|
|
3082
|
+
const entriesArg = option(args, '--entries');
|
|
3083
|
+
const outArg = option(args, '--out');
|
|
3084
|
+
const outPath = outArg || 'consumer-index.json';
|
|
3085
|
+
|
|
3086
|
+
const domainIds = entriesArg
|
|
3087
|
+
? entriesArg.split(",").map((s) => s.trim()).filter(Boolean)
|
|
3088
|
+
: [];
|
|
3089
|
+
|
|
3090
|
+
const index = {
|
|
3091
|
+
consumer_index: "0.1.0",
|
|
3092
|
+
entries: domainIds.map((domainId) => ({
|
|
3093
|
+
domain_id: domainId,
|
|
3094
|
+
status: "draft_generated",
|
|
3095
|
+
enabled: false,
|
|
3096
|
+
route_preference: {
|
|
3097
|
+
primary_for: [],
|
|
3098
|
+
advisor_for: [],
|
|
3099
|
+
never_for: [],
|
|
3100
|
+
},
|
|
3101
|
+
provenance: {
|
|
3102
|
+
generated_by: "kdna-studio",
|
|
3103
|
+
generated_at: new Date().toISOString(),
|
|
3104
|
+
input_hash: crypto.createHash("sha256").update(domainId).digest("hex").slice(0, 12),
|
|
3105
|
+
source: "studio-export",
|
|
3106
|
+
},
|
|
3107
|
+
})),
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3110
|
+
const absOut = path.resolve(outPath);
|
|
3111
|
+
fs.mkdirSync(path.dirname(absOut), { recursive: true });
|
|
3112
|
+
fs.writeFileSync(absOut, JSON.stringify(index, null, 2) + "\n");
|
|
3113
|
+
console.log(`Consumer index skeleton written: ${absOut}`);
|
|
3114
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-studio-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.13",
|
|
4
4
|
"description": "Official KDNA Studio command-line authoring entry for creating, reviewing, compiling, and exporting .kdna judgment assets through the KDNA toolchain.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/",
|
|
11
11
|
"src/",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"NOTICE",
|
|
12
14
|
"README.md"
|
|
13
15
|
],
|
|
14
16
|
"scripts": {
|