cclaw-cli 0.48.9 → 0.48.10
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/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/content/harness-doc.js +1 -1
- package/dist/content/harness-playbooks.js +7 -7
- package/dist/content/hook-events.js +19 -19
- package/dist/content/hooks.d.ts +0 -16
- package/dist/content/hooks.js +112 -1220
- package/dist/content/learnings.js +2 -2
- package/dist/content/next-command.js +2 -2
- package/dist/content/node-hooks.js +20 -11
- package/dist/content/observe.d.ts +0 -38
- package/dist/content/observe.js +27 -1718
- package/dist/content/opencode-plugin.js +5 -5
- package/dist/content/protocols.js +5 -9
- package/dist/content/skills.js +1 -1
- package/dist/content/stage-common-guidance.js +1 -1
- package/dist/content/stages/design.js +1 -1
- package/dist/content/stages/plan.js +2 -2
- package/dist/content/stages/scope.js +1 -1
- package/dist/doctor.js +63 -52
- package/dist/install.js +124 -53
- package/dist/policy.js +13 -13
- package/package.json +2 -3
package/dist/config.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class InvalidConfigError extends Error {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function configPath(projectRoot: string): string;
|
|
6
6
|
/**
|
|
7
|
-
* Default test-path patterns used by workflow-guard
|
|
7
|
+
* Default test-path patterns used by the workflow-guard hook to classify TDD writes.
|
|
8
8
|
*
|
|
9
9
|
* Scope is intentionally narrow and language-agnostic; users can extend this
|
|
10
10
|
* list in config when their repository uses different conventions.
|
package/dist/config.js
CHANGED
|
@@ -100,7 +100,7 @@ export function configPath(projectRoot) {
|
|
|
100
100
|
return path.join(projectRoot, CONFIG_PATH);
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* Default test-path patterns used by workflow-guard
|
|
103
|
+
* Default test-path patterns used by the workflow-guard hook to classify TDD writes.
|
|
104
104
|
*
|
|
105
105
|
* Scope is intentionally narrow and language-agnostic; users can extend this
|
|
106
106
|
* list in config when their repository uses different conventions.
|
|
@@ -103,7 +103,7 @@ shared casing silently breaks generated wiring.
|
|
|
103
103
|
- Codex-specific ceiling: \`PreToolUse\` can only intercept \`Bash\`. Direct
|
|
104
104
|
\`Write\`/\`Edit\` to \`.cclaw/state/flow-state.json\` cannot be hard-blocked
|
|
105
105
|
at hook level, so the canonical path is
|
|
106
|
-
\`
|
|
106
|
+
\`node .cclaw/hooks/stage-complete.mjs <stage>\` plus the non-blocking
|
|
107
107
|
\`UserPromptSubmit\` state nudge.
|
|
108
108
|
|
|
109
109
|
## Shared command contract
|
|
@@ -233,7 +233,7 @@ Codex CLI has a different shape from Claude/Cursor:
|
|
|
233
233
|
\`PostToolUse\` events only fire for the \`Bash\` tool. \`Write\`,
|
|
234
234
|
\`Edit\`, \`WebSearch\`, and MCP tool calls are **not** gated by hooks.
|
|
235
235
|
cclaw partially compensates by wiring \`UserPromptSubmit\` to both
|
|
236
|
-
\`prompt-guard
|
|
236
|
+
\`prompt-guard\` and a non-blocking
|
|
237
237
|
\`cclaw internal verify-current-state --quiet\` nudge that emits
|
|
238
238
|
unmet-delegation / missing-evidence warnings before the turn executes.
|
|
239
239
|
This is still a nudge, not a hard block: workflow-guard (TDD red-first,
|
|
@@ -291,7 +291,7 @@ disabled in v0.33 and remains off.
|
|
|
291
291
|
- \`/use cc\` — open the \`/cc\` skill and pick a track.
|
|
292
292
|
- \`/use cc-next\` — advance the flow one stage.
|
|
293
293
|
- \`/use cc-ops\` — compound / archive / rewind.
|
|
294
|
-
- \`
|
|
294
|
+
- \`node .cclaw/hooks/stage-complete.mjs <stage>\` — canonical stage closeout helper;
|
|
295
295
|
validates delegations + gate evidence before mutating \`flow-state.json\`.
|
|
296
296
|
- Typing \`/cc …\` or \`/cc-next …\` in plain text also works: Codex
|
|
297
297
|
matches the skill descriptions (which spell out these tokens) and
|
|
@@ -318,12 +318,12 @@ continue to work regardless.
|
|
|
318
318
|
|
|
319
319
|
| Hook intent | Codex mapping | Coverage |
|
|
320
320
|
|-------------|---------------|----------|
|
|
321
|
-
| SessionStart rehydration | \`SessionStart\` matcher \`startup|resume\` → \`session-start
|
|
322
|
-
| PreToolUse prompt-guard | \`PreToolUse\` matcher \`Bash\` + \`UserPromptSubmit\` → \`prompt-guard
|
|
321
|
+
| SessionStart rehydration | \`SessionStart\` matcher \`startup|resume\` → \`session-start\` | Full. |
|
|
322
|
+
| PreToolUse prompt-guard | \`PreToolUse\` matcher \`Bash\` + \`UserPromptSubmit\` → \`prompt-guard\` | Bash tool calls are gated inline; \`UserPromptSubmit\` catches prompts before any tool fires, so non-Bash writes (\`Write\`/\`Edit\`) are still prompt-guarded at the turn boundary. |
|
|
323
323
|
| UserPromptSubmit state nudge | \`UserPromptSubmit\` → \`cclaw internal verify-current-state --quiet\` | Non-blocking warning only. Prints unmet mandatory delegation / gate-evidence counts before the turn; cannot block non-Bash \`Write\`/\`Edit\`. |
|
|
324
|
-
| PreToolUse workflow-guard | \`PreToolUse\` matcher \`Bash\` → \`workflow-guard
|
|
325
|
-
| PostToolUse context-monitor | \`PostToolUse\` matcher \`Bash\` → \`context-monitor
|
|
326
|
-
| Stop checkpoint | \`Stop\` → \`stop-checkpoint
|
|
324
|
+
| PreToolUse workflow-guard | \`PreToolUse\` matcher \`Bash\` → \`workflow-guard\` | Bash-only. For \`Write\`/\`Edit\` calls the agent performs the TDD-order / artifact check in-turn (see the stage skill). |
|
|
325
|
+
| PostToolUse context-monitor | \`PostToolUse\` matcher \`Bash\` → \`context-monitor\` | Bash-only. Other tool calls get context-monitored at end-of-turn via \`.cclaw/references/protocols/ethos.md\`. |
|
|
326
|
+
| Stop checkpoint | \`Stop\` → \`stop-checkpoint\` | Full. |
|
|
327
327
|
| PreCompact digest | Not supported — Codex has no \`PreCompact\` event. | Covered by \`/cc-ops retro\` and the user running \`/cc-view status\` before Codex's \`/compact\` command. |
|
|
328
328
|
|
|
329
329
|
## Verification
|
|
@@ -9,27 +9,27 @@ export const HOOK_SEMANTIC_EVENTS = [
|
|
|
9
9
|
export const HOOK_EVENTS_BY_HARNESS = {
|
|
10
10
|
claude: {
|
|
11
11
|
session_rehydrate: "SessionStart matcher startup|resume|clear|compact",
|
|
12
|
-
pre_tool_prompt_guard: "PreToolUse -> prompt-guard
|
|
13
|
-
pre_tool_workflow_guard: "PreToolUse -> workflow-guard
|
|
14
|
-
post_tool_context_monitor: "PostToolUse -> context-monitor
|
|
15
|
-
stop_checkpoint: "Stop -> stop-checkpoint
|
|
16
|
-
precompact_digest: "PreCompact -> pre-compact
|
|
12
|
+
pre_tool_prompt_guard: "PreToolUse -> prompt-guard",
|
|
13
|
+
pre_tool_workflow_guard: "PreToolUse -> workflow-guard",
|
|
14
|
+
post_tool_context_monitor: "PostToolUse -> context-monitor",
|
|
15
|
+
stop_checkpoint: "Stop -> stop-checkpoint",
|
|
16
|
+
precompact_digest: "PreCompact -> pre-compact"
|
|
17
17
|
},
|
|
18
18
|
cursor: {
|
|
19
19
|
session_rehydrate: "sessionStart/sessionResume/sessionClear/sessionCompact",
|
|
20
|
-
pre_tool_prompt_guard: "preToolUse -> prompt-guard
|
|
21
|
-
pre_tool_workflow_guard: "preToolUse -> workflow-guard
|
|
22
|
-
post_tool_context_monitor: "postToolUse -> context-monitor
|
|
23
|
-
stop_checkpoint: "stop -> stop-checkpoint
|
|
24
|
-
precompact_digest: "sessionCompact -> pre-compact
|
|
20
|
+
pre_tool_prompt_guard: "preToolUse -> prompt-guard",
|
|
21
|
+
pre_tool_workflow_guard: "preToolUse -> workflow-guard",
|
|
22
|
+
post_tool_context_monitor: "postToolUse -> context-monitor",
|
|
23
|
+
stop_checkpoint: "stop -> stop-checkpoint",
|
|
24
|
+
precompact_digest: "sessionCompact -> pre-compact"
|
|
25
25
|
},
|
|
26
26
|
opencode: {
|
|
27
27
|
session_rehydrate: "plugin event handlers + transform rehydration",
|
|
28
|
-
pre_tool_prompt_guard: "plugin tool.execute.before -> prompt-guard
|
|
29
|
-
pre_tool_workflow_guard: "plugin tool.execute.before -> workflow-guard
|
|
30
|
-
post_tool_context_monitor: "plugin tool.execute.after -> context-monitor
|
|
31
|
-
stop_checkpoint: "plugin session.idle -> stop-checkpoint
|
|
32
|
-
precompact_digest: "plugin session.compacted -> pre-compact
|
|
28
|
+
pre_tool_prompt_guard: "plugin tool.execute.before -> prompt-guard",
|
|
29
|
+
pre_tool_workflow_guard: "plugin tool.execute.before -> workflow-guard",
|
|
30
|
+
post_tool_context_monitor: "plugin tool.execute.after -> context-monitor",
|
|
31
|
+
stop_checkpoint: "plugin session.idle -> stop-checkpoint",
|
|
32
|
+
precompact_digest: "plugin session.compacted -> pre-compact"
|
|
33
33
|
},
|
|
34
34
|
codex: {
|
|
35
35
|
// Codex CLI v0.114+ exposes lifecycle hooks via `.codex/hooks.json`,
|
|
@@ -39,9 +39,9 @@ export const HOOK_EVENTS_BY_HARNESS = {
|
|
|
39
39
|
// calls do not trigger them). `precompact_digest` is unmapped —
|
|
40
40
|
// Codex has no PreCompact event; cclaw covers it via `/cc-ops retro`.
|
|
41
41
|
session_rehydrate: "SessionStart matcher startup|resume",
|
|
42
|
-
pre_tool_prompt_guard: "PreToolUse matcher Bash -> prompt-guard
|
|
43
|
-
pre_tool_workflow_guard: "PreToolUse matcher Bash -> workflow-guard
|
|
44
|
-
post_tool_context_monitor: "PostToolUse matcher Bash -> context-monitor
|
|
45
|
-
stop_checkpoint: "Stop -> stop-checkpoint
|
|
42
|
+
pre_tool_prompt_guard: "PreToolUse matcher Bash -> prompt-guard (plus UserPromptSubmit for non-Bash prompts)",
|
|
43
|
+
pre_tool_workflow_guard: "PreToolUse matcher Bash -> workflow-guard (Bash-only)",
|
|
44
|
+
post_tool_context_monitor: "PostToolUse matcher Bash -> context-monitor (Bash-only)",
|
|
45
|
+
stop_checkpoint: "Stop -> stop-checkpoint"
|
|
46
46
|
}
|
|
47
47
|
};
|
package/dist/content/hooks.d.ts
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook generators for all supported harnesses.
|
|
3
|
-
*
|
|
4
|
-
* SessionStart: injects using-cclaw + flow state + knowledge + checkpoint/activity summary.
|
|
5
|
-
* Stop: writes checkpoint.json and reminds about flow consistency.
|
|
6
|
-
* Harness hook JSON wiring is generated in observe.ts.
|
|
7
|
-
*/
|
|
8
|
-
export interface HookRuntimeOptions {
|
|
9
|
-
}
|
|
10
|
-
/** Shared bash preamble for generated hook scripts. */
|
|
11
|
-
export declare const RUNTIME_SHELL_DETECT_ROOT = "CCLAW_HOOK_LIB_PATH=\"\"\nfor candidate in \"${CCLAW_PROJECT_ROOT:-}\" \"${CLAUDE_PROJECT_DIR:-}\" \"${CURSOR_PROJECT_DIR:-}\" \"${CURSOR_PROJECT_ROOT:-}\" \"${OPENCODE_PROJECT_DIR:-}\" \"${OPENCODE_PROJECT_ROOT:-}\" \"${PWD:-}\"; do\n if [ -n \"$candidate\" ] && [ -f \"$candidate/.cclaw/hooks/_lib.sh\" ]; then\n CCLAW_HOOK_LIB_PATH=\"$candidate/.cclaw/hooks/_lib.sh\"\n break\n fi\ndone\nif [ -n \"$CCLAW_HOOK_LIB_PATH\" ] && [ -f \"$CCLAW_HOOK_LIB_PATH\" ]; then\n # shellcheck disable=SC1090\n . \"$CCLAW_HOOK_LIB_PATH\"\nfi\n\nif command -v cclaw_hook_detect_root >/dev/null 2>&1; then\n cclaw_hook_detect_root\nelse\n HARNESS=\"codex\"\n if [ -n \"${CLAUDE_PROJECT_DIR:-}\" ]; then\n HARNESS=\"claude\"\n elif [ -n \"${CURSOR_PROJECT_DIR:-}\" ] || [ -n \"${CURSOR_PROJECT_ROOT:-}\" ]; then\n HARNESS=\"cursor\"\n elif [ -n \"${OPENCODE_PROJECT_DIR:-}\" ] || [ -n \"${OPENCODE_PROJECT_ROOT:-}\" ]; then\n HARNESS=\"opencode\"\n fi\n\n ROOT=\"\"\n for candidate in \"${CCLAW_PROJECT_ROOT:-}\" \"${CLAUDE_PROJECT_DIR:-}\" \"${CURSOR_PROJECT_DIR:-}\" \"${CURSOR_PROJECT_ROOT:-}\" \"${OPENCODE_PROJECT_DIR:-}\" \"${OPENCODE_PROJECT_ROOT:-}\" \"${PWD:-}\"; do\n if [ -n \"$candidate\" ] && [ -d \"$candidate/.cclaw\" ]; then\n ROOT=\"$candidate\"\n break\n fi\n done\n if [ -z \"$ROOT\" ]; then\n ROOT=\"${CCLAW_PROJECT_ROOT:-${CLAUDE_PROJECT_DIR:-${CURSOR_PROJECT_DIR:-${CURSOR_PROJECT_ROOT:-${OPENCODE_PROJECT_DIR:-${OPENCODE_PROJECT_ROOT:-${PWD}}}}}}}\"\n fi\nfi";
|
|
12
|
-
export declare function hookLibScript(): string;
|
|
13
|
-
export declare function sessionStartScript(_options?: HookRuntimeOptions): string;
|
|
14
|
-
export declare function stopCheckpointScript(): string;
|
|
15
|
-
export declare function runHookDispatcherScript(): string;
|
|
16
1
|
export declare function stageCompleteScript(): string;
|
|
17
|
-
export declare function preCompactScript(): string;
|
|
18
2
|
export { claudeHooksJsonWithObservation as claudeHooksJson } from "./observe.js";
|
|
19
3
|
export { cursorHooksJsonWithObservation as cursorHooksJson } from "./observe.js";
|
|
20
4
|
export { codexHooksJsonWithObservation as codexHooksJson } from "./observe.js";
|