lumiverse-spindle-types 0.4.35 → 0.4.37
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 +35 -2
- package/src/dom.ts +2 -0
- package/src/index.ts +1 -0
- package/src/spindle-api.ts +3 -1
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -9,6 +9,21 @@ export interface LlmMessageDTO {
|
|
|
9
9
|
name?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Optional metadata returned by an interceptor so Lumiverse can surface
|
|
14
|
+
* extension-injected prompt messages as first-class items in Prompt Breakdown.
|
|
15
|
+
*
|
|
16
|
+
* `messageIndex` points at the message inside the interceptor's returned
|
|
17
|
+
* `messages` array. The host resolves role/content/extension attribution from
|
|
18
|
+
* that message and from the installed extension manifest, so extensions only
|
|
19
|
+
* need to identify which injected messages should appear in the breakdown.
|
|
20
|
+
*/
|
|
21
|
+
export interface InterceptorBreakdownEntryDTO {
|
|
22
|
+
messageIndex: number;
|
|
23
|
+
/** Optional human label for this injected prompt block. */
|
|
24
|
+
name?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
/**
|
|
13
28
|
* Return type for interceptor handlers.
|
|
14
29
|
* Interceptors may return either a plain `LlmMessageDTO[]` (backwards-compatible)
|
|
@@ -18,6 +33,8 @@ export interface InterceptorResultDTO {
|
|
|
18
33
|
messages: LlmMessageDTO[];
|
|
19
34
|
/** Provider parameters merged into the outgoing LLM request. Requires `generation_parameters` permission. */
|
|
20
35
|
parameters?: Record<string, unknown>;
|
|
36
|
+
/** Optional prompt-breakdown entries for injected messages. */
|
|
37
|
+
breakdown?: InterceptorBreakdownEntryDTO[];
|
|
21
38
|
}
|
|
22
39
|
|
|
23
40
|
export interface MacroDefinitionDTO {
|
|
@@ -522,6 +539,8 @@ export interface AssemblyBreakdownEntryDTO {
|
|
|
522
539
|
firstMessageIndex?: number;
|
|
523
540
|
preCountedTokens?: number;
|
|
524
541
|
excludeFromTotal?: boolean;
|
|
542
|
+
extensionId?: string;
|
|
543
|
+
extensionName?: string;
|
|
525
544
|
}
|
|
526
545
|
|
|
527
546
|
export interface ActivationStatsDTO {
|
|
@@ -552,7 +571,14 @@ export interface MemoryStatsDTO {
|
|
|
552
571
|
|
|
553
572
|
export interface DryRunTokenCountDTO {
|
|
554
573
|
total_tokens: number;
|
|
555
|
-
breakdown: Array<{
|
|
574
|
+
breakdown: Array<{
|
|
575
|
+
name: string;
|
|
576
|
+
type: string;
|
|
577
|
+
tokens: number;
|
|
578
|
+
role?: string;
|
|
579
|
+
extensionId?: string;
|
|
580
|
+
extensionName?: string;
|
|
581
|
+
}>;
|
|
556
582
|
tokenizer_id: string | null;
|
|
557
583
|
tokenizer_name: string | null;
|
|
558
584
|
}
|
|
@@ -868,6 +894,7 @@ export interface GenerationStartedPayloadDTO {
|
|
|
868
894
|
targetMessageId?: string;
|
|
869
895
|
characterId?: string;
|
|
870
896
|
characterName?: string;
|
|
897
|
+
breakdown?: AssemblyBreakdownEntryDTO[];
|
|
871
898
|
}
|
|
872
899
|
|
|
873
900
|
/** Payload for `STREAM_TOKEN_RECEIVED` events. */
|
|
@@ -1108,7 +1135,13 @@ export type WorkerToHost =
|
|
|
1108
1135
|
| { type: "unregister_macro"; name: string }
|
|
1109
1136
|
| { type: "update_macro_value"; name: string; value: string }
|
|
1110
1137
|
| { type: "register_interceptor"; priority?: number }
|
|
1111
|
-
| {
|
|
1138
|
+
| {
|
|
1139
|
+
type: "intercept_result";
|
|
1140
|
+
requestId: string;
|
|
1141
|
+
messages: LlmMessageDTO[];
|
|
1142
|
+
parameters?: Record<string, unknown>;
|
|
1143
|
+
breakdown?: InterceptorBreakdownEntryDTO[];
|
|
1144
|
+
}
|
|
1112
1145
|
| { type: "register_tool"; tool: ToolRegistrationDTO }
|
|
1113
1146
|
| { type: "unregister_tool"; name: string }
|
|
1114
1147
|
| { type: "request_generation"; requestId: string; input: GenerationRequestDTO }
|
package/src/dom.ts
CHANGED
|
@@ -135,6 +135,7 @@ export interface SpindleAppMountHandle {
|
|
|
135
135
|
export interface SpindleInputBarActionOptions {
|
|
136
136
|
id: string;
|
|
137
137
|
label: string;
|
|
138
|
+
subtitle?: string;
|
|
138
139
|
iconSvg?: string;
|
|
139
140
|
iconUrl?: string;
|
|
140
141
|
enabled?: boolean;
|
|
@@ -143,6 +144,7 @@ export interface SpindleInputBarActionOptions {
|
|
|
143
144
|
export interface SpindleInputBarActionHandle {
|
|
144
145
|
actionId: string;
|
|
145
146
|
setLabel(label: string): void;
|
|
147
|
+
setSubtitle(subtitle?: string): void;
|
|
146
148
|
setEnabled(enabled: boolean): void;
|
|
147
149
|
onClick(handler: () => void): () => void;
|
|
148
150
|
destroy(): void;
|
package/src/index.ts
CHANGED
package/src/spindle-api.ts
CHANGED
|
@@ -116,7 +116,9 @@ export interface SpindleAPI {
|
|
|
116
116
|
* The handler receives the assembled messages and a context object, and may
|
|
117
117
|
* return either a plain `LlmMessageDTO[]` (backwards-compatible) or an
|
|
118
118
|
* `InterceptorResultDTO` to also inject generation parameters into the
|
|
119
|
-
* outgoing LLM request.
|
|
119
|
+
* outgoing LLM request. `InterceptorResultDTO.breakdown` can be used to mark
|
|
120
|
+
* specific injected messages as Prompt Breakdown entries so dry-run/live UI
|
|
121
|
+
* and saved breakdowns can attribute them back to the extension.
|
|
120
122
|
*
|
|
121
123
|
* Returning `parameters` requires the `generation_parameters` permission.
|
|
122
124
|
* Without it, returned parameters are silently stripped.
|