inamprotocol 0.18.0 → 0.19.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/README.md +18 -0
- package/dist/http.d.ts +60 -0
- package/dist/http.js +108 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,6 +100,24 @@ const check = await verifyErc8004Feedback(fileText, { feedbackHash, clientAddres
|
|
|
100
100
|
// { valid, reasons, receiptId, providerDid, providerAddress }
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
## Receipts over HTTP
|
|
104
|
+
|
|
105
|
+
If your agents already call each other over HTTP, one wrapper on each side turns every call into a countersigned receipt (SPEC.md §15):
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import { InamClient, inamReceipts, inamFetch } from "inamprotocol";
|
|
109
|
+
|
|
110
|
+
// Worker: wrap the fetch-style handler that answers calls.
|
|
111
|
+
export default { fetch: inamReceipts(handleReview, { client: workerClient, capability: "code-review" }) };
|
|
112
|
+
|
|
113
|
+
// Requester: call through inamFetch.
|
|
114
|
+
const inam = inamFetch(requesterClient);
|
|
115
|
+
const res = await inam.fetch("https://reviewer.example/review", { method: "POST", body: diff });
|
|
116
|
+
await inam.settle(); // countersigns run in the background; wait before a serverless function exits
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The requester only countersigns when the receipt's hashes match the exact request it sent and response it received. That confirms delivery, not quality; pass `accept: (res, receipt) => ...` to `inamFetch` to run your own check first.
|
|
120
|
+
|
|
103
121
|
## Vercel AI SDK tools
|
|
104
122
|
|
|
105
123
|
```ts
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receipts over HTTP (SPEC.md §15): every call between two agents leaves a
|
|
3
|
+
* countersigned receipt, with one wrapper on each side.
|
|
4
|
+
*
|
|
5
|
+
* Worker (the agent that does the work and answers the call):
|
|
6
|
+
*
|
|
7
|
+
* const handler = inamReceipts(myHandler, { client, capability: "code-review" });
|
|
8
|
+
*
|
|
9
|
+
* Requester (the agent that calls it):
|
|
10
|
+
*
|
|
11
|
+
* const inam = inamFetch(client);
|
|
12
|
+
* const res = await inam.fetch("https://reviewer.example/review", { method: "POST", body });
|
|
13
|
+
* await inam.settle(); // wait for countersigns before a serverless function exits
|
|
14
|
+
*
|
|
15
|
+
* The requester names itself in `INAM-Requester`. The worker hashes the request
|
|
16
|
+
* it received and the response it sends, drafts a receipt naming the requester,
|
|
17
|
+
* and returns the receipt id in `INAM-Receipt`. The requester recomputes both
|
|
18
|
+
* hashes from the bytes it actually sent and received, and countersigns only
|
|
19
|
+
* when they match. A countersign confirms delivery of exactly those bytes for
|
|
20
|
+
* exactly that request, nothing more; pass `accept` to also judge the output.
|
|
21
|
+
*/
|
|
22
|
+
import type { InamClient } from "./client.js";
|
|
23
|
+
import type { ExecutionReceipt } from "./types.js";
|
|
24
|
+
export declare const INAM_REQUESTER_HEADER = "INAM-Requester";
|
|
25
|
+
export declare const INAM_RECEIPT_HEADER = "INAM-Receipt";
|
|
26
|
+
/** sha256 over `METHOD path?query\n` followed by the exact request body bytes. */
|
|
27
|
+
export declare function httpSpecHash(method: string, url: string, body: Uint8Array): string;
|
|
28
|
+
/** sha256 over the exact response body bytes. */
|
|
29
|
+
export declare function httpOutputHash(body: Uint8Array): string;
|
|
30
|
+
/**
|
|
31
|
+
* Wraps a fetch-style handler (Workers, Hono, Next.js route handlers, Deno,
|
|
32
|
+
* Bun). Drafts a receipt for every 2xx answer to a request that carries a
|
|
33
|
+
* valid `INAM-Requester`; anything else passes through untouched. Buffers the
|
|
34
|
+
* response body to hash it, so it is not for long-lived streams.
|
|
35
|
+
*/
|
|
36
|
+
export declare function inamReceipts(handler: (req: Request) => Response | Promise<Response>, opts: {
|
|
37
|
+
client: InamClient;
|
|
38
|
+
capability: string;
|
|
39
|
+
visibility?: "public" | "participants_only";
|
|
40
|
+
/** Run the registry call in the background (e.g. ctx.waitUntil); default: await it before responding. */
|
|
41
|
+
waitUntil?: (p: Promise<unknown>) => void;
|
|
42
|
+
onError?: (err: unknown) => void;
|
|
43
|
+
}): (req: Request) => Promise<Response>;
|
|
44
|
+
/**
|
|
45
|
+
* A fetch that asks the worker for a receipt and countersigns it once the
|
|
46
|
+
* hashes match what was really sent and received. Countersigning runs in the
|
|
47
|
+
* background; `settle()` waits for all of it.
|
|
48
|
+
*/
|
|
49
|
+
export declare function inamFetch(client: InamClient, opts?: {
|
|
50
|
+
fetch?: typeof fetch;
|
|
51
|
+
/** Return false to leave the draft unsigned (e.g. the output failed your own checks). */
|
|
52
|
+
accept?: (res: Response, receipt: ExecutionReceipt) => boolean | Promise<boolean>;
|
|
53
|
+
onReceipt?: (receipt: ExecutionReceipt) => void;
|
|
54
|
+
onError?: (err: unknown) => void;
|
|
55
|
+
/** How long to wait for a background-drafted receipt to appear. */
|
|
56
|
+
retries?: number;
|
|
57
|
+
}): {
|
|
58
|
+
fetch: typeof fetch;
|
|
59
|
+
settle: () => Promise<void>;
|
|
60
|
+
};
|
package/dist/http.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { computeReceiptId } from "./core/receiptContent.js";
|
|
2
|
+
import { sha256Hex } from "./crypto/keys.js";
|
|
3
|
+
export const INAM_REQUESTER_HEADER = "INAM-Requester";
|
|
4
|
+
export const INAM_RECEIPT_HEADER = "INAM-Receipt";
|
|
5
|
+
const DID_KEY = /^did:key:z[1-9A-HJ-NP-Za-km-z]+$/;
|
|
6
|
+
/** sha256 over `METHOD path?query\n` followed by the exact request body bytes. */
|
|
7
|
+
export function httpSpecHash(method, url, body) {
|
|
8
|
+
const { pathname, search } = new URL(url);
|
|
9
|
+
const head = new TextEncoder().encode(`${method.toUpperCase()} ${pathname}${search}\n`);
|
|
10
|
+
const bytes = new Uint8Array(head.length + body.length);
|
|
11
|
+
bytes.set(head);
|
|
12
|
+
bytes.set(body, head.length);
|
|
13
|
+
return `sha256:${sha256Hex(bytes)}`;
|
|
14
|
+
}
|
|
15
|
+
/** sha256 over the exact response body bytes. */
|
|
16
|
+
export function httpOutputHash(body) {
|
|
17
|
+
return `sha256:${sha256Hex(body)}`;
|
|
18
|
+
}
|
|
19
|
+
const bytesOf = async (r) => new Uint8Array(await r.clone().arrayBuffer());
|
|
20
|
+
/**
|
|
21
|
+
* Wraps a fetch-style handler (Workers, Hono, Next.js route handlers, Deno,
|
|
22
|
+
* Bun). Drafts a receipt for every 2xx answer to a request that carries a
|
|
23
|
+
* valid `INAM-Requester`; anything else passes through untouched. Buffers the
|
|
24
|
+
* response body to hash it, so it is not for long-lived streams.
|
|
25
|
+
*/
|
|
26
|
+
export function inamReceipts(handler, opts) {
|
|
27
|
+
return async (req) => {
|
|
28
|
+
const requester = req.headers.get(INAM_REQUESTER_HEADER);
|
|
29
|
+
if (!requester || !DID_KEY.test(requester) || requester === opts.client.did)
|
|
30
|
+
return handler(req);
|
|
31
|
+
const reqBytes = await bytesOf(req);
|
|
32
|
+
const res = await handler(req);
|
|
33
|
+
if (!res.ok)
|
|
34
|
+
return res;
|
|
35
|
+
const now = new Date().toISOString();
|
|
36
|
+
const input = {
|
|
37
|
+
jobId: `http:${crypto.randomUUID()}`,
|
|
38
|
+
task: { capability: opts.capability, specHash: httpSpecHash(req.method, req.url, reqBytes), createdAt: now },
|
|
39
|
+
result: { outputHash: httpOutputHash(await bytesOf(res)), completedAt: now },
|
|
40
|
+
verification: { method: "payer_confirmation", outcome: "success" },
|
|
41
|
+
};
|
|
42
|
+
// Content-addressed, so the id is known before the registry sees the draft.
|
|
43
|
+
const receiptId = computeReceiptId(requester, opts.client.did, input);
|
|
44
|
+
const draft = opts.client.submitWork(requester, input, { visibility: opts.visibility }).catch((err) => opts.onError?.(err));
|
|
45
|
+
if (opts.waitUntil)
|
|
46
|
+
opts.waitUntil(draft);
|
|
47
|
+
else
|
|
48
|
+
await draft;
|
|
49
|
+
const headers = new Headers(res.headers);
|
|
50
|
+
headers.set(INAM_RECEIPT_HEADER, receiptId);
|
|
51
|
+
return new Response(res.body, { status: res.status, statusText: res.statusText, headers });
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A fetch that asks the worker for a receipt and countersigns it once the
|
|
56
|
+
* hashes match what was really sent and received. Countersigning runs in the
|
|
57
|
+
* background; `settle()` waits for all of it.
|
|
58
|
+
*/
|
|
59
|
+
export function inamFetch(client, opts = {}) {
|
|
60
|
+
const base = opts.fetch ?? fetch;
|
|
61
|
+
const pending = new Set();
|
|
62
|
+
async function countersign(req, reqBytes, res, receiptId) {
|
|
63
|
+
const specHash = httpSpecHash(req.method, req.url, reqBytes);
|
|
64
|
+
const outputHash = httpOutputHash(await bytesOf(res));
|
|
65
|
+
let receipt;
|
|
66
|
+
for (let i = 0;; i++) {
|
|
67
|
+
try {
|
|
68
|
+
receipt = await client.getReceipt(receiptId);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (i >= (opts.retries ?? 5))
|
|
73
|
+
throw err;
|
|
74
|
+
await new Promise((r) => setTimeout(r, 500 * (i + 1)));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (receipt.task.specHash !== specHash)
|
|
78
|
+
throw new Error(`inamFetch: receipt ${receiptId} names a different request (specHash mismatch)`);
|
|
79
|
+
if (receipt.status !== "draft")
|
|
80
|
+
return;
|
|
81
|
+
if (opts.accept && !(await opts.accept(res.clone(), receipt)))
|
|
82
|
+
return;
|
|
83
|
+
// acceptWork also refuses unless this client is the receipt's requester.
|
|
84
|
+
const done = await client.acceptWork(receipt, { jobId: receipt.jobId, outputHash });
|
|
85
|
+
opts.onReceipt?.(done);
|
|
86
|
+
}
|
|
87
|
+
const wrapped = (async (input, init) => {
|
|
88
|
+
const req = new Request(input, init);
|
|
89
|
+
req.headers.set(INAM_REQUESTER_HEADER, client.did);
|
|
90
|
+
const reqBytes = await bytesOf(req);
|
|
91
|
+
const res = await base(req);
|
|
92
|
+
const receiptId = res.headers.get(INAM_RECEIPT_HEADER);
|
|
93
|
+
if (res.ok && receiptId) {
|
|
94
|
+
const p = countersign(req, reqBytes, res.clone(), receiptId).catch((err) => opts.onError?.(err));
|
|
95
|
+
pending.add(p);
|
|
96
|
+
void p.finally(() => pending.delete(p));
|
|
97
|
+
}
|
|
98
|
+
return res;
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
fetch: wrapped,
|
|
102
|
+
settle: async () => {
|
|
103
|
+
while (pending.size)
|
|
104
|
+
await Promise.all([...pending]);
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=http.js.map
|
package/dist/http.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,gBAAgB,EAA4B,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAElD,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAEnD,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,GAAW,EAAE,IAAgB;IACxE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,QAAQ,GAAG,MAAM,IAAI,CAAC,CAAC;IACxF,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CA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ust, checkTrust, DEFAULT_ESCROW_FLAGS } from "./trust.js";
|
|
|
19
19
|
export type { TrustPolicy, TrustDecision, TrustDecisionKind } from "./trust.js";
|
|
20
20
|
export { INAM_FEEDBACK_TAG, buildErc8004Feedback, verifyErc8004Feedback } from "./erc8004.js";
|
|
21
21
|
export type { Erc8004Target, Erc8004Feedback, Erc8004FeedbackCheck } from "./erc8004.js";
|
|
22
|
+
export { inamReceipts, inamFetch, httpSpecHash, httpOutputHash, INAM_REQUESTER_HEADER, INAM_RECEIPT_HEADER } from "./http.js";
|
package/dist/index.js
CHANGED
|
@@ -24,4 +24,5 @@ export { INAM_X402_EXTENSION, inamX402Extension, decideX402, withInamX402Gate, X
|
|
|
24
24
|
export { INAM_A2A_EXTENSION_URI, inamA2AExtension, decideA2A, verifyA2ACard, cardEndpoints } from "./a2a.js";
|
|
25
25
|
export { decideTrust, checkTrust, DEFAULT_ESCROW_FLAGS } from "./trust.js";
|
|
26
26
|
export { INAM_FEEDBACK_TAG, buildErc8004Feedback, verifyErc8004Feedback } from "./erc8004.js";
|
|
27
|
+
export { inamReceipts, inamFetch, httpSpecHash, httpOutputHash, INAM_REQUESTER_HEADER, INAM_RECEIPT_HEADER } from "./http.js";
|
|
27
28
|
//# 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,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,KAAK,EACL,OAAO,GAER,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAE/F,OAAO,EACL,wBAAwB,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