@beeos-ai/cli 1.0.7 → 1.0.8

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/index.js +107 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2091,7 +2091,6 @@ async function detectExistingInstall() {
2091
2091
  try {
2092
2092
  binding = await loadBindingInfo();
2093
2093
  } catch {
2094
- binding = null;
2095
2094
  }
2096
2095
  const openclaw = await detectOpenclaw();
2097
2096
  const devices = await detectDevices();
@@ -2178,7 +2177,6 @@ async function detectSupervisor() {
2178
2177
  try {
2179
2178
  ipcReachable = await p.exists(ipcPath);
2180
2179
  } catch {
2181
- ipcReachable = false;
2182
2180
  }
2183
2181
  let targets = [];
2184
2182
  if (await p.exists(stateFile)) {
@@ -2255,6 +2253,45 @@ var init_detect = __esm({
2255
2253
  }
2256
2254
  });
2257
2255
 
2256
+ // ../core/dist/framework/registry.js
2257
+ function listFrameworks() {
2258
+ return REGISTRY;
2259
+ }
2260
+ function availableFrameworks() {
2261
+ return REGISTRY.filter((f) => f.status === "available");
2262
+ }
2263
+ function frameworkById(id) {
2264
+ return REGISTRY.find((f) => f.id === id);
2265
+ }
2266
+ function defaultFrameworkId() {
2267
+ return "openclaw";
2268
+ }
2269
+ var REGISTRY;
2270
+ var init_registry2 = __esm({
2271
+ "../core/dist/framework/registry.js"() {
2272
+ "use strict";
2273
+ init_registry();
2274
+ REGISTRY = [
2275
+ {
2276
+ id: "openclaw",
2277
+ displayName: "OpenClaw",
2278
+ description: "Self-hosted autonomous coding agent (default)",
2279
+ status: "available",
2280
+ driver: openClawDriver,
2281
+ npmPackage: openClawDriver.npmPackage()
2282
+ }
2283
+ // Future entries land here. Example (commented to keep the menu
2284
+ // clean until the real driver ships):
2285
+ // {
2286
+ // id: "hermes",
2287
+ // displayName: "Hermes",
2288
+ // description: "Hermes multi-model agent",
2289
+ // status: "coming-soon",
2290
+ // },
2291
+ ];
2292
+ }
2293
+ });
2294
+
2258
2295
  // ../core/dist/service-target-spec.js
2259
2296
  function buildOpenclawTargetSpec(ctx) {
2260
2297
  const isMjs = ctx.agentBinary.endsWith(".mjs") || ctx.agentBinary.endsWith(".js");
@@ -2592,7 +2629,7 @@ var init_launchd = __esm({
2592
2629
  }
2593
2630
  }
2594
2631
  async list() {
2595
- let stdout = "";
2632
+ let stdout;
2596
2633
  try {
2597
2634
  ({ stdout } = await execFileP("launchctl", ["list"]));
2598
2635
  } catch {
@@ -2847,7 +2884,7 @@ var init_systemd = __esm({
2847
2884
  }
2848
2885
  async list() {
2849
2886
  const results = [];
2850
- let unitFiles = [];
2887
+ let unitFiles;
2851
2888
  try {
2852
2889
  unitFiles = (await fs2.readdir(this.unitDir)).filter((f) => f.startsWith(SYSTEMD_PREFIX) && f.endsWith(".service"));
2853
2890
  } catch {
@@ -3070,7 +3107,7 @@ var init_task_scheduler = __esm({
3070
3107
  }
3071
3108
  }
3072
3109
  async list() {
3073
- let stdout = "";
3110
+ let stdout;
3074
3111
  try {
3075
3112
  ({ stdout } = await execFileP3("schtasks", ["/Query", "/FO", "CSV"]));
3076
3113
  } catch {
@@ -3235,7 +3272,7 @@ ${spec.id}
3235
3272
  };
3236
3273
  }
3237
3274
  async list() {
3238
- let files = [];
3275
+ let files;
3239
3276
  try {
3240
3277
  files = (await fs4.readdir(this.stateDir)).filter((f) => f.endsWith(".json"));
3241
3278
  } catch {
@@ -3494,6 +3531,7 @@ var init_dist = __esm({
3494
3531
  init_registry();
3495
3532
  init_local_agent();
3496
3533
  init_detect();
3534
+ init_registry2();
3497
3535
  init_service_target_spec();
3498
3536
  init_services();
3499
3537
  }
@@ -4263,15 +4301,20 @@ async function run(agentFramework, options) {
4263
4301
  await ensureDirs();
4264
4302
  const cfg = await loadOrCreateConfig();
4265
4303
  const reporter = new CliReporter();
4266
- if (agentFramework !== "openclaw") {
4267
- throw new Error(`Agent framework '${agentFramework}' is not yet supported. Use 'openclaw'.`);
4304
+ const descriptor = frameworkById(agentFramework);
4305
+ if (!descriptor || descriptor.status !== "available") {
4306
+ const avail = availableFrameworks().map((f) => f.id).join(", ");
4307
+ throw new Error(
4308
+ `Agent framework '${agentFramework}' is not available. Available: ${avail}.`
4309
+ );
4268
4310
  }
4311
+ const driver = descriptor.driver;
4269
4312
  const identity = await loadOrCreateIdentity();
4270
4313
  const fp = fingerprint(identity);
4271
4314
  const pubkey = publicKeyB64(identity);
4272
4315
  const keyFile = p.joinPath(beeoHome(), "identity", "keypair.json");
4273
4316
  const gwToken = await loadOrCreateGatewayToken();
4274
- const location = await findAgent(openClawDriver);
4317
+ const location = await findAgent(driver);
4275
4318
  let binary;
4276
4319
  let home;
4277
4320
  let isSystemHome = false;
@@ -4314,8 +4357,8 @@ async function run(agentFramework, options) {
4314
4357
  }
4315
4358
  }
4316
4359
  } else {
4317
- reporter.onStatus(`Downloading ${openClawDriver.npmPackage()}...`);
4318
- await downloadAgent(openClawDriver.npmPackage(), options.version ?? void 0, agentFramework, reporter);
4360
+ reporter.onStatus(`Downloading ${driver.npmPackage()}...`);
4361
+ await downloadAgent(driver.npmPackage(), options.version ?? void 0, agentFramework, reporter);
4319
4362
  home = agentHome(agentFramework);
4320
4363
  await p.mkdir(home);
4321
4364
  await ensurePlugin(agentFramework, home, reporter);
@@ -4499,7 +4542,6 @@ async function run3() {
4499
4542
  try {
4500
4543
  services = await mgr.list();
4501
4544
  } catch {
4502
- services = [];
4503
4545
  }
4504
4546
  if (services.length === 0) {
4505
4547
  console.log(" (no services registered)");
@@ -4839,13 +4881,15 @@ async function run7(options) {
4839
4881
  if (decision === "rebind-keep-key" || decision === "rebind-new-key") {
4840
4882
  await removeBindingInfo();
4841
4883
  }
4842
- const framework = options.framework ?? "openclaw";
4843
- if (framework !== "openclaw") {
4884
+ const frameworkId = await decideFramework(state, decision, options);
4885
+ const descriptor = frameworkById(frameworkId);
4886
+ if (!descriptor || descriptor.status !== "available") {
4887
+ const avail = availableFrameworks().map((f) => f.id).join(", ");
4844
4888
  throw new Error(
4845
- `Agent framework '${framework}' is not yet supported. Only 'openclaw' is available today.`
4889
+ `Agent framework '${frameworkId}' is not available. Available: ${avail}.`
4846
4890
  );
4847
4891
  }
4848
- await run(framework, {
4892
+ await run(descriptor.id, {
4849
4893
  force: true,
4850
4894
  json: options.json,
4851
4895
  browser: options.browser !== false
@@ -4883,6 +4927,53 @@ async function decideAction(state, options) {
4883
4927
  }
4884
4928
  return choice.options[idx - 1];
4885
4929
  }
4930
+ async function decideFramework(state, decision, options) {
4931
+ if (options.framework && options.framework.trim()) {
4932
+ return options.framework.trim();
4933
+ }
4934
+ if (state.binding && (decision === "upgrade" || decision === "rebind-keep-key")) {
4935
+ return defaultFrameworkId();
4936
+ }
4937
+ if (options.yes || options.json || !process.stdin.isTTY) {
4938
+ return defaultFrameworkId();
4939
+ }
4940
+ const all = listFrameworks();
4941
+ const avail = availableFrameworks();
4942
+ if (avail.length <= 1) {
4943
+ const only = avail[0];
4944
+ if (only) {
4945
+ console.log(`Installing ${only.displayName} (only available framework).`);
4946
+ return only.id;
4947
+ }
4948
+ return defaultFrameworkId();
4949
+ }
4950
+ console.log("");
4951
+ console.log("Choose agent framework:");
4952
+ const def = defaultFrameworkId();
4953
+ all.forEach((f, i) => {
4954
+ const marker = f.id === def ? "*" : " ";
4955
+ const tag = f.status === "coming-soon" ? " [coming soon]" : "";
4956
+ const padName = f.displayName.padEnd(12);
4957
+ console.log(` ${marker} [${i + 1}] ${padName} ${f.description}${tag}`);
4958
+ });
4959
+ console.log("");
4960
+ const defaultIdx = all.findIndex((f) => f.id === def) + 1;
4961
+ const answer = await prompt(`Choose [1-${all.length}] (default ${defaultIdx}): `);
4962
+ const trimmed = answer.trim();
4963
+ if (!trimmed) return def;
4964
+ const idx = parseInt(trimmed, 10);
4965
+ if (!Number.isFinite(idx) || idx < 1 || idx > all.length) {
4966
+ return def;
4967
+ }
4968
+ const picked = all[idx - 1];
4969
+ if (picked.status !== "available") {
4970
+ console.log(
4971
+ ` ${picked.displayName} is not yet available. Falling back to ${def}.`
4972
+ );
4973
+ return def;
4974
+ }
4975
+ return picked.id;
4976
+ }
4886
4977
  async function maybePromptServiceInstall() {
4887
4978
  try {
4888
4979
  const mgr = await getServiceManager();
@@ -4983,7 +5074,6 @@ async function uninstall(options) {
4983
5074
  try {
4984
5075
  services = await mgr.list();
4985
5076
  } catch {
4986
- services = [];
4987
5077
  }
4988
5078
  const removed = [];
4989
5079
  const errors = [];
@@ -5013,7 +5103,6 @@ async function status(options) {
5013
5103
  try {
5014
5104
  services = await mgr.list();
5015
5105
  } catch {
5016
- services = [];
5017
5106
  }
5018
5107
  if (options.json) {
5019
5108
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beeos-ai/cli",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "description": "BeeOS CLI — run AI agents from your desktop",
6
6
  "bin": {