CommandCodeAI / CommandCodeAI/command-code

ModApi gap: mods cannot read or write the live input field (blocks ghost-text / prefill / Space-to-accept)

Abierto
#658 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
4k
Forks
350
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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:

  1. 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, and widget is explicitly "not wired into the TUI yet").
  2. Prefill the input field so the user can edit before sending — impossible; no input-write API.
  3. Press Space to accept the suggestion into the field — impossible; transformInput fires 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 /j slash command or typing 1 — 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)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la referencia de ModApi en commandcode.ai/docs/mods e inspecciona las superficies existentes cmd.ui.notify, cmd.ui.setStatus, cmd.ui.widget y transformInput. Define el comportamiento de lectura y escritura de entradas, y determina si es necesario gestionar las pulsaciones de teclas; el trabajo estará terminado cuando los mods puedan admitir el flujo de trabajo solicitado de prellenado o de sugerencias interactivas sin depender de avisos ni de comandos slash.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Área
api, cli, developer-experience
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.