@knolo/cli 6.2.9 → 6.2.11

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 CHANGED
@@ -19,9 +19,9 @@ reader.
19
19
 
20
20
  `knolo compose`, `knolo attest`, and `knolo verify-attestation` cite local
21
21
  Knowledge Images and write an attestation sidecar. This tree's `@knolo/cli`
22
- package file is `6.2.8` and depends on `@knolo/core` `^6.2.3` and
23
- `@knolo/exchange` `^0.1.1`. npm `latest` is `6.2.8`. `knolo kite`, `knolo research verify`, and `knolo exchange relay` are in this
24
- package and in that release. It is not in published `@knolo/cli@6.2.5`. `knolo exchange` hands
22
+ package file is `6.2.11` and depends on `@knolo/core` `^6.2.3` and
23
+ `@knolo/exchange` `^0.1.1`. npm `latest` is `6.2.11`. `6.2.10` includes `knolo persona`, `knolo ask`, and `knolo compose`. `6.2.11` adds `knolo receipt export`, `knolo receipt verify`, `knolo receipt cite`, and `knolo outdated`. `6.2.9` includes `knolo ask` and `--category`. `@knolo/cli@6.2.8` has no `ask.mjs` and no `--category`. `knolo kite`, `knolo research verify`, and `knolo exchange relay` are in this
24
+ package and in `@knolo/cli@6.2.8`. `knolo kite` is not in published `@knolo/cli@6.2.5`. `knolo exchange` hands
25
25
  a verified V5 image to another agent. Shipped configs keep `adopt: deny`.
26
26
  Discover reads a public advertisement and does not download a pack. They do
27
27
  not fetch Hub for that handoff. Verification
@@ -49,6 +49,13 @@ a model. A receipt is an integrity check. It does not mean a claim is proven.
49
49
  `SATISFIED` means the evidence requirements were met. See
50
50
  [Skills](../../docs/skills/README.md).
51
51
 
52
+ `knolo persona` builds a signed persona pack from style exemplars, a profile,
53
+ a disclosure line, and KITE boundary obligations. The creator signs the consent
54
+ manifest. The private key stays out of the image. `knolo persona` is in npm
55
+ `latest` `6.2.11`, and it has been since `6.2.10`. A receipt is an integrity check. A KITE verdict
56
+ describes the contract. It does not mean the claim is true. The host owns the
57
+ model. See [Persona packs](../../docs/guides/persona-packs.md).
58
+
52
59
  `knolo research package` writes one V5 image from local files. `--agent` is
53
60
  the host-supplied caller. An optional Cortex trace is verified against
54
61
  `--cite` before the write. A cited pack stores a digest-bound composition
@@ -182,6 +189,15 @@ Successful installs are cached by SHA-256 and recorded in
182
189
  `knolo.lock.json`. A yanked version or an existing conflicting pin requires
183
190
  `--force`; digest and artifact validation cannot be bypassed.
184
191
 
192
+ `knolo outdated` compares those pins with the registry and reports a newer
193
+ version. It uses the registry recorded in the lockfile. It does not download
194
+ bytes or change the lockfile.
195
+
196
+ ```bash
197
+ knolo outdated
198
+ knolo outdated --json
199
+ ```
200
+
185
201
  ## Skill packs
186
202
 
187
203
  `knolo skill` is separate from the Hub commands above. `knolo publish` still
@@ -410,7 +426,7 @@ This ensures:
410
426
  ## 🗺 Roadmap
411
427
 
412
428
  The active roadmap is maintained in [`../../docs/ROADMAP.md`](../../docs/ROADMAP.md).
413
- The published npm release is `6.2.8`. This tree's package file is `6.2.8` and adds `knolo research verify` and `knolo exchange relay`. `@knolo/cli@6.2.7` does not include those commands. `@knolo/cli@6.2.5` does not include `knolo kite`. The published release preserves the V4 CLI, keeps V5 verification,
429
+ The published npm release is `6.2.11`. This tree's package file is `6.2.11`. `6.2.10` includes `knolo persona`, `knolo ask`, and `knolo compose`. `6.2.11` adds `knolo receipt export`, `knolo receipt verify`, `knolo receipt cite`, and `knolo outdated`. `@knolo/cli@6.2.8` has no `ask.mjs` and no `--category`. `@knolo/cli@6.2.7` does not include `knolo research verify` or `knolo exchange relay`. `@knolo/cli@6.2.5` does not include `knolo kite`. The published release preserves the V4 CLI, keeps V5 verification,
414
430
  migration, diagnostics, and read-only Studio management, and adds offline
415
431
  composition, attestation, and `knolo cortex`. Cortex verification does not
416
432
  mean an answer is true.
package/bin/compose.mjs CHANGED
@@ -9,7 +9,8 @@ import { createHash } from 'node:crypto';
9
9
  import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
10
10
  import { homedir, tmpdir } from 'node:os';
11
11
  import path from 'node:path';
12
- import { fileURLToPath, pathToFileURL } from 'node:url';
12
+ import { fileURLToPath } from 'node:url';
13
+ import { loadCoreModule } from './load-core.mjs';
13
14
  import { KAR_CLI_MAX_IMAGE_BYTES, readBounded, readBoundedJson } from './kar-limits.mjs';
14
15
 
15
16
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -688,52 +689,55 @@ function resolve(file) {
688
689
  }
689
690
 
690
691
  async function loadAuthorityRoot() {
691
- const candidates = [
692
- path.resolve(__dirname, '../../core/dist/knowledge_key_rotation_v5.js'),
693
- '@knolo/core',
694
- ];
695
- for (const candidate of candidates) {
696
- try {
697
- const href = candidate.startsWith('@') ? candidate : pathToFileURL(candidate).href;
698
- const loaded = await import(href);
699
- if (loaded.authorityKeyringRootV1) return loaded.authorityKeyringRootV1;
700
- } catch {
701
- // Try the next candidate.
702
- }
692
+ try {
693
+ const loaded = await loadCoreModule(
694
+ [
695
+ path.resolve(__dirname, '../../core/dist/knowledge_key_rotation_v5.js'),
696
+ '@knolo/core',
697
+ ],
698
+ (mod) => Boolean(mod?.authorityKeyringRootV1)
699
+ );
700
+ return loaded.authorityKeyringRootV1;
701
+ } catch (error) {
702
+ const detail = error instanceof Error ? error.message : String(error);
703
+ throw new Error(`Could not load authorityKeyringRootV1. Build packages/core first. (${detail})`);
703
704
  }
704
- throw new Error('Could not load authorityKeyringRootV1. Build packages/core first.');
705
705
  }
706
706
 
707
707
  async function loadComposition() {
708
- const candidates = [
709
- path.resolve(__dirname, '../../core/dist/composition/index.js'),
710
- '@knolo/core/composition',
711
- ];
712
- for (const candidate of candidates) {
713
- try {
714
- const href = candidate.startsWith('@') ? candidate : pathToFileURL(candidate).href;
715
- const loaded = await import(href);
716
- if (loaded.createCompositionRecord && loaded.verifyCompositionRecord && loaded.karCompositionBinder) return loaded;
717
- } catch {
718
- // Try the next candidate.
719
- }
708
+ try {
709
+ return await loadCoreModule(
710
+ [
711
+ path.resolve(__dirname, '../../core/dist/composition/index.js'),
712
+ '@knolo/core/composition',
713
+ ],
714
+ (loaded) =>
715
+ Boolean(
716
+ loaded?.createCompositionRecord &&
717
+ loaded?.verifyCompositionRecord &&
718
+ loaded?.karCompositionBinder
719
+ )
720
+ );
721
+ } catch (error) {
722
+ const detail = error instanceof Error ? error.message : String(error);
723
+ throw new Error(`Could not load @knolo/core/composition. Build packages/core first. (${detail})`);
720
724
  }
721
- throw new Error('Could not load @knolo/core/composition. Build packages/core first.');
722
725
  }
723
726
 
724
727
  async function loadAuthoring() {
725
- const candidates = [
726
- path.resolve(__dirname, '../../core/dist/experimental/kar/authoring/index.js'),
727
- '@knolo/core/experimental/kar/authoring',
728
- ];
729
- for (const candidate of candidates) {
730
- try {
731
- const href = candidate.startsWith('@') ? candidate : pathToFileURL(candidate).href;
732
- const loaded = await import(href);
733
- if (loaded.domainPackRoot && loaded.parseAuthoringDocument && loaded.interpretDomainPack) return loaded;
734
- } catch {
735
- // Try the next candidate.
736
- }
728
+ try {
729
+ return await loadCoreModule(
730
+ [
731
+ path.resolve(__dirname, '../../core/dist/experimental/kar/authoring/index.js'),
732
+ '@knolo/core/experimental/kar/authoring',
733
+ ],
734
+ (loaded) =>
735
+ Boolean(
736
+ loaded?.domainPackRoot && loaded?.parseAuthoringDocument && loaded?.interpretDomainPack
737
+ )
738
+ );
739
+ } catch (error) {
740
+ const detail = error instanceof Error ? error.message : String(error);
741
+ throw new Error(`Could not load @knolo/core/kar/authoring. Build packages/core first. (${detail})`);
737
742
  }
738
- throw new Error('Could not load @knolo/core/kar/authoring. Build packages/core first.');
739
743
  }
@@ -0,0 +1,33 @@
1
+ // A failed ESM graph stays cached for the exact URLs that failed. Retrying
2
+ // only the entry file links it against those failed dependencies and reports
3
+ // a missing export that the built file has. Copy the entry's knolo-epoch
4
+ // query onto every other file in that dist tree so the retry is a new graph.
5
+
6
+ export async function resolve(specifier, context, nextResolve) {
7
+ const next = await nextResolve(specifier, context);
8
+ const parent = context.parentURL;
9
+ if (!parent) return next;
10
+ let epoch;
11
+ try {
12
+ epoch = new URL(parent).searchParams.get('knolo-epoch');
13
+ } catch {
14
+ return next;
15
+ }
16
+ if (!epoch) return next;
17
+ let nextUrl;
18
+ let parentUrl;
19
+ try {
20
+ nextUrl = new URL(next.url);
21
+ parentUrl = new URL(parent);
22
+ } catch {
23
+ return next;
24
+ }
25
+ if (nextUrl.protocol !== 'file:') return next;
26
+ const distAt = parentUrl.pathname.lastIndexOf('/dist/');
27
+ if (distAt < 0) return next;
28
+ const distRoot = parentUrl.pathname.slice(0, distAt + '/dist/'.length);
29
+ if (!nextUrl.pathname.startsWith(distRoot)) return next;
30
+ if (nextUrl.searchParams.get('knolo-epoch') === epoch) return next;
31
+ nextUrl.searchParams.set('knolo-epoch', epoch);
32
+ return { format: next.format, shortCircuit: true, url: nextUrl.href };
33
+ }
package/bin/flight.mjs CHANGED
@@ -8,7 +8,8 @@
8
8
  import { createHash } from 'node:crypto';
9
9
  import { createReadStream, existsSync, statSync, writeFileSync } from 'node:fs';
10
10
  import path from 'node:path';
11
- import { fileURLToPath, pathToFileURL } from 'node:url';
11
+ import { fileURLToPath } from 'node:url';
12
+ import { loadCoreModule } from './load-core.mjs';
12
13
  import { KAR_CLI_MAX_IMAGE_BYTES, readBounded } from './kar-limits.mjs';
13
14
 
14
15
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -384,20 +385,15 @@ async function inspectLog(file) {
384
385
  }
385
386
 
386
387
  async function loadImageApi() {
387
- const candidates = [
388
- path.resolve(__dirname, '../../core/dist/index.js'),
389
- '@knolo/core',
390
- ];
391
- for (const candidate of candidates) {
392
- try {
393
- const href = candidate.startsWith('@') ? candidate : pathToFileURL(candidate).href;
394
- const loaded = await import(href);
395
- if (loaded.createKnowledgeImageV5) return loaded;
396
- } catch {
397
- // Try the next candidate.
398
- }
388
+ try {
389
+ return await loadCoreModule(
390
+ [path.resolve(__dirname, '../../core/dist/index.js'), '@knolo/core'],
391
+ (loaded) => Boolean(loaded?.createKnowledgeImageV5)
392
+ );
393
+ } catch (error) {
394
+ const detail = error instanceof Error ? error.message : String(error);
395
+ throw new Error(`Could not load @knolo/core. Build packages/core first. (${detail})`);
399
396
  }
400
- throw new Error('Could not load @knolo/core. Build packages/core first.');
401
397
  }
402
398
 
403
399
  function parseArgs(argv) {
package/bin/knolo.mjs CHANGED
@@ -19,6 +19,7 @@ import { tmpdir } from 'node:os';
19
19
  import path from 'node:path';
20
20
  import process from 'node:process';
21
21
  import { fileURLToPath, pathToFileURL } from 'node:url';
22
+ import { loadCoreModule } from './load-core.mjs';
22
23
  import { createRequire } from 'node:module';
23
24
  import {
24
25
  isHubAddInvocation,
@@ -32,6 +33,7 @@ import {
32
33
  runHubYank,
33
34
  } from './registry/commands.mjs';
34
35
  import { runHubAsk } from './registry/ask.mjs';
36
+ import { runHubOutdated } from './registry/outdated.mjs';
35
37
 
36
38
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
37
39
  const require = createRequire(import.meta.url);
@@ -54,18 +56,21 @@ const SKIP_DIRS = new Set([
54
56
  const SUBCOMMANDS = new Set([
55
57
  'init',
56
58
  'add',
59
+ 'mount',
57
60
  'build',
58
61
  'query',
59
62
  'inspect',
60
63
  'migrate',
61
64
  'verify',
62
65
  'explain',
66
+ 'receipt',
63
67
  'diff',
64
68
  'dev',
65
69
  'v5',
66
70
  'search',
67
71
  'ask',
68
72
  'info',
73
+ 'outdated',
69
74
  'login',
70
75
  'whoami',
71
76
  'logout',
@@ -82,6 +87,7 @@ const SUBCOMMANDS = new Set([
82
87
  'kite',
83
88
  'flight',
84
89
  'skill',
90
+ 'persona',
85
91
  'setup',
86
92
  'exchange',
87
93
  'research',
@@ -104,6 +110,55 @@ function createError(message) {
104
110
  return new Error(message);
105
111
  }
106
112
 
113
+ const USAGE_EXIT_CODE = 2;
114
+ const TOP_LEVEL_COMMANDS = ['help', 'version', 'icp', ...SUBCOMMANDS];
115
+
116
+ function editDistance(a, b) {
117
+ let previous = Array.from({ length: b.length + 1 }, (_, j) => j);
118
+ for (let i = 1; i <= a.length; i += 1) {
119
+ const current = [i];
120
+ for (let j = 1; j <= b.length; j += 1) {
121
+ current[j] = Math.min(
122
+ previous[j] + 1,
123
+ current[j - 1] + 1,
124
+ previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1)
125
+ );
126
+ }
127
+ previous = current;
128
+ }
129
+ return previous[b.length];
130
+ }
131
+
132
+ function suggestCommand(word) {
133
+ const maxDistance = word.length <= 4 ? 1 : 2;
134
+ let best = null;
135
+ let bestDistance = Infinity;
136
+ for (const candidate of TOP_LEVEL_COMMANDS) {
137
+ const distance = editDistance(word.toLowerCase(), candidate);
138
+ if (distance < bestDistance) {
139
+ best = candidate;
140
+ bestDistance = distance;
141
+ }
142
+ }
143
+ return bestDistance <= maxDistance ? best : null;
144
+ }
145
+
146
+ // Direct mode treats the first argument as an input file. A bare word that is
147
+ // not a file is almost always a mistyped command, so report it as one instead
148
+ // of surfacing ENOENT. Arguments that look like paths keep the file error.
149
+ function unknownCommandError(word) {
150
+ if (/[\\/.]/.test(word)) return null;
151
+ if (existsSync(path.resolve(process.cwd(), word))) return null;
152
+ const suggestion = suggestCommand(word);
153
+ const error = createError(
154
+ suggestion
155
+ ? `Unknown command "${word}". Did you mean "${suggestion}"?`
156
+ : `Unknown command "${word}". Run "knolo help" to list commands.`
157
+ );
158
+ error.exitCode = USAGE_EXIT_CODE;
159
+ return error;
160
+ }
161
+
107
162
  async function tryImport(filePath) {
108
163
  try {
109
164
  if (
@@ -121,31 +176,39 @@ async function tryImport(filePath) {
121
176
  return null;
122
177
  }
123
178
 
179
+ function coreNamespaceReady(mod) {
180
+ return Boolean(
181
+ (mod?.buildPack && mod?.mountPack && mod?.query) ||
182
+ (mod?.default?.buildPack && mod?.default?.mountPack && mod?.default?.query)
183
+ );
184
+ }
185
+
124
186
  async function loadCore() {
125
- const candidates = [
126
- path.resolve(__dirname, '../../core/dist/index.js'),
127
- '@knolo/core',
128
- ];
129
- for (const candidate of candidates) {
130
- const mod = await tryImport(candidate);
131
- if (mod?.buildPack && mod?.mountPack && mod?.query) return mod;
132
- if (
133
- mod?.default?.buildPack &&
134
- mod?.default?.mountPack &&
135
- mod?.default?.query
136
- )
137
- return mod.default;
187
+ let mod;
188
+ try {
189
+ mod = await loadCoreModule(
190
+ [path.resolve(__dirname, '../../core/dist/index.js'), '@knolo/core'],
191
+ coreNamespaceReady
192
+ );
193
+ } catch (error) {
194
+ const detail = error instanceof Error ? error.message : String(error);
195
+ throw createError(
196
+ `Could not load @knolo/core. Build packages/core first (npm run build --workspace @knolo/core). (${detail})`
197
+ );
138
198
  }
139
- throw createError(
140
- 'Could not load @knolo/core. Build packages/core first (npm run build --workspace @knolo/core).'
141
- );
199
+ if (mod?.buildPack && mod?.mountPack && mod?.query) return mod;
200
+ return mod.default;
142
201
  }
143
202
 
144
203
  function printVersion() {
145
- const cli = JSON.parse(readFileSync(path.join(__dirname, '../package.json'), 'utf8'));
204
+ const cli = JSON.parse(
205
+ readFileSync(path.join(__dirname, '../package.json'), 'utf8')
206
+ );
146
207
  let coreVersion = 'unavailable';
147
208
  try {
148
- coreVersion = JSON.parse(readFileSync(require.resolve('@knolo/core/package.json'), 'utf8')).version;
209
+ coreVersion = JSON.parse(
210
+ readFileSync(require.resolve('@knolo/core/package.json'), 'utf8')
211
+ ).version;
149
212
  } catch {
150
213
  coreVersion = 'unavailable';
151
214
  }
@@ -163,9 +226,11 @@ Usage:
163
226
  Commands:
164
227
  init Initialize knolo.config.json and starter docs
165
228
  add <name> <path> Add or update a local source entry, or install a Hub pack
229
+ mount Pin a shared image into knolo-mcp.json
166
230
  search <query> Search the Knolo Hub registry
167
231
  ask "<question>" Answer from Hub excerpts with your model
168
232
  info <publisher>/<slug> Show a Hub registry pack
233
+ outdated Compare lockfile pins with the registry
169
234
  login Store a Hub token locally
170
235
  whoami Show the stored Hub token prefix
171
236
  logout Remove the stored Hub token
@@ -177,16 +242,22 @@ Commands:
177
242
  migrate <pack> Migrate a legacy pack to v4
178
243
  verify <pack> Verify pack structure and cryptographic digests
179
244
  explain <receipt> Verify and explain a query receipt
245
+ receipt Export, verify, or cite a portable receipt bundle
180
246
  diff <pack-a> <pack-b> Compare pack identities and source/chunk counts
181
247
  dev Watch config/sources and rebuild on change
248
+ semantic:index Build an embedding sidecar for a V4 pack via an Ollama endpoint
249
+ semantic:inspect Print a semantic sidecar summary
250
+ semantic:validate Check a semantic sidecar against its V4 pack and model
182
251
  v5 Inspect, compress, decompress, and health-check a V5 Knowledge Image
183
252
  kar KAR evidence-set retrieval over a Committed Evidence Graph
184
253
  compose Compose Knowledge Images, packs, and attestations offline
185
254
  attest Create or verify a composition attestation
255
+ verify-attestation Same check as "knolo attest verify"
186
256
  cortex Bounded evidence retrieval with a verifiable trace
187
257
  kite Check a typed contract and replay its certificate
188
258
  flight Pack a flight-events-1 document into a V5 Knowledge Image
189
259
  skill Create and share a Knolo skill pack
260
+ persona Build a signed persona pack and check its boundaries
190
261
  research Package local research files into a V5 Knowledge Image
191
262
  setup Prepare a local index and print the hub next steps
192
263
  exchange Offer or pull a verified Knowledge Image from a peer or relay
@@ -204,17 +275,20 @@ function printCommandHelp(command) {
204
275
  const help = {
205
276
  init: 'Usage: knolo init',
206
277
  add: 'Usage: knolo add <name> <path> | <publisher>/<slug>[@<version>] [--out <path>] [--force] [--json] [--registry <url>]',
278
+ mount:
279
+ 'Usage: knolo mount add <publisher/slug@version | sha256:hex> --config <knolo-mcp.json> --policy <policy.json> [--path <image>] [--id <id>] [--agent <id>] [--audit-dir <dir>]\n knolo mount list --config <knolo-mcp.json>\n knolo mount remove <id> --config <knolo-mcp.json>\n\nAdds one mount beside the mounts already in the config. A digest is read from --path or the local cache and does not contact a registry. A missing publisher/slug@version runs knolo add. Bytes that do not match the pin are not written. The principal is one the policy allows for query and read. A box image uses box:reader. The image is not rebuilt.',
207
280
  search:
208
281
  'Usage: knolo search <query> [--format V4|V5] [--license <id>] [--official] [--agents] [--research] [--json] [--registry <url>]',
209
- ask:
210
- 'Usage: knolo ask "<question>" [--category <id>] [--all] [--model <name>] [--base-url <url>] [--limit <n>] [--evidence] [--hub <url>]\n\nPosts the question to Hub and sends the verified excerpts and skill instructions to an OpenAI-compatible chat endpoint. The default base URL is http://127.0.0.1:11434/v1 (Ollama). Set KNOLO_MODEL_BASE_URL and KNOLO_MODEL for another engine, including a cloud gateway such as https://api.x.ai/v1. KNOLO_MODEL_API_KEY is sent only to that endpoint.\nPass --category one or more times, or pass --all to search the entire hub. With neither, ask exits before the network call. --evidence prints skills first, then excerpts, and does not call a model. A plan limit does not call a model. --hub is the same registry override as --registry.',
282
+ ask: 'Usage: knolo ask "<question>" [--category <id>] [--all] [--model <name>] [--base-url <url>] [--limit <n>] [--evidence] [--hub <url>]\n\nPosts the question to Hub and sends the verified excerpts and skill instructions to an OpenAI-compatible chat endpoint. The default base URL is http://127.0.0.1:11434/v1 (Ollama). Set KNOLO_MODEL_BASE_URL and KNOLO_MODEL for another engine, including a cloud gateway such as https://api.x.ai/v1. KNOLO_MODEL_API_KEY is sent only to that endpoint.\nPass --category one or more times, or pass --all to search the entire hub. With neither, ask exits before the network call. --evidence prints skills first, then excerpts, and does not call a model. A plan limit does not call a model. --hub is the same registry override as --registry.',
211
283
  info: 'Usage: knolo info <publisher>/<slug> [--json] [--registry <url>]',
284
+ outdated:
285
+ 'Usage: knolo outdated [--json] [--registry <url>]\n\nCompares knolo.lock.json pins with the registry and reports newer versions. This contacts the registry. It does not download bytes, change knolo.lock.json, or install an update.',
212
286
  login:
213
287
  'Usage: knolo login [--token kno_…] [--stdin] [--registry <url>]\n\nStores the raw token locally. Hub write calls send Authorization: Bearer kno_….\nMint tokens at https://hub.knolo.dev/dashboard/tokens; login does not call POST /api/v1/tokens.',
214
288
  whoami: 'Usage: knolo whoami',
215
289
  logout: 'Usage: knolo logout',
216
290
  publish:
217
- 'Usage: knolo publish <pack.knolo> --slug <slug> --version <version> --license <SPDX> [--publisher <handle>] [--readme <text>] [--sources <text>] [--intended-use <text>] [--category <id>] [--private] [--json] [--registry <url>]\n\nUses the stored dashboard token as Authorization: Bearer kno_…. Hub issues a public Blob PUT grant; the CLI never needs PACKS_READ_WRITE_TOKEN.\nUploads go to the grant URL without the kno_ token. Complete sends the public Blob URL, then Hub verifies before release.\n--category is repeatable, from 1 to 3 of coding, math, science, news, business, security, writing, general. A new pack needs at least one. --private releases an owner-only pack on a Business or Enterprise plan. The success text omits the Blob URL.',
291
+ 'Usage: knolo publish <pack.knolo> --slug <slug> --version <version> --license <SPDX> [--publisher <handle>] [--readme <text>] [--sources <text>] [--intended-use <text>] [--category <id>] [--private] [--allow-private] [--allow-findings] [--json] [--registry <url>]\n\nA V5 image is checked locally before the account request. A finding stops the publish unless --allow-findings is set. Memory and transcripts need --allow-private. The override is printed. Uses the stored dashboard token as Authorization: Bearer kno_…. Hub issues a public Blob PUT grant; the CLI never needs PACKS_READ_WRITE_TOKEN.\nUploads go to the grant URL without the kno_ token. Complete sends the public Blob URL, then Hub verifies before release.\n--category is repeatable, from 1 to 3 of coding, math, science, news, business, security, writing, general. A new pack needs at least one. --private releases an owner-only pack on a Business or Enterprise plan. The success text omits the Blob URL.',
218
292
  yank: 'Usage: knolo yank <publisher>/<slug>@<version> [--json] [--registry <url>]\n\nUses the stored token as Authorization: Bearer kno_…. Yank is owner-only and leaves the public Blob in place.',
219
293
  build: 'Usage: knolo build',
220
294
  query:
@@ -224,17 +298,36 @@ function printCommandHelp(command) {
224
298
  'Usage: knolo migrate <pack.knolo> --out <new-pack.knolo> [--to 4]',
225
299
  verify: 'Usage: knolo verify <pack.knolo>',
226
300
  explain: 'Usage: knolo explain <receipt.json> --pack <pack.knolo>',
301
+ receipt: `Usage: knolo receipt export <receipt-id> [--audit-dir <dir> | --config <knolo-mcp.json>] [--policy <policy.json>] [--out <file>] [--pack-ref <publisher/slug@version>] [--principal <id>] [--redact]
302
+ knolo receipt verify <bundle.json> --pack <image | publisher/slug@version>
303
+ knolo receipt cite <bundle.json> --pack <image | publisher/slug@version> [--out <file>]
304
+
305
+ Exports an openclaw-knolo-query-v1 or knolo-mcp-evidence-receipt-v1 record as a portable bundle.
306
+ The bundle carries the pack pin, the principal, and the policy JSON. The image stores only the policy root.
307
+ Verify checks the bundle against a local image file or a knolo.lock.json cache entry.
308
+ cite prints a knolo-verified-answer-v1 object after that check succeeds. The object names the bundle file hash and the pack pin. It does not cover an answer sentence.
309
+ A publisher/slug@version argument is not downloaded. Receipt verify does not contact a registry.
310
+ The image is not rebuilt.
311
+ A receipt is an integrity check. It does not mean a claim is proven. SATISFIED means evidence requirements were met. This object does not decide a claim.
312
+ --redact omits the caller and the record digest. The query text stays, because the plan is part of the proof. If the question is private, do not share the receipt.
313
+ Evidence verify checks the record digest and the image pins. It does not replay the tool, and it does not mean the outcome is true.
314
+ A failed cite prints nothing and writes nothing.
315
+ V4 receipt-v1 stays on knolo explain. This command does not add an MCP tool.`,
227
316
  diff: 'Usage: knolo diff <pack-a.knolo> <pack-b.knolo>',
228
317
  dev: 'Usage: knolo dev',
229
318
  v5: 'Usage: knolo v5 <info|health|studio|query|compress|decompress> <image.v5> [--out <file>] [--mode fast|balanced|max] [--attach-index]\n\nFor query: knolo v5 query <image.v5> <EQL> [--json] [--receipt <file>].',
230
319
  kar: 'Usage: knolo kar <evaluate|verify|explain|inspect|graph|package|produce|domain|dossier|coverage|benchmark|demo|conformance> [options]\n\nKnolo Adversarial Retrieval. Semantics are frozen at kar-1-research-1.\n\n knolo kar evaluate --image knowledge.knolo --graph knowledge.kar.json --plan plan.json --query "..."\n knolo kar verify --image knowledge.knolo --graph knowledge.kar.json --plan plan.json --query "..." --result result.json\n knolo kar explain --result result.json\n knolo kar inspect --image knowledge.knolo --graph knowledge.kar.json [--plan plan.json]\n knolo kar graph build --image knowledge.knolo --source knowledge.ceg.yaml --out knowledge.kar.json\n knolo kar package --image knowledge.knolo --graph knowledge.kar.json --out dist/my-knowledge-kar/\n knolo kar produce rules --image knowledge.knolo --domain domains/contracts-v4 --out proposals.json\n knolo kar domain validate domains/contracts-v4\n knolo kar dossier build --image knowledge.knolo --graph knowledge.kar.json --plan plan.json --query "..." --out dossier/\n knolo kar dossier verify dossier/\n knolo kar coverage build --image knowledge.knolo --graph knowledge.kar.json --plan plan.json --query "..." --out coverage/\n knolo kar coverage verify coverage/\n knolo kar benchmark annotate --packet packet.json --decisions decisions.json --out labels.json --role human --reviewer-id <id>\n knolo kar demo\n knolo kar conformance\n\n--json prints the machine-readable result. verify exits non-zero when the certificate does not match. Abstention is a result and exits 0. graph and package author a Committed Evidence Graph without changing retrieval. produce proposes CEG Source and does not write committed bytes. dossier packages one evaluation and fails closed when committed fields change. coverage reports met requirements, gaps, and plans that did not decide. A gap is not a false claim. benchmark labels gold without showing producer output. demo and conformance run from a knolo-core checkout.',
231
- compose: 'Usage: knolo compose <create|verify|excerpt|query> [options]\n\nOffline composition of Knowledge Images, packs, KAR sidecars, Domain Packs, and bounded excerpts.\n\n knolo compose create --members members.json --out composition/ [--host knowledge.knolo] [--availability material|digest] [--policy policy.json]\n knolo compose verify composition/ [--require-material] [--member alias=path]\n knolo compose excerpt --image knowledge.knolo --object <id> --out excerpt.json\n knolo compose query --composition composition/ --eql "FROM chunk SEARCH \\"valve\\"" [--question "..."] [--json]\n\ncompositionRoot does not change a V5 state root or a KAR root. statement used means a query or evaluation ran. It does not mean SATISFIED, and it does not mean a claim is true or false. Hub attested: true is a listing flag and is not an attestation root. The CLI does not fetch Hub.',
232
- attest: 'Usage: knolo attest <create|verify> [options]\n\n knolo attest create --composition composition/composition.json --subject composition --statement mount|used|cited --out attestation.json [--sign-key key.json --principal <id> --key-id <id> --issued-at <ms> --expires-at <ms>]\n knolo attest verify attestation.json [--composition composition.json] [--public-key key.json] [--now <ms>] [--content-only]\n\nstatement used means a query or KAR evaluation ran. It does not mean the claim is true or false. Hub attested: true is unrelated. Signing uses the supplied times. The CLI does not read the clock.',
233
- cortex: 'Usage: knolo cortex <find|ask|explain|verify> [options]\n\nBounded evidence retrieval. The CLI does not call a model.\n\n knolo cortex find <image> --question "..." [--top-k 100] --out candidates.json\n knolo cortex ask <image> --question "..." [--graph file] [--plan plan.json] [--mode find_relevant] --out answer.cortex.json\n knolo cortex explain answer.cortex.json\n knolo cortex verify --image <image> --answer answer.cortex.json [--graph file]\n\nVerification recomputes the trace roots. It does not mean the answer is true. A KAR status of SATISFIED means evidence requirements were met. It does not mean a claim is proven.',
320
+ compose:
321
+ 'Usage: knolo compose <create|verify|excerpt|query> [options]\n\nOffline composition of Knowledge Images, packs, KAR sidecars, Domain Packs, and bounded excerpts.\n\n knolo compose create --members members.json --out composition/ [--host knowledge.knolo] [--availability material|digest] [--policy policy.json]\n knolo compose verify composition/ [--require-material] [--member alias=path]\n knolo compose excerpt --image knowledge.knolo --object <id> --out excerpt.json\n knolo compose query --composition composition/ --eql "FROM chunk SEARCH \\"valve\\"" [--question "..."] [--json]\n\ncompositionRoot does not change a V5 state root or a KAR root. statement used means a query or evaluation ran. It does not mean SATISFIED, and it does not mean a claim is true or false. Hub attested: true is a listing flag and is not an attestation root. The CLI does not fetch Hub.',
322
+ attest:
323
+ 'Usage: knolo attest <create|verify> [options]\n\n knolo attest create --composition composition/composition.json --subject composition --statement mount|used|cited --out attestation.json [--sign-key key.json --principal <id> --key-id <id> --issued-at <ms> --expires-at <ms>]\n knolo attest verify attestation.json [--composition composition.json] [--public-key key.json] [--now <ms>] [--content-only]\n\nstatement used means a query or KAR evaluation ran. It does not mean the claim is true or false. Hub attested: true is unrelated. Signing uses the supplied times. The CLI does not read the clock.',
324
+ cortex:
325
+ 'Usage: knolo cortex <find|ask|explain|verify> [options]\n\nBounded evidence retrieval. The CLI does not call a model.\n\n knolo cortex find <image> --question "..." [--top-k 100] --out candidates.json\n knolo cortex ask <image> --question "..." [--graph file] [--plan plan.json] [--mode find_relevant] --out answer.cortex.json\n knolo cortex explain answer.cortex.json\n knolo cortex verify --image <image> --answer answer.cortex.json [--graph file]\n\nVerification recomputes the trace roots. It does not mean the answer is true. A KAR status of SATISFIED means evidence requirements were met. It does not mean a claim is proven.',
234
326
  kite: 'Usage: knolo kite <evaluate|verify> [options]\n\n knolo kite evaluate --image <image.knolo> --contract <contract.json> --rules <rules.json> [--completeness <file>] [--changes <file>] [--bounds <file>] [--graph <file>] [--as-of YYYY-MM-DD] [--out <result.json>] [--json]\n knolo kite verify --image <image.knolo> --contract <contract.json> --rules <rules.json> --certificate <certificate.json> [--completeness <file>] [--changes <file>] [--bounds <file>] [--graph <file>] [--as-of YYYY-MM-DD]\n\nEvaluation names unmet obligations and derives a verdict inside the declared changes. Verification recomputes that derivation. A certificate is an integrity check. It does not mean the claim is true. BOUND_EXCEEDED means the search did not finish and is not a certificate. This command ships in this package. It loads @knolo/core/kite.',
235
327
  research:
236
328
  'Usage: knolo research package --question <text> --agent <id> --out <image.knolo> --source <file> [--source <file>] [--cite <image.knolo> --trace <answer.cortex.json> [--graph <file>]] [--json]\n\nPacks local files into one V5 Knowledge Image. --agent is the host-supplied caller. --cite and --trace are both required or both omitted. --graph is required when the trace contains KAR evaluations, and it is the same file knolo cortex verify would use. A trace is verified against --cite before any write. A failed check writes nothing. When --cite is set, the image stores a digest-bound composition record for that image and does not copy its bytes. When --graph is set, the checked graph is stored. The command does not call a model and does not download an image. A packed trace is an integrity check. It does not mean a claim is proven. SATISFIED means the trace evidence requirements were met.\n\nUsage: knolo research verify <image.knolo> [--cited <file>]... [--require-material] [--json]\n\nVerifies the image roots, then re-checks a stored composition record, Cortex trace, and KAR graph with the existing verifiers. --cited supplies member bytes in member order. Without those bytes, digest mode succeeds and says the cited bytes were not supplied. --require-material fails when a member has no bytes. The command does not call a model and does not download an image. A verified trace is an integrity check. It does not mean a claim is proven. SATISFIED means evidence requirements were met.',
237
- flight: 'Usage: knolo flight <ingest|verify-log> [options]\n\n knolo flight ingest --events <events.json> --log <file> --out <image.knolo> [--json]\n knolo flight verify-log --image <image.knolo> --log <file> [--json]\n\ningest packs a flight-events-1 document into a V5 Knowledge Image. It hashes --log and writes nothing when the hash or byte length differs. verify-log hashes --log again and compares it with the flight-log object. It writes nothing. A missing flight-log object fails closed. Neither command decodes the log. log.format is ulog, dataflash, or rosbag2. A later KAR status of SATISFIED means evidence requirements were met. It does not mean a flight was safe, legal, or compliant.',
329
+ flight:
330
+ 'Usage: knolo flight <ingest|verify-log> [options]\n\n knolo flight ingest --events <events.json> --log <file> --out <image.knolo> [--json]\n knolo flight verify-log --image <image.knolo> --log <file> [--json]\n\ningest packs a flight-events-1 document into a V5 Knowledge Image. It hashes --log and writes nothing when the hash or byte length differs. verify-log hashes --log again and compares it with the flight-log object. It writes nothing. A missing flight-log object fails closed. Neither command decodes the log. log.format is ulog, dataflash, or rosbag2. A later KAR status of SATISFIED means evidence requirements were met. It does not mean a flight was safe, legal, or compliant.',
238
331
  setup: `Usage: knolo setup [--registry <url>] [--root <dir>] [--agent <id>] [--auto-rebuild] [--reset] [--skills <path>] [--managed-skills <path>] [--memory <path>] [--transcripts <path>]
239
332
 
240
333
  Resolves the hub the same way as the other hub commands.
@@ -291,7 +384,23 @@ local directory. install checks the pin before it writes. It writes into
291
384
  --dir, or into ~/.knolo/skills when --dir is omitted. A pin mismatch
292
385
  writes nothing. list prints every publisher/name from the public catalog.
293
386
  The hub stores packs and does not answer questions.`,
294
- 'verify-attestation': 'Usage: knolo verify-attestation <attestation.json> [--composition composition.json] [--public-key key.json] [--keyring keyring.json] [--now <ms>] [--content-only]\n\nSame check as knolo attest verify. A bad signature exits 1 even when the content root matches. --content-only checks the content root and ignores the envelope. statement used is not a truth verdict. Hub attested: true is unrelated.',
387
+ persona: `Usage: knolo persona <init|build|verify|eval>
388
+
389
+ knolo persona init <name> [--dir <parent>]
390
+ knolo persona build <dir> [--out <file>] [--json]
391
+ knolo persona verify <image> [--withdrawn <id>] [--json]
392
+ knolo persona eval <image> --fixtures <file> [--json]
393
+
394
+ Builds a persona pack on the current V5 image.
395
+ Knolo core does not call a model. The host owns the model.
396
+ A receipt is an integrity check. It does not mean a claim is proven.
397
+ SATISFIED means the evidence requirements were met.
398
+ A KITE verdict describes the contract. It does not mean the claim is true.
399
+ verify fails when a withdrawn source id is still in the image.
400
+ An opt-out rebuild drops that file and produces a new pin.
401
+ The example adapter is examples/persona-chat.`,
402
+ 'verify-attestation':
403
+ 'Usage: knolo verify-attestation <attestation.json> [--composition composition.json] [--public-key key.json] [--keyring keyring.json] [--now <ms>] [--content-only]\n\nSame check as knolo attest verify. A bad signature exits 1 even when the content root matches. --content-only checks the content root and ignores the envelope. statement used is not a truth verdict. Hub attested: true is unrelated.',
295
404
  icp: 'Usage: knolo icp <command> [options]',
296
405
  'semantic:index':
297
406
  'Usage: knolo semantic:index --pack <path> [--out <path>] [--model <id>] [--endpoint <url>]',
@@ -1941,7 +2050,11 @@ async function main() {
1941
2050
  const { runKarCli } = await import('./kar.mjs');
1942
2051
  return await runKarCli(commandArgs);
1943
2052
  }
1944
- if (command === 'compose' || command === 'attest' || command === 'verify-attestation') {
2053
+ if (
2054
+ command === 'compose' ||
2055
+ command === 'attest' ||
2056
+ command === 'verify-attestation'
2057
+ ) {
1945
2058
  const { runComposeCli } = await import('./compose.mjs');
1946
2059
  return await runComposeCli(command, commandArgs);
1947
2060
  }
@@ -1965,6 +2078,10 @@ async function main() {
1965
2078
  const { runSkillCli } = await import('./skill.mjs');
1966
2079
  return await runSkillCli(commandArgs);
1967
2080
  }
2081
+ if (command === 'persona') {
2082
+ const { runPersonaCli } = await import('./persona.mjs');
2083
+ return await runPersonaCli(commandArgs);
2084
+ }
1968
2085
  if (command === 'exchange') {
1969
2086
  const { runExchangeCli } = await import('./exchange.mjs');
1970
2087
  return await runExchangeCli(commandArgs);
@@ -1975,6 +2092,16 @@ async function main() {
1975
2092
  }
1976
2093
  if (command === 'init') return await cmdInit();
1977
2094
  if (command === 'add') return await cmdAdd(commandArgs);
2095
+ if (command === 'mount') {
2096
+ const core = await loadCore();
2097
+ const { runMountCli } = await import('./mount.mjs');
2098
+ return await runMountCli(commandArgs, { core });
2099
+ }
2100
+ if (command === 'receipt') {
2101
+ const core = await loadCore();
2102
+ const { runReceiptCli } = await import('./receipt.mjs');
2103
+ return await runReceiptCli(commandArgs, { core });
2104
+ }
1978
2105
  if (command === 'search') return await runHubSearch(commandArgs);
1979
2106
  if (command === 'ask') {
1980
2107
  const result = await runHubAsk(commandArgs);
@@ -1982,6 +2109,11 @@ async function main() {
1982
2109
  return;
1983
2110
  }
1984
2111
  if (command === 'info') return await runHubInfo(commandArgs);
2112
+ if (command === 'outdated') {
2113
+ const result = await runHubOutdated(commandArgs);
2114
+ if (result.exitCode) process.exit(result.exitCode);
2115
+ return;
2116
+ }
1985
2117
  if (command === 'login') return await runHubLogin(commandArgs);
1986
2118
  if (command === 'whoami') return await runHubWhoami(commandArgs);
1987
2119
  if (command === 'logout') return await runHubLogout(commandArgs);
@@ -2008,6 +2140,8 @@ async function main() {
2008
2140
 
2009
2141
  if (command.startsWith('-'))
2010
2142
  throw createError(`Unknown option: ${command}`);
2143
+ const unknownCommand = unknownCommandError(command);
2144
+ if (unknownCommand) throw unknownCommand;
2011
2145
  const core = await loadCore();
2012
2146
  return await runDirectMode(core, command, commandArgs);
2013
2147
  } catch (error) {
@@ -2016,7 +2150,7 @@ async function main() {
2016
2150
  );
2017
2151
  if (global.debug && error instanceof Error && error.stack)
2018
2152
  console.error(error.stack);
2019
- process.exit(1);
2153
+ process.exit(error?.exitCode ?? 1);
2020
2154
  }
2021
2155
  }
2022
2156