@bountyagents/bountyagents-task 2026.2.274 → 2026.2.275
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 +336 -16626
- package/package.json +2 -3
- package/src/index.ts +1 -6
- package/src/task-db-types.ts +70 -0
- package/src/types.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bountyagents/bountyagents-task",
|
|
3
|
-
"version": "2026.2.
|
|
3
|
+
"version": "2026.2.275",
|
|
4
4
|
"description": "BountyAgents Task Plugin for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@sinclair/typebox": "^0.34.48",
|
|
21
21
|
"zod": "^4.3.6",
|
|
22
|
-
"viem": "^2.9.5"
|
|
23
|
-
"@bountyagents/task-db": "workspace:*"
|
|
22
|
+
"viem": "^2.9.5"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
25
|
"openclaw": "*"
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { fetch } from "undici";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
4
|
-
TaskRecord,
|
|
5
|
-
ResponseRecord,
|
|
6
|
-
taskRecordSchema,
|
|
7
|
-
responseRecordSchema,
|
|
8
|
-
} from "@bountyagents/task-db";
|
|
9
3
|
import { getAddress, Hex } from "viem";
|
|
4
|
+
import { ResponseRecord, TaskRecord, responseRecordSchema, taskRecordSchema } from "./task-db-types.js";
|
|
10
5
|
import { Signer } from "./signers.js";
|
|
11
6
|
import {
|
|
12
7
|
CancelTaskPayload,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const taskStatusSchema = z.enum(["finished", "draft", "active", "closed"]);
|
|
4
|
+
export type TaskStatus = z.infer<typeof taskStatusSchema>;
|
|
5
|
+
|
|
6
|
+
export const responseStatusSchema = z.enum(["pending", "approved", "rejected"]);
|
|
7
|
+
export type ResponseStatus = z.infer<typeof responseStatusSchema>;
|
|
8
|
+
|
|
9
|
+
export const taskRecordSchema = z.object({
|
|
10
|
+
id: z.string().uuid(),
|
|
11
|
+
title: z.string(),
|
|
12
|
+
content: z.string(),
|
|
13
|
+
owner: z.string(),
|
|
14
|
+
created_at: z.number(),
|
|
15
|
+
status: taskStatusSchema,
|
|
16
|
+
price: z.string(),
|
|
17
|
+
token: z.string().nullable(),
|
|
18
|
+
withdraw_signature: z.string().nullable()
|
|
19
|
+
});
|
|
20
|
+
export type TaskRecord = z.infer<typeof taskRecordSchema>;
|
|
21
|
+
|
|
22
|
+
export const responseRecordSchema = z.object({
|
|
23
|
+
id: z.string().uuid(),
|
|
24
|
+
task_id: z.string().uuid(),
|
|
25
|
+
payload: z.string(),
|
|
26
|
+
worker: z.string(),
|
|
27
|
+
status: responseStatusSchema,
|
|
28
|
+
created_at: z.number(),
|
|
29
|
+
settlement: z.string().nullable(),
|
|
30
|
+
settlement_signature: z.string().nullable()
|
|
31
|
+
});
|
|
32
|
+
export type ResponseRecord = z.infer<typeof responseRecordSchema>;
|
|
33
|
+
|
|
34
|
+
export type NewTaskInput = Omit<TaskRecord, 'created_at' | 'status'> & {
|
|
35
|
+
status?: TaskStatus;
|
|
36
|
+
created_at?: number;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type NewResponseInput = Omit<ResponseRecord, 'created_at' | 'status' | 'settlement'> & {
|
|
40
|
+
status?: ResponseStatus;
|
|
41
|
+
created_at?: number;
|
|
42
|
+
settlement?: string | null;
|
|
43
|
+
settlement_signature?: string | null;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type TaskSortKey = 'price' | 'created_at';
|
|
47
|
+
|
|
48
|
+
export interface TaskQueryFilters {
|
|
49
|
+
publisher?: string | null;
|
|
50
|
+
createdAfter?: number | null;
|
|
51
|
+
createdBefore?: number | null;
|
|
52
|
+
status?: TaskStatus | null;
|
|
53
|
+
keyword?: string | null;
|
|
54
|
+
minPrice?: number;
|
|
55
|
+
sortBy?: TaskSortKey;
|
|
56
|
+
pageSize?: number;
|
|
57
|
+
pageNum?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface TaskResponsesPageOptions {
|
|
61
|
+
worker?: string;
|
|
62
|
+
pageSize?: number;
|
|
63
|
+
pageNum?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface WorkerResponsesPageOptions {
|
|
67
|
+
taskId?: string;
|
|
68
|
+
pageSize?: number;
|
|
69
|
+
pageNum?: number;
|
|
70
|
+
}
|
package/src/types.ts
CHANGED