@absol-labs/agent 0.7.3 → 0.9.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 (80) hide show
  1. package/README.md +19 -4
  2. package/dist/discovery/registry.d.ts +110 -305
  3. package/dist/discovery/registry.d.ts.map +1 -1
  4. package/dist/discovery/registry.js +141 -318
  5. package/dist/discovery/registry.js.map +1 -1
  6. package/dist/frameworks/agentkit.d.ts.map +1 -1
  7. package/dist/frameworks/agentkit.js +23 -6
  8. package/dist/frameworks/agentkit.js.map +1 -1
  9. package/dist/gateway/caller-auth-gateway.d.ts +103 -2
  10. package/dist/gateway/caller-auth-gateway.d.ts.map +1 -1
  11. package/dist/gateway/caller-auth-gateway.js +176 -19
  12. package/dist/gateway/caller-auth-gateway.js.map +1 -1
  13. package/dist/gateway/http-server.d.ts +12 -0
  14. package/dist/gateway/http-server.d.ts.map +1 -1
  15. package/dist/gateway/http-server.js +45 -1
  16. package/dist/gateway/http-server.js.map +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3 -3
  20. package/dist/index.js.map +1 -1
  21. package/dist/wallet/autonomous-wallet-store.d.ts +123 -0
  22. package/dist/wallet/autonomous-wallet-store.d.ts.map +1 -0
  23. package/dist/wallet/autonomous-wallet-store.js +318 -0
  24. package/dist/wallet/autonomous-wallet-store.js.map +1 -0
  25. package/dist/wallet/autonomous-wallet.d.ts +14 -39
  26. package/dist/wallet/autonomous-wallet.d.ts.map +1 -1
  27. package/dist/wallet/autonomous-wallet.js +12 -145
  28. package/dist/wallet/autonomous-wallet.js.map +1 -1
  29. package/dist/wallet/cdp-sdk.d.ts +23 -0
  30. package/dist/wallet/cdp-sdk.d.ts.map +1 -0
  31. package/dist/wallet/cdp-sdk.js +27 -0
  32. package/dist/wallet/cdp-sdk.js.map +1 -0
  33. package/dist/wallet/encrypted-file-credential-store.d.ts +41 -0
  34. package/dist/wallet/encrypted-file-credential-store.d.ts.map +1 -0
  35. package/dist/wallet/encrypted-file-credential-store.js +221 -0
  36. package/dist/wallet/encrypted-file-credential-store.js.map +1 -0
  37. package/dist/wallet/provider.d.ts +1 -1
  38. package/dist/wallet/provider.d.ts.map +1 -1
  39. package/dist/wallet/provider.js +8 -3
  40. package/dist/wallet/provider.js.map +1 -1
  41. package/dist/wallet/secret-service-probe.d.ts +56 -0
  42. package/dist/wallet/secret-service-probe.d.ts.map +1 -0
  43. package/dist/wallet/secret-service-probe.js +407 -0
  44. package/dist/wallet/secret-service-probe.js.map +1 -0
  45. package/dist/zktls/reclaim-js-sdk.d.ts +24 -0
  46. package/dist/zktls/reclaim-js-sdk.d.ts.map +1 -0
  47. package/dist/zktls/reclaim-js-sdk.js +29 -0
  48. package/dist/zktls/reclaim-js-sdk.js.map +1 -0
  49. package/dist/zktls/reclaim.d.ts +14 -2
  50. package/dist/zktls/reclaim.d.ts.map +1 -1
  51. package/dist/zktls/reclaim.js +29 -6
  52. package/dist/zktls/reclaim.js.map +1 -1
  53. package/dist/zktls/t2-delivery-proof.d.ts +8 -1
  54. package/dist/zktls/t2-delivery-proof.d.ts.map +1 -1
  55. package/dist/zktls/t2-delivery-proof.js +22 -6
  56. package/dist/zktls/t2-delivery-proof.js.map +1 -1
  57. package/docs/agent-layer.md +150 -0
  58. package/docs/autonomous-privy-wallet.md +133 -0
  59. package/docs/crewai.md +70 -0
  60. package/docs/eliza.md +109 -0
  61. package/docs/langchain.md +63 -0
  62. package/docs/mcp-hosted.md +137 -0
  63. package/docs/privy-embedded-wallet.md +102 -0
  64. package/docs/quickstart.md +370 -0
  65. package/docs/threat-model.md +160 -0
  66. package/package.json +19 -6
  67. package/src/discovery/registry.ts +242 -414
  68. package/src/frameworks/agentkit.ts +24 -5
  69. package/src/gateway/caller-auth-gateway.ts +281 -15
  70. package/src/gateway/http-server.ts +64 -0
  71. package/src/index.ts +24 -0
  72. package/src/wallet/autonomous-wallet-store.ts +487 -0
  73. package/src/wallet/autonomous-wallet.ts +57 -224
  74. package/src/wallet/cdp-sdk.ts +33 -0
  75. package/src/wallet/encrypted-file-credential-store.ts +341 -0
  76. package/src/wallet/provider.ts +16 -9
  77. package/src/wallet/secret-service-probe.ts +487 -0
  78. package/src/zktls/reclaim-js-sdk.ts +50 -0
  79. package/src/zktls/reclaim.ts +57 -23
  80. package/src/zktls/t2-delivery-proof.ts +28 -10
@@ -5,11 +5,12 @@ import {
5
5
  type DeliveryReceipt,
6
6
  type DeliveryReceiptDomainInput,
7
7
  } from "@absol-labs/shared";
8
- import {
9
- getHttpProviderClaimParamsFromProof,
10
- getProviderHashRequirementsFromSpec,
11
- verifyProof,
12
- } from "@reclaimprotocol/js-sdk";
8
+ // `@reclaimprotocol/js-sdk` is an OPTIONAL peer dependency and this module IS
9
+ // reachable from the package barrel, so it may import TYPES only (erased at
10
+ // compile time); runtime values come from `loadReclaimJsSdk()` at first use.
11
+ // Enforced by the barrel-reachability guard in test/flat-install.test.ts.
12
+ import type { verifyProof } from "@reclaimprotocol/js-sdk";
13
+ import { loadReclaimJsSdk } from "./reclaim-js-sdk.js";
13
14
  import {
14
15
  keccak256,
15
16
  stringToBytes,
@@ -167,7 +168,12 @@ const reclaimT2UrlSchema = z.string().url();
167
168
  export class ReclaimDeliveryProofAttestor implements DeliveryProofAttestor {
168
169
  private readonly client: ReclaimClientLike;
169
170
  private readonly config: ReclaimProofServiceConfig;
170
- private readonly verifyProofImpl: VerifyProofFn;
171
+ /**
172
+ * Caller-supplied verifier, if any. NOT defaulted in the constructor: the real
173
+ * `verifyProof` lives in the optional peer, loaded lazily at first use so that
174
+ * constructing this service never requires the peer to be installed.
175
+ */
176
+ private readonly verifyProofOverride: VerifyProofFn | undefined;
171
177
 
172
178
  constructor(
173
179
  config: ReclaimProofServiceConfig,
@@ -189,7 +195,13 @@ export class ReclaimDeliveryProofAttestor implements DeliveryProofAttestor {
189
195
  this.config.applicationSecret,
190
196
  this.config.logs ?? false,
191
197
  );
192
- this.verifyProofImpl = options.verifyProof ?? verifyProof;
198
+ this.verifyProofOverride = options.verifyProof;
199
+ }
200
+
201
+ /** Override if given, else the optional peer's `verifyProof`, loaded on demand. */
202
+ private async resolveVerifyProof(): Promise<VerifyProofFn> {
203
+ if (this.verifyProofOverride !== undefined) return this.verifyProofOverride;
204
+ return (await loadReclaimJsSdk()).verifyProof;
193
205
  }
194
206
 
195
207
  async proveDeliveryResponse(
@@ -245,8 +257,14 @@ export class ReclaimDeliveryProofAttestor implements DeliveryProofAttestor {
245
257
  );
246
258
  }
247
259
 
248
- const verification = await this.verifyProofImpl(proof, {
249
- ...getProviderHashRequirementsFromSpec({
260
+ // Verifier and provider-hash helper both live in the optional peer; load once.
261
+ const [verifyProofFn, reclaimSdk] = await Promise.all([
262
+ this.resolveVerifyProof(),
263
+ loadReclaimJsSdk(),
264
+ ]);
265
+
266
+ const verification = await verifyProofFn(proof, {
267
+ ...reclaimSdk.getProviderHashRequirementsFromSpec({
250
268
  requests: [toRequestSpec(parsed, method)],
251
269
  }),
252
270
  ...(parsed.useTee === true
@@ -266,7 +284,7 @@ export class ReclaimDeliveryProofAttestor implements DeliveryProofAttestor {
266
284
  );
267
285
  }
268
286
 
269
- const request = getHttpProviderClaimParamsFromProof(proof);
287
+ const request = reclaimSdk.getHttpProviderClaimParamsFromProof(proof);
270
288
  return {
271
289
  proof,
272
290
  request: {