mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 15:02:32 +00:00
Rename /branch command to /fork
- RPC: branch -> fork, get_branch_messages -> get_fork_messages - SDK: branch() -> fork(), getBranchMessages() -> getForkMessages() - AgentSession: branch() -> fork(), getUserMessagesForBranching() -> getUserMessagesForForking() - Extension events: session_before_branch -> session_before_fork, session_branch -> session_fork - Settings: doubleEscapeAction 'branch' -> 'fork' fixes #641
This commit is contained in:
parent
e7352a50bf
commit
df3f5f41c0
27 changed files with 162 additions and 156 deletions
|
|
@ -35,7 +35,7 @@ export interface SettingsConfig {
|
|||
availableThemes: string[];
|
||||
hideThinkingBlock: boolean;
|
||||
collapseChangelog: boolean;
|
||||
doubleEscapeAction: "branch" | "tree";
|
||||
doubleEscapeAction: "fork" | "tree";
|
||||
}
|
||||
|
||||
export interface SettingsCallbacks {
|
||||
|
|
@ -51,7 +51,7 @@ export interface SettingsCallbacks {
|
|||
onThemePreview?: (theme: string) => void;
|
||||
onHideThinkingBlockChange: (hidden: boolean) => void;
|
||||
onCollapseChangelogChange: (collapsed: boolean) => void;
|
||||
onDoubleEscapeActionChange: (action: "branch" | "tree") => void;
|
||||
onDoubleEscapeActionChange: (action: "fork" | "tree") => void;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ export class SettingsSelectorComponent extends Container {
|
|||
label: "Double-escape action",
|
||||
description: "Action when pressing Escape twice with empty editor",
|
||||
currentValue: config.doubleEscapeAction,
|
||||
values: ["tree", "branch"],
|
||||
values: ["tree", "fork"],
|
||||
},
|
||||
{
|
||||
id: "thinking",
|
||||
|
|
@ -304,7 +304,7 @@ export class SettingsSelectorComponent extends Container {
|
|||
callbacks.onCollapseChangelogChange(newValue === "true");
|
||||
break;
|
||||
case "double-escape-action":
|
||||
callbacks.onDoubleEscapeActionChange(newValue as "branch" | "tree");
|
||||
callbacks.onDoubleEscapeActionChange(newValue as "fork" | "tree");
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ export class InteractiveMode {
|
|||
{ name: "session", description: "Show session info and stats" },
|
||||
{ name: "changelog", description: "Show changelog entries" },
|
||||
{ name: "hotkeys", description: "Show all keyboard shortcuts" },
|
||||
{ name: "branch", description: "Create a new branch from a previous message" },
|
||||
{ name: "fork", description: "Create a new fork from a previous message" },
|
||||
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
||||
{ name: "login", description: "Login with OAuth provider" },
|
||||
{ name: "logout", description: "Logout from OAuth provider" },
|
||||
|
|
@ -730,8 +730,8 @@ export class InteractiveMode {
|
|||
|
||||
return { cancelled: false };
|
||||
},
|
||||
branch: async (entryId) => {
|
||||
const result = await this.session.branch(entryId);
|
||||
fork: async (entryId) => {
|
||||
const result = await this.session.fork(entryId);
|
||||
if (result.cancelled) {
|
||||
return { cancelled: true };
|
||||
}
|
||||
|
|
@ -739,7 +739,7 @@ export class InteractiveMode {
|
|||
this.chatContainer.clear();
|
||||
this.renderInitialMessages();
|
||||
this.editor.setText(result.selectedText);
|
||||
this.showStatus("Branched to new session");
|
||||
this.showStatus("Forked to new session");
|
||||
|
||||
return { cancelled: false };
|
||||
},
|
||||
|
|
@ -1336,7 +1336,7 @@ export class InteractiveMode {
|
|||
this.isBashMode = false;
|
||||
this.updateEditorBorderColor();
|
||||
} else if (!this.editor.getText().trim()) {
|
||||
// Double-escape with empty editor triggers /tree or /branch based on setting
|
||||
// Double-escape with empty editor triggers /tree or /fork based on setting
|
||||
const now = Date.now();
|
||||
if (now - this.lastEscapeTime < 500) {
|
||||
if (this.settingsManager.getDoubleEscapeAction() === "tree") {
|
||||
|
|
@ -1456,7 +1456,7 @@ export class InteractiveMode {
|
|||
this.editor.setText("");
|
||||
return;
|
||||
}
|
||||
if (text === "/branch") {
|
||||
if (text === "/fork") {
|
||||
this.showUserMessageSelector();
|
||||
this.editor.setText("");
|
||||
return;
|
||||
|
|
@ -2738,10 +2738,10 @@ export class InteractiveMode {
|
|||
}
|
||||
|
||||
private showUserMessageSelector(): void {
|
||||
const userMessages = this.session.getUserMessagesForBranching();
|
||||
const userMessages = this.session.getUserMessagesForForking();
|
||||
|
||||
if (userMessages.length === 0) {
|
||||
this.showStatus("No messages to branch from");
|
||||
this.showStatus("No messages to fork from");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2749,9 +2749,9 @@ export class InteractiveMode {
|
|||
const selector = new UserMessageSelectorComponent(
|
||||
userMessages.map((m) => ({ id: m.entryId, text: m.text })),
|
||||
async (entryId) => {
|
||||
const result = await this.session.branch(entryId);
|
||||
const result = await this.session.fork(entryId);
|
||||
if (result.cancelled) {
|
||||
// Extension cancelled the branch
|
||||
// Extension cancelled the fork
|
||||
done();
|
||||
this.ui.requestRender();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue