@handsupmin/gc-tree 0.7.4 → 0.7.6

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/src/hook.js CHANGED
@@ -115,7 +115,7 @@ export async function dispatchGcTreeHook({ event, home, payload, }) {
115
115
  },
116
116
  };
117
117
  }
118
- const prompt = normalizeText(payload.user_prompt || '');
118
+ const prompt = normalizeText(payload.user_prompt || payload.prompt || '');
119
119
  if (!prompt)
120
120
  return null;
121
121
  const branchStatus = await statusForBranch(home, gcBranch);
@@ -73,13 +73,16 @@ export async function detectCurrentRepoId(startDir = process.cwd()) {
73
73
  const root = await detectRepoRoot(startDir);
74
74
  return root ? basename(root) : null;
75
75
  }
76
+ function repoMatches(entry, repo) {
77
+ return entry === repo || basename(entry) === repo || entry === basename(repo);
78
+ }
76
79
  export function branchScopeStatus(mapping, branch, repo) {
77
80
  if (!repo)
78
81
  return 'unscoped';
79
82
  const rule = normalizeRule(mapping[branch]);
80
- if (rule.exclude?.includes(repo))
83
+ if (rule.exclude?.some((e) => repoMatches(e, repo)))
81
84
  return 'excluded';
82
- if (rule.include?.includes(repo))
85
+ if (rule.include?.some((e) => repoMatches(e, repo)))
83
86
  return 'included';
84
87
  if ((rule.include?.length || 0) > 0 || (rule.exclude?.length || 0) > 0)
85
88
  return 'unmapped';
@@ -98,7 +101,7 @@ export async function resolveBranchForRepo({ home, head, explicitBranch, cwd = p
98
101
  }
99
102
  if (currentRepo) {
100
103
  const includedBranches = Object.entries(mapping)
101
- .filter(([, rule]) => !rule.exclude?.includes(currentRepo) && rule.include?.includes(currentRepo))
104
+ .filter(([, rule]) => !rule.exclude?.some((e) => repoMatches(e, currentRepo)) && rule.include?.some((e) => repoMatches(e, currentRepo)))
102
105
  .map(([branch]) => branch)
103
106
  .sort();
104
107
  if (includedBranches.length === 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsupmin/gc-tree",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "Global Context Tree, a lightweight branch-aware global context orchestrator for AI coding tools",
5
5
  "type": "module",
6
6
  "private": false,