Skip to content

Command wire contracts (types) #1087

Closed

Description

@amrmelsayed

Summary

The wire-contract layer for a controller-agnostic command relay: a controller
(an external control device or companion app) drives the active editor provider
by sending canonical verbs over Tower's existing SSE + REST. Pure, additive type
definitions in @cluesmith/codev-types; no behaviour, no policy, no runtime.

Functionality

command.ts — content-named contracts shared by the Tower relay (#1088) and the
VSCode command provider (#1089):

  • CommandRequest { verb, args } — a controller asks the active provider to run a
    canonical verb (view-diff, forward-hunk, ...); args carries verb operands.
  • CommandResult { ok, error? } — the /api/command response shape.
  • COMMAND_ROUTE (/api/command) and COMMAND_EVENT (command) — the single
    source for the route path and SSE event-type name, so all three packages stay in
    lockstep instead of repeating string literals.

Acceptance

  • Additive only; @cluesmith/codev-types builds; existing consumers unaffected.

Deferred (kept out to avoid unused/duplicative code on main)

  • Editor observation contracts (scroll / position / context, and their demand
    signal): scrolling has a native keyboard equivalent (no relay needed), and zoom
    navigation is driven by the overview API + controller-side state, so no editor
    feed is required by the command relay. A context feed would only return to gate
    the controller's buttons; it travels with the controller if that polish is wanted.
  • resolveBuilderActions (builder-action policy): no consumer in the relay, and
    duplicates the sidebar's per-protocol action gating. Lands with its first
    consumer (the controller) or the sidebar-convergence work.
  • OverviewBuilder.prUrl: the open-PR-url join already exists (the dashboard's
    NeedsAttentionList matches pr.linkedIssue → builder, and overview.ts has the
    merged-PR issueToPrUrl map). A builder prUrl field has no consumer here, so
    it travels with the controller or a dashboard-consolidation issue.

Activity

  1. added
    area/core
    on Jun 21, 2026
  2. self-assigned this
    on Jun 21, 2026
  3. changed the title [-]Editor/command wire contracts + builder-action policy (core)[/-] [+]Editor/command wire contracts (types)[/+] on Jun 21, 2026
  4. changed the title [-]Editor/command wire contracts (types)[/-] [+]Command wire contracts (types)[/+] on Jun 21, 2026
  5. added a commit that references this issue on Jun 21, 2026
    0212bf8
  6. added a commit that references this issue on Jun 25, 2026
    6fe184e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/core

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions