@omaikit/agents 0.1.3 → 0.1.5

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 (100) 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 +55 -136
  5. package/dist/ai-provider/openai.js.map +1 -1
  6. package/dist/ai-provider/provider.d.ts +11 -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 +2 -1
  29. package/dist/coder/coder.d.ts.map +1 -1
  30. package/dist/coder/coder.js +37 -76
  31. package/dist/coder/coder.js.map +1 -1
  32. package/dist/coder/prompt-templates.d.ts +3 -2
  33. package/dist/coder/prompt-templates.d.ts.map +1 -1
  34. package/dist/coder/prompt-templates.js +33 -61
  35. package/dist/coder/prompt-templates.js.map +1 -1
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/manager/manager.d.ts.map +1 -1
  41. package/dist/manager/manager.js +8 -35
  42. package/dist/manager/manager.js.map +1 -1
  43. package/dist/planner/clarification-handler.d.ts.map +1 -1
  44. package/dist/planner/clarification-handler.js +2 -12
  45. package/dist/planner/clarification-handler.js.map +1 -1
  46. package/dist/planner/plan-parser.d.ts.map +1 -1
  47. package/dist/planner/plan-parser.js +33 -31
  48. package/dist/planner/plan-parser.js.map +1 -1
  49. package/dist/planner/planner.d.ts +3 -7
  50. package/dist/planner/planner.d.ts.map +1 -1
  51. package/dist/planner/planner.js +81 -230
  52. package/dist/planner/planner.js.map +1 -1
  53. package/dist/planner/prompt-templates.d.ts +5 -2
  54. package/dist/planner/prompt-templates.d.ts.map +1 -1
  55. package/dist/planner/prompt-templates.js +42 -137
  56. package/dist/planner/prompt-templates.js.map +1 -1
  57. package/dist/tester/prompt-templates.d.ts.map +1 -1
  58. package/dist/tester/prompt-templates.js +14 -21
  59. package/dist/tester/prompt-templates.js.map +1 -1
  60. package/dist/tools/list-files.d.ts.map +1 -1
  61. package/dist/tools/list-files.js +8 -1
  62. package/dist/tools/list-files.js.map +1 -1
  63. package/dist/tools/registry.js +1 -1
  64. package/dist/tools/registry.js.map +1 -1
  65. package/dist/tools/utils.d.ts.map +1 -1
  66. package/dist/tools/utils.js +34 -3
  67. package/dist/tools/utils.js.map +1 -1
  68. package/dist/utils/cache-manager.d.ts +9 -0
  69. package/dist/utils/cache-manager.d.ts.map +1 -0
  70. package/dist/utils/cache-manager.js +33 -0
  71. package/dist/utils/cache-manager.js.map +1 -0
  72. package/dist/utils/context-writer.d.ts +29 -0
  73. package/dist/utils/context-writer.d.ts.map +1 -0
  74. package/dist/utils/context-writer.js +167 -0
  75. package/dist/utils/context-writer.js.map +1 -0
  76. package/dist/utils/index.d.ts +9 -0
  77. package/dist/utils/index.d.ts.map +1 -0
  78. package/dist/utils/index.js +40 -0
  79. package/dist/utils/index.js.map +1 -0
  80. package/dist/utils/plan-writer.d.ts +17 -0
  81. package/dist/utils/plan-writer.d.ts.map +1 -0
  82. package/dist/utils/plan-writer.js +175 -0
  83. package/dist/utils/plan-writer.js.map +1 -0
  84. package/dist/utils/prompt.d.ts +3 -0
  85. package/dist/utils/prompt.d.ts.map +1 -0
  86. package/dist/utils/prompt.js +55 -0
  87. package/dist/utils/prompt.js.map +1 -0
  88. package/dist/utils/test-writer.d.ts +9 -0
  89. package/dist/utils/test-writer.d.ts.map +1 -0
  90. package/dist/utils/test-writer.js +42 -0
  91. package/dist/utils/test-writer.js.map +1 -0
  92. package/package.json +3 -3
  93. package/prompts/coder/instructions.md +42 -0
  94. package/prompts/coder/task.md +13 -0
  95. package/prompts/manager/context.md +2 -0
  96. package/prompts/manager/instructions.md +12 -0
  97. package/prompts/planner/instructions.md +74 -0
  98. package/prompts/planner/plan-milestones.md +30 -0
  99. package/prompts/planner/tasks.md +23 -0
  100. package/prompts/tester/prompt.md +19 -0
@@ -0,0 +1,175 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ export class PlanWriter {
4
+ baseDir = '.omaikit';
5
+ planFile = 'plan.json';
6
+ tasksDir = path.join('.omaikit', 'tasks');
7
+ constructor(baseDir) {
8
+ if (baseDir) {
9
+ this.baseDir = baseDir;
10
+ this.tasksDir = path.join(baseDir, 'tasks');
11
+ }
12
+ }
13
+ async writePlan(plan, filename) {
14
+ return new Promise((resolve, reject) => {
15
+ try {
16
+ // Ensure directory exists
17
+ if (!fs.existsSync(this.baseDir)) {
18
+ fs.mkdirSync(this.baseDir, { recursive: true });
19
+ }
20
+ if (!fs.existsSync(this.tasksDir)) {
21
+ fs.mkdirSync(this.tasksDir, { recursive: true });
22
+ }
23
+ const target = filename || this.planFile;
24
+ const filepath = path.isAbsolute(target) ? target : path.join(this.baseDir, target);
25
+ const dirPath = path.dirname(filepath);
26
+ if (!fs.existsSync(dirPath)) {
27
+ fs.mkdirSync(dirPath, { recursive: true });
28
+ }
29
+ // Persist tasks as separate files
30
+ if (Array.isArray(plan.milestones)) {
31
+ for (const milestone of plan.milestones) {
32
+ if (!Array.isArray(milestone.tasks))
33
+ continue;
34
+ for (const task of milestone.tasks) {
35
+ const taskFilename = this.buildTaskFilename(plan.id, milestone.id, task.id);
36
+ const taskPath = path.join(this.tasksDir, taskFilename);
37
+ const payload = { planId: plan.id, milestoneId: milestone.id, ...task };
38
+ fs.writeFileSync(taskPath, JSON.stringify(payload, null, 2), 'utf-8');
39
+ }
40
+ }
41
+ }
42
+ // Write plan as pretty JSON without embedded tasks
43
+ const strippedPlan = {
44
+ ...plan,
45
+ milestones: Array.isArray(plan.milestones)
46
+ ? plan.milestones.map((m) => {
47
+ const { tasks, ...rest } = m;
48
+ return rest;
49
+ })
50
+ : [],
51
+ };
52
+ const content = JSON.stringify(strippedPlan, null, 2);
53
+ fs.writeFileSync(filepath, content, 'utf-8');
54
+ resolve(filepath);
55
+ }
56
+ catch (error) {
57
+ reject(error);
58
+ }
59
+ });
60
+ }
61
+ async readPlan(filename) {
62
+ return new Promise((resolve) => {
63
+ try {
64
+ const target = filename || this.planFile;
65
+ const filepath = path.isAbsolute(target) ? target : path.join(this.baseDir, target);
66
+ if (!fs.existsSync(filepath)) {
67
+ resolve(null);
68
+ return;
69
+ }
70
+ const content = fs.readFileSync(filepath, 'utf-8');
71
+ const plan = JSON.parse(content);
72
+ const hydrated = this.hydrateTasks(plan);
73
+ resolve(hydrated);
74
+ }
75
+ catch (error) {
76
+ resolve(null);
77
+ }
78
+ });
79
+ }
80
+ async listPlans() {
81
+ return new Promise((resolve) => {
82
+ try {
83
+ if (!fs.existsSync(this.baseDir)) {
84
+ resolve([]);
85
+ return;
86
+ }
87
+ const files = fs
88
+ .readdirSync(this.baseDir)
89
+ .filter((f) => f.endsWith('.json') && f.includes('plan'));
90
+ resolve(files);
91
+ }
92
+ catch (error) {
93
+ resolve([]);
94
+ }
95
+ });
96
+ }
97
+ async deletePlan(filename) {
98
+ return new Promise((resolve) => {
99
+ try {
100
+ const filepath = path.join(this.baseDir, filename || this.planFile);
101
+ if (fs.existsSync(filepath)) {
102
+ fs.unlinkSync(filepath);
103
+ resolve(true);
104
+ }
105
+ else {
106
+ resolve(false);
107
+ }
108
+ }
109
+ catch (error) {
110
+ resolve(false);
111
+ }
112
+ });
113
+ }
114
+ hydrateTasks(plan) {
115
+ if (!plan || !plan.id || !Array.isArray(plan.milestones)) {
116
+ return plan;
117
+ }
118
+ const tasks = this.readTasksForPlan(plan.id);
119
+ const byMilestone = new Map();
120
+ for (const task of tasks) {
121
+ const milestoneId = task.milestoneId;
122
+ if (!milestoneId)
123
+ continue;
124
+ if (!byMilestone.has(milestoneId))
125
+ byMilestone.set(milestoneId, []);
126
+ const { milestoneId: _omit, planId: _omitPlan, ...taskData } = task;
127
+ byMilestone.get(milestoneId)?.push(taskData);
128
+ }
129
+ return {
130
+ ...plan,
131
+ milestones: plan.milestones.map((milestone) => ({
132
+ ...milestone,
133
+ tasks: byMilestone.get(milestone.id) ?? [],
134
+ })),
135
+ };
136
+ }
137
+ readTasksForPlan(planId) {
138
+ if (!fs.existsSync(this.tasksDir)) {
139
+ return [];
140
+ }
141
+ const files = fs.readdirSync(this.tasksDir);
142
+ const tasks = [];
143
+ for (const file of files) {
144
+ const parsed = this.parseTaskFilename(file);
145
+ if (!parsed || parsed.planId !== planId)
146
+ continue;
147
+ const filePath = path.join(this.tasksDir, file);
148
+ try {
149
+ const content = fs.readFileSync(filePath, 'utf-8');
150
+ const data = JSON.parse(content);
151
+ tasks.push(data);
152
+ }
153
+ catch {
154
+ // skip
155
+ }
156
+ }
157
+ return tasks;
158
+ }
159
+ buildTaskFilename(planId, milestoneId, taskId) {
160
+ const safePlan = this.safeSegment(planId);
161
+ const safeMilestone = this.safeSegment(milestoneId);
162
+ const safeTask = this.safeSegment(taskId);
163
+ return `T-${safePlan}-${safeMilestone}-${safeTask}.json`;
164
+ }
165
+ parseTaskFilename(filename) {
166
+ const match = /^T-(P\d+)-(M\d+)-(.+)\.json$/i.exec(filename);
167
+ if (!match)
168
+ return null;
169
+ return { planId: match[1], milestoneId: match[2], taskId: match[3] };
170
+ }
171
+ safeSegment(value) {
172
+ return value.replace(/[\\/]/g, '_');
173
+ }
174
+ }
175
+ //# sourceMappingURL=plan-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-writer.js","sourceRoot":"","sources":["../../src/utils/plan-writer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,OAAO,UAAU;IACb,OAAO,GAAG,UAAU,CAAC;IACrB,QAAQ,GAAG,WAAW,CAAC;IACvB,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAElD,YAAY,OAAgB;QAC1B,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAU,EAAE,QAAiB;QAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC;gBACH,0BAA0B;gBAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;oBACjC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAClD,CAAC;gBAED,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAClC,EAAE,CAAC,SAAS,CAAC,IAAI,CAA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MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1C,OAAO,KAAK,QAAQ,IAAI,aAAa,IAAI,QAAQ,OAAO,CAAC;IAC3D,CAAC;IAEO,iBAAiB,CAAC,QAAgB;QACxC,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,CAAC;IAEO,WAAW,CAAC,KAAa;QAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export declare function readPrompt(name: string, variables?: Record<string, string>): string;
2
+ export declare function readPromptList(name: string): string[];
3
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/utils/prompt.ts"],"names":[],"mappings":"AAMA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAGnF;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAarD"}
@@ -0,0 +1,55 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ const PROMPT_CACHE = new Map();
5
+ export function readPrompt(name, variables) {
6
+ const template = getPromptTemplate(name);
7
+ return renderTemplate(template, variables).trimEnd();
8
+ }
9
+ export function readPromptList(name) {
10
+ const content = readPrompt(name);
11
+ const lines = content.split(/\r?\n/).map((line) => line.trim());
12
+ const bullets = lines
13
+ .filter((line) => line.startsWith('- ') || line.startsWith('* '))
14
+ .map((line) => line.slice(2).trim())
15
+ .filter(Boolean);
16
+ if (bullets.length > 0) {
17
+ return bullets;
18
+ }
19
+ return lines.filter(Boolean);
20
+ }
21
+ function getPromptTemplate(name) {
22
+ if (PROMPT_CACHE.has(name)) {
23
+ return PROMPT_CACHE.get(name);
24
+ }
25
+ const { folder, key } = parsePromptName(name);
26
+ const promptsPath = resolvePromptPath(folder, key);
27
+ const template = fs.readFileSync(promptsPath, 'utf-8');
28
+ PROMPT_CACHE.set(name, template);
29
+ return template;
30
+ }
31
+ function resolvePromptPath(folder, key) {
32
+ const currentDir = path.dirname(fileURLToPath(import.meta.url));
33
+ const rootDir = path.resolve(currentDir, '..', '..');
34
+ return path.join(rootDir, 'prompts', folder, `${key}.md`);
35
+ }
36
+ function parsePromptName(name) {
37
+ const index = name.indexOf('.');
38
+ if (index <= 0 || index === name.length - 1) {
39
+ throw new Error(`Invalid prompt name: ${name}`);
40
+ }
41
+ const folder = name.slice(0, index).trim();
42
+ const key = name.slice(index + 1).trim();
43
+ if (!folder || !key) {
44
+ throw new Error(`Invalid prompt name: ${name}`);
45
+ }
46
+ return { folder, key };
47
+ }
48
+ function renderTemplate(template, variables) {
49
+ if (!variables)
50
+ return template;
51
+ return template.replace(/{{\s*([\w.-]+)\s*}}/g, (_match, key) => {
52
+ return variables[key] ?? '';
53
+ });
54
+ }
55
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/utils/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE/C,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,SAA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AsB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QAC9D,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { TestFile, TestSuite } from '@omaikit/models';
2
+ export declare class TestWriter {
3
+ private baseDir;
4
+ constructor(baseDir?: string);
5
+ writeTestSuite(testSuite: TestSuite, outputDir?: string): Promise<string[]>;
6
+ writeFiles(files: TestFile[], outputDir?: string): Promise<string[]>;
7
+ private sanitizeRelativePath;
8
+ }
9
+ //# sourceMappingURL=test-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-writer.d.ts","sourceRoot":"","sources":["../../src/utils/test-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE3D,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAkC;gBAErC,OAAO,CAAC,EAAE,MAAM;IAMtB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI3E,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAuB1E,OAAO,CAAC,oBAAoB;CAW7B"}
@@ -0,0 +1,42 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ export class TestWriter {
4
+ baseDir = path.join('.omaikit', 'tests');
5
+ constructor(baseDir) {
6
+ if (baseDir) {
7
+ this.baseDir = baseDir;
8
+ }
9
+ }
10
+ async writeTestSuite(testSuite, outputDir) {
11
+ return this.writeFiles(testSuite.files || [], outputDir);
12
+ }
13
+ async writeFiles(files, outputDir) {
14
+ const targetDir = outputDir || this.baseDir;
15
+ if (!fs.existsSync(targetDir)) {
16
+ fs.mkdirSync(targetDir, { recursive: true });
17
+ }
18
+ const writtenPaths = [];
19
+ for (const file of files) {
20
+ const safeRelative = this.sanitizeRelativePath(file.path);
21
+ const fullPath = path.join(targetDir, safeRelative);
22
+ const dirPath = path.dirname(fullPath);
23
+ if (!fs.existsSync(dirPath)) {
24
+ fs.mkdirSync(dirPath, { recursive: true });
25
+ }
26
+ fs.writeFileSync(fullPath, file.content, 'utf-8');
27
+ writtenPaths.push(fullPath);
28
+ }
29
+ return writtenPaths;
30
+ }
31
+ sanitizeRelativePath(filePath) {
32
+ const normalized = path.normalize(filePath).replace(/^[\\/]+/, '');
33
+ if (path.isAbsolute(normalized)) {
34
+ return normalized.replace(/^[A-Z]:/i, '').replace(/^[\\/]+/, '');
35
+ }
36
+ const segments = normalized
37
+ .split(path.sep)
38
+ .filter((segment) => segment !== '..' && segment !== '');
39
+ return segments.join(path.sep);
40
+ }
41
+ }
42
+ //# sourceMappingURL=test-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-writer.js","sourceRoot":"","sources":["../../src/utils/test-writer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,OAAO,UAAU;IACb,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEjD,YAAY,OAAgB;QAC1B,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,SAAoB,EAAE,SAAkB;QAC3D,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,KAAiB,EAAE,SAAkB;QACpD,MAAM,SAAS,GAAG,SAAS,IAAI,IAAI,CAAC,OAAO,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M,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC;QAC3D,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@omaikit/agents",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "description": "AI agent implementations for Omaikit",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "prompts"
10
11
  ],
11
12
  "scripts": {
12
13
  "build": "tsc && tsc-alias",
@@ -26,7 +27,6 @@
26
27
  "dependencies": {
27
28
  "@anthropic-ai/sdk": "^0.71.2",
28
29
  "@dqbd/tiktoken": "^0.4.0",
29
- "@omaikit/analysis": "*",
30
30
  "@omaikit/config": "*",
31
31
  "@omaikit/models": "*",
32
32
  "openai": "^4.104.0"
@@ -0,0 +1,42 @@
1
+ ## Role & Context
2
+
3
+ You are a senior software engineer generating production-ready code and files for the current task that:
4
+
5
+ - Follows PSR-12 and PSR-4
6
+ - Applies SOLID, KISS, DRY, and Clean Code principles
7
+ - Matches the existing project conventions from context
8
+ - Uses structured logging (or the project's logger)
9
+
10
+ Project Context (from .omaikit/context.json):
11
+
12
+ {{contextSummary}}
13
+
14
+ ## Tool usage requirements:
15
+
16
+ - Use list_files to list files or find files by glob pattern.
17
+ - Use search_text to search content within files.
18
+ - Use read_file to inspect exact file contents and confirm existing structure.
19
+ - Use apply_patch for precise, minimal edits to existing files.
20
+ - If the project is empty or the target file does not exist, create new files using apply_patch with create_file.
21
+
22
+ ## Development Requirements
23
+
24
+ 1. Implement the task fully by creating or updating all necessary files.
25
+ 2. Write production-ready code with proper error handling.
26
+ 3. Include logging statements for debugging.
27
+ 4. Add clear documentation where needed, the documents must be clear, concise, well structured and must be saved to the folder: **docs/**.
28
+ 5. Keep functions small and focused.
29
+ 6. Keep the code testable and maintainable.
30
+ 7. Remember to create the base code structure and necessary modules if they do not exist yet in the project context.
31
+
32
+ ## Development Steps
33
+
34
+ 1. Analyze the task requirements and identify necessary files and modules.
35
+ 2. List existing files and search for relevant content to understand the current structure.
36
+ 3. Read the contents of relevant files to gather context.
37
+ 4. Create or update files as needed using apply_patch.
38
+
39
+ ## Output Format
40
+
41
+ - Return ONLY the list of modified/created file paths.
42
+ - No code blocks, no file contents, no extra commentary.
@@ -0,0 +1,13 @@
1
+ Begin to do the following task as part of the overall project.
2
+
3
+ ## Task Details
4
+
5
+ - Title: {{taskTitle}}
6
+ - Description: {{taskDescription}}
7
+ - Type: {{taskType}}
8
+ - Estimated Effort: {{taskEffort}} hours
9
+ {{otherDetails}}
10
+
11
+ ## Acceptance Criteria
12
+
13
+ {{acceptanceCriteria}}
@@ -0,0 +1,2 @@
1
+ {{descriptionLine}}
2
+ Project root: {{rootPath}}
@@ -0,0 +1,12 @@
1
+ - You are the Project Manager with expertise in software development.
2
+ - You working with Agile methodologies to oversee project progress.
3
+ - Your task is to analyze the current project using available tools and produce a context.json payload.
4
+ - Based on the client request, you will ask relevant questions to gather necessary information (use ask tool) if needed.
5
+ - Return ONLY a JSON object with this exact schema:
6
+ {
7
+ "project": { "name": string, "rootPath": string, "description"?: string, "goals"?: string[] },
8
+ "analysis": { "languages": string[], "dependencies": string[], "frameworks"?: string[] },
9
+ "generatedAt": string
10
+ }
11
+
12
+ If unsure, infer from files and keep values conservative. Do not include extra keys. Return raw JSON only.
@@ -0,0 +1,74 @@
1
+ ## Role and Context:
2
+
3
+ - You are an expert Project planner with master level expertise.
4
+ - You working with Agile methodologies to oversee project planning.
5
+
6
+ ## Tool Usage Requirements (strict):
7
+
8
+ - Use list_files to list files or find files by glob pattern (starting from the project root from context).
9
+ - Use search_text to search content within files when context is needed.
10
+ - Use read_file to inspect exact file contents and confirm existing structure before editing.
11
+ - Use edit_file ONLY to add or update file.
12
+
13
+ ## File creation and update instructions:
14
+
15
+ - The plan file must be created or updated at ".omaikit/plans/P{NNN}.json", where {NNN} is the next available sequential number based on existing plan files in that directory.
16
+ - The task file must be created or updated at ".omaikit/tasks/T{NNN}.json", where {NNN} is the next available sequential number based on existing task files in that directory.
17
+
18
+ ## Schema and structure:
19
+
20
+ - The plan JSON structure must follow this exact format. The "id" field must match the filename ("P{NNN}"):
21
+
22
+ ```json
23
+ {
24
+ "id": "P001",
25
+ "title": "Brief project title",
26
+ "description": "Full description",
27
+ "clarifications": [],
28
+ "milestones": [
29
+ {
30
+ "id": "M001",
31
+ "title": "Milestone name",
32
+ "description": "Milestone description",
33
+ "duration": 5,
34
+ "successCriteria": ["Milestone success criteria"]
35
+ }
36
+ ]
37
+ }
38
+ ```
39
+
40
+ - The task JSON structure must follow this exact format. The "id" field must match the filename ("T{NNN}"):
41
+
42
+ ```json
43
+ {
44
+ "id": "T001",
45
+ "plan_id": "CURRENT_PLAN_ID",
46
+ "milestone_id": "CURRENT_MILESTONE_ID",
47
+ "title": "Task name",
48
+ "description": "Task description",
49
+ "type": "feature",
50
+ "estimatedEffort": 3,
51
+ "acceptanceCriteria": ["Acceptance criteria"],
52
+ "inputDependencies": ["T000"],
53
+ "outputDependencies": ["T002"],
54
+ "targetModule": "module-path",
55
+ "affectedModules": ["module-path"],
56
+ "suggestedApproach": "Brief implementation guidance",
57
+ "technicalNotes": "Optional technical notes",
58
+ "riskFactors": [
59
+ {
60
+ "description": "Risk description",
61
+ "likelihood": "low",
62
+ "impact": "medium",
63
+ "mitigation": "Mitigation steps"
64
+ }
65
+ ],
66
+ "status": "planned",
67
+ "blockers": []
68
+ }
69
+ ```
70
+
71
+ ## Output Requirements:
72
+
73
+ - Return ONLY after ALL edit_file calls are completed.
74
+ - No markdown, no comments.
@@ -0,0 +1,30 @@
1
+ ## Request:
2
+
3
+ Make a detailed project plan in JSON format with milestones only (no tasks) for a new feature based on the provided description and project context. Follow these steps and tool usage requirements strictly.
4
+
5
+ ## Execution steps (strict):
6
+
7
+ 1. Discover existing plan files to determine the next available plan index.
8
+ 2. Create a new project plan using the provided plan description and project context.
9
+ 3. Ensure the plan follows the specified JSON schema and structure.
10
+
11
+ ## Project Context:
12
+
13
+ {{projectTypeLine}}
14
+ {{techStackLine}}
15
+ {{languageHintLine}}
16
+
17
+ ## Plan description:
18
+
19
+ {{description}}
20
+
21
+ ## JSON output requirements:
22
+
23
+ - You must STORE the final JSON to ".omaikit/plans/P{NNN}.json" via edit_file.
24
+
25
+ ## Additional constraints:
26
+
27
+ 1. Create 2–5 milestones.
28
+ 2. Effort estimates must be in days (1–30) for "duration".
29
+ 3. Ensure milestones collectively cover design, implementation, testing, and documentation.
30
+ 4. Do NOT include any tasks (no "tasks" fields in milestones).
@@ -0,0 +1,23 @@
1
+ ## Request:
2
+
3
+ Make the tasks for the project plan based on the current milestone in JSON format. Follow these steps and tool usage requirements strictly.
4
+
5
+ ## Execution steps (strict):
6
+ 1. Discover existing task files to determine the next available task index.
7
+ 2. Create tasks for the current milestone using the provided project context.
8
+ 3. Ensure the tasks follow the specified JSON schema and structure.
9
+
10
+ ## Project Context:
11
+
12
+ {{summary}}
13
+
14
+ ## JSON output requirements:
15
+
16
+ - You must STORE the final JSON to ".omaikit/tasks/T{NNN}.json" via edit_file.
17
+
18
+ ## Additional constraints:
19
+
20
+ 1. Create from 1 to 8 tasks based on the current milestone. If the milestone is complex, create more tasks up to 8.
21
+ 2. Effort estimates must be in hours for "estimatedEffort", but not exceed the milestone's total estimated effort.
22
+ 3. Ensure tasks collectively cover design, implementation, testing, and documentation as applicable.
23
+ 4. Based on the languages and tech stack in the project context, suggest the standard coding conventions and best practices.
@@ -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.