@c4a/context-cli 0.5.35-beta.3 → 0.5.38
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 +7 -7
- package/cli.js +47004 -34404
- package/package.json +2 -1
- package/plugin/README.md +2 -2
- package/plugin/README_CN.md +2 -2
- package/plugin/commands/align.md +32 -98
- package/plugin/commands/capture.md +12 -13
- package/plugin/commands/compile.md +78 -149
- package/plugin/commands/init.md +15 -13
- package/plugin/commands/status.md +2 -0
- package/plugin/skills/skill-align-workflow/SKILL.md +41 -83
- package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +1 -1
- package/plugin/skills/skill-align-workflow/references/density-profile.md +2 -0
- package/plugin/skills/skill-compile-close/SKILL.md +7 -9
- package/plugin/skills/skill-compile-draft/SKILL.md +43 -83
- package/plugin/skills/skill-compile-draft/references/notes.md +3 -3
- package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +5 -5
- package/plugin/skills/skill-compile-draft/references/structural-challenges.md +1 -1
- package/plugin/skills/skill-compile-judge/SKILL.md +15 -12
- package/plugin/skills/skill-semantic-reconcile/SKILL.md +7 -7
- package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +1 -1
- package/scripts/build-plugin.ts +8 -6
- package/templates/aspect-runtime/aspectRunnerSdk.ts +749 -0
- package/templates/aspects/README.md +515 -0
- package/templates/aspects/code/aspect.yaml +2 -2
- package/templates/aspects/code/prompt.md +13 -12
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ context --version
|
|
|
21
21
|
# 2. Install the plugin for your editor.
|
|
22
22
|
# Claude Code:
|
|
23
23
|
claude /plugin marketplace add context4ai/context
|
|
24
|
-
claude /plugin install context@
|
|
24
|
+
claude /plugin install context@c4a
|
|
25
25
|
|
|
26
26
|
# Codex CLI:
|
|
27
27
|
codex marketplace add context4ai/context
|
|
@@ -59,8 +59,8 @@ context capture --inbox
|
|
|
59
59
|
context capture --code packages/extract --plan --format json
|
|
60
60
|
context capture --code --module packages/extract --version-from package
|
|
61
61
|
context capture --code # refresh existing code capture config
|
|
62
|
-
context compile
|
|
63
|
-
context compile
|
|
62
|
+
context compile code <source-slug>
|
|
63
|
+
context compile close
|
|
64
64
|
|
|
65
65
|
# In Claude Code, align → compile → drop are agent-driven
|
|
66
66
|
/context:align # agent classifies raw into a Node tree; user confirms
|
|
@@ -82,7 +82,7 @@ Agent-facing output should be stable by construction: shared protocol/schema/loo
|
|
|
82
82
|
|
|
83
83
|
`source_ref` is an opaque citation token. Copy it into citations and decisions exactly as printed; do not parse it or dereference it as a file path. Human/report views may show clickable files for user inspection. Developer/debug-only `context debug ...` commands may expose storage paths for diagnostics, but those values are not production Agent workflow inputs.
|
|
84
84
|
|
|
85
|
-
Code knowledge uses a code-first route. `context capture --code` records a raw code snapshot; `context compile
|
|
85
|
+
Code knowledge uses a code-first route. `context capture --code` records a raw code snapshot; `context compile code <source-slug>` materializes it into package/category/symbol Nodes such as `pkg`, `pkg/components`, and `pkg/symbol/button`. Package roots and category files are navigation surfaces, while concrete symbol Nodes carry code-owned Sections and can later retain doc-owned examples or manual notes. Agents should address these Nodes by slug and query metadata (`source_id`, `source_type`, `evidence_kind`, `source_ref`, `code_projection_status`) rather than by source file paths.
|
|
86
86
|
|
|
87
87
|
## Developer Storage Layout
|
|
88
88
|
|
|
@@ -105,7 +105,7 @@ Embedded layout (default):
|
|
|
105
105
|
│ └── archive/ # archived workflow scratch
|
|
106
106
|
├── .cache/ # ignored internal cache, including current align binding
|
|
107
107
|
├── knowledge/ # synthesized articles (CLI-rendered, agent-directed)
|
|
108
|
-
│ ├── _index.md # workspace index (derivable, rebuilt by compile
|
|
108
|
+
│ ├── _index.md # workspace index (derivable, rebuilt by compile close)
|
|
109
109
|
│ ├── changelog.md # append-only compile / drop log (derivable from git)
|
|
110
110
|
│ ├── domain/ entity/ action/ # one directory per Node type
|
|
111
111
|
├── archive/ # dropped but restorable raw / knowledge artifacts
|
|
@@ -133,8 +133,8 @@ Workflow payload exploration uses a single Agent-facing query protocol:
|
|
|
133
133
|
| `context capture <url \| ./path.md [./more.md...] \| --stdin \| --inbox \| --refresh \| --code [path]>` | CLI | Ingest external documents or code into the source registry. Feishu URLs use `lark-cli`; local `.md` files can be captured one at a time, as variadic paths, or as newline-separated paths from stdin. `--code` snapshots TypeScript packages/symbols/edges through the code aspect. For Agent interaction, run `context capture --code <path> --plan --format json` first, show only package name / module path / version, then capture with repeated `--module <path>`. After capture, continue with source ids and semantic handles, not storage paths. |
|
|
134
134
|
| `context extract <path>` | CLI | Read-only developer/debug print of an extraction; never writes workspace files and is not part of the production Agent workflow. |
|
|
135
135
|
| `context debug <workflow\|source\|workspace\|storage\|command\|snapshot> ...` | CLI | Developer/debug-only path diagnostics. Output is storage-coupled and not a production Agent workflow input. |
|
|
136
|
-
| `context align
|
|
137
|
-
| `context compile
|
|
136
|
+
| `context align scan \| coarse-read --input - \| ops --input - \| validate --input - \| finalize --input - \| code [slug]` | CLI | Workflow helpers driven by the `/context:align` skill pipeline. `scan` returns workflow payload names, scopes, digests, route envelope, and budget-safe inspect commands; agents inspect `align-segments` through `context workflow show --payload align-segments --view blocks --token-budget 2000 --unwrap --format json`, then narrow with `--source`, `--heading`, or CLI-provided `how_to_explore[]`. `--unwrap` only removes the workflow metadata envelope. Validate before finalize, then submit an `align-structure-decision` document through stdin; batched `coarse-read` / `ops` are only used when `next_action.command` asks for them. `code` is a dry-run deterministic code projection route and does not enter prose align. `context schema <name>` prints the exact align workflow input schemas. |
|
|
137
|
+
| `context compile scan \| context <slug> [--view source-refs] \| cycle <slug> --input - --accept-safe-defaults \| draft <slug> --input - --prepare \| close \| code [source-slug]` | CLI | `code` is the deterministic code projection route: it turns captured code snapshots into package/category/symbol knowledge Nodes and does not enter prose draft/reconcile. Workflow helpers driven by the `/context:compile` skill pipeline handle prose/doc knowledge. `scan` returns the incremental compile workset, resume point, and budget-safe source-ref prefetch commands. `context <slug> --view source-refs --token-budget 2000` is a budgeted projection of `NodeContext.raw_snippets[]` for copying citation handles into draft `source_refs[]`; it is not a separate data source. Coverage payloads are inspected with `context workflow show --payload coverage-candidates --view coverage-summary --token-budget 2000 --unwrap --format json` and narrowed with `--view coverage --type <issue-type>` or `--node <slug>`. `cycle <slug>` is the low-friction per-node path: it validates the submitted draft, prepares reconcile, accepts mechanically safe defaults, and applies only when no semantic judgment remains (`status: applied` / `partial-applied` / `review-required`). Manual `draft <slug> --prepare → reconcile review/apply` remains the fallback for questions and unsupported evidence. `--delegated` is a one-time, workflow-level authorization recorded on the initial scan/context/draft/cycle command; it lets the CLI auto-accept low-risk weak source support but never bypasses unsupported evidence, type drift, schema errors, or destructive gates. Normal handoff uses stdin and current workflow payloads; digest flags are optional stale guards, not values agents need to extract. `--save-input` is only an explicit debug scratch copy, not workspace truth. |
|
|
138
138
|
| `context workflow show --payload <name> --view <view> [--token-budget <n>]` | CLI | Inspect workflow payloads through semantic views. High-frequency views are `node-context --view source-refs`, `coverage-candidates --view coverage-summary`, `coverage-candidates --view coverage`, and `align-segments --view blocks`. Follow returned `how_to_explore[]` commands for narrowing or budget expansion. |
|
|
139
139
|
| `context mdrive <group> <verb>` | CLI | Knowledge primitive shell: node / section / edge / query / verify / glossary / workspace. Node/query results include `node_class` to distinguish concrete entities from term definitions. `context mdrive verify workspace --experimental` adds heuristic quality warnings for very thin concrete entities and terms that have grown beyond definition shape; these are warnings, not entity-count limits. `context mdrive query --stats-only` prints only workspace counts; run `context mdrive --help` for subcommands. |
|
|
140
140
|
| `context drop <source-id\|url> --plan [--save-output [file]]` / `context drop --apply-plan --reason <text> --yes` | CLI | Plans and applies source retraction through the current drop workflow. `drop --plan` stores the canonical `drop-plan` workflow payload; `--save-output` is only an optional human-readable scratch copy, not a later input. `reconcile prepare --mode drop` reads the current workflow plan, `reconcile review --decisions -` stores the ready review when semantic decisions are needed, and `drop --apply-plan` consumes the current workflow plan/review without plan or decisions files. |
|