@solar_orb/agent_orb 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -25,6 +25,14 @@ npx --yes ./packages/agent_orb setup --yes
25
25
 
26
26
  If `packages/agent_orb/releases` contains a matching native bundle, setup installs that bundle directly with SHA256 verification. Otherwise it falls back to source build. On Windows, setup also adds the runtime bin directory to the user PATH so a new terminal can run `agent_orb-codex`, `agent_orb-claude`, `agent_orb`, `codex-orb`, and `claude-orb` directly. The adapter launchers start the orb UI if needed before running the target CLI.
27
27
 
28
+ Upgrade or repair an existing install:
29
+
30
+ ```bash
31
+ npx @solar_orb/agent_orb upgrade --yes
32
+ ```
33
+
34
+ The upgrade flow verifies the new bundle before stopping the old daemon/orb UI and removing old runtime files.
35
+
28
36
  ## Windows local path
29
37
 
30
38
  ```powershell
@@ -55,5 +63,5 @@ For Windows-host testing, prefer either:
55
63
 
56
64
  ```powershell
57
65
  cd $env:TEMP\agent-orb-npx
58
- npx --yes .\solar_orb-agent_orb-0.1.2.tgz --help
66
+ npx --yes .\solar_orb-agent_orb-0.1.3.tgz --help
59
67
  ```
package/dist/config.js CHANGED
@@ -14,7 +14,7 @@ export function writeConfig(configDir, selectedAdapters, runtime = runtimeConfig
14
14
  fs.mkdirSync(configDir, { recursive: true });
15
15
  const configPath = path.join(configDir, 'config.toml');
16
16
  const enabled = new Set(selectedAdapters.map((adapter) => adapter.name));
17
- const content = `# Generated by npx agent_orb\n\n[install]\nmethod = "npx"\nversion = "0.1.2"\n\n[adapters.codex]\nenabled = ${enabled.has('codex')}\nbinary = "codex"\nwrapper = "agent_orb-codex"\n\n[adapters.claude]\nenabled = ${enabled.has('claude')}\nbinary = "claude"\nwrapper = "agent_orb-claude"\n\n[daemon]\nhost = "${runtime.daemonHost}"\nport = ${runtime.daemonPort}\nauto_start = true\n\n[orb]\nposition = "top-right"\nsize = 36\nopacity = 0.88\nalways_on_top = true\nclick_through = false\n\n[colors]\ndisconnected = "#6B7280"\nidle = "#9CA3AF"\nstarting = "#60A5FA"\nactive = "#3B82F6"\nthinking_like = "#8B5CF6"\nwaiting_input = "#FBBF24"\ncompleted = "#22C55E"\nerror = "#EF4444"\nwarning = "#F97316"\n\n[behavior]\nsilent_threshold_seconds = 20\nstuck_threshold_seconds = 180\ncompleted_hold_seconds = 10\nerror_requires_click_to_clear = true\n\n[privacy]\ninclude_output_sample = false\nmax_sample_chars = 512\n`;
17
+ const content = `# Generated by npx agent_orb\n\n[install]\nmethod = "npx"\nversion = "0.1.3"\n\n[adapters.codex]\nenabled = ${enabled.has('codex')}\nbinary = "codex"\nwrapper = "agent_orb-codex"\n\n[adapters.claude]\nenabled = ${enabled.has('claude')}\nbinary = "claude"\nwrapper = "agent_orb-claude"\n\n[daemon]\nhost = "${runtime.daemonHost}"\nport = ${runtime.daemonPort}\nauto_start = true\n\n[orb]\nposition = "top-right"\nsize = 36\nopacity = 0.88\nalways_on_top = true\nclick_through = false\n\n[colors]\ndisconnected = "#6B7280"\nidle = "#9CA3AF"\nstarting = "#60A5FA"\nactive = "#3B82F6"\nthinking_like = "#8B5CF6"\nwaiting_input = "#FBBF24"\ncompleted = "#22C55E"\nerror = "#EF4444"\nwarning = "#F97316"\n\n[behavior]\nsilent_threshold_seconds = 20\nstuck_threshold_seconds = 180\ncompleted_hold_seconds = 10\nerror_requires_click_to_clear = true\n\n[privacy]\ninclude_output_sample = false\nmax_sample_chars = 512\n`;
18
18
  fs.writeFileSync(configPath, content, 'utf8');
19
19
  return configPath;
20
20
  }
package/dist/download.js CHANGED
@@ -3,7 +3,7 @@ import os from 'node:os';
3
3
  import path from 'node:path';
4
4
  import { fileURLToPath, pathToFileURL } from 'node:url';
5
5
  import { parseChecksums, verifyChecksum } from './checksum.js';
6
- import { run } from './shell.js';
6
+ import { commandExists, run } from './shell.js';
7
7
  export async function installRuntimeBundle(platform, options = {}) {
8
8
  if (!options.force && runtimeLooksInstalled(platform)) {
9
9
  console.log('\n==> Runtime bundle');
@@ -28,6 +28,7 @@ export async function installRuntimeBundle(platform, options = {}) {
28
28
  }
29
29
  verifyChecksum(bundlePath, expected);
30
30
  console.log(`✓ checksum verified: ${platform.bundleName}`);
31
+ cleanupInstalledRuntime(platform);
31
32
  extractBundle(bundlePath, tempDir, platform);
32
33
  writeInstallManifest(platform, {
33
34
  bundle: platform.bundleName,
@@ -45,6 +46,55 @@ export function runtimeLooksInstalled(platform) {
45
46
  const required = ['agent_orb', 'agent_orbd'].map((name) => path.join(platform.runtimeDir, `${name}${platform.exeSuffix}`));
46
47
  return required.every((file) => fs.existsSync(file));
47
48
  }
49
+ export function cleanupInstalledRuntime(platform) {
50
+ if (!fs.existsSync(platform.runtimeDir))
51
+ return;
52
+ console.log('\n==> Cleaning previous runtime files');
53
+ stopRuntimeProcesses(platform);
54
+ for (const filename of knownRuntimeFiles(platform)) {
55
+ const filePath = path.join(platform.runtimeDir, filename);
56
+ if (!fs.existsSync(filePath))
57
+ continue;
58
+ fs.rmSync(filePath, { force: true });
59
+ console.log(`✓ removed ${filePath}`);
60
+ }
61
+ }
62
+ function stopRuntimeProcesses(platform) {
63
+ if (platform.platform === 'windows') {
64
+ for (const imageName of ['agent_orbd.exe', 'agent-orb-ui.exe']) {
65
+ run('taskkill', ['/F', '/T', '/IM', imageName], {
66
+ allowFailure: true,
67
+ });
68
+ }
69
+ return;
70
+ }
71
+ if (!commandExists('pkill'))
72
+ return;
73
+ for (const processName of ['agent_orbd', 'agent-orb-ui']) {
74
+ run('pkill', ['-x', processName], {
75
+ allowFailure: true,
76
+ });
77
+ }
78
+ }
79
+ function knownRuntimeFiles(platform) {
80
+ const executableNames = [
81
+ `agent_orb${platform.exeSuffix}`,
82
+ `agent_orbd${platform.exeSuffix}`,
83
+ `agent-orb-ui${platform.exeSuffix}`,
84
+ ];
85
+ return [
86
+ ...executableNames,
87
+ 'agent-orb-runtime.json',
88
+ 'agent_orb-codex',
89
+ 'agent_orb-claude',
90
+ 'codex-orb',
91
+ 'claude-orb',
92
+ 'agent_orb-codex.cmd',
93
+ 'agent_orb-claude.cmd',
94
+ 'codex-orb.cmd',
95
+ 'claude-orb.cmd',
96
+ ];
97
+ }
48
98
  function releaseBaseUrl(platform, options) {
49
99
  if (options.releaseDir) {
50
100
  return pathToFileURL(path.resolve(options.releaseDir)).href;
@@ -61,12 +111,18 @@ function releaseBaseUrl(platform, options) {
61
111
  const bundled = bundledReleaseBaseUrl(platform);
62
112
  if (bundled)
63
113
  return bundled;
64
- const version = process.env.AGENT_ORB_VERSION ?? 'v0.1.0';
114
+ const version = process.env.AGENT_ORB_VERSION ?? defaultReleaseVersion() ?? 'v0.1.0';
65
115
  const repo = githubRepository();
66
116
  if (repo)
67
117
  return `https://github.com/${repo}/releases/download/${version}`;
68
118
  return undefined;
69
119
  }
120
+ function defaultReleaseVersion() {
121
+ const version = readPackageVersion();
122
+ if (!version)
123
+ return undefined;
124
+ return version.startsWith('v') ? version : `v${version}`;
125
+ }
70
126
  function githubRepository() {
71
127
  const configured = process.env.AGENT_ORB_GITHUB_REPOSITORY;
72
128
  if (configured?.trim())
@@ -80,11 +136,18 @@ function githubRepository() {
80
136
  return undefined;
81
137
  }
82
138
  function readPackageGithubRepository() {
139
+ const packageJson = readPackageJson();
140
+ const repo = packageJson?.config?.github_repository;
141
+ return typeof repo === 'string' && repo.trim() ? repo.trim() : undefined;
142
+ }
143
+ function readPackageVersion() {
144
+ const version = readPackageJson()?.version;
145
+ return typeof version === 'string' && version.trim() ? version.trim() : undefined;
146
+ }
147
+ function readPackageJson() {
83
148
  try {
84
149
  const packageJsonPath = fileURLToPath(new URL('../package.json', import.meta.url));
85
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
86
- const repo = packageJson.config?.github_repository;
87
- return typeof repo === 'string' && repo.trim() ? repo.trim() : undefined;
150
+ return JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
88
151
  }
89
152
  catch {
90
153
  return undefined;
package/dist/index.js CHANGED
@@ -21,10 +21,20 @@ async function main() {
21
21
  case 'doctor':
22
22
  await doctor();
23
23
  break;
24
+ case 'upgrade':
25
+ await setup({
26
+ yes: flags.has('--yes') || flags.has('-y'),
27
+ smoke: !flags.has('--no-smoke'),
28
+ force: true,
29
+ buildFromSource: flags.has('--build-from-source'),
30
+ releaseBaseUrl: flagValue(args, '--release-base-url'),
31
+ releaseDir: flagValue(args, '--release-dir'),
32
+ });
33
+ break;
24
34
  case 'version':
25
35
  case '--version':
26
36
  case '-v':
27
- console.log('agent_orb bootstrapper 0.1.2');
37
+ console.log('agent_orb bootstrapper 0.1.3');
28
38
  break;
29
39
  case 'help':
30
40
  case '--help':
@@ -65,6 +75,7 @@ Usage:
65
75
  [--release-dir <dir> | --release-base-url <url>]
66
76
  [--build-from-source]
67
77
  agent_orb doctor
78
+ agent_orb upgrade [--yes] [--no-smoke]
68
79
  agent_orb version
69
80
 
70
81
  Local development:
package/dist/setup.js CHANGED
@@ -5,7 +5,7 @@ import { stdin as input, stdout as output } from 'node:process';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { detectAdapters } from './adapter.js';
7
7
  import { runtimeConfigFromEnv, writeConfig } from './config.js';
8
- import { installRuntimeBundle } from './download.js';
8
+ import { cleanupInstalledRuntime, installRuntimeBundle } from './download.js';
9
9
  import { detectPlatform } from './platform.js';
10
10
  import { commandExists, getPathEnv, run, setPathEnv, spawnDetached } from './shell.js';
11
11
  export async function setup(options = {}) {
@@ -65,6 +65,7 @@ function installRuntimeFromSource(platform) {
65
65
  const repoRoot = findRepoRoot();
66
66
  console.log(`Repository: ${repoRoot}`);
67
67
  buildRuntime(repoRoot);
68
+ cleanupInstalledRuntime(platform);
68
69
  installRuntime(repoRoot, platform);
69
70
  }
70
71
  export async function doctor(platform = detectPlatform(), runtime = runtimeConfigFromEnv()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar_orb/agent_orb",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Agent Orb local bootstrapper",
5
5
  "type": "module",
6
6
  "config": {