@lucid-agents/taskmarket 1.16.0 → 1.17.1

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 (128) hide show
  1. package/THIRD_PARTY_NOTICES.md +14 -0
  2. package/dist/THIRD_PARTY_NOTICES.md +3108 -0
  3. package/dist/agent-compatibility.json +54 -0
  4. package/dist/budget-view-XKZC3GY5.js +36 -0
  5. package/dist/channels-Q7XMSUSO.js +29 -0
  6. package/dist/chunk-3S63AB3C.js +16068 -0
  7. package/dist/chunk-73RXOYME.js +185 -0
  8. package/dist/chunk-EIHZYRIU.js +1099 -0
  9. package/dist/chunk-F5SS4NUF.js +1062 -0
  10. package/dist/chunk-JAZ5BWPB.js +181 -0
  11. package/dist/chunk-MI2GPMCZ.js +154 -0
  12. package/dist/chunk-OKZ2NRYZ.js +133 -0
  13. package/dist/chunk-S7SJMJ2I.js +38 -0
  14. package/dist/chunk-YM4S6IE4.js +15 -0
  15. package/dist/compatibility-KUYGZSUC.js +19 -0
  16. package/dist/doctor-BY2PBHS7.js +216 -0
  17. package/dist/errors-2L357HGA.js +8 -0
  18. package/dist/index.js +1186 -13492
  19. package/dist/launch-DE65XO5C.js +22476 -0
  20. package/dist/pi/CHANGELOG.md +5689 -0
  21. package/dist/pi/README.md +718 -0
  22. package/dist/pi/dist/bundle/chunks/anthropic-messages-VWZZOSJQ.js +6 -0
  23. package/dist/pi/dist/bundle/chunks/anthropic.js +75 -0
  24. package/dist/pi/dist/bundle/chunks/azure-openai-responses-BJLAM6CD.js +2 -0
  25. package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +74 -0
  26. package/dist/pi/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
  27. package/dist/pi/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
  28. package/dist/pi/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
  29. package/dist/pi/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
  30. package/dist/pi/dist/bundle/chunks/chunk-AXIIZGTV.js +2 -0
  31. package/dist/pi/dist/bundle/chunks/chunk-CLNPYIDP.js +42 -0
  32. package/dist/pi/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
  33. package/dist/pi/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
  34. package/dist/pi/dist/bundle/chunks/chunk-IDDQWTHI.js +2 -0
  35. package/dist/pi/dist/bundle/chunks/chunk-JVUZSMYM.js +1547 -0
  36. package/dist/pi/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  37. package/dist/pi/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
  38. package/dist/pi/dist/bundle/chunks/chunk-OUXLLA64.js +11 -0
  39. package/dist/pi/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  40. package/dist/pi/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  41. package/dist/pi/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  42. package/dist/pi/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  43. package/dist/pi/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
  44. package/dist/pi/dist/bundle/chunks/chunk-U6ZMQKGD.js +50 -0
  45. package/dist/pi/dist/bundle/chunks/chunk-UAQELI3K.js +2 -0
  46. package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
  47. package/dist/pi/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
  48. package/dist/pi/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
  49. package/dist/pi/dist/bundle/chunks/github-copilot.js +2 -0
  50. package/dist/pi/dist/bundle/chunks/google-generative-ai-Q2K7FBDI.js +2 -0
  51. package/dist/pi/dist/bundle/chunks/google-vertex-7UJBF4S7.js +2 -0
  52. package/dist/pi/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
  53. package/dist/pi/dist/bundle/chunks/image-resize-worker.js +2 -0
  54. package/dist/pi/dist/bundle/chunks/kimi-coding.js +2 -0
  55. package/dist/pi/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
  56. package/dist/pi/dist/bundle/chunks/mistral-conversations-4M6BZBX6.js +5 -0
  57. package/dist/pi/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  58. package/dist/pi/dist/bundle/chunks/node-KG362ECQ.js +16 -0
  59. package/dist/pi/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
  60. package/dist/pi/dist/bundle/chunks/openai-codex-responses-R6VYZTVY.js +10 -0
  61. package/dist/pi/dist/bundle/chunks/openai-codex.js +75 -0
  62. package/dist/pi/dist/bundle/chunks/openai-completions-EKZT2IH2.js +7 -0
  63. package/dist/pi/dist/bundle/chunks/openai-responses-TFDINO6W.js +2 -0
  64. package/dist/pi/dist/bundle/chunks/openrouter-images-N4XVVFSD.js +2 -0
  65. package/dist/pi/dist/bundle/chunks/openrouter.js +75 -0
  66. package/dist/pi/dist/bundle/chunks/pi-messages-PML4SPVJ.js +8 -0
  67. package/dist/pi/dist/bundle/chunks/radius.js +75 -0
  68. package/dist/pi/dist/bundle/chunks/src-UK77SYZE.js +4 -0
  69. package/dist/pi/dist/bundle/chunks/xai.js +2 -0
  70. package/dist/pi/dist/bundle/cli.js +3 -0
  71. package/dist/pi/dist/bundle/index.js +2 -0
  72. package/dist/pi/dist/bundle/rpc-entry.js +3 -0
  73. package/dist/pi/dist/core/export-html/template.css +1066 -0
  74. package/dist/pi/dist/core/export-html/template.html +55 -0
  75. package/dist/pi/dist/core/export-html/template.js +1864 -0
  76. package/dist/pi/dist/core/export-html/vendor/highlight.min.js +1213 -0
  77. package/dist/pi/dist/core/export-html/vendor/marked.min.js +78 -0
  78. package/dist/pi/dist/modes/interactive/assets/clankolas.png +0 -0
  79. package/dist/pi/dist/modes/interactive/theme/dark.json +91 -0
  80. package/dist/pi/dist/modes/interactive/theme/light.json +90 -0
  81. package/dist/pi/dist/modes/interactive/theme/theme-schema.json +356 -0
  82. package/dist/pi/docs/compaction.md +418 -0
  83. package/dist/pi/docs/containerization.md +156 -0
  84. package/dist/pi/docs/custom-provider.md +777 -0
  85. package/dist/pi/docs/development.md +90 -0
  86. package/dist/pi/docs/environment-variables.md +99 -0
  87. package/dist/pi/docs/extensions.md +3023 -0
  88. package/dist/pi/docs/index.md +84 -0
  89. package/dist/pi/docs/json.md +98 -0
  90. package/dist/pi/docs/keybindings.md +239 -0
  91. package/dist/pi/docs/llama-cpp.md +101 -0
  92. package/dist/pi/docs/models.md +574 -0
  93. package/dist/pi/docs/packages.md +228 -0
  94. package/dist/pi/docs/prompt-templates.md +96 -0
  95. package/dist/pi/docs/providers.md +317 -0
  96. package/dist/pi/docs/quickstart.md +167 -0
  97. package/dist/pi/docs/rpc.md +1618 -0
  98. package/dist/pi/docs/sdk.md +1224 -0
  99. package/dist/pi/docs/security.md +59 -0
  100. package/dist/pi/docs/session-format.md +438 -0
  101. package/dist/pi/docs/sessions.md +145 -0
  102. package/dist/pi/docs/settings.md +369 -0
  103. package/dist/pi/docs/shell-aliases.md +13 -0
  104. package/dist/pi/docs/skills.md +232 -0
  105. package/dist/pi/docs/terminal-setup.md +192 -0
  106. package/dist/pi/docs/termux.md +127 -0
  107. package/dist/pi/docs/themes.md +322 -0
  108. package/dist/pi/docs/tmux.md +63 -0
  109. package/dist/pi/docs/tui.md +961 -0
  110. package/dist/pi/docs/usage.md +311 -0
  111. package/dist/pi/docs/windows.md +39 -0
  112. package/dist/pi/package.json +15 -0
  113. package/dist/pi/vendor/chord-context.js +96 -0
  114. package/dist/pi/vendor/jiti/LICENSE +21 -0
  115. package/dist/pi/vendor/jiti/dist/babel.cjs +257 -0
  116. package/dist/pi/vendor/jiti/dist/jiti.cjs +1 -0
  117. package/dist/pi/vendor/jiti/lib/jiti.cjs +30 -0
  118. package/dist/pi/vendor/jiti/package.json +6 -0
  119. package/dist/pi/vendor/photon-node/LICENSE.md +201 -0
  120. package/dist/pi/vendor/photon-node/package.json +6 -0
  121. package/dist/pi/vendor/photon-node/photon_rs.js +4521 -0
  122. package/dist/pi/vendor/photon-node/photon_rs_bg.wasm +0 -0
  123. package/dist/pi-extensions/lockdown.cjs +433 -0
  124. package/dist/pi-extensions/remote-tools.cjs +22320 -0
  125. package/dist/pi-extensions/xgate.cjs +2565 -0
  126. package/dist/reconcile-VEMPNIAO.js +83 -0
  127. package/dist/status-3Q55PBFC.js +18 -0
  128. package/package.json +13 -2
@@ -0,0 +1,83 @@
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
+ openAgentChannels
4
+ } from "./chunk-F5SS4NUF.js";
5
+ import {
6
+ X402_INVOCATION_ID_PATTERN
7
+ } from "./chunk-3S63AB3C.js";
8
+ import {
9
+ AgentLaunchError
10
+ } from "./chunk-YM4S6IE4.js";
11
+ import {
12
+ AGENT_VIEW_VERSION,
13
+ LOST_RESPONSE_TEXT,
14
+ formatUsdc
15
+ } from "./chunk-73RXOYME.js";
16
+ import "./chunk-S7SJMJ2I.js";
17
+
18
+ // src/lib/agent/reconcile.ts
19
+ function outcomeOf(status) {
20
+ if (status.state === "in_progress") return "in_progress";
21
+ if (status.charge === "manually_resolved") return "resolved_manually";
22
+ if (status.uncertain) return "uncertain";
23
+ if (status.charge === "settled") return "charged";
24
+ if (status.charge === "none" || status.charge === "released") return "not_charged";
25
+ return "uncertain";
26
+ }
27
+ function messageFor(outcome, status) {
28
+ const charged = status.payment?.settledAmount;
29
+ switch (outcome) {
30
+ case "charged":
31
+ return `Charged ${charged !== void 0 ? formatUsdc(charged) : "an amount the router committed"}. If its response did not reach you: ${LOST_RESPONSE_TEXT}`;
32
+ case "not_charged":
33
+ return "Nothing was charged. The request is not sent again; ask again in the agent if you still want an answer.";
34
+ case "in_progress":
35
+ return "It is still being sent by another process; reconcile it again once that finishes.";
36
+ case "resolved_manually":
37
+ return "It was resolved by hand; its recorded amount stands.";
38
+ default:
39
+ return "Its outcome is still unknown. It keeps its maximum counted and blocks new turns on its channel; reconcile it again later. It is never sent again.";
40
+ }
41
+ }
42
+ async function railFor(rails, invocationId) {
43
+ for (const rail of rails) {
44
+ try {
45
+ await rail.payer.status(invocationId);
46
+ return rail;
47
+ } catch (error) {
48
+ if (error.code !== "invocation_not_found") throw error;
49
+ }
50
+ const lease = (await rail.payer.channelStatus()).pendingOperation;
51
+ if (lease?.kind === "payment" && lease.id === invocationId) return rail;
52
+ }
53
+ throw new AgentLaunchError(
54
+ "invocation_not_found",
55
+ `No agent purchase ${invocationId} is recorded on this device`
56
+ );
57
+ }
58
+ async function reconcileInvocation(invocationId, deps = {}) {
59
+ if (!X402_INVOCATION_ID_PATTERN.test(invocationId)) {
60
+ throw new AgentLaunchError("invalid_invocation_id", `Not an invocation ID: ${invocationId}`);
61
+ }
62
+ const opened = await (deps.openChannels ?? openAgentChannels)();
63
+ const rail = await railFor([...opened.rails, ...opened.retired ?? []], invocationId);
64
+ const status = await rail.payer.reconcile(invocationId);
65
+ const lease = (await rail.payer.channelStatus()).pendingOperation;
66
+ const outcome = outcomeOf(status);
67
+ return {
68
+ version: AGENT_VIEW_VERSION,
69
+ kind: "taskmarket.agent.reconcile",
70
+ invocationId,
71
+ rail: rail.rail.id,
72
+ outcome,
73
+ state: status.state,
74
+ charge: status.charge,
75
+ authorizedAtomic: status.payment?.authorizedAmount ?? null,
76
+ chargedAtomic: status.payment?.settledAmount ?? null,
77
+ blocksChannel: lease?.kind === "payment" && lease.id === invocationId,
78
+ message: messageFor(outcome, status)
79
+ };
80
+ }
81
+ export {
82
+ reconcileInvocation
83
+ };
@@ -0,0 +1,18 @@
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
+ collectAgentStatus,
4
+ listSandboxes,
5
+ statusLines
6
+ } from "./chunk-JAZ5BWPB.js";
7
+ import "./chunk-MI2GPMCZ.js";
8
+ import "./chunk-EIHZYRIU.js";
9
+ import "./chunk-F5SS4NUF.js";
10
+ import "./chunk-3S63AB3C.js";
11
+ import "./chunk-YM4S6IE4.js";
12
+ import "./chunk-73RXOYME.js";
13
+ import "./chunk-S7SJMJ2I.js";
14
+ export {
15
+ collectAgentStatus,
16
+ listSandboxes,
17
+ statusLines
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucid-agents/taskmarket",
3
- "version": "1.16.0",
3
+ "version": "1.17.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "taskmarket": "./dist/index.js"
@@ -11,24 +11,34 @@
11
11
  "@x402/evm": "2.25.0",
12
12
  "@xmtp/node-sdk": "^2.0.0",
13
13
  "commander": "^12.0.0",
14
+ "ox": "0.14.54",
14
15
  "viem": "^2.57.4",
15
16
  "yaml": "2.8.1",
16
17
  "zod": "^3.24.2"
17
18
  },
18
19
  "devDependencies": {
20
+ "@earendil-works/pi-ai": "0.85.1",
21
+ "@earendil-works/pi-coding-agent": "0.85.1",
22
+ "@lucid-agents/pi-xgate": "0.1.6",
23
+ "@lydell/node-pty": "1.1.0",
24
+ "@peculiar/x509": "1.12.3",
19
25
  "@types/node": "^20.11.0",
26
+ "ssh2": "1.17.0",
20
27
  "tsup": "^8.0.0",
21
28
  "tsx": "^4.7.0",
22
29
  "typescript": "^5.3.3",
23
30
  "vitest": "^2.0.0",
31
+ "@taskmarket/agent-host": "0.0.1",
24
32
  "@taskmarket/contracts": "0.0.0",
25
33
  "@taskmarket/eslint-config": "0.0.0",
26
34
  "@taskmarket/prettier-config": "0.0.0",
35
+ "@taskmarket/remote-tools": "0.0.1",
27
36
  "@taskmarket/shared": "2.0.0",
28
37
  "@taskmarket/x402-payer": "0.1.0"
29
38
  },
30
39
  "files": [
31
- "dist"
40
+ "dist",
41
+ "THIRD_PARTY_NOTICES.md"
32
42
  ],
33
43
  "publishConfig": {
34
44
  "access": "public"
@@ -42,6 +52,7 @@
42
52
  "format:write": "prettier --write src/",
43
53
  "type-check": "tsc --noEmit",
44
54
  "test": "vitest run",
55
+ "test:agent": "vitest run --config vitest.agent.config.ts",
45
56
  "test:watch": "vitest watch",
46
57
  "smoke:xmtp-live": "tsx scripts/smoke-xmtp-live.ts",
47
58
  "smoke:x402-pay": "tsx scripts/smoke-x402-pay.ts"