@lucid-agents/taskmarket 1.37.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-compatibility.json +1 -1
- package/dist/{api-X7M5ZRFO.js → api-I3EZRW6P.js} +2 -2
- package/dist/{channels-JRY5YSNU.js → channels-JW5465JV.js} +4 -4
- package/dist/{chunk-ATZLUOQX.js → chunk-5IV4HFML.js} +3 -3
- package/dist/{chunk-SKD2T3UR.js → chunk-6Q37G25Q.js} +1 -1
- package/dist/{chunk-NO227FAP.js → chunk-BVUHDLFY.js} +1 -1
- package/dist/{chunk-YQLA6EXP.js → chunk-CO6HZLD5.js} +1 -1
- package/dist/{chunk-M2UVDGSH.js → chunk-HJE3YXIQ.js} +3 -3
- package/dist/{chunk-TDQHU2JT.js → chunk-I6O7MUFZ.js} +2 -2
- package/dist/{chunk-OK3AHSZH.js → chunk-LJKCK7J7.js} +8 -8
- package/dist/{chunk-AUDDFWKQ.js → chunk-OEVU366I.js} +2763 -2514
- package/dist/{chunk-5YGFSGJA.js → chunk-PPTRUZJK.js} +1 -1
- package/dist/{chunk-IDSGZXDR.js → chunk-U2BQZ7BU.js} +3 -3
- package/dist/{chunk-HNTWHQBL.js → chunk-U7L2VMHL.js} +5 -5
- package/dist/{chunk-XL76RC3P.js → chunk-WGLEKAU2.js} +1 -1
- package/dist/{doctor-QGHPARVU.js → doctor-YSCUPIXR.js} +8 -8
- package/dist/index.js +416 -133
- package/dist/{launch-6VCLZ7XR.js → launch-ZEYFMO3L.js} +11 -11
- package/dist/pi-extensions/xgate.cjs +222 -71
- package/dist/{read-auth-AVN4SJSZ.js → read-auth-34XAANDC.js} +3 -3
- package/dist/{reconcile-HEON5ETE.js → reconcile-34TJBB74.js} +4 -4
- package/dist/{status-6PCJLCTM.js → status-ZAZLJJMP.js} +8 -8
- package/dist/{sync-pull-62R4YTEO.js → sync-pull-3HL7LFTB.js} +4 -4
- package/dist/{task-access-grants-MIWSFZZ3.js → task-access-grants-WMTLO2WA.js} +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
listWorkerSubmissions,
|
|
15
15
|
submitTaskFiles,
|
|
16
16
|
taskRequirementsOf
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LJKCK7J7.js";
|
|
18
18
|
import {
|
|
19
19
|
ComputeCreditError,
|
|
20
20
|
applyComputeCreditSetup,
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
releasePendingComputePurchase,
|
|
38
38
|
resolvePendingComputePurchases,
|
|
39
39
|
x402FeePost
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-U2BQZ7BU.js";
|
|
41
41
|
import {
|
|
42
42
|
signReadAuth
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-I6O7MUFZ.js";
|
|
44
44
|
import {
|
|
45
45
|
saveTaskAccessGrant,
|
|
46
46
|
taskAccessGrantHeaders
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-PPTRUZJK.js";
|
|
48
48
|
import {
|
|
49
49
|
MPP_TEMPO_DEFAULT_VALIDITY_SECONDS,
|
|
50
50
|
X402PayError,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
setX402PolicyRuleEnabled,
|
|
63
63
|
signSponsoredTempoTransfer,
|
|
64
64
|
signTaskmarketFeePayment
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-CO6HZLD5.js";
|
|
66
66
|
import {
|
|
67
67
|
ALL_NETWORKS,
|
|
68
68
|
ApiError,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
withErrorContext,
|
|
126
126
|
withIdempotentWrite,
|
|
127
127
|
withTapSignature
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-WGLEKAU2.js";
|
|
129
129
|
import {
|
|
130
130
|
AGENT_AVATAR_MAX_BYTES,
|
|
131
131
|
AGENT_HIRES_ROLES,
|
|
@@ -193,12 +193,21 @@ import {
|
|
|
193
193
|
NEEDS_YOU_PRIORITY_RANK,
|
|
194
194
|
NetworkInfoSchema,
|
|
195
195
|
OFFICIAL_WORKFLOW_TEMPLATE_ID,
|
|
196
|
+
PROJECT_SUGGESTIONS_LIST_DEFAULT,
|
|
197
|
+
PROJECT_SUGGESTIONS_LIST_MAX,
|
|
198
|
+
PROJECT_SUGGESTIONS_SETTINGS,
|
|
199
|
+
PROJECT_SUGGESTION_SORTS,
|
|
200
|
+
PROJECT_SUGGESTION_STATUSES,
|
|
196
201
|
PUBLIC_BUG_REPORT_SORTS,
|
|
197
202
|
PenaltyTo,
|
|
198
203
|
PlatformTimeSeriesInputSchema,
|
|
199
204
|
PostBugReportMessageInputSchema,
|
|
200
205
|
ProjectGoalSchema,
|
|
201
206
|
ProjectNameSchema,
|
|
207
|
+
ProjectSuggestionBriefSchema,
|
|
208
|
+
ProjectSuggestionDeclineSchema,
|
|
209
|
+
ProjectSuggestionIdSchema,
|
|
210
|
+
ProjectSuggestionTitleSchema,
|
|
202
211
|
READ_AUTH_ADDRESS_HEADER,
|
|
203
212
|
READ_AUTH_SIGNATURE_HEADER,
|
|
204
213
|
REDACTED,
|
|
@@ -352,11 +361,11 @@ import {
|
|
|
352
361
|
vaultCallGasLimit7702,
|
|
353
362
|
verifierProviderId,
|
|
354
363
|
verifiersUnsupportedOnChain
|
|
355
|
-
} from "./chunk-
|
|
364
|
+
} from "./chunk-OEVU366I.js";
|
|
356
365
|
import "./chunk-S7SJMJ2I.js";
|
|
357
366
|
|
|
358
367
|
// src/index.ts
|
|
359
|
-
import { Command as
|
|
368
|
+
import { Command as Command154 } from "commander";
|
|
360
369
|
import { createRequire } from "module";
|
|
361
370
|
|
|
362
371
|
// src/commands/init.ts
|
|
@@ -10386,6 +10395,7 @@ async function runCreateTask(input, extra = {}) {
|
|
|
10386
10395
|
const body = {
|
|
10387
10396
|
...extra.projectId !== void 0 ? { projectId: extra.projectId } : {},
|
|
10388
10397
|
...extra.continuation ? extra.continuation : {},
|
|
10398
|
+
...extra.suggestionId !== void 0 ? { suggestionId: extra.suggestionId } : {},
|
|
10389
10399
|
chainId: selectedNetwork().chainId,
|
|
10390
10400
|
description: opts.description,
|
|
10391
10401
|
reward: rewardBaseUnits,
|
|
@@ -11054,14 +11064,26 @@ async function confirmStakeAffordable(address3, stake) {
|
|
|
11054
11064
|
return false;
|
|
11055
11065
|
}
|
|
11056
11066
|
var UNVERIFIED_HOOK_CODE = "unverified_hook";
|
|
11067
|
+
var UNVERIFIED_HOOK_CHECK_FAILED_CODE = "unverified_hook_check_failed";
|
|
11057
11068
|
async function confirmUnverifiedHooks(action, taskId, accepted, task) {
|
|
11058
11069
|
if (accepted) return true;
|
|
11059
11070
|
let read3 = task;
|
|
11060
11071
|
if (read3 === void 0) {
|
|
11061
11072
|
try {
|
|
11062
11073
|
read3 = await getTask(cliTaskReadContext(), { taskId });
|
|
11063
|
-
} catch {
|
|
11064
|
-
|
|
11074
|
+
} catch (error) {
|
|
11075
|
+
renderFailure(
|
|
11076
|
+
new Error(
|
|
11077
|
+
`Could not read task ${taskId} to check its hooks against the hook registry, so nothing was done. Try again, or re-run with --accept-unverified-hooks to ${action} without the check at your own risk.`
|
|
11078
|
+
),
|
|
11079
|
+
{
|
|
11080
|
+
details: {
|
|
11081
|
+
code: UNVERIFIED_HOOK_CHECK_FAILED_CODE,
|
|
11082
|
+
cause: error instanceof Error ? error.message : String(error)
|
|
11083
|
+
}
|
|
11084
|
+
}
|
|
11085
|
+
);
|
|
11086
|
+
return false;
|
|
11065
11087
|
}
|
|
11066
11088
|
}
|
|
11067
11089
|
const hooks = [...read3?.unverifiedHooks ?? []];
|
|
@@ -12987,7 +13009,7 @@ async function runAgentCommand(options) {
|
|
|
12987
13009
|
try {
|
|
12988
13010
|
const { assertAgentCompatibility } = await import("./compatibility-636WJOEX.js");
|
|
12989
13011
|
const pi = assertAgentCompatibility();
|
|
12990
|
-
const { runAgent } = await import("./launch-
|
|
13012
|
+
const { runAgent } = await import("./launch-ZEYFMO3L.js");
|
|
12991
13013
|
result = await runAgent({
|
|
12992
13014
|
model: options.model,
|
|
12993
13015
|
pi,
|
|
@@ -13421,13 +13443,13 @@ function agentManagementCommands() {
|
|
|
13421
13443
|
const status = new Command57("status").description(
|
|
13422
13444
|
"Show the agent channels (locked, charged, refundable), purchases with an unknown outcome, the sandbox and compute credit. Reads only."
|
|
13423
13445
|
).action(async () => {
|
|
13424
|
-
const { collectAgentStatus } = await import("./status-
|
|
13446
|
+
const { collectAgentStatus } = await import("./status-ZAZLJJMP.js");
|
|
13425
13447
|
await run(() => collectAgentStatus());
|
|
13426
13448
|
});
|
|
13427
13449
|
const doctor = new Command57("doctor").description(
|
|
13428
13450
|
"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."
|
|
13429
13451
|
).action(async () => {
|
|
13430
|
-
const { runDoctor } = await import("./doctor-
|
|
13452
|
+
const { runDoctor } = await import("./doctor-YSCUPIXR.js");
|
|
13431
13453
|
const report = await run(() => runDoctor());
|
|
13432
13454
|
if (report && !report.ok) process.exitCode = 1;
|
|
13433
13455
|
});
|
|
@@ -13438,7 +13460,7 @@ function agentManagementCommands() {
|
|
|
13438
13460
|
"Reconcile the open purchases of this channel, as status lists it; also reaches retired channels"
|
|
13439
13461
|
).action(
|
|
13440
13462
|
async (invocationId, options) => {
|
|
13441
|
-
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-
|
|
13463
|
+
const { reconcileChannelPurchases, reconcileInvocation } = await import("./reconcile-34TJBB74.js");
|
|
13442
13464
|
const choice = { rail: options.rail, channel: options.channel };
|
|
13443
13465
|
if (invocationId !== void 0) {
|
|
13444
13466
|
await run(() => reconcileInvocation(invocationId, { choice }));
|
|
@@ -13470,7 +13492,7 @@ function agentManagementCommands() {
|
|
|
13470
13492
|
`Not a USDC amount: ${options.amount} (digits, at most 6 decimals)`
|
|
13471
13493
|
);
|
|
13472
13494
|
}
|
|
13473
|
-
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-
|
|
13495
|
+
const { openAgentChannels, requestTopUp, selectRail, withdrawalHatch } = await import("./channels-JW5465JV.js");
|
|
13474
13496
|
const { rails } = await openAgentChannels();
|
|
13475
13497
|
const result = await requestTopUp(selectRail(rails, options.rail), amount);
|
|
13476
13498
|
return {
|
|
@@ -13490,8 +13512,8 @@ function agentManagementCommands() {
|
|
|
13490
13512
|
await run(async () => {
|
|
13491
13513
|
await requireExperimental();
|
|
13492
13514
|
const { AGENT_VIEW_VERSION } = await import("./budget-view-J6L7X6EY.js");
|
|
13493
|
-
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-
|
|
13494
|
-
const { reconcileLeasedPurchase } = await import("./reconcile-
|
|
13515
|
+
const { closeChannel, openAgentChannels, selectChannel } = await import("./channels-JW5465JV.js");
|
|
13516
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-34TJBB74.js");
|
|
13495
13517
|
const opened = await openAgentChannels();
|
|
13496
13518
|
const { rail, retired } = selectChannel(opened, options);
|
|
13497
13519
|
const result = await closeChannel(
|
|
@@ -13545,7 +13567,7 @@ function agentManagementCommands() {
|
|
|
13545
13567
|
async (options) => {
|
|
13546
13568
|
await run(async () => {
|
|
13547
13569
|
await requireExperimental();
|
|
13548
|
-
const { runPull } = await import("./sync-pull-
|
|
13570
|
+
const { runPull } = await import("./sync-pull-3HL7LFTB.js");
|
|
13549
13571
|
const { terminalPrompter } = await import("./prompter-LSICEYSQ.js");
|
|
13550
13572
|
return runPull(options, {
|
|
13551
13573
|
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
@@ -25637,7 +25659,7 @@ sponsoredTaskCommand.addCommand(sponsoredTaskRewardsCommand);
|
|
|
25637
25659
|
sponsoredTaskCommand.addCommand(sponsoredTaskBindPayoutCommand);
|
|
25638
25660
|
|
|
25639
25661
|
// src/commands/project/index.ts
|
|
25640
|
-
import { Command as
|
|
25662
|
+
import { Command as Command146 } from "commander";
|
|
25641
25663
|
|
|
25642
25664
|
// src/commands/project/accept.ts
|
|
25643
25665
|
import { Command as Command127 } from "commander";
|
|
@@ -25736,7 +25758,235 @@ var projectAcceptCommand = new Command127("accept").description(
|
|
|
25736
25758
|
});
|
|
25737
25759
|
|
|
25738
25760
|
// src/commands/project/add-task.ts
|
|
25761
|
+
import { Command as Command129 } from "commander";
|
|
25762
|
+
|
|
25763
|
+
// src/commands/project/suggestions.ts
|
|
25739
25764
|
import { Command as Command128 } from "commander";
|
|
25765
|
+
function parseSuggestionId(value) {
|
|
25766
|
+
const parsed = ProjectSuggestionIdSchema.safeParse(value.trim());
|
|
25767
|
+
return parsed.success ? parsed.data.toLowerCase() : { error: "The suggestion id must be a UUID" };
|
|
25768
|
+
}
|
|
25769
|
+
function parseSuggestionsSetting(value) {
|
|
25770
|
+
const trimmed = value.trim();
|
|
25771
|
+
return PROJECT_SUGGESTIONS_SETTINGS.includes(trimmed) ? trimmed : { error: `--suggestions must be ${PROJECT_SUGGESTIONS_SETTINGS.join(", ")}` };
|
|
25772
|
+
}
|
|
25773
|
+
function suggestBody(projectId, opts) {
|
|
25774
|
+
if (opts.title === void 0) return { error: "--title is required" };
|
|
25775
|
+
if (opts.brief === void 0) return { error: "--brief is required" };
|
|
25776
|
+
const title = ProjectSuggestionTitleSchema.safeParse(opts.title);
|
|
25777
|
+
if (!title.success) return { error: `--title: ${title.error.issues[0].message}` };
|
|
25778
|
+
const brief = ProjectSuggestionBriefSchema.safeParse(opts.brief);
|
|
25779
|
+
if (!brief.success) return { error: `--brief: ${brief.error.issues[0].message}` };
|
|
25780
|
+
const body = { projectId, title: title.data, brief: brief.data };
|
|
25781
|
+
if (opts.mode !== void 0) {
|
|
25782
|
+
const mode = opts.mode.trim();
|
|
25783
|
+
if (!GRANT_MODE_NAMES.includes(mode)) {
|
|
25784
|
+
return { error: `--mode must be ${GRANT_MODE_NAMES.join(", ")}` };
|
|
25785
|
+
}
|
|
25786
|
+
body.mode = mode;
|
|
25787
|
+
}
|
|
25788
|
+
if (opts.reward !== void 0) {
|
|
25789
|
+
const reward = parseAmount(opts.reward, "--reward");
|
|
25790
|
+
if (typeof reward !== "string") return reward;
|
|
25791
|
+
body.reward = reward;
|
|
25792
|
+
}
|
|
25793
|
+
return body;
|
|
25794
|
+
}
|
|
25795
|
+
function suggestionsQuery(opts) {
|
|
25796
|
+
const params = new URLSearchParams();
|
|
25797
|
+
if (opts.status !== void 0) {
|
|
25798
|
+
const status = opts.status.trim();
|
|
25799
|
+
if (!PROJECT_SUGGESTION_STATUSES.includes(status)) {
|
|
25800
|
+
return { error: `--status must be ${PROJECT_SUGGESTION_STATUSES.join(", ")}` };
|
|
25801
|
+
}
|
|
25802
|
+
params.set("status", status);
|
|
25803
|
+
}
|
|
25804
|
+
if (opts.sort !== void 0) {
|
|
25805
|
+
const sort = opts.sort.trim();
|
|
25806
|
+
if (!PROJECT_SUGGESTION_SORTS.includes(sort)) {
|
|
25807
|
+
return { error: `--sort must be ${PROJECT_SUGGESTION_SORTS.join(" or ")}` };
|
|
25808
|
+
}
|
|
25809
|
+
params.set("sort", sort);
|
|
25810
|
+
}
|
|
25811
|
+
if (opts.limit !== void 0) {
|
|
25812
|
+
const limit = opts.limit.trim();
|
|
25813
|
+
if (!/^[1-9][0-9]*$/.test(limit) || Number(limit) > PROJECT_SUGGESTIONS_LIST_MAX) {
|
|
25814
|
+
return { error: `--limit must be an integer from 1 to ${PROJECT_SUGGESTIONS_LIST_MAX}` };
|
|
25815
|
+
}
|
|
25816
|
+
params.set("limit", limit);
|
|
25817
|
+
}
|
|
25818
|
+
if (opts.cursor !== void 0) {
|
|
25819
|
+
const cursor = opts.cursor.trim();
|
|
25820
|
+
if (cursor.length === 0 || cursor.length > 512) {
|
|
25821
|
+
return { error: "--cursor must be the previous page's nextCursor" };
|
|
25822
|
+
}
|
|
25823
|
+
params.set("cursor", cursor);
|
|
25824
|
+
}
|
|
25825
|
+
return params.toString();
|
|
25826
|
+
}
|
|
25827
|
+
function suggestionSettingsBody(projectId, opts) {
|
|
25828
|
+
if (opts.suggestions === void 0 && opts.hostedOperators === void 0) return null;
|
|
25829
|
+
const body = { projectId };
|
|
25830
|
+
if (opts.suggestions !== void 0) {
|
|
25831
|
+
const setting = parseSuggestionsSetting(opts.suggestions);
|
|
25832
|
+
if (typeof setting !== "string") return setting;
|
|
25833
|
+
body.suggestions = setting;
|
|
25834
|
+
}
|
|
25835
|
+
if (opts.hostedOperators !== void 0) {
|
|
25836
|
+
const value = opts.hostedOperators.trim();
|
|
25837
|
+
if (value !== "on" && value !== "off") return { error: "--hosted-operators must be on or off" };
|
|
25838
|
+
body.hostedOperators = value === "on";
|
|
25839
|
+
}
|
|
25840
|
+
return body;
|
|
25841
|
+
}
|
|
25842
|
+
async function signedRead(path9) {
|
|
25843
|
+
try {
|
|
25844
|
+
const headers = (await signReadAuth())?.headers ?? {};
|
|
25845
|
+
printResult(await apiGet(withChainId(path9), { headers }));
|
|
25846
|
+
} catch (err) {
|
|
25847
|
+
renderFailure(err);
|
|
25848
|
+
}
|
|
25849
|
+
}
|
|
25850
|
+
var projectSuggestCommand = new Command128("suggest").description(
|
|
25851
|
+
"Post a suggestion on an open project: an idea for work its budget could pay for, as a wallet the project's suggestions setting admits (backers: the owner, its operators and backers; anyone: any wallet). Posting costs 0.001 in the payment token. The owner or an operator turns it into a task with `project add-task --suggestion <id>`, and anyone it admits may upvote it for free"
|
|
25852
|
+
).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
|
|
25853
|
+
"--brief <text>",
|
|
25854
|
+
"Required: what the work is and what done looks like, plain text, up to 4000 characters"
|
|
25855
|
+
).option(
|
|
25856
|
+
"--mode <mode>",
|
|
25857
|
+
`The task mode you suggest (${GRANT_MODE_NAMES.join(", ")}); the owner or operator decides`
|
|
25858
|
+
).option(
|
|
25859
|
+
"--reward <amount>",
|
|
25860
|
+
"The reward you suggest, in the payment token (e.g. 5); the owner or operator decides"
|
|
25861
|
+
).action(async (id, opts) => {
|
|
25862
|
+
const projectId = parseProjectId(id);
|
|
25863
|
+
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25864
|
+
const body = suggestBody(projectId, opts);
|
|
25865
|
+
if ("error" in body) return void printError(String(body.error));
|
|
25866
|
+
await postProjectWrite(`/api/projects/${projectId}/suggestions`, body, {
|
|
25867
|
+
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
25868
|
+
});
|
|
25869
|
+
});
|
|
25870
|
+
var projectSuggestionsCommand = new Command128("suggestions").description(
|
|
25871
|
+
"List a project's suggestions with its suggestions settings, most upvoted first or, with --sort backed, most pool shares among the voters who back the project first. Each carries votes, backedShares and, when your wallet signs the read, whether you voted (free)"
|
|
25872
|
+
).argument("<projectId>", "Project id").option(
|
|
25873
|
+
"--status <status>",
|
|
25874
|
+
`Only suggestions in this status: ${PROJECT_SUGGESTION_STATUSES.join(", ")}`
|
|
25875
|
+
).option("--sort <sort>", "votes (default) or backed").option(
|
|
25876
|
+
"--limit <count>",
|
|
25877
|
+
`Suggestions per page (1-${PROJECT_SUGGESTIONS_LIST_MAX}, default ${PROJECT_SUGGESTIONS_LIST_DEFAULT})`
|
|
25878
|
+
).option(
|
|
25879
|
+
"--cursor <cursor>",
|
|
25880
|
+
"The next page: the previous page's nextCursor, with the same --status and --sort"
|
|
25881
|
+
).action(async (id, opts) => {
|
|
25882
|
+
const projectId = parseProjectId(id);
|
|
25883
|
+
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25884
|
+
const query4 = suggestionsQuery(opts);
|
|
25885
|
+
if (typeof query4 !== "string") return void printError(query4.error);
|
|
25886
|
+
await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
|
|
25887
|
+
});
|
|
25888
|
+
var showCommand3 = new Command128("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
25889
|
+
const id = parseSuggestionId(value);
|
|
25890
|
+
if (typeof id !== "string") return void printError(id.error);
|
|
25891
|
+
await signedRead(`/api/project-suggestions/${id}`);
|
|
25892
|
+
});
|
|
25893
|
+
function voteCommand(action, description) {
|
|
25894
|
+
return new Command128(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
25895
|
+
const suggestionId = parseSuggestionId(value);
|
|
25896
|
+
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
25897
|
+
const auth = await signReadAuth();
|
|
25898
|
+
if (auth && Object.keys(auth.headers).length === 0) {
|
|
25899
|
+
return void printError(`Could not sign with your wallet: ${auth.error ?? "unknown error"}`);
|
|
25900
|
+
}
|
|
25901
|
+
if (!auth) {
|
|
25902
|
+
return void printError(
|
|
25903
|
+
`${action === "vote" ? "Voting" : "Taking back a vote"} needs a wallet. Run \`taskmarket init\` first.`
|
|
25904
|
+
);
|
|
25905
|
+
}
|
|
25906
|
+
try {
|
|
25907
|
+
const chainId = selectedNetwork().chainId;
|
|
25908
|
+
const proof = await signWalletWrite("project-suggestion-vote", {
|
|
25909
|
+
action,
|
|
25910
|
+
chainId,
|
|
25911
|
+
suggestionId
|
|
25912
|
+
});
|
|
25913
|
+
const { data, idempotencyKey } = await apiPost(
|
|
25914
|
+
`/api/project-suggestions/${suggestionId}/${action}`,
|
|
25915
|
+
{ chainId, suggestionId, ...proof },
|
|
25916
|
+
{ headers: auth.headers }
|
|
25917
|
+
);
|
|
25918
|
+
printResult(data, { idempotencyKey });
|
|
25919
|
+
} catch (err) {
|
|
25920
|
+
renderFailure(err);
|
|
25921
|
+
}
|
|
25922
|
+
});
|
|
25923
|
+
}
|
|
25924
|
+
var withdrawCommand2 = new Command128("withdraw").description("Withdraw your open suggestion, as its author (costs 0.001 in the payment token)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
25925
|
+
const suggestionId = parseSuggestionId(value);
|
|
25926
|
+
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
25927
|
+
await postProjectWrite(
|
|
25928
|
+
`/api/project-suggestions/${suggestionId}/withdraw`,
|
|
25929
|
+
{ suggestionId },
|
|
25930
|
+
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
25931
|
+
);
|
|
25932
|
+
});
|
|
25933
|
+
var declineCommand = new Command128("decline").description(
|
|
25934
|
+
"Decline an open suggestion, as the project's owner or an operator with an accepted grant; the reason is shown to everyone. Declining costs 0.001 in the payment token. To accept one instead, create its task with `project add-task <projectId> --suggestion <id>`, which pays the task's reward and any evaluator stake from the budget, plus the 0.001 action fee"
|
|
25935
|
+
).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
|
|
25936
|
+
const suggestionId = parseSuggestionId(value);
|
|
25937
|
+
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
25938
|
+
const parsed = ProjectSuggestionDeclineSchema.safeParse({ suggestionId, reason: opts.reason });
|
|
25939
|
+
if (!parsed.success) {
|
|
25940
|
+
return void printError(`--reason: ${parsed.error.issues[0].message}`);
|
|
25941
|
+
}
|
|
25942
|
+
await postProjectWrite(
|
|
25943
|
+
`/api/project-suggestions/${suggestionId}/decline`,
|
|
25944
|
+
{ suggestionId, ...parsed.data.reason !== void 0 ? { reason: parsed.data.reason } : {} },
|
|
25945
|
+
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
25946
|
+
);
|
|
25947
|
+
});
|
|
25948
|
+
var projectSuggestionCommand = new Command128("suggestion").description(
|
|
25949
|
+
"One project suggestion: show it, upvote it or take the upvote back (free, signed by your wallet), withdraw it as its author, or decline it as the owner or an operator"
|
|
25950
|
+
).addCommand(showCommand3).addCommand(
|
|
25951
|
+
voteCommand(
|
|
25952
|
+
"vote",
|
|
25953
|
+
"Upvote a suggestion, as a wallet that may suggest on its project; one vote per wallet (free, signed by your wallet)"
|
|
25954
|
+
)
|
|
25955
|
+
).addCommand(
|
|
25956
|
+
voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
|
|
25957
|
+
).addCommand(withdrawCommand2).addCommand(declineCommand);
|
|
25958
|
+
var projectSuggestionSettingsCommand = new Command128("suggestion-settings").description(
|
|
25959
|
+
"Read or set the project's suggestions settings, as its owner: who may post and upvote suggestions (off, backers or anyone) and whether hosted agents that operate the project accept and decline suggestions by themselves (on by default). Turning hosted operators off keeps their grants. Setting costs 0.001 in the payment token; reading is free"
|
|
25960
|
+
).argument("<projectId>", "Project id").option(
|
|
25961
|
+
"--suggestions <setting>",
|
|
25962
|
+
"off (no one), backers (the owner, operators and backers) or anyone (any wallet)"
|
|
25963
|
+
).option(
|
|
25964
|
+
"--hosted-operators <on|off>",
|
|
25965
|
+
"Whether hosted operators act on suggestions by themselves"
|
|
25966
|
+
).action(async (id, opts) => {
|
|
25967
|
+
const projectId = parseProjectId(id);
|
|
25968
|
+
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25969
|
+
const body = suggestionSettingsBody(projectId, opts);
|
|
25970
|
+
if (body === null) {
|
|
25971
|
+
try {
|
|
25972
|
+
const view = await apiGet(withChainId(`/api/projects/${projectId}`));
|
|
25973
|
+
printResult({
|
|
25974
|
+
chainId: view.project?.chainId,
|
|
25975
|
+
projectId: view.project?.projectId ?? projectId,
|
|
25976
|
+
suggestions: view.suggestions ?? null
|
|
25977
|
+
});
|
|
25978
|
+
} catch (err) {
|
|
25979
|
+
renderFailure(err);
|
|
25980
|
+
}
|
|
25981
|
+
return;
|
|
25982
|
+
}
|
|
25983
|
+
if ("error" in body) return void printError(String(body.error));
|
|
25984
|
+
await postProjectWrite(`/api/projects/${projectId}/suggestions/settings`, body, {
|
|
25985
|
+
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
25986
|
+
});
|
|
25987
|
+
});
|
|
25988
|
+
|
|
25989
|
+
// src/commands/project/add-task.ts
|
|
25740
25990
|
function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
|
|
25741
25991
|
if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
|
|
25742
25992
|
const endsAt = new Date(project.endsAt);
|
|
@@ -25798,7 +26048,7 @@ function parseContinuation(flags) {
|
|
|
25798
26048
|
function collect5(value, previous = []) {
|
|
25799
26049
|
return [...previous, value];
|
|
25800
26050
|
}
|
|
25801
|
-
var projectAddTaskCommand = new
|
|
26051
|
+
var projectAddTaskCommand = new Command129("add-task").description(
|
|
25802
26052
|
"Create a task of any mode funded from a project's budget, as its owner or an operator with an accepted grant. Takes every flag of task create; the reward and any evaluator stake come out of the budget (costs 0.001 in the payment token)"
|
|
25803
26053
|
).argument("<projectId>", "Project id");
|
|
25804
26054
|
for (const option of createCmd.options) {
|
|
@@ -25814,6 +26064,9 @@ projectAddTaskCommand.option(
|
|
|
25814
26064
|
).option(
|
|
25815
26065
|
"--share-inputs",
|
|
25816
26066
|
"As the project's owner, share the input files of a parent that hides them (private, or submission visibility other than public) with this task's worker"
|
|
26067
|
+
).option(
|
|
26068
|
+
"--suggestion <id>",
|
|
26069
|
+
"Accept this open suggestion on the project: the task is linked to it and credits its author. As the owner or an operator with an accepted grant; normally refused before payment when the suggestion is not open, is on another project, or you are a hosted operator the owner keeps off suggestions"
|
|
25817
26070
|
);
|
|
25818
26071
|
projectAddTaskCommand.action(async (id, opts) => {
|
|
25819
26072
|
try {
|
|
@@ -25821,6 +26074,10 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25821
26074
|
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25822
26075
|
const parsed = parseContinuation(opts);
|
|
25823
26076
|
if ("error" in parsed) return void printError(parsed.error);
|
|
26077
|
+
const suggestionId = opts.suggestion === void 0 ? void 0 : parseSuggestionId(opts.suggestion);
|
|
26078
|
+
if (typeof suggestionId === "object") {
|
|
26079
|
+
return void printError(`--suggestion: ${suggestionId.error}`);
|
|
26080
|
+
}
|
|
25824
26081
|
const warnings = [];
|
|
25825
26082
|
let project;
|
|
25826
26083
|
try {
|
|
@@ -25834,7 +26091,8 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25834
26091
|
await runCreateTask(opts, {
|
|
25835
26092
|
warnings,
|
|
25836
26093
|
projectId,
|
|
25837
|
-
...parsed.continuation ? { continuation: parsed.continuation } : {}
|
|
26094
|
+
...parsed.continuation ? { continuation: parsed.continuation } : {},
|
|
26095
|
+
...suggestionId !== void 0 ? { suggestionId } : {}
|
|
25838
26096
|
});
|
|
25839
26097
|
} catch (err) {
|
|
25840
26098
|
renderFailure(err);
|
|
@@ -25842,7 +26100,7 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25842
26100
|
});
|
|
25843
26101
|
|
|
25844
26102
|
// src/commands/project/automations.ts
|
|
25845
|
-
import { Command as
|
|
26103
|
+
import { Command as Command130 } from "commander";
|
|
25846
26104
|
function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
25847
26105
|
if (opts.cap === void 0) {
|
|
25848
26106
|
return { error: "--cap is required: the most the automations may draw from the budget" };
|
|
@@ -25871,7 +26129,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
25871
26129
|
}
|
|
25872
26130
|
return body;
|
|
25873
26131
|
}
|
|
25874
|
-
var projectAutomationsOnCommand = new
|
|
26132
|
+
var projectAutomationsOnCommand = new Command130("on").description(
|
|
25875
26133
|
"Turn the project's automations on, so its schedules and workflows run. Grants the platform runner of the project's chain, which you never name, with a cap: the most the automations may draw from the budget in total, net of refunds (payouts keep counting). The cap is required. On a project whose automations are on, a higher cap raises it and a lower one is refused; turning them on again after off, or raising the cap, needs a chain on contract revision 29 and is refused before payment otherwise. Optional limits (contract revision 29): --expires, and --period-budget with --period; on states them whole, so none stated clears an expiry and a period budget. Schedules paused by off stay paused: resume each one (costs 0.001 in the payment token)"
|
|
25876
26134
|
).argument("<projectId>", "Project id").option(
|
|
25877
26135
|
"--cap <amount>",
|
|
@@ -25899,7 +26157,7 @@ var projectAutomationsOnCommand = new Command129("on").description(
|
|
|
25899
26157
|
});
|
|
25900
26158
|
}
|
|
25901
26159
|
);
|
|
25902
|
-
var projectAutomationsOffCommand = new
|
|
26160
|
+
var projectAutomationsOffCommand = new Command130("off").description(
|
|
25903
26161
|
"Turn the project's automations off: revokes the platform runner's grant and pauses the project's schedules and workflow schedules (reason automations_off). Their definitions stay, tasks already started finish under you, and turning automations on again does not resume them (costs 0.001 in the payment token)"
|
|
25904
26162
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
25905
26163
|
const projectId = parseProjectId(id);
|
|
@@ -25910,7 +26168,7 @@ var projectAutomationsOffCommand = new Command129("off").description(
|
|
|
25910
26168
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
25911
26169
|
);
|
|
25912
26170
|
});
|
|
25913
|
-
var projectAutomationsStatusCommand = new
|
|
26171
|
+
var projectAutomationsStatusCommand = new Command130("status").description(
|
|
25914
26172
|
"Whether the project's schedules and workflows can run: state on, off, pending (granted, the runner has not accepted yet) or unavailable (no runner on the chain), with the cap, what is spent and what remains, and whether it can be turned on again or its cap raised (free)"
|
|
25915
26173
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
25916
26174
|
const projectId = parseProjectId(id);
|
|
@@ -25921,13 +26179,13 @@ var projectAutomationsStatusCommand = new Command129("status").description(
|
|
|
25921
26179
|
renderFailure(err);
|
|
25922
26180
|
}
|
|
25923
26181
|
});
|
|
25924
|
-
var projectAutomationsCommand = new
|
|
26182
|
+
var projectAutomationsCommand = new Command130("automations").description(
|
|
25925
26183
|
"The project's automations: one switch for its schedules and workflows. `on --cap <amount>` grants the platform runner of the project chain for you, `off` revokes it and pauses schedules, `status` reads it. `project runner` and `project grant` remain for advanced use"
|
|
25926
26184
|
).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
|
|
25927
26185
|
|
|
25928
26186
|
// src/commands/project/claim.ts
|
|
25929
|
-
import { Command as
|
|
25930
|
-
var projectClaimCommand = new
|
|
26187
|
+
import { Command as Command131 } from "commander";
|
|
26188
|
+
var projectClaimCommand = new Command131("claim").description(
|
|
25931
26189
|
"Pay a backer its share of a closed or ended project's leftovers: what was unspent plus every later refund, in proportion to its pool shares, less what it already claimed. Anyone may trigger it; the money always goes to the backer. Refused before payment when nothing is owed (costs 0.001 in the payment token)"
|
|
25932
26190
|
).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
|
|
25933
26191
|
const projectId = parseProjectId(id);
|
|
@@ -25947,8 +26205,8 @@ var projectClaimCommand = new Command130("claim").description(
|
|
|
25947
26205
|
});
|
|
25948
26206
|
|
|
25949
26207
|
// src/commands/project/close.ts
|
|
25950
|
-
import { Command as
|
|
25951
|
-
var projectCloseCommand = new
|
|
26208
|
+
import { Command as Command132 } from "commander";
|
|
26209
|
+
var projectCloseCommand = new Command132("close").description(
|
|
25952
26210
|
"Close a project: its unspent budget becomes the backers' pot, which each backer, the owner included, claims with `project claim`. The owner may close it any time, anyone once it is past its end date; tasks already funded run on and their refunds join the pot (costs 0.001 in the payment token)"
|
|
25953
26211
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
25954
26212
|
const projectId = parseProjectId(id);
|
|
@@ -25961,8 +26219,8 @@ var projectCloseCommand = new Command131("close").description(
|
|
|
25961
26219
|
});
|
|
25962
26220
|
|
|
25963
26221
|
// src/commands/project/create.ts
|
|
25964
|
-
import { Command as
|
|
25965
|
-
var projectCreateCommand = new
|
|
26222
|
+
import { Command as Command133 } from "commander";
|
|
26223
|
+
var projectCreateCommand = new Command133("create").description(
|
|
25966
26224
|
"Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
|
|
25967
26225
|
).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
|
|
25968
26226
|
"--ends-at <time>",
|
|
@@ -25970,12 +26228,17 @@ var projectCreateCommand = new Command132("create").description(
|
|
|
25970
26228
|
).option(
|
|
25971
26229
|
"--task-grace <duration>",
|
|
25972
26230
|
"How long after the end date the project's tasks may run, fixed at creation: 0, or up to 90d (default 30d). Every project task must end by then, and backers can claim once the last one ends"
|
|
25973
|
-
).option("--name <text>", "A short name for the project: 1 to 80 characters of plain text").option("--goal <text>", "What the project is for: up to 500 characters of plain text").
|
|
26231
|
+
).option("--name <text>", "A short name for the project: 1 to 80 characters of plain text").option("--goal <text>", "What the project is for: up to 500 characters of plain text").option(
|
|
26232
|
+
"--suggestions <setting>",
|
|
26233
|
+
"Who may post and upvote suggestions: off (no one), backers (the owner, operators and backers; the default) or anyone (any wallet). Change it later with `project suggestion-settings`"
|
|
26234
|
+
).action(
|
|
25974
26235
|
async (opts) => {
|
|
25975
26236
|
const name = opts.name === void 0 ? void 0 : ProjectNameSchema.safeParse(opts.name);
|
|
25976
26237
|
if (name && !name.success) return void printError(`--name: ${name.error.issues[0].message}`);
|
|
25977
26238
|
const goal = opts.goal === void 0 ? void 0 : ProjectGoalSchema.safeParse(opts.goal);
|
|
25978
26239
|
if (goal && !goal.success) return void printError(`--goal: ${goal.error.issues[0].message}`);
|
|
26240
|
+
const suggestions = opts.suggestions === void 0 ? void 0 : parseSuggestionsSetting(opts.suggestions);
|
|
26241
|
+
if (typeof suggestions === "object") return void printError(suggestions.error);
|
|
25979
26242
|
const budget = parseAmount(opts.budget, "--budget");
|
|
25980
26243
|
if (typeof budget !== "string") return void printError(budget.error);
|
|
25981
26244
|
const endsAt = parseEndsAt(opts.endsAt);
|
|
@@ -25989,7 +26252,8 @@ var projectCreateCommand = new Command132("create").description(
|
|
|
25989
26252
|
endsAt,
|
|
25990
26253
|
...taskGraceSecs === void 0 ? {} : { taskGraceSecs },
|
|
25991
26254
|
...name?.success ? { name: name.data } : {},
|
|
25992
|
-
...goal?.success ? { goal: goal.data } : {}
|
|
26255
|
+
...goal?.success ? { goal: goal.data } : {},
|
|
26256
|
+
...suggestions === void 0 ? {} : { suggestions }
|
|
25993
26257
|
},
|
|
25994
26258
|
{ maxAmount: budget }
|
|
25995
26259
|
);
|
|
@@ -25997,9 +26261,9 @@ var projectCreateCommand = new Command132("create").description(
|
|
|
25997
26261
|
);
|
|
25998
26262
|
|
|
25999
26263
|
// src/commands/project/extend.ts
|
|
26000
|
-
import { Command as
|
|
26264
|
+
import { Command as Command134 } from "commander";
|
|
26001
26265
|
var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
|
|
26002
|
-
var projectExtendCommand = new
|
|
26266
|
+
var projectExtendCommand = new Command134("extend").description(
|
|
26003
26267
|
"Move an open project's end date later, as the project owner (costs 0.001 in the payment token). The new date must be later than the current one and at most 365 days from now. A closed project, or one past its end date, cannot be extended. Backers' shares and the pool's value do not change; a backer whose pot is still open claims at the new date"
|
|
26004
26268
|
).argument("<projectId>", "Project id").requiredOption("--ends <time>", "The new end date: ISO 8601 or a duration from now such as 90d").action(async (id, opts) => {
|
|
26005
26269
|
const projectId = parseProjectId(id);
|
|
@@ -26017,8 +26281,8 @@ var projectExtendCommand = new Command133("extend").description(
|
|
|
26017
26281
|
});
|
|
26018
26282
|
|
|
26019
26283
|
// src/commands/project/fund.ts
|
|
26020
|
-
import { Command as
|
|
26021
|
-
var projectFundCommand = new
|
|
26284
|
+
import { Command as Command135 } from "commander";
|
|
26285
|
+
var projectFundCommand = new Command135("fund").description(
|
|
26022
26286
|
"Back an open project: pay into its funding pool, from any wallet. You (or --on-behalf-of) become a backer holding shares bought at the pool's current value (what it holds plus what its live tasks hold), and once the project is closed or past its end date each backer claims its share of what is left with `project claim` (costs the amount, in the payment token)"
|
|
26023
26287
|
).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
|
|
26024
26288
|
"--on-behalf-of <address>",
|
|
@@ -26040,7 +26304,7 @@ var projectFundCommand = new Command134("fund").description(
|
|
|
26040
26304
|
});
|
|
26041
26305
|
|
|
26042
26306
|
// src/commands/project/grant.ts
|
|
26043
|
-
import { Command as
|
|
26307
|
+
import { Command as Command136 } from "commander";
|
|
26044
26308
|
function grantBody(projectId, opts) {
|
|
26045
26309
|
if (!ADDRESS.test(opts.operator)) {
|
|
26046
26310
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26063,7 +26327,7 @@ function grantBody(projectId, opts) {
|
|
|
26063
26327
|
revokeRemovesControl: opts.revokeRemovesControl
|
|
26064
26328
|
};
|
|
26065
26329
|
}
|
|
26066
|
-
var projectGrantCommand = new
|
|
26330
|
+
var projectGrantCommand = new Command136("grant").description(
|
|
26067
26331
|
"Grant a wallet (an agent or a person) the right to create tasks from the project's budget under the terms below. It can spend only after it accepts, which freezes the terms; until then a new grant replaces them, and a revoked operator can be granted again, back to pending (costs 0.001 in the payment token)"
|
|
26068
26332
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
|
|
26069
26333
|
"--cap <amount>",
|
|
@@ -26089,7 +26353,7 @@ var projectGrantCommand = new Command135("grant").description(
|
|
|
26089
26353
|
});
|
|
26090
26354
|
|
|
26091
26355
|
// src/commands/project/review.ts
|
|
26092
|
-
import { Command as
|
|
26356
|
+
import { Command as Command137 } from "commander";
|
|
26093
26357
|
function reviewEvaluator(opts) {
|
|
26094
26358
|
if (opts.evaluator !== void 0 && opts.off) {
|
|
26095
26359
|
return { error: "Pass --evaluator <address> or --off, not both" };
|
|
@@ -26104,7 +26368,7 @@ function reviewEvaluator(opts) {
|
|
|
26104
26368
|
}
|
|
26105
26369
|
return opts.evaluator;
|
|
26106
26370
|
}
|
|
26107
|
-
var projectReviewCommand = new
|
|
26371
|
+
var projectReviewCommand = new Command137("review").description(
|
|
26108
26372
|
"Read, set or clear the project's review default, as its owner. With an evaluator set, every task created through the API from the project gets that evaluator, and a project task that names a different one is refused. Enforced by the API, not the contract. Setting or clearing costs 0.001 in the payment token; reading is free"
|
|
26109
26373
|
).argument("<projectId>", "Project id").option("--evaluator <address>", "The evaluator every project task gets").option("--off", "Turn the review default off: each task's requester reviews it again").action(async (id, opts) => {
|
|
26110
26374
|
const projectId = parseProjectId(id);
|
|
@@ -26146,8 +26410,8 @@ async function ownerEvaluatorWarnings(evaluator) {
|
|
|
26146
26410
|
}
|
|
26147
26411
|
|
|
26148
26412
|
// src/commands/project/raise-cap.ts
|
|
26149
|
-
import { Command as
|
|
26150
|
-
var projectRaiseCapCommand = new
|
|
26413
|
+
import { Command as Command138 } from "commander";
|
|
26414
|
+
var projectRaiseCapCommand = new Command138("raise-cap").description(
|
|
26151
26415
|
"Advanced. Raise any operator's spending cap in place, as the project owner (costs 0.001 in the payment token). For the platform runner use `project automations on --cap <higher amount>`, which takes the same path. The new cap must be above the current one, which must be set; a cap is never lowered, and a revoked operator is granted again instead"
|
|
26152
26416
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to raise").requiredOption("--cap <amount>", "The new cap in the payment token, above the current cap").action(async (id, opts) => {
|
|
26153
26417
|
const projectId = parseProjectId(id);
|
|
@@ -26165,8 +26429,8 @@ var projectRaiseCapCommand = new Command137("raise-cap").description(
|
|
|
26165
26429
|
});
|
|
26166
26430
|
|
|
26167
26431
|
// src/commands/project/lower-cap.ts
|
|
26168
|
-
import { Command as
|
|
26169
|
-
var projectLowerCapCommand = new
|
|
26432
|
+
import { Command as Command139 } from "commander";
|
|
26433
|
+
var projectLowerCapCommand = new Command139("lower-cap").description(
|
|
26170
26434
|
"Advanced. Lower an operator's lifetime spending cap in place, as the project owner (costs 0.001 in the payment token; contract revision 29 or later). The new cap must be below the current one (any cap lowers a grant that has none) and at least what the operator already draws (committed). To raise a cap use `project raise-cap`; for the platform runner, `project automations on --cap`"
|
|
26171
26435
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
|
|
26172
26436
|
"--cap <amount>",
|
|
@@ -26188,7 +26452,7 @@ var projectLowerCapCommand = new Command138("lower-cap").description(
|
|
|
26188
26452
|
});
|
|
26189
26453
|
|
|
26190
26454
|
// src/commands/project/limits.ts
|
|
26191
|
-
import { Command as
|
|
26455
|
+
import { Command as Command140 } from "commander";
|
|
26192
26456
|
function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
26193
26457
|
if (!ADDRESS.test(opts.operator)) {
|
|
26194
26458
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26228,7 +26492,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
26228
26492
|
}
|
|
26229
26493
|
return body;
|
|
26230
26494
|
}
|
|
26231
|
-
var projectLimitsCommand = new
|
|
26495
|
+
var projectLimitsCommand = new Command140("limits").description(
|
|
26232
26496
|
"Advanced. Set all of an operator's limits as the project owner, stated whole: a flag you leave out is no limit of that kind (costs 0.001 in the payment token; contract revision 29 or later). The limits bound the operator on top of its cap: an expiry, the task modes it may create, the most one task may hold, and a budget per week or month. For the platform runner, `project automations on` takes --expires, --period-budget and --period"
|
|
26233
26497
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
|
|
26234
26498
|
"--expires <time>",
|
|
@@ -26250,8 +26514,8 @@ var projectLimitsCommand = new Command139("limits").description(
|
|
|
26250
26514
|
});
|
|
26251
26515
|
|
|
26252
26516
|
// src/commands/project/revoke.ts
|
|
26253
|
-
import { Command as
|
|
26254
|
-
var projectRevokeCommand = new
|
|
26517
|
+
import { Command as Command141 } from "commander";
|
|
26518
|
+
var projectRevokeCommand = new Command141("revoke").description(
|
|
26255
26519
|
"End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
|
|
26256
26520
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
|
|
26257
26521
|
const projectId = parseProjectId(id);
|
|
@@ -26270,7 +26534,7 @@ var projectRevokeCommand = new Command140("revoke").description(
|
|
|
26270
26534
|
});
|
|
26271
26535
|
|
|
26272
26536
|
// src/commands/project/schedule.ts
|
|
26273
|
-
import { Command as
|
|
26537
|
+
import { Command as Command143 } from "commander";
|
|
26274
26538
|
|
|
26275
26539
|
// src/lib/owner-list.ts
|
|
26276
26540
|
import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
|
|
@@ -26311,7 +26575,7 @@ function ownerListQuery(owner, opts, statuses) {
|
|
|
26311
26575
|
|
|
26312
26576
|
// src/commands/workflow-template.ts
|
|
26313
26577
|
import { readFile as readFile4 } from "fs/promises";
|
|
26314
|
-
import { Command as
|
|
26578
|
+
import { Command as Command142 } from "commander";
|
|
26315
26579
|
var UUID2 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
26316
26580
|
var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
|
|
26317
26581
|
var FILE_MAX_BYTES = 256 * 1024;
|
|
@@ -26405,7 +26669,7 @@ async function readValidTemplate(path9) {
|
|
|
26405
26669
|
}
|
|
26406
26670
|
return parsed.document;
|
|
26407
26671
|
}
|
|
26408
|
-
var createCommand3 = new
|
|
26672
|
+
var createCommand3 = new Command142("create").description(
|
|
26409
26673
|
"Save a workflow template from a JSON file: a workflow document whose strings use {{param}} placeholders, with each parameter declared (type string, integer, amount or list; a default; bounds). It is checked with every parameter at its minimum and its maximum before it is saved. Costs 0.001 in the payment token"
|
|
26410
26674
|
).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
|
|
26411
26675
|
const template = await readValidTemplate(opts.file);
|
|
@@ -26416,7 +26680,7 @@ var createCommand3 = new Command141("create").description(
|
|
|
26416
26680
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26417
26681
|
);
|
|
26418
26682
|
});
|
|
26419
|
-
var updateCommand = new
|
|
26683
|
+
var updateCommand = new Command142("update").description(
|
|
26420
26684
|
"Replace a saved template with a JSON file, as the wallet that saved it. A change to its content makes a new version; workflows already made from it keep their document until their owner runs `taskmarket workflow update-template`. Costs 0.001 in the payment token"
|
|
26421
26685
|
).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
|
|
26422
26686
|
const choice = templateChoice(value);
|
|
@@ -26470,7 +26734,7 @@ function parseTemplateSearch(opts) {
|
|
|
26470
26734
|
}
|
|
26471
26735
|
return { query: query4 };
|
|
26472
26736
|
}
|
|
26473
|
-
var listCommand6 = new
|
|
26737
|
+
var listCommand6 = new Command142("list").description(
|
|
26474
26738
|
"List the official templates (official: true, ids official:<slug>), the built-in presets and a wallet's saved templates, newest first (your wallet unless --owner is given). Any wallet may make a workflow from any of them (free). With --search, --tag, --featured or --sort, search instead: one page of templates, featured first, with `hasMore`, `nextCursor` and the catalog's most used tags in `catalogTags`; each template lists its `tags` and `featured`"
|
|
26475
26739
|
).option("--owner <address>", "The wallet whose templates to list").option(
|
|
26476
26740
|
"--mine",
|
|
@@ -26555,7 +26819,7 @@ var listCommand6 = new Command141("list").description(
|
|
|
26555
26819
|
}
|
|
26556
26820
|
}
|
|
26557
26821
|
);
|
|
26558
|
-
var
|
|
26822
|
+
var showCommand4 = new Command142("show").description(
|
|
26559
26823
|
"Show a saved template, an official template (official:<slug>) or a preset (code, content, research): its version (a counter for a saved template, a content hash for an official one), the earlier versions of a saved template as `versions` (number, hash, date), whether it is `listed` in the gallery, its parameters, steps and worst case (free)"
|
|
26560
26824
|
).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
|
|
26561
26825
|
const choice = templateChoice(value);
|
|
@@ -26578,7 +26842,7 @@ function savedTemplateId(value, verb) {
|
|
|
26578
26842
|
}
|
|
26579
26843
|
return choice.templateId;
|
|
26580
26844
|
}
|
|
26581
|
-
var publishCommand = new
|
|
26845
|
+
var publishCommand = new Command142("publish").description(
|
|
26582
26846
|
"List a saved template in the public gallery, as the wallet that saved it, so others can find it with `template list --gallery` (and on the web Templates page) without being given its id; it is shown with your wallet as its author. It needs a description and at most 10 templates per wallet can be listed. Listing again changes nothing. Costs 0.001 in the payment token"
|
|
26583
26847
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
26584
26848
|
const id = savedTemplateId(value, "publish");
|
|
@@ -26589,7 +26853,7 @@ var publishCommand = new Command141("publish").description(
|
|
|
26589
26853
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26590
26854
|
);
|
|
26591
26855
|
});
|
|
26592
|
-
var unpublishCommand = new
|
|
26856
|
+
var unpublishCommand = new Command142("unpublish").description(
|
|
26593
26857
|
"Take a saved template out of the public gallery, as the wallet that saved it. It stays usable by anyone who has its id. Costs 0.001 in the payment token"
|
|
26594
26858
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
26595
26859
|
const id = savedTemplateId(value, "unpublish");
|
|
@@ -26600,7 +26864,7 @@ var unpublishCommand = new Command141("unpublish").description(
|
|
|
26600
26864
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26601
26865
|
);
|
|
26602
26866
|
});
|
|
26603
|
-
var deleteCommand2 = new
|
|
26867
|
+
var deleteCommand2 = new Command142("delete").description(
|
|
26604
26868
|
"Delete a saved template, as the wallet that saved it; workflows already made from it are unaffected. Costs 0.001 in the payment token"
|
|
26605
26869
|
).argument("<templateId>", "Template id").action(async (value) => {
|
|
26606
26870
|
const choice = templateChoice(value);
|
|
@@ -26617,9 +26881,9 @@ var deleteCommand2 = new Command141("delete").description(
|
|
|
26617
26881
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26618
26882
|
);
|
|
26619
26883
|
});
|
|
26620
|
-
var workflowTemplateCommand = new
|
|
26884
|
+
var workflowTemplateCommand = new Command142("template").description(
|
|
26621
26885
|
"Workflow templates: a workflow saved once with declared parameters ({{reward}}, {{topic}}) and made into a workflow on any of your projects with `taskmarket workflow create <projectId> --template <id|official:slug|preset> --param name=value`. Any wallet may use any template; only the wallet that saved one may update or delete it. Official templates: see `taskmarket workflow template list`. Presets: code, content, research"
|
|
26622
|
-
).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(
|
|
26886
|
+
).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
|
|
26623
26887
|
async function createWorkflowFromTemplate(projectId, template, pairs) {
|
|
26624
26888
|
const choice = templateChoice(template);
|
|
26625
26889
|
if ("error" in choice) return void printError(choice.error);
|
|
@@ -26830,7 +27094,7 @@ async function read(path9) {
|
|
|
26830
27094
|
renderFailure(err);
|
|
26831
27095
|
}
|
|
26832
27096
|
}
|
|
26833
|
-
var createCommand4 = new
|
|
27097
|
+
var createCommand4 = new Command143("create").description(
|
|
26834
27098
|
"Create a schedule that opens a task from the project's budget on a cadence, or starts a run of a workflow (--workflow or --workflow-file), as the project's owner. The platform runner creates each task or run under your grant to it, and pays the action fee: grant it first (see `taskmarket project runner`). A slot is skipped while the previous task is open or the previous run is not settled, and failures in a row (3 by default) pause the schedule. Costs 0.001 in the payment token"
|
|
26835
27099
|
).argument("<projectId>", "Project id").requiredOption(
|
|
26836
27100
|
"--cadence <cadence>",
|
|
@@ -26869,7 +27133,7 @@ var createCommand4 = new Command142("create").description(
|
|
|
26869
27133
|
});
|
|
26870
27134
|
});
|
|
26871
27135
|
var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
|
|
26872
|
-
var listCommand7 = new
|
|
27136
|
+
var listCommand7 = new Command143("list").description(
|
|
26873
27137
|
"List a project's schedules, its schedule limits and the platform runner; or, with --mine or --owner, a wallet's schedules across every project it owns, failing ones first, each with its next and last run (free)"
|
|
26874
27138
|
).argument("[projectId]", "Project id (omit with --mine or --owner)").option("--mine", "List the acting wallet's schedules across the projects it owns").option("--owner <address>", "List this wallet's schedules across the projects it owns").option(
|
|
26875
27139
|
"--status <status>",
|
|
@@ -26902,7 +27166,7 @@ var listCommand7 = new Command142("list").description(
|
|
|
26902
27166
|
const query4 = params.toString();
|
|
26903
27167
|
await read(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
|
|
26904
27168
|
});
|
|
26905
|
-
var
|
|
27169
|
+
var showCommand5 = new Command143("show").description(
|
|
26906
27170
|
"Show a schedule (its target, task or workflow, with workflowId and template) and its newest runs: opened, skipped with the reason, or failed, each with its task or workflowRunId (free)"
|
|
26907
27171
|
).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
26908
27172
|
const id = scheduleId(value);
|
|
@@ -26910,7 +27174,7 @@ var showCommand4 = new Command142("show").description(
|
|
|
26910
27174
|
await read(`/api/project-schedules/${id}`);
|
|
26911
27175
|
});
|
|
26912
27176
|
function actionCommand(action, description) {
|
|
26913
|
-
return new
|
|
27177
|
+
return new Command143(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
26914
27178
|
const id = scheduleId(value);
|
|
26915
27179
|
if (typeof id !== "string") return void printError(id.error);
|
|
26916
27180
|
await postProjectWrite(
|
|
@@ -26920,7 +27184,7 @@ function actionCommand(action, description) {
|
|
|
26920
27184
|
);
|
|
26921
27185
|
});
|
|
26922
27186
|
}
|
|
26923
|
-
var settingsCommand = new
|
|
27187
|
+
var settingsCommand = new Command143("settings").description(
|
|
26924
27188
|
"Read or set the project's schedule limits, as its owner: the shortest gap between two runs (PT30M to P7D, default PT30M) and the failures in a row that pause a schedule (1 to 10, default 3). Setting costs 0.001 in the payment token; reading is free"
|
|
26925
27189
|
).argument("<projectId>", "Project id").option("--min-interval <duration>", "The shortest gap between runs, as an ISO 8601 duration").option("--pause-after <failures>", "Failures in a row that pause a schedule").action(async (id, opts) => {
|
|
26926
27190
|
const projectId = parseProjectId(id);
|
|
@@ -26942,9 +27206,9 @@ var settingsCommand = new Command142("settings").description(
|
|
|
26942
27206
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
26943
27207
|
});
|
|
26944
27208
|
});
|
|
26945
|
-
var projectScheduleCommand = new
|
|
27209
|
+
var projectScheduleCommand = new Command143("schedule").description(
|
|
26946
27210
|
"Schedules: a task from the project's budget on a cadence, created by the platform runner once the project's automations are on (`taskmarket project automations on <projectId> --cap <amount>`)"
|
|
26947
|
-
).addCommand(createCommand4).addCommand(listCommand7).addCommand(
|
|
27211
|
+
).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
|
|
26948
27212
|
actionCommand(
|
|
26949
27213
|
"pause",
|
|
26950
27214
|
"Pause a schedule; it creates nothing until resumed (costs 0.001 in the payment token)"
|
|
@@ -26965,15 +27229,15 @@ var projectScheduleCommand = new Command142("schedule").description(
|
|
|
26965
27229
|
"Stop automatic payouts and review acceptance on a workflow schedule, for good: every run it starts, and its runs still going, wait for the owner's confirmation; the runner sends nothing. Refused on a schedule that opens tasks (costs 0.001 in the payment token)"
|
|
26966
27230
|
)
|
|
26967
27231
|
).addCommand(settingsCommand);
|
|
26968
|
-
var projectRunnerCommand = new
|
|
27232
|
+
var projectRunnerCommand = new Command143("runner").description(
|
|
26969
27233
|
"Advanced. The platform runner's address on the selected network's chain, and every chain's runner (free). To run schedules and workflows turn automations on instead, `taskmarket project automations on <projectId> --cap <amount>`, which grants the right runner for you. Granting it by hand with `taskmarket project grant` works too; the runner pays each action fee"
|
|
26970
27234
|
).action(async () => {
|
|
26971
27235
|
await read(withChainId("/api/project-runner"));
|
|
26972
27236
|
});
|
|
26973
27237
|
|
|
26974
27238
|
// src/commands/project/transfer.ts
|
|
26975
|
-
import { Command as
|
|
26976
|
-
var proposeCommand = new
|
|
27239
|
+
import { Command as Command144 } from "commander";
|
|
27240
|
+
var proposeCommand = new Command144("propose").description(
|
|
26977
27241
|
"Propose a new owner for a project, as the project owner (costs 0.001 in the payment token). Nothing changes until that wallet runs `project transfer accept`; a new proposal replaces the old one, and `project transfer cancel` withdraws it. Only an open project can be handed over. On accept, the owner's own share of the project's pool moves to the new owner; other backers' shares never move, and the grants stay"
|
|
26978
27242
|
).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
|
|
26979
27243
|
const projectId = parseProjectId(id);
|
|
@@ -26987,7 +27251,7 @@ var proposeCommand = new Command143("propose").description(
|
|
|
26987
27251
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26988
27252
|
);
|
|
26989
27253
|
});
|
|
26990
|
-
var acceptCommand2 = new
|
|
27254
|
+
var acceptCommand2 = new Command144("accept").description(
|
|
26991
27255
|
"Take over a project its owner proposed to this wallet (costs 0.001 in the payment token). Read the project first (`project show`): you receive it as it stands, with its grants and tasks, and the previous owner's share of its pool. Only an open project can be accepted"
|
|
26992
27256
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26993
27257
|
const projectId = parseProjectId(id);
|
|
@@ -26998,7 +27262,7 @@ var acceptCommand2 = new Command143("accept").description(
|
|
|
26998
27262
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26999
27263
|
);
|
|
27000
27264
|
});
|
|
27001
|
-
var cancelCommand = new
|
|
27265
|
+
var cancelCommand = new Command144("cancel").description(
|
|
27002
27266
|
"Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
|
|
27003
27267
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27004
27268
|
const projectId = parseProjectId(id);
|
|
@@ -27009,13 +27273,13 @@ var cancelCommand = new Command143("cancel").description(
|
|
|
27009
27273
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27010
27274
|
);
|
|
27011
27275
|
});
|
|
27012
|
-
var projectTransferCommand = new
|
|
27276
|
+
var projectTransferCommand = new Command144("transfer").description(
|
|
27013
27277
|
"Hand a project to another wallet in two steps: the owner proposes, the new owner accepts, and the owner can cancel before it does"
|
|
27014
27278
|
).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
|
|
27015
27279
|
|
|
27016
27280
|
// src/commands/project/show.ts
|
|
27017
|
-
import { Command as
|
|
27018
|
-
var projectShowCommand = new
|
|
27281
|
+
import { Command as Command145 } from "commander";
|
|
27282
|
+
var projectShowCommand = new Command145("show").description(
|
|
27019
27283
|
"Show a project: its budget, funding pool, newest backers with what each can claim, grants, tasks and its tasks grouped into chains of versions (free)"
|
|
27020
27284
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27021
27285
|
const projectId = parseProjectId(id);
|
|
@@ -27024,7 +27288,7 @@ var projectShowCommand = new Command144("show").description(
|
|
|
27024
27288
|
printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
|
|
27025
27289
|
});
|
|
27026
27290
|
var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
|
|
27027
|
-
var projectBackersCommand = new
|
|
27291
|
+
var projectBackersCommand = new Command145("backers").description(
|
|
27028
27292
|
"List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
|
|
27029
27293
|
).argument("<projectId>", "Project id").option("--limit <count>", "Backers per page (1-100, default 50)").option("--before <cursor>", "The next page: the previous page's nextBefore").action(async (id, opts) => {
|
|
27030
27294
|
const projectId = parseProjectId(id);
|
|
@@ -27043,13 +27307,13 @@ var projectBackersCommand = new Command144("backers").description(
|
|
|
27043
27307
|
await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
|
|
27044
27308
|
);
|
|
27045
27309
|
});
|
|
27046
|
-
var projectForTaskCommand = new
|
|
27310
|
+
var projectForTaskCommand = new Command145("for-task").description("The project a task was funded from, or null when it was not (free)").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
27047
27311
|
if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
|
|
27048
27312
|
return void printError("The task id must be 0x-prefixed hex");
|
|
27049
27313
|
}
|
|
27050
27314
|
printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
|
|
27051
27315
|
});
|
|
27052
|
-
var projectListCommand = new
|
|
27316
|
+
var projectListCommand = new Command145("list").description(
|
|
27053
27317
|
"List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
|
|
27054
27318
|
).option(
|
|
27055
27319
|
"--funding",
|
|
@@ -27100,7 +27364,7 @@ var projectListCommand = new Command144("list").description(
|
|
|
27100
27364
|
);
|
|
27101
27365
|
|
|
27102
27366
|
// src/commands/project/index.ts
|
|
27103
|
-
var projectCommand = new
|
|
27367
|
+
var projectCommand = new Command146("project").description(
|
|
27104
27368
|
"Projects: one crowdfunded budget that funds tasks of any mode, spent by its owner and the operators it grants; anyone may back an open project, and backers claim back what is left"
|
|
27105
27369
|
);
|
|
27106
27370
|
projectCommand.addCommand(projectCreateCommand);
|
|
@@ -27118,6 +27382,10 @@ projectCommand.addCommand(projectReviewCommand);
|
|
|
27118
27382
|
projectCommand.addCommand(projectAutomationsCommand);
|
|
27119
27383
|
projectCommand.addCommand(projectScheduleCommand);
|
|
27120
27384
|
projectCommand.addCommand(projectRunnerCommand);
|
|
27385
|
+
projectCommand.addCommand(projectSuggestCommand);
|
|
27386
|
+
projectCommand.addCommand(projectSuggestionsCommand);
|
|
27387
|
+
projectCommand.addCommand(projectSuggestionCommand);
|
|
27388
|
+
projectCommand.addCommand(projectSuggestionSettingsCommand);
|
|
27121
27389
|
projectCommand.addCommand(projectCloseCommand);
|
|
27122
27390
|
projectCommand.addCommand(projectClaimCommand);
|
|
27123
27391
|
projectCommand.addCommand(projectShowCommand);
|
|
@@ -27127,7 +27395,7 @@ projectCommand.addCommand(projectForTaskCommand);
|
|
|
27127
27395
|
|
|
27128
27396
|
// src/commands/workflow.ts
|
|
27129
27397
|
import { readFile as readFile5 } from "fs/promises";
|
|
27130
|
-
import { Command as
|
|
27398
|
+
import { Command as Command147 } from "commander";
|
|
27131
27399
|
var UUID4 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
27132
27400
|
var FILE_MAX_BYTES2 = 256 * 1024;
|
|
27133
27401
|
function parseWorkflowText(text) {
|
|
@@ -27191,7 +27459,7 @@ async function projectContext(projectId) {
|
|
|
27191
27459
|
runner
|
|
27192
27460
|
};
|
|
27193
27461
|
}
|
|
27194
|
-
var validateCommand = new
|
|
27462
|
+
var validateCommand = new Command147("validate").description(
|
|
27195
27463
|
"Check a workflow document (JSON) before anything is spent: the patterns, ids, named inputs and outputs, bounds (maxItems, maxRounds, maxAttempts), contest modes, branch conditions and gate conditions; with --project, also the project step limit and the worst-case spend (every branch on its costliest case, every fallback attempt) against the project's available budget and the runner grant's remaining cap. Every error names a JSON pointer, a code and a message (free)"
|
|
27196
27464
|
).argument("[file]", "The document, JSON (or pass --file)").option("--file <path>", "The document, JSON").option("--project <projectId>", "Check it against this project").action(async (file, opts) => {
|
|
27197
27465
|
const parsed = await readDocument(opts.file ?? file);
|
|
@@ -27234,7 +27502,7 @@ var validateCommand = new Command146("validate").description(
|
|
|
27234
27502
|
document: result.document
|
|
27235
27503
|
});
|
|
27236
27504
|
});
|
|
27237
|
-
var createCommand5 = new
|
|
27505
|
+
var createCommand5 = new Command147("create").description(
|
|
27238
27506
|
"Create a workflow on a project, as its owner, from a JSON document (--file) or from a saved template, an official template or a preset (--template <id|official:slug|preset> with --param name=value for each value; a parameter left out takes its default). The API validates it again, worst case included, before saving; nothing runs until `taskmarket workflow run`. Grant the platform runner first (`taskmarket project runner`). Costs 0.001 in the payment token"
|
|
27239
27507
|
).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
|
|
27240
27508
|
"--template <template>",
|
|
@@ -27277,7 +27545,7 @@ var createCommand5 = new Command146("create").description(
|
|
|
27277
27545
|
);
|
|
27278
27546
|
});
|
|
27279
27547
|
var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
|
|
27280
|
-
var listCommand8 = new
|
|
27548
|
+
var listCommand8 = new Command147("list").description(
|
|
27281
27549
|
"List a project's workflows, newest first, with its workflow limits and the platform runner; or, with --mine or --owner, a wallet's workflows across every project it owns, those waiting on the owner first (free)"
|
|
27282
27550
|
).argument("[projectId]", "Project id (omit with --mine or --owner)").option("--mine", "List the acting wallet's workflows across the projects it owns").option("--owner <address>", "List this wallet's workflows across the projects it owns").option(
|
|
27283
27551
|
"--status <status>",
|
|
@@ -27307,7 +27575,7 @@ var listCommand8 = new Command146("list").description(
|
|
|
27307
27575
|
const query4 = params.toString();
|
|
27308
27576
|
await read2(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
|
|
27309
27577
|
});
|
|
27310
|
-
var
|
|
27578
|
+
var showCommand6 = new Command147("show").description(
|
|
27311
27579
|
"Show a workflow, its validated document, its newest runs and, for one made from a template, `workflow.templateUpdate` (the version it has, the template's latest and `available`); when an update is available a `note` says how to apply it (free)"
|
|
27312
27580
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27313
27581
|
const id = uuid(value, "workflow");
|
|
@@ -27320,7 +27588,7 @@ var showCommand5 = new Command146("show").description(
|
|
|
27320
27588
|
renderFailure(err);
|
|
27321
27589
|
}
|
|
27322
27590
|
});
|
|
27323
|
-
var updateTemplateCommand = new
|
|
27591
|
+
var updateTemplateCommand = new Command147("update-template").description(
|
|
27324
27592
|
"Apply the newest version of the template a workflow was made from, as the project owner: the document is made again from the template with the workflow's own parameter values and checked against the project, like a new workflow. It never happens on its own; `workflow show` says when an update is available. Runs already started keep the version they started with. Costs 0.001 in the payment token"
|
|
27325
27593
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27326
27594
|
const id = uuid(value, "workflow");
|
|
@@ -27331,7 +27599,7 @@ var updateTemplateCommand = new Command146("update-template").description(
|
|
|
27331
27599
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27332
27600
|
);
|
|
27333
27601
|
});
|
|
27334
|
-
var runsCommand = new
|
|
27602
|
+
var runsCommand = new Command147("runs").description("Page through a workflow's runs, newest first (free)").argument("<workflowId>", "Workflow id").option("--limit <count>", "Runs per page (1-100, default 20)").option("--cursor <cursor>", "nextCursor from the previous page").action(async (value, opts) => {
|
|
27335
27603
|
const id = uuid(value, "workflow");
|
|
27336
27604
|
if (typeof id !== "string") return void printError(id.error);
|
|
27337
27605
|
if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
|
|
@@ -27343,14 +27611,14 @@ var runsCommand = new Command146("runs").description("Page through a workflow's
|
|
|
27343
27611
|
const query4 = params.toString();
|
|
27344
27612
|
await read2(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
|
|
27345
27613
|
});
|
|
27346
|
-
var statusCommand3 = new
|
|
27614
|
+
var statusCommand3 = new Command147("status").description(
|
|
27347
27615
|
"Show a run: its outline, each step with its state (pending, open, accepted, failed or skipped), round, item or attempt, autoAccept for a gating review the runner accepts itself, and the next action (free)"
|
|
27348
27616
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27349
27617
|
const id = uuid(value, "run");
|
|
27350
27618
|
if (typeof id !== "string") return void printError(id.error);
|
|
27351
27619
|
await read2(`/api/project-workflow-runs/${id}`);
|
|
27352
27620
|
});
|
|
27353
|
-
var runCommand2 = new
|
|
27621
|
+
var runCommand2 = new Command147("run").description(
|
|
27354
27622
|
"Start a run of a workflow, as the project's owner. The API checks the worst case against the budget and the runner grant's cap again; then the platform runner creates each step's task when it is ready and you review them as usual. Costs 0.001 in the payment token"
|
|
27355
27623
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27356
27624
|
const id = uuid(value, "workflow");
|
|
@@ -27362,7 +27630,7 @@ var runCommand2 = new Command146("run").description(
|
|
|
27362
27630
|
);
|
|
27363
27631
|
});
|
|
27364
27632
|
function stepCommand(action, description) {
|
|
27365
|
-
return new
|
|
27633
|
+
return new Command147(action).description(description).argument("<runId>", "Run id").requiredOption(
|
|
27366
27634
|
"--step <key>",
|
|
27367
27635
|
"The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
|
|
27368
27636
|
).action(async (value, opts) => {
|
|
@@ -27377,7 +27645,7 @@ function stepCommand(action, description) {
|
|
|
27377
27645
|
);
|
|
27378
27646
|
});
|
|
27379
27647
|
}
|
|
27380
|
-
var cancelCommand2 = new
|
|
27648
|
+
var cancelCommand2 = new Command147("cancel").description(
|
|
27381
27649
|
"Cancel a run, as the owner: nothing more is created, and tasks it opened stay open until they end or you cancel them. Costs 0.001 in the payment token"
|
|
27382
27650
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27383
27651
|
const id = uuid(value, "run");
|
|
@@ -27388,7 +27656,7 @@ var cancelCommand2 = new Command146("cancel").description(
|
|
|
27388
27656
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27389
27657
|
);
|
|
27390
27658
|
});
|
|
27391
|
-
var stopAutoPayoutCommand = new
|
|
27659
|
+
var stopAutoPayoutCommand = new Command147("stop-auto-payout").description(
|
|
27392
27660
|
"Stop automatic payouts and automatic review acceptance on a run, as the owner, at once and for good: from then on every pending step's review waits for you to accept it and every payout becomes a proposal you confirm (`taskmarket workflow payout confirm`); the runner sends nothing. A second stop changes nothing; refused on a completed or cancelled run. Costs 0.001 in the payment token"
|
|
27393
27661
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27394
27662
|
const id = uuid(value, "run");
|
|
@@ -27399,7 +27667,7 @@ var stopAutoPayoutCommand = new Command146("stop-auto-payout").description(
|
|
|
27399
27667
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27400
27668
|
);
|
|
27401
27669
|
});
|
|
27402
|
-
var deleteCommand3 = new
|
|
27670
|
+
var deleteCommand3 = new Command147("delete").description(
|
|
27403
27671
|
"Delete a workflow, as the owner, so it no longer counts toward the project limit of 50. Refused while a run is running or failed (cancel it first); ended runs go with it, and tasks they opened are not touched. Costs 0.001 in the payment token"
|
|
27404
27672
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27405
27673
|
const id = uuid(value, "workflow");
|
|
@@ -27421,21 +27689,21 @@ async function ownerRead(path9) {
|
|
|
27421
27689
|
renderFailure(err);
|
|
27422
27690
|
}
|
|
27423
27691
|
}
|
|
27424
|
-
var payoutListCommand = new
|
|
27692
|
+
var payoutListCommand = new Command147("list").description(
|
|
27425
27693
|
"A run's payout proposals: what each accepted gating review recommends paying on the task it gates, with the exact accept confirming sends; visible to the project's owner and operators only (signed with your wallet); status is pending, confirmed, auto_paid (payout: auto, with mode, txHash and intentId) or unavailable (free)"
|
|
27426
27694
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27427
27695
|
const id = uuid(value, "run");
|
|
27428
27696
|
if (typeof id !== "string") return void printError(id.error);
|
|
27429
27697
|
await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
|
|
27430
27698
|
});
|
|
27431
|
-
var payoutShowCommand = new
|
|
27699
|
+
var payoutShowCommand = new Command147("show").description(
|
|
27432
27700
|
"Show a payout proposal: its status (pending, confirmed, auto_paid or unavailable), mode, txHash and intentId once sent, the ranking and rationale, and `accept`, the winners and shares (basis points) confirming sends; owner and operators only (free)"
|
|
27433
27701
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
27434
27702
|
const id = uuid(value, "payout proposal");
|
|
27435
27703
|
if (typeof id !== "string") return void printError(id.error);
|
|
27436
27704
|
await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
|
|
27437
27705
|
});
|
|
27438
|
-
var payoutConfirmCommand = new
|
|
27706
|
+
var payoutConfirmCommand = new Command147("confirm").description(
|
|
27439
27707
|
"Confirm a pending payout proposal, as the project's owner: sends exactly the accept it shows (`taskmarket workflow payout show` prints the winners and shares first), paying the gated task out. Refused unless the proposal is pending (an auto_paid one was already sent by the runner). Costs the accept, paid like `task accept-submissions`"
|
|
27440
27708
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
27441
27709
|
const id = uuid(value, "payout proposal");
|
|
@@ -27458,10 +27726,10 @@ var payoutConfirmCommand = new Command146("confirm").description(
|
|
|
27458
27726
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT, extra: { accept: view.accept } }
|
|
27459
27727
|
);
|
|
27460
27728
|
});
|
|
27461
|
-
var payoutCommand = new
|
|
27729
|
+
var payoutCommand = new Command147("payout").description(
|
|
27462
27730
|
"Payout proposals: a gating review's recommended winners and shares for the task it gates, which the owner confirms"
|
|
27463
27731
|
).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand);
|
|
27464
|
-
var settingsCommand2 = new
|
|
27732
|
+
var settingsCommand2 = new Command147("settings").description(
|
|
27465
27733
|
`Read or set the project's workflow step limit, as its owner: the most task steps one workflow may hold (${WORKFLOW_STEP_LIMIT_MIN} to ${WORKFLOW_STEP_LIMIT_MAX}, default 6). Setting costs 0.001 in the payment token; reading is free`
|
|
27466
27734
|
).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
|
|
27467
27735
|
const projectId = parseProjectId(id);
|
|
@@ -27492,9 +27760,9 @@ var settingsCommand2 = new Command146("settings").description(
|
|
|
27492
27760
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27493
27761
|
);
|
|
27494
27762
|
});
|
|
27495
|
-
var workflowCommand = new
|
|
27763
|
+
var workflowCommand = new Command147("workflow").description(
|
|
27496
27764
|
"Workflows: project tasks composed from named patterns (sequence, parallel, forEach, reviewLoop, gate, contest, branch, fallback), run by the platform runner under your grant to it. A gate waits for your approval, a step verdict or a time. A workflow is the document; a run is one execution of it"
|
|
27497
|
-
).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(
|
|
27765
|
+
).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
|
|
27498
27766
|
stepCommand(
|
|
27499
27767
|
"approve",
|
|
27500
27768
|
"Approve an open owner gate in a run so the steps after it start, as the owner; a verdict or time gate opens on its own (costs 0.001 in the payment token)"
|
|
@@ -27507,21 +27775,36 @@ var workflowCommand = new Command146("workflow").description(
|
|
|
27507
27775
|
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
27508
27776
|
|
|
27509
27777
|
// src/commands/drops.ts
|
|
27510
|
-
import { Command as
|
|
27511
|
-
var listCommand9 = new
|
|
27512
|
-
|
|
27513
|
-
|
|
27514
|
-
|
|
27515
|
-
|
|
27516
|
-
|
|
27517
|
-
|
|
27518
|
-
|
|
27519
|
-
|
|
27520
|
-
|
|
27521
|
-
|
|
27778
|
+
import { Command as Command148 } from "commander";
|
|
27779
|
+
var listCommand9 = new Command148("list").description("List public Task Drops, ones accepting work first").option("--limit <n>", "Maximum drops to return (1-48)", "24").option("--cursor <cursor>", "nextCursor from a previous page").option("--status <status>", "ended: only drops no longer accepting work, newest first").option("--worker <address>", "Only drops this wallet entered (a submission, pitch or bid)").option("--entered", "Only drops your wallet entered (--worker with your own address)").action(
|
|
27780
|
+
async (opts) => {
|
|
27781
|
+
try {
|
|
27782
|
+
if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
|
|
27783
|
+
let worker = opts.worker;
|
|
27784
|
+
if (opts.entered) {
|
|
27785
|
+
try {
|
|
27786
|
+
worker = (await loadKeystore()).walletAddress;
|
|
27787
|
+
} catch {
|
|
27788
|
+
throw new Error("No keystore found. Run `taskmarket init` first, or pass --worker.");
|
|
27789
|
+
}
|
|
27790
|
+
}
|
|
27791
|
+
const input = parseInput(TaskDropDirectoryInputSchema, {
|
|
27792
|
+
limit: optionalInt(opts.limit),
|
|
27793
|
+
cursor: opts.cursor,
|
|
27794
|
+
status: opts.status,
|
|
27795
|
+
worker
|
|
27796
|
+
});
|
|
27797
|
+
const params = new URLSearchParams({ limit: String(input.limit) });
|
|
27798
|
+
if (input.cursor) params.set("cursor", input.cursor);
|
|
27799
|
+
if (input.status) params.set("status", input.status);
|
|
27800
|
+
if (input.worker) params.set("worker", input.worker.toLowerCase());
|
|
27801
|
+
printResult(await apiGet(`/api/task-drops/directory?${params.toString()}`));
|
|
27802
|
+
} catch (err) {
|
|
27803
|
+
renderFailure(err);
|
|
27804
|
+
}
|
|
27522
27805
|
}
|
|
27523
|
-
|
|
27524
|
-
var
|
|
27806
|
+
);
|
|
27807
|
+
var showCommand7 = new Command148("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
|
|
27525
27808
|
try {
|
|
27526
27809
|
const input = parseInput(TaskDropGetInputSchema, { taskDropId });
|
|
27527
27810
|
const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
|
|
@@ -27533,7 +27816,7 @@ var showCommand6 = new Command147("show").description("Show a Task Drop and its
|
|
|
27533
27816
|
renderFailure(err);
|
|
27534
27817
|
}
|
|
27535
27818
|
});
|
|
27536
|
-
var subscribeCommand = new
|
|
27819
|
+
var subscribeCommand = new Command148("subscribe").description("Subscribe an email to one Task Drop, or with --official to every official drop").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to notify").option("--official", "Subscribe to all official Task Drops").option("--wallet <address>", "Wallet address to associate with the subscription").action(
|
|
27537
27820
|
async (taskDropId, opts) => {
|
|
27538
27821
|
try {
|
|
27539
27822
|
if (opts.official) {
|
|
@@ -27561,7 +27844,7 @@ var subscribeCommand = new Command147("subscribe").description("Subscribe an ema
|
|
|
27561
27844
|
}
|
|
27562
27845
|
}
|
|
27563
27846
|
);
|
|
27564
|
-
var statusCommand4 = new
|
|
27847
|
+
var statusCommand4 = new Command148("status").description("Check whether an email is subscribed to a Task Drop, or with --official to all").argument("[taskDropId]", "Task Drop ID (omit with --official)").requiredOption("--email <email>", "Email address to check").option("--official", "Check the all-official-drops subscription").action(async (taskDropId, opts) => {
|
|
27565
27848
|
try {
|
|
27566
27849
|
if (opts.official) {
|
|
27567
27850
|
if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
|
|
@@ -27578,15 +27861,15 @@ var statusCommand4 = new Command147("status").description("Check whether an emai
|
|
|
27578
27861
|
renderFailure(err);
|
|
27579
27862
|
}
|
|
27580
27863
|
});
|
|
27581
|
-
var dropsCommand = new
|
|
27864
|
+
var dropsCommand = new Command148("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
|
|
27582
27865
|
|
|
27583
27866
|
// src/commands/hooks.ts
|
|
27584
|
-
import { Command as
|
|
27867
|
+
import { Command as Command150 } from "commander";
|
|
27585
27868
|
import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
|
|
27586
27869
|
|
|
27587
27870
|
// src/lib/listing-submissions.ts
|
|
27588
27871
|
import { readFile as readFile6 } from "fs/promises";
|
|
27589
|
-
import { Command as
|
|
27872
|
+
import { Command as Command149 } from "commander";
|
|
27590
27873
|
var NOTICE = "Submitted for staff review. The action fee is kept whether the submission is approved or rejected. Approval opens a review pull request; `listed` turns true once the entry is served.";
|
|
27591
27874
|
function prepareListingFile(kind, text) {
|
|
27592
27875
|
if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
|
|
@@ -27643,7 +27926,7 @@ function prepareListingFile(kind, text) {
|
|
|
27643
27926
|
}
|
|
27644
27927
|
function submitCommandFor(kind) {
|
|
27645
27928
|
const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
|
|
27646
|
-
return new
|
|
27929
|
+
return new Command149("submit").description(
|
|
27647
27930
|
`Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
|
|
27648
27931
|
).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
|
|
27649
27932
|
let text;
|
|
@@ -27675,7 +27958,7 @@ function submitCommandFor(kind) {
|
|
|
27675
27958
|
});
|
|
27676
27959
|
}
|
|
27677
27960
|
function submissionsCommandFor(kind) {
|
|
27678
|
-
return new
|
|
27961
|
+
return new Command149("submissions").description(
|
|
27679
27962
|
`List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
|
|
27680
27963
|
).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
|
|
27681
27964
|
if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
|
|
@@ -27741,7 +28024,7 @@ async function probeHookVersion(entry, chainId) {
|
|
|
27741
28024
|
return reverted ? { ...entry, hookVersion: 1 } : entry;
|
|
27742
28025
|
}
|
|
27743
28026
|
}
|
|
27744
|
-
var listCommand10 = new
|
|
28027
|
+
var listCommand10 = new Command150("list").description(
|
|
27745
28028
|
"List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
|
|
27746
28029
|
).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").option(
|
|
27747
28030
|
"--cursor <cursor>",
|
|
@@ -27780,7 +28063,7 @@ var listCommand10 = new Command149("list").description(
|
|
|
27780
28063
|
}
|
|
27781
28064
|
}
|
|
27782
28065
|
);
|
|
27783
|
-
var
|
|
28066
|
+
var showCommand8 = new Command150("show").description(
|
|
27784
28067
|
"Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
|
|
27785
28068
|
).argument("<address>", "Hook contract address").action(async (address3) => {
|
|
27786
28069
|
try {
|
|
@@ -27800,7 +28083,7 @@ var showCommand7 = new Command149("show").description(
|
|
|
27800
28083
|
renderFailure(err);
|
|
27801
28084
|
}
|
|
27802
28085
|
});
|
|
27803
|
-
var encodeConfigCommand = new
|
|
28086
|
+
var encodeConfigCommand = new Command150("encode-config").description(
|
|
27804
28087
|
"Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
|
|
27805
28088
|
).argument("<address>", "Hook contract address").requiredOption(
|
|
27806
28089
|
"--values <json>",
|
|
@@ -27829,7 +28112,7 @@ var encodeConfigCommand = new Command149("encode-config").description(
|
|
|
27829
28112
|
renderFailure(err);
|
|
27830
28113
|
}
|
|
27831
28114
|
});
|
|
27832
|
-
var attachmentConfigCommand = new
|
|
28115
|
+
var attachmentConfigCommand = new Command150("attachment-config").description(
|
|
27833
28116
|
"Show the protocol-default hook order and maximum hooks per task on the selected --network"
|
|
27834
28117
|
).action(async () => {
|
|
27835
28118
|
try {
|
|
@@ -27838,16 +28121,16 @@ var attachmentConfigCommand = new Command149("attachment-config").description(
|
|
|
27838
28121
|
renderFailure(err);
|
|
27839
28122
|
}
|
|
27840
28123
|
});
|
|
27841
|
-
var hooksCommand = new
|
|
28124
|
+
var hooksCommand = new Command150("hooks").description("Browse the hook registry on the selected --network").addCommand(listCommand10).addCommand(showCommand8).addCommand(encodeConfigCommand).addCommand(attachmentConfigCommand).addCommand(submitCommandFor("hook")).addCommand(submissionsCommandFor("hook"));
|
|
27842
28125
|
|
|
27843
28126
|
// src/commands/catalog/index.ts
|
|
27844
|
-
import { Command as
|
|
27845
|
-
var catalogCommand = new
|
|
28127
|
+
import { Command as Command151 } from "commander";
|
|
28128
|
+
var catalogCommand = new Command151("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
|
|
27846
28129
|
|
|
27847
28130
|
// src/commands/tap.ts
|
|
27848
28131
|
import { promises as fs12 } from "fs";
|
|
27849
|
-
import { Command as
|
|
27850
|
-
var tapCommand = new
|
|
28132
|
+
import { Command as Command152 } from "commander";
|
|
28133
|
+
var tapCommand = new Command152("tap").description(
|
|
27851
28134
|
"Manage the TAP signing key used on tasks that require TAP verification"
|
|
27852
28135
|
);
|
|
27853
28136
|
tapCommand.command("import").description(
|
|
@@ -28006,7 +28289,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
|
|
|
28006
28289
|
});
|
|
28007
28290
|
|
|
28008
28291
|
// src/commands/hire.ts
|
|
28009
|
-
import { Command as
|
|
28292
|
+
import { Command as Command153 } from "commander";
|
|
28010
28293
|
var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
|
|
28011
28294
|
async function lookupListedService(worker, serviceId) {
|
|
28012
28295
|
let listing;
|
|
@@ -28038,7 +28321,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
|
|
|
28038
28321
|
}
|
|
28039
28322
|
return null;
|
|
28040
28323
|
}
|
|
28041
|
-
var hireCommand = new
|
|
28324
|
+
var hireCommand = new Command153("hire").description(
|
|
28042
28325
|
"Hire a worker, a human or an agent: create a claim task only that worker may accept or decline before the accept window ends (costs the reward, in the payment token). Private visibility and every settlement terms flag of task create apply."
|
|
28043
28326
|
).argument("<worker>", "The worker's wallet address (a human or an agent)").option("--service <id>", "The listed service this hire is for (from the worker's listing)").option(
|
|
28044
28327
|
"--requires-evaluator",
|
|
@@ -28101,7 +28384,7 @@ hireCommand.action(async (worker, opts) => {
|
|
|
28101
28384
|
// src/index.ts
|
|
28102
28385
|
var require2 = createRequire(import.meta.url);
|
|
28103
28386
|
var { version } = require2("../package.json");
|
|
28104
|
-
var program = new
|
|
28387
|
+
var program = new Command154();
|
|
28105
28388
|
setLastErrorCliVersion(version);
|
|
28106
28389
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
28107
28390
|
program.option(
|