@lucid-agents/taskmarket 1.17.1 → 1.18.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.
@@ -1,15 +1,6 @@
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
- ApiError,
4
- ComputeCreditBuyOutputSchema,
5
- ComputeCreditPricingSchema,
6
- ComputeCreditStatusOutputSchema,
7
3
  X402PayError,
8
- apiErrorEnvelopeOf,
9
- apiGet,
10
- apiOrigin,
11
- apiPost,
12
- apiUrl,
13
4
  assertX402HeaderName,
14
5
  assertX402HeaderValue,
15
6
  createEvmPerRequestRail,
@@ -18,30 +9,36 @@ import {
18
9
  createWalletAccountFromKeystore,
19
10
  createX402Allocations,
20
11
  createX402Payer,
21
- failureMessage,
22
- getTaskmarketHome,
23
12
  getX402JournalPath,
24
13
  getX402Payment,
25
14
  getX402PolicyPath,
15
+ loadX402Policy,
16
+ readMppTempoChallenge,
17
+ reconcileX402Payment,
18
+ withX402FileLock
19
+ } from "./chunk-S4A6V3J3.js";
20
+ import {
21
+ ApiError,
22
+ ComputeCreditBuyOutputSchema,
23
+ ComputeCreditPricingSchema,
24
+ ComputeCreditStatusOutputSchema,
25
+ apiErrorEnvelopeOf,
26
+ apiGet,
27
+ apiOrigin,
28
+ apiPost,
29
+ apiUrl,
30
+ failureMessage,
31
+ getTaskmarketHome,
26
32
  idempotencyHeaders,
27
33
  legalReceiptHeadersForKeystore,
28
34
  loadKeystore,
29
- loadX402Policy,
30
35
  parseFailureBody,
31
36
  paymentProtocolOf,
32
37
  readFailureBody,
33
- readMppTempoChallenge,
34
- reconcileX402Payment,
35
38
  resolveIdempotencyKey,
36
39
  selectedNetwork,
37
- withIdempotentWrite,
38
- withX402FileLock
39
- } from "./chunk-3S63AB3C.js";
40
-
41
- // src/lib/compute-credits.ts
42
- import { randomUUID as randomUUID4 } from "crypto";
43
- import { promises as fs2 } from "fs";
44
- import path2 from "path";
40
+ withIdempotentWrite
41
+ } from "./chunk-75LS6XS6.js";
45
42
 
46
43
  // src/lib/x402-fee.ts
47
44
  import { randomUUID as randomUUID3 } from "crypto";
@@ -489,6 +486,9 @@ async function x402FeePost(path3, body, options = {}) {
489
486
  }
490
487
 
491
488
  // src/lib/compute-credits.ts
489
+ import { randomUUID as randomUUID4 } from "crypto";
490
+ import { promises as fs2 } from "fs";
491
+ import path2 from "path";
492
492
  var COMPUTE_CREDIT_PATH = "/api/compute/credits";
493
493
  var COMPUTE_CREDIT_STATUS_PATH = "/api/compute/credits/status";
494
494
  var COMPUTE_PRICING_PATH = "/api/compute/pricing";
@@ -851,7 +851,7 @@ async function purchaseLocked(input, seams) {
851
851
  }
852
852
  }
853
853
  function apiErrorCode(error) {
854
- return /\b(purchase_void|purchase_pending|in_flight|key_conflict|disabled)\b/.exec(
854
+ return /\b(purchase_void|purchase_pending|in_flight|key_conflict|disabled|LEGAL_ACCEPTANCE_REQUIRED)\b/.exec(
855
855
  error.message
856
856
  )?.[1];
857
857
  }
@@ -0,0 +1,65 @@
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
+ import {
3
+ AgentLaunchError
4
+ } from "./chunk-YM4S6IE4.js";
5
+
6
+ // src/lib/agent/prompter.ts
7
+ import { createInterface } from "readline";
8
+ function cancelled() {
9
+ return new AgentLaunchError(
10
+ "setup_cancelled",
11
+ "Setup was cancelled; nothing more was written or bought"
12
+ );
13
+ }
14
+ function terminalPrompter(input = process.stdin, output = process.stderr) {
15
+ let readline;
16
+ let closed = false;
17
+ let reject;
18
+ const open = () => {
19
+ if (readline) return readline;
20
+ readline = createInterface({ input, output, terminal: true });
21
+ readline.on("SIGINT", () => {
22
+ output.write("\n");
23
+ reject?.(cancelled());
24
+ });
25
+ readline.on("close", () => {
26
+ closed = true;
27
+ reject?.(cancelled());
28
+ });
29
+ return readline;
30
+ };
31
+ const question = (text) => new Promise((resolve, fail) => {
32
+ if (closed) {
33
+ fail(cancelled());
34
+ return;
35
+ }
36
+ reject = fail;
37
+ open().question(text, (answer) => {
38
+ reject = void 0;
39
+ resolve(answer);
40
+ });
41
+ });
42
+ return {
43
+ say(lines) {
44
+ output.write(`${lines.join("\n")}
45
+ `);
46
+ },
47
+ async ask(text, fallback) {
48
+ const answer = (await question(`${text} [${fallback}]: `)).trim();
49
+ return answer === "" ? fallback : answer;
50
+ },
51
+ async confirm(text) {
52
+ const answer = await question(`${text} Type yes to approve: `);
53
+ return answer.trim().toLowerCase() === "yes";
54
+ },
55
+ close() {
56
+ reject = void 0;
57
+ readline?.close();
58
+ readline = void 0;
59
+ }
60
+ };
61
+ }
62
+
63
+ export {
64
+ terminalPrompter
65
+ };
@@ -6,26 +6,29 @@ import {
6
6
  } from "./chunk-OKZ2NRYZ.js";
7
7
  import {
8
8
  listSandboxes
9
- } from "./chunk-JAZ5BWPB.js";
10
- import "./chunk-MI2GPMCZ.js";
11
- import "./chunk-EIHZYRIU.js";
9
+ } from "./chunk-2QJMUHDT.js";
10
+ import "./chunk-L6ZVRENW.js";
11
+ import "./chunk-64HQ7ZF2.js";
12
+ import "./chunk-W7CXEYST.js";
12
13
  import {
13
14
  channelView,
14
15
  loadAgentPolicy,
15
16
  openAgentChannels
16
- } from "./chunk-F5SS4NUF.js";
17
+ } from "./chunk-MO5KMUTL.js";
17
18
  import {
18
- apiUrl,
19
19
  getX402PolicyPath,
20
- keystoreExists,
21
- loadKeystore,
22
20
  loadX402Policy,
23
21
  rpcUrlForNetwork
24
- } from "./chunk-3S63AB3C.js";
25
- import "./chunk-YM4S6IE4.js";
22
+ } from "./chunk-S4A6V3J3.js";
23
+ import {
24
+ apiUrl,
25
+ keystoreExists,
26
+ loadKeystore
27
+ } from "./chunk-75LS6XS6.js";
26
28
  import {
27
29
  AGENT_VIEW_VERSION
28
- } from "./chunk-73RXOYME.js";
30
+ } from "./chunk-EB6OJBF5.js";
31
+ import "./chunk-YM4S6IE4.js";
29
32
  import "./chunk-S7SJMJ2I.js";
30
33
 
31
34
  // src/lib/agent/doctor.ts