tasks
Implement editor extension Forma command client
Discover a preinstalled Forma binary and invoke structured CLI operations with cancellation, compatibility, and safe process handling.
Implement Editor Extension Forma Command Client
Goal
Provide one testable process boundary for locating and invoking a separately installed Forma binary.
Sources
In Scope
- Resolve an explicit user-level
forma.pathsetting before falling back toformaon the extension-hostPATH. - Treat workspace-scoped binary settings as restricted in untrusted workspaces.
- Run
forma --versionand expose missing, inaccessible, incompatible, and ready outcomes. - Execute structured CLI operations with an explicit workspace root and JSON output.
- Implement cancellation, timeout, bounded stdout/stderr capture, exit-code handling, JSON parse errors, and redacted logging.
- Validate operation and schema versions instead of best-effort interpretation of unknown output.
- Make process spawning injectable so unit tests use deterministic fake processes.
- Keep paths correct when the extension runs in a remote workspace extension host.
Out Of Scope
- Bundling or downloading Forma.
- Running workspace-provided executables automatically.
- Persistent HTTP, stdio RPC, daemon, or language-server lifecycle.
- Workspace selection and editor UI.
Acceptance Criteria
- Explicit user setting and
PATHlookup order are covered by tests. - Missing binary, incompatible version, timeout, cancellation, non-zero exit, invalid JSON, and passed-result cases are covered.
- Logs do not expose environment variables, credentials, or unbounded command output.
- The command client can call current config, health, check, inspect, and view commands through one typed interface.
- No network request is used to acquire Forma.