@xmoxmo/bncr 0.5.3 → 0.5.4
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
CHANGED
|
@@ -17,6 +17,7 @@ export type BncrStructuredContextFactsInput = {
|
|
|
17
17
|
reply: {
|
|
18
18
|
to: string;
|
|
19
19
|
originatingTo: string;
|
|
20
|
+
rawTo?: string;
|
|
20
21
|
};
|
|
21
22
|
sender: {
|
|
22
23
|
id: string;
|
|
@@ -125,6 +126,7 @@ export function buildBncrStructuredContextFacts(input: BncrStructuredContextFact
|
|
|
125
126
|
reply: {
|
|
126
127
|
to: input.reply.to,
|
|
127
128
|
originatingTo: input.reply.originatingTo,
|
|
129
|
+
...(input.reply.rawTo ? { rawTo: input.reply.rawTo } : {}),
|
|
128
130
|
},
|
|
129
131
|
sender: {
|
|
130
132
|
id: input.sender.id,
|
|
@@ -200,6 +202,7 @@ export function buildBncrPromptVisibleContextFacts(
|
|
|
200
202
|
reply?: {
|
|
201
203
|
to: string;
|
|
202
204
|
originatingTo: string;
|
|
205
|
+
rawTo?: string;
|
|
203
206
|
};
|
|
204
207
|
media?: Array<{
|
|
205
208
|
path?: string;
|
|
@@ -249,10 +252,11 @@ export function buildBncrPromptVisibleContextFacts(
|
|
|
249
252
|
};
|
|
250
253
|
}
|
|
251
254
|
|
|
252
|
-
if (facts.reply.originatingTo !== facts.reply.to) {
|
|
255
|
+
if (facts.reply.originatingTo !== facts.reply.to || facts.reply.rawTo) {
|
|
253
256
|
result.reply = {
|
|
254
257
|
to: facts.reply.to,
|
|
255
258
|
originatingTo: facts.reply.originatingTo,
|
|
259
|
+
...(facts.reply.rawTo ? { rawTo: facts.reply.rawTo } : {}),
|
|
256
260
|
};
|
|
257
261
|
}
|
|
258
262
|
|
|
@@ -331,6 +335,7 @@ export type BncrStructuredContextFactsFromInboundPartsInput = {
|
|
|
331
335
|
resolution: {
|
|
332
336
|
chatType: string;
|
|
333
337
|
canonicalTo: string;
|
|
338
|
+
rawTo: string;
|
|
334
339
|
originatingTo: string;
|
|
335
340
|
resolvedRoute: {
|
|
336
341
|
agentId?: string;
|
|
@@ -389,6 +394,7 @@ export function buildBncrStructuredContextFactsFromInboundParts(
|
|
|
389
394
|
reply: {
|
|
390
395
|
to: input.resolution.canonicalTo,
|
|
391
396
|
originatingTo: input.resolution.originatingTo,
|
|
397
|
+
rawTo: input.resolution.rawTo,
|
|
392
398
|
},
|
|
393
399
|
sender: {
|
|
394
400
|
id: input.senderIdForContext,
|
|
@@ -48,6 +48,7 @@ export type BncrInboundReplyRouteFact = {
|
|
|
48
48
|
sessionKey: string;
|
|
49
49
|
route: ParsedInbound['route'];
|
|
50
50
|
canonicalTo: string;
|
|
51
|
+
rawTo: string;
|
|
51
52
|
originatingTo: string;
|
|
52
53
|
chatType: 'direct' | 'group';
|
|
53
54
|
};
|
|
@@ -270,7 +271,7 @@ export function resolveBncrInboundConversation(args: {
|
|
|
270
271
|
const dispatchSessionKey = taskSessionKey || baseSessionKey;
|
|
271
272
|
const rawTo = formatRawBncrInboundTarget(route);
|
|
272
273
|
const canonicalTo = formatDisplayScope(route);
|
|
273
|
-
const originatingTo = providedOriginatingTo ||
|
|
274
|
+
const originatingTo = providedOriginatingTo || canonicalTo;
|
|
274
275
|
|
|
275
276
|
return {
|
|
276
277
|
accountId,
|
|
@@ -419,6 +420,7 @@ export function buildBncrInboundReplyRouteFact(
|
|
|
419
420
|
sessionKey: resolution.dispatchSessionKey,
|
|
420
421
|
route: resolution.route,
|
|
421
422
|
canonicalTo: resolution.canonicalTo,
|
|
423
|
+
rawTo: resolution.rawTo,
|
|
422
424
|
originatingTo: resolution.originatingTo,
|
|
423
425
|
chatType: resolution.chatType,
|
|
424
426
|
};
|