Skip to content

Core: move the controller's editor-agnostic half into @orbit-code/core #1

Description

@imshaikot

Part of the Zed work (tracked in #9). First step, because a second host needs it and it touches nothing Zed-specific.

Why

apps/vscode/src/controller.ts holds two halves: the editor-agnostic one (checking every webview message, the snapshot on ready, a SessionProjector per conversation, attachable files and skills, the MCP action and resume-id checks, the generation counter) and the VS Code one (the panel, env.openExternal, notifications, FileActions over WorkspaceEdit). The monorepo skill ("Adding an editor") says to split them before building another host; apps/server (#2) is that host.

What

  • Move the editor-agnostic half into packages/core (e.g. core/src/hostController.ts), behind a small interface the editor implements: send a message to the UI, open an external URL, notify (permission while hidden, busy, unavailable), and the file operations FileActions does today (git state, read/write against a revision, rename, delete, open in the editor, diff).
  • apps/vscode keeps OrbitController as the VS Code implementation of that interface plus the panel and commands. fileRequest() (what activate() returns for smoke) keeps its shape.
  • hostSim.ts is unaffected; check-wiring.mjs may need its paths updated (it reads controller.ts for the protocol and log lines: see the note in CLAUDE.md "Smoke test dependencies", the log lines must not be reworded).
  • CLAUDE.md Host table and the monorepo skill's "Adding an editor" table: point at the new module.

Checks

yarn typecheck && yarn boundaries && yarn build, node .claude/skills/orbit-extension/scripts/check-wiring.mjs, yarn harness (read the report), yarn smoke.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions