@bountyagents/bountyagents-task 2026.2.262 → 2026.2.272

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