chore: move tabby-ui under ee license. (#667)
* chore: introduce tabby-ui EE license. * updaterelease-notes-05
parent
8c680a73fb
commit
2ee5dbfd4f
|
|
@ -0,0 +1,39 @@
|
|||
name: Test tabby-ui
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- '.github/workflows/tabby-ui-test.yml'
|
||||
- 'ee/tabby-ui/**'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- '.github/workflows/tabby-ui-test.yml'
|
||||
- 'ee/tabby-ui/**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
cache: yarn
|
||||
cache-dependency-path: 'yarn.lock'
|
||||
- name: Install dependencies
|
||||
working-directory: ./ee/tabby-ui
|
||||
run: yarn install
|
||||
- name: Format
|
||||
working-directory: ./ee/tabby-ui
|
||||
run: yarn format:check
|
||||
- name: Lint
|
||||
working-directory: ./ee/tabby-ui
|
||||
run: yarn lint
|
||||
- name: Test build
|
||||
working-directory: ./ee/tabby-ui
|
||||
run: yarn build
|
||||
|
||||
8
Makefile
8
Makefile
|
|
@ -8,9 +8,13 @@ endif
|
|||
fix:
|
||||
cargo clippy --fix --allow-dirty --allow-staged && cargo +nightly fmt
|
||||
|
||||
fix-ui:
|
||||
cd ee/tabby-ui && yarn format:write && yarn lint:fix
|
||||
|
||||
update-ui:
|
||||
cd clients/tabby-ui && yarn build
|
||||
rm -rf crates/tabby/ui && cp -R clients/tabby-ui/out crates/tabby/ui
|
||||
cd ee/tabby-ui && yarn build
|
||||
rm -rf crates/tabby/ui && cp -R ee/tabby-ui/out crates/tabby/ui
|
||||
cp ee/LICENSE crates/tabby/ui/
|
||||
|
||||
bump-version:
|
||||
cargo ws version --no-git-tag --force "*"
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
NEXT_PUBLIC_TABBY_SERVER_URL=http://127.0.0.1:8080
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Copyright 2023 Vercel, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
@ -1 +0,0 @@
|
|||
# Tabby Playground
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
"use client"
|
||||
|
||||
import { buttonVariants } from "@/components/ui/button"
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
|
||||
import { IconSlack } from "@/components/ui/icons"
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { useHealth } from "@/lib/hooks/use-health";
|
||||
import { PropsWithChildren, useEffect, useState } from "react";
|
||||
|
||||
const COMMUNITY_DIALOG_SHOWN_KEY = "community-dialog-shown";
|
||||
|
||||
export default function IndexPage() {
|
||||
const [open, setOpen] = useState(false);
|
||||
useEffect(() => {
|
||||
if (!localStorage.getItem(COMMUNITY_DIALOG_SHOWN_KEY)) {
|
||||
setOpen(true);
|
||||
localStorage.setItem(COMMUNITY_DIALOG_SHOWN_KEY, "true");
|
||||
}
|
||||
}, []);
|
||||
|
||||
return <div className="grow flex justify-center items-center" >
|
||||
<MainPanel />
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogContent>
|
||||
<DialogHeader className="gap-3">
|
||||
<DialogTitle>Join the Tabby community</DialogTitle>
|
||||
<DialogDescription>
|
||||
Connect with other contributors building Tabby. Share knowledge, get help, and contribute to the open-source project.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter className="sm:justify-start">
|
||||
<a target="_blank" href="https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA" className={buttonVariants()}><IconSlack className="-ml-2 h-8 w-8" />Join us on Slack</a>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
}
|
||||
|
||||
interface LinkProps {
|
||||
href: string
|
||||
}
|
||||
|
||||
function Link({ href, children }: PropsWithChildren<LinkProps>) {
|
||||
return <a target="_blank" href={href} className="underline">{children}</a>
|
||||
}
|
||||
|
||||
function toBadgeString(str: string) {
|
||||
return encodeURIComponent(str.replaceAll("-", "--"));
|
||||
}
|
||||
|
||||
function MainPanel() {
|
||||
const { data: healthInfo } = useHealth();
|
||||
|
||||
if (!healthInfo) return
|
||||
|
||||
return <div className="w-2/3 lg:w-1/3 flex flex-col gap-3">
|
||||
<h1><span className="font-bold">Congratulations</span>, your tabby instance is running!</h1>
|
||||
<span className="flex flex-wrap gap-1">
|
||||
<a target="_blank" href={`https://github.com/TabbyML/tabby/releases/tag/${healthInfo.version.git_describe}`}>
|
||||
<img src={`https://img.shields.io/badge/version-${toBadgeString(healthInfo.version.git_describe)}-green`} />
|
||||
</a>
|
||||
<img src={`https://img.shields.io/badge/device-${healthInfo.device}-blue`} />
|
||||
<img src={`https://img.shields.io/badge/model-${toBadgeString(healthInfo.model)}-red`} />
|
||||
{healthInfo.chat_model && <img src={`https://img.shields.io/badge/chat%20model-${toBadgeString(healthInfo.chat_model)}-orange`} />}
|
||||
</span>
|
||||
|
||||
<Separator />
|
||||
|
||||
<span>
|
||||
You can find our documentation <Link href="https://tabby.tabbyml.com/docs/getting-started">here</Link>.
|
||||
<ul className="mt-2">
|
||||
<li>💻 <Link href="https://tabby.tabbyml.com/docs/extensions/">IDE/Editor Extensions</Link></li>
|
||||
<li>⚙️ <Link href="https://tabby.tabbyml.com/docs/configuration">Configuration</Link></li>
|
||||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
|
||||
"use client"
|
||||
|
||||
import useSWRImmutable from 'swr/immutable';
|
||||
import { SWRResponse } from 'swr'
|
||||
|
||||
export interface ReleaseInfo {
|
||||
name: string
|
||||
}
|
||||
|
||||
export function useLatestRelease(): SWRResponse<ReleaseInfo> {
|
||||
const fetcher = (url: string) => fetch(url).then(x => x.json());
|
||||
return useSWRImmutable('https://api.github.com/repos/TabbyML/tabby/releases/latest', fetcher)
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
export default function fetcher(url: string): Promise<any> {
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
return fetch(url).then(x => x.json());
|
||||
} else {
|
||||
return fetch(`${process.env.NEXT_PUBLIC_TABBY_SERVER_URL}${url}`).then(x => x.json());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
import {
|
||||
type AIStreamCallbacksAndOptions,
|
||||
createCallbacksTransformer,
|
||||
createStreamDataTransformer
|
||||
} from 'ai';
|
||||
|
||||
const utf8Decoder = new TextDecoder('utf-8');
|
||||
|
||||
async function processLines(
|
||||
lines: string[],
|
||||
controller: ReadableStreamDefaultController<string>,
|
||||
) {
|
||||
for (const line of lines) {
|
||||
const { content } = JSON.parse(line);
|
||||
controller.enqueue(content);
|
||||
}
|
||||
}
|
||||
|
||||
async function readAndProcessLines(
|
||||
reader: ReadableStreamDefaultReader<Uint8Array>,
|
||||
controller: ReadableStreamDefaultController<string>,
|
||||
) {
|
||||
let segment = '';
|
||||
|
||||
while (true) {
|
||||
const { value: chunk, done } = await reader.read();
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
|
||||
segment += utf8Decoder.decode(chunk, { stream: true });
|
||||
|
||||
const linesArray = segment.split(/\r\n|\n|\r/g);
|
||||
segment = linesArray.pop() || '';
|
||||
|
||||
await processLines(linesArray, controller);
|
||||
}
|
||||
|
||||
if (segment) {
|
||||
const linesArray = [segment];
|
||||
await processLines(linesArray, controller);
|
||||
}
|
||||
|
||||
controller.close();
|
||||
}
|
||||
|
||||
function createParser(res: Response) {
|
||||
const reader = res.body?.getReader();
|
||||
|
||||
return new ReadableStream<string>({
|
||||
async start(controller): Promise<void> {
|
||||
if (!reader) {
|
||||
controller.close();
|
||||
return;
|
||||
}
|
||||
|
||||
await readAndProcessLines(reader, controller);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function TabbyStream(
|
||||
reader: Response,
|
||||
callbacks?: AIStreamCallbacksAndOptions,
|
||||
): ReadableStream {
|
||||
return createParser(reader)
|
||||
.pipeThrough(createCallbacksTransformer(callbacks))
|
||||
.pipeThrough(
|
||||
createStreamDataTransformer(callbacks?.experimental_streamData),
|
||||
);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,36 @@
|
|||
The Tabby Enterprise license (the “Enterprise License”)
|
||||
Copyright (c) 2023 TabbyML, Inc.
|
||||
|
||||
With regard to the Tabby Software:
|
||||
|
||||
This software and associated documentation files (the "Software") may only be
|
||||
used in production, if you (and any entity that you represent) have agreed to,
|
||||
and are in compliance with, the Tabby Subscription Terms of Service, available
|
||||
at https://tabby.tabbyml.com/terms (the “Enterprise Terms”), or other
|
||||
agreement governing the use of the Software, as agreed by you and TabbyML,
|
||||
and otherwise have a valid Tabby Enterprise license for the
|
||||
correct number of user seats. Subject to the foregoing sentence, you are free to
|
||||
modify this Software and publish patches to the Software. You agree that TabbyML
|
||||
and/or its licensors (as applicable) retain all right, title and interest in and
|
||||
to all such modifications and/or patches, and all such modifications and/or
|
||||
patches may only be used, copied, modified, displayed, distributed, or otherwise
|
||||
exploited with a valid Tabby Enterprise license for the correct
|
||||
number of user seats. Notwithstanding the foregoing, you may copy and modify
|
||||
the Software for development and testing purposes, without requiring a
|
||||
subscription. You agree that Tabby and/or its licensors (as applicable) retain
|
||||
all right, title and interest in and to all such modifications. You are not
|
||||
granted any other rights beyond what is expressly stated herein. Subject to the
|
||||
foregoing, it is forbidden to copy, merge, publish, distribute, sublicense,
|
||||
and/or sell the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
For all third party components incorporated into the Tabby Software, those
|
||||
components are licensed under the original license provided by the owner of the
|
||||
applicable component.
|
||||
|
|
@ -1 +1 @@
|
|||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{21050:function(e,n,r){Promise.resolve().then(r.t.bind(r,58877,23)),Promise.resolve().then(r.bind(r,79446)),Promise.resolve().then(r.bind(r,78495)),Promise.resolve().then(r.t.bind(r,6928,23)),Promise.resolve().then(r.t.bind(r,33195,23)),Promise.resolve().then(r.bind(r,5925))},79446:function(e,n,r){"use strict";r.r(n),r.d(n,{Header:function(){return b}});var t=r(57437);r(2265);var s=r(39311),i=r(93023),a=r(84168),o=r(30415),l=r.n(o),d=r(61396),c=r.n(d),u=r(94190),f=r(45362),h=r(73737);let m=l()(()=>r.e(376).then(r.bind(r,15376)).then(e=>e.ThemeToggle),{loadableGenerated:{webpack:()=>[15376]},ssr:!1});function b(){var e;let{data:n}=(0,u.Q)(),r=!!(null==n?void 0:n.chat_model),o=null==n?void 0:null===(e=n.version)||void 0===e?void 0:e.git_describe,{data:l}=(0,f.Z)("https://api.github.com/repos/TabbyML/tabby/releases/latest",e=>fetch(e).then(e=>e.json())),d=function(e,n){try{return e&&n&&(0,h.q)(n.name,e,">")}catch(e){return console.warn(e),!0}}(o,l);return(0,t.jsxs)("header",{className:"sticky top-0 z-50 flex items-center justify-between w-full h-16 px-4 border-b shrink-0 bg-gradient-to-b from-background/10 via-background/50 to-background/80 backdrop-blur-xl",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(m,{}),(0,t.jsx)(c(),{href:"/",className:(0,s.cn)((0,i.d)({variant:"link"})),children:"Home"}),(0,t.jsx)(c(),{href:"/api",className:(0,s.cn)((0,i.d)({variant:"link"})),children:"API"}),r&&(0,t.jsx)(c(),{href:"/playground",className:(0,s.cn)((0,i.d)({variant:"link"})),children:"Playground"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-2",children:[d&&(0,t.jsxs)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby/releases/latest",rel:"noopener noreferrer",className:(0,i.d)({variant:"ghost"}),children:[(0,t.jsx)(a.Qs,{className:"text-yellow-600 dark:text-yellow-400"}),(0,t.jsxs)("span",{className:"hidden ml-2 md:flex",children:["New version (",null==l?void 0:l.name,") available"]})]}),(0,t.jsxs)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby",rel:"noopener noreferrer",className:(0,s.cn)((0,i.d)({variant:"outline"})),children:[(0,t.jsx)(a.Mr,{}),(0,t.jsx)("span",{className:"hidden ml-2 md:flex",children:"GitHub"})]})]})]})}},78495:function(e,n,r){"use strict";r.r(n),r.d(n,{Providers:function(){return a}});var t=r(57437);r(2265);var s=r(6435),i=r(95482);function a(e){let{children:n,...r}=e;return(0,t.jsx)(s.f,{...r,children:(0,t.jsx)(i.pn,{children:n})})}},95482:function(e,n,r){"use strict";r.d(n,{_v:function(){return c},aJ:function(){return d},pn:function(){return o},u:function(){return l}});var t=r(57437),s=r(2265),i=r(43212),a=r(39311);let o=i.zt,l=i.fC,d=i.xz,c=s.forwardRef((e,n)=>{let{className:r,sideOffset:s=4,...o}=e;return(0,t.jsx)(i.VY,{ref:n,sideOffset:s,className:(0,a.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r),...o})});c.displayName=i.VY.displayName},94190:function(e,n,r){"use strict";r.d(n,{Q:function(){return i}});var t=r(45362);function s(e){return fetch(e).then(e=>e.json())}function i(){return(0,t.Z)("/v1/health",s)}},58877:function(){}},function(e){e.O(0,[400,406,362,563,894,971,864,744],function(){return e(e.s=21050)}),_N_E=e.O()}]);
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{25330:function(e,n,r){Promise.resolve().then(r.t.bind(r,58877,23)),Promise.resolve().then(r.bind(r,79446)),Promise.resolve().then(r.bind(r,78495)),Promise.resolve().then(r.t.bind(r,6928,23)),Promise.resolve().then(r.t.bind(r,33195,23)),Promise.resolve().then(r.bind(r,5925))},79446:function(e,n,r){"use strict";r.r(n),r.d(n,{Header:function(){return b}});var t=r(57437);r(2265);var s=r(39311),i=r(93023),a=r(84168),o=r(30415),l=r.n(o),d=r(61396),c=r.n(d),u=r(94190),f=r(45362),h=r(73737);let m=l()(()=>r.e(376).then(r.bind(r,15376)).then(e=>e.ThemeToggle),{loadableGenerated:{webpack:()=>[15376]},ssr:!1});function b(){var e;let{data:n}=(0,u.Q)(),r=!!(null==n?void 0:n.chat_model),o=null==n?void 0:null===(e=n.version)||void 0===e?void 0:e.git_describe,{data:l}=(0,f.Z)("https://api.github.com/repos/TabbyML/tabby/releases/latest",e=>fetch(e).then(e=>e.json())),d=function(e,n){try{return e&&n&&(0,h.q)(n.name,e,">")}catch(e){return console.warn(e),!0}}(o,l);return(0,t.jsxs)("header",{className:"sticky top-0 z-50 flex h-16 w-full shrink-0 items-center justify-between border-b bg-gradient-to-b from-background/10 via-background/50 to-background/80 px-4 backdrop-blur-xl",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(m,{}),(0,t.jsx)(c(),{href:"/",className:(0,s.cn)((0,i.d)({variant:"link"})),children:"Home"}),(0,t.jsx)(c(),{href:"/api",className:(0,s.cn)((0,i.d)({variant:"link"})),children:"API"}),r&&(0,t.jsx)(c(),{href:"/playground",className:(0,s.cn)((0,i.d)({variant:"link"})),children:"Playground"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-2",children:[d&&(0,t.jsxs)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby/releases/latest",rel:"noopener noreferrer",className:(0,i.d)({variant:"ghost"}),children:[(0,t.jsx)(a.Qs,{className:"text-yellow-600 dark:text-yellow-400"}),(0,t.jsxs)("span",{className:"ml-2 hidden md:flex",children:["New version (",null==l?void 0:l.name,") available"]})]}),(0,t.jsxs)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby",rel:"noopener noreferrer",className:(0,s.cn)((0,i.d)({variant:"outline"})),children:[(0,t.jsx)(a.Mr,{}),(0,t.jsx)("span",{className:"ml-2 hidden md:flex",children:"GitHub"})]})]})]})}},78495:function(e,n,r){"use strict";r.r(n),r.d(n,{Providers:function(){return a}});var t=r(57437);r(2265);var s=r(6435),i=r(95482);function a(e){let{children:n,...r}=e;return(0,t.jsx)(s.f,{...r,children:(0,t.jsx)(i.pn,{children:n})})}},95482:function(e,n,r){"use strict";r.d(n,{_v:function(){return c},aJ:function(){return d},pn:function(){return o},u:function(){return l}});var t=r(57437),s=r(2265),i=r(43212),a=r(39311);let o=i.zt,l=i.fC,d=i.xz,c=s.forwardRef((e,n)=>{let{className:r,sideOffset:s=4,...o}=e;return(0,t.jsx)(i.VY,{ref:n,sideOffset:s,className:(0,a.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",r),...o})});c.displayName=i.VY.displayName},94190:function(e,n,r){"use strict";r.d(n,{Q:function(){return i}});var t=r(45362);function s(e){return fetch(e).then(e=>e.json())}function i(){return(0,t.Z)("/v1/health",s)}},58877:function(){}},function(e){e.O(0,[400,406,362,563,894,971,864,744],function(){return e(e.s=25330)}),_N_E=e.O()}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{50588:function(e,n,t){Promise.resolve().then(t.t.bind(t,76054,23)),Promise.resolve().then(t.t.bind(t,41729,23)),Promise.resolve().then(t.t.bind(t,81443,23)),Promise.resolve().then(t.t.bind(t,36384,23)),Promise.resolve().then(t.t.bind(t,18639,23)),Promise.resolve().then(t.t.bind(t,65146,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,864],function(){return n(23123),n(50588)}),_N_E=e.O()}]);
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{49989:function(e,n,t){Promise.resolve().then(t.t.bind(t,76054,23)),Promise.resolve().then(t.t.bind(t,41729,23)),Promise.resolve().then(t.t.bind(t,81443,23)),Promise.resolve().then(t.t.bind(t,36384,23)),Promise.resolve().then(t.t.bind(t,18639,23)),Promise.resolve().then(t.t.bind(t,65146,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,864],function(){return n(23123),n(49989)}),_N_E=e.O()}]);
|
||||
|
|
@ -0,0 +1 @@
|
|||
!function(){"use strict";var t,e,n,r,o,u,i,c,f,a={},l={};function s(t){var e=l[t];if(void 0!==e)return e.exports;var n=l[t]={exports:{}},r=!0;try{a[t](n,n.exports,s),r=!1}finally{r&&delete l[t]}return n.exports}s.m=a,t=[],s.O=function(e,n,r,o){if(n){o=o||0;for(var u=t.length;u>0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,r,o];return}for(var i=1/0,u=0;u<t.length;u++){for(var n=t[u][0],r=t[u][1],o=t[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(t){return s.O[t](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){t.splice(u--,1);var a=r()}}return a},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},n=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},s.t=function(t,r){if(1&r&&(t=this(t)),8&r||"object"==typeof t&&t&&(4&r&&t.__esModule||16&r&&"function"==typeof t.then))return t;var o=Object.create(null);s.r(o);var u={};e=e||[null,n({}),n([]),n(n)];for(var i=2&r&&t;"object"==typeof i&&!~e.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(e){u[e]=function(){return t[e]}});return u.default=function(){return t},s.d(o,u),o},s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce(function(e,n){return s.f[n](t,e),e},[]))},s.u=function(t){return"static/chunks/"+t+".2b6536d53b303d15.js"},s.miniCssF=function(t){return"static/css/2b051a9b83c80bf9.css"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r={},o="_N_E:",s.l=function(t,e,n,u){if(r[t]){r[t].push(e);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(t)),r[t]=[e];var d=function(e,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[t];if(delete r[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(t){return t(n)}),e)return e(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(t){return t}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(t){return s.tt().createScriptURL(t)},s.p="/_next/",i={272:0},s.f.j=function(t,e){var n=s.o(i,t)?i[t]:void 0;if(0!==n){if(n)e.push(n[2]);else if(272!=t){var r=new Promise(function(e,r){n=i[t]=[e,r]});e.push(n[2]=r);var o=s.p+s.u(t),u=Error();s.l(o,function(e){if(s.o(i,t)&&(0!==(n=i[t])&&(i[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+t,t)}else i[t]=0}},s.O.j=function(t){return 0===i[t]},c=function(t,e){var n,r,o=e[0],u=e[1],c=e[2],f=0;if(o.some(function(t){return 0!==i[t]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);if(c)var a=c(s)}for(t&&t(e);f<o.length;f++)r=o[f],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f)),s.nc=void 0}();
|
||||
|
|
@ -1 +0,0 @@
|
|||
!function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e](n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r()}}return a},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return"static/chunks/"+e+".2b6536d53b303d15.js"},s.miniCssF=function(e){return"static/css/bf9a3e46fd923c34.css"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",s.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(e)),r[e]=[t];var d=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={272:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(272!=e){var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}else i[e]=0}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)r=o[f],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f)),s.nc=void 0}();
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,12 +1,12 @@
|
|||
1:HL["/_next/static/media/86fdec36ddd9097e-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
||||
2:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
||||
3:HL["/_next/static/css/bf9a3e46fd923c34.css","style"]
|
||||
0:["eWjUGC2dk8kr9XwC7Wnnr",[[["",{"children":["api",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bf9a3e46fd923c34.css","precedence":"next"}]],"$L5"]]]]
|
||||
6:I{"id":5925,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Toaster","async":false}
|
||||
7:I{"id":78495,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Providers","async":false}
|
||||
8:I{"id":79446,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Header","async":false}
|
||||
9:I{"id":81443,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
a:I{"id":18639,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
3:HL["/_next/static/css/2b051a9b83c80bf9.css","style"]
|
||||
0:["QrHYrv6IM9fXxh7mpanWB",[[["",{"children":["api",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2b051a9b83c80bf9.css","precedence":"next"}]],"$L5"]]]]
|
||||
6:I{"id":5925,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Toaster","async":false}
|
||||
7:I{"id":78495,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Providers","async":false}
|
||||
8:I{"id":79446,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Header","async":false}
|
||||
9:I{"id":81443,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
a:I{"id":18639,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
5:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"Tabby - API"}],["$","meta","2",{"name":"description","content":"Tabby, an opensource, self-hosted AI coding assistant."}],["$","meta","3",{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"white"}],["$","meta","4",{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"black"}],["$","meta","5",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","6",{"name":"next-size-adjust"}]]
|
||||
4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex flex-col min-h-screen","children":[["$","$L8",null,{}],["$","main",null,{"className":"flex flex-col flex-1 bg-muted/50","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children","api","children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$Lb",["$","iframe",null,{"className":"flex-grow","src":"/swagger-ui"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"api"},"styles":[]}]}]]}],null]}]]}]]}],null]
|
||||
4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex min-h-screen flex-col","children":[["$","$L8",null,{}],["$","main",null,{"className":"flex flex-1 flex-col bg-muted/50","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children","api","children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$Lb",["$","iframe",null,{"className":"grow","src":"/swagger-ui"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"api"},"styles":[]}]}]]}],null]}]]}]]}],null]
|
||||
b:null
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,14 +1,14 @@
|
|||
1:HL["/_next/static/media/86fdec36ddd9097e-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
||||
2:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
||||
3:HL["/_next/static/css/bf9a3e46fd923c34.css","style"]
|
||||
0:["eWjUGC2dk8kr9XwC7Wnnr",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bf9a3e46fd923c34.css","precedence":"next"}]],"$L5"]]]]
|
||||
6:I{"id":5925,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Toaster","async":false}
|
||||
7:I{"id":78495,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Providers","async":false}
|
||||
8:I{"id":79446,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Header","async":false}
|
||||
9:I{"id":81443,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
a:I{"id":18639,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
c:I{"id":65146,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
d:I{"id":25454,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","362:static/chunks/362-ae0994d279f3f3bb.js","703:static/chunks/703-35aa8c1eaf8df6ef.js","894:static/chunks/894-f0d1adefd8c6331e.js","931:static/chunks/app/page-a9607532e6afa65f.js"],"name":"","async":false}
|
||||
4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex flex-col min-h-screen","children":[["$","$L8",null,{}],["$","main",null,{"className":"flex flex-col flex-1 bg-muted/50","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$Lb",["$","$Lc",null,{"propsForComponent":{"params":{}},"Component":"$d"}],null],"segment":"__PAGE__"},"styles":[]}]}]]}],null]}]]}]]}],null]
|
||||
3:HL["/_next/static/css/2b051a9b83c80bf9.css","style"]
|
||||
0:["QrHYrv6IM9fXxh7mpanWB",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2b051a9b83c80bf9.css","precedence":"next"}]],"$L5"]]]]
|
||||
6:I{"id":5925,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Toaster","async":false}
|
||||
7:I{"id":78495,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Providers","async":false}
|
||||
8:I{"id":79446,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Header","async":false}
|
||||
9:I{"id":81443,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
a:I{"id":18639,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
c:I{"id":65146,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
d:I{"id":25454,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","362:static/chunks/362-ae0994d279f3f3bb.js","703:static/chunks/703-35aa8c1eaf8df6ef.js","894:static/chunks/894-f0d1adefd8c6331e.js","931:static/chunks/app/page-478c8032840b58db.js"],"name":"","async":false}
|
||||
4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex min-h-screen flex-col","children":[["$","$L8",null,{}],["$","main",null,{"className":"flex flex-1 flex-col bg-muted/50","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$Lb",["$","$Lc",null,{"propsForComponent":{"params":{}},"Component":"$d"}],null],"segment":"__PAGE__"},"styles":[]}]}]]}],null]}]]}]]}],null]
|
||||
5:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"Tabby - Home"}],["$","meta","2",{"name":"description","content":"Tabby, an opensource, self-hosted AI coding assistant."}],["$","meta","3",{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"white"}],["$","meta","4",{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"black"}],["$","meta","5",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","6",{"name":"next-size-adjust"}]]
|
||||
b:null
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +1,13 @@
|
|||
1:HL["/_next/static/media/86fdec36ddd9097e-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
||||
2:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
|
||||
3:HL["/_next/static/css/bf9a3e46fd923c34.css","style"]
|
||||
0:["eWjUGC2dk8kr9XwC7Wnnr",[[["",{"children":["playground",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bf9a3e46fd923c34.css","precedence":"next"}]],"$L5"]]]]
|
||||
6:I{"id":5925,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Toaster","async":false}
|
||||
7:I{"id":78495,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Providers","async":false}
|
||||
8:I{"id":79446,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-b50e232b3c734beb.js"],"name":"Header","async":false}
|
||||
9:I{"id":81443,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
a:I{"id":18639,"chunks":["272:static/chunks/webpack-d594e4426ae7e7e3.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
c:I{"id":12202,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","28:static/chunks/28-27d0fe8a88c4cbfb.js","894:static/chunks/894-f0d1adefd8c6331e.js","383:static/chunks/app/playground/page-1dc9dc57ec66a864.js"],"name":"Chat","async":false}
|
||||
3:HL["/_next/static/css/2b051a9b83c80bf9.css","style"]
|
||||
0:["QrHYrv6IM9fXxh7mpanWB",[[["",{"children":["playground",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/2b051a9b83c80bf9.css","precedence":"next"}]],"$L5"]]]]
|
||||
6:I{"id":5925,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Toaster","async":false}
|
||||
7:I{"id":78495,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Providers","async":false}
|
||||
8:I{"id":79446,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","362:static/chunks/362-ae0994d279f3f3bb.js","563:static/chunks/563-52218f82bb9eb225.js","894:static/chunks/894-f0d1adefd8c6331e.js","185:static/chunks/app/layout-f087fba7a4279e51.js"],"name":"Header","async":false}
|
||||
9:I{"id":81443,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
a:I{"id":18639,"chunks":["272:static/chunks/webpack-04ed420267a761a9.js","971:static/chunks/fd9d1056-5dfc77aa37d8c76f.js","864:static/chunks/864-bf315a5307aba1d7.js"],"name":"","async":false}
|
||||
c:I{"id":12202,"chunks":["400:static/chunks/400-bab9e88e0219f9f5.js","406:static/chunks/406-35481e1b86c5b377.js","28:static/chunks/28-27d0fe8a88c4cbfb.js","894:static/chunks/894-f0d1adefd8c6331e.js","383:static/chunks/app/playground/page-b742820613e86585.js"],"name":"Chat","async":false}
|
||||
5:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"Tabby - Playground"}],["$","meta","2",{"name":"description","content":"Tabby, an opensource, self-hosted AI coding assistant."}],["$","meta","3",{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"white"}],["$","meta","4",{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"black"}],["$","meta","5",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","6",{"name":"next-size-adjust"}]]
|
||||
4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex flex-col min-h-screen","children":[["$","$L8",null,{}],["$","main",null,{"className":"flex flex-col flex-1 bg-muted/50","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children","playground","children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$Lb",["$","$Lc",null,{"id":"jx52i4O"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"playground"},"styles":[]}]}]]}],null]}]]}]]}],null]
|
||||
4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex min-h-screen flex-col","children":[["$","$L8",null,{}],["$","main",null,{"className":"flex flex-1 flex-col bg-muted/50","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children","playground","children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$Lb",["$","$Lc",null,{"id":"GG5oy2I"}],null],"segment":"__PAGE__"},"styles":[]}],"segment":"playground"},"styles":[]}]}]]}],null]}]]}]]}],null]
|
||||
b:null
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
The Tabby Enterprise license (the “Enterprise License”)
|
||||
Copyright (c) 2023 TabbyML, Inc.
|
||||
|
||||
With regard to the Tabby Software:
|
||||
|
||||
This software and associated documentation files (the "Software") may only be
|
||||
used in production, if you (and any entity that you represent) have agreed to,
|
||||
and are in compliance with, the Tabby Subscription Terms of Service, available
|
||||
at https://tabby.tabbyml.com/terms (the “Enterprise Terms”), or other
|
||||
agreement governing the use of the Software, as agreed by you and TabbyML,
|
||||
and otherwise have a valid Tabby Enterprise license for the
|
||||
correct number of user seats. Subject to the foregoing sentence, you are free to
|
||||
modify this Software and publish patches to the Software. You agree that TabbyML
|
||||
and/or its licensors (as applicable) retain all right, title and interest in and
|
||||
to all such modifications and/or patches, and all such modifications and/or
|
||||
patches may only be used, copied, modified, displayed, distributed, or otherwise
|
||||
exploited with a valid Tabby Enterprise license for the correct
|
||||
number of user seats. Notwithstanding the foregoing, you may copy and modify
|
||||
the Software for development and testing purposes, without requiring a
|
||||
subscription. You agree that Tabby and/or its licensors (as applicable) retain
|
||||
all right, title and interest in and to all such modifications. You are not
|
||||
granted any other rights beyond what is expressly stated herein. Subject to the
|
||||
foregoing, it is forbidden to copy, merge, publish, distribute, sublicense,
|
||||
and/or sell the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
For all third party components incorporated into the Tabby Software, those
|
||||
components are licensed under the original license provided by the owner of the
|
||||
applicable component.
|
||||
|
|
@ -0,0 +1 @@
|
|||
# Tabby UI
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import { Metadata } from 'next'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'API',
|
||||
title: 'API'
|
||||
}
|
||||
|
||||
const serverUrl = process.env.NEXT_PUBLIC_TABBY_SERVER_URL || '';
|
||||
const serverUrl = process.env.NEXT_PUBLIC_TABBY_SERVER_URL || ''
|
||||
|
||||
export default function IndexPage() {
|
||||
return <iframe className='flex-grow' src={`${serverUrl}/swagger-ui`} />
|
||||
return <iframe className="grow" src={`${serverUrl}/swagger-ui`} />
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|||
themeColor: [
|
||||
{ media: '(prefers-color-scheme: light)', color: 'white' },
|
||||
{ media: '(prefers-color-scheme: dark)', color: 'black' }
|
||||
],
|
||||
]
|
||||
}
|
||||
|
||||
interface RootLayoutProps {
|
||||
|
|
@ -38,10 +38,10 @@ export default function RootLayout({ children }: RootLayoutProps) {
|
|||
>
|
||||
<Toaster />
|
||||
<Providers attribute="class" defaultTheme="system" enableSystem>
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<div className="flex min-h-screen flex-col">
|
||||
{/* @ts-ignore */}
|
||||
<Header />
|
||||
<main className="flex flex-col flex-1 bg-muted/50">{children}</main>
|
||||
<main className="flex flex-1 flex-col bg-muted/50">{children}</main>
|
||||
</div>
|
||||
<TailwindIndicator />
|
||||
</Providers>
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
'use client'
|
||||
|
||||
import { buttonVariants } from '@/components/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger
|
||||
} from '@/components/ui/dialog'
|
||||
import { IconSlack } from '@/components/ui/icons'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { useHealth } from '@/lib/hooks/use-health'
|
||||
import { PropsWithChildren, useEffect, useState } from 'react'
|
||||
|
||||
const COMMUNITY_DIALOG_SHOWN_KEY = 'community-dialog-shown'
|
||||
|
||||
export default function IndexPage() {
|
||||
const [open, setOpen] = useState(false)
|
||||
useEffect(() => {
|
||||
if (!localStorage.getItem(COMMUNITY_DIALOG_SHOWN_KEY)) {
|
||||
setOpen(true)
|
||||
localStorage.setItem(COMMUNITY_DIALOG_SHOWN_KEY, 'true')
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="flex grow items-center justify-center">
|
||||
<MainPanel />
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogContent>
|
||||
<DialogHeader className="gap-3">
|
||||
<DialogTitle>Join the Tabby community</DialogTitle>
|
||||
<DialogDescription>
|
||||
Connect with other contributors building Tabby. Share knowledge,
|
||||
get help, and contribute to the open-source project.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter className="sm:justify-start">
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA"
|
||||
className={buttonVariants()}
|
||||
>
|
||||
<IconSlack className="-ml-2 h-8 w-8" />
|
||||
Join us on Slack
|
||||
</a>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
interface LinkProps {
|
||||
href: string
|
||||
}
|
||||
|
||||
function Link({ href, children }: PropsWithChildren<LinkProps>) {
|
||||
return (
|
||||
<a target="_blank" href={href} className="underline">
|
||||
{children}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
function toBadgeString(str: string) {
|
||||
return encodeURIComponent(str.replaceAll('-', '--'))
|
||||
}
|
||||
|
||||
function MainPanel() {
|
||||
const { data: healthInfo } = useHealth()
|
||||
|
||||
if (!healthInfo) return
|
||||
|
||||
return (
|
||||
<div className="flex w-2/3 flex-col gap-3 lg:w-1/3">
|
||||
<h1>
|
||||
<span className="font-bold">Congratulations</span>, your tabby instance
|
||||
is running!
|
||||
</h1>
|
||||
<span className="flex flex-wrap gap-1">
|
||||
<a
|
||||
target="_blank"
|
||||
href={`https://github.com/TabbyML/tabby/releases/tag/${healthInfo.version.git_describe}`}
|
||||
>
|
||||
<img
|
||||
src={`https://img.shields.io/badge/version-${toBadgeString(
|
||||
healthInfo.version.git_describe
|
||||
)}-green`}
|
||||
/>
|
||||
</a>
|
||||
<img
|
||||
src={`https://img.shields.io/badge/device-${healthInfo.device}-blue`}
|
||||
/>
|
||||
<img
|
||||
src={`https://img.shields.io/badge/model-${toBadgeString(
|
||||
healthInfo.model
|
||||
)}-red`}
|
||||
/>
|
||||
{healthInfo.chat_model && (
|
||||
<img
|
||||
src={`https://img.shields.io/badge/chat%20model-${toBadgeString(
|
||||
healthInfo.chat_model
|
||||
)}-orange`}
|
||||
/>
|
||||
)}
|
||||
</span>
|
||||
|
||||
<Separator />
|
||||
|
||||
<span>
|
||||
You can find our documentation{' '}
|
||||
<Link href="https://tabby.tabbyml.com/docs/getting-started">here</Link>.
|
||||
<ul className="mt-2">
|
||||
<li>
|
||||
💻{' '}
|
||||
<Link href="https://tabby.tabbyml.com/docs/extensions/">
|
||||
IDE/Editor Extensions
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
⚙️{' '}
|
||||
<Link href="https://tabby.tabbyml.com/docs/configuration">
|
||||
Configuration
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { nanoid } from '@/lib/utils'
|
||||
import { Chat } from '@/components/chat'
|
||||
import { Metadata } from 'next'
|
||||
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Playground',
|
||||
title: 'Playground'
|
||||
}
|
||||
|
||||
export default function IndexPage() {
|
||||
|
|
@ -32,7 +32,7 @@ export function ChatMessage({ message, ...props }: ChatMessageProps) {
|
|||
>
|
||||
{message.role === 'user' ? <IconUser /> : <IconTabby />}
|
||||
</div>
|
||||
<div className="flex-1 px-1 ml-4 space-y-2 overflow-hidden">
|
||||
<div className="ml-4 flex-1 space-y-2 overflow-hidden px-1">
|
||||
<MemoizedReactMarkdown
|
||||
className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0"
|
||||
remarkPlugins={[remarkGfm, remarkMath]}
|
||||
|
|
@ -44,7 +44,7 @@ export function ChatMessage({ message, ...props }: ChatMessageProps) {
|
|||
if (children.length) {
|
||||
if (children[0] == '▍') {
|
||||
return (
|
||||
<span className="mt-1 cursor-default animate-pulse">▍</span>
|
||||
<span className="mt-1 animate-pulse cursor-default">▍</span>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ import { IconArrowRight } from '@/components/ui/icons'
|
|||
const exampleMessages = [
|
||||
{
|
||||
heading: 'Convert list of string to numbers',
|
||||
message: `How to convert a list of string to numbers in python`,
|
||||
message: `How to convert a list of string to numbers in python`
|
||||
},
|
||||
{
|
||||
heading: 'How to parse email address',
|
||||
|
|
@ -18,9 +18,7 @@ export function EmptyScreen({ setInput }: Pick<UseChatHelpers, 'setInput'>) {
|
|||
return (
|
||||
<div className="mx-auto max-w-2xl px-4">
|
||||
<div className="rounded-lg border bg-background p-8">
|
||||
<h1 className="mb-2 text-lg font-semibold">
|
||||
Welcome to Playground!
|
||||
</h1>
|
||||
<h1 className="mb-2 text-lg font-semibold">Welcome to Playground!</h1>
|
||||
<p className="leading-normal text-muted-foreground">
|
||||
You can start a conversation here or try the following examples:
|
||||
</p>
|
||||
|
|
@ -17,14 +17,14 @@ const ThemeToggle = dynamic(
|
|||
)
|
||||
|
||||
export function Header() {
|
||||
const { data } = useHealth();
|
||||
const isChatEnabled = !!data?.chat_model;
|
||||
const version = data?.version?.git_describe;
|
||||
const { data: latestRelease } = useLatestRelease();
|
||||
const newVersionAvailable = isNewVersionAvailable(version, latestRelease);
|
||||
const { data } = useHealth()
|
||||
const isChatEnabled = !!data?.chat_model
|
||||
const version = data?.version?.git_describe
|
||||
const { data: latestRelease } = useLatestRelease()
|
||||
const newVersionAvailable = isNewVersionAvailable(version, latestRelease)
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-50 flex items-center justify-between w-full h-16 px-4 border-b shrink-0 bg-gradient-to-b from-background/10 via-background/50 to-background/80 backdrop-blur-xl">
|
||||
<header className="sticky top-0 z-50 flex h-16 w-full shrink-0 items-center justify-between border-b bg-gradient-to-b from-background/10 via-background/50 to-background/80 px-4 backdrop-blur-xl">
|
||||
<div className="flex items-center">
|
||||
<ThemeToggle />
|
||||
<Link href="/" className={cn(buttonVariants({ variant: 'link' }))}>
|
||||
|
|
@ -33,20 +33,29 @@ export function Header() {
|
|||
<Link href="/api" className={cn(buttonVariants({ variant: 'link' }))}>
|
||||
API
|
||||
</Link>
|
||||
{isChatEnabled && <Link href="/playground" className={cn(buttonVariants({ variant: 'link' }))}>
|
||||
Playground
|
||||
</Link>}
|
||||
{isChatEnabled && (
|
||||
<Link
|
||||
href="/playground"
|
||||
className={cn(buttonVariants({ variant: 'link' }))}
|
||||
>
|
||||
Playground
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center justify-end space-x-2">
|
||||
{newVersionAvailable && <a
|
||||
target="_blank"
|
||||
href="https://github.com/TabbyML/tabby/releases/latest"
|
||||
rel="noopener noreferrer"
|
||||
className={buttonVariants({ variant: 'ghost' })}
|
||||
>
|
||||
<IconNotice className='text-yellow-600 dark:text-yellow-400' />
|
||||
<span className="hidden ml-2 md:flex">New version ({latestRelease?.name}) available</span>
|
||||
</a>}
|
||||
{newVersionAvailable && (
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://github.com/TabbyML/tabby/releases/latest"
|
||||
rel="noopener noreferrer"
|
||||
className={buttonVariants({ variant: 'ghost' })}
|
||||
>
|
||||
<IconNotice className="text-yellow-600 dark:text-yellow-400" />
|
||||
<span className="ml-2 hidden md:flex">
|
||||
New version ({latestRelease?.name}) available
|
||||
</span>
|
||||
</a>
|
||||
)}
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://github.com/TabbyML/tabby"
|
||||
|
|
@ -54,7 +63,7 @@ export function Header() {
|
|||
className={cn(buttonVariants({ variant: 'outline' }))}
|
||||
>
|
||||
<IconGitHub />
|
||||
<span className="hidden ml-2 md:flex">GitHub</span>
|
||||
<span className="ml-2 hidden md:flex">GitHub</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -63,10 +72,10 @@ export function Header() {
|
|||
|
||||
function isNewVersionAvailable(version?: string, latestRelease?: ReleaseInfo) {
|
||||
try {
|
||||
return version && latestRelease && compare(latestRelease.name, version, '>');
|
||||
return version && latestRelease && compare(latestRelease.name, version, '>')
|
||||
} catch (err) {
|
||||
// Handle invalid semver
|
||||
console.warn(err);
|
||||
return true;
|
||||
console.warn(err)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ export function PromptForm({
|
|||
<span
|
||||
className={cn(
|
||||
buttonVariants({ size: 'sm', variant: 'ghost' }),
|
||||
'absolute left-0 top-4 h-8 w-8 rounded-full bg-background p-0 sm:left-4 hover:bg-background'
|
||||
'absolute left-0 top-4 h-8 w-8 rounded-full bg-background p-0 hover:bg-background sm:left-4'
|
||||
)}
|
||||
>
|
||||
<IconEdit />
|
||||
|
|
@ -93,8 +93,8 @@ const CodeBlock: FC<Props> = memo(({ language, value }) => {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="relative w-full font-sans codeblock bg-zinc-950">
|
||||
<div className="flex items-center justify-between w-full px-6 py-2 pr-4 bg-zinc-800 text-zinc-100">
|
||||
<div className="codeblock relative w-full bg-zinc-950 font-sans">
|
||||
<div className="flex w-full items-center justify-between bg-zinc-800 px-6 py-2 pr-4 text-zinc-100">
|
||||
<span className="text-xs lowercase">{language}</span>
|
||||
<div className="flex items-center space-x-1">
|
||||
<Button
|
||||
|
|
@ -476,10 +476,7 @@ function IconChevronUpDown({
|
|||
)
|
||||
}
|
||||
|
||||
function IconSlack({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<'svg'>) {
|
||||
function IconSlack({ className, ...props }: React.ComponentProps<'svg'>) {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
|
@ -490,34 +487,56 @@ function IconSlack({
|
|||
>
|
||||
<g>
|
||||
<g>
|
||||
<path style={{fill: "#E01E5A"}} d="M99.4,151.2c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h12.9V151.2z" />
|
||||
<path style={{fill: "#E01E5A"}} d="M105.9,151.2c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v32.3c0,7.1-5.8,12.9-12.9,12.9
|
||||
s-12.9-5.8-12.9-12.9V151.2z"/>
|
||||
<path
|
||||
style={{ fill: '#E01E5A' }}
|
||||
d="M99.4,151.2c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h12.9V151.2z"
|
||||
/>
|
||||
<path
|
||||
style={{ fill: '#E01E5A' }}
|
||||
d="M105.9,151.2c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v32.3c0,7.1-5.8,12.9-12.9,12.9
|
||||
s-12.9-5.8-12.9-12.9V151.2z"
|
||||
/>
|
||||
</g>
|
||||
<g>
|
||||
<path style={{fill: "#36C5F0"}} d="M118.8,99.4c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v12.9H118.8z" />
|
||||
<path style={{fill: "#36C5F0"}} d="M118.8,105.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H86.5c-7.1,0-12.9-5.8-12.9-12.9
|
||||
s5.8-12.9,12.9-12.9H118.8z"/>
|
||||
<path
|
||||
style={{ fill: '#36C5F0' }}
|
||||
d="M118.8,99.4c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9s12.9,5.8,12.9,12.9v12.9H118.8z"
|
||||
/>
|
||||
<path
|
||||
style={{ fill: '#36C5F0' }}
|
||||
d="M118.8,105.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9H86.5c-7.1,0-12.9-5.8-12.9-12.9
|
||||
s5.8-12.9,12.9-12.9H118.8z"
|
||||
/>
|
||||
</g>
|
||||
<g>
|
||||
<path style={{fill: "#2EB67D"}} d="M170.6,118.8c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9h-12.9V118.8z" />
|
||||
<path style={{fill: "#2EB67D"}} d="M164.1,118.8c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V86.5c0-7.1,5.8-12.9,12.9-12.9
|
||||
c7.1,0,12.9,5.8,12.9,12.9V118.8z"/>
|
||||
<path
|
||||
style={{ fill: '#2EB67D' }}
|
||||
d="M170.6,118.8c0-7.1,5.8-12.9,12.9-12.9c7.1,0,12.9,5.8,12.9,12.9s-5.8,12.9-12.9,12.9h-12.9V118.8z"
|
||||
/>
|
||||
<path
|
||||
style={{ fill: '#2EB67D' }}
|
||||
d="M164.1,118.8c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9V86.5c0-7.1,5.8-12.9,12.9-12.9
|
||||
c7.1,0,12.9,5.8,12.9,12.9V118.8z"
|
||||
/>
|
||||
</g>
|
||||
<g>
|
||||
<path style={{fill: "#ECB22E"}} d="M151.2,170.6c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9v-12.9H151.2z" />
|
||||
<path style={{fill: "#ECB22E"}} d="M151.2,164.1c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h32.3c7.1,0,12.9,5.8,12.9,12.9
|
||||
c0,7.1-5.8,12.9-12.9,12.9H151.2z"/>
|
||||
<path
|
||||
style={{ fill: '#ECB22E' }}
|
||||
d="M151.2,170.6c7.1,0,12.9,5.8,12.9,12.9c0,7.1-5.8,12.9-12.9,12.9c-7.1,0-12.9-5.8-12.9-12.9v-12.9H151.2z"
|
||||
/>
|
||||
<path
|
||||
style={{ fill: '#ECB22E' }}
|
||||
d="M151.2,164.1c-7.1,0-12.9-5.8-12.9-12.9c0-7.1,5.8-12.9,12.9-12.9h32.3c7.1,0,12.9,5.8,12.9,12.9
|
||||
c0,7.1-5.8,12.9-12.9,12.9H151.2z"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
function IconNotice({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<'svg'>) {
|
||||
return (<svg
|
||||
function IconNotice({ className, ...props }: React.ComponentProps<'svg'>) {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
|
|
@ -528,12 +547,13 @@ function IconNotice({
|
|||
viewBox="0 0 24 24"
|
||||
{...props}
|
||||
>
|
||||
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/>
|
||||
</svg>)
|
||||
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />
|
||||
<path d="M12 9v4" />
|
||||
<path d="M12 17h.01" />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
export {
|
||||
IconEdit,
|
||||
IconNextChat,
|
||||
|
|
@ -49,7 +49,7 @@ const SheetContent = React.forwardRef<
|
|||
<SheetPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'fixed inset-y-0 left-0 z-50 h-full border-r bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left data-[state=closed]:duration-300 data-[state=open]:duration-500 sm:max-w-sm',
|
||||
'fixed inset-y-0 left-0 z-50 h-full border-r bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
|
|
@ -31,14 +31,14 @@ export function UserMenu({ user }: UserMenuProps) {
|
|||
<Button variant="ghost" className="pl-0">
|
||||
{user?.image ? (
|
||||
<Image
|
||||
className="w-6 h-6 transition-opacity duration-300 rounded-full select-none ring-1 ring-zinc-100/10 hover:opacity-80"
|
||||
className="h-6 w-6 select-none rounded-full ring-1 ring-zinc-100/10 transition-opacity duration-300 hover:opacity-80"
|
||||
src={user?.image ? `${user.image}&s=60` : ''}
|
||||
alt={user.name ?? 'Avatar'}
|
||||
height={48}
|
||||
width={48}
|
||||
/>
|
||||
) : (
|
||||
<div className="flex items-center justify-center text-xs font-medium uppercase rounded-full select-none h-7 w-7 shrink-0 bg-muted/50 text-muted-foreground">
|
||||
<div className="flex h-7 w-7 shrink-0 select-none items-center justify-center rounded-full bg-muted/50 text-xs font-medium uppercase text-muted-foreground">
|
||||
{user?.name ? getUserInitials(user?.name) : null}
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -56,10 +56,10 @@ export function UserMenu({ user }: UserMenuProps) {
|
|||
href="https://vercel.com"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center justify-between w-full text-xs"
|
||||
className="inline-flex w-full items-center justify-between text-xs"
|
||||
>
|
||||
Vercel Homepage
|
||||
<IconExternalLink className="w-3 h-3 ml-auto" />
|
||||
<IconExternalLink className="ml-auto h-3 w-3" />
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
"use client"
|
||||
'use client'
|
||||
|
||||
import useSWRImmutable from 'swr/immutable'
|
||||
import { SWRResponse } from 'swr'
|
||||
import fetcher from '@/lib/tabby-fetcher'
|
||||
|
||||
export interface HealthInfo {
|
||||
device: string,
|
||||
model: string,
|
||||
chat_model?: string,
|
||||
version: {
|
||||
build_date: string,
|
||||
git_describe: string,
|
||||
}
|
||||
device: string
|
||||
model: string
|
||||
chat_model?: string
|
||||
version: {
|
||||
build_date: string
|
||||
git_describe: string
|
||||
}
|
||||
}
|
||||
|
||||
export function useHealth(): SWRResponse<HealthInfo> {
|
||||
return useSWRImmutable('/v1/health', fetcher);
|
||||
}
|
||||
return useSWRImmutable('/v1/health', fetcher)
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
'use client'
|
||||
|
||||
import useSWRImmutable from 'swr/immutable'
|
||||
import { SWRResponse } from 'swr'
|
||||
|
||||
export interface ReleaseInfo {
|
||||
name: string
|
||||
}
|
||||
|
||||
export function useLatestRelease(): SWRResponse<ReleaseInfo> {
|
||||
const fetcher = (url: string) => fetch(url).then(x => x.json())
|
||||
return useSWRImmutable(
|
||||
'https://api.github.com/repos/TabbyML/tabby/releases/latest',
|
||||
fetcher
|
||||
)
|
||||
}
|
||||
|
|
@ -3,8 +3,7 @@ import { StreamingTextResponse } from 'ai'
|
|||
import { TabbyStream } from '@/lib/tabby-stream'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
const serverUrl =
|
||||
process.env.NEXT_PUBLIC_TABBY_SERVER_URL || ''
|
||||
const serverUrl = process.env.NEXT_PUBLIC_TABBY_SERVER_URL || ''
|
||||
|
||||
export function usePatchFetch() {
|
||||
useEffect(() => {
|
||||
|
|
@ -21,7 +20,7 @@ export function usePatchFetch() {
|
|||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
const stream = TabbyStream(res, undefined)
|
||||
|
|
@ -29,4 +28,3 @@ export function usePatchFetch() {
|
|||
}
|
||||
}, [])
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
export default function fetcher(url: string): Promise<any> {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return fetch(url).then(x => x.json())
|
||||
} else {
|
||||
return fetch(`${process.env.NEXT_PUBLIC_TABBY_SERVER_URL}${url}`).then(x =>
|
||||
x.json()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
import {
|
||||
type AIStreamCallbacksAndOptions,
|
||||
createCallbacksTransformer,
|
||||
createStreamDataTransformer
|
||||
} from 'ai'
|
||||
|
||||
const utf8Decoder = new TextDecoder('utf-8')
|
||||
|
||||
async function processLines(
|
||||
lines: string[],
|
||||
controller: ReadableStreamDefaultController<string>
|
||||
) {
|
||||
for (const line of lines) {
|
||||
const { content } = JSON.parse(line)
|
||||
controller.enqueue(content)
|
||||
}
|
||||
}
|
||||
|
||||
async function readAndProcessLines(
|
||||
reader: ReadableStreamDefaultReader<Uint8Array>,
|
||||
controller: ReadableStreamDefaultController<string>
|
||||
) {
|
||||
let segment = ''
|
||||
|
||||
while (true) {
|
||||
const { value: chunk, done } = await reader.read()
|
||||
if (done) {
|
||||
break
|
||||
}
|
||||
|
||||
segment += utf8Decoder.decode(chunk, { stream: true })
|
||||
|
||||
const linesArray = segment.split(/\r\n|\n|\r/g)
|
||||
segment = linesArray.pop() || ''
|
||||
|
||||
await processLines(linesArray, controller)
|
||||
}
|
||||
|
||||
if (segment) {
|
||||
const linesArray = [segment]
|
||||
await processLines(linesArray, controller)
|
||||
}
|
||||
|
||||
controller.close()
|
||||
}
|
||||
|
||||
function createParser(res: Response) {
|
||||
const reader = res.body?.getReader()
|
||||
|
||||
return new ReadableStream<string>({
|
||||
async start(controller): Promise<void> {
|
||||
if (!reader) {
|
||||
controller.close()
|
||||
return
|
||||
}
|
||||
|
||||
await readAndProcessLines(reader, controller)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function TabbyStream(
|
||||
reader: Response,
|
||||
callbacks?: AIStreamCallbacksAndOptions
|
||||
): ReadableStream {
|
||||
return createParser(reader)
|
||||
.pipeThrough(createCallbacksTransformer(callbacks))
|
||||
.pipeThrough(
|
||||
createStreamDataTransformer(callbacks?.experimental_streamData)
|
||||
)
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
title: Markdown page example
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
|
||||
You don't need React to write simple standalone pages.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
title: Terms
|
||||
hide_table_of_contents: true
|
||||
---
|
||||
|
||||
<details>
|
||||
<summary>Tabby Free and Open-Source Software (FOSS) License Terms</summary>
|
||||
<div>You can find a copy of our FOSS License Terms in our <a target="_blank" href="https://github.com/TabbyML/tabby">GitHub repository</a>. We license the FOSS version of Tabby under the Apache 2.0 License.</div>
|
||||
</details>
|
||||
Loading…
Reference in New Issue