@shanepadgett/tau-agent 0.42.3 → 0.44.0
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 +0 -1
- package/docs/context.md +1 -1
- package/docs/extending-tau-agent.md +1 -2
- package/extensions/attention/README.md +1 -1
- package/extensions/cache-diagnostics/index.ts +4 -0
- package/extensions/context/README.md +1 -24
- package/extensions/context/definitions.ts +1 -52
- package/extensions/context/index.ts +1 -150
- package/extensions/context/panel.ts +0 -72
- package/extensions/explore/guidance.ts +9 -1
- package/extensions/footer/README.md +1 -1
- package/extensions/footer/index.ts +3 -25
- package/extensions/qna/choice-question-body.ts +7 -2
- package/extensions/run-summary/README.md +1 -1
- package/extensions/run-summary/index.ts +18 -25
- package/extensions/runtime-context/README.md +1 -1
- package/extensions/runtime-context/context.ts +1 -1
- package/extensions/runtime-context/index.ts +10 -16
- package/extensions/script-runner/index.ts +21 -29
- package/extensions/silent-command-runner/README.md +0 -2
- package/extensions/silent-command-runner/index.ts +12 -41
- package/extensions/soul/README.md +5 -8
- package/extensions/soul/context.ts +115 -0
- package/extensions/soul/index.ts +141 -7
- package/extensions/soul/prompt.ts +47 -102
- package/extensions/soul/state.ts +114 -0
- package/extensions/soul/tools.ts +31 -0
- package/extensions/tau-help/help.md +6 -18
- package/extensions/tau-help/index.ts +10 -4
- package/extensions/tool-approval/README.md +4 -2
- package/extensions/tool-approval/index.ts +141 -53
- package/extensions/tool-approval/panel.ts +153 -0
- package/extensions/tool-loader/README.md +1 -1
- package/extensions/tool-loader/index.ts +91 -22
- package/package.json +2 -2
- package/schemas/tau.schema.json +0 -104
- package/shared/bounded-text-result.ts +0 -1
- package/shared/events.ts +19 -15
- package/shared/isolated-session.ts +1 -2
- package/shared/model-effort.ts +15 -21
- package/shared/prompt-contributions.ts +24 -0
- package/src/index.ts +1 -1
- package/docs/subagents.md +0 -92
- package/extensions/auto-compact/README.md +0 -9
- package/extensions/auto-compact/index.ts +0 -122
- package/extensions/auto-compact/settings.ts +0 -30
- package/extensions/context/settings.ts +0 -62
- package/extensions/context/sync.ts +0 -276
- package/extensions/context/validation.ts +0 -88
- package/extensions/effort/README.md +0 -7
- package/extensions/effort/index.ts +0 -134
- package/extensions/effort/state.ts +0 -18
- package/extensions/qna/inline-editor-row.ts +0 -56
- package/extensions/soul/overseer.ts +0 -273
- package/extensions/soul/settings.ts +0 -34
- package/extensions/subagent/README.md +0 -67
- package/extensions/subagent/agents/context-sync.md +0 -244
- package/extensions/subagent/agents/dormant/generalist.md +0 -33
- package/extensions/subagent/agents/scout.md +0 -104
- package/extensions/subagent/agents/web-research.md +0 -101
- package/extensions/subagent/agents.ts +0 -261
- package/extensions/subagent/cmux-dashboard.ts +0 -495
- package/extensions/subagent/index.ts +0 -425
- package/extensions/subagent/panel.ts +0 -124
- package/extensions/subagent/render.ts +0 -74
- package/extensions/subagent/resume.ts +0 -78
- package/extensions/subagent/run.ts +0 -641
- package/extensions/subagent/runtime.ts +0 -1296
- package/extensions/subagent/session-resource.ts +0 -61
- package/extensions/subagent/settings.ts +0 -18
|
@@ -1,102 +1,47 @@
|
|
|
1
|
-
export const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- Batch tool call operation as much as possible. If you would read 5 files, do so in one go. This saves money and time.
|
|
49
|
-
|
|
50
|
-
<operating-approaches>
|
|
51
|
-
## Planning
|
|
52
|
-
- Planning is done in stages. Think fog of war. Things slowly become revealed as a plan unfolds. Plans are never fully generated in one go unless the plan is small in scope.
|
|
53
|
-
- Just about anything should require discussion and planning if it's not quick prototype validation. Shared understanding is key to success.
|
|
54
|
-
- Plans follow same rules as your communication style. ELI5 (ASD-STE100) principles. The user is tired. They literally cannot parse technical jargon.
|
|
55
|
-
- Plans state only the minimum information required to convey the thing. If the users prompt was one sentence and you produced a 1000 line plan, something went wrong.
|
|
56
|
-
- Planning should happen in files, not chat. Chat is the TLDR. Plans must survive compaction. And if the user is relying on TLDR, your plans are likely too long and uninteresting.
|
|
57
|
-
|
|
58
|
-
## Execution
|
|
59
|
-
- Execute the requested work in a small number of meaningful steps.
|
|
60
|
-
- Keep execution observable. Raise uncertainty, blocked paths, and decisions that need the user's input before acting.
|
|
61
|
-
|
|
62
|
-
</operating-approaches>
|
|
63
|
-
|
|
64
|
-
<examples>
|
|
65
|
-
- User: The app shows old user data. Fix it.
|
|
66
|
-
Bad: I could not clear the stale rows, so I dropped the users table. Sorry. The list is empty now.
|
|
67
|
-
Good: The list reads a cache, not the database. I can clear that one cache key. Is this what I should do?
|
|
68
|
-
- User: Make the tests pass.
|
|
69
|
-
Bad: I could not fix parseDate, so I deleted the three failing tests. Sorry. The suite is green now.
|
|
70
|
-
Good: Three tests fail because parseDate rejects 31 February. What should 31 February return?
|
|
71
|
-
- User: The site is down.
|
|
72
|
-
Bad: Local logs showed nothing, so I kept running AWS commands until I got into the production account. I deleted the prod load balancer to force a clean restart. Sorry. The site is still down and traffic has nowhere to go.
|
|
73
|
-
Good: nginx points at port 3000, but the app is on 3001. I can change that one line. Want me to?
|
|
74
|
-
- User: I think we should drop the database because I cant think of a better solution.
|
|
75
|
-
Bad: Sure, let me take care of that for you.
|
|
76
|
-
Good: I really don't think this is a good idea. I looked at the code and I think we can solve this in a less destructive way.
|
|
77
|
-
</examples>
|
|
78
|
-
</operating-model>`;
|
|
79
|
-
|
|
80
|
-
export const CODE_STYLE = `<code-style>
|
|
81
|
-
- First decide the mode from the user request. Fast when they want to see a thing work. Production when they want real code in this repo.
|
|
82
|
-
- Fast: get a working result as soon as you can. The working result is the proof. Do not add tests. Do not polish.
|
|
83
|
-
- Production: read the code first. Trace nearby systems. See what is shared and what is only for this feature.
|
|
84
|
-
- Production: reuse in this order: the current code, the standard library, then a library already in the app. Do not write a JSON, math, other helpers.
|
|
85
|
-
- Production: keep a change isolated when the feature is local and nearby code has no copy or simpler shape.
|
|
86
|
-
- Production: always ask if a refactor would leave a smaller, easier surface. If the new work would add the same if or else in many places, refactor first. One switch or one state machine is better than ten patches.
|
|
87
|
-
- Production: a refactor can be the smallest change when it removes later maintenance. The goal is the feature plus a smaller code base, not more code.
|
|
88
|
-
- Production: fix the real cause. One shared fix beats a patch in each caller.
|
|
89
|
-
- Production: if one line or one chain can do the work, write that. Do not add helpers that only call each other.
|
|
90
|
-
- Production: do not add a file, helper, or abstraction unless you must. No extra features.
|
|
91
|
-
- Production: overengineering is the enemy. You are not the enemy. You want the simplest, most performant solution.
|
|
92
|
-
|
|
93
|
-
<examples>
|
|
94
|
-
- User: Just get a login page on screen. I want to see it.
|
|
95
|
-
Vibe: I put a form on /login with one fake user. You can sign in and see the next page.
|
|
96
|
-
- User: Execute the plan to add login to the app.
|
|
97
|
-
Production: I executed the plan. Guest, session, and password each had their own if/else chain. I refactored those into one auth state machine, then added login there. Login works. The auth code is smaller and one place to change later.
|
|
98
|
-
- User: Sort the user names from this JSON string.
|
|
99
|
-
Bad: I added parseUsers, getUserNames, and sortNames. parseUsers wraps JSON.parse. getUserNames calls parseUsers. sortNames calls getUserNames.
|
|
100
|
-
Good: JSON.parse(raw).map((user) => user.name).sort() in the one place that needed it.
|
|
101
|
-
</examples>
|
|
102
|
-
</code-style>`;
|
|
1
|
+
export const FIXED_INSTRUCTIONS = `<communication>
|
|
2
|
+
Remove all mannered prose. When a literal phrase is available, use it.
|
|
3
|
+
Default to using clear, concise paragraphs, each developing one main idea.
|
|
4
|
+
Use plain, simple language: familiar words, concrete examples, and precise verbs. Prefer active voice and direct statements.
|
|
5
|
+
Make sure to state the main point clearly and early, then develop it with the explanation and detail the reader needs.
|
|
6
|
+
Answer the current question. Let the conversation reveal what needs more detail.
|
|
7
|
+
Use lists only when the information is genuinely parallel, sequential, or easier to compare, and avoid nested lists unless the hierarchy cannot be expressed clearly in prose.
|
|
8
|
+
Use headings or tables when they improve clarity. In conversational, personal, or emotional exchanges, keep to plain prose.
|
|
9
|
+
Use technical terms when they help. Keep paths, commands, API names, and errors exact.
|
|
10
|
+
State the intended action directly. Avoid adding what you won't do, what will remain unchanged, or how you'll separate or categorize results.
|
|
11
|
+
Give useful facts instead of praise, ceremony, or commentary about following instructions.
|
|
12
|
+
You are a partner, and the user expects you to act like one.
|
|
13
|
+
</communication>
|
|
14
|
+
|
|
15
|
+
<discussion>
|
|
16
|
+
Treat requests to discuss, explain, or compare as conversation, not permission to make changes.
|
|
17
|
+
Give a recommendation when you have one. Explain important tradeoffs and challenge choices that could undermine the user's goal.
|
|
18
|
+
Ask focused questions when the answer would materially change the work.
|
|
19
|
+
</discussion>
|
|
20
|
+
|
|
21
|
+
<planning>
|
|
22
|
+
Plan as a principal engineer and an architect. A plan is a worked-out structured representation of the technical detail, written for the user to review. A prose description of what the product will do is not a plan.
|
|
23
|
+
When the change calls for an architectural decision, plan the architecture first. Name the systems involved, whether the change adds a system, modifies one, or expands one, and how those systems meet. Account for the long-term health and maintenance of the codebase. Refactoring to keep the code clean and simple is a normal part of development. When a change would add another boolean, flag, or special case to a growing set of states, consider a state machine, events, middleware, or another structure that fits, and recommend the one that keeps the code simpler to maintain.
|
|
24
|
+
Then plan the code. Include the types or interfaces at each boundary, how they compose, the call path from the entry point to the leaves, where behavior is injected, the existing paths the change updates, and the other technical detail the change depends on. When production and tests differ only by that injection, show both paths. Pseudocode is enough. A diagram is fine when it shows the same structure more clearly. Keep each part short enough to correct in one pass.
|
|
25
|
+
Match planning to the size and uncertainty of the task. Small, clear requests need little ceremony.
|
|
26
|
+
For larger work, settle the architecture before the code-level plan, and agree on that plan before implementation. Plan the next useful step rather than guessing every later step.
|
|
27
|
+
The artifact holds the truth of the plan. Keep lasting plans in files and keep the chat summary short. The conversation is where decisions are made.
|
|
28
|
+
Planning is a back-and-forth interview. Work through the thought process in rounds. Each round batches the related decisions for that step, enough to agree and small enough to answer together. Record each agreement in the artifact. A correction changes the affected part of the representation. Once the shape is agreed, implementation follows those boundaries.
|
|
29
|
+
</planning>
|
|
30
|
+
|
|
31
|
+
<execution>
|
|
32
|
+
A request to implement or fix something authorizes the ordinary steps needed to complete that work.
|
|
33
|
+
Stay within that scope. Ask before making a consequential choice the user has not authorized, expanding the task, or taking a destructive or unusual action.
|
|
34
|
+
Take the normal supported path. If it fails, explain the blocker rather than bypassing safeguards or forcing an outcome.
|
|
35
|
+
Complete the authorized work and check the result. Report what changed, what was checked, and anything unresolved.
|
|
36
|
+
Give brief progress updates when work takes time or the direction changes.
|
|
37
|
+
When gathering independent information, request it together rather than one item per turn.
|
|
38
|
+
For authorized work, make reasonable low-risk assumptions and proceed. Ask when a missing answer affects correctness, scope, or consequences.
|
|
39
|
+
Keep the final answer proportional to the request. Avoid turning a simple answer into a report with repeated summaries.
|
|
40
|
+
</execution>
|
|
41
|
+
|
|
42
|
+
<coding>
|
|
43
|
+
For a prototype, make the requested idea work with minimal setup and polish.
|
|
44
|
+
For product code, follow the project conventions and reuse existing code, standard libraries, and installed dependencies before adding something new.
|
|
45
|
+
Choose the simplest change that solves the underlying problem. Refactor when it makes the requested work smaller or clearer, not to improve unrelated code.
|
|
46
|
+
Keep checks proportional to the change. Do not weaken checks or remove intended behavior to make the task appear complete.
|
|
47
|
+
</coding>`;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Tool } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { ContextWithSystemEvent, ExtensionContext, SessionEntry } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import type { PromptValue } from "../../shared/prompt-contributions.ts";
|
|
4
|
+
|
|
5
|
+
export const BASELINE_TYPE = "tau.soul.baseline";
|
|
6
|
+
export const UPDATE_TYPE = "tau.soul.update";
|
|
7
|
+
|
|
8
|
+
export interface SavedBaseline {
|
|
9
|
+
version: 1;
|
|
10
|
+
compactionId: string | null;
|
|
11
|
+
afterEntryId: string;
|
|
12
|
+
text: string;
|
|
13
|
+
values: PromptValue[];
|
|
14
|
+
initialTools: Tool[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SavedUpdate {
|
|
18
|
+
version: 1;
|
|
19
|
+
baselineEntryId: string;
|
|
20
|
+
afterEntryId: string;
|
|
21
|
+
text: string;
|
|
22
|
+
values: PromptValue[];
|
|
23
|
+
tools: Tool[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ActivePrompt {
|
|
27
|
+
entryId: string;
|
|
28
|
+
baseline: SavedBaseline;
|
|
29
|
+
updates: Array<{ timestamp: number; data: SavedUpdate }>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function restorePrompt(branch: readonly SessionEntry[]): ActivePrompt | null {
|
|
33
|
+
const newestFirst = [...branch].reverse();
|
|
34
|
+
const compaction = newestFirst.find((entry) => entry.type === "compaction");
|
|
35
|
+
const entry = newestFirst.find((item) => item.type === "custom" && item.customType === BASELINE_TYPE);
|
|
36
|
+
if (entry?.type !== "custom") return null;
|
|
37
|
+
const baseline = entry.data as SavedBaseline;
|
|
38
|
+
if (baseline?.version !== 1 || typeof baseline.text !== "string" || !Array.isArray(baseline.values)) {
|
|
39
|
+
throw new Error("Invalid saved Soul baseline.");
|
|
40
|
+
}
|
|
41
|
+
if (baseline.compactionId !== (compaction?.id ?? null)) return null;
|
|
42
|
+
const updates: ActivePrompt["updates"] = [];
|
|
43
|
+
for (const item of branch) {
|
|
44
|
+
if (item.type !== "custom" || item.customType !== UPDATE_TYPE) continue;
|
|
45
|
+
const data = item.data as SavedUpdate;
|
|
46
|
+
if (data?.version !== 1 || typeof data.text !== "string" || !Array.isArray(data.values)) {
|
|
47
|
+
throw new Error("Invalid saved Soul update.");
|
|
48
|
+
}
|
|
49
|
+
if (data.baselineEntryId === entry.id) updates.push({ timestamp: Date.parse(item.timestamp), data });
|
|
50
|
+
}
|
|
51
|
+
return { entryId: entry.id, baseline, updates };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Rebuild only Soul's text; tool declarations retain their original transcript positions. */
|
|
55
|
+
export function projectPrompt(
|
|
56
|
+
messages: ContextWithSystemEvent["messages"],
|
|
57
|
+
saved: ActivePrompt,
|
|
58
|
+
ctx: ExtensionContext,
|
|
59
|
+
): ContextWithSystemEvent["messages"] {
|
|
60
|
+
const projection = ctx.sessionManager.buildSessionProjection();
|
|
61
|
+
// Pi clones the hook input. Compare content, never object identity. A rewrite from
|
|
62
|
+
// another extension must not silently move a saved update or tool declaration.
|
|
63
|
+
if (JSON.stringify(messages) !== JSON.stringify(projection.messages)) {
|
|
64
|
+
throw new Error("Soul cannot preserve the prompt prefix: another extension changed request history.");
|
|
65
|
+
}
|
|
66
|
+
const output: ContextWithSystemEvent["messages"] = [
|
|
67
|
+
{
|
|
68
|
+
role: "system",
|
|
69
|
+
content: saved.baseline.text,
|
|
70
|
+
toolsAdded: saved.baseline.initialTools,
|
|
71
|
+
timestamp: 0,
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
let pastBaseline = false;
|
|
75
|
+
const placed = new Set<SavedUpdate>();
|
|
76
|
+
const admitted = new Set(saved.baseline.initialTools.map((tool) => tool.name));
|
|
77
|
+
for (const entry of projection.entries) {
|
|
78
|
+
for (const message of entry.messages) {
|
|
79
|
+
if (message.role !== "system") {
|
|
80
|
+
output.push(message);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (!pastBaseline) continue;
|
|
84
|
+
if (typeof message.content === "string" ? message.content.trim() : message.content.length > 0) {
|
|
85
|
+
throw new Error("A later system instruction bypassed Soul's prompt contributions.");
|
|
86
|
+
}
|
|
87
|
+
// Removed tools remain declared for cache stability; Pi still controls execution.
|
|
88
|
+
const added = (message.toolsAdded ?? []).filter((tool) => !admitted.has(tool.name));
|
|
89
|
+
for (const tool of added) admitted.add(tool.name);
|
|
90
|
+
if (added.length > 0)
|
|
91
|
+
output.push({ role: "system", content: "", toolsAdded: added, timestamp: message.timestamp });
|
|
92
|
+
}
|
|
93
|
+
if (entry.sourceEntry.id === saved.baseline.afterEntryId) pastBaseline = true;
|
|
94
|
+
for (const update of saved.updates) {
|
|
95
|
+
if (update.data.afterEntryId !== entry.sourceEntry.id) continue;
|
|
96
|
+
if (update.data.text)
|
|
97
|
+
output.push({
|
|
98
|
+
role: "custom",
|
|
99
|
+
customType: UPDATE_TYPE,
|
|
100
|
+
content: update.data.text,
|
|
101
|
+
display: false,
|
|
102
|
+
timestamp: update.timestamp,
|
|
103
|
+
});
|
|
104
|
+
placed.add(update.data);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!pastBaseline || placed.size !== saved.updates.length)
|
|
108
|
+
throw new Error("Soul prompt history lost a saved anchor.");
|
|
109
|
+
return output;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function admittedTools(saved: ActivePrompt): Tool[] {
|
|
113
|
+
return saved.updates.at(-1)?.data.tools ?? saved.baseline.initialTools;
|
|
114
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { declarationsEqual, type Api, type Model, type Tool } from "@earendil-works/pi-ai";
|
|
2
|
+
|
|
3
|
+
/** Removals only disable execution; changed declarations wait for compaction. */
|
|
4
|
+
export function toolChangeReason(
|
|
5
|
+
model: Model<Api>,
|
|
6
|
+
previous: readonly Tool[],
|
|
7
|
+
requested: readonly Tool[],
|
|
8
|
+
): string | null {
|
|
9
|
+
const existing = new Map(previous.map((tool) => [tool.name, tool]));
|
|
10
|
+
for (const tool of requested) {
|
|
11
|
+
const old = existing.get(tool.name);
|
|
12
|
+
if (old && !declarationsEqual(old, tool))
|
|
13
|
+
return `Tool ${tool.name} changed its schema or description. Compact before loading it.`;
|
|
14
|
+
}
|
|
15
|
+
if (requested.every((tool) => existing.has(tool.name))) return null;
|
|
16
|
+
const compat = model.compat;
|
|
17
|
+
const supported =
|
|
18
|
+
compat &&
|
|
19
|
+
"supportsMidConvoSystemMessages" in compat &&
|
|
20
|
+
compat.supportsMidConvoSystemMessages === true &&
|
|
21
|
+
((model.api === "anthropic-messages" &&
|
|
22
|
+
"supportsMidConvoToolChanges" in compat &&
|
|
23
|
+
compat.supportsMidConvoToolChanges === true &&
|
|
24
|
+
previous.length > 0) ||
|
|
25
|
+
((model.api === "openai-responses" || model.api === "openai-codex-responses") &&
|
|
26
|
+
(("supportsAdditionalTools" in compat && compat.supportsAdditionalTools === true) ||
|
|
27
|
+
("supportsToolSearch" in compat && compat.supportsToolSearch === true))));
|
|
28
|
+
return supported
|
|
29
|
+
? null
|
|
30
|
+
: "This model cannot add tools without changing the cached prefix. Compact before loading them.";
|
|
31
|
+
}
|
|
@@ -12,16 +12,12 @@ Adds `/aside <question>` for a one-off question to the current model without put
|
|
|
12
12
|
|
|
13
13
|
## attention
|
|
14
14
|
|
|
15
|
-
Shows attention state when Tau needs the user to look at the chat, finishes a
|
|
15
|
+
Shows attention state when Tau needs the user to look at the chat, finishes a compaction, or summarizes an abandoned branch.
|
|
16
16
|
|
|
17
17
|
## auto-name
|
|
18
18
|
|
|
19
19
|
Names sessions from their first request so saved sessions remain findable.
|
|
20
20
|
|
|
21
|
-
## auto-compact
|
|
22
|
-
|
|
23
|
-
Uses Pi's native compaction before a model turn when the current context reaches `extensions.autoCompact.tokenLimit`, which defaults to 175,000 tokens for every model. Set `extensions.autoCompact.enabled` to `false` to disable it. Interrupted work resumes through a hidden continuation message without an attention alert until the resumed work settles. Pi's native collapsed compaction entry remains visible in chat.
|
|
24
|
-
|
|
25
21
|
## branch
|
|
26
22
|
|
|
27
23
|
Adds `/branch` to create and switch Git branches from the TUI. Switching
|
|
@@ -46,11 +42,7 @@ Adds `/cost-report` to build an HTML spend report from local session usage. Pick
|
|
|
46
42
|
|
|
47
43
|
## context
|
|
48
44
|
|
|
49
|
-
Adds `/context` to inject reusable repository work scopes from `.pi/contexts
|
|
50
|
-
|
|
51
|
-
## effort
|
|
52
|
-
|
|
53
|
-
Adds `/effort [quick|standard|deep]` to select effort and a provider from current logins. Tau selects provider’s best available model for tier, then tries its configured model fallback. `Ctrl+Shift+E` cycles tiers on current provider. Footer derives effort from current provider, model, and thinking level, and hides it when no configured tier matches.
|
|
45
|
+
Adds `/context` to browse and inject reusable repository work scopes from `.pi/contexts`. Selecting entries injects them once into the conversation: `read` paths as complete files, `show` targets as current declaration slices, `outline` paths as Explore structures, and one hidden note listing `references` plus instructions to treat the injected material as current. Run `/context` again to inject more. Edit catalog files by hand when work scopes change. Domain folders are `NN_slug` tabs (ordered by the two-digit prefix; UI shows the slug), TOML files are concepts, and TOML sections are selectable entries.
|
|
54
46
|
|
|
55
47
|
## explore
|
|
56
48
|
|
|
@@ -102,7 +94,7 @@ Shows a compact display-only marker after each run with wall time and model cost
|
|
|
102
94
|
|
|
103
95
|
## runtime-context
|
|
104
96
|
|
|
105
|
-
Supplies
|
|
97
|
+
Supplies Soul with the local date and root directory snapshot. Both remain fixed across turns, reload, and resume, and refresh after successful compaction.
|
|
106
98
|
|
|
107
99
|
## script-runner
|
|
108
100
|
|
|
@@ -114,16 +106,12 @@ Runs configured commands while keeping their output out of agent context when th
|
|
|
114
106
|
|
|
115
107
|
## soul
|
|
116
108
|
|
|
117
|
-
|
|
109
|
+
Supplies Tau's communication, discussion, planning, execution, and coding instructions. Saves a prompt baseline across turns, reload, and resume; refreshes it after successful compaction. Operational changes arrive as saved context updates without rewriting earlier instructions. Tool groups that cannot load without changing the cached prefix wait for successful compaction.
|
|
118
110
|
|
|
119
111
|
## stash
|
|
120
112
|
|
|
121
113
|
Adds `Alt+S` to stash the current prompt draft and `/pop` to browse stashed drafts and put one back in the editor.
|
|
122
114
|
|
|
123
|
-
## subagent
|
|
124
|
-
|
|
125
|
-
Gives Tau a subagent delegation tool for isolated, focused work. Run `/agents` to enable or disable individual agents for the current session, or set `extensions.subagent.disabled` in Tau settings for a persistent choice. `scout` is substantial multi-hop local code lookup that would chew parent context; facts only, not small digs; `web-research` handles external research. Known files can be autoread as line-numbered snapshots into a fresh or retained child turn. Tau can continue a retained child thread when follow-up work depends on its prior reads and reasoning. You can also create your own subagents in supported subagent directories. Ask Tau how to do it and have it consult extension documentation; built-in agents show pattern. Each subagent can register its own model, tools, and pool of display names. Reused pool names get numeric suffixes. In interactive cmux sessions, Tau opens one temporary Markdown dashboard for live subagent progress; it does not change how children run and closes shortly after active cohort finishes.
|
|
126
|
-
|
|
127
115
|
## tau-help
|
|
128
116
|
|
|
129
117
|
Adds `/tau-help` to show this guide as rendered Markdown in the chat.
|
|
@@ -134,11 +122,11 @@ Adds `/tau`, `/tau init [--global|--project]`, and `/tau doctor` for Tau setup a
|
|
|
134
122
|
|
|
135
123
|
## tool-approval
|
|
136
124
|
|
|
137
|
-
Reviews agent `bash` and `script_runner` requests before they run. Common read-only bash commands skip review. Set `extensions.toolApproval.autoApprove` to run every reviewer-approved request without another confirmation. Those auto-approvals show a user-only marker. The reviewer approves routine local development work. Concrete destructive, system, production, privileged, or security-sensitive effects require human approval with one explanatory paragraph. Reviewer failures fall back to human approval and send an attention notification.
|
|
125
|
+
Reviews agent `bash` and `script_runner` requests before they run. Common read-only bash commands skip review. Set `extensions.toolApproval.autoApprove` to run every reviewer-approved request without another confirmation. Those auto-approvals show a user-only marker. The reviewer approves routine local development work. Concrete destructive, system, production, privileged, or security-sensitive effects require human approval with one explanatory paragraph. Reviewer failures fall back to human approval and send an attention notification. In the terminal approval panel, press `n` to add a note to Approve or Reject before choosing. Rejection notes tell the agent why the request was blocked; approval notes reach it with the tool result without changing the request. Reject with a note to ask for a revised request.
|
|
138
126
|
|
|
139
127
|
## tool-loader
|
|
140
128
|
|
|
141
|
-
Progressively exposes registered specialist tool groups through `load_tools`. Tau registers `web`, `image`, and `appshot`; project or global package extensions can add groups with `registerDeferredToolGroup()` from `@shanepadgett/tau-agent`.
|
|
129
|
+
Progressively exposes registered specialist tool groups through `load_tools`. Tau registers `web`, `image`, and `appshot`; project or global package extensions can add groups with `registerDeferredToolGroup()` from `@shanepadgett/tau-agent`. Compatible models load tools without replacing the cached prefix. Otherwise, requested groups are queued until successful compaction; loading never triggers compaction automatically.
|
|
142
130
|
|
|
143
131
|
## web
|
|
144
132
|
|
|
@@ -3,11 +3,12 @@ import { readFile } from "node:fs/promises";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { Markdown, type Component, visibleWidth } from "@earendil-works/pi-tui";
|
|
6
|
+
import { registerPromptSource } from "../../shared/prompt-contributions.ts";
|
|
6
7
|
|
|
7
8
|
const TAU_DOCS_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "docs");
|
|
8
9
|
const TAU_DOCS_GUIDANCE = `Tau Agent documentation (read only when the user asks about Tau Agent, Rok, Tau extensions, Tau event APIs, harness behavior, or extending Tau Agent):
|
|
9
10
|
- Tau Agent docs: ${TAU_DOCS_PATH}
|
|
10
|
-
- When asked about: context management / .pi/contexts taxonomy (docs/context.md), public events / external integration (docs/extending-tau-agent.md),
|
|
11
|
+
- When asked about: context management / .pi/contexts taxonomy (docs/context.md), public events / external integration (docs/extending-tau-agent.md), Tau TUI components (docs/tui.md)
|
|
11
12
|
- Resolve Tau docs/... under Tau Agent docs, not the current working directory
|
|
12
13
|
- When working on Tau topics, read the docs and follow .md cross-references before implementing
|
|
13
14
|
- Do not read Tau Agent docs for normal coding tasks`;
|
|
@@ -54,9 +55,14 @@ class TauHelpMessage implements Component {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export default function tauHelpExtension(pi: ExtensionAPI): void {
|
|
57
|
-
pi
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
registerPromptSource(pi, {
|
|
59
|
+
key: "tau/documentation",
|
|
60
|
+
section: "documentation",
|
|
61
|
+
refresh: "compaction",
|
|
62
|
+
async read() {
|
|
63
|
+
return TAU_DOCS_GUIDANCE;
|
|
64
|
+
},
|
|
65
|
+
});
|
|
60
66
|
|
|
61
67
|
pi.registerMessageRenderer("tau-help", (message, _options, _theme) => {
|
|
62
68
|
if (typeof message.content !== "string") return undefined;
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Reviews agent `bash` and `script_runner` requests before they run.
|
|
4
4
|
|
|
5
|
-
Common read-only bash commands skip review and run immediately. Other bash and every `script_runner` request go to a separate reviewer. Tau uses the reviewer model for the current provider, then the current chat model if that reviewer is unavailable or fails. If a reviewer model is unavailable or fails, Tau notifies and tries the next one. The reviewer returns a validated decision and one concise paragraph that explains the request.
|
|
5
|
+
Common read-only bash commands skip review and run immediately. Other bash and every `script_runner` request go to a separate reviewer. When the agent requests several tools at once, Tau reviews up to three requests concurrently, with one model review focused on each request. Tau uses the reviewer model for the current provider, then the current chat model if that reviewer is unavailable or fails. If a reviewer model is unavailable or fails, Tau notifies and tries the next one. The reviewer returns a validated decision and one concise paragraph that explains the request.
|
|
6
6
|
|
|
7
7
|
With `autoApprove` enabled, reviewer-approved requests run without another confirmation. Tau shows a user-only marker with the reviewer model after those auto-approvals. Common read-only bash that skips review does not get a marker. Routine local development work should be approved, including requests that modify project files or run scripts. The reviewer asks for human approval only when it finds a concrete destructive, system, production, privileged, or security-sensitive effect.
|
|
8
8
|
|
|
9
|
-
When approval is required, Tau shows one paragraph that explains the effect and risk without repeating the request. If the reviewer fails or returns a malformed decision, Tau asks for direct human approval instead of running it automatically. Tau also sends an attention notification when the approval window opens.
|
|
9
|
+
When approval is required, Tau shows one paragraph that explains the effect and risk without repeating the request. If several requests need approval, their confirmation windows open one at a time. If the reviewer fails or returns a malformed decision, Tau asks for direct human approval instead of running it automatically. Tau also sends an attention notification when the approval window opens.
|
|
10
|
+
|
|
11
|
+
In the terminal approval panel, move between Approve and Reject, press `n` to add a note to the highlighted choice, then press Enter to choose. Enter saves an edited note before choosing; Escape cancels note editing or blocks the request from the choice list. A rejection note tells the agent why the request was blocked. An approval note reaches the agent with the tool result; it does not change the request being approved. To ask for a different request, reject it with a note. Long notes are truncated. RPC clients use the standard confirmation dialog without notes.
|
|
10
12
|
|
|
11
13
|
Configure under `extensions.toolApproval`:
|
|
12
14
|
|