@c4a/context-cli 0.6.1-beta.4 → 0.6.1-beta.6
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 -0
- package/README.zh-CN.md +2 -0
- package/cli.js +6626 -1305
- package/package.json +3 -2
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/providers/context/graphs/workspace.yaml +1 -1
- package/providers/context/manifest.json +15 -15
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/manuals/reference/project-api.md +67 -5
- package/providers/context/resources/procedures/code-extraction.md +6 -0
- package/providers/context/resources/procedures/prose-compile.md +6 -3
- package/providers/context/resources/procedures/source-boundary.md +11 -0
- package/providers/context/resources/procedures/source-capture-detailed.md +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4a/context-cli",
|
|
3
|
-
"version": "0.6.1-beta.
|
|
3
|
+
"version": "0.6.1-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local CLI for capturing, compiling, and governing knowledge workspaces",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@c4a/agent-graph": "0.2.3",
|
|
24
|
-
"@c4a/context": "0.6.1-beta.
|
|
24
|
+
"@c4a/context": "0.6.1-beta.6",
|
|
25
25
|
"commander": "^11.0.0",
|
|
26
|
+
"fast-xml-parser": "^5.10.1",
|
|
26
27
|
"handlebars": "^4.7.8",
|
|
27
28
|
"ink": "^5.0.0",
|
|
28
29
|
"jiti": "^2.7.0",
|
package/plugins/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.6.1-beta.
|
|
1
|
+
0.6.1-beta.6
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context",
|
|
3
|
-
"version": "0.6.1-beta.
|
|
3
|
+
"version": "0.6.1-beta.6",
|
|
4
4
|
"description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "c4a"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"skills": "./skills/",
|
|
19
19
|
"interface": {
|
|
20
20
|
"displayName": "C4A Context",
|
|
21
|
-
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.1-beta.
|
|
21
|
+
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.1-beta.6",
|
|
22
22
|
"longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
|
|
23
23
|
"developerName": "c4a",
|
|
24
24
|
"category": "Productivity",
|
|
@@ -129,8 +129,8 @@ nodes:
|
|
|
129
129
|
resources:
|
|
130
130
|
required:
|
|
131
131
|
- resources/procedures/prose-compile.md
|
|
132
|
-
- resources/views/structure-current.yaml
|
|
133
132
|
recommended:
|
|
133
|
+
- resources/views/structure-current.yaml
|
|
134
134
|
- resources/semantic/compile/index.md
|
|
135
135
|
|
|
136
136
|
- id: resume-review-current-batch
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"schema": "agent-graph.bundle.v1",
|
|
3
3
|
"provider": {
|
|
4
4
|
"id": "c4a/context",
|
|
5
|
-
"version": "0.6.1-beta.
|
|
5
|
+
"version": "0.6.1-beta.6"
|
|
6
6
|
},
|
|
7
7
|
"providerManifest": "provider.yaml",
|
|
8
8
|
"graphs": [
|
|
9
9
|
{
|
|
10
10
|
"id": "workspace",
|
|
11
11
|
"path": "graphs/workspace.yaml",
|
|
12
|
-
"digest": "sha256:
|
|
12
|
+
"digest": "sha256:4b344cb9ecc03990f2a2f35aca372949917510f5957c4760fe69a651368eddbc"
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"actions": [
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
{
|
|
154
154
|
"id": "context.sdk.project-api",
|
|
155
155
|
"path": "resources/manuals/reference/project-api.md",
|
|
156
|
-
"digest": "sha256:
|
|
156
|
+
"digest": "sha256:9ab0be26aeccea79f561c7ecd01636beb97b7088ea1ddb141c3cbc96af758508"
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"id": "context.sdk.template-variables",
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
{
|
|
274
274
|
"id": "procedure.code-extraction",
|
|
275
275
|
"path": "resources/procedures/code-extraction.md",
|
|
276
|
-
"digest": "sha256:
|
|
276
|
+
"digest": "sha256:0563be260b3c37f1c7a1a9c831ba3a0c01a872ec3ddc64fd28d414e3c876f7e2"
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
"id": "procedure.document-capture",
|
|
@@ -313,17 +313,17 @@
|
|
|
313
313
|
{
|
|
314
314
|
"id": "procedure.prose-compile",
|
|
315
315
|
"path": "resources/procedures/prose-compile.md",
|
|
316
|
-
"digest": "sha256:
|
|
316
|
+
"digest": "sha256:c36ba3dcf9aa11a8759afaab2c9a99859c31acaf5f06456c4e0e6793130b7d6e"
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
319
|
"id": "procedure.source-boundary",
|
|
320
320
|
"path": "resources/procedures/source-boundary.md",
|
|
321
|
-
"digest": "sha256:
|
|
321
|
+
"digest": "sha256:99097947961d7fa5b17f9e6b9c9471aac38cec1943bd7feb414b21d6a1e26a49"
|
|
322
322
|
},
|
|
323
323
|
{
|
|
324
324
|
"id": "procedure.source-capture-detailed",
|
|
325
325
|
"path": "resources/procedures/source-capture-detailed.md",
|
|
326
|
-
"digest": "sha256:
|
|
326
|
+
"digest": "sha256:0cf764a43c33fbcf86b32a3731fec5905ebf0d312b7939059aae99a6ab0532e2"
|
|
327
327
|
},
|
|
328
328
|
{
|
|
329
329
|
"id": "procedure.verify-and-repair",
|
|
@@ -447,11 +447,11 @@
|
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
449
|
"path": "graphs/workspace.yaml",
|
|
450
|
-
"digest": "sha256:
|
|
450
|
+
"digest": "sha256:4b344cb9ecc03990f2a2f35aca372949917510f5957c4760fe69a651368eddbc"
|
|
451
451
|
},
|
|
452
452
|
{
|
|
453
453
|
"path": "provider.yaml",
|
|
454
|
-
"digest": "sha256:
|
|
454
|
+
"digest": "sha256:ad1b825734418814f1ac3673d329070228b6b8004cd821c39a3224c6d30935dd"
|
|
455
455
|
},
|
|
456
456
|
{
|
|
457
457
|
"path": "resources/diagnostics/projection-stale.md",
|
|
@@ -511,7 +511,7 @@
|
|
|
511
511
|
},
|
|
512
512
|
{
|
|
513
513
|
"path": "resources/manuals/reference/project-api.md",
|
|
514
|
-
"digest": "sha256:
|
|
514
|
+
"digest": "sha256:9ab0be26aeccea79f561c7ecd01636beb97b7088ea1ddb141c3cbc96af758508"
|
|
515
515
|
},
|
|
516
516
|
{
|
|
517
517
|
"path": "resources/manuals/reference/template-variables.md",
|
|
@@ -523,7 +523,7 @@
|
|
|
523
523
|
},
|
|
524
524
|
{
|
|
525
525
|
"path": "resources/procedures/code-extraction.md",
|
|
526
|
-
"digest": "sha256:
|
|
526
|
+
"digest": "sha256:0563be260b3c37f1c7a1a9c831ba3a0c01a872ec3ddc64fd28d414e3c876f7e2"
|
|
527
527
|
},
|
|
528
528
|
{
|
|
529
529
|
"path": "resources/procedures/document-capture.md",
|
|
@@ -555,15 +555,15 @@
|
|
|
555
555
|
},
|
|
556
556
|
{
|
|
557
557
|
"path": "resources/procedures/prose-compile.md",
|
|
558
|
-
"digest": "sha256:
|
|
558
|
+
"digest": "sha256:c36ba3dcf9aa11a8759afaab2c9a99859c31acaf5f06456c4e0e6793130b7d6e"
|
|
559
559
|
},
|
|
560
560
|
{
|
|
561
561
|
"path": "resources/procedures/source-boundary.md",
|
|
562
|
-
"digest": "sha256:
|
|
562
|
+
"digest": "sha256:99097947961d7fa5b17f9e6b9c9471aac38cec1943bd7feb414b21d6a1e26a49"
|
|
563
563
|
},
|
|
564
564
|
{
|
|
565
565
|
"path": "resources/procedures/source-capture-detailed.md",
|
|
566
|
-
"digest": "sha256:
|
|
566
|
+
"digest": "sha256:0cf764a43c33fbcf86b32a3731fec5905ebf0d312b7939059aae99a6ab0532e2"
|
|
567
567
|
},
|
|
568
568
|
{
|
|
569
569
|
"path": "resources/procedures/verify-and-repair.md",
|
|
@@ -633,5 +633,5 @@
|
|
|
633
633
|
"graphDependencies": {
|
|
634
634
|
"workspace": []
|
|
635
635
|
},
|
|
636
|
-
"digest": "sha256:
|
|
636
|
+
"digest": "sha256:9496e5137e372e4711605465046811bf322c53603bc7b8c5fbfa07df0862d0eb"
|
|
637
637
|
}
|
|
@@ -338,9 +338,20 @@ Register each source with
|
|
|
338
338
|
flag: `--url`, `--doc-token`, or `--wiki-token`. Multiple documents may share
|
|
339
339
|
one date batch; when `--module` is omitted, the CLI derives an opaque,
|
|
340
340
|
credential-safe module id. Capture reads the
|
|
341
|
-
remote document through the CLI runner
|
|
342
|
-
|
|
343
|
-
|
|
341
|
+
remote document through the CLI runner as structured Docx XML. Context keeps a
|
|
342
|
+
redacted XML audit asset, projects supported blocks deterministically into
|
|
343
|
+
readable Markdown, and registers external resources such as document citations,
|
|
344
|
+
images, video, whiteboards, and Base references in the snapshot manifest even
|
|
345
|
+
when their binary content is not downloaded. The projection does not infer or
|
|
346
|
+
summarize document meaning. Its fidelity report closes discovered blocks
|
|
347
|
+
against converted and intentionally skipped blocks and reports evidence
|
|
348
|
+
completeness separately from Markdown projection quality. Unknown non-empty XML
|
|
349
|
+
blocks receive a generic, auditable, non-interactive projection and do not block
|
|
350
|
+
downstream work. Missing source content or unresolved external-resource identity
|
|
351
|
+
remains an evidence error and prevents downstream Review.
|
|
352
|
+
Snapshot files live under `sources/lark/<date>/` as sibling document files
|
|
353
|
+
tracked by one date-level `manifest.json`. Access credentials and transient
|
|
354
|
+
signed media URLs are not written into the workspace.
|
|
344
355
|
|
|
345
356
|
Use a typed document reference in project declarations:
|
|
346
357
|
|
|
@@ -648,6 +659,56 @@ lookup exact when multiple files contain the same symbol name, kind, and digest;
|
|
|
648
659
|
the complete ref remains opaque to agents. New pages keep only top-level
|
|
649
660
|
`candidate_fingerprint` and do not emit `code_origin`.
|
|
650
661
|
|
|
662
|
+
### `extractCustom`
|
|
663
|
+
|
|
664
|
+
Use a project-owned extractor when code facts cannot be represented by the
|
|
665
|
+
TypeScript symbol extractor, for example a language-specific parser or an
|
|
666
|
+
aggregated repository protocol:
|
|
667
|
+
|
|
668
|
+
```ts
|
|
669
|
+
extractCustom({
|
|
670
|
+
id: "extract:service:protocol",
|
|
671
|
+
sources: [service],
|
|
672
|
+
collection: "codegraph",
|
|
673
|
+
extract: async ({ projectRoot }) => ({
|
|
674
|
+
candidates: [{
|
|
675
|
+
nodeRef: "service/protocol",
|
|
676
|
+
kind: "protocol",
|
|
677
|
+
visibility: "exported",
|
|
678
|
+
module: "service",
|
|
679
|
+
markdown: renderProtocol(projectRoot),
|
|
680
|
+
evidence: [{
|
|
681
|
+
source: "20260811/service",
|
|
682
|
+
file: "src/protocol.ts",
|
|
683
|
+
symbol: "protocol",
|
|
684
|
+
kind: "variable",
|
|
685
|
+
digest: "0123456789ab",
|
|
686
|
+
}],
|
|
687
|
+
review: {
|
|
688
|
+
title: "Service protocol",
|
|
689
|
+
summary: "Aggregated protocol boundary.",
|
|
690
|
+
signals: ["source-backed"],
|
|
691
|
+
reason: "Review the project-owned extraction.",
|
|
692
|
+
},
|
|
693
|
+
}],
|
|
694
|
+
}),
|
|
695
|
+
});
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
`sources` is the complete registered repo scope for the phase. Every candidate
|
|
699
|
+
and edge carries structured `evidence`; the CLI validates that evidence against
|
|
700
|
+
the declared sources, creates canonical `source_ref` values, writes the symbol
|
|
701
|
+
index, candidate ledger and Review snapshots atomically, and records a phase
|
|
702
|
+
fingerprint. `context status` therefore treats this phase exactly like another
|
|
703
|
+
pending code extraction target, and Review can verify snapshot freshness
|
|
704
|
+
without a placeholder `extractTs` phase.
|
|
705
|
+
|
|
706
|
+
The extractor returns knowledge semantics (`nodeRef`, rendered Markdown,
|
|
707
|
+
Review summary and source-backed evidence). It must not write `knowledge/`,
|
|
708
|
+
`.tmp/context-runtime/lifecycle/candidates.jsonl`, extraction fingerprints or
|
|
709
|
+
Review snapshots directly. Context owns those files and preserves rejected and
|
|
710
|
+
unchanged-approved decisions across reruns.
|
|
711
|
+
|
|
651
712
|
### `reviewValidity`
|
|
652
713
|
|
|
653
714
|
Declare the review step for a collection:
|
|
@@ -719,8 +780,9 @@ customPhase("custom:20260712/sample:review", async (ctx) => {
|
|
|
719
780
|
});
|
|
720
781
|
```
|
|
721
782
|
|
|
722
|
-
Custom phases are an escape hatch.
|
|
723
|
-
|
|
783
|
+
Custom phases are an orchestration escape hatch. Use `extractCustom()` instead
|
|
784
|
+
when project code needs to publish codegraph candidates. The supported runtime
|
|
785
|
+
helpers are:
|
|
724
786
|
|
|
725
787
|
- `ctx.ensureSources(...)` for repo source readiness.
|
|
726
788
|
- `ctx.extract.ts(...)` for declared TypeScript extraction.
|
|
@@ -42,3 +42,9 @@ package inventory's `structure.relationship_coverage` to distinguish a current
|
|
|
42
42
|
source-backed extraction that found no approved edges from an older or
|
|
43
43
|
otherwise unknown relationship mode. Never infer missing edges from symbol
|
|
44
44
|
co-occurrence, filenames, or package size.
|
|
45
|
+
|
|
46
|
+
When the built-in TypeScript extractor cannot represent the code source, use a
|
|
47
|
+
declared `extractCustom` phase. The project-owned callback returns candidate
|
|
48
|
+
semantics plus structured source evidence; Context owns canonical refs,
|
|
49
|
+
fingerprints, candidate storage, Review snapshots, freshness, and rerun cleanup.
|
|
50
|
+
Do not use a generic `customPhase` callback to write lifecycle files directly.
|
|
@@ -15,6 +15,9 @@ by the current Route. Do not create compile-action payloads or rewrite source
|
|
|
15
15
|
content.
|
|
16
16
|
|
|
17
17
|
One compile command validates every owned view first, then atomically
|
|
18
|
-
materializes the source/collection candidate batch.
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
materializes the source/collection candidate batch. In an explicitly managed
|
|
19
|
+
conversation, the host loop may continue across the remaining deterministic
|
|
20
|
+
compile slots after this procedure has been read; it re-evaluates revision and
|
|
21
|
+
validation state after every write. The current structure view is optional
|
|
22
|
+
inspection context because the CLI consumes the confirmed structure directly.
|
|
23
|
+
Do not open a partial Review while planned views remain.
|
|
@@ -30,6 +30,17 @@ them. A date-only inspection addresses the batch; `<date>/<module>` addresses
|
|
|
30
30
|
one source. Register a confirmed multi-source request as one serial batch
|
|
31
31
|
mutation instead of running registry writes in parallel.
|
|
32
32
|
|
|
33
|
+
To retire a registered source, first run `context source remove <source-id>
|
|
34
|
+
--format json`. This is a read-only preview that lists every project, candidate,
|
|
35
|
+
or approved-knowledge reference. Only after those references are intentionally
|
|
36
|
+
resolved may the route use `--yes`; the CLI never silently deletes referenced
|
|
37
|
+
knowledge or another source's materialized files. Execute the exact
|
|
38
|
+
digest-bound command returned by the preview. For a shared document batch, the
|
|
39
|
+
manifest entry is the ownership boundary: removal deletes only that entry and
|
|
40
|
+
its explicitly listed files/assets. An uncaptured module has no manifest entry,
|
|
41
|
+
so removal is registry-only; the shared date directory is never inferred as
|
|
42
|
+
module-owned.
|
|
43
|
+
|
|
33
44
|
Repository readiness checks are mechanical and may run after the boundary is
|
|
34
45
|
registered. Clone, fetch, checkout, install, build, test, and other external
|
|
35
46
|
repository operations need separate authority. File and remote-document
|
|
@@ -51,6 +51,19 @@ user's language. Never hand-write captured source snapshots: the
|
|
|
51
51
|
CLI owns normalisation (NFC, BOM strip, line endings) and the `content_hash`
|
|
52
52
|
contract, so any manual edit breaks idempotency.
|
|
53
53
|
|
|
54
|
+
Lark capture obtains the structured XML representation and produces two
|
|
55
|
+
separate artifacts: XML audit evidence and a deterministic readable Markdown
|
|
56
|
+
projection. Do not treat raw XML as Markdown and do not rewrite it yourself.
|
|
57
|
+
Inspect `evidence_status` and `projection_status` separately. An evidence error
|
|
58
|
+
means the source body, external content, or a stable resource locator could not
|
|
59
|
+
be preserved, so the workflow must not proceed to Align, Compile, or Review.
|
|
60
|
+
A projection warning or `generic` status means the original XML is preserved
|
|
61
|
+
and a deterministic non-interactive Markdown fallback was emitted; report the
|
|
62
|
+
diagnostic, but continue through the Route. The CLI, not the plugin, parses the
|
|
63
|
+
document. The plugin only displays the structured counts and diagnostics
|
|
64
|
+
returned by the current source resource. Do not patch the CLI or edit snapshots
|
|
65
|
+
to add a renderer from a user workspace.
|
|
66
|
+
|
|
54
67
|
### Code capture diagnostics
|
|
55
68
|
|
|
56
69
|
Do not run hand-written dependency preflight commands before code extraction or
|