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/index.js
CHANGED
|
@@ -30,11 +30,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
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,
|
|
@@ -1129,6 +1198,7 @@ var AgentsGenerator;
|
|
|
1129
1198
|
var init_generator = __esm({
|
|
1130
1199
|
"src/agents/generator.ts"() {
|
|
1131
1200
|
"use strict";
|
|
1201
|
+
init_cjs_shims();
|
|
1132
1202
|
init_types();
|
|
1133
1203
|
AgentsGenerator = class {
|
|
1134
1204
|
constructor(config) {
|
|
@@ -1297,9 +1367,6 @@ ${this.indentContent(skill.instructions, 4)}
|
|
|
1297
1367
|
if (filter.tags && filter.tags.length > 0) {
|
|
1298
1368
|
result = result.filter((s) => s.tags.some((t) => filter.tags.includes(t)));
|
|
1299
1369
|
}
|
|
1300
|
-
if (filter.minSuccessRate !== void 0) {
|
|
1301
|
-
result = result.filter((s) => s.metrics.successRate >= filter.minSuccessRate);
|
|
1302
|
-
}
|
|
1303
1370
|
if (filter.limit) {
|
|
1304
1371
|
result = result.slice(0, filter.limit);
|
|
1305
1372
|
}
|
|
@@ -1346,6 +1413,7 @@ var AgentsParser;
|
|
|
1346
1413
|
var init_parser = __esm({
|
|
1347
1414
|
"src/agents/parser.ts"() {
|
|
1348
1415
|
"use strict";
|
|
1416
|
+
init_cjs_shims();
|
|
1349
1417
|
AgentsParser = class {
|
|
1350
1418
|
/**
|
|
1351
1419
|
* Parse AGENTS.md content
|
|
@@ -1399,11 +1467,6 @@ var init_parser = __esm({
|
|
|
1399
1467
|
createdAt: defaults?.createdAt || now,
|
|
1400
1468
|
updatedAt: now,
|
|
1401
1469
|
status: "active",
|
|
1402
|
-
metrics: defaults?.metrics || {
|
|
1403
|
-
usageCount: 0,
|
|
1404
|
-
successRate: 0,
|
|
1405
|
-
feedbackScores: []
|
|
1406
|
-
},
|
|
1407
1470
|
source: {
|
|
1408
1471
|
type: "imported",
|
|
1409
1472
|
location: "AGENTS.md",
|
|
@@ -1612,6 +1675,7 @@ var fs9, path9, AgentsSync;
|
|
|
1612
1675
|
var init_sync = __esm({
|
|
1613
1676
|
"src/agents/sync.ts"() {
|
|
1614
1677
|
"use strict";
|
|
1678
|
+
init_cjs_shims();
|
|
1615
1679
|
fs9 = __toESM(require("fs"));
|
|
1616
1680
|
path9 = __toESM(require("path"));
|
|
1617
1681
|
init_generator();
|
|
@@ -1771,8 +1835,6 @@ var init_sync = __esm({
|
|
|
1771
1835
|
// Keep existing ID
|
|
1772
1836
|
createdAt: existing.createdAt,
|
|
1773
1837
|
// Preserve creation date
|
|
1774
|
-
metrics: existing.metrics,
|
|
1775
|
-
// Preserve usage metrics
|
|
1776
1838
|
source: incoming.source || existing.source,
|
|
1777
1839
|
parentVersion: existing.version
|
|
1778
1840
|
// Track update lineage
|
|
@@ -1853,8 +1915,13 @@ __export(index_exports, {
|
|
|
1853
1915
|
writeAgentsMd: () => writeAgentsMd
|
|
1854
1916
|
});
|
|
1855
1917
|
module.exports = __toCommonJS(index_exports);
|
|
1918
|
+
init_cjs_shims();
|
|
1919
|
+
|
|
1920
|
+
// src/skill-bank.ts
|
|
1921
|
+
init_cjs_shims();
|
|
1856
1922
|
|
|
1857
1923
|
// src/types.ts
|
|
1924
|
+
init_cjs_shims();
|
|
1858
1925
|
function hasTaxonomySupport(storage) {
|
|
1859
1926
|
return typeof storage.placeInTaxonomy === "function";
|
|
1860
1927
|
}
|
|
@@ -1862,11 +1929,16 @@ function hasForkSupport(storage) {
|
|
|
1862
1929
|
return typeof storage.recordFork === "function";
|
|
1863
1930
|
}
|
|
1864
1931
|
|
|
1932
|
+
// src/sync/sync-manager.ts
|
|
1933
|
+
init_cjs_shims();
|
|
1934
|
+
|
|
1865
1935
|
// src/sync/git-sync-adapter.ts
|
|
1936
|
+
init_cjs_shims();
|
|
1866
1937
|
var fs2 = __toESM(require("fs"));
|
|
1867
1938
|
var path2 = __toESM(require("path"));
|
|
1868
1939
|
|
|
1869
1940
|
// src/sync/conflict-store.ts
|
|
1941
|
+
init_cjs_shims();
|
|
1870
1942
|
var fs = __toESM(require("fs"));
|
|
1871
1943
|
var path = __toESM(require("path"));
|
|
1872
1944
|
var ConflictStore = class {
|
|
@@ -2082,10 +2154,6 @@ var ConflictStore = class {
|
|
|
2082
2154
|
...skill,
|
|
2083
2155
|
createdAt: skill.createdAt instanceof Date ? skill.createdAt.toISOString() : skill.createdAt,
|
|
2084
2156
|
updatedAt: skill.updatedAt instanceof Date ? skill.updatedAt.toISOString() : skill.updatedAt,
|
|
2085
|
-
metrics: {
|
|
2086
|
-
...skill.metrics,
|
|
2087
|
-
lastUsed: skill.metrics?.lastUsed instanceof Date ? skill.metrics.lastUsed.toISOString() : skill.metrics?.lastUsed
|
|
2088
|
-
},
|
|
2089
2157
|
source: skill.source ? {
|
|
2090
2158
|
...skill.source,
|
|
2091
2159
|
importedAt: skill.source.importedAt instanceof Date ? skill.source.importedAt.toISOString() : skill.source.importedAt
|
|
@@ -2097,10 +2165,6 @@ var ConflictStore = class {
|
|
|
2097
2165
|
...data,
|
|
2098
2166
|
createdAt: new Date(data.createdAt),
|
|
2099
2167
|
updatedAt: new Date(data.updatedAt),
|
|
2100
|
-
metrics: {
|
|
2101
|
-
...data.metrics,
|
|
2102
|
-
lastUsed: data.metrics?.lastUsed ? new Date(data.metrics.lastUsed) : void 0
|
|
2103
|
-
},
|
|
2104
2168
|
source: data.source ? {
|
|
2105
2169
|
...data.source,
|
|
2106
2170
|
importedAt: new Date(data.source.importedAt)
|
|
@@ -2670,12 +2734,7 @@ ${remoteValue}`;
|
|
|
2670
2734
|
tags: metadata.tags ? metadata.tags.split(",").map((t) => t.trim()) : [],
|
|
2671
2735
|
createdAt: metadata.created ? new Date(metadata.created) : /* @__PURE__ */ new Date(),
|
|
2672
2736
|
updatedAt: metadata.updated ? new Date(metadata.updated) : /* @__PURE__ */ new Date(),
|
|
2673
|
-
status: isValidStatus(metadata.status) ? metadata.status : "active"
|
|
2674
|
-
metrics: {
|
|
2675
|
-
usageCount: 0,
|
|
2676
|
-
successRate: 0,
|
|
2677
|
-
feedbackScores: []
|
|
2678
|
-
}
|
|
2737
|
+
status: isValidStatus(metadata.status) ? metadata.status : "active"
|
|
2679
2738
|
};
|
|
2680
2739
|
}
|
|
2681
2740
|
async writeSkill(skill) {
|
|
@@ -2936,7 +2995,14 @@ function createSyncManager(options) {
|
|
|
2936
2995
|
return new SyncManager(options);
|
|
2937
2996
|
}
|
|
2938
2997
|
|
|
2998
|
+
// src/serving/graph-server.ts
|
|
2999
|
+
init_cjs_shims();
|
|
3000
|
+
|
|
3001
|
+
// src/serving/catalog-renderer.ts
|
|
3002
|
+
init_cjs_shims();
|
|
3003
|
+
|
|
2939
3004
|
// src/serving/xml-utils.ts
|
|
3005
|
+
init_cjs_shims();
|
|
2940
3006
|
function escapeXml(text) {
|
|
2941
3007
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2942
3008
|
}
|
|
@@ -3143,6 +3209,7 @@ var CatalogRenderer = class _CatalogRenderer {
|
|
|
3143
3209
|
};
|
|
3144
3210
|
|
|
3145
3211
|
// src/serving/loadout-compiler.ts
|
|
3212
|
+
init_cjs_shims();
|
|
3146
3213
|
var DEFAULT_CONFIG2 = {
|
|
3147
3214
|
defaultMaxSkills: 15,
|
|
3148
3215
|
defaultStatus: ["active"],
|
|
@@ -3157,7 +3224,24 @@ var LoadoutCompiler = class {
|
|
|
3157
3224
|
};
|
|
3158
3225
|
}
|
|
3159
3226
|
/**
|
|
3160
|
-
* Main entry point - compile skills from criteria
|
|
3227
|
+
* Main entry point - compile skills from criteria.
|
|
3228
|
+
*
|
|
3229
|
+
* Filter pipeline order:
|
|
3230
|
+
* 1. status (initial query)
|
|
3231
|
+
* 2. exclude (drop matching IDs)
|
|
3232
|
+
* 3. tags / tagsAll
|
|
3233
|
+
* 4. author
|
|
3234
|
+
* 5. semantic (currently no-op)
|
|
3235
|
+
* 6. relationships (rootSkills traversal)
|
|
3236
|
+
* 7. **include** — presence guarantee: ensures every ID in the
|
|
3237
|
+
* include list is in the result regardless of the filters above,
|
|
3238
|
+
* fetching missing ones from storage as needed. `exclude` still
|
|
3239
|
+
* wins (excluded IDs are removed from the include list before
|
|
3240
|
+
* this step).
|
|
3241
|
+
* 8. limits (maxSkills, maxTokens)
|
|
3242
|
+
*
|
|
3243
|
+
* For "restrict to exactly these skills" semantics, combine
|
|
3244
|
+
* `include: [...]` with `maxSkills: include.length`.
|
|
3161
3245
|
*/
|
|
3162
3246
|
async compile(criteria) {
|
|
3163
3247
|
const status = criteria.status ?? this.config.defaultStatus;
|
|
@@ -3167,6 +3251,7 @@ var LoadoutCompiler = class {
|
|
|
3167
3251
|
candidates = this.applyQualityFilters(candidates, criteria);
|
|
3168
3252
|
candidates = await this.applySemanticFilters(candidates, criteria);
|
|
3169
3253
|
candidates = await this.applyRelationshipFilters(candidates, criteria);
|
|
3254
|
+
candidates = await this.ensureIncludedPresent(candidates, criteria);
|
|
3170
3255
|
candidates = this.applyLimits(candidates, criteria);
|
|
3171
3256
|
return candidates;
|
|
3172
3257
|
}
|
|
@@ -3212,7 +3297,9 @@ var LoadoutCompiler = class {
|
|
|
3212
3297
|
// Filter Methods
|
|
3213
3298
|
// ===========================================================================
|
|
3214
3299
|
/**
|
|
3215
|
-
* Apply explicit
|
|
3300
|
+
* Apply explicit exclude filter. Include is handled separately at the
|
|
3301
|
+
* compile level (see `ensureIncludedPresent`) so it can guarantee
|
|
3302
|
+
* presence regardless of the other filters in this method or below.
|
|
3216
3303
|
*/
|
|
3217
3304
|
applyExplicitFilters(skills, criteria) {
|
|
3218
3305
|
let result = skills;
|
|
@@ -3220,15 +3307,6 @@ var LoadoutCompiler = class {
|
|
|
3220
3307
|
const excludeSet = new Set(criteria.exclude);
|
|
3221
3308
|
result = result.filter((s) => !excludeSet.has(s.id));
|
|
3222
3309
|
}
|
|
3223
|
-
if (criteria.include && criteria.include.length > 0) {
|
|
3224
|
-
const includeSet = new Set(criteria.include);
|
|
3225
|
-
const currentIds = new Set(result.map((s) => s.id));
|
|
3226
|
-
const includedSkills = result.filter((s) => includeSet.has(s.id));
|
|
3227
|
-
const otherSkills = result.filter((s) => !includeSet.has(s.id));
|
|
3228
|
-
if (includedSkills.length > 0) {
|
|
3229
|
-
result = [...includedSkills, ...otherSkills];
|
|
3230
|
-
}
|
|
3231
|
-
}
|
|
3232
3310
|
return result;
|
|
3233
3311
|
}
|
|
3234
3312
|
/**
|
|
@@ -3252,11 +3330,6 @@ var LoadoutCompiler = class {
|
|
|
3252
3330
|
*/
|
|
3253
3331
|
applyQualityFilters(skills, criteria) {
|
|
3254
3332
|
let result = skills;
|
|
3255
|
-
if (criteria.minSuccessRate !== void 0) {
|
|
3256
|
-
result = result.filter(
|
|
3257
|
-
(s) => s.metrics.successRate >= criteria.minSuccessRate
|
|
3258
|
-
);
|
|
3259
|
-
}
|
|
3260
3333
|
if (criteria.author) {
|
|
3261
3334
|
result = result.filter((s) => s.author === criteria.author);
|
|
3262
3335
|
}
|
|
@@ -3314,27 +3387,48 @@ var LoadoutCompiler = class {
|
|
|
3314
3387
|
}
|
|
3315
3388
|
return skills.filter((s) => result.has(s.id));
|
|
3316
3389
|
}
|
|
3390
|
+
/**
|
|
3391
|
+
* Ensure every ID in `criteria.include` is present in the result,
|
|
3392
|
+
* regardless of which earlier filter would have dropped it. Missing
|
|
3393
|
+
* skills are fetched directly from storage.
|
|
3394
|
+
*
|
|
3395
|
+
* `criteria.exclude` still wins: an ID listed in both `include` and
|
|
3396
|
+
* `exclude` is treated as excluded (consistent with openteams' "deny
|
|
3397
|
+
* wins" inheritance rule on permissions).
|
|
3398
|
+
*
|
|
3399
|
+
* Included skills are placed at the front of the result, preserving
|
|
3400
|
+
* the order of `criteria.include`. Other skills retain their relative
|
|
3401
|
+
* order behind them.
|
|
3402
|
+
*/
|
|
3403
|
+
async ensureIncludedPresent(current, criteria) {
|
|
3404
|
+
if (!criteria.include?.length) return current;
|
|
3405
|
+
const excludeSet = new Set(criteria.exclude ?? []);
|
|
3406
|
+
const effectiveInclude = criteria.include.filter(
|
|
3407
|
+
(id) => !excludeSet.has(id)
|
|
3408
|
+
);
|
|
3409
|
+
if (effectiveInclude.length === 0) return current;
|
|
3410
|
+
const currentById = new Map(current.map((s) => [s.id, s]));
|
|
3411
|
+
const ordered = [];
|
|
3412
|
+
for (const id of effectiveInclude) {
|
|
3413
|
+
const existing = currentById.get(id);
|
|
3414
|
+
if (existing) {
|
|
3415
|
+
ordered.push(existing);
|
|
3416
|
+
currentById.delete(id);
|
|
3417
|
+
continue;
|
|
3418
|
+
}
|
|
3419
|
+
const fetched = await this.storage.getSkill(id);
|
|
3420
|
+
if (fetched) {
|
|
3421
|
+
ordered.push(fetched);
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
return [...ordered, ...currentById.values()];
|
|
3425
|
+
}
|
|
3317
3426
|
/**
|
|
3318
3427
|
* Apply limits and sorting
|
|
3319
3428
|
*/
|
|
3320
3429
|
applyLimits(skills, criteria) {
|
|
3321
3430
|
let result = skills;
|
|
3322
|
-
if (criteria.priorityOrder) {
|
|
3323
|
-
result = [...result].sort((a, b) => {
|
|
3324
|
-
switch (criteria.priorityOrder) {
|
|
3325
|
-
case "usage":
|
|
3326
|
-
return b.metrics.usageCount - a.metrics.usageCount;
|
|
3327
|
-
case "successRate":
|
|
3328
|
-
return b.metrics.successRate - a.metrics.successRate;
|
|
3329
|
-
case "recent":
|
|
3330
|
-
const aDate = a.metrics.lastUsed?.getTime() ?? 0;
|
|
3331
|
-
const bDate = b.metrics.lastUsed?.getTime() ?? 0;
|
|
3332
|
-
return bDate - aDate;
|
|
3333
|
-
case "relevance":
|
|
3334
|
-
default:
|
|
3335
|
-
return 0;
|
|
3336
|
-
}
|
|
3337
|
-
});
|
|
3431
|
+
if (criteria.priorityOrder === "relevance") {
|
|
3338
3432
|
}
|
|
3339
3433
|
const maxSkills = criteria.maxSkills ?? this.config.defaultMaxSkills;
|
|
3340
3434
|
if (result.length > maxSkills) {
|
|
@@ -3371,6 +3465,7 @@ var LoadoutCompiler = class {
|
|
|
3371
3465
|
};
|
|
3372
3466
|
|
|
3373
3467
|
// src/serving/project-detector.ts
|
|
3468
|
+
init_cjs_shims();
|
|
3374
3469
|
var import_fs = require("fs");
|
|
3375
3470
|
var import_path = require("path");
|
|
3376
3471
|
var ProjectDetector = class _ProjectDetector {
|
|
@@ -3606,6 +3701,7 @@ var ProjectDetector = class _ProjectDetector {
|
|
|
3606
3701
|
};
|
|
3607
3702
|
|
|
3608
3703
|
// src/serving/view-renderer.ts
|
|
3704
|
+
init_cjs_shims();
|
|
3609
3705
|
var DEFAULT_CONFIG3 = {
|
|
3610
3706
|
includeTokenEstimates: false,
|
|
3611
3707
|
maxSummaryLength: 150
|
|
@@ -3801,6 +3897,7 @@ var ViewRenderer = class {
|
|
|
3801
3897
|
};
|
|
3802
3898
|
|
|
3803
3899
|
// src/serving/profiles/index.ts
|
|
3900
|
+
init_cjs_shims();
|
|
3804
3901
|
var codeReviewProfile = {
|
|
3805
3902
|
tags: ["review", "quality", "security", "best-practices"],
|
|
3806
3903
|
taskDescription: "review code for quality, security, and best practices",
|
|
@@ -3825,7 +3922,6 @@ var securityProfile = {
|
|
|
3825
3922
|
tagsAll: ["security"],
|
|
3826
3923
|
taskDescription: "security review, vulnerability detection, secure coding",
|
|
3827
3924
|
maxSkills: 8,
|
|
3828
|
-
minSuccessRate: 0.7,
|
|
3829
3925
|
priorityOrder: "relevance"
|
|
3830
3926
|
};
|
|
3831
3927
|
var testingProfile = {
|
|
@@ -4079,16 +4175,6 @@ var SkillGraphServer = class {
|
|
|
4079
4175
|
this.emit({ type: "skill:collapsed", skillId });
|
|
4080
4176
|
return true;
|
|
4081
4177
|
}
|
|
4082
|
-
/**
|
|
4083
|
-
* Record skill usage (for LRU tracking and auto-expansion)
|
|
4084
|
-
*/
|
|
4085
|
-
recordUsage(skillId) {
|
|
4086
|
-
if (!this.state.available.has(skillId)) return;
|
|
4087
|
-
this.touchLru(skillId);
|
|
4088
|
-
if (this.config.autoExpandOnUse && !this.state.expanded.has(skillId)) {
|
|
4089
|
-
this.expandSkill(skillId);
|
|
4090
|
-
}
|
|
4091
|
-
}
|
|
4092
4178
|
// ===========================================================================
|
|
4093
4179
|
// AGENT API - Methods for agent-side modifications
|
|
4094
4180
|
// ===========================================================================
|
|
@@ -4377,6 +4463,7 @@ var SkillGraphServer = class {
|
|
|
4377
4463
|
};
|
|
4378
4464
|
|
|
4379
4465
|
// src/serving/interfaces.ts
|
|
4466
|
+
init_cjs_shims();
|
|
4380
4467
|
function createStorageView(storage) {
|
|
4381
4468
|
return {
|
|
4382
4469
|
getSkill: storage.getSkill.bind(storage),
|
|
@@ -4416,7 +4503,11 @@ function createServingEventBridge() {
|
|
|
4416
4503
|
};
|
|
4417
4504
|
}
|
|
4418
4505
|
|
|
4506
|
+
// src/federation/index.ts
|
|
4507
|
+
init_cjs_shims();
|
|
4508
|
+
|
|
4419
4509
|
// src/federation/remote-store.ts
|
|
4510
|
+
init_cjs_shims();
|
|
4420
4511
|
var fs3 = __toESM(require("fs"));
|
|
4421
4512
|
var path3 = __toESM(require("path"));
|
|
4422
4513
|
var REMOTES_FILE = "remotes.json";
|
|
@@ -4612,12 +4703,14 @@ var RemoteStore = class {
|
|
|
4612
4703
|
};
|
|
4613
4704
|
|
|
4614
4705
|
// src/federation/remote-manager.ts
|
|
4706
|
+
init_cjs_shims();
|
|
4615
4707
|
var fs5 = __toESM(require("fs"));
|
|
4616
4708
|
var path5 = __toESM(require("path"));
|
|
4617
4709
|
var import_child_process = require("child_process");
|
|
4618
4710
|
var import_util = require("util");
|
|
4619
4711
|
|
|
4620
4712
|
// src/federation/skilltree-config.ts
|
|
4713
|
+
init_cjs_shims();
|
|
4621
4714
|
var fs4 = __toESM(require("fs"));
|
|
4622
4715
|
var path4 = __toESM(require("path"));
|
|
4623
4716
|
function resolveSkilltreeDir(repoRoot) {
|
|
@@ -5206,12 +5299,7 @@ ${err.stderr || err.message}`
|
|
|
5206
5299
|
tags: this.parseTags(metadata.tags),
|
|
5207
5300
|
createdAt: metadata.created ? new Date(metadata.created) : /* @__PURE__ */ new Date(),
|
|
5208
5301
|
updatedAt: metadata.updated ? new Date(metadata.updated) : /* @__PURE__ */ new Date(),
|
|
5209
|
-
status: metadata.status || "active"
|
|
5210
|
-
metrics: {
|
|
5211
|
-
usageCount: parseInt(metadata.usageCount) || 0,
|
|
5212
|
-
successRate: parseFloat(metadata.successRate) || 0,
|
|
5213
|
-
feedbackScores: []
|
|
5214
|
-
}
|
|
5302
|
+
status: metadata.status || "active"
|
|
5215
5303
|
};
|
|
5216
5304
|
}
|
|
5217
5305
|
/**
|
|
@@ -5280,9 +5368,6 @@ ${body.join("\n")}
|
|
|
5280
5368
|
if (filter.author && skill.author !== filter.author) {
|
|
5281
5369
|
return false;
|
|
5282
5370
|
}
|
|
5283
|
-
if (filter.minSuccessRate !== void 0 && skill.metrics.successRate < filter.minSuccessRate) {
|
|
5284
|
-
return false;
|
|
5285
|
-
}
|
|
5286
5371
|
if (filter.createdAfter && skill.createdAt < filter.createdAfter) {
|
|
5287
5372
|
return false;
|
|
5288
5373
|
}
|
|
@@ -5294,7 +5379,11 @@ ${body.join("\n")}
|
|
|
5294
5379
|
}
|
|
5295
5380
|
};
|
|
5296
5381
|
|
|
5382
|
+
// src/federation/federation-manager.ts
|
|
5383
|
+
init_cjs_shims();
|
|
5384
|
+
|
|
5297
5385
|
// src/versioning/semver.ts
|
|
5386
|
+
init_cjs_shims();
|
|
5298
5387
|
function parseVersion(version) {
|
|
5299
5388
|
const match = version.match(
|
|
5300
5389
|
/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+([a-zA-Z0-9.-]+))?$/
|
|
@@ -5908,11 +5997,13 @@ function createFederationManager(options) {
|
|
|
5908
5997
|
init_base();
|
|
5909
5998
|
|
|
5910
5999
|
// src/storage/cached.ts
|
|
6000
|
+
init_cjs_shims();
|
|
5911
6001
|
var fs8 = __toESM(require("fs"));
|
|
5912
6002
|
var path8 = __toESM(require("path"));
|
|
5913
6003
|
init_base();
|
|
5914
6004
|
|
|
5915
6005
|
// src/storage/filesystem.ts
|
|
6006
|
+
init_cjs_shims();
|
|
5916
6007
|
var fs6 = __toESM(require("fs/promises"));
|
|
5917
6008
|
var path6 = __toESM(require("path"));
|
|
5918
6009
|
init_base();
|
|
@@ -6165,11 +6256,6 @@ ${skill.instructions}
|
|
|
6165
6256
|
status,
|
|
6166
6257
|
parentVersion: parentVersion || void 0,
|
|
6167
6258
|
derivedFrom: derivedFrom.length > 0 ? derivedFrom : void 0,
|
|
6168
|
-
metrics: {
|
|
6169
|
-
usageCount: 0,
|
|
6170
|
-
successRate: 0,
|
|
6171
|
-
feedbackScores: []
|
|
6172
|
-
},
|
|
6173
6259
|
source: metadata?.source,
|
|
6174
6260
|
upstream,
|
|
6175
6261
|
namespace: metadata?.namespace
|
|
@@ -6572,7 +6658,11 @@ var CachedStorageAdapter = class extends BaseStorageAdapter {
|
|
|
6572
6658
|
}
|
|
6573
6659
|
};
|
|
6574
6660
|
|
|
6661
|
+
// src/versioning/index.ts
|
|
6662
|
+
init_cjs_shims();
|
|
6663
|
+
|
|
6575
6664
|
// src/versioning/lineage.ts
|
|
6665
|
+
init_cjs_shims();
|
|
6576
6666
|
var LineageTracker = class {
|
|
6577
6667
|
constructor(storage) {
|
|
6578
6668
|
this.storage = storage;
|
|
@@ -6616,11 +6706,6 @@ var LineageTracker = class {
|
|
|
6616
6706
|
createdAt: /* @__PURE__ */ new Date(),
|
|
6617
6707
|
updatedAt: /* @__PURE__ */ new Date(),
|
|
6618
6708
|
status: "draft",
|
|
6619
|
-
metrics: {
|
|
6620
|
-
usageCount: 0,
|
|
6621
|
-
successRate: 0,
|
|
6622
|
-
feedbackScores: []
|
|
6623
|
-
},
|
|
6624
6709
|
source: {
|
|
6625
6710
|
type: "composed",
|
|
6626
6711
|
importedAt: /* @__PURE__ */ new Date()
|
|
@@ -6821,11 +6906,12 @@ ${source}`;
|
|
|
6821
6906
|
};
|
|
6822
6907
|
|
|
6823
6908
|
// src/versioning/merge.ts
|
|
6909
|
+
init_cjs_shims();
|
|
6824
6910
|
var DEFAULT_MERGE_CONFIG = {
|
|
6825
6911
|
textStrategy: "combine",
|
|
6826
6912
|
tagStrategy: "union",
|
|
6827
6913
|
includeFields: ["instructions", "tags"],
|
|
6828
|
-
excludeFields: ["id", "version", "createdAt", "updatedAt", "
|
|
6914
|
+
excludeFields: ["id", "version", "createdAt", "updatedAt", "source"],
|
|
6829
6915
|
bumpType: "minor"
|
|
6830
6916
|
};
|
|
6831
6917
|
var SkillMerger = class {
|
|
@@ -7234,6 +7320,7 @@ function createSkillMerger(storage, config) {
|
|
|
7234
7320
|
}
|
|
7235
7321
|
|
|
7236
7322
|
// src/hooks/registry.ts
|
|
7323
|
+
init_cjs_shims();
|
|
7237
7324
|
var import_crypto = require("crypto");
|
|
7238
7325
|
var PRIORITY_ORDER = {
|
|
7239
7326
|
high: 0,
|
|
@@ -7418,6 +7505,7 @@ var HookRegistry = class {
|
|
|
7418
7505
|
var hookRegistry = new HookRegistry();
|
|
7419
7506
|
|
|
7420
7507
|
// src/materialization/materializer.ts
|
|
7508
|
+
init_cjs_shims();
|
|
7421
7509
|
var fs10 = __toESM(require("fs"));
|
|
7422
7510
|
var path10 = __toESM(require("path"));
|
|
7423
7511
|
var SKILLTREE_MARKER_START = "<!-- SKILLTREE_START -->";
|
|
@@ -8160,41 +8248,16 @@ var SkillBank = class {
|
|
|
8160
8248
|
}
|
|
8161
8249
|
}
|
|
8162
8250
|
/**
|
|
8163
|
-
* Handle events from serving layer
|
|
8251
|
+
* Handle events from serving layer.
|
|
8252
|
+
*
|
|
8253
|
+
* The `loadout:changed` event is currently the only one we react to.
|
|
8254
|
+
* Earlier versions also handled `skill:used` / `skill:feedback` to mutate
|
|
8255
|
+
* `Skill.metrics`, but skill-tree no longer tracks per-skill usage —
|
|
8256
|
+
* cognitive-core owns that signal via `playbook.evolution.*`. See
|
|
8257
|
+
* docs/SKILL_TREE_METRICS_DEPRECATION.md.
|
|
8164
8258
|
*/
|
|
8165
8259
|
async handleServingEvent(event) {
|
|
8166
8260
|
switch (event.type) {
|
|
8167
|
-
case "skill:used":
|
|
8168
|
-
const skill = await this.storage.getSkill(event.skillId);
|
|
8169
|
-
if (skill) {
|
|
8170
|
-
skill.metrics.usageCount++;
|
|
8171
|
-
skill.metrics.lastUsed = /* @__PURE__ */ new Date();
|
|
8172
|
-
if (event.success) {
|
|
8173
|
-
const total = skill.metrics.usageCount;
|
|
8174
|
-
const currentSuccesses = skill.metrics.successRate * (total - 1);
|
|
8175
|
-
skill.metrics.successRate = (currentSuccesses + 1) / total;
|
|
8176
|
-
} else {
|
|
8177
|
-
const total = skill.metrics.usageCount;
|
|
8178
|
-
const currentSuccesses = skill.metrics.successRate * (total - 1);
|
|
8179
|
-
skill.metrics.successRate = currentSuccesses / total;
|
|
8180
|
-
}
|
|
8181
|
-
skill.updatedAt = /* @__PURE__ */ new Date();
|
|
8182
|
-
await this.storage.saveSkill(skill);
|
|
8183
|
-
}
|
|
8184
|
-
break;
|
|
8185
|
-
case "skill:feedback":
|
|
8186
|
-
const feedbackSkill = await this.storage.getSkill(event.skillId);
|
|
8187
|
-
if (feedbackSkill) {
|
|
8188
|
-
feedbackSkill.metrics.feedbackScores.push(event.score);
|
|
8189
|
-
if (feedbackSkill.metrics.feedbackScores.length > 50) {
|
|
8190
|
-
feedbackSkill.metrics.feedbackScores = feedbackSkill.metrics.feedbackScores.slice(-50);
|
|
8191
|
-
}
|
|
8192
|
-
feedbackSkill.updatedAt = /* @__PURE__ */ new Date();
|
|
8193
|
-
await this.storage.saveSkill(feedbackSkill);
|
|
8194
|
-
}
|
|
8195
|
-
break;
|
|
8196
|
-
case "skill:requested":
|
|
8197
|
-
break;
|
|
8198
8261
|
case "loadout:changed":
|
|
8199
8262
|
break;
|
|
8200
8263
|
}
|
|
@@ -8216,26 +8279,17 @@ var SkillBank = class {
|
|
|
8216
8279
|
deprecated: 0,
|
|
8217
8280
|
experimental: 0
|
|
8218
8281
|
},
|
|
8219
|
-
byTag: {}
|
|
8220
|
-
avgSuccessRate: 0,
|
|
8221
|
-
totalUsage: 0
|
|
8282
|
+
byTag: {}
|
|
8222
8283
|
};
|
|
8223
8284
|
if (this.namespaceConfig) {
|
|
8224
8285
|
stats.byScope = { personal: 0, team: 0, global: 0 };
|
|
8225
8286
|
stats.byVisibility = { private: 0, "team-only": 0, public: 0 };
|
|
8226
8287
|
}
|
|
8227
|
-
let successRateSum = 0;
|
|
8228
|
-
let successRateCount = 0;
|
|
8229
8288
|
for (const skill of skills) {
|
|
8230
8289
|
stats.byStatus[skill.status]++;
|
|
8231
8290
|
for (const tag of skill.tags) {
|
|
8232
8291
|
stats.byTag[tag] = (stats.byTag[tag] || 0) + 1;
|
|
8233
8292
|
}
|
|
8234
|
-
stats.totalUsage += skill.metrics.usageCount;
|
|
8235
|
-
if (skill.metrics.successRate > 0) {
|
|
8236
|
-
successRateSum += skill.metrics.successRate;
|
|
8237
|
-
successRateCount++;
|
|
8238
|
-
}
|
|
8239
8293
|
if (stats.byScope && stats.byVisibility) {
|
|
8240
8294
|
const scope = skill.namespace?.scope || "personal";
|
|
8241
8295
|
const visibility = skill.namespace?.visibility || "private";
|
|
@@ -8243,7 +8297,6 @@ var SkillBank = class {
|
|
|
8243
8297
|
stats.byVisibility[visibility]++;
|
|
8244
8298
|
}
|
|
8245
8299
|
}
|
|
8246
|
-
stats.avgSuccessRate = successRateCount > 0 ? successRateSum / successRateCount : 0;
|
|
8247
8300
|
return stats;
|
|
8248
8301
|
}
|
|
8249
8302
|
/**
|
|
@@ -8309,10 +8362,12 @@ function createSkillBank(config) {
|
|
|
8309
8362
|
}
|
|
8310
8363
|
|
|
8311
8364
|
// src/storage/index.ts
|
|
8365
|
+
init_cjs_shims();
|
|
8312
8366
|
init_base();
|
|
8313
8367
|
init_sqlite();
|
|
8314
8368
|
|
|
8315
8369
|
// src/storage/migration.ts
|
|
8370
|
+
init_cjs_shims();
|
|
8316
8371
|
async function migrateStorage(source, target, options = {}) {
|
|
8317
8372
|
const opts = {
|
|
8318
8373
|
skills: options.skills ?? true,
|
|
@@ -8404,12 +8459,17 @@ async function migrateLineages(source, target, opts, result) {
|
|
|
8404
8459
|
}
|
|
8405
8460
|
|
|
8406
8461
|
// src/agents/index.ts
|
|
8462
|
+
init_cjs_shims();
|
|
8407
8463
|
init_types();
|
|
8408
8464
|
init_generator();
|
|
8409
8465
|
init_parser();
|
|
8410
8466
|
init_sync();
|
|
8411
8467
|
|
|
8468
|
+
// src/hooks/index.ts
|
|
8469
|
+
init_cjs_shims();
|
|
8470
|
+
|
|
8412
8471
|
// src/hooks/builtin.ts
|
|
8472
|
+
init_cjs_shims();
|
|
8413
8473
|
function createLoggingHook(logger = console.log) {
|
|
8414
8474
|
return {
|
|
8415
8475
|
name: "logging-hook",
|
|
@@ -8511,6 +8571,18 @@ function conditionalHook(filter, handler) {
|
|
|
8511
8571
|
};
|
|
8512
8572
|
}
|
|
8513
8573
|
|
|
8574
|
+
// src/serving/index.ts
|
|
8575
|
+
init_cjs_shims();
|
|
8576
|
+
|
|
8577
|
+
// src/materialization/index.ts
|
|
8578
|
+
init_cjs_shims();
|
|
8579
|
+
|
|
8580
|
+
// src/sync/index.ts
|
|
8581
|
+
init_cjs_shims();
|
|
8582
|
+
|
|
8583
|
+
// src/sync/hierarchical-sync-adapter.ts
|
|
8584
|
+
init_cjs_shims();
|
|
8585
|
+
|
|
8514
8586
|
// src/sync/index.ts
|
|
8515
8587
|
function createDefaultSyncConfig(remoteUrl, agentId, options) {
|
|
8516
8588
|
return {
|
|
@@ -8540,10 +8612,15 @@ function createDefaultSyncConfig(remoteUrl, agentId, options) {
|
|
|
8540
8612
|
}
|
|
8541
8613
|
|
|
8542
8614
|
// src/services/indexer.ts
|
|
8615
|
+
init_cjs_shims();
|
|
8543
8616
|
var path12 = __toESM(require("path"));
|
|
8544
8617
|
var fs12 = __toESM(require("fs"));
|
|
8545
8618
|
|
|
8619
|
+
// src/config/index.ts
|
|
8620
|
+
init_cjs_shims();
|
|
8621
|
+
|
|
8546
8622
|
// src/config/types.ts
|
|
8623
|
+
init_cjs_shims();
|
|
8547
8624
|
var DEFAULT_CONFIG6 = {
|
|
8548
8625
|
storage: {
|
|
8549
8626
|
path: "~/.skill-tree"
|
|
@@ -8578,6 +8655,7 @@ var DEFAULT_CONFIG6 = {
|
|
|
8578
8655
|
};
|
|
8579
8656
|
|
|
8580
8657
|
// src/config/loader.ts
|
|
8658
|
+
init_cjs_shims();
|
|
8581
8659
|
var fs11 = __toESM(require("fs"));
|
|
8582
8660
|
var path11 = __toESM(require("path"));
|
|
8583
8661
|
var os = __toESM(require("os"));
|
|
@@ -8873,6 +8951,7 @@ function loadConfig(configPath) {
|
|
|
8873
8951
|
}
|
|
8874
8952
|
|
|
8875
8953
|
// src/import/converter.ts
|
|
8954
|
+
init_cjs_shims();
|
|
8876
8955
|
function convertIndexerSkill(indexerSkill) {
|
|
8877
8956
|
const warnings = [];
|
|
8878
8957
|
const instructions = indexerSkill.content || "";
|
|
@@ -8899,11 +8978,6 @@ function convertIndexerSkill(indexerSkill) {
|
|
|
8899
8978
|
createdAt: new Date(indexerSkill.scrapedAt),
|
|
8900
8979
|
updatedAt: new Date(indexerSkill.updatedAt),
|
|
8901
8980
|
status,
|
|
8902
|
-
metrics: {
|
|
8903
|
-
usageCount: 0,
|
|
8904
|
-
successRate: 0,
|
|
8905
|
-
feedbackScores: []
|
|
8906
|
-
},
|
|
8907
8981
|
source: {
|
|
8908
8982
|
type: "imported",
|
|
8909
8983
|
location: indexerSkill.sourceUrl,
|
|
@@ -9605,7 +9679,7 @@ var IndexerService = class {
|
|
|
9605
9679
|
if (this.db) {
|
|
9606
9680
|
const skills = await (this.db.getAllSkills?.() || this.db.listSkills?.()) || [];
|
|
9607
9681
|
for (const skill of skills) {
|
|
9608
|
-
if (skill.status !== "indexed" && !options?.force) continue;
|
|
9682
|
+
if (skill.status !== "indexed" && !options?.force && !options?.importAll) continue;
|
|
9609
9683
|
try {
|
|
9610
9684
|
const converted = convertIndexerSkill(skill);
|
|
9611
9685
|
await this.skillBank.saveSkill(converted.skill);
|
|
@@ -9702,7 +9776,7 @@ var IndexerService = class {
|
|
|
9702
9776
|
};
|
|
9703
9777
|
|
|
9704
9778
|
// src/index.ts
|
|
9705
|
-
var VERSION = "0.
|
|
9779
|
+
var VERSION = "0.2.0";
|
|
9706
9780
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9707
9781
|
0 && (module.exports = {
|
|
9708
9782
|
AgentsGenerator,
|
|
@@ -9772,4 +9846,3 @@ var VERSION = "0.1.0";
|
|
|
9772
9846
|
testingProfile,
|
|
9773
9847
|
writeAgentsMd
|
|
9774
9848
|
});
|
|
9775
|
-
//# sourceMappingURL=index.js.map
|