@0gfoundation/0g-agentdna 0.2.2 → 0.4.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 (59) hide show
  1. package/GUIDE.md +7 -7
  2. package/MIGRATION.md +8 -0
  3. package/MIGRATION.zh.md +5 -0
  4. package/README.md +2 -2
  5. package/dist/AgenticID.d.ts +2 -1
  6. package/dist/AgenticID.d.ts.map +1 -1
  7. package/dist/AgenticID.js +4 -3
  8. package/dist/AgenticID.js.map +1 -1
  9. package/dist/AgenticIDClient.d.ts +1 -1
  10. package/dist/AgenticIDClient.js +1 -1
  11. package/dist/AttestorClient.d.ts +1 -1
  12. package/dist/AttestorClient.js +1 -1
  13. package/dist/ReputationClient.d.ts +1 -1
  14. package/dist/ReputationClient.js +1 -1
  15. package/dist/SandboxClient.d.ts +1 -1
  16. package/dist/SandboxClient.js +1 -1
  17. package/dist/cli/commands/doctor.d.ts.map +1 -1
  18. package/dist/cli/commands/doctor.js +8 -2
  19. package/dist/cli/commands/doctor.js.map +1 -1
  20. package/dist/cli/commands/interactive.d.ts +1 -1
  21. package/dist/cli/commands/interactive.js +1 -1
  22. package/dist/cli/config.d.ts +10 -0
  23. package/dist/cli/config.d.ts.map +1 -1
  24. package/dist/cli/config.js +38 -0
  25. package/dist/cli/config.js.map +1 -1
  26. package/dist/cli/env.js +1 -1
  27. package/dist/cli/env.js.map +1 -1
  28. package/dist/cli/main.js +12 -2
  29. package/dist/cli/main.js.map +1 -1
  30. package/dist/cli/sdk.d.ts +1 -1
  31. package/dist/cli/sdk.js +1 -1
  32. package/dist/cli/settings.d.ts +3 -3
  33. package/dist/cli/settings.js +3 -3
  34. package/dist/constants.d.ts +3 -3
  35. package/dist/constants.js +2 -2
  36. package/dist/context.d.ts +2 -2
  37. package/dist/context.d.ts.map +1 -1
  38. package/dist/context.js +1 -1
  39. package/dist/secretEnv.js +1 -1
  40. package/dist/secretEnv.js.map +1 -1
  41. package/dist/types.d.ts +1 -1
  42. package/dist/types.js +1 -1
  43. package/package.json +1 -1
  44. package/src/AgenticID.ts +4 -3
  45. package/src/AgenticIDClient.ts +1 -1
  46. package/src/AttestorClient.ts +1 -1
  47. package/src/ReputationClient.ts +1 -1
  48. package/src/SandboxClient.ts +1 -1
  49. package/src/cli/commands/doctor.ts +8 -2
  50. package/src/cli/commands/interactive.ts +1 -1
  51. package/src/cli/config.ts +36 -0
  52. package/src/cli/env.ts +1 -1
  53. package/src/cli/main.ts +13 -3
  54. package/src/cli/sdk.ts +1 -1
  55. package/src/cli/settings.ts +3 -3
  56. package/src/constants.ts +3 -3
  57. package/src/context.ts +2 -2
  58. package/src/secretEnv.ts +1 -1
  59. package/src/types.ts +1 -1
package/src/constants.ts CHANGED
@@ -37,7 +37,7 @@ export const ZERO_G_MAINNET = {
37
37
  } as const;
38
38
 
39
39
  /**
40
- * Contract address set — pass one explicitly to `new AgenticID({ addresses })`.
40
+ * Contract address set — pass one explicitly to `new AgentDNA({ addresses })`.
41
41
  *
42
42
  * Addresses are a deployment artifact, NOT baked into the SDK: an RPC + these
43
43
  * addresses fully determine the target contracts, and keeping them out of the
@@ -67,7 +67,7 @@ export interface ContractAddresses {
67
67
  }
68
68
 
69
69
  /**
70
- * Default RPC URL for the 0G Galileo Testnet (override via `AgenticID({ rpcUrl })`).
70
+ * Default RPC URL for the 0G Galileo Testnet (override via `new AgentDNA({ rpcUrl })`).
71
71
  */
72
72
  export const RPC_URL = 'https://evmrpc-testnet.0g.ai';
73
73
 
@@ -103,4 +103,4 @@ export const RECEIPT_WAIT = {
103
103
 
104
104
  /** This SDK's own version. Kept in lockstep with package.json by a test —
105
105
  * a runtime package.json read would break browser bundles, so a constant. */
106
- export const SDK_VERSION = '0.2.2';
106
+ export const SDK_VERSION = '0.4.0';
package/src/context.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @file context.ts
3
- * @description Shared config + runtime context for the AgenticID facade and its
3
+ * @description Shared config + runtime context for the AgentDNA facade and its
4
4
  * internal per-contract clients. Constructed once; passed to each sub-client.
5
5
  */
6
6
 
@@ -16,7 +16,7 @@ import {
16
16
  import { privateKeyToAccount } from 'viem/accounts';
17
17
  import { ZERO_G_TESTNET, RPC_URL, type ContractAddresses } from './constants';
18
18
 
19
- /** Public config for `new AgenticID(config)`. */
19
+ /** Public config for `new AgentDNA(config)` (exported as `AgentDNAConfig`). */
20
20
  export interface AgenticIDConfig {
21
21
  /** RPC endpoint. Defaults to the 0G Galileo testnet RPC. */
22
22
  rpcUrl?: string;
package/src/secretEnv.ts CHANGED
@@ -118,7 +118,7 @@ export function randomBytes(n: number): Uint8Array {
118
118
  cryptoObj = (require('crypto') as { webcrypto?: WebCrypto }).webcrypto;
119
119
  }
120
120
  if (!cryptoObj?.getRandomValues) {
121
- throw new Error('AgenticID SDK: no WebCrypto available (need a browser or Node >= 18 with crypto.webcrypto)');
121
+ throw new Error('AgentDNA SDK: no WebCrypto available (need a browser or Node >= 18 with crypto.webcrypto)');
122
122
  }
123
123
  cryptoObj.getRandomValues(a);
124
124
  return a;
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @file types.ts
3
- * @description All TypeScript types for the 0G AgenticID SDK, mirroring the Solidity structs and enums.
3
+ * @description All TypeScript types for the 0G AgentDNA SDK, mirroring the Solidity structs and enums.
4
4
  */
5
5
 
6
6
  /**