@modootoday/pmcp 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -10
- package/SECURITY.md +5 -0
- package/dist/{catalog-5v7jrGwP.d.ts → catalog-CS0j6-0U.d.ts} +11 -11
- package/dist/{chunk-GNJSZCRH.js → chunk-DTQAN33I.js} +37 -2
- package/dist/chunk-HB4VJ5VW.js +1664 -0
- package/dist/{chunk-IJPOJ6PG.js → chunk-K7BX33LH.js} +6 -3
- package/dist/{chunk-KP3TQ3QY.js → chunk-MO3LLVVY.js} +2 -2
- package/dist/{chunk-VBLAH6J2.js → chunk-STBBSQ3R.js} +2 -2
- package/dist/cli.js +50 -11
- package/dist/http.d.ts +32 -3
- package/dist/http.js +144 -22
- package/dist/index.d.ts +119 -44
- package/dist/index.js +51 -6
- package/dist/server-CLyCpwZb.d.ts +352 -0
- package/dist/stdio.d.ts +7 -3
- package/dist/stdio.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-C46YCY2I.js +0 -1194
- package/dist/server-B9GDPRoE.d.ts +0 -217
package/dist/index.js
CHANGED
|
@@ -11,78 +11,115 @@ import {
|
|
|
11
11
|
plan,
|
|
12
12
|
project,
|
|
13
13
|
readConfig,
|
|
14
|
-
readSpec
|
|
15
|
-
|
|
14
|
+
readSpec,
|
|
15
|
+
validateCatalog,
|
|
16
|
+
validateSkillDir
|
|
17
|
+
} from "./chunk-DTQAN33I.js";
|
|
16
18
|
import {
|
|
17
19
|
DEFAULT_INTENT_CACHE_LIMIT,
|
|
18
20
|
openIntentCache
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MO3LLVVY.js";
|
|
20
22
|
import {
|
|
21
23
|
ASSET_KINDS,
|
|
22
24
|
CATALOG_PAGE_MAX,
|
|
23
25
|
CATALOG_PAGE_SIZE,
|
|
26
|
+
COMPATIBILITY_MAX,
|
|
24
27
|
DEFAULT_FIND_LIMIT,
|
|
25
28
|
DESCRIBE_FILE_LIMIT,
|
|
29
|
+
DESCRIPTION_MAX,
|
|
26
30
|
MAX_SKILL_DEPTH,
|
|
31
|
+
NAME_MAX,
|
|
27
32
|
READ_BUDGET_BYTES,
|
|
28
33
|
SERVER_NAME,
|
|
34
|
+
SERVER_VERSION,
|
|
29
35
|
SKILLS_EXTENSION,
|
|
30
36
|
SKIPPED_DIRS,
|
|
31
37
|
assetRoot,
|
|
38
|
+
bundleResponseSchema,
|
|
39
|
+
bundleSkill,
|
|
40
|
+
catalogResponseSchema,
|
|
41
|
+
classify,
|
|
32
42
|
cosine,
|
|
33
43
|
createSkillServer,
|
|
34
44
|
createSkillTools,
|
|
45
|
+
describeResponseSchema,
|
|
35
46
|
displayPath,
|
|
36
47
|
extensionEntry,
|
|
37
48
|
find,
|
|
49
|
+
findResultSchema,
|
|
50
|
+
frontmatterObject,
|
|
51
|
+
isUtf8Text,
|
|
38
52
|
kindOf,
|
|
39
53
|
lexicalScore,
|
|
54
|
+
listSkillFiles,
|
|
55
|
+
mimeOf,
|
|
40
56
|
normaliseIntent,
|
|
57
|
+
promptName,
|
|
41
58
|
readBody,
|
|
42
59
|
readCatalog,
|
|
43
60
|
readFrontmatter,
|
|
44
61
|
readFrontmatterText,
|
|
45
62
|
readMarketplace,
|
|
46
63
|
readMetadata,
|
|
64
|
+
readSkillFile,
|
|
65
|
+
registerSkillPrompts,
|
|
66
|
+
registerSkillResources,
|
|
47
67
|
registerSkillTools,
|
|
48
68
|
registerSkillsExtension,
|
|
49
|
-
|
|
69
|
+
resolveSkillFileUri,
|
|
70
|
+
skillFileUri,
|
|
71
|
+
specProblems,
|
|
50
72
|
withoutBody
|
|
51
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-HB4VJ5VW.js";
|
|
52
74
|
export {
|
|
53
75
|
ASSET_KINDS,
|
|
54
76
|
CATALOG_PAGE_MAX,
|
|
55
77
|
CATALOG_PAGE_SIZE,
|
|
78
|
+
COMPATIBILITY_MAX,
|
|
56
79
|
CONFIG_FILE,
|
|
57
80
|
ConfigError,
|
|
58
81
|
DEFAULT_FIND_LIMIT,
|
|
59
82
|
DEFAULT_INTENT_CACHE_LIMIT,
|
|
60
83
|
DESCRIBE_FILE_LIMIT,
|
|
84
|
+
DESCRIPTION_MAX,
|
|
61
85
|
LOCK_FILE,
|
|
62
86
|
MAX_SKILL_DEPTH,
|
|
87
|
+
NAME_MAX,
|
|
63
88
|
ProjectError,
|
|
64
89
|
READ_BUDGET_BYTES,
|
|
65
90
|
SERVER_NAME,
|
|
91
|
+
SERVER_VERSION,
|
|
66
92
|
SKILLS_EXTENSION,
|
|
67
93
|
SKIPPED_DIRS,
|
|
68
94
|
TOOLS,
|
|
69
95
|
assetRoot,
|
|
96
|
+
bundleResponseSchema,
|
|
97
|
+
bundleSkill,
|
|
98
|
+
catalogResponseSchema,
|
|
99
|
+
classify,
|
|
70
100
|
cosine,
|
|
71
101
|
createSkillServer,
|
|
72
102
|
createSkillTools,
|
|
73
103
|
deadGlobs,
|
|
74
104
|
deriveName,
|
|
105
|
+
describeResponseSchema,
|
|
75
106
|
displayPath,
|
|
76
107
|
doctor,
|
|
77
108
|
extensionEntry,
|
|
78
109
|
find,
|
|
79
110
|
findConfig,
|
|
111
|
+
findResultSchema,
|
|
112
|
+
isUtf8Text,
|
|
80
113
|
kindOf,
|
|
81
114
|
lexicalScore,
|
|
115
|
+
listSkillFiles,
|
|
116
|
+
mimeOf,
|
|
82
117
|
normaliseIntent,
|
|
83
118
|
openIntentCache,
|
|
119
|
+
frontmatterObject as parseSkillFrontmatter,
|
|
84
120
|
plan,
|
|
85
121
|
project,
|
|
122
|
+
promptName,
|
|
86
123
|
readBody,
|
|
87
124
|
readCatalog,
|
|
88
125
|
readConfig,
|
|
@@ -90,10 +127,18 @@ export {
|
|
|
90
127
|
readFrontmatterText,
|
|
91
128
|
readMarketplace,
|
|
92
129
|
readMetadata,
|
|
130
|
+
readSkillFile,
|
|
93
131
|
readSpec,
|
|
132
|
+
registerSkillPrompts,
|
|
133
|
+
registerSkillResources,
|
|
94
134
|
registerSkillTools,
|
|
95
135
|
registerSkillsExtension,
|
|
96
|
-
|
|
136
|
+
resolveSkillFileUri,
|
|
137
|
+
skillFileUri,
|
|
138
|
+
skillFileUri as skillUri,
|
|
139
|
+
specProblems,
|
|
140
|
+
validateCatalog,
|
|
141
|
+
validateSkillDir,
|
|
97
142
|
withoutBody
|
|
98
143
|
};
|
|
99
144
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { S as SkillEntry, C as CatalogOptions, A as AssetKind } from './catalog-CS0j6-0U.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The intent key and the cache contract.
|
|
6
|
+
*
|
|
7
|
+
* Separate from the sqlite implementation so that ranking, which needs the key
|
|
8
|
+
* and the interface, does not pull a bun-only module into a consumer running
|
|
9
|
+
* under node. Only `cache.ts` requires bun.
|
|
10
|
+
*/
|
|
11
|
+
interface IntentCacheStats {
|
|
12
|
+
readonly hits: number;
|
|
13
|
+
readonly misses: number;
|
|
14
|
+
/** Rows found for the key but written by a different model. */
|
|
15
|
+
readonly mismatched: number;
|
|
16
|
+
readonly rows: number;
|
|
17
|
+
/** Which sqlite builtin answered, or absent when there is no cache. */
|
|
18
|
+
readonly provider?: string;
|
|
19
|
+
}
|
|
20
|
+
interface IntentCache {
|
|
21
|
+
/** The cached vector for an intent, or null when nothing usable is stored. */
|
|
22
|
+
get(intent: string): Float32Array | null;
|
|
23
|
+
put(intent: string, vector: Float32Array): void;
|
|
24
|
+
stats(): IntentCacheStats;
|
|
25
|
+
close(): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Same question, differently typed. Case, punctuation and spacing only — the
|
|
29
|
+
* key has to survive a caller writing "How do I wire X?" and "how do i wire x".
|
|
30
|
+
*/
|
|
31
|
+
declare function normaliseIntent(intent: string): string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Ranking an intent against skill descriptions.
|
|
35
|
+
*
|
|
36
|
+
* Semantic when an embedder is supplied, lexical otherwise, and the answer says
|
|
37
|
+
* which. A caller that cannot tell the two apart cannot tell a degraded server
|
|
38
|
+
* from a working one.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
type Ranking = "semantic" | "lexical";
|
|
42
|
+
interface Match {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly package: string;
|
|
45
|
+
readonly description: string;
|
|
46
|
+
readonly score: number;
|
|
47
|
+
}
|
|
48
|
+
interface FindResult {
|
|
49
|
+
readonly ranking: Ranking;
|
|
50
|
+
readonly matches: readonly Match[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The encoder, supplied by the caller. There is no default and no bundled
|
|
54
|
+
* model: which model runs decides what the scores mean, so it is the consuming
|
|
55
|
+
* repository's declaration rather than this package's.
|
|
56
|
+
*/
|
|
57
|
+
interface Embedder {
|
|
58
|
+
readonly modelId: string;
|
|
59
|
+
readonly dims: number;
|
|
60
|
+
/** Encodes an intent, the query side. */
|
|
61
|
+
embed(text: string): Promise<Float32Array>;
|
|
62
|
+
/** Encodes a description, for models that write the two sides differently. */
|
|
63
|
+
embedPassage?(text: string): Promise<Float32Array>;
|
|
64
|
+
}
|
|
65
|
+
interface FindOptions {
|
|
66
|
+
readonly entries: readonly SkillEntry[];
|
|
67
|
+
readonly intent: string;
|
|
68
|
+
readonly limit?: number;
|
|
69
|
+
readonly embedder?: Embedder;
|
|
70
|
+
readonly cache?: IntentCache;
|
|
71
|
+
/** Precomputed description vectors, keyed by skill name. */
|
|
72
|
+
readonly vectors?: ReadonlyMap<string, Float32Array>;
|
|
73
|
+
}
|
|
74
|
+
declare const DEFAULT_FIND_LIMIT = 5;
|
|
75
|
+
/**
|
|
76
|
+
* Token overlap and bigram Dice, averaged. Deterministic and dependency-free:
|
|
77
|
+
* this is the answer when there is no model, so it must never be the thing
|
|
78
|
+
* that fails.
|
|
79
|
+
*/
|
|
80
|
+
declare function lexicalScore(intent: string, description: string): number;
|
|
81
|
+
/** Cosine over two equal-width vectors. Zero when either has no magnitude. */
|
|
82
|
+
declare function cosine(a: Float32Array, b: Float32Array): number;
|
|
83
|
+
/**
|
|
84
|
+
* Ranked matches, and which ranking produced them.
|
|
85
|
+
*
|
|
86
|
+
* Returns rather than loads: a search verb that also acts cannot be used to
|
|
87
|
+
* look, and the whole reason this server exists is that looking should be
|
|
88
|
+
* cheap.
|
|
89
|
+
*/
|
|
90
|
+
declare function find(options: FindOptions): Promise<FindResult>;
|
|
91
|
+
|
|
92
|
+
/** The files one skill carries, with sizes and digests. */
|
|
93
|
+
interface SkillFile {
|
|
94
|
+
/** Relative to the skill directory, with forward slashes. */
|
|
95
|
+
readonly path: string;
|
|
96
|
+
readonly bytes: number;
|
|
97
|
+
readonly sha256: string;
|
|
98
|
+
}
|
|
99
|
+
interface SkillFileListing {
|
|
100
|
+
readonly files: readonly SkillFile[];
|
|
101
|
+
readonly truncated: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Every file under a skill root, or the root itself when the asset is one file.
|
|
105
|
+
* node_modules and .git are never part of a skill.
|
|
106
|
+
*/
|
|
107
|
+
declare function listSkillFiles(root: string, limit?: number): SkillFileListing;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Every file of one skill as fetchable links, so a host can write the skill to a
|
|
111
|
+
* local skills directory without routing its bytes through the model.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
interface BundleFile extends SkillFile {
|
|
115
|
+
readonly uri: string;
|
|
116
|
+
readonly mimeType: string;
|
|
117
|
+
}
|
|
118
|
+
interface SkillBundle {
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly files: readonly BundleFile[];
|
|
121
|
+
readonly truncated: boolean;
|
|
122
|
+
}
|
|
123
|
+
declare function bundleSkill(entry: SkillEntry): SkillBundle;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* One MIME table for every surface that hands out skill files, so a file is text,
|
|
127
|
+
* image, audio or blob the same way through skill_read and through resources/read.
|
|
128
|
+
*/
|
|
129
|
+
/** The declared type of a path by extension, or null when the extension is unknown. */
|
|
130
|
+
declare function mimeOf(path: string): string | null;
|
|
131
|
+
/** True when the bytes decode as UTF-8 and encode back to themselves, without NUL. */
|
|
132
|
+
declare function isUtf8Text(bytes: Uint8Array): boolean;
|
|
133
|
+
type FileKind = "text" | "image" | "audio" | "blob";
|
|
134
|
+
interface Classified {
|
|
135
|
+
readonly kind: FileKind;
|
|
136
|
+
readonly mimeType: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* How a file goes out. A type that names text is still served as a blob when the
|
|
140
|
+
* bytes are not valid UTF-8, so a digest over them stays exact.
|
|
141
|
+
*/
|
|
142
|
+
declare function classify(path: string, bytes: Uint8Array): Classified;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Turns a path a caller asked for into a file inside one skill. A path that
|
|
146
|
+
* leaves the skill, directly or through a link, is refused.
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
type FileRefusal = {
|
|
150
|
+
readonly ok: false;
|
|
151
|
+
readonly error: "path_outside_skill" | "no_such_file";
|
|
152
|
+
readonly detail: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* One skill file's bytes, typed. Text stays text; images, audio and other binary
|
|
157
|
+
* go out as base64 so nothing is corrupted on the way. Nothing is ever executed.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
/** Largest file returned whole. A skill needing more should split it. */
|
|
161
|
+
declare const READ_BUDGET_BYTES: number;
|
|
162
|
+
interface SkillFileContent {
|
|
163
|
+
readonly ok: true;
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly path: string;
|
|
166
|
+
readonly bytes: number;
|
|
167
|
+
readonly sha256: string;
|
|
168
|
+
readonly mimeType: string;
|
|
169
|
+
readonly kind: FileKind;
|
|
170
|
+
/** Set when kind is text. */
|
|
171
|
+
readonly text?: string;
|
|
172
|
+
/** Base64, set when kind is not text. */
|
|
173
|
+
readonly blob?: string;
|
|
174
|
+
}
|
|
175
|
+
type ReadResult = SkillFileContent | FileRefusal | {
|
|
176
|
+
readonly ok: false;
|
|
177
|
+
readonly error: "over_budget";
|
|
178
|
+
readonly detail: string;
|
|
179
|
+
};
|
|
180
|
+
declare function readSkillFile(entry: SkillEntry, wanted?: string, budget?: number): ReadResult;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The shapes the tools answer with, defined once: the TypeScript types are
|
|
184
|
+
* inferred from these schemas and the same schemas are each tool's outputSchema,
|
|
185
|
+
* so structuredContent cannot drift from what a client validates it against.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
declare const catalogItemSchema: z.ZodObject<{
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
description: z.ZodString;
|
|
191
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
192
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
agent: "agent";
|
|
194
|
+
skill: "skill";
|
|
195
|
+
hook: "hook";
|
|
196
|
+
mcp: "mcp";
|
|
197
|
+
}>>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
declare const catalogResponseSchema: z.ZodObject<{
|
|
200
|
+
count: z.ZodNumber;
|
|
201
|
+
page: z.ZodNumber;
|
|
202
|
+
totalPages: z.ZodNumber;
|
|
203
|
+
hasNext: z.ZodBoolean;
|
|
204
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
205
|
+
package: z.ZodString;
|
|
206
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
description: z.ZodString;
|
|
209
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
210
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
211
|
+
agent: "agent";
|
|
212
|
+
skill: "skill";
|
|
213
|
+
hook: "hook";
|
|
214
|
+
mcp: "mcp";
|
|
215
|
+
}>>;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
declare const findResultSchema: z.ZodObject<{
|
|
220
|
+
ranking: z.ZodEnum<{
|
|
221
|
+
semantic: "semantic";
|
|
222
|
+
lexical: "lexical";
|
|
223
|
+
}>;
|
|
224
|
+
matches: z.ZodArray<z.ZodObject<{
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
package: z.ZodString;
|
|
227
|
+
description: z.ZodString;
|
|
228
|
+
score: z.ZodNumber;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
declare const describeResponseSchema: z.ZodObject<{
|
|
232
|
+
name: z.ZodString;
|
|
233
|
+
kind: z.ZodEnum<{
|
|
234
|
+
agent: "agent";
|
|
235
|
+
skill: "skill";
|
|
236
|
+
hook: "hook";
|
|
237
|
+
mcp: "mcp";
|
|
238
|
+
}>;
|
|
239
|
+
package: z.ZodString;
|
|
240
|
+
description: z.ZodString;
|
|
241
|
+
tier: z.ZodOptional<z.ZodString>;
|
|
242
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString>>]>>;
|
|
243
|
+
frontmatter: z.ZodString;
|
|
244
|
+
files: z.ZodArray<z.ZodObject<{
|
|
245
|
+
path: z.ZodString;
|
|
246
|
+
bytes: z.ZodNumber;
|
|
247
|
+
sha256: z.ZodString;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
filesTruncated: z.ZodBoolean;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
declare const bundleResponseSchema: z.ZodObject<{
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
truncated: z.ZodBoolean;
|
|
254
|
+
files: z.ZodArray<z.ZodObject<{
|
|
255
|
+
path: z.ZodString;
|
|
256
|
+
bytes: z.ZodNumber;
|
|
257
|
+
sha256: z.ZodString;
|
|
258
|
+
uri: z.ZodString;
|
|
259
|
+
mimeType: z.ZodString;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
type CatalogItem = z.infer<typeof catalogItemSchema>;
|
|
263
|
+
type CatalogResponse = z.infer<typeof catalogResponseSchema>;
|
|
264
|
+
type DescribeResponse = z.infer<typeof describeResponseSchema>;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The catalog operations the tools speak, as plain functions.
|
|
268
|
+
*
|
|
269
|
+
* The point of the server is that a session's startup cost does not grow with
|
|
270
|
+
* the number of skills installed: the host lists a fixed set of tools whatever
|
|
271
|
+
* the catalog holds, and a body is read only when one is asked for.
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
/** How many files skill_describe lists before saying the rest were cut. */
|
|
275
|
+
declare const DESCRIBE_FILE_LIMIT = 200;
|
|
276
|
+
declare const CATALOG_PAGE_SIZE = 8;
|
|
277
|
+
declare const CATALOG_PAGE_MAX = 20;
|
|
278
|
+
/** A kind filter value: one kind, or every kind. */
|
|
279
|
+
type KindFilter = AssetKind | "any";
|
|
280
|
+
/**
|
|
281
|
+
* Equality filters over catalog fields. Unset keys match everything except
|
|
282
|
+
* kind, which defaults to skill so a search for a skill never returns a hook.
|
|
283
|
+
*/
|
|
284
|
+
interface SkillFilters {
|
|
285
|
+
readonly kind?: KindFilter;
|
|
286
|
+
readonly tier?: string;
|
|
287
|
+
readonly package?: string;
|
|
288
|
+
readonly level?: string;
|
|
289
|
+
readonly domain?: string;
|
|
290
|
+
readonly medium?: string;
|
|
291
|
+
}
|
|
292
|
+
interface SkillServerOptions extends CatalogOptions {
|
|
293
|
+
readonly embedder?: Embedder;
|
|
294
|
+
readonly cache?: IntentCache;
|
|
295
|
+
readonly vectors?: ReadonlyMap<string, Float32Array>;
|
|
296
|
+
/** Injected for tests. Reads the catalog off disk otherwise. */
|
|
297
|
+
readonly loadCatalog?: (options: CatalogOptions) => SkillEntry[];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
interface CallResponse {
|
|
301
|
+
readonly name: string;
|
|
302
|
+
readonly body: string;
|
|
303
|
+
/** Files the skill carries besides its body, for skill_read and resources/read. */
|
|
304
|
+
readonly files: readonly BundleFile[];
|
|
305
|
+
readonly filesTruncated: boolean;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The catalog, the search and the read, as plain functions.
|
|
309
|
+
*
|
|
310
|
+
* Separate from the MCP wiring so they can be exercised without a transport,
|
|
311
|
+
* and so a consumer that wants them from a hook or a script is not made to
|
|
312
|
+
* speak a protocol to get them.
|
|
313
|
+
*/
|
|
314
|
+
declare function createSkillTools(options: SkillServerOptions): {
|
|
315
|
+
/**
|
|
316
|
+
* Grouped, and without bodies. The cheap overview and the search's miss
|
|
317
|
+
* path. Paged by package so a large catalog never arrives in one answer.
|
|
318
|
+
*/
|
|
319
|
+
catalog(request?: {
|
|
320
|
+
page?: number;
|
|
321
|
+
pageSize?: number;
|
|
322
|
+
tier?: string;
|
|
323
|
+
kind?: KindFilter;
|
|
324
|
+
}): CatalogResponse;
|
|
325
|
+
/** Ranked names. Returns; never loads a body. */
|
|
326
|
+
find(intent: string, limit?: number, filters?: SkillFilters): Promise<FindResult>;
|
|
327
|
+
/** Every property of one skill and the files it carries, without bodies. */
|
|
328
|
+
describe(name: string): DescribeResponse | null;
|
|
329
|
+
/**
|
|
330
|
+
* One file inside a skill's directory. Paths that leave the directory,
|
|
331
|
+
* directly or through a link, are refused; nothing is ever executed.
|
|
332
|
+
*/
|
|
333
|
+
read(name: string, path?: string): ReadResult | {
|
|
334
|
+
ok: false;
|
|
335
|
+
error: "unknown_skill";
|
|
336
|
+
detail: string;
|
|
337
|
+
};
|
|
338
|
+
/** Every file of one skill as links; the bytes stay out of the answer. */
|
|
339
|
+
bundle(name: string): SkillBundle | null;
|
|
340
|
+
/** One body, at the moment it is needed, and the other files it carries. */
|
|
341
|
+
call(name: string): CallResponse | null;
|
|
342
|
+
/** The catalog entry for a name, among those this caller may see. */
|
|
343
|
+
entry: (name: string) => SkillEntry | null;
|
|
344
|
+
/** Drops the memoised catalog, so the next call re-reads the tree. */
|
|
345
|
+
refresh(): void;
|
|
346
|
+
entries: () => Omit<SkillEntry, "path">[];
|
|
347
|
+
/** The catalog with paths, for the Skills extension. The same array until refresh. */
|
|
348
|
+
skills: () => readonly SkillEntry[];
|
|
349
|
+
};
|
|
350
|
+
type SkillTools = ReturnType<typeof createSkillTools>;
|
|
351
|
+
|
|
352
|
+
export { isUtf8Text as A, type BundleFile as B, CATALOG_PAGE_MAX as C, DEFAULT_FIND_LIMIT as D, type Embedder as E, type FileKind as F, lexicalScore as G, listSkillFiles as H, type IntentCache as I, mimeOf as J, type KindFilter as K, normaliseIntent as L, type Match as M, readSkillFile as N, READ_BUDGET_BYTES as R, type SkillServerOptions as S, type SkillTools as a, CATALOG_PAGE_SIZE as b, type CallResponse as c, type CatalogItem as d, type CatalogResponse as e, type Classified as f, DESCRIBE_FILE_LIMIT as g, type FindOptions as h, type FindResult as i, type IntentCacheStats as j, type Ranking as k, type ReadResult as l, type SkillBundle as m, type SkillFile as n, type SkillFileContent as o, type SkillFileListing as p, type SkillFilters as q, bundleResponseSchema as r, bundleSkill as s, catalogResponseSchema as t, classify as u, cosine as v, createSkillTools as w, describeResponseSchema as x, find as y, findResultSchema as z };
|
package/dist/stdio.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as CatalogOptions } from './catalog-
|
|
2
|
+
import { C as CatalogOptions } from './catalog-CS0j6-0U.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The stdio entry a host launches.
|
|
@@ -11,7 +11,11 @@ import { C as CatalogOptions } from './catalog-5v7jrGwP.js';
|
|
|
11
11
|
|
|
12
12
|
/** `node_modules` roots to walk, from argv or from the working directory. */
|
|
13
13
|
declare function resolveRoots(argv: readonly string[], cwd: string): string[];
|
|
14
|
-
|
|
14
|
+
interface ServeOptions {
|
|
15
|
+
/** One prompt per skill, for hosts that offer prompts as commands. */
|
|
16
|
+
readonly prompts?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare function serve(catalog: CatalogOptions, serving?: ServeOptions): void;
|
|
15
19
|
declare function main(argv?: readonly string[]): void;
|
|
16
20
|
|
|
17
|
-
export { main, resolveRoots, serve };
|
|
21
|
+
export { type ServeOptions, main, resolveRoots, serve };
|
package/dist/stdio.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modootoday/pmcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"author": "modootoday",
|
|
6
6
|
"description": "An MCP server that finds the skills your installed packages already ship. Reads SKILL.md out of node_modules by shape rather than by path, so it sees the skills, .agent, .claude, .gemini and .codex conventions alike, and keeps session startup flat as the number of installed skills grows.",
|