@cat-factory/agents 0.56.0 → 0.58.0
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.
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { AgentKindDefinition, AgentKindRegistry } from './registry.js';
|
|
2
2
|
export declare const PR_REVIEWER_KIND = "pr-reviewer";
|
|
3
3
|
/**
|
|
4
|
-
* The reviewer's structured output.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* the initiative lifts these slice/finding shapes into shared `@cat-factory/contracts` schemas
|
|
9
|
-
* (for the step-state + selection UI); until then this is the sole definition.
|
|
4
|
+
* The reviewer's structured output. The lenient (`v.fallback`) slice/finding shape is the
|
|
5
|
+
* SINGLE source of truth in `@cat-factory/contracts` (`prReviewAgentOutputSchema`) — shared
|
|
6
|
+
* with the engine's coercion onto `step.prReview` and the selection UI — so a partially-
|
|
7
|
+
* malformed reply degrades to sensible defaults rather than failing the run.
|
|
10
8
|
*/
|
|
11
9
|
export declare const prReview: import("./structured-output.js").StructuredOutput<{
|
|
12
10
|
summary?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-reviewer.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"pr-reviewer.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AA4B3E,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;EAAoD,CAAA;AAEzE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AAE9D,eAAO,MAAM,yBAAyB,QAqCjC,CAAA;AAEL,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,EAuBxD,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAEzE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { prReviewAgentOutputSchema } from '@cat-factory/contracts';
|
|
2
2
|
import { defineStructuredOutput } from './structured-output.js';
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
// The `pr-reviewer` agent kind — a deep, token-bounded review of an EXISTING open
|
|
@@ -15,10 +15,11 @@ import { defineStructuredOutput } from './structured-output.js';
|
|
|
15
15
|
// token usage scales with the slice budget, not the whole PR.
|
|
16
16
|
//
|
|
17
17
|
// The structured JSON (slices + severity-ordered findings) is recorded on the step as
|
|
18
|
-
// `result.custom` and rendered
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
18
|
+
// `result.custom` and rendered by the dedicated `pr-review` window: the run parks for a
|
|
19
|
+
// human to multi-select which findings matter, then resolve one of three ways — `finish`
|
|
20
|
+
// (record the selection), `fix` (feed the selected findings to a Fixer that commits fixes
|
|
21
|
+
// onto the PR branch) or `post` (publish them as inline PR review comments). See
|
|
22
|
+
// backend/docs/adr/0023-pr-deep-review.md.
|
|
22
23
|
//
|
|
23
24
|
// The read-only guardrail + final-answer-in-reply directives are appended automatically
|
|
24
25
|
// for a registered `container-explore` kind (see `applySurfaceDirectives`), so the
|
|
@@ -26,48 +27,12 @@ import { defineStructuredOutput } from './structured-output.js';
|
|
|
26
27
|
// ---------------------------------------------------------------------------
|
|
27
28
|
export const PR_REVIEWER_KIND = 'pr-reviewer';
|
|
28
29
|
/**
|
|
29
|
-
* The reviewer's structured output.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* the initiative lifts these slice/finding shapes into shared `@cat-factory/contracts` schemas
|
|
34
|
-
* (for the step-state + selection UI); until then this is the sole definition.
|
|
30
|
+
* The reviewer's structured output. The lenient (`v.fallback`) slice/finding shape is the
|
|
31
|
+
* SINGLE source of truth in `@cat-factory/contracts` (`prReviewAgentOutputSchema`) — shared
|
|
32
|
+
* with the engine's coercion onto `step.prReview` and the selection UI — so a partially-
|
|
33
|
+
* malformed reply degrades to sensible defaults rather than failing the run.
|
|
35
34
|
*/
|
|
36
|
-
export const prReview = defineStructuredOutput(
|
|
37
|
-
/** One-paragraph overall assessment of the PR. */
|
|
38
|
-
summary: v.fallback(v.optional(v.string()), undefined),
|
|
39
|
-
/** The cohesive slices the reviewer grouped the changed files into. */
|
|
40
|
-
slices: v.fallback(v.array(v.fallback(v.object({
|
|
41
|
-
title: v.fallback(v.string(), ''),
|
|
42
|
-
rationale: v.fallback(v.string(), ''),
|
|
43
|
-
paths: v.fallback(v.array(v.fallback(v.string(), '')), []),
|
|
44
|
-
}), { title: '', rationale: '', paths: [] })), []),
|
|
45
|
-
/** The findings, ordered by severity (blocker → nit). */
|
|
46
|
-
findings: v.fallback(v.array(v.fallback(v.object({
|
|
47
|
-
path: v.fallback(v.string(), ''),
|
|
48
|
-
line: v.fallback(v.optional(v.number()), undefined),
|
|
49
|
-
side: v.fallback(v.optional(v.picklist(['LEFT', 'RIGHT'])), undefined),
|
|
50
|
-
severity: v.fallback(v.picklist(['blocker', 'high', 'medium', 'low', 'nit']), 'medium'),
|
|
51
|
-
category: v.fallback(v.picklist([
|
|
52
|
-
'correctness',
|
|
53
|
-
'security',
|
|
54
|
-
'performance',
|
|
55
|
-
'maintainability',
|
|
56
|
-
'style',
|
|
57
|
-
'test',
|
|
58
|
-
'other',
|
|
59
|
-
]), 'other'),
|
|
60
|
-
title: v.fallback(v.string(), ''),
|
|
61
|
-
detail: v.fallback(v.string(), ''),
|
|
62
|
-
suggestedFix: v.fallback(v.optional(v.string()), undefined),
|
|
63
|
-
}), {
|
|
64
|
-
path: '',
|
|
65
|
-
severity: 'medium',
|
|
66
|
-
category: 'other',
|
|
67
|
-
title: '',
|
|
68
|
-
detail: '',
|
|
69
|
-
})), []),
|
|
70
|
-
}));
|
|
35
|
+
export const prReview = defineStructuredOutput(prReviewAgentOutputSchema);
|
|
71
36
|
export const PR_REVIEWER_SYSTEM_PROMPT = 'You are a meticulous senior code reviewer performing a DEEP review of an open pull request. ' +
|
|
72
37
|
'The task names the pull request to review — its number (e.g. #123) and URL. Fetch its head ' +
|
|
73
38
|
'into the checkout and diff it against the base branch:\n' +
|
|
@@ -122,7 +87,9 @@ export const PR_REVIEWER_AGENT_KINDS = [
|
|
|
122
87
|
description: 'Deep, token-bounded review of an open pull request: slices a large diff into cohesive ' +
|
|
123
88
|
'chunks, reviews each, and returns prioritized findings.',
|
|
124
89
|
category: 'review',
|
|
125
|
-
|
|
90
|
+
// Opens the dedicated PR-review window (findings grouped by slice + multi-select →
|
|
91
|
+
// resolve) instead of the generic read-only JSON viewer. See PrReviewWindow.vue.
|
|
92
|
+
resultView: 'pr-review',
|
|
126
93
|
},
|
|
127
94
|
},
|
|
128
95
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-reviewer.js","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"pr-reviewer.js","sourceRoot":"","sources":["../../../src/agents/kinds/pr-reviewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,8EAA8E;AAC9E,kFAAkF;AAClF,iFAAiF;AACjF,kCAAkC;AAClC,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,mFAAmF;AACnF,oFAAoF;AACpF,qFAAqF;AACrF,oFAAoF;AACpF,sFAAsF;AACtF,8DAA8D;AAC9D,E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AE,aAAa;YACpB,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,wFAAwF;gBACxF,yDAAyD;YAC3D,QAAQ,EAAE,QAAQ;YAClB,mFAAmF;YACnF,iFAAiF;YACjF,UAAU,EAAE,WAAW;SACxB;KACF;CACF,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,QAAQ,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAA;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"description": "Agent catalog, routing, prompts and fragment library for the Agent Architecture Board.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"ai": "^6.0.224",
|
|
32
32
|
"handlebars": "^4.7.9",
|
|
33
33
|
"valibot": "^1.4.2",
|
|
34
|
-
"@cat-factory/contracts": "0.
|
|
35
|
-
"@cat-factory/kernel": "0.
|
|
36
|
-
"@cat-factory/prompt-fragments": "0.13.
|
|
34
|
+
"@cat-factory/contracts": "0.132.0",
|
|
35
|
+
"@cat-factory/kernel": "0.128.0",
|
|
36
|
+
"@cat-factory/prompt-fragments": "0.13.21"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"typescript": "7.0.2",
|
|
40
40
|
"vitest": "^4.1.10",
|
|
41
|
-
"@cat-factory/caching": "0.8.
|
|
41
|
+
"@cat-factory/caching": "0.8.3"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -b tsconfig.build.json",
|