@lucid-agents/taskmarket 1.32.1 → 1.34.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-TEZH6URZ.js → api-R76D244Y.js} +2 -2
  3. package/dist/{channels-ZNOTOJIS.js → channels-SVCU2MU5.js} +4 -4
  4. package/dist/{chunk-62QDQXS3.js → chunk-45GK5BHD.js} +8 -8
  5. package/dist/{chunk-CH3OZ5EM.js → chunk-54OR2JDT.js} +10 -6
  6. package/dist/{chunk-R6QEAGHK.js → chunk-B7W4G3EY.js} +1 -1
  7. package/dist/{chunk-FJ4EPHIN.js → chunk-BDKM5JMT.js} +1 -1
  8. package/dist/{chunk-QVP3VXGD.js → chunk-CHX7O7EU.js} +1 -1
  9. package/dist/{chunk-KC32V4AD.js → chunk-G3U2BQNC.js} +27 -5
  10. package/dist/{chunk-LT4DDAEZ.js → chunk-JRWRBSS2.js} +3 -3
  11. package/dist/{chunk-PSN4GDLD.js → chunk-KHDQRFHG.js} +5 -5
  12. package/dist/{chunk-6WOUTOR4.js → chunk-QAGDCIMU.js} +1692 -1518
  13. package/dist/{chunk-SPG5J4RN.js → chunk-WP7GXSKE.js} +3 -3
  14. package/dist/{chunk-CWANOJKR.js → chunk-YGSVDU2D.js} +3 -3
  15. package/dist/{chunk-OUV2RQSB.js → chunk-YHVP2UNE.js} +1 -1
  16. package/dist/{doctor-5KU2FAWD.js → doctor-IIVQFDIB.js} +8 -8
  17. package/dist/index.js +840 -251
  18. package/dist/{launch-RFRQPJAY.js → launch-INDP2HH3.js} +11 -11
  19. package/dist/pi-extensions/xgate.cjs +2946 -2801
  20. package/dist/{read-auth-PQ7DGWZC.js → read-auth-AGP3CUMT.js} +3 -3
  21. package/dist/{reconcile-ZTCPP3G5.js → reconcile-H3JIKN2X.js} +4 -4
  22. package/dist/{status-CDPRDSYZ.js → status-SARVECVT.js} +8 -8
  23. package/dist/{sync-pull-R7EBZKUG.js → sync-pull-IUPV57MU.js} +4 -4
  24. package/dist/{task-access-grants-H3RJAJ32.js → task-access-grants-HALV3NEO.js} +2 -2
  25. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
1
  {
2
- "taskmarket": "1.32.1",
2
+ "taskmarket": "1.34.0",
3
3
  "manifestVersion": 1,
4
4
  "pi": {
5
5
  "package": "@earendil-works/pi-coding-agent",
@@ -14,8 +14,8 @@ import {
14
14
  parseFailureBody,
15
15
  readFailureBody,
16
16
  withErrorContext
17
- } from "./chunk-KC32V4AD.js";
18
- import "./chunk-6WOUTOR4.js";
17
+ } from "./chunk-G3U2BQNC.js";
18
+ import "./chunk-QAGDCIMU.js";
19
19
  import "./chunk-S7SJMJ2I.js";
20
20
  export {
21
21
  ApiError,
@@ -10,10 +10,10 @@ import {
10
10
  selectRail,
11
11
  uncertainPurchases,
12
12
  withdrawalHatch
13
- } from "./chunk-CWANOJKR.js";
14
- import "./chunk-OUV2RQSB.js";
15
- import "./chunk-KC32V4AD.js";
16
- import "./chunk-6WOUTOR4.js";
13
+ } from "./chunk-YGSVDU2D.js";
14
+ import "./chunk-YHVP2UNE.js";
15
+ import "./chunk-G3U2BQNC.js";
16
+ import "./chunk-QAGDCIMU.js";
17
17
  import "./chunk-YM4S6IE4.js";
18
18
  import "./chunk-XJOB4NMV.js";
19
19
  import "./chunk-S7SJMJ2I.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-LT4DDAEZ.js";
4
+ } from "./chunk-JRWRBSS2.js";
5
5
  import {
6
6
  signReadAuth
7
- } from "./chunk-CH3OZ5EM.js";
7
+ } from "./chunk-54OR2JDT.js";
8
8
  import {
9
9
  taskAccessGrantHeaders
10
- } from "./chunk-QVP3VXGD.js";
10
+ } from "./chunk-CHX7O7EU.js";
11
11
  import {
12
12
  apiGet,
13
13
  apiPost,
@@ -15,7 +15,7 @@ import {
15
15
  runWorkerAction,
16
16
  signMessage,
17
17
  taskRequiresTap
18
- } from "./chunk-KC32V4AD.js";
18
+ } from "./chunk-G3U2BQNC.js";
19
19
  import {
20
20
  TaskAwardSchema,
21
21
  buildClaimMessage,
@@ -23,7 +23,7 @@ import {
23
23
  buildSubmitUploadMessage,
24
24
  isRecordingPendingResponse,
25
25
  submitUploadExpiresAt
26
- } from "./chunk-6WOUTOR4.js";
26
+ } from "./chunk-QAGDCIMU.js";
27
27
 
28
28
  // src/sdk/artifact-upload.ts
29
29
  import { extname } from "path";
@@ -110,9 +110,9 @@ function putArtifactBytes(uploadUrl, data, mimeType, onProgress) {
110
110
  // src/lib/worker-attestation.ts
111
111
  var requirementCache = /* @__PURE__ */ new Map();
112
112
  async function defaultGet(path) {
113
- const { apiGet: apiGet2 } = await import("./api-TEZH6URZ.js");
114
- const { signReadAuth: signReadAuth2 } = await import("./read-auth-PQ7DGWZC.js");
115
- const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-H3RJAJ32.js");
113
+ const { apiGet: apiGet2 } = await import("./api-R76D244Y.js");
114
+ const { signReadAuth: signReadAuth2 } = await import("./read-auth-AGP3CUMT.js");
115
+ const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-HALV3NEO.js");
116
116
  const taskId = /^\/api\/tasks\/([^/?]+)/.exec(path)?.[1] ?? "";
117
117
  return apiGet2(path, {
118
118
  headers: {
@@ -2,15 +2,15 @@ import { createRequire as __tmCreateRequire } from 'node:module'; import { fileU
2
2
  import {
3
3
  createWalletAccountFromKeystore,
4
4
  loadKeystore
5
- } from "./chunk-KC32V4AD.js";
5
+ } from "./chunk-G3U2BQNC.js";
6
6
  import {
7
7
  READ_AUTH_ADDRESS_HEADER,
8
8
  READ_AUTH_SIGNATURE_HEADER,
9
9
  buildReadAuthMessage
10
- } from "./chunk-6WOUTOR4.js";
10
+ } from "./chunk-QAGDCIMU.js";
11
11
 
12
12
  // src/lib/read-auth.ts
13
- async function signReadAuth() {
13
+ async function signReadAuth(signal) {
14
14
  let keystore;
15
15
  try {
16
16
  keystore = await loadKeystore();
@@ -18,7 +18,7 @@ async function signReadAuth() {
18
18
  return null;
19
19
  }
20
20
  try {
21
- const account = await createWalletAccountFromKeystore(keystore);
21
+ const account = await createWalletAccountFromKeystore(keystore, signal);
22
22
  const signature = await account.signMessage({
23
23
  message: buildReadAuthMessage(keystore.walletAddress)
24
24
  });
@@ -29,8 +29,12 @@ async function signReadAuth() {
29
29
  [READ_AUTH_SIGNATURE_HEADER]: signature
30
30
  }
31
31
  };
32
- } catch {
33
- return { walletAddress: keystore.walletAddress, headers: {} };
32
+ } catch (error) {
33
+ return {
34
+ walletAddress: keystore.walletAddress,
35
+ headers: {},
36
+ error: error instanceof Error ? error.message : String(error)
37
+ };
34
38
  }
35
39
  }
36
40
 
@@ -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-6WOUTOR4.js";
4
+ } from "./chunk-QAGDCIMU.js";
5
5
  import {
6
6
  AgentLaunchError
7
7
  } from "./chunk-YM4S6IE4.js";
@@ -22,7 +22,7 @@ import {
22
22
  unresolvedCount,
23
23
  updateSyncState,
24
24
  uploadWorkspace
25
- } from "./chunk-R6QEAGHK.js";
25
+ } from "./chunk-B7W4G3EY.js";
26
26
  import {
27
27
  AgentLaunchError
28
28
  } 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-6WOUTOR4.js";
5
+ } from "./chunk-QAGDCIMU.js";
6
6
 
7
7
  // src/lib/task-access-grants.ts
8
8
  import { promises as fs } from "fs";
@@ -9,7 +9,7 @@ import {
9
9
  paymentProtocolFor,
10
10
  taskmarketChain,
11
11
  verifierProviderId
12
- } from "./chunk-6WOUTOR4.js";
12
+ } from "./chunk-QAGDCIMU.js";
13
13
 
14
14
  // src/lib/idempotency.ts
15
15
  import { randomUUID } from "crypto";
@@ -121,6 +121,21 @@ async function loadKeystore(keystorePath) {
121
121
  }
122
122
  return JSON.parse(data);
123
123
  }
124
+ async function keystoreLoadFailure(keystorePath) {
125
+ const p = keystorePath ?? getKeystorePath();
126
+ try {
127
+ await fs.lstat(p);
128
+ } catch (error) {
129
+ if (error.code === "ENOENT") return null;
130
+ return error.message;
131
+ }
132
+ try {
133
+ JSON.parse(await fs.readFile(p, "utf8"));
134
+ } catch (error) {
135
+ return error.message;
136
+ }
137
+ return "it could not be loaded";
138
+ }
124
139
  async function keystoreExists(keystorePath) {
125
140
  const p = keystorePath ?? getKeystorePath();
126
141
  try {
@@ -324,12 +339,13 @@ import {
324
339
 
325
340
  // src/lib/signer.ts
326
341
  import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
327
- async function fetchDeviceKey(deviceId, apiToken, keyServerUrl) {
342
+ async function fetchDeviceKey(deviceId, apiToken, keyServerUrl, signal) {
328
343
  const base = keyServerUrl ?? apiUrl();
329
344
  const res = await fetch(`${base}/api/devices/${deviceId}/key`, {
330
345
  method: "POST",
331
346
  headers: { "Content-Type": "application/json" },
332
- body: JSON.stringify({ deviceId, apiToken })
347
+ body: JSON.stringify({ deviceId, apiToken }),
348
+ signal
333
349
  });
334
350
  if (!res.ok) {
335
351
  const text = await res.text().catch(() => "");
@@ -348,8 +364,13 @@ async function signMessage(message, keystore) {
348
364
  const sig = await account.signMessage({ message });
349
365
  return sig;
350
366
  }
351
- async function createWalletAccountFromKeystore(keystore) {
352
- const dek = await fetchDeviceKey(keystore.deviceId, keystore.apiToken, keystore.keyServerUrl);
367
+ async function createWalletAccountFromKeystore(keystore, signal) {
368
+ const dek = await fetchDeviceKey(
369
+ keystore.deviceId,
370
+ keystore.apiToken,
371
+ keystore.keyServerUrl,
372
+ signal
373
+ );
353
374
  const privateKey = decryptPrivateKey(dek, keystore.encryptedKey);
354
375
  return privateKeyToAccount2(privateKey);
355
376
  }
@@ -885,6 +906,7 @@ export {
885
906
  KeystoreExistsError,
886
907
  createKeystore,
887
908
  loadKeystore,
909
+ keystoreLoadFailure,
888
910
  keystoreExists,
889
911
  readKeystoreNetwork,
890
912
  idempotencyKeyForError,
@@ -15,7 +15,7 @@ import {
15
15
  readMppTempoChallenge,
16
16
  reconcileX402Payment,
17
17
  withX402FileLock
18
- } from "./chunk-OUV2RQSB.js";
18
+ } from "./chunk-YHVP2UNE.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-KC32V4AD.js";
39
+ } from "./chunk-G3U2BQNC.js";
40
40
  import {
41
41
  ComputeCreditBuyOutputSchema,
42
42
  ComputeCreditPricingSchema,
43
43
  ComputeCreditStatusOutputSchema,
44
44
  apiErrorEnvelopeOf,
45
45
  getTaskmarketHome
46
- } from "./chunk-6WOUTOR4.js";
46
+ } from "./chunk-QAGDCIMU.js";
47
47
 
48
48
  // src/lib/x402-fee.ts
49
49
  import { randomUUID as randomUUID3 } from "crypto";
@@ -6,14 +6,14 @@ import {
6
6
  loadDeliverableRecord,
7
7
  readComputeView,
8
8
  taskStage
9
- } from "./chunk-SPG5J4RN.js";
9
+ } from "./chunk-WP7GXSKE.js";
10
10
  import {
11
11
  activeClaim,
12
12
  captureProblem,
13
13
  killedSession,
14
14
  loadSyncState,
15
15
  orphanOf
16
- } from "./chunk-R6QEAGHK.js";
16
+ } from "./chunk-B7W4G3EY.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-CWANOJKR.js";
24
+ } from "./chunk-YGSVDU2D.js";
25
25
  import {
26
26
  apiUrl,
27
27
  selectedNetwork
28
- } from "./chunk-KC32V4AD.js";
28
+ } from "./chunk-G3U2BQNC.js";
29
29
  import {
30
30
  SandboxListOutputSchema
31
- } from "./chunk-6WOUTOR4.js";
31
+ } from "./chunk-QAGDCIMU.js";
32
32
  import {
33
33
  AgentLaunchError
34
34
  } from "./chunk-YM4S6IE4.js";