@openserv-labs/client 2.4.4 → 2.4.6

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 +1 @@
1
- {"version":3,"file":"erc8004-api.d.ts","sourceRoot":"","sources":["../src/erc8004-api.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACb,MAAM,SAAS,CAAC;AAKjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAM1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqDG;IACG,MAAM,CACV,MAAM,EAAE,oBAAoB,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GACpD,OAAO,CAAC,YAAY,CAAC;IAsBxB;;;OAGG;YACW,iBAAiB;IAiC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,eAAe,CAAC,MAAM,EAAE;QAC5B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAoUlC;;OAEG;YACW,YAAY;IAyB1B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA8CjC;;;;;;;;;;;;;;;;OAgBG;IACG,cAAc,CAAC,MAAM,EAAE;QAC3B,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,sBAAsB,CAAC;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kUlC;;OAEG;YACW,YAAY;IAyB1B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA8CjC;;;;;;;;;;;;;;;;OAgBG;IACG,cAAc,CAAC,MAAM,EAAE;QAC3B,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAKpC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -227,6 +227,7 @@ class Erc8004API {
227
227
  // Build the full request schema including the x402 envelope
228
228
  // (buyerAddress + payload wrapping the trigger's own input schema)
229
229
  const requestSchema = {
230
+ $schema: "http://json-schema.org/draft-07/schema#",
230
231
  type: "object",
231
232
  required: ["buyerAddress", "payload"],
232
233
  properties: {
@@ -234,10 +235,13 @@ class Erc8004API {
234
235
  type: "string",
235
236
  description: "The buyer's wallet address (e.g. 0x...) for x402 payment",
236
237
  },
237
- payload: t.inputSchema ?? { type: "object" },
238
+ payload: t.inputSchema
239
+ ? Object.fromEntries(Object.entries(t.inputSchema).filter(([key]) => key !== "$schema"))
240
+ : { type: "object" },
238
241
  },
239
242
  };
240
- httpMeta.inputSchema = requestSchema;
243
+ httpMeta.schema = requestSchema;
244
+ httpMeta.method = "POST";
241
245
  services.push({
242
246
  name: "http",
243
247
  endpoint: t.httpEndpoint,
@@ -293,7 +297,7 @@ class Erc8004API {
293
297
  };
294
298
  const agentCardJson = JSON.stringify(agentCard);
295
299
  // 3. Detect first deploy vs re-deploy
296
- const isRedeploy = !!wallet.latestDeploymentTransactionHash;
300
+ const isRedeploy = !!wallet.latestDeploymentTransactionHash || !!wallet.erc8004AgentId;
297
301
  // 4. On-chain setup
298
302
  const contracts = (0, erc8004_contracts_js_1.getErc8004Contracts)(chainId);
299
303
  const chainConfig = (0, erc8004_contracts_js_1.getErc8004Chain)(chainId);
@@ -373,20 +377,10 @@ class Erc8004API {
373
377
  }
374
378
  }
375
379
  }
376
- // 6. Save initial state
377
- await this.deploy({
378
- workflowId,
379
- erc8004AgentId: existingAgentId ?? "",
380
- stringifiedAgentCard: agentCardJson,
381
- ...(wallet.address ? { walletAddress: wallet.address } : {}),
382
- network: "base",
383
- chainId,
384
- rpcUrl,
385
- });
386
- // 7. Upload to IPFS
380
+ // 6. Upload to IPFS
387
381
  const { url: presignedUrl } = await this.presignIpfsUrl({ workflowId });
388
382
  const ipfsCid = await this.uploadToIpfs(agentCardJson, presignedUrl);
389
- // 8. On-chain registration
383
+ // 7. On-chain registration
390
384
  const walletClient = (0, viem_1.createWalletClient)({
391
385
  account,
392
386
  chain: viemChain,
@@ -429,7 +423,7 @@ class Erc8004API {
429
423
  agentId = `${chainId}:${tokenId}`;
430
424
  txHash = registerHash;
431
425
  }
432
- // 9. Save final state
426
+ // 8. Save state
433
427
  await this.deploy({
434
428
  workflowId,
435
429
  erc8004AgentId: agentId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openserv-labs/client",
3
- "version": "2.4.4",
3
+ "version": "2.4.6",
4
4
  "description": "OpenServ Platform Client - Manage agents, workflows, tasks, and triggers via the OpenServ API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",