@zenera/chat-widget 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -73,13 +73,14 @@ Replace `baseUrl` with your server's address. The example assumes your website s
73
73
 
74
74
  Set these options inside `ZeneraChatWidget.mount({ ... })`:
75
75
 
76
- | Option | Description |
77
- | ----------------- | -------------------------------------------------------------------------------------- |
78
- | `baseUrl` | **Required.** Address of your Zenera server. |
79
- | `token` | **Required.** User access token, or a function that provides a token for each request. |
80
- | `placeholder` | Text shown in the message input before typing. |
81
- | `starterMessages` | Text displayed at the start of a new conversation. |
82
- | `theme` | Chat colors and appearance. |
76
+ | Option | Description |
77
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
78
+ | `baseUrl` | **Required.** Address of your Zenera server. |
79
+ | `token` | **Required.** User access token, or a function that provides a token for each request. |
80
+ | `placeholder` | Text shown in the message input before typing. |
81
+ | `starterMessages` | Text displayed at the start of a new conversation. |
82
+ | `theme` | Chat colors and appearance. |
83
+ | `historyKey` | Any string you choose. The messages sent with it are kept in the browser's `localStorage` under that key, so use a different key for each user and project; users who share a key share their history. Without `historyKey`, ↑/↓ does nothing. Only messages sent after you set it are recalled. |
83
84
 
84
85
  ### Launcher
85
86
 
@@ -56,8 +56,11 @@ export interface ChatTransport {
56
56
  text: string;
57
57
  }, onEvent: (event: AGUIEvent) => void, signal?: AbortSignal): Promise<void>;
58
58
  }
59
- /** 'chats': the user's private chats; 'test-chats': the project editor's Test-tab chats. */
60
- export type ChatCollection = 'chats' | 'test-chats';
59
+ /**
60
+ * 'chats': the user's private chats; 'test-chats': the project editor's Test-tab chats;
61
+ * 'meta-chat': the editor's builder chat, a single thread named `current`.
62
+ */
63
+ export type ChatCollection = 'chats' | 'test-chats' | 'meta-chat';
61
64
  export interface ChatTransportOptions {
62
65
  /** prefix of the API's URLs, e.g. `https://zenera.example.com`; default: the page's origin */
63
66
  baseUrl?: string;
@@ -1,4 +1,4 @@
1
1
  /** `threadId` null is the new chat that has no thread yet. */
2
- export declare const composerDraftKey: (surface: "chat" | "test-chat", userId: string, projectId: string, threadId: string | null) => string;
2
+ export declare const composerDraftKey: (surface: "chat" | "test-chat" | "meta-chat", userId: string, projectId: string, threadId: string | null) => string;
3
3
  export declare function loadDraft(key: string): string;
4
4
  export declare function saveDraft(key: string, text: string): void;
@@ -1,5 +1,5 @@
1
1
  import { type KeyboardEvent } from 'react';
2
- export type HistorySurface = 'chat' | 'test-chat';
2
+ export type HistorySurface = 'chat' | 'test-chat' | 'meta-chat';
3
3
  export declare const MAX_ENTRIES = 30;
4
4
  export declare const MAX_ENTRY_CHARS = 10000;
5
5
  export declare const historyKey: (surface: HistorySurface, userId: string, projectId: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenera/chat-widget",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "React chat for Zenera projects: AG-UI messages, tool calls and markdown, as components and hooks",
5
5
  "keywords": [
6
6
  "zenera",