@lucid-agents/taskmarket 1.23.0 → 1.24.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.
- package/dist/agent-compatibility.json +1 -1
- package/dist/{channels-Z52MJ5YT.js → channels-KCVGG62H.js} +3 -3
- package/dist/{chunk-RYJKYQ6P.js → chunk-2BYIKWV5.js} +4 -4
- package/dist/{chunk-FSK3D3S5.js → chunk-3YYDUJV4.js} +1 -1
- package/dist/{chunk-CAJH6AVP.js → chunk-DT7AD52I.js} +2 -2
- package/dist/{chunk-OGYFQL45.js → chunk-DZMMROHT.js} +146 -18
- package/dist/{chunk-HGTLUZBR.js → chunk-E7Y4UDXH.js} +3 -3
- package/dist/{chunk-4SZBEOE7.js → chunk-EE7LLCQY.js} +3 -3
- package/dist/{chunk-YXCEPGO4.js → chunk-I6DSFR3I.js} +2 -2
- package/dist/{chunk-PKUB7FZE.js → chunk-IPJKSTNW.js} +1 -1
- package/dist/{chunk-SXPG3I34.js → chunk-VKQBB6CG.js} +1 -1
- package/dist/{doctor-YP2Z6WNE.js → doctor-FCQZBQFU.js} +7 -7
- package/dist/index.js +243 -67
- package/dist/{launch-VZ5JBM5R.js → launch-Q67U5TZE.js} +8 -8
- package/dist/pi-extensions/xgate.cjs +147 -19
- package/dist/{reconcile-VVNBTJRJ.js → reconcile-NBIZBPVA.js} +3 -3
- package/dist/{status-RHVQJID5.js → status-5PXMF7RK.js} +7 -7
- package/dist/{sync-pull-C3VA3C26.js → sync-pull-BY4QUY4T.js} +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
signReadAuth,
|
|
15
15
|
submitTaskFiles,
|
|
16
16
|
taskAccessGrantHeaders
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EE7LLCQY.js";
|
|
18
18
|
import {
|
|
19
19
|
ComputeCreditError,
|
|
20
20
|
applyComputeCreditSetup,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
refusedPaidWrite,
|
|
37
37
|
releasePendingComputePurchase,
|
|
38
38
|
resolvePendingComputePurchases
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-I6DSFR3I.js";
|
|
40
40
|
import {
|
|
41
41
|
MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
|
|
42
42
|
X402PayError,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
signSponsoredTempoTransfer,
|
|
60
60
|
signTaskmarketFeePayment,
|
|
61
61
|
signTypedData
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-3YYDUJV4.js";
|
|
63
63
|
import {
|
|
64
64
|
ActivityFeedInputSchema,
|
|
65
65
|
ActivityHeatmapInputSchema,
|
|
@@ -197,7 +197,7 @@ import {
|
|
|
197
197
|
withChainId,
|
|
198
198
|
withErrorContext,
|
|
199
199
|
withIdempotentWrite
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-DZMMROHT.js";
|
|
201
201
|
import {
|
|
202
202
|
channelLines
|
|
203
203
|
} from "./chunk-XJOB4NMV.js";
|
|
@@ -282,10 +282,19 @@ function readLastError() {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
// src/lib/output.ts
|
|
285
|
+
function cliWarning(code, message, details) {
|
|
286
|
+
return { ...details, code, message };
|
|
287
|
+
}
|
|
285
288
|
function printResult(data, options) {
|
|
286
289
|
const idempotencyKey = options?.idempotencyKey;
|
|
290
|
+
const warnings = options?.warnings ?? [];
|
|
287
291
|
console.log(
|
|
288
|
-
JSON.stringify({
|
|
292
|
+
JSON.stringify({
|
|
293
|
+
ok: true,
|
|
294
|
+
data,
|
|
295
|
+
...idempotencyKey !== void 0 ? { idempotencyKey } : {},
|
|
296
|
+
...warnings.length > 0 ? { warnings } : {}
|
|
297
|
+
})
|
|
289
298
|
);
|
|
290
299
|
}
|
|
291
300
|
function x402FailureFields(error) {
|
|
@@ -334,9 +343,6 @@ function renderFailure(error, options) {
|
|
|
334
343
|
function printError(message, options) {
|
|
335
344
|
return renderFailure(new Error(message), options);
|
|
336
345
|
}
|
|
337
|
-
function printWarning(message) {
|
|
338
|
-
process.stderr.write(JSON.stringify({ ok: false, error: message }) + "\n");
|
|
339
|
-
}
|
|
340
346
|
|
|
341
347
|
// src/lib/agent.ts
|
|
342
348
|
function legacyAgentIdChain(keystore) {
|
|
@@ -651,7 +657,7 @@ function sanitizeEmailUsername(agentId, suffix) {
|
|
|
651
657
|
const candidate = `${base}-${suffix}`;
|
|
652
658
|
return /^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/.test(candidate) ? candidate : null;
|
|
653
659
|
}
|
|
654
|
-
async function tryRegisterEmail(deviceId, apiToken, username, explicit) {
|
|
660
|
+
async function tryRegisterEmail(deviceId, apiToken, username, explicit, warnings) {
|
|
655
661
|
try {
|
|
656
662
|
const { data: reg } = await apiPost("/api/emails/register", {
|
|
657
663
|
deviceId,
|
|
@@ -662,8 +668,12 @@ async function tryRegisterEmail(deviceId, apiToken, username, explicit) {
|
|
|
662
668
|
} catch (err) {
|
|
663
669
|
if (explicit) {
|
|
664
670
|
const msg = err instanceof Error ? err.message : String(err);
|
|
665
|
-
|
|
666
|
-
|
|
671
|
+
warnings.push(
|
|
672
|
+
cliWarning(
|
|
673
|
+
"email_registration_failed",
|
|
674
|
+
`Email registration failed: ${msg}. Run: taskmarket email register --username ${username}`,
|
|
675
|
+
{ username, retryCommand: `taskmarket email register --username ${username}` }
|
|
676
|
+
)
|
|
667
677
|
);
|
|
668
678
|
}
|
|
669
679
|
return null;
|
|
@@ -781,7 +791,8 @@ var initCommand = new Command2("init").description(
|
|
|
781
791
|
} catch {
|
|
782
792
|
}
|
|
783
793
|
const username = opts.email ?? (agentId && networkInfo ? sanitizeEmailUsername(agentId, String(selectedNetwork().chainId)) : null);
|
|
784
|
-
const
|
|
794
|
+
const warnings = [];
|
|
795
|
+
const emailAddress = username ? await tryRegisterEmail(deviceId, apiToken, username, !!opts.email, warnings) : null;
|
|
785
796
|
let chain;
|
|
786
797
|
try {
|
|
787
798
|
chain = chainInfoFor(networkInfo, selectedNetwork().chainId);
|
|
@@ -789,15 +800,18 @@ var initCommand = new Command2("init").description(
|
|
|
789
800
|
renderFailure(err);
|
|
790
801
|
return;
|
|
791
802
|
}
|
|
792
|
-
printResult(
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
803
|
+
printResult(
|
|
804
|
+
{
|
|
805
|
+
address,
|
|
806
|
+
agentId,
|
|
807
|
+
network: chain?.networkName ?? networkInfo?.networkName,
|
|
808
|
+
chainId: chain?.chainId ?? networkInfo?.chainId,
|
|
809
|
+
paymentMethod: chain?.paymentMethod,
|
|
810
|
+
feeModel: chain?.feeModel,
|
|
811
|
+
emailAddress
|
|
812
|
+
},
|
|
813
|
+
{ warnings }
|
|
814
|
+
);
|
|
801
815
|
});
|
|
802
816
|
|
|
803
817
|
// src/commands/address.ts
|
|
@@ -1539,6 +1553,42 @@ async function x402Post(path3, body, options) {
|
|
|
1539
1553
|
});
|
|
1540
1554
|
}
|
|
1541
1555
|
|
|
1556
|
+
// src/lib/hook-registry.ts
|
|
1557
|
+
async function fetchHookRegistry(address) {
|
|
1558
|
+
const query3 = address ? `?address=${address}` : "";
|
|
1559
|
+
return await apiGet(withChainId(`/api/hooks/registry${query3}`));
|
|
1560
|
+
}
|
|
1561
|
+
async function describeHookListings(hooks, alwaysListed = []) {
|
|
1562
|
+
if (hooks.length === 0) return { hooks: [], warnings: [] };
|
|
1563
|
+
let registry;
|
|
1564
|
+
try {
|
|
1565
|
+
registry = await fetchHookRegistry();
|
|
1566
|
+
if (!registry || !Array.isArray(registry.listed)) return null;
|
|
1567
|
+
} catch {
|
|
1568
|
+
return null;
|
|
1569
|
+
}
|
|
1570
|
+
const listed = new Map(registry.listed.map((entry) => [entry.address.toLowerCase(), entry]));
|
|
1571
|
+
const implicit = new Set(alwaysListed.map((address) => address.toLowerCase()));
|
|
1572
|
+
const listings = [];
|
|
1573
|
+
const warnings = [];
|
|
1574
|
+
for (const raw of hooks) {
|
|
1575
|
+
const address = raw.toLowerCase();
|
|
1576
|
+
const entry = listed.get(address);
|
|
1577
|
+
const isListed = entry !== void 0 || implicit.has(address);
|
|
1578
|
+
listings.push({ address, listed: isListed, name: entry?.name ?? null });
|
|
1579
|
+
if (!isListed) {
|
|
1580
|
+
warnings.push(
|
|
1581
|
+
cliWarning(
|
|
1582
|
+
"hook_unlisted",
|
|
1583
|
+
`Hook ${address} is not listed in the hook registry for chain ${registry.chainId}. It was attached as given; run \`taskmarket hooks list\` for listed hooks.`,
|
|
1584
|
+
{ address, chainId: registry.chainId }
|
|
1585
|
+
)
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
return { hooks: listings, warnings };
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1542
1592
|
// src/lib/settlement-terms.ts
|
|
1543
1593
|
var TERM_FLAGS = {
|
|
1544
1594
|
stakeRequired: "--stake-required",
|
|
@@ -1692,6 +1742,51 @@ function parseStakeOptions(opts) {
|
|
|
1692
1742
|
}
|
|
1693
1743
|
return { stakeRequired: true, stakeBps };
|
|
1694
1744
|
}
|
|
1745
|
+
var METRIC_DESCRIPTION_MAX = 500;
|
|
1746
|
+
var METRIC_TARGET_MAX = 200;
|
|
1747
|
+
var TASK_DROP_NAME_MAX = 80;
|
|
1748
|
+
var TASK_DROP_DESCRIPTION_MAX = 500;
|
|
1749
|
+
function parseMetricAndDropOptions(opts) {
|
|
1750
|
+
const fields = {};
|
|
1751
|
+
for (const [flag, value, max, key] of [
|
|
1752
|
+
["--metric-description", opts.metricDescription, METRIC_DESCRIPTION_MAX, "metricDescription"],
|
|
1753
|
+
["--metric-target", opts.metricTarget, METRIC_TARGET_MAX, "metricTarget"]
|
|
1754
|
+
]) {
|
|
1755
|
+
if (value === void 0) continue;
|
|
1756
|
+
if (opts.mode !== "benchmark") {
|
|
1757
|
+
return { error: `${flag} is only valid with --mode benchmark` };
|
|
1758
|
+
}
|
|
1759
|
+
if (!value.trim()) return { error: `${flag} must not be empty` };
|
|
1760
|
+
if (value.length > max) return { error: `${flag} must be at most ${max} characters` };
|
|
1761
|
+
fields[key] = value;
|
|
1762
|
+
}
|
|
1763
|
+
if (opts.taskDrop !== void 0 && opts.newTaskDrop !== void 0) {
|
|
1764
|
+
return { error: "--task-drop and --new-task-drop cannot be combined" };
|
|
1765
|
+
}
|
|
1766
|
+
if (opts.newTaskDropDescription !== void 0 && opts.newTaskDrop === void 0) {
|
|
1767
|
+
return { error: "--new-task-drop-description requires --new-task-drop" };
|
|
1768
|
+
}
|
|
1769
|
+
if (opts.taskDrop !== void 0) {
|
|
1770
|
+
const taskDropId = opts.taskDrop.trim();
|
|
1771
|
+
if (!taskDropId) return { error: "--task-drop must not be empty" };
|
|
1772
|
+
fields.taskDropId = taskDropId;
|
|
1773
|
+
}
|
|
1774
|
+
if (opts.newTaskDrop !== void 0) {
|
|
1775
|
+
const name = opts.newTaskDrop.trim();
|
|
1776
|
+
if (!name) return { error: "--new-task-drop must not be empty" };
|
|
1777
|
+
if (name.length > TASK_DROP_NAME_MAX) {
|
|
1778
|
+
return { error: `--new-task-drop must be at most ${TASK_DROP_NAME_MAX} characters` };
|
|
1779
|
+
}
|
|
1780
|
+
const description = opts.newTaskDropDescription?.trim();
|
|
1781
|
+
if (description && description.length > TASK_DROP_DESCRIPTION_MAX) {
|
|
1782
|
+
return {
|
|
1783
|
+
error: `--new-task-drop-description must be at most ${TASK_DROP_DESCRIPTION_MAX} characters`
|
|
1784
|
+
};
|
|
1785
|
+
}
|
|
1786
|
+
fields.taskDropCreate = description ? { name, description } : { name };
|
|
1787
|
+
}
|
|
1788
|
+
return { fields };
|
|
1789
|
+
}
|
|
1695
1790
|
var createCmd = new Command8("create").description("Create a new task (costs the reward, in the payment token)").requiredOption("--description <text>", "Task description").requiredOption("--reward <amount>", "Reward in the payment token (e.g. 5)").requiredOption("--duration <hours>", "Task duration in hours").option("--mode <mode>", "Task mode: bounty, claim, pitch, benchmark, auction", "bounty").option(
|
|
1696
1791
|
"--task-visibility <mode>",
|
|
1697
1792
|
"Task visibility: public (default), unlisted, or private. Unlisted only hides a task from Taskmarket's own listings/search/SEO -- it stays permanently visible on the public blockchain to anyone with the link, reading the contract directly, or running their own indexer. private is genuinely access-controlled: only the requester and invited/assigned workers can view it via listings, get, or the gated reads -- see --allowed-viewers and --access-password. Even private, the on-chain existence, reward, and participation stay publicly observable regardless.",
|
|
@@ -1706,7 +1801,22 @@ var createCmd = new Command8("create").description("Create a new task (costs the
|
|
|
1706
1801
|
"--submission-visibility <mode>",
|
|
1707
1802
|
"Submission visibility: public (default), reveal_all, winner_only, or never. Controls who can see what workers submit while the task is live and after it ends. public matches today's behavior exactly. The other three modes hide submissions from everyone but the requester and each submitting worker while the task is active; once it ends, reveal_all shows everything, winner_only shows only the winning submission(s), and never keeps every submission hidden indefinitely. Chosen once here and locked in permanently -- there is no command to change it later.",
|
|
1708
1803
|
"public"
|
|
1709
|
-
).option("--tags <tags>", "Comma-separated tags").option(
|
|
1804
|
+
).option("--tags <tags>", "Comma-separated tags").option(
|
|
1805
|
+
"--metric-description <text>",
|
|
1806
|
+
'Benchmark metric workers are ranked on, e.g. "Test suite pass rate" (benchmark mode only, max 500 characters)'
|
|
1807
|
+
).option(
|
|
1808
|
+
"--metric-target <value>",
|
|
1809
|
+
"Target value for the benchmark metric, e.g. 98 (benchmark mode only, max 200 characters)"
|
|
1810
|
+
).option(
|
|
1811
|
+
"--task-drop <dropId>",
|
|
1812
|
+
"Add the task to a Task Drop you own; its subscribers are emailed when the task is published. See `taskmarket drops`."
|
|
1813
|
+
).option(
|
|
1814
|
+
"--new-task-drop <name>",
|
|
1815
|
+
"Create a new Task Drop with this name (max 80 characters) and add the task to it. Cannot be combined with --task-drop."
|
|
1816
|
+
).option(
|
|
1817
|
+
"--new-task-drop-description <text>",
|
|
1818
|
+
"Description for the --new-task-drop drop (optional, max 500 characters)"
|
|
1819
|
+
).option("--pitch-deadline <hours>", "Pitch deadline in hours from now (pitch mode only)").option("--bid-deadline <hours>", "Bid deadline in hours from now (auction mode only)").option(
|
|
1710
1820
|
"--max-price <amount>",
|
|
1711
1821
|
"Maximum bid price in the payment token (required for auction mode)"
|
|
1712
1822
|
).option(
|
|
@@ -1720,7 +1830,7 @@ var createCmd = new Command8("create").description("Create a new task (costs the
|
|
|
1720
1830
|
"Floor price in the payment token for dutch clock (required for dutch)"
|
|
1721
1831
|
).option(
|
|
1722
1832
|
"--hook <address>",
|
|
1723
|
-
"Custom ITMPHook contract address (repeat in execution order; protocol defaults run first)",
|
|
1833
|
+
"Custom ITMPHook contract address (repeat in execution order; protocol defaults run first). Run `taskmarket hooks list` for hooks listed (verified) in the hook registry; an unlisted address is still attached, with a hook_unlisted warning",
|
|
1724
1834
|
(value, previous = []) => [...previous, value],
|
|
1725
1835
|
[]
|
|
1726
1836
|
).option(
|
|
@@ -1870,6 +1980,10 @@ var createCmd = new Command8("create").description("Create a new task (costs the
|
|
|
1870
1980
|
);
|
|
1871
1981
|
}
|
|
1872
1982
|
}
|
|
1983
|
+
const metricAndDrop = parseMetricAndDropOptions(opts);
|
|
1984
|
+
if ("error" in metricAndDrop) {
|
|
1985
|
+
return void printError(metricAndDrop.error);
|
|
1986
|
+
}
|
|
1873
1987
|
const stakeFlags = parseStakeOptions(opts);
|
|
1874
1988
|
if ("error" in stakeFlags) {
|
|
1875
1989
|
return void printError(stakeFlags.error);
|
|
@@ -1895,6 +2009,7 @@ var createCmd = new Command8("create").description("Create a new task (costs the
|
|
|
1895
2009
|
if (opts.accessPassword) {
|
|
1896
2010
|
body.accessPassword = opts.accessPassword;
|
|
1897
2011
|
}
|
|
2012
|
+
Object.assign(body, metricAndDrop.fields);
|
|
1898
2013
|
if (opts.pitchDeadline) {
|
|
1899
2014
|
body.pitchDeadline = parseInt(opts.pitchDeadline, 10) * 3600;
|
|
1900
2015
|
}
|
|
@@ -2092,6 +2207,10 @@ var createCmd = new Command8("create").description("Create a new task (costs the
|
|
|
2092
2207
|
} catch {
|
|
2093
2208
|
}
|
|
2094
2209
|
}
|
|
2210
|
+
const hookListings = await describeHookListings(
|
|
2211
|
+
hooks,
|
|
2212
|
+
sponsoredTaskHookAddress ? [sponsoredTaskHookAddress] : []
|
|
2213
|
+
);
|
|
2095
2214
|
let feeBps;
|
|
2096
2215
|
if (opts.evaluator) {
|
|
2097
2216
|
if (!ethAddrRe.test(opts.evaluator)) {
|
|
@@ -2133,9 +2252,14 @@ var createCmd = new Command8("create").description("Create a new task (costs the
|
|
|
2133
2252
|
taskId: result.taskId,
|
|
2134
2253
|
terms,
|
|
2135
2254
|
termsPreset: termsPresetLabel(terms),
|
|
2136
|
-
...
|
|
2255
|
+
...result.taskDropId ? { taskDropId: result.taskDropId } : {},
|
|
2256
|
+
...evaluatorStaked ? { evaluatorStake: evaluatorStakeBaseUnits } : {},
|
|
2257
|
+
...hookListings && hookListings.hooks.length > 0 ? { hooks: hookListings.hooks } : {}
|
|
2137
2258
|
},
|
|
2138
|
-
{
|
|
2259
|
+
{
|
|
2260
|
+
idempotencyKey,
|
|
2261
|
+
...hookListings && hookListings.warnings.length > 0 ? { warnings: hookListings.warnings } : {}
|
|
2262
|
+
}
|
|
2139
2263
|
);
|
|
2140
2264
|
}
|
|
2141
2265
|
);
|
|
@@ -3484,7 +3608,7 @@ taskCommand2.addCommand(releaseCmd);
|
|
|
3484
3608
|
taskCommand2.addCommand(requestRevisionCmd);
|
|
3485
3609
|
taskCommand2.addCommand(rejectCmd);
|
|
3486
3610
|
taskCommand2.addCommand(settleCmd);
|
|
3487
|
-
taskCommand2.addCommand(reviewCmd);
|
|
3611
|
+
taskCommand2.addCommand(reviewCmd, { hidden: true });
|
|
3488
3612
|
taskCommand2.addCommand(startReviewCmd);
|
|
3489
3613
|
|
|
3490
3614
|
// src/commands/agent/index.ts
|
|
@@ -3693,7 +3817,7 @@ async function runAgentCommand(options) {
|
|
|
3693
3817
|
try {
|
|
3694
3818
|
const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
|
|
3695
3819
|
const pi = assertAgentCompatibility();
|
|
3696
|
-
const { runAgent } = await import("./launch-
|
|
3820
|
+
const { runAgent } = await import("./launch-Q67U5TZE.js");
|
|
3697
3821
|
result = await runAgent({
|
|
3698
3822
|
model: options.model,
|
|
3699
3823
|
pi,
|
|
@@ -3752,13 +3876,13 @@ function agentManagementCommands() {
|
|
|
3752
3876
|
const status = new Command48("status").description(
|
|
3753
3877
|
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
3754
3878
|
).option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
3755
|
-
const { collectAgentStatus, statusLines } = await import("./status-
|
|
3879
|
+
const { collectAgentStatus, statusLines } = await import("./status-5PXMF7RK.js");
|
|
3756
3880
|
await run(options, () => collectAgentStatus(), statusLines);
|
|
3757
3881
|
});
|
|
3758
3882
|
const doctor = new Command48("doctor").description(
|
|
3759
3883
|
"Check that the agent can start: Node and the bundled runtime, wallet and policy, channels, API, sandbox broker, host keys, xgate and RPC. Reads only."
|
|
3760
3884
|
).option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
3761
|
-
const { runDoctor, doctorLines } = await import("./doctor-
|
|
3885
|
+
const { runDoctor, doctorLines } = await import("./doctor-FCQZBQFU.js");
|
|
3762
3886
|
const report = await run(options, () => runDoctor(), doctorLines);
|
|
3763
3887
|
if (report && !report.ok) process.exitCode = 1;
|
|
3764
3888
|
});
|
|
@@ -3769,7 +3893,7 @@ function agentManagementCommands() {
|
|
|
3769
3893
|
"Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
|
|
3770
3894
|
).option("--json", "Print the versioned JSON envelope").action(
|
|
3771
3895
|
async (invocationId, options) => {
|
|
3772
|
-
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-
|
|
3896
|
+
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-NBIZBPVA.js");
|
|
3773
3897
|
const choice = { rail: options.rail, channel: options.channel };
|
|
3774
3898
|
if (invocationId !== void 0) {
|
|
3775
3899
|
await run(
|
|
@@ -3827,7 +3951,7 @@ function agentManagementCommands() {
|
|
|
3827
3951
|
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
3828
3952
|
);
|
|
3829
3953
|
}
|
|
3830
|
-
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-
|
|
3954
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-KCVGG62H.js");
|
|
3831
3955
|
const { rails } = await openAgentChannels();
|
|
3832
3956
|
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
3833
3957
|
return {
|
|
@@ -3851,8 +3975,8 @@ function agentManagementCommands() {
|
|
|
3851
3975
|
async () => {
|
|
3852
3976
|
await requireExperimental();
|
|
3853
3977
|
const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
3854
|
-
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-
|
|
3855
|
-
const { reconcileLeasedPurchase } = await import("./reconcile-
|
|
3978
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-KCVGG62H.js");
|
|
3979
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-NBIZBPVA.js");
|
|
3856
3980
|
const opened = await openAgentChannels();
|
|
3857
3981
|
const { rail, retired } = selectChannel(opened, options);
|
|
3858
3982
|
const result = await closeChannel(
|
|
@@ -3923,7 +4047,7 @@ function agentManagementCommands() {
|
|
|
3923
4047
|
options,
|
|
3924
4048
|
async () => {
|
|
3925
4049
|
await requireExperimental();
|
|
3926
|
-
const { runPull } = await import("./sync-pull-
|
|
4050
|
+
const { runPull } = await import("./sync-pull-BY4QUY4T.js");
|
|
3927
4051
|
const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
|
|
3928
4052
|
return runPull(options, {
|
|
3929
4053
|
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY) && !options.json,
|
|
@@ -4430,14 +4554,17 @@ var walletImportCommand = new Command55("import").description("Import an existin
|
|
|
4430
4554
|
);
|
|
4431
4555
|
}
|
|
4432
4556
|
}
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4557
|
+
printResult(
|
|
4558
|
+
{ address, agentId },
|
|
4559
|
+
{
|
|
4560
|
+
warnings: keySource === "flag" ? [
|
|
4561
|
+
cliWarning(
|
|
4562
|
+
"private_key_in_argv",
|
|
4563
|
+
"Private key was passed via --key flag and may be visible in shell history and ps aux."
|
|
4564
|
+
)
|
|
4565
|
+
] : []
|
|
4566
|
+
}
|
|
4567
|
+
);
|
|
4441
4568
|
});
|
|
4442
4569
|
|
|
4443
4570
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
@@ -4480,12 +4607,16 @@ async function fetchWithdrawalAddress(address, chainId) {
|
|
|
4480
4607
|
function noWithdrawalAddressMessage(chainId) {
|
|
4481
4608
|
return `No withdrawal address set on chain ${chainId}. The withdrawal address is per chain; run: ${taskmarketCommandFor(chainId)} wallet set-withdrawal-address <address>`;
|
|
4482
4609
|
}
|
|
4483
|
-
async function verifyWithdrawalAddress(keystore, chainId, serverAddress,
|
|
4610
|
+
async function verifyWithdrawalAddress(keystore, chainId, serverAddress, warnings) {
|
|
4484
4611
|
const pinned = pinnedWithdrawalAddress(keystore, chainId);
|
|
4485
4612
|
if (!pinned) {
|
|
4486
4613
|
await pinWithdrawalAddress(keystore, chainId, serverAddress);
|
|
4487
|
-
|
|
4488
|
-
|
|
4614
|
+
warnings.push(
|
|
4615
|
+
cliWarning(
|
|
4616
|
+
"withdrawal_address_pinned",
|
|
4617
|
+
`Pinned withdrawal address ${serverAddress} for chain ${chainId} in the local keystore.`,
|
|
4618
|
+
{ chainId, withdrawalAddress: serverAddress }
|
|
4619
|
+
)
|
|
4489
4620
|
);
|
|
4490
4621
|
return serverAddress;
|
|
4491
4622
|
}
|
|
@@ -4560,10 +4691,18 @@ var setWithdrawalAddressCommand = new Command56("set-withdrawal-address").descri
|
|
|
4560
4691
|
{
|
|
4561
4692
|
chainId: actedOn,
|
|
4562
4693
|
withdrawalAddress: result.withdrawalAddress,
|
|
4563
|
-
accountRecoveryCode: result.accountRecoveryCode
|
|
4564
|
-
warning: `SAVE THIS ACCOUNT RECOVERY CODE NOW. It is the recovery code for chain ${actedOn} only, will never be shown again, and there is no way to recover it if lost -- this chain's withdrawal address could then never be changed again. Save it in more than one independent place (e.g. a password manager entry AND a printed copy).`
|
|
4694
|
+
accountRecoveryCode: result.accountRecoveryCode
|
|
4565
4695
|
},
|
|
4566
|
-
{
|
|
4696
|
+
{
|
|
4697
|
+
idempotencyKey,
|
|
4698
|
+
warnings: [
|
|
4699
|
+
cliWarning(
|
|
4700
|
+
"recovery_code_shown_once",
|
|
4701
|
+
`SAVE THIS ACCOUNT RECOVERY CODE NOW. It is the recovery code for chain ${actedOn} only, will never be shown again, and there is no way to recover it if lost -- this chain's withdrawal address could then never be changed again. Save it in more than one independent place (e.g. a password manager entry AND a printed copy).`,
|
|
4702
|
+
{ chainId: actedOn }
|
|
4703
|
+
)
|
|
4704
|
+
]
|
|
4705
|
+
}
|
|
4567
4706
|
);
|
|
4568
4707
|
});
|
|
4569
4708
|
|
|
@@ -4628,10 +4767,18 @@ var changeWithdrawalAddressCommand = new Command58("change-withdrawal-address").
|
|
|
4628
4767
|
{
|
|
4629
4768
|
chainId: actedOn,
|
|
4630
4769
|
withdrawalAddress: result.withdrawalAddress,
|
|
4631
|
-
accountRecoveryCode: result.accountRecoveryCode
|
|
4632
|
-
warning: `SAVE THIS NEW ACCOUNT RECOVERY CODE NOW. It is the recovery code for chain ${actedOn} only. The code you just used is no longer valid on this chain. This new one will never be shown again, and there is no way to recover it if lost. Save it in more than one independent place (e.g. a password manager entry AND a printed copy).`
|
|
4770
|
+
accountRecoveryCode: result.accountRecoveryCode
|
|
4633
4771
|
},
|
|
4634
|
-
{
|
|
4772
|
+
{
|
|
4773
|
+
idempotencyKey,
|
|
4774
|
+
warnings: [
|
|
4775
|
+
cliWarning(
|
|
4776
|
+
"recovery_code_shown_once",
|
|
4777
|
+
`SAVE THIS NEW ACCOUNT RECOVERY CODE NOW. It is the recovery code for chain ${actedOn} only. The code you just used is no longer valid on this chain. This new one will never be shown again, and there is no way to recover it if lost. Save it in more than one independent place (e.g. a password manager entry AND a printed copy).`,
|
|
4778
|
+
{ chainId: actedOn }
|
|
4779
|
+
)
|
|
4780
|
+
]
|
|
4781
|
+
}
|
|
4635
4782
|
);
|
|
4636
4783
|
});
|
|
4637
4784
|
|
|
@@ -4694,10 +4841,18 @@ var revealRecoveryCodeCommand = new Command60("reveal-recovery-code").descriptio
|
|
|
4694
4841
|
printResult(
|
|
4695
4842
|
{
|
|
4696
4843
|
chainId: actedOn,
|
|
4697
|
-
accountRecoveryCode: result.accountRecoveryCode
|
|
4698
|
-
warning: `SAVE THIS ACCOUNT RECOVERY CODE NOW. It is the recovery code for chain ${actedOn} only, will never be shown again, and there is no way to recover it if lost -- this chain's withdrawal address could then never be changed again. Save it in more than one independent place (e.g. a password manager entry AND a printed copy).`
|
|
4844
|
+
accountRecoveryCode: result.accountRecoveryCode
|
|
4699
4845
|
},
|
|
4700
|
-
{
|
|
4846
|
+
{
|
|
4847
|
+
idempotencyKey,
|
|
4848
|
+
warnings: [
|
|
4849
|
+
cliWarning(
|
|
4850
|
+
"recovery_code_shown_once",
|
|
4851
|
+
`SAVE THIS ACCOUNT RECOVERY CODE NOW. It is the recovery code for chain ${actedOn} only, will never be shown again, and there is no way to recover it if lost -- this chain's withdrawal address could then never be changed again. Save it in more than one independent place (e.g. a password manager entry AND a printed copy).`,
|
|
4852
|
+
{ chainId: actedOn }
|
|
4853
|
+
)
|
|
4854
|
+
]
|
|
4855
|
+
}
|
|
4701
4856
|
);
|
|
4702
4857
|
});
|
|
4703
4858
|
|
|
@@ -4760,6 +4915,7 @@ var withdrawDreamsCommand = new Command62("withdraw-dreams").description("Withdr
|
|
|
4760
4915
|
);
|
|
4761
4916
|
return;
|
|
4762
4917
|
}
|
|
4918
|
+
const warnings = [];
|
|
4763
4919
|
if (!destination) {
|
|
4764
4920
|
let addressResponse;
|
|
4765
4921
|
try {
|
|
@@ -4776,7 +4932,8 @@ var withdrawDreamsCommand = new Command62("withdraw-dreams").description("Withdr
|
|
|
4776
4932
|
destination = await verifyWithdrawalAddress(
|
|
4777
4933
|
keystore,
|
|
4778
4934
|
balance.chainId,
|
|
4779
|
-
addressResponse.withdrawalAddress
|
|
4935
|
+
addressResponse.withdrawalAddress,
|
|
4936
|
+
warnings
|
|
4780
4937
|
);
|
|
4781
4938
|
} catch (err) {
|
|
4782
4939
|
renderFailure(err);
|
|
@@ -4814,7 +4971,7 @@ var withdrawDreamsCommand = new Command62("withdraw-dreams").description("Withdr
|
|
|
4814
4971
|
dreamsPerUsdc: result.dreamsPerUsdc,
|
|
4815
4972
|
usdEquivalent: result.usdEquivalent
|
|
4816
4973
|
},
|
|
4817
|
-
{ idempotencyKey }
|
|
4974
|
+
{ idempotencyKey, warnings }
|
|
4818
4975
|
);
|
|
4819
4976
|
});
|
|
4820
4977
|
|
|
@@ -5086,11 +5243,13 @@ var withdrawCommand = new Command65("withdraw").description(
|
|
|
5086
5243
|
return;
|
|
5087
5244
|
}
|
|
5088
5245
|
let withdrawalAddress;
|
|
5246
|
+
const warnings = [];
|
|
5089
5247
|
try {
|
|
5090
5248
|
withdrawalAddress = await verifyWithdrawalAddress(
|
|
5091
5249
|
keystore,
|
|
5092
5250
|
chainId,
|
|
5093
|
-
addressResponse.withdrawalAddress
|
|
5251
|
+
addressResponse.withdrawalAddress,
|
|
5252
|
+
warnings
|
|
5094
5253
|
);
|
|
5095
5254
|
} catch (err) {
|
|
5096
5255
|
renderFailure(err);
|
|
@@ -5103,7 +5262,7 @@ var withdrawCommand = new Command65("withdraw").description(
|
|
|
5103
5262
|
withdrawalAddress,
|
|
5104
5263
|
amountBaseUnits
|
|
5105
5264
|
});
|
|
5106
|
-
printResult(withdrawOutput(result2, chainId), { idempotencyKey: idempotencyKey2 });
|
|
5265
|
+
printResult(withdrawOutput(result2, chainId), { idempotencyKey: idempotencyKey2, warnings });
|
|
5107
5266
|
return;
|
|
5108
5267
|
}
|
|
5109
5268
|
let domain;
|
|
@@ -5141,7 +5300,7 @@ var withdrawCommand = new Command65("withdraw").description(
|
|
|
5141
5300
|
signature
|
|
5142
5301
|
}
|
|
5143
5302
|
);
|
|
5144
|
-
printResult(withdrawOutput(result, chainId), { idempotencyKey });
|
|
5303
|
+
printResult(withdrawOutput(result, chainId), { idempotencyKey, warnings });
|
|
5145
5304
|
});
|
|
5146
5305
|
|
|
5147
5306
|
// src/commands/encrypt.ts
|
|
@@ -11243,11 +11402,13 @@ var sponsoredTaskClaimCommand = new Command108("claim").description("Claim your
|
|
|
11243
11402
|
return;
|
|
11244
11403
|
}
|
|
11245
11404
|
let destination;
|
|
11405
|
+
const warnings = [];
|
|
11246
11406
|
try {
|
|
11247
11407
|
destination = await verifyWithdrawalAddress(
|
|
11248
11408
|
keystore,
|
|
11249
11409
|
vault.chainId,
|
|
11250
|
-
addressResponse.withdrawalAddress
|
|
11410
|
+
addressResponse.withdrawalAddress,
|
|
11411
|
+
warnings
|
|
11251
11412
|
);
|
|
11252
11413
|
} catch (err) {
|
|
11253
11414
|
renderFailure(err);
|
|
@@ -11306,7 +11467,7 @@ var sponsoredTaskClaimCommand = new Command108("claim").description("Claim your
|
|
|
11306
11467
|
proof: entitlement.proof
|
|
11307
11468
|
}
|
|
11308
11469
|
);
|
|
11309
|
-
printResult(result, { idempotencyKey });
|
|
11470
|
+
printResult(result, { idempotencyKey, warnings });
|
|
11310
11471
|
});
|
|
11311
11472
|
|
|
11312
11473
|
// src/commands/sponsored-task/rewards.ts
|
|
@@ -11447,20 +11608,35 @@ var dropsCommand = new Command111("drops").description("Browse Task Drops and ma
|
|
|
11447
11608
|
|
|
11448
11609
|
// src/commands/hooks.ts
|
|
11449
11610
|
import { Command as Command112 } from "commander";
|
|
11450
|
-
var listCommand5 = new Command112("list").description(
|
|
11611
|
+
var listCommand5 = new Command112("list").description(
|
|
11612
|
+
"List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
|
|
11613
|
+
).option("--limit <n>", "Maximum unlisted observed hooks to return (1-100)", "50").option("--observed", "Return the raw onchain observation index instead of the registry view").action(async (opts) => {
|
|
11451
11614
|
try {
|
|
11452
11615
|
const input = parseInput(HookIndexInputSchema, { limit: optionalInt(opts.limit) });
|
|
11453
|
-
|
|
11616
|
+
if (opts.observed) {
|
|
11617
|
+
printResult(await apiGet(withChainId(`/api/hooks?limit=${input.limit}`)));
|
|
11618
|
+
return;
|
|
11619
|
+
}
|
|
11620
|
+
const registry = await fetchHookRegistry();
|
|
11621
|
+
printResult({ ...registry, unlisted: registry.unlisted.slice(0, input.limit) });
|
|
11454
11622
|
} catch (err) {
|
|
11455
11623
|
renderFailure(err);
|
|
11456
11624
|
}
|
|
11457
11625
|
});
|
|
11458
|
-
var showCommand3 = new Command112("show").description(
|
|
11626
|
+
var showCommand3 = new Command112("show").description(
|
|
11627
|
+
"Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
|
|
11628
|
+
).argument("<address>", "Hook contract address").action(async (address) => {
|
|
11459
11629
|
try {
|
|
11460
11630
|
const input = parseInput(HookGetInputSchema, { address });
|
|
11461
|
-
const
|
|
11462
|
-
|
|
11463
|
-
|
|
11631
|
+
const registry = await fetchHookRegistry(input.address.toLowerCase());
|
|
11632
|
+
const wanted = input.address.toLowerCase();
|
|
11633
|
+
const listed = registry.listed.find((hook) => hook.address.toLowerCase() === wanted);
|
|
11634
|
+
const unlisted = registry.unlisted.find((hook) => hook.address.toLowerCase() === wanted);
|
|
11635
|
+
const result = listed ?? unlisted;
|
|
11636
|
+
if (!result) {
|
|
11637
|
+
throw new Error(
|
|
11638
|
+
`Hook ${input.address} is not listed in the hook registry and has not been observed on this network`
|
|
11639
|
+
);
|
|
11464
11640
|
}
|
|
11465
11641
|
printResult(result);
|
|
11466
11642
|
} catch (err) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
recordSessionEnd,
|
|
8
8
|
recordSessionStart,
|
|
9
9
|
uploadPlan
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IPJKSTNW.js";
|
|
11
11
|
import {
|
|
12
12
|
TaskOperationError,
|
|
13
13
|
authorizeUploads,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
submitUploadedArtifacts,
|
|
29
29
|
taskAccessGrantHeaders,
|
|
30
30
|
taskAwardsOf
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-EE7LLCQY.js";
|
|
32
32
|
import {
|
|
33
33
|
terminalPrompter
|
|
34
34
|
} from "./chunk-ZIC2YCLV.js";
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
sha256Hex,
|
|
69
69
|
specHash,
|
|
70
70
|
taskStage
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-E7Y4UDXH.js";
|
|
72
72
|
import {
|
|
73
73
|
BrokerConnector,
|
|
74
74
|
OutputLimitError,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
serveSandboxChannel,
|
|
81
81
|
withFileLock,
|
|
82
82
|
writeAtomic
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-VKQBB6CG.js";
|
|
84
84
|
import {
|
|
85
85
|
applyComputeCreditSetup,
|
|
86
86
|
atomicToUsd,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
planComputeCreditSetup,
|
|
91
91
|
readComputeCreditBalance,
|
|
92
92
|
usdToAtomic
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-I6DSFR3I.js";
|
|
94
94
|
import {
|
|
95
95
|
MAX_RETIRED_RAILS,
|
|
96
96
|
WORKSPACE_CONSENT_VERSION,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
routeOfCatalogRow,
|
|
111
111
|
saveAgentPolicy,
|
|
112
112
|
settledRetiredRails
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-DT7AD52I.js";
|
|
114
114
|
import {
|
|
115
115
|
BASE_CHANNEL_RAIL_ID,
|
|
116
116
|
createBaseChannelPayer,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
rpcUrlForNetwork,
|
|
125
125
|
saveX402Policy,
|
|
126
126
|
x402SpendWindowAvailability
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-3YYDUJV4.js";
|
|
128
128
|
import {
|
|
129
129
|
IntentStatusResponseSchema,
|
|
130
130
|
NetworkChainInfoSchema,
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
piCodingAgentTools,
|
|
138
138
|
selectedNetwork,
|
|
139
139
|
taskmarketChain
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-DZMMROHT.js";
|
|
141
141
|
import {
|
|
142
142
|
AGENT_VIEW_VERSION,
|
|
143
143
|
describeFailureDetail,
|