@savvy-web/mcp 0.3.0 → 0.4.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 (41) hide show
  1. package/README.md +1 -0
  2. package/bin/savvy-mcp.js +40 -146
  3. package/package.json +42 -80
  4. package/{resources → public}/content/manifest.json +175 -250
  5. package/public/content/standards/turbo/best-practices.md +76 -0
  6. package/public/content/standards/turbo/boundaries.md +72 -0
  7. package/public/content/standards/turbo/ci.md +69 -0
  8. package/public/content/standards/turbo/environment.md +64 -0
  9. package/public/content/standards/turbo/filtering.md +72 -0
  10. package/public/content/standards/turbo/watch.md +64 -0
  11. package/{resources → public}/content/tags.json +3 -1
  12. package/547.js +0 -416
  13. package/index.d.ts +0 -126
  14. package/index.js +0 -3
  15. package/tsdoc-metadata.json +0 -11
  16. /package/{resources → public}/content/_templates/guides.md +0 -0
  17. /package/{resources → public}/content/_templates/packages.md +0 -0
  18. /package/{resources → public}/content/_templates/standards.md +0 -0
  19. /package/{resources → public}/content/guides/api-docs-from-api-extractor.md +0 -0
  20. /package/{resources → public}/content/guides/building-a-github-action.md +0 -0
  21. /package/{resources → public}/content/guides/choosing-a-builder.md +0 -0
  22. /package/{resources → public}/content/guides/llm-friendly-json-schemas.md +0 -0
  23. /package/{resources → public}/content/packages/cli/command-tree.md +0 -0
  24. /package/{resources → public}/content/packages/cli/init-and-check.md +0 -0
  25. /package/{resources → public}/content/packages/mcp/resource-taxonomy.md +0 -0
  26. /package/{resources → public}/content/packages/rslib-builder/overview.md +0 -0
  27. /package/{resources → public}/content/packages/silk/export-map.md +0 -0
  28. /package/{resources → public}/content/packages/silk/install-and-setup.md +0 -0
  29. /package/{resources → public}/content/packages/silk-effects/index.md +0 -0
  30. /package/{resources → public}/content/packages/silk-effects/managed-section.md +0 -0
  31. /package/{resources → public}/content/packages/silk-effects/platform-layers.md +0 -0
  32. /package/{resources → public}/content/standards/api-model-pipeline.md +0 -0
  33. /package/{resources → public}/content/standards/catalog-usage.md +0 -0
  34. /package/{resources → public}/content/standards/changeset-discipline.md +0 -0
  35. /package/{resources → public}/content/standards/changeset-format.md +0 -0
  36. /package/{resources → public}/content/standards/commit-contract.md +0 -0
  37. /package/{resources → public}/content/standards/dependency-conventions.md +0 -0
  38. /package/{resources → public}/content/standards/linting-conventions.md +0 -0
  39. /package/{resources → public}/content/standards/publishability.md +0 -0
  40. /package/{resources → public}/content/standards/semver.md +0 -0
  41. /package/{resources → public}/content/standards/test-classification.md +0 -0
package/547.js DELETED
@@ -1,416 +0,0 @@
1
- import { ChangesetConfigReaderLive, SilkWorkspaceAnalyzer, SilkWorkspaceAnalyzerLive, TagStrategyLive, VersioningStrategyLive } from "@savvy-web/silk-effects";
2
- import { Effect, JSONSchema, Layer, ParseResult, Schema } from "effect";
3
- import { WorkspaceRoot, WorkspaceRootLive, WorkspacesLive } from "workspaces-effect";
4
- import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
5
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
- import { z } from "zod";
7
- import { existsSync, readFileSync } from "node:fs";
8
- import { dirname, isAbsolute, join, normalize, resolve, sep } from "node:path";
9
- import { fileURLToPath } from "node:url";
10
- const DepsLive = Layer.mergeAll(WorkspacesLive, ChangesetConfigReaderLive, TagStrategyLive, VersioningStrategyLive.pipe(Layer.provide(ChangesetConfigReaderLive)));
11
- const SilkRuntimeLive = Layer.mergeAll(SilkWorkspaceAnalyzerLive, WorkspaceRootLive).pipe(Layer.provide(DepsLive));
12
- const TIER_HEADINGS = [
13
- [
14
- "standards",
15
- "Standards"
16
- ],
17
- [
18
- "packages",
19
- "Packages"
20
- ],
21
- [
22
- "guides",
23
- "Guides"
24
- ]
25
- ];
26
- function renderCatalogMarkdown(manifest) {
27
- const lines = [
28
- "# silk://catalog",
29
- "",
30
- "Read this first to orient. To fetch a doc, call `resources/read` with its `silk://` URI.",
31
- "To search by intent, use the `silk_docs_search` tool.",
32
- ""
33
- ];
34
- for (const [tier, heading] of TIER_HEADINGS){
35
- const entries = manifest.entries.filter((e)=>e.tier === tier && "deprecated" !== e.status);
36
- if (0 !== entries.length) {
37
- lines.push(`## ${heading}`, "");
38
- for (const e of entries){
39
- const gen = "generated" === e.source ? " (generated)" : "";
40
- lines.push(`- \`${e.uri}\`${gen} — ${e.title}. load when: ${e.summary}`);
41
- }
42
- lines.push("");
43
- }
44
- }
45
- return lines.join("\n");
46
- }
47
- function resolveResourcePath(root, relativePath) {
48
- if (relativePath.includes("\0")) throw new Error("path contains null byte");
49
- if (isAbsolute(relativePath)) throw new Error("absolute path not allowed");
50
- const stripped = relativePath.replace(/^\/+/, "");
51
- const withIndex = "" === stripped || stripped.endsWith("/") ? `${stripped}index` : stripped;
52
- const withExt = withIndex.endsWith(".md") ? withIndex : `${withIndex}.md`;
53
- const resolved = resolve(root, normalize(withExt));
54
- const rootWithSep = root.endsWith(sep) ? root : `${root}${sep}`;
55
- if (!resolved.startsWith(rootWithSep) && resolved !== root) throw new Error("path escapes content root");
56
- return resolved;
57
- }
58
- const ID_PATTERN = /^(standards|packages|guides)\/[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*\/?$/;
59
- const Tier = Schema.Literal("standards", "packages", "guides");
60
- const Audience = Schema.Array(Schema.Literal("user", "assistant"));
61
- const Source = Schema.Literal("hand", "generated");
62
- const Status = Schema.Literal("draft", "stable", "deprecated");
63
- const DocFrontMatter = Schema.Struct({
64
- id: Schema.String.pipe(Schema.pattern(ID_PATTERN)),
65
- title: Schema.NonEmptyString,
66
- summary: Schema.NonEmptyString,
67
- tier: Tier,
68
- source: Source,
69
- status: Schema.optionalWith(Status, {
70
- default: ()=>"stable"
71
- }),
72
- supersededBy: Schema.optional(Schema.String),
73
- tags: Schema.Array(Schema.NonEmptyString),
74
- audience: Schema.optionalWith(Audience, {
75
- default: ()=>[
76
- "assistant"
77
- ]
78
- }),
79
- priority: Schema.optionalWith(Schema.Number.pipe(Schema.between(0, 1)), {
80
- default: ()=>0.5
81
- }),
82
- related: Schema.optionalWith(Schema.Array(Schema.String), {
83
- default: ()=>[]
84
- })
85
- });
86
- const ManifestEntry = Schema.Struct({
87
- ...DocFrontMatter.fields,
88
- uri: Schema.String,
89
- lastModified: Schema.optional(Schema.String)
90
- });
91
- const Manifest = Schema.Struct({
92
- entries: Schema.Array(ManifestEntry)
93
- });
94
- Schema.decodeUnknown(DocFrontMatter);
95
- Schema.decodeUnknown(Manifest);
96
- function resolveContentRoot() {
97
- const here = dirname(fileURLToPath(import.meta.url));
98
- const candidates = [
99
- join(here, "resources", "content"),
100
- join(here, "..", "resources", "content"),
101
- join(here, "content")
102
- ];
103
- for (const candidate of candidates)if (existsSync(join(candidate, "manifest.json"))) return candidate;
104
- throw new Error(`[savvy-mcp] cannot locate resources/content with a manifest.json (tried: ${candidates.join(", ")})`);
105
- }
106
- function loadManifest(contentRoot) {
107
- const raw = JSON.parse(readFileSync(join(contentRoot, "manifest.json"), "utf8"));
108
- return Schema.decodeUnknownSync(Manifest)(raw);
109
- }
110
- function readDocBody(contentRoot, relPath) {
111
- return readFileSync(resolveResourcePath(contentRoot, relPath), "utf8");
112
- }
113
- const resourceName = (entry)=>`silk_${entry.id.replace(/[^A-Za-z0-9]/g, "_")}`;
114
- const toSdkAnnotations = (e)=>({
115
- audience: [
116
- ...e.audience
117
- ],
118
- priority: e.priority,
119
- ...e.lastModified ? {
120
- lastModified: e.lastModified
121
- } : {}
122
- });
123
- function registerAllResources(server, deps) {
124
- const { manifest, bodies, contentRoot } = deps;
125
- server.registerResource("silk_catalog", "silk://catalog", {
126
- title: "Silk resource catalog",
127
- description: "Read this first. Lists every Silk resource grouped by tier with a 'load when' hint. Fetch a doc with resources/read <uri>; search by intent with silk_docs_search.",
128
- mimeType: "text/markdown"
129
- }, async (uri)=>({
130
- contents: [
131
- {
132
- uri: uri.href,
133
- mimeType: "text/markdown",
134
- text: renderCatalogMarkdown(manifest)
135
- }
136
- ]
137
- }));
138
- const byUri = new Map(manifest.entries.map((e)=>[
139
- e.uri,
140
- e
141
- ]));
142
- const readBody = (uri, relPath)=>bodies ? bodies[uri] ?? "" : readDocBody(contentRoot, relPath);
143
- server.registerResource("silk_doc", new ResourceTemplate("silk://{+path}", {
144
- list: async ()=>({
145
- resources: manifest.entries.filter((e)=>"deprecated" !== e.status).map((e)=>({
146
- name: resourceName(e),
147
- uri: e.uri,
148
- title: e.title,
149
- description: e.summary,
150
- mimeType: "text/markdown",
151
- annotations: toSdkAnnotations(e)
152
- }))
153
- })
154
- }), {
155
- title: "Silk documentation resource",
156
- mimeType: "text/markdown"
157
- }, async (uri, variables)=>{
158
- const relPath = String(variables.path ?? "");
159
- const entry = byUri.get(uri.href);
160
- return {
161
- contents: [
162
- {
163
- uri: uri.href,
164
- mimeType: "text/markdown",
165
- text: readBody(uri.href, relPath),
166
- ...entry ? {
167
- annotations: toSdkAnnotations(entry)
168
- } : {}
169
- }
170
- ]
171
- };
172
- });
173
- }
174
- function formatQueryLogLine(query, results) {
175
- const top = results.slice(0, 3);
176
- const belowThreshold = 0 === results.length || results.every((r)=>"low" === r.confidenceLabel);
177
- const payload = {
178
- query,
179
- topResults: top.map((r)=>r.uri),
180
- topConfidence: results[0]?.confidence ?? 0,
181
- belowThreshold
182
- };
183
- return `[savvy-mcp] docs-search ${JSON.stringify(payload)}`;
184
- }
185
- const stderrQueryLogger = (line)=>{
186
- process.stderr.write(`${line}\n`);
187
- };
188
- const effectToZodSchema = (schema)=>{
189
- const jsonSchema = JSONSchema.make(schema);
190
- const inlined = inlineAllRefs(jsonSchema);
191
- const zodSchema = z.fromJSONSchema(inlined);
192
- if (isObjectLike(zodSchema)) return zodSchema;
193
- return z.object({}).catchall(z.unknown());
194
- };
195
- const isObjectLike = (schema)=>schema instanceof z.ZodObject;
196
- const REF_PREFIX = "#/$defs/";
197
- const inlineAllRefs = (root)=>{
198
- const defs = root.$defs ?? {};
199
- const visit = (value)=>{
200
- if (Array.isArray(value)) return value.map(visit);
201
- if (null === value || "object" != typeof value) return value;
202
- const obj = value;
203
- if ("string" == typeof obj.$ref && obj.$ref.startsWith(REF_PREFIX)) {
204
- const defName = obj.$ref.slice(REF_PREFIX.length);
205
- const target = defs[defName];
206
- if (void 0 !== target) return visit(target);
207
- }
208
- const out = {};
209
- for (const [k, v] of Object.entries(obj))if ("$defs" !== k) out[k] = visit(v);
210
- return out;
211
- };
212
- return visit(root);
213
- };
214
- const DocsSearchHit = Schema.Struct({
215
- uri: Schema.String,
216
- title: Schema.String,
217
- summary: Schema.String,
218
- tags: Schema.Array(Schema.String),
219
- tier: Schema.Literal("standards", "packages", "guides"),
220
- confidence: Schema.Number,
221
- confidenceLabel: Schema.Literal("high", "medium", "low"),
222
- matchedOn: Schema.Array(Schema.String),
223
- related: Schema.optionalWith(Schema.Array(Schema.String), {
224
- default: ()=>[]
225
- })
226
- }).annotations({
227
- identifier: "DocsSearchHit"
228
- });
229
- const DocsSearchResult = Schema.Struct({
230
- query: Schema.String,
231
- results: Schema.Array(DocsSearchHit)
232
- }).annotations({
233
- identifier: "DocsSearchResult",
234
- title: "silk_docs_search result",
235
- description: "Ranked Silk documentation matches. Fetch a hit with resources/read <uri>."
236
- });
237
- const formatDocsSearchMarkdown = (data)=>{
238
- const lines = [
239
- `# silk_docs_search: ${data.query}`,
240
- ""
241
- ];
242
- if (0 === data.results.length) {
243
- lines.push("No results. Read `silk://catalog` and select a doc by reasoning.");
244
- return lines.join("\n");
245
- }
246
- const allLow = data.results.every((r)=>"low" === r.confidenceLabel);
247
- if (allLow) lines.push("_No high-confidence match — read `silk://catalog` and pick by reasoning._", "");
248
- for (const r of data.results)lines.push(`- \`${r.uri}\` (${r.confidenceLabel}) — ${r.title}. ${r.summary}`);
249
- lines.push("", "Fetch any hit with `resources/read <uri>`.");
250
- return lines.join("\n");
251
- };
252
- const DocsSearchResultAsMarkdown = Schema.transformOrFail(DocsSearchResult, Schema.String, {
253
- strict: true,
254
- decode: (data)=>ParseResult.succeed(formatDocsSearchMarkdown(data)),
255
- encode: (text, _opts, ast)=>ParseResult.fail(new ParseResult.Forbidden(ast, text, "DocsSearchResultAsMarkdown is one-way."))
256
- });
257
- const runDocsSearch = (index, query, opts, logger)=>{
258
- const results = index.search(query, opts);
259
- if (logger) logger(formatQueryLogLine(query, results));
260
- return {
261
- query,
262
- results
263
- };
264
- };
265
- const WorkspaceSummary = Schema.Struct({
266
- name: Schema.String,
267
- version: Schema.String,
268
- path: Schema.String,
269
- root: Schema.Boolean,
270
- publishable: Schema.Boolean,
271
- targets: Schema.Array(Schema.String).annotations({
272
- description: "Publish registry URLs."
273
- }),
274
- versioned: Schema.Boolean,
275
- tagged: Schema.Boolean,
276
- released: Schema.Boolean,
277
- linked: Schema.Array(Schema.String).annotations({
278
- description: "Names of linked workspaces."
279
- }),
280
- fixed: Schema.Array(Schema.String).annotations({
281
- description: "Names of fixed-group siblings."
282
- })
283
- }).annotations({
284
- identifier: "WorkspaceSummary"
285
- });
286
- const WorkspaceInfoResult = Schema.Struct({
287
- root: Schema.String,
288
- runtime: Schema.Literal("node", "bun"),
289
- packageManager: Schema.Struct({
290
- type: Schema.Literal("npm", "pnpm", "yarn", "bun"),
291
- version: Schema.optional(Schema.String)
292
- }),
293
- workspaceCount: Schema.Number,
294
- workspaces: Schema.Array(WorkspaceSummary)
295
- }).annotations({
296
- identifier: "WorkspaceInfoResult",
297
- title: "workspace_info result",
298
- description: "Structured snapshot of the Silk workspace: runtime, package manager, and a per-workspace summary (publishability, versioning, tag/release state, linked/fixed relations)."
299
- });
300
- const toSummary = (w)=>({
301
- name: w.name,
302
- version: w.version.current,
303
- path: w.path,
304
- root: w.root,
305
- publishable: w.publishable,
306
- targets: w.targets.map((t)=>t.registry),
307
- versioned: w.versioned,
308
- tagged: w.tagged,
309
- released: w.released,
310
- linked: w.linked.map((l)=>l.name),
311
- fixed: w.fixed.map((f)=>f.name)
312
- });
313
- const toWorkspaceInfoResult = (analysis)=>({
314
- root: analysis.root,
315
- runtime: analysis.runtime,
316
- packageManager: {
317
- type: analysis.packageManager.type,
318
- ...void 0 !== analysis.packageManager.version ? {
319
- version: analysis.packageManager.version
320
- } : {}
321
- },
322
- workspaceCount: analysis.workspaces.length,
323
- workspaces: analysis.workspaces.map(toSummary)
324
- });
325
- const formatWorkspaceInfoMarkdown = (data)=>{
326
- const pm = data.packageManager.version ? `${data.packageManager.type}@${data.packageManager.version}` : data.packageManager.type;
327
- const lines = [
328
- `# Workspace: ${data.root}`,
329
- "",
330
- `- runtime: ${data.runtime}`,
331
- `- package manager: ${pm}`,
332
- `- workspaces: ${data.workspaceCount}`,
333
- "",
334
- "| name | version | publishable | versioned | tagged | released |",
335
- "| --- | --- | --- | --- | --- | --- |"
336
- ];
337
- for (const w of data.workspaces)lines.push(`| ${w.name} | ${w.version} | ${w.publishable} | ${w.versioned} | ${w.tagged} | ${w.released} |`);
338
- return lines.join("\n");
339
- };
340
- const WorkspaceInfoAsMarkdown = Schema.transformOrFail(WorkspaceInfoResult, Schema.String, {
341
- strict: true,
342
- decode: (data)=>ParseResult.succeed(formatWorkspaceInfoMarkdown(data)),
343
- encode: (text, _options, ast)=>ParseResult.fail(new ParseResult.Forbidden(ast, text, "WorkspaceInfoAsMarkdown is one-way: markdown cannot be parsed back."))
344
- });
345
- const workspaceInfo = (base)=>Effect.gen(function*() {
346
- const workspaceRoot = yield* WorkspaceRoot;
347
- const root = yield* workspaceRoot.find(base);
348
- const analyzer = yield* SilkWorkspaceAnalyzer;
349
- const analysis = yield* analyzer.analyze(root);
350
- return toWorkspaceInfoResult(analysis);
351
- });
352
- const structuredResult = (text, structured)=>({
353
- content: [
354
- {
355
- type: "text",
356
- text
357
- }
358
- ],
359
- structuredContent: structured
360
- });
361
- function buildServer(ctx) {
362
- const server = new McpServer({
363
- name: "savvy-mcp",
364
- version: "0.0.0"
365
- });
366
- server.registerTool("workspace_info", {
367
- description: "Use when you need the Silk workspace layout: runtime, package manager, and a per-workspace summary (publishability, versioning, tag/release state). Prefer this over running shell commands to inspect the workspace. Returns markdown in content[] and a typed object in structuredContent.",
368
- inputSchema: {
369
- cwd: z.optional(z.string()).describe("Workspace root to analyze. Defaults to the server's project dir.")
370
- },
371
- outputSchema: effectToZodSchema(WorkspaceInfoResult)
372
- }, async (args)=>{
373
- const root = args.cwd ?? ctx.cwd;
374
- const data = await ctx.runtime.runPromise(workspaceInfo(root));
375
- const text = Schema.decodeSync(WorkspaceInfoAsMarkdown)(data);
376
- return structuredResult(text, data);
377
- });
378
- server.registerTool("silk_docs_search", {
379
- description: "Search Silk documentation by intent. Pass plain keywords or a short phrase describing what you need (e.g. 'changeset bump rules'). Returns ranked docs with a confidence label; fetch a hit with resources/read <uri>. Read silk://catalog first to orient.",
380
- inputSchema: {
381
- query: z.string().describe("Keywords or a short phrase describing the doc you need."),
382
- limit: z.optional(z.number()).describe("Max results (default 10)."),
383
- tier: z.optional(z["enum"]([
384
- "standards",
385
- "packages",
386
- "guides"
387
- ])).describe("Restrict to one tier.")
388
- },
389
- outputSchema: effectToZodSchema(DocsSearchResult),
390
- annotations: {
391
- readOnlyHint: true
392
- }
393
- }, async (args)=>{
394
- const data = runDocsSearch(ctx.docIndex, args.query, {
395
- ...void 0 !== args.limit ? {
396
- limit: args.limit
397
- } : {},
398
- ...void 0 !== args.tier ? {
399
- tier: args.tier
400
- } : {}
401
- }, stderrQueryLogger);
402
- const text = Schema.decodeSync(DocsSearchResultAsMarkdown)(data);
403
- return structuredResult(text, data);
404
- });
405
- registerAllResources(server, {
406
- manifest: ctx.manifest,
407
- contentRoot: ctx.contentRoot
408
- });
409
- return server;
410
- }
411
- async function startMcpServer(ctx) {
412
- const server = buildServer(ctx);
413
- const transport = new StdioServerTransport();
414
- await server.connect(transport);
415
- }
416
- export { SilkRuntimeLive, loadManifest, readDocBody, resolveContentRoot, startMcpServer };
package/index.d.ts DELETED
@@ -1,126 +0,0 @@
1
- /**
2
- * Public barrel for `@savvy-web/mcp`.
3
- *
4
- * @packageDocumentation
5
- */
6
-
7
- import { FileSystem } from '@effect/platform/FileSystem';
8
- import { Layer } from 'effect';
9
- import type { ManagedRuntime } from 'effect';
10
- import { Path } from '@effect/platform/Path';
11
- import { Schema } from 'effect';
12
- import { SilkWorkspaceAnalyzer } from '@savvy-web/silk-effects';
13
- import { WorkspaceDiscoveryError } from 'workspaces-effect';
14
- import { WorkspaceRoot } from 'workspaces-effect';
15
-
16
- /**
17
- * The package version, replaced at build time. `0.0.0` in dev/test indicates
18
- * an unbuilt source run. Kept in its own module so both `server.ts` and the
19
- * `index.ts` barrel can import it without forming an import cycle.
20
- *
21
- * @packageDocumentation
22
- */
23
- export declare const CURRENT_MCP_VERSION = "0.0.0";
24
-
25
- export declare class DocIndex {
26
- private readonly fuse;
27
- private readonly entries;
28
- private readonly byUri;
29
- private constructor();
30
- static fromManifest(manifest: Manifest, bodies: Readonly<Record<string, string>>): DocIndex;
31
- search(query: string, opts?: SearchOptions): SearchResult[];
32
- /** Never return empty: surface the top entries (by priority) as low-confidence. */
33
- private fallback;
34
- }
35
-
36
- export declare const Manifest: Schema.Struct<{
37
- entries: Schema.Array$<Schema.Struct<{
38
- id: Schema.filter<typeof Schema.String>;
39
- title: typeof Schema.NonEmptyString;
40
- summary: typeof Schema.NonEmptyString;
41
- tier: Schema.Literal<["standards", "packages", "guides"]>;
42
- source: Schema.Literal<["hand", "generated"]>;
43
- status: Schema.optionalWith<Schema.Literal<["draft", "stable", "deprecated"]>, {
44
- default: () => "stable";
45
- }>;
46
- supersededBy: Schema.optional<typeof Schema.String>;
47
- tags: Schema.Array$<typeof Schema.NonEmptyString>;
48
- audience: Schema.optionalWith<Schema.Array$<Schema.Literal<["user", "assistant"]>>, {
49
- default: () => ReadonlyArray<"assistant">;
50
- }>;
51
- priority: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
52
- default: () => number;
53
- }>;
54
- related: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
55
- default: () => ReadonlyArray<string>;
56
- }>;
57
- uri: typeof Schema.String;
58
- lastModified: Schema.optional<typeof Schema.String>;
59
- }>>;
60
- }>;
61
-
62
- export declare type Manifest = Schema.Schema.Type<typeof Manifest>;
63
-
64
- /** A manifest entry = decoded front-matter + the derived uri + lastModified. */
65
- export declare const ManifestEntry: Schema.Struct<{
66
- id: Schema.filter<typeof Schema.String>;
67
- title: typeof Schema.NonEmptyString;
68
- summary: typeof Schema.NonEmptyString;
69
- tier: Schema.Literal<["standards", "packages", "guides"]>;
70
- source: Schema.Literal<["hand", "generated"]>;
71
- status: Schema.optionalWith<Schema.Literal<["draft", "stable", "deprecated"]>, {
72
- default: () => "stable";
73
- }>;
74
- supersededBy: Schema.optional<typeof Schema.String>;
75
- tags: Schema.Array$<typeof Schema.NonEmptyString>;
76
- audience: Schema.optionalWith<Schema.Array$<Schema.Literal<["user", "assistant"]>>, {
77
- default: () => ReadonlyArray<"assistant">;
78
- }>;
79
- priority: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
80
- default: () => number;
81
- }>;
82
- related: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
83
- default: () => ReadonlyArray<string>;
84
- }>;
85
- uri: typeof Schema.String;
86
- lastModified: Schema.optional<typeof Schema.String>;
87
- }>;
88
-
89
- export declare type ManifestEntry = Schema.Schema.Type<typeof ManifestEntry>;
90
-
91
- /** The long-lived runtime, the project working directory, and the resource layer. */
92
- export declare interface McpContext {
93
- readonly runtime: ManagedRuntime.ManagedRuntime<SilkWorkspaceAnalyzer | WorkspaceRoot, WorkspaceDiscoveryError>;
94
- readonly cwd: string;
95
- readonly docIndex: DocIndex;
96
- readonly manifest: Manifest;
97
- readonly contentRoot: string;
98
- }
99
-
100
- export declare interface SearchOptions {
101
- readonly limit?: number;
102
- readonly tier?: ManifestEntry["tier"];
103
- }
104
-
105
- export declare interface SearchResult {
106
- readonly uri: string;
107
- readonly title: string;
108
- readonly summary: string;
109
- readonly tags: ReadonlyArray<string>;
110
- readonly tier: ManifestEntry["tier"];
111
- readonly confidence: number;
112
- readonly confidenceLabel: "high" | "medium" | "low";
113
- readonly matchedOn: ReadonlyArray<string>;
114
- readonly related: ReadonlyArray<string>;
115
- }
116
-
117
- /**
118
- * The MCP runtime layer. Provides `SilkWorkspaceAnalyzer` and `WorkspaceRoot`;
119
- * requires `FileSystem` + `Path` from the host's platform layer.
120
- */
121
- export declare const SilkRuntimeLive: Layer.Layer<SilkWorkspaceAnalyzer | WorkspaceRoot, WorkspaceDiscoveryError, FileSystem | Path>;
122
-
123
- /** Build the server and connect it over stdio. */
124
- export declare function startMcpServer(ctx: McpContext): Promise<void>;
125
-
126
- export { }
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- var src_CURRENT_MCP_VERSION = "0.0.0";
2
- export { SilkRuntimeLive, startMcpServer } from "./547.js";
3
- export { src_CURRENT_MCP_VERSION as CURRENT_MCP_VERSION };
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.58.7"
9
- }
10
- ]
11
- }