@flamingo-stack/openframe-frontend-core 0.0.817 → 0.0.819
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/{chunk-5TSYOIIZ.cjs → chunk-2JFR6XVT.cjs} +32 -32
- package/dist/{chunk-MAHJY2PO.cjs → chunk-2S6BUXYD.cjs} +3 -3
- package/dist/{chunk-ZP4JMX7G.cjs → chunk-2T3HXLZD.cjs} +53 -53
- package/dist/{chunk-P7JQGOX4.cjs → chunk-2W3W3ZV6.cjs} +11 -11
- package/dist/{chunk-7KBHLP4E.cjs → chunk-7IQU54VE.cjs} +16 -16
- package/dist/{chunk-TKEYWSDZ.cjs → chunk-A36XVWIQ.cjs} +39 -39
- package/dist/{chunk-F2LVBRHC.cjs → chunk-CEXPWDT4.cjs} +4 -4
- package/dist/{chunk-IOFIHVVW.cjs → chunk-I453QCEF.cjs} +107 -107
- package/dist/{chunk-6F4YGHGM.cjs → chunk-IVQT5R6M.cjs} +19 -19
- package/dist/{chunk-RDHF3F5R.cjs → chunk-JOXJDNHN.cjs} +3 -3
- package/dist/{chunk-C2OUXL3Q.cjs → chunk-MYIOOA4E.cjs} +2 -2
- package/dist/{chunk-24M2JYM5.cjs → chunk-OTGYA5F7.cjs} +259 -285
- package/dist/{chunk-UFBVOBYR.cjs → chunk-Q6QQSCUC.cjs} +10 -10
- package/dist/{chunk-4ROR52OW.cjs → chunk-S2ZA4TMJ.cjs} +9 -9
- package/dist/{chunk-JMOCM2SW.cjs → chunk-TDQRDQVU.cjs} +4 -4
- package/dist/{chunk-EX7M3VQC.cjs → chunk-U3OICGCV.cjs} +47 -47
- package/dist/{chunk-BL2J5RJK.cjs → chunk-VSKR26MV.cjs} +6 -6
- package/dist/{chunk-DSBRWP5M.cjs → chunk-WPHCVXES.cjs} +7 -7
- package/dist/{cloud-tenants-NMAXIJLL.cjs → cloud-tenants-P5XJ5DPJ.cjs} +4 -4
- package/dist/components/case-studies/index.cjs +16 -16
- package/dist/components/chat/embeddable-chat.d.ts +0 -8
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +10 -67
- package/dist/components/chat/entity-cards/dispatch.d.ts +3 -10
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.js +4 -23
- package/dist/components/chat/index.cjs +3 -3
- package/dist/components/chat/remark-strip-citations.d.ts +1 -1
- package/dist/components/chat/remark-strip-citations.d.ts.map +1 -1
- package/dist/components/chat/remark-strip-citations.js +8 -2
- package/dist/components/chat/types/entities/data-room-doc.d.ts +0 -12
- package/dist/components/chat/types/entities/data-room-doc.d.ts.map +1 -1
- package/dist/components/chat/utils/cited-sources.d.ts.map +1 -1
- package/dist/components/chat/utils/cited-sources.js +36 -0
- package/dist/components/chat/utils/source-row-cta.d.ts +9 -48
- package/dist/components/chat/utils/source-row-cta.d.ts.map +1 -1
- package/dist/components/chat/utils/source-row-cta.js +7 -32
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/docs/index.cjs +8 -8
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/help-center-pages/index.cjs +61 -61
- package/dist/components/index.cjs +37 -37
- package/dist/components/meeting-scheduler/index.cjs +29 -29
- package/dist/components/navigation/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/product-demo/index.cjs +13 -13
- package/dist/components/tickets/index.cjs +9 -9
- package/dist/components/ui/index.cjs +4 -4
- package/dist/contexts/chat-runtime-context.d.ts +3 -14
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/{devices-QBKWVHE6.cjs → devices-BSIWSRZG.cjs} +5 -5
- package/dist/{embeddable-chat-WNPCPMDL.cjs → embeddable-chat-5L2PKTW3.cjs} +107 -127
- package/dist/index.cjs +8 -8
- package/dist/{knowledge-FSAYWM25.cjs → knowledge-2F3IPK73.cjs} +5 -5
- package/dist/{logs-OZX4SYHG.cjs → logs-U3OCJ2OC.cjs} +12 -12
- package/dist/{policies-LPCUCTLX.cjs → policies-L3KHKE2G.cjs} +8 -8
- package/dist/{scripts-ZNFZSONW.cjs → scripts-U4SLB5YC.cjs} +9 -9
- package/dist/{software-update-BRYOVQVY.cjs → software-update-QALYFCIO.cjs} +7 -7
- package/dist/utils/source-grouping.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/chat/embeddable-chat.tsx +10 -74
- package/src/components/chat/entity-cards/data-room-doc-card.tsx +1 -1
- package/src/components/chat/entity-cards/dispatch.tsx +6 -31
- package/src/components/chat/remark-strip-citations.ts +14 -3
- package/src/components/chat/types/entities/data-room-doc.ts +0 -12
- package/src/components/chat/utils/cited-sources.ts +51 -0
- package/src/components/chat/utils/source-row-cta.ts +21 -102
- package/src/contexts/chat-runtime-context.tsx +3 -11
- package/src/utils/source-grouping.ts +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type CardReference, extractCardReferences } from '../../../chat-protocol/card-marker';
|
|
2
|
+
import { canonicalContentRefType } from '../../../utils/list-url';
|
|
1
3
|
import { groupSourcesByTable } from '../../../utils/source-grouping';
|
|
2
4
|
import type { ChatSource } from '../types/message.types';
|
|
3
5
|
|
|
@@ -53,6 +55,14 @@ function withoutCode(content: string): string {
|
|
|
53
55
|
export function splitCitedSources(sources: ChatSource[] | undefined, content: string): CitedSources {
|
|
54
56
|
if (!sources || sources.length === 0) return { cited: [], uncited: [] };
|
|
55
57
|
|
|
58
|
+
// An answer with cards cites what its cards show. The reader sees the cards and not the `[N]` numbers (the
|
|
59
|
+
// renderer hides those beside cards, `remarkStripCitations`), and the numbers a model writes can name another
|
|
60
|
+
// record than the card beside them: guide cards cited as `[1]`, a docs page (CU-17tkuw61kfy). So the strip is
|
|
61
|
+
// built from the cards, and its count is the cards'.
|
|
62
|
+
// An answer whose cards show no retrieved record (a card from an earlier turn) falls back to its numbers.
|
|
63
|
+
const byCards = splitByCards(sources, extractCardReferences(withoutCode(content)));
|
|
64
|
+
if (byCards.cited.length > 0) return byCards;
|
|
65
|
+
|
|
56
66
|
const firstMentionAt = new Map<number, number>();
|
|
57
67
|
for (const match of withoutCode(content).matchAll(CITATION)) {
|
|
58
68
|
const index = Number.parseInt(match[1], 10);
|
|
@@ -65,3 +75,44 @@ export function splitCitedSources(sources: ChatSource[] | undefined, content: st
|
|
|
65
75
|
const uncited = sources.filter(source => !firstMentionAt.has(source.index));
|
|
66
76
|
return { cited: groupSourcesByTable(cited), uncited: groupSourcesByTable(uncited) };
|
|
67
77
|
}
|
|
78
|
+
|
|
79
|
+
/** One record of a source, as a flat source: a flat source itself, or one row of a grouped source (keeping its own
|
|
80
|
+
* citation number when it has one, else the group's). */
|
|
81
|
+
function recordsOf(source: ChatSource): ChatSource[] {
|
|
82
|
+
if (!source.items || source.items.length === 0) return [source];
|
|
83
|
+
return source.items.map(item => ({
|
|
84
|
+
index: item.index ?? source.index,
|
|
85
|
+
id: item.id,
|
|
86
|
+
name: item.name,
|
|
87
|
+
path: item.path ?? '',
|
|
88
|
+
documentType: item.documentType,
|
|
89
|
+
...(item.externalUrl ? { externalUrl: item.externalUrl } : {}),
|
|
90
|
+
targetPlatform: item.targetPlatform ?? null,
|
|
91
|
+
...(source.sourceRepo ? { sourceRepo: source.sourceRepo } : {}),
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The card key of a record, in the canonical vocabulary the card markers use. A document is keyed by its id, or
|
|
96
|
+
* by its path when it carries no id (doc rows are keyed by path). */
|
|
97
|
+
function recordKey(record: ChatSource): string | null {
|
|
98
|
+
const id = record.id || record.path;
|
|
99
|
+
return record.documentType && id ? `${canonicalContentRefType(record.documentType)}:${id}` : null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Cited = the records the answer's cards show, in card order; uncited = every other record. Both halves are then
|
|
103
|
+
* grouped by table, so a table's chip counts exactly its carded records. */
|
|
104
|
+
function splitByCards(sources: ChatSource[], cards: CardReference[]): CitedSources {
|
|
105
|
+
const records = sources.flatMap(recordsOf);
|
|
106
|
+
const byKey = new Map<string, ChatSource>();
|
|
107
|
+
for (const record of records) {
|
|
108
|
+
const key = recordKey(record);
|
|
109
|
+
if (key && !byKey.has(key)) byKey.set(key, record);
|
|
110
|
+
}
|
|
111
|
+
const cited: ChatSource[] = [];
|
|
112
|
+
for (const card of cards) {
|
|
113
|
+
const record = byKey.get(`${canonicalContentRefType(card.type)}:${card.id}`);
|
|
114
|
+
if (record && !cited.includes(record)) cited.push(record);
|
|
115
|
+
}
|
|
116
|
+
const uncited = records.filter(record => !cited.includes(record));
|
|
117
|
+
return { cited: groupSourcesByTable(cited), uncited: groupSourcesByTable(uncited) };
|
|
118
|
+
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* the chat-adjacent surfaces (source chips, inline cards, search results).
|
|
4
4
|
*
|
|
5
5
|
* Lib-side refactor of the hub's `lib/utils/source-row-cta.ts`. Drops:
|
|
6
|
-
* - `currentPlatform()` — host injects via `ctx.currentPlatform`
|
|
7
6
|
* - `traceCompose()` logging — lib stays log-free; hosts can wrap
|
|
8
7
|
* - `tableIdForDocumentType` — host injects via `ctx.tableIdForDocumentType`
|
|
9
8
|
*
|
|
@@ -11,11 +10,9 @@
|
|
|
11
10
|
* - `icon` + `iconLabel` — for visual + a11y. Sourced from
|
|
12
11
|
* `SOURCE_ICON_NAMES` keyed by the row's `sourceRepo` (config id),
|
|
13
12
|
* resolved to a React component via `ICON_REGISTRY`.
|
|
14
|
-
* - `href` — destination URL. `null` means "no
|
|
15
|
-
* the only action".
|
|
16
|
-
*
|
|
17
|
-
* also runs `safeHref()` on the final value so a hostile RAG row
|
|
18
|
-
* can't land `javascript:` / `data:` in the DOM.
|
|
13
|
+
* - `href` — destination URL, from the host's composer (`composeContentUrl`). `null` means "no viewer; Ask is
|
|
14
|
+
* the only action". Runs `safeHref()` on the final value so a hostile RAG row can't land `javascript:` /
|
|
15
|
+
* `data:` in the DOM.
|
|
19
16
|
* - `askable` — whether the Ask drill-in flow can fire. Requires a
|
|
20
17
|
* non-empty `id` AND a `documentType`.
|
|
21
18
|
* - `chatRef` — pre-synthesized `ChatRef` for the Ask handler.
|
|
@@ -23,7 +20,6 @@
|
|
|
23
20
|
|
|
24
21
|
import { FileText } from 'lucide-react';
|
|
25
22
|
import type React from 'react';
|
|
26
|
-
import { getPlatformUrl } from '../../../platform-domains';
|
|
27
23
|
import type { ComposeContentUrl } from '../../../utils/content-href';
|
|
28
24
|
import { canonicalContentRefType } from '../../../utils/list-url';
|
|
29
25
|
import { DOC_TABLE_TYPES } from '../../../utils/source-grouping';
|
|
@@ -60,18 +56,6 @@ export interface SourceRowInput {
|
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
export interface SourceRowContext {
|
|
63
|
-
/** Chat shell's base route — `/data-room`, `/knowledge-base`, etc. */
|
|
64
|
-
baseRoute?: string;
|
|
65
|
-
/** Cross-platform target for the chip / card click. */
|
|
66
|
-
chipBasePlatform?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Host-supplied current-platform identifier. Used as the
|
|
69
|
-
* `targetPlatform` for path-based fallback URLs that point to the
|
|
70
|
-
* host's own surface. When omitted, path-based fallback rows get a
|
|
71
|
-
* `null` targetPlatform — consumers fall back to their legacy
|
|
72
|
-
* origin-check.
|
|
73
|
-
*/
|
|
74
|
-
currentPlatform?: string | null;
|
|
75
59
|
/**
|
|
76
60
|
* Host-supplied reverse map: documentType → tableId. Used to derive
|
|
77
61
|
* `sourceRepo` from `documentType` when the caller didn't supply it
|
|
@@ -81,25 +65,12 @@ export interface SourceRowContext {
|
|
|
81
65
|
*/
|
|
82
66
|
tableIdForDocumentType?: (documentType: string) => string | null;
|
|
83
67
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* types, the hub URL otherwise). When omitted, the row's `externalUrl` is used
|
|
89
|
-
* verbatim (legacy).
|
|
68
|
+
* The host's ONE address rule (`runtime.composeContentUrl`). Every row resolves its href through it: a record by
|
|
69
|
+
* its `externalUrl`, a doc by its tree `path` (passed as the `slug`). The host decides where each type lives and
|
|
70
|
+
* whether that is this site or another platform; the lib builds no address of its own. With no composer, a
|
|
71
|
+
* record's `externalUrl` is used as given and a doc has no link.
|
|
90
72
|
*/
|
|
91
73
|
composeContentUrl?: ComposeContentUrl;
|
|
92
|
-
/**
|
|
93
|
-
* Host-supplied per-`documentType` doc-viewer targets — the UNIFIED, DYNAMIC
|
|
94
|
-
* replacement for the single `chipBasePlatform`. Maps a doc-table documentType
|
|
95
|
-
* (`'markdown'`, `'data_room_doc'`, …) → the platform whose PUBLIC doc viewer
|
|
96
|
-
* hosts it + that viewer's base path. A doc chip with no `externalUrl` resolves
|
|
97
|
-
* to `getPlatformUrl(platform)/<basePath>/<path>` PER ROW — so a chat mixing several
|
|
98
|
-
* doc sources sends EACH to its own home (markdown→flamingo/knowledge-base,
|
|
99
|
-
* data_room_doc→company-hub/data-room) instead of one static fallback for all.
|
|
100
|
-
* Wins over `chipBasePlatform` when a row's documentType has an entry.
|
|
101
|
-
*/
|
|
102
|
-
docPlatformTargets?: Record<string, { platform: string; basePath: string }>;
|
|
103
74
|
}
|
|
104
75
|
|
|
105
76
|
export interface SourceRowCTA {
|
|
@@ -120,27 +91,11 @@ export interface SourceRowCTA {
|
|
|
120
91
|
}
|
|
121
92
|
|
|
122
93
|
/**
|
|
123
|
-
* Build a `SourceRowContext` from a `ChatRuntime
|
|
124
|
-
*
|
|
125
|
-
* `docPlatformTargets`) are wired identically at every `resolveSourceRowCTA` call site
|
|
126
|
-
* (source chips + inline cards), so they live here once — adding a ctx field is then a
|
|
127
|
-
* one-line change instead of editing all three call sites.
|
|
94
|
+
* Build a `SourceRowContext` from a `ChatRuntime`. Wired identically at every `resolveSourceRowCTA` call site
|
|
95
|
+
* (source chips + inline cards), so it lives here once.
|
|
128
96
|
*/
|
|
129
|
-
export function sourceRowCtxFromRuntime(
|
|
130
|
-
|
|
131
|
-
source?: string;
|
|
132
|
-
composeContentUrl?: ComposeContentUrl;
|
|
133
|
-
docPlatformTargets?: SourceRowContext['docPlatformTargets'];
|
|
134
|
-
},
|
|
135
|
-
surface: { baseRoute?: string; chipBasePlatform?: string } = {},
|
|
136
|
-
): SourceRowContext {
|
|
137
|
-
return {
|
|
138
|
-
currentPlatform: runtime.source ?? null,
|
|
139
|
-
composeContentUrl: runtime.composeContentUrl,
|
|
140
|
-
docPlatformTargets: runtime.docPlatformTargets,
|
|
141
|
-
baseRoute: surface.baseRoute,
|
|
142
|
-
chipBasePlatform: surface.chipBasePlatform,
|
|
143
|
-
};
|
|
97
|
+
export function sourceRowCtxFromRuntime(runtime: { composeContentUrl?: ComposeContentUrl }): SourceRowContext {
|
|
98
|
+
return { composeContentUrl: runtime.composeContentUrl };
|
|
144
99
|
}
|
|
145
100
|
|
|
146
101
|
/**
|
|
@@ -155,12 +110,8 @@ function pickSourceIcon(sourceRepo: string | null, documentType: string | null |
|
|
|
155
110
|
return { icon, iconLabel };
|
|
156
111
|
}
|
|
157
112
|
|
|
158
|
-
/**
|
|
159
|
-
|
|
160
|
-
* `externalUrl` is set; the in-app/per-platform viewer can render them. Entity-table
|
|
161
|
-
* rows MUST come with an explicit `externalUrl` from the mapper.
|
|
162
|
-
*/
|
|
163
|
-
function shouldFallbackToPathNav(row: SourceRowInput): boolean {
|
|
113
|
+
/** A doc-table row (DOC_TABLE_TYPES) is addressed by its tree `path`; every other row by its `externalUrl`. */
|
|
114
|
+
function isDocRow(row: SourceRowInput): boolean {
|
|
164
115
|
return !!row.documentType && (DOC_TABLE_TYPES as readonly string[]).includes(row.documentType);
|
|
165
116
|
}
|
|
166
117
|
|
|
@@ -186,57 +137,25 @@ export function resolveSourceRowCTA(row: SourceRowInput, ctx: SourceRowContext =
|
|
|
186
137
|
let href: string | null = null;
|
|
187
138
|
let targetPlatform: string | null = null;
|
|
188
139
|
const idValue = (row.id ?? '').trim();
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// The UNIFIED, DYNAMIC path: a chat mixing multiple doc sources routes
|
|
195
|
-
// EACH row to its own home (markdown→flamingo, data_room_doc→company-hub).
|
|
196
|
-
// 2. chipBasePlatform — legacy SINGLE cross-platform fallback (one platform
|
|
197
|
-
// for every doc; only safe when a surface sees just one doc source).
|
|
198
|
-
// 3. baseRoute — the host serves the doc viewer in-app → relative path nav.
|
|
199
|
-
// else → null (no viewer configured → Ask-only).
|
|
200
|
-
const safePath = sanitizePath(row.path);
|
|
201
|
-
if (safePath) {
|
|
202
|
-
const docTarget = row.documentType ? ctx.docPlatformTargets?.[row.documentType] : undefined;
|
|
203
|
-
if (docTarget) {
|
|
204
|
-
// Trim leading/trailing (and collapse empty) segments WITHOUT a regex — the
|
|
205
|
-
// slash-stripping regex `/^\/+|\/+$/g` tripped CodeQL's js/polynomial-redos (high)
|
|
206
|
-
// since `\/+$` backtracks on inputs with many '/'. split/filter/join is linear.
|
|
207
|
-
const seg = docTarget.basePath.split('/').filter(Boolean).join('/');
|
|
208
|
-
const base = `${getPlatformUrl(docTarget.platform)}${seg ? `/${seg}` : ''}/`;
|
|
209
|
-
href = safeHref(new URL(safePath, base).toString()) ?? null;
|
|
210
|
-
targetPlatform = docTarget.platform;
|
|
211
|
-
} else if (ctx.chipBasePlatform) {
|
|
212
|
-
const base = `${getPlatformUrl(ctx.chipBasePlatform)}/knowledge-base/`;
|
|
213
|
-
href = safeHref(new URL(safePath, base).toString()) ?? null;
|
|
214
|
-
targetPlatform = ctx.chipBasePlatform;
|
|
215
|
-
} else if (ctx.baseRoute) {
|
|
216
|
-
const synthetic = `https://_internal_.local${ctx.baseRoute.startsWith('/') ? ctx.baseRoute : '/' + ctx.baseRoute}/`;
|
|
217
|
-
const absolute = new URL(safePath, synthetic).toString();
|
|
218
|
-
href = safeHref(absolute.replace('https://_internal_.local', '')) ?? null;
|
|
219
|
-
targetPlatform = ctx.currentPlatform ?? null;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
} else if (ctx.composeContentUrl && row.documentType && row.externalUrl) {
|
|
223
|
-
// Entity content WITH a public viewer → the unified content-href seam. The
|
|
224
|
-
// host's hostedTypes/overrides route hosted types in-app (slug relativized
|
|
225
|
-
// from the externalUrl) and everything else to the externalUrl verbatim —
|
|
226
|
-
// the SAME resolver the page-view cards use, so chat + page links match.
|
|
140
|
+
// ONE address rule, the host's (`composeContentUrl`): a record by its `externalUrl`, a doc by its tree `path`
|
|
141
|
+
// (passed as the `slug`). The host's composer decides where the type lives and whether that is this site (a
|
|
142
|
+
// relative link) or another platform; the lib builds no address of its own (CU-17tkuw61kfy).
|
|
143
|
+
const docPath = !row.externalUrl && row.path && isDocRow(row) ? sanitizePath(row.path) : '';
|
|
144
|
+
if (ctx.composeContentUrl && row.documentType && (row.externalUrl || docPath)) {
|
|
227
145
|
const composed = ctx.composeContentUrl({
|
|
228
146
|
// Canonical vocabulary only — a rail-vocab alias would miss the host's
|
|
229
147
|
// `hostedTypes` / `overrides` and fall through to the seam's default
|
|
230
148
|
// `<origin>/<type>/<id>` branch. Same canonicalizer `buildListUrl` uses.
|
|
231
149
|
type: canonicalContentRefType(row.documentType),
|
|
232
150
|
identifier: idValue,
|
|
233
|
-
|
|
151
|
+
...(docPath ? { slug: docPath } : {}),
|
|
152
|
+
externalUrl: row.externalUrl ?? null,
|
|
234
153
|
targetPlatform: row.targetPlatform ?? null,
|
|
235
154
|
});
|
|
236
155
|
href = composed.href ? (safeHref(composed.href) ?? null) : null;
|
|
237
156
|
targetPlatform = composed.targetPlatform;
|
|
238
157
|
} else if (row.externalUrl) {
|
|
239
|
-
// No composer wired
|
|
158
|
+
// No composer wired: the record's own address, as given.
|
|
240
159
|
href = safeHref(row.externalUrl) ?? null;
|
|
241
160
|
targetPlatform = row.targetPlatform ?? null;
|
|
242
161
|
}
|
|
@@ -243,18 +243,10 @@ export interface ChatRuntime {
|
|
|
243
243
|
* Takes a single `ComposeContentUrlInput`: `type` + `identifier` (page
|
|
244
244
|
* views pass the slug; chat rows pass the id + `externalUrl`, whose path
|
|
245
245
|
* yields the slug for in-app routing) + optional `platforms` /
|
|
246
|
-
* `externalUrl` / `targetPlatform`.
|
|
246
|
+
* `externalUrl` / `targetPlatform`. A document (a doc-table row: markdown,
|
|
247
|
+
* data-room) arrives with its tree path as the `slug` and no `externalUrl`:
|
|
248
|
+
* the composer decides where that type's viewer is, like any other type. */
|
|
247
249
|
composeContentUrl?: ComposeContentUrl;
|
|
248
|
-
/** Per-`documentType` doc-viewer targets — the UNIFIED, DYNAMIC replacement for
|
|
249
|
-
* the single `chipBasePlatform` prop. Maps a doc-table documentType
|
|
250
|
-
* (`'markdown'`, `'data_room_doc'`, …) → `{ platform, basePath }` for the PUBLIC
|
|
251
|
-
* doc viewer that hosts it. Doc chips with no `externalUrl` resolve PER ROW to
|
|
252
|
-
* `getPlatformUrl(platform)/<basePath>/<path>`, so a chat mixing several doc sources
|
|
253
|
-
* sends EACH to its own home (markdown→flamingo/knowledge-base,
|
|
254
|
-
* data_room_doc→company-hub/data-room) instead of one static fallback. The hub
|
|
255
|
-
* may keep using `chipBasePlatform` (one doc source per platform); embedders that
|
|
256
|
-
* surface multiple doc sources wire this. Threaded into `resolveSourceRowCTA`. */
|
|
257
|
-
docPlatformTargets?: Record<string, { platform: string; basePath: string }>;
|
|
258
250
|
/** Chat source / platform identifier — OPTIONAL. The hub sets it from
|
|
259
251
|
* `currentPlatform()`; EMBEDDERS leave it unset and stay platform-agnostic.
|
|
260
252
|
*
|
|
@@ -27,8 +27,8 @@ import { defaultDocumentTypeForTableId, getSourceLabel } from './source-icons';
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Doc-table documentTypes: whole documents with their own viewer (markdown =
|
|
30
|
-
* product docs, data_room_doc = data room). They carry an in-app `path
|
|
31
|
-
*
|
|
30
|
+
* product docs, data_room_doc = data room). They carry an in-app `path` (handed
|
|
31
|
+
* to the host's composer as the slug), and a server never folds them
|
|
32
32
|
* into one citation (`groupsByTable`); the strip still draws them as one chip
|
|
33
33
|
* per table. The hub's per-source contract test pins this list to its
|
|
34
34
|
* doc-table configs.
|