@open-artifacts/bus 0.213.0 → 0.214.1

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/assets/oa-bus.ts CHANGED
@@ -11,7 +11,7 @@ import { StringDecoder } from "node:string_decoder";
11
11
  type Json = Record<string, unknown>;
12
12
 
13
13
  /** The IPC marker (CONTRACT.md): the package version, stamped by the CLI's bundler. */
14
- const CLIENT_VERSION = "0.213.0";
14
+ const CLIENT_VERSION = "0.214.1";
15
15
 
16
16
  type Frame = Json & { type: string; id: string };
17
17
  type Ctx = {
@@ -27846,7 +27846,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
27846
27846
  var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
27847
27847
  var isWellFormed2 = (s) => s.isWellFormed();
27848
27848
  var WELL_FORMED = { message: "text is not well-formed unicode" };
27849
- var CLIENT_VERSION = true ? "0.213.0" : "0.0.0";
27849
+ var CLIENT_VERSION = true ? "0.214.1" : "0.0.0";
27850
27850
  var clientVersion = {
27851
27851
  client_version: external_exports.string().min(1).max(64).optional()
27852
27852
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-bus",
3
- "version": "0.213.0",
3
+ "version": "0.214.1",
4
4
  "type": "module",
5
5
  "openclaw": {
6
6
  "extensions": [
package/dist/index.js CHANGED
@@ -32854,7 +32854,7 @@ var init_frames = __esm({
32854
32854
  late = { late: external_exports.array(external_exports.string().min(1)).optional() };
32855
32855
  isWellFormed2 = (s) => s.isWellFormed();
32856
32856
  WELL_FORMED = { message: "text is not well-formed unicode" };
32857
- CLIENT_VERSION = true ? "0.213.0" : "0.0.0";
32857
+ CLIENT_VERSION = true ? "0.214.1" : "0.0.0";
32858
32858
  clientVersion = {
32859
32859
  client_version: external_exports.string().min(1).max(64).optional()
32860
32860
  };
@@ -44727,6 +44727,18 @@ import {
44727
44727
  } from "node:fs";
44728
44728
  import { join as join3 } from "node:path";
44729
44729
  var home = () => busHome();
44730
+ var isDefaultHome = (h = home()) => h === busHome({});
44731
+ function procBusHome(pid) {
44732
+ if (process.platform !== "linux") return null;
44733
+ let env2;
44734
+ try {
44735
+ env2 = readFileSync2(`/proc/${pid}/environ`, "utf8");
44736
+ } catch {
44737
+ return null;
44738
+ }
44739
+ const v = env2.split("\0").find((e) => e.startsWith("OA_BUS_HOME="))?.slice("OA_BUS_HOME=".length);
44740
+ return v ? busHome({ OA_BUS_HOME: v }) : void 0;
44741
+ }
44730
44742
  var socketPath = () => daemonSocketPath(home());
44731
44743
  var claudeReturnDir2 = (h = home()) => claudeReturnDir(h);
44732
44744
  function prepareSocketDir(listenPath, returnDir, h = home()) {
@@ -51551,7 +51563,7 @@ var PINS = {
51551
51563
  payloadType: "application/vnd.in-toto+json",
51552
51564
  tarballName: "bus"
51553
51565
  };
51554
- var MIN_COMMIT_VERSION = "999.0.0";
51566
+ var MIN_COMMIT_VERSION = "0.213.0";
51555
51567
  var VERSION_RE = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/;
51556
51568
  var LIMITS2 = {
51557
51569
  maxVersionLength: 32,
@@ -52252,7 +52264,7 @@ function verifyRelease(rel, opts = {}) {
52252
52264
  }
52253
52265
 
52254
52266
  // ../bus-daemon/src/update/updater.ts
52255
- var UPDATER_LOOP_ENABLED = false;
52267
+ var UPDATER_LOOP_ENABLED = true;
52256
52268
  var TICK_MS = 5e3;
52257
52269
  var REQUEST_MAX_MS = 5 * 6e4;
52258
52270
  var RETRY_MS = 10 * 6e4;
@@ -53120,6 +53132,8 @@ async function runDaemon(deps2 = {}) {
53120
53132
  prepareSocketDir(listenPath, returnDir);
53121
53133
  const startOfPid = cl.procStart ?? claudeProcStartOf;
53122
53134
  const running = cl.isRunning ?? isRunning;
53135
+ const discoverClaude = cl.discover ?? isDefaultHome();
53136
+ const claudeHomeOf = cl.homeOf ?? procBusHome;
53123
53137
  const claudeSessions = {
53124
53138
  dir: cl.sessionsDir ?? claudeSessionsDir(),
53125
53139
  procStart: cachedProcStart(cl.procStart ?? claudeProcStartOf, running),
@@ -53533,6 +53547,11 @@ async function runDaemon(deps2 = {}) {
53533
53547
  for (const s of live) {
53534
53548
  const prev = agents.byRef(s.ref);
53535
53549
  if (prev && prev.kind !== "claude-code") continue;
53550
+ if (!prev && !discoverClaude) continue;
53551
+ if (!prev) {
53552
+ const h = claudeHomeOf(s.pid);
53553
+ if (typeof h === "string" && h !== home()) continue;
53554
+ }
53536
53555
  if (prev && prev.procStart === void 0 && prev.pid === s.pid)
53537
53556
  prev.procStart = s.procStart;
53538
53557
  if (prev?.live) {
@@ -54890,7 +54909,10 @@ async function runDaemon(deps2 = {}) {
54890
54909
  exit: upd.exit,
54891
54910
  log,
54892
54911
  ...upd.enabled !== void 0 ? { enabled: upd.enabled } : {},
54893
- ...upd.every ? { every: upd.every } : {}
54912
+ ...upd.every ? { every: upd.every } : {},
54913
+ ...upd.now ? { now: upd.now } : {},
54914
+ ...upd.fetch ? { fetch: upd.fetch } : {},
54915
+ ...upd.verify ? { verify: upd.verify } : {}
54894
54916
  }) : void 0;
54895
54917
  updaterRef = updater;
54896
54918
  updater?.start();
@@ -55293,11 +55315,16 @@ function copy(style, bus = BUS_CMD, approve) {
55293
55315
  ],
55294
55316
  // Status and doctor, when the hub runs a newer release (C26h). Each
55295
55317
  // version is cut to 19, so the line stays within 80 columns.
55296
- updateAvailable: (hub, mine) => [
55318
+ // The update goes through the instance's checked install step, never an
55319
+ // unchecked npx download.
55320
+ updateAvailable: (hub, mine, origin) => [
55297
55321
  warn(
55298
55322
  `Update available: ${cutMiddle(hub, 19, more)} (this machine runs ${cutMiddle(mine, 19, more)})`
55299
55323
  ),
55300
- next(`Run ${BUS_CMD}@latest install.`)
55324
+ next(`Ask your agent to follow "Install the bus" in`),
55325
+ next(
55326
+ origin ? `${origin.replace(/\/+$/, "")}/llms.txt.` : "your instance's llms.txt."
55327
+ )
55301
55328
  ],
55302
55329
  // Status and doctor, when the hub's `/healthz` names a problem (#294).
55303
55330
  hubProblem: (problem) => [
@@ -57595,9 +57622,9 @@ var real = (path, native = false) => {
57595
57622
  return parent === abs ? abs : join26(real(parent, native), basename7(abs));
57596
57623
  }
57597
57624
  };
57598
- var isDefaultHome = (home2, userHome) => real(home2) === real(join26(userHome, ".oa-bus"));
57625
+ var isDefaultHome2 = (home2, userHome) => real(home2) === real(join26(userHome, ".oa-bus"));
57599
57626
  function serviceNames(home2, userHome) {
57600
- const suffix = isDefaultHome(home2, userHome) ? "" : createHash9("sha256").update(real(home2)).digest("hex").slice(0, 8);
57627
+ const suffix = isDefaultHome2(home2, userHome) ? "" : createHash9("sha256").update(real(home2)).digest("hex").slice(0, 8);
57601
57628
  return {
57602
57629
  label: suffix ? `${LAUNCHD_LABEL}.${suffix}` : LAUNCHD_LABEL,
57603
57630
  unit: suffix ? `oa-bus-${suffix}.service` : SYSTEMD_UNIT
@@ -57735,7 +57762,7 @@ function systemService(d) {
57735
57762
  entry: join26(h, "bin", entryName(src)),
57736
57763
  env: {
57737
57764
  PATH: servicePath(d.env, d.execPath, d.platform),
57738
- ...isDefaultHome(h, d.userHome) ? {} : { OA_BUS_HOME: h },
57765
+ ...isDefaultHome2(h, d.userHome) ? {} : { OA_BUS_HOME: h },
57739
57766
  // Attestation and wake read the Codex home this shell uses (C26e).
57740
57767
  ...codexHomeEnv(d.userHome, d.env)
57741
57768
  },
@@ -57919,7 +57946,7 @@ var noService = {
57919
57946
  remove: async () => ({}),
57920
57947
  cli: () => ["oa-bus"]
57921
57948
  };
57922
- var VERSION = true ? "0.213.0" : JSON.parse(
57949
+ var VERSION = true ? "0.214.1" : JSON.parse(
57923
57950
  readFileSync21(new URL("../package.json", import.meta.url), "utf8")
57924
57951
  ).version;
57925
57952
  var which = (cmd) => {
@@ -62864,7 +62891,7 @@ function busCmd(o) {
62864
62891
  }
62865
62892
  }
62866
62893
  function wiredTo(ctx) {
62867
- if (isDefaultHome(ctx.home, ctx.userHome)) return true;
62894
+ if (isDefaultHome2(ctx.home, ctx.userHome)) return true;
62868
62895
  try {
62869
62896
  return Object.values(
62870
62897
  checkAdapters({
@@ -62998,7 +63025,7 @@ function claudeProofChecks(ctx, hub) {
62998
63025
  projectFile: join36(ctx.cwd, ".mcp.json"),
62999
63026
  cwd: ctx.cwd,
63000
63027
  recorded: rec.proofs,
63001
- ...isDefaultHome(ctx.home, ctx.userHome) ? {} : { busHome: ctx.home }
63028
+ ...isDefaultHome2(ctx.home, ctx.userHome) ? {} : { busHome: ctx.home }
63002
63029
  });
63003
63030
  const out = [];
63004
63031
  const install3 = `run ${ctx.busCmd} install`;
@@ -65083,7 +65110,7 @@ async function install2(opts, realCtx2) {
65083
65110
  }
65084
65111
  async function installRun(opts, realCtx2) {
65085
65112
  const second = Boolean(opts.alongside);
65086
- if (second && isDefaultHome(realCtx2.home, realCtx2.userHome)) {
65113
+ if (second && isDefaultHome2(realCtx2.home, realCtx2.userHome)) {
65087
65114
  sayErr(realCtx2, [
65088
65115
  "--alongside sets up a second bus, so it needs --home <dir> for a folder other than the main one.",
65089
65116
  `Run ${realCtx2.busCmd} install --alongside --home <dir> --instance <url>.`
@@ -65247,7 +65274,7 @@ async function status(ctx) {
65247
65274
  st,
65248
65275
  async () => (await health).version
65249
65276
  );
65250
- if (update2) say(ctx, c.updateAvailable(update2, st.version));
65277
+ if (update2) say(ctx, c.updateAvailable(update2, st.version, m.hub));
65251
65278
  const habits = habitsLine(ctx);
65252
65279
  if (habits) say(ctx, habits);
65253
65280
  if (readRecord4(ctx.home)?.plugins?.length)
@@ -65413,7 +65440,7 @@ async function doctor(ctx) {
65413
65440
  st,
65414
65441
  async () => (await health()).version
65415
65442
  );
65416
- if (update2) warn(c.updateAvailable(update2, st.version));
65443
+ if (update2) warn(c.updateAvailable(update2, st.version, hub ?? ""));
65417
65444
  } else
65418
65445
  fail3(
65419
65446
  probe2.state === "stalled" ? c.daemonNotResponding() : socketFolderLines(ctx) ?? c.daemonNotRunning()
@@ -65570,7 +65597,7 @@ async function doctor(ctx) {
65570
65597
  else if (sh?.kind === "other") warn(c.shimDoctorOther(tilde(ctx, sh.path)));
65571
65598
  else if (sh?.kind === "missing") warn(c.shimDoctorMissing());
65572
65599
  }
65573
- const others2 = isDefaultHome(ctx.home, ctx.userHome) ? ctx.service.others?.() ?? [] : [];
65600
+ const others2 = isDefaultHome2(ctx.home, ctx.userHome) ? ctx.service.others?.() ?? [] : [];
65574
65601
  if (others2.length > 0) say(ctx, c.otherHomes(others2));
65575
65602
  const habits = habitsLine(ctx);
65576
65603
  if (habits) say(ctx, habits);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@open-artifacts/bus",
3
3
  "type": "module",
4
- "version": "0.213.0",
4
+ "version": "0.214.1",
5
5
  "description": "The Open Artifacts bus: your AI agents reach each other across machines.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -29,6 +29,6 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "oaBus": {
32
- "commit": "33a38a1c96a6fcf1c448def7c9e1a44a16341cca"
32
+ "commit": "ee8537bf720a41d3871f6b4b1f2ecf26fac974b6"
33
33
  }
34
34
  }