@decionis/agentsafe 0.2.0 → 0.2.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 +10 -1
- package/dist/Cli.js +16 -7
- package/dist/Cli.js.map +1 -1
- package/dist/Index.d.ts +5 -1
- package/dist/Index.d.ts.map +1 -1
- package/dist/Index.js +5 -1
- package/dist/Index.js.map +1 -1
- package/dist/cli/CliProcess.d.ts +2 -0
- package/dist/cli/CliProcess.d.ts.map +1 -1
- package/dist/cli/CliProcess.js +9 -1
- package/dist/cli/CliProcess.js.map +1 -1
- package/dist/cli/Commands.d.ts +1 -1
- package/dist/cli/Commands.d.ts.map +1 -1
- package/dist/cli/Commands.js +5 -0
- package/dist/cli/Commands.js.map +1 -1
- package/dist/cli/Help.d.ts.map +1 -1
- package/dist/cli/Help.js +2 -0
- package/dist/cli/Help.js.map +1 -1
- package/dist/cli/Intercept.d.ts +30 -0
- package/dist/cli/Intercept.d.ts.map +1 -0
- package/dist/cli/Intercept.js +146 -0
- package/dist/cli/Intercept.js.map +1 -0
- package/dist/cli/Status.d.ts.map +1 -1
- package/dist/cli/Status.js +13 -1
- package/dist/cli/Status.js.map +1 -1
- package/dist/cli/TestCommand.d.ts +9 -0
- package/dist/cli/TestCommand.d.ts.map +1 -1
- package/dist/cli/TestCommand.js +8 -3
- package/dist/cli/TestCommand.js.map +1 -1
- package/dist/cli/VerifyIntent.d.ts +28 -0
- package/dist/cli/VerifyIntent.d.ts.map +1 -0
- package/dist/cli/VerifyIntent.js +136 -0
- package/dist/cli/VerifyIntent.js.map +1 -0
- package/dist/egress/TransparentDial.d.ts +17 -0
- package/dist/egress/TransparentDial.d.ts.map +1 -0
- package/dist/egress/TransparentDial.js +32 -0
- package/dist/egress/TransparentDial.js.map +1 -0
- package/dist/gateway/Activation.d.ts +10 -3
- package/dist/gateway/Activation.d.ts.map +1 -1
- package/dist/gateway/Activation.js +17 -2
- package/dist/gateway/Activation.js.map +1 -1
- package/dist/gateway/Gateway.d.ts +16 -0
- package/dist/gateway/Gateway.d.ts.map +1 -1
- package/dist/gateway/Gateway.js +33 -4
- package/dist/gateway/Gateway.js.map +1 -1
- package/dist/gateway/GatewayConfig.d.ts +7 -0
- package/dist/gateway/GatewayConfig.d.ts.map +1 -1
- package/dist/gateway/GatewayConfig.js +12 -7
- package/dist/gateway/GatewayConfig.js.map +1 -1
- package/dist/gateway/GatewayReport.d.ts +2 -1
- package/dist/gateway/GatewayReport.d.ts.map +1 -1
- package/dist/gateway/GatewayReport.js +3 -0
- package/dist/gateway/GatewayReport.js.map +1 -1
- package/dist/gateway/InstallSurface.d.ts +26 -0
- package/dist/gateway/InstallSurface.d.ts.map +1 -0
- package/dist/gateway/InstallSurface.js +53 -0
- package/dist/gateway/InstallSurface.js.map +1 -0
- package/dist/gateway/ShadowLedger.d.ts +55 -0
- package/dist/gateway/ShadowLedger.d.ts.map +1 -0
- package/dist/gateway/ShadowLedger.js +82 -0
- package/dist/gateway/ShadowLedger.js.map +1 -0
- package/dist/http/InterceptServer.d.ts +94 -0
- package/dist/http/InterceptServer.d.ts.map +1 -0
- package/dist/http/InterceptServer.js +252 -0
- package/dist/http/InterceptServer.js.map +1 -0
- package/dist/intercept/ClientHello.d.ts +37 -0
- package/dist/intercept/ClientHello.d.ts.map +1 -0
- package/dist/intercept/ClientHello.js +212 -0
- package/dist/intercept/ClientHello.js.map +1 -0
- package/dist/intercept/Destination.d.ts +35 -0
- package/dist/intercept/Destination.d.ts.map +1 -0
- package/dist/intercept/Destination.js +62 -0
- package/dist/intercept/Destination.js.map +1 -0
- package/dist/intercept/InterceptLedger.d.ts +67 -0
- package/dist/intercept/InterceptLedger.d.ts.map +1 -0
- package/dist/intercept/InterceptLedger.js +80 -0
- package/dist/intercept/InterceptLedger.js.map +1 -0
- package/dist/intercept/RequestHead.d.ts +48 -0
- package/dist/intercept/RequestHead.d.ts.map +1 -0
- package/dist/intercept/RequestHead.js +151 -0
- package/dist/intercept/RequestHead.js.map +1 -0
- package/dist/verify/VerifyIntentVector.d.ts +25 -0
- package/dist/verify/VerifyIntentVector.d.ts.map +1 -0
- package/dist/verify/VerifyIntentVector.js +188 -0
- package/dist/verify/VerifyIntentVector.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The head of a plaintext HTTP/1 request, read for where it was going: the
|
|
3
|
+
* `Host` header, or the authority of an absolute-form target, which a
|
|
4
|
+
* transparent interceptor has no other way to learn once the destination
|
|
5
|
+
* address has been rewritten to it. It reads the request line and the header
|
|
6
|
+
* names and values only as far as `Host`, keeps nothing, and refuses a head
|
|
7
|
+
* that two parsers could read differently (a repeated `Host`, a target that
|
|
8
|
+
* disagrees with it, a line the grammar does not allow) rather than choose.
|
|
9
|
+
*
|
|
10
|
+
* RFC 9112 sections 3 (request line), 3.2 (request target) and 5 (field
|
|
11
|
+
* syntax); RFC 9110 section 7.2 (Host).
|
|
12
|
+
*/
|
|
13
|
+
/** The most head bytes read before a request is refused as too long to place. */
|
|
14
|
+
export const MAX_REQUEST_HEAD_BYTES = 16_384;
|
|
15
|
+
const HEAD_END = "\r\n\r\n";
|
|
16
|
+
const TOKEN = /^[!#$%&'*+\-.^`|~\w]+$/;
|
|
17
|
+
const REQUEST_LINE = /^([!#$%&'*+\-.^`|~\w]+) (\S+) HTTP\/1\.[01]$/;
|
|
18
|
+
const HOST_NAME = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/;
|
|
19
|
+
const IPV4 = /^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/;
|
|
20
|
+
const IPV6_LITERAL = /^\[[0-9a-f:.]+\]$/;
|
|
21
|
+
const METHODS_WITHOUT_ORIGIN_FORM = new Set(["CONNECT"]);
|
|
22
|
+
/** Reads a client's first bytes as an HTTP/1 request head, or says why they are not one. */
|
|
23
|
+
export function readRequestHead(bytes) {
|
|
24
|
+
const text = latin1(bytes.subarray(0, Math.min(bytes.length, MAX_REQUEST_HEAD_BYTES + HEAD_END.length)));
|
|
25
|
+
const end = text.indexOf(HEAD_END);
|
|
26
|
+
if (end === -1) {
|
|
27
|
+
if (!looksLikeRequestLine(text))
|
|
28
|
+
return { kind: "NOT_HTTP" };
|
|
29
|
+
return bytes.length > MAX_REQUEST_HEAD_BYTES
|
|
30
|
+
? { kind: "MALFORMED", reason: "HEAD_TOO_LONG" }
|
|
31
|
+
: { kind: "NEED_MORE" };
|
|
32
|
+
}
|
|
33
|
+
const lines = text.slice(0, end).split("\r\n");
|
|
34
|
+
const requestLine = lines.shift() ?? "";
|
|
35
|
+
const match = REQUEST_LINE.exec(requestLine);
|
|
36
|
+
if (match === null) {
|
|
37
|
+
return looksLikeRequestLine(text)
|
|
38
|
+
? { kind: "MALFORMED", reason: "REQUEST_LINE_INVALID" }
|
|
39
|
+
: { kind: "NOT_HTTP" };
|
|
40
|
+
}
|
|
41
|
+
const method = match[1] ?? "";
|
|
42
|
+
const rawTarget = match[2] ?? "";
|
|
43
|
+
if (METHODS_WITHOUT_ORIGIN_FORM.has(method))
|
|
44
|
+
return { kind: "MALFORMED", reason: "TARGET_INVALID" };
|
|
45
|
+
let hostHeader = null;
|
|
46
|
+
for (const line of lines) {
|
|
47
|
+
const header = readHeaderLine(line);
|
|
48
|
+
if (header === null)
|
|
49
|
+
return { kind: "MALFORMED", reason: "HEADER_INVALID" };
|
|
50
|
+
if (header.name !== "host")
|
|
51
|
+
continue;
|
|
52
|
+
if (hostHeader !== null)
|
|
53
|
+
return { kind: "MALFORMED", reason: "HOST_REPEATED" };
|
|
54
|
+
hostHeader = header.value;
|
|
55
|
+
}
|
|
56
|
+
let target = rawTarget;
|
|
57
|
+
let authority = null;
|
|
58
|
+
if (!rawTarget.startsWith("/")) {
|
|
59
|
+
const absolute = /^http:\/\/([^/?#]+)(\/\S*)?$/i.exec(rawTarget);
|
|
60
|
+
if (absolute === null)
|
|
61
|
+
return { kind: "MALFORMED", reason: "TARGET_INVALID" };
|
|
62
|
+
authority = parseAuthority(absolute[1] ?? "");
|
|
63
|
+
if (authority === null)
|
|
64
|
+
return { kind: "MALFORMED", reason: "TARGET_INVALID" };
|
|
65
|
+
target = absolute[2] ?? "/";
|
|
66
|
+
}
|
|
67
|
+
if (hostHeader === null) {
|
|
68
|
+
if (authority === null)
|
|
69
|
+
return { kind: "MALFORMED", reason: "HOST_MISSING" };
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const fromHeader = parseAuthority(hostHeader);
|
|
73
|
+
if (fromHeader === null)
|
|
74
|
+
return { kind: "MALFORMED", reason: "HOST_INVALID" };
|
|
75
|
+
if (authority !== null &&
|
|
76
|
+
(authority.host !== fromHeader.host || authority.port !== fromHeader.port)) {
|
|
77
|
+
return { kind: "MALFORMED", reason: "TARGET_DISAGREES_WITH_HOST" };
|
|
78
|
+
}
|
|
79
|
+
authority ??= fromHeader;
|
|
80
|
+
}
|
|
81
|
+
return { kind: "REQUEST", method, target, host: authority.host, port: authority.port };
|
|
82
|
+
}
|
|
83
|
+
/** `host[:port]`, with the host a name, an IPv4 address or a bracketed IPv6 address. */
|
|
84
|
+
export function parseAuthority(value) {
|
|
85
|
+
const text = value.trim().toLowerCase();
|
|
86
|
+
if (text.length === 0 || text.length > 260)
|
|
87
|
+
return null;
|
|
88
|
+
let host;
|
|
89
|
+
let rest;
|
|
90
|
+
if (text.startsWith("[")) {
|
|
91
|
+
const close = text.indexOf("]");
|
|
92
|
+
if (close === -1)
|
|
93
|
+
return null;
|
|
94
|
+
host = text.slice(0, close + 1);
|
|
95
|
+
rest = text.slice(close + 1);
|
|
96
|
+
if (!IPV6_LITERAL.test(host))
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const colon = text.indexOf(":");
|
|
101
|
+
host = colon === -1 ? text : text.slice(0, colon);
|
|
102
|
+
rest = colon === -1 ? "" : text.slice(colon);
|
|
103
|
+
if (!HOST_NAME.test(host) && !IPV4.test(host))
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
if (rest === "")
|
|
107
|
+
return { host, port: null };
|
|
108
|
+
if (!/^:\d{1,5}$/.test(rest))
|
|
109
|
+
return null;
|
|
110
|
+
const port = Number(rest.slice(1));
|
|
111
|
+
if (port < 1 || port > 65_535)
|
|
112
|
+
return null;
|
|
113
|
+
return { host, port };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Whether the first bytes could still be an HTTP request line: an uppercase
|
|
117
|
+
* method token, then a space or the end of what has arrived. Enough to tell a
|
|
118
|
+
* request from a binary protocol before the head is complete.
|
|
119
|
+
*/
|
|
120
|
+
function looksLikeRequestLine(text) {
|
|
121
|
+
return /^[A-Z][!#$%&'*+\-.^`|~\w]{0,19}(?: |$)/.test(text.slice(0, 21));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* One header line as `name: value`, the name a token lowercased and the value
|
|
125
|
+
* without its optional leading and trailing space or tab. A line with a bare
|
|
126
|
+
* CR or LF, or no colon, or a name that is not a token, is not a header.
|
|
127
|
+
*/
|
|
128
|
+
function readHeaderLine(line) {
|
|
129
|
+
if (line.includes("\n") || line.includes("\r"))
|
|
130
|
+
return null;
|
|
131
|
+
const colon = line.indexOf(":");
|
|
132
|
+
if (colon <= 0)
|
|
133
|
+
return null;
|
|
134
|
+
const name = line.slice(0, colon);
|
|
135
|
+
if (!TOKEN.test(name))
|
|
136
|
+
return null;
|
|
137
|
+
let start = colon + 1;
|
|
138
|
+
let end = line.length;
|
|
139
|
+
while (start < end && (line[start] === " " || line[start] === "\t"))
|
|
140
|
+
start += 1;
|
|
141
|
+
while (end > start && (line[end - 1] === " " || line[end - 1] === "\t"))
|
|
142
|
+
end -= 1;
|
|
143
|
+
return { name: name.toLowerCase(), value: line.slice(start, end) };
|
|
144
|
+
}
|
|
145
|
+
function latin1(bytes) {
|
|
146
|
+
let text = "";
|
|
147
|
+
for (const byte of bytes)
|
|
148
|
+
text += String.fromCharCode(byte);
|
|
149
|
+
return text;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=RequestHead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestHead.js","sourceRoot":"","sources":["../../src/intercept/RequestHead.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA8BH,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE7C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,KAAK,GAAG,wBAAwB,CAAC;AACvC,MAAM,YAAY,GAAG,8CAA8C,CAAC;AACpE,MAAM,SAAS,GACb,gGAAgG,CAAC;AACnG,MAAM,IAAI,GAAG,mFAAmF,CAAC;AACjG,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAEzD,4FAA4F;AAC5F,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,MAAM,IAAI,GAAG,MAAM,CACjB,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,sBAAsB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CACpF,CAAC;IACF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAC,MAAM,GAAG,sBAAsB;YAC1C,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,E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AI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;QAAE,KAAK,IAAI,CAAC,CAAC;IAChF,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;QAAE,GAAG,IAAI,CAAC,CAAC;IAClF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,SAAS,MAAM,CAAC,KAAiB;IAC/B,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const INTENT_PROTOCOL = "agent-safe.intent/1";
|
|
2
|
+
export type IntentVectorFindingCode = "DOCUMENT_UNRECOGNISED" | "BINDING_INVALID" | "CANONICAL_MISMATCH" | "HASH_MISMATCH" | "MUTATION_INVALID" | "MUTATION_CANONICAL_MISMATCH" | "MUTATION_HASH_MISMATCH" | "MUTATION_NOT_DISTINCT" | "MUTATION_PATH_UNCHANGED";
|
|
3
|
+
export interface IntentVectorFinding {
|
|
4
|
+
readonly code: IntentVectorFindingCode;
|
|
5
|
+
/** The mutation's path, or the schema path that failed; null for the base. */
|
|
6
|
+
readonly path: string | null;
|
|
7
|
+
readonly expected: string | null;
|
|
8
|
+
readonly computed: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface IntentVectorReport {
|
|
11
|
+
readonly protocol: typeof INTENT_PROTOCOL;
|
|
12
|
+
/** `binding` for a whole intent binding, `canonical` for a bytes-and-digest case. */
|
|
13
|
+
readonly kind: "binding" | "canonical" | "unrecognised";
|
|
14
|
+
readonly ok: boolean;
|
|
15
|
+
/** Whether the document stated a hash to reproduce, or only asked for one. */
|
|
16
|
+
readonly pinned: boolean;
|
|
17
|
+
readonly canonical_json: string | null;
|
|
18
|
+
readonly intent_hash: string | null;
|
|
19
|
+
/** Mutations the document carried, and how many distinct hashes the whole vector came to. */
|
|
20
|
+
readonly mutations: number;
|
|
21
|
+
readonly hashes: number;
|
|
22
|
+
readonly findings: readonly IntentVectorFinding[];
|
|
23
|
+
}
|
|
24
|
+
export declare function verifyIntentVector(document: unknown): IntentVectorReport;
|
|
25
|
+
//# sourceMappingURL=VerifyIntentVector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerifyIntentVector.d.ts","sourceRoot":"","sources":["../../src/verify/VerifyIntentVector.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,MAAM,MAAM,uBAAuB,GAC/B,uBAAuB,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,eAAe,GACf,kBAAkB,GAClB,6BAA6B,GAC7B,wBAAwB,GACxB,uBAAuB,GACvB,yBAAyB,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,OAAO,eAAe,CAAC;IAC1C,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC;IACxD,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,6FAA6F;IAC7F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACnD;AAsDD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,CA0HxE"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The offline half of Agent-Safe Intent conformance: given a vector from the
|
|
3
|
+
* corpus under `conformance/`, or a binding another implementation produced,
|
|
4
|
+
* recompute the canonical bytes and the hash with this runtime's own
|
|
5
|
+
* canonicalizer and say whether they agree. Two kinds of vector exist. A
|
|
6
|
+
* `binding` vector holds a whole `agent-safe.intent/1` binding, which must
|
|
7
|
+
* also parse under the strict schema, and may carry `mutations`: single-field
|
|
8
|
+
* changes that must each hash differently from the base and from one
|
|
9
|
+
* another, which is the Compromised Principal requirement. A `canonical`
|
|
10
|
+
* vector holds any JSON object and pins only the bytes and the digest, which
|
|
11
|
+
* is how the Unicode, number and key-order cases are stated. A document with
|
|
12
|
+
* no expected hash is a binding to describe: its canonical bytes and hash are
|
|
13
|
+
* computed and returned, so an implementer can compare them with theirs.
|
|
14
|
+
*/
|
|
15
|
+
import { createHash } from "node:crypto";
|
|
16
|
+
import { AuthorityIntentBindingSchema, CanonicalIntentHasher, } from "@decionis/agent-safe-pipeline";
|
|
17
|
+
export const INTENT_PROTOCOL = "agent-safe.intent/1";
|
|
18
|
+
const hasher = new CanonicalIntentHasher();
|
|
19
|
+
function isObject(value) {
|
|
20
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21
|
+
}
|
|
22
|
+
function digest(canonical) {
|
|
23
|
+
return `sha256:${createHash("sha256").update(canonical, "utf8").digest("hex")}`;
|
|
24
|
+
}
|
|
25
|
+
/** The value at a dotted path, or undefined; arrays are not addressed. */
|
|
26
|
+
function valueAt(value, path) {
|
|
27
|
+
let current = value;
|
|
28
|
+
for (const key of path.split(".")) {
|
|
29
|
+
if (!isObject(current))
|
|
30
|
+
return undefined;
|
|
31
|
+
current = current[key];
|
|
32
|
+
}
|
|
33
|
+
return current;
|
|
34
|
+
}
|
|
35
|
+
/** Canonical bytes and hash of a bounded JSON object; null when it is not one. */
|
|
36
|
+
function canonicalize(value) {
|
|
37
|
+
if (!isObject(value))
|
|
38
|
+
return null;
|
|
39
|
+
try {
|
|
40
|
+
hasher.assertInputBounded(value);
|
|
41
|
+
const canonical = CanonicalIntentHasher.stringify(value);
|
|
42
|
+
return { canonical, hash: digest(canonical) };
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function schemaFinding(binding, code, path) {
|
|
49
|
+
const result = AuthorityIntentBindingSchema.safeParse(binding);
|
|
50
|
+
if (result.success)
|
|
51
|
+
return null;
|
|
52
|
+
const issue = result.error.issues[0];
|
|
53
|
+
const segments = issue === undefined ? [] : issue.path.map(String);
|
|
54
|
+
// A key the schema does not name is reported by that name, not by its parent.
|
|
55
|
+
if (issue?.code === "unrecognized_keys")
|
|
56
|
+
segments.push(...issue.keys);
|
|
57
|
+
const at = segments.join(".");
|
|
58
|
+
return {
|
|
59
|
+
code,
|
|
60
|
+
path: path === null ? (at === "" ? null : at) : `${path}${at === "" ? "" : ` (${at})`}`,
|
|
61
|
+
expected: issue?.code ?? null,
|
|
62
|
+
computed: null,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function verifyIntentVector(document) {
|
|
66
|
+
const unrecognised = {
|
|
67
|
+
protocol: INTENT_PROTOCOL,
|
|
68
|
+
kind: "unrecognised",
|
|
69
|
+
ok: false,
|
|
70
|
+
pinned: false,
|
|
71
|
+
canonical_json: null,
|
|
72
|
+
intent_hash: null,
|
|
73
|
+
mutations: 0,
|
|
74
|
+
hashes: 0,
|
|
75
|
+
findings: [{ code: "DOCUMENT_UNRECOGNISED", path: null, expected: null, computed: null }],
|
|
76
|
+
};
|
|
77
|
+
if (!isObject(document))
|
|
78
|
+
return unrecognised;
|
|
79
|
+
// A vector wraps its binding; a bare binding is the document itself.
|
|
80
|
+
const wrapped = isObject(document["binding"]);
|
|
81
|
+
const binding = wrapped ? document["binding"] : document;
|
|
82
|
+
if (!isObject(binding))
|
|
83
|
+
return unrecognised;
|
|
84
|
+
const kind = binding["protocol_version"] === INTENT_PROTOCOL ? "binding" : "canonical";
|
|
85
|
+
if (!wrapped && kind !== "binding")
|
|
86
|
+
return unrecognised;
|
|
87
|
+
const findings = [];
|
|
88
|
+
const base = canonicalize(binding);
|
|
89
|
+
if (base === null) {
|
|
90
|
+
findings.push({
|
|
91
|
+
code: "BINDING_INVALID",
|
|
92
|
+
path: null,
|
|
93
|
+
expected: "bounded JSON object",
|
|
94
|
+
computed: null,
|
|
95
|
+
});
|
|
96
|
+
return { ...unrecognised, kind, findings };
|
|
97
|
+
}
|
|
98
|
+
if (kind === "binding") {
|
|
99
|
+
const finding = schemaFinding(binding, "BINDING_INVALID", null);
|
|
100
|
+
if (finding !== null)
|
|
101
|
+
findings.push(finding);
|
|
102
|
+
}
|
|
103
|
+
const expectedCanonical = wrapped ? document["canonical_json"] : undefined;
|
|
104
|
+
const expectedHash = wrapped ? document["intent_hash"] : undefined;
|
|
105
|
+
const pinned = typeof expectedHash === "string";
|
|
106
|
+
if (typeof expectedCanonical === "string" && expectedCanonical !== base.canonical) {
|
|
107
|
+
findings.push({
|
|
108
|
+
code: "CANONICAL_MISMATCH",
|
|
109
|
+
path: null,
|
|
110
|
+
expected: expectedCanonical,
|
|
111
|
+
computed: base.canonical,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (pinned && expectedHash !== base.hash) {
|
|
115
|
+
findings.push({
|
|
116
|
+
code: "HASH_MISMATCH",
|
|
117
|
+
path: null,
|
|
118
|
+
expected: expectedHash,
|
|
119
|
+
computed: base.hash,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const hashes = new Set([base.hash]);
|
|
123
|
+
const mutations = wrapped && Array.isArray(document["mutations"]) ? document["mutations"] : [];
|
|
124
|
+
for (const [index, mutation] of mutations.entries()) {
|
|
125
|
+
const label = isObject(mutation) && typeof mutation["path"] === "string"
|
|
126
|
+
? mutation["path"]
|
|
127
|
+
: `#${String(index)}`;
|
|
128
|
+
const mutated = isObject(mutation) ? canonicalize(mutation["binding"]) : null;
|
|
129
|
+
if (!isObject(mutation) || mutated === null || typeof mutation["intent_hash"] !== "string") {
|
|
130
|
+
findings.push({ code: "MUTATION_INVALID", path: label, expected: null, computed: null });
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (kind === "binding") {
|
|
134
|
+
const finding = schemaFinding(mutation["binding"], "MUTATION_INVALID", label);
|
|
135
|
+
if (finding !== null)
|
|
136
|
+
findings.push(finding);
|
|
137
|
+
}
|
|
138
|
+
if (typeof mutation["canonical_json"] === "string" &&
|
|
139
|
+
mutation["canonical_json"] !== mutated.canonical) {
|
|
140
|
+
findings.push({
|
|
141
|
+
code: "MUTATION_CANONICAL_MISMATCH",
|
|
142
|
+
path: label,
|
|
143
|
+
expected: mutation["canonical_json"],
|
|
144
|
+
computed: mutated.canonical,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (mutation["intent_hash"] !== mutated.hash) {
|
|
148
|
+
findings.push({
|
|
149
|
+
code: "MUTATION_HASH_MISMATCH",
|
|
150
|
+
path: label,
|
|
151
|
+
expected: mutation["intent_hash"],
|
|
152
|
+
computed: mutated.hash,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (hashes.has(mutated.hash)) {
|
|
156
|
+
findings.push({
|
|
157
|
+
code: "MUTATION_NOT_DISTINCT",
|
|
158
|
+
path: label,
|
|
159
|
+
expected: null,
|
|
160
|
+
computed: mutated.hash,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
hashes.add(mutated.hash);
|
|
164
|
+
// The mutation must be what it says it is: the named field differs from the base.
|
|
165
|
+
if (typeof mutation["path"] === "string" &&
|
|
166
|
+
JSON.stringify(valueAt(mutation["binding"], mutation["path"])) ===
|
|
167
|
+
JSON.stringify(valueAt(binding, mutation["path"]))) {
|
|
168
|
+
findings.push({
|
|
169
|
+
code: "MUTATION_PATH_UNCHANGED",
|
|
170
|
+
path: label,
|
|
171
|
+
expected: null,
|
|
172
|
+
computed: null,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
protocol: INTENT_PROTOCOL,
|
|
178
|
+
kind,
|
|
179
|
+
ok: findings.length === 0,
|
|
180
|
+
pinned,
|
|
181
|
+
canonical_json: base.canonical,
|
|
182
|
+
intent_hash: base.hash,
|
|
183
|
+
mutations: mutations.length,
|
|
184
|
+
hashes: hashes.size,
|
|
185
|
+
findings,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=VerifyIntentVector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerifyIntentVector.js","sourceRoot":"","sources":["../../src/verify/VerifyIntentVector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAoCrD,MAAM,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAE3C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK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CAAC;gBACZ,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,KAAK;gBACX,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,OAAO,CAAC,IAAI;aACvB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzB,kFAAkF;QAClF,IACE,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,QAAQ;YACpC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC5D,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EACpD,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,KAAK;gBACX,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,eAAe;QACzB,IAAI;QACJ,EAAE,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;QACzB,MAAM;QACN,cAAc,EAAE,IAAI,CAAC,SAAS;QAC9B,WAAW,EAAE,IAAI,CAAC,IAAI;QACtB,SAAS,EAAE,SAAS,CAAC,MAAM;QAC3B,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decionis/agentsafe",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The trusted executor of the Execution Authority architecture as one deployable process: a proposal in over HTTP, a verdict from the authority, one execution on a claimed single-use grant, and the evidence of each.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"execution-authority",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"jose": "^6.2.10",
|
|
59
59
|
"yaml": "^2.9.0",
|
|
60
60
|
"zod": "^4.5.4",
|
|
61
|
-
"@decionis/agent-safe-pipeline": "^0.3.
|
|
61
|
+
"@decionis/agent-safe-pipeline": "^0.3.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@stryker-mutator/core": "10.0.0",
|