@c4a/context-cli 0.7.10-alpha.2 → 0.7.11
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 +2 -2
- package/README.zh-CN.md +3 -3
- package/cli.js +2034 -925
- package/indexers/bundles/context-code-indexer/references/indexer.md +25 -1
- package/indexers/bundles/context-code-indexer/templates/adapter-integration.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/api-service.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/background-runtime.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/cli-tool.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/component-library.md +4 -4
- package/indexers/bundles/context-code-indexer/templates/contract-source.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +6 -8
- package/indexers/bundles/context-code-indexer/templates/domain-service.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/monorepo-container.md +1 -1
- package/indexers/bundles/context-code-indexer/templates/sdk-library.md +1 -2
- package/indexers/bundles/context-code-indexer/templates/web-application.md +1 -1
- package/indexers/bundles/context-markdown-indexer/references/indexer.md +7 -2
- package/indexers/bundles/context-markdown-indexer/references/semantic-planning.md +9 -6
- package/indexers/contracts/profile-contract.json +245 -245
- package/indexers/release-manifest.json +17 -17
- package/package.json +12 -12
- package/parserEntryWorker.js +43 -10
- package/plugins/README.md +1 -1
- package/plugins/README_CN.md +1 -1
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/context.md +37 -73
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/context/SKILL.md +37 -73
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/commands/c4a-context.md +37 -73
- package/plugins/skills/context/SKILL.md +37 -73
- package/plugins/skills/context-code-indexer/references/indexer.md +25 -1
- package/plugins/skills/context-code-indexer/templates/adapter-integration.md +1 -1
- package/plugins/skills/context-code-indexer/templates/api-service.md +1 -1
- package/plugins/skills/context-code-indexer/templates/background-runtime.md +1 -1
- package/plugins/skills/context-code-indexer/templates/cli-tool.md +1 -1
- package/plugins/skills/context-code-indexer/templates/component-library.md +4 -4
- package/plugins/skills/context-code-indexer/templates/contract-source.md +1 -1
- package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +6 -8
- package/plugins/skills/context-code-indexer/templates/domain-service.md +1 -1
- package/plugins/skills/context-code-indexer/templates/monorepo-container.md +1 -1
- package/plugins/skills/context-code-indexer/templates/sdk-library.md +1 -2
- package/plugins/skills/context-code-indexer/templates/web-application.md +1 -1
- package/plugins/skills/context-markdown-indexer/references/indexer.md +7 -2
- package/plugins/skills/context-markdown-indexer/references/semantic-planning.md +9 -6
- package/providers/context/graphs/workspace.yaml +1 -22
- package/providers/context/manifest.json +34 -70
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/manuals/guides/indexer-provider-and-customization.md +0 -2
- package/providers/context/resources/manuals/guides/knowledge-updates.md +108 -5
- package/providers/context/resources/manuals/guides/package-outputs.md +39 -1
- package/providers/context/resources/manuals/guides/workspace-prepare.md +17 -0
- package/providers/context/resources/manuals/reference/project-api.md +58 -19
- package/providers/context/resources/procedures/close-and-build.md +21 -0
- package/providers/context/resources/procedures/knowledge-review.md +18 -2
- package/providers/context/resources/procedures/knowledge-updates.md +108 -5
- package/providers/context/resources/procedures/package-output.md +18 -0
- package/providers/context/resources/procedures/production-stage-files.md +35 -0
- package/providers/context/resources/procedures/repository-source-recovery.md +5 -3
- package/providers/context/resources/procedures/source-capture-detailed.md +16 -2
- package/providers/context/resources/procedures/task-recovery.md +6 -0
- package/providers/context/resources/procedures/work-start-report.md +24 -11
- package/providers/context/resources/procedures/workspace-prepare.md +17 -0
- package/providers/context/resources/templates/work-start-report.md +11 -6
- package/providers/context/actions/inspect-repository-recovery.yaml +0 -6
- package/providers/context/actions/restore-repository-sources.yaml +0 -7
- package/providers/context/resources/dialogue/repository-source-recovery.md +0 -23
- package/providers/context/schemas/repository-source-recovery.schema.json +0 -40
|
@@ -10,7 +10,9 @@ Repository checkout contents and materialized module links are local runtime
|
|
|
10
10
|
inputs. Git stores their recovery recipe in `sources/repo/index.yaml`; it does
|
|
11
11
|
not store the checkout, local aliases, or `sources/repo/<date>/<module>` links.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Recover only repositories required by the current task, not all registered
|
|
14
|
+
checkouts before an unrelated document or Note update. Run
|
|
15
|
+
`context source recovery-plan <registered-name> --format json` first. It groups logical modules by registered
|
|
14
16
|
remote and pinned commit, so one physical checkout can restore every module in
|
|
15
17
|
that group. Do not create one clone per module. Groups already marked `ready`
|
|
16
18
|
need no decision; when every group is ready, the plan has no recovery action.
|
|
@@ -39,5 +41,5 @@ materializes module links.
|
|
|
39
41
|
|
|
40
42
|
Repository sources are ready only when every selected module resolves to the
|
|
41
43
|
registered remote and pinned commit, every registered subpath exists, no local
|
|
42
|
-
path was overwritten, Context materialization succeeds, and the
|
|
43
|
-
|
|
44
|
+
path was overwritten, Context materialization succeeds, and the selected recovery
|
|
45
|
+
plan reports them ready.
|
|
@@ -121,6 +121,14 @@ manager or version.
|
|
|
121
121
|
|
|
122
122
|
### Route by source boundary
|
|
123
123
|
|
|
124
|
+
For explicitly selected sources needing ordinary capture settings, use
|
|
125
|
+
`source add ... --configure` (also supported by `source add batch`) to register
|
|
126
|
+
and generate explicit `src/index.ts` declarations in one call. This does not
|
|
127
|
+
capture, select unrelated registrations, or change output settings. Inspect the
|
|
128
|
+
returned configuration result: custom/dynamic entries return `manual` and remain
|
|
129
|
+
unchanged; preserve them and make a focused edit. If special processors/resources
|
|
130
|
+
are needed, configure those before capture. Do not retry generation in a loop.
|
|
131
|
+
|
|
124
132
|
Before choosing a local Markdown capture route, honor the surrounding task context. Driver documents such as run instructions, handbooks, READMEs, plans, feedback issues, corpus/index/manifests, and batch lists are not Context sources unless the user explicitly asks to ingest them. Capture only ingest targets that are already explicit in the user request; if they are missing, ask one clarification instead of capturing the driver document.
|
|
125
133
|
|
|
126
134
|
- One or more local `.md` / `.mdx` files or a local documentation folder to ingest →
|
|
@@ -147,15 +155,21 @@ Before choosing a local Markdown capture route, honor the surrounding task conte
|
|
|
147
155
|
- A Lark/Feishu URL, doc token, or wiki token → register one Lark source:
|
|
148
156
|
`context source add lark [YYYYMMDD] --module <module> --url <url>` or the
|
|
149
157
|
matching token flag. Register every requested document under the same date;
|
|
150
|
-
do not ask for `YYYYMMDD-2`.
|
|
158
|
+
do not ask for `YYYYMMDD-2`. For multiple documents, use the shared configuration
|
|
159
|
+
pattern below rather than repeating declarations. For a single document, declare
|
|
151
160
|
`captureLark({ source: source("<date>", "<module>", { type: "lark" }) })`,
|
|
152
|
-
then
|
|
161
|
+
then follow the current Route to execute capture.
|
|
153
162
|
- For a registered document batch with shared capture settings, use
|
|
154
163
|
[Batch capture from the source registry](../manuals/reference/project-api.md#batch-capture-from-the-source-registry)
|
|
155
164
|
to load the registry and generate typed references and phases. Do not transcribe
|
|
156
165
|
the full YAML module list into `src/index.ts`. Select only the intended entries;
|
|
157
166
|
use the entire registry only when all its documents are in scope. Preserve
|
|
158
167
|
existing phases/packages and keep processor or resource exceptions per document.
|
|
168
|
+
Prefer this pattern even for two documents with the same settings. It reduces
|
|
169
|
+
configuration repetition, not capture operations or permission boundaries.
|
|
170
|
+
Independent source identities do not require independent articles: plan and
|
|
171
|
+
write across related captured documents by reader task, not one production
|
|
172
|
+
cycle per input document.
|
|
159
173
|
- Mixed local document and Lark document batches are separate sources unless
|
|
160
174
|
the current CLI explicitly offers a combined source contract. Mapping registered
|
|
161
175
|
entries into declarative SDK phases is supported; writing an Agent-side loop
|
|
@@ -15,6 +15,12 @@ its progress is changing. Never start a competing writer or delete a writer lock
|
|
|
15
15
|
|
|
16
16
|
## Choose the smallest applicable action
|
|
17
17
|
|
|
18
|
+
- Orphan writer lock: preview `task recover --operation writer-lock`. Before
|
|
19
|
+
applying its current digest, pause new workspace commands and confirm no child
|
|
20
|
+
writer or other host/container still uses the workspace. Apply archives only
|
|
21
|
+
the unchanged lock whose owner is no longer running; it does not complete any
|
|
22
|
+
capture. Run recovery inspection again for interrupted transactions, then
|
|
23
|
+
refresh the Route. Unknown or active ownership must not be bypassed.
|
|
18
24
|
- Wrong current payload: use the reported schema/evidence to correct it and refresh
|
|
19
25
|
the Route when available. A current candidate can use its ordinary revise action.
|
|
20
26
|
- Interrupted transaction: preview `task recover --operation transactions`, inspect
|
|
@@ -27,8 +27,10 @@ first, then use documents and selectively read business definitions to correct
|
|
|
27
27
|
reader topics. Directory names are orientation, not verified business semantics.
|
|
28
28
|
Documents need not fit a code-shaped menu.
|
|
29
29
|
|
|
30
|
-
Code investigation
|
|
31
|
-
paths and
|
|
30
|
+
Code investigation identifies the authorized capability families, checked entry
|
|
31
|
+
paths and remaining ranges, not full symbols or call graphs. Broad scope calls for
|
|
32
|
+
horizontal discovery, not deep reading of every implementation before writing.
|
|
33
|
+
Document
|
|
32
34
|
overviews include titles, bounded introductory text, the full H2/H3 hierarchy and
|
|
33
35
|
full-text access. Read more when the overview cannot settle a semantic choice.
|
|
34
36
|
Do not run additional parsers merely to populate counts or tables.
|
|
@@ -38,17 +40,24 @@ confirmed/provisional topics, unchecked ranges and delivery implications. If
|
|
|
38
40
|
document acquisition is blocked, ask whether a limited first scope is acceptable;
|
|
39
41
|
do not silently omit supplied documents or claim full coverage from partial scans.
|
|
40
42
|
|
|
41
|
-
Small, clearly scoped revisions, notes and
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
Small, clearly scoped document tasks, single-module work, revisions, notes and
|
|
44
|
+
conversation summaries can use a short handling proposal: which related articles
|
|
45
|
+
to add or revise, their reading position and the intended result. A module with
|
|
46
|
+
several reader topics may need more planning within that module, not a redesign
|
|
47
|
+
of the whole knowledge base. Do not invent an independent investigation, batch
|
|
48
|
+
hierarchy or dependency analysis to fill a report. This changes report depth, not
|
|
49
|
+
the current Route's approval boundary.
|
|
44
50
|
|
|
45
51
|
## Explain the proposed work
|
|
46
52
|
|
|
47
|
-
Write in the user's language. Open with the reader's task and
|
|
48
|
-
|
|
49
|
-
topics, reuse or revision of existing articles
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
Write in the user's language. Open with the reader's task and whole requested
|
|
54
|
+
outcome, then distinguish the current delivery and remaining work. Explain source
|
|
55
|
+
versions, topics, reuse or revision of existing articles and useful dependencies,
|
|
56
|
+
not protocol IDs. State which topics provide checked problem-level entry points
|
|
57
|
+
and which explain behavior or operations. Package names alone are not that depth.
|
|
58
|
+
Keep material, planned article and investigated-scope counts separate; unknown
|
|
59
|
+
totals are not zero. Describe remaining capability families or document tasks in
|
|
60
|
+
the existing plan/report, without a per-file ledger or another confirmation step.
|
|
52
61
|
|
|
53
62
|
Explain relevant conflicts, gaps, exclusions and decisions requiring feedback.
|
|
54
63
|
Access permission alone does not approve a semantic exclusion. Distinguish user
|
|
@@ -60,12 +69,14 @@ per-module ownership tables. One module may use several Indexers and one article
|
|
|
60
69
|
may combine their materials. Optional specialist absence does not exclude sources.
|
|
61
70
|
|
|
62
71
|
Reuse selected KB, website and LLMS delivery channels. For website delivery,
|
|
63
|
-
include a compact proposed menu and layout: top-level groups, a representative
|
|
72
|
+
for a new site or requested navigation redesign, include a compact proposed menu and layout: top-level groups, a representative
|
|
64
73
|
left menu, article chapters and on-page outline. Explain mobile behavior briefly
|
|
65
74
|
when relevant. This is a sketch, not a built site; do not create empty articles,
|
|
66
75
|
temporary websites or promise deployment. Link the existing requirement or
|
|
67
76
|
workspace configuration rather than creating a permanent report identity.
|
|
68
77
|
Estimate timing or savings only when supported by measurements and conditions.
|
|
78
|
+
For a small addition to an existing site, describe only the affected reading
|
|
79
|
+
position; reuse its layout and delivery choices instead of proposing them again.
|
|
69
80
|
|
|
70
81
|
## Mandatory feedback
|
|
71
82
|
|
|
@@ -90,6 +101,8 @@ pause. Actual scale belongs in the report whose pre-writing feedback is mandator
|
|
|
90
101
|
Use current CLI task and stage progress; distinguish accepted candidates, approved
|
|
91
102
|
articles and delivered outputs. The current batch is not the whole goal. Do not
|
|
92
103
|
treat input rechecks as loss of formal articles or candidates as delivered pages.
|
|
104
|
+
Task completion concerns the declared plan; navigation coverage concerns existing
|
|
105
|
+
articles. Neither proves that all authorized source topics have been explained.
|
|
93
106
|
|
|
94
107
|
Reports, plans, skills, candidates, confirmation and transaction process stay in
|
|
95
108
|
`.tmp`. Only formal results and necessary long-term source/requirement decisions
|
|
@@ -42,6 +42,23 @@ reports, unique material, unknown files and modified checkouts unless their
|
|
|
42
42
|
specific loss is authorized. Do not delete locks, transaction records or active
|
|
43
43
|
tool directories. Empty task directories can remain.
|
|
44
44
|
|
|
45
|
+
Prefer cleanup after successful delivery, not immediately after close: version
|
|
46
|
+
recording, build and retries may still need the current task. Completed production
|
|
47
|
+
drafts and Review state are removed by delivery cleanup. Do not invoke
|
|
48
|
+
`task resume` merely to make a completed workspace advance; it starts a new task
|
|
49
|
+
and requires an actual new user request.
|
|
50
|
+
|
|
51
|
+
Keep repository checkouts referenced by registered sources, including fixed
|
|
52
|
+
commits: removing them can force a costly clone before the next update. Keep
|
|
53
|
+
pending telemetry and source-region baselines; losing the latter reduces the
|
|
54
|
+
ability to distinguish relocated text from changed text. Debug and historical
|
|
55
|
+
views may be archived or removed after diagnosis when no operation is active,
|
|
56
|
+
but unknown Agent files are not automatically disposable.
|
|
57
|
+
|
|
58
|
+
After all scratch state is lost, an existing build receipt defaults the workspace
|
|
59
|
+
to waiting for an explicit new task. This does not restore lost drafts or prove
|
|
60
|
+
sources and outputs are current. Use the recovery checks below before resuming.
|
|
61
|
+
|
|
45
62
|
## Restore usable sources
|
|
46
63
|
|
|
47
64
|
For repositories, run `context source recovery-plan --format json` and read
|
|
@@ -10,11 +10,11 @@ Write `.tmp/work-start-report.md` in the user's language after lightweight
|
|
|
10
10
|
investigation and planning. Adapt this outline; omit empty sections and template
|
|
11
11
|
instructions. Headings are not a questionnaire or mandatory schema.
|
|
12
12
|
|
|
13
|
-
## Readers and
|
|
13
|
+
## Readers, whole goal and current delivery
|
|
14
14
|
|
|
15
|
-
Explain who will use the knowledge,
|
|
16
|
-
reviewed delivery enables.
|
|
17
|
-
|
|
15
|
+
Explain who will use the knowledge, the whole requested outcome and what this
|
|
16
|
+
reviewed delivery enables. Distinguish a first useful batch from the final scope.
|
|
17
|
+
Reuse confirmed purpose, priorities, language and delivery choices.
|
|
18
18
|
|
|
19
19
|
## What the materials support
|
|
20
20
|
|
|
@@ -33,6 +33,9 @@ Use this table only when several groups need comparison:
|
|
|
33
33
|
Keep material counts separate from article counts. Do not produce a per-file
|
|
34
34
|
accounting table. One article may use several sources and Indexers. Batches are
|
|
35
35
|
execution groupings, not fixed article templates or mandatory route transitions.
|
|
36
|
+
State the useful depth for each topic: a specific investigation entry, an
|
|
37
|
+
explanation or an executable procedure. Name still-unplanned capability families
|
|
38
|
+
and document tasks rather than hiding them behind completion of this table.
|
|
36
39
|
|
|
37
40
|
## Reading organization and delivery
|
|
38
41
|
|
|
@@ -43,8 +46,10 @@ duplicating bodies. Retain existing KB, website and LLMS delivery choices.
|
|
|
43
46
|
|
|
44
47
|
For website delivery, add a compact sketch showing the site title, top-level
|
|
45
48
|
groups, a representative left menu, article chapters and on-page outline.
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
For a new homepage or requested redesign, also propose a short title, slogan,
|
|
50
|
+
description and the verified optional resource cards. Briefly explain mobile
|
|
51
|
+
menus when relevant. A sketch is not a built website or permission to create
|
|
52
|
+
empty pages. Do not infer business semantics from code paths or invent links.
|
|
48
53
|
|
|
49
54
|
## Relevant indexing guidance
|
|
50
55
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
schema: agent-graph.action.v1
|
|
2
|
-
id: restore-repository-sources
|
|
3
|
-
description: Restore registered repository sources from user-confirmed local paths or explicit clones.
|
|
4
|
-
runner: command
|
|
5
|
-
effect: external
|
|
6
|
-
command: context source restore --input .tmp/agent-payloads/repository-source-recovery.json --format json
|
|
7
|
-
inputSchema: schemas/repository-source-recovery.schema.json
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: dialogue.repository-source-recovery
|
|
3
|
-
kind: procedure
|
|
4
|
-
mediaType: text/markdown
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Repository source recovery dialogue
|
|
8
|
-
|
|
9
|
-
Explain that the Context project is intact: only Git-ignored source checkouts
|
|
10
|
-
or local links are missing. Show one choice per physical repository, not per
|
|
11
|
-
logical module.
|
|
12
|
-
|
|
13
|
-
For an existing checkout, ask for its path or ask the user to authorize a
|
|
14
|
-
specific parent directory for a bounded scan. Show matching candidates with
|
|
15
|
-
their origin, HEAD, dirty state, and required subpath coverage before the user
|
|
16
|
-
selects one. Do not modify, switch, clean, or pull the selected checkout.
|
|
17
|
-
|
|
18
|
-
For a clone, show the registered remote, pinned commit, target directory, and
|
|
19
|
-
the logical modules that will share it. The clone restores the recorded source
|
|
20
|
-
version; it does not silently advance to the latest branch.
|
|
21
|
-
|
|
22
|
-
After recovery, summarize reused and cloned checkouts, actual commits, restored
|
|
23
|
-
module links, and any remaining permission or missing-subpath blockers.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "context.repository-source-recovery.v1",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"additionalProperties": false,
|
|
6
|
-
"required": ["schema", "repositories"],
|
|
7
|
-
"properties": {
|
|
8
|
-
"schema": {
|
|
9
|
-
"const": "context.repository-source-recovery.v1"
|
|
10
|
-
},
|
|
11
|
-
"repositories": {
|
|
12
|
-
"type": "array",
|
|
13
|
-
"minItems": 1,
|
|
14
|
-
"items": {
|
|
15
|
-
"oneOf": [
|
|
16
|
-
{
|
|
17
|
-
"type": "object",
|
|
18
|
-
"additionalProperties": false,
|
|
19
|
-
"required": ["source", "mode", "path"],
|
|
20
|
-
"properties": {
|
|
21
|
-
"source": { "type": "string", "minLength": 1 },
|
|
22
|
-
"mode": { "const": "local" },
|
|
23
|
-
"path": { "type": "string", "minLength": 1 }
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"type": "object",
|
|
28
|
-
"additionalProperties": false,
|
|
29
|
-
"required": ["source", "mode"],
|
|
30
|
-
"properties": {
|
|
31
|
-
"source": { "type": "string", "minLength": 1 },
|
|
32
|
-
"mode": { "const": "clone" },
|
|
33
|
-
"path": { "type": "string", "minLength": 1 }
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|