triflux 10.3.0 → 10.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "10.3.0",
3
+ "version": "10.3.1",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,7 +3,18 @@ import { join, resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { TFX_START, OMC_END, writeSection } from "./lib/claudemd-scanner.mjs";
5
5
 
6
- const PROJECT_ROOT = fileURLToPath(new URL("..", import.meta.url));
6
+ import { execFileSync } from "node:child_process";
7
+
8
+ function resolveProjectRoot() {
9
+ // 1. git root (가장 신뢰)
10
+ try {
11
+ return execFileSync("git", ["rev-parse", "--show-toplevel"], { encoding: "utf8" }).trim();
12
+ } catch { /* not a git repo */ }
13
+ // 2. cwd fallback (npm 사용자 등)
14
+ return process.cwd();
15
+ }
16
+
17
+ const PROJECT_ROOT = resolveProjectRoot();
7
18
  const PROJECT_CLAUDE_MD_PATH = join(PROJECT_ROOT, "CLAUDE.md");
8
19
  const ROUTING_TAG_OPEN = "<routing>";
9
20
  const ROUTING_TAG_CLOSE = "</routing>";