Browse Source

Export ProviderName type to Roo-Code-Types (#3675)

Chris Estreich 7 months ago
parent
commit
6e958df09e
4 changed files with 87 additions and 0 deletions
  1. 10 0
      src/exports/interface.ts
  2. 51 0
      src/exports/roo-code.d.ts
  3. 25 0
      src/exports/types.ts
  4. 1 0
      src/schemas/index.ts

+ 10 - 0
src/exports/interface.ts

@@ -7,6 +7,7 @@ import { Socket } from "node:net"
 
 import type {
 	GlobalSettings,
+	ProviderName,
 	ProviderSettings,
 	ProviderSettingsEntry,
 	ClineMessage,
@@ -19,6 +20,7 @@ import type {
 
 export type {
 	GlobalSettings,
+	ProviderName,
 	ProviderSettings,
 	ProviderSettingsEntry,
 	ClineMessage,
@@ -37,6 +39,14 @@ import { RooCodeEventName, IpcOrigin, IpcMessageType } from "../schemas"
 
 export { RooCodeEventName, IpcOrigin, IpcMessageType }
 
+/**
+ * Constants
+ */
+
+import { providerNames } from "../schemas"
+
+export { providerNames }
+
 /**
  * RooCodeAPI
  */

+ 51 - 0
src/exports/roo-code.d.ts

@@ -174,6 +174,29 @@ type GlobalSettings = {
 	historyPreviewCollapsed?: boolean | undefined
 }
 
+type ProviderName =
+	| "anthropic"
+	| "glama"
+	| "openrouter"
+	| "bedrock"
+	| "vertex"
+	| "openai"
+	| "ollama"
+	| "vscode-lm"
+	| "lmstudio"
+	| "gemini"
+	| "openai-native"
+	| "mistral"
+	| "deepseek"
+	| "unbound"
+	| "requesty"
+	| "human-relay"
+	| "fake-ai"
+	| "xai"
+	| "groq"
+	| "chutes"
+	| "litellm"
+
 type ProviderSettings = {
 	apiProvider?:
 		| (
@@ -1474,6 +1497,32 @@ type TaskEvent =
 			]
 	  }
 
+/**
+ * ProviderName
+ */
+declare const providerNames: readonly [
+	"anthropic",
+	"glama",
+	"openrouter",
+	"bedrock",
+	"vertex",
+	"openai",
+	"ollama",
+	"vscode-lm",
+	"lmstudio",
+	"gemini",
+	"openai-native",
+	"mistral",
+	"deepseek",
+	"unbound",
+	"requesty",
+	"human-relay",
+	"fake-ai",
+	"xai",
+	"groq",
+	"chutes",
+	"litellm",
+]
 /**
  * RooCodeEvent
  */
@@ -1660,6 +1709,7 @@ export {
 	IpcMessageType,
 	IpcOrigin,
 	type IpcServerEvents,
+	type ProviderName,
 	type ProviderSettings,
 	type ProviderSettingsEntry,
 	type RooCodeAPI,
@@ -1670,4 +1720,5 @@ export {
 	type TaskCommand,
 	type TaskEvent,
 	type TokenUsage,
+	providerNames,
 }

+ 25 - 0
src/exports/types.ts

@@ -176,6 +176,31 @@ type GlobalSettings = {
 
 export type { GlobalSettings }
 
+type ProviderName =
+	| "anthropic"
+	| "glama"
+	| "openrouter"
+	| "bedrock"
+	| "vertex"
+	| "openai"
+	| "ollama"
+	| "vscode-lm"
+	| "lmstudio"
+	| "gemini"
+	| "openai-native"
+	| "mistral"
+	| "deepseek"
+	| "unbound"
+	| "requesty"
+	| "human-relay"
+	| "fake-ai"
+	| "xai"
+	| "groq"
+	| "chutes"
+	| "litellm"
+
+export type { ProviderName }
+
 type ProviderSettings = {
 	apiProvider?:
 		| (

+ 1 - 0
src/schemas/index.ts

@@ -1212,6 +1212,7 @@ export type TypeDefinition = {
 
 export const typeDefinitions: TypeDefinition[] = [
 	{ schema: globalSettingsSchema, identifier: "GlobalSettings" },
+	{ schema: providerNamesSchema, identifier: "ProviderName" },
 	{ schema: providerSettingsSchema, identifier: "ProviderSettings" },
 	{ schema: providerSettingsEntrySchema, identifier: "ProviderSettingsEntry" },
 	{ schema: clineMessageSchema, identifier: "ClineMessage" },