Skip to content

feat: add machine-readable JSON continuation envelopes#51

Merged
yusukebe merged 8 commits into
yusukebe:mainfrom
yearth:codex/json-envelope-ready
Jul 24, 2026
Merged

feat: add machine-readable JSON continuation envelopes#51
yusukebe merged 8 commits into
yusukebe:mainfrom
yearth:codex/json-envelope-ready

Conversation

@yearth

@yearth yearth commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add --json-envelope for structured { data, meta } output
  • expose more, complete, and past_end states with an exact nextOffset for safe continuation
  • support selector, row, table, and locate output while preserving the existing top-level array returned by --json
  • reject incompatible output modes before source I/O and document the continuation workflow

Testing

  • bun test — 145 passed
  • bun test test/cli.test.ts — 64 passed
  • bunx tsc --noEmit
  • bun run format
  • bun run build
  • compiled two-page continuation smoke: morecomplete, with no overlap or gaps

Comment thread src/lib/emit.ts Outdated
total: number
offset: number
returned: number
nextOffset: number | null

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nextOffset should be next_offset because other names use snake_case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. This was an oversight in my review of the repository’s JSON naming convention. I’ve renamed the public field to next_offset and checked the rest of this PR for similar JSON naming issues; I didn’t find any others.

@yusukebe yusukebe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe

Copy link
Copy Markdown
Owner

@yearth

Thank you for the PR and the quick fix. This is a good feature!

@yusukebe
yusukebe merged commit 2d3afe1 into yusukebe:main Jul 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants