@cat-factory/agents 0.116.2 → 0.116.4
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/agents/catalog.d.ts +19 -4
- package/dist/agents/catalog.d.ts.map +1 -1
- package/dist/agents/catalog.js +34 -7
- package/dist/agents/catalog.js.map +1 -1
- package/dist/agents/kinds/built-in-container.d.ts +32 -0
- package/dist/agents/kinds/built-in-container.d.ts.map +1 -0
- package/dist/agents/kinds/built-in-container.js +197 -0
- package/dist/agents/kinds/built-in-container.js.map +1 -0
- package/dist/agents/kinds/built-in-results.d.ts +30 -0
- package/dist/agents/kinds/built-in-results.d.ts.map +1 -0
- package/dist/agents/kinds/built-in-results.js +190 -0
- package/dist/agents/kinds/built-in-results.js.map +1 -0
- package/dist/agents/kinds/container-surface.d.ts +3 -11
- package/dist/agents/kinds/container-surface.d.ts.map +1 -1
- package/dist/agents/kinds/container-surface.js +9 -62
- package/dist/agents/kinds/container-surface.js.map +1 -1
- package/dist/agents/kinds/initiative.d.ts.map +1 -1
- package/dist/agents/kinds/initiative.js +16 -4
- package/dist/agents/kinds/initiative.js.map +1 -1
- package/dist/agents/kinds/registry.d.ts +71 -11
- package/dist/agents/kinds/registry.d.ts.map +1 -1
- package/dist/agents/kinds/registry.js +23 -2
- package/dist/agents/kinds/registry.js.map +1 -1
- package/dist/agents/kinds/spec-blueprints.d.ts.map +1 -1
- package/dist/agents/kinds/spec-blueprints.js +44 -4
- package/dist/agents/kinds/spec-blueprints.js.map +1 -1
- package/dist/agents/prompts/built-in-container.d.ts +43 -0
- package/dist/agents/prompts/built-in-container.d.ts.map +1 -0
- package/dist/agents/prompts/built-in-container.js +130 -0
- package/dist/agents/prompts/built-in-container.js.map +1 -0
- package/dist/agents/runtime/fragments.d.ts +6 -1
- package/dist/agents/runtime/fragments.d.ts.map +1 -1
- package/dist/agents/runtime/fragments.js +7 -0
- package/dist/agents/runtime/fragments.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// The structured-result mappings for the BUILT-IN container kinds whose reply the engine reads
|
|
3
|
+
// through a typed channel it acts on (`mergeAssessment` gates the real merge; `testReport`
|
|
4
|
+
// greenlights the run or loops the fixer; `onCallAssessment` decides whether a human is woken).
|
|
5
|
+
//
|
|
6
|
+
// These are the conservative coercions the bespoke harness handlers used to apply, moved
|
|
7
|
+
// backend-side when the harness collapsed to one generic `agent` kind, and moved HERE — beside
|
|
8
|
+
// the kind definitions — when the built-ins became real `registerAgentKind` entries. They hang
|
|
9
|
+
// off `AgentKindDefinition.mapStructuredResult`, which is what let the executor's parallel
|
|
10
|
+
// `agentKind === …` coercion chain collapse into one registry lookup.
|
|
11
|
+
//
|
|
12
|
+
// The property every one of them holds: **an unreadable reply lands on the CAUTIOUS side.** A
|
|
13
|
+
// garbage merge score reads as maximally severe (a human decides, never a silent auto-merge); a
|
|
14
|
+
// missing on-call confidence reads as 0 (do not imply a PR is at fault without evidence) with a
|
|
15
|
+
// `hold` recommendation; a tester greenlight is honoured only when no blocking concern is open.
|
|
16
|
+
// A judgement the platform could not read is not a judgement, and must not be spent as one.
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
/** The job summary trimmed, or a kind-specific fallback when the model returned none. */
|
|
19
|
+
export function summaryOr(result, fallback) {
|
|
20
|
+
return result.summary?.trim() || fallback;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Clamp a value to a 0..1 number, defaulting to `fallback` for anything that is not a
|
|
24
|
+
* finite number (or a non-empty numeric string). Crucially, `null`, `''`, `false` and `[]`
|
|
25
|
+
* fall back rather than coercing to `0` — `Number()` turns all of them into a finite `0`,
|
|
26
|
+
* which would silently make a garbage merger score read as "trivial/safe" and defeat the
|
|
27
|
+
* conservative-on-garbage default that replaces the harness's old `diffExaminable` guard.
|
|
28
|
+
*/
|
|
29
|
+
function clamp01(value, fallback) {
|
|
30
|
+
const n = typeof value === 'number'
|
|
31
|
+
? value
|
|
32
|
+
: typeof value === 'string' && value.trim() !== ''
|
|
33
|
+
? Number(value)
|
|
34
|
+
: Number.NaN;
|
|
35
|
+
if (!Number.isFinite(n))
|
|
36
|
+
return fallback;
|
|
37
|
+
return Math.min(1, Math.max(0, n));
|
|
38
|
+
}
|
|
39
|
+
/** First non-empty of the agent's rationale or run summary (capped), else a stable default. */
|
|
40
|
+
function coerceRationale(rationale, summary) {
|
|
41
|
+
if (typeof rationale === 'string' && rationale.trim())
|
|
42
|
+
return rationale;
|
|
43
|
+
if (summary?.trim())
|
|
44
|
+
return summary.slice(0, 2000);
|
|
45
|
+
return 'No rationale provided.';
|
|
46
|
+
}
|
|
47
|
+
/** Narrow an unknown reply to an indexable object, so every read below is a plain lookup. */
|
|
48
|
+
function asObject(raw) {
|
|
49
|
+
return (typeof raw === 'object' && raw !== null ? raw : {});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The `merger`'s structured JSON as the engine's merge assessment. A missing or garbage score
|
|
53
|
+
* defaults to 1 (severe → routes to human review rather than a silent auto-merge) and the
|
|
54
|
+
* rationale falls back to the agent's summary. The harness's old container-side `diffExaminable`
|
|
55
|
+
* guard (force 1/1/1 when the base diff was unreadable) is not reproducible backend-side; the
|
|
56
|
+
* conservative-on-garbage default covers the same risk.
|
|
57
|
+
*/
|
|
58
|
+
export function mergerResult(result) {
|
|
59
|
+
const o = asObject(result.custom);
|
|
60
|
+
return {
|
|
61
|
+
output: summaryOr(result, 'Pull request assessed.'),
|
|
62
|
+
mergeAssessment: {
|
|
63
|
+
complexity: clamp01(o.complexity, 1),
|
|
64
|
+
risk: clamp01(o.risk, 1),
|
|
65
|
+
impact: clamp01(o.impact, 1),
|
|
66
|
+
rationale: coerceRationale(o.rationale, result.summary),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The `on-call` agent's structured JSON as the engine's release-regression assessment: a missing
|
|
72
|
+
* confidence defaults to 0 (don't imply the PR is at fault without evidence) and a missing
|
|
73
|
+
* recommendation to `hold` (a human decides). It never auto-reverts.
|
|
74
|
+
*/
|
|
75
|
+
export function onCallResult(result) {
|
|
76
|
+
const o = asObject(result.custom);
|
|
77
|
+
const evidence = Array.isArray(o.evidence)
|
|
78
|
+
? o.evidence.filter((e) => typeof e === 'string')
|
|
79
|
+
: [];
|
|
80
|
+
return {
|
|
81
|
+
output: summaryOr(result, 'Release regression investigated.'),
|
|
82
|
+
onCallAssessment: {
|
|
83
|
+
culpritConfidence: clamp01(o.culpritConfidence, 0),
|
|
84
|
+
recommendation: o.recommendation === 'revert' || o.recommendation === 'monitor' ? o.recommendation : 'hold',
|
|
85
|
+
rationale: coerceRationale(o.rationale, result.summary),
|
|
86
|
+
evidence,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const TEST_SEVERITIES = new Set(['low', 'medium', 'high', 'critical']);
|
|
91
|
+
const TEST_STATUSES = new Set(['passed', 'failed', 'skipped']);
|
|
92
|
+
/** The per-test outcomes of a tester reply, every field defaulted safely. */
|
|
93
|
+
function coerceOutcomes(raw) {
|
|
94
|
+
if (!Array.isArray(raw))
|
|
95
|
+
return [];
|
|
96
|
+
return raw
|
|
97
|
+
.filter((x) => typeof x === 'object' && x !== null)
|
|
98
|
+
.map((x) => ({
|
|
99
|
+
name: typeof x.name === 'string' ? x.name : '(unnamed)',
|
|
100
|
+
status: TEST_STATUSES.has(x.status) ? x.status : 'skipped',
|
|
101
|
+
...(typeof x.detail === 'string' && x.detail ? { detail: x.detail } : {}),
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
/** The concerns of a tester reply, defaulting an unrecognised severity to `medium`. */
|
|
105
|
+
function coerceConcerns(raw) {
|
|
106
|
+
if (!Array.isArray(raw))
|
|
107
|
+
return [];
|
|
108
|
+
return raw
|
|
109
|
+
.filter((x) => typeof x === 'object' && x !== null)
|
|
110
|
+
.map((x) => ({
|
|
111
|
+
title: typeof x.title === 'string' ? x.title : '(concern)',
|
|
112
|
+
detail: typeof x.detail === 'string' ? x.detail : '',
|
|
113
|
+
severity: TEST_SEVERITIES.has(x.severity) ? x.severity : 'medium',
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The screenshots a UI tester captured + uploaded (artifact ids): only the well-formed entries
|
|
118
|
+
* (a view name AND an artifact id), passing the optionals through. Empty for the API tester.
|
|
119
|
+
*/
|
|
120
|
+
function coerceScreenshots(raw) {
|
|
121
|
+
if (!Array.isArray(raw))
|
|
122
|
+
return [];
|
|
123
|
+
return raw
|
|
124
|
+
.filter((x) => typeof x === 'object' && x !== null)
|
|
125
|
+
.filter((x) => typeof x.view === 'string' && typeof x.artifactId === 'string')
|
|
126
|
+
.map((x) => ({
|
|
127
|
+
view: x.view,
|
|
128
|
+
artifactId: x.artifactId,
|
|
129
|
+
...(typeof x.hash === 'string' && x.hash ? { hash: x.hash } : {}),
|
|
130
|
+
...(typeof x.width === 'number' ? { width: x.width } : {}),
|
|
131
|
+
...(typeof x.height === 'number' ? { height: x.height } : {}),
|
|
132
|
+
...(typeof x.referenceArtifactId === 'string' && x.referenceArtifactId
|
|
133
|
+
? { referenceArtifactId: x.referenceArtifactId }
|
|
134
|
+
: {}),
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The Tester's ABORT reason: it reported it could not run a meaningful test at all (its env never
|
|
139
|
+
* came up, a dependency is missing). The PRESENCE of the `abort` object is the signal, so a
|
|
140
|
+
* blank/oversized `reason` must never downgrade that intent back into a (pointless) fixer loop:
|
|
141
|
+
* fall back to a generic reason and cap it like `summary`, since it is shown to the human and
|
|
142
|
+
* stored on the step verbatim.
|
|
143
|
+
*/
|
|
144
|
+
function coerceAbortReason(raw) {
|
|
145
|
+
const abort = typeof raw === 'object' && raw !== null ? raw : null;
|
|
146
|
+
if (!abort)
|
|
147
|
+
return undefined;
|
|
148
|
+
const reason = typeof abort.reason === 'string' && abort.reason.trim()
|
|
149
|
+
? abort.reason.trim()
|
|
150
|
+
: 'the Tester could not run a meaningful test';
|
|
151
|
+
return reason.slice(0, 2000);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* A tester's structured JSON as the engine's `testReport`, defaulting every field safely so a
|
|
155
|
+
* malformed reply still parses (the engine strict-validates it). Crucially a greenlight is
|
|
156
|
+
* honoured ONLY when no BLOCKING (high/critical) concern is open and the run did not abort, so a
|
|
157
|
+
* model that greenlights with an open blocker cannot auto-pass; low/medium concerns are advisory.
|
|
158
|
+
* The engine's `TesterController` re-applies this rule defensively.
|
|
159
|
+
*
|
|
160
|
+
* The in-container docker-compose stand-up record (`infraSetup`) rides along so the engine can
|
|
161
|
+
* persist its captured logs on the Tester step. Harness-produced, so no coercion; the controller
|
|
162
|
+
* validates it defensively before persisting.
|
|
163
|
+
*/
|
|
164
|
+
export function testerResult(result) {
|
|
165
|
+
const o = asObject(result.custom);
|
|
166
|
+
const concerns = coerceConcerns(o.concerns);
|
|
167
|
+
const blocking = concerns.some((c) => c.severity === 'high' || c.severity === 'critical');
|
|
168
|
+
const environment = o.environment === 'local' || o.environment === 'ephemeral' ? o.environment : undefined;
|
|
169
|
+
const screenshots = coerceScreenshots(o.screenshots);
|
|
170
|
+
const abortReason = coerceAbortReason(o.abort);
|
|
171
|
+
return {
|
|
172
|
+
output: summaryOr(result, 'Testing complete.'),
|
|
173
|
+
testReport: {
|
|
174
|
+
greenlight: o.greenlight === true && !blocking && !abortReason,
|
|
175
|
+
summary: typeof o.summary === 'string' && o.summary
|
|
176
|
+
? o.summary
|
|
177
|
+
: (result.summary?.slice(0, 2000) ?? ''),
|
|
178
|
+
tested: Array.isArray(o.tested)
|
|
179
|
+
? o.tested.filter((t) => typeof t === 'string')
|
|
180
|
+
: [],
|
|
181
|
+
outcomes: coerceOutcomes(o.outcomes),
|
|
182
|
+
concerns,
|
|
183
|
+
...(environment ? { environment } : {}),
|
|
184
|
+
...(screenshots.length ? { screenshots } : {}),
|
|
185
|
+
...(abortReason ? { abort: { reason: abortReason } } : {}),
|
|
186
|
+
},
|
|
187
|
+
...(result.infraSetup ? { infraSetup: result.infraSetup } : {}),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=built-in-results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-in-results.js","sourceRoot":"","sources":["../../../src/agents/kinds/built-in-results.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,+FAA+F;AAC/F,2FAA2F;AAC3F,gGAAgG;AAChG,EAAE;AACF,yFAAyF;AACzF,+FAA+F;AAC/F,+FAA+F;AAC/F,2FAA2F;AAC3F,sEAAsE;AACtE,EAAE;AACF,8FAA8F;AAC9F,gGAAgG;AAChG,gGAAgG;AAChG,gGAAgG;AAChG,4FAA4F;AAC5F,8EAA8E;AAE9E,yFAAyF;AACzF,MAAM,UAAU,SAAS,CAAC,MAAuB,EAAE,QAAgB;IACjE,OAAO,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,QAAQ,CAAA;AAC3C,CAAC;AAED;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,KAAc,EAAE,QAAgB;IAC/C,MAAM,CAAC,GACL,OAAO,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;YAChD,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YACf,CAAC,CAAC,MAAM,CAAC,GAAG,CAAA;IAClB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,QAAQ,CAAA;IACxC,OAAO,IAAI,CAAC,GAAG,CAAC,CA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KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;YAC5C,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC7B,CAAC,CAAE,CAAC,CAAC,MAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;gBAC3E,CAAC,CAAC,EAAE;YACN,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC;YACpC,QAAQ;YACR,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3D;QACD,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChE,CAAA;AACH,CAAC"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
2
|
import type { AgentKindRegistry } from './registry.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* end-to-end test authoring (`playwright`) and business-logic documentation
|
|
8
|
-
* (`business-documenter`, which reads the code and commits the domain-rules docs).
|
|
9
|
-
*/
|
|
10
|
-
export declare const CONTAINER_AGENT_KINDS: ReadonlySet<AgentKind>;
|
|
11
|
-
/**
|
|
12
|
-
* Whether a KIND needs a real checkout: a built-in container kind, a registered custom kind
|
|
13
|
-
* that declared `requiresContainer` (or a `container-*` agent surface), or a container-backed
|
|
14
|
-
* companion (which clones the producer's PR branch to review the real repository).
|
|
4
|
+
* Whether a KIND needs a real checkout: a registered kind that declared `requiresContainer` (or
|
|
5
|
+
* a `container-*` agent surface), or a container-backed companion (which clones the producer's
|
|
6
|
+
* PR branch to review the real repository).
|
|
15
7
|
*
|
|
16
8
|
* This is a property of the kind alone. Whether a given DISPATCH of that kind actually gets a
|
|
17
9
|
* checkout is {@link dispatchDeliversCheckout}, which additionally accounts for consensus
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-surface.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/container-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"container-surface.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/container-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAmBtD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAErF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,OAAO,CAGT"}
|
|
@@ -9,76 +9,23 @@ import { isContainerBackedCompanion } from './companions.js';
|
|
|
9
9
|
// no git). Stated once here, in the agent CATALOG, because "which kinds need a checkout"
|
|
10
10
|
// is catalog knowledge rather than HTTP-layer knowledge — the composite executor imported
|
|
11
11
|
// `isContainerBackedCompanion` from here already.
|
|
12
|
+
//
|
|
13
|
+
// There is no built-in allow-list left. Every container kind the platform ships is a real
|
|
14
|
+
// registration declaring a `container-*` surface (see ./built-in-container), so the answer is
|
|
15
|
+
// DERIVED from the same declaration a deployment's own kind makes: adding a container kind can
|
|
16
|
+
// no longer mean remembering a second hard-coded Set.
|
|
12
17
|
// ---------------------------------------------------------------------------
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* end-to-end test authoring (`playwright`) and business-logic documentation
|
|
18
|
-
* (`business-documenter`, which reads the code and commits the domain-rules docs).
|
|
19
|
-
*/
|
|
20
|
-
export const CONTAINER_AGENT_KINDS = new Set([
|
|
21
|
-
'coder',
|
|
22
|
-
'mocker',
|
|
23
|
-
'playwright',
|
|
24
|
-
'business-documenter',
|
|
25
|
-
// The architect explores the repository (read-only) before proposing a design, so
|
|
26
|
-
// it needs a real checkout. Like `analysis` it makes no edits — the harness produces
|
|
27
|
-
// no commit and opens no PR — and returns its proposal as prose `output`.
|
|
28
|
-
'architect',
|
|
29
|
-
// The CI-fixer clones the PR head branch, runs the failing build/tests, fixes
|
|
30
|
-
// them and pushes back to the same branch — a real-checkout operation. (The `ci`
|
|
31
|
-
// step itself is NOT here: it is a special, non-agent gate handled in the engine
|
|
32
|
-
// that *dispatches* a `ci-fixer` job; only the fixer reaches this executor.)
|
|
33
|
-
'ci-fixer',
|
|
34
|
-
// The conflict-resolver clones the PR head branch, merges the base in and resolves
|
|
35
|
-
// the conflicts on the same branch — a real-checkout operation. (The `conflicts`
|
|
36
|
-
// gate itself is NOT here: like `ci` it is a non-agent engine gate that *dispatches*
|
|
37
|
-
// a `conflict-resolver` job; only the resolver reaches this executor.)
|
|
38
|
-
'conflict-resolver',
|
|
39
|
-
// The merger clones the PR head branch to assess the diff (complexity/risk/impact)
|
|
40
|
-
// before the engine decides whether to auto-merge — a real-checkout operation.
|
|
41
|
-
'merger',
|
|
42
|
-
// The tech-debt `analysis` agent clones the repo to inspect it and emit a report.
|
|
43
|
-
// It is read-only (makes no edits) so the coding-agent harness produces no commit
|
|
44
|
-
// and opens no PR — but it still needs a real checkout, so it runs in a container.
|
|
45
|
-
'analysis',
|
|
46
|
-
// The tester clones the PR branch, stands up infra (local docker-compose or an
|
|
47
|
-
// ephemeral env), runs the suite and returns a structured report — a real-checkout
|
|
48
|
-
// operation. (The tester step is also a special engine gate that loops a `fixer`
|
|
49
|
-
// on a withheld greenlight, mirroring `ci`/`ci-fixer`; the engine dispatches both
|
|
50
|
-
// jobs, which reach this executor.) `tester-api` is the general/API tester;
|
|
51
|
-
// `tester-ui` is its browser-driven, screenshot-capturing sibling (UI-tester image).
|
|
52
|
-
'tester-api',
|
|
53
|
-
'tester-ui',
|
|
54
|
-
// The fixer clones the PR head branch, applies fixes from the Tester's report and
|
|
55
|
-
// pushes back to the same branch — a real-checkout operation, like `ci-fixer`.
|
|
56
|
-
'fixer',
|
|
57
|
-
// The on-call agent clones the released PR head to correlate its diff with the
|
|
58
|
-
// Datadog regression evidence and returns a JSON assessment — a real-checkout
|
|
59
|
-
// operation (makes no commits). (The `post-release-health` gate itself is NOT here:
|
|
60
|
-
// like `ci` it is a non-agent engine gate that *dispatches* an `on-call` job; only
|
|
61
|
-
// the on-call agent reaches this executor.)
|
|
62
|
-
'on-call',
|
|
63
|
-
// NOTE: `blueprints`, `spec-writer`, `initiative-analyst` and `initiative-planner` are NOT
|
|
64
|
-
// listed here — they are registered agent kinds whose `container-explore` surface makes
|
|
65
|
-
// `registry.requiresContainer()` return true, so `runsInContainer` covers them without a
|
|
66
|
-
// hard-coded entry. (The `initiative-interviewer` / `initiative-committer` steps are
|
|
67
|
-
// neither: they are non-container engine gates handled entirely in the engine.)
|
|
68
|
-
]);
|
|
69
|
-
/**
|
|
70
|
-
* Whether a KIND needs a real checkout: a built-in container kind, a registered custom kind
|
|
71
|
-
* that declared `requiresContainer` (or a `container-*` agent surface), or a container-backed
|
|
72
|
-
* companion (which clones the producer's PR branch to review the real repository).
|
|
19
|
+
* Whether a KIND needs a real checkout: a registered kind that declared `requiresContainer` (or
|
|
20
|
+
* a `container-*` agent surface), or a container-backed companion (which clones the producer's
|
|
21
|
+
* PR branch to review the real repository).
|
|
73
22
|
*
|
|
74
23
|
* This is a property of the kind alone. Whether a given DISPATCH of that kind actually gets a
|
|
75
24
|
* checkout is {@link dispatchDeliversCheckout}, which additionally accounts for consensus
|
|
76
25
|
* diverting the step to an inline panel.
|
|
77
26
|
*/
|
|
78
27
|
export function runsInContainer(kind, registry) {
|
|
79
|
-
return
|
|
80
|
-
registry.requiresContainer(kind) ||
|
|
81
|
-
isContainerBackedCompanion(kind, registry));
|
|
28
|
+
return registry.requiresContainer(kind) || isContainerBackedCompanion(kind, registry);
|
|
82
29
|
}
|
|
83
30
|
/**
|
|
84
31
|
* Whether THIS dispatch hands the agent a real checkout — i.e. whether it may be told to read
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-surface.js","sourceRoot":"","sources":["../../../src/agents/kinds/container-surface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAG5D,8EAA8E;AAC9E,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,mFAAmF;AACnF,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,0FAA0F;AAC1F,kDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"container-surface.js","sourceRoot":"","sources":["../../../src/agents/kinds/container-surface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAG5D,8EAA8E;AAC9E,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,mFAAmF;AACnF,yFAAyF;AACzF,yFAAyF;AACzF,yFAAyF;AACzF,0FAA0F;AAC1F,kDAAkD;AAClD,EAAE;AACF,0FAA0F;AAC1F,8FAA8F;AAC9F,+FAA+F;AAC/F,sDAAsD;AACtD,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAe,EAAE,QAA2B;IAC1E,OAAO,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,0BAA0B,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AACvF,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAe,EACf,QAA2B,EAC3B,IAAI,GAAmC,EAAE;IAEzC,IAAI,IAAI,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAA;IACvC,OAAO,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiative.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/initiative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"initiative.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/initiative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAA;AAG3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAkB3E,eAAO,MAAM,yBAAyB,yBAAyB,CAAA;AAmL/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAG3E;AA8CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAsB5E;AAuBD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAmB5E;AAED,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,EAgEvD,CAAA;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAE1E"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { INITIATIVE_ANALYST_AGENT_KIND, INITIATIVE_PLANNER_AGENT_KIND } from '@cat-factory/kernel';
|
|
2
2
|
import { CODE_AWARE_TRAIT } from './traits.js';
|
|
3
3
|
import { linkedContextSection } from '../prompts/standard.js';
|
|
4
|
+
import { coerceInitiativePlan } from '../../repo-ops/initiative.js';
|
|
5
|
+
import { summaryOr } from './built-in-results.js';
|
|
4
6
|
// ---------------------------------------------------------------------------
|
|
5
7
|
// The `initiative-breakdown` agent kind — the first agent reachable from the PUBLIC API.
|
|
6
8
|
//
|
|
@@ -55,10 +57,10 @@ function initiativeBreakdownUserPrompt(context) {
|
|
|
55
57
|
// The container initiative-planning kinds — `initiative-analyst` + `initiative-planner`.
|
|
56
58
|
//
|
|
57
59
|
// Both explore a real (read-only) checkout of the initiative's repo, so they run in a
|
|
58
|
-
// container. They were the
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
60
|
+
// container. They were the FIRST built-in container kinds moved off the bespoke per-kind
|
|
61
|
+
// job-body switch in `@cat-factory/server` onto the public `registerAgentKind` seam (the
|
|
62
|
+
// refactoring-candidates.md #5 strangler, since finished: that switch is deleted and every
|
|
63
|
+
// built-in container kind is a registration). Their kind ids live in `@cat-factory/kernel`, so the
|
|
62
64
|
// definitions (prompts + user-prompt builders) live here in the agents package alongside
|
|
63
65
|
// every other registered kind — the generic `agentStep`-driven dispatch path in the server
|
|
64
66
|
// builds their job body from the declared `agent` spec, and `systemPromptFor` supplies the
|
|
@@ -365,6 +367,16 @@ export const INITIATIVE_AGENT_KINDS = [
|
|
|
365
367
|
failOnUnusableFinal: true,
|
|
366
368
|
},
|
|
367
369
|
},
|
|
370
|
+
// The plan as the engine's `initiativePlan` channel (its strict parse + ingest into the
|
|
371
|
+
// `initiatives` entity). A structureless/garbage plan coerces to null and the channel is left
|
|
372
|
+
// unset, so nothing is ingested and the step still records its prose output.
|
|
373
|
+
mapStructuredResult: (result) => {
|
|
374
|
+
const plan = coerceInitiativePlan(result.custom);
|
|
375
|
+
return {
|
|
376
|
+
output: summaryOr(result, 'Initiative plan drafted.'),
|
|
377
|
+
...(plan ? { initiativePlan: plan } : {}),
|
|
378
|
+
};
|
|
379
|
+
},
|
|
368
380
|
},
|
|
369
381
|
];
|
|
370
382
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiative.js","sourceRoot":"","sources":["../../../src/agents/kinds/initiative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAGlG,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"initiative.js","sourceRoot":"","sources":["../../../src/agents/kinds/initiative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAGlG,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,8EAA8E;AAC9E,yFAAyF;AACzF,EAAE;AACF,uFAAuF;AACvF,gGAAgG;AAChG,iGAAiG;AACjG,8FAA8F;AAC9F,kGAAkG;AAClG,6FAA6F;AAC7F,mFAAmF;AACnF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAA;AAE/D;;;;;;;;;GASG;AACH,SAAS,kBAAkB,CACzB,OAAwB,EACxB,IAAI,GAA+B,EAAE;IAErC,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC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GAAkG;IAClG,6FAA6F;IAC7F,6FAA6F;IAC7F;QACE,IAAI,EAAE,6BAA6B;QACnC,YAAY,EAAE,gCAAgC;QAC9C,UAAU,EAAE,2BAA2B;QACvC,0FAA0F;QAC1F,qDAAqD;QACrD,MAAM,EAAE,CAAC,gBAAgB,CAAC;QAC1B,KAAK,EAAE;YACL,OAAO,EAAE,mBAAmB;YAC5B,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YACzB,MAAM,EAAE;gBACN,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,0BAA0B;gBACrC,mBAAmB,EAAE,IAAI;aAC1B;SACF;QACD,wFAAwF;QACxF,8FAA8F;QAC9F,6EAA6E;QAC7E,mBAAmB,EAAE,CAAC,MAAuB,EAAE,EAAE;YAC/C,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAChD,OAAO;gBACL,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,0BAA0B,CAAC;gBACrD,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C,CAAA;QACH,CAAC;KACF;CACF,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA2B;IAClE,QAAQ,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentConfigDescriptor, AgentKind, AgentRunContext, AgentStepSpec, McpServerDefinition, RepoOp } from '@cat-factory/kernel';
|
|
1
|
+
import type { AgentConfigDescriptor, AgentDispatchContext, AgentKind, AgentRunContext, AgentRunResult, AgentStepSpec, AgentUserPromptBuilder, McpServerDefinition, RepoOp, RunnerJobResult } from '@cat-factory/kernel';
|
|
2
2
|
import type { AgentKindSkillRef, AgentKindToolRef, BundledSkillDefinition } from './capabilities.js';
|
|
3
3
|
import { normalizeSkillRefs, normalizeToolRefs } from './capabilities.js';
|
|
4
4
|
import type { AgentPresentation } from '@cat-factory/contracts';
|
|
@@ -13,14 +13,41 @@ export interface AgentKindDefinition {
|
|
|
13
13
|
/**
|
|
14
14
|
* The system prompt (role) for this kind. A function form receives the kind id so a
|
|
15
15
|
* single definition object can serve a family of related kinds.
|
|
16
|
+
*
|
|
17
|
+
* OPTIONAL, and omitting it means one specific thing: the kind's role text already has an
|
|
18
|
+
* owner further up `baseSystemPromptFor` (a standard-phase track, the tester/fixer track, a
|
|
19
|
+
* companion, one of the bespoke `{ role, directives }` prompts). That is the case for the
|
|
20
|
+
* BUILT-IN kinds registered here purely to declare their dispatch shape: a copy on the
|
|
21
|
+
* definition would be a second source of truth for text the track already resolves, and the
|
|
22
|
+
* track wins in `baseSystemPromptFor` regardless, so the copy would be dead the day it drifted.
|
|
23
|
+
* A kind a DEPLOYMENT registers always sets it: nothing else knows its role.
|
|
24
|
+
*/
|
|
25
|
+
systemPrompt?: string | ((kind: AgentKind) => string);
|
|
26
|
+
/**
|
|
27
|
+
* Optional custom user-prompt builder, REPLACING the generic block-context prompt. When
|
|
28
|
+
* omitted the kind uses the generic user prompt (block context + prior pipeline outputs),
|
|
29
|
+
* exactly like any other non-standard-phase kind. Human revision feedback is appended
|
|
30
|
+
* automatically. See {@link userPromptSuffix} for the additive form.
|
|
31
|
+
*/
|
|
32
|
+
userPrompt?: AgentUserPromptBuilder;
|
|
33
|
+
/**
|
|
34
|
+
* Optional task instructions APPENDED to the generic block-context prompt, for a kind that
|
|
35
|
+
* needs everything the generic prompt carries (the run's evidence, the prior agents' output)
|
|
36
|
+
* plus its own closing instruction — the `on-call` agent's "you are on the base branch, here
|
|
37
|
+
* is how to find the merged commit, answer as JSON" is the shape.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately a separate field rather than a `userPrompt` that calls the generic builder:
|
|
40
|
+
* the generic builder is reached THROUGH this registry, so a kind calling it would recurse,
|
|
41
|
+
* and the wrapper sections (an initiative preset's steering, a reusable operation's
|
|
42
|
+
* parameters) would be folded in twice. Ignored when {@link userPrompt} is set, which
|
|
43
|
+
* replaces the generic prompt outright.
|
|
44
|
+
*
|
|
45
|
+
* It ends the prompt UNCONDITIONALLY: `userPromptFor` appends it after the revision feedback
|
|
46
|
+
* and the injected context files, both of which append too. That ordering is the field's whole
|
|
47
|
+
* value for a reply-shape instruction ("respond with ONLY a JSON object"), which a revision
|
|
48
|
+
* re-run would otherwise bury behind the reviewer's comments.
|
|
16
49
|
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Optional custom user-prompt builder. When omitted the kind uses the generic user
|
|
20
|
-
* prompt (block context + prior pipeline outputs), exactly like any other
|
|
21
|
-
* non-standard-phase kind. Human revision feedback is appended automatically.
|
|
22
|
-
*/
|
|
23
|
-
userPrompt?: (context: AgentRunContext) => string;
|
|
50
|
+
userPromptSuffix?: AgentUserPromptBuilder;
|
|
24
51
|
/**
|
|
25
52
|
* When true this kind needs a real checkout (clone/edit/commit/PR) and must run in a
|
|
26
53
|
* container rather than as a one-shot inline LLM call — see the Worker's
|
|
@@ -75,9 +102,14 @@ export interface AgentKindDefinition {
|
|
|
75
102
|
* actually apply them never receive them. A kind choosing this MUST write the files itself
|
|
76
103
|
* (see `prReviewerStandardsPreOp`) and say where they are — the engine only stops folding.
|
|
77
104
|
*
|
|
105
|
+
* - `none` — this kind receives no standards at all. Right for a kind that JUDGES rather than
|
|
106
|
+
* produces (`merger` scores a diff's complexity/risk/impact): a house coding standard has no
|
|
107
|
+
* bearing on that score, and folding it in charges every assessment for text the assessment
|
|
108
|
+
* never applies.
|
|
109
|
+
*
|
|
78
110
|
* Omitted ⇒ `prompt`.
|
|
79
111
|
*/
|
|
80
|
-
standardsDelivery?: 'prompt' | 'context-files';
|
|
112
|
+
standardsDelivery?: 'prompt' | 'context-files' | 'none';
|
|
81
113
|
/**
|
|
82
114
|
* Per-kind execution tuning folded into a container dispatch's job body (today the
|
|
83
115
|
* progress-guard knobs). Lets a custom kind whose normal pattern differs from the
|
|
@@ -116,6 +148,22 @@ export interface AgentKindDefinition {
|
|
|
116
148
|
* (a prose kind, or one that sets `agent.output.shapeHint` by hand).
|
|
117
149
|
*/
|
|
118
150
|
structuredOutput?: StructuredOutput<unknown>;
|
|
151
|
+
/**
|
|
152
|
+
* Map a finished container job onto the engine's {@link AgentRunResult} — the kind's own
|
|
153
|
+
* answer to "what domain channel does my structured reply belong in".
|
|
154
|
+
*
|
|
155
|
+
* A registered kind normally needs none: its parsed JSON surfaces on `result.custom` for its
|
|
156
|
+
* post-op to render from. The BUILT-IN kinds do, because the engine reads their output through
|
|
157
|
+
* a typed channel it acts on (`mergeAssessment` gates the real merge, `testReport` greenlights
|
|
158
|
+
* or loops the fixer, `spec` is sharded into the repo), and those coercions are deliberately
|
|
159
|
+
* CONSERVATIVE: a garbage merge score reads as "severe" so it routes to a human rather than
|
|
160
|
+
* auto-merging. Declaring the mapping here is what let the executor's parallel
|
|
161
|
+
* `agentKind === …` coercion chain collapse into one registry lookup.
|
|
162
|
+
*
|
|
163
|
+
* Called only when the job returned a parsed `custom` payload. Omitted ⇒ the raw JSON is
|
|
164
|
+
* surfaced on `custom`.
|
|
165
|
+
*/
|
|
166
|
+
mapStructuredResult?: (result: RunnerJobResult) => AgentRunResult;
|
|
119
167
|
/**
|
|
120
168
|
* Deterministic backend operations run BEFORE the agent step (over a checkout-free
|
|
121
169
|
* {@link RepoOp} context): read a baseline artifact into the prompt, etc. Plain TS,
|
|
@@ -206,7 +254,19 @@ export declare class AgentKindRegistry {
|
|
|
206
254
|
/** A registered kind's system prompt, or undefined when the kind is not registered. */
|
|
207
255
|
systemPrompt(kind: AgentKind): string | undefined;
|
|
208
256
|
/** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
|
|
209
|
-
userPrompt(context: AgentRunContext): string | undefined;
|
|
257
|
+
userPrompt(context: AgentRunContext, dispatch?: AgentDispatchContext): string | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* A registered kind's ADDITIVE task instructions, appended to the generic block-context
|
|
260
|
+
* prompt, or undefined when the kind is not registered / declared none. See
|
|
261
|
+
* {@link AgentKindDefinition.userPromptSuffix}.
|
|
262
|
+
*/
|
|
263
|
+
userPromptSuffix(context: AgentRunContext, dispatch?: AgentDispatchContext): string | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* A registered kind's structured-result mapping, or undefined when it declared none (the
|
|
266
|
+
* caller then surfaces the raw JSON on `custom`). See
|
|
267
|
+
* {@link AgentKindDefinition.mapStructuredResult}.
|
|
268
|
+
*/
|
|
269
|
+
mapStructuredResult(kind: AgentKind): AgentKindDefinition['mapStructuredResult'];
|
|
210
270
|
/** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
|
|
211
271
|
webResearchHint(kind: AgentKind): string | undefined;
|
|
212
272
|
/** A registered kind's execution tuning, or undefined when unregistered / not supplied. */
|
|
@@ -223,7 +283,7 @@ export declare class AgentKindRegistry {
|
|
|
223
283
|
* (the default) or delivered as `.cat-context/` files by its own preOp. See
|
|
224
284
|
* {@link AgentKindDefinition.standardsDelivery}.
|
|
225
285
|
*/
|
|
226
|
-
standardsDelivery(kind: AgentKind): 'prompt' | 'context-files';
|
|
286
|
+
standardsDelivery(kind: AgentKind): 'prompt' | 'context-files' | 'none';
|
|
227
287
|
/** A registered kind's contributed config descriptors, or an empty array when none. */
|
|
228
288
|
configContributions(kind: AgentKind): AgentConfigDescriptor[];
|
|
229
289
|
/** A registered kind's agent-step spec (surface/output/clone), or undefined when none. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"names":[],"mappings":"AAA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;;;;;;;;;;;OAsBG;IACH,qBAAqB,IAAI,SAAS,EAAE,CAQnC;IAED;;;;;;;;;;OAUG;IACH,eAAe,CAAC,UAAU,EAAE,0BAA0B,GAAG,IAAI,CAE5D;IAED,yCAAyC;IACzC,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,0BAA0B,CAAC,GAAG,IAAI,CAExE;IAED,iEAAiE;IACjE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,CAE1D;IAED,oDAAoD;IACpD,QAAQ,IAAI,0BAA0B,EAAE,CAEvC;IAED;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,0BAA0B,EAAE,CAE7D;CACF;AAiBD;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,iBAAiB,CAoB5D"}
|
|
@@ -14,6 +14,7 @@ import { registerSpecBlueprintAgents } from './spec-blueprints.js';
|
|
|
14
14
|
import { registerEnvironmentAnalystAgent } from './environment-analyst.js';
|
|
15
15
|
import { registerSpikeAgent } from './spike.js';
|
|
16
16
|
import { registerSkillAgent } from './skill.js';
|
|
17
|
+
import { registerBuiltInContainerAgents } from './built-in-container.js';
|
|
17
18
|
/**
|
|
18
19
|
* Derive `agent.output` from a `structuredOutput` schema when the author didn't set it by
|
|
19
20
|
* hand — so a structured kind declares ONE valibot schema and the engine spec falls out of
|
|
@@ -131,8 +132,24 @@ export class AgentKindRegistry {
|
|
|
131
132
|
: definition.systemPrompt;
|
|
132
133
|
}
|
|
133
134
|
/** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
|
|
134
|
-
userPrompt(context) {
|
|
135
|
-
return this.registry.get(context.agentKind)?.userPrompt?.(context);
|
|
135
|
+
userPrompt(context, dispatch) {
|
|
136
|
+
return this.registry.get(context.agentKind)?.userPrompt?.(context, dispatch);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* A registered kind's ADDITIVE task instructions, appended to the generic block-context
|
|
140
|
+
* prompt, or undefined when the kind is not registered / declared none. See
|
|
141
|
+
* {@link AgentKindDefinition.userPromptSuffix}.
|
|
142
|
+
*/
|
|
143
|
+
userPromptSuffix(context, dispatch) {
|
|
144
|
+
return this.registry.get(context.agentKind)?.userPromptSuffix?.(context, dispatch);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A registered kind's structured-result mapping, or undefined when it declared none (the
|
|
148
|
+
* caller then surfaces the raw JSON on `custom`). See
|
|
149
|
+
* {@link AgentKindDefinition.mapStructuredResult}.
|
|
150
|
+
*/
|
|
151
|
+
mapStructuredResult(kind) {
|
|
152
|
+
return this.registry.get(kind)?.mapStructuredResult;
|
|
136
153
|
}
|
|
137
154
|
/** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
|
|
138
155
|
webResearchHint(kind) {
|
|
@@ -458,6 +475,10 @@ export function defaultAgentKindRegistry() {
|
|
|
458
475
|
registerEnvironmentAnalystAgent(registry);
|
|
459
476
|
registerSpikeAgent(registry);
|
|
460
477
|
registerSkillAgent(registry);
|
|
478
|
+
// The built-in CONTAINER kinds (implementer, testers, fixers, assessors, read-only explorers).
|
|
479
|
+
// Disjoint from every id above — registration replaces by kind, so an overlap would silently
|
|
480
|
+
// drop whichever definition ran first.
|
|
481
|
+
registerBuiltInContainerAgents(registry);
|
|
461
482
|
return registry;
|
|
462
483
|
}
|
|
463
484
|
//# sourceMappingURL=registry.js.map
|