kspec 1.0.18 → 1.0.19
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/package.json +1 -1
- package/src/index.js +11 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -248,7 +248,17 @@ function getCurrentSpec() {
|
|
|
248
248
|
const file = path.join(KSPEC_DIR, '.current');
|
|
249
249
|
if (fs.existsSync(file)) {
|
|
250
250
|
const spec = fs.readFileSync(file, 'utf8').trim();
|
|
251
|
+
// Handle full path format
|
|
251
252
|
if (fs.existsSync(spec)) return spec;
|
|
253
|
+
// Handle just folder name (from agent mode)
|
|
254
|
+
const fullPath = path.join(getSpecsDir(), spec);
|
|
255
|
+
if (fs.existsSync(fullPath)) return fullPath;
|
|
256
|
+
// Handle folder name without date prefix - find matching spec
|
|
257
|
+
const specsDir = getSpecsDir();
|
|
258
|
+
if (fs.existsSync(specsDir)) {
|
|
259
|
+
const match = fs.readdirSync(specsDir).find(d => d.includes(spec) || spec.includes(d));
|
|
260
|
+
if (match) return path.join(specsDir, match);
|
|
261
|
+
}
|
|
252
262
|
}
|
|
253
263
|
return null;
|
|
254
264
|
}
|
|
@@ -1287,4 +1297,4 @@ async function run(args) {
|
|
|
1287
1297
|
}
|
|
1288
1298
|
}
|
|
1289
1299
|
|
|
1290
|
-
module.exports = { run, commands, loadConfig, detectCli, requireCli, agentTemplates, getTaskStats, refreshContext, getCurrentTask, checkForUpdates, compareVersions, hasAtlassianMcp, getMcpConfig };
|
|
1300
|
+
module.exports = { run, commands, loadConfig, detectCli, requireCli, agentTemplates, getTaskStats, refreshContext, getCurrentSpec, getCurrentTask, checkForUpdates, compareVersions, hasAtlassianMcp, getMcpConfig };
|