@lucid-agents/taskmarket 1.33.0 → 1.35.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.
- package/dist/agent-compatibility.json +1 -1
- package/dist/{api-J7LB2GAY.js → api-R76D244Y.js} +2 -2
- package/dist/{channels-XY4SSEBG.js → channels-SVCU2MU5.js} +4 -4
- package/dist/{chunk-ACKPSLIR.js → chunk-54OR2JDT.js} +10 -6
- package/dist/{chunk-BESAWMVS.js → chunk-B7W4G3EY.js} +1 -1
- package/dist/{chunk-ALTIKIGD.js → chunk-BDKM5JMT.js} +1 -1
- package/dist/{chunk-YUYW5N4U.js → chunk-CHX7O7EU.js} +1 -1
- package/dist/{chunk-QUIWYQZL.js → chunk-G3U2BQNC.js} +27 -5
- package/dist/{chunk-WVHSHZBK.js → chunk-JRWRBSS2.js} +3 -3
- package/dist/{chunk-VW7I7J5Q.js → chunk-KHDQRFHG.js} +5 -5
- package/dist/{chunk-KGU3CSYK.js → chunk-L6D2CDVQ.js} +14 -9
- package/dist/{chunk-TZH4XU62.js → chunk-QAGDCIMU.js} +1690 -1518
- package/dist/{chunk-E7HZKIUP.js → chunk-WP7GXSKE.js} +3 -3
- package/dist/{chunk-JZ3SUHWV.js → chunk-YGSVDU2D.js} +3 -3
- package/dist/{chunk-QQ4PHAPV.js → chunk-YHVP2UNE.js} +1 -1
- package/dist/{doctor-LHFMQ737.js → doctor-IIVQFDIB.js} +8 -8
- package/dist/index.js +851 -199
- package/dist/{launch-B2KFGY2L.js → launch-OC4LIPSS.js} +11 -11
- package/dist/pi-extensions/xgate.cjs +2944 -2801
- package/dist/{read-auth-P2WTHPWW.js → read-auth-AGP3CUMT.js} +3 -3
- package/dist/{reconcile-7AIMC4P3.js → reconcile-H3JIKN2X.js} +4 -4
- package/dist/{status-6EYEBSQ6.js → status-SARVECVT.js} +8 -8
- package/dist/{sync-pull-XSIEQDGD.js → sync-pull-IUPV57MU.js} +4 -4
- package/dist/{task-access-grants-Z32WK3FJ.js → task-access-grants-HALV3NEO.js} +2 -2
- package/package.json +3 -3
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
parseFailureBody,
|
|
15
15
|
readFailureBody,
|
|
16
16
|
withErrorContext
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
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-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
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";
|
|
@@ -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-
|
|
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-
|
|
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 {
|
|
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-
|
|
4
|
+
} from "./chunk-QAGDCIMU.js";
|
|
5
5
|
import {
|
|
6
6
|
AgentLaunchError
|
|
7
7
|
} 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-
|
|
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-
|
|
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(
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
24
|
+
} from "./chunk-YGSVDU2D.js";
|
|
25
25
|
import {
|
|
26
26
|
apiUrl,
|
|
27
27
|
selectedNetwork
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-G3U2BQNC.js";
|
|
29
29
|
import {
|
|
30
30
|
SandboxListOutputSchema
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-QAGDCIMU.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-
|
|
4
|
+
} from "./chunk-JRWRBSS2.js";
|
|
5
5
|
import {
|
|
6
6
|
signReadAuth
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-54OR2JDT.js";
|
|
8
8
|
import {
|
|
9
9
|
taskAccessGrantHeaders
|
|
10
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
26
|
+
} from "./chunk-QAGDCIMU.js";
|
|
27
27
|
|
|
28
28
|
// src/sdk/artifact-upload.ts
|
|
29
29
|
import { extname } from "path";
|
|
@@ -65,7 +65,8 @@ function mimeTypeForPath(filePath) {
|
|
|
65
65
|
return "application/octet-stream";
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
var UPLOAD_IDLE_TIMEOUT_MS = 12e4;
|
|
69
|
+
function putArtifactBytes(uploadUrl, data, mimeType, onProgress, idleTimeoutMs = UPLOAD_IDLE_TIMEOUT_MS) {
|
|
69
70
|
return new Promise((resolve, reject) => {
|
|
70
71
|
const url = new URL(uploadUrl);
|
|
71
72
|
const transport = url.protocol === "https:" ? https : http;
|
|
@@ -73,6 +74,7 @@ function putArtifactBytes(uploadUrl, data, mimeType, onProgress) {
|
|
|
73
74
|
url,
|
|
74
75
|
{
|
|
75
76
|
method: "PUT",
|
|
77
|
+
timeout: idleTimeoutMs,
|
|
76
78
|
headers: {
|
|
77
79
|
"Content-Type": mimeType,
|
|
78
80
|
"Content-Length": String(data.length)
|
|
@@ -96,6 +98,9 @@ function putArtifactBytes(uploadUrl, data, mimeType, onProgress) {
|
|
|
96
98
|
}
|
|
97
99
|
);
|
|
98
100
|
req.on("error", reject);
|
|
101
|
+
req.on("timeout", () => {
|
|
102
|
+
req.destroy(new Error(`Upload timed out after ${idleTimeoutMs}ms with no activity`));
|
|
103
|
+
});
|
|
99
104
|
let uploaded = 0;
|
|
100
105
|
const stream = Readable.from([data]);
|
|
101
106
|
stream.on("data", (chunk) => {
|
|
@@ -110,9 +115,9 @@ function putArtifactBytes(uploadUrl, data, mimeType, onProgress) {
|
|
|
110
115
|
// src/lib/worker-attestation.ts
|
|
111
116
|
var requirementCache = /* @__PURE__ */ new Map();
|
|
112
117
|
async function defaultGet(path) {
|
|
113
|
-
const { apiGet: apiGet2 } = await import("./api-
|
|
114
|
-
const { signReadAuth: signReadAuth2 } = await import("./read-auth-
|
|
115
|
-
const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-
|
|
118
|
+
const { apiGet: apiGet2 } = await import("./api-R76D244Y.js");
|
|
119
|
+
const { signReadAuth: signReadAuth2 } = await import("./read-auth-AGP3CUMT.js");
|
|
120
|
+
const { taskAccessGrantHeaders: taskAccessGrantHeaders2 } = await import("./task-access-grants-HALV3NEO.js");
|
|
116
121
|
const taskId = /^\/api\/tasks\/([^/?]+)/.exec(path)?.[1] ?? "";
|
|
117
122
|
return apiGet2(path, {
|
|
118
123
|
headers: {
|