@lucid-agents/taskmarket 1.17.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.
- package/dist/agent-compatibility.json +1 -1
- package/dist/budget-view-XKZC3GY5.js +36 -0
- package/dist/channels-Q7XMSUSO.js +29 -0
- package/dist/{chunk-3XPF2O6L.js → chunk-3S63AB3C.js} +3285 -4277
- package/dist/chunk-73RXOYME.js +185 -0
- package/dist/chunk-EIHZYRIU.js +1099 -0
- package/dist/chunk-F5SS4NUF.js +1062 -0
- package/dist/chunk-JAZ5BWPB.js +181 -0
- package/dist/chunk-MI2GPMCZ.js +154 -0
- package/dist/{compatibility-F3RC2GX7.js → chunk-OKZ2NRYZ.js} +5 -5
- package/dist/{chunk-O27J7ZPH.js → chunk-YM4S6IE4.js} +2 -1
- package/dist/compatibility-KUYGZSUC.js +19 -0
- package/dist/doctor-BY2PBHS7.js +216 -0
- package/dist/{errors-F3EGNA4F.js → errors-2L357HGA.js} +1 -1
- package/dist/index.js +264 -128
- package/dist/{launch-EZJGJJ5Y.js → launch-DE65XO5C.js} +1414 -700
- package/dist/pi-extensions/xgate.cjs +310 -5
- package/dist/reconcile-VEMPNIAO.js +83 -0
- package/dist/status-3Q55PBFC.js +18 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
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);
|
|
3
|
+
import {
|
|
4
|
+
ComputeCreditError,
|
|
5
|
+
applyComputeCreditSetup,
|
|
6
|
+
assertDenomination,
|
|
7
|
+
buyComputeCredit,
|
|
8
|
+
checkComputeBalance,
|
|
9
|
+
computeCreditStatus,
|
|
10
|
+
disableComputeAutoTopUp,
|
|
11
|
+
executeX402PayRequest,
|
|
12
|
+
failedAfterPayment,
|
|
13
|
+
fetchComputePricing,
|
|
14
|
+
listPendingComputePurchases,
|
|
15
|
+
loadComputeCreditConfig,
|
|
16
|
+
loadExternalHeaders,
|
|
17
|
+
mppPost,
|
|
18
|
+
paidWriteRequest,
|
|
19
|
+
planComputeCreditSetup,
|
|
20
|
+
reconcileX402PaymentById,
|
|
21
|
+
refusedPaidWrite,
|
|
22
|
+
releasePendingComputePurchase,
|
|
23
|
+
resolvePendingComputePurchases,
|
|
24
|
+
x402FeePost
|
|
25
|
+
} from "./chunk-EIHZYRIU.js";
|
|
3
26
|
import {
|
|
4
27
|
AgentMessageEnvelopeSchema,
|
|
5
28
|
ApiError,
|
|
6
|
-
ComputeCreditError,
|
|
7
29
|
LegalAcceptanceResponseSchema,
|
|
8
30
|
LegalBundleSchema,
|
|
9
31
|
LegalChallengeResponseSchema,
|
|
@@ -23,8 +45,6 @@ import {
|
|
|
23
45
|
apiOrigin,
|
|
24
46
|
apiPost,
|
|
25
47
|
apiUrl,
|
|
26
|
-
applyComputeCreditSetup,
|
|
27
|
-
assertDenomination,
|
|
28
48
|
buildClaimMessage,
|
|
29
49
|
buildDeviceRegisterMessage,
|
|
30
50
|
buildForfeitMessage,
|
|
@@ -37,18 +57,11 @@ import {
|
|
|
37
57
|
buildSubmitMessage,
|
|
38
58
|
buildWalletLegalAcceptanceMessage,
|
|
39
59
|
buildWithdrawDreamsMessage,
|
|
40
|
-
buyComputeCredit,
|
|
41
60
|
chainInfoFor,
|
|
42
|
-
checkComputeBalance,
|
|
43
|
-
computeCreditStatus,
|
|
44
61
|
createWalletAccountFromKeystore,
|
|
45
62
|
decryptPrivateKey,
|
|
46
|
-
disableComputeAutoTopUp,
|
|
47
63
|
dreamsToUsd,
|
|
48
64
|
encryptPrivateKey,
|
|
49
|
-
executeX402PayRequest,
|
|
50
|
-
failedAfterPayment,
|
|
51
|
-
fetchComputePricing,
|
|
52
65
|
fetchDeviceKey,
|
|
53
66
|
formatDreams,
|
|
54
67
|
formatUsdcBaseUnits,
|
|
@@ -63,26 +76,16 @@ import {
|
|
|
63
76
|
isInFlightApiError,
|
|
64
77
|
isPendingApiError,
|
|
65
78
|
keystoreExists,
|
|
66
|
-
listPendingComputePurchases,
|
|
67
79
|
listX402Payments,
|
|
68
|
-
loadComputeCreditConfig,
|
|
69
|
-
loadExternalHeaders,
|
|
70
80
|
loadKeystore,
|
|
71
81
|
loadX402Policy,
|
|
72
|
-
mppPost,
|
|
73
82
|
networkToStamp,
|
|
74
|
-
paidWriteRequest,
|
|
75
83
|
paymentProtocolOf,
|
|
76
|
-
planComputeCreditSetup,
|
|
77
84
|
readFailureBody,
|
|
78
85
|
readKeystoreNetwork,
|
|
79
|
-
reconcileX402PaymentById,
|
|
80
|
-
refusedPaidWrite,
|
|
81
|
-
releasePendingComputePurchase,
|
|
82
86
|
removeX402PolicyRule,
|
|
83
87
|
resolveIdempotencyKey,
|
|
84
88
|
resolveNetwork,
|
|
85
|
-
resolvePendingComputePurchases,
|
|
86
89
|
resolveX402PaymentManually,
|
|
87
90
|
saveKeystore,
|
|
88
91
|
selectedNetwork,
|
|
@@ -95,13 +98,15 @@ import {
|
|
|
95
98
|
taskmarketChain,
|
|
96
99
|
usdcToBaseUnits,
|
|
97
100
|
withErrorContext,
|
|
98
|
-
withIdempotentWrite
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
withIdempotentWrite
|
|
102
|
+
} from "./chunk-3S63AB3C.js";
|
|
103
|
+
import {
|
|
104
|
+
channelLines
|
|
105
|
+
} from "./chunk-73RXOYME.js";
|
|
101
106
|
import "./chunk-S7SJMJ2I.js";
|
|
102
107
|
|
|
103
108
|
// src/index.ts
|
|
104
|
-
import { Command as
|
|
109
|
+
import { Command as Command93 } from "commander";
|
|
105
110
|
import { createRequire } from "module";
|
|
106
111
|
|
|
107
112
|
// src/commands/init.ts
|
|
@@ -2324,7 +2329,7 @@ taskCommand.addCommand(uninviteCmd);
|
|
|
2324
2329
|
taskCommand.addCommand(viewersCmd);
|
|
2325
2330
|
|
|
2326
2331
|
// src/commands/agent/index.ts
|
|
2327
|
-
import { Command as
|
|
2332
|
+
import { Command as Command44, Option as Option2 } from "commander";
|
|
2328
2333
|
|
|
2329
2334
|
// src/commands/agent/credits.ts
|
|
2330
2335
|
import { Command as Command42 } from "commander";
|
|
@@ -2524,23 +2529,23 @@ async function runAgentCommand(options) {
|
|
|
2524
2529
|
);
|
|
2525
2530
|
return;
|
|
2526
2531
|
}
|
|
2527
|
-
const { AgentLaunchError } = await import("./errors-
|
|
2532
|
+
const { AgentLaunchError } = await import("./errors-2L357HGA.js");
|
|
2528
2533
|
let result;
|
|
2529
2534
|
try {
|
|
2530
|
-
const { assertAgentCompatibility } = await import("./compatibility-
|
|
2535
|
+
const { assertAgentCompatibility } = await import("./compatibility-KUYGZSUC.js");
|
|
2531
2536
|
const pi = assertAgentCompatibility();
|
|
2532
|
-
const { runAgent } = await import("./launch-
|
|
2537
|
+
const { runAgent } = await import("./launch-DE65XO5C.js");
|
|
2533
2538
|
result = await runAgent({ model: options.model, pi });
|
|
2534
2539
|
} catch (error) {
|
|
2535
2540
|
renderFailure(error, {
|
|
2536
|
-
details: error instanceof AgentLaunchError ? { code: error.code } : void 0
|
|
2541
|
+
details: error instanceof AgentLaunchError ? { ...error.details, code: error.code } : void 0
|
|
2537
2542
|
});
|
|
2538
2543
|
return;
|
|
2539
2544
|
}
|
|
2540
2545
|
if (result.unresolvedInvocations.length > 0 || result.interrupted) {
|
|
2541
2546
|
renderFailure(
|
|
2542
2547
|
new Error(
|
|
2543
|
-
result.unresolvedInvocations.length > 0 ?
|
|
2548
|
+
result.unresolvedInvocations.length > 0 ? `The session ended with purchases whose outcome is unknown: ${result.unresolvedInvocations.join(", ")}. They are never sent again; reconcile each with taskmarket agent reconcile <invocation-id> before buying more. If one was charged, its response cannot be recovered or regenerated: xgate delivers it live only and keeps no copy.` : "The session was interrupted"
|
|
2544
2549
|
),
|
|
2545
2550
|
{
|
|
2546
2551
|
details: {
|
|
@@ -2554,9 +2559,137 @@ async function runAgentCommand(options) {
|
|
|
2554
2559
|
process.exitCode = result.exitCode || process.exitCode || 0;
|
|
2555
2560
|
}
|
|
2556
2561
|
|
|
2562
|
+
// src/commands/agent/manage.ts
|
|
2563
|
+
import { Command as Command43 } from "commander";
|
|
2564
|
+
async function run(options, work, lines) {
|
|
2565
|
+
try {
|
|
2566
|
+
const value = await work();
|
|
2567
|
+
if (options.json) printResult(value);
|
|
2568
|
+
else process.stdout.write(`${lines(value).join("\n")}
|
|
2569
|
+
`);
|
|
2570
|
+
return value;
|
|
2571
|
+
} catch (error) {
|
|
2572
|
+
const { AgentLaunchError } = await import("./errors-2L357HGA.js");
|
|
2573
|
+
renderFailure(error, {
|
|
2574
|
+
details: error instanceof AgentLaunchError ? { code: error.code } : void 0
|
|
2575
|
+
});
|
|
2576
|
+
return void 0;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
async function requireExperimental() {
|
|
2580
|
+
if (agentCommandEnabled()) return;
|
|
2581
|
+
const { AgentLaunchError } = await import("./errors-2L357HGA.js");
|
|
2582
|
+
throw new AgentLaunchError(
|
|
2583
|
+
"experimental_command_disabled",
|
|
2584
|
+
`taskmarket agent is experimental and not available yet. Set ${EXPERIMENTAL_AGENT_ENV}=1 to try it.`
|
|
2585
|
+
);
|
|
2586
|
+
}
|
|
2587
|
+
function agentManagementCommands() {
|
|
2588
|
+
const status = new Command43("status").description(
|
|
2589
|
+
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
2590
|
+
).option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
2591
|
+
const { collectAgentStatus, statusLines } = await import("./status-3Q55PBFC.js");
|
|
2592
|
+
await run(options, () => collectAgentStatus(), statusLines);
|
|
2593
|
+
});
|
|
2594
|
+
const doctor = new Command43("doctor").description(
|
|
2595
|
+
"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."
|
|
2596
|
+
).option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
2597
|
+
const { runDoctor, doctorLines } = await import("./doctor-BY2PBHS7.js");
|
|
2598
|
+
const report = await run(options, () => runDoctor(), doctorLines);
|
|
2599
|
+
if (report && !report.ok) process.exitCode = 1;
|
|
2600
|
+
});
|
|
2601
|
+
const reconcile = new Command43("reconcile").description(
|
|
2602
|
+
"Decide an agent purchase whose outcome is unknown, by its invocation ID. Never sends it again."
|
|
2603
|
+
).argument("<invocation-id>", "The purchase, as status or the agent named it").option("--json", "Print the versioned JSON envelope").action(async (invocationId, options) => {
|
|
2604
|
+
const { reconcileInvocation } = await import("./reconcile-VEMPNIAO.js");
|
|
2605
|
+
await run(
|
|
2606
|
+
options,
|
|
2607
|
+
() => reconcileInvocation(invocationId),
|
|
2608
|
+
(view) => [`Purchase ${view.invocationId} on ${view.rail}: ${view.outcome}`, view.message]
|
|
2609
|
+
);
|
|
2610
|
+
});
|
|
2611
|
+
const topup = new Command43("topup").description(
|
|
2612
|
+
"Check a channel top-up against the approved budget: within it, the channel deposits by itself with the next turn that needs funds; over it, a new approval is needed"
|
|
2613
|
+
).requiredOption("--amount <usdc>", "Top-up in USDC, e.g. 5 or 2.50").option("--rail <id>", "The rail to top up (required when the policy has more than one)").option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
2614
|
+
await run(
|
|
2615
|
+
options,
|
|
2616
|
+
async () => {
|
|
2617
|
+
await requireExperimental();
|
|
2618
|
+
const { usdcToAtomic, AGENT_VIEW_VERSION } = await import("./budget-view-XKZC3GY5.js");
|
|
2619
|
+
const { AgentLaunchError } = await import("./errors-2L357HGA.js");
|
|
2620
|
+
const amount = usdcToAtomic(options.amount);
|
|
2621
|
+
if (amount === void 0 || amount === "0") {
|
|
2622
|
+
throw new AgentLaunchError(
|
|
2623
|
+
"invalid_amount",
|
|
2624
|
+
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
2625
|
+
);
|
|
2626
|
+
}
|
|
2627
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-Q7XMSUSO.js");
|
|
2628
|
+
const { rails } = await openAgentChannels();
|
|
2629
|
+
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
2630
|
+
return {
|
|
2631
|
+
version: AGENT_VIEW_VERSION,
|
|
2632
|
+
kind: "taskmarket.agent.topup",
|
|
2633
|
+
...result,
|
|
2634
|
+
withdrawal: withdrawalHatch(result.channel)
|
|
2635
|
+
};
|
|
2636
|
+
},
|
|
2637
|
+
(view) => [view.note, ...channelLines(view.channel)]
|
|
2638
|
+
);
|
|
2639
|
+
});
|
|
2640
|
+
const close = new Command43("close").description(
|
|
2641
|
+
"Close the agent's channel and refund its unused balance cooperatively; checks an earlier close instead of sending it again"
|
|
2642
|
+
).option("--rail <id>", "The rail to close (required when the policy has more than one)").option(
|
|
2643
|
+
"--channel <channel-id>",
|
|
2644
|
+
"The channel to close by its ID, as status lists it; also reaches retired channels"
|
|
2645
|
+
).option("--yes", "Skip the confirmation prompt").option("--json", "Print the versioned JSON envelope").action(async (options) => {
|
|
2646
|
+
await run(
|
|
2647
|
+
options,
|
|
2648
|
+
async () => {
|
|
2649
|
+
await requireExperimental();
|
|
2650
|
+
const { AGENT_VIEW_VERSION } = await import("./budget-view-XKZC3GY5.js");
|
|
2651
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-Q7XMSUSO.js");
|
|
2652
|
+
const { rail, retired } = selectChannel(await openAgentChannels(), options);
|
|
2653
|
+
const result = await closeChannel(
|
|
2654
|
+
rail,
|
|
2655
|
+
async (lines) => {
|
|
2656
|
+
if (options.yes) {
|
|
2657
|
+
process.stderr.write(`${lines.join("\n")}
|
|
2658
|
+
`);
|
|
2659
|
+
return true;
|
|
2660
|
+
}
|
|
2661
|
+
return confirmAtTerminal(lines, "pass --yes to close without a prompt");
|
|
2662
|
+
},
|
|
2663
|
+
{ retired }
|
|
2664
|
+
);
|
|
2665
|
+
return {
|
|
2666
|
+
version: AGENT_VIEW_VERSION,
|
|
2667
|
+
kind: "taskmarket.agent.close",
|
|
2668
|
+
...result
|
|
2669
|
+
};
|
|
2670
|
+
},
|
|
2671
|
+
(view) => [
|
|
2672
|
+
{
|
|
2673
|
+
refunded: `Closed: the unused balance of ${view.rail} was refunded to the wallet.`,
|
|
2674
|
+
pending: `The refund of ${view.rail} is not confirmed yet${view.reconciled ? "" : " (sent)"}. Run close again to check it; it is never sent twice.`,
|
|
2675
|
+
failed: `The router refused the refund of ${view.rail}; nothing was returned.`,
|
|
2676
|
+
closed: `The ${view.rail} channel is already closed.`
|
|
2677
|
+
}[view.outcome],
|
|
2678
|
+
...channelLines(view.channel),
|
|
2679
|
+
...view.outcome === "failed" ? [view.withdrawal.note] : [],
|
|
2680
|
+
...view.sessionClosed && !view.retired ? [
|
|
2681
|
+
"It buys nothing more. The next taskmarket agent launch asks to renew the spending policy, which opens a new channel."
|
|
2682
|
+
] : [],
|
|
2683
|
+
...view.dropped ? ["Nothing is left on it, so it was removed from the policy."] : []
|
|
2684
|
+
]
|
|
2685
|
+
);
|
|
2686
|
+
});
|
|
2687
|
+
return [status, doctor, reconcile, topup, close];
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2557
2690
|
// src/commands/agent/index.ts
|
|
2558
2691
|
var experimental = agentCommandEnabled();
|
|
2559
|
-
var agentCommand = new
|
|
2692
|
+
var agentCommand = new Command44("agent").description(
|
|
2560
2693
|
experimental ? "The Taskmarket agent and the compute it runs on. Without a subcommand (experimental), open Pi's interactive coding agent in this project, with paid xgate inference from your wallet and tools in your cloud sandbox" : "The Taskmarket agent and the compute it runs on"
|
|
2561
2694
|
).addOption(
|
|
2562
2695
|
new Option2("--model <id>", "Start on one model from your approved spending policy").hideHelp(
|
|
@@ -2570,10 +2703,13 @@ if (experimental) {
|
|
|
2570
2703
|
);
|
|
2571
2704
|
}
|
|
2572
2705
|
agentCommand.addCommand(agentCreditsCommand);
|
|
2706
|
+
for (const command of agentManagementCommands()) {
|
|
2707
|
+
agentCommand.addCommand(command, { hidden: !experimental });
|
|
2708
|
+
}
|
|
2573
2709
|
|
|
2574
2710
|
// src/commands/agents.ts
|
|
2575
|
-
import { Command as
|
|
2576
|
-
var agentsCommand = new
|
|
2711
|
+
import { Command as Command45 } from "commander";
|
|
2712
|
+
var agentsCommand = new Command45("agents").description("Browse the agent directory").option("--sort <order>", "Sort order: reputation or tasks", "reputation").option("--skill <tag>", "Filter by skill tag").option("--search <query>", "Search by agentId or wallet address").option("--limit <n>", "Maximum results to return", "20").action(async (opts) => {
|
|
2577
2713
|
const params = new URLSearchParams();
|
|
2578
2714
|
if (opts.sort) params.set("sort", opts.sort);
|
|
2579
2715
|
if (opts.skill) params.set("skill", opts.skill);
|
|
@@ -2584,8 +2720,8 @@ var agentsCommand = new Command44("agents").description("Browse the agent direct
|
|
|
2584
2720
|
});
|
|
2585
2721
|
|
|
2586
2722
|
// src/commands/inbox.ts
|
|
2587
|
-
import { Command as
|
|
2588
|
-
var inboxCommand = new
|
|
2723
|
+
import { Command as Command46 } from "commander";
|
|
2724
|
+
var inboxCommand = new Command46("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
|
|
2589
2725
|
const auth = await signReadAuth();
|
|
2590
2726
|
if (!auth) {
|
|
2591
2727
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -2606,8 +2742,8 @@ var inboxCommand = new Command45("inbox").description("Show tasks you created an
|
|
|
2606
2742
|
});
|
|
2607
2743
|
|
|
2608
2744
|
// src/commands/actions.ts
|
|
2609
|
-
import { Command as
|
|
2610
|
-
var actionsCommand = new
|
|
2745
|
+
import { Command as Command47 } from "commander";
|
|
2746
|
+
var actionsCommand = new Command47("actions").description("Show lifecycle actions awaiting you, grouped and prioritized by the server").action(async () => {
|
|
2611
2747
|
const auth = await signReadAuth();
|
|
2612
2748
|
if (!auth) {
|
|
2613
2749
|
printError("No keystore found. Run `taskmarket init` first.");
|
|
@@ -2621,8 +2757,8 @@ var actionsCommand = new Command46("actions").description("Show lifecycle action
|
|
|
2621
2757
|
});
|
|
2622
2758
|
|
|
2623
2759
|
// src/commands/deposit.ts
|
|
2624
|
-
import { Command as
|
|
2625
|
-
var depositCommand = new
|
|
2760
|
+
import { Command as Command48 } from "commander";
|
|
2761
|
+
var depositCommand = new Command48("deposit").description("Show wallet address and network info for funding").action(async () => {
|
|
2626
2762
|
let address;
|
|
2627
2763
|
try {
|
|
2628
2764
|
address = await getWalletAddress();
|
|
@@ -2649,11 +2785,11 @@ var depositCommand = new Command47("deposit").description("Show wallet address a
|
|
|
2649
2785
|
});
|
|
2650
2786
|
|
|
2651
2787
|
// src/commands/wallet/index.ts
|
|
2652
|
-
import { Command as
|
|
2788
|
+
import { Command as Command57 } from "commander";
|
|
2653
2789
|
|
|
2654
2790
|
// src/commands/wallet/balance.ts
|
|
2655
|
-
import { Command as
|
|
2656
|
-
var walletBalanceCommand = new
|
|
2791
|
+
import { Command as Command49 } from "commander";
|
|
2792
|
+
var walletBalanceCommand = new Command49("balance").description("Show USDC balance").option("--address <addr>", "Address to check (defaults to own wallet)").action(async (opts) => {
|
|
2657
2793
|
let address = opts.address;
|
|
2658
2794
|
if (!address) {
|
|
2659
2795
|
const keystore = await loadKeystore();
|
|
@@ -2664,7 +2800,7 @@ var walletBalanceCommand = new Command48("balance").description("Show USDC balan
|
|
|
2664
2800
|
});
|
|
2665
2801
|
|
|
2666
2802
|
// src/commands/wallet/import.ts
|
|
2667
|
-
import { Command as
|
|
2803
|
+
import { Command as Command50 } from "commander";
|
|
2668
2804
|
import { createInterface as createInterface3 } from "readline";
|
|
2669
2805
|
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
2670
2806
|
function normalizePrivateKey(raw) {
|
|
@@ -2699,7 +2835,7 @@ function promptHiddenInput(prompt) {
|
|
|
2699
2835
|
});
|
|
2700
2836
|
});
|
|
2701
2837
|
}
|
|
2702
|
-
var walletImportCommand = new
|
|
2838
|
+
var walletImportCommand = new Command50("import").description("Import an existing private key as the agent wallet").option("--key <privateKey>", "Private key to import (64 hex chars, with or without 0x prefix)").option(
|
|
2703
2839
|
"--yes",
|
|
2704
2840
|
"Confirm legal acceptance non-interactively after reviewing every current policy"
|
|
2705
2841
|
).action(async (opts) => {
|
|
@@ -2779,11 +2915,11 @@ var walletImportCommand = new Command49("import").description("Import an existin
|
|
|
2779
2915
|
});
|
|
2780
2916
|
|
|
2781
2917
|
// src/commands/wallet/set-withdrawal-address.ts
|
|
2782
|
-
import { Command as
|
|
2918
|
+
import { Command as Command51 } from "commander";
|
|
2783
2919
|
function isValidAddress(addr) {
|
|
2784
2920
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
2785
2921
|
}
|
|
2786
|
-
var setWithdrawalAddressCommand = new
|
|
2922
|
+
var setWithdrawalAddressCommand = new Command51("set-withdrawal-address").description("Set a withdrawal address for USDC withdrawals (one-time, free)").argument("<address>", "Ethereum address to receive withdrawals").action(async (address) => {
|
|
2787
2923
|
if (!isValidAddress(address)) {
|
|
2788
2924
|
printError("Invalid Ethereum address: must be 0x followed by 40 hex characters");
|
|
2789
2925
|
return;
|
|
@@ -2814,8 +2950,8 @@ var setWithdrawalAddressCommand = new Command50("set-withdrawal-address").descri
|
|
|
2814
2950
|
});
|
|
2815
2951
|
|
|
2816
2952
|
// src/commands/wallet/get-withdrawal-address.ts
|
|
2817
|
-
import { Command as
|
|
2818
|
-
var getWithdrawalAddressCommand = new
|
|
2953
|
+
import { Command as Command52 } from "commander";
|
|
2954
|
+
var getWithdrawalAddressCommand = new Command52("get-withdrawal-address").description("Show the currently registered withdrawal address, if any").option("--address <addr>", "Wallet address to check (defaults to own wallet)").action(async (opts) => {
|
|
2819
2955
|
let address = opts.address;
|
|
2820
2956
|
if (!address) {
|
|
2821
2957
|
const keystore = await loadKeystore();
|
|
@@ -2826,14 +2962,14 @@ var getWithdrawalAddressCommand = new Command51("get-withdrawal-address").descri
|
|
|
2826
2962
|
});
|
|
2827
2963
|
|
|
2828
2964
|
// src/commands/wallet/change-withdrawal-address.ts
|
|
2829
|
-
import { Command as
|
|
2965
|
+
import { Command as Command53 } from "commander";
|
|
2830
2966
|
function isValidAddress2(addr) {
|
|
2831
2967
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
2832
2968
|
}
|
|
2833
2969
|
function isValidRecoveryCode(code) {
|
|
2834
2970
|
return /^\d{8}$/.test(code);
|
|
2835
2971
|
}
|
|
2836
|
-
var changeWithdrawalAddressCommand = new
|
|
2972
|
+
var changeWithdrawalAddressCommand = new Command53("change-withdrawal-address").description("Change the withdrawal address using the account recovery code (RFC-0012)").argument("<recovery-code>", "The 8-digit account recovery code from set-withdrawal-address").argument("<new-address>", "New Ethereum address to receive withdrawals").action(async (recoveryCode, newAddress) => {
|
|
2837
2973
|
if (!isValidRecoveryCode(recoveryCode)) {
|
|
2838
2974
|
printError("Invalid account recovery code: must be 8 digits");
|
|
2839
2975
|
return;
|
|
@@ -2865,8 +3001,8 @@ var changeWithdrawalAddressCommand = new Command52("change-withdrawal-address").
|
|
|
2865
3001
|
});
|
|
2866
3002
|
|
|
2867
3003
|
// src/commands/wallet/reveal-recovery-code.ts
|
|
2868
|
-
import { Command as
|
|
2869
|
-
var revealRecoveryCodeCommand = new
|
|
3004
|
+
import { Command as Command54 } from "commander";
|
|
3005
|
+
var revealRecoveryCodeCommand = new Command54("reveal-recovery-code").description("One-time reveal of your account recovery code, if one has not been generated yet").action(async () => {
|
|
2870
3006
|
let keystore;
|
|
2871
3007
|
try {
|
|
2872
3008
|
keystore = await loadKeystore();
|
|
@@ -2891,8 +3027,8 @@ var revealRecoveryCodeCommand = new Command53("reveal-recovery-code").descriptio
|
|
|
2891
3027
|
});
|
|
2892
3028
|
|
|
2893
3029
|
// src/commands/wallet/publish-key.ts
|
|
2894
|
-
import { Command as
|
|
2895
|
-
var publishKeyCommand = new
|
|
3030
|
+
import { Command as Command55 } from "commander";
|
|
3031
|
+
var publishKeyCommand = new Command55("publish-key").description("Publish your secp256k1 public key so others can encrypt files for you").action(async () => {
|
|
2896
3032
|
let keystore;
|
|
2897
3033
|
try {
|
|
2898
3034
|
keystore = await loadKeystore();
|
|
@@ -2912,13 +3048,13 @@ var publishKeyCommand = new Command54("publish-key").description("Publish your s
|
|
|
2912
3048
|
});
|
|
2913
3049
|
|
|
2914
3050
|
// src/commands/wallet/withdraw-dreams.ts
|
|
2915
|
-
import { Command as
|
|
3051
|
+
import { Command as Command56 } from "commander";
|
|
2916
3052
|
import { toHex } from "viem";
|
|
2917
3053
|
var AUTHORIZATION_VALIDITY_SECONDS = 300;
|
|
2918
3054
|
function isValidAddress3(addr) {
|
|
2919
3055
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
2920
3056
|
}
|
|
2921
|
-
var withdrawDreamsCommand = new
|
|
3057
|
+
var withdrawDreamsCommand = new Command56("withdraw-dreams").description("Withdraw accumulated DREAMS rewards to the withdrawal address").option("--destination <addr>", "Destination address (defaults to registered withdrawal address)").action(async (opts) => {
|
|
2922
3058
|
let keystore;
|
|
2923
3059
|
try {
|
|
2924
3060
|
keystore = await loadKeystore();
|
|
@@ -2972,7 +3108,7 @@ var withdrawDreamsCommand = new Command55("withdraw-dreams").description("Withdr
|
|
|
2972
3108
|
});
|
|
2973
3109
|
|
|
2974
3110
|
// src/commands/wallet/index.ts
|
|
2975
|
-
var walletCommand = new
|
|
3111
|
+
var walletCommand = new Command57("wallet").description("Wallet management commands");
|
|
2976
3112
|
walletCommand.addCommand(walletBalanceCommand);
|
|
2977
3113
|
walletCommand.addCommand(walletImportCommand);
|
|
2978
3114
|
walletCommand.addCommand(setWithdrawalAddressCommand);
|
|
@@ -2983,7 +3119,7 @@ walletCommand.addCommand(publishKeyCommand);
|
|
|
2983
3119
|
walletCommand.addCommand(withdrawDreamsCommand);
|
|
2984
3120
|
|
|
2985
3121
|
// src/commands/withdraw.ts
|
|
2986
|
-
import { Command as
|
|
3122
|
+
import { Command as Command58 } from "commander";
|
|
2987
3123
|
import { toHex as toHex2 } from "viem";
|
|
2988
3124
|
var RECEIVE_POLICY_BLOCKED = "recipient_receive_policy_blocked";
|
|
2989
3125
|
async function withdrawOnTempo(input) {
|
|
@@ -3030,7 +3166,7 @@ var USDC_TYPES = {
|
|
|
3030
3166
|
{ name: "nonce", type: "bytes32" }
|
|
3031
3167
|
]
|
|
3032
3168
|
};
|
|
3033
|
-
var withdrawCommand = new
|
|
3169
|
+
var withdrawCommand = new Command58("withdraw").description(
|
|
3034
3170
|
"Withdraw the payment token (USDC on Base, OUSD on Tempo) to the registered withdrawal address"
|
|
3035
3171
|
).argument("<amount>", "Amount in whole tokens (e.g. 5 for 5 USDC or 5 OUSD)").action(async (amount) => {
|
|
3036
3172
|
const parsed = parseFloat(amount);
|
|
@@ -3105,9 +3241,9 @@ var withdrawCommand = new Command57("withdraw").description(
|
|
|
3105
3241
|
});
|
|
3106
3242
|
|
|
3107
3243
|
// src/commands/encrypt.ts
|
|
3108
|
-
import { Command as
|
|
3244
|
+
import { Command as Command59 } from "commander";
|
|
3109
3245
|
import { promises as fs2 } from "fs";
|
|
3110
|
-
var encryptCommand = new
|
|
3246
|
+
var encryptCommand = new Command59("encrypt").description("Encrypt a file with ECIES using wallet keys").argument("<file>", "Path to the file to encrypt").option("--recipient <address>", "Recipient wallet address (default: self)").option("--output <path>", "Output path (default: <file>.enc)").action(async (file, opts) => {
|
|
3111
3247
|
let plaintext;
|
|
3112
3248
|
try {
|
|
3113
3249
|
plaintext = await fs2.readFile(file);
|
|
@@ -3155,9 +3291,9 @@ var encryptCommand = new Command58("encrypt").description("Encrypt a file with E
|
|
|
3155
3291
|
});
|
|
3156
3292
|
|
|
3157
3293
|
// src/commands/decrypt.ts
|
|
3158
|
-
import { Command as
|
|
3294
|
+
import { Command as Command60 } from "commander";
|
|
3159
3295
|
import { promises as fs3 } from "fs";
|
|
3160
|
-
var decryptCommand = new
|
|
3296
|
+
var decryptCommand = new Command60("decrypt").description("Decrypt a file using your wallet key").argument("<file>", "Path to the encrypted file").option("--output <path>", "Output path (default: strips .enc, otherwise appends .dec)").action(async (file, opts) => {
|
|
3161
3297
|
let ciphertext;
|
|
3162
3298
|
try {
|
|
3163
3299
|
ciphertext = await fs3.readFile(file);
|
|
@@ -3197,7 +3333,7 @@ var decryptCommand = new Command59("decrypt").description("Decrypt a file using
|
|
|
3197
3333
|
});
|
|
3198
3334
|
|
|
3199
3335
|
// src/commands/xmtp.ts
|
|
3200
|
-
import { Command as
|
|
3336
|
+
import { Command as Command61 } from "commander";
|
|
3201
3337
|
|
|
3202
3338
|
// src/lib/xmtp-client.ts
|
|
3203
3339
|
import path2 from "path";
|
|
@@ -3960,7 +4096,7 @@ function getDefaultQueryTimeoutMs() {
|
|
|
3960
4096
|
}
|
|
3961
4097
|
return Math.floor(parsed);
|
|
3962
4098
|
}
|
|
3963
|
-
var xmtpCommand = new
|
|
4099
|
+
var xmtpCommand = new Command61("xmtp").description("Manage XMTP messaging for this agent");
|
|
3964
4100
|
xmtpCommand.command("init").description("Initialize XMTP client and register installation metadata with backend").action(async () => {
|
|
3965
4101
|
const keystore = await loadKeystore();
|
|
3966
4102
|
const client = await createXmtpClient({
|
|
@@ -4197,7 +4333,7 @@ xmtpCommand.command("purge").description("Revoke stale XMTP installations that h
|
|
|
4197
4333
|
});
|
|
4198
4334
|
|
|
4199
4335
|
// src/commands/daemon.ts
|
|
4200
|
-
import { Command as
|
|
4336
|
+
import { Command as Command62 } from "commander";
|
|
4201
4337
|
function diffTaskStatuses(prev, next) {
|
|
4202
4338
|
const changes = [];
|
|
4203
4339
|
for (const [taskId, newStatus] of next) {
|
|
@@ -4225,7 +4361,7 @@ function sleepOrAbort(ms, signal) {
|
|
|
4225
4361
|
});
|
|
4226
4362
|
}
|
|
4227
4363
|
var MAX_SEEN_TASK_IDS = 2e3;
|
|
4228
|
-
var daemonCommand = new
|
|
4364
|
+
var daemonCommand = new Command62("daemon").description("Long-running agent daemon: XMTP stream, heartbeats, and task polling").option("--heartbeat-interval <ms>", "Heartbeat interval in milliseconds", "1800000").option("--inbox-interval <ms>", "Inbox poll interval in milliseconds", "15000").option("--task-interval <ms>", "New task poll interval in milliseconds", "15000").option(
|
|
4229
4365
|
"--auction-poll-interval <ms>",
|
|
4230
4366
|
"Poll interval for clock-based auction tasks (dutch/reverse_dutch) in milliseconds",
|
|
4231
4367
|
"15000"
|
|
@@ -4558,11 +4694,11 @@ var daemonCommand = new Command61("daemon").description("Long-running agent daem
|
|
|
4558
4694
|
);
|
|
4559
4695
|
|
|
4560
4696
|
// src/commands/email/index.ts
|
|
4561
|
-
import { Command as
|
|
4697
|
+
import { Command as Command71 } from "commander";
|
|
4562
4698
|
|
|
4563
4699
|
// src/commands/email/register.ts
|
|
4564
|
-
import { Command as
|
|
4565
|
-
var registerCommand = new
|
|
4700
|
+
import { Command as Command63 } from "commander";
|
|
4701
|
+
var registerCommand = new Command63("register").description("Register an email address for this agent").requiredOption("--username <name>", "Desired username (e.g. myagent)").action(async (opts) => {
|
|
4566
4702
|
const check = await apiGet(
|
|
4567
4703
|
`/api/emails/check-username?username=${encodeURIComponent(opts.username)}`
|
|
4568
4704
|
);
|
|
@@ -4583,8 +4719,8 @@ var registerCommand = new Command62("register").description("Register an email a
|
|
|
4583
4719
|
});
|
|
4584
4720
|
|
|
4585
4721
|
// src/commands/email/inbox.ts
|
|
4586
|
-
import { Command as
|
|
4587
|
-
var inboxCommand2 = new
|
|
4722
|
+
import { Command as Command64 } from "commander";
|
|
4723
|
+
var inboxCommand2 = new Command64("inbox").description("List emails in your inbox").option("--limit <n>", "Number of emails to return", "20").option("--unread", "Show only unread emails").action(async (opts) => {
|
|
4588
4724
|
const keystore = await loadKeystore();
|
|
4589
4725
|
const params = new URLSearchParams({
|
|
4590
4726
|
deviceId: keystore.deviceId,
|
|
@@ -4599,8 +4735,8 @@ var inboxCommand2 = new Command63("inbox").description("List emails in your inbo
|
|
|
4599
4735
|
});
|
|
4600
4736
|
|
|
4601
4737
|
// src/commands/email/read.ts
|
|
4602
|
-
import { Command as
|
|
4603
|
-
var readCommand = new
|
|
4738
|
+
import { Command as Command65 } from "commander";
|
|
4739
|
+
var readCommand = new Command65("read").description("Read an email by ID (marks it as read)").argument("<id>", "Email ID").action(async (id) => {
|
|
4604
4740
|
const keystore = await loadKeystore();
|
|
4605
4741
|
const params = new URLSearchParams({
|
|
4606
4742
|
deviceId: keystore.deviceId,
|
|
@@ -4612,8 +4748,8 @@ var readCommand = new Command64("read").description("Read an email by ID (marks
|
|
|
4612
4748
|
});
|
|
4613
4749
|
|
|
4614
4750
|
// src/commands/email/send.ts
|
|
4615
|
-
import { Command as
|
|
4616
|
-
var sendCommand = new
|
|
4751
|
+
import { Command as Command66 } from "commander";
|
|
4752
|
+
var sendCommand = new Command66("send").description("Send an email").requiredOption("--to <address>", "Recipient email address").requiredOption("--subject <subject>", "Email subject").requiredOption("--body <text>", "Email body text").action(async (opts) => {
|
|
4617
4753
|
const keystore = await loadKeystore();
|
|
4618
4754
|
const { data: result, idempotencyKey } = await apiPost("/api/emails/send", {
|
|
4619
4755
|
deviceId: keystore.deviceId,
|
|
@@ -4626,8 +4762,8 @@ var sendCommand = new Command65("send").description("Send an email").requiredOpt
|
|
|
4626
4762
|
});
|
|
4627
4763
|
|
|
4628
4764
|
// src/commands/email/reply.ts
|
|
4629
|
-
import { Command as
|
|
4630
|
-
var replyCommand = new
|
|
4765
|
+
import { Command as Command67 } from "commander";
|
|
4766
|
+
var replyCommand = new Command67("reply").description("Reply to an email").argument("<id>", "Email ID to reply to").requiredOption("--body <text>", "Reply body text").action(async (id, opts) => {
|
|
4631
4767
|
const keystore = await loadKeystore();
|
|
4632
4768
|
const params = new URLSearchParams({
|
|
4633
4769
|
deviceId: keystore.deviceId,
|
|
@@ -4649,8 +4785,8 @@ var replyCommand = new Command66("reply").description("Reply to an email").argum
|
|
|
4649
4785
|
});
|
|
4650
4786
|
|
|
4651
4787
|
// src/commands/email/delete.ts
|
|
4652
|
-
import { Command as
|
|
4653
|
-
var deleteCommand = new
|
|
4788
|
+
import { Command as Command68 } from "commander";
|
|
4789
|
+
var deleteCommand = new Command68("delete").description("Delete an email by ID").argument("<id>", "Email ID").action(async (id) => {
|
|
4654
4790
|
const keystore = await loadKeystore();
|
|
4655
4791
|
const { data: result, idempotencyKey } = await apiPost(
|
|
4656
4792
|
"/api/emails/delete",
|
|
@@ -4664,15 +4800,15 @@ var deleteCommand = new Command67("delete").description("Delete an email by ID")
|
|
|
4664
4800
|
});
|
|
4665
4801
|
|
|
4666
4802
|
// src/commands/email/address.ts
|
|
4667
|
-
import { Command as
|
|
4668
|
-
var addressCommand2 = new
|
|
4803
|
+
import { Command as Command69 } from "commander";
|
|
4804
|
+
var addressCommand2 = new Command69("address").description("Show your registered email address").action(async () => {
|
|
4669
4805
|
const keystore = await loadKeystore();
|
|
4670
4806
|
const result = await apiGet(`/api/agents/stats?address=${keystore.walletAddress}`);
|
|
4671
4807
|
printResult({ emailAddress: result.emailAddress ?? null });
|
|
4672
4808
|
});
|
|
4673
4809
|
|
|
4674
4810
|
// src/commands/email/mark-read.ts
|
|
4675
|
-
import { Command as
|
|
4811
|
+
import { Command as Command70 } from "commander";
|
|
4676
4812
|
async function setReadStatus(id, read) {
|
|
4677
4813
|
const keystore = await loadKeystore();
|
|
4678
4814
|
const { data: result, idempotencyKey } = await apiPost(
|
|
@@ -4686,12 +4822,12 @@ async function setReadStatus(id, read) {
|
|
|
4686
4822
|
);
|
|
4687
4823
|
printResult({ id: result.id, isRead: result.isRead }, { idempotencyKey });
|
|
4688
4824
|
}
|
|
4689
|
-
var markReadCommand = new
|
|
4825
|
+
var markReadCommand = new Command70("mark-read").description("Mark an email as read or unread").argument("<id>", "Email ID").option("--unread", "Mark as unread instead of read").action(async (id, opts) => {
|
|
4690
4826
|
await setReadStatus(id, !opts.unread);
|
|
4691
4827
|
});
|
|
4692
4828
|
|
|
4693
4829
|
// src/commands/email/index.ts
|
|
4694
|
-
var emailCommand = new
|
|
4830
|
+
var emailCommand = new Command71("email").description("Email management commands");
|
|
4695
4831
|
emailCommand.addCommand(registerCommand);
|
|
4696
4832
|
emailCommand.addCommand(inboxCommand2);
|
|
4697
4833
|
emailCommand.addCommand(readCommand);
|
|
@@ -4702,11 +4838,11 @@ emailCommand.addCommand(addressCommand2);
|
|
|
4702
4838
|
emailCommand.addCommand(markReadCommand);
|
|
4703
4839
|
|
|
4704
4840
|
// src/commands/requester/index.ts
|
|
4705
|
-
import { Command as
|
|
4841
|
+
import { Command as Command73 } from "commander";
|
|
4706
4842
|
|
|
4707
4843
|
// src/commands/requester/stats.ts
|
|
4708
|
-
import { Command as
|
|
4709
|
-
var requesterStatsCmd = new
|
|
4844
|
+
import { Command as Command72 } from "commander";
|
|
4845
|
+
var requesterStatsCmd = new Command72("stats").description("Get requester reputation stats for an address").argument("<address>", "Wallet address of the requester").action(async (address) => {
|
|
4710
4846
|
if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
|
|
4711
4847
|
printError("Address must be a 0x-prefixed 20-byte hex string");
|
|
4712
4848
|
return;
|
|
@@ -4720,13 +4856,13 @@ var requesterStatsCmd = new Command71("stats").description("Get requester reputa
|
|
|
4720
4856
|
});
|
|
4721
4857
|
|
|
4722
4858
|
// src/commands/requester/index.ts
|
|
4723
|
-
var requesterCmd = new
|
|
4859
|
+
var requesterCmd = new Command73("requester").description("Requester reputation commands").addCommand(requesterStatsCmd);
|
|
4724
4860
|
|
|
4725
4861
|
// src/commands/x402/index.ts
|
|
4726
|
-
import { Command as
|
|
4862
|
+
import { Command as Command77 } from "commander";
|
|
4727
4863
|
|
|
4728
4864
|
// src/commands/x402/payments.ts
|
|
4729
|
-
import { Command as
|
|
4865
|
+
import { Command as Command74, Option as Option3 } from "commander";
|
|
4730
4866
|
import { createInterface as createInterface4 } from "readline";
|
|
4731
4867
|
var PAYMENT_STATES = [
|
|
4732
4868
|
"reserved",
|
|
@@ -4752,7 +4888,7 @@ async function confirmManualResolution() {
|
|
|
4752
4888
|
readline.close();
|
|
4753
4889
|
return answer.trim().toLowerCase() === "resolve";
|
|
4754
4890
|
}
|
|
4755
|
-
var x402PaymentsCommand = new
|
|
4891
|
+
var x402PaymentsCommand = new Command74("payments").description(
|
|
4756
4892
|
"Inspect and reconcile X402 Pay payment records"
|
|
4757
4893
|
);
|
|
4758
4894
|
x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option3("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
|
|
@@ -4781,7 +4917,7 @@ x402PaymentsCommand.command("resolve").description("Manually record an externall
|
|
|
4781
4917
|
|
|
4782
4918
|
// src/commands/x402/policy.ts
|
|
4783
4919
|
import { promises as fs4 } from "fs";
|
|
4784
|
-
import { Command as
|
|
4920
|
+
import { Command as Command75 } from "commander";
|
|
4785
4921
|
import { createInterface as createInterface5 } from "readline";
|
|
4786
4922
|
async function confirmUnattendedRule(rule) {
|
|
4787
4923
|
if (!process.stdin.isTTY) {
|
|
@@ -4807,7 +4943,7 @@ async function confirmUnattendedRule(rule) {
|
|
|
4807
4943
|
readline.close();
|
|
4808
4944
|
return answer.trim().toLowerCase() === "authorize";
|
|
4809
4945
|
}
|
|
4810
|
-
var x402PolicyCommand = new
|
|
4946
|
+
var x402PolicyCommand = new Command75("policy").description(
|
|
4811
4947
|
"Manage local X402 Pay spending policy"
|
|
4812
4948
|
);
|
|
4813
4949
|
x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
|
|
@@ -4843,14 +4979,14 @@ for (const enabled of [true, false]) {
|
|
|
4843
4979
|
}
|
|
4844
4980
|
|
|
4845
4981
|
// src/commands/x402/request.ts
|
|
4846
|
-
import { Command as
|
|
4982
|
+
import { Command as Command76, Option as Option4 } from "commander";
|
|
4847
4983
|
function collect2(value, previous) {
|
|
4848
4984
|
return [...previous, value];
|
|
4849
4985
|
}
|
|
4850
4986
|
function confirm(lines) {
|
|
4851
4987
|
return confirmAtTerminal(lines, "use --non-interactive with policy");
|
|
4852
4988
|
}
|
|
4853
|
-
var x402RequestCommand = new
|
|
4989
|
+
var x402RequestCommand = new Command76("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option4("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
|
|
4854
4990
|
"--header-env <header=ENV_VAR>",
|
|
4855
4991
|
"Read one request header from an environment variable (repeatable)",
|
|
4856
4992
|
collect2,
|
|
@@ -4898,7 +5034,7 @@ var x402RequestCommand = new Command75("request").description("Request and pay f
|
|
|
4898
5034
|
);
|
|
4899
5035
|
|
|
4900
5036
|
// src/commands/x402/index.ts
|
|
4901
|
-
var x402Command = new
|
|
5037
|
+
var x402Command = new Command77("x402").description(
|
|
4902
5038
|
"Pay x402 services with local spending policies (X402 Pay)"
|
|
4903
5039
|
);
|
|
4904
5040
|
x402Command.addCommand(x402RequestCommand);
|
|
@@ -4906,10 +5042,10 @@ x402Command.addCommand(x402PolicyCommand);
|
|
|
4906
5042
|
x402Command.addCommand(x402PaymentsCommand);
|
|
4907
5043
|
|
|
4908
5044
|
// src/commands/sponsored-task/index.ts
|
|
4909
|
-
import { Command as
|
|
5045
|
+
import { Command as Command92 } from "commander";
|
|
4910
5046
|
|
|
4911
5047
|
// src/commands/sponsored-task/create.ts
|
|
4912
|
-
import { Command as
|
|
5048
|
+
import { Command as Command78 } from "commander";
|
|
4913
5049
|
import { toHex as toHex3 } from "viem";
|
|
4914
5050
|
|
|
4915
5051
|
// ../../packages/contracts/abi/generated/SponsoredTasksVault.ts
|
|
@@ -8131,7 +8267,7 @@ async function approveSponsoredTaskSpend(input) {
|
|
|
8131
8267
|
function isValidAddress4(addr) {
|
|
8132
8268
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
8133
8269
|
}
|
|
8134
|
-
var sponsoredTaskCreateCommand = new
|
|
8270
|
+
var sponsoredTaskCreateCommand = new Command78("create").description("Create a new Sponsored Task vault for a project token").requiredOption("--factory <address>", "SponsoredTaskFactory contract address").requiredOption("--chain-id <id>", "Chain id the factory is deployed on").requiredOption("--token <address>", "Project ERC-20 token address to fund the vault with").option("--owner <address>", "Vault owner (defaults to your own wallet)").action(async (opts) => {
|
|
8135
8271
|
if (!isValidAddress4(opts.factory) || !isValidAddress4(opts.token)) {
|
|
8136
8272
|
printError("Invalid Ethereum address for --factory or --token");
|
|
8137
8273
|
return;
|
|
@@ -8168,11 +8304,11 @@ var sponsoredTaskCreateCommand = new Command77("create").description("Create a n
|
|
|
8168
8304
|
});
|
|
8169
8305
|
|
|
8170
8306
|
// src/commands/sponsored-task/fund.ts
|
|
8171
|
-
import { Command as
|
|
8307
|
+
import { Command as Command79 } from "commander";
|
|
8172
8308
|
function isValidAddress5(addr) {
|
|
8173
8309
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
8174
8310
|
}
|
|
8175
|
-
var sponsoredTaskFundCommand = new
|
|
8311
|
+
var sponsoredTaskFundCommand = new Command79("fund").description("Fund a Sponsored Task vault with its project token (base units)").requiredOption("--vault <address>", "Vault address").requiredOption("--token <address>", "Project ERC-20 token address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to fund, in the token base units").action(async (opts) => {
|
|
8176
8312
|
if (!isValidAddress5(opts.vault) || !isValidAddress5(opts.token)) {
|
|
8177
8313
|
printError("Invalid Ethereum address for --vault or --token");
|
|
8178
8314
|
return;
|
|
@@ -8211,7 +8347,7 @@ var sponsoredTaskFundCommand = new Command78("fund").description("Fund a Sponsor
|
|
|
8211
8347
|
});
|
|
8212
8348
|
|
|
8213
8349
|
// src/commands/sponsored-task/managers.ts
|
|
8214
|
-
import { Command as
|
|
8350
|
+
import { Command as Command80 } from "commander";
|
|
8215
8351
|
function isValidAddress6(addr) {
|
|
8216
8352
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
8217
8353
|
}
|
|
@@ -8257,7 +8393,7 @@ async function configure(opts) {
|
|
|
8257
8393
|
});
|
|
8258
8394
|
printResult({ txHash, manager: opts.manager, spendCap: cap.toString(), active: opts.active });
|
|
8259
8395
|
}
|
|
8260
|
-
var sponsoredTaskManagersCommand = new
|
|
8396
|
+
var sponsoredTaskManagersCommand = new Command80("managers").description(
|
|
8261
8397
|
"Manage authorized managers for a Sponsored Task vault"
|
|
8262
8398
|
);
|
|
8263
8399
|
sponsoredTaskManagersCommand.command("add").description("Authorize a manager with a token-denominated spend cap").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--manager <address>", "Manager address to authorize").requiredOption("--cap <baseUnits>", "Spend cap, in the project token base units").action((opts) => configure({ ...opts, active: true }));
|
|
@@ -8268,8 +8404,8 @@ sponsoredTaskManagersCommand.command("list").description("List a vault authorize
|
|
|
8268
8404
|
});
|
|
8269
8405
|
|
|
8270
8406
|
// src/commands/sponsored-task/managed.ts
|
|
8271
|
-
import { Command as
|
|
8272
|
-
var sponsoredTaskManagedCommand = new
|
|
8407
|
+
import { Command as Command81 } from "commander";
|
|
8408
|
+
var sponsoredTaskManagedCommand = new Command81("managed").description(
|
|
8273
8409
|
"List the active Sponsored Task vaults an address can fund tasks from as an active manager (defaults to your wallet)"
|
|
8274
8410
|
).option("--address <address>", "Manager address (defaults to your wallet)").option("--limit <n>", "Max vaults to return (1-100)", "50").option("--cursor <vaultId>", "Pagination cursor from a previous nextCursor").action(async (opts) => {
|
|
8275
8411
|
let address = opts.address;
|
|
@@ -8299,7 +8435,7 @@ var sponsoredTaskManagedCommand = new Command80("managed").description(
|
|
|
8299
8435
|
});
|
|
8300
8436
|
|
|
8301
8437
|
// src/commands/sponsored-task/fee-bank.ts
|
|
8302
|
-
import { Command as
|
|
8438
|
+
import { Command as Command82 } from "commander";
|
|
8303
8439
|
function isValidAddress7(addr) {
|
|
8304
8440
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
8305
8441
|
}
|
|
@@ -8311,7 +8447,7 @@ async function requireKeystore2() {
|
|
|
8311
8447
|
return null;
|
|
8312
8448
|
}
|
|
8313
8449
|
}
|
|
8314
|
-
var sponsoredTaskFeeBankCommand = new
|
|
8450
|
+
var sponsoredTaskFeeBankCommand = new Command82("fee-bank").description(
|
|
8315
8451
|
"Manage a manager USDC credit balance, charged by the Sponsored Task hook at task creation"
|
|
8316
8452
|
);
|
|
8317
8453
|
sponsoredTaskFeeBankCommand.command("deposit").description("Deposit USDC credit for creating sponsored tasks").requiredOption("--fee-bank <address>", "SponsoredTaskFeeBank contract address").requiredOption("--usdc <address>", "USDC token address").requiredOption("--chain-id <id>", "Chain id the fee bank is deployed on").requiredOption("--amount <baseUnits>", "Amount to deposit, in USDC base units (6 decimals)").action(async (opts) => {
|
|
@@ -8395,8 +8531,8 @@ sponsoredTaskFeeBankCommand.command("withdraw").description("Withdraw unused USD
|
|
|
8395
8531
|
);
|
|
8396
8532
|
|
|
8397
8533
|
// src/commands/sponsored-task/list.ts
|
|
8398
|
-
import { Command as
|
|
8399
|
-
var sponsoredTaskListCommand = new
|
|
8534
|
+
import { Command as Command83 } from "commander";
|
|
8535
|
+
var sponsoredTaskListCommand = new Command83("list").description("List Sponsored Task vaults").option("--limit <n>", "Max vaults to return", "50").option("--cursor <vaultId>", "Pagination cursor").option("--include-unverified", "Include vaults not yet curator-approved", false).action(async (opts) => {
|
|
8400
8536
|
const params = new URLSearchParams({ limit: opts.limit });
|
|
8401
8537
|
if (opts.cursor) params.set("cursor", opts.cursor);
|
|
8402
8538
|
if (opts.includeUnverified) params.set("includeUnverified", "true");
|
|
@@ -8405,8 +8541,8 @@ var sponsoredTaskListCommand = new Command82("list").description("List Sponsored
|
|
|
8405
8541
|
});
|
|
8406
8542
|
|
|
8407
8543
|
// src/commands/sponsored-task/settlements.ts
|
|
8408
|
-
import { Command as
|
|
8409
|
-
var sponsoredTaskSettlementsCommand = new
|
|
8544
|
+
import { Command as Command84 } from "commander";
|
|
8545
|
+
var sponsoredTaskSettlementsCommand = new Command84("settlements").description("List the settlements a Sponsored Task vault has installed, newest first").argument("<vaultId>", "Vault id").option("--limit <n>", "Max settlements to return (1-100)", "25").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(async (vaultId, opts) => {
|
|
8410
8546
|
const limit = Number(opts.limit);
|
|
8411
8547
|
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
8412
8548
|
printError("--limit must be an integer from 1 to 100");
|
|
@@ -8421,17 +8557,17 @@ var sponsoredTaskSettlementsCommand = new Command83("settlements").description("
|
|
|
8421
8557
|
});
|
|
8422
8558
|
|
|
8423
8559
|
// src/commands/sponsored-task/show.ts
|
|
8424
|
-
import { Command as
|
|
8425
|
-
var sponsoredTaskShowCommand = new
|
|
8560
|
+
import { Command as Command85 } from "commander";
|
|
8561
|
+
var sponsoredTaskShowCommand = new Command85("show").description("Show a Sponsored Task vault by id").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
8426
8562
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}`);
|
|
8427
8563
|
printResult(result);
|
|
8428
8564
|
});
|
|
8429
8565
|
|
|
8430
8566
|
// src/commands/sponsored-task/request-review.ts
|
|
8431
8567
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
8432
|
-
import { Command as
|
|
8568
|
+
import { Command as Command86 } from "commander";
|
|
8433
8569
|
var REQUEST_TTL_SECONDS = 5 * 60;
|
|
8434
|
-
var sponsoredTaskRequestReviewCommand = new
|
|
8570
|
+
var sponsoredTaskRequestReviewCommand = new Command86("request-review").description("Ask Taskmarket curators to review a Sponsored Task vault (vault owner only)").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
8435
8571
|
let keystore;
|
|
8436
8572
|
try {
|
|
8437
8573
|
keystore = await loadKeystore();
|
|
@@ -8488,18 +8624,18 @@ var sponsoredTaskRequestReviewCommand = new Command85("request-review").descript
|
|
|
8488
8624
|
});
|
|
8489
8625
|
|
|
8490
8626
|
// src/commands/sponsored-task/balance.ts
|
|
8491
|
-
import { Command as
|
|
8492
|
-
var sponsoredTaskBalanceCommand = new
|
|
8627
|
+
import { Command as Command87 } from "commander";
|
|
8628
|
+
var sponsoredTaskBalanceCommand = new Command87("balance").description("Show a Sponsored Task vault funded/available/reserved balances").argument("<vaultId>", "Vault id").action(async (vaultId) => {
|
|
8493
8629
|
const result = await apiGet(`/api/sponsored-task-vaults/${vaultId}/balance`);
|
|
8494
8630
|
printResult(result);
|
|
8495
8631
|
});
|
|
8496
8632
|
|
|
8497
8633
|
// src/commands/sponsored-task/withdraw.ts
|
|
8498
|
-
import { Command as
|
|
8634
|
+
import { Command as Command88 } from "commander";
|
|
8499
8635
|
function isValidAddress8(addr) {
|
|
8500
8636
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
8501
8637
|
}
|
|
8502
|
-
var sponsoredTaskWithdrawCommand = new
|
|
8638
|
+
var sponsoredTaskWithdrawCommand = new Command88("withdraw").description("Withdraw unreserved project tokens from a vault (owner only)").requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").requiredOption("--amount <baseUnits>", "Amount to withdraw, in the project token base units").option("--recipient <address>", "Recipient (defaults to your own wallet)").action(async (opts) => {
|
|
8503
8639
|
if (!isValidAddress8(opts.vault) || opts.recipient && !isValidAddress8(opts.recipient)) {
|
|
8504
8640
|
printError("Invalid Ethereum address for --vault or --recipient");
|
|
8505
8641
|
return;
|
|
@@ -8529,11 +8665,11 @@ var sponsoredTaskWithdrawCommand = new Command87("withdraw").description("Withdr
|
|
|
8529
8665
|
});
|
|
8530
8666
|
|
|
8531
8667
|
// src/commands/sponsored-task/exit.ts
|
|
8532
|
-
import { Command as
|
|
8668
|
+
import { Command as Command89 } from "commander";
|
|
8533
8669
|
function isValidAddress9(addr) {
|
|
8534
8670
|
return /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
8535
8671
|
}
|
|
8536
|
-
var sponsoredTaskExitCommand = new
|
|
8672
|
+
var sponsoredTaskExitCommand = new Command89("exit").description(
|
|
8537
8673
|
"Terminally exit a vault: sweeps every reserved and unclaimed token back to you, invalidating every outstanding reservation, claim signature, and Merkle proof at once. There is no undo and no per-allocation revoke -- a worker with a pending but unclaimed entitlement gets nothing once this runs."
|
|
8538
8674
|
).requiredOption("--vault <address>", "Vault address").requiredOption("--chain-id <id>", "Chain id the vault is deployed on").option("--recipient <address>", "Recipient (defaults to your own wallet)").option("--yes", "Skip the confirmation prompt", false).action(async (opts) => {
|
|
8539
8675
|
if (!isValidAddress9(opts.vault) || opts.recipient && !isValidAddress9(opts.recipient)) {
|
|
@@ -8569,7 +8705,7 @@ var sponsoredTaskExitCommand = new Command88("exit").description(
|
|
|
8569
8705
|
});
|
|
8570
8706
|
|
|
8571
8707
|
// src/commands/sponsored-task/claim.ts
|
|
8572
|
-
import { Command as
|
|
8708
|
+
import { Command as Command90 } from "commander";
|
|
8573
8709
|
var CLAIM_TO_TYPES = {
|
|
8574
8710
|
ClaimTo: [
|
|
8575
8711
|
{ name: "vaultId", type: "bytes32" },
|
|
@@ -8604,7 +8740,7 @@ async function postClaimWithRetry(path3, body, options = {}) {
|
|
|
8604
8740
|
}
|
|
8605
8741
|
}
|
|
8606
8742
|
}
|
|
8607
|
-
var sponsoredTaskClaimCommand = new
|
|
8743
|
+
var sponsoredTaskClaimCommand = new Command90("claim").description("Claim your unclaimed Sponsored Task reward for a vault task").argument("<vaultId>", "Vault id").option(
|
|
8608
8744
|
"--task-id <id>",
|
|
8609
8745
|
"Claim the entitlement for a specific task (defaults to the first unclaimed one)"
|
|
8610
8746
|
).action(async (vaultId, opts) => {
|
|
@@ -8684,10 +8820,10 @@ var sponsoredTaskClaimCommand = new Command89("claim").description("Claim your u
|
|
|
8684
8820
|
});
|
|
8685
8821
|
|
|
8686
8822
|
// src/commands/sponsored-task/rewards.ts
|
|
8687
|
-
import { Command as
|
|
8823
|
+
import { Command as Command91 } from "commander";
|
|
8688
8824
|
var REWARD_STATES = SponsoredTaskRewardStateSchema.options;
|
|
8689
8825
|
var CLAIM_STATUSES = SponsoredTaskWorkerRewardClaimStatusSchema.options;
|
|
8690
|
-
var sponsoredTaskRewardsCommand = new
|
|
8826
|
+
var sponsoredTaskRewardsCommand = new Command91("rewards").description("List Sponsored Task rewards across every vault (defaults to your wallet)").option("--address <address>", "Worker address (defaults to your wallet)").option("--state <state>", `Reward state: ${REWARD_STATES.join(", ")}`).option("--claim-status <status>", `Claim status: ${CLAIM_STATUSES.join(", ")}`).option("--limit <n>", "Max rewards to return (1-100)", "50").option("--cursor <cursor>", "Pagination cursor from a previous nextCursor").action(
|
|
8691
8827
|
async (opts) => {
|
|
8692
8828
|
let address = opts.address;
|
|
8693
8829
|
if (address === void 0) {
|
|
@@ -8727,7 +8863,7 @@ var sponsoredTaskRewardsCommand = new Command90("rewards").description("List Spo
|
|
|
8727
8863
|
);
|
|
8728
8864
|
|
|
8729
8865
|
// src/commands/sponsored-task/index.ts
|
|
8730
|
-
var sponsoredTaskCommand = new
|
|
8866
|
+
var sponsoredTaskCommand = new Command92("sponsored-task").description(
|
|
8731
8867
|
"Sponsored Task vault administration and reward claims"
|
|
8732
8868
|
);
|
|
8733
8869
|
sponsoredTaskCommand.addCommand(sponsoredTaskCreateCommand);
|
|
@@ -8748,7 +8884,7 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
|
|
|
8748
8884
|
// src/index.ts
|
|
8749
8885
|
var require2 = createRequire(import.meta.url);
|
|
8750
8886
|
var { version } = require2("../package.json");
|
|
8751
|
-
var program = new
|
|
8887
|
+
var program = new Command93();
|
|
8752
8888
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
8753
8889
|
program.option(
|
|
8754
8890
|
"--network <name>",
|