@dupecom/botcha-cloudflare 0.20.2 → 0.23.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 (88) hide show
  1. package/README.md +74 -9
  2. package/dist/agent-auth.d.ts +129 -0
  3. package/dist/agent-auth.d.ts.map +1 -0
  4. package/dist/agent-auth.js +210 -0
  5. package/dist/agents.d.ts +10 -0
  6. package/dist/agents.d.ts.map +1 -1
  7. package/dist/agents.js +51 -1
  8. package/dist/app-gate.d.ts +6 -0
  9. package/dist/app-gate.d.ts.map +1 -0
  10. package/dist/app-gate.js +69 -0
  11. package/dist/apps.d.ts +13 -4
  12. package/dist/apps.d.ts.map +1 -1
  13. package/dist/apps.js +30 -4
  14. package/dist/dashboard/account.d.ts +63 -0
  15. package/dist/dashboard/account.d.ts.map +1 -0
  16. package/dist/dashboard/account.js +488 -0
  17. package/dist/dashboard/api.js +15 -68
  18. package/dist/dashboard/auth.d.ts.map +1 -1
  19. package/dist/dashboard/auth.js +14 -14
  20. package/dist/dashboard/docs.d.ts.map +1 -1
  21. package/dist/dashboard/docs.js +146 -3
  22. package/dist/dashboard/layout.d.ts.map +1 -1
  23. package/dist/dashboard/layout.js +2 -2
  24. package/dist/dashboard/mcp-setup.d.ts +15 -0
  25. package/dist/dashboard/mcp-setup.d.ts.map +1 -0
  26. package/dist/dashboard/mcp-setup.js +391 -0
  27. package/dist/dashboard/showcase.d.ts +6 -10
  28. package/dist/dashboard/showcase.d.ts.map +1 -1
  29. package/dist/dashboard/showcase.js +67 -991
  30. package/dist/dashboard/whitepaper.d.ts.map +1 -1
  31. package/dist/dashboard/whitepaper.js +42 -4
  32. package/dist/index.d.ts +5 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +660 -83
  35. package/dist/mcp.d.ts +20 -0
  36. package/dist/mcp.d.ts.map +1 -0
  37. package/dist/mcp.js +1290 -0
  38. package/dist/oauth-agent.d.ts +130 -0
  39. package/dist/oauth-agent.d.ts.map +1 -0
  40. package/dist/oauth-agent.js +194 -0
  41. package/dist/static.d.ts +781 -5
  42. package/dist/static.d.ts.map +1 -1
  43. package/dist/static.js +790 -111
  44. package/dist/tap-a2a-routes.d.ts +355 -0
  45. package/dist/tap-a2a-routes.d.ts.map +1 -0
  46. package/dist/tap-a2a-routes.js +475 -0
  47. package/dist/tap-a2a.d.ts +199 -0
  48. package/dist/tap-a2a.d.ts.map +1 -0
  49. package/dist/tap-a2a.js +502 -0
  50. package/dist/tap-agents.d.ts +15 -0
  51. package/dist/tap-agents.d.ts.map +1 -1
  52. package/dist/tap-agents.js +31 -1
  53. package/dist/tap-ans-routes.d.ts +302 -0
  54. package/dist/tap-ans-routes.d.ts.map +1 -0
  55. package/dist/tap-ans-routes.js +535 -0
  56. package/dist/tap-ans.d.ts +241 -0
  57. package/dist/tap-ans.d.ts.map +1 -0
  58. package/dist/tap-ans.js +481 -0
  59. package/dist/tap-delegation-routes.d.ts.map +1 -1
  60. package/dist/tap-delegation-routes.js +11 -0
  61. package/dist/tap-did.d.ts +140 -0
  62. package/dist/tap-did.d.ts.map +1 -0
  63. package/dist/tap-did.js +262 -0
  64. package/dist/tap-oidca-routes.d.ts +383 -0
  65. package/dist/tap-oidca-routes.d.ts.map +1 -0
  66. package/dist/tap-oidca-routes.js +597 -0
  67. package/dist/tap-oidca.d.ts +288 -0
  68. package/dist/tap-oidca.d.ts.map +1 -0
  69. package/dist/tap-oidca.js +461 -0
  70. package/dist/tap-routes.d.ts +24 -8
  71. package/dist/tap-routes.d.ts.map +1 -1
  72. package/dist/tap-routes.js +169 -23
  73. package/dist/tap-vc-routes.d.ts +358 -0
  74. package/dist/tap-vc-routes.d.ts.map +1 -0
  75. package/dist/tap-vc-routes.js +367 -0
  76. package/dist/tap-vc.d.ts +125 -0
  77. package/dist/tap-vc.d.ts.map +1 -0
  78. package/dist/tap-vc.js +245 -0
  79. package/dist/tap-x402-routes.d.ts +89 -0
  80. package/dist/tap-x402-routes.d.ts.map +1 -0
  81. package/dist/tap-x402-routes.js +579 -0
  82. package/dist/tap-x402.d.ts +222 -0
  83. package/dist/tap-x402.d.ts.map +1 -0
  84. package/dist/tap-x402.js +546 -0
  85. package/dist/webhooks.d.ts +99 -0
  86. package/dist/webhooks.d.ts.map +1 -0
  87. package/dist/webhooks.js +642 -0
  88. package/package.json +3 -1
@@ -0,0 +1,355 @@
1
+ /**
2
+ * A2A Agent Card Attestation — Route Handlers
3
+ *
4
+ * Routes:
5
+ * GET /.well-known/agent.json — BOTCHA's own A2A Agent Card
6
+ * POST /v1/a2a/attest — Attest an A2A Agent Card
7
+ * POST /v1/a2a/verify-card — Verify an attested A2A Agent Card
8
+ * GET /v1/a2a/cards — List BOTCHA-verified Agent Cards
9
+ * GET /v1/a2a/cards/:id — Get a specific A2A attestation record
10
+ */
11
+ import type { Context } from 'hono';
12
+ /**
13
+ * GET /.well-known/agent.json
14
+ *
15
+ * BOTCHA's own A2A Agent Card. Serves the standard A2A discovery document
16
+ * so any A2A-compatible agent can discover BOTCHA's skills and auth requirements.
17
+ *
18
+ * No auth required — this is a public discovery endpoint.
19
+ */
20
+ export declare function agentCardRoute(c: Context): Promise<Response & import("hono").TypedResponse<{
21
+ [x: string]: import("hono/utils/types").JSONValue;
22
+ name: string;
23
+ description?: string | undefined;
24
+ url: string;
25
+ version?: string | undefined;
26
+ documentationUrl?: string | undefined;
27
+ capabilities?: {
28
+ streaming?: boolean | undefined;
29
+ pushNotifications?: boolean | undefined;
30
+ stateTransitionHistory?: boolean | undefined;
31
+ } | undefined;
32
+ authentication?: {
33
+ schemes: string[];
34
+ description?: string | undefined;
35
+ credentials?: {
36
+ [x: string]: string;
37
+ } | undefined;
38
+ }[] | undefined;
39
+ defaultInputModes?: string[] | undefined;
40
+ defaultOutputModes?: string[] | undefined;
41
+ skills?: {
42
+ id: string;
43
+ name: string;
44
+ description?: string | undefined;
45
+ tags?: string[] | undefined;
46
+ examples?: string[] | undefined;
47
+ inputModes?: string[] | undefined;
48
+ outputModes?: string[] | undefined;
49
+ }[] | undefined;
50
+ extensions?: {
51
+ [x: string]: import("hono/utils/types").JSONValue;
52
+ botcha_attestation?: {
53
+ token: string;
54
+ verified_at: string;
55
+ trust_level: string;
56
+ issuer: string;
57
+ card_hash: string;
58
+ expires_at: string;
59
+ } | undefined;
60
+ } | undefined;
61
+ }, 200, "json">>;
62
+ /**
63
+ * POST /v1/a2a/attest
64
+ *
65
+ * Attest an A2A Agent Card. BOTCHA verifies the card structure, hashes its
66
+ * content, signs a JWT attestation, and embeds it in extensions.botcha_attestation.
67
+ *
68
+ * Request body:
69
+ * card — A2A Agent Card JSON (required)
70
+ * duration_seconds — TTL for attestation (default 86400, max 2592000)
71
+ * trust_level — 'basic' | 'verified' | 'enterprise' (default 'verified')
72
+ *
73
+ * Auth: BOTCHA Bearer token (app_id required)
74
+ */
75
+ export declare function attestCardRoute(c: Context): Promise<(Response & import("hono").TypedResponse<{
76
+ success: false;
77
+ error: string | undefined;
78
+ message: string;
79
+ hint: string;
80
+ }, 401 | 403, "json">) | (Response & import("hono").TypedResponse<{
81
+ success: false;
82
+ error: string;
83
+ message: string | undefined;
84
+ }, 400 | 500, "json">) | (Response & import("hono").TypedResponse<{
85
+ success: true;
86
+ message: string;
87
+ attestation: {
88
+ attestation_id: string;
89
+ agent_url: string;
90
+ agent_name: string;
91
+ app_id: string;
92
+ card_hash: string;
93
+ trust_level: string;
94
+ token: string;
95
+ created_at: string;
96
+ expires_at: string;
97
+ };
98
+ attested_card: {
99
+ [x: string]: import("hono/utils/types").JSONValue;
100
+ name: string;
101
+ description?: string | undefined;
102
+ url: string;
103
+ version?: string | undefined;
104
+ documentationUrl?: string | undefined;
105
+ capabilities?: {
106
+ streaming?: boolean | undefined;
107
+ pushNotifications?: boolean | undefined;
108
+ stateTransitionHistory?: boolean | undefined;
109
+ } | undefined;
110
+ authentication?: {
111
+ schemes: string[];
112
+ description?: string | undefined;
113
+ credentials?: {
114
+ [x: string]: string;
115
+ } | undefined;
116
+ }[] | undefined;
117
+ defaultInputModes?: string[] | undefined;
118
+ defaultOutputModes?: string[] | undefined;
119
+ skills?: {
120
+ id: string;
121
+ name: string;
122
+ description?: string | undefined;
123
+ tags?: string[] | undefined;
124
+ examples?: string[] | undefined;
125
+ inputModes?: string[] | undefined;
126
+ outputModes?: string[] | undefined;
127
+ }[] | undefined;
128
+ extensions?: {
129
+ [x: string]: import("hono/utils/types").JSONValue;
130
+ botcha_attestation?: {
131
+ token: string;
132
+ verified_at: string;
133
+ trust_level: string;
134
+ issuer: string;
135
+ card_hash: string;
136
+ expires_at: string;
137
+ } | undefined;
138
+ } | undefined;
139
+ } | undefined;
140
+ usage: {
141
+ note: string;
142
+ verify: string;
143
+ registry: string;
144
+ };
145
+ }, 201, "json">)>;
146
+ /**
147
+ * POST /v1/a2a/verify-card
148
+ *
149
+ * Verify a BOTCHA-attested A2A Agent Card. Any agent can call this endpoint
150
+ * to check whether a card's attestation is valid. No auth required.
151
+ *
152
+ * Request body:
153
+ * card — A2A Agent Card JSON including extensions.botcha_attestation (required)
154
+ *
155
+ * Returns:
156
+ * valid: true → card is verified, claims decoded
157
+ * valid: false → reason for failure (expired, tampered, revoked, missing)
158
+ */
159
+ export declare function verifyCardRoute(c: Context): Promise<(Response & import("hono").TypedResponse<{
160
+ success: false;
161
+ error: string;
162
+ message: string;
163
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
164
+ success: false;
165
+ error: string;
166
+ message: string | undefined;
167
+ }, 500, "json">) | (Response & import("hono").TypedResponse<{
168
+ success: true;
169
+ valid: false;
170
+ verified: false;
171
+ error: string | undefined;
172
+ reason: string | undefined;
173
+ attestation_id: string | null;
174
+ card_hash: string | null;
175
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
176
+ success: true;
177
+ valid: true;
178
+ verified: true;
179
+ attestation_id: string | undefined;
180
+ agent_url: string | undefined;
181
+ agent_name: string | undefined;
182
+ card_hash: string | undefined;
183
+ trust_level: string | undefined;
184
+ app_id: string | undefined;
185
+ issued_at: string | undefined;
186
+ expires_at: string | undefined;
187
+ issuer: string;
188
+ message: string;
189
+ }, 200, "json">)>;
190
+ /**
191
+ * GET /v1/a2a/cards
192
+ *
193
+ * List BOTCHA-verified A2A Agent Cards from the public registry.
194
+ *
195
+ * Query params:
196
+ * verified=true — only non-revoked (default true)
197
+ * agent_url= — filter by agent URL
198
+ * limit= — max results (default 50, max 200)
199
+ *
200
+ * No auth required — this is a public discovery endpoint.
201
+ */
202
+ export declare function listCardsRoute(c: Context): Promise<(Response & import("hono").TypedResponse<{
203
+ success: false;
204
+ error: string;
205
+ message: string | undefined;
206
+ }, 500, "json">) | (Response & import("hono").TypedResponse<{
207
+ success: true;
208
+ count: number;
209
+ verified_only: boolean;
210
+ agent_url_filter: string | null;
211
+ cards: {
212
+ attestation_id: string;
213
+ agent_url: string;
214
+ agent_name: string;
215
+ app_id: string;
216
+ card_hash: string;
217
+ trust_level: string;
218
+ created_at: string;
219
+ expires_at: string;
220
+ revoked: boolean;
221
+ }[];
222
+ meta: {
223
+ note: string;
224
+ verify: string;
225
+ attest: string;
226
+ };
227
+ }, 200, "json">)>;
228
+ /**
229
+ * GET /v1/a2a/cards/:id
230
+ *
231
+ * Get a specific A2A attestation record by attestation ID.
232
+ * No auth required — public registry lookup.
233
+ */
234
+ export declare function getCardAttestationRoute(c: Context): Promise<(Response & import("hono").TypedResponse<{
235
+ success: false;
236
+ error: string;
237
+ message: string;
238
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
239
+ success: false;
240
+ error: string;
241
+ message: string;
242
+ }, 404, "json">) | (Response & import("hono").TypedResponse<{
243
+ success: true;
244
+ attestation_id: string;
245
+ agent_url: string;
246
+ agent_name: string;
247
+ app_id: string;
248
+ card_hash: string;
249
+ trust_level: string;
250
+ created_at: string;
251
+ expires_at: string;
252
+ revoked: boolean;
253
+ revoked_at: string | null;
254
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
255
+ success: false;
256
+ error: string;
257
+ message: string;
258
+ }, 500, "json">)>;
259
+ /**
260
+ * POST /v1/a2a/verify-agent
261
+ *
262
+ * Verify an agent by agent_card (with embedded attestation) or by agent_url.
263
+ * Convenience wrapper: accepts the same payload as /v1/a2a/verify-card
264
+ * plus an `agent_url` shorthand to look up the latest active attestation.
265
+ */
266
+ export declare function verifyAgentRoute(c: Context): Promise<(Response & import("hono").TypedResponse<{
267
+ success: false;
268
+ verified: false;
269
+ error: string;
270
+ message: string;
271
+ }, 404, "json">) | (Response & import("hono").TypedResponse<{
272
+ success: true;
273
+ verified: true;
274
+ agent_url: string;
275
+ agent_name: string;
276
+ attestation_id: string;
277
+ trust_level: string;
278
+ issued_at: string;
279
+ expires_at: string;
280
+ issuer: string;
281
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
282
+ success: false;
283
+ verified: false;
284
+ error: string;
285
+ message: string;
286
+ example: {
287
+ agent_card: {
288
+ name: string;
289
+ url: string;
290
+ extensions: {
291
+ botcha_attestation: string;
292
+ };
293
+ };
294
+ };
295
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
296
+ success: false;
297
+ verified: false;
298
+ error: string;
299
+ valid: false;
300
+ }, 400 | 200, "json">) | (Response & import("hono").TypedResponse<{
301
+ success: true;
302
+ verified: boolean | undefined;
303
+ valid: boolean | undefined;
304
+ attestation_id: string | undefined;
305
+ trust_level: string | undefined;
306
+ card_hash: string | undefined;
307
+ issued_at: string | undefined;
308
+ expires_at: string | undefined;
309
+ issuer: string;
310
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
311
+ success: false;
312
+ error: string;
313
+ message: string;
314
+ }, 500, "json">)>;
315
+ /**
316
+ * GET /v1/a2a/trust-level/:agent_url
317
+ *
318
+ * Returns the current trust level for an agent identified by URL.
319
+ * The :agent_url path param should be URL-encoded.
320
+ */
321
+ export declare function agentTrustLevelRoute(c: Context): Promise<(Response & import("hono").TypedResponse<{
322
+ success: false;
323
+ error: string;
324
+ message: string;
325
+ }, 400, "json">) | (Response & import("hono").TypedResponse<{
326
+ success: true;
327
+ agent_url: string;
328
+ trust_level: string;
329
+ attestation_count: number;
330
+ message: string;
331
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
332
+ success: true;
333
+ agent_url: string;
334
+ agent_name: string;
335
+ trust_level: string;
336
+ attestation_id: string;
337
+ issued_at: string;
338
+ expires_at: string;
339
+ verified: boolean;
340
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
341
+ success: false;
342
+ error: string;
343
+ message: string;
344
+ }, 500, "json">)>;
345
+ declare const _default: {
346
+ agentCardRoute: typeof agentCardRoute;
347
+ attestCardRoute: typeof attestCardRoute;
348
+ verifyCardRoute: typeof verifyCardRoute;
349
+ listCardsRoute: typeof listCardsRoute;
350
+ getCardAttestationRoute: typeof getCardAttestationRoute;
351
+ verifyAgentRoute: typeof verifyAgentRoute;
352
+ agentTrustLevelRoute: typeof agentTrustLevelRoute;
353
+ };
354
+ export default _default;
355
+ //# sourceMappingURL=tap-a2a-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tap-a2a-routes.d.ts","sourceRoot":"","sources":["../src/tap-a2a-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AA6DpC;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS9C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsF/C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4D/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;kBA0D9C;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;kBA6CvD;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4EhD;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;kBA4CpD;;;;;;;;;;AAED,wBAQE"}