Part of Phase 1 — Core skeleton (tasks.md Task 1.3).
Summary
Implement core/commands/registry.ts: the command bus every behavior in tecode goes through.
Details
register(id, handler, meta?) returns a Disposable; re-registering an existing ID replaces the handler (last-wins) and logs a warning.execute(id, ...args) is async and never throws: unknown ID and handler exceptions become HostErrors routed to a status sink (stub interface for now; the statusbar extension consumes it later). Returns undefined on failure, the handler's return value on success.list() returns { id, title, category, when }[] for the palette; no when-filtering here (callers filter).- Command IDs follow
namespace.verb; meta supports title, category, when.
Completion requirements
References
- requirements.md: Req 3.1–3.5
- design.md: §5
Dependencies
Blocked by: 1.2 (#3). Parallelizable with 1.4–1.10.
Part of Phase 1 — Core skeleton (tasks.md Task 1.3).
Summary
Implement
core/commands/registry.ts: the command bus every behavior in tecode goes through.Details
register(id, handler, meta?)returns aDisposable; re-registering an existing ID replaces the handler (last-wins) and logs a warning.execute(id, ...args)is async and never throws: unknown ID and handler exceptions becomeHostErrors routed to a status sink (stub interface for now; the statusbar extension consumes it later). Returnsundefinedon failure, the handler's return value on success.list()returns{ id, title, category, when }[]for the palette; no when-filtering here (callers filter).namespace.verb;metasupportstitle,category,when.Completion requirements
Command not found: <id>via the status sink and does not throwexecuteresolvesundefinedlist()metadatabun testand lint passReferences
Dependencies
Blocked by: 1.2 (#3). Parallelizable with 1.4–1.10.