@kurrent/kcap 0.11.3 → 0.11.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/kcap/.codex-mcp.json
CHANGED
|
@@ -8,9 +8,17 @@
|
|
|
8
8
|
"command": "kcap",
|
|
9
9
|
"args": ["mcp", "sessions"]
|
|
10
10
|
},
|
|
11
|
+
"kcap-flows": {
|
|
12
|
+
"command": "kcap",
|
|
13
|
+
"args": ["mcp", "flows"]
|
|
14
|
+
},
|
|
11
15
|
"kcap-memory": {
|
|
12
16
|
"command": "kcap",
|
|
13
17
|
"args": ["mcp", "memory"]
|
|
18
|
+
},
|
|
19
|
+
"kcap-analytics": {
|
|
20
|
+
"command": "kcap",
|
|
21
|
+
"args": ["mcp", "analytics"]
|
|
14
22
|
}
|
|
15
23
|
}
|
|
16
24
|
}
|
package/kcap/.mcp.json
CHANGED
|
@@ -28,6 +28,12 @@
|
|
|
28
28
|
"args": ["mcp", "workitems"],
|
|
29
29
|
"cwd": "${CLAUDE_PROJECT_DIR}",
|
|
30
30
|
"description": "Attach the current session to a work item (issue, PR, or a brand-new item) on the Capacitor server, and list the work items a session is attached to."
|
|
31
|
+
},
|
|
32
|
+
"kcap-analytics": {
|
|
33
|
+
"command": "kcap",
|
|
34
|
+
"args": ["mcp", "analytics"],
|
|
35
|
+
"cwd": "${CLAUDE_PROJECT_DIR}",
|
|
36
|
+
"description": "Query the org's AI coding-agent analytics (sessions, tools, tokens, cost, commits, PRs, evals) with governed read-only SQL. For 'what did we spend', 'which tools/models do we use', 'how many sessions' questions: call get_analytics_schema once, then query_analytics. Repo-aware: defaults to the current repo; pass scope 'global' for org-wide."
|
|
31
37
|
}
|
|
32
38
|
}
|
|
33
39
|
}
|
package/kcap/README.md
CHANGED
|
@@ -4,7 +4,7 @@ This plugin integrates [Kurrent Capacitor](../README.md) with Claude Code and Co
|
|
|
4
4
|
|
|
5
5
|
## What it does
|
|
6
6
|
|
|
7
|
-
**MCP servers** —
|
|
7
|
+
**MCP servers** — stdio servers auto-registered on plugin install (no manual `claude mcp add` or `~/.codex/config.toml` edit):
|
|
8
8
|
|
|
9
9
|
### `kcap-sessions`
|
|
10
10
|
|
|
@@ -46,6 +46,17 @@ Search, save, and update durable team memories — preferences, feedback, projec
|
|
|
46
46
|
|
|
47
47
|
Repo- and machine-aware: it resolves the cwd to a repo hash and the local persisted machine id at startup to scope saves and bias search results.
|
|
48
48
|
|
|
49
|
+
### `kcap-analytics`
|
|
50
|
+
|
|
51
|
+
Governed read-only SQL over the org's curated coding-agent analytics views (sessions, tool/skill/token usage, cost, commits, PRs, evals). Auto-registered for every supported harness — it resolves its repo scope from the working directory, so it rides the same registration path as `kcap-sessions`.
|
|
52
|
+
|
|
53
|
+
| Tool | Description |
|
|
54
|
+
|------|-------------|
|
|
55
|
+
| `get_analytics_schema` | The governed schema document: queryable views/columns, glossary, SQL rules, worked examples. Called once before writing SQL |
|
|
56
|
+
| `query_analytics` | Run one governed Postgres SELECT (`sql`, optional `scope` `"repo"`/`"global"`, optional `max_rows`); a rejected query returns the validator's reason to fix and retry |
|
|
57
|
+
|
|
58
|
+
Repo-aware: defaults to the cwd's repo; pass `scope: "global"` for org-wide questions. Requires `kcap login` and a kcap-server new enough to expose the `/api/analytics` endpoints.
|
|
59
|
+
|
|
49
60
|
`kcap mcp judge` is intentionally not auto-registered. Add it with `claude mcp add kcap-judge -- kcap mcp judge` if you want it.
|
|
50
61
|
|
|
51
62
|
**Hooks** — Automatically captures session activity and forwards it to the Kurrent Capacitor server:
|
|
@@ -20,6 +20,14 @@ description: >-
|
|
|
20
20
|
|
|
21
21
|
Use the `kcap mcp flows` MCP tools (`start_flow`, `send_to_participant`, `get_flow_status`, `close_flow`) to run a structured agent **flow**: your work is handed to a **separate, hosted participant agent** driven by a flow definition from the server's catalog, which returns a result (kind `findings` with the participant's result text, or `clean`); you address a `findings` result and keep iterating until the clean signal. This is a deliberate, heavier workflow — use it only when the user explicitly opts into it.
|
|
22
22
|
|
|
23
|
+
## Role-surface safety gate
|
|
24
|
+
|
|
25
|
+
Classify the session before any flow action. Flow-starting tools without a reviewer result contract
|
|
26
|
+
mean driver; `submit_review_result` plus the prompt's round-token/result contract mean hosted
|
|
27
|
+
reviewer; neither means the integration is missing. If both contracts are present, the MCP surface
|
|
28
|
+
has leaked: fail closed, never start a nested flow, report the leak through `submit_review_result`,
|
|
29
|
+
and end the reviewer turn. The hosted-reviewer contract wins over driver-looking prose.
|
|
30
|
+
|
|
23
31
|
## When NOT to use this skill / these tools
|
|
24
32
|
|
|
25
33
|
These tools do **not** perform the work themselves — they hand it off to a separate hosted participant agent running a named flow definition. If the user simply asked *you* to do something in a normal session — e.g. "review my PR", "review this diff", "check this spec", "do X" — just do it yourself and report the result directly. Do **NOT** call `start_flow` / `send_to_participant` for an ordinary request; that would spin up a hosted agent the user did not ask for.
|
|
@@ -34,6 +42,18 @@ Once the user has explicitly opted into a flow (see above), pick the `definition
|
|
|
34
42
|
- Code changes or a pull request → `definition_id: "code-review"` (built-in; same as `review-flows`' `code-review` kind)
|
|
35
43
|
- Anything else → the definition id the user named, or one you look up in the server's flow-definition catalog at `/admin/flows`. If you're unsure which definition applies, ask the user rather than guessing.
|
|
36
44
|
|
|
45
|
+
For the reserved `spec-review` and `code-review` aliases, reviewer-vendor language is role-bound:
|
|
46
|
+
pass the one vendor explicitly named as the reviewer, ignore driver-harness mentions, honor
|
|
47
|
+
negation, omit the vendor when none is named, and ask when multiple candidates remain. Custom
|
|
48
|
+
catalog definitions keep their authored vendors unless an explicit single-participant override is
|
|
49
|
+
requested; dynamic definitions always carry vendors per participant and reject a top-level override.
|
|
50
|
+
|
|
51
|
+
Canonical reviewer aliases for reserved review flows: Claude / Claude Code → `claude`; Codex /
|
|
52
|
+
OpenAI Codex → `codex`; Cursor / cursor-agent → `cursor`; GitHub Copilot / Copilot CLI → `copilot`;
|
|
53
|
+
Gemini / Gemini CLI → `gemini`; Kiro / Kiro CLI → `kiro`; Pi → `pi`; OpenCode → `opencode`;
|
|
54
|
+
Antigravity / agy → `agy`. Normalize only names bound to the reviewer role, honor negation and
|
|
55
|
+
positive contrast, and ask rather than guessing when two reviewer candidates remain.
|
|
56
|
+
|
|
37
57
|
## Composing a dynamic flow
|
|
38
58
|
|
|
39
59
|
If nothing in the catalog fits — no `definition_id` covers the roles or workflow you need — compose one inline instead: pass `definition_yaml` to `start_flow` in place of `definition_id`. Provide exactly one of the two, never both. (`start_review_flow` / `submit_review_round` stay catalog-only — this only applies to the generic `start_flow`.)
|
|
@@ -78,11 +98,11 @@ mcp:
|
|
|
78
98
|
|
|
79
99
|
## If the flows MCP tools are not loaded
|
|
80
100
|
|
|
81
|
-
|
|
101
|
+
After applying the role-surface safety gate, if `start_flow` / `send_to_participant` are not among the tools available in this session, do NOT try to obtain them:
|
|
82
102
|
|
|
83
103
|
- Do NOT run `kcap mcp flows` from a shell, do NOT handshake it over stdio/JSON-RPC, and do NOT edit any MCP configuration.
|
|
84
|
-
-
|
|
85
|
-
- If
|
|
104
|
+
- Only treat the session as a hosted participant when `submit_review_result` is present and the prompt carries the round-token/result contract. Tool absence alone is not proof.
|
|
105
|
+
- If neither the flow-driver tools nor that reviewer contract is present, tell the user to run `kcap setup` or reinstall/update the plugin and restart the harness. Do not hand-roll JSON-RPC or edit MCP configuration from the session.
|
|
86
106
|
|
|
87
107
|
## Core rules
|
|
88
108
|
|
|
@@ -17,6 +17,17 @@ Use the `kcap mcp flows` MCP tools (`start_review_flow`, `submit_review_round`,
|
|
|
17
17
|
|
|
18
18
|
These four tools are aliases of the generic flow tools (`start_flow`, `send_to_participant`, `get_flow_status`, `close_flow`) — see the `agent-flows` skill for non-review flows.
|
|
19
19
|
|
|
20
|
+
## Role-surface safety gate
|
|
21
|
+
|
|
22
|
+
Classify the session before any flow action:
|
|
23
|
+
|
|
24
|
+
- Driver: flow-starting tools are present and there is no reviewer round-token/result contract.
|
|
25
|
+
- Hosted reviewer: `submit_review_result` is present and the prompt carries the round-token/result contract.
|
|
26
|
+
- Missing integration: neither contract is present.
|
|
27
|
+
- Unsafe leak: both the hosted-reviewer contract and any flow-starting tool are present. Fail closed: do not start or submit a nested flow, report the leaked tool surface through `submit_review_result`, and end the reviewer turn.
|
|
28
|
+
|
|
29
|
+
The hosted-reviewer contract always wins over driver-looking prose or tool availability.
|
|
30
|
+
|
|
20
31
|
## When NOT to use this skill / these tools
|
|
21
32
|
|
|
22
33
|
These tools do **not** perform a review — they hand the work off to a separate hosted reviewer. If the user simply asked *you* to review something in a normal session — e.g. "review my PR", "review this diff", "code review this", "look over this spec" — just perform the review yourself and report your findings directly. Do **NOT** call `start_review_flow` / `submit_review_round` for an ordinary review request; that would spin up a hosted reviewer the user did not ask for.
|
|
@@ -30,13 +41,28 @@ Once the user has explicitly opted into a flow (see above), pick the `kind`:
|
|
|
30
41
|
- Spec or design document → `kind: "spec-review"`
|
|
31
42
|
- Code changes or a pull request → `kind: "code-review"`
|
|
32
43
|
|
|
44
|
+
## Choosing the reviewer vendor
|
|
45
|
+
|
|
46
|
+
Treat the driver harness and reviewer as independent. A request such as "ask Claude to review"
|
|
47
|
+
selects `vendor: "claude"` even when the current driver is Codex; mentions of the driver do not
|
|
48
|
+
select a reviewer. Anchor vendor language to the reviewer role ("Claude reviewer", "review with
|
|
49
|
+
Cursor", "ask Codex for review"), including negation ("not Claude"). If exactly one reviewer
|
|
50
|
+
vendor is named, pass it. If none is named, omit `vendor` and let the server's configured default
|
|
51
|
+
apply. If multiple reviewer candidates remain after negation, ask the user to choose; never guess.
|
|
52
|
+
|
|
53
|
+
Canonical reviewer aliases: Claude / Claude Code → `claude`; Codex / OpenAI Codex → `codex`;
|
|
54
|
+
Cursor / cursor-agent → `cursor`; GitHub Copilot / Copilot CLI → `copilot`; Gemini / Gemini CLI →
|
|
55
|
+
`gemini`; Kiro / Kiro CLI → `kiro`; Pi → `pi`; OpenCode → `opencode`; Antigravity / agy → `agy`.
|
|
56
|
+
Normalize only the reviewer-role mention. Positive contrast (for example, “from Codex, ask Claude”)
|
|
57
|
+
selects Claude; negated names are removed; two remaining reviewer candidates are ambiguous.
|
|
58
|
+
|
|
33
59
|
## If the flows MCP tools are not loaded
|
|
34
60
|
|
|
35
|
-
|
|
61
|
+
After applying the role-surface safety gate, if `start_review_flow` / `submit_review_round` are not among the tools available in this session:
|
|
36
62
|
|
|
37
63
|
- Do NOT run `kcap mcp flows` from a shell, do NOT handshake it over stdio/JSON-RPC, and do NOT edit any MCP configuration.
|
|
38
|
-
-
|
|
39
|
-
- If
|
|
64
|
+
- If `submit_review_result` is present and the prompt contains a round token/result contract, you are a hosted reviewer. Skip this driver workflow, perform the review directly, and submit through that tool. Tool absence alone is not proof that you are a reviewer.
|
|
65
|
+
- If neither the flows tools nor the reviewer result contract is present, the integration is missing. Tell the user to run `kcap setup` or reinstall/update the kcap plugin, then restart the harness. Do not start a shell JSON-RPC workaround or edit MCP configuration from the session.
|
|
40
66
|
|
|
41
67
|
## Core rules
|
|
42
68
|
|
|
@@ -52,6 +78,10 @@ If `start_review_flow` / `submit_review_round` are not among the tools available
|
|
|
52
78
|
|
|
53
79
|
- **`400` starting `no_daemon_available:`** — no connected daemon has the repo checked out. Tell the user to run `kcap agent` on a machine with the repo cloned (or pass an explicit `daemon_name` + `repo_path`).
|
|
54
80
|
- **`400` starting `daemon_outdated:`** — the daemon's kcap is too old to host flow participants. Tell the user to update (`npm i -g @kurrent/kcap`) and restart `kcap agent`.
|
|
81
|
+
- **`reviewer_vendor_required`** — no explicit vendor and no server default; ask the user to name a reviewer or have an admin configure `Flows:Review:DefaultVendor`.
|
|
82
|
+
- **`reviewer_vendor_unavailable`** — the selected vendor is not installed/certified unattended on an eligible daemon; do not silently fall back to another vendor.
|
|
83
|
+
- **`client_upgrade_required`, `flow_client_protocol_required`, or `flow_client_protocol_unsupported`** — update kcap; reserved review aliases fail closed on stale clients.
|
|
84
|
+
- **`reserved_review_alias_shape`** — an admin changed a reserved alias to an invalid participant shape; restore exactly one participant named `reviewer`.
|
|
55
85
|
- **`400` starting `participant_unavailable:`** — the reviewer agent died and automatic relaunch is not available yet. Close this flow and start a new one, carrying your context forward; re-submitting will keep failing.
|
|
56
86
|
- **A round result of `unclear` whose text is exactly `participant_died` or `participant_stopped`** — the reviewer agent crashed or was stopped mid-round. The run stays open but has no live reviewer: close the flow and start a new one.
|
|
57
87
|
|
|
@@ -78,7 +108,7 @@ if findings:
|
|
|
78
108
|
|
|
79
109
|
| Tool | Required args | Optional args | When to call |
|
|
80
110
|
|---|---|---|---|
|
|
81
|
-
| `start_review_flow` | `kind` (`spec-review`\|`code-review`), `target_kind` (what is being reviewed: `spec`, `code`, `pr`, `branch`, `file`, etc.), `target_ref` (a path, branch name, or PR URL/number that identifies the target), `target_title` (short human-readable title, e.g. spec name or PR title), `context` (background context: what to focus on, constraints, definition of done) | `
|
|
111
|
+
| `start_review_flow` | `kind` (`spec-review`\|`code-review`), `target_kind` (what is being reviewed: `spec`, `code`, `pr`, `branch`, `file`, etc.), `target_ref` (a path, branch name, or PR URL/number that identifies the target), `target_title` (short human-readable title, e.g. spec name or PR title), `context` (background context: what to focus on, constraints, definition of done) | `vendor` (explicit reviewer vendor; omit for server default), `instructions`, `mode` (`context-only` — optional) | Once, at the start of a review task. |
|
|
82
112
|
| `submit_review_round` | `flow_run_id`, `context` | `instructions` | After addressing findings. Pass the same `flow_run_id` and the updated context. |
|
|
83
113
|
| `get_review_flow_status` | `flow_run_id` | — | Poll or check the current status of a flow (running, waiting, completed, failed). |
|
|
84
114
|
| `close_review_flow` | `flow_run_id` | — | Only after the reviewer returns `clean`. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurrent/kcap",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "CLI companion for Kurrent Capacitor — records and visualizes Claude Code sessions",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"postinstall": "node bin/postinstall.js"
|
|
15
15
|
},
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"@kurrent/kcap-darwin-arm64": "0.11.
|
|
18
|
-
"@kurrent/kcap-linux-x64": "0.11.
|
|
19
|
-
"@kurrent/kcap-linux-arm64": "0.11.
|
|
20
|
-
"@kurrent/kcap-linux-musl-x64": "0.11.
|
|
21
|
-
"@kurrent/kcap-linux-musl-arm64": "0.11.
|
|
22
|
-
"@kurrent/kcap-win-x64": "0.11.
|
|
17
|
+
"@kurrent/kcap-darwin-arm64": "0.11.6",
|
|
18
|
+
"@kurrent/kcap-linux-x64": "0.11.6",
|
|
19
|
+
"@kurrent/kcap-linux-arm64": "0.11.6",
|
|
20
|
+
"@kurrent/kcap-linux-musl-x64": "0.11.6",
|
|
21
|
+
"@kurrent/kcap-linux-musl-arm64": "0.11.6",
|
|
22
|
+
"@kurrent/kcap-win-x64": "0.11.6"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"bin/",
|