Add --mode flag for CLI output control (text/json/rpc)

- text mode: only outputs final assistant message text (default)
- json mode: streams all events as JSON (same as session manager writes)
- rpc mode: JSON output + listens for JSON input on stdin for headless operation
- Suppress informational messages in json/rpc modes
This commit is contained in:
Mario Zechner 2025-11-12 20:33:31 +01:00
parent c75f53f6f2
commit 68092ccf01
8 changed files with 800 additions and 286 deletions

14
package-lock.json generated
View file

@ -500,6 +500,13 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/diff": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/@types/diff/-/diff-7.0.2.tgz",
"integrity": "sha512-JSWRMozjFKsGlEjiiKajUjIJVKuKdE3oVy2DNtK+fUo8q82nhFZ2CPQwicAIkXrofahDXrWJ7mjelvZphMS98Q==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/estree": {
"version": "1.0.8",
"dev": true,
@ -1102,7 +1109,8 @@
},
"node_modules/diff": {
"version": "8.0.2",
"dev": true,
"resolved": "https://registry.npmjs.org/diff/-/diff-8.0.2.tgz",
"integrity": "sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==",
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.3.1"
@ -3262,12 +3270,13 @@
},
"packages/coding-agent": {
"name": "@mariozechner/coding-agent",
"version": "0.6.0",
"version": "0.6.1",
"license": "MIT",
"dependencies": {
"@mariozechner/pi-agent": "^0.6.0",
"@mariozechner/pi-ai": "^0.6.0",
"chalk": "^5.5.0",
"diff": "^8.0.2",
"glob": "^11.0.3"
},
"bin": {
@ -3275,6 +3284,7 @@
"pi": "dist/cli.js"
},
"devDependencies": {
"@types/diff": "^7.0.2",
"@types/node": "^24.3.0",
"typescript": "^5.7.3",
"vitest": "^3.2.4"