@markusylisiurunen/tau 0.3.101 → 0.3.103
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 +18 -23
- package/dist/core/config/ownership.js +3 -1
- package/dist/core/config/ownership.js.map +1 -1
- package/dist/core/config/schema.js +3 -1
- package/dist/core/config/schema.js.map +1 -1
- package/dist/core/history/migrations.js +46 -1
- package/dist/core/history/migrations.js.map +1 -1
- package/dist/core/history/setup.js +24 -7
- package/dist/core/history/setup.js.map +1 -1
- package/dist/core/mcp/cli.js +1 -1
- package/dist/core/mcp/cli.js.map +1 -1
- package/dist/core/static/tau_docs/client-tools.md +46 -385
- package/dist/core/static/tau_docs/code-mode.md +104 -43
- package/dist/core/static/tau_docs/configuration.md +77 -171
- package/dist/core/static/tau_docs/getting-started.md +25 -96
- package/dist/core/static/tau_docs/history.md +30 -228
- package/dist/core/static/tau_docs/how-tau-works.md +53 -0
- package/dist/core/static/tau_docs/image-generation.md +15 -107
- package/dist/core/static/tau_docs/index.md +46 -45
- package/dist/core/static/tau_docs/instructions-and-skills.md +81 -0
- package/dist/core/static/tau_docs/manifest.json +15 -20
- package/dist/core/static/tau_docs/mcp.md +77 -0
- package/dist/core/static/tau_docs/models-and-credentials.md +67 -0
- package/dist/core/static/tau_docs/openrouter.md +31 -129
- package/dist/core/static/tau_docs/pdf-unpacking.md +8 -21
- package/dist/core/static/tau_docs/personas.md +48 -144
- package/dist/core/static/tau_docs/remote-sessions.md +33 -170
- package/dist/core/static/tau_docs/sdk.md +150 -0
- package/dist/core/static/tau_docs/security.md +6 -193
- package/dist/core/static/tau_docs/session-protocol.md +84 -246
- package/dist/core/static/tau_docs/sessions.md +41 -205
- package/dist/core/static/tau_docs/speech-generation.md +16 -129
- package/dist/core/static/tau_docs/subagents.md +57 -229
- package/dist/core/static/tau_docs/telegram.md +152 -220
- package/dist/core/static/tau_docs/tools.md +44 -167
- package/dist/core/static/tau_docs/troubleshooting.md +23 -217
- package/dist/core/static/tau_docs/tui.md +42 -276
- package/dist/core/subagents/claude_code_runner.mjs +65 -65
- package/dist/core/telegram/adapter.js +178 -61
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/telegram/cli.js +1 -3
- package/dist/core/telegram/cli.js.map +1 -1
- package/dist/core/telegram/config.js +3 -1
- package/dist/core/telegram/config.js.map +1 -1
- package/dist/core/telegram/runtime.js +1 -1
- package/dist/core/telegram/runtime.js.map +1 -1
- package/dist/core/utils/scribe_transcription.js +283 -0
- package/dist/core/utils/scribe_transcription.js.map +1 -0
- package/dist/core/utils/speech_cleanup.js +198 -0
- package/dist/core/utils/speech_cleanup.js.map +1 -0
- package/dist/core/utils/speech_to_text.js +3 -3
- package/dist/core/utils/speech_to_text_keywords.js +5 -4
- package/dist/core/utils/speech_to_text_keywords.js.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/diff_tool/app/dist/assets/{core-CXVpaOO1.js → core-Cnp6wBC7.js} +1 -1
- package/dist/diff_tool/app/dist/assets/engine-oniguruma-ConHyUk6.js +1 -0
- package/dist/diff_tool/app/dist/assets/{highlights-DuJNYjEh.js → highlights-DeO0fGqQ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/index-BDuQ2wXS.js +221 -0
- package/dist/diff_tool/app/dist/assets/langs-DDFHLNuJ.js +1 -0
- package/dist/diff_tool/app/dist/assets/{loader-bi21_x0K.js → loader-DrwOwtvp.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{preload-helper-CRzLMJPS.js → preload-helper-DclECHGd.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shiki-D6ZyrNQD.js → shiki-CwKGJZFi.js} +2 -2
- package/dist/diff_tool/app/dist/assets/{stream-tokenizer-BdsyU_yB.js → stream-tokenizer-D4-m26wx.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{themes-9lpTYI_i.js → themes-Do3waJhf.js} +2 -2
- package/dist/diff_tool/app/dist/index.html +2 -2
- package/dist/history/worker/index.js +83 -63
- package/dist/history/worker/index.js.map +1 -1
- package/dist/history/worker/migrations/0003_digest_schedule.sql +36 -0
- package/dist/history/worker/migrations/0004_recent_sessions.sql +1 -0
- package/dist/history/worker/migrations/0005_external_content.sql +58 -0
- package/dist/history/worker/migrations/0006_external_content_cutover.sql +44 -0
- package/dist/store/session_snapshot_migrations.js +14 -1
- package/dist/store/session_snapshot_migrations.js.map +1 -1
- package/dist/tui/chat_view.js +3 -1
- package/dist/tui/chat_view.js.map +1 -1
- package/dist/tui/listen_capture.js +7 -5
- package/dist/tui/listen_capture.js.map +1 -1
- package/dist/tui/session_chat_controller.js +93 -15
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/ui/custom_editor.js +3 -0
- package/dist/tui/ui/custom_editor.js.map +1 -1
- package/package.json +8 -7
- package/dist/core/static/tau_docs/config-reference.md +0 -355
- package/dist/core/static/tau_docs/credentials.md +0 -165
- package/dist/core/static/tau_docs/models.md +0 -57
- package/dist/core/static/tau_docs/node-sdk.md +0 -430
- package/dist/core/static/tau_docs/ownership-and-scope.md +0 -107
- package/dist/core/static/tau_docs/prompts-and-project-context.md +0 -147
- package/dist/core/static/tau_docs/sdk-diff-review.md +0 -92
- package/dist/core/static/tau_docs/session-protocol-methods.md +0 -655
- package/dist/core/static/tau_docs/skills.md +0 -135
- package/dist/core/static/tau_docs/telegram-projects.md +0 -197
- package/dist/core/utils/gemini_transcription.js +0 -566
- package/dist/core/utils/gemini_transcription.js.map +0 -1
- package/dist/diff_tool/app/dist/assets/engine-oniguruma-Rz_7DPcV.js +0 -1
- package/dist/diff_tool/app/dist/assets/index-F9is7PUw.js +0 -221
- package/dist/diff_tool/app/dist/assets/langs-CTftvgbb.js +0 -1
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
# Telegram
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Telegram runner connects Telegram bots to Tau sessions on the runner machine. Each session is an ordinary local session in a project workspace, with normal Tau configuration, personas, skills, and tools.
|
|
4
4
|
|
|
5
|
-
Anyone who can use a bot can cause model calls, file changes, and repository changes. Set up
|
|
5
|
+
Anyone who can use a bot can cause model calls, file changes, and repository changes. Set up the access lists before adding a bot to a group.
|
|
6
6
|
|
|
7
7
|
## Start the runner
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
tau telegram --config-file /etc/tau/telegram.json
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
The process stays in the foreground until `SIGINT` or `SIGTERM`. Relative `--config-file` paths resolve from the process working directory. Paths inside that file resolve as described below, usually from the config file's directory.
|
|
16
|
-
|
|
17
|
-
Add `--check-config` to validate the file and exit without starting the runner. It does not check tokens, directories, or repository access.
|
|
18
|
-
|
|
19
|
-
The Telegram file is **not** one of Tau's `config.json` levels. It configures the runner: bot tokens, startup settings, presets, projects, workspace roots, and routing. Tau still loads normal configuration from the runner's startup directory and from each session's workspace. See [configuration](configuration.md) and [ownership and scope](ownership-and-scope.md).
|
|
20
|
-
|
|
21
|
-
Run at most one runner per configuration and workspace root. Two runners would compete for Telegram updates, runner state, and workspace cleanup.
|
|
22
|
-
|
|
23
|
-
## Minimal configuration
|
|
24
|
-
|
|
25
|
-
A useful configuration defines at least one bot and one project:
|
|
9
|
+
Create a config file. It is separate from `config.json`:
|
|
26
10
|
|
|
27
11
|
```json
|
|
28
12
|
{
|
|
@@ -31,260 +15,208 @@ A useful configuration defines at least one bot and one project:
|
|
|
31
15
|
"engineering": {
|
|
32
16
|
"botToken": "<telegram-bot-token>",
|
|
33
17
|
"startup": { "source": "workspace" },
|
|
34
|
-
"allowedProjectIds": ["ledger"],
|
|
35
18
|
"allowedUserIds": [18422031],
|
|
36
19
|
"allowedChatIds": [18422031],
|
|
37
20
|
"defaultProjectId": "ledger"
|
|
38
21
|
}
|
|
39
22
|
},
|
|
40
23
|
"projects": {
|
|
41
|
-
"ledger": {
|
|
42
|
-
"repo": "acme/ledger",
|
|
43
|
-
"ref": "main"
|
|
44
|
-
}
|
|
24
|
+
"ledger": { "repo": "acme/ledger", "ref": "main" }
|
|
45
25
|
}
|
|
46
26
|
}
|
|
47
27
|
```
|
|
48
28
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## Top-level fields
|
|
54
|
-
|
|
55
|
-
| Field | Required | Behavior |
|
|
56
|
-
| --- | --- | --- |
|
|
57
|
-
| `bots` | Yes | Non-empty object keyed by a bot ID you choose. |
|
|
58
|
-
| `projects` | Yes | Object keyed by project ID. Bots select from these definitions. |
|
|
59
|
-
| `workspaceRoot` | No | Base for managed workspaces; defaults to `.tau/telegram-workspaces` beside the Telegram config file. |
|
|
60
|
-
| `maxSessions` | No | Positive integer cap on active sessions across the whole runner. |
|
|
61
|
-
|
|
62
|
-
A relative `workspaceRoot` resolves from the config file's directory. Tau saves runner session records in `<workspaceRoot>-sessions.json` and per-chat preferences in `<workspaceRoot>-project-preferences.json`. These are the runner's own state files; do not edit them. Sessions are saved in the usual place in the runner user's Tau home.
|
|
63
|
-
|
|
64
|
-
`maxSessions` counts queued, preparing, running, and waiting sessions across all bots. Failed sessions do not count, but stay visible to their chat until replaced or closed.
|
|
65
|
-
|
|
66
|
-
## Bots and access control
|
|
67
|
-
|
|
68
|
-
Each `bots.<id>` object supports:
|
|
69
|
-
|
|
70
|
-
| Field | Required | Behavior |
|
|
71
|
-
| --- | --- | --- |
|
|
72
|
-
| `botToken` | Yes | Telegram Bot API token. |
|
|
73
|
-
| `env` | No | Environment variables for this bot's workspace preparation and new sessions. See [bot environments](telegram-projects.md#bot-environments). |
|
|
74
|
-
| `allowedProjectIds` | No | Non-empty unique subset of configured project IDs; omission exposes all projects. |
|
|
75
|
-
| `autoCompactThresholdTokens` | No | Default automatic-compaction threshold for this bot's sessions. See [compaction thresholds](#compaction-thresholds). |
|
|
76
|
-
| `startup` | Yes | `{ "source": "workspace" }` or `{ "source": "preset", "preset": "<key>" }`. See [startup and presets](#startup-and-presets). |
|
|
77
|
-
| `presets` | No | Named choices that `/persona` offers. Omission offers all workspace personas, and `{}` offers none. |
|
|
78
|
-
| `allowedUserIds` | No | Integer user IDs allowed to trigger turns, commands, and callbacks. |
|
|
79
|
-
| `allowedChatIds` | No | Integer chat IDs allowed to interact with the bot; also opts groups in. |
|
|
80
|
-
| `defaultProjectId` | No | Initial project preference, and must be allowed for this bot. |
|
|
81
|
-
| `systemMessage` | No | Additional instruction for turns from this bot. |
|
|
82
|
-
|
|
83
|
-
The runner retries failed polling after 1,000 ms and uses a 30-second Telegram long-poll timeout.
|
|
84
|
-
|
|
85
|
-
A missing or empty `allowedUserIds` allows every user. A missing or empty `allowedChatIds` allows all DMs and no groups. A non-empty `allowedChatIds` allows only the listed DMs and groups. Group IDs are usually negative.
|
|
86
|
-
|
|
87
|
-
Use both lists for a private bot. `allowedUserIds` decides who can start work, but in an allowed group, messages from other users can still become context, labeled with their sender. Add the bot only to groups whose conversation is fine to send to the model.
|
|
88
|
-
|
|
89
|
-
A bot sees only its `allowedProjectIds`, or every project if the field is missing. If only one project is allowed, it is selected automatically and the command palette omits `/use_<project>` commands. The command still works when typed directly. Otherwise the palette includes project-switch commands, and a chat needs `defaultProjectId` or a `/use_<project>` choice before `/new`. Each startup replaces the palette, removing switch commands if the bot now has only one available project.
|
|
90
|
-
|
|
91
|
-
Telegram allows 100 commands per bot: thirteen built-ins and up to 87 `/use_<projectId>` commands. With `presets: {}`, `/persona` is hidden, which leaves room for one more project command.
|
|
92
|
-
|
|
93
|
-
## Projects
|
|
94
|
-
|
|
95
|
-
Each project tells the runner where a session works. There are three kinds:
|
|
96
|
-
|
|
97
|
-
- A **repository project** clones one GitHub repository into a new workspace for each session.
|
|
98
|
-
- A **persistent-directory project** reuses one existing directory for all of its sessions.
|
|
99
|
-
- A **composite project** combines several repository projects in one workspace.
|
|
100
|
-
|
|
101
|
-
[Telegram projects and workspaces](telegram-projects.md) describes project fields, workspace preparation, provision hooks, and recovery.
|
|
102
|
-
|
|
103
|
-
**Important:** at startup, the runner deletes everything under its managed workspace roots that no saved session uses. Give Tau a dedicated `workspaceRoot`; never use a home directory, a collection of repositories, or any directory with other content.
|
|
104
|
-
|
|
105
|
-
## Normal Tau configuration inside workspaces
|
|
106
|
-
|
|
107
|
-
After preparation, Tau creates an ordinary local session in the workspace. It reads `~/.config/tau` and the `.tau` directories above the workspace as usual, so personas, prompts, skills, project context, host tools, [MCP servers](config-reference.md#mcpservers), and other settings work as in the TUI.
|
|
108
|
-
|
|
109
|
-
The bot's `startup` selects a new session's settings, as described in [startup and presets](#startup-and-presets).
|
|
110
|
-
|
|
111
|
-
Every Telegram turn starts with a hidden `<system>` block saying the message comes from Telegram and the reply goes there. It asks for direct answers to simple questions, and for short acknowledgements or useful progress updates during longer work, because users cannot see tool activity.
|
|
112
|
-
|
|
113
|
-
Each message also carries its sender, as reported by Telegram. A DM turn gets a hidden block with the sender. In a group, the trigger message and each context message are labeled with their sender. Each queued attachment keeps the sender of the message that carried it. The sender is a JSON object with the numeric Telegram user ID and, when available, the display name and the username without the `@`, or `null` when Telegram does not identify one:
|
|
114
|
-
|
|
115
|
-
```json
|
|
116
|
-
{ "user-id": 123456789, "name": "Ada Lovelace", "username": "ada" }
|
|
29
|
+
```sh
|
|
30
|
+
tau telegram --config-file /etc/tau/telegram.json --check-config
|
|
31
|
+
tau telegram --config-file /etc/tau/telegram.json
|
|
117
32
|
```
|
|
118
33
|
|
|
119
|
-
The
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
##
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
34
|
+
`--check-config` validates the file without checking tokens or repository access. The file holds bot tokens, so protect it and never commit it. The runner stays in the foreground and refuses unknown fields. Run one runner per configuration and workspace root, and restart it after changing the file.
|
|
35
|
+
|
|
36
|
+
The runner needs `tau`, `git`, and a signed-in `gh` on its login-shell `PATH`, and model credentials like any [host](models-and-credentials.md). To check that it works, send `/status` and then `/new` in an allowed DM.
|
|
37
|
+
|
|
38
|
+
**Give the runner a dedicated `workspaceRoot`.** At startup, it deletes everything under that root that no saved session uses, so never point it at a home directory or a directory with other content.
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
type TelegramConfig = {
|
|
44
|
+
bots: Record<string, Bot>;
|
|
45
|
+
projects: Record<string, Project>; // IDs: lowercase, digits, "_", at most 28 characters
|
|
46
|
+
workspaceRoot?: string; // default .tau/telegram-workspaces beside this file
|
|
47
|
+
maxSessions?: number; // active sessions across all bots
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type Bot = {
|
|
51
|
+
botToken: string;
|
|
52
|
+
startup: { source: "workspace" } | { source: "preset"; preset: string };
|
|
53
|
+
presets?: Record<string, Preset>; // what /persona offers, {} hides it
|
|
54
|
+
allowedUserIds?: number[]; // empty or missing: every user
|
|
55
|
+
allowedChatIds?: number[]; // empty or missing: all DMs and no groups
|
|
56
|
+
allowedProjectIds?: string[]; // missing: all projects
|
|
57
|
+
defaultProjectId?: string;
|
|
58
|
+
systemMessage?: string; // added to each turn from this bot
|
|
59
|
+
speechCleanupStyle?: "off" | "default"; // clean up voice transcripts, default "off"
|
|
60
|
+
autoCompactThresholdTokens?: number;
|
|
61
|
+
env?: Record<string, string>; // see Bot environments
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type Preset =
|
|
65
|
+
| { source: "workspace"; label: string }
|
|
66
|
+
| {
|
|
67
|
+
source: "persona";
|
|
68
|
+
label: string;
|
|
69
|
+
persona: string;
|
|
70
|
+
reasoning?: Reasoning;
|
|
71
|
+
autoCompactThresholdTokens?: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type Project = { description?: string } & (
|
|
75
|
+
| { repo: string; ref?: string; workingDirectory?: string } // repo is GitHub "owner/name"
|
|
76
|
+
| { directory: string }
|
|
77
|
+
| {
|
|
78
|
+
projectIds: string[];
|
|
79
|
+
instructions?: string;
|
|
80
|
+
subagents?: { launchModels?: string[] };
|
|
81
|
+
}
|
|
82
|
+
);
|
|
156
83
|
```
|
|
157
84
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
## Startup and presets
|
|
161
|
-
|
|
162
|
-
`startup` decides how a bot's new sessions start, and `presets` decides what `/persona` offers. `startup` does not add a menu entry.
|
|
163
|
-
|
|
164
|
-
`startup` is required. `{ "source": "workspace" }` uses the workspace's `defaultPersona`, found through the same configuration layers as the TUI, including any effort suffix. To start with a named preset instead:
|
|
85
|
+
`startup` selects how a new session starts. `{ "source": "workspace" }` uses the workspace's `defaultPersona`, and a preset applies its persona and settings:
|
|
165
86
|
|
|
166
87
|
```json
|
|
167
|
-
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
88
|
+
{
|
|
89
|
+
"startup": { "source": "preset", "preset": "astra" },
|
|
90
|
+
"presets": {
|
|
91
|
+
"workspace": { "source": "workspace", "label": "Workspace default" },
|
|
92
|
+
"astra": {
|
|
93
|
+
"source": "persona",
|
|
94
|
+
"label": "Astra",
|
|
95
|
+
"persona": "gpt-6-astra-chat",
|
|
96
|
+
"reasoning": "low"
|
|
97
|
+
}
|
|
176
98
|
}
|
|
177
99
|
}
|
|
178
100
|
```
|
|
179
101
|
|
|
180
|
-
`
|
|
181
|
-
|
|
182
|
-
- A `workspace` preset resolves the workspace's `defaultPersona` each time it is applied.
|
|
183
|
-
- A `persona` preset names a persona ID without an effort suffix. Its optional `reasoning` is one of `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`, and defaults to the persona's own setting. Its optional `autoCompactThresholdTokens` is [described below](#compaction-thresholds).
|
|
184
|
-
|
|
185
|
-
Every preset needs a non-empty `label`. Keys must be non-empty, without surrounding whitespace.
|
|
186
|
-
|
|
187
|
-
The `/persona` menu depends on `presets`:
|
|
188
|
-
|
|
189
|
-
- Omitted: all personas available in the session's workspace, with their own labels and default settings.
|
|
190
|
-
- `{}`: nothing, and `/persona` is hidden from the command palette. Typing it replies that no presets are configured.
|
|
191
|
-
- With entries: exactly those entries, in the object's order. Integer-like keys sort first, so use non-numeric keys to keep the order you wrote.
|
|
192
|
-
|
|
193
|
-
Buttons show only labels, because a session does not record which preset was applied. `/status` reports the session's actual settings.
|
|
194
|
-
|
|
195
|
-
Applying a preset changes the prompt, model, tools, reasoning, and other persona settings together, and keeps the conversation. It applies them once, so effort commands then change only reasoning, and applying the preset again restores its settings.
|
|
196
|
-
|
|
197
|
-
An unavailable persona stays in the menu. Applying it, or a `reasoning` value the persona does not support, reports an error and changes no settings. The value must be in the persona's `allowedReasoningLevels` when that list is non-empty, and a model without reasoning accepts only `none`. A failing preset at `startup` fails the new session.
|
|
198
|
-
|
|
199
|
-
A workspace selection works as in the TUI: an unavailable `defaultPersona` falls back to the first available persona, and its effort suffix skips these checks.
|
|
200
|
-
|
|
201
|
-
Restart the runner after editing `startup` or `presets`. Recovery keeps a session's saved settings and does not reapply them. Reload keeps the session's settings if its persona still exists.
|
|
202
|
-
|
|
203
|
-
## Compaction thresholds
|
|
204
|
-
|
|
205
|
-
A bot's optional `autoCompactThresholdTokens` sets a default for its sessions. A persona preset's optional field of the same name sets a saved session override when the preset is applied, including at startup. Both take a safe integer of at least 50,000 tokens.
|
|
102
|
+
If you omit `presets`, `/persona` offers every persona in the workspace. A preset changes model, tools, and reasoning together and keeps the conversation. `/new` returns to `startup`.
|
|
206
103
|
|
|
207
|
-
|
|
104
|
+
## Access
|
|
208
105
|
|
|
209
|
-
|
|
106
|
+
For a private bot, use both lists. `allowedUserIds` decides who can start work, and `allowedChatIds` decides which DMs and groups the bot talks in. Group IDs are usually negative. Telegram display names do not grant anything.
|
|
210
107
|
|
|
211
|
-
|
|
108
|
+
In an allowed group, a message starts a turn only when it mentions the bot. The last 50 other messages are kept as context for the next turn, labeled with their sender, so add the bot only to groups whose conversation can be sent to the model.
|
|
212
109
|
|
|
213
|
-
##
|
|
214
|
-
|
|
215
|
-
In a DM, ordinary text goes to the active session. If none is selected but the chat has exactly one session, Tau selects it. Otherwise the bot asks for `/new`.
|
|
216
|
-
|
|
217
|
-
In an allowed group, a message starts a turn only when it mentions the bot's username. Other text and captions are kept as background context, labeled with their sender. At the next mention, Tau includes up to the 50 most recent kept messages since the last turn, and clears them once the turn is submitted.
|
|
218
|
-
|
|
219
|
-
Group context can include attachment paths, audio transcripts, and processing errors. The model receives it as untrusted input.
|
|
110
|
+
## Projects
|
|
220
111
|
|
|
221
|
-
|
|
112
|
+
Each session works in a project:
|
|
222
113
|
|
|
223
|
-
|
|
114
|
+
- A **repository project** clones one GitHub repository into a new workspace for each session. `workingDirectory` sets a subdirectory as the session's working directory.
|
|
115
|
+
- A **directory project** reuses one existing directory for all its sessions, so sessions from different chats can edit the same files at once. Tau never creates or removes the directory. Use an absolute path, because `~` is not expanded. Changing `directory` makes recovery of existing sessions fail.
|
|
116
|
+
- A **composite project** places two or more repository projects in one workspace, under a directory per project ID. Tau writes an `AGENTS.md` listing the members and any `instructions`. Configuration comes from the workspace root, and members' `.tau/config.json` files are not merged.
|
|
224
117
|
|
|
225
|
-
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"projects": {
|
|
121
|
+
"web": { "repo": "acme/web", "ref": "main" },
|
|
122
|
+
"api": { "repo": "acme/api" },
|
|
123
|
+
"notes": { "directory": "/srv/tau/notes" },
|
|
124
|
+
"platform": {
|
|
125
|
+
"projectIds": ["web", "api"],
|
|
126
|
+
"instructions": "Keep shared contracts synchronized."
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
226
131
|
|
|
227
|
-
|
|
132
|
+
If a bot allows one project, Tau selects it automatically. Otherwise the chat picks one with `/use_<projectId>` or gets `defaultProjectId`. Telegram allows 100 commands per bot, which leaves room for 90 project commands. Relative `workspaceRoot` and `directory` paths resolve from the config file's directory.
|
|
228
133
|
|
|
229
|
-
|
|
134
|
+
Sessions read `~/.config/tau` and the `.tau` directories above the workspace as usual. A project's `.tau/config.json` can start [MCP servers](mcp.md) on the runner machine, so review what you add as a project.
|
|
230
135
|
|
|
231
|
-
|
|
136
|
+
### Workspace lifecycle
|
|
232
137
|
|
|
233
|
-
|
|
138
|
+
Tau prepares a repository or composite workspace once per session, using a bare cache in `<workspaceRoot>-repo-cache`. Restarting the runner reuses the workspace as it is, so configuration changes apply only to workspaces prepared later. `/new` and closing a session delete the workspace, and Tau does not commit or push anything first. If a workspace is missing at recovery, Tau rebuilds it from the current configuration.
|
|
234
139
|
|
|
235
|
-
|
|
140
|
+
### Provision hooks
|
|
236
141
|
|
|
237
|
-
|
|
142
|
+
A repository can include an executable `.tau/scripts/provision` with a shebang. Tau runs it in the session's working directory in new and rebuilt workspaces, without blocking chat. A failure is reported to the chat and leaves the session usable. Directory projects do not run hooks.
|
|
238
143
|
|
|
239
|
-
##
|
|
144
|
+
## Chat commands
|
|
240
145
|
|
|
241
|
-
|
|
146
|
+
| Command | Behavior |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `/new` | Replace the active session using the preferred project. |
|
|
149
|
+
| `/use_<projectId>` | Select the project for future `/new` sessions. |
|
|
150
|
+
| `/status` | Show session state, project, model, reasoning, context use, and cost. |
|
|
151
|
+
| `/persona [key]` | Apply a persona or preset while idle, keeping the conversation. |
|
|
152
|
+
| `/effort [level]` | Set reasoning for future turns, also during a turn. |
|
|
153
|
+
| `/prompt [id]` | Add a saved prompt to the conversation without starting a turn. |
|
|
154
|
+
| `/auto_compact [tokens\|default]` | Show or set the compaction threshold. |
|
|
155
|
+
| `/compact` | Compact while idle. |
|
|
156
|
+
| `/interrupt` | Interrupt the running turn. |
|
|
157
|
+
| `/tts_on`, `/tts_off` | Turn voice replies on or off. |
|
|
242
158
|
|
|
243
|
-
|
|
159
|
+
`/persona`, `/effort`, and `/prompt` show buttons when sent alone. With a value they apply it directly, as in `/persona astra`, `/effort low`, or `/prompt release-summary`. A persona value is the preset key when the bot has `presets`, and otherwise the persona ID, never the button label. Values are case-sensitive.
|
|
244
160
|
|
|
245
|
-
|
|
161
|
+
In groups, commands must mention the bot, as in `/status@tau_engineering_bot`.
|
|
246
162
|
|
|
247
|
-
|
|
163
|
+
A message sent while Tau is working steers the running turn. Telegram has no way to queue a separate turn, so wait or use `/interrupt` before starting something unrelated. Users do not see tool activity, and only the agent's text is sent. Tau tells the agent this at the start of each turn.
|
|
248
164
|
|
|
249
|
-
|
|
165
|
+
## Files and voice
|
|
250
166
|
|
|
251
|
-
|
|
167
|
+
The bot accepts documents, photos, videos, and audio, up to 20 MiB per file, 100 MiB per turn, and 32 files per turn. Sending a file only queues it, and the next text or voice message starts a turn with the file paths. Files go to a temporary directory on the runner machine, where system cleanup can remove them.
|
|
252
168
|
|
|
253
|
-
|
|
169
|
+
Voice notes up to 20 minutes are transcribed with `ELEVENLABS_API_KEY`. With `speechCleanupStyle: "default"`, the transcript is also cleaned up as in the [TUI](tui.md#speech), which needs OpenAI credentials, and the raw transcript is used if cleanup fails. `/tts_on` needs OpenAI and ElevenLabs keys and `ffmpeg` with Opus on the runner. See [models and credentials](models-and-credentials.md).
|
|
254
170
|
|
|
255
|
-
|
|
171
|
+
The agent can send files back with these tools, which take `{ path, caption? }`:
|
|
256
172
|
|
|
257
|
-
|
|
173
|
+
| Tool | Delivery | Files | Maximum size |
|
|
174
|
+
| --------------------------- | --------------- | --------- | ------------ |
|
|
175
|
+
| `send_photo_to_telegram` | In-chat photo | JPEG, PNG | 10 MB |
|
|
176
|
+
| `send_video_to_telegram` | Playable video | MPEG4 | 50 MB |
|
|
177
|
+
| `send_audio_to_telegram` | Audio player | MP3, M4A | 50 MB |
|
|
178
|
+
| `send_document_to_telegram` | File attachment | Any | 50 MB |
|
|
258
179
|
|
|
259
|
-
|
|
260
|
-
2. Confirm the runner user can execute `tau`, `git`, and `gh`, and that `gh` can access each repository.
|
|
261
|
-
3. Start the runner and watch for config, polling, command-sync, cache, checkout, and recovery errors. Successful startup prints `tau telegram running`.
|
|
262
|
-
4. In an allowed DM, run `/status`, select a project if needed, then run `/new`.
|
|
263
|
-
5. Send a small, non-sensitive prompt and confirm the reply.
|
|
264
|
-
6. If groups are enabled, check that a message without a mention gets no reply and a command with a mention works.
|
|
265
|
-
7. If there is a provision hook, wait for it to finish or report a failure before relying on what it installs.
|
|
266
|
-
8. Restart the runner normally and use `/status` to confirm the session recovered without resending old replies.
|
|
180
|
+
Calls are not retried, because an interrupted upload may already have arrived. Tau does not convert files, so send unsupported media as a document. The workspace's `enabledClientTools` selects any configured [command tools](client-tools.md), and these run on the runner machine.
|
|
267
181
|
|
|
268
|
-
|
|
182
|
+
## Bot environments
|
|
269
183
|
|
|
270
|
-
|
|
184
|
+
Bots in one runner can use different environment variables, for example to give each bot its own GitHub account:
|
|
271
185
|
|
|
272
|
-
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"env": {
|
|
189
|
+
"GH_CONFIG_DIR": "/var/lib/assistant-github/gh",
|
|
190
|
+
"GIT_CONFIG_GLOBAL": "/var/lib/assistant-github/gitconfig",
|
|
191
|
+
"GH_TOKEN": "",
|
|
192
|
+
"GITHUB_TOKEN": ""
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
273
196
|
|
|
274
|
-
|
|
197
|
+
Sign in with `GH_CONFIG_DIR=/var/lib/assistant-github/gh gh auth login`. The Git config needs a commit identity and the credential helper:
|
|
275
198
|
|
|
276
|
-
|
|
199
|
+
```ini
|
|
200
|
+
[credential "https://github.com"]
|
|
201
|
+
helper =
|
|
202
|
+
helper = !gh auth git-credential
|
|
203
|
+
[user]
|
|
204
|
+
name = Assistant
|
|
205
|
+
email = assistant@example.com
|
|
206
|
+
```
|
|
277
207
|
|
|
278
|
-
|
|
208
|
+
The empty tokens stop `gh` from using a token in the runner's environment. The map applies to the bot's repository commands and to new sessions, and values are used literally, so use absolute paths. Tau saves the map in each session, so keep secrets out of it. It does not isolate bots from each other, because they share one OS user. Use separate runners under separate accounts when bots must be isolated.
|
|
279
209
|
|
|
280
|
-
|
|
210
|
+
A saved session whose map differs from the bot's current `env` fails recovery. Restore the old `env`, or start over with `/new`, which deletes a repository workspace, so save unfinished work first.
|
|
281
211
|
|
|
282
|
-
|
|
212
|
+
## Restarts
|
|
283
213
|
|
|
284
|
-
|
|
214
|
+
A normal shutdown interrupts running work and disconnects sessions. After a restart, sessions reconnect with their conversation, and unsent failure notices are delivered. A message that Tau never accepted is reported so you can resend it. Do not edit the runner's state files, `<workspaceRoot>-sessions.json` and `<workspaceRoot>-project-preferences.json`.
|
|
285
215
|
|
|
286
|
-
|
|
216
|
+
## When the bot ignores you
|
|
287
217
|
|
|
288
|
-
**
|
|
218
|
+
- **In a DM:** check that the chat and the sender are in the allowlists that are set.
|
|
219
|
+
- **In a group:** the group must be in `allowedChatIds`, the message must mention the bot, and the sender must be in `allowedUserIds` when that is set.
|
|
220
|
+
- **`/new` asks for a project:** set `defaultProjectId` or run `/use_<projectId>`.
|
|
289
221
|
|
|
290
|
-
|
|
222
|
+
The runner log names the failing step for repository preparation, attachments, and delivery.
|