lumiverse-spindle-types 0.4.60 → 0.4.62
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/api.ts +10 -0
- package/src/index.ts +1 -0
- package/src/spindle-api.ts +5 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -44,6 +44,8 @@ export interface MacroDefinitionDTO {
|
|
|
44
44
|
returnType?: "string" | "integer" | "number" | "boolean";
|
|
45
45
|
args?: { name: string; description?: string; required?: boolean }[];
|
|
46
46
|
handler: string; // serialized function body (executed in worker context)
|
|
47
|
+
/** Set true when the macro returns different output across calls with the same args (time, randomness, idle duration). The display-regex cache will not store resolutions that include this macro. */
|
|
48
|
+
volatile?: boolean;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/** Minimal shape exposed to extension macro handlers. Additional fields may be present. */
|
|
@@ -570,6 +572,14 @@ export interface ChatSwitchedPayloadDTO {
|
|
|
570
572
|
chatId: string | null;
|
|
571
573
|
}
|
|
572
574
|
|
|
575
|
+
/** Payload for `CHAT_CHANGED` events. */
|
|
576
|
+
export interface ChatChangedPayloadDTO {
|
|
577
|
+
/** The chat after the change. */
|
|
578
|
+
chat: { id: string; [key: string]: unknown };
|
|
579
|
+
/** Optional. Dot-paths of fields that differed between the prior and new chat (e.g. `metadata.macro_variables.local.foo`, `name`, `metadata.last_message_id`). Absent on events emitted by sources that don't compute the diff. */
|
|
580
|
+
changedFields?: string[];
|
|
581
|
+
}
|
|
582
|
+
|
|
573
583
|
// ─── World Book DTOs ─────────────────────────────────────────────────────
|
|
574
584
|
|
|
575
585
|
/**
|
package/src/index.ts
CHANGED
package/src/spindle-api.ts
CHANGED
|
@@ -73,6 +73,7 @@ import type {
|
|
|
73
73
|
BackendProcessInfoDTO,
|
|
74
74
|
BackendProcessLifecycleEventDTO,
|
|
75
75
|
BackendProcessStopOptionsDTO,
|
|
76
|
+
ChatChangedPayloadDTO,
|
|
76
77
|
GenerationStartedPayloadDTO,
|
|
77
78
|
StreamTokenPayloadDTO,
|
|
78
79
|
GenerationEndedPayloadDTO,
|
|
@@ -176,6 +177,8 @@ export interface SpindleAPI {
|
|
|
176
177
|
on(event: "GENERATION_ENDED", handler: (payload: GenerationEndedPayloadDTO, userId?: string) => void): () => void;
|
|
177
178
|
/** Subscribe to generation-stopped events (requires `generation` permission). The optional `userId` identifies which user triggered the event. */
|
|
178
179
|
on(event: "GENERATION_STOPPED", handler: (payload: GenerationStoppedPayloadDTO, userId?: string) => void): () => void;
|
|
180
|
+
/** 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. */
|
|
181
|
+
on(event: "CHAT_CHANGED", handler: (payload: ChatChangedPayloadDTO, userId?: string) => void): () => void;
|
|
179
182
|
/**
|
|
180
183
|
* Subscribe to swipe lifecycle events. The payload's `action` discriminator
|
|
181
184
|
* tells you whether a swipe was added, updated, deleted, or navigated, and
|
|
@@ -501,6 +504,8 @@ export interface SpindleAPI {
|
|
|
501
504
|
text?: string | null;
|
|
502
505
|
duration?: number | null;
|
|
503
506
|
};
|
|
507
|
+
/** Internal-only escape hatch for extension/system rewrites that should not invalidate chat chunks. */
|
|
508
|
+
skipChunkRebuild?: boolean;
|
|
504
509
|
}
|
|
505
510
|
): Promise<void>;
|
|
506
511
|
deleteMessage(chatId: string, messageId: string): Promise<void>;
|