@handsupmin/gc-tree 0.8.19 → 1.0.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/docs/usage.zh.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 概述
6
6
 
7
- 标准的 `gctree` 工作流如下:初始化 gc-tree、选择提供商、对默认的 `main` gc-branch 执行 onboard、解析所需上下文、在工作需要独立空间时创建新的 gc-branch、将代码仓库映射到正确的 gc-branch,以及在后续使用有引导的更新流程进行持久化变更。
7
+ 标准的 `gctree` 工作流如下:初始化 gc-tree、选择提供商、对默认的 `main` gc-branch 执行 onboard、解析所需上下文、在工作需要独立空间时创建新的 gc-branch、将代码仓库映射到正确的 gc-branch、在后续使用有引导的流程更新持久化上下文,并在需要刷新 CLI 和已安装 provider 集成时运行 `gctree update`。
8
8
 
9
9
  ## 标准工作流
10
10
 
@@ -19,7 +19,8 @@
19
19
  9. 使用 `gctree checkout` 创建或切换 gc-branch
20
20
  10. 仅对空的 gc-branch 运行 `gctree onboard`
21
21
  11. 使用仓库作用范围映射,使 gc-branch 只在其适用的地方生效
22
- 12. 使用 `gctree update-global-context` 进行后续的持久化变更
22
+ 12. 使用 `gctree update-global-context` 进行后续的持久化上下文变更
23
+ 13. 使用 `gctree update` 更新 gc-tree 本身并重新安装已安装的 provider
23
24
 
24
25
  ## 核心命令
25
26
 
@@ -41,6 +42,7 @@
41
42
  | `gctree update-global-context` | 为活跃的 gc-branch 启动有引导的持久化更新。 |
42
43
  | `gctree update-gc` / `gctree ugc` | `gctree update-global-context` 的别名。 |
43
44
  | `gctree scaffold --host <codex\|claude-code>` | 在单个仓库或工作区中安装本地 provider override。 |
45
+ | `gctree update` | 将 gctree 更新到最新 npm 版本,并重新安装所有已有 provider。 |
44
46
  | `gctree uninstall --yes` | 删除 `~/.gctree` 和全局 gctree 激活。 |
45
47
 
46
48
  ## resolve 返回的内容
@@ -51,40 +53,22 @@
51
53
  gctree resolve --query "auth token rotation policy"
52
54
  ```
53
55
 
54
- ```json
55
- {
56
- "gc_branch": "main",
57
- "query": "auth token rotation policy",
58
- "status": "matched",
59
- "matches": [
60
- {
61
- "id": "auth",
62
- "title": "Auth & Session Conventions",
63
- "path": "docs/auth.md",
64
- "score": 4,
65
- "summary": "JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL",
66
- "excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request...",
67
- "commands": {
68
- "show_doc": "gctree show-doc --id \"auth\" --home \"~/.gctree\" --branch \"main\"",
69
- "related": "gctree related --id \"auth\" --home \"~/.gctree\" --branch \"main\""
70
- }
71
- }
72
- ]
73
- }
56
+ ```
57
+ [gc-tree] 1 matching doc gc-branch="main" repo="my-repo"
58
+ [Auth & Session Conventions] JWT rotation on every request, refresh tokens in httpOnly cookies, 15-min access token TTL
59
+ [Auth & Session Conventions] show full doc: gctree show-doc --id "auth" --branch "main"
74
60
  ```
75
61
 
76
62
  推荐的流程是:
77
63
 
78
64
  1. `resolve` → 紧凑索引
79
- 2. `related` → 某个匹配周围的 supporting docs
80
- 3. `show-doc` → 仅在需要时读取完整 markdown
65
+ 2. `show-doc` → 仅在需要时读取完整 markdown
81
66
 
82
67
  Graceful degradation 也是显式的:
83
68
 
84
- - 空 gc-branch → `status: "empty_branch"`
85
- - 被排除的 repo → `status: "excluded"`
86
- - 无匹配结果 → `status: "no_match"`
87
- - 文档 ID 不存在 → `status: "doc_not_found"`
69
+ - 空 gc-branch → 纯文本提示:该 gc-branch 为空
70
+ - 被排除的 repo → 纯文本提示:该 repo 已被排除
71
+ - 无匹配结果 → 纯文本提示:没有匹配项
88
72
 
89
73
  ## 仓库作用范围示例流程
90
74
 
@@ -128,7 +112,7 @@ gctree init
128
112
  ## 多分支示例流程
129
113
 
130
114
  ```bash
131
- gctree checkout -b client-b
115
+ gctree checkout -b project-b
132
116
  gctree onboard
133
117
  gctree resolve --query "billing retry policy"
134
118
  ```
@@ -151,13 +135,21 @@ gctree ugc
151
135
  1. 将该仓库映射到 gc-branch
152
136
  2. 然后运行 `update-global-context`,添加关于该仓库用途及重要性的持久化知识
153
137
 
138
+ ## 工具更新示例流程
139
+
140
+ ```bash
141
+ gctree update
142
+ ```
143
+
144
+ 这会将 `@handsupmin/gc-tree` 更新到最新 npm 版本,并重新安装通过 `gctree init` 或 `gctree scaffold` 已安装的所有 provider。当新的 hook、command、skill 或集成片段发布时,可以用它进行维护更新。
145
+
154
146
  ## 集成模式
155
147
 
156
148
  ### Codex CLI / Claude Code CLI
157
149
 
158
150
  `gctree init` 会安装全局 provider hook 表面。`gctree scaffold` 则在某个仓库需要自己的 markdown 片段或本地命令表面时,将本地 override 安装到目标目录中。
159
151
 
160
- UserPromptSubmit hook 只注入紧凑的 pre-task context:found/no-match 状态以及匹配文档的标题/ID。默认不内联摘要或长 excerpt;需要时用 `gctree resolve --id <id>` 打开完整文档。
152
+ UserPromptSubmit hook 会在每次提示词前将匹配文档的摘要直接注入上下文——让 AI 看到的是真实的模式和命令,而不只是标题。当摘要过短或过于笼统时,hook 会回退到文档正文的摘录。完整文档随时可通过 `gctree resolve --id <id>` 按需获取。
161
153
 
162
154
  ```bash
163
155
  gctree scaffold --host codex --target /path/to/repo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsupmin/gc-tree",
3
- "version": "0.8.19",
3
+ "version": "1.0.1",
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,
@@ -27,9 +27,7 @@
27
27
  "eval:multi-repo:verbose": "node --import tsx tests/eval/multi-repo.ts --verbose",
28
28
  "eval:autoresearch": "node --import tsx tests/eval/autoresearch.ts",
29
29
  "eval:multilingual": "node --import tsx tests/eval/multilingual.ts",
30
- "eval:multilingual:verbose": "node --import tsx tests/eval/multilingual.ts --verbose",
31
- "eval:real-docs": "node --import tsx tests/eval/real-docs.ts",
32
- "eval:real-docs:verbose": "node --import tsx tests/eval/real-docs.ts --verbose"
30
+ "eval:multilingual:verbose": "node --import tsx tests/eval/multilingual.ts --verbose"
33
31
  },
34
32
  "engines": {
35
33
  "node": ">=20"