lumiverse-spindle-types 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/spindle-api.ts +34 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
@@ -402,6 +402,40 @@ export interface SpindleAPI {
402
402
  }>;
403
403
  };
404
404
 
405
+ /**
406
+ * Macro resolution (free tier — no permission needed).
407
+ * Resolve `{{macro}}` placeholders in arbitrary text using
408
+ * the full Lumiverse macro engine (character fields, chat context,
409
+ * variables, time/date, random, etc.).
410
+ */
411
+ macros: {
412
+ /**
413
+ * Resolve all macros in the given template string.
414
+ * Provide `chatId` and/or `characterId` for full context resolution.
415
+ * Without them, only context-free macros (time, random, etc.) resolve.
416
+ *
417
+ * @example
418
+ * ```ts
419
+ * const { text } = await spindle.macros.resolve(
420
+ * 'Hello {{user}}, I am {{char}}!',
421
+ * { chatId: 'abc', characterId: 'xyz' },
422
+ * )
423
+ * ```
424
+ */
425
+ resolve(
426
+ template: string,
427
+ options?: {
428
+ chatId?: string;
429
+ characterId?: string;
430
+ /** For operator-scoped extensions only. */
431
+ userId?: string;
432
+ },
433
+ ): Promise<{
434
+ text: string;
435
+ diagnostics: Array<{ message: string; offset: number; length: number }>;
436
+ }>;
437
+ };
438
+
405
439
  /**
406
440
  * User presence queries (free tier — no permission needed).
407
441
  * Check whether a user currently has the Lumiverse app visible/focused