lumiverse-spindle-types 0.6.15 → 0.6.16
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/src/dom.ts +71 -0
- package/src/index.ts +4 -0
package/package.json
CHANGED
package/src/dom.ts
CHANGED
|
@@ -890,6 +890,61 @@ export interface SpindleDisplayResolverRegistry {
|
|
|
890
890
|
}): void;
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
+
/** Query options shared by the Lumiverse recent-chats host reads. */
|
|
894
|
+
export interface SpindleRecentChatsQuery {
|
|
895
|
+
limit?: number;
|
|
896
|
+
offset?: number;
|
|
897
|
+
search?: string;
|
|
898
|
+
sort?: "name" | "recent" | "created";
|
|
899
|
+
direction?: "asc" | "desc";
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* A flat recent-chat row: one entry per chat, newest-first by default.
|
|
904
|
+
* `message_count` and `last_message_preview` ride along so list UIs never
|
|
905
|
+
* need a per-row message fetch.
|
|
906
|
+
*/
|
|
907
|
+
export interface SpindleRecentChat {
|
|
908
|
+
id: string;
|
|
909
|
+
character_id: string;
|
|
910
|
+
name: string;
|
|
911
|
+
created_at: number;
|
|
912
|
+
updated_at: number;
|
|
913
|
+
character_name: string;
|
|
914
|
+
character_image_id: string | null;
|
|
915
|
+
character_avatar_path?: string | null;
|
|
916
|
+
message_count: number;
|
|
917
|
+
last_message_preview: string;
|
|
918
|
+
[key: string]: unknown;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* A grouped recent-chat row: one entry per solo character / group member
|
|
923
|
+
* set, pointing at that lineage's most recent chat.
|
|
924
|
+
*/
|
|
925
|
+
export interface SpindleGroupedRecentChat {
|
|
926
|
+
character_id: string;
|
|
927
|
+
character_name: string;
|
|
928
|
+
character_image_id: string | null;
|
|
929
|
+
character_avatar_path?: string | null;
|
|
930
|
+
latest_chat_id: string;
|
|
931
|
+
latest_chat_name: string;
|
|
932
|
+
updated_at: number;
|
|
933
|
+
chat_count: number;
|
|
934
|
+
is_group: boolean;
|
|
935
|
+
group_character_ids?: string[];
|
|
936
|
+
group_name?: string;
|
|
937
|
+
multiplayer?: boolean;
|
|
938
|
+
[key: string]: unknown;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
/** Paginated recent-chats response (`data` + `total`). */
|
|
942
|
+
export interface SpindleRecentChatsPage<TRow = SpindleRecentChat> {
|
|
943
|
+
data: TRow[];
|
|
944
|
+
total: number;
|
|
945
|
+
[key: string]: unknown;
|
|
946
|
+
}
|
|
947
|
+
|
|
893
948
|
/** Context object provided to frontend extension modules */
|
|
894
949
|
export interface SpindleFrontendContext {
|
|
895
950
|
/** Immutable host compatibility descriptor for this extension runtime. */
|
|
@@ -1078,6 +1133,22 @@ export interface SpindleFrontendContext {
|
|
|
1078
1133
|
chats: {
|
|
1079
1134
|
/** Update a message through the host app's authenticated API. */
|
|
1080
1135
|
updateMessage(chatId: string, messageId: string, input: { content?: string }): Promise<unknown>;
|
|
1136
|
+
/**
|
|
1137
|
+
* Lumiverse host extension: flat one-row-per-chat recent list with
|
|
1138
|
+
* server-side search/sort and per-row preview enrichment. Free
|
|
1139
|
+
* (session-authenticated REST read). Undefined on hosts without it.
|
|
1140
|
+
*/
|
|
1141
|
+
listRecent?(options?: SpindleRecentChatsQuery): Promise<SpindleRecentChatsPage<SpindleRecentChat>>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Lumiverse host extension: recent chats grouped per character/group with
|
|
1144
|
+
* server-side search, sort, and pagination. Free (session-authenticated
|
|
1145
|
+
* REST read). Undefined on hosts without it.
|
|
1146
|
+
*/
|
|
1147
|
+
listRecentGrouped?(options?: SpindleRecentChatsQuery): Promise<SpindleRecentChatsPage<SpindleGroupedRecentChat>>;
|
|
1148
|
+
/** Lumiverse host extension: rename a chat / merge metadata (permission: "chats"). */
|
|
1149
|
+
update?(chatId: string, input: { name?: string; metadata?: Record<string, unknown> }): Promise<unknown>;
|
|
1150
|
+
/** Lumiverse host extension: permanently delete a chat (permission: "chats"). */
|
|
1151
|
+
delete?(chatId: string): Promise<void>;
|
|
1081
1152
|
};
|
|
1082
1153
|
/** Take over display-time content resolution in the browser. */
|
|
1083
1154
|
display?: SpindleDisplayResolverRegistry;
|
package/src/index.ts
CHANGED
|
@@ -267,6 +267,10 @@ export type {
|
|
|
267
267
|
SpindleMessageWidgetOptions,
|
|
268
268
|
PermissionRequestOptions,
|
|
269
269
|
SpindleFrontendContext,
|
|
270
|
+
SpindleRecentChatsQuery,
|
|
271
|
+
SpindleRecentChat,
|
|
272
|
+
SpindleGroupedRecentChat,
|
|
273
|
+
SpindleRecentChatsPage,
|
|
270
274
|
SpindleFrontendModule,
|
|
271
275
|
SpindleFrontendTeardown,
|
|
272
276
|
SpindleGuideDefinition,
|