mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-17 03:56:45 +00:00
Some checks are pending
CI / semgrep (push) Waiting to run
* Add IBM Bob provider * Add workspace extraction for Cline-family providers Extract project name from workspace directory in api_conversation_history.json so sessions show actual folder names instead of the provider display name. Thread projectPath through ParsedProviderCall to avoid unsanitizePath mangling hyphenated folder names. --------- Co-authored-by: ozymandiashh <234437643+ozymandiashh@users.noreply.github.com> Co-authored-by: iamtoruk <hello@agentseal.org>
2.7 KiB
2.7 KiB
vscode-cline-parser (Shared Helper)
Shared discovery and parsing for Cline-family task folders.
- Source:
src/providers/vscode-cline-parser.ts - Loading: not a provider; imported by
ibm-bob.ts,kilo-code.ts, androo-code.ts. - Test: none directly. Coverage comes from
tests/providers/ibm-bob.test.ts,tests/providers/kilo-code.test.ts, andtests/providers/roo-code.test.ts.
What it does
Two responsibilities:
discoverClineTasks(extensionId)walks VS Code'sglobalStorage/<extensionId>/tasks/directories and returns one source per task that has aui_messages.jsonfile.discoverClineTasksInBaseDirs(baseDirs)does the same for non-VS Code apps with compatible task storage, such as IBM Bob.createClineParserreads each task'sui_messages.jsonandapi_conversation_history.json, extracts model and token counts, and yieldsParsedProviderCallobjects.
Storage layout
Per task directory:
<globalStorage>/<extensionId>/tasks/<taskId>/
ui_messages.json # event stream
api_conversation_history.json # full prompt history with model tags
Model resolution
The model is extracted from api_conversation_history.json by searching user message content blocks for a <model>...</model> tag. Falls back to the provider-supplied auto model (cline-auto by default) if no tag is found.
Token extraction
From api_req_started entries inside ui_messages.json. Each such entry's text field is JSON-parsed; the parsed object holds tokensIn, tokensOut, cacheReads, cacheWrites, and (optionally) cost.
If cost is present, it is used directly. If not, calculateCost from src/models.ts computes it from tokens.
Deduplication
Per <providerName>:<taskId>:<index> where index is the position of the api_req_started entry within ui_messages.json.
Quirks
- Only the first user message is emitted as
userMessagein theParsedProviderCall. Subsequent user turns are accounted but not surfaced. - The model regex looks inside content blocks, not at top-level fields. Some Cline-derivative extensions emit the model elsewhere; if you add support for one, branch on extension ID rather than rewriting the regex.
When fixing a bug here
- A change here ripples to IBM Bob, KiloCode, and Roo Code. Run all three provider test files before opening a PR.
- If you find that one of the two extensions emits a different shape, branch on the extension ID parameter that the discovery function already takes; do not duplicate the parser.
- If you add support for another Cline-family task store, register it as a thin wrapper file in the same shape as
ibm-bob.ts,kilo-code.ts, androo-code.ts.