@c4a/context-cli 0.6.1-beta.3 → 0.6.1-beta.5
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/README.md +22 -9
- package/README.zh-CN.md +12 -8
- package/cli.js +76339 -69108
- package/docs/quickstart.md +7 -0
- package/package.json +4 -3
- package/plugins/README.md +7 -2
- package/plugins/README_CN.md +7 -2
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/continue.md +17 -3
- package/plugins/claude/commands/init.md +7 -4
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/continue/SKILL.md +17 -3
- package/plugins/codex/skills/init/SKILL.md +6 -3
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/commands/context-continue.md +17 -3
- package/plugins/cursor/commands/context-init.md +7 -4
- package/plugins/skills/context-continue/SKILL.md +17 -3
- package/plugins/skills/context-init/SKILL.md +6 -3
- package/providers/context/actions/accept-package-templates.yaml +5 -0
- package/providers/context/actions/align-next.yaml +1 -0
- package/providers/context/codes.yaml +2 -0
- package/providers/context/graphs/workspace.yaml +26 -1
- package/providers/context/manifest.json +67 -40
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/diagnostics/projection-stale.md +13 -0
- package/providers/context/resources/dialogue/document-classification.md +2 -1
- package/providers/context/resources/dialogue/package-output.md +5 -7
- package/providers/context/resources/manuals/guides/package-outputs.md +40 -37
- package/providers/context/resources/manuals/reference/package-templates.md +36 -48
- package/providers/context/resources/manuals/reference/project-api.md +139 -17
- package/providers/context/resources/manuals/reference/template-variables.md +12 -11
- package/providers/context/resources/procedures/close-and-build.md +3 -1
- package/providers/context/resources/procedures/code-extraction.md +22 -2
- package/providers/context/resources/procedures/document-capture.md +14 -0
- package/providers/context/resources/procedures/document-classification.md +3 -0
- package/providers/context/resources/procedures/package-output.md +17 -11
- package/providers/context/resources/procedures/prose-align.md +45 -0
- package/providers/context/resources/procedures/source-boundary.md +6 -0
- package/providers/context/resources/procedures/source-capture-detailed.md +10 -0
- package/providers/context/resources/semantic/align/candidate-resolution.md +4 -2
- package/providers/context/resources/semantic/align/structure-planning.md +8 -5
- package/providers/context/schemas/prose-structure-batch.schema.json +35 -0
package/README.md
CHANGED
|
@@ -57,6 +57,7 @@ the route; progressive loading does not shorten or discard them.
|
|
|
57
57
|
```bash
|
|
58
58
|
# Create a standalone workspace.
|
|
59
59
|
context init context
|
|
60
|
+
# Use --language zh-CN when generated workspace and starter templates should be Chinese.
|
|
60
61
|
cd context
|
|
61
62
|
bun install
|
|
62
63
|
|
|
@@ -78,10 +79,21 @@ The workspace state is split across:
|
|
|
78
79
|
|
|
79
80
|
- `src/` for project declarations and package templates.
|
|
80
81
|
- `sources/` for source registries and captured evidence.
|
|
81
|
-
-
|
|
82
|
-
|
|
82
|
+
- `.tmp/context-runtime/lifecycle/` for ignored, CLI-managed draft candidates and
|
|
83
|
+
confirmed structure snapshots during an open lifecycle round.
|
|
84
|
+
- `knowledge/` for approved Markdown, the closed `structure.yaml` projection,
|
|
85
|
+
and the minimal `decisions.json` rejected-candidate fingerprint map when one
|
|
86
|
+
exists.
|
|
83
87
|
- `dist/` for generated package output.
|
|
84
|
-
- `.tmp/context-runtime/` for ignored logs, previews, reports, locks, and caches.
|
|
88
|
+
- `.tmp/context-runtime/` for other ignored logs, previews, reports, locks, and caches.
|
|
89
|
+
|
|
90
|
+
The lifecycle and review runtime state is not user-editable and is removed by a
|
|
91
|
+
successful `context close`. `knowledge/structure.yaml` is the durable approved
|
|
92
|
+
structure projection. Its minimal `source_inputs` entries record only the
|
|
93
|
+
source, collection, and source snapshot consumed by a closed prose target, so a
|
|
94
|
+
clean workspace can distinguish completed and changed inputs after transient
|
|
95
|
+
snapshots are removed. `knowledge/decisions.json` only preserves rejected
|
|
96
|
+
candidate IDs and their fingerprints so unchanged candidates are not offered again.
|
|
85
97
|
|
|
86
98
|
Do not repair lifecycle state by manually deleting or rewriting these
|
|
87
99
|
directories. Use the command or next action returned by the CLI.
|
|
@@ -89,12 +101,11 @@ directories. Use the command or next action returned by the CLI.
|
|
|
89
101
|
## Package Output
|
|
90
102
|
|
|
91
103
|
`context build` writes each declared package under `dist/<package-name>/`.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Skill names remain independent.
|
|
104
|
+
KB packages use flat, package-relative OKF roots: `wikis/`, `guides/`,
|
|
105
|
+
`rules/`, and `feats/`. The package name already identifies the surrounding
|
|
106
|
+
`dist/<package-name>/` directory and is not repeated inside those roots. Older
|
|
107
|
+
workspaces that still declare `distribution.knowledgeNamespace` remain
|
|
108
|
+
loadable, but the legacy value no longer changes package paths.
|
|
98
109
|
|
|
99
110
|
See the SDK manuals for the complete configuration and template contract:
|
|
100
111
|
|
|
@@ -138,6 +149,8 @@ context source add repo [YYYYMMDD] --module <module> --local <repo-or-subdir>
|
|
|
138
149
|
context source add file [YYYYMMDD] --module <module> --local <file-or-folder>
|
|
139
150
|
context source add lark [YYYYMMDD] --module <module> --url <lark-url>
|
|
140
151
|
context source add batch [YYYYMMDD] --input <yaml-or-json>
|
|
152
|
+
context source remove <source-id> --format json # preview
|
|
153
|
+
context source remove <source-id> --yes --format json # apply after reference checks
|
|
141
154
|
context source ensure [source]
|
|
142
155
|
context source inspect [source]
|
|
143
156
|
|
package/README.zh-CN.md
CHANGED
|
@@ -40,7 +40,7 @@ Agent 把 `context status --format json` 返回的 `workflow.current` 作为当
|
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
# 创建独立工作区
|
|
43
|
-
context init context
|
|
43
|
+
context init context --language zh-CN
|
|
44
44
|
cd context
|
|
45
45
|
bun install
|
|
46
46
|
|
|
@@ -61,19 +61,21 @@ node_modules/@c4a/context/docs/reference/package-templates.md
|
|
|
61
61
|
|
|
62
62
|
- `src/`:项目声明和知识包模板。
|
|
63
63
|
- `sources/`:来源登记和已经读取的证据。
|
|
64
|
-
-
|
|
65
|
-
- `knowledge
|
|
64
|
+
- `.tmp/context-runtime/lifecycle/`:一个开放生命周期轮次中的、被忽略且仅由 CLI 管理的草稿候选和已确认结构快照。
|
|
65
|
+
- `knowledge/`:已批准的 Markdown、close 后的 `structure.yaml` 结构投影,以及存在时用于记录被拒候选 fingerprint 的精简 `decisions.json`。
|
|
66
66
|
- `dist/`:构建生成的知识包。
|
|
67
|
-
- `.tmp/context-runtime
|
|
67
|
+
- `.tmp/context-runtime/`:其他被忽略的日志、预览、报告、锁和缓存。
|
|
68
|
+
|
|
69
|
+
生命周期和审核运行态不可由用户编辑,成功执行 `context close` 后会被自动清理。`knowledge/structure.yaml` 是持久的已批准结构投影,其中精简的 `source_inputs` 只记录已关闭 prose 目标消费的 source、collection 和来源快照,以便临时结构清理后仍能区分已完成输入与变化输入;`knowledge/decisions.json` 仅保留被拒候选的 ID 与 fingerprint,避免未变化的候选再次出现。
|
|
68
70
|
|
|
69
71
|
不要通过手动删除或改写这些目录来修复流程状态,应使用 CLI 返回的命令或下一步操作。
|
|
70
72
|
|
|
71
73
|
## 知识包输出
|
|
72
74
|
|
|
73
|
-
`context build` 会把声明好的知识包写入 `dist/<package-name
|
|
74
|
-
`wikis
|
|
75
|
-
`
|
|
76
|
-
|
|
75
|
+
`context build` 会把声明好的知识包写入 `dist/<package-name>/`。KB 包直接使用
|
|
76
|
+
`wikis/`、`guides/`、`rules/` 和 `feats/` 作为包内 OKF 根目录,不再在这些目录下重复包名。
|
|
77
|
+
旧工作区即使仍声明 `distribution.knowledgeNamespace` 也可以继续加载,但该兼容字段不再改变
|
|
78
|
+
知识包输出路径。
|
|
77
79
|
|
|
78
80
|
完整配置和模板约定参见 SDK 手册:
|
|
79
81
|
|
|
@@ -113,6 +115,8 @@ context source add repo [YYYYMMDD] --module <module> --local <repo-or-subdir>
|
|
|
113
115
|
context source add file [YYYYMMDD] --module <module> --local <file-or-folder>
|
|
114
116
|
context source add lark [YYYYMMDD] --module <module> --url <lark-url>
|
|
115
117
|
context source add batch [YYYYMMDD] --input <yaml-or-json>
|
|
118
|
+
context source remove <source-id> --format json # 预览
|
|
119
|
+
context source remove <source-id> --yes --format json # 引用检查通过后执行
|
|
116
120
|
context source ensure [source]
|
|
117
121
|
context source inspect [source]
|
|
118
122
|
|