@omaikit/agents 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +17 -0
  2. package/dist/ai-provider/openai.d.ts +2 -2
  3. package/dist/ai-provider/openai.d.ts.map +1 -1
  4. package/dist/ai-provider/openai.js +38 -111
  5. package/dist/ai-provider/openai.js.map +1 -1
  6. package/dist/ai-provider/provider.d.ts +7 -6
  7. package/dist/ai-provider/provider.d.ts.map +1 -1
  8. package/dist/analysis/cache-manager.d.ts +9 -0
  9. package/dist/analysis/cache-manager.d.ts.map +1 -0
  10. package/dist/analysis/cache-manager.js +33 -0
  11. package/dist/analysis/cache-manager.js.map +1 -0
  12. package/dist/analysis/context-writer.d.ts +29 -0
  13. package/dist/analysis/context-writer.d.ts.map +1 -0
  14. package/dist/analysis/context-writer.js +168 -0
  15. package/dist/analysis/context-writer.js.map +1 -0
  16. package/dist/analysis/index.d.ts +5 -0
  17. package/dist/analysis/index.d.ts.map +1 -0
  18. package/dist/analysis/index.js +5 -0
  19. package/dist/analysis/index.js.map +1 -0
  20. package/dist/analysis/plan-writer.d.ts +11 -0
  21. package/dist/analysis/plan-writer.d.ts.map +1 -0
  22. package/dist/analysis/plan-writer.js +87 -0
  23. package/dist/analysis/plan-writer.js.map +1 -0
  24. package/dist/analysis/test-writer.d.ts +9 -0
  25. package/dist/analysis/test-writer.d.ts.map +1 -0
  26. package/dist/analysis/test-writer.js +42 -0
  27. package/dist/analysis/test-writer.js.map +1 -0
  28. package/dist/coder/coder.d.ts.map +1 -1
  29. package/dist/coder/coder.js +27 -38
  30. package/dist/coder/coder.js.map +1 -1
  31. package/dist/coder/prompt-templates.d.ts +1 -1
  32. package/dist/coder/prompt-templates.d.ts.map +1 -1
  33. package/dist/coder/prompt-templates.js +25 -60
  34. package/dist/coder/prompt-templates.js.map +1 -1
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/manager/manager.d.ts.map +1 -1
  40. package/dist/manager/manager.js +5 -16
  41. package/dist/manager/manager.js.map +1 -1
  42. package/dist/planner/clarification-handler.d.ts.map +1 -1
  43. package/dist/planner/clarification-handler.js +2 -12
  44. package/dist/planner/clarification-handler.js.map +1 -1
  45. package/dist/planner/plan-parser.d.ts.map +1 -1
  46. package/dist/planner/plan-parser.js +33 -31
  47. package/dist/planner/plan-parser.js.map +1 -1
  48. package/dist/planner/planner.d.ts +3 -7
  49. package/dist/planner/planner.d.ts.map +1 -1
  50. package/dist/planner/planner.js +77 -230
  51. package/dist/planner/planner.js.map +1 -1
  52. package/dist/planner/prompt-templates.d.ts +4 -2
  53. package/dist/planner/prompt-templates.d.ts.map +1 -1
  54. package/dist/planner/prompt-templates.js +38 -137
  55. package/dist/planner/prompt-templates.js.map +1 -1
  56. package/dist/tester/prompt-templates.d.ts.map +1 -1
  57. package/dist/tester/prompt-templates.js +14 -21
  58. package/dist/tester/prompt-templates.js.map +1 -1
  59. package/dist/tools/list-files.d.ts.map +1 -1
  60. package/dist/tools/list-files.js +8 -1
  61. package/dist/tools/list-files.js.map +1 -1
  62. package/dist/tools/registry.js +1 -1
  63. package/dist/tools/registry.js.map +1 -1
  64. package/dist/tools/utils.d.ts.map +1 -1
  65. package/dist/tools/utils.js +34 -3
  66. package/dist/tools/utils.js.map +1 -1
  67. package/dist/utils/cache-manager.d.ts +9 -0
  68. package/dist/utils/cache-manager.d.ts.map +1 -0
  69. package/dist/utils/cache-manager.js +33 -0
  70. package/dist/utils/cache-manager.js.map +1 -0
  71. package/dist/utils/context-writer.d.ts +29 -0
  72. package/dist/utils/context-writer.d.ts.map +1 -0
  73. package/dist/utils/context-writer.js +168 -0
  74. package/dist/utils/context-writer.js.map +1 -0
  75. package/dist/utils/index.d.ts +7 -0
  76. package/dist/utils/index.d.ts.map +1 -0
  77. package/dist/utils/index.js +7 -0
  78. package/dist/utils/index.js.map +1 -0
  79. package/dist/utils/plan-writer.d.ts +17 -0
  80. package/dist/utils/plan-writer.d.ts.map +1 -0
  81. package/dist/utils/plan-writer.js +175 -0
  82. package/dist/utils/plan-writer.js.map +1 -0
  83. package/dist/utils/prompt.d.ts +3 -0
  84. package/dist/utils/prompt.d.ts.map +1 -0
  85. package/dist/utils/prompt.js +55 -0
  86. package/dist/utils/prompt.js.map +1 -0
  87. package/dist/utils/test-writer.d.ts +9 -0
  88. package/dist/utils/test-writer.d.ts.map +1 -0
  89. package/dist/utils/test-writer.js +42 -0
  90. package/dist/utils/test-writer.js.map +1 -0
  91. package/package.json +3 -3
  92. package/prompts/coder/task.md +59 -0
  93. package/prompts/manager/context.md +11 -0
  94. package/prompts/planner/clarification.md +12 -0
  95. package/prompts/planner/clarification.questions.md +10 -0
  96. package/prompts/planner/optimize.md +75 -0
  97. package/prompts/planner/plan-milestones.md +73 -0
  98. package/prompts/planner/repair.md +6 -0
  99. package/prompts/planner/summary.md +22 -0
  100. package/prompts/planner/system.md +4 -0
  101. package/prompts/planner/tasks.md +82 -0
  102. package/prompts/tester/prompt.md +19 -0
@@ -0,0 +1,10 @@
1
+ - What is the primary use case or business goal?
2
+ - Who are the target users?
3
+ - What are the key success criteria?
4
+ - Are there any existing systems to integrate with?
5
+ - What is the expected timeline?
6
+ - What is the budget or resource constraints?
7
+ - Are there specific technology requirements?
8
+ - What about performance or scale requirements?
9
+ - Is this a greenfield project or enhancement?
10
+ - What are the security and compliance requirements?
@@ -0,0 +1,75 @@
1
+ You are an expert project planner. Step 3: re-analyze and optimize the entire plan.
2
+
3
+ Execution phases (strict):
4
+
5
+ PHASE 1 – Discover and load the current plan and task files:
6
+ 1. Use list_files to inspect the filesystem (starting from the project root in context).
7
+ 2. Use list_files on ".omaikit/plans" to identify existing plan files and determine N (the same N used in previous steps).
8
+ 3. Use read_file on ".omaikit/plans/P{NNN}.json" to:
9
+ - Confirm the exact current JSON structure.
10
+ - Load all milestones and tasks for analysis.
11
+ 4. Use list_files on ".omaikit/tasks" to locate task files for the plan.
12
+ 5. Use read_file on each task file to load task details.
13
+ 6. Optionally use search_text ONLY to gather additional technical or structural context from other project files, but do NOT modify those files.
14
+
15
+ PHASE 2 – Analyze and optimize:
16
+ 1. Analyze the loaded plan and corresponding task files to identify:
17
+ - Redundant or overlapping tasks.
18
+ - Overly complex or unnecessary dependencies.
19
+ - Vague or ambiguous titles and descriptions.
20
+ - Inconsistent or incorrect targetModule / affectedModules paths.
21
+ - Imbalanced milestones (too heavy or too light vs. others).
22
+ 2. Optimize the task set by updating the in-memory task objects that map directly to existing task files:
23
+ - Remove or merge redundant tasks where appropriate by updating their existing task files (e.g. status, description, dependencies). Do NOT create any new plan or milestone records.
24
+ - Simplify and correct dependencies so they are:
25
+ - Minimal (no unnecessary links).
26
+ - Correct (match the logical execution order).
27
+ - Acyclic (no circular dependencies).
28
+ - Improve task titles and descriptions for clarity and actionability.
29
+ - Adjust targetModule and affectedModules so they align with the actual or intended project structure.
30
+ - Re-balance milestones so that scope and effort are realistic and consistent across the plan, using only fields available in the existing task files.
31
+
32
+ PHASE 3 – Persist the optimized tasks:
33
+ 1. After optimization, use edit_file ONLY to update the task files under ".omaikit/tasks".
34
+ 2. Do NOT modify ".omaikit/plans/P{NNN}.json" in this step.
35
+ 3. Do NOT create any new plan files (e.g. no new ".omaikit/plans/PXXX.json" or alternative plan structures).
36
+
37
+ Tool usage requirements (mandatory):
38
+ - Use list_files to list files or find files by glob pattern (start from the project root from context).
39
+ - Use search_text to search content within files when project context is needed.
40
+ - Use read_file to inspect exact file contents and confirm the current structure of ".omaikit/plans/P{NNN}.json" BEFORE optimizing.
41
+ - Use read_file to inspect current task files under ".omaikit/tasks" BEFORE editing them.
42
+ - Use edit_file ONLY to update files under ".omaikit/tasks".
43
+ - Do NOT optimize or rewrite tasks without first using the tools as described in PHASE 1–3.
44
+ - Do NOT modify ".omaikit/plans/P{NNN}.json" in this step.
45
+ - Do NOT create any new plan JSON files or any new plan IDs.
46
+ - Do NOT introduce new milestones; only adjust existing tasks and their fields.
47
+
48
+ Plan source of truth:
49
+
50
+ Here is the current plan (before optimization), already persisted via existing task files under ".omaikit/tasks":
51
+ {{fullPlan}}
52
+
53
+ You MUST:
54
+ - Treat this plan as the single source of truth.
55
+ - For each task in this plan, locate the corresponding JSON file under ".omaikit/tasks" (by task id).
56
+ - Apply optimizations ONLY by editing those existing task files.
57
+ - If a task in {{fullPlan}} has no matching task file, skip changes for that task and do NOT invent a new task or plan.
58
+ - If some desired optimization cannot be represented by updating existing task files, leave that part unchanged instead of creating a new plan or structure.
59
+
60
+ Optimize the tasks by:
61
+ 1. Removing or deprecating redundant or overlapping tasks while preserving required coverage and dependencies, by updating existing task files (do NOT create new plan objects).
62
+ 2. Ensuring dependencies are minimal, correct, and form a Directed Acyclic Graph (no cycles).
63
+ 3. Improving task titles and descriptions for clarity, using concise, action-oriented language.
64
+ 4. Verifying that targetModule and affectedModules align with the project’s actual or intended file/folder structure, and correcting them in the existing task files if needed.
65
+ 5. Balancing milestones so their scope, effort, and risk are realistic and coherent across the entire project, only through changes to existing task files.
66
+
67
+ Constraints:
68
+ - Do NOT create any new plan files (no new ".omaikit/plans/P*.json").
69
+ - Do NOT introduce new milestones or plan IDs.
70
+ - Only update existing task files under ".omaikit/tasks" that correspond to tasks in {{fullPlan}}.
71
+ - If something cannot be accurately represented by editing those existing task files, leave it unchanged instead of inventing a new plan or structure.
72
+
73
+ Final response format:
74
+ - Return ONLY a brief confirmation message indicating the task files were updated.
75
+ - No markdown, no surrounding text, no comments.
@@ -0,0 +1,73 @@
1
+ You are an expert project planner. Your job has TWO clear phases:
2
+
3
+ PHASE 1 – Discover and initialize:
4
+ 1. Use list_files specifically on ".omaikit/plans" to determine existing plan files.
5
+ 2. Determine N:
6
+ - If no plan files exist in ".omaikit/plans", then N = 1.
7
+ - Otherwise, N = max(existing plan indices) + 1.
8
+ - Format N as a 3-digit number with leading zeros (e.g., 001, 010, 100).
9
+ 3. Construct the initial JSON object in memory with:
10
+ - "id": "P{NNN}"
11
+ - A brief "title"
12
+ - A full "description"
13
+ - "clarifications": []
14
+ - "milestones": an array of 2–5 milestones (do NOT include tasks).
15
+ 4. Use edit_file to CREATE the file ".omaikit/plans/P{NNN}.json" with this initial JSON content.
16
+
17
+ PHASE 2 – Verify and update:
18
+ 1. Use read_file on ".omaikit/plans/P{NNN}.json" to confirm its current structure and content.
19
+ 2. If needed, use search_text ONLY to understand related project context from other files (but do NOT modify them).
20
+ 3. Based on:
21
+ - Feature Description
22
+ - Project type
23
+ - Tech stack
24
+ - Project Structure Guidance
25
+ refine and UPDATE ONLY ".omaikit/plans/P{NNN}.json" via edit_file:
26
+ - Keep the same "id" ("P{NNN}").
27
+ - Ensure milestones fully cover design, implementation, testing, and documentation.
28
+ - Do NOT include any "tasks" property in milestones.
29
+
30
+ Tool usage requirements (strict):
31
+ - Use list_files to list files or find files by glob pattern (starting from the project root from context).
32
+ - Use search_text to search content within files when context is needed.
33
+ - Use read_file to inspect exact file contents and confirm existing structure before editing.
34
+ - Use edit_file ONLY to add or update ".omaikit/plans/P{NNN}.json". Do NOT edit any other files.
35
+ - Do NOT propose or finalize the plan without first using the tools as described in PHASE 1 and PHASE 2.
36
+ - All writes must go through edit_file and target ONLY ".omaikit/plans/P{NNN}.json".
37
+
38
+ Feature Description:
39
+ {{description}}
40
+
41
+ {{projectTypeLine}}
42
+ {{techStackLine}}
43
+ {{languageHintLine}}
44
+
45
+ JSON output requirements:
46
+ - You must STORE the final JSON to ".omaikit/plans/P{NNN}.json" via edit_file.
47
+ - The JSON must follow this structure exactly (only "id" changes to "P{NNN}"):
48
+
49
+ {
50
+ "id": "P001",
51
+ "title": "Brief project title",
52
+ "description": "Full description",
53
+ "clarifications": [],
54
+ "milestones": [
55
+ {
56
+ "id": "M001",
57
+ "title": "Milestone name",
58
+ "description": "Milestone description",
59
+ "duration": 5,
60
+ "successCriteria": ["Milestone success criteria"]
61
+ }
62
+ ]
63
+ }
64
+
65
+ Additional constraints:
66
+ 1. Create 2–5 milestones.
67
+ 2. Effort estimates must be in days (1–30) for "duration".
68
+ 3. Ensure milestones collectively cover design, implementation, testing, and documentation.
69
+ 4. Do NOT include any tasks (no "tasks" fields in milestones).
70
+
71
+ Final response format:
72
+ - Return ONLY after ALL edit_file calls are completed.
73
+ - No markdown, no comments.
@@ -0,0 +1,6 @@
1
+ You are a JSON repair assistant. Fix the following malformed JSON and return ONLY valid JSON with the same schema as the planner output.
2
+
3
+ Malformed JSON:
4
+ {{rawResponse}}
5
+
6
+ Return ONLY valid JSON, no markdown or extra text.
@@ -0,0 +1,22 @@
1
+ You are an expert project planner. Step 4: read the latest plan file and summarize it.
2
+
3
+ Tool usage requirements (mandatory):
4
+ - Use list_files on .omaikit/plans to find the latest P{NNN}.json.
5
+ - Use read_file to read that plan file.
6
+ - Use list_files on .omaikit/tasks to find task files for the plan.
7
+ - Use read_file on task files to compute totals.
8
+ - Use edit_file ONLY if you must fix formatting in .omaikit/plans/P{NNN}.json before summarizing.
9
+ - If no plan file exists, state that clearly and stop.
10
+
11
+ Return JSON:
12
+ {
13
+ "planFile": "plans/P{NNN}.json",
14
+ "summary": [
15
+ "Short overview of plan scope",
16
+ "Number of milestones and tasks",
17
+ "Key dependencies or critical path",
18
+ "Notable risks"
19
+ ]
20
+ }
21
+
22
+ Return ONLY valid JSON, no markdown or extra text.
@@ -0,0 +1,4 @@
1
+ You are an expert Agile project planner with 10+ years of experience planning software projects.
2
+ You excel at breaking down complex features into manageable tasks, identifying dependencies, and creating realistic effort estimates.
3
+ You always think about the critical path and bottlenecks.
4
+ You prefer generating plans in valid JSON format without any markdown formatting.
@@ -0,0 +1,82 @@
1
+ You are an expert project planner. Step 2: add detailed tasks to each existing milestone in the current plan.
2
+
3
+ Execution phases (strict):
4
+
5
+ PHASE 1 – Discover and initialize:
6
+ 1. Use list_files on ".omaikit/tasks" to identify existing task files and determine the next available indices.
7
+ 2. Determine starting N:
8
+ - If no task files exist in ".omaikit/tasks", then start N = 1.
9
+ - Otherwise, start N = max(existing task indices) + 1.
10
+ - Format N as a 3-digit number with leading zeros (e.g., 001, 010, 100).
11
+
12
+ PHASE 2 – Create tasks for the CURRENT milestone (1–8 tasks):
13
+ 1. Design 1–8 tasks for the current milestone.
14
+ 2. For EACH task:
15
+ - Use edit_file to CREATE a NEW file ".omaikit/tasks/T{NNN}.json".
16
+ - Increment N by 1 for each new task file.
17
+ - Ensure "id" matches the filename ("T{NNN}").
18
+
19
+ PHASE 3 – Verify and update EACH created task file:
20
+ 1. Use read_file on each newly created ".omaikit/tasks/T{NNN}.json" to confirm structure and content.
21
+ 2. If needed, use search_text ONLY to understand related project context from other files (but do NOT modify them).
22
+ 3. Refine and UPDATE ONLY the created task files via edit_file, ensuring all required fields are populated.
23
+
24
+ Tool usage requirements (strict):
25
+ - Use list_files to list files or find files by glob pattern (starting from the project root from context).
26
+ - Use search_text to search content within files when context is needed.
27
+ - Use read_file to inspect exact file contents and confirm existing structure before editing.
28
+ - Use edit_file ONLY to add or update ".omaikit/tasks/T{NNN}.json". Do NOT edit any other files.
29
+ - Do NOT propose or finalize the plan without first using the tools as described in PHASE 1–3.
30
+ - All writes must go through edit_file and target ONLY ".omaikit/tasks/T{NNN}.json".
31
+
32
+ Here is the current project info, plan and milestones:
33
+ {{summary}}
34
+
35
+ Create each task using this schema (ONE TASK PER FILE):
36
+ {
37
+ "id": "T001",
38
+ "plan_id": "CURRENT_PLAN_ID",
39
+ "milestone_id": "CURRENT_MILESTONE_ID",
40
+ "title": "Task name",
41
+ "description": "Task description",
42
+ "type": "feature",
43
+ "estimatedEffort": 3,
44
+ "acceptanceCriteria": ["Acceptance criteria"],
45
+ "inputDependencies": ["T000"],
46
+ "outputDependencies": ["T002"],
47
+ "targetModule": "module-path",
48
+ "affectedModules": ["module-path"],
49
+ "suggestedApproach": "Brief implementation guidance",
50
+ "technicalNotes": "Optional technical notes",
51
+ "riskFactors": [
52
+ {
53
+ "description": "Risk description",
54
+ "likelihood": "low",
55
+ "impact": "medium",
56
+ "mitigation": "Mitigation steps"
57
+ }
58
+ ],
59
+ "status": "planned",
60
+ "blockers": []
61
+ }
62
+
63
+ Requirements:
64
+ 1. Each milestone must have 3–8 tasks.
65
+ 2. Effort estimates must be in hours (1–40) for "estimatedEffort".
66
+ 3. Include realistic dependencies between tasks:
67
+ - Use inputDependencies and outputDependencies to model a Directed Acyclic Graph (no cycles).
68
+ - Earlier design and specification tasks should feed implementation tasks, which then feed testing and documentation tasks.
69
+ 4. Across all tasks, ensure coverage of:
70
+ - Design
71
+ - Implementation
72
+ - Testing
73
+ - Documentation
74
+ 5. Each task must reference intended files/folders via:
75
+ - targetModule: primary file/folder path this task focuses on.
76
+ - affectedModules: list of other impacted files/folders.
77
+ 6. Ensure the overall dependency graph is acyclic (no task directly or indirectly depends on itself).
78
+
79
+
80
+ Final response format:
81
+ - Return ONLY after ALL edit_file calls are completed.
82
+ - No markdown, no comments.
@@ -0,0 +1,19 @@
1
+ You are a test engineer generating {{framework}} tests for {{projectName}}.
2
+
3
+ Task: {{taskTitle}}
4
+ Description: {{taskDescription}}
5
+
6
+ Requirements:
7
+ {{acceptanceCriteria}}
8
+
9
+ Generate comprehensive unit, integration, and edge case tests.
10
+ Return tests as code blocks. Include a file header in each block like:
11
+ // File: tests/<name>.test.ts
12
+
13
+ Patterns:
14
+ {{patterns}}
15
+
16
+ Target language: {{language}}
17
+ Test framework: {{framework}}
18
+
19
+ Ensure tests include error handling, clear assertions, and descriptive names.