@virtuals-protocol/acp-node 0.1.0-beta.4 → 0.1.0-beta.5

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.mts CHANGED
@@ -75,6 +75,7 @@ type AcpContractConfig = {
75
75
  alchemyRpcUrl: string;
76
76
  };
77
77
  declare const baseSepoliaAcpConfig: AcpContractConfig;
78
+ declare const baseAcpConfig: AcpContractConfig;
78
79
 
79
80
  declare enum MemoType {
80
81
  MESSAGE = 0,
@@ -101,8 +102,8 @@ declare class AcpContractClient {
101
102
  private chain;
102
103
  private contractAddress;
103
104
  private virtualsTokenAddress;
104
- constructor(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config: AcpContractConfig);
105
- static build(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config: AcpContractConfig): Promise<AcpContractClient>;
105
+ constructor(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config?: AcpContractConfig);
106
+ static build(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config?: AcpContractConfig): Promise<AcpContractClient>;
106
107
  init(): Promise<void>;
107
108
  get sessionKeyClient(): {
108
109
  [x: string]: unknown;
@@ -8367,7 +8368,8 @@ declare class AcpJob {
8367
8368
  price: number;
8368
8369
  memos: AcpMemo[];
8369
8370
  phase: AcpJobPhases;
8370
- constructor(acpClient: AcpClient, id: number, clientAddress: Address$1, providerAddress: Address$1, evaluatorAddress: Address$1, price: number, memos: AcpMemo[], phase: AcpJobPhases);
8371
+ context: Record<string, any>;
8372
+ constructor(acpClient: AcpClient, id: number, clientAddress: Address$1, providerAddress: Address$1, evaluatorAddress: Address$1, price: number, memos: AcpMemo[], phase: AcpJobPhases, context: Record<string, any>);
8371
8373
  get serviceRequirement(): string | undefined;
8372
8374
  get deliverable(): string | undefined;
8373
8375
  get providerAgent(): Promise<AcpAgent | undefined>;
@@ -8467,4 +8469,4 @@ declare class AcpClient {
8467
8469
  getAgent(walletAddress: Address$1): Promise<AcpAgent | undefined>;
8468
8470
  }
8469
8471
 
8470
- export { ACP_ABI, AcpAgentSort, AcpContractClient, type AcpContractConfig, AcpJob, AcpJobPhases, AcpMemo, MemoType, baseSepoliaAcpConfig, AcpClient as default };
8472
+ export { ACP_ABI, AcpAgentSort, AcpContractClient, type AcpContractConfig, AcpJob, AcpJobPhases, AcpMemo, MemoType, baseAcpConfig, baseSepoliaAcpConfig, AcpClient as default };
package/dist/index.d.ts CHANGED
@@ -75,6 +75,7 @@ type AcpContractConfig = {
75
75
  alchemyRpcUrl: string;
76
76
  };
77
77
  declare const baseSepoliaAcpConfig: AcpContractConfig;
78
+ declare const baseAcpConfig: AcpContractConfig;
78
79
 
79
80
  declare enum MemoType {
80
81
  MESSAGE = 0,
@@ -101,8 +102,8 @@ declare class AcpContractClient {
101
102
  private chain;
102
103
  private contractAddress;
103
104
  private virtualsTokenAddress;
104
- constructor(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config: AcpContractConfig);
105
- static build(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config: AcpContractConfig): Promise<AcpContractClient>;
105
+ constructor(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config?: AcpContractConfig);
106
+ static build(walletPrivateKey: Address, sessionEntityKeyId: number, agentWalletAddress: Address, config?: AcpContractConfig): Promise<AcpContractClient>;
106
107
  init(): Promise<void>;
107
108
  get sessionKeyClient(): {
108
109
  [x: string]: unknown;
@@ -8367,7 +8368,8 @@ declare class AcpJob {
8367
8368
  price: number;
8368
8369
  memos: AcpMemo[];
8369
8370
  phase: AcpJobPhases;
8370
- constructor(acpClient: AcpClient, id: number, clientAddress: Address$1, providerAddress: Address$1, evaluatorAddress: Address$1, price: number, memos: AcpMemo[], phase: AcpJobPhases);
8371
+ context: Record<string, any>;
8372
+ constructor(acpClient: AcpClient, id: number, clientAddress: Address$1, providerAddress: Address$1, evaluatorAddress: Address$1, price: number, memos: AcpMemo[], phase: AcpJobPhases, context: Record<string, any>);
8371
8373
  get serviceRequirement(): string | undefined;
8372
8374
  get deliverable(): string | undefined;
8373
8375
  get providerAgent(): Promise<AcpAgent | undefined>;
@@ -8467,4 +8469,4 @@ declare class AcpClient {
8467
8469
  getAgent(walletAddress: Address$1): Promise<AcpAgent | undefined>;
8468
8470
  }
8469
8471
 
8470
- export { ACP_ABI, AcpAgentSort, AcpContractClient, type AcpContractConfig, AcpJob, AcpJobPhases, AcpMemo, MemoType, baseSepoliaAcpConfig, AcpClient as default };
8472
+ export { ACP_ABI, AcpAgentSort, AcpContractClient, type AcpContractConfig, AcpJob, AcpJobPhases, AcpMemo, MemoType, baseAcpConfig, baseSepoliaAcpConfig, AcpClient as default };
package/dist/index.js CHANGED
@@ -71,6 +71,7 @@ __export(index_exports, {
71
71
  AcpJobPhases: () => AcpJobPhases,
72
72
  AcpMemo: () => acpMemo_default,
73
73
  MemoType: () => MemoType,
74
+ baseAcpConfig: () => baseAcpConfig,
74
75
  baseSepoliaAcpConfig: () => baseSepoliaAcpConfig,
75
76
  default: () => index_default
76
77
  });
@@ -763,8 +764,27 @@ var import_socket = require("socket.io-client");
763
764
 
764
765
  // src/acpContractClient.ts
765
766
  var import_core = require("@aa-sdk/core");
766
- var import_infra = require("@account-kit/infra");
767
+ var import_infra2 = require("@account-kit/infra");
767
768
  var import_smart_contracts = require("@account-kit/smart-contracts");
769
+
770
+ // src/configs.ts
771
+ var import_infra = require("@account-kit/infra");
772
+ var baseSepoliaAcpConfig = {
773
+ chain: import_infra.baseSepolia,
774
+ contractAddress: "0x2422c1c43451Eb69Ff49dfD39c4Dc8C5230fA1e6",
775
+ virtualsTokenAddress: "0xbfAB80ccc15DF6fb7185f9498d6039317331846a",
776
+ alchemyRpcUrl: "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
777
+ acpUrl: "https://acpx-staging.virtuals.io"
778
+ };
779
+ var baseAcpConfig = {
780
+ chain: import_infra.base,
781
+ contractAddress: "0x2422c1c43451Eb69Ff49dfD39c4Dc8C5230fA1e6",
782
+ virtualsTokenAddress: "0xbfAB80ccc15DF6fb7185f9498d6039317331846a",
783
+ alchemyRpcUrl: "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
784
+ acpUrl: "https://acpx.virtuals.io"
785
+ };
786
+
787
+ // src/acpContractClient.ts
768
788
  var import_viem = require("viem");
769
789
  var MemoType = /* @__PURE__ */ ((MemoType2) => {
770
790
  MemoType2[MemoType2["MESSAGE"] = 0] = "MESSAGE";
@@ -785,7 +805,7 @@ var AcpJobPhases = /* @__PURE__ */ ((AcpJobPhases2) => {
785
805
  return AcpJobPhases2;
786
806
  })(AcpJobPhases || {});
787
807
  var AcpContractClient = class _AcpContractClient {
788
- constructor(walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config) {
808
+ constructor(walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfig) {
789
809
  this.walletPrivateKey = walletPrivateKey;
790
810
  this.sessionEntityKeyId = sessionEntityKeyId;
791
811
  this.agentWalletAddress = agentWalletAddress;
@@ -794,8 +814,8 @@ var AcpContractClient = class _AcpContractClient {
794
814
  this.contractAddress = config.contractAddress;
795
815
  this.virtualsTokenAddress = config.virtualsTokenAddress;
796
816
  }
797
- static build(walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config) {
798
- return __async(this, null, function* () {
817
+ static build(_0, _1, _2) {
818
+ return __async(this, arguments, function* (walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfig) {
799
819
  const acpContractClient = new _AcpContractClient(
800
820
  walletPrivateKey,
801
821
  sessionEntityKeyId,
@@ -811,7 +831,7 @@ var AcpContractClient = class _AcpContractClient {
811
831
  const sessionKeySigner = import_core.LocalAccountSigner.privateKeyToAccountSigner(this.walletPrivateKey);
812
832
  this._sessionKeyClient = yield (0, import_smart_contracts.createModularAccountV2Client)({
813
833
  chain: this.chain,
814
- transport: (0, import_infra.alchemy)({
834
+ transport: (0, import_infra2.alchemy)({
815
835
  rpcUrl: this.config.alchemyRpcUrl
816
836
  }),
817
837
  signer: sessionKeySigner,
@@ -983,7 +1003,7 @@ var acpContractClient_default = AcpContractClient;
983
1003
 
984
1004
  // src/acpJob.ts
985
1005
  var AcpJob = class {
986
- constructor(acpClient, id, clientAddress, providerAddress, evaluatorAddress, price, memos, phase) {
1006
+ constructor(acpClient, id, clientAddress, providerAddress, evaluatorAddress, price, memos, phase, context) {
987
1007
  this.acpClient = acpClient;
988
1008
  this.id = id;
989
1009
  this.clientAddress = clientAddress;
@@ -992,6 +1012,7 @@ var AcpJob = class {
992
1012
  this.price = price;
993
1013
  this.memos = memos;
994
1014
  this.phase = phase;
1015
+ this.context = context;
995
1016
  }
996
1017
  get serviceRequirement() {
997
1018
  var _a;
@@ -1171,7 +1192,8 @@ var AcpClient = class {
1171
1192
  memo.nextPhase
1172
1193
  );
1173
1194
  }),
1174
- data.phase
1195
+ data.phase,
1196
+ data.context
1175
1197
  );
1176
1198
  this.onEvaluate(job);
1177
1199
  }
@@ -1198,7 +1220,8 @@ var AcpClient = class {
1198
1220
  memo.nextPhase
1199
1221
  );
1200
1222
  }),
1201
- data.phase
1223
+ data.phase,
1224
+ data.context
1202
1225
  );
1203
1226
  this.onNewTask(job);
1204
1227
  }
@@ -1344,7 +1367,8 @@ var AcpClient = class {
1344
1367
  memo.nextPhase
1345
1368
  );
1346
1369
  }),
1347
- job.phase
1370
+ job.phase,
1371
+ job.context
1348
1372
  );
1349
1373
  });
1350
1374
  } catch (error) {
@@ -1382,7 +1406,8 @@ var AcpClient = class {
1382
1406
  memo.nextPhase
1383
1407
  );
1384
1408
  }),
1385
- job.phase
1409
+ job.phase,
1410
+ job.context
1386
1411
  );
1387
1412
  });
1388
1413
  } catch (error) {
@@ -1420,7 +1445,8 @@ var AcpClient = class {
1420
1445
  memo.nextPhase
1421
1446
  );
1422
1447
  }),
1423
- job.phase
1448
+ job.phase,
1449
+ job.context
1424
1450
  );
1425
1451
  });
1426
1452
  } catch (error) {
@@ -1461,7 +1487,8 @@ var AcpClient = class {
1461
1487
  memo.nextPhase
1462
1488
  );
1463
1489
  }),
1464
- job.phase
1490
+ job.phase,
1491
+ job.context
1465
1492
  );
1466
1493
  } catch (error) {
1467
1494
  throw error;
@@ -1522,16 +1549,6 @@ var AcpAgentSort = /* @__PURE__ */ ((AcpAgentSort2) => {
1522
1549
  return AcpAgentSort2;
1523
1550
  })(AcpAgentSort || {});
1524
1551
 
1525
- // src/configs.ts
1526
- var import_infra2 = require("@account-kit/infra");
1527
- var baseSepoliaAcpConfig = {
1528
- chain: import_infra2.baseSepolia,
1529
- contractAddress: "0x2422c1c43451Eb69Ff49dfD39c4Dc8C5230fA1e6",
1530
- virtualsTokenAddress: "0xbfAB80ccc15DF6fb7185f9498d6039317331846a",
1531
- alchemyRpcUrl: "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
1532
- acpUrl: "https://acpx-staging.virtuals.io"
1533
- };
1534
-
1535
1552
  // src/index.ts
1536
1553
  var index_default = acpClient_default;
1537
1554
  // Annotate the CommonJS export names for ESM import in node:
@@ -1543,5 +1560,6 @@ var index_default = acpClient_default;
1543
1560
  AcpJobPhases,
1544
1561
  AcpMemo,
1545
1562
  MemoType,
1563
+ baseAcpConfig,
1546
1564
  baseSepoliaAcpConfig
1547
1565
  });
package/dist/index.mjs CHANGED
@@ -726,6 +726,25 @@ import { alchemy } from "@account-kit/infra";
726
726
  import {
727
727
  createModularAccountV2Client
728
728
  } from "@account-kit/smart-contracts";
729
+
730
+ // src/configs.ts
731
+ import { baseSepolia, base } from "@account-kit/infra";
732
+ var baseSepoliaAcpConfig = {
733
+ chain: baseSepolia,
734
+ contractAddress: "0x2422c1c43451Eb69Ff49dfD39c4Dc8C5230fA1e6",
735
+ virtualsTokenAddress: "0xbfAB80ccc15DF6fb7185f9498d6039317331846a",
736
+ alchemyRpcUrl: "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
737
+ acpUrl: "https://acpx-staging.virtuals.io"
738
+ };
739
+ var baseAcpConfig = {
740
+ chain: base,
741
+ contractAddress: "0x2422c1c43451Eb69Ff49dfD39c4Dc8C5230fA1e6",
742
+ virtualsTokenAddress: "0xbfAB80ccc15DF6fb7185f9498d6039317331846a",
743
+ alchemyRpcUrl: "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
744
+ acpUrl: "https://acpx.virtuals.io"
745
+ };
746
+
747
+ // src/acpContractClient.ts
729
748
  import { encodeFunctionData, erc20Abi, fromHex } from "viem";
730
749
  var MemoType = /* @__PURE__ */ ((MemoType2) => {
731
750
  MemoType2[MemoType2["MESSAGE"] = 0] = "MESSAGE";
@@ -746,7 +765,7 @@ var AcpJobPhases = /* @__PURE__ */ ((AcpJobPhases2) => {
746
765
  return AcpJobPhases2;
747
766
  })(AcpJobPhases || {});
748
767
  var AcpContractClient = class _AcpContractClient {
749
- constructor(walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config) {
768
+ constructor(walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfig) {
750
769
  this.walletPrivateKey = walletPrivateKey;
751
770
  this.sessionEntityKeyId = sessionEntityKeyId;
752
771
  this.agentWalletAddress = agentWalletAddress;
@@ -755,8 +774,8 @@ var AcpContractClient = class _AcpContractClient {
755
774
  this.contractAddress = config.contractAddress;
756
775
  this.virtualsTokenAddress = config.virtualsTokenAddress;
757
776
  }
758
- static build(walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config) {
759
- return __async(this, null, function* () {
777
+ static build(_0, _1, _2) {
778
+ return __async(this, arguments, function* (walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfig) {
760
779
  const acpContractClient = new _AcpContractClient(
761
780
  walletPrivateKey,
762
781
  sessionEntityKeyId,
@@ -944,7 +963,7 @@ var acpContractClient_default = AcpContractClient;
944
963
 
945
964
  // src/acpJob.ts
946
965
  var AcpJob = class {
947
- constructor(acpClient, id, clientAddress, providerAddress, evaluatorAddress, price, memos, phase) {
966
+ constructor(acpClient, id, clientAddress, providerAddress, evaluatorAddress, price, memos, phase, context) {
948
967
  this.acpClient = acpClient;
949
968
  this.id = id;
950
969
  this.clientAddress = clientAddress;
@@ -953,6 +972,7 @@ var AcpJob = class {
953
972
  this.price = price;
954
973
  this.memos = memos;
955
974
  this.phase = phase;
975
+ this.context = context;
956
976
  }
957
977
  get serviceRequirement() {
958
978
  var _a;
@@ -1132,7 +1152,8 @@ var AcpClient = class {
1132
1152
  memo.nextPhase
1133
1153
  );
1134
1154
  }),
1135
- data.phase
1155
+ data.phase,
1156
+ data.context
1136
1157
  );
1137
1158
  this.onEvaluate(job);
1138
1159
  }
@@ -1159,7 +1180,8 @@ var AcpClient = class {
1159
1180
  memo.nextPhase
1160
1181
  );
1161
1182
  }),
1162
- data.phase
1183
+ data.phase,
1184
+ data.context
1163
1185
  );
1164
1186
  this.onNewTask(job);
1165
1187
  }
@@ -1305,7 +1327,8 @@ var AcpClient = class {
1305
1327
  memo.nextPhase
1306
1328
  );
1307
1329
  }),
1308
- job.phase
1330
+ job.phase,
1331
+ job.context
1309
1332
  );
1310
1333
  });
1311
1334
  } catch (error) {
@@ -1343,7 +1366,8 @@ var AcpClient = class {
1343
1366
  memo.nextPhase
1344
1367
  );
1345
1368
  }),
1346
- job.phase
1369
+ job.phase,
1370
+ job.context
1347
1371
  );
1348
1372
  });
1349
1373
  } catch (error) {
@@ -1381,7 +1405,8 @@ var AcpClient = class {
1381
1405
  memo.nextPhase
1382
1406
  );
1383
1407
  }),
1384
- job.phase
1408
+ job.phase,
1409
+ job.context
1385
1410
  );
1386
1411
  });
1387
1412
  } catch (error) {
@@ -1422,7 +1447,8 @@ var AcpClient = class {
1422
1447
  memo.nextPhase
1423
1448
  );
1424
1449
  }),
1425
- job.phase
1450
+ job.phase,
1451
+ job.context
1426
1452
  );
1427
1453
  } catch (error) {
1428
1454
  throw error;
@@ -1483,16 +1509,6 @@ var AcpAgentSort = /* @__PURE__ */ ((AcpAgentSort2) => {
1483
1509
  return AcpAgentSort2;
1484
1510
  })(AcpAgentSort || {});
1485
1511
 
1486
- // src/configs.ts
1487
- import { baseSepolia, base } from "@account-kit/infra";
1488
- var baseSepoliaAcpConfig = {
1489
- chain: baseSepolia,
1490
- contractAddress: "0x2422c1c43451Eb69Ff49dfD39c4Dc8C5230fA1e6",
1491
- virtualsTokenAddress: "0xbfAB80ccc15DF6fb7185f9498d6039317331846a",
1492
- alchemyRpcUrl: "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
1493
- acpUrl: "https://acpx-staging.virtuals.io"
1494
- };
1495
-
1496
1512
  // src/index.ts
1497
1513
  var index_default = acpClient_default;
1498
1514
  export {
@@ -1503,6 +1519,7 @@ export {
1503
1519
  AcpJobPhases,
1504
1520
  acpMemo_default as AcpMemo,
1505
1521
  MemoType,
1522
+ baseAcpConfig,
1506
1523
  baseSepoliaAcpConfig,
1507
1524
  index_default as default
1508
1525
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virtuals-protocol/acp-node",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.5",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",