@schlenkr/quassel 0.0.0-stage → 0.5.0
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/ChatActionDock.d.ts +2 -0
- package/ChatInputToolbar.d.ts +61 -0
- package/ChatMessages.d.ts +51 -0
- package/ChatPanel.d.ts +17 -0
- package/ChatSendContext.d.ts +7 -0
- package/DetailModeSwitch.d.ts +16 -0
- package/LICENSE +21 -0
- package/Markdown.d.ts +19 -0
- package/MessageActions.d.ts +8 -0
- package/PendingActionCard.d.ts +13 -0
- package/QuasselProvider.d.ts +89 -0
- package/README.md +127 -2
- package/StepPopover.d.ts +16 -0
- package/TimestampSwitch.d.ts +7 -0
- package/TranscriptModeSwitch.d.ts +8 -0
- package/WorkingScenes.d.ts +12 -0
- package/announce.d.ts +2 -0
- package/attachments.d.ts +24 -0
- package/chat-attachments.d.ts +6 -0
- package/chat-scroll.d.ts +12 -0
- package/chat.css +2072 -0
- package/chunk-3VEL4HEO.js +183 -0
- package/chunk-3VEL4HEO.js.map +7 -0
- package/elapsed.d.ts +16 -0
- package/events.d.ts +145 -0
- package/events.js +21 -0
- package/events.js.map +7 -0
- package/index.d.ts +25 -0
- package/index.js +2565 -0
- package/index.js.map +7 -0
- package/options.d.ts +42 -0
- package/package.json +53 -4
- package/texts.d.ts +71 -0
- package/timestamps.d.ts +7 -0
- package/types.d.ts +23 -0
- package/ui/button.d.ts +8 -0
- package/ui/card.d.ts +5 -0
- package/ui/cn.d.ts +2 -0
- package/ui/popover.d.ts +6 -0
- package/ui/spinner.d.ts +2 -0
- package/ui/stop-button.d.ts +10 -0
- package/ui/toggle.d.ts +8 -0
- package/ui/useFileInput.d.ts +20 -0
- package/useChatAction.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schlenkr/quassel",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Chat building blocks for React: streaming transcript with thinking and tool steps, input card, themable Tailwind styles and an event contract",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Ronald Schlenker",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/SchlenkR/quassel.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/SchlenkR/quassel#readme",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"chat",
|
|
14
|
+
"react",
|
|
15
|
+
"llm",
|
|
16
|
+
"agent",
|
|
17
|
+
"streaming",
|
|
18
|
+
"ui",
|
|
19
|
+
"tailwind"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"*.css"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
|
+
"default": "./index.js"
|
|
29
|
+
},
|
|
30
|
+
"./events": {
|
|
31
|
+
"types": "./events.d.ts",
|
|
32
|
+
"default": "./events.js"
|
|
33
|
+
},
|
|
34
|
+
"./chat.css": "./chat.css"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@base-ui/react": "^1.8.0",
|
|
38
|
+
"class-variance-authority": "^0.7.1",
|
|
39
|
+
"cn": "^0.3.0",
|
|
40
|
+
"lucide-react": "^1.46.0",
|
|
41
|
+
"streamdown": "^2.6.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": "^18 || ^19",
|
|
45
|
+
"react-dom": "^18 || ^19"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"react": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"react-dom": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
package/texts.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export interface ChatTexts {
|
|
2
|
+
working: string;
|
|
3
|
+
toolRunning: string;
|
|
4
|
+
toolStillRunning: string;
|
|
5
|
+
toolElapsedSeconds: string;
|
|
6
|
+
currentTool: string;
|
|
7
|
+
thinkingChip: string;
|
|
8
|
+
toolChip: string;
|
|
9
|
+
stepGroupOne: string;
|
|
10
|
+
stepGroupMany: string;
|
|
11
|
+
stepGroupErrorOne?: string;
|
|
12
|
+
stepGroupErrorMany?: string;
|
|
13
|
+
stepGroupCollapse: string;
|
|
14
|
+
thinkingTitle: string;
|
|
15
|
+
toolTitle: string;
|
|
16
|
+
argumentsLabel: string;
|
|
17
|
+
resultLabel: string;
|
|
18
|
+
close: string;
|
|
19
|
+
jumpToEnd: string;
|
|
20
|
+
send: string;
|
|
21
|
+
sendIntoRun: string;
|
|
22
|
+
stop: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
steeringPlaceholder: string;
|
|
25
|
+
steered: string;
|
|
26
|
+
detailModeTitle: string;
|
|
27
|
+
detailModeOff: string;
|
|
28
|
+
detailModeCurrent: string;
|
|
29
|
+
detailModeIcons: string;
|
|
30
|
+
detailModeChips: string;
|
|
31
|
+
detailModeGrouped: string;
|
|
32
|
+
detailModeCompact: string;
|
|
33
|
+
detailModeFull: string;
|
|
34
|
+
showAllMessages?: string;
|
|
35
|
+
showLatestExchange?: string;
|
|
36
|
+
showTimestamps: string;
|
|
37
|
+
hideTimestamps: string;
|
|
38
|
+
copyMessage: string;
|
|
39
|
+
editMessage: string;
|
|
40
|
+
retryMessage: string;
|
|
41
|
+
copyCode: string;
|
|
42
|
+
copied: string;
|
|
43
|
+
pendingAction: string;
|
|
44
|
+
dismissAction: string;
|
|
45
|
+
actionDismissed: string;
|
|
46
|
+
actionFailed: string;
|
|
47
|
+
clipboardUnavailable: string;
|
|
48
|
+
transcript: string;
|
|
49
|
+
attachments: string;
|
|
50
|
+
attachFiles: string;
|
|
51
|
+
attachFilesHint: string;
|
|
52
|
+
removeAttachment: string;
|
|
53
|
+
attachmentPreparing: string;
|
|
54
|
+
attachmentsPreparing: string;
|
|
55
|
+
attachmentReadFailed: string;
|
|
56
|
+
attachmentsWhileBusy: string;
|
|
57
|
+
tooManyAttachments: string;
|
|
58
|
+
attachmentsTooLarge: string;
|
|
59
|
+
attachmentUnsupported: string;
|
|
60
|
+
attachmentUnsupportedByModel: string;
|
|
61
|
+
attachmentKindImage: string;
|
|
62
|
+
attachmentKindVideo: string;
|
|
63
|
+
attachmentKindPdf: string;
|
|
64
|
+
notSent: string;
|
|
65
|
+
notSentAttachments: string;
|
|
66
|
+
insertUnsent: string;
|
|
67
|
+
}
|
|
68
|
+
export declare const fillText: (text: string, values: Record<string, string | number>) => string;
|
|
69
|
+
export declare const englishTexts: Required<ChatTexts>;
|
|
70
|
+
export declare const germanTexts: Required<ChatTexts>;
|
|
71
|
+
export declare const defaultTexts: Required<ChatTexts>;
|
package/timestamps.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TimestampOptions } from "./options";
|
|
2
|
+
export declare function messageDate(at: string | undefined): Date | undefined;
|
|
3
|
+
export declare function timestampLabel(date: Date, options?: TimestampOptions, now?: number): string;
|
|
4
|
+
export declare function timestampDay(date: Date, options?: TimestampOptions): {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Message } from "./events";
|
|
2
|
+
export type { Role, ToolInfo, PendingAction, Message, ChatEvent, ChatTextCursor, ChatJournalCursor, ChatAttachment, ChatAttachmentInput, ChatAttachmentCapabilities, ChatStartupStatus } from "./events";
|
|
3
|
+
export { applyEvent, prettyJson, compactToolLine } from "./events";
|
|
4
|
+
export type TranscriptMode = "all" | "latest";
|
|
5
|
+
/**
|
|
6
|
+
* current = only the running step, off = answers only, icons = steps as plain icons side by side,
|
|
7
|
+
* chips = steps as icon + short text side by side (wrapping),
|
|
8
|
+
* grouped = consecutive steps as one expandable line, single line each inside,
|
|
9
|
+
* compact = thinking and tools on a single line, full = everything expanded.
|
|
10
|
+
*/
|
|
11
|
+
export type DetailMode = "off" | "current" | "icons" | "chips" | "grouped" | "compact" | "full";
|
|
12
|
+
/** running = call still open, thinking = thought block still open, done = finished, error = failed. */
|
|
13
|
+
export type StepState = "running" | "thinking" | "done" | "error";
|
|
14
|
+
/** The single derivation of a step state, so chips, hosts and tests read the same signal. */
|
|
15
|
+
export declare function stepState(message: Message): StepState;
|
|
16
|
+
/** A moment worth one screen reader announcement: a finished reply or a new pending action. */
|
|
17
|
+
export type ChatAnnouncement = {
|
|
18
|
+
kind: "reply";
|
|
19
|
+
message: Message;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "action";
|
|
22
|
+
message: Message;
|
|
23
|
+
};
|
package/ui/button.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Button, buttonVariants };
|
package/ui/card.d.ts
ADDED
package/ui/cn.d.ts
ADDED
package/ui/popover.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
2
|
+
declare function Popover({ ...props }: PopoverPrimitive.Root.Props): import("react").JSX.Element;
|
|
3
|
+
declare function PopoverContent({ className, align, alignOffset, side, sideOffset, anchor, collisionPadding, keepMounted, portalContainer, ...props }: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "anchor" | "collisionPadding"> & Pick<PopoverPrimitive.Portal.Props, "keepMounted"> & {
|
|
4
|
+
portalContainer?: HTMLElement | ShadowRoot;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
export { Popover, PopoverContent };
|
package/ui/spinner.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SquareIcon } from "lucide-react";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
/** The one stop glyph: a filled red square; never used as a state icon. */
|
|
5
|
+
export declare function StopGlyph({ className, ...props }: Omit<ComponentProps<typeof SquareIcon>, "fill">): import("react").JSX.Element;
|
|
6
|
+
/** Every stop button looks the same: the glyph as icon, the word in the tooltip, red at rest and on hover. */
|
|
7
|
+
export declare function StopButton({ label, busy, className, title, ...props }: Omit<ComponentProps<typeof Button>, "children" | "variant"> & {
|
|
8
|
+
label: string;
|
|
9
|
+
busy?: boolean;
|
|
10
|
+
}): import("react").JSX.Element;
|
package/ui/toggle.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const toggleVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "outline" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Toggle({ className, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChangeEvent, type ClipboardEvent, type DragEvent } from "react";
|
|
2
|
+
export declare function useFileInput({ disabled, onFiles, onPasteText }: {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onFiles: (files: File[]) => void | Promise<void>;
|
|
5
|
+
onPasteText?: (text: string) => void;
|
|
6
|
+
}): {
|
|
7
|
+
inputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
8
|
+
dragging: boolean;
|
|
9
|
+
clearDragging: () => void;
|
|
10
|
+
inputProps: {
|
|
11
|
+
ref: import("react").RefObject<HTMLInputElement | null>;
|
|
12
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
};
|
|
14
|
+
dropProps: {
|
|
15
|
+
onDragOver: (event: DragEvent<HTMLElement>) => void;
|
|
16
|
+
onDragLeave: (event: DragEvent<HTMLElement>) => void;
|
|
17
|
+
onDrop: (event: DragEvent<HTMLElement>) => void;
|
|
18
|
+
onPaste: (event: ClipboardEvent<HTMLElement>) => void;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function useChatAction(): {
|
|
2
|
+
status: "done" | "idle" | "pending";
|
|
3
|
+
error: string | undefined;
|
|
4
|
+
invoke: (action: () => void | Promise<void>, failureLabel: string) => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export declare function copyChatText(text: string, unavailable: string): Promise<void>;
|