@yumiai/chat-widget 0.2.1 → 0.2.2
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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/ExcelCore-EAXQMKZT.js +10 -0
- package/dist/{ExcelViewer-3YLLYYIQ.js → ExcelViewer-OGWM52ZT.js} +2 -3
- package/dist/{ExcelViewer-3YLLYYIQ.js.map → ExcelViewer-OGWM52ZT.js.map} +1 -1
- package/dist/{GerberViewerA2UI-X5FWAD5M.js → GerberViewerA2UI-AORHOCF6.js} +2 -3
- package/dist/{GerberViewerA2UI-X5FWAD5M.js.map → GerberViewerA2UI-AORHOCF6.js.map} +1 -1
- package/dist/{GraphStatsLegend-D5bPeXB_.d.cts → GraphStatsLegend-CV0Y3-cP.d.cts} +39 -0
- package/dist/{GraphStatsLegend-D5bPeXB_.d.ts → GraphStatsLegend-CV0Y3-cP.d.ts} +39 -0
- package/dist/JsonRenderStandalone-L5ROJ6XP.js +17 -0
- package/dist/{KicadViewer-GV6ZC4AQ.js → KicadViewer-H6YY6WVC.js} +3 -4
- package/dist/{KicadViewer-GV6ZC4AQ.js.map → KicadViewer-H6YY6WVC.js.map} +1 -1
- package/dist/KicadViewerCore-XVJE2FTQ.js +10 -0
- package/dist/{PdfViewer-CHPDRK46.js → PdfViewer-GKVDDNCZ.js} +9 -10
- package/dist/{PdfViewer-CHPDRK46.js.map → PdfViewer-GKVDDNCZ.js.map} +1 -1
- package/dist/{PdfViewerCore-HJPEHSRA.js → PdfViewerCore-SUVXHXYO.js} +24 -11
- package/dist/PdfViewerCore-SUVXHXYO.js.map +1 -0
- package/dist/PowerPointCore-IZ4G6HEQ.js +10 -0
- package/dist/{PowerPointViewer-LQTO6UCU.js → PowerPointViewer-5R2KSWWJ.js} +2 -3
- package/dist/{PowerPointViewer-LQTO6UCU.js.map → PowerPointViewer-5R2KSWWJ.js.map} +1 -1
- package/dist/{StepViewerCore-7W3L3R4E.js → StepViewerCore-RORWXIRU.js} +2 -3
- package/dist/{StepViewerCore-7W3L3R4E.js.map → StepViewerCore-RORWXIRU.js.map} +1 -1
- package/dist/{ThreeViewerCore-N3QJD5QI.js → ThreeViewerCore-GTUZKD5V.js} +2 -3
- package/dist/{ThreeViewerCore-N3QJD5QI.js.map → ThreeViewerCore-GTUZKD5V.js.map} +1 -1
- package/dist/WordCore-QFG5HTYD.js +10 -0
- package/dist/{WordViewer-ZHCQMHOH.js → WordViewer-7XUQFS4A.js} +2 -3
- package/dist/{WordViewer-ZHCQMHOH.js.map → WordViewer-7XUQFS4A.js.map} +1 -1
- package/dist/{chunk-QLVPIM6R.js → chunk-3CNQONCV.js} +79 -1
- package/dist/chunk-3CNQONCV.js.map +1 -0
- package/dist/{chunk-2UC7YLVX.js → chunk-3LOSHCSH.js} +3 -3
- package/dist/chunk-5VUKEGFC.js +108 -0
- package/dist/chunk-5VUKEGFC.js.map +1 -0
- package/dist/chunk-AO4YUJQT.js +479 -0
- package/dist/chunk-AO4YUJQT.js.map +1 -0
- package/dist/{chunk-KQV7IKET.js → chunk-ASV4TISB.js} +2 -2
- package/dist/{chunk-CFKGNAJM.js → chunk-AT6VLLOO.js} +15 -15
- package/dist/{chunk-56WRZM3R.js → chunk-EYWNUJVZ.js} +3 -3
- package/dist/{chunk-K4KGNVL5.js → chunk-EZ46FGQ6.js} +3 -3
- package/dist/{chunk-GYXTSY22.js → chunk-KXPR6SRW.js} +4 -4
- package/dist/{chunk-7S67DOHQ.js → chunk-MTN6SUUQ.js} +2 -2
- package/dist/chunk-Q5PLT3AI.js +29 -0
- package/dist/chunk-Q5PLT3AI.js.map +1 -0
- package/dist/{chunk-PZXSASDY.js → chunk-R5LHMOAC.js} +3 -3
- package/dist/chunk-X67V7257.js +238 -0
- package/dist/chunk-X67V7257.js.map +1 -0
- package/dist/citationContext-CILHTO2Z.js +25 -0
- package/dist/components/JsonRender/standalone.cjs +56 -9753
- package/dist/components/JsonRender/standalone.cjs.map +1 -1
- package/dist/components/JsonRender/standalone.js +10 -11
- package/dist/components/JsonRender/standalone.js.map +1 -1
- package/dist/{gerber-2d-entry-OQ4SQRBY.js → gerber-2d-entry-HEFXQGBK.js} +5 -9
- package/dist/{gerber-2d-entry-OQ4SQRBY.js.map → gerber-2d-entry-HEFXQGBK.js.map} +1 -1
- package/dist/{gerber-3d-entry-DEHDBOO2.js → gerber-3d-entry-KVTONA37.js} +5 -9
- package/dist/{gerber-3d-entry-DEHDBOO2.js.map → gerber-3d-entry-KVTONA37.js.map} +1 -1
- package/dist/{gerber-simulation-entry-EBDX72XE.js → gerber-simulation-entry-GZ62QX5H.js} +5 -9
- package/dist/{gerber-simulation-entry-EBDX72XE.js.map → gerber-simulation-entry-GZ62QX5H.js.map} +1 -1
- package/dist/index.cjs +6690 -13472
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +776 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +979 -26
- package/dist/index.d.ts +979 -26
- package/dist/index.js +4350 -1859
- package/dist/index.js.map +1 -1
- package/dist/provenance/index.cjs +78 -0
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +2 -2
- package/dist/provenance/index.d.ts +2 -2
- package/dist/provenance/index.js +2 -3
- package/dist/{resolveToArrayBuffer-AQIDZHSQ.js → resolveToArrayBuffer-PVSVIAII.js} +1 -3
- package/dist/{resolveToArrayBuffer-AQIDZHSQ.js.map → resolveToArrayBuffer-PVSVIAII.js.map} +1 -1
- package/dist/sseAdapter-LFXYGYC4.js +8 -0
- package/dist/sseAdapter-LFXYGYC4.js.map +1 -0
- package/package.json +2 -1
- package/dist/ExcelCore-DJOIVQMI.js +0 -11
- package/dist/JsonRenderStandalone-EIZM62JU.js +0 -18
- package/dist/KicadViewerCore-U7BWZHKJ.js +0 -11
- package/dist/PdfViewerCore-HJPEHSRA.js.map +0 -1
- package/dist/PowerPointCore-FPDR2BL4.js +0 -11
- package/dist/WordCore-JKSXK2XD.js +0 -11
- package/dist/chunk-7A4FY6FK.js +0 -10226
- package/dist/chunk-7A4FY6FK.js.map +0 -1
- package/dist/chunk-7D4SUZUM.js +0 -38
- package/dist/chunk-QLVPIM6R.js.map +0 -1
- package/dist/chunk-VXJWGLZ7.js +0 -21
- package/dist/chunk-VXJWGLZ7.js.map +0 -1
- /package/dist/{ExcelCore-DJOIVQMI.js.map → ExcelCore-EAXQMKZT.js.map} +0 -0
- /package/dist/{JsonRenderStandalone-EIZM62JU.js.map → JsonRenderStandalone-L5ROJ6XP.js.map} +0 -0
- /package/dist/{KicadViewerCore-U7BWZHKJ.js.map → KicadViewerCore-XVJE2FTQ.js.map} +0 -0
- /package/dist/{PowerPointCore-FPDR2BL4.js.map → PowerPointCore-IZ4G6HEQ.js.map} +0 -0
- /package/dist/{WordCore-JKSXK2XD.js.map → WordCore-QFG5HTYD.js.map} +0 -0
- /package/dist/{chunk-2UC7YLVX.js.map → chunk-3LOSHCSH.js.map} +0 -0
- /package/dist/{chunk-KQV7IKET.js.map → chunk-ASV4TISB.js.map} +0 -0
- /package/dist/{chunk-CFKGNAJM.js.map → chunk-AT6VLLOO.js.map} +0 -0
- /package/dist/{chunk-56WRZM3R.js.map → chunk-EYWNUJVZ.js.map} +0 -0
- /package/dist/{chunk-K4KGNVL5.js.map → chunk-EZ46FGQ6.js.map} +0 -0
- /package/dist/{chunk-GYXTSY22.js.map → chunk-KXPR6SRW.js.map} +0 -0
- /package/dist/{chunk-7S67DOHQ.js.map → chunk-MTN6SUUQ.js.map} +0 -0
- /package/dist/{chunk-PZXSASDY.js.map → chunk-R5LHMOAC.js.map} +0 -0
- /package/dist/{chunk-7D4SUZUM.js.map → citationContext-CILHTO2Z.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { RefObject } from 'react';
|
|
3
|
-
import { k as ProvenanceGraphSnapshot, a as ChatWidgetMessages, C as ChatWidgetLocale } from './GraphStatsLegend-
|
|
4
|
-
export { E as EdgeType, F as FetchGraphOptions, b as FilterBar, G as GraphBuilder, c as GraphEdge, d as GraphFilter, e as GraphSSEPayload, f as GraphStatsLegend, g as GraphToolbar, N as NodeDetailPanel, h as NodeType, P as ProvenanceGraph3D, i as ProvenanceGraphDrawerContent, j as ProvenanceGraphFetcher, l as ProvenanceNode, m as fetchProvenanceGraph, r as resolveMessages, u as useProvenanceGraph } from './GraphStatsLegend-
|
|
3
|
+
import { k as ProvenanceGraphSnapshot, a as ChatWidgetMessages, C as ChatWidgetLocale } from './GraphStatsLegend-CV0Y3-cP.js';
|
|
4
|
+
export { E as EdgeType, F as FetchGraphOptions, b as FilterBar, G as GraphBuilder, c as GraphEdge, d as GraphFilter, e as GraphSSEPayload, f as GraphStatsLegend, g as GraphToolbar, N as NodeDetailPanel, h as NodeType, P as ProvenanceGraph3D, i as ProvenanceGraphDrawerContent, j as ProvenanceGraphFetcher, l as ProvenanceNode, m as fetchProvenanceGraph, r as resolveMessages, u as useProvenanceGraph } from './GraphStatsLegend-CV0Y3-cP.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
export { J as JsonRenderActionHandler, a as JsonRenderStandalone, b as JsonRenderStandaloneProps } from './JsonRenderStandalone-UsTcST4G.js';
|
|
7
7
|
|
|
@@ -12,7 +12,13 @@ type NotificationType = 'user_input' | 'node_notification' | 'start' | 'model_st
|
|
|
12
12
|
| 'session_title'
|
|
13
13
|
/** JETP-073:client("办公室")级 LLM 起名 notification。controller 派发为
|
|
14
14
|
* ``ClientTitleEvent``;上游消费方按 ``client_id`` 增量更新本地 cache。 */
|
|
15
|
-
| 'client_title' | 'compression_started' | 'compression_completed' | 'node_summary'
|
|
15
|
+
| 'client_title' | 'compression_started' | 'compression_completed' | 'node_summary'
|
|
16
|
+
/** JETP-084 T-4.1 / T-5.5b: paragraph-level RAG provenance. Emitted right
|
|
17
|
+
* before MODEL_END for any LLM turn that consumed read-tool output. Content
|
|
18
|
+
* is a `CitationContextEvent` (see `provenance/rag/types.ts`) carrying the
|
|
19
|
+
* set of files cited in this message so the frontend can preload sidecars
|
|
20
|
+
* and render Chips. */
|
|
21
|
+
| 'citation_context';
|
|
16
22
|
interface UiConfig {
|
|
17
23
|
display_type: 'content' | 'command' | 'browser' | 'query' | 'path' | 'trigger' | 'thinking' | 'params';
|
|
18
24
|
icon?: string;
|
|
@@ -70,6 +76,27 @@ interface SSEMessage {
|
|
|
70
76
|
* 旧后端不下发 → undefined → 不做 echo 抑制,回退到 Phase 1-5 行为 (AC-CONN-008)。
|
|
71
77
|
*/
|
|
72
78
|
connection_id_from?: string;
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated JETP-084 v3 (Phase 10) — embedded citation_context in
|
|
81
|
+
* NodeNotification.ext was deleted. v3 emits an independent
|
|
82
|
+
* ``CITATION_CONTEXT`` SSE notification from the read tool. The field
|
|
83
|
+
* is retained on the type for one release so call sites mid-migration
|
|
84
|
+
* compile; new code should ignore it.
|
|
85
|
+
*
|
|
86
|
+
* Historical (deleted) v2 path:
|
|
87
|
+
* Phase 9 embedded the citation_context payload into
|
|
88
|
+
* ``notification.ext.citation_context`` for non-streaming carriers
|
|
89
|
+
* so the controller could ingest keyed by the frontend's own
|
|
90
|
+
* ``messageKey`` (= ``msg.id``) — sidestepping the
|
|
91
|
+
* ID-alignment failure mode of the legacy standalone event.
|
|
92
|
+
*
|
|
93
|
+
* Shape: ``{ message_id: string (server-side debug hint), files: CitationContextFile[] }``.
|
|
94
|
+
* The frontend ignores ``message_id`` and uses the local messageKey instead.
|
|
95
|
+
*
|
|
96
|
+
* Absent on streaming notifications (covered by the legacy
|
|
97
|
+
* standalone CITATION_CONTEXT event + global Solution B fallback).
|
|
98
|
+
*/
|
|
99
|
+
citation_context?: unknown;
|
|
73
100
|
}
|
|
74
101
|
interface PlanItem {
|
|
75
102
|
text: string;
|
|
@@ -298,6 +325,13 @@ interface Round {
|
|
|
298
325
|
endedAgentInstanceIds?: Set<number>;
|
|
299
326
|
/** JETP-045 Layer 1:客户端连接子空间标识。 */
|
|
300
327
|
clientId?: string;
|
|
328
|
+
/**
|
|
329
|
+
* 本轮是否由真实用户消息发起(存在 user_input)。用于置顶区/钉选时区分
|
|
330
|
+
* 「用户提问 round」与「无用户输入的续作 round」(如后端下发的 genui/a2ui round,
|
|
331
|
+
* 历史模式下其 userMessage 会被填成占位文案 "(历史消息)",不能据此误判为有用户消息)。
|
|
332
|
+
* 缺省(undefined)按旧逻辑信任 userMessage。
|
|
333
|
+
*/
|
|
334
|
+
hasUserMessage?: boolean;
|
|
301
335
|
}
|
|
302
336
|
type ExecutionStatus = 'idle' | 'running' | 'compressing' | 'completed' | 'error';
|
|
303
337
|
interface ChatWidgetConfig {
|
|
@@ -469,6 +503,31 @@ interface ModelOverride {
|
|
|
469
503
|
scope?: 'root' | 'all';
|
|
470
504
|
settings?: Record<string, unknown>;
|
|
471
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* 单个 ``model_id`` 折叠后的能力位。字段名严格匹配 hip ``Capabilities`` DTO。
|
|
508
|
+
*/
|
|
509
|
+
interface ModelCapabilities {
|
|
510
|
+
/** 模型接受用户消息中的图像块(OpenAI ``image_url`` / Anthropic ``input_image``)。 */
|
|
511
|
+
imageInput: boolean;
|
|
512
|
+
/** 模型接受音频块(少数模型,如 Gemini multimodal、4o-audio)。 */
|
|
513
|
+
audioInput: boolean;
|
|
514
|
+
/** 模型接受视频块(Gemini family)。 */
|
|
515
|
+
videoInput: boolean;
|
|
516
|
+
/** 模型支持工具调用(OpenAI ``tools`` / Anthropic ``tool_use``)。 */
|
|
517
|
+
functionCall: boolean;
|
|
518
|
+
/** 模型支持流式响应。绝大多数 chat completion 模型都 true。 */
|
|
519
|
+
streaming: boolean;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* ``GET /api/v1/models/capabilities`` 响应;``items`` key = ``channel/model_name``
|
|
523
|
+
* (与 ``ModelListItemRaw.id`` 完全一致)。
|
|
524
|
+
*
|
|
525
|
+
* 调用方约定:取不到的 model_id 应当默认按全 ``false`` 处理(保守门控)。
|
|
526
|
+
*/
|
|
527
|
+
interface ListModelCapabilitiesResponse {
|
|
528
|
+
items: Record<string, ModelCapabilities>;
|
|
529
|
+
total: number;
|
|
530
|
+
}
|
|
472
531
|
/**
|
|
473
532
|
* 单条模型记录,等价于 hip ``Model`` DTO。每条 = 一个 (channel, model_name) 对。
|
|
474
533
|
*
|
|
@@ -587,7 +646,20 @@ interface ListModelsParams {
|
|
|
587
646
|
groupBy?: 'basename' | 'name' | 'none';
|
|
588
647
|
}
|
|
589
648
|
interface ChatWidgetAPI {
|
|
590
|
-
|
|
649
|
+
/**
|
|
650
|
+
* 发送一条用户消息。
|
|
651
|
+
*
|
|
652
|
+
* 第 9 个参数 ``modelCapabilities`` 是 JETP-multimodal 引入的"目标模型能力位"
|
|
653
|
+
* 转发通道:DefaultComposer / 自定义 footer 在用户挑选模型后用
|
|
654
|
+
* ``useModelCapabilities`` 解出当前 model 的 caps,然后跟 ``modelOverride`` 一起
|
|
655
|
+
* 透到这里;controller 把它原样传给 ``adapter.buildStreamBody``,由 adapter
|
|
656
|
+
* 决定是否把 image 附件折成 ``image_url`` 协议块。
|
|
657
|
+
*
|
|
658
|
+
* 不传 / null → adapter 视为"未知能力,保守不发图",与未升级前的行为完全一致。
|
|
659
|
+
* 调用方**不应**自行猜测 caps("我看模型名带 vision 就传 imageInput=true"):
|
|
660
|
+
* 数据源唯一是 hip-server,前端 useModelCapabilities 已经处理了缓存 / 失败兜底。
|
|
661
|
+
*/
|
|
662
|
+
sendMessage: (message: string, agentId?: string, inlineRefs?: FileReference[], selectedSkills?: SelectedSkillRef[], overrideInstanceId?: number | null, clientId?: string, fileAttachments?: FileAttachment[], modelOverride?: ModelOverride | null, modelCapabilities?: ModelCapabilities | null) => void | Promise<void>;
|
|
591
663
|
getCurrentRound: () => Round | null;
|
|
592
664
|
getAllRounds: () => Round[];
|
|
593
665
|
scrollToBottom: () => void;
|
|
@@ -638,6 +710,19 @@ interface ChatWidgetAPI {
|
|
|
638
710
|
removeFile: (resourceId: string) => void;
|
|
639
711
|
clear: () => void;
|
|
640
712
|
enabled: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* JETP-multimodal: 主动刷新一组(或全部 image)附件的预签名 URL。
|
|
715
|
+
*
|
|
716
|
+
* 何时调:
|
|
717
|
+
* - send 前的"过期保护":buildStreamBody 之前检查 ``imageUrlExpiresAt``,
|
|
718
|
+
* 如果距过期 < safety_margin(默认 5 分钟),先把这些 URL 刷一遍再上行;
|
|
719
|
+
* - 用户长时间打字(>= 30min)后再发送的兜底;
|
|
720
|
+
* - retry:上次 send 因 URL 401 失败的恢复路径。
|
|
721
|
+
*
|
|
722
|
+
* 不传 ``resourceIds`` → 刷新所有 ready 的 image MIME 附件。
|
|
723
|
+
* adapter 缺 ``getResourceUrls`` 时本方法 no-op(返回已 resolved 的 Promise)。
|
|
724
|
+
*/
|
|
725
|
+
refreshUrls: (resourceIds?: string[]) => Promise<void>;
|
|
641
726
|
};
|
|
642
727
|
}
|
|
643
728
|
interface ToolCallData {
|
|
@@ -997,6 +1082,16 @@ interface ChatWidgetAdapter {
|
|
|
997
1082
|
* 详见 ``ModelOverride``。
|
|
998
1083
|
*/
|
|
999
1084
|
modelOverride?: ModelOverride | null;
|
|
1085
|
+
/**
|
|
1086
|
+
* JETP-multimodal: 目标模型的能力位,由 Composer 端 ``useModelCapabilities``
|
|
1087
|
+
* 解析得到。adapter 仅在 ``imageInput=true`` 时才把 image 附件折成
|
|
1088
|
+
* ``{type: 'image_url', ...}`` 协议块下发;其他情况只走文本 marker。
|
|
1089
|
+
*
|
|
1090
|
+
* 缺省 / null → adapter 视为"未知能力,保守不发",与未升级前的行为完全一致。
|
|
1091
|
+
* 这条门控**必须**由前端兜底:``ImagePart.to_serializable`` 在 IMAGE 类型
|
|
1092
|
+
* 上强依赖 ``uri`` 非空,下游不能再做"宽容"。
|
|
1093
|
+
*/
|
|
1094
|
+
modelCapabilities?: ModelCapabilities | null;
|
|
1000
1095
|
}): object;
|
|
1001
1096
|
listSkills?(params?: SkillListParams): Promise<SkillListResponse>;
|
|
1002
1097
|
onAuthFailure?(): void;
|
|
@@ -1079,6 +1174,49 @@ interface ChatWidgetAdapter {
|
|
|
1079
1174
|
listModels?<TGroup extends 'basename' | 'name' | 'none' = 'basename'>(params?: ListModelsParams & {
|
|
1080
1175
|
groupBy?: TGroup;
|
|
1081
1176
|
}): Promise<ListModelsResponse<TGroup extends 'basename' ? ModelListItemBasenameGrouped : TGroup extends 'name' ? ModelListItemGrouped : ModelListItemRaw>>;
|
|
1177
|
+
/**
|
|
1178
|
+
* 拉取"模型能力位"全表 / 子集。**唯一来源**是 hip-server
|
|
1179
|
+
* ``GET /api/v1/models/capabilities``,**不走 fusion / model-lake 直连**。
|
|
1180
|
+
*
|
|
1181
|
+
* 行为约定:
|
|
1182
|
+
* - 不传 ``modelIds`` → 返回所有 active model 的能力位(开发态调试 / 后台批量);
|
|
1183
|
+
* - 传 ``modelIds`` → 仅这几个;hip 端保证未命中的 id 实化为全 false 而不是省略;
|
|
1184
|
+
* - 网络 / 5xx → 抛 ``ChatWidgetNetworkError``,让 UI 决定降级
|
|
1185
|
+
* (**不要**在 adapter 层兜成 ``{}`` —— 错误"撒谎成 false"会误导多模态 UI)。
|
|
1186
|
+
*
|
|
1187
|
+
* 当 adapter 不实现该方法时,上层 ``useModelCapabilities`` 返回全 false 的
|
|
1188
|
+
* ``EMPTY_CAPS``。这只影响 ``adapter.buildStreamBody`` **是否把附件折成**
|
|
1189
|
+
* ``image_url`` / ``audio`` / ``video_url`` 协议块;并**不**影响附件是否能
|
|
1190
|
+
* 上传 —— Composer 任何时候都不会因为 caps 缺失而拒收文件,未折成协议块的
|
|
1191
|
+
* 附件仍以"文本 marker(resourceId)" 形态参与,由 KG / 工作空间工具 / agent
|
|
1192
|
+
* 文字阅读兜底消费。
|
|
1193
|
+
*/
|
|
1194
|
+
listModelCapabilities?(modelIds?: string[]): Promise<ListModelCapabilitiesResponse>;
|
|
1195
|
+
/**
|
|
1196
|
+
* JETP-multimodal: 批量获取一组 ``resource_id`` 的访问 URL + MIME + 过期时间。
|
|
1197
|
+
*
|
|
1198
|
+
* **唯一来源**是 jetagents KG ``GET /api/knowledge/workspace/files`` (带
|
|
1199
|
+
* ``generate_urls=true``);KG 已经按 ``access_mode=private`` 生成 MinIO 预签名
|
|
1200
|
+
* URL(默认 1h TTL)。
|
|
1201
|
+
*
|
|
1202
|
+
* 设计取舍:
|
|
1203
|
+
* - 批量 vs. 逐个 ``getResourceUrl``:后者每次都列全表,N 张图片就 N 次 O(N)
|
|
1204
|
+
* 扫表;批量一次拿全部,明显省网络。
|
|
1205
|
+
* - 返回 Map<rid, {url, mimeType, expiresAtMs}>:调用方一般要按 rid 反查,
|
|
1206
|
+
* 用 Map 比 Array 直接;未命中的 rid 直接缺 key(让上层显式处理)。
|
|
1207
|
+
* - ``expiresAtMs`` 由 adapter 当场用 ``Date.now() + url_expires_in*1000``
|
|
1208
|
+
* 算出来。把"相对秒数 → 绝对时刻"的归一化做在 adapter 层,hook 这一侧
|
|
1209
|
+
* 只做"now > expiresAtMs - safety → 重拉"的判断,逻辑收敛。
|
|
1210
|
+
*
|
|
1211
|
+
* 当 adapter 不实现该方法时,``useFileUpload`` 不会去拉 URL,附件依旧能正常
|
|
1212
|
+
* 上传 / 在文本 marker 形态出现,只是图片缩略图 + 多模态 image_url 协议块
|
|
1213
|
+
* 都不会出现(fail-safe 到"老链路")。
|
|
1214
|
+
*/
|
|
1215
|
+
getResourceUrls?(sessionId: number, resourceIds: string[]): Promise<Map<string, {
|
|
1216
|
+
url: string;
|
|
1217
|
+
mimeType?: string;
|
|
1218
|
+
expiresAtMs?: number;
|
|
1219
|
+
}>>;
|
|
1082
1220
|
/**
|
|
1083
1221
|
* 按 ``agentId`` 查询该 agent 在后端注册的默认模型,**仅用于 picker 展示态**。
|
|
1084
1222
|
*
|
|
@@ -1269,6 +1407,25 @@ interface UploadedFileInfo {
|
|
|
1269
1407
|
status: 'uploading' | 'processing' | 'ready' | 'error';
|
|
1270
1408
|
progress?: string;
|
|
1271
1409
|
error?: string;
|
|
1410
|
+
/**
|
|
1411
|
+
* JETP-multimodal: 与 ``FileAttachment.mimeType`` 同义;upload 时由 localFile.type
|
|
1412
|
+
* 兜底,ready 后被 ``getResourceUrls`` 返回的权威 mime 覆盖。
|
|
1413
|
+
*/
|
|
1414
|
+
mimeType?: string;
|
|
1415
|
+
/**
|
|
1416
|
+
* JETP-multimodal: 与 ``FileAttachment.imageUrl`` 同义;只对 image MIME 文件填充。
|
|
1417
|
+
* 状态 'uploading' / 'processing' 期间为 undefined;'ready' 后异步填充
|
|
1418
|
+
* (拉 KG URL 期间维持 undefined → 上层不应假设 ready ⇒ imageUrl 已就绪,
|
|
1419
|
+
* 而是看 ``imageUrlExpiresAt > now`` 判断"可用且未过期")。
|
|
1420
|
+
*/
|
|
1421
|
+
imageUrl?: string;
|
|
1422
|
+
/** JETP-multimodal: 与 ``FileAttachment.imageUrlExpiresAt`` 同义。 */
|
|
1423
|
+
imageUrlExpiresAt?: number;
|
|
1424
|
+
/**
|
|
1425
|
+
* JETP-multimodal: ``true`` 表示当前正在拉 / 刷新 URL;UI 可据此显示 loading
|
|
1426
|
+
* 缩略图占位,避免"已 ready 但 url 还在路上"造成的闪烁。
|
|
1427
|
+
*/
|
|
1428
|
+
imageUrlRefreshing?: boolean;
|
|
1272
1429
|
}
|
|
1273
1430
|
interface FileUploadResult {
|
|
1274
1431
|
status?: 'accepted' | 'partial_success' | 'failed';
|
|
@@ -1315,6 +1472,32 @@ interface FileAttachment {
|
|
|
1315
1472
|
resourceId: string;
|
|
1316
1473
|
fileName: string;
|
|
1317
1474
|
gitPath?: string;
|
|
1475
|
+
/**
|
|
1476
|
+
* JETP-multimodal: 已签名 / 公开可读的图片 URL(KG presigned 或 public),
|
|
1477
|
+
* 仅对 ``mimeType`` 以 ``image/`` 开头的附件填充。``buildStreamBody`` 在判定
|
|
1478
|
+
* 目标模型支持 ``image_input`` 时,会把这个 URL 拼到 ``contents`` 的
|
|
1479
|
+
* ``{ type: 'image_url', ... }`` 协议块里。
|
|
1480
|
+
*
|
|
1481
|
+
* 取舍:附带 URL 不依赖目标模型是否支持图像 —— **能力门控发生在 send 时**,
|
|
1482
|
+
* 不在 upload 时;这样用户切换模型不需要重新拉 URL,体验更流畅。
|
|
1483
|
+
* 模型不支持时,附件仍会以 ``[附件: fn | resource_id: rid]`` 文本 marker
|
|
1484
|
+
* 形态出现在 message 中(与历史行为一致),让 agent / 工具仍能从 workspace
|
|
1485
|
+
* 通过 resource_id 拿文件。
|
|
1486
|
+
*/
|
|
1487
|
+
imageUrl?: string;
|
|
1488
|
+
/**
|
|
1489
|
+
* JETP-multimodal: ``imageUrl`` 的预期过期时刻(unix ms)。KG presigned URL
|
|
1490
|
+
* 默认 1h;前端在 send 前会对"距过期 < safety_margin"的 URL 触发刷新。
|
|
1491
|
+
*/
|
|
1492
|
+
imageUrlExpiresAt?: number;
|
|
1493
|
+
/**
|
|
1494
|
+
* JETP-multimodal: 文件 MIME(KG 已识别);用于:
|
|
1495
|
+
* 1. Composer 判定 image 缩略图 vs. 普通附件 chip;
|
|
1496
|
+
* 2. buildStreamBody 用 ``image/`` 前缀决定是否参与多模态组装。
|
|
1497
|
+
*
|
|
1498
|
+
* 缺省 → 走"非 image"路径,与历史行为一致。
|
|
1499
|
+
*/
|
|
1500
|
+
mimeType?: string;
|
|
1318
1501
|
}
|
|
1319
1502
|
declare function mergeConsecutiveThinkMessages(messages: AggregatedMessage[]): AggregatedMessage[];
|
|
1320
1503
|
interface TodoCardProps {
|
|
@@ -1568,7 +1751,7 @@ interface ChatWidgetControllerState {
|
|
|
1568
1751
|
}>;
|
|
1569
1752
|
/** JETP-083 WS3.7.5 — terminal lifecycle markers (cancelled/error) by spec_id. */
|
|
1570
1753
|
specLifecycleMap: Map<string, SpecLifecycleEntry>;
|
|
1571
|
-
sendMessage: (message: string, agentId?: string, inlineRefs?: FileReference[], selectedSkills?: SelectedSkillRef[], overrideInstanceId?: number | null, clientId?: string, fileAttachments?: FileAttachment[], modelOverride?: ModelOverride | null) => Promise<void>;
|
|
1754
|
+
sendMessage: (message: string, agentId?: string, inlineRefs?: FileReference[], selectedSkills?: SelectedSkillRef[], overrideInstanceId?: number | null, clientId?: string, fileAttachments?: FileAttachment[], modelOverride?: ModelOverride | null, modelCapabilities?: ModelCapabilities | null) => Promise<void>;
|
|
1572
1755
|
widgetAPI: ChatWidgetAPI;
|
|
1573
1756
|
/** Agent instance states tracked via WS status stream. Empty map when SSE transport. */
|
|
1574
1757
|
agentStates: Map<number, AgentInstanceState>;
|
|
@@ -1942,11 +2125,26 @@ interface UseFileUploadReturn {
|
|
|
1942
2125
|
addFiles: (files: File[]) => void;
|
|
1943
2126
|
removeFile: (resourceId: string) => void;
|
|
1944
2127
|
clear: () => void;
|
|
2128
|
+
/**
|
|
2129
|
+
* JETP-multimodal: 主动刷新一组(或全部 image/audio/video)附件的预签名 URL。
|
|
2130
|
+
*
|
|
2131
|
+
* 行为:
|
|
2132
|
+
* - 不传 ``resourceIds`` → 默认刷新所有 ``status='ready'`` 且 ``mimeType``
|
|
2133
|
+
* 属于多模态大类(image / audio / video)的附件;
|
|
2134
|
+
* - adapter 未实现 ``getResourceUrls`` → no-op(resolved Promise)。
|
|
2135
|
+
*
|
|
2136
|
+
* 与 ``addFiles`` 内部的 first-fetch 共用底层 ``_fetchAndApplyMediaUrls`` 助手,
|
|
2137
|
+
* 保证两条路径走完全相同的拉取 + 写回逻辑。
|
|
2138
|
+
*/
|
|
2139
|
+
refreshUrls: (resourceIds?: string[]) => Promise<void>;
|
|
1945
2140
|
}
|
|
1946
2141
|
/**
|
|
1947
|
-
* JETP-040: Shared hook managing the two-step file upload lifecycle.
|
|
2142
|
+
* JETP-040 (multimodal extension): Shared hook managing the two-step file upload lifecycle.
|
|
1948
2143
|
* 1. Upload files via adapter.uploadFiles() -> get resource IDs
|
|
1949
2144
|
* 2. Poll adapter.getUploadStatus() until all files are 'ready' or 'error'
|
|
2145
|
+
* 3. (multimodal) For image MIME attachments, fetch ``imageUrl`` via
|
|
2146
|
+
* ``adapter.getResourceUrls()`` so Composer can render thumbnails and
|
|
2147
|
+
* ``buildStreamBody`` can emit ``{type: 'image_url', ...}`` content blocks.
|
|
1950
2148
|
*/
|
|
1951
2149
|
declare function useFileUpload(options: UseFileUploadOptions): UseFileUploadReturn;
|
|
1952
2150
|
|
|
@@ -2668,6 +2866,12 @@ interface RichInputHandle {
|
|
|
2668
2866
|
insertSkillChip: (skill: SkillSummary) => void;
|
|
2669
2867
|
focus: () => void;
|
|
2670
2868
|
clear: () => void;
|
|
2869
|
+
/**
|
|
2870
|
+
* 用纯文本替换编辑器全部内容(chip 也会被清掉)。
|
|
2871
|
+
* 适用于"外部 prefill"场景:scenario 卡片 → 灌词 → 让用户继续编辑。
|
|
2872
|
+
* 调用后光标自动移到末尾。
|
|
2873
|
+
*/
|
|
2874
|
+
setText: (text: string) => void;
|
|
2671
2875
|
getText: () => string;
|
|
2672
2876
|
getReferences: () => FileReference[];
|
|
2673
2877
|
getSkills: () => SkillSummary[];
|
|
@@ -2709,6 +2913,83 @@ interface RichInputProps {
|
|
|
2709
2913
|
}
|
|
2710
2914
|
declare const RichInput: React__default.ForwardRefExoticComponent<RichInputProps & React__default.RefAttributes<RichInputHandle>>;
|
|
2711
2915
|
|
|
2916
|
+
/**
|
|
2917
|
+
* Model 启发式分类:vendor(厂商家族)+ modality(模态/能力)。
|
|
2918
|
+
*
|
|
2919
|
+
* 为什么是"启发式":
|
|
2920
|
+
* model-lake `/unified/v1/models` 当前只透出 ``(channel, model_name)`` 二元组,
|
|
2921
|
+
* 没有 modality / family 元信息。给前端 picker 做"按家族分组 + 按模态过滤"两个
|
|
2922
|
+
* 高 ROI 功能需要这两个轴,要么 (A) 后端先加 schema,要么 (B) 前端从 basename
|
|
2923
|
+
* 推断。我们选 (B) —— 一来 basename 命名在我们这套 model-lake 里有很强规律
|
|
2924
|
+
* (openai-* / gemini-* / anthropic-claude-* / qwen-* / glm-* …),前端推断
|
|
2925
|
+
* 覆盖率 > 95%;二来这一层完全本地,不阻塞 picker UX 改进。
|
|
2926
|
+
*
|
|
2927
|
+
* 后续如果要把这两个轴升级到"后端权威":
|
|
2928
|
+
* - hip-server BasenameVariant / BasenameGrouped 加 ``vendor`` / ``modality`` 字段;
|
|
2929
|
+
* - 本文件 ``vendorOf`` / ``modalityOf`` 改成"优先读 BasenameGrouped 注入的字段,
|
|
2930
|
+
* 回落到本地启发式",调用方代码不动。
|
|
2931
|
+
*
|
|
2932
|
+
* 不在这里做:
|
|
2933
|
+
* - 不做"模型质量评分 / 推荐度"——那属于 product policy,不是 UI 分类;
|
|
2934
|
+
* - 不做 vendor → modality 反向硬绑(``anthropic`` 只能聊天)——上下文是开放的,
|
|
2935
|
+
* 未来 anthropic 出图像模型时不应该被前端误归类。匹配独立、各自负责。
|
|
2936
|
+
*
|
|
2937
|
+
* 测试:``modelClassifier.test.ts`` 把我们 model-lake 里真实出现过的 basename
|
|
2938
|
+
* 全部跑一遍,确保归类稳定。
|
|
2939
|
+
*/
|
|
2940
|
+
/** 已识别的 vendor 家族 id;``'other'`` 是 catch-all。 */
|
|
2941
|
+
type VendorId = 'openai' | 'anthropic' | 'google' | 'xai' | 'alibaba' | 'zhipu' | 'moonshot' | 'bytedance' | 'deepseek' | 'minimax' | 'openrouter' | 'xiaomi' | 'other';
|
|
2942
|
+
/**
|
|
2943
|
+
* Vendor 显示顺序(picker 默认渲染顺序)。
|
|
2944
|
+
* 排序原则:用户活跃度高的几家在前;尾巴留 openrouter / xiaomi / other。
|
|
2945
|
+
* 修改顺序 = 修改 picker 默认视觉次序;不要轻易动,做 A/B 时改这里就行。
|
|
2946
|
+
*/
|
|
2947
|
+
declare const VENDOR_ORDER: readonly VendorId[];
|
|
2948
|
+
/**
|
|
2949
|
+
* 把 basename 归到一个 ``VendorId``;无匹配 → ``'other'``。
|
|
2950
|
+
*
|
|
2951
|
+
* **不要**用这个返回值去做发送态的路由决策——它只是 UI 分组标签,可能误判
|
|
2952
|
+
* (如某天 openrouter 命名调整把 anthropic 词缀挪到中间)。发送依然走
|
|
2953
|
+
* variant.name 原值。
|
|
2954
|
+
*/
|
|
2955
|
+
declare function vendorOf(basename: string): VendorId;
|
|
2956
|
+
/**
|
|
2957
|
+
* 模态/能力轴:
|
|
2958
|
+
* - chat: 普通对话(默认 catch-all,所有未匹配到具体模态的回落到这里)
|
|
2959
|
+
* - image: 图像生成 / 编辑
|
|
2960
|
+
* - video: 视频生成
|
|
2961
|
+
* - audio: TTS / STT / 音乐
|
|
2962
|
+
* - embedding: 文本向量
|
|
2963
|
+
* - realtime: 双向流式语音(OpenAI Realtime / Gemini Live 等)
|
|
2964
|
+
*
|
|
2965
|
+
* 我们故意**不**把"reasoning"做成独立模态——它是 ``chat`` 的一种子能力,
|
|
2966
|
+
* 用户在 picker 这一层不需要切到独立 tab;后续如果要做能力 chip("reasoning"
|
|
2967
|
+
* "thinking" "vision"),那是行内 badge,不是 tab。
|
|
2968
|
+
*/
|
|
2969
|
+
type ModalityId = 'chat' | 'image' | 'video' | 'audio' | 'embedding' | 'realtime';
|
|
2970
|
+
/** 模态显示顺序(tab 渲染顺序)。 */
|
|
2971
|
+
declare const MODALITY_ORDER: readonly ModalityId[];
|
|
2972
|
+
/**
|
|
2973
|
+
* 把 basename 归到一个 ``ModalityId``;无匹配 → ``'chat'``(catch-all)。
|
|
2974
|
+
*
|
|
2975
|
+
* 把 chat 作为默认是有意的:99% 用户来 picker 是为了聊天,把不确定的归到 chat
|
|
2976
|
+
* 让他们最容易看到。误归造成"应该在 image tab 里的模型出现在 chat tab"的代价
|
|
2977
|
+
* 远小于"漏归造成模型被完全过滤掉"。
|
|
2978
|
+
*/
|
|
2979
|
+
declare function modalityOf(basename: string): ModalityId;
|
|
2980
|
+
/**
|
|
2981
|
+
* 极轻量级模糊匹配:把 query 和 basename 都归一化后做 substring 检测,
|
|
2982
|
+
* 同时保留"按空格拆词、每个词都要命中"的 AND 语义。
|
|
2983
|
+
*
|
|
2984
|
+
* 选择不引入 fuse.js / fzf:
|
|
2985
|
+
* - 引入第三方搜索库会带来 ~12-30 kB gzip 增量,picker 只过滤 173 项,性价比低;
|
|
2986
|
+
* - 真正影响用户体验的是"输入即筛"而不是"模糊容错";我们的 basename 命名都很规整,
|
|
2987
|
+
* 用户记住前几个字符的概率远高于"打错字"。
|
|
2988
|
+
*
|
|
2989
|
+
* 返回 ``true`` 表示 basename 命中 query。空 query 视为全命中。
|
|
2990
|
+
*/
|
|
2991
|
+
declare function basenameMatchesQuery(basename: string, query: string): boolean;
|
|
2992
|
+
|
|
2712
2993
|
/**
|
|
2713
2994
|
* Model 注册表 / 持久化 helpers
|
|
2714
2995
|
* --------------------------------------------------
|
|
@@ -2767,8 +3048,13 @@ declare function loadLastModelName(agentId: string): ModelChoice;
|
|
|
2767
3048
|
* 写入该 agent 当前选择。``null`` / 空串 → 删除 key(恢复 AUTO)。
|
|
2768
3049
|
* 静默失败(隐私模式 / 配额满都不应让 UI 崩)。
|
|
2769
3050
|
*
|
|
2770
|
-
*
|
|
3051
|
+
* **副作用 1**:第一次写入新 key 时顺便清掉旧的 v1 全局 key 与 yumiai 旧前缀 key,
|
|
2771
3052
|
* 避免不同浏览器下用户看到不同行为。幂等,重复执行无副作用。
|
|
3053
|
+
*
|
|
3054
|
+
* **副作用 2**:非 AUTO 写入同时把 ``name`` push 到 ``recentModels`` 的 FIFO,
|
|
3055
|
+
* 让 picker 顶部"最近"区有数据。AUTO(null)不影响 recent —— recent 是"真实模型"
|
|
3056
|
+
* 的快速回路。这两件事写在同一个函数里是有意为之:调用方(picker / loader 钩子)
|
|
3057
|
+
* 只需关心"用户选了 X",不必各自记得手动同步 recent。
|
|
2772
3058
|
*/
|
|
2773
3059
|
declare function saveLastModelName(agentId: string, name: ModelChoice): void;
|
|
2774
3060
|
|
|
@@ -2781,23 +3067,32 @@ interface ModelPickerProps {
|
|
|
2781
3067
|
compact?: boolean;
|
|
2782
3068
|
/**
|
|
2783
3069
|
* 当前 agent 在后端注册的默认模型 ``name`` —— **仅用于 picker 展示态**。
|
|
2784
|
-
*
|
|
2785
|
-
* 行为分两条线,必须分清:
|
|
2786
|
-
* · **展示态**:``value == null`` 且本字段命中清单时,trigger 文案 + AUTO 行 hint
|
|
2787
|
-
* 都自动定位到该模型,让用户一眼看到"当前 agent 实际会用哪个 model"。
|
|
2788
|
-
* · **发送态**:``value == null`` 时**永远**不带 ``modelOverride``,由后端按 agent 默认走。
|
|
2789
|
-
*
|
|
2790
|
-
* null / undefined / 没命中清单 → picker 退化为"显示『默认模型』占位"。
|
|
3070
|
+
* 见 v1 注释;语义不变。
|
|
2791
3071
|
*/
|
|
2792
3072
|
agentDefaultModelName?: string | null;
|
|
2793
3073
|
/**
|
|
2794
|
-
* 是否允许触发 listModels 请求。默认 true
|
|
2795
|
-
* 游客态(未登录)使用:传 false → 内部 useModels enabled=false 不发请求,
|
|
2796
|
-
* 同时 trigger 走 inert 分支,hover 提示"登录后可选模型"。
|
|
3074
|
+
* 是否允许触发 listModels 请求。默认 true。游客态传 false → 走 inert 占位。
|
|
2797
3075
|
*/
|
|
2798
3076
|
enabled?: boolean;
|
|
3077
|
+
/**
|
|
3078
|
+
* 当前 agent id,用于读取 per-agent "最近使用模型" FIFO。
|
|
3079
|
+
* 不传 → recent 区不显示。
|
|
3080
|
+
*/
|
|
3081
|
+
agentId?: string;
|
|
3082
|
+
/**
|
|
3083
|
+
* 允许展示的 vendor 子集;不传 → 全部。
|
|
3084
|
+
* 留给上层(yumiai-web)做 agent-aware 裁剪:例如纯写代码的 agent 传
|
|
3085
|
+
* ``['openai','anthropic','google']``。picker 自己不感知 agent 业务,
|
|
3086
|
+
* 只做"清单 ∩ 白名单"。空数组 = 不裁剪(不要因为传了空数组而清空整个 picker)。
|
|
3087
|
+
*/
|
|
3088
|
+
vendorWhitelist?: VendorId[];
|
|
3089
|
+
/**
|
|
3090
|
+
* 允许展示的 modality 子集;不传 → 全部。同 ``vendorWhitelist`` 设计。
|
|
3091
|
+
* 例如"图像生成 agent"传 ``['image']`` 让 picker 只露图像模型。
|
|
3092
|
+
*/
|
|
3093
|
+
modalityWhitelist?: ModalityId[];
|
|
2799
3094
|
}
|
|
2800
|
-
declare function ModelPicker({ value, onChange, adapter, disabled, compact, agentDefaultModelName, enabled, }: ModelPickerProps): react_jsx_runtime.JSX.Element;
|
|
3095
|
+
declare function ModelPicker({ value, onChange, adapter, disabled, compact, agentDefaultModelName, enabled, agentId, vendorWhitelist, modalityWhitelist, }: ModelPickerProps): react_jsx_runtime.JSX.Element;
|
|
2801
3096
|
|
|
2802
3097
|
interface UseModelsResult {
|
|
2803
3098
|
items: ModelListItemBasenameGrouped[];
|
|
@@ -2828,6 +3123,13 @@ interface UseAgentDefaultModelResult {
|
|
|
2828
3123
|
/** null = 没查到 / 还没拉 / adapter 不支持 / 拉失败(任何一种) */
|
|
2829
3124
|
info: AgentDefaultModelInfo | null;
|
|
2830
3125
|
loading: boolean;
|
|
3126
|
+
/**
|
|
3127
|
+
* 显式撬开缓存重拉。
|
|
3128
|
+
* - 不传参 → 刷当前 agentId;
|
|
3129
|
+
* - 传 ``aid`` → 定向刷指定 agent(用于"我刚通过别的渠道改了 agent-x 配置")。
|
|
3130
|
+
* 永不抛;失败被静默吞,配合 cache 不污染策略,对调用方就是"尽力而为"。
|
|
3131
|
+
*/
|
|
3132
|
+
refresh: (aid?: string) => Promise<void>;
|
|
2831
3133
|
}
|
|
2832
3134
|
interface UseAgentDefaultModelOptions {
|
|
2833
3135
|
/**
|
|
@@ -2842,6 +3144,57 @@ interface UseAgentDefaultModelOptions {
|
|
|
2842
3144
|
}
|
|
2843
3145
|
declare function useAgentDefaultModel(adapter: ChatWidgetAdapter, agentId: string | undefined, options?: UseAgentDefaultModelOptions): UseAgentDefaultModelResult;
|
|
2844
3146
|
|
|
3147
|
+
/**
|
|
3148
|
+
* Per-agent 最近使用模型 FIFO 持久化。
|
|
3149
|
+
*
|
|
3150
|
+
* 与 ``modelRegistry.ts::loadLastModelName / saveLastModelName`` 的关系:
|
|
3151
|
+
* - ``loadLastModelName`` 维持 ``ModelChoice``(单值,AUTO=null)—— 那是 picker
|
|
3152
|
+
* "上一次选了什么"的语义,进 composer 时直接复用;
|
|
3153
|
+
* - 本模块维持的是 ``string[]``(最多 ``MAX_RECENT`` 条,最近使用在最前),
|
|
3154
|
+
* 供 picker 把"频繁用的 N 个"置顶展示,让 173 个 basename 不必每次都扫一遍。
|
|
3155
|
+
*
|
|
3156
|
+
* 关键约束:
|
|
3157
|
+
* - **AUTO 不进 recent**:null / 空串不写入;recent 是给"真实模型"用的快速回路,
|
|
3158
|
+
* AUTO 永远在 picker 头部独占一行,没必要去 recent 占名额。
|
|
3159
|
+
* - **per-agent 分桶**:不同 agent 任务不同(写代码 / 看图 / 翻译),共享 recent
|
|
3160
|
+
* 会污染。key = ``chat_widget_recent_models:${agentId}``。
|
|
3161
|
+
* - **静默失败**:localStorage 不可用(隐私模式、配额满)→ 全部 op 返回空数组,
|
|
3162
|
+
* 不抛、不污染 UI 主链路。
|
|
3163
|
+
*
|
|
3164
|
+
* 不在这里做:
|
|
3165
|
+
* - 不做"按使用频次排序"(LRU 更复杂、收益边际)—— 严格 FIFO + dedup 已经覆盖
|
|
3166
|
+
* "用户最近几个高频选择"95% 的场景;
|
|
3167
|
+
* - 不做跨设备同步——那是 yumiai-web 自己的事(如果未来要做),SDK 这一层
|
|
3168
|
+
* 只承诺浏览器本地。
|
|
3169
|
+
*/
|
|
3170
|
+
/** 默认最大保存条数;调用方可在 ``pushRecent`` / ``loadRecent`` 时覆盖。 */
|
|
3171
|
+
declare const MAX_RECENT = 5;
|
|
3172
|
+
/**
|
|
3173
|
+
* 读取该 agent 的最近使用模型列表(最近在前)。
|
|
3174
|
+
* 永远返回数组,失败 / 空 → ``[]``。
|
|
3175
|
+
*/
|
|
3176
|
+
declare function loadRecent(agentId: string, max?: number): string[];
|
|
3177
|
+
/**
|
|
3178
|
+
* 把 ``name`` 推到 recent 列表头部。
|
|
3179
|
+
*
|
|
3180
|
+
* 语义:
|
|
3181
|
+
* - 空串 / null → no-op(不破坏现有列表);AUTO 选择不进 recent;
|
|
3182
|
+
* - 已存在则提到头部(dedup);
|
|
3183
|
+
* - 超出 cap 的尾部自动 drop。
|
|
3184
|
+
*
|
|
3185
|
+
* 失败静默。
|
|
3186
|
+
*/
|
|
3187
|
+
declare function pushRecent(agentId: string, name: string | null | undefined, max?: number): void;
|
|
3188
|
+
/** 清空该 agent 的 recent 列表。 */
|
|
3189
|
+
declare function clearRecent(agentId: string): void;
|
|
3190
|
+
|
|
3191
|
+
declare const I18nContext: React$1.Context<ChatWidgetMessages>;
|
|
3192
|
+
declare function useChatWidgetI18n(): {
|
|
3193
|
+
messages: ChatWidgetMessages;
|
|
3194
|
+
t: (key: keyof ChatWidgetMessages, params?: Record<string, string | number>) => string;
|
|
3195
|
+
locale: ChatWidgetLocale;
|
|
3196
|
+
};
|
|
3197
|
+
|
|
2845
3198
|
/**
|
|
2846
3199
|
* DefaultComposer — SDK 默认的对话输入组件。
|
|
2847
3200
|
*
|
|
@@ -2922,6 +3275,22 @@ interface DefaultComposerProps {
|
|
|
2922
3275
|
* 默认 true;游客态宿主可置 false 完全跳过请求。
|
|
2923
3276
|
*/
|
|
2924
3277
|
enableAgentDefaultModelLookup?: boolean;
|
|
3278
|
+
/**
|
|
3279
|
+
* ModelPicker agent-aware 裁剪 —— 仅展示这些 vendor 家族。
|
|
3280
|
+
* 不传 / 空数组 → 不裁剪(picker 展示全部 vendor)。
|
|
3281
|
+
*
|
|
3282
|
+
* 例:纯写代码 agent 传 ``['openai','anthropic','google']``。
|
|
3283
|
+
* 由宿主(yumiai-web)按当前 agent 元数据决定,SDK 这一层不做业务判断。
|
|
3284
|
+
*/
|
|
3285
|
+
modelVendorWhitelist?: VendorId[];
|
|
3286
|
+
/**
|
|
3287
|
+
* ModelPicker 能力轴裁剪 —— 仅展示这些 modality(chat/image/video/audio/embedding/realtime)。
|
|
3288
|
+
* 不传 / 空数组 → 不裁剪。
|
|
3289
|
+
*
|
|
3290
|
+
* 例:"图像生成 agent" 传 ``['image']`` 让 picker 只露图像模型,
|
|
3291
|
+
* 避免用户在 sora/veo/imagen 中误选了普通对话模型。
|
|
3292
|
+
*/
|
|
3293
|
+
modelModalityWhitelist?: ModalityId[];
|
|
2925
3294
|
}
|
|
2926
3295
|
declare const DefaultComposer: React__default.FC<DefaultComposerProps>;
|
|
2927
3296
|
|
|
@@ -3137,6 +3506,20 @@ declare class DefaultJetAgentsAdapter implements ChatWidgetAdapter {
|
|
|
3137
3506
|
* 后端按 agent 注册的默认 ``ModelMeta`` 走(与历史完全一致)。
|
|
3138
3507
|
*/
|
|
3139
3508
|
modelOverride?: ModelOverride | null;
|
|
3509
|
+
/**
|
|
3510
|
+
* JETP-multimodal: 目标模型能力位(由 Composer 端的 ``useModelCapabilities``
|
|
3511
|
+
* 解析得到)。仅决定**附件折成哪种协议块**,不参与 accept/reject。
|
|
3512
|
+
*
|
|
3513
|
+
* - ``imageInput`` → image/* 折成 ``{type:'image_url', uri:<resource_id>, content:<URL>}``
|
|
3514
|
+
* - ``audioInput`` → audio/* 折成 ``{type:'audio', uri:<resource_id>, content:<URL>}``
|
|
3515
|
+
* - ``imageInput || videoInput`` → video/* 折成 ``{type:'video_url', uri:<resource_id>, content:<URL>}``
|
|
3516
|
+
* (视频双轨:model-lake 端会按 vendor spec 决策原生 vs 抽帧,所以只要
|
|
3517
|
+
* 模型支持图像即可走视频协议块。详见 RFC-020 T8)
|
|
3518
|
+
*
|
|
3519
|
+
* 缺省 / 缺失 → 不组装多模态块,附件仅以"文本 marker"形态参与文字 turn,
|
|
3520
|
+
* KG / 工作空间工具 / agent 文字阅读仍可消费 resourceId,不会因此 422。
|
|
3521
|
+
*/
|
|
3522
|
+
modelCapabilities?: ModelCapabilities | null;
|
|
3140
3523
|
}): object;
|
|
3141
3524
|
/**
|
|
3142
3525
|
* Convert raw JetAgents Notification SSE to ChatWidget flat SSEMessage format.
|
|
@@ -3169,6 +3552,49 @@ declare class DefaultJetAgentsAdapter implements ChatWidgetAdapter {
|
|
|
3169
3552
|
listModels<TGroup extends 'basename' | 'name' | 'none' = 'basename'>(params?: ListModelsParams & {
|
|
3170
3553
|
groupBy?: TGroup;
|
|
3171
3554
|
}): Promise<ListModelsResponse<TGroup extends 'basename' ? ModelListItemBasenameGrouped : TGroup extends 'name' ? ModelListItemGrouped : ModelListItemRaw>>;
|
|
3555
|
+
/**
|
|
3556
|
+
* 拉取模型"能力位"。**走 hip-server**,端点 ``GET /api/v1/models/capabilities``。
|
|
3557
|
+
*
|
|
3558
|
+
* 透传规则:
|
|
3559
|
+
* - 不传 ``modelIds`` → query 不带 ``model_ids``,hip 端返回全表;
|
|
3560
|
+
* - 传 ``modelIds`` → 拼成 ``?model_ids=a/x,b/y``(CSV 形态,与 hip 端约定一致);
|
|
3561
|
+
* - hip 端保证未命中的 id 实化为全 false(保守门控),所以前端不用兜底。
|
|
3562
|
+
*
|
|
3563
|
+
* 错误语义:与 ``listModels`` 一样**抛错**而不是返回空 map:
|
|
3564
|
+
* "未知 → false" 是危险的撒谎;让上层 ``useModelCapabilities`` 自己决定
|
|
3565
|
+
* "拉不到能力位 → 整个多模态入口隐藏"的兜底,而不是把"all false"和
|
|
3566
|
+
* "真的 all false(极端罕见)"混为一谈。
|
|
3567
|
+
*
|
|
3568
|
+
* hipBaseUrl 缺省 → 走相对 URL,开发态由 vite proxy / 生产态由网关接管,
|
|
3569
|
+
* 与本类内其他 hip 调用一致。
|
|
3570
|
+
*/
|
|
3571
|
+
listModelCapabilities(modelIds?: string[]): Promise<ListModelCapabilitiesResponse>;
|
|
3572
|
+
/**
|
|
3573
|
+
* JETP-multimodal: 批量获取一组 resource_id 的访问 URL + MIME + 过期时刻。
|
|
3574
|
+
*
|
|
3575
|
+
* 通道:``GET /api/knowledge/workspace/files``(KG)。
|
|
3576
|
+
* - ``file_ids=<rid>`` 可重复,FastAPI 解析成 ``list[str]``;
|
|
3577
|
+
* - ``generate_urls=true`` 让 KG 在响应里填 ``download_url`` / ``preview_url`` /
|
|
3578
|
+
* ``url_expires_in``(秒),并填 ``mime_type``;
|
|
3579
|
+
* - ``access_mode=private`` 拿预签名 URL(默认 1h TTL)。
|
|
3580
|
+
*
|
|
3581
|
+
* 取舍:
|
|
3582
|
+
* - 不依赖 sessionId 也能查(``file_ids`` 是 KG 全局 id),但接口要求 KG 端
|
|
3583
|
+
* 校验 principal 鉴权;保留 ``sessionId`` 参数让未来如果 KG 端引入
|
|
3584
|
+
* session 维度的 ACL 仍能用同一签名。
|
|
3585
|
+
* - 不区分 download vs. preview:图片优先 ``preview_url``(KG 会针对图片返回
|
|
3586
|
+
* 适合 inline 展示的格式),缺失才 fallback 到 ``download_url``。
|
|
3587
|
+
* - 单次请求 file_ids 上限:默认 ``page_size=20`` 已经够用;
|
|
3588
|
+
* 真有 >20 张图的场景再拆批。当前不做拆批以保持实现简单。
|
|
3589
|
+
*
|
|
3590
|
+
* 失败:上游 5xx / 404 抛 ``ChatWidgetNetworkError``;
|
|
3591
|
+
* 未命中的 rid 不在返回 Map 里(让 hook 自行决定降级 / 重试)。
|
|
3592
|
+
*/
|
|
3593
|
+
getResourceUrls(sessionId: number, resourceIds: string[]): Promise<Map<string, {
|
|
3594
|
+
url: string;
|
|
3595
|
+
mimeType?: string;
|
|
3596
|
+
expiresAtMs?: number;
|
|
3597
|
+
}>>;
|
|
3172
3598
|
/**
|
|
3173
3599
|
* 拉取 agent 在后端注册的默认模型,仅供 picker 展示态使用。
|
|
3174
3600
|
*
|
|
@@ -3265,13 +3691,6 @@ declare class InvalidClientIdError extends Error {
|
|
|
3265
3691
|
constructor(message: string, reason: 'missing' | 'session_not_ready' | 'allocation_failed' | 'legacy_main' | 'legacy_format' | 'session_forbidden', sessionId?: string | number | null | undefined);
|
|
3266
3692
|
}
|
|
3267
3693
|
|
|
3268
|
-
declare const I18nContext: React$1.Context<ChatWidgetMessages>;
|
|
3269
|
-
declare function useChatWidgetI18n(): {
|
|
3270
|
-
messages: ChatWidgetMessages;
|
|
3271
|
-
t: (key: keyof ChatWidgetMessages, params?: Record<string, string | number>) => string;
|
|
3272
|
-
locale: ChatWidgetLocale;
|
|
3273
|
-
};
|
|
3274
|
-
|
|
3275
3694
|
declare function organizeMessagesByLevel(messages: Round['messages']): {
|
|
3276
3695
|
rootMessages: Round['messages'];
|
|
3277
3696
|
childrenMap: Map<string, Round['messages']>;
|
|
@@ -3661,4 +4080,538 @@ declare function prepareJsonRenderSpec<T = Record<string, unknown>>(raw: unknown
|
|
|
3661
4080
|
*/
|
|
3662
4081
|
declare function extractKicadSexprByUuid(content: string, uuid: string): string | null;
|
|
3663
4082
|
|
|
3664
|
-
|
|
4083
|
+
/**
|
|
4084
|
+
* JETP-084 — RAG paragraph-level provenance protocol types (frontend).
|
|
4085
|
+
*
|
|
4086
|
+
* These types mirror the backend Pydantic models in
|
|
4087
|
+
* `jetagents/runtime/provenance/types.py`. They are the *single source of
|
|
4088
|
+
* truth* for the cross-system marker / sidecar / citation_context contract on
|
|
4089
|
+
* the chat-widget side.
|
|
4090
|
+
*
|
|
4091
|
+
* Cross-protocol fields use strict, narrow types so that violations surface
|
|
4092
|
+
* at type-check time. Backwards-compatible / cosmetic fields are widened where
|
|
4093
|
+
* spec allows.
|
|
4094
|
+
*/
|
|
4095
|
+
/** File kinds the protocol distinguishes. Backend mirror: `Chunk.file_type`. */
|
|
4096
|
+
type RagFileType = 'markdown' | 'text' | 'code' | 'pdf' | 'word';
|
|
4097
|
+
/** Coarse block classification used by the chunker. */
|
|
4098
|
+
type RagBlockType = 'text' | 'image' | 'table' | 'equation';
|
|
4099
|
+
/**
|
|
4100
|
+
* `[@§N:rid_short](kw1 kw2)` — the marker the LLM emits in stream tokens.
|
|
4101
|
+
*
|
|
4102
|
+
* After the FSM extracts and validates a marker it produces a `MarkerEnvelope`
|
|
4103
|
+
* which is the canonical in-memory representation handed to UI components.
|
|
4104
|
+
*/
|
|
4105
|
+
interface MarkerEnvelope {
|
|
4106
|
+
/** chunk_id `§N` — 1-indexed, ≤ file.total_chunks. */
|
|
4107
|
+
n: number;
|
|
4108
|
+
/** Short resource id (fixed 5 [a-z0-9] chars, v4 sha1 hash). */
|
|
4109
|
+
rid_short: string;
|
|
4110
|
+
/** Keywords used for downstream fuzzy search; LLM-supplied, may be empty. */
|
|
4111
|
+
keywords: string[];
|
|
4112
|
+
/** Raw marker text as parsed, useful for fallback rendering & debug. */
|
|
4113
|
+
raw: string;
|
|
4114
|
+
}
|
|
4115
|
+
/** Per-file entry inside a `citation_context` event. */
|
|
4116
|
+
interface CitationContextFile {
|
|
4117
|
+
/** Stable, globally unique resource id (long form). */
|
|
4118
|
+
rid: string;
|
|
4119
|
+
/** Short alias assigned by the session-scoped pool (JETP-084 v3). */
|
|
4120
|
+
rid_short: string;
|
|
4121
|
+
/** Commit the chunks were computed against. */
|
|
4122
|
+
git_commit_hash: string;
|
|
4123
|
+
/** Human-friendly file name (e.g. `datasheet.pdf`). */
|
|
4124
|
+
file_name: string;
|
|
4125
|
+
/**
|
|
4126
|
+
* Git path of the original (user-facing) file inside the workspace
|
|
4127
|
+
* repo. Added in JETP-084 v3 so the UI can render path information
|
|
4128
|
+
* without an extra lookup. May be `''` when emitted by a transitional
|
|
4129
|
+
* backend mid-rollout.
|
|
4130
|
+
*/
|
|
4131
|
+
file_path?: string;
|
|
4132
|
+
file_type: RagFileType;
|
|
4133
|
+
/** Number of chunks in the sidecar; FSM uses this to validate `§N`. */
|
|
4134
|
+
total_chunks: number;
|
|
4135
|
+
}
|
|
4136
|
+
/**
|
|
4137
|
+
* JETP-084 v3 — citation_context SSE notification payload.
|
|
4138
|
+
*
|
|
4139
|
+
* v3 dropped the `message_id` field: the event is now emitted by the
|
|
4140
|
+
* read tool independent of any LLM message and carries the **full
|
|
4141
|
+
* session-known files list** every time. Frontends maintain a single
|
|
4142
|
+
* session-scoped index keyed by `rid_short`.
|
|
4143
|
+
*/
|
|
4144
|
+
interface CitationContextEvent {
|
|
4145
|
+
files: CitationContextFile[];
|
|
4146
|
+
}
|
|
4147
|
+
/** A single paragraph-level chunk inside `chunks.json`. */
|
|
4148
|
+
interface ChunksSidecarChunk {
|
|
4149
|
+
/** 1-indexed chunk number; matches the §N in markers. */
|
|
4150
|
+
n: number;
|
|
4151
|
+
/** Heading breadcrumb, root first. */
|
|
4152
|
+
heading_path: string[];
|
|
4153
|
+
block_type: RagBlockType;
|
|
4154
|
+
/**
|
|
4155
|
+
* 1-indexed inclusive line range inside `.extracted.md`. `null` when the
|
|
4156
|
+
* file type / block type cannot express it (e.g. PDF body images).
|
|
4157
|
+
*/
|
|
4158
|
+
line_range: [number, number] | null;
|
|
4159
|
+
/** 0-indexed half-open character range inside `.extracted.md`. */
|
|
4160
|
+
char_range: [number, number];
|
|
4161
|
+
/** Verbatim paragraph text rendered in the Popover. */
|
|
4162
|
+
paragraph_text: string;
|
|
4163
|
+
/** Approximate token count (rough heuristic). */
|
|
4164
|
+
token_count: number;
|
|
4165
|
+
/** 0-indexed PDF page, `null` for non-PDF files. */
|
|
4166
|
+
page_idx: number | null;
|
|
4167
|
+
}
|
|
4168
|
+
/** The `chunks.json` sidecar payload. */
|
|
4169
|
+
interface ChunksSidecar {
|
|
4170
|
+
resource_id: string;
|
|
4171
|
+
file_type: RagFileType;
|
|
4172
|
+
git_commit_hash: string;
|
|
4173
|
+
/** SHA-256 of the source extracted markdown; guards stale chunk drift. */
|
|
4174
|
+
source_hash: string;
|
|
4175
|
+
total_chunks: number;
|
|
4176
|
+
chunks: ChunksSidecarChunk[];
|
|
4177
|
+
}
|
|
4178
|
+
/** Status of a sidecar entry across the cache + UI lifecycle. */
|
|
4179
|
+
type SidecarStatus = 'idle' | 'loading' | 'ready' | 'missing' | 'stale';
|
|
4180
|
+
/**
|
|
4181
|
+
* Compile-time regex for the marker grammar. Mirrors backend `MarkerEnvelope`
|
|
4182
|
+
* field validators. Exposed so other modules (FSM tests, debug tooling) can
|
|
4183
|
+
* reuse without reinventing the pattern.
|
|
4184
|
+
*/
|
|
4185
|
+
declare const MARKER_REGEX: RegExp;
|
|
4186
|
+
|
|
4187
|
+
/**
|
|
4188
|
+
* JETP-084 — Streaming Marker FSM.
|
|
4189
|
+
*
|
|
4190
|
+
* Consumes raw stream tokens (any chunking) character-by-character and emits
|
|
4191
|
+
* `text` / `placeholder` / `flush` / `chip` events. Designed to be cheap (O(N)
|
|
4192
|
+
* single pass), allocation-light, and to never throw on bad input — every
|
|
4193
|
+
* failure mode degrades to plain text.
|
|
4194
|
+
*
|
|
4195
|
+
* State machine (see `chat-widget/02_streaming_fsm.md`):
|
|
4196
|
+
*
|
|
4197
|
+
* NORMAL ─ "[@§" ─► BUFFERING ─ ")" ─► PARSE ─ ok ─► EMIT_CHIP ─► NORMAL
|
|
4198
|
+
* │ │
|
|
4199
|
+
* └─ timeout/overflow/nested ──► flush as text ─► NORMAL
|
|
4200
|
+
* │
|
|
4201
|
+
* └─ regex / validation fail ──► flush ─► NORMAL
|
|
4202
|
+
*
|
|
4203
|
+
* The FSM keeps no React state and is safe to instantiate per-message.
|
|
4204
|
+
*/
|
|
4205
|
+
|
|
4206
|
+
/** State labels are exported for tests / debug overlays. */
|
|
4207
|
+
type FsmState = 'NORMAL' | 'BUFFERING' | 'PARSE' | 'EMIT_CHIP';
|
|
4208
|
+
/** Discriminated emit event. */
|
|
4209
|
+
type FsmEmit = {
|
|
4210
|
+
type: 'text';
|
|
4211
|
+
text: string;
|
|
4212
|
+
} | {
|
|
4213
|
+
type: 'placeholder';
|
|
4214
|
+
} | {
|
|
4215
|
+
type: 'flush';
|
|
4216
|
+
} | {
|
|
4217
|
+
type: 'chip';
|
|
4218
|
+
marker: MarkerEnvelope;
|
|
4219
|
+
};
|
|
4220
|
+
interface FsmConfig {
|
|
4221
|
+
/** Citation context for the current message; usually from SSE or persisted msg field. */
|
|
4222
|
+
citationContext: CitationContextFile[];
|
|
4223
|
+
/** Buffer timeout in ms. Default 3000. Set to 0 to disable the timer. */
|
|
4224
|
+
bufferTimeoutMs?: number;
|
|
4225
|
+
/** Max buffer length before forced flush. Default 500. */
|
|
4226
|
+
bufferMaxChars?: number;
|
|
4227
|
+
emit: (event: FsmEmit) => void;
|
|
4228
|
+
}
|
|
4229
|
+
declare class StreamingMarkerFSM {
|
|
4230
|
+
private state;
|
|
4231
|
+
private buffer;
|
|
4232
|
+
private timeoutHandle;
|
|
4233
|
+
private readonly bufferTimeoutMs;
|
|
4234
|
+
private readonly bufferMaxChars;
|
|
4235
|
+
private readonly emit;
|
|
4236
|
+
private citationContext;
|
|
4237
|
+
constructor(config: FsmConfig);
|
|
4238
|
+
/** Refresh the citation context mid-stream (e.g. event arrives after stream began). */
|
|
4239
|
+
setCitationContext(files: CitationContextFile[]): void;
|
|
4240
|
+
/** Internal state, exposed for tests + debugging. Treat as read-only. */
|
|
4241
|
+
getState(): FsmState;
|
|
4242
|
+
/** Receive a chunk of arbitrary length; processed byte-by-byte. */
|
|
4243
|
+
feed(chunk: string): void;
|
|
4244
|
+
/** Call when the stream ends so any partial buffer is flushed as plain text. */
|
|
4245
|
+
end(): void;
|
|
4246
|
+
/** Force-flush + tear down timers. Safe to call multiple times. */
|
|
4247
|
+
dispose(): void;
|
|
4248
|
+
private feedChar;
|
|
4249
|
+
private handleNormal;
|
|
4250
|
+
private enterBuffering;
|
|
4251
|
+
private handleBuffering;
|
|
4252
|
+
private tryParse;
|
|
4253
|
+
private flushBufferAsText;
|
|
4254
|
+
private armTimer;
|
|
4255
|
+
private clearTimer;
|
|
4256
|
+
}
|
|
4257
|
+
|
|
4258
|
+
/**
|
|
4259
|
+
* JETP-084 — Sidecar LRU cache + batch preloader + React hook.
|
|
4260
|
+
*
|
|
4261
|
+
* Memory model:
|
|
4262
|
+
* - Single browser-tab in-memory `Map<key, CacheEntry>`; insertion order is
|
|
4263
|
+
* LRU order (oldest first).
|
|
4264
|
+
* - On `get` we re-insert to bump recency.
|
|
4265
|
+
* - On `set` we evict from the front until size ≤ MAX_ENTRIES.
|
|
4266
|
+
*
|
|
4267
|
+
* Network model:
|
|
4268
|
+
* - `preloadSidecars` groups requested (rid, commit) tuples by commit and
|
|
4269
|
+
* fires one batched fetch per commit. Failures mark each affected entry as
|
|
4270
|
+
* `missing` so the UI never spins forever.
|
|
4271
|
+
* - `useSidecar` is a thin reactive layer on top via `useSyncExternalStore`.
|
|
4272
|
+
*/
|
|
4273
|
+
|
|
4274
|
+
interface CacheEntry {
|
|
4275
|
+
status: SidecarStatus;
|
|
4276
|
+
data?: ChunksSidecar;
|
|
4277
|
+
/** Tracks an in-flight request; used to dedupe parallel hover requests. */
|
|
4278
|
+
promise?: Promise<void>;
|
|
4279
|
+
}
|
|
4280
|
+
interface BatchFetcherResponse {
|
|
4281
|
+
/** Keyed by `rid`. */
|
|
4282
|
+
items: Record<string, ChunksSidecar>;
|
|
4283
|
+
/** Resource ids that have no sidecar at all (404 equivalent). */
|
|
4284
|
+
missing: string[];
|
|
4285
|
+
/** Resource ids whose sidecar commit ≠ requested commit. */
|
|
4286
|
+
stale: string[];
|
|
4287
|
+
}
|
|
4288
|
+
interface BatchFetcher {
|
|
4289
|
+
(params: {
|
|
4290
|
+
ids: string;
|
|
4291
|
+
commit: string;
|
|
4292
|
+
}): Promise<BatchFetcherResponse>;
|
|
4293
|
+
}
|
|
4294
|
+
interface SidecarSnapshot {
|
|
4295
|
+
status: SidecarStatus;
|
|
4296
|
+
sidecar: ChunksSidecar | undefined;
|
|
4297
|
+
}
|
|
4298
|
+
/** Public — return entry and bump LRU recency. Returns `undefined` if miss. */
|
|
4299
|
+
declare function getCachedSidecar(rid: string, commit: string): CacheEntry | undefined;
|
|
4300
|
+
/** Public — write/replace an entry. Triggers notify + LRU eviction. */
|
|
4301
|
+
declare function setCachedSidecar(rid: string, commit: string, entry: CacheEntry): void;
|
|
4302
|
+
/**
|
|
4303
|
+
* Preload sidecars for the given `(rid, commit)` tuples. Skips already-ready
|
|
4304
|
+
* and in-flight entries. Groups by commit so a single message with N citations
|
|
4305
|
+
* from a single commit ⇒ exactly 1 network request.
|
|
4306
|
+
*/
|
|
4307
|
+
declare function preloadSidecars(files: Array<{
|
|
4308
|
+
rid: string;
|
|
4309
|
+
commit: string;
|
|
4310
|
+
}>, fetcher: BatchFetcher): Promise<void>;
|
|
4311
|
+
/** Default fetcher hitting `/api/sidecar`. Override in tests / non-browser contexts. */
|
|
4312
|
+
declare const defaultFetcher: BatchFetcher;
|
|
4313
|
+
declare function setSidecarFetcher(fetcher: BatchFetcher | null): void;
|
|
4314
|
+
/**
|
|
4315
|
+
* Reactive accessor for a single (rid, commit) entry. Triggers a lazy fetch on
|
|
4316
|
+
* `idle` (e.g. first hover). Returns a stable snapshot identity for the same
|
|
4317
|
+
* underlying entry so React can skip re-renders.
|
|
4318
|
+
*/
|
|
4319
|
+
declare function useSidecar(rid: string, commit: string): SidecarSnapshot;
|
|
4320
|
+
|
|
4321
|
+
/**
|
|
4322
|
+
* JETP-084 v3 (Phase 10, 2026-05-27) — Session-scoped citation context.
|
|
4323
|
+
*
|
|
4324
|
+
* v3 ditches the v1/v2 per-message store entirely. The backend emits
|
|
4325
|
+
* a single `citation_context` SSE notification from the *read* tool
|
|
4326
|
+
* carrying the full session-known files list (no `message_id`); the
|
|
4327
|
+
* frontend maintains one global `rid_short → file` index for the
|
|
4328
|
+
* lifetime of the open session and resolves chips against it.
|
|
4329
|
+
*
|
|
4330
|
+
* Lifecycle:
|
|
4331
|
+
* - SSE callback → `ingestCitationContext(files)` → merges into the
|
|
4332
|
+
* index and notifies subscribers.
|
|
4333
|
+
* - Session switch / sign-out → `__resetForSessionSwitch()` wipes
|
|
4334
|
+
* the index so cross-session bleed-through is impossible.
|
|
4335
|
+
* - UI chips: `useFileByRidShort(ridShort)` returns the matching
|
|
4336
|
+
* file or null; no messageId argument.
|
|
4337
|
+
*
|
|
4338
|
+
* Why this is the correct shape (vs v1/v2 per-message):
|
|
4339
|
+
* - The backend pool is session-scoped (see
|
|
4340
|
+
* `jetagents/runtime/turn/citation_pool.py`), so each emit already
|
|
4341
|
+
* carries every file the session has surfaced. Maintaining a parallel
|
|
4342
|
+
* per-message index on the frontend just multiplies the failure modes
|
|
4343
|
+
* (ID alignment between LLM message IDs and SSE deliveries was the
|
|
4344
|
+
* entire v2 chip-render bug).
|
|
4345
|
+
* - The rid_short identifier is deterministic per (session, rid) on
|
|
4346
|
+
* the backend, so any frontend resolution that finds a match is
|
|
4347
|
+
* guaranteed to be correct as long as the session matches.
|
|
4348
|
+
*
|
|
4349
|
+
* Spec: `doc/proposals/JETP-084-rag-paragraph-provenance/chat-widget/05_sidecar_cache.md` §5–§6.
|
|
4350
|
+
*/
|
|
4351
|
+
|
|
4352
|
+
/**
|
|
4353
|
+
* Ingest a v3 citation_context payload. The full session-known
|
|
4354
|
+
* `files` list is merged into the global index; entries are upserted
|
|
4355
|
+
* by `rid_short` (the deterministic identifier). Stale rid_shorts not
|
|
4356
|
+
* present in the new payload are intentionally kept around — the LLM
|
|
4357
|
+
* may still cite them from memory and the chip should resolve. The
|
|
4358
|
+
* backend's session-level pool TTL / LRU enforces the upper bound.
|
|
4359
|
+
*/
|
|
4360
|
+
declare function ingestCitationContext(files: CitationContextFile[]): void;
|
|
4361
|
+
/** @deprecated v1/v2 per-message store removed. v3 ignores `messageId`. */
|
|
4362
|
+
declare function persistFromMessage(_messageId: string, files: CitationContextFile[], options?: {
|
|
4363
|
+
preload?: boolean;
|
|
4364
|
+
}): void;
|
|
4365
|
+
/** @deprecated v1/v2 hook — use {@link useFileByRidShort} (no messageId arg). */
|
|
4366
|
+
declare function useCitationContext(_messageId: string): {
|
|
4367
|
+
files: CitationContextFile[];
|
|
4368
|
+
};
|
|
4369
|
+
|
|
4370
|
+
/**
|
|
4371
|
+
* JETP-084 — Popover content rendered on Chip hover/focus.
|
|
4372
|
+
*
|
|
4373
|
+
* Pure presentational; routing into the FileViewer happens via the
|
|
4374
|
+
* `onOpenInViewer` callback supplied by the parent.
|
|
4375
|
+
*
|
|
4376
|
+
* State map:
|
|
4377
|
+
* loading → <PopoverSkeleton/>
|
|
4378
|
+
* ready → header / breadcrumb / paragraph + (stale chip if stale)
|
|
4379
|
+
* stale → same as ready but with the "⚠ file updated" banner
|
|
4380
|
+
* missing → <PopoverMissing/>
|
|
4381
|
+
*/
|
|
4382
|
+
|
|
4383
|
+
interface PopoverProps {
|
|
4384
|
+
status: SidecarStatus;
|
|
4385
|
+
/** Chunk identified by the marker; undefined when the sidecar lacks the §N. */
|
|
4386
|
+
chunk: ChunksSidecarChunk | undefined;
|
|
4387
|
+
file: CitationContextFile;
|
|
4388
|
+
marker: MarkerEnvelope;
|
|
4389
|
+
onOpenInViewer: () => void;
|
|
4390
|
+
/** UI strings — defaulted to Chinese to match existing chat-widget copy. */
|
|
4391
|
+
i18n?: PopoverI18n;
|
|
4392
|
+
}
|
|
4393
|
+
interface PopoverI18n {
|
|
4394
|
+
openInViewer: string;
|
|
4395
|
+
staleWarning: string;
|
|
4396
|
+
missingTitle: string;
|
|
4397
|
+
missingHint: string;
|
|
4398
|
+
loadingHint: string;
|
|
4399
|
+
}
|
|
4400
|
+
declare const Popover: React$1.FC<PopoverProps>;
|
|
4401
|
+
/**
|
|
4402
|
+
* Highlight every keyword occurrence in `text`. Matching rules:
|
|
4403
|
+
* - case-insensitive
|
|
4404
|
+
* - longest first (so "工作温度" wins over "工作")
|
|
4405
|
+
* - simple substring; no word-boundary, no overlap
|
|
4406
|
+
* - safe against regex meta-chars (keyword is escaped)
|
|
4407
|
+
* - empty / zero-hit keywords ⇒ rendered text unchanged
|
|
4408
|
+
*/
|
|
4409
|
+
declare const HighlightedText: React$1.FC<{
|
|
4410
|
+
text: string;
|
|
4411
|
+
keywords: string[];
|
|
4412
|
+
}>;
|
|
4413
|
+
|
|
4414
|
+
/**
|
|
4415
|
+
* JETP-084 — Inline Chip rendered for a parsed `[@§N:rid_short](kw...)` marker.
|
|
4416
|
+
*
|
|
4417
|
+
* Visual: `📎 file_name › leaf_heading`. Click ⇒ open in FileViewer.
|
|
4418
|
+
* Hover/focus ⇒ show `<Popover/>` (lazy-fetched sidecar).
|
|
4419
|
+
*
|
|
4420
|
+
* The Chip intentionally avoids exposing `§N` in the label (UX decision).
|
|
4421
|
+
*/
|
|
4422
|
+
|
|
4423
|
+
interface ChipProps {
|
|
4424
|
+
marker: MarkerEnvelope;
|
|
4425
|
+
file: CitationContextFile;
|
|
4426
|
+
onOpenInViewer?: (file: CitationContextFile, marker: MarkerEnvelope) => void;
|
|
4427
|
+
/** Delay (ms) before Popover opens on hover; default 200. */
|
|
4428
|
+
openDelay?: number;
|
|
4429
|
+
className?: string;
|
|
4430
|
+
popoverI18n?: PopoverI18n;
|
|
4431
|
+
}
|
|
4432
|
+
declare const Chip: React$1.FC<ChipProps>;
|
|
4433
|
+
|
|
4434
|
+
/**
|
|
4435
|
+
* JETP-084 — React hook wrapping `StreamingMarkerFSM` for use inside message
|
|
4436
|
+
* components. The hook converts FSM emit events into an ordered list of
|
|
4437
|
+
* `Segment` records which can be mapped 1:1 to JSX (`<span>` for text,
|
|
4438
|
+
* `<Chip>` for chip, placeholder skeleton for in-flight marker).
|
|
4439
|
+
*
|
|
4440
|
+
* Design notes:
|
|
4441
|
+
* - The FSM is owned by a `useRef` so it survives re-renders without
|
|
4442
|
+
* re-instantiation.
|
|
4443
|
+
* - Segments are accumulated in a ref-backed list; we surface them via a
|
|
4444
|
+
* React state bumped on each event to trigger re-render exactly once per
|
|
4445
|
+
* micro-batch.
|
|
4446
|
+
* - Citation context updates are forwarded via `fsm.setCitationContext` so
|
|
4447
|
+
* late-arriving SSE events can retroactively validate buffered markers.
|
|
4448
|
+
* - The hook returns idempotent `feed` / `end` / `reset` functions for
|
|
4449
|
+
* callers to wire into their SSE stream.
|
|
4450
|
+
*/
|
|
4451
|
+
|
|
4452
|
+
type Segment = {
|
|
4453
|
+
kind: 'text';
|
|
4454
|
+
key: string;
|
|
4455
|
+
text: string;
|
|
4456
|
+
} | {
|
|
4457
|
+
kind: 'chip';
|
|
4458
|
+
key: string;
|
|
4459
|
+
marker: MarkerEnvelope;
|
|
4460
|
+
} | {
|
|
4461
|
+
kind: 'placeholder';
|
|
4462
|
+
key: string;
|
|
4463
|
+
};
|
|
4464
|
+
interface UseStreamingMarkersOptions {
|
|
4465
|
+
citationContext: CitationContextFile[];
|
|
4466
|
+
bufferTimeoutMs?: FsmConfig['bufferTimeoutMs'];
|
|
4467
|
+
bufferMaxChars?: FsmConfig['bufferMaxChars'];
|
|
4468
|
+
}
|
|
4469
|
+
interface UseStreamingMarkersApi {
|
|
4470
|
+
segments: Segment[];
|
|
4471
|
+
feed: (chunk: string) => void;
|
|
4472
|
+
end: () => void;
|
|
4473
|
+
reset: () => void;
|
|
4474
|
+
}
|
|
4475
|
+
declare function useStreamingMarkers(opts: UseStreamingMarkersOptions): UseStreamingMarkersApi;
|
|
4476
|
+
|
|
4477
|
+
/**
|
|
4478
|
+
* JETP-084 — Provenance routing decision tree.
|
|
4479
|
+
*
|
|
4480
|
+
* Pure synchronous function. Decides:
|
|
4481
|
+
* 1. Whether the snapshot is precise / fuzzy / stale.
|
|
4482
|
+
* 2. What action FileViewer should take (line jump / keyword search / open).
|
|
4483
|
+
*
|
|
4484
|
+
* The function has no side effects so it can be tested exhaustively.
|
|
4485
|
+
*/
|
|
4486
|
+
|
|
4487
|
+
type Precision = 'precise' | 'fuzzy' | 'stale';
|
|
4488
|
+
type ProvenanceAction = {
|
|
4489
|
+
type: 'lineRange';
|
|
4490
|
+
lines: [number, number];
|
|
4491
|
+
keywords: string[];
|
|
4492
|
+
} | {
|
|
4493
|
+
type: 'keywordSearch';
|
|
4494
|
+
keywords: string[];
|
|
4495
|
+
pageHint?: number;
|
|
4496
|
+
} | {
|
|
4497
|
+
type: 'fileOpen';
|
|
4498
|
+
};
|
|
4499
|
+
interface ProvenanceRouteParams {
|
|
4500
|
+
file: CitationContextFile;
|
|
4501
|
+
marker: MarkerEnvelope;
|
|
4502
|
+
chunk: ChunksSidecarChunk;
|
|
4503
|
+
}
|
|
4504
|
+
interface ProvenanceRouteResult {
|
|
4505
|
+
precision: Precision;
|
|
4506
|
+
action: ProvenanceAction;
|
|
4507
|
+
}
|
|
4508
|
+
/**
|
|
4509
|
+
* @param params marker + chunk + file metadata
|
|
4510
|
+
* @param currentHeadCommit the current commit of the file as known by the
|
|
4511
|
+
* workspace; if omitted, commit checking is skipped.
|
|
4512
|
+
*/
|
|
4513
|
+
declare function routeProvenance(params: ProvenanceRouteParams, currentHeadCommit?: string): ProvenanceRouteResult;
|
|
4514
|
+
|
|
4515
|
+
/**
|
|
4516
|
+
* JETP-084 — Text / code / markdown route applier.
|
|
4517
|
+
*
|
|
4518
|
+
* Decoupled from any concrete editor implementation; consumers pass in an
|
|
4519
|
+
* `EditorAdapter` so the chat-widget can wire this to Monaco, CodeMirror, or
|
|
4520
|
+
* its own `MarkdownViewer` without taking a hard dependency here.
|
|
4521
|
+
*/
|
|
4522
|
+
/**
|
|
4523
|
+
* Minimal editor surface area required for line-range navigation + range
|
|
4524
|
+
* highlight. Models the Monaco IStandaloneCodeEditor subset we need.
|
|
4525
|
+
*/
|
|
4526
|
+
interface EditorAdapter {
|
|
4527
|
+
/** Scroll so `line` is in (or near) the vertical center of the viewport. */
|
|
4528
|
+
revealLineInCenter(line: number): void;
|
|
4529
|
+
/** Select an inclusive line range. */
|
|
4530
|
+
selectLines(start: number, end: number): void;
|
|
4531
|
+
/**
|
|
4532
|
+
* Apply a "RAG paragraph highlight" decoration spanning [start, end].
|
|
4533
|
+
* Returns a token the caller can pass back to `clearDecorations` later.
|
|
4534
|
+
*/
|
|
4535
|
+
addRangeDecoration(start: number, end: number, className: string): string;
|
|
4536
|
+
/** Clear previously applied decorations. */
|
|
4537
|
+
clearDecorations(ids: string[]): void;
|
|
4538
|
+
/**
|
|
4539
|
+
* Highlight every occurrence of each keyword inside the [start, end] range.
|
|
4540
|
+
* Returns decoration ids for later cleanup.
|
|
4541
|
+
*/
|
|
4542
|
+
highlightKeywords(range: [number, number], keywords: string[], className: string): string[];
|
|
4543
|
+
}
|
|
4544
|
+
interface TextRouteResult {
|
|
4545
|
+
/** Decoration tokens callers should clear when navigating away. */
|
|
4546
|
+
decorationIds: string[];
|
|
4547
|
+
/** Number of keyword matches highlighted. */
|
|
4548
|
+
keywordMatches: number;
|
|
4549
|
+
}
|
|
4550
|
+
interface TextRouteOptions {
|
|
4551
|
+
editor: EditorAdapter;
|
|
4552
|
+
lines: [number, number];
|
|
4553
|
+
keywords: string[];
|
|
4554
|
+
rangeClassName?: string;
|
|
4555
|
+
keywordClassName?: string;
|
|
4556
|
+
}
|
|
4557
|
+
declare function applyTextRoute(opts: TextRouteOptions): TextRouteResult;
|
|
4558
|
+
|
|
4559
|
+
/**
|
|
4560
|
+
* JETP-084 — PDF route applier.
|
|
4561
|
+
*
|
|
4562
|
+
* Uses a thin `PdfViewerAdapter` interface so the chat-widget can keep this
|
|
4563
|
+
* module decoupled from the actual PDF.js wrapper. The adapter signature is
|
|
4564
|
+
* intentionally narrow.
|
|
4565
|
+
*
|
|
4566
|
+
* Degradation chain (matches `04_file_viewer_routing.md` §5):
|
|
4567
|
+
* 1. Multi-keyword highlight all.
|
|
4568
|
+
* 2. If 0 matches and >1 keyword ⇒ fall back to the longest single keyword.
|
|
4569
|
+
* 3. If still 0 ⇒ caller is notified via `outcome === 'no-match'`.
|
|
4570
|
+
*/
|
|
4571
|
+
interface PdfViewerAdapter {
|
|
4572
|
+
/** Navigate to a 1-indexed page (no-op out of range). */
|
|
4573
|
+
gotoPage(page: number): Promise<void> | void;
|
|
4574
|
+
/**
|
|
4575
|
+
* Search the document for `term`; returns the number of matches highlighted.
|
|
4576
|
+
* The viewer is expected to keep prior highlights when called repeatedly
|
|
4577
|
+
* with `appendHighlights: true`.
|
|
4578
|
+
*/
|
|
4579
|
+
search(term: string, opts: {
|
|
4580
|
+
caseSensitive?: boolean;
|
|
4581
|
+
highlightAll?: boolean;
|
|
4582
|
+
appendHighlights?: boolean;
|
|
4583
|
+
}): Promise<number> | number;
|
|
4584
|
+
/** Remove all highlights from a previous search. */
|
|
4585
|
+
clearHighlights(): Promise<void> | void;
|
|
4586
|
+
}
|
|
4587
|
+
interface PdfRouteOptions {
|
|
4588
|
+
viewer: PdfViewerAdapter;
|
|
4589
|
+
keywords: string[];
|
|
4590
|
+
/** 0-indexed page hint (matches sidecar.page_idx). */
|
|
4591
|
+
pageHint?: number;
|
|
4592
|
+
}
|
|
4593
|
+
type PdfRouteOutcome = 'matched' | 'degraded-longest' | 'no-match';
|
|
4594
|
+
interface PdfRouteResult {
|
|
4595
|
+
outcome: PdfRouteOutcome;
|
|
4596
|
+
matched: number;
|
|
4597
|
+
/** The keywords actually used in the (possibly degraded) search. */
|
|
4598
|
+
searchedKeywords: string[];
|
|
4599
|
+
}
|
|
4600
|
+
declare function applyPdfRoute(opts: PdfRouteOptions): Promise<PdfRouteResult>;
|
|
4601
|
+
|
|
4602
|
+
/**
|
|
4603
|
+
* JETP-084 — Precision signal badge (✅ / ≈ / ⚠️).
|
|
4604
|
+
*
|
|
4605
|
+
* Pure presentational: maps a {precision} value to label + className. Caller
|
|
4606
|
+
* controls placement.
|
|
4607
|
+
*/
|
|
4608
|
+
|
|
4609
|
+
interface PrecisionBadgeProps {
|
|
4610
|
+
precision: Precision;
|
|
4611
|
+
/** Optional label override; otherwise uses the default Chinese copy. */
|
|
4612
|
+
label?: string;
|
|
4613
|
+
className?: string;
|
|
4614
|
+
}
|
|
4615
|
+
declare const PrecisionBadge: React$1.FC<PrecisionBadgeProps>;
|
|
4616
|
+
|
|
4617
|
+
export { type AgentControlFrame, type AgentDefaultModelInfo, AgentGroupPanel, type AgentGroupPanelProps, type AgentInstanceState, type AggregatedMessage, type AnnotationAnchor, type AnnotationAnchorRect, AnnotationFAB, type AnnotationFABProps, type AnnotationInteraction, type AnnotationKind, type AnnotationMessage, AnnotationPanel, type AnnotationPanelMessage, type AnnotationPanelProps, type Artifact, type ArtifactRef, type AttentionToast, AttentionToastList, type AttentionToastListProps, ChatOverlay, type ChatOverlayProps, ChatWidget, type ChatWidgetAPI, type ChatWidgetAdapter, ChatWidgetAuthError, type ChatWidgetConfig, type ChatWidgetControllerOptions, type ChatWidgetControllerState, type ChatWidgetInteractionEvent, ChatWidgetLocale, ChatWidgetMessages, ChatWidgetNetworkError, type ChatWidgetProps, ChildAgentCard, HttpError as ClientAllocatorHttpError, type ClientTitleEvent, type ConnectionStatus, ContextChip, type ContextChipProps, type ContextPreload, type CreateClientOptions, type CreateClientResponse, type CreateDiscussionRequest, type CreateDiscussionResponse, DEFAULT_CONFIG, DefaultComposer, type DefaultComposerProps, DefaultJetAgentsAdapter, type DefaultJetAgentsAdapterOptions, type DirectoryFileEntry, DiscussionComposer, type DiscussionComposerProps, type DiscussionFile, type DiscussionMessage, type DiscussionMeta, DiscussionPanel, type DiscussionPanelProps, DiscussionViewer, type DiscussionViewerProps, ESC_PRIORITY, type EscHandler, type ExecutionStatus, type FileAttachment, type FileCategory$1 as FileCategory, type FileReference, type FileUploadResult, type FileUploadStatusResult, FileViewer, FileViewerModal, type FileViewerModalProps, FileViewerPanel, type FileViewerPanelProps, type FileViewerProps, FloatingInput, type FloatingInputProps, FloatingToolbar, type FloatingToolbarProps, type HITLRequest, type HITLResponse, HoverPreview, type HoverPreviewProps, I18nContext, Icon, type IconName, type IconProps, type IconWeight, ImmersiveShell, type ImmersiveShellProps, InlineAnnotationInput, type InlineAnnotationInputProps, type InteractionEventType, InvalidClientIdError, type KicadCanvasSelectionPayload, LinkCard, type ListDirectoryFilesOptions, type ListModelsParams, type ListModelsResponse, type ListSessionsParams, type ListSessionsResponse, MAX_RECENT, MODALITY_ORDER, MODEL_AUTO, MentionAutocomplete, type MentionAutocompleteProps, type MentionTarget, MessageContent, type MessageContentType, type ModalityId, type ModelChoice, type ModelListItemBasenameGrouped, type ModelListItemGrouped, type ModelListItemRaw, type ModelListVariant, type ModelOverride, ModelPicker, type ModelPickerProps, type NotificationConfig, type NotificationTurn, type NotificationType, type PendingHIL, PinnedArea, PlanCard, type PlanItem, type PoolAgent, type PoolAgentAction, type PoolStatusResponse, type PostDiscussionMessageRequest, type PostDiscussionMessageResponse, PrecisionBadge, type ProjectFile, ProvenanceGraphSnapshot, MARKER_REGEX as RAG_MARKER_REGEX, type BatchFetcher as RagBatchFetcher, type BatchFetcherResponse as RagBatchFetcherResponse, type RagBlockType, type CacheEntry as RagCacheEntry, Chip as RagChip, type ChipProps as RagChipProps, type ChunksSidecar as RagChunksSidecar, type ChunksSidecarChunk as RagChunksSidecarChunk, type CitationContextEvent as RagCitationContextEvent, type CitationContextFile as RagCitationContextFile, type EditorAdapter as RagEditorAdapter, type RagFileType, type FsmConfig as RagFsmConfig, type FsmEmit as RagFsmEmit, type FsmState as RagFsmState, HighlightedText as RagHighlightedText, type MarkerEnvelope as RagMarkerEnvelope, type PdfRouteOptions as RagPdfRouteOptions, type PdfRouteOutcome as RagPdfRouteOutcome, type PdfRouteResult as RagPdfRouteResult, type PdfViewerAdapter as RagPdfViewerAdapter, Popover as RagPopover, type PopoverI18n as RagPopoverI18n, type PopoverProps as RagPopoverProps, type Precision as RagPrecision, type PrecisionBadgeProps as RagPrecisionBadgeProps, type ProvenanceAction as RagProvenanceAction, type ProvenanceRouteParams as RagRouteParams, type ProvenanceRouteResult as RagRouteResult, type SidecarSnapshot as RagSidecarSnapshot, type SidecarStatus as RagSidecarStatus, type Segment as RagStreamingSegment, type TextRouteOptions as RagTextRouteOptions, type TextRouteResult as RagTextRouteResult, type RailAction, type ReadReceipt, ResourceChip, type ResourceContent, ResourceContext, type ResourceContextValue, type ResourceInput, ResourceProvider, type ResourceState, RichInput, type RichInputHandle, type RichInputProps, type Round, RoundHeader, RoundMessageList, RoundsView, type RoundsViewProps, type SSEMessage, SchemaFormRenderer, type SelectedSkillRef, type SelectionBridgeOptions, type SelectionData, type SelectionState, type SessionChannelMessage, type ClientItem as SessionClientItem, BusinessError as SessionClientsBusinessError, type SessionDetail, type SessionLifecycleEvent, type SessionListItem, SessionListPanel, type SessionListPanelProps, ShareResourceProvider, type ShortcutDef, type SkillListParams, type SkillListResponse, SkillSelector, type SkillSelectorProps, type SkillSummary, type SmartPasteOptions, type SnapshotData, type SpecLifecycleEntry, SplitPanel, type SplitPanelProps, StreamingMarkerFSM, TabBar, type TabBarProps, type TaskPlan, TodoCard, type TodoData, type TodoGroup, type TodoPhase, type TodoStats, type TodoTask, type ToolCallData, ToolCardBuffering, type TransportMode, type TreePersistState, type UiConfig, type UploadedFileInfo, type UseAgentControlOptions, type UseAgentDefaultModelOptions, type UseAgentDefaultModelResult, type UseAnnotationsOptions, type UseAnnotationsReturn, type UseAttentionManagerOptions, type UseAutoTabOptions, type UseClientIdAllocatorReturn, type UseDiscussionsOptions, type UseDiscussionsReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseHoverPreviewOptions, type UseModelsOptions, type UseModelsResult, type UseProjectFilesOptions, type UseProjectFilesResult, type UseStreamingMarkersApi as UseRagStreamingMarkersApi, type UseStreamingMarkersOptions as UseRagStreamingMarkersOptions, type UseSessionChannelOptions, type UseSessionChannelReturn, type UseSessionClientsReturn, type UseSessionListOptions, type UseSessionListReturn, type UseShortcutsOptions, type UseSkillDataOptions, type UseSkillDataReturn, type UseSkillOrchestrationOptions, type UseSkillOrchestrationReturn, type UseSkillSelectorStateReturn, type UseViewerTabsReturn, type UseWorkspaceFilesOptions, type UseWorkspaceFilesReturn, VENDOR_ORDER, VIEWER_CAPABILITIES, type VendorId, type ViewerInteractionAdapter, type ViewerTab, type WorkspaceFile, WorkspacePanel, type WorkspacePanelProps, type WorkspaceTreeNode, type WorkspaceUploadResult, type XrefMeta, type XrefRecord, type XrefRef, applyPdfRoute, applyTextRoute, basenameMatchesQuery, clearRecent, contentToSrc, defaultFetcher as defaultRagSidecarFetcher, extractKicadSexprByUuid, fileTypeCategory, fileTypeColor, fileTypeIcon, formatFileSize, getCachedSidecar as getCachedRagSidecar, getExtension, getFileCategory, getStatusDisplay, getViewerCapabilities, inferLanguage, ingestCitationContext as ingestRagCitationContext, isShowModelChannels, isTodoNotificationContent, loadLastModelName, loadRecent, mergeConsecutiveThinkMessages, modalityOf, modelBasename, organizeMessagesByLevel, parseDiscussionMessages, parseXrefs, persistFromMessage as persistRagCitationContext, preloadSidecars as preloadRagSidecars, prepareJsonRenderSpec, pushRecent, routeProvenance, saveLastModelName, setCachedSidecar as setCachedRagSidecar, setSidecarFetcher as setRagSidecarFetcher, useAgentControl, useAgentDefaultModel, useAnnotations, useAttentionManager, useAutoTab, useChatWidgetController, useChatWidgetI18n, useClientIdAllocator, useDiscussions, useEscStack, useFileUpload, useHoverPreview, useMessageAggregator, useModels, useNarrowMode, useProjectFiles, useCitationContext as useRagCitationContext, useSidecar as useRagSidecar, useResource, useResourceContext, useSSE, useSelectionBridge, useSessionChannel, useSessionClients, useSessionList, useShortcuts, useSkillData, useSkillOrchestration, useSkillSelectorState, useSmartPaste, useStreamingMarkers, useTreePersist, useViewerTabs, useWorkspaceFiles, vendorOf };
|