lumiverse-spindle-types 0.5.17 → 0.5.18

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.5.17",
3
+ "version": "0.5.18",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -774,6 +774,26 @@ export interface ChatChangedPayloadDTO {
774
774
  changedFields?: string[];
775
775
  }
776
776
 
777
+ /**
778
+ * Payload for `CHAT_FORKED` events. Emitted when a chat is forked (branched)
779
+ * from a specific message — the messages up to and including the fork point are
780
+ * copied into a brand-new chat that shares the source chat's character.
781
+ */
782
+ export interface ChatForkedPayloadDTO {
783
+ /** Id of the source chat that was forked. */
784
+ sourceChatId: string;
785
+ /** Id of the newly created forked chat. Equal to `chat.id`. */
786
+ forkedChatId: string;
787
+ /** The new forked chat row, including its `metadata` (carries `branched_from` and `branch_at_message`). */
788
+ chat: { id: string; [key: string]: unknown };
789
+ /** The `branch_id` assigned to every message copied into the forked chat. */
790
+ branchId: string;
791
+ /** Id of the message in the source chat the fork was taken at. Messages up to and including this one were copied into the forked chat. */
792
+ forkedAtMessageId: string;
793
+ /** Zero-based index of the fork-point message within the source chat. */
794
+ forkedAtMessageIndex: number;
795
+ }
796
+
777
797
  // ─── User Preset DTOs ───────────────────────────────────────────────────
778
798
 
779
799
  /** Option entry for `select` and `multiselect` prompt variables. */
package/src/events.ts CHANGED
@@ -14,6 +14,7 @@ export enum CoreEventType {
14
14
  CONNECTED = "CONNECTED",
15
15
  CHAT_CHANGED = "CHAT_CHANGED",
16
16
  CHAT_SWITCHED = "CHAT_SWITCHED",
17
+ CHAT_FORKED = "CHAT_FORKED",
17
18
  MESSAGE_SENT = "MESSAGE_SENT",
18
19
  MESSAGE_EDITED = "MESSAGE_EDITED",
19
20
  MESSAGE_DELETED = "MESSAGE_DELETED",
package/src/index.ts CHANGED
@@ -49,6 +49,7 @@ export type {
49
49
  ChatUpdateDTO,
50
50
  ChatSwitchedPayloadDTO,
51
51
  ChatChangedPayloadDTO,
52
+ ChatForkedPayloadDTO,
52
53
  PromptVariableOptionDTO,
53
54
  PromptVariableDefDTO,
54
55
  PromptVariableTypeDTO,
@@ -85,6 +85,7 @@ import type {
85
85
  BackendProcessLifecycleEventDTO,
86
86
  BackendProcessStopOptionsDTO,
87
87
  ChatChangedPayloadDTO,
88
+ ChatForkedPayloadDTO,
88
89
  ChatMessageDTO,
89
90
  GenerationStartedPayloadDTO,
90
91
  StreamTokenPayloadDTO,
@@ -220,6 +221,8 @@ export interface SpindleAPI {
220
221
  on(event: "GENERATION_STOPPED", handler: (payload: GenerationStoppedPayloadDTO, userId?: string) => void): () => void;
221
222
  /** Subscribe to `CHAT_CHANGED` events. `changedFields` lists the dot-paths that differed when emitted by the standard `updateChat` path; absent on emits from other sources. */
222
223
  on(event: "CHAT_CHANGED", handler: (payload: ChatChangedPayloadDTO, userId?: string) => void): () => void;
224
+ /** Subscribe to `CHAT_FORKED` events. Emitted when a chat is forked (branched) from a message into a new chat. The payload carries the source/forked chat ids, the full forked chat row, and the fork point. */
225
+ on(event: "CHAT_FORKED", handler: (payload: ChatForkedPayloadDTO, userId?: string) => void): () => void;
223
226
  /**
224
227
  * Subscribe to swipe lifecycle events. The payload's `action` discriminator
225
228
  * tells you whether a swipe was added, updated, deleted, or navigated, and