stacklok / stacklok/mecatl

Story: expose mecatui workflows through the TypeScript SDK

Open
#1,466 0 comments 0 reactions 1 assignee View on GitHub

@samuv is already working on this.

Since Sep 14, 2026.

enhancement sdk
Dominant language
Go
Stars
152
Forks
16
Avg merge
14h 48m
Merged PRs (30d)
536

Description

User story

As an SDK consumer, I want programmatic access to the reusable workflows available in mecatui, so I can build clients with equivalent capabilities without reproducing protocol choreography or invoking TUI command strings.

Problem

The TypeScript SDK has raw transport coverage for every public HarnessService and ScheduleService RPC, but several common workflows remain ergonomic only in mecatui. Raw descriptor reachability is not sufficient discoverability for applications using the normal Client and Session APIs.

The TUI command palette also mixes several kinds of behavior: server operations, multi-RPC workflows, local configuration, and presentation-only actions. Mirroring those command names as a generic SDK command API would couple the SDK to one client and blur authority boundaries.

Direction

Expose reusable capabilities as typed SDK operations:

  • server-owned authorization, validation, lifecycle truth, and atomicity remain on the server;
  • the SDK owns session binding, typed requests and responses, streaming lifecycle, cancellation, and correlation;
  • applications own rendering, pickers, filtering, clipboard integration, browser opening, and local preferences.

Server-discovered workspace commands remain separate. Applications list them through the commands namespace and invoke them as a normal run, leaving expansion on the server.

Workstreams

This story is implemented through native sub-issues grouped by independently reviewable category:

  • complete the ergonomic session lifecycle surface;
  • expose compatibility, capability, and server information;
  • expose MCP connector inventory and workspace enrollment;
  • design and implement MCP authorization lifecycle ergonomics;
  • add high-level coverage classification, tests, documentation, and examples.

Acceptance criteria

  • SDK consumers can perform the functional equivalents of session inspection, transcript retrieval, rename, clear, failed-step retry, manual compaction, permission-mode changes, model/effort forks, and worktree selection without constructing raw descriptor calls.
  • Compatibility and operator-enabled capability information is available without creating a probe session.
  • MCP connector, workspace-enrollment, and authorization workflows have discoverable typed APIs.
  • Stateful streaming workflows preserve session affinity, cancellation, request options, typed errors, and single-consumption guarantees.
  • Successor-producing operations do not silently destroy the source session.
  • Server authority remains definitive; the SDK does not reproduce the TUI phase machine or deferred UI retry policies.
  • Every public RPC and every TUI builtin has an explicit high-level-surface classification.
  • gRPC and HTTP behavior remains parity-tested where supported.
  • Public API reports, user documentation, examples, and the SDK changelog are updated.

Out of scope

  • A generic commands.execute() API for TUI builtins.
  • TUI rendering, overlays, filtering, keybindings, short handles, and clipboard behavior.
  • /help, /quit, /debug-ask, or other presentation/debug-only actions.
  • Saved-target selection, automatic browser opening, or application-owned credential UX.
  • TUI-local model-default and learning-setting persistence.
  • Local provider configuration and credential-management commands.
  • Client-side duplication of server authorization or lifecycle rules.

Architecture note

ADR 0304 currently establishes thin namespaces for non-session RPCs and limits new ergonomic resource handles. If MCP authorization requires a lifecycle handle, its sub-issue must record a superseding architectural decision before implementation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.