Skip to content

Commit b662209

Browse files
authored
refactor(github-copilot): localize internal helpers (#101393)
1 parent 7b366e1 commit b662209

5 files changed

Lines changed: 5 additions & 6 deletions

File tree

extensions/github-copilot/connection-bound-ids.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function rewriteCopilotConnectionBoundResponseIds(input: unknown): boolea
7070
return sanitizeCopilotReplayResponseIds(input);
7171
}
7272

73-
export function sanitizeCopilotReplayResponsePayloadIds(payload: unknown): boolean {
73+
function sanitizeCopilotReplayResponsePayloadIds(payload: unknown): boolean {
7474
if (!payload || typeof payload !== "object") {
7575
return false;
7676
}

extensions/github-copilot/login.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ function normalizeGitHubDeviceUserCode(raw: string): string {
260260
return userCode;
261261
}
262262

263-
export type GitHubCopilotDeviceFlowResult =
263+
type GitHubCopilotDeviceFlowResult =
264264
| { status: "authorized"; accessToken: string }
265265
| { status: "access_denied" }
266266
| { status: "expired" };
267267

268-
export type GitHubCopilotDeviceFlowIO = {
268+
type GitHubCopilotDeviceFlowIO = {
269269
showCode(args: { verificationUrl: string; userCode: string; expiresInMs: number }): Promise<void>;
270270
openUrl?: (url: string) => Promise<void>;
271271
};

extensions/github-copilot/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function asCopilotApiModelEntry(value: unknown): CopilotApiModelEntry {
245245
return value as CopilotApiModelEntry;
246246
}
247247

248-
export type FetchCopilotModelCatalogParams = {
248+
type FetchCopilotModelCatalogParams = {
249249
/** Short-lived Copilot API token (from `resolveCopilotApiToken`). */
250250
copilotApiToken: string;
251251
/** Resolved baseUrl from the same token-exchange response. */

extensions/github-copilot/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function inferCopilotInitiator(messages: Context["messages"]): "agent" | "user"
3434
return last.role === "user" ? "user" : "agent";
3535
}
3636

37-
export function hasCopilotVisionInput(messages: Context["messages"]): boolean {
37+
function hasCopilotVisionInput(messages: Context["messages"]): boolean {
3838
return messages.some((message) => {
3939
if (message.role === "user" && Array.isArray(message.content)) {
4040
return message.content.some((item) => containsCopilotContentType(item, "image"));

extensions/github-copilot/token.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ export {
33
DEFAULT_COPILOT_API_BASE_URL,
44
deriveCopilotApiBaseUrlFromToken,
55
resolveCopilotApiToken,
6-
type CachedCopilotToken,
76
} from "openclaw/plugin-sdk/provider-auth";

0 commit comments

Comments
 (0)