@handsupmin/gc-tree 0.8.9 → 0.8.11

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
@@ -26,7 +26,12 @@ function limitMatches(matches, max = 3) {
26
26
  }
27
27
  function formatMatches(matches) {
28
28
  return limitMatches(matches)
29
- .map((match, index) => `${index + 1}. ${match.title} [${match.id}]`)
29
+ .map((match, index) => {
30
+ const summary = match.summary?.trim();
31
+ return summary
32
+ ? `${index + 1}. ${match.title} [${match.id}]\n > ${summary}`
33
+ : `${index + 1}. ${match.title} [${match.id}]`;
34
+ })
30
35
  .join('\n');
31
36
  }
32
37
  function buildSessionStartContext({ gcBranch, currentRepo, repoScopeStatus, }) {
@@ -45,7 +50,7 @@ function buildMatchContext({ gcBranch, currentRepo, repoScopeStatus, matches, })
45
50
  const lines = [
46
51
  `[gc-tree] USE FIRST: ${Math.min(matches.length, 3)} docs gc-branch="${gcBranch}" repo="${currentRepo || 'unscoped'}" scope=${repoScopeStatus}.`,
47
52
  formatMatches(matches),
48
- `Rule: apply these docs before tools; if insufficient, open full doc: gctree resolve --id <id>`,
53
+ `Rule: summaries above are mandatory context read them now. Only run \`gctree resolve --id <id>\` if a summary is insufficient for the task.`,
49
54
  ];
50
55
  if (repoScopeStatus === 'unmapped' && currentRepo) {
51
56
  lines.push(`Note: repo "${currentRepo}" is unmapped. If it belongs here, offer to run: gctree set-repo-scope --branch ${gcBranch} --include`);
@@ -51,7 +51,13 @@ export async function selfUpdate(home) {
51
51
  process.stderr.write(`Found ${hosts.length} scaffolded provider(s): ${hosts.map((h) => `${h.host}(${h.scope})`).join(', ')}\n`);
52
52
  }
53
53
  process.stderr.write('\nUpdating gctree to latest...\n');
54
- execSync('npm install -g @handsupmin/gc-tree@latest', { stdio: 'inherit' });
54
+ try {
55
+ execSync('npm install -g @handsupmin/gc-tree', { stdio: 'inherit' });
56
+ }
57
+ catch {
58
+ process.stderr.write('\nnpm registry may not have propagated the latest version yet. Wait a minute and retry: gctree update\n');
59
+ process.exit(1);
60
+ }
55
61
  if (hosts.length > 0) {
56
62
  process.stderr.write('\nRe-scaffolding providers with new version...\n');
57
63
  for (const record of hosts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsupmin/gc-tree",
3
- "version": "0.8.9",
3
+ "version": "0.8.11",
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,