hermium 0.1.2 → 0.1.4
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/bin/hermium.mjs +184 -145
- package/dist/server/index.mjs +65 -65
- package/dist/web-server/__23tanstack-start-plugin-adapters-Cwee5PKy.mjs +6 -0
- package/dist/web-server/_chunks/ssr-renderer.mjs +22 -0
- package/dist/web-server/_libs/babel__runtime.mjs +237 -0
- package/dist/web-server/_libs/bail.mjs +8 -0
- package/dist/web-server/_libs/base-ui__react.mjs +9554 -0
- package/dist/web-server/_libs/base-ui__utils.mjs +1101 -0
- package/dist/web-server/_libs/ccount.mjs +16 -0
- package/dist/web-server/_libs/character-entities-legacy.mjs +111 -0
- package/dist/web-server/_libs/character-entities.mjs +2130 -0
- package/dist/web-server/_libs/character-reference-invalid.mjs +33 -0
- package/dist/web-server/_libs/class-variance-authority.mjs +44 -0
- package/dist/web-server/_libs/clsx.mjs +16 -0
- package/dist/web-server/_libs/comma-separated-tokens.mjs +31 -0
- package/dist/web-server/_libs/cookie-es.mjs +44 -0
- package/dist/web-server/_libs/croner.mjs +1 -0
- package/dist/web-server/_libs/crossws.mjs +1 -0
- package/dist/web-server/_libs/decode-named-character-reference+[...].mjs +8 -0
- package/dist/web-server/_libs/devlop.mjs +8 -0
- package/dist/web-server/_libs/escape-string-regexp.mjs +9 -0
- package/dist/web-server/_libs/estree-util-is-identifier-name.mjs +11 -0
- package/dist/web-server/_libs/extend.mjs +97 -0
- package/dist/web-server/_libs/fault.mjs +1 -0
- package/dist/web-server/_libs/floating-ui__core.mjs +663 -0
- package/dist/web-server/_libs/floating-ui__dom.mjs +624 -0
- package/dist/web-server/_libs/floating-ui__react-dom.mjs +279 -0
- package/dist/web-server/_libs/floating-ui__utils.mjs +322 -0
- package/dist/web-server/_libs/format.mjs +1 -0
- package/dist/web-server/_libs/h3.mjs +408 -0
- package/dist/web-server/_libs/hast-util-parse-selector.mjs +39 -0
- package/dist/web-server/_libs/hast-util-to-jsx-runtime.mjs +388 -0
- package/dist/web-server/_libs/hast-util-whitespace.mjs +10 -0
- package/dist/web-server/_libs/hastscript.mjs +200 -0
- package/dist/web-server/_libs/highlight.js.mjs +1 -0
- package/dist/web-server/_libs/hookable.mjs +1 -0
- package/dist/web-server/_libs/html-url-attributes.mjs +26 -0
- package/dist/web-server/_libs/inline-style-parser.mjs +142 -0
- package/dist/web-server/_libs/is-alphabetical.mjs +7 -0
- package/dist/web-server/_libs/is-alphanumerical.mjs +8 -0
- package/dist/web-server/_libs/is-decimal.mjs +7 -0
- package/dist/web-server/_libs/is-hexadecimal.mjs +7 -0
- package/dist/web-server/_libs/is-plain-obj.mjs +10 -0
- package/dist/web-server/_libs/isbot.mjs +21 -0
- package/dist/web-server/_libs/longest-streak.mjs +25 -0
- package/dist/web-server/_libs/lowlight.mjs +1 -0
- package/dist/web-server/_libs/markdown-table.mjs +142 -0
- package/dist/web-server/_libs/mdast-util-find-and-replace.mjs +109 -0
- package/dist/web-server/_libs/mdast-util-from-markdown.mjs +717 -0
- package/dist/web-server/_libs/mdast-util-gfm-autolink-literal+[...].mjs +156 -0
- package/dist/web-server/_libs/mdast-util-gfm-footnote.mjs +117 -0
- package/dist/web-server/_libs/mdast-util-gfm-strikethrough.mjs +54 -0
- package/dist/web-server/_libs/mdast-util-gfm-table.mjs +157 -0
- package/dist/web-server/_libs/mdast-util-gfm-task-list-item.mjs +77 -0
- package/dist/web-server/_libs/mdast-util-gfm.mjs +29 -0
- package/dist/web-server/_libs/mdast-util-phrasing.mjs +30 -0
- package/dist/web-server/_libs/mdast-util-to-hast.mjs +710 -0
- package/dist/web-server/_libs/mdast-util-to-markdown.mjs +798 -0
- package/dist/web-server/_libs/mdast-util-to-string.mjs +38 -0
- package/dist/web-server/_libs/micromark-core-commonmark.mjs +2259 -0
- package/dist/web-server/_libs/micromark-extension-gfm-autolink-literal+[...].mjs +344 -0
- package/dist/web-server/_libs/micromark-extension-gfm-footnote+[...].mjs +279 -0
- package/dist/web-server/_libs/micromark-extension-gfm-strikethrough+[...].mjs +98 -0
- package/dist/web-server/_libs/micromark-extension-gfm-table.mjs +491 -0
- package/dist/web-server/_libs/micromark-extension-gfm-tagfilter+[...].mjs +1 -0
- package/dist/web-server/_libs/micromark-extension-gfm-task-list-item+[...].mjs +77 -0
- package/dist/web-server/_libs/micromark-extension-gfm.mjs +18 -0
- package/dist/web-server/_libs/micromark-factory-destination.mjs +94 -0
- package/dist/web-server/_libs/micromark-factory-label.mjs +63 -0
- package/dist/web-server/_libs/micromark-factory-space.mjs +24 -0
- package/dist/web-server/_libs/micromark-factory-title.mjs +65 -0
- package/dist/web-server/_libs/micromark-factory-whitespace.mjs +22 -0
- package/dist/web-server/_libs/micromark-util-character.mjs +44 -0
- package/dist/web-server/_libs/micromark-util-chunked.mjs +36 -0
- package/dist/web-server/_libs/micromark-util-classify-character+[...].mjs +12 -0
- package/dist/web-server/_libs/micromark-util-combine-extensions+[...].mjs +41 -0
- package/dist/web-server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +19 -0
- package/dist/web-server/_libs/micromark-util-decode-string.mjs +21 -0
- package/dist/web-server/_libs/micromark-util-encode.mjs +1 -0
- package/dist/web-server/_libs/micromark-util-html-tag-name.mjs +69 -0
- package/dist/web-server/_libs/micromark-util-normalize-identifier+[...].mjs +6 -0
- package/dist/web-server/_libs/micromark-util-resolve-all.mjs +15 -0
- package/dist/web-server/_libs/micromark-util-sanitize-uri.mjs +41 -0
- package/dist/web-server/_libs/micromark-util-subtokenize.mjs +346 -0
- package/dist/web-server/_libs/micromark.mjs +906 -0
- package/dist/web-server/_libs/ocache.mjs +1 -0
- package/dist/web-server/_libs/ohash.mjs +1 -0
- package/dist/web-server/_libs/parse-entities.mjs +245 -0
- package/dist/web-server/_libs/property-information.mjs +1210 -0
- package/dist/web-server/_libs/react-dom.mjs +10779 -0
- package/dist/web-server/_libs/react-markdown.mjs +147 -0
- package/dist/web-server/_libs/react-syntax-highlighter.mjs +941 -0
- package/dist/web-server/_libs/react.mjs +513 -0
- package/dist/web-server/_libs/refractor.mjs +2425 -0
- package/dist/web-server/_libs/remark-gfm.mjs +20 -0
- package/dist/web-server/_libs/remark-parse.mjs +19 -0
- package/dist/web-server/_libs/remark-rehype.mjs +21 -0
- package/dist/web-server/_libs/reselect.mjs +1 -0
- package/dist/web-server/_libs/rou3.mjs +8 -0
- package/dist/web-server/_libs/seroval-plugins.mjs +58 -0
- package/dist/web-server/_libs/seroval.mjs +1775 -0
- package/dist/web-server/_libs/space-separated-tokens.mjs +11 -0
- package/dist/web-server/_libs/srvx.mjs +781 -0
- package/dist/web-server/_libs/style-to-js.mjs +72 -0
- package/dist/web-server/_libs/style-to-object.mjs +38 -0
- package/dist/web-server/_libs/tabler__icons-react.mjs +224 -0
- package/dist/web-server/_libs/tanstack__history.mjs +204 -0
- package/dist/web-server/_libs/tanstack__query-core.mjs +2552 -0
- package/dist/web-server/_libs/tanstack__react-query.mjs +190 -0
- package/dist/web-server/_libs/tanstack__react-router.mjs +1120 -0
- package/dist/web-server/_libs/tanstack__react-store.mjs +2 -0
- package/dist/web-server/_libs/tanstack__router-core.mjs +4288 -0
- package/dist/web-server/_libs/tanstack__store.mjs +1 -0
- package/dist/web-server/_libs/trim-lines.mjs +41 -0
- package/dist/web-server/_libs/trough.mjs +85 -0
- package/dist/web-server/_libs/ufo.mjs +54 -0
- package/dist/web-server/_libs/unctx.mjs +1 -0
- package/dist/web-server/_libs/ungap__structured-clone.mjs +224 -0
- package/dist/web-server/_libs/unified.mjs +661 -0
- package/dist/web-server/_libs/unist-util-is.mjs +100 -0
- package/dist/web-server/_libs/unist-util-position.mjs +27 -0
- package/dist/web-server/_libs/unist-util-stringify-position.mjs +27 -0
- package/dist/web-server/_libs/unist-util-visit-parents.mjs +83 -0
- package/dist/web-server/_libs/unist-util-visit.mjs +24 -0
- package/dist/web-server/_libs/unstorage.mjs +1 -0
- package/dist/web-server/_libs/use-sync-external-store.mjs +139 -0
- package/dist/web-server/_libs/vfile-message.mjs +138 -0
- package/dist/web-server/_libs/vfile.mjs +467 -0
- package/dist/web-server/_libs/zod.mjs +3915 -0
- package/dist/web-server/_libs/zustand.mjs +343 -0
- package/dist/web-server/_libs/zwitch.mjs +1 -0
- package/dist/web-server/_ssr/index-BLK6uN4p.mjs +612 -0
- package/dist/web-server/_ssr/index-BkkxTg0a.mjs +1855 -0
- package/dist/web-server/_ssr/index-Bp9a_nTf.mjs +66 -0
- package/dist/web-server/_ssr/index-C8t8AZQG.mjs +513 -0
- package/dist/web-server/_ssr/index-DSIu0x-q.mjs +449 -0
- package/dist/web-server/_ssr/index-DqFrn6kj.mjs +278 -0
- package/dist/web-server/_ssr/index-EKE8NFy_.mjs +189 -0
- package/dist/web-server/_ssr/index-JzLhPyir.mjs +213 -0
- package/dist/web-server/_ssr/index-wTy_4MhH.mjs +369 -0
- package/dist/web-server/_ssr/index.mjs +1558 -0
- package/dist/web-server/_ssr/input-BQFduUUo.mjs +20 -0
- package/dist/web-server/_ssr/router-59cN5lqo.mjs +1998 -0
- package/dist/web-server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/dist/web-server/_ssr/switch-Bim4kX8N.mjs +33 -0
- package/dist/web-server/_ssr/syntax-highlighter-5vezNTce.mjs +62 -0
- package/dist/web-server/_ssr/textarea-CK0ROhfF.mjs +18 -0
- package/dist/web-server/_tanstack-start-manifest_v-DLw6M7p4.mjs +4 -0
- package/dist/web-server/index.mjs +611 -0
- package/package.json +1 -1
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
+
import { d as useNavigate } from "../_libs/tanstack__react-router.mjs";
|
|
3
|
+
import { c as createSession, B as Button, a as cn } from "./router-59cN5lqo.mjs";
|
|
4
|
+
import { T as Textarea } from "./textarea-CK0ROhfF.mjs";
|
|
5
|
+
import { z as IconChevronLeft, v as IconPencil, A as IconBook, B as IconCode, C as IconHeart, D as IconCloud, E as IconArrowUp } from "../_libs/tabler__icons-react.mjs";
|
|
6
|
+
import "../_libs/tanstack__router-core.mjs";
|
|
7
|
+
import "../_libs/tanstack__history.mjs";
|
|
8
|
+
import "../_libs/cookie-es.mjs";
|
|
9
|
+
import "../_libs/seroval.mjs";
|
|
10
|
+
import "../_libs/seroval-plugins.mjs";
|
|
11
|
+
import "node:stream/web";
|
|
12
|
+
import "node:stream";
|
|
13
|
+
import "../_libs/react-dom.mjs";
|
|
14
|
+
import "util";
|
|
15
|
+
import "crypto";
|
|
16
|
+
import "async_hooks";
|
|
17
|
+
import "stream";
|
|
18
|
+
import "../_libs/isbot.mjs";
|
|
19
|
+
import "../_libs/tanstack__query-core.mjs";
|
|
20
|
+
import "../_libs/tanstack__react-query.mjs";
|
|
21
|
+
import "../_libs/clsx.mjs";
|
|
22
|
+
import "../_libs/class-variance-authority.mjs";
|
|
23
|
+
import "../_libs/zustand.mjs";
|
|
24
|
+
import "../_libs/base-ui__react.mjs";
|
|
25
|
+
import "../_libs/base-ui__utils.mjs";
|
|
26
|
+
import "../_libs/use-sync-external-store.mjs";
|
|
27
|
+
import "../_libs/floating-ui__utils.mjs";
|
|
28
|
+
import "../_libs/floating-ui__react-dom.mjs";
|
|
29
|
+
import "../_libs/floating-ui__dom.mjs";
|
|
30
|
+
import "../_libs/floating-ui__core.mjs";
|
|
31
|
+
import "../_libs/zod.mjs";
|
|
32
|
+
const PROMPT_CARDS = [
|
|
33
|
+
{
|
|
34
|
+
icon: IconPencil,
|
|
35
|
+
label: "Write",
|
|
36
|
+
title: "Write",
|
|
37
|
+
description: "Articles, stories, documentation, and all kinds of written content.",
|
|
38
|
+
prompts: [
|
|
39
|
+
"Write a short story about a robot learning to paint — make it emotional and reflective, around 500 words.",
|
|
40
|
+
"Draft a professional email template for following up with clients after a meeting.",
|
|
41
|
+
"Write a persuasive blog post on why companies should adopt a 4-day work week.",
|
|
42
|
+
"Create a product description for a smart water bottle that tracks hydration, 3 sentences max per feature.",
|
|
43
|
+
"Rewrite this paragraph to be more concise and impactful: [paste text]"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
icon: IconBook,
|
|
48
|
+
label: "Learn",
|
|
49
|
+
title: "Learn",
|
|
50
|
+
description: "Explore new topics, get clear explanations, and dive deep into any subject.",
|
|
51
|
+
prompts: [
|
|
52
|
+
"Explain quantum computing like I'm 10 years old — simple but accurate with fun analogies.",
|
|
53
|
+
"Teach me the basics of investing: stocks, bonds, ETFs, and how to start with $500.",
|
|
54
|
+
"Give me a 5-minute summary of the French Revolution — key dates, people, and outcomes.",
|
|
55
|
+
"Explain how large language models like you actually work under the hood.",
|
|
56
|
+
"Walk me through the core principles of color theory for UI design."
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
icon: IconCode,
|
|
61
|
+
label: "Code",
|
|
62
|
+
title: "Code",
|
|
63
|
+
description: "Build, debug, refactor, and architect software with AI assistance.",
|
|
64
|
+
prompts: [
|
|
65
|
+
"Build a Python script that monitors a directory for new files and uploads them to S3. Include error handling, logging, and a config file.",
|
|
66
|
+
"Review this code for performance bottlenecks and suggest specific improvements: [paste code]",
|
|
67
|
+
"Create a React hook that debounces a value and returns loading/error states.",
|
|
68
|
+
"Write a SQL query to find the top 5 customers by revenue this month, with their last order date.",
|
|
69
|
+
"Explain the difference between REST and GraphQL — when would you choose one over the other, with a real example."
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
icon: IconHeart,
|
|
74
|
+
label: "Life stuff",
|
|
75
|
+
title: "Life Stuff",
|
|
76
|
+
description: "Productivity, habits, health, relationships, and everyday advice.",
|
|
77
|
+
prompts: [
|
|
78
|
+
"Give me a daily routine that balances deep work, exercise, social time, and rest. I work from home and tend to overwork.",
|
|
79
|
+
"How do I start a regular meditation practice? Suggest a beginner-friendly 10-minute routine.",
|
|
80
|
+
"I want to read more books — help me set up a sustainable reading habit and pick my first 5.",
|
|
81
|
+
"What are 3 evidence-backed techniques to reduce anxiety before a big presentation?",
|
|
82
|
+
"Help me plan a weekly meal prep routine that's healthy, affordable, and takes under 2 hours on Sunday."
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
icon: IconCloud,
|
|
87
|
+
label: "Weather",
|
|
88
|
+
title: "Weather",
|
|
89
|
+
description: "Forecasts, climate insights, and weather patterns anywhere in the world.",
|
|
90
|
+
prompts: [
|
|
91
|
+
"What's the weather like today in my area? Give me a detailed forecast with temperature, humidity, and chance of rain.",
|
|
92
|
+
"What's the best time of year to visit Tokyo for mild weather and fewer crowds?",
|
|
93
|
+
"Explain how hurricanes form and how their intensity is categorized.",
|
|
94
|
+
"Compare the climates of San Francisco and New York — which one has milder winters?",
|
|
95
|
+
"What does 'dew point' actually mean and why does it matter for comfort?"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
function useGreeting() {
|
|
100
|
+
const [greeting, setGreeting] = reactExports.useState("");
|
|
101
|
+
reactExports.useEffect(() => {
|
|
102
|
+
const hour = (/* @__PURE__ */ new Date()).getHours();
|
|
103
|
+
if (hour < 12) setGreeting("Good morning");
|
|
104
|
+
else if (hour < 17) setGreeting("Good afternoon");
|
|
105
|
+
else if (hour < 21) setGreeting("Good evening");
|
|
106
|
+
else setGreeting("Good night");
|
|
107
|
+
}, []);
|
|
108
|
+
return greeting;
|
|
109
|
+
}
|
|
110
|
+
function DashboardInput({
|
|
111
|
+
onSubmit,
|
|
112
|
+
disabled
|
|
113
|
+
}) {
|
|
114
|
+
const [value, setValue] = reactExports.useState("");
|
|
115
|
+
const textareaRef = reactExports.useRef(null);
|
|
116
|
+
const autoResize = reactExports.useCallback(() => {
|
|
117
|
+
const el = textareaRef.current;
|
|
118
|
+
if (!el) return;
|
|
119
|
+
el.style.height = "auto";
|
|
120
|
+
el.style.height = `${Math.min(el.scrollHeight, 200)}px`;
|
|
121
|
+
}, []);
|
|
122
|
+
reactExports.useEffect(() => {
|
|
123
|
+
autoResize();
|
|
124
|
+
}, [value, autoResize]);
|
|
125
|
+
reactExports.useEffect(() => {
|
|
126
|
+
textareaRef.current?.focus();
|
|
127
|
+
}, []);
|
|
128
|
+
const handleSend = reactExports.useCallback(() => {
|
|
129
|
+
const text = value.trim();
|
|
130
|
+
if (!text || disabled) return;
|
|
131
|
+
setValue("");
|
|
132
|
+
if (textareaRef.current) textareaRef.current.style.height = "auto";
|
|
133
|
+
onSubmit(text);
|
|
134
|
+
}, [value, disabled, onSubmit]);
|
|
135
|
+
function handleKeyDown(e) {
|
|
136
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
handleSend();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const canSend = value.trim().length > 0;
|
|
142
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col rounded-2xl border border-border bg-card shadow-lg transition-colors", children: [
|
|
143
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
144
|
+
Textarea,
|
|
145
|
+
{
|
|
146
|
+
ref: textareaRef,
|
|
147
|
+
value,
|
|
148
|
+
onChange: (e) => setValue(e.target.value),
|
|
149
|
+
onKeyDown: handleKeyDown,
|
|
150
|
+
placeholder: "Ask anything…",
|
|
151
|
+
rows: 1,
|
|
152
|
+
disabled,
|
|
153
|
+
className: cn(
|
|
154
|
+
"w-full !rounded-none border-0 p-4 outline-none text-[15px] text-foreground resize-none shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-transparent bg-transparent whitespace-pre-wrap break-words",
|
|
155
|
+
"min-h-[56px] max-h-[200px]"
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-end p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
160
|
+
Button,
|
|
161
|
+
{
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
size: "icon-sm",
|
|
164
|
+
className: cn(
|
|
165
|
+
"rounded-full transition-colors cursor-pointer",
|
|
166
|
+
canSend && !disabled ? "bg-primary hover:bg-primary/90 text-primary-foreground" : "bg-primary text-primary-foreground opacity-40"
|
|
167
|
+
),
|
|
168
|
+
disabled: !canSend || disabled,
|
|
169
|
+
onClick: handleSend,
|
|
170
|
+
title: "Send message",
|
|
171
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconArrowUp, { className: "h-4 w-4" })
|
|
172
|
+
}
|
|
173
|
+
) })
|
|
174
|
+
] });
|
|
175
|
+
}
|
|
176
|
+
function DashboardPage() {
|
|
177
|
+
const navigate = useNavigate();
|
|
178
|
+
const greeting = useGreeting();
|
|
179
|
+
const [selectedPrompt, setSelectedPrompt] = reactExports.useState(null);
|
|
180
|
+
const [isSubmitting, setIsSubmitting] = reactExports.useState(false);
|
|
181
|
+
const submittingRef = reactExports.useRef(false);
|
|
182
|
+
const handleNewChat = reactExports.useCallback(
|
|
183
|
+
async (initialMessage) => {
|
|
184
|
+
if (submittingRef.current) return;
|
|
185
|
+
submittingRef.current = true;
|
|
186
|
+
setIsSubmitting(true);
|
|
187
|
+
try {
|
|
188
|
+
const session = await createSession();
|
|
189
|
+
if (initialMessage) {
|
|
190
|
+
sessionStorage.setItem(`hermium_pending_msg_${session.id}`, initialMessage);
|
|
191
|
+
}
|
|
192
|
+
navigate({
|
|
193
|
+
to: "/chat/$sessionId",
|
|
194
|
+
params: { sessionId: session.id }
|
|
195
|
+
});
|
|
196
|
+
} catch {
|
|
197
|
+
submittingRef.current = false;
|
|
198
|
+
setIsSubmitting(false);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
[navigate]
|
|
202
|
+
);
|
|
203
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-1 flex-col items-center justify-center px-4 overflow-hidden", children: [
|
|
204
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-10 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-5xl font-semibold tracking-tight", children: greeting }) }),
|
|
205
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full max-w-3xl", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
206
|
+
DashboardInput,
|
|
207
|
+
{
|
|
208
|
+
onSubmit: handleNewChat,
|
|
209
|
+
disabled: isSubmitting
|
|
210
|
+
}
|
|
211
|
+
) }),
|
|
212
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-6 w-full max-w-3xl", children: selectedPrompt ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
213
|
+
"div",
|
|
214
|
+
{
|
|
215
|
+
className: "rounded-2xl border bg-card p-6",
|
|
216
|
+
style: { animation: "fadeSlideIn 0.2s ease-out" },
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
219
|
+
"button",
|
|
220
|
+
{
|
|
221
|
+
disabled: isSubmitting,
|
|
222
|
+
onClick: () => setSelectedPrompt(null),
|
|
223
|
+
className: "mb-4 flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconChevronLeft, { className: "size-3.5" }),
|
|
226
|
+
"Back to suggestions"
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "space-y-2", children: selectedPrompt.prompts.map((prompt, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
231
|
+
"button",
|
|
232
|
+
{
|
|
233
|
+
disabled: isSubmitting,
|
|
234
|
+
onClick: () => handleNewChat(prompt),
|
|
235
|
+
className: "group w-full rounded-xl border border-border bg-muted/30 px-4 py-3 text-left text-sm leading-relaxed text-foreground transition-colors hover:bg-muted/60 hover:border-foreground/20 disabled:opacity-50",
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-2 text-xs font-medium text-muted-foreground", children: [
|
|
238
|
+
i + 1,
|
|
239
|
+
"."
|
|
240
|
+
] }),
|
|
241
|
+
prompt
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
) }, i)) })
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"prompt-card"
|
|
248
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
className: "flex flex-wrap justify-center gap-2",
|
|
252
|
+
style: { animation: "fadeSlideIn 0.2s ease-out" },
|
|
253
|
+
children: PROMPT_CARDS.map((meta) => {
|
|
254
|
+
const Icon = meta.icon;
|
|
255
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
256
|
+
Button,
|
|
257
|
+
{
|
|
258
|
+
variant: "ghost",
|
|
259
|
+
disabled: isSubmitting,
|
|
260
|
+
className: "group flex items-center gap-2 rounded-lg border border-border bg-muted/40 dark:bg-muted/40 px-3 py-1.5 text-sm text-foreground transition-colors duration-200 ease-out hover:bg-muted/60 h-auto disabled:opacity-50",
|
|
261
|
+
onClick: () => setSelectedPrompt(meta),
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: "h-5 w-5 text-muted-foreground transition-colors group-hover:text-foreground" }),
|
|
264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[15px]", children: meta.label })
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
meta.label
|
|
268
|
+
);
|
|
269
|
+
})
|
|
270
|
+
},
|
|
271
|
+
"chips"
|
|
272
|
+
) })
|
|
273
|
+
] });
|
|
274
|
+
}
|
|
275
|
+
const SplitComponent = DashboardPage;
|
|
276
|
+
export {
|
|
277
|
+
SplitComponent as component
|
|
278
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../_libs/react.mjs";
|
|
2
|
+
import { R as Route$5, u as useTheme } from "./router-59cN5lqo.mjs";
|
|
3
|
+
import { i as IconLanguage, h as IconKey, g as IconBell, f as IconPaint, e as IconUser, q as IconRobot, c as IconSun, d as IconMoon, M as IconDeviceDesktop } from "../_libs/tabler__icons-react.mjs";
|
|
4
|
+
import "../_libs/tanstack__react-router.mjs";
|
|
5
|
+
import "../_libs/tanstack__router-core.mjs";
|
|
6
|
+
import "../_libs/tanstack__history.mjs";
|
|
7
|
+
import "../_libs/cookie-es.mjs";
|
|
8
|
+
import "../_libs/seroval.mjs";
|
|
9
|
+
import "../_libs/seroval-plugins.mjs";
|
|
10
|
+
import "node:stream/web";
|
|
11
|
+
import "node:stream";
|
|
12
|
+
import "../_libs/react-dom.mjs";
|
|
13
|
+
import "util";
|
|
14
|
+
import "crypto";
|
|
15
|
+
import "async_hooks";
|
|
16
|
+
import "stream";
|
|
17
|
+
import "../_libs/isbot.mjs";
|
|
18
|
+
import "../_libs/tanstack__query-core.mjs";
|
|
19
|
+
import "../_libs/tanstack__react-query.mjs";
|
|
20
|
+
import "../_libs/clsx.mjs";
|
|
21
|
+
import "../_libs/class-variance-authority.mjs";
|
|
22
|
+
import "../_libs/zustand.mjs";
|
|
23
|
+
import "../_libs/base-ui__react.mjs";
|
|
24
|
+
import "../_libs/base-ui__utils.mjs";
|
|
25
|
+
import "../_libs/use-sync-external-store.mjs";
|
|
26
|
+
import "../_libs/floating-ui__utils.mjs";
|
|
27
|
+
import "../_libs/floating-ui__react-dom.mjs";
|
|
28
|
+
import "../_libs/floating-ui__dom.mjs";
|
|
29
|
+
import "../_libs/floating-ui__core.mjs";
|
|
30
|
+
import "../_libs/zod.mjs";
|
|
31
|
+
const settingsMap = {
|
|
32
|
+
profile: {
|
|
33
|
+
icon: IconUser,
|
|
34
|
+
title: "Profile",
|
|
35
|
+
description: "Your name, email, and avatar",
|
|
36
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
37
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
38
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-foreground", children: "Display Name" }),
|
|
39
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
defaultValue: "User",
|
|
44
|
+
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none focus:border-primary/50 transition-colors"
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
49
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-foreground", children: "Email" }),
|
|
50
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51
|
+
"input",
|
|
52
|
+
{
|
|
53
|
+
type: "email",
|
|
54
|
+
defaultValue: "user@hermium.dev",
|
|
55
|
+
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none focus:border-primary/50 transition-colors"
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
},
|
|
61
|
+
appearance: {
|
|
62
|
+
icon: IconPaint,
|
|
63
|
+
title: "Appearance",
|
|
64
|
+
description: "Theme, font size, and density",
|
|
65
|
+
get content() {
|
|
66
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AppearanceSettings, {});
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
notifications: {
|
|
70
|
+
icon: IconBell,
|
|
71
|
+
title: "Notifications",
|
|
72
|
+
description: "Push and in-app notifications",
|
|
73
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-3", children: ["Desktop notifications", "Sound on new message", "Show preview in notification"].map((label) => /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [
|
|
74
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", defaultChecked: true, className: "rounded border-border accent-primary" }),
|
|
75
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-foreground", children: label })
|
|
76
|
+
] }, label)) })
|
|
77
|
+
},
|
|
78
|
+
"api-keys": {
|
|
79
|
+
icon: IconKey,
|
|
80
|
+
title: "API Keys",
|
|
81
|
+
description: "Manage providers and keys",
|
|
82
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
|
|
83
|
+
[
|
|
84
|
+
{ provider: "OpenAI", key: "sk-••••••••••••••••", status: "active" },
|
|
85
|
+
{ provider: "Anthropic", key: "sk-ant-•••••••••••", status: "active" },
|
|
86
|
+
{ provider: "Groq", key: "gsk-••••••••••••••••", status: "active" }
|
|
87
|
+
].map((p) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between rounded-lg border border-border px-3 py-2.5", children: [
|
|
88
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconRobot, { className: "size-4 text-muted-foreground" }),
|
|
90
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
91
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-medium text-foreground", children: p.provider }),
|
|
92
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground ml-2", children: p.key })
|
|
93
|
+
] })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] font-medium text-green-600 dark:text-green-400 uppercase tracking-wider", children: p.status })
|
|
96
|
+
] }, p.provider)),
|
|
97
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "w-full rounded-lg border border-dashed border-border px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors", children: "+ Add API Key" })
|
|
98
|
+
] })
|
|
99
|
+
},
|
|
100
|
+
language: {
|
|
101
|
+
icon: IconLanguage,
|
|
102
|
+
title: "Language & Region",
|
|
103
|
+
description: "Language, timezone, and format preferences",
|
|
104
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
|
|
105
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
106
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-foreground", children: "Language" }),
|
|
107
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("select", { className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary/50 transition-colors", children: [
|
|
108
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "English" }),
|
|
109
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "Spanish" }),
|
|
110
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "French" }),
|
|
111
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "German" }),
|
|
112
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "Japanese" })
|
|
113
|
+
] })
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-foreground", children: "Timezone" }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("select", { className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary/50 transition-colors", children: [
|
|
118
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "UTC (Coordinated Universal Time)" }),
|
|
119
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "America/New_York" }),
|
|
120
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "America/Los_Angeles" }),
|
|
121
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "Europe/London" }),
|
|
122
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { children: "Asia/Tokyo" })
|
|
123
|
+
] })
|
|
124
|
+
] })
|
|
125
|
+
] })
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
function AppearanceSettings() {
|
|
129
|
+
const { resolvedTheme, setTheme } = useTheme();
|
|
130
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
131
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
132
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-foreground", children: "Theme" }),
|
|
133
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-3 gap-2", children: [
|
|
134
|
+
{ id: "light", icon: IconSun, label: "Light" },
|
|
135
|
+
{ id: "dark", icon: IconMoon, label: "Dark" },
|
|
136
|
+
{ id: "system", icon: IconDeviceDesktop, label: "System" }
|
|
137
|
+
].map((t) => {
|
|
138
|
+
const isActive = t.id === (resolvedTheme === "dark" ? "dark" : t.id === "system" ? "system" : "light");
|
|
139
|
+
const Icon = t.icon;
|
|
140
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
141
|
+
"button",
|
|
142
|
+
{
|
|
143
|
+
onClick: () => setTheme(t.id),
|
|
144
|
+
className: cn(
|
|
145
|
+
"flex flex-col items-center gap-1.5 rounded-lg border px-3 py-2.5 text-xs transition-colors",
|
|
146
|
+
isActive ? "border-primary/50 bg-primary/5 text-foreground" : "border-border text-muted-foreground hover:border-foreground/20 hover:text-foreground"
|
|
147
|
+
),
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: "size-5" }),
|
|
150
|
+
t.label
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
t.id
|
|
154
|
+
);
|
|
155
|
+
}) })
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
158
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium text-foreground", children: "Font Size" }),
|
|
159
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
160
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-muted-foreground", children: "A" }),
|
|
161
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "range", min: "12", max: "20", defaultValue: "14", className: "flex-1 accent-primary" }),
|
|
162
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg text-muted-foreground", children: "A" })
|
|
163
|
+
] })
|
|
164
|
+
] })
|
|
165
|
+
] });
|
|
166
|
+
}
|
|
167
|
+
function cn(...classes) {
|
|
168
|
+
return classes.filter(Boolean).join(" ");
|
|
169
|
+
}
|
|
170
|
+
function SettingsPage({ section }) {
|
|
171
|
+
const currentSectionId = section && section in settingsMap ? section : "profile";
|
|
172
|
+
const current = settingsMap[currentSectionId];
|
|
173
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-auto max-w-2xl px-8 py-8", children: [
|
|
174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
|
|
175
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold text-foreground", children: current.title }),
|
|
176
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: current.description })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-xl border border-border bg-card p-6", children: current.content })
|
|
179
|
+
] }) });
|
|
180
|
+
}
|
|
181
|
+
function SettingsRoute() {
|
|
182
|
+
const {
|
|
183
|
+
section
|
|
184
|
+
} = Route$5.useSearch();
|
|
185
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsPage, { section });
|
|
186
|
+
}
|
|
187
|
+
export {
|
|
188
|
+
SettingsRoute as component
|
|
189
|
+
};
|