/** * Discovery Types * * Type definitions for the discovery module. */ import type { Agent } from "../agent/types.js"; import type { Prompt } from "../prompt/types.js"; import type { Resource } from "../resource/types.js"; import type { Skill } from "../skill/types.js"; import type { Tool } from "../tool/types.js"; import type { Workflow } from "../workflow/types.js"; import type { TaskDefinition } from "../task/types.js"; import type { EvalDefinition } from "../eval/types.js"; import type { ScheduleDefinition } from "../schedule/types.js"; import type { WebhookDefinition } from "../webhook/types.js"; import type { Platform } from "../platform/core-platform.js"; import type { FileSystemAdapter } from "../platform/adapters/base.js"; /** * Context for file discovery operations */ export interface FileDiscoveryContext { platform: Platform; fsAdapter?: FileSystemAdapter; /** Stable project or source-snapshot identity for transpiled module reuse. */ cacheNamespace?: string; nodeDeps?: { fs: typeof import("node:fs"); path: typeof import("node:path"); }; baseDir?: string; /** Explicit host-owned capability for trusted local/dedicated runtimes only. */ allowHostProjectCodeExecution?: boolean; } /** * Configuration for the discovery process */ export interface DiscoveryConfig { baseDir: string; /** Stable project or source-snapshot identity for transpiled module reuse. */ cacheNamespace?: string; toolDirs?: string[]; agentDirs?: string[]; skillDirs?: string[]; resourceDirs?: string[]; promptDirs?: string[]; workflowDirs?: string[]; taskDirs?: string[]; scheduleDirs?: string[]; webhookDirs?: string[]; evalDirs?: string[]; verbose?: boolean; fsAdapter?: FileSystemAdapter; /** Explicit host-owned capability required before executable modules are imported. */ allowHostProjectCodeExecution?: boolean; } /** * Result of the discovery process */ export interface DiscoveryResult { tools: Map; agents: Map; skills: Map; resources: Map; prompts: Map; workflows: Map; tasks: Map; schedules: Map; webhooks: Map; evals: Map; errors: Array<{ file: string; error: Error; }>; } /** * Handler for discovering specific item types */ export interface DiscoveryHandler { typeName: string; validate: (item: unknown) => item is Candidate; /** Validate and capture a candidate before it participates in ID fallback selection. */ prepare?: (item: Candidate) => Prepared; getId: (item: Candidate, file: string, dir: string) => string; register: (id: string, item: Candidate, file: string, dir: string, exportName?: string, prepared?: Prepared) => T; getResultMap: (result: DiscoveryResult) => Map; } //# sourceMappingURL=types.d.ts.map