Skip to content

[codex] Add slash command registry foundation#29

Merged
roackb2 merged 1 commit intomainfrom
codex/slash-command-registry
May 2, 2026
Merged

[codex] Add slash command registry foundation#29
roackb2 merged 1 commit intomainfrom
codex/slash-command-registry

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 2, 2026

Summary

This adds the M2 slash-command foundation without wiring it into the existing TUI command path yet.

Changes:

  • Add core slash command types for parsed input, commands, modules, hints, and matches.
  • Add a parser that rejects non-command input and absolute Unix paths.
  • Add a registry that composes command modules, supports command-owned match predicates, and rejects duplicate module ids, command ids, syntaxes, and aliases.
  • Add autocomplete helpers for shared-prefix completion and placeholder stripping.
  • Add unit coverage for exact, alias, prefix-style matching, duplicate detection, parsing, and autocomplete behavior.

Impact

This prepares M3+ to migrate command behavior out of src/cli/chat/state/local-commands.ts incrementally, while preserving the existing TUI command behavior for now.

Validation

  • yarn test:unit src/__tests__/unit/core/slash-commands.test.ts
  • yarn test:unit src/__tests__/unit/tui/local-commands.test.ts
  • yarn eslint
  • yarn typecheck

@roackb2 roackb2 marked this pull request as ready for review May 2, 2026 12:49
@roackb2 roackb2 merged commit 122cbb9 into main May 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant