@cat-factory/agents 0.33.0 → 0.34.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.
Files changed (52) hide show
  1. package/dist/agents/catalog.d.ts +3 -2
  2. package/dist/agents/catalog.d.ts.map +1 -1
  3. package/dist/agents/catalog.js +13 -14
  4. package/dist/agents/catalog.js.map +1 -1
  5. package/dist/agents/kinds/bug-investigator.d.ts +29 -0
  6. package/dist/agents/kinds/bug-investigator.d.ts.map +1 -0
  7. package/dist/agents/kinds/bug-investigator.js +102 -0
  8. package/dist/agents/kinds/bug-investigator.js.map +1 -0
  9. package/dist/agents/kinds/configs.d.ts +3 -2
  10. package/dist/agents/kinds/configs.d.ts.map +1 -1
  11. package/dist/agents/kinds/configs.js +4 -5
  12. package/dist/agents/kinds/configs.js.map +1 -1
  13. package/dist/agents/kinds/document.d.ts +4 -4
  14. package/dist/agents/kinds/document.d.ts.map +1 -1
  15. package/dist/agents/kinds/document.js +4 -7
  16. package/dist/agents/kinds/document.js.map +1 -1
  17. package/dist/agents/kinds/initiative.d.ts +4 -4
  18. package/dist/agents/kinds/initiative.d.ts.map +1 -1
  19. package/dist/agents/kinds/initiative.js +4 -7
  20. package/dist/agents/kinds/initiative.js.map +1 -1
  21. package/dist/agents/kinds/registry.d.ts +69 -36
  22. package/dist/agents/kinds/registry.d.ts.map +1 -1
  23. package/dist/agents/kinds/registry.js +111 -82
  24. package/dist/agents/kinds/registry.js.map +1 -1
  25. package/dist/agents/kinds/step-surface.d.ts +2 -1
  26. package/dist/agents/kinds/step-surface.d.ts.map +1 -1
  27. package/dist/agents/kinds/step-surface.js +2 -3
  28. package/dist/agents/kinds/step-surface.js.map +1 -1
  29. package/dist/agents/kinds/traits.d.ts +10 -4
  30. package/dist/agents/kinds/traits.d.ts.map +1 -1
  31. package/dist/agents/kinds/traits.js +12 -8
  32. package/dist/agents/kinds/traits.js.map +1 -1
  33. package/dist/agents/kinds/tuning.d.ts +2 -1
  34. package/dist/agents/kinds/tuning.d.ts.map +1 -1
  35. package/dist/agents/kinds/tuning.js +2 -3
  36. package/dist/agents/kinds/tuning.js.map +1 -1
  37. package/dist/agents/prompts/roles.d.ts.map +1 -1
  38. package/dist/agents/prompts/roles.js +4 -6
  39. package/dist/agents/prompts/roles.js.map +1 -1
  40. package/dist/agents/runtime/executor.d.ts +9 -1
  41. package/dist/agents/runtime/executor.d.ts.map +1 -1
  42. package/dist/agents/runtime/executor.js +7 -4
  43. package/dist/agents/runtime/executor.js.map +1 -1
  44. package/dist/agents/runtime/web-search.d.ts +2 -1
  45. package/dist/agents/runtime/web-search.d.ts.map +1 -1
  46. package/dist/agents/runtime/web-search.js +2 -3
  47. package/dist/agents/runtime/web-search.js.map +1 -1
  48. package/dist/index.d.ts +2 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +7 -4
  51. package/dist/index.js.map +1 -1
  52. 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
- * Whether a registered kind runs in a container — either it set `requiresContainer`
109
- * explicitly, or its `agent` step declares a container surface. False for built-in /
110
- * unregistered kinds.
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 function registeredKindRequiresContainer(kind: AgentKind): boolean;
113
- /** Drop all registered kinds. Intended for tests that exercise registration. */
114
- export declare function clearRegisteredAgentKinds(): void;
115
- /** A registered kind's system prompt, or undefined when the kind is not registered. */
116
- export declare function registeredSystemPrompt(kind: AgentKind): string | undefined;
117
- /** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
118
- export declare function registeredUserPrompt(context: AgentRunContext): string | undefined;
119
- /** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
120
- export declare function registeredWebResearchHint(kind: AgentKind): string | undefined;
121
- /** A registered kind's execution tuning, or undefined when unregistered / not supplied. */
122
- export declare function registeredAgentTuning(kind: AgentKind): AgentTuning | undefined;
123
- /** A registered kind's contributed config descriptors, or an empty array when none. */
124
- export declare function registeredConfigContributions(kind: AgentKind): AgentConfigDescriptor[];
125
- /** A registered kind's agent-step spec (surface/output/clone), or undefined when none. */
126
- export declare function registeredAgentStep(kind: AgentKind): AgentStepSpec | undefined;
127
- /** A registered kind's pre-op hooks (run before the agent step), or an empty array. */
128
- export declare function registeredPreOps(kind: AgentKind): RepoOp[];
129
- /** A registered kind's post-op hooks (run after the agent step), or an empty array. */
130
- export declare function registeredPostOps(kind: AgentKind): RepoOp[];
131
- /** A registered kind's frontend presentation metadata, or undefined when not supplied. */
132
- export declare function registeredAgentPresentation(kind: AgentKind): AgentPresentation | undefined;
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 registered kind's schema-driven structured output (its typed `parse`/`safeParse` + the
135
- * derived spec), or undefined when the kind isn't registered / declared no schema. A post-op
136
- * or step-resolver uses this to parse `result.custom` without hand-writing a coercer.
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 registeredStructuredOutput(kind: AgentKind): StructuredOutput<unknown> | undefined;
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,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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
- // Process-wide registry, mirroring the Worker's model-provider registry. Registration
2
- // is a startup side effect read by every prompt build / routing decision, so the extra
3
- // kinds reach all paths — HTTP requests, the durable driver and the cron sweeper.
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
- * Whether a registered kind runs in a container — either it set `requiresContainer`
35
- * explicitly, or its `agent` step declares a container surface. False for built-in /
36
- * unregistered kinds.
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 function registeredKindRequiresContainer(kind) {
39
- const definition = registry.get(kind);
40
- if (!definition)
41
- return false;
42
- if (definition.requiresContainer === true)
43
- return true;
44
- const surface = definition.agent?.surface;
45
- return surface === 'container-explore' || surface === 'container-coding';
46
- }
47
- /** Drop all registered kinds. Intended for tests that exercise registration. */
48
- export function clearRegisteredAgentKinds() {
49
- registry.clear();
50
- }
51
- /** A registered kind's system prompt, or undefined when the kind is not registered. */
52
- export function registeredSystemPrompt(kind) {
53
- const definition = registry.get(kind);
54
- if (!definition)
55
- return undefined;
56
- return typeof definition.systemPrompt === 'function'
57
- ? definition.systemPrompt(kind)
58
- : definition.systemPrompt;
59
- }
60
- /** A registered kind's user prompt, or undefined when the kind is not registered / has no builder. */
61
- export function registeredUserPrompt(context) {
62
- return registry.get(context.agentKind)?.userPrompt?.(context);
63
- }
64
- /** A registered kind's web-research hint, or undefined when unregistered / not supplied. */
65
- export function registeredWebResearchHint(kind) {
66
- return registry.get(kind)?.webResearchHint;
67
- }
68
- /** A registered kind's execution tuning, or undefined when unregistered / not supplied. */
69
- export function registeredAgentTuning(kind) {
70
- return registry.get(kind)?.tuning;
71
- }
72
- /** A registered kind's contributed config descriptors, or an empty array when none. */
73
- export function registeredConfigContributions(kind) {
74
- return registry.get(kind)?.configContributions ?? [];
75
- }
76
- /** A registered kind's agent-step spec (surface/output/clone), or undefined when none. */
77
- export function registeredAgentStep(kind) {
78
- return registry.get(kind)?.agent;
79
- }
80
- /** A registered kind's pre-op hooks (run before the agent step), or an empty array. */
81
- export function registeredPreOps(kind) {
82
- return registry.get(kind)?.preOps ?? [];
83
- }
84
- /** A registered kind's post-op hooks (run after the agent step), or an empty array. */
85
- export function registeredPostOps(kind) {
86
- return registry.get(kind)?.postOps ?? [];
87
- }
88
- /** A registered kind's frontend presentation metadata, or undefined when not supplied. */
89
- export function registeredAgentPresentation(kind) {
90
- return registry.get(kind)?.presentation;
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 registered kind's schema-driven structured output (its typed `parse`/`safeParse` + the
94
- * derived spec), or undefined when the kind isn't registered / declared no schema. A post-op
95
- * or step-resolver uses this to parse `result.custom` without hand-writing a coercer.
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 registeredStructuredOutput(kind) {
98
- return registry.get(kind)?.structuredOutput;
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":"AAoHA,sFAAsF;AACtF,uFAAuF;AACvF,kFAAkF;AAClF,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA+B,CAAA;AAEvD,kGAAkG;AAClG,MAAM,UAAU,iBAAiB,CAAC,UAA+B;IAC/D,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAA;AAC9D,CAAC;AAED;;;;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,mDAAmD;AACnD,MAAM,UAAU,kBAAkB,CAAC,WAA0C;IAC3E,KAAK,MAAM,UAAU,IAAI,WAAW;QAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;AACrE,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,mBAAmB,CAAC,IAAe;IACjD,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CA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AE,MAAM,IAAI,EAAE,CAAA;IAC9C,CAAC;IAED,uFAAuF;IACvF,OAAO,CAAC,IAAe;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,IAAI,EAAE,CAAA;IAC/C,CAAC;IAED,0FAA0F;IAC1F,YAAY,CAAC,IAAe;QAC1B,OAAO,IAAI,CAAC,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;AAuBpD,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,GAAG,OAAO,CAG1D"}
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 registeredAgentKind(kind)?.agent?.surface === 'inline';
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;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAEnD,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;IAC/C,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAC9C,OAAO,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,QAAQ,CAAA;AAC/D,CAAC"}
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
- /** The traits a kind carries: its built-in set unioned with a registered custom kind's. */
74
- export declare function traitsFor(kind: AgentKind): Set<AgentTrait>;
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;AAapD,yFAAyF;AACzF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,UAAwB,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAyB,CAAA;AAExD;;;;;;;;GA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2FAA2F;AAC3F,wBAAgB,oBAAoB,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
- /** The traits a kind carries: its built-in set unioned with a registered custom kind's. */
120
- export function traitsFor(kind) {
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 registeredAgentKind(kind)?.traits ?? [])
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;AAEhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAenD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe,WAAW,CAAA;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,YAAY,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAe,gBAAgB,CAAA;AAEhE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,8QAA8Q;IAC9Q,OAAO,kBAAkB,0GAA0G;IACnI,OAAO,gBAAgB,mHAAmH;IAC1I,OAAO,gBAAgB,0IAA0I;IACjK,OAAO,iBAAiB,uFAAuF;IAC/G,+RAA+R;CAChS,CAAC,IAAI,CAAC,IAAI,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,EAAE,CAAC,CAAA;IAC5C,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,EAAE,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":"AAgBA,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,GAAG,WAAW,GAAG,SAAS,CAEpE"}
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 registeredAgentTuning(kind) ?? BUILTIN_AGENT_TUNING[kind];
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":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AA+BrD,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;IACzC,OAAO,qBAAqB,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAA;AAClE,CAAC"}
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;AA0EzD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAOxD"}
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
- // Opens a bug-fix pipeline. Clones the repo and reads the codebase from the raw bug
23
- // report to enrich it before triage. It MUST be read-only (no edits / commits / PR);
24
- // its prose report feeds the downstream clarity reviewer (the triage subject) and the
25
- // coder (a non-binding lead). It only proposes a root-cause hypothesis when reasonably
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)