Skip to content

refactor(ambion): split application surface from host and protocol exports - #63

Open
andreisavu wants to merge 2 commits into
mainfrom
codex/refactor-application-surface-and-exports
Open

andreisavu wants to merge 2 commits into
mainfrom
codex/refactor-application-surface-and-exports

Conversation

@andreisavu

Copy link
Copy Markdown
Contributor

Motivation

  • Make the package root a small, well-documented application surface focused on agents, humans, tools, workspaces, sessions, visits, messages and session events so application authors import only what they need.
  • Surface host integration points (Runtime, Transport, Clock, session repo helpers, workspace backends) separately for embedding environments to implement host-specific concerns.
  • Expose the advanced, JSON-safe seat protocol separately for transport authors so only the transport implementation depends on low-level wire shapes and seat actor types.

Description

  • Reduced packages/ambion/src/index.ts to the application-facing API and moved host integration exports into a new packages/ambion/src/host.ts module that re-exports runtime, session repo and workspace backend types and helpers.
  • Added packages/ambion/src/protocol.ts to export SeatActor, inProcessTransport, wire assertion helpers and the JSON-safe types (Commit, LeaseRow, ViewResponse, Wake, etc.) needed by a transport implementation.
  • Updated packages/ambion/tsdown.config.ts and packages/ambion/package.json to build and publish explicit subpath exports for . (application), ./host, and ./protocol.
  • Migrated internal tests to import from the appropriate surface (root, /host or /protocol), added lightweight compile fixtures in packages/ambion/test/imports/*, and revised README.md and packages/ambion/README.md so the first example uses only the root package.

Testing

  • Built the package with pnpm --filter @ambionframework/ambion run build using Node.js 22.19.0 and tsdown, and the build completed successfully.
  • Type-checked the package with tsc --noEmit -p packages/ambion/tsconfig.json (Node.js 22.19.0) with no type errors after updating test imports.
  • Ran the test suite with pnpm --filter @ambionframework/ambion test (Node.js 22.19.0), which executed 20 test files and passed 371 tests.
  • Ran git diff --check to ensure no whitespace/punct issues; attempted lint with biome but the tool was not available in the runtime so the lint step was not executed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant