@valiron/sdk 0.1.1 → 0.3.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/dist/clients.d.ts CHANGED
@@ -1,90 +1,46 @@
1
- import { ValironConfig, RoutingResponse, AgentProfile, WalletProfile, SubmitFeedbackParams, SandboxTestParams } from './types';
1
+ import { ValironConfig, AgentProfile, WalletProfile, SandboxResult, CallOptions } from "./types";
2
2
  /**
3
- * Base client for making HTTP requests to Valiron API
3
+ * HTTP client for the Valiron Operator API.
4
+ *
5
+ * All methods map 1-to-1 to the /operator/* endpoints exposed by the
6
+ * Valiron edge-proxy service.
4
7
  */
5
- export declare class BaseClient {
6
- protected endpoint: string;
7
- protected apiKey?: string;
8
- protected timeout: number;
9
- protected debug: boolean;
8
+ export declare class ValironClient {
9
+ private endpoint;
10
+ private apiKey?;
11
+ private defaultChain?;
12
+ private timeout;
13
+ private debug;
10
14
  constructor(config?: ValironConfig);
15
+ /** Resolve the effective chain: per-call override > constructor default > undefined (server default). */
16
+ private resolveChain;
11
17
  /**
12
- * Build headers for API requests
13
- */
14
- private buildHeaders;
15
- /**
16
- * Make a GET request to Valiron API
17
- */
18
- protected get<T>(path: string, params?: Record<string, string>, extraHeaders?: Record<string, string>): Promise<T>;
19
- /**
20
- * Make a POST request to Valiron API
21
- */
22
- protected post<T>(path: string, body?: any): Promise<T>;
23
- }
24
- /**
25
- * Client for agent trust and routing operations
26
- */
27
- export declare class TrustClient extends BaseClient {
28
- /**
29
- * Check agent routing decision
18
+ * Get the complete trust profile for an agent.
30
19
  *
31
- * This is the primary method for determining how to route requests from an agent.
32
- * The Valiron system will automatically handle sandbox testing if needed.
20
+ * Combines ERC-8004 on-chain identity, on-chain reputation, local
21
+ * behavioral reputation, and a hybrid routing decision.
33
22
  *
34
- * @param agentId - The ERC-8004 agent ID
35
- * @returns Routing decision with explanation
23
+ * `GET /operator/agent/:agentId`
36
24
  */
37
- checkAgent(agentId: string): Promise<RoutingResponse>;
25
+ getAgentProfile(agentId: string, options?: CallOptions): Promise<AgentProfile>;
38
26
  /**
39
- * Check wallet routing decision (legacy support)
27
+ * Get a trust profile by wallet address (reverse lookup).
40
28
  *
41
- * @param wallet - The wallet address
42
- * @returns Routing decision with explanation
29
+ * `GET /operator/wallet/:wallet`
43
30
  */
44
- checkWallet(wallet: string): Promise<RoutingResponse>;
31
+ getWalletProfile(wallet: string, options?: CallOptions): Promise<WalletProfile>;
45
32
  /**
46
- * Get complete agent trust profile
33
+ * Trigger real sandbox testing for an agent.
47
34
  *
48
- * Returns combined on-chain and off-chain reputation data
49
- *
50
- * @param agentId - The ERC-8004 agent ID
51
- * @returns Complete agent profile
52
- */
53
- getAgentProfile(agentId: string): Promise<AgentProfile>;
54
- /**
55
- * Get wallet profile
35
+ * Sends test requests against the agent's HTTP endpoint (if one is
36
+ * registered on-chain) or through the sandbox-api relay, then computes
37
+ * a Valiron score and stores the result.
56
38
  *
57
- * @param wallet - The wallet address
58
- * @returns Wallet profile with routing info
39
+ * `POST /operator/trigger-sandbox/:agentId`
59
40
  */
60
- getWalletProfile(wallet: string): Promise<WalletProfile>;
61
- }
62
- /**
63
- * Client for reputation feedback operations
64
- */
65
- export declare class ReputationClient extends BaseClient {
66
- /**
67
- * Submit feedback about an agent's behavior
68
- *
69
- * Note: This submits feedback to Valiron, which then handles
70
- * IPFS upload and on-chain submission on your behalf.
71
- *
72
- * @param params - Feedback parameters
73
- */
74
- submitFeedback(params: SubmitFeedbackParams): Promise<{
75
- success: boolean;
76
- txHash?: string;
77
- }>;
78
- /**
79
- * Manually trigger sandbox testing for an agent
80
- *
81
- * Useful for testing or re-evaluation scenarios.
82
- *
83
- * @param params - Sandbox test parameters
84
- */
85
- triggerSandboxTest(params: SandboxTestParams): Promise<{
86
- success: boolean;
87
- message: string;
88
- }>;
41
+ triggerSandboxTest(agentId: string, options?: CallOptions): Promise<SandboxResult>;
42
+ private buildHeaders;
43
+ private get;
44
+ private post;
89
45
  }
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
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReputationClient = exports.TrustClient = exports.BaseClient = void 0;
3
+ exports.ValironClient = void 0;
4
4
  const types_1 = require("./types");
5
5
  /**
6
- * Base client for making HTTP requests to Valiron API
6
+ * HTTP client for the Valiron Operator API.
7
+ *
8
+ * All methods map 1-to-1 to the /operator/* endpoints exposed by the
9
+ * Valiron edge-proxy service.
7
10
  */
8
- class BaseClient {
11
+ class ValironClient {
9
12
  constructor(config = {}) {
10
- this.endpoint = config.endpoint || 'https://valiron-edge-proxy.onrender.com';
13
+ this.endpoint =
14
+ config.endpoint || "https://valiron-edge-proxy.onrender.com";
11
15
  this.apiKey = config.apiKey;
16
+ this.defaultChain = config.chain;
12
17
  this.timeout = config.timeout || 5000;
13
18
  this.debug = config.debug || false;
14
19
  }
20
+ // ─── Public API ─────────────────────────────────────────────────────────
21
+ /** Resolve the effective chain: per-call override > constructor default > undefined (server default). */
22
+ resolveChain(options) {
23
+ return options?.chain ?? this.defaultChain;
24
+ }
25
+ /**
26
+ * Get the complete trust profile for an agent.
27
+ *
28
+ * Combines ERC-8004 on-chain identity, on-chain reputation, local
29
+ * behavioral reputation, and a hybrid routing decision.
30
+ *
31
+ * `GET /operator/agent/:agentId`
32
+ */
33
+ async getAgentProfile(agentId, options) {
34
+ return this.get(`/operator/agent/${agentId}`, this.resolveChain(options));
35
+ }
15
36
  /**
16
- * Build headers for API requests
37
+ * Get a trust profile by wallet address (reverse lookup).
38
+ *
39
+ * `GET /operator/wallet/:wallet`
17
40
  */
18
- buildHeaders(extraHeaders) {
41
+ async getWalletProfile(wallet, options) {
42
+ return this.get(`/operator/wallet/${wallet}`, this.resolveChain(options));
43
+ }
44
+ /**
45
+ * Trigger real sandbox testing for an agent.
46
+ *
47
+ * Sends test requests against the agent's HTTP endpoint (if one is
48
+ * registered on-chain) or through the sandbox-api relay, then computes
49
+ * a Valiron score and stores the result.
50
+ *
51
+ * `POST /operator/trigger-sandbox/:agentId`
52
+ */
53
+ async triggerSandboxTest(agentId, options) {
54
+ return this.post(`/operator/trigger-sandbox/${agentId}`, undefined, this.resolveChain(options));
55
+ }
56
+ // ─── HTTP helpers ───────────────────────────────────────────────────────
57
+ buildHeaders() {
19
58
  const headers = {
20
- 'Content-Type': 'application/json',
59
+ "Content-Type": "application/json",
21
60
  };
22
- // Only include Authorization header if apiKey is provided
23
61
  if (this.apiKey) {
24
- headers['Authorization'] = `Bearer ${this.apiKey}`;
25
- }
26
- // Merge extra headers
27
- if (extraHeaders) {
28
- Object.assign(headers, extraHeaders);
62
+ headers["Authorization"] = `Bearer ${this.apiKey}`;
29
63
  }
30
64
  return headers;
31
65
  }
32
- /**
33
- * Make a GET request to Valiron API
34
- */
35
- async get(path, params, extraHeaders) {
66
+ async get(path, chain) {
36
67
  const url = new URL(path, this.endpoint);
37
- if (params) {
38
- Object.entries(params).forEach(([key, value]) => {
39
- url.searchParams.append(key, value);
40
- });
41
- }
68
+ if (chain)
69
+ url.searchParams.set("chain", chain);
42
70
  if (this.debug) {
43
71
  console.log(`[Valiron SDK] GET ${url.toString()}`);
44
72
  }
@@ -46,37 +74,36 @@ class BaseClient {
46
74
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
47
75
  try {
48
76
  const response = await fetch(url.toString(), {
49
- method: 'GET',
50
- headers: this.buildHeaders(extraHeaders),
77
+ method: "GET",
78
+ headers: this.buildHeaders(),
51
79
  signal: controller.signal,
52
80
  });
53
81
  clearTimeout(timeoutId);
54
82
  if (!response.ok) {
55
- const error = await response.json().catch(() => ({ message: response.statusText }));
56
- throw new types_1.ValironError(error.message || `Request failed: ${response.statusText}`, error.code || 'API_ERROR', response.status);
83
+ const body = await response
84
+ .json()
85
+ .catch(() => ({ message: response.statusText }));
86
+ throw new types_1.ValironError(body.error || body.message || `Request failed: ${response.statusText}`, "API_ERROR", response.status);
57
87
  }
58
88
  const data = await response.json();
59
- if (this.debug) {
89
+ if (this.debug)
60
90
  console.log(`[Valiron SDK] Response:`, data);
61
- }
62
91
  return data;
63
92
  }
64
93
  catch (error) {
65
94
  clearTimeout(timeoutId);
66
- if (error.name === 'AbortError') {
67
- throw new types_1.ValironError(`Request timeout after ${this.timeout}ms`, 'TIMEOUT_ERROR');
95
+ if (error.name === "AbortError") {
96
+ throw new types_1.ValironError(`Request timeout after ${this.timeout}ms`, "TIMEOUT_ERROR");
68
97
  }
69
- if (error instanceof types_1.ValironError) {
98
+ if (error instanceof types_1.ValironError)
70
99
  throw error;
71
- }
72
- throw new types_1.ValironError(error.message || 'Network error', 'NETWORK_ERROR');
100
+ throw new types_1.ValironError(error.message || "Network error", "NETWORK_ERROR");
73
101
  }
74
102
  }
75
- /**
76
- * Make a POST request to Valiron API
77
- */
78
- async post(path, body) {
103
+ async post(path, body, chain) {
79
104
  const url = new URL(path, this.endpoint);
105
+ if (chain)
106
+ url.searchParams.set("chain", chain);
80
107
  if (this.debug) {
81
108
  console.log(`[Valiron SDK] POST ${url.toString()}`, body);
82
109
  }
@@ -84,107 +111,33 @@ class BaseClient {
84
111
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
85
112
  try {
86
113
  const response = await fetch(url.toString(), {
87
- method: 'POST',
114
+ method: "POST",
88
115
  headers: this.buildHeaders(),
89
116
  body: body ? JSON.stringify(body) : undefined,
90
117
  signal: controller.signal,
91
118
  });
92
119
  clearTimeout(timeoutId);
93
120
  if (!response.ok) {
94
- const error = await response.json().catch(() => ({ message: response.statusText }));
95
- throw new types_1.ValironError(error.message || `Request failed: ${response.statusText}`, error.code || 'API_ERROR', response.status);
121
+ const respBody = await response
122
+ .json()
123
+ .catch(() => ({ message: response.statusText }));
124
+ throw new types_1.ValironError(respBody.error || respBody.message || `Request failed: ${response.statusText}`, "API_ERROR", response.status);
96
125
  }
97
126
  const data = await response.json();
98
- if (this.debug) {
127
+ if (this.debug)
99
128
  console.log(`[Valiron SDK] Response:`, data);
100
- }
101
129
  return data;
102
130
  }
103
131
  catch (error) {
104
132
  clearTimeout(timeoutId);
105
- if (error.name === 'AbortError') {
106
- throw new types_1.ValironError(`Request timeout after ${this.timeout}ms`, 'TIMEOUT_ERROR');
133
+ if (error.name === "AbortError") {
134
+ throw new types_1.ValironError(`Request timeout after ${this.timeout}ms`, "TIMEOUT_ERROR");
107
135
  }
108
- if (error instanceof types_1.ValironError) {
136
+ if (error instanceof types_1.ValironError)
109
137
  throw error;
110
- }
111
- throw new types_1.ValironError(error.message || 'Network error', 'NETWORK_ERROR');
138
+ throw new types_1.ValironError(error.message || "Network error", "NETWORK_ERROR");
112
139
  }
113
140
  }
114
141
  }
115
- exports.BaseClient = BaseClient;
116
- /**
117
- * Client for agent trust and routing operations
118
- */
119
- class TrustClient extends BaseClient {
120
- /**
121
- * Check agent routing decision
122
- *
123
- * This is the primary method for determining how to route requests from an agent.
124
- * The Valiron system will automatically handle sandbox testing if needed.
125
- *
126
- * @param agentId - The ERC-8004 agent ID
127
- * @returns Routing decision with explanation
128
- */
129
- async checkAgent(agentId) {
130
- return this.get('/route', undefined, { 'x-agent-id': agentId });
131
- }
132
- /**
133
- * Check wallet routing decision (legacy support)
134
- *
135
- * @param wallet - The wallet address
136
- * @returns Routing decision with explanation
137
- */
138
- async checkWallet(wallet) {
139
- return this.get('/route', undefined, { 'x-payment-address': wallet });
140
- }
141
- /**
142
- * Get complete agent trust profile
143
- *
144
- * Returns combined on-chain and off-chain reputation data
145
- *
146
- * @param agentId - The ERC-8004 agent ID
147
- * @returns Complete agent profile
148
- */
149
- async getAgentProfile(agentId) {
150
- return this.get(`/agent/${agentId}`);
151
- }
152
- /**
153
- * Get wallet profile
154
- *
155
- * @param wallet - The wallet address
156
- * @returns Wallet profile with routing info
157
- */
158
- async getWalletProfile(wallet) {
159
- return this.get(`/wallet/${wallet}`);
160
- }
161
- }
162
- exports.TrustClient = TrustClient;
163
- /**
164
- * Client for reputation feedback operations
165
- */
166
- class ReputationClient extends BaseClient {
167
- /**
168
- * Submit feedback about an agent's behavior
169
- *
170
- * Note: This submits feedback to Valiron, which then handles
171
- * IPFS upload and on-chain submission on your behalf.
172
- *
173
- * @param params - Feedback parameters
174
- */
175
- async submitFeedback(params) {
176
- return this.post('/feedback', params);
177
- }
178
- /**
179
- * Manually trigger sandbox testing for an agent
180
- *
181
- * Useful for testing or re-evaluation scenarios.
182
- *
183
- * @param params - Sandbox test parameters
184
- */
185
- async triggerSandboxTest(params) {
186
- return this.post('/sandbox/trigger', params);
187
- }
188
- }
189
- exports.ReputationClient = ReputationClient;
142
+ exports.ValironClient = ValironClient;
190
143
  //# sourceMappingURL=clients.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clients.js","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":";;;AAAA,mCAQiB;AAEjB;;GAEG;AACH,MAAa,UAAU;IAMrB,YAAY,SAAwB,EAAE;QACpC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,yCAAyC,CAAC;QAC7E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC;IACrC,CAAC;IAED;;OAEG;IACK,YAAY,CAAC,YAAqC;QACxD,MAAM,OAAO,GAA2B;YACtC,cAAc,EAAE,kBAAkB;SACnC,CAAC;QACF,0DAA0D;QAC1D,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC;QACrD,CAAC;QACD,sBAAsB;QACtB,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,MAA+B,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GED
@@ -1,132 +1,117 @@
1
- import { ValironConfig, RoutingResponse, AgentProfile, WalletProfile, SubmitFeedbackParams, SandboxTestParams } from './types';
1
+ import { ValironConfig, CallOptions, AgentProfile, WalletProfile, SandboxResult, RouteDecision } from "./types";
2
2
  /**
3
- * Valiron SDK - Official TypeScript SDK for the Trust Layer for Agentic Economy
3
+ * Valiron SDK – Official TypeScript SDK for the Trust Layer for Agentic Economy
4
4
  *
5
5
  * @example
6
6
  * ```typescript
7
7
  * import { ValironSDK } from '@valiron/sdk';
8
8
  *
9
- * const valiron = new ValironSDK({
10
- * apiKey: 'vln_your_api_key'
11
- * });
9
+ * // Default chain (ethereum)
10
+ * const valiron = new ValironSDK();
12
11
  *
13
- * // Check if agent can access production
14
- * const decision = await valiron.checkAgent('123');
15
- * if (decision.route === 'prod') {
12
+ * // Or set a default chain at construction
13
+ * const monadValiron = new ValironSDK({ chain: 'monad' });
14
+ *
15
+ * // Get full trust profile (identity + reputation + routing)
16
+ * const profile = await valiron.getAgentProfile('25459');
17
+ *
18
+ * // Override chain per-call
19
+ * const monadProfile = await valiron.getAgentProfile('8348', { chain: 'monad' });
20
+ *
21
+ * if (profile.routing.finalRoute === 'prod') {
16
22
  * // Allow full production access
17
23
  * }
18
24
  * ```
19
25
  */
20
26
  export declare class ValironSDK {
21
- private trustClient;
22
- private reputationClient;
23
- constructor(config: ValironConfig);
27
+ private client;
28
+ constructor(config?: ValironConfig);
24
29
  /**
25
- * Check agent routing decision
30
+ * Get the complete trust profile for an ERC-8004 agent.
26
31
  *
27
- * This is the primary method for determining how to route requests from an agent.
28
- * Valiron automatically handles sandbox testing if the agent hasn't been evaluated.
32
+ * Returns on-chain identity, on-chain reputation (feedback count,
33
+ * average score, individual entries), local behavioral reputation
34
+ * (Valiron sandbox metrics), and a hybrid routing decision.
29
35
  *
30
36
  * @param agentId - The ERC-8004 agent ID
31
- * @returns Routing decision with detailed explanation
37
+ * @param options - Optional overrides (e.g. `{ chain: 'monad' }`)
38
+ * @returns Full agent trust profile
32
39
  *
33
40
  * @example
34
41
  * ```typescript
35
- * const result = await valiron.checkAgent('417');
36
- *
37
- * switch (result.route) {
38
- * case 'prod':
39
- * return handleProductionRequest();
40
- * case 'prod_throttled':
41
- * return handleThrottledRequest();
42
- * case 'sandbox':
43
- * case 'sandbox_only':
44
- * return rejectRequest();
45
- * }
46
- * ```
47
- */
48
- checkAgent(agentId: string): Promise<RoutingResponse>;
49
- /**
50
- * Check wallet routing decision
42
+ * // Uses default chain
43
+ * const profile = await valiron.getAgentProfile('25459');
51
44
  *
52
- * Legacy method for wallet-based routing. Prefer `checkAgent()` for ERC-8004 agents.
45
+ * // Explicit Monad chain
46
+ * const monadProfile = await valiron.getAgentProfile('8348', { chain: 'monad' });
53
47
  *
54
- * @param wallet - The wallet address
55
- * @returns Routing decision
48
+ * console.log(profile.routing.finalRoute); // 'prod'
49
+ * console.log(profile.routing.decision); // human-readable explanation
50
+ * console.log(profile.localReputation?.tier); // 'AAA'
51
+ * console.log(profile.onchainReputation.averageScore); // 92.5
52
+ * ```
56
53
  */
57
- checkWallet(wallet: string): Promise<RoutingResponse>;
54
+ getAgentProfile(agentId: string, options?: CallOptions): Promise<AgentProfile>;
58
55
  /**
59
- * Get complete agent trust profile
56
+ * Convenience helper – get just the routing decision for an agent.
60
57
  *
61
- * Returns comprehensive trust data including on-chain reputation,
62
- * behavioral analysis scores, and routing logic.
58
+ * This calls `getAgentProfile` under the hood and extracts the
59
+ * `routing.finalRoute` field.
63
60
  *
64
61
  * @param agentId - The ERC-8004 agent ID
65
- * @returns Complete agent profile
62
+ * @param options - Optional overrides (e.g. `{ chain: 'monad' }`)
63
+ * @returns The route decision string
66
64
  *
67
65
  * @example
68
66
  * ```typescript
69
- * const profile = await valiron.getAgentProfile('417');
70
- * console.log(`Agent score: ${profile.localReputation?.score}`);
71
- * console.log(`Tier: ${profile.localReputation?.tier}`);
72
- * console.log(`On-chain feedback: ${profile.onchainReputation.count} entries`);
67
+ * const route = await valiron.checkAgent('25459');
68
+ * const monadRoute = await valiron.checkAgent('8348', { chain: 'monad' });
69
+ * if (route === 'prod' || route === 'prod_throttled') {
70
+ * return handleRequest();
71
+ * }
73
72
  * ```
74
73
  */
75
- getAgentProfile(agentId: string): Promise<AgentProfile>;
74
+ checkAgent(agentId: string, options?: CallOptions): Promise<RouteDecision>;
76
75
  /**
77
- * Get wallet profile
76
+ * Get a trust profile by wallet address (reverse lookup).
78
77
  *
79
- * @param wallet - The wallet address
80
- * @returns Wallet profile with routing info
81
- */
82
- getWalletProfile(wallet: string): Promise<WalletProfile>;
83
- /**
84
- * Submit feedback about an agent's behavior
85
- *
86
- * This allows you to report an agent's behavior to Valiron.
87
- * Valiron handles IPFS storage and on-chain submission automatically.
78
+ * If the wallet has an associated agent ID in local state, the full
79
+ * profile (identity + on-chain reputation) is included. Otherwise
80
+ * only local behavioral data is returned.
88
81
  *
89
- * @param params - Feedback parameters
90
- * @returns Submission result with transaction hash
82
+ * @param wallet - Ethereum wallet address
83
+ * @param options - Optional overrides (e.g. `{ chain: 'monad' }`)
84
+ * @returns Wallet trust profile
91
85
  *
92
86
  * @example
93
87
  * ```typescript
94
- * await valiron.submitFeedback({
95
- * agentId: '417',
96
- * score: 95,
97
- * outcome: 'success',
98
- * metadata: {
99
- * taskType: 'data_processing',
100
- * duration: 1234
101
- * }
102
- * });
88
+ * const profile = await valiron.getWalletProfile('0x52ce…');
89
+ * console.log(profile.routing.finalRoute);
103
90
  * ```
104
91
  */
105
- submitFeedback(params: SubmitFeedbackParams): Promise<{
106
- success: boolean;
107
- txHash?: string;
108
- }>;
92
+ getWalletProfile(wallet: string, options?: CallOptions): Promise<WalletProfile>;
109
93
  /**
110
- * Manually trigger sandbox testing
94
+ * Trigger real sandbox testing for an agent.
111
95
  *
112
- * Useful for re-evaluating an agent or testing specific scenarios.
96
+ * Sends a series of test requests against the agent's HTTP endpoint
97
+ * (if registered on-chain) or through the sandbox relay, then computes
98
+ * a Valiron behavioral score and stores the result.
113
99
  *
114
- * @param params - Sandbox test parameters
115
- * @returns Test trigger result
100
+ * @param agentId - The ERC-8004 agent ID
101
+ * @param options - Optional overrides (e.g. `{ chain: 'monad' }`)
102
+ * @returns Sandbox test results including score, tier, and metrics
116
103
  *
117
104
  * @example
118
105
  * ```typescript
119
- * await valiron.triggerSandboxTest({
120
- * agentId: '417',
121
- * behaviorType: 'good'
122
- * });
106
+ * const result = await valiron.triggerSandboxTest('25459');
107
+ * console.log(result.valironScore); // 95
108
+ * console.log(result.tier); // 'AAA'
109
+ * console.log(result.riskLevel); // 'GREEN'
110
+ * console.log(result.testSummary); // { totalRequests, successCount, … }
123
111
  * ```
124
112
  */
125
- triggerSandboxTest(params: SandboxTestParams): Promise<{
126
- success: boolean;
127
- message: string;
128
- }>;
113
+ triggerSandboxTest(agentId: string, options?: CallOptions): Promise<SandboxResult>;
129
114
  }
130
- export * from './types';
131
- export * from './clients';
115
+ export * from "./types";
116
+ export { ValironClient } from "./clients";
132
117
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,MAAM,EAAE,aAAa;IAKjC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI3D;;;;;;;OAOG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI3D;;;;;;;;;;;;;;;;OAgBG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,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