@open-artifacts/bus 0.207.0 → 0.209.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 +23 -2
- package/assets/openclaw/index.js +20 -3
- package/assets/openclaw/package.json +1 -1
- package/dist/index.js +37 -9
- package/package.json +2 -2
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.
|
|
14
|
+
const CLIENT_VERSION = "0.209.0";
|
|
15
15
|
|
|
16
16
|
type Frame = Json & { type: string; id: string };
|
|
17
17
|
type Ctx = {
|
|
@@ -1199,7 +1199,28 @@ export default function oaBus(pi: Pi): void {
|
|
|
1199
1199
|
body: stripTerminalControls(String(f.body)),
|
|
1200
1200
|
});
|
|
1201
1201
|
try {
|
|
1202
|
-
|
|
1202
|
+
// #2768: a server notice's fields ride as data in `details`, never in the text.
|
|
1203
|
+
// Only the known keys, as short id-shaped strings, whoever wrote the frame.
|
|
1204
|
+
const raw: unknown = f.meta;
|
|
1205
|
+
const meta: Record<string, string> = {};
|
|
1206
|
+
if (raw && typeof raw === "object")
|
|
1207
|
+
for (const k of [
|
|
1208
|
+
"kind",
|
|
1209
|
+
"artifact_id",
|
|
1210
|
+
"comment_id",
|
|
1211
|
+
"thread_id",
|
|
1212
|
+
"user_id",
|
|
1213
|
+
"until",
|
|
1214
|
+
]) {
|
|
1215
|
+
const v = (raw as Record<string, unknown>)[k];
|
|
1216
|
+
if (typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v))
|
|
1217
|
+
meta[k] = v;
|
|
1218
|
+
}
|
|
1219
|
+
show("oa_bus", content, {
|
|
1220
|
+
msg_id: msgId,
|
|
1221
|
+
from,
|
|
1222
|
+
...(meta.kind ? { meta } : {}),
|
|
1223
|
+
});
|
|
1203
1224
|
} catch {
|
|
1204
1225
|
shown.delete(msgId);
|
|
1205
1226
|
return; // Not handed to Pi: no ack, so the daemon does not call it delivered.
|
package/assets/openclaw/index.js
CHANGED
|
@@ -27688,10 +27688,20 @@ var ErrorFrame = external_exports.strictObject({
|
|
|
27688
27688
|
]),
|
|
27689
27689
|
message: WellFormedText.pipe(external_exports.string().max(1024))
|
|
27690
27690
|
});
|
|
27691
|
+
var NOTICE_META_ID_RE = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
27691
27692
|
var Notice = external_exports.strictObject({
|
|
27692
27693
|
size: external_exports.number().int().gt(LIMITS.inlineBodyBytes).max(LIMITS.maxMessageBytes),
|
|
27693
27694
|
msg_id: MsgIdSchema
|
|
27694
27695
|
});
|
|
27696
|
+
var NoticeMetaSchema = external_exports.strictObject({
|
|
27697
|
+
kind: external_exports.string().regex(/^[a-z_]{1,32}$/),
|
|
27698
|
+
artifact_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
27699
|
+
comment_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
27700
|
+
thread_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
27701
|
+
user_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
27702
|
+
/** ISO 8601 date-time, UTC (`2026-11-18T09:00:00.000Z`). */
|
|
27703
|
+
until: external_exports.string().max(40).regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,6})?)?Z$/).refine((v) => !Number.isNaN(Date.parse(v)), "invalid date").optional()
|
|
27704
|
+
});
|
|
27695
27705
|
var Deliver = external_exports.strictObject({
|
|
27696
27706
|
...base,
|
|
27697
27707
|
type: external_exports.literal("deliver"),
|
|
@@ -27708,8 +27718,13 @@ var Deliver = external_exports.strictObject({
|
|
|
27708
27718
|
/** The SENDER's namespace, so a reply can set `to_namespace` from it. */
|
|
27709
27719
|
namespace: WireNamespaceSchema,
|
|
27710
27720
|
body: InlineBodySchema.optional(),
|
|
27711
|
-
notice: Notice.optional()
|
|
27721
|
+
notice: Notice.optional(),
|
|
27722
|
+
/** Only from the reserved sender, only with BUS_CAPS.noticeMeta (#2768). */
|
|
27723
|
+
meta: NoticeMetaSchema.optional()
|
|
27712
27724
|
}).refine(
|
|
27725
|
+
(f) => f.meta === void 0 || f.from_name === INSTANCE_SENDER_NAME,
|
|
27726
|
+
"meta only from the instance"
|
|
27727
|
+
).refine(
|
|
27713
27728
|
(f) => f.body === void 0 !== (f.notice === void 0),
|
|
27714
27729
|
"body xor notice"
|
|
27715
27730
|
).refine(
|
|
@@ -27817,7 +27832,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
|
|
|
27817
27832
|
var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
|
|
27818
27833
|
var isWellFormed2 = (s) => s.isWellFormed();
|
|
27819
27834
|
var WELL_FORMED = { message: "text is not well-formed unicode" };
|
|
27820
|
-
var CLIENT_VERSION = true ? "0.
|
|
27835
|
+
var CLIENT_VERSION = true ? "0.209.0" : "0.0.0";
|
|
27821
27836
|
var clientVersion = {
|
|
27822
27837
|
client_version: external_exports.string().min(1).max(64).optional()
|
|
27823
27838
|
};
|
|
@@ -28146,7 +28161,9 @@ var Deliver2 = external_exports.object({
|
|
|
28146
28161
|
from_name: external_exports.string(),
|
|
28147
28162
|
namespace: external_exports.string(),
|
|
28148
28163
|
body: external_exports.string().optional(),
|
|
28149
|
-
notice: external_exports.object({ size: external_exports.number(), msg_id: external_exports.string() }).optional()
|
|
28164
|
+
notice: external_exports.object({ size: external_exports.number(), msg_id: external_exports.string() }).optional(),
|
|
28165
|
+
/** #2768: a server notice's structured fields, as data beside the body. */
|
|
28166
|
+
meta: external_exports.object(NoticeMetaSchema.shape).optional()
|
|
28150
28167
|
}).refine((d) => d.body === void 0 !== (d.notice === void 0), {
|
|
28151
28168
|
message: "deliver needs exactly one of body or notice"
|
|
28152
28169
|
});
|
package/dist/index.js
CHANGED
|
@@ -31489,7 +31489,15 @@ var init_caps = __esm({
|
|
|
31489
31489
|
* `update_report` only to a hub that listed it in `hello_ok.caps`. Either
|
|
31490
31490
|
* side without it sees none of these frames.
|
|
31491
31491
|
*/
|
|
31492
|
-
runVersion: "run_version"
|
|
31492
|
+
runVersion: "run_version",
|
|
31493
|
+
/**
|
|
31494
|
+
* Notice fields (#2768): a deliver frame from the reserved sender may carry
|
|
31495
|
+
* `meta` (kind, ids, user id, `until`) as data beside its text. The hub sends
|
|
31496
|
+
* it only to a socket whose hello listed this cap and lists it in
|
|
31497
|
+
* `hello_ok.caps`: Deliver is a strict object, so an older daemon would refuse
|
|
31498
|
+
* the whole frame. A daemon without it gets the text alone.
|
|
31499
|
+
*/
|
|
31500
|
+
noticeMeta: "notice_meta"
|
|
31493
31501
|
};
|
|
31494
31502
|
MAX_CAPS = 16;
|
|
31495
31503
|
CapTokenSchema = external_exports.string().regex(/^[a-z][a-z0-9_-]{0,31}$/);
|
|
@@ -32249,7 +32257,7 @@ function decode3(raw, schema, caps) {
|
|
|
32249
32257
|
function decodeServerFrame(raw) {
|
|
32250
32258
|
return decode3(raw, ServerFrameSchema, SERVER_CAPS);
|
|
32251
32259
|
}
|
|
32252
|
-
var PING, PONG, isWellFormed, WellFormedText, FrameIdSchema, base, BodySchema, InlineBodySchema, distinct, Hello, AgentUp, AgentDown, Sessions, Send, Ack, Refuse, List, Fetch, Status, Rename, FollowRefSchema, Follow, Unfollow, Following, LINK_PROOF_HEADER, LinkProofSchema, LinkProofHashSchema, LinkBind, LinkBound, MAX_WAITING_QUERY, WaitingQuery, WaitingCounts, Acked, MAX_FOLLOWS, FollowEntry, Followed, Unfollowed, Follows, RunVersionSchema, UPDATE_REASONS, UPDATE_EVENTS, ReportVersion, UpdateReport, RunVersionPush, InstallNow, UpdateAck, HelloOk, AgentOk, Renamed, ReceiptFrame, RosterAgent, Roster, BodyFrame, AGENT_CAP_MESSAGES, ErrorFrame, Notice, Deliver, ReceiptUpdate, RosterChanged, ClientFrameSchema, ServerFrameSchema, FrameSchema, MAX_RAW_FRAME_CHARS, SERVER_CAPS, MAX_OBJECT_TOKENS, ID_PREFIX_RE;
|
|
32260
|
+
var PING, PONG, isWellFormed, WellFormedText, FrameIdSchema, base, BodySchema, InlineBodySchema, distinct, Hello, AgentUp, AgentDown, Sessions, Send, Ack, Refuse, List, Fetch, Status, Rename, FollowRefSchema, Follow, Unfollow, Following, LINK_PROOF_HEADER, LinkProofSchema, LinkProofHashSchema, LinkBind, LinkBound, MAX_WAITING_QUERY, WaitingQuery, WaitingCounts, Acked, MAX_FOLLOWS, FollowEntry, Followed, Unfollowed, Follows, RunVersionSchema, UPDATE_REASONS, UPDATE_EVENTS, ReportVersion, UpdateReport, RunVersionPush, InstallNow, UpdateAck, HelloOk, AgentOk, Renamed, ReceiptFrame, RosterAgent, Roster, BodyFrame, AGENT_CAP_MESSAGES, ErrorFrame, NOTICE_META_ID_RE, Notice, NoticeMetaSchema, Deliver, ReceiptUpdate, RosterChanged, ClientFrameSchema, ServerFrameSchema, FrameSchema, MAX_RAW_FRAME_CHARS, SERVER_CAPS, MAX_OBJECT_TOKENS, ID_PREFIX_RE;
|
|
32253
32261
|
var init_protocol2 = __esm({
|
|
32254
32262
|
"../bus-protocol/src/protocol.ts"() {
|
|
32255
32263
|
"use strict";
|
|
@@ -32626,10 +32634,20 @@ var init_protocol2 = __esm({
|
|
|
32626
32634
|
]),
|
|
32627
32635
|
message: WellFormedText.pipe(external_exports.string().max(1024))
|
|
32628
32636
|
});
|
|
32637
|
+
NOTICE_META_ID_RE = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
32629
32638
|
Notice = external_exports.strictObject({
|
|
32630
32639
|
size: external_exports.number().int().gt(LIMITS.inlineBodyBytes).max(LIMITS.maxMessageBytes),
|
|
32631
32640
|
msg_id: MsgIdSchema
|
|
32632
32641
|
});
|
|
32642
|
+
NoticeMetaSchema = external_exports.strictObject({
|
|
32643
|
+
kind: external_exports.string().regex(/^[a-z_]{1,32}$/),
|
|
32644
|
+
artifact_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
32645
|
+
comment_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
32646
|
+
thread_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
32647
|
+
user_id: external_exports.string().regex(NOTICE_META_ID_RE).optional(),
|
|
32648
|
+
/** ISO 8601 date-time, UTC (`2026-11-18T09:00:00.000Z`). */
|
|
32649
|
+
until: external_exports.string().max(40).regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,6})?)?Z$/).refine((v) => !Number.isNaN(Date.parse(v)), "invalid date").optional()
|
|
32650
|
+
});
|
|
32633
32651
|
Deliver = external_exports.strictObject({
|
|
32634
32652
|
...base,
|
|
32635
32653
|
type: external_exports.literal("deliver"),
|
|
@@ -32646,8 +32664,13 @@ var init_protocol2 = __esm({
|
|
|
32646
32664
|
/** The SENDER's namespace, so a reply can set `to_namespace` from it. */
|
|
32647
32665
|
namespace: WireNamespaceSchema,
|
|
32648
32666
|
body: InlineBodySchema.optional(),
|
|
32649
|
-
notice: Notice.optional()
|
|
32667
|
+
notice: Notice.optional(),
|
|
32668
|
+
/** Only from the reserved sender, only with BUS_CAPS.noticeMeta (#2768). */
|
|
32669
|
+
meta: NoticeMetaSchema.optional()
|
|
32650
32670
|
}).refine(
|
|
32671
|
+
(f) => f.meta === void 0 || f.from_name === INSTANCE_SENDER_NAME,
|
|
32672
|
+
"meta only from the instance"
|
|
32673
|
+
).refine(
|
|
32651
32674
|
(f) => f.body === void 0 !== (f.notice === void 0),
|
|
32652
32675
|
"body xor notice"
|
|
32653
32676
|
).refine(
|
|
@@ -32810,7 +32833,7 @@ var init_frames = __esm({
|
|
|
32810
32833
|
late = { late: external_exports.array(external_exports.string().min(1)).optional() };
|
|
32811
32834
|
isWellFormed2 = (s) => s.isWellFormed();
|
|
32812
32835
|
WELL_FORMED = { message: "text is not well-formed unicode" };
|
|
32813
|
-
CLIENT_VERSION = true ? "0.
|
|
32836
|
+
CLIENT_VERSION = true ? "0.209.0" : "0.0.0";
|
|
32814
32837
|
clientVersion = {
|
|
32815
32838
|
client_version: external_exports.string().min(1).max(64).optional()
|
|
32816
32839
|
};
|
|
@@ -33144,7 +33167,9 @@ var init_frames = __esm({
|
|
|
33144
33167
|
from_name: external_exports.string(),
|
|
33145
33168
|
namespace: external_exports.string(),
|
|
33146
33169
|
body: external_exports.string().optional(),
|
|
33147
|
-
notice: external_exports.object({ size: external_exports.number(), msg_id: external_exports.string() }).optional()
|
|
33170
|
+
notice: external_exports.object({ size: external_exports.number(), msg_id: external_exports.string() }).optional(),
|
|
33171
|
+
/** #2768: a server notice's structured fields, as data beside the body. */
|
|
33172
|
+
meta: external_exports.object(NoticeMetaSchema.shape).optional()
|
|
33148
33173
|
}).refine((d) => d.body === void 0 !== (d.notice === void 0), {
|
|
33149
33174
|
message: "deliver needs exactly one of body or notice"
|
|
33150
33175
|
});
|
|
@@ -47646,7 +47671,8 @@ function createDeliver(ctx) {
|
|
|
47646
47671
|
...frame.from_id === void 0 ? {} : { from_id: frame.from_id },
|
|
47647
47672
|
namespace: frame.namespace,
|
|
47648
47673
|
body,
|
|
47649
|
-
...frame.body === void 0 ? { notice: { size: frame.notice?.size ?? 0, msg_id } } : {}
|
|
47674
|
+
...frame.body === void 0 ? { notice: { size: frame.notice?.size ?? 0, msg_id } } : {},
|
|
47675
|
+
...frame.meta === void 0 ? {} : { meta: frame.meta }
|
|
47650
47676
|
}).catch((e) => {
|
|
47651
47677
|
ctx.log?.(
|
|
47652
47678
|
`transport threw: ${e instanceof Error ? e.message : String(e)}`
|
|
@@ -47902,7 +47928,8 @@ var HUB_HELLO_CAPS = [
|
|
|
47902
47928
|
BUS_CAPS.waitingQuery,
|
|
47903
47929
|
BUS_CAPS.noticeAck,
|
|
47904
47930
|
BUS_CAPS.ackConfirm,
|
|
47905
|
-
BUS_CAPS.runVersion
|
|
47931
|
+
BUS_CAPS.runVersion,
|
|
47932
|
+
BUS_CAPS.noticeMeta
|
|
47906
47933
|
];
|
|
47907
47934
|
var HubConnection = class {
|
|
47908
47935
|
constructor(opts) {
|
|
@@ -50414,7 +50441,8 @@ var PiTransport = class {
|
|
|
50414
50441
|
msg_id: mail.msg_id,
|
|
50415
50442
|
from_name: mail.from_name,
|
|
50416
50443
|
namespace: mail.namespace,
|
|
50417
|
-
...mail.notice ? { notice: mail.notice } : { body: mail.body }
|
|
50444
|
+
...mail.notice ? { notice: mail.notice } : { body: mail.body },
|
|
50445
|
+
...mail.meta ? { meta: mail.meta } : {}
|
|
50418
50446
|
});
|
|
50419
50447
|
if (!pushed) return { ok: false, reason: "closed" };
|
|
50420
50448
|
this.#forget(mail.msg_id);
|
|
@@ -57825,7 +57853,7 @@ var noService = {
|
|
|
57825
57853
|
remove: async () => ({}),
|
|
57826
57854
|
cli: () => ["oa-bus"]
|
|
57827
57855
|
};
|
|
57828
|
-
var VERSION = true ? "0.
|
|
57856
|
+
var VERSION = true ? "0.209.0" : JSON.parse(
|
|
57829
57857
|
readFileSync21(new URL("../package.json", import.meta.url), "utf8")
|
|
57830
57858
|
).version;
|
|
57831
57859
|
var which = (cmd) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-artifacts/bus",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.209.0",
|
|
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": "
|
|
32
|
+
"commit": "9df01e5164c884a49a0cfc6e9ac53e4c085d6a18"
|
|
33
33
|
}
|
|
34
34
|
}
|