daedalion 0.0.1 → 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/README.md +20 -5
- package/bin/daedalion.js +12 -5
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +167 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/clean.d.ts +2 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +106 -0
- package/dist/commands/clean.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 +83 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +119 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +101 -0
- package/dist/config.js.map +1 -0
- package/dist/generators/agent.d.ts +3 -0
- package/dist/generators/agent.d.ts.map +1 -0
- package/dist/generators/agent.js +105 -0
- package/dist/generators/agent.js.map +1 -0
- package/dist/generators/instructions.d.ts +3 -0
- package/dist/generators/instructions.d.ts.map +1 -0
- package/{src → dist}/generators/instructions.js +42 -52
- package/dist/generators/instructions.js.map +1 -0
- package/dist/generators/prompt.d.ts +4 -0
- package/dist/generators/prompt.d.ts.map +1 -0
- package/{src → dist}/generators/prompt.js +96 -102
- package/dist/generators/prompt.js.map +1 -0
- package/dist/generators/skill.d.ts +3 -0
- package/dist/generators/skill.d.ts.map +1 -0
- package/dist/generators/skill.js +89 -0
- package/dist/generators/skill.js.map +1 -0
- package/dist/generators/tools.d.ts +3 -0
- package/dist/generators/tools.d.ts.map +1 -0
- package/dist/generators/tools.js +192 -0
- package/dist/generators/tools.js.map +1 -0
- package/dist/generators/workflow.d.ts +3 -0
- package/dist/generators/workflow.d.ts.map +1 -0
- package/{src → dist}/generators/workflow.js +47 -53
- package/dist/generators/workflow.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/{src → dist}/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/proposal.d.ts +3 -0
- package/dist/parsers/proposal.d.ts.map +1 -0
- package/dist/parsers/proposal.js +45 -0
- package/dist/parsers/proposal.js.map +1 -0
- package/dist/parsers/spec.d.ts +3 -0
- package/dist/parsers/spec.d.ts.map +1 -0
- package/dist/parsers/spec.js +87 -0
- package/dist/parsers/spec.js.map +1 -0
- package/dist/parsers/tasks.d.ts +4 -0
- package/dist/parsers/tasks.d.ts.map +1 -0
- package/dist/parsers/tasks.js +39 -0
- package/dist/parsers/tasks.js.map +1 -0
- package/dist/types.d.ts +107 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +46 -0
- package/dist/utils.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +47 -0
- package/dist/version.js.map +1 -0
- package/package.json +18 -3
- package/src/commands/build.js +0 -198
- package/src/commands/clean.js +0 -85
- package/src/commands/init.js +0 -88
- package/src/commands/validate.js +0 -141
- package/src/config.js +0 -50
- package/src/generators/agent.js +0 -121
- package/src/generators/skill.js +0 -105
- package/src/generators/tools.js +0 -183
- package/src/parsers/proposal.js +0 -52
- package/src/parsers/spec.js +0 -105
- package/src/parsers/tasks.js +0 -46
- package/src/utils.js +0 -51
- package/src/version.js +0 -60
package/src/parsers/proposal.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import { basename, dirname } from 'path';
|
|
3
|
-
import matter from 'gray-matter';
|
|
4
|
-
|
|
5
|
-
export function parseProposal(proposalPath) {
|
|
6
|
-
const content = readFileSync(proposalPath, 'utf-8');
|
|
7
|
-
const { data: frontmatter, content: body } = matter(content);
|
|
8
|
-
|
|
9
|
-
const changeName = basename(dirname(proposalPath));
|
|
10
|
-
const title = extractTitle(body);
|
|
11
|
-
const why = extractSection(body, 'Why');
|
|
12
|
-
const what = extractSection(body, 'What');
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
path: proposalPath,
|
|
16
|
-
changeName,
|
|
17
|
-
title,
|
|
18
|
-
frontmatter,
|
|
19
|
-
why,
|
|
20
|
-
what
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function extractTitle(content) {
|
|
25
|
-
const match = content.match(/^#\s+(.+)$/m);
|
|
26
|
-
return match ? match[1].trim() : 'Untitled Proposal';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function extractSection(content, sectionName) {
|
|
30
|
-
const lines = content.split('\n');
|
|
31
|
-
let inSection = false;
|
|
32
|
-
let sectionContent = [];
|
|
33
|
-
|
|
34
|
-
for (const line of lines) {
|
|
35
|
-
// Match ## Why or ## What (case insensitive)
|
|
36
|
-
const sectionMatch = line.match(/^##\s+(.+)$/);
|
|
37
|
-
if (sectionMatch) {
|
|
38
|
-
if (sectionMatch[1].toLowerCase() === sectionName.toLowerCase()) {
|
|
39
|
-
inSection = true;
|
|
40
|
-
continue;
|
|
41
|
-
} else if (inSection) {
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (inSection && line.trim()) {
|
|
47
|
-
sectionContent.push(line.trim());
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return sectionContent.join('\n') || null;
|
|
52
|
-
}
|
package/src/parsers/spec.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import { basename, dirname } from 'path';
|
|
3
|
-
import matter from 'gray-matter';
|
|
4
|
-
|
|
5
|
-
export function parseSpec(specPath) {
|
|
6
|
-
const content = readFileSync(specPath, 'utf-8');
|
|
7
|
-
const { data: frontmatter, content: body } = matter(content);
|
|
8
|
-
|
|
9
|
-
const domain = basename(dirname(specPath));
|
|
10
|
-
const title = extractTitle(body);
|
|
11
|
-
const requirements = extractRequirements(body);
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
path: specPath,
|
|
15
|
-
domain,
|
|
16
|
-
title,
|
|
17
|
-
frontmatter,
|
|
18
|
-
requirements
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function extractTitle(content) {
|
|
23
|
-
const match = content.match(/^#\s+(.+)$/m);
|
|
24
|
-
return match ? match[1].trim() : 'Untitled Specification';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function extractRequirements(content) {
|
|
28
|
-
const requirements = [];
|
|
29
|
-
const lines = content.split('\n');
|
|
30
|
-
|
|
31
|
-
let currentRequirement = null;
|
|
32
|
-
let currentScenario = null;
|
|
33
|
-
let inRequirementDescription = false;
|
|
34
|
-
|
|
35
|
-
for (let i = 0; i < lines.length; i++) {
|
|
36
|
-
const line = lines[i];
|
|
37
|
-
|
|
38
|
-
// Match ### Requirement: Name
|
|
39
|
-
const reqMatch = line.match(/^###\s+Requirement:\s*(.+)$/i);
|
|
40
|
-
if (reqMatch) {
|
|
41
|
-
if (currentRequirement) {
|
|
42
|
-
if (currentScenario) {
|
|
43
|
-
currentRequirement.scenarios.push(currentScenario);
|
|
44
|
-
}
|
|
45
|
-
requirements.push(currentRequirement);
|
|
46
|
-
}
|
|
47
|
-
currentRequirement = {
|
|
48
|
-
name: reqMatch[1].trim(),
|
|
49
|
-
description: '',
|
|
50
|
-
scenarios: []
|
|
51
|
-
};
|
|
52
|
-
currentScenario = null;
|
|
53
|
-
inRequirementDescription = true;
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Match #### Scenario: Name
|
|
58
|
-
const scenarioMatch = line.match(/^####\s+Scenario:\s*(.+)$/i);
|
|
59
|
-
if (scenarioMatch && currentRequirement) {
|
|
60
|
-
if (currentScenario) {
|
|
61
|
-
currentRequirement.scenarios.push(currentScenario);
|
|
62
|
-
}
|
|
63
|
-
currentScenario = {
|
|
64
|
-
name: scenarioMatch[1].trim(),
|
|
65
|
-
steps: []
|
|
66
|
-
};
|
|
67
|
-
inRequirementDescription = false;
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Stop description collection at any heading
|
|
72
|
-
if (line.match(/^#{1,4}\s+/)) {
|
|
73
|
-
inRequirementDescription = false;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Collect requirement description
|
|
78
|
-
if (inRequirementDescription && currentRequirement && line.trim()) {
|
|
79
|
-
if (currentRequirement.description) {
|
|
80
|
-
currentRequirement.description += ' ' + line.trim();
|
|
81
|
-
} else {
|
|
82
|
-
currentRequirement.description = line.trim();
|
|
83
|
-
}
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Collect scenario steps (lines starting with -)
|
|
88
|
-
if (currentScenario && line.match(/^\s*-\s+/)) {
|
|
89
|
-
const step = line.replace(/^\s*-\s+/, '').trim();
|
|
90
|
-
if (step) {
|
|
91
|
-
currentScenario.steps.push(step);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Push last requirement/scenario
|
|
97
|
-
if (currentRequirement) {
|
|
98
|
-
if (currentScenario) {
|
|
99
|
-
currentRequirement.scenarios.push(currentScenario);
|
|
100
|
-
}
|
|
101
|
-
requirements.push(currentRequirement);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return requirements;
|
|
105
|
-
}
|
package/src/parsers/tasks.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from 'fs';
|
|
2
|
-
|
|
3
|
-
export function parseTasks(tasksPath, maxItems = 10) {
|
|
4
|
-
if (!existsSync(tasksPath)) {
|
|
5
|
-
return { groups: [], items: [], hasMore: false };
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const content = readFileSync(tasksPath, 'utf-8');
|
|
9
|
-
return summarizeTasks(content, maxItems);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function summarizeTasks(content, maxItems = 10) {
|
|
13
|
-
const lines = content.split('\n');
|
|
14
|
-
const groups = [];
|
|
15
|
-
const items = [];
|
|
16
|
-
let currentGroup = null;
|
|
17
|
-
let totalItems = 0;
|
|
18
|
-
|
|
19
|
-
for (const line of lines) {
|
|
20
|
-
// Match headings as groups
|
|
21
|
-
const headingMatch = line.match(/^(#{1,3})\s+(.+)$/);
|
|
22
|
-
if (headingMatch) {
|
|
23
|
-
currentGroup = headingMatch[2].trim();
|
|
24
|
-
if (!groups.includes(currentGroup)) {
|
|
25
|
-
groups.push(currentGroup);
|
|
26
|
-
}
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Match top-level task items (- [ ] or - [x] or just -)
|
|
31
|
-
const taskMatch = line.match(/^-\s+(\[[ x]\])?\s*(.+)$/);
|
|
32
|
-
if (taskMatch && !line.match(/^\s{2,}-/)) {
|
|
33
|
-
totalItems++;
|
|
34
|
-
if (items.length < maxItems) {
|
|
35
|
-
const taskText = taskMatch[2].trim();
|
|
36
|
-
items.push(taskText);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
groups,
|
|
43
|
-
items,
|
|
44
|
-
hasMore: totalItems > maxItems
|
|
45
|
-
};
|
|
46
|
-
}
|
package/src/utils.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, existsSync } from 'fs';
|
|
2
|
-
import { dirname } from 'path';
|
|
3
|
-
|
|
4
|
-
export function ensureDir(filePath) {
|
|
5
|
-
const dir = dirname(filePath);
|
|
6
|
-
if (!existsSync(dir)) {
|
|
7
|
-
mkdirSync(dir, { recursive: true });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function extractFirstHeading(content) {
|
|
12
|
-
const match = content.match(/^#\s+(.+)$/m);
|
|
13
|
-
return match ? match[1].trim() : null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function extractDescription(content) {
|
|
17
|
-
const lines = content.split('\n');
|
|
18
|
-
let inFrontmatter = false;
|
|
19
|
-
let description = [];
|
|
20
|
-
|
|
21
|
-
for (const line of lines) {
|
|
22
|
-
if (line.trim() === '---') {
|
|
23
|
-
if (inFrontmatter) {
|
|
24
|
-
inFrontmatter = false;
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
inFrontmatter = true;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (inFrontmatter) continue;
|
|
32
|
-
|
|
33
|
-
if (line.startsWith('#')) continue;
|
|
34
|
-
|
|
35
|
-
if (line.trim() && !line.startsWith('##')) {
|
|
36
|
-
description.push(line.trim());
|
|
37
|
-
if (description.length >= 2) break;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (line.startsWith('##')) break;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return description.join(' ').slice(0, 200) || null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function slugify(text) {
|
|
47
|
-
return text
|
|
48
|
-
.toLowerCase()
|
|
49
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
50
|
-
.replace(/^-|-$/g, '');
|
|
51
|
-
}
|
package/src/version.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { dirname, join } from 'path';
|
|
5
|
-
|
|
6
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = dirname(__filename);
|
|
8
|
-
|
|
9
|
-
// Read version from package.json
|
|
10
|
-
const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
11
|
-
export const VERSION = pkg.version;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Get version string with commit hash for dev builds
|
|
15
|
-
* @returns {string} e.g., "0.0.1" or "0.0.1-dev+abc1234"
|
|
16
|
-
*/
|
|
17
|
-
export function getVersionString() {
|
|
18
|
-
const commitHash = getCommitHash();
|
|
19
|
-
if (commitHash && !isReleaseBuild()) {
|
|
20
|
-
return `${VERSION}-dev+${commitHash}`;
|
|
21
|
-
}
|
|
22
|
-
return VERSION;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Get short commit hash
|
|
27
|
-
* @returns {string|null}
|
|
28
|
-
*/
|
|
29
|
-
function getCommitHash() {
|
|
30
|
-
try {
|
|
31
|
-
return execSync('git rev-parse --short HEAD', {
|
|
32
|
-
encoding: 'utf-8',
|
|
33
|
-
stdio: ['pipe', 'pipe', 'ignore']
|
|
34
|
-
}).trim();
|
|
35
|
-
} catch {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Check if this is a release build (tagged or npm published)
|
|
42
|
-
* @returns {boolean}
|
|
43
|
-
*/
|
|
44
|
-
function isReleaseBuild() {
|
|
45
|
-
// Check if running from node_modules (npm installed)
|
|
46
|
-
if (__dirname.includes('node_modules')) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Check if current commit is tagged
|
|
51
|
-
try {
|
|
52
|
-
execSync('git describe --exact-match --tags HEAD', {
|
|
53
|
-
encoding: 'utf-8',
|
|
54
|
-
stdio: ['pipe', 'pipe', 'ignore']
|
|
55
|
-
});
|
|
56
|
-
return true;
|
|
57
|
-
} catch {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
}
|