@bountyagents/bountyagents-task 2026.2.261 → 2026.2.271

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.
Files changed (3) hide show
  1. package/dist/index.js +37 -6
  2. package/index.ts +45 -35
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -42391,8 +42391,7 @@ function register(api2) {
42391
42391
  });
42392
42392
  console.log("Task created successfully:", task);
42393
42393
  return {
42394
- text: "Task created successfully:",
42395
- task
42394
+ text: `Task created successfully: ${task.id}`
42396
42395
  };
42397
42396
  } catch (error) {
42398
42397
  console.error("Failed to create task:", error);
@@ -42404,16 +42403,48 @@ function register(api2) {
42404
42403
  }
42405
42404
  return {
42406
42405
  text: [
42407
- "Voice commands:",
42406
+ "Bounty Agents Task commands:",
42408
42407
  "",
42409
- "/voice status",
42410
- "/voice list [limit]",
42411
- "/voice set <voiceId|name>"
42408
+ "/task create"
42412
42409
  ].join(`
42413
42410
  `)
42414
42411
  };
42415
42412
  }
42416
42413
  });
42414
+ api2.registerTool({
42415
+ name: "create_bounty_task",
42416
+ description: "Create a draft bounty task for an agent based on user request",
42417
+ parameters: exports_external.object({
42418
+ title: exports_external.string({ description: "The title of the bounty task" }),
42419
+ content: exports_external.string({ description: "Detailed description and requirements of the task" })
42420
+ }),
42421
+ async execute(_id, params) {
42422
+ const signer = new PrivateKeySigner("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80");
42423
+ const plugin = new BountyAgentsPublisherPlugin(signer, {
42424
+ serviceUrl: "http://localhost:3000",
42425
+ contractAddress: "0x55D45aFA265d0381C8A81328FfeA408D2Dd45F40"
42426
+ });
42427
+ try {
42428
+ const task = await plugin.executeTool("bountyagents.publisher.task.create", {
42429
+ id: crypto2.randomUUID(),
42430
+ title: params.title,
42431
+ content: params.content
42432
+ });
42433
+ return {
42434
+ content: [
42435
+ { type: "text", text: `Task created successfully! ID: ${task.id}` }
42436
+ ]
42437
+ };
42438
+ } catch (error) {
42439
+ return {
42440
+ content: [
42441
+ { type: "text", text: `Failed to create task: ${error.message}` }
42442
+ ],
42443
+ isError: true
42444
+ };
42445
+ }
42446
+ }
42447
+ });
42417
42448
  }
42418
42449
  export {
42419
42450
  register as default
package/index.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import { BountyAgentsPublisherPlugin } from "./src/index.js";
2
2
  import { PrivateKeySigner } from "./src/signers.js";
3
3
  import crypto from "node:crypto";
4
+ import { z } from "zod";
4
5
 
5
6
  export default function register(api: any) {
6
7
  api.registerCommand({
7
8
  name: "task",
8
9
  description: "Bounty Agents Task commands",
9
10
  acceptsArgs: true,
10
- handler: async (ctx) => {
11
+ handler: async (ctx: any) => {
11
12
  const args = ctx.args?.trim() ?? "";
12
13
  const tokens = args.split(/\s+/).filter(Boolean);
13
14
  const action = (tokens[0] ?? "status").toLowerCase();
@@ -29,11 +30,10 @@ export default function register(api: any) {
29
30
  title: "Test Task from CLI",
30
31
  content: "This is a test task created via the CLI tool.",
31
32
  }
32
- );
33
+ ) as any;
33
34
  console.log("Task created successfully:", task);
34
35
  return {
35
- text: "Task created successfully:",
36
- task,
36
+ text: `Task created successfully: ${task.id}`,
37
37
  };
38
38
  } catch (error) {
39
39
  console.error("Failed to create task:", error);
@@ -46,42 +46,52 @@ export default function register(api: any) {
46
46
 
47
47
  return {
48
48
  text: [
49
- "Voice commands:",
49
+ "Bounty Agents Task commands:",
50
50
  "",
51
- "/voice status",
52
- "/voice list [limit]",
53
- "/voice set <voiceId|name>",
51
+ "/task create",
54
52
  ].join("\n"),
55
53
  };
56
54
  },
57
55
  });
58
56
 
59
- // api.registerCli(
60
- // ({ program }: { program: any }) => {
61
- // program.command("createtask").action(async () => {
62
- // const signer = new PrivateKeySigner(
63
- // "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
64
- // );
65
- // const plugin = new BountyAgentsPublisherPlugin(signer, {
66
- // serviceUrl: "http://localhost:3000",
67
- // contractAddress: "0x55D45aFA265d0381C8A81328FfeA408D2Dd45F40",
68
- // });
57
+ api.registerTool({
58
+ name: "create_bounty_task",
59
+ description: "Create a draft bounty task for an agent based on user request",
60
+ parameters: z.object({
61
+ title: z.string({ description: "The title of the bounty task" }),
62
+ content: z.string({ description: "Detailed description and requirements of the task" }),
63
+ }),
64
+ async execute(_id: string, params: any) {
65
+ const signer = new PrivateKeySigner(
66
+ "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
67
+ );
68
+ const plugin = new BountyAgentsPublisherPlugin(signer, {
69
+ serviceUrl: "http://localhost:3000",
70
+ contractAddress: "0x55D45aFA265d0381C8A81328FfeA408D2Dd45F40",
71
+ });
69
72
 
70
- // try {
71
- // const task = await plugin.executeTool(
72
- // "bountyagents.publisher.task.create",
73
- // {
74
- // id: crypto.randomUUID(),
75
- // title: "Test Task from CLI",
76
- // content: "This is a test task created via the CLI tool.",
77
- // }
78
- // );
79
- // console.log("Task created successfully:", task);
80
- // } catch (error) {
81
- // console.error("Failed to create task:", error);
82
- // }
83
- // });
84
- // },
85
- // { commands: ["createtask"] }
86
- // );
73
+ try {
74
+ const task = await plugin.executeTool(
75
+ "bountyagents.publisher.task.create",
76
+ {
77
+ id: crypto.randomUUID(),
78
+ title: params.title,
79
+ content: params.content,
80
+ }
81
+ ) as any;
82
+ return {
83
+ content: [
84
+ { type: "text", text: `Task created successfully! ID: ${task.id}` }
85
+ ]
86
+ };
87
+ } catch (error: any) {
88
+ return {
89
+ content: [
90
+ { type: "text", text: `Failed to create task: ${error.message}` }
91
+ ],
92
+ isError: true
93
+ };
94
+ }
95
+ }
96
+ });
87
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bountyagents/bountyagents-task",
3
- "version": "2026.2.261",
3
+ "version": "2026.2.271",
4
4
  "description": "BountyAgents Task Plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",