@@ -8,23 +8,24 @@ then into provider/session/runtime collaborators.
88
99## Command Mapping
1010
11- | User Command | Entry Function | Primary Path |
12- | ----------------------------- | -------------------------------- | ----------------------------------------------------- |
13- | ` :Codex ` | ` codex.toggle() ` | Toggle active terminal or open a focused session |
14- | ` :Codex! ` | ` codex.open(true) ` | Force-open and focus terminal |
15- | ` :CodexFocus ` | ` codex.focus() ` | Focus active session or open one |
16- | ` :CodexClose ` | ` codex.close() ` | Close active session and reset queue |
17- | ` :CodexClearInput ` | ` codex.clear_input() ` | Send ` <C-c> ` to active session |
18- | ` :CodexSend ` | ` codex.send_selection(opts) ` | Collect selection, format, send via queue |
19- | ` :CodexAdd [path] ` | ` codex.add_file(path) ` | Build ` /mention ` payload and submit |
20- | ` :CodexResume ` | ` codex.resume({ last = false }) ` | In-process ` /resume ` or launch ` codex resume ` |
21- | ` :CodexResume! ` | ` codex.resume({ last = true }) ` | Launch ` codex resume --last ` when opening new process |
22- | ` :CodexModel ` | ` codex.set_model() ` | Slash command wrapper (` /model ` ) |
23- | ` :CodexStatus ` | ` codex.show_status() ` | Slash command wrapper (` /status ` ) |
24- | ` :CodexPermissions ` | ` codex.show_permissions() ` | Slash command wrapper (` /permissions ` ) |
25- | ` :CodexCompact ` | ` codex.compact() ` | Slash command wrapper (` /compact ` ) |
26- | ` :CodexReview [instructions] ` | ` codex.review(instructions) ` | Slash command wrapper (` /review ... ` ) |
27- | ` :CodexDiff ` | ` codex.show_diff() ` | Slash command wrapper (` /diff ` ) |
11+ | User Command | Entry Function | Primary Path |
12+ | ------------------------------- | -------------------------------- | ----------------------------------------------------- |
13+ | ` :Codex ` | ` codex.toggle() ` | Toggle active terminal or open a focused session |
14+ | ` :Codex! ` | ` codex.open(true) ` | Force-open and focus terminal |
15+ | ` :CodexFocus ` | ` codex.focus() ` | Focus active session or open one |
16+ | ` :CodexClose ` | ` codex.close() ` | Close active session and reset queue |
17+ | ` :CodexClearInput ` | ` codex.clear_input() ` | Send ` <C-c> ` to active session |
18+ | ` :CodexSend ` | ` codex.send_selection(opts) ` | Collect selection, format, send via queue |
19+ | ` :CodexMentionFile [path] ` | ` codex.mention_file(path) ` | Build ` /mention ` payload for file and submit |
20+ | ` :CodexMentionDirectory [path] ` | ` codex.mention_directory(path) ` | Build ` /mention ` payload for directory and submit |
21+ | ` :CodexResume ` | ` codex.resume({ last = false }) ` | In-process ` /resume ` or launch ` codex resume ` |
22+ | ` :CodexResume! ` | ` codex.resume({ last = true }) ` | Launch ` codex resume --last ` when opening new process |
23+ | ` :CodexModel ` | ` codex.set_model() ` | Slash command wrapper (` /model ` ) |
24+ | ` :CodexStatus ` | ` codex.show_status() ` | Slash command wrapper (` /status ` ) |
25+ | ` :CodexPermissions ` | ` codex.show_permissions() ` | Slash command wrapper (` /permissions ` ) |
26+ | ` :CodexCompact ` | ` codex.compact() ` | Slash command wrapper (` /compact ` ) |
27+ | ` :CodexReview [instructions] ` | ` codex.review(instructions) ` | Slash command wrapper (` /review ... ` ) |
28+ | ` :CodexDiff ` | ` codex.show_diff() ` | Slash command wrapper (` /diff ` ) |
2829
2930## Setup Registration Flow
3031
@@ -145,27 +146,28 @@ init.lua send_selection()
145146 \- [not ready yet] -> queue + retry loop until ready/timeout
146147```
147148
148- ### ` :CodexAdd [path] `
149+ ### ` :CodexMentionFile [path] ` and ` :CodexMentionDirectory [path]`
149150
150151``` text
151- User runs :CodexAdd [path]
152+ User runs :CodexMentionFile [path] (or :CodexMentionDirectory [path])
152153 |
153154 v
154- commands.lua -> codex.add_file (path_or_nil)
155+ commands.lua -> codex.mention_file (path_or_nil) (or codex.mention_directory(path_or_nil) )
155156 |
156157 v
157- init.lua add_file (path)
158+ init.lua mention_file(path) / mention_directory (path)
158159 |- ensure_setup()
159- |- resolve path (arg or current buffer absolute path)
160- |- [missing path] -> log + return false, "current buffer has no file path"
160+ |- resolve path (arg or current buffer path via %:p / %:p:h )
161+ |- [missing path] -> log + return false, "current buffer has no file/directory path"
161162 |- path.to_relative(...)
162- |- formatter.format_mention(relative_path)
163- |- [active + alive] provider.focus(handle) before prompt capture
164- |- capture_terminal_prompt_input() (best effort)
165- |- mention_payload = clear_line_sequence + mention_text
166- \- dispatch_send(mention_payload, { open_focus=true, pre_focus=true, command_path="/mention", on_sent=... })
167- |- on_sent: submit_with_enter_key("/mention")
168- \- on_sent: restore captured prompt input via delayed dispatch_send(...)
163+ \- dispatch_mention(relative_path)
164+ |- formatter.format_mention(relative_path)
165+ |- [active + alive] provider.focus(handle) before prompt capture
166+ |- capture_terminal_prompt_input() (best effort)
167+ |- mention_payload = clear_line_sequence + mention_text
168+ \- dispatch_send(mention_payload, { open_focus=true, pre_focus=true, command_path="/mention", on_sent=... })
169+ |- on_sent: submit_with_enter_key("/mention")
170+ \- on_sent: restore captured prompt input via delayed dispatch_send(...)
169171```
170172
171173### ` :CodexResume ` and ` :CodexResume! `
0 commit comments