@weareikko/code-review 0.9.7 → 0.9.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 (46) hide show
  1. package/README.md +1 -0
  2. package/dist/{cli-m4pS6_5q.js → cli-SQpUnA6c.js} +1462 -62
  3. package/dist/cli-SQpUnA6c.js.map +1 -0
  4. package/dist/cli.d.ts +29 -3
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +2 -2
  7. package/dist/config.d.ts +39 -1
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/diagnostics.d.ts +79 -0
  10. package/dist/diagnostics.d.ts.map +1 -1
  11. package/dist/github.d.ts +7 -0
  12. package/dist/github.d.ts.map +1 -1
  13. package/dist/gitlab-review.d.ts +69 -11
  14. package/dist/gitlab-review.d.ts.map +1 -1
  15. package/dist/gitlab.d.ts +6 -0
  16. package/dist/gitlab.d.ts.map +1 -1
  17. package/dist/intent.d.ts +21 -0
  18. package/dist/intent.d.ts.map +1 -0
  19. package/dist/marketplaces.d.ts +37 -0
  20. package/dist/marketplaces.d.ts.map +1 -1
  21. package/dist/mcp-config.d.ts +90 -0
  22. package/dist/mcp-config.d.ts.map +1 -0
  23. package/dist/mcp-parse.d.ts +146 -0
  24. package/dist/mcp-parse.d.ts.map +1 -0
  25. package/dist/mcp.d.ts +95 -0
  26. package/dist/mcp.d.ts.map +1 -0
  27. package/dist/otel.d.ts.map +1 -1
  28. package/dist/platform.d.ts +5 -0
  29. package/dist/platform.d.ts.map +1 -1
  30. package/dist/platforms/github.d.ts +1 -0
  31. package/dist/platforms/github.d.ts.map +1 -1
  32. package/dist/platforms/gitlab.d.ts +1 -0
  33. package/dist/platforms/gitlab.d.ts.map +1 -1
  34. package/dist/posting.d.ts +1 -0
  35. package/dist/posting.d.ts.map +1 -1
  36. package/dist/review.d.ts +9 -3
  37. package/dist/review.d.ts.map +1 -1
  38. package/dist/review.js +2 -2
  39. package/dist/skill-links.d.ts +14 -4
  40. package/dist/skill-links.d.ts.map +1 -1
  41. package/dist/skill-usage.d.ts +67 -0
  42. package/dist/skill-usage.d.ts.map +1 -0
  43. package/dist/verify.d.ts +25 -1
  44. package/dist/verify.d.ts.map +1 -1
  45. package/package.json +2 -1
  46. package/dist/cli-m4pS6_5q.js.map +0 -1
@@ -0,0 +1,67 @@
1
+ /** The minimum a loaded skill must expose to attribute a file read to it. */
2
+ export interface SkillReadTarget {
3
+ name: string;
4
+ /** Absolute path to the skill directory. Reads under it count as skill reads. */
5
+ rootDir: string;
6
+ }
7
+ /**
8
+ * The path a built-in read tool call targets, or `undefined` for any other tool
9
+ * or a call with no usable `path`. The parameter name is `path`, matching the
10
+ * `read` tool from `createReadOnlyTools` that the reviewer is actually handed.
11
+ * Only the built-in read tool is considered: a skill is loaded by reading its
12
+ * `SKILL.md`, and every other tool (grep, git, MCP) says nothing about whether
13
+ * the reviewer read the skill.
14
+ */
15
+ export declare function readToolPath(toolName: string, args: unknown): string | undefined;
16
+ /**
17
+ * The skill whose directory contains `path`, or `undefined` when the read
18
+ * targeted something else. Any file under the skill root counts — a reference
19
+ * file the `SKILL.md` points at is as much a skill read as the `SKILL.md`
20
+ * itself. Relative paths resolve against `cwd` — the review working directory
21
+ * the reviewer's read tool resolves them against, which `--cwd` can move away
22
+ * from the process working directory.
23
+ */
24
+ export declare function findSkillForPath(skills: readonly SkillReadTarget[], path: string, cwd: string): SkillReadTarget | undefined;
25
+ /** Counts, per skill, how many files under its directory the reviewer read. */
26
+ export interface SkillReadCounter {
27
+ /** Feed every tool start; non-read calls and reads outside a skill are ignored. */
28
+ record(toolName: string, args: unknown): void;
29
+ /** Reads recorded for `skill` so far. */
30
+ countFor(skill: SkillReadTarget): number;
31
+ }
32
+ /**
33
+ * Build a counter shared by every review stage — Find and Verify run different
34
+ * agents over the same tool list, so a skill read in either stage counts.
35
+ */
36
+ export declare function createSkillReadCounter(skills: readonly SkillReadTarget[], cwd: string): SkillReadCounter;
37
+ /** Whether a skill was read, as shown in the footer and the usage log line. */
38
+ export declare function formatSkillUsageState(skill: {
39
+ reads: number;
40
+ }): string;
41
+ /**
42
+ * How much a server was used, as shown in the footer and the usage log line:
43
+ * a pluralised call count, `unused` for a server that connected but was never
44
+ * called, and `unavailable` for one that failed to connect.
45
+ */
46
+ export declare function formatMcpUsageState(server: {
47
+ status: 'connected' | 'unavailable';
48
+ calls: number;
49
+ }): string;
50
+ /**
51
+ * The end-of-review usage log line, e.g.
52
+ * `Usage: skills code-review (read); MCP github (1 call), docs (unused)`.
53
+ * Each half is omitted when nothing of that kind was configured, and the whole
54
+ * line is `undefined` when neither was.
55
+ */
56
+ export declare function formatReviewUsageSummary(usage: {
57
+ skills: readonly {
58
+ name: string;
59
+ reads: number;
60
+ }[];
61
+ mcp: readonly {
62
+ name: string;
63
+ status: 'connected' | 'unavailable';
64
+ calls: number;
65
+ }[];
66
+ }): string | undefined;
67
+ //# sourceMappingURL=skill-usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-usage.d.ts","sourceRoot":"","sources":["../src/skill-usage.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKhF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV,eAAe,GAAG,SAAS,CAM7B;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9C,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,GAAG,EAAE,MAAM,GACV,gBAAgB,CAclB;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,MAAM,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,GAAG,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtF,GAAG,MAAM,GAAG,SAAS,CAWrB"}
package/dist/verify.d.ts CHANGED
@@ -32,7 +32,31 @@ export interface SynthesisResult {
32
32
  comments: ReviewComment[];
33
33
  audit: AuditEntry[];
34
34
  }
35
- export declare function buildVerifySystemPrompt(diff: string, commitLog?: string, staged?: SkippedDiffFile[]): string;
35
+ /** One MCP tool result captured during Find and replayed to the verifiers. */
36
+ export interface McpResultEntry {
37
+ /** Bridged tool name, e.g. `mcp__tracker__get_issue`. */
38
+ tool: string;
39
+ /** Short, already-redacted rendering of the call arguments. */
40
+ argsSummary: string;
41
+ /** Text the tool returned. */
42
+ text: string;
43
+ }
44
+ /**
45
+ * Render the MCP tool results the Find stage collected as an
46
+ * `<external-context-results>` block: the verifier sees the same external
47
+ * evidence the finder did without calling any tool itself. The block is capped
48
+ * at {@link MAX_EXTERNAL_CONTEXT_CHARS}; when it does not fit, the most recent
49
+ * results win (they are the ones the finding is most likely to cite) and a
50
+ * notice records how many older ones were dropped.
51
+ */
52
+ export declare function renderExternalContextResults(entries: McpResultEntry[]): string;
53
+ export interface VerifyContext {
54
+ /** Pre-rendered `<intent>` block from `renderIntentBlock`, if the MR has one. */
55
+ intentBlock?: string;
56
+ /** MCP tool results captured during Find, replayed as read-only evidence. */
57
+ externalContext?: McpResultEntry[];
58
+ }
59
+ export declare function buildVerifySystemPrompt(diff: string, commitLog?: string, staged?: SkippedDiffFile[], context?: VerifyContext): string;
36
60
  export declare function buildVerifyUserPrompt(comment: ReviewComment): string;
37
61
  export declare function parseVerdict(text: string): Verdict;
38
62
  export declare function stepDownSeverity(severity: Severity): Severity;
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC;IACjC,YAAY,EAAE,QAAQ,CAAC;IACvB,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;CACr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AQ,EAAE,aAAa,EAAE,EACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,eAAe,CA0CjB;AAmDD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,CAkB5F;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,MAAM,EAAE,eAAe,GACtB,MAAM,CASR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weareikko/code-review",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "description": "Agent-driven code review for GitLab merge requests and GitHub pull requests, with deduplicated inline comments and summary notes.",
5
5
  "keywords": [
6
6
  "ci",
@@ -64,6 +64,7 @@
64
64
  "@earendil-works/pi-agent-core": "0.85.1",
65
65
  "@earendil-works/pi-ai": "0.85.1",
66
66
  "@earendil-works/pi-coding-agent": "0.85.1",
67
+ "@modelcontextprotocol/sdk": "^1.30.1",
67
68
  "@opentelemetry/api": "^1.9.1",
68
69
  "@opentelemetry/api-logs": "^0.222.0",
69
70
  "@opentelemetry/resources": "^2.7.1",