fullcourtdefense-cli 1.15.7 → 1.15.8

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.
@@ -138,6 +138,9 @@ function runDiscoverSweep(timeoutMs = 300_000) {
138
138
  const child = (0, child_process_1.spawn)(process.execPath, [cliEntry(), 'discover', '--upload', '--surface', 'all', '--silent'], {
139
139
  windowsHide: true,
140
140
  stdio: 'ignore',
141
+ // Daemon/scheduled-task cwd is C:\WINDOWS\system32 — scan from the user's
142
+ // home so the posture scope reports a meaningful folder, not an OS dir.
143
+ cwd: os.homedir(),
141
144
  });
142
145
  const timer = setTimeout(() => {
143
146
  child.kill();
@@ -123,6 +123,15 @@ function buildHostMetadata(userEmail, probeMode = 'config') {
123
123
  function candidateConfigPaths(cwd, extra) {
124
124
  return (0, discoverPaths_1.discoverScanTargets)(cwd, extra);
125
125
  }
126
+ /** True when a path is an operating-system folder (daemon/scheduled-task cwd), never a real project. */
127
+ function isOsSystemFolder(dir) {
128
+ const normalized = path.resolve(dir).toLowerCase();
129
+ if (process.platform === 'win32') {
130
+ const windir = (process.env.SystemRoot || 'C:\\Windows').toLowerCase();
131
+ return normalized === windir || normalized.startsWith(`${windir}${path.sep}`) || /^[a-z]:\\$/.test(normalized);
132
+ }
133
+ return normalized === '/' || ['/usr', '/bin', '/sbin', '/etc', '/var'].some(root => normalized === root || normalized.startsWith(`${root}/`));
134
+ }
126
135
  /** Dot-dirs that hold a client's project config; the real project root is their parent. */
127
136
  const CONFIG_DOT_DIRS = new Set(['.cursor', '.claude', '.codex', '.vscode', '.gemini', '.kiro']);
128
137
  /** Map discovered project config file paths back to their owning project folders. */
@@ -797,7 +806,12 @@ async function discoverCommand(args, config) {
797
806
  }
798
807
  return;
799
808
  }
800
- const cwd = process.cwd();
809
+ // Scheduled tasks and the daemon run with cwd=C:\WINDOWS\system32 (or "/" on
810
+ // POSIX). Scanning "the current project folder" from an OS directory is
811
+ // meaningless and confusing in the dashboard scan-scope report — fall back to
812
+ // the user's home, which is where all the AI-dev roots we scan live anyway.
813
+ const rawCwd = process.cwd();
814
+ const cwd = isOsSystemFolder(rawCwd) ? os.homedir() : rawCwd;
801
815
  const runMcp = surfaces.has('mcp');
802
816
  const scanned = [];
803
817
  let found = [];
@@ -882,7 +896,9 @@ async function discoverCommand(args, config) {
882
896
  workingDirectory: cwd,
883
897
  mcpConfigPaths: scanned.map(s => ({ ...s, exists: fs.existsSync(s.path) })),
884
898
  included: [
885
- `Current command folder: ${cwd}`,
899
+ cwd === rawCwd
900
+ ? `Current command folder: ${cwd}`
901
+ : `User home folder: ${cwd} (scan started by the background daemon/scheduler)`,
886
902
  'Known MCP/AI client config files for Cursor, Claude, Codex, Gemini, Windsurf, and VS Code',
887
903
  `User-level AI rules, skills, hooks, and instruction files under ${home}`,
888
904
  `Credential stores and shell history under ${home}`,
package/dist/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.15.7"
2
+ "version": "1.15.8"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fullcourtdefense-cli",
3
- "version": "1.15.7",
3
+ "version": "1.15.8",
4
4
  "description": "Full Court Defense CLI — security scanning for AI agents from your terminal",
5
5
  "main": "dist/index.js",
6
6
  "bin": {