@skillkit/core 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -161,6 +161,9 @@ declare const SkillkitConfig: z.ZodObject<{
161
161
  enabledSkills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
162
162
  disabledSkills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
163
  autoSync: z.ZodDefault<z.ZodBoolean>;
164
+ cacheDir: z.ZodOptional<z.ZodString>;
165
+ marketplaceSources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
166
+ defaultTimeout: z.ZodOptional<z.ZodNumber>;
164
167
  }, "strip", z.ZodTypeAny, {
165
168
  version: 1;
166
169
  agent: "claude-code" | "codex" | "cursor" | "antigravity" | "opencode" | "gemini-cli" | "amp" | "clawdbot" | "droid" | "github-copilot" | "goose" | "kilo" | "kiro-cli" | "roo" | "trae" | "windsurf" | "universal";
@@ -168,6 +171,9 @@ declare const SkillkitConfig: z.ZodObject<{
168
171
  skillsDir?: string | undefined;
169
172
  enabledSkills?: string[] | undefined;
170
173
  disabledSkills?: string[] | undefined;
174
+ cacheDir?: string | undefined;
175
+ marketplaceSources?: string[] | undefined;
176
+ defaultTimeout?: number | undefined;
171
177
  }, {
172
178
  version: 1;
173
179
  agent?: "claude-code" | "codex" | "cursor" | "antigravity" | "opencode" | "gemini-cli" | "amp" | "clawdbot" | "droid" | "github-copilot" | "goose" | "kilo" | "kiro-cli" | "roo" | "trae" | "windsurf" | "universal" | undefined;
@@ -175,6 +181,9 @@ declare const SkillkitConfig: z.ZodObject<{
175
181
  enabledSkills?: string[] | undefined;
176
182
  disabledSkills?: string[] | undefined;
177
183
  autoSync?: boolean | undefined;
184
+ cacheDir?: string | undefined;
185
+ marketplaceSources?: string[] | undefined;
186
+ defaultTimeout?: number | undefined;
178
187
  }>;
179
188
  type SkillkitConfig = z.infer<typeof SkillkitConfig>;
180
189
  interface InstallOptions {
@@ -247,7 +256,7 @@ declare function isPathInside(child: string, parent: string): boolean;
247
256
 
248
257
  declare function getProjectConfigPath(): string;
249
258
  declare function getGlobalConfigPath(): string;
250
- declare function loadConfig(): SkillkitConfig;
259
+ declare function loadConfig(global?: boolean): SkillkitConfig;
251
260
  declare function saveConfig(config: SkillkitConfig, global?: boolean): void;
252
261
  declare function getSearchDirs(adapter: AgentAdapterInfo): string[];
253
262
  declare function getInstallDir(adapter: AgentAdapterInfo, global?: boolean): string;
@@ -1952,6 +1961,126 @@ declare function syncToAllAgents(projectPath?: string, options?: ContextSyncOpti
1952
1961
  */
1953
1962
  declare function syncToAgent(agent: AgentType, projectPath?: string, options?: ContextSyncOptions): Promise<SyncResult>;
1954
1963
 
1964
+ /**
1965
+ * Context Loader
1966
+ *
1967
+ * Smart context loading with token budgets and category-based loading.
1968
+ */
1969
+ /**
1970
+ * Context category with size limits
1971
+ */
1972
+ interface ContextCategory {
1973
+ /** Category name */
1974
+ name: string;
1975
+ /** Maximum tokens for this category */
1976
+ maxTokens: number;
1977
+ /** Whether to always load this category */
1978
+ alwaysLoad: boolean;
1979
+ /** File path (relative to project) */
1980
+ file?: string;
1981
+ /** Inline content */
1982
+ content?: string;
1983
+ }
1984
+ /**
1985
+ * Context loading options
1986
+ */
1987
+ interface ContextLoadOptions {
1988
+ /** Total token budget */
1989
+ totalBudget?: number;
1990
+ /** Categories to load (load all if not specified) */
1991
+ categories?: string[];
1992
+ /** Whether to warn when approaching budget limits */
1993
+ warnOnBudgetLimit?: boolean;
1994
+ }
1995
+ /**
1996
+ * Loaded context result
1997
+ */
1998
+ interface LoadedContext {
1999
+ /** All loaded content combined */
2000
+ content: string;
2001
+ /** Total tokens used */
2002
+ totalTokens: number;
2003
+ /** Budget remaining */
2004
+ budgetRemaining: number;
2005
+ /** Categories loaded */
2006
+ categoriesLoaded: string[];
2007
+ /** Categories skipped (due to budget or not found) */
2008
+ categoriesSkipped: string[];
2009
+ /** Warnings generated */
2010
+ warnings: string[];
2011
+ /** Whether budget is near limit (>50% used) */
2012
+ nearBudgetLimit: boolean;
2013
+ /** Whether context is degraded (>70% used) */
2014
+ contextDegraded: boolean;
2015
+ }
2016
+ /**
2017
+ * Default context categories
2018
+ */
2019
+ declare const DEFAULT_CONTEXT_CATEGORIES: ContextCategory[];
2020
+ /**
2021
+ * Rough estimate of tokens from text
2022
+ * (approximation: ~4 characters per token for English text)
2023
+ */
2024
+ declare function estimateTokens(text: string): number;
2025
+ /**
2026
+ * Context Loader class
2027
+ */
2028
+ declare class ContextLoader {
2029
+ private projectPath;
2030
+ private categories;
2031
+ private defaultBudget;
2032
+ constructor(projectPath: string, options?: {
2033
+ categories?: ContextCategory[];
2034
+ defaultBudget?: number;
2035
+ });
2036
+ /**
2037
+ * Load context based on options
2038
+ */
2039
+ load(options?: ContextLoadOptions): LoadedContext;
2040
+ /**
2041
+ * Load a single category
2042
+ */
2043
+ private loadCategory;
2044
+ /**
2045
+ * Get category by name
2046
+ */
2047
+ getCategory(name: string): ContextCategory | undefined;
2048
+ /**
2049
+ * Add a custom category
2050
+ */
2051
+ addCategory(category: ContextCategory): void;
2052
+ /**
2053
+ * Remove a category
2054
+ */
2055
+ removeCategory(name: string): void;
2056
+ /**
2057
+ * Get estimated context size for categories
2058
+ */
2059
+ estimateSize(categoryNames?: string[]): {
2060
+ category: string;
2061
+ tokens: number;
2062
+ available: boolean;
2063
+ }[];
2064
+ /**
2065
+ * Check if context would exceed budget threshold
2066
+ */
2067
+ wouldExceedThreshold(additionalTokens: number, threshold?: number): boolean;
2068
+ /**
2069
+ * Suggest spawning fresh agent if context is degraded
2070
+ */
2071
+ shouldSpawnFreshAgent(): {
2072
+ should: boolean;
2073
+ reason?: string;
2074
+ };
2075
+ }
2076
+ /**
2077
+ * Create a context loader
2078
+ */
2079
+ declare function createContextLoader(projectPath: string, options?: {
2080
+ categories?: ContextCategory[];
2081
+ defaultBudget?: number;
2082
+ }): ContextLoader;
2083
+
1955
2084
  /**
1956
2085
  * Skill summary for recommendation matching
1957
2086
  */
@@ -2231,4 +2360,2636 @@ declare class RecommendationEngine {
2231
2360
  */
2232
2361
  declare function createRecommendationEngine(weights?: Partial<ScoringWeights>): RecommendationEngine;
2233
2362
 
2234
- export { AGENT_FORMAT_MAP, type AgentAdapterInfo, AgentConfig, AgentType, BitbucketProvider, CONTEXT_DIR, CONTEXT_FILE, type CanonicalSkill, type CloneOptions, type CloneResult, type CommandResult, type ContextExportOptions, type ContextImportOptions, ContextManager, ContextSync, type ContextSyncOptions, CopilotTranslator, CursorTranslator, DEFAULT_SCORING_WEIGHTS, DependencyInfo, Detection, type DetectionSource, type DiscoveredSkill, type FormatCategory, type FormatTranslator, type FreshnessResult, GitHubProvider, GitLabProvider, GitProvider, type GitProviderAdapter, type IndexSource, type InstallOptions, LocalProvider, type MatchCategory, type MatchReason, PROJECT_TYPE_HINTS, ProjectContext, ProjectDetector, ProjectPatterns, type ProjectProfile, ProjectStack, type RecommendOptions, RecommendationEngine, type RecommendationResult, type RegistrySkill, SKILL_DISCOVERY_PATHS, type ScoredSkill, type ScoringWeights, type SearchOptions, type SearchResult, Skill, SkillFrontmatter, type SkillIndex, SkillLocation, SkillMdTranslator, SkillMetadata, SkillPreferences, SkillSummary, SkillkitConfig, type SyncOptions, type SyncReport, type SyncResult, TAG_TO_TECH, TranslatableSkillFrontmatter, type TranslationOptions, type TranslationPath, type TranslationResult, TranslatorRegistry, type UpdateOptions, WindsurfTranslator, analyzeProject, canTranslate, copilotTranslator, createContextManager, createContextSync, createRecommendationEngine, cursorTranslator, detectProvider, detectSkillFormat, discoverSkills, extractField, extractFrontmatter, findAllSkills, findSkill, getAgentConfigPath, getAllProviders, getGlobalConfigPath, getInstallDir, getProjectConfigPath, getProvider, getSearchDirs, getStackTags, getSupportedTranslationAgents, getTechTags, initContext, initProject, isGitUrl, isLocalPath, isPathInside, loadConfig, loadContext, loadMetadata, loadSkillMetadata, parseShorthand, parseSkill, parseSkillContent, parseSource, readSkillContent, saveConfig, saveSkillMetadata, setSkillEnabled, skillMdTranslator, syncToAgent, syncToAllAgents, translateSkill, translateSkillFile, translatorRegistry, validateSkill, windsurfTranslator };
2363
+ /**
2364
+ * Known skill repositories to index
2365
+ */
2366
+ declare const KNOWN_SKILL_REPOS: readonly [{
2367
+ readonly owner: "anthropics";
2368
+ readonly repo: "courses";
2369
+ readonly description: "Anthropic official courses and skills";
2370
+ }, {
2371
+ readonly owner: "vercel-labs";
2372
+ readonly repo: "ai-sdk-preview-internal-knowledge-base";
2373
+ readonly description: "Vercel AI SDK skills";
2374
+ }, {
2375
+ readonly owner: "composioHQ";
2376
+ readonly repo: "awesome-claude-code-skills";
2377
+ readonly description: "Curated Claude Code skills";
2378
+ }];
2379
+ /**
2380
+ * Index file path
2381
+ */
2382
+ declare const INDEX_PATH: string;
2383
+ declare const INDEX_CACHE_HOURS = 24;
2384
+ /**
2385
+ * Fetch skills from a GitHub repository
2386
+ */
2387
+ declare function fetchSkillsFromRepo(owner: string, repo: string): Promise<{
2388
+ skills: SkillSummary[];
2389
+ error?: string;
2390
+ }>;
2391
+ /**
2392
+ * Fetch skills from all known repositories and build index
2393
+ */
2394
+ declare function buildSkillIndex(repos?: typeof KNOWN_SKILL_REPOS, onProgress?: (message: string) => void): Promise<{
2395
+ index: SkillIndex;
2396
+ errors: string[];
2397
+ }>;
2398
+ /**
2399
+ * Save skill index to cache
2400
+ */
2401
+ declare function saveIndex(index: SkillIndex): void;
2402
+ /**
2403
+ * Load skill index from cache
2404
+ */
2405
+ declare function loadIndex(): SkillIndex | null;
2406
+ /**
2407
+ * Check if index is stale
2408
+ */
2409
+ declare function isIndexStale(index: SkillIndex): boolean;
2410
+ /**
2411
+ * Get index status
2412
+ */
2413
+ declare function getIndexStatus(): 'missing' | 'stale' | 'fresh';
2414
+
2415
+ /**
2416
+ * Session State Types
2417
+ *
2418
+ * Types for managing skill execution sessions with pause/resume support.
2419
+ */
2420
+ /**
2421
+ * Status of a task in execution
2422
+ */
2423
+ type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'paused';
2424
+ /**
2425
+ * A single task within a skill execution
2426
+ */
2427
+ interface SessionTask {
2428
+ /** Task identifier */
2429
+ id: string;
2430
+ /** Task name/description */
2431
+ name: string;
2432
+ /** Task type (auto, checkpoint:human-verify, checkpoint:decision, checkpoint:human-action) */
2433
+ type: 'auto' | 'checkpoint:human-verify' | 'checkpoint:decision' | 'checkpoint:human-action';
2434
+ /** Current status */
2435
+ status: TaskStatus;
2436
+ /** Start time */
2437
+ startedAt?: string;
2438
+ /** Completion time */
2439
+ completedAt?: string;
2440
+ /** Error message if failed */
2441
+ error?: string;
2442
+ /** Output/result of the task */
2443
+ output?: string;
2444
+ /** Files modified by this task */
2445
+ filesModified?: string[];
2446
+ /** Git commit SHA if committed */
2447
+ commitSha?: string;
2448
+ }
2449
+ /**
2450
+ * Current skill execution state
2451
+ */
2452
+ interface CurrentExecution {
2453
+ /** Skill being executed */
2454
+ skillName: string;
2455
+ /** Skill source (repo) */
2456
+ skillSource: string;
2457
+ /** Current step/task index */
2458
+ currentStep: number;
2459
+ /** Total steps */
2460
+ totalSteps: number;
2461
+ /** Execution status */
2462
+ status: 'running' | 'paused' | 'completed' | 'failed';
2463
+ /** When execution started */
2464
+ startedAt: string;
2465
+ /** When execution was paused (if paused) */
2466
+ pausedAt?: string;
2467
+ /** Tasks in this execution */
2468
+ tasks: SessionTask[];
2469
+ }
2470
+ /**
2471
+ * Historical execution record
2472
+ */
2473
+ interface ExecutionHistory {
2474
+ /** Skill name */
2475
+ skillName: string;
2476
+ /** Skill source */
2477
+ skillSource: string;
2478
+ /** When execution completed */
2479
+ completedAt: string;
2480
+ /** Duration in milliseconds */
2481
+ durationMs: number;
2482
+ /** Final status */
2483
+ status: 'completed' | 'failed' | 'cancelled';
2484
+ /** Git commits created */
2485
+ commits: string[];
2486
+ /** Files modified */
2487
+ filesModified: string[];
2488
+ /** Error if failed */
2489
+ error?: string;
2490
+ }
2491
+ /**
2492
+ * User decisions made during skill execution
2493
+ */
2494
+ interface SessionDecision {
2495
+ /** Decision key/identifier */
2496
+ key: string;
2497
+ /** Decision value */
2498
+ value: string;
2499
+ /** When decision was made */
2500
+ madeAt: string;
2501
+ /** Skill that prompted the decision */
2502
+ skillName?: string;
2503
+ }
2504
+ /**
2505
+ * Full session state
2506
+ */
2507
+ interface SessionState {
2508
+ /** Schema version */
2509
+ version: 1;
2510
+ /** Last activity timestamp */
2511
+ lastActivity: string;
2512
+ /** Project path this session is for */
2513
+ projectPath: string;
2514
+ /** Current execution (if any) */
2515
+ currentExecution?: CurrentExecution;
2516
+ /** Execution history */
2517
+ history: ExecutionHistory[];
2518
+ /** User decisions */
2519
+ decisions: SessionDecision[];
2520
+ }
2521
+ /**
2522
+ * Session state file path within .skillkit directory
2523
+ */
2524
+ declare const SESSION_FILE = "session.yaml";
2525
+
2526
+ /**
2527
+ * Session Manager
2528
+ *
2529
+ * Manages session state for skill execution with pause/resume support.
2530
+ */
2531
+
2532
+ /**
2533
+ * Session Manager for tracking skill execution state
2534
+ */
2535
+ declare class SessionManager {
2536
+ private projectPath;
2537
+ private sessionPath;
2538
+ private state;
2539
+ constructor(projectPath: string);
2540
+ /**
2541
+ * Get session file path
2542
+ */
2543
+ getSessionPath(): string;
2544
+ /**
2545
+ * Load session state from disk
2546
+ */
2547
+ load(): SessionState | null;
2548
+ /**
2549
+ * Save session state to disk
2550
+ */
2551
+ save(): void;
2552
+ /**
2553
+ * Initialize a new session
2554
+ */
2555
+ init(): SessionState;
2556
+ /**
2557
+ * Get current session state (load if needed)
2558
+ */
2559
+ get(): SessionState | null;
2560
+ /**
2561
+ * Get or create session
2562
+ */
2563
+ getOrCreate(): SessionState;
2564
+ /**
2565
+ * Start a new skill execution
2566
+ */
2567
+ startExecution(skillName: string, skillSource: string, tasks: Omit<SessionTask, 'status'>[]): CurrentExecution;
2568
+ /**
2569
+ * Update task status
2570
+ */
2571
+ updateTask(taskId: string, updates: Partial<Pick<SessionTask, 'status' | 'output' | 'error' | 'filesModified' | 'commitSha'>>): void;
2572
+ /**
2573
+ * Advance to next task
2574
+ */
2575
+ advanceToNextTask(): SessionTask | null;
2576
+ /**
2577
+ * Pause current execution
2578
+ */
2579
+ pause(): boolean;
2580
+ /**
2581
+ * Resume paused execution
2582
+ */
2583
+ resume(): boolean;
2584
+ /**
2585
+ * Complete current execution
2586
+ */
2587
+ completeExecution(status: 'completed' | 'failed' | 'cancelled', error?: string): void;
2588
+ /**
2589
+ * Record a user decision
2590
+ */
2591
+ recordDecision(key: string, value: string, skillName?: string): void;
2592
+ /**
2593
+ * Get a decision value
2594
+ */
2595
+ getDecision(key: string): string | undefined;
2596
+ /**
2597
+ * Get execution history
2598
+ */
2599
+ getHistory(limit?: number): ExecutionHistory[];
2600
+ /**
2601
+ * Check if there's an active execution
2602
+ */
2603
+ hasActiveExecution(): boolean;
2604
+ /**
2605
+ * Check if execution is paused
2606
+ */
2607
+ isPaused(): boolean;
2608
+ /**
2609
+ * Clear session (delete file)
2610
+ */
2611
+ clear(): void;
2612
+ }
2613
+ /**
2614
+ * Create a new session manager
2615
+ */
2616
+ declare function createSessionManager(projectPath: string): SessionManager;
2617
+
2618
+ /**
2619
+ * Workflow Types
2620
+ *
2621
+ * Types for skill composition and workflow orchestration.
2622
+ */
2623
+ /**
2624
+ * A skill reference within a workflow
2625
+ */
2626
+ interface WorkflowSkill {
2627
+ /** Skill name or source (e.g., "typescript-strict-mode" or "owner/repo/skill") */
2628
+ skill: string;
2629
+ /** Optional configuration overrides */
2630
+ config?: Record<string, unknown>;
2631
+ /** Optional condition to run this skill */
2632
+ condition?: string;
2633
+ }
2634
+ /**
2635
+ * A wave of skills to execute (parallel or sequential)
2636
+ */
2637
+ interface WorkflowWave {
2638
+ /** Wave name/description */
2639
+ name?: string;
2640
+ /** Whether skills in this wave run in parallel */
2641
+ parallel: boolean;
2642
+ /** Skills to execute in this wave */
2643
+ skills: (string | WorkflowSkill)[];
2644
+ /** Continue to next wave even if this wave has failures */
2645
+ continueOnError?: boolean;
2646
+ }
2647
+ /**
2648
+ * Workflow definition
2649
+ */
2650
+ interface Workflow {
2651
+ /** Workflow name (used as identifier) */
2652
+ name: string;
2653
+ /** Human-readable description */
2654
+ description?: string;
2655
+ /** Workflow version */
2656
+ version?: string;
2657
+ /** Author information */
2658
+ author?: string;
2659
+ /** Tags for discovery */
2660
+ tags?: string[];
2661
+ /** Waves of skills to execute */
2662
+ waves: WorkflowWave[];
2663
+ /** Environment variables to set */
2664
+ env?: Record<string, string>;
2665
+ /** Pre-execution hooks */
2666
+ preHooks?: string[];
2667
+ /** Post-execution hooks */
2668
+ postHooks?: string[];
2669
+ }
2670
+ /**
2671
+ * Workflow execution status
2672
+ */
2673
+ type WorkflowExecutionStatus = 'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
2674
+ /**
2675
+ * Status of a wave execution
2676
+ */
2677
+ interface WaveExecutionStatus {
2678
+ /** Wave index */
2679
+ waveIndex: number;
2680
+ /** Wave name */
2681
+ waveName?: string;
2682
+ /** Status */
2683
+ status: WorkflowExecutionStatus;
2684
+ /** Skills statuses */
2685
+ skills: {
2686
+ skill: string;
2687
+ status: WorkflowExecutionStatus;
2688
+ startedAt?: string;
2689
+ completedAt?: string;
2690
+ error?: string;
2691
+ }[];
2692
+ /** When wave started */
2693
+ startedAt?: string;
2694
+ /** When wave completed */
2695
+ completedAt?: string;
2696
+ }
2697
+ /**
2698
+ * Workflow execution state
2699
+ */
2700
+ interface WorkflowExecution {
2701
+ /** Workflow being executed */
2702
+ workflow: Workflow;
2703
+ /** Execution ID */
2704
+ executionId: string;
2705
+ /** Overall status */
2706
+ status: WorkflowExecutionStatus;
2707
+ /** Current wave index */
2708
+ currentWave: number;
2709
+ /** Wave statuses */
2710
+ waves: WaveExecutionStatus[];
2711
+ /** When execution started */
2712
+ startedAt: string;
2713
+ /** When execution completed */
2714
+ completedAt?: string;
2715
+ /** Error if failed */
2716
+ error?: string;
2717
+ }
2718
+ /**
2719
+ * Workflow file location
2720
+ */
2721
+ declare const WORKFLOWS_DIR = "workflows";
2722
+ declare const WORKFLOW_EXTENSION = ".yaml";
2723
+
2724
+ /**
2725
+ * Workflow Parser
2726
+ *
2727
+ * Parses workflow YAML files into Workflow objects.
2728
+ */
2729
+
2730
+ /**
2731
+ * Parse a workflow from YAML content
2732
+ */
2733
+ declare function parseWorkflow(content: string): Workflow;
2734
+ /**
2735
+ * Load a workflow from a file
2736
+ */
2737
+ declare function loadWorkflow(filePath: string): Workflow;
2738
+ /**
2739
+ * Load a workflow by name from the project's workflows directory
2740
+ */
2741
+ declare function loadWorkflowByName(projectPath: string, name: string): Workflow | null;
2742
+ /**
2743
+ * List all workflows in a project
2744
+ */
2745
+ declare function listWorkflows(projectPath: string): Workflow[];
2746
+ /**
2747
+ * Save a workflow to a file
2748
+ */
2749
+ declare function saveWorkflow(projectPath: string, workflow: Workflow): string;
2750
+ /**
2751
+ * Serialize a workflow to YAML
2752
+ */
2753
+ declare function serializeWorkflow(workflow: Workflow): string;
2754
+ /**
2755
+ * Validate a workflow
2756
+ */
2757
+ declare function validateWorkflow(workflow: Workflow): {
2758
+ valid: boolean;
2759
+ errors: string[];
2760
+ };
2761
+ /**
2762
+ * Create a new workflow from a template
2763
+ */
2764
+ declare function createWorkflowTemplate(name: string, description?: string): Workflow;
2765
+
2766
+ /**
2767
+ * Workflow Orchestrator
2768
+ *
2769
+ * Executes workflows with wave-based orchestration.
2770
+ */
2771
+
2772
+ /**
2773
+ * Skill executor function type
2774
+ */
2775
+ type SkillExecutor = (skillName: string, config?: Record<string, unknown>) => Promise<{
2776
+ success: boolean;
2777
+ error?: string;
2778
+ }>;
2779
+ /**
2780
+ * Progress callback for workflow execution
2781
+ */
2782
+ type WorkflowProgressCallback = (event: {
2783
+ type: 'wave_start' | 'wave_complete' | 'skill_start' | 'skill_complete' | 'workflow_complete';
2784
+ waveIndex?: number;
2785
+ waveName?: string;
2786
+ skillName?: string;
2787
+ status?: WorkflowExecutionStatus;
2788
+ error?: string;
2789
+ }) => void;
2790
+ /**
2791
+ * Workflow Orchestrator
2792
+ *
2793
+ * Manages the execution of workflows with parallel/sequential waves.
2794
+ */
2795
+ declare class WorkflowOrchestrator {
2796
+ private execution;
2797
+ private executor;
2798
+ private onProgress?;
2799
+ constructor(executor: SkillExecutor, onProgress?: WorkflowProgressCallback);
2800
+ /**
2801
+ * Get current execution state
2802
+ */
2803
+ getExecution(): WorkflowExecution | null;
2804
+ /**
2805
+ * Execute a workflow
2806
+ */
2807
+ execute(workflow: Workflow): Promise<WorkflowExecution>;
2808
+ /**
2809
+ * Execute a single wave
2810
+ */
2811
+ private executeWave;
2812
+ /**
2813
+ * Execute a single skill
2814
+ */
2815
+ private executeSkill;
2816
+ /**
2817
+ * Pause execution
2818
+ */
2819
+ pause(): boolean;
2820
+ /**
2821
+ * Check if execution should continue
2822
+ */
2823
+ private shouldContinue;
2824
+ /**
2825
+ * Resume execution
2826
+ */
2827
+ resume(): Promise<WorkflowExecution | null>;
2828
+ /**
2829
+ * Cancel execution
2830
+ */
2831
+ cancel(): boolean;
2832
+ }
2833
+ /**
2834
+ * Create a new workflow orchestrator
2835
+ */
2836
+ declare function createWorkflowOrchestrator(executor: SkillExecutor, onProgress?: WorkflowProgressCallback): WorkflowOrchestrator;
2837
+
2838
+ /**
2839
+ * Executor Types
2840
+ *
2841
+ * Types for skill execution engine.
2842
+ */
2843
+
2844
+ /**
2845
+ * Task type within a skill
2846
+ */
2847
+ type ExecutableTaskType = 'auto' | 'checkpoint:human-verify' | 'checkpoint:decision' | 'checkpoint:human-action';
2848
+ /**
2849
+ * Task status
2850
+ */
2851
+ type ExecutionTaskStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
2852
+ /**
2853
+ * Verification rule for a task
2854
+ */
2855
+ interface VerificationRule {
2856
+ /** Command to run for verification */
2857
+ command?: string;
2858
+ /** Expected result (success, contains:<text>, matches:<regex>) */
2859
+ expect?: string;
2860
+ /** Human verification prompt */
2861
+ description?: string;
2862
+ /** URL to show for verification */
2863
+ url?: string;
2864
+ }
2865
+ /**
2866
+ * An executable task within a skill
2867
+ */
2868
+ interface ExecutableTask {
2869
+ /** Task identifier */
2870
+ id: string;
2871
+ /** Task name/description */
2872
+ name: string;
2873
+ /** Task type */
2874
+ type: ExecutableTaskType;
2875
+ /** Action description for AI agent */
2876
+ action: string;
2877
+ /** Files expected to be modified */
2878
+ files?: string[];
2879
+ /** Verification rules */
2880
+ verify?: {
2881
+ automated?: VerificationRule[];
2882
+ human?: VerificationRule[];
2883
+ };
2884
+ /** Options for checkpoint:decision type */
2885
+ options?: string[];
2886
+ /** Dependencies (task IDs that must complete first) */
2887
+ dependsOn?: string[];
2888
+ }
2889
+ /**
2890
+ * Extended skill with execution metadata
2891
+ */
2892
+ interface ExecutableSkill {
2893
+ /** Skill name */
2894
+ name: string;
2895
+ /** Skill description */
2896
+ description?: string;
2897
+ /** Skill version */
2898
+ version?: string;
2899
+ /** Skill source (repo or path) */
2900
+ source: string;
2901
+ /** Skill content (instructions) */
2902
+ content: string;
2903
+ /** Executable tasks */
2904
+ tasks?: ExecutableTask[];
2905
+ /** Environment requirements */
2906
+ requirements?: {
2907
+ frameworks?: string[];
2908
+ languages?: string[];
2909
+ libraries?: string[];
2910
+ };
2911
+ }
2912
+ /**
2913
+ * Task execution result
2914
+ */
2915
+ interface TaskExecutionResult {
2916
+ /** Task ID */
2917
+ taskId: string;
2918
+ /** Task name */
2919
+ taskName: string;
2920
+ /** Final status */
2921
+ status: ExecutionTaskStatus;
2922
+ /** Start time */
2923
+ startedAt: string;
2924
+ /** End time (only present for completed/failed/skipped tasks) */
2925
+ completedAt?: string;
2926
+ /** Duration in milliseconds (only present for completed/failed/skipped tasks) */
2927
+ durationMs?: number;
2928
+ /** Output/result */
2929
+ output?: string;
2930
+ /** Error message if failed */
2931
+ error?: string;
2932
+ /** Files modified */
2933
+ filesModified?: string[];
2934
+ /** Git commit SHA if committed */
2935
+ commitSha?: string;
2936
+ /** Verification results */
2937
+ verificationResults?: {
2938
+ automated: {
2939
+ rule: string;
2940
+ passed: boolean;
2941
+ output?: string;
2942
+ }[];
2943
+ human: {
2944
+ description: string;
2945
+ passed: boolean;
2946
+ }[];
2947
+ };
2948
+ }
2949
+ /**
2950
+ * Skill execution result
2951
+ */
2952
+ interface SkillExecutionResult {
2953
+ /** Skill name */
2954
+ skillName: string;
2955
+ /** Skill source */
2956
+ skillSource: string;
2957
+ /** Overall status */
2958
+ status: 'completed' | 'failed' | 'cancelled' | 'paused';
2959
+ /** Start time */
2960
+ startedAt: string;
2961
+ /** End time */
2962
+ completedAt?: string;
2963
+ /** Total duration in milliseconds */
2964
+ durationMs?: number;
2965
+ /** Task results */
2966
+ tasks: TaskExecutionResult[];
2967
+ /** All files modified */
2968
+ filesModified: string[];
2969
+ /** All commits created */
2970
+ commits: string[];
2971
+ /** Error if failed */
2972
+ error?: string;
2973
+ }
2974
+ /**
2975
+ * Execution options
2976
+ */
2977
+ interface ExecutionOptions {
2978
+ /** Target agent to use */
2979
+ agent?: AgentType;
2980
+ /** Whether to create commits per task */
2981
+ autoCommit?: boolean;
2982
+ /** Whether to run verification checks */
2983
+ verify?: boolean;
2984
+ /** Dry run (show what would be done) */
2985
+ dryRun?: boolean;
2986
+ /** Continue on task failure */
2987
+ continueOnError?: boolean;
2988
+ /** Environment variables to set */
2989
+ env?: Record<string, string>;
2990
+ }
2991
+ /**
2992
+ * Checkpoint response from user
2993
+ */
2994
+ interface CheckpointResponse {
2995
+ /** Whether to continue */
2996
+ continue: boolean;
2997
+ /** Selected option (for decision checkpoints) */
2998
+ selectedOption?: string;
2999
+ /** User notes */
3000
+ notes?: string;
3001
+ }
3002
+ /**
3003
+ * Checkpoint handler function type
3004
+ */
3005
+ type CheckpointHandler = (task: ExecutableTask, context: {
3006
+ skillName: string;
3007
+ taskIndex: number;
3008
+ totalTasks: number;
3009
+ }) => Promise<CheckpointResponse>;
3010
+
3011
+ /**
3012
+ * Skill Execution Engine
3013
+ *
3014
+ * Executes skills with task-based orchestration, verification, and state management.
3015
+ */
3016
+
3017
+ /**
3018
+ * Progress event for execution
3019
+ */
3020
+ interface ExecutionProgressEvent {
3021
+ type: 'task_start' | 'task_complete' | 'checkpoint' | 'verification' | 'complete';
3022
+ taskId?: string;
3023
+ taskName?: string;
3024
+ taskIndex?: number;
3025
+ totalTasks?: number;
3026
+ status?: ExecutionTaskStatus | 'paused' | 'cancelled';
3027
+ message?: string;
3028
+ error?: string;
3029
+ }
3030
+ /**
3031
+ * Progress callback type
3032
+ */
3033
+ type ExecutionProgressCallback = (event: ExecutionProgressEvent) => void;
3034
+ /**
3035
+ * Skill Execution Engine
3036
+ */
3037
+ declare class SkillExecutionEngine {
3038
+ private projectPath;
3039
+ private sessionManager;
3040
+ private checkpointHandler?;
3041
+ private onProgress?;
3042
+ constructor(projectPath: string, options?: {
3043
+ checkpointHandler?: CheckpointHandler;
3044
+ onProgress?: ExecutionProgressCallback;
3045
+ });
3046
+ /**
3047
+ * Execute a skill
3048
+ */
3049
+ execute(skill: ExecutableSkill, options?: ExecutionOptions): Promise<SkillExecutionResult>;
3050
+ /**
3051
+ * Resume a paused execution
3052
+ */
3053
+ private resumeExecution;
3054
+ /**
3055
+ * Execute a single task
3056
+ */
3057
+ private executeTask;
3058
+ /**
3059
+ * Handle a checkpoint
3060
+ */
3061
+ private handleCheckpoint;
3062
+ /**
3063
+ * Check if a regex pattern is potentially dangerous (ReDoS-vulnerable)
3064
+ * Rejects patterns with nested quantifiers and other known problematic constructs
3065
+ */
3066
+ private isUnsafeRegexPattern;
3067
+ /**
3068
+ * Safely test a regex pattern with ReDoS prevention
3069
+ *
3070
+ * This method validates patterns before execution to prevent catastrophic backtracking.
3071
+ * Note: This cannot guarantee protection against all ReDoS patterns, but catches common ones.
3072
+ */
3073
+ private safeRegexTest;
3074
+ /**
3075
+ * Run verification for a task
3076
+ *
3077
+ * SECURITY NOTE: Verification commands are executed from skill configuration.
3078
+ * Only run skills from trusted sources. Commands run with the same privileges
3079
+ * as the skillkit process.
3080
+ */
3081
+ private runVerification;
3082
+ /**
3083
+ * Create a dry run result
3084
+ */
3085
+ private createDryRunResult;
3086
+ /**
3087
+ * Pause current execution
3088
+ */
3089
+ pause(): boolean;
3090
+ /**
3091
+ * Check if execution is paused
3092
+ */
3093
+ isPaused(): boolean;
3094
+ /**
3095
+ * Get session manager
3096
+ */
3097
+ getSessionManager(): SessionManager;
3098
+ }
3099
+ /**
3100
+ * Create a new skill execution engine
3101
+ */
3102
+ declare function createExecutionEngine(projectPath: string, options?: {
3103
+ checkpointHandler?: CheckpointHandler;
3104
+ onProgress?: ExecutionProgressCallback;
3105
+ }): SkillExecutionEngine;
3106
+
3107
+ /**
3108
+ * Agent Execution Module
3109
+ *
3110
+ * Handles real execution of skills through various AI agent CLIs.
3111
+ */
3112
+
3113
+ /**
3114
+ * Agent CLI configuration
3115
+ */
3116
+ interface AgentCLIConfig {
3117
+ /** Agent type */
3118
+ type: AgentType;
3119
+ /** CLI command name */
3120
+ command: string;
3121
+ /** Whether the agent supports CLI execution */
3122
+ supportsCLI: boolean;
3123
+ /** Arguments to pass the prompt/skill content */
3124
+ promptArgs?: string[];
3125
+ /** Arguments for non-interactive mode */
3126
+ nonInteractiveArgs?: string[];
3127
+ /** Environment variables needed */
3128
+ envVars?: Record<string, string>;
3129
+ /** How to check if agent is installed */
3130
+ checkCommand?: string;
3131
+ }
3132
+ /**
3133
+ * Execution result from an agent
3134
+ */
3135
+ interface AgentExecutionResult {
3136
+ success: boolean;
3137
+ output: string;
3138
+ error?: string;
3139
+ exitCode: number;
3140
+ duration: number;
3141
+ }
3142
+ /**
3143
+ * Agent CLI configurations
3144
+ */
3145
+ declare const AGENT_CLI_CONFIGS: AgentCLIConfig[];
3146
+ /**
3147
+ * Get CLI config for an agent
3148
+ */
3149
+ declare function getAgentCLIConfig(agentType: AgentType): AgentCLIConfig | undefined;
3150
+ /**
3151
+ * Check if an agent CLI is available
3152
+ */
3153
+ declare function isAgentCLIAvailable(agentType: AgentType): Promise<boolean>;
3154
+ /**
3155
+ * Get all available CLI agents
3156
+ */
3157
+ declare function getAvailableCLIAgents(): Promise<AgentType[]>;
3158
+ /**
3159
+ * Execute a skill using an agent CLI
3160
+ */
3161
+ declare function executeWithAgent(agentType: AgentType, prompt: string, options?: {
3162
+ cwd?: string;
3163
+ timeout?: number;
3164
+ env?: Record<string, string>;
3165
+ }): Promise<AgentExecutionResult>;
3166
+ /**
3167
+ * Format skill content as a prompt for an agent
3168
+ */
3169
+ declare function formatSkillAsPrompt(skillName: string, skillContent: string, taskDescription?: string): string;
3170
+ /**
3171
+ * Agent execution strategy
3172
+ */
3173
+ type ExecutionStrategy = 'cli' | 'ide' | 'api' | 'manual';
3174
+ /**
3175
+ * Get recommended execution strategy for an agent
3176
+ */
3177
+ declare function getExecutionStrategy(agentType: AgentType): ExecutionStrategy;
3178
+ /**
3179
+ * Get instructions for manual/IDE execution
3180
+ */
3181
+ declare function getManualExecutionInstructions(agentType: AgentType, skillPath: string): string;
3182
+
3183
+ /**
3184
+ * Skill Executor for Workflows
3185
+ *
3186
+ * Provides a real skill executor that finds skills by name
3187
+ * and executes them using available agent CLIs.
3188
+ */
3189
+
3190
+ /**
3191
+ * Options for creating a skill executor
3192
+ */
3193
+ interface SkillExecutorOptions {
3194
+ /** Project path to search for skills */
3195
+ projectPath?: string;
3196
+ /** Preferred agent to use for execution */
3197
+ preferredAgent?: AgentType;
3198
+ /** Timeout for skill execution (ms) */
3199
+ timeout?: number;
3200
+ /** Whether to fall back to other agents if preferred is unavailable */
3201
+ fallbackToAvailable?: boolean;
3202
+ /** Callback for execution events */
3203
+ onExecutionEvent?: (event: SkillExecutionEvent) => void;
3204
+ }
3205
+ /**
3206
+ * Skill execution event
3207
+ */
3208
+ interface SkillExecutionEvent {
3209
+ type: 'skill_found' | 'skill_not_found' | 'agent_selected' | 'execution_start' | 'execution_complete';
3210
+ skillName: string;
3211
+ agent?: AgentType;
3212
+ message?: string;
3213
+ success?: boolean;
3214
+ error?: string;
3215
+ }
3216
+ /**
3217
+ * Create a skill executor for workflow orchestration
3218
+ *
3219
+ * This returns a function compatible with the WorkflowOrchestrator's SkillExecutor type.
3220
+ */
3221
+ declare function createSkillExecutor(options?: SkillExecutorOptions): SkillExecutor;
3222
+ /**
3223
+ * Create a simulated skill executor for testing/dry-run
3224
+ *
3225
+ * This executor doesn't actually run skills but simulates execution.
3226
+ */
3227
+ declare function createSimulatedSkillExecutor(options?: {
3228
+ delay?: number;
3229
+ shouldFail?: (skillName: string) => boolean;
3230
+ onExecute?: (skillName: string) => void;
3231
+ }): SkillExecutor;
3232
+
3233
+ /**
3234
+ * Skill Testing Framework Types
3235
+ *
3236
+ * Define test cases in skill frontmatter for automated verification.
3237
+ */
3238
+ /**
3239
+ * Test assertion types
3240
+ */
3241
+ type TestAssertionType = 'file_exists' | 'file_not_exists' | 'file_contains' | 'file_not_contains' | 'file_matches' | 'command_succeeds' | 'command_fails' | 'command_output_contains' | 'json_valid' | 'json_has_key' | 'yaml_valid' | 'type_check' | 'lint_passes' | 'test_passes' | 'env_var_set' | 'port_available' | 'url_responds' | 'custom';
3242
+ /**
3243
+ * Test assertion definition
3244
+ */
3245
+ interface TestAssertion {
3246
+ /** Assertion type */
3247
+ type: TestAssertionType;
3248
+ /** Target file, command, or URL */
3249
+ target?: string;
3250
+ /** Expected value or pattern */
3251
+ expected?: string | boolean | number;
3252
+ /** Custom command for 'custom' type */
3253
+ command?: string;
3254
+ /** Timeout in milliseconds */
3255
+ timeout?: number;
3256
+ /** Error message on failure */
3257
+ message?: string;
3258
+ }
3259
+ /**
3260
+ * Test case definition
3261
+ */
3262
+ interface SkillTestCase {
3263
+ /** Test name */
3264
+ name: string;
3265
+ /** Test description */
3266
+ description?: string;
3267
+ /** Assertions to run */
3268
+ assertions: TestAssertion[];
3269
+ /** Setup commands to run before test */
3270
+ setup?: string[];
3271
+ /** Cleanup commands to run after test */
3272
+ cleanup?: string[];
3273
+ /** Skip this test */
3274
+ skip?: boolean;
3275
+ /** Only run this test */
3276
+ only?: boolean;
3277
+ /** Tags for filtering */
3278
+ tags?: string[];
3279
+ }
3280
+ /**
3281
+ * Test suite for a skill
3282
+ */
3283
+ interface SkillTestSuite {
3284
+ /** Skill name */
3285
+ skillName: string;
3286
+ /** Test cases */
3287
+ tests: SkillTestCase[];
3288
+ /** Global setup commands */
3289
+ globalSetup?: string[];
3290
+ /** Global cleanup commands */
3291
+ globalCleanup?: string[];
3292
+ /** Default timeout for all tests */
3293
+ defaultTimeout?: number;
3294
+ }
3295
+ /**
3296
+ * Individual assertion result
3297
+ */
3298
+ interface AssertionResult {
3299
+ /** Assertion that was run */
3300
+ assertion: TestAssertion;
3301
+ /** Whether assertion passed */
3302
+ passed: boolean;
3303
+ /** Actual value found */
3304
+ actual?: string;
3305
+ /** Expected value */
3306
+ expected?: string;
3307
+ /** Error message if failed */
3308
+ error?: string;
3309
+ /** Duration in milliseconds */
3310
+ duration: number;
3311
+ }
3312
+ /**
3313
+ * Test case result
3314
+ */
3315
+ interface TestCaseResult {
3316
+ /** Test case that was run */
3317
+ testCase: SkillTestCase;
3318
+ /** Whether all assertions passed */
3319
+ passed: boolean;
3320
+ /** Individual assertion results */
3321
+ assertions: AssertionResult[];
3322
+ /** Setup error if any */
3323
+ setupError?: string;
3324
+ /** Cleanup error if any */
3325
+ cleanupError?: string;
3326
+ /** Total duration in milliseconds */
3327
+ duration: number;
3328
+ /** Whether test was skipped */
3329
+ skipped: boolean;
3330
+ }
3331
+ /**
3332
+ * Test suite result
3333
+ */
3334
+ interface TestSuiteResult {
3335
+ /** Skill name */
3336
+ skillName: string;
3337
+ /** Whether all tests passed */
3338
+ passed: boolean;
3339
+ /** Individual test results */
3340
+ tests: TestCaseResult[];
3341
+ /** Number of tests passed */
3342
+ passedCount: number;
3343
+ /** Number of tests failed */
3344
+ failedCount: number;
3345
+ /** Number of tests skipped */
3346
+ skippedCount: number;
3347
+ /** Total duration in milliseconds */
3348
+ duration: number;
3349
+ /** Global setup error if any */
3350
+ globalSetupError?: string;
3351
+ /** Global cleanup error if any */
3352
+ globalCleanupError?: string;
3353
+ }
3354
+ /**
3355
+ * Test runner options
3356
+ */
3357
+ interface TestRunnerOptions {
3358
+ /** Working directory */
3359
+ cwd?: string;
3360
+ /** Default timeout in milliseconds */
3361
+ timeout?: number;
3362
+ /** Only run tests with these tags */
3363
+ tags?: string[];
3364
+ /** Skip tests with these tags */
3365
+ skipTags?: string[];
3366
+ /** Verbose output */
3367
+ verbose?: boolean;
3368
+ /** Stop on first failure */
3369
+ bail?: boolean;
3370
+ /** Run tests in parallel */
3371
+ parallel?: boolean;
3372
+ /** Progress callback */
3373
+ onProgress?: (event: TestProgressEvent) => void;
3374
+ }
3375
+ /**
3376
+ * Test progress event
3377
+ */
3378
+ interface TestProgressEvent {
3379
+ type: 'suite_start' | 'suite_end' | 'test_start' | 'test_end' | 'assertion_start' | 'assertion_end';
3380
+ skillName?: string;
3381
+ testName?: string;
3382
+ assertionType?: TestAssertionType;
3383
+ passed?: boolean;
3384
+ error?: string;
3385
+ }
3386
+
3387
+ /**
3388
+ * Skill Test Runner
3389
+ *
3390
+ * Executes test suites and assertions for skill verification.
3391
+ */
3392
+
3393
+ /**
3394
+ * Run a test suite
3395
+ */
3396
+ declare function runTestSuite(suite: SkillTestSuite, options?: TestRunnerOptions): Promise<TestSuiteResult>;
3397
+ /**
3398
+ * Create a test suite from skill frontmatter
3399
+ */
3400
+ declare function createTestSuiteFromFrontmatter(skillName: string, frontmatter: Record<string, unknown>): SkillTestSuite | null;
3401
+
3402
+ /**
3403
+ * Skill Marketplace Types
3404
+ *
3405
+ * Types for the aggregated skill marketplace.
3406
+ */
3407
+ /**
3408
+ * Skill source repository
3409
+ */
3410
+ interface SkillSource {
3411
+ /** Repository owner */
3412
+ owner: string;
3413
+ /** Repository name */
3414
+ repo: string;
3415
+ /** Human-readable name */
3416
+ name: string;
3417
+ /** Description */
3418
+ description?: string;
3419
+ /** Whether this is an official source */
3420
+ official?: boolean;
3421
+ /** Branch to fetch from */
3422
+ branch?: string;
3423
+ /** Path to skills index file */
3424
+ indexPath?: string;
3425
+ }
3426
+ /**
3427
+ * Skill entry in the marketplace
3428
+ */
3429
+ interface MarketplaceSkill {
3430
+ /** Unique identifier (owner/repo/path) */
3431
+ id: string;
3432
+ /** Skill name */
3433
+ name: string;
3434
+ /** Description */
3435
+ description: string;
3436
+ /** Source repository */
3437
+ source: SkillSource;
3438
+ /** Path within the repository */
3439
+ path: string;
3440
+ /** Version if available */
3441
+ version?: string;
3442
+ /** Author */
3443
+ author?: string;
3444
+ /** Tags for categorization */
3445
+ tags: string[];
3446
+ /** Supported agents */
3447
+ agents?: string[];
3448
+ /** GitHub stars (if available) */
3449
+ stars?: number;
3450
+ /** Last updated date */
3451
+ updatedAt?: string;
3452
+ /** Download/install count */
3453
+ downloads?: number;
3454
+ /** Raw content URL */
3455
+ rawUrl?: string;
3456
+ }
3457
+ /**
3458
+ * Marketplace index (cached locally)
3459
+ */
3460
+ interface MarketplaceIndex {
3461
+ /** Index version */
3462
+ version: number;
3463
+ /** When the index was last updated */
3464
+ updatedAt: string;
3465
+ /** Sources included in this index */
3466
+ sources: SkillSource[];
3467
+ /** All skills in the index */
3468
+ skills: MarketplaceSkill[];
3469
+ /** Total skill count */
3470
+ totalCount: number;
3471
+ }
3472
+ /**
3473
+ * Search options for the marketplace
3474
+ */
3475
+ interface MarketplaceSearchOptions {
3476
+ /** Search query */
3477
+ query?: string;
3478
+ /** Filter by tags */
3479
+ tags?: string[];
3480
+ /** Filter by source */
3481
+ source?: string;
3482
+ /** Filter by agent compatibility */
3483
+ agent?: string;
3484
+ /** Sort by field */
3485
+ sortBy?: 'name' | 'stars' | 'downloads' | 'updatedAt';
3486
+ /** Sort direction */
3487
+ sortOrder?: 'asc' | 'desc';
3488
+ /** Limit results */
3489
+ limit?: number;
3490
+ /** Offset for pagination */
3491
+ offset?: number;
3492
+ }
3493
+ /**
3494
+ * Search result
3495
+ */
3496
+ interface MarketplaceSearchResult {
3497
+ /** Matching skills */
3498
+ skills: MarketplaceSkill[];
3499
+ /** Total matches (before limit) */
3500
+ total: number;
3501
+ /** Query that was searched */
3502
+ query?: string;
3503
+ }
3504
+ /**
3505
+ * Marketplace configuration
3506
+ */
3507
+ interface MarketplaceConfig {
3508
+ /** Custom sources to include */
3509
+ sources?: SkillSource[];
3510
+ /** Cache directory */
3511
+ cacheDir?: string;
3512
+ /** Cache TTL in milliseconds */
3513
+ cacheTTL?: number;
3514
+ /** GitHub token for API access */
3515
+ githubToken?: string;
3516
+ }
3517
+ /**
3518
+ * Default skill sources
3519
+ */
3520
+ declare const DEFAULT_SKILL_SOURCES: SkillSource[];
3521
+ /**
3522
+ * Cache file name
3523
+ */
3524
+ declare const MARKETPLACE_CACHE_FILE = "marketplace-index.json";
3525
+ /**
3526
+ * Default cache TTL (1 hour)
3527
+ */
3528
+ declare const DEFAULT_CACHE_TTL: number;
3529
+
3530
+ /**
3531
+ * Marketplace Aggregator
3532
+ *
3533
+ * Fetches and indexes skills from multiple GitHub repositories.
3534
+ */
3535
+
3536
+ /**
3537
+ * Marketplace Aggregator
3538
+ */
3539
+ declare class MarketplaceAggregator {
3540
+ private config;
3541
+ private cacheDir;
3542
+ private cachePath;
3543
+ private index;
3544
+ constructor(config?: MarketplaceConfig);
3545
+ /**
3546
+ * Get all sources (default + custom)
3547
+ */
3548
+ getSources(): SkillSource[];
3549
+ /**
3550
+ * Load cached index
3551
+ */
3552
+ loadCache(): MarketplaceIndex | null;
3553
+ /**
3554
+ * Save index to cache
3555
+ */
3556
+ saveCache(index: MarketplaceIndex): void;
3557
+ /**
3558
+ * Fetch skills from a single source
3559
+ */
3560
+ fetchSource(source: SkillSource): Promise<MarketplaceSkill[]>;
3561
+ /**
3562
+ * Check if a path is an absolute URL
3563
+ */
3564
+ private isAbsoluteUrl;
3565
+ /**
3566
+ * Convert a GitHub URL to raw content URL
3567
+ */
3568
+ private toRawUrl;
3569
+ /**
3570
+ * Parse a skill entry from JSON
3571
+ */
3572
+ private parseSkillEntry;
3573
+ /**
3574
+ * Parse README for skill links
3575
+ */
3576
+ private parseReadmeForSkills;
3577
+ /**
3578
+ * Build raw URL for a skill
3579
+ */
3580
+ private buildRawUrl;
3581
+ /**
3582
+ * Infer tags from name and description
3583
+ */
3584
+ private inferTags;
3585
+ /**
3586
+ * Refresh the marketplace index
3587
+ */
3588
+ refresh(): Promise<MarketplaceIndex>;
3589
+ /**
3590
+ * Get the marketplace index (from cache or refresh)
3591
+ */
3592
+ getIndex(forceRefresh?: boolean): Promise<MarketplaceIndex>;
3593
+ /**
3594
+ * Search the marketplace
3595
+ */
3596
+ search(options?: MarketplaceSearchOptions): Promise<MarketplaceSearchResult>;
3597
+ /**
3598
+ * Get a skill by ID
3599
+ */
3600
+ getSkill(id: string): Promise<MarketplaceSkill | null>;
3601
+ /**
3602
+ * Get skill content
3603
+ */
3604
+ getSkillContent(skill: MarketplaceSkill): Promise<string | null>;
3605
+ /**
3606
+ * Get popular tags
3607
+ */
3608
+ getPopularTags(limit?: number): Promise<{
3609
+ tag: string;
3610
+ count: number;
3611
+ }[]>;
3612
+ /**
3613
+ * Add a custom source
3614
+ */
3615
+ addSource(source: SkillSource): void;
3616
+ /**
3617
+ * Remove a custom source
3618
+ */
3619
+ removeSource(owner: string, repo: string): void;
3620
+ /**
3621
+ * Clear cache
3622
+ */
3623
+ clearCache(): void;
3624
+ }
3625
+ /**
3626
+ * Create a marketplace aggregator
3627
+ */
3628
+ declare function createMarketplaceAggregator(config?: MarketplaceConfig): MarketplaceAggregator;
3629
+
3630
+ /**
3631
+ * CI/CD Templates
3632
+ *
3633
+ * Provides templates for GitHub Actions, pre-commit hooks, and other CI/CD integrations.
3634
+ */
3635
+ /**
3636
+ * GitHub Action workflow for skill validation
3637
+ */
3638
+ declare const GITHUB_ACTION_TEMPLATE = "# Skill Validation Workflow\n# This workflow validates skills in your repository\n\nname: Validate Skills\n\non:\n push:\n paths:\n - '.claude/skills/**'\n - '.cursor/skills/**'\n - 'skills/**'\n pull_request:\n paths:\n - '.claude/skills/**'\n - '.cursor/skills/**'\n - 'skills/**'\n\njobs:\n validate:\n runs-on: ubuntu-latest\n\n steps:\n - name: Checkout\n uses: actions/checkout@v4\n\n - name: Setup Node.js\n uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n - name: Install SkillKit\n run: npm install -g skillkit\n\n - name: Validate Skills\n run: skillkit validate\n\n - name: Run Skill Tests\n run: skillkit test --json > test-results.json\n continue-on-error: true\n\n - name: Upload Test Results\n uses: actions/upload-artifact@v4\n with:\n name: skill-test-results\n path: test-results.json\n retention-days: 30\n\n - name: Check Test Results\n run: |\n if [ -f test-results.json ]; then\n passed=$(cat test-results.json | jq -r '.passed')\n if [ \"$passed\" = \"false\" ]; then\n echo \"Some skill tests failed\"\n exit 1\n fi\n fi\n";
3639
+ /**
3640
+ * Pre-commit hook script for skill validation
3641
+ */
3642
+ declare const PRE_COMMIT_HOOK_TEMPLATE = "#!/bin/bash\n# SkillKit Pre-commit Hook\n# Validates skills before commit\n\n# Colors for output\nRED='\\033[0;31m'\nGREEN='\\033[0;32m'\nYELLOW='\\033[0;33m'\nNC='\\033[0m' # No Color\n\necho -e \"${YELLOW}Running SkillKit validation...${NC}\"\n\n# Check if skillkit is installed\nif ! command -v skillkit &> /dev/null; then\n echo -e \"${RED}SkillKit not found. Install with: npm install -g skillkit${NC}\"\n exit 1\nfi\n\n# Get list of staged skill files\nSKILL_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\\.(md|mdc)$' | grep -E '(skills|.claude|.cursor)')\n\nif [ -z \"$SKILL_FILES\" ]; then\n echo -e \"${GREEN}No skill files staged, skipping validation.${NC}\"\n exit 0\nfi\n\necho \"Validating skill files:\"\necho \"$SKILL_FILES\"\n\n# Run validation\nif ! skillkit validate; then\n echo -e \"${RED}Skill validation failed. Please fix the errors and try again.${NC}\"\n exit 1\nfi\n\n# Run tests if any\nif skillkit test --json 2>/dev/null | jq -e '.passed == false' > /dev/null 2>&1; then\n echo -e \"${RED}Skill tests failed. Please fix the failing tests.${NC}\"\n exit 1\nfi\n\necho -e \"${GREEN}All skills validated successfully!${NC}\"\nexit 0\n";
3643
+ /**
3644
+ * Pre-commit config for .pre-commit-config.yaml
3645
+ */
3646
+ declare const PRE_COMMIT_CONFIG_TEMPLATE = "# SkillKit Pre-commit Configuration\n# Add this to your .pre-commit-config.yaml\n\nrepos:\n - repo: local\n hooks:\n - id: skillkit-validate\n name: SkillKit Validate\n entry: skillkit validate\n language: system\n files: \\.(md|mdc)$\n pass_filenames: false\n\n - id: skillkit-test\n name: SkillKit Test\n entry: skillkit test\n language: system\n files: \\.(md|mdc)$\n pass_filenames: false\n";
3647
+ /**
3648
+ * GitLab CI template
3649
+ */
3650
+ declare const GITLAB_CI_TEMPLATE = "# SkillKit GitLab CI Configuration\n# Add this to your .gitlab-ci.yml\n\nskill-validation:\n image: node:20\n stage: test\n before_script:\n - npm install -g skillkit\n script:\n - skillkit validate\n - skillkit test --json > test-results.json\n artifacts:\n # Note: test-results.json is JSON format, not JUnit XML\n paths:\n - test-results.json\n expire_in: 30 days\n rules:\n - changes:\n - \".claude/skills/**\"\n - \".cursor/skills/**\"\n - \"skills/**\"\n";
3651
+ /**
3652
+ * CircleCI config template
3653
+ */
3654
+ declare const CIRCLECI_CONFIG_TEMPLATE = "# SkillKit CircleCI Configuration\n# Add this to your .circleci/config.yml\n\nversion: 2.1\n\njobs:\n validate-skills:\n docker:\n - image: cimg/node:20.0\n steps:\n - checkout\n - run:\n name: Install SkillKit\n command: npm install -g skillkit\n - run:\n name: Validate Skills\n command: skillkit validate\n - run:\n name: Run Skill Tests\n command: skillkit test --json > test-results.json\n - store_artifacts:\n path: test-results.json\n destination: skill-tests\n\nworkflows:\n skill-validation:\n jobs:\n - validate-skills:\n filters:\n branches:\n only: /.*/\n";
3655
+ /**
3656
+ * Get a CI/CD template by name
3657
+ */
3658
+ declare function getCICDTemplate(name: string): string | null;
3659
+ /**
3660
+ * List available CI/CD templates
3661
+ */
3662
+ declare function listCICDTemplates(): {
3663
+ name: string;
3664
+ description: string;
3665
+ }[];
3666
+
3667
+ type ObservationType = 'tool_use' | 'decision' | 'error' | 'solution' | 'pattern' | 'file_change' | 'checkpoint';
3668
+ interface ObservationContent {
3669
+ action: string;
3670
+ context: string;
3671
+ result?: string;
3672
+ files?: string[];
3673
+ tags?: string[];
3674
+ error?: string;
3675
+ solution?: string;
3676
+ }
3677
+ interface Observation {
3678
+ id: string;
3679
+ timestamp: string;
3680
+ sessionId: string;
3681
+ agent: AgentType;
3682
+ type: ObservationType;
3683
+ content: ObservationContent;
3684
+ relevance: number;
3685
+ }
3686
+ interface Learning {
3687
+ id: string;
3688
+ createdAt: string;
3689
+ updatedAt: string;
3690
+ source: 'session' | 'manual' | 'imported';
3691
+ sourceObservations?: string[];
3692
+ title: string;
3693
+ content: string;
3694
+ scope: 'project' | 'global';
3695
+ project?: string;
3696
+ tags: string[];
3697
+ frameworks?: string[];
3698
+ patterns?: string[];
3699
+ useCount: number;
3700
+ lastUsed?: string;
3701
+ effectiveness?: number;
3702
+ }
3703
+ interface MemoryIndex {
3704
+ version: 1;
3705
+ lastUpdated: string;
3706
+ entries: Record<string, string[]>;
3707
+ tags: Record<string, string[]>;
3708
+ }
3709
+ interface MemorySummary {
3710
+ id: string;
3711
+ title: string;
3712
+ tags: string[];
3713
+ relevance: number;
3714
+ }
3715
+ interface MemoryPreview extends MemorySummary {
3716
+ excerpt: string;
3717
+ lastUsed?: string;
3718
+ }
3719
+ interface MemoryFull extends MemoryPreview {
3720
+ content: string;
3721
+ sourceObservations?: Observation[];
3722
+ }
3723
+ interface ObservationStoreData {
3724
+ version: 1;
3725
+ sessionId: string;
3726
+ observations: Observation[];
3727
+ }
3728
+ interface LearningStoreData {
3729
+ version: 1;
3730
+ learnings: Learning[];
3731
+ }
3732
+ interface MemoryConfig {
3733
+ autoCompress: boolean;
3734
+ compressionThreshold: number;
3735
+ compressionModel?: string;
3736
+ maxObservations: number;
3737
+ maxLearnings: number;
3738
+ }
3739
+ declare const DEFAULT_MEMORY_CONFIG: MemoryConfig;
3740
+ interface MemorySearchOptions {
3741
+ query?: string;
3742
+ tags?: string[];
3743
+ scope?: 'project' | 'global' | 'all';
3744
+ limit?: number;
3745
+ minRelevance?: number;
3746
+ }
3747
+ interface MemorySearchResult {
3748
+ learning: Learning;
3749
+ score: number;
3750
+ matchedKeywords: string[];
3751
+ matchedTags: string[];
3752
+ }
3753
+
3754
+ declare class ObservationStore {
3755
+ private readonly filePath;
3756
+ private data;
3757
+ private sessionId;
3758
+ constructor(projectPath: string, sessionId?: string);
3759
+ private ensureDir;
3760
+ private load;
3761
+ private createEmpty;
3762
+ private save;
3763
+ add(type: ObservationType, content: ObservationContent, agent: AgentType, relevance?: number): Observation;
3764
+ getAll(): Observation[];
3765
+ getByType(type: ObservationType): Observation[];
3766
+ getByRelevance(minRelevance: number): Observation[];
3767
+ getRecent(count: number): Observation[];
3768
+ getUncompressed(compressedIds: string[]): Observation[];
3769
+ count(): number;
3770
+ clear(): void;
3771
+ getById(id: string): Observation | undefined;
3772
+ getByIds(ids: string[]): Observation[];
3773
+ getSessionId(): string;
3774
+ setSessionId(sessionId: string): void;
3775
+ exists(): boolean;
3776
+ delete(id: string): boolean;
3777
+ deleteMany(ids: string[]): number;
3778
+ }
3779
+
3780
+ declare class LearningStore {
3781
+ private readonly filePath;
3782
+ private readonly scope;
3783
+ private readonly projectName?;
3784
+ private data;
3785
+ constructor(scope: 'project' | 'global', projectPath?: string, projectName?: string);
3786
+ private ensureDir;
3787
+ private load;
3788
+ private createEmpty;
3789
+ private save;
3790
+ add(learning: Omit<Learning, 'id' | 'createdAt' | 'updatedAt' | 'useCount' | 'scope' | 'project'>): Learning;
3791
+ update(id: string, updates: Partial<Omit<Learning, 'id' | 'createdAt'>>): Learning | null;
3792
+ delete(id: string): boolean;
3793
+ getAll(): Learning[];
3794
+ getById(id: string): Learning | undefined;
3795
+ getByTags(tags: string[]): Learning[];
3796
+ getByFrameworks(frameworks: string[]): Learning[];
3797
+ getRecent(count: number): Learning[];
3798
+ getMostUsed(count: number): Learning[];
3799
+ getMostEffective(count: number): Learning[];
3800
+ incrementUseCount(id: string): void;
3801
+ setEffectiveness(id: string, effectiveness: number): void;
3802
+ search(query: string): Learning[];
3803
+ count(): number;
3804
+ clear(): void;
3805
+ exists(): boolean;
3806
+ getScope(): 'project' | 'global';
3807
+ }
3808
+
3809
+ declare class MemoryIndexStore {
3810
+ private readonly filePath;
3811
+ private data;
3812
+ constructor(basePath: string, _isGlobal?: boolean);
3813
+ private ensureDir;
3814
+ private load;
3815
+ private createEmpty;
3816
+ private save;
3817
+ private extractKeywords;
3818
+ indexLearning(learning: Learning): void;
3819
+ removeLearning(learningId: string): void;
3820
+ searchByKeywords(query: string): string[];
3821
+ searchByTags(tags: string[]): string[];
3822
+ search(query: string, tags?: string[]): string[];
3823
+ getAllTags(): string[];
3824
+ getTagCounts(): Record<string, number>;
3825
+ rebuildIndex(learnings: Learning[]): void;
3826
+ clear(): void;
3827
+ exists(): boolean;
3828
+ getStats(): {
3829
+ keywords: number;
3830
+ tags: number;
3831
+ lastUpdated: string;
3832
+ };
3833
+ }
3834
+
3835
+ interface MemoryPaths {
3836
+ projectMemoryDir: string;
3837
+ globalMemoryDir: string;
3838
+ observationsFile: string;
3839
+ learningsFile: string;
3840
+ indexFile: string;
3841
+ globalLearningsFile: string;
3842
+ globalIndexFile: string;
3843
+ }
3844
+ declare function getMemoryPaths(projectPath: string): MemoryPaths;
3845
+ declare function initializeMemoryDirectory(projectPath: string): MemoryPaths;
3846
+ declare function memoryDirectoryExists(projectPath: string): boolean;
3847
+ declare function globalMemoryDirectoryExists(): boolean;
3848
+ interface MemoryStatus {
3849
+ projectMemoryExists: boolean;
3850
+ globalMemoryExists: boolean;
3851
+ hasObservations: boolean;
3852
+ hasLearnings: boolean;
3853
+ hasGlobalLearnings: boolean;
3854
+ hasIndex: boolean;
3855
+ hasGlobalIndex: boolean;
3856
+ }
3857
+ declare function getMemoryStatus(projectPath: string): MemoryStatus;
3858
+
3859
+ /**
3860
+ * Memory Observer
3861
+ *
3862
+ * Captures observations during skill execution and stores them in the ObservationStore.
3863
+ * Provides intelligent filtering to capture only significant events.
3864
+ */
3865
+
3866
+ /**
3867
+ * Event types that can be observed
3868
+ */
3869
+ type ObservableEventType = 'task_start' | 'task_complete' | 'task_failed' | 'checkpoint_reached' | 'checkpoint_decision' | 'verification_passed' | 'verification_failed' | 'file_modified' | 'error_encountered' | 'solution_applied' | 'execution_start' | 'execution_complete' | 'execution_paused';
3870
+ /**
3871
+ * Observable event structure
3872
+ */
3873
+ interface ObservableEvent {
3874
+ type: ObservableEventType;
3875
+ timestamp: string;
3876
+ skillName?: string;
3877
+ taskId?: string;
3878
+ taskName?: string;
3879
+ taskAction?: string;
3880
+ files?: string[];
3881
+ error?: string;
3882
+ output?: string;
3883
+ decision?: string;
3884
+ context?: string;
3885
+ }
3886
+ /**
3887
+ * Observer configuration
3888
+ */
3889
+ interface MemoryObserverConfig {
3890
+ /** Minimum relevance score to store (0-100) */
3891
+ minRelevance?: number;
3892
+ /** Whether to capture task starts */
3893
+ captureTaskStarts?: boolean;
3894
+ /** Whether to capture checkpoints */
3895
+ captureCheckpoints?: boolean;
3896
+ /** Whether to capture file modifications */
3897
+ captureFileModifications?: boolean;
3898
+ /** Whether to capture errors */
3899
+ captureErrors?: boolean;
3900
+ /** Whether to capture solutions */
3901
+ captureSolutions?: boolean;
3902
+ /** Custom relevance scorer */
3903
+ relevanceScorer?: (event: ObservableEvent) => number;
3904
+ }
3905
+ /**
3906
+ * Memory Observer
3907
+ *
3908
+ * Captures and filters observations during skill execution.
3909
+ */
3910
+ declare class MemoryObserver {
3911
+ private store;
3912
+ private config;
3913
+ private currentAgent;
3914
+ private currentSkillName?;
3915
+ private pendingErrors;
3916
+ constructor(projectPath: string, sessionId?: string, config?: MemoryObserverConfig);
3917
+ /**
3918
+ * Set the current agent being used
3919
+ */
3920
+ setAgent(agent: AgentType): void;
3921
+ /**
3922
+ * Set the current skill being executed
3923
+ */
3924
+ setSkillName(skillName: string): void;
3925
+ /**
3926
+ * Get the underlying observation store
3927
+ */
3928
+ getStore(): ObservationStore;
3929
+ /**
3930
+ * Observe an event and potentially store it
3931
+ */
3932
+ observe(event: ObservableEvent): Observation | null;
3933
+ /**
3934
+ * Create an observation callback for the SkillExecutionEngine
3935
+ */
3936
+ createProgressCallback(): (event: ExecutionProgressEvent) => void;
3937
+ /**
3938
+ * Convert ExecutionProgressEvent to ObservableEvent
3939
+ */
3940
+ private convertProgressEvent;
3941
+ /**
3942
+ * Record a file modification event
3943
+ */
3944
+ recordFileModification(files: string[], context: string): Observation | null;
3945
+ /**
3946
+ * Record an error event
3947
+ */
3948
+ recordError(error: string, context: string, taskId?: string): Observation | null;
3949
+ /**
3950
+ * Record a solution event (potentially matching a previous error)
3951
+ */
3952
+ recordSolution(solution: string, context: string, relatedError?: string): Observation | null;
3953
+ /**
3954
+ * Record a decision event
3955
+ */
3956
+ recordDecision(decision: string, options: string[], context: string): Observation | null;
3957
+ /**
3958
+ * Record execution start
3959
+ */
3960
+ recordExecutionStart(skillName: string, agent: AgentType): Observation | null;
3961
+ /**
3962
+ * Record execution pause
3963
+ */
3964
+ recordExecutionPause(reason?: string): Observation | null;
3965
+ /**
3966
+ * Check if we should capture this event type
3967
+ */
3968
+ private shouldCapture;
3969
+ /**
3970
+ * Classify event into observation type
3971
+ */
3972
+ private classifyEvent;
3973
+ /**
3974
+ * Extract content from event
3975
+ */
3976
+ private extractContent;
3977
+ /**
3978
+ * Get action description from event
3979
+ */
3980
+ private getActionDescription;
3981
+ /**
3982
+ * Generate context if not provided
3983
+ */
3984
+ private generateContext;
3985
+ /**
3986
+ * Generate tags for event
3987
+ */
3988
+ private generateTags;
3989
+ /**
3990
+ * Score relevance of event
3991
+ */
3992
+ private scoreRelevance;
3993
+ /**
3994
+ * Generate a key for matching errors to solutions
3995
+ */
3996
+ private generateErrorKey;
3997
+ /**
3998
+ * Get session ID
3999
+ */
4000
+ getSessionId(): string;
4001
+ /**
4002
+ * Get all observations
4003
+ */
4004
+ getObservations(): Observation[];
4005
+ /**
4006
+ * Get observation count
4007
+ */
4008
+ getObservationCount(): number;
4009
+ /**
4010
+ * Clear all observations
4011
+ */
4012
+ clear(): void;
4013
+ }
4014
+ /**
4015
+ * Create a MemoryObserver instance
4016
+ */
4017
+ declare function createMemoryObserver(projectPath: string, sessionId?: string, config?: MemoryObserverConfig): MemoryObserver;
4018
+
4019
+ /**
4020
+ * Memory-Enabled Execution Engine Integration
4021
+ *
4022
+ * Provides utilities to integrate MemoryObserver with SkillExecutionEngine.
4023
+ */
4024
+
4025
+ /**
4026
+ * Options for creating a memory-enabled execution engine
4027
+ */
4028
+ interface MemoryEnabledEngineOptions {
4029
+ /** Checkpoint handler for interactive checkpoints */
4030
+ checkpointHandler?: CheckpointHandler;
4031
+ /** Additional progress callback (called alongside memory observer) */
4032
+ onProgress?: ExecutionProgressCallback;
4033
+ /** Memory observer configuration */
4034
+ memoryConfig?: MemoryObserverConfig;
4035
+ /** Session ID for the memory observer */
4036
+ sessionId?: string;
4037
+ /** Default agent type */
4038
+ defaultAgent?: AgentType;
4039
+ }
4040
+ /**
4041
+ * Memory-enabled execution engine wrapper
4042
+ */
4043
+ declare class MemoryEnabledEngine {
4044
+ private engine;
4045
+ private observer;
4046
+ private userProgressCallback?;
4047
+ constructor(projectPath: string, options?: MemoryEnabledEngineOptions);
4048
+ /**
4049
+ * Execute a skill with memory observation
4050
+ */
4051
+ execute(skill: ExecutableSkill, options?: ExecutionOptions): ReturnType<SkillExecutionEngine['execute']>;
4052
+ /**
4053
+ * Record a manual error observation
4054
+ */
4055
+ recordError(error: string, context: string, taskId?: string): void;
4056
+ /**
4057
+ * Record a manual solution observation
4058
+ */
4059
+ recordSolution(solution: string, context: string, relatedError?: string): void;
4060
+ /**
4061
+ * Record a file modification observation
4062
+ */
4063
+ recordFileModification(files: string[], context: string): void;
4064
+ /**
4065
+ * Record a decision observation
4066
+ */
4067
+ recordDecision(decision: string, options: string[], context: string): void;
4068
+ /**
4069
+ * Pause execution
4070
+ */
4071
+ pause(): boolean;
4072
+ /**
4073
+ * Check if execution is paused
4074
+ */
4075
+ isPaused(): boolean;
4076
+ /**
4077
+ * Get the memory observer
4078
+ */
4079
+ getObserver(): MemoryObserver;
4080
+ /**
4081
+ * Get the underlying execution engine
4082
+ */
4083
+ getEngine(): SkillExecutionEngine;
4084
+ /**
4085
+ * Get the session manager
4086
+ */
4087
+ getSessionManager(): ReturnType<SkillExecutionEngine['getSessionManager']>;
4088
+ /**
4089
+ * Get observation count
4090
+ */
4091
+ getObservationCount(): number;
4092
+ /**
4093
+ * Get all observations
4094
+ */
4095
+ getObservations(): ReturnType<MemoryObserver['getObservations']>;
4096
+ /**
4097
+ * Clear observations
4098
+ */
4099
+ clearObservations(): void;
4100
+ }
4101
+ /**
4102
+ * Create a memory-enabled execution engine
4103
+ */
4104
+ declare function createMemoryEnabledEngine(projectPath: string, options?: MemoryEnabledEngineOptions): MemoryEnabledEngine;
4105
+ /**
4106
+ * Wrap an existing progress callback with memory observation
4107
+ */
4108
+ declare function wrapProgressCallbackWithMemory(projectPath: string, existingCallback?: ExecutionProgressCallback, memoryConfig?: MemoryObserverConfig, sessionId?: string): {
4109
+ callback: ExecutionProgressCallback;
4110
+ observer: MemoryObserver;
4111
+ };
4112
+
4113
+ /**
4114
+ * Memory Compression Engine
4115
+ *
4116
+ * Compresses raw observations into learnings using either rule-based
4117
+ * extraction or AI-powered compression.
4118
+ */
4119
+
4120
+ /**
4121
+ * Compression result for a single learning
4122
+ */
4123
+ interface CompressedLearning {
4124
+ title: string;
4125
+ content: string;
4126
+ tags: string[];
4127
+ frameworks?: string[];
4128
+ patterns?: string[];
4129
+ importance: number;
4130
+ sourceObservationIds: string[];
4131
+ }
4132
+ /**
4133
+ * Compression result
4134
+ */
4135
+ interface CompressionResult {
4136
+ learnings: CompressedLearning[];
4137
+ processedObservationIds: string[];
4138
+ skippedObservationIds: string[];
4139
+ stats: {
4140
+ inputCount: number;
4141
+ outputCount: number;
4142
+ compressionRatio: number;
4143
+ };
4144
+ }
4145
+ /**
4146
+ * Compression options
4147
+ */
4148
+ interface CompressionOptions {
4149
+ /** Minimum observations to trigger compression */
4150
+ minObservations?: number;
4151
+ /** Maximum learnings to generate per compression */
4152
+ maxLearnings?: number;
4153
+ /** Minimum importance score (1-10) to keep a learning */
4154
+ minImportance?: number;
4155
+ /** Whether to include low-relevance observations */
4156
+ includeLowRelevance?: boolean;
4157
+ /** Custom tags to add to all learnings */
4158
+ additionalTags?: string[];
4159
+ /** Project name for context */
4160
+ projectName?: string;
4161
+ }
4162
+ /**
4163
+ * Compression engine interface
4164
+ */
4165
+ interface CompressionEngine {
4166
+ /**
4167
+ * Compress observations into learnings
4168
+ */
4169
+ compress(observations: Observation[], options?: CompressionOptions): Promise<CompressionResult>;
4170
+ /**
4171
+ * Get the engine type
4172
+ */
4173
+ getType(): 'rule-based' | 'api';
4174
+ }
4175
+ /**
4176
+ * Rule-based compression engine
4177
+ *
4178
+ * Uses heuristics and patterns to extract learnings without AI.
4179
+ */
4180
+ declare class RuleBasedCompressor implements CompressionEngine {
4181
+ getType(): 'rule-based' | 'api';
4182
+ compress(observations: Observation[], options?: CompressionOptions): Promise<CompressionResult>;
4183
+ private groupByType;
4184
+ private extractErrorSolutionPairs;
4185
+ private extractDecisionPatterns;
4186
+ private extractFileChangePatterns;
4187
+ private extractToolUsagePatterns;
4188
+ private generateTitle;
4189
+ private formatErrorSolutionContent;
4190
+ private formatStandaloneErrorContent;
4191
+ private formatSolutionContent;
4192
+ private formatDecisionContent;
4193
+ private formatFileChangeContent;
4194
+ private formatToolUsageContent;
4195
+ private extractTags;
4196
+ private extractFrameworks;
4197
+ private getFilePattern;
4198
+ private getActionType;
4199
+ private hasSimilarKeywords;
4200
+ /**
4201
+ * Check for strong keyword overlap (multiple matching words)
4202
+ * More strict than hasSimilarKeywords - requires at least 2 matching words
4203
+ */
4204
+ private hasStrongKeywordOverlap;
4205
+ }
4206
+ /**
4207
+ * API-based compression engine configuration
4208
+ */
4209
+ interface APICompressionConfig {
4210
+ /** API provider */
4211
+ provider: 'anthropic' | 'openai';
4212
+ /** API key */
4213
+ apiKey: string;
4214
+ /** Model to use */
4215
+ model?: string;
4216
+ /** Maximum tokens for response */
4217
+ maxTokens?: number;
4218
+ }
4219
+ /**
4220
+ * API-based compression engine
4221
+ *
4222
+ * Uses Claude or OpenAI to extract learnings from observations.
4223
+ */
4224
+ declare class APIBasedCompressor implements CompressionEngine {
4225
+ private config;
4226
+ constructor(config: APICompressionConfig);
4227
+ getType(): 'rule-based' | 'api';
4228
+ compress(observations: Observation[], options?: CompressionOptions): Promise<CompressionResult>;
4229
+ private formatObservationsForPrompt;
4230
+ private buildCompressionPrompt;
4231
+ private callAPI;
4232
+ private callAnthropic;
4233
+ private callOpenAI;
4234
+ private parseAPIResponse;
4235
+ }
4236
+ /**
4237
+ * Memory compressor that manages compression and stores results
4238
+ */
4239
+ declare class MemoryCompressor {
4240
+ private engine;
4241
+ private learningStore;
4242
+ private indexStore;
4243
+ private projectName?;
4244
+ constructor(projectPath: string, options?: {
4245
+ engine?: CompressionEngine;
4246
+ scope?: 'project' | 'global';
4247
+ projectName?: string;
4248
+ });
4249
+ /**
4250
+ * Set the compression engine
4251
+ */
4252
+ setEngine(engine: CompressionEngine): void;
4253
+ /**
4254
+ * Compress observations without storing (for dry-run/preview)
4255
+ */
4256
+ compress(observations: Observation[], options?: CompressionOptions): Promise<CompressionResult>;
4257
+ /**
4258
+ * Compress observations and store as learnings
4259
+ */
4260
+ compressAndStore(observations: Observation[], options?: CompressionOptions): Promise<{
4261
+ learnings: Learning[];
4262
+ result: CompressionResult;
4263
+ }>;
4264
+ /**
4265
+ * Get the learning store
4266
+ */
4267
+ getLearningStore(): LearningStore;
4268
+ /**
4269
+ * Get the index store
4270
+ */
4271
+ getIndexStore(): MemoryIndexStore;
4272
+ /**
4273
+ * Get compression engine type
4274
+ */
4275
+ getEngineType(): 'rule-based' | 'api';
4276
+ }
4277
+ /**
4278
+ * Learning consolidator
4279
+ *
4280
+ * Merges similar learnings to reduce redundancy.
4281
+ */
4282
+ declare class LearningConsolidator {
4283
+ /**
4284
+ * Find similar learnings
4285
+ */
4286
+ findSimilar(learnings: Learning[], similarity?: number): Array<[Learning, Learning]>;
4287
+ /**
4288
+ * Merge two similar learnings
4289
+ */
4290
+ merge(learning1: Learning, learning2: Learning): Omit<Learning, 'id' | 'createdAt' | 'updatedAt'>;
4291
+ /**
4292
+ * Consolidate a list of learnings
4293
+ */
4294
+ consolidate(learnings: Learning[], store: LearningStore, index: MemoryIndexStore, similarity?: number): {
4295
+ merged: number;
4296
+ remaining: number;
4297
+ };
4298
+ private calculateSimilarity;
4299
+ private getBetterLearning;
4300
+ private mergeContent;
4301
+ }
4302
+ /**
4303
+ * Create a rule-based compressor
4304
+ */
4305
+ declare function createRuleBasedCompressor(): RuleBasedCompressor;
4306
+ /**
4307
+ * Create an API-based compressor
4308
+ */
4309
+ declare function createAPIBasedCompressor(config: APICompressionConfig): APIBasedCompressor;
4310
+ /**
4311
+ * Create a memory compressor
4312
+ */
4313
+ declare function createMemoryCompressor(projectPath: string, options?: {
4314
+ engine?: CompressionEngine;
4315
+ scope?: 'project' | 'global';
4316
+ projectName?: string;
4317
+ }): MemoryCompressor;
4318
+
4319
+ /**
4320
+ * Memory Injector
4321
+ *
4322
+ * Injects relevant memories into agent context with relevance matching,
4323
+ * agent-specific formatting, and token budgeting.
4324
+ */
4325
+
4326
+ /**
4327
+ * Injection options
4328
+ */
4329
+ interface InjectionOptions {
4330
+ /** Maximum tokens to use for injected memories */
4331
+ maxTokens?: number;
4332
+ /** Minimum relevance score to include (0-100) */
4333
+ minRelevance?: number;
4334
+ /** Maximum number of learnings to inject */
4335
+ maxLearnings?: number;
4336
+ /** Include global memories */
4337
+ includeGlobal?: boolean;
4338
+ /** Specific tags to match */
4339
+ tags?: string[];
4340
+ /** Current task description for relevance matching */
4341
+ currentTask?: string;
4342
+ /** Progressive disclosure level */
4343
+ disclosureLevel?: 'summary' | 'preview' | 'full';
4344
+ }
4345
+ /**
4346
+ * Injected memory with relevance score
4347
+ */
4348
+ interface InjectedMemory {
4349
+ learning: Learning;
4350
+ relevanceScore: number;
4351
+ matchedBy: {
4352
+ frameworks: string[];
4353
+ tags: string[];
4354
+ keywords: string[];
4355
+ patterns: string[];
4356
+ };
4357
+ tokenEstimate: number;
4358
+ }
4359
+ /**
4360
+ * Injection result
4361
+ */
4362
+ interface InjectionResult {
4363
+ memories: InjectedMemory[];
4364
+ formattedContent: string;
4365
+ totalTokens: number;
4366
+ stats: {
4367
+ considered: number;
4368
+ matched: number;
4369
+ injected: number;
4370
+ truncated: number;
4371
+ };
4372
+ }
4373
+ /**
4374
+ * Memory Injector
4375
+ *
4376
+ * Retrieves and formats relevant memories for injection into agent context.
4377
+ */
4378
+ declare class MemoryInjector {
4379
+ private projectStore;
4380
+ private globalStore;
4381
+ private projectContext?;
4382
+ constructor(projectPath: string, projectName?: string, projectContext?: ProjectContext);
4383
+ /**
4384
+ * Set project context for better relevance matching
4385
+ */
4386
+ setProjectContext(context: ProjectContext): void;
4387
+ /**
4388
+ * Get relevant memories for injection
4389
+ */
4390
+ getRelevantMemories(options?: InjectionOptions): Promise<InjectedMemory[]>;
4391
+ /**
4392
+ * Score a learning for relevance to current context
4393
+ */
4394
+ private scoreLearning;
4395
+ /**
4396
+ * Extract framework names from project context
4397
+ */
4398
+ private extractFrameworkNames;
4399
+ /**
4400
+ * Extract keywords from text
4401
+ */
4402
+ private extractKeywords;
4403
+ /**
4404
+ * Calculate days since a date
4405
+ */
4406
+ private daysSince;
4407
+ /**
4408
+ * Estimate tokens for a learning
4409
+ */
4410
+ private estimateTokens;
4411
+ /**
4412
+ * Inject memories and return formatted content
4413
+ */
4414
+ inject(options?: InjectionOptions): Promise<InjectionResult>;
4415
+ /**
4416
+ * Inject memories formatted for a specific agent
4417
+ */
4418
+ injectForAgent(agent: AgentType, options?: InjectionOptions): Promise<InjectionResult>;
4419
+ /**
4420
+ * Format memories for display
4421
+ */
4422
+ private formatMemories;
4423
+ /**
4424
+ * Format memories for a specific agent
4425
+ */
4426
+ formatForAgent(memories: InjectedMemory[], agent: AgentType, level?: 'summary' | 'preview' | 'full'): string;
4427
+ /**
4428
+ * Format memories for Claude (XML tags)
4429
+ */
4430
+ private formatForClaude;
4431
+ /**
4432
+ * Format memories for Cursor (.mdc format)
4433
+ */
4434
+ private formatForCursor;
4435
+ /**
4436
+ * Format memories for Copilot/Codex (concise markdown)
4437
+ */
4438
+ private formatForCopilot;
4439
+ /**
4440
+ * Escape XML special characters
4441
+ */
4442
+ private escapeXml;
4443
+ /**
4444
+ * Get memory summaries (for progressive disclosure)
4445
+ */
4446
+ getSummaries(options?: InjectionOptions): MemorySummary[];
4447
+ /**
4448
+ * Get memory previews (for progressive disclosure)
4449
+ */
4450
+ getPreviews(ids: string[], options?: InjectionOptions): MemoryPreview[];
4451
+ /**
4452
+ * Get full memories (for progressive disclosure)
4453
+ */
4454
+ getFullMemories(ids: string[], options?: InjectionOptions): MemoryFull[];
4455
+ /**
4456
+ * Search memories by query
4457
+ */
4458
+ search(query: string, options?: InjectionOptions): InjectedMemory[];
4459
+ }
4460
+ /**
4461
+ * Create a MemoryInjector instance
4462
+ */
4463
+ declare function createMemoryInjector(projectPath: string, projectName?: string, projectContext?: ProjectContext): MemoryInjector;
4464
+
4465
+ /**
4466
+ * Team Collaboration Types
4467
+ */
4468
+
4469
+ /**
4470
+ * Team member information
4471
+ */
4472
+ interface TeamMember {
4473
+ id: string;
4474
+ name: string;
4475
+ email?: string;
4476
+ role: 'admin' | 'contributor' | 'viewer';
4477
+ joinedAt: string;
4478
+ }
4479
+ /**
4480
+ * Shared skill metadata
4481
+ */
4482
+ interface SharedSkill {
4483
+ name: string;
4484
+ version: string;
4485
+ description?: string;
4486
+ author: string;
4487
+ sharedAt: string;
4488
+ updatedAt: string;
4489
+ source: string;
4490
+ tags?: string[];
4491
+ agents: AgentType[];
4492
+ downloads?: number;
4493
+ rating?: number;
4494
+ }
4495
+ /**
4496
+ * Team configuration
4497
+ */
4498
+ interface TeamConfig {
4499
+ /** Team identifier */
4500
+ teamId: string;
4501
+ /** Team name */
4502
+ teamName: string;
4503
+ /** Team registry URL (git repo or registry endpoint) */
4504
+ registryUrl: string;
4505
+ /** Authentication method */
4506
+ auth?: {
4507
+ type: 'token' | 'ssh' | 'none';
4508
+ token?: string;
4509
+ keyPath?: string;
4510
+ };
4511
+ /** Auto-sync interval in minutes (0 = disabled) */
4512
+ autoSyncInterval?: number;
4513
+ /** Members list (for admin features) */
4514
+ members?: TeamMember[];
4515
+ }
4516
+ /**
4517
+ * Team registry containing shared skills
4518
+ */
4519
+ interface TeamRegistry {
4520
+ version: number;
4521
+ teamId: string;
4522
+ teamName: string;
4523
+ skills: SharedSkill[];
4524
+ updatedAt: string;
4525
+ createdAt: string;
4526
+ }
4527
+ /**
4528
+ * Bundle manifest for exporting skills
4529
+ */
4530
+ interface BundleManifest {
4531
+ version: number;
4532
+ name: string;
4533
+ description?: string;
4534
+ author: string;
4535
+ createdAt: string;
4536
+ skills: {
4537
+ name: string;
4538
+ path: string;
4539
+ agents: AgentType[];
4540
+ }[];
4541
+ totalSize: number;
4542
+ }
4543
+ /**
4544
+ * Options for sharing a skill
4545
+ */
4546
+ interface ShareOptions {
4547
+ /** Skill name to share */
4548
+ skillName: string;
4549
+ /** Description override */
4550
+ description?: string;
4551
+ /** Tags to add */
4552
+ tags?: string[];
4553
+ /** Target agents (default: all compatible) */
4554
+ agents?: AgentType[];
4555
+ /** Visibility level */
4556
+ visibility?: 'team' | 'public';
4557
+ }
4558
+ /**
4559
+ * Options for importing skills
4560
+ */
4561
+ interface ImportOptions {
4562
+ /** Overwrite existing skills */
4563
+ overwrite?: boolean;
4564
+ /** Target agents to install for */
4565
+ agents?: AgentType[];
4566
+ /** Dry run mode */
4567
+ dryRun?: boolean;
4568
+ }
4569
+
4570
+ /**
4571
+ * Team Manager
4572
+ *
4573
+ * Manages team skill sharing and collaboration
4574
+ */
4575
+
4576
+ /**
4577
+ * Team Manager for collaboration features
4578
+ */
4579
+ declare class TeamManager {
4580
+ private projectPath;
4581
+ private config;
4582
+ private registry;
4583
+ constructor(projectPath: string);
4584
+ /**
4585
+ * Initialize team configuration
4586
+ */
4587
+ init(config: Omit<TeamConfig, 'teamId'>): Promise<TeamConfig>;
4588
+ /**
4589
+ * Load existing team configuration
4590
+ */
4591
+ load(): TeamConfig | null;
4592
+ /**
4593
+ * Get current config
4594
+ */
4595
+ getConfig(): TeamConfig | null;
4596
+ /**
4597
+ * Get current registry
4598
+ */
4599
+ getRegistry(): TeamRegistry | null;
4600
+ /**
4601
+ * Share a skill to the team registry
4602
+ */
4603
+ shareSkill(options: ShareOptions): Promise<SharedSkill>;
4604
+ /**
4605
+ * List all shared skills in the team registry
4606
+ */
4607
+ listSharedSkills(): SharedSkill[];
4608
+ /**
4609
+ * Search shared skills
4610
+ */
4611
+ searchSkills(query: string): SharedSkill[];
4612
+ /**
4613
+ * Import a shared skill from the team registry
4614
+ */
4615
+ importSkill(skillName: string, options?: ImportOptions): Promise<{
4616
+ success: boolean;
4617
+ path?: string;
4618
+ error?: string;
4619
+ }>;
4620
+ /**
4621
+ * Sync with remote registry
4622
+ */
4623
+ sync(): Promise<{
4624
+ added: string[];
4625
+ updated: string[];
4626
+ removed: string[];
4627
+ }>;
4628
+ /**
4629
+ * Remove a skill from the team registry
4630
+ */
4631
+ removeSkill(skillName: string): boolean;
4632
+ private generateTeamId;
4633
+ private saveConfig;
4634
+ private loadRegistry;
4635
+ private saveRegistry;
4636
+ private findLocalSkill;
4637
+ private getAuthor;
4638
+ private detectCompatibleAgents;
4639
+ private extractFrontmatter;
4640
+ private parseYaml;
4641
+ private toYaml;
4642
+ }
4643
+ /**
4644
+ * Create a team manager instance
4645
+ */
4646
+ declare function createTeamManager(projectPath: string): TeamManager;
4647
+
4648
+ /**
4649
+ * Skill Bundle
4650
+ *
4651
+ * Package multiple skills into a shareable bundle
4652
+ */
4653
+
4654
+ /**
4655
+ * Skill Bundle class for creating and managing skill bundles
4656
+ */
4657
+ declare class SkillBundle {
4658
+ private manifest;
4659
+ private skills;
4660
+ constructor(name: string, author: string, description?: string);
4661
+ /**
4662
+ * Add a skill to the bundle
4663
+ */
4664
+ addSkill(skillPath: string, agents?: AgentType[]): void;
4665
+ /**
4666
+ * Remove a skill from the bundle
4667
+ */
4668
+ removeSkill(skillName: string): boolean;
4669
+ /**
4670
+ * Get bundle manifest
4671
+ */
4672
+ getManifest(): BundleManifest;
4673
+ /**
4674
+ * Get all skill names in bundle
4675
+ */
4676
+ getSkillNames(): string[];
4677
+ /**
4678
+ * Get skill content by name
4679
+ */
4680
+ getSkillContent(skillName: string): string | undefined;
4681
+ /**
4682
+ * Calculate bundle checksum
4683
+ */
4684
+ getChecksum(): string;
4685
+ private readSkillContent;
4686
+ private detectAgents;
4687
+ }
4688
+ /**
4689
+ * Create a new skill bundle
4690
+ */
4691
+ declare function createSkillBundle(name: string, author: string, description?: string): SkillBundle;
4692
+ /**
4693
+ * Export a bundle to a file
4694
+ */
4695
+ declare function exportBundle(bundle: SkillBundle, outputPath: string): {
4696
+ success: boolean;
4697
+ path?: string;
4698
+ error?: string;
4699
+ };
4700
+ /**
4701
+ * Import a bundle from a file
4702
+ */
4703
+ declare function importBundle(bundlePath: string, targetDir: string, options?: {
4704
+ overwrite?: boolean;
4705
+ }): {
4706
+ success: boolean;
4707
+ imported: string[];
4708
+ errors: string[];
4709
+ };
4710
+
4711
+ /**
4712
+ * Plugin System Types
4713
+ */
4714
+
4715
+ /**
4716
+ * Plugin metadata
4717
+ */
4718
+ interface PluginMetadata {
4719
+ /** Unique plugin identifier */
4720
+ name: string;
4721
+ /** Plugin version (semver) */
4722
+ version: string;
4723
+ /** Human-readable description */
4724
+ description?: string;
4725
+ /** Plugin author */
4726
+ author?: string;
4727
+ /** Plugin homepage or repository URL */
4728
+ homepage?: string;
4729
+ /** Required SkillKit version */
4730
+ skillkitVersion?: string;
4731
+ /** Plugin dependencies */
4732
+ dependencies?: string[];
4733
+ /** Plugin keywords for discovery */
4734
+ keywords?: string[];
4735
+ }
4736
+ /**
4737
+ * Plugin lifecycle hooks
4738
+ */
4739
+ interface PluginHooks {
4740
+ /** Called when a skill is installed */
4741
+ onSkillInstall?: (skill: CanonicalSkill, agent: AgentType) => Promise<void>;
4742
+ /** Called when a skill is removed */
4743
+ onSkillRemove?: (skillName: string, agent: AgentType) => Promise<void>;
4744
+ /** Called when skills are synced */
4745
+ onSync?: (agents: AgentType[]) => Promise<void>;
4746
+ /** Called before translation */
4747
+ beforeTranslate?: (skill: CanonicalSkill, targetAgent: AgentType) => Promise<CanonicalSkill>;
4748
+ /** Called after translation */
4749
+ afterTranslate?: (content: string, targetAgent: AgentType) => Promise<string>;
4750
+ /** Called when plugin is loaded */
4751
+ onLoad?: (context: PluginContext) => Promise<void>;
4752
+ /** Called when plugin is unloaded */
4753
+ onUnload?: () => Promise<void>;
4754
+ }
4755
+ /**
4756
+ * Translator plugin - adds support for new agent formats
4757
+ */
4758
+ interface TranslatorPlugin {
4759
+ type: 'translator';
4760
+ /** Agent type this translator handles */
4761
+ agentType: AgentType | string;
4762
+ /** The translator implementation */
4763
+ translator: FormatTranslator;
4764
+ }
4765
+ /**
4766
+ * Provider plugin - adds support for new skill sources
4767
+ */
4768
+ interface ProviderPlugin {
4769
+ type: 'provider';
4770
+ /** Provider name (e.g., 'bitbucket', 's3') */
4771
+ providerName: string;
4772
+ /** The provider implementation */
4773
+ provider: GitProviderAdapter;
4774
+ }
4775
+ /**
4776
+ * Command plugin - adds new CLI commands
4777
+ */
4778
+ interface CommandPlugin {
4779
+ type: 'command';
4780
+ /** Command name */
4781
+ name: string;
4782
+ /** Command aliases */
4783
+ aliases?: string[];
4784
+ /** Command description */
4785
+ description: string;
4786
+ /** Command options */
4787
+ options?: Array<{
4788
+ name: string;
4789
+ description: string;
4790
+ type: 'string' | 'boolean' | 'number';
4791
+ required?: boolean;
4792
+ default?: unknown;
4793
+ }>;
4794
+ /** Command handler */
4795
+ handler: (args: Record<string, unknown>, context: PluginContext) => Promise<number>;
4796
+ }
4797
+ /**
4798
+ * Plugin context passed to plugins
4799
+ */
4800
+ interface PluginContext {
4801
+ /** Project path */
4802
+ projectPath: string;
4803
+ /** SkillKit version */
4804
+ skillkitVersion: string;
4805
+ /** Plugin configuration */
4806
+ config: PluginConfig;
4807
+ /** Logger instance */
4808
+ log: {
4809
+ info: (message: string) => void;
4810
+ warn: (message: string) => void;
4811
+ error: (message: string) => void;
4812
+ debug: (message: string) => void;
4813
+ };
4814
+ /** Get a registered translator by agent type */
4815
+ getTranslator: (agentType: AgentType) => FormatTranslator | undefined;
4816
+ /** Get a registered provider by name */
4817
+ getProvider: (name: string) => GitProviderAdapter | undefined;
4818
+ }
4819
+ /**
4820
+ * Plugin configuration
4821
+ */
4822
+ interface PluginConfig {
4823
+ /** Plugin-specific settings */
4824
+ settings?: Record<string, unknown>;
4825
+ /** Whether plugin is enabled */
4826
+ enabled?: boolean;
4827
+ }
4828
+ /**
4829
+ * Main plugin interface
4830
+ */
4831
+ interface Plugin {
4832
+ /** Plugin metadata */
4833
+ metadata: PluginMetadata;
4834
+ /** Plugin hooks */
4835
+ hooks?: PluginHooks;
4836
+ /** Translator extensions */
4837
+ translators?: TranslatorPlugin[];
4838
+ /** Provider extensions */
4839
+ providers?: ProviderPlugin[];
4840
+ /** Command extensions */
4841
+ commands?: CommandPlugin[];
4842
+ /** Plugin initialization */
4843
+ init?: (context: PluginContext) => Promise<void>;
4844
+ /** Plugin cleanup */
4845
+ destroy?: () => Promise<void>;
4846
+ }
4847
+
4848
+ /**
4849
+ * Plugin Manager
4850
+ *
4851
+ * Manages plugin registration, lifecycle, and execution
4852
+ */
4853
+
4854
+ /**
4855
+ * Plugin Manager class
4856
+ */
4857
+ declare class PluginManager {
4858
+ private projectPath;
4859
+ private plugins;
4860
+ private translators;
4861
+ private providers;
4862
+ private commands;
4863
+ private hooks;
4864
+ private state;
4865
+ private context;
4866
+ constructor(projectPath: string);
4867
+ /**
4868
+ * Register a plugin
4869
+ */
4870
+ register(plugin: Plugin): Promise<void>;
4871
+ /**
4872
+ * Unregister a plugin
4873
+ */
4874
+ unregister(name: string): Promise<void>;
4875
+ /**
4876
+ * Get a registered plugin
4877
+ */
4878
+ getPlugin(name: string): Plugin | undefined;
4879
+ /**
4880
+ * Get all registered plugins
4881
+ */
4882
+ getAllPlugins(): Plugin[];
4883
+ /**
4884
+ * Get plugin metadata for all plugins
4885
+ */
4886
+ listPlugins(): PluginMetadata[];
4887
+ /**
4888
+ * Get a translator by agent type
4889
+ */
4890
+ getTranslator(agentType: AgentType | string): FormatTranslator | undefined;
4891
+ /**
4892
+ * Get all registered translators
4893
+ */
4894
+ getAllTranslators(): Map<string, FormatTranslator>;
4895
+ /**
4896
+ * Get a provider by name
4897
+ */
4898
+ getProvider(name: string): GitProviderAdapter | undefined;
4899
+ /**
4900
+ * Get all registered providers
4901
+ */
4902
+ getAllProviders(): Map<string, GitProviderAdapter>;
4903
+ /**
4904
+ * Get a command by name
4905
+ */
4906
+ getCommand(name: string): CommandPlugin | undefined;
4907
+ /**
4908
+ * Get all registered commands
4909
+ */
4910
+ getAllCommands(): CommandPlugin[];
4911
+ /**
4912
+ * Execute hooks for an event
4913
+ */
4914
+ executeHook<K extends keyof PluginHooks>(hookName: K, ...args: Parameters<NonNullable<PluginHooks[K]>>): Promise<void>;
4915
+ /**
4916
+ * Execute beforeTranslate hooks (returns transformed skill)
4917
+ */
4918
+ executeBeforeTranslate(skill: CanonicalSkill, targetAgent: AgentType): Promise<CanonicalSkill>;
4919
+ /**
4920
+ * Execute afterTranslate hooks (returns transformed content)
4921
+ */
4922
+ executeAfterTranslate(content: string, targetAgent: AgentType): Promise<string>;
4923
+ /**
4924
+ * Set plugin configuration
4925
+ */
4926
+ setPluginConfig(name: string, config: PluginConfig): void;
4927
+ /**
4928
+ * Get plugin configuration
4929
+ */
4930
+ getPluginConfig(name: string): PluginConfig | undefined;
4931
+ /**
4932
+ * Enable a plugin
4933
+ */
4934
+ enablePlugin(name: string): void;
4935
+ /**
4936
+ * Disable a plugin
4937
+ */
4938
+ disablePlugin(name: string): void;
4939
+ /**
4940
+ * Check if plugin is enabled
4941
+ */
4942
+ isPluginEnabled(name: string): boolean;
4943
+ private loadState;
4944
+ private saveState;
4945
+ private createContext;
4946
+ }
4947
+ /**
4948
+ * Create a plugin manager instance
4949
+ */
4950
+ declare function createPluginManager(projectPath: string): PluginManager;
4951
+
4952
+ /**
4953
+ * Plugin Loader
4954
+ *
4955
+ * Loads plugins from various sources:
4956
+ * - Local files
4957
+ * - npm packages
4958
+ * - Git repositories
4959
+ */
4960
+
4961
+ /**
4962
+ * Plugin Loader class
4963
+ */
4964
+ declare class PluginLoader {
4965
+ /**
4966
+ * Load a plugin from a file path
4967
+ */
4968
+ loadFromFile(filePath: string): Promise<Plugin>;
4969
+ /**
4970
+ * Load a plugin from an npm package
4971
+ */
4972
+ loadFromPackage(packageName: string): Promise<Plugin>;
4973
+ /**
4974
+ * Load a plugin from a JSON definition (for simple plugins)
4975
+ */
4976
+ loadFromJson(jsonPath: string): Plugin;
4977
+ /**
4978
+ * Scan a directory for plugins
4979
+ */
4980
+ scanDirectory(dirPath: string): Promise<PluginMetadata[]>;
4981
+ /**
4982
+ * Validate a plugin structure
4983
+ */
4984
+ private validatePlugin;
4985
+ }
4986
+ /**
4987
+ * Load a plugin from a file
4988
+ */
4989
+ declare function loadPlugin(source: string): Promise<Plugin>;
4990
+ /**
4991
+ * Load all plugins from a directory
4992
+ */
4993
+ declare function loadPluginsFromDirectory(dirPath: string): Promise<Plugin[]>;
4994
+
4995
+ export { AGENT_CLI_CONFIGS, AGENT_FORMAT_MAP, APIBasedCompressor, type APICompressionConfig, type AgentAdapterInfo, type AgentCLIConfig, AgentConfig, type AgentExecutionResult, AgentType, type AssertionResult, BitbucketProvider, type BundleManifest, CIRCLECI_CONFIG_TEMPLATE, CONTEXT_DIR, CONTEXT_FILE, type CanonicalSkill, type CheckpointHandler, type CheckpointResponse, type CloneOptions, type CloneResult, type CommandPlugin, type CommandResult, type CompressedLearning, type CompressionEngine, type CompressionOptions, type CompressionResult, type ContextCategory, type ContextExportOptions, type ContextImportOptions, type ContextLoadOptions, ContextLoader, ContextManager, ContextSync, type ContextSyncOptions, CopilotTranslator, type CurrentExecution, CursorTranslator, DEFAULT_CACHE_TTL, DEFAULT_CONTEXT_CATEGORIES, DEFAULT_MEMORY_CONFIG, DEFAULT_SCORING_WEIGHTS, DEFAULT_SKILL_SOURCES, DependencyInfo, Detection, type DetectionSource, type DiscoveredSkill, type ExecutableSkill, type ExecutableTask, type ExecutableTaskType, type ExecutionHistory, type ExecutionOptions, type ExecutionProgressCallback, type ExecutionProgressEvent, type ExecutionStrategy, type ExecutionTaskStatus, type FormatCategory, type FormatTranslator, type FreshnessResult, GITHUB_ACTION_TEMPLATE, GITLAB_CI_TEMPLATE, GitHubProvider, GitLabProvider, GitProvider, type GitProviderAdapter, INDEX_CACHE_HOURS, INDEX_PATH, type ImportOptions, type IndexSource, type InjectedMemory, type InjectionOptions, type InjectionResult, type InstallOptions, KNOWN_SKILL_REPOS, type Learning, LearningConsolidator, LearningStore, type LearningStoreData, type LoadedContext, LocalProvider, MARKETPLACE_CACHE_FILE, MarketplaceAggregator, type MarketplaceConfig, type MarketplaceIndex, type MarketplaceSearchOptions, type MarketplaceSearchResult, type MarketplaceSkill, type MatchCategory, type MatchReason, MemoryCompressor, type MemoryConfig, MemoryEnabledEngine, type MemoryEnabledEngineOptions, type MemoryFull, type MemoryIndex, MemoryIndexStore, MemoryInjector, MemoryObserver, type MemoryObserverConfig, type MemoryPaths, type MemoryPreview, type MemorySearchOptions, type MemorySearchResult, type MemoryStatus, type MemorySummary, type ObservableEvent, type ObservableEventType, type Observation, type ObservationContent, ObservationStore, type ObservationStoreData, type ObservationType, PRE_COMMIT_CONFIG_TEMPLATE, PRE_COMMIT_HOOK_TEMPLATE, PROJECT_TYPE_HINTS, type Plugin, type PluginConfig, type PluginContext, type PluginHooks, PluginLoader, PluginManager, type PluginMetadata, ProjectContext, ProjectDetector, ProjectPatterns, type ProjectProfile, ProjectStack, type ProviderPlugin, type RecommendOptions, RecommendationEngine, type RecommendationResult, type RegistrySkill, RuleBasedCompressor, SESSION_FILE, SKILL_DISCOVERY_PATHS, type ScoredSkill, type ScoringWeights, type SearchOptions, type SearchResult, type SessionDecision, SessionManager, type SessionState, type SessionTask, type ShareOptions, type SharedSkill, Skill, SkillBundle, SkillExecutionEngine, type SkillExecutionEvent, type SkillExecutionResult, type SkillExecutor, type SkillExecutorOptions, SkillFrontmatter, type SkillIndex, SkillLocation, SkillMdTranslator, SkillMetadata, SkillPreferences, type SkillSource, SkillSummary, type SkillTestCase, type SkillTestSuite, SkillkitConfig, type SyncOptions, type SyncReport, type SyncResult, TAG_TO_TECH, type TaskExecutionResult, type TaskStatus, type TeamConfig, TeamManager, type TeamMember, type TeamRegistry, type TestAssertion, type TestAssertionType, type TestCaseResult, type TestProgressEvent, type TestRunnerOptions, type TestSuiteResult, TranslatableSkillFrontmatter, type TranslationOptions, type TranslationPath, type TranslationResult, type TranslatorPlugin, TranslatorRegistry, type UpdateOptions, type VerificationRule, WORKFLOWS_DIR, WORKFLOW_EXTENSION, type WaveExecutionStatus, WindsurfTranslator, type Workflow, type WorkflowExecution, type WorkflowExecutionStatus, WorkflowOrchestrator, type WorkflowProgressCallback, type WorkflowSkill, type WorkflowWave, analyzeProject, buildSkillIndex, canTranslate, copilotTranslator, createAPIBasedCompressor, createContextLoader, createContextManager, createContextSync, createExecutionEngine, createMarketplaceAggregator, createMemoryCompressor, createMemoryEnabledEngine, createMemoryInjector, createMemoryObserver, createPluginManager, createRecommendationEngine, createRuleBasedCompressor, createSessionManager, createSimulatedSkillExecutor, createSkillBundle, createSkillExecutor, createTeamManager, createTestSuiteFromFrontmatter, createWorkflowOrchestrator, createWorkflowTemplate, cursorTranslator, detectProvider, detectSkillFormat, discoverSkills, estimateTokens, executeWithAgent, exportBundle, extractField, extractFrontmatter, fetchSkillsFromRepo, findAllSkills, findSkill, formatSkillAsPrompt, getAgentCLIConfig, getAgentConfigPath, getAllProviders, getAvailableCLIAgents, getCICDTemplate, getExecutionStrategy, getGlobalConfigPath, getIndexStatus, getInstallDir, getManualExecutionInstructions, getMemoryPaths, getMemoryStatus, getProjectConfigPath, getProvider, getSearchDirs, getStackTags, getSupportedTranslationAgents, getTechTags, globalMemoryDirectoryExists, importBundle, initContext, initProject, initializeMemoryDirectory, isAgentCLIAvailable, isGitUrl, isIndexStale, isLocalPath, isPathInside, listCICDTemplates, listWorkflows, loadConfig, loadContext, loadIndex, loadMetadata, loadPlugin, loadPluginsFromDirectory, loadSkillMetadata, loadWorkflow, loadWorkflowByName, memoryDirectoryExists, parseShorthand, parseSkill, parseSkillContent, parseSource, parseWorkflow, readSkillContent, runTestSuite, saveConfig, saveIndex, saveSkillMetadata, saveWorkflow, serializeWorkflow, setSkillEnabled, skillMdTranslator, syncToAgent, syncToAllAgents, translateSkill, translateSkillFile, translatorRegistry, validateSkill, validateWorkflow, windsurfTranslator, wrapProgressCallbackWithMemory };