lumiverse-spindle-types 0.4.69 → 0.4.70

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.69",
3
+ "version": "0.4.70",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -1606,9 +1606,8 @@ export interface GenerationStoppedPayloadDTO {
1606
1606
  * Wire shape of a chat message as delivered in WebSocket event payloads
1607
1607
  * (e.g. `MESSAGE_SENT`, `MESSAGE_EDITED`, `MESSAGE_SWIPED`).
1608
1608
  *
1609
- * This is the raw backend message shape and is distinct from the normalized
1610
- * `{ id, role, content, ... }` object returned by `spindle.chat.getMessages()`,
1611
- * which collapses `is_user`/`name` into a `role` discriminator.
1609
+ * `spindle.chat.getMessages()` returns this backend shape plus normalized
1610
+ * convenience fields such as `role` and `metadata`.
1612
1611
  */
1613
1612
  export interface ChatMessageDTO {
1614
1613
  id: string;
@@ -76,6 +76,7 @@ import type {
76
76
  BackendProcessLifecycleEventDTO,
77
77
  BackendProcessStopOptionsDTO,
78
78
  ChatChangedPayloadDTO,
79
+ ChatMessageDTO,
79
80
  GenerationStartedPayloadDTO,
80
81
  StreamTokenPayloadDTO,
81
82
  GenerationEndedPayloadDTO,
@@ -447,26 +448,17 @@ export interface SpindleAPI {
447
448
 
448
449
  /** Chat mutation helpers */
449
450
  chat: {
450
- getMessages(chatId: string): Promise<Array<{
451
- id: string;
451
+ getMessages(chatId: string): Promise<Array<ChatMessageDTO & {
452
+ /** Normalized role derived from `is_user` and Spindle system-message metadata. */
452
453
  role: "system" | "user" | "assistant";
453
- content: string;
454
454
  /**
455
455
  * The free-form `extra` bag minus `spindle_metadata` (which is surfaced
456
456
  * separately on `metadata`). Carries reasoning text/duration, attachments,
457
457
  * and any host-owned housekeeping fields.
458
458
  */
459
459
  extra: Record<string, unknown>;
460
+ /** Spindle-owned metadata split out from `extra.spindle_metadata`. */
460
461
  metadata?: Record<string, unknown>;
461
- /** Index of the active swipe in `swipes`. `0` when the message has no alternates. */
462
- swipe_id: number;
463
- /**
464
- * All swipe variants for this message, including the currently active one.
465
- * `swipes[swipe_id]` always equals `content`.
466
- */
467
- swipes: string[];
468
- /** Per-swipe creation timestamps (unix epoch seconds), aligned with `swipes`. */
469
- swipe_dates: number[];
470
462
  }>>;
471
463
  appendMessage(
472
464
  chatId: string,