agent0-sdk 1.5.3 → 1.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.
Files changed (83) hide show
  1. package/README.md +59 -18
  2. package/dist/core/a2a-client.d.ts +109 -0
  3. package/dist/core/a2a-client.d.ts.map +1 -0
  4. package/dist/core/a2a-client.js +792 -0
  5. package/dist/core/a2a-client.js.map +1 -0
  6. package/dist/core/a2a-summary-client.d.ts +28 -0
  7. package/dist/core/a2a-summary-client.d.ts.map +1 -0
  8. package/dist/core/a2a-summary-client.js +79 -0
  9. package/dist/core/a2a-summary-client.js.map +1 -0
  10. package/dist/core/agent.d.ts +74 -3
  11. package/dist/core/agent.d.ts.map +1 -1
  12. package/dist/core/agent.js +267 -7
  13. package/dist/core/agent.js.map +1 -1
  14. package/dist/core/contracts.d.ts +5 -0
  15. package/dist/core/contracts.d.ts.map +1 -1
  16. package/dist/core/contracts.js +11 -0
  17. package/dist/core/contracts.js.map +1 -1
  18. package/dist/core/endpoint-crawler.d.ts +10 -0
  19. package/dist/core/endpoint-crawler.d.ts.map +1 -1
  20. package/dist/core/endpoint-crawler.js +59 -4
  21. package/dist/core/endpoint-crawler.js.map +1 -1
  22. package/dist/core/feedback-manager.d.ts.map +1 -1
  23. package/dist/core/feedback-manager.js +27 -32
  24. package/dist/core/feedback-manager.js.map +1 -1
  25. package/dist/core/ipfs-client.d.ts +26 -5
  26. package/dist/core/ipfs-client.d.ts.map +1 -1
  27. package/dist/core/ipfs-client.js +133 -108
  28. package/dist/core/ipfs-client.js.map +1 -1
  29. package/dist/core/sdk.d.ts +70 -3
  30. package/dist/core/sdk.d.ts.map +1 -1
  31. package/dist/core/sdk.js +158 -19
  32. package/dist/core/sdk.js.map +1 -1
  33. package/dist/core/subgraph-client.d.ts.map +1 -1
  34. package/dist/core/subgraph-client.js +16 -0
  35. package/dist/core/subgraph-client.js.map +1 -1
  36. package/dist/core/viem-chain-client.d.ts.map +1 -1
  37. package/dist/core/viem-chain-client.js +5 -4
  38. package/dist/core/viem-chain-client.js.map +1 -1
  39. package/dist/core/x402-payment.d.ts +28 -0
  40. package/dist/core/x402-payment.d.ts.map +1 -0
  41. package/dist/core/x402-payment.js +242 -0
  42. package/dist/core/x402-payment.js.map +1 -0
  43. package/dist/core/x402-request.d.ts +33 -0
  44. package/dist/core/x402-request.d.ts.map +1 -0
  45. package/dist/core/x402-request.js +195 -0
  46. package/dist/core/x402-request.js.map +1 -0
  47. package/dist/core/x402-types.d.ts +147 -0
  48. package/dist/core/x402-types.d.ts.map +1 -0
  49. package/dist/core/x402-types.js +190 -0
  50. package/dist/core/x402-types.js.map +1 -0
  51. package/dist/index.d.ts +3 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +2 -0
  54. package/dist/index.js.map +1 -1
  55. package/dist/models/a2a.d.ts +176 -0
  56. package/dist/models/a2a.d.ts.map +1 -0
  57. package/dist/models/a2a.js +5 -0
  58. package/dist/models/a2a.js.map +1 -0
  59. package/dist/models/generated/subgraph-types.d.ts +87 -26
  60. package/dist/models/generated/subgraph-types.d.ts.map +1 -1
  61. package/dist/models/index.d.ts +1 -0
  62. package/dist/models/index.d.ts.map +1 -1
  63. package/dist/models/index.js +1 -0
  64. package/dist/models/index.js.map +1 -1
  65. package/dist/models/interfaces.d.ts +16 -10
  66. package/dist/models/interfaces.d.ts.map +1 -1
  67. package/dist/models/interfaces.js.map +1 -1
  68. package/dist/utils/data-uri.d.ts +33 -0
  69. package/dist/utils/data-uri.d.ts.map +1 -0
  70. package/dist/utils/data-uri.js +157 -0
  71. package/dist/utils/data-uri.js.map +1 -0
  72. package/dist/utils/index.d.ts +2 -0
  73. package/dist/utils/index.d.ts.map +1 -1
  74. package/dist/utils/index.js +2 -0
  75. package/dist/utils/index.js.map +1 -1
  76. package/dist/utils/registration-json.d.ts +12 -0
  77. package/dist/utils/registration-json.d.ts.map +1 -0
  78. package/dist/utils/registration-json.js +67 -0
  79. package/dist/utils/registration-json.js.map +1 -0
  80. package/dist/utils/validation.d.ts.map +1 -1
  81. package/dist/utils/validation.js +4 -0
  82. package/dist/utils/validation.js.map +1 -1
  83. package/package.json +15 -3
@@ -0,0 +1,190 @@
1
+ /**
2
+ * x402 payment-required types and 402 response parsing.
3
+ */
4
+ /**
5
+ * Type guard: result is 402 response. Returns false for null/undefined.
6
+ */
7
+ export function isX402Required(result) {
8
+ return typeof result === 'object' && result !== null && 'x402Required' in result && result.x402Required === true;
9
+ }
10
+ /** True if the accept is EVM (eip155:* or numeric network). Used to filter out Solana etc. */
11
+ function isEvmAccept(a) {
12
+ const n = a.network;
13
+ if (n == null || n === '')
14
+ return true;
15
+ const s = String(n);
16
+ return /^eip155:\d+$/.test(s) || /^\d+$/.test(s);
17
+ }
18
+ /** Filter accepts to EVM-only (Solana and other non-EVM options removed). Applied when building 402 response. */
19
+ export function filterEvmAccepts(accepts) {
20
+ return accepts.filter(isEvmAccept);
21
+ }
22
+ /**
23
+ * Normalize a single accept entry from PAYMENT-REQUIRED header (amount/asset/payTo → price/token/destination).
24
+ */
25
+ function normalizeAcceptEntry(entry) {
26
+ const pr = entry.paymentRequirements || entry;
27
+ const price = pr.price ?? pr.amount ?? pr.maxAmountRequired ?? '0';
28
+ const token = pr.token ?? pr.asset ?? '';
29
+ return {
30
+ price: String(price),
31
+ token: String(token),
32
+ network: pr.network,
33
+ scheme: pr.scheme,
34
+ description: pr.description,
35
+ maxAmountRequired: pr.maxAmountRequired,
36
+ destination: pr.destination ?? pr.payTo,
37
+ asset: pr.asset,
38
+ ...entry,
39
+ };
40
+ }
41
+ function decodeBase64(b64) {
42
+ if (typeof Buffer !== 'undefined') {
43
+ return Buffer.from(b64, 'base64').toString('utf8');
44
+ }
45
+ return atob(b64);
46
+ }
47
+ function parseResourceInfo(obj) {
48
+ if (obj == null || typeof obj !== 'object' || Array.isArray(obj))
49
+ return undefined;
50
+ const r = obj;
51
+ const url = typeof r.url === 'string' ? r.url : undefined;
52
+ if (url === undefined)
53
+ return undefined;
54
+ return {
55
+ url,
56
+ description: typeof r.description === 'string' ? r.description : undefined,
57
+ mimeType: typeof r.mimeType === 'string' ? r.mimeType : undefined,
58
+ };
59
+ }
60
+ /**
61
+ * Parse PAYMENT-REQUIRED header (x402 spec: base64-encoded JSON with accepts array).
62
+ * Returns accepts, x402Version, and when present resource (v2) and error (v1).
63
+ */
64
+ export function parse402FromHeader(headerValue) {
65
+ if (!headerValue || typeof headerValue !== 'string')
66
+ return { accepts: [] };
67
+ try {
68
+ const json = JSON.parse(decodeBase64(headerValue.trim()));
69
+ if (json == null || typeof json !== 'object')
70
+ return { accepts: [] };
71
+ const list = json.accepts;
72
+ const accepts = Array.isArray(list)
73
+ ? list
74
+ .filter((e) => typeof e === 'object' && e !== null)
75
+ .map(normalizeAcceptEntry)
76
+ : [];
77
+ const x402Version = typeof json.x402Version === 'number' ? json.x402Version : undefined;
78
+ const resource = parseResourceInfo(json.resource);
79
+ const error = typeof json.error === 'string' ? json.error : undefined;
80
+ return { accepts, x402Version, resource, error };
81
+ }
82
+ catch {
83
+ return { accepts: [] };
84
+ }
85
+ }
86
+ /**
87
+ * Parse WWW-Authenticate header with x402 challenge (e.g. 402payment-test.com).
88
+ * Format: x402 address="0x...", amount="0.01", chainId="8453", token="0x..."
89
+ * Returns a single accept; amount is converted to atomic units if it looks like a decimal (USDC 6 decimals).
90
+ */
91
+ export function parse402FromWWWAuthenticate(headerValue) {
92
+ if (!headerValue || typeof headerValue !== 'string')
93
+ return { accepts: [] };
94
+ const x402Match = headerValue.match(/\bx402\s+(.+)/i);
95
+ if (!x402Match)
96
+ return { accepts: [] };
97
+ const rest = x402Match[1];
98
+ const pairs = {};
99
+ const re = /(\w+)\s*=\s*([^\s,]+|"[^"]*")/g;
100
+ let m;
101
+ while ((m = re.exec(rest)) !== null) {
102
+ const key = m[1].toLowerCase();
103
+ let val = m[2];
104
+ if (val.startsWith('"') && val.endsWith('"'))
105
+ val = val.slice(1, -1);
106
+ pairs[key] = val;
107
+ }
108
+ const address = pairs.address ?? pairs.payto;
109
+ const amount = pairs.amount ?? '0';
110
+ const chainId = pairs.chainid ?? pairs.chain_id ?? '';
111
+ const token = pairs.token ?? pairs.asset ?? '';
112
+ if (!address || !token)
113
+ return { accepts: [] };
114
+ // If amount looks like decimal (e.g. "0.01"), assume USDC 6 decimals for atomic units
115
+ let price = amount;
116
+ if (/^\d*\.\d+$/.test(amount)) {
117
+ const n = parseFloat(amount);
118
+ if (Number.isFinite(n))
119
+ price = String(Math.round(n * 1e6));
120
+ }
121
+ const networkStr = chainId ? (chainId.includes(':') ? chainId : `eip155:${chainId}`) : undefined;
122
+ const accept = {
123
+ price,
124
+ token,
125
+ destination: address,
126
+ payTo: address,
127
+ network: networkStr,
128
+ scheme: 'exact',
129
+ };
130
+ // Servers that advertise chainId (e.g. 402payment-test.com) often expect v2 (PAYMENT-SIGNATURE + CAIP-2).
131
+ const x402Version = networkStr && /^eip155:\d+$/.test(networkStr) ? 2 : 1;
132
+ return { accepts: [accept], x402Version };
133
+ }
134
+ /**
135
+ * Parse 402 response body (JSON with accepts array). Used when server sends payment options in body (e.g. httpay.xyz).
136
+ * Returns accepts, x402Version, and when present resource (v2) and error (v1).
137
+ */
138
+ export function parse402FromBody(bodyText) {
139
+ if (!bodyText || typeof bodyText !== 'string')
140
+ return { accepts: [] };
141
+ try {
142
+ const json = JSON.parse(bodyText.trim());
143
+ if (json == null || typeof json !== 'object')
144
+ return { accepts: [] };
145
+ const list = json.accepts;
146
+ const accepts = Array.isArray(list)
147
+ ? list
148
+ .filter((e) => typeof e === 'object' && e !== null)
149
+ .map(normalizeAcceptEntry)
150
+ : [];
151
+ const x402Version = typeof json.x402Version === 'number' ? json.x402Version : undefined;
152
+ const resource = parseResourceInfo(json.resource);
153
+ const error = typeof json.error === 'string' ? json.error : undefined;
154
+ return { accepts, x402Version, resource, error };
155
+ }
156
+ catch {
157
+ return { accepts: [] };
158
+ }
159
+ }
160
+ /**
161
+ * Parse PAYMENT-REQUIRED header (x402 spec: base64-encoded JSON with accepts array).
162
+ * Server sends payment options in header; body may be empty. Returns [] if header missing/invalid.
163
+ */
164
+ export function parse402AcceptsFromHeader(headerValue) {
165
+ return parse402FromHeader(headerValue).accepts;
166
+ }
167
+ /**
168
+ * Parse PAYMENT-RESPONSE header (base64-encoded JSON) after successful pay.
169
+ * Returns settlement info (success, transaction, network, payer) when present and valid.
170
+ */
171
+ export function parse402SettlementFromHeader(headerValue) {
172
+ if (!headerValue || typeof headerValue !== 'string')
173
+ return undefined;
174
+ try {
175
+ const json = JSON.parse(decodeBase64(headerValue.trim()));
176
+ if (json == null || typeof json !== 'object')
177
+ return undefined;
178
+ return {
179
+ success: json.success === true,
180
+ errorReason: typeof json.errorReason === 'string' ? json.errorReason : undefined,
181
+ transaction: typeof json.transaction === 'string' ? json.transaction : undefined,
182
+ network: typeof json.network === 'string' ? json.network : undefined,
183
+ payer: typeof json.payer === 'string' ? json.payer : undefined,
184
+ };
185
+ }
186
+ catch {
187
+ return undefined;
188
+ }
189
+ }
190
+ //# sourceMappingURL=x402-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x402-types.js","sourceRoot":"","sources":["../../src/core/x402-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2FH;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA+C;IAE/C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,cAAc,IAAI,MAAM,IAAK,MAAkC,CAAC,YAAY,KAAK,IAAI,CAAC;AAChJ,CAAC;AAED,8FAA8F;AAC9F,SAAS,WAAW,CAAC,CAAa;IAChC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;IACpB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACvC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,cAAc,CAAC,IAAI,CAAC,C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B,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './utils/index.js';
7
7
  export { SDK } from './core/sdk.js';
8
8
  export type { SDKConfig } from './core/sdk.js';
9
9
  export { Agent } from './core/agent.js';
10
+ export { A2AClientFromSummary } from './core/a2a-summary-client.js';
10
11
  export { ViemChainClient } from './core/viem-chain-client.js';
11
12
  export type { ChainClient, TransactionOptions } from './core/chain-client.js';
12
13
  export { IPFSClient } from './core/ipfs-client.js';
@@ -19,4 +20,6 @@ export { AgentIndexer } from './core/indexer.js';
19
20
  export { TransactionHandle } from './core/transaction-handle.js';
20
21
  export type { TransactionMined, TransactionWaitOptions } from './core/transaction-handle.js';
21
22
  export * from './core/contracts.js';
23
+ export type { X402Accept, X402Payment, X402RequestOptions, X402RequiredResponse, X402RequestResult, ResourceInfo, X402SettlementResponse, Parse402FromHeaderResult, } from './core/x402-types.js';
24
+ export { isX402Required, parse402AcceptsFromHeader, parse402FromBody, parse402FromHeader, parse402SettlementFromHeader, parse402FromWWWAuthenticate, } from './core/x402-types.js';
22
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAA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jD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAG7F,cAAc,qBAAqB,CAAC;AAGpC,YAAY,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export * from './utils/index.js';
9
9
  // Export core classes
10
10
  export { SDK } from './core/sdk.js';
11
11
  export { Agent } from './core/agent.js';
12
+ export { A2AClientFromSummary } from './core/a2a-summary-client.js';
12
13
  export { ViemChainClient } from './core/viem-chain-client.js';
13
14
  export { IPFSClient } from './core/ipfs-client.js';
14
15
  export { SubgraphClient } from './core/subgraph-client.js';
@@ -18,4 +19,5 @@ export { AgentIndexer } from './core/indexer.js';
18
19
  export { TransactionHandle } from './core/transaction-handle.js';
19
20
  // Export contract definitions
20
21
  export * from './core/contracts.js';
22
+ export { isX402Required, parse402AcceptsFromHeader, parse402FromBody, parse402FromHeader, parse402SettlementFromHeader, parse402FromWWWAuthenticate, } from './core/x402-types.js';
21
23
  //# 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;;;GAGG;AAEH,gBAAgB;AAChB,cAAc,mBAAmB,CAAC;AAElC,mBAAmB;AACnB,cAAc,kBAAkB,CAAC;AAEjC,sBAAsB;AACtB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACx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AC5B,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * A2A (Agent-to-Agent) types.
3
+ */
4
+ /** Credential as object; string is normalized to { apiKey: string }. */
5
+ export interface CredentialObject {
6
+ apiKey?: string;
7
+ bearer?: string;
8
+ [key: string]: unknown;
9
+ }
10
+ /** Options for messageA2A (blocking, contextId, taskId, credential, payment per §2.1, §4.2). */
11
+ export interface MessageA2AOptions {
12
+ blocking?: boolean;
13
+ contextId?: string;
14
+ taskId?: string;
15
+ /** When the agent's endpoint requires auth: string (→ apiKey) or object (e.g. { apiKey } or { bearer }). */
16
+ credential?: string | CredentialObject;
17
+ /** Optional payment payload (e.g. base64 PAYMENT-SIGNATURE) to send with the first request; if server accepts, 2xx and no 402. */
18
+ payment?: string;
19
+ /** SendMessageConfiguration: accepted output modes (e.g. stream, push). */
20
+ acceptedOutputModes?: string[];
21
+ /** SendMessageConfiguration: requested history length for the task. */
22
+ historyLength?: number;
23
+ /** SendMessageConfiguration: push notification config (v0.3 / v1). */
24
+ pushNotificationConfig?: Record<string, unknown>;
25
+ /** SendMessageConfiguration: return immediately without waiting (v1). */
26
+ returnImmediately?: boolean;
27
+ }
28
+ /** OpenAPI-style apiKey scheme: where to send the value and under what name. */
29
+ export interface SecuritySchemeApiKey {
30
+ type: 'apiKey';
31
+ in: 'header' | 'query' | 'cookie';
32
+ name: string;
33
+ description?: string;
34
+ }
35
+ /** OpenAPI-style http (Bearer) scheme. */
36
+ export interface SecuritySchemeHttp {
37
+ type: 'http';
38
+ scheme: 'bearer' | 'basic';
39
+ bearerFormat?: string;
40
+ description?: string;
41
+ }
42
+ /** Supported A2A security scheme types (per spec §2.5). */
43
+ export type SecurityScheme = SecuritySchemeApiKey | SecuritySchemeHttp;
44
+ /** AgentCard auth shape: securitySchemes and which are required. */
45
+ export interface AgentCardAuth {
46
+ securitySchemes?: Record<string, SecurityScheme>;
47
+ security?: Array<Record<string, string[]>>;
48
+ }
49
+ /**
50
+ * Part: smallest unit of content in a Message or Artifact.
51
+ * Per A2A Protocol: text, url, data, or raw.
52
+ */
53
+ export interface Part {
54
+ text?: string;
55
+ url?: string;
56
+ data?: string;
57
+ raw?: string;
58
+ [key: string]: unknown;
59
+ }
60
+ /**
61
+ * Direct message response from an A2A server (no task created).
62
+ * No `task` or `taskId`; discriminate from TaskResponse by 'task' in msg.
63
+ * Has x402Required?: false so you can use if (result.x402Required) to detect 402.
64
+ */
65
+ export interface MessageResponse {
66
+ x402Required?: false;
67
+ content?: string;
68
+ parts?: Part[];
69
+ contextId?: string;
70
+ }
71
+ /**
72
+ * Task state returned by task.query() or after cancel.
73
+ * Server-specific status values; common: open, working, completed, failed, canceled, rejected.
74
+ */
75
+ export interface TaskState {
76
+ state?: string;
77
+ [key: string]: unknown;
78
+ }
79
+ /**
80
+ * When an A2A request returns HTTP 402. Caller may call x402Payment.pay() to pay and retry.
81
+ * Compatible with X402RequiredResponse from core/x402-types (used by a2a-client).
82
+ */
83
+ export interface A2APaymentRequired<T = unknown> {
84
+ x402Required: true;
85
+ x402Payment: {
86
+ pay(accept?: unknown): Promise<T>;
87
+ /** When present: pays using first accept with sufficient token balance. */
88
+ payFirst?(): Promise<T>;
89
+ accepts: unknown[];
90
+ price?: string;
91
+ token?: string;
92
+ network?: string;
93
+ };
94
+ }
95
+ /** Result of task.query(): state or 402. */
96
+ export type TaskQueryResult = {
97
+ taskId: string;
98
+ contextId: string;
99
+ status?: TaskState;
100
+ artifacts?: unknown[];
101
+ messages?: unknown[];
102
+ };
103
+ /** Result of task.cancel(): state or 402. */
104
+ export type TaskCancelResult = {
105
+ taskId: string;
106
+ contextId: string;
107
+ status?: TaskState;
108
+ };
109
+ /** Summary of a task returned by listTasks. */
110
+ export interface TaskSummary {
111
+ x402Required?: false;
112
+ taskId: string;
113
+ contextId: string;
114
+ status?: TaskState;
115
+ /** Optional message history when historyLength > 0. */
116
+ messages?: unknown[];
117
+ [key: string]: unknown;
118
+ }
119
+ /** Options for listTasks (filter, historyLength, credential, payment per §2.3, §4.2). */
120
+ export interface ListTasksOptions {
121
+ filter?: {
122
+ contextId?: string;
123
+ status?: string;
124
+ [key: string]: unknown;
125
+ };
126
+ historyLength?: number;
127
+ credential?: string | CredentialObject;
128
+ /** Optional payment payload to send with the first request; if server accepts, 2xx and no 402. */
129
+ payment?: string;
130
+ }
131
+ /**
132
+ * Task handle: read-only taskId, contextId, and methods query, message, cancel.
133
+ * Returned by response.task and by agent.loadTask(taskId).
134
+ * Methods may return 402 (A2APaymentRequired); use pay() to retry.
135
+ */
136
+ export interface AgentTask {
137
+ readonly taskId: string;
138
+ readonly contextId: string;
139
+ query(options?: {
140
+ historyLength?: number;
141
+ }): Promise<TaskQueryResult | A2APaymentRequired<TaskQueryResult>>;
142
+ message(content: string | {
143
+ parts: Part[];
144
+ }): Promise<MessageResponse | TaskResponse | A2APaymentRequired<MessageResponse | TaskResponse>>;
145
+ cancel(): Promise<TaskCancelResult | A2APaymentRequired<TaskCancelResult>>;
146
+ }
147
+ /**
148
+ * Response when the server created a task.
149
+ * Discriminate from MessageResponse by 'task' in response.
150
+ * Has x402Required?: false so you can use if (result.x402Required) to detect 402.
151
+ */
152
+ export interface TaskResponse {
153
+ x402Required?: false;
154
+ taskId: string;
155
+ contextId: string;
156
+ task: AgentTask;
157
+ /** Optional task snapshot from send response */
158
+ status?: TaskState;
159
+ }
160
+ /** Options for loadTask (credential, payment). */
161
+ export interface LoadTaskOptions {
162
+ credential?: string | CredentialObject;
163
+ payment?: string;
164
+ }
165
+ /**
166
+ * Interface for A2A-capable clients. Implemented by Agent and A2AClientFromSummary
167
+ * so that loaded agents and agent summaries can be used interchangeably for A2A.
168
+ */
169
+ export interface A2AClient {
170
+ messageA2A(content: string | {
171
+ parts: Part[];
172
+ }, options?: MessageA2AOptions): Promise<MessageResponse | TaskResponse | A2APaymentRequired<MessageResponse | TaskResponse>>;
173
+ listTasks(options?: ListTasksOptions): Promise<TaskSummary[] | A2APaymentRequired<TaskSummary[]>>;
174
+ loadTask(taskId: string, options?: LoadTaskOptions): Promise<AgentTask | A2APaymentRequired<AgentTask>>;
175
+ }
176
+ //# sourceMappingURL=a2a.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a.d.ts","sourceRoot":"","sources":["../../src/models/a2a.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,gGAAgG;AAChG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACvC,kIAAkI;IAClI,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,YAAY,CAAC,E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AAC,SAAS,CAAC,CAAC,CAAC;CACvD"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A2A (Agent-to-Agent) types.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=a2a.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a.js","sourceRoot":"","sources":["../../src/models/a2a.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -53,6 +53,14 @@ export type Scalars = {
53
53
  input: string;
54
54
  output: string;
55
55
  };
56
+ Int8: {
57
+ input: bigint;
58
+ output: bigint;
59
+ };
60
+ Timestamp: {
61
+ input: number;
62
+ output: number;
63
+ };
56
64
  };
57
65
  export type Agent = {
58
66
  __typename?: 'Agent';
@@ -73,6 +81,17 @@ export type Agent = {
73
81
  updatedAt: Scalars['BigInt']['output'];
74
82
  validations: Array<Validation>;
75
83
  };
84
+ export type AgentFeedbackStats = {
85
+ __typename?: 'AgentFeedbackStats';
86
+ agent: Agent;
87
+ feedbackCreated: Scalars['BigInt']['output'];
88
+ feedbackRevoked: Scalars['BigInt']['output'];
89
+ id: Scalars['Int8']['output'];
90
+ protocol: Protocol;
91
+ timestamp: Scalars['Timestamp']['output'];
92
+ valueDeltaSum: Scalars['BigDecimal']['output'];
93
+ valueSum: Scalars['BigDecimal']['output'];
94
+ };
76
95
  export type AgentMetadata = {
77
96
  __typename?: 'AgentMetadata';
78
97
  agent: Agent;
@@ -112,17 +131,22 @@ export type AgentRegistrationFile = {
112
131
  webEndpoint?: Maybe<Scalars['String']['output']>;
113
132
  x402Support?: Maybe<Scalars['Boolean']['output']>;
114
133
  };
115
- export type AgentStats = {
116
- __typename?: 'AgentStats';
134
+ export type AgentRegistrationPoint = {
135
+ __typename?: 'AgentRegistrationPoint';
117
136
  agent: Agent;
118
- averageFeedbackValue: Scalars['BigDecimal']['output'];
119
- averageValidationScore: Scalars['BigDecimal']['output'];
120
- completedValidations: Scalars['BigInt']['output'];
121
- id: Scalars['ID']['output'];
122
- lastActivity: Scalars['BigInt']['output'];
123
- totalFeedback: Scalars['BigInt']['output'];
124
- totalValidations: Scalars['BigInt']['output'];
125
- updatedAt: Scalars['BigInt']['output'];
137
+ id: Scalars['Int8']['output'];
138
+ protocol: Protocol;
139
+ timestamp: Scalars['Timestamp']['output'];
140
+ };
141
+ export type AgentValidationStats = {
142
+ __typename?: 'AgentValidationStats';
143
+ agent: Agent;
144
+ id: Scalars['Int8']['output'];
145
+ protocol: Protocol;
146
+ scoreSum: Scalars['BigInt']['output'];
147
+ timestamp: Scalars['Timestamp']['output'];
148
+ validationRequests: Scalars['BigInt']['output'];
149
+ validationResponses: Scalars['BigInt']['output'];
126
150
  };
127
151
  export type Feedback = {
128
152
  __typename?: 'Feedback';
@@ -171,6 +195,19 @@ export type FeedbackFile = {
171
195
  valueDecimals?: Maybe<Scalars['Int']['output']>;
172
196
  valueRaw?: Maybe<Scalars['BigInt']['output']>;
173
197
  };
198
+ export type FeedbackPoint = {
199
+ __typename?: 'FeedbackPoint';
200
+ agent: Agent;
201
+ createdCount: Scalars['BigInt']['output'];
202
+ id: Scalars['Int8']['output'];
203
+ isRevocation: Scalars['Boolean']['output'];
204
+ protocol: Protocol;
205
+ revokedCount: Scalars['BigInt']['output'];
206
+ timestamp: Scalars['Timestamp']['output'];
207
+ value: Scalars['BigDecimal']['output'];
208
+ valueDelta: Scalars['BigDecimal']['output'];
209
+ valueForSum: Scalars['BigDecimal']['output'];
210
+ };
174
211
  export type FeedbackResponse = {
175
212
  __typename?: 'FeedbackResponse';
176
213
  createdAt: Scalars['BigInt']['output'];
@@ -180,32 +217,43 @@ export type FeedbackResponse = {
180
217
  responseHash?: Maybe<Scalars['Bytes']['output']>;
181
218
  responseUri?: Maybe<Scalars['String']['output']>;
182
219
  };
183
- export type GlobalStats = {
184
- __typename?: 'GlobalStats';
185
- agents: Array<Agent>;
186
- id: Scalars['ID']['output'];
187
- tags: Array<Scalars['String']['output']>;
188
- totalAgents: Scalars['BigInt']['output'];
189
- totalFeedback: Scalars['BigInt']['output'];
190
- totalProtocols: Scalars['BigInt']['output'];
191
- totalValidations: Scalars['BigInt']['output'];
192
- updatedAt: Scalars['BigInt']['output'];
193
- };
194
220
  export type Protocol = {
195
221
  __typename?: 'Protocol';
196
- agents: Array<Agent>;
197
222
  chainId: Scalars['BigInt']['output'];
223
+ createdAt: Scalars['BigInt']['output'];
198
224
  id: Scalars['ID']['output'];
199
225
  identityRegistry: Scalars['Bytes']['output'];
200
226
  name: Scalars['String']['output'];
201
227
  reputationRegistry: Scalars['Bytes']['output'];
202
- tags: Array<Scalars['String']['output']>;
203
- totalAgents: Scalars['BigInt']['output'];
204
- totalFeedback: Scalars['BigInt']['output'];
205
- totalValidations: Scalars['BigInt']['output'];
206
228
  updatedAt: Scalars['BigInt']['output'];
207
229
  validationRegistry: Scalars['Bytes']['output'];
208
230
  };
231
+ export type ProtocolAgentStats = {
232
+ __typename?: 'ProtocolAgentStats';
233
+ agentRegistrations: Scalars['Int8']['output'];
234
+ id: Scalars['Int8']['output'];
235
+ protocol: Protocol;
236
+ timestamp: Scalars['Timestamp']['output'];
237
+ };
238
+ export type ProtocolFeedbackStats = {
239
+ __typename?: 'ProtocolFeedbackStats';
240
+ feedbackCreated: Scalars['BigInt']['output'];
241
+ feedbackRevoked: Scalars['BigInt']['output'];
242
+ id: Scalars['Int8']['output'];
243
+ protocol: Protocol;
244
+ timestamp: Scalars['Timestamp']['output'];
245
+ valueDeltaSum: Scalars['BigDecimal']['output'];
246
+ valueSum: Scalars['BigDecimal']['output'];
247
+ };
248
+ export type ProtocolValidationStats = {
249
+ __typename?: 'ProtocolValidationStats';
250
+ id: Scalars['Int8']['output'];
251
+ protocol: Protocol;
252
+ scoreSum: Scalars['BigInt']['output'];
253
+ timestamp: Scalars['Timestamp']['output'];
254
+ validationRequests: Scalars['BigInt']['output'];
255
+ validationResponses: Scalars['BigInt']['output'];
256
+ };
209
257
  export type Validation = {
210
258
  __typename?: 'Validation';
211
259
  agent: Agent;
@@ -221,5 +269,18 @@ export type Validation = {
221
269
  updatedAt: Scalars['BigInt']['output'];
222
270
  validatorAddress: Scalars['Bytes']['output'];
223
271
  };
272
+ export type ValidationPoint = {
273
+ __typename?: 'ValidationPoint';
274
+ agent: Agent;
275
+ id: Scalars['Int8']['output'];
276
+ isRequest: Scalars['Boolean']['output'];
277
+ isResponse: Scalars['Boolean']['output'];
278
+ protocol: Protocol;
279
+ requestCount: Scalars['BigInt']['output'];
280
+ responseCount: Scalars['BigInt']['output'];
281
+ responseScore: Scalars['BigInt']['output'];
282
+ score: Scalars['Int']['output'];
283
+ timestamp: Scalars['Timestamp']['output'];
284
+ };
224
285
  export type ValidationStatus = 'COMPLETED' | 'EXPIRED' | 'PENDING';
225
286
  //# sourceMappingURL=subgraph-types.d.ts.map