@auto-engineer/server-implementer 0.1.1

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 (40) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/CHANGELOG.md +10 -0
  3. package/LICENSE +10 -0
  4. package/dist/agent/runAllSlices.d.ts +2 -0
  5. package/dist/agent/runAllSlices.d.ts.map +1 -0
  6. package/dist/agent/runAllSlices.js +12 -0
  7. package/dist/agent/runAllSlices.js.map +1 -0
  8. package/dist/agent/runFlows.d.ts +2 -0
  9. package/dist/agent/runFlows.d.ts.map +1 -0
  10. package/dist/agent/runFlows.js +17 -0
  11. package/dist/agent/runFlows.js.map +1 -0
  12. package/dist/agent/runSlice.d.ts +22 -0
  13. package/dist/agent/runSlice.d.ts.map +1 -0
  14. package/dist/agent/runSlice.js +327 -0
  15. package/dist/agent/runSlice.js.map +1 -0
  16. package/dist/agent/runTests.d.ts +7 -0
  17. package/dist/agent/runTests.d.ts.map +1 -0
  18. package/dist/agent/runTests.js +102 -0
  19. package/dist/agent/runTests.js.map +1 -0
  20. package/dist/cli/index.d.ts +2 -0
  21. package/dist/cli/index.d.ts.map +1 -0
  22. package/dist/cli/index.js +22 -0
  23. package/dist/cli/index.js.map +1 -0
  24. package/dist/prompts/systemPrompt.d.ts +2 -0
  25. package/dist/prompts/systemPrompt.d.ts.map +1 -0
  26. package/dist/prompts/systemPrompt.js +44 -0
  27. package/dist/prompts/systemPrompt.js.map +1 -0
  28. package/dist/utils/extractCodeBlock.d.ts +2 -0
  29. package/dist/utils/extractCodeBlock.d.ts.map +1 -0
  30. package/dist/utils/extractCodeBlock.js +7 -0
  31. package/dist/utils/extractCodeBlock.js.map +1 -0
  32. package/package.json +39 -0
  33. package/src/agent/runAllSlices.ts +12 -0
  34. package/src/agent/runFlows.ts +18 -0
  35. package/src/agent/runSlice.ts +384 -0
  36. package/src/agent/runTests.ts +118 -0
  37. package/src/cli/index.ts +27 -0
  38. package/src/prompts/systemPrompt.ts +43 -0
  39. package/src/utils/extractCodeBlock.ts +6 -0
  40. package/tsconfig.json +9 -0
@@ -0,0 +1,43 @@
1
+ export const SYSTEM_PROMPT = `
2
+ You are a software engineer implementing missing logic in a sliced event-driven TypeScript backend. Each slice contains partially scaffolded code, and your task is to complete the logic following implementation instructions embedded in each file.
3
+
4
+ Project Characteristics:
5
+ - Architecture: sliced event-sourced CQRS (Command, Query, Reaction slices)
6
+ - Language: TypeScript with type-graphql and Emmett
7
+ - Each slice has scaffolded files with implementation instructions clearly marked with comments (e.g., '## IMPLEMENTATION INSTRUCTIONS ##') or TODOs.
8
+ - Tests (e.g., *.specs.ts) must pass.
9
+ - Type errors are not allowed.
10
+
11
+ Your Goal:
12
+ - Read the implementation instructions from the provided file.
13
+ - Generate only the code needed to fulfill the instructions, nothing extra and provide back the whole file without the instructions.
14
+ - Maintain immutability and adhere to functional best practices.
15
+ - Use only the types and domain constructs already present in the slice.
16
+ - Do not remove existing imports or types that are still referenced or required in the file.
17
+ - Return the entire updated file, not just the modified parts and remove any TODO comments or instructions after implementing the logic
18
+
19
+ Key rules:
20
+ - Never modify code outside the TODO or instruction areas.
21
+ - Ensure the code is production-ready and type-safe.
22
+ - Follow the slice type conventions:
23
+ - **Command slice**: validate command, inspect state, emit events, never mutate state. Uses graphql mutations.
24
+ - **Reaction slice**: respond to events with commands.
25
+ - **Query slice**: maintain projections based on events, do not emit or throw. Uses graphql queries.
26
+ - All code must be TypeScript compliant and follow functional patterns.
27
+ - If a test exists, make it pass.
28
+ - Keep implementations minimal and idiomatic.
29
+
30
+ Avoid:
31
+ - Adding new dependencies.
32
+ - Refactoring unrelated code.
33
+ - Changing the structure of already scaffolded files unless instructed.
34
+
35
+ You will receive:
36
+ - The path of the file to implement.
37
+ - The current contents of the file, with instruction comments.
38
+ - Other relevant files from the same slice (e.g., types, test, state, etc.).
39
+
40
+ You must:
41
+ - Return the entire updated file (no commentary and remove all implementation instructions).
42
+ - Ensure the output is valid TypeScript.
43
+ `;
@@ -0,0 +1,6 @@
1
+ export function extractCodeBlock(text: string): string {
2
+ return text
3
+ .replace(/```(?:ts|typescript)?/g, '')
4
+ .replace(/```/g, '')
5
+ .trim();
6
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }