@lucid-agents/taskmarket 1.38.0 → 1.40.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-TC2WI2WY.js → api-KVJC2YUT.js} +2 -2
- package/dist/{channels-UFRYFVIT.js → channels-C7RATT4R.js} +4 -4
- package/dist/{chunk-UWGOLGKA.js → chunk-6QUUNUR4.js} +8 -8
- package/dist/{chunk-LOUQO73Y.js → chunk-DQ7VOFP7.js} +5 -5
- package/dist/{chunk-YGYWUPFH.js → chunk-H6EGL76J.js} +2761 -2518
- package/dist/{chunk-U6KNPJQ3.js → chunk-HDXVDIQQ.js} +1 -1
- package/dist/{chunk-QGTMCIZ3.js → chunk-HWOVMACE.js} +2 -2
- package/dist/{chunk-XSYOVYGF.js → chunk-I56PQUGS.js} +3 -3
- package/dist/{chunk-PYXJTK3J.js → chunk-IILD5VXU.js} +1 -1
- package/dist/{chunk-3VNJBJSK.js → chunk-JAJCNNGK.js} +1 -1
- package/dist/{chunk-WOQ6DNU2.js → chunk-KOV37V5R.js} +3 -3
- package/dist/{chunk-HF6T5WRD.js → chunk-LPW4GUD5.js} +3 -3
- package/dist/{chunk-7RISA22K.js → chunk-PQCZDREC.js} +1 -1
- package/dist/{chunk-6JQ7KVVK.js → chunk-QEDLNQCE.js} +1 -1
- package/dist/{doctor-3X5OIY5A.js → doctor-22BCAXSE.js} +8 -8
- package/dist/index.js +421 -124
- package/dist/{launch-YMPZUCU6.js → launch-CGOA6WTU.js} +11 -11
- package/dist/pi-extensions/xgate.cjs +222 -74
- package/dist/{read-auth-7HZZGCWW.js → read-auth-XV4SH3GF.js} +3 -3
- package/dist/{reconcile-KV6XDQVM.js → reconcile-7ZG7SJM2.js} +4 -4
- package/dist/{status-JBJOPZQO.js → status-VODVEYZK.js} +8 -8
- package/dist/{sync-pull-EJMIUSC6.js → sync-pull-3EZWIMNV.js} +4 -4
- package/dist/{task-access-grants-BIPLWENT.js → task-access-grants-J3RR2BKM.js} +2 -2
- package/package.json +1 -1
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-6QUUNUR4.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-LPW4GUD5.js";
|
|
41
41
|
import {
|
|
42
42
|
signReadAuth
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-HWOVMACE.js";
|
|
44
44
|
import {
|
|
45
45
|
saveTaskAccessGrant,
|
|
46
46
|
taskAccessGrantHeaders
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-IILD5VXU.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-QEDLNQCE.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-HDXVDIQQ.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-H6EGL76J.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-CGOA6WTU.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-VODVEYZK.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-22BCAXSE.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-7ZG7SJM2.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-C7RATT4R.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-C7RATT4R.js");
|
|
13516
|
+
const { reconcileLeasedPurchase } = await import("./reconcile-7ZG7SJM2.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-3EZWIMNV.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,256 @@ 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 parseSuggestionsMinBacking(value, options = {}) {
|
|
25774
|
+
const trimmed = value.trim();
|
|
25775
|
+
if (options.allowDefault && trimmed === "default") return null;
|
|
25776
|
+
try {
|
|
25777
|
+
return usdcToBaseUnits(trimmed, { allowZero: true });
|
|
25778
|
+
} catch (err) {
|
|
25779
|
+
return {
|
|
25780
|
+
error: `Invalid --suggestions-min-backing: ${err instanceof Error ? err.message : String(err)}${options.allowDefault ? ", or default" : ""}`
|
|
25781
|
+
};
|
|
25782
|
+
}
|
|
25783
|
+
}
|
|
25784
|
+
function suggestBody(projectId, opts) {
|
|
25785
|
+
if (opts.title === void 0) return { error: "--title is required" };
|
|
25786
|
+
if (opts.brief === void 0) return { error: "--brief is required" };
|
|
25787
|
+
const title = ProjectSuggestionTitleSchema.safeParse(opts.title);
|
|
25788
|
+
if (!title.success) return { error: `--title: ${title.error.issues[0].message}` };
|
|
25789
|
+
const brief = ProjectSuggestionBriefSchema.safeParse(opts.brief);
|
|
25790
|
+
if (!brief.success) return { error: `--brief: ${brief.error.issues[0].message}` };
|
|
25791
|
+
const body = { projectId, title: title.data, brief: brief.data };
|
|
25792
|
+
if (opts.mode !== void 0) {
|
|
25793
|
+
const mode = opts.mode.trim();
|
|
25794
|
+
if (!GRANT_MODE_NAMES.includes(mode)) {
|
|
25795
|
+
return { error: `--mode must be ${GRANT_MODE_NAMES.join(", ")}` };
|
|
25796
|
+
}
|
|
25797
|
+
body.mode = mode;
|
|
25798
|
+
}
|
|
25799
|
+
if (opts.reward !== void 0) {
|
|
25800
|
+
const reward = parseAmount(opts.reward, "--reward");
|
|
25801
|
+
if (typeof reward !== "string") return reward;
|
|
25802
|
+
body.reward = reward;
|
|
25803
|
+
}
|
|
25804
|
+
return body;
|
|
25805
|
+
}
|
|
25806
|
+
function suggestionsQuery(opts) {
|
|
25807
|
+
const params = new URLSearchParams();
|
|
25808
|
+
if (opts.status !== void 0) {
|
|
25809
|
+
const status = opts.status.trim();
|
|
25810
|
+
if (!PROJECT_SUGGESTION_STATUSES.includes(status)) {
|
|
25811
|
+
return { error: `--status must be ${PROJECT_SUGGESTION_STATUSES.join(", ")}` };
|
|
25812
|
+
}
|
|
25813
|
+
params.set("status", status);
|
|
25814
|
+
}
|
|
25815
|
+
if (opts.sort !== void 0) {
|
|
25816
|
+
const sort = opts.sort.trim();
|
|
25817
|
+
if (!PROJECT_SUGGESTION_SORTS.includes(sort)) {
|
|
25818
|
+
return { error: `--sort must be ${PROJECT_SUGGESTION_SORTS.join(" or ")}` };
|
|
25819
|
+
}
|
|
25820
|
+
params.set("sort", sort);
|
|
25821
|
+
}
|
|
25822
|
+
if (opts.limit !== void 0) {
|
|
25823
|
+
const limit = opts.limit.trim();
|
|
25824
|
+
if (!/^[1-9][0-9]*$/.test(limit) || Number(limit) > PROJECT_SUGGESTIONS_LIST_MAX) {
|
|
25825
|
+
return { error: `--limit must be an integer from 1 to ${PROJECT_SUGGESTIONS_LIST_MAX}` };
|
|
25826
|
+
}
|
|
25827
|
+
params.set("limit", limit);
|
|
25828
|
+
}
|
|
25829
|
+
if (opts.cursor !== void 0) {
|
|
25830
|
+
const cursor = opts.cursor.trim();
|
|
25831
|
+
if (cursor.length === 0 || cursor.length > 512) {
|
|
25832
|
+
return { error: "--cursor must be the previous page's nextCursor" };
|
|
25833
|
+
}
|
|
25834
|
+
params.set("cursor", cursor);
|
|
25835
|
+
}
|
|
25836
|
+
return params.toString();
|
|
25837
|
+
}
|
|
25838
|
+
function suggestionSettingsBody(projectId, opts) {
|
|
25839
|
+
if (opts.suggestions === void 0 && opts.hostedOperators === void 0 && opts.suggestionsMinBacking === void 0) {
|
|
25840
|
+
return null;
|
|
25841
|
+
}
|
|
25842
|
+
const body = { projectId };
|
|
25843
|
+
if (opts.suggestions !== void 0) {
|
|
25844
|
+
const setting = parseSuggestionsSetting(opts.suggestions);
|
|
25845
|
+
if (typeof setting !== "string") return setting;
|
|
25846
|
+
body.suggestions = setting;
|
|
25847
|
+
}
|
|
25848
|
+
if (opts.hostedOperators !== void 0) {
|
|
25849
|
+
const value = opts.hostedOperators.trim();
|
|
25850
|
+
if (value !== "on" && value !== "off") return { error: "--hosted-operators must be on or off" };
|
|
25851
|
+
body.hostedOperators = value === "on";
|
|
25852
|
+
}
|
|
25853
|
+
if (opts.suggestionsMinBacking !== void 0) {
|
|
25854
|
+
const min = parseSuggestionsMinBacking(opts.suggestionsMinBacking, { allowDefault: true });
|
|
25855
|
+
if (min !== null && typeof min === "object") return min;
|
|
25856
|
+
body.minBacking = min;
|
|
25857
|
+
}
|
|
25858
|
+
return body;
|
|
25859
|
+
}
|
|
25860
|
+
async function signedRead(path9) {
|
|
25861
|
+
try {
|
|
25862
|
+
const headers = (await signReadAuth())?.headers ?? {};
|
|
25863
|
+
printResult(await apiGet(withChainId(path9), { headers }));
|
|
25864
|
+
} catch (err) {
|
|
25865
|
+
renderFailure(err);
|
|
25866
|
+
}
|
|
25867
|
+
}
|
|
25868
|
+
var projectSuggestCommand = new Command128("suggest").description(
|
|
25869
|
+
"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"
|
|
25870
|
+
).argument("<projectId>", "Project id").option("--title <text>", "Required: one line, 1 to 120 characters").option(
|
|
25871
|
+
"--brief <text>",
|
|
25872
|
+
"Required: what the work is and what done looks like, plain text, up to 4000 characters"
|
|
25873
|
+
).option(
|
|
25874
|
+
"--mode <mode>",
|
|
25875
|
+
`The task mode you suggest (${GRANT_MODE_NAMES.join(", ")}); the owner or operator decides`
|
|
25876
|
+
).option(
|
|
25877
|
+
"--reward <amount>",
|
|
25878
|
+
"The reward you suggest, in the payment token (e.g. 5); the owner or operator decides"
|
|
25879
|
+
).action(async (id, opts) => {
|
|
25880
|
+
const projectId = parseProjectId(id);
|
|
25881
|
+
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25882
|
+
const body = suggestBody(projectId, opts);
|
|
25883
|
+
if ("error" in body) return void printError(String(body.error));
|
|
25884
|
+
await postProjectWrite(`/api/projects/${projectId}/suggestions`, body, {
|
|
25885
|
+
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
25886
|
+
});
|
|
25887
|
+
});
|
|
25888
|
+
var projectSuggestionsCommand = new Command128("suggestions").description(
|
|
25889
|
+
"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)"
|
|
25890
|
+
).argument("<projectId>", "Project id").option(
|
|
25891
|
+
"--status <status>",
|
|
25892
|
+
`Only suggestions in this status: ${PROJECT_SUGGESTION_STATUSES.join(", ")}`
|
|
25893
|
+
).option("--sort <sort>", "votes (default) or backed").option(
|
|
25894
|
+
"--limit <count>",
|
|
25895
|
+
`Suggestions per page (1-${PROJECT_SUGGESTIONS_LIST_MAX}, default ${PROJECT_SUGGESTIONS_LIST_DEFAULT})`
|
|
25896
|
+
).option(
|
|
25897
|
+
"--cursor <cursor>",
|
|
25898
|
+
"The next page: the previous page's nextCursor, with the same --status and --sort"
|
|
25899
|
+
).action(async (id, opts) => {
|
|
25900
|
+
const projectId = parseProjectId(id);
|
|
25901
|
+
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25902
|
+
const query4 = suggestionsQuery(opts);
|
|
25903
|
+
if (typeof query4 !== "string") return void printError(query4.error);
|
|
25904
|
+
await signedRead(`/api/projects/${projectId}/suggestions${query4 ? `?${query4}` : ""}`);
|
|
25905
|
+
});
|
|
25906
|
+
var showCommand3 = new Command128("show").description("Show a suggestion with its status, votes and backedShares (free)").argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
25907
|
+
const id = parseSuggestionId(value);
|
|
25908
|
+
if (typeof id !== "string") return void printError(id.error);
|
|
25909
|
+
await signedRead(`/api/project-suggestions/${id}`);
|
|
25910
|
+
});
|
|
25911
|
+
function voteCommand(action, description) {
|
|
25912
|
+
return new Command128(action).description(description).argument("<suggestionId>", "Suggestion id").action(async (value) => {
|
|
25913
|
+
const suggestionId = parseSuggestionId(value);
|
|
25914
|
+
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
25915
|
+
const auth = await signReadAuth();
|
|
25916
|
+
if (auth && Object.keys(auth.headers).length === 0) {
|
|
25917
|
+
return void printError(`Could not sign with your wallet: ${auth.error ?? "unknown error"}`);
|
|
25918
|
+
}
|
|
25919
|
+
if (!auth) {
|
|
25920
|
+
return void printError(
|
|
25921
|
+
`${action === "vote" ? "Voting" : "Taking back a vote"} needs a wallet. Run \`taskmarket init\` first.`
|
|
25922
|
+
);
|
|
25923
|
+
}
|
|
25924
|
+
try {
|
|
25925
|
+
const chainId = selectedNetwork().chainId;
|
|
25926
|
+
const proof = await signWalletWrite("project-suggestion-vote", {
|
|
25927
|
+
action,
|
|
25928
|
+
chainId,
|
|
25929
|
+
suggestionId
|
|
25930
|
+
});
|
|
25931
|
+
const { data, idempotencyKey } = await apiPost(
|
|
25932
|
+
`/api/project-suggestions/${suggestionId}/${action}`,
|
|
25933
|
+
{ chainId, suggestionId, ...proof },
|
|
25934
|
+
{ headers: auth.headers }
|
|
25935
|
+
);
|
|
25936
|
+
printResult(data, { idempotencyKey });
|
|
25937
|
+
} catch (err) {
|
|
25938
|
+
renderFailure(err);
|
|
25939
|
+
}
|
|
25940
|
+
});
|
|
25941
|
+
}
|
|
25942
|
+
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) => {
|
|
25943
|
+
const suggestionId = parseSuggestionId(value);
|
|
25944
|
+
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
25945
|
+
await postProjectWrite(
|
|
25946
|
+
`/api/project-suggestions/${suggestionId}/withdraw`,
|
|
25947
|
+
{ suggestionId },
|
|
25948
|
+
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
25949
|
+
);
|
|
25950
|
+
});
|
|
25951
|
+
var declineCommand = new Command128("decline").description(
|
|
25952
|
+
"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"
|
|
25953
|
+
).argument("<suggestionId>", "Suggestion id").option("--reason <text>", "Why, shown to everyone: up to 500 characters").action(async (value, opts) => {
|
|
25954
|
+
const suggestionId = parseSuggestionId(value);
|
|
25955
|
+
if (typeof suggestionId !== "string") return void printError(suggestionId.error);
|
|
25956
|
+
const parsed = ProjectSuggestionDeclineSchema.safeParse({ suggestionId, reason: opts.reason });
|
|
25957
|
+
if (!parsed.success) {
|
|
25958
|
+
return void printError(`--reason: ${parsed.error.issues[0].message}`);
|
|
25959
|
+
}
|
|
25960
|
+
await postProjectWrite(
|
|
25961
|
+
`/api/project-suggestions/${suggestionId}/decline`,
|
|
25962
|
+
{ suggestionId, ...parsed.data.reason !== void 0 ? { reason: parsed.data.reason } : {} },
|
|
25963
|
+
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
25964
|
+
);
|
|
25965
|
+
});
|
|
25966
|
+
var projectSuggestionCommand = new Command128("suggestion").description(
|
|
25967
|
+
"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"
|
|
25968
|
+
).addCommand(showCommand3).addCommand(
|
|
25969
|
+
voteCommand(
|
|
25970
|
+
"vote",
|
|
25971
|
+
"Upvote a suggestion, as a wallet that may suggest on its project; one vote per wallet (free, signed by your wallet)"
|
|
25972
|
+
)
|
|
25973
|
+
).addCommand(
|
|
25974
|
+
voteCommand("unvote", "Take back your upvote on a suggestion (free, signed by your wallet)")
|
|
25975
|
+
).addCommand(withdrawCommand2).addCommand(declineCommand);
|
|
25976
|
+
var projectSuggestionSettingsCommand = new Command128("suggestion-settings").description(
|
|
25977
|
+
"Read or set the project's suggestions settings, as its owner: who may post and upvote suggestions (off, backers or anyone), the least a wallet must have contributed to count as a backer for them (1 in the payment token by default), 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"
|
|
25978
|
+
).argument("<projectId>", "Project id").option(
|
|
25979
|
+
"--suggestions <setting>",
|
|
25980
|
+
"off (no one), backers (the owner, operators and backers) or anyone (any wallet)"
|
|
25981
|
+
).option(
|
|
25982
|
+
"--suggestions-min-backing <amount>",
|
|
25983
|
+
"Under backers, the least a wallet must have contributed to the project's pool to post and upvote, in the payment token (e.g. 5); 0 admits any contribution, default returns to the default of 1"
|
|
25984
|
+
).option(
|
|
25985
|
+
"--hosted-operators <on|off>",
|
|
25986
|
+
"Whether hosted operators act on suggestions by themselves"
|
|
25987
|
+
).action(async (id, opts) => {
|
|
25988
|
+
const projectId = parseProjectId(id);
|
|
25989
|
+
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25990
|
+
const body = suggestionSettingsBody(projectId, opts);
|
|
25991
|
+
if (body === null) {
|
|
25992
|
+
try {
|
|
25993
|
+
const view = await apiGet(withChainId(`/api/projects/${projectId}`));
|
|
25994
|
+
printResult({
|
|
25995
|
+
chainId: view.project?.chainId,
|
|
25996
|
+
projectId: view.project?.projectId ?? projectId,
|
|
25997
|
+
suggestions: view.suggestions ?? null
|
|
25998
|
+
});
|
|
25999
|
+
} catch (err) {
|
|
26000
|
+
renderFailure(err);
|
|
26001
|
+
}
|
|
26002
|
+
return;
|
|
26003
|
+
}
|
|
26004
|
+
if ("error" in body) return void printError(String(body.error));
|
|
26005
|
+
await postProjectWrite(`/api/projects/${projectId}/suggestions/settings`, body, {
|
|
26006
|
+
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
26007
|
+
});
|
|
26008
|
+
});
|
|
26009
|
+
|
|
26010
|
+
// src/commands/project/add-task.ts
|
|
25740
26011
|
function deadlineCheck(durationHours, project, now = /* @__PURE__ */ new Date()) {
|
|
25741
26012
|
if (!project?.endsAt || !Number.isFinite(durationHours)) return null;
|
|
25742
26013
|
const endsAt = new Date(project.endsAt);
|
|
@@ -25798,7 +26069,7 @@ function parseContinuation(flags) {
|
|
|
25798
26069
|
function collect5(value, previous = []) {
|
|
25799
26070
|
return [...previous, value];
|
|
25800
26071
|
}
|
|
25801
|
-
var projectAddTaskCommand = new
|
|
26072
|
+
var projectAddTaskCommand = new Command129("add-task").description(
|
|
25802
26073
|
"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
26074
|
).argument("<projectId>", "Project id");
|
|
25804
26075
|
for (const option of createCmd.options) {
|
|
@@ -25814,6 +26085,9 @@ projectAddTaskCommand.option(
|
|
|
25814
26085
|
).option(
|
|
25815
26086
|
"--share-inputs",
|
|
25816
26087
|
"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"
|
|
26088
|
+
).option(
|
|
26089
|
+
"--suggestion <id>",
|
|
26090
|
+
"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
26091
|
);
|
|
25818
26092
|
projectAddTaskCommand.action(async (id, opts) => {
|
|
25819
26093
|
try {
|
|
@@ -25821,6 +26095,10 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25821
26095
|
if (typeof projectId !== "number") return void printError(projectId.error);
|
|
25822
26096
|
const parsed = parseContinuation(opts);
|
|
25823
26097
|
if ("error" in parsed) return void printError(parsed.error);
|
|
26098
|
+
const suggestionId = opts.suggestion === void 0 ? void 0 : parseSuggestionId(opts.suggestion);
|
|
26099
|
+
if (typeof suggestionId === "object") {
|
|
26100
|
+
return void printError(`--suggestion: ${suggestionId.error}`);
|
|
26101
|
+
}
|
|
25824
26102
|
const warnings = [];
|
|
25825
26103
|
let project;
|
|
25826
26104
|
try {
|
|
@@ -25834,7 +26112,8 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25834
26112
|
await runCreateTask(opts, {
|
|
25835
26113
|
warnings,
|
|
25836
26114
|
projectId,
|
|
25837
|
-
...parsed.continuation ? { continuation: parsed.continuation } : {}
|
|
26115
|
+
...parsed.continuation ? { continuation: parsed.continuation } : {},
|
|
26116
|
+
...suggestionId !== void 0 ? { suggestionId } : {}
|
|
25838
26117
|
});
|
|
25839
26118
|
} catch (err) {
|
|
25840
26119
|
renderFailure(err);
|
|
@@ -25842,7 +26121,7 @@ projectAddTaskCommand.action(async (id, opts) => {
|
|
|
25842
26121
|
});
|
|
25843
26122
|
|
|
25844
26123
|
// src/commands/project/automations.ts
|
|
25845
|
-
import { Command as
|
|
26124
|
+
import { Command as Command130 } from "commander";
|
|
25846
26125
|
function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
25847
26126
|
if (opts.cap === void 0) {
|
|
25848
26127
|
return { error: "--cap is required: the most the automations may draw from the budget" };
|
|
@@ -25871,7 +26150,7 @@ function automationsOnBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
25871
26150
|
}
|
|
25872
26151
|
return body;
|
|
25873
26152
|
}
|
|
25874
|
-
var projectAutomationsOnCommand = new
|
|
26153
|
+
var projectAutomationsOnCommand = new Command130("on").description(
|
|
25875
26154
|
"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
26155
|
).argument("<projectId>", "Project id").option(
|
|
25877
26156
|
"--cap <amount>",
|
|
@@ -25899,7 +26178,7 @@ var projectAutomationsOnCommand = new Command129("on").description(
|
|
|
25899
26178
|
});
|
|
25900
26179
|
}
|
|
25901
26180
|
);
|
|
25902
|
-
var projectAutomationsOffCommand = new
|
|
26181
|
+
var projectAutomationsOffCommand = new Command130("off").description(
|
|
25903
26182
|
"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
26183
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
25905
26184
|
const projectId = parseProjectId(id);
|
|
@@ -25910,7 +26189,7 @@ var projectAutomationsOffCommand = new Command129("off").description(
|
|
|
25910
26189
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
25911
26190
|
);
|
|
25912
26191
|
});
|
|
25913
|
-
var projectAutomationsStatusCommand = new
|
|
26192
|
+
var projectAutomationsStatusCommand = new Command130("status").description(
|
|
25914
26193
|
"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
26194
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
25916
26195
|
const projectId = parseProjectId(id);
|
|
@@ -25921,13 +26200,13 @@ var projectAutomationsStatusCommand = new Command129("status").description(
|
|
|
25921
26200
|
renderFailure(err);
|
|
25922
26201
|
}
|
|
25923
26202
|
});
|
|
25924
|
-
var projectAutomationsCommand = new
|
|
26203
|
+
var projectAutomationsCommand = new Command130("automations").description(
|
|
25925
26204
|
"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
26205
|
).addCommand(projectAutomationsOnCommand).addCommand(projectAutomationsOffCommand).addCommand(projectAutomationsStatusCommand);
|
|
25927
26206
|
|
|
25928
26207
|
// src/commands/project/claim.ts
|
|
25929
|
-
import { Command as
|
|
25930
|
-
var projectClaimCommand = new
|
|
26208
|
+
import { Command as Command131 } from "commander";
|
|
26209
|
+
var projectClaimCommand = new Command131("claim").description(
|
|
25931
26210
|
"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
26211
|
).argument("<projectId>", "Project id").option("--backer <address>", "The backer to pay (default: your wallet)").action(async (id, opts) => {
|
|
25933
26212
|
const projectId = parseProjectId(id);
|
|
@@ -25947,8 +26226,8 @@ var projectClaimCommand = new Command130("claim").description(
|
|
|
25947
26226
|
});
|
|
25948
26227
|
|
|
25949
26228
|
// src/commands/project/close.ts
|
|
25950
|
-
import { Command as
|
|
25951
|
-
var projectCloseCommand = new
|
|
26229
|
+
import { Command as Command132 } from "commander";
|
|
26230
|
+
var projectCloseCommand = new Command132("close").description(
|
|
25952
26231
|
"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
26232
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
25954
26233
|
const projectId = parseProjectId(id);
|
|
@@ -25961,8 +26240,8 @@ var projectCloseCommand = new Command131("close").description(
|
|
|
25961
26240
|
});
|
|
25962
26241
|
|
|
25963
26242
|
// src/commands/project/create.ts
|
|
25964
|
-
import { Command as
|
|
25965
|
-
var projectCreateCommand = new
|
|
26243
|
+
import { Command as Command133 } from "commander";
|
|
26244
|
+
var projectCreateCommand = new Command133("create").description(
|
|
25966
26245
|
"Open a project: one budget that funds tasks of any mode (costs the budget, in the payment token)"
|
|
25967
26246
|
).requiredOption("--budget <amount>", "Opening budget in the payment token (e.g. 50)").requiredOption(
|
|
25968
26247
|
"--ends-at <time>",
|
|
@@ -25970,12 +26249,24 @@ var projectCreateCommand = new Command132("create").description(
|
|
|
25970
26249
|
).option(
|
|
25971
26250
|
"--task-grace <duration>",
|
|
25972
26251
|
"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").
|
|
26252
|
+
).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(
|
|
26253
|
+
"--suggestions <setting>",
|
|
26254
|
+
"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`"
|
|
26255
|
+
).option(
|
|
26256
|
+
"--suggestions-min-backing <amount>",
|
|
26257
|
+
"Under backers, the least a wallet must have contributed to the project's pool to post and upvote suggestions, in the payment token: 1 by default, 0 admits any contribution"
|
|
26258
|
+
).action(
|
|
25974
26259
|
async (opts) => {
|
|
25975
26260
|
const name = opts.name === void 0 ? void 0 : ProjectNameSchema.safeParse(opts.name);
|
|
25976
26261
|
if (name && !name.success) return void printError(`--name: ${name.error.issues[0].message}`);
|
|
25977
26262
|
const goal = opts.goal === void 0 ? void 0 : ProjectGoalSchema.safeParse(opts.goal);
|
|
25978
26263
|
if (goal && !goal.success) return void printError(`--goal: ${goal.error.issues[0].message}`);
|
|
26264
|
+
const suggestions = opts.suggestions === void 0 ? void 0 : parseSuggestionsSetting(opts.suggestions);
|
|
26265
|
+
if (typeof suggestions === "object") return void printError(suggestions.error);
|
|
26266
|
+
const suggestionsMinBacking = opts.suggestionsMinBacking === void 0 ? void 0 : parseSuggestionsMinBacking(opts.suggestionsMinBacking);
|
|
26267
|
+
if (suggestionsMinBacking !== null && typeof suggestionsMinBacking === "object") {
|
|
26268
|
+
return void printError(suggestionsMinBacking.error);
|
|
26269
|
+
}
|
|
25979
26270
|
const budget = parseAmount(opts.budget, "--budget");
|
|
25980
26271
|
if (typeof budget !== "string") return void printError(budget.error);
|
|
25981
26272
|
const endsAt = parseEndsAt(opts.endsAt);
|
|
@@ -25989,7 +26280,9 @@ var projectCreateCommand = new Command132("create").description(
|
|
|
25989
26280
|
endsAt,
|
|
25990
26281
|
...taskGraceSecs === void 0 ? {} : { taskGraceSecs },
|
|
25991
26282
|
...name?.success ? { name: name.data } : {},
|
|
25992
|
-
...goal?.success ? { goal: goal.data } : {}
|
|
26283
|
+
...goal?.success ? { goal: goal.data } : {},
|
|
26284
|
+
...suggestions === void 0 ? {} : { suggestions },
|
|
26285
|
+
...suggestionsMinBacking === void 0 ? {} : { suggestionsMinBacking }
|
|
25993
26286
|
},
|
|
25994
26287
|
{ maxAmount: budget }
|
|
25995
26288
|
);
|
|
@@ -25997,9 +26290,9 @@ var projectCreateCommand = new Command132("create").description(
|
|
|
25997
26290
|
);
|
|
25998
26291
|
|
|
25999
26292
|
// src/commands/project/extend.ts
|
|
26000
|
-
import { Command as
|
|
26293
|
+
import { Command as Command134 } from "commander";
|
|
26001
26294
|
var MAX_EXTENSION_MS = 365 * 24 * 3600 * 1e3;
|
|
26002
|
-
var projectExtendCommand = new
|
|
26295
|
+
var projectExtendCommand = new Command134("extend").description(
|
|
26003
26296
|
"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
26297
|
).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
26298
|
const projectId = parseProjectId(id);
|
|
@@ -26017,8 +26310,8 @@ var projectExtendCommand = new Command133("extend").description(
|
|
|
26017
26310
|
});
|
|
26018
26311
|
|
|
26019
26312
|
// src/commands/project/fund.ts
|
|
26020
|
-
import { Command as
|
|
26021
|
-
var projectFundCommand = new
|
|
26313
|
+
import { Command as Command135 } from "commander";
|
|
26314
|
+
var projectFundCommand = new Command135("fund").description(
|
|
26022
26315
|
"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
26316
|
).argument("<projectId>", "Project id").requiredOption("--amount <amount>", "Amount in the payment token (e.g. 10)").option(
|
|
26024
26317
|
"--on-behalf-of <address>",
|
|
@@ -26040,7 +26333,7 @@ var projectFundCommand = new Command134("fund").description(
|
|
|
26040
26333
|
});
|
|
26041
26334
|
|
|
26042
26335
|
// src/commands/project/grant.ts
|
|
26043
|
-
import { Command as
|
|
26336
|
+
import { Command as Command136 } from "commander";
|
|
26044
26337
|
function grantBody(projectId, opts) {
|
|
26045
26338
|
if (!ADDRESS.test(opts.operator)) {
|
|
26046
26339
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26063,7 +26356,7 @@ function grantBody(projectId, opts) {
|
|
|
26063
26356
|
revokeRemovesControl: opts.revokeRemovesControl
|
|
26064
26357
|
};
|
|
26065
26358
|
}
|
|
26066
|
-
var projectGrantCommand = new
|
|
26359
|
+
var projectGrantCommand = new Command136("grant").description(
|
|
26067
26360
|
"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
26361
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The wallet granted the right to spend the budget").option(
|
|
26069
26362
|
"--cap <amount>",
|
|
@@ -26089,7 +26382,7 @@ var projectGrantCommand = new Command135("grant").description(
|
|
|
26089
26382
|
});
|
|
26090
26383
|
|
|
26091
26384
|
// src/commands/project/review.ts
|
|
26092
|
-
import { Command as
|
|
26385
|
+
import { Command as Command137 } from "commander";
|
|
26093
26386
|
function reviewEvaluator(opts) {
|
|
26094
26387
|
if (opts.evaluator !== void 0 && opts.off) {
|
|
26095
26388
|
return { error: "Pass --evaluator <address> or --off, not both" };
|
|
@@ -26104,7 +26397,7 @@ function reviewEvaluator(opts) {
|
|
|
26104
26397
|
}
|
|
26105
26398
|
return opts.evaluator;
|
|
26106
26399
|
}
|
|
26107
|
-
var projectReviewCommand = new
|
|
26400
|
+
var projectReviewCommand = new Command137("review").description(
|
|
26108
26401
|
"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
26402
|
).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
26403
|
const projectId = parseProjectId(id);
|
|
@@ -26146,8 +26439,8 @@ async function ownerEvaluatorWarnings(evaluator) {
|
|
|
26146
26439
|
}
|
|
26147
26440
|
|
|
26148
26441
|
// src/commands/project/raise-cap.ts
|
|
26149
|
-
import { Command as
|
|
26150
|
-
var projectRaiseCapCommand = new
|
|
26442
|
+
import { Command as Command138 } from "commander";
|
|
26443
|
+
var projectRaiseCapCommand = new Command138("raise-cap").description(
|
|
26151
26444
|
"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
26445
|
).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
26446
|
const projectId = parseProjectId(id);
|
|
@@ -26165,8 +26458,8 @@ var projectRaiseCapCommand = new Command137("raise-cap").description(
|
|
|
26165
26458
|
});
|
|
26166
26459
|
|
|
26167
26460
|
// src/commands/project/lower-cap.ts
|
|
26168
|
-
import { Command as
|
|
26169
|
-
var projectLowerCapCommand = new
|
|
26461
|
+
import { Command as Command139 } from "commander";
|
|
26462
|
+
var projectLowerCapCommand = new Command139("lower-cap").description(
|
|
26170
26463
|
"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
26464
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose cap to lower").requiredOption(
|
|
26172
26465
|
"--cap <amount>",
|
|
@@ -26188,7 +26481,7 @@ var projectLowerCapCommand = new Command138("lower-cap").description(
|
|
|
26188
26481
|
});
|
|
26189
26482
|
|
|
26190
26483
|
// src/commands/project/limits.ts
|
|
26191
|
-
import { Command as
|
|
26484
|
+
import { Command as Command140 } from "commander";
|
|
26192
26485
|
function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
26193
26486
|
if (!ADDRESS.test(opts.operator)) {
|
|
26194
26487
|
return { error: "--operator must be a wallet address (0x + 40 hex chars)" };
|
|
@@ -26228,7 +26521,7 @@ function limitsBody(projectId, opts, now = /* @__PURE__ */ new Date()) {
|
|
|
26228
26521
|
}
|
|
26229
26522
|
return body;
|
|
26230
26523
|
}
|
|
26231
|
-
var projectLimitsCommand = new
|
|
26524
|
+
var projectLimitsCommand = new Command140("limits").description(
|
|
26232
26525
|
"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
26526
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator whose limits to set").option(
|
|
26234
26527
|
"--expires <time>",
|
|
@@ -26250,8 +26543,8 @@ var projectLimitsCommand = new Command139("limits").description(
|
|
|
26250
26543
|
});
|
|
26251
26544
|
|
|
26252
26545
|
// src/commands/project/revoke.ts
|
|
26253
|
-
import { Command as
|
|
26254
|
-
var projectRevokeCommand = new
|
|
26546
|
+
import { Command as Command141 } from "commander";
|
|
26547
|
+
var projectRevokeCommand = new Command141("revoke").description(
|
|
26255
26548
|
"End an operator's right to create tasks from the project, as its owner (costs 0.001 in the payment token)"
|
|
26256
26549
|
).argument("<projectId>", "Project id").requiredOption("--operator <address>", "The operator to revoke").action(async (id, opts) => {
|
|
26257
26550
|
const projectId = parseProjectId(id);
|
|
@@ -26270,7 +26563,7 @@ var projectRevokeCommand = new Command140("revoke").description(
|
|
|
26270
26563
|
});
|
|
26271
26564
|
|
|
26272
26565
|
// src/commands/project/schedule.ts
|
|
26273
|
-
import { Command as
|
|
26566
|
+
import { Command as Command143 } from "commander";
|
|
26274
26567
|
|
|
26275
26568
|
// src/lib/owner-list.ts
|
|
26276
26569
|
import { getAddress as getAddress2, isAddress as isAddress5 } from "viem";
|
|
@@ -26311,7 +26604,7 @@ function ownerListQuery(owner, opts, statuses) {
|
|
|
26311
26604
|
|
|
26312
26605
|
// src/commands/workflow-template.ts
|
|
26313
26606
|
import { readFile as readFile4 } from "fs/promises";
|
|
26314
|
-
import { Command as
|
|
26607
|
+
import { Command as Command142 } from "commander";
|
|
26315
26608
|
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
26609
|
var ADDRESS2 = /^0x[0-9a-fA-F]{40}$/;
|
|
26317
26610
|
var FILE_MAX_BYTES = 256 * 1024;
|
|
@@ -26405,7 +26698,7 @@ async function readValidTemplate(path9) {
|
|
|
26405
26698
|
}
|
|
26406
26699
|
return parsed.document;
|
|
26407
26700
|
}
|
|
26408
|
-
var createCommand3 = new
|
|
26701
|
+
var createCommand3 = new Command142("create").description(
|
|
26409
26702
|
"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
26703
|
).requiredOption("--file <path>", "The template, JSON").action(async (opts) => {
|
|
26411
26704
|
const template = await readValidTemplate(opts.file);
|
|
@@ -26416,7 +26709,7 @@ var createCommand3 = new Command141("create").description(
|
|
|
26416
26709
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26417
26710
|
);
|
|
26418
26711
|
});
|
|
26419
|
-
var updateCommand = new
|
|
26712
|
+
var updateCommand = new Command142("update").description(
|
|
26420
26713
|
"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
26714
|
).argument("<templateId>", "Template id").requiredOption("--file <path>", "The template, JSON").action(async (value, opts) => {
|
|
26422
26715
|
const choice = templateChoice(value);
|
|
@@ -26470,7 +26763,7 @@ function parseTemplateSearch(opts) {
|
|
|
26470
26763
|
}
|
|
26471
26764
|
return { query: query4 };
|
|
26472
26765
|
}
|
|
26473
|
-
var listCommand6 = new
|
|
26766
|
+
var listCommand6 = new Command142("list").description(
|
|
26474
26767
|
"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
26768
|
).option("--owner <address>", "The wallet whose templates to list").option(
|
|
26476
26769
|
"--mine",
|
|
@@ -26555,7 +26848,7 @@ var listCommand6 = new Command141("list").description(
|
|
|
26555
26848
|
}
|
|
26556
26849
|
}
|
|
26557
26850
|
);
|
|
26558
|
-
var
|
|
26851
|
+
var showCommand4 = new Command142("show").description(
|
|
26559
26852
|
"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
26853
|
).argument("<template>", "Template id, official template id or preset name").action(async (value) => {
|
|
26561
26854
|
const choice = templateChoice(value);
|
|
@@ -26578,7 +26871,7 @@ function savedTemplateId(value, verb) {
|
|
|
26578
26871
|
}
|
|
26579
26872
|
return choice.templateId;
|
|
26580
26873
|
}
|
|
26581
|
-
var publishCommand = new
|
|
26874
|
+
var publishCommand = new Command142("publish").description(
|
|
26582
26875
|
"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
26876
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
26584
26877
|
const id = savedTemplateId(value, "publish");
|
|
@@ -26589,7 +26882,7 @@ var publishCommand = new Command141("publish").description(
|
|
|
26589
26882
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26590
26883
|
);
|
|
26591
26884
|
});
|
|
26592
|
-
var unpublishCommand = new
|
|
26885
|
+
var unpublishCommand = new Command142("unpublish").description(
|
|
26593
26886
|
"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
26887
|
).argument("<templateId>", "Saved template id").action(async (value) => {
|
|
26595
26888
|
const id = savedTemplateId(value, "unpublish");
|
|
@@ -26600,7 +26893,7 @@ var unpublishCommand = new Command141("unpublish").description(
|
|
|
26600
26893
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26601
26894
|
);
|
|
26602
26895
|
});
|
|
26603
|
-
var deleteCommand2 = new
|
|
26896
|
+
var deleteCommand2 = new Command142("delete").description(
|
|
26604
26897
|
"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
26898
|
).argument("<templateId>", "Template id").action(async (value) => {
|
|
26606
26899
|
const choice = templateChoice(value);
|
|
@@ -26617,9 +26910,9 @@ var deleteCommand2 = new Command141("delete").description(
|
|
|
26617
26910
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26618
26911
|
);
|
|
26619
26912
|
});
|
|
26620
|
-
var workflowTemplateCommand = new
|
|
26913
|
+
var workflowTemplateCommand = new Command142("template").description(
|
|
26621
26914
|
"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(
|
|
26915
|
+
).addCommand(createCommand3).addCommand(updateCommand).addCommand(listCommand6).addCommand(showCommand4).addCommand(publishCommand).addCommand(unpublishCommand).addCommand(deleteCommand2);
|
|
26623
26916
|
async function createWorkflowFromTemplate(projectId, template, pairs) {
|
|
26624
26917
|
const choice = templateChoice(template);
|
|
26625
26918
|
if ("error" in choice) return void printError(choice.error);
|
|
@@ -26830,7 +27123,7 @@ async function read(path9) {
|
|
|
26830
27123
|
renderFailure(err);
|
|
26831
27124
|
}
|
|
26832
27125
|
}
|
|
26833
|
-
var createCommand4 = new
|
|
27126
|
+
var createCommand4 = new Command143("create").description(
|
|
26834
27127
|
"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
27128
|
).argument("<projectId>", "Project id").requiredOption(
|
|
26836
27129
|
"--cadence <cadence>",
|
|
@@ -26869,7 +27162,7 @@ var createCommand4 = new Command142("create").description(
|
|
|
26869
27162
|
});
|
|
26870
27163
|
});
|
|
26871
27164
|
var OWNER_SCHEDULE_STATUSES = [...STATUSES, "needs_action", "all"];
|
|
26872
|
-
var listCommand7 = new
|
|
27165
|
+
var listCommand7 = new Command143("list").description(
|
|
26873
27166
|
"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
27167
|
).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
27168
|
"--status <status>",
|
|
@@ -26902,7 +27195,7 @@ var listCommand7 = new Command142("list").description(
|
|
|
26902
27195
|
const query4 = params.toString();
|
|
26903
27196
|
await read(withChainId(`/api/projects/${projectId}/schedules${query4 ? `?${query4}` : ""}`));
|
|
26904
27197
|
});
|
|
26905
|
-
var
|
|
27198
|
+
var showCommand5 = new Command143("show").description(
|
|
26906
27199
|
"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
27200
|
).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
26908
27201
|
const id = scheduleId(value);
|
|
@@ -26910,7 +27203,7 @@ var showCommand4 = new Command142("show").description(
|
|
|
26910
27203
|
await read(`/api/project-schedules/${id}`);
|
|
26911
27204
|
});
|
|
26912
27205
|
function actionCommand(action, description) {
|
|
26913
|
-
return new
|
|
27206
|
+
return new Command143(action).description(description).argument("<scheduleId>", "Schedule id").action(async (value) => {
|
|
26914
27207
|
const id = scheduleId(value);
|
|
26915
27208
|
if (typeof id !== "string") return void printError(id.error);
|
|
26916
27209
|
await postProjectWrite(
|
|
@@ -26920,7 +27213,7 @@ function actionCommand(action, description) {
|
|
|
26920
27213
|
);
|
|
26921
27214
|
});
|
|
26922
27215
|
}
|
|
26923
|
-
var settingsCommand = new
|
|
27216
|
+
var settingsCommand = new Command143("settings").description(
|
|
26924
27217
|
"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
27218
|
).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
27219
|
const projectId = parseProjectId(id);
|
|
@@ -26942,9 +27235,9 @@ var settingsCommand = new Command142("settings").description(
|
|
|
26942
27235
|
maxAmount: ACTION_FEE_MAX_AMOUNT
|
|
26943
27236
|
});
|
|
26944
27237
|
});
|
|
26945
|
-
var projectScheduleCommand = new
|
|
27238
|
+
var projectScheduleCommand = new Command143("schedule").description(
|
|
26946
27239
|
"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(
|
|
27240
|
+
).addCommand(createCommand4).addCommand(listCommand7).addCommand(showCommand5).addCommand(
|
|
26948
27241
|
actionCommand(
|
|
26949
27242
|
"pause",
|
|
26950
27243
|
"Pause a schedule; it creates nothing until resumed (costs 0.001 in the payment token)"
|
|
@@ -26965,15 +27258,15 @@ var projectScheduleCommand = new Command142("schedule").description(
|
|
|
26965
27258
|
"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
27259
|
)
|
|
26967
27260
|
).addCommand(settingsCommand);
|
|
26968
|
-
var projectRunnerCommand = new
|
|
27261
|
+
var projectRunnerCommand = new Command143("runner").description(
|
|
26969
27262
|
"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
27263
|
).action(async () => {
|
|
26971
27264
|
await read(withChainId("/api/project-runner"));
|
|
26972
27265
|
});
|
|
26973
27266
|
|
|
26974
27267
|
// src/commands/project/transfer.ts
|
|
26975
|
-
import { Command as
|
|
26976
|
-
var proposeCommand = new
|
|
27268
|
+
import { Command as Command144 } from "commander";
|
|
27269
|
+
var proposeCommand = new Command144("propose").description(
|
|
26977
27270
|
"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
27271
|
).argument("<projectId>", "Project id").requiredOption("--to <address>", "The wallet that will own the project once it accepts").action(async (id, opts) => {
|
|
26979
27272
|
const projectId = parseProjectId(id);
|
|
@@ -26987,7 +27280,7 @@ var proposeCommand = new Command143("propose").description(
|
|
|
26987
27280
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26988
27281
|
);
|
|
26989
27282
|
});
|
|
26990
|
-
var acceptCommand2 = new
|
|
27283
|
+
var acceptCommand2 = new Command144("accept").description(
|
|
26991
27284
|
"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
27285
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
26993
27286
|
const projectId = parseProjectId(id);
|
|
@@ -26998,7 +27291,7 @@ var acceptCommand2 = new Command143("accept").description(
|
|
|
26998
27291
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
26999
27292
|
);
|
|
27000
27293
|
});
|
|
27001
|
-
var cancelCommand = new
|
|
27294
|
+
var cancelCommand = new Command144("cancel").description(
|
|
27002
27295
|
"Withdraw the pending ownership proposal, as the project owner (costs 0.001 in the payment token)"
|
|
27003
27296
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27004
27297
|
const projectId = parseProjectId(id);
|
|
@@ -27009,13 +27302,13 @@ var cancelCommand = new Command143("cancel").description(
|
|
|
27009
27302
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27010
27303
|
);
|
|
27011
27304
|
});
|
|
27012
|
-
var projectTransferCommand = new
|
|
27305
|
+
var projectTransferCommand = new Command144("transfer").description(
|
|
27013
27306
|
"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
27307
|
).addCommand(proposeCommand).addCommand(acceptCommand2).addCommand(cancelCommand);
|
|
27015
27308
|
|
|
27016
27309
|
// src/commands/project/show.ts
|
|
27017
|
-
import { Command as
|
|
27018
|
-
var projectShowCommand = new
|
|
27310
|
+
import { Command as Command145 } from "commander";
|
|
27311
|
+
var projectShowCommand = new Command145("show").description(
|
|
27019
27312
|
"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
27313
|
).argument("<projectId>", "Project id").action(async (id) => {
|
|
27021
27314
|
const projectId = parseProjectId(id);
|
|
@@ -27024,7 +27317,7 @@ var projectShowCommand = new Command144("show").description(
|
|
|
27024
27317
|
printResult(await apiGet(withChainId(`/api/projects/${projectId}`), { headers }));
|
|
27025
27318
|
});
|
|
27026
27319
|
var BACKERS_CURSOR = /^\d{1,20}-\d{1,9}$/;
|
|
27027
|
-
var projectBackersCommand = new
|
|
27320
|
+
var projectBackersCommand = new Command145("backers").description(
|
|
27028
27321
|
"List a project's backers, newest first, with each one's contribution, shares, claims and claimable share (free)"
|
|
27029
27322
|
).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
27323
|
const projectId = parseProjectId(id);
|
|
@@ -27043,13 +27336,13 @@ var projectBackersCommand = new Command144("backers").description(
|
|
|
27043
27336
|
await apiGet(withChainId(`/api/projects/${projectId}/backers${query4 ? `?${query4}` : ""}`))
|
|
27044
27337
|
);
|
|
27045
27338
|
});
|
|
27046
|
-
var projectForTaskCommand = new
|
|
27339
|
+
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
27340
|
if (!/^0x[0-9a-fA-F]{1,78}$/.test(taskId.trim())) {
|
|
27048
27341
|
return void printError("The task id must be 0x-prefixed hex");
|
|
27049
27342
|
}
|
|
27050
27343
|
printResult(await apiGet(`/api/projects/by-task/${encodeURIComponent(taskId.trim())}`));
|
|
27051
27344
|
});
|
|
27052
|
-
var projectListCommand = new
|
|
27345
|
+
var projectListCommand = new Command145("list").description(
|
|
27053
27346
|
"List a wallet's projects, as owner, operator or backer, or with --funding the projects open for backing now (free; default: your wallet)"
|
|
27054
27347
|
).option(
|
|
27055
27348
|
"--funding",
|
|
@@ -27100,7 +27393,7 @@ var projectListCommand = new Command144("list").description(
|
|
|
27100
27393
|
);
|
|
27101
27394
|
|
|
27102
27395
|
// src/commands/project/index.ts
|
|
27103
|
-
var projectCommand = new
|
|
27396
|
+
var projectCommand = new Command146("project").description(
|
|
27104
27397
|
"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
27398
|
);
|
|
27106
27399
|
projectCommand.addCommand(projectCreateCommand);
|
|
@@ -27118,6 +27411,10 @@ projectCommand.addCommand(projectReviewCommand);
|
|
|
27118
27411
|
projectCommand.addCommand(projectAutomationsCommand);
|
|
27119
27412
|
projectCommand.addCommand(projectScheduleCommand);
|
|
27120
27413
|
projectCommand.addCommand(projectRunnerCommand);
|
|
27414
|
+
projectCommand.addCommand(projectSuggestCommand);
|
|
27415
|
+
projectCommand.addCommand(projectSuggestionsCommand);
|
|
27416
|
+
projectCommand.addCommand(projectSuggestionCommand);
|
|
27417
|
+
projectCommand.addCommand(projectSuggestionSettingsCommand);
|
|
27121
27418
|
projectCommand.addCommand(projectCloseCommand);
|
|
27122
27419
|
projectCommand.addCommand(projectClaimCommand);
|
|
27123
27420
|
projectCommand.addCommand(projectShowCommand);
|
|
@@ -27127,7 +27424,7 @@ projectCommand.addCommand(projectForTaskCommand);
|
|
|
27127
27424
|
|
|
27128
27425
|
// src/commands/workflow.ts
|
|
27129
27426
|
import { readFile as readFile5 } from "fs/promises";
|
|
27130
|
-
import { Command as
|
|
27427
|
+
import { Command as Command147 } from "commander";
|
|
27131
27428
|
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
27429
|
var FILE_MAX_BYTES2 = 256 * 1024;
|
|
27133
27430
|
function parseWorkflowText(text) {
|
|
@@ -27191,7 +27488,7 @@ async function projectContext(projectId) {
|
|
|
27191
27488
|
runner
|
|
27192
27489
|
};
|
|
27193
27490
|
}
|
|
27194
|
-
var validateCommand = new
|
|
27491
|
+
var validateCommand = new Command147("validate").description(
|
|
27195
27492
|
"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
27493
|
).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
27494
|
const parsed = await readDocument(opts.file ?? file);
|
|
@@ -27234,7 +27531,7 @@ var validateCommand = new Command146("validate").description(
|
|
|
27234
27531
|
document: result.document
|
|
27235
27532
|
});
|
|
27236
27533
|
});
|
|
27237
|
-
var createCommand5 = new
|
|
27534
|
+
var createCommand5 = new Command147("create").description(
|
|
27238
27535
|
"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
27536
|
).argument("<projectId>", "Project id").option("--file <path>", "The document, JSON").option(
|
|
27240
27537
|
"--template <template>",
|
|
@@ -27277,7 +27574,7 @@ var createCommand5 = new Command146("create").description(
|
|
|
27277
27574
|
);
|
|
27278
27575
|
});
|
|
27279
27576
|
var OWNER_WORKFLOW_STATUSES = ["needs_action", "running", "failed", "idle", "all"];
|
|
27280
|
-
var listCommand8 = new
|
|
27577
|
+
var listCommand8 = new Command147("list").description(
|
|
27281
27578
|
"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
27579
|
).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
27580
|
"--status <status>",
|
|
@@ -27307,7 +27604,7 @@ var listCommand8 = new Command146("list").description(
|
|
|
27307
27604
|
const query4 = params.toString();
|
|
27308
27605
|
await read2(withChainId(`/api/projects/${projectId}/workflows${query4 ? `?${query4}` : ""}`));
|
|
27309
27606
|
});
|
|
27310
|
-
var
|
|
27607
|
+
var showCommand6 = new Command147("show").description(
|
|
27311
27608
|
"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
27609
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27313
27610
|
const id = uuid(value, "workflow");
|
|
@@ -27320,7 +27617,7 @@ var showCommand5 = new Command146("show").description(
|
|
|
27320
27617
|
renderFailure(err);
|
|
27321
27618
|
}
|
|
27322
27619
|
});
|
|
27323
|
-
var updateTemplateCommand = new
|
|
27620
|
+
var updateTemplateCommand = new Command147("update-template").description(
|
|
27324
27621
|
"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
27622
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27326
27623
|
const id = uuid(value, "workflow");
|
|
@@ -27331,7 +27628,7 @@ var updateTemplateCommand = new Command146("update-template").description(
|
|
|
27331
27628
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27332
27629
|
);
|
|
27333
27630
|
});
|
|
27334
|
-
var runsCommand = new
|
|
27631
|
+
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
27632
|
const id = uuid(value, "workflow");
|
|
27336
27633
|
if (typeof id !== "string") return void printError(id.error);
|
|
27337
27634
|
if (opts.limit !== void 0 && !/^(100|[1-9][0-9]?)$/.test(opts.limit.trim())) {
|
|
@@ -27343,14 +27640,14 @@ var runsCommand = new Command146("runs").description("Page through a workflow's
|
|
|
27343
27640
|
const query4 = params.toString();
|
|
27344
27641
|
await read2(`/api/project-workflows/${id}/runs${query4 ? `?${query4}` : ""}`);
|
|
27345
27642
|
});
|
|
27346
|
-
var statusCommand3 = new
|
|
27643
|
+
var statusCommand3 = new Command147("status").description(
|
|
27347
27644
|
"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
27645
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27349
27646
|
const id = uuid(value, "run");
|
|
27350
27647
|
if (typeof id !== "string") return void printError(id.error);
|
|
27351
27648
|
await read2(`/api/project-workflow-runs/${id}`);
|
|
27352
27649
|
});
|
|
27353
|
-
var runCommand2 = new
|
|
27650
|
+
var runCommand2 = new Command147("run").description(
|
|
27354
27651
|
"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
27652
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27356
27653
|
const id = uuid(value, "workflow");
|
|
@@ -27362,7 +27659,7 @@ var runCommand2 = new Command146("run").description(
|
|
|
27362
27659
|
);
|
|
27363
27660
|
});
|
|
27364
27661
|
function stepCommand(action, description) {
|
|
27365
|
-
return new
|
|
27662
|
+
return new Command147(action).description(description).argument("<runId>", "Run id").requiredOption(
|
|
27366
27663
|
"--step <key>",
|
|
27367
27664
|
"The step key the run shows, e.g. gate-1, review[round=2] or post[attempt=2]"
|
|
27368
27665
|
).action(async (value, opts) => {
|
|
@@ -27377,7 +27674,7 @@ function stepCommand(action, description) {
|
|
|
27377
27674
|
);
|
|
27378
27675
|
});
|
|
27379
27676
|
}
|
|
27380
|
-
var cancelCommand2 = new
|
|
27677
|
+
var cancelCommand2 = new Command147("cancel").description(
|
|
27381
27678
|
"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
27679
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27383
27680
|
const id = uuid(value, "run");
|
|
@@ -27388,7 +27685,7 @@ var cancelCommand2 = new Command146("cancel").description(
|
|
|
27388
27685
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27389
27686
|
);
|
|
27390
27687
|
});
|
|
27391
|
-
var stopAutoPayoutCommand = new
|
|
27688
|
+
var stopAutoPayoutCommand = new Command147("stop-auto-payout").description(
|
|
27392
27689
|
"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
27690
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27394
27691
|
const id = uuid(value, "run");
|
|
@@ -27399,7 +27696,7 @@ var stopAutoPayoutCommand = new Command146("stop-auto-payout").description(
|
|
|
27399
27696
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27400
27697
|
);
|
|
27401
27698
|
});
|
|
27402
|
-
var deleteCommand3 = new
|
|
27699
|
+
var deleteCommand3 = new Command147("delete").description(
|
|
27403
27700
|
"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
27701
|
).argument("<workflowId>", "Workflow id").action(async (value) => {
|
|
27405
27702
|
const id = uuid(value, "workflow");
|
|
@@ -27421,21 +27718,21 @@ async function ownerRead(path9) {
|
|
|
27421
27718
|
renderFailure(err);
|
|
27422
27719
|
}
|
|
27423
27720
|
}
|
|
27424
|
-
var payoutListCommand = new
|
|
27425
|
-
"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)"
|
|
27721
|
+
var payoutListCommand = new Command147("list").description(
|
|
27722
|
+
"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), accepted_by_owner (the gated task was accepted by hand before the automatic payout landed; the runner paid nothing) or unavailable (free)"
|
|
27426
27723
|
).argument("<runId>", "Run id").action(async (value) => {
|
|
27427
27724
|
const id = uuid(value, "run");
|
|
27428
27725
|
if (typeof id !== "string") return void printError(id.error);
|
|
27429
27726
|
await ownerRead(withChainId(`/api/project-workflow-runs/${id}/payouts`));
|
|
27430
27727
|
});
|
|
27431
|
-
var payoutShowCommand = new
|
|
27432
|
-
"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)"
|
|
27728
|
+
var payoutShowCommand = new Command147("show").description(
|
|
27729
|
+
"Show a payout proposal: its status (pending, confirmed, auto_paid, accepted_by_owner 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
27730
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
27434
27731
|
const id = uuid(value, "payout proposal");
|
|
27435
27732
|
if (typeof id !== "string") return void printError(id.error);
|
|
27436
27733
|
await ownerRead(withChainId(`/api/project-workflow-payouts/${id}`));
|
|
27437
27734
|
});
|
|
27438
|
-
var payoutConfirmCommand = new
|
|
27735
|
+
var payoutConfirmCommand = new Command147("confirm").description(
|
|
27439
27736
|
"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
27737
|
).argument("<proposalId>", "Payout proposal id").action(async (value) => {
|
|
27441
27738
|
const id = uuid(value, "payout proposal");
|
|
@@ -27458,10 +27755,10 @@ var payoutConfirmCommand = new Command146("confirm").description(
|
|
|
27458
27755
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT, extra: { accept: view.accept } }
|
|
27459
27756
|
);
|
|
27460
27757
|
});
|
|
27461
|
-
var payoutCommand = new
|
|
27758
|
+
var payoutCommand = new Command147("payout").description(
|
|
27462
27759
|
"Payout proposals: a gating review's recommended winners and shares for the task it gates, which the owner confirms"
|
|
27463
27760
|
).addCommand(payoutListCommand).addCommand(payoutShowCommand).addCommand(payoutConfirmCommand);
|
|
27464
|
-
var settingsCommand2 = new
|
|
27761
|
+
var settingsCommand2 = new Command147("settings").description(
|
|
27465
27762
|
`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
27763
|
).argument("<projectId>", "Project id").option("--step-limit <count>", "The most task steps per workflow").action(async (id, opts) => {
|
|
27467
27764
|
const projectId = parseProjectId(id);
|
|
@@ -27492,9 +27789,9 @@ var settingsCommand2 = new Command146("settings").description(
|
|
|
27492
27789
|
{ maxAmount: ACTION_FEE_MAX_AMOUNT }
|
|
27493
27790
|
);
|
|
27494
27791
|
});
|
|
27495
|
-
var workflowCommand = new
|
|
27792
|
+
var workflowCommand = new Command147("workflow").description(
|
|
27496
27793
|
"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(
|
|
27794
|
+
).addCommand(validateCommand).addCommand(createCommand5).addCommand(listCommand8).addCommand(showCommand6).addCommand(runsCommand).addCommand(runCommand2).addCommand(statusCommand3).addCommand(
|
|
27498
27795
|
stepCommand(
|
|
27499
27796
|
"approve",
|
|
27500
27797
|
"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,8 +27804,8 @@ var workflowCommand = new Command146("workflow").description(
|
|
|
27507
27804
|
).addCommand(cancelCommand2).addCommand(stopAutoPayoutCommand).addCommand(updateTemplateCommand).addCommand(deleteCommand3).addCommand(settingsCommand2).addCommand(payoutCommand).addCommand(workflowTemplateCommand);
|
|
27508
27805
|
|
|
27509
27806
|
// src/commands/drops.ts
|
|
27510
|
-
import { Command as
|
|
27511
|
-
var listCommand9 = new
|
|
27807
|
+
import { Command as Command148 } from "commander";
|
|
27808
|
+
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(
|
|
27512
27809
|
async (opts) => {
|
|
27513
27810
|
try {
|
|
27514
27811
|
if (opts.worker && opts.entered) throw new Error("Pass --worker or --entered, not both");
|
|
@@ -27536,7 +27833,7 @@ var listCommand9 = new Command147("list").description("List public Task Drops, o
|
|
|
27536
27833
|
}
|
|
27537
27834
|
}
|
|
27538
27835
|
);
|
|
27539
|
-
var
|
|
27836
|
+
var showCommand7 = new Command148("show").description("Show a Task Drop and its discoverable tasks").argument("<taskDropId>", "Task Drop ID").action(async (taskDropId) => {
|
|
27540
27837
|
try {
|
|
27541
27838
|
const input = parseInput(TaskDropGetInputSchema, { taskDropId });
|
|
27542
27839
|
const result = await apiGet(`/api/task-drops/${encodeURIComponent(input.taskDropId)}`);
|
|
@@ -27548,7 +27845,7 @@ var showCommand6 = new Command147("show").description("Show a Task Drop and its
|
|
|
27548
27845
|
renderFailure(err);
|
|
27549
27846
|
}
|
|
27550
27847
|
});
|
|
27551
|
-
var subscribeCommand = new
|
|
27848
|
+
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(
|
|
27552
27849
|
async (taskDropId, opts) => {
|
|
27553
27850
|
try {
|
|
27554
27851
|
if (opts.official) {
|
|
@@ -27576,7 +27873,7 @@ var subscribeCommand = new Command147("subscribe").description("Subscribe an ema
|
|
|
27576
27873
|
}
|
|
27577
27874
|
}
|
|
27578
27875
|
);
|
|
27579
|
-
var statusCommand4 = new
|
|
27876
|
+
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) => {
|
|
27580
27877
|
try {
|
|
27581
27878
|
if (opts.official) {
|
|
27582
27879
|
if (taskDropId) throw new Error("Pass either a Task Drop ID or --official, not both");
|
|
@@ -27593,15 +27890,15 @@ var statusCommand4 = new Command147("status").description("Check whether an emai
|
|
|
27593
27890
|
renderFailure(err);
|
|
27594
27891
|
}
|
|
27595
27892
|
});
|
|
27596
|
-
var dropsCommand = new
|
|
27893
|
+
var dropsCommand = new Command148("drops").description("Browse Task Drops and manage email subscriptions to them").addCommand(listCommand9).addCommand(showCommand7).addCommand(subscribeCommand).addCommand(statusCommand4);
|
|
27597
27894
|
|
|
27598
27895
|
// src/commands/hooks.ts
|
|
27599
|
-
import { Command as
|
|
27896
|
+
import { Command as Command150 } from "commander";
|
|
27600
27897
|
import { BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError } from "viem";
|
|
27601
27898
|
|
|
27602
27899
|
// src/lib/listing-submissions.ts
|
|
27603
27900
|
import { readFile as readFile6 } from "fs/promises";
|
|
27604
|
-
import { Command as
|
|
27901
|
+
import { Command as Command149 } from "commander";
|
|
27605
27902
|
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.";
|
|
27606
27903
|
function prepareListingFile(kind, text) {
|
|
27607
27904
|
if (Buffer.byteLength(text, "utf8") > LISTING_SUBMISSION_MAX_BYTES) {
|
|
@@ -27658,7 +27955,7 @@ function prepareListingFile(kind, text) {
|
|
|
27658
27955
|
}
|
|
27659
27956
|
function submitCommandFor(kind) {
|
|
27660
27957
|
const what = kind === "catalog" ? "catalog entry (kind x402-endpoint)" : "hook manifest";
|
|
27661
|
-
return new
|
|
27958
|
+
return new Command149("submit").description(
|
|
27662
27959
|
`Submit a ${what} for staff review. Pays the standard action fee, kept either way; needs an ERC-8004 identity on the selected network`
|
|
27663
27960
|
).requiredOption("--file <path>", `Path to the ${what} JSON file`).action(async (opts) => {
|
|
27664
27961
|
let text;
|
|
@@ -27690,7 +27987,7 @@ function submitCommandFor(kind) {
|
|
|
27690
27987
|
});
|
|
27691
27988
|
}
|
|
27692
27989
|
function submissionsCommandFor(kind) {
|
|
27693
|
-
return new
|
|
27990
|
+
return new Command149("submissions").description(
|
|
27694
27991
|
`List the ${kind === "catalog" ? "catalog entries" : "hook listings"} you submitted and their status`
|
|
27695
27992
|
).option("--status <status>", `Only this status: ${LISTING_SUBMISSION_STATUSES.join(", ")}`).option("--limit <n>", "Maximum submissions to return (1-100)", "50").action(async (opts) => {
|
|
27696
27993
|
if (opts.status && !LISTING_SUBMISSION_STATUSES.includes(opts.status)) {
|
|
@@ -27756,7 +28053,7 @@ async function probeHookVersion(entry, chainId) {
|
|
|
27756
28053
|
return reverted ? { ...entry, hookVersion: 1 } : entry;
|
|
27757
28054
|
}
|
|
27758
28055
|
}
|
|
27759
|
-
var listCommand10 = new
|
|
28056
|
+
var listCommand10 = new Command150("list").description(
|
|
27760
28057
|
"List hooks listed (verified) in the hook registry on the selected --network, then observed hooks that are not listed"
|
|
27761
28058
|
).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(
|
|
27762
28059
|
"--cursor <cursor>",
|
|
@@ -27795,7 +28092,7 @@ var listCommand10 = new Command149("list").description(
|
|
|
27795
28092
|
}
|
|
27796
28093
|
}
|
|
27797
28094
|
);
|
|
27798
|
-
var
|
|
28095
|
+
var showCommand8 = new Command150("show").description(
|
|
27799
28096
|
"Show one hook on the selected --network: its registry listing, or its onchain observation marked unlisted"
|
|
27800
28097
|
).argument("<address>", "Hook contract address").action(async (address3) => {
|
|
27801
28098
|
try {
|
|
@@ -27815,7 +28112,7 @@ var showCommand7 = new Command149("show").description(
|
|
|
27815
28112
|
renderFailure(err);
|
|
27816
28113
|
}
|
|
27817
28114
|
});
|
|
27818
|
-
var encodeConfigCommand = new
|
|
28115
|
+
var encodeConfigCommand = new Command150("encode-config").description(
|
|
27819
28116
|
"Encode a V2 hook's typed configuration from its registry config schema, for --hook-config"
|
|
27820
28117
|
).argument("<address>", "Hook contract address").requiredOption(
|
|
27821
28118
|
"--values <json>",
|
|
@@ -27844,7 +28141,7 @@ var encodeConfigCommand = new Command149("encode-config").description(
|
|
|
27844
28141
|
renderFailure(err);
|
|
27845
28142
|
}
|
|
27846
28143
|
});
|
|
27847
|
-
var attachmentConfigCommand = new
|
|
28144
|
+
var attachmentConfigCommand = new Command150("attachment-config").description(
|
|
27848
28145
|
"Show the protocol-default hook order and maximum hooks per task on the selected --network"
|
|
27849
28146
|
).action(async () => {
|
|
27850
28147
|
try {
|
|
@@ -27853,16 +28150,16 @@ var attachmentConfigCommand = new Command149("attachment-config").description(
|
|
|
27853
28150
|
renderFailure(err);
|
|
27854
28151
|
}
|
|
27855
28152
|
});
|
|
27856
|
-
var hooksCommand = new
|
|
28153
|
+
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"));
|
|
27857
28154
|
|
|
27858
28155
|
// src/commands/catalog/index.ts
|
|
27859
|
-
import { Command as
|
|
27860
|
-
var catalogCommand = new
|
|
28156
|
+
import { Command as Command151 } from "commander";
|
|
28157
|
+
var catalogCommand = new Command151("catalog").description("Submit paid endpoints to the Taskmarket catalog and track your submissions").addCommand(submitCommandFor("catalog")).addCommand(submissionsCommandFor("catalog"));
|
|
27861
28158
|
|
|
27862
28159
|
// src/commands/tap.ts
|
|
27863
28160
|
import { promises as fs12 } from "fs";
|
|
27864
|
-
import { Command as
|
|
27865
|
-
var tapCommand = new
|
|
28161
|
+
import { Command as Command152 } from "commander";
|
|
28162
|
+
var tapCommand = new Command152("tap").description(
|
|
27866
28163
|
"Manage the TAP signing key used on tasks that require TAP verification"
|
|
27867
28164
|
);
|
|
27868
28165
|
tapCommand.command("import").description(
|
|
@@ -28021,7 +28318,7 @@ tapCommand.command("remove").description("Remove the TAP key from the keystore")
|
|
|
28021
28318
|
});
|
|
28022
28319
|
|
|
28023
28320
|
// src/commands/hire.ts
|
|
28024
|
-
import { Command as
|
|
28321
|
+
import { Command as Command153 } from "commander";
|
|
28025
28322
|
var OWN_FLAGS = /* @__PURE__ */ new Set(["--mode", "--hire-worker", "--service-id"]);
|
|
28026
28323
|
async function lookupListedService(worker, serviceId) {
|
|
28027
28324
|
let listing;
|
|
@@ -28053,7 +28350,7 @@ function hireEvaluatorError(opts, requiresEvaluator) {
|
|
|
28053
28350
|
}
|
|
28054
28351
|
return null;
|
|
28055
28352
|
}
|
|
28056
|
-
var hireCommand = new
|
|
28353
|
+
var hireCommand = new Command153("hire").description(
|
|
28057
28354
|
"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."
|
|
28058
28355
|
).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(
|
|
28059
28356
|
"--requires-evaluator",
|
|
@@ -28116,7 +28413,7 @@ hireCommand.action(async (worker, opts) => {
|
|
|
28116
28413
|
// src/index.ts
|
|
28117
28414
|
var require2 = createRequire(import.meta.url);
|
|
28118
28415
|
var { version } = require2("../package.json");
|
|
28119
|
-
var program = new
|
|
28416
|
+
var program = new Command154();
|
|
28120
28417
|
setLastErrorCliVersion(version);
|
|
28121
28418
|
program.name("taskmarket").description("Taskmarket CLI for AI agents").version(version);
|
|
28122
28419
|
program.option(
|