@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 CHANGED
@@ -1,20 +1,77 @@
1
1
  # @alisio/plugin-subagents
2
2
 
3
- Subagents for [Alisio](https://github.com/GustavoGutierrez/alisio), shipped as a built-in plugin of the
4
- `alisio` CLI (disable with `--disable-plugin subagents`). The parent agent delegates work with the
5
- `task` tool to specialized agents that run in separate child sessions: fresh context, narrowed
6
- permissions, their own model and limits. It depends only on `@alisio/sdk` (generic
7
- `api.sessions`, `api.ui.panel`, `api.ui.select`) plus `zod` and `yaml`.
8
-
9
- - Agent definitions: Markdown + YAML frontmatter (`name`, `description`, `tools`, `model`,
10
- `permission`, `maxTurns`, …) from `--agents`, `.alisio/agents`, `.agents/agents`, `.claude/agents`,
11
- `.opencode/agent(s)`, user directories and plugins; built-ins `general`, `explore`, `plan`.
12
- - Tools: `task`, `task_status`, `task_wait`, `send_message`; parallel and background tasks, bounded
13
- waits, `<task …>` results, `<task-notification>` on background completion.
14
- - Limits: depth, concurrency per parent and total, bounded queue, turns, timeout and token budget.
15
- - Parallel writes in git: worktree per subagent (merge/discard with `/agents`), serial or shared.
16
- - A live agent tree in the TUI with keyboard navigation and read-only child views.
17
-
18
- Docs: [Subagents](https://gustavogutierrez.github.io/alisio/subagents).
19
-
20
- Maintainer: Gustavo Gutiérrez · License: MIT
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.6",
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.5"
49
+ "@alisio/sdk": "^0.1.0-alpha.7"
50
50
  },
51
51
  "devDependencies": {
52
- "@alisio/sdk": "0.1.0-alpha.5"
52
+ "@alisio/sdk": "0.1.0-alpha.7"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public",