@t2000/cli 10.30.3 → 10.30.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.js CHANGED
@@ -30548,7 +30548,7 @@ init_coinSelection();
30548
30548
  init_errors();
30549
30549
  init_token_registry();
30550
30550
  init_coinSelection();
30551
- var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x83f02c59575b7daa4576eeccc22542f8a5679520e4edd02feeeee2daae16b819";
30551
+ var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0xc84fc8a6d7e8766e36abb16acf5f0c0d15444797137274bbbe027ac7972c56a7";
30552
30552
  var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
30553
30553
  var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
30554
30554
  var MAINNET_A2A_ESCROW_PACKAGE_ID = "0x358a819c1c016e2cc84ef5fbea81cba90c31f7f8a62bf45cb5e5276acf198bdd";
@@ -36176,7 +36176,7 @@ function resolveCreated(digest, marker) {
36176
36176
  return resolveCreatedObjectId(getSuiClient(), digest, marker);
36177
36177
  }
36178
36178
  function registerOpenVerbs(group) {
36179
- group.command("open").description("Open \u2014 post the job to the public board with no ASP picked (buyer); ESCROWS the budget on-chain now, first claim starts work").requiredOption("--title <text>", "The job's public name (up to 80 chars)").requiredOption("--brief <file-or-text>", "What you want delivered \u2014 PUBLIC, every ASP on the board reads it").requiredOption("--max <usdc>", `Budget escrowed AT POST (max ${MAX_JOB_USDC})`).option("--sla <duration>", "Delivery window once claimed (e.g. 30m, 24h, 7d)", "24h").option("--open-for <duration>", "How long the posting stays claimable before it refunds", "24h").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE6})`).action(
36179
+ group.command("open").description("Open \u2014 post the job to the public board with no ASP picked (buyer); ESCROWS the budget on-chain now, first claim starts work. Reject on open work returns 100% to you (contract-locked) \u2014 junk delivery earns the seller nothing.").requiredOption("--title <text>", "The job's public name (up to 80 chars)").requiredOption("--brief <file-or-text>", "What you want delivered \u2014 PUBLIC, every ASP on the board reads it").requiredOption("--max <usdc>", `Budget escrowed AT POST (max ${MAX_JOB_USDC})`).option("--sla <duration>", "Delivery window once claimed (e.g. 30m, 24h, 7d)", "24h").option("--open-for <duration>", "How long the posting stays claimable before it refunds", "24h").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE6})`).action(
36180
36180
  async (opts) => {
36181
36181
  try {
36182
36182
  const base = opts.api ?? DEFAULT_API_BASE6;
@@ -36361,12 +36361,29 @@ async function loadSpecText(input) {
36361
36361
  }
36362
36362
  return { kind: "text", text };
36363
36363
  }
36364
+ async function putAndVerifySpec(base, content) {
36365
+ const hash = await putJobSpec(base, content);
36366
+ let roundTrip;
36367
+ try {
36368
+ roundTrip = await getJobSpec(base, hash);
36369
+ } catch (e) {
36370
+ throw new Error(
36371
+ `The content store accepted the upload but could not serve it back (${e instanceof Error ? e.message : "read failed"}) \u2014 nothing was pinned on-chain. Retry in a moment.`
36372
+ );
36373
+ }
36374
+ if (roundTrip !== content) {
36375
+ throw new Error(
36376
+ "The content store returned different bytes than were uploaded \u2014 nothing was pinned on-chain. Retry in a moment."
36377
+ );
36378
+ }
36379
+ return hash;
36380
+ }
36364
36381
  async function resolveSpecUpload(base, input) {
36365
36382
  const loaded = await loadSpecText(input);
36366
36383
  if (loaded.kind === "hash") {
36367
36384
  return { hash: loaded.hash, uploaded: false };
36368
36385
  }
36369
- return { hash: `0x${await putJobSpec(base, loaded.text)}`, uploaded: true };
36386
+ return { hash: `0x${await putAndVerifySpec(base, loaded.text)}`, uploaded: true };
36370
36387
  }
36371
36388
  async function resolveHireSpecUpload(base, input, title) {
36372
36389
  const loaded = await loadSpecText(input);
@@ -36379,7 +36396,7 @@ async function resolveHireSpecUpload(base, input, title) {
36379
36396
  "The brief plus its envelope exceeds the 16 KiB job-spec store cap \u2014 shorten the brief, or link the long artifact (URL / IPFS)."
36380
36397
  );
36381
36398
  }
36382
- return { hash: `0x${await putJobSpec(base, body2)}`, uploaded: true };
36399
+ return { hash: `0x${await putAndVerifySpec(base, body2)}`, uploaded: true };
36383
36400
  }
36384
36401
  function stateColor(state) {
36385
36402
  if (state === "released") return import_picocolors13.default.green(state);
@@ -36680,7 +36697,7 @@ no fund step; unclaimed openings refund fee-free):
36680
36697
  buyer,
36681
36698
  createdAtMs: Date.now()
36682
36699
  });
36683
- specHash = `0x${await putJobSpec(base, spec)}`;
36700
+ specHash = `0x${await putAndVerifySpec(base, spec)}`;
36684
36701
  amountUsdc = service.priceUsdc;
36685
36702
  seller = service.agent;
36686
36703
  deliverByMs = Date.now() + service.slaMinutes * 6e4;