better-opencode-async-agents 0.2.0 → 0.4.0
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 +5 -11
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/helpers.d.ts +17 -2
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +671 -52
- package/dist/index.js.map +21 -17
- package/dist/manager/events.d.ts +1 -0
- package/dist/manager/events.d.ts.map +1 -1
- package/dist/manager/index.d.ts +20 -0
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/notifications.d.ts.map +1 -1
- package/dist/manager/polling.d.ts +1 -1
- package/dist/manager/polling.d.ts.map +1 -1
- package/dist/manager/task-lifecycle.d.ts +2 -2
- package/dist/manager/task-lifecycle.d.ts.map +1 -1
- package/dist/prompts.d.ts +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/server/cors.d.ts +22 -0
- package/dist/server/cors.d.ts.map +1 -0
- package/dist/server/index.d.ts +20 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/routes.d.ts +14 -0
- package/dist/server/routes.d.ts.map +1 -0
- package/dist/server/sse.d.ts +44 -0
- package/dist/server/sse.d.ts.map +1 -0
- package/dist/server/types.d.ts +69 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/storage.d.ts +34 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/tools/cancel.d.ts +3 -3
- package/dist/tools/cancel.d.ts.map +1 -1
- package/dist/tools/list.d.ts.map +1 -1
- package/dist/tools/output.d.ts +3 -2
- package/dist/tools/output.d.ts.map +1 -1
- package/dist/tools/task.d.ts +1 -0
- package/dist/tools/task.d.ts.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- 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
|
@@ -4,15 +4,10 @@
|
|
|
4
4
|
[](https://github.com/mainsoft-2024/better-opencode-async-agents/blob/main/LICENSE)
|
|
5
5
|
|
|
6
6
|
An unopinionated,
|
|
7
|
-
|
|
8
7
|
**Async**,
|
|
9
|
-
|
|
10
8
|
Forkable,
|
|
11
|
-
|
|
12
9
|
Resumable,
|
|
13
|
-
|
|
14
10
|
Parallelizable
|
|
15
|
-
|
|
16
11
|
multi-agent plugin for OpenCode.
|
|
17
12
|
|
|
18
13
|
## Configuration
|
|
@@ -47,12 +42,11 @@ This is the subagent/subtask plugin we all know and love, with some key features
|
|
|
47
42
|
|
|
48
43
|
| Tool | Description |
|
|
49
44
|
|------|-------------|
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `superagents_clear` | Abort and clear all tasks |
|
|
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 |
|
|
56
50
|
|
|
57
51
|
## Philosophy
|
|
58
52
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,4 +8,12 @@ export declare const FORK_MAX_TOKENS = 100000;
|
|
|
8
8
|
export declare const FORK_TOOL_RESULT_LIMIT = 1500;
|
|
9
9
|
/** Maximum characters for tool parameters preview in forked context */
|
|
10
10
|
export declare const FORK_TOOL_PARAMS_LIMIT = 200;
|
|
11
|
+
export declare const DEFAULT_API_PORT = 5165;
|
|
12
|
+
export declare const DEFAULT_API_HOST = "127.0.0.1";
|
|
13
|
+
export declare const SERVER_INFO_FILENAME = "server.json";
|
|
14
|
+
export declare const MAX_PORT_RETRY = 10;
|
|
15
|
+
export declare const HEARTBEAT_INTERVAL_MS = 30000;
|
|
16
|
+
export declare const MAX_SSE_SUBSCRIBERS = 50;
|
|
17
|
+
export declare const DEFAULT_TASK_LIMIT = 50;
|
|
18
|
+
export declare const MAX_TASK_LIMIT = 200;
|
|
11
19
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AACjD,eAAO,MAAM,cAAc,UAAqD,CAAC;AAoCjF,eAAO,MAAM,WAAW,QAA+D,CAAC;AACxF,eAAO,MAAM,UAAU,QAA8B,CAAC;AAMtD,6EAA6E;AAC7E,eAAO,MAAM,eAAe,SAAS,CAAC;AAEtC,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AACjD,eAAO,MAAM,cAAc,UAAqD,CAAC;AAoCjF,eAAO,MAAM,WAAW,QAA+D,CAAC;AACxF,eAAO,MAAM,UAAU,QAA8B,CAAC;AAMtD,6EAA6E;AAC7E,eAAO,MAAM,eAAe,SAAS,CAAC;AAEtC,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAM1C,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAC5C,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAC5C,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,cAAc,MAAM,CAAC"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -5,16 +5,31 @@ import type { BackgroundTask, BackgroundTaskStatus } from "./types";
|
|
|
5
5
|
* - Sets task.completedAt for terminal statuses
|
|
6
6
|
* - Optionally sets task.error
|
|
7
7
|
* - Auto-persists if persistFn is provided
|
|
8
|
+
* - Emits events if emitFn is provided
|
|
8
9
|
*/
|
|
9
10
|
export declare function setTaskStatus(task: BackgroundTask, status: BackgroundTaskStatus, options?: {
|
|
10
11
|
error?: string;
|
|
11
12
|
persistFn?: (task: BackgroundTask) => void;
|
|
13
|
+
emitFn?: (eventType: "task.completed" | "task.error" | "task.cancelled", task: BackgroundTask) => void;
|
|
12
14
|
}): void;
|
|
13
15
|
/**
|
|
14
|
-
* Converts a full session ID to a short display ID
|
|
16
|
+
* Converts a full session ID to a short display ID.
|
|
17
|
+
* Simple version — no collision awareness. Use for cases where
|
|
18
|
+
* you don't have access to the sibling task list.
|
|
19
|
+
*
|
|
15
20
|
* Example: ses_41e080918ffeyhQtX6E4vERe4O → ses_41e08091
|
|
16
21
|
*/
|
|
17
|
-
export declare function shortId(sessionId: string): string;
|
|
22
|
+
export declare function shortId(sessionId: string, minLen?: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Converts a full session ID to a collision-free short display ID.
|
|
25
|
+
* Git-style: starts at minLen chars, extends until unique among siblings.
|
|
26
|
+
*
|
|
27
|
+
* @param sessionId - Full session ID (e.g., "ses_41e080918ffeyhQtX6E4vERe4O")
|
|
28
|
+
* @param siblingIds - Array of OTHER full session IDs to avoid collision with
|
|
29
|
+
* @param minLen - Minimum suffix length (default 8)
|
|
30
|
+
* @returns Short ID guaranteed unique among siblings
|
|
31
|
+
*/
|
|
32
|
+
export declare function uniqueShortId(sessionId: string, siblingIds: string[], minLen?: number): string;
|
|
18
33
|
export declare function formatDuration(startStr: string, endStr?: string): string;
|
|
19
34
|
export declare function truncateText(text: string, maxLength: number): string;
|
|
20
35
|
export declare function getStatusIcon(status: BackgroundTaskStatus): string;
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAMpE
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAMpE;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,MAAM,CAAC,EAAE,CACP,SAAS,EAAE,gBAAgB,GAAG,YAAY,GAAG,gBAAgB,EAC7D,IAAI,EAAE,cAAc,KACjB,IAAI,CAAC;CACX,GACA,IAAI,CA2BN;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,MAAM,CAO7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,MAAM,SAAI,GAAG,MAAM,CAkBzF;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAexE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAalE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CA8B7D;AAGD,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,GACzD,OAAO,CAAC,MAAM,CAAC,CA8CjB"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAY9D,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI/F;;;;;GAKG;AACH,wBAA8B,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CA0BrE"}
|