@c4a/context-cli 0.7.50 → 0.7.60
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/cli.js +3358 -2136
- package/indexers/contracts/profile-contract.json +245 -245
- package/indexers/release-manifest.json +1 -1
- package/package.json +12 -12
- package/parserEntryWorker.js +73 -2
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/context-inspect-search.md +8 -0
- package/plugins/claude/commands/context.md +335 -266
- package/plugins/claude/resources/context/imports.md +87 -0
- package/plugins/claude/resources/context/local-install.md +21 -0
- package/plugins/claude/skills/context-inspect-search/SKILL.md +8 -0
- package/plugins/claude/skills/context-repo-content/SKILL.md +2 -1
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/context/SKILL.md +335 -266
- package/plugins/codex/skills/context/references/imports.md +87 -0
- package/plugins/codex/skills/context/references/local-install.md +21 -0
- package/plugins/codex/skills/context-inspect-search/SKILL.md +8 -0
- package/plugins/codex/skills/context-repo-content/SKILL.md +2 -1
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/commands/c4a-context-inspect-search.md +8 -0
- package/plugins/cursor/commands/c4a-context.md +335 -266
- package/plugins/cursor/resources/context/imports.md +87 -0
- package/plugins/cursor/resources/context/local-install.md +21 -0
- package/plugins/cursor/skills/context-inspect-search/SKILL.md +8 -0
- package/plugins/cursor/skills/context-repo-content/SKILL.md +2 -1
- package/plugins/skills/context/SKILL.md +335 -266
- package/plugins/skills/context/references/imports.md +87 -0
- package/plugins/skills/context/references/local-install.md +21 -0
- package/plugins/skills/context-inspect-search/SKILL.md +8 -0
- package/plugins/skills/context-repo-content/SKILL.md +2 -1
- package/providers/context/actions/repair-project-entry.yaml +1 -0
- package/providers/context/actions/translate-site-locales.yaml +5 -0
- package/providers/context/codes.yaml +1 -0
- package/providers/context/graphs/workspace.yaml +14 -1
- package/providers/context/manifest.json +44 -18
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/manuals/guides/imports.md +90 -0
- package/providers/context/resources/manuals/guides/knowledge-updates.md +13 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +42 -4
- package/providers/context/resources/manuals/guides/page-customization.md +16 -0
- package/providers/context/resources/manuals/guides/site-translation.md +78 -0
- package/providers/context/resources/manuals/reference/project-api.md +2 -1
- package/providers/context/resources/procedures/knowledge-updates.md +13 -0
- package/providers/context/skills/record-workspace-version/SKILL.md +3 -2
- package/providers/context/skills/translate-site-locales/SKILL.md +36 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: context.sdk.site-translation
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Site translation
|
|
8
|
+
|
|
9
|
+
A knowledge package website can publish translated copies of approved
|
|
10
|
+
knowledge for each language tag declared in `site.locales`. Approved knowledge
|
|
11
|
+
in the primary language remains the only source of truth; translations are a
|
|
12
|
+
reader projection and never change Review, Verify or the KB output.
|
|
13
|
+
|
|
14
|
+
## Storage
|
|
15
|
+
|
|
16
|
+
| Path | Content |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `translations/<tag>/<approved-path>.md` | Translated article. Frontmatter holds `title`, optional `description` and a `translation` record with `locale`, `artifact_ref`, `source_digest` and `translated_at`. |
|
|
19
|
+
| `translations/<tag>/knowledge-map.yaml` | Translated navigation titles keyed by knowledge map entry `key`. |
|
|
20
|
+
|
|
21
|
+
`<approved-path>` is the path below `knowledge/`. Translations are formal
|
|
22
|
+
workspace content: they are included in workspace versions and package
|
|
23
|
+
fingerprints, so changing one rebuilds the website.
|
|
24
|
+
|
|
25
|
+
## Freshness
|
|
26
|
+
|
|
27
|
+
Each translation records the digest of the approved title, description and
|
|
28
|
+
body it was written from. A translation is `current` when the digest matches,
|
|
29
|
+
`stale` when the approved article changed, and `missing` when no file exists.
|
|
30
|
+
Runtime metadata changes do not make a translation stale. Files whose approved
|
|
31
|
+
article no longer exists are reported as orphans and removed by the next
|
|
32
|
+
submission.
|
|
33
|
+
|
|
34
|
+
When a package declares locales and any item is not current, the workspace Route
|
|
35
|
+
selects `translate-site-locales` after package template approval and before the
|
|
36
|
+
workspace version is recorded.
|
|
37
|
+
|
|
38
|
+
## Commands
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
context translate status --format json
|
|
42
|
+
context translate prepare --format json
|
|
43
|
+
context translate submit --input <file> --format json
|
|
44
|
+
context translate skip --digest <expected_digest> --format json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`prepare` lists each pending article and navigation title with
|
|
48
|
+
`expected_digest`. `submit` accepts:
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
expected_digest: <from prepare>
|
|
52
|
+
articles:
|
|
53
|
+
- locale: zh-CN
|
|
54
|
+
approved_path: knowledge/codeindex/app/start.md
|
|
55
|
+
file: .tmp/agent-payloads/translations/zh-CN/codeindex/app/start.md
|
|
56
|
+
map_entries:
|
|
57
|
+
- locale: zh-CN
|
|
58
|
+
key: getting-started
|
|
59
|
+
title: 入门
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
A translated article keeps every `context:section` marker, id and order, every
|
|
63
|
+
fenced code block with its language and content (Mermaid labels may change), and
|
|
64
|
+
every link target. Submission validates all items first and saves nothing when
|
|
65
|
+
any item fails. A digest from before an approved content change is rejected.
|
|
66
|
+
|
|
67
|
+
`skip` records that the current pending items are published in the primary
|
|
68
|
+
language. Use it only when the user declines translation for this iteration;
|
|
69
|
+
the next approved change asks again.
|
|
70
|
+
|
|
71
|
+
## Website
|
|
72
|
+
|
|
73
|
+
Each page is published once and contains every language; the reader's language
|
|
74
|
+
selects what is shown at the same URL. A stale page shows the translation with
|
|
75
|
+
an outdated notice and a button that switches to the original; a missing page
|
|
76
|
+
shows the original with a notice. Navigation titles without a translation use
|
|
77
|
+
the translated article title, then the primary title. Site search covers every
|
|
78
|
+
language; opening a result in another language switches to it.
|
|
@@ -189,7 +189,8 @@ may be rebuilt; it is not an authoring source.
|
|
|
189
189
|
`kbPackage.site` optionally adds a VitePress website at `dist/<base>-site/` in
|
|
190
190
|
the same build, beside the KB directory. `<base>` removes one trailing `-kb`
|
|
191
191
|
from the package name, if present. Omit it for KB-only output. It accepts `title`, `description`,
|
|
192
|
-
`lang`, a deployment `base` path,
|
|
192
|
+
`lang`, a deployment `base` path, an optional top-bar `titleLink`, and an
|
|
193
|
+
optional `home` presentation. `home`
|
|
193
194
|
accepts `title`, `slogan`, `description`, hero `actions`, and `resources` shown
|
|
194
195
|
below the generated site map. Each resource needs an `href`, a copyable
|
|
195
196
|
`command`, or both. Omit unknown resources; the builder never invents service
|
|
@@ -35,6 +35,19 @@ empty diff. Inspect/edit does not advance references; delivery or an explicit
|
|
|
35
35
|
no-impact outcome settles the selected scope. Historical locators always store
|
|
36
36
|
the real repository path at the cited commit, not today's registration path.
|
|
37
37
|
|
|
38
|
+
External associations in `imports.yaml` are entrances, not recorded evidence:
|
|
39
|
+
they create no `references[]` and no review hints, and the CLI never checks
|
|
40
|
+
their versions. When the user asks to update or check external associations,
|
|
41
|
+
use existing authorized Host tools (for example `git ls-remote`, a package
|
|
42
|
+
manager or a web read) to observe each selected entry's current version and
|
|
43
|
+
compare it with its optional `version`. If it differs, read only what the
|
|
44
|
+
linked articles rely on, report whether they need revision and update
|
|
45
|
+
`version` once settled. Unreachable, unauthorized or failed checks are
|
|
46
|
+
"version unknown": report them, keep `version` unchanged, and never treat them
|
|
47
|
+
as changed. When an article's conclusion must trace or track external content,
|
|
48
|
+
register the needed part as a source and capture it; do not cite the
|
|
49
|
+
association itself as evidence.
|
|
50
|
+
|
|
38
51
|
Before starting production, compare the proposed content with the workspace's
|
|
39
52
|
reader purpose. For clearly unrelated anecdotes or personal rankings, briefly
|
|
40
53
|
recommend leaving them out of the formal manual or saving them separately because
|
|
@@ -9,7 +9,8 @@ checks real changes and an increasing SemVer; you decide the wording and impact.
|
|
|
9
9
|
Do not summarize temporary execution progress as knowledge changes.
|
|
10
10
|
|
|
11
11
|
This action is selected at completed-scope delivery, after Review, Close and
|
|
12
|
-
package configuration/template approval, before the final
|
|
12
|
+
package configuration/template approval and website translation, before the final
|
|
13
|
+
package build.
|
|
13
14
|
Record one version for the completed scope, then follow the returned workspace
|
|
14
15
|
Route to build outputs with that version. A failed build alone does not require
|
|
15
16
|
another version; retry through the Route using the recorded version. Do not
|
|
@@ -26,7 +27,7 @@ Use the returned digest in `context version record --input <file> --format json`
|
|
|
26
27
|
Input fields: `expected_digest`, `version`, `title`, `changes` (nonempty list),
|
|
27
28
|
`triggers` (nonempty list of `{kind, description}`), and optional
|
|
28
29
|
`actor: {name, kind}`. Trigger kinds are initial, note, sessions, mr, module,
|
|
29
|
-
document, navigation, repair, dist, other. Describe what actually triggered the
|
|
30
|
+
document, navigation, repair, dist, translation, other. Describe what actually triggered the
|
|
30
31
|
iteration, not merely the CLI command. Never include raw private transcripts,
|
|
31
32
|
credentials, local absolute paths or private account IDs in public history.
|
|
32
33
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: translate-site-locales
|
|
3
|
+
description: Translate approved knowledge for the website locales declared in site.locales when the workspace Route selects this action.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Run `context translate prepare --format json`. The task lists every article and
|
|
7
|
+
knowledge map title that is missing or stale for each declared locale, with the
|
|
8
|
+
`expected_digest` to submit. Approved knowledge in the primary language remains
|
|
9
|
+
the only source of truth; translations never change it.
|
|
10
|
+
|
|
11
|
+
For each article, read the approved file and write a complete translation to a
|
|
12
|
+
temporary file under `.tmp/agent-payloads/`. Keep its structure exactly:
|
|
13
|
+
|
|
14
|
+
- frontmatter contains only a translated `title` and optional `description`;
|
|
15
|
+
- keep every `context:section` marker, id and order unchanged;
|
|
16
|
+
- keep every fenced code block, language and content unchanged; only Mermaid
|
|
17
|
+
labels may be translated;
|
|
18
|
+
- keep every link target unchanged; translate link labels only;
|
|
19
|
+
- keep product names, commands, file paths, identifiers and API names as written.
|
|
20
|
+
|
|
21
|
+
Translate knowledge map titles as short navigation labels. Submit with
|
|
22
|
+
`context translate submit --input <file> --format json`. Input fields:
|
|
23
|
+
`expected_digest`, `articles` (list of `{locale, approved_path, file}`) and
|
|
24
|
+
`map_entries` (list of `{locale, key, title}`). Validation is all-or-nothing:
|
|
25
|
+
fix each reported item and submit again. A large task may be submitted in
|
|
26
|
+
several batches with the same digest; untranslated pages show the original with
|
|
27
|
+
a notice.
|
|
28
|
+
|
|
29
|
+
When the user declines translation for this iteration, run
|
|
30
|
+
`context translate skip --digest <expected_digest> --format json`. The website
|
|
31
|
+
then publishes the pending pages in the primary language with a notice. Do not
|
|
32
|
+
skip on your own judgment.
|
|
33
|
+
|
|
34
|
+
Consume the returned `workflow.current` directly. In managed mode resume
|
|
35
|
+
`context run --managed --until blocked-or-complete --format json`. Translating
|
|
36
|
+
does not authorize a commit, upload or deployment.
|