@curenorway/kode-mcp 1.5.1 → 1.7.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/dist/index.js +27 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -843,16 +843,26 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
843
843
|
const siteId = getSiteId();
|
|
844
844
|
switch (name) {
|
|
845
845
|
case "kode_list_scripts": {
|
|
846
|
-
const scripts = await
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
846
|
+
const [scripts, allPages] = await Promise.all([
|
|
847
|
+
client.listScripts(siteId),
|
|
848
|
+
client.listPages(siteId)
|
|
849
|
+
]);
|
|
850
|
+
const formatted = scripts.map((s) => {
|
|
851
|
+
const pageAssignments = (s.pages || []).filter((p) => p.is_enabled).map((p) => {
|
|
852
|
+
const page = allPages.find((pg) => pg.id === p.page_id);
|
|
853
|
+
return page ? { slug: page.slug, name: page.name, patterns: page.url_patterns } : null;
|
|
854
|
+
}).filter((p) => p !== null);
|
|
855
|
+
return {
|
|
856
|
+
slug: s.slug,
|
|
857
|
+
name: s.name,
|
|
858
|
+
type: s.type,
|
|
859
|
+
scope: s.scope,
|
|
860
|
+
version: s.current_version,
|
|
861
|
+
active: s.is_active,
|
|
862
|
+
loadOrder: s.load_order,
|
|
863
|
+
...pageAssignments.length > 0 ? { pages: pageAssignments } : {}
|
|
864
|
+
};
|
|
865
|
+
});
|
|
856
866
|
return {
|
|
857
867
|
content: [
|
|
858
868
|
{
|
|
@@ -2530,12 +2540,16 @@ Use kode_list_pages_context to see cached pages, or kode_refresh_page to cache a
|
|
|
2530
2540
|
try {
|
|
2531
2541
|
const scripts = await client.listScripts(siteId);
|
|
2532
2542
|
const pages = await client.listPages(siteId);
|
|
2543
|
+
const deployStatus = await client.getDeploymentStatus(siteId).catch(() => null);
|
|
2544
|
+
const productionEnabled = deployStatus?.productionEnabled ?? false;
|
|
2533
2545
|
let text = `Documentation synced:
|
|
2534
2546
|
|
|
2535
2547
|
`;
|
|
2536
2548
|
text += `Scripts: ${scripts.length}
|
|
2537
2549
|
`;
|
|
2538
2550
|
text += `Pages: ${pages.length}
|
|
2551
|
+
`;
|
|
2552
|
+
text += `Production: ${productionEnabled ? "Enabled" : "Disabled (staging only)"}
|
|
2539
2553
|
|
|
2540
2554
|
`;
|
|
2541
2555
|
if (scripts.length > 0) {
|
|
@@ -2574,6 +2588,9 @@ Use kode_list_pages_context to see cached pages, or kode_refresh_page to cache a
|
|
|
2574
2588
|
`;
|
|
2575
2589
|
kodeMd += `> **This file is auto-generated.** Do not edit manually.
|
|
2576
2590
|
|
|
2591
|
+
`;
|
|
2592
|
+
kodeMd += `**Produksjon:** ${productionEnabled ? "\u2713 Aktivert \u2014 deploy til staging og produksjon" : "\u25CB Deaktivert \u2014 kun staging. Ikke hent fra produksjons-URL."}
|
|
2593
|
+
|
|
2577
2594
|
---
|
|
2578
2595
|
|
|
2579
2596
|
`;
|