@chaoschain/sdk 0.3.0 → 0.3.1

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/dist/index.d.cts CHANGED
@@ -1047,6 +1047,15 @@ declare class StudioClient {
1047
1047
  * const { workflow_id, data_hash } = await session.complete();
1048
1048
  * ```
1049
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
+ }
1050
1059
  /** Options for {@link Session.log}. */
1051
1060
  interface SessionLogOptions {
1052
1061
  /** Human-readable description of what happened. */
@@ -1055,6 +1064,8 @@ interface SessionLogOptions {
1055
1064
  event_type?: string;
1056
1065
  /** Arbitrary metadata attached to the event. */
1057
1066
  metadata?: Record<string, unknown>;
1067
+ /** Override the session-level agent for this event. */
1068
+ agent?: SessionAgentOverride;
1058
1069
  }
1059
1070
  /** Result returned by {@link Session.complete}. */
1060
1071
  interface SessionCompleteResult {
@@ -1110,7 +1121,7 @@ declare class Session {
1110
1121
  * @param stepType - Friendly step name.
1111
1122
  * @param summary - What happened in this step.
1112
1123
  */
1113
- step(stepType: string, summary: string): Promise<void>;
1124
+ step(stepType: string, summary: string, agent?: SessionAgentOverride): Promise<void>;
1114
1125
  /**
1115
1126
  * Complete the session.
1116
1127
  *
@@ -2696,7 +2707,7 @@ declare class StudioManager {
2696
2707
  * @packageDocumentation
2697
2708
  */
2698
2709
 
2699
- declare const SDK_VERSION = "0.3.0";
2710
+ declare const SDK_VERSION = "0.3.1";
2700
2711
  declare const ERC8004_VERSION = "1.0";
2701
2712
  declare const X402_VERSION = "1.0";
2702
2713
 
@@ -2733,4 +2744,4 @@ declare function initChaosChainSDK(config: {
2733
2744
  enableStorage?: boolean;
2734
2745
  }): ChaosChainSDK;
2735
2746
 
2736
- export { A2AX402Extension, AgentMetadata, AgentRegistration, AgentRegistrationError, AgentRole, AutoStorageManager, CHAOS_CORE_ABI, ChaosAgent, ChaosChainSDK, ChaosChainSDKConfig, ChaosChainSDKError, ConfigurationError, ContractAddresses, ContractError, ERC8004_VERSION, FeedbackParams, GatewayClient, GatewayClientConfig, GatewayConnectionError, GatewayError, GatewayTimeoutError, GoogleAP2Integration, IDENTITY_REGISTRY_ABI, PinataStorage as IPFSPinataStorage, IntegrityProof, IntegrityVerificationError, IrysStorage, IrysStorage as IrysStorageProvider, LocalIPFSStorage, MandateManager, NetworkConfig, PaymentError, type PaymentHeader, PaymentManager, PaymentMethod, PendingWorkResponse, PinataStorage, REPUTATION_REGISTRY_ABI, REWARDS_DISTRIBUTOR_ABI, ValidationError as SDKValidationError, SDK_VERSION, STUDIO_FACTORY_ABI, STUDIO_PROXY_ABI, Session, SessionClient, type SessionClientConfig, type SessionCompleteResult, type SessionLogOptions, type SessionStartOptions, type SettleRequest, type SettleResponse, type StorageBackend, StorageError, type StorageResult, StudioClient, type StudioClientConfig, StudioManager, type StudioManagerConfig, type Task, type TransferAuthorizationParams, UploadOptions, UploadResult, VALIDATION_REGISTRY_ABI, WalletConfig, WalletManager, WorkEvidenceResponse, type WorkerBid, WorkflowError, WorkflowFailedError, WorkflowStatus, type X402FacilitatorConfig, X402PaymentManager, type X402PaymentProof, type X402PaymentRequest$1 as X402PaymentRequest, type X402PaymentRequirements, X402Server, X402_VERSION, ZeroGStorage, ChaosChainSDK as default, getContractAddresses, getNetworkInfo, initChaosChainSDK };
2747
+ export { A2AX402Extension, AgentMetadata, AgentRegistration, AgentRegistrationError, AgentRole, AutoStorageManager, CHAOS_CORE_ABI, ChaosAgent, ChaosChainSDK, ChaosChainSDKConfig, ChaosChainSDKError, ConfigurationError, ContractAddresses, ContractError, ERC8004_VERSION, FeedbackParams, GatewayClient, GatewayClientConfig, GatewayConnectionError, GatewayError, GatewayTimeoutError, GoogleAP2Integration, IDENTITY_REGISTRY_ABI, PinataStorage as IPFSPinataStorage, IntegrityProof, IntegrityVerificationError, IrysStorage, IrysStorage as IrysStorageProvider, LocalIPFSStorage, MandateManager, NetworkConfig, PaymentError, type PaymentHeader, PaymentManager, PaymentMethod, PendingWorkResponse, PinataStorage, REPUTATION_REGISTRY_ABI, REWARDS_DISTRIBUTOR_ABI, ValidationError as SDKValidationError, SDK_VERSION, STUDIO_FACTORY_ABI, STUDIO_PROXY_ABI, Session, type SessionAgentOverride, type SessionAgentRole, SessionClient, type SessionClientConfig, type SessionCompleteResult, type SessionLogOptions, type SessionStartOptions, type SettleRequest, type SettleResponse, type StorageBackend, StorageError, type StorageResult, StudioClient, type StudioClientConfig, StudioManager, type StudioManagerConfig, type Task, type TransferAuthorizationParams, UploadOptions, UploadResult, VALIDATION_REGISTRY_ABI, WalletConfig, WalletManager, WorkEvidenceResponse, type WorkerBid, WorkflowError, WorkflowFailedError, 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.d.ts CHANGED
@@ -1047,6 +1047,15 @@ declare class StudioClient {
1047
1047
  * const { workflow_id, data_hash } = await session.complete();
1048
1048
  * ```
1049
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
+ }
1050
1059
  /** Options for {@link Session.log}. */
1051
1060
  interface SessionLogOptions {
1052
1061
  /** Human-readable description of what happened. */
@@ -1055,6 +1064,8 @@ interface SessionLogOptions {
1055
1064
  event_type?: string;
1056
1065
  /** Arbitrary metadata attached to the event. */
1057
1066
  metadata?: Record<string, unknown>;
1067
+ /** Override the session-level agent for this event. */
1068
+ agent?: SessionAgentOverride;
1058
1069
  }
1059
1070
  /** Result returned by {@link Session.complete}. */
1060
1071
  interface SessionCompleteResult {
@@ -1110,7 +1121,7 @@ declare class Session {
1110
1121
  * @param stepType - Friendly step name.
1111
1122
  * @param summary - What happened in this step.
1112
1123
  */
1113
- step(stepType: string, summary: string): Promise<void>;
1124
+ step(stepType: string, summary: string, agent?: SessionAgentOverride): Promise<void>;
1114
1125
  /**
1115
1126
  * Complete the session.
1116
1127
  *
@@ -2696,7 +2707,7 @@ declare class StudioManager {
2696
2707
  * @packageDocumentation
2697
2708
  */
2698
2709
 
2699
- declare const SDK_VERSION = "0.3.0";
2710
+ declare const SDK_VERSION = "0.3.1";
2700
2711
  declare const ERC8004_VERSION = "1.0";
2701
2712
  declare const X402_VERSION = "1.0";
2702
2713
 
@@ -2733,4 +2744,4 @@ declare function initChaosChainSDK(config: {
2733
2744
  enableStorage?: boolean;
2734
2745
  }): ChaosChainSDK;
2735
2746
 
2736
- export { A2AX402Extension, AgentMetadata, AgentRegistration, AgentRegistrationError, AgentRole, AutoStorageManager, CHAOS_CORE_ABI, ChaosAgent, ChaosChainSDK, ChaosChainSDKConfig, ChaosChainSDKError, ConfigurationError, ContractAddresses, ContractError, ERC8004_VERSION, FeedbackParams, GatewayClient, GatewayClientConfig, GatewayConnectionError, GatewayError, GatewayTimeoutError, GoogleAP2Integration, IDENTITY_REGISTRY_ABI, PinataStorage as IPFSPinataStorage, IntegrityProof, IntegrityVerificationError, IrysStorage, IrysStorage as IrysStorageProvider, LocalIPFSStorage, MandateManager, NetworkConfig, PaymentError, type PaymentHeader, PaymentManager, PaymentMethod, PendingWorkResponse, PinataStorage, REPUTATION_REGISTRY_ABI, REWARDS_DISTRIBUTOR_ABI, ValidationError as SDKValidationError, SDK_VERSION, STUDIO_FACTORY_ABI, STUDIO_PROXY_ABI, Session, SessionClient, type SessionClientConfig, type SessionCompleteResult, type SessionLogOptions, type SessionStartOptions, type SettleRequest, type SettleResponse, type StorageBackend, StorageError, type StorageResult, StudioClient, type StudioClientConfig, StudioManager, type StudioManagerConfig, type Task, type TransferAuthorizationParams, UploadOptions, UploadResult, VALIDATION_REGISTRY_ABI, WalletConfig, WalletManager, WorkEvidenceResponse, type WorkerBid, WorkflowError, WorkflowFailedError, WorkflowStatus, type X402FacilitatorConfig, X402PaymentManager, type X402PaymentProof, type X402PaymentRequest$1 as X402PaymentRequest, type X402PaymentRequirements, X402Server, X402_VERSION, ZeroGStorage, ChaosChainSDK as default, getContractAddresses, getNetworkInfo, initChaosChainSDK };
2747
+ export { A2AX402Extension, AgentMetadata, AgentRegistration, AgentRegistrationError, AgentRole, AutoStorageManager, CHAOS_CORE_ABI, ChaosAgent, ChaosChainSDK, ChaosChainSDKConfig, ChaosChainSDKError, ConfigurationError, ContractAddresses, ContractError, ERC8004_VERSION, FeedbackParams, GatewayClient, GatewayClientConfig, GatewayConnectionError, GatewayError, GatewayTimeoutError, GoogleAP2Integration, IDENTITY_REGISTRY_ABI, PinataStorage as IPFSPinataStorage, IntegrityProof, IntegrityVerificationError, IrysStorage, IrysStorage as IrysStorageProvider, LocalIPFSStorage, MandateManager, NetworkConfig, PaymentError, type PaymentHeader, PaymentManager, PaymentMethod, PendingWorkResponse, PinataStorage, REPUTATION_REGISTRY_ABI, REWARDS_DISTRIBUTOR_ABI, ValidationError as SDKValidationError, SDK_VERSION, STUDIO_FACTORY_ABI, STUDIO_PROXY_ABI, Session, type SessionAgentOverride, type SessionAgentRole, SessionClient, type SessionClientConfig, type SessionCompleteResult, type SessionLogOptions, type SessionStartOptions, type SettleRequest, type SettleResponse, type StorageBackend, StorageError, type StorageResult, StudioClient, type StudioClientConfig, StudioManager, type StudioManagerConfig, type Task, type TransferAuthorizationParams, UploadOptions, UploadResult, VALIDATION_REGISTRY_ABI, WalletConfig, WalletManager, WorkEvidenceResponse, type WorkerBid, WorkflowError, WorkflowFailedError, 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
@@ -15414,7 +15414,10 @@ var Session = class {
15414
15414
  causality: {
15415
15415
  parent_event_ids: this.lastEventId ? [this.lastEventId] : []
15416
15416
  },
15417
- agent: { agent_address: this.agentAddress, role: "worker" },
15417
+ agent: {
15418
+ agent_address: opts.agent?.agent_address ?? this.agentAddress,
15419
+ role: opts.agent?.role ?? "worker"
15420
+ },
15418
15421
  studio: {
15419
15422
  studio_address: this.studioAddress,
15420
15423
  studio_policy_version: this.studioPolicyVersion
@@ -15444,9 +15447,9 @@ var Session = class {
15444
15447
  * @param stepType - Friendly step name.
15445
15448
  * @param summary - What happened in this step.
15446
15449
  */
15447
- async step(stepType, summary) {
15450
+ async step(stepType, summary, agent) {
15448
15451
  const eventType = STEP_TYPE_MAP[stepType] ?? "artifact_created";
15449
- await this.log({ event_type: eventType, summary });
15452
+ await this.log({ event_type: eventType, summary, agent });
15450
15453
  }
15451
15454
  /**
15452
15455
  * Complete the session.
@@ -16154,7 +16157,7 @@ var ChaosChainSDK = class _ChaosChainSDK {
16154
16157
  * Get SDK version
16155
16158
  */
16156
16159
  getVersion() {
16157
- return "0.3.0";
16160
+ return "0.3.1";
16158
16161
  }
16159
16162
  /**
16160
16163
  * Get SDK capabilities summary
@@ -16952,7 +16955,7 @@ function verifyWorkEvidence(evidence, context) {
16952
16955
  }
16953
16956
 
16954
16957
  // src/index.ts
16955
- var SDK_VERSION = "0.3.0";
16958
+ var SDK_VERSION = "0.3.1";
16956
16959
  var ERC8004_VERSION = "1.0";
16957
16960
  var X402_VERSION = "1.0";
16958
16961
  var src_default = ChaosChainSDK;