@dewtech/dare-cli 0.1.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.
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/__tests__/dag-converter.test.d.ts +2 -0
- package/dist/__tests__/dag-converter.test.d.ts.map +1 -0
- package/dist/__tests__/dag-converter.test.js +134 -0
- package/dist/__tests__/dag-converter.test.js.map +1 -0
- package/dist/__tests__/validators.test.d.ts +2 -0
- package/dist/__tests__/validators.test.d.ts.map +1 -0
- package/dist/__tests__/validators.test.js +62 -0
- package/dist/__tests__/validators.test.js.map +1 -0
- package/dist/bin/dare.d.ts +3 -0
- package/dist/bin/dare.d.ts.map +1 -0
- package/dist/bin/dare.js +20 -0
- package/dist/bin/dare.js.map +1 -0
- package/dist/commands/blueprint.d.ts +3 -0
- package/dist/commands/blueprint.d.ts.map +1 -0
- package/dist/commands/blueprint.js +134 -0
- package/dist/commands/blueprint.js.map +1 -0
- package/dist/commands/design.d.ts +3 -0
- package/dist/commands/design.d.ts.map +1 -0
- package/dist/commands/design.js +38 -0
- package/dist/commands/design.js.map +1 -0
- package/dist/commands/execute.d.ts +3 -0
- package/dist/commands/execute.d.ts.map +1 -0
- package/dist/commands/execute.js +60 -0
- package/dist/commands/execute.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +112 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/dag-runner/run_dag.d.ts +32 -0
- package/dist/dag-runner/run_dag.d.ts.map +1 -0
- package/dist/dag-runner/run_dag.js +160 -0
- package/dist/dag-runner/run_dag.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/dag-converter.d.ts +10 -0
- package/dist/utils/dag-converter.d.ts.map +1 -0
- package/dist/utils/dag-converter.js +46 -0
- package/dist/utils/dag-converter.js.map +1 -0
- package/dist/utils/project-generator.d.ts +12 -0
- package/dist/utils/project-generator.d.ts.map +1 -0
- package/dist/utils/project-generator.js +103 -0
- package/dist/utils/project-generator.js.map +1 -0
- package/dist/utils/templates.d.ts +11 -0
- package/dist/utils/templates.d.ts.map +1 -0
- package/dist/utils/templates.js +137 -0
- package/dist/utils/templates.js.map +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dewtech Technologies
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# @dewtech/dare-cli
|
|
2
|
+
|
|
3
|
+
CLI tool for DARE Framework - AI-assisted software development with parallel task execution.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @dewtech/dare-cli
|
|
9
|
+
# or
|
|
10
|
+
npx @dewtech/dare-cli init my-project
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
### `dare init`
|
|
16
|
+
|
|
17
|
+
Interactive project initialization with stack selection.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
dare init my-project
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Prompts:
|
|
24
|
+
- Project structure (Monorepo / Backend only / Frontend only)
|
|
25
|
+
- Backend stack (Rust/Axum, Node/NestJS, Python/FastAPI, PHP/Laravel)
|
|
26
|
+
- Frontend stack (React, Vue)
|
|
27
|
+
- IDE (Cursor, Antigravity, Hybrid)
|
|
28
|
+
- GraphRAG backend (SQLite, JSON, Neo4j)
|
|
29
|
+
- Enable MCP Server
|
|
30
|
+
|
|
31
|
+
Generates:
|
|
32
|
+
- `.cursorrules` / `.antigravityrules` (global rules)
|
|
33
|
+
- `.cursor/rules/*.mdc` (stack-specific skills)
|
|
34
|
+
- `.cursor/commands/` (DARE commands)
|
|
35
|
+
- `.agents/skills/` (Antigravity skills)
|
|
36
|
+
- `dare.config.json` (project config)
|
|
37
|
+
- `DARE/README.md` (methodology guide)
|
|
38
|
+
|
|
39
|
+
### `dare design`
|
|
40
|
+
|
|
41
|
+
Generate DESIGN.md from a project description.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
dare design "Build a REST API for user authentication with JWT"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `dare blueprint`
|
|
48
|
+
|
|
49
|
+
Generate BLUEPRINT.md, dare-dag.yaml, and TASKS.md from DESIGN.md.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
dare blueprint
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### `dare execute`
|
|
56
|
+
|
|
57
|
+
Execute tasks using DAG Task Runner.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Execute all tasks in parallel
|
|
61
|
+
dare execute --parallel --runner cursor
|
|
62
|
+
|
|
63
|
+
# Execute a specific task
|
|
64
|
+
dare execute task-001
|
|
65
|
+
|
|
66
|
+
# Sequential execution
|
|
67
|
+
dare execute
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Workflow
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# 1. Initialize project
|
|
74
|
+
dare init my-api
|
|
75
|
+
|
|
76
|
+
# 2. Define requirements
|
|
77
|
+
dare design "Build a REST API for user management"
|
|
78
|
+
|
|
79
|
+
# 3. Generate blueprint and task graph
|
|
80
|
+
dare blueprint
|
|
81
|
+
|
|
82
|
+
# 4. Execute tasks in parallel (75% faster)
|
|
83
|
+
dare execute --parallel --runner cursor
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Performance
|
|
87
|
+
|
|
88
|
+
| Mode | Estimated Time |
|
|
89
|
+
|------|---------------|
|
|
90
|
+
| Sequential (old) | ~280 minutes |
|
|
91
|
+
| Parallel DAG | ~70 minutes |
|
|
92
|
+
| **Improvement** | **75% faster** |
|
|
93
|
+
|
|
94
|
+
## Supported Stacks
|
|
95
|
+
|
|
96
|
+
### Backend
|
|
97
|
+
- Rust/Axum
|
|
98
|
+
- Node.js/NestJS
|
|
99
|
+
- Python/FastAPI
|
|
100
|
+
- PHP/Laravel
|
|
101
|
+
|
|
102
|
+
### Frontend
|
|
103
|
+
- React 18+
|
|
104
|
+
- Vue 3+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag-converter.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/dag-converter.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
// Inline DAG validation logic
|
|
3
|
+
function validateDAG(dag) {
|
|
4
|
+
const errors = [];
|
|
5
|
+
const taskIds = new Set(dag.tasks.map(t => t.id));
|
|
6
|
+
// Check for duplicate IDs
|
|
7
|
+
if (taskIds.size !== dag.tasks.length) {
|
|
8
|
+
errors.push('Duplicate task IDs found');
|
|
9
|
+
}
|
|
10
|
+
// Check dependencies exist
|
|
11
|
+
for (const task of dag.tasks) {
|
|
12
|
+
for (const dep of task.depends_on) {
|
|
13
|
+
if (!taskIds.has(dep)) {
|
|
14
|
+
errors.push(`Task "${task.id}" depends on unknown task "${dep}"`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// Check for cycles (simple DFS)
|
|
19
|
+
const visited = new Set();
|
|
20
|
+
const inStack = new Set();
|
|
21
|
+
function hasCycle(taskId) {
|
|
22
|
+
visited.add(taskId);
|
|
23
|
+
inStack.add(taskId);
|
|
24
|
+
const task = dag.tasks.find(t => t.id === taskId);
|
|
25
|
+
if (task) {
|
|
26
|
+
for (const dep of task.depends_on) {
|
|
27
|
+
if (!visited.has(dep)) {
|
|
28
|
+
if (hasCycle(dep))
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
else if (inStack.has(dep)) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
inStack.delete(taskId);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
for (const task of dag.tasks) {
|
|
40
|
+
if (!visited.has(task.id)) {
|
|
41
|
+
if (hasCycle(task.id)) {
|
|
42
|
+
errors.push('Circular dependency detected in DAG');
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { valid: errors.length === 0, errors };
|
|
48
|
+
}
|
|
49
|
+
// Compute execution ranks (tasks with same rank can run in parallel)
|
|
50
|
+
function computeRanks(dag) {
|
|
51
|
+
const ranks = new Map();
|
|
52
|
+
function getRank(taskId) {
|
|
53
|
+
if (ranks.has(taskId))
|
|
54
|
+
return ranks.get(taskId);
|
|
55
|
+
const task = dag.tasks.find(t => t.id === taskId);
|
|
56
|
+
if (!task || task.depends_on.length === 0) {
|
|
57
|
+
ranks.set(taskId, 0);
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
const maxDepRank = Math.max(...task.depends_on.map(dep => getRank(dep)));
|
|
61
|
+
const rank = maxDepRank + 1;
|
|
62
|
+
ranks.set(taskId, rank);
|
|
63
|
+
return rank;
|
|
64
|
+
}
|
|
65
|
+
for (const task of dag.tasks) {
|
|
66
|
+
getRank(task.id);
|
|
67
|
+
}
|
|
68
|
+
return ranks;
|
|
69
|
+
}
|
|
70
|
+
describe('DAG Converter', () => {
|
|
71
|
+
const validDAG = {
|
|
72
|
+
title: 'Test Project',
|
|
73
|
+
models: { HIGH: 'gpt-4', MED: 'gpt-3.5-turbo', LOW: 'gpt-3.5-turbo' },
|
|
74
|
+
tasks: [
|
|
75
|
+
{ id: 'task-001', depends_on: [], complexity: 'HIGH', subtask_prompt: 'Setup project' },
|
|
76
|
+
{ id: 'task-002', depends_on: [], complexity: 'MED', subtask_prompt: 'Setup database' },
|
|
77
|
+
{ id: 'task-003', depends_on: ['task-001', 'task-002'], complexity: 'HIGH', subtask_prompt: 'Implement auth' },
|
|
78
|
+
{ id: 'task-004', depends_on: ['task-003'], complexity: 'MED', subtask_prompt: 'Write tests' },
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
describe('validateDAG', () => {
|
|
82
|
+
it('should validate a correct DAG', () => {
|
|
83
|
+
const result = validateDAG(validDAG);
|
|
84
|
+
expect(result.valid).toBe(true);
|
|
85
|
+
expect(result.errors).toHaveLength(0);
|
|
86
|
+
});
|
|
87
|
+
it('should detect unknown dependencies', () => {
|
|
88
|
+
const invalidDAG = {
|
|
89
|
+
...validDAG,
|
|
90
|
+
tasks: [
|
|
91
|
+
{ id: 'task-001', depends_on: ['task-999'], complexity: 'HIGH', subtask_prompt: 'Test' },
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
const result = validateDAG(invalidDAG);
|
|
95
|
+
expect(result.valid).toBe(false);
|
|
96
|
+
expect(result.errors[0]).toContain('task-999');
|
|
97
|
+
});
|
|
98
|
+
it('should detect circular dependencies', () => {
|
|
99
|
+
const cyclicDAG = {
|
|
100
|
+
...validDAG,
|
|
101
|
+
tasks: [
|
|
102
|
+
{ id: 'task-001', depends_on: ['task-002'], complexity: 'HIGH', subtask_prompt: 'A' },
|
|
103
|
+
{ id: 'task-002', depends_on: ['task-001'], complexity: 'MED', subtask_prompt: 'B' },
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
const result = validateDAG(cyclicDAG);
|
|
107
|
+
expect(result.valid).toBe(false);
|
|
108
|
+
expect(result.errors.some(e => e.includes('Circular'))).toBe(true);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
describe('computeRanks', () => {
|
|
112
|
+
it('should assign rank 0 to tasks with no dependencies', () => {
|
|
113
|
+
const ranks = computeRanks(validDAG);
|
|
114
|
+
expect(ranks.get('task-001')).toBe(0);
|
|
115
|
+
expect(ranks.get('task-002')).toBe(0);
|
|
116
|
+
});
|
|
117
|
+
it('should assign rank 1 to tasks that depend on rank-0 tasks', () => {
|
|
118
|
+
const ranks = computeRanks(validDAG);
|
|
119
|
+
expect(ranks.get('task-003')).toBe(1);
|
|
120
|
+
});
|
|
121
|
+
it('should assign rank 2 to tasks that depend on rank-1 tasks', () => {
|
|
122
|
+
const ranks = computeRanks(validDAG);
|
|
123
|
+
expect(ranks.get('task-004')).toBe(2);
|
|
124
|
+
});
|
|
125
|
+
it('should identify parallelizable tasks (same rank)', () => {
|
|
126
|
+
const ranks = computeRanks(validDAG);
|
|
127
|
+
const rank0Tasks = [...ranks.entries()].filter(([, r]) => r === 0).map(([id]) => id);
|
|
128
|
+
expect(rank0Tasks).toContain('task-001');
|
|
129
|
+
expect(rank0Tasks).toContain('task-002');
|
|
130
|
+
expect(rank0Tasks).toHaveLength(2);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=dag-converter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag-converter.test.js","sourceRoot":"","sources":["../../src/__tests__/dag-converter.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAgB9C,8BAA8B;AAC9B,SAAS,WAAW,CAAC,GAAc;IACjC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAElD,0BAA0B;IAC1B,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAC1C,CAAC;IAED,2BAA2B;IAC3B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE,8BAA8B,GAAG,GAAG,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,SAAS,QAAQ,CAAC,MAAc;QAC9B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,MAA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AC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YAC1D,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,MAAM,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;YACrF,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzC,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzC,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/validators.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
// Inline validators to avoid import issues in tests
|
|
3
|
+
function isValidProjectName(name) {
|
|
4
|
+
return /^[a-z0-9-_]+$/.test(name) && name.length >= 2 && name.length <= 50;
|
|
5
|
+
}
|
|
6
|
+
function sanitizeProjectName(name) {
|
|
7
|
+
return name
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.replace(/[^a-z0-9-_]/g, '-')
|
|
10
|
+
.replace(/-+/g, '-')
|
|
11
|
+
.replace(/^-|-$/g, '');
|
|
12
|
+
}
|
|
13
|
+
describe('validators', () => {
|
|
14
|
+
describe('isValidProjectName', () => {
|
|
15
|
+
it('should accept valid lowercase names', () => {
|
|
16
|
+
expect(isValidProjectName('my-project')).toBe(true);
|
|
17
|
+
expect(isValidProjectName('myproject')).toBe(true);
|
|
18
|
+
expect(isValidProjectName('my_project')).toBe(true);
|
|
19
|
+
expect(isValidProjectName('project123')).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
it('should reject names with uppercase letters', () => {
|
|
22
|
+
expect(isValidProjectName('MyProject')).toBe(false);
|
|
23
|
+
expect(isValidProjectName('MY_PROJECT')).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
it('should reject names with spaces', () => {
|
|
26
|
+
expect(isValidProjectName('my project')).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
it('should reject names with special characters', () => {
|
|
29
|
+
expect(isValidProjectName('my@project')).toBe(false);
|
|
30
|
+
expect(isValidProjectName('my.project')).toBe(false);
|
|
31
|
+
expect(isValidProjectName('my/project')).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it('should reject names that are too short', () => {
|
|
34
|
+
expect(isValidProjectName('a')).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
it('should reject names that are too long', () => {
|
|
37
|
+
expect(isValidProjectName('a'.repeat(51))).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
it('should accept names at boundary lengths', () => {
|
|
40
|
+
expect(isValidProjectName('ab')).toBe(true);
|
|
41
|
+
expect(isValidProjectName('a'.repeat(50))).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe('sanitizeProjectName', () => {
|
|
45
|
+
it('should convert uppercase to lowercase', () => {
|
|
46
|
+
expect(sanitizeProjectName('MyProject')).toBe('myproject');
|
|
47
|
+
});
|
|
48
|
+
it('should replace spaces with hyphens', () => {
|
|
49
|
+
expect(sanitizeProjectName('my project')).toBe('my-project');
|
|
50
|
+
});
|
|
51
|
+
it('should replace special characters with hyphens', () => {
|
|
52
|
+
expect(sanitizeProjectName('my@project!')).toBe('my-project-');
|
|
53
|
+
});
|
|
54
|
+
it('should collapse multiple hyphens', () => {
|
|
55
|
+
expect(sanitizeProjectName('my--project')).toBe('my-project');
|
|
56
|
+
});
|
|
57
|
+
it('should remove leading and trailing hyphens', () => {
|
|
58
|
+
expect(sanitizeProjectName('-my-project-')).toBe('my-project');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=validators.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.test.js","sourceRoot":"","sources":["../../src/__tests__/validators.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,oDAAoD;AACpD,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;AAC7E,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7C,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,MAAM,CAAC,kBAAk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0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { initCommand } from '../commands/init.js';
|
|
4
|
+
import { designCommand } from '../commands/design.js';
|
|
5
|
+
import { blueprintCommand } from '../commands/blueprint.js';
|
|
6
|
+
import { executeCommand } from '../commands/execute.js';
|
|
7
|
+
const program = new Command();
|
|
8
|
+
program
|
|
9
|
+
.name('dare')
|
|
10
|
+
.description('DARE Framework - Design, Architect, Review, Execute methodology for AI-assisted development')
|
|
11
|
+
.version('0.1.0');
|
|
12
|
+
program.addCommand(initCommand);
|
|
13
|
+
program.addCommand(designCommand);
|
|
14
|
+
program.addCommand(blueprintCommand);
|
|
15
|
+
program.addCommand(executeCommand);
|
|
16
|
+
program.parse(process.argv);
|
|
17
|
+
if (!process.argv.slice(2).length) {
|
|
18
|
+
program.outputHelp();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=dare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dare.js","sourceRoot":"","sources":["../../src/bin/dare.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,6FAA6F,CAAC;KAC1G,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEnC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../src/commands/blueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,gBAAgB,SAwIzB,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
export const blueprintCommand = new Command('blueprint')
|
|
6
|
+
.description('Generate BLUEPRINT.md and dare-dag.yaml from DESIGN.md')
|
|
7
|
+
.argument('[design-file]', 'Path to DESIGN.md', 'DARE/DESIGN.md')
|
|
8
|
+
.action(async (designFile) => {
|
|
9
|
+
console.log(chalk.blue.bold('\nšļø DARE Framework - Blueprint Phase\n'));
|
|
10
|
+
const dareDir = path.resolve(process.cwd(), 'DARE');
|
|
11
|
+
const designPath = path.resolve(process.cwd(), designFile);
|
|
12
|
+
if (!await fs.pathExists(designPath)) {
|
|
13
|
+
console.error(chalk.red(`ā DESIGN.md not found at ${designPath}`));
|
|
14
|
+
console.log(chalk.yellow('Run: dare design "Your project description"'));
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
await fs.ensureDir(dareDir);
|
|
18
|
+
// Generate BLUEPRINT.md
|
|
19
|
+
const blueprintContent = `# BLUEPRINT
|
|
20
|
+
|
|
21
|
+
## Architecture Overview
|
|
22
|
+
> Generated from DESIGN.md
|
|
23
|
+
|
|
24
|
+
## Technology Stack
|
|
25
|
+
- **Backend:** To be defined
|
|
26
|
+
- **Frontend:** To be defined
|
|
27
|
+
- **Database:** To be defined
|
|
28
|
+
- **Infrastructure:** To be defined
|
|
29
|
+
|
|
30
|
+
## Modules
|
|
31
|
+
### Module 1: Core
|
|
32
|
+
- Description
|
|
33
|
+
- Endpoints
|
|
34
|
+
- Data models
|
|
35
|
+
|
|
36
|
+
## API Contracts
|
|
37
|
+
\`\`\`yaml
|
|
38
|
+
openapi: 3.0.0
|
|
39
|
+
info:
|
|
40
|
+
title: Project API
|
|
41
|
+
version: 0.1.0
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
## Database Schema
|
|
45
|
+
\`\`\`sql
|
|
46
|
+
-- Tables to be defined
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
*Generated by DARE Framework - ${new Date().toISOString()}*
|
|
51
|
+
`;
|
|
52
|
+
// Generate dare-dag.yaml (DAG Task Runner)
|
|
53
|
+
const dagContent = `title: "Project - Development Tasks"
|
|
54
|
+
version: "1.0.0"
|
|
55
|
+
generated: "${new Date().toISOString()}"
|
|
56
|
+
|
|
57
|
+
models:
|
|
58
|
+
HIGH: "gpt-4"
|
|
59
|
+
MED: "gpt-4o-mini"
|
|
60
|
+
LOW: "gpt-4o-mini"
|
|
61
|
+
|
|
62
|
+
tasks:
|
|
63
|
+
- id: task-001
|
|
64
|
+
title: "Setup project structure"
|
|
65
|
+
depends_on: []
|
|
66
|
+
complexity: LOW
|
|
67
|
+
subtask_prompt: |
|
|
68
|
+
Setup the base project structure following the BLUEPRINT.md specifications.
|
|
69
|
+
Create all necessary directories, configuration files, and base dependencies.
|
|
70
|
+
|
|
71
|
+
- id: task-002
|
|
72
|
+
title: "Implement database schema"
|
|
73
|
+
depends_on: []
|
|
74
|
+
complexity: MED
|
|
75
|
+
subtask_prompt: |
|
|
76
|
+
Implement the database schema as defined in BLUEPRINT.md.
|
|
77
|
+
Create migrations, models, and seed data.
|
|
78
|
+
|
|
79
|
+
- id: task-003
|
|
80
|
+
title: "Implement core API endpoints"
|
|
81
|
+
depends_on: [task-001, task-002]
|
|
82
|
+
complexity: HIGH
|
|
83
|
+
subtask_prompt: |
|
|
84
|
+
Implement the core API endpoints as defined in BLUEPRINT.md.
|
|
85
|
+
Follow the API contracts and ensure proper error handling.
|
|
86
|
+
|
|
87
|
+
- id: task-004
|
|
88
|
+
title: "Implement authentication"
|
|
89
|
+
depends_on: [task-001, task-002]
|
|
90
|
+
complexity: HIGH
|
|
91
|
+
subtask_prompt: |
|
|
92
|
+
Implement authentication and authorization following security best practices.
|
|
93
|
+
|
|
94
|
+
- id: task-005
|
|
95
|
+
title: "Write tests"
|
|
96
|
+
depends_on: [task-003, task-004]
|
|
97
|
+
complexity: MED
|
|
98
|
+
subtask_prompt: |
|
|
99
|
+
Write unit and integration tests for all implemented features.
|
|
100
|
+
Ensure at least 80% code coverage.
|
|
101
|
+
`;
|
|
102
|
+
// Generate TASKS.md
|
|
103
|
+
const tasksContent = `# TASKS
|
|
104
|
+
|
|
105
|
+
## Status Legend
|
|
106
|
+
- ā³ PENDING
|
|
107
|
+
- š IN_PROGRESS
|
|
108
|
+
- ā
DONE
|
|
109
|
+
- ā FAILED
|
|
110
|
+
- āļø SKIPPED
|
|
111
|
+
|
|
112
|
+
## Tasks
|
|
113
|
+
|
|
114
|
+
| ID | Title | Status | Depends On | Complexity |
|
|
115
|
+
|----|-------|--------|------------|------------|
|
|
116
|
+
| task-001 | Setup project structure | ā³ PENDING | - | LOW |
|
|
117
|
+
| task-002 | Implement database schema | ā³ PENDING | - | MED |
|
|
118
|
+
| task-003 | Implement core API endpoints | ā³ PENDING | task-001, task-002 | HIGH |
|
|
119
|
+
| task-004 | Implement authentication | ā³ PENDING | task-001, task-002 | HIGH |
|
|
120
|
+
| task-005 | Write tests | ā³ PENDING | task-003, task-004 | MED |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
*Generated by DARE Framework - ${new Date().toISOString()}*
|
|
124
|
+
`;
|
|
125
|
+
await fs.writeFile(path.join(dareDir, 'BLUEPRINT.md'), blueprintContent);
|
|
126
|
+
await fs.writeFile(path.join(dareDir, 'dare-dag.yaml'), dagContent);
|
|
127
|
+
await fs.writeFile(path.join(dareDir, 'TASKS.md'), tasksContent);
|
|
128
|
+
console.log(chalk.green('ā
Files generated:'));
|
|
129
|
+
console.log(` ${chalk.cyan('DARE/BLUEPRINT.md')} - Architecture specification`);
|
|
130
|
+
console.log(` ${chalk.cyan('DARE/dare-dag.yaml')} - Task dependency graph`);
|
|
131
|
+
console.log(` ${chalk.cyan('DARE/TASKS.md')} - Task tracking\n`);
|
|
132
|
+
console.log(chalk.cyan('Next: dare execute --parallel\n'));
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=blueprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.js","sourceRoot":"","sources":["../../src/commands/blueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACrD,WAAW,CAAC,wDAAwD,CAAC;KACrE,QAAQ,CAAC,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,CAAC;KAChE,MAAM,CAAC,KAAK,EAAE,UAAkB,EAAE,EAAE;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,CAAC;IAE1E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IACpD,MAAM,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BAAoB,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,+BAA+B,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IAC9E,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../src/commands/design.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,aAAa,SAoCtB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
export const designCommand = new Command('design')
|
|
6
|
+
.description('Generate a DESIGN.md from a project description')
|
|
7
|
+
.argument('<description>', 'Project description')
|
|
8
|
+
.action(async (description) => {
|
|
9
|
+
console.log(chalk.blue.bold('\nš DARE Framework - Design Phase\n'));
|
|
10
|
+
const dareDir = path.resolve(process.cwd(), 'DARE');
|
|
11
|
+
await fs.ensureDir(dareDir);
|
|
12
|
+
const designContent = `# DESIGN
|
|
13
|
+
|
|
14
|
+
## Project Description
|
|
15
|
+
${description}
|
|
16
|
+
|
|
17
|
+
## Goals
|
|
18
|
+
- [ ] Define core requirements
|
|
19
|
+
- [ ] Identify stakeholders
|
|
20
|
+
- [ ] Map user journeys
|
|
21
|
+
|
|
22
|
+
## Constraints
|
|
23
|
+
- [ ] Technical constraints
|
|
24
|
+
- [ ] Business constraints
|
|
25
|
+
- [ ] Timeline constraints
|
|
26
|
+
|
|
27
|
+
## Success Criteria
|
|
28
|
+
- [ ] Define measurable outcomes
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
*Generated by DARE Framework - ${new Date().toISOString()}*
|
|
32
|
+
`;
|
|
33
|
+
const designPath = path.join(dareDir, 'DESIGN.md');
|
|
34
|
+
await fs.writeFile(designPath, designContent);
|
|
35
|
+
console.log(chalk.green(`ā
DESIGN.md created at ${designPath}`));
|
|
36
|
+
console.log(chalk.cyan('\nNext: dare blueprint\n'));
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=design.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/commands/design.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,iDAAiD,CAAC;KAC9D,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;KAChD,MAAM,CAAC,KAAK,EAAE,WAAmB,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC,CAAC;IAErE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IACpD,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAE5B,MAAM,aAAa,GAAG;;;EAGxB,WAAW;;;;;;;;;;;;;;;;iCAgBoB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACxD,CAAC;IAEE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACnD,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAE9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B,UAAU,EAAE,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/commands/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,cAAc,SAwDvB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { runDag } from '../dag-runner/run_dag.js';
|
|
6
|
+
import { convertYamlToDag } from '../utils/dag-converter.js';
|
|
7
|
+
export const executeCommand = new Command('execute')
|
|
8
|
+
.description('Execute tasks using DAG Task Runner')
|
|
9
|
+
.argument('[task-id]', 'Specific task ID to execute')
|
|
10
|
+
.option('--parallel', 'Execute independent tasks in parallel', false)
|
|
11
|
+
.option('--runner <runner>', 'Runner: cursor or antigravity', 'cursor')
|
|
12
|
+
.option('--dag <file>', 'Path to dare-dag.yaml', 'DARE/dare-dag.yaml')
|
|
13
|
+
.action(async (taskId, options) => {
|
|
14
|
+
console.log(chalk.blue.bold('\nā” DARE Framework - Execute Phase\n'));
|
|
15
|
+
const dagPath = path.resolve(process.cwd(), options.dag);
|
|
16
|
+
if (!await fs.pathExists(dagPath)) {
|
|
17
|
+
console.error(chalk.red(`ā dare-dag.yaml not found at ${dagPath}`));
|
|
18
|
+
console.log(chalk.yellow('Run: dare blueprint'));
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
const dagContent = await fs.readFile(dagPath, 'utf-8');
|
|
22
|
+
const dag = convertYamlToDag(dagContent);
|
|
23
|
+
if (taskId) {
|
|
24
|
+
const task = dag.tasks.find((t) => t.id === taskId);
|
|
25
|
+
if (!task) {
|
|
26
|
+
console.error(chalk.red(`ā Task ${taskId} not found in DAG`));
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
console.log(chalk.cyan(`šÆ Executing single task: ${task.id} - ${task.title}`));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const pendingTasks = dag.tasks.filter((t) => t.status !== 'DONE');
|
|
33
|
+
console.log(chalk.cyan(`š Tasks to execute: ${pendingTasks.length}`));
|
|
34
|
+
console.log(chalk.cyan(`š Mode: ${options.parallel ? 'Parallel (DAG)' : 'Sequential'}`));
|
|
35
|
+
console.log(chalk.cyan(`š„ļø Runner: ${options.runner}\n`));
|
|
36
|
+
}
|
|
37
|
+
if (options.parallel) {
|
|
38
|
+
console.log(chalk.yellow('š Starting DAG Task Runner with parallel execution...\n'));
|
|
39
|
+
await runDag(dag, {
|
|
40
|
+
parallel: true,
|
|
41
|
+
runner: options.runner,
|
|
42
|
+
canvasPath: path.resolve(process.cwd(), 'DARE/.canvas.md'),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log(chalk.yellow('ā¶ļø Starting sequential execution...\n'));
|
|
47
|
+
for (const task of dag.tasks) {
|
|
48
|
+
if (task.status === 'DONE') {
|
|
49
|
+
console.log(chalk.gray(`āļø Skipping ${task.id} (already done)`));
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
console.log(chalk.cyan(`š Executing ${task.id}: ${task.title}`));
|
|
53
|
+
// Sequential execution placeholder
|
|
54
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
55
|
+
console.log(chalk.green(`ā
${task.id} completed`));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
console.log(chalk.green.bold('\nā
Execution complete!\n'));
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=execute.js.map
|