fapony 0.6.1 → 0.6.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/package.json +1 -1
  2. package/src/init.ts +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fapony",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Token usage across Claude Code, OpenCode, Codex & ZCode on one yardstick — plus a project mem log and convention-debt tracker agents query via 3 MCP tools. No server, your data stays local",
5
5
  "license": "MIT",
6
6
  "author": "delamind (https://github.com/kire21b)",
package/src/init.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  existsSync,
9
9
  mkdirSync,
10
10
  readFileSync,
11
+ realpathSync,
11
12
  writeFileSync,
12
13
  } from "node:fs";
13
14
  import { dirname, join, relative } from "node:path";
@@ -209,9 +210,16 @@ export function rulesTargets(targetPath: string): {
209
210
  create: boolean;
210
211
  append: string[];
211
212
  } {
212
- const found = AGENT_RULE_FILES.map((f) => join(targetPath, f)).filter(
213
- existsSync,
214
- );
213
+ // one real file per entry: AGENTS.md -> CLAUDE.md symlinks are common, and
214
+ // appending through both names wrote the rules twice (wt-falsify 2026-09-24)
215
+ const seen = new Set<string>();
216
+ const found = AGENT_RULE_FILES.map((f) => join(targetPath, f)).filter((f) => {
217
+ if (!existsSync(f)) return false;
218
+ const real = realpathSync(f);
219
+ if (seen.has(real)) return false;
220
+ seen.add(real);
221
+ return true;
222
+ });
215
223
  const has = (f: string) => readFileSync(f, "utf-8").includes(RULES_MARKER);
216
224
  const agents = join(targetPath, "AGENTS.md");
217
225
  // a CLAUDE.md that imports a rules-carrying AGENTS.md already has them