From fe94bb8e50ed9625e553cc7bd79d3a02889c2979 Mon Sep 17 00:00:00 2001 From: Ola <74724224+OlaHulleberg@users.noreply.github.com> Date: Tue, 4 Nov 2025 22:36:12 +0100 Subject: feat(provider): add GitHub Enterprise support for Copilot (#2522) Co-authored-by: Jon-Mikkel Korsvik <48263282+jkorsvik@users.noreply.github.com> Co-authored-by: GitHub Action Co-authored-by: Aiden Cline --- packages/plugin/src/index.ts | 61 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'packages/plugin/src') diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index 9c2647c60..f103749bd 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -39,13 +39,35 @@ export interface Hooks { | { type: "oauth" label: string - authorize(): Promise< + prompts?: Array< + | { + type: "text" + key: string + message: string + placeholder?: string + validate?: (value: string) => string | undefined + condition?: (inputs: Record) => boolean + } + | { + type: "select" + key: string + message: string + options: Array<{ + label: string + value: string + hint?: string + }> + condition?: (inputs: Record) => boolean + } + > + authorize(inputs?: Record): Promise< { url: string; instructions: string } & ( | { method: "auto" callback(): Promise< | ({ type: "success" + provider?: string } & ( | { refresh: string @@ -64,6 +86,7 @@ export interface Hooks { callback(code: string): Promise< | ({ type: "success" + provider?: string } & ( | { refresh: string @@ -80,7 +103,41 @@ export interface Hooks { ) > } - | { type: "api"; label: string } + | { + type: "api" + label: string + prompts?: Array< + | { + type: "text" + key: string + message: string + placeholder?: string + validate?: (value: string) => string | undefined + condition?: (inputs: Record) => boolean + } + | { + type: "select" + key: string + message: string + options: Array<{ + label: string + value: string + hint?: string + }> + condition?: (inputs: Record) => boolean + } + > + authorize?(inputs?: Record): Promise< + | { + type: "success" + key: string + provider?: string + } + | { + type: "failed" + } + > + } )[] } /** -- cgit v1.2.3