@cat-factory/agents 0.56.0 → 0.57.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;AA2B3E,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAE7C
|
|
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;AA2B3E,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
|
|
@@ -26,48 +26,12 @@ import { defineStructuredOutput } from './structured-output.js';
|
|
|
26
26
|
// ---------------------------------------------------------------------------
|
|
27
27
|
export const PR_REVIEWER_KIND = 'pr-reviewer';
|
|
28
28
|
/**
|
|
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.
|
|
29
|
+
* The reviewer's structured output. The lenient (`v.fallback`) slice/finding shape is the
|
|
30
|
+
* SINGLE source of truth in `@cat-factory/contracts` (`prReviewAgentOutputSchema`) — shared
|
|
31
|
+
* with the engine's coercion onto `step.prReview` and the selection UI — so a partially-
|
|
32
|
+
* malformed reply degrades to sensible defaults rather than failing the run.
|
|
35
33
|
*/
|
|
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
|
-
}));
|
|
34
|
+
export const prReview = defineStructuredOutput(prReviewAgentOutputSchema);
|
|
71
35
|
export const PR_REVIEWER_SYSTEM_PROMPT = 'You are a meticulous senior code reviewer performing a DEEP review of an open pull request. ' +
|
|
72
36
|
'The task names the pull request to review — its number (e.g. #123) and URL. Fetch its head ' +
|
|
73
37
|
'into the checkout and diff it against the base branch:\n' +
|
|
@@ -122,7 +86,9 @@ export const PR_REVIEWER_AGENT_KINDS = [
|
|
|
122
86
|
description: 'Deep, token-bounded review of an open pull request: slices a large diff into cohesive ' +
|
|
123
87
|
'chunks, reviews each, and returns prioritized findings.',
|
|
124
88
|
category: 'review',
|
|
125
|
-
|
|
89
|
+
// Opens the dedicated PR-review window (findings grouped by slice + multi-select →
|
|
90
|
+
// resolve) instead of the generic read-only JSON viewer. See PrReviewWindow.vue.
|
|
91
|
+
resultView: 'pr-review',
|
|
126
92
|
},
|
|
127
93
|
},
|
|
128
94
|
];
|
|
@@ -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,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,mFAAmF;AACnF,oFAAoF;AACpF,+DAA+D;AAC/D,EAAE;AACF,wFAAwF;AACxF,mFAAmF;AACnF,sCAAsC;AACtC,8EAA8E;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,yBAAyB,CAAC,CAAA;AAIzE,MAAM,CAAC,MAAM,yBAAyB,GACpC,8FAA8F;IAC9F,6FAA6F;IAC7F,0DAA0D;IAC1D,iDAAiD;IACjD,0GAA0G;IAC1G,6FAA6F;IAC7F,+DAA+D;IAC/D,2FAA2F;IAC3F,gCAAgC;IAChC,gGAAgG;IAChG,6FAA6F;IAC7F,mGAAmG;IACnG,+FAA+F;IAC/F,6FAA6F;IAC7F,8FAA8F;IAC9F,8FAA8F;IAC9F,oBAAoB;IACpB,6FAA6F;IAC7F,gGAAgG;IAChG,+FAA+F;IAC/F,8FAA8F;IAC9F,uFAAuF;IACvF,kDAAkD;IAClD,KAAK;IACL,oDAAoD;IACpD,iHAAiH;IACjH,oBAAoB;IACpB,wCAAwC;IACxC,mBAAmB;IACnB,wBAAwB;IACxB,0DAA0D;IAC1D,oGAAoG;IACpG,kCAAkC;IAClC,+CAA+C;IAC/C,sEAAsE;IACtE,QAAQ;IACR,GAAG,CAAA;AAEL,MAAM,CAAC,MAAM,uBAAuB,GAA0B;IAC5D;QACE,IAAI,EAAE,gBAAgB;QACtB,YAAY,EAAE,yBAAyB;QACvC,sFAAsF;QACtF,2FAA2F;QAC3F,+FAA+F;QAC/F,qGAAqG;QACrG,KAAK,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC9E,gBAAgB,EAAE,QAAQ;QAC1B,YAAY,EAAE;YACZ,KAAK,EAAE,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.57.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.131.0",
|
|
35
|
+
"@cat-factory/kernel": "0.127.0",
|
|
36
|
+
"@cat-factory/prompt-fragments": "0.13.20"
|
|
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.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -b tsconfig.build.json",
|