import type { ProjectContext } from "./memory.js"; import type { WorkflowDefinition } from "./workflow.js"; export interface PluginInstructionRequest { pluginName: string; workflowName: string; stepId: string; title: string; instruction: string; suggestedTools: string[]; expectedOutput?: string; input: Record; } export interface PluginWorkflowStepContext { sessionId: string; projectRoot: string; executeInstruction?(request: PluginInstructionRequest): Promise>; } export interface PluginWorkflowStepHandler { id: string; run(input: Record, context: PluginWorkflowStepContext): Promise>; inputSchema?: Record; outputSchema?: Record; } export interface KnowledgeSource { name: string; urls: string[]; pluginName: string; version: string; renderJs?: boolean; } export interface KnowledgeEntry { id: string; source: string; title: string; content: string; url?: string; version?: string; embedding: number[]; score?: number; excerpt?: string; matchingTerms?: string[]; applicability?: string[]; scoreDetails?: import('./knowledge.js').KnowledgeScoreDetails; } export interface McpToolDef { name: string; description: string; inputSchema: Record; outputSchema?: Record; annotations?: { readOnlyHint?: boolean; destructiveHint?: boolean; idempotentHint?: boolean; openWorldHint?: boolean; }; handler: (input: Record) => Promise; } export interface PluginContext { projectRoot: string; memory: { getAll(): Promise; upsertGlobal(entries: unknown[]): Promise; }; knowledge: { registerSource(source: KnowledgeSource): Promise; }; workflow: { registerStepHandler(id: string, handler: unknown): void; }; } export interface DevFlowPlugin { meta: { name: string; version: string; description: string; icon?: string; tags: string[]; }; knowledge: { sources: KnowledgeSource[]; embeddings?: string; }; memory?: { /** Optional suggestions. They must never be persisted without explicit user selection. */ project?: Partial; global?: KnowledgeEntry[]; }; workflow?: { steps: PluginWorkflowStepHandler[]; templates?: WorkflowDefinition[]; }; prompt?: { system?: string; rules?: string[]; /** Tool names required by this plugin's projected Skill contract. */ requiredTools?: string[]; }; tools?: McpToolDef[]; onInstall?(ctx: PluginContext): Promise; onUninstall?(ctx: PluginContext): Promise; onUpdate?(ctx: PluginContext, prevVersion: string): Promise; } export type PluginRecommendation = 'install' | 'optimize' | 'remove'; export interface PluginEffectivenessSummary { name: string; installCount: number; usageCount: number; activeRate: number; successRate: number; lastUsedAt?: string; compatibleStacks?: string[]; recommendation: PluginRecommendation; } export interface PluginInstallRecord { pluginName: string; projectRoot: string; installedAt: number; uninstalledAt?: number; } //# sourceMappingURL=plugin.d.ts.map