@fenglimg/fabric-server 1.8.0-rc.1 → 1.8.0-rc.3
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/{chunk-E3BHIUIW.js → chunk-ZZGARZL5.js} +117 -1
- package/dist/{http-MEFXOG3L.js → http-PXFWUKCA.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/static/assets/index-BSbndc76.js +10 -0
- package/dist/static/index.html +1 -1
- package/package.json +3 -3
- package/dist/static/assets/index-C-ba4ih0.js +0 -10
|
@@ -1142,7 +1142,7 @@ async function reconcileRules(projectRoot, opts) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
1144
|
// src/services/doctor.ts
|
|
1145
|
-
import { existsSync as existsSync4, mkdirSync, readdirSync, readFileSync, rmdirSync, renameSync, statSync as statSync3 } from "fs";
|
|
1145
|
+
import { existsSync as existsSync4, mkdirSync, readdirSync, readFileSync, rmdirSync, renameSync, statSync as statSync3, unlinkSync } from "fs";
|
|
1146
1146
|
import { access, readFile as readFile7, writeFile as writeFile2 } from "fs/promises";
|
|
1147
1147
|
import { constants } from "fs";
|
|
1148
1148
|
import { isAbsolute as isAbsolute3, join as join8, posix as posix2, resolve as resolve4 } from "path";
|
|
@@ -1911,6 +1911,8 @@ async function runDoctorReport(target) {
|
|
|
1911
1911
|
const rulesDirUnindexed = inspectRulesDirUnindexed(projectRoot, meta);
|
|
1912
1912
|
const stableIdCollision = await inspectStableIdCollisions(projectRoot);
|
|
1913
1913
|
const claudeSkillLegacyPath = inspectClaudeSkillLegacyPath(projectRoot);
|
|
1914
|
+
const claudeHookLegacyPath = inspectClaudeHookLegacyPath(projectRoot);
|
|
1915
|
+
const codexSkillLegacyPath = inspectCodexSkillLegacyPath(projectRoot);
|
|
1914
1916
|
const preexistingRootFiles = inspectPreexistingRootFiles(projectRoot);
|
|
1915
1917
|
const legacyClientPaths = inspectLegacyClientPaths(projectRoot);
|
|
1916
1918
|
const taxonomyExists = existsSync4(join8(projectRoot, ".fabric", "INITIAL_TAXONOMY.md"));
|
|
@@ -1931,6 +1933,8 @@ async function runDoctorReport(target) {
|
|
|
1931
1933
|
createRulesDirUnindexedCheck(rulesDirUnindexed),
|
|
1932
1934
|
createStableIdCollisionCheck(stableIdCollision),
|
|
1933
1935
|
createClaudeSkillLegacyPathCheck(claudeSkillLegacyPath),
|
|
1936
|
+
createClaudeHookLegacyPathCheck(claudeHookLegacyPath),
|
|
1937
|
+
createCodexSkillLegacyPathCheck(codexSkillLegacyPath),
|
|
1934
1938
|
createPreexistingRootFilesCheck(preexistingRootFiles),
|
|
1935
1939
|
createLegacyClientPathCheck(legacyClientPaths)
|
|
1936
1940
|
];
|
|
@@ -2023,6 +2027,14 @@ async function runDoctorFix(target) {
|
|
|
2023
2027
|
await fixClaudeSkillLegacyPath(projectRoot);
|
|
2024
2028
|
fixed.push(findIssue(before.fixable_errors, "claude_skill_legacy_path"));
|
|
2025
2029
|
}
|
|
2030
|
+
if (before.fixable_errors.some((issue) => issue.code === "claude_hook_legacy_path")) {
|
|
2031
|
+
await fixClaudeHookLegacyPath(projectRoot);
|
|
2032
|
+
fixed.push(findIssue(before.fixable_errors, "claude_hook_legacy_path"));
|
|
2033
|
+
}
|
|
2034
|
+
if (before.fixable_errors.some((issue) => issue.code === "codex_skill_legacy_path")) {
|
|
2035
|
+
await fixCodexSkillLegacyPath(projectRoot);
|
|
2036
|
+
fixed.push(findIssue(before.fixable_errors, "codex_skill_legacy_path"));
|
|
2037
|
+
}
|
|
2026
2038
|
if (before.warnings.some((issue) => issue.code === "legacy_client_path_present")) {
|
|
2027
2039
|
await fixLegacyClientPaths(projectRoot);
|
|
2028
2040
|
fixed.push(findIssue(before.warnings, "legacy_client_path_present"));
|
|
@@ -2641,6 +2653,110 @@ async function fixClaudeSkillLegacyPath(projectRoot) {
|
|
|
2641
2653
|
to: newPath
|
|
2642
2654
|
});
|
|
2643
2655
|
}
|
|
2656
|
+
var LEGACY_HOOK_FILENAME = "agents-md-init-reminder.cjs";
|
|
2657
|
+
var NEW_HOOK_FILENAME = "fabric-init-reminder.cjs";
|
|
2658
|
+
function inspectClaudeHookLegacyPath(projectRoot) {
|
|
2659
|
+
const legacyHookPath = join8(projectRoot, ".claude", "hooks", LEGACY_HOOK_FILENAME);
|
|
2660
|
+
const newHookPath = join8(projectRoot, ".claude", "hooks", NEW_HOOK_FILENAME);
|
|
2661
|
+
const settingsPath = join8(projectRoot, ".claude", "settings.json");
|
|
2662
|
+
const hasLegacyFile = existsSync4(legacyHookPath);
|
|
2663
|
+
let hasLegacySettingsCommand = false;
|
|
2664
|
+
if (existsSync4(settingsPath)) {
|
|
2665
|
+
try {
|
|
2666
|
+
const raw = readFileSync(settingsPath, "utf8");
|
|
2667
|
+
hasLegacySettingsCommand = raw.includes(LEGACY_HOOK_FILENAME);
|
|
2668
|
+
} catch {
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
return { hasLegacyFile, hasLegacySettingsCommand, legacyHookPath, newHookPath, settingsPath };
|
|
2672
|
+
}
|
|
2673
|
+
function createClaudeHookLegacyPathCheck(inspection) {
|
|
2674
|
+
if (inspection.hasLegacyFile || inspection.hasLegacySettingsCommand) {
|
|
2675
|
+
return issueCheck(
|
|
2676
|
+
"Claude hook path",
|
|
2677
|
+
"error",
|
|
2678
|
+
"fixable_error",
|
|
2679
|
+
"claude_hook_legacy_path",
|
|
2680
|
+
`.claude/hooks/${LEGACY_HOOK_FILENAME} (or its reference in .claude/settings.json) exists at the legacy path. Run --fix to migrate to ${NEW_HOOK_FILENAME}.`,
|
|
2681
|
+
`Run \`fab doctor --fix\` to rename ${LEGACY_HOOK_FILENAME} to ${NEW_HOOK_FILENAME} and update .claude/settings.json hook commands.`
|
|
2682
|
+
);
|
|
2683
|
+
}
|
|
2684
|
+
return okCheck("Claude hook path", `.claude/hooks/${NEW_HOOK_FILENAME} is at the canonical path (or not present).`);
|
|
2685
|
+
}
|
|
2686
|
+
async function fixClaudeHookLegacyPath(projectRoot) {
|
|
2687
|
+
const { hasLegacyFile, hasLegacySettingsCommand, legacyHookPath, newHookPath, settingsPath } = inspectClaudeHookLegacyPath(projectRoot);
|
|
2688
|
+
if (hasLegacyFile) {
|
|
2689
|
+
if (existsSync4(newHookPath)) {
|
|
2690
|
+
unlinkSync(legacyHookPath);
|
|
2691
|
+
} else {
|
|
2692
|
+
mkdirSync(join8(newHookPath, ".."), { recursive: true });
|
|
2693
|
+
renameSync(legacyHookPath, newHookPath);
|
|
2694
|
+
}
|
|
2695
|
+
}
|
|
2696
|
+
if (hasLegacySettingsCommand) {
|
|
2697
|
+
try {
|
|
2698
|
+
const raw = readFileSync(settingsPath, "utf8");
|
|
2699
|
+
const updated = raw.split(LEGACY_HOOK_FILENAME).join(NEW_HOOK_FILENAME);
|
|
2700
|
+
if (updated !== raw) {
|
|
2701
|
+
const parsed = JSON.parse(updated);
|
|
2702
|
+
await atomicWriteJson2(settingsPath, parsed);
|
|
2703
|
+
}
|
|
2704
|
+
} catch {
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
if (hasLegacyFile || hasLegacySettingsCommand) {
|
|
2708
|
+
await appendEventLedgerEvent(projectRoot, {
|
|
2709
|
+
event_type: "claude_hook_path_migrated",
|
|
2710
|
+
from: legacyHookPath,
|
|
2711
|
+
to: newHookPath
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
function inspectCodexSkillLegacyPath(projectRoot) {
|
|
2716
|
+
const legacyPath = join8(projectRoot, ".agents", "skills", "fabric-init", "SKILL.md");
|
|
2717
|
+
const newPath = join8(projectRoot, ".codex", "skills", "fabric-init", "SKILL.md");
|
|
2718
|
+
const hasLegacy = existsSync4(legacyPath) && !existsSync4(newPath);
|
|
2719
|
+
return { hasLegacy, legacyPath, newPath };
|
|
2720
|
+
}
|
|
2721
|
+
function createCodexSkillLegacyPathCheck(inspection) {
|
|
2722
|
+
if (inspection.hasLegacy) {
|
|
2723
|
+
return issueCheck(
|
|
2724
|
+
"Codex skill path",
|
|
2725
|
+
"error",
|
|
2726
|
+
"fixable_error",
|
|
2727
|
+
"codex_skill_legacy_path",
|
|
2728
|
+
`.agents/skills/fabric-init/SKILL.md exists at the legacy path. Codex CLI reads repo skills from .codex/skills/, not .agents/skills/. Run --fix to migrate it to .codex/skills/fabric-init/SKILL.md (user edits preserved).`,
|
|
2729
|
+
"Run `fab doctor --fix` to move .agents/skills/fabric-init/ to .codex/skills/fabric-init/, preserving any user edits to SKILL.md."
|
|
2730
|
+
);
|
|
2731
|
+
}
|
|
2732
|
+
return okCheck("Codex skill path", ".codex/skills/fabric-init/SKILL.md is at the canonical path (or not present).");
|
|
2733
|
+
}
|
|
2734
|
+
async function fixCodexSkillLegacyPath(projectRoot) {
|
|
2735
|
+
const { hasLegacy, legacyPath, newPath } = inspectCodexSkillLegacyPath(projectRoot);
|
|
2736
|
+
if (!hasLegacy) {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
mkdirSync(join8(newPath, ".."), { recursive: true });
|
|
2740
|
+
renameSync(legacyPath, newPath);
|
|
2741
|
+
const legacyDir = join8(legacyPath, "..");
|
|
2742
|
+
try {
|
|
2743
|
+
rmdirSync(legacyDir);
|
|
2744
|
+
} catch {
|
|
2745
|
+
}
|
|
2746
|
+
try {
|
|
2747
|
+
rmdirSync(join8(legacyDir, ".."));
|
|
2748
|
+
} catch {
|
|
2749
|
+
}
|
|
2750
|
+
try {
|
|
2751
|
+
rmdirSync(join8(legacyDir, "..", ".."));
|
|
2752
|
+
} catch {
|
|
2753
|
+
}
|
|
2754
|
+
await appendEventLedgerEvent(projectRoot, {
|
|
2755
|
+
event_type: "codex_skill_path_migrated",
|
|
2756
|
+
from: legacyPath,
|
|
2757
|
+
to: newPath
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2644
2760
|
function inspectLegacyClientPaths(projectRoot) {
|
|
2645
2761
|
const configPath = join8(projectRoot, "fabric.config.json");
|
|
2646
2762
|
if (!existsSync4(configPath)) {
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
runDoctorReport,
|
|
23
23
|
stableStringify,
|
|
24
24
|
writeRuleMeta
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZZGARZL5.js";
|
|
26
26
|
|
|
27
27
|
// src/index.ts
|
|
28
28
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -312,7 +312,7 @@ function formatPreexistingRootMessage(projectRoot) {
|
|
|
312
312
|
function createFabricServer(tracker) {
|
|
313
313
|
const server = new McpServer({
|
|
314
314
|
name: "fabric-context-server",
|
|
315
|
-
version: "1.8.0-rc.
|
|
315
|
+
version: "1.8.0-rc.3"
|
|
316
316
|
});
|
|
317
317
|
registerPlanContext(server, tracker);
|
|
318
318
|
registerRuleSections(server, tracker);
|
|
@@ -406,7 +406,7 @@ function createShutdownHandler(deps) {
|
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
async function startHttpServer(options) {
|
|
409
|
-
const { createFabricHttpApp } = await import("./http-
|
|
409
|
+
const { createFabricHttpApp } = await import("./http-PXFWUKCA.js");
|
|
410
410
|
const { port, projectRoot, host = "127.0.0.1", authToken, dashboardDistPath, dev } = options;
|
|
411
411
|
const app = createFabricHttpApp({ projectRoot, host, authToken, dashboardDistPath, dev });
|
|
412
412
|
return await new Promise((resolveServer, rejectServer) => {
|