@motebit/verifier 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +30 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +190 -2
- package/dist/lib.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* `play_integrity` / `webauthn` claims. Permissive-floor consumers can
|
|
32
32
|
* supply their own; `@motebit/verify` wires the canonical bundle.
|
|
33
33
|
*/
|
|
34
|
-
export { verifyFile, verifyArtifact, formatHuman } from "./lib.js";
|
|
34
|
+
export { verifyFile, verifyArtifact, verifySkillDirectory, formatHuman } from "./lib.js";
|
|
35
35
|
export type { VerifyFileOptions } from "./lib.js";
|
|
36
|
-
export type { VerifyResult, ArtifactType } from "@motebit/crypto";
|
|
36
|
+
export type { VerifyResult, ArtifactType, SkillVerifyResult, SkillFileVerifyResult, } from "@motebit/crypto";
|
|
37
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzF,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
* `play_integrity` / `webauthn` claims. Permissive-floor consumers can
|
|
32
32
|
* supply their own; `@motebit/verify` wires the canonical bundle.
|
|
33
33
|
*/
|
|
34
|
-
export { verifyFile, verifyArtifact, formatHuman } from "./lib.js";
|
|
34
|
+
export { verifyFile, verifyArtifact, verifySkillDirectory, formatHuman } from "./lib.js";
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
* - `receipt` — signed `ExecutionReceipt` JSON
|
|
9
9
|
* - `credential` — W3C-style `VerifiableCredential` JSON
|
|
10
10
|
* - `presentation`— `VerifiablePresentation` JSON
|
|
11
|
+
* - `skill` — directory containing `SKILL.md` + `skill-envelope.json`
|
|
12
|
+
* plus any auxiliary `files[]` declared in the envelope
|
|
11
13
|
*
|
|
12
14
|
* Error handling: file I/O errors throw (caller decides how to surface).
|
|
13
15
|
* Parse / signature errors are returned as `valid: false` results so the
|
|
14
16
|
* caller can render a structured reason instead of catching exceptions.
|
|
15
17
|
*/
|
|
16
|
-
import { type ArtifactType, type HardwareAttestationVerifiers, type VerifyResult } from "@motebit/crypto";
|
|
18
|
+
import { type ArtifactType, type HardwareAttestationVerifiers, type SkillVerifyResult, type VerifyResult } from "@motebit/crypto";
|
|
17
19
|
export interface VerifyFileOptions {
|
|
18
20
|
/**
|
|
19
21
|
* Pin the expected artifact type. When set, detection must match or
|
|
@@ -45,8 +47,35 @@ export interface VerifyFileOptions {
|
|
|
45
47
|
/**
|
|
46
48
|
* Verify an artifact read from disk. Auto-detects type via content
|
|
47
49
|
* inspection in `@motebit/crypto`.
|
|
50
|
+
*
|
|
51
|
+
* Path-shape dispatch:
|
|
52
|
+
* - Directory → routed to `verifySkillDirectory` (a skill ships as
|
|
53
|
+
* `<dir>/SKILL.md` + `<dir>/skill-envelope.json` plus any auxiliary
|
|
54
|
+
* files declared in `envelope.files[]`). The full envelope-sig +
|
|
55
|
+
* body-hash + per-file-hash cross-check runs on disk.
|
|
56
|
+
* - File → read as bytes and routed through `verifyArtifact`, which
|
|
57
|
+
* calls `@motebit/crypto`'s detector.
|
|
48
58
|
*/
|
|
49
59
|
export declare function verifyFile(path: string, opts?: VerifyFileOptions): Promise<VerifyResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Verify a skill directory end-to-end: envelope signature + body hash
|
|
62
|
+
* + every declared file hash. Reads `<dir>/skill-envelope.json` and
|
|
63
|
+
* `<dir>/SKILL.md`, plus each file in `envelope.files[]` from the
|
|
64
|
+
* directory tree, then composes the unified `SkillVerifyResult`.
|
|
65
|
+
*
|
|
66
|
+
* Faithful to `services/relay/CLAUDE.md` rule 6 ("relay is a
|
|
67
|
+
* convenience layer, not a trust root") at the ecosystem layer: an
|
|
68
|
+
* agentskills.io user with a skill they downloaded from anywhere can
|
|
69
|
+
* run `motebit-verify <path-to-skill-dir>` and answer "is this signed
|
|
70
|
+
* AND do the bytes match the signature?" without trusting any motebit
|
|
71
|
+
* service.
|
|
72
|
+
*
|
|
73
|
+
* I/O failures (missing envelope, missing SKILL.md, unreadable
|
|
74
|
+
* directory) return `valid: false` with named errors rather than
|
|
75
|
+
* throwing, so the CLI's structured-output path can surface them
|
|
76
|
+
* uniformly with signature/hash failures.
|
|
77
|
+
*/
|
|
78
|
+
export declare function verifySkillDirectory(dir: string, opts?: VerifyFileOptions): Promise<SkillVerifyResult>;
|
|
50
79
|
/**
|
|
51
80
|
* Verify an already-loaded artifact. Accepts a JSON string, an
|
|
52
81
|
* already-parsed object, or a `motebit.md` identity string.
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,4BAA4B,CAAC;CAC7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAS9F;AA2BD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,iBAAiB,GACvB,OAAO,CAAC,iBAAiB,CAAC,CAoE5B;AA8CD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,IAAI,CAAC,EAAE,iBAAiB,GACvB,OAAO,CAAC,YAAY,CAAC,CAgBvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAqBxD"}
|
package/dist/lib.js
CHANGED
|
@@ -8,21 +8,186 @@
|
|
|
8
8
|
* - `receipt` — signed `ExecutionReceipt` JSON
|
|
9
9
|
* - `credential` — W3C-style `VerifiableCredential` JSON
|
|
10
10
|
* - `presentation`— `VerifiablePresentation` JSON
|
|
11
|
+
* - `skill` — directory containing `SKILL.md` + `skill-envelope.json`
|
|
12
|
+
* plus any auxiliary `files[]` declared in the envelope
|
|
11
13
|
*
|
|
12
14
|
* Error handling: file I/O errors throw (caller decides how to surface).
|
|
13
15
|
* Parse / signature errors are returned as `valid: false` results so the
|
|
14
16
|
* caller can render a structured reason instead of catching exceptions.
|
|
15
17
|
*/
|
|
16
|
-
import { readFile } from "node:fs/promises";
|
|
17
|
-
import {
|
|
18
|
+
import { readFile, stat } from "node:fs/promises";
|
|
19
|
+
import { join, basename } from "node:path";
|
|
20
|
+
import { verify, verifySkillBundle, } from "@motebit/crypto";
|
|
18
21
|
/**
|
|
19
22
|
* Verify an artifact read from disk. Auto-detects type via content
|
|
20
23
|
* inspection in `@motebit/crypto`.
|
|
24
|
+
*
|
|
25
|
+
* Path-shape dispatch:
|
|
26
|
+
* - Directory → routed to `verifySkillDirectory` (a skill ships as
|
|
27
|
+
* `<dir>/SKILL.md` + `<dir>/skill-envelope.json` plus any auxiliary
|
|
28
|
+
* files declared in `envelope.files[]`). The full envelope-sig +
|
|
29
|
+
* body-hash + per-file-hash cross-check runs on disk.
|
|
30
|
+
* - File → read as bytes and routed through `verifyArtifact`, which
|
|
31
|
+
* calls `@motebit/crypto`'s detector.
|
|
21
32
|
*/
|
|
22
33
|
export async function verifyFile(path, opts) {
|
|
34
|
+
// I/O failures bubble up per the existing contract — the caller
|
|
35
|
+
// (CLI, library consumer) decides whether to surface or transform.
|
|
36
|
+
const stats = await stat(path);
|
|
37
|
+
if (stats.isDirectory()) {
|
|
38
|
+
return verifySkillDirectory(path, opts);
|
|
39
|
+
}
|
|
23
40
|
const content = await readFile(path, "utf-8");
|
|
24
41
|
return verifyArtifact(content, opts);
|
|
25
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Body-bytes extraction from a SKILL.md file. Splits on the YAML
|
|
45
|
+
* frontmatter delimiters and returns the LF-normalized body bytes — the
|
|
46
|
+
* exact input that `signSkillEnvelope` hashed at sign time, per
|
|
47
|
+
* `spec/skills-v1.md` §5.1.
|
|
48
|
+
*
|
|
49
|
+
* Light-weight by design: no YAML parse, no schema validation. The
|
|
50
|
+
* verifier needs body bytes for hashing, not a structured manifest. A
|
|
51
|
+
* malformed frontmatter (no closing `---`) returns `null` so the caller
|
|
52
|
+
* surfaces it as `body_hash` step `actual: null` rather than throwing.
|
|
53
|
+
*/
|
|
54
|
+
function extractSkillBody(rawText) {
|
|
55
|
+
// Strip the UTF-8 BOM (U+FEFF) if present, then normalize line
|
|
56
|
+
// endings. Regex unicode-escape keeps the source ASCII-only.
|
|
57
|
+
const text = rawText
|
|
58
|
+
.replace(/^\uFEFF/, "")
|
|
59
|
+
.replace(/\r\n/g, "\n")
|
|
60
|
+
.replace(/\r/g, "\n");
|
|
61
|
+
if (!text.startsWith("---\n"))
|
|
62
|
+
return null;
|
|
63
|
+
const closing = text.indexOf("\n---\n", 4);
|
|
64
|
+
if (closing === -1)
|
|
65
|
+
return null;
|
|
66
|
+
const bodyStart = closing + "\n---\n".length;
|
|
67
|
+
return new TextEncoder().encode(text.slice(bodyStart));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Verify a skill directory end-to-end: envelope signature + body hash
|
|
71
|
+
* + every declared file hash. Reads `<dir>/skill-envelope.json` and
|
|
72
|
+
* `<dir>/SKILL.md`, plus each file in `envelope.files[]` from the
|
|
73
|
+
* directory tree, then composes the unified `SkillVerifyResult`.
|
|
74
|
+
*
|
|
75
|
+
* Faithful to `services/relay/CLAUDE.md` rule 6 ("relay is a
|
|
76
|
+
* convenience layer, not a trust root") at the ecosystem layer: an
|
|
77
|
+
* agentskills.io user with a skill they downloaded from anywhere can
|
|
78
|
+
* run `motebit-verify <path-to-skill-dir>` and answer "is this signed
|
|
79
|
+
* AND do the bytes match the signature?" without trusting any motebit
|
|
80
|
+
* service.
|
|
81
|
+
*
|
|
82
|
+
* I/O failures (missing envelope, missing SKILL.md, unreadable
|
|
83
|
+
* directory) return `valid: false` with named errors rather than
|
|
84
|
+
* throwing, so the CLI's structured-output path can surface them
|
|
85
|
+
* uniformly with signature/hash failures.
|
|
86
|
+
*/
|
|
87
|
+
export async function verifySkillDirectory(dir, opts) {
|
|
88
|
+
const envelopePath = join(dir, "skill-envelope.json");
|
|
89
|
+
const skillMdPath = join(dir, "SKILL.md");
|
|
90
|
+
// Step 0 — read the envelope. Failures collapse to a structured
|
|
91
|
+
// valid-false rather than throwing so the CLI's --json output stays
|
|
92
|
+
// uniform across signature-fails and disk-fails.
|
|
93
|
+
let envelopeJson;
|
|
94
|
+
try {
|
|
95
|
+
envelopeJson = await readFile(envelopePath, "utf-8");
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
99
|
+
return invalidSkillResult(`failed to read ${basename(envelopePath)}: ${msg}`);
|
|
100
|
+
}
|
|
101
|
+
let envelope;
|
|
102
|
+
try {
|
|
103
|
+
envelope = JSON.parse(envelopeJson);
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
107
|
+
return invalidSkillResult(`failed to parse ${basename(envelopePath)}: ${msg}`);
|
|
108
|
+
}
|
|
109
|
+
if (opts?.expectedType !== undefined && opts.expectedType !== "skill") {
|
|
110
|
+
return invalidSkillResult(`Expected type "${opts.expectedType}" but found a skill directory`, envelope);
|
|
111
|
+
}
|
|
112
|
+
// Step 1 — read SKILL.md, extract LF-normalized body bytes. Same I/O
|
|
113
|
+
// separation as before; the actual verification (sig + body + files)
|
|
114
|
+
// delegates to `verifySkillBundle` in @motebit/crypto so browser
|
|
115
|
+
// consumers and this directory walker run the same code.
|
|
116
|
+
let skillMd;
|
|
117
|
+
try {
|
|
118
|
+
skillMd = await readFile(skillMdPath, "utf-8");
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
122
|
+
return ioFailureSkillResult(envelope, [
|
|
123
|
+
{ message: `failed to read ${basename(skillMdPath)}: ${msg}`, path: "body_hash" },
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
const bodyBytes = extractSkillBody(skillMd);
|
|
127
|
+
if (bodyBytes === null) {
|
|
128
|
+
return ioFailureSkillResult(envelope, [
|
|
129
|
+
{
|
|
130
|
+
message: `${basename(skillMdPath)} is not a valid SKILL.md (missing frontmatter delimiters)`,
|
|
131
|
+
path: "body_hash",
|
|
132
|
+
},
|
|
133
|
+
]);
|
|
134
|
+
}
|
|
135
|
+
// Step 2 — read every file declared in envelope.files[]. Missing
|
|
136
|
+
// bytes are passed through as `undefined` so verifySkillBundle can
|
|
137
|
+
// surface `reason: "missing"` per-entry uniformly with the bundle
|
|
138
|
+
// path.
|
|
139
|
+
const fileBytes = {};
|
|
140
|
+
for (const entry of envelope.files) {
|
|
141
|
+
const filePath = join(dir, entry.path);
|
|
142
|
+
try {
|
|
143
|
+
const buf = await readFile(filePath);
|
|
144
|
+
fileBytes[entry.path] = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// Leave undefined — verifySkillBundle reports "missing".
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return verifySkillBundle({ envelope, body: bodyBytes, files: fileBytes });
|
|
151
|
+
}
|
|
152
|
+
function invalidSkillResult(message, envelope) {
|
|
153
|
+
return {
|
|
154
|
+
type: "skill",
|
|
155
|
+
valid: false,
|
|
156
|
+
envelope: envelope ?? null,
|
|
157
|
+
...(envelope ? { skill: `${envelope.skill.name}@${envelope.skill.version}` } : {}),
|
|
158
|
+
...(envelope ? { signer: envelope.signature.public_key } : {}),
|
|
159
|
+
steps: {
|
|
160
|
+
envelope: { valid: false, reason: "wrong_suite" },
|
|
161
|
+
body_hash: null,
|
|
162
|
+
files: [],
|
|
163
|
+
},
|
|
164
|
+
errors: [{ message }],
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Surface a SKILL.md-read failure (or malformed-frontmatter) with the
|
|
169
|
+
* envelope already loaded. We DON'T re-run sig verification here
|
|
170
|
+
* because verifySkillBundle is the single source of truth for that —
|
|
171
|
+
* a SKILL.md failure means we couldn't even feed bytes to the bundle
|
|
172
|
+
* primitive, so we report the structural issue directly. This keeps
|
|
173
|
+
* the directory walker's role purely "I/O shim" while
|
|
174
|
+
* verifySkillBundle owns all verification semantics.
|
|
175
|
+
*/
|
|
176
|
+
function ioFailureSkillResult(envelope, extraErrors) {
|
|
177
|
+
return {
|
|
178
|
+
type: "skill",
|
|
179
|
+
valid: false,
|
|
180
|
+
envelope,
|
|
181
|
+
skill: `${envelope.skill.name}@${envelope.skill.version}`,
|
|
182
|
+
signer: envelope.signature.public_key,
|
|
183
|
+
steps: {
|
|
184
|
+
envelope: { valid: true, reason: "ok" },
|
|
185
|
+
body_hash: null,
|
|
186
|
+
files: [],
|
|
187
|
+
},
|
|
188
|
+
errors: [...extraErrors],
|
|
189
|
+
};
|
|
190
|
+
}
|
|
26
191
|
/**
|
|
27
192
|
* Verify an already-loaded artifact. Accepts a JSON string, an
|
|
28
193
|
* already-parsed object, or a `motebit.md` identity string.
|
|
@@ -141,6 +306,29 @@ function summarizeValid(result) {
|
|
|
141
306
|
}
|
|
142
307
|
return out;
|
|
143
308
|
}
|
|
309
|
+
case "skill": {
|
|
310
|
+
if (!result.envelope)
|
|
311
|
+
return [];
|
|
312
|
+
const out = [];
|
|
313
|
+
if (result.skill)
|
|
314
|
+
out.push(["skill:", result.skill]);
|
|
315
|
+
if (result.signer)
|
|
316
|
+
out.push(["signer:", result.signer]);
|
|
317
|
+
const env = result.steps.envelope.valid ? "✓" : "✗";
|
|
318
|
+
out.push(["envelope:", `${env} ${result.steps.envelope.reason}`]);
|
|
319
|
+
if (result.steps.body_hash !== null) {
|
|
320
|
+
const body = result.steps.body_hash.valid ? "✓" : "✗";
|
|
321
|
+
out.push([
|
|
322
|
+
"body:",
|
|
323
|
+
`${body} sha256 ${result.steps.body_hash.valid ? "matches" : "differs"}`,
|
|
324
|
+
]);
|
|
325
|
+
}
|
|
326
|
+
if (result.steps.files.length > 0) {
|
|
327
|
+
const passed = result.steps.files.filter((f) => f.valid).length;
|
|
328
|
+
out.push(["files:", `${passed}/${result.steps.files.length} verified`]);
|
|
329
|
+
}
|
|
330
|
+
return out;
|
|
331
|
+
}
|
|
144
332
|
}
|
|
145
333
|
}
|
|
146
334
|
//# sourceMappingURL=lib.js.map
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,MAAM,EACN,iBAAiB,GAMlB,MAAM,iBAAiB,CAAC;AAgCzB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,IAAwB;IACrE,gE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C,IAAI,CAAC;oBACP,OAAO;oBACP,GAAG,IAAI,WAAW,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE;iBACzE,CAAC,CAAC;YACL,CAAC;YACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAClC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;gBAChE,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC;YAC1E,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motebit/verifier",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Apache-2.0 library for verifying signed Motebit artifacts (identity files, execution receipts, credentials, presentations) — file-reading and human-formatting helpers on top of @motebit/crypto. The canonical `motebit-verify` CLI now lives at @motebit/verify; this package is the Apache-2.0 library it sits on.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@motebit/crypto": "1.
|
|
56
|
+
"@motebit/crypto": "1.2.0",
|
|
57
|
+
"@motebit/protocol": "1.2.0"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@noble/ed25519": "~3.0.1",
|