lumiverse-spindle-types 0.6.53 → 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.
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ /** Frontend-only: the chat composer bridge (`ctx.composer`). */
2
+ export const SPINDLE_COMPOSER_HOST_CAPABILITIES = Object.freeze({
3
+ "composer-v1": 1,
4
+ });
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. */
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
5
5
  export type { LumiverseVersionInfo, SpindleHostDescriptorV1, SpindleHostLocale, SpindleHostLocaleAPI, } from "./host.js";
6
6
  export type { SpindleClientKind, SpindleClientPlatform, SpindleClientInfo, SpindleClientAPI } from "./client.js";
7
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";
8
10
  export type { SpindleFileRef, SpindleFileSource, FileOperationOptions, FileFetchOptions, SpindleFileCreateInput, SpindleFileChunk, SpindleArchiveEntry, ArchiveCreateOptions, ArchiveExtractOptions, SpindleArchiveExtractedEntry, SpindleFilesAPI, SpindleArchivesAPI, SpindleFileDownloadAPI, FileTransferWorkerMessage, } from "./file-transfers.js";
9
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";
10
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.6.53",
3
+ "version": "0.6.54",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "keywords": [