/** * Core types for skillctl. * Defines shared interfaces used across manifest, lockfile, registry, etc. * Follows patterns from design doc (PR2). */ export interface SkillRef { name: string; version?: string; source: string; } export interface ResolvedSkill { name: string; canonicalPath: string; integrity: string; resolvedSource: string; fetchedAt: string; provenance?: Provenance; } export interface Provenance { type: 'github' | 'npm' | 'local' | 'skills.sh' | 'other'; commit?: string; requestedRef?: string; version?: string; tarballHash?: string; tarballUrl?: string; subpath?: string; migratedFrom?: 'npx' | 'python-skillctl' | 'project-scan'; originalHash?: string; originalSource?: string; originalPath?: string; adapter?: string; signature?: string; } export interface AgentAdapter { readonly id: string; readonly name: string; readonly projectPaths: string[]; readonly globalPaths: string[]; detect(): Promise; ensureTarget(skillName: string, targetPath: string, canonical: string, mode?: 'symlink' | 'copy' | 'junction', options?: { relative?: boolean; dryRun?: boolean; force?: boolean; }): Promise; removeTarget(skillName: string, targetPath: string, canonical?: string): Promise; } export interface RegistrySource { readonly id: string; match(spec: string): boolean; resolve(spec: string, options?: { ref?: string; cwd?: string; }): Promise; fetch(resolved: ResolvedSource, dest: string): Promise<{ integrity: string; }>; } export interface ResolvedSource { name: string; resolved: string; sourceType: 'github' | 'npm' | 'local' | 'skills.sh'; sourceId: string; originalSpec: string; tarballUrl?: string; tarballHash?: string; gitUrl?: string; ref?: string; requestedRef?: string; subpath?: string; skillSelector?: string; localPath?: string; } export interface CatalogSearchOptions { owner?: string; limit?: number; } export interface CatalogSearchResult { id: string; name: string; source: string; installs?: number; sourceType: string; installSpecifier: string; url?: string; stale?: boolean; } export interface CatalogProvider { readonly id: string; search(query: string, options?: CatalogSearchOptions): Promise; } export type UpdateStatus = 'current' | 'outdated' | 'modified' | 'legacy' | 'unavailable' | 'unsupported'; export type UpdateKind = 'none' | 'patch' | 'minor' | 'major' | 'commit' | 'content'; export interface UpdateCandidate { name: string; sourceType: string; specifier: string; currentResolved: string; candidateResolved?: string; currentVersion?: string; candidateVersion?: string; status: UpdateStatus; kind: UpdateKind; manifestChange?: { before: string; after: string; }; warning?: string; } export interface SkillManifest { name?: string; version?: string; agentSkills?: { dependencies?: Record; devDependencies?: Record; }; } export interface LockfileEntry { specifier: string; resolved: string; integrity: string; name: string; canonicalPath: string; fetchedAt: string; provenance: Provenance; } export interface SkillLockfile { lockfileVersion: '1.0'; agents?: string[]; skills: Record; metadata?: { migratedAt?: string; toolVersion?: string; }; } export interface SkillctlConfig { version: 1; store: string; defaultMode: 'symlink' | 'copy' | 'junction'; agents: Record; registries?: string[]; trustedSources?: string[]; experimental?: { plugins?: boolean; }; plugins?: Array<{ name: string; path: string; enabled: boolean; }>; security?: { trustedSourcesMode?: 'off' | 'warn' | 'error'; }; } export type LinkMode = 'symlink' | 'copy' | 'junction'; //# sourceMappingURL=types.d.ts.map