Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
768 changes: 768 additions & 0 deletions docs/design/slash-command/phase3-technical-design.md

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions docs/design/slash-command/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,11 @@

#### 3.5 Claude Code 缺失命令补齐

补充 Qwen Code 当前没有、Claude Code 有且常用的命令:
确认并回归 Qwen Code 已有的 `/doctor` 命令;`/release-notes` 不纳入本阶段,避免引入无明确产品需求的 built-in 命令表面。

| 命令 | 类型 | 说明 |
| ---------------- | ------- | ---------------------------------------- |
| `/doctor` | `local` | 环境自检,输出配置/连接/工具状态诊断 |
| `/release-notes` | `local` | 展示当前版本的更新日志 |
| `/cost` | `local` | 展示当前 session 的 token 消耗和费用估算 |
| 命令 | 类型 | 说明 |
| --------- | ------- | ------------------------------------ |
| `/doctor` | `local` | 环境自检,输出配置/连接/工具状态诊断 |

> 注:`/review`、`/commit` 等任务类命令以 bundled skill 形式提供,不在此列。

Expand All @@ -275,10 +273,11 @@
- [ ] 近期使用的命令在补全列表中优先出现
- [ ] alias 命中时在补全项中注明原名
- [ ] mid-input slash:ghost text 提示正确渲染
- [ ] `/help` 输出按来源分组,每条命令展示支持模式标记
- [ ] `/help` 以 Claude Code 风格分 tab 展示,避免命令堆砌,并在命令页展示支持模式标记
- [ ] ACP available commands 包含 `argumentHint`、`source`、`subcommands` 字段
- [ ] `/doctor`、`/release-notes`、`/cost` 三个命令可用
- [ ] `/doctor` 命令可用
- [ ] `/doctor` 在 non-interactive 模式下可执行(返回 `message`)
- [ ] 不新增 `/release-notes`

---

Expand Down
42 changes: 42 additions & 0 deletions packages/cli/src/acp-integration/session/Session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
} from '@agentclientprotocol/sdk';
import type { LoadedSettings } from '../../config/settings.js';
import * as nonInteractiveCliCommands from '../../nonInteractiveCliCommands.js';
import { CommandKind } from '../../ui/commands/types.js';

vi.mock('../../nonInteractiveCliCommands.js', () => ({
ALLOWED_BUILTIN_COMMANDS_NON_INTERACTIVE: [
Expand Down Expand Up @@ -250,6 +251,23 @@ describe('Session', () => {
description: 'Initialize project context',
kind: 'built-in',
argumentHint: '[path]',
source: 'builtin-command',
sourceLabel: 'Built-in',
supportedModes: ['interactive', 'non_interactive', 'acp'],
modelInvocable: false,
subCommands: [
{
name: 'visible',
description: 'Visible subcommand',
kind: CommandKind.BUILT_IN,
},
{
name: 'hidden',
description: 'Hidden subcommand',
kind: CommandKind.BUILT_IN,
hidden: true,
},
],
},
]);

Expand All @@ -269,6 +287,14 @@ describe('Session', () => {
name: 'init',
description: 'Initialize project context',
input: { hint: '[path]' },
_meta: {
argumentHint: '[path]',
source: 'builtin-command',
sourceLabel: 'Built-in',
supportedModes: ['interactive', 'non_interactive', 'acp'],
subcommands: ['visible'],
modelInvocable: false,
},
},
],
},
Expand Down Expand Up @@ -298,6 +324,14 @@ describe('Session', () => {
name: 'export',
description: 'Export conversation history',
input: { hint: '' },
_meta: {
argumentHint: undefined,
source: undefined,
sourceLabel: undefined,
supportedModes: ['interactive'],
subcommands: ['md'],
modelInvocable: false,
},
},
],
},
Expand Down Expand Up @@ -333,6 +367,14 @@ describe('Session', () => {
name: 'init',
description: 'Initialize project context',
input: null,
_meta: {
argumentHint: undefined,
source: undefined,
sourceLabel: undefined,
supportedModes: ['interactive'],
subcommands: [],
modelInvocable: false,
},
},
],
_meta: {
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/src/acp-integration/session/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import {
needsConfirmation,
isPlanModeBlocked,
} from '@qwen-code/qwen-code-core';
import { getCommandSubcommandNames } from '../../services/commandMetadata.js';
import { getEffectiveSupportedModes } from '../../services/commandUtils.js';

import { RequestError } from '@agentclientprotocol/sdk';
import type {
Expand Down Expand Up @@ -1270,6 +1272,14 @@ export class Session implements SessionContext {
name: cmd.name,
description: cmd.description,
input: acceptsInput ? { hint: cmd.argumentHint ?? '' } : null,
_meta: {
argumentHint: cmd.argumentHint,
source: cmd.source,
sourceLabel: cmd.sourceLabel,
supportedModes: getEffectiveSupportedModes(cmd),
subcommands: getCommandSubcommandNames(cmd),
modelInvocable: cmd.modelInvocable === true,
},
};
});

Expand Down
Loading
Loading