@open-livex-wiki/mcp 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AndersonBY
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export { allocateSceneAnchorHandles, computeWikiFingerprint, createWikiMcpServer, DEFAULT_READ_SCENE_MAX_CHARS, formatRouteCoverageReport, MCP_PACKAGE_VERSION, PROGRESSIVE_CONSUMPTION_INSTRUCTIONS, startWikiMcpStdioServer, type WikiMcpCacheStats, type WikiMcpServer, type WikiMcpServerOptions, wrapUntrustedWikiContent, } from "./server.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,oCAAoC,EACpC,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { allocateSceneAnchorHandles, computeWikiFingerprint, createWikiMcpServer, DEFAULT_READ_SCENE_MAX_CHARS, formatRouteCoverageReport, MCP_PACKAGE_VERSION, PROGRESSIVE_CONSUMPTION_INSTRUCTIONS, startWikiMcpStdioServer, wrapUntrustedWikiContent, } from "./server.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,oCAAoC,EACpC,uBAAuB,EAIvB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { type Anchor, type LoadedWiki, type RouteCoverageResult } from "@open-livex-wiki/core";
3
+ export declare const MCP_PACKAGE_VERSION = "0.2.0";
4
+ export declare const DEFAULT_READ_SCENE_MAX_CHARS = 32000;
5
+ export interface WikiMcpServerOptions {
6
+ wikiDir: string;
7
+ wiki?: LoadedWiki;
8
+ reposDir?: string;
9
+ }
10
+ export interface WikiMcpCacheStats {
11
+ loadCount: number;
12
+ cacheHits: number;
13
+ cacheMisses: number;
14
+ lastFingerprint: string | null;
15
+ }
16
+ export type WikiMcpServer = McpServer & {
17
+ getCacheStats: () => WikiMcpCacheStats;
18
+ invalidateCache: () => void;
19
+ };
20
+ export declare const PROGRESSIVE_CONSUMPTION_INSTRUCTIONS: string;
21
+ export declare function wrapUntrustedWikiContent(rawMarkdown: string): string;
22
+ /**
23
+ * Computes a fast stat-metadata fingerprint (`size` + `mtimeMs` + `ctimeMs`) over `wiki.config.yaml`
24
+ * and `<domainsDir>/**\/*.md` without reading file contents, while preserving symlink/junction
25
+ * containment and directory-cycle guards. Any `.md` or `wiki.config.yaml` change invalidates the cache.
26
+ */
27
+ export declare function computeWikiFingerprint(wikiDir: string, domainsDir?: string): Promise<string>;
28
+ /**
29
+ * Allocates deterministic per-scene short citation handles: explicit `anchor.handle` when unique,
30
+ * otherwise `FIG-n` (figures / image files), `SEC-n` (sections, documents, page ranges), or `ANC-n`.
31
+ */
32
+ export declare function allocateSceneAnchorHandles(anchors: readonly Anchor[]): string[];
33
+ export declare function formatRouteCoverageReport(result: RouteCoverageResult): string;
34
+ export declare function createWikiMcpServer(options: WikiMcpServerOptions): WikiMcpServer;
35
+ export declare function startWikiMcpStdioServer(options: WikiMcpServerOptions): Promise<WikiMcpServer>;
36
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EACL,KAAK,MAAM,EAWX,KAAK,UAAU,EAGf,KAAK,mBAAmB,EAOzB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MA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