@kya-brasil/agent-tools 0.5.0 → 0.5.1
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/dist/auth.d.ts +1 -1
- package/dist/auth.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ActionQuery, type AgentKey, type CredentialStatus, type KyaClient, type Mandate, type Verdict, type Verification, type KyaOptions } from "./index";
|
|
1
|
+
import { type ActionQuery, type AgentKey, type CredentialStatus, type KyaClient, type Mandate, type Verdict, type Verification, type KyaOptions } from "./index.js";
|
|
2
2
|
export declare const KYA_HEADERS: {
|
|
3
3
|
readonly credential: "kya-credential";
|
|
4
4
|
readonly created: "kya-created";
|
package/dist/auth.js
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { verifyMessage } from "viem";
|
|
29
29
|
import { privateKeyToAccount } from "viem/accounts";
|
|
30
|
-
import { createKyaClient } from "./index";
|
|
31
|
-
import { fromBase64Url, toBase64Url } from "./base64url";
|
|
30
|
+
import { createKyaClient } from "./index.js";
|
|
31
|
+
import { fromBase64Url, toBase64Url } from "./base64url.js";
|
|
32
32
|
export const KYA_HEADERS = { credential: "kya-credential", created: "kya-created", expires: "kya-expires", signature: "kya-signature", content: "kya-content-sha256" };
|
|
33
33
|
const enc = new TextEncoder();
|
|
34
34
|
const hex = (buf) => [...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -21,7 +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
|
+
import { toBase64Url } from "./base64url.js";
|
|
25
25
|
export const DEFAULT_BASE_URL = "https://kya-br-agents.marcelfons.workers.dev";
|
|
26
26
|
export class KyaError extends Error {
|
|
27
27
|
code;
|
|
@@ -238,4 +238,4 @@ export async function verifyCredentialOffline(credential, opts = {}) {
|
|
|
238
238
|
const within_validity = Date.parse(credential.expires_at) > (opts.now ?? new Date()).getTime();
|
|
239
239
|
return { signature, within_validity, live_status: "unknown", usable_offline: signature.valid && within_validity && credential.status === "active" };
|
|
240
240
|
}
|
|
241
|
-
export * from "./auth";
|
|
241
|
+
export * from "./auth.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-brasil/agent-tools",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
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",
|