@bitflower/va-mcp 1.0.1 → 1.0.2

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/dist/index.js +28 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { Command, CommanderError } from "commander";
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@bitflower/va-mcp",
11
- version: "1.0.1",
11
+ version: "1.0.2",
12
12
  description: "Install the Virtual Architect MCP server and SessionStart playbook into a Claude Code project.",
13
13
  repository: {
14
14
  type: "git",
@@ -283,6 +283,7 @@ function pruneSettingsLocal(projectDir) {
283
283
  }
284
284
 
285
285
  // src/gitignore-check.ts
286
+ import { spawnSync as spawnSync2 } from "child_process";
286
287
  import * as fs3 from "fs";
287
288
  import * as path3 from "path";
288
289
  var SETTINGS_RELPATH = ".claude/settings.local.json";
@@ -321,8 +322,34 @@ function isPathIgnored(projectDir, relpath) {
321
322
  }
322
323
  return ignored;
323
324
  }
325
+ var GIT_CHECK_IGNORE_TIMEOUT_MS = 5e3;
326
+ function gitConfirmsIgnored(projectDir, relpath) {
327
+ const probe = spawnSync2("git", ["check-ignore", "-q", "--", relpath], {
328
+ cwd: projectDir,
329
+ timeout: GIT_CHECK_IGNORE_TIMEOUT_MS,
330
+ windowsHide: true
331
+ });
332
+ if (probe.error) return null;
333
+ if (probe.status === 0) return true;
334
+ if (probe.status === 1) return false;
335
+ return null;
336
+ }
324
337
  function checkGitignorePrecondition(projectDir) {
325
338
  if (!isInsideGitWorkTree(projectDir)) return;
339
+ const gitVerdict = gitConfirmsIgnored(projectDir, SETTINGS_RELPATH);
340
+ if (gitVerdict === true) return;
341
+ if (gitVerdict === false) {
342
+ throw new InstallerError(
343
+ `refusing to write ${SETTINGS_RELPATH} into a git work tree \u2014 git reports it is not ignored, so it could be committed. Add an entry that ignores it to a \`.gitignore\` (in a monorepo the repo-root file works too):
344
+
345
+ ${SETTINGS_RELPATH}
346
+
347
+ If the file is already tracked, a .gitignore entry will not help \u2014 untrack it first:
348
+
349
+ git rm --cached ${SETTINGS_RELPATH}
350
+ `
351
+ );
352
+ }
326
353
  if (isPathIgnored(projectDir, SETTINGS_RELPATH)) return;
327
354
  throw new InstallerError(
328
355
  `refusing to write ${SETTINGS_RELPATH} into a git work tree. The installer's plain-text gitignore scan found no exact-path or directory-prefix entry that ignores it (globs like '.claude/*' and '!' negation lines are NOT evaluated \u2014 we err on the safe side and refuse if there is any chance the file ends up tracked). To proceed, add an exact entry to ${path3.join(projectDir, ".gitignore")}:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitflower/va-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Install the Virtual Architect MCP server and SessionStart playbook into a Claude Code project.",
5
5
  "repository": {
6
6
  "type": "git",