@alisio/plugin-subagents 0.1.0-alpha.6 → 0.1.0-alpha.8
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 +75 -18
- package/dist/config.d.ts +1 -0
- package/dist/config.js +5 -0
- package/dist/manager.js +3 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,20 +1,77 @@
|
|
|
1
1
|
# @alisio/plugin-subagents
|
|
2
2
|
|
|
3
|
-
Subagents for [Alisio](https://github.com/GustavoGutierrez/alisio)
|
|
4
|
-
`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
**Subagents for [Alisio](https://github.com/GustavoGutierrez/alisio).** The parent agent delegates
|
|
4
|
+
work with the `task` tool to specialized agents that run in separate child sessions: fresh context,
|
|
5
|
+
narrowed permissions, their own model and limits.
|
|
6
|
+
|
|
7
|
+
## What it is
|
|
8
|
+
|
|
9
|
+
Shipped as a built-in plugin of the `alisio` CLI (disable with `--disable-plugin subagents` or
|
|
10
|
+
`builtinPlugins.subagents.enabled: false`). It is built on the generic `api.sessions` service,
|
|
11
|
+
`api.ui.panel` and `api.ui.select`, so it depends only on `@alisio/sdk` plus `zod` and `yaml`.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Preinstalled in the `alisio` CLI. For an embedded host, register it through `createApplication`'s
|
|
16
|
+
`builtins` list.
|
|
17
|
+
|
|
18
|
+
## Tools
|
|
19
|
+
|
|
20
|
+
| Tool | Input | Behavior |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `task` | `description`, `prompt`, `subagent_type`, optional `model`, `task_id`, `background` | Start an agent (or continue `task_id` with full history) and return its final report; several calls in one turn run in parallel |
|
|
23
|
+
| `task_status` | `task_id` | Status, agent, background flag and tokens; does not wait |
|
|
24
|
+
| `task_wait` | `task_id`, optional `timeout_ms` | Wait for a result, bounded by `waitMaxMs` |
|
|
25
|
+
| `send_message` | `task_id`, `text` | One-way message: queued for a running child's next turn, or resumes a finished child |
|
|
26
|
+
|
|
27
|
+
Results are wrapped in `<task …>` elements; background tasks deliver a `<task-notification>` when
|
|
28
|
+
they finish. Failures are structured tool errors that keep the `task_id`, so a task can be resumed.
|
|
29
|
+
|
|
30
|
+
## Agent definitions
|
|
31
|
+
|
|
32
|
+
Markdown + YAML frontmatter (`name`, `description`, `tools`, `model`, `permission`, `maxTurns`, …)
|
|
33
|
+
discovered from `--agents` (JSON), `.alisio/agents`, `.agents/agents`, `.claude/agents`,
|
|
34
|
+
`.opencode/agent(s)`, user directories and plugin resources. Built-ins: `general` (multi-step
|
|
35
|
+
tasks), `explore` (read-only exploration) and `plan` (read-only implementation plans).
|
|
36
|
+
|
|
37
|
+
## Parallel writes in git
|
|
38
|
+
|
|
39
|
+
With `parallelWrites: "worktree"`, each write-capable child works in its own git worktree
|
|
40
|
+
(`worktreeDir`, default `<state home>/worktrees`); the TUI `/agents` command offers
|
|
41
|
+
`open|cancel|kill|resume` and `merge|discard <id>` for worktrees. `ask`, `serial` and `shared` are
|
|
42
|
+
the other modes.
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
Under `builtinPlugins.subagents`:
|
|
47
|
+
|
|
48
|
+
| Field | Default | Description |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| `maxDepth` | `3` | Maximum nesting (1–8) |
|
|
51
|
+
| `maxConcurrentPerParent` | `4` | Running children per parent (1–32) |
|
|
52
|
+
| `maxConcurrentTotal` | `8` | Running children in total (1–64) |
|
|
53
|
+
| `maxQueued` | `16` | Waiting tasks beyond the concurrency limits (0–256) |
|
|
54
|
+
| `maxTurns` | `50` | Default turn limit per child |
|
|
55
|
+
| `timeoutMs` | `600000` | Timeout per child run |
|
|
56
|
+
| `maxTokensPerChild` | core budget | Per-child cumulative token budget |
|
|
57
|
+
| `maxOutputTokensPerChild` | `16384` | Per-child per-call output token budget |
|
|
58
|
+
| `parallelWrites` | `ask` | `ask`, `worktree`, `serial` or `shared` |
|
|
59
|
+
| `resultMaxBytes` | `50000` | Result size cap |
|
|
60
|
+
| `worktreeDir` | `<state home>/worktrees` | Where worktrees are created |
|
|
61
|
+
|
|
62
|
+
Children never exceed their parent: a read-only parent (or `--read-only`) makes every descendant
|
|
63
|
+
read-only, and approvals bubble up to the TUI labeled with the agent path.
|
|
64
|
+
|
|
65
|
+
## Docs
|
|
66
|
+
|
|
67
|
+
[Subagents](https://gustavogutierrez.github.io/alisio/subagents) ·
|
|
68
|
+
[Configuration](https://gustavogutierrez.github.io/alisio/configuration).
|
|
69
|
+
|
|
70
|
+
## Requirements
|
|
71
|
+
|
|
72
|
+
Node.js **>= 22.16** or Bun **>= 1.4.2**.
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT. Maintained by Gustavo Gutiérrez Mercado. Source: <https://github.com/GustavoGutierrez/alisio> ·
|
|
77
|
+
npm: <https://www.npmjs.com/settings/alisio/packages>.
|
package/dist/config.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const subagentsConfigSchema: z.ZodObject<{
|
|
|
9
9
|
maxTurns: z.ZodDefault<z.ZodNumber>;
|
|
10
10
|
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
11
11
|
maxTokensPerChild: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
maxOutputTokensPerChild: z.ZodDefault<z.ZodNumber>;
|
|
12
13
|
parallelWrites: z.ZodDefault<z.ZodEnum<{
|
|
13
14
|
ask: "ask";
|
|
14
15
|
serial: "serial";
|
package/dist/config.js
CHANGED
|
@@ -18,6 +18,11 @@ export const subagentsConfigSchema = z
|
|
|
18
18
|
timeoutMs: z.number().int().min(1_000).default(600_000),
|
|
19
19
|
/** Per-child cumulative token budget; default follows the core proportional budget. */
|
|
20
20
|
maxTokensPerChild: z.number().int().positive().optional(),
|
|
21
|
+
/**
|
|
22
|
+
* Per-child per-call output token budget. Children forward this (never the global agent-loop
|
|
23
|
+
* default) so reasoning-heavy models are not starved; 4096 would be spent on reasoning alone.
|
|
24
|
+
*/
|
|
25
|
+
maxOutputTokensPerChild: z.number().int().positive().default(16_384),
|
|
21
26
|
/** Parallel write-capable children in a git repository. */
|
|
22
27
|
parallelWrites: z.enum(["ask", "worktree", "serial", "shared"]).default("ask"),
|
|
23
28
|
waitMaxMs: z.number().int().min(100).default(600_000),
|
package/dist/manager.js
CHANGED
|
@@ -284,6 +284,7 @@ export class SubagentManager {
|
|
|
284
284
|
maxTurns: agent.maxTurns ?? this.config.maxTurns,
|
|
285
285
|
timeoutMs: this.config.timeoutMs,
|
|
286
286
|
...(this.config.maxTokensPerChild ? { maxTokens: this.config.maxTokensPerChild } : {}),
|
|
287
|
+
maxOutputTokens: this.config.maxOutputTokensPerChild,
|
|
287
288
|
});
|
|
288
289
|
const task = {
|
|
289
290
|
id: info.id,
|
|
@@ -341,6 +342,8 @@ export class SubagentManager {
|
|
|
341
342
|
task.tokens = Math.max(task.tokens, result.usage.input + result.usage.output);
|
|
342
343
|
if (task.worktree && result.status === "completed")
|
|
343
344
|
await this.summarizeWorktree(task);
|
|
345
|
+
if (result.status === "completed" && result.turnsExceeded)
|
|
346
|
+
task.notes.push("This subagent reached its turn limit; the report above may be incomplete. Ask it to continue or raise its maxTurns in the agent definition.");
|
|
344
347
|
task.result =
|
|
345
348
|
result.status === "completed"
|
|
346
349
|
? this.wrap(task, "completed", result.text || "(no final message)")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alisio/plugin-subagents",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.8",
|
|
4
4
|
"description": "Subagents for Alisio: delegate tasks to specialized agents in separate child sessions with narrowed permissions, parallel execution, git worktree isolation and a live agent tree. Built-in, disableable plugin.",
|
|
5
5
|
"author": "Gustavo Gutiérrez",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"zod": "4.6.5"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@alisio/sdk": "^0.1.0-alpha.
|
|
49
|
+
"@alisio/sdk": "^0.1.0-alpha.7"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@alisio/sdk": "0.1.0-alpha.
|
|
52
|
+
"@alisio/sdk": "0.1.0-alpha.7"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public",
|