lumiverse-spindle-types 0.5.19 → 0.5.21
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 +18 -0
- package/src/index.ts +1 -0
- package/src/spindle-api.ts +19 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -36,6 +36,24 @@ export interface LlmMessageDTO {
|
|
|
36
36
|
* only on `role: 'assistant'` messages.
|
|
37
37
|
*/
|
|
38
38
|
reasoning_content?: string;
|
|
39
|
+
/**
|
|
40
|
+
* True when this message is a chat-history turn (as opposed to a depth-injected
|
|
41
|
+
* world-info/preset/author's-note block that was spliced into the chat-history
|
|
42
|
+
* range). Set by the host only on the messages passed to the interceptor pipeline,
|
|
43
|
+
* so an extension applying prompt-target regex inline can reproduce the host's depth
|
|
44
|
+
* frame exactly.
|
|
45
|
+
*/
|
|
46
|
+
__isChatHistory?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Id of the originating chat message, set only on chat-history turns. Lets
|
|
49
|
+
* interceptors map back to the source message without matching on
|
|
50
|
+
* (macro/regex-mutated) content. Stripped before the LLM payload.
|
|
51
|
+
*/
|
|
52
|
+
sourceMessageId?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Source message's `index_in_chat`, paired with `sourceMessageId`.
|
|
55
|
+
*/
|
|
56
|
+
sourceIndexInChat?: number;
|
|
39
57
|
}
|
|
40
58
|
|
|
41
59
|
export type SpindleUserRoleDTO = "operator" | "admin" | "user";
|
package/src/index.ts
CHANGED
package/src/spindle-api.ts
CHANGED
|
@@ -209,6 +209,19 @@ export type SpindleBackendProcessModule = {
|
|
|
209
209
|
run?: (process: SpindleBackendProcessContext) => void | (() => void) | Promise<void | (() => void)>;
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Lets an extension tell the host that it will apply `target:prompt` regex
|
|
214
|
+
* itself for a set of chats, so the host skips its own per-message prompt-regex
|
|
215
|
+
* pass for those chats.
|
|
216
|
+
*/
|
|
217
|
+
export interface SpindlePromptRegex {
|
|
218
|
+
/**
|
|
219
|
+
* Declare the chats this extension applies `target:prompt` regex for. Replaces
|
|
220
|
+
* the previously-declared set. Empty array clears ownership (host resumes its pass).
|
|
221
|
+
*/
|
|
222
|
+
setOwnedChats(chatIds: string[]): void;
|
|
223
|
+
}
|
|
224
|
+
|
|
212
225
|
/** The global `spindle` object available in backend extension workers */
|
|
213
226
|
export interface SpindleAPI {
|
|
214
227
|
/** Subscribe to generation-started events (requires `generation` permission). The optional `userId` identifies which user triggered the event. */
|
|
@@ -289,6 +302,12 @@ export interface SpindleAPI {
|
|
|
289
302
|
priority?: number
|
|
290
303
|
): void;
|
|
291
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Declare the chats whose `target:prompt` regex this extension applies itself; the
|
|
307
|
+
* host skips its own pass for them.
|
|
308
|
+
*/
|
|
309
|
+
promptRegex: SpindlePromptRegex;
|
|
310
|
+
|
|
292
311
|
/** Register an LLM tool */
|
|
293
312
|
registerTool(tool: ToolRegistrationDTO): void;
|
|
294
313
|
/** Unregister an LLM tool */
|