@agenticstechnologies/verify 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.
- package/README.md +3 -4
- package/bin/verify.mjs +32 -4
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -6,13 +6,12 @@ Agentics, and it does not trust the `verification` summary inside the file.
|
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
> **Not yet published.** `@agenticstechnologies/verify` is not on npm, so this install fails with E404. Run it from a checkout of this repo, as shown below.
|
|
10
|
-
|
|
11
9
|
```bash
|
|
12
|
-
npm install @agenticstechnologies/verify
|
|
10
|
+
npm install -g @agenticstechnologies/verify
|
|
11
|
+
agentics-verify bundle.json
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
The package binary is `agentics-verify`.
|
|
14
|
+
The package binary is `agentics-verify`. Pass `-` to read JSON from stdin, and `--help` to print usage.
|
|
16
15
|
|
|
17
16
|
## Version bump policy
|
|
18
17
|
|
package/bin/verify.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Offline check of an Agentics evidence export.
|
|
3
3
|
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// agentics-verify bundle.json
|
|
5
|
+
// agentics-verify - # JSON on stdin
|
|
6
6
|
//
|
|
7
7
|
// Exit 0 when the leaf and prev_hash checks pass, any included Merkle proof
|
|
8
8
|
// folds, and a devnet/testnet memo (if present) matches or the RPC is skipped.
|
|
9
9
|
// Exit 1 when a check fails. Exit 2 when no path is given.
|
|
10
10
|
|
|
11
|
+
import fs from "node:fs";
|
|
11
12
|
import { verifyBundle } from "../src/bundle.mjs";
|
|
12
13
|
import { isRecordBundle, verifyRecord } from "../src/record.mjs";
|
|
13
14
|
|
|
@@ -15,7 +16,35 @@ function statusLine(label, part) {
|
|
|
15
16
|
return `${label} ${part.status}${part.reason ? " " + part.reason : ""}`;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
const USAGE = "usage: agentics-verify <bundle.json | -> [--jwks jwks.json]";
|
|
20
|
+
|
|
21
|
+
function packageVersion() {
|
|
22
|
+
return JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function printHelp() {
|
|
26
|
+
console.log([
|
|
27
|
+
"agentics-verify — check an Agentics evidence export offline",
|
|
28
|
+
"",
|
|
29
|
+
USAGE,
|
|
30
|
+
"",
|
|
31
|
+
" agentics-verify bundle.json",
|
|
32
|
+
" agentics-verify - --jwks jwks.json",
|
|
33
|
+
"",
|
|
34
|
+
"Exit 0 when the checks pass. Exit 1 when a check fails. Exit 2 when no file is given.",
|
|
35
|
+
].join("\n"));
|
|
36
|
+
}
|
|
37
|
+
|
|
18
38
|
const args = process.argv.slice(2);
|
|
39
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
40
|
+
printHelp();
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
44
|
+
console.log("agentics-verify " + packageVersion());
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
19
48
|
let jwksPath = null;
|
|
20
49
|
const positional = [];
|
|
21
50
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -28,11 +57,10 @@ for (let i = 0; i < args.length; i++) {
|
|
|
28
57
|
}
|
|
29
58
|
const arg = positional[0];
|
|
30
59
|
if (!arg) {
|
|
31
|
-
console.error(
|
|
60
|
+
console.error(USAGE);
|
|
32
61
|
process.exit(2);
|
|
33
62
|
}
|
|
34
63
|
|
|
35
|
-
const fs = await import("node:fs");
|
|
36
64
|
let text;
|
|
37
65
|
try {
|
|
38
66
|
text = arg === "-" ? fs.readFileSync(0, "utf8") : fs.readFileSync(arg, "utf8");
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticstechnologies/verify",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Offline verifier for Agentics evidence export bundles. Recomputes receipt leaves and the prev_hash chain, and folds a Merkle proof when the export includes one.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Agentics Technologies LLC",
|
|
7
|
-
"homepage": "https://agentics.you",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"directory": "packages/agentics-verify"
|
|
7
|
+
"homepage": "https://agentics.you/docs/",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://agentics.you/contact/",
|
|
10
|
+
"email": "support@agentics.you"
|
|
12
11
|
},
|
|
13
12
|
"type": "module",
|
|
14
13
|
"bin": {
|