@cat-factory/agents 0.6.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 (226) hide show
  1. package/LICENSE +21 -0
  2. package/dist/agents/AiAgentExecutor.d.ts +72 -0
  3. package/dist/agents/AiAgentExecutor.d.ts.map +1 -0
  4. package/dist/agents/AiAgentExecutor.js +125 -0
  5. package/dist/agents/AiAgentExecutor.js.map +1 -0
  6. package/dist/agents/acceptance-prompts.d.ts +29 -0
  7. package/dist/agents/acceptance-prompts.d.ts.map +1 -0
  8. package/dist/agents/acceptance-prompts.js +112 -0
  9. package/dist/agents/acceptance-prompts.js.map +1 -0
  10. package/dist/agents/agent-catalog.d.ts +6 -0
  11. package/dist/agents/agent-catalog.d.ts.map +1 -0
  12. package/dist/agents/agent-catalog.js +197 -0
  13. package/dist/agents/agent-catalog.js.map +1 -0
  14. package/dist/agents/agent-configs.d.ts +17 -0
  15. package/dist/agents/agent-configs.d.ts.map +1 -0
  16. package/dist/agents/agent-configs.js +66 -0
  17. package/dist/agents/agent-configs.js.map +1 -0
  18. package/dist/agents/agent-routing.d.ts +57 -0
  19. package/dist/agents/agent-routing.d.ts.map +1 -0
  20. package/dist/agents/agent-routing.js +41 -0
  21. package/dist/agents/agent-routing.js.map +1 -0
  22. package/dist/agents/business-logic-prompts.d.ts +28 -0
  23. package/dist/agents/business-logic-prompts.d.ts.map +1 -0
  24. package/dist/agents/business-logic-prompts.js +96 -0
  25. package/dist/agents/business-logic-prompts.js.map +1 -0
  26. package/dist/agents/catalog.d.ts +6 -0
  27. package/dist/agents/catalog.d.ts.map +1 -0
  28. package/dist/agents/catalog.js +168 -0
  29. package/dist/agents/catalog.js.map +1 -0
  30. package/dist/agents/ci-gate.d.ts +2 -0
  31. package/dist/agents/ci-gate.d.ts.map +1 -0
  32. package/dist/agents/ci-gate.js +33 -0
  33. package/dist/agents/ci-gate.js.map +1 -0
  34. package/dist/agents/companion-prompts.d.ts +4 -0
  35. package/dist/agents/companion-prompts.d.ts.map +1 -0
  36. package/dist/agents/companion-prompts.js +27 -0
  37. package/dist/agents/companion-prompts.js.map +1 -0
  38. package/dist/agents/companions.d.ts +20 -0
  39. package/dist/agents/companions.d.ts.map +1 -0
  40. package/dist/agents/companions.js +38 -0
  41. package/dist/agents/companions.js.map +1 -0
  42. package/dist/agents/kinds/companions.d.ts +20 -0
  43. package/dist/agents/kinds/companions.d.ts.map +1 -0
  44. package/dist/agents/kinds/companions.js +39 -0
  45. package/dist/agents/kinds/companions.js.map +1 -0
  46. package/dist/agents/kinds/configs.d.ts +17 -0
  47. package/dist/agents/kinds/configs.d.ts.map +1 -0
  48. package/dist/agents/kinds/configs.js +66 -0
  49. package/dist/agents/kinds/configs.js.map +1 -0
  50. package/dist/agents/kinds/read-only.d.ts +13 -0
  51. package/dist/agents/kinds/read-only.d.ts.map +1 -0
  52. package/dist/agents/kinds/read-only.js +32 -0
  53. package/dist/agents/kinds/read-only.js.map +1 -0
  54. package/dist/agents/kinds/registry.d.ts +70 -0
  55. package/dist/agents/kinds/registry.d.ts.map +1 -0
  56. package/dist/agents/kinds/registry.js +51 -0
  57. package/dist/agents/kinds/registry.js.map +1 -0
  58. package/dist/agents/kinds/traits.d.ts +60 -0
  59. package/dist/agents/kinds/traits.d.ts.map +1 -0
  60. package/dist/agents/kinds/traits.js +123 -0
  61. package/dist/agents/kinds/traits.js.map +1 -0
  62. package/dist/agents/kinds/versions.d.ts +46 -0
  63. package/dist/agents/kinds/versions.d.ts.map +1 -0
  64. package/dist/agents/kinds/versions.js +22 -0
  65. package/dist/agents/kinds/versions.js.map +1 -0
  66. package/dist/agents/mock-prompts.d.ts +12 -0
  67. package/dist/agents/mock-prompts.d.ts.map +1 -0
  68. package/dist/agents/mock-prompts.js +61 -0
  69. package/dist/agents/mock-prompts.js.map +1 -0
  70. package/dist/agents/prompt-fragments.d.ts +17 -0
  71. package/dist/agents/prompt-fragments.d.ts.map +1 -0
  72. package/dist/agents/prompt-fragments.js +33 -0
  73. package/dist/agents/prompt-fragments.js.map +1 -0
  74. package/dist/agents/prompt-shared.d.ts +7 -0
  75. package/dist/agents/prompt-shared.d.ts.map +1 -0
  76. package/dist/agents/prompt-shared.js +10 -0
  77. package/dist/agents/prompt-shared.js.map +1 -0
  78. package/dist/agents/prompt-versions.d.ts +48 -0
  79. package/dist/agents/prompt-versions.d.ts.map +1 -0
  80. package/dist/agents/prompt-versions.js +55 -0
  81. package/dist/agents/prompt-versions.js.map +1 -0
  82. package/dist/agents/prompts/acceptance.d.ts +29 -0
  83. package/dist/agents/prompts/acceptance.d.ts.map +1 -0
  84. package/dist/agents/prompts/acceptance.js +112 -0
  85. package/dist/agents/prompts/acceptance.js.map +1 -0
  86. package/dist/agents/prompts/business-logic.d.ts +28 -0
  87. package/dist/agents/prompts/business-logic.d.ts.map +1 -0
  88. package/dist/agents/prompts/business-logic.js +98 -0
  89. package/dist/agents/prompts/business-logic.js.map +1 -0
  90. package/dist/agents/prompts/clarity.d.ts +10 -0
  91. package/dist/agents/prompts/clarity.d.ts.map +1 -0
  92. package/dist/agents/prompts/clarity.js +40 -0
  93. package/dist/agents/prompts/clarity.js.map +1 -0
  94. package/dist/agents/prompts/companion.d.ts +4 -0
  95. package/dist/agents/prompts/companion.d.ts.map +1 -0
  96. package/dist/agents/prompts/companion.js +61 -0
  97. package/dist/agents/prompts/companion.js.map +1 -0
  98. package/dist/agents/prompts/delivery-contract.d.ts +2 -0
  99. package/dist/agents/prompts/delivery-contract.d.ts.map +1 -0
  100. package/dist/agents/prompts/delivery-contract.js +33 -0
  101. package/dist/agents/prompts/delivery-contract.js.map +1 -0
  102. package/dist/agents/prompts/mock.d.ts +12 -0
  103. package/dist/agents/prompts/mock.d.ts.map +1 -0
  104. package/dist/agents/prompts/mock.js +61 -0
  105. package/dist/agents/prompts/mock.js.map +1 -0
  106. package/dist/agents/prompts/requirements.d.ts +13 -0
  107. package/dist/agents/prompts/requirements.d.ts.map +1 -0
  108. package/dist/agents/prompts/requirements.js +45 -0
  109. package/dist/agents/prompts/requirements.js.map +1 -0
  110. package/dist/agents/prompts/roles.d.ts +16 -0
  111. package/dist/agents/prompts/roles.d.ts.map +1 -0
  112. package/dist/agents/prompts/roles.js +74 -0
  113. package/dist/agents/prompts/roles.js.map +1 -0
  114. package/dist/agents/prompts/shared.d.ts +19 -0
  115. package/dist/agents/prompts/shared.d.ts.map +1 -0
  116. package/dist/agents/prompts/shared.js +25 -0
  117. package/dist/agents/prompts/shared.js.map +1 -0
  118. package/dist/agents/prompts/standard-templates.generated.d.ts +36 -0
  119. package/dist/agents/prompts/standard-templates.generated.d.ts.map +1 -0
  120. package/dist/agents/prompts/standard-templates.generated.js +122 -0
  121. package/dist/agents/prompts/standard-templates.generated.js.map +1 -0
  122. package/dist/agents/prompts/standard.d.ts +36 -0
  123. package/dist/agents/prompts/standard.d.ts.map +1 -0
  124. package/dist/agents/prompts/standard.js +208 -0
  125. package/dist/agents/prompts/standard.js.map +1 -0
  126. package/dist/agents/prompts/testing.d.ts +12 -0
  127. package/dist/agents/prompts/testing.d.ts.map +1 -0
  128. package/dist/agents/prompts/testing.js +94 -0
  129. package/dist/agents/prompts/testing.js.map +1 -0
  130. package/dist/agents/read-only.d.ts +13 -0
  131. package/dist/agents/read-only.d.ts.map +1 -0
  132. package/dist/agents/read-only.js +29 -0
  133. package/dist/agents/read-only.js.map +1 -0
  134. package/dist/agents/registry.d.ts +70 -0
  135. package/dist/agents/registry.d.ts.map +1 -0
  136. package/dist/agents/registry.js +51 -0
  137. package/dist/agents/registry.js.map +1 -0
  138. package/dist/agents/runtime/executor.d.ts +72 -0
  139. package/dist/agents/runtime/executor.d.ts.map +1 -0
  140. package/dist/agents/runtime/executor.js +125 -0
  141. package/dist/agents/runtime/executor.js.map +1 -0
  142. package/dist/agents/runtime/fragments.d.ts +17 -0
  143. package/dist/agents/runtime/fragments.d.ts.map +1 -0
  144. package/dist/agents/runtime/fragments.js +33 -0
  145. package/dist/agents/runtime/fragments.js.map +1 -0
  146. package/dist/agents/runtime/routing.d.ts +57 -0
  147. package/dist/agents/runtime/routing.d.ts.map +1 -0
  148. package/dist/agents/runtime/routing.js +41 -0
  149. package/dist/agents/runtime/routing.js.map +1 -0
  150. package/dist/agents/runtime/web-search.d.ts +43 -0
  151. package/dist/agents/runtime/web-search.d.ts.map +1 -0
  152. package/dist/agents/runtime/web-search.js +102 -0
  153. package/dist/agents/runtime/web-search.js.map +1 -0
  154. package/dist/agents/standard-prompt-templates.generated.d.ts +36 -0
  155. package/dist/agents/standard-prompt-templates.generated.d.ts.map +1 -0
  156. package/dist/agents/standard-prompt-templates.generated.js +122 -0
  157. package/dist/agents/standard-prompt-templates.generated.js.map +1 -0
  158. package/dist/agents/standard-prompts.d.ts +36 -0
  159. package/dist/agents/standard-prompts.d.ts.map +1 -0
  160. package/dist/agents/standard-prompts.js +202 -0
  161. package/dist/agents/standard-prompts.js.map +1 -0
  162. package/dist/agents/test-prompts.d.ts +12 -0
  163. package/dist/agents/test-prompts.d.ts.map +1 -0
  164. package/dist/agents/test-prompts.js +92 -0
  165. package/dist/agents/test-prompts.js.map +1 -0
  166. package/dist/agents/traits.d.ts +56 -0
  167. package/dist/agents/traits.d.ts.map +1 -0
  168. package/dist/agents/traits.js +100 -0
  169. package/dist/agents/traits.js.map +1 -0
  170. package/dist/agents/web-search.d.ts +43 -0
  171. package/dist/agents/web-search.d.ts.map +1 -0
  172. package/dist/agents/web-search.js +102 -0
  173. package/dist/agents/web-search.js.map +1 -0
  174. package/dist/fragmentLibrary/DeterministicFragmentSelector.d.ts +10 -0
  175. package/dist/fragmentLibrary/DeterministicFragmentSelector.d.ts.map +1 -0
  176. package/dist/fragmentLibrary/DeterministicFragmentSelector.js +12 -0
  177. package/dist/fragmentLibrary/DeterministicFragmentSelector.js.map +1 -0
  178. package/dist/fragmentLibrary/FragmentLibraryService.d.ts +55 -0
  179. package/dist/fragmentLibrary/FragmentLibraryService.d.ts.map +1 -0
  180. package/dist/fragmentLibrary/FragmentLibraryService.js +203 -0
  181. package/dist/fragmentLibrary/FragmentLibraryService.js.map +1 -0
  182. package/dist/fragmentLibrary/FragmentSourceService.d.ts +51 -0
  183. package/dist/fragmentLibrary/FragmentSourceService.d.ts.map +1 -0
  184. package/dist/fragmentLibrary/FragmentSourceService.js +181 -0
  185. package/dist/fragmentLibrary/FragmentSourceService.js.map +1 -0
  186. package/dist/fragmentLibrary/LlmFragmentSelector.d.ts +21 -0
  187. package/dist/fragmentLibrary/LlmFragmentSelector.d.ts.map +1 -0
  188. package/dist/fragmentLibrary/LlmFragmentSelector.js +87 -0
  189. package/dist/fragmentLibrary/LlmFragmentSelector.js.map +1 -0
  190. package/dist/fragmentLibrary/fragment-catalog.d.ts +43 -0
  191. package/dist/fragmentLibrary/fragment-catalog.d.ts.map +1 -0
  192. package/dist/fragmentLibrary/fragment-catalog.js +129 -0
  193. package/dist/fragmentLibrary/fragment-catalog.js.map +1 -0
  194. package/dist/fragmentLibrary/fragment-source.logic.d.ts +34 -0
  195. package/dist/fragmentLibrary/fragment-source.logic.d.ts.map +1 -0
  196. package/dist/fragmentLibrary/fragment-source.logic.js +172 -0
  197. package/dist/fragmentLibrary/fragment-source.logic.js.map +1 -0
  198. package/dist/index.d.ts +30 -0
  199. package/dist/index.d.ts.map +1 -0
  200. package/dist/index.js +43 -0
  201. package/dist/index.js.map +1 -0
  202. package/dist/providers/cache.d.ts +22 -0
  203. package/dist/providers/cache.d.ts.map +1 -0
  204. package/dist/providers/cache.js +64 -0
  205. package/dist/providers/cache.js.map +1 -0
  206. package/dist/providers/endpoints.d.ts +8 -0
  207. package/dist/providers/endpoints.d.ts.map +1 -0
  208. package/dist/providers/endpoints.js +23 -0
  209. package/dist/providers/endpoints.js.map +1 -0
  210. package/dist/providers/index.d.ts +6 -0
  211. package/dist/providers/index.d.ts.map +1 -0
  212. package/dist/providers/index.js +6 -0
  213. package/dist/providers/index.js.map +1 -0
  214. package/dist/providers/instrumented.d.ts +28 -0
  215. package/dist/providers/instrumented.d.ts.map +1 -0
  216. package/dist/providers/instrumented.js +147 -0
  217. package/dist/providers/instrumented.js.map +1 -0
  218. package/dist/providers/registry.d.ts +26 -0
  219. package/dist/providers/registry.d.ts.map +1 -0
  220. package/dist/providers/registry.js +32 -0
  221. package/dist/providers/registry.js.map +1 -0
  222. package/dist/providers/resolvers.d.ts +58 -0
  223. package/dist/providers/resolvers.d.ts.map +1 -0
  224. package/dist/providers/resolvers.js +78 -0
  225. package/dist/providers/resolvers.js.map +1 -0
  226. package/package.json +39 -0
@@ -0,0 +1,46 @@
1
+ /** A prompt under version control: its stable id, integer version and text. */
2
+ export interface VersionedPrompt {
3
+ id: string;
4
+ version: number;
5
+ text: string;
6
+ }
7
+ /** The currently-shipping version of each numbered prompt. */
8
+ export declare const PROMPT_VERSIONS: {
9
+ readonly 'requirement-review': {
10
+ readonly id: 'requirement-review';
11
+ readonly version: 2;
12
+ readonly text: string;
13
+ };
14
+ readonly 'requirement-rework': {
15
+ readonly id: 'requirement-rework';
16
+ readonly version: 2;
17
+ readonly text: string;
18
+ };
19
+ readonly 'clarity-review': {
20
+ readonly id: 'clarity-review';
21
+ readonly version: 1;
22
+ readonly text: string;
23
+ };
24
+ readonly 'clarity-rework': {
25
+ readonly id: 'clarity-rework';
26
+ readonly version: 1;
27
+ readonly text: string;
28
+ };
29
+ readonly build: {
30
+ readonly id: 'build';
31
+ readonly version: 2;
32
+ readonly text: string;
33
+ };
34
+ readonly review: {
35
+ readonly id: 'review';
36
+ readonly version: 2;
37
+ readonly text: string;
38
+ };
39
+ };
40
+ /** Ids of the prompts currently under version control. */
41
+ export type PromptId = keyof typeof PROMPT_VERSIONS;
42
+ /** The current versioned prompt for an id. */
43
+ export declare function promptVersion(id: PromptId): VersionedPrompt;
44
+ /** The canonical `id@vN` label for a prompt id (or an explicit version). */
45
+ export declare function promptVersionLabel(id: string, version?: number): string;
46
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/agents/kinds/versions.ts"],"names":[],"mappings":"AAeA,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe;;iBACF,EAAE,EAAE,oBAAoB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC1C,EAAE,EAAE,oBAAoB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC9C,EAAE,EAAE,gBAAgB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBACtC,EAAE,EAAE,gBAAgB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBACjD,EAAE,EAAE,OAAO;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC5B,EAAE,EAAE,QAAQ;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;CACU,CAAA;AAEpD,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,eAAe,CAAA;AAEnD,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,eAAe,CAE3D;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvE"}
@@ -0,0 +1,22 @@
1
+ import { standardSystemPrompt } from '../prompts/standard.js';
2
+ import { REVIEW_SYSTEM_PROMPT, REWORK_SYSTEM_PROMPT } from '../prompts/requirements.js';
3
+ import { CLARITY_REVIEW_SYSTEM_PROMPT, CLARITY_REWORK_SYSTEM_PROMPT } from '../prompts/clarity.js';
4
+ /** The currently-shipping version of each numbered prompt. */
5
+ export const PROMPT_VERSIONS = {
6
+ 'requirement-review': { id: 'requirement-review', version: 2, text: REVIEW_SYSTEM_PROMPT },
7
+ 'requirement-rework': { id: 'requirement-rework', version: 2, text: REWORK_SYSTEM_PROMPT },
8
+ 'clarity-review': { id: 'clarity-review', version: 1, text: CLARITY_REVIEW_SYSTEM_PROMPT },
9
+ 'clarity-rework': { id: 'clarity-rework', version: 1, text: CLARITY_REWORK_SYSTEM_PROMPT },
10
+ build: { id: 'build', version: 2, text: standardSystemPrompt('build') },
11
+ review: { id: 'review', version: 2, text: standardSystemPrompt('review') },
12
+ };
13
+ /** The current versioned prompt for an id. */
14
+ export function promptVersion(id) {
15
+ return PROMPT_VERSIONS[id];
16
+ }
17
+ /** The canonical `id@vN` label for a prompt id (or an explicit version). */
18
+ export function promptVersionLabel(id, version) {
19
+ const v = version ?? (id in PROMPT_VERSIONS ? PROMPT_VERSIONS[id].version : 1);
20
+ return `${id}@v${v}`;
21
+ }
22
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../src/agents/kinds/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAoBlG,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,oBAAoB,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC1F,oBAAoB,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC1F,gBAAgB,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE;IAC1F,gBAAgB,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE;IAC1F,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE;IACvE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EAAE;CACxB,CAAA;AAKpD,8CAA8C;AAC9C,MAAM,UAAU,aAAa,CAAC,EAAY;IACxC,OAAO,eAAe,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB,CAAC,EAAU,EAAE,OAAgB;IAC7D,MAAM,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,IAAI,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,EAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1F,OAAO,GAAG,EAAE,KAAK,CAAC,EAAE,CAAA;AACtB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { AgentKind } from '@cat-factory/kernel';
2
+ /** The single agent kind that builds external-dependency mocks. */
3
+ export declare const MOCK_AGENT_KIND = "mocker";
4
+ /** True when the agent kind is the mock-builder. */
5
+ export declare function isMockKind(kind: AgentKind): boolean;
6
+ /**
7
+ * The built-out system (role) prompt for the mock-builder agent kind, or
8
+ * `undefined` when the kind is not the mock builder (so callers can fall through
9
+ * to the standard phases / acceptance track / generic role).
10
+ */
11
+ export declare function mockSystemPrompt(kind: AgentKind): string | undefined;
12
+ //# sourceMappingURL=mock-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-prompts.d.ts","sourceRoot":"","sources":["../../src/agents/mock-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAiBpD,mEAAmE;AACnE,eAAO,MAAM,eAAe,WAAW,CAAA;AAmCvC,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAEpE"}
@@ -0,0 +1,61 @@
1
+ import { STANDARDS_FOOTER } from './prompt-shared.js';
2
+ // Built-out role prompt for the mock-builder agent. This kind stands up
3
+ // WireMock-based mocks for the external SERVICES a building block depends on, so
4
+ // the block can build, run and be tested locally and in CI without reaching real
5
+ // third parties — in particular so end-to-end / Playwright suites pass on GitHub
6
+ // Actions against the mocks rather than live APIs.
7
+ //
8
+ // Like the standard solution phases and the acceptance-testing track, "what the
9
+ // agent should do" lives here and "which extra standards apply" stays in
10
+ // @cat-factory/prompt-fragments: the prompt closes by deferring to the
11
+ // best-practice fragments that `composeSystemPrompt` appends below it. The
12
+ // dynamic run context (the block, its features, linked requirement docs and the
13
+ // prior agents' output — where the external dependencies surface) is folded in by
14
+ // the generic `userPromptFor`.
15
+ /** The single agent kind that builds external-dependency mocks. */
16
+ export const MOCK_AGENT_KIND = 'mocker';
17
+ const SYSTEM_PROMPT = [
18
+ 'You are an integration-test engineer owning the EXTERNAL-DEPENDENCY MOCKS for a building block.',
19
+ 'Your goal: make the service runnable and usable LOCALLY with just `docker-compose up` — every external service it depends on answered by a WireMock mock, so it builds, runs and can be exercised end to end without reaching any real third party. This is what lets the later Tester step actually run the service.',
20
+ '',
21
+ 'This is a HANDS-ON build step, not a write-up. You MUST inspect the repository, then create/extend the mock mappings, fixtures and wiring and COMMIT them. Do NOT merely restate what the implementer did, describe the dependencies in prose, or report "already covered" without having read the existing mappings and confirmed it. If the block calls external services that are not yet mocked, leaving them unmocked is a failure of this step. A commit with the new/updated mock files is the deliverable; the prose note is only a summary of what you committed.',
22
+ '',
23
+ 'Scope — services, not infrastructure:',
24
+ '- Mock external SERVICES the block depends on: third-party / partner HTTP APIs, payment, email / SMS, auth or identity providers, and other internal services reached over the network.',
25
+ '- Do NOT mock owned infrastructure (databases, caches, queues, object storage) — those run as real local instances (e.g. containers) wired into docker-compose, not WireMock.',
26
+ '',
27
+ 'Be incremental and additive:',
28
+ '- First discover what is already mocked: read the existing WireMock stub mappings, response fixtures and mock wiring already in the repository.',
29
+ '- Inventory the external calls the block actually makes — base URL, path, method, auth headers, request and response shapes — from the code and the design / prior work given to you.',
30
+ '- Add stubs ONLY for calls that are not mocked yet. Never duplicate, rewrite or delete an existing mapping; if an existing stub looks wrong, flag it rather than silently changing it.',
31
+ '',
32
+ 'WireMock best practices:',
33
+ '- One stub mapping per external operation; match on method + URL path, adding header / query / body matchers only where they are needed to disambiguate — keep matchers as loose as correctness allows so they are not brittle.',
34
+ '- Return realistic, schema-faithful response bodies and status codes; cover the success path plus the error and edge responses the block must handle (4xx, 5xx, rate limits, timeouts).',
35
+ '- Keep mappings deterministic and self-contained: prefer JSON mapping files (with response bodies in `__files`) checked into the repo over programmatic stubs, and reach for response templating only where a dynamic echo is genuinely required.',
36
+ '- Organise mappings per upstream service and name each one after the operation it stands in for, so coverage is easy to read.',
37
+ '- Add a low-priority catch-all stub that fails loudly on any unmatched request, so a new, yet-unmocked call is caught instead of silently passing.',
38
+ '- Never hard-code real secrets in stubs; assert on the presence / shape of auth headers, not their real values.',
39
+ '',
40
+ 'Hook the mocks up for local docker-compose and CI runs:',
41
+ "- Add the WireMock server to the service's docker-compose so a plain `docker-compose up` brings the mocks up alongside the real infra; point the block's external base URLs at it through environment variables / config, switched on for local dev and CI and off in production.",
42
+ '- Make it runnable in CI (e.g. a GitHub Actions service container or a start step) so end-to-end / Playwright tests pass on GHA against the mocks, waiting on a health check before the tests start.',
43
+ '- Document how to start the mocks and run the suite locally with the same configuration, so local and CI behave identically.',
44
+ '',
45
+ 'Commit the WireMock mapping files, the response fixtures and the docker-compose / config / wiring changes. Then, as your prose output, list each external service and which of its operations are now mocked, and call out any external call you deliberately left unmocked and why.',
46
+ '',
47
+ STANDARDS_FOOTER,
48
+ ].join('\n');
49
+ /** True when the agent kind is the mock-builder. */
50
+ export function isMockKind(kind) {
51
+ return kind === MOCK_AGENT_KIND;
52
+ }
53
+ /**
54
+ * The built-out system (role) prompt for the mock-builder agent kind, or
55
+ * `undefined` when the kind is not the mock builder (so callers can fall through
56
+ * to the standard phases / acceptance track / generic role).
57
+ */
58
+ export function mockSystemPrompt(kind) {
59
+ return isMockKind(kind) ? SYSTEM_PROMPT : undefined;
60
+ }
61
+ //# sourceMappingURL=mock-prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-prompts.js","sourceRoot":"","sources":["../../src/agents/mock-prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,wEAAwE;AACxE,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,mDAAmD;AACnD,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,uEAAuE;AACvE,2EAA2E;AAC3E,gFAAgF;AAChF,kFAAkF;AAClF,+BAA+B;AAE/B,mEAAmE;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA;AAEvC,MAAM,aAAa,GAAG;IACpB,iGAAiG;IACjG,uTAAuT;IACvT,EAAE;IACF,4iBAA4iB;IAC5iB,EAAE;IACF,uCAAuC;IACvC,yLAAyL;IACzL,+KAA+K;IAC/K,EAAE;IACF,8BAA8B;IAC9B,iJAAiJ;IACjJ,uLAAuL;IACvL,wLAAwL;IACxL,EAAE;IACF,0BAA0B;IAC1B,iOAAiO;IACjO,yLAAyL;IACzL,mPAAmP;IACnP,+HAA+H;IAC/H,oJAAoJ;IACpJ,iHAAiH;IACjH,EAAE;IACF,yDAAyD;IACzD,mRAAmR;IACnR,sMAAsM;IACtM,8HAA8H;IAC9H,EAAE;IACF,sRAAsR;IACtR,EAAE;IACF,gBAAgB;CACjB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,oDAAoD;AACpD,MAAM,UAAU,UAAU,CAAC,IAAe;IACxC,OAAO,IAAI,KAAK,eAAe,CAAA;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC9C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAA;AACrD,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** A block's fragment selection, as the prompt composer needs it. */
2
+ export interface ComposableBlock {
3
+ fragmentIds?: string[];
4
+ resolvedFragments?: {
5
+ id: string;
6
+ body: string;
7
+ }[];
8
+ }
9
+ export declare function composeSystemPrompt(baseSystem: string, fragmentIds?: string[]): string;
10
+ /**
11
+ * Compose the system prompt for a block, preferring the engine-resolved tenant
12
+ * catalog bodies when present and otherwise falling back to static id resolution.
13
+ * Both inline and container executors use this so the fragment-library feature
14
+ * applies uniformly to every agent kind, not just the reviewer.
15
+ */
16
+ export declare function composeBlockSystemPrompt(baseSystem: string, block: ComposableBlock): string;
17
+ //# sourceMappingURL=prompt-fragments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-fragments.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-fragments.ts"],"names":[],"mappings":"AAgBA,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,iBAAiB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACnD;AAcD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO,GAAG,MAAM,CAM1F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAQ3F"}
@@ -0,0 +1,33 @@
1
+ import { getFragment } from '@cat-factory/prompt-fragments';
2
+ /** Fold a set of fragment bodies into the base system prompt under a header. */
3
+ function foldStandards(baseSystem, bodies) {
4
+ if (bodies.length === 0)
5
+ return baseSystem;
6
+ return [
7
+ baseSystem,
8
+ '',
9
+ 'Follow these standards while doing the work:',
10
+ '',
11
+ bodies.join('\n\n'),
12
+ ].join('\n');
13
+ }
14
+ export function composeSystemPrompt(baseSystem, fragmentIds = []) {
15
+ const bodies = fragmentIds
16
+ .map((id) => getFragment(id))
17
+ .filter((fragment) => fragment !== undefined)
18
+ .map((fragment) => fragment.body);
19
+ return foldStandards(baseSystem, bodies);
20
+ }
21
+ /**
22
+ * Compose the system prompt for a block, preferring the engine-resolved tenant
23
+ * catalog bodies when present and otherwise falling back to static id resolution.
24
+ * Both inline and container executors use this so the fragment-library feature
25
+ * applies uniformly to every agent kind, not just the reviewer.
26
+ */
27
+ export function composeBlockSystemPrompt(baseSystem, block) {
28
+ if (block.resolvedFragments && block.resolvedFragments.length > 0) {
29
+ return foldStandards(baseSystem, block.resolvedFragments.map((f) => f.body));
30
+ }
31
+ return composeSystemPrompt(baseSystem, block.fragmentIds);
32
+ }
33
+ //# sourceMappingURL=prompt-fragments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-fragments.js","sourceRoot":"","sources":["../../src/agents/prompt-fragments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAsB3D,gFAAgF;AAChF,SAAS,aAAa,CAAC,UAAkB,EAAE,MAAgB;IACzD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,UAAU,CAAA;IAC1C,OAAO;QACL,UAAU;QACV,EAAE;QACF,8CAA8C;QAC9C,EAAE;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;KACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EAAE,WAAW,GAAa,EAAE;IAChF,MAAM,MAAM,GAAG,WAAW;SACvB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;SAC5B,MAAM,CAAC,CAAC,QAAQ,EAA4C,EAAE,CAAC,QAAQ,KAAK,SAAS,CAAC;SACtF,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACnC,OAAO,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAkB,EAAE,KAAsB;IACjF,IAAI,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,aAAa,CAClB,UAAU,EACV,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAC3C,CAAA;IACH,CAAC;IACD,OAAO,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;AAC3D,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Closing line every role prompt appends before `composeSystemPrompt` folds in
3
+ * the user's selected best-practice fragments — it tells the agent to treat those
4
+ * appended standards as hard requirements rather than optional suggestions.
5
+ */
6
+ export declare const STANDARDS_FOOTER = "Treat every best-practice standard appended below as a hard requirement, not a suggestion.";
7
+ //# sourceMappingURL=prompt-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-shared.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-shared.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,+FACiE,CAAA"}
@@ -0,0 +1,10 @@
1
+ // Shared constants used across the agent role prompts (standard solution phases,
2
+ // acceptance-testing track, business-logic track and the mock prompts). Kept here
3
+ // so the wording stays identical everywhere it is appended.
4
+ /**
5
+ * Closing line every role prompt appends before `composeSystemPrompt` folds in
6
+ * the user's selected best-practice fragments — it tells the agent to treat those
7
+ * appended standards as hard requirements rather than optional suggestions.
8
+ */
9
+ export const STANDARDS_FOOTER = 'Treat every best-practice standard appended below as a hard requirement, not a suggestion.';
10
+ //# sourceMappingURL=prompt-shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-shared.js","sourceRoot":"","sources":["../../src/agents/prompt-shared.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kFAAkF;AAClF,4DAA4D;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,4FAA4F,CAAA"}
@@ -0,0 +1,48 @@
1
+ export declare const REVIEW_SYSTEM_PROMPT: string;
2
+ /**
3
+ * The "requirements rework" agent. Given a block's collected requirements plus the
4
+ * answers / dismissals a human gave to the reviewer's findings, it folds everything
5
+ * into ONE self-contained requirements document. The output is emitted in a fixed,
6
+ * standard structure so the service-level spec-writer can aggregate it with
7
+ * minimal synthesis (it mirrors that writer's own expectations: "The system SHALL …"
8
+ * statements, MoSCoW priorities, Given/When/Then acceptance criteria, and
9
+ * cross-cutting domain rules). It must produce this standard document even when the
10
+ * reviewer raised no findings — so every task can carry a clean, writer-ready spec.
11
+ */
12
+ export declare const REWORK_SYSTEM_PROMPT: string;
13
+ /** A prompt under version control: its stable id, integer version and text. */
14
+ export interface VersionedPrompt {
15
+ id: string;
16
+ version: number;
17
+ text: string;
18
+ }
19
+ /** The currently-shipping version of each numbered prompt. */
20
+ export declare const PROMPT_VERSIONS: {
21
+ readonly 'requirement-review': {
22
+ readonly id: 'requirement-review';
23
+ readonly version: 1;
24
+ readonly text: string;
25
+ };
26
+ readonly 'requirement-rework': {
27
+ readonly id: 'requirement-rework';
28
+ readonly version: 1;
29
+ readonly text: string;
30
+ };
31
+ readonly build: {
32
+ readonly id: 'build';
33
+ readonly version: 2;
34
+ readonly text: string;
35
+ };
36
+ readonly review: {
37
+ readonly id: 'review';
38
+ readonly version: 1;
39
+ readonly text: string;
40
+ };
41
+ };
42
+ /** Ids of the prompts currently under version control. */
43
+ export type PromptId = keyof typeof PROMPT_VERSIONS;
44
+ /** The current versioned prompt for an id. */
45
+ export declare function promptVersion(id: PromptId): VersionedPrompt;
46
+ /** The canonical `id@vN` label for a prompt id (or an explicit version). */
47
+ export declare function promptVersionLabel(id: string, version?: number): string;
48
+ //# sourceMappingURL=prompt-versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-versions.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-versions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,QAO8B,CAAA;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAoBF,CAAA;AAY/B,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe;;iBACF,EAAE,EAAE,oBAAoB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC1C,EAAE,EAAE,oBAAoB;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBACzD,EAAE,EAAE,OAAO;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;;iBAC5B,EAAE,EAAE,QAAQ;iBAAE,OAAO,EAAE,CAAC;iBAAE,IAAI;;CACU,CAAA;AAEpD,0DAA0D;AAC1D,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,eAAe,CAAA;AAEnD,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,eAAe,CAE3D;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvE"}
@@ -0,0 +1,55 @@
1
+ import { standardSystemPrompt } from './standard-prompts.js';
2
+ export const REVIEW_SYSTEM_PROMPT = 'You are a meticulous product / requirements analyst reviewing the collected ' +
3
+ 'requirements for a single unit of software work before an engineer starts on it. ' +
4
+ 'Surface everything that would block confident implementation: missing information ' +
5
+ '(gaps), ambiguities that need clarification, unstated assumptions, risks, and open ' +
6
+ 'questions. Be specific, concrete and actionable, and phrase each item so a product ' +
7
+ 'owner can answer it directly. Do NOT invent answers or requirements. ' +
8
+ 'Respond with ONLY a JSON object — no prose, no code fences.';
9
+ /**
10
+ * The "requirements rework" agent. Given a block's collected requirements plus the
11
+ * answers / dismissals a human gave to the reviewer's findings, it folds everything
12
+ * into ONE self-contained requirements document. The output is emitted in a fixed,
13
+ * standard structure so the service-level spec-writer can aggregate it with
14
+ * minimal synthesis (it mirrors that writer's own expectations: "The system SHALL …"
15
+ * statements, MoSCoW priorities, Given/When/Then acceptance criteria, and
16
+ * cross-cutting domain rules). It must produce this standard document even when the
17
+ * reviewer raised no findings — so every task can carry a clean, writer-ready spec.
18
+ */
19
+ export const REWORK_SYSTEM_PROMPT = 'You are a requirements editor. You are given the current collected requirements ' +
20
+ 'for a single unit of software work, plus any clarifying questions and the answers ' +
21
+ 'a human gave. Produce a revised, self-contained requirements document in Markdown ' +
22
+ 'that folds every answer in, resolves the ambiguities, and states the ' +
23
+ 'previously-missing details explicitly. Preserve the original intent; do not invent ' +
24
+ 'facts beyond what the answers provide. Even when there are no questions, restate ' +
25
+ 'the requirements cleanly in the SAME standard structure. Use EXACTLY these Markdown ' +
26
+ 'sections, in this order, omitting a section only when it has no content:\n' +
27
+ '# <Title> — Requirements\n' +
28
+ '## Overview — one paragraph of intent and scope.\n' +
29
+ '## Functional Requirements — a bullet per requirement phrased as "The system SHALL ' +
30
+ '…", each tagged with a MoSCoW priority (must/should/could); under each, an ' +
31
+ '"Acceptance:" sub-list of Given/When/Then criteria.\n' +
32
+ '## Non-Functional Requirements — quality attributes, same "The system SHALL …" ' +
33
+ 'phrasing with a priority and a short rationale.\n' +
34
+ '## Domain Rules / Constraints — cross-cutting invariants, each with a brief why.\n' +
35
+ '## Assumptions — assumptions the requirements rest on.\n' +
36
+ '## Out of Scope — what this work explicitly does not cover.\n' +
37
+ 'Respond with ONLY the revised requirements in Markdown — no preamble, no ' +
38
+ 'commentary, no code fences.';
39
+ /** The currently-shipping version of each numbered prompt. */
40
+ export const PROMPT_VERSIONS = {
41
+ 'requirement-review': { id: 'requirement-review', version: 1, text: REVIEW_SYSTEM_PROMPT },
42
+ 'requirement-rework': { id: 'requirement-rework', version: 1, text: REWORK_SYSTEM_PROMPT },
43
+ build: { id: 'build', version: 2, text: standardSystemPrompt('build') },
44
+ review: { id: 'review', version: 1, text: standardSystemPrompt('review') },
45
+ };
46
+ /** The current versioned prompt for an id. */
47
+ export function promptVersion(id) {
48
+ return PROMPT_VERSIONS[id];
49
+ }
50
+ /** The canonical `id@vN` label for a prompt id (or an explicit version). */
51
+ export function promptVersionLabel(id, version) {
52
+ const v = version ?? (id in PROMPT_VERSIONS ? PROMPT_VERSIONS[id].version : 1);
53
+ return `${id}@v${v}`;
54
+ }
55
+ //# sourceMappingURL=prompt-versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-versions.js","sourceRoot":"","sources":["../../src/agents/prompt-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAC/B,8EAA8E;IAC9E,mFAAmF;IACnF,oFAAoF;IACpF,qFAAqF;IACrF,qFAAqF;IACrF,uEAAuE;IACvE,6DAA6D,CAAA;AAE/D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,kFAAkF;IAClF,oFAAoF;IACpF,oFAAoF;IACpF,uEAAuE;IACvE,qFAAqF;IACrF,mFAAmF;IACnF,sFAAsF;IACtF,4EAA4E;IAC5E,4BAA4B;IAC5B,oDAAoD;IACpD,qFAAqF;IACrF,6EAA6E;IAC7E,uDAAuD;IACvD,iFAAiF;IACjF,mDAAmD;IACnD,oFAAoF;IACpF,0DAA0D;IAC1D,+DAA+D;IAC/D,2EAA2E;IAC3E,6BAA6B,CAAA;AAmB/B,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,oBAAoB,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC1F,oBAAoB,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC1F,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE;IACvE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EAAE;CACxB,CAAA;AAKpD,8CAA8C;AAC9C,MAAM,UAAU,aAAa,CAAC,EAAY;IACxC,OAAO,eAAe,CAAC,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB,CAAC,EAAU,EAAE,OAAgB;IAC7D,MAAM,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,IAAI,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,EAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1F,OAAO,GAAG,EAAE,KAAK,CAAC,EAAE,CAAA;AACtB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { AgentKind } from '@cat-factory/kernel';
2
+ import type { AgentRunContext } from '@cat-factory/kernel';
3
+ /** The agent kinds that make up the acceptance-testing track. */
4
+ export type AcceptanceAgentKind = 'playwright';
5
+ export declare const ACCEPTANCE_AGENT_KINDS: readonly AcceptanceAgentKind[];
6
+ /** True when the agent kind is part of the acceptance-testing track. */
7
+ export declare function isAcceptanceKind(kind: AgentKind): kind is AcceptanceAgentKind;
8
+ /**
9
+ * The built-out system (role) prompt for an acceptance-testing agent kind, or
10
+ * `undefined` when the kind is not part of this track (so callers can fall
11
+ * through to the standard phases / generic role).
12
+ */
13
+ export declare function acceptanceSystemPrompt(kind: AgentKind): string | undefined;
14
+ /**
15
+ * The "where do the tests run" section for an acceptance-testing step, rendered
16
+ * from the block's contributed `playwright.e2eTarget` config value. Empty for
17
+ * non-track kinds or when no target is recorded, so callers can append it
18
+ * unconditionally.
19
+ */
20
+ export declare function e2eTargetSection(context: AgentRunContext): string;
21
+ /**
22
+ * The "how should these tests be written" section for the runnable-tests step
23
+ * (`playwright` kind), chosen from the block type: Playwright for user-facing
24
+ * blocks, the project's own test framework for backend blocks. Empty for the
25
+ * scenario-writing step and any non-track kind, so callers can append it
26
+ * unconditionally. The scenario author stays framework-agnostic by design.
27
+ */
28
+ export declare function testApproachSection(context: AgentRunContext): string;
29
+ //# sourceMappingURL=acceptance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAwB1D,iEAAiE;AACjE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAA;AAE9C,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAAmB,CAAA;AAsCpF,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI,mBAAmB,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE1E;AAoBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAMjE;AAqBD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAIpE"}
@@ -0,0 +1,112 @@
1
+ import { PLATFORM_DELIVERY_CONTRACT } from './delivery-contract.js';
2
+ import { PLAYWRIGHT_E2E_TARGET_CONFIG_ID } from '../kinds/configs.js';
3
+ import { STANDARDS_FOOTER } from './shared.js';
4
+ export const ACCEPTANCE_AGENT_KINDS = ['playwright'];
5
+ // The runnable-tests step commits tests through a pull request. Tests only earn
6
+ // their keep once they actually run in CI, so "done" means the suite is wired into
7
+ // the project's CI configuration AND passes locally. The agent does NOT push or wait
8
+ // on CI itself (it has no push credentials) — the platform pushes, opens the PR and
9
+ // drives CI per the shared PLATFORM_DELIVERY_CONTRACT; the agent's job is to author
10
+ // the tests and hook them into the CI config.
11
+ const PLAYWRIGHT_DELIVERY_GATE = [
12
+ 'Definition of done: the acceptance tests are written, wired into the project CI configuration, and pass when you run them locally.',
13
+ '- Make sure the suite is actually hooked into the project CI workflow: confirm the workflow executes this suite on a pull request, and add or update the CI configuration if it does not yet run them. (Editing the CI config is part of the work; running CI is not — the platform does that.)',
14
+ PLATFORM_DELIVERY_CONTRACT,
15
+ ].join('\n');
16
+ const SYSTEM_PROMPTS = {
17
+ playwright: [
18
+ 'You are a test automation engineer owning the runnable ACCEPTANCE TESTS for a building block.',
19
+ 'Translate the agreed acceptance scenarios into runnable tests that live in the repository.',
20
+ '',
21
+ 'Pick the test tool to match the surface under test:',
22
+ '- Frontend / user-facing UI: write Playwright end-to-end tests that drive the app through the browser.',
23
+ "- Backend (services, APIs, queues, integrations, data): write the acceptance tests with the project's EXISTING test framework — discover it from the repository (test config, dev dependencies, the tests already present) and match it. Do not pull in Playwright or a browser for behaviour that has no UI.",
24
+ 'The run context below states the test approach for this specific block; follow it.',
25
+ '',
26
+ 'Approach:',
27
+ '- Treat the acceptance scenarios as the source of truth: prefer the Gherkin scenarios in `spec/features/*.feature` when present (each `Scenario` becomes one runnable test, named after it), else the scenarios provided above. One test per scenario so the mapping is obvious.',
28
+ '- Be additive and idempotent: only create tests for scenarios that do not already have one; never duplicate or silently rewrite an existing test.',
29
+ '- Exercise the system through its outermost interface and assert on observable behaviour — user-facing locators (roles, labels, text) for UI, public API / HTTP / message contracts for backend — never on internal implementation.',
30
+ '- Keep tests isolated and deterministic: no shared mutable state, await every action, and rely on auto-retrying assertions instead of fixed sleeps.',
31
+ '- Reach the system under test at the URL / entry point from the run context; read any access credentials from the harness, never hard-code secrets.',
32
+ '- Output the test files to commit, each in the conventional test directory for its tool (e.g. the e2e/Playwright directory for UI tests), ready to run in CI.',
33
+ '',
34
+ PLAYWRIGHT_DELIVERY_GATE,
35
+ '',
36
+ STANDARDS_FOOTER,
37
+ ].join('\n'),
38
+ };
39
+ /** True when the agent kind is part of the acceptance-testing track. */
40
+ export function isAcceptanceKind(kind) {
41
+ return kind === 'playwright';
42
+ }
43
+ /**
44
+ * The built-out system (role) prompt for an acceptance-testing agent kind, or
45
+ * `undefined` when the kind is not part of this track (so callers can fall
46
+ * through to the standard phases / generic role).
47
+ */
48
+ export function acceptanceSystemPrompt(kind) {
49
+ return isAcceptanceKind(kind) ? SYSTEM_PROMPTS[kind] : undefined;
50
+ }
51
+ // Where the generated tests run is a per-block choice, so it is dynamic context
52
+ // rather than part of the static role prompt. These blurbs tell the agent how
53
+ // to wire and where to point the tests for each target.
54
+ const TEST_TARGET_GUIDANCE = {
55
+ ci: [
56
+ 'Test execution target: project CI (GitHub Actions).',
57
+ '- Add the tests to the project so they run in a GitHub Actions workflow on each push / pull request.',
58
+ '- Spin the system under test up inside the same workflow run (e.g. a build/start step or a `services:` container) and wait for it to be healthy before the tests run.',
59
+ '- Point Playwright at the locally started service (e.g. http://localhost:<port>) via its config/baseURL; do not rely on an external environment.',
60
+ ].join('\n'),
61
+ ephemeral: [
62
+ 'Test execution target: the provisioned ephemeral environment for this run.',
63
+ '- Run the tests against the ephemeral environment URL from the run context, not a locally started service.',
64
+ '- Read any access credentials for that environment from the test harness/secrets; never hard-code them.',
65
+ '- Assume the environment is already deployed and healthy before the tests start.',
66
+ ].join('\n'),
67
+ };
68
+ /**
69
+ * The "where do the tests run" section for an acceptance-testing step, rendered
70
+ * from the block's contributed `playwright.e2eTarget` config value. Empty for
71
+ * non-track kinds or when no target is recorded, so callers can append it
72
+ * unconditionally.
73
+ */
74
+ export function e2eTargetSection(context) {
75
+ if (!isAcceptanceKind(context.agentKind))
76
+ return '';
77
+ const raw = context.block.agentConfig?.[PLAYWRIGHT_E2E_TARGET_CONFIG_ID];
78
+ const target = raw === 'ci' || raw === 'ephemeral' ? raw : undefined;
79
+ if (!target)
80
+ return '';
81
+ return `\n${TEST_TARGET_GUIDANCE[target]}`;
82
+ }
83
+ // Block types whose behaviour is exercised through a browser UI, so the runnable
84
+ // tests should be Playwright e2e. Everything else is backend behaviour that gets
85
+ // tested with the project's own framework. Mirrors how the `playwright.e2e`
86
+ // best-practice fragment is scoped in @cat-factory/prompt-fragments.
87
+ const UI_BLOCK_TYPES = ['frontend', 'environment'];
88
+ const UI_TEST_APPROACH = [
89
+ 'Test approach for this block: Playwright end-to-end tests.',
90
+ '- This block has a user-facing surface, so cover its scenarios with Playwright tests that drive the app through the browser.',
91
+ '- Select elements by user-facing locators (getByRole, getByLabel, getByText) and assert on what the user observes.',
92
+ ].join('\n');
93
+ const BACKEND_TEST_APPROACH = [
94
+ "Test approach for this block: the project's existing test framework (do NOT use Playwright).",
95
+ '- This block has no user-facing UI, so do not add Playwright or a browser to it.',
96
+ "- Discover the test framework already used in the repository (test config, dev dependencies, the tests already present) and write the acceptance tests with it, matching the project's conventions.",
97
+ '- Drive the system through its public interface (API / HTTP calls, queue messages, exported functions) and assert on observable behaviour, never on internals.',
98
+ ].join('\n');
99
+ /**
100
+ * The "how should these tests be written" section for the runnable-tests step
101
+ * (`playwright` kind), chosen from the block type: Playwright for user-facing
102
+ * blocks, the project's own test framework for backend blocks. Empty for the
103
+ * scenario-writing step and any non-track kind, so callers can append it
104
+ * unconditionally. The scenario author stays framework-agnostic by design.
105
+ */
106
+ export function testApproachSection(context) {
107
+ if (context.agentKind !== 'playwright')
108
+ return '';
109
+ const isUi = UI_BLOCK_TYPES.includes(context.block.type);
110
+ return `\n${isUi ? UI_TEST_APPROACH : BACKEND_TEST_APPROACH}`;
111
+ }
112
+ //# sourceMappingURL=acceptance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptance.js","sourceRoot":"","sources":["../../../src/agents/prompts/acceptance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAwB9C,MAAM,CAAC,MAAM,sBAAsB,GAAmC,CAAC,YAAY,CAAC,CAAA;AAEpF,gFAAgF;AAChF,mFAAmF;AACnF,qFAAqF;AACrF,oFAAoF;AACpF,oFAAoF;AACpF,8CAA8C;AAC9C,MAAM,wBAAwB,GAAG;IAC/B,oIAAoI;IACpI,iSAAiS;IACjS,0BAA0B;CAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,cAAc,GAAwC;IAC1D,UAAU,EAAE;QACV,+FAA+F;QAC/F,4FAA4F;QAC5F,EAAE;QACF,qDAAqD;QACrD,wGAAwG;QACxG,+SAA+S;QAC/S,oFAAoF;QACpF,EAAE;QACF,WAAW;QACX,kRAAkR;QAClR,mJAAmJ;QACnJ,qOAAqO;QACrO,qJAAqJ;QACrJ,qJAAqJ;QACrJ,+JAA+J;QAC/J,EAAE;QACF,wBAAwB;QACxB,EAAE;QACF,gBAAgB;KACjB,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAA;AAED,wEAAwE;AACxE,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC9C,OAAO,IAAI,KAAK,YAAY,CAAA;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAe;IACpD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAClE,CAAC;AAED,gFAAgF;AAChF,8EAA8E;AAC9E,wDAAwD;AACxD,MAAM,oBAAoB,GAA8B;IACtD,EAAE,EAAE;QACF,qDAAqD;QACrD,sGAAsG;QACtG,uKAAuK;QACvK,kJAAkJ;KACnJ,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,SAAS,EAAE;QACT,4EAA4E;QAC5E,4GAA4G;QAC5G,yGAAyG;QACzG,kFAAkF;KACnF,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAwB;IACvD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,CAAA;IACnD,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,+BAA+B,CAAC,CAAA;IACxE,MAAM,MAAM,GAA0B,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3F,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAA;IACtB,OAAO,KAAK,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAA;AAC5C,CAAC;AAED,iFAAiF;AACjF,iFAAiF;AACjF,4EAA4E;AAC5E,qEAAqE;AACrE,MAAM,cAAc,GAAyB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;AAExE,MAAM,gBAAgB,GAAG;IACvB,4DAA4D;IAC5D,8HAA8H;IAC9H,oHAAoH;CACrH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,qBAAqB,GAAG;IAC5B,8FAA8F;IAC9F,kFAAkF;IAClF,qMAAqM;IACrM,gKAAgK;CACjK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAwB;IAC1D,IAAI,OAAO,CAAC,SAAS,KAAK,YAAY;QAAE,OAAO,EAAE,CAAA;IACjD,MAAM,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACxD,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAAA;AAC/D,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { AgentKind } from '@cat-factory/kernel';
2
+ /** The agent kinds that make up the business-logic / domain-rules track. */
3
+ export type BusinessLogicAgentKind = 'business-documenter' | 'business-reviewer';
4
+ export declare const BUSINESS_LOGIC_AGENT_KINDS: readonly BusinessLogicAgentKind[];
5
+ /**
6
+ * The kind that writes/updates the documentation. Repo-operating: the worker
7
+ * routes it to the container executor (see `CONTAINER_KINDS`) so it can read the
8
+ * checkout and commit the docs through a pull request.
9
+ */
10
+ export declare const BUSINESS_DOCUMENTER_KIND: BusinessLogicAgentKind;
11
+ /** The kind that reviews a change against the documented rules. Inline. */
12
+ export declare const BUSINESS_REVIEWER_KIND: BusinessLogicAgentKind;
13
+ /**
14
+ * Canonical in-repo home for the documentation this track produces and reviews
15
+ * against. Both prompts reference it so the documenter writes where the reviewer
16
+ * later looks. An established location already present in the repo wins over this
17
+ * default — the prompts tell the agents to respect one if they find it.
18
+ */
19
+ export declare const BUSINESS_LOGIC_DOCS_DIR = "docs/business-logic";
20
+ /** True when the agent kind is part of the business-logic / domain-rules track. */
21
+ export declare function isBusinessLogicKind(kind: AgentKind): kind is BusinessLogicAgentKind;
22
+ /**
23
+ * The built-out system (role) prompt for a business-logic agent kind, or
24
+ * `undefined` when the kind is not part of this track (so callers can fall
25
+ * through to the standard phases / acceptance track / mock builder / generic role).
26
+ */
27
+ export declare function businessLogicSystemPrompt(kind: AgentKind): string | undefined;
28
+ //# sourceMappingURL=business-logic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business-logic.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/business-logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AA2BpD,4EAA4E;AAC5E,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG,mBAAmB,CAAA;AAEhF,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAGvE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,sBAA8C,CAAA;AAErF,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,EAAE,sBAA4C,CAAA;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAoE5D,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI,sBAAsB,CAEnF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7E"}