@cat-factory/agents 0.33.1 → 0.35.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.
- package/dist/agents/catalog.d.ts +3 -2
- package/dist/agents/catalog.d.ts.map +1 -1
- package/dist/agents/catalog.js +13 -14
- package/dist/agents/catalog.js.map +1 -1
- package/dist/agents/kinds/bug-investigator.d.ts +29 -0
- package/dist/agents/kinds/bug-investigator.d.ts.map +1 -0
- package/dist/agents/kinds/bug-investigator.js +102 -0
- package/dist/agents/kinds/bug-investigator.js.map +1 -0
- package/dist/agents/kinds/configs.d.ts +3 -2
- package/dist/agents/kinds/configs.d.ts.map +1 -1
- package/dist/agents/kinds/configs.js +4 -5
- package/dist/agents/kinds/configs.js.map +1 -1
- package/dist/agents/kinds/document.d.ts +4 -4
- package/dist/agents/kinds/document.d.ts.map +1 -1
- package/dist/agents/kinds/document.js +49 -7
- package/dist/agents/kinds/document.js.map +1 -1
- package/dist/agents/kinds/initiative.d.ts +4 -4
- package/dist/agents/kinds/initiative.d.ts.map +1 -1
- package/dist/agents/kinds/initiative.js +4 -7
- package/dist/agents/kinds/initiative.js.map +1 -1
- package/dist/agents/kinds/registry.d.ts +69 -36
- package/dist/agents/kinds/registry.d.ts.map +1 -1
- package/dist/agents/kinds/registry.js +111 -82
- package/dist/agents/kinds/registry.js.map +1 -1
- package/dist/agents/kinds/step-surface.d.ts +2 -1
- package/dist/agents/kinds/step-surface.d.ts.map +1 -1
- package/dist/agents/kinds/step-surface.js +2 -3
- package/dist/agents/kinds/step-surface.js.map +1 -1
- package/dist/agents/kinds/traits.d.ts +10 -4
- package/dist/agents/kinds/traits.d.ts.map +1 -1
- package/dist/agents/kinds/traits.js +12 -8
- package/dist/agents/kinds/traits.js.map +1 -1
- package/dist/agents/kinds/tuning.d.ts +2 -1
- package/dist/agents/kinds/tuning.d.ts.map +1 -1
- package/dist/agents/kinds/tuning.js +2 -3
- package/dist/agents/kinds/tuning.js.map +1 -1
- package/dist/agents/prompts/roles.d.ts.map +1 -1
- package/dist/agents/prompts/roles.js +4 -6
- package/dist/agents/prompts/roles.js.map +1 -1
- package/dist/agents/runtime/executor.d.ts +9 -1
- package/dist/agents/runtime/executor.d.ts.map +1 -1
- package/dist/agents/runtime/executor.js +7 -4
- package/dist/agents/runtime/executor.js.map +1 -1
- package/dist/agents/runtime/web-search.d.ts +2 -1
- package/dist/agents/runtime/web-search.d.ts.map +1 -1
- package/dist/agents/runtime/web-search.js +2 -3
- package/dist/agents/runtime/web-search.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -25,6 +25,15 @@ export interface AgentKindDefinition {
|
|
|
25
25
|
* end-to-end with no harness changes.
|
|
26
26
|
*/
|
|
27
27
|
requiresContainer?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* When true this container kind fans out across the block's connected involved-service
|
|
30
|
+
* repos: the executor resolves the peer checkouts and threads them (+ the multi-repo
|
|
31
|
+
* prompt section) into the dispatch, so the harness clones the primary repo PLUS every
|
|
32
|
+
* peer as sibling checkouts. Used by cross-service kinds (e.g. the read-only
|
|
33
|
+
* `bug-investigator`). Defaults to false (single-repo). Only meaningful for a container
|
|
34
|
+
* kind — see {@link AgentKindRegistry.fansOutMultiRepo}.
|
|
35
|
+
*/
|
|
36
|
+
fanOutMultiRepo?: boolean;
|
|
28
37
|
/**
|
|
29
38
|
* Optional one-clause reason this kind should reach for web search, phrased to
|
|
30
39
|
* complete "Use it mainly to …" (e.g. "verify the vendor's current API contract
|
|
@@ -96,44 +105,68 @@ export interface AgentKindDefinition {
|
|
|
96
105
|
*/
|
|
97
106
|
presentation?: AgentPresentation;
|
|
98
107
|
}
|
|
99
|
-
/** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
|
|
100
|
-
export declare function registerAgentKind(definition: AgentKindDefinition): void;
|
|
101
|
-
/** Register several custom agent kinds at once. */
|
|
102
|
-
export declare function registerAgentKinds(definitions: Iterable<AgentKindDefinition>): void;
|
|
103
|
-
/** The registered definition for a kind, or undefined for built-in / unregistered kinds. */
|
|
104
|
-
export declare function registeredAgentKind(kind: AgentKind): AgentKindDefinition | undefined;
|
|
105
|
-
/** All registered custom agent kinds (registration order). */
|
|
106
|
-
export declare function registeredAgentKinds(): AgentKindDefinition[];
|
|
107
108
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
109
|
+
* App-owned registry of agent kinds, mirroring the backend-registries pilot
|
|
110
|
+
* (`RunnerBackendRegistry` / `EnvironmentBackendRegistry`). The composition root news ONE
|
|
111
|
+
* instance per app (`defaultAgentKindRegistry()`), threads it through `CoreDependencies`, and
|
|
112
|
+
* every prompt build / routing decision reads it from there — so there is no module-global
|
|
113
|
+
* `Map`, no `clear*()` test cruft, and no external-adapter module-identity gotcha: a
|
|
114
|
+
* deployment registers extra kinds by reference (`registry.register(def)`) on the instance the
|
|
115
|
+
* facade injects. The built-in kinds (`bug-investigator` / the document + initiative kinds) are
|
|
116
|
+
* pre-loaded by the factory, not by an import side effect.
|
|
111
117
|
*/
|
|
112
|
-
export declare
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
118
|
+
export declare class AgentKindRegistry {
|
|
119
|
+
private readonly registry;
|
|
120
|
+
/** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
|
|
121
|
+
register(definition: AgentKindDefinition): void;
|
|
122
|
+
/** Register several custom agent kinds at once. */
|
|
123
|
+
registerAll(definitions: Iterable<AgentKindDefinition>): void;
|
|
124
|
+
/** The registered definition for a kind, or undefined for built-in / unregistered kinds. */
|
|
125
|
+
get(kind: AgentKind): AgentKindDefinition | undefined;
|
|
126
|
+
/** All registered agent kinds (registration order). */
|
|
127
|
+
all(): AgentKindDefinition[];
|
|
128
|
+
/**
|
|
129
|
+
* Whether a registered kind runs in a container — either it set `requiresContainer`
|
|
130
|
+
* explicitly, or its `agent` step declares a container surface. False for built-in /
|
|
131
|
+
* unregistered kinds.
|
|
132
|
+
*/
|
|
133
|
+
requiresContainer(kind: AgentKind): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Whether a registered kind fans out across the block's connected involved-service repos
|
|
136
|
+
* (see {@link AgentKindDefinition.fanOutMultiRepo}). False for built-in / unregistered kinds —
|
|
137
|
+
* the executor keeps a small allow-list for the pre-registry built-ins (`coder` / `ci-fixer`).
|
|
138
|
+
*/
|
|
139
|
+
fansOutMultiRepo(kind: AgentKind): boolean;
|
|
140
|
+
/** A registered kind's system prompt, or undefined when the kind is not registered. */
|
|
141
|
+
systemPrompt(kind: AgentKind): string | undefined;
|
|
142
|
+
/** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
|
|
143
|
+
userPrompt(context: AgentRunContext): string | undefined;
|
|
144
|
+
/** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
|
|
145
|
+
webResearchHint(kind: AgentKind): string | undefined;
|
|
146
|
+
/** A registered kind's execution tuning, or undefined when unregistered / not supplied. */
|
|
147
|
+
tuning(kind: AgentKind): AgentTuning | undefined;
|
|
148
|
+
/** A registered kind's contributed config descriptors, or an empty array when none. */
|
|
149
|
+
configContributions(kind: AgentKind): AgentConfigDescriptor[];
|
|
150
|
+
/** A registered kind's agent-step spec (surface/output/clone), or undefined when none. */
|
|
151
|
+
agentStep(kind: AgentKind): AgentStepSpec | undefined;
|
|
152
|
+
/** A registered kind's pre-op hooks (run before the agent step), or an empty array. */
|
|
153
|
+
preOps(kind: AgentKind): RepoOp[];
|
|
154
|
+
/** A registered kind's post-op hooks (run after the agent step), or an empty array. */
|
|
155
|
+
postOps(kind: AgentKind): RepoOp[];
|
|
156
|
+
/** A registered kind's frontend presentation metadata, or undefined when not supplied. */
|
|
157
|
+
presentation(kind: AgentKind): AgentPresentation | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* A registered kind's schema-driven structured output (its typed `parse`/`safeParse` + the
|
|
160
|
+
* derived spec), or undefined when the kind isn't registered / declared no schema. A post-op
|
|
161
|
+
* or step-resolver uses this to parse `result.custom` without hand-writing a coercer.
|
|
162
|
+
*/
|
|
163
|
+
structuredOutput(kind: AgentKind): StructuredOutput<unknown> | undefined;
|
|
164
|
+
}
|
|
133
165
|
/**
|
|
134
|
-
* A
|
|
135
|
-
*
|
|
136
|
-
*
|
|
166
|
+
* A fresh registry pre-loaded with the built-in agent kinds. This is the single place the
|
|
167
|
+
* built-ins are installed — there is no module-load side effect — so every app (and every
|
|
168
|
+
* test) gets its own instance with the built-ins present. A deployment then registers its
|
|
169
|
+
* own kinds by reference on the instance the composition root injects.
|
|
137
170
|
*/
|
|
138
|
-
export declare function
|
|
171
|
+
export declare function defaultAgentKindRegistry(): AgentKindRegistry;
|
|
139
172
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -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,MAAM,EACP,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"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BAAiB,GAAG,SAAS,CAE3D;IAED;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,SAAS,CAEvE;CACF;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,iBAAiB,CAM5D"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const registry = new Map();
|
|
5
|
-
/** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
|
|
6
|
-
export function registerAgentKind(definition) {
|
|
7
|
-
registry.set(definition.kind, withDerivedOutput(definition));
|
|
8
|
-
}
|
|
1
|
+
import { registerBugInvestigatorAgent } from './bug-investigator.js';
|
|
2
|
+
import { registerDocumentAgents } from './document.js';
|
|
3
|
+
import { registerInitiativeAgents } from './initiative.js';
|
|
9
4
|
/**
|
|
10
5
|
* Derive `agent.output` from a `structuredOutput` schema when the author didn't set it by
|
|
11
6
|
* hand — so a structured kind declares ONE valibot schema and the engine spec falls out of
|
|
@@ -17,84 +12,118 @@ function withDerivedOutput(definition) {
|
|
|
17
12
|
return definition;
|
|
18
13
|
return { ...definition, agent: { ...agent, output: structuredOutput.spec } };
|
|
19
14
|
}
|
|
20
|
-
/** Register several custom agent kinds at once. */
|
|
21
|
-
export function registerAgentKinds(definitions) {
|
|
22
|
-
for (const definition of definitions)
|
|
23
|
-
registerAgentKind(definition);
|
|
24
|
-
}
|
|
25
|
-
/** The registered definition for a kind, or undefined for built-in / unregistered kinds. */
|
|
26
|
-
export function registeredAgentKind(kind) {
|
|
27
|
-
return registry.get(kind);
|
|
28
|
-
}
|
|
29
|
-
/** All registered custom agent kinds (registration order). */
|
|
30
|
-
export function registeredAgentKinds() {
|
|
31
|
-
return [...registry.values()];
|
|
32
|
-
}
|
|
33
15
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
16
|
+
* App-owned registry of agent kinds, mirroring the backend-registries pilot
|
|
17
|
+
* (`RunnerBackendRegistry` / `EnvironmentBackendRegistry`). The composition root news ONE
|
|
18
|
+
* instance per app (`defaultAgentKindRegistry()`), threads it through `CoreDependencies`, and
|
|
19
|
+
* every prompt build / routing decision reads it from there — so there is no module-global
|
|
20
|
+
* `Map`, no `clear*()` test cruft, and no external-adapter module-identity gotcha: a
|
|
21
|
+
* deployment registers extra kinds by reference (`registry.register(def)`) on the instance the
|
|
22
|
+
* facade injects. The built-in kinds (`bug-investigator` / the document + initiative kinds) are
|
|
23
|
+
* pre-loaded by the factory, not by an import side effect.
|
|
37
24
|
*/
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
/** A registered kind's
|
|
89
|
-
|
|
90
|
-
|
|
25
|
+
export class AgentKindRegistry {
|
|
26
|
+
registry = new Map();
|
|
27
|
+
/** Register a custom agent kind. A later registration of the same id replaces the earlier one. */
|
|
28
|
+
register(definition) {
|
|
29
|
+
this.registry.set(definition.kind, withDerivedOutput(definition));
|
|
30
|
+
}
|
|
31
|
+
/** Register several custom agent kinds at once. */
|
|
32
|
+
registerAll(definitions) {
|
|
33
|
+
for (const definition of definitions)
|
|
34
|
+
this.register(definition);
|
|
35
|
+
}
|
|
36
|
+
/** The registered definition for a kind, or undefined for built-in / unregistered kinds. */
|
|
37
|
+
get(kind) {
|
|
38
|
+
return this.registry.get(kind);
|
|
39
|
+
}
|
|
40
|
+
/** All registered agent kinds (registration order). */
|
|
41
|
+
all() {
|
|
42
|
+
return [...this.registry.values()];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether a registered kind runs in a container — either it set `requiresContainer`
|
|
46
|
+
* explicitly, or its `agent` step declares a container surface. False for built-in /
|
|
47
|
+
* unregistered kinds.
|
|
48
|
+
*/
|
|
49
|
+
requiresContainer(kind) {
|
|
50
|
+
const definition = this.registry.get(kind);
|
|
51
|
+
if (!definition)
|
|
52
|
+
return false;
|
|
53
|
+
if (definition.requiresContainer === true)
|
|
54
|
+
return true;
|
|
55
|
+
const surface = definition.agent?.surface;
|
|
56
|
+
return surface === 'container-explore' || surface === 'container-coding';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether a registered kind fans out across the block's connected involved-service repos
|
|
60
|
+
* (see {@link AgentKindDefinition.fanOutMultiRepo}). False for built-in / unregistered kinds —
|
|
61
|
+
* the executor keeps a small allow-list for the pre-registry built-ins (`coder` / `ci-fixer`).
|
|
62
|
+
*/
|
|
63
|
+
fansOutMultiRepo(kind) {
|
|
64
|
+
return this.registry.get(kind)?.fanOutMultiRepo === true;
|
|
65
|
+
}
|
|
66
|
+
/** A registered kind's system prompt, or undefined when the kind is not registered. */
|
|
67
|
+
systemPrompt(kind) {
|
|
68
|
+
const definition = this.registry.get(kind);
|
|
69
|
+
if (!definition)
|
|
70
|
+
return undefined;
|
|
71
|
+
return typeof definition.systemPrompt === 'function'
|
|
72
|
+
? definition.systemPrompt(kind)
|
|
73
|
+
: definition.systemPrompt;
|
|
74
|
+
}
|
|
75
|
+
/** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
|
|
76
|
+
userPrompt(context) {
|
|
77
|
+
return this.registry.get(context.agentKind)?.userPrompt?.(context);
|
|
78
|
+
}
|
|
79
|
+
/** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
|
|
80
|
+
webResearchHint(kind) {
|
|
81
|
+
return this.registry.get(kind)?.webResearchHint;
|
|
82
|
+
}
|
|
83
|
+
/** A registered kind's execution tuning, or undefined when unregistered / not supplied. */
|
|
84
|
+
tuning(kind) {
|
|
85
|
+
return this.registry.get(kind)?.tuning;
|
|
86
|
+
}
|
|
87
|
+
/** A registered kind's contributed config descriptors, or an empty array when none. */
|
|
88
|
+
configContributions(kind) {
|
|
89
|
+
return this.registry.get(kind)?.configContributions ?? [];
|
|
90
|
+
}
|
|
91
|
+
/** A registered kind's agent-step spec (surface/output/clone), or undefined when none. */
|
|
92
|
+
agentStep(kind) {
|
|
93
|
+
return this.registry.get(kind)?.agent;
|
|
94
|
+
}
|
|
95
|
+
/** A registered kind's pre-op hooks (run before the agent step), or an empty array. */
|
|
96
|
+
preOps(kind) {
|
|
97
|
+
return this.registry.get(kind)?.preOps ?? [];
|
|
98
|
+
}
|
|
99
|
+
/** A registered kind's post-op hooks (run after the agent step), or an empty array. */
|
|
100
|
+
postOps(kind) {
|
|
101
|
+
return this.registry.get(kind)?.postOps ?? [];
|
|
102
|
+
}
|
|
103
|
+
/** A registered kind's frontend presentation metadata, or undefined when not supplied. */
|
|
104
|
+
presentation(kind) {
|
|
105
|
+
return this.registry.get(kind)?.presentation;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A registered kind's schema-driven structured output (its typed `parse`/`safeParse` + the
|
|
109
|
+
* derived spec), or undefined when the kind isn't registered / declared no schema. A post-op
|
|
110
|
+
* or step-resolver uses this to parse `result.custom` without hand-writing a coercer.
|
|
111
|
+
*/
|
|
112
|
+
structuredOutput(kind) {
|
|
113
|
+
return this.registry.get(kind)?.structuredOutput;
|
|
114
|
+
}
|
|
91
115
|
}
|
|
92
116
|
/**
|
|
93
|
-
* A
|
|
94
|
-
*
|
|
95
|
-
*
|
|
117
|
+
* A fresh registry pre-loaded with the built-in agent kinds. This is the single place the
|
|
118
|
+
* built-ins are installed — there is no module-load side effect — so every app (and every
|
|
119
|
+
* test) gets its own instance with the built-ins present. A deployment then registers its
|
|
120
|
+
* own kinds by reference on the instance the composition root injects.
|
|
96
121
|
*/
|
|
97
|
-
export function
|
|
98
|
-
|
|
122
|
+
export function defaultAgentKindRegistry() {
|
|
123
|
+
const registry = new AgentKindRegistry();
|
|
124
|
+
registerBugInvestigatorAgent(registry);
|
|
125
|
+
registerDocumentAgents(registry);
|
|
126
|
+
registerInitiativeAgents(registry);
|
|
127
|
+
return registry;
|
|
99
128
|
}
|
|
100
129
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/agents/kinds/registry.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAmH1D;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,UAA+B;IACxD,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,UAAU,CAAA;IAC9C,IAAI,CAAC,gBAAgB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO,UAAU,CAAA;IAClE,OAAO,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAA;AAC9E,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAi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AAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,YAAY,CAAA;IAC9C,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,IAAe;QAC9B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;IAClD,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAA;IACxC,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IACtC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IAChC,wBAAwB,CAAC,QAAQ,CAAC,CAAA;IAClC,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
|
+
import type { AgentKindRegistry } from './registry.js';
|
|
2
3
|
export declare const REQUIREMENTS_REVIEW_AGENT_KIND = "requirements-review";
|
|
3
4
|
export declare const CLARITY_REVIEW_AGENT_KIND = "clarity-review";
|
|
4
5
|
export declare const REQUIREMENTS_BRAINSTORM_AGENT_KIND = "requirements-brainstorm";
|
|
@@ -9,5 +10,5 @@ export declare const ARCHITECTURE_BRAINSTORM_AGENT_KIND = "architecture-brainsto
|
|
|
9
10
|
* and for any custom kind registered with an `inline` agent surface. Used by the start guard
|
|
10
11
|
* to apply the stricter inline-model-usability check to exactly these steps.
|
|
11
12
|
*/
|
|
12
|
-
export declare function isInlineModelStep(kind: AgentKind): boolean;
|
|
13
|
+
export declare function isInlineModelStep(kind: AgentKind, registry: AgentKindRegistry): boolean;
|
|
13
14
|
//# sourceMappingURL=step-surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-surface.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/step-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"step-surface.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/step-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAqBtD,eAAO,MAAM,8BAA8B,wBAAwB,CAAA;AACnE,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;AACzD,eAAO,MAAM,kCAAkC,4BAA4B,CAAA;AAC3E,eAAO,MAAM,kCAAkC,4BAA4B,CAAA;AAU3E;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAGvF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TASK_ESTIMATOR_AGENT_KIND } from '../prompts/roles.js';
|
|
2
|
-
import { registeredAgentKind } from './registry.js';
|
|
3
2
|
// Which execution surface a pipeline step's model runs on — the taxonomy the preset
|
|
4
3
|
// satisfiability guard keys off. Only INLINE model steps need a special check: an inline
|
|
5
4
|
// `generateText` call cannot use a container-only subscription token, so a step that runs a
|
|
@@ -35,9 +34,9 @@ const INLINE_ENGINE_KINDS = new Set([
|
|
|
35
34
|
* and for any custom kind registered with an `inline` agent surface. Used by the start guard
|
|
36
35
|
* to apply the stricter inline-model-usability check to exactly these steps.
|
|
37
36
|
*/
|
|
38
|
-
export function isInlineModelStep(kind) {
|
|
37
|
+
export function isInlineModelStep(kind, registry) {
|
|
39
38
|
if (INLINE_ENGINE_KINDS.has(kind))
|
|
40
39
|
return true;
|
|
41
|
-
return
|
|
40
|
+
return registry.get(kind)?.agent?.surface === 'inline';
|
|
42
41
|
}
|
|
43
42
|
//# sourceMappingURL=step-surface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-surface.js","sourceRoot":"","sources":["../../../src/agents/kinds/step-surface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"step-surface.js","sourceRoot":"","sources":["../../../src/agents/kinds/step-surface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAG/D,oFAAoF;AACpF,yFAAyF;AACzF,4FAA4F;AAC5F,6FAA6F;AAC7F,wFAAwF;AACxF,2CAA2C;AAC3C,EAAE;AACF,wFAAwF;AACxF,4FAA4F;AAC5F,yFAAyF;AAEzF,+EAA+E;AAC/E,0FAA0F;AAC1F,2FAA2F;AAC3F,uFAAuF;AACvF,qFAAqF;AACrF,sFAAsF;AACtF,0FAA0F;AAC1F,kCAAkC;AAClC,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAA;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAgB,CAAA;AACzD,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAA;AAC3E,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAA;AAE3E,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS;IAC1C,8BAA8B;IAC9B,yBAAyB;IACzB,kCAAkC;IAClC,kCAAkC;IAClC,yBAAyB;CAC1B,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAe,EAAE,QAA2B;IAC5E,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAC9C,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,QAAQ,CAAA;AACxD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentKind } from '@cat-factory/kernel';
|
|
2
|
+
import type { AgentKindRegistry } from './registry.js';
|
|
2
3
|
/** A trait id. Free-form so deployments can define their own beyond the standard two. */
|
|
3
4
|
export type AgentTrait = string;
|
|
4
5
|
/**
|
|
@@ -70,14 +71,19 @@ export declare function registerAgentTraits(definitions: Iterable<AgentTraitDefi
|
|
|
70
71
|
export declare function registeredAgentTrait(id: AgentTrait): AgentTraitDefinition | undefined;
|
|
71
72
|
/** Drop all registered (custom) traits. Intended for tests; standard traits re-register below. */
|
|
72
73
|
export declare function clearRegisteredAgentTraits(): void;
|
|
73
|
-
/**
|
|
74
|
-
|
|
74
|
+
/**
|
|
75
|
+
* The traits a kind carries: its built-in set unioned with a registered kind's own `traits`
|
|
76
|
+
* (read off the app-owned {@link AgentKindRegistry}) and any extra assignments. The trait
|
|
77
|
+
* definition + assignment registries remain module-global (the separate "Agent traits" slice);
|
|
78
|
+
* only the agent-kind lookup rides the injected registry.
|
|
79
|
+
*/
|
|
80
|
+
export declare function traitsFor(kind: AgentKind, registry: AgentKindRegistry): Set<AgentTrait>;
|
|
75
81
|
/** Whether `kind` carries `trait`. */
|
|
76
|
-
export declare function hasTrait(kind: AgentKind, trait: AgentTrait): boolean;
|
|
82
|
+
export declare function hasTrait(kind: AgentKind, trait: AgentTrait, registry: AgentKindRegistry): boolean;
|
|
77
83
|
/**
|
|
78
84
|
* The guidance lines contributed by the traits a kind carries, in trait order. Folded
|
|
79
85
|
* into the kind's system prompt by `systemPromptFor`. Marker traits (no guidance, e.g.
|
|
80
86
|
* `code-aware`) contribute nothing here.
|
|
81
87
|
*/
|
|
82
|
-
export declare function traitGuidanceFor(kind: AgentKind): string[];
|
|
88
|
+
export declare function traitGuidanceFor(kind: AgentKind, registry: AgentKindRegistry): string[];
|
|
83
89
|
//# sourceMappingURL=traits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"traits.d.ts","sourceRoot":"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AoB,CAAC,EAAE,EAAE,UAAU,GAAG,oBAAoB,GAAG,SAAS,CAErF;AAED,kGAAkG;AAClG,wBAAgB,0BAA0B,IAAI,IAAI,CAGjD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,GAAG,CAAC,UAAU,CAAC,CAKvF;AAED,sCAAsC;AACtC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAEjG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAQvF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SPEC_FEATURES_DIR, SPEC_MODULES_DIR, SPEC_OVERVIEW_PATH } from '@cat-factory/contracts';
|
|
2
|
-
import { registeredAgentKind } from './registry.js';
|
|
3
2
|
/**
|
|
4
3
|
* Code-aware kinds read and/or change the service's code. The service's selected
|
|
5
4
|
* best-practice / guideline fragments (Node, Fastify, performance, …) are folded into
|
|
@@ -116,27 +115,32 @@ export function clearRegisteredAgentTraits() {
|
|
|
116
115
|
traitRegistry.clear();
|
|
117
116
|
registerStandardTraits();
|
|
118
117
|
}
|
|
119
|
-
/**
|
|
120
|
-
|
|
118
|
+
/**
|
|
119
|
+
* The traits a kind carries: its built-in set unioned with a registered kind's own `traits`
|
|
120
|
+
* (read off the app-owned {@link AgentKindRegistry}) and any extra assignments. The trait
|
|
121
|
+
* definition + assignment registries remain module-global (the separate "Agent traits" slice);
|
|
122
|
+
* only the agent-kind lookup rides the injected registry.
|
|
123
|
+
*/
|
|
124
|
+
export function traitsFor(kind, registry) {
|
|
121
125
|
const traits = new Set(STANDARD_AGENT_TRAITS[kind] ?? []);
|
|
122
|
-
for (const trait of
|
|
126
|
+
for (const trait of registry.get(kind)?.traits ?? [])
|
|
123
127
|
traits.add(trait);
|
|
124
128
|
for (const trait of assignedTraits.get(kind) ?? [])
|
|
125
129
|
traits.add(trait);
|
|
126
130
|
return traits;
|
|
127
131
|
}
|
|
128
132
|
/** Whether `kind` carries `trait`. */
|
|
129
|
-
export function hasTrait(kind, trait) {
|
|
130
|
-
return traitsFor(kind).has(trait);
|
|
133
|
+
export function hasTrait(kind, trait, registry) {
|
|
134
|
+
return traitsFor(kind, registry).has(trait);
|
|
131
135
|
}
|
|
132
136
|
/**
|
|
133
137
|
* The guidance lines contributed by the traits a kind carries, in trait order. Folded
|
|
134
138
|
* into the kind's system prompt by `systemPromptFor`. Marker traits (no guidance, e.g.
|
|
135
139
|
* `code-aware`) contribute nothing here.
|
|
136
140
|
*/
|
|
137
|
-
export function traitGuidanceFor(kind) {
|
|
141
|
+
export function traitGuidanceFor(kind, registry) {
|
|
138
142
|
const lines = [];
|
|
139
|
-
for (const trait of traitsFor(kind)) {
|
|
143
|
+
for (const trait of traitsFor(kind, registry)) {
|
|
140
144
|
const guidance = traitRegistry.get(trait)?.guidance;
|
|
141
145
|
if (!guidance)
|
|
142
146
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"traits.js","sourceRoot":"","sources":["../../../src/agents/kinds/traits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAiBhG;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe,WAAW,CAAA;AAEtD;;;;GAIG;AACH,MAAM,CA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E,EAAE,eAAe,EAAE,CAAC,CAAA;IAC3C,kBAAkB,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,CAAA;AAC7E,CAAC;AAED,sBAAsB,EAAE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentKindRegistry } from './registry.js';
|
|
1
2
|
/** Per-knob progress-guard overrides for a kind (each optional; absent ⇒ harness default). */
|
|
2
3
|
export interface AgentGuardTuning {
|
|
3
4
|
/** Non-exploration tool calls allowed before the first edit (the no-edit bound). */
|
|
@@ -17,5 +18,5 @@ export interface AgentTuning {
|
|
|
17
18
|
* every knob). Returns the override object as-is — the dispatcher spreads it into the
|
|
18
19
|
* job body and the harness clamps each value.
|
|
19
20
|
*/
|
|
20
|
-
export declare function agentTuningFor(kind: string): AgentTuning | undefined;
|
|
21
|
+
export declare function agentTuningFor(kind: string, registry: AgentKindRegistry): AgentTuning | undefined;
|
|
21
22
|
//# sourceMappingURL=tuning.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuning.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/tuning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tuning.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/tuning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAgBtD,8FAA8F;AAC9F,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,gEAAgE;IAChE,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,wFAAwF;IACxF,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAC/B;AAkBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,WAAW,GAAG,SAAS,CAEjG"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registeredAgentTuning } from './registry.js';
|
|
2
1
|
// Built-in per-kind tuning. Deliberately sparse: only kinds with a documented reason
|
|
3
2
|
// their normal pattern trips a default guard get an entry — everything else inherits
|
|
4
3
|
// the harness defaults unchanged. Every override here LOOSENS a limit.
|
|
@@ -20,7 +19,7 @@ const BUILTIN_AGENT_TUNING = {
|
|
|
20
19
|
* every knob). Returns the override object as-is — the dispatcher spreads it into the
|
|
21
20
|
* job body and the harness clamps each value.
|
|
22
21
|
*/
|
|
23
|
-
export function agentTuningFor(kind) {
|
|
24
|
-
return
|
|
22
|
+
export function agentTuningFor(kind, registry) {
|
|
23
|
+
return registry.tuning(kind) ?? BUILTIN_AGENT_TUNING[kind];
|
|
25
24
|
}
|
|
26
25
|
//# sourceMappingURL=tuning.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuning.js","sourceRoot":"","sources":["../../../src/agents/kinds/tuning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tuning.js","sourceRoot":"","sources":["../../../src/agents/kinds/tuning.ts"],"names":[],"mappings":"AA+BA,qFAAqF;AACrF,qFAAqF;AACrF,uEAAuE;AACvE,MAAM,oBAAoB,GAAgC;IACxD,mFAAmF;IACnF,sFAAsF;IACtF,yCAAyC;IACzC,mBAAmB,EAAE,EAAE,WAAW,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAE,EAAE;IAClE,oFAAoF;IACpF,mFAAmF;IACnF,UAAU,EAAE,EAAE,WAAW,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,EAAE;IAC3D,sFAAsF;IACtF,2EAA2E;IAC3E,QAAQ,EAAE,EAAE,WAAW,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,EAAE;CAC1D,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,QAA2B;IACtE,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/roles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGpD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/roles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGpD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;AAuEzD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAOxD"}
|
|
@@ -19,12 +19,10 @@ const ROLES = {
|
|
|
19
19
|
// produce a single, prioritized, actionable markdown report that a downstream
|
|
20
20
|
// `tracker` step files as an issue and a `coder` step then implements.
|
|
21
21
|
analysis: 'You are a senior engineer performing a technical-debt audit of this service. Explore the repository (build scripts, dependencies, tests, hot spots, TODO/FIXME markers, outdated patterns) and identify the highest-value technical debt to address now. Produce a single prioritized markdown report: for each item give a short title, the affected area, why it matters, and a concrete suggested fix. Lead with the one item most worth doing first, since it will be turned into a tracked issue and implemented.',
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
// its
|
|
25
|
-
//
|
|
26
|
-
// confident — a low-confidence guess would misdirect the fix.
|
|
27
|
-
'bug-investigator': 'You are a senior engineer triaging a bug report against this codebase before anyone fixes it. Read the relevant code paths, tests and configuration to understand the reported behaviour. Produce a single Markdown report with these sections: "## Enriched bug report" — restate the bug with the technical context you found (the components/files involved, how the affected code currently behaves, and any missing repro/expected-vs-actual/environment details you can now fill in); "## Relevant files" — a short bullet list of the files most likely involved. ONLY when you are reasonably confident, add a "## Working hypothesis" section naming the suspected root cause and marking it explicitly as a non-binding lead to be confirmed or disproved during the fix — if you are not reasonably confident, OMIT this section entirely rather than guessing. Do not propose or write a fix.',
|
|
22
|
+
// NOTE: `bug-investigator` is no longer a prose ROLE — it is a STRUCTURED
|
|
23
|
+
// `container-explore` kind registered via `registerAgentKind` in
|
|
24
|
+
// `agents/kinds/bug-investigator.ts` (its structured `clarity`/`questions` drive the
|
|
25
|
+
// downstream clarity gate). It intentionally has no entry here.
|
|
28
26
|
documenter: 'You are a technical writer. Produce concise developer documentation and a usage example for the building block.',
|
|
29
27
|
integrator: 'You are an integration engineer. Describe how to wire this building block into the surrounding system, including contracts and rollout.',
|
|
30
28
|
// Runs before the architect: reviews the collected CONTEXT (the linked-prose brief)
|