@agirails/sdk 2.0.3 → 2.0.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.
Files changed (57) hide show
  1. package/dist/adapters/BaseAdapter.js +2 -2
  2. package/dist/adapters/BaseAdapter.js.map +1 -1
  3. package/dist/adapters/BasicAdapter.d.ts.map +1 -1
  4. package/dist/adapters/BasicAdapter.js.map +1 -1
  5. package/dist/adapters/StandardAdapter.d.ts.map +1 -1
  6. package/dist/adapters/StandardAdapter.js.map +1 -1
  7. package/dist/builders/QuoteBuilder.js +1 -1
  8. package/dist/builders/QuoteBuilder.js.map +1 -1
  9. package/dist/cli/commands/config.js +1 -1
  10. package/dist/cli/commands/config.js.map +1 -1
  11. package/dist/cli/commands/simulate.js.map +1 -1
  12. package/dist/cli/commands/time.d.ts.map +1 -1
  13. package/dist/cli/commands/time.js.map +1 -1
  14. package/dist/level0/request.d.ts.map +1 -1
  15. package/dist/level0/request.js +1 -2
  16. package/dist/level0/request.js.map +1 -1
  17. package/dist/level1/Agent.d.ts.map +1 -1
  18. package/dist/level1/Agent.js.map +1 -1
  19. package/dist/level1/pricing/PriceCalculator.js +1 -1
  20. package/dist/level1/pricing/PriceCalculator.js.map +1 -1
  21. package/dist/level1/types/Options.d.ts.map +1 -1
  22. package/dist/protocol/MessageSigner.js +1 -1
  23. package/dist/protocol/MessageSigner.js.map +1 -1
  24. package/dist/protocol/ProofGenerator.d.ts.map +1 -1
  25. package/dist/protocol/ProofGenerator.js +1 -0
  26. package/dist/protocol/ProofGenerator.js.map +1 -1
  27. package/dist/runtime/BlockchainRuntime.d.ts +3 -3
  28. package/dist/runtime/BlockchainRuntime.d.ts.map +1 -1
  29. package/dist/runtime/BlockchainRuntime.js +3 -3
  30. package/dist/runtime/BlockchainRuntime.js.map +1 -1
  31. package/dist/runtime/MockRuntime.d.ts.map +1 -1
  32. package/dist/runtime/MockRuntime.js.map +1 -1
  33. package/dist/utils/ErrorRecoveryGuide.d.ts.map +1 -1
  34. package/dist/utils/ErrorRecoveryGuide.js +1 -2
  35. package/dist/utils/ErrorRecoveryGuide.js.map +1 -1
  36. package/dist/utils/UsedAttestationTracker.d.ts +1 -1
  37. package/dist/utils/UsedAttestationTracker.d.ts.map +1 -1
  38. package/dist/utils/UsedAttestationTracker.js +1 -1
  39. package/dist/utils/UsedAttestationTracker.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/adapters/BaseAdapter.ts +2 -2
  42. package/src/adapters/BasicAdapter.ts +1 -2
  43. package/src/adapters/StandardAdapter.ts +1 -1
  44. package/src/builders/QuoteBuilder.ts +1 -1
  45. package/src/cli/commands/config.ts +1 -1
  46. package/src/cli/commands/simulate.ts +1 -1
  47. package/src/cli/commands/time.ts +1 -2
  48. package/src/level0/request.ts +1 -2
  49. package/src/level1/Agent.ts +2 -2
  50. package/src/level1/pricing/PriceCalculator.ts +1 -1
  51. package/src/level1/types/Options.ts +1 -1
  52. package/src/protocol/MessageSigner.ts +1 -1
  53. package/src/protocol/ProofGenerator.ts +1 -0
  54. package/src/runtime/BlockchainRuntime.ts +3 -3
  55. package/src/runtime/MockRuntime.ts +0 -2
  56. package/src/utils/ErrorRecoveryGuide.ts +1 -2
  57. package/src/utils/UsedAttestationTracker.ts +1 -1
@@ -14,7 +14,7 @@ import { Command } from 'commander';
14
14
  import { Output, ExitCode, fmt } from '../utils/output';
15
15
  import { loadConfig } from '../utils/config';
16
16
  import { mapError } from '../utils/client';
17
- import { BaseAdapter, ValidationError, MIN_AMOUNT_WEI } from '../../adapters/BaseAdapter';
17
+ import { BaseAdapter } from '../../adapters/BaseAdapter';
18
18
 
19
19
  // ============================================================================
20
20
  // Command Definition
@@ -10,10 +10,9 @@
10
10
  */
11
11
 
12
12
  import { Command } from 'commander';
13
- import { Output, ExitCode, fmt } from '../utils/output';
13
+ import { Output, ExitCode } from '../utils/output';
14
14
  import { loadConfig } from '../utils/config';
15
15
  import { createClient, mapError } from '../utils/client';
16
- import { MockRuntime } from '../../runtime/MockRuntime';
17
16
  import { IMockRuntime } from '../../runtime/IACTPRuntime';
18
17
 
19
18
  // ============================================================================
@@ -164,7 +164,6 @@ export async function request(
164
164
 
165
165
  let tx = await client.runtime.getTransaction(txId);
166
166
  let attempts = 0;
167
- let timedOut = false;
168
167
 
169
168
  while (tx && tx.state !== 'DELIVERED' && tx.state !== 'SETTLED' && attempts < maxAttempts) {
170
169
  // Check for terminal states that indicate failure
@@ -190,7 +189,7 @@ export async function request(
190
189
 
191
190
  // Check if we got a result
192
191
  if (!tx || (tx.state !== 'DELIVERED' && tx.state !== 'SETTLED')) {
193
- timedOut = true;
192
+ const _timedOut = true; // Flag for potential future use
194
193
 
195
194
  // SECURITY FIX (H-3): Auto-cancel transaction on timeout if still in early state
196
195
  // This prevents funds from being locked indefinitely if provider never responds
@@ -14,10 +14,10 @@ import * as fs from 'fs';
14
14
  import { ethers } from 'ethers';
15
15
  import { ACTPClient } from '../ACTPClient';
16
16
  import { Job, JobHandler, JobContext } from './types/Job';
17
- import { ProvideOptions, RequestOptions, RequestResult, NetworkOption } from './types/Options';
17
+ import { RequestOptions, RequestResult, NetworkOption } from './types/Options';
18
18
  import { PricingStrategy } from './pricing/PricingStrategy';
19
19
  import { AgentLifecycleError, ServiceConfigError, ValidationError } from '../errors';
20
- import { validateServiceName, validatePath, isValidAddress, LRUCache } from '../utils/security';
20
+ import { validateServiceName, validatePath, LRUCache } from '../utils/security';
21
21
  import { Logger } from '../utils/Logger';
22
22
  import { ServiceHash } from '../utils/Helpers';
23
23
  import { Semaphore } from '../utils/Semaphore';
@@ -214,7 +214,7 @@ function estimateUnits(job: Job, unit: string): number {
214
214
  *
215
215
  * @internal
216
216
  */
217
- function estimateApiCost(api: string, job: Job): number {
217
+ function estimateApiCost(_api: string, _job: Job): number {
218
218
  // MVP: Returns 0 (API costs tracked externally by agent)
219
219
  // V2: Integrate with OpenAI/Anthropic pricing APIs
220
220
 
@@ -4,7 +4,7 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
 
7
- import { JobHandler, Job } from './Job';
7
+ import { Job } from './Job';
8
8
 
9
9
  /**
10
10
  * Wallet configuration options
@@ -157,7 +157,7 @@ export class MessageSigner {
157
157
  );
158
158
  }
159
159
 
160
- const { type, version, from, to, timestamp, nonce, signature, ...payload } = message;
160
+ const { type, version, from, to, timestamp, nonce, signature: _sig, ...payload } = message;
161
161
 
162
162
  // SECURITY FIX (H-3): Validate nonce format (must be bytes32)
163
163
  if (!nonce || !/^0x[a-fA-F0-9]{64}$/.test(nonce)) {
@@ -230,6 +230,7 @@ export class ProofGenerator {
230
230
  throw new Error('Response body is not readable');
231
231
  }
232
232
 
233
+ // eslint-disable-next-line no-constant-condition
233
234
  while (true) {
234
235
  const { done, value } = await reader.read();
235
236
 
@@ -892,7 +892,7 @@ export class BlockchainRuntime implements IACTPRuntime {
892
892
  * @param params - Transaction parameters
893
893
  * @returns Estimated gas limit and cost in wei
894
894
  */
895
- async estimateCreateTransactionGas(params: CreateTransactionParams): Promise<{
895
+ async estimateCreateTransactionGas(_params: CreateTransactionParams): Promise<{
896
896
  gasLimit: bigint;
897
897
  gasCostWei: bigint;
898
898
  gasCostGwei: string;
@@ -921,7 +921,7 @@ export class BlockchainRuntime implements IACTPRuntime {
921
921
  * @param txId - Transaction ID
922
922
  * @returns Estimated gas limit and cost
923
923
  */
924
- async estimateLinkEscrowGas(txId: string): Promise<{
924
+ async estimateLinkEscrowGas(_txId: string): Promise<{
925
925
  gasLimit: bigint;
926
926
  gasCostWei: bigint;
927
927
  gasCostGwei: string;
@@ -949,7 +949,7 @@ export class BlockchainRuntime implements IACTPRuntime {
949
949
  * @param newState - Target state
950
950
  * @returns Estimated gas limit and cost
951
951
  */
952
- async estimateTransitionGas(txId: string, newState: string): Promise<{
952
+ async estimateTransitionGas(_txId: string, _newState: string): Promise<{
953
953
  gasLimit: bigint;
954
954
  gasCostWei: bigint;
955
955
  gasCostGwei: string;
@@ -25,8 +25,6 @@ import {
25
25
  MockEscrow,
26
26
  MockEvent,
27
27
  TransactionState,
28
- TransactionStateValue,
29
- MOCK_STATE_DEFAULTS,
30
28
  } from './types/MockState';
31
29
  import { IACTPRuntime, CreateTransactionParams } from './IACTPRuntime';
32
30
 
@@ -637,14 +637,12 @@ export async function withRecoveryGuidance<T>(
637
637
  ): Promise<T> {
638
638
  const { logGuidance = false, autoRetry = false, onError } = options;
639
639
 
640
- let lastError: unknown;
641
640
  let attempts = 0;
642
641
 
643
642
  do {
644
643
  try {
645
644
  return await operation();
646
645
  } catch (error) {
647
- lastError = error;
648
646
  const recovery = ErrorRecoveryGuide.analyze(error);
649
647
 
650
648
  if (onError) {
@@ -671,5 +669,6 @@ export async function withRecoveryGuidance<T>(
671
669
 
672
670
  throw error;
673
671
  }
672
+ // eslint-disable-next-line no-constant-condition
674
673
  } while (true);
675
674
  }
@@ -202,7 +202,7 @@ export class InMemoryUsedAttestationTracker implements IUsedAttestationTracker {
202
202
  *
203
203
  * @param maxAgeHours - Remove entries older than this many hours
204
204
  */
205
- cleanupOldEntries(maxAgeHours: number): number {
205
+ cleanupOldEntries(_maxAgeHours: number): number {
206
206
  // In-memory tracker doesn't track timestamps
207
207
  // This is a placeholder for future enhancement
208
208
  console.warn(