@open-artifacts/bus 0.252.0 → 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.252.0";
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"),
@@ -27513,6 +27530,35 @@ var ProofSeen = external_exports.strictObject({
27513
27530
  type: external_exports.literal("proof_seen"),
27514
27531
  hash: LinkProofHashSchema
27515
27532
  });
27533
+ var CodexThreadIdSchema = external_exports.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
27534
+ var CodexExecCallIdSchema = external_exports.string().regex(/^exec-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
27535
+ var CodexDirectCallIdSchema = external_exports.string().regex(/^call_[A-Za-z0-9]{8,64}$/);
27536
+ var CodexItemIdSchema = external_exports.string().regex(/^ctc_[0-9a-f]{16,96}$/);
27537
+ var CodexToolNameSchema = external_exports.string().regex(/^[a-z][a-z0-9_]{0,63}$/);
27538
+ var CodexCallCheck = external_exports.strictObject({
27539
+ ...base,
27540
+ type: external_exports.literal("codex_call_check"),
27541
+ thread_id: CodexThreadIdSchema,
27542
+ tool: CodexToolNameSchema,
27543
+ mode: external_exports.discriminatedUnion("kind", [
27544
+ external_exports.strictObject({
27545
+ kind: external_exports.literal("direct"),
27546
+ call_id: CodexDirectCallIdSchema,
27547
+ args_sha256: LinkProofHashSchema
27548
+ }),
27549
+ external_exports.strictObject({
27550
+ kind: external_exports.literal("code"),
27551
+ call_id: CodexExecCallIdSchema,
27552
+ item_id: CodexItemIdSchema
27553
+ })
27554
+ ])
27555
+ });
27556
+ var CodexCallChecked = external_exports.strictObject({
27557
+ ...base,
27558
+ type: external_exports.literal("codex_call_checked"),
27559
+ re: FrameIdSchema,
27560
+ ok: external_exports.boolean()
27561
+ });
27516
27562
  var MAX_WAITING_QUERY = 64;
27517
27563
  var WaitingQuery = external_exports.strictObject({
27518
27564
  ...base,
@@ -27793,7 +27839,8 @@ var ClientFrameSchema = external_exports.discriminatedUnion("type", [
27793
27839
  WaitingQuery,
27794
27840
  UpdateReport,
27795
27841
  GuestUp,
27796
- GuestDown
27842
+ GuestDown,
27843
+ CodexCallChecked
27797
27844
  ]);
27798
27845
  var ServerFrameSchema = external_exports.discriminatedUnion("type", [
27799
27846
  HelloOk,
@@ -27816,7 +27863,8 @@ var ServerFrameSchema = external_exports.discriminatedUnion("type", [
27816
27863
  InstallNow,
27817
27864
  UpdateAck,
27818
27865
  OwnerAwayPush,
27819
- ProofSeen
27866
+ ProofSeen,
27867
+ CodexCallCheck
27820
27868
  ]);
27821
27869
  var FrameSchema = external_exports.discriminatedUnion("type", [
27822
27870
  Hello,
@@ -27838,6 +27886,7 @@ var FrameSchema = external_exports.discriminatedUnion("type", [
27838
27886
  UpdateReport,
27839
27887
  GuestUp,
27840
27888
  GuestDown,
27889
+ CodexCallChecked,
27841
27890
  HelloOk,
27842
27891
  AgentOk,
27843
27892
  ReceiptFrame,
@@ -27858,7 +27907,8 @@ var FrameSchema = external_exports.discriminatedUnion("type", [
27858
27907
  InstallNow,
27859
27908
  UpdateAck,
27860
27909
  OwnerAwayPush,
27861
- ProofSeen
27910
+ ProofSeen,
27911
+ CodexCallCheck
27862
27912
  ]);
27863
27913
  var MAX_RAW_FRAME_CHARS = 2 * LIMITS.maxMessageBytes + 4096;
27864
27914
 
@@ -27877,7 +27927,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
27877
27927
  var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
27878
27928
  var isWellFormed2 = (s) => s.isWellFormed();
27879
27929
  var WELL_FORMED = { message: "text is not well-formed unicode" };
27880
- var CLIENT_VERSION = true ? "0.252.0" : "0.0.0";
27930
+ var CLIENT_VERSION = true ? "0.254.0" : "0.0.0";
27881
27931
  var clientVersion = {
27882
27932
  client_version: external_exports.string().min(1).max(64).optional()
27883
27933
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-bus",
3
- "version": "0.252.0",
3
+ "version": "0.254.0",
4
4
  "type": "module",
5
5
  "openclaw": {
6
6
  "extensions": [