@knolo/cli 6.2.4 → 6.2.6
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 +22 -5
- package/bin/flight.mjs +62 -5
- package/bin/kite.mjs +199 -0
- package/bin/knolo.mjs +17 -2
- package/bin/registry/commands.mjs +3 -2
- package/bin/research.mjs +325 -0
- package/bin/skill.mjs +38 -20
- package/package.json +3 -3
- package/templates/icp-knowledge-canister/canisters/knolo-core-rust/src/kar/mod.rs +1 -1
- package/templates/icp-knowledge-canister/canisters/knolo-core-rust/src/kite/mod.rs +887 -0
- package/templates/icp-knowledge-canister/canisters/knolo-core-rust/src/lib.rs +2 -0
- package/templates/icp-knowledge-canister/canisters/knolo-core-rust/tests/fixtures/kite-v1/cases.json +1088 -0
package/README.md
CHANGED
|
@@ -19,8 +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.
|
|
23
|
-
`@knolo/exchange` `^0.1.0`. npm `latest` is `6.2.
|
|
22
|
+
package file is `6.2.6` and depends on `@knolo/core` `^6.2.3` and
|
|
23
|
+
`@knolo/exchange` `^0.1.0`. npm `latest` is `6.2.5`. `knolo kite` is in this
|
|
24
|
+
package file. It is not in published `@knolo/cli@6.2.5`. `knolo exchange` hands
|
|
24
25
|
a verified V5 image to another agent. Shipped configs keep `adopt: deny`.
|
|
25
26
|
Discover reads a public advertisement and does not download a pack. They do
|
|
26
27
|
not fetch Hub for that handoff. Verification
|
|
@@ -35,8 +36,10 @@ model and does not take an API key. A verified trace matches the image. It
|
|
|
35
36
|
does not mean the answer is true.
|
|
36
37
|
|
|
37
38
|
`knolo flight ingest` packs a `flight-events-1` document into a V5 Knowledge
|
|
38
|
-
Image and binds it to the SHA-256 of one log file.
|
|
39
|
-
|
|
39
|
+
Image and binds it to the SHA-256 of one log file. `knolo flight verify-log`
|
|
40
|
+
hashes that file again and compares it with the image. It writes nothing.
|
|
41
|
+
Neither command decodes the log. `log.format` is `ulog`, `dataflash`, or
|
|
42
|
+
`rosbag2`. Optional producers live in
|
|
40
43
|
`scripts/flight/` and are not part of `npm test`. `SATISFIED` on a later KAR
|
|
41
44
|
check means the evidence requirements were met. It does not mean a flight was
|
|
42
45
|
safe, legal, or compliant. See `docs/flight/README.md`.
|
|
@@ -46,6 +49,16 @@ a model. A receipt is an integrity check. It does not mean a claim is proven.
|
|
|
46
49
|
`SATISFIED` means the evidence requirements were met. See
|
|
47
50
|
[Skills](../../docs/skills/README.md).
|
|
48
51
|
|
|
52
|
+
`knolo research package` writes one V5 image from local files. `--agent` is
|
|
53
|
+
the host-supplied caller. An optional Cortex trace is verified against
|
|
54
|
+
`--cite` before the write. A cited pack stores a digest-bound composition
|
|
55
|
+
record and does not copy the cited image. Pass `--graph` when that trace
|
|
56
|
+
records KAR evaluations. The checked graph is stored in the image. The
|
|
57
|
+
command does not call a model and does not download an image.
|
|
58
|
+
`examples/skills/research-and-cite` and `examples/skills/share-findings`
|
|
59
|
+
install with `knolo skill install`. See
|
|
60
|
+
[Research packs](../../docs/guides/research-packs.md).
|
|
61
|
+
|
|
49
62
|
The official CLI for building `.knolo` knowledge packs.
|
|
50
63
|
|
|
51
64
|
It indexes structured content and produces a deterministic, local-first knowledge bundle for use with `@knolo/core`.
|
|
@@ -73,9 +86,13 @@ changing the local pack workflow:
|
|
|
73
86
|
|
|
74
87
|
```bash
|
|
75
88
|
knolo search "refund policy"
|
|
89
|
+
knolo search "refund policy" --research
|
|
76
90
|
knolo info acme/refund-policy
|
|
77
91
|
```
|
|
78
92
|
|
|
93
|
+
`--research` asks for packs whose image metadata role is `research-pack`.
|
|
94
|
+
`--agents` remains the agent-definition namespace.
|
|
95
|
+
|
|
79
96
|
The production registry is `https://hub.knolo.dev`. Use `--registry` for a
|
|
80
97
|
one-off override, or set `KNOLO_HUB_URL` for the current environment:
|
|
81
98
|
|
|
@@ -370,7 +387,7 @@ This ensures:
|
|
|
370
387
|
## 🗺 Roadmap
|
|
371
388
|
|
|
372
389
|
The active roadmap is maintained in [`../../docs/ROADMAP.md`](../../docs/ROADMAP.md).
|
|
373
|
-
The published npm release is `6.2.
|
|
390
|
+
The published npm release is `6.2.5`. This tree's package file is `6.2.6` and adds `knolo kite`. The published release preserves the V4 CLI, keeps V5 verification,
|
|
374
391
|
migration, diagnostics, and read-only Studio management, and adds offline
|
|
375
392
|
composition, attestation, and `knolo cortex`. Cortex verification does not
|
|
376
393
|
mean an answer is true.
|
package/bin/flight.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { createHash } from 'node:crypto';
|
|
|
9
9
|
import { createReadStream, existsSync, statSync, writeFileSync } from 'node:fs';
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
12
|
-
import { readBounded } from './kar-limits.mjs';
|
|
12
|
+
import { KAR_CLI_MAX_IMAGE_BYTES, readBounded } from './kar-limits.mjs';
|
|
13
13
|
|
|
14
14
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
15
|
|
|
@@ -36,11 +36,16 @@ const KIND_FIELDS = {
|
|
|
36
36
|
'scan-summary': ['phrase'],
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const USAGE = `Usage: knolo flight ingest
|
|
39
|
+
const USAGE = `Usage: knolo flight <ingest|verify-log> [options]
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
knolo flight ingest --events <events.json> --log <file> --out <image.knolo> [--json]
|
|
42
|
+
knolo flight verify-log --image <image.knolo> --log <file> [--json]
|
|
43
|
+
|
|
44
|
+
ingest packs a flight-events-1 document into a V5 Knowledge Image.
|
|
45
|
+
It hashes --log and writes nothing when the hash or byte length differs.
|
|
46
|
+
verify-log hashes --log again and compares it with the flight-log object.
|
|
47
|
+
It writes nothing. A missing flight-log object fails closed.
|
|
48
|
+
Neither command decodes the log. Parsing stays in an external producer.
|
|
44
49
|
A later KAR status of SATISFIED means evidence requirements were met.
|
|
45
50
|
It does not mean a flight was safe, legal, or compliant.`;
|
|
46
51
|
|
|
@@ -51,6 +56,7 @@ export async function runFlightCli(argv) {
|
|
|
51
56
|
console.log(USAGE);
|
|
52
57
|
return;
|
|
53
58
|
}
|
|
59
|
+
if (sub === 'verify-log') return verifyFlightLog(flags);
|
|
54
60
|
if (sub !== 'ingest') throw new Error(`Unknown flight command "${sub}".\n${USAGE}`);
|
|
55
61
|
const eventsPath = required(flags, 'events');
|
|
56
62
|
const logPath = required(flags, 'log');
|
|
@@ -76,6 +82,57 @@ export async function runFlightCli(argv) {
|
|
|
76
82
|
console.log(`FLIGHT IMAGE\nstate root ${image.stateRoot}\nevents ${document.events.length}\nwrote ${outPath}\n\nEvidence requirements are not a safety or compliance determination.`);
|
|
77
83
|
}
|
|
78
84
|
|
|
85
|
+
async function verifyFlightLog(flags) {
|
|
86
|
+
const imagePath = required(flags, 'image');
|
|
87
|
+
const logPath = required(flags, 'log');
|
|
88
|
+
const stored = await readFlightLogBinding(imagePath);
|
|
89
|
+
const log = await inspectLog(logPath);
|
|
90
|
+
if (log.byteLength !== stored.byteLength || log.sha256 !== stored.sha256) {
|
|
91
|
+
throw new Error('FLIGHT_LOG_MISMATCH: log bytes do not match the flight-log object.');
|
|
92
|
+
}
|
|
93
|
+
if (flags.json) {
|
|
94
|
+
console.log(JSON.stringify({
|
|
95
|
+
ok: true,
|
|
96
|
+
stateRoot: stored.stateRoot,
|
|
97
|
+
logSha256: stored.sha256,
|
|
98
|
+
byteLength: stored.byteLength,
|
|
99
|
+
}, null, 2));
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
console.log(`FLIGHT LOG VERIFIED\nstate root ${stored.stateRoot}\nlog ${stored.sha256}\nbytes ${stored.byteLength}\n\nEvidence requirements are not a safety or compliance determination.`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function readFlightLogBinding(imagePath) {
|
|
106
|
+
const bytes = readBounded(imagePath, KAR_CLI_MAX_IMAGE_BYTES);
|
|
107
|
+
const api = await loadImageApi();
|
|
108
|
+
if (!api.mountKnowledgeImageV5) throw new Error('Could not load @knolo/core. Build packages/core first.');
|
|
109
|
+
let image;
|
|
110
|
+
try {
|
|
111
|
+
image = api.mountKnowledgeImageV5(bytes);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
114
|
+
throw new Error(`FLIGHT_EVENTS_INVALID: ${message}`);
|
|
115
|
+
}
|
|
116
|
+
const logs = image.objects.filter((object) => object.meta && object.meta.role === 'flight-log');
|
|
117
|
+
if (logs.length !== 1) {
|
|
118
|
+
throw new Error('FLIGHT_EVENTS_INVALID: image must contain one flight-log object.');
|
|
119
|
+
}
|
|
120
|
+
const sha256 = logs[0].meta.logSha256;
|
|
121
|
+
const rawLength = logs[0].meta.byteLength;
|
|
122
|
+
const byteLength = typeof rawLength === 'number' ? rawLength : Number(rawLength);
|
|
123
|
+
const lengthText = typeof rawLength === 'string' ? rawLength : String(rawLength);
|
|
124
|
+
if (
|
|
125
|
+
typeof sha256 !== 'string' ||
|
|
126
|
+
!DIGEST.test(sha256) ||
|
|
127
|
+
!Number.isSafeInteger(byteLength) ||
|
|
128
|
+
byteLength < 0 ||
|
|
129
|
+
lengthText !== String(byteLength)
|
|
130
|
+
) {
|
|
131
|
+
throw new Error('FLIGHT_EVENTS_INVALID: flight-log metadata is not a sha256 and byte length.');
|
|
132
|
+
}
|
|
133
|
+
return { sha256, byteLength, stateRoot: image.stateRoot };
|
|
134
|
+
}
|
|
135
|
+
|
|
79
136
|
export function readEvents(file) {
|
|
80
137
|
const resolved = path.resolve(process.cwd(), file);
|
|
81
138
|
const stat = statSync(resolved);
|
package/bin/kite.mjs
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* knolo kite evaluate | verify
|
|
3
|
+
*
|
|
4
|
+
* Replays a typed contract against a local V5 image.
|
|
5
|
+
* It does not call a model and it does not download an image.
|
|
6
|
+
* A certificate is an integrity check. It does not mean a claim is true.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
11
|
+
import {
|
|
12
|
+
KAR_CLI_MAX_IMAGE_BYTES,
|
|
13
|
+
KAR_CLI_MAX_TEXT_BYTES,
|
|
14
|
+
readBounded,
|
|
15
|
+
} from './kar-limits.mjs';
|
|
16
|
+
|
|
17
|
+
const USAGE = `Usage: knolo kite <evaluate|verify> [options]
|
|
18
|
+
|
|
19
|
+
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]
|
|
20
|
+
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]
|
|
21
|
+
|
|
22
|
+
Evaluation names unmet obligations and derives a verdict inside the declared changes.
|
|
23
|
+
Verification recomputes that derivation.
|
|
24
|
+
A certificate is an integrity check. It does not mean the claim is true.
|
|
25
|
+
BOUND_EXCEEDED means the search did not finish and is not a certificate.`;
|
|
26
|
+
|
|
27
|
+
export async function runKiteCli(argv) {
|
|
28
|
+
if (
|
|
29
|
+
argv.length === 0 ||
|
|
30
|
+
argv[0] === 'help' ||
|
|
31
|
+
argv[0] === '--help' ||
|
|
32
|
+
argv[0] === '-h'
|
|
33
|
+
) {
|
|
34
|
+
console.log(USAGE);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const command = argv[0];
|
|
38
|
+
if (command !== 'evaluate' && command !== 'verify') {
|
|
39
|
+
throw new Error(`Unknown kite command "${command}".\n${USAGE}`);
|
|
40
|
+
}
|
|
41
|
+
const flags = parseFlags(argv.slice(1));
|
|
42
|
+
if (flags.help) {
|
|
43
|
+
console.log(USAGE);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
if (command === 'evaluate') await evaluate(flags);
|
|
48
|
+
else await verify(flags);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
if (
|
|
51
|
+
error &&
|
|
52
|
+
typeof error.code === 'string' &&
|
|
53
|
+
error.code.startsWith('KITE')
|
|
54
|
+
) {
|
|
55
|
+
throw new Error(`${error.code}: ${error.message}`);
|
|
56
|
+
}
|
|
57
|
+
if (error && error.code === 'BOUND_EXCEEDED') {
|
|
58
|
+
throw new Error(`${error.code}: ${error.message}`);
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function evaluate(flags) {
|
|
65
|
+
const api = await loadKite();
|
|
66
|
+
const session = createSession(api, flags);
|
|
67
|
+
const result = await api.evaluateKiteSession(session, optionsFrom(flags));
|
|
68
|
+
const body = `${JSON.stringify(result, null, 2)}\n`;
|
|
69
|
+
if (flags.out) writeNew(flags.out, body);
|
|
70
|
+
if (flags.json || !flags.out) {
|
|
71
|
+
if (flags.json) process.stdout.write(body);
|
|
72
|
+
else if (result.certificate) {
|
|
73
|
+
console.log(`${result.verdict} ${result.certificate.invarianceRoot}`);
|
|
74
|
+
} else console.log(result.verdict);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function verify(flags) {
|
|
79
|
+
const api = await loadKite();
|
|
80
|
+
const certificate = readJson(required(flags.certificate, '--certificate'));
|
|
81
|
+
const verified = await api.verifyKiteCertificate({
|
|
82
|
+
...inputFrom(flags),
|
|
83
|
+
...optionsFrom(flags),
|
|
84
|
+
certificate,
|
|
85
|
+
});
|
|
86
|
+
if (!verified.ok) throw new Error(`${verified.code}: ${verified.message}`);
|
|
87
|
+
console.log(`ok ${verified.invarianceRoot}`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function createSession(api, flags) {
|
|
91
|
+
return api.createKiteSession(inputFrom(flags));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function inputFrom(flags) {
|
|
95
|
+
const input = {
|
|
96
|
+
image: new Uint8Array(
|
|
97
|
+
readBounded(required(flags.image, '--image'), KAR_CLI_MAX_IMAGE_BYTES)
|
|
98
|
+
),
|
|
99
|
+
contract: readJson(required(flags.contract, '--contract')),
|
|
100
|
+
rules: readJson(required(flags.rules, '--rules')),
|
|
101
|
+
};
|
|
102
|
+
if (flags.completeness) input.completeness = readJson(flags.completeness);
|
|
103
|
+
if (flags.changes) input.changes = readJson(flags.changes);
|
|
104
|
+
if (flags.bounds) input.bounds = readJson(flags.bounds);
|
|
105
|
+
if (flags.graph) input.graph = readJson(flags.graph);
|
|
106
|
+
return input;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function optionsFrom(flags) {
|
|
110
|
+
const options = {};
|
|
111
|
+
if (flags.question) options.question = flags.question;
|
|
112
|
+
if (flags.asOf) options.asOf = flags.asOf;
|
|
113
|
+
return options;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function readJson(file) {
|
|
117
|
+
const bytes = readBounded(file, KAR_CLI_MAX_TEXT_BYTES);
|
|
118
|
+
try {
|
|
119
|
+
return JSON.parse(new TextDecoder().decode(bytes));
|
|
120
|
+
} catch (error) {
|
|
121
|
+
throw new Error(
|
|
122
|
+
`KITE_CONTRACT_INVALID: ${path.basename(file)} is not JSON.`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function writeNew(file, body) {
|
|
128
|
+
const resolved = path.resolve(process.cwd(), file);
|
|
129
|
+
if (existsSync(resolved)) throw new Error(`Refusing to overwrite ${file}`);
|
|
130
|
+
try {
|
|
131
|
+
writeFileSync(resolved, body, { flag: 'wx' });
|
|
132
|
+
} catch (error) {
|
|
133
|
+
if (error && error.code !== 'EEXIST') {
|
|
134
|
+
try {
|
|
135
|
+
unlinkSync(resolved);
|
|
136
|
+
} catch {
|
|
137
|
+
// The file was not created.
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function hasKite(loaded) {
|
|
145
|
+
return Boolean(
|
|
146
|
+
loaded?.createKiteSession &&
|
|
147
|
+
loaded?.evaluateKiteSession &&
|
|
148
|
+
loaded?.verifyKiteCertificate
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function loadKite() {
|
|
153
|
+
const candidate = path.resolve(
|
|
154
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
155
|
+
'../../core/dist/kite/index.js'
|
|
156
|
+
);
|
|
157
|
+
try {
|
|
158
|
+
const loaded = await import(pathToFileURL(candidate).href);
|
|
159
|
+
if (hasKite(loaded)) return loaded;
|
|
160
|
+
} catch {
|
|
161
|
+
// An installed package does not have the checkout dist path.
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
const loaded = await import('@knolo/core/kite');
|
|
165
|
+
if (hasKite(loaded)) return loaded;
|
|
166
|
+
} catch {
|
|
167
|
+
// The package fallback is absent until core is installed.
|
|
168
|
+
}
|
|
169
|
+
throw new Error(
|
|
170
|
+
'Could not load @knolo/core/kite. Build packages/core first.'
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function required(value, name) {
|
|
175
|
+
if (!value) throw new Error(`Missing ${name}.\n${USAGE}`);
|
|
176
|
+
return value;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function parseFlags(args) {
|
|
180
|
+
const flags = {};
|
|
181
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
182
|
+
const arg = args[index];
|
|
183
|
+
if (arg === '--help' || arg === '-h') flags.help = true;
|
|
184
|
+
else if (arg === '--json') flags.json = true;
|
|
185
|
+
else if (arg === '--image') flags.image = args[++index];
|
|
186
|
+
else if (arg === '--contract') flags.contract = args[++index];
|
|
187
|
+
else if (arg === '--rules') flags.rules = args[++index];
|
|
188
|
+
else if (arg === '--completeness') flags.completeness = args[++index];
|
|
189
|
+
else if (arg === '--changes') flags.changes = args[++index];
|
|
190
|
+
else if (arg === '--bounds') flags.bounds = args[++index];
|
|
191
|
+
else if (arg === '--graph') flags.graph = args[++index];
|
|
192
|
+
else if (arg === '--certificate') flags.certificate = args[++index];
|
|
193
|
+
else if (arg === '--as-of') flags.asOf = args[++index];
|
|
194
|
+
else if (arg === '--question') flags.question = args[++index];
|
|
195
|
+
else if (arg === '--out') flags.out = args[++index];
|
|
196
|
+
else throw new Error(`Unknown kite option "${arg}".\n${USAGE}`);
|
|
197
|
+
}
|
|
198
|
+
return flags;
|
|
199
|
+
}
|
package/bin/knolo.mjs
CHANGED
|
@@ -77,10 +77,12 @@ const SUBCOMMANDS = new Set([
|
|
|
77
77
|
'attest',
|
|
78
78
|
'verify-attestation',
|
|
79
79
|
'cortex',
|
|
80
|
+
'kite',
|
|
80
81
|
'flight',
|
|
81
82
|
'skill',
|
|
82
83
|
'setup',
|
|
83
84
|
'exchange',
|
|
85
|
+
'research',
|
|
84
86
|
]);
|
|
85
87
|
const ICP_SUBCOMMANDS = new Set([
|
|
86
88
|
'init',
|
|
@@ -179,8 +181,10 @@ Commands:
|
|
|
179
181
|
compose Compose Knowledge Images, packs, and attestations offline
|
|
180
182
|
attest Create or verify a composition attestation
|
|
181
183
|
cortex Bounded evidence retrieval with a verifiable trace
|
|
184
|
+
kite Check a typed contract and replay its certificate
|
|
182
185
|
flight Pack a flight-events-1 document into a V5 Knowledge Image
|
|
183
186
|
skill Create and share a Knolo skill pack
|
|
187
|
+
research Package local research files into a V5 Knowledge Image
|
|
184
188
|
setup Prepare a local index and print the hub next steps
|
|
185
189
|
exchange Offer or pull a verified Knowledge Image from a peer
|
|
186
190
|
icp Scaffold and operate an ICP-native knowledge canister
|
|
@@ -198,7 +202,7 @@ function printCommandHelp(command) {
|
|
|
198
202
|
init: 'Usage: knolo init',
|
|
199
203
|
add: 'Usage: knolo add <name> <path> | <publisher>/<slug>[@<version>] [--out <path>] [--force] [--json] [--registry <url>]',
|
|
200
204
|
search:
|
|
201
|
-
'Usage: knolo search <query> [--format V4|V5] [--license <id>] [--official] [--agents] [--json] [--registry <url>]',
|
|
205
|
+
'Usage: knolo search <query> [--format V4|V5] [--license <id>] [--official] [--agents] [--research] [--json] [--registry <url>]',
|
|
202
206
|
info: 'Usage: knolo info <publisher>/<slug> [--json] [--registry <url>]',
|
|
203
207
|
login:
|
|
204
208
|
'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.',
|
|
@@ -222,7 +226,10 @@ function printCommandHelp(command) {
|
|
|
222
226
|
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.',
|
|
223
227
|
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.',
|
|
224
228
|
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.',
|
|
225
|
-
|
|
229
|
+
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.',
|
|
230
|
+
research:
|
|
231
|
+
'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.',
|
|
232
|
+
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.',
|
|
226
233
|
setup: `Usage: knolo setup [--registry <url>] [--root <dir>] [--agent <id>] [--auto-rebuild] [--reset] [--skills <path>] [--managed-skills <path>] [--memory <path>] [--transcripts <path>]
|
|
227
234
|
|
|
228
235
|
Resolves the hub the same way as the other hub commands.
|
|
@@ -1934,10 +1941,18 @@ async function main() {
|
|
|
1934
1941
|
const { runCortexCli } = await import('./cortex.mjs');
|
|
1935
1942
|
return await runCortexCli(commandArgs);
|
|
1936
1943
|
}
|
|
1944
|
+
if (command === 'kite') {
|
|
1945
|
+
const { runKiteCli } = await import('./kite.mjs');
|
|
1946
|
+
return await runKiteCli(commandArgs);
|
|
1947
|
+
}
|
|
1937
1948
|
if (command === 'flight') {
|
|
1938
1949
|
const { runFlightCli } = await import('./flight.mjs');
|
|
1939
1950
|
return await runFlightCli(commandArgs);
|
|
1940
1951
|
}
|
|
1952
|
+
if (command === 'research') {
|
|
1953
|
+
const { runResearchCli } = await import('./research.mjs');
|
|
1954
|
+
return await runResearchCli(commandArgs);
|
|
1955
|
+
}
|
|
1941
1956
|
if (command === 'skill') {
|
|
1942
1957
|
const { runSkillCli } = await import('./skill.mjs');
|
|
1943
1958
|
return await runSkillCli(commandArgs);
|
|
@@ -62,6 +62,7 @@ export async function runHubSearch(
|
|
|
62
62
|
license: flags.license,
|
|
63
63
|
official: flags.official ? 'true' : undefined,
|
|
64
64
|
agents: flags.agents ? 'true' : undefined,
|
|
65
|
+
research: flags.research ? 'true' : undefined,
|
|
65
66
|
});
|
|
66
67
|
const body = await getJson(url, { fetchImpl });
|
|
67
68
|
validatePacksResponse(body);
|
|
@@ -961,7 +962,7 @@ export function parseSearchArgs(args) {
|
|
|
961
962
|
const flags = {};
|
|
962
963
|
for (let i = 0; i < args.length; i++) {
|
|
963
964
|
const arg = args[i];
|
|
964
|
-
if (arg === '--json' || arg === '--official' || arg === '--agents') {
|
|
965
|
+
if (arg === '--json' || arg === '--official' || arg === '--agents' || arg === '--research') {
|
|
965
966
|
flags[arg.slice(2)] = true;
|
|
966
967
|
continue;
|
|
967
968
|
}
|
|
@@ -980,7 +981,7 @@ export function parseSearchArgs(args) {
|
|
|
980
981
|
const query = positional.join(' ').trim();
|
|
981
982
|
if (!query)
|
|
982
983
|
throw new Error(
|
|
983
|
-
'Usage: knolo search <query> [--format V4|V5] [--license <id>] [--official] [--agents] [--json] [--registry <url>]'
|
|
984
|
+
'Usage: knolo search <query> [--format V4|V5] [--license <id>] [--official] [--agents] [--research] [--json] [--registry <url>]'
|
|
984
985
|
);
|
|
985
986
|
if (
|
|
986
987
|
flags.format &&
|