lumiverse-spindle-types 0.6.52 → 0.6.54
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/dist/api.d.ts +1 -1
- package/dist/composer.d.ts +40 -0
- package/dist/composer.js +4 -0
- package/dist/dom.d.ts +3 -0
- package/dist/embeddings.d.ts +51 -0
- package/dist/embeddings.js +1 -0
- package/dist/host.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/permissions.d.ts +2 -1
- package/dist/permissions.js +1 -0
- package/dist/spindle-api.d.ts +2 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -3381,7 +3381,7 @@ export interface ProviderManager {
|
|
|
3381
3381
|
key: ProviderKeyDTO;
|
|
3382
3382
|
}) => void): () => void;
|
|
3383
3383
|
}
|
|
3384
|
-
export type WorkerToHost = import("./decisions.js").DecisionWorkerMessage | import("./file-transfers.js").FileTransferWorkerMessage | import("./desktop-capture.js").DesktopCaptureWorkerMessage | {
|
|
3384
|
+
export type WorkerToHost = import("./decisions.js").DecisionWorkerMessage | import("./embeddings.js").EmbeddingsWorkerMessage | import("./file-transfers.js").FileTransferWorkerMessage | import("./desktop-capture.js").DesktopCaptureWorkerMessage | {
|
|
3385
3385
|
type: "subscribe_event";
|
|
3386
3386
|
event: string;
|
|
3387
3387
|
} | {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Frontend-only: the chat composer bridge (`ctx.composer`). */
|
|
2
|
+
export declare const SPINDLE_COMPOSER_HOST_CAPABILITIES: Readonly<{
|
|
3
|
+
readonly "composer-v1": 1;
|
|
4
|
+
}>;
|
|
5
|
+
/** A snapshot of the chat composer, the message input of the open chat. */
|
|
6
|
+
export interface SpindleComposerState {
|
|
7
|
+
/** False when no chat composer is on screen (for example, outside a chat page). */
|
|
8
|
+
readonly mounted: boolean;
|
|
9
|
+
/** The chat the composer belongs to; null when not mounted. */
|
|
10
|
+
readonly chatId: string | null;
|
|
11
|
+
/** The current draft; "" when not mounted. */
|
|
12
|
+
readonly text: string;
|
|
13
|
+
}
|
|
14
|
+
export type SpindleComposerInsertPosition = "caret" | "end";
|
|
15
|
+
/**
|
|
16
|
+
* Reads and writes the draft in the chat composer and sends it through the
|
|
17
|
+
* host's own send path. Available with composer-v1. Every method except
|
|
18
|
+
* getState() and onChange() throws `COMPOSER_UNAVAILABLE` when no composer is mounted.
|
|
19
|
+
*/
|
|
20
|
+
export interface SpindleComposerAPI {
|
|
21
|
+
/** Free. Never throws when no composer is mounted; returns `mounted: false`. */
|
|
22
|
+
getState(): SpindleComposerState;
|
|
23
|
+
/** Free. Fires after the draft, the chat or the mounted state changes. Returns an unsubscribe function. */
|
|
24
|
+
onChange(handler: (state: SpindleComposerState) => void): () => void;
|
|
25
|
+
/** Free. Replaces the draft. The user still decides whether to send it. */
|
|
26
|
+
setText(text: string): void;
|
|
27
|
+
/** Free. `at: "caret"` (default) replaces the current selection; `"end"` appends. Text is inserted as is. */
|
|
28
|
+
insertText(text: string, options?: {
|
|
29
|
+
at?: SpindleComposerInsertPosition;
|
|
30
|
+
}): void;
|
|
31
|
+
/** Free. Focuses the composer textarea. */
|
|
32
|
+
focus(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Requires `generation`. Same as pressing Send: uses the active persona, pending attachments,
|
|
35
|
+
* group-chat targeting and multiplayer rules, then starts a generation. An empty draft asks for a
|
|
36
|
+
* fresh reply, like the Send button. Rejects with `COMPOSER_BUSY` while a send or generation is running.
|
|
37
|
+
* Host-side send failures are shown to the user as toasts and do not reject.
|
|
38
|
+
*/
|
|
39
|
+
send(): Promise<void>;
|
|
40
|
+
}
|
package/dist/composer.js
ADDED
package/dist/dom.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SpindleSTTAPI } from "./speech-to-text.js";
|
|
2
2
|
import type { SpindleSystemAudioAPI } from "./system-audio.js";
|
|
3
3
|
import type { SpindleClientAPI } from "./client.js";
|
|
4
|
+
import type { SpindleComposerAPI } from "./composer.js";
|
|
4
5
|
import type { SpindleFileDownloadAPI } from "./file-transfers.js";
|
|
5
6
|
import type { ChatDTO, ChatMessageDTO, ChatUpdateDTO, ConnectionProfileDTO, LlmMessageDTO, PromptBlockDTO, PromptVariableValuesDTO, RequestInitDTO, TokenCountOptionsDTO, TokenCountResultDTO, WorldBookCreateDTO, WorldBookDTO, WorldBookEntryCreateDTO, WorldBookEntryDTO, WorldBookEntryUpdateDTO, WorldBookUpdateDTO } from "./api.js";
|
|
6
7
|
import type { SpindleComponentsHelper } from "./components.js";
|
|
@@ -1049,6 +1050,8 @@ export interface SpindleFrontendContext {
|
|
|
1049
1050
|
readonly client?: SpindleClientAPI;
|
|
1050
1051
|
/** Native downloads of completed backend files. Available with file-transfers-v1. */
|
|
1051
1052
|
readonly files: SpindleFileDownloadAPI;
|
|
1053
|
+
/** The chat composer draft and its send path. Feature-detect composer-v1; unavailable on older hosts. */
|
|
1054
|
+
readonly composer?: SpindleComposerAPI;
|
|
1052
1055
|
/** Host-managed STT. Feature-detect speech-to-text-v1; unavailable on older hosts. */
|
|
1053
1056
|
readonly stt?: SpindleSTTAPI;
|
|
1054
1057
|
/** Host-managed system-audio analysis (spectrum only). Feature-detect system-audio-v1; desktop client only. */
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Embeddings with the user's embedding connections. Requires the embeddings permission and the embeddings-v1 host capability. */
|
|
2
|
+
/** A saved embedding connection (Settings > Embeddings). The API key never leaves the host. */
|
|
3
|
+
export interface EmbeddingConnectionDTO {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
model: string;
|
|
8
|
+
/** Configured output size, or `null` when the provider's native size is used. */
|
|
9
|
+
dimensions: number | null;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
/** The user's main embedding connection; used when `connection_id` is omitted. */
|
|
12
|
+
is_primary: boolean;
|
|
13
|
+
has_api_key: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface EmbeddingsEmbedInput {
|
|
16
|
+
/** 1-256 non-empty texts, each at most 8192 characters. */
|
|
17
|
+
texts: string[];
|
|
18
|
+
/** A connection from `listConnections()`. Default: the user's primary embedding connection. Fallback connections are never used. */
|
|
19
|
+
connection_id?: string;
|
|
20
|
+
/** Asymmetric models (Cohere, NVIDIA NIM) embed search queries and stored passages differently. Default: `"passage"`. */
|
|
21
|
+
input_type?: "query" | "passage";
|
|
22
|
+
userId?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface EmbeddingsEmbedResult {
|
|
25
|
+
/** One vector per input text, in input order. */
|
|
26
|
+
embeddings: number[][];
|
|
27
|
+
/** The connection that produced every vector in this result. */
|
|
28
|
+
connection_id: string;
|
|
29
|
+
model: string;
|
|
30
|
+
dimensions: number;
|
|
31
|
+
}
|
|
32
|
+
export interface SpindleEmbeddingsAPI {
|
|
33
|
+
listConnections(options?: {
|
|
34
|
+
userId?: string;
|
|
35
|
+
}): Promise<EmbeddingConnectionDTO[]>;
|
|
36
|
+
embed(input: EmbeddingsEmbedInput, options?: {
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): Promise<EmbeddingsEmbedResult>;
|
|
39
|
+
}
|
|
40
|
+
export type EmbeddingsWorkerMessage = {
|
|
41
|
+
type: "embeddings_connections_list";
|
|
42
|
+
requestId: string;
|
|
43
|
+
userId?: string;
|
|
44
|
+
} | {
|
|
45
|
+
type: "embeddings_embed";
|
|
46
|
+
requestId: string;
|
|
47
|
+
input: EmbeddingsEmbedInput;
|
|
48
|
+
} | {
|
|
49
|
+
type: "embeddings_cancel";
|
|
50
|
+
requestId: string;
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/host.js
CHANGED
|
@@ -13,6 +13,7 @@ export const SPINDLE_HOST_CAPABILITIES = Object.freeze({
|
|
|
13
13
|
"mcp-servers-v1": 1,
|
|
14
14
|
"decisions-v1": 1,
|
|
15
15
|
"decision-images-v1": 1,
|
|
16
|
+
"embeddings-v1": 1,
|
|
16
17
|
"file-transfers-v1": 1,
|
|
17
18
|
});
|
|
18
19
|
/** Structured error code returned when host compatibility validation fails. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export type { DecisionImageAsset, DecisionBox, DecisionJsonValue, DecisionDescription, DecisionState, DecisionQuestion, DecisionAnswer, DecisionAnswerFor, DecisionAnswers, DecisionResult, DecisionEvaluationInput, DecisionConnectionProfileDTO, DecisionModelDTO, DecisionProviderDTO, SpindleDecisionsAPI, DecisionWorkerMessage } from "./decisions.js";
|
|
2
|
+
export type { EmbeddingConnectionDTO, EmbeddingsEmbedInput, EmbeddingsEmbedResult, SpindleEmbeddingsAPI, EmbeddingsWorkerMessage } from "./embeddings.js";
|
|
2
3
|
export type { SpindleManifest, SpindlePermission, SpindleCapability, } from "./manifest.js";
|
|
3
4
|
export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
|
|
4
5
|
export type { LumiverseVersionInfo, SpindleHostDescriptorV1, SpindleHostLocale, SpindleHostLocaleAPI, } from "./host.js";
|
|
5
6
|
export type { SpindleClientKind, SpindleClientPlatform, SpindleClientInfo, SpindleClientAPI } from "./client.js";
|
|
6
7
|
export { SPINDLE_CLIENT_HOST_CAPABILITIES } from "./client.js";
|
|
8
|
+
export type { SpindleComposerState, SpindleComposerInsertPosition, SpindleComposerAPI } from "./composer.js";
|
|
9
|
+
export { SPINDLE_COMPOSER_HOST_CAPABILITIES } from "./composer.js";
|
|
7
10
|
export type { SpindleFileRef, SpindleFileSource, FileOperationOptions, FileFetchOptions, SpindleFileCreateInput, SpindleFileChunk, SpindleArchiveEntry, ArchiveCreateOptions, ArchiveExtractOptions, SpindleArchiveExtractedEntry, SpindleFilesAPI, SpindleArchivesAPI, SpindleFileDownloadAPI, FileTransferWorkerMessage, } from "./file-transfers.js";
|
|
8
11
|
export { SPINDLE_FILE_CHUNK_BYTES, SPINDLE_FILE_MAX_BYTES, SPINDLE_FILE_DEFAULT_MAX_BYTES, SPINDLE_FILE_TTL_MS, SPINDLE_FILE_MAX_COUNT, } from "./file-transfers.js";
|
|
9
12
|
export { SPINDLE_HOST_CAPABILITIES, SPINDLE_COMPATIBILITY_ERROR_CODE, } from "./host.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
|
|
2
2
|
export { SPINDLE_CLIENT_HOST_CAPABILITIES } from "./client.js";
|
|
3
|
+
export { SPINDLE_COMPOSER_HOST_CAPABILITIES } from "./composer.js";
|
|
3
4
|
export { SPINDLE_FILE_CHUNK_BYTES, SPINDLE_FILE_MAX_BYTES, SPINDLE_FILE_DEFAULT_MAX_BYTES, SPINDLE_FILE_TTL_MS, SPINDLE_FILE_MAX_COUNT, } from "./file-transfers.js";
|
|
4
5
|
export { SPINDLE_HOST_CAPABILITIES, SPINDLE_COMPATIBILITY_ERROR_CODE, } from "./host.js";
|
|
5
6
|
export { SPINDLE_THEME_AUTHORING_HOST_CAPABILITIES } from "./theme.js";
|
package/dist/permissions.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Gated tier (must declare):
|
|
7
7
|
* - "decisions" — inspect and invoke saved Decision model connections
|
|
8
|
+
* - "embeddings" — list the user's embedding connections and embed text with them
|
|
8
9
|
* - "generation" — fire generations on behalf of user
|
|
9
10
|
* - "interceptor" — pre-generation prompt modification
|
|
10
11
|
* - "tools" — register LLM tools
|
|
@@ -42,6 +43,6 @@
|
|
|
42
43
|
* device is playing (never samples), desktop client only. Privileged;
|
|
43
44
|
* the host asks the user on every start.
|
|
44
45
|
*/
|
|
45
|
-
export type SpindlePermission = "screen_capture" | "screen_recording" | "system_audio" | "generation" | "interceptor" | "tools" | "cors_proxy" | "context_handler" | "ephemeral_storage" | "chat_mutation" | "event_tracking" | "ui_panels" | "app_manipulation" | "oauth" | "characters" | "chats" | "presets" | "world_books" | "regex_scripts" | "regex_scripts_unrestricted" | "databanks" | "memories" | "media" | "personas" | "push_notification" | "decisions" | "image_gen" | "images" | "generation_parameters" | "macro_interceptor" | "web_search" | "unsafe_eval" | "final_response" | "providers.embedding.register" | "providers.tts.register" | "providers.stt.register" | "providers.sidecar.register" | "mcp_servers" | "mcp_servers.create";
|
|
46
|
+
export type SpindlePermission = "screen_capture" | "screen_recording" | "system_audio" | "generation" | "interceptor" | "tools" | "cors_proxy" | "context_handler" | "ephemeral_storage" | "chat_mutation" | "event_tracking" | "ui_panels" | "app_manipulation" | "oauth" | "characters" | "chats" | "presets" | "world_books" | "regex_scripts" | "regex_scripts_unrestricted" | "databanks" | "memories" | "media" | "personas" | "push_notification" | "decisions" | "embeddings" | "image_gen" | "images" | "generation_parameters" | "macro_interceptor" | "web_search" | "unsafe_eval" | "final_response" | "providers.embedding.register" | "providers.tts.register" | "providers.stt.register" | "providers.sidecar.register" | "mcp_servers" | "mcp_servers.create";
|
|
46
47
|
export declare const ALL_PERMISSIONS: readonly SpindlePermission[];
|
|
47
48
|
export declare function isValidPermission(p: string): p is SpindlePermission;
|
package/dist/permissions.js
CHANGED
package/dist/spindle-api.d.ts
CHANGED
|
@@ -136,6 +136,8 @@ export interface SpindleConnectionsAPI {
|
|
|
136
136
|
export interface SpindleAPI {
|
|
137
137
|
/** Typed Decision models (permission: decisions; host capability: decisions-v1). */
|
|
138
138
|
decisions: import("./decisions.js").SpindleDecisionsAPI;
|
|
139
|
+
/** Embed text with the user's embedding connections (permission: embeddings; host capability: embeddings-v1). */
|
|
140
|
+
embeddings: import("./embeddings.js").SpindleEmbeddingsAPI;
|
|
139
141
|
/** Disk-backed downloads and bounded reads/writes. Available with file-transfers-v1. */
|
|
140
142
|
readonly files: SpindleFilesAPI;
|
|
141
143
|
/** Streaming ZIP64 creation and validated disk-backed extraction. */
|