tycono 0.1.96-beta.47 → 0.1.96-beta.49

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
@@ -219,19 +219,13 @@ async function startServerForTui(): Promise<void> {
219
219
  const logFd = fs.openSync(logFile, 'a');
220
220
  const logStream = fs.createWriteStream(logFile, { fd: logFd });
221
221
  const origStdoutWrite = process.stdout.write.bind(process.stdout);
222
- const origStderrWrite = process.stderr.write.bind(process.stderr);
223
- // Intercept all stdout/stderronly allow Ink's output (ANSI escape sequences)
224
- const isInkOutput = (s: string) => s.includes('\x1b[') || s.includes('\x1b(');
225
- process.stdout.write = ((chunk: any, ...args: any[]) => {
226
- const str = typeof chunk === 'string' ? chunk : chunk.toString();
227
- if (isInkOutput(str)) return origStdoutWrite(chunk, ...args);
228
- logStream.write(str);
229
- return true;
230
- }) as any;
231
- process.stderr.write = ((chunk: any, ...args: any[]) => {
232
- logStream.write(typeof chunk === 'string' ? chunk : chunk.toString());
233
- return true;
234
- }) as any;
222
+ // Redirect console.log/console.error to log file (server output)
223
+ // But DO NOT intercept process.stdout.write — Ink needs full control
224
+ const origConsoleLog = console.log;
225
+ const origConsoleError = console.error;
226
+ console.log = (...args: unknown[]) => { logStream.write(args.join(' ') + '\n'); };
227
+ console.error = (...args: unknown[]) => { logStream.write(args.join(' ') + '\n'); };
228
+ console.warn = (...args: unknown[]) => { logStream.write(args.join(' ') + '\n'); };
235
229
  const origLog = (...args: unknown[]) => origStdoutWrite(args.join(' ') + '\n');
236
230
 
237
231
  const { createHttpServer } = await import('../src/api/src/create-server.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.96-beta.47",
3
+ "version": "0.1.96-beta.49",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tui/app.tsx CHANGED
@@ -192,6 +192,7 @@ export const App: React.FC = () => {
192
192
  // View state: loading -> setup (no company) -> dashboard
193
193
  const [view, setView] = useState<View>('loading');
194
194
 
195
+ // Loading → setup/dashboard transition
195
196
  React.useEffect(() => {
196
197
  if (!api.loaded) return;
197
198
  if (view === 'loading') {
@@ -199,6 +200,17 @@ export const App: React.FC = () => {
199
200
  }
200
201
  }, [api.loaded, api.company, view]);
201
202
 
203
+ // Fallback: if loading for more than 8 seconds, force to setup
204
+ React.useEffect(() => {
205
+ if (view !== 'loading') return;
206
+ const timer = setTimeout(() => {
207
+ if (view === 'loading') {
208
+ setView('setup');
209
+ }
210
+ }, 8000);
211
+ return () => clearTimeout(timer);
212
+ }, [view]);
213
+
202
214
  const handleSetupComplete = useCallback(() => {
203
215
  api.refresh();
204
216
  setView('dashboard');