import { Database } from "sqlite"; import { Agent, AgentAuthMetadata, AgentAuthSecret, AgentHealth, AgentUsageLimitRecord, AgentModel, AgentPromptManifest, CreateAgentInput, UpsertAgentUsageLimitInput, UpdateAgentInput, WorkspaceDefault } from "@mcoda/shared"; import { Connection } from "../../sqlite/connection.js"; export type GlobalCommandStatus = "running" | "succeeded" | "failed"; export interface GlobalCommandRunInsert { commandName: string; startedAt: string; status: GlobalCommandStatus; exitCode?: number | null; errorSummary?: string | null; payload?: Record; } export interface GlobalCommandRun extends GlobalCommandRunInsert { id: string; completedAt?: string | null; result?: Record; } export interface GlobalTokenUsageInsert { agentId?: string | null; commandRunId?: string | null; modelName?: string | null; commandName?: string | null; action?: string | null; invocationKind?: string | null; provider?: string | null; currency?: string | null; tokensPrompt?: number | null; tokensCompletion?: number | null; tokensTotal?: number | null; tokensCached?: number | null; tokensCacheRead?: number | null; tokensCacheWrite?: number | null; costEstimate?: number | null; durationSeconds?: number | null; durationMs?: number | null; startedAt?: string | null; finishedAt?: string | null; timestamp: string; metadata?: Record; } export interface AgentRunRatingInsert { agentId: string; jobId?: string | null; commandRunId?: string | null; taskId?: string | null; taskKey?: string | null; commandName?: string | null; discipline?: string | null; complexity?: number | null; qualityScore?: number | null; tokensTotal?: number | null; durationSeconds?: number | null; iterations?: number | null; totalCost?: number | null; runScore?: number | null; ratingVersion?: string | null; rawReview?: Record | null; createdAt: string; } export interface AgentRunRatingRow extends AgentRunRatingInsert { id: string; } export declare class GlobalRepository { private db; private connection?; constructor(db: Database, connection?: Connection | undefined); static create(): Promise; close(): Promise; listAgents(): Promise; getAgentById(id: string): Promise; getAgentBySlug(slug: string): Promise; createAgent(input: CreateAgentInput): Promise; updateAgent(id: string, patch: UpdateAgentInput): Promise; deleteAgent(id: string): Promise; setAgentCapabilities(agentId: string, capabilities: string[]): Promise; getAgentCapabilities(agentId: string): Promise; setAgentModels(agentId: string, models: AgentModel[]): Promise; getAgentModels(agentId: string): Promise; setAgentPrompts(agentId: string, prompts: AgentPromptManifest): Promise; getAgentPrompts(agentId: string): Promise; setAgentAuth(agentId: string, encryptedSecret: string, lastVerifiedAt?: string): Promise; getAgentAuthMetadata(agentId: string): Promise; getAgentAuthSecret(agentId: string): Promise; setAgentHealth(health: AgentHealth): Promise; getAgentHealth(agentId: string): Promise; listAgentHealthSummary(): Promise; upsertAgentUsageLimit(input: UpsertAgentUsageLimitInput): Promise; upsertAgentUsageLimits(inputs: UpsertAgentUsageLimitInput[]): Promise; listAgentUsageLimits(agentId?: string): Promise; setWorkspaceDefault(workspaceId: string, commandName: string, agentId: string, options?: { qaProfile?: string; docdexScope?: string; }): Promise; getWorkspaceDefaults(workspaceId: string): Promise; removeWorkspaceDefault(workspaceId: string, commandName: string): Promise; findWorkspaceReferences(agentId: string): Promise; createCommandRun(record: GlobalCommandRunInsert): Promise; completeCommandRun(id: string, update: { status: GlobalCommandStatus; completedAt: string; exitCode?: number | null; errorSummary?: string | null; result?: Record; }): Promise; recordTokenUsage(entry: GlobalTokenUsageInsert): Promise; insertAgentRunRating(entry: AgentRunRatingInsert): Promise; listAgentRunRatings(agentId: string, limit?: number): Promise; } //# sourceMappingURL=GlobalRepository.d.ts.map