@bountyagents/bountyagents-task 2026.2.26 → 2026.2.261
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/README.md +26 -0
- package/dist/index.js +45 -19
- package/index.ts +60 -7
- package/package.json +1 -1
- package/.env.local +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# bountyagents-task
|
|
2
|
+
|
|
3
|
+
## Tutorial
|
|
4
|
+
|
|
5
|
+
To install and use this plugin, follow these steps:
|
|
6
|
+
|
|
7
|
+
1. **Install the plugin:**
|
|
8
|
+
```bash
|
|
9
|
+
openclaw plugins install @bountyagents/bountyagents-task
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Enable the plugin:**
|
|
13
|
+
```bash
|
|
14
|
+
openclaw plugins enable bountyagents-task
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. **Restart the gateway:**
|
|
18
|
+
```bash
|
|
19
|
+
openclaw gateway restart
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
4. **Create a task:**
|
|
23
|
+
You can now run the following command in your terminal:
|
|
24
|
+
```bash
|
|
25
|
+
openclaw createtask
|
|
26
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -42368,27 +42368,53 @@ class PrivateKeySigner {
|
|
|
42368
42368
|
|
|
42369
42369
|
// index.ts
|
|
42370
42370
|
import crypto2 from "node:crypto";
|
|
42371
|
-
function
|
|
42372
|
-
api2.
|
|
42373
|
-
|
|
42374
|
-
|
|
42375
|
-
|
|
42376
|
-
|
|
42377
|
-
|
|
42378
|
-
|
|
42379
|
-
|
|
42380
|
-
|
|
42381
|
-
|
|
42382
|
-
|
|
42383
|
-
|
|
42371
|
+
function register(api2) {
|
|
42372
|
+
api2.registerCommand({
|
|
42373
|
+
name: "task",
|
|
42374
|
+
description: "Bounty Agents Task commands",
|
|
42375
|
+
acceptsArgs: true,
|
|
42376
|
+
handler: async (ctx) => {
|
|
42377
|
+
const args = ctx.args?.trim() ?? "";
|
|
42378
|
+
const tokens = args.split(/\s+/).filter(Boolean);
|
|
42379
|
+
const action = (tokens[0] ?? "status").toLowerCase();
|
|
42380
|
+
if (action === "create") {
|
|
42381
|
+
const signer = new PrivateKeySigner("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80");
|
|
42382
|
+
const plugin = new BountyAgentsPublisherPlugin(signer, {
|
|
42383
|
+
serviceUrl: "http://localhost:3000",
|
|
42384
|
+
contractAddress: "0x55D45aFA265d0381C8A81328FfeA408D2Dd45F40"
|
|
42384
42385
|
});
|
|
42385
|
-
|
|
42386
|
-
|
|
42387
|
-
|
|
42386
|
+
try {
|
|
42387
|
+
const task = await plugin.executeTool("bountyagents.publisher.task.create", {
|
|
42388
|
+
id: crypto2.randomUUID(),
|
|
42389
|
+
title: "Test Task from CLI",
|
|
42390
|
+
content: "This is a test task created via the CLI tool."
|
|
42391
|
+
});
|
|
42392
|
+
console.log("Task created successfully:", task);
|
|
42393
|
+
return {
|
|
42394
|
+
text: "Task created successfully:",
|
|
42395
|
+
task
|
|
42396
|
+
};
|
|
42397
|
+
} catch (error) {
|
|
42398
|
+
console.error("Failed to create task:", error);
|
|
42399
|
+
return {
|
|
42400
|
+
text: "Failed to create task:",
|
|
42401
|
+
error
|
|
42402
|
+
};
|
|
42403
|
+
}
|
|
42388
42404
|
}
|
|
42389
|
-
|
|
42390
|
-
|
|
42405
|
+
return {
|
|
42406
|
+
text: [
|
|
42407
|
+
"Voice commands:",
|
|
42408
|
+
"",
|
|
42409
|
+
"/voice status",
|
|
42410
|
+
"/voice list [limit]",
|
|
42411
|
+
"/voice set <voiceId|name>"
|
|
42412
|
+
].join(`
|
|
42413
|
+
`)
|
|
42414
|
+
};
|
|
42415
|
+
}
|
|
42416
|
+
});
|
|
42391
42417
|
}
|
|
42392
42418
|
export {
|
|
42393
|
-
|
|
42419
|
+
register as default
|
|
42394
42420
|
};
|
package/index.ts
CHANGED
|
@@ -2,10 +2,17 @@ import { BountyAgentsPublisherPlugin } from "./src/index.js";
|
|
|
2
2
|
import { PrivateKeySigner } from "./src/signers.js";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
|
|
5
|
-
export default function (api: any) {
|
|
6
|
-
api.
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export default function register(api: any) {
|
|
6
|
+
api.registerCommand({
|
|
7
|
+
name: "task",
|
|
8
|
+
description: "Bounty Agents Task commands",
|
|
9
|
+
acceptsArgs: true,
|
|
10
|
+
handler: async (ctx) => {
|
|
11
|
+
const args = ctx.args?.trim() ?? "";
|
|
12
|
+
const tokens = args.split(/\s+/).filter(Boolean);
|
|
13
|
+
const action = (tokens[0] ?? "status").toLowerCase();
|
|
14
|
+
|
|
15
|
+
if (action === "create") {
|
|
9
16
|
const signer = new PrivateKeySigner(
|
|
10
17
|
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
|
|
11
18
|
);
|
|
@@ -24,11 +31,57 @@ export default function (api: any) {
|
|
|
24
31
|
}
|
|
25
32
|
);
|
|
26
33
|
console.log("Task created successfully:", task);
|
|
34
|
+
return {
|
|
35
|
+
text: "Task created successfully:",
|
|
36
|
+
task,
|
|
37
|
+
};
|
|
27
38
|
} catch (error) {
|
|
28
39
|
console.error("Failed to create task:", error);
|
|
40
|
+
return {
|
|
41
|
+
text: "Failed to create task:",
|
|
42
|
+
error: error,
|
|
43
|
+
};
|
|
29
44
|
}
|
|
30
|
-
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
text: [
|
|
49
|
+
"Voice commands:",
|
|
50
|
+
"",
|
|
51
|
+
"/voice status",
|
|
52
|
+
"/voice list [limit]",
|
|
53
|
+
"/voice set <voiceId|name>",
|
|
54
|
+
].join("\n"),
|
|
55
|
+
};
|
|
31
56
|
},
|
|
32
|
-
|
|
33
|
-
|
|
57
|
+
});
|
|
58
|
+
|
|
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
|
+
// });
|
|
69
|
+
|
|
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
|
+
// );
|
|
34
87
|
}
|
package/package.json
CHANGED
package/.env.local
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
NPM_TOKEN=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
|