@skillkit/core 1.11.0 → 1.12.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 +125 -1
- package/dist/index.js +371 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10703,6 +10703,27 @@ declare class HybridSearchPipeline {
|
|
|
10703
10703
|
declare function createHybridSearchPipeline(config?: Partial<LocalModelConfig>): HybridSearchPipeline;
|
|
10704
10704
|
declare function hybridSearch(skills: SkillSummary[], query: string, options?: Partial<HybridSearchOptions>): Promise<HybridSearchResponse>;
|
|
10705
10705
|
|
|
10706
|
+
interface ParsedEntry {
|
|
10707
|
+
name: string;
|
|
10708
|
+
url: string;
|
|
10709
|
+
description: string;
|
|
10710
|
+
category: string;
|
|
10711
|
+
}
|
|
10712
|
+
declare class CommunityRegistry implements ExternalRegistry {
|
|
10713
|
+
private skillsMdPath?;
|
|
10714
|
+
name: string;
|
|
10715
|
+
private entries;
|
|
10716
|
+
private loaded;
|
|
10717
|
+
constructor(skillsMdPath?: string | undefined);
|
|
10718
|
+
private load;
|
|
10719
|
+
private parse;
|
|
10720
|
+
search(query: string, options?: {
|
|
10721
|
+
limit?: number;
|
|
10722
|
+
}): Promise<ExternalSkill[]>;
|
|
10723
|
+
getAll(): ParsedEntry[];
|
|
10724
|
+
getCategories(): string[];
|
|
10725
|
+
}
|
|
10726
|
+
|
|
10706
10727
|
interface ExternalSkill {
|
|
10707
10728
|
name: string;
|
|
10708
10729
|
description: string;
|
|
@@ -10736,6 +10757,7 @@ declare class GitHubSkillRegistry implements ExternalRegistry {
|
|
|
10736
10757
|
timeoutMs?: number;
|
|
10737
10758
|
}): Promise<ExternalSkill[]>;
|
|
10738
10759
|
}
|
|
10760
|
+
|
|
10739
10761
|
declare class FederatedSearch {
|
|
10740
10762
|
private registries;
|
|
10741
10763
|
addRegistry(registry: ExternalRegistry): void;
|
|
@@ -10744,4 +10766,106 @@ declare class FederatedSearch {
|
|
|
10744
10766
|
}): Promise<FederatedResult>;
|
|
10745
10767
|
}
|
|
10746
10768
|
|
|
10747
|
-
export { AGENT_CLI_CONFIGS, AGENT_CONFIG, AGENT_DISCOVERY_PATHS, AGENT_FORMAT_MAP, AGENT_INSTRUCTION_TEMPLATES, AGENT_SKILL_FORMATS, type AIConfig, type AIGenerateOptions, AIManager, type AIProvider, AISearch, type AISearchOptions, type AISearchResult, AISkillGenerator, ALL_AGENT_DISCOVERY_PATHS, APIBasedCompressor, type APICompressionConfig, type ActivatedSkill, type AdvancedScore, type AgentAdapterInfo, type AgentCLIConfig, type AgentCommandFormat, AgentConfig, type AgentDirectoryConfig, type AgentExecutionResult, type AgentFormatCategory, AgentFrontmatter, AgentHook, type AgentHookFormat, type AgentInstance, type AgentInstructionTemplate, AgentLocation, AgentMetadata, AgentPermissionMode, type AgentPipeline, type AgentSkillFormat, type AgentStatus, type AgentTranslationOptions, type AgentTranslationResult, AgentType, type AssertionResult, type AuditEvent, type AuditEventType, type AuditExportOptions, AuditLogger, type AuditQuery, type AuditStats, BUILTIN_PIPELINES, BaseAIProvider, type BenchmarkResult, BitbucketProvider, type BundleManifest, CATEGORY_RELEVANCE_PROMPT, CATEGORY_TAXONOMY, CIConfig, CIRCLECI_CONFIG_TEMPLATE, CONTEXT_DIR, CONTEXT_FILE, CUSTOM_AGENT_FORMAT_MAP, type CanonicalAgent, type CanonicalSkill, type CategoryMapping, type CategoryScore, type CategoryStats, type CheckpointHandler, type CheckpointResponse, type ClarityScore, type CloneOptions, type CloneResult, CodeConvention, type CommandArg, type CommandBundle, type CommandContext, type CommandEvent, type CommandEventListener, CommandGenerator, type CommandGeneratorOptions, type CommandHandler, type CommandPlugin, CommandRegistry, type CommandRegistryOptions, type CommandResult, type CommandSearchOptions, type CommandValidationResult, type CompletenessResult, type CompressedLearning, type CompressionEngine, type CompressionOptions, type CompressionResult, type ConnectorAnalysis, type ConnectorCategory, ConnectorCategorySchema, type ConnectorConfig, ConnectorConfigSchema, type ConnectorMapping, ConnectorMappingSchema, type ConnectorPlaceholder, ConnectorPlaceholderSchema, type ContextCategory, type ContextExportOptions, type ContextImportOptions, type ContextLoadOptions, ContextLoader, ContextManager, ContextSync, type ContextSyncOptions, CopilotTranslator, type CrossAgentSkill, type CurrentExecution, CursorTranslator, type CustomAgent, DEFAULT_CACHE_TTL, DEFAULT_CHUNKING_CONFIG, DEFAULT_CONTEXT_CATEGORIES, DEFAULT_GUIDELINE_CONFIG, DEFAULT_HYBRID_CONFIG, DEFAULT_LEARNING_CONFIG, DEFAULT_MEMORY_CONFIG, DEFAULT_PROFILE_CONFIG, DEFAULT_REASONING_CONFIG, DEFAULT_SCORING_WEIGHTS, DEFAULT_SKILL_SOURCES, DependencyInfo, Detection, type DetectionSource, type DiscoveredSkill, DockerConfig, EXPLANATION_PROMPT, EmbeddingService, type EmbeddingServiceStats, EnvConfig, type EvolvingPattern, type ExecutableSkill, type ExecutableTask, type ExecutableTaskType, type ExecutionContext, type ExecutionFlow, type ExecutionFlowConfig, ExecutionFlowSchema, type ExecutionHistory, ExecutionManager, type ExecutionMode, type ExecutionModeConfig, type ExecutionOptions, type ExecutionProgressCallback, type ExecutionProgressEvent, type ExecutionStep, ExecutionStepSchema, type ExecutionStepStatus, ExecutionStepStatusSchema, type ExecutionStrategy, type ExecutionTaskStatus, type ExpandedQuery, type ExplainedMatch, type ExplainedMatchDetails, type ExplainedRecommendation, type ExplainedScoredSkill, type ExternalRegistry, type ExternalSkill, type FederatedResult, FederatedSearch, type FeedbackResult, type FlowMetrics, type FlowSummary, type FormatCategory, type FormatTranslator, type FreshnessResult, GITHUB_ACTION_TEMPLATE, GITLAB_CI_TEMPLATE, type GenerateOptions, type GeneratedInstruction, type GeneratedSkill, type GitAnalysisOptions, type GitAnalysisResult, type GitAnalysisSummary, type GitCommit, type GitFileChange, GitHubProvider, GitHubSkillRegistry, GitLabProvider, GitProvider, type GitProviderAdapter, type Guideline, type GuidelineCategory, type GuidelineConfig, type HookConfig, type HookContext, type HookError, type HookEvent, type HookEventListener, HookManager, type HookManagerOptions, type HookTriggerResult, type HybridSearchOptions, HybridSearchPipeline, type HybridSearchResponse, type HybridSearchResult, INDEX_CACHE_HOURS, INDEX_PATH, type ImportOptions, type IndexBuildCallback, type IndexBuildProgress, type IndexSource, type InjectedMemory, type InjectionMode, type InjectionOptions, type InjectionResult, type InstallOptions, type InstallResult, type InstalledPackInfo, type InstalledSkillInfo, type IssueSeverity, KNOWN_SKILL_REPOS, type LLMResponse, type LearnedPattern, type LearnedSkillOutput, type Learning, type LearningConfig, LearningConsolidator, LearningStore, type LearningStoreData, type LoadedContext, type LocalModelConfig, LocalModelConfigSchema, LocalModelManager, LocalProvider, MARKETPLACE_CACHE_FILE, MODEL_REGISTRY, MarketplaceAggregator, type MarketplaceConfig, type MarketplaceIndex, type MarketplaceSearchOptions, type MarketplaceSearchResult, type MarketplaceSkill, type MatchCategory, type MatchReason, type MatcherFunction, 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 MessageHandler, type MessageType, MethodologyLoader, MethodologyManager, type MethodologyManagerOptions, type MethodologyPack, type MethodologySearchQuery, type MethodologySearchResult, type MethodologySkill, type MethodologySkillMetadata, type MethodologyState, type MethodologySyncResult, MockAIProvider, type ModeCapabilities, type ModeDetectionResult, type ObservableEvent, type ObservableEventType, type Observation, type ObservationContent, ObservationStore, type ObservationStoreData, type ObservationType, type OperationalProfile, type OrchestratorOptions, type OrchestratorTaskStatus, type OrchestratorTeamConfig, PRE_COMMIT_CONFIG_TEMPLATE, PRE_COMMIT_HOOK_TEMPLATE, PROJECT_TYPE_HINTS, PackageManager, type ParseOptions, type PatternCategory, type PatternDomain, type PatternExtractionResult, type PatternGenerateOptions, type PatternStore, type PipelineStage, type PlaceholderMatch, type PlaceholderReplacement, type PlanEvent, type PlanEventListener, type PlanExecutionOptions, type PlanExecutionResult, PlanExecutor, PlanGenerator, PlanParser, type PlanResult, type PlanStatus, type PlanStep, type PlanTask, type PlanTaskFiles, type PlanTaskResult, type PlanValidationResult, PlanValidator, type Plugin, type PluginConfig, type PluginContext, type PluginHooks, PluginLoader, PluginManager, type PluginMetadata, PrimerAnalysis, PrimerAnalyzer, PrimerGenerator, PrimerLanguage, type PrimerOptions, type PrimerResult, type ProfileConfig, type ProfileName, ProjectContext, ProjectDetector, ProjectPatterns, type ProjectProfile, ProjectStack, ProjectStructure, type ProviderPlugin, type QualityScore, QueryExpander, type RRFInput, type RRFRanking, type RankerResult, RateLimitError, type ReasoningCacheEntry, type ReasoningConfig, ReasoningEngine, type ReasoningEngineStats, type ReasoningPrompt, type ReasoningProvider, ReasoningProviderSchema, type ReasoningRecommendOptions, ReasoningRecommendationEngine, type ReasoningRecommendationResult, type RecommendHybridSearchOptions, type RecommendHybridSearchResult, type RecommendOptions, RecommendationEngine, type RecommendationResult, type RegisteredCommand, type RegistrySkill, type RelatedSkillResult, type RelationType, type RerankerInput, type RerankerOutput, type ReviewIssue, type ReviewResult, type ReviewStage, type ReviewStageName, RuleBasedCompressor, SEARCH_PLANNING_PROMPT, SESSION_FILE, SKILL_DISCOVERY_PATHS, SKILL_MATCH_PROMPT, STANDARD_PLACEHOLDERS, type ScoredSkill, type ScoringWeights, type SearchOptions, type SearchPlan, type SearchResult, type SearchableSkill, type SessionContext, type SessionDecision, type SessionFile, SessionManager, type SessionMessage, type SessionState, type SessionSummary, type SessionTask, type ShareOptions, type SharedSkill, Skill, SkillBundle, type SkillChunk, SkillChunkSchema, type SkillEmbedding, type SkillEntry, type SkillExample, SkillExecutionEngine, type SkillExecutionEvent, type SkillExecutionResult, type SkillExecutor, type SkillExecutorOptions, SkillFrontmatter, type SkillGraph, type SkillHook, type SkillIndex, SkillLocation, SkillMdTranslator, SkillMetadata, type SkillNode, SkillPreferences, type SkillRelation, type SkillSource, SkillSummary, type SkillTestCase, type SkillTestSuite, type SkillToSubagentOptions, type SkillTranslationOptions, type SkillTranslationResult, type SkillTree, SkillTreeSchema, SkillTriggerEngine, SkillkitConfig, type SkillsManifest, type SlashCommand, type SlashCommandResult, type SpecificityScore, type StepDefinition, type StepExecutor, type StepType, type StructureScore, type StructuredPlan, type SyncOptions, type SyncReport, type SyncResult, TAG_TO_CATEGORY, TAG_TO_TECH, TASK_TEMPLATES, TREE_FILE_NAME, type Task, type TaskEvent, type TaskEventListener, type TaskExecutionResult, type TaskFiles, type TaskFilter, TaskManager, type TaskPlan, type TaskResult, type TaskStatus, type TaskStep, type TaskTemplate, type Team, type TeamConfig, type TeamEvent, type TeamEventListener, TeamManager, type TeamMember, type TeamMessage, TeamMessageBus, TeamOrchestrator, type TeamRegistry, type TeamStatus, type TestAssertion, type TestAssertionType, type TestCaseResult, type TestProgressEvent, type TestResult, type TestRunnerOptions, type TestSuiteResult, TranslatableSkillFrontmatter, type TranslationOptions, type TranslationPath, type TranslationResult, type TranslatorPlugin, TranslatorRegistry, TreeGenerator, type TreeGeneratorOptions, type TreeNode, TreeNodeSchema, type TreePath, type TreeReasoningResult, type TreeSearchQuery, type TreeSearchResult, type TreeTraversalStep, type TriggerEngineOptions, type UpdateOptions, type ValidationError, type ValidationIssue, type ValidationResult, type ValidationWarning, type ValidatorOptions, type VectorSearchResult, VectorStore, type VectorStoreConfig, type VerificationRule, WORKFLOWS_DIR, WORKFLOW_EXTENSION, type WaveExecutionStatus, type WellKnownIndex, WellKnownProvider, type WellKnownSkill, WindsurfTranslator, type Workflow, type WorkflowExecution, type WorkflowExecutionStatus, WorkflowOrchestrator, type WorkflowProgressCallback, type WorkflowSkill, type WorkflowWave, addCustomGuideline, addCustomProfile, addPattern, addToManifest, agentExists, analyzeForPrimer, analyzeGitHistory, analyzePlaceholders, analyzePrimer, analyzeProject, applyConnectorConfig, applyPositionAwareBlending, approvePattern, benchmarkSkill, buildCategoryRelevancePrompt, buildExplanationPrompt, buildSearchPlanPrompt, buildSkillGraph, buildSkillIndex, buildSkillMatchPrompt, calculateBaseSkillsUrl, calculatePercentile, canTranslate, clusterPatterns, compareTreeVersions, computeRRFScore, copilotTranslator, createAPIBasedCompressor, createCommandGenerator, createCommandRegistry, createConnectorConfig, createContextLoader, createContextManager, createContextSync, createEmbeddingService, createExecutionEngine, createExecutionManager, createHookManager, createHybridSearchPipeline, createMarketplaceAggregator, createMemoryCompressor, createMemoryEnabledEngine, createMemoryInjector, createMemoryObserver, createMessageBus, createMethodologyLoader, createMethodologyManager, createModeAwareExecutor, createPlanExecutor, createPlanGenerator, createPlanParser, createPlanValidator, createPluginManager, createQueryExpander, createReasoningEngine, createReasoningRecommendationEngine, createRecommendationEngine, createRuleBasedCompressor, createSessionFile, createSessionManager, createSimulatedSkillExecutor, createSkillBundle, createSkillExecutor, createTaskManager, createTeamManager, createTeamOrchestrator, createTestSuiteFromFrontmatter, createTriggerEngine, createVectorStore, createWorkflowOrchestrator, createWorkflowTemplate, cursorTranslator, deserializeGraph, deserializeTree, detectCategory, detectExecutionMode, detectPlaceholders, detectProvider, detectSkillFormat, disableGuideline, discoverAgents, discoverAgentsForAgent, discoverAgentsFromPath, discoverAgentsRecursive, discoverGlobalAgents, discoverSkills, dryRunExecutor, enableGuideline, estimateTokens, evaluateSkillContent, evaluateSkillDirectory, evaluateSkillFile, executeWithAgent, expandQuerySimple, exportBundle, exportPatternsAsJson, extractAgentContent, extractAgentFrontmatter, extractField, extractFrontmatter, extractJsonFromResponse, extractPatternsFromSession, extractSkillMetadata, fetchSkillsFromRepo, findAgent, findAllAgents, findAllSkills, findManifestPath, findSkill, findSkillsByRelationType, findSkillsInCategory, formatBytes, formatSkillAsPrompt, fromCanonicalAgent, fuseWithRRF, generateComparisonNotes, generateConnectorsMarkdown, generateManifestFromInstalled, generatePatternReport, generatePrimer, generatePrimerForAgent, generateRecommendations, generateSkillFromPatterns, generateSkillTree, generateSkillsConfig, generateSubagentFromSkill, generateWellKnownIndex, generateWellKnownStructure, getActiveProfile, getAgentCLIConfig, getAgentConfigFile, getAgentConfigPath, getAgentDirectoryConfig, getAgentFilename, getAgentFormat, getAgentSkillsDir, getAgentStats, getAgentTargetDirectory, getAgentsDirectory, getAllCategories, getAllGuidelines, getAllPatterns, getAllProfiles, getAllProviders, getAllSkillsDirs, getApprovedPatterns, getAvailableCLIAgents, getBuiltinGuidelines, getBuiltinPacksDir, getBuiltinPipeline, getBuiltinPipelines, getBuiltinProfiles, getCICDTemplate, getCategoryStats, getConfigFile, getConfigFormat, getDefaultConfigPath, getDefaultModelDir, getDefaultStorePath, getEnabledGuidelineContent, getEnabledGuidelines, getEvolvingPattern, getEvolvingPatternsByDomain, getExecutionStrategy, getGitCommits, getGlobalConfigPath, getGlobalSkillsDir, getGrade, getGuideline, getGuidelineContent, getGuidelinesByCategory, getHighConfidencePatterns, getIndexStatus, getInstallDir, getLowConfidencePatterns, getManualExecutionInstructions, getMemoryPaths, getMemoryStatus, getModeDescription, getMostRecentSession, getMostUsedPatterns, getPattern, getPatternStats, getPatternsByCategory, getPlaceholderInfo, getProfile, getProfileContext, getProfileNames, getProjectConfigPath, getProvider, getQualityGrade, getRankFromScore, getRecentBugFixes, getRecentRefactors, getRelatedSkills, getSearchDirs, getSkillPath, getSkillsDir, getStackTags, getStandaloneAlternative, getSupportedTranslationAgents, getTechTags, globalMemoryDirectoryExists, hybridSearch, importBundle, importPatternsFromJson, initContext, initManifest, initProject, initializeMemoryDirectory, isAgentCLIAvailable, isAgentCompatible, isBuiltinGuideline, isBuiltinProfile, isGitUrl, isGuidelineEnabled, isHighQuality, isIndexStale, isLocalPath, isPathInside, listCICDTemplates, listSessions, listWorkflows, loadAgentMetadata, loadAndConvertSkill, loadConfig, loadContext, loadGuidelineConfig, loadIndex, loadLearningConfig, loadManifest, loadMetadata, loadPatternStore, loadPlugin, loadPluginsFromDirectory, loadProfileConfig, loadSessionFile, loadSkillMetadata, loadTree, loadWorkflow, loadWorkflowByName, memoryDirectoryExists, mergePatterns, mergeRankings, normalizeScores, parseAgentDir, parseAgentFile, parseShorthand, parseSkill, parseSkillContent, parseSkillContentToCanonical, parseSkillToCanonical, parseSource, parseWorkflow, readAgentContent, readSkillContent, recordFailure, recordSuccess, rejectPattern, removeCustomGuideline, removeCustomProfile, removeFromManifest, removePattern, replacePlaceholders, requireCapability, requireEnhancedMode, runTestSuite, saveConfig, saveGeneratedSkill, saveGuidelineConfig, saveIndex, saveLearningConfig, saveManifest, savePatternStore, saveProfileConfig, saveSessionFile, saveSkillMetadata, saveTree, saveWorkflow, serializeGraph, serializeTree, serializeWorkflow, setActiveProfile, setSkillEnabled, shellExecutor, skillMdTranslator, skillToSubagent, suggestMappingsFromMcp, supportsAutoDiscovery, supportsSlashCommands, syncToAgent, syncToAllAgents, toCanonicalAgent, translateAgent, translateAgentContent, translateAgents, translateCanonicalAgent, translateSkill, translateSkillFile, translateSkillToAgent, translateSkillToAll, translatorRegistry, treeToMarkdown, treeToText, updateSessionFile, validateAgent, validateBuiltinPacks, validateCategoryScore, validateConnectorConfig, validatePackDirectory, validatePackManifest, validatePlan, validateSearchPlan, validateSkill, validateSkillContent, validateWorkflow, weightedCombine, windsurfTranslator, wrapProgressCallbackWithMemory, writeTranslatedSkill };
|
|
10769
|
+
interface CacheStats {
|
|
10770
|
+
hits: number;
|
|
10771
|
+
misses: number;
|
|
10772
|
+
size: number;
|
|
10773
|
+
maxSize: number;
|
|
10774
|
+
hitRate: number;
|
|
10775
|
+
}
|
|
10776
|
+
interface CacheOptions {
|
|
10777
|
+
maxSize?: number;
|
|
10778
|
+
ttlMs?: number;
|
|
10779
|
+
}
|
|
10780
|
+
interface CacheBackend<V = unknown> {
|
|
10781
|
+
get(key: string): V | undefined;
|
|
10782
|
+
set(key: string, value: V): void;
|
|
10783
|
+
delete(key: string): boolean;
|
|
10784
|
+
has(key: string): boolean;
|
|
10785
|
+
clear(): void;
|
|
10786
|
+
stats(): CacheStats;
|
|
10787
|
+
}
|
|
10788
|
+
|
|
10789
|
+
declare class MemoryCache<V = unknown> implements CacheBackend<V> {
|
|
10790
|
+
private store;
|
|
10791
|
+
private maxSize;
|
|
10792
|
+
private ttlMs;
|
|
10793
|
+
private hitCount;
|
|
10794
|
+
private missCount;
|
|
10795
|
+
constructor(options?: CacheOptions);
|
|
10796
|
+
get(key: string): V | undefined;
|
|
10797
|
+
set(key: string, value: V): void;
|
|
10798
|
+
delete(key: string): boolean;
|
|
10799
|
+
has(key: string): boolean;
|
|
10800
|
+
clear(): void;
|
|
10801
|
+
stats(): CacheStats;
|
|
10802
|
+
private evictLRU;
|
|
10803
|
+
}
|
|
10804
|
+
|
|
10805
|
+
interface RankableSkill {
|
|
10806
|
+
name: string;
|
|
10807
|
+
description?: string;
|
|
10808
|
+
content?: string;
|
|
10809
|
+
stars?: number;
|
|
10810
|
+
installs?: number;
|
|
10811
|
+
references?: string[];
|
|
10812
|
+
}
|
|
10813
|
+
interface RankedSkill<T extends RankableSkill = RankableSkill> {
|
|
10814
|
+
skill: T;
|
|
10815
|
+
score: number;
|
|
10816
|
+
breakdown: ScoreBreakdown;
|
|
10817
|
+
}
|
|
10818
|
+
interface ScoreBreakdown {
|
|
10819
|
+
contentAvailability: number;
|
|
10820
|
+
queryMatch: number;
|
|
10821
|
+
popularity: number;
|
|
10822
|
+
referenceScore: number;
|
|
10823
|
+
}
|
|
10824
|
+
declare class RelevanceRanker {
|
|
10825
|
+
rank<T extends RankableSkill>(skills: T[], query?: string): RankedSkill<T>[];
|
|
10826
|
+
private score;
|
|
10827
|
+
private scoreContent;
|
|
10828
|
+
private scoreQuery;
|
|
10829
|
+
private scorePopularity;
|
|
10830
|
+
private scoreReferences;
|
|
10831
|
+
}
|
|
10832
|
+
|
|
10833
|
+
interface SkillReference {
|
|
10834
|
+
path: string;
|
|
10835
|
+
type: 'example' | 'doc' | 'resource' | 'asset';
|
|
10836
|
+
name: string;
|
|
10837
|
+
}
|
|
10838
|
+
interface ParsedSkillContent {
|
|
10839
|
+
frontmatter: Record<string, unknown>;
|
|
10840
|
+
body: string;
|
|
10841
|
+
references: SkillReference[];
|
|
10842
|
+
raw: string;
|
|
10843
|
+
}
|
|
10844
|
+
declare function discoverReferences(skillDir: string): SkillReference[];
|
|
10845
|
+
declare function stripFrontmatter(raw: string): {
|
|
10846
|
+
frontmatter: Record<string, unknown>;
|
|
10847
|
+
body: string;
|
|
10848
|
+
};
|
|
10849
|
+
declare function parseSkillMd(raw: string, skillDir?: string): ParsedSkillContent;
|
|
10850
|
+
|
|
10851
|
+
interface RuntimeSkillSource {
|
|
10852
|
+
owner: string;
|
|
10853
|
+
repo: string;
|
|
10854
|
+
}
|
|
10855
|
+
interface FetchedSkill {
|
|
10856
|
+
source: RuntimeSkillSource;
|
|
10857
|
+
skillId: string;
|
|
10858
|
+
parsed: ParsedSkillContent;
|
|
10859
|
+
fetchedAt: number;
|
|
10860
|
+
}
|
|
10861
|
+
declare class SkillInjector {
|
|
10862
|
+
private cache;
|
|
10863
|
+
constructor(cacheTtlMs?: number);
|
|
10864
|
+
fetch(source: string, skillId: string): Promise<FetchedSkill>;
|
|
10865
|
+
inject(source: string, skillId: string): Promise<string>;
|
|
10866
|
+
private fetchRawSkillMd;
|
|
10867
|
+
clearCache(): void;
|
|
10868
|
+
cacheStats(): CacheStats;
|
|
10869
|
+
}
|
|
10870
|
+
|
|
10871
|
+
export { AGENT_CLI_CONFIGS, AGENT_CONFIG, AGENT_DISCOVERY_PATHS, AGENT_FORMAT_MAP, AGENT_INSTRUCTION_TEMPLATES, AGENT_SKILL_FORMATS, type AIConfig, type AIGenerateOptions, AIManager, type AIProvider, AISearch, type AISearchOptions, type AISearchResult, AISkillGenerator, ALL_AGENT_DISCOVERY_PATHS, APIBasedCompressor, type APICompressionConfig, type ActivatedSkill, type AdvancedScore, type AgentAdapterInfo, type AgentCLIConfig, type AgentCommandFormat, AgentConfig, type AgentDirectoryConfig, type AgentExecutionResult, type AgentFormatCategory, AgentFrontmatter, AgentHook, type AgentHookFormat, type AgentInstance, type AgentInstructionTemplate, AgentLocation, AgentMetadata, AgentPermissionMode, type AgentPipeline, type AgentSkillFormat, type AgentStatus, type AgentTranslationOptions, type AgentTranslationResult, AgentType, type AssertionResult, type AuditEvent, type AuditEventType, type AuditExportOptions, AuditLogger, type AuditQuery, type AuditStats, BUILTIN_PIPELINES, BaseAIProvider, type BenchmarkResult, BitbucketProvider, type BundleManifest, CATEGORY_RELEVANCE_PROMPT, CATEGORY_TAXONOMY, CIConfig, CIRCLECI_CONFIG_TEMPLATE, CONTEXT_DIR, CONTEXT_FILE, CUSTOM_AGENT_FORMAT_MAP, type CacheBackend, type CacheOptions, type CacheStats, type CanonicalAgent, type CanonicalSkill, type CategoryMapping, type CategoryScore, type CategoryStats, type CheckpointHandler, type CheckpointResponse, type ClarityScore, type CloneOptions, type CloneResult, CodeConvention, type CommandArg, type CommandBundle, type CommandContext, type CommandEvent, type CommandEventListener, CommandGenerator, type CommandGeneratorOptions, type CommandHandler, type CommandPlugin, CommandRegistry, type CommandRegistryOptions, type CommandResult, type CommandSearchOptions, type CommandValidationResult, CommunityRegistry, type CompletenessResult, type CompressedLearning, type CompressionEngine, type CompressionOptions, type CompressionResult, type ConnectorAnalysis, type ConnectorCategory, ConnectorCategorySchema, type ConnectorConfig, ConnectorConfigSchema, type ConnectorMapping, ConnectorMappingSchema, type ConnectorPlaceholder, ConnectorPlaceholderSchema, type ContextCategory, type ContextExportOptions, type ContextImportOptions, type ContextLoadOptions, ContextLoader, ContextManager, ContextSync, type ContextSyncOptions, CopilotTranslator, type CrossAgentSkill, type CurrentExecution, CursorTranslator, type CustomAgent, DEFAULT_CACHE_TTL, DEFAULT_CHUNKING_CONFIG, DEFAULT_CONTEXT_CATEGORIES, DEFAULT_GUIDELINE_CONFIG, DEFAULT_HYBRID_CONFIG, DEFAULT_LEARNING_CONFIG, DEFAULT_MEMORY_CONFIG, DEFAULT_PROFILE_CONFIG, DEFAULT_REASONING_CONFIG, DEFAULT_SCORING_WEIGHTS, DEFAULT_SKILL_SOURCES, DependencyInfo, Detection, type DetectionSource, type DiscoveredSkill, DockerConfig, EXPLANATION_PROMPT, EmbeddingService, type EmbeddingServiceStats, EnvConfig, type EvolvingPattern, type ExecutableSkill, type ExecutableTask, type ExecutableTaskType, type ExecutionContext, type ExecutionFlow, type ExecutionFlowConfig, ExecutionFlowSchema, type ExecutionHistory, ExecutionManager, type ExecutionMode, type ExecutionModeConfig, type ExecutionOptions, type ExecutionProgressCallback, type ExecutionProgressEvent, type ExecutionStep, ExecutionStepSchema, type ExecutionStepStatus, ExecutionStepStatusSchema, type ExecutionStrategy, type ExecutionTaskStatus, type ExpandedQuery, type ExplainedMatch, type ExplainedMatchDetails, type ExplainedRecommendation, type ExplainedScoredSkill, type ExternalRegistry, type ExternalSkill, type FederatedResult, FederatedSearch, type FeedbackResult, type FetchedSkill, type FlowMetrics, type FlowSummary, type FormatCategory, type FormatTranslator, type FreshnessResult, GITHUB_ACTION_TEMPLATE, GITLAB_CI_TEMPLATE, type GenerateOptions, type GeneratedInstruction, type GeneratedSkill, type GitAnalysisOptions, type GitAnalysisResult, type GitAnalysisSummary, type GitCommit, type GitFileChange, GitHubProvider, GitHubSkillRegistry, GitLabProvider, GitProvider, type GitProviderAdapter, type Guideline, type GuidelineCategory, type GuidelineConfig, type HookConfig, type HookContext, type HookError, type HookEvent, type HookEventListener, HookManager, type HookManagerOptions, type HookTriggerResult, type HybridSearchOptions, HybridSearchPipeline, type HybridSearchResponse, type HybridSearchResult, INDEX_CACHE_HOURS, INDEX_PATH, type ImportOptions, type IndexBuildCallback, type IndexBuildProgress, type IndexSource, type InjectedMemory, type InjectionMode, type InjectionOptions, type InjectionResult, type InstallOptions, type InstallResult, type InstalledPackInfo, type InstalledSkillInfo, type IssueSeverity, KNOWN_SKILL_REPOS, type LLMResponse, type LearnedPattern, type LearnedSkillOutput, type Learning, type LearningConfig, LearningConsolidator, LearningStore, type LearningStoreData, type LoadedContext, type LocalModelConfig, LocalModelConfigSchema, LocalModelManager, LocalProvider, MARKETPLACE_CACHE_FILE, MODEL_REGISTRY, MarketplaceAggregator, type MarketplaceConfig, type MarketplaceIndex, type MarketplaceSearchOptions, type MarketplaceSearchResult, type MarketplaceSkill, type MatchCategory, type MatchReason, type MatcherFunction, MemoryCache, 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 MessageHandler, type MessageType, MethodologyLoader, MethodologyManager, type MethodologyManagerOptions, type MethodologyPack, type MethodologySearchQuery, type MethodologySearchResult, type MethodologySkill, type MethodologySkillMetadata, type MethodologyState, type MethodologySyncResult, MockAIProvider, type ModeCapabilities, type ModeDetectionResult, type ObservableEvent, type ObservableEventType, type Observation, type ObservationContent, ObservationStore, type ObservationStoreData, type ObservationType, type OperationalProfile, type OrchestratorOptions, type OrchestratorTaskStatus, type OrchestratorTeamConfig, PRE_COMMIT_CONFIG_TEMPLATE, PRE_COMMIT_HOOK_TEMPLATE, PROJECT_TYPE_HINTS, PackageManager, type ParseOptions, type ParsedSkillContent, type PatternCategory, type PatternDomain, type PatternExtractionResult, type PatternGenerateOptions, type PatternStore, type PipelineStage, type PlaceholderMatch, type PlaceholderReplacement, type PlanEvent, type PlanEventListener, type PlanExecutionOptions, type PlanExecutionResult, PlanExecutor, PlanGenerator, PlanParser, type PlanResult, type PlanStatus, type PlanStep, type PlanTask, type PlanTaskFiles, type PlanTaskResult, type PlanValidationResult, PlanValidator, type Plugin, type PluginConfig, type PluginContext, type PluginHooks, PluginLoader, PluginManager, type PluginMetadata, PrimerAnalysis, PrimerAnalyzer, PrimerGenerator, PrimerLanguage, type PrimerOptions, type PrimerResult, type ProfileConfig, type ProfileName, ProjectContext, ProjectDetector, ProjectPatterns, type ProjectProfile, ProjectStack, ProjectStructure, type ProviderPlugin, type QualityScore, QueryExpander, type RRFInput, type RRFRanking, type RankableSkill, type RankedSkill, type RankerResult, RateLimitError, type ReasoningCacheEntry, type ReasoningConfig, ReasoningEngine, type ReasoningEngineStats, type ReasoningPrompt, type ReasoningProvider, ReasoningProviderSchema, type ReasoningRecommendOptions, ReasoningRecommendationEngine, type ReasoningRecommendationResult, type RecommendHybridSearchOptions, type RecommendHybridSearchResult, type RecommendOptions, RecommendationEngine, type RecommendationResult, type RegisteredCommand, type RegistrySkill, type RelatedSkillResult, type RelationType, RelevanceRanker, type RerankerInput, type RerankerOutput, type ReviewIssue, type ReviewResult, type ReviewStage, type ReviewStageName, RuleBasedCompressor, type RuntimeSkillSource, SEARCH_PLANNING_PROMPT, SESSION_FILE, SKILL_DISCOVERY_PATHS, SKILL_MATCH_PROMPT, STANDARD_PLACEHOLDERS, type ScoreBreakdown, type ScoredSkill, type ScoringWeights, type SearchOptions, type SearchPlan, type SearchResult, type SearchableSkill, type SessionContext, type SessionDecision, type SessionFile, SessionManager, type SessionMessage, type SessionState, type SessionSummary, type SessionTask, type ShareOptions, type SharedSkill, Skill, SkillBundle, type SkillChunk, SkillChunkSchema, type SkillEmbedding, type SkillEntry, type SkillExample, SkillExecutionEngine, type SkillExecutionEvent, type SkillExecutionResult, type SkillExecutor, type SkillExecutorOptions, SkillFrontmatter, type SkillGraph, type SkillHook, type SkillIndex, SkillInjector, SkillLocation, SkillMdTranslator, SkillMetadata, type SkillNode, SkillPreferences, type SkillReference, type SkillRelation, type SkillSource, SkillSummary, type SkillTestCase, type SkillTestSuite, type SkillToSubagentOptions, type SkillTranslationOptions, type SkillTranslationResult, type SkillTree, SkillTreeSchema, SkillTriggerEngine, SkillkitConfig, type SkillsManifest, type SlashCommand, type SlashCommandResult, type SpecificityScore, type StepDefinition, type StepExecutor, type StepType, type StructureScore, type StructuredPlan, type SyncOptions, type SyncReport, type SyncResult, TAG_TO_CATEGORY, TAG_TO_TECH, TASK_TEMPLATES, TREE_FILE_NAME, type Task, type TaskEvent, type TaskEventListener, type TaskExecutionResult, type TaskFiles, type TaskFilter, TaskManager, type TaskPlan, type TaskResult, type TaskStatus, type TaskStep, type TaskTemplate, type Team, type TeamConfig, type TeamEvent, type TeamEventListener, TeamManager, type TeamMember, type TeamMessage, TeamMessageBus, TeamOrchestrator, type TeamRegistry, type TeamStatus, type TestAssertion, type TestAssertionType, type TestCaseResult, type TestProgressEvent, type TestResult, type TestRunnerOptions, type TestSuiteResult, TranslatableSkillFrontmatter, type TranslationOptions, type TranslationPath, type TranslationResult, type TranslatorPlugin, TranslatorRegistry, TreeGenerator, type TreeGeneratorOptions, type TreeNode, TreeNodeSchema, type TreePath, type TreeReasoningResult, type TreeSearchQuery, type TreeSearchResult, type TreeTraversalStep, type TriggerEngineOptions, type UpdateOptions, type ValidationError, type ValidationIssue, type ValidationResult, type ValidationWarning, type ValidatorOptions, type VectorSearchResult, VectorStore, type VectorStoreConfig, type VerificationRule, WORKFLOWS_DIR, WORKFLOW_EXTENSION, type WaveExecutionStatus, type WellKnownIndex, WellKnownProvider, type WellKnownSkill, WindsurfTranslator, type Workflow, type WorkflowExecution, type WorkflowExecutionStatus, WorkflowOrchestrator, type WorkflowProgressCallback, type WorkflowSkill, type WorkflowWave, addCustomGuideline, addCustomProfile, addPattern, addToManifest, agentExists, analyzeForPrimer, analyzeGitHistory, analyzePlaceholders, analyzePrimer, analyzeProject, applyConnectorConfig, applyPositionAwareBlending, approvePattern, benchmarkSkill, buildCategoryRelevancePrompt, buildExplanationPrompt, buildSearchPlanPrompt, buildSkillGraph, buildSkillIndex, buildSkillMatchPrompt, calculateBaseSkillsUrl, calculatePercentile, canTranslate, clusterPatterns, compareTreeVersions, computeRRFScore, copilotTranslator, createAPIBasedCompressor, createCommandGenerator, createCommandRegistry, createConnectorConfig, createContextLoader, createContextManager, createContextSync, createEmbeddingService, createExecutionEngine, createExecutionManager, createHookManager, createHybridSearchPipeline, createMarketplaceAggregator, createMemoryCompressor, createMemoryEnabledEngine, createMemoryInjector, createMemoryObserver, createMessageBus, createMethodologyLoader, createMethodologyManager, createModeAwareExecutor, createPlanExecutor, createPlanGenerator, createPlanParser, createPlanValidator, createPluginManager, createQueryExpander, createReasoningEngine, createReasoningRecommendationEngine, createRecommendationEngine, createRuleBasedCompressor, createSessionFile, createSessionManager, createSimulatedSkillExecutor, createSkillBundle, createSkillExecutor, createTaskManager, createTeamManager, createTeamOrchestrator, createTestSuiteFromFrontmatter, createTriggerEngine, createVectorStore, createWorkflowOrchestrator, createWorkflowTemplate, cursorTranslator, deserializeGraph, deserializeTree, detectCategory, detectExecutionMode, detectPlaceholders, detectProvider, detectSkillFormat, disableGuideline, discoverAgents, discoverAgentsForAgent, discoverAgentsFromPath, discoverAgentsRecursive, discoverGlobalAgents, discoverReferences, discoverSkills, dryRunExecutor, enableGuideline, estimateTokens, evaluateSkillContent, evaluateSkillDirectory, evaluateSkillFile, executeWithAgent, expandQuerySimple, exportBundle, exportPatternsAsJson, extractAgentContent, extractAgentFrontmatter, extractField, extractFrontmatter, extractJsonFromResponse, extractPatternsFromSession, extractSkillMetadata, fetchSkillsFromRepo, findAgent, findAllAgents, findAllSkills, findManifestPath, findSkill, findSkillsByRelationType, findSkillsInCategory, formatBytes, formatSkillAsPrompt, fromCanonicalAgent, fuseWithRRF, generateComparisonNotes, generateConnectorsMarkdown, generateManifestFromInstalled, generatePatternReport, generatePrimer, generatePrimerForAgent, generateRecommendations, generateSkillFromPatterns, generateSkillTree, generateSkillsConfig, generateSubagentFromSkill, generateWellKnownIndex, generateWellKnownStructure, getActiveProfile, getAgentCLIConfig, getAgentConfigFile, getAgentConfigPath, getAgentDirectoryConfig, getAgentFilename, getAgentFormat, getAgentSkillsDir, getAgentStats, getAgentTargetDirectory, getAgentsDirectory, getAllCategories, getAllGuidelines, getAllPatterns, getAllProfiles, getAllProviders, getAllSkillsDirs, getApprovedPatterns, getAvailableCLIAgents, getBuiltinGuidelines, getBuiltinPacksDir, getBuiltinPipeline, getBuiltinPipelines, getBuiltinProfiles, getCICDTemplate, getCategoryStats, getConfigFile, getConfigFormat, getDefaultConfigPath, getDefaultModelDir, getDefaultStorePath, getEnabledGuidelineContent, getEnabledGuidelines, getEvolvingPattern, getEvolvingPatternsByDomain, getExecutionStrategy, getGitCommits, getGlobalConfigPath, getGlobalSkillsDir, getGrade, getGuideline, getGuidelineContent, getGuidelinesByCategory, getHighConfidencePatterns, getIndexStatus, getInstallDir, getLowConfidencePatterns, getManualExecutionInstructions, getMemoryPaths, getMemoryStatus, getModeDescription, getMostRecentSession, getMostUsedPatterns, getPattern, getPatternStats, getPatternsByCategory, getPlaceholderInfo, getProfile, getProfileContext, getProfileNames, getProjectConfigPath, getProvider, getQualityGrade, getRankFromScore, getRecentBugFixes, getRecentRefactors, getRelatedSkills, getSearchDirs, getSkillPath, getSkillsDir, getStackTags, getStandaloneAlternative, getSupportedTranslationAgents, getTechTags, globalMemoryDirectoryExists, hybridSearch, importBundle, importPatternsFromJson, initContext, initManifest, initProject, initializeMemoryDirectory, isAgentCLIAvailable, isAgentCompatible, isBuiltinGuideline, isBuiltinProfile, isGitUrl, isGuidelineEnabled, isHighQuality, isIndexStale, isLocalPath, isPathInside, listCICDTemplates, listSessions, listWorkflows, loadAgentMetadata, loadAndConvertSkill, loadConfig, loadContext, loadGuidelineConfig, loadIndex, loadLearningConfig, loadManifest, loadMetadata, loadPatternStore, loadPlugin, loadPluginsFromDirectory, loadProfileConfig, loadSessionFile, loadSkillMetadata, loadTree, loadWorkflow, loadWorkflowByName, memoryDirectoryExists, mergePatterns, mergeRankings, normalizeScores, parseAgentDir, parseAgentFile, parseShorthand, parseSkill, parseSkillContent, parseSkillContentToCanonical, parseSkillMd, parseSkillToCanonical, parseSource, parseWorkflow, readAgentContent, readSkillContent, recordFailure, recordSuccess, rejectPattern, removeCustomGuideline, removeCustomProfile, removeFromManifest, removePattern, replacePlaceholders, requireCapability, requireEnhancedMode, runTestSuite, saveConfig, saveGeneratedSkill, saveGuidelineConfig, saveIndex, saveLearningConfig, saveManifest, savePatternStore, saveProfileConfig, saveSessionFile, saveSkillMetadata, saveTree, saveWorkflow, serializeGraph, serializeTree, serializeWorkflow, setActiveProfile, setSkillEnabled, shellExecutor, skillMdTranslator, skillToSubagent, stripFrontmatter, suggestMappingsFromMcp, supportsAutoDiscovery, supportsSlashCommands, syncToAgent, syncToAllAgents, toCanonicalAgent, translateAgent, translateAgentContent, translateAgents, translateCanonicalAgent, translateSkill, translateSkillFile, translateSkillToAgent, translateSkillToAll, translatorRegistry, treeToMarkdown, treeToText, updateSessionFile, validateAgent, validateBuiltinPacks, validateCategoryScore, validateConnectorConfig, validatePackDirectory, validatePackManifest, validatePlan, validateSearchPlan, validateSkill, validateSkillContent, validateWorkflow, weightedCombine, windsurfTranslator, wrapProgressCallbackWithMemory, writeTranslatedSkill };
|
package/dist/index.js
CHANGED
|
@@ -25659,6 +25659,80 @@ init_rrf();
|
|
|
25659
25659
|
init_expansion();
|
|
25660
25660
|
init_hybrid();
|
|
25661
25661
|
|
|
25662
|
+
// src/registry/community.ts
|
|
25663
|
+
import { readFileSync as readFileSync34, existsSync as existsSync48 } from "fs";
|
|
25664
|
+
import { join as join48, dirname as dirname19 } from "path";
|
|
25665
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
25666
|
+
var CommunityRegistry = class {
|
|
25667
|
+
constructor(skillsMdPath) {
|
|
25668
|
+
this.skillsMdPath = skillsMdPath;
|
|
25669
|
+
}
|
|
25670
|
+
name = "community";
|
|
25671
|
+
entries = [];
|
|
25672
|
+
loaded = false;
|
|
25673
|
+
load() {
|
|
25674
|
+
if (this.loaded) return;
|
|
25675
|
+
this.loaded = true;
|
|
25676
|
+
const paths = this.skillsMdPath ? [this.skillsMdPath] : [
|
|
25677
|
+
join48(process.cwd(), "registry", "SKILLS.md"),
|
|
25678
|
+
join48(dirname19(fileURLToPath2(import.meta.url)), "..", "..", "..", "..", "registry", "SKILLS.md")
|
|
25679
|
+
];
|
|
25680
|
+
for (const path4 of paths) {
|
|
25681
|
+
if (!existsSync48(path4)) continue;
|
|
25682
|
+
try {
|
|
25683
|
+
const content = readFileSync34(path4, "utf-8");
|
|
25684
|
+
this.entries = this.parse(content);
|
|
25685
|
+
return;
|
|
25686
|
+
} catch {
|
|
25687
|
+
continue;
|
|
25688
|
+
}
|
|
25689
|
+
}
|
|
25690
|
+
}
|
|
25691
|
+
parse(content) {
|
|
25692
|
+
const results = [];
|
|
25693
|
+
let currentCategory = "";
|
|
25694
|
+
for (const line of content.split("\n")) {
|
|
25695
|
+
const headerMatch = line.match(/^##\s+(.+)/);
|
|
25696
|
+
if (headerMatch) {
|
|
25697
|
+
currentCategory = headerMatch[1].trim();
|
|
25698
|
+
continue;
|
|
25699
|
+
}
|
|
25700
|
+
const entryMatch = line.match(/^-\s+\[([^\]]+)\]\(([^)]+)\)\s*-\s*(.+)/);
|
|
25701
|
+
if (entryMatch) {
|
|
25702
|
+
results.push({
|
|
25703
|
+
name: entryMatch[1].trim(),
|
|
25704
|
+
url: entryMatch[2].trim(),
|
|
25705
|
+
description: entryMatch[3].trim(),
|
|
25706
|
+
category: currentCategory
|
|
25707
|
+
});
|
|
25708
|
+
}
|
|
25709
|
+
}
|
|
25710
|
+
return results;
|
|
25711
|
+
}
|
|
25712
|
+
async search(query, options) {
|
|
25713
|
+
this.load();
|
|
25714
|
+
const limit = options?.limit ?? 20;
|
|
25715
|
+
const q = query.toLowerCase();
|
|
25716
|
+
const matched = this.entries.filter(
|
|
25717
|
+
(e) => e.name.toLowerCase().includes(q) || e.description.toLowerCase().includes(q) || e.category.toLowerCase().includes(q)
|
|
25718
|
+
);
|
|
25719
|
+
return matched.slice(0, limit).map((e) => ({
|
|
25720
|
+
name: e.name,
|
|
25721
|
+
description: e.description,
|
|
25722
|
+
source: e.url,
|
|
25723
|
+
registry: this.name
|
|
25724
|
+
}));
|
|
25725
|
+
}
|
|
25726
|
+
getAll() {
|
|
25727
|
+
this.load();
|
|
25728
|
+
return [...this.entries];
|
|
25729
|
+
}
|
|
25730
|
+
getCategories() {
|
|
25731
|
+
this.load();
|
|
25732
|
+
return [...new Set(this.entries.map((e) => e.category))];
|
|
25733
|
+
}
|
|
25734
|
+
};
|
|
25735
|
+
|
|
25662
25736
|
// src/registry/index.ts
|
|
25663
25737
|
var RateLimitError = class extends Error {
|
|
25664
25738
|
constructor(registry) {
|
|
@@ -25765,6 +25839,296 @@ var FederatedSearch = class {
|
|
|
25765
25839
|
};
|
|
25766
25840
|
}
|
|
25767
25841
|
};
|
|
25842
|
+
|
|
25843
|
+
// src/cache/memory.ts
|
|
25844
|
+
var DEFAULT_MAX_SIZE = 1e3;
|
|
25845
|
+
var DEFAULT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
25846
|
+
var MemoryCache = class {
|
|
25847
|
+
store = /* @__PURE__ */ new Map();
|
|
25848
|
+
maxSize;
|
|
25849
|
+
ttlMs;
|
|
25850
|
+
hitCount = 0;
|
|
25851
|
+
missCount = 0;
|
|
25852
|
+
constructor(options) {
|
|
25853
|
+
this.maxSize = options?.maxSize ?? DEFAULT_MAX_SIZE;
|
|
25854
|
+
this.ttlMs = options?.ttlMs ?? DEFAULT_TTL_MS;
|
|
25855
|
+
}
|
|
25856
|
+
get(key) {
|
|
25857
|
+
const entry = this.store.get(key);
|
|
25858
|
+
if (!entry) {
|
|
25859
|
+
this.missCount++;
|
|
25860
|
+
return void 0;
|
|
25861
|
+
}
|
|
25862
|
+
if (Date.now() > entry.expiresAt) {
|
|
25863
|
+
this.store.delete(key);
|
|
25864
|
+
this.missCount++;
|
|
25865
|
+
return void 0;
|
|
25866
|
+
}
|
|
25867
|
+
entry.lastAccessed = Date.now();
|
|
25868
|
+
this.hitCount++;
|
|
25869
|
+
return entry.value;
|
|
25870
|
+
}
|
|
25871
|
+
set(key, value) {
|
|
25872
|
+
if (this.store.size >= this.maxSize && !this.store.has(key)) {
|
|
25873
|
+
this.evictLRU();
|
|
25874
|
+
}
|
|
25875
|
+
const now = Date.now();
|
|
25876
|
+
this.store.set(key, {
|
|
25877
|
+
value,
|
|
25878
|
+
expiresAt: now + this.ttlMs,
|
|
25879
|
+
lastAccessed: now
|
|
25880
|
+
});
|
|
25881
|
+
}
|
|
25882
|
+
delete(key) {
|
|
25883
|
+
return this.store.delete(key);
|
|
25884
|
+
}
|
|
25885
|
+
has(key) {
|
|
25886
|
+
const entry = this.store.get(key);
|
|
25887
|
+
if (!entry) return false;
|
|
25888
|
+
if (Date.now() > entry.expiresAt) {
|
|
25889
|
+
this.store.delete(key);
|
|
25890
|
+
return false;
|
|
25891
|
+
}
|
|
25892
|
+
return true;
|
|
25893
|
+
}
|
|
25894
|
+
clear() {
|
|
25895
|
+
this.store.clear();
|
|
25896
|
+
this.hitCount = 0;
|
|
25897
|
+
this.missCount = 0;
|
|
25898
|
+
}
|
|
25899
|
+
stats() {
|
|
25900
|
+
const total = this.hitCount + this.missCount;
|
|
25901
|
+
return {
|
|
25902
|
+
hits: this.hitCount,
|
|
25903
|
+
misses: this.missCount,
|
|
25904
|
+
size: this.store.size,
|
|
25905
|
+
maxSize: this.maxSize,
|
|
25906
|
+
hitRate: total > 0 ? this.hitCount / total : 0
|
|
25907
|
+
};
|
|
25908
|
+
}
|
|
25909
|
+
evictLRU() {
|
|
25910
|
+
let oldestKey = null;
|
|
25911
|
+
let oldestTime = Infinity;
|
|
25912
|
+
for (const [key, entry] of this.store) {
|
|
25913
|
+
if (entry.lastAccessed < oldestTime) {
|
|
25914
|
+
oldestTime = entry.lastAccessed;
|
|
25915
|
+
oldestKey = key;
|
|
25916
|
+
}
|
|
25917
|
+
}
|
|
25918
|
+
if (oldestKey) {
|
|
25919
|
+
this.store.delete(oldestKey);
|
|
25920
|
+
}
|
|
25921
|
+
}
|
|
25922
|
+
};
|
|
25923
|
+
|
|
25924
|
+
// src/ranking/relevance.ts
|
|
25925
|
+
var WEIGHTS = {
|
|
25926
|
+
contentAvailability: 40,
|
|
25927
|
+
queryMatch: 30,
|
|
25928
|
+
popularity: 15,
|
|
25929
|
+
references: 15
|
|
25930
|
+
};
|
|
25931
|
+
var RelevanceRanker = class {
|
|
25932
|
+
rank(skills, query) {
|
|
25933
|
+
const results = skills.map((skill) => {
|
|
25934
|
+
const breakdown = this.score(skill, query);
|
|
25935
|
+
const score = breakdown.contentAvailability + breakdown.queryMatch + breakdown.popularity + breakdown.referenceScore;
|
|
25936
|
+
return { skill, score, breakdown };
|
|
25937
|
+
});
|
|
25938
|
+
results.sort((a, b) => b.score - a.score);
|
|
25939
|
+
return results;
|
|
25940
|
+
}
|
|
25941
|
+
score(skill, query) {
|
|
25942
|
+
return {
|
|
25943
|
+
contentAvailability: this.scoreContent(skill),
|
|
25944
|
+
queryMatch: query ? this.scoreQuery(skill, query) : 0,
|
|
25945
|
+
popularity: this.scorePopularity(skill),
|
|
25946
|
+
referenceScore: this.scoreReferences(skill)
|
|
25947
|
+
};
|
|
25948
|
+
}
|
|
25949
|
+
scoreContent(skill) {
|
|
25950
|
+
let score = 0;
|
|
25951
|
+
if (skill.description && skill.description.length > 0) score += 20;
|
|
25952
|
+
if (skill.content && skill.content.length > 0) score += 20;
|
|
25953
|
+
return score;
|
|
25954
|
+
}
|
|
25955
|
+
scoreQuery(skill, query) {
|
|
25956
|
+
const q = query.toLowerCase();
|
|
25957
|
+
const name = skill.name.toLowerCase();
|
|
25958
|
+
if (name === q) return WEIGHTS.queryMatch;
|
|
25959
|
+
if (name.includes(q) || q.includes(name)) {
|
|
25960
|
+
return WEIGHTS.queryMatch * 0.7;
|
|
25961
|
+
}
|
|
25962
|
+
const desc = (skill.description || "").toLowerCase();
|
|
25963
|
+
const content = (skill.content || "").toLowerCase();
|
|
25964
|
+
const searchable = `${name} ${desc} ${content}`;
|
|
25965
|
+
const words = q.split(/\s+/).filter(Boolean);
|
|
25966
|
+
const matched = words.filter((w) => searchable.includes(w)).length;
|
|
25967
|
+
if (words.length === 0) return 0;
|
|
25968
|
+
return Math.round(WEIGHTS.queryMatch * (matched / words.length) * 0.6);
|
|
25969
|
+
}
|
|
25970
|
+
scorePopularity(skill) {
|
|
25971
|
+
const count = (skill.stars ?? 0) + (skill.installs ?? 0);
|
|
25972
|
+
if (count <= 0) return 0;
|
|
25973
|
+
return Math.min(WEIGHTS.popularity, Math.round(Math.log10(count + 1) * 5));
|
|
25974
|
+
}
|
|
25975
|
+
scoreReferences(skill) {
|
|
25976
|
+
if (!skill.references || skill.references.length === 0) return 0;
|
|
25977
|
+
return Math.min(WEIGHTS.references, skill.references.length * 5);
|
|
25978
|
+
}
|
|
25979
|
+
};
|
|
25980
|
+
|
|
25981
|
+
// src/parser/references.ts
|
|
25982
|
+
import { readdirSync as readdirSync12, statSync as statSync9, existsSync as existsSync49 } from "fs";
|
|
25983
|
+
import { join as join49 } from "path";
|
|
25984
|
+
var REFERENCE_DIRS = ["references", "resources", "docs", "examples", "assets", "scripts"];
|
|
25985
|
+
var DIR_TYPE_MAP = {
|
|
25986
|
+
references: "resource",
|
|
25987
|
+
resources: "resource",
|
|
25988
|
+
docs: "doc",
|
|
25989
|
+
examples: "example",
|
|
25990
|
+
assets: "asset",
|
|
25991
|
+
scripts: "resource"
|
|
25992
|
+
};
|
|
25993
|
+
function discoverReferences(skillDir) {
|
|
25994
|
+
const refs = [];
|
|
25995
|
+
for (const dir of REFERENCE_DIRS) {
|
|
25996
|
+
const fullPath = join49(skillDir, dir);
|
|
25997
|
+
if (!existsSync49(fullPath)) continue;
|
|
25998
|
+
try {
|
|
25999
|
+
const stat = statSync9(fullPath);
|
|
26000
|
+
if (!stat.isDirectory()) continue;
|
|
26001
|
+
} catch {
|
|
26002
|
+
continue;
|
|
26003
|
+
}
|
|
26004
|
+
const type = DIR_TYPE_MAP[dir] || "resource";
|
|
26005
|
+
try {
|
|
26006
|
+
const entries = readdirSync12(fullPath);
|
|
26007
|
+
for (const entry of entries) {
|
|
26008
|
+
const entryPath = join49(fullPath, entry);
|
|
26009
|
+
try {
|
|
26010
|
+
const entryStat = statSync9(entryPath);
|
|
26011
|
+
if (entryStat.isFile()) {
|
|
26012
|
+
refs.push({
|
|
26013
|
+
path: join49(dir, entry),
|
|
26014
|
+
type,
|
|
26015
|
+
name: entry
|
|
26016
|
+
});
|
|
26017
|
+
}
|
|
26018
|
+
} catch {
|
|
26019
|
+
continue;
|
|
26020
|
+
}
|
|
26021
|
+
}
|
|
26022
|
+
} catch {
|
|
26023
|
+
continue;
|
|
26024
|
+
}
|
|
26025
|
+
}
|
|
26026
|
+
return refs;
|
|
26027
|
+
}
|
|
26028
|
+
function stripFrontmatter(raw) {
|
|
26029
|
+
const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
|
26030
|
+
if (!match) {
|
|
26031
|
+
const emptyMatch = raw.match(/^---\r?\n---\r?\n?([\s\S]*)$/);
|
|
26032
|
+
if (emptyMatch) {
|
|
26033
|
+
return { frontmatter: {}, body: emptyMatch[1] };
|
|
26034
|
+
}
|
|
26035
|
+
return { frontmatter: {}, body: raw };
|
|
26036
|
+
}
|
|
26037
|
+
const fmBlock = match[1];
|
|
26038
|
+
const body = match[2];
|
|
26039
|
+
const frontmatter = {};
|
|
26040
|
+
for (const line of fmBlock.split("\n")) {
|
|
26041
|
+
const colonIdx = line.indexOf(":");
|
|
26042
|
+
if (colonIdx === -1) continue;
|
|
26043
|
+
const key = line.slice(0, colonIdx).trim();
|
|
26044
|
+
const value = line.slice(colonIdx + 1).trim();
|
|
26045
|
+
if (key) {
|
|
26046
|
+
frontmatter[key] = value;
|
|
26047
|
+
}
|
|
26048
|
+
}
|
|
26049
|
+
return { frontmatter, body };
|
|
26050
|
+
}
|
|
26051
|
+
function parseSkillMd(raw, skillDir) {
|
|
26052
|
+
const { frontmatter, body } = stripFrontmatter(raw);
|
|
26053
|
+
const references = skillDir ? discoverReferences(skillDir) : [];
|
|
26054
|
+
return {
|
|
26055
|
+
frontmatter,
|
|
26056
|
+
body,
|
|
26057
|
+
references,
|
|
26058
|
+
raw
|
|
26059
|
+
};
|
|
26060
|
+
}
|
|
26061
|
+
|
|
26062
|
+
// src/runtime/injector.ts
|
|
26063
|
+
function parseSource2(source) {
|
|
26064
|
+
const parts = source.replace(/^https?:\/\/github\.com\//, "").split("/");
|
|
26065
|
+
if (parts.length < 2) {
|
|
26066
|
+
throw new Error(`Invalid source format: "${source}". Expected "owner/repo".`);
|
|
26067
|
+
}
|
|
26068
|
+
return { owner: parts[0], repo: parts[1] };
|
|
26069
|
+
}
|
|
26070
|
+
var SkillInjector = class {
|
|
26071
|
+
cache;
|
|
26072
|
+
constructor(cacheTtlMs) {
|
|
26073
|
+
this.cache = new MemoryCache({
|
|
26074
|
+
maxSize: 200,
|
|
26075
|
+
ttlMs: cacheTtlMs ?? 24 * 60 * 60 * 1e3
|
|
26076
|
+
});
|
|
26077
|
+
}
|
|
26078
|
+
async fetch(source, skillId) {
|
|
26079
|
+
const cacheKey = `${source}:${skillId}`;
|
|
26080
|
+
const cached = this.cache.get(cacheKey);
|
|
26081
|
+
if (cached) return cached;
|
|
26082
|
+
const { owner, repo } = parseSource2(source);
|
|
26083
|
+
const raw = await this.fetchRawSkillMd(owner, repo, skillId);
|
|
26084
|
+
const parsed = parseSkillMd(raw);
|
|
26085
|
+
const result = {
|
|
26086
|
+
source: { owner, repo },
|
|
26087
|
+
skillId,
|
|
26088
|
+
parsed,
|
|
26089
|
+
fetchedAt: Date.now()
|
|
26090
|
+
};
|
|
26091
|
+
this.cache.set(cacheKey, result);
|
|
26092
|
+
return result;
|
|
26093
|
+
}
|
|
26094
|
+
async inject(source, skillId) {
|
|
26095
|
+
const fetched = await this.fetch(source, skillId);
|
|
26096
|
+
return fetched.parsed.body;
|
|
26097
|
+
}
|
|
26098
|
+
async fetchRawSkillMd(owner, repo, skillId) {
|
|
26099
|
+
const paths = [
|
|
26100
|
+
`${skillId}/SKILL.md`,
|
|
26101
|
+
`skills/${skillId}/SKILL.md`,
|
|
26102
|
+
`SKILL.md`
|
|
26103
|
+
];
|
|
26104
|
+
const headers = {
|
|
26105
|
+
Accept: "application/vnd.github.v3.raw",
|
|
26106
|
+
"User-Agent": "skillkit-runtime"
|
|
26107
|
+
};
|
|
26108
|
+
const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
|
|
26109
|
+
if (token) {
|
|
26110
|
+
headers.Authorization = `Bearer ${token}`;
|
|
26111
|
+
}
|
|
26112
|
+
for (const path4 of paths) {
|
|
26113
|
+
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path4}`;
|
|
26114
|
+
try {
|
|
26115
|
+
const response = await fetch(url, { headers });
|
|
26116
|
+
if (response.ok) {
|
|
26117
|
+
return await response.text();
|
|
26118
|
+
}
|
|
26119
|
+
} catch {
|
|
26120
|
+
continue;
|
|
26121
|
+
}
|
|
26122
|
+
}
|
|
26123
|
+
throw new Error(`SKILL.md not found in ${owner}/${repo} for skill "${skillId}"`);
|
|
26124
|
+
}
|
|
26125
|
+
clearCache() {
|
|
26126
|
+
this.cache.clear();
|
|
26127
|
+
}
|
|
26128
|
+
cacheStats() {
|
|
26129
|
+
return this.cache.stats();
|
|
26130
|
+
}
|
|
26131
|
+
};
|
|
25768
26132
|
export {
|
|
25769
26133
|
AGENT_CLI_CONFIGS,
|
|
25770
26134
|
AGENT_CONFIG,
|
|
@@ -25795,6 +26159,7 @@ export {
|
|
|
25795
26159
|
CUSTOM_AGENT_FORMAT_MAP,
|
|
25796
26160
|
CommandGenerator,
|
|
25797
26161
|
CommandRegistry,
|
|
26162
|
+
CommunityRegistry,
|
|
25798
26163
|
ConnectorCategorySchema,
|
|
25799
26164
|
ConnectorConfigSchema,
|
|
25800
26165
|
ConnectorMappingSchema,
|
|
@@ -25841,6 +26206,7 @@ export {
|
|
|
25841
26206
|
MARKETPLACE_CACHE_FILE,
|
|
25842
26207
|
MODEL_REGISTRY,
|
|
25843
26208
|
MarketplaceAggregator,
|
|
26209
|
+
MemoryCache,
|
|
25844
26210
|
MemoryCompressor,
|
|
25845
26211
|
MemoryEnabledEngine,
|
|
25846
26212
|
MemoryIndexStore,
|
|
@@ -25868,6 +26234,7 @@ export {
|
|
|
25868
26234
|
ReasoningProviderSchema,
|
|
25869
26235
|
ReasoningRecommendationEngine,
|
|
25870
26236
|
RecommendationEngine,
|
|
26237
|
+
RelevanceRanker,
|
|
25871
26238
|
RuleBasedCompressor,
|
|
25872
26239
|
SEARCH_PLANNING_PROMPT,
|
|
25873
26240
|
SESSION_FILE,
|
|
@@ -25880,6 +26247,7 @@ export {
|
|
|
25880
26247
|
SkillChunkSchema,
|
|
25881
26248
|
SkillExecutionEngine,
|
|
25882
26249
|
SkillFrontmatter,
|
|
26250
|
+
SkillInjector,
|
|
25883
26251
|
SkillLocation,
|
|
25884
26252
|
SkillMdTranslator,
|
|
25885
26253
|
SkillMetadata,
|
|
@@ -25989,6 +26357,7 @@ export {
|
|
|
25989
26357
|
discoverAgentsFromPath,
|
|
25990
26358
|
discoverAgentsRecursive,
|
|
25991
26359
|
discoverGlobalAgents,
|
|
26360
|
+
discoverReferences,
|
|
25992
26361
|
discoverSkills,
|
|
25993
26362
|
dryRunExecutor,
|
|
25994
26363
|
enableGuideline,
|
|
@@ -26155,6 +26524,7 @@ export {
|
|
|
26155
26524
|
parseSkill,
|
|
26156
26525
|
parseSkillContent,
|
|
26157
26526
|
parseSkillContentToCanonical,
|
|
26527
|
+
parseSkillMd,
|
|
26158
26528
|
parseSkillToCanonical,
|
|
26159
26529
|
parseSource,
|
|
26160
26530
|
parseWorkflow,
|
|
@@ -26191,6 +26561,7 @@ export {
|
|
|
26191
26561
|
shellExecutor,
|
|
26192
26562
|
skillMdTranslator,
|
|
26193
26563
|
skillToSubagent,
|
|
26564
|
+
stripFrontmatter,
|
|
26194
26565
|
suggestMappingsFromMcp,
|
|
26195
26566
|
supportsAutoDiscovery,
|
|
26196
26567
|
supportsSlashCommands,
|