/** * Pure data models — no I/O, no side effects. */ /** * Discriminator for catalog entries and asset references. * Used in asset ref strings (e.g. `'skill:my-skill'`, `'agent:my-agent'`). * @docLink packages/core/concepts#asset-kind */ export type AssetKind = "skill" | "agent" | "prompt" | "bundle" | "flow" | "contract" | "mcp-server" | "persona" | "ruleset" | "knowledge" | "connector"; /** * All valid AssetKind values as a readonly array. * @docLink packages/core/concepts#asset-kinds */ export declare const ASSET_KINDS: readonly AssetKind[]; /** * Asset kinds that represent individually installable assets (excludes "bundle"). * Note: persona, ruleset, and knowledge are valid AssetKind values but are not * individually installable — they are resolved at session creation time via the * mixin-resolver, not through the install/deploy pipeline. * @docLink packages/core/concepts#individual-kinds */ export declare const INDIVIDUAL_KINDS: ["skill", "agent", "prompt", "flow", "contract", "mcp-server"]; /** * Declared dependency on another catalog asset. * @docLink packages/core/concepts#dependency */ export interface Dependency { /** Asset kind (e.g. "skill", "agent", "contract"). */ kind: string; /** Asset name within that kind. */ name: string; /** Canonical publisher namespace (when known). */ publisher?: string; } /** * Parse a `"kind:name"` dependency string, or a bare `"name"` (defaults kind to `"skill"`). * * @param s - Dependency string, e.g. `"skill:use-exa"` or `"use-exa"` * @returns Parsed `{ kind, name }` dependency object * @docLink packages/core/concepts#parse-dep */ export declare function parseDep(s: string): Dependency; /** * Serialize a Dependency back to its `"kind:name"` string form. * * @param d - Dependency to serialize * @returns String in `"kind:name"` format * @docLink packages/core/concepts#dep-to-str */ export declare function depToStr(d: Dependency): string; /** * A resolved catalog entry describing an installable asset. * Produced by manifest parsers and stored in the catalog YAML. * @docLink packages/core/concepts#catalog-entry */ export interface CatalogEntry { /** Unique asset name within its kind. */ name: string; /** Asset kind discriminator. */ kind: AssetKind; /** Short description of what this asset does. */ description: string; /** Absolute path to manifest file */ source: string; /** Canonical publisher namespace this asset belongs to (formerly `repository`). */ publisher?: string; /** * `"/"` coordinate the asset came from. Absent → the asset groups * directly under its publisher (local library with no git remote, or a * non-GitHub source). Replaces the former derived `domain` axis. */ repo?: string; /** * Navigational domain slug (from a sidecar `DOMAIN.md`), or absent when no * domain claims this asset. Display-only — groups assets under their publisher * in the manage TUI; never part of identity or the install layout. */ domainSlug?: string; /** Semantic version string (may be empty if not declared in the manifest). */ version: string; /** Skills, agents, or other assets this entry depends on. */ requires: Dependency[]; /** Bundle dependencies — asset refs to install (bundles only). */ dependencies: string[]; /** * Kind-specific metadata extracted from the manifest frontmatter. * Used by MCP servers to carry default config (transport, command, args, env, url, headers) * so that `mcp:name` dependency refs resolve to a runnable declaration without * requiring verbose inline config in `skaile.yaml`. */ metadata?: Record; /** Curated facet, surfaced as a badge in the manage TUI (not a tree axis). */ category?: string; /** Store-listing keywords (manifest `assets[].keywords`, else frontmatter). */ keywords?: string[]; /** Store-listing license (manifest `assets[].license`, else repo-level default). */ license?: string; /** Store-listing homepage (manifest `assets[].homepage`, else repo-level default). */ homepage?: string; } /** * How the members of a domain relate — drives display affordances only, never * install behaviour. Single canonical spelling shared with the store * (`DomainRelation` enum) and forge contract. */ export type DomainRelation = "additions" | "alternatives" | "sequence"; /** * Display-only metadata for a navigational domain (from a sidecar `DOMAIN.md`, * surfaced by the store's `catalog.listDomains`). Keyed by {@link CatalogEntry.domainSlug}. * A domain groups assets under their publisher for co-discovery; it is never * part of asset identity and never bulk-installs. */ export interface CatalogDomain { /** Stable slug — the join key to {@link CatalogEntry.domainSlug}. */ slug: string; /** Human-readable title (may change without breaking the slug join). */ title: string; /** Free-text description from the `DOMAIN.md` body. */ description?: string; /** How members relate — drives sort + per-asset glyph, not installs. */ relation?: DomainRelation; /** Display order among a publisher's domains (ascending). */ order?: number; /** `kind:name` ref of the recommended member (alternatives domains). */ recommendedRef?: string; /** Sidecar provenance — `"/"` the `DOMAIN.md` was authored in. */ sidecarSource?: string; } /** * Construct a CatalogEntry from a raw deserialized record (e.g. from catalog.yaml). * * @param d - Raw object with loosely typed fields * @returns Normalized CatalogEntry * @docLink packages/core/concepts#entry-from-raw */ export declare function entryFromRaw(d: Record): CatalogEntry; /** * Serialize a CatalogEntry to a plain record suitable for YAML/JSON persistence. * * @param e - CatalogEntry to serialize * @returns Plain object with string-serialized requires and dependencies * @docLink packages/core/concepts#entry-to-raw */ export declare function entryToRaw(e: CatalogEntry): Record; /** * A parsed asset reference: `kind:@/name[#pin]`. * * `publisher` is the canonical, GitHub-shaped publisher namespace (≤39 chars, * alphanumeric+hyphen). `pin` is a SemVer constraint, exact SHA, or absent. * Floating refs (`main`, `latest`, `HEAD`) are rejected at parse time. * * Produced by `parseAssetRef`; consumed by `resolveAsset` and `resolveAll`. * @docLink packages/core/concepts#asset-ref */ export interface AssetRef { kind: string; name: string; /** Canonical publisher namespace. Optional only for ambiguity-resolution * during migration; new manifests require it. */ publisher?: string; /** SemVer constraint (^1.4.0, ~1.4, 1.x, exact 1.4.0), 40-char SHA, or undefined. */ pin?: string; } /** Human-readable statement of the canonical asset-name rule. */ export declare const ASSET_NAME_HINT = "names must be lowercase kebab-case (a-z, 0-9, single hyphens; e.g. \"cli-concept\")"; /** * True when `name` is a canonical asset name: lowercase kebab-case, scope-free. * * This is the single source of truth for asset-name validity — `parseAssetRef` * enforces it, and `skaile validate` reports violations across a repo tree. * @docLink packages/core/concepts#is-valid-asset-name */ export declare function isValidAssetName(name: string): boolean; /** * Coerce an arbitrary string into a canonical asset name (lowercase kebab-case). * * For **third-party sources we don't control**, an upstream asset may carry a * human-styled identity (`"Complex App"`, `"CLI_Concept"`). The canonical grammar * (`isValidAssetName`) rejects those, so the ingestion boundary slugifies them to * a valid identity rather than crashing: Unicode is folded to ASCII, the result is * lowercased, every run of non-`[a-z0-9]` becomes a single hyphen, and * leading/trailing hyphens are trimmed. The transform is idempotent and a no-op on * already-canonical names. * * This is intentionally **lossy** — the pretty original is not part of identity. * Callers that want to preserve it for display must stash it themselves (e.g. on * `CatalogEntry.metadata.displayName`). Authoring-time validation (`skaile validate`) * still uses `isValidAssetName` on raw frontmatter, so first-party typos surface there. * * @throws When `raw` contains no `[a-z0-9]` character (nothing to slugify). * @docLink packages/core/concepts#slugify-asset-name */ export declare function slugifyAssetName(raw: string): string; /** * Parse a canonical asset reference string into an `AssetRef` object. * * Grammar: `kind:@/name[#version]` * "skill:@skaile-ai/audit" → { kind: "skill", name: "audit", publisher: "skaile-ai" } * "skill:@skaile-ai/audit#^1.4.0" → { …, pin: "^1.4.0" } * "skill:@skaile-ai/audit#<40-sha>" → { …, pin: "<40-sha>" } * * `@` is the scope sigil and `#` the version sigil. `` is GitHub-shaped * (≤39 chars, alphanumeric+hyphen, no leading/trailing or double hyphen). `pin` * accepts a SemVer constraint (`^`, `~`, `x`, exact), a 40-char SHA, or is absent. * Floating refs (`main`/`latest`/`HEAD`/anything non-canonical) are parse-time errors. * * The shorthand `mcp:` is normalized to `mcp-server:`. `kind` defaults to `"skill"`. * * @param s - Asset reference string * @returns Parsed `AssetRef` * @throws When the ref matches no grammar, the publisher is malformed, or the pin * is a floating ref. * @docLink packages/core/concepts#parse-asset-ref */ export declare function parseAssetRef(s: string): AssetRef; /** * Serialize an AssetRef back to its canonical string form. * * Emits the scope form `kind:@publisher/name[#pin]` when `publisher` is present, * and the bare `kind:name[#pin]` form for transitive refs that inherit it. * * @param ref - AssetRef to serialize * @returns String in `"kind:@publisher/name[#pin]"` (or bare `"kind:name[#pin]"`) format * @docLink packages/core/concepts#asset-ref-to-str */ export declare function assetRefToStr(ref: AssetRef): string; /** * Convert an AssetRef to a simple Dependency, dropping the repository and pin qualifiers. * * @param ref - Full asset reference (may include repository and pin) * @returns Dependency with only kind and name * @docLink packages/core/concepts#asset-ref-to-dep */ export declare function assetRefToDep(ref: AssetRef): Dependency; /** A path/sha256 pair recorded for one file inside a locked asset. */ export interface LockFileEntry { path: string; sha256: string; } /** * Per-asset entry in the lock file (v3 schema). * Keyed in `LockFile.assets` by canonical ref (`:@/#`). * @docLink packages/core/api-reference#lock-entry */ export interface LockEntry { /** Composite sha256 over sorted `:\n` rows. */ sha256: string; /** Resolved upstream source + commit. */ source: { url: string; commit: string; }; /** Files that constitute the asset. */ files: LockFileEntry[]; /** True when an `overrides[]` entry pinned this resolution. */ override_applied: boolean; } /** Per-source-URL entry in `LockFile.sources`. */ export interface LockSourceEntry { url: string; commit: string; } /** * Full skaile.lock.yaml structure (v3 schema). * @docLink packages/core/api-reference#lock-file */ export interface LockFile { /** Lock file schema version. v3 is canonical. */ schema_version: 3; /** ISO timestamp of when the lock was generated. */ locked_at: string; /** Resolved assets keyed by canonical ref `:@/#`. */ assets: Record; /** Every source URL that contributed at least one resolved asset. */ sources: LockSourceEntry[]; /** * Resolved plugin packages (from `skaile.yaml` `plugins:`), keyed by package * name. The plugin-store reconciler reads this slice into its reconcile-hash * so a lock change reinstalls even when the manifest list is unchanged. */ plugins?: Record; } /** One pinned plugin package in the lock file's `plugins` slice. */ export interface LockPluginEntry { /** Resolved exact version (e.g. "0.1.3"). */ version: string; /** Package integrity hash (e.g. "sha512-..."); may be empty until populated from bun's output. */ integrity: string; } /** * Agent package manifest — parsed from `agent.yaml` in an agent directory. * Defines the agent's identity, model preferences, capability requirements, and composition mixins. * @docLink packages/core/concepts#agent-manifest */ export interface AgentManifest { spec_version?: string; name?: string; version?: string; description?: string; model?: { preferred?: string; fallback?: string[]; constraints?: { temperature?: number; max_tokens?: number; }; }; tools?: { allowed?: string[]; denied?: string[]; }; delegation?: { mode?: string; }; requires?: Array<{ name: string; source: string; version?: string; mount: string; }>; tags?: string[]; author?: string; metadata?: Record; /** * @deprecated Use `persona`, `rules`, and `knowledge` mixin arrays instead. * This field is declared but was never resolved at runtime. */ extends?: string; abilities?: string[]; /** * Identity fragments to compose into the agent persona. * Each entry is a catalog ref (`persona:name@repo#pin`), a bare name * (defaults to kind "persona"), or a local path (`./my.persona.md`). * Resolved in order — concatenated with \n\n---\n\n separator. */ persona?: string[]; /** * Behavioral rule sets to compose into the agent's constraints. * Each entry is a catalog ref (`ruleset:name@repo#pin`), bare name, * or local path. All rules apply (union). */ rules?: string[]; /** * Knowledge bundles to compose into the agent's domain knowledge. * Each entry is a catalog ref (`knowledge:name@repo#pin`), bare name, * or local path to a knowledge directory. Loaded in declaration order. */ knowledge?: string[]; contracts?: string[]; /** * v2 composition items. Each entry references an asset (skill, connector, * soul, ruleset, etc.) with binding semantics (discoverable, inline-live, * inline-snapshot). Resolved at session start via the composition module. */ composes?: Array<{ kind: string; ref: string; instance?: string; binding?: "discoverable" | "inline-live" | "inline-snapshot"; }>; runtime?: { max_turns?: number; timeout?: number; [key: string]: unknown; }; } type RepositoryKind = "local" | "github"; /** * A registered asset repository (local path or cloned GitHub repo). * Stored in the catalog; consumed by `repo-manager` for cloning and scanning. * @docLink packages/core/concepts#repository */ export interface Repository { /** Logical repository name. */ name: string; /** Storage kind: "local" for paths, "github" for remote URLs. */ kind: RepositoryKind; /** Absolute path (local) or remote URL (github). */ path: string; /** Active branch. */ branch: string; /** Upstream fork URL (for fork-based workflows). */ upstream?: string; } /** * Construct a `Repository` from a raw deserialized record. * * @param d - Raw object from YAML/JSON * @returns Normalized `Repository` * @docLink packages/core/concepts#repository-from-raw */ export declare function repositoryFromRaw(d: Record): Repository; /** * Serialize a `Repository` to a plain record for YAML/JSON persistence. * Omits the `branch` field when it equals `"main"` to keep serialized output clean. * * @param r - Repository to serialize * @returns Plain object suitable for YAML/JSON * @docLink packages/core/concepts#repository-to-raw */ export declare function repositoryToRaw(r: Repository): Record; export {}; //# sourceMappingURL=models.d.ts.map