@c4a/context-cli 0.7.12 → 0.7.14-beta.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.
Files changed (27) hide show
  1. package/cli.js +1484 -1174
  2. package/indexers/contracts/profile-contract.json +245 -245
  3. package/indexers/release-manifest.json +1 -1
  4. package/package.json +12 -12
  5. package/parserEntryWorker.js +12 -1
  6. package/plugins/VERSION +1 -1
  7. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  8. package/plugins/claude/commands/context-inspect-search.md +18 -0
  9. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  10. package/plugins/codex/skills/context-inspect-search/SKILL.md +18 -0
  11. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  12. package/plugins/cursor/commands/c4a-context-inspect-search.md +18 -0
  13. package/plugins/skills/context-inspect-search/SKILL.md +18 -0
  14. package/providers/context/graphs/workspace.yaml +3 -1
  15. package/providers/context/manifest.json +31 -22
  16. package/providers/context/provider.yaml +1 -1
  17. package/providers/context/resources/manuals/guides/knowledge-updates.md +82 -19
  18. package/providers/context/resources/manuals/guides/package-outputs.md +25 -0
  19. package/providers/context/resources/manuals/guides/page-customization.md +93 -0
  20. package/providers/context/resources/manuals/reference/project-api.md +6 -0
  21. package/providers/context/resources/procedures/close-and-build.md +10 -15
  22. package/providers/context/resources/procedures/document-capture.md +7 -1
  23. package/providers/context/resources/procedures/knowledge-maintenance.md +5 -3
  24. package/providers/context/resources/procedures/knowledge-updates.md +82 -19
  25. package/providers/context/resources/procedures/production-stage-files.md +6 -0
  26. package/providers/context/skills/record-workspace-version/SKILL.md +6 -0
  27. package/providers/context/skills/work-production-stage/SKILL.md +5 -0
@@ -0,0 +1,93 @@
1
+ ---
2
+ id: context.sdk.page-customization
3
+ kind: procedure
4
+ mediaType: text/markdown
5
+ ---
6
+
7
+ # Page content customization
8
+
9
+ Keep trusted website code in `src/site/`. It is presentation code, not captured
10
+ material or approved knowledge. Configure it in the existing `kbPackage.site`:
11
+
12
+ ```ts
13
+ site: {
14
+ title: "Engineering handbook",
15
+ extensions: {
16
+ root: "src/site",
17
+ slots: {
18
+ banner: "components/Banner.vue",
19
+ floating: "components/Chat.vue",
20
+ },
21
+ pages: { support: "pages/support.md" },
22
+ },
23
+ }
24
+ ```
25
+
26
+ Paths are relative to `root`. The directory can contain Vue components, CSS,
27
+ Markdown and imported assets. Use relative imports within this directory;
28
+ declare external dependencies in the workspace package manifest. Do not put
29
+ credentials or private configuration in frontend files. Hidden files,
30
+ `node_modules` and `dist` are not copied; symlinks are rejected.
31
+
32
+ ## Homepage and floating slots
33
+
34
+ | Slot | Default | Customization |
35
+ | --- | --- | --- |
36
+ | `banner` | Existing homepage hero and actions | Replace with a component |
37
+ | `knowledge` | Knowledge-map card group | Replace with a component |
38
+ | `resources` | Resource card group | Replace with a component |
39
+ | `footer` | Existing homepage footer | Replace with a component |
40
+ | `floating` | Empty | Client-only component fixed at the bottom right on all pages |
41
+
42
+ Omit a slot to retain its default; set it to `false` to hide it. A component
43
+ replaces only its slot, not the global navigation, language switch or article
44
+ provenance. Components can use VitePress `useData()` and `useRoute()` for theme,
45
+ page and route information. Import scoped CSS from components for local styling.
46
+
47
+ The floating component owns its button, chat/bot panel and open/close behavior.
48
+ Keep its panel within the viewport and preserve keyboard focus and close controls.
49
+ Load expensive chat SDKs when opened. Its component import is client-only, but
50
+ other components must support static rendering: use `onMounted` for browser APIs.
51
+ The static website supplies no chat backend or secret storage; use an authorized
52
+ business service for authentication and requests. A service failure must not
53
+ prevent reading the handbook.
54
+
55
+ ## Custom pages and navigation
56
+
57
+ Each `pages` key becomes `/custom/<key>.html` under the configured site base.
58
+ A page is trusted Markdown and may import Vue components, for example:
59
+
60
+ ```md
61
+ # Support
62
+
63
+ <script setup>
64
+ import SupportPanel from '../components/SupportPanel.vue'
65
+ </script>
66
+
67
+ <SupportPanel />
68
+ ```
69
+
70
+ Place it using the existing knowledge-map entry structure, with
71
+ `target: { artifact_ref: "site:support" }`. Set `parent`, `title` and `order`
72
+ as for other directory entries; do not create a second menu configuration.
73
+ The `site:` namespace is reserved for website pages; do not use `section_key`
74
+ on these targets. Undeclared targets fail website building with a diagnostic.
75
+ Pages without directory entries remain directly accessible. Multiple entries
76
+ can reference one page without duplicating content.
77
+
78
+ These pages are website-only: they are not approved articles and do not enter
79
+ the knowledge package or LLM Docs. Update formal articles through the existing
80
+ knowledge revision workflow, not through a custom page that shadows their URLs.
81
+
82
+ ## Build and delivery
83
+
84
+ Use the existing package build after editing configuration or presentation files;
85
+ site customization does not require capture, Indexer planning or a new review
86
+ gate. Existing authorization for building and deployment still applies.
87
+ Extension files and workspace dependency manifests participate in build
88
+ fingerprints. Build errors preserve previous outputs. Never edit the generated
89
+ `.tmp` website or `dist` as the source of customization.
90
+
91
+ Preview the homepage, custom pages and floating panel on desktop and mobile,
92
+ including a non-root `site.base`, dark mode and keyboard navigation. Publish only
93
+ the resulting website directory, not the source tree or workspace credentials.
@@ -193,6 +193,12 @@ or repository links. Knowledge map is projected from
193
193
  `src/knowledge-map.yaml` independently of KB directories; see
194
194
  [Package Outputs](../guides/package-outputs.md#optional-static-documentation-website).
195
195
 
196
+ `site.extensions` optionally names a trusted `src/site` root, homepage and floating
197
+ `slots`, and custom Markdown `pages`. Place custom pages in the same knowledge map
198
+ with `target.artifact_ref: "site:<page-key>"`. See
199
+ [Page content customization](../guides/page-customization.md) for the configuration
200
+ and the boundary between presentation code and approved knowledge.
201
+
196
202
  ## Knowledge requirements and Indexer Skills
197
203
 
198
204
  When `src/indexers.yaml` is absent, the configuration Route supplies its schema.
@@ -13,17 +13,15 @@ Pass `actor` explicitly when the conversation identifies the triggering user,
13
13
  including a known Lark display name. If Git has no name and the conversation
14
14
  does not identify the user, leave it absent and mention that in the delivery
15
15
  summary; do not infer identity from paths, logins or source authors. Amending
16
- an unbuilt entry preserves its actor unless an explicit replacement is supplied.
16
+ an unpublished entry preserves its actor unless an explicit replacement is supplied.
17
17
  Record after Close and package/template approval, before the final build, so the
18
18
  selected outputs are built with the new version once. Build records hashes without
19
19
  increasing versions. Never count temporary progress or a build retry as a change.
20
20
 
21
- For formal repairs before a successful build, use `version inspect`'s
22
- `reusable_version` when present. Submit the same version and a complete updated
23
- changelog covering the original work plus repairs, not a repair-only replacement.
24
- The CLI updates the pending entry in place. A successful build or publication
25
- seals that version; subsequent changes require an increase. Do not delete build
26
- or publication receipts to reopen history.
21
+ For formal repairs, inspect the current diff and check the publication target
22
+ before reusing an untagged version. An unpublished preview can amend its current
23
+ entry with the complete iteration's changes. Published content requires an
24
+ increasing version. A successful local build does not seal a version.
27
25
 
28
26
  Successful delivery clears completed task drafts. Do not empty `.tmp` or call
29
27
  `task resume` as a finalization step. Retain registered repository checkouts,
@@ -34,14 +32,11 @@ Website rendering must preserve literal code and template examples. Do not revis
34
32
  valid source-grounded JSX or template syntax merely to avoid Vue interpolation;
35
33
  report a rendering defect if the website compiler cannot display it literally.
36
34
 
37
- Before an authorized external publication, run `context version publish-check
38
- --format json`. If `needs_version` is true, inspect with `context version inspect
39
- --publish --format json`, record a patch changelog using a `dist` trigger, and
40
- rebuild. Do not increment again if the workspace version already changed.
41
- If `unchanged` is true, there is no new delivery. Only after a successful external
42
- publication, use `context version published --hash <checked-hash> --receipt
43
- <successful-publication-reference> --format json`. Failure does not advance that
44
- baseline. These commands do not upload, publish or grant publishing authority.
35
+ Before an authorized external publication, use the installed distribution skill
36
+ or tool to read that target's current remote version and confirm the complete
37
+ build directory. Reconcile its version with package.json and changelog.yaml.
38
+ Building a preview does not publish or seal a version. Record the successful
39
+ remote receipt per target; commit/tag only when separately authorized.
45
40
 
46
41
  Close deterministically reconciles approved Markdown and current relationship
47
42
  inputs into `knowledge/structure.yaml`. It compacts repeated machine fields out
@@ -41,7 +41,7 @@ successful module as completion of the whole batch.
41
41
  The CLI owns normalization, snapshot identity, hashes, manifests, and
42
42
  idempotency. For Lark sources it also owns embedded-resource download,
43
43
  structured export, completeness reporting, and link projection. Required
44
- resource failures block the next phase; reference-only resources remain
44
+ resource failures block work that depends on that material; reference-only resources remain
45
45
  explicit in the report. Never hand-write or repair captured snapshots or their
46
46
  asset links. If a selected local
47
47
  boundary is a documentation site rather than plain Markdown, use the
@@ -56,3 +56,9 @@ response. Once selected, the same identity is used for the document body and
56
56
  all embedded resources. If `docs +fetch` lacks the required `--doc-format`
57
57
  capability, follow the returned `lark-cli update` recovery and rerun the same
58
58
  Route command; do not replace the capture with a hand-written export.
59
+
60
+ An active production stage can continue planning and writing articles whose sources
61
+ are available while another capture remains pending. Keep unresolved sources in
62
+ `pending_scopes`; do not cite their unavailable snapshots. The Route returns to
63
+ pending capture after the active production/review work, before delivery completes.
64
+ This does not mark failed captures as complete or waive source-read authorization.
@@ -7,9 +7,9 @@ mediaType: text/markdown
7
7
  # Maintain knowledge while production continues
8
8
 
9
9
  Use `context task maintain --input <file|-> --format json` to register multiple
10
- approved pages or an approved-output rebuild. The machine-readable input is
11
- [maintenance input](../../schemas/knowledge-maintenance-input.schema.json). This accepts a request; it does
12
- not discard the current task or immediately rewrite a page.
10
+ approved pages or an approved-output rebuild. Read the input schema with
11
+ `context task maintain --schema --format json`. Registration saves a request;
12
+ it does not discard the current task or immediately rewrite a page.
13
13
 
14
14
  ```yaml
15
15
  id: clarify-existing-guides
@@ -66,3 +66,5 @@ route. If status says `target-still-in-production`, the original task still owns
66
66
  an unfinished page of that subject: let that writer settle before revising its
67
67
  latest approved text. After completion, read the
68
68
  new Route to resume production. Never resubmit an accepted old batch.
69
+
70
+ After Review and Close, a revision with remaining targets continues authoring without an intermediate package build. Build the configured outputs after the final revision batch; Close alone does not mark the maintenance request delivered.
@@ -107,12 +107,11 @@ configuration/template approval, before the final build. The record response
107
107
  returns the next workspace Route, so no extra status call is needed. Build retries
108
108
  reuse the recorded version when formal content is unchanged. If build preparation
109
109
  or rendering fails and formal corrections are needed, `version inspect` returns
110
- `reusable_version` for the current entry only while it has no successful build or
111
- publication receipt. Submit that same version with the complete iteration's title,
112
- changes and triggers, including the repair; this replaces the pending changelog
113
- entry rather than appending another version. Do not submit only the repair and
114
- lose the original delivery description. Once built or published, the version is
115
- sealed and further formal changes require an increase. Intermediate batches
110
+ `reusable_version` for an untagged current entry. Before amending, read the
111
+ publication target's remote version using the distribution skill. An unpublished
112
+ preview may reuse its version with the complete iteration's title, changes and
113
+ triggers; preserve the original delivery description. Published content requires
114
+ an increasing version. A local build alone does not seal a version. Intermediate batches
116
115
  do not each receive a version.
117
116
 
118
117
  The workspace AGENTS.md and version-writing instructions require each entry's
@@ -149,19 +148,23 @@ are `initial`, `note`, `sessions`, `mr`, `module`, `document`, `navigation`,
149
148
  `repair`, `dist`, and `other`. Agent-written fields describe the actual diff and
150
149
  conversation; they must not expose credentials, raw transcripts or private IDs.
151
150
 
152
- The CLI writes `changelog.yaml`, generated `CHANGELOG.md`, `package.json` and the
153
- `.context-version.json` content baseline together. Keep these formal files with
154
- the workspace; do not hand-edit generated baselines. Git-managed and unignored
155
- new files are compared (without Git, non-runtime workspace files are compared).
156
- Version metadata itself, `dist`, `.tmp` and dependencies do not cause changes.
157
-
158
- Successful builds record version and per-package hashes in `.context-builds.json`.
159
- They do not increase versions. Before publishing, `context version publish-check
160
- --format json` compares against `.context-published.json`. A same-version changed
161
- output requires a patch using `version inspect --publish` and a `dist` trigger,
162
- then a rebuild. Record `version published --hash <checked-hash> --receipt
163
- <successful-publication-reference> --format json` only after external success.
164
- No command commits, tags or uploads automatically.
151
+ The CLI updates `package.json`, `changelog.yaml` and generated `CHANGELOG.md` together.
152
+ `context version inspect --base <commit-or-tag> --format json` compares the actual
153
+ workspace files with Git, including untracked files. Without an explicit base it
154
+ uses the current version's `v<version>` tag when available, otherwise HEAD; HEAD
155
+ is not proof of publication. Review article bodies, assets, structure, navigation
156
+ and templates, not structure alone. Without Git, inspection reports local files.
157
+ A disposable `.tmp` checkpoint suppresses repeated recording in an uncommitted
158
+ iteration. Losing it does not lose knowledge or prove a new publication.
159
+
160
+ There are no root-level Context version/build/publication receipts to maintain.
161
+ Build freshness uses the existing local package cache. The CLI does not seal a
162
+ version merely because a preview was built. Before reusing a version, check the
163
+ actual publication target and Git tags; a published version requires an increase.
164
+ Publication belongs to the installed distribution tool. Record remote receipts
165
+ in its configuration or the existing work summary, separately for each target.
166
+ A successful authorized commit/tag identifies the delivered source; never create
167
+ one automatically, and never treat Git success as platform publication success.
165
168
 
166
169
  Website history is available at `changelog.html`: cards are newest first, the
167
170
  latest three expanded and older cards collapsed. The History button beside the
@@ -197,6 +200,66 @@ coverage by mechanically placing every new page under an unrelated catch-all.
197
200
  Build reports missing bindings for the Agent to resolve; it does not classify
198
201
  content. Moving a menu entry does not change the article URL.
199
202
 
203
+ ### Reader tasks, names and reading order
204
+
205
+ Read the affected articles' bodies before changing their categories or titles.
206
+ Titles and outlines help locate material; they do not settle its main reader task.
207
+ During initial planning, keep names and placement provisional until the relevant
208
+ material supports them. Classify by the question the page primarily answers and
209
+ its intended reader, rather than its collection, source path or isolated words:
210
+
211
+ | Main reader task | Organizing emphasis |
212
+ | --- | --- |
213
+ | Understand a business process | Participants, rules, decisions and lifecycle |
214
+ | Understand an implementation | Components, data changes, calls and failure handling |
215
+ | Integrate or use a capability | Prerequisites, setup, contracts and usage |
216
+ | Diagnose or recover from a problem | Symptoms, checks, causes, actions and verification |
217
+
218
+ These distinctions guide placement, not a required set of top-level directories.
219
+ A page explaining retry scheduling and persistence belongs with its implementation;
220
+ a page explaining how to recover a stalled worker serves troubleshooting. The word
221
+ "retry" alone decides neither. Choose a primary home for a mixed page and link
222
+ related tasks without duplicating the same overview across categories.
223
+
224
+ Give each directory a concrete shared subject or reader task. At every parent,
225
+ keep its children either all directories or all articles. Place an overview in
226
+ the appropriate article group when the parent contains directories. Avoid empty
227
+ category scaffolding and chains of single-article directories that add no useful
228
+ choice. A residual "Other" group, when warranted, comes last; it must not absorb
229
+ articles whose purpose fits an existing group. Do not invent a fixed depth,
230
+ number of categories or page quota to make the tree look uniform.
231
+
232
+ Keep directory and article titles concise and specific to their actual subject.
233
+ Name the object and useful task, rather than enumerating every section heading.
234
+ For example, prefer "Client authentication" to "Client tokens, configuration,
235
+ requests, refresh and errors" when those sections all explain authentication.
236
+ Retain a platform or product name only when it distinguishes otherwise ambiguous
237
+ topics. Keep an existing accurate title when it already works; a necessary
238
+ technical name need not be shortened just to meet a word count.
239
+
240
+ The Agent manually arranges siblings for reading: a useful overview, prerequisites,
241
+ the main tasks or process sequence, then later maintenance and reference material
242
+ where applicable. Use a numbered list or ordered outline to review that proposal,
243
+ then assign explicit, distinct `order` values among siblings in the knowledge-map
244
+ adjustment, for example 10, 20 and 30. The list is an editing plan; persisted
245
+ `order` values determine navigation. Reordering YAML/JSON entries or changing the
246
+ plan's list order alone does not change the site. Paths, internal keys, alphabetical
247
+ order and source-file order are not substitutes for a reader sequence. Keep order
248
+ numbers out of titles. This navigation order is separate from the order in which
249
+ workers write their drafts.
250
+
251
+ For a long or compound page, inspect its content before suggesting a split or
252
+ merge. Keep one coherent task together, and separate independently useful tasks
253
+ only when their supported content warrants it. A long title or many headings
254
+ alone is insufficient. Preserve useful detail and links, and retain article IDs,
255
+ paths and unaffected sections when the reader task is unchanged. A navigation-only
256
+ change does not require a prose rewrite or file migration; changing its label does
257
+ not silently rename the approved article. Needed title or content revisions use
258
+ the existing revision and Review flow. Splits and merges use ordinary article
259
+ tasks, link repair and any explicit retirement after replacement content is
260
+ delivered. These are Agent editorial decisions, not new CLI checks or approval
261
+ gates.
262
+
200
263
  ## Edit one section or review part of a batch
201
264
 
202
265
  The current approved-revision Route accepts either full `markdown` or explicit
@@ -10,6 +10,12 @@ The stage entry links CLI-owned requirements, planned skill guidance and task
10
10
  directories. Read relevant source text before writing; a skeleton is navigation,
11
11
  not semantic evidence. Skill names guide work, not article ownership or versions.
12
12
 
13
+ Use the [reader organization guidance](knowledge-updates.md#reader-tasks-names-and-reading-order)
14
+ for article names, placement and manually arranged navigation. Check the draft's
15
+ main reader task against its planned title and group; adjust through the existing
16
+ plan, revision or knowledge-map flow when needed. A navigation change alone does
17
+ not call for rewriting valid prose.
18
+
13
19
  Restore repository checkouts only when needed for the current investigation or
14
20
  article. Independent notes/documents can proceed while unavailable code remains
15
21
  an explicit gap. For a required repository, read the
@@ -30,6 +30,12 @@ document, navigation, repair, dist, other. Describe what actually triggered the
30
30
  iteration, not merely the CLI command. Never include raw private transcripts,
31
31
  credentials, local absolute paths or private account IDs in public history.
32
32
 
33
+ Before amending the current version, check the target platform and Git tags.
34
+ A local build is not publication. Use an increasing version for published content.
35
+ Git comparison supports `version inspect --base <commit-or-tag>`; include the
36
+ same `base_ref` in the record input when selected. Missing `.tmp` checkpoints do
37
+ not require recreating historical receipts.
38
+
33
39
  Increment minor for added modules/material that expands knowledge coverage;
34
40
  increment patch for repairs, existing-module updates, navigation or persistent
35
41
  work-status changes. Major increases require an explicit user instruction.
@@ -6,6 +6,11 @@ description: Investigate or write within the current Context production director
6
6
  Use only the current Route's stage and authorized materials. Explain decisions
7
7
  in the user's conversation language.
8
8
 
9
+ When planning or revising article placement, titles or reading order, read
10
+ [reader organization guidance](../../resources/procedures/knowledge-updates.md#reader-tasks-names-and-reading-order).
11
+ Apply it to the affected topics within the user's scope; it adds no production
12
+ stage or permission gate.
13
+
9
14
  For investigation, use the supplied directory and its submission schema. Start
10
15
  with code skeletons and document outlines; selectively read original material
11
16
  where needed to decide reader topics, source grouping and writing batches.