@motebit/verifier 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +18 -40
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,25 +1,31 @@
1
1
  # @motebit/verifier
2
2
 
3
- Offline third-party verifier for every signed Motebit artifact.
3
+ Apache-2.0 library for verifying signed Motebit artifacts. The thin file-reading + human-formatting layer on top of [`@motebit/crypto`](https://www.npmjs.com/package/@motebit/crypto)'s pure verification primitives.
4
4
 
5
5
  ```bash
6
- npm i -g @motebit/verifier
7
- motebit-verify motebit.md
6
+ npm i @motebit/verifier
8
7
  ```
9
8
 
10
- Outputs
9
+ ```ts
10
+ import { verifyFile } from "@motebit/verifier";
11
11
 
12
- ```
13
- VALID (identity)
14
- did: did:motebit:01234567-...
15
- name: my-agent
12
+ const result = await verifyFile("./receipt.json");
13
+ if (result.valid && result.type === "receipt") {
14
+ console.log(`receipt signed by ${result.signer}`);
15
+ }
16
16
  ```
17
17
 
18
18
  Zero relay contact. Zero network. The signer's public key is embedded in the artifact or derivable from it; verification is pure crypto against committed wire formats.
19
19
 
20
+ ## Looking for the `motebit-verify` command-line tool?
21
+
22
+ Install [`@motebit/verify`](https://www.npmjs.com/package/@motebit/verify) instead. That package ships the `motebit-verify` binary with every hardware-attestation platform bundled. This package (`@motebit/verifier`) is the library it sits on — reach for it when you're writing TypeScript code that consumes signed artifacts programmatically.
23
+
24
+ The naming follows the verb / agent-noun lineage that survives for decades — `git` / `libgit2`, `cargo` / `tokio`, `npm` / `@npm/arborist`. Verb (`verify`) = the tool a human installs. Agent-noun with `-er` suffix (`verifier`) = the library code links against.
25
+
20
26
  ## Why this exists
21
27
 
22
- Motebit's moat is the **self-signing body**: every action the agent takes emits a signed receipt that any third party can verify without running the motebit. This package is the smallest public surface of that promise — a CLI and a library that together answer _"is this signed artifact authentic, and what does it claim?"_
28
+ Motebit's moat is the **self-signing body**: every action the agent takes emits a signed receipt that any third party can verify without running the motebit. This package is the smallest public surface of that promise — a deterministic verification library that answers _"is this signed artifact authentic, and what does it claim?"_ — exposed for programmatic consumption.
23
29
 
24
30
  ## What it verifies
25
31
 
@@ -30,45 +36,17 @@ The unified `verify()` dispatcher in [`@motebit/crypto`](https://www.npmjs.com/p
30
36
  - **credential** — W3C-style Verifiable Credentials
31
37
  - **presentation** — W3C-style Verifiable Presentations
32
38
 
33
- ## Usage
34
-
35
- ```
36
- motebit-verify <file> [options]
37
-
38
- --json Print structured JSON instead of human.
39
- --expect <type> Pin expected type: identity | receipt | credential | presentation.
40
- --clock-skew <seconds> Allowance for credential/presentation time bounds.
41
- -h, --help
42
- -V, --version
43
- ```
44
-
45
- ### Exit codes
46
-
47
- | Code | Meaning |
48
- | ---- | --------------------------------------------------- |
49
- | `0` | Artifact verified |
50
- | `1` | Artifact invalid (bad signature, expired, mismatch) |
51
- | `2` | Usage or I/O error |
52
-
53
- POSIX-friendly — chain into CI gates, `make` targets, `git` hooks.
54
-
55
- ### Library
56
-
57
- ```ts
58
- import { verifyFile } from "@motebit/verifier";
59
-
60
- const result = await verifyFile("./receipt.json");
61
- if (result.valid) console.log(`receipt signed by ${result.receipt?.signer}`);
62
- ```
39
+ This package wraps the dispatcher with `verifyFile` (path → result), `verifyArtifact` (string → result), and `formatHuman` (result → printable banner).
63
40
 
64
41
  ## Guarantees
65
42
 
66
43
  - **No network.** Verification runs entirely offline. No relay calls, no DID resolution over the wire.
67
44
  - **No dependencies beyond `@motebit/crypto`.** Every dependency is a trust attack surface we'd have to re-audit on every upgrade.
68
- - **Suite-agile.** New signature suites (post-quantum, future) are registry additions, not CLI changes — `@motebit/crypto`'s `verifyBySuite` dispatches for us.
45
+ - **Suite-agile.** New signature suites (post-quantum, future) are registry additions, not library changes — `@motebit/crypto`'s `verifyBySuite` dispatches for us.
69
46
 
70
47
  ## Related
71
48
 
49
+ - [`@motebit/verify`](https://www.npmjs.com/package/@motebit/verify) — the **`motebit-verify` CLI** that ships with every hardware-attestation platform bundled. Install this if you want the command-line tool.
72
50
  - [`@motebit/crypto`](https://www.npmjs.com/package/@motebit/crypto) — the verification primitives this package wraps (Apache-2.0, zero deps)
73
51
  - [`@motebit/protocol`](https://www.npmjs.com/package/@motebit/protocol) — protocol types for the artifacts being verified (Apache-2.0, zero deps)
74
52
  - [`@motebit/sdk`](https://www.npmjs.com/package/@motebit/sdk) — developer contract for building Motebit-powered agents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motebit/verifier",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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,7 @@
53
53
  ]
54
54
  },
55
55
  "dependencies": {
56
- "@motebit/crypto": "1.0.0"
56
+ "@motebit/crypto": "1.1.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@noble/ed25519": "~3.0.1",