@0gfoundation/0g-agentdna 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/GUIDE.md +190 -40
- package/OPERATORS.md +164 -0
- package/OPERATORS.zh.md +141 -0
- package/PROVIDERS.md +6 -0
- package/PROVIDERS.zh.md +3 -1
- package/README.md +84 -11
- package/dist/AgentClient.d.ts +374 -26
- package/dist/AgentClient.d.ts.map +1 -1
- package/dist/AgentClient.js +323 -40
- package/dist/AgentClient.js.map +1 -1
- package/dist/AgenticID.d.ts +170 -80
- package/dist/AgenticID.d.ts.map +1 -1
- package/dist/AgenticID.js +300 -42
- package/dist/AgenticID.js.map +1 -1
- package/dist/AttestorClient.d.ts +115 -31
- package/dist/AttestorClient.d.ts.map +1 -1
- package/dist/AttestorClient.js +276 -56
- package/dist/AttestorClient.js.map +1 -1
- package/dist/Credentials.d.ts +574 -0
- package/dist/Credentials.d.ts.map +1 -0
- package/dist/Credentials.js +838 -0
- package/dist/Credentials.js.map +1 -0
- package/dist/Operators.d.ts +60 -0
- package/dist/Operators.d.ts.map +1 -0
- package/dist/Operators.js +38 -0
- package/dist/Operators.js.map +1 -0
- package/dist/Providers.d.ts +13 -0
- package/dist/Providers.d.ts.map +1 -1
- package/dist/Providers.js +20 -1
- package/dist/Providers.js.map +1 -1
- package/dist/Releases.d.ts +51 -0
- package/dist/Releases.d.ts.map +1 -0
- package/dist/Releases.js +72 -0
- package/dist/Releases.js.map +1 -0
- package/dist/ReputationClient.d.ts +47 -3
- package/dist/ReputationClient.d.ts.map +1 -1
- package/dist/ReputationClient.js +204 -78
- package/dist/ReputationClient.js.map +1 -1
- package/dist/ServeProof.d.ts +70 -23
- package/dist/ServeProof.d.ts.map +1 -1
- package/dist/ServeProof.js +94 -35
- package/dist/ServeProof.js.map +1 -1
- package/dist/ServeSession.d.ts +17 -2
- package/dist/ServeSession.d.ts.map +1 -1
- package/dist/ServeSession.js +77 -9
- package/dist/ServeSession.js.map +1 -1
- package/dist/Settings.d.ts +25 -1
- package/dist/Settings.d.ts.map +1 -1
- package/dist/Settings.js +53 -1
- package/dist/Settings.js.map +1 -1
- package/dist/TrustRegistry.d.ts +28 -0
- package/dist/TrustRegistry.d.ts.map +1 -0
- package/dist/TrustRegistry.js +67 -0
- package/dist/TrustRegistry.js.map +1 -0
- package/dist/abi.d.ts +346 -34
- package/dist/abi.d.ts.map +1 -1
- package/dist/abi.js +150 -30
- package/dist/abi.js.map +1 -1
- package/dist/cli/attach.d.ts +79 -0
- package/dist/cli/attach.d.ts.map +1 -0
- package/dist/cli/attach.js +253 -0
- package/dist/cli/attach.js.map +1 -0
- package/dist/cli/commands/cells.d.ts +45 -0
- package/dist/cli/commands/cells.d.ts.map +1 -1
- package/dist/cli/commands/cells.js +77 -0
- package/dist/cli/commands/cells.js.map +1 -1
- package/dist/cli/commands/cred.d.ts +12 -0
- package/dist/cli/commands/cred.d.ts.map +1 -0
- package/dist/cli/commands/cred.js +43 -0
- package/dist/cli/commands/cred.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +44 -35
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/interactive.d.ts +597 -21
- package/dist/cli/commands/interactive.d.ts.map +1 -1
- package/dist/cli/commands/interactive.js +5082 -1323
- package/dist/cli/commands/interactive.js.map +1 -1
- package/dist/cli/commands/list.d.ts +5 -5
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/list.js +21 -26
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/providers.d.ts +4 -0
- package/dist/cli/commands/providers.d.ts.map +1 -1
- package/dist/cli/commands/providers.js +19 -5
- package/dist/cli/commands/providers.js.map +1 -1
- package/dist/cli/commands/releases.d.ts +13 -0
- package/dist/cli/commands/releases.d.ts.map +1 -0
- package/dist/cli/commands/releases.js +65 -0
- package/dist/cli/commands/releases.js.map +1 -0
- package/dist/cli/commands/settings.d.ts +5 -0
- package/dist/cli/commands/settings.d.ts.map +1 -1
- package/dist/cli/commands/settings.js +70 -24
- package/dist/cli/commands/settings.js.map +1 -1
- package/dist/cli/commands/status.d.ts +2 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +22 -19
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/config.d.ts +48 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +114 -5
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/credentials.d.ts +179 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +1443 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/download.d.ts +21 -0
- package/dist/cli/download.d.ts.map +1 -0
- package/dist/cli/download.js +89 -0
- package/dist/cli/download.js.map +1 -0
- package/dist/cli/env.d.ts +6 -0
- package/dist/cli/env.d.ts.map +1 -1
- package/dist/cli/env.js +18 -6
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/envelope.d.ts +4 -2
- package/dist/cli/envelope.d.ts.map +1 -1
- package/dist/cli/envelope.js +10 -6
- package/dist/cli/envelope.js.map +1 -1
- package/dist/cli/errors.d.ts +45 -1
- package/dist/cli/errors.d.ts.map +1 -1
- package/dist/cli/errors.js +77 -0
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/inference.d.ts.map +1 -1
- package/dist/cli/inference.js +7 -0
- package/dist/cli/inference.js.map +1 -1
- package/dist/cli/inkView.d.ts +341 -0
- package/dist/cli/inkView.d.ts.map +1 -0
- package/dist/cli/inkView.js +1019 -0
- package/dist/cli/inkView.js.map +1 -0
- package/dist/cli/legacy/modelKey.d.ts +24 -0
- package/dist/cli/legacy/modelKey.d.ts.map +1 -0
- package/dist/cli/legacy/modelKey.js +32 -0
- package/dist/cli/legacy/modelKey.js.map +1 -0
- package/dist/cli/livePrompt.d.ts +212 -0
- package/dist/cli/livePrompt.d.ts.map +1 -0
- package/dist/cli/livePrompt.js +576 -0
- package/dist/cli/livePrompt.js.map +1 -0
- package/dist/cli/main.js +206 -72
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/modelkey.d.ts +64 -0
- package/dist/cli/modelkey.d.ts.map +1 -0
- package/dist/cli/modelkey.js +113 -0
- package/dist/cli/modelkey.js.map +1 -0
- package/dist/cli/outboxSync.d.ts +51 -0
- package/dist/cli/outboxSync.d.ts.map +1 -0
- package/dist/cli/outboxSync.js +210 -0
- package/dist/cli/outboxSync.js.map +1 -0
- package/dist/cli/plain.d.ts +46 -0
- package/dist/cli/plain.d.ts.map +1 -0
- package/dist/cli/plain.js +260 -0
- package/dist/cli/plain.js.map +1 -0
- package/dist/cli/proofs.d.ts +5 -0
- package/dist/cli/proofs.d.ts.map +1 -1
- package/dist/cli/proofs.js +20 -0
- package/dist/cli/proofs.js.map +1 -1
- package/dist/cli/ref.d.ts.map +1 -1
- package/dist/cli/ref.js +3 -2
- package/dist/cli/ref.js.map +1 -1
- package/dist/cli/releaseNotice.d.ts +64 -0
- package/dist/cli/releaseNotice.d.ts.map +1 -0
- package/dist/cli/releaseNotice.js +194 -0
- package/dist/cli/releaseNotice.js.map +1 -0
- package/dist/cli/sdk.d.ts +18 -0
- package/dist/cli/sdk.d.ts.map +1 -1
- package/dist/cli/sdk.js +99 -1
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli/settings.d.ts +87 -6
- package/dist/cli/settings.d.ts.map +1 -1
- package/dist/cli/settings.js +270 -18
- package/dist/cli/settings.js.map +1 -1
- package/dist/cli/textfit.d.ts +28 -0
- package/dist/cli/textfit.d.ts.map +1 -0
- package/dist/cli/textfit.js +111 -0
- package/dist/cli/textfit.js.map +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context.d.ts +26 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -0
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +19 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy/modelKey.d.ts +67 -0
- package/dist/legacy/modelKey.d.ts.map +1 -0
- package/dist/legacy/modelKey.js +80 -0
- package/dist/legacy/modelKey.js.map +1 -0
- package/dist/legacy/serveProofV1.d.ts +56 -0
- package/dist/legacy/serveProofV1.d.ts.map +1 -0
- package/dist/legacy/serveProofV1.js +91 -0
- package/dist/legacy/serveProofV1.js.map +1 -0
- package/dist/provider-catalog.json +3 -2
- package/dist/secretEnv.d.ts +18 -3
- package/dist/secretEnv.d.ts.map +1 -1
- package/dist/secretEnv.js +16 -2
- package/dist/secretEnv.js.map +1 -1
- package/dist/types.d.ts +63 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/viemErrors.d.ts +30 -0
- package/dist/viemErrors.d.ts.map +1 -0
- package/dist/viemErrors.js +36 -0
- package/dist/viemErrors.js.map +1 -0
- package/package.json +5 -1
- package/src/AgentClient.ts +622 -68
- package/src/AgenticID.ts +345 -56
- package/src/AttestorClient.ts +330 -83
- package/src/Credentials.ts +1027 -0
- package/src/Operators.ts +71 -0
- package/src/Providers.ts +20 -0
- package/src/Releases.ts +95 -0
- package/src/ReputationClient.ts +231 -79
- package/src/ServeProof.ts +123 -39
- package/src/ServeSession.ts +91 -9
- package/src/Settings.ts +61 -1
- package/src/TrustRegistry.ts +75 -0
- package/src/abi.ts +153 -30
- package/src/cli/attach.ts +257 -0
- package/src/cli/commands/cells.ts +104 -0
- package/src/cli/commands/cred.ts +44 -0
- package/src/cli/commands/doctor.ts +45 -37
- package/src/cli/commands/interactive.ts +4120 -664
- package/src/cli/commands/list.ts +21 -30
- package/src/cli/commands/providers.ts +17 -4
- package/src/cli/commands/releases.ts +60 -0
- package/src/cli/commands/settings.ts +75 -28
- package/src/cli/commands/status.ts +24 -21
- package/src/cli/config.ts +119 -4
- package/src/cli/credentials.ts +1379 -0
- package/src/cli/download.ts +80 -0
- package/src/cli/env.ts +22 -7
- package/src/cli/envelope.ts +10 -6
- package/src/cli/errors.ts +92 -0
- package/src/cli/inference.ts +8 -1
- package/src/cli/inkView.ts +969 -0
- package/src/cli/legacy/modelKey.ts +35 -0
- package/src/cli/livePrompt.ts +615 -0
- package/src/cli/main.ts +206 -76
- package/src/cli/modelkey.ts +124 -0
- package/src/cli/outboxSync.ts +231 -0
- package/src/cli/plain.ts +260 -0
- package/src/cli/proofs.ts +27 -0
- package/src/cli/ref.ts +5 -4
- package/src/cli/releaseNotice.ts +200 -0
- package/src/cli/sdk.ts +87 -7
- package/src/cli/settings.ts +272 -22
- package/src/cli/textfit.ts +95 -0
- package/src/constants.ts +1 -1
- package/src/context.ts +28 -0
- package/src/index.ts +50 -7
- package/src/legacy/modelKey.ts +80 -0
- package/src/legacy/serveProofV1.ts +124 -0
- package/src/provider-catalog.json +3 -2
- package/src/secretEnv.ts +18 -3
- package/src/types.ts +60 -1
- package/src/viemErrors.ts +39 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file legacy/serveProofV1.ts
|
|
3
|
+
* @description LEGACY(v1): ServeProof v1 — what every image before the
|
|
4
|
+
* layered runtime signs (sealed/LAYERS.md §8, "Compatibility with existing
|
|
5
|
+
* 0g-harness images"): a proof whose envelope carries no `version`.
|
|
6
|
+
*
|
|
7
|
+
* The rest of the SDK speaks v2 and comes here only for a proof without a
|
|
8
|
+
* version: the v1 digest, and the registry's and the batcher's v1 entry
|
|
9
|
+
* points. Once those images are gone, delete this file and every
|
|
10
|
+
* `LEGACY(v1)` mark (`git grep -n 'LEGACY(v1)'`): the compiler lists every
|
|
11
|
+
* call site, each one branch of a version dispatch, and the marks show the
|
|
12
|
+
* places it cannot see — where a proof without a `version` is read as v1, the
|
|
13
|
+
* v1 ABI entries and vectors. A proof without a version is then malformed.
|
|
14
|
+
* The registry keeps its v1 entry points, and nothing here is needed to read
|
|
15
|
+
* the marks v1 proofs left.
|
|
16
|
+
*/
|
|
17
|
+
import { type Account, type Address, type Chain, type Hash, type Hex, type WalletClient } from 'viem';
|
|
18
|
+
import type { FeedbackArgs } from '../ReputationClient';
|
|
19
|
+
import type { ServeProof, TaskReveal } from '../types';
|
|
20
|
+
/** The fields the v1 preimage covers (BuildServeProofHashParams without a version). */
|
|
21
|
+
interface ServeProofV1Fields {
|
|
22
|
+
chainId: bigint;
|
|
23
|
+
verifyingContract: Address;
|
|
24
|
+
submitter: Address;
|
|
25
|
+
agentId: bigint;
|
|
26
|
+
timestamp: bigint;
|
|
27
|
+
deadline: bigint;
|
|
28
|
+
taskHash: Hash;
|
|
29
|
+
dataHashes: Hash[];
|
|
30
|
+
frameworkHash: Hash;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The v1 inner hash, exactly as the registry's `_serveProofHash`:
|
|
34
|
+
*
|
|
35
|
+
* ```solidity
|
|
36
|
+
* keccak256(abi.encode(
|
|
37
|
+
* block.chainid, identityRegistry, submitter, agentId, timestamp,
|
|
38
|
+
* deadline, taskHash, keccak256(abi.encodePacked(dataHashes)),
|
|
39
|
+
* frameworkHash))
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Every field is a static 32-byte word (uint256, a left-padded address,
|
|
43
|
+
* bytes32), so abi.encode is a plain concatenation.
|
|
44
|
+
*/
|
|
45
|
+
export declare function serveProofHashV1(p: ServeProofV1Fields): Hash;
|
|
46
|
+
/** `attestFeedback`, or `attestFeedbackWithTask` with a task, for a v1 proof. */
|
|
47
|
+
export declare function attestV1(wallet: WalletClient, tx: {
|
|
48
|
+
address: Address;
|
|
49
|
+
account: Account;
|
|
50
|
+
chain: Chain;
|
|
51
|
+
}, agentId: bigint, feedbackIndex: bigint, proof: ServeProof, task?: TaskReveal): Promise<Hash>;
|
|
52
|
+
/** FeedbackBatcher calldata for a v1 proof: `giveFeedbackAndAttest`. An empty
|
|
53
|
+
* `task.method` routes to plain attestFeedback. */
|
|
54
|
+
export declare function batchCallV1(feedback: FeedbackArgs, proof: ServeProof, task: TaskReveal): Hex;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=serveProofV1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serveProofV1.d.ts","sourceRoot":"","sources":["../../src/legacy/serveProofV1.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvD,uFAAuF;AACvF,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,IAAI,CAAC;IACf,UAAU,EAAE,IAAI,EAAE,CAAC;IACnB,aAAa,EAAE,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAa5D;AAkBD,iFAAiF;AACjF,wBAAgB,QAAQ,CACtB,MAAM,EAAE,YAAY,EACpB,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,EACxD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,UAAU,EACjB,IAAI,CAAC,EAAE,UAAU,GAChB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED;oDACoD;AACpD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,GAAG,CAM5F"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file legacy/serveProofV1.ts
|
|
4
|
+
* @description LEGACY(v1): ServeProof v1 — what every image before the
|
|
5
|
+
* layered runtime signs (sealed/LAYERS.md §8, "Compatibility with existing
|
|
6
|
+
* 0g-harness images"): a proof whose envelope carries no `version`.
|
|
7
|
+
*
|
|
8
|
+
* The rest of the SDK speaks v2 and comes here only for a proof without a
|
|
9
|
+
* version: the v1 digest, and the registry's and the batcher's v1 entry
|
|
10
|
+
* points. Once those images are gone, delete this file and every
|
|
11
|
+
* `LEGACY(v1)` mark (`git grep -n 'LEGACY(v1)'`): the compiler lists every
|
|
12
|
+
* call site, each one branch of a version dispatch, and the marks show the
|
|
13
|
+
* places it cannot see — where a proof without a `version` is read as v1, the
|
|
14
|
+
* v1 ABI entries and vectors. A proof without a version is then malformed.
|
|
15
|
+
* The registry keeps its v1 entry points, and nothing here is needed to read
|
|
16
|
+
* the marks v1 proofs left.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.serveProofHashV1 = serveProofHashV1;
|
|
20
|
+
exports.attestV1 = attestV1;
|
|
21
|
+
exports.batchCallV1 = batchCallV1;
|
|
22
|
+
const viem_1 = require("viem");
|
|
23
|
+
const abi_1 = require("../abi");
|
|
24
|
+
/**
|
|
25
|
+
* The v1 inner hash, exactly as the registry's `_serveProofHash`:
|
|
26
|
+
*
|
|
27
|
+
* ```solidity
|
|
28
|
+
* keccak256(abi.encode(
|
|
29
|
+
* block.chainid, identityRegistry, submitter, agentId, timestamp,
|
|
30
|
+
* deadline, taskHash, keccak256(abi.encodePacked(dataHashes)),
|
|
31
|
+
* frameworkHash))
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Every field is a static 32-byte word (uint256, a left-padded address,
|
|
35
|
+
* bytes32), so abi.encode is a plain concatenation.
|
|
36
|
+
*/
|
|
37
|
+
function serveProofHashV1(p) {
|
|
38
|
+
const packedDataHashes = p.dataHashes.length > 0 ? (0, viem_1.concat)(p.dataHashes) : '0x';
|
|
39
|
+
return (0, viem_1.keccak256)((0, viem_1.concat)([
|
|
40
|
+
(0, viem_1.pad)((0, viem_1.toHex)(p.chainId), { size: 32 }),
|
|
41
|
+
(0, viem_1.pad)(p.verifyingContract, { size: 32 }),
|
|
42
|
+
(0, viem_1.pad)(p.submitter, { size: 32 }),
|
|
43
|
+
(0, viem_1.pad)((0, viem_1.toHex)(p.agentId), { size: 32 }),
|
|
44
|
+
(0, viem_1.pad)((0, viem_1.toHex)(p.timestamp), { size: 32 }),
|
|
45
|
+
(0, viem_1.pad)((0, viem_1.toHex)(p.deadline), { size: 32 }),
|
|
46
|
+
(0, viem_1.pad)(p.taskHash, { size: 32 }),
|
|
47
|
+
(0, viem_1.pad)((0, viem_1.keccak256)(packedDataHashes), { size: 32 }),
|
|
48
|
+
(0, viem_1.pad)(p.frameworkHash, { size: 32 }),
|
|
49
|
+
]));
|
|
50
|
+
}
|
|
51
|
+
/** The eight on-chain fields of a v1 proof. The envelope's `validator` is not
|
|
52
|
+
* one of them (ABI encoding would drop an undeclared key anyway; this keeps
|
|
53
|
+
* the intent explicit). */
|
|
54
|
+
function v1Tuple(proof) {
|
|
55
|
+
return {
|
|
56
|
+
agentId: proof.agentId,
|
|
57
|
+
submitter: proof.submitter,
|
|
58
|
+
timestamp: proof.timestamp,
|
|
59
|
+
deadline: proof.deadline,
|
|
60
|
+
taskHash: proof.taskHash,
|
|
61
|
+
dataHashes: proof.dataHashes,
|
|
62
|
+
frameworkHash: proof.frameworkHash,
|
|
63
|
+
signature: proof.signature,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** `attestFeedback`, or `attestFeedbackWithTask` with a task, for a v1 proof. */
|
|
67
|
+
function attestV1(wallet, tx, agentId, feedbackIndex, proof, task) {
|
|
68
|
+
return task
|
|
69
|
+
? wallet.writeContract({
|
|
70
|
+
...tx,
|
|
71
|
+
abi: abi_1.verifiedFeedbackAbi,
|
|
72
|
+
functionName: 'attestFeedbackWithTask',
|
|
73
|
+
args: [agentId, feedbackIndex, v1Tuple(proof), task],
|
|
74
|
+
})
|
|
75
|
+
: wallet.writeContract({
|
|
76
|
+
...tx,
|
|
77
|
+
abi: abi_1.verifiedFeedbackAbi,
|
|
78
|
+
functionName: 'attestFeedback',
|
|
79
|
+
args: [agentId, feedbackIndex, v1Tuple(proof)],
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** FeedbackBatcher calldata for a v1 proof: `giveFeedbackAndAttest`. An empty
|
|
83
|
+
* `task.method` routes to plain attestFeedback. */
|
|
84
|
+
function batchCallV1(feedback, proof, task) {
|
|
85
|
+
return (0, viem_1.encodeFunctionData)({
|
|
86
|
+
abi: abi_1.feedbackBatcherAbi,
|
|
87
|
+
functionName: 'giveFeedbackAndAttest',
|
|
88
|
+
args: [...feedback, v1Tuple(proof), task],
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=serveProofV1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serveProofV1.js","sourceRoot":"","sources":["../../src/legacy/serveProofV1.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AA6CH,4CAaC;AAmBD,4BAqBC;AAID,kCAMC;AA1GD,+BAYc;AACd,gCAAiE;AAiBjE;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAAC,CAAqB;IACpD,MAAM,gBAAgB,GAAQ,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,aAAM,EAAC,CAAC,CAAC,UAA4B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtG,OAAO,IAAA,gBAAS,EAAC,IAAA,aAA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AC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,SAAgB,QAAQ,CACtB,MAAoB,EACpB,EAAwD,EACxD,OAAe,EACf,aAAqB,EACrB,KAAiB,EACjB,IAAiB;IAEjB,OAAO,IAAI;QACT,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;YACnB,GAAG,EAAE;YACL,GAAG,EAAE,yBAAmB;YACxB,YAAY,EAAE,wBAAwB;YACtC,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;SACrD,CAAC;QACJ,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;YACnB,GAAG,EAAE;YACL,GAAG,EAAE,yBAAmB;YACxB,YAAY,EAAE,gBAAgB;YAC9B,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;SAC/C,CAAC,CAAC;AACT,CAAC;AAED;oDACoD;AACpD,SAAgB,WAAW,CAAC,QAAsB,EAAE,KAAiB,EAAE,IAAgB;IACrF,OAAO,IAAA,yBAAkB,EAAC;QACxB,GAAG,EAAE,wBAAkB;QACvB,YAAY,EAAE,uBAAuB;QACrC,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"anthropic": "https://router-api.0g.ai"
|
|
10
10
|
},
|
|
11
11
|
"modelCatalog": "https://router-api.0g.ai/v1/models",
|
|
12
|
+
"webSearch": "0g-router",
|
|
12
13
|
"compatibility": {
|
|
13
14
|
"requiresStringContent": true,
|
|
14
15
|
"supportsStore": false,
|
|
@@ -18,6 +19,6 @@
|
|
|
18
19
|
"maxTokensField": "max_tokens"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
|
-
{ "id": "openai", "name": "OpenAI", "native": true, "formats": ["openai"] },
|
|
22
|
-
{ "id": "anthropic", "name": "Anthropic", "native": true, "formats": ["anthropic"] }
|
|
22
|
+
{ "id": "openai", "name": "OpenAI", "native": true, "formats": ["openai"], "webSearch": "openai" },
|
|
23
|
+
{ "id": "anthropic", "name": "Anthropic", "native": true, "formats": ["anthropic"], "webSearch": "anthropic" }
|
|
23
24
|
]
|
package/dist/secretEnv.d.ts
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
* agent's agentSeal public key, so it never appears in clear in the envelope
|
|
5
5
|
* the owner's wallet signs (issue #166).
|
|
6
6
|
*
|
|
7
|
+
* LEGACY(model-key): model keys go into the agent's credential set
|
|
8
|
+
* (Credentials.ts; an integrator's with `sealModelKey`). The secret env is the
|
|
9
|
+
* copy sent with the request for images that read only that
|
|
10
|
+
* (legacy/modelKey.ts), and its parts here go with it: the scheme and its
|
|
11
|
+
* variable, {@link SecretEnvMode}, `sealSecretEnv`, `checkSealedSecretEnv` and
|
|
12
|
+
* the request-only refusal codes. What stays: {@link eciesEncrypt}, which the
|
|
13
|
+
* credential set seals with; {@link SecretEnvRefusedError}, which the
|
|
14
|
+
* credential set's checks throw too; the agentSeal key checks
|
|
15
|
+
* (`parseAgentSealPubkey`, `publicKeyToAddress`).
|
|
16
|
+
*
|
|
7
17
|
* The sandbox "create" envelope is signed with EIP-191 `personal_sign`, and a
|
|
8
18
|
* wallet shows that message verbatim. With the key in `env.API_KEY`, the
|
|
9
19
|
* prompt displayed it, and every hop that relays the envelope (an
|
|
@@ -29,12 +39,13 @@
|
|
|
29
39
|
* 16-byte nonce; wire format `ephemeralPub(65) ‖ nonce(16) ‖ tag(16) ‖ ct`.
|
|
30
40
|
*/
|
|
31
41
|
import { type Address, type Hex } from 'viem';
|
|
32
|
-
/** `GET /config` value that says this attestor's sealed images open a secret env. */
|
|
42
|
+
/** LEGACY(model-key): `GET /config` value that says this attestor's sealed images open a secret env. */
|
|
33
43
|
export declare const SECRET_ENV_SCHEME = "agent-seal-ecies-v1";
|
|
34
|
-
/**
|
|
44
|
+
/** LEGACY(model-key): the container env var that carries the sealed secret env. */
|
|
35
45
|
export declare const SECRET_ENV_VAR = "SEAL_SECRET_ENV";
|
|
36
46
|
/**
|
|
37
|
-
*
|
|
47
|
+
* LEGACY(model-key): how `start` / `reset` / `retry` / `deploy` deliver the
|
|
48
|
+
* request copy of the inference key:
|
|
38
49
|
* - `'auto'` (default): sealed to the agent when the attestor advertises
|
|
39
50
|
* `secret_env_scheme` and the agent exists already; otherwise in clear
|
|
40
51
|
* (older attestors, and a one-shot `deploy` with `sandbox`, whose agent
|
|
@@ -98,6 +109,8 @@ export declare function publicKeyToAddress(pubkey: Uint8Array): Address;
|
|
|
98
109
|
/** eciesjs-compatible ECIES encryption to a secp256k1 public key (33 or 65 bytes). */
|
|
99
110
|
export declare function eciesEncrypt(recipientPubkey: Uint8Array, plaintext: Uint8Array): Uint8Array;
|
|
100
111
|
/**
|
|
112
|
+
* LEGACY(model-key): the request copy of a key.
|
|
113
|
+
*
|
|
101
114
|
* Seal `env` for one agent. `agentSealPubkey` is the agent's agentSeal public
|
|
102
115
|
* key (hex, compressed or uncompressed); `owner` is the address that will sign
|
|
103
116
|
* the envelope (the container requires it to be the agent's on-chain owner).
|
|
@@ -108,6 +121,8 @@ export declare function sealSecretEnv(agentSealPubkey: Hex, owner: Address, env:
|
|
|
108
121
|
* its canonical compressed hex. Throws on anything that is not a curve point. */
|
|
109
122
|
export declare function parseAgentSealPubkey(pubkey: string): Hex;
|
|
110
123
|
/**
|
|
124
|
+
* LEGACY(model-key): the request copy of a key.
|
|
125
|
+
*
|
|
111
126
|
* Check that `value` has the shape `sealSecretEnv` produces (standard base64
|
|
112
127
|
* of `ephemeralPub(65) ‖ nonce(16) ‖ tag(16) ‖ ct`, with a valid ephemeral
|
|
113
128
|
* point) and return it trimmed. The SDK cannot decrypt it, so this does not
|
package/dist/secretEnv.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretEnv.d.ts","sourceRoot":"","sources":["../src/secretEnv.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"secretEnv.d.ts","sourceRoot":"","sources":["../src/secretEnv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAMH,OAAO,EAA4C,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAExF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,mFAAmF;AACnF,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE5D;sBACsB;AACtB,MAAM,MAAM,oBAAoB;AAC9B,0DAA0D;AACxD,8BAA8B,GAC9B,cAAc;AAChB,kFAAkF;GAChF,oBAAoB;AACtB,mGAAmG;GACjG,eAAe;AACjB,gGAAgG;GAC9F,oBAAoB;AACtB,0FAA0F;GACxF,mBAAmB;AACrB,2DAA2D;GACzD,oBAAoB;AACtB,gEAAgE;GAC9D,oBAAoB;AACtB,sEAAsE;GACpE,gBAAgB;AAClB,yGAAyG;GACvG,iBAAiB;AACnB,8CAA8C;GAC5C,mBAAmB;AACrB,2FAA2F;GACzF,gBAAgB;AAClB,gFAAgF;GAC9E,2BAA2B;AAC7B;;;;;gCAKgC;GAC9B,kBAAkB,CAAC;AAEvB;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAG5C,QAAQ,CAAC,IAAI,EAAE,oBAAoB;IAFrC,QAAQ,CAAC,MAAM,EAAG,KAAK,CAAU;gBAEtB,IAAI,EAAE,oBAAoB,EACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAMhC;AAID;2DAC2D;AAC3D,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAYjD;AAYD,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAG9D;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,CAoB3F;AAWD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,aAAa,EAAE,mBAAmB,GAAG,MAAM,CAcpM;AAED;kFACkF;AAClF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAcxD;AAgBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa1D"}
|
package/dist/secretEnv.js
CHANGED
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
* agent's agentSeal public key, so it never appears in clear in the envelope
|
|
6
6
|
* the owner's wallet signs (issue #166).
|
|
7
7
|
*
|
|
8
|
+
* LEGACY(model-key): model keys go into the agent's credential set
|
|
9
|
+
* (Credentials.ts; an integrator's with `sealModelKey`). The secret env is the
|
|
10
|
+
* copy sent with the request for images that read only that
|
|
11
|
+
* (legacy/modelKey.ts), and its parts here go with it: the scheme and its
|
|
12
|
+
* variable, {@link SecretEnvMode}, `sealSecretEnv`, `checkSealedSecretEnv` and
|
|
13
|
+
* the request-only refusal codes. What stays: {@link eciesEncrypt}, which the
|
|
14
|
+
* credential set seals with; {@link SecretEnvRefusedError}, which the
|
|
15
|
+
* credential set's checks throw too; the agentSeal key checks
|
|
16
|
+
* (`parseAgentSealPubkey`, `publicKeyToAddress`).
|
|
17
|
+
*
|
|
8
18
|
* The sandbox "create" envelope is signed with EIP-191 `personal_sign`, and a
|
|
9
19
|
* wallet shows that message verbatim. With the key in `env.API_KEY`, the
|
|
10
20
|
* prompt displayed it, and every hop that relays the envelope (an
|
|
@@ -42,9 +52,9 @@ const hkdf_1 = require("@noble/hashes/hkdf");
|
|
|
42
52
|
const sha2_1 = require("@noble/hashes/sha2");
|
|
43
53
|
const aes_1 = require("@noble/ciphers/aes");
|
|
44
54
|
const viem_1 = require("viem");
|
|
45
|
-
/** `GET /config` value that says this attestor's sealed images open a secret env. */
|
|
55
|
+
/** LEGACY(model-key): `GET /config` value that says this attestor's sealed images open a secret env. */
|
|
46
56
|
exports.SECRET_ENV_SCHEME = 'agent-seal-ecies-v1';
|
|
47
|
-
/**
|
|
57
|
+
/** LEGACY(model-key): the container env var that carries the sealed secret env. */
|
|
48
58
|
exports.SECRET_ENV_VAR = 'SEAL_SECRET_ENV';
|
|
49
59
|
/**
|
|
50
60
|
* A secret-env refusal. `signed` is always false: the SDK checks everything
|
|
@@ -124,6 +134,8 @@ function randomValidPriv() {
|
|
|
124
134
|
}
|
|
125
135
|
}
|
|
126
136
|
/**
|
|
137
|
+
* LEGACY(model-key): the request copy of a key.
|
|
138
|
+
*
|
|
127
139
|
* Seal `env` for one agent. `agentSealPubkey` is the agent's agentSeal public
|
|
128
140
|
* key (hex, compressed or uncompressed); `owner` is the address that will sign
|
|
129
141
|
* the envelope (the container requires it to be the agent's on-chain owner).
|
|
@@ -173,6 +185,8 @@ function fromBase64(s) {
|
|
|
173
185
|
/** Smallest `{"v":1,"owner":"0x…40","env":{"API_KEY":"x"}}` plaintext, in bytes. */
|
|
174
186
|
const MIN_PLAINTEXT = 70;
|
|
175
187
|
/**
|
|
188
|
+
* LEGACY(model-key): the request copy of a key.
|
|
189
|
+
*
|
|
176
190
|
* Check that `value` has the shape `sealSecretEnv` produces (standard base64
|
|
177
191
|
* of `ephemeralPub(65) ‖ nonce(16) ‖ tag(16) ‖ ct`, with a valid ephemeral
|
|
178
192
|
* point) and return it trimmed. The SDK cannot decrypt it, so this does not
|
package/dist/secretEnv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secretEnv.js","sourceRoot":"","sources":["../src/secretEnv.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"secretEnv.js","sourceRoot":"","sources":["../src/secretEnv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;;;AAoFH,kCAYC;AAaD,gDAGC;AAGD,oCAoBC;AAmBD,sCAcC;AAID,oDAcC;AA0BD,oDAaC;AA/ND,uDAAoD;AACpD,6CAA0C;AAC1C,6CAA4C;AAC5C,4CAAyC;AACzC,+BAAwF;AAExF,wGAAwG;AAC3F,QAAA,iBAAiB,GAAG,qBAAqB,CAAC;AACvD,mFAAmF;AACtE,QAAA,cAAc,GAAG,iBAAiB,CAAC;AAmDhD;;;;GAIG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAE9C,YACW,IAA0B,EACnC,OAAe,EACf,OAA6B;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAAsB;QAF5B,WAAM,GAAG,KAAc,CAAC;QAO/B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO;YAAG,IAA4B,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IACzF,CAAC;CACF;AAXD,sDAWC;AAID;2DAC2D;AAC3D,SAAgB,WAAW,CAAC,CAAS;IACnC,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,SAAS,GAAI,UAAqC,CAAC,MAAM,CAAC;IAC9D,IAAI,CAAC,SAAS,EAAE,eAAe,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;QACjE,8DA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,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAC7G,IAAI,CAAC;QACH,qBAAS,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,MAAM,CAAC,kDAAkD,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -65,12 +65,25 @@ export interface ServeProof {
|
|
|
65
65
|
taskHash: `0x${string}`;
|
|
66
66
|
/** Hashes of the data involved in the service */
|
|
67
67
|
dataHashes: `0x${string}`[];
|
|
68
|
-
/** Hash of the agent framework version */
|
|
68
|
+
/** Hash of the agent framework version: the image hash (base) */
|
|
69
69
|
frameworkHash: `0x${string}`;
|
|
70
70
|
/** agentSeal signature: EIP-191 version 0x00 (data with intended validator
|
|
71
71
|
* = the VerifiedFeedbackRegistry proxy) over the proof's abi.encode hash —
|
|
72
72
|
* see buildServeProofSigningHash. NOT personal_sign. */
|
|
73
73
|
signature: `0x${string}`;
|
|
74
|
+
/** 2 for a versioned proof, which also signs the four fields below;
|
|
75
|
+
* LEGACY(v1): absent for v1, what images before the layered runtime sign.
|
|
76
|
+
* It picks the digest and the registry entry point (sealed/LAYERS.md §7). */
|
|
77
|
+
version?: number;
|
|
78
|
+
/** v2: sha256 of the sealed program the loader verified and ran. */
|
|
79
|
+
sealedHash?: `0x${string}`;
|
|
80
|
+
/** v2: sha256 of the official harness version running. */
|
|
81
|
+
harnessHash?: `0x${string}`;
|
|
82
|
+
/** v2: where sealed's inference proxy forwarded model calls; '' when the
|
|
83
|
+
* framework dials its provider itself. */
|
|
84
|
+
inferenceURL?: string;
|
|
85
|
+
/** v2: the model name the inference proxy sent, the owner's setting. */
|
|
86
|
+
model?: string;
|
|
74
87
|
/** The VerifiedFeedbackRegistry the sealed proxy signed this proof for, as
|
|
75
88
|
* echoed in the X-Agent-Proof envelope. Diagnostics only: unsigned, NOT part
|
|
76
89
|
* of the on-chain ServeProof tuple (the registry uses its own address), and
|
|
@@ -161,6 +174,16 @@ export interface ServeData {
|
|
|
161
174
|
/** Framework hash */
|
|
162
175
|
frameworkHash: `0x${string}`;
|
|
163
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* The layers a verified entry's ServeProof named (v2): the sealed program and
|
|
179
|
+
* the official harness version. Zero hashes for an entry attested with a v1
|
|
180
|
+
* proof.
|
|
181
|
+
* @struct
|
|
182
|
+
*/
|
|
183
|
+
export interface ServeLayers {
|
|
184
|
+
sealedHash: `0x${string}`;
|
|
185
|
+
harnessHash: `0x${string}`;
|
|
186
|
+
}
|
|
164
187
|
/**
|
|
165
188
|
* Parameters for registering an agent.
|
|
166
189
|
*/
|
|
@@ -333,4 +356,43 @@ export interface GetSummaryParams {
|
|
|
333
356
|
/** Second tag filter. Default: no filter. */
|
|
334
357
|
tag2?: string;
|
|
335
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* One record of what an agent's sign socket did: a signature it made, or a
|
|
361
|
+
* request a rule refused (`result: "refused"`, with `reason`). Which fields
|
|
362
|
+
* are set depends on `kind`. Read with `AgenticID.signatures`.
|
|
363
|
+
*/
|
|
364
|
+
export interface SignatureRecord {
|
|
365
|
+
/** Record number; pass the last one seen as `after` to read only newer ones. */
|
|
366
|
+
seq: number;
|
|
367
|
+
/** When, RFC 3339. */
|
|
368
|
+
ts: string;
|
|
369
|
+
kind: 'personal_sign' | 'typed_data' | 'transaction';
|
|
370
|
+
result: 'signed' | 'refused';
|
|
371
|
+
/** Why a rule refused it. */
|
|
372
|
+
reason?: string;
|
|
373
|
+
/** personal_sign: the EIP-191 hash, the message length in bytes, and its start when it is text. */
|
|
374
|
+
msg_hash?: string;
|
|
375
|
+
length?: number;
|
|
376
|
+
text?: string;
|
|
377
|
+
/** typed_data: the EIP-712 digest, the primary type and the domain fields set. */
|
|
378
|
+
digest?: string;
|
|
379
|
+
primary_type?: string;
|
|
380
|
+
domain?: {
|
|
381
|
+
name?: string;
|
|
382
|
+
version?: string;
|
|
383
|
+
chain_id?: string;
|
|
384
|
+
verifying_contract?: string;
|
|
385
|
+
};
|
|
386
|
+
/** transaction: what was signed. `create` marks a contract creation (no `to`). */
|
|
387
|
+
tx_hash?: string;
|
|
388
|
+
chain_id?: string;
|
|
389
|
+
to?: string;
|
|
390
|
+
create?: boolean;
|
|
391
|
+
/** Wei, decimal. */
|
|
392
|
+
value?: string;
|
|
393
|
+
nonce?: number;
|
|
394
|
+
/** The calldata's first four bytes, and its length in bytes. */
|
|
395
|
+
selector?: string;
|
|
396
|
+
data_len?: number;
|
|
397
|
+
}
|
|
336
398
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,oBAAY,UAAU;IACpB,0CAA0C;IAC1C,GAAG,IAAI;IACP,2BAA2B;IAC3B,GAAG,IAAI;CACR;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,aAAa,EAAE,KAAK,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,uCAAuC;IACvC,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,mBAAmB;IACnB,OAAO,EAAE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AgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file viemErrors.ts
|
|
3
|
+
* @description viem errors found by name along the cause chain. Not by
|
|
4
|
+
* `instanceof`: viem ships separate ESM and CommonJS builds, and an error
|
|
5
|
+
* made by one copy is no instance of the other's class — a caller's client,
|
|
6
|
+
* or a test stub, on the ESM build would slip past this CommonJS build's
|
|
7
|
+
* checks.
|
|
8
|
+
*
|
|
9
|
+
* LEGACY(pre-1.4.0): every caller tells a deployment from before AgenticID
|
|
10
|
+
* 1.4.0 / FeedbackBatcher v5 by a revert (trustRegistryOf, the batcher
|
|
11
|
+
* probe); the file goes with them.
|
|
12
|
+
*/
|
|
13
|
+
/** A viem error's fields this SDK reads. */
|
|
14
|
+
export interface ViemErrorLike {
|
|
15
|
+
name: string;
|
|
16
|
+
/** ContractFunctionRevertedError: the decoded custom error, when the ABI has it. */
|
|
17
|
+
data?: {
|
|
18
|
+
errorName?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** The first error along `e`'s cause chain whose name is one of `names`. */
|
|
22
|
+
export declare function findViemError(e: unknown, names: readonly string[]): ViemErrorLike | null;
|
|
23
|
+
/** Whether `e` is the contract refusing the call — the node said it
|
|
24
|
+
* reverted (JSON-RPC code 3, or "execution reverted": viem's
|
|
25
|
+
* ExecutionRevertedError), or it returned no data at all — as opposed to a
|
|
26
|
+
* call that got no answer, or an answer that is no revert. A
|
|
27
|
+
* ContractFunctionRevertedError alone proves nothing: viem also wraps a
|
|
28
|
+
* node's internal error (-32603) in one. */
|
|
29
|
+
export declare function isContractRevert(e: unknown): boolean;
|
|
30
|
+
//# sourceMappingURL=viemErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viemErrors.d.ts","sourceRoot":"","sources":["../src/viemErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/B;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI,CAOxF;AAED;;;;;6CAK6C;AAC7C,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAEpD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file viemErrors.ts
|
|
4
|
+
* @description viem errors found by name along the cause chain. Not by
|
|
5
|
+
* `instanceof`: viem ships separate ESM and CommonJS builds, and an error
|
|
6
|
+
* made by one copy is no instance of the other's class — a caller's client,
|
|
7
|
+
* or a test stub, on the ESM build would slip past this CommonJS build's
|
|
8
|
+
* checks.
|
|
9
|
+
*
|
|
10
|
+
* LEGACY(pre-1.4.0): every caller tells a deployment from before AgenticID
|
|
11
|
+
* 1.4.0 / FeedbackBatcher v5 by a revert (trustRegistryOf, the batcher
|
|
12
|
+
* probe); the file goes with them.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.findViemError = findViemError;
|
|
16
|
+
exports.isContractRevert = isContractRevert;
|
|
17
|
+
/** The first error along `e`'s cause chain whose name is one of `names`. */
|
|
18
|
+
function findViemError(e, names) {
|
|
19
|
+
let x = e;
|
|
20
|
+
for (let depth = 0; x && typeof x === 'object' && depth < 16; depth++) {
|
|
21
|
+
if (typeof x.name === 'string' && names.includes(x.name))
|
|
22
|
+
return x;
|
|
23
|
+
x = x.cause;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
/** Whether `e` is the contract refusing the call — the node said it
|
|
28
|
+
* reverted (JSON-RPC code 3, or "execution reverted": viem's
|
|
29
|
+
* ExecutionRevertedError), or it returned no data at all — as opposed to a
|
|
30
|
+
* call that got no answer, or an answer that is no revert. A
|
|
31
|
+
* ContractFunctionRevertedError alone proves nothing: viem also wraps a
|
|
32
|
+
* node's internal error (-32603) in one. */
|
|
33
|
+
function isContractRevert(e) {
|
|
34
|
+
return !!findViemError(e, ['ExecutionRevertedError', 'ContractFunctionZeroDataError']);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=viemErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viemErrors.js","sourceRoot":"","sources":["../src/viemErrors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAUH,sCAOC;AAQD,4CAEC;AAlBD,4EAA4E;AAC5E,SAAgB,aAAa,CAAC,CAAU,EAAE,KAAwB;IAChE,IAAI,CAAC,GAAG,CAA2D,CAAC;IACpE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC;QACtE,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAO,CAAkB,CAAC;QACpF,CAAC,GAAG,CAAC,CAAC,KAAiB,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;6CAK6C;AAC7C,SAAgB,gBAAgB,CAAC,CAAU;IACzC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,wBAAwB,EAAE,+BAA+B,CAAC,CAAC,CAAC;AACzF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0gfoundation/0g-agentdna",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "0G AgentDNA TypeScript SDK and CLI for on-chain AI agent identities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"src",
|
|
24
24
|
"README.md",
|
|
25
25
|
"GUIDE.md",
|
|
26
|
+
"OPERATORS.md",
|
|
27
|
+
"OPERATORS.zh.md",
|
|
26
28
|
"LICENSE",
|
|
27
29
|
"MIGRATION.md",
|
|
28
30
|
"MIGRATION.zh.md",
|
|
@@ -53,6 +55,8 @@
|
|
|
53
55
|
"@noble/ciphers": "^1.3.0",
|
|
54
56
|
"@noble/curves": "^1.9.1",
|
|
55
57
|
"@noble/hashes": "^1.8.0",
|
|
58
|
+
"ink": "5.2.1",
|
|
59
|
+
"react": "18.3.1",
|
|
56
60
|
"viem": "^2.21.0"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|