@absol-labs/agent 0.5.0 → 0.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 (76) hide show
  1. package/README.md +49 -10
  2. package/dist/discovery/registry.d.ts +260 -15
  3. package/dist/discovery/registry.d.ts.map +1 -1
  4. package/dist/discovery/registry.js +174 -31
  5. package/dist/discovery/registry.js.map +1 -1
  6. package/dist/frameworks/agentkit.js +1 -1
  7. package/dist/frameworks/agentkit.js.map +1 -1
  8. package/dist/frameworks/crewai.js +1 -1
  9. package/dist/frameworks/crewai.js.map +1 -1
  10. package/dist/gateway/caller-auth-gateway.d.ts +3 -1
  11. package/dist/gateway/caller-auth-gateway.d.ts.map +1 -1
  12. package/dist/gateway/caller-auth-gateway.js +9 -7
  13. package/dist/gateway/caller-auth-gateway.js.map +1 -1
  14. package/dist/gateway/http-server.d.ts +3 -1
  15. package/dist/gateway/http-server.d.ts.map +1 -1
  16. package/dist/gateway/http-server.js +15 -1
  17. package/dist/gateway/http-server.js.map +1 -1
  18. package/dist/index.d.ts +8 -3
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +8 -3
  21. package/dist/index.js.map +1 -1
  22. package/dist/mcp/server.js +2 -0
  23. package/dist/mcp/server.js.map +1 -1
  24. package/dist/sdk/invoke.d.ts +16 -2
  25. package/dist/sdk/invoke.d.ts.map +1 -1
  26. package/dist/sdk/invoke.js +117 -1
  27. package/dist/sdk/invoke.js.map +1 -1
  28. package/dist/wallet/autonomous-wallet-broker.d.ts +97 -0
  29. package/dist/wallet/autonomous-wallet-broker.d.ts.map +1 -0
  30. package/dist/wallet/autonomous-wallet-broker.js +468 -0
  31. package/dist/wallet/autonomous-wallet-broker.js.map +1 -0
  32. package/dist/wallet/autonomous-wallet-protocol.d.ts +56 -0
  33. package/dist/wallet/autonomous-wallet-protocol.d.ts.map +1 -0
  34. package/dist/wallet/autonomous-wallet-protocol.js +15 -0
  35. package/dist/wallet/autonomous-wallet-protocol.js.map +1 -0
  36. package/dist/wallet/autonomous-wallet.d.ts +106 -0
  37. package/dist/wallet/autonomous-wallet.d.ts.map +1 -0
  38. package/dist/wallet/autonomous-wallet.js +494 -0
  39. package/dist/wallet/autonomous-wallet.js.map +1 -0
  40. package/dist/wallet/privy-broker-server-entry.d.ts +2 -0
  41. package/dist/wallet/privy-broker-server-entry.d.ts.map +1 -0
  42. package/dist/wallet/privy-broker-server-entry.js +8 -0
  43. package/dist/wallet/privy-broker-server-entry.js.map +1 -0
  44. package/dist/wallet/privy-broker-server.d.ts +29 -0
  45. package/dist/wallet/privy-broker-server.d.ts.map +1 -0
  46. package/dist/wallet/privy-broker-server.js +480 -0
  47. package/dist/wallet/privy-broker-server.js.map +1 -0
  48. package/dist/wallet/privy-session-broker.d.ts +109 -0
  49. package/dist/wallet/privy-session-broker.d.ts.map +1 -0
  50. package/dist/wallet/privy-session-broker.js +372 -0
  51. package/dist/wallet/privy-session-broker.js.map +1 -0
  52. package/dist/wallet/privy-session-provider.d.ts +21 -0
  53. package/dist/wallet/privy-session-provider.d.ts.map +1 -0
  54. package/dist/wallet/privy-session-provider.js +94 -0
  55. package/dist/wallet/privy-session-provider.js.map +1 -0
  56. package/dist/wallet/provider.d.ts +51 -2
  57. package/dist/wallet/provider.d.ts.map +1 -1
  58. package/dist/wallet/provider.js +138 -1
  59. package/dist/wallet/provider.js.map +1 -1
  60. package/package.json +4 -2
  61. package/src/discovery/registry.ts +213 -35
  62. package/src/frameworks/agentkit.ts +1 -1
  63. package/src/frameworks/crewai.ts +1 -1
  64. package/src/gateway/caller-auth-gateway.ts +13 -9
  65. package/src/gateway/http-server.ts +18 -1
  66. package/src/index.ts +78 -0
  67. package/src/mcp/server.ts +2 -0
  68. package/src/sdk/invoke.ts +186 -4
  69. package/src/wallet/autonomous-wallet-broker.ts +764 -0
  70. package/src/wallet/autonomous-wallet-protocol.ts +71 -0
  71. package/src/wallet/autonomous-wallet.ts +779 -0
  72. package/src/wallet/privy-broker-server-entry.ts +9 -0
  73. package/src/wallet/privy-broker-server.ts +573 -0
  74. package/src/wallet/privy-session-broker.ts +634 -0
  75. package/src/wallet/privy-session-provider.ts +129 -0
  76. package/src/wallet/provider.ts +260 -3
@@ -0,0 +1,71 @@
1
+ import type { Address, Hex } from "viem";
2
+
3
+ export const AUTONOMOUS_WALLET_VERSION = 1 as const;
4
+ export const AUTONOMOUS_WALLET_CHAIN_ID = 84532 as const;
5
+ export const AUTONOMOUS_WALLET_CAIP2 = "eip155:84532" as const;
6
+
7
+ export interface PreparedPrivyRequest {
8
+ readonly requestId: string;
9
+ readonly walletId: string;
10
+ readonly method: "eth_sendTransaction" | "eth_signTypedData_v4";
11
+ /** Base64 of the exact canonical Privy authorization payload. */
12
+ readonly payload: string;
13
+ readonly expiresAt: number;
14
+ }
15
+
16
+ export interface AutonomousWalletProof {
17
+ readonly version: typeof AUTONOMOUS_WALLET_VERSION;
18
+ readonly appId: string;
19
+ readonly chainId: typeof AUTONOMOUS_WALLET_CHAIN_ID;
20
+ readonly publicKey: string;
21
+ readonly nonce: string;
22
+ readonly issuedAt: number;
23
+ /** Base64 DER ECDSA P-256 signature over {@link autonomousProofBytes}. */
24
+ readonly signature: string;
25
+ }
26
+
27
+ export interface AutonomousWalletBroker {
28
+ provision(input: {
29
+ readonly appId: string;
30
+ readonly chainId: typeof AUTONOMOUS_WALLET_CHAIN_ID;
31
+ readonly publicKey: string;
32
+ readonly proof: AutonomousWalletProof;
33
+ readonly idempotencyKey: string;
34
+ }): Promise<{
35
+ readonly walletId: string;
36
+ readonly address: Address;
37
+ readonly policyId: string;
38
+ }>;
39
+ prepare(input: {
40
+ readonly walletId: string;
41
+ readonly publicKey: string;
42
+ readonly method: "eth_sendTransaction" | "eth_signTypedData_v4";
43
+ readonly params: readonly unknown[];
44
+ }): Promise<PreparedPrivyRequest>;
45
+ execute(input: {
46
+ readonly requestId: string;
47
+ readonly publicKey: string;
48
+ readonly signature: string;
49
+ }): Promise<Hex>;
50
+ }
51
+
52
+ /** Canonical proof-of-possession bytes shared by the agent and broker. */
53
+ export function autonomousProofBytes(input: {
54
+ readonly version: typeof AUTONOMOUS_WALLET_VERSION;
55
+ readonly appId: string;
56
+ readonly chainId: typeof AUTONOMOUS_WALLET_CHAIN_ID;
57
+ readonly publicKey: string;
58
+ readonly nonce: string;
59
+ readonly issuedAt: number;
60
+ }): Uint8Array {
61
+ return new TextEncoder().encode(
62
+ JSON.stringify({
63
+ appId: input.appId,
64
+ chainId: input.chainId,
65
+ nonce: input.nonce,
66
+ publicKey: input.publicKey,
67
+ version: input.version,
68
+ issuedAt: input.issuedAt,
69
+ }),
70
+ );
71
+ }