skill-tree 0.2.1 → 0.3.1

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.
Files changed (57) hide show
  1. package/dist/{chunk-P5GJJ4JB.mjs → chunk-GPN6UQVR.mjs} +4 -3
  2. package/dist/{chunk-4TFMKAVC.mjs → chunk-MBF2MJS5.mjs} +5 -0
  3. package/dist/cli/index.js +6 -1
  4. package/dist/cli/index.mjs +2 -2
  5. package/dist/index.d.mts +116 -2
  6. package/dist/index.d.ts +116 -2
  7. package/dist/index.js +8 -1
  8. package/dist/index.mjs +4 -2
  9. package/dist/{sqlite-RR2SJ3SR.mjs → sqlite-V6GFGHTD.mjs} +1 -1
  10. package/package.json +1 -1
  11. package/dist/chunk-3SRB47JW.mjs +0 -8344
  12. package/dist/chunk-43YOKLZP.mjs +0 -6081
  13. package/dist/chunk-4AGZU52D.mjs +0 -7918
  14. package/dist/chunk-4HXHCEFH.mjs +0 -9157
  15. package/dist/chunk-4OC5QFIF.mjs +0 -11267
  16. package/dist/chunk-55SMGVTP.mjs +0 -7126
  17. package/dist/chunk-6FX4IK4Z.mjs +0 -5368
  18. package/dist/chunk-6UPDN5QM.mjs +0 -163
  19. package/dist/chunk-7EGDKOHV.mjs +0 -9439
  20. package/dist/chunk-7LMOQW5H.mjs +0 -4893
  21. package/dist/chunk-7QIQJVNP.mjs +0 -14206
  22. package/dist/chunk-7VB4ZRZO.mjs +0 -7127
  23. package/dist/chunk-A3SILZYX.mjs +0 -8360
  24. package/dist/chunk-BPVRW25O.mjs +0 -6089
  25. package/dist/chunk-CI4476KM.mjs +0 -6607
  26. package/dist/chunk-DDXYQ74I.mjs +0 -13969
  27. package/dist/chunk-DQOFJXBX.mjs +0 -6595
  28. package/dist/chunk-E2CVK23F.mjs +0 -8751
  29. package/dist/chunk-F3YEUQAP.mjs +0 -654
  30. package/dist/chunk-FKJJ4RJG.mjs +0 -13874
  31. package/dist/chunk-II7DECZQ.mjs +0 -9111
  32. package/dist/chunk-INKVOZXK.mjs +0 -15898
  33. package/dist/chunk-J2JM7HAK.mjs +0 -8787
  34. package/dist/chunk-K6NRCSAZ.mjs +0 -4355
  35. package/dist/chunk-OYHYXKXO.mjs +0 -7297
  36. package/dist/chunk-PDPN7FW7.mjs +0 -1045
  37. package/dist/chunk-QNK3WYNA.mjs +0 -8971
  38. package/dist/chunk-T4PVQW5O.mjs +0 -124
  39. package/dist/chunk-TEUB6DZR.mjs +0 -6453
  40. package/dist/chunk-TWPEHDW4.mjs +0 -1067
  41. package/dist/chunk-VHFTX33A.mjs +0 -6724
  42. package/dist/chunk-Y54UK2J3.mjs +0 -13071
  43. package/dist/chunk-ZQVS7MQK.mjs +0 -6081
  44. package/dist/dist-es-2JG6ZWFR.mjs +0 -69
  45. package/dist/dist-es-FIVW7BUZ.mjs +0 -317
  46. package/dist/dist-es-HRBPKDMR.mjs +0 -935
  47. package/dist/dist-es-LHPJ63IO.mjs +0 -4437
  48. package/dist/dist-es-ZYHLY2E6.mjs +0 -487
  49. package/dist/loadSso-OYKG6ZRE.mjs +0 -579
  50. package/dist/signin-LMFNL434.mjs +0 -665
  51. package/dist/sqlite-MG45OOTV.mjs +0 -6
  52. package/dist/sqlite-OLU72GHB.mjs +0 -6
  53. package/dist/sqlite-XJRPMNAJ.mjs +0 -6
  54. package/dist/sso-oidc-NNH6SQIH.mjs +0 -832
  55. package/dist/sts-EF755UBF.mjs +0 -6290
  56. package/dist/sync-BSWMMDA6.mjs +0 -14
  57. package/dist/sync-WHIIDHML.mjs +0 -14
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BaseStorageAdapter,
3
3
  MemoryStorageAdapter
4
- } from "./chunk-4TFMKAVC.mjs";
4
+ } from "./chunk-MBF2MJS5.mjs";
5
5
 
6
6
  // src/types.ts
7
7
  function hasTaxonomySupport(storage) {
@@ -4970,7 +4970,7 @@ var CachedStorageAdapter = class extends BaseStorageAdapter {
4970
4970
  fs7.mkdirSync(this.cacheDir, { recursive: true });
4971
4971
  }
4972
4972
  try {
4973
- const { SQLiteStorageAdapter: SQLiteStorageAdapter2 } = await import("./sqlite-RR2SJ3SR.mjs");
4973
+ const { SQLiteStorageAdapter: SQLiteStorageAdapter2 } = await import("./sqlite-V6GFGHTD.mjs");
4974
4974
  const sqliteCache = new SQLiteStorageAdapter2({
4975
4975
  dbPath: this.dbPath,
4976
4976
  walMode: true,
@@ -9141,7 +9141,7 @@ async function importLocalSkillDir(dirPath, bank, options = {}) {
9141
9141
  }
9142
9142
 
9143
9143
  // src/index.ts
9144
- var VERSION = "0.2.0";
9144
+ var VERSION = "0.3.0";
9145
9145
 
9146
9146
  export {
9147
9147
  ConflictStore,
@@ -9190,6 +9190,7 @@ export {
9190
9190
  inferBumpType,
9191
9191
  FederationManager,
9192
9192
  createFederationManager,
9193
+ FilesystemStorageAdapter,
9193
9194
  CachedStorageAdapter,
9194
9195
  LineageTracker,
9195
9196
  SkillMerger,
@@ -115,12 +115,17 @@ var _BaseStorageAdapter = class _BaseStorageAdapter {
115
115
  df.set(t, (df.get(t) ?? 0) + 1);
116
116
  }
117
117
  }
118
+ const requiredTerms = [...new Set(queryTerms)].filter((qt) => (df.get(qt) ?? 0) > 0);
118
119
  const scored = docs.map((doc) => {
119
120
  let score = 0;
120
121
  const tf = /* @__PURE__ */ new Map();
121
122
  for (const t of doc.terms) {
122
123
  tf.set(t, (tf.get(t) ?? 0) + 1);
123
124
  }
125
+ const matchesAll = requiredTerms.every((qt) => (tf.get(qt) ?? 0) > 0);
126
+ if (!matchesAll) {
127
+ return { skill: doc.skill, score: 0 };
128
+ }
124
129
  for (const qt of queryTerms) {
125
130
  const termDf = df.get(qt) ?? 0;
126
131
  if (termDf === 0) continue;
package/dist/cli/index.js CHANGED
@@ -146,12 +146,17 @@ var init_base = __esm({
146
146
  df.set(t, (df.get(t) ?? 0) + 1);
147
147
  }
148
148
  }
149
+ const requiredTerms = [...new Set(queryTerms)].filter((qt) => (df.get(qt) ?? 0) > 0);
149
150
  const scored = docs.map((doc) => {
150
151
  let score = 0;
151
152
  const tf = /* @__PURE__ */ new Map();
152
153
  for (const t of doc.terms) {
153
154
  tf.set(t, (tf.get(t) ?? 0) + 1);
154
155
  }
156
+ const matchesAll = requiredTerms.every((qt) => (tf.get(qt) ?? 0) > 0);
157
+ if (!matchesAll) {
158
+ return { skill: doc.skill, score: 0 };
159
+ }
155
160
  for (const qt of queryTerms) {
156
161
  const termDf = df.get(qt) ?? 0;
157
162
  if (termDf === 0) continue;
@@ -9844,7 +9849,7 @@ async function importLocalSkillDir(dirPath, bank, options = {}) {
9844
9849
  }
9845
9850
 
9846
9851
  // src/index.ts
9847
- var VERSION = "0.2.0";
9852
+ var VERSION = "0.3.0";
9848
9853
 
9849
9854
  // src/cli/commands/list.ts
9850
9855
  var import_commander = require("commander");
@@ -17,8 +17,8 @@ import {
17
17
  importSkillMdFile,
18
18
  loadConfig,
19
19
  parseIndexerExport
20
- } from "../chunk-P5GJJ4JB.mjs";
21
- import "../chunk-4TFMKAVC.mjs";
20
+ } from "../chunk-GPN6UQVR.mjs";
21
+ import "../chunk-MBF2MJS5.mjs";
22
22
  import "../chunk-MBIGW6KU.mjs";
23
23
  import "../chunk-QZ7TP4HQ.mjs";
24
24
 
package/dist/index.d.mts CHANGED
@@ -2857,6 +2857,120 @@ declare class MemoryStorageAdapter extends BaseStorageAdapter {
2857
2857
  recordFork(sourceSkillId: string, fork: SkillFork): Promise<void>;
2858
2858
  }
2859
2859
 
2860
+ /**
2861
+ * Filesystem storage adapter
2862
+ * Compatible with OpenSkills SKILL.md format (YAML frontmatter + Markdown)
2863
+ *
2864
+ * Directory structure:
2865
+ * basePath/
2866
+ * .skilltree/
2867
+ * config.json <- optional configuration
2868
+ * skills/ <- default skills location
2869
+ * skill-id/
2870
+ * SKILL.md
2871
+ * .skilltree.json <- metadata
2872
+ * .versions/ <- version history
2873
+ */
2874
+
2875
+ /**
2876
+ * Configuration for filesystem storage
2877
+ */
2878
+ interface FilesystemStorageConfig {
2879
+ /** Base directory for skill storage */
2880
+ basePath: string;
2881
+ /** Use OpenSkills-compatible format (SKILL.md) */
2882
+ openSkillsCompatible?: boolean;
2883
+ /** Store version history */
2884
+ trackVersions?: boolean;
2885
+ }
2886
+ /**
2887
+ * Filesystem storage adapter with OpenSkills compatibility
2888
+ *
2889
+ * Uses .skilltree/ directory structure:
2890
+ * basePath/.skilltree/skills/ <- skills stored here
2891
+ * basePath/.skilltree/.versions/ <- version history
2892
+ */
2893
+ declare class FilesystemStorageAdapter extends BaseStorageAdapter {
2894
+ private config;
2895
+ private skilltreeDir;
2896
+ private skillsDir;
2897
+ private versionsDir;
2898
+ constructor(config: FilesystemStorageConfig);
2899
+ initialize(): Promise<void>;
2900
+ /**
2901
+ * Get the base path for this storage
2902
+ */
2903
+ getBasePath(): string;
2904
+ saveSkill(skill: Skill): Promise<void>;
2905
+ getSkill(id: string, version?: string): Promise<Skill | null>;
2906
+ listSkills(filter?: SkillFilter): Promise<Skill[]>;
2907
+ deleteSkill(id: string, version?: string): Promise<boolean>;
2908
+ getVersionHistory(skillId: string): Promise<SkillVersion[]>;
2909
+ getLineage(skillId: string): Promise<SkillLineage | null>;
2910
+ searchSkills(query: string): Promise<Skill[]>;
2911
+ /**
2912
+ * Serialize skill to YAML frontmatter + Markdown format
2913
+ */
2914
+ private serializeSkill;
2915
+ /**
2916
+ * Build YAML frontmatter
2917
+ */
2918
+ private buildFrontmatter;
2919
+ /**
2920
+ * Parse skill from YAML frontmatter + Markdown content
2921
+ */
2922
+ private parseSkill;
2923
+ /**
2924
+ * Split content into frontmatter and body
2925
+ */
2926
+ private parseFrontmatterAndBody;
2927
+ /**
2928
+ * Extract a single-line YAML field
2929
+ */
2930
+ private extractYamlField;
2931
+ /**
2932
+ * Extract a multiline YAML field (using |)
2933
+ */
2934
+ private extractYamlMultiline;
2935
+ /**
2936
+ * Extract a YAML list
2937
+ */
2938
+ private extractYamlList;
2939
+ /**
2940
+ * Save a version snapshot
2941
+ */
2942
+ private saveVersionSnapshot;
2943
+ /**
2944
+ * Get a specific version of a skill
2945
+ */
2946
+ private getVersionedSkill;
2947
+ /**
2948
+ * Delete a specific version
2949
+ */
2950
+ private deleteVersion;
2951
+ /**
2952
+ * Create metadata for a skill
2953
+ */
2954
+ private createMetadata;
2955
+ /**
2956
+ * Load metadata for a skill directory
2957
+ */
2958
+ private loadMetadata;
2959
+ /**
2960
+ * Save metadata for a skill directory
2961
+ */
2962
+ private saveMetadata;
2963
+ /**
2964
+ * Compare semantic versions
2965
+ */
2966
+ private compareVersions;
2967
+ /**
2968
+ * Generate content hash
2969
+ */
2970
+ private hashContent;
2971
+ recordFork(sourceSkillId: string, fork: SkillFork): Promise<void>;
2972
+ }
2973
+
2860
2974
  /**
2861
2975
  * Cached Storage Adapter
2862
2976
  *
@@ -4975,6 +5089,6 @@ declare function importLocalSkillDir(dirPath: string, bank: SkillBank, options?:
4975
5089
  *
4976
5090
  * @packageDocumentation
4977
5091
  */
4978
- declare const VERSION = "0.2.0";
5092
+ declare const VERSION = "0.3.0";
4979
5093
 
4980
- export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BedrockEmbeddingConfig, BedrockEmbeddingProvider, type BedrockRerankConfig, BedrockRerankProvider, type BumpType, CachedStorageAdapter, type CachedStorageConfig, type CachingEmbeddingConfig, CachingEmbeddingProvider, CatalogRenderer, type CatalogRendererConfig, type ConfidenceThresholds, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, DEFAULT_FIELD_WEIGHTS, DEFAULT_SKILLNET_API, type DecisionMetrics, type DisclosureEvent, type DisclosureTrace, type DiscoveredSkill, type EmbeddingProvider, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, FeedbackRecorder, type FetchLike, type FetchResult, type FieldWeights, type ForkOptions, type FoundSkillMd, type FusionStrategy, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type HybridRetrievalOptions, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type LocalImportResult, type LogisticUtilityConfig, LogisticUtilityScorer, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type OutcomeCandidate, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedSkillMd, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RerankCandidate, type RerankProvider, type RerankResult, type RollbackOptions, type SageMakerEmbeddingConfig, SageMakerEmbeddingProvider, type ScoredSkill, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, type SkillFromMdOptions, type SkillFromMdResult, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillNamespace, SkillNetClient, type SkillNetClientConfig, type SkillNetConversionResult, type SkillNetImportResult, type SkillNetSearchOptions, type SkillNetSearchResult, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaskOutcome, type TaxonomyNode, TelemetryCollector, type UpstreamUpdate, type UtilityExample, type UtilityFeatures, type UtilityScorer, type UtilityTrainReport, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, bm25Scores, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, computeDecisionMetrics, conditionalHook, cosineSimilarity, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSkillNetClient, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, findSkillMdFiles, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, importLocalSkillDir, importSkillMdFile, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseGitHubUrl, parseSkillMd, parseVersion, reciprocalRankFusion, refactoringProfile, satisfiesRange, scoreSkillRelevance, scoreSkillsHybrid, securityProfile, skillFromSkillMd, slugify, sortVersions, splitFrontmatter, termSimilarity, testingProfile, tokenize, tokenizeList, writeAgentsMd };
5094
+ export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BedrockEmbeddingConfig, BedrockEmbeddingProvider, type BedrockRerankConfig, BedrockRerankProvider, type BumpType, CachedStorageAdapter, type CachedStorageConfig, type CachingEmbeddingConfig, CachingEmbeddingProvider, CatalogRenderer, type CatalogRendererConfig, type ConfidenceThresholds, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, DEFAULT_FIELD_WEIGHTS, DEFAULT_SKILLNET_API, type DecisionMetrics, type DisclosureEvent, type DisclosureTrace, type DiscoveredSkill, type EmbeddingProvider, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, FeedbackRecorder, type FetchLike, type FetchResult, type FieldWeights, FilesystemStorageAdapter, type FilesystemStorageConfig, type ForkOptions, type FoundSkillMd, type FusionStrategy, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type HybridRetrievalOptions, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type LocalImportResult, type LogisticUtilityConfig, LogisticUtilityScorer, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type OutcomeCandidate, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedSkillMd, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RerankCandidate, type RerankProvider, type RerankResult, type RollbackOptions, type SageMakerEmbeddingConfig, SageMakerEmbeddingProvider, type ScoredSkill, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, type SkillFromMdOptions, type SkillFromMdResult, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillNamespace, SkillNetClient, type SkillNetClientConfig, type SkillNetConversionResult, type SkillNetImportResult, type SkillNetSearchOptions, type SkillNetSearchResult, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaskOutcome, type TaxonomyNode, TelemetryCollector, type UpstreamUpdate, type UtilityExample, type UtilityFeatures, type UtilityScorer, type UtilityTrainReport, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, bm25Scores, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, computeDecisionMetrics, conditionalHook, cosineSimilarity, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSkillNetClient, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, findSkillMdFiles, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, importLocalSkillDir, importSkillMdFile, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseGitHubUrl, parseSkillMd, parseVersion, reciprocalRankFusion, refactoringProfile, satisfiesRange, scoreSkillRelevance, scoreSkillsHybrid, securityProfile, skillFromSkillMd, slugify, sortVersions, splitFrontmatter, termSimilarity, testingProfile, tokenize, tokenizeList, writeAgentsMd };
package/dist/index.d.ts CHANGED
@@ -2857,6 +2857,120 @@ declare class MemoryStorageAdapter extends BaseStorageAdapter {
2857
2857
  recordFork(sourceSkillId: string, fork: SkillFork): Promise<void>;
2858
2858
  }
2859
2859
 
2860
+ /**
2861
+ * Filesystem storage adapter
2862
+ * Compatible with OpenSkills SKILL.md format (YAML frontmatter + Markdown)
2863
+ *
2864
+ * Directory structure:
2865
+ * basePath/
2866
+ * .skilltree/
2867
+ * config.json <- optional configuration
2868
+ * skills/ <- default skills location
2869
+ * skill-id/
2870
+ * SKILL.md
2871
+ * .skilltree.json <- metadata
2872
+ * .versions/ <- version history
2873
+ */
2874
+
2875
+ /**
2876
+ * Configuration for filesystem storage
2877
+ */
2878
+ interface FilesystemStorageConfig {
2879
+ /** Base directory for skill storage */
2880
+ basePath: string;
2881
+ /** Use OpenSkills-compatible format (SKILL.md) */
2882
+ openSkillsCompatible?: boolean;
2883
+ /** Store version history */
2884
+ trackVersions?: boolean;
2885
+ }
2886
+ /**
2887
+ * Filesystem storage adapter with OpenSkills compatibility
2888
+ *
2889
+ * Uses .skilltree/ directory structure:
2890
+ * basePath/.skilltree/skills/ <- skills stored here
2891
+ * basePath/.skilltree/.versions/ <- version history
2892
+ */
2893
+ declare class FilesystemStorageAdapter extends BaseStorageAdapter {
2894
+ private config;
2895
+ private skilltreeDir;
2896
+ private skillsDir;
2897
+ private versionsDir;
2898
+ constructor(config: FilesystemStorageConfig);
2899
+ initialize(): Promise<void>;
2900
+ /**
2901
+ * Get the base path for this storage
2902
+ */
2903
+ getBasePath(): string;
2904
+ saveSkill(skill: Skill): Promise<void>;
2905
+ getSkill(id: string, version?: string): Promise<Skill | null>;
2906
+ listSkills(filter?: SkillFilter): Promise<Skill[]>;
2907
+ deleteSkill(id: string, version?: string): Promise<boolean>;
2908
+ getVersionHistory(skillId: string): Promise<SkillVersion[]>;
2909
+ getLineage(skillId: string): Promise<SkillLineage | null>;
2910
+ searchSkills(query: string): Promise<Skill[]>;
2911
+ /**
2912
+ * Serialize skill to YAML frontmatter + Markdown format
2913
+ */
2914
+ private serializeSkill;
2915
+ /**
2916
+ * Build YAML frontmatter
2917
+ */
2918
+ private buildFrontmatter;
2919
+ /**
2920
+ * Parse skill from YAML frontmatter + Markdown content
2921
+ */
2922
+ private parseSkill;
2923
+ /**
2924
+ * Split content into frontmatter and body
2925
+ */
2926
+ private parseFrontmatterAndBody;
2927
+ /**
2928
+ * Extract a single-line YAML field
2929
+ */
2930
+ private extractYamlField;
2931
+ /**
2932
+ * Extract a multiline YAML field (using |)
2933
+ */
2934
+ private extractYamlMultiline;
2935
+ /**
2936
+ * Extract a YAML list
2937
+ */
2938
+ private extractYamlList;
2939
+ /**
2940
+ * Save a version snapshot
2941
+ */
2942
+ private saveVersionSnapshot;
2943
+ /**
2944
+ * Get a specific version of a skill
2945
+ */
2946
+ private getVersionedSkill;
2947
+ /**
2948
+ * Delete a specific version
2949
+ */
2950
+ private deleteVersion;
2951
+ /**
2952
+ * Create metadata for a skill
2953
+ */
2954
+ private createMetadata;
2955
+ /**
2956
+ * Load metadata for a skill directory
2957
+ */
2958
+ private loadMetadata;
2959
+ /**
2960
+ * Save metadata for a skill directory
2961
+ */
2962
+ private saveMetadata;
2963
+ /**
2964
+ * Compare semantic versions
2965
+ */
2966
+ private compareVersions;
2967
+ /**
2968
+ * Generate content hash
2969
+ */
2970
+ private hashContent;
2971
+ recordFork(sourceSkillId: string, fork: SkillFork): Promise<void>;
2972
+ }
2973
+
2860
2974
  /**
2861
2975
  * Cached Storage Adapter
2862
2976
  *
@@ -4975,6 +5089,6 @@ declare function importLocalSkillDir(dirPath: string, bank: SkillBank, options?:
4975
5089
  *
4976
5090
  * @packageDocumentation
4977
5091
  */
4978
- declare const VERSION = "0.2.0";
5092
+ declare const VERSION = "0.3.0";
4979
5093
 
4980
- export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BedrockEmbeddingConfig, BedrockEmbeddingProvider, type BedrockRerankConfig, BedrockRerankProvider, type BumpType, CachedStorageAdapter, type CachedStorageConfig, type CachingEmbeddingConfig, CachingEmbeddingProvider, CatalogRenderer, type CatalogRendererConfig, type ConfidenceThresholds, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, DEFAULT_FIELD_WEIGHTS, DEFAULT_SKILLNET_API, type DecisionMetrics, type DisclosureEvent, type DisclosureTrace, type DiscoveredSkill, type EmbeddingProvider, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, FeedbackRecorder, type FetchLike, type FetchResult, type FieldWeights, type ForkOptions, type FoundSkillMd, type FusionStrategy, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type HybridRetrievalOptions, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type LocalImportResult, type LogisticUtilityConfig, LogisticUtilityScorer, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type OutcomeCandidate, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedSkillMd, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RerankCandidate, type RerankProvider, type RerankResult, type RollbackOptions, type SageMakerEmbeddingConfig, SageMakerEmbeddingProvider, type ScoredSkill, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, type SkillFromMdOptions, type SkillFromMdResult, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillNamespace, SkillNetClient, type SkillNetClientConfig, type SkillNetConversionResult, type SkillNetImportResult, type SkillNetSearchOptions, type SkillNetSearchResult, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaskOutcome, type TaxonomyNode, TelemetryCollector, type UpstreamUpdate, type UtilityExample, type UtilityFeatures, type UtilityScorer, type UtilityTrainReport, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, bm25Scores, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, computeDecisionMetrics, conditionalHook, cosineSimilarity, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSkillNetClient, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, findSkillMdFiles, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, importLocalSkillDir, importSkillMdFile, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseGitHubUrl, parseSkillMd, parseVersion, reciprocalRankFusion, refactoringProfile, satisfiesRange, scoreSkillRelevance, scoreSkillsHybrid, securityProfile, skillFromSkillMd, slugify, sortVersions, splitFrontmatter, termSimilarity, testingProfile, tokenize, tokenizeList, writeAgentsMd };
5094
+ export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BedrockEmbeddingConfig, BedrockEmbeddingProvider, type BedrockRerankConfig, BedrockRerankProvider, type BumpType, CachedStorageAdapter, type CachedStorageConfig, type CachingEmbeddingConfig, CachingEmbeddingProvider, CatalogRenderer, type CatalogRendererConfig, type ConfidenceThresholds, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, DEFAULT_FIELD_WEIGHTS, DEFAULT_SKILLNET_API, type DecisionMetrics, type DisclosureEvent, type DisclosureTrace, type DiscoveredSkill, type EmbeddingProvider, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, FeedbackRecorder, type FetchLike, type FetchResult, type FieldWeights, FilesystemStorageAdapter, type FilesystemStorageConfig, type ForkOptions, type FoundSkillMd, type FusionStrategy, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type HybridRetrievalOptions, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type LocalImportResult, type LogisticUtilityConfig, LogisticUtilityScorer, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type OutcomeCandidate, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedSkillMd, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RerankCandidate, type RerankProvider, type RerankResult, type RollbackOptions, type SageMakerEmbeddingConfig, SageMakerEmbeddingProvider, type ScoredSkill, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, type SkillFromMdOptions, type SkillFromMdResult, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillNamespace, SkillNetClient, type SkillNetClientConfig, type SkillNetConversionResult, type SkillNetImportResult, type SkillNetSearchOptions, type SkillNetSearchResult, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaskOutcome, type TaxonomyNode, TelemetryCollector, type UpstreamUpdate, type UtilityExample, type UtilityFeatures, type UtilityScorer, type UtilityTrainReport, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, bm25Scores, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, computeDecisionMetrics, conditionalHook, cosineSimilarity, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSkillNetClient, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, findSkillMdFiles, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, importLocalSkillDir, importSkillMdFile, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseGitHubUrl, parseSkillMd, parseVersion, reciprocalRankFusion, refactoringProfile, satisfiesRange, scoreSkillRelevance, scoreSkillsHybrid, securityProfile, skillFromSkillMd, slugify, sortVersions, splitFrontmatter, termSimilarity, testingProfile, tokenize, tokenizeList, writeAgentsMd };
package/dist/index.js CHANGED
@@ -148,12 +148,17 @@ var init_base = __esm({
148
148
  df.set(t, (df.get(t) ?? 0) + 1);
149
149
  }
150
150
  }
151
+ const requiredTerms = [...new Set(queryTerms)].filter((qt) => (df.get(qt) ?? 0) > 0);
151
152
  const scored = docs.map((doc) => {
152
153
  let score = 0;
153
154
  const tf = /* @__PURE__ */ new Map();
154
155
  for (const t of doc.terms) {
155
156
  tf.set(t, (tf.get(t) ?? 0) + 1);
156
157
  }
158
+ const matchesAll = requiredTerms.every((qt) => (tf.get(qt) ?? 0) > 0);
159
+ if (!matchesAll) {
160
+ return { skill: doc.skill, score: 0 };
161
+ }
157
162
  for (const qt of queryTerms) {
158
163
  const termDf = df.get(qt) ?? 0;
159
164
  if (termDf === 0) continue;
@@ -38680,6 +38685,7 @@ __export(index_exports, {
38680
38685
  DEFAULT_SKILLNET_API: () => DEFAULT_SKILLNET_API,
38681
38686
  FederationManager: () => FederationManager,
38682
38687
  FeedbackRecorder: () => FeedbackRecorder,
38688
+ FilesystemStorageAdapter: () => FilesystemStorageAdapter,
38683
38689
  GitSyncAdapter: () => GitSyncAdapter,
38684
38690
  HookRegistry: () => HookRegistry,
38685
38691
  IndexerService: () => IndexerService,
@@ -47877,7 +47883,7 @@ async function importLocalSkillDir(dirPath, bank, options = {}) {
47877
47883
  }
47878
47884
 
47879
47885
  // src/index.ts
47880
- var VERSION = "0.2.0";
47886
+ var VERSION = "0.3.0";
47881
47887
  // Annotate the CommonJS export names for ESM import in node:
47882
47888
  0 && (module.exports = {
47883
47889
  AgentsGenerator,
@@ -47894,6 +47900,7 @@ var VERSION = "0.2.0";
47894
47900
  DEFAULT_SKILLNET_API,
47895
47901
  FederationManager,
47896
47902
  FeedbackRecorder,
47903
+ FilesystemStorageAdapter,
47897
47904
  GitSyncAdapter,
47898
47905
  HookRegistry,
47899
47906
  IndexerService,
package/dist/index.mjs CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  DEFAULT_SKILLNET_API,
10
10
  FederationManager,
11
11
  FeedbackRecorder,
12
+ FilesystemStorageAdapter,
12
13
  GitSyncAdapter,
13
14
  HookRegistry,
14
15
  IndexerService,
@@ -82,10 +83,10 @@ import {
82
83
  testingProfile,
83
84
  tokenize,
84
85
  tokenizeList
85
- } from "./chunk-P5GJJ4JB.mjs";
86
+ } from "./chunk-GPN6UQVR.mjs";
86
87
  import {
87
88
  MemoryStorageAdapter
88
- } from "./chunk-4TFMKAVC.mjs";
89
+ } from "./chunk-MBF2MJS5.mjs";
89
90
  import {
90
91
  AgentsGenerator,
91
92
  AgentsParser,
@@ -114,6 +115,7 @@ export {
114
115
  DEFAULT_SKILLNET_API,
115
116
  FederationManager,
116
117
  FeedbackRecorder,
118
+ FilesystemStorageAdapter,
117
119
  GitSyncAdapter,
118
120
  HookRegistry,
119
121
  IndexerService,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SQLiteStorageAdapter
3
- } from "./chunk-4TFMKAVC.mjs";
3
+ } from "./chunk-MBF2MJS5.mjs";
4
4
  import "./chunk-QZ7TP4HQ.mjs";
5
5
  export {
6
6
  SQLiteStorageAdapter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skill-tree",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Library for managing agent skill versions and evolution - extract, iterate, and adapt skills from agent trajectories",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",