@open-artifacts/bus 0.254.0 → 0.257.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.254.0";
14
+ const CLIENT_VERSION = "0.257.0";
15
15
 
16
16
  type Frame = Json & { type: string; id: string };
17
17
  type Ctx = {
@@ -27803,7 +27803,9 @@ var Deliver = external_exports.strictObject({
27803
27803
  body: InlineBodySchema.optional(),
27804
27804
  notice: Notice.optional(),
27805
27805
  /** Only from the reserved sender, only with BUS_CAPS.noticeMeta (#2768). */
27806
- meta: NoticeMetaSchema.optional()
27806
+ meta: NoticeMetaSchema.optional(),
27807
+ /** When the hub drops this message if it is still unacked; set only with BUS_CAPS.mailExpiry. */
27808
+ expires_at: IsoTimeSchema.optional()
27807
27809
  }).refine(
27808
27810
  (f) => f.meta === void 0 || f.from_name === INSTANCE_SENDER_NAME,
27809
27811
  "meta only from the instance"
@@ -27927,7 +27929,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
27927
27929
  var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
27928
27930
  var isWellFormed2 = (s) => s.isWellFormed();
27929
27931
  var WELL_FORMED = { message: "text is not well-formed unicode" };
27930
- var CLIENT_VERSION = true ? "0.254.0" : "0.0.0";
27932
+ var CLIENT_VERSION = true ? "0.257.0" : "0.0.0";
27931
27933
  var clientVersion = {
27932
27934
  client_version: external_exports.string().min(1).max(64).optional()
27933
27935
  };
@@ -27969,7 +27971,15 @@ var ADAPTER_CAPS = {
27969
27971
  * `welcome.caps` only for an adapter that listed it, and an adapter sends
27970
27972
  * the frame only to a daemon whose welcome listed it.
27971
27973
  */
27972
- link: "link"
27974
+ link: "link",
27975
+ /**
27976
+ * `agy_watch` (agy S3): this antigravity connection is the watcher of one
27977
+ * agy process, not a conversation. Its hello names the watcher's own pid
27978
+ * and the agy process's start time; the daemon walks the watcher's parents
27979
+ * to that agy process and pushes it `agy_deliver` frames, which it answers
27980
+ * with `ack` or `agy_failed`. Any other request on it is refused.
27981
+ */
27982
+ agyWatch: "agy_watch"
27973
27983
  };
27974
27984
  var Hello2 = external_exports.object({
27975
27985
  ...base2,
@@ -28120,13 +28130,26 @@ var LinkProofRequest = external_exports.object({
28120
28130
  * main, so an older helper's frame is unchanged. The daemon binds it only on
28121
28131
  * that instance's hub, and only for a session homed there.
28122
28132
  */
28123
- instance: external_exports.string().regex(/^[a-z0-9-]{1,32}$/).optional()
28133
+ instance: external_exports.string().regex(/^[a-z0-9-]{1,32}$/).optional(),
28134
+ /**
28135
+ * agy S5: the Antigravity conversation this proof is for, from the
28136
+ * tools/call `_meta` agy sends. Present, `pid` is an agy process and the
28137
+ * daemon binds the hash only to the live antigravity session of that pid
28138
+ * and conversation. Absent, the request is Claude's, as before.
28139
+ */
28140
+ conversation: AGENT_REF.optional()
28124
28141
  });
28125
28142
  var AdapterLinkProof = external_exports.object({
28126
28143
  ...base2,
28127
28144
  type: external_exports.literal("link_proof"),
28128
28145
  hash: LinkProofHashSchema
28129
28146
  }).strict();
28147
+ var AgyFailed = external_exports.object({
28148
+ ...base2,
28149
+ type: external_exports.literal("agy_failed"),
28150
+ msg_id: MsgIdSchema,
28151
+ outcome: external_exports.literal("unknown").optional()
28152
+ });
28130
28153
  var AdapterFrame = external_exports.discriminatedUnion("type", [
28131
28154
  Hello2,
28132
28155
  Send2,
@@ -28141,7 +28164,8 @@ var AdapterFrame = external_exports.discriminatedUnion("type", [
28141
28164
  Following2,
28142
28165
  ProposeReach,
28143
28166
  Habits,
28144
- AdapterLinkProof
28167
+ AdapterLinkProof,
28168
+ AgyFailed
28145
28169
  ]);
28146
28170
  var ConfigFile = external_exports.object({
28147
28171
  file: external_exports.string(),
@@ -28278,6 +28302,13 @@ var Deliver2 = external_exports.object({
28278
28302
  }).refine((d) => d.body === void 0 !== (d.notice === void 0), {
28279
28303
  message: "deliver needs exactly one of body or notice"
28280
28304
  });
28305
+ var AgyDeliver = external_exports.object({
28306
+ ...base2,
28307
+ type: external_exports.literal("agy_deliver"),
28308
+ msg_id: MsgIdSchema,
28309
+ conversation_id: AGENT_REF,
28310
+ text: external_exports.string().min(1)
28311
+ });
28281
28312
  var Notice2 = external_exports.object({
28282
28313
  ...base2,
28283
28314
  type: external_exports.literal("notice"),
@@ -28401,6 +28432,7 @@ var DaemonFrame = external_exports.discriminatedUnion("type", [
28401
28432
  Agent,
28402
28433
  Body,
28403
28434
  Deliver2,
28435
+ AgyDeliver,
28404
28436
  Notice2,
28405
28437
  ErrorFrame2,
28406
28438
  StatusReply,
@@ -28466,6 +28498,10 @@ async function connectDaemon(opts) {
28466
28498
  const early = [];
28467
28499
  let notice;
28468
28500
  const earlyNotices = [];
28501
+ let agyDeliver;
28502
+ const earlyAgy = [];
28503
+ const closers = [];
28504
+ let closedOnce = false;
28469
28505
  const report = opts.onError ?? ((e) => console.error("onDeliver threw", e));
28470
28506
  const dispatch = (f) => {
28471
28507
  try {
@@ -28494,6 +28530,16 @@ async function connectDaemon(opts) {
28494
28530
  else early.push(frame);
28495
28531
  continue;
28496
28532
  }
28533
+ if (frame.type === "agy_deliver") {
28534
+ if (!agyDeliver) earlyAgy.push(frame);
28535
+ else
28536
+ try {
28537
+ agyDeliver(frame);
28538
+ } catch (e) {
28539
+ report(e);
28540
+ }
28541
+ continue;
28542
+ }
28497
28543
  if (frame.type === "notice") {
28498
28544
  if (notice) {
28499
28545
  try {
@@ -28519,7 +28565,12 @@ async function connectDaemon(opts) {
28519
28565
  }
28520
28566
  });
28521
28567
  sock.on("error", (e) => failAll(e));
28522
- sock.on("close", () => failAll(new Error("daemon connection closed")));
28568
+ sock.on("close", () => {
28569
+ failAll(new Error("daemon connection closed"));
28570
+ if (closedOnce) return;
28571
+ closedOnce = true;
28572
+ for (const cb of closers.splice(0)) cb();
28573
+ });
28523
28574
  let timer;
28524
28575
  const welcomeRaw = await new Promise((resolve3, reject) => {
28525
28576
  waiters.push({ resolve: resolve3, reject });
@@ -28582,6 +28633,28 @@ async function connectDaemon(opts) {
28582
28633
  notice = cb;
28583
28634
  for (const t of earlyNotices.splice(0)) cb(t);
28584
28635
  },
28636
+ onAgyDeliver: (cb) => {
28637
+ agyDeliver = cb;
28638
+ for (const f of earlyAgy.splice(0)) cb(f);
28639
+ },
28640
+ agyFailed: (msg_id) => {
28641
+ if (state === "closed") return;
28642
+ sock.write(
28643
+ `${JSON.stringify({ v: 1, type: "agy_failed", id: `agyf-${++seq}`, msg_id })}
28644
+ `
28645
+ );
28646
+ },
28647
+ agyUnknown: (msg_id) => {
28648
+ if (state === "closed") return;
28649
+ sock.write(
28650
+ `${JSON.stringify({ v: 1, type: "agy_failed", id: `agyf-${++seq}`, msg_id, outcome: "unknown" })}
28651
+ `
28652
+ );
28653
+ },
28654
+ onClose: (cb) => {
28655
+ if (closedOnce) cb();
28656
+ else closers.push(cb);
28657
+ },
28585
28658
  close: () => sock.destroy()
28586
28659
  };
28587
28660
  }
@@ -30400,6 +30473,9 @@ var ServerResultSchema = union([
30400
30473
  CreateTaskResultSchema
30401
30474
  ]);
30402
30475
 
30476
+ // ../bus-adapter-claude-code/src/forward.ts
30477
+ var MAX_BODY = 16 * 1024 * 1024;
30478
+
30403
30479
  // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@4.6.7/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
30404
30480
  var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
30405
30481
 
@@ -30712,9 +30788,6 @@ var RESTART_REFUSAL = `Open Artifacts bus did not accept this thread: the update
30712
30788
  // ../bus-adapter-claude-code/src/connect.ts
30713
30789
  var NOT_CONNECTED_MESSAGE = `oa-bus: this session isn't connected to the bus. Tell your user. Installing restarts the bus for every session on this machine, so ask them before running \`${BUS_CMD} install\`.`;
30714
30790
 
30715
- // ../bus-adapter-claude-code/src/forward.ts
30716
- var MAX_BODY = 16 * 1024 * 1024;
30717
-
30718
30791
  // ../bus-adapter-claude-code/src/socket-path.ts
30719
30792
  import { createHash } from "node:crypto";
30720
30793
  import { lstatSync, mkdirSync, realpathSync } from "node:fs";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-bus",
3
- "version": "0.254.0",
3
+ "version": "0.257.0",
4
4
  "type": "module",
5
5
  "openclaw": {
6
6
  "extensions": [