Add Maestro login button

This commit is contained in:
Saoud Rizwan
2024-08-22 11:02:25 -04:00
parent e8df2400bf
commit f6fd76823b
18 changed files with 375 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
import { ApiConfiguration } from "./api"
import { HistoryItem } from "./HistoryItem"
import { MaestroUser } from "./maestro"
// webview will hold state
export interface ExtensionMessage {
@@ -21,6 +22,7 @@ export interface ExtensionState {
claudeMessages: ClaudeMessage[]
taskHistory: HistoryItem[]
shouldShowAnnouncement: boolean
maestroUser?: MaestroUser
}
export interface ClaudeMessage {

View File

@@ -15,6 +15,8 @@ export interface WebviewMessage {
| "showTaskWithId"
| "deleteTaskWithId"
| "exportTaskWithId"
| "didClickMaestroSignIn"
| "didClickMaestroSignOut"
text?: string
askResponse?: ClaudeAskResponse
apiConfiguration?: ApiConfiguration

View File

@@ -1,4 +1,4 @@
export type ApiProvider = "anthropic" | "openrouter" | "bedrock"
export type ApiProvider = "anthropic" | "openrouter" | "bedrock" | "maestro"
export interface ApiHandlerOptions {
apiModelId?: ApiModelId
@@ -7,6 +7,7 @@ export interface ApiHandlerOptions {
awsAccessKey?: string
awsSecretKey?: string
awsRegion?: string
maestroToken?: string
}
export type ApiConfiguration = ApiHandlerOptions & {
@@ -232,3 +233,10 @@ export const openRouterModels = {
// outputPrice: 1.5,
// },
} as const satisfies Record<string, ModelInfo>
// Maestro
export type MaestroModelId = keyof typeof maestroModels
export const maestroDefaultModelId: MaestroModelId = "claude-3-5-sonnet-20240620"
export const maestroModels = {
...anthropicModels,
} as const satisfies Record<string, ModelInfo>

10
src/shared/maestro.ts Normal file
View File

@@ -0,0 +1,10 @@
import { z } from "zod"
export const MaestroUserSchema = z.object({
id: z.string(),
image: z.string().nullable(),
email: z.string().email(),
name: z.string().nullable(),
emailVerified: z.coerce.date().nullable(),
})
export type MaestroUser = z.infer<typeof MaestroUserSchema>