@lucid-agents/taskmarket 1.5.0 → 1.6.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/index.js +71 -38
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4182,6 +4182,7 @@ var TaskDropPageDataSchema = external_exports.object({
|
|
|
4182
4182
|
// ../../packages/shared/dist/schemas/task.schemas.js
|
|
4183
4183
|
var TaskMode = external_exports.enum(["bounty", "claim", "pitch", "benchmark", "auction"]);
|
|
4184
4184
|
var TaskVisibility = external_exports.enum(["unlisted", "public"]);
|
|
4185
|
+
var SubmissionVisibility = external_exports.enum(["public", "reveal_all", "winner_only", "never"]);
|
|
4185
4186
|
var TaskStatus = external_exports.enum([
|
|
4186
4187
|
"open",
|
|
4187
4188
|
"claimed",
|
|
@@ -4194,6 +4195,7 @@ var TaskStatus = external_exports.enum([
|
|
|
4194
4195
|
"expired",
|
|
4195
4196
|
"cancelled"
|
|
4196
4197
|
]);
|
|
4198
|
+
var TaskPhase = external_exports.enum(["active", "in_review", "awaiting_settlement", "resolved"]);
|
|
4197
4199
|
var AuctionType = external_exports.enum(["dutch", "english", "reverse_dutch", "reverse_english"]);
|
|
4198
4200
|
var PendingActionName = external_exports.enum([
|
|
4199
4201
|
"accept",
|
|
@@ -4249,6 +4251,7 @@ var TaskCreateSchema = external_exports.object({
|
|
|
4249
4251
|
tags: external_exports.array(external_exports.string()).max(10, "Maximum 10 tags allowed"),
|
|
4250
4252
|
mode: TaskMode.optional().default("bounty"),
|
|
4251
4253
|
taskVisibility: TaskVisibility.optional().default("public"),
|
|
4254
|
+
submissionVisibility: SubmissionVisibility.optional().default("public"),
|
|
4252
4255
|
stakeRequired: external_exports.boolean().optional().default(false),
|
|
4253
4256
|
stakeBps: external_exports.number().min(0).max(1e4).optional().default(0),
|
|
4254
4257
|
pitchDeadline: external_exports.number().positive().optional(),
|
|
@@ -4342,6 +4345,7 @@ var TaskResponseSchema = external_exports.object({
|
|
|
4342
4345
|
tags: external_exports.array(external_exports.string()),
|
|
4343
4346
|
mode: TaskMode,
|
|
4344
4347
|
taskVisibility: TaskVisibility.optional().default("public"),
|
|
4348
|
+
submissionVisibility: SubmissionVisibility.optional().default("public"),
|
|
4345
4349
|
stakeRequired: external_exports.boolean(),
|
|
4346
4350
|
stakeBps: external_exports.number(),
|
|
4347
4351
|
pitchDeadline: external_exports.string().nullable(),
|
|
@@ -4388,6 +4392,7 @@ var TaskResponseSchema = external_exports.object({
|
|
|
4388
4392
|
verdictConfidence: external_exports.number().nullable().optional(),
|
|
4389
4393
|
verdictEvidenceHash: external_exports.string().nullable().optional(),
|
|
4390
4394
|
submissionWindowOpen: external_exports.boolean(),
|
|
4395
|
+
phase: TaskPhase,
|
|
4391
4396
|
netReward: external_exports.string().nullable().optional(),
|
|
4392
4397
|
pendingActions: PendingActionSchema.array().optional(),
|
|
4393
4398
|
selfAward: external_exports.boolean().nullable().optional(),
|
|
@@ -4402,6 +4407,7 @@ var TaskListInputSchema = external_exports.object({
|
|
|
4402
4407
|
limit: external_exports.number().min(1).max(100).optional().default(20),
|
|
4403
4408
|
cursor: external_exports.string().optional(),
|
|
4404
4409
|
status: external_exports.union([TaskStatus, external_exports.literal("ALL")]).optional().default("ALL"),
|
|
4410
|
+
phase: TaskPhase.optional(),
|
|
4405
4411
|
mode: external_exports.enum(["ALL", "bounty", "claim", "pitch", "benchmark", "auction"]).optional().default("ALL"),
|
|
4406
4412
|
auctionType: AuctionType.optional(),
|
|
4407
4413
|
requesterActorType: external_exports.enum(["agent", "human"]).optional(),
|
|
@@ -4411,6 +4417,7 @@ var TaskListInputSchema = external_exports.object({
|
|
|
4411
4417
|
deadlineHours: external_exports.number().int().positive().optional(),
|
|
4412
4418
|
requester: external_exports.string().optional(),
|
|
4413
4419
|
worker: external_exports.string().optional(),
|
|
4420
|
+
taskDropId: external_exports.string().trim().min(1).optional(),
|
|
4414
4421
|
sort: external_exports.enum(["newest", "reward_desc", "reward_asc", "deadline_asc"]).optional().default("newest")
|
|
4415
4422
|
});
|
|
4416
4423
|
var TaskListResponseSchema = external_exports.object({
|
|
@@ -4419,12 +4426,7 @@ var TaskListResponseSchema = external_exports.object({
|
|
|
4419
4426
|
hasMore: external_exports.boolean()
|
|
4420
4427
|
});
|
|
4421
4428
|
var TaskInboxInputSchema = external_exports.object({
|
|
4422
|
-
address: external_exports.string()
|
|
4423
|
-
// Optional proof that the caller owns `address`: a signature over
|
|
4424
|
-
// `taskmarket:inbox:<address>` (see ADR-0015). When present and valid, the
|
|
4425
|
-
// response additionally includes that address's own unlisted tasks; otherwise
|
|
4426
|
-
// behavior is unchanged (public tasks only, same as today, for any address).
|
|
4427
|
-
signature: external_exports.string().optional()
|
|
4429
|
+
address: external_exports.string()
|
|
4428
4430
|
});
|
|
4429
4431
|
var TaskInboxResponseSchema = external_exports.object({
|
|
4430
4432
|
asRequester: external_exports.array(TaskResponseSchema),
|
|
@@ -5417,12 +5419,11 @@ function formatDreams(baseUnits) {
|
|
|
5417
5419
|
function buildSelectWorkerMessage(taskId, pitchId, workerAddress) {
|
|
5418
5420
|
return `taskmarket:select-worker:${taskId}:${pitchId}:${workerAddress.toLowerCase()}`;
|
|
5419
5421
|
}
|
|
5420
|
-
function
|
|
5421
|
-
return `taskmarket:
|
|
5422
|
-
}
|
|
5423
|
-
function buildMyBidsMessage(address) {
|
|
5424
|
-
return `taskmarket:my-bids:${address.toLowerCase()}`;
|
|
5422
|
+
function buildReadAuthMessage(address) {
|
|
5423
|
+
return `taskmarket:read:${address.toLowerCase()}`;
|
|
5425
5424
|
}
|
|
5425
|
+
var READ_AUTH_ADDRESS_HEADER = "X-Taskmarket-Caller-Address";
|
|
5426
|
+
var READ_AUTH_SIGNATURE_HEADER = "X-Taskmarket-Caller-Signature";
|
|
5426
5427
|
function buildSubmitMessage(taskId) {
|
|
5427
5428
|
return `taskmarket:submit:${taskId}`;
|
|
5428
5429
|
}
|
|
@@ -6597,6 +6598,10 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
|
|
|
6597
6598
|
"--task-visibility <mode>",
|
|
6598
6599
|
"Task visibility: public (default) or unlisted. Unlisted only hides a task from Taskmarket's own listings/search/SEO -- it stays permanently visible on the public blockchain to anyone with the link, reading the contract directly, or running their own indexer. Not a privacy feature.",
|
|
6599
6600
|
"public"
|
|
6601
|
+
).option(
|
|
6602
|
+
"--submission-visibility <mode>",
|
|
6603
|
+
"Submission visibility: public (default), reveal_all, winner_only, or never. Controls who can see what workers submit while the task is live and after it ends. public matches today's behavior exactly. The other three modes hide submissions from everyone but the requester and each submitting worker while the task is active; once it ends, reveal_all shows everything, winner_only shows only the winning submission(s), and never keeps every submission hidden indefinitely. Chosen once here and locked in permanently -- there is no command to change it later.",
|
|
6604
|
+
"public"
|
|
6600
6605
|
).option("--tags <tags>", "Comma-separated tags").option("--pitch-deadline <hours>", "Pitch deadline in hours from now (pitch mode only)").option("--bid-deadline <hours>", "Bid deadline in hours from now (auction mode only)").option("--max-price <usdc>", "Maximum bid price in USDC (required for auction mode)").option(
|
|
6601
6606
|
"--auction-type <type>",
|
|
6602
6607
|
"Auction subtype: dutch, english, reverse_dutch, reverse_english (required for auction mode)"
|
|
@@ -6626,6 +6631,12 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
|
|
|
6626
6631
|
if (opts.taskVisibility !== "public" && opts.taskVisibility !== "unlisted") {
|
|
6627
6632
|
return void printError("--task-visibility must be one of: public, unlisted");
|
|
6628
6633
|
}
|
|
6634
|
+
const validSubmissionVisibilities = ["public", "reveal_all", "winner_only", "never"];
|
|
6635
|
+
if (!validSubmissionVisibilities.includes(opts.submissionVisibility)) {
|
|
6636
|
+
return void printError(
|
|
6637
|
+
`--submission-visibility must be one of: ${validSubmissionVisibilities.join(", ")}`
|
|
6638
|
+
);
|
|
6639
|
+
}
|
|
6629
6640
|
if (opts.mode === "auction") {
|
|
6630
6641
|
if (!opts.maxPrice) {
|
|
6631
6642
|
return void printError("--max-price is required for auction mode");
|
|
@@ -6670,6 +6681,7 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
|
|
|
6670
6681
|
duration,
|
|
6671
6682
|
mode: opts.mode,
|
|
6672
6683
|
taskVisibility: opts.taskVisibility,
|
|
6684
|
+
submissionVisibility: opts.submissionVisibility,
|
|
6673
6685
|
tags,
|
|
6674
6686
|
stakeRequired: false,
|
|
6675
6687
|
stakeBps: 0
|
|
@@ -6756,13 +6768,17 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
|
|
|
6756
6768
|
|
|
6757
6769
|
// src/commands/task/search.ts
|
|
6758
6770
|
import { Command as Command7 } from "commander";
|
|
6759
|
-
var listCmd = new Command7("list").alias("search").description("List available tasks").option("--status <status>", "Filter by status (e.g. open)", "open").option(
|
|
6771
|
+
var listCmd = new Command7("list").alias("search").description("List available tasks").option("--status <status>", "Filter by status (e.g. open)", "open").option(
|
|
6772
|
+
"--phase <phase>",
|
|
6773
|
+
"Filter by derived lifecycle phase (active, in_review, awaiting_settlement, resolved) -- independent of --status, e.g. --phase awaiting_settlement finds tasks whose deadline has passed but are still open/claimed/worker_selected"
|
|
6774
|
+
).option("--mode <mode>", "Filter by mode (bounty, claim, pitch, benchmark, auction)").option(
|
|
6760
6775
|
"--auction-type <type>",
|
|
6761
6776
|
"Filter auction tasks by subtype (dutch, english, reverse_dutch, reverse_english)"
|
|
6762
6777
|
).option("--tags <tags>", "Comma-separated tags to filter by").option("--skill <skill>", "Filter by skill tag (comma-separated, alias for --tags)").option("--reward-min <n>", "Minimum reward in USDC").option("--reward-max <n>", "Maximum reward in USDC").option("--deadline-hours <n>", "Only tasks expiring within this many hours").option("--limit <n>", "Maximum results to return", "20").option("--cursor <cursor>", "Cursor from previous page (nextCursor in JSON output)").action(
|
|
6763
6778
|
async (opts) => {
|
|
6764
6779
|
const params = new URLSearchParams();
|
|
6765
6780
|
if (opts.status) params.set("status", opts.status);
|
|
6781
|
+
if (opts.phase) params.set("phase", opts.phase);
|
|
6766
6782
|
if (opts.mode) params.set("mode", opts.mode);
|
|
6767
6783
|
if (opts.auctionType) params.set("auctionType", opts.auctionType);
|
|
6768
6784
|
const tagsValue = opts.tags ?? opts.skill;
|
|
@@ -7148,10 +7164,38 @@ var auctionAcceptCmd = new Command20("auction-accept").description("Accept curre
|
|
|
7148
7164
|
|
|
7149
7165
|
// src/commands/task/submissions.ts
|
|
7150
7166
|
import { Command as Command21 } from "commander";
|
|
7167
|
+
|
|
7168
|
+
// src/lib/read-auth.ts
|
|
7169
|
+
async function signReadAuth() {
|
|
7170
|
+
let keystore;
|
|
7171
|
+
try {
|
|
7172
|
+
keystore = await loadKeystore();
|
|
7173
|
+
} catch {
|
|
7174
|
+
return null;
|
|
7175
|
+
}
|
|
7176
|
+
try {
|
|
7177
|
+
const account = await createWalletAccountFromKeystore(keystore);
|
|
7178
|
+
const signature = await account.signMessage({
|
|
7179
|
+
message: buildReadAuthMessage(keystore.walletAddress)
|
|
7180
|
+
});
|
|
7181
|
+
return {
|
|
7182
|
+
walletAddress: keystore.walletAddress,
|
|
7183
|
+
headers: {
|
|
7184
|
+
[READ_AUTH_ADDRESS_HEADER]: keystore.walletAddress,
|
|
7185
|
+
[READ_AUTH_SIGNATURE_HEADER]: signature
|
|
7186
|
+
}
|
|
7187
|
+
};
|
|
7188
|
+
} catch {
|
|
7189
|
+
return { walletAddress: keystore.walletAddress, headers: {} };
|
|
7190
|
+
}
|
|
7191
|
+
}
|
|
7192
|
+
|
|
7193
|
+
// src/commands/task/submissions.ts
|
|
7151
7194
|
var submissionsCmd = new Command21("submissions").description("List submissions for a task").argument("<taskId>", "Task ID (0x-prefixed hex)").action(async (taskId) => {
|
|
7195
|
+
const auth = await signReadAuth();
|
|
7152
7196
|
let subs;
|
|
7153
7197
|
try {
|
|
7154
|
-
subs = await apiGet(`/api/tasks/${taskId}/submissions
|
|
7198
|
+
subs = await apiGet(`/api/tasks/${taskId}/submissions`, { headers: auth?.headers ?? {} });
|
|
7155
7199
|
} catch (err) {
|
|
7156
7200
|
const msg = err instanceof Error ? err.message : "Failed to fetch submissions.";
|
|
7157
7201
|
printError(msg);
|
|
@@ -7314,13 +7358,14 @@ var rejectAllSubmissionsCmd = new Command27("reject-all-submissions").descriptio
|
|
|
7314
7358
|
import { Command as Command28 } from "commander";
|
|
7315
7359
|
var mySubmissionsCmd = new Command28("my-submissions").description("List all submissions made by your wallet across all tasks.").option("--address <address>", "Wallet address to query (defaults to own wallet from keystore)").action(async (opts) => {
|
|
7316
7360
|
try {
|
|
7317
|
-
|
|
7361
|
+
const auth = await signReadAuth();
|
|
7362
|
+
const address = opts.address ?? auth?.walletAddress;
|
|
7318
7363
|
if (!address) {
|
|
7319
|
-
|
|
7320
|
-
address = keystore.walletAddress;
|
|
7364
|
+
throw new Error("No address provided and no keystore found -- pass --address <address>.");
|
|
7321
7365
|
}
|
|
7322
7366
|
const result = await apiGet(
|
|
7323
|
-
`/api/submissions/mine?workerAddress=${encodeURIComponent(address)}
|
|
7367
|
+
`/api/submissions/mine?workerAddress=${encodeURIComponent(address)}`,
|
|
7368
|
+
{ headers: auth?.headers ?? {} }
|
|
7324
7369
|
);
|
|
7325
7370
|
printResult(result);
|
|
7326
7371
|
} catch (err) {
|
|
@@ -7611,30 +7656,18 @@ var agentsCommand = new Command37("agents").description("Browse the agent direct
|
|
|
7611
7656
|
// src/commands/inbox.ts
|
|
7612
7657
|
import { Command as Command38 } from "commander";
|
|
7613
7658
|
var inboxCommand = new Command38("inbox").description("Show tasks you created and tasks you are working on").action(async () => {
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
keystore
|
|
7617
|
-
} catch (err) {
|
|
7618
|
-
const msg = err instanceof Error ? err.message : "No keystore found. Run `taskmarket init` first.";
|
|
7619
|
-
printError(msg);
|
|
7620
|
-
}
|
|
7621
|
-
const address = keystore.walletAddress;
|
|
7622
|
-
let account;
|
|
7623
|
-
try {
|
|
7624
|
-
account = await createWalletAccountFromKeystore(keystore);
|
|
7625
|
-
} catch {
|
|
7659
|
+
const auth = await signReadAuth();
|
|
7660
|
+
if (!auth) {
|
|
7661
|
+
printError("No keystore found. Run `taskmarket init` first.");
|
|
7626
7662
|
}
|
|
7627
|
-
const
|
|
7628
|
-
|
|
7629
|
-
account?.signMessage({ message: buildMyBidsMessage(address) }).catch(() => void 0)
|
|
7630
|
-
]);
|
|
7663
|
+
const address = auth.walletAddress;
|
|
7664
|
+
const hasReadAuth = Object.keys(auth.headers).length > 0;
|
|
7631
7665
|
const inboxParams = new URLSearchParams({ address });
|
|
7632
|
-
if (signature) inboxParams.set("signature", signature);
|
|
7633
|
-
const bidParams = new URLSearchParams({ address });
|
|
7634
|
-
if (bidsSignature) bidParams.set("signature", bidsSignature);
|
|
7635
7666
|
const [taskResult, pendingBids] = await Promise.all([
|
|
7636
|
-
apiGet(`/api/agents/inbox?${inboxParams.toString()}
|
|
7637
|
-
|
|
7667
|
+
apiGet(`/api/agents/inbox?${inboxParams.toString()}`, {
|
|
7668
|
+
headers: auth.headers
|
|
7669
|
+
}),
|
|
7670
|
+
hasReadAuth ? apiGet("/api/bids/my", { headers: auth.headers }).catch(
|
|
7638
7671
|
() => []
|
|
7639
7672
|
) : Promise.resolve([])
|
|
7640
7673
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucid-agents/taskmarket",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"taskmarket": "./dist/index.js"
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"tsx": "^4.7.0",
|
|
18
18
|
"typescript": "^5.3.3",
|
|
19
19
|
"vitest": "^2.0.0",
|
|
20
|
-
"@taskmarket/eslint-config": "0.0.0",
|
|
21
20
|
"@taskmarket/prettier-config": "0.0.0",
|
|
21
|
+
"@taskmarket/eslint-config": "0.0.0",
|
|
22
22
|
"@taskmarket/shared": "2.0.0"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|