token-pilot 0.6.1 → 0.6.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 +5 -0
- package/package.json +1 -1
- package/dist/handlers/changed-symbols.d.ts +0 -11
- package/dist/handlers/changed-symbols.d.ts.map +0 -1
- package/dist/handlers/changed-symbols.js +0 -44
- package/dist/handlers/changed-symbols.js.map +0 -1
- package/dist/handlers/find-callers.d.ts +0 -12
- package/dist/handlers/find-callers.d.ts.map +0 -1
- package/dist/handlers/find-callers.js +0 -54
- package/dist/handlers/find-callers.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ 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.6.2] - 2026-03-02
|
|
9
|
+
|
|
10
|
+
### Removed
|
|
11
|
+
- **Dead handler files** — deleted `changed-symbols.ts` (removed in v0.5.0) and `find-callers.ts` (removed in v0.4.0). Were never registered in server but lingered as dead code.
|
|
12
|
+
|
|
8
13
|
## [0.6.1] - 2026-03-02
|
|
9
14
|
|
|
10
15
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AstIndexClient } from '../ast-index/client.js';
|
|
2
|
-
export interface ChangedSymbolsArgs {
|
|
3
|
-
base?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function handleChangedSymbols(args: ChangedSymbolsArgs, astIndex: AstIndexClient): Promise<{
|
|
6
|
-
content: Array<{
|
|
7
|
-
type: 'text';
|
|
8
|
-
text: string;
|
|
9
|
-
}>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=changed-symbols.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changed-symbols.d.ts","sourceRoot":"","sources":["../../src/handlers/changed-symbols.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAkD7D"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export async function handleChangedSymbols(args, astIndex) {
|
|
2
|
-
const changed = await astIndex.changed(args.base);
|
|
3
|
-
if (changed.length === 0) {
|
|
4
|
-
const base = args.base ?? 'origin/main';
|
|
5
|
-
return {
|
|
6
|
-
content: [{
|
|
7
|
-
type: 'text',
|
|
8
|
-
text: `No changed symbols since ${base}.\nTIP: This uses git diff. Make sure you have uncommitted changes or are on a feature branch.`,
|
|
9
|
-
}],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
// Group by change type
|
|
13
|
-
const added = changed.filter(c => c.change_type === 'added');
|
|
14
|
-
const modified = changed.filter(c => c.change_type === 'modified');
|
|
15
|
-
const removed = changed.filter(c => c.change_type === 'removed');
|
|
16
|
-
const lines = [
|
|
17
|
-
`CHANGED SYMBOLS: ${changed.length} total (${added.length} added, ${modified.length} modified, ${removed.length} removed)`,
|
|
18
|
-
'',
|
|
19
|
-
];
|
|
20
|
-
if (added.length > 0) {
|
|
21
|
-
lines.push('ADDED:');
|
|
22
|
-
for (const s of added) {
|
|
23
|
-
lines.push(` + ${s.kind} ${s.name} (${s.file}:${s.line})`);
|
|
24
|
-
}
|
|
25
|
-
lines.push('');
|
|
26
|
-
}
|
|
27
|
-
if (modified.length > 0) {
|
|
28
|
-
lines.push('MODIFIED:');
|
|
29
|
-
for (const s of modified) {
|
|
30
|
-
lines.push(` ~ ${s.kind} ${s.name} (${s.file}:${s.line})`);
|
|
31
|
-
}
|
|
32
|
-
lines.push('');
|
|
33
|
-
}
|
|
34
|
-
if (removed.length > 0) {
|
|
35
|
-
lines.push('REMOVED:');
|
|
36
|
-
for (const s of removed) {
|
|
37
|
-
lines.push(` - ${s.kind} ${s.name} (${s.file}:${s.line})`);
|
|
38
|
-
}
|
|
39
|
-
lines.push('');
|
|
40
|
-
}
|
|
41
|
-
lines.push('HINT: Use read_symbol() to see the actual code changes.');
|
|
42
|
-
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=changed-symbols.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"changed-symbols.js","sourceRoot":"","sources":["../../src/handlers/changed-symbols.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAwB,EACxB,QAAwB;IAExB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC;QACxC,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,4BAA4B,IAAI,gGAAgG;iBACvI,CAAC;SACH,CAAC;IACJ,CAAC;IAED,uBAAuB;IACvB,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,UAAU,CAA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AC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IAEtE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AstIndexClient } from '../ast-index/client.js';
|
|
2
|
-
export interface FindCallersArgs {
|
|
3
|
-
function: string;
|
|
4
|
-
depth?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function handleFindCallers(args: FindCallersArgs, astIndex: AstIndexClient): Promise<{
|
|
7
|
-
content: Array<{
|
|
8
|
-
type: 'text';
|
|
9
|
-
text: string;
|
|
10
|
-
}>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=find-callers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-callers.d.ts","sourceRoot":"","sources":["../../src/handlers/find-callers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAoD7D"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
export async function handleFindCallers(args, astIndex) {
|
|
2
|
-
const depth = args.depth ?? 1;
|
|
3
|
-
// depth=1: flat callers list, depth>1: call tree
|
|
4
|
-
if (depth <= 1) {
|
|
5
|
-
const callers = await astIndex.callers(args.function);
|
|
6
|
-
if (callers.length === 0) {
|
|
7
|
-
return {
|
|
8
|
-
content: [{
|
|
9
|
-
type: 'text',
|
|
10
|
-
text: `No callers found for "${args.function}".\nTIP: ast-index callers tracks direct function calls. Method calls via objects (this.service.method()) may not be detected.`,
|
|
11
|
-
}],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const lines = [
|
|
15
|
-
`CALLERS: "${args.function}" (${callers.length} callers)`,
|
|
16
|
-
'',
|
|
17
|
-
];
|
|
18
|
-
for (const c of callers) {
|
|
19
|
-
lines.push(` ${c.path}:${c.line}`);
|
|
20
|
-
if (c.context)
|
|
21
|
-
lines.push(` ${c.context.trim()}`);
|
|
22
|
-
}
|
|
23
|
-
lines.push('');
|
|
24
|
-
lines.push('HINT: Use depth=2+ to see the full call hierarchy tree.');
|
|
25
|
-
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
26
|
-
}
|
|
27
|
-
// Call tree mode
|
|
28
|
-
const tree = await astIndex.callTree(args.function, depth);
|
|
29
|
-
if (!tree) {
|
|
30
|
-
return {
|
|
31
|
-
content: [{
|
|
32
|
-
type: 'text',
|
|
33
|
-
text: `No call tree found for "${args.function}".`,
|
|
34
|
-
}],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const lines = [
|
|
38
|
-
`CALL TREE: "${args.function}" (depth=${depth})`,
|
|
39
|
-
'',
|
|
40
|
-
];
|
|
41
|
-
formatCallTree(tree, lines, 0);
|
|
42
|
-
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
43
|
-
}
|
|
44
|
-
function formatCallTree(node, lines, indent) {
|
|
45
|
-
const prefix = ' '.repeat(indent);
|
|
46
|
-
const loc = node.file ? ` (${node.file}:${node.line ?? '?'})` : '';
|
|
47
|
-
lines.push(`${prefix}${indent === 0 ? '' : '← '}${node.name}${loc}`);
|
|
48
|
-
if (node.callers) {
|
|
49
|
-
for (const caller of node.callers) {
|
|
50
|
-
formatCallTree(caller, lines, indent + 1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=find-callers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-callers.js","sourceRoot":"","sources":["../../src/handlers/find-callers.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAqB,EACrB,QAAwB;IAExB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IAE9B,iDAAiD;IACjD,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,yBAAyB,IAAI,CAAC,QAAQ,gIAAgI;qBAC7K,CAAC;aACH,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAa;YACtB,aAAa,IAAI,CAAC,QAAQ,MAAM,OAAO,CAAC,MAAM,WAAW;YACzD,EAAE;SACH,CAAC;QAEF,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACpC,IAAI,CAAC,CAAC,OAAO;gBAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC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