lumiverse-spindle-types 0.4.72 → 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.72",
3
+ "version": "0.4.73",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -1822,6 +1822,14 @@ export interface SharedRpcRequestContextDTO {
1822
1822
  endpoint: string;
1823
1823
  /** Identifier of the extension requesting the value. */
1824
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[];
1825
1833
  }
1826
1834
 
1827
1835
  // ─── Worker → Host messages ──────────────────────────────────────────────
@@ -1906,15 +1914,16 @@ export type WorkerToHost =
1906
1914
  reservationId: string;
1907
1915
  }
1908
1916
  | { type: "permissions_get_granted"; requestId: string }
1909
- | { type: "rpc_pool_sync"; endpoint: string; value: unknown }
1910
- | { 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 }
1911
1919
  | { type: "rpc_pool_unregister"; endpoint: string }
1912
- | { type: "rpc_pool_read"; requestId: string; endpoint: string }
1920
+ | { type: "rpc_pool_read"; requestId: string; endpoint: string; rpcPermissionScopeId?: string }
1913
1921
  | {
1914
1922
  type: "rpc_pool_handler_result";
1915
1923
  requestId: string;
1916
1924
  result?: unknown;
1917
1925
  error?: string;
1926
+ rpcPermissionScopeId?: string;
1918
1927
  }
1919
1928
  | { type: "connections_list"; requestId: string; userId?: string }
1920
1929
  | { type: "connections_get"; requestId: string; connectionId: string; userId?: string }
@@ -2284,6 +2293,8 @@ export type HostToWorker =
2284
2293
  requestId: string;
2285
2294
  endpoint: string;
2286
2295
  requesterExtensionId: string;
2296
+ rpcPermissionScopeId: string;
2297
+ effectivePermissions: string[];
2287
2298
  }
2288
2299
  | {
2289
2300
  type: "intercept_request";
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>;