@open-artifacts/bus 0.253.1 → 0.254.0

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.253.1";
14
+ const CLIENT_VERSION = "0.254.0";
15
15
 
16
16
  type Frame = Json & { type: string; id: string };
17
17
  type Ctx = {
@@ -573,11 +573,19 @@ function rosterLine(
573
573
  }
574
574
 
575
575
  /** @oa/bus-protocol isFallbackName: a name only the harness gave the session. */
576
+ const KIND_DEFAULT_NAMES: Readonly<Record<string, string>> = {
577
+ antigravity: "agy",
578
+ };
579
+
576
580
  const isFallbackName = (name: string, kind: string): boolean => {
577
581
  const lname = name.toLowerCase();
582
+ const d = Object.hasOwn(KIND_DEFAULT_NAMES, kind)
583
+ ? KIND_DEFAULT_NAMES[kind]
584
+ : undefined;
578
585
  return (
579
586
  lname === kind ||
580
587
  lname.startsWith(`${kind}-`) ||
588
+ (d !== undefined && (lname === d || lname.startsWith(`${d}-`))) ||
581
589
  lname === "agent" ||
582
590
  /^claude-\d+$/.test(lname)
583
591
  );
@@ -493,10 +493,20 @@ def roster_line(a, now_ms, home=None):
493
493
  return f"- {a['name']} ({', '.join(parts)}){mark}{tail}"
494
494
 
495
495
 
496
+ KIND_DEFAULT_NAMES = {"antigravity": "agy"}
497
+
498
+
496
499
  def is_fallback_name(name, kind):
497
500
  """bus-protocol isFallbackName: a name only the harness gave the session."""
498
501
  low = name.lower()
499
- return low == kind or low.startswith(f"{kind}-") or low == "agent" or re.fullmatch(r"claude-\d+", low) is not None
502
+ d = KIND_DEFAULT_NAMES.get(kind)
503
+ return (
504
+ low == kind
505
+ or low.startswith(f"{kind}-")
506
+ or (d is not None and (low == d or low.startswith(f"{d}-")))
507
+ or low == "agent"
508
+ or re.fullmatch(r"claude-\d+", low) is not None
509
+ )
500
510
 
501
511
 
502
512
  AWAY_RECENT_MS = 60 * 60_000
@@ -27212,9 +27212,13 @@ var KindTokenSchema = external_exports.string().regex(/^[a-z][a-z0-9-]{0,31}$/);
27212
27212
 
27213
27213
  // ../bus-protocol/src/meta.ts
27214
27214
  var FALLBACK_BUS_NAME = "agent";
27215
+ var KIND_DEFAULT_NAMES = {
27216
+ antigravity: "agy"
27217
+ };
27215
27218
  function isFallbackName(name, kind) {
27216
27219
  const lname = name.toLowerCase();
27217
- return lname === kind || lname.startsWith(`${kind}-`) || lname === FALLBACK_BUS_NAME || /^claude-\d+$/.test(lname);
27220
+ const d = Object.hasOwn(KIND_DEFAULT_NAMES, kind) ? KIND_DEFAULT_NAMES[kind] : void 0;
27221
+ return lname === kind || lname.startsWith(`${kind}-`) || d !== void 0 && (lname === d || lname.startsWith(`${d}-`)) || lname === FALLBACK_BUS_NAME || /^claude-\d+$/.test(lname);
27218
27222
  }
27219
27223
  var INSTANCE_SENDER_NAME = "open-artifacts";
27220
27224
  var BUS_CMD = "npx @open-artifacts/bus";
@@ -27401,12 +27405,25 @@ var Sessions = external_exports.strictObject({
27401
27405
  ...base,
27402
27406
  type: external_exports.literal("sessions"),
27403
27407
  open: external_exports.array(AgentRefSchema).max(LIMITS.maxRosterAgents),
27404
- closed: external_exports.array(AgentRefSchema).max(LIMITS.maxRosterAgents)
27408
+ closed: external_exports.array(AgentRefSchema).max(LIMITS.maxRosterAgents),
27409
+ /**
27410
+ * #3208 (`BUS_CAPS.sessionsGone`): refs of closed sessions that will never
27411
+ * reopen (a subset of `closed`). The hub expires their pending mail as
27412
+ * `recipient_closed` and drops their away reservations. Sent only after
27413
+ * `hello_ok.caps` listed `sessions_gone` (older hubs refuse the key).
27414
+ */
27415
+ gone: external_exports.array(AgentRefSchema).max(LIMITS.maxRosterAgents).optional()
27405
27416
  }).refine((f) => {
27406
27417
  if (!distinct(f.open) || !distinct(f.closed)) return false;
27407
27418
  const open2 = new Set(f.open);
27408
- return !f.closed.some((r) => open2.has(r));
27409
- }, "duplicate or overlapping session refs");
27419
+ if (f.closed.some((r) => open2.has(r))) return false;
27420
+ if (f.gone !== void 0) {
27421
+ if (!distinct(f.gone)) return false;
27422
+ const closed = new Set(f.closed);
27423
+ if (f.gone.some((r) => !closed.has(r))) return false;
27424
+ }
27425
+ return true;
27426
+ }, "duplicate, overlapping, or unclosed gone session refs");
27410
27427
  var Send = external_exports.strictObject({
27411
27428
  ...base,
27412
27429
  type: external_exports.literal("send"),
@@ -27910,7 +27927,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
27910
27927
  var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
27911
27928
  var isWellFormed2 = (s) => s.isWellFormed();
27912
27929
  var WELL_FORMED = { message: "text is not well-formed unicode" };
27913
- var CLIENT_VERSION = true ? "0.253.1" : "0.0.0";
27930
+ var CLIENT_VERSION = true ? "0.254.0" : "0.0.0";
27914
27931
  var clientVersion = {
27915
27932
  client_version: external_exports.string().min(1).max(64).optional()
27916
27933
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-bus",
3
- "version": "0.253.1",
3
+ "version": "0.254.0",
4
4
  "type": "module",
5
5
  "openclaw": {
6
6
  "extensions": [