@nexart/cli 0.12.0 → 0.12.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @nexart/cli — Changelog
2
2
 
3
+ ## v0.12.2 (2026-06-15) — bump core to `@nexart/ai-execution@^0.23.0`
4
+
5
+ Dependency alignment. No command behavior changes, no breaking changes.
6
+
7
+ - **Bumps** `@nexart/ai-execution` to `^0.23.0`, which adds optional identity
8
+ binding (`snapshot.identity`). The change is additive and PII-safe.
9
+ - **`nexart verify-bundle`** already verifies identity-bound bundles with no code
10
+ change: `snapshot.identity` is sealed snapshot data bound by `certificateHash`,
11
+ and the standalone verifier recomputes over the snapshot exactly as stored — so
12
+ a tampered `snapshot.identity` FAILS integrity, while identity-free bundles
13
+ verify byte-for-byte unchanged.
14
+ - Keeps the SDK-backed `nexart ai` commands on the latest core.
15
+
16
+ ## v0.12.1 (2026-06-14) — packaging fix for `verify-bundle`
17
+
18
+ Packaging-only fix. No functional changes, no breaking changes, no command
19
+ behavior changes.
20
+
21
+ - **Fix:** the published npm package was missing `dist/standaloneVerify.js` (and
22
+ its type declarations), which broke the `nexart verify-bundle` command at
23
+ runtime with `Cannot find module dist/standaloneVerify.js`. The `files` field
24
+ in `package.json` listed individual `dist/index.*` files only; it now ships the
25
+ entire `dist/` directory, so all compiled modules are included.
26
+ - **Restores** full functionality of the `nexart verify-bundle` command.
27
+
3
28
  ## v0.12.0 (2026-06-14) — `verify-bundle` (standalone, SDK-free CER verification)
4
29
 
5
30
  Additive and fully backward-compatible. No existing command, flag, or output
package/README.md CHANGED
@@ -667,7 +667,10 @@ nexart verify-bundle cer.json --public-key node-keys.json --verbose
667
667
  1. **Integrity** — recomputes `certificateHash` from the bundle's evidentiary
668
668
  payload (`bundleType`, `createdAt`, `snapshot`, `version`, and, when present,
669
669
  `context` / `contextSummary` / `policyEvaluation`) and compares it to the
670
- stored value. Canonicalisation is bound to `snapshot.protocolVersion`:
670
+ stored value. The whole `snapshot` is hashed, so an optional
671
+ `snapshot.identity` assertion (v0.23.0+) is bound by `certificateHash` and
672
+ tampering with it FAILS — no special-casing in the verifier. Canonicalisation
673
+ is bound to `snapshot.protocolVersion`:
671
674
  - `1.2.0` → **nexart-v1** (NexArt's original canonical JSON)
672
675
  - `1.3.0` → **jcs-v1** (RFC 8785 JSON Canonicalization Scheme)
673
676
 
@@ -0,0 +1,65 @@
1
+ import { type KeyObject } from 'node:crypto';
2
+ /** Canonicalisation mode bound to a protocolVersion. Fail-closed on unknown. */
3
+ export declare function canonicalModeForProtocol(protocolVersion: string): 'nexart-v1' | 'jcs-v1';
4
+ /** Canonicalise `value` using the mode bound to `protocolVersion`. */
5
+ export declare function canonicalForProtocol(value: unknown, protocolVersion: string): string;
6
+ interface Bundle {
7
+ bundleType?: unknown;
8
+ certificateHash?: unknown;
9
+ createdAt?: unknown;
10
+ version?: unknown;
11
+ snapshot?: {
12
+ protocolVersion?: unknown;
13
+ } & Record<string, unknown>;
14
+ context?: unknown;
15
+ contextSummary?: unknown;
16
+ policyEvaluation?: unknown;
17
+ receipt?: unknown;
18
+ signature?: unknown;
19
+ attestorKeyId?: unknown;
20
+ publicKey?: unknown;
21
+ meta?: {
22
+ attestation?: Record<string, unknown>;
23
+ } & Record<string, unknown>;
24
+ }
25
+ /** Recompute "sha256:<hex>" over the bundle's evidentiary payload. */
26
+ export declare function recomputeCertificateHash(bundle: Bundle): {
27
+ hash: string;
28
+ protocolVersion: string;
29
+ canonical: string;
30
+ };
31
+ /**
32
+ * Resolve an Ed25519 public KeyObject from arbitrary supplied material:
33
+ * • PEM (-----BEGIN PUBLIC KEY-----)
34
+ * • JWK JSON ({ kty:'OKP', crv:'Ed25519', x })
35
+ * • NodeKeysDocument JSON ({ keys:[{ kid, publicKey | publicKeyJwk | publicKeySpkiB64 }] })
36
+ * • raw base64url / base64 string (32-byte point)
37
+ */
38
+ export declare function resolvePublicKey(material: string, kid?: string): KeyObject;
39
+ export type Pass = 'pass' | 'fail' | 'skipped';
40
+ export interface StandaloneVerifyResult {
41
+ status: 'verified' | 'failed';
42
+ integrity: Pass;
43
+ signature: Pass;
44
+ protocolVersion: string;
45
+ expectedCertificateHash: string | null;
46
+ actualCertificateHash: string | null;
47
+ reasons: string[];
48
+ steps: string[];
49
+ }
50
+ export interface StandaloneVerifyOptions {
51
+ /** Raw public-key material (PEM/JWK/NodeKeysDocument/raw). Highest priority. */
52
+ publicKeyMaterial?: string;
53
+ /** kid to select from a NodeKeysDocument. */
54
+ kid?: string;
55
+ /** Collect human-readable intermediate steps. */
56
+ verbose?: boolean;
57
+ }
58
+ /**
59
+ * Verify a CER bundle with no NexArt dependency. Returns a structured result;
60
+ * never throws for an ordinary verification failure (only for programmer error
61
+ * such as a non-object bundle).
62
+ */
63
+ export declare function verifyBundleStandalone(bundleInput: unknown, options?: StandaloneVerifyOptions): StandaloneVerifyResult;
64
+ export {};
65
+ //# sourceMappingURL=standaloneVerify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standaloneVerify.d.ts","sourceRoot":"","sources":["../src/standaloneVerify.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAkE9F,gFAAgF;AAChF,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAOxF;AAED,sEAAsE;AACtE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAIpF;AAYD,UAAU,MAAM;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,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G,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,OAAO,EACpB,OAAO,GAAE,uBAA4B,GACpC,sBAAsB,CAmIxB"}
@@ -0,0 +1,387 @@
1
+ // ─────────────────────────────────────────────────────────────────────────────
2
+ // Standalone CER verifier — ZERO NexArt dependencies.
3
+ //
4
+ // This module re-implements, from first principles, everything needed to verify
5
+ // a NexArt CER bundle (`cer.ai.execution.v1`) independently of the NexArt node
6
+ // and of every `@nexart/*` package. A third-party auditor can read this single
7
+ // file end-to-end and reproduce the result with nothing but the JSON bundle, the
8
+ // signer's public key, and the Node.js standard library.
9
+ //
10
+ // It imports ONLY `node:crypto`. There is no hidden NexArt logic, no network,
11
+ // and no SDK import — by design and by audit.
12
+ //
13
+ // What it proves:
14
+ // 1. INTEGRITY — recompute the certificateHash from the bundle's evidentiary
15
+ // payload and compare it to `bundle.certificateHash`.
16
+ // 2. SIGNATURE — when a signed node attestation receipt is present, verify its
17
+ // Ed25519 signature over the canonical JSON of the receipt.
18
+ //
19
+ // Canonicalisation is bound to the protocol version, exactly as the producer did:
20
+ // • 1.2.0 → "nexart-v1" (NexArt's original canonical JSON; copied verbatim)
21
+ // • 1.3.0 → "jcs-v1" (RFC 8785 JSON Canonicalization Scheme)
22
+ // Both schemes are byte-for-byte identical for every JSON-safe value; they are
23
+ // kept as two explicit functions so the binding to protocolVersion is auditable.
24
+ // ─────────────────────────────────────────────────────────────────────────────
25
+ import { createHash, createPublicKey, verify as edVerify } from 'node:crypto';
26
+ // ── Canonicalisation: nexart-v1 (protocolVersion 1.2.0) ──────────────────────
27
+ // Copied verbatim from NexArt's frozen canonicaliser. These bytes never change.
28
+ function canonicalizeNexartV1(value) {
29
+ if (value === null)
30
+ return 'null';
31
+ if (typeof value === 'boolean')
32
+ return value ? 'true' : 'false';
33
+ if (typeof value === 'number') {
34
+ if (!Number.isFinite(value)) {
35
+ throw new Error(`Non-finite number not allowed in canonical JSON: ${value}`);
36
+ }
37
+ return JSON.stringify(value);
38
+ }
39
+ if (typeof value === 'string')
40
+ return JSON.stringify(value);
41
+ if (Array.isArray(value)) {
42
+ return '[' + value.map((item) => canonicalizeNexartV1(item)).join(',') + ']';
43
+ }
44
+ if (typeof value === 'object') {
45
+ const obj = value;
46
+ const keys = Object.keys(obj).sort();
47
+ const entries = keys
48
+ .map((key) => {
49
+ const val = obj[key];
50
+ if (val === undefined)
51
+ return null;
52
+ return JSON.stringify(key) + ':' + canonicalizeNexartV1(val);
53
+ })
54
+ .filter((e) => e !== null);
55
+ return '{' + entries.join(',') + '}';
56
+ }
57
+ throw new Error(`Unsupported type for canonical JSON: ${typeof value}`);
58
+ }
59
+ // ── Canonicalisation: jcs-v1 (protocolVersion 1.3.0) — RFC 8785 ──────────────
60
+ // RFC 8785 JSON Canonicalization Scheme (§3.2):
61
+ // • literals null/true/false; numbers via ECMAScript Number::toString (finite);
62
+ // • strings via minimal JSON escaping; object members sorted by UTF-16 code
63
+ // unit; no insignificant whitespace. JSON.stringify(scalar) already emits the
64
+ // RFC 8785 string/number forms, and Array.prototype.sort() orders by UTF-16
65
+ // code unit — so this is a faithful, dependency-free RFC 8785 serialiser.
66
+ function canonicalizeJcs(value) {
67
+ if (value === null)
68
+ return 'null';
69
+ if (typeof value === 'boolean')
70
+ return value ? 'true' : 'false';
71
+ if (typeof value === 'number') {
72
+ if (!Number.isFinite(value)) {
73
+ throw new Error(`RFC 8785: non-finite number is not valid JSON: ${value}`);
74
+ }
75
+ return JSON.stringify(value);
76
+ }
77
+ if (typeof value === 'string')
78
+ return JSON.stringify(value);
79
+ if (Array.isArray(value)) {
80
+ return '[' + value.map((item) => canonicalizeJcs(item)).join(',') + ']';
81
+ }
82
+ if (typeof value === 'object') {
83
+ const obj = value;
84
+ const keys = Object.keys(obj).sort();
85
+ const entries = [];
86
+ for (const key of keys) {
87
+ const val = obj[key];
88
+ if (val === undefined)
89
+ continue;
90
+ entries.push(JSON.stringify(key) + ':' + canonicalizeJcs(val));
91
+ }
92
+ return '{' + entries.join(',') + '}';
93
+ }
94
+ throw new Error(`RFC 8785: unsupported type for canonical JSON: ${typeof value}`);
95
+ }
96
+ /** Canonicalisation mode bound to a protocolVersion. Fail-closed on unknown. */
97
+ export function canonicalModeForProtocol(protocolVersion) {
98
+ if (protocolVersion === '1.3.0')
99
+ return 'jcs-v1';
100
+ if (protocolVersion === '1.2.0')
101
+ return 'nexart-v1';
102
+ throw new Error(`Unsupported protocolVersion "${protocolVersion}": no canonicalisation mode is bound to it ` +
103
+ `(supported: 1.2.0 → nexart-v1, 1.3.0 → jcs-v1).`);
104
+ }
105
+ /** Canonicalise `value` using the mode bound to `protocolVersion`. */
106
+ export function canonicalForProtocol(value, protocolVersion) {
107
+ return canonicalModeForProtocol(protocolVersion) === 'jcs-v1'
108
+ ? canonicalizeJcs(value)
109
+ : canonicalizeNexartV1(value);
110
+ }
111
+ function sha256Hex(text) {
112
+ return createHash('sha256').update(text, 'utf8').digest('hex');
113
+ }
114
+ function buildCertificatePayload(bundle) {
115
+ const payload = {
116
+ bundleType: 'cer.ai.execution.v1',
117
+ createdAt: bundle.createdAt,
118
+ snapshot: bundle.snapshot,
119
+ version: bundle.version,
120
+ };
121
+ if (bundle.context !== undefined)
122
+ payload.context = bundle.context;
123
+ if (bundle.contextSummary !== undefined)
124
+ payload.contextSummary = bundle.contextSummary;
125
+ if (bundle.policyEvaluation !== undefined)
126
+ payload.policyEvaluation = bundle.policyEvaluation;
127
+ return payload;
128
+ }
129
+ /** Recompute "sha256:<hex>" over the bundle's evidentiary payload. */
130
+ export function recomputeCertificateHash(bundle) {
131
+ const pv = bundle.snapshot?.protocolVersion;
132
+ const protocolVersion = typeof pv === 'string' ? pv : '1.2.0';
133
+ const payload = buildCertificatePayload(bundle);
134
+ const canonical = canonicalForProtocol(payload, protocolVersion);
135
+ return { hash: `sha256:${sha256Hex(canonical)}`, protocolVersion, canonical };
136
+ }
137
+ function extractReceipt(bundle) {
138
+ const pickKey = (src) => {
139
+ const jwk = src.publicKeyJwk;
140
+ const raw = typeof src.publicKey === 'string' ? src.publicKey : undefined;
141
+ const spki = typeof src.publicKeySpkiB64 === 'string' ? src.publicKeySpkiB64 : undefined;
142
+ if (jwk || raw || spki)
143
+ return { jwk, raw, spki };
144
+ return undefined;
145
+ };
146
+ if (bundle.receipt && typeof bundle.receipt === 'object' && typeof bundle.signature === 'string') {
147
+ return {
148
+ receipt: bundle.receipt,
149
+ signature: bundle.signature,
150
+ attestorKeyId: typeof bundle.attestorKeyId === 'string' ? bundle.attestorKeyId : undefined,
151
+ embeddedKey: pickKey(bundle),
152
+ };
153
+ }
154
+ const att = bundle.meta?.attestation;
155
+ if (att && typeof att === 'object') {
156
+ const a = att;
157
+ if (a.receipt && typeof a.receipt === 'object' && typeof a.signature === 'string') {
158
+ return {
159
+ receipt: a.receipt,
160
+ signature: a.signature,
161
+ attestorKeyId: typeof a.attestorKeyId === 'string' ? a.attestorKeyId : undefined,
162
+ embeddedKey: pickKey(a),
163
+ };
164
+ }
165
+ }
166
+ return null;
167
+ }
168
+ // ── Public key resolution ────────────────────────────────────────────────────
169
+ function rawToBase64Url(s) {
170
+ return s.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
171
+ }
172
+ function base64urlToBuffer(s) {
173
+ return Buffer.from(s.replace(/-/g, '+').replace(/_/g, '/'), 'base64');
174
+ }
175
+ function keyFromJwkX(x) {
176
+ return createPublicKey({ key: { kty: 'OKP', crv: 'Ed25519', x: rawToBase64Url(x) }, format: 'jwk' });
177
+ }
178
+ function keyFromSpkiBase64(spkiB64) {
179
+ const der = base64urlToBuffer(spkiB64);
180
+ // Use the trailing 32 bytes (the raw Ed25519 point) so any SPKI variant works.
181
+ const raw = der.subarray(der.length - 32);
182
+ return keyFromJwkX(rawToBase64Url(raw.toString('base64')));
183
+ }
184
+ /**
185
+ * Resolve an Ed25519 public KeyObject from arbitrary supplied material:
186
+ * • PEM (-----BEGIN PUBLIC KEY-----)
187
+ * • JWK JSON ({ kty:'OKP', crv:'Ed25519', x })
188
+ * • NodeKeysDocument JSON ({ keys:[{ kid, publicKey | publicKeyJwk | publicKeySpkiB64 }] })
189
+ * • raw base64url / base64 string (32-byte point)
190
+ */
191
+ export function resolvePublicKey(material, kid) {
192
+ const text = material.trim();
193
+ if (text.startsWith('-----BEGIN'))
194
+ return createPublicKey(text);
195
+ try {
196
+ const parsed = JSON.parse(text);
197
+ if (Array.isArray(parsed.keys)) {
198
+ const keys = parsed.keys;
199
+ const activeKid = typeof parsed.activeKid === 'string' ? parsed.activeKid : undefined;
200
+ let entry;
201
+ if (kid) {
202
+ // Strict (parity with SDK selectNodeKey): a requested kid that is absent
203
+ // is an error, never a silent fallback to another key.
204
+ entry = keys.find((k) => k.kid === kid);
205
+ if (!entry)
206
+ throw new Error(`Key with kid="${kid}" not found in node keys document`);
207
+ }
208
+ else if (activeKid) {
209
+ entry = keys.find((k) => k.kid === activeKid);
210
+ if (!entry)
211
+ throw new Error(`activeKid="${activeKid}" not found in node keys document`);
212
+ }
213
+ else {
214
+ entry = keys[0];
215
+ }
216
+ if (!entry)
217
+ throw new Error('No key entry found in node keys document');
218
+ return keyFromEntry(entry);
219
+ }
220
+ if (parsed.kty === 'OKP' || typeof parsed.x === 'string') {
221
+ return keyFromJwkX(String(parsed.x));
222
+ }
223
+ return keyFromEntry(parsed);
224
+ }
225
+ catch (err) {
226
+ if (err instanceof SyntaxError) {
227
+ // Not JSON → treat as a raw base64url/base64 32-byte public key.
228
+ return keyFromJwkX(rawToBase64Url(text));
229
+ }
230
+ throw err;
231
+ }
232
+ }
233
+ function keyFromEntry(entry) {
234
+ const jwk = entry.publicKeyJwk;
235
+ if (jwk && typeof jwk.x === 'string')
236
+ return keyFromJwkX(jwk.x);
237
+ if (typeof entry.publicKey === 'string')
238
+ return keyFromJwkX(rawToBase64Url(entry.publicKey));
239
+ if (typeof entry.publicKeySpkiB64 === 'string')
240
+ return keyFromSpkiBase64(entry.publicKeySpkiB64);
241
+ throw new Error('Key entry has no usable public key (publicKeyJwk.x, publicKey, or publicKeySpkiB64)');
242
+ }
243
+ function keyFromEmbedded(embedded) {
244
+ if (embedded.jwk && typeof embedded.jwk.x === 'string')
245
+ return keyFromJwkX(embedded.jwk.x);
246
+ if (embedded.raw)
247
+ return keyFromJwkX(rawToBase64Url(embedded.raw));
248
+ if (embedded.spki)
249
+ return keyFromSpkiBase64(embedded.spki);
250
+ throw new Error('Embedded key has no usable public key material');
251
+ }
252
+ /**
253
+ * Verify a CER bundle with no NexArt dependency. Returns a structured result;
254
+ * never throws for an ordinary verification failure (only for programmer error
255
+ * such as a non-object bundle).
256
+ */
257
+ export function verifyBundleStandalone(bundleInput, options = {}) {
258
+ const reasons = [];
259
+ const steps = [];
260
+ const step = (s) => { if (options.verbose)
261
+ steps.push(s); };
262
+ if (typeof bundleInput !== 'object' || bundleInput === null) {
263
+ return {
264
+ status: 'failed',
265
+ integrity: 'fail',
266
+ signature: 'skipped',
267
+ protocolVersion: 'unknown',
268
+ expectedCertificateHash: null,
269
+ actualCertificateHash: null,
270
+ reasons: ['Bundle is not a JSON object'],
271
+ steps,
272
+ };
273
+ }
274
+ const bundle = bundleInput;
275
+ const expectedHash = typeof bundle.certificateHash === 'string' ? bundle.certificateHash : null;
276
+ // ── Structural checks ──
277
+ if (bundle.bundleType !== 'cer.ai.execution.v1') {
278
+ reasons.push(`Expected bundleType "cer.ai.execution.v1", got ${JSON.stringify(bundle.bundleType)}`);
279
+ }
280
+ if (!bundle.snapshot || typeof bundle.snapshot !== 'object') {
281
+ reasons.push('snapshot is required');
282
+ }
283
+ if (!expectedHash || !expectedHash.startsWith('sha256:')) {
284
+ reasons.push(`certificateHash must start with "sha256:", got ${JSON.stringify(bundle.certificateHash)}`);
285
+ }
286
+ // ── 1. Integrity ──
287
+ let integrity = 'fail';
288
+ let actualHash = null;
289
+ let protocolVersion = 'unknown';
290
+ if (bundle.snapshot && typeof bundle.snapshot === 'object') {
291
+ try {
292
+ const recomputed = recomputeCertificateHash(bundle);
293
+ actualHash = recomputed.hash;
294
+ protocolVersion = recomputed.protocolVersion;
295
+ step(`Canonicalisation mode: ${canonicalModeForProtocol(protocolVersion)} (protocolVersion ${protocolVersion})`);
296
+ step(`Canonical payload bytes: ${recomputed.canonical.length}`);
297
+ step(`Recomputed certificateHash: ${actualHash}`);
298
+ step(`Bundle certificateHash: ${expectedHash ?? '(none)'}`);
299
+ if (expectedHash && actualHash === expectedHash) {
300
+ integrity = 'pass';
301
+ }
302
+ else {
303
+ reasons.push(`certificateHash mismatch: recomputed ${actualHash}, bundle has ${expectedHash ?? '(none)'}`);
304
+ }
305
+ }
306
+ catch (err) {
307
+ reasons.push(`Cannot recompute certificateHash: ${err instanceof Error ? err.message : String(err)}`);
308
+ }
309
+ }
310
+ // ── 2. Signature ──
311
+ let signature = 'skipped';
312
+ const extracted = extractReceipt(bundle);
313
+ if (!extracted) {
314
+ step('No signed node attestation receipt present → signature: skipped');
315
+ }
316
+ else {
317
+ step('Signed node attestation receipt found');
318
+ const receiptCertHash = extracted.receipt.certificateHash;
319
+ if (typeof receiptCertHash === 'string' && expectedHash && receiptCertHash !== expectedHash) {
320
+ signature = 'fail';
321
+ reasons.push(`Receipt certificateHash (${receiptCertHash}) does not match bundle certificateHash (${expectedHash})`);
322
+ }
323
+ else {
324
+ let key = null;
325
+ try {
326
+ if (options.publicKeyMaterial) {
327
+ key = resolvePublicKey(options.publicKeyMaterial, options.kid ?? extracted.attestorKeyId);
328
+ step('Public key resolved from supplied material');
329
+ }
330
+ else if (extracted.embeddedKey) {
331
+ key = keyFromEmbedded(extracted.embeddedKey);
332
+ step('Public key resolved from key material embedded in the bundle');
333
+ }
334
+ }
335
+ catch (err) {
336
+ signature = 'fail';
337
+ reasons.push(`Cannot load public key: ${err instanceof Error ? err.message : String(err)}`);
338
+ }
339
+ if (!key && signature !== 'fail') {
340
+ signature = 'skipped';
341
+ reasons.push('Signature present but no public key supplied (pass --public-key <path> to verify it)');
342
+ step('No public key available → signature: skipped');
343
+ }
344
+ else if (key) {
345
+ try {
346
+ // Receipt signature mode is bound to the receipt's OWN protocolVersion.
347
+ // Fail-closed (parity with the SDK): a missing/unsupported version is an
348
+ // invalid signature, never silently coerced to a default.
349
+ const rpv = extracted.receipt.protocolVersion;
350
+ if (typeof rpv !== 'string') {
351
+ throw new Error('Receipt protocolVersion is missing or not a string (fail-closed)');
352
+ }
353
+ const message = Buffer.from(canonicalForProtocol(extracted.receipt, rpv), 'utf8');
354
+ const sigBytes = base64urlToBuffer(extracted.signature);
355
+ step(`Signed message (canonical receipt) bytes: ${message.length}`);
356
+ step(`Signature bytes: ${sigBytes.length}`);
357
+ if (sigBytes.length !== 64) {
358
+ signature = 'fail';
359
+ reasons.push(`Ed25519 signature must be 64 bytes, got ${sigBytes.length}`);
360
+ }
361
+ else {
362
+ const ok = edVerify(null, message, key, sigBytes);
363
+ signature = ok ? 'pass' : 'fail';
364
+ if (!ok)
365
+ reasons.push('Ed25519 signature verification failed');
366
+ }
367
+ }
368
+ catch (err) {
369
+ signature = 'fail';
370
+ reasons.push(`Signature verification error: ${err instanceof Error ? err.message : String(err)}`);
371
+ }
372
+ }
373
+ }
374
+ }
375
+ const status = integrity === 'pass' && signature !== 'fail' ? 'verified' : 'failed';
376
+ return {
377
+ status,
378
+ integrity,
379
+ signature,
380
+ protocolVersion,
381
+ expectedCertificateHash: expectedHash,
382
+ actualCertificateHash: actualHash,
383
+ reasons,
384
+ steps,
385
+ };
386
+ }
387
+ //# sourceMappingURL=standaloneVerify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standaloneVerify.js","sourceRoot":"","sources":["../src/standaloneVerify.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,sDAAsD;AACtD,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,+EAA+E;AAC/E,iFAAiF;AACjF,yDAAyD;AACzD,E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OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;wBAClD,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;wBACjC,IAAI,CAAC,EAAE;4BAAE,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,SAAS,GAAG,MAAM,CAAC;oBACnB,OAAO,CAAC,IAAI,CAAC,iCAAiC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACpG,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GACV,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEvE,OAAO;QACL,MAAM;QACN,SAAS;QACT,SAAS;QACT,eAAe;QACf,uBAAuB,EAAE,YAAY;QACrC,qBAAqB,EAAE,UAAU;QACjC,OAAO;QACP,KAAK;KACN,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexart/cli",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "NexArt CLI — Code Mode and AI execution certification",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "author": "NexArt",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@nexart/ai-execution": "^0.22.0",
32
+ "@nexart/ai-execution": "^0.23.0",
33
33
  "@nexart/codemode-sdk": "^1.12.0",
34
34
  "yargs": "^17.7.2"
35
35
  },
@@ -46,10 +46,8 @@
46
46
  "node": ">=18.0.0"
47
47
  },
48
48
  "files": [
49
- "dist/index.js",
50
- "dist/index.js.map",
51
- "dist/index.d.ts",
52
- "dist/index.d.ts.map",
49
+ "dist",
50
+ "!dist/__tests__",
53
51
  "README.md",
54
52
  "CHANGELOG.md"
55
53
  ]