@fenglimg/fabric-server 2.0.0-rc.29 → 2.0.0-rc.30
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.
|
@@ -851,8 +851,9 @@ function createDefaultNodeMeta(contentRef) {
|
|
|
851
851
|
scope_glob: deriveScopeGlob(contentRef),
|
|
852
852
|
deps: layer === "L0" ? [] : ["L0"],
|
|
853
853
|
priority: layer === "L0" ? "high" : "medium",
|
|
854
|
+
// v2.0.0-rc.30 TASK-004: dropped duplicate `layer:` write — was always
|
|
855
|
+
// identical to `level:`; AgentsMetaNode no longer carries the field.
|
|
854
856
|
level: layer,
|
|
855
|
-
layer,
|
|
856
857
|
topology_type: topologyType,
|
|
857
858
|
hash: ""
|
|
858
859
|
};
|
|
@@ -6370,12 +6371,8 @@ async function emitAutoHealEventBestEffort(projectRoot, payload) {
|
|
|
6370
6371
|
// src/services/get-knowledge.ts
|
|
6371
6372
|
import { readFile as readFile6 } from "fs/promises";
|
|
6372
6373
|
import { join as join8 } from "path";
|
|
6374
|
+
import { deriveAgentsMetaLayer as deriveAgentsMetaLayer2 } from "@fenglimg/fabric-shared";
|
|
6373
6375
|
import { minimatch as minimatch2 } from "minimatch";
|
|
6374
|
-
var PRIORITY_ORDER = {
|
|
6375
|
-
high: 0,
|
|
6376
|
-
medium: 1,
|
|
6377
|
-
low: 2
|
|
6378
|
-
};
|
|
6379
6376
|
async function getKnowledge(projectRoot, input) {
|
|
6380
6377
|
const metaResult = await loadActiveMeta(projectRoot, { caller: "getKnowledge" });
|
|
6381
6378
|
if (metaResult.auto_healed) {
|
|
@@ -6432,12 +6429,7 @@ function normalizeKnowledgePath(value) {
|
|
|
6432
6429
|
}
|
|
6433
6430
|
function matchRuleNodes(meta, path2) {
|
|
6434
6431
|
const requestedPath = normalizeKnowledgePath(path2);
|
|
6435
|
-
return Object.entries(meta.nodes).filter(([, node]) => shouldLoadNodeForPath(requestedPath, node)).sort((left, right) => {
|
|
6436
|
-
const [leftId, leftNode] = left;
|
|
6437
|
-
const [rightId, rightNode] = right;
|
|
6438
|
-
const priorityDelta = PRIORITY_ORDER[leftNode.priority ?? "medium"] - PRIORITY_ORDER[rightNode.priority ?? "medium"];
|
|
6439
|
-
return priorityDelta !== 0 ? priorityDelta : leftId.localeCompare(rightId);
|
|
6440
|
-
}).map(([nodeId, node]) => ({
|
|
6432
|
+
return Object.entries(meta.nodes).filter(([, node]) => shouldLoadNodeForPath(requestedPath, node)).sort((left, right) => left[0].localeCompare(right[0])).map(([nodeId, node]) => ({
|
|
6441
6433
|
node_id: nodeId,
|
|
6442
6434
|
level: classifyNode(nodeId, node),
|
|
6443
6435
|
stable_id: node.stable_id ?? nodeId,
|
|
@@ -6491,7 +6483,8 @@ function classifyNode(nodeId, node) {
|
|
|
6491
6483
|
if (nodeId.startsWith("L2/")) {
|
|
6492
6484
|
return "L2";
|
|
6493
6485
|
}
|
|
6494
|
-
|
|
6486
|
+
const layer = node.level ?? deriveAgentsMetaLayer2(node.file);
|
|
6487
|
+
return layer === "L0" ? null : layer;
|
|
6495
6488
|
}
|
|
6496
6489
|
function partitionRulesByLevel(loadedRules, dedupeByPath) {
|
|
6497
6490
|
const l1 = [];
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readEventLedger,
|
|
15
15
|
runDoctorReport,
|
|
16
16
|
sha256
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4DLGRSYE.js";
|
|
18
18
|
|
|
19
19
|
// src/http.ts
|
|
20
20
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -725,7 +725,9 @@ function buildLedgerFallbackMeta(entries) {
|
|
|
725
725
|
scope_glob: affectedPath,
|
|
726
726
|
deps: [],
|
|
727
727
|
priority: "medium",
|
|
728
|
-
layer: "L2"
|
|
728
|
+
// v2.0.0-rc.30 TASK-004: dropped `layer: "L2"` — use `level` only;
|
|
729
|
+
// AgentsMetaNode no longer carries `layer`.
|
|
730
|
+
level: "L2",
|
|
729
731
|
topology_type: "mirror",
|
|
730
732
|
hash: `replayed:${hashBase ?? entry.id}`
|
|
731
733
|
};
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
sha256,
|
|
40
40
|
stableStringify,
|
|
41
41
|
writeKnowledgeMeta
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-4DLGRSYE.js";
|
|
43
43
|
|
|
44
44
|
// src/index.ts
|
|
45
45
|
import { existsSync as existsSync3 } from "fs";
|
|
@@ -848,7 +848,7 @@ function registerPlanContext(server, tracker) {
|
|
|
848
848
|
const gateResult = await awaitFirstReconcileGate();
|
|
849
849
|
const gateWarn = gateWarning(gateResult);
|
|
850
850
|
const projectRoot = resolveProjectRoot();
|
|
851
|
-
const syncReport = await ensureKnowledgeFresh(projectRoot);
|
|
851
|
+
const syncReport = await ensureKnowledgeFresh(projectRoot, { autoHealOnDrift: true });
|
|
852
852
|
const result = await planContext(projectRoot, {
|
|
853
853
|
paths,
|
|
854
854
|
intent,
|
|
@@ -1774,6 +1774,7 @@ import { enforcePayloadLimit as enforcePayloadLimit4 } from "@fenglimg/fabric-sh
|
|
|
1774
1774
|
import { readFile as readFile4 } from "fs/promises";
|
|
1775
1775
|
import { homedir as homedir3 } from "os";
|
|
1776
1776
|
import { join as join3 } from "path";
|
|
1777
|
+
import { deriveAgentsMetaLayer as deriveAgentsMetaLayer2 } from "@fenglimg/fabric-shared";
|
|
1777
1778
|
var PRIORITY_ORDER = {
|
|
1778
1779
|
high: 0,
|
|
1779
1780
|
medium: 1,
|
|
@@ -1896,7 +1897,7 @@ function findRuleNode(meta, stableId) {
|
|
|
1896
1897
|
if (nodeStableId !== stableId) {
|
|
1897
1898
|
continue;
|
|
1898
1899
|
}
|
|
1899
|
-
const level = node.level ?? node.
|
|
1900
|
+
const level = node.level ?? deriveAgentsMetaLayer2(node.file);
|
|
1900
1901
|
return {
|
|
1901
1902
|
stable_id: nodeStableId,
|
|
1902
1903
|
level,
|
|
@@ -1958,7 +1959,7 @@ function registerKnowledgeSections(server, tracker) {
|
|
|
1958
1959
|
const gateResult = await awaitFirstReconcileGate();
|
|
1959
1960
|
const gateWarn = gateWarning(gateResult);
|
|
1960
1961
|
const projectRoot = resolveProjectRoot();
|
|
1961
|
-
const syncReport = await ensureKnowledgeFresh(projectRoot);
|
|
1962
|
+
const syncReport = await ensureKnowledgeFresh(projectRoot, { autoHealOnDrift: true });
|
|
1962
1963
|
const result = await getKnowledgeSections(projectRoot, input);
|
|
1963
1964
|
const response = {
|
|
1964
1965
|
...result,
|
|
@@ -2012,7 +2013,7 @@ function formatPreexistingRootMessage(projectRoot) {
|
|
|
2012
2013
|
function createFabricServer(tracker) {
|
|
2013
2014
|
const server = new McpServer({
|
|
2014
2015
|
name: "fabric-knowledge-server",
|
|
2015
|
-
version: "2.0.0-rc.
|
|
2016
|
+
version: "2.0.0-rc.30"
|
|
2016
2017
|
});
|
|
2017
2018
|
registerPlanContext(server, tracker);
|
|
2018
2019
|
registerKnowledgeSections(server, tracker);
|
|
@@ -2120,7 +2121,7 @@ function createShutdownHandler(deps) {
|
|
|
2120
2121
|
};
|
|
2121
2122
|
}
|
|
2122
2123
|
async function startHttpServer(options) {
|
|
2123
|
-
const { createFabricHttpApp } = await import("./http-
|
|
2124
|
+
const { createFabricHttpApp } = await import("./http-ALTGDHLT.js");
|
|
2124
2125
|
const { port, projectRoot, host = "127.0.0.1", authToken, allowLoopbackNoAuth } = options;
|
|
2125
2126
|
const app = createFabricHttpApp({ projectRoot, host, authToken, allowLoopbackNoAuth });
|
|
2126
2127
|
return await new Promise((resolveServer, rejectServer) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fenglimg/fabric-server",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"express": "^5.2.1",
|
|
14
14
|
"minimatch": "^10.0.1",
|
|
15
15
|
"zod": "^3.25.0",
|
|
16
|
-
"@fenglimg/fabric-shared": "2.0.0-rc.
|
|
16
|
+
"@fenglimg/fabric-shared": "2.0.0-rc.30"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/express": "^5.0.6",
|