@lucid-agents/taskmarket 1.30.0 → 1.32.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-E5UZ2QWE.js} +2 -2
  3. package/dist/{channels-BUVR2LSZ.js → channels-347BLVQI.js} +4 -4
  4. package/dist/{chunk-HET5ZDJT.js → chunk-34AFGDDW.js} +13 -1
  5. package/dist/{chunk-RY4U7U45.js → chunk-6WOUTOR4.js} +7365 -4579
  6. package/dist/{chunk-5YR4AZAD.js → chunk-EDZKOEOY.js} +3 -3
  7. package/dist/{chunk-J27HWZ7Y.js → chunk-FJ4EPHIN.js} +1 -1
  8. package/dist/{chunk-E7HXLN2A.js → chunk-NFSTIKPI.js} +2 -2
  9. package/dist/{chunk-CPYULZB3.js → chunk-OUUCDNIE.js} +3 -3
  10. package/dist/{chunk-VE4GYPEZ.js → chunk-OUV2RQSB.js} +1 -1
  11. package/dist/{chunk-MSTGI2YG.js → chunk-QVP3VXGD.js} +1 -1
  12. package/dist/{chunk-S52R3ZY5.js → chunk-R6QEAGHK.js} +1 -1
  13. package/dist/{chunk-CJS2PHFX.js → chunk-TSMFV7XG.js} +3 -3
  14. package/dist/{chunk-QS4JQF6W.js → chunk-XFCZYEKA.js} +5 -5
  15. package/dist/{chunk-6C63PTFL.js → chunk-YSOV3WQK.js} +34 -14
  16. package/dist/{doctor-RYO3E7UL.js → doctor-BCC7R7AE.js} +8 -8
  17. package/dist/index.js +4768 -1268
  18. package/dist/{launch-5NLS7GTY.js → launch-BGOVTUPV.js} +15 -13
  19. package/dist/pi-extensions/xgate.cjs +2537 -85
  20. package/dist/{read-auth-GIBB7BSS.js → read-auth-IBJWXGFC.js} +3 -3
  21. package/dist/{reconcile-YEIABUC6.js → reconcile-CSMSM4OC.js} +4 -4
  22. package/dist/{status-K3CANP2J.js → status-O6GBRFDB.js} +8 -8
  23. package/dist/{sync-pull-JK2V7ZZF.js → sync-pull-765XDDFN.js} +4 -4
  24. package/dist/{task-access-grants-FS7OSOE2.js → task-access-grants-H3RJAJ32.js} +2 -2
  25. package/package.json +1 -1
@@ -15,7 +15,7 @@ import {
15
15
  readMppTempoChallenge,
16
16
  reconcileX402Payment,
17
17
  withX402FileLock
18
- } from "./chunk-VE4GYPEZ.js";
18
+ } from "./chunk-OUV2RQSB.js";
19
19
  import {
20
20
  ApiError,
21
21
  apiGet,
@@ -36,14 +36,14 @@ import {
36
36
  withChainId,
37
37
  withIdempotentWrite,
38
38
  withTapSignature
39
- } from "./chunk-HET5ZDJT.js";
39
+ } from "./chunk-34AFGDDW.js";
40
40
  import {
41
41
  ComputeCreditBuyOutputSchema,
42
42
  ComputeCreditPricingSchema,
43
43
  ComputeCreditStatusOutputSchema,
44
44
  apiErrorEnvelopeOf,
45
45
  getTaskmarketHome
46
- } from "./chunk-RY4U7U45.js";
46
+ } from "./chunk-6WOUTOR4.js";
47
47
 
48
48
  // src/lib/x402-fee.ts
49
49
  import { randomUUID as randomUUID3 } from "crypto";
@@ -22,7 +22,7 @@ import {
22
22
  unresolvedCount,
23
23
  updateSyncState,
24
24
  uploadWorkspace
25
- } from "./chunk-S52R3ZY5.js";
25
+ } from "./chunk-R6QEAGHK.js";
26
26
  import {
27
27
  AgentLaunchError
28
28
  } from "./chunk-YM4S6IE4.js";
@@ -2,12 +2,12 @@ import { createRequire as __tmCreateRequire } from 'node:module'; import { fileU
2
2
  import {
3
3
  createWalletAccountFromKeystore,
4
4
  loadKeystore
5
- } from "./chunk-HET5ZDJT.js";
5
+ } from "./chunk-34AFGDDW.js";
6
6
  import {
7
7
  READ_AUTH_ADDRESS_HEADER,
8
8
  READ_AUTH_SIGNATURE_HEADER,
9
9
  buildReadAuthMessage
10
- } from "./chunk-RY4U7U45.js";
10
+ } from "./chunk-6WOUTOR4.js";
11
11
 
12
12
  // src/lib/read-auth.ts
13
13
  async function signReadAuth() {
@@ -8,7 +8,7 @@ import {
8
8
  unsafeHostPath,
9
9
  withFileLock,
10
10
  writeAtomic
11
- } from "./chunk-S52R3ZY5.js";
11
+ } from "./chunk-R6QEAGHK.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-EDZKOEOY.js";
20
20
  import {
21
21
  getTaskmarketHome
22
- } from "./chunk-RY4U7U45.js";
22
+ } from "./chunk-6WOUTOR4.js";
23
23
  import {
24
24
  AgentLaunchError
25
25
  } from "./chunk-YM4S6IE4.js";
@@ -8,7 +8,7 @@ import {
8
8
  getTaskmarketHome,
9
9
  mppAttributionMemo,
10
10
  parseMppChallenge
11
- } from "./chunk-RY4U7U45.js";
11
+ } from "./chunk-6WOUTOR4.js";
12
12
 
13
13
  // ../../packages/x402-payer/dist/api.js
14
14
  var X402_PAYER_API_VERSION = 1;
@@ -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-6WOUTOR4.js";
6
6
 
7
7
  // src/lib/task-access-grants.ts
8
8
  import { promises as fs } from "fs";
@@ -1,7 +1,7 @@
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
  getTaskmarketHome
4
- } from "./chunk-RY4U7U45.js";
4
+ } from "./chunk-6WOUTOR4.js";
5
5
  import {
6
6
  AgentLaunchError
7
7
  } from "./chunk-YM4S6IE4.js";
@@ -10,16 +10,16 @@ import {
10
10
  listX402Payments,
11
11
  loadX402Policy,
12
12
  rpcUrlForNetwork
13
- } from "./chunk-VE4GYPEZ.js";
13
+ } from "./chunk-OUV2RQSB.js";
14
14
  import {
15
15
  createWalletAccountFromKeystore,
16
16
  keystoreExists,
17
17
  loadKeystore
18
- } from "./chunk-HET5ZDJT.js";
18
+ } from "./chunk-34AFGDDW.js";
19
19
  import {
20
20
  getTaskmarketHome,
21
21
  taskmarketChain
22
- } from "./chunk-RY4U7U45.js";
22
+ } from "./chunk-6WOUTOR4.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-OUUCDNIE.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-R6QEAGHK.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-TSMFV7XG.js";
25
25
  import {
26
26
  apiUrl,
27
27
  selectedNetwork
28
- } from "./chunk-HET5ZDJT.js";
28
+ } from "./chunk-34AFGDDW.js";
29
29
  import {
30
30
  SandboxListOutputSchema
31
- } from "./chunk-RY4U7U45.js";
31
+ } from "./chunk-6WOUTOR4.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-EDZKOEOY.js";
5
5
  import {
6
6
  signReadAuth
7
- } from "./chunk-E7HXLN2A.js";
7
+ } from "./chunk-NFSTIKPI.js";
8
8
  import {
9
9
  taskAccessGrantHeaders
10
- } from "./chunk-MSTGI2YG.js";
10
+ } from "./chunk-QVP3VXGD.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-34AFGDDW.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-6WOUTOR4.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-E5UZ2QWE.js");
114
+ const { signReadAuth: signReadAuth2 } = await import("./read-auth-IBJWXGFC.js");
115
+ const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-H3RJAJ32.js");
114
116
  const taskId = /^\/api\/tasks\/([^/?]+)/.exec(path)?.[1] ?? "";
115
117
  return apiGet2(path, {
116
118
  headers: {
@@ -264,6 +266,7 @@ async function listTasks(ctx, filter = {}) {
264
266
  if (filter.hire !== void 0) params.set("hire", String(filter.hire));
265
267
  if (filter.hireKind) params.set("hireKind", filter.hireKind);
266
268
  if (filter.hireState) params.set("hireState", filter.hireState);
269
+ if (filter.hireTab) params.set("hireTab", filter.hireTab);
267
270
  if (filter.hireServiceId) params.set("hireServiceId", filter.hireServiceId);
268
271
  if (filter.reservedWorker) params.set("reservedWorker", filter.reservedWorker);
269
272
  if (filter.limit) params.set("limit", filter.limit);
@@ -272,7 +275,12 @@ async function listTasks(ctx, filter = {}) {
272
275
  `/api/tasks?${params.toString()}`,
273
276
  await readAuthHeaders(ctx)
274
277
  );
275
- return { tasks: result.tasks, hasMore: result.hasMore, nextCursor: result.nextCursor };
278
+ return {
279
+ tasks: result.tasks,
280
+ hasMore: result.hasMore,
281
+ nextCursor: result.nextCursor,
282
+ ...result.hireTabCounts ? { hireTabCounts: result.hireTabCounts } : {}
283
+ };
276
284
  }
277
285
  async function listTaskSubmissions(ctx, ref, filter = {}) {
278
286
  const headers = await readAuthHeaders(ctx);
@@ -335,15 +343,26 @@ function taskAwardsOf(task) {
335
343
  }
336
344
  async function claimTask(ctx, ref, options = {}) {
337
345
  const signature = await ctx.signer.signMessage(buildClaimMessage(ref.taskId));
338
- const { data, idempotencyKey } = await ctx.transport.post(
346
+ const { data, idempotencyKey } = await ctx.transport.feePost(
339
347
  `/api/tasks/${ref.taskId}/claim`,
340
348
  withChainBody({ workerAddress: ctx.signer.address, signature }, ref.chainId),
341
349
  writeOptions(options.idempotencyKey)
342
350
  );
343
351
  return { claimId: data.claimId, idempotencyKey };
344
352
  }
345
- async function authorizeUploads(ctx, ref) {
346
- return { signature: await ctx.signer.signMessage(buildSubmitMessage(ref.taskId)) };
353
+ var UPLOAD_AUTHORIZATION_REFRESH_SECONDS = 60;
354
+ async function authorizeUploads(ctx, ref, nowMs = Date.now()) {
355
+ const expiresAt = submitUploadExpiresAt(nowMs);
356
+ return {
357
+ signature: await ctx.signer.signMessage(buildSubmitUploadMessage(ref.taskId, expiresAt)),
358
+ expiresAt
359
+ };
360
+ }
361
+ async function freshUploadAuthorization(ctx, ref, current, nowMs = Date.now()) {
362
+ if (current && current.expiresAt - UPLOAD_AUTHORIZATION_REFRESH_SECONDS > Math.floor(nowMs / 1e3)) {
363
+ return current;
364
+ }
365
+ return authorizeUploads(ctx, ref, nowMs);
347
366
  }
348
367
  async function readArtifactFile(file) {
349
368
  const fileName = file.fileName ?? basename(file.path);
@@ -373,6 +392,7 @@ async function requestArtifactUpload(ctx, ref, artifact, authorization) {
373
392
  taskId: ref.taskId,
374
393
  workerAddress: ctx.signer.address,
375
394
  signature: authorization.signature,
395
+ expiresAt: authorization.expiresAt,
376
396
  fileName: artifact.fileName,
377
397
  mimeType: artifact.mimeType,
378
398
  role: artifact.role,
@@ -459,7 +479,7 @@ export {
459
479
  getAgentStats,
460
480
  taskAwardsOf,
461
481
  claimTask,
462
- authorizeUploads,
482
+ freshUploadAuthorization,
463
483
  readArtifactFile,
464
484
  requestArtifactUpload,
465
485
  submitUploadedArtifacts,
@@ -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-XFCZYEKA.js";
5
+ import "./chunk-OUUCDNIE.js";
6
+ import "./chunk-R6QEAGHK.js";
7
+ import "./chunk-EDZKOEOY.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-TSMFV7XG.js";
20
20
  import {
21
21
  getX402PolicyPath,
22
22
  loadX402Policy,
23
23
  rpcUrlForNetwork
24
- } from "./chunk-VE4GYPEZ.js";
24
+ } from "./chunk-OUV2RQSB.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-34AFGDDW.js";
31
+ import "./chunk-6WOUTOR4.js";
32
32
  import "./chunk-YM4S6IE4.js";
33
33
  import {
34
34
  AGENT_VIEW_VERSION