@xmoxmo/bncr 0.6.3 → 0.6.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
|
@@ -405,11 +405,6 @@ export function buildBncrConversationContextFromEntries(args: {
|
|
|
405
405
|
return `[Chat messages since your last reply - for context]\n${historyText}\n\n[Current message - respond to this]${args.currentMessage}`;
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
export function collectBncrHistoryMediaFromEntries(args: {
|
|
409
|
-
entries: readonly BncrHistoryEntry[];
|
|
410
|
-
}): HistoryMediaEntry[] {
|
|
411
|
-
return args.entries.flatMap((entry) => (Array.isArray(entry.media) ? entry.media : []));
|
|
412
|
-
}
|
|
413
408
|
export function clearBncrPendingConversationHistory(args: {
|
|
414
409
|
historyMap: BncrConversationHistoryMap;
|
|
415
410
|
parsed: ParsedInbound;
|
|
@@ -9,11 +9,7 @@ import {
|
|
|
9
9
|
buildBncrStructuredContextFactsFromInboundParts,
|
|
10
10
|
} from './context-facts.ts';
|
|
11
11
|
import type { BncrInboundApi, BncrInboundConfig, BncrInboundContextPayload } from './contracts.ts';
|
|
12
|
-
import {
|
|
13
|
-
type BncrConversationHistoryMap,
|
|
14
|
-
type BncrHistoryEntry,
|
|
15
|
-
collectBncrHistoryMediaFromEntries,
|
|
16
|
-
} from './conversation-history.ts';
|
|
12
|
+
import type { BncrConversationHistoryMap, BncrHistoryEntry } from './conversation-history.ts';
|
|
17
13
|
import type {
|
|
18
14
|
BncrInboundConversationResolution,
|
|
19
15
|
BncrPreparedInboundSessionContext,
|
|
@@ -193,9 +189,6 @@ export function buildBncrInboundTurnContext(args: {
|
|
|
193
189
|
const senderIsOwner = parsed.isAdmin === true || Boolean(ownerAllowFrom?.length);
|
|
194
190
|
const senderIsAuthorized = senderIsOwner;
|
|
195
191
|
const inboundHistory = undefined;
|
|
196
|
-
const contextMedia = shouldDispatch
|
|
197
|
-
? collectBncrHistoryMediaFromEntries({ entries: contextEntries })
|
|
198
|
-
: [];
|
|
199
192
|
const structuredContextEntries = shouldDispatch
|
|
200
193
|
? contextEntries.map((entry) => ({
|
|
201
194
|
messageId: entry.messageId,
|
|
@@ -271,7 +264,7 @@ export function buildBncrInboundTurnContext(args: {
|
|
|
271
264
|
kind: item.kind,
|
|
272
265
|
messageId: msgId ?? undefined,
|
|
273
266
|
}));
|
|
274
|
-
const media = dedupeBncrTurnMedia(
|
|
267
|
+
const media = dedupeBncrTurnMedia(currentTurnMedia);
|
|
275
268
|
|
|
276
269
|
return Promise.resolve(
|
|
277
270
|
resolveBncrChannelInboundRuntime(api).buildContext({
|