lumiverse-spindle-types 0.5.19 → 0.5.20

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.19",
3
+ "version": "0.5.20",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -36,6 +36,14 @@ 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;
39
47
  }
40
48
 
41
49
  export type SpindleUserRoleDTO = "operator" | "admin" | "user";
package/src/index.ts CHANGED
@@ -334,6 +334,7 @@ export type {
334
334
 
335
335
  export type {
336
336
  SpindleAPI,
337
+ SpindlePromptRegex,
337
338
  FrontendProcessHandle,
338
339
  BackendProcessHandle,
339
340
  SpindleBackendProcessContext,
@@ -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 */