@c4a/context-cli 0.6.2 → 0.6.3

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 (41) hide show
  1. package/README.md +30 -3
  2. package/README.zh-CN.md +29 -3
  3. package/cli.js +23732 -20136
  4. package/docs/context-debug-event-v1.schema.json +29 -0
  5. package/docs/context-debug-replay-v1.schema.json +33 -0
  6. package/docs/debug-tracing.md +86 -0
  7. package/docs/quickstart.md +1 -1
  8. package/package.json +7 -4
  9. package/plugins/VERSION +1 -1
  10. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  11. package/plugins/claude/commands/continue.md +19 -14
  12. package/plugins/claude/commands/init.md +3 -1
  13. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  14. package/plugins/codex/skills/continue/SKILL.md +19 -14
  15. package/plugins/codex/skills/init/SKILL.md +2 -0
  16. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  17. package/plugins/cursor/commands/context-continue.md +19 -14
  18. package/plugins/cursor/commands/context-init.md +3 -1
  19. package/plugins/skills/context-continue/SKILL.md +19 -14
  20. package/plugins/skills/context-init/SKILL.md +2 -0
  21. package/providers/context/actions/inspect-repository-recovery.yaml +6 -0
  22. package/providers/context/actions/reconcile-review-identities.yaml +5 -0
  23. package/providers/context/actions/repair-verification.yaml +3 -3
  24. package/providers/context/actions/restore-repository-sources.yaml +7 -0
  25. package/providers/context/codes.yaml +2 -1
  26. package/providers/context/graphs/workspace.yaml +49 -7
  27. package/providers/context/manifest.json +94 -31
  28. package/providers/context/provider.yaml +1 -1
  29. package/providers/context/resources/dialogue/repository-source-recovery.md +23 -0
  30. package/providers/context/resources/manuals/guides/lark-resources.md +121 -0
  31. package/providers/context/resources/manuals/guides/package-outputs.md +8 -0
  32. package/providers/context/resources/manuals/reference/project-api.md +43 -7
  33. package/providers/context/resources/procedures/close-and-build.md +5 -3
  34. package/providers/context/resources/procedures/document-capture.md +5 -1
  35. package/providers/context/resources/procedures/knowledge-review.md +10 -0
  36. package/providers/context/resources/procedures/repository-source-recovery.md +43 -0
  37. package/providers/context/resources/procedures/source-capture-detailed.md +13 -0
  38. package/providers/context/resources/procedures/verify-and-repair.md +12 -0
  39. package/providers/context/resources/views/source-boundary.yaml +6 -0
  40. package/providers/context/schemas/repository-source-recovery.schema.json +40 -0
  41. package/providers/context/actions/ensure-repository-sources.yaml +0 -5
package/README.md CHANGED
@@ -37,6 +37,11 @@ The public Agent entries are:
37
37
  For the shortest installed-package walkthrough, read
38
38
  [CLI Quickstart](./docs/quickstart.md).
39
39
 
40
+ Workspace tracing is off by default. Use `context init context --debug` or
41
+ `context debug enable` only when command and Agent Graph route observability is
42
+ needed; logs stay under ignored `.tmp/context-runtime/debug/`. See
43
+ [Workspace debug tracing](./docs/debug-tracing.md).
44
+
40
45
  ## CLI And Agent Responsibilities
41
46
 
42
47
  | Responsibility | Owner |
@@ -83,7 +88,8 @@ The workspace state is split across:
83
88
  confirmed structure snapshots during an open lifecycle round.
84
89
  - `knowledge/` for approved Markdown, the closed `structure.yaml` projection,
85
90
  and the minimal `decisions.json` rejected-candidate fingerprint map when one
86
- exists.
91
+ exists. Resources referenced by approved pages live in content-addressed
92
+ `knowledge/assets/` paths.
87
93
  - `dist/` for generated package output.
88
94
  - `.tmp/context-runtime/` for other ignored logs, previews, reports, locks, and caches.
89
95
 
@@ -106,6 +112,8 @@ KB packages use flat, package-relative OKF roots: `wikis/`, `guides/`,
106
112
  `dist/<package-name>/` directory and is not repeated inside those roots. Older
107
113
  workspaces that still declare `distribution.knowledgeNamespace` remain
108
114
  loadable, but the legacy value no longer changes package paths.
115
+ Resources referenced by selected pages are copied to `others/assets/` inside
116
+ the package, with links rewritten by the builder.
109
117
 
110
118
  See the SDK manuals for the complete configuration and template contract:
111
119
 
@@ -140,9 +148,14 @@ freeze the workspace. New sources can be added and processed later.
140
148
  context plugin install
141
149
  context plugin status
142
150
 
143
- # Workspace state
151
+ # Workspace creation and state
144
152
  context init [project-dir]
145
153
  context status
154
+ context run --managed --until blocked-or-complete --format json
155
+
156
+ # Route-selected resources
157
+ context resource materialize --help
158
+ context resource acknowledge-current --help
146
159
 
147
160
  # Sources
148
161
  context source add repo [YYYYMMDD] --module <module> --local <repo-or-subdir>
@@ -161,15 +174,28 @@ context run <phase-id>
161
174
  context review html [collection] --open
162
175
  context review apply <payload-file>
163
176
 
177
+ # Package template decisions
178
+ context package template accept --help
179
+
164
180
  # Final quality and output
165
181
  context close
166
182
  context verify
167
183
  context build
184
+
185
+ # Optional workspace tracing
186
+ context debug enable
187
+ context debug status
188
+ context debug export
189
+
190
+ # Development/cache maintenance
191
+ context clean-cache --dry-run
168
192
  ```
169
193
 
170
194
  Run `context <command> --help` for current flags. Commands that require a
171
195
  workspace search upward for a `package.json` with `context.project=true` and a
172
- configured `context.entry`.
196
+ configured `context.entry`. Revision-bound resource and package commands should
197
+ normally be copied from `workflow.current`; the examples above show their
198
+ discovery surface rather than a replacement for the current route.
173
199
 
174
200
  ## Human Gates And Evidence
175
201
 
@@ -195,6 +221,7 @@ citation: copy it exactly and do not parse it as a filesystem path.
195
221
  - [Getting Started](../context/docs/getting-started.md)
196
222
  - [Agent Guide](../context/docs/guides/agent-guide.md)
197
223
  - [Agent Dialogue](../context/docs/guides/agent-dialogue.md)
224
+ - [Lark Resource Materialization](../context/docs/guides/lark-resources.md)
198
225
  - [Project API](../context/docs/reference/project-api.md)
199
226
  - [Package Templates](../context/docs/reference/package-templates.md)
200
227
 
package/README.zh-CN.md CHANGED
@@ -26,6 +26,11 @@ context plugin install
26
26
 
27
27
  最简安装后流程参见 [CLI 快速开始](./docs/quickstart.md)。
28
28
 
29
+ 工作区调试追踪默认关闭。仅在需要观察命令调用与 Agent Graph 路由时,使用
30
+ `context init context --debug` 或 `context debug enable` 开启;日志只写入已忽略的
31
+ `.tmp/context-runtime/debug/`。协议与回放说明见
32
+ [工作区调试追踪](./docs/debug-tracing.md)。
33
+
29
34
  ## CLI、Agent 和用户的分工
30
35
 
31
36
  | 职责 | 负责方 |
@@ -62,7 +67,7 @@ node_modules/@c4a/context/docs/reference/package-templates.md
62
67
  - `src/`:项目声明和知识包模板。
63
68
  - `sources/`:来源登记和已经读取的证据。
64
69
  - `.tmp/context-runtime/lifecycle/`:一个开放生命周期轮次中的、被忽略且仅由 CLI 管理的草稿候选和已确认结构快照。
65
- - `knowledge/`:已批准的 Markdown、close 后的 `structure.yaml` 结构投影,以及存在时用于记录被拒候选 fingerprint 的精简 `decisions.json`。
70
+ - `knowledge/`:已批准的 Markdown、close 后的 `structure.yaml` 结构投影,以及存在时用于记录被拒候选 fingerprint 的精简 `decisions.json`。已批准页面引用的资源位于内容寻址的 `knowledge/assets/`。
66
71
  - `dist/`:构建生成的知识包。
67
72
  - `.tmp/context-runtime/`:其他被忽略的日志、预览、报告、锁和缓存。
68
73
 
@@ -76,6 +81,7 @@ node_modules/@c4a/context/docs/reference/package-templates.md
76
81
  `wikis/`、`guides/`、`rules/` 和 `feats/` 作为包内 OKF 根目录,不再在这些目录下重复包名。
77
82
  旧工作区即使仍声明 `distribution.knowledgeNamespace` 也可以继续加载,但该兼容字段不再改变
78
83
  知识包输出路径。
84
+ 选中页面引用的资源会复制到包内 `others/assets/`,相对链接由构建器自动改写。
79
85
 
80
86
  完整配置和模板约定参见 SDK 手册:
81
87
 
@@ -106,9 +112,14 @@ node_modules/@c4a/context/docs/reference/package-templates.md
106
112
  context plugin install
107
113
  context plugin status
108
114
 
109
- # 工作区状态
115
+ # 工作区创建与状态
110
116
  context init [project-dir]
111
117
  context status
118
+ context run --managed --until blocked-or-complete --format json
119
+
120
+ # 当前路由选择的资源
121
+ context resource materialize --help
122
+ context resource acknowledge-current --help
112
123
 
113
124
  # 知识来源
114
125
  context source add repo [YYYYMMDD] --module <module> --local <repo-or-subdir>
@@ -127,13 +138,27 @@ context run <phase-id>
127
138
  context review html [collection] --open
128
139
  context review apply <payload-file>
129
140
 
141
+ # 知识包模板决策
142
+ context package template accept --help
143
+
130
144
  # 最终质量与输出
131
145
  context close
132
146
  context verify
133
147
  context build
148
+
149
+ # 可选的工作区调试追踪
150
+ context debug enable
151
+ context debug status
152
+ context debug export
153
+
154
+ # 开发与缓存维护
155
+ context clean-cache --dry-run
134
156
  ```
135
157
 
136
- 当前参数以 `context <command> --help` 为准。需要工作区的命令会向上查找带有 `context.project=true` 和 `context.entry` 配置的 `package.json`。
158
+ 当前参数以 `context <command> --help` 为准。需要工作区的命令会向上查找带有
159
+ `context.project=true` 和 `context.entry` 配置的 `package.json`。带 revision
160
+ 约束的资源和知识包命令通常应直接复制 `workflow.current` 返回的命令;上面的例子只用于
161
+ 发现命令入口,不能替代当前路由。
137
162
 
138
163
  ## 人工门禁与证据
139
164
 
@@ -152,6 +177,7 @@ CLI 返回的来源名称、阶段 ID、候选 ID、诊断和 `source_ref` 都
152
177
  - [快速开始](../context/docs/getting-started.md)
153
178
  - [Agent 指南](../context/docs/guides/agent-guide.md)
154
179
  - [Agent 对话指南](../context/docs/guides/agent-dialogue.md)
180
+ - [飞书资源物化](../context/docs/guides/lark-resources.md)
155
181
  - [项目 API](../context/docs/reference/project-api.md)
156
182
  - [知识包模板](../context/docs/reference/package-templates.md)
157
183