@mytechtoday/augment-sdd 1.0.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/.eslintrc.json +20 -0
- package/out/commands/executeBeadsBatch.js +165 -0
- package/out/commands/executeBeadsBatch.js.map +1 -0
- package/out/commands/fullPipeline.js +129 -0
- package/out/commands/fullPipeline.js.map +1 -0
- package/out/commands/generateBeads.js +148 -0
- package/out/commands/generateBeads.js.map +1 -0
- package/out/commands/generateOpenSpec.js +241 -0
- package/out/commands/generateOpenSpec.js.map +1 -0
- package/out/dashboard/DashboardPanel.js +171 -0
- package/out/dashboard/DashboardPanel.js.map +1 -0
- package/out/extension.js +96 -0
- package/out/extension.js.map +1 -0
- package/out/parsers/parseBeadUpdates.js +28 -0
- package/out/parsers/parseBeadUpdates.js.map +1 -0
- package/out/parsers/parseTasksMarkdown.js +49 -0
- package/out/parsers/parseTasksMarkdown.js.map +1 -0
- package/out/test/integration/executeBeadsBatch.test.js +155 -0
- package/out/test/integration/executeBeadsBatch.test.js.map +1 -0
- package/out/test/integration/generateOpenSpec.test.js +154 -0
- package/out/test/integration/generateOpenSpec.test.js.map +1 -0
- package/out/test/runTest.js +47 -0
- package/out/test/runTest.js.map +1 -0
- package/out/test/suite/index.js +74 -0
- package/out/test/suite/index.js.map +1 -0
- package/out/test/unit/parseBeadUpdates.test.js +73 -0
- package/out/test/unit/parseBeadUpdates.test.js.map +1 -0
- package/out/test/unit/parseTasksMarkdown.test.js +69 -0
- package/out/test/unit/parseTasksMarkdown.test.js.map +1 -0
- package/out/test/unit/runCli.test.js +113 -0
- package/out/test/unit/runCli.test.js.map +1 -0
- package/out/utils/detectCli.js +30 -0
- package/out/utils/detectCli.js.map +1 -0
- package/out/utils/getConfig.js +60 -0
- package/out/utils/getConfig.js.map +1 -0
- package/out/utils/logger.js +30 -0
- package/out/utils/logger.js.map +1 -0
- package/out/utils/runCli.js +122 -0
- package/out/utils/runCli.js.map +1 -0
- package/package.json +111 -0
- package/src/commands/executeBeadsBatch.ts +153 -0
- package/src/commands/fullPipeline.ts +120 -0
- package/src/commands/generateBeads.ts +127 -0
- package/src/commands/generateOpenSpec.ts +227 -0
- package/src/dashboard/DashboardPanel.ts +168 -0
- package/src/extension.ts +77 -0
- package/src/parsers/parseBeadUpdates.ts +26 -0
- package/src/parsers/parseTasksMarkdown.ts +61 -0
- package/src/test/integration/executeBeadsBatch.test.ts +129 -0
- package/src/test/integration/generateOpenSpec.test.ts +129 -0
- package/src/test/runTest.ts +15 -0
- package/src/test/suite/index.ts +37 -0
- package/src/test/unit/parseBeadUpdates.test.ts +48 -0
- package/src/test/unit/parseTasksMarkdown.test.ts +41 -0
- package/src/test/unit/runCli.test.ts +109 -0
- package/src/utils/detectCli.ts +28 -0
- package/src/utils/getConfig.ts +25 -0
- package/src/utils/logger.ts +42 -0
- package/src/utils/runCli.ts +102 -0
- package/tsconfig.json +18 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"ecmaVersion": 2020,
|
|
6
|
+
"sourceType": "module"
|
|
7
|
+
},
|
|
8
|
+
"plugins": ["@typescript-eslint"],
|
|
9
|
+
"extends": [
|
|
10
|
+
"eslint:recommended",
|
|
11
|
+
"plugin:@typescript-eslint/recommended"
|
|
12
|
+
],
|
|
13
|
+
"rules": {
|
|
14
|
+
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
|
|
15
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
16
|
+
"@typescript-eslint/no-explicit-any": "warn"
|
|
17
|
+
},
|
|
18
|
+
"ignorePatterns": ["out", "node_modules"]
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.executeBeadsBatch = executeBeadsBatch;
|
|
37
|
+
/**
|
|
38
|
+
* executeBeadsBatch — Bead 7 command implementation.
|
|
39
|
+
*
|
|
40
|
+
* Steps (tasks 7.1-7.7):
|
|
41
|
+
* 7.1 Fetch and JSON-parse bd ready --json; exit gracefully if empty.
|
|
42
|
+
* 7.2 Slice first N beads per augmentSdd.batchSize setting (default 3).
|
|
43
|
+
* 7.3 Build batch Auggie prompt with --- BEAD START --- sentinels.
|
|
44
|
+
* 7.4 Execute auggie --print --quiet via runCli.
|
|
45
|
+
* 7.5 Parse bd update sentinel lines from response.
|
|
46
|
+
* 7.6 Execute each parsed bd update command; continue on partial failure.
|
|
47
|
+
* 7.7 Show warning if no sentinel lines were parsed from Auggie response.
|
|
48
|
+
*/
|
|
49
|
+
const vscode = __importStar(require("vscode"));
|
|
50
|
+
const runCli_1 = require("../utils/runCli");
|
|
51
|
+
const getConfig_1 = require("../utils/getConfig");
|
|
52
|
+
const logger_1 = require("../utils/logger");
|
|
53
|
+
const parseBeadUpdates_1 = require("../parsers/parseBeadUpdates");
|
|
54
|
+
/** Entry point registered as `augmentSdd.executeBeadsBatch`. */
|
|
55
|
+
async function executeBeadsBatch() {
|
|
56
|
+
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
|
|
57
|
+
if (!workspaceRoot) {
|
|
58
|
+
vscode.window.showErrorMessage('Augment SDD: No workspace folder open.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// 7.1 Fetch ready beads
|
|
62
|
+
let beads;
|
|
63
|
+
try {
|
|
64
|
+
const raw = await (0, runCli_1.runCli)('bd', ['ready', '--json'], workspaceRoot, 30000, logger_1.log);
|
|
65
|
+
beads = JSON.parse(raw);
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
69
|
+
(0, logger_1.log)(`executeBeadsBatch: failed to fetch ready beads — ${msg}`);
|
|
70
|
+
const action = await vscode.window.showErrorMessage(`Augment SDD: Failed to fetch ready beads. ${msg}`, 'View Logs');
|
|
71
|
+
if (action === 'View Logs') {
|
|
72
|
+
(0, logger_1.revealOutputChannel)();
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (beads.length === 0) {
|
|
77
|
+
vscode.window.showInformationMessage('Augment SDD: No beads ready.');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// 7.2 Slice to batchSize
|
|
81
|
+
const batchSize = (0, getConfig_1.getConfig)('batchSize', 3);
|
|
82
|
+
const batch = beads.slice(0, batchSize);
|
|
83
|
+
(0, logger_1.log)(`executeBeadsBatch: ${batch.length} bead(s) selected (batchSize=${batchSize})`);
|
|
84
|
+
// 7.3 Build prompt
|
|
85
|
+
const prompt = buildBatchPrompt(batch);
|
|
86
|
+
(0, logger_1.log)(`executeBeadsBatch: prompt length=${prompt.length}`);
|
|
87
|
+
// 7.4 Run Auggie
|
|
88
|
+
let auggieOutput;
|
|
89
|
+
try {
|
|
90
|
+
const extraFlags = (0, getConfig_1.getConfig)('auggieExtraFlags', '');
|
|
91
|
+
const args = ['--print', '--quiet', prompt];
|
|
92
|
+
if (extraFlags) {
|
|
93
|
+
args.push(...extraFlags.split(/\s+/).filter(Boolean));
|
|
94
|
+
}
|
|
95
|
+
auggieOutput = await (0, runCli_1.runCli)('auggie', args, workspaceRoot, 600000, logger_1.log);
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
99
|
+
(0, logger_1.log)(`executeBeadsBatch: Auggie failed — ${msg}`);
|
|
100
|
+
const action = await vscode.window.showErrorMessage(`Augment SDD: Auggie execution failed. ${msg}`, 'View Logs');
|
|
101
|
+
if (action === 'View Logs') {
|
|
102
|
+
(0, logger_1.revealOutputChannel)();
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// 7.5 Parse sentinel lines
|
|
107
|
+
const updates = (0, parseBeadUpdates_1.parseBeadUpdates)(auggieOutput);
|
|
108
|
+
(0, logger_1.log)(`executeBeadsBatch: parsed ${updates.length} sentinel line(s)`);
|
|
109
|
+
// 7.7 Warn if no sentinels found
|
|
110
|
+
if (updates.length === 0) {
|
|
111
|
+
(0, logger_1.log)('executeBeadsBatch: WARNING — no bd update sentinel lines found in Auggie response');
|
|
112
|
+
const action = await vscode.window.showWarningMessage('Augment SDD: Auggie did not return any bead completion sentinels. Check logs for details.', 'View Logs');
|
|
113
|
+
if (action === 'View Logs') {
|
|
114
|
+
(0, logger_1.revealOutputChannel)();
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// 7.6 Execute each sentinel command; continue on partial failure
|
|
119
|
+
let successCount = 0;
|
|
120
|
+
let failureCount = 0;
|
|
121
|
+
for (const updateCmd of updates) {
|
|
122
|
+
const parts = updateCmd.split(/\s+/);
|
|
123
|
+
// parts: ['bd', 'update', '<id>', '--status', 'done']
|
|
124
|
+
const args = parts.slice(1); // drop 'bd'
|
|
125
|
+
try {
|
|
126
|
+
await (0, runCli_1.runCli)('bd', args, workspaceRoot, 30000, logger_1.log);
|
|
127
|
+
(0, logger_1.log)(`executeBeadsBatch: ✓ ${updateCmd}`);
|
|
128
|
+
successCount++;
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
132
|
+
(0, logger_1.log)(`executeBeadsBatch: ✗ ${updateCmd} — ${msg}`);
|
|
133
|
+
failureCount++;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// Surface final result
|
|
137
|
+
if (failureCount === 0) {
|
|
138
|
+
vscode.window.showInformationMessage(`Augment SDD: Batch complete — ${successCount} bead(s) marked done.`);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const action = await vscode.window.showWarningMessage(`Augment SDD: Batch finished with ${failureCount} failure(s). ${successCount} bead(s) succeeded.`, 'View Logs');
|
|
142
|
+
if (action === 'View Logs') {
|
|
143
|
+
(0, logger_1.revealOutputChannel)();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 7.3: Construct the multi-bead Auggie prompt with --- BEAD START --- sentinels.
|
|
149
|
+
*/
|
|
150
|
+
function buildBatchPrompt(beads) {
|
|
151
|
+
const header = [
|
|
152
|
+
'You are Auggie, a senior engineer working inside this codebase.',
|
|
153
|
+
'Implement the following beads one at a time. For each bead:',
|
|
154
|
+
'',
|
|
155
|
+
'1. Understand the requirements from the provided OpenSpec context.',
|
|
156
|
+
'2. Make all necessary code changes.',
|
|
157
|
+
'3. At the VERY END of your response for that specific bead, output EXACTLY this line and nothing else on that line:',
|
|
158
|
+
' bd update <BEAD-ID> --status done',
|
|
159
|
+
'',
|
|
160
|
+
'Do not output any other bd commands unless completing a bead.',
|
|
161
|
+
].join('\n');
|
|
162
|
+
const sections = beads.map(b => `--- BEAD START ---\nID: ${b.id}\nTitle: ${b.title}\nDescription: ${b.description}`).join('\n\n');
|
|
163
|
+
return `${header}\n\n${sections}`;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=executeBeadsBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeBeadsBatch.js","sourceRoot":"","sources":["../../src/commands/executeBeadsBatch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,8CAsGC;AAhID;;;;;;;;;;;GAWG;AACH,+CAAiC;AACjC,4CAAyC;AACzC,kDAA+C;AAC/C,4CAA2D;AAC3D,kEAA+D;AAS/D,gEAAgE;AACzD,KAAK,UAAU,iBAAiB;IACrC,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IACzE,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,CAAC;QACzE,OAAO;IACT,CAAC;IAED,wBAAwB;IACxB,IAAI,KAAkB,CAAC;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,M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CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,KAAkB;IAC1C,MAAM,MAAM,GAAG;QACb,iEAAiE;QACjE,6DAA6D;QAC7D,EAAE;QACF,oEAAoE;QACpE,qCAAqC;QACrC,qHAAqH;QACrH,sCAAsC;QACtC,EAAE;QACF,+DAA+D;KAChE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAC7B,2BAA2B,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,WAAW,EAAE,CACpF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,OAAO,GAAG,MAAM,OAAO,QAAQ,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.fullPipeline = fullPipeline;
|
|
37
|
+
/**
|
|
38
|
+
* fullPipeline — Bead 8 command implementation.
|
|
39
|
+
*
|
|
40
|
+
* Steps (tasks 8.1-8.4):
|
|
41
|
+
* 8.1 Wire generateOpenSpec -> generateBeads -> executeBeadsBatch behind
|
|
42
|
+
* a VS Code progress notification.
|
|
43
|
+
* 8.2 Update progress indicator at each step boundary.
|
|
44
|
+
* 8.3 Halt pipeline on step failure; show step name, error, and offer
|
|
45
|
+
* Resume from step X quick-pick options.
|
|
46
|
+
* 8.4 Implement resume logic: skip steps before the selected resume point.
|
|
47
|
+
*/
|
|
48
|
+
const vscode = __importStar(require("vscode"));
|
|
49
|
+
const logger_1 = require("../utils/logger");
|
|
50
|
+
const getConfig_1 = require("../utils/getConfig");
|
|
51
|
+
const DashboardPanel_1 = require("../dashboard/DashboardPanel");
|
|
52
|
+
const generateOpenSpec_1 = require("./generateOpenSpec");
|
|
53
|
+
const generateBeads_1 = require("./generateBeads");
|
|
54
|
+
const executeBeadsBatch_1 = require("./executeBeadsBatch");
|
|
55
|
+
/** All pipeline steps in execution order. */
|
|
56
|
+
const PIPELINE_STEPS = [
|
|
57
|
+
{ name: 'generateOpenSpec', label: 'Generating OpenSpec…', run: generateOpenSpec_1.generateOpenSpec },
|
|
58
|
+
{ name: 'generateBeads', label: 'Generating Beads…', run: generateBeads_1.generateBeads },
|
|
59
|
+
{ name: 'executeBeadsBatch', label: 'Executing Beads Batch…', run: executeBeadsBatch_1.executeBeadsBatch },
|
|
60
|
+
];
|
|
61
|
+
/** Entry point registered as `augmentSdd.fullPipeline`. */
|
|
62
|
+
async function fullPipeline(startFromIndex = 0) {
|
|
63
|
+
const steps = PIPELINE_STEPS.slice(startFromIndex);
|
|
64
|
+
const totalSteps = PIPELINE_STEPS.length;
|
|
65
|
+
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
|
|
66
|
+
await vscode.window.withProgress({
|
|
67
|
+
location: vscode.ProgressLocation.Notification,
|
|
68
|
+
title: 'Augment SDD: Full Pipeline',
|
|
69
|
+
cancellable: false,
|
|
70
|
+
}, async (progress) => {
|
|
71
|
+
for (const step of steps) {
|
|
72
|
+
const globalIndex = PIPELINE_STEPS.indexOf(step);
|
|
73
|
+
const stepNum = globalIndex + 1;
|
|
74
|
+
const pct = Math.round(((globalIndex) / totalSteps) * 100);
|
|
75
|
+
progress.report({
|
|
76
|
+
message: `Step ${stepNum}/${totalSteps}: ${step.label}`,
|
|
77
|
+
increment: pct === 0 ? 0 : Math.round(100 / totalSteps),
|
|
78
|
+
});
|
|
79
|
+
(0, logger_1.log)(`fullPipeline: starting step ${stepNum}/${totalSteps} — ${step.name}`);
|
|
80
|
+
try {
|
|
81
|
+
await step.run();
|
|
82
|
+
(0, logger_1.log)(`fullPipeline: step ${stepNum} completed — ${step.name}`);
|
|
83
|
+
// Open / refresh the dashboard after each successful step if the setting is enabled.
|
|
84
|
+
if ((0, getConfig_1.getConfig)('enableWebviewDashboard', true) && workspaceRoot) {
|
|
85
|
+
DashboardPanel_1.DashboardPanel.show(workspaceRoot);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
90
|
+
(0, logger_1.log)(`fullPipeline: step ${stepNum} FAILED — ${step.name}: ${errMsg}`);
|
|
91
|
+
await handleStepFailure(step.name, stepNum, errMsg);
|
|
92
|
+
return; // abort progress handler; resume handled separately
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// All steps succeeded
|
|
96
|
+
progress.report({ message: 'Complete!', increment: 100 });
|
|
97
|
+
(0, logger_1.log)('fullPipeline: all steps completed successfully');
|
|
98
|
+
vscode.window.showInformationMessage('Augment SDD: Full pipeline complete — OpenSpec generated, beads created, and batch executed.');
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 8.3: Show error notification with Resume from step X quick-pick options.
|
|
103
|
+
* Launches a new pipeline run from the selected resume point.
|
|
104
|
+
*/
|
|
105
|
+
async function handleStepFailure(stepName, failedStepNum, errMsg) {
|
|
106
|
+
// Build resume options for the failed step and all subsequent steps
|
|
107
|
+
const resumeOptions = PIPELINE_STEPS
|
|
108
|
+
.slice(failedStepNum - 1)
|
|
109
|
+
.map((s, i) => ({
|
|
110
|
+
label: `Resume from step ${failedStepNum + i}: ${s.name}`,
|
|
111
|
+
index: failedStepNum - 1 + i,
|
|
112
|
+
}));
|
|
113
|
+
const picked = await vscode.window.showErrorMessage(`Augment SDD: Pipeline failed at step ${failedStepNum} (${stepName}): ${errMsg}`, ...resumeOptions.map(o => o.label));
|
|
114
|
+
if (!picked) {
|
|
115
|
+
(0, logger_1.log)('fullPipeline: user dismissed resume dialog — pipeline aborted');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const selected = resumeOptions.find(o => o.label === picked);
|
|
119
|
+
if (selected !== undefined) {
|
|
120
|
+
(0, logger_1.log)(`fullPipeline: user selected resume from index ${selected.index} (${PIPELINE_STEPS[selected.index].name})`);
|
|
121
|
+
// Run the resumed pipeline (non-awaited so the progress handler can close)
|
|
122
|
+
setImmediate(() => {
|
|
123
|
+
fullPipeline(selected.index).catch(e => {
|
|
124
|
+
(0, logger_1.log)(`fullPipeline(resume): unexpected error — ${String(e)}`);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=fullPipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullPipeline.js","sourceRoot":"","sources":["../../src/commands/fullPipeline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,oCA6CC;AA/ED;;;;;;;;;;GAUG;AACH,+CAAiC;AACjC,4CAAsC;AACtC,kDAA+C;AAC/C,gEAA6D;AAC7D,yDAAsD;AACtD,mDAAgD;AAChD,2DAAwD;AASxD,6CAA6C;AAC7C,MAAM,cAAc,GAAmB;IACrC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,sBAAsB,EAAI,GAAG,EAAE,mCAAgB,EAAE;IACpF,EAAE,IAAI,EAAE,eAAe,EAAK,KAAK,EAAE,mBAAmB,EAAO,GAAG,EAAE,6BAAa,EAAE;IACjF,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,wBAAwB,EAAE,GAAG,EAAE,qCAAiB,EAAE;CACvF,CAAC;AAEF,2DAA2D;AACpD,KAAK,UAAU,YAAY,CAAC,cAAc,GAAG,CAAC;IACnD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC;IACzC,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAEzE,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAC9B;QACE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,YAAY;QAC9C,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,KAAK;KACnB,EACD,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC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AAQ,CAAC,KAAK,KAAK,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAChH,2EAA2E;QAC3E,YAAY,CAAC,GAAG,EAAE;YAChB,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACrC,IAAA,YAAG,EAAC,4CAA4C,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateBeads = generateBeads;
|
|
37
|
+
/**
|
|
38
|
+
* generateBeads — Bead 6 command implementation.
|
|
39
|
+
*
|
|
40
|
+
* Steps (tasks 6.1–6.5):
|
|
41
|
+
* 6.1 Glob openspec/changes/{id}/tasks.md and select the most recently modified.
|
|
42
|
+
* 6.2 Parse using parseTasksMarkdown (heading-based regex, design D3).
|
|
43
|
+
* 6.3 Execute bd create --title --description for each task.
|
|
44
|
+
* 6.4 Continue processing on individual bd create failures; log each one.
|
|
45
|
+
* 6.5 Run bd ready --json after all creates; display ready-bead count.
|
|
46
|
+
*/
|
|
47
|
+
const vscode = __importStar(require("vscode"));
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const runCli_1 = require("../utils/runCli");
|
|
51
|
+
const logger_1 = require("../utils/logger");
|
|
52
|
+
const parseTasksMarkdown_1 = require("../parsers/parseTasksMarkdown");
|
|
53
|
+
/** Entry point registered as `augmentSdd.generateBeads`. */
|
|
54
|
+
async function generateBeads() {
|
|
55
|
+
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
|
|
56
|
+
if (!workspaceRoot) {
|
|
57
|
+
vscode.window.showErrorMessage('Augment SDD: No workspace folder open.');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// 6.1 — Find the most recently modified tasks.md.
|
|
61
|
+
const tasksFile = findNewestTasksFile(workspaceRoot);
|
|
62
|
+
if (!tasksFile) {
|
|
63
|
+
vscode.window.showErrorMessage('Augment SDD: No tasks.md found in openspec/changes/. ' +
|
|
64
|
+
'Please run "Augment SDD: Generate OpenSpec" first.');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
(0, logger_1.log)(`Using tasks.md: ${tasksFile}`);
|
|
68
|
+
// 6.2 — Parse headings into tasks.
|
|
69
|
+
const content = fs.readFileSync(tasksFile, 'utf8');
|
|
70
|
+
const tasks = (0, parseTasksMarkdown_1.parseTasksMarkdown)(content);
|
|
71
|
+
if (tasks.length === 0) {
|
|
72
|
+
const snippet = content.slice(0, 300);
|
|
73
|
+
vscode.window.showErrorMessage(`Augment SDD: No markdown headings found in tasks.md.\n\nFile begins:\n${snippet}`);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
(0, logger_1.log)(`Parsed ${tasks.length} task(s) from ${path.basename(path.dirname(tasksFile))}/tasks.md`);
|
|
77
|
+
// 6.3–6.4 — Create beads; continue on individual failures.
|
|
78
|
+
let created = 0;
|
|
79
|
+
for (const task of tasks) {
|
|
80
|
+
try {
|
|
81
|
+
// Shell-quote title and description so spaces are preserved correctly
|
|
82
|
+
// when spawn joins args into a shell command string (shell: true).
|
|
83
|
+
const quotedTitle = `"${task.title.replace(/"/g, '\\"')}"`;
|
|
84
|
+
const quotedDesc = `"${task.description.replace(/"/g, '\\"')}"`;
|
|
85
|
+
await (0, runCli_1.runCli)('bd', ['create', quotedTitle, '--description', quotedDesc], workspaceRoot, 30000, logger_1.log);
|
|
86
|
+
created++;
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
90
|
+
(0, logger_1.log)(`bd create failed for "${task.title}": ${msg}`);
|
|
91
|
+
// Do NOT break — spec 6.4 requires continuing with remaining tasks.
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
(0, logger_1.log)(`Created ${created}/${tasks.length} bead(s).`);
|
|
95
|
+
// 6.5 — Run bd ready --json and display count.
|
|
96
|
+
try {
|
|
97
|
+
const readyJson = await (0, runCli_1.runCli)('bd', ['ready', '--json'], workspaceRoot, 30000, logger_1.log);
|
|
98
|
+
let readyCount = 0;
|
|
99
|
+
try {
|
|
100
|
+
const parsed = JSON.parse(readyJson);
|
|
101
|
+
readyCount = Array.isArray(parsed) ? parsed.length : 0;
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
(0, logger_1.log)('Warning: could not parse bd ready --json output as JSON array');
|
|
105
|
+
}
|
|
106
|
+
vscode.window.showInformationMessage(`Augment SDD: Created ${created}/${tasks.length} bead(s). ` +
|
|
107
|
+
`${readyCount} bead(s) ready to execute.`);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
111
|
+
(0, logger_1.log)(`bd ready --json failed: ${msg}`);
|
|
112
|
+
const action = await vscode.window.showInformationMessage(`Augment SDD: Created ${created}/${tasks.length} bead(s). ` +
|
|
113
|
+
`(Could not retrieve ready count.)`, 'View Logs');
|
|
114
|
+
if (action === 'View Logs') {
|
|
115
|
+
(0, logger_1.revealOutputChannel)();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// Helper
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
/**
|
|
123
|
+
* 6.1: Scan openspec/changes/{id}/tasks.md and return the path to the most
|
|
124
|
+
* recently modified file. Skips the 'archive' subdirectory.
|
|
125
|
+
* Returns undefined when no tasks.md is found.
|
|
126
|
+
*/
|
|
127
|
+
function findNewestTasksFile(workspaceRoot) {
|
|
128
|
+
const changesDir = path.join(workspaceRoot, 'openspec', 'changes');
|
|
129
|
+
if (!fs.existsSync(changesDir)) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const candidates = [];
|
|
133
|
+
for (const entry of fs.readdirSync(changesDir, { withFileTypes: true })) {
|
|
134
|
+
if (!entry.isDirectory() || entry.name === 'archive') {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const tasksPath = path.join(changesDir, entry.name, 'tasks.md');
|
|
138
|
+
if (fs.existsSync(tasksPath)) {
|
|
139
|
+
candidates.push({ filePath: tasksPath, mtime: fs.statSync(tasksPath).mtimeMs });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (candidates.length === 0) {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
candidates.sort((a, b) => b.mtime - a.mtime);
|
|
146
|
+
return candidates[0].filePath;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=generateBeads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateBeads.js","sourceRoot":"","sources":["../../src/commands/generateBeads.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,sCA+EC;AAjGD;;;;;;;;;GASG;AACH,+CAAiC;AACjC,uCAAyB;AACzB,2CAA6B;AAC7B,4CAAyC;AACzC,4CAA2D;AAC3D,sEAAmE;AAEnE,4DAA4D;AACrD,KAAK,UAAU,aAAa;IACjC,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IACzE,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,CAAC;QACzE,OAAO;IACT,CAAC;IAED,kDAAkD;IAClD,MAAM,SAAS,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACrD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAC5B,uDAAuD;YACvD,oDAAoD,CACrD,CAAC;QACF,OAAO;IACT,CAAC;IACD,IAAA,YAAG,EAAC,mBAAmB,SAAS,EAAE,CAAC,CAAC;IAEpC,mCAAmC;IACn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