skilldb 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +13 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +129 -6
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -57,7 +57,13 @@ var SkillDBClient = class {
|
|
|
57
57
|
}
|
|
58
58
|
return h;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
/** Make an authenticated request to any endpoint (used by MCP tools for private skills). */
|
|
61
|
+
async rawRequest(endpoint, init) {
|
|
62
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
63
|
+
const headers = { ...this.headers(), ...init?.headers || {} };
|
|
64
|
+
return fetch(url, { ...init, headers });
|
|
65
|
+
}
|
|
66
|
+
async typedRequest(endpoint, params) {
|
|
61
67
|
const url = new URL(`${this.baseUrl}${endpoint}`);
|
|
62
68
|
if (params) {
|
|
63
69
|
for (const [k, v] of Object.entries(params)) {
|
|
@@ -74,7 +80,7 @@ var SkillDBClient = class {
|
|
|
74
80
|
}
|
|
75
81
|
/** Search skills by keyword. */
|
|
76
82
|
async search(query, options) {
|
|
77
|
-
return this.
|
|
83
|
+
return this.typedRequest("/skills", {
|
|
78
84
|
search: query,
|
|
79
85
|
category: options?.category ?? "",
|
|
80
86
|
pack: options?.pack ?? "",
|
|
@@ -86,7 +92,7 @@ var SkillDBClient = class {
|
|
|
86
92
|
}
|
|
87
93
|
/** List skills with optional filters and sorting. */
|
|
88
94
|
async list(options) {
|
|
89
|
-
return this.
|
|
95
|
+
return this.typedRequest("/skills", {
|
|
90
96
|
category: options?.category ?? "",
|
|
91
97
|
pack: options?.pack ?? "",
|
|
92
98
|
search: options?.search ?? "",
|
|
@@ -99,21 +105,21 @@ var SkillDBClient = class {
|
|
|
99
105
|
/** Get a single skill by ID (e.g. "software-skills/code-review.md"). */
|
|
100
106
|
async get(id) {
|
|
101
107
|
const encoded = encodeURIComponent(id);
|
|
102
|
-
const res = await this.
|
|
108
|
+
const res = await this.typedRequest(`/skills/${encoded}`, {
|
|
103
109
|
include_content: "true"
|
|
104
110
|
});
|
|
105
111
|
return "skill" in res ? res.skill : res;
|
|
106
112
|
}
|
|
107
113
|
/** Batch retrieve multiple skills by IDs (max 50). */
|
|
108
114
|
async batch(ids) {
|
|
109
|
-
return this.
|
|
115
|
+
return this.typedRequest("/skills", {
|
|
110
116
|
ids: ids.slice(0, 50).join(","),
|
|
111
117
|
include_content: "true"
|
|
112
118
|
});
|
|
113
119
|
}
|
|
114
120
|
/** Get search autocomplete suggestions. */
|
|
115
121
|
async suggest(query) {
|
|
116
|
-
return this.
|
|
122
|
+
return this.typedRequest("/skills/suggest", { q: query });
|
|
117
123
|
}
|
|
118
124
|
/** Validate that the configured API key works. */
|
|
119
125
|
async validate() {
|
|
@@ -1922,7 +1928,7 @@ async function purgeCommand(options) {
|
|
|
1922
1928
|
}
|
|
1923
1929
|
stats.activeKept = 0;
|
|
1924
1930
|
}
|
|
1925
|
-
writeManifest(
|
|
1931
|
+
writeManifest(manifest, cwd);
|
|
1926
1932
|
console.log(pc18.green(`
|
|
1927
1933
|
\u2713 Purge complete`));
|
|
1928
1934
|
console.log(` Skills removed: ${stats.skillsRemoved}`);
|