genbox 1.0.221 → 1.0.223

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.
@@ -1446,18 +1446,43 @@ function buildPayload(resolved, config, publicKey, privateKey, configLoader) {
1446
1446
  installClaudeCode: config.defaults?.install_claude_code,
1447
1447
  envVars: resolved.env,
1448
1448
  apps: resolved.apps.map(a => a.name),
1449
- appConfigs: resolved.apps.map(a => ({
1450
- name: a.name,
1451
- path: a.path.startsWith('/') ? a.path : `${resolved.repos[0]?.path || '/home/dev'}/${a.path}`,
1452
- type: a.type,
1453
- port: a.port,
1454
- framework: a.framework,
1455
- runner: a.runner,
1456
- docker: a.docker,
1457
- healthcheck: a.healthcheck,
1458
- dependsOn: a.dependsOn,
1459
- commands: a.commands,
1460
- })),
1449
+ appConfigs: resolved.apps.map(a => {
1450
+ // Resolve app path - paths in genbox.yaml are relative to workspace root
1451
+ // e.g., path: "api" with workspace "goodpass" -> /home/dev/goodpass/api
1452
+ let resolvedPath;
1453
+ if (a.path.startsWith('/')) {
1454
+ // Absolute path - use as-is
1455
+ resolvedPath = a.path;
1456
+ }
1457
+ else {
1458
+ // Relative path - resolve from workspace root
1459
+ // First check if there's a matching repo with an absolute path
1460
+ const appConfig = config.apps[a.name];
1461
+ if (appConfig?.repo && config.repos?.[appConfig.repo]?.path) {
1462
+ resolvedPath = config.repos[appConfig.repo].path;
1463
+ }
1464
+ else if (config.repos?.[a.name]?.path) {
1465
+ resolvedPath = config.repos[a.name].path;
1466
+ }
1467
+ else {
1468
+ // Fall back to workspace-relative path
1469
+ const workspaceRoot = resolved.repos[0]?.path?.replace(/\/[^/]+$/, '') || '/home/dev';
1470
+ resolvedPath = `${workspaceRoot}/${a.path}`;
1471
+ }
1472
+ }
1473
+ return {
1474
+ name: a.name,
1475
+ path: resolvedPath,
1476
+ type: a.type,
1477
+ port: a.port,
1478
+ framework: a.framework,
1479
+ runner: a.runner,
1480
+ docker: a.docker,
1481
+ healthcheck: a.healthcheck,
1482
+ dependsOn: a.dependsOn,
1483
+ commands: a.commands,
1484
+ };
1485
+ }),
1461
1486
  infrastructure: resolved.infrastructure.map(i => ({
1462
1487
  name: i.name,
1463
1488
  type: i.type,
@@ -256,21 +256,27 @@ function displaySessions(result, options = {}) {
256
256
  const localCloudIds = new Set(sessions.filter(s => s.type === 'cloud').map(s => s.infrastructure?.genboxId));
257
257
  const additionalCloudSessions = cloudGenboxes
258
258
  .filter(g => !localCloudIds.has(g.id))
259
- .map(g => ({
260
- id: g.id,
261
- name: g.name,
262
- type: 'cloud',
263
- provider: 'claude',
264
- status: (g.status === 'running' ? 'running' : 'stopped'),
265
- projectPath: g.projectPath || '',
266
- createdAt: g.createdAt,
267
- syncEnabled: true,
268
- infrastructure: {
269
- genboxId: g.id,
270
- genboxName: g.name,
271
- ipAddress: g.ipAddress,
272
- },
273
- }));
259
+ .map(g => {
260
+ // Get the first URL from the urls map (usually 'app' or the first service)
261
+ const urlValues = g.urls ? Object.values(g.urls) : [];
262
+ const previewUrl = urlValues.length > 0 ? urlValues[0] : undefined;
263
+ return {
264
+ id: g.id,
265
+ name: g.name,
266
+ type: 'cloud',
267
+ provider: 'claude',
268
+ status: (g.status === 'running' ? 'running' : 'stopped'),
269
+ projectPath: g.projectPath || '',
270
+ createdAt: g.createdAt,
271
+ syncEnabled: true,
272
+ previewUrl,
273
+ infrastructure: {
274
+ genboxId: g.id,
275
+ genboxName: g.name,
276
+ ipAddress: g.ipAddress,
277
+ },
278
+ };
279
+ });
274
280
  const allSessions = [...sessions, ...additionalCloudSessions];
275
281
  // Separate into local and cloud
276
282
  const localTypes = ['native', 'docker', 'multipass', 'genbox'];
@@ -302,11 +308,9 @@ function displaySessions(result, options = {}) {
302
308
  console.log(chalk_1.default.dim(' ' + '─'.repeat(70)));
303
309
  for (const session of cloudSessions) {
304
310
  console.log(formatItem(session));
305
- // Show URL
306
- const previewUrl = session.previewUrl ||
307
- (session.infrastructure?.ipAddress ? `https://${session.infrastructure.genboxName || session.name}.genbox.dev` : null);
308
- if (previewUrl) {
309
- console.log(chalk_1.default.dim(` └─ ${previewUrl}`));
311
+ // Show URL (from API-provided urls, no fallback to avoid incorrect URLs)
312
+ if (session.previewUrl) {
313
+ console.log(chalk_1.default.dim(` └─ ${session.previewUrl}`));
310
314
  }
311
315
  // Show AI sessions running on this cloud genbox
312
316
  const genboxName = session.infrastructure?.genboxName || session.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.221",
3
+ "version": "1.0.223",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {