feat(kiro): add Kiro CLI session discovery and parsing#476
Open
inola-ww wants to merge 1 commit into
Open
Conversation
The Kiro provider previously only detected sessions from the Kiro IDE (VS Code-based) stored in globalStorage. This adds support for Kiro CLI (`kiro-cli chat`) sessions stored in ~/.kiro/sessions/cli/. CLI sessions use a different format: - .jsonl files with Prompt/AssistantMessage/ToolResults entries - Companion .json files with session metadata, model info, and per-turn metering usage (credits) Changes: - Add CLI session discovery (scans ~/.kiro/sessions/cli/ for .jsonl) - Add CLI JSONL parser that extracts turns, tools, and cost from metering_usage credits - Add CLI tool name mappings (read, write, shell, grep, glob) - Make CLI sessions dir configurable via third param to createKiroProvider for testability - Add unit tests for CLI session discovery and parsing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Kiro provider currently only detects sessions from the Kiro IDE (VS Code-based) stored in
globalStorage/kiro.kiroagent. This adds support for Kiro CLI (kiro-cli chat) sessions stored in~/.kiro/sessions/cli/.Problem
Users running
kiro-cli chathave their sessions stored in a different location (~/.kiro/sessions/cli/*.jsonl) with a different format than the IDE. Codeburn currently cannot detect these sessions.Changes
~/.kiro/sessions/cli/for.jsonlfiles, reads project name from companion.jsonmetadataPrompt/AssistantMessage/ToolResultsentry formatmetering_usagecredits from the session metadata (actual cost, not estimated)read,write,shell,grep,globtotoolNameMapKIRO_HOMEenv var: respects the override for users who relocated their.kirodirectorycliSessionsDirOverrideoncreateKiroProvider(defaults to non-scanning when IDE dir is overridden, so existing tests are unaffected)CLI session format
Testing
$HOME/.kiro/on all platforms (confirmed from binary), andpath.join(homedir(), '.kiro', ...)resolves correctly everywhere