@flamingo-stack/openframe-frontend-core 0.0.706-snapshot.20261006181108 → 0.0.706
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/dist/chat-protocol/index.cjs +14 -23
- package/dist/chat-protocol/index.js +14 -23
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/chat-protocol/source-metadata.d.ts +2 -11
- package/dist/chat-protocol/source-metadata.d.ts.map +1 -1
- package/dist/{chunk-2YHNQAMU.js → chunk-3EZ4HHAP.js} +2 -2
- package/dist/{chunk-FBY4V3YS.js → chunk-3NCM4ZQB.js} +1 -1
- package/dist/{chunk-F4E3L3KV.cjs → chunk-3PLDQDE6.cjs} +9 -9
- package/dist/{chunk-4RVC6TCE.js → chunk-4CJMQLB5.js} +2 -2
- package/dist/{chunk-YQWTGQG5.js → chunk-4ILM7W2R.js} +1 -1
- package/dist/{chunk-RZNRVXHH.js → chunk-6232S532.js} +1 -1
- package/dist/{chunk-IBQZMRWO.js → chunk-7GEBFJT2.js} +17 -28
- package/dist/{chunk-AGNG62O2.cjs → chunk-7OFPU7WE.cjs} +17 -28
- package/dist/{chunk-O6WNIA6W.cjs → chunk-7SCNMP2B.cjs} +12 -12
- package/dist/{chunk-SGJP2WKD.js → chunk-BHI6GVC4.js} +3 -3
- package/dist/{chunk-56LOCS37.cjs → chunk-DDVBX42E.cjs} +7 -7
- package/dist/{chunk-3FZP73R4.js → chunk-DWPAAWMR.js} +4 -4
- package/dist/{chunk-HTBN3XYF.js → chunk-G6UMNAVI.js} +1 -1
- package/dist/{chunk-7XVBJDH7.cjs → chunk-GWQEYPYM.cjs} +312 -312
- package/dist/{chunk-MY3JYZQY.cjs → chunk-HZ7CBXPL.cjs} +40 -40
- package/dist/{chunk-632NGOIH.js → chunk-IKJA3Y7Z.js} +1 -1
- package/dist/{chunk-JFSLQ2XS.cjs → chunk-K6O43WDL.cjs} +32 -32
- package/dist/{chunk-TB5EDWRC.cjs → chunk-LVSFKENJ.cjs} +2 -2
- package/dist/{chunk-4UMOD5NU.cjs → chunk-M75XEEGT.cjs} +24 -24
- package/dist/{chunk-L3Q7R7CQ.cjs → chunk-MB4PNY7C.cjs} +2 -2
- package/dist/{chunk-Y5VSOYPS.js → chunk-O2RSAA5M.js} +5 -5
- package/dist/{chunk-E2TQZIOJ.js → chunk-PXOQIA5K.js} +2 -2
- package/dist/{chunk-5CMYEGHE.cjs → chunk-RTIPR53L.cjs} +70 -70
- package/dist/{chunk-EUSDLX5W.cjs → chunk-SEKYEWQG.cjs} +20 -20
- package/dist/{chunk-I43ZVJRL.cjs → chunk-STHZBOQI.cjs} +9 -9
- package/dist/{chunk-WXAT5C4C.cjs → chunk-SW5ZV2BN.cjs} +20 -20
- package/dist/{chunk-ECXW3RIH.js → chunk-T5TMCHWM.js} +2 -2
- package/dist/{chunk-LSQPH73L.js → chunk-TE773HEH.js} +4 -4
- package/dist/{chunk-STXYW25T.cjs → chunk-TQ4LB2DS.cjs} +3 -3
- package/dist/{chunk-54L6NMKQ.cjs → chunk-UJ33ZXDT.cjs} +4 -4
- package/dist/{chunk-BETJB7UV.js → chunk-VZICIQW2.js} +4 -4
- package/dist/{chunk-U6BWEKJC.js → chunk-YGJKKDDM.js} +1 -1
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/types/message.types.d.ts +16 -20
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +70 -70
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +36 -36
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +25 -25
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/src/chat-protocol/nats-decoder.ts +8 -10
- package/src/chat-protocol/source-metadata.ts +2 -25
- package/src/components/chat/types/message.types.ts +15 -21
- package/src/components/chat/types/unified-chat-state.types.ts +1 -1
- package/src/components/chat/utils/process-historical-messages.ts +4 -12
|
@@ -20,7 +20,7 @@ import { MESSAGE_TYPE } from '../components/chat/types/message.types';
|
|
|
20
20
|
import type { AskOptionData } from '../components/chat/types/message.types';
|
|
21
21
|
import { ESCALATION_STATE, escalationResolvedStatus } from './events';
|
|
22
22
|
import type { ApprovalToolCall, ChatStreamEvent } from './events';
|
|
23
|
-
import {
|
|
23
|
+
import { sourceMetadataEvent } from './source-metadata';
|
|
24
24
|
import { isRecord } from './wire-narrow';
|
|
25
25
|
|
|
26
26
|
/** Minimal structural view of a NATS chunk (see `ChunkData` in
|
|
@@ -122,15 +122,13 @@ export function decodeNatsChunk(chunk: unknown): ChatStreamEvent | null {
|
|
|
122
122
|
}
|
|
123
123
|
return null;
|
|
124
124
|
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// The envelope `ATTACHMENTS` replaced (see `MESSAGE_TYPE.GUIDE`).
|
|
133
|
-
case MESSAGE_TYPE.GUIDE: {
|
|
125
|
+
// Two chunk names, one payload and one decoder. `SOURCES` is the contract
|
|
126
|
+
// the backend is moving to; `GUIDE` is the v2 envelope it ships in during
|
|
127
|
+
// the rollout (see `MESSAGE_TYPE.GUIDE`). The chunk arrives BEFORE or
|
|
128
|
+
// between the answer's text deltas, so the reducer — not this decoder —
|
|
129
|
+
// owns attaching it to the right turn.
|
|
130
|
+
case MESSAGE_TYPE.GUIDE:
|
|
131
|
+
case MESSAGE_TYPE.SOURCES: {
|
|
134
132
|
const event = sourceMetadataEvent(data.payload);
|
|
135
133
|
return event ? { ...event, ...seq } : null;
|
|
136
134
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Source-metadata payload → `{ sources, refs }`.
|
|
3
3
|
*
|
|
4
|
-
* ONE decoder for two arrival paths: the live `
|
|
5
|
-
* persisted row of the same name in dialog history. That is the whole point
|
|
4
|
+
* ONE decoder for two arrival paths: the live `GUIDE`/`SOURCES` NATS chunk and
|
|
5
|
+
* the persisted row of the same name in dialog history. That is the whole point
|
|
6
6
|
* of putting it here rather than in either consumer — a reloaded thread has to
|
|
7
7
|
* render identically to the live turn, and two parsers is exactly how that stops
|
|
8
8
|
* being true.
|
|
@@ -313,29 +313,6 @@ export function sourceMetadataEvent(payload: unknown): SourcesEvent | null {
|
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
/** `null` fields dropped, at any depth. */
|
|
317
|
-
function withoutNulls(value: unknown): unknown {
|
|
318
|
-
if (Array.isArray(value)) return value.map(withoutNulls);
|
|
319
|
-
if (!isRecord(value)) return value;
|
|
320
|
-
return Object.fromEntries(
|
|
321
|
-
Object.entries(value)
|
|
322
|
-
.filter(([, field]) => field !== null)
|
|
323
|
-
.map(([key, field]) => [key, withoutNulls(field)]),
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Decode one typed `ATTACHMENTS` record — the live chunk or the persisted
|
|
329
|
-
* `AttachmentsData` row, which carry `sources` / `videos` / `cards` directly.
|
|
330
|
-
*
|
|
331
|
-
* GraphQL answers an unset field with `null` where the live chunk omits it, so
|
|
332
|
-
* nulls are read as absent: a reloaded source must not gain a
|
|
333
|
-
* `targetPlatform: null` ("no destination") the live one never carried.
|
|
334
|
-
*/
|
|
335
|
-
export function attachmentsEvent(record: unknown): SourcesEvent | null {
|
|
336
|
-
return sourceMetadataEvent(withoutNulls(record));
|
|
337
|
-
}
|
|
338
|
-
|
|
339
316
|
/** What one assistant answer carries: its citations and its expandable refs. */
|
|
340
317
|
export interface SourceMetadata {
|
|
341
318
|
sources?: ChatSource[];
|
|
@@ -12,13 +12,15 @@ export const MESSAGE_TYPE = {
|
|
|
12
12
|
TEXT: 'TEXT',
|
|
13
13
|
THINKING: 'THINKING',
|
|
14
14
|
ASK: 'ASK',
|
|
15
|
-
/** Per-answer
|
|
15
|
+
/** Per-answer source metadata (documents, videos, entity cards).
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* `GUIDE` is the envelope it
|
|
19
|
-
*
|
|
20
|
-
|
|
17
|
+
* TWO names for ONE payload, on purpose. `SOURCES` is the contract the
|
|
18
|
+
* backend is moving to; `GUIDE` is the envelope it ships in today, reused
|
|
19
|
+
* from Guide Mode v2 so a released frontend keeps working during the v2→v3
|
|
20
|
+
* rollout. Both decode through the same path, so dropping `GUIDE` later is a
|
|
21
|
+
* deletion here and nothing else. */
|
|
21
22
|
GUIDE: 'GUIDE',
|
|
23
|
+
SOURCES: 'SOURCES',
|
|
22
24
|
EXECUTING_TOOL: 'EXECUTING_TOOL',
|
|
23
25
|
EXECUTED_TOOL: 'EXECUTED_TOOL',
|
|
24
26
|
APPROVAL_REQUEST: 'APPROVAL_REQUEST',
|
|
@@ -410,7 +412,7 @@ export interface ThinkingMessageData extends MessageDataBase {
|
|
|
410
412
|
*
|
|
411
413
|
* Lives here, beside `Message`, because BOTH transports produce it now: the SSE
|
|
412
414
|
* adapter reads it off the per-turn metadata frame, and the NATS path decodes it
|
|
413
|
-
* out of
|
|
415
|
+
* out of a `GUIDE`/`SOURCES` chunk. It used to be declared inside
|
|
414
416
|
* `use-sse-chat-adapter`, which made "a Guide answer's citations" structurally a
|
|
415
417
|
* property of one transport — `use-sse-chat-adapter` still re-exports the name
|
|
416
418
|
* so existing imports keep working.
|
|
@@ -449,20 +451,13 @@ export interface ChatSource {
|
|
|
449
451
|
label?: string;
|
|
450
452
|
}
|
|
451
453
|
|
|
452
|
-
/** Persisted
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
* wire data, and the decoder is what turns it
|
|
456
|
-
|
|
457
|
-
type: 'ATTACHMENTS';
|
|
458
|
-
sources?: unknown;
|
|
459
|
-
videos?: unknown;
|
|
460
|
-
cards?: unknown;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/** The envelope `ATTACHMENTS` replaced: the same arrays under `payload`. */
|
|
454
|
+
/** Persisted source-metadata row. `payload` is the SAME object the live chunk
|
|
455
|
+
* carries, so history and realtime share one decoder (`sourceMetadataEvent`)
|
|
456
|
+
* and cannot drift apart. Left as an open record here rather than typed
|
|
457
|
+
* structurally: it is unvalidated wire data, and the decoder is what turns it
|
|
458
|
+
* into `ChatSource[]` / `ChatRef[]`. */
|
|
464
459
|
export interface SourceMetadataMessageData extends MessageDataBase {
|
|
465
|
-
type: 'GUIDE';
|
|
460
|
+
type: 'GUIDE' | 'SOURCES';
|
|
466
461
|
payload?: unknown;
|
|
467
462
|
}
|
|
468
463
|
|
|
@@ -608,7 +603,6 @@ export type MessageData =
|
|
|
608
603
|
| TextMessageData
|
|
609
604
|
| ThinkingMessageData
|
|
610
605
|
| AskMessageData
|
|
611
|
-
| AttachmentsMessageData
|
|
612
606
|
| SourceMetadataMessageData
|
|
613
607
|
| ExecutingToolMessageData
|
|
614
608
|
| ExecutedToolMessageData
|
|
@@ -660,7 +654,7 @@ export interface ProcessedMessage {
|
|
|
660
654
|
* Absent when the source row(s) carried no seq. */
|
|
661
655
|
streamSeq?: number;
|
|
662
656
|
/** Documents this answer cited — see `Message.sources`, the same field.
|
|
663
|
-
* Replayed from the turn's persisted `
|
|
657
|
+
* Replayed from the turn's persisted `GUIDE`/`SOURCES` row, so a reloaded
|
|
664
658
|
* answer carries the citations the live one did. */
|
|
665
659
|
sources?: ChatSource[];
|
|
666
660
|
/** Entity references this answer's metadata described — see `Message.refs`. */
|
|
@@ -239,7 +239,7 @@ export interface UnifiedChatMessage {
|
|
|
239
239
|
/**
|
|
240
240
|
* Documents this answer cited, rendered as chips beneath it. Produced by
|
|
241
241
|
* BOTH transports now — SSE reads them off the per-turn metadata frame, NATS
|
|
242
|
-
* decodes them out of
|
|
242
|
+
* decodes them out of a `GUIDE`/`SOURCES` chunk.
|
|
243
243
|
*/
|
|
244
244
|
sources?: ChatSource[];
|
|
245
245
|
/**
|
|
@@ -34,12 +34,7 @@ import {
|
|
|
34
34
|
// One normalizer for ask rows, shared with the live decoder — history and the
|
|
35
35
|
// stream must agree on which options are usable.
|
|
36
36
|
import { normalizeAskOptions } from '../../../chat-protocol/nats-decoder';
|
|
37
|
-
import {
|
|
38
|
-
attachmentsEvent,
|
|
39
|
-
mergeSourceMetadata,
|
|
40
|
-
sourceMetadataEvent,
|
|
41
|
-
type SourceMetadata,
|
|
42
|
-
} from '../../../chat-protocol/source-metadata';
|
|
37
|
+
import { mergeSourceMetadata, sourceMetadataEvent, type SourceMetadata } from '../../../chat-protocol/source-metadata';
|
|
43
38
|
import { applyApprovalStatusToSegment } from '../stream/message-mutations';
|
|
44
39
|
import {
|
|
45
40
|
MESSAGE_TYPE,
|
|
@@ -127,14 +122,11 @@ export function decodeHistoricalMessageData(data: MessageData): ChatStreamEvent
|
|
|
127
122
|
}
|
|
128
123
|
return null;
|
|
129
124
|
|
|
130
|
-
// Persisted
|
|
131
|
-
// (`
|
|
125
|
+
// Persisted source metadata, through the SAME decoder the live chunk uses
|
|
126
|
+
// (`sourceMetadataEvent`). That shared parse is the whole reason a reloaded
|
|
132
127
|
// answer renders identically to the one the reader watched arrive.
|
|
133
|
-
case MESSAGE_TYPE.ATTACHMENTS:
|
|
134
|
-
return attachmentsEvent(data);
|
|
135
|
-
|
|
136
|
-
// The envelope `ATTACHMENTS` replaced (see `MESSAGE_TYPE.GUIDE`).
|
|
137
128
|
case MESSAGE_TYPE.GUIDE:
|
|
129
|
+
case MESSAGE_TYPE.SOURCES:
|
|
138
130
|
return 'payload' in data ? sourceMetadataEvent(data.payload) : null;
|
|
139
131
|
|
|
140
132
|
// Same completeness gate as the live decoder (`decodeNatsChunk`): a
|