opencara 0.100.1 → 0.100.2

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/dist/bin.js +5 -4
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  arch,
6
6
  cpus,
7
7
  freemem,
8
- hostname,
8
+ hostname as hostname2,
9
9
  networkInterfaces,
10
10
  platform,
11
11
  release,
@@ -56,6 +56,7 @@ function defaultOrchestratorUrl() {
56
56
  // src/commands/register.ts
57
57
  import { createHash, randomBytes } from "node:crypto";
58
58
  import { spawn } from "node:child_process";
59
+ import { hostname } from "node:os";
59
60
 
60
61
  // ../shared/dist/events.js
61
62
  import { z as z2 } from "zod";
@@ -219,7 +220,7 @@ async function register(opts = {}) {
219
220
  throw new Error(`pairing create failed: ${createRes.status} ${await createRes.text()}`);
220
221
  }
221
222
  const { code, expires_at } = PairingCreateResponseSchema.parse(await createRes.json());
222
- const pairUrl = `${orchestratorUrl}/devices/pair?code=${encodeURIComponent(code)}`;
223
+ const pairUrl = `${orchestratorUrl}/devices/pair?code=${encodeURIComponent(code)}&hostname=${encodeURIComponent(hostname())}`;
223
224
  console.log(`
224
225
  Pairing code: ${code}`);
225
226
  console.log(` Open ${pairUrl} in your browser to confirm.`);
@@ -398,7 +399,7 @@ async function run(opts = {}) {
398
399
  console.log(`[opencara] disconnected (code=${code} reason="${reason}")`);
399
400
  }
400
401
  });
401
- console.log(`[opencara] starting as ${cfg.deviceName} (${hostname()})`);
402
+ console.log(`[opencara] starting as ${cfg.deviceName} (${hostname2()})`);
402
403
  client.start();
403
404
  }
404
405
  function handleServerMessage(msg, client, _cfg) {
@@ -492,7 +493,7 @@ function collectSystemInfo() {
492
493
  os: platform(),
493
494
  release: release(),
494
495
  arch: arch(),
495
- hostname: hostname(),
496
+ hostname: hostname2(),
496
497
  cpu: {
497
498
  model: head?.model.trim() ?? "unknown",
498
499
  cores: cpuList.length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencara",
3
- "version": "0.100.1",
3
+ "version": "0.100.2",
4
4
  "description": "OpenCara agent-host CLI: register a machine as an agent host and run dispatched agents.",
5
5
  "license": "MIT",
6
6
  "repository": {