The extension's parser (src/stParser.ts) only understands the text format (st/1). stacktale can also be configured to write the reports as st-json/1 — one JSON object per line (NDJSON) — and today those files show up empty in the view. The MCP server already reads both formats; the editor extensions should reach parity.
What to do
In src/stParser.ts:
- Detect the format from the first non-blank, non-
# line: if it starts with {, it's st-json/1; otherwise the current st/1 path.
- For JSON, parse each line as a JSON object (skip blank lines; a half-written last line must be ignored, not throw). There are two record kinds — a full
report and a repeat (a re-occurrence). Map a report into the same StReport shape the text parser produces: id, timestamp, headline, culprit, frames, block (use the pretty-printed JSON as the block for copy-for-AI).
- Keep the public function signature (
parseReports(content)) unchanged so extension.ts doesn't care which format it got.
Reference
- The format spec: docs/FORMAT.md (the
st-json/1 section lists the exact fields).
- A working implementation to mirror: the MCP server's
StReportFile.parseJson in the main repo.
How to verify
Add a test to src/test/parser.test.ts with a small NDJSON sample (a report line + a repeat line) and assert id, timestamp, headline, and culprit. npm test must stay green.
Files: src/stParser.ts, src/test/parser.test.ts.
The extension's parser (
src/stParser.ts) only understands the text format (st/1). stacktale can also be configured to write the reports asst-json/1— one JSON object per line (NDJSON) — and today those files show up empty in the view. The MCP server already reads both formats; the editor extensions should reach parity.What to do
In
src/stParser.ts:#line: if it starts with{, it'sst-json/1; otherwise the currentst/1path.reportand arepeat(a re-occurrence). Map areportinto the sameStReportshape the text parser produces:id,timestamp,headline,culprit,frames,block(use the pretty-printed JSON as theblockfor copy-for-AI).parseReports(content)) unchanged soextension.tsdoesn't care which format it got.Reference
st-json/1section lists the exact fields).StReportFile.parseJsonin the main repo.How to verify
Add a test to
src/test/parser.test.tswith a small NDJSON sample (areportline + arepeatline) and assertid,timestamp,headline, andculprit.npm testmust stay green.Files:
src/stParser.ts,src/test/parser.test.ts.