@zenera/chat-widget 0.0.0-stage → 0.1.1

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -2
  3. package/dist/index.js +16 -0
  4. package/dist/shadow-DmEgvnQS.js +4 -0
  5. package/dist/styles.css +2 -0
  6. package/dist/types/packages/chat-widget/src/index.d.ts +4 -0
  7. package/dist/types/packages/chat-widget/src/launcher/geometry.d.ts +27 -0
  8. package/dist/types/packages/chat-widget/src/launcher/index.d.ts +17 -0
  9. package/dist/types/packages/chat-widget/src/launcher/presentation.d.ts +59 -0
  10. package/dist/types/packages/chat-widget/src/launcher/shell.d.ts +22 -0
  11. package/dist/types/packages/chat-widget/src/reducer.d.ts +63 -0
  12. package/dist/types/packages/chat-widget/src/transport.d.ts +98 -0
  13. package/dist/types/packages/chat-widget/src/ui/ChatSidebar.d.ts +54 -0
  14. package/dist/types/packages/chat-widget/src/ui/ChatThreadView.d.ts +37 -0
  15. package/dist/types/packages/chat-widget/src/ui/ZeneraChat.d.ts +42 -0
  16. package/dist/types/packages/chat-widget/src/ui/ZeneraChatLauncher.d.ts +15 -0
  17. package/dist/types/packages/chat-widget/src/ui/ZeneraChatWidget.d.ts +26 -0
  18. package/dist/types/packages/chat-widget/src/ui/index.d.ts +9 -0
  19. package/dist/types/packages/chat-widget/src/ui/internal/InterruptCard.d.ts +35 -0
  20. package/dist/types/packages/chat-widget/src/ui/internal/KnownToolContent.d.ts +7 -0
  21. package/dist/types/packages/chat-widget/src/ui/internal/McpToolContent.d.ts +7 -0
  22. package/dist/types/packages/chat-widget/src/ui/internal/MemoryToolContent.d.ts +10 -0
  23. package/dist/types/packages/chat-widget/src/ui/internal/ShadowFrame.d.ts +6 -0
  24. package/dist/types/packages/chat-widget/src/ui/internal/ToolCallCard.d.ts +25 -0
  25. package/dist/types/packages/chat-widget/src/ui/internal/ToolContent.d.ts +22 -0
  26. package/dist/types/packages/chat-widget/src/ui/internal/composerDraft.d.ts +4 -0
  27. package/dist/types/packages/chat-widget/src/ui/internal/memoryPresentation.d.ts +13 -0
  28. package/dist/types/packages/chat-widget/src/ui/internal/toolPresentation.d.ts +23 -0
  29. package/dist/types/packages/chat-widget/src/useChatThread.d.ts +24 -0
  30. package/dist/types/packages/chat-widget/src/useThreadList.d.ts +11 -0
  31. package/dist/types/packages/chat-widget/src/widget.d.ts +32 -0
  32. package/dist/types/shared/components/Button.d.ts +11 -0
  33. package/dist/types/shared/components/CodeBlock.d.ts +5 -0
  34. package/dist/types/shared/components/CollapsibleBubble.d.ts +7 -0
  35. package/dist/types/shared/components/CopyButton.d.ts +6 -0
  36. package/dist/types/shared/components/DeleteButton.d.ts +13 -0
  37. package/dist/types/shared/components/Hint.d.ts +7 -0
  38. package/dist/types/shared/components/Input.d.ts +2 -0
  39. package/dist/types/shared/components/Markdown.d.ts +6 -0
  40. package/dist/types/shared/components/Mermaid.d.ts +8 -0
  41. package/dist/types/shared/components/Textarea.d.ts +2 -0
  42. package/dist/types/shared/lib/clipboard.d.ts +4 -0
  43. package/dist/types/shared/lib/colorScheme.d.ts +1 -0
  44. package/dist/types/shared/lib/focus.d.ts +2 -0
  45. package/dist/types/shared/lib/highlight.d.ts +3 -0
  46. package/dist/types/shared/lib/portalContainer.d.ts +2 -0
  47. package/dist/types/shared/lib/promptHistory.d.ts +32 -0
  48. package/dist/types/shared/lib/utils.d.ts +2 -0
  49. package/dist/ui.js +2823 -0
  50. package/dist/useThreadList-Pg29akQ4.js +576 -0
  51. package/dist/widget/chat-widget.iife.js +315 -0
  52. package/package.json +89 -5
@@ -0,0 +1,2 @@
1
+ export declare const PortalContainerContext: import("react").Context<HTMLElement | null>;
2
+ export declare const usePortalContainer: () => HTMLElement | null;
@@ -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
+ };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;