refactor(oauth): add provider registry
This commit is contained in:
@@ -32,6 +32,7 @@ import type {
|
||||
ExtensionRuntime,
|
||||
LoadExtensionsResult,
|
||||
MessageRenderer,
|
||||
ProviderConfig,
|
||||
RegisteredCommand,
|
||||
ToolDefinition,
|
||||
} from "./types.js";
|
||||
@@ -122,6 +123,7 @@ export function createExtensionRuntime(): ExtensionRuntime {
|
||||
getThinkingLevel: notInitialized,
|
||||
setThinkingLevel: notInitialized,
|
||||
flagValues: new Map(),
|
||||
pendingProviderRegistrations: [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -238,6 +240,10 @@ function createExtensionAPI(
|
||||
runtime.setThinkingLevel(level);
|
||||
},
|
||||
|
||||
registerProvider(name: string, config: ProviderConfig) {
|
||||
runtime.pendingProviderRegistrations.push({ name, config });
|
||||
},
|
||||
|
||||
events: eventBus,
|
||||
} as ExtensionAPI;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user