@blade-hq/agent-react 2610.0.0-beta.6 → 2610.0.0-beta.60
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/README.md +138 -3
- package/dist/chunk-G3PMV62Z.js +36 -0
- package/dist/{chunk-ZXXLY4RM.js → chunk-MAAMCOAU.js} +8 -32
- package/dist/{chunk-ZXXLY4RM.js.map → chunk-MAAMCOAU.js.map} +1 -1
- package/dist/components/AgentChat.d.ts +3 -0
- package/dist/components/AgentLoopBlock.d.ts +1 -4
- package/dist/components/AskUserQuestionBlock.d.ts +9 -0
- package/dist/components/AssistantTurnBlock.d.ts +20 -6
- package/dist/components/ChatInput.d.ts +8 -1
- package/dist/components/ChatSurface.d.ts +14 -2
- package/dist/components/ConnectionBanner.d.ts +1 -1
- package/dist/components/ConnectorPanel.d.ts +41 -0
- package/dist/components/ContextCard.d.ts +20 -0
- package/dist/components/MarkdownContent.d.ts +2 -0
- package/dist/components/McpAppCard.d.ts +14 -0
- package/dist/components/MessageList.d.ts +8 -1
- package/dist/components/PlanUpdateBlock.d.ts +31 -0
- package/dist/components/PluginConnectorList.d.ts +47 -0
- package/dist/components/PluginTriggerStack.d.ts +22 -0
- package/dist/components/SessionMemoryToggle.d.ts +19 -0
- package/dist/components/SessionPluginConfigDialog.d.ts +10 -0
- package/dist/components/SessionPluginConfigForm.d.ts +14 -0
- package/dist/components/SessionPluginIcon.d.ts +30 -0
- package/dist/components/SessionPluginSelector.d.ts +10 -0
- package/dist/components/SessionQueuePanel.d.ts +29 -0
- package/dist/components/ToolCallBlock.d.ts +4 -2
- package/dist/components/ToolUiCardView.d.ts +9 -0
- package/dist/components/UserMessageBubble.d.ts +1 -1
- package/dist/components/WhatIfUserBubble.d.ts +7 -0
- package/dist/components/connector-panel-types.d.ts +37 -0
- package/dist/components/display-utils.d.ts +10 -0
- package/dist/components/plugin-config-draft.d.ts +13 -0
- package/dist/components/plugin-config-schema.d.ts +6 -0
- package/dist/components/plugin-connector.d.ts +40 -0
- package/dist/components/use-session-plugin-activation.d.ts +40 -0
- package/dist/context.d.ts +1 -0
- package/dist/embed/entry.d.ts +47 -0
- package/dist/{highlighted-body-B3W2YXNL-YD7FAP6V.js → highlighted-body-B3W2YXNL-IASCZDV2.js} +3 -2
- package/dist/{highlighted-body-B3W2YXNL-YD7FAP6V.js.map → highlighted-body-B3W2YXNL-IASCZDV2.js.map} +1 -1
- package/dist/hooks/use-agent-session.d.ts +5 -0
- package/dist/hooks/use-message-pin.d.ts +28 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +44547 -1616
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-computer-command.d.ts +34 -0
- package/dist/lib/utils.d.ts +3 -1
- package/dist/lib/whatif-prompt.d.ts +18 -0
- package/dist/mermaid-3ZIDBTTL-BPVVWTVV.js +9 -0
- package/dist/mermaid-3ZIDBTTL-BPVVWTVV.js.map +1 -0
- package/dist/style.css +91 -1
- package/dist/style.full.css +92 -2
- package/dist/webapi-W3IB5DO4.js +2481 -0
- package/dist/webapi-W3IB5DO4.js.map +1 -0
- package/package.json +2 -2
- package/public-api.md +1285 -45
- package/dist/mermaid-3ZIDBTTL-N7YKJ3SM.js +0 -8
- /package/dist/{mermaid-3ZIDBTTL-N7YKJ3SM.js.map → chunk-G3PMV62Z.js.map} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PluginCatalogEntry, SessionPlugin, SessionPluginConfigSummary } from "@blade-hq/agent-client";
|
|
2
|
+
/**
|
|
3
|
+
* 连接器面板里的一行插件。
|
|
4
|
+
*
|
|
5
|
+
* 展示字段(名称、图标)和启用状态分开表达:目录接口在没有会话时也能给出名称与
|
|
6
|
+
* 图标,而「这次会话是否启用」只有会话接口知道。首页候选行恒为 `active: false`,
|
|
7
|
+
* 因为它只是待选,不代表已经激活。
|
|
8
|
+
*/
|
|
9
|
+
export interface PluginConnectorItem {
|
|
10
|
+
name: string;
|
|
11
|
+
display_name: string | null;
|
|
12
|
+
/** 图标 token;null 时显示统一占位,不隐藏整行。 */
|
|
13
|
+
icon: string | null;
|
|
14
|
+
/** 图标从哪个接口取:账号级目录,还是会话内已准备的包。 */
|
|
15
|
+
iconSource: "account" | "session";
|
|
16
|
+
installed: boolean | null;
|
|
17
|
+
/** 会话里已提交的选择;首页候选恒为 false。 */
|
|
18
|
+
active: boolean;
|
|
19
|
+
status: string;
|
|
20
|
+
reason?: string | null;
|
|
21
|
+
config?: SessionPluginConfigSummary;
|
|
22
|
+
projected: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** 首页候选:只有账号级目录,没有会话状态。 */
|
|
25
|
+
export declare function catalogToConnectorItems(catalog: PluginCatalogEntry[]): PluginConnectorItem[];
|
|
26
|
+
/**
|
|
27
|
+
* 会话列表叠加账号目录。
|
|
28
|
+
*
|
|
29
|
+
* 目录可用时展示字段以目录为准(包可能还没准备,会话列表拿不到名称和图标),
|
|
30
|
+
* 目录不可用时退回会话行自己的字段,这样已选插件仍然可以取消。
|
|
31
|
+
*/
|
|
32
|
+
export declare function mergeConnectorItems(sessionPlugins: SessionPlugin[], catalog: PluginCatalogEntry[] | null): PluginConnectorItem[];
|
|
33
|
+
/**
|
|
34
|
+
* 一行的配置说明文案;权威状态来自配置接口。
|
|
35
|
+
*
|
|
36
|
+
* `unchecked` 刻意没有文案:列表没有读过用户的 Home,说任何话都是噪音,
|
|
37
|
+
* 入口是开关本身。
|
|
38
|
+
*/
|
|
39
|
+
/** 按名称和显示名做本地过滤;空查询返回全部。 */
|
|
40
|
+
export declare function filterConnectorItems(items: PluginConnectorItem[], query: string): PluginConnectorItem[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BladeClient, SessionPluginActivation, SessionPluginConfigState } from "@blade-hq/agent-client";
|
|
2
|
+
import type { ConfiguringPlugin } from "./PluginConnectorList";
|
|
3
|
+
import { type PluginConnectorItem } from "./plugin-connector";
|
|
4
|
+
export interface UseSessionPluginActivationResult {
|
|
5
|
+
items: PluginConnectorItem[];
|
|
6
|
+
loading: boolean;
|
|
7
|
+
/** 插件列表本身读不到(Hub 不可用等),已有选择仍然可取消。 */
|
|
8
|
+
listError: boolean;
|
|
9
|
+
/** 某次启用/停用/准备失败了。 */
|
|
10
|
+
mutationError: boolean;
|
|
11
|
+
/** 正在为哪些插件提交意图;对应的开关在转圈,但仍然可点(点是取消)。 */
|
|
12
|
+
inFlight: Record<string, true>;
|
|
13
|
+
busy: boolean;
|
|
14
|
+
configuring: ConfiguringPlugin | null;
|
|
15
|
+
reload: () => void;
|
|
16
|
+
toggle: (item: PluginConnectorItem, next: boolean) => void;
|
|
17
|
+
retry: (item: PluginConnectorItem) => void;
|
|
18
|
+
editConfig: (item: PluginConnectorItem) => void;
|
|
19
|
+
onConfigSaved: (state: SessionPluginConfigState) => void;
|
|
20
|
+
onConfigClose: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 会话内插件启用的唯一实现。
|
|
24
|
+
*
|
|
25
|
+
* 顺序是「先准备配置,再提交 activation」:缺配置时开关不落到已启用、立刻弹表单,
|
|
26
|
+
* 保存成功才提交;取消、校验失败、配置读取失败都不提交。绝不先持久化 active=true
|
|
27
|
+
* 再靠补偿关掉——那样用户下次刷新会看到一个从没被成功打开的插件。
|
|
28
|
+
*
|
|
29
|
+
* 停用仍然直接提交:在服务端它只是取消一条数据库选择,不准备包、不连 MCP。但如果
|
|
30
|
+
* 这次「启用」只是还在准备、压根没提交过 activation,取消就只是放弃本地意图。
|
|
31
|
+
*
|
|
32
|
+
* 所有异步响应都按 (lifetime, mutation) 校验:迟到的准备或激活结果不会把已经取消 /
|
|
33
|
+
* 已经切走会话的插件重新打开;反过来,旧响应发现服务端落库顺序与用户最新意图不同时,
|
|
34
|
+
* 会重新提交最新意图。
|
|
35
|
+
*/
|
|
36
|
+
export declare function useSessionPluginActivation({ client, sessionId, onChange, }: {
|
|
37
|
+
client: BladeClient;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
onChange?: (plugin: SessionPluginActivation) => void;
|
|
40
|
+
}): UseSessionPluginActivationResult;
|
package/dist/context.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export interface BladeProviderProps {
|
|
|
11
11
|
export declare function BladeProvider({ client, children }: BladeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
/** 读取当前 BladeProvider 提供的 client。不在 Provider 内使用时抛错。 */
|
|
13
13
|
export declare function useBladeClient(): BladeClient;
|
|
14
|
+
export declare function useOptionalBladeClient(): BladeClient | null;
|
package/dist/embed/entry.d.ts
CHANGED
|
@@ -18,18 +18,45 @@ declare function getChat(element: Element | null): Promise<AgentSession>;
|
|
|
18
18
|
declare const BladeAgent: {
|
|
19
19
|
BladeClient: typeof agentClient.BladeClient;
|
|
20
20
|
BladeApiError: typeof agentClient.BladeApiError;
|
|
21
|
+
PollingBackoff: typeof agentClient.PollingBackoff;
|
|
22
|
+
EMPTY_PLATFORM_ENDPOINTS: agentClient.PlatformEndpoints;
|
|
23
|
+
loadPlatformEndpoints: typeof agentClient.loadPlatformEndpoints;
|
|
24
|
+
resolveServiceUrl: typeof agentClient.resolveServiceUrl;
|
|
21
25
|
SDK_NAME: "agent-client";
|
|
22
26
|
SDK_VERSION: string;
|
|
23
27
|
AgentSession: typeof AgentSession;
|
|
24
28
|
SessionHub: typeof agentClient.SessionHub;
|
|
29
|
+
isMcpAppData: typeof agentClient.isMcpAppData;
|
|
25
30
|
SessionSetupError: typeof agentClient.SessionSetupError;
|
|
26
31
|
createInitialSessionState: typeof agentClient.createInitialSessionState;
|
|
32
|
+
reconcileHistoricalUserTurns: typeof agentClient.reconcileHistoricalUserTurns;
|
|
33
|
+
reconcileOptimisticUserTurns: typeof agentClient.reconcileOptimisticUserTurns;
|
|
27
34
|
toReplaySnapshot: typeof agentClient.toReplaySnapshot;
|
|
35
|
+
EMPTY_SESSION_QUEUE: agentClient.SessionQueueSnapshot;
|
|
36
|
+
canCancelQueuedMessage: typeof agentClient.canCancelQueuedMessage;
|
|
37
|
+
canDeliverQueuedMessage: typeof agentClient.canDeliverQueuedMessage;
|
|
38
|
+
canEditQueuedMessage: typeof agentClient.canEditQueuedMessage;
|
|
39
|
+
isSessionQueueSnapshot: typeof agentClient.isSessionQueueSnapshot;
|
|
40
|
+
parseQueueAck: typeof agentClient.parseQueueAck;
|
|
41
|
+
queuePauseReasonLabel: typeof agentClient.queuePauseReasonLabel;
|
|
42
|
+
queuedMessageStatusLabel: typeof agentClient.queuedMessageStatusLabel;
|
|
43
|
+
shouldApplySnapshot: typeof agentClient.shouldApplySnapshot;
|
|
28
44
|
connectEmbedded: typeof agentClient.connectEmbedded;
|
|
29
45
|
isCommandEnvelope: typeof agentClient.isCommandEnvelope;
|
|
30
46
|
isInboundEnvelope: typeof agentClient.isInboundEnvelope;
|
|
47
|
+
ComputersResource: typeof agentClient.ComputersResource;
|
|
48
|
+
canToggleComputer: typeof agentClient.canToggleComputer;
|
|
49
|
+
computerDaemonVersion: typeof agentClient.computerDaemonVersion;
|
|
50
|
+
computerOS: typeof agentClient.computerOS;
|
|
51
|
+
computerPlatformLabel: typeof agentClient.computerPlatformLabel;
|
|
52
|
+
computerState: typeof agentClient.computerState;
|
|
53
|
+
sortComputers: typeof agentClient.sortComputers;
|
|
31
54
|
ModelsResource: typeof agentClient.ModelsResource;
|
|
55
|
+
ChatGroupsResource: typeof agentClient.ChatGroupsResource;
|
|
56
|
+
PluginsResource: typeof agentClient.PluginsResource;
|
|
57
|
+
hasChatRunEvent: typeof agentClient.hasChatRunEvent;
|
|
32
58
|
buildMessageContent: typeof agentClient.buildMessageContent;
|
|
59
|
+
chatErrorForDisplay: typeof agentClient.chatErrorForDisplay;
|
|
33
60
|
contentPreview: typeof agentClient.contentPreview;
|
|
34
61
|
extractTextAttachments: typeof agentClient.extractTextAttachments;
|
|
35
62
|
getFileParts: typeof agentClient.getFileParts;
|
|
@@ -39,7 +66,20 @@ declare const BladeAgent: {
|
|
|
39
66
|
isHiddenInternalMessage: typeof agentClient.isHiddenInternalMessage;
|
|
40
67
|
normalizeMessageContent: typeof agentClient.normalizeMessageContent;
|
|
41
68
|
transformSlashCommand: typeof agentClient.transformSlashCommand;
|
|
69
|
+
contextProjectionData: typeof agentClient.contextProjectionData;
|
|
70
|
+
getContextDisplayState: typeof agentClient.getContextDisplayState;
|
|
71
|
+
getContextGroupDisplayState: typeof agentClient.getContextGroupDisplayState;
|
|
72
|
+
groupAdjacentContextRuns: typeof agentClient.groupAdjacentContextRuns;
|
|
42
73
|
latestPostChatFollowup: typeof agentClient.latestPostChatFollowup;
|
|
74
|
+
buildToolUiCardKey: typeof agentClient.buildToolUiCardKey;
|
|
75
|
+
collectInlineToolUiCards: typeof agentClient.collectInlineToolUiCards;
|
|
76
|
+
collectPreviewToolUiCards: typeof agentClient.collectPreviewToolUiCards;
|
|
77
|
+
isAppDevToolUiCard: typeof agentClient.isAppDevToolUiCard;
|
|
78
|
+
isInternalStatusToolUiCard: typeof agentClient.isInternalStatusToolUiCard;
|
|
79
|
+
isToolUiCard: typeof agentClient.isToolUiCard;
|
|
80
|
+
resolveToolUiCardContent: typeof agentClient.resolveToolUiCardContent;
|
|
81
|
+
prependOlder: typeof agentClient.prependOlder;
|
|
82
|
+
replaceWindow: typeof agentClient.replaceWindow;
|
|
43
83
|
DEFAULT_REPLAY_SPEED: agentClient.ReplaySpeed;
|
|
44
84
|
SessionInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
45
85
|
id: string;
|
|
@@ -70,7 +110,11 @@ declare const BladeAgent: {
|
|
|
70
110
|
disable_tools?: string[] | undefined;
|
|
71
111
|
runtime_type?: string | null | undefined;
|
|
72
112
|
daemon_id?: string | null | undefined;
|
|
113
|
+
agent_runtime_id?: string | null | undefined;
|
|
73
114
|
workspace_path?: string | null | undefined;
|
|
115
|
+
ba_version?: string | null | undefined;
|
|
116
|
+
sandbox_version?: string | null | undefined;
|
|
117
|
+
chat_group_id?: string | null | undefined;
|
|
74
118
|
match?: unknown;
|
|
75
119
|
}, {}>;
|
|
76
120
|
SessionStatus: import("arktype/internal/variants/string.ts").StringType<"completed" | "created" | "failed" | "interrupted" | "running" | "waiting_for_input", {}>;
|
|
@@ -86,7 +130,10 @@ declare const BladeAgent: {
|
|
|
86
130
|
}, {}>;
|
|
87
131
|
TaskStatus: import("arktype/internal/variants/string.ts").StringType<"done" | "failed" | "in_progress" | "pending" | "skipped", {}>;
|
|
88
132
|
acceptedPostChatFollowupCompletesLatestRun: typeof agentClient.acceptedPostChatFollowupCompletesLatestRun;
|
|
133
|
+
acknowledgeTurnEvents: typeof agentClient.acknowledgeTurnEvents;
|
|
89
134
|
ClientProjectionBuilder: typeof agentClient.ClientProjectionBuilder;
|
|
135
|
+
AuthBusyReconnect: typeof agentClient.AuthBusyReconnect;
|
|
136
|
+
authBusyRetryDelayMs: typeof agentClient.authBusyRetryDelayMs;
|
|
90
137
|
createSocket: typeof agentClient.createSocket;
|
|
91
138
|
getChat: typeof getChat;
|
|
92
139
|
BladeChatElement: typeof BladeChatElement;
|
package/dist/{highlighted-body-B3W2YXNL-YD7FAP6V.js → highlighted-body-B3W2YXNL-IASCZDV2.js}
RENAMED
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
Ks,
|
|
4
4
|
Qe,
|
|
5
5
|
R
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MAAMCOAU.js";
|
|
7
|
+
import "./chunk-G3PMV62Z.js";
|
|
7
8
|
|
|
8
9
|
// ../../node_modules/.pnpm/streamdown@2.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js
|
|
9
10
|
import { useContext, useState, useEffect } from "react";
|
|
@@ -24,4 +25,4 @@ var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
|
|
|
24
25
|
export {
|
|
25
26
|
L as HighlightedCodeBlockBody
|
|
26
27
|
};
|
|
27
|
-
//# sourceMappingURL=highlighted-body-B3W2YXNL-
|
|
28
|
+
//# sourceMappingURL=highlighted-body-B3W2YXNL-IASCZDV2.js.map
|
package/dist/{highlighted-body-B3W2YXNL-YD7FAP6V.js.map → highlighted-body-B3W2YXNL-IASCZDV2.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/streamdown@2.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js"],"sourcesContent":["\"use client\";\nimport {k,d,c}from'./chunk-RLXIAIE6.js';import {useContext,useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var L=({code:s,language:t,raw:e,className:n,...d$1})=>{let{shikiTheme:l}=useContext(k),o=d(),[m,i]=useState(e);return useEffect(()=>{if(!o){i(e);return}let g=o.highlight({code:s,language:t,themes:l},p=>{i(p);});g&&i(g);},[s,t,l,o,e]),jsx(c,{className:n,language:t,result:m,...d$1})};export{L as HighlightedCodeBlockBody};"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/streamdown@2.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js"],"sourcesContent":["\"use client\";\nimport {k,d,c}from'./chunk-RLXIAIE6.js';import {useContext,useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var L=({code:s,language:t,raw:e,className:n,...d$1})=>{let{shikiTheme:l}=useContext(k),o=d(),[m,i]=useState(e);return useEffect(()=>{if(!o){i(e);return}let g=o.highlight({code:s,language:t,themes:l},p=>{i(p);});g&&i(g);},[s,t,l,o,e]),jsx(c,{className:n,language:t,result:m,...d$1})};export{L as HighlightedCodeBlockBody};"],"mappings":";;;;;;;;;AACwC,SAAQ,YAAW,UAAS,iBAAc;AAAQ,SAAQ,WAAQ;AAAoB,IAAI,IAAE,CAAC,EAAC,MAAK,GAAE,UAAS,GAAE,KAAI,GAAE,WAAU,GAAE,GAAG,IAAG,MAAI;AAAC,MAAG,EAAC,YAAW,EAAC,IAAE,WAAW,CAAC,GAAE,IAAE,GAAE,GAAE,CAAC,GAAE,CAAC,IAAE,SAAS,CAAC;AAAE,SAAO,UAAU,MAAI;AAAC,QAAG,CAAC,GAAE;AAAC,QAAE,CAAC;AAAE;AAAA,IAAM;AAAC,QAAI,IAAE,EAAE,UAAU,EAAC,MAAK,GAAE,UAAS,GAAE,QAAO,EAAC,GAAE,OAAG;AAAC,QAAE,CAAC;AAAA,IAAE,CAAC;AAAE,SAAG,EAAE,CAAC;AAAA,EAAE,GAAE,CAAC,GAAE,GAAE,GAAE,GAAE,CAAC,CAAC,GAAE,IAAI,IAAE,EAAC,WAAU,GAAE,UAAS,GAAE,QAAO,GAAE,GAAG,IAAG,CAAC;AAAC;","names":[]}
|
|
@@ -4,6 +4,11 @@ export interface UseAgentSessionOptions {
|
|
|
4
4
|
createOptions?: CreateSessionRequest;
|
|
5
5
|
/** 自动创建出的 sessionId 通过此回调交还调用方持有(重挂载复用的依据)。 */
|
|
6
6
|
onSessionCreated?: (sessionId: string) => void;
|
|
7
|
+
/**
|
|
8
|
+
* 会话进入实时事件路由后、历史加载与房间订阅开始前同步执行。
|
|
9
|
+
* 返回的清理函数会在切换会话或卸载时执行。
|
|
10
|
+
*/
|
|
11
|
+
onSessionConnected?: (session: AgentSession) => () => void;
|
|
7
12
|
}
|
|
8
13
|
export interface UseAgentSessionResult {
|
|
9
14
|
/** 连接/创建完成前为 null。 */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface UseMessagePinOptions {
|
|
2
|
+
targetKey: string | null;
|
|
3
|
+
pinTarget: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 省略时按旧行为处理(视为一直流式中,只靠 targetKey 变化释放)——
|
|
6
|
+
* useMessagePin 是导出的公开 hook,加这个字段前如果直接改成必填,
|
|
7
|
+
* 所有已经在调用这个 hook 的外部使用方都会编译不过。
|
|
8
|
+
*/
|
|
9
|
+
isStreaming?: boolean;
|
|
10
|
+
layoutKey?: string;
|
|
11
|
+
getScrollElement: () => HTMLElement | null;
|
|
12
|
+
getContentElement?: () => HTMLElement | null;
|
|
13
|
+
getTargetElement: () => HTMLElement | null;
|
|
14
|
+
getTargetScrollTop?: (scroll: HTMLElement) => number | null;
|
|
15
|
+
getSpacerHeight: () => number;
|
|
16
|
+
setSpacerHeight: (height: number) => void;
|
|
17
|
+
stopAutoScroll: () => void;
|
|
18
|
+
scrollToBottom: () => void;
|
|
19
|
+
margin?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 用户发言顶置的共享状态机。SDK 和内置轻量列表只提供 DOM/虚拟列表适配器,
|
|
23
|
+
* 触发、调度、resize、手动接管和跟随交还的决策只在这里维护。
|
|
24
|
+
*/
|
|
25
|
+
export declare function useMessagePin({ targetKey, pinTarget, isStreaming, layoutKey, getScrollElement, getContentElement, getTargetElement, getTargetScrollTop, getSpacerHeight, setSpacerHeight, stopAutoScroll, scrollToBottom, margin, }: UseMessagePinOptions): {
|
|
26
|
+
release: () => void;
|
|
27
|
+
isActive: () => boolean;
|
|
28
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,19 +5,60 @@ export type { UseAgentSessionOptions, UseAgentSessionResult } from "./hooks/use-
|
|
|
5
5
|
export { useReplay } from "./hooks/use-replay";
|
|
6
6
|
export type { ReplayMismatch, UseReplayResult } from "./hooks/use-replay";
|
|
7
7
|
export { useLlmChat } from "./hooks/use-llm-chat";
|
|
8
|
+
export { useMessagePin } from "./hooks/use-message-pin";
|
|
9
|
+
export type { UseMessagePinOptions } from "./hooks/use-message-pin";
|
|
8
10
|
export type { ChatCompletionTool, LlmChatOptions, LlmToolCall, UseLlmChatResult, } from "./hooks/use-llm-chat";
|
|
9
11
|
export { ChatView } from "./components/ChatView";
|
|
10
12
|
export type { ChatViewClassNames, ChatViewProps, ChatViewRenderers, ChatViewSlots, FollowupInteractionEvent, } from "./components/ChatView";
|
|
13
|
+
export { ConnectorPanel } from "./components/ConnectorPanel";
|
|
14
|
+
export type { ConnectorPanelProps } from "./components/ConnectorPanel";
|
|
15
|
+
export { PluginConnectorList } from "./components/PluginConnectorList";
|
|
16
|
+
export type { ConfiguringPlugin, PluginConnectorListProps } from "./components/PluginConnectorList";
|
|
17
|
+
export { useSessionPluginActivation } from "./components/use-session-plugin-activation";
|
|
18
|
+
export type { UseSessionPluginActivationResult } from "./components/use-session-plugin-activation";
|
|
19
|
+
export { catalogToConnectorItems, filterConnectorItems, mergeConnectorItems, } from "./components/plugin-connector";
|
|
20
|
+
export type { PluginConnectorItem } from "./components/plugin-connector";
|
|
21
|
+
export { selectionFromItem, triggerSummary, TRIGGER_ICON_LIMIT } from "./components/connector-panel-types";
|
|
22
|
+
export type { PluginConnectorSelection, TriggerSummary, } from "./components/connector-panel-types";
|
|
23
|
+
export { SessionPluginSelector } from "./components/SessionPluginSelector";
|
|
24
|
+
export type { SessionPluginSelectorProps } from "./components/SessionPluginSelector";
|
|
25
|
+
export { SessionPluginIcon, sessionPluginLabel } from "./components/SessionPluginIcon";
|
|
26
|
+
export type { SessionPluginIconProps, SessionPluginLabelProps } from "./components/SessionPluginIcon";
|
|
27
|
+
export { PluginTriggerStack } from "./components/PluginTriggerStack";
|
|
28
|
+
export type { PluginTriggerStackProps } from "./components/PluginTriggerStack";
|
|
29
|
+
export { SessionPluginConfigDialog } from "./components/SessionPluginConfigDialog";
|
|
30
|
+
export type { SessionPluginConfigDialogProps } from "./components/SessionPluginConfigDialog";
|
|
31
|
+
export { SessionPluginConfigForm } from "./components/SessionPluginConfigForm";
|
|
32
|
+
export type { SessionPluginConfigDraft, SessionPluginConfigFormProps, } from "./components/SessionPluginConfigForm";
|
|
11
33
|
export { AgentChat } from "./components/AgentChat";
|
|
12
34
|
export type { AgentChatProps } from "./components/AgentChat";
|
|
13
35
|
export { LlmChat } from "./components/LlmChat";
|
|
14
36
|
export type { LlmChatHandle, LlmChatProps } from "./components/LlmChat";
|
|
15
37
|
export type { LlmAdvancedSettings, LlmOverride } from "./components/LlmAdvancedSettings";
|
|
16
38
|
export { MarkdownContent } from "./components/MarkdownContent";
|
|
39
|
+
export { normalizeAdjacentUrlFormatting } from "./components/MarkdownContent";
|
|
17
40
|
export type { MarkdownContentProps } from "./components/MarkdownContent";
|
|
41
|
+
export { WhatIfUserBubble } from "./components/WhatIfUserBubble";
|
|
42
|
+
export type { WhatIfUserBubbleProps } from "./components/WhatIfUserBubble";
|
|
43
|
+
export { parseWhatIfPrompt } from "./lib/whatif-prompt";
|
|
44
|
+
export type { ParsedWhatIfPrompt, WhatIfQuote } from "./lib/whatif-prompt";
|
|
18
45
|
export { ReplayBar } from "./components/ReplayBar";
|
|
19
46
|
export type { ReplayBarProps } from "./components/ReplayBar";
|
|
20
47
|
export { ReplayMismatchPrompt } from "./components/ReplayMismatchPrompt";
|
|
21
48
|
export type { ReplayMismatchPromptProps } from "./components/ReplayMismatchPrompt";
|
|
22
49
|
export type { ToolCallRenderer } from "./components/ToolCallBlock";
|
|
50
|
+
export { CurrentPlanPanel, getPlanUpdateDisplayState, isPlanUpdateTool, PLAN_AUTO_COLLAPSE_MS, parsePlanUpdate, pickCurrentPlanStep, PlanUpdateBlock, } from "./components/PlanUpdateBlock";
|
|
51
|
+
export type { PlanStepStatus, PlanUpdateData, PlanUpdateDisplayState, } from "./components/PlanUpdateBlock";
|
|
52
|
+
export { ContextCard, ContextGroupCard } from "./components/ContextCard";
|
|
53
|
+
export type { ContextCardProps, ContextGroupCardProps } from "./components/ContextCard";
|
|
54
|
+
export { collectMemoryRefs, MemoryRefsHint } from "./components/AssistantTurnBlock";
|
|
55
|
+
export { ToolUiCardView } from "./components/ToolUiCardView";
|
|
56
|
+
export { McpAppCard } from "./components/McpAppCard";
|
|
57
|
+
export type { McpAppMessage } from "./components/McpAppCard";
|
|
58
|
+
export { SessionMemoryToggle } from "./components/SessionMemoryToggle";
|
|
59
|
+
export type { SessionMemoryToggleProps } from "./components/SessionMemoryToggle";
|
|
60
|
+
export { SessionQueuePanel } from "./components/SessionQueuePanel";
|
|
61
|
+
export type { SessionQueuePanelProps } from "./components/SessionQueuePanel";
|
|
62
|
+
export { isAgentComputerCommand, isAgentComputerToolCall, classifyAgentComputerLaunchOutcome, } from "./lib/agent-computer-command";
|
|
63
|
+
export type { AgentComputerLaunchOutcome } from "./lib/agent-computer-command";
|
|
23
64
|
export * from "@blade-hq/agent-client";
|