ModApi gap: mods cannot read or write the live input field (blocks ghost-text / prefill / Space-to-accept)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- api, cli, developer-experience
Hướng nghiên cứu
Bắt đầu với tài liệu tham chiếu ModApi tại commandcode.ai/docs/mods và kiểm tra các surface hiện có là cmd.ui.notify, cmd.ui.setStatus, cmd.ui.widget và transformInput. Xác định hành vi đọc và ghi input, đồng thời xác định xem có cần xử lý thao tác nhấn phím hay không; công việc được xem là hoàn tất khi các mods có thể hỗ trợ workflow prefill hoặc đề xuất tương tác được yêu cầu mà không phụ thuộc vào thông báo hoặc lệnh slash.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ModApi gap: mods cannot read or write the live input field
Summary
The ModApi gives mods no way to read the current text in the input field or set/prefill it. transformInput only intercepts submitted text — it never sees what's being typed, and there's no cmd.ui.setInputText-style API. This blocks a whole class of UX (ghost-text suggestions, inline completion, input prefill) that pi-prompt-suggester and similar tools rely on.
Context
I built a prompt-suggester mod (https://github.com/burningportra/cmd-prompt-suggester) that aims to suggest the user's next prompt after each response — the pi-prompt-suggester UX. The core interaction I cannot implement:
- Show a suggestion as ghost text inside the input box — impossible; rendering is line-based only (
cmd.ui.notify/cmd.ui.setStatus/cmd.ui.widget, andwidgetis explicitly "not wired into the TUI yet"). - Prefill the input field so the user can edit before sending — impossible; no input-write API.
- Press Space to accept the suggestion into the field — impossible;
transformInputfires on submit, not on keystroke, so I can't fill the field or bind a key.
What I had to ship instead
- Suggestion rendered as a
💡 next:notice (line-based). - Accept via
/jslash command or typing1— because there's no way to inject text into the field.
This works, but it's a strict downgrade from pi's UX (ghost text + Space-to-accept), and it's the single most-requested feature for this kind of mod.
Proposed API (open to alternatives)
cmd.ui.getInputText(): string— read the current input field contents.cmd.ui.setInputText(text: string): void— replace/prefill the input field.- Optionally a keybinding hook (
hooks.onKeypress) so mods can respond to Space/Tab/arrows while typing.
Why it matters
The ModApi docs advertise "typed-input interception" as a first-class capability, but it only covers submitted input. Interactive suggestion/prefill is the natural next step, and it's what users expect from a "prompt suggester" mod.
Environment
- Command Code 1.15.0, macOS
- Docs read: commandcode.ai/docs/mods (ModApi reference, UI surface)
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4k
- Fork
- 350
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommandCodeAI/command-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#855 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CommandCodeAI/command-code#841 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#655 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/command-code#608 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
CommandCodeAI/command-code#893 ·
Tất cả issue của CommandCodeAI/command-code
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
get-convex/migrations#69 ·
-
Observer env strips CLAUDE_CODE_TMPDIR, which is the documented fix for a fatal temp-dir error Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
thedotmack/claude-mem#4161 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
connectrpc/connect-py#342 ·
-
01 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
plone/cookieplone-templates#471 ·