@c4a/context-cli 0.6.7 → 0.6.9

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 (39) hide show
  1. package/README.md +156 -220
  2. package/README.zh-CN.md +120 -160
  3. package/cli.js +1533 -869
  4. package/docs/quickstart.md +57 -70
  5. package/docs/quickstart.zh-CN.md +79 -0
  6. package/package.json +4 -4
  7. package/plugins/.agents/plugins/marketplace.json +1 -1
  8. package/plugins/.claude-plugin/marketplace.json +2 -2
  9. package/plugins/.cursor-plugin/marketplace.json +2 -2
  10. package/plugins/README.md +79 -66
  11. package/plugins/README_CN.md +62 -57
  12. package/plugins/VERSION +1 -1
  13. package/plugins/claude/.claude-plugin/plugin.json +3 -3
  14. package/plugins/claude/commands/context.md +121 -0
  15. package/plugins/codex/.codex-plugin/plugin.json +4 -4
  16. package/plugins/codex/skills/context/SKILL.md +133 -0
  17. package/plugins/cursor/.cursor-plugin/plugin.json +3 -3
  18. package/plugins/cursor/README.md +2 -2
  19. package/plugins/cursor/commands/c4a-context.md +125 -0
  20. package/plugins/skills/c4a-context/SKILL.md +133 -0
  21. package/providers/context/actions/flush-runtime-events.yaml +5 -0
  22. package/providers/context/codes.yaml +1 -0
  23. package/providers/context/graphs/workspace.yaml +53 -2
  24. package/providers/context/manifest.json +48 -12
  25. package/providers/context/provider.yaml +2 -2
  26. package/providers/context/resources/dialogue/workflow-mode-after-capture.md +22 -0
  27. package/providers/context/resources/dialogue/workflow-mode-after-creation.md +25 -0
  28. package/providers/context/resources/manuals/guides/package-outputs.md +1 -1
  29. package/providers/context/resources/manuals/reference/package-templates.md +13 -1
  30. package/providers/context/resources/procedures/package-output.md +16 -2
  31. package/providers/context/resources/procedures/runtime-event-delivery.md +86 -0
  32. package/plugins/claude/commands/continue.md +0 -85
  33. package/plugins/claude/commands/init.md +0 -36
  34. package/plugins/codex/skills/continue/SKILL.md +0 -97
  35. package/plugins/codex/skills/init/SKILL.md +0 -48
  36. package/plugins/cursor/commands/context-continue.md +0 -89
  37. package/plugins/cursor/commands/context-init.md +0 -40
  38. package/plugins/skills/context-continue/SKILL.md +0 -97
  39. package/plugins/skills/context-init/SKILL.md +0 -48
@@ -1,97 +0,0 @@
1
- ---
2
- name: continue
3
- description: >
4
- Inspect the Context workspace, decide the next useful action, and proceed. Use the local `context` CLI for workspace writes.
5
- tools:
6
- - Bash
7
- ---
8
-
9
- # Continue
10
-
11
- Public Context entry for agents that expose skills instead of slash commands.
12
-
13
- - Public entry: `continue`
14
- - Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
15
- - CLI primitive prefix: `context ...`
16
-
17
- ---
18
-
19
- ## Workflow
20
-
21
- Use this as the conversational entry for an existing Context workspace. There
22
- is no `context continue` CLI primitive. Without explicit fully managed
23
- authority, start with:
24
-
25
- ```bash
26
- context status --format json
27
- ```
28
-
29
- If the user explicitly asks to enable debugging, first run
30
- `context debug enable`. It sets `package.json` `context.debug=true` and records
31
- subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
32
- Do not enable it proactively; tracing is not workflow authority or evidence.
33
-
34
- When the user explicitly requests fully managed operation in this conversation,
35
- start with the managed loop instead of a manual status/action cycle:
36
-
37
- ```bash
38
- context run --managed --until blocked-or-complete --format json
39
- ```
40
-
41
- Never persist or reuse that authority in another conversation. While the
42
- request remains active, use `--managed` for every resumed status evaluation;
43
- stop using it when the conversation ends or the user revokes it.
44
-
45
- If the user is starting a new workspace or a new batch from a raw repository
46
- root, do not run `context status` first. Use the public Context init entry or
47
- `context init` to create the workspace, complete the init setup command, then
48
- return here from the initialized workspace.
49
-
50
- The managed loop is the default entry for an explicitly managed conversation,
51
- not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
52
- non-managed authority in this conversation. This loop executes only one
53
- revision-bound command at a time and re-evaluates after every receipt. It stops
54
- before read-only interpretation, project configuration, unresolved authority,
55
- diagnostics, or a non-unique command plan. On stop, resume from the returned
56
- `workflow.current`; do not derive a command from earlier steps.
57
-
58
- Language policy: explain, ask, confirm, and summarize in the user's current
59
- conversation language. Keep CLI commands, flags, paths, ids, status enum values,
60
- JSONL payload keys, `source_ref` values, and copied CLI output tokens unchanged.
61
-
62
- Treat `workflow.current` as the current-step authority:
63
-
64
- 1. Read every `resources.required` item whose `read_state` is
65
- `read-required`. Read a `path` directly; for a resource with `command`,
66
- execute that command and read the returned file. Keep read receipts only in
67
- the current conversation and pass the merged receipt set back with
68
- `context status --resource-receipts @<file>`; an unchanged static digest or
69
- matching dynamic Route revision then returns `read_state: current`.
70
- Materializing a resource is not a read: use the returned
71
- `after_read_receipts` only after reading the complete returned file. A
72
- `context.source-body/*` resource is the complete captured Markdown body;
73
- source indexes and heading metadata never replace it. The exact
74
- `resources.after_read.command` returns the re-evaluated `workflow.current`;
75
- continue from that response without an additional status call.
76
- 2. At a Gate, keep conditional context phase-local. An `inspection_action`
77
- Skill or Schema is read only when performing that pre-decision inspection;
78
- a `resolution_action` Skill or Schema is read only after the user confirms
79
- the Gate. Neither replaces ordinary `resources.required`.
80
- 3. Execute only `commands` returned by the Route, preserving revision and
81
- authority flags exactly. A command marked `after-human-confirmation` must
82
- wait for the current Gate decision. Run a command whose
83
- `execution.target` is `agent-host` as a top-level host action with the
84
- host's external and credential access, not inside a restricted child
85
- sandbox. Request host approval when required; never weaken credential
86
- storage as a workaround.
87
- 4. If `configuration` is present, edit only the named project file using the
88
- selected resources as its contract.
89
- 5. After every action or configuration change, run status again. The managed
90
- `--until` loop performs this re-evaluation internally. A phase-local
91
- `next_action` can continue that operation but never replaces the workspace
92
- Route.
93
-
94
- Do not infer repo sources, extraction scope, review decisions, or package output
95
- choices from surrounding files. Do not call source-repo operations such as
96
- clone, checkout, reset, fetch, install, build, or test without explicit user
97
- approval.
@@ -1,48 +0,0 @@
1
- ---
2
- name: init
3
- description: >
4
- Initialize a Context knowledge workspace. Use the local `context` CLI for workspace writes.
5
- tools:
6
- - Bash
7
- ---
8
-
9
- # Init
10
-
11
- Public Context entry for agents that expose skills instead of slash commands.
12
-
13
- - Public entry: `init`
14
- - Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
15
- - CLI primitive prefix: `context ...`
16
-
17
- ---
18
-
19
- ## Workflow
20
-
21
- Initialize a Context workspace with the global CLI, complete the returned setup
22
- step, then hand control to the current workflow route.
23
-
24
- Use the user's language for conversation. Keep command and payload tokens
25
- unchanged.
26
-
27
- Run `context init [project-dir] [--name <name>] --language <language>`. Use the
28
- user's explicit language choice when present; otherwise pass `zh-CN` for a
29
- Chinese conversation and `en` for an English conversation. This explicit CLI
30
- value controls generated workspace instructions and starter templates. Never
31
- substitute `.` when `project-dir` was omitted; the default is `context/`. Use
32
- `--dev` only for an explicitly requested local-link test.
33
- Add `--debug` only when the user explicitly asks to trace this workspace. Debug
34
- mode is otherwise off by default.
35
-
36
- If init reports `init-target-nonempty`, explain that existing files would share
37
- the workspace root. Run the returned `--allow-nonempty` command only after
38
- explicit confirmation.
39
-
40
- Execute the returned setup command, enter the project root, and read its
41
- generated `AGENTS.md`. Then run `context status --format json`, adding
42
- `--managed` only for fully managed operation explicitly authorized in this
43
- conversation. Treat `workflow.current` as authoritative: read its required
44
- resources, execute only exact commands, honor unresolved human gates, and
45
- reevaluate status after each action.
46
-
47
- Do not add extra project-local agent setup or infer sources from the surrounding
48
- monorepo.
@@ -1,89 +0,0 @@
1
- ---
2
- description: "Inspect the Context workspace, decide the next useful action, and proceed."
3
- argument-hint: "[user intent]"
4
- allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
- ---
6
-
7
- Continue the Context workflow from the current workspace state.
8
-
9
- ---
10
-
11
- ## Workflow
12
-
13
- Use this as the conversational entry for an existing Context workspace. There
14
- is no `context continue` CLI primitive. Without explicit fully managed
15
- authority, start with:
16
-
17
- ```bash
18
- context status --format json
19
- ```
20
-
21
- If the user explicitly asks to enable debugging, first run
22
- `context debug enable`. It sets `package.json` `context.debug=true` and records
23
- subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
24
- Do not enable it proactively; tracing is not workflow authority or evidence.
25
-
26
- When the user explicitly requests fully managed operation in this conversation,
27
- start with the managed loop instead of a manual status/action cycle:
28
-
29
- ```bash
30
- context run --managed --until blocked-or-complete --format json
31
- ```
32
-
33
- Never persist or reuse that authority in another conversation. While the
34
- request remains active, use `--managed` for every resumed status evaluation;
35
- stop using it when the conversation ends or the user revokes it.
36
-
37
- If the user is starting a new workspace or a new batch from a raw repository
38
- root, do not run `context status` first. Use the public Context init entry or
39
- `context init` to create the workspace, complete the init setup command, then
40
- return here from the initialized workspace.
41
-
42
- The managed loop is the default entry for an explicitly managed conversation,
43
- not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
44
- non-managed authority in this conversation. This loop executes only one
45
- revision-bound command at a time and re-evaluates after every receipt. It stops
46
- before read-only interpretation, project configuration, unresolved authority,
47
- diagnostics, or a non-unique command plan. On stop, resume from the returned
48
- `workflow.current`; do not derive a command from earlier steps.
49
-
50
- Language policy: explain, ask, confirm, and summarize in the user's current
51
- conversation language. Keep CLI commands, flags, paths, ids, status enum values,
52
- JSONL payload keys, `source_ref` values, and copied CLI output tokens unchanged.
53
-
54
- Treat `workflow.current` as the current-step authority:
55
-
56
- 1. Read every `resources.required` item whose `read_state` is
57
- `read-required`. Read a `path` directly; for a resource with `command`,
58
- execute that command and read the returned file. Keep read receipts only in
59
- the current conversation and pass the merged receipt set back with
60
- `context status --resource-receipts @<file>`; an unchanged static digest or
61
- matching dynamic Route revision then returns `read_state: current`.
62
- Materializing a resource is not a read: use the returned
63
- `after_read_receipts` only after reading the complete returned file. A
64
- `context.source-body/*` resource is the complete captured Markdown body;
65
- source indexes and heading metadata never replace it. The exact
66
- `resources.after_read.command` returns the re-evaluated `workflow.current`;
67
- continue from that response without an additional status call.
68
- 2. At a Gate, keep conditional context phase-local. An `inspection_action`
69
- Skill or Schema is read only when performing that pre-decision inspection;
70
- a `resolution_action` Skill or Schema is read only after the user confirms
71
- the Gate. Neither replaces ordinary `resources.required`.
72
- 3. Execute only `commands` returned by the Route, preserving revision and
73
- authority flags exactly. A command marked `after-human-confirmation` must
74
- wait for the current Gate decision. Run a command whose
75
- `execution.target` is `agent-host` as a top-level host action with the
76
- host's external and credential access, not inside a restricted child
77
- sandbox. Request host approval when required; never weaken credential
78
- storage as a workaround.
79
- 4. If `configuration` is present, edit only the named project file using the
80
- selected resources as its contract.
81
- 5. After every action or configuration change, run status again. The managed
82
- `--until` loop performs this re-evaluation internally. A phase-local
83
- `next_action` can continue that operation but never replaces the workspace
84
- Route.
85
-
86
- Do not infer repo sources, extraction scope, review decisions, or package output
87
- choices from surrounding files. Do not call source-repo operations such as
88
- clone, checkout, reset, fetch, install, build, or test without explicit user
89
- approval.
@@ -1,40 +0,0 @@
1
- ---
2
- description: "Initialize a Context knowledge workspace."
3
- argument-hint: "[project-dir] [--name <name>] [--language en|zh-CN] [--debug]"
4
- allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
- ---
6
-
7
- Initialize a Context knowledge workspace.
8
-
9
- ---
10
-
11
- ## Workflow
12
-
13
- Initialize a Context workspace with the global CLI, complete the returned setup
14
- step, then hand control to the current workflow route.
15
-
16
- Use the user's language for conversation. Keep command and payload tokens
17
- unchanged.
18
-
19
- Run `context init [project-dir] [--name <name>] --language <language>`. Use the
20
- user's explicit language choice when present; otherwise pass `zh-CN` for a
21
- Chinese conversation and `en` for an English conversation. This explicit CLI
22
- value controls generated workspace instructions and starter templates. Never
23
- substitute `.` when `project-dir` was omitted; the default is `context/`. Use
24
- `--dev` only for an explicitly requested local-link test.
25
- Add `--debug` only when the user explicitly asks to trace this workspace. Debug
26
- mode is otherwise off by default.
27
-
28
- If init reports `init-target-nonempty`, explain that existing files would share
29
- the workspace root. Run the returned `--allow-nonempty` command only after
30
- explicit confirmation.
31
-
32
- Execute the returned setup command, enter the project root, and read its
33
- generated `AGENTS.md`. Then run `context status --format json`, adding
34
- `--managed` only for fully managed operation explicitly authorized in this
35
- conversation. Treat `workflow.current` as authoritative: read its required
36
- resources, execute only exact commands, honor unresolved human gates, and
37
- reevaluate status after each action.
38
-
39
- Do not add extra project-local agent setup or infer sources from the surrounding
40
- monorepo.
@@ -1,97 +0,0 @@
1
- ---
2
- name: context-continue
3
- description: >
4
- Inspect the Context workspace, decide the next useful action, and proceed. Use the local `context` CLI for workspace writes.
5
- tools:
6
- - Bash
7
- ---
8
-
9
- # Continue
10
-
11
- Public Context entry for agents that expose skills instead of slash commands.
12
-
13
- - Public entry: `context-continue`
14
- - Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
15
- - CLI primitive prefix: `context ...`
16
-
17
- ---
18
-
19
- ## Workflow
20
-
21
- Use this as the conversational entry for an existing Context workspace. There
22
- is no `context continue` CLI primitive. Without explicit fully managed
23
- authority, start with:
24
-
25
- ```bash
26
- context status --format json
27
- ```
28
-
29
- If the user explicitly asks to enable debugging, first run
30
- `context debug enable`. It sets `package.json` `context.debug=true` and records
31
- subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
32
- Do not enable it proactively; tracing is not workflow authority or evidence.
33
-
34
- When the user explicitly requests fully managed operation in this conversation,
35
- start with the managed loop instead of a manual status/action cycle:
36
-
37
- ```bash
38
- context run --managed --until blocked-or-complete --format json
39
- ```
40
-
41
- Never persist or reuse that authority in another conversation. While the
42
- request remains active, use `--managed` for every resumed status evaluation;
43
- stop using it when the conversation ends or the user revokes it.
44
-
45
- If the user is starting a new workspace or a new batch from a raw repository
46
- root, do not run `context status` first. Use the public Context init entry or
47
- `context init` to create the workspace, complete the init setup command, then
48
- return here from the initialized workspace.
49
-
50
- The managed loop is the default entry for an explicitly managed conversation,
51
- not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
52
- non-managed authority in this conversation. This loop executes only one
53
- revision-bound command at a time and re-evaluates after every receipt. It stops
54
- before read-only interpretation, project configuration, unresolved authority,
55
- diagnostics, or a non-unique command plan. On stop, resume from the returned
56
- `workflow.current`; do not derive a command from earlier steps.
57
-
58
- Language policy: explain, ask, confirm, and summarize in the user's current
59
- conversation language. Keep CLI commands, flags, paths, ids, status enum values,
60
- JSONL payload keys, `source_ref` values, and copied CLI output tokens unchanged.
61
-
62
- Treat `workflow.current` as the current-step authority:
63
-
64
- 1. Read every `resources.required` item whose `read_state` is
65
- `read-required`. Read a `path` directly; for a resource with `command`,
66
- execute that command and read the returned file. Keep read receipts only in
67
- the current conversation and pass the merged receipt set back with
68
- `context status --resource-receipts @<file>`; an unchanged static digest or
69
- matching dynamic Route revision then returns `read_state: current`.
70
- Materializing a resource is not a read: use the returned
71
- `after_read_receipts` only after reading the complete returned file. A
72
- `context.source-body/*` resource is the complete captured Markdown body;
73
- source indexes and heading metadata never replace it. The exact
74
- `resources.after_read.command` returns the re-evaluated `workflow.current`;
75
- continue from that response without an additional status call.
76
- 2. At a Gate, keep conditional context phase-local. An `inspection_action`
77
- Skill or Schema is read only when performing that pre-decision inspection;
78
- a `resolution_action` Skill or Schema is read only after the user confirms
79
- the Gate. Neither replaces ordinary `resources.required`.
80
- 3. Execute only `commands` returned by the Route, preserving revision and
81
- authority flags exactly. A command marked `after-human-confirmation` must
82
- wait for the current Gate decision. Run a command whose
83
- `execution.target` is `agent-host` as a top-level host action with the
84
- host's external and credential access, not inside a restricted child
85
- sandbox. Request host approval when required; never weaken credential
86
- storage as a workaround.
87
- 4. If `configuration` is present, edit only the named project file using the
88
- selected resources as its contract.
89
- 5. After every action or configuration change, run status again. The managed
90
- `--until` loop performs this re-evaluation internally. A phase-local
91
- `next_action` can continue that operation but never replaces the workspace
92
- Route.
93
-
94
- Do not infer repo sources, extraction scope, review decisions, or package output
95
- choices from surrounding files. Do not call source-repo operations such as
96
- clone, checkout, reset, fetch, install, build, or test without explicit user
97
- approval.
@@ -1,48 +0,0 @@
1
- ---
2
- name: context-init
3
- description: >
4
- Initialize a Context knowledge workspace. Use the local `context` CLI for workspace writes.
5
- tools:
6
- - Bash
7
- ---
8
-
9
- # Init
10
-
11
- Public Context entry for agents that expose skills instead of slash commands.
12
-
13
- - Public entry: `context-init`
14
- - Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
15
- - CLI primitive prefix: `context ...`
16
-
17
- ---
18
-
19
- ## Workflow
20
-
21
- Initialize a Context workspace with the global CLI, complete the returned setup
22
- step, then hand control to the current workflow route.
23
-
24
- Use the user's language for conversation. Keep command and payload tokens
25
- unchanged.
26
-
27
- Run `context init [project-dir] [--name <name>] --language <language>`. Use the
28
- user's explicit language choice when present; otherwise pass `zh-CN` for a
29
- Chinese conversation and `en` for an English conversation. This explicit CLI
30
- value controls generated workspace instructions and starter templates. Never
31
- substitute `.` when `project-dir` was omitted; the default is `context/`. Use
32
- `--dev` only for an explicitly requested local-link test.
33
- Add `--debug` only when the user explicitly asks to trace this workspace. Debug
34
- mode is otherwise off by default.
35
-
36
- If init reports `init-target-nonempty`, explain that existing files would share
37
- the workspace root. Run the returned `--allow-nonempty` command only after
38
- explicit confirmation.
39
-
40
- Execute the returned setup command, enter the project root, and read its
41
- generated `AGENTS.md`. Then run `context status --format json`, adding
42
- `--managed` only for fully managed operation explicitly authorized in this
43
- conversation. Treat `workflow.current` as authoritative: read its required
44
- resources, execute only exact commands, honor unresolved human gates, and
45
- reevaluate status after each action.
46
-
47
- Do not add extra project-local agent setup or infer sources from the surrounding
48
- monorepo.