feat: 添加工具类命令(teleport、recap、break-cache、env、tui 等)

- /teleport: 从 claude.ai 恢复会话
- /recap: 生成会话摘要
- /break-cache: 提示缓存管理(once/always/off/status)
- /env: 环境信息展示(含密钥脱敏)
- /tui: 无闪烁 TUI 模式管理
- /onboarding: 引导流程
- /perf-issue: 性能问题诊断
- /debug-tool-call: 工具调用调试
- /usage: 用量统计(合并 /cost 和 /stats 别名)

Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-05-09 23:04:31 +08:00
parent 6766f08e47
commit fdddb6dbe8
38 changed files with 5494 additions and 43 deletions

View File

@@ -1,6 +1,7 @@
import axios from 'axios';
import chalk from 'chalk';
import { randomUUID } from 'crypto';
import React from 'react';
import { getOriginalCwd, getSessionId } from 'src/bootstrap/state.js';
import { checkGate_CACHED_OR_BLOCKING } from 'src/services/analytics/growthbook.js';
import {
@@ -877,6 +878,13 @@ export async function teleportToRemote(options: {
* identify the PR associated with this session.
*/
githubPr?: { owner: string; repo: string; number: number };
/**
* Identifies which command/flow originated this teleport. CCR backend
* uses this for routing/observability. Known values: 'autofix_pr',
* 'ultrareview', 'ultraplan'. Pass-through field — not interpreted
* client-side; if backend doesn't recognize it, it's silently ignored.
*/
source?: string;
}): Promise<TeleportToRemoteResponse | null> {
const { initialMessage, signal } = options;
try {
@@ -1227,6 +1235,7 @@ export async function teleportToRemote(options: {
model: options.model ?? getMainLoopModel(),
...(options.reuseOutcomeBranch && { reuse_outcome_branches: true }),
...(options.githubPr && { github_pr: options.githubPr }),
...(options.source && { source: options.source }),
};
// CreateCCRSessionPayload has no permission_mode field — a top-level