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

Code before:
};

/**
 * [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;
  export const type = new ProtocolRequestType<
    GenerateCommitMessageParams,
    GenerateCommitMessageResult | null,
    void,
    ChatFeatureNotAvailableError,
    void
  >(method);
}

export type GenerateCommitMessageParams = {
  /**
   * The root URI of the git repository.

Review comment (suggestion):
```suggestion
export type DidChangeActiveEditorParams = {
  activeEditor: Location;
  visibleEditors: Location[] | undefined;
};
```

Code after:
};

/**
 * [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,
    void
  >(method);
}

export type GenerateCommitMessageParams = {
  /**
   * The root URI of the git repository.
   */
  repository: URI;
};

export type GenerateCommitMessageResult = {