token-pilot 0.23.1 → 0.23.2
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/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +31 -0
- package/dist/agents/tp-audit-scanner.md +1 -1
- package/dist/agents/tp-commit-writer.md +1 -1
- package/dist/agents/tp-dead-code-finder.md +1 -1
- package/dist/agents/tp-debugger.md +1 -1
- package/dist/agents/tp-history-explorer.md +1 -1
- package/dist/agents/tp-impact-analyzer.md +1 -1
- package/dist/agents/tp-migration-scout.md +1 -1
- package/dist/agents/tp-onboard.md +1 -1
- package/dist/agents/tp-pr-reviewer.md +1 -1
- package/dist/agents/tp-refactor-planner.md +1 -1
- package/dist/agents/tp-run.md +1 -1
- package/dist/agents/tp-session-restorer.md +1 -1
- package/dist/agents/tp-test-triage.md +1 -1
- package/dist/agents/tp-test-writer.md +1 -1
- package/dist/hooks/session-start.js +59 -20
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "Enforcement layer for token-efficient AI coding: MCP-first hook with structural denial summaries, SessionStart reminder, bless-agents CLI, and six tp-* subagents — works for every agent including those without MCP access.",
|
|
5
5
|
"author": "token-pilot",
|
|
6
6
|
"license": "MIT",
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to Token Pilot will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.23.2] - 2026-04-18
|
|
9
|
+
|
|
10
|
+
### Changed — SessionStart reminder now carries a task→agent decision guide
|
|
11
|
+
|
|
12
|
+
The reminder used to list the installed `tp-*` agents with their descriptions. Useful, but the main agent still had to decide **when** to delegate. Now the reminder carries a compact task→agent cheat-sheet inline:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
WHEN DELEGATING — if the task fits a specialist, use the Task tool:
|
|
16
|
+
bug / stack trace → tp-debugger
|
|
17
|
+
PR / diff review → tp-pr-reviewer
|
|
18
|
+
impact before change → tp-impact-analyzer
|
|
19
|
+
plan refactor → tp-refactor-planner
|
|
20
|
+
failing tests → tp-test-triage
|
|
21
|
+
write new tests → tp-test-writer
|
|
22
|
+
migrate API / version → tp-migration-scout
|
|
23
|
+
"why is this like this?" → tp-history-explorer
|
|
24
|
+
security / quality audit → tp-audit-scanner
|
|
25
|
+
resume after /clear → tp-session-restorer
|
|
26
|
+
dead code cleanup → tp-dead-code-finder
|
|
27
|
+
commit message → tp-commit-writer
|
|
28
|
+
repo onboarding → tp-onboard
|
|
29
|
+
general workhorse → tp-run
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Lines for agents the user hasn't installed are filtered out automatically. Custom / third-party `tp-*` agents not in the core map get a fallback line with their own description. Over-budget trimming still lands `… and N more` with a total count, so nothing silently disappears.
|
|
33
|
+
|
|
34
|
+
Also added to the MANDATORY block: `Batch variants (prefer over loops): read_symbols, smart_read_many, read_section.` — the three batch tools that v0.23.1 wired into specialist agents but that the main agent also benefits from.
|
|
35
|
+
|
|
36
|
+
### Numbers
|
|
37
|
+
- 906 tests green (+6 new buildReminderMessage regression tests), `tsc --noEmit` clean.
|
|
38
|
+
|
|
8
39
|
## [0.23.1] - 2026-04-18
|
|
9
40
|
|
|
10
41
|
### Changed — agent toolset coverage
|
|
@@ -9,7 +9,7 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__smart_read
|
|
10
10
|
- mcp__token-pilot__smart_read_many
|
|
11
11
|
- mcp__token-pilot__read_section
|
|
12
|
-
token_pilot_version: "0.23.
|
|
12
|
+
token_pilot_version: "0.23.2"
|
|
13
13
|
token_pilot_body_hash: ae0b86eaffaf34bf283b94b5572481fa8c2d6a2a25193f1173b70bef0fbe1919
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -7,7 +7,7 @@ tools:
|
|
|
7
7
|
- mcp__token-pilot__read_diff
|
|
8
8
|
- mcp__token-pilot__outline
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
|
-
token_pilot_version: "0.23.
|
|
10
|
+
token_pilot_version: "0.23.2"
|
|
11
11
|
token_pilot_body_hash: a058518619fd6e2def0c9226f6c70438a5e0a80efe680c935414ecd7e1b14a4f
|
|
12
12
|
---
|
|
13
13
|
|
package/dist/agents/tp-run.md
CHANGED
|
@@ -7,7 +7,7 @@ tools:
|
|
|
7
7
|
- mcp__token-pilot__read_range
|
|
8
8
|
- mcp__token-pilot__find_usages
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
|
-
token_pilot_version: "0.23.
|
|
10
|
+
token_pilot_version: "0.23.2"
|
|
11
11
|
token_pilot_body_hash: 255912c47661d203c8f9a735237bc419f97e937f788a01811bbe126ee3dd5878
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -97,7 +97,24 @@ MANDATORY — for code files, use these before raw Read:
|
|
|
97
97
|
mcp__token-pilot__read_symbol(path, sym) — one function / class
|
|
98
98
|
mcp__token-pilot__read_for_edit(path, sym)— exact text for editing
|
|
99
99
|
mcp__token-pilot__outline(path) — symbol list
|
|
100
|
+
Batch variants (prefer over loops): read_symbols, smart_read_many, read_section.
|
|
100
101
|
Raw Read allowed only with offset/limit or TOKEN_PILOT_BYPASS=1.`;
|
|
102
|
+
const DECISION_GUIDE = `WHEN DELEGATING — if the task fits a specialist, use the Task tool:
|
|
103
|
+
bug / stack trace → tp-debugger
|
|
104
|
+
PR / diff review → tp-pr-reviewer
|
|
105
|
+
impact before change → tp-impact-analyzer
|
|
106
|
+
plan refactor → tp-refactor-planner
|
|
107
|
+
failing tests → tp-test-triage
|
|
108
|
+
write new tests → tp-test-writer
|
|
109
|
+
migrate API / version → tp-migration-scout
|
|
110
|
+
"why is this like this?"→ tp-history-explorer
|
|
111
|
+
security / quality audit→ tp-audit-scanner
|
|
112
|
+
resume after /clear → tp-session-restorer
|
|
113
|
+
dead code cleanup → tp-dead-code-finder
|
|
114
|
+
commit message → tp-commit-writer
|
|
115
|
+
repo onboarding → tp-onboard
|
|
116
|
+
general workhorse → tp-run
|
|
117
|
+
Delegating keeps main-context lean; each specialist has a narrow toolset + budget.`;
|
|
101
118
|
function estimateTokens(text) {
|
|
102
119
|
// Fast approximation: chars / 4, adjusted for whitespace
|
|
103
120
|
if (text.length === 0)
|
|
@@ -110,29 +127,51 @@ function estimateTokens(text) {
|
|
|
110
127
|
* delegating list with "… and N more" if needed.
|
|
111
128
|
*/
|
|
112
129
|
export function buildReminderMessage(agents, maxReminderTokens) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
130
|
+
// If no agents installed, give the user a clear nudge; skip the
|
|
131
|
+
// delegation guide since there's nothing to delegate to.
|
|
132
|
+
if (agents.length === 0) {
|
|
133
|
+
return `${MANDATORY_BLOCK}\n\nWHEN DELEGATING — none installed; run: npx token-pilot install-agents`;
|
|
134
|
+
}
|
|
135
|
+
// Filter the decision guide to the agents this user actually has
|
|
136
|
+
// installed. Dropping lines for missing agents keeps the reminder
|
|
137
|
+
// honest when the template ships an agent the user hasn't installed.
|
|
138
|
+
const installedNames = new Set(agents.map((a) => a.name));
|
|
139
|
+
const guideKnownNames = new Set();
|
|
140
|
+
const decisionGuideLines = DECISION_GUIDE.split("\n").filter((line) => {
|
|
141
|
+
const m = line.match(/→\s+(tp-[a-z-]+)/);
|
|
142
|
+
if (!m)
|
|
143
|
+
return true; // header / footer
|
|
144
|
+
guideKnownNames.add(m[1]);
|
|
145
|
+
return installedNames.has(m[1]);
|
|
146
|
+
});
|
|
147
|
+
// Fallback: custom / third-party tp-* agents we don't hard-code in the
|
|
148
|
+
// guide still deserve a mention so the main agent can delegate to them.
|
|
149
|
+
const extras = agents.filter((a) => !guideKnownNames.has(a.name));
|
|
150
|
+
if (extras.length > 0) {
|
|
151
|
+
const extraLines = extras.map((a) => ` custom: ${a.name} — ${a.description}`);
|
|
152
|
+
// Insert before the "Delegating keeps..." footer.
|
|
153
|
+
const footer = decisionGuideLines.pop() ?? "";
|
|
154
|
+
decisionGuideLines.push(...extraLines, footer);
|
|
155
|
+
}
|
|
156
|
+
const decisionGuide = decisionGuideLines.join("\n");
|
|
157
|
+
const full = `${MANDATORY_BLOCK}\n\n${decisionGuide}`;
|
|
118
158
|
if (estimateTokens(full) <= maxReminderTokens) {
|
|
119
159
|
return full;
|
|
120
160
|
}
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const candidate = `${MANDATORY_BLOCK}\n\nWHEN DELEGATING — use the right token-pilot-native subagent:\n${trimmedLines}`;
|
|
161
|
+
// Budget overflow: trim decision-guide body lines from the end (keep
|
|
162
|
+
// header, footer, and as many mappings as fit). Preserves the first
|
|
163
|
+
// line so the agent still knows the section exists.
|
|
164
|
+
const header = decisionGuideLines[0];
|
|
165
|
+
const footer = decisionGuideLines[decisionGuideLines.length - 1];
|
|
166
|
+
const body = decisionGuideLines.slice(1, -1);
|
|
167
|
+
let kept = body.length;
|
|
168
|
+
while (kept > 0) {
|
|
169
|
+
kept--;
|
|
170
|
+
const dropped = body.length - kept;
|
|
171
|
+
const trimmedBody = kept === 0
|
|
172
|
+
? [` … and ${dropped} more (reminder budget exhausted)`]
|
|
173
|
+
: body.slice(0, kept).concat(` … and ${dropped} more`);
|
|
174
|
+
const candidate = `${MANDATORY_BLOCK}\n\n${[header, ...trimmedBody, footer].join("\n")}`;
|
|
136
175
|
if (estimateTokens(candidate) <= maxReminderTokens) {
|
|
137
176
|
return candidate;
|
|
138
177
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "Save up to 80% tokens when AI reads code — MCP server for token-efficient code navigation, AST-aware structural reading instead of dumping full files into context window",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|