@tonyclaw/llm-inspector 1.6.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/.output/nitro.json +17 -0
- package/.output/public/assets/alibaba-TTwafVwX.svg +1 -0
- package/.output/public/assets/index-B3RwBPLW.css +1 -0
- package/.output/public/assets/index-s4lwsWvq.js +97 -0
- package/.output/public/assets/main-Cp8AM0Pa.js +17 -0
- package/.output/public/assets/minimax-BPMzvuL-.jpeg +0 -0
- package/.output/public/assets/qwen-CONDcHqt.png +0 -0
- package/.output/public/assets/zhipuai-BPNAnxo-.svg +219 -0
- package/.output/server/_chunks/ssr-renderer.mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +210 -0
- package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +11 -0
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +69 -0
- package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-escape-keydown+[...].mjs +17 -0
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +1 -0
- package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +6 -0
- package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +34 -0
- package/.output/server/_libs/ajv-formats.mjs +330 -0
- package/.output/server/_libs/ajv.mjs +11444 -0
- package/.output/server/_libs/aria-hidden.mjs +122 -0
- package/.output/server/_libs/atomically.mjs +152 -0
- package/.output/server/_libs/bail.mjs +8 -0
- package/.output/server/_libs/character-entities.mjs +2130 -0
- package/.output/server/_libs/class-variance-authority.mjs +44 -0
- package/.output/server/_libs/clsx.mjs +16 -0
- package/.output/server/_libs/comma-separated-tokens.mjs +10 -0
- package/.output/server/_libs/conf.mjs +635 -0
- package/.output/server/_libs/cookie-es.mjs +58 -0
- package/.output/server/_libs/core-util-is.mjs +75 -0
- package/.output/server/_libs/croner.mjs +1 -0
- package/.output/server/_libs/crossws.mjs +1 -0
- package/.output/server/_libs/debounce-fn.mjs +69 -0
- package/.output/server/_libs/decode-named-character-reference+[...].mjs +8 -0
- package/.output/server/_libs/detect-node-es.mjs +1 -0
- package/.output/server/_libs/devlop.mjs +8 -0
- package/.output/server/_libs/dot-prop.mjs +265 -0
- package/.output/server/_libs/env-paths.mjs +57 -0
- package/.output/server/_libs/estree-util-is-identifier-name.mjs +11 -0
- package/.output/server/_libs/extend.mjs +97 -0
- package/.output/server/_libs/fast-deep-equal.mjs +38 -0
- package/.output/server/_libs/fast-uri.mjs +812 -0
- package/.output/server/_libs/floating-ui__core.mjs +725 -0
- package/.output/server/_libs/floating-ui__dom.mjs +622 -0
- package/.output/server/_libs/floating-ui__react-dom.mjs +292 -0
- package/.output/server/_libs/floating-ui__utils.mjs +320 -0
- package/.output/server/_libs/get-nonce.mjs +9 -0
- package/.output/server/_libs/h3-v2.mjs +276 -0
- package/.output/server/_libs/h3.mjs +400 -0
- package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +388 -0
- package/.output/server/_libs/hast-util-whitespace.mjs +10 -0
- package/.output/server/_libs/hookable.mjs +1 -0
- package/.output/server/_libs/html-url-attributes.mjs +26 -0
- package/.output/server/_libs/immediate.mjs +74 -0
- package/.output/server/_libs/inherits.mjs +50 -0
- package/.output/server/_libs/inline-style-parser.mjs +142 -0
- package/.output/server/_libs/is-plain-obj.mjs +10 -0
- package/.output/server/_libs/isarray.mjs +14 -0
- package/.output/server/_libs/isbot.mjs +20 -0
- package/.output/server/_libs/json-schema-traverse.mjs +180 -0
- package/.output/server/_libs/jszip.mjs +3049 -0
- package/.output/server/_libs/lie.mjs +273 -0
- package/.output/server/_libs/lucide-react.mjs +368 -0
- package/.output/server/_libs/mdast-util-from-markdown.mjs +717 -0
- package/.output/server/_libs/mdast-util-to-hast.mjs +710 -0
- package/.output/server/_libs/mdast-util-to-string.mjs +38 -0
- package/.output/server/_libs/micromark-core-commonmark.mjs +2259 -0
- package/.output/server/_libs/micromark-factory-destination.mjs +94 -0
- package/.output/server/_libs/micromark-factory-label.mjs +63 -0
- package/.output/server/_libs/micromark-factory-space.mjs +24 -0
- package/.output/server/_libs/micromark-factory-title.mjs +65 -0
- package/.output/server/_libs/micromark-factory-whitespace.mjs +22 -0
- package/.output/server/_libs/micromark-util-character.mjs +44 -0
- package/.output/server/_libs/micromark-util-chunked.mjs +36 -0
- package/.output/server/_libs/micromark-util-classify-character+[...].mjs +12 -0
- package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +41 -0
- package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +19 -0
- package/.output/server/_libs/micromark-util-decode-string.mjs +21 -0
- package/.output/server/_libs/micromark-util-encode.mjs +1 -0
- package/.output/server/_libs/micromark-util-html-tag-name.mjs +69 -0
- package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +6 -0
- package/.output/server/_libs/micromark-util-resolve-all.mjs +15 -0
- package/.output/server/_libs/micromark-util-sanitize-uri.mjs +41 -0
- package/.output/server/_libs/micromark-util-subtokenize.mjs +346 -0
- package/.output/server/_libs/micromark.mjs +906 -0
- package/.output/server/_libs/mimic-function.mjs +47 -0
- package/.output/server/_libs/ohash.mjs +1 -0
- package/.output/server/_libs/pako.mjs +4223 -0
- package/.output/server/_libs/process-nextick-args.mjs +48 -0
- package/.output/server/_libs/property-information.mjs +1209 -0
- package/.output/server/_libs/radix-ui.mjs +1 -0
- package/.output/server/_libs/radix-ui__number.mjs +6 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +11 -0
- package/.output/server/_libs/radix-ui__react-accordion.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
- package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-avatar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-checkbox.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +144 -0
- package/.output/server/_libs/radix-ui__react-collection.mjs +69 -0
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +39 -0
- package/.output/server/_libs/radix-ui__react-context-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-context.mjs +78 -0
- package/.output/server/_libs/radix-ui__react-dialog.mjs +325 -0
- package/.output/server/_libs/radix-ui__react-direction.mjs +9 -0
- package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +29 -0
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +206 -0
- package/.output/server/_libs/radix-ui__react-form.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-hover-card.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-id.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-label.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-menu.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-menubar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-popover.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-popper.mjs +286 -0
- package/.output/server/_libs/radix-ui__react-portal.mjs +16 -0
- package/.output/server/_libs/radix-ui__react-presence.mjs +128 -0
- package/.output/server/_libs/radix-ui__react-primitive.mjs +42 -0
- package/.output/server/_libs/radix-ui__react-progress.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-radio-group.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +224 -0
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +721 -0
- package/.output/server/_libs/radix-ui__react-select.mjs +1163 -0
- package/.output/server/_libs/radix-ui__react-separator.mjs +28 -0
- package/.output/server/_libs/radix-ui__react-slider.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-slot.mjs +99 -0
- package/.output/server/_libs/radix-ui__react-switch.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-tabs.mjs +189 -0
- package/.output/server/_libs/radix-ui__react-toast.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toggle-group.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toggle.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-toolbar.mjs +1 -0
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +495 -0
- package/.output/server/_libs/radix-ui__react-use-previous.mjs +14 -0
- package/.output/server/_libs/radix-ui__react-use-size.mjs +39 -0
- package/.output/server/_libs/react-dom.mjs +9935 -0
- package/.output/server/_libs/react-markdown.mjs +147 -0
- package/.output/server/_libs/react-remove-scroll-bar.mjs +82 -0
- package/.output/server/_libs/react-remove-scroll.mjs +328 -0
- package/.output/server/_libs/react-style-singleton.mjs +69 -0
- package/.output/server/_libs/react.mjs +515 -0
- package/.output/server/_libs/readable-stream.mjs +1518 -0
- package/.output/server/_libs/remark-parse.mjs +19 -0
- package/.output/server/_libs/remark-rehype.mjs +21 -0
- package/.output/server/_libs/rou3.mjs +8 -0
- package/.output/server/_libs/safe-buffer.mjs +64 -0
- package/.output/server/_libs/semver.mjs +1984 -0
- package/.output/server/_libs/seroval-plugins.mjs +58 -0
- package/.output/server/_libs/seroval.mjs +1765 -0
- package/.output/server/_libs/setimmediate.mjs +1 -0
- package/.output/server/_libs/space-separated-tokens.mjs +6 -0
- package/.output/server/_libs/srvx.mjs +334 -0
- package/.output/server/_libs/stubborn-fs.mjs +91 -0
- package/.output/server/_libs/stubborn-utils.mjs +66 -0
- package/.output/server/_libs/style-to-js.mjs +72 -0
- package/.output/server/_libs/style-to-object.mjs +38 -0
- package/.output/server/_libs/tailwind-merge.mjs +3010 -0
- package/.output/server/_libs/tanstack__history.mjs +217 -0
- package/.output/server/_libs/tanstack__react-router.mjs +1480 -0
- package/.output/server/_libs/tanstack__react-store.mjs +1 -0
- package/.output/server/_libs/tanstack__react-virtual.mjs +44 -0
- package/.output/server/_libs/tanstack__router-core.mjs +4827 -0
- package/.output/server/_libs/tanstack__store.mjs +1 -0
- package/.output/server/_libs/tanstack__virtual-core.mjs +1225 -0
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/trim-lines.mjs +41 -0
- package/.output/server/_libs/trough.mjs +85 -0
- package/.output/server/_libs/tslib.mjs +576 -0
- package/.output/server/_libs/ufo.mjs +54 -0
- package/.output/server/_libs/uint8array-extras.mjs +69 -0
- package/.output/server/_libs/unctx.mjs +1 -0
- package/.output/server/_libs/ungap__structured-clone.mjs +212 -0
- package/.output/server/_libs/unified.mjs +661 -0
- package/.output/server/_libs/unist-util-is.mjs +100 -0
- package/.output/server/_libs/unist-util-position.mjs +27 -0
- package/.output/server/_libs/unist-util-stringify-position.mjs +27 -0
- package/.output/server/_libs/unist-util-visit-parents.mjs +82 -0
- package/.output/server/_libs/unist-util-visit.mjs +24 -0
- package/.output/server/_libs/unstorage.mjs +1 -0
- package/.output/server/_libs/use-callback-ref.mjs +66 -0
- package/.output/server/_libs/use-sidecar.mjs +106 -0
- package/.output/server/_libs/use-sync-external-store.mjs +1 -0
- package/.output/server/_libs/util-deprecate.mjs +12 -0
- package/.output/server/_libs/vfile-message.mjs +138 -0
- package/.output/server/_libs/vfile.mjs +467 -0
- package/.output/server/_libs/when-exit.mjs +53 -0
- package/.output/server/_libs/zod.mjs +4460 -0
- package/.output/server/_ssr/index-ByCLZu7J.mjs +3061 -0
- package/.output/server/_ssr/index.mjs +1176 -0
- package/.output/server/_ssr/router-Bq_mxeNz.mjs +2872 -0
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-C4E0e9my.mjs +4 -0
- package/.output/server/index.mjs +393 -0
- package/README.md +196 -0
- package/package.json +91 -0
- package/src/assets/logos/alibaba.svg +1 -0
- package/src/assets/logos/anthropic.svg +1 -0
- package/src/assets/logos/deepseek.svg +1 -0
- package/src/assets/logos/minimax.jpeg +0 -0
- package/src/assets/logos/openai.svg +1 -0
- package/src/assets/logos/qwen.png +0 -0
- package/src/assets/logos/zhipuai.svg +219 -0
- package/src/cli.ts +68 -0
- package/src/components/ProxyViewer.tsx +325 -0
- package/src/components/ProxyViewerContainer.tsx +211 -0
- package/src/components/providers/ProviderCard.tsx +186 -0
- package/src/components/providers/ProviderForm.tsx +259 -0
- package/src/components/providers/ProviderLogo.tsx +111 -0
- package/src/components/providers/ProvidersPanel.tsx +259 -0
- package/src/components/providers/SettingsDialog.tsx +39 -0
- package/src/components/proxy-viewer/ConversationGroup.tsx +68 -0
- package/src/components/proxy-viewer/ConversationHeader.tsx +141 -0
- package/src/components/proxy-viewer/LogEntry.tsx +225 -0
- package/src/components/proxy-viewer/LogEntryHeader.tsx +250 -0
- package/src/components/proxy-viewer/ReplayDialog.tsx +208 -0
- package/src/components/proxy-viewer/ResponseView.tsx +161 -0
- package/src/components/proxy-viewer/StreamingChunkSequence.tsx +171 -0
- package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +139 -0
- package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +64 -0
- package/src/components/proxy-viewer/formats/index.tsx +24 -0
- package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +80 -0
- package/src/components/proxy-viewer/index.ts +8 -0
- package/src/components/ui/badge.tsx +47 -0
- package/src/components/ui/button.tsx +47 -0
- package/src/components/ui/collapsible.tsx +21 -0
- package/src/components/ui/dialog.tsx +129 -0
- package/src/components/ui/json-viewer.tsx +464 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/select.tsx +178 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/tabs.tsx +88 -0
- package/src/components/ui/tooltip.tsx +51 -0
- package/src/index.css +11 -0
- package/src/lib/export-logs.ts +51 -0
- package/src/lib/utils.ts +22 -0
- package/src/proxy/chunkStorage.ts +118 -0
- package/src/proxy/constants.ts +36 -0
- package/src/proxy/formats/anthropic/anthropicProvider.ts +75 -0
- package/src/proxy/formats/anthropic/handler.ts +74 -0
- package/src/proxy/formats/anthropic/index.ts +14 -0
- package/src/proxy/formats/anthropic/register.ts +4 -0
- package/src/proxy/formats/anthropic/schemas.ts +217 -0
- package/src/proxy/formats/anthropic/stream.ts +167 -0
- package/src/proxy/formats/handler.ts +46 -0
- package/src/proxy/formats/index.ts +12 -0
- package/src/proxy/formats/jsonSchema.ts +24 -0
- package/src/proxy/formats/openai/alibabaProvider.ts +38 -0
- package/src/proxy/formats/openai/handler.ts +70 -0
- package/src/proxy/formats/openai/index.ts +25 -0
- package/src/proxy/formats/openai/provider.ts +50 -0
- package/src/proxy/formats/openai/register.ts +4 -0
- package/src/proxy/formats/openai/schemas.ts +150 -0
- package/src/proxy/formats/openai/stream.ts +153 -0
- package/src/proxy/formats/protocol.ts +50 -0
- package/src/proxy/formats/providerRegistry.ts +51 -0
- package/src/proxy/formats/providers/index.ts +3 -0
- package/src/proxy/formats/registry.ts +61 -0
- package/src/proxy/handler.ts +389 -0
- package/src/proxy/logIndex.ts +187 -0
- package/src/proxy/logger.ts +99 -0
- package/src/proxy/providers.ts +234 -0
- package/src/proxy/schemas.ts +160 -0
- package/src/proxy/socketTracker.ts +158 -0
- package/src/proxy/store.ts +386 -0
- package/src/router.tsx +16 -0
- package/src/routes/__root.tsx +38 -0
- package/src/routes/api/config.paths.ts +14 -0
- package/src/routes/api/health.ts +11 -0
- package/src/routes/api/logs.$id.chunks.ts +36 -0
- package/src/routes/api/logs.$id.replay.ts +262 -0
- package/src/routes/api/logs.$id.ts +22 -0
- package/src/routes/api/logs.stream.ts +64 -0
- package/src/routes/api/logs.ts +30 -0
- package/src/routes/api/models.ts +10 -0
- package/src/routes/api/providers.$providerId.ts +45 -0
- package/src/routes/api/providers.ts +37 -0
- package/src/routes/api/sessions.ts +10 -0
- package/src/routes/index.tsx +6 -0
- package/src/routes/proxy/$.ts +15 -0
- package/styles/globals.css +121 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getLogById } from "../../proxy/store";
|
|
4
|
+
import { findProviderByModel } from "../../proxy/providers";
|
|
5
|
+
import { registry } from "../../proxy/formats";
|
|
6
|
+
import { formatForPath, type FormatHandler } from "../../proxy/formats";
|
|
7
|
+
import { extractModelFromBody } from "../../proxy/schemas";
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_UPSTREAM,
|
|
10
|
+
DEFAULT_OPENAI_UPSTREAM,
|
|
11
|
+
PROXY_IDENTITY,
|
|
12
|
+
PRESERVE_HEADERS,
|
|
13
|
+
PATH_V1_CHAT_COMPLETIONS,
|
|
14
|
+
PATH_CHAT_COMPLETIONS,
|
|
15
|
+
PATH_V1_MESSAGES,
|
|
16
|
+
HEADER_CONTENT_TYPE,
|
|
17
|
+
HEADER_USER_AGENT,
|
|
18
|
+
HEADER_X_PROXY_IDENTITY,
|
|
19
|
+
HEADER_AUTHORIZATION,
|
|
20
|
+
HEADER_X_API_KEY,
|
|
21
|
+
HEADER_CONTENT_ENCODING,
|
|
22
|
+
HEADER_CONTENT_LENGTH,
|
|
23
|
+
HEADER_HOST,
|
|
24
|
+
AUTH_HEADER_X_API_KEY,
|
|
25
|
+
STATUS_FORBIDDEN,
|
|
26
|
+
STATUS_BAD_GATEWAY,
|
|
27
|
+
} from "../../proxy/constants";
|
|
28
|
+
|
|
29
|
+
type ReplayRequest = {
|
|
30
|
+
modifiedBody: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const ReplayRequestSchema = z.object({
|
|
34
|
+
modifiedBody: z.string(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
type ReplayResponse = {
|
|
38
|
+
success: boolean;
|
|
39
|
+
error?: string;
|
|
40
|
+
responseStatus?: number;
|
|
41
|
+
responseText?: string;
|
|
42
|
+
inputTokens?: number;
|
|
43
|
+
outputTokens?: number;
|
|
44
|
+
elapsedMs?: number;
|
|
45
|
+
streaming?: boolean;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
function getHostFromUrl(urlStr: string): string {
|
|
49
|
+
try {
|
|
50
|
+
const url = new URL(urlStr);
|
|
51
|
+
return url.host;
|
|
52
|
+
} catch {
|
|
53
|
+
return "api.anthropic.com";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function buildUpstreamUrl(upstreamBase: string, apiPath: string): string {
|
|
58
|
+
return upstreamBase + apiPath;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function selectUpstreamBase(
|
|
62
|
+
isChatCompletions: boolean,
|
|
63
|
+
matchedProviderConfig: ReturnType<typeof findProviderByModel>,
|
|
64
|
+
): string {
|
|
65
|
+
let upstreamBase: string;
|
|
66
|
+
|
|
67
|
+
if (matchedProviderConfig) {
|
|
68
|
+
if (
|
|
69
|
+
isChatCompletions &&
|
|
70
|
+
matchedProviderConfig.openaiBaseUrl !== undefined &&
|
|
71
|
+
matchedProviderConfig.openaiBaseUrl !== ""
|
|
72
|
+
) {
|
|
73
|
+
upstreamBase = matchedProviderConfig.openaiBaseUrl;
|
|
74
|
+
} else if (
|
|
75
|
+
!isChatCompletions &&
|
|
76
|
+
matchedProviderConfig.anthropicBaseUrl !== undefined &&
|
|
77
|
+
matchedProviderConfig.anthropicBaseUrl !== ""
|
|
78
|
+
) {
|
|
79
|
+
upstreamBase = matchedProviderConfig.anthropicBaseUrl;
|
|
80
|
+
} else if (
|
|
81
|
+
matchedProviderConfig.baseUrl !== undefined &&
|
|
82
|
+
matchedProviderConfig.baseUrl !== ""
|
|
83
|
+
) {
|
|
84
|
+
upstreamBase = matchedProviderConfig.baseUrl;
|
|
85
|
+
} else {
|
|
86
|
+
upstreamBase =
|
|
87
|
+
matchedProviderConfig.format === "openai" ? DEFAULT_OPENAI_UPSTREAM : DEFAULT_UPSTREAM;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
upstreamBase = isChatCompletions ? DEFAULT_OPENAI_UPSTREAM : DEFAULT_UPSTREAM;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return upstreamBase;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function injectAuthHeaders(
|
|
97
|
+
upstreamHeaders: Headers,
|
|
98
|
+
matchedProviderConfig: ReturnType<typeof findProviderByModel>,
|
|
99
|
+
): void {
|
|
100
|
+
if (!matchedProviderConfig) return;
|
|
101
|
+
|
|
102
|
+
const apiKey = matchedProviderConfig.apiKey.replace(/^Bearer\s+/i, "").trim();
|
|
103
|
+
if (matchedProviderConfig.authHeader === AUTH_HEADER_X_API_KEY) {
|
|
104
|
+
upstreamHeaders.set(HEADER_X_API_KEY, apiKey);
|
|
105
|
+
upstreamHeaders.delete(HEADER_AUTHORIZATION);
|
|
106
|
+
} else {
|
|
107
|
+
upstreamHeaders.set(HEADER_AUTHORIZATION, `Bearer ${apiKey}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const Route = createFileRoute("/api/logs/$id/replay")({
|
|
112
|
+
server: {
|
|
113
|
+
handlers: {
|
|
114
|
+
POST: async ({ params, request }: { params: { id: string }; request: Request }) => {
|
|
115
|
+
const id = Number(params.id);
|
|
116
|
+
if (isNaN(id)) {
|
|
117
|
+
return Response.json({ error: "Invalid log ID" }, { status: 400 });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
let replayRequest: ReplayRequest;
|
|
121
|
+
try {
|
|
122
|
+
const raw: unknown = await request.json();
|
|
123
|
+
const parsed = ReplayRequestSchema.safeParse(raw);
|
|
124
|
+
if (!parsed.success) {
|
|
125
|
+
return Response.json({ error: "Invalid request body" }, { status: 400 });
|
|
126
|
+
}
|
|
127
|
+
replayRequest = parsed.data;
|
|
128
|
+
} catch {
|
|
129
|
+
return Response.json({ error: "Invalid JSON body" }, { status: 400 });
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const { modifiedBody } = replayRequest;
|
|
133
|
+
|
|
134
|
+
// Get original log for context
|
|
135
|
+
const log = await getLogById(id);
|
|
136
|
+
if (log === null) {
|
|
137
|
+
return Response.json({ error: "Log not found" }, { status: 404 });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Extract model from modified body
|
|
141
|
+
const model = extractModelFromBody(modifiedBody);
|
|
142
|
+
if (model === null) {
|
|
143
|
+
return Response.json(
|
|
144
|
+
{ error: "Could not extract model from request body" },
|
|
145
|
+
{ status: 400 },
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Find provider
|
|
150
|
+
const matchedProviderConfig = findProviderByModel(model);
|
|
151
|
+
const provider = registry.findProvider(model);
|
|
152
|
+
if (provider === null) {
|
|
153
|
+
return Response.json(
|
|
154
|
+
{ error: "No provider found for model" },
|
|
155
|
+
{ status: STATUS_FORBIDDEN },
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Determine API path from original log
|
|
160
|
+
const apiPath = log.path;
|
|
161
|
+
const isChatCompletions =
|
|
162
|
+
apiPath === PATH_V1_CHAT_COMPLETIONS || apiPath === PATH_CHAT_COMPLETIONS;
|
|
163
|
+
const normalizedPath =
|
|
164
|
+
isChatCompletions && !apiPath.startsWith("/v1/") ? "/v1" + apiPath : apiPath;
|
|
165
|
+
|
|
166
|
+
// Get format handler
|
|
167
|
+
const formatHandler = formatForPath(apiPath);
|
|
168
|
+
if (formatHandler === null) {
|
|
169
|
+
return Response.json({ error: "Unsupported path" }, { status: STATUS_FORBIDDEN });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Build upstream URL
|
|
173
|
+
const upstreamBase = selectUpstreamBase(isChatCompletions, matchedProviderConfig);
|
|
174
|
+
const upstreamUrl = buildUpstreamUrl(upstreamBase, normalizedPath);
|
|
175
|
+
const upstreamHost = getHostFromUrl(upstreamBase);
|
|
176
|
+
|
|
177
|
+
// Build headers
|
|
178
|
+
const headers = new Headers();
|
|
179
|
+
headers.set(HEADER_USER_AGENT, PROXY_IDENTITY);
|
|
180
|
+
headers.set(HEADER_X_PROXY_IDENTITY, PROXY_IDENTITY);
|
|
181
|
+
headers.set(HEADER_CONTENT_TYPE, "application/json");
|
|
182
|
+
|
|
183
|
+
for (const name of PRESERVE_HEADERS) {
|
|
184
|
+
const value = log.rawHeaders?.[name.toLowerCase()];
|
|
185
|
+
if (value !== undefined) {
|
|
186
|
+
headers.set(name, value);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
headers.set(HEADER_HOST, upstreamHost);
|
|
190
|
+
injectAuthHeaders(headers, matchedProviderConfig);
|
|
191
|
+
|
|
192
|
+
const startTime = Date.now();
|
|
193
|
+
|
|
194
|
+
// Send request
|
|
195
|
+
let upstreamRes: Response;
|
|
196
|
+
try {
|
|
197
|
+
upstreamRes = await fetch(upstreamUrl, {
|
|
198
|
+
method: "POST",
|
|
199
|
+
headers,
|
|
200
|
+
body: modifiedBody,
|
|
201
|
+
});
|
|
202
|
+
} catch (err) {
|
|
203
|
+
return Response.json({
|
|
204
|
+
success: false,
|
|
205
|
+
error: String(err),
|
|
206
|
+
} satisfies ReplayResponse);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const elapsedMs = Date.now() - startTime;
|
|
210
|
+
const isStream =
|
|
211
|
+
upstreamRes.headers.get(HEADER_CONTENT_TYPE)?.includes("text/event-stream") ?? false;
|
|
212
|
+
|
|
213
|
+
if (isStream) {
|
|
214
|
+
// Accumulate streaming response
|
|
215
|
+
const chunks: string[] = [];
|
|
216
|
+
const decoder = new TextDecoder();
|
|
217
|
+
const reader = upstreamRes.body?.getReader();
|
|
218
|
+
if (reader) {
|
|
219
|
+
try {
|
|
220
|
+
while (true) {
|
|
221
|
+
const { done, value } = await reader.read();
|
|
222
|
+
if (done) break;
|
|
223
|
+
chunks.push(decoder.decode(value, { stream: true }));
|
|
224
|
+
}
|
|
225
|
+
} catch {
|
|
226
|
+
// Stream read error
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const fullResponse = chunks.join("");
|
|
230
|
+
|
|
231
|
+
// Create a mock log for streaming extraction
|
|
232
|
+
const mockLog: typeof log = { ...log };
|
|
233
|
+
const responseText = formatHandler.extractStream(fullResponse, mockLog, model, false);
|
|
234
|
+
const tokens = formatHandler.extractTokens(responseText);
|
|
235
|
+
|
|
236
|
+
return Response.json({
|
|
237
|
+
success: true,
|
|
238
|
+
responseStatus: upstreamRes.status,
|
|
239
|
+
responseText,
|
|
240
|
+
inputTokens: tokens.inputTokens ?? undefined,
|
|
241
|
+
outputTokens: tokens.outputTokens ?? undefined,
|
|
242
|
+
elapsedMs,
|
|
243
|
+
streaming: true,
|
|
244
|
+
} satisfies ReplayResponse);
|
|
245
|
+
} else {
|
|
246
|
+
const responseText = await upstreamRes.text();
|
|
247
|
+
const tokens = formatHandler.extractTokens(responseText);
|
|
248
|
+
|
|
249
|
+
return Response.json({
|
|
250
|
+
success: true,
|
|
251
|
+
responseStatus: upstreamRes.status,
|
|
252
|
+
responseText,
|
|
253
|
+
inputTokens: tokens.inputTokens ?? undefined,
|
|
254
|
+
outputTokens: tokens.outputTokens ?? undefined,
|
|
255
|
+
elapsedMs,
|
|
256
|
+
streaming: false,
|
|
257
|
+
} satisfies ReplayResponse);
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { getLogById } from "../../proxy/store";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/api/logs/$id")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: async ({ params }: { params: { id: string } }) => {
|
|
8
|
+
const id = Number(params.id);
|
|
9
|
+
if (isNaN(id)) {
|
|
10
|
+
return Response.json({ error: "Invalid ID" }, { status: 400 });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const log = await getLogById(id);
|
|
14
|
+
if (log === null) {
|
|
15
|
+
return Response.json({ error: "Log not found" }, { status: 404 });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return Response.json(log);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { onLogUpdate, getFilteredLogs } from "../../proxy/store";
|
|
3
|
+
import { type CapturedLog } from "../../proxy/schemas";
|
|
4
|
+
|
|
5
|
+
export const Route = createFileRoute("/api/logs/stream")({
|
|
6
|
+
server: {
|
|
7
|
+
handlers: {
|
|
8
|
+
GET: ({ request }: { request: Request }) => {
|
|
9
|
+
const url = new URL(request.url);
|
|
10
|
+
const sessionId = url.searchParams.get("sessionId") ?? undefined;
|
|
11
|
+
const model = url.searchParams.get("model") ?? undefined;
|
|
12
|
+
|
|
13
|
+
let controllerRef: ReadableStreamDefaultController<Uint8Array> | null = null;
|
|
14
|
+
|
|
15
|
+
// Send heartbeat comment every 30s to keep connection alive
|
|
16
|
+
const heartbeat = setInterval(() => {
|
|
17
|
+
if (controllerRef) {
|
|
18
|
+
try {
|
|
19
|
+
controllerRef.enqueue(new TextEncoder().encode(": heartbeat\n\n"));
|
|
20
|
+
} catch {
|
|
21
|
+
// Stream closed
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, 30000);
|
|
25
|
+
|
|
26
|
+
const unsubscribe = onLogUpdate((log: CapturedLog) => {
|
|
27
|
+
if (!controllerRef) return;
|
|
28
|
+
// Filter by session/model if specified
|
|
29
|
+
if (sessionId !== undefined && log.sessionId !== sessionId) return;
|
|
30
|
+
if (model !== undefined && log.model !== model) return;
|
|
31
|
+
try {
|
|
32
|
+
const data = `data: ${JSON.stringify({ type: "update", log })}\n\n`;
|
|
33
|
+
controllerRef.enqueue(new TextEncoder().encode(data));
|
|
34
|
+
} catch {
|
|
35
|
+
// Stream closed
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const stream = new ReadableStream<Uint8Array>({
|
|
40
|
+
start(controller) {
|
|
41
|
+
controllerRef = controller;
|
|
42
|
+
// Send initial batch of logs immediately
|
|
43
|
+
const logs = getFilteredLogs(sessionId, model);
|
|
44
|
+
const initData = `data: ${JSON.stringify({ type: "init", logs })}\n\n`;
|
|
45
|
+
controller.enqueue(new TextEncoder().encode(initData));
|
|
46
|
+
},
|
|
47
|
+
cancel() {
|
|
48
|
+
clearInterval(heartbeat);
|
|
49
|
+
unsubscribe();
|
|
50
|
+
controllerRef = null;
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return new Response(stream, {
|
|
55
|
+
headers: {
|
|
56
|
+
"Content-Type": "text/event-stream",
|
|
57
|
+
"Cache-Control": "no-cache",
|
|
58
|
+
Connection: "keep-alive",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { clearAllLogs, getFilteredLogs } from "../../proxy/store";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/api/logs")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: ({ request }: { request: Request }) => {
|
|
8
|
+
const url = new URL(request.url);
|
|
9
|
+
const sessionId = url.searchParams.get("sessionId") ?? undefined;
|
|
10
|
+
const model = url.searchParams.get("model") ?? undefined;
|
|
11
|
+
const offset = Number(url.searchParams.get("offset") ?? 0);
|
|
12
|
+
const limit = Number(url.searchParams.get("limit") ?? 50);
|
|
13
|
+
|
|
14
|
+
const allLogs = getFilteredLogs(sessionId, model);
|
|
15
|
+
const paginatedLogs = allLogs.slice(offset, offset + limit);
|
|
16
|
+
|
|
17
|
+
return Response.json({
|
|
18
|
+
logs: paginatedLogs,
|
|
19
|
+
total: allLogs.length,
|
|
20
|
+
offset,
|
|
21
|
+
limit,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
DELETE: () => {
|
|
25
|
+
const result = clearAllLogs();
|
|
26
|
+
return Response.json({ success: true, cleared: result.cleared });
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getProviders, updateProvider, deleteProvider } from "../../proxy/providers";
|
|
4
|
+
|
|
5
|
+
const ProviderUpdateSchema = z.object({
|
|
6
|
+
name: z.string().min(1, "Name is required").optional(),
|
|
7
|
+
apiKey: z.string().min(1, "API key is required").optional(),
|
|
8
|
+
format: z.enum(["anthropic", "openai"]).optional(),
|
|
9
|
+
baseUrl: z.string().min(1, "Base URL is required").optional(),
|
|
10
|
+
model: z.string().min(1, "Model is required").optional(),
|
|
11
|
+
authHeader: z.enum(["bearer", "x-api-key"]).optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const Route = createFileRoute("/api/providers/$providerId")({
|
|
15
|
+
server: {
|
|
16
|
+
handlers: {
|
|
17
|
+
GET: ({ params }: { params: { providerId: string } }) => {
|
|
18
|
+
const providers = getProviders();
|
|
19
|
+
const provider = providers.find((p) => p.id === params.providerId);
|
|
20
|
+
if (!provider) {
|
|
21
|
+
return Response.json({ error: "Provider not found" }, { status: 404 });
|
|
22
|
+
}
|
|
23
|
+
return Response.json(provider);
|
|
24
|
+
},
|
|
25
|
+
PUT: async ({ params, request }: { params: { providerId: string }; request: Request }) => {
|
|
26
|
+
const parsed = ProviderUpdateSchema.safeParse(await request.json());
|
|
27
|
+
if (!parsed.success) {
|
|
28
|
+
return Response.json({ error: parsed.error.message }, { status: 400 });
|
|
29
|
+
}
|
|
30
|
+
const updated = updateProvider(params.providerId, parsed.data);
|
|
31
|
+
if (!updated) {
|
|
32
|
+
return Response.json({ error: "Provider not found" }, { status: 404 });
|
|
33
|
+
}
|
|
34
|
+
return Response.json(updated);
|
|
35
|
+
},
|
|
36
|
+
DELETE: ({ params }: { params: { providerId: string } }) => {
|
|
37
|
+
const deleted = deleteProvider(params.providerId);
|
|
38
|
+
if (!deleted) {
|
|
39
|
+
return Response.json({ error: "Provider not found" }, { status: 404 });
|
|
40
|
+
}
|
|
41
|
+
return Response.json({ success: true });
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getProviders, addProvider } from "../../proxy/providers";
|
|
4
|
+
|
|
5
|
+
const ProviderInputSchema = z.object({
|
|
6
|
+
name: z.string().min(1, "Name is required"),
|
|
7
|
+
apiKey: z.string().min(1, "API key is required"),
|
|
8
|
+
format: z.enum(["anthropic", "openai"]),
|
|
9
|
+
baseUrl: z.string().min(1, "Base URL is required"),
|
|
10
|
+
model: z.string().min(1, "Model is required"),
|
|
11
|
+
authHeader: z.enum(["bearer", "x-api-key"]).optional().default("bearer"),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const Route = createFileRoute("/api/providers")({
|
|
15
|
+
server: {
|
|
16
|
+
handlers: {
|
|
17
|
+
GET: () => {
|
|
18
|
+
return Response.json(getProviders());
|
|
19
|
+
},
|
|
20
|
+
POST: async ({ request }: { request: Request }) => {
|
|
21
|
+
const parsed = ProviderInputSchema.safeParse(await request.json());
|
|
22
|
+
if (!parsed.success) {
|
|
23
|
+
return Response.json({ error: parsed.error.message }, { status: 400 });
|
|
24
|
+
}
|
|
25
|
+
const newProvider = addProvider(
|
|
26
|
+
parsed.data.name,
|
|
27
|
+
parsed.data.apiKey,
|
|
28
|
+
parsed.data.format,
|
|
29
|
+
parsed.data.baseUrl,
|
|
30
|
+
parsed.data.model,
|
|
31
|
+
parsed.data.authHeader,
|
|
32
|
+
);
|
|
33
|
+
return Response.json(newProvider, { status: 201 });
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { handleProxy } from "../../proxy/handler";
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute("/proxy/$")({
|
|
5
|
+
server: {
|
|
6
|
+
handlers: {
|
|
7
|
+
GET: ({ request }: { request: Request }) => handleProxy(request),
|
|
8
|
+
POST: ({ request }: { request: Request }) => handleProxy(request),
|
|
9
|
+
PUT: ({ request }: { request: Request }) => handleProxy(request),
|
|
10
|
+
DELETE: ({ request }: { request: Request }) => handleProxy(request),
|
|
11
|
+
PATCH: ({ request }: { request: Request }) => handleProxy(request),
|
|
12
|
+
OPTIONS: ({ request }: { request: Request }) => handleProxy(request),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
@plugin "@tailwindcss/typography";
|
|
4
|
+
|
|
5
|
+
@custom-variant dark (&:is(.dark *));
|
|
6
|
+
|
|
7
|
+
@theme inline {
|
|
8
|
+
--color-background: var(--background);
|
|
9
|
+
--color-foreground: var(--foreground);
|
|
10
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
11
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
12
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
13
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
14
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
15
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
16
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
17
|
+
--color-sidebar: var(--sidebar);
|
|
18
|
+
--color-chart-5: var(--chart-5);
|
|
19
|
+
--color-chart-4: var(--chart-4);
|
|
20
|
+
--color-chart-3: var(--chart-3);
|
|
21
|
+
--color-chart-2: var(--chart-2);
|
|
22
|
+
--color-chart-1: var(--chart-1);
|
|
23
|
+
--color-ring: var(--ring);
|
|
24
|
+
--color-input: var(--input);
|
|
25
|
+
--color-border: var(--border);
|
|
26
|
+
--color-destructive: var(--destructive);
|
|
27
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
28
|
+
--color-accent: var(--accent);
|
|
29
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
30
|
+
--color-muted: var(--muted);
|
|
31
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
32
|
+
--color-secondary: var(--secondary);
|
|
33
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
34
|
+
--color-primary: var(--primary);
|
|
35
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
36
|
+
--color-popover: var(--popover);
|
|
37
|
+
--color-card-foreground: var(--card-foreground);
|
|
38
|
+
--color-card: var(--card);
|
|
39
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
40
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
41
|
+
--radius-lg: var(--radius);
|
|
42
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:root {
|
|
46
|
+
--radius: 0.625rem;
|
|
47
|
+
--background: oklch(1 0 0);
|
|
48
|
+
--foreground: oklch(0.145 0 0);
|
|
49
|
+
--card: oklch(1 0 0);
|
|
50
|
+
--card-foreground: oklch(0.145 0 0);
|
|
51
|
+
--popover: oklch(1 0 0);
|
|
52
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
53
|
+
--primary: oklch(0.205 0 0);
|
|
54
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
55
|
+
--secondary: oklch(0.97 0 0);
|
|
56
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
57
|
+
--muted: oklch(0.97 0 0);
|
|
58
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
59
|
+
--accent: oklch(0.97 0 0);
|
|
60
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
61
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
62
|
+
--border: oklch(0.922 0 0);
|
|
63
|
+
--input: oklch(0.922 0 0);
|
|
64
|
+
--ring: oklch(0.708 0 0);
|
|
65
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
66
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
67
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
68
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
69
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
70
|
+
--sidebar: oklch(0.985 0 0);
|
|
71
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
72
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
73
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
74
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
75
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
76
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
77
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dark {
|
|
81
|
+
--background: oklch(0.145 0 0);
|
|
82
|
+
--foreground: oklch(0.985 0 0);
|
|
83
|
+
--card: oklch(0.205 0 0);
|
|
84
|
+
--card-foreground: oklch(0.985 0 0);
|
|
85
|
+
--popover: oklch(0.205 0 0);
|
|
86
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
87
|
+
--primary: oklch(0.922 0 0);
|
|
88
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
89
|
+
--secondary: oklch(0.269 0 0);
|
|
90
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
91
|
+
--muted: oklch(0.269 0 0);
|
|
92
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
93
|
+
--accent: oklch(0.269 0 0);
|
|
94
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
95
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
96
|
+
--border: oklch(1 0 0 / 10%);
|
|
97
|
+
--input: oklch(1 0 0 / 15%);
|
|
98
|
+
--ring: oklch(0.556 0 0);
|
|
99
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
100
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
101
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
102
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
103
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
104
|
+
--sidebar: oklch(0.205 0 0);
|
|
105
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
106
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
107
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
108
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
109
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
110
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
111
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@layer base {
|
|
115
|
+
* {
|
|
116
|
+
@apply border-border outline-ring/50;
|
|
117
|
+
}
|
|
118
|
+
body {
|
|
119
|
+
@apply bg-background text-foreground;
|
|
120
|
+
}
|
|
121
|
+
}
|