Skip to content

feat(sdk): stage 5 — export adapter factories from package root#1432

Merged
vanceingalls merged 4 commits into
mainfrom
sdk-stage5-adapter-exports
Jun 15, 2026
Merged

feat(sdk): stage 5 — export adapter factories from package root#1432
vanceingalls merged 4 commits into
mainfrom
sdk-stage5-adapter-exports

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

Stage 5 — public adapter factory exports

Ships the public entry points for the SDK's adapter layer. The concrete adapters already existed internally (memory.ts, headless.ts, fs.ts) and pass the T13 contract suite, but index.ts only re-exported the type interfaces — so consumers had to reach into deep src/adapters/* paths to instantiate one. This wires them to the package root.

What's exported

Factory Adapter Use case
createHeadlessAdapter() PreviewAdapter (no-op) Agents, CI, SSR — no browser, no DOM
createMemoryAdapter() PersistAdapter (in-memory) Tests, demos, headless open with no storage backend
createFsAdapter(opts) PersistAdapter (node fs) Local dev — versioned history on disk

FsAdapterOptions is exported alongside createFsAdapter.

Why this completes the headless story

Agents and CI can now open a composition with zero browser and zero disk:

import { openComposition, createHeadlessAdapter, createMemoryAdapter } from "@hyperframes/sdk";

const session = await openComposition(html, {
  preview: createHeadlessAdapter(),
  persist: createMemoryAdapter(),
});

Scope

  • S3 / production HTTP adapters are post-Pacific — intentionally not included.
  • No new adapter implementations; this is purely the public export surface.

Verification

  • index.ts only, +6 lines
  • oxlint clean, oxfmt clean
  • sdk typecheck clean
  • 156/156 sdk tests pass

🤖 Generated with Claude Code

@james-russo-rames-d-jusso james-russo-rames-d-jusso left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verified at HEAD 7da2e36.

Trivial PR (+6 lines, single file). Adds createMemoryAdapter / createHeadlessAdapter / createFsAdapter + FsAdapterOptions to the package root entry. Diff is mechanical and the body explains the rationale clearly (the concrete adapters existed but only deep-paths could instantiate them).

Concern — stack-coherence flag (heads-up, not blocking this PR)

I cross-read sibling PRs in the same Graphite stack to verify import expectations. Two relevant observations:

  • #1441 (http persist adapter) adds createHttpAdapter to the same root index alongside this PR's exports — wire-coherent, no conflict.
  • #1443 (wire SDK session into Studio) removes createFsAdapter and FsAdapterOptions from the root index with the comment // Concrete adapter factories (browser-safe — Node-only fs adapter: @hyperframes/sdk/adapters/fs). and switches consumers to import from the @hyperframes/sdk/adapters/fs deep subpath instead.

So this PR's createFsAdapter root-level export is transient — it'll be reverted 5 PRs downstream in the same stack. The deep subpath ./adapters/fs already exists in packages/sdk/package.json on main, so consumers have a stable path either way.

That's not a blocker for #1432 — the rationale ("agents and CI can now open with zero browser") is real for the in-between PRs (#1434, #1429), and the headless + memory exports survive. But worth aligning intent: either:

  • (a) skip createFsAdapter from the root in this PR to match the eventual state in #1443, or
  • (b) leave as-is and accept the churn (which is what the current stack does).

Either is fine. Author's call.

No other findings. Mechanical export PR, oxlint/oxfmt/typecheck clean per the body, 156/156 tests pass.

Determinism: re-export only, no runtime code. N/A.

Verdict: approve.

Review by Rames D Jusso

jrusso1020
jrusso1020 previously approved these changes Jun 15, 2026

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved.

miguel-heygen
miguel-heygen previously approved these changes Jun 15, 2026

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tiny re-export PR — no logic changes. CI blocked by root oxfmt failure in #1423.

The packages/sdk/src/index.ts comment clarifying that createFsAdapter is Node-only and must be imported from @hyperframes/sdk/adapters/fs (not the browser-safe root) is exactly right. Good that createHttpAdapter now exports from the root since it's browser-safe.

Verdict: APPROVE (pending #1423 oxfmt fix)
Reasoning: Export cleanup is correct and the Node/browser split is now explicit.

— magi

@vanceingalls vanceingalls force-pushed the sdk-stage5-adapter-exports branch from 7da2e36 to 8f3a7ac Compare June 15, 2026 05:06
@vanceingalls vanceingalls changed the base branch from graphite-base/1432 to 06-14-feat_sdk_stage_4_canundo_canredo_removeelement_gsap_cascade_override-set_cleanup June 15, 2026 05:07
@vanceingalls vanceingalls force-pushed the 06-14-feat_sdk_stage_4_canundo_canredo_removeelement_gsap_cascade_override-set_cleanup branch from 33aa492 to 43f39ef Compare June 15, 2026 08:10
@vanceingalls vanceingalls force-pushed the sdk-stage5-adapter-exports branch from 8f3a7ac to 12e4a2b Compare June 15, 2026 08:13
vanceingalls and others added 3 commits June 15, 2026 02:03
… scoped ids

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
Internal planning artifact should not be committed to the repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
@vanceingalls vanceingalls force-pushed the 06-14-feat_sdk_stage_4_canundo_canredo_removeelement_gsap_cascade_override-set_cleanup branch from 43f39ef to 7e6f442 Compare June 15, 2026 09:03
Base automatically changed from 06-14-feat_sdk_stage_4_canundo_canredo_removeelement_gsap_cascade_override-set_cleanup to main June 15, 2026 09:07
@vanceingalls vanceingalls dismissed stale reviews from miguel-heygen and jrusso1020 June 15, 2026 09:07

The base branch was changed.

Expose the concrete adapter factories so consumers no longer reach into deep
adapter paths:
- createHeadlessAdapter — no-op PreviewAdapter for agents/CI/SSR (no browser)
- createMemoryAdapter — in-memory PersistAdapter for tests/headless open
- createFsAdapter (+ FsAdapterOptions) — node fs PersistAdapter for local dev

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the sdk-stage5-adapter-exports branch from 12e4a2b to 24ea332 Compare June 15, 2026 09:10
@vanceingalls vanceingalls merged commit f10f342 into main Jun 15, 2026
36 checks passed
@vanceingalls vanceingalls deleted the sdk-stage5-adapter-exports branch June 15, 2026 09:12
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.

4 participants