Extension commands: let `CommandDefinition` declare an input hint and choices

Aperta
#2,911 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start by reading the TypeScript definition of CommandDefinition and the SlashCommandInput type, then trace where CopilotClient sends commands during session.create and session.resume. Add the input shape to the definition and forward it with each command; done when client commands can provide the hint and choices described in the issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context

Built-in commands show users what they accept as they type. /computer draws [on|off|show] after its name and lists each choice with its description, so a user can find and pick a subcommand without leaving the prompt. Extension commands cannot do this: the slash menu shows an extension command's description and nothing about what it accepts. Users of an extension command with subcommands (in our case a voice extension's on, off, status, listen, stop, and five more) must remember them or run a help subcommand to find them. The alternative, one command per action, crowds the slash menu.

The runtime already models this. SlashCommandInfo, which session.commands.list returns, has an experimental input?: SlashCommandInput: a hint, literal choices that each have a description, plus required and completion. The SlashCommandInputChoice docs use /computer's values as their example. But CommandDefinition takes only name, description and handler, and CopilotClient sends just { name, description } to the runtime on session.create and session.resume. This is the same in 1.0.29 and 1.0.30-preview.1, with CLI 1.0.107.

Request

Let CommandDefinition carry the existing input shape, and forward it with the command:

export interface CommandDefinition {
    name: string;
    description?: string;
    /** Shown as for built-in commands: the hint after the name, the choices as completions. */
    input?: SlashCommandInput;
    handler: CommandHandler;
}

A kind: "client" command would then render its hint and choices the same way a built-in command does.

Lingua principale
Java
Stelle
10.7k
Fork
1.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/copilot-sdk

Tutte le issue di github/copilot-sdk

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.