orchestrix-yuri 4.1.2 → 4.1.3
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/lib/gateway/router.js +37 -16
- package/package.json +1 -1
package/lib/gateway/router.js
CHANGED
|
@@ -270,30 +270,51 @@ class Router {
|
|
|
270
270
|
parts.push(status.message);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
// Read project state
|
|
273
|
+
// Read project state — generate progress card even if orchestrator isn't tracking
|
|
274
274
|
const projectRoot = engine.resolveProjectRoot();
|
|
275
|
-
if (projectRoot) {
|
|
275
|
+
if (projectRoot && !this.orchestrator.isRunning()) {
|
|
276
276
|
const focusPath = path.join(projectRoot, '.yuri', 'focus.yaml');
|
|
277
277
|
if (fs.existsSync(focusPath)) {
|
|
278
278
|
try {
|
|
279
279
|
const focus = yaml.load(fs.readFileSync(focusPath, 'utf8')) || {};
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
280
|
+
|
|
281
|
+
// Dev phase in progress: generate progress card directly
|
|
282
|
+
if (focus.phase === 3 || focus.phase === '3') {
|
|
283
|
+
const phase3Path = path.join(projectRoot, '.yuri', 'state', 'phase3.yaml');
|
|
284
|
+
if (fs.existsSync(phase3Path)) {
|
|
285
|
+
const phase3 = yaml.load(fs.readFileSync(phase3Path, 'utf8')) || {};
|
|
286
|
+
if (phase3.status === 'in_progress') {
|
|
287
|
+
// Temporarily set orchestrator's project root to generate card
|
|
288
|
+
const savedRoot = this.orchestrator._projectRoot;
|
|
289
|
+
const savedSession = this.orchestrator._session;
|
|
290
|
+
const savedStarted = this.orchestrator._devStartedAt;
|
|
291
|
+
|
|
292
|
+
this.orchestrator._projectRoot = projectRoot;
|
|
293
|
+
if (phase3.tmux && phase3.tmux.session) {
|
|
294
|
+
this.orchestrator._session = phase3.tmux.session;
|
|
295
|
+
}
|
|
296
|
+
this.orchestrator._devStartedAt = phase3.started_at
|
|
297
|
+
? new Date(phase3.started_at).getTime() : Date.now();
|
|
298
|
+
|
|
299
|
+
try {
|
|
300
|
+
const progress = this.orchestrator._gatherDevProgress();
|
|
301
|
+
const card = this.orchestrator._buildProgressCard(progress);
|
|
302
|
+
parts.push(card);
|
|
303
|
+
} catch { /* fallback below */ }
|
|
304
|
+
|
|
305
|
+
// Restore
|
|
306
|
+
this.orchestrator._projectRoot = savedRoot;
|
|
307
|
+
this.orchestrator._session = savedSession;
|
|
308
|
+
this.orchestrator._devStartedAt = savedStarted;
|
|
294
309
|
}
|
|
295
310
|
}
|
|
296
311
|
}
|
|
312
|
+
|
|
313
|
+
// Fallback: show pulse/step if no card was generated
|
|
314
|
+
if (parts.length === 0) {
|
|
315
|
+
if (focus.pulse) parts.push(`Pulse: ${focus.pulse}`);
|
|
316
|
+
if (focus.step) parts.push(`Step: ${focus.step}`);
|
|
317
|
+
}
|
|
297
318
|
} catch { /* ok */ }
|
|
298
319
|
}
|
|
299
320
|
}
|