@chaoschain/sdk 0.2.3 → 0.2.4

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.
@@ -1,4 +1,4 @@
1
- import { o as ComputeProvider } from '../../types-CEFAgoAM.cjs';
1
+ import { o as ComputeProvider } from '../../types-DZze-Z8B.cjs';
2
2
  import 'ethers';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { o as ComputeProvider } from '../../types-CEFAgoAM.js';
1
+ import { o as ComputeProvider } from '../../types-DZze-Z8B.js';
2
2
  import 'ethers';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
- export { I as IPFSLocalStorage } from '../../IPFSLocal-DqzD3Y7I.cjs';
2
- import { n as StorageProvider, U as UploadOptions, i as UploadResult } from '../../types-CEFAgoAM.cjs';
1
+ export { I as IPFSLocalStorage } from '../../IPFSLocal-azjjaiGR.cjs';
2
+ import { n as StorageProvider, U as UploadOptions, i as UploadResult } from '../../types-DZze-Z8B.cjs';
3
3
  import 'ethers';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- export { I as IPFSLocalStorage } from '../../IPFSLocal-BCIADaOU.js';
2
- import { n as StorageProvider, U as UploadOptions, i as UploadResult } from '../../types-CEFAgoAM.js';
1
+ export { I as IPFSLocalStorage } from '../../IPFSLocal-BqyHRp_l.js';
2
+ import { n as StorageProvider, U as UploadOptions, i as UploadResult } from '../../types-DZze-Z8B.js';
3
3
  import 'ethers';
4
4
 
5
5
  /**
@@ -39,11 +39,24 @@ interface WorkVerificationResult {
39
39
  signals?: AgencySignals;
40
40
  }
41
41
  /**
42
- * Verifier assessment — optional overrides for each dimension.
42
+ * Verifier assessment for production scoring.
43
+ * Compliance and efficiency are REQUIRED — verifier agents must provide them.
43
44
  * Values can be in 0..1 (normalized) or 0..100 (integer); the SDK
44
45
  * auto-detects and normalizes internally.
45
46
  */
46
47
  type VerifierAssessment = {
48
+ complianceScore: number;
49
+ efficiencyScore: number;
50
+ initiativeScore?: number;
51
+ collaborationScore?: number;
52
+ reasoningScore?: number;
53
+ rationale?: string;
54
+ };
55
+ /**
56
+ * Relaxed assessment for demo/test use only.
57
+ * All fields optional — missing compliance/efficiency fall back to signals or 0.
58
+ */
59
+ type DemoAssessment = {
47
60
  initiativeScore?: number;
48
61
  collaborationScore?: number;
49
62
  reasoningScore?: number;
@@ -76,6 +89,8 @@ type AgencySignals = {
76
89
  requiredArtifactsPresent?: string[];
77
90
  missingArtifacts?: string[];
78
91
  durationMs?: number;
92
+ fragmentationPenalty?: number;
93
+ overcomplexityPenalty?: number;
79
94
  };
80
95
  };
81
96
  type ScoreRange = {
@@ -177,26 +192,35 @@ declare function extractAgencySignals(evidence: EvidencePackage[], context?: Sig
177
192
  */
178
193
  declare function computeDepth(evidence: EvidencePackage[]): number;
179
194
  /**
180
- * Composes a final on-chain score vector from deterministic signals and
181
- * optional verifier assessment.
195
+ * Production score vector composition for verifier agents.
196
+ *
197
+ * Compliance and efficiency are REQUIRED — verifier agents must explicitly
198
+ * provide these based on their judgment + deterministic signals. Throws if
199
+ * either is missing.
182
200
  *
183
- * For each dimension:
184
- * - If the verifier provides an override → use it (normalized)
185
- * - Otherwise → use the deterministic signal
186
- * - If the signal is also undefined → 0
201
+ * Initiative, collaboration, and reasoning default to deterministic signals
202
+ * unless the verifier provides overrides.
187
203
  *
188
204
  * Input values can be in 0..1 or 0..100; the SDK auto-detects.
189
205
  * Output is always integer tuple [0..100] × 5 ready for contract submission.
190
206
  */
191
- declare function composeScoreVector(signals: AgencySignals, assessment?: VerifierAssessment): [number, number, number, number, number];
207
+ declare function composeScoreVector(signals: AgencySignals, assessment: VerifierAssessment): [number, number, number, number, number];
208
+ /**
209
+ * Demo/test score vector composition — all fields optional.
210
+ *
211
+ * Falls back to deterministic signals (or 0) for any missing dimension.
212
+ * Use this for demo scripts and testing only — production verifier agents
213
+ * must use composeScoreVector() which enforces compliance/efficiency.
214
+ */
215
+ declare function composeScoreVectorWithDefaults(signals: AgencySignals, assessment?: DemoAssessment): [number, number, number, number, number];
192
216
  /**
193
217
  * Convenience wrapper: extract signals + compose score vector in one call.
194
218
  *
195
219
  * Returns [Initiative, Collaboration, Reasoning, Compliance, Efficiency]
196
220
  * as integers 0..100 for on-chain submission.
197
221
  *
198
- * Compliance and efficiency come from signals when available, or from the
199
- * verifier-provided `options`. No hardcoded placeholders.
222
+ * Uses composeScoreVectorWithDefaults internally compliance and efficiency
223
+ * fall back to signals or 0 when not provided.
200
224
  */
201
225
  declare function derivePoAScores(evidence: EvidencePackage[], options?: {
202
226
  compliance?: number;
@@ -753,4 +777,4 @@ interface DKGNodeData {
753
777
  canonicalHash?: string;
754
778
  }
755
779
 
756
- export { AgentRole as A, extractAgencySignals as B, type ContractAddresses as C, type DKGNodeData as D, composeScoreVector as E, type FeedbackParams as F, type GatewayClientConfig as G, rangeFit as H, type IntegrityProof as I, type EvidencePackage as J, type WorkEvidenceVerificationResult as K, type WorkVerificationResult as L, type AgencySignals as M, NetworkConfig as N, type VerifierAssessment as O, type PendingWorkResponse as P, type ScoreRange as Q, type EngineeringStudioPolicy as R, ScoreSubmissionMode as S, type TEEAttestation as T, type UploadOptions as U, type ValidationRequestParams as V, type WalletConfig as W, type X402PaymentParams as X, type WorkMandate as Y, type SignalExtractionContext as Z, type NetworkInfo as a, type GatewayHealthResponse as b, type WorkflowStatus as c, type WorkEvidenceResponse as d, type ChaosChainSDKConfig as e, type AgentMetadata as f, type AgentRegistration as g, PaymentMethod as h, type UploadResult as i, type WorkflowError as j, type FeedbackRecord as k, type ValidationRequest as l, type X402Payment as m, type StorageProvider as n, type ComputeProvider as o, type TransactionResult as p, ValidationStatus as q, WorkflowType as r, WorkflowState as s, type WorkflowProgress as t, type PendingWorkItem as u, type XMTPMessageData as v, computeDepth as w, derivePoAScores as x, validateEvidenceGraph as y, verifyWorkEvidence as z };
780
+ export { type SignalExtractionContext as $, AgentRole as A, extractAgencySignals as B, type ContractAddresses as C, type DKGNodeData as D, composeScoreVector as E, type FeedbackParams as F, type GatewayClientConfig as G, composeScoreVectorWithDefaults as H, type IntegrityProof as I, rangeFit as J, type EvidencePackage as K, type WorkEvidenceVerificationResult as L, type WorkVerificationResult as M, NetworkConfig as N, type AgencySignals as O, type PendingWorkResponse as P, type VerifierAssessment as Q, type DemoAssessment as R, ScoreSubmissionMode as S, type TEEAttestation as T, type UploadOptions as U, type ValidationRequestParams as V, type WalletConfig as W, type X402PaymentParams as X, type ScoreRange as Y, type EngineeringStudioPolicy as Z, type WorkMandate as _, type NetworkInfo as a, type GatewayHealthResponse as b, type WorkflowStatus as c, type WorkEvidenceResponse as d, type ChaosChainSDKConfig as e, type AgentMetadata as f, type AgentRegistration as g, PaymentMethod as h, type UploadResult as i, type WorkflowError as j, type FeedbackRecord as k, type ValidationRequest as l, type X402Payment as m, type StorageProvider as n, type ComputeProvider as o, type TransactionResult as p, ValidationStatus as q, WorkflowType as r, WorkflowState as s, type WorkflowProgress as t, type PendingWorkItem as u, type XMTPMessageData as v, computeDepth as w, derivePoAScores as x, validateEvidenceGraph as y, verifyWorkEvidence as z };
@@ -39,11 +39,24 @@ interface WorkVerificationResult {
39
39
  signals?: AgencySignals;
40
40
  }
41
41
  /**
42
- * Verifier assessment — optional overrides for each dimension.
42
+ * Verifier assessment for production scoring.
43
+ * Compliance and efficiency are REQUIRED — verifier agents must provide them.
43
44
  * Values can be in 0..1 (normalized) or 0..100 (integer); the SDK
44
45
  * auto-detects and normalizes internally.
45
46
  */
46
47
  type VerifierAssessment = {
48
+ complianceScore: number;
49
+ efficiencyScore: number;
50
+ initiativeScore?: number;
51
+ collaborationScore?: number;
52
+ reasoningScore?: number;
53
+ rationale?: string;
54
+ };
55
+ /**
56
+ * Relaxed assessment for demo/test use only.
57
+ * All fields optional — missing compliance/efficiency fall back to signals or 0.
58
+ */
59
+ type DemoAssessment = {
47
60
  initiativeScore?: number;
48
61
  collaborationScore?: number;
49
62
  reasoningScore?: number;
@@ -76,6 +89,8 @@ type AgencySignals = {
76
89
  requiredArtifactsPresent?: string[];
77
90
  missingArtifacts?: string[];
78
91
  durationMs?: number;
92
+ fragmentationPenalty?: number;
93
+ overcomplexityPenalty?: number;
79
94
  };
80
95
  };
81
96
  type ScoreRange = {
@@ -177,26 +192,35 @@ declare function extractAgencySignals(evidence: EvidencePackage[], context?: Sig
177
192
  */
178
193
  declare function computeDepth(evidence: EvidencePackage[]): number;
179
194
  /**
180
- * Composes a final on-chain score vector from deterministic signals and
181
- * optional verifier assessment.
195
+ * Production score vector composition for verifier agents.
196
+ *
197
+ * Compliance and efficiency are REQUIRED — verifier agents must explicitly
198
+ * provide these based on their judgment + deterministic signals. Throws if
199
+ * either is missing.
182
200
  *
183
- * For each dimension:
184
- * - If the verifier provides an override → use it (normalized)
185
- * - Otherwise → use the deterministic signal
186
- * - If the signal is also undefined → 0
201
+ * Initiative, collaboration, and reasoning default to deterministic signals
202
+ * unless the verifier provides overrides.
187
203
  *
188
204
  * Input values can be in 0..1 or 0..100; the SDK auto-detects.
189
205
  * Output is always integer tuple [0..100] × 5 ready for contract submission.
190
206
  */
191
- declare function composeScoreVector(signals: AgencySignals, assessment?: VerifierAssessment): [number, number, number, number, number];
207
+ declare function composeScoreVector(signals: AgencySignals, assessment: VerifierAssessment): [number, number, number, number, number];
208
+ /**
209
+ * Demo/test score vector composition — all fields optional.
210
+ *
211
+ * Falls back to deterministic signals (or 0) for any missing dimension.
212
+ * Use this for demo scripts and testing only — production verifier agents
213
+ * must use composeScoreVector() which enforces compliance/efficiency.
214
+ */
215
+ declare function composeScoreVectorWithDefaults(signals: AgencySignals, assessment?: DemoAssessment): [number, number, number, number, number];
192
216
  /**
193
217
  * Convenience wrapper: extract signals + compose score vector in one call.
194
218
  *
195
219
  * Returns [Initiative, Collaboration, Reasoning, Compliance, Efficiency]
196
220
  * as integers 0..100 for on-chain submission.
197
221
  *
198
- * Compliance and efficiency come from signals when available, or from the
199
- * verifier-provided `options`. No hardcoded placeholders.
222
+ * Uses composeScoreVectorWithDefaults internally compliance and efficiency
223
+ * fall back to signals or 0 when not provided.
200
224
  */
201
225
  declare function derivePoAScores(evidence: EvidencePackage[], options?: {
202
226
  compliance?: number;
@@ -753,4 +777,4 @@ interface DKGNodeData {
753
777
  canonicalHash?: string;
754
778
  }
755
779
 
756
- export { AgentRole as A, extractAgencySignals as B, type ContractAddresses as C, type DKGNodeData as D, composeScoreVector as E, type FeedbackParams as F, type GatewayClientConfig as G, rangeFit as H, type IntegrityProof as I, type EvidencePackage as J, type WorkEvidenceVerificationResult as K, type WorkVerificationResult as L, type AgencySignals as M, NetworkConfig as N, type VerifierAssessment as O, type PendingWorkResponse as P, type ScoreRange as Q, type EngineeringStudioPolicy as R, ScoreSubmissionMode as S, type TEEAttestation as T, type UploadOptions as U, type ValidationRequestParams as V, type WalletConfig as W, type X402PaymentParams as X, type WorkMandate as Y, type SignalExtractionContext as Z, type NetworkInfo as a, type GatewayHealthResponse as b, type WorkflowStatus as c, type WorkEvidenceResponse as d, type ChaosChainSDKConfig as e, type AgentMetadata as f, type AgentRegistration as g, PaymentMethod as h, type UploadResult as i, type WorkflowError as j, type FeedbackRecord as k, type ValidationRequest as l, type X402Payment as m, type StorageProvider as n, type ComputeProvider as o, type TransactionResult as p, ValidationStatus as q, WorkflowType as r, WorkflowState as s, type WorkflowProgress as t, type PendingWorkItem as u, type XMTPMessageData as v, computeDepth as w, derivePoAScores as x, validateEvidenceGraph as y, verifyWorkEvidence as z };
780
+ export { type SignalExtractionContext as $, AgentRole as A, extractAgencySignals as B, type ContractAddresses as C, type DKGNodeData as D, composeScoreVector as E, type FeedbackParams as F, type GatewayClientConfig as G, composeScoreVectorWithDefaults as H, type IntegrityProof as I, rangeFit as J, type EvidencePackage as K, type WorkEvidenceVerificationResult as L, type WorkVerificationResult as M, NetworkConfig as N, type AgencySignals as O, type PendingWorkResponse as P, type VerifierAssessment as Q, type DemoAssessment as R, ScoreSubmissionMode as S, type TEEAttestation as T, type UploadOptions as U, type ValidationRequestParams as V, type WalletConfig as W, type X402PaymentParams as X, type ScoreRange as Y, type EngineeringStudioPolicy as Z, type WorkMandate as _, type NetworkInfo as a, type GatewayHealthResponse as b, type WorkflowStatus as c, type WorkEvidenceResponse as d, type ChaosChainSDKConfig as e, type AgentMetadata as f, type AgentRegistration as g, PaymentMethod as h, type UploadResult as i, type WorkflowError as j, type FeedbackRecord as k, type ValidationRequest as l, type X402Payment as m, type StorageProvider as n, type ComputeProvider as o, type TransactionResult as p, ValidationStatus as q, WorkflowType as r, WorkflowState as s, type WorkflowProgress as t, type PendingWorkItem as u, type XMTPMessageData as v, computeDepth as w, derivePoAScores as x, validateEvidenceGraph as y, verifyWorkEvidence as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoschain/sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for building verifiable AI agents on ChaosChain",
6
6
  "main": "./dist/index.cjs",