@gricha/perry 0.3.20 → 0.3.22

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.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Perry</title>
8
- <script type="module" crossorigin src="/assets/index-mAcZDiNE.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-nqocJMjI.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DfAa5Wi1.css">
10
10
  </head>
11
11
  <body>
package/dist/index.js CHANGED
@@ -370,14 +370,15 @@ program
370
370
  console.log(`No ports configured for workspace '${name}'.`);
371
371
  console.log('');
372
372
  console.log('Configure ports with: perry ports <name> <port> [<port>...]');
373
- console.log(' Example: perry ports ' + name + ' 3000 5173');
373
+ console.log(' Example: perry ports ' + name + ' 3000 8080:5173');
374
374
  console.log('');
375
375
  console.log('Or specify ports directly: perry proxy <name> <port> [<port>...]');
376
- console.log(' Example: perry proxy ' + name + ' 3000 5173');
376
+ console.log(' Example: perry proxy ' + name + ' 3000 8080:5173');
377
377
  return;
378
378
  }
379
- effectivePorts = configuredForwards.map((p) => String(p));
380
- console.log(`Using configured ports: ${configuredForwards.join(', ')}`);
379
+ effectivePorts = configuredForwards.map((p) => p.host === p.container ? String(p.container) : `${p.host}:${p.container}`);
380
+ const formatted = effectivePorts.join(', ');
381
+ console.log(`Using configured ports: ${formatted}`);
381
382
  }
382
383
  if (isLocalWorker(worker)) {
383
384
  const containerName = getContainerName(name);
@@ -437,7 +438,7 @@ program
437
438
  });
438
439
  program
439
440
  .command('ports <name> [ports...]')
440
- .description('Configure ports to forward for a workspace')
441
+ .description('Configure port mappings for a workspace (e.g. 3000, 8080:3000)')
441
442
  .action(async (name, ports) => {
442
443
  try {
443
444
  const client = await getClient();
@@ -452,23 +453,22 @@ program
452
453
  console.log(`No ports configured for workspace '${name}'.`);
453
454
  console.log('');
454
455
  console.log('Usage: perry ports <name> <port> [<port>...]');
455
- console.log(' Example: perry ports ' + name + ' 3000 5173 8080');
456
+ console.log(' Format: <port> or <host>:<container>');
457
+ console.log(' Example: perry ports ' + name + ' 3000 8080:5173');
456
458
  }
457
459
  else {
458
- console.log(`Ports configured for '${name}': ${currentPorts.join(', ')}`);
460
+ const formatted = currentPorts.map((p) => p.host === p.container ? String(p.container) : `${p.host}:${p.container}`);
461
+ console.log(`Ports configured for '${name}': ${formatted.join(', ')}`);
459
462
  }
460
463
  return;
461
464
  }
462
- const portNumbers = ports.map((p) => {
463
- const num = parseInt(p, 10);
464
- if (isNaN(num) || num < 1 || num > 65535) {
465
- console.error(`Invalid port number: ${p}`);
466
- process.exit(1);
467
- }
468
- return num;
465
+ const portMappings = ports.map((spec) => {
466
+ const mapping = parsePortForward(spec);
467
+ return { host: mapping.localPort, container: mapping.remotePort };
469
468
  });
470
- await client.setPortForwards(name, portNumbers);
471
- console.log(`Ports configured for '${name}': ${portNumbers.join(', ')}`);
469
+ await client.setPortForwards(name, portMappings);
470
+ const formatted = portMappings.map((p) => p.host === p.container ? String(p.container) : `${p.host}:${p.container}`);
471
+ console.log(`Ports configured for '${name}': ${formatted.join(', ')}`);
472
472
  console.log('');
473
473
  console.log(`Run 'perry proxy ${name}' to start forwarding.`);
474
474
  }
@@ -72,11 +72,13 @@ function parseOpencodeModels(output) {
72
72
  continue;
73
73
  const parts = trimmed.split('/');
74
74
  const id = trimmed;
75
- const name = parts.length > 1 ? parts[1] : parts[0];
76
- const displayName = name
75
+ const provider = parts.length > 1 ? parts[0] : '';
76
+ const modelName = parts.length > 1 ? parts[1] : parts[0];
77
+ const formattedModel = modelName
77
78
  .split('-')
78
79
  .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
79
80
  .join(' ');
81
+ const displayName = provider ? `${provider} / ${formattedModel}` : formattedModel;
80
82
  models.push({
81
83
  id,
82
84
  name: displayName,
@@ -105,4 +107,4 @@ export async function discoverContainerOpencodeModels(containerName, execInConta
105
107
  return [];
106
108
  }
107
109
  }
108
- export { FALLBACK_CLAUDE_MODELS };
110
+ export { FALLBACK_CLAUDE_MODELS, parseOpencodeModels };
package/dist/perry-worker CHANGED
Binary file
@@ -32,6 +32,9 @@ export class ClaudeCodeAdapter {
32
32
  if (options.model) {
33
33
  this.model = options.model;
34
34
  }
35
+ if (options.projectPath) {
36
+ this.workDir = options.projectPath;
37
+ }
35
38
  this.setStatus('idle');
36
39
  }
37
40
  async sendMessage(message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gricha/perry",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "description": "Self-contained CLI for spinning up Docker-in-Docker development environments with SSH and proxy helpers.",
5
5
  "type": "module",
6
6
  "bin": {