Skip to content

Extract session readers into @liwala/agent-sessions workspace package#18

Merged
luisalima merged 3 commits into
mainfrom
extract-session-parser
Apr 30, 2026
Merged

Extract session readers into @liwala/agent-sessions workspace package#18
luisalima merged 3 commits into
mainfrom
extract-session-parser

Conversation

@luisalima
Copy link
Copy Markdown
Contributor

Summary

  • Move all session/transcript readers (Claude Code, Codex, Amp, Gemini CLI, Entire.io) out of src/entire/ into a new @liwala/agent-sessions workspace package, so the parsers can be consumed standalone (npm install @liwala/agent-sessions).
  • Sheal now depends on the workspace package (^0.0.1); all consumers updated to import from @liwala/agent-sessions.
  • Extraction polish: NativeProject moved to shared types.ts (no Claude-specific module ownership), runGit helper inlined privately into entire-reader.ts (drops a duplicate of src/utils/exec.ts), dead totalFiles removed in amp.ts, multi-line same-package imports coalesced across consumers.
  • Workspace build hardening: clean step wipes dist/ before each tsc (so a deleted source can't ship as a stale output), prepublishOnly enforces a fresh build, and CI now runs npm run build instead of npx tsc so workspace dist exists before vitest runs.
  • LICENSE copied into the package directory so the published tarball matches the manifest's files: [..., "LICENSE"] claim.

Test plan

  • npm run build from a clean state (both dist/ dirs removed) — succeeds, workspace cleaned + rebuilt before root tsc
  • npx vitest run — 254/254 pass
  • npx tsc --noEmit — clean
  • cd packages/agent-sessions && npm pack --dry-run — tarball includes LICENSE, no stale exec.* files, 19 entries total
  • Verify CI green on this PR

🤖 Generated with Claude Code

luisalima and others added 3 commits April 29, 2026 07:52
Moves src/entire/ into packages/agent-sessions/ as a standalone npm
workspace package; sheal now consumes session-reading via the package
barrel instead of internal imports.

- New package: @liwala/agent-sessions@0.0.1 (MIT, Node >=22)
- Renames drop the misleading "Entire.io" framing now that the package
  also houses native readers for Claude, Codex, Amp, and Gemini:
    claude-native.ts → claude.ts
    codex-native.ts  → codex.ts
    amp-native.ts    → amp.ts
    gemini-native.ts → gemini.ts
    reader.ts        → entire-reader.ts
- Barrel expanded to re-export everything sheal previously deep-imported
  (amp/codex/gemini functions and types) so all consumers reach for
  @liwala/agent-sessions only — no subpath imports.
- exec helper copied into the package so it has zero internal deps on
  sheal; sheal keeps src/utils/exec.ts for its other callers.
- npm workspace wires everything up: root build runs the workspace
  build first, then sheal.

All 254 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add LICENSE to the package (was declared in files[] but missing).
- Pin sheal -> agent-sessions dep to ^0.0.1 instead of "*".
- Move NativeProject from claude.ts to types.ts so amp/codex/gemini
  don't depend on a Claude-specific module.
- Inline exec helper into entire-reader.ts as a private runGit and
  drop packages/agent-sessions/src/exec.ts (was byte-identical to
  src/utils/exec.ts).
- Remove dead totalFiles in amp.ts.
- Coalesce per-file imports from @liwala/agent-sessions and replace
  inline import("...") types in retro.ts with bare references.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI was running `npx tsc` then `npx vitest run` after `npm ci`, but
`packages/agent-sessions/dist/` is gitignored and never built — every
test that imports `@liwala/agent-sessions` would fail to resolve.
Switch CI to `npm run build`, which already builds workspaces first.

Also: tsc never removes outputs for deleted sources, so removing
src/exec.ts left dist/exec.* lingering in the package tarball. Add a
`clean` step to the workspace build and a `prepublishOnly` guard so a
stale dist can't ship.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@luisalima luisalima merged commit 11fda5e into main Apr 30, 2026
1 check failed
@luisalima luisalima deleted the extract-session-parser branch May 7, 2026 13:48
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.

1 participant