@markusylisiurunen/tau 0.3.19 → 0.3.20
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 +19 -47
- package/dist/core/cli.js +6 -39
- package/dist/core/cli.js.map +1 -1
- package/dist/core/commands/index.js +1 -1
- package/dist/core/commands/index.js.map +1 -1
- package/dist/core/commands/registry.js +5 -76
- package/dist/core/commands/registry.js.map +1 -1
- package/dist/core/config/builtin_themes.js +0 -62
- package/dist/core/config/builtin_themes.js.map +1 -1
- package/dist/core/config/content_loader.js +4 -7
- package/dist/core/config/content_loader.js.map +1 -1
- package/dist/core/config/diff_tool.js +1 -1
- package/dist/core/config/diff_tool.js.map +1 -1
- package/dist/core/config/runtime.js +1 -1
- package/dist/core/config/runtime.js.map +1 -1
- package/dist/core/config/runtime_config_snapshot.js +1 -1
- package/dist/core/config/runtime_config_snapshot.js.map +1 -1
- package/dist/core/config/schema.js +10 -43
- package/dist/core/config/schema.js.map +1 -1
- package/dist/core/config/skill_parser.js +1 -1
- package/dist/core/config/skill_parser.js.map +1 -1
- package/dist/core/config/virtual_defaults.js +0 -1
- package/dist/core/config/virtual_defaults.js.map +1 -1
- package/dist/core/debug.js +1 -7
- package/dist/core/debug.js.map +1 -1
- package/dist/core/diff_review/bridge.js +1 -3
- package/dist/core/diff_review/bridge.js.map +1 -1
- package/dist/core/diff_review/index.js.map +1 -1
- package/dist/core/diff_review/protocol.js +13 -13
- package/dist/core/diff_review/protocol.js.map +1 -1
- package/dist/core/diff_review/review_instructions.js +48 -0
- package/dist/core/diff_review/review_instructions.js.map +1 -0
- package/dist/core/events/index.js.map +1 -1
- package/dist/core/events/parser.js +161 -38
- package/dist/core/events/parser.js.map +1 -1
- package/dist/core/events/types.js +1 -1
- package/dist/core/events/types.js.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/models/catalog.js +4 -4
- package/dist/core/models/catalog.js.map +1 -1
- package/dist/core/personas.js +29 -14
- package/dist/core/personas.js.map +1 -1
- package/dist/core/runtime/chat_runtime.js +12 -34
- package/dist/core/runtime/chat_runtime.js.map +1 -1
- package/dist/core/runtime/conversation_turn_runtime.js +0 -4
- package/dist/core/runtime/conversation_turn_runtime.js.map +1 -1
- package/dist/core/runtime/runtime_bootstrap.js +191 -317
- package/dist/core/runtime/runtime_bootstrap.js.map +1 -1
- package/dist/core/runtime/session_prompt_composer.js +2 -6
- package/dist/core/runtime/session_prompt_composer.js.map +1 -1
- package/dist/core/session/core_session.js +2 -5
- package/dist/core/session/core_session.js.map +1 -1
- package/dist/core/session/message_accumulator.js +6 -0
- package/dist/core/session/message_accumulator.js.map +1 -1
- package/dist/core/session/runner.js +137 -32
- package/dist/core/session/runner.js.map +1 -1
- package/dist/core/session/session_engine.js +365 -120
- package/dist/core/session/session_engine.js.map +1 -1
- package/dist/core/static/index.js +0 -11
- package/dist/core/static/index.js.map +1 -1
- package/dist/core/subagents/registry.js +0 -2
- package/dist/core/subagents/registry.js.map +1 -1
- package/dist/core/subagents/subagent_engine.js +1 -3
- package/dist/core/subagents/subagent_engine.js.map +1 -1
- package/dist/core/telegram/adapter.js +1 -1
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/telegram/config.js +3 -13
- package/dist/core/telegram/config.js.map +1 -1
- package/dist/core/telegram/session_manager.js +2 -5
- package/dist/core/telegram/session_manager.js.map +1 -1
- package/dist/core/tools/bash.js +6 -21
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.js +1 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/emit_output.js +1 -1
- package/dist/core/tools/emit_output.js.map +1 -1
- package/dist/core/tools/execution_backend.js +3 -1
- package/dist/core/tools/execution_backend.js.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/list.js +1 -1
- package/dist/core/tools/list.js.map +1 -1
- package/dist/core/tools/nook.js +1 -10
- package/dist/core/tools/nook.js.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/registry.js.map +1 -1
- package/dist/core/tools/send_input_to_agent.js +1 -1
- package/dist/core/tools/send_input_to_agent.js.map +1 -1
- package/dist/core/tools/spawn_agent.js +40 -88
- package/dist/core/tools/spawn_agent.js.map +1 -1
- package/dist/core/tools/terminate_agent.js +1 -1
- package/dist/core/tools/terminate_agent.js.map +1 -1
- package/dist/core/tools/view_image.js +1 -1
- package/dist/core/tools/view_image.js.map +1 -1
- package/dist/core/tools/wait_for_agents.js +1 -1
- package/dist/core/tools/wait_for_agents.js.map +1 -1
- package/dist/core/tools/web_fetch.js +1 -1
- package/dist/core/tools/web_fetch.js.map +1 -1
- package/dist/core/tools/web_search.js +1 -1
- package/dist/core/tools/web_search.js.map +1 -1
- package/dist/core/tools/write.js +1 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/types.js +0 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/utils/context.js +1 -1
- package/dist/core/utils/context.js.map +1 -1
- package/dist/core/utils/context_builder.js +1 -15
- package/dist/core/utils/context_builder.js.map +1 -1
- package/dist/core/utils/user_metadata.js +13 -19
- package/dist/core/utils/user_metadata.js.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/execution/cloudflare_sandbox_execution_environment.js +15 -10
- package/dist/execution/cloudflare_sandbox_execution_environment.js.map +1 -1
- package/dist/execution/fly_sprite_execution_environment.js +9 -1
- package/dist/execution/fly_sprite_execution_environment.js.map +1 -1
- package/dist/execution/local_execution_environment.js +9 -55
- package/dist/execution/local_execution_environment.js.map +1 -1
- package/dist/execution/tool_backend_execution_environment.js +7 -10
- package/dist/execution/tool_backend_execution_environment.js.map +1 -1
- package/dist/host/client_tool_broker.js +1 -1
- package/dist/host/client_tool_broker.js.map +1 -1
- package/dist/host/execution_runtime.js +35 -0
- package/dist/host/execution_runtime.js.map +1 -0
- package/dist/host/hosted_ephemeral_agent_session.js +20 -11
- package/dist/host/hosted_ephemeral_agent_session.js.map +1 -1
- package/dist/host/local_session_host.js +117 -109
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/host/session_protocol_handler.js +0 -10
- package/dist/host/session_protocol_handler.js.map +1 -1
- package/dist/main.js +31 -63
- package/dist/main.js.map +1 -1
- package/dist/nook/README.md +1 -1
- package/dist/protocol/index.d.ts +1 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/session_protocol.d.ts +1 -11
- package/dist/protocol/session_protocol.js +242 -343
- package/dist/protocol/session_protocol.js.map +1 -1
- package/dist/sdk/client.js +2 -24
- package/dist/sdk/client.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/session.js +0 -9
- package/dist/sdk/session.js.map +1 -1
- package/dist/sdk/types.d.ts +0 -4
- package/dist/starter/skills/guided-review/SKILL.md +1 -1
- package/dist/tui/chat_controller/command_hints.js +0 -2
- package/dist/tui/chat_controller/command_hints.js.map +1 -1
- package/dist/tui/chat_view.js +0 -2
- package/dist/tui/chat_view.js.map +1 -1
- package/dist/tui/session_chat_app.js +1 -1
- package/dist/tui/session_chat_app.js.map +1 -1
- package/dist/tui/session_chat_controller.js +2 -38
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/ui/custom_editor.js +0 -5
- package/dist/tui/ui/custom_editor.js.map +1 -1
- package/dist/tui/ui/footer.js +4 -37
- package/dist/tui/ui/footer.js.map +1 -1
- package/dist/tui/ui/slash_autocomplete.js +2 -33
- package/dist/tui/ui/slash_autocomplete.js.map +1 -1
- package/dist/tui/ui/theme/palette.js +0 -2
- package/dist/tui/ui/theme/palette.js.map +1 -1
- package/dist/tui/ui/theme/theme.js.map +1 -1
- package/package.json +4 -4
- package/dist/core/diff_review/review_thread.js +0 -264
- package/dist/core/diff_review/review_thread.js.map +0 -1
- package/dist/core/static/prompts/diff-review-wrapper.md +0 -26
package/README.md
CHANGED
|
@@ -82,10 +82,10 @@ filters: `--since`, `--persona`, `--provider`, `--model`.
|
|
|
82
82
|
tau can run without the TUI via NDJSON RPC over stdin/stdout:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
tau rpc --persona gpt-5.5-coder
|
|
85
|
+
tau rpc --persona gpt-5.5-coder
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
RPC mode reuses the same startup config
|
|
88
|
+
RPC mode reuses the same startup config and persona loading as interactive mode. stdin/stdout are reserved for protocol traffic in this mode (piped stdin is **not** treated as an initial user message). `--caffeinated` is a macOS-only TUI flag and is rejected outside TUI mode.
|
|
89
89
|
|
|
90
90
|
for protocol details and examples, see [docs/rpc.md](docs/rpc.md).
|
|
91
91
|
|
|
@@ -94,7 +94,7 @@ for protocol details and examples, see [docs/rpc.md](docs/rpc.md).
|
|
|
94
94
|
tau can host sessions over WebSocket:
|
|
95
95
|
|
|
96
96
|
```sh
|
|
97
|
-
tau serve --host 0.0.0.0 --port 8787 --auth-token "$TAU_WS_AUTH_TOKEN"
|
|
97
|
+
tau serve --host 0.0.0.0 --port 8787 --auth-token "$TAU_WS_AUTH_TOKEN"
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
WebSocket auth tokens authorize full session access. Prefer `wss://` behind a trusted TLS proxy on untrusted networks, avoid putting tokens in URLs or shell history, and treat any proxy/access logs that capture headers, query strings, or WebSocket handshake details as sensitive.
|
|
@@ -127,16 +127,16 @@ tau attach --new --execution-kind fly-sprite --fly-api default --fly-sprite spri
|
|
|
127
127
|
tau can also run the terminal UI against any command that speaks the same session protocol on stdin/stdout:
|
|
128
128
|
|
|
129
129
|
```sh
|
|
130
|
-
tau attach -- ssh vps 'cd /path/to/repo && tau rpc
|
|
130
|
+
tau attach -- ssh vps 'cd /path/to/repo && tau rpc'
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
For stdio attach, use `--session <id>` before `--`:
|
|
134
134
|
|
|
135
135
|
```sh
|
|
136
|
-
tau attach --session 0195d6e4-4cf9-7f44-a2d8-f8f7f49ee9d3 -- ssh vps 'cd /path/to/repo && tau rpc
|
|
136
|
+
tau attach --session 0195d6e4-4cf9-7f44-a2d8-f8f7f49ee9d3 -- ssh vps 'cd /path/to/repo && tau rpc'
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Session attach renders the authoritative session snapshot, streams recoverable `session.delta` updates and independently revisioned, non-persisted `session.pendingUserMessages` replacements, submits normal user input through `session.submit`, `session.queue`, and `session.steer`, supports steering/interruption, runs `!`/`!!` shell commands in the session execution environment, records `/listen` from the local microphone, speaks `/speak` locally, reloads session content with `/reload`,
|
|
139
|
+
Session attach renders the authoritative session snapshot, streams recoverable `session.delta` updates and independently revisioned, non-persisted `session.pendingUserMessages` replacements, submits normal user input through `session.submit`, `session.queue`, and `session.steer`, supports steering/interruption, runs `!`/`!!` shell commands in the session execution environment, records `/listen` from the local microphone, speaks `/speak` locally, reloads session content with `/reload`, switches session personas with `/persona:<id>` or `Ctrl+P`, inserts session prompt templates with `/prompt:<id>`, compacts or prunes the session with `/compact:*` and `/prune:*`, creates a new session with `/new`, and exits with `/exit` or `Ctrl+C` twice.
|
|
140
140
|
|
|
141
141
|
## Telegram runner
|
|
142
142
|
|
|
@@ -199,7 +199,7 @@ Add a single configured target to Tau config after deploying the Worker and crea
|
|
|
199
199
|
}
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
-
Template copies require a destination directory that already exists and is empty. The Worker validates Cloudflare Access JWTs against the Access JWKS with the configured issuer and audience. Tau sends service-token headers to Cloudflare Access for CLI/API calls, but the Worker does not treat those raw headers as authentication. When `nook` is configured, Tau automatically exposes a
|
|
202
|
+
Template copies require a destination directory that already exists and is empty. The Worker validates Cloudflare Access JWTs against the Access JWKS with the configured issuer and audience. Tau sends service-token headers to Cloudflare Access for CLI/API calls, but the Worker does not treat those raw headers as authentication. When `nook` is configured, Tau automatically exposes a model tool named `nook`. Detailed setup, deploy, template, Worker, browser SDK, and V0 scope notes live in [src/nook/README.md](src/nook/README.md).
|
|
203
203
|
|
|
204
204
|
## SDK usage (Node)
|
|
205
205
|
|
|
@@ -258,13 +258,8 @@ this writes prompts and skills into `.tau/` under your current working directory
|
|
|
258
258
|
|
|
259
259
|
## security notice
|
|
260
260
|
|
|
261
|
-
**the risk level system is a UX guardrail, not a hard security boundary.** it helps prevent accidental writes and guides model behavior, but it has significant limitations:
|
|
262
|
-
|
|
263
|
-
- **model trust**: the bash tool relies on the model honestly declaring whether a command is a read or write. there's no runtime validation that the command actually matches the declared intent. a model could declare `safetyLevel="read"` while running `rm -rf /`.
|
|
264
|
-
- **no command analysis**: the system doesn't inspect command content. it trusts the declared safety level without verifying what the command actually does.
|
|
265
261
|
- **full system access**: the model can access any file on your system that your user account can read or write, not just the current working directory. if you need stronger isolation, run Tau inside a VM or container.
|
|
266
262
|
- **no tty / non-interactive tools**: tool commands run with stdin ignored and no TTY. anything that prompts for input or opens an editor can hang or fail (for example `sudo`, `ssh` password prompts, `git` credential prompts). tau also forces git into non-interactive mode (no prompt/editor/pager, batch-mode ssh).
|
|
267
|
-
- **user bypasses**: the `!` prefix executes shell commands directly and completely bypasses risk level checks. this is intentional for direct use, but means risk levels only constrain the model, not the user.
|
|
268
263
|
|
|
269
264
|
note that there is no confirmation step before tool execution. the model runs commands immediately, and you can only observe the results after the fact.
|
|
270
265
|
|
|
@@ -305,7 +300,6 @@ available palette tokens (theme keys):
|
|
|
305
300
|
- diff: `diffAdd`, `diffRemove`
|
|
306
301
|
- toasts: `toastSuccess`, `toastWarn`, `toastError`
|
|
307
302
|
- user: `userSurface`, `userMemorySurface`, `userMemoryText`
|
|
308
|
-
- risk: `riskReadOnlyText`, `riskReadWriteText`
|
|
309
303
|
|
|
310
304
|
example theme file (`.tau/themes/solarized.json`):
|
|
311
305
|
|
|
@@ -323,24 +317,9 @@ and in config (`.tau/config.json` or `~/.config/tau/config.json`):
|
|
|
323
317
|
{ "defaultTheme": "solarized" }
|
|
324
318
|
```
|
|
325
319
|
|
|
326
|
-
##
|
|
327
|
-
|
|
328
|
-
tau uses risk levels to control what the model can do. this lets you stay in control while working alongside AI.
|
|
329
|
-
|
|
330
|
-
- **read-only** (default): model can run read-only tools (no file modifications)
|
|
331
|
-
- **read-write**: model can create, edit, and delete files
|
|
332
|
-
|
|
333
|
-
sub-agents inherit the session risk level unless overridden in persona config. a sub-agent configured with `riskLevel: read-write` can write even when the main session is `read-only`.
|
|
334
|
-
|
|
335
|
-
start with a specific risk level (exact values: `read-only` or `read-write`):
|
|
336
|
-
|
|
337
|
-
```sh
|
|
338
|
-
tau --risk read-write
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
or change it during a session with `/risk:read-only` or `/risk:read-write`.
|
|
320
|
+
## tool access
|
|
342
321
|
|
|
343
|
-
|
|
322
|
+
enabled tools execute directly. persona and sub-agent tool lists determine which tools are available.
|
|
344
323
|
|
|
345
324
|
## power management (macOS)
|
|
346
325
|
|
|
@@ -359,10 +338,10 @@ tau comes with several built-in personas across different models:
|
|
|
359
338
|
- **Claude Opus 4.6** (Anthropic): `opus-4.6-chat`, `opus-4.6-coder`
|
|
360
339
|
- **Claude Opus 4.8** (Anthropic): `opus-4.8-chat`, `opus-4.8-coder`
|
|
361
340
|
- **GPT-5.5** (OpenAI): `gpt-5.5-chat`, `gpt-5.5-coder`
|
|
362
|
-
- **GPT-5.5 Fast (ChatGPT)** and **GPT-5.6 Fast (ChatGPT)** (OpenAI Codex, priority tier): `gpt-5.5-chatgpt-fast-chat`, `gpt-5.5-chatgpt-fast-coder`, `gpt-5.6-sol-chatgpt-fast-chat`, `gpt-5.6-sol-chatgpt-fast-coder`, `gpt-5.6-terra-chatgpt-fast-chat`, `gpt-5.6-terra-chatgpt-fast-coder`
|
|
341
|
+
- **GPT-5.5 Fast (ChatGPT)** and **GPT-5.6 Fast (ChatGPT)** (OpenAI Codex, priority tier): `gpt-5.5-chatgpt-fast-chat`, `gpt-5.5-chatgpt-fast-coder`, `gpt-5.6-sol-chatgpt-fast-chat`, `gpt-5.6-sol-chatgpt-fast-coder`, `gpt-5.6-terra-chatgpt-fast-chat`, `gpt-5.6-terra-chatgpt-fast-coder`, `gpt-5.6-luna-chatgpt-fast-chat`, `gpt-5.6-luna-chatgpt-fast-coder`
|
|
363
342
|
- **GPT-5.5 (ChatGPT)** (OpenAI Codex): `gpt-5.5-chatgpt-chat`, `gpt-5.5-chatgpt-coder`
|
|
364
|
-
- **GPT-5.6 Sol** and **GPT-5.6
|
|
365
|
-
- **GPT-5.6 Sol (ChatGPT)** and **GPT-5.6
|
|
343
|
+
- **GPT-5.6 Sol**, **GPT-5.6 Terra**, and **GPT-5.6 Luna** (OpenAI): `gpt-5.6-sol-chat`, `gpt-5.6-sol-coder`, `gpt-5.6-terra-chat`, `gpt-5.6-terra-coder`, `gpt-5.6-luna-chat`, `gpt-5.6-luna-coder`
|
|
344
|
+
- **GPT-5.6 Sol (ChatGPT)**, **GPT-5.6 Terra (ChatGPT)**, and **GPT-5.6 Luna (ChatGPT)** (OpenAI Codex): `gpt-5.6-sol-chatgpt-chat`, `gpt-5.6-sol-chatgpt-coder`, `gpt-5.6-terra-chatgpt-chat`, `gpt-5.6-terra-chatgpt-coder`, `gpt-5.6-luna-chatgpt-chat`, `gpt-5.6-luna-chatgpt-coder`
|
|
366
345
|
- **Gemini 3.1 Pro** and **Gemini 3 Flash** (Google): `gemini-3.1-pro-chat`, `gemini-3-flash-chat`
|
|
367
346
|
|
|
368
347
|
chat variants are for general-purpose assistance; coder variants are optimized for software engineering. built-in personas include the `default` sub-agent for background tasks unless disabled.
|
|
@@ -379,9 +358,9 @@ tau --persona opus-4.8-coder
|
|
|
379
358
|
|
|
380
359
|
some personas can run isolated sub-agents via the `spawn_agent`, `send_input_to_agent`, `wait_for_agents`, and `terminate_agent` tools. sub-agents report progress in the subagent panel, and `wait_for_agents` returns completed outputs as soon as at least one requested agent finishes.
|
|
381
360
|
|
|
382
|
-
the built-in `default` sub-agent is available unless disabled. it inherits the main persona's model, settings, tool access (minus sub-agent management tools),
|
|
361
|
+
the built-in `default` sub-agent is available unless disabled. it inherits the main persona's model, settings, tool access (minus sub-agent management tools), and system prompt. the inherited main prompt is wrapped with default sub-agent-specific rules, and those wrapper rules take precedence on conflicts. custom sub-agents can override model, reasoning, and tools.
|
|
383
362
|
|
|
384
|
-
`spawn_agent` supports an optional launch override string (`model: "<provider>/<model>:<effort>"`) and an optional `workingDirectory`. when `workingDirectory` is set, the sub-agent runs from that directory and its
|
|
363
|
+
`spawn_agent` supports an optional launch override string (`model: "<provider>/<model>:<effort>"`) and an optional `workingDirectory`. when `workingDirectory` is set, the sub-agent runs from that directory and its config, model catalog, repository metadata, AGENTS.md context, and skills are resolved through the session execution environment as if tau was started there. launch overrides are allowlisted per subagent. custom subagents can define `launchModels` in persona frontmatter, and the built-in `default` sub-agent uses `subagents.defaultLaunchModels` from config.
|
|
385
364
|
|
|
386
365
|
sub-agent progress appears in a sticky panel. use `alt+down` to cycle active subagents and `ctrl+g` to terminate the selected one. tau caps active subagents at 8.
|
|
387
366
|
|
|
@@ -469,9 +448,7 @@ tau supports slash commands for common actions:
|
|
|
469
448
|
| `/persona:<id>` | switch to a different persona |
|
|
470
449
|
| `/prompt:<id>` | insert a saved prompt template |
|
|
471
450
|
| `/theme:<id>` | switch to a loaded theme |
|
|
472
|
-
|
|
|
473
|
-
| `/risk:read-write` | allow all tools |
|
|
474
|
-
| `!<cmd>` | run a shell command directly (bypasses risk checks) |
|
|
451
|
+
| `!<cmd>` | run a shell command directly |
|
|
475
452
|
| `!!<cmd>` | run a shell command without adding output to the model context |
|
|
476
453
|
|
|
477
454
|
tau automatically compacts long sessions when provider-reported usage approaches the model context limit. automatic compaction summarizes older context, asks the compaction model to select original user messages to append verbatim inside the summary by history id, retains a recent tail verbatim, and inserts a hidden continuation note so the assistant continues without asking you to repeat context.
|
|
@@ -493,7 +470,6 @@ the prune commands drop bash tool results from the active context without summar
|
|
|
493
470
|
| key | action |
|
|
494
471
|
| ------------ | ----------------------------------------- |
|
|
495
472
|
| `shift+tab` | cycle reasoning effort |
|
|
496
|
-
| `ctrl+r` | cycle risk level |
|
|
497
473
|
| `ctrl+p` | cycle personality |
|
|
498
474
|
| `ctrl+t` | toggle thinking visibility |
|
|
499
475
|
| `ctrl+o` | toggle compact tool display |
|
|
@@ -526,7 +502,6 @@ model definitions can be extended and overridden through `~/.config/tau/models.j
|
|
|
526
502
|
"mistral": "..."
|
|
527
503
|
},
|
|
528
504
|
"defaultPersona": "gpt-5.5-chat",
|
|
529
|
-
"defaultRisk": "read-write",
|
|
530
505
|
"disableBuiltinPersonas": false,
|
|
531
506
|
"disableBuiltinThemes": false,
|
|
532
507
|
"defaultTheme": "solarized",
|
|
@@ -580,8 +555,6 @@ for built-in providers and features, the `apiKeys` field uses these keys: `anthr
|
|
|
580
555
|
|
|
581
556
|
the `defaultPersona` field specifies which persona to use when starting the app. it accepts `<id>` or `<id>:<reasoning>`, and matching is exact/case-sensitive. the `--persona` flag overrides this setting.
|
|
582
557
|
|
|
583
|
-
the `defaultRisk` field sets the initial risk level (`read-only` or `read-write`). the `--risk` flag overrides this setting. if not specified, defaults to `read-only`.
|
|
584
|
-
|
|
585
558
|
the `defaultTheme` field sets the theme id to load at startup. it must be non-empty, and matching is exact/case-sensitive. if not specified, it defaults to `gold`.
|
|
586
559
|
|
|
587
560
|
`speechToText.provider` selects the `/listen` and Telegram audio transcription provider. supported values are `mistral` (default, uses Voxtral) and `gemini` (uses Gemini 3.5 Flash with minimal thinking).
|
|
@@ -675,8 +648,8 @@ optional frontmatter fields:
|
|
|
675
648
|
- `serviceTier`: `priority` or `flex` for providers that support service tiers (currently `openai` and `openai-codex`)
|
|
676
649
|
- `allowedReasoningLevels`: list of reasoning levels shown in the ui
|
|
677
650
|
- `skills`: list of enabled skill names (matched by `name` in skill frontmatter), or `"*"` to enable all discovered skills. if omitted, custom personas default to `"*"`. set `skills: []` to disable skills completely.
|
|
678
|
-
- `tools`: optional list of persona-selected host tools. Nook is not selected here; when effective config contains `nook`, Tau exposes the `nook` tool automatically
|
|
679
|
-
- `subagents`: optional map of subagent definitions. the built-in `default` sub-agent is implicit unless `default: false` is provided. custom subagents must include `systemPrompt` and may include `description`, `provider`+`model`, `reasoning`, `serviceTier`, `tools`,
|
|
651
|
+
- `tools`: optional list of persona-selected host tools. Nook is not selected here; when effective config contains `nook`, Tau exposes the `nook` tool automatically.
|
|
652
|
+
- `subagents`: optional map of subagent definitions. the built-in `default` sub-agent is implicit unless `default: false` is provided. custom subagents must include `systemPrompt` and may include `description`, `provider`+`model`, `reasoning`, `serviceTier`, `tools`, and `launchModels` (when specifying a model, `provider` and `model` must be provided together). names must be lowercase with dashes (max 64 chars). `launchModels` entries must use `<provider>/<model>:<effort>` and are used to allowlist launch-time `spawn_agent` overrides. example:
|
|
680
653
|
```yaml
|
|
681
654
|
subagents:
|
|
682
655
|
default: false
|
|
@@ -688,12 +661,11 @@ optional frontmatter fields:
|
|
|
688
661
|
model: claude-haiku-4-5
|
|
689
662
|
reasoning: medium
|
|
690
663
|
tools: [web_search, web_fetch, bash]
|
|
691
|
-
riskLevel: read-only
|
|
692
664
|
launchModels:
|
|
693
665
|
- openai/gpt-5.5:high
|
|
694
666
|
- anthropic/claude-haiku-4-5:medium
|
|
695
667
|
```
|
|
696
|
-
- `tools`: list of tool names to enable for this persona. allowed: `bash`, `write`, `edit`, `view_image`, `spawn_agent`, `send_input_to_agent`, `wait_for_agents`, `terminate_agent`. if omitted, defaults to `bash`, `write`, `edit`, `view_image` (and subagent tools when subagents are enabled).
|
|
668
|
+
- `tools`: list of tool names to enable for this persona. allowed: `bash`, `write`, `edit`, `view_image`, `spawn_agent`, `send_input_to_agent`, `wait_for_agents`, `terminate_agent`. if omitted, defaults to `bash`, `write`, `edit`, `view_image` (and subagent tools when subagents are enabled).
|
|
697
669
|
|
|
698
670
|
the markdown body becomes the system prompt.
|
|
699
671
|
|
|
@@ -745,7 +717,7 @@ use `/reload` to pick up changes to personas, model overrides, prompts, skills,
|
|
|
745
717
|
|
|
746
718
|
## how it works
|
|
747
719
|
|
|
748
|
-
tau connects your terminal to large language models, giving them tools to interact with your filesystem. when you ask the model to explore code or make changes, it decides which tools to use and executes them
|
|
720
|
+
tau connects your terminal to large language models, giving them tools to interact with your filesystem. when you ask the model to explore code or make changes, it decides which tools to use and executes them directly.
|
|
749
721
|
|
|
750
722
|
the model sees your messages, any file contents you've shared, and the results of tool calls. it doesn't have ambient access to your filesystem; it only sees what you show it or what it explicitly requests through tools.
|
|
751
723
|
|
package/dist/core/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parsePersonaReference } from "./persona_reference.js";
|
|
2
|
-
import { REASONING_LEVELS
|
|
2
|
+
import { REASONING_LEVELS } from "./types.js";
|
|
3
3
|
export class CliError extends Error {
|
|
4
4
|
constructor(message) {
|
|
5
5
|
super(message);
|
|
@@ -23,7 +23,7 @@ export function parsePersonaString(raw, personas) {
|
|
|
23
23
|
reasoning: personaId ? parsed.reasoning : undefined,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function parsePersonaOption(raw
|
|
26
|
+
function parsePersonaOption(raw) {
|
|
27
27
|
const parsedReference = parsePersonaReference(raw);
|
|
28
28
|
if (parsedReference.error === "missing-reasoning") {
|
|
29
29
|
throw new CliError("missing reasoning level after ':' in --persona");
|
|
@@ -35,28 +35,11 @@ function parsePersonaOption(raw, personas) {
|
|
|
35
35
|
if (!parsedReference.personaId) {
|
|
36
36
|
throw new CliError("missing persona id in --persona");
|
|
37
37
|
}
|
|
38
|
-
const personaId = resolvePersonaId(parsedReference.personaId, personas);
|
|
39
|
-
if (!personaId) {
|
|
40
|
-
const available = personas.map((p) => p.id).join(", ");
|
|
41
|
-
throw new CliError(`unknown persona '${parsedReference.personaId}'. available personas: ${available}`);
|
|
42
|
-
}
|
|
43
38
|
return {
|
|
44
|
-
personaId,
|
|
39
|
+
personaId: parsedReference.personaId,
|
|
45
40
|
reasoningOverride: parsedReference.reasoning,
|
|
46
41
|
};
|
|
47
42
|
}
|
|
48
|
-
function parseRiskOption(raw) {
|
|
49
|
-
const normalized = raw.trim();
|
|
50
|
-
if (!normalized) {
|
|
51
|
-
throw new CliError("missing value for --risk");
|
|
52
|
-
}
|
|
53
|
-
const parsed = RiskLevelSchema.safeParse(normalized);
|
|
54
|
-
if (!parsed.success) {
|
|
55
|
-
const allowed = RiskLevelSchema.options.join(", ");
|
|
56
|
-
throw new CliError(`invalid risk level '${raw}'. allowed levels: ${allowed}`);
|
|
57
|
-
}
|
|
58
|
-
return parsed.data;
|
|
59
|
-
}
|
|
60
43
|
function parseValue(arg, argv, index) {
|
|
61
44
|
const eqIndex = arg.indexOf("=");
|
|
62
45
|
if (eqIndex !== -1) {
|
|
@@ -72,12 +55,11 @@ function parseValue(arg, argv, index) {
|
|
|
72
55
|
}
|
|
73
56
|
return { value: next, nextIndex: index + 1 };
|
|
74
57
|
}
|
|
75
|
-
export function parseCliArgs(argv
|
|
58
|
+
export function parseCliArgs(argv) {
|
|
76
59
|
let help = false;
|
|
77
60
|
let debug = false;
|
|
78
61
|
let personaId;
|
|
79
62
|
let reasoningOverride;
|
|
80
|
-
let riskLevel;
|
|
81
63
|
let caffeinated = false;
|
|
82
64
|
let noAgentContextFiles = false;
|
|
83
65
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -103,18 +85,12 @@ export function parseCliArgs(argv, personas) {
|
|
|
103
85
|
arg.startsWith("--persona=") ||
|
|
104
86
|
arg.startsWith("-p=")) {
|
|
105
87
|
const parsed = parseValue(arg, argv, i);
|
|
106
|
-
const persona = parsePersonaOption(parsed.value
|
|
88
|
+
const persona = parsePersonaOption(parsed.value);
|
|
107
89
|
personaId = persona.personaId;
|
|
108
90
|
reasoningOverride = persona.reasoningOverride;
|
|
109
91
|
i = parsed.nextIndex;
|
|
110
92
|
continue;
|
|
111
93
|
}
|
|
112
|
-
if (arg === "--risk" || arg === "-r" || arg.startsWith("--risk=") || arg.startsWith("-r=")) {
|
|
113
|
-
const parsed = parseValue(arg, argv, i);
|
|
114
|
-
riskLevel = parseRiskOption(parsed.value);
|
|
115
|
-
i = parsed.nextIndex;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
94
|
if (arg.startsWith("-")) {
|
|
119
95
|
throw new CliError(`unknown option: ${arg}`);
|
|
120
96
|
}
|
|
@@ -125,7 +101,6 @@ export function parseCliArgs(argv, personas) {
|
|
|
125
101
|
debug,
|
|
126
102
|
personaId,
|
|
127
103
|
reasoningOverride,
|
|
128
|
-
riskLevel,
|
|
129
104
|
caffeinated,
|
|
130
105
|
noAgentContextFiles,
|
|
131
106
|
};
|
|
@@ -133,7 +108,6 @@ export function parseCliArgs(argv, personas) {
|
|
|
133
108
|
export function printHelp(personas) {
|
|
134
109
|
const personaList = personas.map((p) => p.id).join(", ");
|
|
135
110
|
const reasoningList = REASONING_LEVELS.join(", ");
|
|
136
|
-
const riskList = RiskLevelSchema.options.join(", ");
|
|
137
111
|
console.log([
|
|
138
112
|
"tau - terminal chat",
|
|
139
113
|
"",
|
|
@@ -153,12 +127,10 @@ export function printHelp(personas) {
|
|
|
153
127
|
"",
|
|
154
128
|
"options:",
|
|
155
129
|
" --help show this help and exit.",
|
|
156
|
-
" --debug print debug info
|
|
130
|
+
" --debug print debug info and exit (TUI mode only).",
|
|
157
131
|
` --persona, -p <id>[:<level>] start with a persona. available: ${personaList}.`,
|
|
158
132
|
` optionally specify reasoning level. levels: ${reasoningList}.`,
|
|
159
133
|
` if not specified, uses resolved config defaultPersona.`,
|
|
160
|
-
` --risk, -r <level> set initial model risk level. levels: ${riskList}.`,
|
|
161
|
-
` if not specified, uses resolved config defaultRisk (default: read-only).`,
|
|
162
134
|
" --caffeinated keep macOS awake during active assistant turns in TUI mode (no-op on Linux).",
|
|
163
135
|
" --no-agent-context-files disable AGENTS.md injection into the system prompt.",
|
|
164
136
|
"",
|
|
@@ -177,12 +149,8 @@ export function printHelp(personas) {
|
|
|
177
149
|
"examples:",
|
|
178
150
|
" tau --persona gpt-5.4-chat:high",
|
|
179
151
|
" tau -p opus-4.8-coder",
|
|
180
|
-
" tau --persona gpt-5.4-chat:medium --risk read-write",
|
|
181
|
-
" tau -p gpt-5.4-coder:high -r read-write",
|
|
182
|
-
" tau serve --host 0.0.0.0 --port 8787 --risk read-only",
|
|
183
152
|
" tau attach --new --cwd /repo ws://127.0.0.1:8787",
|
|
184
153
|
" tau attach ws://127.0.0.1:8787",
|
|
185
|
-
" tau attach --new --cwd /repo -- ssh vps 'tau rpc --risk read-only'",
|
|
186
154
|
"",
|
|
187
155
|
"notes:",
|
|
188
156
|
" use `tau auth login codex` to authenticate ChatGPT subscription credentials.",
|
|
@@ -194,7 +162,6 @@ export function printHelp(personas) {
|
|
|
194
162
|
" /diff opens the local diff review tool and delegates review work to the session host.",
|
|
195
163
|
" you can switch persona during a session with /persona:<id>.",
|
|
196
164
|
" insert prompt templates with /prompt:<id>.",
|
|
197
|
-
" you can change model risk level during a session with /risk:read-only or /risk:read-write.",
|
|
198
165
|
" if stdin is piped, its contents are sent as the first message automatically in TUI mode.",
|
|
199
166
|
" in RPC mode, stdin/stdout are reserved for protocol traffic.",
|
|
200
167
|
" reasoning only affects providers that support it.",
|
package/dist/core/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/core/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/core/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAgB,gBAAgB,EAAwB,MAAM,YAAY,CAAC;AAWlF,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAA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CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,GAAG,CACT;QACE,QAAQ;QACR,0BAA0B;QAC1B,EAAE;QACF,uGAAuG;QACvG,0HAA0H;QAC1H,EAAE;QACF,WAAW;QACX,wBAAwB;KACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CommandRegistry, createCommandRegistry,
|
|
1
|
+
export { CommandRegistry, createCommandRegistry, } from "./registry.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/commands/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,eAAe,EACf,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/commands/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,eAAe,CAAC"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { dirname } from "node:path";
|
|
2
|
-
import { RiskLevelSchema } from "../types.js";
|
|
3
2
|
import { formatPathForDisplay } from "../utils/format.js";
|
|
4
|
-
const DEFAULT_RISK_LEVELS = ["read-only", "read-write"];
|
|
5
|
-
const RISK_LEVEL_HELP_DESCRIPTIONS = {
|
|
6
|
-
"read-only": "allow read-only tool calls",
|
|
7
|
-
"read-write": "allow all tools",
|
|
8
|
-
};
|
|
9
|
-
export function getRiskLevelDescription(level) {
|
|
10
|
-
switch (level) {
|
|
11
|
-
case "read-only":
|
|
12
|
-
return "read-only tools";
|
|
13
|
-
case "read-write":
|
|
14
|
-
return "all tools";
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export function getRiskLevelAutocompleteOptions(allowed) {
|
|
18
|
-
return allowed.map((level) => ({
|
|
19
|
-
id: level,
|
|
20
|
-
description: RISK_LEVEL_HELP_DESCRIPTIONS[level],
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
3
|
function formatSkillPath(fullPath, formatPath) {
|
|
24
4
|
return formatPath(dirname(dirname(fullPath)));
|
|
25
5
|
}
|
|
@@ -66,7 +46,7 @@ export class CommandRegistry {
|
|
|
66
46
|
}
|
|
67
47
|
buildHelpText(options = {}) {
|
|
68
48
|
const lines = [];
|
|
69
|
-
const { agentsFiles, skills,
|
|
49
|
+
const { agentsFiles, skills, themes } = options;
|
|
70
50
|
const formatPath = options.formatPath ?? formatPathForDisplay;
|
|
71
51
|
if (agentsFiles && agentsFiles.length > 0) {
|
|
72
52
|
lines.push("context:");
|
|
@@ -88,26 +68,12 @@ export class CommandRegistry {
|
|
|
88
68
|
}
|
|
89
69
|
const hasThemes = (themes?.length ?? 0) > 0;
|
|
90
70
|
const commands = this.list().filter((command) => command.argument !== "theme" || hasThemes);
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
baseCommands.forEach((command) => {
|
|
96
|
-
commandEntries.push([command.usage, command.description]);
|
|
97
|
-
});
|
|
98
|
-
if (riskCommand) {
|
|
99
|
-
const allowed = riskLevels ?? DEFAULT_RISK_LEVELS;
|
|
100
|
-
allowed.forEach((level) => {
|
|
101
|
-
const description = RISK_LEVEL_HELP_DESCRIPTIONS[level];
|
|
102
|
-
commandEntries.push([`/risk:${level}`, description]);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
trailingCommands.forEach((command) => {
|
|
106
|
-
commandEntries.push([command.usage, command.description]);
|
|
107
|
-
});
|
|
71
|
+
const commandEntries = commands.map((command) => [
|
|
72
|
+
command.usage,
|
|
73
|
+
command.description,
|
|
74
|
+
]);
|
|
108
75
|
const keyEntries = [
|
|
109
76
|
["shift+tab", "cycle reasoning effort"],
|
|
110
|
-
["ctrl+r", "cycle risk level"],
|
|
111
77
|
["ctrl+p", "cycle personality"],
|
|
112
78
|
["ctrl+t", "toggle thoughts visibility"],
|
|
113
79
|
["ctrl+o", "toggle compact tool UI"],
|
|
@@ -140,7 +106,6 @@ export function createCommandRegistry() {
|
|
|
140
106
|
description: "show this help",
|
|
141
107
|
autocompleteDescription: "show help",
|
|
142
108
|
argument: "none",
|
|
143
|
-
section: "base",
|
|
144
109
|
parse: (raw) => {
|
|
145
110
|
const { command, extra } = splitCommandInput(raw);
|
|
146
111
|
if (command !== "/help")
|
|
@@ -155,7 +120,6 @@ export function createCommandRegistry() {
|
|
|
155
120
|
description: "exit tau",
|
|
156
121
|
autocompleteDescription: "exit tau",
|
|
157
122
|
argument: "none",
|
|
158
|
-
section: "base",
|
|
159
123
|
allowDuringStreaming: true,
|
|
160
124
|
parse: (raw) => {
|
|
161
125
|
const { command, extra } = splitCommandInput(raw);
|
|
@@ -171,7 +135,6 @@ export function createCommandRegistry() {
|
|
|
171
135
|
description: "new session",
|
|
172
136
|
autocompleteDescription: "new session",
|
|
173
137
|
argument: "none",
|
|
174
|
-
section: "base",
|
|
175
138
|
parse: (raw) => {
|
|
176
139
|
const { command, extra } = splitCommandInput(raw);
|
|
177
140
|
if (command !== "/new")
|
|
@@ -186,7 +149,6 @@ export function createCommandRegistry() {
|
|
|
186
149
|
description: "rewind context to an earlier user message",
|
|
187
150
|
autocompleteDescription: "rewind context to a selected user message",
|
|
188
151
|
argument: "none",
|
|
189
|
-
section: "base",
|
|
190
152
|
parse: (raw) => {
|
|
191
153
|
const { command, extra } = splitCommandInput(raw);
|
|
192
154
|
if (command !== "/rewind")
|
|
@@ -201,7 +163,6 @@ export function createCommandRegistry() {
|
|
|
201
163
|
description: "open the local diff review tool for the session diff",
|
|
202
164
|
autocompleteDescription: "open diff review for git diff args",
|
|
203
165
|
argument: "none",
|
|
204
|
-
section: "base",
|
|
205
166
|
parse: (raw) => {
|
|
206
167
|
const { command, extra } = splitCommandInput(raw);
|
|
207
168
|
if (command !== "/diff")
|
|
@@ -216,7 +177,6 @@ export function createCommandRegistry() {
|
|
|
216
177
|
description: "summarize and start new session",
|
|
217
178
|
autocompleteDescription: "compact history to a summary",
|
|
218
179
|
argument: "none",
|
|
219
|
-
section: "base",
|
|
220
180
|
parse: (raw) => {
|
|
221
181
|
const { command, extra } = splitCommandInput(raw);
|
|
222
182
|
if (command !== "/compact:summary-only")
|
|
@@ -231,7 +191,6 @@ export function createCommandRegistry() {
|
|
|
231
191
|
description: "summarize and include previous last assistant message",
|
|
232
192
|
autocompleteDescription: "compact history, keep last assistant message",
|
|
233
193
|
argument: "none",
|
|
234
|
-
section: "base",
|
|
235
194
|
parse: (raw) => {
|
|
236
195
|
const { command, extra } = splitCommandInput(raw);
|
|
237
196
|
if (command !== "/compact:summary-and-last")
|
|
@@ -246,7 +205,6 @@ export function createCommandRegistry() {
|
|
|
246
205
|
description: "prune earliest tool results from context",
|
|
247
206
|
autocompleteDescription: "prune earliest tool results",
|
|
248
207
|
argument: "none",
|
|
249
|
-
section: "base",
|
|
250
208
|
parse: (raw) => {
|
|
251
209
|
const { command, extra } = splitCommandInput(raw);
|
|
252
210
|
if (command !== "/prune:earliest")
|
|
@@ -261,7 +219,6 @@ export function createCommandRegistry() {
|
|
|
261
219
|
description: "prune largest tool results from context",
|
|
262
220
|
autocompleteDescription: "prune largest tool results",
|
|
263
221
|
argument: "none",
|
|
264
|
-
section: "base",
|
|
265
222
|
parse: (raw) => {
|
|
266
223
|
const { command, extra } = splitCommandInput(raw);
|
|
267
224
|
if (command !== "/prune:largest")
|
|
@@ -276,7 +233,6 @@ export function createCommandRegistry() {
|
|
|
276
233
|
description: "prune tool results using model selection",
|
|
277
234
|
autocompleteDescription: "prune tool results with model selection",
|
|
278
235
|
argument: "none",
|
|
279
|
-
section: "base",
|
|
280
236
|
parse: (raw) => {
|
|
281
237
|
const { command, extra } = splitCommandInput(raw);
|
|
282
238
|
if (command !== "/prune:smart")
|
|
@@ -291,7 +247,6 @@ export function createCommandRegistry() {
|
|
|
291
247
|
description: "reload prompts, skills, themes, and AGENTS.md",
|
|
292
248
|
autocompleteDescription: "reload prompts, skills, themes, and AGENTS.md",
|
|
293
249
|
argument: "none",
|
|
294
|
-
section: "base",
|
|
295
250
|
parse: (raw) => {
|
|
296
251
|
const { command, extra } = splitCommandInput(raw);
|
|
297
252
|
if (command !== "/reload")
|
|
@@ -306,7 +261,6 @@ export function createCommandRegistry() {
|
|
|
306
261
|
description: "start voice recording and transcription",
|
|
307
262
|
autocompleteDescription: "start voice recording",
|
|
308
263
|
argument: "none",
|
|
309
|
-
section: "base",
|
|
310
264
|
allowDuringStreaming: true,
|
|
311
265
|
parse: (raw) => {
|
|
312
266
|
const { command, extra } = splitCommandInput(raw);
|
|
@@ -322,7 +276,6 @@ export function createCommandRegistry() {
|
|
|
322
276
|
description: "speak the last assistant message aloud",
|
|
323
277
|
autocompleteDescription: "speak the last assistant message",
|
|
324
278
|
argument: "none",
|
|
325
|
-
section: "base",
|
|
326
279
|
parse: (raw) => {
|
|
327
280
|
const { command, extra } = splitCommandInput(raw);
|
|
328
281
|
if (command !== "/speak")
|
|
@@ -337,7 +290,6 @@ export function createCommandRegistry() {
|
|
|
337
290
|
description: "copy last assistant message",
|
|
338
291
|
autocompleteDescription: "copy last assistant message",
|
|
339
292
|
argument: "none",
|
|
340
|
-
section: "base",
|
|
341
293
|
parse: (raw) => {
|
|
342
294
|
const { command, extra } = splitCommandInput(raw);
|
|
343
295
|
if (command !== "/copy:text")
|
|
@@ -352,7 +304,6 @@ export function createCommandRegistry() {
|
|
|
352
304
|
description: "copy code blocks from last assistant message",
|
|
353
305
|
autocompleteDescription: "copy code blocks from last assistant message",
|
|
354
306
|
argument: "none",
|
|
355
|
-
section: "base",
|
|
356
307
|
parse: (raw) => {
|
|
357
308
|
const { command, extra } = splitCommandInput(raw);
|
|
358
309
|
if (command !== "/copy:code")
|
|
@@ -361,30 +312,11 @@ export function createCommandRegistry() {
|
|
|
361
312
|
},
|
|
362
313
|
run: (ctx) => ctx.copyCode(),
|
|
363
314
|
});
|
|
364
|
-
registry.register({
|
|
365
|
-
id: "risk",
|
|
366
|
-
usage: "/risk:<level>",
|
|
367
|
-
description: "set risk level",
|
|
368
|
-
argument: "risk",
|
|
369
|
-
section: "risk",
|
|
370
|
-
parse: (raw) => {
|
|
371
|
-
const { command, extra } = splitCommandInput(raw);
|
|
372
|
-
const match = command.match(/^\/risk:(read-only|read-write)$/i);
|
|
373
|
-
if (!match)
|
|
374
|
-
return null;
|
|
375
|
-
const parsed = RiskLevelSchema.safeParse(match[1]?.toLowerCase());
|
|
376
|
-
if (!parsed.success)
|
|
377
|
-
return null;
|
|
378
|
-
return { type: "risk", level: parsed.data, extra };
|
|
379
|
-
},
|
|
380
|
-
run: (ctx, command) => ctx.risk(command.level),
|
|
381
|
-
});
|
|
382
315
|
registry.register({
|
|
383
316
|
id: "persona",
|
|
384
317
|
usage: "/persona:<id>",
|
|
385
318
|
description: "switch persona",
|
|
386
319
|
argument: "persona",
|
|
387
|
-
section: "trailing",
|
|
388
320
|
parse: (raw) => {
|
|
389
321
|
const { command, extra } = splitCommandInput(raw);
|
|
390
322
|
const match = command.match(/^\/persona:(.+)$/i);
|
|
@@ -400,7 +332,6 @@ export function createCommandRegistry() {
|
|
|
400
332
|
usage: "/prompt:<id>",
|
|
401
333
|
description: "insert prompt template",
|
|
402
334
|
argument: "prompt",
|
|
403
|
-
section: "trailing",
|
|
404
335
|
allowDuringStreaming: true,
|
|
405
336
|
parse: (raw) => {
|
|
406
337
|
const { command, extra } = splitCommandInput(raw);
|
|
@@ -417,7 +348,6 @@ export function createCommandRegistry() {
|
|
|
417
348
|
usage: "/theme:<id>",
|
|
418
349
|
description: "switch theme",
|
|
419
350
|
argument: "theme",
|
|
420
|
-
section: "trailing",
|
|
421
351
|
parse: (raw) => {
|
|
422
352
|
const { command, extra } = splitCommandInput(raw);
|
|
423
353
|
const match = command.match(/^\/theme:(.+)$/i);
|
|
@@ -433,7 +363,6 @@ export function createCommandRegistry() {
|
|
|
433
363
|
usage: "",
|
|
434
364
|
description: "",
|
|
435
365
|
argument: "none",
|
|
436
|
-
section: "base",
|
|
437
366
|
hidden: true,
|
|
438
367
|
parse: () => null,
|
|
439
368
|
run: (ctx, command) => ctx.unknown(command.raw),
|