token-pilot 0.28.3 → 0.30.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +75 -0
- package/README.md +39 -390
- package/agents/tp-api-surface-tracker.md +4 -2
- package/agents/tp-audit-scanner.md +4 -2
- package/agents/tp-commit-writer.md +4 -2
- package/agents/tp-context-engineer.md +4 -2
- package/agents/tp-dead-code-finder.md +4 -2
- package/agents/tp-debugger.md +4 -2
- package/agents/tp-dep-health.md +4 -2
- package/agents/tp-doc-writer.md +4 -2
- package/agents/tp-history-explorer.md +4 -2
- package/agents/tp-impact-analyzer.md +4 -2
- package/agents/tp-incident-timeline.md +4 -2
- package/agents/tp-incremental-builder.md +4 -2
- package/agents/tp-migration-scout.md +4 -2
- package/agents/tp-onboard.md +4 -2
- package/agents/tp-performance-profiler.md +4 -2
- package/agents/tp-pr-reviewer.md +4 -2
- package/agents/tp-refactor-planner.md +4 -2
- package/agents/tp-review-impact.md +4 -2
- package/agents/tp-run.md +4 -2
- package/agents/tp-session-restorer.md +4 -2
- package/agents/tp-ship-coordinator.md +4 -2
- package/agents/tp-spec-writer.md +4 -2
- package/agents/tp-test-coverage-gapper.md +4 -2
- package/agents/tp-test-triage.md +4 -2
- package/agents/tp-test-writer.md +4 -2
- package/dist/cli/tool-audit.d.ts +5 -0
- package/dist/cli/tool-audit.js +9 -1
- package/dist/core/policy-engine.d.ts +1 -5
- package/dist/core/policy-engine.js +9 -24
- package/dist/hooks/pre-bash.d.ts +13 -1
- package/dist/hooks/pre-bash.js +56 -1
- package/dist/hooks/pre-grep.d.ts +2 -1
- package/dist/hooks/pre-grep.js +3 -1
- package/dist/index.js +4 -2
- package/dist/server/enforcement-mode.d.ts +47 -0
- package/dist/server/enforcement-mode.js +59 -0
- package/dist/server/tool-definitions.d.ts +20 -0
- package/dist/server/tool-definitions.js +113 -10
- package/dist/server/tool-profiles.d.ts +19 -1
- package/dist/server/tool-profiles.js +38 -4
- package/dist/server.d.ts +2 -0
- package/dist/server.js +68 -16
- package/docs/agents.md +82 -0
- package/docs/configuration.md +117 -0
- package/docs/hooks.md +99 -0
- package/docs/installation.md +143 -0
- package/docs/tools.md +61 -0
- package/package.json +2 -2
|
@@ -8,8 +8,8 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__test_summary
|
|
9
9
|
- mcp__token-pilot__outline
|
|
10
10
|
- Bash
|
|
11
|
-
token_pilot_version: "0.
|
|
12
|
-
token_pilot_body_hash:
|
|
11
|
+
token_pilot_version: "0.30.0"
|
|
12
|
+
token_pilot_body_hash: b6831f11c61a9b255c2b6ffa04837130242fd02843463a7d30f109c1a06b3e3f
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -18,6 +18,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
18
18
|
|
|
19
19
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
20
20
|
|
|
21
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
22
|
+
|
|
21
23
|
Your specific role is defined below.
|
|
22
24
|
|
|
23
25
|
Role: commit-message authoring.
|
|
@@ -13,8 +13,8 @@ tools:
|
|
|
13
13
|
- Edit
|
|
14
14
|
- Glob
|
|
15
15
|
model: sonnet
|
|
16
|
-
token_pilot_version: "0.
|
|
17
|
-
token_pilot_body_hash:
|
|
16
|
+
token_pilot_version: "0.30.0"
|
|
17
|
+
token_pilot_body_hash: 43f9364ce722ff76daf0f8720ddaf9f77e18d4c4ed8bee3e15f12d207798e778
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -23,6 +23,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
23
23
|
|
|
24
24
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
25
25
|
|
|
26
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
27
|
+
|
|
26
28
|
Your specific role is defined below.
|
|
27
29
|
|
|
28
30
|
Role: curate what AI agents see so output quality stays high.
|
|
@@ -11,8 +11,8 @@ tools:
|
|
|
11
11
|
- Grep
|
|
12
12
|
- Read
|
|
13
13
|
model: sonnet
|
|
14
|
-
token_pilot_version: "0.
|
|
15
|
-
token_pilot_body_hash:
|
|
14
|
+
token_pilot_version: "0.30.0"
|
|
15
|
+
token_pilot_body_hash: 386760aed26df6c3595d3267954605565fad08afa8761e016079ae60c19887a8
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -21,6 +21,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
21
21
|
|
|
22
22
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
23
23
|
|
|
24
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
25
|
+
|
|
24
26
|
Your specific role is defined below.
|
|
25
27
|
|
|
26
28
|
Role: safe dead-code detection.
|
package/agents/tp-debugger.md
CHANGED
|
@@ -12,8 +12,8 @@ tools:
|
|
|
12
12
|
- Read
|
|
13
13
|
- Bash
|
|
14
14
|
model: sonnet
|
|
15
|
-
token_pilot_version: "0.
|
|
16
|
-
token_pilot_body_hash:
|
|
15
|
+
token_pilot_version: "0.30.0"
|
|
16
|
+
token_pilot_body_hash: 71738830d025e86c70988e046a2f7f30b4590f3d284291a18609ed5fdd732321
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -22,6 +22,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
22
22
|
|
|
23
23
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
24
24
|
|
|
25
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
26
|
+
|
|
25
27
|
Your specific role is defined below.
|
|
26
28
|
|
|
27
29
|
Role: bug diagnosis via systematic triage.
|
package/agents/tp-dep-health.md
CHANGED
|
@@ -9,8 +9,8 @@ tools:
|
|
|
9
9
|
- Bash
|
|
10
10
|
- Read
|
|
11
11
|
model: haiku
|
|
12
|
-
token_pilot_version: "0.
|
|
13
|
-
token_pilot_body_hash:
|
|
12
|
+
token_pilot_version: "0.30.0"
|
|
13
|
+
token_pilot_body_hash: 12634cd28889d0a0ef1b4a6b994ba978353e14f3cb349011c393076e7e2b5c96
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -19,6 +19,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
19
19
|
|
|
20
20
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
21
21
|
|
|
22
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
23
|
+
|
|
22
24
|
Your specific role is defined below.
|
|
23
25
|
|
|
24
26
|
Role: dependency health audit.
|
package/agents/tp-doc-writer.md
CHANGED
|
@@ -13,8 +13,8 @@ tools:
|
|
|
13
13
|
- Edit
|
|
14
14
|
- Glob
|
|
15
15
|
model: haiku
|
|
16
|
-
token_pilot_version: "0.
|
|
17
|
-
token_pilot_body_hash:
|
|
16
|
+
token_pilot_version: "0.30.0"
|
|
17
|
+
token_pilot_body_hash: 8e29d07dd8f58adeb9530ec477a59a6e42de6c624f322d2c6cfa8da66456b46a
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -23,6 +23,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
23
23
|
|
|
24
24
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
25
25
|
|
|
26
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
27
|
+
|
|
26
28
|
Your specific role is defined below.
|
|
27
29
|
|
|
28
30
|
Role: documentation author — decisions, ADRs, READMEs, API docs.
|
|
@@ -10,8 +10,8 @@ tools:
|
|
|
10
10
|
- Bash
|
|
11
11
|
- Read
|
|
12
12
|
model: haiku
|
|
13
|
-
token_pilot_version: "0.
|
|
14
|
-
token_pilot_body_hash:
|
|
13
|
+
token_pilot_version: "0.30.0"
|
|
14
|
+
token_pilot_body_hash: 260197bc31531352f5eda3b70cf114c7c57bb7e9373f68ca76161dd68a804b0d
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -20,6 +20,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
20
20
|
|
|
21
21
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
22
22
|
|
|
23
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
24
|
+
|
|
23
25
|
Your specific role is defined below.
|
|
24
26
|
|
|
25
27
|
Role: git-history archaeology — why, when, by whom.
|
|
@@ -12,8 +12,8 @@ tools:
|
|
|
12
12
|
- mcp__token-pilot__read_symbols
|
|
13
13
|
- Read
|
|
14
14
|
model: sonnet
|
|
15
|
-
token_pilot_version: "0.
|
|
16
|
-
token_pilot_body_hash:
|
|
15
|
+
token_pilot_version: "0.30.0"
|
|
16
|
+
token_pilot_body_hash: 1da6936cc117a7627640fae3cc85bf13a17f0b0b0d0d533423dfb4b7c0b4b1c2
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -22,6 +22,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
22
22
|
|
|
23
23
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
24
24
|
|
|
25
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
26
|
+
|
|
25
27
|
Your specific role is defined below.
|
|
26
28
|
|
|
27
29
|
Role: impact analysis.
|
|
@@ -8,8 +8,8 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__read_symbol
|
|
9
9
|
- Bash
|
|
10
10
|
model: inherit
|
|
11
|
-
token_pilot_version: "0.
|
|
12
|
-
token_pilot_body_hash:
|
|
11
|
+
token_pilot_version: "0.30.0"
|
|
12
|
+
token_pilot_body_hash: 213746bab7acb6730a6edb16e1ff7b2c56572c3adf4f94990799f1c168cfa2ad
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -18,6 +18,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
18
18
|
|
|
19
19
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
20
20
|
|
|
21
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
22
|
+
|
|
21
23
|
Your specific role is defined below.
|
|
22
24
|
|
|
23
25
|
Role: incident post-mortem timeline builder.
|
|
@@ -13,8 +13,8 @@ tools:
|
|
|
13
13
|
- Edit
|
|
14
14
|
- Bash
|
|
15
15
|
model: sonnet
|
|
16
|
-
token_pilot_version: "0.
|
|
17
|
-
token_pilot_body_hash:
|
|
16
|
+
token_pilot_version: "0.30.0"
|
|
17
|
+
token_pilot_body_hash: 14c9adcabfb772c77a467a5fbfa682abbd5adc87e22d7fbe5d1329ffd790dde5
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -23,6 +23,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
23
23
|
|
|
24
24
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
25
25
|
|
|
26
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
27
|
+
|
|
26
28
|
Your specific role is defined below.
|
|
27
29
|
|
|
28
30
|
Role: incremental feature implementation with slice-by-slice discipline.
|
|
@@ -11,8 +11,8 @@ tools:
|
|
|
11
11
|
- Grep
|
|
12
12
|
- Glob
|
|
13
13
|
model: sonnet
|
|
14
|
-
token_pilot_version: "0.
|
|
15
|
-
token_pilot_body_hash:
|
|
14
|
+
token_pilot_version: "0.30.0"
|
|
15
|
+
token_pilot_body_hash: 62893e448e943d0e1b928a670823ec3e152de395e487564862f145bd82161fcb
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -21,6 +21,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
21
21
|
|
|
22
22
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
23
23
|
|
|
24
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
25
|
+
|
|
24
26
|
Your specific role is defined below.
|
|
25
27
|
|
|
26
28
|
Role: migration impact mapping.
|
package/agents/tp-onboard.md
CHANGED
|
@@ -10,8 +10,8 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__smart_read
|
|
11
11
|
- mcp__token-pilot__smart_read_many
|
|
12
12
|
- mcp__token-pilot__read_section
|
|
13
|
-
token_pilot_version: "0.
|
|
14
|
-
token_pilot_body_hash:
|
|
13
|
+
token_pilot_version: "0.30.0"
|
|
14
|
+
token_pilot_body_hash: 4e82f7b3c6446663e958fb6bf5eb5348bbdf33389269c888ce0dab766e50561f
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -20,6 +20,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
20
20
|
|
|
21
21
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
22
22
|
|
|
23
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
24
|
+
|
|
23
25
|
Your specific role is defined below.
|
|
24
26
|
|
|
25
27
|
Role: repository onboarding.
|
|
@@ -11,8 +11,8 @@ tools:
|
|
|
11
11
|
- Bash
|
|
12
12
|
- Read
|
|
13
13
|
model: sonnet
|
|
14
|
-
token_pilot_version: "0.
|
|
15
|
-
token_pilot_body_hash:
|
|
14
|
+
token_pilot_version: "0.30.0"
|
|
15
|
+
token_pilot_body_hash: 8b9f454a47e57e3761668de788850ef97d5d6f127b059cf8e0cef03deaca3f98
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -21,6 +21,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
21
21
|
|
|
22
22
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
23
23
|
|
|
24
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
25
|
+
|
|
24
26
|
Your specific role is defined below.
|
|
25
27
|
|
|
26
28
|
Role: performance diagnosis and targeted optimization.
|
package/agents/tp-pr-reviewer.md
CHANGED
|
@@ -11,8 +11,8 @@ tools:
|
|
|
11
11
|
- mcp__token-pilot__read_for_edit
|
|
12
12
|
- Read
|
|
13
13
|
model: sonnet
|
|
14
|
-
token_pilot_version: "0.
|
|
15
|
-
token_pilot_body_hash:
|
|
14
|
+
token_pilot_version: "0.30.0"
|
|
15
|
+
token_pilot_body_hash: 91003b244472c4e65d840b55474a86ce04fba379859d588cc0fa54850b0e1e4f
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -21,6 +21,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
21
21
|
|
|
22
22
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
23
23
|
|
|
24
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
25
|
+
|
|
24
26
|
Your specific role is defined below.
|
|
25
27
|
|
|
26
28
|
Role: PR / diff review across five axes.
|
|
@@ -8,8 +8,8 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__outline
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
10
|
model: sonnet
|
|
11
|
-
token_pilot_version: "0.
|
|
12
|
-
token_pilot_body_hash:
|
|
11
|
+
token_pilot_version: "0.30.0"
|
|
12
|
+
token_pilot_body_hash: 45f972c6b36929491a529322bac3c34fd44872f7be4a974d25c7e27cb12e9dc3
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -18,6 +18,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
18
18
|
|
|
19
19
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
20
20
|
|
|
21
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
22
|
+
|
|
21
23
|
Your specific role is defined below.
|
|
22
24
|
|
|
23
25
|
Role: refactor planning with behaviour-preservation discipline.
|
|
@@ -9,8 +9,8 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__module_info
|
|
10
10
|
- Bash
|
|
11
11
|
model: sonnet
|
|
12
|
-
token_pilot_version: "0.
|
|
13
|
-
token_pilot_body_hash:
|
|
12
|
+
token_pilot_version: "0.30.0"
|
|
13
|
+
token_pilot_body_hash: 3c1c66f952ac63a5936bec86fefda8c842fb9713bca81e48ca5bb568ccb5f367
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -19,6 +19,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
19
19
|
|
|
20
20
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
21
21
|
|
|
22
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
23
|
+
|
|
22
24
|
Your specific role is defined below.
|
|
23
25
|
|
|
24
26
|
Role: pre-merge blast-radius review.
|
package/agents/tp-run.md
CHANGED
|
@@ -16,8 +16,8 @@ tools:
|
|
|
16
16
|
- Glob
|
|
17
17
|
- Bash
|
|
18
18
|
model: haiku
|
|
19
|
-
token_pilot_version: "0.
|
|
20
|
-
token_pilot_body_hash:
|
|
19
|
+
token_pilot_version: "0.30.0"
|
|
20
|
+
token_pilot_body_hash: de342efe1e3ee265df1773ebde1241555750ab17de249190a5c1c200f1f8f51a
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -26,6 +26,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
26
26
|
|
|
27
27
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
28
28
|
|
|
29
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
30
|
+
|
|
29
31
|
Your specific role is defined below.
|
|
30
32
|
|
|
31
33
|
Role: general-purpose token-pilot workhorse.
|
|
@@ -9,8 +9,8 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__session_budget
|
|
10
10
|
- Bash
|
|
11
11
|
- Read
|
|
12
|
-
token_pilot_version: "0.
|
|
13
|
-
token_pilot_body_hash:
|
|
12
|
+
token_pilot_version: "0.30.0"
|
|
13
|
+
token_pilot_body_hash: d031f30e9cc4ea454aa256427659ed27249d820b75dc8b9b99c81ba7635230a7
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -19,6 +19,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
19
19
|
|
|
20
20
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
21
21
|
|
|
22
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
23
|
+
|
|
22
24
|
Your specific role is defined below.
|
|
23
25
|
|
|
24
26
|
Role: session-state rehydration.
|
|
@@ -11,8 +11,8 @@ tools:
|
|
|
11
11
|
- Read
|
|
12
12
|
- Grep
|
|
13
13
|
model: sonnet
|
|
14
|
-
token_pilot_version: "0.
|
|
15
|
-
token_pilot_body_hash:
|
|
14
|
+
token_pilot_version: "0.30.0"
|
|
15
|
+
token_pilot_body_hash: 6b1c27b3dc4fad622cebff7c49e079fc764ca0ae57ef5bc4e61b563d8321092d
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -21,6 +21,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
21
21
|
|
|
22
22
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
23
23
|
|
|
24
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
25
|
+
|
|
24
26
|
Your specific role is defined below.
|
|
25
27
|
|
|
26
28
|
Role: pre-production readiness coordinator.
|
package/agents/tp-spec-writer.md
CHANGED
|
@@ -9,8 +9,8 @@ tools:
|
|
|
9
9
|
- Read
|
|
10
10
|
- Write
|
|
11
11
|
model: sonnet
|
|
12
|
-
token_pilot_version: "0.
|
|
13
|
-
token_pilot_body_hash:
|
|
12
|
+
token_pilot_version: "0.30.0"
|
|
13
|
+
token_pilot_body_hash: 4ae44482db80a8a3a43794c6ecb665ec0b5385a274e1e5b2e3a404956075be88
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -19,6 +19,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
19
19
|
|
|
20
20
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
21
21
|
|
|
22
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
23
|
+
|
|
22
24
|
Your specific role is defined below.
|
|
23
25
|
|
|
24
26
|
Role: pre-code specification author.
|
|
@@ -10,8 +10,8 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__test_summary
|
|
11
11
|
- Glob
|
|
12
12
|
- Grep
|
|
13
|
-
token_pilot_version: "0.
|
|
14
|
-
token_pilot_body_hash:
|
|
13
|
+
token_pilot_version: "0.30.0"
|
|
14
|
+
token_pilot_body_hash: 6d862d1bcaeda3fb13099f51e40faaaf45d16d7d41d1b938609500192aa606f2
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -20,6 +20,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
20
20
|
|
|
21
21
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
22
22
|
|
|
23
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
24
|
+
|
|
23
25
|
Your specific role is defined below.
|
|
24
26
|
|
|
25
27
|
Role: test coverage gap finder.
|
package/agents/tp-test-triage.md
CHANGED
|
@@ -8,8 +8,8 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__find_usages
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
10
|
model: sonnet
|
|
11
|
-
token_pilot_version: "0.
|
|
12
|
-
token_pilot_body_hash:
|
|
11
|
+
token_pilot_version: "0.30.0"
|
|
12
|
+
token_pilot_body_hash: f4e0dcbd2b4e8648efcafc9d53101a66bf394d7c90e97df7581ac47fcfbff5cb
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -18,6 +18,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
18
18
|
|
|
19
19
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
20
20
|
|
|
21
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
22
|
+
|
|
21
23
|
Your specific role is defined below.
|
|
22
24
|
|
|
23
25
|
Role: test-failure triage.
|
package/agents/tp-test-writer.md
CHANGED
|
@@ -13,8 +13,8 @@ tools:
|
|
|
13
13
|
- Edit
|
|
14
14
|
- Bash
|
|
15
15
|
model: sonnet
|
|
16
|
-
token_pilot_version: "0.
|
|
17
|
-
token_pilot_body_hash:
|
|
16
|
+
token_pilot_version: "0.30.0"
|
|
17
|
+
token_pilot_body_hash: 960fe9e907e9c7d13b14dcc22af99e8cc7e7335f99791fa808df76ac21e1f5e9
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
You are a token-pilot agent (`tp-<name>`). Your defining contract:
|
|
@@ -23,6 +23,8 @@ For every file in a programming language, you MUST use the token-pilot MCP tools
|
|
|
23
23
|
|
|
24
24
|
If any MCP tool fails, fall back sensibly (another MCP tool → bounded Read → pass-through) and note the fallback in your output. Never silently abandon the contract.
|
|
25
25
|
|
|
26
|
+
For heavy Bash operations (test runs, builds, recursive searches, network calls, any command with potentially large stdout): when `mcp__context-mode__execute` or `ctx_batch_execute` is available, use it instead of raw Bash. Context-mode runs commands in a sandbox and only the result enters your context — typically 95% token reduction vs raw stdout dump. This is complementary to token-pilot: we own code reading, context-mode owns command execution.
|
|
27
|
+
|
|
26
28
|
Your specific role is defined below.
|
|
27
29
|
|
|
28
30
|
Role: targeted test authoring with TDD discipline.
|
package/dist/cli/tool-audit.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface ToolAuditRow {
|
|
|
22
22
|
/** Calls where the recorder claimed NO savings (pass-through) — separate so
|
|
23
23
|
* they don't poison the reduction average. */
|
|
24
24
|
noneCalls: number;
|
|
25
|
+
/** Calls where the MCP response was served from the session cache (the model
|
|
26
|
+
* replayed cached tokens). These contribute to `saved` but the mechanism
|
|
27
|
+
* is token re-use, not structural compression — useful to split out so the
|
|
28
|
+
* "Est.Saved*" column is understood correctly. */
|
|
29
|
+
cacheHitCalls: number;
|
|
25
30
|
/** True when reduction is below the low-value threshold AND we have enough
|
|
26
31
|
* samples (≥5) to make a claim — avoids flagging tools after 1 bad run. */
|
|
27
32
|
lowValue: boolean;
|
package/dist/cli/tool-audit.js
CHANGED
|
@@ -24,12 +24,15 @@ export function aggregateToolCalls(events, lowValueThreshold = 20, minSamples =
|
|
|
24
24
|
tokensReturned: 0,
|
|
25
25
|
tokensWouldBe: 0,
|
|
26
26
|
noneCalls: 0,
|
|
27
|
+
cacheHitCalls: 0,
|
|
27
28
|
};
|
|
28
29
|
row.count++;
|
|
29
30
|
row.tokensReturned += e.tokensReturned;
|
|
30
31
|
row.tokensWouldBe += e.tokensWouldBe;
|
|
31
32
|
if (e.savingsCategory === "none")
|
|
32
33
|
row.noneCalls++;
|
|
34
|
+
if (e.sessionCacheHit)
|
|
35
|
+
row.cacheHitCalls++;
|
|
33
36
|
byTool.set(e.tool, row);
|
|
34
37
|
}
|
|
35
38
|
const rows = [];
|
|
@@ -47,6 +50,7 @@ export function aggregateToolCalls(events, lowValueThreshold = 20, minSamples =
|
|
|
47
50
|
saved,
|
|
48
51
|
reductionPct,
|
|
49
52
|
noneCalls: r.noneCalls,
|
|
53
|
+
cacheHitCalls: r.cacheHitCalls,
|
|
50
54
|
lowValue,
|
|
51
55
|
});
|
|
52
56
|
}
|
|
@@ -74,7 +78,7 @@ Run a few MCP tool calls from your AI client, then re-run \`npx token-pilot tool
|
|
|
74
78
|
lines.push(`Token Pilot — tool audit`);
|
|
75
79
|
lines.push(` ${opts.totalEvents} calls across ${rows.length} tools (cumulative across sessions)`);
|
|
76
80
|
lines.push("");
|
|
77
|
-
lines.push(" Tool Calls
|
|
81
|
+
lines.push(" Tool Calls Est.Saved* Returned Reduction");
|
|
78
82
|
lines.push(" ─────────────────────────────────────────────────────────────────");
|
|
79
83
|
for (const r of rows) {
|
|
80
84
|
const tool = r.tool.padEnd(24);
|
|
@@ -91,6 +95,10 @@ Run a few MCP tool calls from your AI client, then re-run \`npx token-pilot tool
|
|
|
91
95
|
lines.push("Low-value tools flagged above have <20% token reduction across ≥5 calls.");
|
|
92
96
|
lines.push("Consider: check their `none` passthrough count, or whether a cheaper alternative (Grep, Read) would do the job.");
|
|
93
97
|
}
|
|
98
|
+
lines.push("");
|
|
99
|
+
lines.push("* Est.Saved is estimated against a full-file read baseline. Actual prompt");
|
|
100
|
+
lines.push(" savings depend on client caching — use `cacheHitCalls` in --json output");
|
|
101
|
+
lines.push(" to distinguish structural compression from cache re-use.");
|
|
94
102
|
return lines.join("\n");
|
|
95
103
|
}
|
|
96
104
|
export async function runToolAudit(opts) {
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
export interface PolicyConfig {
|
|
7
7
|
/** Advisory hints when an expensive tool is used where a cheaper alternative exists */
|
|
8
8
|
preferCheapReads: boolean;
|
|
9
|
-
/** Track if read_for_edit was called before edit (advisory) */
|
|
10
|
-
requireReadForEditBeforeEdit: boolean;
|
|
11
9
|
/** Always cache project overview in session cache */
|
|
12
10
|
cacheProjectOverview: boolean;
|
|
13
11
|
/** Warn after N full-file reads in a session */
|
|
@@ -25,13 +23,11 @@ export declare const DEFAULT_POLICIES: PolicyConfig;
|
|
|
25
23
|
export interface PolicyCheckContext {
|
|
26
24
|
fullFileReadsCount: number;
|
|
27
25
|
tokensReturned: number;
|
|
28
|
-
readForEditCalled?: Set<string>;
|
|
29
|
-
editTargetPath?: string;
|
|
30
26
|
totalCallCount?: number;
|
|
31
27
|
totalTokensReturned?: number;
|
|
32
28
|
}
|
|
33
29
|
export interface PolicyAdvisory {
|
|
34
|
-
level:
|
|
30
|
+
level: "info" | "warn";
|
|
35
31
|
message: string;
|
|
36
32
|
}
|
|
37
33
|
/**
|