@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,7 +1,7 @@
1
1
  {
2
- "name": "context",
3
- "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
4
- "version": "0.6.7",
2
+ "name": "c4a",
3
+ "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
4
+ "version": "0.6.9",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -0,0 +1,121 @@
1
+ ---
2
+ description: "Build or continue structured, traceable Agent knowledge from documents and code."
3
+ argument-hint: "[project-dir or user intent]"
4
+ allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
+ ---
6
+
7
+ ## Your Task
8
+
9
+ Context is a knowledge management tool built for Agent knowledge workflows. It
10
+ compiles Feishu/Lark documents, local Markdown, repository code, and manually
11
+ curated business material into structured, traceable knowledge, then produces
12
+ knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
13
+ workflow guidance, knowledge-building procedures, and code-indexing capabilities
14
+ needed to produce that knowledge; follow its returned commands and resources
15
+ for the next action.
16
+
17
+ Use this as the single conversational entry for Context. Let the CLI locate an
18
+ existing workspace, relocate into it, initialize a requested workspace, or
19
+ evaluate its current workflow. Do not infer the workspace state yourself.
20
+
21
+ ### Enter the workspace
22
+
23
+ Run:
24
+
25
+ ```bash
26
+ context entry [project-dir] --language <language> --format json
27
+ ```
28
+
29
+ Use the user's explicit language choice when present; otherwise pass `zh-CN`
30
+ for a Chinese conversation and `en` for an English conversation. Pass
31
+ `project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
32
+ requested that initialization choice. Pass `--managed` only after the user
33
+ explicitly authorizes fully managed operation in this conversation.
34
+
35
+ If the `context` process itself cannot start because the command is missing
36
+ (`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
37
+ command, such as `command not found: context` or `context: command not found`),
38
+ explain that the global CLI is not installed and ask the user to install or
39
+ authorize installation with:
40
+
41
+ ```bash
42
+ npm install -g @c4a/context-cli@latest
43
+ context plugin install
44
+ ```
45
+
46
+ Stop after giving that recovery. Do not run an installation preflight, install
47
+ automatically, or mistake a normal Context `not found` diagnostic for a missing
48
+ executable.
49
+
50
+ Execute only `next_action.command` returned by `context entry`:
51
+
52
+ - `initialize-workspace` writes a new workspace. Execute it immediately only
53
+ when the user explicitly requested initialization through this entry;
54
+ otherwise explain the target root and ask for confirmation. Preserve the
55
+ `init-target-nonempty` confirmation.
56
+ - `enter-workspace` and `evaluate-workflow` are read-only and need no additional
57
+ confirmation.
58
+ - After initialization, execute the exact setup command returned by `context
59
+ init`, enter the project root, read the generated `AGENTS.md`, and run this
60
+ entry again.
61
+
62
+ ### Conversation modes
63
+
64
+ Enable debugging only when the user explicitly requests it. Run `context debug
65
+ enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
66
+ does not grant workflow authority or provide source evidence.
67
+
68
+ For explicitly authorized fully managed operation, use:
69
+
70
+ ```bash
71
+ context run --managed --until blocked-or-complete --format json
72
+ ```
73
+
74
+ Use `--managed` for every resumed workflow evaluation in the same active
75
+ request. Never persist or reuse that authority in another conversation, and
76
+ stop using it when the conversation ends or the user revokes it. Pass any
77
+ additional `--authority` only when the user explicitly grants that authority in
78
+ this conversation.
79
+
80
+ The managed loop executes only Route-selected work and returns the current
81
+ `workflow.current` whenever Agent reading, project configuration, a human Gate,
82
+ host execution, diagnostics, or a non-unique plan needs attention. Resume from
83
+ that returned Route; never reconstruct a command from an earlier step.
84
+
85
+ ### Follow the current Route
86
+
87
+ Treat `workflow.current` as the current-step authority:
88
+
89
+ 1. Read every `resources.required` item whose `read_state` is `read-required`.
90
+ Read a returned `path` completely, or execute a returned resource `command`
91
+ and read its complete output file. Materializing a resource is not reading
92
+ it. Keep the merged receipts only in this conversation and submit them with
93
+ the exact returned `context status --resource-receipts @<file>` command. Use
94
+ `after_read_receipts` only after the full resource has been read. The exact
95
+ `resources.after_read.command` already returns the re-evaluated
96
+ `workflow.current`; continue from it without an additional status call.
97
+ 2. At a Gate, keep inspection and resolution phase-local. Read an
98
+ `inspection_action` resource only while inspecting the decision, and read a
99
+ `resolution_action` resource only after the user confirms the Gate. Neither
100
+ replaces ordinary required resources.
101
+ 3. Execute only `commands` returned by the Route, preserving revision and
102
+ authority flags exactly. A command marked `after-human-confirmation` waits
103
+ for the current Gate decision. Run a command whose `execution.target` is `agent-host`
104
+ as an exact top-level host action with the required host access,
105
+ not inside a restricted child sandbox. Follow the Route-selected procedure
106
+ for its audit and approval contract; never invent a payload, destination, or
107
+ substitute command.
108
+ 4. If `configuration` is present, edit only the named project file and use the
109
+ selected resources as its contract.
110
+ 5. After every action or configuration change, run status again. The managed
111
+ loop performs this re-evaluation internally. A phase-local `next_action` can
112
+ continue that operation but never replaces the workspace Route.
113
+
114
+ Explain, ask, confirm, and summarize in the user's current conversation
115
+ language. Keep commands, flags, paths, ids, status values, JSONL keys,
116
+ `source_ref` values, and copied CLI tokens unchanged.
117
+
118
+ Do not infer repo sources, extraction scope, review decisions, or package output
119
+ choices from surrounding files. Do not call source-repo operations such as
120
+ clone, checkout, reset, fetch, install, build, or test without explicit user
121
+ approval.
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "context",
3
- "version": "0.6.7",
4
- "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
2
+ "name": "c4a",
3
+ "version": "0.6.9",
4
+ "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -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.7",
21
+ "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.9",
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",
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: context
3
+ description: >
4
+ Build or continue structured, traceable Agent knowledge from documents and code. Use the local `context` CLI for workspace writes.
5
+ tools:
6
+ - Bash
7
+ ---
8
+
9
+ # Context
10
+
11
+ Public Context entry for agents that expose skills instead of slash commands.
12
+
13
+ - Public entry: `context`
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
+ Context is a knowledge management tool built for Agent knowledge workflows. It
22
+ compiles Feishu/Lark documents, local Markdown, repository code, and manually
23
+ curated business material into structured, traceable knowledge, then produces
24
+ knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
25
+ workflow guidance, knowledge-building procedures, and code-indexing capabilities
26
+ needed to produce that knowledge; follow its returned commands and resources
27
+ for the next action.
28
+
29
+ Use this as the single conversational entry for Context. Let the CLI locate an
30
+ existing workspace, relocate into it, initialize a requested workspace, or
31
+ evaluate its current workflow. Do not infer the workspace state yourself.
32
+
33
+ ### Enter the workspace
34
+
35
+ Run:
36
+
37
+ ```bash
38
+ context entry [project-dir] --language <language> --format json
39
+ ```
40
+
41
+ Use the user's explicit language choice when present; otherwise pass `zh-CN`
42
+ for a Chinese conversation and `en` for an English conversation. Pass
43
+ `project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
44
+ requested that initialization choice. Pass `--managed` only after the user
45
+ explicitly authorizes fully managed operation in this conversation.
46
+
47
+ If the `context` process itself cannot start because the command is missing
48
+ (`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
49
+ command, such as `command not found: context` or `context: command not found`),
50
+ explain that the global CLI is not installed and ask the user to install or
51
+ authorize installation with:
52
+
53
+ ```bash
54
+ npm install -g @c4a/context-cli@latest
55
+ context plugin install
56
+ ```
57
+
58
+ Stop after giving that recovery. Do not run an installation preflight, install
59
+ automatically, or mistake a normal Context `not found` diagnostic for a missing
60
+ executable.
61
+
62
+ Execute only `next_action.command` returned by `context entry`:
63
+
64
+ - `initialize-workspace` writes a new workspace. Execute it immediately only
65
+ when the user explicitly requested initialization through this entry;
66
+ otherwise explain the target root and ask for confirmation. Preserve the
67
+ `init-target-nonempty` confirmation.
68
+ - `enter-workspace` and `evaluate-workflow` are read-only and need no additional
69
+ confirmation.
70
+ - After initialization, execute the exact setup command returned by `context
71
+ init`, enter the project root, read the generated `AGENTS.md`, and run this
72
+ entry again.
73
+
74
+ ### Conversation modes
75
+
76
+ Enable debugging only when the user explicitly requests it. Run `context debug
77
+ enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
78
+ does not grant workflow authority or provide source evidence.
79
+
80
+ For explicitly authorized fully managed operation, use:
81
+
82
+ ```bash
83
+ context run --managed --until blocked-or-complete --format json
84
+ ```
85
+
86
+ Use `--managed` for every resumed workflow evaluation in the same active
87
+ request. Never persist or reuse that authority in another conversation, and
88
+ stop using it when the conversation ends or the user revokes it. Pass any
89
+ additional `--authority` only when the user explicitly grants that authority in
90
+ this conversation.
91
+
92
+ The managed loop executes only Route-selected work and returns the current
93
+ `workflow.current` whenever Agent reading, project configuration, a human Gate,
94
+ host execution, diagnostics, or a non-unique plan needs attention. Resume from
95
+ that returned Route; never reconstruct a command from an earlier step.
96
+
97
+ ### Follow the current Route
98
+
99
+ Treat `workflow.current` as the current-step authority:
100
+
101
+ 1. Read every `resources.required` item whose `read_state` is `read-required`.
102
+ Read a returned `path` completely, or execute a returned resource `command`
103
+ and read its complete output file. Materializing a resource is not reading
104
+ it. Keep the merged receipts only in this conversation and submit them with
105
+ the exact returned `context status --resource-receipts @<file>` command. Use
106
+ `after_read_receipts` only after the full resource has been read. The exact
107
+ `resources.after_read.command` already returns the re-evaluated
108
+ `workflow.current`; continue from it without an additional status call.
109
+ 2. At a Gate, keep inspection and resolution phase-local. Read an
110
+ `inspection_action` resource only while inspecting the decision, and read a
111
+ `resolution_action` resource only after the user confirms the Gate. Neither
112
+ replaces ordinary required resources.
113
+ 3. Execute only `commands` returned by the Route, preserving revision and
114
+ authority flags exactly. A command marked `after-human-confirmation` waits
115
+ for the current Gate decision. Run a command whose `execution.target` is `agent-host`
116
+ as an exact top-level host action with the required host access,
117
+ not inside a restricted child sandbox. Follow the Route-selected procedure
118
+ for its audit and approval contract; never invent a payload, destination, or
119
+ substitute command.
120
+ 4. If `configuration` is present, edit only the named project file and use the
121
+ selected resources as its contract.
122
+ 5. After every action or configuration change, run status again. The managed
123
+ loop performs this re-evaluation internally. A phase-local `next_action` can
124
+ continue that operation but never replaces the workspace Route.
125
+
126
+ Explain, ask, confirm, and summarize in the user's current conversation
127
+ language. Keep commands, flags, paths, ids, status values, JSONL keys,
128
+ `source_ref` values, and copied CLI tokens unchanged.
129
+
130
+ Do not infer repo sources, extraction scope, review decisions, or package output
131
+ choices from surrounding files. Do not call source-repo operations such as
132
+ clone, checkout, reset, fetch, install, build, or test without explicit user
133
+ approval.
@@ -1,8 +1,8 @@
1
1
  {
2
- "name": "context",
2
+ "name": "c4a",
3
3
  "displayName": "C4A Context",
4
- "version": "0.6.7",
5
- "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
4
+ "version": "0.6.9",
5
+ "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
6
6
  "author": {
7
7
  "name": "Context4AI",
8
8
  "email": "support@context4ai.dev"
@@ -7,7 +7,7 @@ Edit `packages/context-cli/plugin/` and rerun the build instead.
7
7
  Install shape:
8
8
 
9
9
  - Marketplace/GitHub plugin shape: this directory is a plugin root with `.cursor-plugin/plugin.json` and `commands/`.
10
- - User entries are under `commands/`; Cursor command files are prefixed as `context-*` to avoid global slash-command collisions.
11
- - Local plugin fallback: symlink or copy this directory to `~/.cursor/plugins/local/context/` only when Marketplace import is unavailable.
10
+ - User entries are under `commands/`; Cursor command files are prefixed as `c4a-*` to avoid global slash-command collisions.
11
+ - Local plugin fallback: symlink or copy this directory to `~/.cursor/plugins/local/c4a/` only when Marketplace import is unavailable.
12
12
 
13
13
  Cursor Marketplace installs this plugin root directly.
@@ -0,0 +1,125 @@
1
+ ---
2
+ description: "Build or continue structured, traceable Agent knowledge from documents and code."
3
+ argument-hint: "[project-dir or user intent]"
4
+ allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
+ ---
6
+
7
+ Start or continue a C4A Context knowledge workspace.
8
+
9
+ ---
10
+
11
+ ## Workflow
12
+
13
+ Context is a knowledge management tool built for Agent knowledge workflows. It
14
+ compiles Feishu/Lark documents, local Markdown, repository code, and manually
15
+ curated business material into structured, traceable knowledge, then produces
16
+ knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
17
+ workflow guidance, knowledge-building procedures, and code-indexing capabilities
18
+ needed to produce that knowledge; follow its returned commands and resources
19
+ for the next action.
20
+
21
+ Use this as the single conversational entry for Context. Let the CLI locate an
22
+ existing workspace, relocate into it, initialize a requested workspace, or
23
+ evaluate its current workflow. Do not infer the workspace state yourself.
24
+
25
+ ### Enter the workspace
26
+
27
+ Run:
28
+
29
+ ```bash
30
+ context entry [project-dir] --language <language> --format json
31
+ ```
32
+
33
+ Use the user's explicit language choice when present; otherwise pass `zh-CN`
34
+ for a Chinese conversation and `en` for an English conversation. Pass
35
+ `project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
36
+ requested that initialization choice. Pass `--managed` only after the user
37
+ explicitly authorizes fully managed operation in this conversation.
38
+
39
+ If the `context` process itself cannot start because the command is missing
40
+ (`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
41
+ command, such as `command not found: context` or `context: command not found`),
42
+ explain that the global CLI is not installed and ask the user to install or
43
+ authorize installation with:
44
+
45
+ ```bash
46
+ npm install -g @c4a/context-cli@latest
47
+ context plugin install
48
+ ```
49
+
50
+ Stop after giving that recovery. Do not run an installation preflight, install
51
+ automatically, or mistake a normal Context `not found` diagnostic for a missing
52
+ executable.
53
+
54
+ Execute only `next_action.command` returned by `context entry`:
55
+
56
+ - `initialize-workspace` writes a new workspace. Execute it immediately only
57
+ when the user explicitly requested initialization through this entry;
58
+ otherwise explain the target root and ask for confirmation. Preserve the
59
+ `init-target-nonempty` confirmation.
60
+ - `enter-workspace` and `evaluate-workflow` are read-only and need no additional
61
+ confirmation.
62
+ - After initialization, execute the exact setup command returned by `context
63
+ init`, enter the project root, read the generated `AGENTS.md`, and run this
64
+ entry again.
65
+
66
+ ### Conversation modes
67
+
68
+ Enable debugging only when the user explicitly requests it. Run `context debug
69
+ enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
70
+ does not grant workflow authority or provide source evidence.
71
+
72
+ For explicitly authorized fully managed operation, use:
73
+
74
+ ```bash
75
+ context run --managed --until blocked-or-complete --format json
76
+ ```
77
+
78
+ Use `--managed` for every resumed workflow evaluation in the same active
79
+ request. Never persist or reuse that authority in another conversation, and
80
+ stop using it when the conversation ends or the user revokes it. Pass any
81
+ additional `--authority` only when the user explicitly grants that authority in
82
+ this conversation.
83
+
84
+ The managed loop executes only Route-selected work and returns the current
85
+ `workflow.current` whenever Agent reading, project configuration, a human Gate,
86
+ host execution, diagnostics, or a non-unique plan needs attention. Resume from
87
+ that returned Route; never reconstruct a command from an earlier step.
88
+
89
+ ### Follow the current Route
90
+
91
+ Treat `workflow.current` as the current-step authority:
92
+
93
+ 1. Read every `resources.required` item whose `read_state` is `read-required`.
94
+ Read a returned `path` completely, or execute a returned resource `command`
95
+ and read its complete output file. Materializing a resource is not reading
96
+ it. Keep the merged receipts only in this conversation and submit them with
97
+ the exact returned `context status --resource-receipts @<file>` command. Use
98
+ `after_read_receipts` only after the full resource has been read. The exact
99
+ `resources.after_read.command` already returns the re-evaluated
100
+ `workflow.current`; continue from it without an additional status call.
101
+ 2. At a Gate, keep inspection and resolution phase-local. Read an
102
+ `inspection_action` resource only while inspecting the decision, and read a
103
+ `resolution_action` resource only after the user confirms the Gate. Neither
104
+ replaces ordinary required resources.
105
+ 3. Execute only `commands` returned by the Route, preserving revision and
106
+ authority flags exactly. A command marked `after-human-confirmation` waits
107
+ for the current Gate decision. Run a command whose `execution.target` is `agent-host`
108
+ as an exact top-level host action with the required host access,
109
+ not inside a restricted child sandbox. Follow the Route-selected procedure
110
+ for its audit and approval contract; never invent a payload, destination, or
111
+ substitute command.
112
+ 4. If `configuration` is present, edit only the named project file and use the
113
+ selected resources as its contract.
114
+ 5. After every action or configuration change, run status again. The managed
115
+ loop performs this re-evaluation internally. A phase-local `next_action` can
116
+ continue that operation but never replaces the workspace Route.
117
+
118
+ Explain, ask, confirm, and summarize in the user's current conversation
119
+ language. Keep commands, flags, paths, ids, status values, JSONL keys,
120
+ `source_ref` values, and copied CLI tokens unchanged.
121
+
122
+ Do not infer repo sources, extraction scope, review decisions, or package output
123
+ choices from surrounding files. Do not call source-repo operations such as
124
+ clone, checkout, reset, fetch, install, build, or test without explicit user
125
+ approval.
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: c4a-context
3
+ description: >
4
+ Build or continue structured, traceable Agent knowledge from documents and code. Use the local `context` CLI for workspace writes.
5
+ tools:
6
+ - Bash
7
+ ---
8
+
9
+ # Context
10
+
11
+ Public Context entry for agents that expose skills instead of slash commands.
12
+
13
+ - Public entry: `c4a-context`
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
+ Context is a knowledge management tool built for Agent knowledge workflows. It
22
+ compiles Feishu/Lark documents, local Markdown, repository code, and manually
23
+ curated business material into structured, traceable knowledge, then produces
24
+ knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
25
+ workflow guidance, knowledge-building procedures, and code-indexing capabilities
26
+ needed to produce that knowledge; follow its returned commands and resources
27
+ for the next action.
28
+
29
+ Use this as the single conversational entry for Context. Let the CLI locate an
30
+ existing workspace, relocate into it, initialize a requested workspace, or
31
+ evaluate its current workflow. Do not infer the workspace state yourself.
32
+
33
+ ### Enter the workspace
34
+
35
+ Run:
36
+
37
+ ```bash
38
+ context entry [project-dir] --language <language> --format json
39
+ ```
40
+
41
+ Use the user's explicit language choice when present; otherwise pass `zh-CN`
42
+ for a Chinese conversation and `en` for an English conversation. Pass
43
+ `project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
44
+ requested that initialization choice. Pass `--managed` only after the user
45
+ explicitly authorizes fully managed operation in this conversation.
46
+
47
+ If the `context` process itself cannot start because the command is missing
48
+ (`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
49
+ command, such as `command not found: context` or `context: command not found`),
50
+ explain that the global CLI is not installed and ask the user to install or
51
+ authorize installation with:
52
+
53
+ ```bash
54
+ npm install -g @c4a/context-cli@latest
55
+ context plugin install
56
+ ```
57
+
58
+ Stop after giving that recovery. Do not run an installation preflight, install
59
+ automatically, or mistake a normal Context `not found` diagnostic for a missing
60
+ executable.
61
+
62
+ Execute only `next_action.command` returned by `context entry`:
63
+
64
+ - `initialize-workspace` writes a new workspace. Execute it immediately only
65
+ when the user explicitly requested initialization through this entry;
66
+ otherwise explain the target root and ask for confirmation. Preserve the
67
+ `init-target-nonempty` confirmation.
68
+ - `enter-workspace` and `evaluate-workflow` are read-only and need no additional
69
+ confirmation.
70
+ - After initialization, execute the exact setup command returned by `context
71
+ init`, enter the project root, read the generated `AGENTS.md`, and run this
72
+ entry again.
73
+
74
+ ### Conversation modes
75
+
76
+ Enable debugging only when the user explicitly requests it. Run `context debug
77
+ enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
78
+ does not grant workflow authority or provide source evidence.
79
+
80
+ For explicitly authorized fully managed operation, use:
81
+
82
+ ```bash
83
+ context run --managed --until blocked-or-complete --format json
84
+ ```
85
+
86
+ Use `--managed` for every resumed workflow evaluation in the same active
87
+ request. Never persist or reuse that authority in another conversation, and
88
+ stop using it when the conversation ends or the user revokes it. Pass any
89
+ additional `--authority` only when the user explicitly grants that authority in
90
+ this conversation.
91
+
92
+ The managed loop executes only Route-selected work and returns the current
93
+ `workflow.current` whenever Agent reading, project configuration, a human Gate,
94
+ host execution, diagnostics, or a non-unique plan needs attention. Resume from
95
+ that returned Route; never reconstruct a command from an earlier step.
96
+
97
+ ### Follow the current Route
98
+
99
+ Treat `workflow.current` as the current-step authority:
100
+
101
+ 1. Read every `resources.required` item whose `read_state` is `read-required`.
102
+ Read a returned `path` completely, or execute a returned resource `command`
103
+ and read its complete output file. Materializing a resource is not reading
104
+ it. Keep the merged receipts only in this conversation and submit them with
105
+ the exact returned `context status --resource-receipts @<file>` command. Use
106
+ `after_read_receipts` only after the full resource has been read. The exact
107
+ `resources.after_read.command` already returns the re-evaluated
108
+ `workflow.current`; continue from it without an additional status call.
109
+ 2. At a Gate, keep inspection and resolution phase-local. Read an
110
+ `inspection_action` resource only while inspecting the decision, and read a
111
+ `resolution_action` resource only after the user confirms the Gate. Neither
112
+ replaces ordinary required resources.
113
+ 3. Execute only `commands` returned by the Route, preserving revision and
114
+ authority flags exactly. A command marked `after-human-confirmation` waits
115
+ for the current Gate decision. Run a command whose `execution.target` is `agent-host`
116
+ as an exact top-level host action with the required host access,
117
+ not inside a restricted child sandbox. Follow the Route-selected procedure
118
+ for its audit and approval contract; never invent a payload, destination, or
119
+ substitute command.
120
+ 4. If `configuration` is present, edit only the named project file and use the
121
+ selected resources as its contract.
122
+ 5. After every action or configuration change, run status again. The managed
123
+ loop performs this re-evaluation internally. A phase-local `next_action` can
124
+ continue that operation but never replaces the workspace Route.
125
+
126
+ Explain, ask, confirm, and summarize in the user's current conversation
127
+ language. Keep commands, flags, paths, ids, status values, JSONL keys,
128
+ `source_ref` values, and copied CLI tokens unchanged.
129
+
130
+ Do not infer repo sources, extraction scope, review decisions, or package output
131
+ choices from surrounding files. Do not call source-repo operations such as
132
+ clone, checkout, reset, fetch, install, build, or test without explicit user
133
+ approval.
@@ -0,0 +1,5 @@
1
+ schema: agent-graph.action.v1
2
+ id: flush-runtime-events
3
+ runner: host
4
+ effect: external
5
+ handler: context.logs.flush
@@ -39,3 +39,4 @@ codes:
39
39
  - { code: route.package.configuration-required, kind: route-reason, summary: Declare the confirmed package output in the Context project., document: resources/procedures/package-output.md }
40
40
  - { code: route.package.template-review-required, kind: route-reason, summary: "Replace or edit package templates, or explicitly accept the generic defaults.", document: resources/procedures/package-output.md }
41
41
  - { code: route.build.package-stale, kind: route-reason, summary: Build the declared package outputs from current approved knowledge., document: resources/procedures/close-and-build.md }
42
+ - { code: route.logs.delivery-pending, kind: route-reason, summary: Send locally queued runtime logs through the configured generic sink., document: resources/procedures/close-and-build.md }