@thallylabs/mcp 0.10.48 → 0.10.49
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/index.js +7 -26
- package/dist/tools.js +7 -26
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -893,23 +893,11 @@ async function handleGetContext(input) {
|
|
|
893
893
|
import { z as z13 } from "zod";
|
|
894
894
|
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "fs";
|
|
895
895
|
import { join as join8 } from "path";
|
|
896
|
+
import { projectNavigationContract } from "@thallylabs/core/navigation";
|
|
896
897
|
var lintProjectSchema = z13.object({
|
|
897
898
|
projectDir: z13.string().describe("Path to the Thally project root"),
|
|
898
899
|
fix: z13.boolean().optional().default(false).describe("Auto-fix issues where possible (adds orphan pages to nav)")
|
|
899
900
|
});
|
|
900
|
-
function collectNavPageIds(groups, seen, duplicates) {
|
|
901
|
-
for (const page of groups) {
|
|
902
|
-
if (typeof page === "string") {
|
|
903
|
-
if (seen.has(page)) {
|
|
904
|
-
duplicates.add(page);
|
|
905
|
-
} else {
|
|
906
|
-
seen.add(page);
|
|
907
|
-
}
|
|
908
|
-
} else if (page.pages) {
|
|
909
|
-
collectNavPageIds(page.pages, seen, duplicates);
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
901
|
function addOrphanToNav(projectDir, pageId) {
|
|
914
902
|
const config = readDocsJson(projectDir);
|
|
915
903
|
const tab = config.tabs.find((candidate) => !candidate.href && !candidate.api && (candidate.pages?.length || candidate.groups?.length));
|
|
@@ -937,20 +925,13 @@ async function handleLintProject(input) {
|
|
|
937
925
|
throw new Error(`Not a Thally project: docs.json not found in ${projectDir}`);
|
|
938
926
|
}
|
|
939
927
|
const config = readDocsJson(projectDir);
|
|
940
|
-
const
|
|
941
|
-
const
|
|
942
|
-
for (const tab of
|
|
943
|
-
|
|
944
|
-
if ((tab.href || tab.api) && !hasNavigationNodes) continue;
|
|
945
|
-
if (!hasNavigationNodes) {
|
|
946
|
-
issues.push({ severity: "error", message: `Tab "${tab.tab}" has no groups and no href \u2014 it will render empty` });
|
|
947
|
-
continue;
|
|
948
|
-
}
|
|
949
|
-
collectNavPageIds(tab.pages ?? [], navPageIds, duplicates);
|
|
950
|
-
collectNavPageIds(tab.groups ?? [], navPageIds, duplicates);
|
|
928
|
+
const navigation = projectNavigationContract(config);
|
|
929
|
+
const navPageIds = new Set(navigation.authoredPageIds);
|
|
930
|
+
for (const tab of navigation.emptyTabs) {
|
|
931
|
+
issues.push({ severity: "error", message: `Tab "${tab}" has no groups and no href \u2014 it will render empty` });
|
|
951
932
|
}
|
|
952
|
-
for (const dup of
|
|
953
|
-
issues.push({ severity: "
|
|
933
|
+
for (const dup of navigation.duplicatePageIds) {
|
|
934
|
+
issues.push({ severity: "warning", message: `[duplicate] "${dup}" appears more than once in docs.json` });
|
|
954
935
|
}
|
|
955
936
|
for (const pageId of navPageIds) {
|
|
956
937
|
const candidates = [
|
package/dist/tools.js
CHANGED
|
@@ -884,23 +884,11 @@ async function handleGetContext(input) {
|
|
|
884
884
|
import { z as z13 } from "zod";
|
|
885
885
|
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "fs";
|
|
886
886
|
import { join as join8 } from "path";
|
|
887
|
+
import { projectNavigationContract } from "@thallylabs/core/navigation";
|
|
887
888
|
var lintProjectSchema = z13.object({
|
|
888
889
|
projectDir: z13.string().describe("Path to the Thally project root"),
|
|
889
890
|
fix: z13.boolean().optional().default(false).describe("Auto-fix issues where possible (adds orphan pages to nav)")
|
|
890
891
|
});
|
|
891
|
-
function collectNavPageIds(groups, seen, duplicates) {
|
|
892
|
-
for (const page of groups) {
|
|
893
|
-
if (typeof page === "string") {
|
|
894
|
-
if (seen.has(page)) {
|
|
895
|
-
duplicates.add(page);
|
|
896
|
-
} else {
|
|
897
|
-
seen.add(page);
|
|
898
|
-
}
|
|
899
|
-
} else if (page.pages) {
|
|
900
|
-
collectNavPageIds(page.pages, seen, duplicates);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
892
|
function addOrphanToNav(projectDir, pageId) {
|
|
905
893
|
const config = readDocsJson(projectDir);
|
|
906
894
|
const tab = config.tabs.find((candidate) => !candidate.href && !candidate.api && (candidate.pages?.length || candidate.groups?.length));
|
|
@@ -928,20 +916,13 @@ async function handleLintProject(input) {
|
|
|
928
916
|
throw new Error(`Not a Thally project: docs.json not found in ${projectDir}`);
|
|
929
917
|
}
|
|
930
918
|
const config = readDocsJson(projectDir);
|
|
931
|
-
const
|
|
932
|
-
const
|
|
933
|
-
for (const tab of
|
|
934
|
-
|
|
935
|
-
if ((tab.href || tab.api) && !hasNavigationNodes) continue;
|
|
936
|
-
if (!hasNavigationNodes) {
|
|
937
|
-
issues.push({ severity: "error", message: `Tab "${tab.tab}" has no groups and no href \u2014 it will render empty` });
|
|
938
|
-
continue;
|
|
939
|
-
}
|
|
940
|
-
collectNavPageIds(tab.pages ?? [], navPageIds, duplicates);
|
|
941
|
-
collectNavPageIds(tab.groups ?? [], navPageIds, duplicates);
|
|
919
|
+
const navigation = projectNavigationContract(config);
|
|
920
|
+
const navPageIds = new Set(navigation.authoredPageIds);
|
|
921
|
+
for (const tab of navigation.emptyTabs) {
|
|
922
|
+
issues.push({ severity: "error", message: `Tab "${tab}" has no groups and no href \u2014 it will render empty` });
|
|
942
923
|
}
|
|
943
|
-
for (const dup of
|
|
944
|
-
issues.push({ severity: "
|
|
924
|
+
for (const dup of navigation.duplicatePageIds) {
|
|
925
|
+
issues.push({ severity: "warning", message: `[duplicate] "${dup}" appears more than once in docs.json` });
|
|
945
926
|
}
|
|
946
927
|
for (const pageId of navPageIds) {
|
|
947
928
|
const candidates = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thallylabs/mcp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.49",
|
|
4
4
|
"description": "MCP server for managing Thally docs and tracing product changes into evidence-backed updates for human review.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@anthropic-ai/sdk": "^0.36.0",
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
41
|
-
"
|
|
41
|
+
"@thallylabs/core": "0.2.6",
|
|
42
|
+
"create-thally-docs": "0.10.47",
|
|
42
43
|
"p-limit": "^6.1.0",
|
|
43
44
|
"yaml": "^2.8.2",
|
|
44
45
|
"zod": "^3.0.0"
|