/** * A single file or directory requirement declared in SKILL.md frontmatter. * * @docLink packages/resolver/concepts#file-requirements */ export interface FileRequirement { /** Relative path pattern (glob or literal) to check in the workspace. */ path: string; /** Hard gate blocks execution if missing; soft gate produces a warning only. */ gate: "hard" | "soft"; /** Human-readable description of why this file is needed. */ description: string; /** For directories: minimum number of files required recursively. */ min_entries?: number; } /** * Supported input field types in skill frontmatter. * * @docLink packages/resolver/concepts#input-fields */ export type InputFieldType = "text" | "textarea" | "select" | "multiselect" | "boolean" | "number"; /** * A user-input field declared in SKILL.md frontmatter. * Collected interactively by the CLI/UI and stored in input.json. * * @docLink packages/resolver/concepts#input-fields */ export interface InputField { /** Machine key used as the variable name in the skill prompt. */ id: string; /** Human-readable label shown in the UI. */ label: string; /** Input type selector. */ type: InputFieldType; /** When true, the skill cannot proceed without this value. */ required: boolean; /** Valid options for select/multiselect types. */ options?: string[]; /** Default value if the user does not provide one. */ default?: any; /** Helper text shown alongside the input field. */ hint?: string; /** Optional JSON Schema fragment for additional validation. */ schema?: Record; } /** * A file or directory that the skill reads but does not declare as a prerequisite gate. * Listed in the `READS` preamble block so the agent knows to locate these before starting. * * @docLink packages/resolver/concepts#read-sources */ export interface ReadSource { /** Relative path (from project root) to the file or directory the skill reads. */ path: string; /** Human-readable explanation of why the skill reads this resource. */ description: string; } /** * A file or directory that the skill will create or update. * Listed in the `WRITES` preamble block so the agent and orchestrator * know what this skill produces (used to satisfy downstream `FileRequirement` gates). * * @docLink packages/resolver/concepts#produces-entries */ export interface ProducesEntry { /** Relative path (from project root) of the file or directory this skill will write. */ path: string; /** Human-readable description of the produced artifact. */ description: string; } /** * A runtime resource (connector, mount, or external service) that the skill requires. * Declared under `metadata.prerequisites.resources[]` in SKILL.md frontmatter. * Actual availability is verified by the runner's `ResourceManager`; the resolver * only records the declaration in the report. * * @docLink packages/resolver/concepts#resource-requirements */ export interface ResourceRequirement { /** Resource ID that must be available. */ id: string; /** Specific operations the skill uses (all if omitted). */ operations?: string[]; /** Soft gate — warn but don't block. Default: false (hard gate). */ optional?: boolean; /** Human-readable description. */ description?: string; } /** * A connector driver a skill declares as required to function. * * @docLink packages/resolver/concepts#connector-requirements */ export interface ConnectorRequirement { /** Driver name that must be present in skaile.yaml connectors. */ driver: string; /** Minimum access level required. Default: "read-only". */ access?: "read-only" | "read-write"; } /** * All requirements parsed from a single SKILL.md frontmatter block. * Returned by `parseSkillRequirements()` and consumed by `validateRequirements()`. * * @docLink packages/resolver/concepts#skillrequirements-type */ export interface SkillRequirements { /** File and directory prerequisites with hard/soft gate semantics. */ files: FileRequirement[]; /** Input fields that must be supplied before the skill can run. */ inputs_required: InputField[]; /** Input fields that enhance skill output but are not blocking. */ inputs_optional: InputField[]; /** Files or directories the skill reads (informational, not gated). */ reads: ReadSource[]; /** Files or directories the skill will create or update. */ produces: ProducesEntry[]; /** Runtime resources (connectors, mounts) the skill depends on. */ resources: ResourceRequirement[]; /** Connector drivers the skill requires to be declared in skaile.yaml. */ connectors: ConnectorRequirement[]; } /** * Validation result for a single `FileRequirement`. * Produced by `validateRequirements()` for each declared file prerequisite. * * @docLink packages/resolver/concepts#validation-report */ export interface FileCheck { /** Relative path that was checked (mirrors `FileRequirement.path`). */ path: string; /** Gate severity — determines whether a failure blocks execution. */ gate: "hard" | "soft"; /** Whether the file or directory exists (and meets `min_entries` if set). */ exists: boolean; /** Human-readable description copied from the requirement declaration. */ description: string; /** Skill ID that declares this file as a `produces` output, if found in the active flow context. */ producedBy?: string; /** * Set when a `min_entries` count hit a walk bound (depth, entry cap, * wall-clock budget, symlink cycle, unreadable subtree) before reaching the * threshold. `exists: false` then means "could not be proven", not "too few * files" — a truncated count is never presented as a complete one. */ truncated?: boolean; } /** * Validation result for a single `InputField`. * Present for both required and optional inputs regardless of whether a value was found. * * @docLink packages/resolver/concepts#validation-report */ export interface InputCheck { /** Input field key, matching `InputField.id`. */ id: string; /** Whether the field was declared as required. */ required: boolean; /** Whether a value for this field exists in the skill's `input.json`. */ present: boolean; /** Full field declaration, available for rendering prompts or defaults. */ field: InputField; } /** * Validation result for a single `ReadSource`. * Always informational — read sources are never blocking. * * @docLink packages/resolver/concepts#validation-report */ export interface ReadCheck { /** Relative path that was checked (mirrors `ReadSource.path`). */ path: string; /** Whether the file or directory exists at validation time. */ exists: boolean; /** Human-readable description copied from the requirement declaration. */ description: string; } /** * Validation result for a single `ResourceRequirement`. * Availability is set to `true` by the resolver; actual availability * is determined at a higher level by the runner's `ResourceManager`. * * @docLink packages/resolver/concepts#validation-report */ export interface ResourceCheck { /** Resource ID (mirrors `ResourceRequirement.id`). */ id: string; /** Whether the resource is considered available (always `true` at resolver level). */ available: boolean; /** Operations declared as needed but not yet confirmed available. */ missingOps: string[]; /** Whether a missing resource is non-blocking (mirrors `ResourceRequirement.optional`). */ optional: boolean; } /** * Aggregate result returned by `validateRequirements()`. * The caller uses `satisfied` to decide whether to proceed with skill execution. * * @docLink packages/resolver/concepts#validation-report */ export interface RequirementsReport { /** Canonical skill identifier (matches the directory name in `ai-assets/`). */ skillId: string; /** True when all hard gates pass AND all required inputs/resources are present */ satisfied: boolean; /** Per-file check results, in declaration order. */ files: FileCheck[]; /** Per-input check results, required inputs first then optional. */ inputs: InputCheck[]; /** Per-read-source check results (informational). */ reads: ReadCheck[]; /** Per-resource check results. */ resources: ResourceCheck[]; } /** * Event emitted by the runner or CLI when input collection is needed before a skill can run. * Consumers (UI, CLI, agent) should prompt the user and respond with `InputResponseEvent`. * * @remarks * This is a scaffold type — the event streaming infrastructure is not yet implemented. * * @docLink packages/resolver/concepts#input-collection-events */ export interface InputRequestEvent { /** Discriminant identifying this as an input-collection request. */ type: "input_request"; /** Canonical ID of the skill that requires inputs. */ skillId: string; /** Flow node context (if running in flow) */ nodeId?: string; /** Ordered list of input fields the consumer must collect. */ fields: InputField[]; /** Target file path for collected inputs. */ writeTo: string; /** Timeout ms before skipping optional inputs. */ deadline?: number; } /** * Event emitted by the UI/CLI/agent after collecting skill inputs and writing `input.json`. * Consumed by the runner to confirm that inputs are available before proceeding. * * @remarks * This is a scaffold type — the event streaming infrastructure is not yet implemented. * * @docLink packages/resolver/concepts#input-collection-events */ export interface InputResponseEvent { /** Discriminant identifying this as a collected-inputs response. */ type: "input_response"; /** Canonical ID of the skill whose inputs were collected. */ skillId: string; /** Flow node context that originated the request, if applicable. */ nodeId?: string; /** Collected field values keyed by `InputField.id`. */ values: Record; /** Absolute or relative path of the file written by the consumer, echoing the writeTo field of the originating request. */ writtenTo: string; } /** * Shape of the input.json file written by UI/CLI/agent. * * @docLink packages/resolver/concepts#input-collection */ export interface SkillInputFile { /** Optional JSON Schema URI for editor tooling. */ $schema?: string; /** Canonical skill identifier that this input file belongs to. */ skill: string; /** ISO 8601 timestamp of when the inputs were collected. */ collected_at: string; /** Which surface collected the inputs — used for auditing and replay. */ collected_by: "cli" | "ui" | "agent"; /** Field values keyed by `InputField.id`. */ values: Record; } /** * Per-node overrides applied by the flow engine before requirement validation. * Allows prior nodes to signal that certain prerequisites are already satisfied, * preventing redundant filesystem checks for files they are guaranteed to produce. * * @docLink packages/resolver/concepts#flow-overrides */ export interface NodeOverrides { /** File paths to skip checking (guaranteed by prior nodes). */ skip_checks?: string[]; } //# sourceMappingURL=types.d.ts.map