cc-hindsight 1.3.0 → 1.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/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import { stripVTControlCharacters, styleText } from "node:util";
10
10
  import readline from "node:readline";
11
11
  import { spinner } from "@clack/prompts";
12
12
  //#region package.json
13
- var version = "1.3.0";
13
+ var version = "1.3.1";
14
14
  var description = "Mine your coding-agent session history (Claude Code, kiro-cli) into a oneshot prompt library and CLAUDE.md/AGENTS.md preferences. The prompt you'd write if you knew then what you know now.";
15
15
  //#endregion
16
16
  //#region src/commands/_shared.ts
@@ -30,7 +30,7 @@ const sharedArgs = {
30
30
  },
31
31
  source: {
32
32
  type: "string",
33
- description: "Which backend(s) to read: claude, kiro, or auto (default: auto)"
33
+ description: "Which backend(s) to read: claude, kiro, or auto (default: auto). Pass after the subcommand"
34
34
  }
35
35
  };
36
36
  /**
@@ -5605,6 +5605,38 @@ var status_default = defineCommand({
5605
5605
  });
5606
5606
  //#endregion
5607
5607
  //#region src/main.ts
5608
+ /**
5609
+ * Publish root-level path flags so the dispatched subcommand honors them.
5610
+ *
5611
+ * `--help` presents `--home`, `--claude-dir` and `--kiro-dir` as ROOT options,
5612
+ * but citty does not thread a parent's parsed args into a subcommand: each one
5613
+ * re-declares the same names and reads only its own. So `cc-hindsight --home X
5614
+ * export` parsed `--home`, dropped it, and wrote to the DEFAULT store. The
5615
+ * failure was silent and it targeted exactly the flags that decide where data
5616
+ * is read from and written to (observed for real: an `export` intended for a
5617
+ * scratch dir ran against the live store and pruned it).
5618
+ *
5619
+ * The fix rides the precedence `resolvePaths` already implements
5620
+ * (flag > env > default): write the root flag into the environment, so it beats
5621
+ * the default while a subcommand-level flag still beats it. Only ever fills a
5622
+ * variable the user did not set, so `CC_HINDSIGHT_HOME=… cc-hindsight …` is
5623
+ * untouched. Runs in `setup`, which citty calls BEFORE the subcommand; the root
5624
+ * `run` fires after it and would be too late.
5625
+ *
5626
+ * When both placements are given, citty parses them into one flat namespace and
5627
+ * the later (subcommand-level) value wins, which is the specific-beats-general
5628
+ * behavior a reader expects.
5629
+ */
5630
+ function publishRootPaths(args) {
5631
+ for (const [flag, envVar] of Object.entries({
5632
+ home: "CC_HINDSIGHT_HOME",
5633
+ "claude-dir": "CLAUDE_CONFIG_DIR",
5634
+ "kiro-dir": "KIRO_CONFIG_DIR"
5635
+ })) {
5636
+ const value = args[flag];
5637
+ if (typeof value === "string" && value !== "") process.env[envVar] = value;
5638
+ }
5639
+ }
5608
5640
  /** Root command. Running with no subcommand performs the safe default: scan. */
5609
5641
  const main = defineCommand({
5610
5642
  meta: {
@@ -5613,6 +5645,9 @@ const main = defineCommand({
5613
5645
  description
5614
5646
  },
5615
5647
  args: { ...sharedArgs },
5648
+ setup({ args }) {
5649
+ publishRootPaths(args);
5650
+ },
5616
5651
  subCommands: {
5617
5652
  scan: scan_default,
5618
5653
  export: export_default,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "cc-hindsight",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "cc-hindsight",
9
- "version": "1.3.0",
9
+ "version": "1.3.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@clack/prompts": "1.7.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-hindsight",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Mine your coding-agent session history (Claude Code, kiro-cli) into a oneshot prompt library and CLAUDE.md/AGENTS.md preferences. The prompt you'd write if you knew then what you know now.",
5
5
  "type": "module",
6
6
  "author": "Aditya Singhal (https://adityasinghal.com)",