@aikdna/kdna-cli 0.17.0 → 0.18.0
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 +42 -23
- package/package.json +5 -4
- package/skills/kdna-loader/SKILL.md +5 -6
- package/src/agent.js +145 -109
- package/src/cli.js +104 -60
- package/src/cmds/_common.js +32 -16
- package/src/cmds/badge.js +7 -7
- package/src/cmds/changelog.js +1 -1
- package/src/cmds/cluster.js +16 -48
- package/src/cmds/doctor.js +10 -27
- package/src/cmds/domain.js +77 -400
- package/src/cmds/explain.js +122 -0
- package/src/cmds/legacy.js +8 -8
- package/src/cmds/license.js +483 -26
- package/src/cmds/quality.js +2 -2
- package/src/cmds/registry.js +15 -67
- package/src/cmds/studio.js +4 -5
- package/src/cmds/test.js +4 -4
- package/src/cmds/trace.js +11 -7
- package/src/compare.js +28 -22
- package/src/diff.js +11 -13
- package/src/init.js +2 -2
- package/src/install.js +138 -460
- package/src/loader.js +10 -10
- package/src/package-store.js +229 -0
- package/src/paths.js +44 -0
- package/src/publish.js +73 -22
- package/src/registry.js +76 -9
- package/src/setup.js +19 -20
- package/src/verify.js +233 -124
- package/templates/standard-domain/kdna.json +2 -1
- package/src/cmds/encrypt.js +0 -199
package/README.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# @aikdna/kdna-cli
|
|
2
2
|
|
|
3
|
+
> **KDNA Ecosystem:** [`kdna`](https://github.com/aikdna/kdna) — the protocol. [KDNAChat](https://github.com/AhaSparkCoach/kdnachat) — the consumption client. [KDNaStudio](https://github.com/AhaSparkCoach/kdnastudio) — the authoring tool. [KDNAWork](https://github.com/AhaSparkCoach/kdnawork) — the workbench. **You are here → kdna-cli** — the toolchain. [Registry](https://github.com/aikdna/kdna-registry) — the catalog.
|
|
4
|
+
|
|
5
|
+
**Role**: kdna-cli is the **runtime control plane** — the official reference implementation for domain validation, loading, packaging, comparison, and agent-facing runtime workflows. It bridges Studio output to Chat/Work consumption.
|
|
6
|
+
|
|
3
7
|
**KDNA CLI is the official open-source reference implementation for KDNA validation, loading, packaging, comparison, registry access, and agent-facing runtime workflows.**
|
|
4
8
|
|
|
5
9
|
It is the runtime control plane for loading, validating, composing, testing, and governing domain judgment for AI agents.
|
|
6
10
|
|
|
7
11
|
KDNA CLI 是 KDNA 验证、加载、打包、比较、注册表访问和 Agent 运行时工作流的官方开源参考实现,也是 AI Agent 加载、验证、组合、测试和治理领域判断的运行控制平面。
|
|
8
12
|
|
|
9
|
-
The CLI is how a KDNA
|
|
13
|
+
The CLI is how a KDNA domain judgment package becomes usable by agents. It installs KDNA domains, verifies their structure and trust metadata, loads them into agent-readable form, compares judgment paths with and without KDNA, and records traces for audit.
|
|
10
14
|
|
|
11
|
-
KDNA CLI
|
|
15
|
+
KDNA CLI 让一个领域判断资产真正被 Agent 使用。它负责安装 KDNA、验证结构与信任信息、把 KDNA 转换成 Agent 可加载的形式、对比加载前后的判断路径,并记录可审计的使用痕迹。
|
|
12
16
|
|
|
13
17
|
Part of the [KDNA](https://github.com/aikdna/kdna) ecosystem.
|
|
14
18
|
|
|
@@ -30,19 +34,30 @@ kdna compare @aikdna/writing --input "help me improve this post"
|
|
|
30
34
|
kdna doctor --agents
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
## Commands
|
|
37
|
+
## The 6 Commands You Actually Need
|
|
38
|
+
|
|
39
|
+
| Command | What it does |
|
|
40
|
+
|---------|-------------|
|
|
41
|
+
| `kdna setup` | Initialize ~/.kdna, install the agent skill loader |
|
|
42
|
+
| `kdna install <domain>` | Install a domain from the registry |
|
|
43
|
+
| `kdna list` | Show installed domains with quality info |
|
|
44
|
+
| `kdna verify <domain>` | 3-layer check: structure + trust + judgment |
|
|
45
|
+
| `kdna compare <domain> --input "..."` | Compare with/without KDNA judgment |
|
|
46
|
+
| `kdna doctor --agents` | Check agent integration health |
|
|
47
|
+
|
|
48
|
+
## All Commands by Role
|
|
34
49
|
|
|
35
50
|
### Domain Authoring
|
|
36
51
|
|
|
37
52
|
| Command | Status | Description |
|
|
38
53
|
|---------|--------|-------------|
|
|
39
54
|
| `kdna init <name>` | Beta | Scaffold a new domain from template |
|
|
40
|
-
| `kdna validate <path>` | Stable | Validate
|
|
41
|
-
| `kdna
|
|
42
|
-
| `kdna
|
|
43
|
-
| `kdna
|
|
44
|
-
| `kdna
|
|
45
|
-
| `kdna inspect <
|
|
55
|
+
| `kdna dev validate <path>` | Stable | Validate a non-canonical dev source directory |
|
|
56
|
+
| `kdna dev pack <path>` | Beta | Build a dev source directory into a .kdna asset |
|
|
57
|
+
| `kdna dev unpack <file>` | Beta | Unpack .kdna into a dev source directory |
|
|
58
|
+
| `kdna dev inspect <path>` | Beta | Inspect a non-canonical dev source directory |
|
|
59
|
+
| `kdna dev card <path>` | Beta | Display KDNA Card from a dev source directory |
|
|
60
|
+
| `kdna inspect <file.kdna>` | Beta | Inspect a .kdna asset |
|
|
46
61
|
| `kdna publish <path>` | Experimental | Pack + sign + publish to registry |
|
|
47
62
|
| `kdna publish --check <path>` | Experimental | Quality gate check only |
|
|
48
63
|
| `kdna version bump <level> [path]` | Beta | Bump domain version |
|
|
@@ -53,17 +68,17 @@ kdna doctor --agents
|
|
|
53
68
|
|---------|--------|-------------|
|
|
54
69
|
| `kdna available [--json]` | Beta | List installed domains with v2.1 fields |
|
|
55
70
|
| `kdna match "<task>" [--json]` | Beta | Signal matching — find relevant domains |
|
|
56
|
-
| `kdna load <name> [--as=prompt\|json\|raw]` | Beta | Emit
|
|
71
|
+
| `kdna load <name\|file.kdna> [--as=prompt\|json\|raw]` | Beta | Emit asset in agent-ready format |
|
|
57
72
|
| `kdna postvalidate <name> --output <file>` | Beta | Post-generation judgment check |
|
|
58
73
|
|
|
59
74
|
### Testing & Verification
|
|
60
75
|
|
|
61
76
|
| Command | Status | Description |
|
|
62
77
|
|---------|--------|-------------|
|
|
63
|
-
| `kdna verify <name>` | Beta | 3-layer: structure + trust + judgment |
|
|
64
|
-
| `kdna compare <name> --input "..."` | Beta | With/without KDNA reasoning diff |
|
|
65
|
-
| `kdna compare <name> --input "..." --report-md` | Beta | Markdown report with scoring |
|
|
66
|
-
| `kdna compare <name> --input "..." --report-json` | Beta | JSON report with scoring |
|
|
78
|
+
| `kdna verify <name\|file.kdna>` | Beta | 3-layer: structure + trust + judgment |
|
|
79
|
+
| `kdna compare <name\|file.kdna> --input "..."` | Beta | With/without KDNA reasoning diff |
|
|
80
|
+
| `kdna compare <name\|file.kdna> --input "..." --report-md` | Beta | Markdown report with scoring |
|
|
81
|
+
| `kdna compare <name\|file.kdna> --input "..." --report-json` | Beta | JSON report with scoring |
|
|
67
82
|
| `kdna diff <name>@<v1> <name>@<v2>` | Beta | Judgment-level diff between versions |
|
|
68
83
|
|
|
69
84
|
### Diagnostics & Trace
|
|
@@ -87,9 +102,12 @@ kdna doctor --agents
|
|
|
87
102
|
|---------|--------|-------------|
|
|
88
103
|
| `kdna license generate <domain> --to <email>` | Experimental | Generate signed license |
|
|
89
104
|
| `kdna license install <license.json>` | Experimental | Register license for auto-decrypt |
|
|
105
|
+
| `kdna license activate <domain> --key <key> --server <url>` | Experimental | Activate a license from entitlement source |
|
|
106
|
+
| `kdna license sync [domain] [--server <url>]` | Experimental | Refresh entitlement and revocation status |
|
|
90
107
|
| `kdna license verify <license.json>` | Experimental | Verify license signature and validity |
|
|
91
108
|
| `kdna license bind <license.json>` | Experimental | Bind license to this machine |
|
|
92
109
|
| `kdna license show <license.json>` | Experimental | Display license details |
|
|
110
|
+
| `kdna license status [domain] [--json]` | Experimental | Show installed license activation status without exposing keys |
|
|
93
111
|
|
|
94
112
|
### Cluster Composition
|
|
95
113
|
|
|
@@ -102,8 +120,7 @@ kdna doctor --agents
|
|
|
102
120
|
| Command | Status | Description |
|
|
103
121
|
|---------|--------|-------------|
|
|
104
122
|
| `kdna install <name>` | Beta | Install domain from registry |
|
|
105
|
-
| `kdna install
|
|
106
|
-
| `kdna install ./file.kdnae` | Beta | Install from encrypted .kdnae (auto-decrypt with license) |
|
|
123
|
+
| `kdna install file.kdna` | Beta | Install from local .kdna asset |
|
|
107
124
|
| `kdna remove <name>` | Beta | Uninstall a domain |
|
|
108
125
|
| `kdna update <name>` | Beta | Update installed domain |
|
|
109
126
|
| `kdna info <name>` | Beta | Show domain metadata and trust status |
|
|
@@ -130,9 +147,9 @@ kdna doctor --agents
|
|
|
130
147
|
|
|
131
148
|
## SPEC Compatibility
|
|
132
149
|
|
|
133
|
-
KDNA CLI follows the canonical KDNA
|
|
150
|
+
KDNA CLI follows the canonical KDNA asset structure defined in [`aikdna/kdna`](https://github.com/aikdna/kdna).
|
|
134
151
|
|
|
135
|
-
A valid KDNA domain is a
|
|
152
|
+
A valid KDNA domain is a `.kdna` asset. The internal tree of that asset may include up to six standard KDNA judgment files:
|
|
136
153
|
|
|
137
154
|
- `KDNA_Core.json`
|
|
138
155
|
- `KDNA_Patterns.json`
|
|
@@ -141,18 +158,20 @@ A valid KDNA domain is a lowercase `snake_case` folder. A complete domain may in
|
|
|
141
158
|
- `KDNA_Reasoning.json`
|
|
142
159
|
- `KDNA_Evolution.json`
|
|
143
160
|
|
|
144
|
-
The minimum valid
|
|
161
|
+
The minimum valid `.kdna` asset requires these internal entries:
|
|
145
162
|
|
|
146
163
|
- `KDNA_Core.json`
|
|
147
164
|
- `KDNA_Patterns.json`
|
|
148
165
|
|
|
149
|
-
Each file must include `meta.version`, `meta.domain`, `meta.created`, `meta.purpose`, and `meta.load_condition`.
|
|
166
|
+
Each KDNA judgment file must include `meta.version`, `meta.domain`, `meta.created`, `meta.purpose`, and `meta.load_condition`.
|
|
167
|
+
|
|
168
|
+
Source directories are dev-only authoring workspaces. Public install, inspect, verify, load, compare, and agent-facing commands consume `.kdna` assets or installed asset names, not source directories.
|
|
150
169
|
|
|
151
170
|
---
|
|
152
171
|
|
|
153
172
|
## Default Registry
|
|
154
173
|
|
|
155
|
-
By default, KDNA CLI uses the official KDNA registry. Users may override
|
|
174
|
+
By default, KDNA CLI uses the official KDNA registry. Registry schema v3 is asset-first: installable entries must publish `asset_url`, `asset_digest`, signature metadata, trust snapshot/timestamp metadata, and revocations. Expired, yanked, revoked, or digest-mismatched assets are rejected. Users may override the registry with `KDNA_REGISTRY_URL`.
|
|
156
175
|
|
|
157
176
|
```bash
|
|
158
177
|
# Use the official registry (default)
|
|
@@ -178,9 +197,9 @@ Commercial or hosted layers may include:
|
|
|
178
197
|
- Team collaboration in KDNA Studio
|
|
179
198
|
- Licensed/private judgment asset distribution
|
|
180
199
|
|
|
181
|
-
KDNA supports both open judgment assets and licensed/private judgment assets. Open
|
|
200
|
+
KDNA supports both open judgment assets and licensed/private judgment assets. Open assets remain the default path for community adoption. Licensed assets still use the `.kdna` extension; protected entries are decrypted only in memory after local license activation.
|
|
182
201
|
|
|
183
|
-
KDNA
|
|
202
|
+
KDNA 同时支持开放判断资产和授权/私有判断资产。开放资产是社区采用的默认路径;授权资产仍然使用 `.kdna` 后缀,受保护条目只会在本地 license activation 通过后以内存方式解密。
|
|
184
203
|
|
|
185
204
|
---
|
|
186
205
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "KDNA CLI — create, validate, install, and manage domain
|
|
3
|
+
"version": "0.18.0",
|
|
4
|
+
"description": "KDNA CLI — create, validate, install, and manage domain judgment packages for AI agents.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"kdna": "src/cli.js",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"kdna",
|
|
31
31
|
"kdna-cli",
|
|
32
32
|
"ai-agent",
|
|
33
|
-
"domain-
|
|
33
|
+
"domain-judgment",
|
|
34
|
+
"judgment-protocol",
|
|
34
35
|
"cli"
|
|
35
36
|
],
|
|
36
37
|
"license": "Apache-2.0",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"node": ">=18"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@aikdna/kdna-core": "^0.
|
|
50
|
+
"@aikdna/kdna-core": "^0.5.0"
|
|
50
51
|
},
|
|
51
52
|
"optionalDependencies": {
|
|
52
53
|
"ajv": "^8.17.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: kdna-loader
|
|
3
|
-
description: Discover and load KDNA judgment frameworks from
|
|
3
|
+
description: Discover and load KDNA judgment frameworks from installed .kdna assets when the task requires domain-specific judgment (review, diagnosis, critique, classification, strategy) where the same input could legitimately be interpreted multiple ways. Skip for pure formatting, factual lookup, code execution, or mechanical transformations. This skill is the entire interface to KDNA — domains themselves are not separate skills.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# KDNA Loader
|
|
@@ -17,7 +17,7 @@ this skill provides the **routing and protocol**, KDNA provides the
|
|
|
17
17
|
**judgment material**.
|
|
18
18
|
|
|
19
19
|
This skill is the **only** KDNA-related skill. Domains themselves are
|
|
20
|
-
not registered as skills — they live
|
|
20
|
+
not registered as skills — they live as `.kdna` assets under `~/.kdna/packages/` and
|
|
21
21
|
are discovered on demand. Whether the user has 1 domain installed or
|
|
22
22
|
100, this skill is the single entry point.
|
|
23
23
|
|
|
@@ -68,8 +68,8 @@ Returns a compact JSON array — one entry per installed domain — with:
|
|
|
68
68
|
axioms), `does_not_apply_when` (flattened), `failure_risks`. Yanked
|
|
69
69
|
domains are excluded automatically.
|
|
70
70
|
|
|
71
|
-
This is your **only** discovery interface. Do not
|
|
72
|
-
or `cat`
|
|
71
|
+
This is your **only** discovery interface. Do not inspect `~/.kdna/packages/` manually, unzip `.kdna` files,
|
|
72
|
+
or `cat` internal JSON entries directly — the CLI is the supported contract
|
|
73
73
|
between this skill and the KDNA file format. The on-disk layout may
|
|
74
74
|
change; `kdna available` will not.
|
|
75
75
|
|
|
@@ -291,8 +291,7 @@ Otherwise, stay silent about the loading mechanics.
|
|
|
291
291
|
|
|
292
292
|
## What this skill is NOT
|
|
293
293
|
|
|
294
|
-
- Not a list of available KDNA domains (those
|
|
295
|
-
`~/.kdna/domains/`, discovered on demand)
|
|
294
|
+
- Not a list of available KDNA domains (those are installed `.kdna` assets, discovered on demand)
|
|
296
295
|
- Not a registry browser (use `kdna list --available` CLI)
|
|
297
296
|
- Not a domain creator (use `kdna init <name>` CLI)
|
|
298
297
|
- Not an auto-loader that runs on every request — you decide per
|