token-pilot 0.19.1 → 0.22.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.
Files changed (94) hide show
  1. package/.claude-plugin/hooks/hooks.json +21 -0
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/CHANGELOG.md +736 -580
  4. package/README.md +172 -315
  5. package/dist/agents/tp-commit-writer.md +41 -0
  6. package/dist/agents/tp-dead-code-finder.md +43 -0
  7. package/dist/agents/tp-debugger.md +45 -0
  8. package/dist/agents/tp-impact-analyzer.md +44 -0
  9. package/dist/agents/tp-migration-scout.md +43 -0
  10. package/dist/agents/tp-onboard.md +40 -0
  11. package/dist/agents/tp-pr-reviewer.md +41 -0
  12. package/dist/agents/tp-refactor-planner.md +42 -0
  13. package/dist/agents/tp-run.md +48 -0
  14. package/dist/agents/tp-test-triage.md +40 -0
  15. package/dist/agents/tp-test-writer.md +46 -0
  16. package/dist/ast-index/binary-manager.d.ts +3 -3
  17. package/dist/ast-index/binary-manager.js +74 -11
  18. package/dist/ast-index/client.d.ts +5 -1
  19. package/dist/ast-index/client.js +9 -2
  20. package/dist/cli/agent-frontmatter.d.ts +48 -0
  21. package/dist/cli/agent-frontmatter.js +189 -0
  22. package/dist/cli/bless-agents.d.ts +65 -0
  23. package/dist/cli/bless-agents.js +307 -0
  24. package/dist/cli/claudeignore.d.ts +33 -0
  25. package/dist/cli/claudeignore.js +88 -0
  26. package/dist/cli/claudemd-hygiene.d.ts +26 -0
  27. package/dist/cli/claudemd-hygiene.js +43 -0
  28. package/dist/cli/doctor-drift.d.ts +31 -0
  29. package/dist/cli/doctor-drift.js +130 -0
  30. package/dist/cli/doctor-env-check.d.ts +25 -0
  31. package/dist/cli/doctor-env-check.js +91 -0
  32. package/dist/cli/install-agents.d.ts +108 -0
  33. package/dist/cli/install-agents.js +402 -0
  34. package/dist/cli/save-doc.d.ts +42 -0
  35. package/dist/cli/save-doc.js +145 -0
  36. package/dist/cli/scan-agents.d.ts +46 -0
  37. package/dist/cli/scan-agents.js +227 -0
  38. package/dist/cli/stats.d.ts +36 -0
  39. package/dist/cli/stats.js +131 -0
  40. package/dist/cli/unbless-agents.d.ts +33 -0
  41. package/dist/cli/unbless-agents.js +85 -0
  42. package/dist/cli/uninstall-agents.d.ts +36 -0
  43. package/dist/cli/uninstall-agents.js +117 -0
  44. package/dist/config/defaults.d.ts +1 -1
  45. package/dist/config/defaults.js +14 -8
  46. package/dist/config/loader.d.ts +1 -1
  47. package/dist/config/loader.js +105 -11
  48. package/dist/core/context-registry.d.ts +16 -1
  49. package/dist/core/context-registry.js +60 -28
  50. package/dist/core/event-log.d.ts +79 -0
  51. package/dist/core/event-log.js +190 -0
  52. package/dist/core/session-registry.d.ts +43 -0
  53. package/dist/core/session-registry.js +113 -0
  54. package/dist/core/session-savings.d.ts +19 -0
  55. package/dist/core/session-savings.js +60 -0
  56. package/dist/handlers/session-budget.d.ts +32 -0
  57. package/dist/handlers/session-budget.js +61 -0
  58. package/dist/handlers/session-snapshot-persist.d.ts +22 -0
  59. package/dist/handlers/session-snapshot-persist.js +76 -0
  60. package/dist/hooks/adaptive-threshold.d.ts +27 -0
  61. package/dist/hooks/adaptive-threshold.js +46 -0
  62. package/dist/hooks/format-deny-message.d.ts +21 -0
  63. package/dist/hooks/format-deny-message.js +147 -0
  64. package/dist/hooks/installer.d.ts +7 -1
  65. package/dist/hooks/installer.js +175 -55
  66. package/dist/hooks/path-safety.d.ts +16 -0
  67. package/dist/hooks/path-safety.js +34 -0
  68. package/dist/hooks/post-bash.d.ts +46 -0
  69. package/dist/hooks/post-bash.js +77 -0
  70. package/dist/hooks/session-start.d.ts +45 -0
  71. package/dist/hooks/session-start.js +179 -0
  72. package/dist/hooks/summary-ast-index.d.ts +28 -0
  73. package/dist/hooks/summary-ast-index.js +122 -0
  74. package/dist/hooks/summary-head-tail.d.ts +15 -0
  75. package/dist/hooks/summary-head-tail.js +78 -0
  76. package/dist/hooks/summary-pipeline.d.ts +35 -0
  77. package/dist/hooks/summary-pipeline.js +63 -0
  78. package/dist/hooks/summary-regex.d.ts +14 -0
  79. package/dist/hooks/summary-regex.js +130 -0
  80. package/dist/hooks/summary-types.d.ts +29 -0
  81. package/dist/hooks/summary-types.js +9 -0
  82. package/dist/index.d.ts +15 -3
  83. package/dist/index.js +508 -131
  84. package/dist/integration/context-mode-detector.d.ts +7 -1
  85. package/dist/integration/context-mode-detector.js +51 -15
  86. package/dist/server/tool-definitions.d.ts +149 -0
  87. package/dist/server/tool-definitions.js +424 -202
  88. package/dist/server.d.ts +1 -1
  89. package/dist/server.js +456 -179
  90. package/dist/templates/agent-builder.d.ts +49 -0
  91. package/dist/templates/agent-builder.js +104 -0
  92. package/dist/types.d.ts +38 -4
  93. package/package.json +89 -87
  94. package/skills/stats/SKILL.md +13 -2
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Shared types for the hook summary pipeline (Phase 1).
3
+ *
4
+ * Every parser in the fallback chain (ast-index subprocess, regex, head+tail)
5
+ * returns a HookSummary. The downstream formatter in handleHookRead renders
6
+ * this structure into the `permissionDecisionReason` body.
7
+ */
8
+ export type SignalKind = "import" | "export" | "declaration" | "raw";
9
+ export interface SignalLine {
10
+ /** 1-based line number in the original source. */
11
+ line: number;
12
+ kind: SignalKind;
13
+ /** Trimmed source line, truncated to a parser-defined character cap. */
14
+ text: string;
15
+ }
16
+ export interface HookSummary {
17
+ signals: SignalLine[];
18
+ totalLines: number;
19
+ estimatedTokens: number;
20
+ /** Lower-case extension without the dot; empty string if none. */
21
+ language: string;
22
+ /**
23
+ * Optional human-readable note explaining a non-standard summary
24
+ * (e.g. "parser unavailable — showing head+tail only"). Rendered by the
25
+ * formatter above the signals section.
26
+ */
27
+ note?: string;
28
+ }
29
+ //# sourceMappingURL=summary-types.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shared types for the hook summary pipeline (Phase 1).
3
+ *
4
+ * Every parser in the fallback chain (ast-index subprocess, regex, head+tail)
5
+ * returns a HookSummary. The downstream formatter in handleHookRead renders
6
+ * this structure into the `permissionDecisionReason` body.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=summary-types.js.map
package/dist/index.d.ts CHANGED
@@ -1,9 +1,21 @@
1
1
  #!/usr/bin/env node
2
+ import type { HookMode } from "./types.js";
2
3
  export declare const CODE_EXTENSIONS: Set<string>;
3
4
  export declare function getVersion(): string;
4
5
  export declare function main(cliArgs?: string[]): Promise<void>;
5
6
  export declare function startServer(cliArgs?: string[]): Promise<void>;
6
- export declare function handleHookRead(filePathArg?: string, denyThreshold?: number): void;
7
+ export interface HookReadAdaptiveOptions {
8
+ adaptiveThreshold?: boolean;
9
+ adaptiveBudgetTokens?: number;
10
+ }
11
+ export declare function handleHookRead(filePathArg?: string, mode?: HookMode, denyThreshold?: number, projectRoot?: string, adaptive?: HookReadAdaptiveOptions): Promise<void>;
12
+ /**
13
+ * Pure implementation of the hook-read dispatch — returns the JSON payload
14
+ * to write to stdout, or null when we should pass-through (no output).
15
+ * Extracted for testability; the outer handleHookRead adds the process.exit
16
+ * wrapping.
17
+ */
18
+ export declare function runHookReadDispatch(filePathArg: string | undefined, mode: HookMode, denyThresholdArg?: number, projectRootArg?: string, adaptive?: HookReadAdaptiveOptions): Promise<string | null>;
7
19
  export declare function handleHookEdit(): void;
8
20
  export declare function handleInstallHook(projectRoot: string): Promise<void>;
9
21
  export declare function handleUninstallHook(projectRoot: string): Promise<void>;
@@ -11,8 +23,8 @@ export declare function handleInstallAstIndex(): Promise<void>;
11
23
  export declare function handleDoctor(): Promise<void>;
12
24
  export declare function handleInit(targetDir: string): Promise<void>;
13
25
  export declare function checkNpmLatest(packageName: string): Promise<string | null>;
14
- import type { TokenPilotConfig } from './types.js';
15
- import type { BinaryStatus } from './ast-index/binary-manager.js';
26
+ import type { TokenPilotConfig } from "./types.js";
27
+ import type { BinaryStatus } from "./ast-index/binary-manager.js";
16
28
  export declare function checkAllUpdates(config: TokenPilotConfig, binaryStatus: BinaryStatus): Promise<void>;
17
29
  export declare function printHelp(): void;
18
30
  //# sourceMappingURL=index.d.ts.map