opc-agent 4.0.13 → 4.0.15

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/dist/cli.js CHANGED
@@ -842,9 +842,21 @@ program
842
842
  await runtime.initialize();
843
843
  await runtime.start();
844
844
  const agent = runtime.getAgent();
845
+ // Auto-start Studio on port 4000
846
+ let studioUrl = '';
847
+ try {
848
+ const { StudioServer } = require('./studio/server');
849
+ const studioPort = parseInt(opts.port || '3000') === 4000 ? 4001 : 4000;
850
+ const studio = new StudioServer({ port: studioPort, agentDir: process.cwd() });
851
+ await studio.start();
852
+ studioUrl = `http://localhost:${studioPort}`;
853
+ }
854
+ catch { }
845
855
  console.log(`\n${icon.rocket} Agent "${color.bold(agent?.name ?? 'unknown')}" is running.`);
846
- console.log(` ${color.dim('Web UI:')} http://localhost:3000`);
847
- console.log(` ${color.dim('API:')} POST http://localhost:3000/api/chat`);
856
+ console.log(` ${color.dim('Chat:')} http://localhost:3000`);
857
+ if (studioUrl)
858
+ console.log(` ${color.dim('Studio:')} ${studioUrl}`);
859
+ console.log(` ${color.dim('API:')} POST http://localhost:3000/api/chat`);
848
860
  console.log(`\n ${color.dim('Press Ctrl+C to stop.')}\n`);
849
861
  });
850
862
  // ── Serve command (OpenAI-compatible API) ────────────────────
@@ -342,6 +342,18 @@ class AgentRuntime {
342
342
  this.logger.info('Scheduler started');
343
343
  }
344
344
  this.logger.info('Agent started');
345
+ // Auto-start Studio UI
346
+ try {
347
+ const { StudioServer } = require('../studio/server');
348
+ const studioPort = 4000;
349
+ const studio = new StudioServer({ port: studioPort, agentDir: process.cwd() });
350
+ await studio.start();
351
+ this.logger.info(`Studio UI ready → http://localhost:${studioPort}`);
352
+ console.log(` Studio: http://localhost:${studioPort}`);
353
+ }
354
+ catch (e) {
355
+ this.logger.debug('Studio UI not available: ' + (e?.message || ''));
356
+ }
345
357
  }
346
358
  async stop() {
347
359
  if (!this.agent)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opc-agent",
3
- "version": "4.0.13",
3
+ "version": "4.0.15",
4
4
  "description": "Open Agent Framework — Build, test, and run AI Agents for business workstations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/cli.ts CHANGED
@@ -939,9 +939,21 @@ program
939
939
  await runtime.initialize();
940
940
  await runtime.start();
941
941
  const agent = runtime.getAgent();
942
+
943
+ // Auto-start Studio on port 4000
944
+ let studioUrl = '';
945
+ try {
946
+ const { StudioServer } = require('./studio/server');
947
+ const studioPort = parseInt(opts.port || '3000') === 4000 ? 4001 : 4000;
948
+ const studio = new StudioServer({ port: studioPort, agentDir: process.cwd() });
949
+ await studio.start();
950
+ studioUrl = `http://localhost:${studioPort}`;
951
+ } catch {}
952
+
942
953
  console.log(`\n${icon.rocket} Agent "${color.bold(agent?.name ?? 'unknown')}" is running.`);
943
- console.log(` ${color.dim('Web UI:')} http://localhost:3000`);
944
- console.log(` ${color.dim('API:')} POST http://localhost:3000/api/chat`);
954
+ console.log(` ${color.dim('Chat:')} http://localhost:3000`);
955
+ if (studioUrl) console.log(` ${color.dim('Studio:')} ${studioUrl}`);
956
+ console.log(` ${color.dim('API:')} POST http://localhost:3000/api/chat`);
945
957
  console.log(`\n ${color.dim('Press Ctrl+C to stop.')}\n`);
946
958
  });
947
959
 
@@ -320,6 +320,18 @@ export class AgentRuntime {
320
320
  this.logger.info('Scheduler started');
321
321
  }
322
322
  this.logger.info('Agent started');
323
+
324
+ // Auto-start Studio UI
325
+ try {
326
+ const { StudioServer } = require('../studio/server');
327
+ const studioPort = 4000;
328
+ const studio = new StudioServer({ port: studioPort, agentDir: process.cwd() });
329
+ await studio.start();
330
+ this.logger.info(`Studio UI ready → http://localhost:${studioPort}`);
331
+ console.log(` Studio: http://localhost:${studioPort}`);
332
+ } catch (e: any) {
333
+ this.logger.debug('Studio UI not available: ' + (e?.message || ''));
334
+ }
323
335
  }
324
336
 
325
337
  async stop(): Promise<void> {