/** * Skill type definitions * * Implements the Agent Skills metadata format. Veryfront intentionally uses a * documented, fail-closed subset of the experimental allowed-tools syntax. * Pure type/const file — no runtime dependencies. * * @module */ import type { FileSystemAdapter } from "../platform/adapters/base.js"; /** * Historical public skill-name inspection matcher. * Mutating this compatibility value does not alter framework admission. */ export declare const SKILL_NAME_REGEX: RegExp; /** * Strict filesystem skill-name matcher: 1-64 lowercase alphanumeric * characters or single hyphens, without leading or trailing hyphens. * Mutating this compatibility value does not alter framework admission. */ export declare const SKILL_STRICT_NAME_REGEX: RegExp; /** * Provider-safe owned skill-id inspection matcher, max 64 characters. * Mutating this compatibility value does not alter framework admission. */ export declare const SKILL_PROVIDER_SAFE_ID_REGEX: RegExp; /** Framework-owned historical skill-name grammar check. */ export declare function isValidSkillName(value: unknown): value is string; /** Framework-owned strict filesystem skill-name grammar check. */ export declare function isValidStrictSkillName(value: unknown): value is string; /** Framework-owned provider-safe owned skill-id grammar check. */ export declare function isValidProviderSafeSkillId(value: unknown): value is string; /** Whether an adapter-owned Skill root is a canonical relative path. */ export declare function isCanonicalAdapterRelativeSkillRoot(value: unknown): value is string; /** * Public inspection matcher for exact tool IDs and prefix wildcards. * Mutating this compatibility value does not alter authorization decisions. */ export declare const SKILL_ALLOWED_TOOL_PATTERN_REGEX: RegExp; /** Framework-owned allowed-tool grammar check. */ export declare function isValidSkillAllowedToolPattern(value: unknown): value is string; /** Maximum description length in characters */ export declare const SKILL_DESCRIPTION_MAX_LENGTH = 1024; /** Maximum compatibility declaration length from the Agent Skills specification. */ export declare const SKILL_COMPATIBILITY_MAX_LENGTH = 500; /** Framework resource budgets for optional skill metadata. */ export declare const SKILL_LICENSE_MAX_LENGTH = 256; export declare const SKILL_METADATA_MAX_ENTRIES = 64; export declare const SKILL_METADATA_KEY_MAX_LENGTH = 128; export declare const SKILL_METADATA_VALUE_MAX_LENGTH = 2048; /** Standard SKILL.md filename per agentskills.io spec */ export declare const SKILL_MD_FILENAME = "SKILL.md"; /** * Public snapshot of tool IDs that belong to the skill system. * * Mutating this compatibility value does not alter framework authorization * policy. Use it only for inspection. */ export declare const SKILL_TOOL_IDS: Set; /** Framework-owned membership check that cannot be changed by public Set mutation. */ export declare function isSkillInfrastructureToolId(toolId: string): boolean; /** Conventional subdirectory names */ export declare const SKILL_SCRIPTS_DIR = "scripts"; export declare const SKILL_REFERENCES_DIR = "references"; export declare const SKILL_RESOURCES_DIR = "resources"; export declare const SKILL_ASSETS_DIR = "assets"; /** Canonical read-only skill directories exposed through reference loading. */ export declare const SKILL_READABLE_DIRS: readonly ["references", "resources", "assets"]; /** Parsed frontmatter metadata from SKILL.md */ export interface SkillMetadata { /** Skill identifier (lowercase, hyphenated) */ name: string; /** Optional human-readable label; never used for skill lookup/reference. */ displayName?: string; /** Human-readable description */ description: string; /** Tool access restrictions (space-delimited in YAML, parsed to array) */ allowedTools?: string[]; /** SPDX license identifier */ license?: string; /** Compatibility constraints */ compatibility?: string; /** Arbitrary key-value metadata */ metadata?: Record; } /** Full skill content returned by load_skill tool */ export interface SkillContent { /** Loaded skill identifier */ skillId: string; /** Markdown instructions (body after frontmatter) */ instructions: string; /** Tool access restrictions from frontmatter */ /** Available reference file paths */ references: string[]; /** Available script file paths */ scripts: string[]; } /** Registered skill instance */ export interface Skill { /** Unique skill ID (matches directory name) */ id: string; /** Parsed frontmatter metadata */ metadata: SkillMetadata; /** Absolute path to the skill directory */ rootPath: string; /** Optional filesystem adapter for VFS/cloud-backed projects */ fsAdapter?: FileSystemAdapter; /** * Owning agent id for agent-scoped skills. Unowned (undefined) skills are * project-global. Owned skills are invisible to other agents in selector * resolution and skill tools. */ ownerAgentId?: string; /** Short name used by the owning agent's `skills:` selector (e.g. "cite"). */ shortName?: string; } /** * Result from executing a skill script. * * Executor implementations return a structural object with these three own, * enumerable data properties. Skill tools snapshot only the documented * fields, detach and freeze them, and enforce their combined stdout/stderr * byte budget before returning the result. Additional structural fields and * the source object's prototype are not retained. */ export interface SkillScriptResult { stdout: string; stderr: string; exitCode: number; } /** One validated text file retained in an executable skill-script snapshot. */ export interface SkillScriptSnapshotFile { /** Canonical path relative to the skill root, beginning with `scripts/`. */ readonly path: string; /** Exact validated UTF-8 content materialized for execution. */ readonly content: string; } /** * Bounded, validated script tree used to preserve same-directory imports. * * Executors materialize this tree under a private root and execute * `entryPath`; they never resolve missing files against the host project. */ export interface SkillScriptSnapshot { /** Canonical entry path relative to the skill root. */ readonly entryPath: string; /** Validated files, including exactly one file matching `entryPath`. */ readonly files: readonly SkillScriptSnapshotFile[]; } /** Input for the script executor */ export interface SkillScriptExecutorInput { scriptPath: string; /** * Already-validated script content. When omitted with * `validatedSourceRoot`, the executor bounded-reads the contained script and * binds that decoded content to the same filesystem identity. Local * execution runs a private temporary materialization of this exact content; * cloud execution uploads the same validated snapshot. */ scriptContent?: string; /** * Optional bounded script tree. Framework tools provide this snapshot so * sibling module imports resolve from the same private materialization. * `scriptContent` remains populated for compatibility with custom executors. */ scriptSnapshot?: SkillScriptSnapshot; args?: string[]; /** Passed as structured environment data, never embedded in a shell command. */ env?: Record; /** * Local execution working directory. Supplied content without an explicit * working directory runs inside its private materialization directory. Cloud * execution maps this intent to a fresh remote directory containing only the * selected uploaded script. */ cwd?: string; /** * Canonical source-containment root supplied after framework path validation. * Local execution uses it for strict resource limits and final containment, * content, and filesystem-identity checks before executing a private snapshot. * Cloud execution applies the same containment and identity checks before * reading omitted `scriptContent`. Omit it for generic executor calls that do * not carry that validation contract. */ validatedSourceRoot?: string; timeoutMs?: number; /** Cooperative cancellation shared with the outer skill operation budget. */ abortSignal?: AbortSignal; } /** * Script executor interface. * * Implementations honor `timeoutMs` and cooperative `abortSignal` settlement, * and return a `SkillScriptResult` that satisfies the boundary contract above. */ export interface SkillScriptExecutor { execute(input: SkillScriptExecutorInput): Promise; } /** Active skill context for runtime availability and delegation tracking */ export interface ActiveSkillContext { skillId: string; } //# sourceMappingURL=types.d.ts.map