@c4a/context-cli 0.6.1-beta.3 → 0.6.1-beta.4

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 +20 -9
  2. package/README.zh-CN.md +10 -8
  3. package/cli.js +71833 -69465
  4. package/docs/quickstart.md +7 -0
  5. package/package.json +3 -3
  6. package/plugins/README.md +7 -2
  7. package/plugins/README_CN.md +7 -2
  8. package/plugins/VERSION +1 -1
  9. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  10. package/plugins/claude/commands/continue.md +17 -3
  11. package/plugins/claude/commands/init.md +7 -4
  12. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  13. package/plugins/codex/skills/continue/SKILL.md +17 -3
  14. package/plugins/codex/skills/init/SKILL.md +6 -3
  15. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  16. package/plugins/cursor/commands/context-continue.md +17 -3
  17. package/plugins/cursor/commands/context-init.md +7 -4
  18. package/plugins/skills/context-continue/SKILL.md +17 -3
  19. package/plugins/skills/context-init/SKILL.md +6 -3
  20. package/providers/context/actions/accept-package-templates.yaml +5 -0
  21. package/providers/context/actions/align-next.yaml +1 -0
  22. package/providers/context/codes.yaml +2 -0
  23. package/providers/context/graphs/workspace.yaml +26 -1
  24. package/providers/context/manifest.json +63 -36
  25. package/providers/context/provider.yaml +1 -1
  26. package/providers/context/resources/diagnostics/projection-stale.md +13 -0
  27. package/providers/context/resources/dialogue/document-classification.md +2 -1
  28. package/providers/context/resources/dialogue/package-output.md +5 -7
  29. package/providers/context/resources/manuals/guides/package-outputs.md +40 -37
  30. package/providers/context/resources/manuals/reference/package-templates.md +36 -48
  31. package/providers/context/resources/manuals/reference/project-api.md +75 -12
  32. package/providers/context/resources/manuals/reference/template-variables.md +12 -11
  33. package/providers/context/resources/procedures/close-and-build.md +3 -1
  34. package/providers/context/resources/procedures/code-extraction.md +16 -2
  35. package/providers/context/resources/procedures/document-capture.md +14 -0
  36. package/providers/context/resources/procedures/document-classification.md +3 -0
  37. package/providers/context/resources/procedures/package-output.md +17 -11
  38. package/providers/context/resources/procedures/prose-align.md +45 -0
  39. package/providers/context/resources/semantic/align/candidate-resolution.md +4 -2
  40. package/providers/context/resources/semantic/align/structure-planning.md +8 -5
  41. 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
- - `unapproved/` for draft, rejected, or deprecated candidates.
82
- - `knowledge/` for approved knowledge.
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
- Every KB package uses its package name as the default knowledge namespace, so
93
- its final OKF roots are shaped like
94
- `wikis/<package-name>/`, `guides/<package-name>/`,
95
- `rules/<package-name>/`, and `feats/<package-name>/`. A project may explicitly
96
- choose another safe single- or multi-segment namespace in `src/index.ts`;
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
 
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
- - `unapproved/`:草稿、拒绝或废弃的知识候选。
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>/`。每个 KB 包默认使用包名作为知识 namespace,因此最终 OKF 根目录形如
74
- `wikis/<package-name>/`、`guides/<package-name>/`、
75
- `rules/<package-name>/` 和 `feats/<package-name>/`。项目可以在
76
- `src/index.ts` 中显式指定其他安全的单段或多段 namespace;Skill 名称与它相互独立。
75
+ `context build` 会把声明好的知识包写入 `dist/<package-name>/`。KB 包直接使用
76
+ `wikis/`、`guides/`、`rules/` 和 `feats/` 作为包内 OKF 根目录,不再在这些目录下重复包名。
77
+ 旧工作区即使仍声明 `distribution.knowledgeNamespace` 也可以继续加载,但该兼容字段不再改变
78
+ 知识包输出路径。
77
79
 
78
80
  完整配置和模板约定参见 SDK 手册:
79
81