Skip to content

Arch: adapter-sdk bootstrap.ts contains adapter-specific implementation #1458

Description

@nick-pape

Category: Leaking Abstraction

Problem

packages/adapter-sdk/src/bootstrap.ts (632 lines) is an implementation file with hardcoded logic for specific adapters, baked into what should be a generic SDK:

  1. Codespace paths: /workspaces/*/ detection (line 146-149), /workspaces/.codespaces/shared/.env token read (line 389)
  2. Docker host: "0.0.0.0" assumption in StartRemotePowerLineOptions.host (line 141)
  3. POSIX-only: $HOME/.grackle/powerline in REMOTE_POWERLINE_DIRECTORY (utils.ts line 8) — Windows agents can't use this
  4. Implementation, not SDK: npm install timeouts (line 21), git credential helpers (lines 514-532), runtime catalog integration (lines 534-607), hardcoded npm registry URLs (lines 475, 582)

Proposed Fix

  1. Extract workspace detection into adapters via a WorkspaceDetector interface
  2. Move .codespaces token logic into CodespaceAdapter
  3. Move Docker host config into DockerAdapter
  4. Refactor bootstrapPowerLine() into composable utilities that adapters call, rather than a monolithic function

The SDK should export interfaces and utilities. Adapter-specific implementation belongs in the adapter packages.

Impact

High — generic SDK is not generic. Adding a new adapter type means working around codespace/docker assumptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode improvement, no behavior change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions