summaryrefslogtreecommitdiffhomepage
path: root/packages/plugin/src
diff options
context:
space:
mode:
authorOla <[email protected]>2025-11-04 22:36:12 +0100
committerGitHub <[email protected]>2025-11-04 15:36:12 -0600
commitfe94bb8e50ed9625e553cc7bd79d3a02889c2979 (patch)
tree1777af638ffe04a950712d644b2555454cfcd08e /packages/plugin/src
parentba8bc1b8b488e10eec8c0b915a753f4810164343 (diff)
downloadopencode-fe94bb8e50ed9625e553cc7bd79d3a02889c2979.tar.gz
opencode-fe94bb8e50ed9625e553cc7bd79d3a02889c2979.zip
feat(provider): add GitHub Enterprise support for Copilot (#2522)
Co-authored-by: Jon-Mikkel Korsvik <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
Diffstat (limited to 'packages/plugin/src')
-rw-r--r--packages/plugin/src/index.ts61
1 files changed, 59 insertions, 2 deletions
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<string, string>) => boolean
+ }
+ | {
+ type: "select"
+ key: string
+ message: string
+ options: Array<{
+ label: string
+ value: string
+ hint?: string
+ }>
+ condition?: (inputs: Record<string, string>) => boolean
+ }
+ >
+ authorize(inputs?: Record<string, string>): 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<string, string>) => boolean
+ }
+ | {
+ type: "select"
+ key: string
+ message: string
+ options: Array<{
+ label: string
+ value: string
+ hint?: string
+ }>
+ condition?: (inputs: Record<string, string>) => boolean
+ }
+ >
+ authorize?(inputs?: Record<string, string>): Promise<
+ | {
+ type: "success"
+ key: string
+ provider?: string
+ }
+ | {
+ type: "failed"
+ }
+ >
+ }
)[]
}
/**