@agenticprimitives/a2a 0.0.0-alpha.5 → 0.0.0-alpha.50
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/CLAUDE.md +39 -55
- package/README.md +44 -1
- package/bin/a2a-conform.mjs +17 -0
- package/dist/agent.d.ts +203 -7
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +586 -76
- package/dist/agent.js.map +1 -1
- package/dist/auth.d.ts +84 -11
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +94 -20
- package/dist/auth.js.map +1 -1
- package/dist/authority-extension.d.ts +58 -0
- package/dist/authority-extension.d.ts.map +1 -0
- package/dist/authority-extension.js +70 -0
- package/dist/authority-extension.js.map +1 -0
- package/dist/card-audience.d.ts +87 -0
- package/dist/card-audience.d.ts.map +1 -0
- package/dist/card-audience.js +135 -0
- package/dist/card-audience.js.map +1 -0
- package/dist/client.d.ts +23 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +76 -13
- package/dist/client.js.map +1 -1
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +10 -2
- package/dist/cloudflare/index.js.map +1 -1
- package/dist/conform/index.d.ts +36 -0
- package/dist/conform/index.d.ts.map +1 -0
- package/dist/conform/index.js +247 -0
- package/dist/conform/index.js.map +1 -0
- package/dist/discovery.d.ts +4 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +6 -2
- package/dist/discovery.js.map +1 -1
- package/dist/engagement.d.ts +37 -0
- package/dist/engagement.d.ts.map +1 -0
- package/dist/engagement.js +83 -0
- package/dist/engagement.js.map +1 -0
- package/dist/grant.d.ts +4 -2
- package/dist/grant.d.ts.map +1 -1
- package/dist/grant.js +21 -13
- package/dist/grant.js.map +1 -1
- package/dist/handoff.d.ts +42 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +28 -0
- package/dist/handoff.js.map +1 -0
- package/dist/index.d.ts +30 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -5
- package/dist/index.js.map +1 -1
- package/dist/payment-gate.d.ts +69 -3
- package/dist/payment-gate.d.ts.map +1 -1
- package/dist/payment-gate.js +36 -5
- package/dist/payment-gate.js.map +1 -1
- package/dist/placeholder.d.ts +5 -0
- package/dist/placeholder.d.ts.map +1 -0
- package/dist/placeholder.js +10 -0
- package/dist/placeholder.js.map +1 -0
- package/dist/run-provenance-extension.d.ts +22 -0
- package/dist/run-provenance-extension.d.ts.map +1 -0
- package/dist/run-provenance-extension.js +23 -0
- package/dist/run-provenance-extension.js.map +1 -0
- package/dist/runtime.d.ts +13 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +62 -16
- package/dist/runtime.js.map +1 -1
- package/dist/session-wire.d.ts +114 -0
- package/dist/session-wire.d.ts.map +1 -0
- package/dist/session-wire.js +292 -0
- package/dist/session-wire.js.map +1 -0
- package/dist/skill-handler.d.ts +21 -1
- package/dist/skill-handler.d.ts.map +1 -1
- package/dist/skill-handler.js.map +1 -1
- package/dist/standard/app-delegation.d.ts +60 -0
- package/dist/standard/app-delegation.d.ts.map +1 -0
- package/dist/standard/app-delegation.js +43 -0
- package/dist/standard/app-delegation.js.map +1 -0
- package/dist/standard/caller.d.ts +115 -0
- package/dist/standard/caller.d.ts.map +1 -0
- package/dist/standard/caller.js +186 -0
- package/dist/standard/caller.js.map +1 -0
- package/dist/standard/client.d.ts +64 -0
- package/dist/standard/client.d.ts.map +1 -0
- package/dist/standard/client.js +109 -0
- package/dist/standard/client.js.map +1 -0
- package/dist/standard/delegated.d.ts +127 -0
- package/dist/standard/delegated.d.ts.map +1 -0
- package/dist/standard/delegated.js +179 -0
- package/dist/standard/delegated.js.map +1 -0
- package/dist/standard/errors.d.ts +31 -0
- package/dist/standard/errors.d.ts.map +1 -0
- package/dist/standard/errors.js +75 -0
- package/dist/standard/errors.js.map +1 -0
- package/dist/standard/from-agent.d.ts +43 -0
- package/dist/standard/from-agent.d.ts.map +1 -0
- package/dist/standard/from-agent.js +149 -0
- package/dist/standard/from-agent.js.map +1 -0
- package/dist/standard/index.d.ts +12 -0
- package/dist/standard/index.d.ts.map +1 -0
- package/dist/standard/index.js +18 -0
- package/dist/standard/index.js.map +1 -0
- package/dist/standard/mount.d.ts +101 -0
- package/dist/standard/mount.d.ts.map +1 -0
- package/dist/standard/mount.js +186 -0
- package/dist/standard/mount.js.map +1 -0
- package/dist/standard/outbound-fetch.d.ts +51 -0
- package/dist/standard/outbound-fetch.d.ts.map +1 -0
- package/dist/standard/outbound-fetch.js +152 -0
- package/dist/standard/outbound-fetch.js.map +1 -0
- package/dist/standard/push-url-policy.d.ts +34 -0
- package/dist/standard/push-url-policy.d.ts.map +1 -0
- package/dist/standard/push-url-policy.js +218 -0
- package/dist/standard/push-url-policy.js.map +1 -0
- package/dist/standard/server.d.ts +150 -0
- package/dist/standard/server.d.ts.map +1 -0
- package/dist/standard/server.js +575 -0
- package/dist/standard/server.js.map +1 -0
- package/dist/standard/types.d.ts +186 -0
- package/dist/standard/types.d.ts.map +1 -0
- package/dist/standard/types.js +14 -0
- package/dist/standard/types.js.map +1 -0
- package/dist/subject-ask.d.ts +142 -0
- package/dist/subject-ask.d.ts.map +1 -0
- package/dist/subject-ask.js +137 -0
- package/dist/subject-ask.js.map +1 -0
- package/dist/subject-hop.d.ts +156 -0
- package/dist/subject-hop.d.ts.map +1 -0
- package/dist/subject-hop.js +276 -0
- package/dist/subject-hop.js.map +1 -0
- package/dist/task-store.d.ts +9 -3
- package/dist/task-store.d.ts.map +1 -1
- package/dist/task-store.js +12 -6
- package/dist/task-store.js.map +1 -1
- package/dist/types.d.ts +27 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wire-verify.d.ts +35 -0
- package/dist/wire-verify.d.ts.map +1 -0
- package/dist/wire-verify.js +55 -0
- package/dist/wire-verify.js.map +1 -0
- package/package.json +35 -12
- package/dist/jsonrpc.d.ts +0 -25
- package/dist/jsonrpc.d.ts.map +0 -1
- package/dist/jsonrpc.js +0 -52
- package/dist/jsonrpc.js.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { AP_DELEGATED_TASK_EXTENSION, DELEGATED_TASK_CARD_EXTENSION, GET_TASK_ARTIFACT_METHOD, delegatedInput, delegatedTaskAsV1, isPartyToDelegatedTask, readDelegatedTask, toProfileMessage, } from './delegated.js';
|
|
2
|
+
import { wireToDelegation } from '../session-wire.js';
|
|
3
|
+
import { A2A_ERROR, A2aError, JSONRPC_ERROR } from './errors.js';
|
|
4
|
+
import { createMemoryPushStore, createStandardA2aServer, } from './server.js';
|
|
5
|
+
/** Spec 445 §9 decision 8 — the delegated-task extension's payment-resume method: `{ id, settlement }`. */
|
|
6
|
+
export const SETTLE_TASK_PAYMENT_METHOD = 'SettleTaskPayment';
|
|
7
|
+
/** Project a runtime record into the 1.0 shape. */
|
|
8
|
+
export const recordAsV1 = (r) => delegatedTaskAsV1({
|
|
9
|
+
task: { taskId: r.task.taskId, state: r.task.state, assignee: r.task.assignee, permissionGrantRef: r.task.permissionGrantRef },
|
|
10
|
+
principal: r.principal, sender: r.sender, skill: r.skill,
|
|
11
|
+
inbound: (r.inbound ?? []).map((m) => ({ messageId: m.messageId, sender: m.sender, threadId: m.threadId, createdAt: m.createdAt, bodyRef: m.bodyRef, bodyHash: m.bodyHash })),
|
|
12
|
+
artifacts: (r.artifacts ?? []).map((a) => ({ artifactId: a.artifactId, artifactKind: a.artifactKind, bodyRef: a.bodyRef, bodyHash: a.contentHash })),
|
|
13
|
+
...(r.error ? { error: r.error } : {}),
|
|
14
|
+
...(r.rev !== undefined ? { rev: r.rev } : {}),
|
|
15
|
+
...(r.updatedAt !== undefined ? { updatedAt: r.updatedAt } : {}),
|
|
16
|
+
});
|
|
17
|
+
/** A read-only `StandardTaskStore` over the runtime's own store, plus a writable side for tasks this
|
|
18
|
+
* server creates itself (a plain conversation). One `GetTask` answers from whichever holds the id. */
|
|
19
|
+
export function taskStoreOverAgent(runtime, own) {
|
|
20
|
+
return {
|
|
21
|
+
async get(id) {
|
|
22
|
+
const rec = /^0x[0-9a-fA-F]{64}$/.test(id) ? await runtime.get(id).catch(() => null) : null;
|
|
23
|
+
return rec ? recordAsV1(rec) : own.get(id);
|
|
24
|
+
},
|
|
25
|
+
put: (t) => own.put(t),
|
|
26
|
+
async all() {
|
|
27
|
+
const mine = await own.all();
|
|
28
|
+
if (!runtime.list)
|
|
29
|
+
return mine;
|
|
30
|
+
const theirs = (await runtime.list(200).catch(() => [])).map(recordAsV1);
|
|
31
|
+
return [...theirs, ...mine];
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const REFUSES_PLAIN = 'this agent takes delegation-authorized tasks; carry the delegated-task extension on the message';
|
|
36
|
+
/**
|
|
37
|
+
* Build the ONE server this agent serves: A2A 1.0 methods, the delegation-authorized runtime behind
|
|
38
|
+
* `SendMessage`-with-extension, and an ordinary conversation behind `SendMessage` without one.
|
|
39
|
+
*/
|
|
40
|
+
export function createAgentBackedServer(opts) {
|
|
41
|
+
const tasks = taskStoreOverAgent(opts.runtimeStore, opts.ownStore);
|
|
42
|
+
const card = {
|
|
43
|
+
...opts.card,
|
|
44
|
+
capabilities: {
|
|
45
|
+
...opts.card.capabilities,
|
|
46
|
+
extensions: [
|
|
47
|
+
...(opts.card.capabilities.extensions ?? []).filter((e) => e.uri !== AP_DELEGATED_TASK_EXTENSION),
|
|
48
|
+
{ ...DELEGATED_TASK_CARD_EXTENSION },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
return createStandardA2aServer({
|
|
53
|
+
card,
|
|
54
|
+
tasks,
|
|
55
|
+
push: opts.push ?? createMemoryPushStore(),
|
|
56
|
+
...(opts.principal ? { principal: opts.principal } : {}),
|
|
57
|
+
...(opts.versions ? { versions: opts.versions } : {}),
|
|
58
|
+
...(opts.fetch ? { fetch: opts.fetch } : {}),
|
|
59
|
+
...(opts.now ? { now: opts.now } : {}),
|
|
60
|
+
executor: opts.executor ?? { execute: async (ctx) => ctx.reject([{ text: REFUSES_PLAIN }]) },
|
|
61
|
+
// A delegated task is the RUNTIME's: it keeps its id, its states and its gates.
|
|
62
|
+
beforeSend: async ({ message, configuration }, principal) => {
|
|
63
|
+
const ext = readDelegatedTask(message);
|
|
64
|
+
if (ext === null)
|
|
65
|
+
return null; // an ordinary conversation
|
|
66
|
+
if ('error' in ext)
|
|
67
|
+
throw new A2aError(JSONRPC_ERROR.InvalidParams, ext.error);
|
|
68
|
+
// The caller at the door and the party the grant names must be the same agent. The runtime checks
|
|
69
|
+
// this too (delegate === requester); doing it here as well means an impostor never reaches it.
|
|
70
|
+
if (principal && ext.requester.toLowerCase() !== principal.agent.toLowerCase()) {
|
|
71
|
+
throw new A2aError(JSONRPC_ERROR.InvalidParams, `the delegated task names ${ext.requester} as its requester; you are calling as ${principal.agent}`);
|
|
72
|
+
}
|
|
73
|
+
const profileMessage = toProfileMessage(message, ext);
|
|
74
|
+
const params = {
|
|
75
|
+
// The wire carries `salt` as a decimal string; the runtime hashes a bigint.
|
|
76
|
+
delegation: wireToDelegation(ext.delegation),
|
|
77
|
+
requester: ext.requester,
|
|
78
|
+
message: profileMessage,
|
|
79
|
+
input: delegatedInput(message),
|
|
80
|
+
...(configuration?.taskPushNotificationConfig?.url ? { pushConfig: { url: configuration.taskPushNotificationConfig.url, ...(configuration.taskPushNotificationConfig.token ? { token: configuration.taskPushNotificationConfig.token } : {}) } } : {}),
|
|
81
|
+
};
|
|
82
|
+
const r = ext.taskId
|
|
83
|
+
? await opts.agent.resubmit({ ...params, taskId: ext.taskId })
|
|
84
|
+
: await opts.agent.messageSend(params);
|
|
85
|
+
if (!r.ok)
|
|
86
|
+
throw new A2aError(r.code === -32001 ? JSONRPC_ERROR.InvalidParams : r.code, r.message);
|
|
87
|
+
const rec = await opts.runtimeStore.get(r.result.taskId);
|
|
88
|
+
// The projection is the answer; falling back to a synthetic task would report a state nothing holds.
|
|
89
|
+
if (!rec)
|
|
90
|
+
throw new A2aError(A2A_ERROR.InvalidAgentResponse, `the runtime accepted task ${r.result.taskId} and the store does not hold it`);
|
|
91
|
+
return { task: recordAsV1(rec) };
|
|
92
|
+
},
|
|
93
|
+
onCancel: async (task, principal) => {
|
|
94
|
+
if (!isPartyToDelegatedTask(task, principal?.agent))
|
|
95
|
+
return null; // not the runtime's — the ordinary path
|
|
96
|
+
// The door authenticated this caller; the runtime re-runs the party test and nothing else.
|
|
97
|
+
const r = await opts.agent.tasksCancelAs({ taskId: task.id, caller: principal.agent });
|
|
98
|
+
if (!r.ok)
|
|
99
|
+
throw new A2aError(r.code, r.message);
|
|
100
|
+
const rec = await opts.runtimeStore.get(task.id);
|
|
101
|
+
return rec ? recordAsV1(rec) : null;
|
|
102
|
+
},
|
|
103
|
+
canSeeTask: async (task, principal, op) => {
|
|
104
|
+
const delegated = task.metadata?.[AP_DELEGATED_TASK_EXTENSION] !== undefined;
|
|
105
|
+
if (delegated)
|
|
106
|
+
return isPartyToDelegatedTask(task, principal?.agent);
|
|
107
|
+
return opts.canSeeOwnTask ? (await opts.canSeeOwnTask(task, principal)) === true : opts.visibility === 'single-tenant';
|
|
108
|
+
},
|
|
109
|
+
// THE ARTIFACT BODY READ (the extension's one method). The profile's `tasks/artifact` was the only wire path
|
|
110
|
+
// to a body — the projection carries a ref and a hash, never the body (A2A-INV-04) — and the fold dropped it
|
|
111
|
+
// without a 1.0 successor; the skills corpus agent, which reads the documents its dispatched tasks produce,
|
|
112
|
+
// was the consumer that found out. The door's principal must be a PARTY (sender or assignee, the runtime's
|
|
113
|
+
// own test); an unauthenticated caller, a non-party, and an artifact of another task all read as not found.
|
|
114
|
+
methods: {
|
|
115
|
+
// Spec 445 §9 decision 8 — THE PAYMENT RESUME on the wire. A payment-parked task waits for exactly the payment its
|
|
116
|
+
// record names (`x402.payment.awaited`); the payer presents the settlement here and the runtime decides —
|
|
117
|
+
// terms match, the gate verifies the proof, the settlement and the park are each consumed once. Anything else
|
|
118
|
+
// leaves the task parked; the refusal says only that it was refused.
|
|
119
|
+
[SETTLE_TASK_PAYMENT_METHOD]: async (params) => {
|
|
120
|
+
const id = String(params.id ?? params.taskId ?? '');
|
|
121
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(id) || !params.settlement || typeof params.settlement !== 'object')
|
|
122
|
+
throw new A2aError(JSONRPC_ERROR.InvalidParams, `${SETTLE_TASK_PAYMENT_METHOD} takes { id, settlement: { reference, amount, asset, payee, proof } }`);
|
|
123
|
+
const r = await opts.agent.settlePayment({ taskId: id, settlement: params.settlement });
|
|
124
|
+
if (!r.ok)
|
|
125
|
+
throw new A2aError(r.code === -32004 ? A2A_ERROR.TaskNotFound : JSONRPC_ERROR.InvalidParams, r.message);
|
|
126
|
+
const rec = await opts.runtimeStore.get(id);
|
|
127
|
+
return rec ? recordAsV1(rec) : { id, state: r.result.state };
|
|
128
|
+
},
|
|
129
|
+
[GET_TASK_ARTIFACT_METHOD]: async (params, principal) => {
|
|
130
|
+
const id = String(params.id ?? params.taskId ?? '');
|
|
131
|
+
const artifactId = String(params.artifactId ?? '');
|
|
132
|
+
if (!/^0x[0-9a-fA-F]{64}$/.test(id) || !artifactId)
|
|
133
|
+
throw new A2aError(JSONRPC_ERROR.InvalidParams, 'GetTaskArtifact takes { id, artifactId }');
|
|
134
|
+
if (!principal?.agent)
|
|
135
|
+
throw new A2aError(A2A_ERROR.TaskNotFound, undefined, { id });
|
|
136
|
+
const r = await opts.agent.tasksArtifactAs({ taskId: id, artifactId: artifactId, caller: principal.agent });
|
|
137
|
+
if (!r.ok)
|
|
138
|
+
throw new A2aError(A2A_ERROR.TaskNotFound, undefined, { id });
|
|
139
|
+
return {
|
|
140
|
+
artifactId: r.result.artifactId,
|
|
141
|
+
...(r.result.artifactKind ? { name: r.result.artifactKind } : {}),
|
|
142
|
+
parts: [{ data: r.result.body ?? null }],
|
|
143
|
+
metadata: { bodyRef: r.result.bodyRef, residency: 'vault' },
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=from-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-agent.js","sourceRoot":"","sources":["../../src/standard/from-agent.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,2BAA2B,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,cAAc,EAAE,iBAAiB,EACvH,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,GAC5D,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,qBAAqB,EAAE,uBAAuB,GAE/C,MAAM,aAAa,CAAC;AAGrB,2GAA2G;AAC3G,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAA4B,CAAC;AAEvE,mDAAmD;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAa,EAAU,EAAE,CAAC,iBAAiB,CAAC;IACrE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE;IAC9H,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK;IACxD,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,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I,IAAI,IAAI,EAAE,CAAC;oBACxC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE;iBAC5D,CAAC;YACJ,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './errors.js';
|
|
3
|
+
export * from './server.js';
|
|
4
|
+
export * from './push-url-policy.js';
|
|
5
|
+
export * from './caller.js';
|
|
6
|
+
export * from './delegated.js';
|
|
7
|
+
export * from './from-agent.js';
|
|
8
|
+
export * from './client.js';
|
|
9
|
+
export * from './outbound-fetch.js';
|
|
10
|
+
export * from './mount.js';
|
|
11
|
+
export * from './app-delegation.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standard/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAE5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAE5B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @agenticprimitives/a2a/standard — the A2A 1.0 standard surface (spec 372 S1), beside the delegation
|
|
2
|
+
// profile at the package root. A door for every A2A 1.0 client and the official TCK; never a grant.
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export * from './errors.js';
|
|
5
|
+
export * from './server.js';
|
|
6
|
+
// Spec 445 §3.5 — where a push notification may go (the shipped URL policy and the store/deliver check).
|
|
7
|
+
export * from './push-url-policy.js';
|
|
8
|
+
export * from './caller.js';
|
|
9
|
+
export * from './delegated.js';
|
|
10
|
+
export * from './from-agent.js';
|
|
11
|
+
export * from './client.js';
|
|
12
|
+
// Spec 445 W0 (RUN-16 / RUNB-9) — bounded outbound card/agent calls and where a credential may go.
|
|
13
|
+
export * from './outbound-fetch.js';
|
|
14
|
+
// Spec 372 S2/S4, spec 399 §4 — mounting this surface in front of a harness: card fields, task-id shape, the
|
|
15
|
+
// one task view, the two admission schemes, delegated/engagement dispatch, the reply-kind → state table.
|
|
16
|
+
export * from './mount.js';
|
|
17
|
+
export * from './app-delegation.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standard/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,oGAAoG;AACpG,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,yGAAyG;AACzG,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,mGAAmG;AACnG,cAAc,qBAAqB,CAAC;AACpC,6GAA6G;AAC7G,yGAAyG;AACzG,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { ExecutionContext, Principal, StandardServerConfig, StandardTaskStore } from './server.js';
|
|
3
|
+
import type { PartV1, TaskV1 } from './types.js';
|
|
4
|
+
/** The delegation runtime mints 32-byte hex task ids; a standard server's own conversational tasks are
|
|
5
|
+
* uuids. That is how a read knows which side holds a task — the shape is minted, not guessed. */
|
|
6
|
+
export declare const isRuntimeTaskId: (id: unknown) => boolean;
|
|
7
|
+
/** The text of a message's parts, joined; `data` parts that are strings count as text. */
|
|
8
|
+
export declare const partsText: (parts: PartV1[]) => string;
|
|
9
|
+
/** The first structured `data` part, or null. */
|
|
10
|
+
export declare const partsData: (parts: PartV1[]) => Record<string, unknown> | null;
|
|
11
|
+
/** Spec 390 W2 — the W3C Trace Context a request arrived with, as headers to forward on the next hop so the
|
|
12
|
+
* run's record keeps it. Ids only: nothing admits on these. */
|
|
13
|
+
export declare function traceHeadersOf(h: Headers): Record<string, string>;
|
|
14
|
+
export interface StandardCardFieldsOpts {
|
|
15
|
+
/** Where this surface takes A2A 1.0 JSON-RPC. */
|
|
16
|
+
messageUrl: string;
|
|
17
|
+
/** The card extensions this surface admits (default: the delegated-task and engagement extensions). */
|
|
18
|
+
extensions?: Array<{
|
|
19
|
+
uri: string;
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
/** The bearer scheme a person presents (default: a Home session — it names the asking person and grants nothing). */
|
|
23
|
+
bearer?: {
|
|
24
|
+
name: string;
|
|
25
|
+
bearerFormat: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Spec 445 §3.5 (H-11) — the host OPTS IN to push notifications; default off. Push makes this server POST
|
|
30
|
+
* to an address a caller names, so a host says yes only when it has bound an admitting `principal`, a
|
|
31
|
+
* `canSeeTask` that answers the `push` op, and (where it can resolve DNS) `resolveHost` on the server.
|
|
32
|
+
* Whatever the live card said is not consulted: the flag describes THIS surface.
|
|
33
|
+
*/
|
|
34
|
+
pushNotifications?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The 1.0 fields a live card needs on top of what a runtime already builds: an interface with a protocol
|
|
38
|
+
* version, input/output modes, skills with names, the extensions this surface admits and the bearer scheme.
|
|
39
|
+
* Additive — every field the card carried stays; a released card (spec 347 §8) is served byte-for-byte and
|
|
40
|
+
* never passes through here.
|
|
41
|
+
*/
|
|
42
|
+
export declare function withStandardCardFields(live: Record<string, unknown>, opts: StandardCardFieldsOpts): Record<string, unknown>;
|
|
43
|
+
/** A JSON-RPC call forwarded to the agent's own delegation runtime; the response comes back verbatim. */
|
|
44
|
+
export type DelegatedRpc = (agent: Address, rpc: unknown, principal: Principal | null) => Promise<{
|
|
45
|
+
result?: unknown;
|
|
46
|
+
error?: {
|
|
47
|
+
code: number;
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* ONE TASK VIEW over two stores (spec 372 S4): a 32-byte hex id can only be the runtime's, so a read asks
|
|
53
|
+
* the object that owns it; anything else is a conversation this server made. A caller cannot tell, and
|
|
54
|
+
* must not have to. Writes go to the local store only — a delegated task is the runtime's to write.
|
|
55
|
+
*/
|
|
56
|
+
export declare function runtimeBackedTaskStore(input: {
|
|
57
|
+
local: StandardTaskStore;
|
|
58
|
+
agent: Address;
|
|
59
|
+
rpc: DelegatedRpc;
|
|
60
|
+
}): StandardTaskStore;
|
|
61
|
+
/**
|
|
62
|
+
* What runs in front of `SendMessage` and `CancelTask` when the agent has a delegation runtime and/or answers
|
|
63
|
+
* engagement probes. A message carrying the DELEGATED-TASK extension is forwarded to the runtime, which keeps
|
|
64
|
+
* its own task id (two ids for one task would make `GetTask` a coin toss). An engagement PROBE is answered
|
|
65
|
+
* with a MESSAGE and no task (spec 336 §5) — the provider's own document — and only for a known caller who is
|
|
66
|
+
* the requester it names, addressed to this agent. A malformed engagement document is refused, never ignored.
|
|
67
|
+
*/
|
|
68
|
+
export declare function delegatedDispatch(input: {
|
|
69
|
+
agent: Address;
|
|
70
|
+
rpc?: DelegatedRpc;
|
|
71
|
+
answerProbe?: (input: {
|
|
72
|
+
agent: Address;
|
|
73
|
+
probe: Record<string, unknown>;
|
|
74
|
+
caller: Principal | null;
|
|
75
|
+
}) => Promise<Record<string, unknown>>;
|
|
76
|
+
}): Pick<StandardServerConfig, 'beforeSend' | 'onCancel'>;
|
|
77
|
+
/** A delegated task is visible to its parties; a conversation, to whoever had it (its `asker`). A task
|
|
78
|
+
* nobody claimed is NOBODY'S (R917-P-6, spec 408 §2.6): the old "single-tenant shape" made every
|
|
79
|
+
* asker-less task world-readable, and a runtime with two tenants is not single-tenant. Compared
|
|
80
|
+
* lowercased on both sides — the caller assertion lowercases the agent (`caller.ts`), a task's
|
|
81
|
+
* metadata may not. */
|
|
82
|
+
export declare function canSeeDelegatedOrOwnTask(task: TaskV1, principal: Principal | null): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* TWO SCHEMES, ONE MECHANISM EACH (ADR-0013). `Bearer` is a PERSON's session; `A2A-Session` is an AGENT's
|
|
85
|
+
* session wire, verified on chain per request (spec 372 S3c). The scheme token selects which runs — neither
|
|
86
|
+
* is ever tried because the other failed, and each fails closed on its own terms. `first` is the product's
|
|
87
|
+
* own door (an in-process marker, say): it answers a principal, `null` to refuse, or `undefined` to say the
|
|
88
|
+
* request is not its to judge.
|
|
89
|
+
*/
|
|
90
|
+
export declare function principalBySchemes(input: {
|
|
91
|
+
bearer: (token: string) => Promise<Principal | null>;
|
|
92
|
+
wire?: ((request: Request) => Promise<Principal | null>) | null;
|
|
93
|
+
first?: (request: Request) => Principal | null | undefined;
|
|
94
|
+
}): (request: Request) => Promise<Principal | null>;
|
|
95
|
+
/** The task state a harness reply's KIND maps to (spec 372 S4): a question parks as INPUT_REQUIRED, an act
|
|
96
|
+
* that needs a mandate as AUTH_REQUIRED, an answer or a done act completes, a refusal rejects, an error fails. */
|
|
97
|
+
export type ReplySettlement = 'completed' | 'input-required' | 'auth-required' | 'rejected' | 'failed';
|
|
98
|
+
export declare function settlementForReplyKind(kind: string | undefined): ReplySettlement;
|
|
99
|
+
/** Move the task to a settlement with the given parts. */
|
|
100
|
+
export declare function settleTask(ctx: ExecutionContext, settlement: ReplySettlement, parts: PartV1[]): Promise<void>;
|
|
101
|
+
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/standard/mount.ts"],"names":[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C,CAAC,GAAG,IAAI,CAAC;IAChE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5D,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAUlD;AAED;mHACmH;AACnH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,gBAAgB,GAAG,eAAe,GAAG,UAAU,GAAG,QAAQ,CAAC;AACvG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,CAShF;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ7G"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { AP_ENGAGEMENT_EXTENSION_URI, ENGAGEMENT_CARD_EXTENSION, engagementOf, engagementResponseMessage } from '../engagement.js';
|
|
2
|
+
import { AP_DELEGATED_TASK_EXTENSION, DELEGATED_TASK_CARD_EXTENSION, isPartyToDelegatedTask, readDelegatedTask } from './delegated.js';
|
|
3
|
+
/** The delegation runtime mints 32-byte hex task ids; a standard server's own conversational tasks are
|
|
4
|
+
* uuids. That is how a read knows which side holds a task — the shape is minted, not guessed. */
|
|
5
|
+
export const isRuntimeTaskId = (id) => typeof id === 'string' && /^0x[0-9a-fA-F]{64}$/.test(id);
|
|
6
|
+
/** The text of a message's parts, joined; `data` parts that are strings count as text. */
|
|
7
|
+
export const partsText = (parts) => parts.map((p) => (typeof p.text === 'string' ? p.text : typeof p.data === 'string' ? p.data : '')).filter(Boolean).join('\n').trim();
|
|
8
|
+
/** The first structured `data` part, or null. */
|
|
9
|
+
export const partsData = (parts) => { const d = parts.find((p) => p.data && typeof p.data === 'object' && !Array.isArray(p.data)); return d ? d.data : null; };
|
|
10
|
+
/** Spec 390 W2 — the W3C Trace Context a request arrived with, as headers to forward on the next hop so the
|
|
11
|
+
* run's record keeps it. Ids only: nothing admits on these. */
|
|
12
|
+
export function traceHeadersOf(h) {
|
|
13
|
+
const out = {};
|
|
14
|
+
const tp = h.get('traceparent');
|
|
15
|
+
const ts = h.get('tracestate');
|
|
16
|
+
if (tp)
|
|
17
|
+
out.traceparent = tp;
|
|
18
|
+
if (ts)
|
|
19
|
+
out.tracestate = ts;
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The 1.0 fields a live card needs on top of what a runtime already builds: an interface with a protocol
|
|
24
|
+
* version, input/output modes, skills with names, the extensions this surface admits and the bearer scheme.
|
|
25
|
+
* Additive — every field the card carried stays; a released card (spec 347 §8) is served byte-for-byte and
|
|
26
|
+
* never passes through here.
|
|
27
|
+
*/
|
|
28
|
+
export function withStandardCardFields(live, opts) {
|
|
29
|
+
const skills = (Array.isArray(live.skills) ? live.skills : []);
|
|
30
|
+
const caps = (live.capabilities && typeof live.capabilities === 'object' ? live.capabilities : {});
|
|
31
|
+
const extensions = opts.extensions ?? [{ ...DELEGATED_TASK_CARD_EXTENSION }, { ...ENGAGEMENT_CARD_EXTENSION }];
|
|
32
|
+
const ours = new Set(extensions.map((e) => e.uri));
|
|
33
|
+
const bearer = opts.bearer ?? { name: 'homeSession', bearerFormat: 'home-session', description: 'A Home session presented as a bearer names the asking person; it grants nothing (spec 372 §0).' };
|
|
34
|
+
return {
|
|
35
|
+
...live,
|
|
36
|
+
protocolVersion: '1.0',
|
|
37
|
+
supportedInterfaces: [{ url: opts.messageUrl, protocolBinding: 'JSONRPC', protocolVersion: '1.0' }],
|
|
38
|
+
// Honest flags: the standard server streams (SSE); it delivers push only where the host opted in (spec
|
|
39
|
+
// 445 §3.5 — never forced on) — the flags describe the surface a 1.0 client reaches by these methods.
|
|
40
|
+
capabilities: {
|
|
41
|
+
...caps, streaming: true, pushNotifications: opts.pushNotifications === true, extendedAgentCard: false,
|
|
42
|
+
// The card SAYS how to authorize a task, so a peer learns it before calling rather than by failing.
|
|
43
|
+
extensions: [
|
|
44
|
+
...(caps.extensions ?? []).filter((e) => !ours.has(e.uri) && e.uri !== AP_DELEGATED_TASK_EXTENSION && e.uri !== AP_ENGAGEMENT_EXTENSION_URI),
|
|
45
|
+
...extensions,
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
defaultInputModes: ['text/plain', 'application/json'],
|
|
49
|
+
defaultOutputModes: ['text/plain', 'application/json'],
|
|
50
|
+
skills: skills.map((s) => ({ id: s.id, name: s.name ?? s.id, description: s.description ?? s.name ?? s.id, tags: s.tags ?? [] })),
|
|
51
|
+
securitySchemes: { ...(live.securitySchemes ?? {}), [bearer.name]: { httpAuthSecurityScheme: { scheme: 'bearer', bearerFormat: bearer.bearerFormat, description: bearer.description } } },
|
|
52
|
+
securityRequirements: [{ schemes: { [bearer.name]: { list: [] } } }],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* ONE TASK VIEW over two stores (spec 372 S4): a 32-byte hex id can only be the runtime's, so a read asks
|
|
57
|
+
* the object that owns it; anything else is a conversation this server made. A caller cannot tell, and
|
|
58
|
+
* must not have to. Writes go to the local store only — a delegated task is the runtime's to write.
|
|
59
|
+
*/
|
|
60
|
+
export function runtimeBackedTaskStore(input) {
|
|
61
|
+
const { local, agent, rpc } = input;
|
|
62
|
+
return {
|
|
63
|
+
async get(id) {
|
|
64
|
+
if (!isRuntimeTaskId(id))
|
|
65
|
+
return local.get(id);
|
|
66
|
+
const r = await rpc(agent, { jsonrpc: '2.0', id: 1, method: 'GetTask', params: { id } }, null).catch(() => null);
|
|
67
|
+
return r?.result ?? null;
|
|
68
|
+
},
|
|
69
|
+
put: (t) => local.put(t),
|
|
70
|
+
async all() {
|
|
71
|
+
const own = await local.all();
|
|
72
|
+
const r = await rpc(agent, { jsonrpc: '2.0', id: 1, method: 'ListTasks', params: {} }, null).catch(() => null);
|
|
73
|
+
const theirs = (r?.result?.tasks ?? []);
|
|
74
|
+
return [...theirs, ...own];
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const a2aError = (message, code) => Object.assign(new Error(message), { code, name: 'A2aError' });
|
|
79
|
+
/**
|
|
80
|
+
* What runs in front of `SendMessage` and `CancelTask` when the agent has a delegation runtime and/or answers
|
|
81
|
+
* engagement probes. A message carrying the DELEGATED-TASK extension is forwarded to the runtime, which keeps
|
|
82
|
+
* its own task id (two ids for one task would make `GetTask` a coin toss). An engagement PROBE is answered
|
|
83
|
+
* with a MESSAGE and no task (spec 336 §5) — the provider's own document — and only for a known caller who is
|
|
84
|
+
* the requester it names, addressed to this agent. A malformed engagement document is refused, never ignored.
|
|
85
|
+
*/
|
|
86
|
+
export function delegatedDispatch(input) {
|
|
87
|
+
const { agent, rpc, answerProbe } = input;
|
|
88
|
+
if (!rpc && !answerProbe)
|
|
89
|
+
return {};
|
|
90
|
+
return {
|
|
91
|
+
beforeSend: async ({ message, configuration }, principal) => {
|
|
92
|
+
const eng = engagementOf(message);
|
|
93
|
+
if (eng && 'errors' in eng)
|
|
94
|
+
throw a2aError(`the engagement document is malformed: ${eng.errors.join('; ')}`, -32602);
|
|
95
|
+
if (eng && 'probe' in eng) {
|
|
96
|
+
if (!answerProbe)
|
|
97
|
+
throw a2aError('this agent does not answer engagement probes here', -32601);
|
|
98
|
+
if (!principal)
|
|
99
|
+
throw a2aError('a probe names its requester, and the caller must be known', -32001);
|
|
100
|
+
if (String(eng.probe.requester).toLowerCase() !== principal.agent.toLowerCase())
|
|
101
|
+
throw a2aError('the probe names a requester other than its caller', -32602);
|
|
102
|
+
if (String(eng.probe.candidate).toLowerCase() !== agent.toLowerCase())
|
|
103
|
+
throw a2aError('the probe is addressed to another agent', -32602);
|
|
104
|
+
const response = await answerProbe({ agent, probe: eng.probe, caller: principal });
|
|
105
|
+
return { message: engagementResponseMessage(response) };
|
|
106
|
+
}
|
|
107
|
+
if (eng && 'response' in eng)
|
|
108
|
+
throw a2aError('an engagement response is read by the requester that probed, not sent to it as a new message', -32602);
|
|
109
|
+
if (!rpc)
|
|
110
|
+
return null;
|
|
111
|
+
const ext = readDelegatedTask(message);
|
|
112
|
+
if (ext === null)
|
|
113
|
+
return null;
|
|
114
|
+
const r = await rpc(agent, { jsonrpc: '2.0', id: 1, method: 'SendMessage', params: { message, ...(configuration ? { configuration } : {}) } }, principal);
|
|
115
|
+
if (r.error)
|
|
116
|
+
throw a2aError(r.error.message, r.error.code);
|
|
117
|
+
return r.result ?? null;
|
|
118
|
+
},
|
|
119
|
+
onCancel: async (task, principal) => {
|
|
120
|
+
if (!isRuntimeTaskId(task.id) || !rpc)
|
|
121
|
+
return null;
|
|
122
|
+
const r = await rpc(agent, { jsonrpc: '2.0', id: 1, method: 'CancelTask', params: { id: task.id } }, principal);
|
|
123
|
+
if (r.error)
|
|
124
|
+
throw a2aError(r.error.message, r.error.code);
|
|
125
|
+
return r.result ?? null;
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/** A delegated task is visible to its parties; a conversation, to whoever had it (its `asker`). A task
|
|
130
|
+
* nobody claimed is NOBODY'S (R917-P-6, spec 408 §2.6): the old "single-tenant shape" made every
|
|
131
|
+
* asker-less task world-readable, and a runtime with two tenants is not single-tenant. Compared
|
|
132
|
+
* lowercased on both sides — the caller assertion lowercases the agent (`caller.ts`), a task's
|
|
133
|
+
* metadata may not. */
|
|
134
|
+
export function canSeeDelegatedOrOwnTask(task, principal) {
|
|
135
|
+
const delegated = task.metadata?.[AP_DELEGATED_TASK_EXTENSION] !== undefined;
|
|
136
|
+
if (delegated)
|
|
137
|
+
return isPartyToDelegatedTask(task, principal?.agent);
|
|
138
|
+
const asker = task.metadata?.asker;
|
|
139
|
+
if (typeof asker !== 'string' || !asker || !principal?.agent)
|
|
140
|
+
return false;
|
|
141
|
+
return asker.toLowerCase() === principal.agent.toLowerCase();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* TWO SCHEMES, ONE MECHANISM EACH (ADR-0013). `Bearer` is a PERSON's session; `A2A-Session` is an AGENT's
|
|
145
|
+
* session wire, verified on chain per request (spec 372 S3c). The scheme token selects which runs — neither
|
|
146
|
+
* is ever tried because the other failed, and each fails closed on its own terms. `first` is the product's
|
|
147
|
+
* own door (an in-process marker, say): it answers a principal, `null` to refuse, or `undefined` to say the
|
|
148
|
+
* request is not its to judge.
|
|
149
|
+
*/
|
|
150
|
+
export function principalBySchemes(input) {
|
|
151
|
+
return async (request) => {
|
|
152
|
+
const own = input.first?.(request);
|
|
153
|
+
if (own !== undefined)
|
|
154
|
+
return own;
|
|
155
|
+
const auth = request.headers.get('authorization') ?? '';
|
|
156
|
+
if (/^A2A-Session\s/i.test(auth))
|
|
157
|
+
return input.wire ? input.wire(request) : null;
|
|
158
|
+
const token = /^Bearer\s+(.+)$/i.exec(auth)?.[1]?.trim();
|
|
159
|
+
if (!token)
|
|
160
|
+
return null;
|
|
161
|
+
return input.bearer(token).catch(() => null);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export function settlementForReplyKind(kind) {
|
|
165
|
+
switch (kind) {
|
|
166
|
+
case 'answer':
|
|
167
|
+
case 'done': return 'completed';
|
|
168
|
+
case 'prompt': return 'input-required';
|
|
169
|
+
case 'authority_required': return 'auth-required';
|
|
170
|
+
case 'refused':
|
|
171
|
+
case 'denied': return 'rejected';
|
|
172
|
+
case 'error': return 'failed';
|
|
173
|
+
default: return 'completed';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/** Move the task to a settlement with the given parts. */
|
|
177
|
+
export function settleTask(ctx, settlement, parts) {
|
|
178
|
+
switch (settlement) {
|
|
179
|
+
case 'completed': return ctx.complete(parts);
|
|
180
|
+
case 'input-required': return ctx.inputRequired(parts);
|
|
181
|
+
case 'auth-required': return ctx.authRequired(parts);
|
|
182
|
+
case 'rejected': return ctx.reject(parts);
|
|
183
|
+
case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AC,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,gBAAgB,CAAC,CAAC,OAAO,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvD,KAAK,eAAe,CAAC,CAAC,OAAO,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACrD,KAAK,UAAU,CAAC,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1C,KAAK,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type PushHostResolver, type PushUrlPolicy } from './push-url-policy.js';
|
|
2
|
+
export declare const OUTBOUND_CARD_MAX_BYTES: number;
|
|
3
|
+
export declare const OUTBOUND_REPLY_MAX_BYTES: number;
|
|
4
|
+
export declare const OUTBOUND_TIMEOUT_MS = 15000;
|
|
5
|
+
export interface OutboundFetchLimits {
|
|
6
|
+
/** Whole-call deadline in ms (default `OUTBOUND_TIMEOUT_MS`). */
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
/** Largest body read, in bytes (default per call site: a card, or a reply). */
|
|
9
|
+
maxBytes?: number;
|
|
10
|
+
/** The URL judgement (default `defaultPushUrlPolicy`). A deployment that must reach a private peer says so here. */
|
|
11
|
+
urlPolicy?: PushUrlPolicy;
|
|
12
|
+
/** RUN-16 residual — resolve the URL's host name; EVERY address must be public (loopback, link-local / metadata,
|
|
13
|
+
* private, CGNAT, … refused). A failing or empty resolver is a refusal. Not consulted for an IP-literal host. */
|
|
14
|
+
resolveHost?: PushHostResolver;
|
|
15
|
+
/** RUN-16 residual — true ⇒ a host name is fetched only after `resolveHost` judged it; no resolver ⇒ refused.
|
|
16
|
+
* Default false: without a resolver the literal-host policy is the whole check (enough on a Worker, whose
|
|
17
|
+
* outbound fetch cannot reach private ranges; not enough on a host inside a private network). */
|
|
18
|
+
requireResolution?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** RUN-16 residual — how much the caller relies on a fetched card. */
|
|
21
|
+
export interface CardTrustOptions {
|
|
22
|
+
/** The caller routes on, or takes authority from, this card (its endpoint receives a credential or an act). Then an
|
|
23
|
+
* unpinned card must carry a signature `verifyCardSignature` accepts — otherwise it is refused. */
|
|
24
|
+
relyOnCard?: boolean;
|
|
25
|
+
/** Verify the card's signature (JWS / RFC 8785 over the card) against the key the agent's ON-CHAIN record binds.
|
|
26
|
+
* `raw` is the card's bytes as served. true ⇒ verified; false or a throw ⇒ refused. */
|
|
27
|
+
verifyCardSignature?: (card: unknown, raw: string) => Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
/** RUN-16 residual — why a card may not be relied on, or null when it may (or the caller does not rely on it).
|
|
30
|
+
* A pinned card is the name's word already; an unpinned one needs a verified signature. A verifier that is
|
|
31
|
+
* supplied is always run, relied on or not: a card that fails its signature is never used. */
|
|
32
|
+
export declare function cardTrustRefusal(card: unknown, raw: string, pinned: boolean, trust?: CardTrustOptions): Promise<string | null>;
|
|
33
|
+
/** Why this URL may not be fetched — null when it may. */
|
|
34
|
+
export declare function outboundUrlRefusal(url: string, policy?: PushUrlPolicy): string | null;
|
|
35
|
+
/** RUN-16 residual — the URL policy, then (with `resolveHost`) every address the host resolves to; with
|
|
36
|
+
* `requireResolution` and no resolver, a host name is refused. Null ⇒ may be fetched. */
|
|
37
|
+
export declare function outboundUrlRefusalResolved(url: string, limits?: Pick<OutboundFetchLimits, 'urlPolicy' | 'resolveHost' | 'requireResolution'>): Promise<string | null>;
|
|
38
|
+
/** Read a body (a response's, or an inbound request's — RUN-18) as text, refusing past `maxBytes`. Counts the bytes
|
|
39
|
+
* actually received. */
|
|
40
|
+
export declare function readTextBounded(res: Pick<Response, 'headers' | 'body' | 'text'>, maxBytes: number): Promise<string>;
|
|
41
|
+
/** One bounded outbound call: URL policy, no redirects, a deadline, a size cap. Throws with the reason in words. */
|
|
42
|
+
export declare function fetchTextBounded(fetchImpl: (input: string, init: RequestInit) => Promise<Response>, url: string, init: RequestInit, limits: OutboundFetchLimits & {
|
|
43
|
+
maxBytes: number;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
res: Response;
|
|
46
|
+
text: string;
|
|
47
|
+
}>;
|
|
48
|
+
/** RUNB-9 — may a credential be sent to `endpoint`, which the card at `cardUrl` named? Only when the endpoint is on the
|
|
49
|
+
* card's own origin, or the card was pinned by digest (its content is then the name's word). Null ⇒ yes. */
|
|
50
|
+
export declare function credentialDestinationRefusal(cardUrl: string, endpoint: string, pinned: boolean): string | null;
|
|
51
|
+
//# sourceMappingURL=outbound-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-fetch.d.ts","sourceRoot":"","sources":["../../src/standard/outbound-fetch.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAsC,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErH,eAAO,MAAM,uBAAuB,QAAa,CAAC;AAClD,eAAO,MAAM,wBAAwB,QAAkB,CAAC;AACxD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oHAAoH;IACpH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B;sHACkH;IAClH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;sGAEkG;IAClG,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B;wGACoG;IACpG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;4FACwF;IACxF,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,O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