tycono 0.1.52 → 0.1.54

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/bin/tycono.ts CHANGED
@@ -170,7 +170,8 @@ async function startServer(): Promise<void> {
170
170
  const { createHttpServer } = await import('../src/api/src/create-server.js');
171
171
  const server = createHttpServer();
172
172
 
173
- server.listen(port, () => {
173
+ const host = process.env.HOST || '0.0.0.0';
174
+ server.listen(port, host, () => {
174
175
  openBrowser(url);
175
176
  });
176
177
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.52",
3
+ "version": "0.1.54",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,6 +20,7 @@
20
20
  "dev": "npm run dev:api & npm run dev:web",
21
21
  "dev:api": "npm run dev --prefix src/api",
22
22
  "dev:web": "npm run dev --prefix src/web",
23
+ "build": "npm run build:web && npm run build:forge",
23
24
  "build:web": "npm run build --prefix src/web",
24
25
  "build:forge": "tsup --config tsup.forge.ts",
25
26
  "typecheck": "npm run typecheck:api && npm run typecheck:web",
@@ -157,18 +157,6 @@ function handleStartJob(body: Record<string, unknown>, res: ServerResponse): voi
157
157
  sourceRole: 'ceo',
158
158
  parentJobId,
159
159
  });
160
- roleStatus.set(cRole, 'working');
161
- // Clean up roleStatus when wave job completes — only if no other running jobs for same role
162
- const sub = (event: { type: string }) => {
163
- if (event.type === 'job:done' || event.type === 'job:error' || event.type === 'job:awaiting_input') {
164
- job.stream.unsubscribe(sub);
165
- const stillRunning = jobManager.listJobs({ status: 'running', roleId: cRole });
166
- if (stillRunning.length === 0) {
167
- roleStatus.set(cRole, 'idle');
168
- }
169
- }
170
- };
171
- job.stream.subscribe(sub);
172
160
  jobIds.push(job.id);
173
161
  }
174
162
 
@@ -197,20 +185,6 @@ function handleStartJob(body: Record<string, unknown>, res: ServerResponse): voi
197
185
  parentJobId,
198
186
  });
199
187
 
200
- roleStatus.set(roleId, 'working');
201
-
202
- // Clean up roleStatus when job completes — only if no other running jobs for same role
203
- const sub = (event: { type: string }) => {
204
- if (event.type === 'job:done' || event.type === 'job:error' || event.type === 'job:awaiting_input') {
205
- job.stream.unsubscribe(sub);
206
- const stillRunning = jobManager.listJobs({ status: 'running', roleId });
207
- if (stillRunning.length === 0) {
208
- roleStatus.set(roleId, 'idle');
209
- }
210
- }
211
- };
212
- job.stream.subscribe(sub);
213
-
214
188
  jsonResponse(res, 200, { jobId: job.id });
215
189
  }
216
190
 
@@ -498,9 +472,8 @@ function handleAssign(body: Record<string, unknown>, req: IncomingMessage, res:
498
472
  return;
499
473
  }
500
474
 
501
- // Start job via JobManager
475
+ // Start job via JobManager (JobManager is source of truth for job status)
502
476
  const job = jobManager.startJob({ type: 'assign', roleId, task, sourceRole, readOnly });
503
- roleStatus.set(roleId, 'working');
504
477
 
505
478
  // Bridge: stream job events as legacy SSE format
506
479
  startSSE(res);
@@ -535,14 +508,12 @@ function handleAssign(body: Record<string, unknown>, req: IncomingMessage, res:
535
508
  break;
536
509
  case 'job:done':
537
510
  cleanupLifecycle();
538
- roleStatus.set(roleId, 'idle');
539
511
  sendSSE(res, 'done', event.data);
540
512
  if (!res.writableEnded) res.end();
541
513
  job.stream.unsubscribe(subscriber);
542
514
  break;
543
515
  case 'job:error':
544
516
  cleanupLifecycle();
545
- roleStatus.set(roleId, 'idle');
546
517
  sendSSE(res, 'error', { message: event.data.message });
547
518
  if (!res.writableEnded) res.end();
548
519
  job.stream.unsubscribe(subscriber);
@@ -586,7 +557,6 @@ function handleWave(body: Record<string, unknown>, req: IncomingMessage, res: Se
586
557
  task: `[CEO Wave] ${directive}`,
587
558
  sourceRole: 'ceo',
588
559
  });
589
- roleStatus.set(cRole, 'working');
590
560
  jobs.push(job);
591
561
  }
592
562
 
@@ -624,7 +594,6 @@ function handleWave(body: Record<string, unknown>, req: IncomingMessage, res: Se
624
594
  sendSSE(res, 'stderr', { roleId: rolePrefix, message: event.data.message });
625
595
  break;
626
596
  case 'job:done':
627
- roleStatus.set(rolePrefix, 'idle');
628
597
  sendSSE(res, 'role:done', { roleId: rolePrefix, ...event.data });
629
598
  doneCount++;
630
599
  if (doneCount >= jobs.length) {
@@ -633,7 +602,6 @@ function handleWave(body: Record<string, unknown>, req: IncomingMessage, res: Se
633
602
  }
634
603
  break;
635
604
  case 'job:error':
636
- roleStatus.set(rolePrefix, 'idle');
637
605
  sendSSE(res, 'role:error', { roleId: rolePrefix, message: event.data.message });
638
606
  doneCount++;
639
607
  if (doneCount >= jobs.length) {