@storvia/sdk 0.9.7 → 0.9.9
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/dist/index.cjs.js +8 -8
- package/dist/index.d.mts +175 -79
- package/dist/index.esm.js +6 -6
- package/dist/index.umd.js +8 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ interface AssetItem {
|
|
|
11
11
|
assetType: 'avatar' | 'icon';
|
|
12
12
|
category: string;
|
|
13
13
|
}
|
|
14
|
-
type StorviaErrorCode = 'UNAUTHORIZED' | 'INSUFFICIENT_CREDITS' | 'VIOLATION_WORD_DETECTED' | 'CONTENT_FILTERED' | 'MODEL_REFUSAL' | 'STREAM_INTERRUPTED' | 'RATE_LIMITED' | 'GENERATING_IN_PROGRESS' | 'CONCURRENT_GENERATION_LIMIT' | 'INVENTORY_LIMIT' | 'CUSTOM_FIELDS_LIMIT' | 'MODEL_NOT_FOUND' | 'GAME_NOT_FOUND' | 'INVALID_REQUEST' | 'INVALID_EXTRACT_RULE' | 'INTERNAL_ERROR' | 'NOT_INITIALIZED' | 'NOT_SUPPORTED_IN_PREVIEW' | 'NETWORK_ERROR' | 'REQUEST_TIMEOUT' | 'MODEL_LOADING_TIMEOUT' | '
|
|
14
|
+
type StorviaErrorCode = 'UNAUTHORIZED' | 'INSUFFICIENT_CREDITS' | 'VIOLATION_WORD_DETECTED' | 'CONTENT_FILTERED' | 'MODEL_REFUSAL' | 'STREAM_INTERRUPTED' | 'RATE_LIMITED' | 'GENERATING_IN_PROGRESS' | 'CONCURRENT_GENERATION_LIMIT' | 'INVENTORY_LIMIT' | 'CUSTOM_FIELDS_LIMIT' | 'MODEL_NOT_FOUND' | 'GAME_NOT_FOUND' | 'INVALID_REQUEST' | 'INVALID_EXTRACT_RULE' | 'INTERNAL_ERROR' | 'NOT_INITIALIZED' | 'NOT_SUPPORTED_IN_PREVIEW' | 'NETWORK_ERROR' | 'REQUEST_TIMEOUT' | 'MODEL_LOADING_TIMEOUT' | 'DAISY_CARD_REQUIRED' | 'MESSAGE_NOT_FOUND' | 'MESSAGE_TOO_OLD' | 'NO_MESSAGES_TO_DELETE' | 'GENERATION_TIMEOUT' | 'GENERATION_LOST' | 'REPETITION_LOOP' | 'SAVE_FAILED' | 'FINALIZE_FAILED' | 'CONVERSATION_NOT_FOUND' | 'EMPTY_MESSAGE' | 'CONTINUE_MODEL_NOT_AVAILABLE' | 'CONTINUE_PROMPT_MISSING' | 'GENERATION_ABORTED';
|
|
15
15
|
/** AI 本轮的属性变更(仅包含发生改变的字段) */
|
|
16
16
|
interface StateChanges {
|
|
17
17
|
/** 世界状态变更(扁平 KV) */
|
|
@@ -504,8 +504,8 @@ declare class HttpClient {
|
|
|
504
504
|
setToken(token: string): void;
|
|
505
505
|
setDebug(enabled: boolean): void;
|
|
506
506
|
private static readonly REQUEST_TIMEOUT;
|
|
507
|
-
private static readonly
|
|
508
|
-
private static readonly
|
|
507
|
+
private static readonly INITIAL_TIMEOUT;
|
|
508
|
+
private static readonly RESUME_STALL_TIMEOUT;
|
|
509
509
|
/** 非 StorviaError(通常是 fetch 网络层抛错)统一弹 NETWORK_ERROR toast */
|
|
510
510
|
private maybeShowNetworkToast;
|
|
511
511
|
/** 将 AbortError 转换为 StorviaError('REQUEST_TIMEOUT') */
|
|
@@ -688,6 +688,13 @@ declare class CharacterStateModule {
|
|
|
688
688
|
* 系统自动保留字段元数据(type/min/max)并做范围钳位。
|
|
689
689
|
*/
|
|
690
690
|
update(name: string, group: string, values: Record<string, string | number | boolean>): Promise<void>;
|
|
691
|
+
/**
|
|
692
|
+
* 删除该角色指定分组下的字段。传空数组直接返回,不发请求。
|
|
693
|
+
* 删到分组为空时分组本身仍保留(要连分组一起删用 [removeGroup])。
|
|
694
|
+
*/
|
|
695
|
+
remove(name: string, group: string, keys: string[]): Promise<void>;
|
|
696
|
+
/** 删除该角色的整个属性分组(连同组内所有字段)。分组不存在时是 no-op。 */
|
|
697
|
+
removeGroup(name: string, group: string): Promise<void>;
|
|
691
698
|
}
|
|
692
699
|
declare class CharactersModule {
|
|
693
700
|
private http;
|
|
@@ -795,6 +802,13 @@ declare class PlayerStateModule {
|
|
|
795
802
|
get(): Promise<Record<string, Record<string, FieldValue>>>;
|
|
796
803
|
get(group: string): Promise<Record<string, FieldValue>>;
|
|
797
804
|
update(group: string, values: Record<string, string | number | boolean>): Promise<void>;
|
|
805
|
+
/**
|
|
806
|
+
* 删除指定分组下的字段。传空数组直接返回,不发请求。
|
|
807
|
+
* 删到分组为空时分组本身仍保留(要连分组一起删用 [removeGroup])。
|
|
808
|
+
*/
|
|
809
|
+
remove(group: string, keys: string[]): Promise<void>;
|
|
810
|
+
/** 删除整个分组(连同组内所有字段)。分组不存在时是 no-op。 */
|
|
811
|
+
removeGroup(group: string): Promise<void>;
|
|
798
812
|
}
|
|
799
813
|
declare class PlayerModule {
|
|
800
814
|
private http;
|
|
@@ -904,80 +918,6 @@ declare class MemoryModule {
|
|
|
904
918
|
update(content: string): Promise<AISummary>;
|
|
905
919
|
}
|
|
906
920
|
|
|
907
|
-
interface DevConfig {
|
|
908
|
-
apiKey: string;
|
|
909
|
-
gameId: string;
|
|
910
|
-
/** 本地预览/dev:指定初始模型的展示名(display name)。不传则用第一个可用模型。 */
|
|
911
|
-
model?: string;
|
|
912
|
-
}
|
|
913
|
-
declare class StorviaSDK {
|
|
914
|
-
private http;
|
|
915
|
-
private baseUrl;
|
|
916
|
-
private gameId;
|
|
917
|
-
private conversationId;
|
|
918
|
-
private modelId;
|
|
919
|
-
private models;
|
|
920
|
-
/** 预设 id(per-model);由宿主经 init / 'set-preset' 下发,每次生成请求自动带上 preset */
|
|
921
|
-
private presetId;
|
|
922
|
-
private accessToken;
|
|
923
|
-
private initialized;
|
|
924
|
-
private isPreview;
|
|
925
|
-
private previewConfig;
|
|
926
|
-
private bus;
|
|
927
|
-
chat: ChatModule;
|
|
928
|
-
characters: CharactersModule;
|
|
929
|
-
relationships: RelationshipsModule;
|
|
930
|
-
inventory: InventoryModule;
|
|
931
|
-
world: WorldModule;
|
|
932
|
-
player: PlayerModule;
|
|
933
|
-
custom: CustomModule;
|
|
934
|
-
save: SaveModule;
|
|
935
|
-
state: StateModule;
|
|
936
|
-
memory: MemoryModule;
|
|
937
|
-
init(): Promise<void>;
|
|
938
|
-
/**
|
|
939
|
-
* 监听宿主运行时下发的模型切换(envelope 'set-model')。
|
|
940
|
-
* 正式模式用:宿主已接管模型选择,用户在宿主 FAB 改模型时实时同步到 SDK。
|
|
941
|
-
* (预览模式的 set-model 在 listenForPreviewMessages 内单独处理。)
|
|
942
|
-
*/
|
|
943
|
-
private listenForModelChange;
|
|
944
|
-
/**
|
|
945
|
-
* 监听父页面 token 刷新(envelope 'token-update')。
|
|
946
|
-
* Supabase JWT 默认 1h 过期,父页面 session 自动刷新后转发新 token 进来,
|
|
947
|
-
* 否则 SDK 会一直用旧 token 请求被服务端 401。
|
|
948
|
-
*/
|
|
949
|
-
private listenForTokenUpdate;
|
|
950
|
-
/** 监听父页面发来的预览模式动态更新(envelope 'config-update' / 'set-model') */
|
|
951
|
-
private listenForPreviewMessages;
|
|
952
|
-
/**
|
|
953
|
-
* 调用 POST /preview/initial-snapshot 拉取与正式发布等价的初始数据
|
|
954
|
-
* - 预览模式:传 game_config + game_state_override(来自 previewConfig)
|
|
955
|
-
* - dev 模式:HttpClient 自动带 x-api-key,后端按 game_id 反查
|
|
956
|
-
* 失败时返回 null(不阻塞 init,list/get 仍能用空 mem 工作)
|
|
957
|
-
*/
|
|
958
|
-
private fetchPreviewSnapshot;
|
|
959
|
-
/** 重新拉 snapshot 并把结果灌进每个 module 的 mem(用于 update-config 后同步) */
|
|
960
|
-
private refreshPreviewSnapshot;
|
|
961
|
-
private fetchModels;
|
|
962
|
-
private authenticate;
|
|
963
|
-
initDev(devConfig: DevConfig): Promise<void>;
|
|
964
|
-
getAssets(type: 'avatar' | 'icon', category?: string): Promise<AssetItem[]>;
|
|
965
|
-
}
|
|
966
|
-
declare function createStorviaSDK(options?: {
|
|
967
|
-
dev?: DevConfig;
|
|
968
|
-
}): Promise<StorviaSDK>;
|
|
969
|
-
|
|
970
|
-
declare class StorviaError extends Error {
|
|
971
|
-
code: StorviaErrorCode;
|
|
972
|
-
/**
|
|
973
|
-
* 命中的违禁词列表,仅 `code === 'VIOLATION_WORD_DETECTED'` 时有值。
|
|
974
|
-
* 服务端以 `matched_words` 下发,SDK 转成 camelCase 挂在这里,
|
|
975
|
-
* 供游戏侧在自己的 UI 里高亮 / 提示具体是哪几个词。
|
|
976
|
-
*/
|
|
977
|
-
matchedWords?: string[];
|
|
978
|
-
constructor(code: StorviaErrorCode, message: string, matchedWords?: string[]);
|
|
979
|
-
}
|
|
980
|
-
|
|
981
921
|
/**
|
|
982
922
|
* 父子 iframe postMessage 协议类型
|
|
983
923
|
*
|
|
@@ -1096,12 +1036,34 @@ interface NavigatePayload {
|
|
|
1096
1036
|
target: 'wallet';
|
|
1097
1037
|
reason?: 'insufficient_credits' | 'daisy_card_required';
|
|
1098
1038
|
}
|
|
1039
|
+
/** 面板 tab 维度,供小组件声明这次改了哪块(宿主据此亮 badge) */
|
|
1040
|
+
declare const HOST_PANEL_SCOPES: readonly ["player", "characters", "inventory", "relations", "world"];
|
|
1041
|
+
type HostPanelScope = (typeof HOST_PANEL_SCOPES)[number];
|
|
1042
|
+
/**
|
|
1043
|
+
* 子 → 父:请求宿主在主线(聊天页)弹一条 toast。
|
|
1044
|
+
*
|
|
1045
|
+
* 只在小组件**后台运行**时展示 —— 前台时玩家就在小组件里看着,不必再打断。
|
|
1046
|
+
* 宿主把 text 当纯文本渲染(不解析 markdown / HTML)、截断、按小组件维度节流。
|
|
1047
|
+
*
|
|
1048
|
+
* 刻意不带 level / 图标:这是「消息通知」不是「结果通知」,成功✓失败✗的语义
|
|
1049
|
+
* 对「你的信件已送达」这类内容是误导。要视觉区分就在文本里放 emoji。
|
|
1050
|
+
*/
|
|
1051
|
+
interface HostNotifyPayload {
|
|
1052
|
+
text: string;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* 子 → 父:小组件改过主线状态,请求宿主重拉 game_state 刷新聊天页面板。
|
|
1056
|
+
* scope 只用于亮对应 tab 的 badge,宿主恒全量重拉。
|
|
1057
|
+
*/
|
|
1058
|
+
interface HostStateChangedPayload {
|
|
1059
|
+
scope?: HostPanelScope[];
|
|
1060
|
+
}
|
|
1099
1061
|
interface AckPayload {
|
|
1100
1062
|
ok: boolean;
|
|
1101
1063
|
error?: string;
|
|
1102
1064
|
}
|
|
1103
1065
|
type DownstreamMsg = ProtocolEnvelope<'init', InitPayload> | ProtocolEnvelope<'preview-init', PreviewInitPayload> | ProtocolEnvelope<'token-update', TokenUpdatePayload> | ProtocolEnvelope<'config-update', ConfigUpdatePayload> | ProtocolEnvelope<'set-model', SetModelPayload> | ProtocolEnvelope<'set-preset', SetPresetPayload> | ProtocolEnvelope<'orientation', OrientationPayload> | ProtocolEnvelope<'ack', AckPayload>;
|
|
1104
|
-
type UpstreamMsg = ProtocolEnvelope<'ready', ReadyPayload> | ProtocolEnvelope<'exit', Record<string, never>> | ProtocolEnvelope<'request-orientation', OrientationPayload> | ProtocolEnvelope<'error', SdkErrorPayload> | ProtocolEnvelope<'navigate', NavigatePayload> | ProtocolEnvelope<'model-change', SetModelPayload> | ProtocolEnvelope<'ack', AckPayload>;
|
|
1066
|
+
type UpstreamMsg = ProtocolEnvelope<'ready', ReadyPayload> | ProtocolEnvelope<'exit', Record<string, never>> | ProtocolEnvelope<'request-orientation', OrientationPayload> | ProtocolEnvelope<'error', SdkErrorPayload> | ProtocolEnvelope<'navigate', NavigatePayload> | ProtocolEnvelope<'model-change', SetModelPayload> | ProtocolEnvelope<'host-notify', HostNotifyPayload> | ProtocolEnvelope<'host-state-changed', HostStateChangedPayload> | ProtocolEnvelope<'ack', AckPayload>;
|
|
1105
1067
|
declare function isProtocolEnvelope(data: unknown): data is ProtocolEnvelope<string, unknown>;
|
|
1106
1068
|
declare function envelope<T extends string, P>(type: T, payload: P, opts?: {
|
|
1107
1069
|
id?: string;
|
|
@@ -1175,6 +1137,140 @@ declare class StorviaBus<TIn extends AnyEnvelope, TOut extends AnyEnvelope> {
|
|
|
1175
1137
|
destroy(): void;
|
|
1176
1138
|
}
|
|
1177
1139
|
|
|
1140
|
+
/**
|
|
1141
|
+
* 小组件 → 主线(宿主聊天页)的联动通道。
|
|
1142
|
+
*
|
|
1143
|
+
* 两个能力都只发 postMessage 信号,不打后端:
|
|
1144
|
+
* - [notify] 主线弹一条 toast(仅小组件**后台运行**时展示,前台时宿主静默丢弃)
|
|
1145
|
+
* - [refreshPanel] 主线重拉 game_state 刷新游戏面板
|
|
1146
|
+
*
|
|
1147
|
+
* 面板能刷出内容的前提:小组件与主线**共享** player / characters / inventory /
|
|
1148
|
+
* relationships / world 这几块状态(`sdk.player` / `sdk.characters` / `sdk.inventory` /
|
|
1149
|
+
* `sdk.relationships` / `sdk.world` 写的就是主线那一份),所以先写再 refreshPanel 即可。
|
|
1150
|
+
* `sdk.custom` / `sdk.save` 是小组件自己的沙盒,**不会**出现在主线面板上。
|
|
1151
|
+
*/
|
|
1152
|
+
/**
|
|
1153
|
+
* toast 文本上限,超出截断。
|
|
1154
|
+
* ⚠️ 三端对齐:Storvia `src/constants/limits.ts` 的 WIDGET_HOST_NOTIFY_MAX_LENGTH、
|
|
1155
|
+
* App `lib/core/constants/app_limits.dart` 的 widgetHostNotifyMaxLength 须同值。
|
|
1156
|
+
*/
|
|
1157
|
+
declare const HOST_NOTIFY_MAX_LENGTH = 60;
|
|
1158
|
+
/**
|
|
1159
|
+
* 两次 toast / 两次面板刷新的最小间隔。
|
|
1160
|
+
* 这里只是第一道(省一次 postMessage),宿主侧还会独立再拦一道 —— 作者能绕过 SDK
|
|
1161
|
+
* 直接 postMessage,节流的权威判定必须在宿主。
|
|
1162
|
+
*
|
|
1163
|
+
* 两个值差两个数量级是因为代价不同:notify 纯前端(发一条消息、宿主渲染一条 toast,
|
|
1164
|
+
* toast 在宿主侧纵向堆叠不会互相覆盖),卡 1s 只为防刷屏;refreshPanel 每次都会让
|
|
1165
|
+
* 宿主重拉一次会话详情,是真实后端请求,必须卡住。
|
|
1166
|
+
*/
|
|
1167
|
+
declare const HOST_NOTIFY_MIN_INTERVAL_MS = 1000;
|
|
1168
|
+
declare const HOST_REFRESH_MIN_INTERVAL_MS = 10000;
|
|
1169
|
+
declare class HostModule {
|
|
1170
|
+
private send;
|
|
1171
|
+
private isPreview;
|
|
1172
|
+
/** 注入时间源,便于测试;生产恒 Date.now */
|
|
1173
|
+
private now;
|
|
1174
|
+
private lastNotifyAt;
|
|
1175
|
+
private lastRefreshAt;
|
|
1176
|
+
constructor(send: (msg: UpstreamMsg) => void, isPreview?: boolean,
|
|
1177
|
+
/** 注入时间源,便于测试;生产恒 Date.now */
|
|
1178
|
+
now?: () => number);
|
|
1179
|
+
/**
|
|
1180
|
+
* 给主线聊天页发一条 toast。
|
|
1181
|
+
*
|
|
1182
|
+
* 返回是否真的发出去了:文本为空、或距上次不足 [HOST_NOTIFY_MIN_INTERVAL_MS] 时返回 false。
|
|
1183
|
+
* 预览模式下没有主线可通知,降级为在小组件内部弹一条 SDK 自带 toast,方便作者调效果。
|
|
1184
|
+
*
|
|
1185
|
+
* 宿主渲染成不带状态图标的纯文本 toast —— 这是消息通知不是结果通知。
|
|
1186
|
+
* 想强调语气就在文本里放 emoji(`sdk.host.notify('📮 你的信件已送达')`)。
|
|
1187
|
+
*/
|
|
1188
|
+
notify(text: string): boolean;
|
|
1189
|
+
/**
|
|
1190
|
+
* 请求主线重拉 game_state 刷新面板(写完状态后调)。
|
|
1191
|
+
*
|
|
1192
|
+
* `scope` 声明这次改了哪几块,宿主据此亮对应 tab 的 badge;不传就只刷新不亮 badge。
|
|
1193
|
+
* 返回是否真的发出去了:距上次不足 [HOST_REFRESH_MIN_INTERVAL_MS] 时返回 false。
|
|
1194
|
+
* 预览模式下主线面板不存在,直接 no-op 返回 false。
|
|
1195
|
+
*/
|
|
1196
|
+
refreshPanel(scope?: HostPanelScope[]): boolean;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
interface DevConfig {
|
|
1200
|
+
apiKey: string;
|
|
1201
|
+
gameId: string;
|
|
1202
|
+
/** 本地预览/dev:指定初始模型的展示名(display name)。不传则用第一个可用模型。 */
|
|
1203
|
+
model?: string;
|
|
1204
|
+
}
|
|
1205
|
+
declare class StorviaSDK {
|
|
1206
|
+
private http;
|
|
1207
|
+
private baseUrl;
|
|
1208
|
+
private gameId;
|
|
1209
|
+
private conversationId;
|
|
1210
|
+
private modelId;
|
|
1211
|
+
private models;
|
|
1212
|
+
/** 预设 id(per-model);由宿主经 init / 'set-preset' 下发,每次生成请求自动带上 preset */
|
|
1213
|
+
private presetId;
|
|
1214
|
+
private accessToken;
|
|
1215
|
+
private initialized;
|
|
1216
|
+
private isPreview;
|
|
1217
|
+
private previewConfig;
|
|
1218
|
+
private bus;
|
|
1219
|
+
chat: ChatModule;
|
|
1220
|
+
characters: CharactersModule;
|
|
1221
|
+
relationships: RelationshipsModule;
|
|
1222
|
+
inventory: InventoryModule;
|
|
1223
|
+
world: WorldModule;
|
|
1224
|
+
player: PlayerModule;
|
|
1225
|
+
custom: CustomModule;
|
|
1226
|
+
save: SaveModule;
|
|
1227
|
+
state: StateModule;
|
|
1228
|
+
memory: MemoryModule;
|
|
1229
|
+
host: HostModule;
|
|
1230
|
+
init(): Promise<void>;
|
|
1231
|
+
/**
|
|
1232
|
+
* 监听宿主运行时下发的模型切换(envelope 'set-model')。
|
|
1233
|
+
* 正式模式用:宿主已接管模型选择,用户在宿主 FAB 改模型时实时同步到 SDK。
|
|
1234
|
+
* (预览模式的 set-model 在 listenForPreviewMessages 内单独处理。)
|
|
1235
|
+
*/
|
|
1236
|
+
private listenForModelChange;
|
|
1237
|
+
/**
|
|
1238
|
+
* 监听父页面 token 刷新(envelope 'token-update')。
|
|
1239
|
+
* Supabase JWT 默认 1h 过期,父页面 session 自动刷新后转发新 token 进来,
|
|
1240
|
+
* 否则 SDK 会一直用旧 token 请求被服务端 401。
|
|
1241
|
+
*/
|
|
1242
|
+
private listenForTokenUpdate;
|
|
1243
|
+
/** 监听父页面发来的预览模式动态更新(envelope 'config-update' / 'set-model') */
|
|
1244
|
+
private listenForPreviewMessages;
|
|
1245
|
+
/**
|
|
1246
|
+
* 调用 POST /preview/initial-snapshot 拉取与正式发布等价的初始数据
|
|
1247
|
+
* - 预览模式:传 game_config + game_state_override(来自 previewConfig)
|
|
1248
|
+
* - dev 模式:HttpClient 自动带 x-api-key,后端按 game_id 反查
|
|
1249
|
+
* 失败时返回 null(不阻塞 init,list/get 仍能用空 mem 工作)
|
|
1250
|
+
*/
|
|
1251
|
+
private fetchPreviewSnapshot;
|
|
1252
|
+
/** 重新拉 snapshot 并把结果灌进每个 module 的 mem(用于 update-config 后同步) */
|
|
1253
|
+
private refreshPreviewSnapshot;
|
|
1254
|
+
private fetchModels;
|
|
1255
|
+
private authenticate;
|
|
1256
|
+
initDev(devConfig: DevConfig): Promise<void>;
|
|
1257
|
+
getAssets(type: 'avatar' | 'icon', category?: string): Promise<AssetItem[]>;
|
|
1258
|
+
}
|
|
1259
|
+
declare function createStorviaSDK(options?: {
|
|
1260
|
+
dev?: DevConfig;
|
|
1261
|
+
}): Promise<StorviaSDK>;
|
|
1262
|
+
|
|
1263
|
+
declare class StorviaError extends Error {
|
|
1264
|
+
code: StorviaErrorCode;
|
|
1265
|
+
/**
|
|
1266
|
+
* 命中的违禁词列表,仅 `code === 'VIOLATION_WORD_DETECTED'` 时有值。
|
|
1267
|
+
* 服务端以 `matched_words` 下发,SDK 转成 camelCase 挂在这里,
|
|
1268
|
+
* 供游戏侧在自己的 UI 里高亮 / 提示具体是哪几个词。
|
|
1269
|
+
*/
|
|
1270
|
+
matchedWords?: string[];
|
|
1271
|
+
constructor(code: StorviaErrorCode, message: string, matchedWords?: string[]);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1178
1274
|
/**
|
|
1179
1275
|
* SDK 内置 Toast:参考主站 Toast.vue 样式
|
|
1180
1276
|
* 用于在 HTTP 层捕获错误后自动提示用户
|
|
@@ -1193,4 +1289,4 @@ interface ToastAction {
|
|
|
1193
1289
|
*/
|
|
1194
1290
|
declare function showToast(message: string, type?: ToastType, duration?: number, action?: ToastAction): void;
|
|
1195
1291
|
|
|
1196
|
-
export { type AISummary, type AckPayload, type AssetItem, type CharacterAddOptions, type CharacterDetail, type CharacterPersona, type CharacterUpdateOptions, type ChatAbortInfo, type ChatAbortedCallback, type ChatCancelOptions, type ChatCancelResult, type ChatContinueOptions, type ChatDoneCallback, type ChatDoneInfo, type ChatGenerateOptions, type ChatMessage, type ChatMessageCursor, type ChatMessagesOptions, type ChatMessagesResponse, type ChatReconnectingCallback, type ChatResponse, type ChatResumeOptions, type ChatRetryOptions, type ChatSaveOptions, type ChatSendOptions, type ChatStateCallback, type ConfigUpdatePayload, type CurrentState, type DormantState, type DownstreamMsg, type FieldValue, type Gender, type InitPayload, type InventoryAddOptions, type InventoryMoveOptions, type InventoryRemoveGroupOptions, type InventoryRemoveOptions, type InventoryState, type InventoryUpdateOptions, type ItemData, type OrientationPayload, PROTOCOL_VERSION, type PlayerPersona, type PreviewConfig, type PreviewInitPayload, type ProtocolEnvelope, type ReadyPayload, type Relationship, type RichFieldValue, type SdkErrorPayload, type SetModelPayload, type State, type StateChanges, StorviaBus, type StorviaBusOptions, StorviaError, type StorviaErrorCode, StorviaSDK, type TokenUpdatePayload, type UpstreamMsg, createStorviaSDK, envelope, extractFieldValue, isProtocolEnvelope, isRichFieldValue, setToastEnabled, showToast };
|
|
1292
|
+
export { type AISummary, type AckPayload, type AssetItem, type CharacterAddOptions, type CharacterDetail, type CharacterPersona, type CharacterUpdateOptions, type ChatAbortInfo, type ChatAbortedCallback, type ChatCancelOptions, type ChatCancelResult, type ChatContinueOptions, type ChatDoneCallback, type ChatDoneInfo, type ChatGenerateOptions, type ChatMessage, type ChatMessageCursor, type ChatMessagesOptions, type ChatMessagesResponse, type ChatReconnectingCallback, type ChatResponse, type ChatResumeOptions, type ChatRetryOptions, type ChatSaveOptions, type ChatSendOptions, type ChatStateCallback, type ConfigUpdatePayload, type CurrentState, type DormantState, type DownstreamMsg, type FieldValue, type Gender, HOST_NOTIFY_MAX_LENGTH, HOST_NOTIFY_MIN_INTERVAL_MS, HOST_PANEL_SCOPES, HOST_REFRESH_MIN_INTERVAL_MS, HostModule, type HostNotifyPayload, type HostPanelScope, type HostStateChangedPayload, type InitPayload, type InventoryAddOptions, type InventoryMoveOptions, type InventoryRemoveGroupOptions, type InventoryRemoveOptions, type InventoryState, type InventoryUpdateOptions, type ItemData, type OrientationPayload, PROTOCOL_VERSION, type PlayerPersona, type PreviewConfig, type PreviewInitPayload, type ProtocolEnvelope, type ReadyPayload, type Relationship, type RichFieldValue, type SdkErrorPayload, type SetModelPayload, type State, type StateChanges, StorviaBus, type StorviaBusOptions, StorviaError, type StorviaErrorCode, StorviaSDK, type TokenUpdatePayload, type UpstreamMsg, createStorviaSDK, envelope, extractFieldValue, isProtocolEnvelope, isRichFieldValue, setToastEnabled, showToast };
|