pi-rtk-optimizer 0.3.3 → 0.5.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +102 -67
  2. package/README.md +292 -290
  3. package/config/config.example.json +36 -35
  4. package/package.json +4 -4
  5. package/src/additional-coverage-test.ts +278 -0
  6. package/src/boolean-format.ts +3 -0
  7. package/src/command-rewriter-test.ts +160 -120
  8. package/src/command-rewriter.ts +594 -585
  9. package/src/config-modal-test.ts +168 -0
  10. package/src/config-modal.ts +613 -600
  11. package/src/config-store.ts +224 -217
  12. package/src/index-test.ts +54 -0
  13. package/src/index.ts +410 -289
  14. package/src/output-compactor-test.ts +500 -158
  15. package/src/output-compactor.ts +432 -349
  16. package/src/record-utils.ts +6 -0
  17. package/src/rewrite-bypass.ts +332 -173
  18. package/src/rewrite-pipeline-safety.ts +154 -0
  19. package/src/rewrite-rules.ts +255 -255
  20. package/src/rtk-command-environment.ts +64 -0
  21. package/src/runtime-guard-test.ts +42 -50
  22. package/src/runtime-guard.ts +14 -14
  23. package/src/techniques/build.ts +155 -155
  24. package/src/techniques/emoji.ts +91 -0
  25. package/src/techniques/git.ts +231 -229
  26. package/src/techniques/index.ts +10 -16
  27. package/src/techniques/linter.ts +151 -161
  28. package/src/techniques/path-utils.ts +67 -0
  29. package/src/techniques/rtk.ts +136 -0
  30. package/src/techniques/search.ts +67 -76
  31. package/src/techniques/source.ts +253 -253
  32. package/src/techniques/test-output.ts +172 -172
  33. package/src/test-helpers.ts +10 -0
  34. package/src/tool-execution-sanitizer.ts +69 -0
  35. package/src/types-shims.d.ts +192 -183
  36. package/src/types.ts +103 -114
  37. package/src/zellij-modal.ts +1001 -1001
  38. package/src/compat-commands.ts +0 -207
package/CHANGELOG.md CHANGED
@@ -1,67 +1,102 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [0.3.3] - 2026-03-07
11
-
12
- ### Added
13
- - Added rewrite bypass rules for structured `gh` output commands and non-interactive container shell sessions.
14
- - Added dedicated runtime guard helpers and test coverage for rewrite-mode availability behavior.
15
- - Added repository lockfile plus additional command rewriter and runtime guard tests.
16
-
17
- ### Changed
18
- - Updated README documentation to reflect rewrite bypass behavior, runtime guard semantics, source filtering details, and expanded development verification commands.
19
- - Added a dedicated `typecheck` script and expanded `check` to run typecheck plus the full test suite.
20
- - Routed `pnpm dlx` commands through the RTK proxy path instead of the generic pnpm wrapper.
21
-
22
- ### Fixed
23
- - Improved command tokenization so `sed` scripts, shell separators, redirects, and background operators do not break later rewrites.
24
- - Preserved exact `read` output at the 80-line smart-truncation threshold instead of compacting boundary-sized results.
25
- - Preserved userscript metadata blocks during source filtering.
26
- - Limited RTK-missing command suppression to rewrite mode so suggest mode still produces guidance.
27
-
28
- ## [0.3.2] - 2026-03-04
29
-
30
- ### Fixed
31
- - Use absolute GitHub raw URL for README image to fix npm display
32
-
33
- ## [0.3.1] - 2026-03-04
34
-
35
- ### Changed
36
- - Rewrote README.md with professional documentation standards
37
- - Added comprehensive feature documentation, configuration reference, and usage examples
38
-
39
- ## [0.3.0] - 2026-03-02
40
-
41
- ### Changed
42
- - Renamed extension/package from `rtk-integration` to `pi-rtk-optimizer` to better reflect its full purpose: RTK command rewrite plus tool-output compaction optimization.
43
- - Updated extension identity references across config path resolution, modal UI labeling, installation commands, package metadata, and build check artifact naming.
44
-
45
- ## [0.2.0] - 2026-03-02
46
-
47
- ### Changed
48
- - Reorganized extension into a publish-ready package layout:
49
- - moved implementation modules into `src/`
50
- - kept root `index.ts` as stable Pi auto-discovery entrypoint
51
- - added `config/config.example.json` for distributable config starter
52
- - Vendored modal UI dependency as `src/zellij-modal.ts` so the package no longer depends on sibling extension paths.
53
- - Updated TypeScript project includes for the new modular layout.
54
-
55
- ### Added
56
- - Public repository scaffolding:
57
- - `README.md`
58
- - `CHANGELOG.md`
59
- - `LICENSE`
60
- - `.gitignore`
61
- - `.npmignore`
62
- - Distribution metadata in `package.json`:
63
- - `description`, `keywords`, `files`, `engines`, `publishConfig`, repository links
64
- - standard `build`, `lint`, `test`, and `check` scripts
65
- - Credits section referencing upstream inspiration projects:
66
- - `mcowger/pi-rtk`
67
- - `rtk-ai/rtk`
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.5.0] - 2026-03-23
11
+
12
+ ### Added
13
+ - RTK_DB_PATH environment variable support for rewritten commands enables RTK history database isolation per session
14
+ - Tool execution sanitizer to strip RTK self-diagnostics from streamed bash results before TUI rendering
15
+ - Tracking of active bash commands by tool call ID for output sanitization
16
+ - `rtk-command-environment.ts` module for platform-specific temp directory resolution and shell-safe quoting
17
+
18
+ ### Changed
19
+ - Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to ^0.62.0
20
+ - Simplified RTK hook warning detection removed unused command-specific patterns and consolidated detection logic
21
+ - Focus on canonical hook warning messages that RTK emits
22
+ - Updated tests to verify simplified behavior and ensure non-hook RTK output is preserved verbatim
23
+
24
+ ### Tests
25
+ - Added additional coverage tests for edge cases
26
+ - Added tests for output compactor behavior with RTK diagnostics
27
+ - Added tests for emoji stripping in RTK output
28
+
29
+ ## [0.4.0] - 2026-03-12
30
+
31
+ ### Added
32
+ - Command rewrite bypass system with safety patterns for dangerous operations
33
+ - `shouldBypassWholeCommandRewrite` to prevent rewriting of unsafe compound commands
34
+ - Bypass patterns for `find`, `grep`, `rg`, `ls` with action detection
35
+ - Inline command flag detection for `bash`, `powershell`, and `cmd` shells
36
+ - `path-utils` module for cross-technique path handling
37
+ - Comprehensive test coverage with shared test helpers
38
+ - Additional coverage tests for edge cases
39
+
40
+ ### Changed
41
+ - Extended `rewrite-bypass` with bypass patterns for interactive container shells
42
+ - Improved command rewriter test coverage
43
+ - Removed deprecated `compat-commands` module
44
+
45
+ ## [0.3.3] - 2026-03-07
46
+
47
+ ### Added
48
+ - Added rewrite bypass rules for structured `gh` output commands and non-interactive container shell sessions.
49
+ - Added dedicated runtime guard helpers and test coverage for rewrite-mode availability behavior.
50
+ - Added repository lockfile plus additional command rewriter and runtime guard tests.
51
+
52
+ ### Changed
53
+ - Updated README documentation to reflect rewrite bypass behavior, runtime guard semantics, source filtering details, and expanded development verification commands.
54
+ - Added a dedicated `typecheck` script and expanded `check` to run typecheck plus the full test suite.
55
+ - Routed `pnpm dlx` commands through the RTK proxy path instead of the generic pnpm wrapper.
56
+
57
+ ### Fixed
58
+ - Improved command tokenization so `sed` scripts, shell separators, redirects, and background operators do not break later rewrites.
59
+ - Preserved exact `read` output at the 80-line smart-truncation threshold instead of compacting boundary-sized results.
60
+ - Preserved userscript metadata blocks during source filtering.
61
+ - Limited RTK-missing command suppression to rewrite mode so suggest mode still produces guidance.
62
+
63
+ ## [0.3.2] - 2026-03-04
64
+
65
+ ### Fixed
66
+ - Use absolute GitHub raw URL for README image to fix npm display
67
+
68
+ ## [0.3.1] - 2026-03-04
69
+
70
+ ### Changed
71
+ - Rewrote README.md with professional documentation standards
72
+ - Added comprehensive feature documentation, configuration reference, and usage examples
73
+
74
+ ## [0.3.0] - 2026-03-02
75
+
76
+ ### Changed
77
+ - Renamed extension/package from `rtk-integration` to `pi-rtk-optimizer` to better reflect its full purpose: RTK command rewrite plus tool-output compaction optimization.
78
+ - Updated extension identity references across config path resolution, modal UI labeling, installation commands, package metadata, and build check artifact naming.
79
+
80
+ ## [0.2.0] - 2026-03-02
81
+
82
+ ### Changed
83
+ - Reorganized extension into a publish-ready package layout:
84
+ - moved implementation modules into `src/`
85
+ - kept root `index.ts` as stable Pi auto-discovery entrypoint
86
+ - added `config/config.example.json` for distributable config starter
87
+ - Vendored modal UI dependency as `src/zellij-modal.ts` so the package no longer depends on sibling extension paths.
88
+ - Updated TypeScript project includes for the new modular layout.
89
+
90
+ ### Added
91
+ - Public repository scaffolding:
92
+ - `README.md`
93
+ - `CHANGELOG.md`
94
+ - `LICENSE`
95
+ - `.gitignore`
96
+ - `.npmignore`
97
+ - Distribution metadata in `package.json`:
98
+ - `description`, `keywords`, `files`, `engines`, `publishConfig`, repository links
99
+ - standard `build`, `lint`, `test`, and `check` scripts
100
+ - Credits section referencing upstream inspiration projects:
101
+ - `mcowger/pi-rtk`
102
+ - `rtk-ai/rtk`