@amodalai/amodal 0.3.43 → 0.3.45

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": "@amodalai/amodal",
3
- "version": "0.3.43",
3
+ "version": "0.3.45",
4
4
  "description": "Amodal CLI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,12 +26,12 @@
26
26
  "react": "^19.2.4",
27
27
  "yargs": "^17.7.2",
28
28
  "zod": "^4.3.6",
29
- "@amodalai/core": "0.3.43",
30
- "@amodalai/types": "0.3.43",
31
- "@amodalai/db": "0.3.43",
32
- "@amodalai/studio": "0.3.43",
33
- "@amodalai/runtime": "0.3.43",
34
- "@amodalai/runtime-app": "0.3.43"
29
+ "@amodalai/types": "0.3.45",
30
+ "@amodalai/core": "0.3.45",
31
+ "@amodalai/db": "0.3.45",
32
+ "@amodalai/runtime": "0.3.45",
33
+ "@amodalai/studio": "0.3.45",
34
+ "@amodalai/runtime-app": "0.3.45"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.11.24",
@@ -24,8 +24,6 @@ import {getDb, ensureSchema, closeDb} from '@amodalai/db';
24
24
  // ---------------------------------------------------------------------------
25
25
 
26
26
  const DEFAULT_RUNTIME_PORT = 3847;
27
- const DEFAULT_STUDIO_PORT = 3848;
28
- const DEFAULT_ADMIN_PORT = 3849;
29
27
 
30
28
  // ---------------------------------------------------------------------------
31
29
  // Port checking
@@ -81,6 +79,8 @@ function resolveStudioDir(): string | null {
81
79
  export interface DevOptions {
82
80
  cwd?: string;
83
81
  port?: number;
82
+ studioPort?: number;
83
+ adminPort?: number;
84
84
  host?: string;
85
85
  resume?: string;
86
86
  verbose?: number;
@@ -331,9 +331,6 @@ async function spawnAdminAgent(opts: {
331
331
  AMODAL_NO_STUDIO: '1',
332
332
  REPO_PATH: opts.repoPath,
333
333
  };
334
- if (opts.studioUrl) {
335
- env['STUDIO_URL'] = opts.studioUrl;
336
- }
337
334
 
338
335
  const child = spawn(
339
336
  process.execPath,
@@ -377,9 +374,20 @@ export async function runDev(options: DevOptions = {}): Promise<void> {
377
374
  let repoPath: string;
378
375
  try {
379
376
  repoPath = findRepoRoot(options.cwd);
380
- } catch (err) {
381
- const msg = err instanceof Error ? err.message : String(err);
382
- process.stderr.write(`[dev] ${msg}\n`);
377
+ } catch {
378
+ process.stderr.write(`
379
+ No amodal.json found.
380
+
381
+ Create a new agent:
382
+
383
+ amodal init Initialize this directory
384
+ amodal dev Start the dev server
385
+
386
+ Or if your agent is in another directory:
387
+
388
+ cd /path/to/agent && amodal dev
389
+
390
+ `);
383
391
  process.exit(1);
384
392
  }
385
393
 
@@ -458,8 +466,8 @@ Or add it to your agent's .env file:
458
466
  // -------------------------------------------------------------------------
459
467
 
460
468
  const runtimePort = options.port ?? DEFAULT_RUNTIME_PORT;
461
- const studioPort = DEFAULT_STUDIO_PORT;
462
- const adminPort = DEFAULT_ADMIN_PORT;
469
+ const studioPort = options.studioPort ?? runtimePort + 1;
470
+ const adminPort = options.adminPort ?? runtimePort + 2;
463
471
 
464
472
  await assertPortFree(runtimePort);
465
473
  if (!options.noStudio) await assertPortFree(studioPort);
@@ -633,6 +641,14 @@ export const devCommand: CommandModule = {
633
641
  describe: 'Only show errors',
634
642
  default: false,
635
643
  },
644
+ 'studio-port': {
645
+ type: 'number',
646
+ describe: 'Port for Studio (defaults to port + 1)',
647
+ },
648
+ 'admin-port': {
649
+ type: 'number',
650
+ describe: 'Port for admin agent (defaults to port + 2)',
651
+ },
636
652
  'no-studio': {
637
653
  type: 'boolean',
638
654
  describe: 'Do not spawn Studio subprocess',
@@ -655,12 +671,17 @@ export const devCommand: CommandModule = {
655
671
  const verbose = argv['verbose'] as number;
656
672
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
657
673
  const quiet = argv['quiet'] as boolean;
674
+
675
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
676
+ const studioPort = argv['studio-port'] as number | undefined;
677
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
678
+ const adminPort = argv['admin-port'] as number | undefined;
658
679
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
659
680
  const noStudio = (argv['no-studio'] as boolean) || process.env['AMODAL_NO_STUDIO'] === '1';
660
681
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
661
682
  const noAdmin = (argv['no-admin'] as boolean) || process.env['AMODAL_NO_ADMIN'] === '1';
662
683
  try {
663
- await runDev({port, host, resume, verbose, quiet, noStudio, noAdmin});
684
+ await runDev({port, studioPort, adminPort, host, resume, verbose, quiet, noStudio, noAdmin});
664
685
  } catch (err: unknown) {
665
686
  const msg = err instanceof Error ? err.message : String(err);
666
687
  process.stderr.write(`\n Error: ${msg}\n\n`);