@modootoday/pmcp 0.17.4 → 0.18.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.
Files changed (246) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/CHANGELOG.md +60 -0
  5. package/README.md +29 -24
  6. package/dist/apply-4IGTXOCQ.js +242 -0
  7. package/dist/{attachment-tU5FZrgZ.d.ts → attachment-D84OGI6n.d.ts} +1 -1
  8. package/dist/available-DBSIVVJ6.js +73 -0
  9. package/dist/broadcast-3RY3OZGY.js +18 -0
  10. package/dist/chunk-25GHX674.js +1246 -0
  11. package/dist/chunk-2P4Z2NUX.js +28 -0
  12. package/dist/chunk-34DECPVC.js +22 -0
  13. package/dist/chunk-3NYG4SGU.js +45 -0
  14. package/dist/chunk-3PW4FI7U.js +32 -0
  15. package/dist/chunk-3Y3HDMHA.js +108 -0
  16. package/dist/chunk-47O3X4VS.js +113 -0
  17. package/dist/chunk-4NDEP7HU.js +26 -0
  18. package/dist/chunk-4VCC2NXE.js +104 -0
  19. package/dist/chunk-5OMOPUE6.js +39 -0
  20. package/dist/chunk-5QQWS4US.js +53 -0
  21. package/dist/chunk-5ZABTVSW.js +48 -0
  22. package/dist/chunk-65ZHM5RH.js +4985 -0
  23. package/dist/chunk-665TA55Z.js +419 -0
  24. package/dist/chunk-6STKGOCW.js +27 -0
  25. package/dist/chunk-6WXMJOMI.js +9 -0
  26. package/dist/chunk-73AKO4UL.js +24 -0
  27. package/dist/chunk-7BLPN3W6.js +31 -0
  28. package/dist/chunk-7DLZC73N.js +29 -0
  29. package/dist/chunk-7GBYECSK.js +72 -0
  30. package/dist/chunk-7TD53M7L.js +13 -0
  31. package/dist/chunk-A4PKLESO.js +112 -0
  32. package/dist/chunk-ABTJQ4QV.js +74 -0
  33. package/dist/chunk-BBTBJCFA.js +380 -0
  34. package/dist/chunk-BU65MNVU.js +13 -0
  35. package/dist/chunk-BVCTKPT3.js +83 -0
  36. package/dist/chunk-C4NHQGHL.js +142 -0
  37. package/dist/chunk-CJTKR6K6.js +1213 -0
  38. package/dist/chunk-DCU2EXQV.js +78 -0
  39. package/dist/chunk-DZ2MRTYT.js +135 -0
  40. package/dist/chunk-E2YOZ2FF.js +207 -0
  41. package/dist/chunk-E3DQB5LS.js +48 -0
  42. package/dist/chunk-E7OOHLQR.js +7 -0
  43. package/dist/chunk-EATCUWGG.js +66 -0
  44. package/dist/chunk-EIDIVIAD.js +33 -0
  45. package/dist/chunk-EJBZGIDK.js +1934 -0
  46. package/dist/chunk-ELAGZ635.js +252 -0
  47. package/dist/chunk-GZHHEHKY.js +44 -0
  48. package/dist/chunk-HDMBVLCZ.js +53 -0
  49. package/dist/chunk-HQOB7OQS.js +81 -0
  50. package/dist/chunk-IGYRMM62.js +28 -0
  51. package/dist/chunk-IJBSOWHK.js +86 -0
  52. package/dist/chunk-INT7QLEU.js +114 -0
  53. package/dist/chunk-J6QLLQVL.js +1025 -0
  54. package/dist/chunk-J7UYNJCR.js +9 -0
  55. package/dist/chunk-JEL35P7S.js +53 -0
  56. package/dist/chunk-JGJ4INEN.js +32 -0
  57. package/dist/chunk-JS5RTH4I.js +84 -0
  58. package/dist/chunk-JUXNIXN4.js +42 -0
  59. package/dist/chunk-JWRZDYB5.js +59 -0
  60. package/dist/chunk-KMXRRSKT.js +660 -0
  61. package/dist/chunk-LAZQBMAU.js +67 -0
  62. package/dist/chunk-LLBPVZXM.js +67 -0
  63. package/dist/chunk-LLT5FQBE.js +57 -0
  64. package/dist/chunk-LMT3PPXJ.js +17 -0
  65. package/dist/chunk-MM2Y43LC.js +87 -0
  66. package/dist/chunk-MPSQXSC6.js +346 -0
  67. package/dist/chunk-MVFH26QT.js +97 -0
  68. package/dist/chunk-MWFOUBFC.js +39 -0
  69. package/dist/chunk-N5AQ3PP7.js +211 -0
  70. package/dist/chunk-NQPURJT5.js +44 -0
  71. package/dist/chunk-NRBQK6UX.js +105 -0
  72. package/dist/chunk-NZS5CD72.js +333 -0
  73. package/dist/chunk-OEH47H6A.js +48 -0
  74. package/dist/chunk-OG7QR2DP.js +75 -0
  75. package/dist/chunk-OPYFEHKG.js +52 -0
  76. package/dist/chunk-P4N7DBD5.js +83 -0
  77. package/dist/chunk-PAX3QXX2.js +140 -0
  78. package/dist/chunk-PLX3BOOS.js +396 -0
  79. package/dist/chunk-PMJG2CXF.js +122 -0
  80. package/dist/chunk-PWSJJXLQ.js +643 -0
  81. package/dist/chunk-Q5H3L6Y4.js +23 -0
  82. package/dist/chunk-Q65R3XKX.js +155 -0
  83. package/dist/chunk-QEW4J3IZ.js +74 -0
  84. package/dist/chunk-QPL7E2HW.js +464 -0
  85. package/dist/chunk-R2GPCZUX.js +22 -0
  86. package/dist/chunk-R4L6LJJ2.js +778 -0
  87. package/dist/chunk-R5MT42JS.js +284 -0
  88. package/dist/chunk-RK4PYD7L.js +73 -0
  89. package/dist/chunk-RMATE45Z.js +197 -0
  90. package/dist/chunk-S3PIAMXV.js +230 -0
  91. package/dist/chunk-SG5TPMKH.js +93 -0
  92. package/dist/chunk-T3LKX23M.js +168 -0
  93. package/dist/chunk-T6GOWHK6.js +30 -0
  94. package/dist/chunk-TIA4SPU2.js +10 -0
  95. package/dist/chunk-TNCZ6444.js +57 -0
  96. package/dist/chunk-TVL5RTE6.js +269 -0
  97. package/dist/chunk-UOCLRM7P.js +151 -0
  98. package/dist/chunk-UPQTAHUK.js +189 -0
  99. package/dist/chunk-V4NPDK6X.js +14 -0
  100. package/dist/chunk-VJFEN6DJ.js +38 -0
  101. package/dist/chunk-WIW772I3.js +25 -0
  102. package/dist/chunk-XELAZAIM.js +136 -0
  103. package/dist/chunk-XNML2KIC.js +23 -0
  104. package/dist/chunk-XP2U3LO3.js +30 -0
  105. package/dist/chunk-YGOWIJPE.js +51 -0
  106. package/dist/chunk-YIXDHQYE.js +11 -0
  107. package/dist/chunk-YMHUM7AV.js +22 -0
  108. package/dist/chunk-YSAWTGNA.js +117 -0
  109. package/dist/chunk-Z4HRRXRF.js +478 -0
  110. package/dist/chunk-ZH6R642Z.js +102 -0
  111. package/dist/claude-U2JC2DNQ.js +77 -0
  112. package/dist/cli-VYCQJZ5X.js +41 -0
  113. package/dist/cli-ZTCBSDW4.js +46 -0
  114. package/dist/cli.js +144 -16197
  115. package/dist/completion-E7RRG3ZT.js +142 -0
  116. package/dist/config-DnpLL2kT.d.ts +46 -0
  117. package/dist/{service-qpCsOXkQ.d.ts → core-C1LPjxK6.d.ts} +2 -6
  118. package/dist/diagnostics-XXH4FLUG.js +93 -0
  119. package/dist/doctor-ZIOESU3N.js +538 -0
  120. package/dist/entry-ZNFCTDVE.js +305 -0
  121. package/dist/exec-mcp-X6372BLE.js +365 -0
  122. package/dist/harness-F2XFDYXF.js +177 -0
  123. package/dist/harness-egress-bridge.js +4 -4
  124. package/dist/harness-launch-gate.js +47 -940
  125. package/dist/harness-pane-runner.js +13 -80
  126. package/dist/harness-worker.js +21 -2703
  127. package/dist/hook-body.js +5221 -0
  128. package/dist/hook-spec-C5fWTSCH.d.ts +100 -0
  129. package/dist/hook.js +26 -0
  130. package/dist/hooks-FYE2L5RW.js +21 -0
  131. package/dist/host-GRY3VAHH.js +22 -0
  132. package/dist/host-X6BR6X4O.js +200 -0
  133. package/dist/host-run-GCA6H6SR.js +307 -0
  134. package/dist/http.d.ts +5 -42
  135. package/dist/http.js +21 -2234
  136. package/dist/import-mcp-2TTBPVLY.js +400 -0
  137. package/dist/index.d.ts +146 -168
  138. package/dist/index.js +133 -4948
  139. package/dist/init-627KFXTG.js +14 -0
  140. package/dist/install-GG7HHZK2.js +796 -0
  141. package/dist/invoke-LW22Z6ET.js +23 -0
  142. package/dist/list-MCP2FXUF.js +68 -0
  143. package/dist/list-NGMSQ5SH.js +65 -0
  144. package/dist/load-BEUBABtB.d.ts +21 -0
  145. package/dist/logout-6CSHUWWE.js +44 -0
  146. package/dist/logs-SPB6AANY.js +107 -0
  147. package/dist/mailbox/index.d.ts +10 -5
  148. package/dist/mailbox/index.js +53 -1572
  149. package/dist/mailbox-7BV54Q4R.js +285 -0
  150. package/dist/mailbox-GDJ7BWQN.js +189 -0
  151. package/dist/mainline-JQTTYJMI.js +639 -0
  152. package/dist/marketplace-G4VQET5W.js +191 -0
  153. package/dist/mcp-2DKVU3SW.js +15 -0
  154. package/dist/mcp-V23HC3LB.js +193 -0
  155. package/dist/models-ISU4DCMA.js +32 -0
  156. package/dist/opencode-CN7JLQYO.js +60 -0
  157. package/dist/pause-FFAYRBWI.js +18 -0
  158. package/dist/preview-DT7DWG5F.js +91 -0
  159. package/dist/project/hook-adapter.d.ts +5 -2
  160. package/dist/project/hook-adapter.js +41 -27
  161. package/dist/project-FY62G55N.js +70 -0
  162. package/dist/pty-XTJ4MIWK.js +94 -0
  163. package/dist/recovery-U6QB3PMT.js +100 -0
  164. package/dist/reindex-Y27QJFDB.js +22 -0
  165. package/dist/resume-UU4HZIUP.js +18 -0
  166. package/dist/run-HALGEJNJ.js +19 -0
  167. package/dist/run-OGA3P7FC.js +126 -0
  168. package/dist/serve-NBKT5BKY.js +104 -0
  169. package/dist/session-XM2CR425.js +159 -0
  170. package/dist/setup-DTKZLZUT.js +18 -0
  171. package/dist/start-login-UIQYQBMC.js +416 -0
  172. package/dist/status-A2OUTNGK.js +9 -0
  173. package/dist/status-H2VAHIDV.js +10 -0
  174. package/dist/status-NOOHW5WA.js +43 -0
  175. package/dist/status-VHODZPXB.js +55 -0
  176. package/dist/status-XQANBVXW.js +286 -0
  177. package/dist/stdio.d.ts +3 -13
  178. package/dist/stdio.js +16 -3186
  179. package/dist/sweep-64JDCGK6.js +18 -0
  180. package/dist/test-MKAXFJOL.js +561 -0
  181. package/dist/tools-gpHNq9Dh.d.ts +328 -0
  182. package/dist/tui-MWKAXE4K.js +153 -0
  183. package/dist/unbroadcast-KPUEFLZD.js +18 -0
  184. package/dist/validate-5GZ5YWNA.js +46 -0
  185. package/dist/worker-RQ575EJL.js +80 -0
  186. package/dist/worktree-create-PZSRB7PH.js +89 -0
  187. package/dist/worktree-list-JYB6VXLW.js +51 -0
  188. package/dist/worktree-sync-UF5CXPWV.js +30 -0
  189. package/docs/hooks/capabilities/antigravity.json +199 -0
  190. package/docs/hooks/capabilities/claude.json +179 -0
  191. package/docs/hooks/capabilities/codex.json +179 -0
  192. package/docs/hooks/capabilities/gemini.json +196 -0
  193. package/docs/hooks/capabilities/grok.json +192 -0
  194. package/docs/hooks/capabilities/opencode.json +184 -0
  195. package/docs/project-configuration.md +821 -4
  196. package/docs/terminal-harness.md +71 -28
  197. package/docs/terminal-workspace.md +91 -170
  198. package/gemini-extension.json +1 -1
  199. package/package.json +13 -1
  200. package/plugin.json +1 -1
  201. package/plugins/pmcp/.claude-plugin/plugin.json +4 -2
  202. package/plugins/pmcp/gemini-extension.json +1 -1
  203. package/plugins/pmcp/mod/commands.ts +72 -0
  204. package/plugins/pmcp/mod/contract.d.ts +39 -0
  205. package/plugins/pmcp/mod/draw.tsx +216 -0
  206. package/plugins/pmcp/mod/guard.ts +42 -0
  207. package/plugins/pmcp/mod/hooks.json +4 -0
  208. package/plugins/pmcp/mod/host.ts +46 -0
  209. package/plugins/pmcp/mod/model.ts +144 -0
  210. package/plugins/pmcp/mod/reader/index.ts +18 -0
  211. package/plugins/pmcp/mod/reader/read.ts +76 -0
  212. package/plugins/pmcp/mod/reader/settings.ts +54 -0
  213. package/plugins/pmcp/mod/reader/types.ts +38 -0
  214. package/plugins/pmcp/mod/register.tsx +73 -0
  215. package/plugins/pmcp/mod/sessions/format.ts +91 -0
  216. package/plugins/pmcp/mod/sessions/types.ts +162 -0
  217. package/plugins/pmcp/mod/snapshot.ts +75 -0
  218. package/plugins/pmcp/mod/spinner.tsx +30 -0
  219. package/plugins/pmcp/mod/state.ts +28 -0
  220. package/plugins/pmcp/plugin.json +1 -1
  221. package/plugins/pmcp/skills/agent-assets-migrate/SKILL.md +96 -0
  222. package/plugins/pmcp/skills/headless-agents-ci-scaffold/SKILL.md +100 -0
  223. package/plugins/pmcp/skills/marketplace-plugin-scaffold/SKILL.md +87 -0
  224. package/plugins/pmcp/skills/package-skill-catalog/SKILL.md +51 -11
  225. package/plugins/pmcp/skills/pmcp-project-init/SKILL.md +145 -0
  226. package/plugins/pmcp/skills/pmcp-sessions-and-git/SKILL.md +104 -0
  227. package/plugins/pmcp/skills/skill-package-scaffold/SKILL.md +88 -0
  228. package/schema/catalog-v1.json +158 -0
  229. package/schema/library.json +164 -0
  230. package/schema/marketplace-manifest.json +130 -0
  231. package/schema/plugin-manifest.json +55 -0
  232. package/schema/skill-frontmatter.json +144 -0
  233. package/schema/skill-metadata-core.json +110 -0
  234. package/skills/agent-assets-migrate/SKILL.md +96 -0
  235. package/skills/headless-agents-ci-scaffold/SKILL.md +100 -0
  236. package/skills/marketplace-plugin-scaffold/SKILL.md +87 -0
  237. package/skills/package-skill-catalog/SKILL.md +51 -11
  238. package/skills/pmcp-project-init/SKILL.md +145 -0
  239. package/skills/pmcp-sessions-and-git/SKILL.md +104 -0
  240. package/skills/skill-package-scaffold/SKILL.md +88 -0
  241. package/dist/config-BkSpjUG6.d.ts +0 -50
  242. package/dist/embed-DRROSD3F.d.ts +0 -53
  243. package/dist/hook-spec-CSJJySsH.d.ts +0 -11
  244. package/dist/server-VWSY3Shw.d.ts +0 -543
  245. package/dist/tui-worker.js +0 -6549
  246. /package/dist/{tui-worker.d.ts → hook.d.ts} +0 -0
@@ -1,543 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * SKILL.md frontmatter, read as YAML the way a host reads it, and checked against
5
- * the Agent Skills specification (https://agentskills.io/specification).
6
- */
7
- type MetadataLeaf = string | readonly string[];
8
- /** A metadata value: a leaf, or a map of leaves one level below the metadata key. */
9
- type MetadataValue = MetadataLeaf | {
10
- readonly [key: string]: MetadataLeaf;
11
- };
12
- /**
13
- * Parsed frontmatter. A value with an unquoted ": " is a common authoring slip
14
- * the client guide says to recover from by quoting it, so that is retried once.
15
- */
16
- declare function frontmatterObject(source: string): Record<string, unknown> | null;
17
- declare const NAME_MAX = 64;
18
- declare const DESCRIPTION_MAX = 1024;
19
- declare const COMPATIBILITY_MAX = 500;
20
- /**
21
- * What the specification requires of one SKILL.md, as messages; empty when valid.
22
- * directory is the name of the folder holding it.
23
- */
24
- declare function specProblems(front: Record<string, unknown> | null, directory: string): string[];
25
-
26
- /**
27
- * The skills the installed packages brought with them.
28
- *
29
- * Derived from `node_modules` at read time rather than from a list somebody
30
- * maintains: installing a package is how its skill arrives and uninstalling it
31
- * is how the skill leaves, so the catalog is always true of the project.
32
- */
33
-
34
- interface SkillEntry {
35
- /** `<package>/<slug>`. Unique, and stable while the package is installed. */
36
- readonly name: string;
37
- readonly package: string;
38
- readonly slug: string;
39
- /** Frontmatter description. The only text `find` ranks against. */
40
- readonly description: string;
41
- /** Absolute path to the SKILL.md. `call` reads the body from here. */
42
- readonly path: string;
43
- /** open, free or paid. Set for marketplace skills, absent for packages. */
44
- readonly tier?: string;
45
- /** The frontmatter `metadata:` block; maps such as `requires` are kept one level down. */
46
- readonly metadata?: Readonly<Record<string, MetadataValue>>;
47
- /** Extra search terms. Ranked with the description, never used as triggers. */
48
- readonly keywords?: readonly string[];
49
- /** What the entry is. Absent means a skill. */
50
- readonly kind?: AssetKind;
51
- /**
52
- * What describe and read may open: a directory, or one file for an asset
53
- * that is a single file. Absent means the directory holding `path`.
54
- */
55
- readonly root?: string;
56
- }
57
- /** Everything the catalog serves. Commands are skills; workflows have no kind of their own. */
58
- declare const ASSET_KINDS: readonly ["skill", "agent", "hook", "mcp"];
59
- type AssetKind = (typeof ASSET_KINDS)[number];
60
- declare const kindOf: (entry: Pick<SkillEntry, "kind">) => AssetKind;
61
- interface CatalogOptions {
62
- /** Directories to walk. Each is a `node_modules` root, not a package root. */
63
- readonly roots: readonly string[];
64
- /** Package name prefixes to consider. Empty means every package. */
65
- readonly scopes?: readonly string[];
66
- /** Installed local marketplace roots, without remote source fetching. */
67
- readonly marketplaces?: readonly string[];
68
- /** Package directories read directly, for a package no node_modules links. */
69
- readonly packages?: readonly string[];
70
- /** Workspace roots: the root and every member its workspaces globs name. */
71
- readonly workspaces?: readonly string[];
72
- /** Told about every marketplace skill left out, and why. */
73
- readonly onReject?: (rejection: {
74
- path: string;
75
- reason: string;
76
- }) => void;
77
- /**
78
- * Told about a skill that is served but breaks the Agent Skills specification,
79
- * or that lost a name collision. Loading stays lenient, as the client guide asks.
80
- */
81
- readonly onWarning?: (warning: {
82
- path: string;
83
- reason: string;
84
- }) => void;
85
- }
86
- /**
87
- * Directories a walk does not enter. Kept as short as the evidence allows: a
88
- * name here is a package whose skill will never be found, and the cost of one
89
- * extra readdir is far below the cost of missing a skill. Measured 20260906 --
90
- * `lib` was on this list and hid playwright's `lib/skill/SKILL.md`, which is
91
- * the most widely installed skill in the real world.
92
- */
93
- declare const SKIPPED_DIRS: ReadonlySet<string>;
94
- /**
95
- * How deep below a package root a SKILL.md is looked for. Three reaches every
96
- * convention in use (skills, .agent/skills, .claude/skills, .gemini/skills,
97
- * .codex/skills); four was measured to find nothing more.
98
- */
99
- declare const MAX_SKILL_DEPTH = 3;
100
- /**
101
- * Top-level scalar fields of a SKILL.md frontmatter, parsed as YAML, so a folded
102
- * `description: >-` arrives as its text rather than as the indicator.
103
- */
104
- declare function readFrontmatter(source: string): Record<string, string>;
105
- /** The body after the frontmatter, or the whole file when there is none. */
106
- declare function readBody(source: string): string;
107
- /**
108
- * Every skill reachable from the given roots, sorted by name.
109
- *
110
- * A package with no skills directory contributes nothing and costs one
111
- * `existsSync` per convention. A skill with no description is skipped rather
112
- * than listed:
113
- * `find` ranks descriptions, so one without a description can only ever be
114
- * found by already knowing its name, and listing it would spend a session's
115
- * tokens on an entry that cannot answer.
116
- */
117
- declare function readCatalog(options: CatalogOptions): SkillEntry[];
118
- /** A catalog entry without its body, which is what `catalog` returns. */
119
- declare function withoutBody({ path, ...rest }: SkillEntry): Omit<SkillEntry, "path">;
120
- /** Path relative to a root, for a message a reader can act on. */
121
- declare function displayPath(root: string, entry: SkillEntry): string;
122
-
123
- /**
124
- * The intent key and the cache contract.
125
- *
126
- * Separate from the sqlite implementation so that ranking, which needs the key
127
- * and the interface, does not pull a bun-only module into a consumer running
128
- * under node. Only `cache.ts` requires bun.
129
- */
130
- interface IntentCacheStats {
131
- readonly hits: number;
132
- readonly misses: number;
133
- /** Rows found for the key but written by a different model. */
134
- readonly mismatched: number;
135
- readonly rows: number;
136
- /** Which sqlite builtin answered, or absent when there is no cache. */
137
- readonly provider?: string;
138
- }
139
- interface IntentCache {
140
- /** The cached vector for an intent, or null when nothing usable is stored. */
141
- get(intent: string): Float32Array | null;
142
- put(intent: string, vector: Float32Array): void;
143
- stats(): IntentCacheStats;
144
- close(): void;
145
- }
146
- /**
147
- * Canonically equivalent Unicode must share the same query and cache key.
148
- */
149
- declare function normaliseIntent(intent: string): string;
150
-
151
- /**
152
- * Ranking an intent against skill descriptions.
153
- *
154
- * Semantic when an embedder is supplied, lexical otherwise, and the answer says
155
- * which. A caller that cannot tell the two apart cannot tell a degraded server
156
- * from a working one.
157
- */
158
-
159
- type Ranking = "semantic" | "lexical";
160
- interface Match {
161
- readonly name: string;
162
- readonly package: string;
163
- readonly description: string;
164
- readonly score: number;
165
- }
166
- interface FindResult {
167
- readonly ranking: Ranking;
168
- readonly matches: readonly Match[];
169
- }
170
- /**
171
- * The encoder, supplied by the caller. There is no default and no bundled
172
- * model: which model runs decides what the scores mean, so it is the consuming
173
- * repository's declaration rather than this package's.
174
- */
175
- interface Embedder {
176
- readonly modelId: string;
177
- readonly indexKey?: string;
178
- readonly dims: number;
179
- /** Encodes an intent, the query side. */
180
- embed(text: string): Promise<Float32Array>;
181
- /** Encodes a description, for models that write the two sides differently. */
182
- embedPassage?(text: string): Promise<Float32Array>;
183
- }
184
- interface FindOptions {
185
- readonly entries: readonly SkillEntry[];
186
- readonly intent: string;
187
- readonly limit?: number;
188
- readonly embedder?: Embedder;
189
- readonly cache?: IntentCache;
190
- /** Precomputed description vectors, keyed by skill name. */
191
- readonly vectors?: ReadonlyMap<string, Float32Array>;
192
- }
193
- declare const DEFAULT_FIND_LIMIT = 5;
194
- /**
195
- * Token overlap and bigram Dice, averaged. Deterministic and dependency-free:
196
- * this is the answer when there is no model, so it must never be the thing
197
- * that fails.
198
- */
199
- declare function lexicalScore(intent: string, description: string): number;
200
- /** Cosine over two equal-width vectors. Zero when either has no magnitude. */
201
- declare function cosine(a: Float32Array, b: Float32Array): number;
202
- /**
203
- * Ranked matches, and which ranking produced them.
204
- *
205
- * Returns rather than loads: a search verb that also acts cannot be used to
206
- * look, and the whole reason this server exists is that looking should be
207
- * cheap.
208
- */
209
- declare function find(options: FindOptions): Promise<FindResult>;
210
-
211
- /** The files one skill carries, with sizes and digests. */
212
- interface SkillFile {
213
- /** Relative to the skill directory, with forward slashes. */
214
- readonly path: string;
215
- readonly bytes: number;
216
- readonly sha256: string;
217
- }
218
- interface SkillFileListing {
219
- readonly files: readonly SkillFile[];
220
- readonly truncated: boolean;
221
- }
222
- /**
223
- * Every file under a skill root, or the root itself when the asset is one file.
224
- * node_modules and .git are never part of a skill.
225
- */
226
- declare function listSkillFiles(root: string, limit?: number): SkillFileListing;
227
-
228
- /**
229
- * Every file of one skill as fetchable links, so a host can write the skill to a
230
- * local skills directory without routing its bytes through the model.
231
- */
232
-
233
- interface BundleFile extends SkillFile {
234
- readonly uri: string;
235
- readonly mimeType: string;
236
- }
237
- interface SkillBundle {
238
- readonly name: string;
239
- readonly files: readonly BundleFile[];
240
- readonly truncated: boolean;
241
- }
242
- declare function bundleSkill(entry: SkillEntry): SkillBundle;
243
-
244
- /**
245
- * One MIME table for every surface that hands out skill files, so a file is text,
246
- * image, audio or blob the same way through skill_read and through resources/read.
247
- */
248
- /** The declared type of a path by extension, or null when the extension is unknown. */
249
- declare function mimeOf(path: string): string | null;
250
- /** True when the bytes decode as UTF-8 and encode back to themselves, without NUL. */
251
- declare function isUtf8Text(bytes: Uint8Array): boolean;
252
- type FileKind = "text" | "image" | "audio" | "blob";
253
- interface Classified {
254
- readonly kind: FileKind;
255
- readonly mimeType: string;
256
- }
257
- /**
258
- * How a file goes out. A type that names text is still served as a blob when the
259
- * bytes are not valid UTF-8, so a digest over them stays exact.
260
- */
261
- declare function classify(path: string, bytes: Uint8Array): Classified;
262
-
263
- /**
264
- * Turns a path a caller asked for into a file inside one skill. A path that
265
- * leaves the skill, directly or through a link, is refused.
266
- */
267
-
268
- type FileRefusal = {
269
- readonly ok: false;
270
- readonly error: "path_outside_skill" | "no_such_file";
271
- readonly detail: string;
272
- };
273
-
274
- /**
275
- * One skill file's bytes, typed. Text stays text; images, audio and other binary
276
- * go out as base64 so nothing is corrupted on the way. Nothing is ever executed.
277
- */
278
-
279
- /** Largest file returned whole. A skill needing more should split it. */
280
- declare const READ_BUDGET_BYTES: number;
281
- interface SkillFileContent {
282
- readonly ok: true;
283
- readonly name: string;
284
- readonly path: string;
285
- readonly bytes: number;
286
- readonly sha256: string;
287
- readonly mimeType: string;
288
- readonly kind: FileKind;
289
- /** Set when kind is text. */
290
- readonly text?: string;
291
- /** Base64, set when kind is not text. */
292
- readonly blob?: string;
293
- }
294
- type ReadResult = SkillFileContent | FileRefusal | {
295
- readonly ok: false;
296
- readonly error: "over_budget";
297
- readonly detail: string;
298
- };
299
- declare function readSkillFile(entry: SkillEntry, wanted?: string, budget?: number): ReadResult;
300
-
301
- /**
302
- * Agent runtimes a skill can declare itself verified on, and the mapping from
303
- * an MCP client's reported name to one of them.
304
- */
305
-
306
- declare const RUNTIMES: readonly ["claude-code", "codex-cli", "gemini-cli", "grok-cli", "antigravity"];
307
- type Runtime = (typeof RUNTIMES)[number];
308
- /** The runtimes a metadata block lists as verified; unknown values are dropped. */
309
- declare function verifiedRuntimesOf(metadata: Readonly<Record<string, MetadataValue>> | undefined): Runtime[];
310
- /** The runtime an MCP client name stands for; null when it is not recognised. */
311
- declare function runtimeOfClient(name: string | undefined): Runtime | null;
312
- interface ClientSource {
313
- readonly server?: {
314
- getClientVersion?: () => {
315
- readonly name?: string;
316
- } | undefined;
317
- };
318
- }
319
- interface RequestContext {
320
- readonly mcpReq?: {
321
- readonly envelope?: object;
322
- };
323
- }
324
- /**
325
- * The runtime of the client making this request. The per-request envelope is
326
- * read first, then the initialize-scoped identity; a stateless caller has
327
- * neither and gets null.
328
- */
329
- declare function detectRuntime(server: ClientSource, ctx?: RequestContext): Runtime | null;
330
-
331
- /**
332
- * The shapes the tools answer with, defined once: the TypeScript types are
333
- * inferred from these schemas and the same schemas are each tool's outputSchema,
334
- * so structuredContent cannot drift from what a client validates it against.
335
- */
336
-
337
- declare const catalogItemSchema: z.ZodObject<{
338
- name: z.ZodString;
339
- description: z.ZodString;
340
- tier: z.ZodOptional<z.ZodString>;
341
- kind: z.ZodOptional<z.ZodEnum<{
342
- agent: "agent";
343
- skill: "skill";
344
- hook: "hook";
345
- mcp: "mcp";
346
- }>>;
347
- verifiedRuntimes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
348
- "claude-code": "claude-code";
349
- "codex-cli": "codex-cli";
350
- "gemini-cli": "gemini-cli";
351
- "grok-cli": "grok-cli";
352
- antigravity: "antigravity";
353
- }>>>;
354
- verified: z.ZodOptional<z.ZodBoolean>;
355
- }, z.core.$loose>;
356
- declare const catalogResponseSchema: z.ZodObject<{
357
- count: z.ZodNumber;
358
- page: z.ZodNumber;
359
- totalPages: z.ZodNumber;
360
- hasNext: z.ZodBoolean;
361
- packages: z.ZodArray<z.ZodObject<{
362
- package: z.ZodString;
363
- skills: z.ZodArray<z.ZodObject<{
364
- name: z.ZodString;
365
- description: z.ZodString;
366
- tier: z.ZodOptional<z.ZodString>;
367
- kind: z.ZodOptional<z.ZodEnum<{
368
- agent: "agent";
369
- skill: "skill";
370
- hook: "hook";
371
- mcp: "mcp";
372
- }>>;
373
- verifiedRuntimes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
374
- "claude-code": "claude-code";
375
- "codex-cli": "codex-cli";
376
- "gemini-cli": "gemini-cli";
377
- "grok-cli": "grok-cli";
378
- antigravity: "antigravity";
379
- }>>>;
380
- verified: z.ZodOptional<z.ZodBoolean>;
381
- }, z.core.$loose>>;
382
- }, z.core.$loose>>;
383
- }, z.core.$loose>;
384
- declare const findResultSchema: z.ZodObject<{
385
- ranking: z.ZodEnum<{
386
- semantic: "semantic";
387
- lexical: "lexical";
388
- }>;
389
- runtime: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
390
- "claude-code": "claude-code";
391
- "codex-cli": "codex-cli";
392
- "gemini-cli": "gemini-cli";
393
- "grok-cli": "grok-cli";
394
- antigravity: "antigravity";
395
- }>>>;
396
- matches: z.ZodArray<z.ZodObject<{
397
- name: z.ZodString;
398
- package: z.ZodString;
399
- description: z.ZodString;
400
- score: z.ZodNumber;
401
- verifiedRuntimes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
402
- "claude-code": "claude-code";
403
- "codex-cli": "codex-cli";
404
- "gemini-cli": "gemini-cli";
405
- "grok-cli": "grok-cli";
406
- antigravity: "antigravity";
407
- }>>>;
408
- verified: z.ZodOptional<z.ZodBoolean>;
409
- }, z.core.$loose>>;
410
- }, z.core.$loose>;
411
- declare const describeResponseSchema: z.ZodObject<{
412
- name: z.ZodString;
413
- kind: z.ZodEnum<{
414
- agent: "agent";
415
- skill: "skill";
416
- hook: "hook";
417
- mcp: "mcp";
418
- }>;
419
- package: z.ZodString;
420
- description: z.ZodString;
421
- tier: z.ZodOptional<z.ZodString>;
422
- metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString>>]>>;
423
- frontmatter: z.ZodString;
424
- files: z.ZodArray<z.ZodObject<{
425
- path: z.ZodString;
426
- bytes: z.ZodNumber;
427
- sha256: z.ZodString;
428
- }, z.core.$loose>>;
429
- filesTruncated: z.ZodBoolean;
430
- }, z.core.$loose>;
431
- declare const bundleResponseSchema: z.ZodObject<{
432
- name: z.ZodString;
433
- truncated: z.ZodBoolean;
434
- files: z.ZodArray<z.ZodObject<{
435
- path: z.ZodString;
436
- bytes: z.ZodNumber;
437
- sha256: z.ZodString;
438
- uri: z.ZodString;
439
- mimeType: z.ZodString;
440
- }, z.core.$loose>>;
441
- }, z.core.$loose>;
442
- type CatalogItem = z.infer<typeof catalogItemSchema>;
443
- type CatalogResponse = z.infer<typeof catalogResponseSchema>;
444
- type FindResponse = z.infer<typeof findResultSchema>;
445
- type DescribeResponse = z.infer<typeof describeResponseSchema>;
446
-
447
- /**
448
- * The catalog operations the tools speak, as plain functions.
449
- *
450
- * The point of the server is that a session's startup cost does not grow with
451
- * the number of skills installed: the host lists a fixed set of tools whatever
452
- * the catalog holds, and a body is read only when one is asked for.
453
- */
454
-
455
- /** How many files skill_describe lists before saying the rest were cut. */
456
- declare const DESCRIBE_FILE_LIMIT = 200;
457
- declare const CATALOG_PAGE_SIZE = 8;
458
- declare const CATALOG_PAGE_MAX = 20;
459
- /** A kind filter value: one kind, or every kind. */
460
- type KindFilter = AssetKind | "any";
461
- /**
462
- * Equality filters over catalog fields. Unset keys match everything except
463
- * kind, which defaults to skill so a search for a skill never returns a hook.
464
- */
465
- interface SkillFilters {
466
- readonly kind?: KindFilter;
467
- readonly tier?: string;
468
- readonly package?: string;
469
- readonly level?: string;
470
- readonly domain?: string;
471
- readonly medium?: string;
472
- /** The runtime verified skills are ranked and marked for. Never filters by itself. */
473
- readonly runtime?: Runtime;
474
- /** Keep only skills verified on `runtime`, or on any runtime when it is unset. */
475
- readonly verifiedOnly?: boolean;
476
- }
477
- interface SkillServerOptions extends CatalogOptions {
478
- readonly embedder?: Embedder;
479
- readonly cache?: IntentCache;
480
- readonly vectors?: ReadonlyMap<string, Float32Array>;
481
- /** Injected for tests. Reads the catalog off disk otherwise. */
482
- readonly loadCatalog?: (options: CatalogOptions) => SkillEntry[];
483
- /** Off by default so a call without a runtime input ranks exactly as before. */
484
- readonly rankByClientRuntime?: boolean;
485
- }
486
-
487
- interface CallResponse {
488
- readonly name: string;
489
- readonly body: string;
490
- /** Files the skill carries besides its body, for skill_read and resources/read. */
491
- readonly files: readonly BundleFile[];
492
- readonly filesTruncated: boolean;
493
- }
494
- /**
495
- * The catalog, the search and the read, as plain functions.
496
- *
497
- * Separate from the MCP wiring so they can be exercised without a transport,
498
- * and so a consumer that wants them from a hook or a script is not made to
499
- * speak a protocol to get them.
500
- */
501
- declare function createSkillTools(options: SkillServerOptions): {
502
- /**
503
- * Grouped, and without bodies. The cheap overview and the search's miss
504
- * path. Paged by package so a large catalog never arrives in one answer.
505
- */
506
- catalog(request?: {
507
- page?: number;
508
- pageSize?: number;
509
- tier?: string;
510
- kind?: KindFilter;
511
- runtime?: Runtime;
512
- verifiedOnly?: boolean;
513
- /** The caller's own runtime, for ordering only. */
514
- clientRuntime?: Runtime | null;
515
- }): CatalogResponse;
516
- /** Ranked names. Returns; never loads a body. */
517
- find(intent: string, limit?: number, filters?: SkillFilters, clientRuntime?: Runtime | null): Promise<FindResponse>;
518
- /** Every property of one skill and the files it carries, without bodies. */
519
- describe(name: string): DescribeResponse | null;
520
- /**
521
- * One file inside a skill's directory. Paths that leave the directory,
522
- * directly or through a link, are refused; nothing is ever executed.
523
- */
524
- read(name: string, path?: string): ReadResult | {
525
- ok: false;
526
- error: "unknown_skill";
527
- detail: string;
528
- };
529
- /** Every file of one skill as links; the bytes stay out of the answer. */
530
- bundle(name: string): SkillBundle | null;
531
- /** One body, at the moment it is needed, and the other files it carries. */
532
- call(name: string): CallResponse | null;
533
- /** The catalog entry for a name, among those this caller may see. */
534
- entry: (name: string) => SkillEntry | null;
535
- /** Drops the memoised catalog, so the next call re-reads the tree. */
536
- refresh(): void;
537
- entries: () => Omit<SkillEntry, "path">[];
538
- /** The catalog with paths, for the Skills extension. The same array until refresh. */
539
- skills: () => readonly SkillEntry[];
540
- };
541
- type SkillTools = ReturnType<typeof createSkillTools>;
542
-
543
- export { isUtf8Text as $, ASSET_KINDS as A, type BundleFile as B, type CatalogOptions as C, DEFAULT_FIND_LIMIT as D, type Embedder as E, type FileKind as F, type SkillFile as G, type SkillFileContent as H, type IntentCache as I, type SkillFileListing as J, type KindFilter as K, type SkillFilters as L, type MetadataValue as M, NAME_MAX as N, bundleResponseSchema as O, bundleSkill as P, catalogResponseSchema as Q, type Runtime as R, type SkillServerOptions as S, classify as T, cosine as U, createSkillTools as V, describeResponseSchema as W, detectRuntime as X, displayPath as Y, find as Z, findResultSchema as _, type SkillEntry as a, kindOf as a0, lexicalScore as a1, listSkillFiles as a2, mimeOf as a3, normaliseIntent as a4, frontmatterObject as a5, readBody as a6, readFrontmatter as a7, readSkillFile as a8, runtimeOfClient as a9, specProblems as aa, withoutBody as ab, type Ranking as b, type SkillTools as c, type AssetKind as d, CATALOG_PAGE_MAX as e, CATALOG_PAGE_SIZE as f, COMPATIBILITY_MAX as g, type CallResponse as h, type CatalogItem as i, type CatalogResponse as j, type Classified as k, DESCRIBE_FILE_LIMIT as l, DESCRIPTION_MAX as m, type FindOptions as n, type FindResult as o, type IntentCacheStats as p, MAX_SKILL_DEPTH as q, readCatalog as r, type Match as s, type MetadataLeaf as t, READ_BUDGET_BYTES as u, verifiedRuntimesOf as v, RUNTIMES as w, type ReadResult as x, SKIPPED_DIRS as y, type SkillBundle as z };