@blade-hq/agent-react 2612.0.0-beta.6 → 2612.0.0-beta.8
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 +1 -1
- package/dist/chat/LiteMessageList.d.ts +1 -1
- package/dist/chat/customization.d.ts +1 -1
- package/dist/chat/index.d.ts +1 -4
- package/dist/chat/lib/citations.d.ts +2 -23
- package/dist/chat/runtime/actions.d.ts +0 -1
- package/dist/chat/runtime/input-services.d.ts +0 -6
- package/dist/{chunk-XJLFFRQP.js → chunk-67GHJQK5.js} +443 -410
- package/dist/chunk-67GHJQK5.js.map +1 -0
- package/dist/{chunk-IRBOKMF5.js → chunk-DPDXGYGM.js} +2 -2
- package/dist/{chunk-UKQFSXGC.js → chunk-MERN5XEM.js} +506 -686
- package/dist/chunk-MERN5XEM.js.map +1 -0
- package/dist/host.d.ts +0 -4
- package/dist/index.js +2 -2
- package/dist/internal.js +3 -3
- package/dist/rich-input/FileCompletionMenu.d.ts +4 -9
- package/dist/rich-input/index.d.ts +0 -2
- package/dist/rich-input/lib/composer-content.d.ts +2 -21
- package/dist/rich-input/lib/reference-candidates.d.ts +0 -3
- package/dist/rich-input/services.d.ts +2 -3
- package/dist/rich-input.js +37 -254
- package/dist/rich-input.js.map +1 -1
- package/dist/style.full.css +1 -1
- package/package.json +2 -2
- package/public-api.md +0 -1
- package/dist/chat/tool-renderers/KbSearchRenderer.d.ts +0 -2
- package/dist/chat/tool-renderers/kb-search-result.d.ts +0 -19
- package/dist/chunk-UKQFSXGC.js.map +0 -1
- package/dist/chunk-XJLFFRQP.js.map +0 -1
- package/dist/rich-input/extensions/kb-mention.d.ts +0 -18
- package/dist/rich-input/lib/kb-suggestions.d.ts +0 -37
- /package/dist/{chunk-IRBOKMF5.js.map → chunk-DPDXGYGM.js.map} +0 -0
package/dist/host.d.ts
CHANGED
|
@@ -31,10 +31,6 @@ export interface BladeHost {
|
|
|
31
31
|
listSkills?(context: {
|
|
32
32
|
sessionId?: string;
|
|
33
33
|
}): Promise<HostCatalogItem[]>;
|
|
34
|
-
/** 可在输入框里提及的知识库清单。 */
|
|
35
|
-
listKnowledgeBases?(context: {
|
|
36
|
-
sessionId?: string;
|
|
37
|
-
}): Promise<HostCatalogItem[]>;
|
|
38
34
|
}
|
|
39
35
|
/** 宿主上传完成的附件。 */
|
|
40
36
|
export interface HostAttachment {
|
package/dist/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
useAgentSession,
|
|
8
8
|
useReplay,
|
|
9
9
|
useTopicAssetSubmissionAccess
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-67GHJQK5.js";
|
|
11
11
|
import {
|
|
12
12
|
BladeProvider,
|
|
13
13
|
useBladeClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MERN5XEM.js";
|
|
15
15
|
import "./chunk-PR4QN5HX.js";
|
|
16
16
|
export {
|
|
17
17
|
BladeProvider,
|
package/dist/internal.js
CHANGED
|
@@ -29,14 +29,14 @@ import {
|
|
|
29
29
|
useTopicAssetSubmissionAccess,
|
|
30
30
|
useTurnNavigation,
|
|
31
31
|
useTypewriterReveal
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-67GHJQK5.js";
|
|
33
33
|
import {
|
|
34
34
|
ConnectorPanel,
|
|
35
35
|
PluginTriggerStack,
|
|
36
36
|
TRIGGER_ICON_LIMIT,
|
|
37
37
|
selectionFromItem,
|
|
38
38
|
triggerSummary
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-DPDXGYGM.js";
|
|
40
40
|
import {
|
|
41
41
|
BladeProvider,
|
|
42
42
|
Content2,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
useBladeHost,
|
|
64
64
|
useOptionalBladeClient,
|
|
65
65
|
useSessionPluginActivation
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-MERN5XEM.js";
|
|
67
67
|
import "./chunk-PR4QN5HX.js";
|
|
68
68
|
|
|
69
69
|
// src/internal.ts
|
|
@@ -4,22 +4,17 @@ import type { SuggestionProps } from "@tiptap/suggestion";
|
|
|
4
4
|
import type { BladeClient, FileEntry } from "@blade-hq/agent-client";
|
|
5
5
|
import { type UserHomeRuntime } from "./lib/user-home";
|
|
6
6
|
import type { FileSuggestionItem } from "./extensions/file-mention";
|
|
7
|
-
import { type KbSuggestionItem } from "./extensions/kb-mention";
|
|
8
7
|
/**
|
|
9
8
|
* `session` 浏览当前会话的工作空间(相对路径,需要会话);`userHome` 浏览用户
|
|
10
9
|
* 云电脑的 HOME(`/root/...` 绝对路径),首页还没有会话时用这一种。两种模式
|
|
11
10
|
* 的条目由调用方拉好后传进来,这里只负责过滤和渲染。
|
|
12
11
|
*/
|
|
13
12
|
export type FileBrowseScope = "session" | "userHome";
|
|
14
|
-
/**
|
|
15
|
-
export type MentionSuggestionItem = FileSuggestionItem | PluginSuggestionItem |
|
|
16
|
-
/**
|
|
17
|
-
* `items` 里可以混着知识库候选(`kind: "kb"`)和文件条目:知识库来自 blade_hub
|
|
18
|
-
* `/api/kb`,文件来自会话工作区或云电脑 HOME。菜单把两者拆成「知识库 / 文件」
|
|
19
|
-
* 两组渲染,键盘上下键跨组连续移动。
|
|
20
|
-
*/
|
|
13
|
+
/** Selected file, plugin entry or topic asset. */
|
|
14
|
+
export type MentionSuggestionItem = FileSuggestionItem | PluginSuggestionItem | TopicAssetSuggestionItem;
|
|
15
|
+
/** Candidates from the shared reference sources. */
|
|
21
16
|
export interface FileCompletionMenuProps extends Omit<SuggestionProps<FileSuggestionItem, FileSuggestionItem>, "command" | "items"> {
|
|
22
|
-
items: Array<FileEntry | PluginSuggestionError | PluginSuggestionItem |
|
|
17
|
+
items: Array<FileEntry | PluginSuggestionError | PluginSuggestionItem | TopicAssetSuggestionItem | TopicAssetSuggestionError>;
|
|
23
18
|
command: (props: MentionSuggestionItem) => void;
|
|
24
19
|
onExit?: () => void;
|
|
25
20
|
sessionId?: string | null;
|
|
@@ -19,7 +19,6 @@ export * from "./PlanningToggle";
|
|
|
19
19
|
export * from "./ReasoningModeSelect";
|
|
20
20
|
export * from "./SkillCompletionMenu";
|
|
21
21
|
export * from "./extensions/file-mention";
|
|
22
|
-
export * from "./extensions/kb-mention";
|
|
23
22
|
export * from "./extensions/skill-mention";
|
|
24
23
|
export * from "./extensions/workflow-mention";
|
|
25
24
|
export * from "./input-keyboard";
|
|
@@ -28,7 +27,6 @@ export * from "./lib/background-tasks-view";
|
|
|
28
27
|
export * from "./lib/client-query";
|
|
29
28
|
export * from "./lib/composer-content";
|
|
30
29
|
export * from "./lib/image-input-availability";
|
|
31
|
-
export * from "./lib/kb-suggestions";
|
|
32
30
|
export * from "./lib/reasoning-levels";
|
|
33
31
|
export * from "./lib/session-data";
|
|
34
32
|
export * from "./lib/skill-suggestions";
|
|
@@ -23,29 +23,10 @@ export interface LeadingSkillMention extends SkillMentionAvailability {
|
|
|
23
23
|
* 时,药丸只是被提到,不改写整条消息的意图。
|
|
24
24
|
*/
|
|
25
25
|
export declare function findLeadingSkillMention(node: EditorJSON | null | undefined): LeadingSkillMention | null;
|
|
26
|
-
export interface KbMentionRef {
|
|
27
|
-
kbId: number;
|
|
28
|
-
name: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* 收集正文里所有知识库药丸(按出现顺序去重)。位置不限——不像技能只认开头,
|
|
32
|
-
* 用户在句中 @ 一个库同样是在圈定这条消息的检索范围。
|
|
33
|
-
*/
|
|
34
|
-
export declare function collectKbMentions(node: EditorJSON | null | undefined): KbMentionRef[];
|
|
35
|
-
/**
|
|
36
|
-
* 输入历史(ArrowUp/ArrowDown 召回)只存了序列化后的纯文本——知识库药丸序列化
|
|
37
|
-
* 成 `@库名` 就是普通文字,`kbId` 早就丢了。召回时如果只是把文字塞回编辑器,
|
|
38
|
-
* 画面上看着还是 `@库名`,但已经是纯文本、不是真的 kbMention 节点,
|
|
39
|
-
* `collectKbMentions` 找不到,后端就不会收到这次显式的知识库 Context 声明。
|
|
40
|
-
*
|
|
41
|
-
* 这里按文字里 `@库名` 出现的位置,把召回时一并存下来的 `kbMentions` 换回真的
|
|
42
|
-
* kbMention 节点,其余部分照旧当纯文本——只在能找到对应文字的地方才替换,
|
|
43
|
-
* 找不到就原样留成文字,不强行拼接、不假装恢复成功。
|
|
44
|
-
*/
|
|
45
|
-
export declare function buildEditorDocumentWithKbMentions(text: string, kbMentions: readonly KbMentionRef[]): EditorJSON;
|
|
46
26
|
/** Asset identity travels separately; no metadata or retrieval instruction enters the user's text. */
|
|
47
27
|
export declare function collectTopicAssetMentions(node: EditorJSON | null | undefined): TopicAssetRef[];
|
|
48
|
-
export declare function buildEditorDocumentWithMentions(text: string,
|
|
28
|
+
export declare function buildEditorDocumentWithMentions(text: string, topicAssetRefs?: readonly TopicAssetRef[]): EditorJSON;
|
|
49
29
|
/** Switching the explicitly selected topic must not leave pills from the previous one. */
|
|
50
30
|
export declare function retainTopicAssetMentions(node: EditorJSON, topicId: string | null): EditorJSON;
|
|
51
31
|
export declare function collectPluginMentions(node: EditorJSON | null | undefined): PluginRef[];
|
|
32
|
+
export declare function buildEditorDocument(text: string): EditorJSON;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { PluginSuggestionItem, PluginSuggestionError } from "../extensions/plugin-mention";
|
|
2
2
|
import type { FileEntry } from "@blade-hq/agent-client";
|
|
3
|
-
import type { KbSuggestionItem } from "../extensions/kb-mention";
|
|
4
3
|
import type { TopicAssetSuggestionError, TopicAssetSuggestionItem } from "../extensions/topic-asset-mention";
|
|
5
4
|
export interface ReferenceCandidateGroups {
|
|
6
5
|
plugins: Array<PluginSuggestionItem | PluginSuggestionError>;
|
|
7
|
-
kbs: KbSuggestionItem[];
|
|
8
6
|
topics: Array<TopicAssetSuggestionItem | TopicAssetSuggestionError>;
|
|
9
7
|
files: FileEntry[];
|
|
10
8
|
}
|
|
@@ -17,7 +15,6 @@ export interface ReferenceCandidateSnapshot {
|
|
|
17
15
|
}
|
|
18
16
|
export interface ReferenceCandidateSources {
|
|
19
17
|
plugins?: (query: string) => Promise<Array<PluginSuggestionItem | PluginSuggestionError>>;
|
|
20
|
-
kbs: (query: string) => Promise<ReferenceCandidateGroups["kbs"]>;
|
|
21
18
|
topics: (query: string) => Promise<ReferenceCandidateGroups["topics"]>;
|
|
22
19
|
files: (query: string) => Promise<ReferenceCandidateGroups["files"]>;
|
|
23
20
|
}
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* 否则用基于 BladeClient 的默认实现。覆盖点见 `RichInputServices`(internal 入口)。
|
|
4
4
|
*/
|
|
5
5
|
import type { BackgroundTask, ConnectionStatus, SessionContextStats } from "@blade-hq/agent-client/internal";
|
|
6
|
-
import { type InputConnection, type InputDataState, type
|
|
7
|
-
export { type ConnectorComputerSectionProps, type InputConnection, type InputDataState, type
|
|
6
|
+
import { type InputConnection, type InputDataState, type InputModelCatalog, type InputModelPreferences, type InputSessionSkill, type InputSkillStats } from "../chat/runtime/input-services";
|
|
7
|
+
export { type ConnectorComputerSectionProps, type InputConnection, type InputDataState, type InputModelCatalog, type InputModelOption, type InputModelPreferences, type InputSessionSkill, type InputSkillStats, type RichInputServices, RichInputServicesProvider, useRichInputServices, } from "../chat/runtime/input-services";
|
|
8
8
|
export declare function useModelCatalog(): InputModelCatalog;
|
|
9
9
|
export declare function useModelPreferences(): InputModelPreferences;
|
|
10
|
-
export declare function useKnowledgeBaseLoader(): () => Promise<InputKnowledgeBase[]>;
|
|
11
10
|
/** 连接情况:宿主给了就用宿主的(内置 Web 看全局连接),否则看当前会话。 */
|
|
12
11
|
export declare function useComposerConnectionInfo(sessionId: string | null): InputConnection;
|
|
13
12
|
export declare function useComposerConnection(sessionId: string | null): ConnectionStatus;
|