Repository: TabbyML/tabby
File: clients/tabby-agent/src/protocol.ts (TypeScript)

Code before:
    /**
     * Add undo stop after making the edits.
     */
    readonly undoStopAfter: boolean;
  };
}

export type ChatEditResolveCommand = LspCommand & {
  title: string;
  tooltip?: string;
  command: "tabby/chat/edit/resolve";
  arguments: [ChatEditResolveParams];
};

/**
 * [Tabby] Opened File Tracking Request(➡️)
 *
 * This method is sent from the client to server with specific action to track opened file.
 *
 *
 * - method: `tabby/agent/openedFileOperation`
 * - params: {@link OpenedFileParams}
 * - result: void
 */
export namespace OpenedFileRequest {
  export const method = "tabby/agent/openedFileOperation";
  export const messageDirection = MessageDirection.clientToServer;
  export const type = new ProtocolNotificationType<OpenedFileParams, void>(method);
}
export interface EditorParams {
  uri: string;
  visibleRange: Range;
}
export type OpenedFileParams = {
  action: "change" | "test";
  activeEditor: EditorParams;
  visibleEditors?: EditorParams[];
};

/**
 * [Tabby] GenerateCommitMessage Request(↩️)
 *
 * This method is sent from the client to the server to generate a commit message for a git repository.
 * - method: `tabby/chat/generateCommitMessage`
 * - params: {@link GenerateCommitMessageParams}
 * - result: {@link GenerateCommitMessageResult} | null
 * - error: {@link ChatFeatureNotAvailableError}
 */
export namespace GenerateCommitMessageRequest {
  export const method = "tabby/chat/generateCommitMessage";
  export const messageDirection = MessageDirection.clientToServer;

Review comment (suggestion):
```suggestion
export namespace DidChangeActiveEditorNotification {
  export const method = "tabby/editors/didChangeActiveEditor";
```

Code after:
    /**
     * Add undo stop after making the edits.
     */
    readonly undoStopAfter: boolean;
  };
}

export type ChatEditResolveCommand = LspCommand & {
  title: string;
  tooltip?: string;
  command: "tabby/chat/edit/resolve";
  arguments: [ChatEditResolveParams];
};

/**
 * [Tabby] Did Change Active Editor Notification(➡️)
 *
 * This method is sent from the client to server when the active editor changed.
 *
 *
 * - method: `tabby/editors/didChangeActiveEditor`
 * - params: {@link OpenedFileParams}
 * - result: void
 */
export namespace DidChangeActiveEditorNotification {
  export const method = "tabby/editors/didChangeActiveEditor";
  export const messageDirection = MessageDirection.clientToServer;
  export const type = new ProtocolNotificationType<DidChangeActiveEditorParams, void>(method);
}
export type DidChangeActiveEditorParams = {
  activeEditor: Location;
  visibleEditors: Location[] | undefined;
};

/**
 * [Tabby] GenerateCommitMessage Request(↩️)
 *
 * This method is sent from the client to the server to generate a commit message for a git repository.
 * - method: `tabby/chat/generateCommitMessage`
 * - params: {@link GenerateCommitMessageParams}
 * - result: {@link GenerateCommitMessageResult} | null
 * - error: {@link ChatFeatureNotAvailableError}
 */
export namespace GenerateCommitMessageRequest {
  export const method = "tabby/chat/generateCommitMessage";
  export const messageDirection = MessageDirection.clientToServer;
  export const type = new ProtocolRequestType<
    GenerateCommitMessageParams,
    GenerateCommitMessageResult | null,
    void,
    ChatFeatureNotAvailableError,