metheus-governance-mcp-cli 0.2.20 → 0.2.21

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.
Files changed (2) hide show
  1. package/cli.mjs +19 -20
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -1913,7 +1913,7 @@ async function runDoctor(flags) {
1913
1913
  );
1914
1914
 
1915
1915
  const syncStatus = String(summary.ctxpack_sync_status || "").trim();
1916
- if (["downloaded", "updated", "current"].includes(syncStatus)) {
1916
+ if (["downloaded", "updated", "current", "home_fallback"].includes(syncStatus)) {
1917
1917
  addDoctorCheck(
1918
1918
  rows,
1919
1919
  "ok",
@@ -2489,20 +2489,15 @@ function syncCtxpackToLocalCache({
2489
2489
  const status = String(ctxpack?.status || "").trim() || "draft";
2490
2490
  const files = normalizeCtxpackFiles(ctxpack?.files);
2491
2491
  const resolvedWorkspaceDir = resolveWorkspaceDir(workspaceDir);
2492
- const cacheDir = path.join(ctxpackCacheRootDir(resolvedWorkspaceDir), projectID);
2492
+ const isHomeFallback = isHomeWorkspaceRoot(resolvedWorkspaceDir) && !allowHomeWorkspaceRoot();
2493
+ const cacheDir = path.join(
2494
+ isHomeFallback ? homeCtxpackCacheRootDir() : ctxpackCacheRootDir(resolvedWorkspaceDir),
2495
+ projectID,
2496
+ );
2493
2497
  const metaPath = path.join(cacheDir, CTXPACK_META_FILENAME);
2494
- const workspaceMetaPath = path.join(resolvedWorkspaceDir, CTXPACK_META_FILENAME);
2495
-
2496
- if (isHomeWorkspaceRoot(resolvedWorkspaceDir) && !allowHomeWorkspaceRoot()) {
2497
- return {
2498
- sync_status: "guarded",
2499
- sync_message:
2500
- "Workspace root resolved to home directory. Guardrail blocked ctxpack local write. Use --workspace-dir <project_path> or --workspace-dir auto.",
2501
- local_path: cacheDir,
2502
- workspace_path: resolvedWorkspaceDir,
2503
- local_file_count: 0,
2504
- };
2505
- }
2498
+ const workspaceMetaPath = isHomeFallback
2499
+ ? metaPath
2500
+ : path.join(resolvedWorkspaceDir, CTXPACK_META_FILENAME);
2506
2501
 
2507
2502
  if (!workspaceSignalTrusted) {
2508
2503
  return {
@@ -2549,8 +2544,10 @@ function syncCtxpackToLocalCache({
2549
2544
  // Best-effort metadata refresh for workspace-root auto-detection.
2550
2545
  }
2551
2546
  return {
2552
- sync_status: "current",
2553
- sync_message: "Local ctxpack cache is up to date.",
2547
+ sync_status: isHomeFallback ? "home_fallback" : "current",
2548
+ sync_message: isHomeFallback
2549
+ ? "Ctxpack cached in home directory. Workspace was not detected; use --workspace-dir for project-local cache."
2550
+ : "Local ctxpack cache is up to date.",
2554
2551
  local_path: cacheDir,
2555
2552
  workspace_path: resolvedWorkspaceDir,
2556
2553
  local_file_count: files.length,
@@ -2571,10 +2568,12 @@ function syncCtxpackToLocalCache({
2571
2568
  fs.writeFileSync(workspaceMetaPath, `${JSON.stringify(payload, null, 2)}\n`, "utf8");
2572
2569
 
2573
2570
  return {
2574
- sync_status: previousMeta ? "updated" : "downloaded",
2575
- sync_message: previousMeta
2576
- ? "Ctxpack updated to latest server version."
2577
- : "Ctxpack downloaded to local cache.",
2571
+ sync_status: isHomeFallback ? "home_fallback" : (previousMeta ? "updated" : "downloaded"),
2572
+ sync_message: isHomeFallback
2573
+ ? "Ctxpack cached in home directory. Workspace was not detected; use --workspace-dir for project-local cache."
2574
+ : (previousMeta
2575
+ ? "Ctxpack updated to latest server version."
2576
+ : "Ctxpack downloaded to local cache."),
2578
2577
  local_path: cacheDir,
2579
2578
  workspace_path: resolvedWorkspaceDir,
2580
2579
  local_file_count: files.length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metheus-governance-mcp-cli",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "Metheus Governance MCP CLI (setup + stdio proxy)",
5
5
  "type": "module",
6
6
  "files": [