lumiverse-spindle-types 0.6.28 → 0.6.30

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 CHANGED
@@ -2845,6 +2845,10 @@ export interface SwipeEditedPayloadDTO {
2845
2845
  * role boundaries directly instead of re-parsing the flattened `args.context`
2846
2846
  * string. Multi-part message content is flattened to its text portion before
2847
2847
  * being delivered. `undefined` for non-council invocation paths.
2848
+ *
2849
+ * Authenticated user context is intentionally NOT part of this payload. Hosts deliver
2850
+ * it separately as the TOOL_INVOCATION handler's second argument so model-controlled
2851
+ * args cannot spoof or collide with identity metadata.
2848
2852
  */
2849
2853
  export interface ToolInvocationPayloadDTO {
2850
2854
  /** The bare (unqualified) tool name, matching what was passed to `registerTool`. */
@@ -4683,6 +4687,13 @@ export type HostToWorker = {
4683
4687
  requestId: string;
4684
4688
  toolName: string;
4685
4689
  args: Record<string, unknown>;
4690
+ /**
4691
+ * Trusted host context identifying the user whose generation triggered this tool invocation.
4692
+ * This value is host-owned transport metadata: it is never sourced from, merged into, or
4693
+ * exposed through model-controlled tool args. The worker runtime delivers it as the second
4694
+ * argument to the TOOL_INVOCATION handler. Optional for compatibility with older hosts.
4695
+ */
4696
+ userId?: string;
4686
4697
  /**
4687
4698
  * Populated when the invocation originates from a council execution
4688
4699
  * cycle — carries the assigned council member's identity, role, chance,
@@ -185,8 +185,13 @@ export interface SpindleAPI {
185
185
  * includes a `councilMember` snapshot describing the assigned member
186
186
  * (identity, role, chance, avatar URL, and Lumia personality fields) so the
187
187
  * extension can tailor its tool output to that member's voice.
188
+ *
189
+ * The optional second `userId` argument is trusted host context identifying the
190
+ * user whose generation triggered the invocation. Multi-user/operator-scoped
191
+ * extensions should pass it through to user-scoped Spindle APIs. It is deliberately
192
+ * kept separate from `payload.args` so tool/model input cannot spoof identity.
188
193
  */
189
- on(event: "TOOL_INVOCATION", handler: (payload: ToolInvocationPayloadDTO) => string | Promise<string> | void | Promise<void>): () => void;
194
+ on(event: "TOOL_INVOCATION", handler: (payload: ToolInvocationPayloadDTO, userId?: string) => string | Promise<string> | void | Promise<void>): () => void;
190
195
  /** Subscribe to a Lumiverse event. Multi-user extensions should use the optional `userId` to keep per-user state and notifications isolated. */
191
196
  on(event: string, handler: (payload: unknown, userId?: string) => void): () => void;
192
197
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.6.28",
3
+ "version": "0.6.30",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "keywords": [