lumiverse-spindle-types 0.4.71 → 0.4.73

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.4.71",
3
+ "version": "0.4.73",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -14,6 +14,19 @@ export interface LlmMessageDTO {
14
14
  role: "system" | "user" | "assistant";
15
15
  content: string | LlmMessagePartDTO[];
16
16
  name?: string;
17
+ /**
18
+ * Thinking-mode reasoning content from the previous assistant turn, echoed
19
+ * back on the next request. Required by DeepSeek's thinking-mode models
20
+ * (`deepseek-reasoner`, `deepseek-chat` with thinking enabled) **on
21
+ * tool-call continuations** — DeepSeek's API rejects a continuation when
22
+ * an assistant turn invoked a tool call and the echo doesn't carry its
23
+ * reasoning_content back. Plain-text continuations don't need this; nor
24
+ * do non-thinking models. Other openai-compatible providers that route
25
+ * DeepSeek (NanoGPT, OpenRouter, etc.) inherit the same requirement;
26
+ * providers without a reasoning_content notion ignore the field. Set
27
+ * only on `role: 'assistant'` messages.
28
+ */
29
+ reasoning_content?: string;
17
30
  }
18
31
 
19
32
  export type SpindleUserRoleDTO = "operator" | "admin" | "user";
@@ -1809,6 +1822,14 @@ export interface SharedRpcRequestContextDTO {
1809
1822
  endpoint: string;
1810
1823
  /** Identifier of the extension requesting the value. */
1811
1824
  requesterExtensionId: string;
1825
+ /** Gated permissions available while this delegated handler request is running. */
1826
+ effectivePermissions: readonly string[];
1827
+ }
1828
+
1829
+ /** Optional read policy for a shared RPC endpoint. Omit to require legacy owner-permission inheritance. */
1830
+ export interface SharedRpcEndpointPolicyDTO {
1831
+ /** Gated permissions both owner and requester must have; `[]` means no gated permissions are delegated. */
1832
+ requires?: readonly string[];
1812
1833
  }
1813
1834
 
1814
1835
  // ─── Worker → Host messages ──────────────────────────────────────────────
@@ -1893,15 +1914,16 @@ export type WorkerToHost =
1893
1914
  reservationId: string;
1894
1915
  }
1895
1916
  | { type: "permissions_get_granted"; requestId: string }
1896
- | { type: "rpc_pool_sync"; endpoint: string; value: unknown }
1897
- | { type: "rpc_pool_register_handler"; endpoint: string }
1917
+ | { type: "rpc_pool_sync"; endpoint: string; value: unknown; policy?: SharedRpcEndpointPolicyDTO; rpcPermissionScopeId?: string }
1918
+ | { type: "rpc_pool_register_handler"; endpoint: string; policy?: SharedRpcEndpointPolicyDTO; rpcPermissionScopeId?: string }
1898
1919
  | { type: "rpc_pool_unregister"; endpoint: string }
1899
- | { type: "rpc_pool_read"; requestId: string; endpoint: string }
1920
+ | { type: "rpc_pool_read"; requestId: string; endpoint: string; rpcPermissionScopeId?: string }
1900
1921
  | {
1901
1922
  type: "rpc_pool_handler_result";
1902
1923
  requestId: string;
1903
1924
  result?: unknown;
1904
1925
  error?: string;
1926
+ rpcPermissionScopeId?: string;
1905
1927
  }
1906
1928
  | { type: "connections_list"; requestId: string; userId?: string }
1907
1929
  | { type: "connections_get"; requestId: string; connectionId: string; userId?: string }
@@ -2271,6 +2293,8 @@ export type HostToWorker =
2271
2293
  requestId: string;
2272
2294
  endpoint: string;
2273
2295
  requesterExtensionId: string;
2296
+ rpcPermissionScopeId: string;
2297
+ effectivePermissions: string[];
2274
2298
  }
2275
2299
  | {
2276
2300
  type: "intercept_request";
package/src/dom.ts CHANGED
@@ -232,6 +232,8 @@ export interface SpindleSandboxAPI {
232
232
  fetchAudio(url: string, options?: RequestInitDTO): Promise<SpindleSandboxMediaResource>;
233
233
  /** Fetch remote audio through the proxy and create a sandbox-local audio element. */
234
234
  createAudio(url: string, options?: SpindleSandboxAudioOptions): Promise<SpindleSandboxAudioHandle>;
235
+ /** Fetch a remote web font through the permission-gated proxy and expose it as a blob URL usable in `@font-face src: url(...)`. */
236
+ fetchFont(url: string, options?: RequestInitDTO): Promise<SpindleSandboxMediaResource>;
235
237
  }
236
238
 
237
239
  export interface SpindleUploadFile {
package/src/events.ts CHANGED
@@ -38,6 +38,10 @@ export enum CoreEventType {
38
38
  WORLD_INFO_ACTIVATED = "WORLD_INFO_ACTIVATED",
39
39
  REGEX_SCRIPT_CHANGED = "REGEX_SCRIPT_CHANGED",
40
40
  REGEX_SCRIPT_DELETED = "REGEX_SCRIPT_DELETED",
41
+ WORLD_BOOK_CHANGED = "WORLD_BOOK_CHANGED",
42
+ WORLD_BOOK_DELETED = "WORLD_BOOK_DELETED",
43
+ WORLD_BOOK_ENTRY_CHANGED = "WORLD_BOOK_ENTRY_CHANGED",
44
+ WORLD_BOOK_ENTRY_DELETED = "WORLD_BOOK_ENTRY_DELETED",
41
45
  MESSAGE_TAG_INTERCEPTED = "MESSAGE_TAG_INTERCEPTED",
42
46
  TOOL_INVOCATION = "TOOL_INVOCATION",
43
47
  }
package/src/index.ts CHANGED
@@ -130,6 +130,7 @@ export type {
130
130
  TokenCountOptionsDTO,
131
131
  TokenCountResultDTO,
132
132
  SharedRpcRequestContextDTO,
133
+ SharedRpcEndpointPolicyDTO,
133
134
  MacroInterceptorPhase,
134
135
  MacroInterceptorEnvDTO,
135
136
  MacroInterceptorCtxDTO,
@@ -95,6 +95,7 @@ import type {
95
95
  MessageContentProcessorCtxDTO,
96
96
  MessageContentProcessorResultDTO,
97
97
  SharedRpcRequestContextDTO,
98
+ SharedRpcEndpointPolicyDTO,
98
99
  } from "./api";
99
100
 
100
101
  export interface FrontendProcessHandle {
@@ -860,7 +861,7 @@ export interface SpindleAPI {
860
861
  *
861
862
  * Returns the fully-qualified endpoint name.
862
863
  */
863
- sync(endpoint: string, value: unknown): string;
864
+ sync(endpoint: string, value: unknown, policy?: SharedRpcEndpointPolicyDTO): string;
864
865
  /**
865
866
  * Register an on-demand endpoint handler. Replaces any previously synced
866
867
  * value or handler for the same endpoint.
@@ -869,7 +870,8 @@ export interface SpindleAPI {
869
870
  */
870
871
  handle(
871
872
  endpoint: string,
872
- handler: (ctx: SharedRpcRequestContextDTO) => unknown | Promise<unknown>
873
+ handler: (ctx: SharedRpcRequestContextDTO) => unknown | Promise<unknown>,
874
+ policy?: SharedRpcEndpointPolicyDTO
873
875
  ): string;
874
876
  /** Read the latest value from another extension's fully-qualified endpoint. */
875
877
  read<T = unknown>(endpoint: string): Promise<T>;