@steerable/pack-sdk 0.6.65 → 0.6.66
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/package.json +1 -1
- package/types/web.d.ts +24 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steerable/pack-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.66",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Scenario pack contract for @steerable/agent-shell (pure types, zero runtime). A scenario pack declares every extension a vertical scenario needs — services, tools, tables, skills, agent seeds, HTTP routes, renderer slots, branding — and the host composes the selected packs at build time.",
|
|
6
6
|
"license": "Apache-2.0",
|
package/types/web.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export interface PackSettingsPanelContribution {
|
|
|
25
25
|
export interface PackChatSlotProps {
|
|
26
26
|
/** 当前打开的会话 id(无会话时为空串)。 */
|
|
27
27
|
chatId: string;
|
|
28
|
+
/** 当前标签 id。一个槽位可以按资源打开多个不同的标签。 */
|
|
29
|
+
tabId?: string;
|
|
30
|
+
/** 动态标签绑定的内容身份;静态槽位标签没有这一项。 */
|
|
31
|
+
contentId?: string;
|
|
32
|
+
/** 更新当前标签的显示标题,不改变内容身份。 */
|
|
33
|
+
onTitleChange?: (title: string) => void;
|
|
28
34
|
/** 关闭栏位(用户点面板右上角 ×)。 */
|
|
29
35
|
onClose: () => void;
|
|
30
36
|
/**
|
|
@@ -37,10 +43,17 @@ export interface PackChatSlotProps {
|
|
|
37
43
|
}) => boolean | void | Promise<boolean | void>;
|
|
38
44
|
}
|
|
39
45
|
|
|
46
|
+
export interface PackChatSlotTarget {
|
|
47
|
+
/** 文件完整地址、浏览器会话 id 等稳定内容身份。 */
|
|
48
|
+
contentId?: string;
|
|
49
|
+
/** 该标签的初始显示标题。 */
|
|
50
|
+
title?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
40
53
|
/** 自动展开钩子拿到的布局 API。 */
|
|
41
54
|
export interface PackChatSlotAutoRevealApi {
|
|
42
55
|
/** 请求把本槽位加进右侧标签。栏位空着时显示它;已有别的标签时只追加,不抢走当前标签。 */
|
|
43
|
-
reveal: () => void;
|
|
56
|
+
reveal: (target?: PackChatSlotTarget) => void;
|
|
44
57
|
/** 当前会话 id(事件载荷据此过滤)。 */
|
|
45
58
|
getCurrentChatId: () => string | null;
|
|
46
59
|
}
|
|
@@ -53,6 +66,16 @@ export interface PackChatSlotContribution {
|
|
|
53
66
|
readonly Icon: ComponentType<{ className?: string }>;
|
|
54
67
|
/** 面板本体;shell 布局注入 {@link PackChatSlotProps}。 */
|
|
55
68
|
readonly Component: ComponentType<PackChatSlotProps>;
|
|
69
|
+
/** 加号每次创建独立内容实例;缺省时同 kind 只有一个静态内容。 */
|
|
70
|
+
readonly multiple?: boolean;
|
|
71
|
+
/** 切走后仍保持 React body 挂载;适合浏览器等实时页面。 */
|
|
72
|
+
readonly keepMounted?: boolean;
|
|
73
|
+
/** 静态打开或旧状态迁移时使用的内容身份;缺省为 slotId。 */
|
|
74
|
+
readonly defaultContentId?: string;
|
|
75
|
+
/** `multiple` 类型从加号新建实例时生成内容身份。 */
|
|
76
|
+
readonly createContentId?: () => string;
|
|
77
|
+
/** 用户关闭标签后释放该内容在宿主侧的资源。 */
|
|
78
|
+
readonly onContentClosed?: (input: { chatId: string; contentId: string }) => void;
|
|
56
79
|
/**
|
|
57
80
|
* 自动展开:布局挂载时调用一次,包实现自己的事件订阅(桥接事件),
|
|
58
81
|
* 命中当前会话时调 reveal()。返回 cleanup(布局卸载时调用)。
|