@kya-brasil/agent-tools 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # @kya-brasil/agent-tools
2
2
 
3
3
  **Know-your-agent for Brazil, as code.** Verify that an AI agent really acts for a Brazilian company
4
- (credential signed by the company's e-CNPJ, company cleared by [KYB Brasil](https://kyb-br-agents.marcelfons.workers.dev)),
4
+ (credential signed by the company's e-CNPJ, checked against its AC's revocation list, company active at the Receita Federal),
5
5
  check an action against the agent's mandate, or give your own agent a credential.
6
6
 
7
7
  Paid per call with [x402](https://x402.org) (USDC on Base, no signup). Free verification works without a wallet
@@ -11,12 +11,15 @@ Paid per call with [x402](https://x402.org) (USDC on Base, no signup). Free veri
11
11
  npm i @kya-brasil/agent-tools
12
12
  ```
13
13
 
14
+ The same build is mirrored to GitHub Packages as `@celfons/kya-agent-tools` (listed on the repository page;
15
+ installing from there needs a GitHub token). npmjs.com is the channel to install from.
16
+
14
17
  Node 18+ (global `fetch`, WebCrypto). ESM.
15
18
 
16
19
  ## Verifier: you receive an action from someone else's agent
17
20
 
18
21
  ```ts
19
- import { createKyaClient, verifyAttestation } from "@kya-brasil/agent-tools";
22
+ import { createKyaClient, verifyAttestation, verifyCredentialOffline, companyText, signWithECnpj } from "@kya-brasil/agent-tools";
20
23
 
21
24
  const kya = createKyaClient({ privateKey: process.env.KYA_PAYER_PK as `0x${string}` }); // wallet optional
22
25
 
@@ -30,14 +33,25 @@ if (!verdict.allowed) reject(verdict.reason);
30
33
 
31
34
  await verifyAttestation(verdict); // local Ed25519 check of the issuer's signature
32
35
 
33
- const receipt = await kya.registerAct(credentialId, { // $0.02 once you accept it: signed receipt,
34
- action: "order", amount: 4200, currency: "BRL", counterparty: "12345678000190", reference: "PO-1"
35
- }); // daily ceilings enforced across counterparties
36
+ // max_per_day: pass your own spent_today; the issuer does not record acts.
37
+
38
+ const offline = await verifyCredentialOffline(credential); // issuer down: signature + expires_at only,
39
+ // live_status "unknown" (your risk until expires_at)
36
40
  ```
37
41
 
38
42
  Also check that the key that signed the agent's request is `v.agent.id`; the credential_id alone proves nothing.
39
43
 
40
- Agent frameworks (verifier tools `kya_verify`, `kya_check_action`, `kya_register_act`, `kya_verify_paid`):
44
+ Company side, after issuance: see every agent in your name and get signed events (issued, renewed, suspended,
45
+ reinstated, revoked) at your webhook. Both requests are signed with the e-CNPJ:
46
+
47
+ ```ts
48
+ const text = companyText("webhook", cnpj, { url: "https://acme.com.br/kya-events" });
49
+ await kya.setCompanyWebhook(cnpj, { signed_text: text, ecnpj_signature: await signWithECnpj(material, text) });
50
+ const inv = await kya.companyAgents(cnpj, { signed_text: t2, ecnpj_signature: s2 }); // t2 = companyText("agents", cnpj)
51
+ // on your webhook: (await verifyAttestation(body)).valid before trusting the event
52
+ ```
53
+
54
+ Agent frameworks (verifier tools `kya_verify`, `kya_check_action`, `kya_verify_paid`):
41
55
 
42
56
  ```ts
43
57
  import { toOpenAI, toVercelAI, toLangChain, toAnthropic } from "@kya-brasil/agent-tools";
@@ -124,9 +138,8 @@ Renew every 90 days (`kya.renew` then `kya.renewProve`), revoke at once (`kya.re
124
138
 
125
139
  | Call | Price |
126
140
  |---|---|
127
- | verify, verifyByKey, prove, renewProve, revoke, revocations | free |
141
+ | verify, verifyByKey, prove, renewProve, revoke, revocations, companyAgents, setCompanyWebhook | free |
128
142
  | verified (signed receipt, no limit), allowed (signed verdict) | 0.01 |
129
- | registerAct (signed receipt of what the agent did) | 0.02 |
130
143
  | renew | 0.10 |
131
144
  | register | 0.50 |
132
145
 
package/dist/auth.d.ts CHANGED
@@ -81,7 +81,7 @@ export interface LocalVerdict {
81
81
  /**
82
82
  * Local evaluation of the reserved mandate fields: actions, max_per_operation, currencies, counterparties
83
83
  * (with `*.` wildcards), valid_from / valid_until. `max_per_day` is listed as not evaluated: only the issuer
84
- * knows what was registered today (use ctx.allowed or registerAct).
84
+ * knows nothing of it either: pass your own spent_today to ctx.allowed.
85
85
  */
86
86
  export declare function checkMandate(mandate: Mandate, q: ActionQuery, now?: Date): LocalVerdict;
87
87
  export interface KyaAuth {
package/dist/auth.js CHANGED
@@ -28,11 +28,12 @@
28
28
  import { verifyMessage } from "viem";
29
29
  import { privateKeyToAccount } from "viem/accounts";
30
30
  import { createKyaClient } from "./index";
31
+ import { fromBase64Url, toBase64Url } from "./base64url";
31
32
  export const KYA_HEADERS = { credential: "kya-credential", created: "kya-created", expires: "kya-expires", signature: "kya-signature", content: "kya-content-sha256" };
32
33
  const enc = new TextEncoder();
33
34
  const hex = (buf) => [...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, "0")).join("");
34
- const b64u = (bytes) => btoa(String.fromCharCode(...bytes)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
35
- const unb64u = (s) => Uint8Array.from(atob(s.replace(/-/g, "+").replace(/_/g, "/").padEnd(Math.ceil(s.length / 4) * 4, "=")), (c) => c.charCodeAt(0));
35
+ const b64u = toBase64Url;
36
+ const unb64u = fromBase64Url;
36
37
  export async function sha256Hex(data) {
37
38
  const bytes = typeof data === "string" ? enc.encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data);
38
39
  return hex(await crypto.subtle.digest("SHA-256", bytes));
@@ -80,12 +81,15 @@ function normalizeCounterparty(c) {
80
81
  return digits;
81
82
  if (/^0x[0-9a-fA-F]{40}$/.test(t))
82
83
  return t.toLowerCase();
83
- return t.toLowerCase().replace(/^https?:\/\//, "").replace(/\/.*$/, "");
84
+ // Domain or URL: drop the scheme, then everything from the first "/" (indexOf, no backtracking regex).
85
+ const host = t.toLowerCase().replace(/^https?:\/\//, "");
86
+ const slash = host.indexOf("/");
87
+ return slash === -1 ? host : host.slice(0, slash);
84
88
  }
85
89
  /**
86
90
  * Local evaluation of the reserved mandate fields: actions, max_per_operation, currencies, counterparties
87
91
  * (with `*.` wildcards), valid_from / valid_until. `max_per_day` is listed as not evaluated: only the issuer
88
- * knows what was registered today (use ctx.allowed or registerAct).
92
+ * knows nothing of it either: pass your own spent_today to ctx.allowed.
89
93
  */
90
94
  export function checkMandate(mandate, q, now = new Date()) {
91
95
  const checks = [];
@@ -0,0 +1,4 @@
1
+ /** Base64url without padding (RFC 4648 §5), for agent signatures and keys. Linear time, no regex. */
2
+ export declare function stripPadding(s: string): string;
3
+ export declare function toBase64Url(bytes: Uint8Array): string;
4
+ export declare function fromBase64Url(s: string): Uint8Array<ArrayBuffer>;
@@ -0,0 +1,14 @@
1
+ /** Base64url without padding (RFC 4648 §5), for agent signatures and keys. Linear time, no regex. */
2
+ export function stripPadding(s) {
3
+ let end = s.length;
4
+ while (end > 0 && s[end - 1] === "=")
5
+ end--;
6
+ return s.slice(0, end);
7
+ }
8
+ export function toBase64Url(bytes) {
9
+ return stripPadding(btoa(String.fromCodePoint(...bytes)).replaceAll("+", "-").replaceAll("/", "_"));
10
+ }
11
+ export function fromBase64Url(s) {
12
+ const b64 = s.replaceAll("-", "+").replaceAll("_", "/");
13
+ return Uint8Array.from(atob(b64.padEnd(Math.ceil(b64.length / 4) * 4, "=")), (c) => c.codePointAt(0) ?? 0);
14
+ }
package/dist/index.d.ts CHANGED
@@ -56,7 +56,8 @@ export interface Credential {
56
56
  signed_at: string;
57
57
  };
58
58
  mandate: Mandate;
59
- kyb_snapshot: Record<string, unknown>;
59
+ /** Informative; null when the issuer has no KYB source. */
60
+ kyb_snapshot: Record<string, unknown> | null;
60
61
  status: CredentialStatus;
61
62
  issued_at: string;
62
63
  expires_at: string;
@@ -131,44 +132,30 @@ export interface Proof {
131
132
  agent_signature: string;
132
133
  ecnpj_signature: string;
133
134
  }
134
- export interface ActInput {
135
- action: string;
136
- amount?: number;
137
- currency?: string;
138
- counterparty?: string;
139
- reference?: string;
140
- content_sha256?: string;
141
- registered_by?: "counterparty" | "agent";
142
- registrant?: string;
143
- agent_signature?: string;
135
+ export type CompanyEvent = "credential.issued" | "credential.renewed" | "credential.suspended" | "credential.reinstated" | "credential.revoked";
136
+ /** Body POSTed to the company's webhook. Check it with verifyAttestation(event) before trusting it. */
137
+ export interface CompanyWebhookEvent {
138
+ event: CompanyEvent;
139
+ cnpj: string;
140
+ at: string;
141
+ data: Record<string, unknown>;
142
+ attestation?: Attestation;
144
143
  }
145
- export interface ActReceipt {
146
- act_id: string;
147
- credential_id: string;
148
- status: CredentialStatus;
149
- allowed: boolean;
150
- reason: string;
151
- act: ActInput & {
152
- agent_signed: boolean;
153
- };
154
- checks: {
155
- rule: string;
156
- ok: boolean;
157
- detail?: string;
144
+ export interface CompanyInventory {
145
+ cnpj: string;
146
+ cnpj_formatted: string;
147
+ count: number;
148
+ agents: {
149
+ credential_id: string;
150
+ agent: AgentKey;
151
+ status: CredentialStatus | "pending";
152
+ status_reason: string | null;
153
+ mandate: Mandate;
154
+ certificate_sha256: string | null;
155
+ created_at: string;
156
+ issued_at: string | null;
157
+ expires_at: string | null;
158
158
  }[];
159
- not_evaluated: string[];
160
- spent_today_registered_before: {
161
- currency: string;
162
- amount: number;
163
- } | null;
164
- spent_today_registered_after: {
165
- currency: string;
166
- amount: number;
167
- } | null;
168
- registered_at: string;
169
- receipt_url: string;
170
- attestation?: Attestation;
171
- [k: string]: unknown;
172
159
  }
173
160
  export declare class KyaError extends Error {
174
161
  readonly code: string;
@@ -196,7 +183,7 @@ export interface KyaClient {
196
183
  cnpj: string;
197
184
  mandate: Mandate;
198
185
  }): Promise<Registration>;
199
- /** Free: send both signatures; the credential is issued if the e-CNPJ, the CNPJ and KYB Brasil all clear. */
186
+ /** Free: send both signatures; the credential is issued if the e-CNPJ is valid and not revoked, the CNPJ matches and the company is ATIVA. */
200
187
  prove(credentialId: string, proof: Proof): Promise<{
201
188
  credential: Credential;
202
189
  kyb_warnings: string[];
@@ -223,26 +210,20 @@ export interface KyaClient {
223
210
  credential_id: string;
224
211
  status: "revoked";
225
212
  }>;
226
- /** $0.02: register what the agent did (you accepted it); mandate re-checked with today's registered acts; signed receipt. */
227
- registerAct(credentialId: string, act: ActInput): Promise<ActReceipt>;
228
- /** Free: a registered act and its receipt, by act_id. */
229
- act(actId: string): Promise<ActReceipt>;
230
- /** Free: the exact text the agent signs for an act (optional agent_signature). */
231
- actText(credentialId: string, act: ActInput): Promise<{
232
- credential_id: string;
233
- agent: AgentKey;
234
- text: string;
235
- }>;
236
- /** Free, company only: the trail of an agent's acts, request signed with the e-CNPJ over actsExportText(id). */
237
- exportActs(credentialId: string, input: {
213
+ /** Free, company only: every credential registered for the CNPJ, any status. signed_text = companyText("agents", cnpj), signed with the e-CNPJ. */
214
+ companyAgents(cnpj: string, input: {
215
+ signed_text: string;
216
+ ecnpj_signature: string;
217
+ }): Promise<CompanyInventory>;
218
+ /** Free, company only: sets (or removes, with "-") the https URL that receives signed CompanyWebhookEvent. signed_text = companyText("webhook", cnpj, { url }). */
219
+ setCompanyWebhook(cnpj: string, input: {
238
220
  signed_text: string;
239
221
  ecnpj_signature: string;
240
- since?: string;
241
222
  }): Promise<{
242
- credential_id: string;
243
- since: string;
244
- count: number;
245
- acts: Record<string, unknown>[];
223
+ cnpj: string;
224
+ webhook: string | null;
225
+ signed_at: string;
226
+ events: CompanyEvent[];
246
227
  }>;
247
228
  /** Free: credentials revoked since a date (default 30 days). */
248
229
  revocations(since?: string): Promise<{
@@ -316,8 +297,14 @@ export interface ECnpjMaterial {
316
297
  * Works with A1 certificates (file). A3 (token or smart card) must sign through the vendor's software.
317
298
  */
318
299
  export declare function signWithECnpj(material: ECnpjMaterial, text: string): Promise<string>;
319
- /** The text the company signs to read its agent's trail of acts. */
320
- export declare function actsExportText(credentialId: string, nonce?: string): string;
300
+ /**
301
+ * The text the company signs for its inventory or its webhook. The issuer accepts it for 10 minutes after `at`
302
+ * (and a webhook change only if newer than the last accepted one). For the webhook, url "-" removes it.
303
+ */
304
+ export declare function companyText(verb: "agents" | "webhook", cnpj: string, opts?: {
305
+ url?: string;
306
+ at?: Date;
307
+ }): string;
321
308
  /** The text the company signs to revoke a credential. */
322
309
  export declare function revocationText(credentialId: string, nonce?: string): string;
323
310
  export interface VerifyResult {
@@ -337,4 +324,23 @@ export declare function verifyAttestation(doc: Record<string, unknown>, opts?: {
337
324
  publicJwk?: JsonWebKey;
338
325
  fetch?: typeof fetch;
339
326
  }): Promise<VerifyResult>;
327
+ export interface OfflineCheck {
328
+ /** Issuer signature over the credential: proves what was issued and that it was not modified. */
329
+ signature: VerifyResult;
330
+ /** expires_at is in the future (the credential's own deadline). */
331
+ within_validity: boolean;
332
+ /**
333
+ * Always "unknown": a signature cannot say whether the credential was suspended or revoked after it was issued.
334
+ * Check verify() (or /v1/revocations) when you can; accepting an offline-only check is your risk until expires_at.
335
+ */
336
+ live_status: "unknown";
337
+ usable_offline: boolean;
338
+ }
339
+ /** Checks a credential with no call to the issuer's API (only the published key, unless publicJwk is given). */
340
+ export declare function verifyCredentialOffline(credential: Credential, opts?: {
341
+ baseUrl?: string;
342
+ publicJwk?: JsonWebKey;
343
+ fetch?: typeof fetch;
344
+ now?: Date;
345
+ }): Promise<OfflineCheck>;
340
346
  export * from "./auth";
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { toClientEvmSigner } from "@x402/evm";
21
21
  import { wrapFetchWithPayment } from "@x402/fetch";
22
22
  import { privateKeyToAccount } from "viem/accounts";
23
23
  import * as pkijs from "pkijs";
24
+ import { toBase64Url } from "./base64url";
24
25
  export const DEFAULT_BASE_URL = "https://kya-br-agents.marcelfons.workers.dev";
25
26
  export class KyaError extends Error {
26
27
  code;
@@ -80,10 +81,8 @@ export function createKyaClient(opts = {}) {
80
81
  renewProve: (id, proof) => call("POST", `/v1/agents/${encodeURIComponent(id)}/renew/prove`, proof),
81
82
  revoke: (id, input) => call("POST", `/v1/agents/${encodeURIComponent(id)}/revoke`, input),
82
83
  revocations: (since) => call("GET", `/v1/revocations${q({ since })}`),
83
- registerAct: (id, act) => call("POST", `/v1/agents/${encodeURIComponent(id)}/acts`, act, true, 0.02),
84
- act: (actId) => call("GET", `/v1/acts/${encodeURIComponent(actId)}`),
85
- actText: (id, act) => call("POST", `/v1/agents/${encodeURIComponent(id)}/acts/text`, act),
86
- exportActs: (id, input) => call("POST", `/v1/agents/${encodeURIComponent(id)}/acts/export`, input),
84
+ companyAgents: (cnpj, input) => call("POST", `/v1/companies/${encodeURIComponent(cnpj)}/agents`, input),
85
+ setCompanyWebhook: (cnpj, input) => call("POST", `/v1/companies/${encodeURIComponent(cnpj)}/webhook`, input),
87
86
  tools: [],
88
87
  execute: async (name, args) => {
89
88
  const t = client.tools.find((x) => x.name === name);
@@ -106,12 +105,6 @@ export function createKyaClient(opts = {}) {
106
105
  parameters: { type: "object", properties: { credential_id: ID, action: { type: "string" }, amount: { type: "number" }, currency: { type: "string" }, counterparty: { type: "string", description: "Your CNPJ, domain or wallet address" }, spent_today: { type: "number" } }, required: ["credential_id"], additionalProperties: false },
107
106
  execute: async (a) => client.allowed(String(a.credential_id), { action: a.action, amount: a.amount, currency: a.currency, counterparty: a.counterparty, spent_today: a.spent_today })
108
107
  },
109
- {
110
- name: "kya_register_act", priceUsd: 0.02,
111
- description: "Register an action you accepted from an agent ($0.02): the issuer re-checks the mandate including everything registered today by anyone (so daily ceilings hold across counterparties) and returns a signed receipt, your proof of what the agent could and did do. Denied acts are recorded too.",
112
- parameters: { type: "object", properties: { credential_id: ID, action: { type: "string" }, amount: { type: "number" }, currency: { type: "string" }, counterparty: { type: "string", description: "You: CNPJ, domain or wallet" }, reference: { type: "string" }, content_sha256: { type: "string" } }, required: ["credential_id", "action"], additionalProperties: false },
113
- execute: async (a) => { const { credential_id, ...act } = a; return client.registerAct(String(credential_id), act); }
114
- },
115
108
  {
116
109
  name: "kya_verify_paid", priceUsd: 0.01,
117
110
  description: "Same as kya_verify without the daily limit, plus a signed receipt of the verification ($0.01).",
@@ -143,7 +136,7 @@ export async function signChallengeWithEvmKey(privateKey, text) {
143
136
  export async function signChallengeWithEd25519(privateKey, text) {
144
137
  const key = typeof privateKey === "string" ? await crypto.subtle.importKey("pkcs8", Uint8Array.from(atob(privateKey), (c) => c.charCodeAt(0)), { name: "Ed25519" }, false, ["sign"]) : privateKey;
145
138
  const sig = new Uint8Array(await crypto.subtle.sign({ name: "Ed25519" }, key, new TextEncoder().encode(text)));
146
- return btoa(String.fromCharCode(...sig)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
139
+ return toBase64Url(sig);
147
140
  }
148
141
  const pemToDer = (pem) => Uint8Array.from(atob(pem.replace(/-----[^-]+-----/g, "").replace(/\s+/g, "")), (c) => c.charCodeAt(0)).buffer;
149
142
  const pemBlocks = (pem) => [...pem.matchAll(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g)].map((m) => m[0]);
@@ -173,22 +166,43 @@ export async function signWithECnpj(material, text) {
173
166
  s += String.fromCharCode(b);
174
167
  return btoa(s);
175
168
  }
176
- /** The text the company signs to read its agent's trail of acts. */
177
- export function actsExportText(credentialId, nonce = crypto.randomUUID()) {
178
- return `KYA Brasil: acts ${credentialId}\n${nonce}`;
169
+ /**
170
+ * The text the company signs for its inventory or its webhook. The issuer accepts it for 10 minutes after `at`
171
+ * (and a webhook change only if newer than the last accepted one). For the webhook, url "-" removes it.
172
+ */
173
+ export function companyText(verb, cnpj, opts = {}) {
174
+ const digits = cnpj.replace(/\D/g, "");
175
+ const extra = verb === "webhook" ? [`url: ${opts.url ?? "-"}`] : [];
176
+ return [`KYA Brasil: ${verb} ${digits}`, ...extra, `at: ${(opts.at ?? new Date()).toISOString()}`].join("\n");
179
177
  }
180
178
  /** The text the company signs to revoke a credential. */
181
179
  export function revocationText(credentialId, nonce = crypto.randomUUID()) {
182
180
  return `KYA Brasil: revoke ${credentialId}\n${nonce}`;
183
181
  }
184
182
  // --- Local verification of a credential or a signed answer (no network once you hold the key) ---
183
+ /**
184
+ * Key order of the canonical JSON: UTF-16 code units, exactly what a comparator-less sort() does. Not
185
+ * localeCompare: a locale-dependent order would change the signed bytes between machines and break every
186
+ * signature already issued.
187
+ */
188
+ function byCodeUnit(a, b) {
189
+ if (a < b)
190
+ return -1;
191
+ if (a > b)
192
+ return 1;
193
+ return 0;
194
+ }
185
195
  function canonicalize(v) {
186
196
  if (v === null || typeof v !== "object")
187
197
  return JSON.stringify(v);
188
198
  if (Array.isArray(v))
189
199
  return `[${v.map(canonicalize).join(",")}]`;
190
200
  const o = v;
191
- return `{${Object.keys(o).filter((k) => o[k] !== undefined).sort().map((k) => `${JSON.stringify(k)}:${canonicalize(o[k])}`).join(",")}}`;
201
+ const members = Object.keys(o)
202
+ .filter((k) => o[k] !== undefined)
203
+ .sort(byCodeUnit)
204
+ .map((k) => JSON.stringify(k) + ":" + canonicalize(o[k]));
205
+ return "{" + members.join(",") + "}";
192
206
  }
193
207
  /**
194
208
  * Verifies the Ed25519 attestation of a credential or a signed answer: recomputes the SHA-256 of the
@@ -218,4 +232,10 @@ export async function verifyAttestation(doc, opts = {}) {
218
232
  const ok = await crypto.subtle.verify({ name: "Ed25519" }, key, sig, new TextEncoder().encode(`${hex}\n${att.signed_at}`));
219
233
  return ok ? { valid: true, key_id: att.key_id, signed_at: att.signed_at } : { valid: false, reason: "signature does not verify", key_id: att.key_id, signed_at: att.signed_at };
220
234
  }
235
+ /** Checks a credential with no call to the issuer's API (only the published key, unless publicJwk is given). */
236
+ export async function verifyCredentialOffline(credential, opts = {}) {
237
+ const signature = await verifyAttestation(credential, opts);
238
+ const within_validity = Date.parse(credential.expires_at) > (opts.now ?? new Date()).getTime();
239
+ return { signature, within_validity, live_status: "unknown", usable_offline: signature.valid && within_validity && credential.status === "active" };
240
+ }
221
241
  export * from "./auth";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kya-brasil/agent-tools",
3
- "version": "0.4.0",
4
- "description": "KYA Brasil for AI agents: verify that an agent acts for a Brazilian company (e-CNPJ-signed, KYB-checked credential), check an action against its mandate, or give your own agent a credential. Sign in with KYA middleware (Hono, Express, Workers) and request signing. x402 payments (USDC on Base) handled for you. Adapters for Vercel AI SDK, LangChain, OpenAI and Anthropic.",
3
+ "version": "0.5.0",
4
+ "description": "KYA Brasil for AI agents: verify that an agent acts for a Brazilian company (e-CNPJ-signed credential, revocation and company registration checked daily), check an action against its mandate, or give your own agent a credential. Sign in with KYA middleware (Hono, Express, Workers) and request signing. x402 payments (USDC on Base) handled for you. Adapters for Vercel AI SDK, LangChain, OpenAI and Anthropic.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -58,12 +58,13 @@
58
58
  "viem": "^2.57.5"
59
59
  },
60
60
  "devDependencies": {
61
+ "@kya-br/core": "workspace:*",
61
62
  "@peculiar/asn1-schema": "^2.3.15",
62
63
  "@peculiar/asn1-x509": "^2.3.15",
63
64
  "@peculiar/x509": "^2.1.0",
65
+ "@types/node": "^22.20.5",
64
66
  "reflect-metadata": "^0.2.2",
65
67
  "typescript": "^5.9.3",
66
- "vitest": "^3.2.4",
67
- "@kya-br/core": "workspace:*"
68
+ "vitest": "^4.1.11"
68
69
  }
69
70
  }