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

未关闭
#2,911 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Java
星标
10.7k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-sdk 的其他 Issue

查看 github/copilot-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。