Repository navigation
Releases
v0.4.0
v0.4.0
- Add optional
Scanner.OnReportWithOffsetsto locate reports in the original byte stream, including across writes. This lets consumers correlate status changes with surrounding output. Existing callbacks remain unchanged. (#11)
v0.3.1
v0.3.1
Performance release. No API or behaviour changes.
Changes
Stripperreturns writes with no OSC sequence unchanged. Writes containing other escape sequences, such as SGR colour codes, no longer take the per-byte path or allocate a copy.
Benchmarks
Apple M4, v0.3.0 → v0.3.1:
| Benchmark | MB/s | allocs/op |
|---|---|---|
| Stripper/ansi | 1486 → 1942 | 33 → 4 |
Full changes: v0.3.0...v0.3.1
v0.3.0
v0.3.0
Moves the Go module to the Buildkite organization following the repository transfer.
Breaking changes
- The module and import path is now
github.com/buildkite/osc7501, replacinggithub.com/wolfeidau/osc7501. Update imports and rungo get github.com/buildkite/osc7501@v0.3.0followed bygo mod tidy.
Unchanged
- Exported APIs and protocol behavior are unchanged from v0.2.1.
- No production Go implementation files changed.
Full changes: v0.2.1...v0.3.0
v0.2.1
v0.2.1
Performance release. No API or behaviour changes.
Changes
ScannerandStripperskip plain text. Outside an escape sequence they jump to the nextESCwithbytes.IndexByteinstead of stepping byte by byte.Parseallocates less. It no longer builds a map or splits the body, and converts values to strings only for known keys.ValidIDno longer allocates.- Adds benchmarks and a
make benchtarget.
Benchmarks
benchstat, n=10, Apple M4, v0.2.0 → v0.2.1:
| Benchmark | sec/op | allocs/op |
|---|---|---|
| Parse/minimal | 75.1ns → 25.4ns (−66%) | 3 → 1 |
| Parse/full | 994ns → 861ns (−13%) | 19 → 7 |
| Scanner/reports | 162.3µs → 25.5µs (−84%) | 896 → 256 |
| Stripper/reports | 250.3µs → 29.6µs (−88%) | 33 → 33 |
The "reports" streams are 128 KB of terminal output with 64 reports. Output with frequent SGR colour codes sees smaller gains than plain text.
Full changes: #6
v0.2.0
v0.2.0
Aligns Parse with the spec rev 0.4 Limits rule and makes rejections diagnosable.
Breaking changes
Parsereturns(Report, error)instead of(Report, bool). Replaceokwitherr == nil. Errors wrapErrNoState,ErrUnknownState,ErrLimit,ErrInvalidIDorErrInvalidText(test witherrors.Is) and name the failing field, e.g.osc7501: limit exceeded: app is 33 bytes, max 32.- Reports breaking a limit are discarded whole. Previously accepted, now rejected:
- keys over 16 bytes
appover 32 bytes- an invalid or oversized
id,app,titleormsgfollowed by a valid duplicate - bodies that cannot fit in a 4096-byte sequence
Unchanged
Scanner.OnReportfires only for accepted reports; rejected reports are dropped silently.- An
appwith invalid characters (within 32 bytes) is still treated as absent.
Thanks to @dannymidnight for the report in buildkite/terminal-to-html#289.
v0.1.0
v0.1.0
First release. A Go implementation of OSC 7501 program status (spec rev 0.4) with no dependencies outside the standard library.
- Emit:
ReporterwithWorking,Blocked,Done,Failed,IdleandClear. An invalid state, id, app or kind returnsErrInvalidReport; title and msg are sanitised and truncated to the protocol limits. - Parse:
Parsedecodes a report body and enforces the spec limits. - Scan:
Scanneris anio.Writerfilter that forwards bytes unchanged and callsOnReportandOnQuery.QueryReplyanswers a feature query. - Strip:
Stripperremoves reports and queries from text output, including sequences split across writes.
Pre-1.0: breaking changes bump the minor version.
This package was written with the help of an AI coding assistant (Claude Code) and is reviewed and maintained by a human maintainer.