@intentsolutions/blueprint 2.2.0 → 2.3.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/dist/cli.js +191 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/github/action.d.ts +27 -0
- package/dist/integrations/github/action.d.ts.map +1 -0
- package/dist/integrations/github/action.js +151 -0
- package/dist/integrations/github/action.js.map +1 -0
- package/dist/integrations/github/client.d.ts +78 -0
- package/dist/integrations/github/client.d.ts.map +1 -0
- package/dist/integrations/github/client.js +279 -0
- package/dist/integrations/github/client.js.map +1 -0
- package/dist/integrations/github/exporter.d.ts +53 -0
- package/dist/integrations/github/exporter.d.ts.map +1 -0
- package/dist/integrations/github/exporter.js +387 -0
- package/dist/integrations/github/exporter.js.map +1 -0
- package/dist/integrations/github/index.d.ts +10 -0
- package/dist/integrations/github/index.d.ts.map +1 -0
- package/dist/integrations/github/index.js +9 -0
- package/dist/integrations/github/index.js.map +1 -0
- package/dist/integrations/github/types.d.ts +70 -0
- package/dist/integrations/github/types.d.ts.map +1 -0
- package/dist/integrations/github/types.js +63 -0
- package/dist/integrations/github/types.js.map +1 -0
- package/dist/mcp/index.js +0 -0
- package/package.json +2 -1
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub API Client
|
|
3
|
+
* Handles all GitHub API interactions using Octokit
|
|
4
|
+
*/
|
|
5
|
+
import { Octokit } from '@octokit/rest';
|
|
6
|
+
import { CATEGORY_LABELS, PRIORITY_LABELS, } from './types.js';
|
|
7
|
+
export class GitHubClient {
|
|
8
|
+
octokit;
|
|
9
|
+
owner;
|
|
10
|
+
repo;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.octokit = new Octokit({
|
|
13
|
+
auth: config.token,
|
|
14
|
+
baseUrl: config.baseUrl,
|
|
15
|
+
});
|
|
16
|
+
this.owner = config.owner;
|
|
17
|
+
this.repo = config.repo;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Verify connection and permissions
|
|
21
|
+
*/
|
|
22
|
+
async verify() {
|
|
23
|
+
try {
|
|
24
|
+
const { data } = await this.octokit.repos.get({
|
|
25
|
+
owner: this.owner,
|
|
26
|
+
repo: this.repo,
|
|
27
|
+
});
|
|
28
|
+
if (!data.permissions?.push) {
|
|
29
|
+
return { valid: false, error: 'No push access to repository' };
|
|
30
|
+
}
|
|
31
|
+
return { valid: true };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
return {
|
|
35
|
+
valid: false,
|
|
36
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create or update labels
|
|
42
|
+
*/
|
|
43
|
+
async ensureLabels(labels) {
|
|
44
|
+
let created = 0;
|
|
45
|
+
let updated = 0;
|
|
46
|
+
for (const label of labels) {
|
|
47
|
+
try {
|
|
48
|
+
await this.octokit.issues.createLabel({
|
|
49
|
+
owner: this.owner,
|
|
50
|
+
repo: this.repo,
|
|
51
|
+
name: label.name,
|
|
52
|
+
color: label.color,
|
|
53
|
+
description: label.description,
|
|
54
|
+
});
|
|
55
|
+
created++;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
// Label might already exist, try to update
|
|
59
|
+
if (error.status === 422) {
|
|
60
|
+
try {
|
|
61
|
+
await this.octokit.issues.updateLabel({
|
|
62
|
+
owner: this.owner,
|
|
63
|
+
repo: this.repo,
|
|
64
|
+
name: label.name,
|
|
65
|
+
color: label.color,
|
|
66
|
+
description: label.description,
|
|
67
|
+
});
|
|
68
|
+
updated++;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Ignore update errors
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { created, updated };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a milestone
|
|
80
|
+
*/
|
|
81
|
+
async createMilestone(milestone) {
|
|
82
|
+
try {
|
|
83
|
+
const { data } = await this.octokit.issues.createMilestone({
|
|
84
|
+
owner: this.owner,
|
|
85
|
+
repo: this.repo,
|
|
86
|
+
title: milestone.title,
|
|
87
|
+
description: milestone.description,
|
|
88
|
+
due_on: milestone.dueOn,
|
|
89
|
+
state: milestone.state || 'open',
|
|
90
|
+
});
|
|
91
|
+
return data.number;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
// Milestone might already exist
|
|
95
|
+
if (error.status === 422) {
|
|
96
|
+
const existing = await this.findMilestone(milestone.title);
|
|
97
|
+
return existing;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Find milestone by title
|
|
104
|
+
*/
|
|
105
|
+
async findMilestone(title) {
|
|
106
|
+
try {
|
|
107
|
+
const { data } = await this.octokit.issues.listMilestones({
|
|
108
|
+
owner: this.owner,
|
|
109
|
+
repo: this.repo,
|
|
110
|
+
state: 'all',
|
|
111
|
+
});
|
|
112
|
+
const milestone = data.find((m) => m.title === title);
|
|
113
|
+
return milestone?.number || null;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Create an issue
|
|
121
|
+
*/
|
|
122
|
+
async createIssue(issue) {
|
|
123
|
+
try {
|
|
124
|
+
const { data } = await this.octokit.issues.create({
|
|
125
|
+
owner: this.owner,
|
|
126
|
+
repo: this.repo,
|
|
127
|
+
title: issue.title,
|
|
128
|
+
body: issue.body,
|
|
129
|
+
labels: issue.labels,
|
|
130
|
+
milestone: issue.milestone,
|
|
131
|
+
assignees: issue.assignees,
|
|
132
|
+
});
|
|
133
|
+
return { number: data.number, url: data.html_url };
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Create multiple issues from task breakdown
|
|
141
|
+
*/
|
|
142
|
+
async createIssuesFromTasks(tasks, options = {}) {
|
|
143
|
+
const results = [];
|
|
144
|
+
for (const task of tasks) {
|
|
145
|
+
const labels = ['blueprint', 'task'];
|
|
146
|
+
// Add priority label
|
|
147
|
+
if (task.priority && PRIORITY_LABELS[task.priority]) {
|
|
148
|
+
labels.push(PRIORITY_LABELS[task.priority].name);
|
|
149
|
+
}
|
|
150
|
+
// Add category label
|
|
151
|
+
if (task.category && CATEGORY_LABELS[task.category]) {
|
|
152
|
+
labels.push(CATEGORY_LABELS[task.category].name);
|
|
153
|
+
}
|
|
154
|
+
// Add prefix if specified
|
|
155
|
+
if (options.labelPrefix) {
|
|
156
|
+
labels.push(`${options.labelPrefix}:task`);
|
|
157
|
+
}
|
|
158
|
+
const body = this.formatTaskBody(task);
|
|
159
|
+
const result = await this.createIssue({
|
|
160
|
+
title: task.title,
|
|
161
|
+
body,
|
|
162
|
+
labels,
|
|
163
|
+
milestone: options.milestoneId,
|
|
164
|
+
});
|
|
165
|
+
if (result) {
|
|
166
|
+
results.push({ ...result, title: task.title });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return results;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Format task body for GitHub issue
|
|
173
|
+
*/
|
|
174
|
+
formatTaskBody(task) {
|
|
175
|
+
const lines = [];
|
|
176
|
+
lines.push('## Description');
|
|
177
|
+
lines.push(task.description);
|
|
178
|
+
lines.push('');
|
|
179
|
+
if (task.estimatedHours) {
|
|
180
|
+
lines.push(`**Estimated Time:** ${task.estimatedHours} hours`);
|
|
181
|
+
lines.push('');
|
|
182
|
+
}
|
|
183
|
+
if (task.dependencies && task.dependencies.length > 0) {
|
|
184
|
+
lines.push('## Dependencies');
|
|
185
|
+
for (const dep of task.dependencies) {
|
|
186
|
+
lines.push(`- [ ] ${dep}`);
|
|
187
|
+
}
|
|
188
|
+
lines.push('');
|
|
189
|
+
}
|
|
190
|
+
if (task.acceptanceCriteria && task.acceptanceCriteria.length > 0) {
|
|
191
|
+
lines.push('## Acceptance Criteria');
|
|
192
|
+
for (const ac of task.acceptanceCriteria) {
|
|
193
|
+
lines.push(`- [ ] ${ac}`);
|
|
194
|
+
}
|
|
195
|
+
lines.push('');
|
|
196
|
+
}
|
|
197
|
+
lines.push('---');
|
|
198
|
+
lines.push('*Generated by [Intent Blueprint](https://github.com/intent-solutions-io/intent-blueprint-docs)*');
|
|
199
|
+
return lines.join('\n');
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Create milestones from release phases
|
|
203
|
+
*/
|
|
204
|
+
async createMilestonesFromPhases(phases) {
|
|
205
|
+
const results = [];
|
|
206
|
+
for (const phase of phases) {
|
|
207
|
+
const milestoneId = await this.createMilestone({
|
|
208
|
+
title: phase.name,
|
|
209
|
+
description: phase.description,
|
|
210
|
+
dueOn: phase.endDate,
|
|
211
|
+
});
|
|
212
|
+
if (milestoneId) {
|
|
213
|
+
results.push({ number: milestoneId, title: phase.name });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return results;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Create PR templates
|
|
220
|
+
*/
|
|
221
|
+
async createPRTemplates(templates) {
|
|
222
|
+
let created = 0;
|
|
223
|
+
for (const template of templates) {
|
|
224
|
+
try {
|
|
225
|
+
const path = template.name === 'default'
|
|
226
|
+
? '.github/PULL_REQUEST_TEMPLATE.md'
|
|
227
|
+
: `.github/PULL_REQUEST_TEMPLATE/${template.name}.md`;
|
|
228
|
+
// Check if file exists
|
|
229
|
+
let sha;
|
|
230
|
+
try {
|
|
231
|
+
const { data } = await this.octokit.repos.getContent({
|
|
232
|
+
owner: this.owner,
|
|
233
|
+
repo: this.repo,
|
|
234
|
+
path,
|
|
235
|
+
});
|
|
236
|
+
if ('sha' in data) {
|
|
237
|
+
sha = data.sha;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
// File doesn't exist, that's fine
|
|
242
|
+
}
|
|
243
|
+
await this.octokit.repos.createOrUpdateFileContents({
|
|
244
|
+
owner: this.owner,
|
|
245
|
+
repo: this.repo,
|
|
246
|
+
path,
|
|
247
|
+
message: `docs: add ${template.name} PR template (Intent Blueprint)`,
|
|
248
|
+
content: Buffer.from(template.content).toString('base64'),
|
|
249
|
+
sha,
|
|
250
|
+
});
|
|
251
|
+
created++;
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
// Ignore errors for individual templates
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return created;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get repository info
|
|
261
|
+
*/
|
|
262
|
+
async getRepoInfo() {
|
|
263
|
+
try {
|
|
264
|
+
const { data } = await this.octokit.repos.get({
|
|
265
|
+
owner: this.owner,
|
|
266
|
+
repo: this.repo,
|
|
267
|
+
});
|
|
268
|
+
return {
|
|
269
|
+
name: data.full_name,
|
|
270
|
+
url: data.html_url,
|
|
271
|
+
defaultBranch: data.default_branch,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/github/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAWxC,OAAO,EACL,eAAe,EACf,eAAe,GAEhB,MAAM,YAAY,CAAC;AAEpB,MAAM,OAAO,YAAY;IACf,OAAO,CAAU;IACjB,KAAK,CAAS;IACd,IAAI,CAAS;IAErB,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AAC;wBAClB,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;oBACjB,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,kCAAkC;gBACpC,CAAC;gBAED,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC;oBAClD,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI;oBACJ,OAAO,EAAE,aAAa,QAAQ,CAAC,IAAI,iCAAiC;oBACpE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBACzD,GAAG;iBACJ,CAAC,CAAC;gBAEH,OAAO,EAAE,CAAC;YACZ,CAAC;YAAC,MAAM,CAAC;gBACP,yCAAyC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QACf,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;gBAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,SAAS;gBACpB,GAAG,EAAE,IAAI,CAAC,QAAQ;gBAClB,aAAa,EAAE,IAAI,CAAC,cAAc;aACnC,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Exporter
|
|
3
|
+
* Converts Blueprint documents to GitHub artifacts (issues, milestones, templates)
|
|
4
|
+
*/
|
|
5
|
+
import type { GitHubConfig, ExportResult, ExportOptions, TaskBreakdown, ReleasePhase, GitHubLabel } from './types.js';
|
|
6
|
+
import type { GeneratedDocument, TemplateContext } from '../../core/index.js';
|
|
7
|
+
export declare class GitHubExporter {
|
|
8
|
+
private client;
|
|
9
|
+
private options;
|
|
10
|
+
constructor(config: GitHubConfig, options?: ExportOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Export generated documents to GitHub
|
|
13
|
+
*/
|
|
14
|
+
export(documents: GeneratedDocument[], context: TemplateContext): Promise<ExportResult>;
|
|
15
|
+
/**
|
|
16
|
+
* Get all labels to create
|
|
17
|
+
*/
|
|
18
|
+
private getAllLabels;
|
|
19
|
+
/**
|
|
20
|
+
* Extract tasks from generated documents
|
|
21
|
+
*/
|
|
22
|
+
private extractTasks;
|
|
23
|
+
/**
|
|
24
|
+
* Parse tasks from markdown content
|
|
25
|
+
*/
|
|
26
|
+
private parseTasksFromMarkdown;
|
|
27
|
+
/**
|
|
28
|
+
* Extract release phases from documents
|
|
29
|
+
*/
|
|
30
|
+
private extractPhases;
|
|
31
|
+
/**
|
|
32
|
+
* Parse release phases from markdown
|
|
33
|
+
*/
|
|
34
|
+
private parsePhasesFromMarkdown;
|
|
35
|
+
/**
|
|
36
|
+
* Generate PR templates based on project context
|
|
37
|
+
*/
|
|
38
|
+
private generatePRTemplates;
|
|
39
|
+
/**
|
|
40
|
+
* Preview what would be exported (dry run)
|
|
41
|
+
*/
|
|
42
|
+
preview(documents: GeneratedDocument[], context: TemplateContext): Promise<{
|
|
43
|
+
labels: GitHubLabel[];
|
|
44
|
+
tasks: TaskBreakdown[];
|
|
45
|
+
phases: ReleasePhase[];
|
|
46
|
+
prTemplates: string[];
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Quick export function
|
|
51
|
+
*/
|
|
52
|
+
export declare function exportToGitHub(config: GitHubConfig, documents: GeneratedDocument[], context: TemplateContext, options?: ExportOptions): Promise<ExportResult>;
|
|
53
|
+
//# sourceMappingURL=exporter.d.ts.map
|
|
@@ -0,0 +1 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