@zenera/chat-widget 0.0.0-stage → 0.1.2
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/LICENSE +21 -0
- package/README.md +190 -2
- package/dist/index.js +16 -0
- package/dist/shadow-DmEgvnQS.js +4 -0
- package/dist/styles.css +2 -0
- package/dist/types/packages/chat-widget/src/index.d.ts +4 -0
- package/dist/types/packages/chat-widget/src/launcher/geometry.d.ts +27 -0
- package/dist/types/packages/chat-widget/src/launcher/index.d.ts +17 -0
- package/dist/types/packages/chat-widget/src/launcher/presentation.d.ts +59 -0
- package/dist/types/packages/chat-widget/src/launcher/shell.d.ts +22 -0
- package/dist/types/packages/chat-widget/src/reducer.d.ts +63 -0
- package/dist/types/packages/chat-widget/src/transport.d.ts +98 -0
- package/dist/types/packages/chat-widget/src/ui/ChatSidebar.d.ts +54 -0
- package/dist/types/packages/chat-widget/src/ui/ChatThreadView.d.ts +37 -0
- package/dist/types/packages/chat-widget/src/ui/ZeneraChat.d.ts +42 -0
- package/dist/types/packages/chat-widget/src/ui/ZeneraChatLauncher.d.ts +15 -0
- package/dist/types/packages/chat-widget/src/ui/ZeneraChatWidget.d.ts +26 -0
- package/dist/types/packages/chat-widget/src/ui/index.d.ts +9 -0
- package/dist/types/packages/chat-widget/src/ui/internal/InterruptCard.d.ts +35 -0
- package/dist/types/packages/chat-widget/src/ui/internal/KnownToolContent.d.ts +7 -0
- package/dist/types/packages/chat-widget/src/ui/internal/McpToolContent.d.ts +7 -0
- package/dist/types/packages/chat-widget/src/ui/internal/MemoryToolContent.d.ts +10 -0
- package/dist/types/packages/chat-widget/src/ui/internal/ShadowFrame.d.ts +6 -0
- package/dist/types/packages/chat-widget/src/ui/internal/ToolCallCard.d.ts +25 -0
- package/dist/types/packages/chat-widget/src/ui/internal/ToolContent.d.ts +22 -0
- package/dist/types/packages/chat-widget/src/ui/internal/composerDraft.d.ts +4 -0
- package/dist/types/packages/chat-widget/src/ui/internal/memoryPresentation.d.ts +13 -0
- package/dist/types/packages/chat-widget/src/ui/internal/toolPresentation.d.ts +23 -0
- package/dist/types/packages/chat-widget/src/useChatThread.d.ts +24 -0
- package/dist/types/packages/chat-widget/src/useThreadList.d.ts +11 -0
- package/dist/types/packages/chat-widget/src/widget.d.ts +32 -0
- package/dist/types/shared/components/Button.d.ts +11 -0
- package/dist/types/shared/components/CodeBlock.d.ts +5 -0
- package/dist/types/shared/components/CollapsibleBubble.d.ts +7 -0
- package/dist/types/shared/components/CopyButton.d.ts +6 -0
- package/dist/types/shared/components/DeleteButton.d.ts +13 -0
- package/dist/types/shared/components/Hint.d.ts +7 -0
- package/dist/types/shared/components/Input.d.ts +2 -0
- package/dist/types/shared/components/Markdown.d.ts +6 -0
- package/dist/types/shared/components/Mermaid.d.ts +8 -0
- package/dist/types/shared/components/Textarea.d.ts +2 -0
- package/dist/types/shared/lib/clipboard.d.ts +4 -0
- package/dist/types/shared/lib/colorScheme.d.ts +1 -0
- package/dist/types/shared/lib/focus.d.ts +2 -0
- package/dist/types/shared/lib/highlight.d.ts +3 -0
- package/dist/types/shared/lib/portalContainer.d.ts +2 -0
- package/dist/types/shared/lib/promptHistory.d.ts +32 -0
- package/dist/types/shared/lib/utils.d.ts +2 -0
- package/dist/ui.js +2823 -0
- package/dist/useThreadList-Pg29akQ4.js +576 -0
- package/dist/widget/chat-widget.iife.js +315 -0
- package/package.json +89 -5
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type KeyboardEvent } from 'react';
|
|
2
|
+
export type HistorySurface = 'chat' | 'test-chat';
|
|
3
|
+
export declare const MAX_ENTRIES = 30;
|
|
4
|
+
export declare const MAX_ENTRY_CHARS = 10000;
|
|
5
|
+
export declare const historyKey: (surface: HistorySurface, userId: string, projectId: string) => string;
|
|
6
|
+
/** Oldest first. */
|
|
7
|
+
export declare function loadHistory(key: string): string[];
|
|
8
|
+
export declare function rememberPrompt(key: string, text: string): void;
|
|
9
|
+
/** Each message once, at the place of its latest use. */
|
|
10
|
+
export declare function latestUnique(entries: string[]): string[];
|
|
11
|
+
export interface Browsing {
|
|
12
|
+
/** the entry shown now */
|
|
13
|
+
index: number;
|
|
14
|
+
/** what was in the box before the first step back */
|
|
15
|
+
draft: string;
|
|
16
|
+
shown: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Step {
|
|
19
|
+
value: string;
|
|
20
|
+
browsing: Browsing | null;
|
|
21
|
+
}
|
|
22
|
+
export declare function stepHistory(entries: string[], browsing: Browsing | null, direction: 'up' | 'down', value: string): Step | null;
|
|
23
|
+
export declare const onFirstLine: (value: string, start: number, end: number) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* `entries` gives the messages, oldest first. `onKeyDown` goes on the textarea; it handles the
|
|
26
|
+
* arrows and leaves every other key alone. While a recalled message is untouched, both arrows
|
|
27
|
+
* keep walking; once it is edited the arrows move the caret again.
|
|
28
|
+
*/
|
|
29
|
+
export declare function usePromptHistory(entries: () => string[]): {
|
|
30
|
+
onKeyDown: (e: KeyboardEvent<HTMLTextAreaElement>, value: string, setValue: (value: string) => void) => void;
|
|
31
|
+
reset: () => void;
|
|
32
|
+
};
|