gbos 1.4.13 → 1.4.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gbos",
3
- "version": "1.4.13",
3
+ "version": "1.4.14",
4
4
  "description": "GBOS - Command line interface for GBOS services",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -650,6 +650,10 @@ async function autoCommand(options) {
650
650
  emitEvent('task_fetched', { task });
651
651
  });
652
652
 
653
+ orchestrator.on('task_status', ({ taskId, taskKey, status }) => {
654
+ emitEvent('task_status', { taskId, taskKey, status });
655
+ });
656
+
653
657
  orchestrator.on('log', ({ message, data }) => {
654
658
  emitEvent('log', { message, ...data });
655
659
  });
@@ -446,9 +446,15 @@ class Orchestrator extends EventEmitter {
446
446
  method: 'PATCH',
447
447
  body: { status: 'in_progress' },
448
448
  });
449
+ this.emit('task_status', { taskId: this.currentTask.id, taskKey: this.currentTask.task_key, status: 'in_progress' });
449
450
  } catch (e) {
450
451
  // Fall back to the /start endpoint
451
- await api.startTask(this.currentTask.id);
452
+ try {
453
+ await api.startTask(this.currentTask.id);
454
+ this.emit('task_status', { taskId: this.currentTask.id, taskKey: this.currentTask.task_key, status: 'in_progress' });
455
+ } catch (e2) {
456
+ this.log(`Failed to set task in_progress: ${e2.message}`);
457
+ }
452
458
  }
453
459
 
454
460
  this.stateMachine.transition(STATES.FETCH_TASK, {
@@ -661,6 +667,7 @@ class Orchestrator extends EventEmitter {
661
667
  },
662
668
  });
663
669
 
670
+ this.emit('task_status', { taskId: this.currentTask.id, taskKey: this.currentTask.task_key, status: 'review' });
664
671
  this.log(`Task ${this.currentTask.task_key || this.currentTask.id} set to review`);
665
672
 
666
673
  } catch (error) {