feat(shared): add dynamic-truncator utility for context-aware output truncation

Extract and generalize dynamic output truncation logic from grep-output-truncator.
Provides context window-aware truncation that adapts based on remaining tokens.

Features:
- truncateToTokenLimit(): Sync truncation with configurable header preservation
- getContextWindowUsage(): Get current context window usage from session
- dynamicTruncate(): Async truncation that queries context window state
- createDynamicTruncator(): Factory for creating truncator instance

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-14 10:54:05 +09:00
parent d3e317663e
commit 521bcd5667
2 changed files with 165 additions and 0 deletions

View File

@@ -9,3 +9,4 @@ export * from "./pattern-matcher"
export * from "./hook-disabled"
export * from "./deep-merge"
export * from "./file-utils"
export * from "./dynamic-truncator"