@chaoschain/sdk 0.3.1 → 0.3.2
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/CHANGELOG.md +15 -0
- package/README.md +49 -0
- package/dist/{IPFSLocal-B4hnMEfS.d.ts → IPFSLocal-B_Sgmd_Q.d.ts} +1 -1
- package/dist/{IPFSLocal-zRj6kG8e.d.cts → IPFSLocal-DjFddwHD.d.cts} +1 -1
- package/dist/gateway/index.cjs +591 -0
- package/dist/gateway/index.cjs.map +1 -0
- package/dist/gateway/index.d.cts +3 -0
- package/dist/gateway/index.d.ts +3 -0
- package/dist/gateway/index.js +581 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/index-CL0fidQs.d.ts +223 -0
- package/dist/index-iUO5l1VD.d.cts +223 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -393
- package/dist/index.d.ts +9 -393
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/providers/compute/index.d.cts +1 -1
- package/dist/providers/compute/index.d.ts +1 -1
- package/dist/providers/storage/index.d.cts +2 -2
- package/dist/providers/storage/index.d.ts +2 -2
- package/dist/session/index.cjs +196 -0
- package/dist/session/index.cjs.map +1 -0
- package/dist/session/index.d.cts +169 -0
- package/dist/session/index.d.ts +169 -0
- package/dist/session/index.js +189 -0
- package/dist/session/index.js.map +1 -0
- package/dist/{types-BBVtx_jV.d.cts → types-C0Ay90UI.d.cts} +1 -1
- package/dist/{types-BBVtx_jV.d.ts → types-C0Ay90UI.d.ts} +1 -1
- package/package.json +11 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { N as NetworkConfig, I as IntegrityProof, W as WalletConfig,
|
|
2
|
-
export {
|
|
1
|
+
import { N as NetworkConfig, I as IntegrityProof, W as WalletConfig, b as NetworkInfo, c as ContractAddresses, A as AgentRole, d as ChaosChainSDKConfig, e as AgentMetadata, f as AgentRegistration, F as FeedbackParams, P as PaymentMethod, U as UploadOptions, a as UploadResult, g as WorkflowStatus, h as ScoreSubmissionMode } from './types-C0Ay90UI.js';
|
|
2
|
+
export { M as AgencySignals, C as ComputeProvider, D as DKGNodeData, Q as DemoAssessment, Y as EngineeringStudioPolicy, J as EvidencePackage, i as FeedbackRecord, G as GatewayClientConfig, r as PendingWorkItem, s as PendingWorkResponse, R as ScoreRange, _ as SignalExtractionContext, S as StorageProvider, T as TEEAttestation, l as TransactionResult, j as ValidationRequest, V as ValidationRequestParams, m as ValidationStatus, O as VerifierAssessment, t as WorkEvidenceResponse, K as WorkEvidenceVerificationResult, Z as WorkMandate, L as WorkVerificationResult, q as WorkflowError, p as WorkflowProgress, o as WorkflowState, n as WorkflowType, k as X402Payment, X as X402PaymentParams, u as XMTPMessageData, B as composeScoreVector, E as composeScoreVectorWithDefaults, v as computeDepth, w as derivePoAScores, z as extractAgencySignals, H as rangeFit, x as validateEvidenceGraph, y as verifyWorkEvidence } from './types-C0Ay90UI.js';
|
|
3
3
|
import { ethers } from 'ethers';
|
|
4
|
-
|
|
4
|
+
import { G as GatewayClient } from './index-CL0fidQs.js';
|
|
5
|
+
export { A as AgentRegistrationError, C as ChaosChainSDKError, b as ConfigurationError, a as ContractError, d as GatewayConnectionError, c as GatewayError, e as GatewayTimeoutError, I as IntegrityVerificationError, P as PaymentError, V as SDKValidationError, S as StorageError, W as WorkflowFailedError } from './index-CL0fidQs.js';
|
|
6
|
+
import { SessionClient } from './session/index.js';
|
|
7
|
+
export { Session, SessionAgentOverride, SessionAgentRole, SessionClientConfig, SessionCompleteResult, SessionLogOptions, SessionStartOptions } from './session/index.js';
|
|
8
|
+
export { I as IPFSLocalStorage } from './IPFSLocal-B_Sgmd_Q.js';
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* X402 Payment Manager for ChaosChain SDK
|
|
@@ -715,152 +719,6 @@ declare function getNetworkInfo(network: NetworkConfig | string): NetworkInfo;
|
|
|
715
719
|
*/
|
|
716
720
|
declare function getContractAddresses(network: NetworkConfig | string): ContractAddresses;
|
|
717
721
|
|
|
718
|
-
declare class GatewayClient {
|
|
719
|
-
private gatewayUrl;
|
|
720
|
-
private timeout;
|
|
721
|
-
private maxPollTime;
|
|
722
|
-
private pollInterval;
|
|
723
|
-
private defaultHeaders?;
|
|
724
|
-
private auth?;
|
|
725
|
-
private retryConfig?;
|
|
726
|
-
constructor(config: GatewayClientConfig);
|
|
727
|
-
private _resolveTimeout;
|
|
728
|
-
private _resolveAuthMode;
|
|
729
|
-
private _buildHeaders;
|
|
730
|
-
private _classifyStatusCode;
|
|
731
|
-
private _normalizeError;
|
|
732
|
-
private _getRetryDelayMs;
|
|
733
|
-
private _sleep;
|
|
734
|
-
/**
|
|
735
|
-
* Make HTTP request to Gateway.
|
|
736
|
-
* Handles errors and transforms them to Gateway exceptions.
|
|
737
|
-
*/
|
|
738
|
-
private _request;
|
|
739
|
-
/**
|
|
740
|
-
* Parse workflow status from API response.
|
|
741
|
-
*/
|
|
742
|
-
private _parseWorkflowStatus;
|
|
743
|
-
healthCheck(): Promise<GatewayHealthResponse>;
|
|
744
|
-
isHealthy(): Promise<boolean>;
|
|
745
|
-
/**
|
|
746
|
-
* Create a work submission workflow.
|
|
747
|
-
* POST /workflows/work-submission
|
|
748
|
-
*
|
|
749
|
-
* SDK prepares inputs; Gateway handles:
|
|
750
|
-
* - Evidence upload to Arweave
|
|
751
|
-
* - Transaction submission
|
|
752
|
-
* - Confirmation waiting
|
|
753
|
-
*
|
|
754
|
-
* @param studioAddress - Ethereum address of the studio
|
|
755
|
-
* @param epoch - Epoch number
|
|
756
|
-
* @param agentAddress - Ethereum address of the submitting agent
|
|
757
|
-
* @param dataHash - Bytes32 hash of the work (as hex string)
|
|
758
|
-
* @param threadRoot - Bytes32 DKG thread root (as hex string)
|
|
759
|
-
* @param evidenceRoot - Bytes32 evidence Merkle root (as hex string)
|
|
760
|
-
* @param evidenceContent - Raw evidence bytes (will be base64 encoded)
|
|
761
|
-
* @param signerAddress - Ethereum address of the signer (must be registered in Gateway)
|
|
762
|
-
* @returns WorkflowStatus - Initial status of the created workflow
|
|
763
|
-
*/
|
|
764
|
-
submitWork(studioAddress: string, epoch: number, agentAddress: string, dataHash: string, threadRoot: string, evidenceRoot: string, evidenceContent: Buffer | string, signerAddress: string): Promise<WorkflowStatus>;
|
|
765
|
-
/**
|
|
766
|
-
* Create a score submission workflow.
|
|
767
|
-
* POST /workflows/score-submission
|
|
768
|
-
*
|
|
769
|
-
* Supports two modes:
|
|
770
|
-
* - DIRECT (default): Simple direct scoring, requires workerAddress
|
|
771
|
-
* - COMMIT_REVEAL: Commit-reveal pattern, requires salt
|
|
772
|
-
*
|
|
773
|
-
* @param studioAddress - Ethereum address of the studio
|
|
774
|
-
* @param epoch - Epoch number
|
|
775
|
-
* @param validatorAddress - Ethereum address of the validator
|
|
776
|
-
* @param dataHash - Bytes32 hash of the work being scored (as hex string)
|
|
777
|
-
* @param scores - Array of dimension scores (0-10000 basis points)
|
|
778
|
-
* @param signerAddress - Ethereum address of the signer
|
|
779
|
-
* @param options - Additional options (workerAddress, salt, mode)
|
|
780
|
-
*/
|
|
781
|
-
submitScore(studioAddress: string, epoch: number, validatorAddress: string, dataHash: string, scores: number[], signerAddress: string, options?: {
|
|
782
|
-
workerAddress?: string;
|
|
783
|
-
salt?: string;
|
|
784
|
-
mode?: ScoreSubmissionMode;
|
|
785
|
-
}): Promise<WorkflowStatus>;
|
|
786
|
-
/**
|
|
787
|
-
* Create a close epoch workflow.
|
|
788
|
-
* POST /workflows/close-epoch
|
|
789
|
-
*
|
|
790
|
-
* This is economically final — cannot be undone.
|
|
791
|
-
*
|
|
792
|
-
* @param studioAddress - Ethereum address of the studio
|
|
793
|
-
* @param epoch - Epoch number to close
|
|
794
|
-
* @param signerAddress - Ethereum address of the signer
|
|
795
|
-
*/
|
|
796
|
-
closeEpoch(studioAddress: string, epoch: number, signerAddress: string): Promise<WorkflowStatus>;
|
|
797
|
-
/**
|
|
798
|
-
* Get workflow status by ID.
|
|
799
|
-
* GET /workflows/{id}
|
|
800
|
-
*/
|
|
801
|
-
getWorkflow(workflowId: string): Promise<WorkflowStatus>;
|
|
802
|
-
/**
|
|
803
|
-
* List workflows with optional filters.
|
|
804
|
-
* GET /workflows?studio=&state=&type=
|
|
805
|
-
*/
|
|
806
|
-
listWorkflows(options?: {
|
|
807
|
-
studio?: string;
|
|
808
|
-
state?: string;
|
|
809
|
-
workflowType?: string;
|
|
810
|
-
}): Promise<WorkflowStatus[]>;
|
|
811
|
-
/**
|
|
812
|
-
* Poll workflow until it reaches a terminal state.
|
|
813
|
-
*
|
|
814
|
-
* @param workflowId - UUID of the workflow
|
|
815
|
-
* @param options - Polling options
|
|
816
|
-
* @throws WorkflowFailedError - If workflow reaches FAILED state
|
|
817
|
-
* @throws GatewayTimeoutError - If maxWait exceeded
|
|
818
|
-
*/
|
|
819
|
-
waitForCompletion(workflowId: string, options?: {
|
|
820
|
-
maxWait?: number;
|
|
821
|
-
pollInterval?: number;
|
|
822
|
-
onProgress?: (status: WorkflowStatus) => void;
|
|
823
|
-
}): Promise<WorkflowStatus>;
|
|
824
|
-
/**
|
|
825
|
-
* Submit work and wait for completion.
|
|
826
|
-
*/
|
|
827
|
-
submitWorkAndWait(studioAddress: string, epoch: number, agentAddress: string, dataHash: string, threadRoot: string, evidenceRoot: string, evidenceContent: Buffer | string, signerAddress: string, options?: {
|
|
828
|
-
onProgress?: (status: WorkflowStatus) => void;
|
|
829
|
-
}): Promise<WorkflowStatus>;
|
|
830
|
-
/**
|
|
831
|
-
* Submit score and wait for completion.
|
|
832
|
-
*/
|
|
833
|
-
submitScoreAndWait(studioAddress: string, epoch: number, validatorAddress: string, dataHash: string, scores: number[], signerAddress: string, options?: {
|
|
834
|
-
workerAddress?: string;
|
|
835
|
-
workAddress?: string;
|
|
836
|
-
salt?: string;
|
|
837
|
-
mode?: ScoreSubmissionMode;
|
|
838
|
-
onProgress?: (status: WorkflowStatus) => void;
|
|
839
|
-
}): Promise<WorkflowStatus>;
|
|
840
|
-
/**
|
|
841
|
-
* Close epoch and wait for completion.
|
|
842
|
-
*/
|
|
843
|
-
closeEpochAndWait(studioAddress: string, epoch: number, signerAddress: string, options?: {
|
|
844
|
-
onProgress?: (status: WorkflowStatus) => void;
|
|
845
|
-
}): Promise<WorkflowStatus>;
|
|
846
|
-
/**
|
|
847
|
-
* Fetch pending (unfinalized) work for a studio from the gateway.
|
|
848
|
-
*
|
|
849
|
-
* @param studioAddress - 0x-prefixed studio contract address
|
|
850
|
-
* @param options - Optional limit/offset for pagination
|
|
851
|
-
* @returns Typed pending work response
|
|
852
|
-
*/
|
|
853
|
-
getPendingWork(studioAddress: string, options?: {
|
|
854
|
-
limit?: number;
|
|
855
|
-
offset?: number;
|
|
856
|
-
}): Promise<PendingWorkResponse>;
|
|
857
|
-
/**
|
|
858
|
-
* Fetch full evidence graph for a work submission.
|
|
859
|
-
* Endpoint: GET /v1/work/{hash}/evidence
|
|
860
|
-
*/
|
|
861
|
-
getWorkEvidence(workHash: string): Promise<WorkEvidenceResponse>;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
722
|
interface StudioClientConfig {
|
|
865
723
|
provider: ethers.Provider;
|
|
866
724
|
signer: ethers.Signer;
|
|
@@ -1032,174 +890,6 @@ declare class StudioClient {
|
|
|
1032
890
|
generateSalt(): string;
|
|
1033
891
|
}
|
|
1034
892
|
|
|
1035
|
-
/**
|
|
1036
|
-
* Session — high-level wrapper for ChaosChain Engineering Studio sessions.
|
|
1037
|
-
*
|
|
1038
|
-
* Agents use this class to log work events without constructing raw event schemas,
|
|
1039
|
-
* managing parent IDs, or thinking about DAGs. The gateway handles all of that.
|
|
1040
|
-
*
|
|
1041
|
-
* @example
|
|
1042
|
-
* ```ts
|
|
1043
|
-
* const session = await client.start({ studio_address: '0x...', agent_address: '0x...' });
|
|
1044
|
-
* await session.log({ summary: 'Planning cache layer implementation' });
|
|
1045
|
-
* await session.step('implementing', 'Added CacheService class');
|
|
1046
|
-
* await session.step('testing', 'All 47 tests pass');
|
|
1047
|
-
* const { workflow_id, data_hash } = await session.complete();
|
|
1048
|
-
* ```
|
|
1049
|
-
*/
|
|
1050
|
-
/** Valid agent roles accepted by the gateway for session events. */
|
|
1051
|
-
type SessionAgentRole = 'worker' | 'verifier' | 'collaborator';
|
|
1052
|
-
/** Per-event agent override. */
|
|
1053
|
-
interface SessionAgentOverride {
|
|
1054
|
-
/** Wallet address of the agent emitting this event. */
|
|
1055
|
-
agent_address: string;
|
|
1056
|
-
/** Agent role (defaults to `"worker"`). Must be `worker`, `verifier`, or `collaborator`. */
|
|
1057
|
-
role?: SessionAgentRole;
|
|
1058
|
-
}
|
|
1059
|
-
/** Options for {@link Session.log}. */
|
|
1060
|
-
interface SessionLogOptions {
|
|
1061
|
-
/** Human-readable description of what happened. */
|
|
1062
|
-
summary: string;
|
|
1063
|
-
/** Canonical event type. Defaults to `"artifact_created"`. */
|
|
1064
|
-
event_type?: string;
|
|
1065
|
-
/** Arbitrary metadata attached to the event. */
|
|
1066
|
-
metadata?: Record<string, unknown>;
|
|
1067
|
-
/** Override the session-level agent for this event. */
|
|
1068
|
-
agent?: SessionAgentOverride;
|
|
1069
|
-
}
|
|
1070
|
-
/** Result returned by {@link Session.complete}. */
|
|
1071
|
-
interface SessionCompleteResult {
|
|
1072
|
-
workflow_id: string | null;
|
|
1073
|
-
data_hash: string | null;
|
|
1074
|
-
}
|
|
1075
|
-
declare class Session {
|
|
1076
|
-
/** Session ID returned by the gateway. */
|
|
1077
|
-
readonly sessionId: string;
|
|
1078
|
-
private readonly gatewayUrl;
|
|
1079
|
-
private readonly apiKey;
|
|
1080
|
-
private readonly studioAddress;
|
|
1081
|
-
private readonly agentAddress;
|
|
1082
|
-
private readonly studioPolicyVersion;
|
|
1083
|
-
private readonly workMandateId;
|
|
1084
|
-
private readonly taskType;
|
|
1085
|
-
private lastEventId;
|
|
1086
|
-
/** @internal — use {@link SessionClient.start} to create instances. */
|
|
1087
|
-
constructor(opts: {
|
|
1088
|
-
sessionId: string;
|
|
1089
|
-
gatewayUrl: string;
|
|
1090
|
-
apiKey?: string;
|
|
1091
|
-
lastEventId?: string | null;
|
|
1092
|
-
studioAddress: string;
|
|
1093
|
-
agentAddress: string;
|
|
1094
|
-
studioPolicyVersion: string;
|
|
1095
|
-
workMandateId: string;
|
|
1096
|
-
taskType: string;
|
|
1097
|
-
});
|
|
1098
|
-
/**
|
|
1099
|
-
* Log a session event.
|
|
1100
|
-
*
|
|
1101
|
-
* Automatically generates `event_id`, `timestamp`, and chains `parent_event_ids`
|
|
1102
|
-
* from the previous event so the gateway can build a causal DAG.
|
|
1103
|
-
*
|
|
1104
|
-
* @param opts - Event details. Only `summary` is required.
|
|
1105
|
-
* @throws Error if the gateway returns a non-2xx status.
|
|
1106
|
-
*/
|
|
1107
|
-
log(opts: SessionLogOptions): Promise<void>;
|
|
1108
|
-
/**
|
|
1109
|
-
* Convenience wrapper around {@link log} that maps human-friendly step names
|
|
1110
|
-
* to canonical event types.
|
|
1111
|
-
*
|
|
1112
|
-
* Mappings:
|
|
1113
|
-
* - `"planning"` → `plan_created`
|
|
1114
|
-
* - `"testing"` → `test_run`
|
|
1115
|
-
* - `"debugging"` → `debug_step`
|
|
1116
|
-
* - `"implementing"` → `file_written`
|
|
1117
|
-
* - `"completing"` → `submission_created`
|
|
1118
|
-
*
|
|
1119
|
-
* Unknown step types fall back to `artifact_created`.
|
|
1120
|
-
*
|
|
1121
|
-
* @param stepType - Friendly step name.
|
|
1122
|
-
* @param summary - What happened in this step.
|
|
1123
|
-
*/
|
|
1124
|
-
step(stepType: string, summary: string, agent?: SessionAgentOverride): Promise<void>;
|
|
1125
|
-
/**
|
|
1126
|
-
* Complete the session.
|
|
1127
|
-
*
|
|
1128
|
-
* Triggers the on-chain WorkSubmission workflow (if the gateway is configured for it)
|
|
1129
|
-
* and returns `workflow_id` + `data_hash` for downstream verification/scoring.
|
|
1130
|
-
*
|
|
1131
|
-
* @param opts - Optional status (`"completed"` | `"failed"`) and summary.
|
|
1132
|
-
* @returns `{ workflow_id, data_hash }` — both may be `null` if the gateway
|
|
1133
|
-
* workflow engine is not configured.
|
|
1134
|
-
* @throws Error if the gateway returns a non-2xx status.
|
|
1135
|
-
*/
|
|
1136
|
-
complete(opts?: {
|
|
1137
|
-
status?: 'completed' | 'failed';
|
|
1138
|
-
summary?: string;
|
|
1139
|
-
}): Promise<SessionCompleteResult>;
|
|
1140
|
-
private post;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* SessionClient — factory for creating ChaosChain Engineering Studio sessions.
|
|
1145
|
-
*
|
|
1146
|
-
* @example
|
|
1147
|
-
* ```ts
|
|
1148
|
-
* import { SessionClient } from '@chaoschain/sdk';
|
|
1149
|
-
*
|
|
1150
|
-
* const client = new SessionClient({ gatewayUrl: 'https://gateway.chaoscha.in', apiKey: 'cc_...' });
|
|
1151
|
-
* const session = await client.start({
|
|
1152
|
-
* studio_address: '0xFA0795fD5D7F58eCAa7Eae35Ad9cB8AED9424Dd0',
|
|
1153
|
-
* agent_address: '0x9B4Cef62a0ce1671ccFEFA6a6D8cBFa165c49831',
|
|
1154
|
-
* task_type: 'feature',
|
|
1155
|
-
* });
|
|
1156
|
-
*
|
|
1157
|
-
* await session.log({ summary: 'Started implementing cache layer' });
|
|
1158
|
-
* await session.step('testing', 'All tests pass');
|
|
1159
|
-
* const result = await session.complete();
|
|
1160
|
-
* ```
|
|
1161
|
-
*/
|
|
1162
|
-
|
|
1163
|
-
/** Configuration for {@link SessionClient}. */
|
|
1164
|
-
interface SessionClientConfig {
|
|
1165
|
-
/** Gateway base URL (default: `"https://gateway.chaoscha.in"`). */
|
|
1166
|
-
gatewayUrl?: string;
|
|
1167
|
-
/** API key sent as `X-API-Key` header. */
|
|
1168
|
-
apiKey?: string;
|
|
1169
|
-
}
|
|
1170
|
-
/** Options for {@link SessionClient.start}. */
|
|
1171
|
-
interface SessionStartOptions {
|
|
1172
|
-
/** Studio contract address (required). */
|
|
1173
|
-
studio_address: string;
|
|
1174
|
-
/** Worker agent wallet address (required). */
|
|
1175
|
-
agent_address: string;
|
|
1176
|
-
/** Work mandate ID (default: `"generic-task"`). */
|
|
1177
|
-
work_mandate_id?: string;
|
|
1178
|
-
/** Task classification (default: `"general"`). */
|
|
1179
|
-
task_type?: string;
|
|
1180
|
-
/** Studio policy version (default: `"engineering-studio-default-v1"`). */
|
|
1181
|
-
studio_policy_version?: string;
|
|
1182
|
-
/** Client-provided session ID. Server generates one if omitted. */
|
|
1183
|
-
session_id?: string;
|
|
1184
|
-
}
|
|
1185
|
-
declare class SessionClient {
|
|
1186
|
-
private readonly gatewayUrl;
|
|
1187
|
-
private readonly apiKey;
|
|
1188
|
-
constructor(config?: SessionClientConfig);
|
|
1189
|
-
/**
|
|
1190
|
-
* Create a new coding session on the gateway.
|
|
1191
|
-
*
|
|
1192
|
-
* Returns a {@link Session} instance that can be used to log events, run steps,
|
|
1193
|
-
* and complete the session. The gateway persists all events and constructs the
|
|
1194
|
-
* Evidence DAG automatically.
|
|
1195
|
-
*
|
|
1196
|
-
* @param opts - Session creation parameters.
|
|
1197
|
-
* @returns A live {@link Session} bound to the newly created session ID.
|
|
1198
|
-
* @throws Error if the gateway returns a non-2xx status.
|
|
1199
|
-
*/
|
|
1200
|
-
start(opts: SessionStartOptions): Promise<Session>;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
893
|
/**
|
|
1204
894
|
* Main ChaosChain SDK Class - Complete TypeScript implementation
|
|
1205
895
|
*
|
|
@@ -1957,80 +1647,6 @@ declare class AutoStorageManager implements StorageBackend {
|
|
|
1957
1647
|
getAvailableBackends(): string[];
|
|
1958
1648
|
}
|
|
1959
1649
|
|
|
1960
|
-
/**
|
|
1961
|
-
* Exception classes for the ChaosChain SDK.
|
|
1962
|
-
*
|
|
1963
|
-
* This module defines all custom exceptions used throughout the SDK
|
|
1964
|
-
* to provide clear error handling and debugging information.
|
|
1965
|
-
*/
|
|
1966
|
-
declare class ChaosChainSDKError extends Error {
|
|
1967
|
-
details: Record<string, any>;
|
|
1968
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1969
|
-
toString(): string;
|
|
1970
|
-
}
|
|
1971
|
-
declare class AgentRegistrationError extends ChaosChainSDKError {
|
|
1972
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1973
|
-
}
|
|
1974
|
-
declare class PaymentError extends ChaosChainSDKError {
|
|
1975
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1976
|
-
}
|
|
1977
|
-
declare class StorageError extends ChaosChainSDKError {
|
|
1978
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1979
|
-
}
|
|
1980
|
-
declare class IntegrityVerificationError extends ChaosChainSDKError {
|
|
1981
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1982
|
-
}
|
|
1983
|
-
declare class ContractError extends ChaosChainSDKError {
|
|
1984
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1985
|
-
}
|
|
1986
|
-
declare class ValidationError extends ChaosChainSDKError {
|
|
1987
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1988
|
-
}
|
|
1989
|
-
declare class ConfigurationError extends ChaosChainSDKError {
|
|
1990
|
-
constructor(message: string, details?: Record<string, any>);
|
|
1991
|
-
}
|
|
1992
|
-
/**
|
|
1993
|
-
* Options passed when constructing a GatewayError (statusCode, response, category, retryable).
|
|
1994
|
-
*/
|
|
1995
|
-
interface GatewayErrorDetails {
|
|
1996
|
-
statusCode?: number;
|
|
1997
|
-
response?: Record<string, any>;
|
|
1998
|
-
category?: 'transient' | 'permanent' | 'auth' | 'unknown';
|
|
1999
|
-
retryable?: boolean;
|
|
2000
|
-
}
|
|
2001
|
-
/**
|
|
2002
|
-
* Base error from Gateway API.
|
|
2003
|
-
*/
|
|
2004
|
-
declare class GatewayError extends ChaosChainSDKError {
|
|
2005
|
-
readonly statusCode?: number;
|
|
2006
|
-
readonly response?: Record<string, any>;
|
|
2007
|
-
readonly category?: 'transient' | 'permanent' | 'auth' | 'unknown';
|
|
2008
|
-
readonly retryable?: boolean;
|
|
2009
|
-
constructor(message: string, details?: GatewayErrorDetails);
|
|
2010
|
-
}
|
|
2011
|
-
/**
|
|
2012
|
-
* Failed to connect to Gateway.
|
|
2013
|
-
*/
|
|
2014
|
-
declare class GatewayConnectionError extends GatewayError {
|
|
2015
|
-
constructor(message: string);
|
|
2016
|
-
}
|
|
2017
|
-
/**
|
|
2018
|
-
* Gateway request or polling timed out.
|
|
2019
|
-
*/
|
|
2020
|
-
declare class GatewayTimeoutError extends GatewayError {
|
|
2021
|
-
readonly workflowId: string;
|
|
2022
|
-
readonly lastStatus?: WorkflowStatus;
|
|
2023
|
-
constructor(workflowId: string, message: string, lastStatus?: WorkflowStatus);
|
|
2024
|
-
}
|
|
2025
|
-
/**
|
|
2026
|
-
* Workflow reached FAILED state.
|
|
2027
|
-
*/
|
|
2028
|
-
declare class WorkflowFailedError extends GatewayError {
|
|
2029
|
-
readonly workflowId: string;
|
|
2030
|
-
readonly workflowError: WorkflowError;
|
|
2031
|
-
constructor(workflowId: string, error: WorkflowError);
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
1650
|
/**
|
|
2035
1651
|
* ERC-8004 v1.0 Contract ABIs and Addresses
|
|
2036
1652
|
*
|
|
@@ -2707,7 +2323,7 @@ declare class StudioManager {
|
|
|
2707
2323
|
* @packageDocumentation
|
|
2708
2324
|
*/
|
|
2709
2325
|
|
|
2710
|
-
declare const SDK_VERSION = "0.3.
|
|
2326
|
+
declare const SDK_VERSION = "0.3.2";
|
|
2711
2327
|
declare const ERC8004_VERSION = "1.0";
|
|
2712
2328
|
declare const X402_VERSION = "1.0";
|
|
2713
2329
|
|
|
@@ -2744,4 +2360,4 @@ declare function initChaosChainSDK(config: {
|
|
|
2744
2360
|
enableStorage?: boolean;
|
|
2745
2361
|
}): ChaosChainSDK;
|
|
2746
2362
|
|
|
2747
|
-
export { A2AX402Extension, AgentMetadata, AgentRegistration,
|
|
2363
|
+
export { A2AX402Extension, AgentMetadata, AgentRegistration, AgentRole, AutoStorageManager, CHAOS_CORE_ABI, ChaosAgent, ChaosChainSDK, ChaosChainSDKConfig, ContractAddresses, ERC8004_VERSION, FeedbackParams, GatewayClient, GoogleAP2Integration, IDENTITY_REGISTRY_ABI, PinataStorage as IPFSPinataStorage, IntegrityProof, IrysStorage, IrysStorage as IrysStorageProvider, LocalIPFSStorage, MandateManager, NetworkConfig, type PaymentHeader, PaymentManager, PaymentMethod, PinataStorage, REPUTATION_REGISTRY_ABI, REWARDS_DISTRIBUTOR_ABI, SDK_VERSION, STUDIO_FACTORY_ABI, STUDIO_PROXY_ABI, SessionClient, type SettleRequest, type SettleResponse, type StorageBackend, type StorageResult, StudioClient, type StudioClientConfig, StudioManager, type StudioManagerConfig, type Task, type TransferAuthorizationParams, UploadOptions, UploadResult, VALIDATION_REGISTRY_ABI, WalletConfig, WalletManager, type WorkerBid, WorkflowStatus, type X402FacilitatorConfig, X402PaymentManager, type X402PaymentProof, type X402PaymentRequest$1 as X402PaymentRequest, type X402PaymentRequirements, X402Server, X402_VERSION, ZeroGStorage, ChaosChainSDK as default, getContractAddresses, getNetworkInfo, initChaosChainSDK };
|
package/dist/index.js
CHANGED
|
@@ -16157,7 +16157,7 @@ var ChaosChainSDK = class _ChaosChainSDK {
|
|
|
16157
16157
|
* Get SDK version
|
|
16158
16158
|
*/
|
|
16159
16159
|
getVersion() {
|
|
16160
|
-
return "0.3.
|
|
16160
|
+
return "0.3.2";
|
|
16161
16161
|
}
|
|
16162
16162
|
/**
|
|
16163
16163
|
* Get SDK capabilities summary
|
|
@@ -16955,7 +16955,7 @@ function verifyWorkEvidence(evidence, context) {
|
|
|
16955
16955
|
}
|
|
16956
16956
|
|
|
16957
16957
|
// src/index.ts
|
|
16958
|
-
var SDK_VERSION = "0.3.
|
|
16958
|
+
var SDK_VERSION = "0.3.2";
|
|
16959
16959
|
var ERC8004_VERSION = "1.0";
|
|
16960
16960
|
var X402_VERSION = "1.0";
|
|
16961
16961
|
var src_default = ChaosChainSDK;
|