@blade-hq/agent-react 2610.0.0-beta.57 → 2610.0.0-beta.59
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 +3 -2
- package/dist/components/ConnectorPanel.d.ts +1 -1
- package/dist/components/PluginTriggerStack.d.ts +22 -0
- package/dist/components/SessionPluginIcon.d.ts +8 -1
- package/dist/components/SessionQueuePanel.d.ts +6 -2
- package/dist/components/connector-panel-types.d.ts +10 -8
- package/dist/components/plugin-connector.d.ts +0 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +450 -326
- package/dist/index.js.map +1 -1
- package/dist/style.full.css +1 -1
- package/package.json +2 -2
- package/public-api.md +21 -10
package/README.md
CHANGED
|
@@ -387,7 +387,8 @@ blade-chat { --primary: 262 83% 58%; height: 640px; }
|
|
|
387
387
|
## 附录:连接器与插件选择
|
|
388
388
|
|
|
389
389
|
- **连接器面板**:`ConnectorPanel`、`ConnectorPanelProps`、`PluginConnectorList`、`PluginConnectorListProps`、`ConfiguringPlugin`
|
|
390
|
-
- **插件行与触发器**:`PluginConnectorItem`、`PluginConnectorSelection`、`selectionFromItem`、`triggerSummary`、`TriggerSummary`、`TRIGGER_ICON_LIMIT`、`mergeConnectorItems`、`catalogToConnectorItems`、`filterConnectorItems
|
|
390
|
+
- **插件行与触发器**:`PluginConnectorItem`、`PluginConnectorSelection`、`selectionFromItem`、`triggerSummary`、`TriggerSummary`、`TRIGGER_ICON_LIMIT`、`mergeConnectorItems`、`catalogToConnectorItems`、`filterConnectorItems`
|
|
391
|
+
- **触发器上的头像堆叠**:`PluginTriggerStack`、`PluginTriggerStackProps`(前三枚插件头像 + `+N`,宿主自己画触发器时用它,不要另写一份折叠)
|
|
391
392
|
- **启用时序**:`useSessionPluginActivation`、`UseSessionPluginActivationResult`
|
|
392
393
|
|
|
393
394
|
## 附录:re-export 自 @blade-hq/agent-client
|
|
@@ -424,7 +425,7 @@ blade-chat { --primary: 262 83% 58%; height: 640px; }
|
|
|
424
425
|
|
|
425
426
|
插件行的渲染交给 `<PluginConnectorList>`(`PluginConnectorListProps`),它只负责样式与排版:
|
|
426
427
|
"该显示成什么"全部来自 `PluginConnectorItem`、`mergeConnectorItems`、`catalogToConnectorItems`、
|
|
427
|
-
`filterConnectorItems
|
|
428
|
+
`filterConnectorItems`,判定不各写一份。`sessionPluginLabel` 决定
|
|
428
429
|
一行读起来是什么名字。
|
|
429
430
|
|
|
430
431
|
启用时序由 `useSessionPluginActivation` 收口(返回值类型 `UseSessionPluginActivationResult`):
|
|
@@ -27,7 +27,7 @@ export interface ConnectorPanelProps {
|
|
|
27
27
|
renderComputerSection?: (query: string) => ReactNode;
|
|
28
28
|
/** 宿主注入:外部账号分区(飞书 / GitHub 等固定连接入口)。 */
|
|
29
29
|
renderExternalAccounts?: (query: string) => ReactNode;
|
|
30
|
-
/**
|
|
30
|
+
/** 宿主注入:底部操作区;不注入就不渲染这一块。 */
|
|
31
31
|
renderFooterActions?: () => ReactNode;
|
|
32
32
|
className?: string;
|
|
33
33
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BladeClient } from "@blade-hq/agent-client";
|
|
2
|
+
import type { TriggerSummary } from "./connector-panel-types";
|
|
3
|
+
export interface PluginTriggerStackProps {
|
|
4
|
+
client: BladeClient;
|
|
5
|
+
/** 会话内图标走会话接口;首页待选传 `null`(走账号级目录图标)。 */
|
|
6
|
+
sessionId: string | null;
|
|
7
|
+
/** 折叠结果,来自 `triggerSummary`——折叠规则只有那一处。 */
|
|
8
|
+
summary: TriggerSummary;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 触发器上的插件头像堆叠:前三枚圆形头像 + 其余折成 `+N`。
|
|
13
|
+
*
|
|
14
|
+
* 没有图标 token 的插件也用显示名首字占一枚圆——它和别的插件长得不一样,
|
|
15
|
+
* 「我选过它」就看得见;早先把这类项直接剔掉,选中后入口毫无变化。
|
|
16
|
+
*
|
|
17
|
+
* 圆环色取 `--background`(盖住被压住的那枚),与整站头像堆叠同一约定,见
|
|
18
|
+
* `apps/web/src/components/agent-board/ProjectMembers.tsx`:容器没有自己的底色时,
|
|
19
|
+
* 环就等于容器露出来的那层底。图标裁成圆形:插件 logo 多是方的,套在圆按钮里
|
|
20
|
+
* 「方套圆」才是那个视觉冲突的来源。
|
|
21
|
+
*/
|
|
22
|
+
export declare function PluginTriggerStack({ client, sessionId, summary, className }: PluginTriggerStackProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -7,6 +7,13 @@ export interface SessionPluginIconProps {
|
|
|
7
7
|
*/
|
|
8
8
|
sessionId: string | null;
|
|
9
9
|
plugin: Pick<SessionPlugin, "name" | "icon">;
|
|
10
|
+
/** 边长,默认 20。 */
|
|
11
|
+
size?: number;
|
|
12
|
+
/**
|
|
13
|
+
* 外框形状:`rounded`(默认,面板列表里的小方角)或 `circle`(触发器上的头像堆叠)。
|
|
14
|
+
* 默认值不动,避免改到列表与第三方接入方的观感。
|
|
15
|
+
*/
|
|
16
|
+
shape?: "rounded" | "circle";
|
|
10
17
|
className?: string;
|
|
11
18
|
}
|
|
12
19
|
export interface SessionPluginLabelProps {
|
|
@@ -20,4 +27,4 @@ export interface SessionPluginLabelProps {
|
|
|
20
27
|
*/
|
|
21
28
|
export declare function sessionPluginLabel(plugin: Pick<SessionPlugin, "name" | "display_name">): string;
|
|
22
29
|
/** Package-local plugin icon, with a stable generic placeholder. */
|
|
23
|
-
export declare function SessionPluginIcon({ client, sessionId, plugin, className }: SessionPluginIconProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function SessionPluginIcon({ client, sessionId, plugin, size, shape, className }: SessionPluginIconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { type QueuedMessage, type SessionQueueSnapshot } from "@blade-hq/agent-c
|
|
|
2
2
|
import { type JSX } from "react";
|
|
3
3
|
export interface SessionQueuePanelProps {
|
|
4
4
|
snapshot: SessionQueueSnapshot;
|
|
5
|
-
/**
|
|
5
|
+
/** 当前是否有可接收补充的运行任务(决定「立刻发送」是否可用) */
|
|
6
6
|
canDeliver: boolean;
|
|
7
7
|
/** 正在等服务端确认的条目 id:禁用该条目的操作,避免重复提交 */
|
|
8
8
|
pendingItemId?: string | null;
|
|
@@ -19,7 +19,11 @@ export interface SessionQueuePanelProps {
|
|
|
19
19
|
/**
|
|
20
20
|
* 会话消息队列面板:输入框上方的「待执行 · N」区域。
|
|
21
21
|
*
|
|
22
|
+
* 一行一条:左边三条横向的拖动手柄、中间单行截断的正文、右边 hover 才出现的操作
|
|
23
|
+
* (立刻发送 / 编辑 / 删除)。顺序靠拖动整行调整,手柄上也能用 Alt+↑/↓ 调(键盘
|
|
24
|
+
* 可达性不能因为去掉上下箭头按钮就没了)。
|
|
25
|
+
*
|
|
22
26
|
* 纯展示组件,不持有会话状态;能否编辑/删除/补充全部用 agent-client 的判定函数,
|
|
23
|
-
*
|
|
27
|
+
* 不在本包重写一份。拖动与键盘调整最终都由调用方提交完整的 pending id 顺序。
|
|
24
28
|
*/
|
|
25
29
|
export declare function SessionQueuePanel({ snapshot, canDeliver, pendingItemId, notice, onResume, onCancel, onEdit, onRequeue, onMove, onReorder, onDeliver, }: SessionQueuePanelProps): JSX.Element | null;
|
|
@@ -16,20 +16,22 @@ export interface PluginConnectorSelection {
|
|
|
16
16
|
}
|
|
17
17
|
/** 面板一行 → 待选条目。 */
|
|
18
18
|
export declare function selectionFromItem(item: PluginConnectorItem): PluginConnectorSelection;
|
|
19
|
-
/**
|
|
19
|
+
/** 触发器上最多直接显示几个插件头像,其余折成数量。 */
|
|
20
20
|
export declare const TRIGGER_ICON_LIMIT = 3;
|
|
21
|
-
/**
|
|
21
|
+
/** 触发器上的头像堆叠内容:前三个 + 折起来的数量。 */
|
|
22
22
|
export interface TriggerSummary {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/** 前 TRIGGER_ICON_LIMIT 个选中项,**不管有没有图标 token**。 */
|
|
24
|
+
visible: Array<Pick<PluginConnectorSelection, "name" | "displayName" | "icon" | "iconSource">>;
|
|
25
|
+
/** 超出 TRIGGER_ICON_LIMIT 的数量;0 表示不显示 `+N`。 */
|
|
25
26
|
overflow: number;
|
|
26
27
|
/** 已选/已启用的总数,用于无障碍标签与提示。 */
|
|
27
28
|
total: number;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* 把一份插件列表折成触发器上的头像堆叠。
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* 前三项都占位,**不管有没有图标 token**:没有图标的用显示名首字起头的圆形占位,
|
|
34
|
+
* 「选了哪个」照样看得见。早先的实现把无图标的项从图标位里剔掉、还把它们算进
|
|
35
|
+
* `overflow`,于是选中一个没有图标的插件时触发器毫无变化——选择在入口上不可见。
|
|
34
36
|
*/
|
|
35
|
-
export declare function triggerSummary(items: Array<Pick<PluginConnectorSelection, "name" | "icon" | "iconSource">>): TriggerSummary;
|
|
37
|
+
export declare function triggerSummary(items: Array<Pick<PluginConnectorSelection, "name" | "displayName" | "icon" | "iconSource">>): TriggerSummary;
|
|
@@ -36,6 +36,5 @@ export declare function mergeConnectorItems(sessionPlugins: SessionPlugin[], cat
|
|
|
36
36
|
* `unchecked` 刻意没有文案:列表没有读过用户的 Home,说任何话都是噪音,
|
|
37
37
|
* 入口是开关本身。
|
|
38
38
|
*/
|
|
39
|
-
export declare function pluginConnectorSummary(state: string | undefined): string | null;
|
|
40
39
|
/** 按名称和显示名做本地过滤;空查询返回全部。 */
|
|
41
40
|
export declare function filterConnectorItems(items: PluginConnectorItem[], query: string): PluginConnectorItem[];
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { PluginConnectorList } from "./components/PluginConnectorList";
|
|
|
16
16
|
export type { ConfiguringPlugin, PluginConnectorListProps } from "./components/PluginConnectorList";
|
|
17
17
|
export { useSessionPluginActivation } from "./components/use-session-plugin-activation";
|
|
18
18
|
export type { UseSessionPluginActivationResult } from "./components/use-session-plugin-activation";
|
|
19
|
-
export { catalogToConnectorItems, filterConnectorItems, mergeConnectorItems,
|
|
19
|
+
export { catalogToConnectorItems, filterConnectorItems, mergeConnectorItems, } from "./components/plugin-connector";
|
|
20
20
|
export type { PluginConnectorItem } from "./components/plugin-connector";
|
|
21
21
|
export { selectionFromItem, triggerSummary, TRIGGER_ICON_LIMIT } from "./components/connector-panel-types";
|
|
22
22
|
export type { PluginConnectorSelection, TriggerSummary, } from "./components/connector-panel-types";
|
|
@@ -24,6 +24,8 @@ export { SessionPluginSelector } from "./components/SessionPluginSelector";
|
|
|
24
24
|
export type { SessionPluginSelectorProps } from "./components/SessionPluginSelector";
|
|
25
25
|
export { SessionPluginIcon, sessionPluginLabel } from "./components/SessionPluginIcon";
|
|
26
26
|
export type { SessionPluginIconProps, SessionPluginLabelProps } from "./components/SessionPluginIcon";
|
|
27
|
+
export { PluginTriggerStack } from "./components/PluginTriggerStack";
|
|
28
|
+
export type { PluginTriggerStackProps } from "./components/PluginTriggerStack";
|
|
27
29
|
export { SessionPluginConfigDialog } from "./components/SessionPluginConfigDialog";
|
|
28
30
|
export type { SessionPluginConfigDialogProps } from "./components/SessionPluginConfigDialog";
|
|
29
31
|
export { SessionPluginConfigForm } from "./components/SessionPluginConfigForm";
|