mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 17:01:02 +00:00
Refactor OAuth/API key handling: AuthStorage and ModelRegistry
- Add AuthStorage class for credential storage (auth.json) - Add ModelRegistry class for model management with API key resolution - Add discoverAuthStorage() and discoverModels() discovery functions - Add migration from legacy oauth.json and settings.json apiKeys to auth.json - Remove configureOAuthStorage, defaultGetApiKey, findModel, discoverAvailableModels - Remove apiKeys from Settings type and SettingsManager methods - Rename getOAuthPath to getAuthPath - Update SDK, examples, docs, tests, and mom package Fixes #296
This commit is contained in:
parent
9f97f0c8da
commit
54018b6cc0
29 changed files with 953 additions and 2017 deletions
|
|
@ -9,6 +9,8 @@ export {
|
|||
type PromptOptions,
|
||||
type SessionStats,
|
||||
} from "./core/agent-session.js";
|
||||
// Auth and model registry
|
||||
export { type ApiKeyCredential, type AuthCredential, AuthStorage, type OAuthCredential } from "./core/auth-storage.js";
|
||||
// Compaction
|
||||
export {
|
||||
type CutPointResult,
|
||||
|
|
@ -72,24 +74,13 @@ export {
|
|||
isWriteToolResult,
|
||||
} from "./core/hooks/index.js";
|
||||
export { messageTransformer } from "./core/messages.js";
|
||||
// Model configuration and OAuth
|
||||
export { findModel, getApiKeyForModel, getAvailableModels } from "./core/models-json.js";
|
||||
export {
|
||||
getOAuthProviders,
|
||||
login,
|
||||
logout,
|
||||
type OAuthAuthInfo,
|
||||
type OAuthPrompt,
|
||||
type OAuthProvider,
|
||||
} from "./core/oauth/index.js";
|
||||
export { ModelRegistry } from "./core/model-registry.js";
|
||||
// SDK for programmatic usage
|
||||
export {
|
||||
type BuildSystemPromptOptions,
|
||||
buildSystemPrompt,
|
||||
type CreateAgentSessionOptions,
|
||||
type CreateAgentSessionResult,
|
||||
// Configuration
|
||||
configureOAuthStorage,
|
||||
// Factory
|
||||
createAgentSession,
|
||||
createBashTool,
|
||||
|
|
@ -102,18 +93,15 @@ export {
|
|||
createReadOnlyTools,
|
||||
createReadTool,
|
||||
createWriteTool,
|
||||
// Helpers
|
||||
defaultGetApiKey,
|
||||
discoverAvailableModels,
|
||||
// Discovery
|
||||
discoverAuthStorage,
|
||||
discoverContextFiles,
|
||||
discoverCustomTools,
|
||||
discoverHooks,
|
||||
// Discovery
|
||||
discoverModels,
|
||||
discoverSkills,
|
||||
discoverSlashCommands,
|
||||
type FileSlashCommand,
|
||||
findModel as findModelByProviderAndId,
|
||||
loadSettings,
|
||||
// Pre-built tools (use process.cwd())
|
||||
readOnlyTools,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue