@lucid-agents/taskmarket 1.30.0 → 1.31.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.
Files changed (25) hide show
  1. package/dist/agent-compatibility.json +1 -1
  2. package/dist/{api-JLEPMDTE.js → api-72EG7RDG.js} +2 -2
  3. package/dist/{channels-BUVR2LSZ.js → channels-WVJNWZHJ.js} +4 -4
  4. package/dist/{chunk-VE4GYPEZ.js → chunk-3YNTCMLY.js} +1 -1
  5. package/dist/{chunk-5YR4AZAD.js → chunk-4E4WY6AJ.js} +3 -3
  6. package/dist/{chunk-J27HWZ7Y.js → chunk-7KGKGZLK.js} +1 -1
  7. package/dist/{chunk-E7HXLN2A.js → chunk-AUQJBVNF.js} +2 -2
  8. package/dist/{chunk-HET5ZDJT.js → chunk-GO4PAHB3.js} +13 -1
  9. package/dist/{chunk-S52R3ZY5.js → chunk-JI63EPPO.js} +1 -1
  10. package/dist/{chunk-RY4U7U45.js → chunk-LEQ4JRAS.js} +7247 -4574
  11. package/dist/{chunk-CPYULZB3.js → chunk-PCSHRHUX.js} +3 -3
  12. package/dist/{chunk-QS4JQF6W.js → chunk-PSFCFRC4.js} +5 -5
  13. package/dist/{chunk-6C63PTFL.js → chunk-SJZEU7FN.js} +27 -13
  14. package/dist/{chunk-CJS2PHFX.js → chunk-VIKSHMQ7.js} +3 -3
  15. package/dist/{chunk-MSTGI2YG.js → chunk-VLXBDE22.js} +1 -1
  16. package/dist/{doctor-RYO3E7UL.js → doctor-JP77AWIU.js} +8 -8
  17. package/dist/index.js +4701 -1260
  18. package/dist/{launch-5NLS7GTY.js → launch-DFIZTKMO.js} +15 -13
  19. package/dist/pi-extensions/xgate.cjs +2413 -74
  20. package/dist/{read-auth-GIBB7BSS.js → read-auth-U6CQ2ATH.js} +3 -3
  21. package/dist/{reconcile-YEIABUC6.js → reconcile-TD7RMO4A.js} +4 -4
  22. package/dist/{status-K3CANP2J.js → status-P3NIGGYJ.js} +8 -8
  23. package/dist/{sync-pull-JK2V7ZZF.js → sync-pull-TH3U6DPI.js} +4 -4
  24. package/dist/{task-access-grants-FS7OSOE2.js → task-access-grants-4GVGJEKT.js} +2 -2
  25. package/package.json +2 -2
@@ -8,7 +8,7 @@ import {
8
8
  unsafeHostPath,
9
9
  withFileLock,
10
10
  writeAtomic
11
- } from "./chunk-S52R3ZY5.js";
11
+ } from "./chunk-JI63EPPO.js";
12
12
  import {
13
13
  buyComputeCredit,
14
14
  fetchComputePricing,
@@ -16,10 +16,10 @@ import {
16
16
  loadComputeCreditConfig,
17
17
  onComputeBalanceObserved,
18
18
  readComputeCreditStatus
19
- } from "./chunk-5YR4AZAD.js";
19
+ } from "./chunk-4E4WY6AJ.js";
20
20
  import {
21
21
  getTaskmarketHome
22
- } from "./chunk-RY4U7U45.js";
22
+ } from "./chunk-LEQ4JRAS.js";
23
23
  import {
24
24
  AgentLaunchError
25
25
  } from "./chunk-YM4S6IE4.js";
@@ -6,14 +6,14 @@ import {
6
6
  loadDeliverableRecord,
7
7
  readComputeView,
8
8
  taskStage
9
- } from "./chunk-CPYULZB3.js";
9
+ } from "./chunk-PCSHRHUX.js";
10
10
  import {
11
11
  activeClaim,
12
12
  captureProblem,
13
13
  killedSession,
14
14
  loadSyncState,
15
15
  orphanOf
16
- } from "./chunk-S52R3ZY5.js";
16
+ } from "./chunk-JI63EPPO.js";
17
17
  import {
18
18
  allocationViews,
19
19
  channelView,
@@ -21,14 +21,14 @@ import {
21
21
  openAgentChannels,
22
22
  uncertainPurchases,
23
23
  withdrawalHatch
24
- } from "./chunk-CJS2PHFX.js";
24
+ } from "./chunk-VIKSHMQ7.js";
25
25
  import {
26
26
  apiUrl,
27
27
  selectedNetwork
28
- } from "./chunk-HET5ZDJT.js";
28
+ } from "./chunk-GO4PAHB3.js";
29
29
  import {
30
30
  SandboxListOutputSchema
31
- } from "./chunk-RY4U7U45.js";
31
+ } from "./chunk-LEQ4JRAS.js";
32
32
  import {
33
33
  AgentLaunchError
34
34
  } from "./chunk-YM4S6IE4.js";
@@ -1,13 +1,13 @@
1
1
  import { createRequire as __tmCreateRequire } from 'node:module'; import { fileURLToPath as __tmFileURLToPath } from 'node:url'; import { dirname as __tmDirname } from 'node:path'; const require = __tmCreateRequire(import.meta.url); const __tmFilename = __tmFileURLToPath(import.meta.url); const __tmDirnameValue = __tmDirname(__tmFilename);
2
2
  import {
3
3
  x402FeePost
4
- } from "./chunk-5YR4AZAD.js";
4
+ } from "./chunk-4E4WY6AJ.js";
5
5
  import {
6
6
  signReadAuth
7
- } from "./chunk-E7HXLN2A.js";
7
+ } from "./chunk-AUQJBVNF.js";
8
8
  import {
9
9
  taskAccessGrantHeaders
10
- } from "./chunk-MSTGI2YG.js";
10
+ } from "./chunk-VLXBDE22.js";
11
11
  import {
12
12
  apiGet,
13
13
  apiPost,
@@ -15,13 +15,15 @@ import {
15
15
  runWorkerAction,
16
16
  signMessage,
17
17
  taskRequiresTap
18
- } from "./chunk-HET5ZDJT.js";
18
+ } from "./chunk-GO4PAHB3.js";
19
19
  import {
20
20
  TaskAwardSchema,
21
21
  buildClaimMessage,
22
22
  buildSubmitMessage,
23
- isRecordingPendingResponse
24
- } from "./chunk-RY4U7U45.js";
23
+ buildSubmitUploadMessage,
24
+ isRecordingPendingResponse,
25
+ submitUploadExpiresAt
26
+ } from "./chunk-LEQ4JRAS.js";
25
27
 
26
28
  // src/sdk/artifact-upload.ts
27
29
  import { extname } from "path";
@@ -108,9 +110,9 @@ function putArtifactBytes(uploadUrl, data, mimeType, onProgress) {
108
110
  // src/lib/worker-attestation.ts
109
111
  var requirementCache = /* @__PURE__ */ new Map();
110
112
  async function defaultGet(path) {
111
- const { apiGet: apiGet2 } = await import("./api-JLEPMDTE.js");
112
- const { signReadAuth: signReadAuth2 } = await import("./read-auth-GIBB7BSS.js");
113
- const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-FS7OSOE2.js");
113
+ const { apiGet: apiGet2 } = await import("./api-72EG7RDG.js");
114
+ const { signReadAuth: signReadAuth2 } = await import("./read-auth-U6CQ2ATH.js");
115
+ const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-4GVGJEKT.js");
114
116
  const taskId = /^\/api\/tasks\/([^/?]+)/.exec(path)?.[1] ?? "";
115
117
  return apiGet2(path, {
116
118
  headers: {
@@ -335,15 +337,26 @@ function taskAwardsOf(task) {
335
337
  }
336
338
  async function claimTask(ctx, ref, options = {}) {
337
339
  const signature = await ctx.signer.signMessage(buildClaimMessage(ref.taskId));
338
- const { data, idempotencyKey } = await ctx.transport.post(
340
+ const { data, idempotencyKey } = await ctx.transport.feePost(
339
341
  `/api/tasks/${ref.taskId}/claim`,
340
342
  withChainBody({ workerAddress: ctx.signer.address, signature }, ref.chainId),
341
343
  writeOptions(options.idempotencyKey)
342
344
  );
343
345
  return { claimId: data.claimId, idempotencyKey };
344
346
  }
345
- async function authorizeUploads(ctx, ref) {
346
- return { signature: await ctx.signer.signMessage(buildSubmitMessage(ref.taskId)) };
347
+ var UPLOAD_AUTHORIZATION_REFRESH_SECONDS = 60;
348
+ async function authorizeUploads(ctx, ref, nowMs = Date.now()) {
349
+ const expiresAt = submitUploadExpiresAt(nowMs);
350
+ return {
351
+ signature: await ctx.signer.signMessage(buildSubmitUploadMessage(ref.taskId, expiresAt)),
352
+ expiresAt
353
+ };
354
+ }
355
+ async function freshUploadAuthorization(ctx, ref, current, nowMs = Date.now()) {
356
+ if (current && current.expiresAt - UPLOAD_AUTHORIZATION_REFRESH_SECONDS > Math.floor(nowMs / 1e3)) {
357
+ return current;
358
+ }
359
+ return authorizeUploads(ctx, ref, nowMs);
347
360
  }
348
361
  async function readArtifactFile(file) {
349
362
  const fileName = file.fileName ?? basename(file.path);
@@ -373,6 +386,7 @@ async function requestArtifactUpload(ctx, ref, artifact, authorization) {
373
386
  taskId: ref.taskId,
374
387
  workerAddress: ctx.signer.address,
375
388
  signature: authorization.signature,
389
+ expiresAt: authorization.expiresAt,
376
390
  fileName: artifact.fileName,
377
391
  mimeType: artifact.mimeType,
378
392
  role: artifact.role,
@@ -459,7 +473,7 @@ export {
459
473
  getAgentStats,
460
474
  taskAwardsOf,
461
475
  claimTask,
462
- authorizeUploads,
476
+ freshUploadAuthorization,
463
477
  readArtifactFile,
464
478
  requestArtifactUpload,
465
479
  submitUploadedArtifacts,
@@ -10,16 +10,16 @@ import {
10
10
  listX402Payments,
11
11
  loadX402Policy,
12
12
  rpcUrlForNetwork
13
- } from "./chunk-VE4GYPEZ.js";
13
+ } from "./chunk-3YNTCMLY.js";
14
14
  import {
15
15
  createWalletAccountFromKeystore,
16
16
  keystoreExists,
17
17
  loadKeystore
18
- } from "./chunk-HET5ZDJT.js";
18
+ } from "./chunk-GO4PAHB3.js";
19
19
  import {
20
20
  getTaskmarketHome,
21
21
  taskmarketChain
22
- } from "./chunk-RY4U7U45.js";
22
+ } from "./chunk-LEQ4JRAS.js";
23
23
  import {
24
24
  AgentLaunchError
25
25
  } from "./chunk-YM4S6IE4.js";
@@ -2,7 +2,7 @@ import { createRequire as __tmCreateRequire } from 'node:module'; import { fileU
2
2
  import {
3
3
  TASK_ACCESS_GRANT_HEADER,
4
4
  getTaskmarketHome
5
- } from "./chunk-RY4U7U45.js";
5
+ } from "./chunk-LEQ4JRAS.js";
6
6
 
7
7
  // src/lib/task-access-grants.ts
8
8
  import { promises as fs } from "fs";
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __tmCreateRequire } from 'node:module'; import { fileURLToPath as __tmFileURLToPath } from 'node:url'; import { dirname as __tmDirname } from 'node:path'; const require = __tmCreateRequire(import.meta.url); const __tmFilename = __tmFileURLToPath(import.meta.url); const __tmDirnameValue = __tmDirname(__tmFilename);
2
2
  import {
3
3
  listSandboxes
4
- } from "./chunk-QS4JQF6W.js";
5
- import "./chunk-CPYULZB3.js";
6
- import "./chunk-S52R3ZY5.js";
7
- import "./chunk-5YR4AZAD.js";
4
+ } from "./chunk-PSFCFRC4.js";
5
+ import "./chunk-PCSHRHUX.js";
6
+ import "./chunk-JI63EPPO.js";
7
+ import "./chunk-4E4WY6AJ.js";
8
8
  import {
9
9
  AGENT_COMPATIBILITY,
10
10
  assertAgentCompatibility,
@@ -16,19 +16,19 @@ import {
16
16
  loadAgentPolicy,
17
17
  openAgentChannels,
18
18
  railChainIdHex
19
- } from "./chunk-CJS2PHFX.js";
19
+ } from "./chunk-VIKSHMQ7.js";
20
20
  import {
21
21
  getX402PolicyPath,
22
22
  loadX402Policy,
23
23
  rpcUrlForNetwork
24
- } from "./chunk-VE4GYPEZ.js";
24
+ } from "./chunk-3YNTCMLY.js";
25
25
  import {
26
26
  apiUrl,
27
27
  keystoreExists,
28
28
  loadKeystore,
29
29
  withChainId
30
- } from "./chunk-HET5ZDJT.js";
31
- import "./chunk-RY4U7U45.js";
30
+ } from "./chunk-GO4PAHB3.js";
31
+ import "./chunk-LEQ4JRAS.js";
32
32
  import "./chunk-YM4S6IE4.js";
33
33
  import {
34
34
  AGENT_VIEW_VERSION