tycono 0.1.96-beta.59 → 0.1.96-beta.60

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.
Files changed (2) hide show
  1. package/bin/tycono.ts +50 -16
  2. package/package.json +1 -1
package/bin/tycono.ts CHANGED
@@ -19,18 +19,17 @@ function printHelp(): void {
19
19
  Build an AI company. Watch them work.
20
20
 
21
21
  Usage:
22
- tycono [path] Start the server (optionally point to a company directory)
23
- tycono tui Start API server + TUI mode
24
- tycono tui --attach Connect TUI to existing API server
22
+ tycono [path] Start TUI (default, optionally point to a company directory)
23
+ tycono --classic Start pixel office web UI
24
+ tycono --attach Connect TUI to existing API server
25
25
  tycono --help Show this help message
26
26
  tycono --version Show version
27
27
 
28
28
  Examples:
29
- tycono Start in current directory
30
- tycono ./my-company Start with existing company folder
31
- tycono /path/to/akb Start with absolute path
32
- tycono tui Start with terminal UI
33
- PORT=3000 tycono tui --attach Attach TUI to running server
29
+ tycono Start TUI in current directory
30
+ tycono ./my-company Start TUI with existing company folder
31
+ tycono --classic Start pixel office web UI
32
+ PORT=3000 tycono --attach Attach TUI to running server
34
33
 
35
34
  AI Engine (auto-detected):
36
35
  1. Claude Code CLI Install from https://claude.ai/download (recommended)
@@ -273,24 +272,37 @@ export async function main(args: string[]): Promise<void> {
273
272
  return;
274
273
  }
275
274
 
276
- // tui subcommand: start API server + TUI mode
275
+ // --classic: legacy pixel office web UI
276
+ if (command === '--classic' || args.includes('--classic')) {
277
+ if (command === '--classic' && args[1] && !args[1].startsWith('-')) {
278
+ process.env.COMPANY_ROOT = path.resolve(args[1]);
279
+ }
280
+ await startServer();
281
+ return;
282
+ }
283
+
284
+ // --attach: connect TUI to existing API server
285
+ if (command === '--attach' || args.includes('--attach')) {
286
+ const port = process.env.PORT ? Number(process.env.PORT) : 3000;
287
+ const { startTui } = await import('../src/tui/index.tsx');
288
+ await startTui({ port });
289
+ return;
290
+ }
291
+
292
+ // Legacy: `tui` subcommand still works
277
293
  if (command === 'tui') {
278
- const attachMode = args.includes('--attach');
279
- // If --attach, skip server start — just connect to existing API
280
- if (attachMode) {
294
+ if (args.includes('--attach')) {
281
295
  const port = process.env.PORT ? Number(process.env.PORT) : 3000;
282
296
  const { startTui } = await import('../src/tui/index.tsx');
283
297
  await startTui({ port });
284
298
  return;
285
299
  }
286
-
287
- // Start API server, then TUI
288
300
  await startServerForTui();
289
301
  return;
290
302
  }
291
303
 
304
+ // Path argument: treat as company directory
292
305
  if (command && !command.startsWith('-')) {
293
- // Treat as path to company directory
294
306
  const resolved = path.resolve(command);
295
307
  if (!fs.existsSync(resolved)) {
296
308
  console.error(` Path not found: ${resolved}`);
@@ -299,5 +311,27 @@ export async function main(args: string[]): Promise<void> {
299
311
  process.env.COMPANY_ROOT = resolved;
300
312
  }
301
313
 
302
- await startServer();
314
+ // Show first-run notice (once only)
315
+ const prefsPath = path.resolve(process.env.COMPANY_ROOT || process.cwd(), '.tycono', 'preferences.json');
316
+ let prefs: Record<string, unknown> = {};
317
+ try { prefs = JSON.parse(fs.readFileSync(prefsPath, 'utf-8')); } catch {}
318
+ if (!prefs.tuiNoticeShown) {
319
+ console.log('');
320
+ console.log(' Tycono v' + VERSION + ' — AI Company OS');
321
+ console.log('');
322
+ console.log(' New: Terminal mode is now the default.');
323
+ console.log(' Faster, scriptable, built for work.');
324
+ console.log('');
325
+ console.log(' Looking for the pixel office?');
326
+ console.log(' → npx tycono --classic');
327
+ console.log('');
328
+ prefs.tuiNoticeShown = true;
329
+ try {
330
+ fs.mkdirSync(path.dirname(prefsPath), { recursive: true });
331
+ fs.writeFileSync(prefsPath, JSON.stringify(prefs, null, 2));
332
+ } catch {}
333
+ }
334
+
335
+ // Default: TUI mode
336
+ await startServerForTui();
303
337
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.96-beta.59",
3
+ "version": "0.1.96-beta.60",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {