@xmoxmo/bncr 0.4.2 → 0.4.3
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/package.json +1 -1
- package/src/channel.ts +3 -0
- package/src/core/outbox-entry-builders.ts +2 -0
- package/src/messaging/outbound/media.ts +2 -0
- package/src/messaging/outbound/reply-enqueue-media.ts +3 -0
- package/src/messaging/outbound/reply-enqueue.ts +4 -0
- package/src/messaging/outbound/send-params.ts +4 -0
- package/src/messaging/outbound/send.ts +3 -0
- package/src/plugin/channel-plugin-surface-group.ts +1 -0
- package/src/plugin/channel-runtime-builders-delivery.ts +1 -0
- package/src/plugin/media-orchestrators-runtime-group.ts +2 -0
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -1164,6 +1164,7 @@ class BncrBridgeRuntime {
|
|
|
1164
1164
|
asVoice?: boolean;
|
|
1165
1165
|
audioAsVoice?: boolean;
|
|
1166
1166
|
type?: string;
|
|
1167
|
+
extra?: Record<string, unknown>;
|
|
1167
1168
|
kind?: 'tool' | 'block' | 'final';
|
|
1168
1169
|
replyToId?: string;
|
|
1169
1170
|
replyTargetPolicy?: OutboundReplyTargetPolicy;
|
|
@@ -1182,6 +1183,7 @@ class BncrBridgeRuntime {
|
|
|
1182
1183
|
asVoice: params.asVoice,
|
|
1183
1184
|
audioAsVoice: params.audioAsVoice,
|
|
1184
1185
|
type: params.type,
|
|
1186
|
+
extra: params.extra,
|
|
1185
1187
|
kind: params.kind,
|
|
1186
1188
|
replyToId: asString(params.replyToId || '').trim() || undefined,
|
|
1187
1189
|
replyTargetPolicy: params.replyTargetPolicy,
|
|
@@ -1245,6 +1247,7 @@ class BncrBridgeRuntime {
|
|
|
1245
1247
|
mimeType: params.media.mimeType,
|
|
1246
1248
|
}),
|
|
1247
1249
|
hintedType: wantsVoice ? 'voice' : asString(params.meta.type || '') || undefined,
|
|
1250
|
+
extra: params.meta.extra as Record<string, unknown> | undefined,
|
|
1248
1251
|
kind: messageKind,
|
|
1249
1252
|
replyToId: normalizeReplyToId(params.meta.replyToId) || undefined,
|
|
1250
1253
|
now: now(),
|
|
@@ -16,6 +16,7 @@ export function buildFileTransferOutboxEntry(args: {
|
|
|
16
16
|
asVoice?: boolean;
|
|
17
17
|
audioAsVoice?: boolean;
|
|
18
18
|
type?: string;
|
|
19
|
+
extra?: Record<string, unknown>;
|
|
19
20
|
kind?: 'tool' | 'block' | 'final';
|
|
20
21
|
replyToId?: string;
|
|
21
22
|
replyTargetPolicy?: OutboundReplyTargetPolicy;
|
|
@@ -38,6 +39,7 @@ export function buildFileTransferOutboxEntry(args: {
|
|
|
38
39
|
asVoice: args.asVoice === true,
|
|
39
40
|
audioAsVoice: args.audioAsVoice === true,
|
|
40
41
|
type: args.type,
|
|
42
|
+
...(args.extra ? { extra: { ...args.extra } } : {}),
|
|
41
43
|
finalEvent: args.pushEvent,
|
|
42
44
|
replyToId:
|
|
43
45
|
normalizeOutboundReplyToId({
|
|
@@ -68,6 +68,7 @@ export function buildBncrMediaOutboundFrame(params: {
|
|
|
68
68
|
mediaMsg: string;
|
|
69
69
|
fileName: string;
|
|
70
70
|
hintedType?: string;
|
|
71
|
+
extra?: Record<string, unknown>;
|
|
71
72
|
kind?: 'tool' | 'block' | 'final';
|
|
72
73
|
replyToId?: string;
|
|
73
74
|
now: number;
|
|
@@ -96,6 +97,7 @@ export function buildBncrMediaOutboundFrame(params: {
|
|
|
96
97
|
base64: params.media.mediaBase64 || '',
|
|
97
98
|
fileName: params.fileName,
|
|
98
99
|
transferMode: params.media.mode,
|
|
100
|
+
...(params.extra ? { extra: { ...params.extra } } : {}),
|
|
99
101
|
},
|
|
100
102
|
ts: params.now,
|
|
101
103
|
};
|
|
@@ -62,6 +62,7 @@ export function enqueueReplyMediaFileTransferEntry(
|
|
|
62
62
|
asVoice: boolean;
|
|
63
63
|
audioAsVoice: boolean;
|
|
64
64
|
type?: string;
|
|
65
|
+
extra?: Record<string, unknown>;
|
|
65
66
|
kind?: 'tool' | 'block' | 'final';
|
|
66
67
|
replyToId?: string;
|
|
67
68
|
replyTargetPolicy?: OutboundReplyTargetPolicy;
|
|
@@ -86,6 +87,7 @@ export function enqueueReplyMediaFileTransferEntry(
|
|
|
86
87
|
asVoice: params.asVoice,
|
|
87
88
|
audioAsVoice: params.audioAsVoice,
|
|
88
89
|
type: params.type,
|
|
90
|
+
extra: params.extra,
|
|
89
91
|
kind: params.kind,
|
|
90
92
|
replyToId: params.replyToId || undefined,
|
|
91
93
|
replyTargetPolicy: params.replyTargetPolicy,
|
|
@@ -132,6 +134,7 @@ export function enqueueSingleReplyMediaEntry(
|
|
|
132
134
|
asVoice: params.params.payload.asVoice,
|
|
133
135
|
audioAsVoice: params.params.payload.audioAsVoice,
|
|
134
136
|
type: params.params.payload.type,
|
|
137
|
+
extra: params.params.payload.extra,
|
|
135
138
|
kind: params.params.payload.kind,
|
|
136
139
|
replyToId: params.params.payload.replyToId,
|
|
137
140
|
replyTargetPolicy: params.params.payload.replyTargetPolicy,
|
|
@@ -19,6 +19,7 @@ export type ReplyPayloadInput = {
|
|
|
19
19
|
asVoice?: boolean;
|
|
20
20
|
audioAsVoice?: boolean;
|
|
21
21
|
type?: string;
|
|
22
|
+
extra?: Record<string, unknown>;
|
|
22
23
|
kind?: 'tool' | 'block' | 'final';
|
|
23
24
|
replyToId?: string;
|
|
24
25
|
};
|
|
@@ -31,6 +32,7 @@ export type NormalizedReplyPayload = {
|
|
|
31
32
|
asVoice: boolean;
|
|
32
33
|
audioAsVoice: boolean;
|
|
33
34
|
type?: string;
|
|
35
|
+
extra?: Record<string, unknown>;
|
|
34
36
|
kind?: 'tool' | 'block' | 'final';
|
|
35
37
|
replyToId: string;
|
|
36
38
|
replyTargetPolicy: OutboundReplyTargetPolicy;
|
|
@@ -64,6 +66,7 @@ export type ReplyMediaFileTransferParams = {
|
|
|
64
66
|
asVoice: boolean;
|
|
65
67
|
audioAsVoice: boolean;
|
|
66
68
|
type?: string;
|
|
69
|
+
extra?: Record<string, unknown>;
|
|
67
70
|
kind?: 'tool' | 'block' | 'final';
|
|
68
71
|
replyToId: string;
|
|
69
72
|
replyTargetPolicy: OutboundReplyTargetPolicy;
|
|
@@ -268,6 +271,7 @@ export function normalizeReplyPayload(
|
|
|
268
271
|
asVoice: payload?.asVoice === true,
|
|
269
272
|
audioAsVoice: payload?.audioAsVoice === true,
|
|
270
273
|
...(type ? { type } : {}),
|
|
274
|
+
...(payload?.extra ? { extra: { ...payload.extra } } : {}),
|
|
271
275
|
kind: payload?.kind,
|
|
272
276
|
replyTargetPolicy: options?.replyTargetPolicy ?? 'agent-default',
|
|
273
277
|
replyToId: normalizeOutboundReplyToId({
|
|
@@ -11,6 +11,7 @@ export type NormalizedBncrSendParams = {
|
|
|
11
11
|
asVoice: boolean;
|
|
12
12
|
audioAsVoice: boolean;
|
|
13
13
|
type?: string;
|
|
14
|
+
extra?: Record<string, unknown>;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
@@ -51,6 +52,8 @@ export function normalizeBncrSendParams(input: {
|
|
|
51
52
|
const asVoice = readOpenClawBooleanParam(paramsObj, 'asVoice') ?? false;
|
|
52
53
|
const audioAsVoice = readOpenClawBooleanParam(paramsObj, 'audioAsVoice') ?? false;
|
|
53
54
|
const type = readOpenClawStringParam(paramsObj, 'type') || undefined;
|
|
55
|
+
const rawExtra = paramsObj.extra;
|
|
56
|
+
const extra = isPlainObject(rawExtra) ? { ...rawExtra } : undefined;
|
|
54
57
|
|
|
55
58
|
const hasMedia = Boolean(mediaUrl || dedupedMediaUrls?.length);
|
|
56
59
|
|
|
@@ -73,5 +76,6 @@ export function normalizeBncrSendParams(input: {
|
|
|
73
76
|
asVoice,
|
|
74
77
|
audioAsVoice,
|
|
75
78
|
...(type ? { type } : {}),
|
|
79
|
+
...(extra ? { extra } : {}),
|
|
76
80
|
};
|
|
77
81
|
}
|
|
@@ -64,6 +64,7 @@ export async function sendBncrMedia(params: {
|
|
|
64
64
|
asVoice?: boolean;
|
|
65
65
|
audioAsVoice?: boolean;
|
|
66
66
|
type?: string;
|
|
67
|
+
extra?: Record<string, unknown>;
|
|
67
68
|
kind?: string;
|
|
68
69
|
replyToId?: string;
|
|
69
70
|
mediaLocalRoots?: readonly string[];
|
|
@@ -83,6 +84,7 @@ export async function sendBncrMedia(params: {
|
|
|
83
84
|
asVoice?: boolean;
|
|
84
85
|
audioAsVoice?: boolean;
|
|
85
86
|
type?: string;
|
|
87
|
+
extra?: Record<string, unknown>;
|
|
86
88
|
kind?: 'tool' | 'block' | 'final';
|
|
87
89
|
replyToId?: string;
|
|
88
90
|
};
|
|
@@ -104,6 +106,7 @@ export async function sendBncrMedia(params: {
|
|
|
104
106
|
asVoice: params.asVoice === true ? true : undefined,
|
|
105
107
|
audioAsVoice: params.audioAsVoice === true ? true : undefined,
|
|
106
108
|
type: params.type,
|
|
109
|
+
extra: params.extra,
|
|
107
110
|
kind: normalizeReplyKind(params.kind),
|
|
108
111
|
replyToId: params.replyToId,
|
|
109
112
|
},
|
|
@@ -152,6 +152,7 @@ export function createBncrChannelPluginSurfaceGroup(runtime: {
|
|
|
152
152
|
asVoice: normalized.asVoice,
|
|
153
153
|
audioAsVoice: normalized.audioAsVoice,
|
|
154
154
|
type: normalized.type,
|
|
155
|
+
extra: normalized.extra,
|
|
155
156
|
mediaLocalRoots,
|
|
156
157
|
resolveVerifiedTarget: (to, accountId) =>
|
|
157
158
|
toolActionBridge.resolveVerifiedTarget(to, accountId),
|
|
@@ -337,6 +337,7 @@ export function buildBncrMediaOrchestratorsRuntime(deps: {
|
|
|
337
337
|
asVoice: boolean;
|
|
338
338
|
audioAsVoice: boolean;
|
|
339
339
|
type?: string;
|
|
340
|
+
extra?: Record<string, unknown>;
|
|
340
341
|
kind?: 'tool' | 'block' | 'final';
|
|
341
342
|
replyToId?: string;
|
|
342
343
|
replyTargetPolicy?: OutboundReplyTargetPolicy;
|
|
@@ -49,6 +49,7 @@ function buildReplyMediaEntryHelpers(runtime: {
|
|
|
49
49
|
asVoice: boolean;
|
|
50
50
|
audioAsVoice: boolean;
|
|
51
51
|
type?: string;
|
|
52
|
+
extra?: Record<string, unknown>;
|
|
52
53
|
kind?: 'tool' | 'block' | 'final';
|
|
53
54
|
replyToId?: string;
|
|
54
55
|
replyTargetPolicy?: OutboundReplyTargetPolicy;
|
|
@@ -203,6 +204,7 @@ export function createBncrMediaOrchestratorsRuntimeGroup(runtime: {
|
|
|
203
204
|
asVoice: boolean;
|
|
204
205
|
audioAsVoice: boolean;
|
|
205
206
|
type?: string;
|
|
207
|
+
extra?: Record<string, unknown>;
|
|
206
208
|
kind?: 'tool' | 'block' | 'final';
|
|
207
209
|
replyToId?: string;
|
|
208
210
|
replyTargetPolicy?: OutboundReplyTargetPolicy;
|