better-opencode-async-agents 0.1.1 → 0.2.1
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/CHANGELOG.md +6 -0
- package/README.md +41 -24
- package/dist/index.js +20 -20
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,12 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
11
11
|
- **Tool call parameter preview**: Forked context now shows tool parameters (up to 200 chars) instead of just tool names
|
|
12
12
|
|
|
13
13
|
### Breaking Changes
|
|
14
|
+
- **BREAKING** Renamed all tools from `superagents_*` to `asyncagents_*`:
|
|
15
|
+
- `superagents_task` → `asyncagents_task`
|
|
16
|
+
- `superagents_output` → `asyncagents_output`
|
|
17
|
+
- `superagents_cancel` → `asyncagents_cancel`
|
|
18
|
+
- `superagents_list` → `asyncagents_list`
|
|
19
|
+
- `superagents_clear` → `asyncagents_clear`
|
|
14
20
|
- **BREAKING** Renamed all tools from `background_*` to `superagents_*`:
|
|
15
21
|
- `background_task` → `superagents_task`
|
|
16
22
|
- `background_output` → `superagents_output`
|
package/README.md
CHANGED
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/better-opencode-async-agents)
|
|
4
4
|
[](https://github.com/mainsoft-2024/better-opencode-async-agents/blob/main/LICENSE)
|
|
5
5
|
|
|
6
|
-
An unopinionated,
|
|
6
|
+
An unopinionated,
|
|
7
|
+
**Async**,
|
|
8
|
+
Forkable,
|
|
9
|
+
Resumable,
|
|
10
|
+
Parallelizable
|
|
11
|
+
multi-agent plugin for OpenCode.
|
|
7
12
|
|
|
8
13
|
## Configuration
|
|
9
14
|
|
|
@@ -15,24 +20,44 @@ Add the plugin to your `opencode.json(c)`:
|
|
|
15
20
|
}
|
|
16
21
|
```
|
|
17
22
|
|
|
18
|
-
##
|
|
23
|
+
## Overview
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- **
|
|
23
|
-
|
|
24
|
-
- **
|
|
25
|
-
|
|
26
|
-
- **
|
|
25
|
+
This is the subagent/subtask plugin we all know and love, with some key features that support advanced agent control:
|
|
26
|
+
|
|
27
|
+
- **Async & Batch Task Execution**: Run multiple agent tasks in parallel without blocking the main conversation. Launch tasks individually or in batches and continue working while they execute.
|
|
28
|
+
|
|
29
|
+
- **Real-time Progress Tracking**: Live updates with spinner animations and tool call counts. See exactly what each agent is doing as it works.
|
|
30
|
+
|
|
31
|
+
- **Resumable & Cancellable**: Resume completed tasks with follow-up messages for multi-turn conversations. Cancel running tasks at any time.
|
|
32
|
+
|
|
33
|
+
- **Context Forking Support**: Fork the current conversation context to spawn new agent sessions that inherit the parent's context.
|
|
34
|
+
|
|
35
|
+
- **Automatic Context Truncation**: When forking, context is intelligently truncated to fit within token limits while preserving the most relevant information.
|
|
36
|
+
|
|
37
|
+
- **Dynamic Agent Response Collection**: Collect responses from agents in blocking or non-blocking modes. Wait for all tasks to complete or check progress incrementally.
|
|
38
|
+
|
|
39
|
+
- **Variable Timeouts**: Configure custom timeouts per task. Some tasks need seconds, others need minutes - you decide.
|
|
27
40
|
|
|
28
41
|
## Tools Provided
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
| Tool | Description |
|
|
44
|
+
|------|-------------|
|
|
45
|
+
| `asyncagents_task` | Launch async background agent tasks with description, prompt, and agent type |
|
|
46
|
+
| `asyncagents_output` | Get task results (blocking or non-blocking) with configurable timeout |
|
|
47
|
+
| `asyncagents_cancel` | Cancel a running task |
|
|
48
|
+
| `asyncagents_list` | List all tasks with optional status filter |
|
|
49
|
+
| `asyncagents_clear` | Abort and clear all tasks |
|
|
50
|
+
|
|
51
|
+
## Philosophy
|
|
52
|
+
|
|
53
|
+
This is an unopinionated tool. It provides the primitives for async multi-agent orchestration without imposing a specific workflow. You decide:
|
|
54
|
+
|
|
55
|
+
- When to block vs. fire-and-forget
|
|
56
|
+
- How to structure your agent hierarchy
|
|
57
|
+
- What context to fork and when
|
|
58
|
+
- How long to wait for results
|
|
59
|
+
|
|
60
|
+
Build your own patterns on top of these building blocks.
|
|
36
61
|
|
|
37
62
|
## Development
|
|
38
63
|
|
|
@@ -46,14 +71,8 @@ bun run build
|
|
|
46
71
|
# Run tests
|
|
47
72
|
bun test
|
|
48
73
|
|
|
49
|
-
# Run linter
|
|
50
|
-
bun run lint
|
|
51
|
-
|
|
52
74
|
# Type check
|
|
53
75
|
bun run typecheck
|
|
54
|
-
|
|
55
|
-
# Format code
|
|
56
|
-
bun run format
|
|
57
76
|
```
|
|
58
77
|
|
|
59
78
|
## License
|
|
@@ -62,6 +81,4 @@ MIT
|
|
|
62
81
|
|
|
63
82
|
---
|
|
64
83
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
For issues, questions, or contributions, please visit the [GitHub repository](https://github.com/mainsoft-2024/better-opencode-async-agents).
|
|
84
|
+
For issues, questions, or contributions, visit the [GitHub repository](https://github.com/mainsoft-2024/better-opencode-async-agents).
|
package/dist/index.js
CHANGED
|
@@ -635,8 +635,8 @@ Arguments:
|
|
|
635
635
|
|
|
636
636
|
IMPORTANT: You'll be informed when each task is complete. DO NOT assume all tasks were done, check again if all agents you need are complete.
|
|
637
637
|
|
|
638
|
-
Returns immediately with task ID. The task will run in background and notify you when complete.
|
|
639
|
-
Optionally use \`
|
|
638
|
+
Returns immediately with task ID. The task will run in background and notify you when complete.
|
|
639
|
+
Optionally use \`asyncagents_output\` later if you need to check results manually with or without blocking.`,
|
|
640
640
|
backgroundList: `List all background tasks.
|
|
641
641
|
|
|
642
642
|
Shows all running, completed, error, and cancelled background tasks with their status.
|
|
@@ -696,10 +696,10 @@ ${textContent || "(No text response)"}`,
|
|
|
696
696
|
};
|
|
697
697
|
var ERROR_MESSAGES = {
|
|
698
698
|
taskNotFound: (taskId) => `Task not found: ${taskId}`,
|
|
699
|
-
taskNotFoundWithHint: (taskId) => `Task not found: ${taskId}. Use
|
|
699
|
+
taskNotFoundWithHint: (taskId) => `Task not found: ${taskId}. Use asyncagents_list to see available tasks.`,
|
|
700
700
|
taskCurrentlyResuming: "Task is currently being resumed. Wait for completion.",
|
|
701
701
|
onlyCompletedCanResume: (currentStatus) => `Only completed tasks can be resumed. Current status: ${currentStatus}`,
|
|
702
|
-
sessionExpired: "Session expired or was deleted. Start a new
|
|
702
|
+
sessionExpired: "Session expired or was deleted. Start a new asyncagents_task to continue.",
|
|
703
703
|
agentRequired: "Agent parameter is required. Specify which agent to use.",
|
|
704
704
|
promptRequired: "Prompt is required when resuming a task",
|
|
705
705
|
launchFailed: (message) => `Failed to launch background task: ${message}`,
|
|
@@ -732,14 +732,14 @@ var NOTIFICATION_MESSAGES = {
|
|
|
732
732
|
devHintIndicator: "[hint attached]"
|
|
733
733
|
};
|
|
734
734
|
var SYSTEM_HINT_MESSAGES = {
|
|
735
|
-
runningTasksHint: (taskId) => `If you need results immediately, use
|
|
735
|
+
runningTasksHint: (taskId) => `If you need results immediately, use asyncagents_output(task_id="${taskId}").
|
|
736
736
|
You can continue working or just say 'waiting' and halt.
|
|
737
737
|
WATCH OUT for leftovers, you will likely WANT to wait for all agents to complete.`,
|
|
738
738
|
allTasksDoneHint: (totalCount) => `All ${totalCount} tasks finished.
|
|
739
|
-
Use
|
|
739
|
+
Use asyncagents_output tools to see agent responses.`,
|
|
740
740
|
errorHint: (taskId, errorMessage) => `Task failed: ${errorMessage}
|
|
741
|
-
Use
|
|
742
|
-
resumeHint: (taskId) => `Use
|
|
741
|
+
Use asyncagents_output(task_id="${taskId}") for details.`,
|
|
742
|
+
resumeHint: (taskId) => `Use asyncagents_output(task_id="${taskId}") for full response.`
|
|
743
743
|
};
|
|
744
744
|
var TOAST_TITLES = {
|
|
745
745
|
taskCompleted: "✓ Task completed",
|
|
@@ -747,7 +747,7 @@ var TOAST_TITLES = {
|
|
|
747
747
|
taskCancelled: "⊘ Task cancelled",
|
|
748
748
|
backgroundTasksRunning: (spinner) => {
|
|
749
749
|
const prefix = process.env.OPENCODE_BGAGENT_PREFIX;
|
|
750
|
-
const baseText = "
|
|
750
|
+
const baseText = "AsyncAgents";
|
|
751
751
|
return prefix ? `⛭ ${prefix} ${baseText}` : `⛭ ${baseText}`;
|
|
752
752
|
},
|
|
753
753
|
tasksComplete: "✓ Tasks complete"
|
|
@@ -1523,11 +1523,11 @@ ${contextText}`;
|
|
|
1523
1523
|
body: {
|
|
1524
1524
|
agent: input.agent,
|
|
1525
1525
|
tools: {
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1526
|
+
asyncagents_task: false,
|
|
1527
|
+
asyncagents_output: false,
|
|
1528
|
+
asyncagents_cancel: false,
|
|
1529
|
+
asyncagents_list: false,
|
|
1530
|
+
asyncagents_clear: false
|
|
1531
1531
|
},
|
|
1532
1532
|
parts: [{ type: "text", text: input.prompt }]
|
|
1533
1533
|
}
|
|
@@ -14522,11 +14522,11 @@ async function plugin(ctx) {
|
|
|
14522
14522
|
const manager = new BackgroundManager(ctx);
|
|
14523
14523
|
return {
|
|
14524
14524
|
tool: {
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14525
|
+
asyncagents_task: createBackgroundTask(manager),
|
|
14526
|
+
asyncagents_output: createBackgroundOutput(manager),
|
|
14527
|
+
asyncagents_cancel: createBackgroundCancel(manager),
|
|
14528
|
+
asyncagents_list: createBackgroundList(manager),
|
|
14529
|
+
asyncagents_clear: createBackgroundClear(manager)
|
|
14530
14530
|
},
|
|
14531
14531
|
event: async () => {}
|
|
14532
14532
|
};
|
|
@@ -14535,5 +14535,5 @@ export {
|
|
|
14535
14535
|
plugin as default
|
|
14536
14536
|
};
|
|
14537
14537
|
|
|
14538
|
-
//# debugId=
|
|
14538
|
+
//# debugId=E81274522F3E3FAA64756E2164756E21
|
|
14539
14539
|
//# sourceMappingURL=index.js.map
|