@agent-blueprint-protocol/verifier 0.7.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/CHANGELOG.md +891 -0
- package/LICENSE +190 -0
- package/NOTICE +4 -0
- package/README.md +199 -0
- package/dist/corpus/cases/base64url-decode.json +1 -0
- package/dist/corpus/cases/blueprint-decode.json +1 -0
- package/dist/corpus/cases/bounds-new.json +1 -0
- package/dist/corpus/cases/bounds_algebra-intersect.json +1 -0
- package/dist/corpus/cases/canonicalization-encode.json +1 -0
- package/dist/corpus/cases/compatibility-verify.json +1 -0
- package/dist/corpus/cases/deployment-decode.json +1 -0
- package/dist/corpus/cases/digest-tagged.json +1 -0
- package/dist/corpus/cases/extension-resolve.json +1 -0
- package/dist/corpus/cases/federation-decode.json +1 -0
- package/dist/corpus/cases/federation-verify_commitment.json +1 -0
- package/dist/corpus/cases/json-decode.json +1 -0
- package/dist/corpus/cases/negotiation-negotiate.json +1 -0
- package/dist/corpus/cases/portability-scan.json +1 -0
- package/dist/corpus/cases/schema-validate_instance.json +1 -0
- package/dist/corpus/cases/signature-verify.json +1 -0
- package/dist/corpus/index.json +1 -0
- package/dist/corpus/schemas/estate-contract.schema.json +1 -0
- package/dist/corpus/schemas/object.schema.json +1 -0
- package/dist/corpus/vectors/blueprint-golden.json +1 -0
- package/dist/corpus/vectors/deployment-golden.json +1 -0
- package/dist/corpus/vectors/rfc8785-numbers.json +1 -0
- package/dist/kit/cli.mjs +24 -0
- package/dist/verifier/b64url.d.ts +16 -0
- package/dist/verifier/b64url.js +36 -0
- package/dist/verifier/blueprint.d.ts +56 -0
- package/dist/verifier/blueprint.js +795 -0
- package/dist/verifier/bounds.d.ts +19 -0
- package/dist/verifier/bounds.js +45 -0
- package/dist/verifier/bounds_algebra.d.ts +27 -0
- package/dist/verifier/bounds_algebra.js +282 -0
- package/dist/verifier/canonical.d.ts +17 -0
- package/dist/verifier/canonical.js +160 -0
- package/dist/verifier/cli.d.ts +1 -0
- package/dist/verifier/cli.js +149 -0
- package/dist/verifier/compatibility.d.ts +22 -0
- package/dist/verifier/compatibility.js +112 -0
- package/dist/verifier/corpus.d.ts +42 -0
- package/dist/verifier/corpus.js +672 -0
- package/dist/verifier/decode.d.ts +16 -0
- package/dist/verifier/decode.js +457 -0
- package/dist/verifier/deployment.d.ts +49 -0
- package/dist/verifier/deployment.js +830 -0
- package/dist/verifier/digest.d.ts +23 -0
- package/dist/verifier/digest.js +58 -0
- package/dist/verifier/extension.d.ts +11 -0
- package/dist/verifier/extension.js +75 -0
- package/dist/verifier/federation.d.ts +76 -0
- package/dist/verifier/federation.js +817 -0
- package/dist/verifier/negotiation.d.ts +29 -0
- package/dist/verifier/negotiation.js +324 -0
- package/dist/verifier/portability.d.ts +12 -0
- package/dist/verifier/portability.js +184 -0
- package/dist/verifier/predicate.d.ts +10 -0
- package/dist/verifier/predicate.js +172 -0
- package/dist/verifier/registry.d.ts +16 -0
- package/dist/verifier/registry.js +120 -0
- package/dist/verifier/registry_engine.d.ts +42 -0
- package/dist/verifier/registry_engine.js +220 -0
- package/dist/verifier/report.d.ts +13 -0
- package/dist/verifier/report.js +29 -0
- package/dist/verifier/run_corpus.d.ts +1 -0
- package/dist/verifier/run_corpus.js +81 -0
- package/dist/verifier/runner.d.ts +20 -0
- package/dist/verifier/runner.js +778 -0
- package/dist/verifier/schema.d.ts +20 -0
- package/dist/verifier/schema.js +623 -0
- package/dist/verifier/self_checks.d.ts +1 -0
- package/dist/verifier/self_checks.js +316 -0
- package/dist/verifier/signature.d.ts +23 -0
- package/dist/verifier/signature.js +226 -0
- package/dist/verifier/value.d.ts +44 -0
- package/dist/verifier/value.js +77 -0
- package/package.json +42 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// The closed tagged value algebra — the mirror of AgentBlueprintProtocol.Json's
|
|
2
|
+
// value() union. Objects are pair-arrays so member order, "__proto__" keys, and
|
|
3
|
+
// integer-like keys keep byte-level semantics (no JS object coercion anywhere).
|
|
4
|
+
//
|
|
5
|
+
// Errors are value-free strings in the runner's projected form ("duplicate_member",
|
|
6
|
+
// "ceiling:depth", …) — the same vocabulary the Elixir side projects for comparison.
|
|
7
|
+
export const ok = (v) => ({ ok: true, v });
|
|
8
|
+
export const err = (e) => ({ ok: false, e });
|
|
9
|
+
export const nil = { t: "null" };
|
|
10
|
+
export const bool = (v) => ({ t: "bool", v });
|
|
11
|
+
export const int = (v) => ({ t: "int", v });
|
|
12
|
+
export const float = (v) => ({ t: "float", v });
|
|
13
|
+
export const str = (v) => ({ t: "str", v });
|
|
14
|
+
export const arr = (v) => ({ t: "arr", v });
|
|
15
|
+
export const obj = (v) => ({ t: "obj", v });
|
|
16
|
+
// The I-JSON / RFC 8785 §3.1 magnitude bound mirrored from the decoder.
|
|
17
|
+
export const IJSON_MAX = 9_007_199_254_740_991;
|
|
18
|
+
// Deep equality over the tagged algebra. Numbers compare numerically
|
|
19
|
+
// (int 2 equals float 2.0 — Elixir's `==` semantics, which the runner's
|
|
20
|
+
// expectation comparison relies on); ±0 are equal.
|
|
21
|
+
export function sameValue(a, b) {
|
|
22
|
+
if (a.t !== b.t) {
|
|
23
|
+
if ((a.t === "int" || a.t === "float") && (b.t === "int" || b.t === "float")) {
|
|
24
|
+
return a.v === b.v;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
switch (a.t) {
|
|
29
|
+
case "null":
|
|
30
|
+
return true;
|
|
31
|
+
case "bool":
|
|
32
|
+
case "int":
|
|
33
|
+
case "float":
|
|
34
|
+
case "str":
|
|
35
|
+
return a.v === b.v;
|
|
36
|
+
case "arr":
|
|
37
|
+
return (a.v.length === b.v.length && a.v.every((x, i) => sameValue(x, b.v[i])));
|
|
38
|
+
case "obj":
|
|
39
|
+
return (a.v.length === b.v.length &&
|
|
40
|
+
a.v.every((pair, i) => {
|
|
41
|
+
const other = b.v[i];
|
|
42
|
+
return pair[0] === other[0] && sameValue(pair[1], other[1]);
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function toPlain(v) {
|
|
47
|
+
switch (v.t) {
|
|
48
|
+
case "null":
|
|
49
|
+
return null;
|
|
50
|
+
case "bool":
|
|
51
|
+
case "int":
|
|
52
|
+
case "float":
|
|
53
|
+
case "str":
|
|
54
|
+
return v.v;
|
|
55
|
+
case "arr":
|
|
56
|
+
return v.v.map(toPlain);
|
|
57
|
+
case "obj":
|
|
58
|
+
// Null prototype: "__proto__" and friends stay plain members.
|
|
59
|
+
const out = Object.create(null);
|
|
60
|
+
for (const [k, member] of v.v)
|
|
61
|
+
out[k] = toPlain(member);
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function fromPlain(p) {
|
|
66
|
+
if (p === null)
|
|
67
|
+
return nil;
|
|
68
|
+
if (typeof p === "boolean")
|
|
69
|
+
return bool(p);
|
|
70
|
+
if (typeof p === "number")
|
|
71
|
+
return Number.isInteger(p) ? int(p) : float(p);
|
|
72
|
+
if (typeof p === "string")
|
|
73
|
+
return str(p);
|
|
74
|
+
if (Array.isArray(p))
|
|
75
|
+
return arr(p.map(fromPlain));
|
|
76
|
+
return obj(Object.entries(p).map(([k, member]) => [k, fromPlain(member)]));
|
|
77
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agent-blueprint-protocol/verifier",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Installable verifier for the Agent Blueprint Protocol: canonical-bytes, digest, signature, bounds, and conformance-corpus verification. Non-authorizing \u2014 evidence, never a decision.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/baselabs/agent_blueprint_protocol.git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=24"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"agent-blueprint-protocol": "dist/kit/cli.mjs",
|
|
16
|
+
"verifier": "dist/kit/cli.mjs"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"NOTICE"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -p tsconfig.json && node scripts/build_kit.mjs",
|
|
27
|
+
"prepack": "npm run build"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^25.0.0",
|
|
31
|
+
"typescript": "^7.0.2"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"agent",
|
|
35
|
+
"protocol",
|
|
36
|
+
"verifier",
|
|
37
|
+
"conformance",
|
|
38
|
+
"interoperability",
|
|
39
|
+
"mcp",
|
|
40
|
+
"a2a"
|
|
41
|
+
]
|
|
42
|
+
}
|