@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,216 @@
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
+ AGENT_COMPATIBILITY,
4
+ assertAgentCompatibility,
5
+ nodeVersionSupported
6
+ } from "./chunk-OKZ2NRYZ.js";
7
+ import {
8
+ listSandboxes
9
+ } from "./chunk-JAZ5BWPB.js";
10
+ import "./chunk-MI2GPMCZ.js";
11
+ import "./chunk-EIHZYRIU.js";
12
+ import {
13
+ channelView,
14
+ loadAgentPolicy,
15
+ openAgentChannels
16
+ } from "./chunk-F5SS4NUF.js";
17
+ import {
18
+ apiUrl,
19
+ getX402PolicyPath,
20
+ keystoreExists,
21
+ loadKeystore,
22
+ loadX402Policy,
23
+ rpcUrlForNetwork
24
+ } from "./chunk-3S63AB3C.js";
25
+ import "./chunk-YM4S6IE4.js";
26
+ import {
27
+ AGENT_VIEW_VERSION
28
+ } from "./chunk-73RXOYME.js";
29
+ import "./chunk-S7SJMJ2I.js";
30
+
31
+ // src/lib/agent/doctor.ts
32
+ var CHAIN_IDS = { "eip155:8453": "0x2105", "eip155:84532": "0x14a34" };
33
+ function reason(error) {
34
+ return error.code ?? error.message;
35
+ }
36
+ function loopback(url) {
37
+ return ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
38
+ }
39
+ async function runDoctor(deps = {}) {
40
+ const fetchImpl = deps.fetch ?? fetch;
41
+ const nodeVersion = deps.nodeVersion ?? process.versions.node;
42
+ const apiBase = deps.apiUrl ?? apiUrl();
43
+ const checks = [];
44
+ const add = (id, status, summary) => checks.push({ id, status, summary });
45
+ const get = (url, init = {}) => fetchImpl(url, { redirect: "error", signal: AbortSignal.timeout(1e4), ...init });
46
+ add(
47
+ "node",
48
+ nodeVersionSupported(nodeVersion) ? "pass" : "fail",
49
+ `Node ${nodeVersion}; taskmarket agent needs ${AGENT_COMPATIBILITY.node.minimum} or later`
50
+ );
51
+ try {
52
+ (deps.checkRuntime ?? (() => assertAgentCompatibility({ nodeVersion: "99.0.0" })))();
53
+ add(
54
+ "runtime",
55
+ "pass",
56
+ `Bundled Pi ${AGENT_COMPATIBILITY.pi.version} and pi-xgate ${AGENT_COMPATIBILITY.piXgate.version} match this build`
57
+ );
58
+ } catch (error) {
59
+ add("runtime", "fail", error.message);
60
+ }
61
+ let credentials;
62
+ let walletAddress;
63
+ if (await keystoreExists()) {
64
+ const keystore = await loadKeystore();
65
+ credentials = { deviceId: keystore.deviceId, apiToken: keystore.apiToken };
66
+ walletAddress = keystore.walletAddress;
67
+ add("wallet", "pass", `Wallet ${keystore.walletAddress} (not unlocked)`);
68
+ } else {
69
+ add("wallet", "fail", "No wallet; run taskmarket wallet import");
70
+ }
71
+ let policy;
72
+ try {
73
+ policy = await loadAgentPolicy();
74
+ const foreign = policy.rails.filter(
75
+ (rail) => walletAddress && rail.wallet.toLowerCase() !== walletAddress.toLowerCase()
76
+ );
77
+ add(
78
+ "policy",
79
+ foreign.length > 0 ? "fail" : "pass",
80
+ foreign.length > 0 ? `Rail ${foreign[0].id} pays from ${foreign[0].wallet}, not this wallet` : `${policy.models.length} approved model(s), ${policy.rails.length} rail(s)`
81
+ );
82
+ } catch (error) {
83
+ add("policy", "fail", error.message);
84
+ }
85
+ const rpcUrls = /* @__PURE__ */ new Map();
86
+ if (policy) {
87
+ try {
88
+ const x402Policy = await loadX402Policy(getX402PolicyPath());
89
+ for (const rail of policy.rails)
90
+ rpcUrls.set(rail.network, rpcUrlForNetwork(x402Policy, rail.network));
91
+ add("payment_policy", "pass", `RPC configured for ${[...rpcUrls.keys()].join(", ")}`);
92
+ } catch (error) {
93
+ add("payment_policy", "fail", reason(error));
94
+ }
95
+ } else {
96
+ add("payment_policy", "skip", "No spending policy to check");
97
+ }
98
+ if (policy && rpcUrls.size > 0 && walletAddress) {
99
+ try {
100
+ const opened = await openAgentChannels();
101
+ const problems = [];
102
+ for (const rail of opened.rails) {
103
+ const channel = await channelView(rail);
104
+ if (channel.pendingOperation) {
105
+ problems.push(
106
+ `${channel.rail} has an unresolved ${channel.pendingOperation.kind} ${channel.pendingOperation.id}`
107
+ );
108
+ } else if (channel.state !== "open") {
109
+ problems.push(`${channel.rail} is ${channel.state}`);
110
+ }
111
+ }
112
+ add(
113
+ "channels",
114
+ problems.length > 0 ? "warn" : "pass",
115
+ problems.length > 0 ? problems.join("; ") : `${opened.rails.length} channel(s) open, nothing unresolved`
116
+ );
117
+ } catch (error) {
118
+ add("channels", "fail", reason(error));
119
+ }
120
+ } else {
121
+ add("channels", "skip", "Needs a wallet and a usable spending policy");
122
+ }
123
+ try {
124
+ const response = await get(`${apiBase.replace(/\/+$/, "")}/api/compute/pricing`);
125
+ await response.body?.cancel().catch(() => void 0);
126
+ add(
127
+ "api",
128
+ response.ok ? "pass" : "fail",
129
+ `${new URL(apiBase).origin} answered ${response.status}`
130
+ );
131
+ } catch (error) {
132
+ add("api", "fail", `${apiBase} is unreachable: ${reason(error)}`);
133
+ }
134
+ if (credentials) {
135
+ try {
136
+ const sandboxes = await listSandboxes(credentials, fetchImpl);
137
+ add(
138
+ "sandbox",
139
+ "pass",
140
+ `The sandbox broker answered; ${sandboxes.length} sandbox(es) on this wallet`
141
+ );
142
+ } catch (error) {
143
+ add("sandbox", "fail", `The sandbox broker is unavailable: ${reason(error)}`);
144
+ }
145
+ } else {
146
+ add("sandbox", "skip", "Needs a wallet");
147
+ }
148
+ const api = new URL(apiBase);
149
+ add(
150
+ "host_key",
151
+ api.protocol === "https:" ? "pass" : loopback(api) ? "warn" : "fail",
152
+ api.protocol === "https:" ? "Sandbox host keys are pinned per connection (ssh-ed25519 only) from the broker over HTTPS; never trusted on first use" : loopback(api) ? "The API is a local development server without TLS; host keys are only as trustworthy as it is" : `The API ${api.origin} is not HTTPS, so the sandbox host keys it returns cannot be trusted`
153
+ );
154
+ if (policy) {
155
+ for (const origin of new Set(policy.rails.map((rail) => rail.origin))) {
156
+ try {
157
+ const response = await get(`${origin}/v1/models`, {
158
+ headers: { accept: "application/json" }
159
+ });
160
+ await response.body?.cancel().catch(() => void 0);
161
+ add(
162
+ "xgate",
163
+ response.ok ? "pass" : "fail",
164
+ `${origin} catalog answered ${response.status}`
165
+ );
166
+ } catch (error) {
167
+ add("xgate", "fail", `${origin} is unreachable: ${reason(error)}`);
168
+ }
169
+ }
170
+ for (const [network, url] of rpcUrls) {
171
+ try {
172
+ const response = await get(url, {
173
+ method: "POST",
174
+ headers: { "content-type": "application/json" },
175
+ body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_chainId", params: [] })
176
+ });
177
+ const body = await response.json();
178
+ const expected = CHAIN_IDS[network];
179
+ add(
180
+ "rpc",
181
+ body.result === expected ? "pass" : "fail",
182
+ body.result === expected ? `${network} RPC reachable` : `${network} RPC answered chain ${String(body.result)}, expected ${expected}`
183
+ );
184
+ } catch (error) {
185
+ add("rpc", "fail", `${network} RPC is unreachable: ${reason(error)}`);
186
+ }
187
+ }
188
+ } else {
189
+ add("xgate", "skip", "No spending policy names an xgate origin");
190
+ }
191
+ return {
192
+ version: AGENT_VIEW_VERSION,
193
+ kind: "taskmarket.agent.doctor",
194
+ ok: !checks.some((check) => check.status === "fail"),
195
+ compatibility: {
196
+ node: nodeVersion,
197
+ nodeMinimum: AGENT_COMPATIBILITY.node.minimum,
198
+ pi: AGENT_COMPATIBILITY.pi.version,
199
+ piXgate: AGENT_COMPATIBILITY.piXgate.version,
200
+ protocol: AGENT_COMPATIBILITY.protocol
201
+ },
202
+ checks
203
+ };
204
+ }
205
+ function doctorLines(report) {
206
+ return [
207
+ `taskmarket agent doctor (view v${report.version}): ${report.ok ? "ready" : "problems found"}`,
208
+ ...report.checks.map(
209
+ (check) => `${check.status.toUpperCase().padEnd(4)} ${check.id}: ${check.summary}`
210
+ )
211
+ ];
212
+ }
213
+ export {
214
+ doctorLines,
215
+ runDoctor
216
+ };
@@ -0,0 +1,8 @@
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
+ import "./chunk-S7SJMJ2I.js";
6
+ export {
7
+ AgentLaunchError
8
+ };