@blade-hq/agent-react 2612.0.0-beta.9 → 2612.0.0-beta.90

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.
Files changed (185) hide show
  1. package/README.md +56 -0
  2. package/dist/SessionPluginConfigForm-FROO3XEW.js +9 -0
  3. package/dist/SessionPluginConfigForm-FROO3XEW.js.map +1 -0
  4. package/dist/chat/AgentLoopBlock.d.ts +0 -2
  5. package/dist/chat/AskUserQuestionBlock.d.ts +3 -20
  6. package/dist/chat/AssistantTurnBlock.d.ts +3 -10
  7. package/dist/chat/AttachmentPreviewDialog.d.ts +0 -1
  8. package/dist/chat/ChatLoadingIndicator.d.ts +15 -0
  9. package/dist/chat/ChatPanel.d.ts +3 -1
  10. package/dist/chat/ContextAttachmentPills.d.ts +4 -0
  11. package/dist/chat/CurrentPlanPanel.d.ts +0 -3
  12. package/dist/chat/FileDeliveryCards.d.ts +12 -10
  13. package/dist/chat/FinalArtifactCards.d.ts +0 -1
  14. package/dist/chat/ImageLightbox.d.ts +1 -1
  15. package/dist/chat/LiteMessageList.d.ts +5 -3
  16. package/dist/chat/MessageFileAttachmentList.d.ts +0 -5
  17. package/dist/chat/QuestionnaireQuestionBlock.d.ts +11 -0
  18. package/dist/chat/SessionReplayBar.d.ts +0 -1
  19. package/dist/chat/TextAttachmentPills.d.ts +0 -3
  20. package/dist/chat/TurnNavRail.d.ts +1 -7
  21. package/dist/chat/WorkflowRunBlock.d.ts +21 -4
  22. package/dist/chat/ai-elements/shimmer.d.ts +2 -2
  23. package/dist/chat/chat-column-width.d.ts +21 -0
  24. package/dist/chat/customization.d.ts +1 -1
  25. package/dist/chat/index.d.ts +6 -3
  26. package/dist/chat/markdown/ExternalAnchor.d.ts +2 -2
  27. package/dist/chat/message-list-blocks.d.ts +0 -1
  28. package/dist/chat/runtime/actions.d.ts +7 -3
  29. package/dist/chat/runtime/background-task-dismissals.d.ts +0 -1
  30. package/dist/chat/runtime/composer-channels.d.ts +0 -3
  31. package/dist/chat/runtime/environment.d.ts +2 -0
  32. package/dist/chat/runtime/input-cache-reset.d.ts +0 -5
  33. package/dist/chat/runtime/input-services.d.ts +10 -0
  34. package/dist/chat/runtime/session-source.d.ts +0 -5
  35. package/dist/chat/runtime/use-chat-actions.d.ts +1 -5
  36. package/dist/chat/turn-locate-channel.d.ts +53 -0
  37. package/dist/chat.css +23 -18
  38. package/dist/chunk-2GP2S3IR.js +9629 -0
  39. package/dist/chunk-2GP2S3IR.js.map +1 -0
  40. package/dist/{chunk-4OG6AJXY.js → chunk-3XWKS2YP.js} +3955 -26107
  41. package/dist/chunk-3XWKS2YP.js.map +1 -0
  42. package/dist/{chunk-HJ7KNUWM.js → chunk-5FK33U4M.js} +4181 -16595
  43. package/dist/chunk-5FK33U4M.js.map +1 -0
  44. package/dist/chunk-A5WYUMNB.js +1340 -0
  45. package/dist/chunk-A5WYUMNB.js.map +1 -0
  46. package/dist/chunk-JBVJMUJA.js +805 -0
  47. package/dist/chunk-JBVJMUJA.js.map +1 -0
  48. package/dist/chunk-NRAHM3CD.js +14861 -0
  49. package/dist/chunk-NRAHM3CD.js.map +1 -0
  50. package/dist/chunk-NS55ESUC.js +9488 -0
  51. package/dist/chunk-NS55ESUC.js.map +1 -0
  52. package/dist/chunk-PRDGUQTE.js +4157 -0
  53. package/dist/chunk-PRDGUQTE.js.map +1 -0
  54. package/dist/chunk-T42PKMOI.js +2417 -0
  55. package/dist/chunk-T42PKMOI.js.map +1 -0
  56. package/dist/chunk-WMWYGB2C.js +964 -0
  57. package/dist/chunk-WMWYGB2C.js.map +1 -0
  58. package/dist/components/AccountConnectorRules.d.ts +7 -0
  59. package/dist/components/AccountConnectors.d.ts +13 -0
  60. package/dist/components/ActionApprovals.d.ts +16 -0
  61. package/dist/components/BrowserConnectionDialog.d.ts +8 -0
  62. package/dist/components/ChatInput.d.ts +1 -15
  63. package/dist/components/ConfigConnection.d.ts +16 -0
  64. package/dist/components/ConnectorAuthorizationProgress.d.ts +6 -0
  65. package/dist/components/ConnectorConnection.d.ts +4 -0
  66. package/dist/components/ConnectorDetail.d.ts +46 -0
  67. package/dist/components/ConnectorPanel.d.ts +3 -1
  68. package/dist/components/ConnectorRulesPanel.d.ts +10 -0
  69. package/dist/components/ConnectorRuntimeDiagnostics.d.ts +5 -0
  70. package/dist/components/DeviceConnection.d.ts +17 -0
  71. package/dist/components/FeishuCapabilitySelection.d.ts +14 -0
  72. package/dist/components/FeishuPermissionStatus.d.ts +7 -0
  73. package/dist/components/LlmAdvancedSettings.d.ts +0 -1
  74. package/dist/components/ManagedConnection.d.ts +12 -0
  75. package/dist/components/McpAppFrame.d.ts +17 -0
  76. package/dist/components/PackEventNotice.d.ts +3 -0
  77. package/dist/components/PlanUpdateBlock.d.ts +0 -1
  78. package/dist/components/SessionPluginConfigForm.d.ts +4 -1
  79. package/dist/components/SessionPluginIcon.d.ts +1 -0
  80. package/dist/components/action-approval-format.d.ts +35 -0
  81. package/dist/components/plugin-connector.d.ts +1 -0
  82. package/dist/connectors.d.ts +6 -0
  83. package/dist/connectors.js +19 -0
  84. package/dist/connectors.js.map +1 -0
  85. package/dist/embed/blade-chat-element.d.ts +0 -8
  86. package/dist/embed/entry.d.ts +21 -19
  87. package/dist/hooks/use-capabilities.d.ts +3 -0
  88. package/dist/hooks/use-message-pin.d.ts +1 -1
  89. package/dist/hooks/use-turn-navigation.d.ts +19 -0
  90. package/dist/index.d.ts +9 -0
  91. package/dist/index.js +31 -3
  92. package/dist/internal.d.ts +7 -4
  93. package/dist/internal.js +671 -103
  94. package/dist/internal.js.map +1 -1
  95. package/dist/lib/message-shortcuts.d.ts +5 -0
  96. package/dist/questions.d.ts +7 -0
  97. package/dist/questions.js +910 -0
  98. package/dist/questions.js.map +1 -0
  99. package/dist/rich-input/ChatInput.d.ts +1 -1
  100. package/dist/rich-input/ConnectButton.d.ts +7 -5
  101. package/dist/rich-input/FileCompletionMenu.d.ts +1 -2
  102. package/dist/rich-input/InputActionSubmenu.d.ts +10 -0
  103. package/dist/rich-input/ModelSelector.d.ts +3 -1
  104. package/dist/rich-input/SkillActionMenu.d.ts +10 -0
  105. package/dist/rich-input/SkillStatusBar.d.ts +0 -6
  106. package/dist/rich-input/extensions/skill-mention.d.ts +3 -20
  107. package/dist/rich-input/index.d.ts +3 -2
  108. package/dist/rich-input/lib/composer-content.d.ts +5 -1
  109. package/dist/rich-input/lib/plugin-suggestions.d.ts +4 -4
  110. package/dist/rich-input/lib/reference-candidates.d.ts +0 -1
  111. package/dist/rich-input/lib/skill-suggestions.d.ts +1 -1
  112. package/dist/rich-input/lib/user-home.d.ts +0 -17
  113. package/dist/rich-input/model/resolve-model.d.ts +2 -2
  114. package/dist/rich-input/services.d.ts +1 -1
  115. package/dist/rich-input/voice/VoiceWaveform.d.ts +0 -3
  116. package/dist/rich-input.js +1711 -2140
  117. package/dist/rich-input.js.map +1 -1
  118. package/dist/style.css +16 -55
  119. package/dist/style.full.css +41 -77
  120. package/dist/tool-details.d.ts +8 -0
  121. package/dist/tool-details.js +25 -0
  122. package/dist/tool-details.js.map +1 -0
  123. package/node_modules/@modelcontextprotocol/ext-apps/LICENSE +216 -0
  124. package/node_modules/@modelcontextprotocol/ext-apps/README.md +284 -0
  125. package/node_modules/@modelcontextprotocol/ext-apps/dist/docs/patterns.d.ts +9 -0
  126. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.d.ts +1348 -0
  127. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.examples.d.ts +9 -0
  128. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js +39 -0
  129. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.test.d.ts +1 -0
  130. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-with-deps.js +82 -0
  131. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.d.ts +1214 -0
  132. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.examples.d.ts +9 -0
  133. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js +39 -0
  134. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.test.d.ts +1 -0
  135. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/constants.d.ts +65 -0
  136. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.d.ts +47 -0
  137. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.test.d.ts +1 -0
  138. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.d.ts +1047 -0
  139. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.json +6170 -0
  140. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.test.d.ts +41 -0
  141. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/interop-v1.test.d.ts +1 -0
  142. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/legacy-handlers.d.ts +66 -0
  143. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/legacy-handlers.test.d.ts +1 -0
  144. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.d.ts +126 -0
  145. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.examples.d.ts +9 -0
  146. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.test.d.ts +1 -0
  147. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.d.ts +37 -0
  148. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.examples.d.ts +6 -0
  149. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.js +39 -0
  150. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/react-with-deps.js +82 -0
  151. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.d.ts +115 -0
  152. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.examples.d.ts +6 -0
  153. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.d.ts +54 -0
  154. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.examples.d.ts +6 -0
  155. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.d.ts +44 -0
  156. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.examples.d.ts +6 -0
  157. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.d.ts +113 -0
  158. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.examples.d.ts +6 -0
  159. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.d.ts +381 -0
  160. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.examples.d.ts +9 -0
  161. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js +1 -0
  162. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.test.d.ts +1 -0
  163. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/spec.types.d.ts +698 -0
  164. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/standard-schema.d.ts +23 -0
  165. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.d.ts +184 -0
  166. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.examples.d.ts +9 -0
  167. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/types.d.ts +33 -0
  168. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/wire-compat.test.d.ts +1 -0
  169. package/node_modules/@modelcontextprotocol/ext-apps/package.json +144 -0
  170. package/node_modules/@standard-schema/spec/LICENSE +21 -0
  171. package/node_modules/@standard-schema/spec/README.md +198 -0
  172. package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
  173. package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
  174. package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
  175. package/node_modules/@standard-schema/spec/dist/index.js +0 -0
  176. package/node_modules/@standard-schema/spec/package.json +52 -0
  177. package/package.json +19 -3
  178. package/public-api.md +100 -4
  179. package/dist/chat-OCLOVB3H.css +0 -175
  180. package/dist/chunk-3DRBRQXN.js +0 -258
  181. package/dist/chunk-3DRBRQXN.js.map +0 -1
  182. package/dist/chunk-4OG6AJXY.js.map +0 -1
  183. package/dist/chunk-HJ7KNUWM.js.map +0 -1
  184. package/dist/lib/agent-computer-command.d.ts +0 -32
  185. package/dist/rich-input/extensions/workflow-mention.d.ts +0 -10
@@ -0,0 +1,12 @@
1
+ import { type ConnectorDetailOptions } from "./ConnectorDetail";
2
+ import type { ConnectorAuthorization, ConnectorAuthorizationAction, ConnectorAuthorizationOptions, ConnectorDiagnostics } from "@blade-hq/agent-client";
3
+ export interface ManagedConnectionProps {
4
+ detail?: ConnectorDetailOptions;
5
+ diagnostics?: () => Promise<ConnectorDiagnostics>;
6
+ read: () => Promise<ConnectorAuthorization>;
7
+ act: (action: ConnectorAuthorizationAction, options?: ConnectorAuthorizationOptions) => Promise<ConnectorAuthorization>;
8
+ onChanged: () => Promise<unknown>;
9
+ bindDelivery?: boolean;
10
+ onDisable?: () => Promise<unknown>;
11
+ }
12
+ export declare function ManagedConnection({ read, act, onChanged, bindDelivery, onDisable, detail, diagnostics }: ManagedConnectionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { AppBridge } from "@modelcontextprotocol/ext-apps/app-bridge";
2
+ export interface McpAppFrameProps {
3
+ html?: string;
4
+ resourceMeta: Record<string, unknown>;
5
+ title?: string;
6
+ error?: string | null;
7
+ toolInput?: Parameters<AppBridge["sendToolInput"]>[0];
8
+ callTool?: AppBridge["oncalltool"];
9
+ sendMessage?: AppBridge["onmessage"];
10
+ updateModelContext?: AppBridge["onupdatemodelcontext"];
11
+ requestDisplayMode?: AppBridge["onrequestdisplaymode"];
12
+ sizeChange?: AppBridge["onsizechange"];
13
+ openLink?: AppBridge["onopenlink"];
14
+ onReady?: (bridge: AppBridge) => void;
15
+ }
16
+ /** Sandboxed MCP App surface shared by chat cards and file previews. */
17
+ export declare function McpAppFrame(props: McpAppFrameProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function PackEventNotice({ title }: {
2
+ title: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -18,7 +18,6 @@ export declare function pickCurrentPlanStep(plan: PlanUpdateData["plan"]): PlanU
18
18
  export declare function PlanUpdateBlock({ toolCall, running, autoReveal, className, }: {
19
19
  toolCall: ToolCallInfo;
20
20
  running?: boolean;
21
- /** 实时收到的新进度短暂展开;加载历史时保持默认收起。 */
22
21
  autoReveal?: boolean;
23
22
  className?: string;
24
23
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -4,11 +4,14 @@ export interface SessionPluginConfigDraft {
4
4
  remove: string[];
5
5
  }
6
6
  export interface SessionPluginConfigFormProps {
7
+ collapseHelp?: boolean;
7
8
  config: SessionPluginConfigState;
8
9
  submitting: boolean;
9
10
  errors: SessionPluginConfigError[];
10
11
  failure: string | null;
11
12
  onSubmit: (draft: SessionPluginConfigDraft) => void;
12
13
  onCancel: () => void;
14
+ submitLabel?: string;
15
+ submittingLabel?: string;
13
16
  }
14
- export declare function SessionPluginConfigForm({ config, submitting, errors, failure, onSubmit, onCancel, }: SessionPluginConfigFormProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function SessionPluginConfigForm({ config, submitting, errors, failure, onSubmit, onCancel, submitLabel, submittingLabel, collapseHelp, }: SessionPluginConfigFormProps): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,7 @@ export interface SessionPluginIconProps {
6
6
  * 这样首页这种还没有会话的地方也能显示包内图标。
7
7
  */
8
8
  sessionId: string | null;
9
+ /** Also accepts the package data image returned by the connector catalog. */
9
10
  plugin: Pick<SessionPlugin, "name" | "icon">;
10
11
  /** 边长,默认 20。 */
11
12
  size?: number;
@@ -0,0 +1,35 @@
1
+ import type { ActionApproval } from '@blade-hq/agent-client';
2
+ export declare const BODY_COLLAPSE_CHARS = 260;
3
+ export declare const BODY_COLLAPSE_LINES = 6;
4
+ export declare const VISIBLE_SOURCE_LIMIT = 3;
5
+ export interface SourceDisplayItem {
6
+ key: string;
7
+ label: string;
8
+ summary?: string;
9
+ }
10
+ export interface ApprovalCardView {
11
+ title: string;
12
+ recipientNameMissing: boolean;
13
+ metadataRows: {
14
+ label: string;
15
+ value: string;
16
+ }[];
17
+ body: string;
18
+ hasBody: boolean;
19
+ formattedBody: string;
20
+ isLongFormattedBody: boolean;
21
+ isLongBody: boolean;
22
+ detailRows: {
23
+ key: string;
24
+ label: string;
25
+ value: string;
26
+ }[];
27
+ sourceItems: SourceDisplayItem[];
28
+ elevatedPrompt: boolean;
29
+ originPromptText: string;
30
+ cleanedError: string;
31
+ createdText: string;
32
+ expiresText: string;
33
+ }
34
+ export declare function stripInternalIds(value: string): string;
35
+ export declare function buildApprovalCardView(item: ActionApproval, nowMs?: number): ApprovalCardView;
@@ -15,6 +15,7 @@ export interface PluginConnectorItem {
15
15
  iconSource: "account" | "session";
16
16
  auth_status?: PluginCatalogEntry["auth_status"];
17
17
  installed: boolean | null;
18
+ connector?: boolean;
18
19
  /** 会话里已提交的选择;首页候选恒为 false。 */
19
20
  active: boolean;
20
21
  status: string;
@@ -0,0 +1,6 @@
1
+ export { DeviceConnection } from "./components/DeviceConnection";
2
+ export { ConnectorConnection } from "./components/ConnectorConnection";
3
+ export { ConnectorRulesPanel } from "./components/ConnectorRulesPanel";
4
+ export { ConnectorDetail } from "./components/ConnectorDetail";
5
+ export type { ConnectorDetailOptions, ConnectorDetailAction } from "./components/ConnectorDetail";
6
+ export { ConfigConnection } from "./components/ConfigConnection";
@@ -0,0 +1,19 @@
1
+ import {
2
+ ConnectorConnection,
3
+ DeviceConnection
4
+ } from "./chunk-T42PKMOI.js";
5
+ import {
6
+ ConfigConnection,
7
+ ConnectorDetail,
8
+ ConnectorRulesPanel
9
+ } from "./chunk-2GP2S3IR.js";
10
+ import "./chunk-WMWYGB2C.js";
11
+ import "./chunk-PR4QN5HX.js";
12
+ export {
13
+ ConfigConnection,
14
+ ConnectorConnection,
15
+ ConnectorDetail,
16
+ ConnectorRulesPanel,
17
+ DeviceConnection
18
+ };
19
+ //# sourceMappingURL=connectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -15,7 +15,6 @@ export declare class BladeChatElement extends HTMLElement {
15
15
  /** 当前会话(连接完成后可用);BladeAgent.getChat() 依赖它。 */
16
16
  session: AgentSession | null;
17
17
  private sessionWaiters;
18
- /** 自动创建的会话 id:attribute 变化触发的重渲染要继续用它,避免重复建会话。 */
19
18
  private autoCreatedSessionId;
20
19
  private mountRenderers;
21
20
  /** 转换后的 React 渲染器按渲染器对象缓存,避免每次渲染重建挂载内容。 */
@@ -29,13 +28,6 @@ export declare class BladeChatElement extends HTMLElement {
29
28
  set renderers(value: BladeChatMountRenderers | null);
30
29
  private currentReactRenderers;
31
30
  connectedCallback(): void;
32
- /**
33
- * 自定义样式口子:<blade-chat> 的直接 <style> 子元素会被拷入 Shadow DOM,
34
- * 排在内置样式之后(同优先级时后者胜)。配合内置的 .blade-chat-* 类名、
35
- * ::part()(每个可见区块都带与锚点同名的 part,如
36
- * blade-chat::part(user-bubble))与 CSS 变量(--primary / --background 等,
37
- * 页面直接对 blade-chat 元素设置即可穿透),无需构建工具即可深度定制。
38
- */
39
31
  private adoptUserStyles;
40
32
  disconnectedCallback(): void;
41
33
  attributeChangedCallback(): void;
@@ -1,27 +1,23 @@
1
- /**
2
- * blade-agent.js(IIFE)入口:纯静态 HTML 的接入方式。
3
- *
4
- * ```html
5
- * <script src="https://blade.example.com/sdk/blade-agent.js"></script>
6
- * <blade-chat base-url="https://blade.example.com"></blade-chat>
7
- * <script>
8
- * const chat = await BladeAgent.getChat(document.querySelector("blade-chat"))
9
- * chat.onCommand("map.highlight", (data) => { ... })
10
- * </script>
11
- * ```
12
- */
13
1
  import * as agentClient from "@blade-hq/agent-client";
14
2
  import type { AgentSession } from "@blade-hq/agent-client";
15
3
  import { BladeChatElement } from "./blade-chat-element";
16
- /** 取某个 `<blade-chat>` 元素背后的会话对象(等待连接就绪)。 */
17
4
  declare function getChat(element: Element | null): Promise<AgentSession>;
18
5
  declare const BladeAgent: {
6
+ FeishuBotsResource: typeof agentClient.FeishuBotsResource;
7
+ BladeApplicationClient: typeof agentClient.BladeApplicationClient;
19
8
  BladeClient: typeof agentClient.BladeClient;
9
+ BROWSER_DISABLED_CODE: "BROWSER_DISABLED";
10
+ BrowserDisabledError: typeof agentClient.BrowserDisabledError;
11
+ getBrowserCapability: typeof agentClient.getBrowserCapability;
12
+ isBrowserDisabledError: typeof agentClient.isBrowserDisabledError;
13
+ ConnectorsResource: typeof agentClient.ConnectorsResource;
20
14
  BladeApiError: typeof agentClient.BladeApiError;
21
15
  SDK_NAME: "agent-client";
22
16
  SDK_VERSION: string;
23
17
  AgentSession: typeof AgentSession;
24
18
  AgentSessionError: typeof agentClient.AgentSessionError;
19
+ parseAskUserQuestion: typeof agentClient.parseAskUserQuestion;
20
+ formatAskUserAnswer: typeof agentClient.formatAskUserAnswer;
25
21
  SessionSetupError: typeof agentClient.SessionSetupError;
26
22
  DEFAULT_REPLAY_SPEED: agentClient.ReplaySpeed;
27
23
  SessionInfo: import("arktype/internal/variants/object.ts").ObjectType<{
@@ -31,12 +27,13 @@ declare const BladeAgent: {
31
27
  created_at: string;
32
28
  updated_at: string;
33
29
  shared?: boolean | undefined;
30
+ anonymous?: boolean | undefined;
34
31
  memory_enabled?: boolean | undefined;
35
32
  is_persistent?: boolean | undefined;
36
33
  initiator?: "sdk" | "ui" | "unknown" | null | undefined;
37
34
  is_headless?: boolean | undefined;
35
+ scheduled_task_id?: string | undefined;
38
36
  viewer_role?: "owner" | "viewer" | undefined;
39
- template_id?: string | null | undefined;
40
37
  model?: string | null | undefined;
41
38
  enable_thinking?: boolean | null | undefined;
42
39
  solution_id?: string | null | undefined;
@@ -44,17 +41,12 @@ declare const BladeAgent: {
44
41
  biz_role_id?: string | null | undefined;
45
42
  solution?: unknown;
46
43
  plan_summary?: string | null | undefined;
47
- primary_skill_id?: string | null | undefined;
48
- bound_skill_id?: string | null | undefined;
49
44
  replay_state?: unknown;
50
45
  is_pinned?: boolean | undefined;
51
46
  pinned_at?: string | null | undefined;
52
47
  is_example?: boolean | undefined;
53
48
  ports?: unknown;
54
49
  disable_tools?: string[] | undefined;
55
- runtime_type?: string | null | undefined;
56
- daemon_id?: string | null | undefined;
57
- agent_runtime_id?: string | null | undefined;
58
50
  workspace_path?: string | null | undefined;
59
51
  ba_version?: string | null | undefined;
60
52
  sandbox_version?: string | null | undefined;
@@ -72,6 +64,16 @@ declare const BladeAgent: {
72
64
  userFacingErrorText: typeof agentClient.userFacingErrorText;
73
65
  normalizeTopicAssetRefs: typeof agentClient.normalizeTopicAssetRefs;
74
66
  normalizePluginRefs: typeof agentClient.normalizePluginRefs;
67
+ normalizeMessageRefs: typeof agentClient.normalizeMessageRefs;
68
+ ToolProvider: typeof agentClient.ToolProvider;
69
+ SandboxResource: typeof agentClient.SandboxResource;
70
+ ApprovalsResource: typeof agentClient.ApprovalsResource;
71
+ reconcileApprovals: typeof agentClient.reconcileApprovals;
72
+ ProfileResource: typeof agentClient.ProfileResource;
73
+ PacksResource: typeof agentClient.PacksResource;
74
+ PackRecordsResource: typeof agentClient.PackRecordsResource;
75
+ attachPackPageBridge: typeof agentClient.attachPackPageBridge;
76
+ CapabilitiesResource: typeof agentClient.CapabilitiesResource;
75
77
  getChat: typeof getChat;
76
78
  BladeChatElement: typeof BladeChatElement;
77
79
  };
@@ -0,0 +1,3 @@
1
+ import type { BladeClient, CapabilitySnapshot } from "@blade-hq/agent-client";
2
+ /** Refresh at the authority's expiry without retaining an expired allow on errors. */
3
+ export declare function useCapabilities(client: BladeClient): CapabilitySnapshot | null;
@@ -22,7 +22,7 @@ export interface UseMessagePinOptions {
22
22
  * 用户发言顶置的共享状态机。SDK 和内置轻量列表只提供 DOM/虚拟列表适配器,
23
23
  * 触发、调度、resize、手动接管和跟随交还的决策只在这里维护。
24
24
  */
25
- export declare function useMessagePin({ targetKey, pinTarget, isStreaming, layoutKey, getScrollElement, getContentElement, getTargetElement, getTargetScrollTop, getSpacerHeight, setSpacerHeight, stopAutoScroll, scrollToBottom, margin, }: UseMessagePinOptions): {
25
+ export declare function useMessagePin({ targetKey, pinTarget, isStreaming, layoutKey, getScrollElement, getContentElement, getTargetElement, getTargetScrollTop, getSpacerHeight, setSpacerHeight, stopAutoScroll, margin, }: UseMessagePinOptions): {
26
26
  release: () => void;
27
27
  isActive: () => boolean;
28
28
  };
@@ -11,6 +11,25 @@ export declare const TURN_NAV_HIGHLIGHT_CLASS = "blade-turn-nav-flash";
11
11
  export interface TurnNavItem {
12
12
  id: string;
13
13
  title: string;
14
+ /** 这一段的小结(post_chat_followup.recaption);空时表示这一段没有小结。 */
15
+ recaption?: string;
16
+ /** 这一段交付的产物(final_artifacts),脉络卡片上直接列出来。 */
17
+ artifacts?: TurnNavArtifact[];
18
+ /** 这一段里的每一次用户发言(脉络展开后逐条列出)。 */
19
+ entries?: TurnNavEntry[];
20
+ }
21
+ /** 分段里的一次用户发言。 */
22
+ export interface TurnNavEntry {
23
+ id: string;
24
+ title: string;
25
+ /** AskUserQuestion 的应答:消息列表里没有独立行,点它定位不到。 */
26
+ answer?: boolean;
27
+ }
28
+ /** 这一段交付的产物(文件 / 链接)。 */
29
+ export interface TurnNavArtifact {
30
+ kind: "file" | "link";
31
+ target: string;
32
+ label: string;
14
33
  }
15
34
  export interface TurnNavigationSource {
16
35
  /** 目录来源;不传就不请求目录,导航条目只由 `fallbackItems` 兜底。 */
package/dist/index.d.ts CHANGED
@@ -21,3 +21,12 @@ export { MarkdownContent } from "./chat/markdown/MarkdownContent";
21
21
  export type { MarkdownContentProps } from "./chat/markdown/MarkdownContent";
22
22
  export { TopicAssetSubmitDialog, useTopicAssetSubmissionAccess } from "./components/TopicAssetSubmitDialog";
23
23
  export type { TopicAssetSubmitDialogProps } from "./components/TopicAssetSubmitDialog";
24
+ export { DeviceConnection } from "./components/DeviceConnection";
25
+ export { ConnectorConnection } from "./components/ConnectorConnection";
26
+ export { ConnectorRulesPanel } from "./components/ConnectorRulesPanel";
27
+ export { ConnectorDetail } from "./components/ConnectorDetail";
28
+ export type { ConnectorDetailOptions, ConnectorDetailAction } from "./components/ConnectorDetail";
29
+ export { ConfigConnection } from "./components/ConfigConnection";
30
+ export { ActionApprovals, ActionApprovalCard, approvalDecisionMessage } from "./components/ActionApprovals";
31
+ export type { ActionApprovalsProps, ActionApprovalCardProps } from "./components/ActionApprovals";
32
+ export { useCapabilities } from "./hooks/use-capabilities";
package/dist/index.js CHANGED
@@ -1,27 +1,55 @@
1
1
  import {
2
+ ActionApprovalCard,
3
+ ActionApprovals,
2
4
  ChatView,
3
- MarkdownContent,
4
5
  ReplayBar,
5
6
  ReplayMismatchPrompt,
6
7
  TopicAssetSubmitDialog,
8
+ approvalDecisionMessage,
7
9
  useAgentSession,
10
+ useCapabilities,
8
11
  useReplay,
9
12
  useTopicAssetSubmissionAccess
10
- } from "./chunk-4OG6AJXY.js";
13
+ } from "./chunk-NRAHM3CD.js";
14
+ import "./chunk-A5WYUMNB.js";
15
+ import {
16
+ ConnectorConnection,
17
+ DeviceConnection
18
+ } from "./chunk-T42PKMOI.js";
19
+ import "./chunk-3XWKS2YP.js";
20
+ import {
21
+ MarkdownContent
22
+ } from "./chunk-NS55ESUC.js";
11
23
  import {
12
24
  BladeProvider,
13
25
  useBladeClient
14
- } from "./chunk-HJ7KNUWM.js";
26
+ } from "./chunk-PRDGUQTE.js";
27
+ import {
28
+ ConfigConnection,
29
+ ConnectorDetail,
30
+ ConnectorRulesPanel
31
+ } from "./chunk-2GP2S3IR.js";
32
+ import "./chunk-5FK33U4M.js";
33
+ import "./chunk-WMWYGB2C.js";
15
34
  import "./chunk-PR4QN5HX.js";
16
35
  export {
36
+ ActionApprovalCard,
37
+ ActionApprovals,
17
38
  BladeProvider,
18
39
  ChatView,
40
+ ConfigConnection,
41
+ ConnectorConnection,
42
+ ConnectorDetail,
43
+ ConnectorRulesPanel,
44
+ DeviceConnection,
19
45
  MarkdownContent,
20
46
  ReplayBar,
21
47
  ReplayMismatchPrompt,
22
48
  TopicAssetSubmitDialog,
49
+ approvalDecisionMessage,
23
50
  useAgentSession,
24
51
  useBladeClient,
52
+ useCapabilities,
25
53
  useReplay,
26
54
  useTopicAssetSubmissionAccess
27
55
  };
@@ -1,5 +1,5 @@
1
1
  export * from "./index";
2
- export * from "./chat";
2
+ export * from "./chat/index";
3
3
  export { useBladeHost, useOptionalBladeClient } from "./context";
4
4
  export { MountHostContext, MountSlot, mountRenderersToReact } from "./lib/mount-renderers";
5
5
  export { useLlmChat } from "./hooks/use-llm-chat";
@@ -8,7 +8,7 @@ export type { UseMessagePinOptions } from "./hooks/use-message-pin";
8
8
  export { useTypewriterReveal } from "./hooks/use-typewriter-reveal";
9
9
  export type { UseTypewriterRevealResult } from "./hooks/use-typewriter-reveal";
10
10
  export { latestUserSpeechEntryId, TURN_NAV_HIGHLIGHT_CLASS, turnNavItemsFromMessages, useTurnNavigation, } from "./hooks/use-turn-navigation";
11
- export type { TurnNavigationOptions, TurnNavigationResult, TurnNavigationSource, } from "./hooks/use-turn-navigation";
11
+ export type { TurnNavigationOptions, TurnNavigationResult, TurnNavigationSource, TurnNavArtifact, TurnNavEntry, TurnNavItem, } from "./hooks/use-turn-navigation";
12
12
  export type { UseLlmChatResult } from "./hooks/use-llm-chat";
13
13
  export { ConnectorPanel } from "./components/ConnectorPanel";
14
14
  export type { ConnectorPanelProps } from "./components/ConnectorPanel";
@@ -52,8 +52,6 @@ export { SessionMemoryToggle } from "./components/SessionMemoryToggle";
52
52
  export type { SessionMemoryToggleProps } from "./components/SessionMemoryToggle";
53
53
  export { SessionQueuePanel, isQueuePanelVisible } from "./components/SessionQueuePanel";
54
54
  export type { SessionQueuePanelProps } from "./components/SessionQueuePanel";
55
- export { isAgentComputerCommand, isAgentComputerToolCall, classifyAgentComputerLaunchOutcome, } from "./lib/agent-computer-command";
56
- export type { AgentComputerLaunchOutcome } from "./lib/agent-computer-command";
57
55
  export { SessionBranchPicker } from "./components/SessionBranchPicker";
58
56
  export type { SessionBranchPickerProps } from "./components/SessionBranchPicker";
59
57
  export { MessageImage, type MessageImageProps } from "./components/MessageImage";
@@ -61,3 +59,8 @@ export { BackgroundWakeNotice } from "./components/BackgroundWakeNotice";
61
59
  export { TopicAssetSubmitDialog, useTopicAssetSubmissionAccess } from "./components/TopicAssetSubmitDialog";
62
60
  export type { TopicAssetSubmitDialogProps } from "./components/TopicAssetSubmitDialog";
63
61
  export { CodeBlockPre } from "./chat/markdown/MarkdownContent";
62
+ export { ChatLoadingIndicator, formatLoadingElapsed, isPreparingReply, resolveLoadingStageLabel, } from "./chat/ChatLoadingIndicator";
63
+ export { BrowserConnectionDialog } from "./components/BrowserConnectionDialog";
64
+ export { AccountConnectors } from "./components/AccountConnectors";
65
+ export { McpAppFrame } from "./components/McpAppFrame";
66
+ export type { McpAppFrameProps } from "./components/McpAppFrame";