@bountyagents/bountyagents-task 2026.2.274 → 2026.2.276

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/index.ts CHANGED
@@ -23,14 +23,14 @@ export default function register(api: any) {
23
23
  });
24
24
 
25
25
  try {
26
- const task = await plugin.executeTool(
26
+ const task = (await plugin.executeTool(
27
27
  "bountyagents.publisher.task.create",
28
28
  {
29
29
  id: crypto.randomUUID(),
30
30
  title: "Test Task from CLI",
31
31
  content: "This is a test task created via the CLI tool.",
32
32
  }
33
- ) as any;
33
+ )) as any;
34
34
  console.log("Task created successfully:", task);
35
35
  return {
36
36
  text: `Task created successfully: ${task.id}`,
@@ -45,18 +45,15 @@ export default function register(api: any) {
45
45
  }
46
46
 
47
47
  return {
48
- text: [
49
- "Bounty Agents Task commands:",
50
- "",
51
- "/task create",
52
- ].join("\n"),
48
+ text: ["Bounty Agents Task commands:", "", "/task create"].join("\n"),
53
49
  };
54
50
  },
55
51
  });
56
52
 
57
53
  api.registerTool({
58
54
  name: "create_bounty_task",
59
- description: "Create a draft bounty task for an agent based on user request",
55
+ description:
56
+ "Create a draft bounty task for an agent based on user request, tell user to give title and content of the task, and return the created task id to user if successful",
60
57
  parameters: Type.Object({
61
58
  title: Type.String(),
62
59
  content: Type.String(),
@@ -71,27 +68,27 @@ export default function register(api: any) {
71
68
  });
72
69
 
73
70
  try {
74
- const task = await plugin.executeTool(
71
+ const task = (await plugin.executeTool(
75
72
  "bountyagents.publisher.task.create",
76
73
  {
77
74
  id: crypto.randomUUID(),
78
75
  title: params.title,
79
76
  content: params.content,
80
77
  }
81
- ) as any;
78
+ )) as any;
82
79
  return {
83
80
  content: [
84
- { type: "text", text: `Task created successfully! ID: ${task.id}` }
85
- ]
81
+ { type: "text", text: `Task created successfully! ID: ${task.id}` },
82
+ ],
86
83
  };
87
84
  } catch (error: any) {
88
85
  return {
89
86
  content: [
90
- { type: "text", text: `Failed to create task: ${error.message}` }
87
+ { type: "text", text: `Failed to create task: ${error.message}` },
91
88
  ],
92
- isError: true
89
+ isError: true,
93
90
  };
94
91
  }
95
- }
92
+ },
96
93
  });
97
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bountyagents/bountyagents-task",
3
- "version": "2026.2.274",
3
+ "version": "2026.2.276",
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
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { responseStatusSchema, taskStatusSchema } from '@bountyagents/task-db';
2
+ import { responseStatusSchema, taskStatusSchema } from './task-db-types.js';
3
3
  import { getAddress, isAddress } from 'viem';
4
4
 
5
5
  const addressSchema = z