subagent-cli 0.1.5__tar.gz → 0.1.7__tar.gz

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.
Files changed (51) hide show
  1. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/PKG-INFO +36 -65
  2. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/README.ja.md +35 -64
  3. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/README.md +35 -64
  4. subagent_cli-0.1.7/config.example.yaml +97 -0
  5. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/docs/ARCHITECTURE.md +3 -3
  6. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/docs/examples/checkpoint.json +1 -2
  7. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/docs/examples/normalized-event.ndjson +1 -1
  8. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/docs/examples/worker-continue-flow.md +4 -4
  9. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/pyproject.toml +1 -1
  10. subagent_cli-0.1.7/skills/subagent-manager/SKILL.md +140 -0
  11. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/__init__.py +1 -1
  12. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/approval_utils.py +39 -2
  13. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/cli.py +250 -167
  14. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/config.py +89 -83
  15. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/handoff_service.py +13 -18
  16. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/paths.py +1 -1
  17. subagent_cli-0.1.7/src/subagent/prompt_service.py +81 -0
  18. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/runtime_service.py +94 -29
  19. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/state.py +61 -20
  20. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/turn_service.py +140 -38
  21. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/worker_runtime.py +65 -44
  22. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/worker_service.py +64 -58
  23. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_acp_backend_integration.py +70 -30
  24. subagent_cli-0.1.7/tests/test_cli_commands.py +582 -0
  25. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_daemon.py +7 -10
  26. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_handoff_commands.py +13 -20
  27. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_prompt_and_contracts.py +29 -34
  28. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_turn_commands.py +271 -53
  29. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_worker_lifecycle.py +7 -15
  30. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/uv.lock +1 -1
  31. subagent_cli-0.1.5/config.example.yaml +0 -104
  32. subagent_cli-0.1.5/src/subagent/prompt_service.py +0 -121
  33. subagent_cli-0.1.5/tests/test_cli_commands.py +0 -317
  34. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/.github/workflows/publish-pypi.yml +0 -0
  35. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/.gitignore +0 -0
  36. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/.python-version +0 -0
  37. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/CONTRIBUTING.md +0 -0
  38. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/LICENSE +0 -0
  39. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/docs/examples/handoff.md +0 -0
  40. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/acp_client.py +0 -0
  41. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/constants.py +0 -0
  42. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/controller_service.py +0 -0
  43. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/daemon.py +0 -0
  44. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/errors.py +0 -0
  45. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/hints.py +0 -0
  46. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/input_contract.py +0 -0
  47. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/launcher_service.py +0 -0
  48. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/output.py +0 -0
  49. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/src/subagent/simple_yaml.py +0 -0
  50. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/fixtures/fake_acp_agent.py +0 -0
  51. {subagent_cli-0.1.5 → subagent_cli-0.1.7}/tests/test_paths.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: subagent-cli
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Protocol-agnostic worker orchestration CLI
5
5
  Author: niitsuma-t
6
6
  License: MIT License
@@ -101,6 +101,10 @@ From local artifacts:
101
101
  pip install dist/subagent_cli-*.whl
102
102
  ```
103
103
 
104
+ ## Terminal Demo 🎬
105
+ Recorded asciinema session:
106
+ - [![asciicast](https://asciinema.org/a/Cxfk7i9wOOpZB17F.svg)](https://asciinema.org/a/Cxfk7i9wOOpZB17F)
107
+
104
108
  ## Quick Start ⚡
105
109
  1. Bootstrap your local config.
106
110
  ```bash
@@ -114,61 +118,19 @@ subagent config init --scope user
114
118
  subagent controller init --cwd .
115
119
  ```
116
120
 
117
- 4. Hand off from here to your manager agent (Codex / Claude Code).
118
- Ask the manager agent to run `subagent prompt render --target manager` as its first step.
119
- Use this instruction template:
120
-
121
- ```text
122
- Act as the manager and product lead for this repository.
123
-
124
- Use subagent-cli as the control plane and progress this task by coordinating a small team of worker agents rather than acting as a solo implementer.
125
-
126
- Your role:
127
-
128
- * Define the objective, user value, constraints, scope, and success criteria.
129
- * Break the work into small chunks with clear owners.
130
- * Assign worker roles intentionally.
131
- * Coordinate handoffs, reviews, and validation.
132
- * Review worker proposals critically and give actionable feedback.
133
- * Make explicit decisions on whether to proceed, revise, compare options, or reject.
134
-
135
- Default behavior:
136
-
137
- * Delegate by default when useful.
138
- * Prefer small, verifiable increments.
139
- * Prevent over-engineering and keep the team focused on the smallest valuable outcome.
140
- * Do not accept worker output blindly; evaluate it for product fit, feasibility, scope, risk, and validation quality.
141
-
142
- Before execution:
143
-
144
- 1. Run `subagent prompt render --target manager` and follow that output.
145
- 2. Check command help before execution (`subagent worker --help`, `subagent send --help`, `subagent approve --help`).
146
- 3. State:
147
- * your role
148
- * planned worker roles
149
- * task breakdown
150
- * success criteria
151
- * validation plan
152
-
153
- During execution:
154
-
155
- 4. Start and coordinate workers with subagent-cli.
156
- 5. Use `send` as the default turn driver (`send` waits by default).
157
- 6. If `matchedEvent.type` is `approval.requested`, run `approve` and continue with `send`.
158
- 7. Use `watch` only when detailed event streaming or debugging is needed.
159
- 8. Use handoff/continue when context gets large.
160
- 9. Require workers to report: goal, findings, proposal, risks, validation, next step.
161
- 10. Respond to worker proposals with: decision, reason, what is good, what is missing, what should change, and next action.
162
-
163
- Before reporting completion:
121
+ 4. Install the recommended manager skill (after this repository is pushed to GitHub).
122
+ ```bash
123
+ npx skills add "github/otakumesi/subagent-cli"
124
+ ```
164
125
 
165
- 11. Verify results with tests or checks.
166
- 12. Confirm the final output is integrated, validated, and aligned with the task objective.
126
+ 5. Hand off from here to your manager agent (Codex / Claude Code).
127
+ Use an instruction like this:
167
128
 
168
- If worker startup or turn operations fail due to sandbox limits, request approval for out-of-sandbox execution and retry.
129
+ ```text
130
+ <what to do that you want>
169
131
 
170
- Task to execute:
171
- <your task here>
132
+ Use subagent commands to delegate tasks to a team of agents and coordinate their progress.
133
+ Use the "subagent-manager" skill.
172
134
  ```
173
135
 
174
136
  After handoff, the manager agent's standard lifecycle is:
@@ -176,28 +138,37 @@ After handoff, the manager agent's standard lifecycle is:
176
138
 
177
139
  For a single command that sends and waits for terminal-or-approval events:
178
140
  ```bash
179
- subagent send --worker <worker-id> --text "<instruction>" --json
141
+ subagent send --worker-id <worker-id> --text "<instruction>" --json
180
142
  ```
181
143
 
182
144
  Opt out of waiting when needed:
183
145
  ```bash
184
- subagent send --worker <worker-id> --text "<instruction>" --no-wait --json
146
+ subagent send --worker-id <worker-id> --text "<instruction>" --no-wait --json
185
147
  ```
186
148
 
187
- For shell-safe input (recommended when text includes backticks, `$()`, redirects, etc.):
149
+ For multiline or shell-safe input (recommended):
188
150
  ```bash
189
- subagent send --input - --json <<'JSON'
190
- {
191
- "workerId": "<worker-id>",
192
- "text": "Use commands like `echo hello` literally; do not execute them."
193
- }
194
- JSON
151
+ cat > instruction.txt <<'TEXT'
152
+ Use commands like `echo hello` literally; do not execute them.
153
+ TEXT
154
+ subagent send --worker-id <worker-id> --text-file ./instruction.txt --json
195
155
  ```
196
- `workerId` is required in JSON input payloads.
156
+
157
+ stdin variant:
158
+ ```bash
159
+ cat ./instruction.txt | subagent send --worker-id <worker-id> --text-stdin --json
160
+ ```
161
+
162
+ Advanced automation can still use structured JSON input via `--input` (JSON key: `workerId`; CLI flag: `--worker-id`).
197
163
 
198
164
  Manual wait mode (advanced cursor control) still exists:
199
165
  ```bash
200
- subagent wait --worker <worker-id> --until turn_end --timeout-seconds 60 --json
166
+ subagent wait --worker-id <worker-id> --until turn_end --timeout-seconds 60 --json
167
+ ```
168
+
169
+ To include historical events in matching:
170
+ ```bash
171
+ subagent wait --worker-id <worker-id> --include-history --until turn_end --timeout-seconds 60 --json
201
172
  ```
202
173
 
203
174
  For local simulation/testing without a real ACP launcher:
@@ -213,7 +184,7 @@ subagent worker start --cwd . --debug-mode
213
184
  ```bash
214
185
  subagent launcher probe <launcher-name> --json
215
186
  ```
216
- - If `worker start` fails with `BACKEND_UNAVAILABLE`, inspect runtime logs under `<workspace>/.subagent/state/runtimes/` (default) or `$SUBAGENT_STATE_DIR/runtimes/` (when overridden).
187
+ - If `worker start` fails with a backend error (for example `BACKEND_TIMEOUT`, `BACKEND_SOCKET_UNREACHABLE`, `BACKEND_LAUNCHER`), inspect runtime logs under `<workspace>/.subagent/state/runtimes/` (default) or `$SUBAGENT_STATE_DIR/runtimes/` (when overridden).
217
188
  - For cut-down local testing without backend connectivity:
218
189
  ```bash
219
190
  subagent worker start --cwd . --debug-mode
@@ -58,6 +58,10 @@ pip install subagent-cli
58
58
  pip install dist/subagent_cli-*.whl
59
59
  ```
60
60
 
61
+ ## ターミナルデモ 🎬
62
+ 録画した asciinema セッション:
63
+ - [![asciicast](https://asciinema.org/a/Cxfk7i9wOOpZB17F.svg)](https://asciinema.org/a/Cxfk7i9wOOpZB17F)
64
+
61
65
  ## クイックスタート ⚡
62
66
  1. ローカル設定ファイルを初期化します。
63
67
  ```bash
@@ -71,61 +75,19 @@ subagent config init --scope user
71
75
  subagent controller init --cwd .
72
76
  ```
73
77
 
74
- 4. ここからマネージャーエージェント(Codex / Claude Code)へ handoff します。
75
- マネージャー側の最初の手順として `subagent prompt render --target manager` を実行させてください。
76
- 以下のテンプレートを使えます:
77
-
78
- ```text
79
- Act as the manager and product lead for this repository.
80
-
81
- Use subagent-cli as the control plane and progress this task by coordinating a small team of worker agents rather than acting as a solo implementer.
82
-
83
- Your role:
84
-
85
- * Define the objective, user value, constraints, scope, and success criteria.
86
- * Break the work into small chunks with clear owners.
87
- * Assign worker roles intentionally.
88
- * Coordinate handoffs, reviews, and validation.
89
- * Review worker proposals critically and give actionable feedback.
90
- * Make explicit decisions on whether to proceed, revise, compare options, or reject.
91
-
92
- Default behavior:
93
-
94
- * Delegate by default when useful.
95
- * Prefer small, verifiable increments.
96
- * Prevent over-engineering and keep the team focused on the smallest valuable outcome.
97
- * Do not accept worker output blindly; evaluate it for product fit, feasibility, scope, risk, and validation quality.
98
-
99
- Before execution:
100
-
101
- 1. Run `subagent prompt render --target manager` and follow that output.
102
- 2. Check command help before execution (`subagent worker --help`, `subagent send --help`, `subagent approve --help`).
103
- 3. State:
104
- * your role
105
- * planned worker roles
106
- * task breakdown
107
- * success criteria
108
- * validation plan
109
-
110
- During execution:
111
-
112
- 4. Start and coordinate workers with subagent-cli.
113
- 5. Use `send` as the default turn driver (`send` waits by default).
114
- 6. If `matchedEvent.type` is `approval.requested`, run `approve` and continue with `send`.
115
- 7. Use `watch` only when detailed event streaming or debugging is needed.
116
- 8. Use handoff/continue when context gets large.
117
- 9. Require workers to report: goal, findings, proposal, risks, validation, next step.
118
- 10. Respond to worker proposals with: decision, reason, what is good, what is missing, what should change, and next action.
119
-
120
- Before reporting completion:
78
+ 4. (このリポジトリを GitHub push 後)推奨の manager スキルをインストールします。
79
+ ```bash
80
+ npx skills add "github/otakumesi/subagent-cli"
81
+ ```
121
82
 
122
- 11. Verify results with tests or checks.
123
- 12. Confirm the final output is integrated, validated, and aligned with the task objective.
83
+ 5. ここからマネージャーエージェント(Codex / Claude Code)へ handoff します。
84
+ 以下のような指示文を使えます:
124
85
 
125
- If worker startup or turn operations fail due to sandbox limits, request approval for out-of-sandbox execution and retry.
86
+ ```text
87
+ <what to do that you want>
126
88
 
127
- Task to execute:
128
- <your task here>
89
+ Use subagent commands to delegate tasks to a team of agents and coordinate their progress.
90
+ Use the "subagent-manager" skill.
129
91
  ```
130
92
 
131
93
  handoff 後のマネージャーエージェント標準ライフサイクル:
@@ -133,28 +95,37 @@ handoff 後のマネージャーエージェント標準ライフサイクル:
133
95
 
134
96
  単発で送信して、終了イベントまたは承認要求まで待機する例:
135
97
  ```bash
136
- subagent send --worker <worker-id> --text "<instruction>" --json
98
+ subagent send --worker-id <worker-id> --text "<instruction>" --json
137
99
  ```
138
100
 
139
101
  待機を無効化する例:
140
102
  ```bash
141
- subagent send --worker <worker-id> --text "<instruction>" --no-wait --json
103
+ subagent send --worker-id <worker-id> --text "<instruction>" --no-wait --json
142
104
  ```
143
105
 
144
- シェル解釈事故を避ける安全な入力方法(`--input` 推奨):
106
+ 複数行やシェル解釈事故を避ける安全な入力方法(推奨):
145
107
  ```bash
146
- subagent send --input - --json <<'JSON'
147
- {
148
- "workerId": "<worker-id>",
149
- "text": "`echo hello` $(uname) を文字列として扱い、実行しないこと。"
150
- }
151
- JSON
108
+ cat > instruction.txt <<'TEXT'
109
+ `echo hello` や $(uname) を文字列として扱い、実行しないこと。
110
+ TEXT
111
+ subagent send --worker-id <worker-id> --text-file ./instruction.txt --json
152
112
  ```
153
- JSON 入力では `workerId` が必須です。
113
+
114
+ stdin 版:
115
+ ```bash
116
+ cat ./instruction.txt | subagent send --worker-id <worker-id> --text-stdin --json
117
+ ```
118
+
119
+ 高度な自動化では、構造化 JSON 入力 `--input` も使えます(JSON キーは `workerId`、CLI フラグは `--worker-id`)。
154
120
 
155
121
  手動待機モード(高度なカーソル制御):
156
122
  ```bash
157
- subagent wait --worker <worker-id> --until turn_end --timeout-seconds 60 --json
123
+ subagent wait --worker-id <worker-id> --until turn_end --timeout-seconds 60 --json
124
+ ```
125
+
126
+ 履歴イベントも対象に含める場合:
127
+ ```bash
128
+ subagent wait --worker-id <worker-id> --include-history --until turn_end --timeout-seconds 60 --json
158
129
  ```
159
130
 
160
131
  実 launcher なしでローカルシミュレーションする場合:
@@ -170,7 +141,7 @@ subagent worker start --cwd . --debug-mode
170
141
  ```bash
171
142
  subagent launcher probe <launcher-name> --json
172
143
  ```
173
- - `worker start` `BACKEND_UNAVAILABLE` で失敗する場合は、`<workspace>/.subagent/state/runtimes/`(既定)または `$SUBAGENT_STATE_DIR/runtimes/`(上書き時)のログを確認してください。
144
+ - `worker start` がバックエンド系エラー(例: `BACKEND_TIMEOUT` / `BACKEND_SOCKET_UNREACHABLE` / `BACKEND_LAUNCHER`)で失敗する場合は、`<workspace>/.subagent/state/runtimes/`(既定)または `$SUBAGENT_STATE_DIR/runtimes/`(上書き時)のログを確認してください。
174
145
  - バックエンド接続なしの簡易テスト:
175
146
  ```bash
176
147
  subagent worker start --cwd . --debug-mode
@@ -58,6 +58,10 @@ From local artifacts:
58
58
  pip install dist/subagent_cli-*.whl
59
59
  ```
60
60
 
61
+ ## Terminal Demo 🎬
62
+ Recorded asciinema session:
63
+ - [![asciicast](https://asciinema.org/a/Cxfk7i9wOOpZB17F.svg)](https://asciinema.org/a/Cxfk7i9wOOpZB17F)
64
+
61
65
  ## Quick Start ⚡
62
66
  1. Bootstrap your local config.
63
67
  ```bash
@@ -71,61 +75,19 @@ subagent config init --scope user
71
75
  subagent controller init --cwd .
72
76
  ```
73
77
 
74
- 4. Hand off from here to your manager agent (Codex / Claude Code).
75
- Ask the manager agent to run `subagent prompt render --target manager` as its first step.
76
- Use this instruction template:
77
-
78
- ```text
79
- Act as the manager and product lead for this repository.
80
-
81
- Use subagent-cli as the control plane and progress this task by coordinating a small team of worker agents rather than acting as a solo implementer.
82
-
83
- Your role:
84
-
85
- * Define the objective, user value, constraints, scope, and success criteria.
86
- * Break the work into small chunks with clear owners.
87
- * Assign worker roles intentionally.
88
- * Coordinate handoffs, reviews, and validation.
89
- * Review worker proposals critically and give actionable feedback.
90
- * Make explicit decisions on whether to proceed, revise, compare options, or reject.
91
-
92
- Default behavior:
93
-
94
- * Delegate by default when useful.
95
- * Prefer small, verifiable increments.
96
- * Prevent over-engineering and keep the team focused on the smallest valuable outcome.
97
- * Do not accept worker output blindly; evaluate it for product fit, feasibility, scope, risk, and validation quality.
98
-
99
- Before execution:
100
-
101
- 1. Run `subagent prompt render --target manager` and follow that output.
102
- 2. Check command help before execution (`subagent worker --help`, `subagent send --help`, `subagent approve --help`).
103
- 3. State:
104
- * your role
105
- * planned worker roles
106
- * task breakdown
107
- * success criteria
108
- * validation plan
109
-
110
- During execution:
111
-
112
- 4. Start and coordinate workers with subagent-cli.
113
- 5. Use `send` as the default turn driver (`send` waits by default).
114
- 6. If `matchedEvent.type` is `approval.requested`, run `approve` and continue with `send`.
115
- 7. Use `watch` only when detailed event streaming or debugging is needed.
116
- 8. Use handoff/continue when context gets large.
117
- 9. Require workers to report: goal, findings, proposal, risks, validation, next step.
118
- 10. Respond to worker proposals with: decision, reason, what is good, what is missing, what should change, and next action.
119
-
120
- Before reporting completion:
78
+ 4. Install the recommended manager skill (after this repository is pushed to GitHub).
79
+ ```bash
80
+ npx skills add "github/otakumesi/subagent-cli"
81
+ ```
121
82
 
122
- 11. Verify results with tests or checks.
123
- 12. Confirm the final output is integrated, validated, and aligned with the task objective.
83
+ 5. Hand off from here to your manager agent (Codex / Claude Code).
84
+ Use an instruction like this:
124
85
 
125
- If worker startup or turn operations fail due to sandbox limits, request approval for out-of-sandbox execution and retry.
86
+ ```text
87
+ <what to do that you want>
126
88
 
127
- Task to execute:
128
- <your task here>
89
+ Use subagent commands to delegate tasks to a team of agents and coordinate their progress.
90
+ Use the "subagent-manager" skill.
129
91
  ```
130
92
 
131
93
  After handoff, the manager agent's standard lifecycle is:
@@ -133,28 +95,37 @@ After handoff, the manager agent's standard lifecycle is:
133
95
 
134
96
  For a single command that sends and waits for terminal-or-approval events:
135
97
  ```bash
136
- subagent send --worker <worker-id> --text "<instruction>" --json
98
+ subagent send --worker-id <worker-id> --text "<instruction>" --json
137
99
  ```
138
100
 
139
101
  Opt out of waiting when needed:
140
102
  ```bash
141
- subagent send --worker <worker-id> --text "<instruction>" --no-wait --json
103
+ subagent send --worker-id <worker-id> --text "<instruction>" --no-wait --json
142
104
  ```
143
105
 
144
- For shell-safe input (recommended when text includes backticks, `$()`, redirects, etc.):
106
+ For multiline or shell-safe input (recommended):
145
107
  ```bash
146
- subagent send --input - --json <<'JSON'
147
- {
148
- "workerId": "<worker-id>",
149
- "text": "Use commands like `echo hello` literally; do not execute them."
150
- }
151
- JSON
108
+ cat > instruction.txt <<'TEXT'
109
+ Use commands like `echo hello` literally; do not execute them.
110
+ TEXT
111
+ subagent send --worker-id <worker-id> --text-file ./instruction.txt --json
152
112
  ```
153
- `workerId` is required in JSON input payloads.
113
+
114
+ stdin variant:
115
+ ```bash
116
+ cat ./instruction.txt | subagent send --worker-id <worker-id> --text-stdin --json
117
+ ```
118
+
119
+ Advanced automation can still use structured JSON input via `--input` (JSON key: `workerId`; CLI flag: `--worker-id`).
154
120
 
155
121
  Manual wait mode (advanced cursor control) still exists:
156
122
  ```bash
157
- subagent wait --worker <worker-id> --until turn_end --timeout-seconds 60 --json
123
+ subagent wait --worker-id <worker-id> --until turn_end --timeout-seconds 60 --json
124
+ ```
125
+
126
+ To include historical events in matching:
127
+ ```bash
128
+ subagent wait --worker-id <worker-id> --include-history --until turn_end --timeout-seconds 60 --json
158
129
  ```
159
130
 
160
131
  For local simulation/testing without a real ACP launcher:
@@ -170,7 +141,7 @@ subagent worker start --cwd . --debug-mode
170
141
  ```bash
171
142
  subagent launcher probe <launcher-name> --json
172
143
  ```
173
- - If `worker start` fails with `BACKEND_UNAVAILABLE`, inspect runtime logs under `<workspace>/.subagent/state/runtimes/` (default) or `$SUBAGENT_STATE_DIR/runtimes/` (when overridden).
144
+ - If `worker start` fails with a backend error (for example `BACKEND_TIMEOUT`, `BACKEND_SOCKET_UNREACHABLE`, `BACKEND_LAUNCHER`), inspect runtime logs under `<workspace>/.subagent/state/runtimes/` (default) or `$SUBAGENT_STATE_DIR/runtimes/` (when overridden).
174
145
  - For cut-down local testing without backend connectivity:
175
146
  ```bash
176
147
  subagent worker start --cwd . --debug-mode
@@ -0,0 +1,97 @@
1
+ launchers:
2
+ codex:
3
+ backend:
4
+ kind: acp-stdio
5
+ command: npx
6
+ args:
7
+ - -y
8
+ - "@zed-industries/codex-acp"
9
+ env: {}
10
+
11
+ claude-code:
12
+ backend:
13
+ kind: acp-stdio
14
+ command: npx
15
+ args:
16
+ - -y
17
+ - "@zed-industries/claude-agent-acp"
18
+ env: {}
19
+
20
+ gemini:
21
+ backend:
22
+ kind: acp-stdio
23
+ command: npx
24
+ args:
25
+ - -y
26
+ - "@google/gemini-cli"
27
+ - "--experimental-acp"
28
+ env: {}
29
+
30
+ opencode:
31
+ backend:
32
+ kind: acp-stdio
33
+ command: opencode
34
+ args:
35
+ - acp
36
+ env: {}
37
+
38
+ cline:
39
+ backend:
40
+ kind: acp-stdio
41
+ command: npx
42
+ args:
43
+ - -y
44
+ - "cline"
45
+ - "--acp"
46
+ env: {}
47
+
48
+ github-copilot:
49
+ backend:
50
+ kind: acp-stdio
51
+ command: npx
52
+ args:
53
+ - -y
54
+ - "@github/copilot-language-server"
55
+ - "--acp"
56
+ env: {}
57
+
58
+ kiro:
59
+ backend:
60
+ kind: acp-stdio
61
+ command: npx
62
+ args:
63
+ - -y
64
+ - "@kirodotdev/cli"
65
+ - acp
66
+ env: {}
67
+
68
+ roleDefaults:
69
+ promptLanguage: en
70
+ responseLanguage: same_as_manager
71
+
72
+ roleHints:
73
+ developer:
74
+ preferredLauncher: codex
75
+ delegationHint: "State goal, constraints, done conditions, affected files, and test expectations."
76
+ # Optional: list skill names the agent should explicitly invoke for this role.
77
+ recommendedSkills: []
78
+ reviewer:
79
+ preferredLauncher: claude-code
80
+ delegationHint: "Review as a lead engineer; prioritize bugs, regressions, missing tests, and risk."
81
+ recommendedSkills: []
82
+ research_analyst:
83
+ preferredLauncher: gemini
84
+ delegationHint: "Gather primary sources first, then report with dates and source URLs."
85
+ recommendedSkills: []
86
+ ux_designer:
87
+ preferredLauncher: claude-code
88
+ delegationHint: "Provide user flows, alternatives, trade-offs, decision rationale, and validation metrics."
89
+ recommendedSkills: []
90
+ data_scientist:
91
+ preferredLauncher: codex
92
+ delegationHint: "Define hypothesis, required data, method, evaluation metrics, and reproducible steps."
93
+ recommendedSkills: []
94
+
95
+ defaults:
96
+ launcher: codex
97
+ role: developer
@@ -5,13 +5,13 @@
5
5
  - Local control plane: `subagentd` process for bootstrap/status, heartbeat, worker runtime health checks, and auto-restart attempts.
6
6
  - Runtime state: sqlite-backed `StateStore` for controllers, controller instances, workers, event journal, approval requests, and handoff snapshots.
7
7
  - Runtime adapter: per-worker ACP runtime process (`subagent.worker_runtime`) with unix-socket IPC (`runtime_service`).
8
- - Config registry: loader for `launchers` / `profiles` / `packs` / `defaults` from config.
8
+ - Config registry: loader for `launchers` / `roleHints` / `roleDefaults` / `defaults` from config.
9
9
 
10
10
  ## Current v1 Scope (Implemented)
11
11
  - `config`: `init` (user/project config template generation)
12
- - `launcher/profile/pack`: `list`, `show`
12
+ - `launcher/role`: `list`, `show`
13
13
  - `launcher`: `probe`
14
- - `prompt`: `render` (manager/worker)
14
+ - `prompt`: `render` (manager)
15
15
  - `controller`: `init`, `attach`, `status`, `recover`, `release`
16
16
  - `worker`: `start`, `list`, `show`, `inspect`, `stop`, `handoff`, `continue`
17
17
  - turn operations: `send`, `watch`, `wait`, `approve`, `cancel`
@@ -3,8 +3,7 @@
3
3
  "workerId": "w_123",
4
4
  "controllerId": "ctl_abc123",
5
5
  "launcher": "codex",
6
- "profile": "worker-default",
7
- "packs": ["repo-conventions"],
6
+ "role": "worker-default",
8
7
  "cwd": "/path/to/workspace",
9
8
  "state": "handoff_ready",
10
9
  "sourceTurnId": "turn_07",
@@ -1,4 +1,4 @@
1
- {"schemaVersion":"v1","eventId":"ev_01","ts":"2026-03-01T22:00:00Z","workerId":"w_123","type":"worker.started","data":{"launcher":"codex","profile":"worker-default","state":"idle"}}
1
+ {"schemaVersion":"v1","eventId":"ev_01","ts":"2026-03-01T22:00:00Z","workerId":"w_123","type":"worker.started","data":{"launcher":"codex","role":"worker-default","state":"idle"}}
2
2
  {"schemaVersion":"v1","eventId":"ev_02","ts":"2026-03-01T22:00:05Z","workerId":"w_123","type":"turn.started","data":{"turnId":"turn_01"}}
3
3
  {"schemaVersion":"v1","eventId":"ev_03","ts":"2026-03-01T22:00:12Z","workerId":"w_123","type":"progress.message","data":{"role":"assistant","text":"STATUS: Investigating flaky payments retry test."}}
4
4
  {"schemaVersion":"v1","eventId":"ev_04","ts":"2026-03-01T22:00:20Z","workerId":"w_123","type":"turn.completed","data":{"turnId":"turn_01","state":"idle"}}
@@ -1,13 +1,13 @@
1
1
  # Worker Continue Flow (v1)
2
2
 
3
3
  1. Create handoff from previous worker:
4
- `subagent worker handoff --worker w_123`
4
+ `subagent worker handoff --worker-id w_123`
5
5
 
6
6
  2. Start a new worker from the handoff artifact:
7
- `subagent worker continue --from-worker w_123 --launcher codex --profile worker-default`
7
+ `subagent worker continue --from-worker w_123 --launcher codex --role worker-default`
8
8
 
9
9
  3. Watch normalized events from the new worker:
10
- `subagent watch --worker w_456 --follow --ndjson`
10
+ `subagent watch --worker-id w_456 --follow --ndjson`
11
11
 
12
12
  4. Continue by sending a new instruction:
13
- `subagent send --worker w_456 --text "Proceed with the minimal fix and add regression coverage."`
13
+ `subagent send --worker-id w_456 --text "Proceed with the minimal fix and add regression coverage."`
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "subagent-cli"
3
- version = "0.1.5"
3
+ version = "0.1.7"
4
4
  description = "Protocol-agnostic worker orchestration CLI"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"