skill-tree 0.1.6 → 0.2.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/README.md +27 -2
- package/dist/cli/index.js +305 -211
- package/dist/cli/index.mjs +461 -361
- package/dist/index.d.mts +76 -49
- package/dist/index.d.ts +76 -49
- package/dist/index.js +233 -160
- package/dist/index.mjs +370 -289
- package/package.json +2 -2
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -30,11 +30,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
mod
|
|
31
31
|
));
|
|
32
32
|
|
|
33
|
+
// node_modules/tsup/assets/cjs_shims.js
|
|
34
|
+
var init_cjs_shims = __esm({
|
|
35
|
+
"node_modules/tsup/assets/cjs_shims.js"() {
|
|
36
|
+
"use strict";
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
33
40
|
// src/storage/base.ts
|
|
34
41
|
var BaseStorageAdapter, MemoryStorageAdapter;
|
|
35
42
|
var init_base = __esm({
|
|
36
43
|
"src/storage/base.ts"() {
|
|
37
44
|
"use strict";
|
|
45
|
+
init_cjs_shims();
|
|
38
46
|
BaseStorageAdapter = class {
|
|
39
47
|
constructor() {
|
|
40
48
|
this.initialized = false;
|
|
@@ -63,9 +71,6 @@ var init_base = __esm({
|
|
|
63
71
|
if (filter.author && skill.author !== filter.author) {
|
|
64
72
|
return false;
|
|
65
73
|
}
|
|
66
|
-
if (filter.minSuccessRate !== void 0 && skill.metrics.successRate < filter.minSuccessRate) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
74
|
if (filter.createdAfter && skill.createdAt < filter.createdAfter) {
|
|
70
75
|
return false;
|
|
71
76
|
}
|
|
@@ -307,6 +312,7 @@ var import_better_sqlite3, path7, fs7, SCHEMA_VERSION, SQLiteStorageAdapter;
|
|
|
307
312
|
var init_sqlite = __esm({
|
|
308
313
|
"src/storage/sqlite.ts"() {
|
|
309
314
|
"use strict";
|
|
315
|
+
init_cjs_shims();
|
|
310
316
|
import_better_sqlite3 = __toESM(require("better-sqlite3"));
|
|
311
317
|
path7 = __toESM(require("path"));
|
|
312
318
|
fs7 = __toESM(require("fs"));
|
|
@@ -358,12 +364,19 @@ var init_sqlite = __esm({
|
|
|
358
364
|
status TEXT NOT NULL,
|
|
359
365
|
parent_version TEXT,
|
|
360
366
|
derived_from TEXT,
|
|
361
|
-
metrics TEXT NOT NULL,
|
|
362
367
|
source TEXT,
|
|
363
368
|
taxonomy TEXT,
|
|
364
369
|
external_source TEXT
|
|
365
370
|
)
|
|
366
371
|
`);
|
|
372
|
+
try {
|
|
373
|
+
db.exec("ALTER TABLE skills DROP COLUMN metrics");
|
|
374
|
+
} catch {
|
|
375
|
+
const cols = db.prepare("PRAGMA table_info(skills)").all();
|
|
376
|
+
if (cols.some((c) => c.name === "metrics")) {
|
|
377
|
+
this.rebuildSkillsTableWithoutMetrics(db, cols);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
367
380
|
db.exec(`
|
|
368
381
|
CREATE TABLE IF NOT EXISTS skill_versions (
|
|
369
382
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -527,6 +540,75 @@ var init_sqlite = __esm({
|
|
|
527
540
|
db.prepare("UPDATE schema_version SET version = ?").run(SCHEMA_VERSION);
|
|
528
541
|
}
|
|
529
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* Rebuild the `skills` table without the legacy `metrics` column.
|
|
545
|
+
*
|
|
546
|
+
* Used as the fallback path on SQLite < 3.35 where ALTER TABLE DROP
|
|
547
|
+
* COLUMN isn't supported. Uses the standard "table dance" pattern:
|
|
548
|
+
* CREATE NEW → INSERT FROM OLD → DROP OLD → RENAME, inside a single
|
|
549
|
+
* transaction so a partial state can't outlive a crash.
|
|
550
|
+
*
|
|
551
|
+
* The `existingCols` arg is the full PRAGMA table_info output for the
|
|
552
|
+
* legacy table — we use it to figure out which columns to copy. Some
|
|
553
|
+
* legacy installs may have a subset of the current schema's columns
|
|
554
|
+
* (e.g., taxonomy/external_source were added in v2, related in v3),
|
|
555
|
+
* so we only copy columns that exist on both sides.
|
|
556
|
+
*/
|
|
557
|
+
rebuildSkillsTableWithoutMetrics(db, existingCols) {
|
|
558
|
+
const NEW_SCHEMA_COLUMNS = [
|
|
559
|
+
"id",
|
|
560
|
+
"version",
|
|
561
|
+
"name",
|
|
562
|
+
"description",
|
|
563
|
+
"instructions",
|
|
564
|
+
"related",
|
|
565
|
+
"author",
|
|
566
|
+
"tags",
|
|
567
|
+
"created_at",
|
|
568
|
+
"updated_at",
|
|
569
|
+
"status",
|
|
570
|
+
"parent_version",
|
|
571
|
+
"derived_from",
|
|
572
|
+
"source",
|
|
573
|
+
"taxonomy",
|
|
574
|
+
"external_source"
|
|
575
|
+
];
|
|
576
|
+
const sourceNames = new Set(existingCols.map((c) => c.name));
|
|
577
|
+
const copyable = NEW_SCHEMA_COLUMNS.filter((c) => sourceNames.has(c));
|
|
578
|
+
const copyList = copyable.join(", ");
|
|
579
|
+
db.exec("BEGIN");
|
|
580
|
+
try {
|
|
581
|
+
db.exec(`
|
|
582
|
+
CREATE TABLE skills_new (
|
|
583
|
+
id TEXT PRIMARY KEY,
|
|
584
|
+
version TEXT NOT NULL,
|
|
585
|
+
name TEXT NOT NULL,
|
|
586
|
+
description TEXT,
|
|
587
|
+
instructions TEXT NOT NULL DEFAULT '',
|
|
588
|
+
related TEXT,
|
|
589
|
+
author TEXT NOT NULL,
|
|
590
|
+
tags TEXT NOT NULL,
|
|
591
|
+
created_at TEXT NOT NULL,
|
|
592
|
+
updated_at TEXT NOT NULL,
|
|
593
|
+
status TEXT NOT NULL,
|
|
594
|
+
parent_version TEXT,
|
|
595
|
+
derived_from TEXT,
|
|
596
|
+
source TEXT,
|
|
597
|
+
taxonomy TEXT,
|
|
598
|
+
external_source TEXT
|
|
599
|
+
)
|
|
600
|
+
`);
|
|
601
|
+
db.exec(
|
|
602
|
+
`INSERT INTO skills_new (${copyList}) SELECT ${copyList} FROM skills`
|
|
603
|
+
);
|
|
604
|
+
db.exec("DROP TABLE skills");
|
|
605
|
+
db.exec("ALTER TABLE skills_new RENAME TO skills");
|
|
606
|
+
db.exec("COMMIT");
|
|
607
|
+
} catch (err) {
|
|
608
|
+
db.exec("ROLLBACK");
|
|
609
|
+
throw err;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
530
612
|
getDb() {
|
|
531
613
|
if (!this.db) {
|
|
532
614
|
throw new Error("Database not initialized. Call initialize() first.");
|
|
@@ -539,10 +621,10 @@ var init_sqlite = __esm({
|
|
|
539
621
|
const stmt = db.prepare(`
|
|
540
622
|
INSERT OR REPLACE INTO skills (
|
|
541
623
|
id, version, name, description, instructions, related, author, tags,
|
|
542
|
-
created_at, updated_at, status, parent_version, derived_from,
|
|
624
|
+
created_at, updated_at, status, parent_version, derived_from,
|
|
543
625
|
source, taxonomy, external_source
|
|
544
626
|
) VALUES (
|
|
545
|
-
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
|
627
|
+
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
|
546
628
|
)
|
|
547
629
|
`);
|
|
548
630
|
stmt.run(
|
|
@@ -559,7 +641,6 @@ var init_sqlite = __esm({
|
|
|
559
641
|
skill.status,
|
|
560
642
|
skill.parentVersion || null,
|
|
561
643
|
skill.derivedFrom ? JSON.stringify(skill.derivedFrom) : null,
|
|
562
|
-
JSON.stringify(skill.metrics),
|
|
563
644
|
skill.source ? JSON.stringify(skill.source) : null,
|
|
564
645
|
skill.taxonomy ? JSON.stringify(skill.taxonomy) : null,
|
|
565
646
|
skill.externalSource ? JSON.stringify({
|
|
@@ -654,10 +735,6 @@ var init_sqlite = __esm({
|
|
|
654
735
|
sql += " AND author = ?";
|
|
655
736
|
params.push(filter.author);
|
|
656
737
|
}
|
|
657
|
-
if (filter?.minSuccessRate !== void 0) {
|
|
658
|
-
sql += " AND json_extract(metrics, '$.successRate') >= ?";
|
|
659
|
-
params.push(filter.minSuccessRate);
|
|
660
|
-
}
|
|
661
738
|
if (filter?.createdAfter) {
|
|
662
739
|
sql += " AND created_at >= ?";
|
|
663
740
|
params.push(filter.createdAfter.toISOString());
|
|
@@ -1052,7 +1129,6 @@ var init_sqlite = __esm({
|
|
|
1052
1129
|
status: row.status,
|
|
1053
1130
|
parentVersion: row.parent_version || void 0,
|
|
1054
1131
|
derivedFrom: row.derived_from ? JSON.parse(row.derived_from) : void 0,
|
|
1055
|
-
metrics: JSON.parse(row.metrics),
|
|
1056
1132
|
source: row.source ? JSON.parse(row.source) : void 0,
|
|
1057
1133
|
taxonomy: row.taxonomy ? JSON.parse(row.taxonomy) : void 0,
|
|
1058
1134
|
externalSource: externalSource ? {
|
|
@@ -1069,11 +1145,7 @@ var init_sqlite = __esm({
|
|
|
1069
1145
|
source: skill.source ? {
|
|
1070
1146
|
...skill.source,
|
|
1071
1147
|
importedAt: skill.source.importedAt.toISOString()
|
|
1072
|
-
} : void 0
|
|
1073
|
-
metrics: {
|
|
1074
|
-
...skill.metrics,
|
|
1075
|
-
lastUsed: skill.metrics.lastUsed?.toISOString()
|
|
1076
|
-
}
|
|
1148
|
+
} : void 0
|
|
1077
1149
|
};
|
|
1078
1150
|
}
|
|
1079
1151
|
deserializeSkill(data) {
|
|
@@ -1084,11 +1156,7 @@ var init_sqlite = __esm({
|
|
|
1084
1156
|
source: data.source ? {
|
|
1085
1157
|
...data.source,
|
|
1086
1158
|
importedAt: new Date(data.source.importedAt)
|
|
1087
|
-
} : void 0
|
|
1088
|
-
metrics: {
|
|
1089
|
-
...data.metrics,
|
|
1090
|
-
lastUsed: data.metrics.lastUsed ? new Date(data.metrics.lastUsed) : void 0
|
|
1091
|
-
}
|
|
1159
|
+
} : void 0
|
|
1092
1160
|
};
|
|
1093
1161
|
}
|
|
1094
1162
|
hashSkill(skill) {
|
|
@@ -1112,6 +1180,7 @@ var DEFAULT_AGENTS_CONFIG;
|
|
|
1112
1180
|
var init_types = __esm({
|
|
1113
1181
|
"src/agents/types.ts"() {
|
|
1114
1182
|
"use strict";
|
|
1183
|
+
init_cjs_shims();
|
|
1115
1184
|
DEFAULT_AGENTS_CONFIG = {
|
|
1116
1185
|
format: "xml",
|
|
1117
1186
|
includeIds: true,
|
|
@@ -1126,6 +1195,7 @@ var AgentsGenerator;
|
|
|
1126
1195
|
var init_generator = __esm({
|
|
1127
1196
|
"src/agents/generator.ts"() {
|
|
1128
1197
|
"use strict";
|
|
1198
|
+
init_cjs_shims();
|
|
1129
1199
|
init_types();
|
|
1130
1200
|
AgentsGenerator = class {
|
|
1131
1201
|
constructor(config2) {
|
|
@@ -1294,9 +1364,6 @@ ${this.indentContent(skill.instructions, 4)}
|
|
|
1294
1364
|
if (filter.tags && filter.tags.length > 0) {
|
|
1295
1365
|
result = result.filter((s) => s.tags.some((t) => filter.tags.includes(t)));
|
|
1296
1366
|
}
|
|
1297
|
-
if (filter.minSuccessRate !== void 0) {
|
|
1298
|
-
result = result.filter((s) => s.metrics.successRate >= filter.minSuccessRate);
|
|
1299
|
-
}
|
|
1300
1367
|
if (filter.limit) {
|
|
1301
1368
|
result = result.slice(0, filter.limit);
|
|
1302
1369
|
}
|
|
@@ -1340,6 +1407,7 @@ var AgentsParser;
|
|
|
1340
1407
|
var init_parser = __esm({
|
|
1341
1408
|
"src/agents/parser.ts"() {
|
|
1342
1409
|
"use strict";
|
|
1410
|
+
init_cjs_shims();
|
|
1343
1411
|
AgentsParser = class {
|
|
1344
1412
|
/**
|
|
1345
1413
|
* Parse AGENTS.md content
|
|
@@ -1393,11 +1461,6 @@ var init_parser = __esm({
|
|
|
1393
1461
|
createdAt: defaults?.createdAt || now,
|
|
1394
1462
|
updatedAt: now,
|
|
1395
1463
|
status: "active",
|
|
1396
|
-
metrics: defaults?.metrics || {
|
|
1397
|
-
usageCount: 0,
|
|
1398
|
-
successRate: 0,
|
|
1399
|
-
feedbackScores: []
|
|
1400
|
-
},
|
|
1401
1464
|
source: {
|
|
1402
1465
|
type: "imported",
|
|
1403
1466
|
location: "AGENTS.md",
|
|
@@ -1606,6 +1669,7 @@ var fs9, path9, AgentsSync;
|
|
|
1606
1669
|
var init_sync = __esm({
|
|
1607
1670
|
"src/agents/sync.ts"() {
|
|
1608
1671
|
"use strict";
|
|
1672
|
+
init_cjs_shims();
|
|
1609
1673
|
fs9 = __toESM(require("fs"));
|
|
1610
1674
|
path9 = __toESM(require("path"));
|
|
1611
1675
|
init_generator();
|
|
@@ -1765,8 +1829,6 @@ var init_sync = __esm({
|
|
|
1765
1829
|
// Keep existing ID
|
|
1766
1830
|
createdAt: existing.createdAt,
|
|
1767
1831
|
// Preserve creation date
|
|
1768
|
-
metrics: existing.metrics,
|
|
1769
|
-
// Preserve usage metrics
|
|
1770
1832
|
source: incoming.source || existing.source,
|
|
1771
1833
|
parentVersion: existing.version
|
|
1772
1834
|
// Track update lineage
|
|
@@ -1777,9 +1839,17 @@ var init_sync = __esm({
|
|
|
1777
1839
|
});
|
|
1778
1840
|
|
|
1779
1841
|
// src/cli/index.ts
|
|
1780
|
-
|
|
1842
|
+
init_cjs_shims();
|
|
1843
|
+
var import_commander38 = require("commander");
|
|
1844
|
+
|
|
1845
|
+
// src/index.ts
|
|
1846
|
+
init_cjs_shims();
|
|
1847
|
+
|
|
1848
|
+
// src/skill-bank.ts
|
|
1849
|
+
init_cjs_shims();
|
|
1781
1850
|
|
|
1782
1851
|
// src/types.ts
|
|
1852
|
+
init_cjs_shims();
|
|
1783
1853
|
function hasTaxonomySupport(storage) {
|
|
1784
1854
|
return typeof storage.placeInTaxonomy === "function";
|
|
1785
1855
|
}
|
|
@@ -1787,11 +1857,16 @@ function hasForkSupport(storage) {
|
|
|
1787
1857
|
return typeof storage.recordFork === "function";
|
|
1788
1858
|
}
|
|
1789
1859
|
|
|
1860
|
+
// src/sync/sync-manager.ts
|
|
1861
|
+
init_cjs_shims();
|
|
1862
|
+
|
|
1790
1863
|
// src/sync/git-sync-adapter.ts
|
|
1864
|
+
init_cjs_shims();
|
|
1791
1865
|
var fs2 = __toESM(require("fs"));
|
|
1792
1866
|
var path2 = __toESM(require("path"));
|
|
1793
1867
|
|
|
1794
1868
|
// src/sync/conflict-store.ts
|
|
1869
|
+
init_cjs_shims();
|
|
1795
1870
|
var fs = __toESM(require("fs"));
|
|
1796
1871
|
var path = __toESM(require("path"));
|
|
1797
1872
|
var ConflictStore = class {
|
|
@@ -2007,10 +2082,6 @@ var ConflictStore = class {
|
|
|
2007
2082
|
...skill,
|
|
2008
2083
|
createdAt: skill.createdAt instanceof Date ? skill.createdAt.toISOString() : skill.createdAt,
|
|
2009
2084
|
updatedAt: skill.updatedAt instanceof Date ? skill.updatedAt.toISOString() : skill.updatedAt,
|
|
2010
|
-
metrics: {
|
|
2011
|
-
...skill.metrics,
|
|
2012
|
-
lastUsed: skill.metrics?.lastUsed instanceof Date ? skill.metrics.lastUsed.toISOString() : skill.metrics?.lastUsed
|
|
2013
|
-
},
|
|
2014
2085
|
source: skill.source ? {
|
|
2015
2086
|
...skill.source,
|
|
2016
2087
|
importedAt: skill.source.importedAt instanceof Date ? skill.source.importedAt.toISOString() : skill.source.importedAt
|
|
@@ -2022,10 +2093,6 @@ var ConflictStore = class {
|
|
|
2022
2093
|
...data,
|
|
2023
2094
|
createdAt: new Date(data.createdAt),
|
|
2024
2095
|
updatedAt: new Date(data.updatedAt),
|
|
2025
|
-
metrics: {
|
|
2026
|
-
...data.metrics,
|
|
2027
|
-
lastUsed: data.metrics?.lastUsed ? new Date(data.metrics.lastUsed) : void 0
|
|
2028
|
-
},
|
|
2029
2096
|
source: data.source ? {
|
|
2030
2097
|
...data.source,
|
|
2031
2098
|
importedAt: new Date(data.source.importedAt)
|
|
@@ -2592,12 +2659,7 @@ ${remoteValue}`;
|
|
|
2592
2659
|
tags: metadata.tags ? metadata.tags.split(",").map((t) => t.trim()) : [],
|
|
2593
2660
|
createdAt: metadata.created ? new Date(metadata.created) : /* @__PURE__ */ new Date(),
|
|
2594
2661
|
updatedAt: metadata.updated ? new Date(metadata.updated) : /* @__PURE__ */ new Date(),
|
|
2595
|
-
status: isValidStatus(metadata.status) ? metadata.status : "active"
|
|
2596
|
-
metrics: {
|
|
2597
|
-
usageCount: 0,
|
|
2598
|
-
successRate: 0,
|
|
2599
|
-
feedbackScores: []
|
|
2600
|
-
}
|
|
2662
|
+
status: isValidStatus(metadata.status) ? metadata.status : "active"
|
|
2601
2663
|
};
|
|
2602
2664
|
}
|
|
2603
2665
|
async writeSkill(skill) {
|
|
@@ -2852,7 +2914,14 @@ var SyncManager = class {
|
|
|
2852
2914
|
}
|
|
2853
2915
|
};
|
|
2854
2916
|
|
|
2917
|
+
// src/serving/graph-server.ts
|
|
2918
|
+
init_cjs_shims();
|
|
2919
|
+
|
|
2920
|
+
// src/serving/catalog-renderer.ts
|
|
2921
|
+
init_cjs_shims();
|
|
2922
|
+
|
|
2855
2923
|
// src/serving/xml-utils.ts
|
|
2924
|
+
init_cjs_shims();
|
|
2856
2925
|
function escapeXml(text) {
|
|
2857
2926
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2858
2927
|
}
|
|
@@ -3059,6 +3128,7 @@ var CatalogRenderer = class _CatalogRenderer {
|
|
|
3059
3128
|
};
|
|
3060
3129
|
|
|
3061
3130
|
// src/serving/loadout-compiler.ts
|
|
3131
|
+
init_cjs_shims();
|
|
3062
3132
|
var DEFAULT_CONFIG2 = {
|
|
3063
3133
|
defaultMaxSkills: 15,
|
|
3064
3134
|
defaultStatus: ["active"],
|
|
@@ -3073,7 +3143,24 @@ var LoadoutCompiler = class {
|
|
|
3073
3143
|
};
|
|
3074
3144
|
}
|
|
3075
3145
|
/**
|
|
3076
|
-
* Main entry point - compile skills from criteria
|
|
3146
|
+
* Main entry point - compile skills from criteria.
|
|
3147
|
+
*
|
|
3148
|
+
* Filter pipeline order:
|
|
3149
|
+
* 1. status (initial query)
|
|
3150
|
+
* 2. exclude (drop matching IDs)
|
|
3151
|
+
* 3. tags / tagsAll
|
|
3152
|
+
* 4. author
|
|
3153
|
+
* 5. semantic (currently no-op)
|
|
3154
|
+
* 6. relationships (rootSkills traversal)
|
|
3155
|
+
* 7. **include** — presence guarantee: ensures every ID in the
|
|
3156
|
+
* include list is in the result regardless of the filters above,
|
|
3157
|
+
* fetching missing ones from storage as needed. `exclude` still
|
|
3158
|
+
* wins (excluded IDs are removed from the include list before
|
|
3159
|
+
* this step).
|
|
3160
|
+
* 8. limits (maxSkills, maxTokens)
|
|
3161
|
+
*
|
|
3162
|
+
* For "restrict to exactly these skills" semantics, combine
|
|
3163
|
+
* `include: [...]` with `maxSkills: include.length`.
|
|
3077
3164
|
*/
|
|
3078
3165
|
async compile(criteria) {
|
|
3079
3166
|
const status = criteria.status ?? this.config.defaultStatus;
|
|
@@ -3083,6 +3170,7 @@ var LoadoutCompiler = class {
|
|
|
3083
3170
|
candidates = this.applyQualityFilters(candidates, criteria);
|
|
3084
3171
|
candidates = await this.applySemanticFilters(candidates, criteria);
|
|
3085
3172
|
candidates = await this.applyRelationshipFilters(candidates, criteria);
|
|
3173
|
+
candidates = await this.ensureIncludedPresent(candidates, criteria);
|
|
3086
3174
|
candidates = this.applyLimits(candidates, criteria);
|
|
3087
3175
|
return candidates;
|
|
3088
3176
|
}
|
|
@@ -3128,7 +3216,9 @@ var LoadoutCompiler = class {
|
|
|
3128
3216
|
// Filter Methods
|
|
3129
3217
|
// ===========================================================================
|
|
3130
3218
|
/**
|
|
3131
|
-
* Apply explicit
|
|
3219
|
+
* Apply explicit exclude filter. Include is handled separately at the
|
|
3220
|
+
* compile level (see `ensureIncludedPresent`) so it can guarantee
|
|
3221
|
+
* presence regardless of the other filters in this method or below.
|
|
3132
3222
|
*/
|
|
3133
3223
|
applyExplicitFilters(skills, criteria) {
|
|
3134
3224
|
let result = skills;
|
|
@@ -3136,15 +3226,6 @@ var LoadoutCompiler = class {
|
|
|
3136
3226
|
const excludeSet = new Set(criteria.exclude);
|
|
3137
3227
|
result = result.filter((s) => !excludeSet.has(s.id));
|
|
3138
3228
|
}
|
|
3139
|
-
if (criteria.include && criteria.include.length > 0) {
|
|
3140
|
-
const includeSet = new Set(criteria.include);
|
|
3141
|
-
const currentIds = new Set(result.map((s) => s.id));
|
|
3142
|
-
const includedSkills = result.filter((s) => includeSet.has(s.id));
|
|
3143
|
-
const otherSkills = result.filter((s) => !includeSet.has(s.id));
|
|
3144
|
-
if (includedSkills.length > 0) {
|
|
3145
|
-
result = [...includedSkills, ...otherSkills];
|
|
3146
|
-
}
|
|
3147
|
-
}
|
|
3148
3229
|
return result;
|
|
3149
3230
|
}
|
|
3150
3231
|
/**
|
|
@@ -3168,11 +3249,6 @@ var LoadoutCompiler = class {
|
|
|
3168
3249
|
*/
|
|
3169
3250
|
applyQualityFilters(skills, criteria) {
|
|
3170
3251
|
let result = skills;
|
|
3171
|
-
if (criteria.minSuccessRate !== void 0) {
|
|
3172
|
-
result = result.filter(
|
|
3173
|
-
(s) => s.metrics.successRate >= criteria.minSuccessRate
|
|
3174
|
-
);
|
|
3175
|
-
}
|
|
3176
3252
|
if (criteria.author) {
|
|
3177
3253
|
result = result.filter((s) => s.author === criteria.author);
|
|
3178
3254
|
}
|
|
@@ -3230,27 +3306,48 @@ var LoadoutCompiler = class {
|
|
|
3230
3306
|
}
|
|
3231
3307
|
return skills.filter((s) => result.has(s.id));
|
|
3232
3308
|
}
|
|
3309
|
+
/**
|
|
3310
|
+
* Ensure every ID in `criteria.include` is present in the result,
|
|
3311
|
+
* regardless of which earlier filter would have dropped it. Missing
|
|
3312
|
+
* skills are fetched directly from storage.
|
|
3313
|
+
*
|
|
3314
|
+
* `criteria.exclude` still wins: an ID listed in both `include` and
|
|
3315
|
+
* `exclude` is treated as excluded (consistent with openteams' "deny
|
|
3316
|
+
* wins" inheritance rule on permissions).
|
|
3317
|
+
*
|
|
3318
|
+
* Included skills are placed at the front of the result, preserving
|
|
3319
|
+
* the order of `criteria.include`. Other skills retain their relative
|
|
3320
|
+
* order behind them.
|
|
3321
|
+
*/
|
|
3322
|
+
async ensureIncludedPresent(current, criteria) {
|
|
3323
|
+
if (!criteria.include?.length) return current;
|
|
3324
|
+
const excludeSet = new Set(criteria.exclude ?? []);
|
|
3325
|
+
const effectiveInclude = criteria.include.filter(
|
|
3326
|
+
(id) => !excludeSet.has(id)
|
|
3327
|
+
);
|
|
3328
|
+
if (effectiveInclude.length === 0) return current;
|
|
3329
|
+
const currentById = new Map(current.map((s) => [s.id, s]));
|
|
3330
|
+
const ordered = [];
|
|
3331
|
+
for (const id of effectiveInclude) {
|
|
3332
|
+
const existing = currentById.get(id);
|
|
3333
|
+
if (existing) {
|
|
3334
|
+
ordered.push(existing);
|
|
3335
|
+
currentById.delete(id);
|
|
3336
|
+
continue;
|
|
3337
|
+
}
|
|
3338
|
+
const fetched = await this.storage.getSkill(id);
|
|
3339
|
+
if (fetched) {
|
|
3340
|
+
ordered.push(fetched);
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3343
|
+
return [...ordered, ...currentById.values()];
|
|
3344
|
+
}
|
|
3233
3345
|
/**
|
|
3234
3346
|
* Apply limits and sorting
|
|
3235
3347
|
*/
|
|
3236
3348
|
applyLimits(skills, criteria) {
|
|
3237
3349
|
let result = skills;
|
|
3238
|
-
if (criteria.priorityOrder) {
|
|
3239
|
-
result = [...result].sort((a, b) => {
|
|
3240
|
-
switch (criteria.priorityOrder) {
|
|
3241
|
-
case "usage":
|
|
3242
|
-
return b.metrics.usageCount - a.metrics.usageCount;
|
|
3243
|
-
case "successRate":
|
|
3244
|
-
return b.metrics.successRate - a.metrics.successRate;
|
|
3245
|
-
case "recent":
|
|
3246
|
-
const aDate = a.metrics.lastUsed?.getTime() ?? 0;
|
|
3247
|
-
const bDate = b.metrics.lastUsed?.getTime() ?? 0;
|
|
3248
|
-
return bDate - aDate;
|
|
3249
|
-
case "relevance":
|
|
3250
|
-
default:
|
|
3251
|
-
return 0;
|
|
3252
|
-
}
|
|
3253
|
-
});
|
|
3350
|
+
if (criteria.priorityOrder === "relevance") {
|
|
3254
3351
|
}
|
|
3255
3352
|
const maxSkills = criteria.maxSkills ?? this.config.defaultMaxSkills;
|
|
3256
3353
|
if (result.length > maxSkills) {
|
|
@@ -3287,6 +3384,7 @@ var LoadoutCompiler = class {
|
|
|
3287
3384
|
};
|
|
3288
3385
|
|
|
3289
3386
|
// src/serving/project-detector.ts
|
|
3387
|
+
init_cjs_shims();
|
|
3290
3388
|
var import_fs = require("fs");
|
|
3291
3389
|
var import_path = require("path");
|
|
3292
3390
|
var ProjectDetector = class _ProjectDetector {
|
|
@@ -3522,6 +3620,7 @@ var ProjectDetector = class _ProjectDetector {
|
|
|
3522
3620
|
};
|
|
3523
3621
|
|
|
3524
3622
|
// src/serving/view-renderer.ts
|
|
3623
|
+
init_cjs_shims();
|
|
3525
3624
|
var DEFAULT_CONFIG3 = {
|
|
3526
3625
|
includeTokenEstimates: false,
|
|
3527
3626
|
maxSummaryLength: 150
|
|
@@ -3717,6 +3816,7 @@ var ViewRenderer = class {
|
|
|
3717
3816
|
};
|
|
3718
3817
|
|
|
3719
3818
|
// src/serving/profiles/index.ts
|
|
3819
|
+
init_cjs_shims();
|
|
3720
3820
|
var codeReviewProfile = {
|
|
3721
3821
|
tags: ["review", "quality", "security", "best-practices"],
|
|
3722
3822
|
taskDescription: "review code for quality, security, and best practices",
|
|
@@ -3741,7 +3841,6 @@ var securityProfile = {
|
|
|
3741
3841
|
tagsAll: ["security"],
|
|
3742
3842
|
taskDescription: "security review, vulnerability detection, secure coding",
|
|
3743
3843
|
maxSkills: 8,
|
|
3744
|
-
minSuccessRate: 0.7,
|
|
3745
3844
|
priorityOrder: "relevance"
|
|
3746
3845
|
};
|
|
3747
3846
|
var testingProfile = {
|
|
@@ -3989,16 +4088,6 @@ var SkillGraphServer = class {
|
|
|
3989
4088
|
this.emit({ type: "skill:collapsed", skillId });
|
|
3990
4089
|
return true;
|
|
3991
4090
|
}
|
|
3992
|
-
/**
|
|
3993
|
-
* Record skill usage (for LRU tracking and auto-expansion)
|
|
3994
|
-
*/
|
|
3995
|
-
recordUsage(skillId) {
|
|
3996
|
-
if (!this.state.available.has(skillId)) return;
|
|
3997
|
-
this.touchLru(skillId);
|
|
3998
|
-
if (this.config.autoExpandOnUse && !this.state.expanded.has(skillId)) {
|
|
3999
|
-
this.expandSkill(skillId);
|
|
4000
|
-
}
|
|
4001
|
-
}
|
|
4002
4091
|
// ===========================================================================
|
|
4003
4092
|
// AGENT API - Methods for agent-side modifications
|
|
4004
4093
|
// ===========================================================================
|
|
@@ -4287,6 +4376,7 @@ var SkillGraphServer = class {
|
|
|
4287
4376
|
};
|
|
4288
4377
|
|
|
4289
4378
|
// src/serving/interfaces.ts
|
|
4379
|
+
init_cjs_shims();
|
|
4290
4380
|
function createStorageView(storage) {
|
|
4291
4381
|
return {
|
|
4292
4382
|
getSkill: storage.getSkill.bind(storage),
|
|
@@ -4326,7 +4416,11 @@ function createServingEventBridge() {
|
|
|
4326
4416
|
};
|
|
4327
4417
|
}
|
|
4328
4418
|
|
|
4419
|
+
// src/federation/index.ts
|
|
4420
|
+
init_cjs_shims();
|
|
4421
|
+
|
|
4329
4422
|
// src/federation/remote-store.ts
|
|
4423
|
+
init_cjs_shims();
|
|
4330
4424
|
var fs3 = __toESM(require("fs"));
|
|
4331
4425
|
var path3 = __toESM(require("path"));
|
|
4332
4426
|
var REMOTES_FILE = "remotes.json";
|
|
@@ -4522,12 +4616,14 @@ var RemoteStore = class {
|
|
|
4522
4616
|
};
|
|
4523
4617
|
|
|
4524
4618
|
// src/federation/remote-manager.ts
|
|
4619
|
+
init_cjs_shims();
|
|
4525
4620
|
var fs5 = __toESM(require("fs"));
|
|
4526
4621
|
var path5 = __toESM(require("path"));
|
|
4527
4622
|
var import_child_process = require("child_process");
|
|
4528
4623
|
var import_util = require("util");
|
|
4529
4624
|
|
|
4530
4625
|
// src/federation/skilltree-config.ts
|
|
4626
|
+
init_cjs_shims();
|
|
4531
4627
|
var fs4 = __toESM(require("fs"));
|
|
4532
4628
|
var path4 = __toESM(require("path"));
|
|
4533
4629
|
function resolveSkilltreeDir(repoRoot) {
|
|
@@ -5116,12 +5212,7 @@ ${err.stderr || err.message}`
|
|
|
5116
5212
|
tags: this.parseTags(metadata.tags),
|
|
5117
5213
|
createdAt: metadata.created ? new Date(metadata.created) : /* @__PURE__ */ new Date(),
|
|
5118
5214
|
updatedAt: metadata.updated ? new Date(metadata.updated) : /* @__PURE__ */ new Date(),
|
|
5119
|
-
status: metadata.status || "active"
|
|
5120
|
-
metrics: {
|
|
5121
|
-
usageCount: parseInt(metadata.usageCount) || 0,
|
|
5122
|
-
successRate: parseFloat(metadata.successRate) || 0,
|
|
5123
|
-
feedbackScores: []
|
|
5124
|
-
}
|
|
5215
|
+
status: metadata.status || "active"
|
|
5125
5216
|
};
|
|
5126
5217
|
}
|
|
5127
5218
|
/**
|
|
@@ -5190,9 +5281,6 @@ ${body.join("\n")}
|
|
|
5190
5281
|
if (filter.author && skill.author !== filter.author) {
|
|
5191
5282
|
return false;
|
|
5192
5283
|
}
|
|
5193
|
-
if (filter.minSuccessRate !== void 0 && skill.metrics.successRate < filter.minSuccessRate) {
|
|
5194
|
-
return false;
|
|
5195
|
-
}
|
|
5196
5284
|
if (filter.createdAfter && skill.createdAt < filter.createdAfter) {
|
|
5197
5285
|
return false;
|
|
5198
5286
|
}
|
|
@@ -5204,7 +5292,11 @@ ${body.join("\n")}
|
|
|
5204
5292
|
}
|
|
5205
5293
|
};
|
|
5206
5294
|
|
|
5295
|
+
// src/federation/federation-manager.ts
|
|
5296
|
+
init_cjs_shims();
|
|
5297
|
+
|
|
5207
5298
|
// src/versioning/semver.ts
|
|
5299
|
+
init_cjs_shims();
|
|
5208
5300
|
function parseVersion(version) {
|
|
5209
5301
|
const match = version.match(
|
|
5210
5302
|
/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+([a-zA-Z0-9.-]+))?$/
|
|
@@ -5754,11 +5846,13 @@ ${remote.instructions}` : remote.instructions,
|
|
|
5754
5846
|
init_base();
|
|
5755
5847
|
|
|
5756
5848
|
// src/storage/cached.ts
|
|
5849
|
+
init_cjs_shims();
|
|
5757
5850
|
var fs8 = __toESM(require("fs"));
|
|
5758
5851
|
var path8 = __toESM(require("path"));
|
|
5759
5852
|
init_base();
|
|
5760
5853
|
|
|
5761
5854
|
// src/storage/filesystem.ts
|
|
5855
|
+
init_cjs_shims();
|
|
5762
5856
|
var fs6 = __toESM(require("fs/promises"));
|
|
5763
5857
|
var path6 = __toESM(require("path"));
|
|
5764
5858
|
init_base();
|
|
@@ -6011,11 +6105,6 @@ ${skill.instructions}
|
|
|
6011
6105
|
status,
|
|
6012
6106
|
parentVersion: parentVersion || void 0,
|
|
6013
6107
|
derivedFrom: derivedFrom.length > 0 ? derivedFrom : void 0,
|
|
6014
|
-
metrics: {
|
|
6015
|
-
usageCount: 0,
|
|
6016
|
-
successRate: 0,
|
|
6017
|
-
feedbackScores: []
|
|
6018
|
-
},
|
|
6019
6108
|
source: metadata?.source,
|
|
6020
6109
|
upstream,
|
|
6021
6110
|
namespace: metadata?.namespace
|
|
@@ -6418,7 +6507,11 @@ var CachedStorageAdapter = class extends BaseStorageAdapter {
|
|
|
6418
6507
|
}
|
|
6419
6508
|
};
|
|
6420
6509
|
|
|
6510
|
+
// src/versioning/index.ts
|
|
6511
|
+
init_cjs_shims();
|
|
6512
|
+
|
|
6421
6513
|
// src/versioning/lineage.ts
|
|
6514
|
+
init_cjs_shims();
|
|
6422
6515
|
var LineageTracker = class {
|
|
6423
6516
|
constructor(storage) {
|
|
6424
6517
|
this.storage = storage;
|
|
@@ -6462,11 +6555,6 @@ var LineageTracker = class {
|
|
|
6462
6555
|
createdAt: /* @__PURE__ */ new Date(),
|
|
6463
6556
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
6464
6557
|
status: "draft",
|
|
6465
|
-
metrics: {
|
|
6466
|
-
usageCount: 0,
|
|
6467
|
-
successRate: 0,
|
|
6468
|
-
feedbackScores: []
|
|
6469
|
-
},
|
|
6470
6558
|
source: {
|
|
6471
6559
|
type: "composed",
|
|
6472
6560
|
importedAt: /* @__PURE__ */ new Date()
|
|
@@ -6666,7 +6754,11 @@ ${source}`;
|
|
|
6666
6754
|
}
|
|
6667
6755
|
};
|
|
6668
6756
|
|
|
6757
|
+
// src/versioning/merge.ts
|
|
6758
|
+
init_cjs_shims();
|
|
6759
|
+
|
|
6669
6760
|
// src/hooks/registry.ts
|
|
6761
|
+
init_cjs_shims();
|
|
6670
6762
|
var import_crypto = require("crypto");
|
|
6671
6763
|
var PRIORITY_ORDER = {
|
|
6672
6764
|
high: 0,
|
|
@@ -6851,6 +6943,7 @@ var HookRegistry = class {
|
|
|
6851
6943
|
var hookRegistry = new HookRegistry();
|
|
6852
6944
|
|
|
6853
6945
|
// src/materialization/materializer.ts
|
|
6946
|
+
init_cjs_shims();
|
|
6854
6947
|
var fs10 = __toESM(require("fs"));
|
|
6855
6948
|
var path10 = __toESM(require("path"));
|
|
6856
6949
|
var SKILLTREE_MARKER_START = "<!-- SKILLTREE_START -->";
|
|
@@ -7593,41 +7686,16 @@ var SkillBank = class {
|
|
|
7593
7686
|
}
|
|
7594
7687
|
}
|
|
7595
7688
|
/**
|
|
7596
|
-
* Handle events from serving layer
|
|
7689
|
+
* Handle events from serving layer.
|
|
7690
|
+
*
|
|
7691
|
+
* The `loadout:changed` event is currently the only one we react to.
|
|
7692
|
+
* Earlier versions also handled `skill:used` / `skill:feedback` to mutate
|
|
7693
|
+
* `Skill.metrics`, but skill-tree no longer tracks per-skill usage —
|
|
7694
|
+
* cognitive-core owns that signal via `playbook.evolution.*`. See
|
|
7695
|
+
* docs/SKILL_TREE_METRICS_DEPRECATION.md.
|
|
7597
7696
|
*/
|
|
7598
7697
|
async handleServingEvent(event) {
|
|
7599
7698
|
switch (event.type) {
|
|
7600
|
-
case "skill:used":
|
|
7601
|
-
const skill = await this.storage.getSkill(event.skillId);
|
|
7602
|
-
if (skill) {
|
|
7603
|
-
skill.metrics.usageCount++;
|
|
7604
|
-
skill.metrics.lastUsed = /* @__PURE__ */ new Date();
|
|
7605
|
-
if (event.success) {
|
|
7606
|
-
const total = skill.metrics.usageCount;
|
|
7607
|
-
const currentSuccesses = skill.metrics.successRate * (total - 1);
|
|
7608
|
-
skill.metrics.successRate = (currentSuccesses + 1) / total;
|
|
7609
|
-
} else {
|
|
7610
|
-
const total = skill.metrics.usageCount;
|
|
7611
|
-
const currentSuccesses = skill.metrics.successRate * (total - 1);
|
|
7612
|
-
skill.metrics.successRate = currentSuccesses / total;
|
|
7613
|
-
}
|
|
7614
|
-
skill.updatedAt = /* @__PURE__ */ new Date();
|
|
7615
|
-
await this.storage.saveSkill(skill);
|
|
7616
|
-
}
|
|
7617
|
-
break;
|
|
7618
|
-
case "skill:feedback":
|
|
7619
|
-
const feedbackSkill = await this.storage.getSkill(event.skillId);
|
|
7620
|
-
if (feedbackSkill) {
|
|
7621
|
-
feedbackSkill.metrics.feedbackScores.push(event.score);
|
|
7622
|
-
if (feedbackSkill.metrics.feedbackScores.length > 50) {
|
|
7623
|
-
feedbackSkill.metrics.feedbackScores = feedbackSkill.metrics.feedbackScores.slice(-50);
|
|
7624
|
-
}
|
|
7625
|
-
feedbackSkill.updatedAt = /* @__PURE__ */ new Date();
|
|
7626
|
-
await this.storage.saveSkill(feedbackSkill);
|
|
7627
|
-
}
|
|
7628
|
-
break;
|
|
7629
|
-
case "skill:requested":
|
|
7630
|
-
break;
|
|
7631
7699
|
case "loadout:changed":
|
|
7632
7700
|
break;
|
|
7633
7701
|
}
|
|
@@ -7649,26 +7717,17 @@ var SkillBank = class {
|
|
|
7649
7717
|
deprecated: 0,
|
|
7650
7718
|
experimental: 0
|
|
7651
7719
|
},
|
|
7652
|
-
byTag: {}
|
|
7653
|
-
avgSuccessRate: 0,
|
|
7654
|
-
totalUsage: 0
|
|
7720
|
+
byTag: {}
|
|
7655
7721
|
};
|
|
7656
7722
|
if (this.namespaceConfig) {
|
|
7657
7723
|
stats.byScope = { personal: 0, team: 0, global: 0 };
|
|
7658
7724
|
stats.byVisibility = { private: 0, "team-only": 0, public: 0 };
|
|
7659
7725
|
}
|
|
7660
|
-
let successRateSum = 0;
|
|
7661
|
-
let successRateCount = 0;
|
|
7662
7726
|
for (const skill of skills) {
|
|
7663
7727
|
stats.byStatus[skill.status]++;
|
|
7664
7728
|
for (const tag of skill.tags) {
|
|
7665
7729
|
stats.byTag[tag] = (stats.byTag[tag] || 0) + 1;
|
|
7666
7730
|
}
|
|
7667
|
-
stats.totalUsage += skill.metrics.usageCount;
|
|
7668
|
-
if (skill.metrics.successRate > 0) {
|
|
7669
|
-
successRateSum += skill.metrics.successRate;
|
|
7670
|
-
successRateCount++;
|
|
7671
|
-
}
|
|
7672
7731
|
if (stats.byScope && stats.byVisibility) {
|
|
7673
7732
|
const scope = skill.namespace?.scope || "personal";
|
|
7674
7733
|
const visibility = skill.namespace?.visibility || "private";
|
|
@@ -7676,7 +7735,6 @@ var SkillBank = class {
|
|
|
7676
7735
|
stats.byVisibility[visibility]++;
|
|
7677
7736
|
}
|
|
7678
7737
|
}
|
|
7679
|
-
stats.avgSuccessRate = successRateCount > 0 ? successRateSum / successRateCount : 0;
|
|
7680
7738
|
return stats;
|
|
7681
7739
|
}
|
|
7682
7740
|
/**
|
|
@@ -7739,15 +7797,38 @@ var SkillBank = class {
|
|
|
7739
7797
|
};
|
|
7740
7798
|
|
|
7741
7799
|
// src/storage/index.ts
|
|
7800
|
+
init_cjs_shims();
|
|
7742
7801
|
init_base();
|
|
7743
7802
|
init_sqlite();
|
|
7744
7803
|
|
|
7804
|
+
// src/storage/migration.ts
|
|
7805
|
+
init_cjs_shims();
|
|
7806
|
+
|
|
7745
7807
|
// src/agents/index.ts
|
|
7808
|
+
init_cjs_shims();
|
|
7746
7809
|
init_types();
|
|
7747
7810
|
init_generator();
|
|
7748
7811
|
init_parser();
|
|
7749
7812
|
init_sync();
|
|
7750
7813
|
|
|
7814
|
+
// src/hooks/index.ts
|
|
7815
|
+
init_cjs_shims();
|
|
7816
|
+
|
|
7817
|
+
// src/hooks/builtin.ts
|
|
7818
|
+
init_cjs_shims();
|
|
7819
|
+
|
|
7820
|
+
// src/serving/index.ts
|
|
7821
|
+
init_cjs_shims();
|
|
7822
|
+
|
|
7823
|
+
// src/materialization/index.ts
|
|
7824
|
+
init_cjs_shims();
|
|
7825
|
+
|
|
7826
|
+
// src/sync/index.ts
|
|
7827
|
+
init_cjs_shims();
|
|
7828
|
+
|
|
7829
|
+
// src/sync/hierarchical-sync-adapter.ts
|
|
7830
|
+
init_cjs_shims();
|
|
7831
|
+
|
|
7751
7832
|
// src/sync/index.ts
|
|
7752
7833
|
function createDefaultSyncConfig(remoteUrl, agentId, options) {
|
|
7753
7834
|
return {
|
|
@@ -7777,10 +7858,15 @@ function createDefaultSyncConfig(remoteUrl, agentId, options) {
|
|
|
7777
7858
|
}
|
|
7778
7859
|
|
|
7779
7860
|
// src/services/indexer.ts
|
|
7861
|
+
init_cjs_shims();
|
|
7780
7862
|
var path12 = __toESM(require("path"));
|
|
7781
7863
|
var fs12 = __toESM(require("fs"));
|
|
7782
7864
|
|
|
7865
|
+
// src/config/index.ts
|
|
7866
|
+
init_cjs_shims();
|
|
7867
|
+
|
|
7783
7868
|
// src/config/types.ts
|
|
7869
|
+
init_cjs_shims();
|
|
7784
7870
|
var DEFAULT_CONFIG6 = {
|
|
7785
7871
|
storage: {
|
|
7786
7872
|
path: "~/.skill-tree"
|
|
@@ -7815,6 +7901,7 @@ var DEFAULT_CONFIG6 = {
|
|
|
7815
7901
|
};
|
|
7816
7902
|
|
|
7817
7903
|
// src/config/loader.ts
|
|
7904
|
+
init_cjs_shims();
|
|
7818
7905
|
var fs11 = __toESM(require("fs"));
|
|
7819
7906
|
var path11 = __toESM(require("path"));
|
|
7820
7907
|
var os = __toESM(require("os"));
|
|
@@ -8110,6 +8197,7 @@ function loadConfig(configPath) {
|
|
|
8110
8197
|
}
|
|
8111
8198
|
|
|
8112
8199
|
// src/import/converter.ts
|
|
8200
|
+
init_cjs_shims();
|
|
8113
8201
|
function convertIndexerSkill(indexerSkill) {
|
|
8114
8202
|
const warnings = [];
|
|
8115
8203
|
const instructions = indexerSkill.content || "";
|
|
@@ -8136,11 +8224,6 @@ function convertIndexerSkill(indexerSkill) {
|
|
|
8136
8224
|
createdAt: new Date(indexerSkill.scrapedAt),
|
|
8137
8225
|
updatedAt: new Date(indexerSkill.updatedAt),
|
|
8138
8226
|
status,
|
|
8139
|
-
metrics: {
|
|
8140
|
-
usageCount: 0,
|
|
8141
|
-
successRate: 0,
|
|
8142
|
-
feedbackScores: []
|
|
8143
|
-
},
|
|
8144
8227
|
source: {
|
|
8145
8228
|
type: "imported",
|
|
8146
8229
|
location: indexerSkill.sourceUrl,
|
|
@@ -8878,7 +8961,7 @@ var IndexerService = class {
|
|
|
8878
8961
|
if (this.db) {
|
|
8879
8962
|
const skills = await (this.db.getAllSkills?.() || this.db.listSkills?.()) || [];
|
|
8880
8963
|
for (const skill of skills) {
|
|
8881
|
-
if (skill.status !== "indexed" && !options?.force) continue;
|
|
8964
|
+
if (skill.status !== "indexed" && !options?.force && !options?.importAll) continue;
|
|
8882
8965
|
try {
|
|
8883
8966
|
const converted = convertIndexerSkill(skill);
|
|
8884
8967
|
await this.skillBank.saveSkill(converted.skill);
|
|
@@ -8978,12 +9061,17 @@ function createIntegratedIndexer(skillBank, config2 = {}) {
|
|
|
8978
9061
|
}
|
|
8979
9062
|
|
|
8980
9063
|
// src/index.ts
|
|
8981
|
-
var VERSION = "0.
|
|
9064
|
+
var VERSION = "0.2.0";
|
|
8982
9065
|
|
|
8983
9066
|
// src/cli/commands/list.ts
|
|
9067
|
+
init_cjs_shims();
|
|
8984
9068
|
var import_commander = require("commander");
|
|
8985
9069
|
|
|
9070
|
+
// src/cli/utils/skillbank.ts
|
|
9071
|
+
init_cjs_shims();
|
|
9072
|
+
|
|
8986
9073
|
// src/cli/utils/paths.ts
|
|
9074
|
+
init_cjs_shims();
|
|
8987
9075
|
var fs13 = __toESM(require("fs"));
|
|
8988
9076
|
var path13 = __toESM(require("path"));
|
|
8989
9077
|
var os2 = __toESM(require("os"));
|
|
@@ -9066,6 +9154,7 @@ function getSkillPath(options) {
|
|
|
9066
9154
|
var getSkillBank = createSkillBankFromOptions;
|
|
9067
9155
|
|
|
9068
9156
|
// src/cli/utils/output.ts
|
|
9157
|
+
init_cjs_shims();
|
|
9069
9158
|
var import_chalk = __toESM(require("chalk"));
|
|
9070
9159
|
function formatSkillLine(skill) {
|
|
9071
9160
|
const status = formatStatus(skill.status);
|
|
@@ -9104,10 +9193,6 @@ function formatSkillDetail(skill) {
|
|
|
9104
9193
|
if (skill.derivedFrom && skill.derivedFrom.length > 0) {
|
|
9105
9194
|
lines.push(`${import_chalk.default.dim("Derived:")} ${skill.derivedFrom.join(", ")}`);
|
|
9106
9195
|
}
|
|
9107
|
-
const { usageCount, successRate } = skill.metrics;
|
|
9108
|
-
if (usageCount > 0) {
|
|
9109
|
-
lines.push(`${import_chalk.default.dim("Usage:")} ${usageCount} times, ${Math.round(successRate * 100)}% success`);
|
|
9110
|
-
}
|
|
9111
9196
|
lines.push("");
|
|
9112
9197
|
lines.push(import_chalk.default.dim("Description"));
|
|
9113
9198
|
lines.push(import_chalk.default.dim("\u2500".repeat(50)));
|
|
@@ -9187,11 +9272,6 @@ function formatStats(stats) {
|
|
|
9187
9272
|
}
|
|
9188
9273
|
lines.push("");
|
|
9189
9274
|
}
|
|
9190
|
-
if (stats.totalUsage > 0) {
|
|
9191
|
-
lines.push(import_chalk.default.dim("Usage:"));
|
|
9192
|
-
lines.push(` Total uses: ${stats.totalUsage}`);
|
|
9193
|
-
lines.push(` Avg success: ${Math.round(stats.avgSuccessRate * 100)}%`);
|
|
9194
|
-
}
|
|
9195
9275
|
return lines.join("\n");
|
|
9196
9276
|
}
|
|
9197
9277
|
function printError(message) {
|
|
@@ -9256,6 +9336,7 @@ var listCommand = new import_commander.Command("list").description("List all ski
|
|
|
9256
9336
|
});
|
|
9257
9337
|
|
|
9258
9338
|
// src/cli/commands/show.ts
|
|
9339
|
+
init_cjs_shims();
|
|
9259
9340
|
var import_commander2 = require("commander");
|
|
9260
9341
|
var showCommand = new import_commander2.Command("show").description("Show skill details").argument("<id>", "Skill ID").option("-v, --version <version>", "Show specific version").action(async (id, options, command) => {
|
|
9261
9342
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9278,6 +9359,7 @@ var showCommand = new import_commander2.Command("show").description("Show skill
|
|
|
9278
9359
|
});
|
|
9279
9360
|
|
|
9280
9361
|
// src/cli/commands/search.ts
|
|
9362
|
+
init_cjs_shims();
|
|
9281
9363
|
var import_commander3 = require("commander");
|
|
9282
9364
|
var searchCommand = new import_commander3.Command("search").description("Search skills by text").argument("<query>", "Search query").action(async (query, options, command) => {
|
|
9283
9365
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9310,6 +9392,7 @@ var searchCommand = new import_commander3.Command("search").description("Search
|
|
|
9310
9392
|
});
|
|
9311
9393
|
|
|
9312
9394
|
// src/cli/commands/stats.ts
|
|
9395
|
+
init_cjs_shims();
|
|
9313
9396
|
var import_commander4 = require("commander");
|
|
9314
9397
|
var statsCommand = new import_commander4.Command("stats").description("Show skill bank statistics").action(async (options, command) => {
|
|
9315
9398
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9328,6 +9411,7 @@ var statsCommand = new import_commander4.Command("stats").description("Show skil
|
|
|
9328
9411
|
});
|
|
9329
9412
|
|
|
9330
9413
|
// src/cli/commands/versions.ts
|
|
9414
|
+
init_cjs_shims();
|
|
9331
9415
|
var import_commander5 = require("commander");
|
|
9332
9416
|
var versionsCommand = new import_commander5.Command("versions").description("Show version history for a skill").argument("<id>", "Skill ID").action(async (id, options, command) => {
|
|
9333
9417
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9350,6 +9434,7 @@ var versionsCommand = new import_commander5.Command("versions").description("Sho
|
|
|
9350
9434
|
});
|
|
9351
9435
|
|
|
9352
9436
|
// src/cli/commands/diff.ts
|
|
9437
|
+
init_cjs_shims();
|
|
9353
9438
|
var import_commander6 = require("commander");
|
|
9354
9439
|
var diffCommand = new import_commander6.Command("diff").description("Compare two versions of a skill").argument("<id>", "Skill ID").argument("<version-a>", "First version").argument("<version-b>", "Second version").action(async (id, versionA, versionB, options, command) => {
|
|
9355
9440
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9368,6 +9453,7 @@ var diffCommand = new import_commander6.Command("diff").description("Compare two
|
|
|
9368
9453
|
});
|
|
9369
9454
|
|
|
9370
9455
|
// src/cli/commands/rollback.ts
|
|
9456
|
+
init_cjs_shims();
|
|
9371
9457
|
var import_commander7 = require("commander");
|
|
9372
9458
|
var rollbackCommand = new import_commander7.Command("rollback").description("Rollback a skill to a previous version").argument("<id>", "Skill ID").requiredOption("--to <version>", "Version to rollback to").action(async (id, options, command) => {
|
|
9373
9459
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9386,6 +9472,7 @@ var rollbackCommand = new import_commander7.Command("rollback").description("Rol
|
|
|
9386
9472
|
});
|
|
9387
9473
|
|
|
9388
9474
|
// src/cli/commands/fork.ts
|
|
9475
|
+
init_cjs_shims();
|
|
9389
9476
|
var import_commander8 = require("commander");
|
|
9390
9477
|
var forkCommand = new import_commander8.Command("fork").description("Fork a skill to create a variant").argument("<id>", "Skill ID to fork from").requiredOption("--new-id <id>", "ID for the new forked skill").requiredOption("--reason <reason>", "Reason for forking").option("--name <name>", "Name for the forked skill").option("--from-version <version>", "Version to fork from (defaults to latest)").action(async (id, options, command) => {
|
|
9391
9478
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9409,6 +9496,7 @@ var forkCommand = new import_commander8.Command("fork").description("Fork a skil
|
|
|
9409
9496
|
});
|
|
9410
9497
|
|
|
9411
9498
|
// src/cli/commands/deprecate.ts
|
|
9499
|
+
init_cjs_shims();
|
|
9412
9500
|
var import_commander9 = require("commander");
|
|
9413
9501
|
var deprecateCommand = new import_commander9.Command("deprecate").description("Mark a skill as deprecated").argument("<id>", "Skill ID").action(async (id, options, command) => {
|
|
9414
9502
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9427,6 +9515,7 @@ var deprecateCommand = new import_commander9.Command("deprecate").description("M
|
|
|
9427
9515
|
});
|
|
9428
9516
|
|
|
9429
9517
|
// src/cli/commands/activate.ts
|
|
9518
|
+
init_cjs_shims();
|
|
9430
9519
|
var import_commander10 = require("commander");
|
|
9431
9520
|
var activateCommand = new import_commander10.Command("activate").description("Mark a skill as active").argument("<id>", "Skill ID").action(async (id, options, command) => {
|
|
9432
9521
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9452,6 +9541,7 @@ var activateCommand = new import_commander10.Command("activate").description("Ma
|
|
|
9452
9541
|
});
|
|
9453
9542
|
|
|
9454
9543
|
// src/cli/commands/delete.ts
|
|
9544
|
+
init_cjs_shims();
|
|
9455
9545
|
var import_commander11 = require("commander");
|
|
9456
9546
|
var deleteCommand = new import_commander11.Command("delete").description("Delete a skill").argument("<id>", "Skill ID").option("-f, --force", "Skip confirmation").option("-v, --version <version>", "Delete specific version only").action(async (id, options, command) => {
|
|
9457
9547
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -9484,6 +9574,7 @@ var deleteCommand = new import_commander11.Command("delete").description("Delete
|
|
|
9484
9574
|
});
|
|
9485
9575
|
|
|
9486
9576
|
// src/cli/commands/export.ts
|
|
9577
|
+
init_cjs_shims();
|
|
9487
9578
|
var import_commander12 = require("commander");
|
|
9488
9579
|
var fs14 = __toESM(require("fs"));
|
|
9489
9580
|
var exportCommand = new import_commander12.Command("export").description("Export all skills to JSON").option("-o, --output <file>", "Output file path (defaults to stdout)").action(async (options, command) => {
|
|
@@ -9507,14 +9598,19 @@ var exportCommand = new import_commander12.Command("export").description("Export
|
|
|
9507
9598
|
});
|
|
9508
9599
|
|
|
9509
9600
|
// src/cli/commands/import.ts
|
|
9601
|
+
init_cjs_shims();
|
|
9510
9602
|
var import_commander13 = require("commander");
|
|
9511
9603
|
var fs15 = __toESM(require("fs"));
|
|
9512
9604
|
|
|
9605
|
+
// src/import/index.ts
|
|
9606
|
+
init_cjs_shims();
|
|
9607
|
+
|
|
9513
9608
|
// src/import/detect.ts
|
|
9609
|
+
init_cjs_shims();
|
|
9514
9610
|
function isSkillTreeSkill(obj) {
|
|
9515
9611
|
if (typeof obj !== "object" || obj === null) return false;
|
|
9516
9612
|
const skill = obj;
|
|
9517
|
-
return typeof skill.id === "string" && typeof skill.name === "string" && typeof skill.version === "string" && typeof skill.instructions === "string"
|
|
9613
|
+
return typeof skill.id === "string" && typeof skill.name === "string" && typeof skill.version === "string" && typeof skill.instructions === "string";
|
|
9518
9614
|
}
|
|
9519
9615
|
function isIndexerSkill(obj) {
|
|
9520
9616
|
if (typeof obj !== "object" || obj === null) return false;
|
|
@@ -9605,9 +9701,6 @@ var importCommand = new import_commander13.Command("import").description("Import
|
|
|
9605
9701
|
for (const skill of skills) {
|
|
9606
9702
|
skill.createdAt = new Date(skill.createdAt);
|
|
9607
9703
|
skill.updatedAt = new Date(skill.updatedAt);
|
|
9608
|
-
if (skill.metrics.lastUsed) {
|
|
9609
|
-
skill.metrics.lastUsed = new Date(skill.metrics.lastUsed);
|
|
9610
|
-
}
|
|
9611
9704
|
if (skill.source?.importedAt) {
|
|
9612
9705
|
skill.source.importedAt = new Date(skill.source.importedAt);
|
|
9613
9706
|
}
|
|
@@ -9636,9 +9729,11 @@ var importCommand = new import_commander13.Command("import").description("Import
|
|
|
9636
9729
|
});
|
|
9637
9730
|
|
|
9638
9731
|
// src/cli/commands/indexer/index.ts
|
|
9732
|
+
init_cjs_shims();
|
|
9639
9733
|
var import_commander20 = require("commander");
|
|
9640
9734
|
|
|
9641
9735
|
// src/cli/commands/indexer/scrape.ts
|
|
9736
|
+
init_cjs_shims();
|
|
9642
9737
|
var import_commander14 = require("commander");
|
|
9643
9738
|
var import_child_process2 = require("child_process");
|
|
9644
9739
|
var scrapeCommand = new import_commander14.Command("scrape").description("Scrape skills from GitHub sources").argument("[url]", "Repository or awesome-list URL").option("-d, --discover", "Discover from default sources").option("-f, --force", "Force scrape even if no changes detected").option("--standalone", "Use standalone skillindexer CLI (fallback)").option("--import", "Auto-import scraped skills into skill-tree", true).action(async (url, options, command) => {
|
|
@@ -9763,6 +9858,7 @@ async function runSkillIndexer(args, quiet) {
|
|
|
9763
9858
|
}
|
|
9764
9859
|
|
|
9765
9860
|
// src/cli/commands/indexer/classify.ts
|
|
9861
|
+
init_cjs_shims();
|
|
9766
9862
|
var import_commander15 = require("commander");
|
|
9767
9863
|
var import_child_process3 = require("child_process");
|
|
9768
9864
|
var classifyCommand = new import_commander15.Command("classify").description("Classify unindexed skills using AI").option("-s, --skill <id>", "Classify specific skill by ID").option("--all", "Re-classify all skills (including already indexed)").option("--standalone", "Use standalone skillindexer CLI (fallback)").action(async (options, command) => {
|
|
@@ -9857,6 +9953,7 @@ async function runSkillIndexer2(args, quiet) {
|
|
|
9857
9953
|
}
|
|
9858
9954
|
|
|
9859
9955
|
// src/cli/commands/indexer/taxonomy.ts
|
|
9956
|
+
init_cjs_shims();
|
|
9860
9957
|
var import_commander16 = require("commander");
|
|
9861
9958
|
var import_child_process4 = require("child_process");
|
|
9862
9959
|
var taxonomyCommand = new import_commander16.Command("taxonomy").description("Browse the taxonomy tree").argument("[path]", 'Subtree path (e.g., "Development/Python")').option("-i, --interactive", "Interactive browsing mode").option("--standalone", "Use standalone skillindexer CLI (fallback)").action(async (pathArg, options, command) => {
|
|
@@ -9937,6 +10034,7 @@ async function runSkillIndexer3(args, quiet) {
|
|
|
9937
10034
|
}
|
|
9938
10035
|
|
|
9939
10036
|
// src/cli/commands/indexer/relationships.ts
|
|
10037
|
+
init_cjs_shims();
|
|
9940
10038
|
var import_commander17 = require("commander");
|
|
9941
10039
|
var import_child_process5 = require("child_process");
|
|
9942
10040
|
var relationshipsCommand = new import_commander17.Command("relationships").description("Detect relationships between indexed skills").option("-s, --skill <id>", "Detect relationships for specific skill").option("--use-ai", "Use AI for relationship reasoning (slower, more accurate)").option("--clear", "Clear existing relationships before detection").option("--standalone", "Use standalone skillindexer CLI (fallback)").action(async (options, command) => {
|
|
@@ -10023,6 +10121,7 @@ async function runSkillIndexer4(args, quiet) {
|
|
|
10023
10121
|
}
|
|
10024
10122
|
|
|
10025
10123
|
// src/cli/commands/indexer/stats.ts
|
|
10124
|
+
init_cjs_shims();
|
|
10026
10125
|
var import_commander18 = require("commander");
|
|
10027
10126
|
var import_child_process6 = require("child_process");
|
|
10028
10127
|
var indexerStatsCommand = new import_commander18.Command("stats").description("Show indexer database statistics").option("--standalone", "Use standalone skillindexer CLI (fallback)").action(async (options, command) => {
|
|
@@ -10102,6 +10201,7 @@ async function runSkillIndexer5(args, quiet) {
|
|
|
10102
10201
|
}
|
|
10103
10202
|
|
|
10104
10203
|
// src/cli/commands/indexer/sync.ts
|
|
10204
|
+
init_cjs_shims();
|
|
10105
10205
|
var import_commander19 = require("commander");
|
|
10106
10206
|
var fs16 = __toESM(require("fs"));
|
|
10107
10207
|
var path14 = __toESM(require("path"));
|
|
@@ -10109,6 +10209,7 @@ var os3 = __toESM(require("os"));
|
|
|
10109
10209
|
var import_child_process7 = require("child_process");
|
|
10110
10210
|
|
|
10111
10211
|
// src/services/sync.ts
|
|
10212
|
+
init_cjs_shims();
|
|
10112
10213
|
var SyncService = class {
|
|
10113
10214
|
constructor(skillBank, config2 = {}) {
|
|
10114
10215
|
this.syncStates = /* @__PURE__ */ new Map();
|
|
@@ -10633,6 +10734,7 @@ async function runSkillIndexer6(args, quiet) {
|
|
|
10633
10734
|
var indexerCommand = new import_commander20.Command("index").description("Skill indexer - discover and classify skills from GitHub").addCommand(scrapeCommand).addCommand(classifyCommand).addCommand(taxonomyCommand).addCommand(relationshipsCommand).addCommand(indexerStatsCommand).addCommand(syncCommand);
|
|
10634
10735
|
|
|
10635
10736
|
// src/cli/commands/config.ts
|
|
10737
|
+
init_cjs_shims();
|
|
10636
10738
|
var import_commander21 = require("commander");
|
|
10637
10739
|
var fs17 = __toESM(require("fs"));
|
|
10638
10740
|
var configCommand = new import_commander21.Command("config").description("View and manage configuration");
|
|
@@ -10783,6 +10885,7 @@ function printConfig(obj, indent) {
|
|
|
10783
10885
|
}
|
|
10784
10886
|
|
|
10785
10887
|
// src/cli/commands/sync.ts
|
|
10888
|
+
init_cjs_shims();
|
|
10786
10889
|
var import_commander22 = require("commander");
|
|
10787
10890
|
var path15 = __toESM(require("path"));
|
|
10788
10891
|
var fs18 = __toESM(require("fs"));
|
|
@@ -11107,6 +11210,7 @@ function resolveCommand() {
|
|
|
11107
11210
|
}
|
|
11108
11211
|
|
|
11109
11212
|
// src/cli/commands/read.ts
|
|
11213
|
+
init_cjs_shims();
|
|
11110
11214
|
var import_commander23 = require("commander");
|
|
11111
11215
|
var path16 = __toESM(require("path"));
|
|
11112
11216
|
function serializeSkillMd(skill) {
|
|
@@ -11171,6 +11275,7 @@ var readCommand = new import_commander23.Command("read").description("Read skill
|
|
|
11171
11275
|
});
|
|
11172
11276
|
|
|
11173
11277
|
// src/cli/commands/materialize.ts
|
|
11278
|
+
init_cjs_shims();
|
|
11174
11279
|
var import_commander24 = require("commander");
|
|
11175
11280
|
var materializeCommand = new import_commander24.Command("materialize").description("Materialize skills to agent-discoverable paths").option("--paths <dirs>", "Comma-separated target directories (e.g. .claude/skills,.agent/skills)").option("--agents-md <path>", "Path to write AGENTS.md").option("--format <format>", "AGENTS.md format: xml, markdown, json", "xml").option("--mode <mode>", "Materialization mode: symlink or copy", "symlink").option("-w, --watch", "Watch for changes and re-materialize").action(async (options, command) => {
|
|
11176
11281
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11231,12 +11336,18 @@ var materializeCommand = new import_commander24.Command("materialize").descripti
|
|
|
11231
11336
|
});
|
|
11232
11337
|
|
|
11233
11338
|
// src/cli/commands/loadout/index.ts
|
|
11234
|
-
|
|
11339
|
+
init_cjs_shims();
|
|
11340
|
+
var import_commander37 = require("commander");
|
|
11235
11341
|
|
|
11236
11342
|
// src/cli/commands/loadout/list.ts
|
|
11343
|
+
init_cjs_shims();
|
|
11237
11344
|
var import_commander25 = require("commander");
|
|
11238
11345
|
|
|
11346
|
+
// src/cli/utils/loadout-server.ts
|
|
11347
|
+
init_cjs_shims();
|
|
11348
|
+
|
|
11239
11349
|
// src/serving/state-persistence.ts
|
|
11350
|
+
init_cjs_shims();
|
|
11240
11351
|
var fs19 = __toESM(require("fs"));
|
|
11241
11352
|
var path17 = __toESM(require("path"));
|
|
11242
11353
|
var STATE_FILENAME = ".loadout-state.json";
|
|
@@ -11344,6 +11455,7 @@ var listSubcommand = new import_commander25.Command("list").description("List sk
|
|
|
11344
11455
|
});
|
|
11345
11456
|
|
|
11346
11457
|
// src/cli/commands/loadout/search.ts
|
|
11458
|
+
init_cjs_shims();
|
|
11347
11459
|
var import_commander26 = require("commander");
|
|
11348
11460
|
var searchSubcommand = new import_commander26.Command("search").description("Search for skills to add to the loadout").argument("<query>", "Search query").option("-l, --limit <n>", "Maximum results", "10").action(async (query, options, command) => {
|
|
11349
11461
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11375,6 +11487,7 @@ var searchSubcommand = new import_commander26.Command("search").description("Sea
|
|
|
11375
11487
|
});
|
|
11376
11488
|
|
|
11377
11489
|
// src/cli/commands/loadout/add.ts
|
|
11490
|
+
init_cjs_shims();
|
|
11378
11491
|
var import_commander27 = require("commander");
|
|
11379
11492
|
var addSubcommand = new import_commander27.Command("add").description("Add skills to the loadout").argument("<ids...>", "Skill IDs to add").action(async (ids, _options, command) => {
|
|
11380
11493
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11394,6 +11507,7 @@ var addSubcommand = new import_commander27.Command("add").description("Add skill
|
|
|
11394
11507
|
});
|
|
11395
11508
|
|
|
11396
11509
|
// src/cli/commands/loadout/remove.ts
|
|
11510
|
+
init_cjs_shims();
|
|
11397
11511
|
var import_commander28 = require("commander");
|
|
11398
11512
|
var removeSubcommand = new import_commander28.Command("remove").description("Remove skills from the loadout").argument("<ids...>", "Skill IDs to remove").action(async (ids, _options, command) => {
|
|
11399
11513
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11413,6 +11527,7 @@ var removeSubcommand = new import_commander28.Command("remove").description("Rem
|
|
|
11413
11527
|
});
|
|
11414
11528
|
|
|
11415
11529
|
// src/cli/commands/loadout/profile.ts
|
|
11530
|
+
init_cjs_shims();
|
|
11416
11531
|
var import_commander29 = require("commander");
|
|
11417
11532
|
var profileSubcommand = new import_commander29.Command("profile").description("Switch to a named skill profile").argument("[name]", "Profile name (e.g. debugging, security, code-review)").option("--list", "List available profiles").action(async (name, options, command) => {
|
|
11418
11533
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11445,6 +11560,7 @@ var profileSubcommand = new import_commander29.Command("profile").description("S
|
|
|
11445
11560
|
});
|
|
11446
11561
|
|
|
11447
11562
|
// src/cli/commands/loadout/set.ts
|
|
11563
|
+
init_cjs_shims();
|
|
11448
11564
|
var import_commander30 = require("commander");
|
|
11449
11565
|
var setSubcommand = new import_commander30.Command("set").description("Set loadout from criteria (tags, task description, etc.)").option("--tags <tags>", "Comma-separated tags to match").option("--task <description>", "Task description for semantic matching").option("--max-skills <n>", "Maximum number of skills").action(async (options, command) => {
|
|
11450
11566
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11475,6 +11591,7 @@ var setSubcommand = new import_commander30.Command("set").description("Set loado
|
|
|
11475
11591
|
});
|
|
11476
11592
|
|
|
11477
11593
|
// src/cli/commands/loadout/expand.ts
|
|
11594
|
+
init_cjs_shims();
|
|
11478
11595
|
var import_commander31 = require("commander");
|
|
11479
11596
|
var expandSubcommand = new import_commander31.Command("expand").description("Expand a skill to see its full content").argument("<id>", "Skill ID to expand").action(async (id, _options, command) => {
|
|
11480
11597
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11501,6 +11618,7 @@ var expandSubcommand = new import_commander31.Command("expand").description("Exp
|
|
|
11501
11618
|
});
|
|
11502
11619
|
|
|
11503
11620
|
// src/cli/commands/loadout/collapse.ts
|
|
11621
|
+
init_cjs_shims();
|
|
11504
11622
|
var import_commander32 = require("commander");
|
|
11505
11623
|
var collapseSubcommand = new import_commander32.Command("collapse").description("Collapse an expanded skill back to summary").argument("<id>", "Skill ID to collapse").action(async (id, _options, command) => {
|
|
11506
11624
|
const globalOpts = command.optsWithGlobals();
|
|
@@ -11523,36 +11641,10 @@ var collapseSubcommand = new import_commander32.Command("collapse").description(
|
|
|
11523
11641
|
}
|
|
11524
11642
|
});
|
|
11525
11643
|
|
|
11526
|
-
// src/cli/commands/loadout/use.ts
|
|
11527
|
-
var import_commander33 = require("commander");
|
|
11528
|
-
var useSubcommand = new import_commander33.Command("use").description("Mark a skill as being used (auto-expands and records usage)").argument("<id>", "Skill ID to use").action(async (id, _options, command) => {
|
|
11529
|
-
const globalOpts = command.optsWithGlobals();
|
|
11530
|
-
try {
|
|
11531
|
-
const { server, save } = await createLoadoutServer(globalOpts);
|
|
11532
|
-
server.recordUsage(id);
|
|
11533
|
-
const expanded = server.expandSkill(id);
|
|
11534
|
-
if (!expanded) {
|
|
11535
|
-
printError(`Skill "${id}" not found in loadout`);
|
|
11536
|
-
process.exit(1);
|
|
11537
|
-
}
|
|
11538
|
-
save();
|
|
11539
|
-
const skill = server.getState().available.get(id);
|
|
11540
|
-
if (globalOpts.json) {
|
|
11541
|
-
console.log(JSON.stringify(skill, null, 2));
|
|
11542
|
-
return;
|
|
11543
|
-
}
|
|
11544
|
-
printSuccess(`Using "${id}"`);
|
|
11545
|
-
console.log();
|
|
11546
|
-
console.log(formatSkillDetail(skill));
|
|
11547
|
-
} catch (error) {
|
|
11548
|
-
printError(error.message);
|
|
11549
|
-
process.exit(1);
|
|
11550
|
-
}
|
|
11551
|
-
});
|
|
11552
|
-
|
|
11553
11644
|
// src/cli/commands/loadout/get.ts
|
|
11554
|
-
|
|
11555
|
-
var
|
|
11645
|
+
init_cjs_shims();
|
|
11646
|
+
var import_commander33 = require("commander");
|
|
11647
|
+
var getSubcommand = new import_commander33.Command("get").description("Get details about a skill in the loadout").argument("<id>", "Skill ID").action(async (id, _options, command) => {
|
|
11556
11648
|
const globalOpts = command.optsWithGlobals();
|
|
11557
11649
|
try {
|
|
11558
11650
|
const { server } = await createLoadoutServer(globalOpts);
|
|
@@ -11574,8 +11666,9 @@ var getSubcommand = new import_commander34.Command("get").description("Get detai
|
|
|
11574
11666
|
});
|
|
11575
11667
|
|
|
11576
11668
|
// src/cli/commands/loadout/render.ts
|
|
11577
|
-
|
|
11578
|
-
var
|
|
11669
|
+
init_cjs_shims();
|
|
11670
|
+
var import_commander34 = require("commander");
|
|
11671
|
+
var renderSubcommand = new import_commander34.Command("render").description("Render the current loadout as a system prompt (XML or Markdown)").option("--format <format>", "Output format: xml or markdown", "xml").action(async (options, command) => {
|
|
11579
11672
|
const globalOpts = command.optsWithGlobals();
|
|
11580
11673
|
try {
|
|
11581
11674
|
const { server } = await createLoadoutServer(globalOpts);
|
|
@@ -11593,8 +11686,9 @@ var renderSubcommand = new import_commander35.Command("render").description("Ren
|
|
|
11593
11686
|
});
|
|
11594
11687
|
|
|
11595
11688
|
// src/cli/commands/loadout/clear.ts
|
|
11596
|
-
|
|
11597
|
-
var
|
|
11689
|
+
init_cjs_shims();
|
|
11690
|
+
var import_commander35 = require("commander");
|
|
11691
|
+
var clearSubcommand = new import_commander35.Command("clear").description("Clear the current loadout state").action(async (_options, command) => {
|
|
11598
11692
|
const globalOpts = command.optsWithGlobals();
|
|
11599
11693
|
try {
|
|
11600
11694
|
const skillPath = resolveSkillPath(globalOpts.path);
|
|
@@ -11615,8 +11709,9 @@ var clearSubcommand = new import_commander36.Command("clear").description("Clear
|
|
|
11615
11709
|
});
|
|
11616
11710
|
|
|
11617
11711
|
// src/cli/commands/loadout/browse.ts
|
|
11618
|
-
|
|
11619
|
-
var
|
|
11712
|
+
init_cjs_shims();
|
|
11713
|
+
var import_commander36 = require("commander");
|
|
11714
|
+
var browseSubcommand = new import_commander36.Command("browse").description("Browse the skill catalog by category").argument("[path]", "Category path to browse (e.g., Development/Python)").action(async (pathArg, _options, command) => {
|
|
11620
11715
|
const globalOpts = command.optsWithGlobals();
|
|
11621
11716
|
try {
|
|
11622
11717
|
const { server } = await createLoadoutServer(globalOpts);
|
|
@@ -11638,10 +11733,10 @@ var browseSubcommand = new import_commander37.Command("browse").description("Bro
|
|
|
11638
11733
|
});
|
|
11639
11734
|
|
|
11640
11735
|
// src/cli/commands/loadout/index.ts
|
|
11641
|
-
var loadoutCommand = new
|
|
11736
|
+
var loadoutCommand = new import_commander37.Command("loadout").description("Manage skill loadouts for agent sessions").addCommand(listSubcommand).addCommand(searchSubcommand).addCommand(addSubcommand).addCommand(removeSubcommand).addCommand(profileSubcommand).addCommand(setSubcommand).addCommand(expandSubcommand).addCommand(collapseSubcommand).addCommand(getSubcommand).addCommand(renderSubcommand).addCommand(clearSubcommand).addCommand(browseSubcommand);
|
|
11642
11737
|
|
|
11643
11738
|
// src/cli/index.ts
|
|
11644
|
-
var program = new
|
|
11739
|
+
var program = new import_commander38.Command();
|
|
11645
11740
|
var config = loadConfig();
|
|
11646
11741
|
program.name("skill-tree").description("Management CLI for agent skills").version(VERSION).option("-p, --path <dir>", "Skills directory path", config.storage.path).option("-c, --config <file>", "Config file path", getConfigPath()).option("--json", "Output as JSON", config.cli.output_format === "json").option("-q, --quiet", "Suppress non-essential output", config.cli.quiet).option("--no-color", "Disable colored output", !config.cli.color);
|
|
11647
11742
|
program.addCommand(listCommand);
|
|
@@ -11664,4 +11759,3 @@ program.addCommand(readCommand);
|
|
|
11664
11759
|
program.addCommand(materializeCommand);
|
|
11665
11760
|
program.addCommand(loadoutCommand);
|
|
11666
11761
|
program.parse();
|
|
11667
|
-
//# sourceMappingURL=index.js.map
|