@pagelines/sdk 1.0.445 → 1.0.447

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.
@@ -2,6 +2,15 @@ import { Ref } from 'vue';
2
2
  import { AgentConfig, SettingsObject } from '@pagelines/core';
3
3
  import { PageLinesSDK } from '../sdkClient';
4
4
  import { AgentMode, ChatAttachment, ChatMessage, TextConnectionState, Agent } from './schema';
5
+ /**
6
+ * Structured error payload surfaced by the chat stream. Matches the
7
+ * ApiResponse contract in plans/standards/api.md — consumers switch on
8
+ * `code` (stable identifier), render `error` (user-facing copy).
9
+ */
10
+ export interface ChatStreamError {
11
+ code: string;
12
+ error: string;
13
+ }
5
14
  export type ChatStreamFn = (args: {
6
15
  message: string;
7
16
  attachments?: ChatAttachment[];
@@ -12,7 +21,7 @@ export type ChatStreamFn = (args: {
12
21
  }>;
13
22
  onDelta: (text: string) => void;
14
23
  onDone: (conversationId: string) => void;
15
- onError: (error: string) => void;
24
+ onError: (error: string | ChatStreamError) => void;
16
25
  onStatus?: (status: string) => void;
17
26
  }) => Promise<void>;
18
27
  type AgentChatControllerSettings = {