@tencent-ai/agent-sdk 0.3.252 → 0.3.253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/CHANGELOG.md +22 -0
- package/cli/dist/codebuddy-headless.js +73 -58
- package/cli/dist/codebuddy-lite-wb.mjs +96 -81
- package/cli/dist/lazy/{427.68132a34.js → 427.74b982af.js} +4 -4
- package/cli/dist/lazy-headless/{834.391fb41e.js → 834.3b674e07.js} +9 -9
- package/cli/dist-server/3556.codebuddy.js +1 -1
- package/cli/dist-server/6037.codebuddy.js +1 -1
- package/cli/dist-server/6784.codebuddy.js +1 -1
- package/cli/dist-server/codebuddy.js +45 -30
- package/cli/dist-server/types/node/agent/openai-agents-types.d.ts +5 -5
- package/cli/dist-server/types/node/mcp/mcp-sdk-values.d.ts +1 -1
- package/cli/dist-server/types/node/model/model-provider.d.ts +3 -1
- package/cli/dist-server/types/node/tools/a2a-get-task-tool.d.ts +139 -34
- package/cli/dist-server/types/node/tools/a2a-poll-retry.d.ts +46 -0
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +2 -2
- package/cli/product.json +4 -4
- package/cli/product.selfhosted.json +2 -2
- package/package.json +1 -1
- package/cli/dist-server/types/node/acp/acp-view-rewind-to.d.ts +0 -34
- package/cli/dist-server/types/node/acp/acp-web-ui-client.d.ts +0 -22
- package/cli/dist-server/types/node/acp/usage-by-category-calculator.d.ts +0 -45
- package/cli/dist-server/types/node/acp/usage-by-category-char-weight.d.ts +0 -9
- package/cli/dist-server/types/node/acp/usage-by-category-distribute.d.ts +0 -6
- package/cli/dist-server/types/node/acp/usage-by-category-tools-split.d.ts +0 -11
- package/cli/dist-server/types/node/agent-home/agent-home-envelope-body.d.ts +0 -54
- package/cli/dist-server/types/node/agent-home/agent-home-inbox-events.d.ts +0 -14
- package/cli/dist-server/types/node/agent-home/agent-home-room-contacts.d.ts +0 -30
- package/cli/dist-server/types/node/agent-team/permission-bridge-client.d.ts +0 -32
- package/cli/dist-server/types/node/agent-team/permission-bridge-protocol.d.ts +0 -47
- package/cli/dist-server/types/node/agent-view/handoff-policy.d.ts +0 -80
- package/cli/dist-server/types/node/agent-view/job-respawn-prefs.d.ts +0 -12
- package/cli/dist-server/types/node/agent-view/session-handoff.d.ts +0 -161
- package/cli/dist-server/types/node/ask/index.d.ts +0 -3
- package/cli/dist-server/types/node/bash-sandbox/bash-sandbox-manager.d.ts +0 -125
- package/cli/dist-server/types/node/bash-sandbox/legacy-sandbox-shell-service.d.ts +0 -33
- package/cli/dist-server/types/node/bash-sandbox/managed-security-policy.d.ts +0 -6
- package/cli/dist-server/types/node/bash-sandbox/workbuddy-directory-protection.d.ts +0 -12
- package/cli/dist-server/types/node/checkpoint/checkpoint-service.d.ts +0 -70
- package/cli/dist-server/types/node/checkpoint/file-changes-controller.d.ts +0 -29
- package/cli/dist-server/types/node/checkpoint/file-track-service.d.ts +0 -11
- package/cli/dist-server/types/node/checkpoint/file-version-manager.d.ts +0 -10
- package/cli/dist-server/types/node/checkpoint/file-version-store.d.ts +0 -9
- package/cli/dist-server/types/node/checkpoint/file-version-update-strategies.d.ts +0 -62
- package/cli/dist-server/types/node/command/add-dir-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/agents-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/auto-compact-command-executor.d.ts +0 -20
- package/cli/dist-server/types/node/command/background-command-executor.d.ts +0 -29
- package/cli/dist-server/types/node/command/btw-command-executor.d.ts +0 -19
- package/cli/dist-server/types/node/command/clear-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/config-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/context-command-executor.d.ts +0 -42
- package/cli/dist-server/types/node/command/copy-command-executor.d.ts +0 -10
- package/cli/dist-server/types/node/command/cost-command-executor.d.ts +0 -13
- package/cli/dist-server/types/node/command/debug-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/deep-research-command-executor.d.ts +0 -25
- package/cli/dist-server/types/node/command/doctor-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/effort-command-executor.d.ts +0 -46
- package/cli/dist-server/types/node/command/exit-command-executor.d.ts +0 -14
- package/cli/dist-server/types/node/command/export-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/feedback-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/fork-bg-command-executor.d.ts +0 -30
- package/cli/dist-server/types/node/command/fork-command-executor.d.ts +0 -28
- package/cli/dist-server/types/node/command/goal-command-executor.d.ts +0 -50
- package/cli/dist-server/types/node/command/handoff-message-adapter.d.ts +0 -9
- package/cli/dist-server/types/node/command/help-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/hooks-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/ide-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/mcp-command-executor.d.ts +0 -15
- package/cli/dist-server/types/node/command/memory-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/mode-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/model-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/model-image-to-image-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-image-to-video-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-lite-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-reasoning-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-text-to-image-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/model-text-to-video-command-executor.d.ts +0 -17
- package/cli/dist-server/types/node/command/multitask-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/permissions-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/plan-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/plugin-command-executor.d.ts +0 -25
- package/cli/dist-server/types/node/command/plugin-validate-command-executor.d.ts +0 -21
- package/cli/dist-server/types/node/command/release-notes-command-executor.d.ts +0 -18
- package/cli/dist-server/types/node/command/reload-plugins-command-executor.d.ts +0 -24
- package/cli/dist-server/types/node/command/remote-control-command-executor.d.ts +0 -44
- package/cli/dist-server/types/node/command/rename-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/reset-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/resume-command-executor.d.ts +0 -21
- package/cli/dist-server/types/node/command/rewind-command-executor.d.ts +0 -10
- package/cli/dist-server/types/node/command/sandbox-command-executor.d.ts +0 -20
- package/cli/dist-server/types/node/command/save-workflow-command-executor.d.ts +0 -43
- package/cli/dist-server/types/node/command/session-reset-notifier.d.ts +0 -23
- package/cli/dist-server/types/node/command/skills-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/stats-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/status-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/tasks-command-executor.d.ts +0 -9
- package/cli/dist-server/types/node/command/terminal-setup-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/theme-command-executor.d.ts +0 -7
- package/cli/dist-server/types/node/command/todos-command-executor.d.ts +0 -16
- package/cli/dist-server/types/node/command/upgrade-command-executor.d.ts +0 -13
- package/cli/dist-server/types/node/command/vim-command-executor.d.ts +0 -11
- package/cli/dist-server/types/node/command/workflows-command-executor.d.ts +0 -26
- package/cli/dist-server/types/node/feedback/feedback-protocol.d.ts +0 -32
- package/cli/dist-server/types/node/feedback/feedback-service.d.ts +0 -19
- package/cli/dist-server/types/node/feedback/index.d.ts +0 -2
- package/cli/dist-server/types/node/goal/goal-policy.d.ts +0 -55
- package/cli/dist-server/types/node/goal/goal-protocol.d.ts +0 -178
- package/cli/dist-server/types/node/goal/goal-service.d.ts +0 -201
- package/cli/dist-server/types/node/goal/goal-session-start-hook.d.ts +0 -24
- package/cli/dist-server/types/node/hooks/parse-frontmatter-hooks.d.ts +0 -42
- package/cli/dist-server/types/node/install/index.d.ts +0 -6
- package/cli/dist-server/types/node/install/install-controller.d.ts +0 -15
- package/cli/dist-server/types/node/install/install-env.d.ts +0 -12
- package/cli/dist-server/types/node/install/install-errors.d.ts +0 -46
- package/cli/dist-server/types/node/install/install-protocol.d.ts +0 -83
- package/cli/dist-server/types/node/install/install-service.d.ts +0 -36
- package/cli/dist-server/types/node/install/install-utils.d.ts +0 -7
- package/cli/dist-server/types/node/install/releases-service.d.ts +0 -18
- package/cli/dist-server/types/node/install/shell-setup.d.ts +0 -36
- package/cli/dist-server/types/node/mcp/mcp-cancellation.d.ts +0 -65
- package/cli/dist-server/types/node/mcp/mcp-controller.d.ts +0 -56
- package/cli/dist-server/types/node/mcp/mcp-model-id-header-helper.d.ts +0 -12
- package/cli/dist-server/types/node/mcp/mcp-oauth-callback-html.d.ts +0 -6
- package/cli/dist-server/types/node/mcp/mcp-oauth-controller.d.ts +0 -26
- package/cli/dist-server/types/node/mcp/mcp-output-storage.d.ts +0 -57
- package/cli/dist-server/types/node/mcp/mcp-server-override-impl.d.ts +0 -136
- package/cli/dist-server/types/node/mcp/mcp-server-override.d.ts +0 -29
- package/cli/dist-server/types/node/mcp/mcp-tool-result-sideband.d.ts +0 -26
- package/cli/dist-server/types/node/mcp/mcp-validate-middleware.d.ts +0 -25
- package/cli/dist-server/types/node/mcp/models/mcp-server.d.ts +0 -18
- package/cli/dist-server/types/node/mcp/node-websocket-transport.d.ts +0 -38
- package/cli/dist-server/types/node/mcp/official-mcp-egress-policy.d.ts +0 -17
- package/cli/dist-server/types/node/mcp/sdk-mcp-server.d.ts +0 -143
- package/cli/dist-server/types/node/mcp/sdk-mcp-transport.d.ts +0 -97
- package/cli/dist-server/types/node/message-queue/followup-queue.d.ts +0 -35
- package/cli/dist-server/types/node/message-queue/index.d.ts +0 -11
- package/cli/dist-server/types/node/plugins/concurrency.d.ts +0 -1
- package/cli/dist-server/types/node/plugins/dependency-resolver.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/directory-plugin-cache-projection.d.ts +0 -2
- package/cli/dist-server/types/node/plugins/guards/index.d.ts +0 -2
- package/cli/dist-server/types/node/plugins/guards/weixinpay-integrity-guard.d.ts +0 -15
- package/cli/dist-server/types/node/plugins/installers/git-plugin-installer.d.ts +0 -42
- package/cli/dist-server/types/node/plugins/installers/git-subdir-plugin-installer.d.ts +0 -19
- package/cli/dist-server/types/node/plugins/installers/index.d.ts +0 -4
- package/cli/dist-server/types/node/plugins/installers/local-plugin-installer.d.ts +0 -40
- package/cli/dist-server/types/node/plugins/installers/npm-plugin-installer.d.ts +0 -23
- package/cli/dist-server/types/node/plugins/loaders/agent-loader.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/loaders/command-loader.d.ts +0 -37
- package/cli/dist-server/types/node/plugins/loaders/hook-loader.d.ts +0 -55
- package/cli/dist-server/types/node/plugins/loaders/index.d.ts +0 -8
- package/cli/dist-server/types/node/plugins/loaders/lsp-loader.d.ts +0 -47
- package/cli/dist-server/types/node/plugins/loaders/mcp-loader.d.ts +0 -75
- package/cli/dist-server/types/node/plugins/loaders/output-style-loader.d.ts +0 -49
- package/cli/dist-server/types/node/plugins/loaders/plugin-loader-manager.d.ts +0 -49
- package/cli/dist-server/types/node/plugins/loaders/skill-loader.d.ts +0 -45
- package/cli/dist-server/types/node/plugins/marketplace-name-validator.d.ts +0 -50
- package/cli/dist-server/types/node/plugins/marketplace-path-safety.d.ts +0 -86
- package/cli/dist-server/types/node/plugins/marketplaces/base-marketplace.d.ts +0 -43
- package/cli/dist-server/types/node/plugins/marketplaces/builtin-marketplace-provider.d.ts +0 -22
- package/cli/dist-server/types/node/plugins/marketplaces/directory-marketplace.d.ts +0 -19
- package/cli/dist-server/types/node/plugins/marketplaces/git-availability-detector.d.ts +0 -62
- package/cli/dist-server/types/node/plugins/marketplaces/git-fallback-coordinator.d.ts +0 -42
- package/cli/dist-server/types/node/plugins/marketplaces/git-to-zip-url-converter.d.ts +0 -50
- package/cli/dist-server/types/node/plugins/marketplaces/github-marketplace.d.ts +0 -41
- package/cli/dist-server/types/node/plugins/marketplaces/http-marketplace.d.ts +0 -47
- package/cli/dist-server/types/node/plugins/marketplaces/index.d.ts +0 -13
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-config-manager.d.ts +0 -39
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-factory.d.ts +0 -11
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-storage.d.ts +0 -141
- package/cli/dist-server/types/node/plugins/marketplaces/marketplace-update-checker.d.ts +0 -38
- package/cli/dist-server/types/node/plugins/marketplaces/workspace-project-root.d.ts +0 -14
- package/cli/dist-server/types/node/plugins/marketplaces/zip-marketplace.d.ts +0 -134
- package/cli/dist-server/types/node/plugins/mcpb-handler.d.ts +0 -29
- package/cli/dist-server/types/node/plugins/plugin-controller.d.ts +0 -75
- package/cli/dist-server/types/node/plugins/plugin-error-collector.d.ts +0 -17
- package/cli/dist-server/types/node/plugins/plugin-install-stats-service.d.ts +0 -20
- package/cli/dist-server/types/node/plugins/plugin-manager.d.ts +0 -692
- package/cli/dist-server/types/node/plugins/plugin-policy-service.d.ts +0 -53
- package/cli/dist-server/types/node/plugins/plugin-validator.d.ts +0 -48
- package/cli/dist-server/types/node/plugins/zip-utils.d.ts +0 -93
- package/cli/dist-server/types/node/remote-control/clients/liveness-watchdog.d.ts +0 -56
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-activity.d.ts +0 -23
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-auth.d.ts +0 -64
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client-factory.d.ts +0 -47
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-client.d.ts +0 -191
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-inbound.d.ts +0 -7
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-interaction.d.ts +0 -142
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-live.d.ts +0 -78
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-media.d.ts +0 -35
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-qr-bind.d.ts +0 -49
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-respond-queue.d.ts +0 -33
- package/cli/dist-server/types/node/remote-control/clients/wecom-bot/wecom-bot-types.d.ts +0 -207
- package/cli/dist-server/types/node/remote-control/remote-control-protocol.d.ts +0 -288
- package/cli/dist-server/types/node/remote-gateway/gateway-protocol.d.ts +0 -502
- package/cli/dist-server/types/node/remote-gateway/utils/qrcode-utils.d.ts +0 -16
- package/cli/dist-server/types/node/session/session-preview-utils.d.ts +0 -30
- package/cli/dist-server/types/node/settings/model-setting-utils.d.ts +0 -2
- package/cli/dist-server/types/node/tool-control/tool-control-policy.d.ts +0 -35
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-critique-client.d.ts +0 -51
- package/cli/dist-server/types/node/tools/auto-mode/auto-mode-strategy.d.ts +0 -19
- package/cli/dist-server/types/node/utils/add-dir-utils.d.ts +0 -20
- package/cli/dist-server/types/node/utils/compress-path.source.d.ts +0 -59
- package/cli/dist-server/types/node/vim/index.d.ts +0 -2
- package/cli/dist-server/types/node/vim/vim-manager.d.ts +0 -12
- package/cli/dist-server/types/node/vim/vim-protocol.d.ts +0 -24
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@celljs/core';
|
|
2
|
-
import { EventService } from '@genie/telemetry';
|
|
3
|
-
import { type Session } from '../session';
|
|
4
|
-
import { SettingsManager } from '../settings';
|
|
5
|
-
import { type Checkpoint, type CheckpointFileChangeStats, CheckpointService, FileVersionManager, FileVersionStore } from './checkpoint-protocol';
|
|
6
|
-
export declare class CheckpointServiceImpl implements CheckpointService {
|
|
7
|
-
protected readonly logger: Logger;
|
|
8
|
-
protected readonly settingsManager: SettingsManager;
|
|
9
|
-
protected readonly fileVersionStore: FileVersionStore;
|
|
10
|
-
protected readonly fileVersionManager: FileVersionManager;
|
|
11
|
-
protected readonly eventService?: EventService;
|
|
12
|
-
protected init(): void;
|
|
13
|
-
createCheckpoint(session: Session, options?: {
|
|
14
|
-
autoAddToHistory?: boolean;
|
|
15
|
-
messageId?: string;
|
|
16
|
-
isSnapshotUpdate?: boolean;
|
|
17
|
-
}): Promise<Checkpoint | undefined>;
|
|
18
|
-
revertToCheckpoint(session: Session, checkpoint: Checkpoint, scope: import('./checkpoint-protocol.js').RevertScope): Promise<void>;
|
|
19
|
-
getRewindableCheckpoints(session: Session): Checkpoint[];
|
|
20
|
-
/**
|
|
21
|
-
* 按 user 消息 UUID 定位 checkpoint。
|
|
22
|
-
*
|
|
23
|
-
* 对齐 Claude Code `rewind_files` 语义:查找该 user 消息**发送之前**的
|
|
24
|
-
* 文件快照。cbc 中 `createCheckpoint` 是在 user 消息进入历史 + tool 执行**之前**
|
|
25
|
-
* 拍照,因此 snapshot.messageId === userMessageId 的那份快照恰好是「该 user
|
|
26
|
-
* 消息发送前」的磁盘状态。
|
|
27
|
-
*
|
|
28
|
-
* 严格约束:
|
|
29
|
-
* 1. userMessageId 必须存在于活跃历史链中(非活跃分支的消息不能作为目标)。
|
|
30
|
-
* 2. 该消息必须是 real user message(非 assistant / tool_call)。
|
|
31
|
-
* 3. 必须存在与之关联的 FileHistorySnapshotItem。
|
|
32
|
-
*
|
|
33
|
-
* 三条约束任一不满足即返回 undefined,交由上层生成对齐 Claude 的错误文案。
|
|
34
|
-
*/
|
|
35
|
-
findCheckpointByUserMessageId(session: Session, userMessageId: string): Checkpoint | undefined;
|
|
36
|
-
hasRewindableCheckpoint(session: Session): boolean;
|
|
37
|
-
getLatestCheckpoint(session: Session): Checkpoint;
|
|
38
|
-
shouldSkipCheckpoint(session: Session): Promise<boolean>;
|
|
39
|
-
compareWithCurrentFiles(session: Session, targetCheckpoint: Checkpoint): Promise<CheckpointFileChangeStats>;
|
|
40
|
-
private get sessionManager();
|
|
41
|
-
/**
|
|
42
|
-
* revert 前强制刷新 session.checkpoint 到最新磁盘文件状态。
|
|
43
|
-
* 不写入 history(autoAddToHistory=false),仅更新内存中的 version/backup。
|
|
44
|
-
*/
|
|
45
|
-
private refreshCheckpointBeforeRevert;
|
|
46
|
-
private revertFiles;
|
|
47
|
-
private restoreFile;
|
|
48
|
-
private deleteFile;
|
|
49
|
-
private fileExists;
|
|
50
|
-
private updateHistory;
|
|
51
|
-
private isCheckpointingEnabled;
|
|
52
|
-
private convertCheckpointToSnapshot;
|
|
53
|
-
/**
|
|
54
|
-
* 获取包含 snapshot 的活跃历史记录
|
|
55
|
-
*
|
|
56
|
-
* HistoryUtils.getActiveHistory 通过 parentId 链遍历构建活跃历史,
|
|
57
|
-
* 但 FileHistorySnapshotItem 的 id 是随机 UUID,不在任何 parentId 链上,
|
|
58
|
-
* 因此不会被 getActiveHistory 收录。
|
|
59
|
-
*
|
|
60
|
-
* 本方法在 getActiveHistory 的结果基础上,从 session.history 中找到
|
|
61
|
-
* 属于活跃对话链的 snapshot(通过 snapshot.messageId 关联用户消息),
|
|
62
|
-
* 并将它们插入到正确的位置。
|
|
63
|
-
*/
|
|
64
|
-
private getActiveHistory;
|
|
65
|
-
/**
|
|
66
|
-
* 构建 CheckpointInfo 并通过 ACP 广播到所有客户端。
|
|
67
|
-
* 发送文件列表、changeType 和每个文件的 additions/deletions/diff。
|
|
68
|
-
*/
|
|
69
|
-
broadcastCheckpointNotification(session: Session, checkpoint: Checkpoint): Promise<void>;
|
|
70
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal File Changes Controller
|
|
3
|
-
*
|
|
4
|
-
* 提供 checkpoint 相关的文件变更操作,供 Web UI 内部消费。
|
|
5
|
-
*
|
|
6
|
-
* 端点:
|
|
7
|
-
* - POST /internal/file-changes/diff → 获取文件 diff(oldText vs newText)
|
|
8
|
-
* - POST /internal/file-changes/checkpoints → 列出可回退的 checkpoint
|
|
9
|
-
* - POST /internal/file-changes/revert → 撤回文件变更
|
|
10
|
-
*/
|
|
11
|
-
import { Logger } from '@genie/telemetry';
|
|
12
|
-
import { type RevertScope } from './checkpoint-protocol';
|
|
13
|
-
interface DiffRequest {
|
|
14
|
-
path: string;
|
|
15
|
-
}
|
|
16
|
-
interface RevertRequest {
|
|
17
|
-
paths?: string[];
|
|
18
|
-
checkpointId?: string;
|
|
19
|
-
scope?: RevertScope;
|
|
20
|
-
}
|
|
21
|
-
export declare class FileChangesController {
|
|
22
|
-
protected readonly logger: Logger;
|
|
23
|
-
diff(body: DiffRequest): Promise<void>;
|
|
24
|
-
checkpoints(): Promise<void>;
|
|
25
|
-
revert(body: RevertRequest): Promise<void>;
|
|
26
|
-
/** 获取当前活跃 session */
|
|
27
|
-
private resolveSession;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@celljs/core';
|
|
2
|
-
import type { Session } from '../session';
|
|
3
|
-
import { CheckpointService, FileTrackService } from './checkpoint-protocol';
|
|
4
|
-
export declare const INITIAL_VERSION = 0;
|
|
5
|
-
export declare class FileTrackServiceImpl implements FileTrackService {
|
|
6
|
-
protected readonly logger: Logger;
|
|
7
|
-
protected readonly checkpointService: CheckpointService;
|
|
8
|
-
protected init(): void;
|
|
9
|
-
/** 跟踪文件 */
|
|
10
|
-
trackFile(session: Session, filePath: string): Promise<boolean>;
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Logger, Provider } from '@celljs/core';
|
|
2
|
-
import { FileVersion, FileVersionManager, FileVersionStore, FileVersionUpdateStrategy } from './checkpoint-protocol';
|
|
3
|
-
export declare class FileVersionManagerImpl implements FileVersionManager {
|
|
4
|
-
protected readonly logger: Logger;
|
|
5
|
-
protected readonly fileVersionStore: FileVersionStore;
|
|
6
|
-
protected readonly strategyProvider: Provider<FileVersionUpdateStrategy>;
|
|
7
|
-
protected init(): void;
|
|
8
|
-
/** 更新文件版本 */
|
|
9
|
-
update(sessionId: string, fileVersion: FileVersion, isSnapshotUpdate?: boolean): Promise<FileVersion | undefined>;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@celljs/core';
|
|
2
|
-
import { type FileVersion, FileVersionStore } from './checkpoint-protocol';
|
|
3
|
-
export declare class FileVersionStoreImpl implements FileVersionStore {
|
|
4
|
-
protected readonly logger: Logger;
|
|
5
|
-
protected init(): void;
|
|
6
|
-
save(sessionId: string, fileVersion: FileVersion): Promise<void>;
|
|
7
|
-
get(sessionId: string, backupFileName: string): Promise<string | undefined>;
|
|
8
|
-
cleanup(sessionId: string): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { type FileVersion, FileVersionUpdateStrategy, type FileVersionUpdateStrategyContext } from './checkpoint-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* 初始化策略
|
|
4
|
-
* 优先级: 5 (最高)
|
|
5
|
-
* 条件: 版本号为 0 (首次调用),说明是新跟踪的文件的 2 种处理
|
|
6
|
-
*/
|
|
7
|
-
export declare class InitialVersionStrategy implements FileVersionUpdateStrategy {
|
|
8
|
-
priority: number;
|
|
9
|
-
private readonly logger;
|
|
10
|
-
private readonly fileVersionStore;
|
|
11
|
-
protected init(): void;
|
|
12
|
-
matches(context: FileVersionUpdateStrategyContext): boolean;
|
|
13
|
-
apply(context: FileVersionUpdateStrategyContext): Promise<FileVersion>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* 无变更策略
|
|
17
|
-
* 优先级: 4
|
|
18
|
-
* 条件: 文件不存在 && 备份不存在,说明文件已被删除且没有处理
|
|
19
|
-
*/
|
|
20
|
-
export declare class NoChangeStrategy implements FileVersionUpdateStrategy {
|
|
21
|
-
priority: number;
|
|
22
|
-
matches(context: FileVersionUpdateStrategyContext): boolean;
|
|
23
|
-
apply(context: FileVersionUpdateStrategyContext): Promise<FileVersion>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 文件删除策略
|
|
27
|
-
* 优先级: 3
|
|
28
|
-
* 条件: 文件不存在 && 备份存在,说明文件已被删除
|
|
29
|
-
*/
|
|
30
|
-
export declare class FileDeletedStrategy implements FileVersionUpdateStrategy {
|
|
31
|
-
priority: number;
|
|
32
|
-
private readonly logger;
|
|
33
|
-
protected init(): void;
|
|
34
|
-
matches(context: FileVersionUpdateStrategyContext): boolean;
|
|
35
|
-
apply(context: FileVersionUpdateStrategyContext): Promise<FileVersion>;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 备份文件创建策略
|
|
39
|
-
* 优先级: 2
|
|
40
|
-
* 条件: 文件存在 && 备份不存在,说明是已跟踪文件重新创建
|
|
41
|
-
*/
|
|
42
|
-
export declare class FileCreatedStrategy implements FileVersionUpdateStrategy {
|
|
43
|
-
priority: number;
|
|
44
|
-
private readonly logger;
|
|
45
|
-
private readonly fileVersionStore;
|
|
46
|
-
protected init(): void;
|
|
47
|
-
matches(context: FileVersionUpdateStrategyContext): boolean;
|
|
48
|
-
apply(context: FileVersionUpdateStrategyContext): Promise<FileVersion>;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* 文件修改策略
|
|
52
|
-
* 优先级: 1 (最低)
|
|
53
|
-
* 条件: 文件存在 && 备份存在
|
|
54
|
-
*/
|
|
55
|
-
export declare class FileModifiedStrategy implements FileVersionUpdateStrategy {
|
|
56
|
-
priority: number;
|
|
57
|
-
private readonly logger;
|
|
58
|
-
private readonly fileVersionStore;
|
|
59
|
-
protected init(): void;
|
|
60
|
-
matches(context: FileVersionUpdateStrategyContext): boolean;
|
|
61
|
-
apply(context: FileVersionUpdateStrategyContext): Promise<FileVersion>;
|
|
62
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NavigationManager } from '../navigation';
|
|
2
|
-
import { SessionManager } from '../session';
|
|
3
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
|
-
export declare class AddDirCommandExecutor implements CommandExecutor {
|
|
5
|
-
name: string;
|
|
6
|
-
message: string;
|
|
7
|
-
autoGenerateHistory: boolean;
|
|
8
|
-
protected readonly navigationManager: NavigationManager;
|
|
9
|
-
protected readonly sessionManager: SessionManager;
|
|
10
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
11
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SessionManager } from '../session';
|
|
2
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
3
|
-
export declare class AgentsCommandExecutor implements CommandExecutor {
|
|
4
|
-
name: string;
|
|
5
|
-
message: string;
|
|
6
|
-
autoGenerateHistory: boolean;
|
|
7
|
-
protected readonly sessionManager: SessionManager;
|
|
8
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SessionManager } from '../session';
|
|
2
|
-
import { SettingsManager } from '../settings';
|
|
3
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
|
-
/**
|
|
5
|
-
* `/autocompact <auto | 400k | 1m | 400000>` —— 设置自动压缩窗口大小,写入 user settings
|
|
6
|
-
* 的 `autoCompactWindow`(对齐 Claude Code 的 `/autocompact`)。
|
|
7
|
-
*
|
|
8
|
-
* - `auto`:清空 `autoCompactWindow`,回到「跟随模型窗口」
|
|
9
|
-
* - token 数(支持 1000 进制 k/m 后缀):写入 clamp 到 [100k, 1M] 后的值
|
|
10
|
-
* - 无参数:显示当前生效值
|
|
11
|
-
*/
|
|
12
|
-
export declare class AutoCompactCommandExecutor implements CommandExecutor {
|
|
13
|
-
name: string;
|
|
14
|
-
autoGenerateHistory: boolean;
|
|
15
|
-
protected readonly sessionManager: SessionManager;
|
|
16
|
-
protected readonly settingsManager: SettingsManager;
|
|
17
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
18
|
-
private describeCurrent;
|
|
19
|
-
private output;
|
|
20
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `/background`(别名 `/bg`)—— 把当前会话搬到后台,前台退出。
|
|
3
|
-
*
|
|
4
|
-
* 对照 Claude Code v2.1.216 bundle 559597-559606 / 768141-768163:
|
|
5
|
-
* - 已经是后台会话 → 等价 detach,不新建
|
|
6
|
-
* - 持久化关闭 → 拒绝
|
|
7
|
-
* - 一条消息都还没有 → `Nothing to background yet — send a message first.`
|
|
8
|
-
* - 成功 → spawn 后打印后续命令提示
|
|
9
|
-
*/
|
|
10
|
-
import { SessionManager } from '../session';
|
|
11
|
-
import { type Session } from '../session/session-protocol';
|
|
12
|
-
import { SettingsManager } from '../settings';
|
|
13
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
14
|
-
export declare class BackgroundCommandExecutor implements CommandExecutor {
|
|
15
|
-
name: string;
|
|
16
|
-
message: string;
|
|
17
|
-
autoGenerateHistory: boolean;
|
|
18
|
-
protected readonly sessionManager: SessionManager;
|
|
19
|
-
protected readonly settingsManager: SettingsManager;
|
|
20
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
21
|
-
protected failureMessage(reason: string): string;
|
|
22
|
-
protected isAgentViewDisabled(): Promise<boolean>;
|
|
23
|
-
protected isPersistenceDisabled(): Promise<boolean>;
|
|
24
|
-
protected say(session: Session, text: string): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
/** `/bg` —— `/background` 的别名(对照 Claude `aliases: ["bg"]`) */
|
|
27
|
-
export declare class BgCommandExecutor extends BackgroundCommandExecutor {
|
|
28
|
-
name: string;
|
|
29
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* /btw (By The Way) Command Executor
|
|
4
|
-
*
|
|
5
|
-
* This is a stub — the actual side question logic is handled entirely by
|
|
6
|
-
* BtwPanel (src/node/ui/input/panel/btw-panel.tsx), which is navigated to
|
|
7
|
-
* directly from use-slash-interceptor.ts.
|
|
8
|
-
*
|
|
9
|
-
* The executor exists only so that CommandManager recognizes "/btw" as a
|
|
10
|
-
* valid local command (commandExecutorMap.has(name) check in parseCommand).
|
|
11
|
-
*
|
|
12
|
-
* autoGenerateHistory = false: /btw messages must NOT enter session history.
|
|
13
|
-
*/
|
|
14
|
-
export declare class BtwCommandExecutor implements CommandExecutor {
|
|
15
|
-
name: string;
|
|
16
|
-
message: string;
|
|
17
|
-
autoGenerateHistory: boolean;
|
|
18
|
-
execute(_ctx: CommandExecuteContext): Promise<void>;
|
|
19
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@genie/telemetry';
|
|
2
|
-
import { SessionHookManager, SessionManager } from '../session';
|
|
3
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
|
-
export declare class ClearCommandExecutor implements CommandExecutor {
|
|
5
|
-
name: string;
|
|
6
|
-
message: string;
|
|
7
|
-
autoGenerateHistory: boolean;
|
|
8
|
-
protected readonly sessionManager: SessionManager;
|
|
9
|
-
protected readonly sessionHookManager: SessionHookManager;
|
|
10
|
-
protected readonly logger: Logger;
|
|
11
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Notify ACP clients that session has been reset via session_info_update.
|
|
14
|
-
* This allows Web UI to update its sessionId and clear chat history.
|
|
15
|
-
*/
|
|
16
|
-
private notifySessionReset;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { NavigationManager } from '../navigation';
|
|
2
|
-
import { SessionManager } from '../session';
|
|
3
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
|
-
export declare class ConfigCommandExecutor implements CommandExecutor {
|
|
5
|
-
name: string;
|
|
6
|
-
message: string;
|
|
7
|
-
autoGenerateHistory: boolean;
|
|
8
|
-
protected readonly sessionManager: SessionManager;
|
|
9
|
-
protected readonly navigationManager: NavigationManager;
|
|
10
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
11
|
-
private handleList;
|
|
12
|
-
private handleGet;
|
|
13
|
-
private handleSet;
|
|
14
|
-
private outputResult;
|
|
15
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
2
|
-
/**
|
|
3
|
-
* /context 命令执行器
|
|
4
|
-
* 计算当前会话的上下文token分布情况
|
|
5
|
-
*/
|
|
6
|
-
export declare class ContextCommandExecutor implements CommandExecutor {
|
|
7
|
-
name: string;
|
|
8
|
-
message: string;
|
|
9
|
-
autoGenerateHistory: boolean;
|
|
10
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* 格式化输出。布局对齐 Claude `/context`:
|
|
13
|
-
* 分类标题带估算合计("Estimated usage by category · 33.7k"),与顶行
|
|
14
|
-
* `realInputTokens` 分开,避免把分项加总误当成上次请求的权威用量。
|
|
15
|
-
* Skills 单独成行(从 System tools 里划出,避免重复计数);
|
|
16
|
-
* Memory / Skills / Agents 默认折叠,`/context all` 展开。
|
|
17
|
-
*
|
|
18
|
-
* 顶行 / 矩阵 / Free space 优先 `realInputTokens`,无真实调用时回退 `total`。
|
|
19
|
-
* 分项行始终是本地粗估;`/context` 本身写入历史后 Messages 会涨,顶行要等下次模型请求才更新。
|
|
20
|
-
*/
|
|
21
|
-
private formatOutput;
|
|
22
|
-
private isExpandArg;
|
|
23
|
-
private formatCollapsedOrExpandedDetails;
|
|
24
|
-
/**
|
|
25
|
-
* 按 scope 分组 skills 和 commands
|
|
26
|
-
*/
|
|
27
|
-
private groupSkillsAndCommandsByScope;
|
|
28
|
-
/**
|
|
29
|
-
* 合并矩阵和明细信息,并排显示
|
|
30
|
-
*/
|
|
31
|
-
private mergeMatrixAndDetails;
|
|
32
|
-
/**
|
|
33
|
-
* 创建彩色矩阵显示
|
|
34
|
-
* @param usedTokens 权威用量(顶行同源)。矩阵填充总量由它决定,各分项只决定
|
|
35
|
-
* 这些格子的配色比例,避免"顶行 85%而格子只填 23%"的矛盾(#69538)。
|
|
36
|
-
*/
|
|
37
|
-
private createMatrix;
|
|
38
|
-
/**
|
|
39
|
-
* 格式化token数量显示
|
|
40
|
-
*/
|
|
41
|
-
private formatTokens;
|
|
42
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SessionManager } from '../session';
|
|
2
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
3
|
-
export declare class CopyCommandExecutor implements CommandExecutor {
|
|
4
|
-
name: string;
|
|
5
|
-
message: string;
|
|
6
|
-
autoGenerateHistory: boolean;
|
|
7
|
-
protected readonly sessionManager: SessionManager;
|
|
8
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
9
|
-
private run;
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ProductManager } from '@genie/product';
|
|
2
|
-
import { SessionManager } from '../session';
|
|
3
|
-
import { CostService } from '../telemetry';
|
|
4
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
5
|
-
export declare class CostCommandExecutor implements CommandExecutor {
|
|
6
|
-
name: string;
|
|
7
|
-
message: string;
|
|
8
|
-
autoGenerateHistory: boolean;
|
|
9
|
-
protected readonly sessionManager: SessionManager;
|
|
10
|
-
protected readonly costService: CostService;
|
|
11
|
-
protected readonly productManager: ProductManager;
|
|
12
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DebugService } from '../debug/debug-protocol';
|
|
2
|
-
import { SessionManager } from '../session';
|
|
3
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
|
-
export declare class DebugCommandExecutor implements CommandExecutor {
|
|
5
|
-
name: string;
|
|
6
|
-
message: string;
|
|
7
|
-
autoGenerateHistory: boolean;
|
|
8
|
-
protected readonly sessionManager: SessionManager;
|
|
9
|
-
protected readonly debugService: DebugService;
|
|
10
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
11
|
-
private run;
|
|
12
|
-
private isDebugEnabled;
|
|
13
|
-
private enableDebugLogging;
|
|
14
|
-
private formatFileSize;
|
|
15
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* /deep-research <question>
|
|
3
|
-
*
|
|
4
|
-
* 单一职责:把 `/deep-research` 命令翻成 `Workflow` 工具调用,启动 builtin "deep-research"
|
|
5
|
-
* workflow 并立刻返回 runId(workflow 在后台跑,通过 /workflows 看进度)。
|
|
6
|
-
*
|
|
7
|
-
* 与 Claude Code 行为对齐:
|
|
8
|
-
* - 必须有 question 参数
|
|
9
|
-
* - 启动后只返回 ack(具体报告由 workflow done 时通知)
|
|
10
|
-
*/
|
|
11
|
-
import { Logger } from '@genie/telemetry';
|
|
12
|
-
import { SessionManager } from '../session';
|
|
13
|
-
import type { WorkflowManager } from '@genie/cbc-workflow';
|
|
14
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
15
|
-
export declare class DeepResearchCommandExecutor implements CommandExecutor {
|
|
16
|
-
name: string;
|
|
17
|
-
autoGenerateHistory: boolean;
|
|
18
|
-
protected readonly logger: Logger;
|
|
19
|
-
protected readonly sessionManager: SessionManager;
|
|
20
|
-
protected readonly manager: WorkflowManager;
|
|
21
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
22
|
-
private run;
|
|
23
|
-
private joinArgs;
|
|
24
|
-
private appendHistory;
|
|
25
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
2
|
-
export declare class DoctorCommandExecutor implements CommandExecutor {
|
|
3
|
-
name: string;
|
|
4
|
-
message: string;
|
|
5
|
-
autoGenerateHistory: boolean;
|
|
6
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* /effort <level> —— 切换 workflow effort level。
|
|
3
|
-
*
|
|
4
|
-
* 单一职责:维护 `session.meta.workflowEffortLevel`,触发 enter/exit reminder 一次性写入历史。
|
|
5
|
-
*
|
|
6
|
-
* 支持的 level:
|
|
7
|
-
* - `ultracode`:开启;后续每轮注入持续提醒(由 UltracodeEffortReminderInterceptor 驱动)
|
|
8
|
-
* - `high` / `default` / `off` / `none`:关闭(任意非 ultracode 字符串都视为关闭)
|
|
9
|
-
*
|
|
10
|
-
* Reminder 文本通过 PromptManager 从 prompt template 加载:
|
|
11
|
-
* - workflow-ultra-effort-enter
|
|
12
|
-
* - workflow-ultra-effort-exit ({{previous}}, {{current}})
|
|
13
|
-
*
|
|
14
|
-
* 不影响其他 effort 系统(此处仅作 workflow opt-in 开关;model 的 reasoning effort 由别处控制)。
|
|
15
|
-
*/
|
|
16
|
-
import { PromptManager } from '@genie/prompts';
|
|
17
|
-
import { Logger } from '@genie/telemetry';
|
|
18
|
-
import { Session, SessionManager } from '../session';
|
|
19
|
-
import { SettingsManager } from '../settings';
|
|
20
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
21
|
-
export declare class EffortCommandExecutor implements CommandExecutor {
|
|
22
|
-
name: string;
|
|
23
|
-
autoGenerateHistory: boolean;
|
|
24
|
-
protected readonly logger: Logger;
|
|
25
|
-
protected readonly sessionManager: SessionManager;
|
|
26
|
-
protected readonly settingsManager: SettingsManager;
|
|
27
|
-
protected readonly promptManager: PromptManager;
|
|
28
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
29
|
-
/** Visible-for-testing:argv → level 字符串 */
|
|
30
|
-
static parseLevel(args: unknown[]): string;
|
|
31
|
-
/** Visible-for-testing:把 (session, level) → stdout 字符串 + 副作用更新 meta */
|
|
32
|
-
run(session: Session, level: string): Promise<string>;
|
|
33
|
-
/**
|
|
34
|
-
* 持久化 reasoning effort 到用户全局 settings。写入失败不阻断命令(override 已生效),仅告警。
|
|
35
|
-
*/
|
|
36
|
-
private persistReasoningEffort;
|
|
37
|
-
/**
|
|
38
|
-
* Issue #58743: 解析当前"用户会看到的" effort 档位。
|
|
39
|
-
* ultracode > session override.reasoningEffort > merged settings.reasoningEffort
|
|
40
|
-
* 保持与 EffortPanel 的初始高亮同源,避免同一状态两处出现不同答案。
|
|
41
|
-
*/
|
|
42
|
-
private resolveEffectiveLevel;
|
|
43
|
-
private loadTemplate;
|
|
44
|
-
private fallbackExit;
|
|
45
|
-
private appendHistory;
|
|
46
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CheckpointService } from '../checkpoint';
|
|
2
|
-
import { SessionHookManager } from '../session';
|
|
3
|
-
import { type IWorktreeChangeDetector, type IWorktreeSessionManager } from '../worktree';
|
|
4
|
-
import { type CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
5
|
-
export declare class ExitCommandExecutor implements CommandExecutor {
|
|
6
|
-
name: string;
|
|
7
|
-
message: string;
|
|
8
|
-
autoGenerateHistory: boolean;
|
|
9
|
-
protected readonly checkpointService: CheckpointService;
|
|
10
|
-
protected readonly sessionHookManager: SessionHookManager;
|
|
11
|
-
protected readonly worktreeSessionManager?: IWorktreeSessionManager;
|
|
12
|
-
protected readonly worktreeChangeDetector?: IWorktreeChangeDetector;
|
|
13
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
2
|
-
export declare class ExportCommandExecutor implements CommandExecutor {
|
|
3
|
-
name: string;
|
|
4
|
-
message: string;
|
|
5
|
-
autoGenerateHistory: boolean;
|
|
6
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FeedbackService } from '../feedback';
|
|
2
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
3
|
-
export declare class FeedbackCommandExecutor implements CommandExecutor {
|
|
4
|
-
name: string;
|
|
5
|
-
message: string;
|
|
6
|
-
autoGenerateHistory: boolean;
|
|
7
|
-
protected readonly feedbackService: FeedbackService;
|
|
8
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `/fork-bg` —— 把当前会话复制成一个后台会话,**当前会话继续存活**。
|
|
3
|
-
*
|
|
4
|
-
* 对照 Claude Code v2.1.216 的 `/fork`(bundle 554633-554640、781588-781613)。
|
|
5
|
-
* 命名说明:本仓 `/fork` 已经是「前台分支」(与 `/branch` 同一个 executor),
|
|
6
|
-
* 语义与 Claude 相反。为了不改变既有用户的 `/fork` 行为,后台副本另起名 `/fork-bg`。
|
|
7
|
-
*
|
|
8
|
-
* 与 `/background` 的唯一差别就是「原会话是否继续」(design D8):
|
|
9
|
-
* - `/background`:前台交出去,自己退出
|
|
10
|
-
* - `/fork-bg`:副本进后台,父会话原样留在终端
|
|
11
|
-
*/
|
|
12
|
-
import { SessionManager } from '../session';
|
|
13
|
-
import { type Session } from '../session/session-protocol';
|
|
14
|
-
import { SettingsManager } from '../settings';
|
|
15
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
16
|
-
export declare class ForkBgCommandExecutor implements CommandExecutor {
|
|
17
|
-
name: string;
|
|
18
|
-
message: string;
|
|
19
|
-
autoGenerateHistory: boolean;
|
|
20
|
-
protected readonly sessionManager: SessionManager;
|
|
21
|
-
protected readonly settingsManager: SettingsManager;
|
|
22
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
23
|
-
/** 透传给副本的启动 flag(对照 D8:权限模式 / 模型 / effort / add-dir) */
|
|
24
|
-
protected inheritFlags(): string[];
|
|
25
|
-
protected restrictedFlag(): string | undefined;
|
|
26
|
-
protected failureMessage(reason: string): string;
|
|
27
|
-
protected isAgentViewDisabled(): Promise<boolean>;
|
|
28
|
-
protected isPersistenceDisabled(): Promise<boolean>;
|
|
29
|
-
protected say(session: Session, text: string): Promise<void>;
|
|
30
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@genie/telemetry';
|
|
2
|
-
import { SessionHookManager, SessionManager } from '../session';
|
|
3
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
4
|
-
/**
|
|
5
|
-
* /fork 命令执行器
|
|
6
|
-
*
|
|
7
|
-
* 在当前对话位置创建一个分支,复制活跃对话历史到新 session 并自动切换。
|
|
8
|
-
* 参考 Claude Code 的 /branch 命令实现。
|
|
9
|
-
*/
|
|
10
|
-
export declare class ForkCommandExecutor implements CommandExecutor {
|
|
11
|
-
name: string;
|
|
12
|
-
message: string;
|
|
13
|
-
autoGenerateHistory: boolean;
|
|
14
|
-
protected readonly sessionManager: SessionManager;
|
|
15
|
-
protected readonly sessionHookManager: SessionHookManager;
|
|
16
|
-
protected readonly logger: Logger;
|
|
17
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* 通知 ACP 客户端 session 已切换
|
|
20
|
-
*/
|
|
21
|
-
private notifySessionReset;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* /branch 命令执行器,与 /fork 功能完全相同
|
|
25
|
-
*/
|
|
26
|
-
export declare class BranchCommandExecutor extends ForkCommandExecutor {
|
|
27
|
-
name: string;
|
|
28
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { AcpBroadcastService, GoalRecapPayload } from '../acp/acp-protocol';
|
|
2
|
-
import { GoalService } from '../goal';
|
|
3
|
-
import { NavigationManager } from '../navigation';
|
|
4
|
-
import { CommandExecuteContext, CommandExecutor } from './command-protocol';
|
|
5
|
-
/**
|
|
6
|
-
* `/goal` 斜杠命令。
|
|
7
|
-
*
|
|
8
|
-
* 仅做参数派发:
|
|
9
|
-
* /goal → 打开 recap 面板(TUI 走 NavigationManager;Web UI ACP
|
|
10
|
-
* 走 AcpBroadcastService.broadcastGoalRecap)
|
|
11
|
-
* /goal clear → goalService.clear
|
|
12
|
-
* /goal pause → 已有 goal 则 pause;否则 set("pause")(旧斜杠语义)
|
|
13
|
-
* /goal resume → 已有 goal 则 resume;否则 set("resume")
|
|
14
|
-
* /goal <condition> → goalService.set
|
|
15
|
-
*
|
|
16
|
-
* 业务逻辑(hook 注册、文案、metric)全部在 GoalService 里。Executor 留得越薄
|
|
17
|
-
* 越容易单测——单测里 mock GoalService 即可断言派发是否正确。
|
|
18
|
-
*
|
|
19
|
-
* 双通道触发理由:TUI 的 NavigationManager 路径是本地 React Ink 路由,根本
|
|
20
|
-
* 不会过 ACP,Web UI 看不见;反过来 Web UI 的 ACP 客户端也不参与 TUI 路由。
|
|
21
|
-
* 两条路径同时触发,对端没连接时 broadcast fan-out 自动空集合跳过,对端连接
|
|
22
|
-
* 时各自打开自己 UI 框架下的面板。
|
|
23
|
-
*
|
|
24
|
-
* Headless / SDK 场景下 NavigationManager 与 AcpBroadcastService 都不可用
|
|
25
|
-
* (`@Optional`),降级走 goalService.show 的纯文本输出,保留兼容。
|
|
26
|
-
*/
|
|
27
|
-
export declare class GoalCommandExecutor implements CommandExecutor {
|
|
28
|
-
name: string;
|
|
29
|
-
message: string;
|
|
30
|
-
autoGenerateHistory: boolean;
|
|
31
|
-
protected readonly goalService: GoalService;
|
|
32
|
-
protected readonly navigationManager?: NavigationManager;
|
|
33
|
-
protected readonly acpBroadcastService?: AcpBroadcastService;
|
|
34
|
-
execute(ctx: CommandExecuteContext): Promise<void>;
|
|
35
|
-
/** WorkBuddy/unopted ACP keeps the historical `/goal <condition>` parser. */
|
|
36
|
-
protected supportsPauseResumeCommands(session: CommandExecuteContext['session']): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* 同时给 TUI(NavigationManager)和 Web UI(ACP broadcast)发起 recap 面板。
|
|
39
|
-
*
|
|
40
|
-
* - TUI 路径:本地路由切换,不依赖 session 数据,直接 navigate 即可,UI 自己从
|
|
41
|
-
* GoalService 拉取 active/latest。
|
|
42
|
-
* - Web UI 路径:ACP 客户端拿不到 GoalService,需要服务端把 recap snapshot
|
|
43
|
-
* 组装好通过 _meta 推过去。两个路径数据源同一个,行为对齐。
|
|
44
|
-
*
|
|
45
|
-
* @returns 是否至少一条通道成功触发(用于 headless 降级判断)。
|
|
46
|
-
*/
|
|
47
|
-
protected openRecapPanels(session: CommandExecuteContext['session']): Promise<boolean>;
|
|
48
|
-
/** 把 GoalService 的 active / latest 投影成 ACP recap payload。 */
|
|
49
|
-
protected buildRecapPayload(session: CommandExecuteContext['session']): GoalRecapPayload;
|
|
50
|
-
}
|