@markusylisiurunen/tau 0.3.102 → 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/history/migrations.js +40 -0
- 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 -46
- package/dist/core/static/tau_docs/instructions-and-skills.md +81 -0
- package/dist/core/static/tau_docs/manifest.json +15 -21
- 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 -192
- 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 -282
- package/dist/core/version.js +1 -1
- package/dist/history/worker/index.js +16 -22
- package/dist/history/worker/index.js.map +1 -1
- package/dist/history/worker/migrations/0005_external_content.sql +58 -0
- package/dist/history/worker/migrations/0006_external_content_cutover.sql +44 -0
- package/package.json +2 -2
- package/dist/core/static/tau_docs/config-reference.md +0 -367
- 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-commands.md +0 -55
- package/dist/core/static/tau_docs/telegram-projects.md +0 -197
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# Prompts and project context
|
|
2
|
-
|
|
3
|
-
Tau has three ways to add instructions or reusable text to a session, and each enters at a different point:
|
|
4
|
-
|
|
5
|
-
- Prompt templates fill the editor when you ask for them.
|
|
6
|
-
- `AGENTS.md` files give standing project instructions.
|
|
7
|
-
- Hidden system blocks at the start of a user message add instructions for that one message.
|
|
8
|
-
|
|
9
|
-
None of these choose models or tools. [Personas](personas.md) set the base system prompt, model settings, and tools. Model-specific system notices are configured separately in the [configuration reference](config-reference.md).
|
|
10
|
-
|
|
11
|
-
## Prompt templates fill the editor
|
|
12
|
-
|
|
13
|
-
A prompt template is saved Markdown that Tau inserts into the TUI editor, where you can review and send it. It is never added to the system prompt and never runs by itself.
|
|
14
|
-
|
|
15
|
-
Tau discovers prompt files from:
|
|
16
|
-
|
|
17
|
-
| Scope | Location |
|
|
18
|
-
| ------- | ------------------------------- |
|
|
19
|
-
| Global | `~/.config/tau/prompts/<id>.md` |
|
|
20
|
-
| Project | `<level>/.tau/prompts/<id>.md` |
|
|
21
|
-
|
|
22
|
-
The global location applies only when the session's working directory is inside the execution environment's home directory. Tau searches project levels from the working directory up to home, or up to the filesystem root when outside home. The nearest project definition wins over parent and global ones. Prompt IDs are compared case-insensitively, both for precedence and for lookup.
|
|
23
|
-
|
|
24
|
-
A prompt's ID is its filename without `.md`. Each file needs YAML frontmatter with a non-empty `label`. For example, `release-summary.md`:
|
|
25
|
-
|
|
26
|
-
```markdown
|
|
27
|
-
---
|
|
28
|
-
label: release summary
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
Summarize the changes since the previous release. Separate user-visible changes from internal maintenance, and call out any migration steps.
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The `label` appears in TUI autocomplete and in the Telegram prompt picker. Unknown frontmatter fields are ignored. The Markdown body is the text inserted into the editor.
|
|
35
|
-
|
|
36
|
-
Only files ending in lowercase `.md` are found. Tau skips a file with a warning if its YAML is invalid, its frontmatter is not an object, or its label is missing or invalid.
|
|
37
|
-
|
|
38
|
-
### Invoke a prompt
|
|
39
|
-
|
|
40
|
-
In the TUI, invoke a prompt by ID:
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
/prompt:release-summary
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Tau replaces the editor text with the template body. It does not send the text, so you can edit it first. Lookup is case-insensitive.
|
|
47
|
-
|
|
48
|
-
The session stores only each prompt's ID and label. Tau reads the body from the execution environment each time `/prompt:<id>` runs. As a result:
|
|
49
|
-
|
|
50
|
-
- An edit to the body of a known prompt takes effect on its next use, without `/reload`.
|
|
51
|
-
- After adding, removing, or renaming a prompt, or changing its label, run `/reload` before autocomplete shows the change.
|
|
52
|
-
|
|
53
|
-
If the file is missing or invalid when Tau reads it, the command fails. Tau never falls back to an older copy of the body. An attached client always gets the prompt from the session's execution environment, never from a file with the same name on the client machine.
|
|
54
|
-
|
|
55
|
-
### Telegram prompts
|
|
56
|
-
|
|
57
|
-
In [Telegram](telegram.md), `/prompt` opens a picker with the active session's saved prompts, split into pages when there are many. `/prompt <id>` chooses a prompt [directly](telegram-commands.md#choose-a-persona-effort-or-prompt). Either way, Tau reads the prompt's current body and adds it to the session as a user message, without starting a turn. You can add a prompt only while the session is idle. Otherwise, wait for Tau to finish or use `/interrupt` first.
|
|
58
|
-
|
|
59
|
-
After a prompt is added, any open picker's buttons stop working and the bot shows the prompt text, split across more messages if needed. Send a normal message, such as details or “go”, to start the next turn with the prompt in context. In groups, that message must mention the bot as usual. Adding another prompt adds another message and does not replace the first. Added prompts survive session recovery.
|
|
60
|
-
|
|
61
|
-
Only the newest picker in a chat works. A picker belongs to the session that opened it and expires after a prompt is added, when the session is replaced, or when the runner restarts. Tapping twice does not add the prompt twice. Adding a prompt does not use up pending attachments or group context.
|
|
62
|
-
|
|
63
|
-
## `AGENTS.md` provides standing context
|
|
64
|
-
|
|
65
|
-
`AGENTS.md` files are added to the system prompt as project context. Use them for repository conventions, architecture boundaries, verification commands, and other instructions that apply to every request in the project.
|
|
66
|
-
|
|
67
|
-
Tau always reads `AGENTS.md` from the execution environment, also in a local session.
|
|
68
|
-
|
|
69
|
-
### Ancestor files are included in full
|
|
70
|
-
|
|
71
|
-
Starting at the session working directory, Tau checks each ancestor for `AGENTS.md`. When the working directory is inside home, the walk stops at home and includes home itself. Otherwise it stops at the filesystem root.
|
|
72
|
-
|
|
73
|
-
Each file found is included in full, nearest first, followed by those in parent directories. The agent sees both local and broader instructions. When they conflict, the more specific project guidance takes priority, within the agent's overall instruction hierarchy.
|
|
74
|
-
|
|
75
|
-
A file is included only if it resolves to a real file named exactly `AGENTS.md`, in a directory that is a parent or a subdirectory of the working directory. When the working directory is inside home, the resolved file must also be inside home. These checks stop a symlink from pulling in unrelated instructions from outside the session's directories.
|
|
76
|
-
|
|
77
|
-
### Descendant files are listed by path
|
|
78
|
-
|
|
79
|
-
Tau also looks below the working directory for nested `AGENTS.md` files. Their contents are not added automatically. Tau lists only their paths, so the agent knows more specific instructions exist and can read the right file before working in that subdirectory.
|
|
80
|
-
|
|
81
|
-
The scan is breadth-first, visits at most 8,192 directories, and goes at most 16 levels deep. It follows only directories whose resolved path stays under the working directory, and it does not loop on symlink cycles.
|
|
82
|
-
|
|
83
|
-
Tau skips these directory names at every level:
|
|
84
|
-
|
|
85
|
-
```text
|
|
86
|
-
.cache .git .hg .jj .next .nuxt .parcel-cache .svn .turbo
|
|
87
|
-
.venv .vite __pycache__ build coverage dist node_modules out
|
|
88
|
-
target vendor venv
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
When the scan starts at the home directory itself, Tau also skips these tool-managed directories directly under home:
|
|
92
|
-
|
|
93
|
-
```text
|
|
94
|
-
.bun .cargo .config .deno .gradle .local .m2 .npm .nvm
|
|
95
|
-
.pnpm-store .rustup .sdkman .yarn
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
It also skips `Library` directly under home on macOS, and `snap` on Linux. A directory with one of these names elsewhere is still scanned.
|
|
99
|
-
|
|
100
|
-
## Disable project context
|
|
101
|
-
|
|
102
|
-
Start Tau with:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
tau --no-agent-context-files
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
This turns off both the included `AGENTS.md` files and the list of nested ones. Personas, prompt templates, and [skills](skills.md) still work.
|
|
109
|
-
|
|
110
|
-
The option works for local TUI sessions and for hosts started with `tau serve`. In the Node SDK, `noAgentContextFiles: true` does the same for the host. An attached client cannot change this for a session that already exists on a remote host.
|
|
111
|
-
|
|
112
|
-
## Alternate subagent working directories
|
|
113
|
-
|
|
114
|
-
A subagent normally uses its parent's working directory and context. When `tau.agents.spawn` sets a different `workingDirectory`, Tau rebuilds the parts of the context that depend on the directory:
|
|
115
|
-
|
|
116
|
-
- environment and repository details
|
|
117
|
-
- the applicable `AGENTS.md` files
|
|
118
|
-
- the skills found from that directory
|
|
119
|
-
|
|
120
|
-
The persona, model catalog, model settings, and tool policy still come from the parent. A persona file in the other directory is not used. See [subagents](subagents.md) for details.
|
|
121
|
-
|
|
122
|
-
## Leading hidden system blocks
|
|
123
|
-
|
|
124
|
-
Tau recognizes one or more `<system>...</system>` blocks only when they start a user message and each closing tag is followed by a newline:
|
|
125
|
-
|
|
126
|
-
```text
|
|
127
|
-
<system>Use the deployment checklist for this response.</system>
|
|
128
|
-
Prepare the staging release.
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
The whole message is saved and sent to the model. When Tau displays the message, it hides the recognized blocks and shows the rest. A block anywhere else in the message, a malformed block, or a closing tag without the newline is shown as ordinary text.
|
|
132
|
-
|
|
133
|
-
Integrations can use this to give the model instructions for one message without showing them as the user's words. The blocks are not secret and do not control access: they are saved in the session and sent to the model. Put project-wide guidance in `AGENTS.md` and lasting persona behavior in the persona's system prompt.
|
|
134
|
-
|
|
135
|
-
## Reload and verify context
|
|
136
|
-
|
|
137
|
-
Run `/reload` in an idle session after changing prompts, skills, personas, configuration, or project context files. Reload reads everything again and rebuilds the system prompt for the active persona. It reports configuration warnings and how much content it loaded. Reload is refused while a turn is running.
|
|
138
|
-
|
|
139
|
-
For a new local session, debug mode prints the discovered content, the paths of loaded context files, tool schemas, and the system prompt, then exits:
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
tau --debug --persona release-coder
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Add `--no-agent-context-files` to see the result without project context. Debug mode works only for TUI startup, not with `tau serve`.
|
|
146
|
-
|
|
147
|
-
If expected context is missing, check the `cwd` and `home` of the execution environment, not the attached client's current directory. Then check exact filenames, the path rules above, scan exclusions, and reload warnings. See [troubleshooting](troubleshooting.md) for broader diagnostics.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# SDK browser diff review
|
|
2
|
-
|
|
3
|
-
`startTauSdkDiffReview()` starts Tau's built-in browser review UI for an observed SDK session, without the TUI and without opening a browser. It takes the diff in the session's execution environment, creates the same review agent context that `/diff` uses, starts preparing the review context and reviewer guide right away, and starts an HTTP server, on loopback by default.
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
import { startTauSdkDiffReview } from "@markusylisiurunen/tau/sdk";
|
|
7
|
-
|
|
8
|
-
const review = await startTauSdkDiffReview({
|
|
9
|
-
session,
|
|
10
|
-
source: {
|
|
11
|
-
kind: "git_diff",
|
|
12
|
-
diffArgs: ["main...HEAD"],
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
console.log(review.url);
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
const result = await review.result;
|
|
20
|
-
console.log(result);
|
|
21
|
-
} finally {
|
|
22
|
-
await review.close();
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
The source can instead be `{ kind: "patch_files", patchFiles, scopeLabel }`. Paths and Git arguments refer to the session's execution environment. A snapshot's patch can be at most 16 MiB; narrow the Git arguments or patch files if a larger diff is rejected. A plain working-tree snapshot includes non-binary untracked files of up to 4 MiB each, within that total. The optional `host`, `port`, and `signal` fields set where the HTTP server listens and let you cancel startup.
|
|
27
|
-
|
|
28
|
-
## Routing and lifecycle
|
|
29
|
-
|
|
30
|
-
The returned `url` is on the SDK client's machine and ends with a slash. Your service can expose it through a reverse proxy that handles authentication or access links. The browser app uses relative paths, so it works under a path prefix, as long as the public URL also ends with a slash. Your service is responsible for public authentication, routing, retention, and recovery.
|
|
31
|
-
|
|
32
|
-
The HTTP server has no authentication. The default loopback address suits a proxy on the same machine. Set a non-loopback `host` only inside a trusted network; otherwise keep it on loopback behind a protected proxy.
|
|
33
|
-
|
|
34
|
-
Always call `close()` when the review should no longer be available. It cancels the review if needed, closes the review agent context, and stops the HTTP server.
|
|
35
|
-
|
|
36
|
-
In the UI, **Submit** first opens a preview of the exact text to be returned, where the reviewer can exclude feedback and copy the full review. **Approve** returns right away when no feedback remains; if feedback appears while approval is being checked, the preview opens instead. The returned Markdown stands on its own: it names the reviewed scope, gives change-level comments their context, and explains who took part in each unresolved discussion and in what role.
|
|
37
|
-
|
|
38
|
-
`result` resolves once, with the outcome or the reason for cancellation. An approval and a review with comments are separate outcomes, so you never need to check for placeholder text:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
const result = await review.result;
|
|
42
|
-
if (result.status === "returned" && result.outcome === "approved") {
|
|
43
|
-
console.log("approved without comments");
|
|
44
|
-
} else if (result.status === "returned") {
|
|
45
|
-
console.log(result.review);
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Durable review state
|
|
50
|
-
|
|
51
|
-
By default, review annotations, transcripts, guide content and comments, and UI preferences are kept only in memory. Pass a `storage` adapter to save them:
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
const review = await startTauSdkDiffReview({
|
|
55
|
-
session,
|
|
56
|
-
source: { kind: "git_diff", diffArgs: ["main...HEAD"] },
|
|
57
|
-
storage: {
|
|
58
|
-
load: () => database.loadReviewState(reviewId),
|
|
59
|
-
save: (document) => database.saveReviewState(reviewId, document),
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
The stored document is a versioned Tau value of limited size. Store it as is, without reading or changing it. Tau saves each change before the HTTP request succeeds, and undoes the change if saving fails.
|
|
65
|
-
|
|
66
|
-
To restore, the stored document must be valid, supported by the running Tau version, and made for the same diff. "The same diff" covers the patch, file metadata, diff command and arguments, repository root, and working directory. If the state is invalid, unsupported, or for a different diff, `startTauSdkDiffReview()` rejects, instead of quietly starting empty. Your application then decides whether to keep, discard, or replace the document before trying again.
|
|
67
|
-
|
|
68
|
-
Saved state does not include loading indicators or review agent thread IDs. After a restore, the first follow-up question starts a new agent thread and gives it the saved conversation transcript.
|
|
69
|
-
|
|
70
|
-
## Durable submission
|
|
71
|
-
|
|
72
|
-
Use `onSubmit` when the submitted review must be saved before the browser is told it succeeded:
|
|
73
|
-
|
|
74
|
-
```ts
|
|
75
|
-
const review = await startTauSdkDiffReview({
|
|
76
|
-
session,
|
|
77
|
-
source: { kind: "git_diff", diffArgs: ["main...HEAD"] },
|
|
78
|
-
storage,
|
|
79
|
-
onSubmit: async (submission) => {
|
|
80
|
-
await database.acceptReviewOnce({
|
|
81
|
-
reviewId,
|
|
82
|
-
...submission,
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
An approved submission has `outcome: "approved"` and no `review` field. A commented submission has `outcome: "commented"` and a required `review` field. Both include `diffCommand` and `reviewedFiles`.
|
|
89
|
-
|
|
90
|
-
Each running review server allows only one submission at a time, and none after one succeeds. Tau waits for `onSubmit` to finish before reporting success and closing the review. If the callback fails, the reviewer can submit again.
|
|
91
|
-
|
|
92
|
-
Your application is responsible for recording the submission exactly once, for deciding whether a submitted review may be opened again, and for keeping or deleting stored state. A typical callback marks its own review record as submitted and queues follow-up work in one transaction.
|