diff options
| author | GitHub Action <[email protected]> | 2025-11-08 01:59:02 +0000 |
|---|---|---|
| committer | GitHub Action <[email protected]> | 2025-11-08 01:59:02 +0000 |
| commit | 34ff87d504836ff71b3bb2d466842c00ee3c5ec2 (patch) | |
| tree | cc8ac777f2f082ff676b179017c7dc0f3270314b /packages/console | |
| parent | 16357e804145b7f96a2a53badb7dcb6c5453dafe (diff) | |
| download | opencode-34ff87d504836ff71b3bb2d466842c00ee3c5ec2.tar.gz opencode-34ff87d504836ff71b3bb2d466842c00ee3c5ec2.zip | |
chore: format code
Diffstat (limited to 'packages/console')
42 files changed, 340 insertions, 1457 deletions
diff --git a/packages/console/app/src/app.tsx b/packages/console/app/src/app.tsx index 7976f6b3b..1cf963642 100644 --- a/packages/console/app/src/app.tsx +++ b/packages/console/app/src/app.tsx @@ -12,10 +12,7 @@ export default function App() { root={(props) => ( <MetaProvider> <Title>opencode</Title> - <Meta - name="description" - content="OpenCode - The AI coding agent built for the terminal." - /> + <Meta name="description" content="OpenCode - The AI coding agent built for the terminal." /> <Suspense>{props.children}</Suspense> </MetaProvider> )} diff --git a/packages/console/app/src/component/faq.tsx b/packages/console/app/src/component/faq.tsx index 47dca9513..753a0dce4 100644 --- a/packages/console/app/src/component/faq.tsx +++ b/packages/console/app/src/component/faq.tsx @@ -13,10 +13,7 @@ export function Faq(props: ParentProps & { question: string }) { fill="currentColor" xmlns="http://www.w3.org/2000/svg" > - <path - d="M12.5 11.5H19V12.5H12.5V19H11.5V12.5H5V11.5H11.5V5H12.5V11.5Z" - fill="currentColor" - /> + <path d="M12.5 11.5H19V12.5H12.5V19H11.5V12.5H5V11.5H11.5V5H12.5V11.5Z" fill="currentColor" /> </svg> <svg data-slot="faq-icon-minus" diff --git a/packages/console/app/src/component/icon.tsx b/packages/console/app/src/component/icon.tsx index d0bce947b..0395cad52 100644 --- a/packages/console/app/src/component/icon.tsx +++ b/packages/console/app/src/component/icon.tsx @@ -9,23 +9,10 @@ export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) { <path d="M13.7124 9.14333V4.5719H18.2838V9.14333H13.7124Z" fill="currentColor" /> <path d="M13.7124 13.7136V9.14221H18.2838V13.7136H13.7124Z" fill="currentColor" /> <path d="M0 18.2857V13.7142H4.57143V18.2857H0Z" fill="currentColor" fill-opacity="0.2" /> - <rect - width="4.57143" - height="4.57143" - transform="translate(4.57178 13.7141)" - fill="currentColor" - /> - <path - d="M4.57178 18.2855V13.7141H9.14321V18.2855H4.57178Z" - fill="currentColor" - fill-opacity="0.2" - /> + <rect width="4.57143" height="4.57143" transform="translate(4.57178 13.7141)" fill="currentColor" /> + <path d="M4.57178 18.2855V13.7141H9.14321V18.2855H4.57178Z" fill="currentColor" fill-opacity="0.2" /> <path d="M9.1438 18.2855V13.7141H13.7152V18.2855H9.1438Z" fill="currentColor" /> - <path - d="M13.7156 18.2855V13.7141H18.287V18.2855H13.7156Z" - fill="currentColor" - fill-opacity="0.2" - /> + <path d="M13.7156 18.2855V13.7141H18.287V18.2855H13.7156Z" fill="currentColor" fill-opacity="0.2" /> <rect width="4.57143" height="4.57143" transform="translate(0 18.2859)" fill="currentColor" /> <path d="M0 22.8572V18.2858H4.57143V22.8572H0Z" fill="currentColor" fill-opacity="0.2" /> <rect @@ -36,16 +23,8 @@ export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) { fill-opacity="0.2" /> <path d="M4.57178 22.8573V18.2859H9.14321V22.8573H4.57178Z" fill="currentColor" /> - <path - d="M9.1438 22.8573V18.2859H13.7152V22.8573H9.1438Z" - fill="currentColor" - fill-opacity="0.2" - /> - <path - d="M13.7156 22.8573V18.2859H18.287V22.8573H13.7156Z" - fill="currentColor" - fill-opacity="0.2" - /> + <path d="M9.1438 22.8573V18.2859H13.7152V22.8573H9.1438Z" fill="currentColor" fill-opacity="0.2" /> + <path d="M13.7156 22.8573V18.2859H18.287V22.8573H13.7156Z" fill="currentColor" fill-opacity="0.2" /> <path d="M0 27.4292V22.8578H4.57143V27.4292H0Z" fill="currentColor" /> <path d="M4.57178 27.4292V22.8578H9.14321V27.4292H4.57178Z" fill="currentColor" /> <path d="M9.1438 27.4276V22.8562H13.7152V27.4276H9.1438Z" fill="currentColor" /> @@ -61,21 +40,9 @@ export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) { <path d="M32.001 18.2855V13.7141H36.5724V18.2855H32.001Z" fill="currentColor" /> <path d="M36.5698 18.2855V13.7141H41.1413V18.2855H36.5698Z" fill="currentColor" /> <path d="M22.8572 22.8573V18.2859H27.4286V22.8573H22.8572Z" fill="currentColor" /> - <path - d="M27.4292 22.8573V18.2859H32.0006V22.8573H27.4292Z" - fill="currentColor" - fill-opacity="0.2" - /> - <path - d="M32.001 22.8573V18.2859H36.5724V22.8573H32.001Z" - fill="currentColor" - fill-opacity="0.2" - /> - <path - d="M36.5698 22.8573V18.2859H41.1413V22.8573H36.5698Z" - fill="currentColor" - fill-opacity="0.2" - /> + <path d="M27.4292 22.8573V18.2859H32.0006V22.8573H27.4292Z" fill="currentColor" fill-opacity="0.2" /> + <path d="M32.001 22.8573V18.2859H36.5724V22.8573H32.001Z" fill="currentColor" fill-opacity="0.2" /> + <path d="M36.5698 22.8573V18.2859H41.1413V22.8573H36.5698Z" fill="currentColor" fill-opacity="0.2" /> <path d="M22.8572 27.4292V22.8578H27.4286V27.4292H22.8572Z" fill="currentColor" /> <path d="M27.4292 27.4276V22.8562H32.0006V27.4276H27.4292Z" fill="currentColor" /> <path d="M32.001 27.4276V22.8562H36.5724V27.4276H32.001Z" fill="currentColor" /> @@ -86,40 +53,16 @@ export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) { <path d="M45.7144 13.7136V9.14221H50.2858V13.7136H45.7144Z" fill="currentColor" /> <path d="M59.4299 13.7152V9.1438H64.0014V13.7152H59.4299Z" fill="currentColor" /> <path d="M45.7144 18.2855V13.7141H50.2858V18.2855H45.7144Z" fill="currentColor" /> - <path - d="M50.2861 18.2857V13.7142H54.8576V18.2857H50.2861Z" - fill="currentColor" - fill-opacity="0.2" - /> - <path - d="M54.8579 18.2855V13.7141H59.4293V18.2855H54.8579Z" - fill="currentColor" - fill-opacity="0.2" - /> + <path d="M50.2861 18.2857V13.7142H54.8576V18.2857H50.2861Z" fill="currentColor" fill-opacity="0.2" /> + <path d="M54.8579 18.2855V13.7141H59.4293V18.2855H54.8579Z" fill="currentColor" fill-opacity="0.2" /> <path d="M59.4299 18.2855V13.7141H64.0014V18.2855H59.4299Z" fill="currentColor" /> <path d="M45.7144 22.8573V18.2859H50.2858V22.8573H45.7144Z" fill="currentColor" /> - <path - d="M50.2861 22.8572V18.2858H54.8576V22.8572H50.2861Z" - fill="currentColor" - fill-opacity="0.2" - /> - <path - d="M54.8579 22.8573V18.2859H59.4293V22.8573H54.8579Z" - fill="currentColor" - fill-opacity="0.2" - /> + <path d="M50.2861 22.8572V18.2858H54.8576V22.8572H50.2861Z" fill="currentColor" fill-opacity="0.2" /> + <path d="M54.8579 22.8573V18.2859H59.4293V22.8573H54.8579Z" fill="currentColor" fill-opacity="0.2" /> <path d="M59.4299 22.8573V18.2859H64.0014V22.8573H59.4299Z" fill="currentColor" /> <path d="M45.7144 27.4292V22.8578H50.2858V27.4292H45.7144Z" fill="currentColor" /> - <path - d="M50.2861 27.4286V22.8572H54.8576V27.4286H50.2861Z" - fill="currentColor" - fill-opacity="0.2" - /> - <path - d="M54.8579 27.4285V22.8571H59.4293V27.4285H54.8579Z" - fill="currentColor" - fill-opacity="0.2" - /> + <path d="M50.2861 27.4286V22.8572H54.8576V27.4286H50.2861Z" fill="currentColor" fill-opacity="0.2" /> + <path d="M54.8579 27.4285V22.8571H59.4293V27.4285H54.8579Z" fill="currentColor" fill-opacity="0.2" /> <path d="M59.4299 27.4292V22.8578H64.0014V27.4292H59.4299Z" fill="currentColor" /> </svg> ) @@ -127,14 +70,7 @@ export function IconLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) { export function IconCopy(props: JSX.SvgSVGAttributes<SVGSVGElement>) { return ( - <svg - {...props} - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg {...props} width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.75 8.75V2.75H21.25V15.25H15.25M15.25 8.75H2.75V21.25H15.25V8.75Z" stroke="currentColor" @@ -147,20 +83,8 @@ export function IconCopy(props: JSX.SvgSVGAttributes<SVGSVGElement>) { export function IconCheck(props: JSX.SvgSVGAttributes<SVGSVGElement>) { return ( - <svg - {...props} - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M2.75 15.0938L9 20.25L21.25 3.75" - stroke="#03B000" - stroke-width="2" - stroke-linecap="square" - /> + <svg {...props} width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M2.75 15.0938L9 20.25L21.25 3.75" stroke="#03B000" stroke-width="2" stroke-linecap="square" /> </svg> ) } @@ -189,14 +113,7 @@ export function IconStripe(props: JSX.SvgSVGAttributes<SVGSVGElement>) { export function IconChevron(props: JSX.SvgSVGAttributes<SVGSVGElement>) { return ( - <svg - {...props} - width="8" - height="6" - viewBox="0 0 8 6" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg {...props} width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill="currentColor" d="M4.00024 5.04041L7.37401 1.66663L6.66691 0.959525L4.00024 3.62619L1.33357 0.959525L0.626465 1.66663L4.00024 5.04041Z" @@ -207,14 +124,7 @@ export function IconChevron(props: JSX.SvgSVGAttributes<SVGSVGElement>) { export function IconWorkspaceLogo(props: JSX.SvgSVGAttributes<SVGSVGElement>) { return ( - <svg - {...props} - width="24" - height="30" - viewBox="0 0 24 30" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg {...props} width="24" height="30" viewBox="0 0 24 30" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M18 6H6V24H18V6ZM24 30H0V0H24V30Z" fill="currentColor" /> </svg> ) @@ -234,10 +144,7 @@ export function IconOpenAI(props: JSX.SvgSVGAttributes<SVGSVGElement>) { export function IconAnthropic(props: JSX.SvgSVGAttributes<SVGSVGElement>) { return ( <svg {...props} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path - fill="currentColor" - d="M13.7891 3.93188L20.2223 20.068H23.7502L17.317 3.93188H13.7891Z" - /> + <path fill="currentColor" d="M13.7891 3.93188L20.2223 20.068H23.7502L17.317 3.93188H13.7891Z" /> <path fill="currentColor" d="M6.32538 13.6827L8.52662 8.01201L10.7279 13.6827H6.32538ZM6.68225 3.93188L0.25 20.068H3.84652L5.16202 16.6794H11.8914L13.2067 20.068H16.8033L10.371 3.93188H6.68225Z" diff --git a/packages/console/app/src/lib/github.ts b/packages/console/app/src/lib/github.ts index dab317751..bc49d2e62 100644 --- a/packages/console/app/src/lib/github.ts +++ b/packages/console/app/src/lib/github.ts @@ -7,10 +7,7 @@ export const github = query(async () => { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", } - const apiBaseUrl = config.github.repoUrl.replace( - "https://github.com/", - "https://api.github.com/repos/", - ) + const apiBaseUrl = config.github.repoUrl.replace("https://github.com/", "https://api.github.com/repos/") try { const [meta, releases, contributors] = await Promise.all([ fetch(apiBaseUrl, { headers }).then((res) => res.json()), diff --git a/packages/console/app/src/routes/auth/authorize.ts b/packages/console/app/src/routes/auth/authorize.ts index 293e9ede7..166466ef8 100644 --- a/packages/console/app/src/routes/auth/authorize.ts +++ b/packages/console/app/src/routes/auth/authorize.ts @@ -2,9 +2,6 @@ import type { APIEvent } from "@solidjs/start/server" import { AuthClient } from "~/context/auth" export async function GET(input: APIEvent) { - const result = await AuthClient.authorize( - new URL("./callback", input.request.url).toString(), - "code", - ) + const result = await AuthClient.authorize(new URL("./callback", input.request.url).toString(), "code") return Response.redirect(result.url, 302) } diff --git a/packages/console/app/src/routes/brand/index.tsx b/packages/console/app/src/routes/brand/index.tsx index 72ea0f150..6aac4517a 100644 --- a/packages/console/app/src/routes/brand/index.tsx +++ b/packages/console/app/src/routes/brand/index.tsx @@ -68,13 +68,7 @@ export default function Brand() { onClick={() => downloadFile(brandAssets, "opencode-brand-assets.zip")} > Download all assets - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -90,13 +84,7 @@ export default function Brand() { <div data-component="actions"> <button onClick={() => downloadFile(logoLightPng, "opencode-logo-light.png")}> PNG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -107,13 +95,7 @@ export default function Brand() { </button> <button onClick={() => downloadFile(logoLightSvg, "opencode-logo-light.svg")}> SVG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -129,13 +111,7 @@ export default function Brand() { <div data-component="actions"> <button onClick={() => downloadFile(logoDarkPng, "opencode-logo-dark.png")}> PNG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -146,13 +122,7 @@ export default function Brand() { </button> <button onClick={() => downloadFile(logoDarkSvg, "opencode-logo-dark.svg")}> SVG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -166,17 +136,9 @@ export default function Brand() { <div> <img src={previewWordmarkLight} alt="OpenCode brand guidelines" /> <div data-component="actions"> - <button - onClick={() => downloadFile(wordmarkLightPng, "opencode-wordmark-light.png")} - > + <button onClick={() => downloadFile(wordmarkLightPng, "opencode-wordmark-light.png")}> PNG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -185,17 +147,9 @@ export default function Brand() { /> </svg> </button> - <button - onClick={() => downloadFile(wordmarkLightSvg, "opencode-wordmark-light.svg")} - > + <button onClick={() => downloadFile(wordmarkLightSvg, "opencode-wordmark-light.svg")}> SVG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -209,17 +163,9 @@ export default function Brand() { <div> <img src={previewWordmarkDark} alt="OpenCode brand guidelines" /> <div data-component="actions"> - <button - onClick={() => downloadFile(wordmarkDarkPng, "opencode-wordmark-dark.png")} - > + <button onClick={() => downloadFile(wordmarkDarkPng, "opencode-wordmark-dark.png")}> PNG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -228,17 +174,9 @@ export default function Brand() { /> </svg> </button> - <button - onClick={() => downloadFile(wordmarkDarkSvg, "opencode-wordmark-dark.svg")} - > + <button onClick={() => downloadFile(wordmarkDarkSvg, "opencode-wordmark-dark.svg")}> SVG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -252,19 +190,9 @@ export default function Brand() { <div> <img src={previewWordmarkSimpleLight} alt="OpenCode brand guidelines" /> <div data-component="actions"> - <button - onClick={() => - downloadFile(wordmarkSimpleLightPng, "opencode-wordmark-simple-light.png") - } - > + <button onClick={() => downloadFile(wordmarkSimpleLightPng, "opencode-wordmark-simple-light.png")}> PNG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -273,19 +201,9 @@ export default function Brand() { /> </svg> </button> - <button - onClick={() => - downloadFile(wordmarkSimpleLightSvg, "opencode-wordmark-simple-light.svg") - } - > + <button onClick={() => downloadFile(wordmarkSimpleLightSvg, "opencode-wordmark-simple-light.svg")}> SVG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -299,19 +217,9 @@ export default function Brand() { <div> <img src={previewWordmarkSimpleDark} alt="OpenCode brand guidelines" /> <div data-component="actions"> - <button - onClick={() => - downloadFile(wordmarkSimpleDarkPng, "opencode-wordmark-simple-dark.png") - } - > + <button onClick={() => downloadFile(wordmarkSimpleDarkPng, "opencode-wordmark-simple-dark.png")}> PNG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" @@ -320,19 +228,9 @@ export default function Brand() { /> </svg> </button> - <button - onClick={() => - downloadFile(wordmarkSimpleDarkSvg, "opencode-wordmark-simple-dark.svg") - } - > + <button onClick={() => downloadFile(wordmarkSimpleDarkSvg, "opencode-wordmark-simple-dark.svg")}> SVG - <svg - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M13.9583 10.6247L10 14.583L6.04167 10.6247M10 2.08301V13.958M16.25 17.9163H3.75" stroke="currentColor" diff --git a/packages/console/app/src/routes/enterprise/index.tsx b/packages/console/app/src/routes/enterprise/index.tsx index 4bff061a8..095ed97a2 100644 --- a/packages/console/app/src/routes/enterprise/index.tsx +++ b/packages/console/app/src/routes/enterprise/index.tsx @@ -66,39 +66,26 @@ export default function Enterprise() { <div data-component="enterprise-column-1"> <h1>Your code is yours</h1> <p> - OpenCode operates securely inside your organization with no data or context stored - and no licensing restrictions or ownership claims. Start a trial with your team, - then deploy it across your organization by integrating it with your SSO and - internal AI gateway. + OpenCode operates securely inside your organization with no data or context stored and no licensing + restrictions or ownership claims. Start a trial with your team, then deploy it across your + organization by integrating it with your SSO and internal AI gateway. </p> <p>Let us know and how we can help.</p> <Show when={false}> <div data-component="testimonial"> <div data-component="quotation"> - <svg - width="20" - height="17" - viewBox="0 0 20 17" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="20" height="17" viewBox="0 0 20 17" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M19.4118 0L16.5882 9.20833H20V17H12.2353V10.0938L16 0H19.4118ZM7.17647 0L4.35294 9.20833H7.76471V17H0V10.0938L3.76471 0H7.17647Z" fill="currentColor" /> </svg> </div> - Thanks to OpenCode, we found a way to create software to track all our assets — - even the imaginary ones. + Thanks to OpenCode, we found a way to create software to track all our assets — even the imaginary + ones. <div data-component="testimonial-logo"> - <svg - width="80" - height="79" - viewBox="0 0 80 79" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="80" height="79" viewBox="0 0 80 79" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" @@ -215,11 +202,7 @@ export default function Enterprise() { </button> </form> - {showSuccess() && ( - <div data-component="success-message"> - Message sent, we'll be in touch soon. - </div> - )} + {showSuccess() && <div data-component="success-message">Message sent, we'll be in touch soon.</div>} </div> </div> </div> @@ -232,31 +215,29 @@ export default function Enterprise() { <ul> <li> <Faq question="What is OpenCode Enterprise?"> - OpenCode Enterprise is for organizations that want to ensure that their code and - data never leaves their infrastructure. It can do this by using a centralized - config that integrates with your SSO and internal AI gateway. + OpenCode Enterprise is for organizations that want to ensure that their code and data never leaves + their infrastructure. It can do this by using a centralized config that integrates with your SSO and + internal AI gateway. </Faq> </li> <li> <Faq question="How do I get started with OpenCode Enterprise?"> - Simply start with an internal trial with your team. OpenCode by default does not - store your code or context data, making it easy to get started. Then contact us to - discuss pricing and implementation options. + Simply start with an internal trial with your team. OpenCode by default does not store your code or + context data, making it easy to get started. Then contact us to discuss pricing and implementation + options. </Faq> </li> <li> <Faq question="How does enterprise pricing work?"> - We offer per-seat enterprise pricing. If you have your own LLM gateway, we do not - charge for tokens used. For further details, contact us for a custom quote based - on your organization's needs. + We offer per-seat enterprise pricing. If you have your own LLM gateway, we do not charge for tokens + used. For further details, contact us for a custom quote based on your organization's needs. </Faq> </li> <li> <Faq question="Is my data secure with OpenCode Enterprise?"> - Yes. OpenCode does not store your code or context data. All processing happens - locally or through direct API calls to your AI provider. With central config and - SSO integration, your data remains secure within your organization's - infrastructure. + Yes. OpenCode does not store your code or context data. All processing happens locally or through + direct API calls to your AI provider. With central config and SSO integration, your data remains + secure within your organization's infrastructure. </Faq> </li> </ul> diff --git a/packages/console/app/src/routes/index.tsx b/packages/console/app/src/routes/index.tsx index ee138e140..8b8f44999 100644 --- a/packages/console/app/src/routes/index.tsx +++ b/packages/console/app/src/routes/index.tsx @@ -42,10 +42,7 @@ export default function Home() { return ( <main data-page="opencode"> - <HttpHeader - name="Cache-Control" - value="public, max-age=1, s-maxage=3600, stale-while-revalidate=86400" - /> + <HttpHeader name="Cache-Control" value="public, max-age=1, s-maxage=3600, stale-while-revalidate=86400" /> <Title>OpenCode | The AI coding agent built for the terminal</Title> <Link rel="canonical" href={config.baseUrl} /> <Link rel="icon" type="image/svg+xml" href="/favicon.svg" /> @@ -57,27 +54,17 @@ export default function Home() { <div data-component="content"> <section data-component="hero"> <div data-slot="hero-copy"> - <a - data-slot="releases" - href={release()?.url ?? `${config.github.repoUrl}/releases`} - target="_blank" - > + <a data-slot="releases" href={release()?.url ?? `${config.github.repoUrl}/releases`} target="_blank"> What’s new in {release()?.name ?? "the latest release"} </a> <h1>The AI coding agent built for the terminal</h1> <p> - OpenCode is fully open source, giving you control and freedom to use any provider, - any model, and any editor. + OpenCode is fully open source, giving you control and freedom to use any provider, any model, and any + editor. </p> <a href="/docs"> <span>Read docs </span> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6.5 12L17 12M13 16.5L17.5 12L13 7.5" stroke="currentColor" @@ -176,10 +163,7 @@ export default function Home() { <section data-component="what"> <div data-slot="section-title"> <h3>What is OpenCode?</h3> - <p> - OpenCode is an open source agent that helps you write and run code directly from the - terminal. - </p> + <p>OpenCode is an open source agent that helps you write and run code directly from the terminal.</p> </div> <ul> <li> @@ -197,8 +181,7 @@ export default function Home() { <li> <span>[*]</span> <div> - <strong>Multi-session</strong> Start multiple agents in parallel on the same - project + <strong>Multi-session</strong> Start multiple agents in parallel on the same project </div> </li> <li> @@ -210,15 +193,13 @@ export default function Home() { <li> <span>[*]</span> <div> - <strong>Claude Pro</strong> Log in with Anthropic to use your Claude Pro or Max - account + <strong>Claude Pro</strong> Log in with Anthropic to use your Claude Pro or Max account </div> </li> <li> <span>[*]</span> <div> - <strong>Any model</strong> 75+ LLM providers through Models.dev, including local - models + <strong>Any model</strong> 75+ LLM providers through Models.dev, including local models </div> </li> <li> @@ -238,21 +219,15 @@ export default function Home() { <p> With over <strong>{config.github.starsFormatted.full}</strong> GitHub stars,{" "} <strong>{config.stats.contributors}</strong> contributors, and almost{" "} - <strong>{config.stats.commits}</strong> commits, OpenCode is used and trusted by - over <strong>{config.stats.monthlyUsers}</strong> developers every month. + <strong>{config.stats.commits}</strong> commits, OpenCode is used and trusted by over{" "} + <strong>{config.stats.monthlyUsers}</strong> developers every month. </p> </div> <div data-component="growth-stats"> <div data-component="growth-stat"> <div data-component="stat-illustration"> - <svg - width="205" - height="264" - viewBox="0 0 205 264" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="205" height="264" viewBox="0 0 205 264" fill="none" xmlns="http://www.w3.org/2000/svg"> <g opacity="0.5" clip-path="url(#clip0_236_15902)"> <mask id="mask0_236_15902" @@ -298,20 +273,13 @@ export default function Home() { </svg> </div> <span> - <figure>Fig 1.</figure> <strong>{config.github.starsFormatted.compact}</strong>{" "} - GitHub Stars + <figure>Fig 1.</figure> <strong>{config.github.starsFormatted.compact}</strong> GitHub Stars </span> </div> <div data-component="growth-stat"> <div data-component="stat-illustration"> - <svg - width="205" - height="264" - viewBox="0 0 205 264" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="205" height="264" viewBox="0 0 205 264" fill="none" xmlns="http://www.w3.org/2000/svg"> <g opacity="0.5" clip-path="url(#clip0_236_15557)"> <g clip-path="url(#clip1_236_15557)"> <rect opacity="0.81" width="6" height="6" fill="#CFCECD" /> @@ -440,54 +408,12 @@ export default function Home() { <rect opacity="0.32" x="70" y="112" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.52" x="84" y="112" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.02" x="98" y="112" width="6" height="6" fill="#CFCECD" /> - <rect - opacity="0.88" - x="126" - y="112" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.12" - x="140" - y="112" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.93" - x="154" - y="112" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.79" - x="168" - y="112" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.24" - x="182" - y="112" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.64" - x="196" - y="112" - width="6" - height="6" - fill="#CFCECD" - /> + <rect opacity="0.88" x="126" y="112" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.12" x="140" y="112" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.93" x="154" y="112" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.79" x="168" y="112" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.24" x="182" y="112" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.64" x="196" y="112" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.57" y="126" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.6" x="14" y="126" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.05" x="28" y="126" width="6" height="6" fill="#BCBBBB" /> @@ -496,55 +422,13 @@ export default function Home() { <rect opacity="0.93" x="70" y="126" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.63" x="84" y="126" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.58" x="98" y="126" width="6" height="6" fill="#DAD9D9" /> - <rect - opacity="0.64" - x="112" - y="126" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.74" - x="126" - y="126" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.74" - x="140" - y="126" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.64" x="112" y="126" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.74" x="126" y="126" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.74" x="140" y="126" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.1" x="154" y="126" width="6" height="6" fill="#8E8B8B" /> - <rect - opacity="0.93" - x="168" - y="126" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.43" - x="182" - y="126" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.45" - x="196" - y="126" - width="6" - height="6" - fill="#BCBBBB" - /> + <rect opacity="0.93" x="168" y="126" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.43" x="182" y="126" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.45" x="196" y="126" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.77" y="140" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.78" x="14" y="140" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.18" x="28" y="140" width="6" height="6" fill="#DAD9D9" /> @@ -553,55 +437,13 @@ export default function Home() { <rect opacity="0.53" x="70" y="140" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.06" x="84" y="140" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.81" x="98" y="140" width="6" height="6" fill="#DAD9D9" /> - <rect - opacity="0.49" - x="112" - y="140" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.45" - x="126" - y="140" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.37" - x="140" - y="140" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.58" - x="154" - y="140" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.49" x="112" y="140" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.45" x="126" y="140" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.37" x="140" y="140" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.58" x="154" y="140" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.8" x="168" y="140" width="6" height="6" fill="#BCBBBB" /> - <rect - opacity="0.35" - x="182" - y="140" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.73" - x="196" - y="140" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.35" x="182" y="140" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.73" x="196" y="140" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.92" y="154" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.32" x="14" y="154" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.3" x="28" y="154" width="6" height="6" fill="#8E8B8B" /> @@ -610,47 +452,12 @@ export default function Home() { <rect opacity="0.66" x="70" y="154" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.83" x="84" y="154" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.52" x="98" y="154" width="6" height="6" fill="#8E8B8B" /> - <rect - opacity="0.82" - x="112" - y="154" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.95" - x="126" - y="154" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.89" - x="140" - y="154" - width="6" - height="6" - fill="#CFCECD" - /> + <rect opacity="0.82" x="112" y="154" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.95" x="126" y="154" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.89" x="140" y="154" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.2" x="154" y="154" width="6" height="6" fill="#BCBBBB" /> - <rect - opacity="0.61" - x="168" - y="154" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.34" - x="196" - y="154" - width="6" - height="6" - fill="#DAD9D9" - /> + <rect opacity="0.61" x="168" y="154" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.34" x="196" y="154" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.9" y="168" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.99" x="14" y="168" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.49" x="28" y="168" width="6" height="6" fill="#BCBBBB" /> @@ -659,55 +466,13 @@ export default function Home() { <rect opacity="0.92" x="70" y="168" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.79" x="84" y="168" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.8" x="98" y="168" width="6" height="6" fill="#BCBBBB" /> - <rect - opacity="0.74" - x="112" - y="168" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.38" - x="126" - y="168" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.56" - x="140" - y="168" - width="6" - height="6" - fill="#CFCECD" - /> + <rect opacity="0.74" x="112" y="168" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.38" x="126" y="168" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.56" x="140" y="168" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.7" x="154" y="168" width="6" height="6" fill="#DAD9D9" /> - <rect - opacity="0.47" - x="168" - y="168" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.92" - x="182" - y="168" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.19" - x="196" - y="168" - width="6" - height="6" - fill="#BCBBBB" - /> + <rect opacity="0.47" x="168" y="168" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.92" x="182" y="168" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.19" x="196" y="168" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.12" y="182" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.16" x="14" y="182" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.98" x="28" y="182" width="6" height="6" fill="#8E8B8B" /> @@ -716,55 +481,13 @@ export default function Home() { <rect opacity="0.17" x="70" y="182" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.26" x="84" y="182" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.3" x="98" y="182" width="6" height="6" fill="#DAD9D9" /> - <rect - opacity="0.12" - x="112" - y="182" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.31" - x="126" - y="182" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.62" - x="140" - y="182" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.74" - x="154" - y="182" - width="6" - height="6" - fill="#DAD9D9" - /> + <rect opacity="0.12" x="112" y="182" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.31" x="126" y="182" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.62" x="140" y="182" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.74" x="154" y="182" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.8" x="168" y="182" width="6" height="6" fill="#CFCECD" /> - <rect - opacity="0.89" - x="182" - y="182" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.75" - x="196" - y="182" - width="6" - height="6" - fill="#DAD9D9" - /> + <rect opacity="0.89" x="182" y="182" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.75" x="196" y="182" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.1" y="196" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.11" x="14" y="196" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.79" x="28" y="196" width="6" height="6" fill="#BCBBBB" /> @@ -773,62 +496,13 @@ export default function Home() { <rect opacity="0.31" x="70" y="196" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.33" x="84" y="196" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.2" x="98" y="196" width="6" height="6" fill="#8E8B8B" /> - <rect - opacity="0.21" - x="112" - y="196" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.02" - x="126" - y="196" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.82" - x="140" - y="196" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.28" - x="154" - y="196" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.19" - x="168" - y="196" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.97" - x="182" - y="196" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.45" - x="196" - y="196" - width="6" - height="6" - fill="#DAD9D9" - /> + <rect opacity="0.21" x="112" y="196" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.02" x="126" y="196" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.82" x="140" y="196" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.28" x="154" y="196" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.19" x="168" y="196" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.97" x="182" y="196" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.45" x="196" y="196" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.88" y="210" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.58" x="14" y="210" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.53" x="28" y="210" width="6" height="6" fill="#BCBBBB" /> @@ -837,55 +511,13 @@ export default function Home() { <rect opacity="0.73" x="70" y="210" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.87" x="84" y="210" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.35" x="98" y="210" width="6" height="6" fill="#8E8B8B" /> - <rect - opacity="0.61" - x="112" - y="210" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.61" x="112" y="210" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.8" x="126" y="210" width="6" height="6" fill="#8E8B8B" /> - <rect - opacity="0.87" - x="140" - y="210" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.77" - x="154" - y="210" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.94" - x="168" - y="210" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.59" - x="182" - y="210" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.37" - x="196" - y="210" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.87" x="140" y="210" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.77" x="154" y="210" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.94" x="168" y="210" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.59" x="182" y="210" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.37" x="196" y="210" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.7" y="224" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.72" x="14" y="224" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.95" x="28" y="224" width="6" height="6" fill="#CFCECD" /> @@ -895,54 +527,12 @@ export default function Home() { <rect opacity="0.2" x="84" y="224" width="6" height="6" fill="#BCBBBB" /> <rect opacity="0.63" x="98" y="224" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.5" x="112" y="224" width="6" height="6" fill="#8E8B8B" /> - <rect - opacity="0.79" - x="126" - y="224" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.02" - x="140" - y="224" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.17" - x="154" - y="224" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.99" - x="168" - y="224" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.82" - x="182" - y="224" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.28" - x="196" - y="224" - width="6" - height="6" - fill="#DAD9D9" - /> + <rect opacity="0.79" x="126" y="224" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.02" x="140" y="224" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.17" x="154" y="224" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.99" x="168" y="224" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.82" x="182" y="224" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.28" x="196" y="224" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.76" y="238" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.39" x="14" y="238" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.14" x="28" y="238" width="6" height="6" fill="#8E8B8B" /> @@ -951,62 +541,13 @@ export default function Home() { <rect opacity="0.13" x="70" y="238" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.35" x="84" y="238" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.13" x="98" y="238" width="6" height="6" fill="#BCBBBB" /> - <rect - opacity="0.55" - x="112" - y="238" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.83" - x="126" - y="238" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.86" - x="140" - y="238" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.63" - x="154" - y="238" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.38" - x="168" - y="238" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.57" - x="182" - y="238" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.13" - x="196" - y="238" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.55" x="112" y="238" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.83" x="126" y="238" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.86" x="140" y="238" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.63" x="154" y="238" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.38" x="168" y="238" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.57" x="182" y="238" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.13" x="196" y="238" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.9" y="252" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.63" x="14" y="252" width="6" height="6" fill="#CFCECD" /> <rect opacity="0.23" x="28" y="252" width="6" height="6" fill="#8E8B8B" /> @@ -1015,54 +556,12 @@ export default function Home() { <rect opacity="0.19" x="70" y="252" width="6" height="6" fill="#DAD9D9" /> <rect opacity="0.29" x="84" y="252" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.78" x="98" y="252" width="6" height="6" fill="#BCBBBB" /> - <rect - opacity="0.14" - x="112" - y="252" - width="6" - height="6" - fill="#BCBBBB" - /> - <rect - opacity="0.64" - x="126" - y="252" - width="6" - height="6" - fill="#8E8B8B" - /> - <rect - opacity="0.27" - x="140" - y="252" - width="6" - height="6" - fill="#CFCECD" - /> - <rect - opacity="0.85" - x="154" - y="252" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.02" - x="168" - y="252" - width="6" - height="6" - fill="#DAD9D9" - /> - <rect - opacity="0.29" - x="182" - y="252" - width="6" - height="6" - fill="#8E8B8B" - /> + <rect opacity="0.14" x="112" y="252" width="6" height="6" fill="#BCBBBB" /> + <rect opacity="0.64" x="126" y="252" width="6" height="6" fill="#8E8B8B" /> + <rect opacity="0.27" x="140" y="252" width="6" height="6" fill="#CFCECD" /> + <rect opacity="0.85" x="154" y="252" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.02" x="168" y="252" width="6" height="6" fill="#DAD9D9" /> + <rect opacity="0.29" x="182" y="252" width="6" height="6" fill="#8E8B8B" /> <rect opacity="0.4" x="196" y="252" width="6" height="6" fill="#8E8B8B" /> </g> </g> @@ -1071,31 +570,19 @@ export default function Home() { <rect width="205" height="264" fill="white" /> </clipPath> <clipPath id="clip1_236_15557"> - <rect - width="236" - height="264" - fill="white" - transform="translate(-0.164062)" - /> + <rect width="236" height="264" fill="white" transform="translate(-0.164062)" /> </clipPath> </defs> </svg> </div> <span> - <figure>Fig 2.</figure> <strong>{config.stats.contributors}</strong>{" "} - Contributors + <figure>Fig 2.</figure> <strong>{config.stats.contributors}</strong> Contributors </span> </div> <div data-component="growth-stat"> <div data-component="stat-illustration"> - <svg - width="205" - height="264" - viewBox="0 0 205 264" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="205" height="264" viewBox="0 0 205 264" fill="none" xmlns="http://www.w3.org/2000/svg"> <g opacity="0.5"> <path d="M205 0H203.985V264H205V0Z" fill="#8E8B8B" /> <path d="M197.896 34H196.881V264H197.896V34Z" fill="#8E8B8B" /> @@ -1131,8 +618,7 @@ export default function Home() { </svg> </div> <span> - <figure>Fig 3.</figure> <strong>{config.stats.monthlyUsers}</strong> Monthly - Devs + <figure>Fig 3.</figure> <strong>{config.stats.monthlyUsers}</strong> Monthly Devs </span> </div> </div> @@ -1146,9 +632,8 @@ export default function Home() { <span>[*]</span> <p> - OpenCode does not store any of your code or context data, so that it can operate - in privacy sensitive environments. Learn more about{" "} - <a href="/docs/enterprise/ ">privacy</a>. + OpenCode does not store any of your code or context data, so that it can operate in privacy sensitive + environments. Learn more about <a href="/docs/enterprise/ ">privacy</a>. </p> </div> </div> @@ -1161,9 +646,9 @@ export default function Home() { <ul> <li> <Faq question="What is OpenCode?"> - OpenCode is an open source agent that helps you write and run code directly from - the terminal. You can pair OpenCode with any AI model, and because it’s - terminal-based you can pair it with your preferred code editor. + OpenCode is an open source agent that helps you write and run code directly from the terminal. You can + pair OpenCode with any AI model, and because it’s terminal-based you can pair it with your preferred + code editor. </Faq> </li> <li> @@ -1173,32 +658,30 @@ export default function Home() { </li> <li> <Faq question="Do I need extra AI subscriptions to use OpenCode?"> - Not necessarily, but probably. You’ll need an AI subscription if you want to - connect OpenCode to a paid provider, although you can work with{" "} + Not necessarily, but probably. You’ll need an AI subscription if you want to connect OpenCode to a + paid provider, although you can work with{" "} <a href="/docs/providers/#lm-studio" target="_blank"> local models </a>{" "} - for free. While we encourage users to use <A href="/zen">Zen</A>, OpenCode works - with all popular providers such as OpenAI, Anthropic, xAI etc. + for free. While we encourage users to use <A href="/zen">Zen</A>, OpenCode works with all popular + providers such as OpenAI, Anthropic, xAI etc. </Faq> </li> <li> <Faq question="Can I only use OpenCode in the terminal?"> - Yes, for now. We are actively working on a desktop app. Join the waitlist for - early access. + Yes, for now. We are actively working on a desktop app. Join the waitlist for early access. </Faq> </li> <li> <Faq question="How much does OpenCode cost?"> - OpenCode is 100% free to use. Any additional costs will come from your - subscription to a model provider. While OpenCode works with any model provider, we - recommend using <A href="/zen">Zen</A>. + OpenCode is 100% free to use. Any additional costs will come from your subscription to a model + provider. While OpenCode works with any model provider, we recommend using <A href="/zen">Zen</A>. </Faq> </li> <li> <Faq question="What about data and privacy?"> - Your data and information is only stored when you create sharable links in - OpenCode. Learn more about <a href="/docs/share/#privacy">share pages</a>. + Your data and information is only stored when you create sharable links in OpenCode. Learn more about{" "} + <a href="/docs/share/#privacy">share pages</a>. </Faq> </li> <li> @@ -1211,8 +694,8 @@ export default function Home() { <a href={`${config.github.repoUrl}?tab=MIT-1-ov-file#readme`} target="_blank"> MIT License </a> - , meaning anyone can use, modify, or contribute to its development. Anyone from - the community can file issues, submit pull requests, and extend functionality. + , meaning anyone can use, modify, or contribute to its development. Anyone from the community can file + issues, submit pull requests, and extend functionality. </Faq> </li> </ul> @@ -1222,19 +705,13 @@ export default function Home() { <div data-slot="zen-cta-copy"> <strong>Access reliable optimized models for coding agents</strong> <p> - Zen gives you access to a handpicked set of AI models that OpenCode has tested and - benchmarked specifically for coding agents. No need to worry about inconsistent - performance and quality across providers, use validated models that work. + Zen gives you access to a handpicked set of AI models that OpenCode has tested and benchmarked + specifically for coding agents. No need to worry about inconsistent performance and quality across + providers, use validated models that work. </p> <div data-slot="model-logos"> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <mask id="mask0_79_128586" style="mask-type:luminance" @@ -1255,17 +732,8 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M13.7891 3.93164L20.2223 20.0677H23.7502L17.317 3.93164H13.7891Z" - fill="currentColor" - /> + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M13.7891 3.93164L20.2223 20.0677H23.7502L17.317 3.93164H13.7891Z" fill="currentColor" /> <path d="M6.32538 13.6824L8.52662 8.01177L10.7279 13.6824H6.32538ZM6.68225 3.93164L0.25 20.0677H3.84652L5.16202 16.6791H11.8914L13.2067 20.0677H16.8033L10.371 3.93164H6.68225Z" fill="currentColor" @@ -1273,13 +741,7 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9.16861 16.0529L17.2018 9.85156C17.5957 9.54755 18.1586 9.66612 18.3463 10.1384C19.3339 12.6288 18.8926 15.6217 16.9276 17.6766C14.9626 19.7314 12.2285 20.1821 9.72948 19.1557L6.9995 20.4775C10.9151 23.2763 15.6699 22.5841 18.6411 19.4749C20.9979 17.0103 21.7278 13.6508 21.0453 10.6214L21.0515 10.6278C20.0617 6.17736 21.2948 4.39847 23.8207 0.760904C23.8804 0.674655 23.9402 0.588405 24 0.5L20.6762 3.97585V3.96506L9.16658 16.0551" fill="currentColor" @@ -1291,13 +753,7 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" @@ -1307,13 +763,7 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12.6241 11.346L20.3848 3.44816C20.5309 3.29931 20.4487 3 20.2601 3H16.0842C16.0388 3 15.9949 3.01897 15.9594 3.05541L7.59764 11.5629C7.46721 11.6944 7.27446 11.5771 7.27446 11.3666V3.25183C7.27446 3.11242 7.18515 3 7.07594 3H4.19843C4.08932 3 4 3.11242 4 3.25183V20.7482C4 20.8876 4.08932 21 4.19843 21H7.07594C7.18515 21 7.27446 20.8876 7.27446 20.7482V17.1834C7.27446 17.1073 7.30136 17.0344 7.34815 16.987L9.94075 14.3486C10.0031 14.2853 10.0895 14.2757 10.159 14.3232L17.0934 19.5573C18.2289 20.3412 19.4975 20.8226 20.786 20.9652C20.9008 20.9778 21 20.8606 21 20.7133V17.3559C21 17.2276 20.9249 17.1232 20.8243 17.1073C20.0659 16.9853 19.326 16.6845 18.6569 16.222L12.6538 11.764C12.5291 11.6785 12.5135 11.4584 12.6241 11.346Z" fill="currentColor" @@ -1323,13 +773,7 @@ export default function Home() { </div> <A href="/zen"> <span>Learn about Zen </span> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6.5 12L17 12M13 16.5L17.5 12L13 7.5" stroke="currentColor" diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts index d8d857255..3260f31b2 100644 --- a/packages/console/app/src/routes/stripe/webhook.ts +++ b/packages/console/app/src/routes/stripe/webhook.ts @@ -41,8 +41,7 @@ export async function POST(input: APIEvent) { } if (body.type === "checkout.session.completed") { const workspaceID = body.data.object.metadata?.workspaceID - const amountInCents = - body.data.object.metadata?.amount && parseInt(body.data.object.metadata?.amount) + const amountInCents = body.data.object.metadata?.amount && parseInt(body.data.object.metadata?.amount) const customerID = body.data.object.customer as string const paymentID = body.data.object.payment_intent as string const invoiceID = body.data.object.invoice as string @@ -55,8 +54,7 @@ export async function POST(input: APIEvent) { await Actor.provide("system", { workspaceID }, async () => { const customer = await Billing.get() - if (customer?.customerID && customer.customerID !== customerID) - throw new Error("Customer ID mismatch") + if (customer?.customerID && customer.customerID !== customerID) throw new Error("Customer ID mismatch") // set customer metadata if (!customer?.customerID) { @@ -72,8 +70,7 @@ export async function POST(input: APIEvent) { expand: ["payment_method"], }) const paymentMethod = paymentIntent.payment_method - if (!paymentMethod || typeof paymentMethod === "string") - throw new Error("Payment method not expanded") + if (!paymentMethod || typeof paymentMethod === "string") throw new Error("Payment method not expanded") await Database.transaction(async (tx) => { await tx @@ -128,12 +125,7 @@ export async function POST(input: APIEvent) { amount: PaymentTable.amount, }) .from(PaymentTable) - .where( - and( - eq(PaymentTable.paymentID, paymentIntentID), - eq(PaymentTable.workspaceID, workspaceID), - ), - ) + .where(and(eq(PaymentTable.paymentID, paymentIntentID), eq(PaymentTable.workspaceID, workspaceID))) .then((rows) => rows[0]?.amount), ) if (!amount) throw new Error("Payment not found") @@ -144,12 +136,7 @@ export async function POST(input: APIEvent) { .set({ timeRefunded: new Date(body.created * 1000), }) - .where( - and( - eq(PaymentTable.paymentID, paymentIntentID), - eq(PaymentTable.workspaceID, workspaceID), - ), - ) + .where(and(eq(PaymentTable.paymentID, paymentIntentID), eq(PaymentTable.workspaceID, workspaceID))) await tx .update(BillingTable) diff --git a/packages/console/app/src/routes/temp.tsx b/packages/console/app/src/routes/temp.tsx index 59987e4d0..b0aef00e7 100644 --- a/packages/console/app/src/routes/temp.tsx +++ b/packages/console/app/src/routes/temp.tsx @@ -79,19 +79,17 @@ export default function Home() { <strong>LSP enabled</strong> Automatically loads the right LSPs for the LLM </li> <li> - <strong>opencode zen</strong> A <a href="/docs/zen">curated list of models</a>{" "} - provided by opencode <label>New</label> + <strong>opencode zen</strong> A <a href="/docs/zen">curated list of models</a> provided by opencode{" "} + <label>New</label> </li> <li> <strong>Multi-session</strong> Start multiple agents in parallel on the same project </li> <li> - <strong>Shareable links</strong> Share a link to any sessions for reference or to - debug + <strong>Shareable links</strong> Share a link to any sessions for reference or to debug </li> <li> - <strong>Claude Pro</strong> Log in with Anthropic to use your Claude Pro or Max - account + <strong>Claude Pro</strong> Log in with Anthropic to use your Claude Pro or Max account </li> <li> <strong>Use any model</strong> Supports 75+ LLM providers through{" "} diff --git a/packages/console/app/src/routes/workspace-picker.tsx b/packages/console/app/src/routes/workspace-picker.tsx index 4e218227c..fa8cf1d21 100644 --- a/packages/console/app/src/routes/workspace-picker.tsx +++ b/packages/console/app/src/routes/workspace-picker.tsx @@ -85,10 +85,7 @@ export function WorkspacePicker() { <Dropdown trigger={currentWorkspace()} align="left"> <For each={workspaces()}> {(workspace) => ( - <DropdownItem - selected={workspace.id === params.id} - onClick={() => handleSelectWorkspace(workspace.id)} - > + <DropdownItem selected={workspace.id === params.id} onClick={() => handleSelectWorkspace(workspace.id)}> {workspace.name || workspace.slug} </DropdownItem> )} @@ -98,11 +95,7 @@ export function WorkspacePicker() { </button> </Dropdown> - <Modal - open={store.showForm} - onClose={() => setStore("showForm", false)} - title="Create New Workspace" - > + <Modal open={store.showForm} onClose={() => setStore("showForm", false)} title="Create New Workspace"> <form data-slot="create-form" action={createWorkspace} method="post"> <div data-slot="create-input-group"> <input diff --git a/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx index 9e51bbe10..05f8edd01 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx @@ -133,8 +133,7 @@ export function BillingSection() { <div data-slot="section-title"> <h2>Billing</h2> <p> - Manage payments methods. <a href="mailto:[email protected]">Contact us</a> if you have any - questions. + Manage payments methods. <a href="mailto:[email protected]">Contact us</a> if you have any questions. </p> </div> <div data-slot="section-content"> @@ -164,32 +163,20 @@ export function BillingSection() { placeholder="Enter amount" /> <div data-slot="form-actions"> - <button - data-color="ghost" - type="button" - onClick={() => hideAddBalanceForm()} - > + <button data-color="ghost" type="button" onClick={() => hideAddBalanceForm()}> Cancel </button> <button data-color="primary" type="button" - disabled={ - !store.addBalanceAmount || - checkoutSubmission.pending || - store.checkoutRedirecting - } + disabled={!store.addBalanceAmount || checkoutSubmission.pending || store.checkoutRedirecting} onClick={onClickCheckout} > - {checkoutSubmission.pending || store.checkoutRedirecting - ? "Loading..." - : "Add"} + {checkoutSubmission.pending || store.checkoutRedirecting ? "Loading..." : "Add"} </button> </div> </div> - <Show - when={checkoutSubmission.result && (checkoutSubmission.result as any).error} - > + <Show when={checkoutSubmission.result && (checkoutSubmission.result as any).error}> {(err: any) => <div data-slot="form-error">{err()}</div>} </Show> </div> @@ -210,10 +197,7 @@ export function BillingSection() { <div data-slot="card-details"> <Switch> <Match when={billingInfo()?.paymentMethodType === "card"}> - <Show - when={billingInfo()?.paymentMethodLast4} - fallback={<span data-slot="number">----</span>} - > + <Show when={billingInfo()?.paymentMethodLast4} fallback={<span data-slot="number">----</span>}> <span data-slot="secret">••••</span> <span data-slot="number">{billingInfo()?.paymentMethodLast4}</span> </Show> @@ -241,9 +225,7 @@ export function BillingSection() { disabled={checkoutSubmission.pending || store.checkoutRedirecting} onClick={onClickCheckout} > - {checkoutSubmission.pending || store.checkoutRedirecting - ? "Loading..." - : "Enable Billing"} + {checkoutSubmission.pending || store.checkoutRedirecting ? "Loading..." : "Enable Billing"} </button> </Show> </div> diff --git a/packages/console/app/src/routes/workspace/[id]/billing/monthly-limit-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/monthly-limit-section.tsx index e6461ac83..77c017964 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/monthly-limit-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/monthly-limit-section.tsx @@ -104,13 +104,9 @@ export function MonthlyLimitSection() { </button> </Show> </div> - <Show - when={billingInfo()?.monthlyLimit} - fallback={<p data-slot="usage-status">No usage limit set.</p>} - > + <Show when={billingInfo()?.monthlyLimit} fallback={<p data-slot="usage-status">No usage limit set.</p>}> <p data-slot="usage-status"> - Current usage for{" "} - {new Date().toLocaleDateString("en-US", { month: "long", timeZone: "UTC" })} is $ + Current usage for {new Date().toLocaleDateString("en-US", { month: "long", timeZone: "UTC" })} is $ {(() => { const dateLastUsed = billingInfo()?.timeMonthlyUsageUpdated if (!dateLastUsed) return "0" diff --git a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx index a7218546d..0fb2a0df6 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx @@ -89,10 +89,7 @@ export function PaymentSection() { <td data-slot="payment-receipt"> <button onClick={async () => { - const receiptUrl = await downloadReceiptAction( - params.id, - payment.paymentID!, - ) + const receiptUrl = await downloadReceiptAction(params.id, payment.paymentID!) if (receiptUrl) { window.open(receiptUrl, "_blank") } diff --git a/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx index 50d00ef30..8dcc4da92 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx @@ -69,11 +69,7 @@ export function ReloadSection() { }) createEffect(() => { - if ( - !setReloadSubmission.pending && - setReloadSubmission.result && - !(setReloadSubmission.result as any).error - ) { + if (!setReloadSubmission.pending && setReloadSubmission.result && !(setReloadSubmission.result as any).error) { setStore("show", false) } }) @@ -108,8 +104,8 @@ export function ReloadSection() { } > <p> - Auto reload is <b>enabled</b>. We'll reload <b>${billingInfo()?.reloadAmount}</b>{" "} - (+$1.23 processing fee) when balance reaches <b>${billingInfo()?.reloadTrigger}</b>. + Auto reload is <b>enabled</b>. We'll reload <b>${billingInfo()?.reloadAmount}</b> (+$1.23 processing fee) + when balance reaches <b>${billingInfo()?.reloadTrigger}</b>. </p> </Show> <button data-color="primary" type="button" onClick={() => show()}> @@ -194,8 +190,8 @@ export function ReloadSection() { minute: "2-digit", second: "2-digit", })} - . Reason: {billingInfo()?.reloadError?.replace(/\.$/, "")}. Please update your payment - method and try again. + . Reason: {billingInfo()?.reloadError?.replace(/\.$/, "")}. Please update your payment method and try + again. </p> <form action={reload} method="post" data-slot="create-form"> <input type="hidden" name="workspaceID" value={params.id} /> diff --git a/packages/console/app/src/routes/workspace/[id]/index.tsx b/packages/console/app/src/routes/workspace/[id]/index.tsx index 2e7f7d64b..45f67ca38 100644 --- a/packages/console/app/src/routes/workspace/[id]/index.tsx +++ b/packages/console/app/src/routes/workspace/[id]/index.tsx @@ -51,9 +51,7 @@ export default function () { disabled={checkoutSubmission.pending || store.checkoutRedirecting} onClick={onClickCheckout} > - {checkoutSubmission.pending || store.checkoutRedirecting - ? "Loading..." - : "Enable billing"} + {checkoutSubmission.pending || store.checkoutRedirecting ? "Loading..." : "Enable billing"} </button> } > diff --git a/packages/console/app/src/routes/workspace/[id]/keys/key-section.tsx b/packages/console/app/src/routes/workspace/[id]/keys/key-section.tsx index e1c2c00cf..565981c7f 100644 --- a/packages/console/app/src/routes/workspace/[id]/keys/key-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/keys/key-section.tsx @@ -146,20 +146,14 @@ export function KeySection() { title="Copy API key" > <span>{key.keyDisplay}</span> - <Show - when={copied()} - fallback={<IconCopy style={{ width: "14px", height: "14px" }} />} - > + <Show when={copied()} fallback={<IconCopy style={{ width: "14px", height: "14px" }} />}> <IconCheck style={{ width: "14px", height: "14px" }} /> </Show> </button> </Show> </td> <td data-slot="key-user-email">{key.email}</td> - <td - data-slot="key-last-used" - title={key.timeUsed ? formatDateUTC(key.timeUsed) : undefined} - > + <td data-slot="key-last-used" title={key.timeUsed ? formatDateUTC(key.timeUsed) : undefined}> {key.timeUsed ? formatDateForTable(key.timeUsed) : "-"} </td> <td data-slot="key-actions"> diff --git a/packages/console/app/src/routes/workspace/[id]/members/member-section.tsx b/packages/console/app/src/routes/workspace/[id]/members/member-section.tsx index 4b2a12fdc..5aa1b969e 100644 --- a/packages/console/app/src/routes/workspace/[id]/members/member-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/members/member-section.tsx @@ -85,12 +85,7 @@ const updateMember = action(async (form: FormData) => { ) }, "member.update") -function MemberRow(props: { - member: any - workspaceID: string - actorID: string - actorRole: string -}) { +function MemberRow(props: { member: any; workspaceID: string; actorID: string; actorRole: string }) { const submission = useSubmission(updateMember) const isCurrentUser = () => props.actorID === props.member.id const isAdmin = () => props.actorRole === "admin" diff --git a/packages/console/app/src/routes/workspace/[id]/model-section.tsx b/packages/console/app/src/routes/workspace/[id]/model-section.tsx index 223d69fc8..7a1980ebe 100644 --- a/packages/console/app/src/routes/workspace/[id]/model-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/model-section.tsx @@ -5,15 +5,7 @@ import { withActor } from "~/context/auth.withActor" import { ZenData } from "@opencode-ai/console-core/model.js" import styles from "./model-section.module.css" import { querySessionInfo } from "../common" -import { - IconAlibaba, - IconAnthropic, - IconMoonshotAI, - IconOpenAI, - IconStealth, - IconXai, - IconZai, -} from "~/component/icon" +import { IconAlibaba, IconAnthropic, IconMoonshotAI, IconOpenAI, IconStealth, IconXai, IconZai } from "~/component/icon" const getModelLab = (modelId: string) => { if (modelId.startsWith("claude")) return "Anthropic" @@ -76,8 +68,7 @@ export function ModelSection() { <div data-slot="section-title"> <h2>Models</h2> <p> - Manage which models workspace members can access.{" "} - <a href="/docs/zen#pricing ">Learn more</a>. + Manage which models workspace members can access. <a href="/docs/zen#pricing ">Learn more</a>. </p> </div> <div data-slot="models-list"> diff --git a/packages/console/app/src/routes/workspace/[id]/new-user-section.tsx b/packages/console/app/src/routes/workspace/[id]/new-user-section.tsx index 7b949c661..65edc6847 100644 --- a/packages/console/app/src/routes/workspace/[id]/new-user-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/new-user-section.tsx @@ -43,24 +43,15 @@ export function NewUserSection() { <div data-component="feature-grid"> <div data-slot="feature"> <h3>Tested & Verified Models</h3> - <p> - We've benchmarked and tested models specifically for coding agents to ensure the best - performance. - </p> + <p>We've benchmarked and tested models specifically for coding agents to ensure the best performance.</p> </div> <div data-slot="feature"> <h3>Highest Quality</h3> - <p> - Access models configured for optimal performance - no downgrades or routing to cheaper - providers. - </p> + <p>Access models configured for optimal performance - no downgrades or routing to cheaper providers.</p> </div> <div data-slot="feature"> <h3>No Lock-in</h3> - <p> - Use Zen with any coding agent, and continue using other providers with opencode - whenever you want. - </p> + <p>Use Zen with any coding agent, and continue using other providers with opencode whenever you want.</p> </div> </div> diff --git a/packages/console/app/src/routes/workspace/[id]/provider-section.tsx b/packages/console/app/src/routes/workspace/[id]/provider-section.tsx index 67314fbdc..5419ed7fb 100644 --- a/packages/console/app/src/routes/workspace/[id]/provider-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/provider-section.tsx @@ -55,10 +55,7 @@ const listProviders = query(async (workspaceID: string) => { function ProviderRow(props: { provider: Provider }) { const params = useParams() const providers = createAsync(() => listProviders(params.id)) - const saveSubmission = useSubmission( - saveProvider, - ([fd]) => fd.get("provider")?.toString() === props.provider.key, - ) + const saveSubmission = useSubmission(saveProvider, ([fd]) => fd.get("provider")?.toString() === props.provider.key) const removeSubmission = useSubmission( removeProvider, ([fd]) => fd.get("provider")?.toString() === props.provider.key, @@ -94,16 +91,9 @@ function ProviderRow(props: { provider: Provider }) { <td data-slot="provider-key"> <Show when={store.editing} - fallback={ - <span>{providerData() ? maskCredentials(providerData()!.credentials) : "-"}</span> - } + fallback={<span>{providerData() ? maskCredentials(providerData()!.credentials) : "-"}</span>} > - <form - id={`provider-form-${props.provider.key}`} - action={saveProvider} - method="post" - data-slot="edit-form" - > + <form id={`provider-form-${props.provider.key}`} action={saveProvider} method="post" data-slot="edit-form"> <div data-slot="input-wrapper"> <input ref={(r) => (input = r)} diff --git a/packages/console/app/src/routes/workspace/common.tsx b/packages/console/app/src/routes/workspace/common.tsx index 5b638192c..a6eaaeb1e 100644 --- a/packages/console/app/src/routes/workspace/common.tsx +++ b/packages/console/app/src/routes/workspace/common.tsx @@ -67,10 +67,7 @@ export const querySessionInfo = query(async (workspaceID: string) => { return withActor(() => { return { isAdmin: Actor.userRole() === "admin", - isBeta: - Resource.App.stage === "production" - ? workspaceID === "wrk_01K46JDFR0E75SG2Q8K172KF3Y" - : true, + isBeta: Resource.App.stage === "production" ? workspaceID === "wrk_01K46JDFR0E75SG2Q8K172KF3Y" : true, } }, workspaceID) }, "session.get") diff --git a/packages/console/app/src/routes/zen/index.tsx b/packages/console/app/src/routes/zen/index.tsx index a096b52d7..4eab4dcb9 100644 --- a/packages/console/app/src/routes/zen/index.tsx +++ b/packages/console/app/src/routes/zen/index.tsx @@ -29,10 +29,7 @@ export default function Home() { createAsync(() => checkLoggedIn()) return ( <main data-page="zen"> - <HttpHeader - name="Cache-Control" - value="public, max-age=1, s-maxage=3600, stale-while-revalidate=86400" - /> + <HttpHeader name="Cache-Control" value="public, max-age=1, s-maxage=3600, stale-while-revalidate=86400" /> <Title>OpenCode Zen | A curated set of reliable optimized models for coding agents</Title> <Link rel="canonical" href={`${config.baseUrl}/zen`} /> <Link rel="icon" type="image/svg+xml" href="/favicon-zen.svg" /> @@ -49,19 +46,13 @@ export default function Home() { <img data-slot="zen logo dark" src={zenLogoDark} alt="zen logo dark" /> <h1>Reliable optimized models for coding agents</h1> <p> - Zen gives you access to a curated set of AI models that OpenCode has tested and - benchmarked specifically for coding agents. No need to worry about inconsistent - performance and quality, use validated models that work. + Zen gives you access to a curated set of AI models that OpenCode has tested and benchmarked specifically + for coding agents. No need to worry about inconsistent performance and quality, use validated models + that work. </p> <div data-slot="model-logos"> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <mask id="mask0_79_128586" style="mask-type:luminance" @@ -82,17 +73,8 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M13.7891 3.93164L20.2223 20.0677H23.7502L17.317 3.93164H13.7891Z" - fill="currentColor" - /> + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M13.7891 3.93164L20.2223 20.0677H23.7502L17.317 3.93164H13.7891Z" fill="currentColor" /> <path d="M6.32538 13.6824L8.52662 8.01177L10.7279 13.6824H6.32538ZM6.68225 3.93164L0.25 20.0677H3.84652L5.16202 16.6791H11.8914L13.2067 20.0677H16.8033L10.371 3.93164H6.68225Z" fill="currentColor" @@ -100,13 +82,7 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9.16861 16.0529L17.2018 9.85156C17.5957 9.54755 18.1586 9.66612 18.3463 10.1384C19.3339 12.6288 18.8926 15.6217 16.9276 17.6766C14.9626 19.7314 12.2285 20.1821 9.72948 19.1557L6.9995 20.4775C10.9151 23.2763 15.6699 22.5841 18.6411 19.4749C20.9979 17.0103 21.7278 13.6508 21.0453 10.6214L21.0515 10.6278C20.0617 6.17736 21.2948 4.39847 23.8207 0.760904C23.8804 0.674655 23.9402 0.588405 24 0.5L20.6762 3.97585V3.96506L9.16658 16.0551" fill="currentColor" @@ -118,13 +94,7 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" @@ -134,13 +104,7 @@ export default function Home() { </svg> </div> <div> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12.6241 11.346L20.3848 3.44816C20.5309 3.29931 20.4487 3 20.2601 3H16.0842C16.0388 3 15.9949 3.01897 15.9594 3.05541L7.59764 11.5629C7.46721 11.6944 7.27446 11.5771 7.27446 11.3666V3.25183C7.27446 3.11242 7.18515 3 7.07594 3H4.19843C4.08932 3 4 3.11242 4 3.25183V20.7482C4 20.8876 4.08932 21 4.19843 21H7.07594C7.18515 21 7.27446 20.8876 7.27446 20.7482V17.1834C7.27446 17.1073 7.30136 17.0344 7.34815 16.987L9.94075 14.3486C10.0031 14.2853 10.0895 14.2757 10.159 14.3232L17.0934 19.5573C18.2289 20.3412 19.4975 20.8226 20.786 20.9652C20.9008 20.9778 21 20.8606 21 20.7133V17.3559C21 17.2276 20.9249 17.1232 20.8243 17.1073C20.0659 16.9853 19.326 16.6845 18.6569 16.222L12.6538 11.764C12.5291 11.6785 12.5135 11.4584 12.6241 11.346Z" fill="currentColor" @@ -150,13 +114,7 @@ export default function Home() { </div> <a href="/auth"> <span>Get started with Zen </span> - <svg - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6.5 12L17 12M13 16.5L17.5 12L13 7.5" stroke="currentColor" @@ -168,23 +126,14 @@ export default function Home() { </div> <div data-slot="pricing-copy"> <p> - <strong>Add $20 Pay as you go balance</strong>{" "} - <span>(+$1.23 card processing fee)</span> + <strong>Add $20 Pay as you go balance</strong> <span>(+$1.23 card processing fee)</span> </p> <p>Use with any agent. Set monthly spend limits. Cancel any time.</p> </div> </section> <section data-component="comparison"> - <video - src={compareVideo} - autoplay - playsinline - loop - muted - preload="auto" - poster={compareVideoPoster} - > + <video src={compareVideo} autoplay playsinline loop muted preload="auto" poster={compareVideoPoster}> Your browser does not support the video tag. </video> </section> @@ -193,8 +142,8 @@ export default function Home() { <div data-slot="section-title"> <h3>What problem is Zen solving?</h3> <p> - There are so many models available, but only a few work well with coding agents. - Most providers configure them differently with varying results. + There are so many models available, but only a few work well with coding agents. Most providers + configure them differently with varying results. </p> </div> <p>We're fixing this for everyone, not just OpenCode users.</p> @@ -229,15 +178,14 @@ export default function Home() { <li> <span>[2]</span> <div> - <strong>Use Zen with transparent pricing</strong> -{" "} - <a href="/docs/zen/#pricing">pay per request</a> with zero markups + <strong>Use Zen with transparent pricing</strong> - <a href="/docs/zen/#pricing">pay per request</a>{" "} + with zero markups </div> </li> <li> <span>[3]</span> <div> - <strong>Auto-top up</strong> - when your balance reaches $5 we’ll automatically - add $20 + <strong>Auto-top up</strong> - when your balance reaches $5 we’ll automatically add $20 </div> </li> </ul> @@ -249,9 +197,8 @@ export default function Home() { <div> <span>[*]</span> <p> - All Zen models are hosted in the US. Providers follow a zero-retention policy and - do not use your data for model training, with the{" "} - <a href="/docs/zen/#privacy">following exceptions</a>. + All Zen models are hosted in the US. Providers follow a zero-retention policy and do not use your data + for model training, with the <a href="/docs/zen/#privacy">following exceptions</a>. </p> </div> </div> @@ -306,8 +253,7 @@ export default function Home() { <span>ex-Head of Design, Laravel</span> </div> <div data-slot="quote"> - With <span>@OpenCode</span> Zen I know all the models are tested and perfect for - coding agents. + With <span>@OpenCode</span> Zen I know all the models are tested and perfect for coding agents. </div> </div> </a> @@ -331,44 +277,38 @@ export default function Home() { <ul> <li> <Faq question="What is OpenCode Zen?"> - Zen is a curated set of AI models tested and benchmarked for coding agents created - by the team behind OpenCode. + Zen is a curated set of AI models tested and benchmarked for coding agents created by the team behind + OpenCode. </Faq> </li> <li> <Faq question="What makes Zen more accurate?"> - Zen only provides models that have been specifically tested and benchmarked for - coding agents. You wouldn’t use a butter knife to cut steak, don’t use poor models - for coding. + Zen only provides models that have been specifically tested and benchmarked for coding agents. You + wouldn’t use a butter knife to cut steak, don’t use poor models for coding. </Faq> </li> <li> <Faq question="Is Zen cheaper?"> - Zen is not for profit. Zen passes through the costs from the model providers to - you. The higher Zen’s usage the more OpenCode can negotiate better rates and pass - those to you. + Zen is not for profit. Zen passes through the costs from the model providers to you. The higher Zen’s + usage the more OpenCode can negotiate better rates and pass those to you. </Faq> </li> <li> <Faq question="How much does Zen cost?"> - Zen <a href="/docs/zen/#pricing">charges per request</a> with zero markups, so you - pay exactly what the model provider charges. Your total cost depends on usage, and - you can set monthly spend limits in your <a href="/auth">account</a>. To cover - costs, OpenCode adds only a small payment processing fee of $1.23 per $20 balance - top-up. + Zen <a href="/docs/zen/#pricing">charges per request</a> with zero markups, so you pay exactly what + the model provider charges. Your total cost depends on usage, and you can set monthly spend limits in + your <a href="/auth">account</a>. To cover costs, OpenCode adds only a small payment processing fee of + $1.23 per $20 balance top-up. </Faq> </li> <li> <Faq question="What about data and privacy?"> - All Zen models are hosted in the US. Providers follow a zero-retention policy and - do not use your data for model training, with the{" "} - <a href="/docs/zen/#privacy">following exceptions</a>. + All Zen models are hosted in the US. Providers follow a zero-retention policy and do not use your data + for model training, with the <a href="/docs/zen/#privacy">following exceptions</a>. </Faq> </li> <li> - <Faq question="Can I set spend limits?"> - Yes, you can set monthly spending limits in your account. - </Faq> + <Faq question="Can I set spend limits?">Yes, you can set monthly spending limits in your account.</Faq> </li> <li> <Faq question="Can I cancel?"> @@ -377,8 +317,8 @@ export default function Home() { </li> <li> <Faq question="Can I use Zen with other coding agents?"> - While Zen works great with OpenCode, you can use Zen with any agent. Follow the - setup instructions in your preferred coding agent. + While Zen works great with OpenCode, you can use Zen with any agent. Follow the setup instructions in + your preferred coding agent. </Faq> </li> </ul> diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index deab7ded2..194a7c71e 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -13,11 +13,7 @@ import { ModelTable } from "@opencode-ai/console-core/schema/model.sql.js" import { ProviderTable } from "@opencode-ai/console-core/schema/provider.sql.js" import { logger } from "./logger" import { AuthError, CreditsError, MonthlyLimitError, UserLimitError, ModelError } from "./error" -import { - createBodyConverter, - createStreamPartConverter, - createResponseConverter, -} from "./provider/provider" +import { createBodyConverter, createStreamPartConverter, createResponseConverter } from "./provider/provider" import { anthropicHelper } from "./provider/anthropic" import { openaiHelper } from "./provider/openai" import { oaCompatHelper } from "./provider/openai-compatible" @@ -46,11 +42,7 @@ export async function handler( }) const zenData = ZenData.list() const modelInfo = validateModel(zenData, body.model) - const providerInfo = selectProvider( - zenData, - modelInfo, - input.request.headers.get("x-real-ip") ?? "", - ) + const providerInfo = selectProvider(zenData, modelInfo, input.request.headers.get("x-real-ip") ?? "") const authInfo = await authenticate(modelInfo, providerInfo) validateBilling(modelInfo, authInfo) validateModelSettings(authInfo) @@ -229,11 +221,7 @@ export async function handler( return { id: modelId, ...modelData } } - function selectProvider( - zenData: ZenData, - model: Awaited<ReturnType<typeof validateModel>>, - ip: string, - ) { + function selectProvider(zenData: ZenData, model: Awaited<ReturnType<typeof validateModel>>, ip: string) { const providers = model.providers .filter((provider) => !provider.disabled) .flatMap((provider) => Array<typeof provider>(provider.weight ?? 1).fill(provider)) @@ -252,11 +240,7 @@ export async function handler( return { ...provider, ...zenData.providers[provider.id], - ...(format === "anthropic" - ? anthropicHelper - : format === "openai" - ? openaiHelper - : oaCompatHelper), + ...(format === "anthropic" ? anthropicHelper : format === "openai" ? openaiHelper : oaCompatHelper), } } @@ -297,20 +281,11 @@ export async function handler( .from(KeyTable) .innerJoin(WorkspaceTable, eq(WorkspaceTable.id, KeyTable.workspaceID)) .innerJoin(BillingTable, eq(BillingTable.workspaceID, KeyTable.workspaceID)) - .innerJoin( - UserTable, - and(eq(UserTable.workspaceID, KeyTable.workspaceID), eq(UserTable.id, KeyTable.userID)), - ) - .leftJoin( - ModelTable, - and(eq(ModelTable.workspaceID, KeyTable.workspaceID), eq(ModelTable.model, model.id)), - ) + .innerJoin(UserTable, and(eq(UserTable.workspaceID, KeyTable.workspaceID), eq(UserTable.id, KeyTable.userID))) + .leftJoin(ModelTable, and(eq(ModelTable.workspaceID, KeyTable.workspaceID), eq(ModelTable.model, model.id))) .leftJoin( ProviderTable, - and( - eq(ProviderTable.workspaceID, KeyTable.workspaceID), - eq(ProviderTable.provider, providerInfo.id), - ), + and(eq(ProviderTable.workspaceID, KeyTable.workspaceID), eq(ProviderTable.provider, providerInfo.id)), ) .where(and(eq(KeyTable.key, apiKey), isNull(KeyTable.timeDeleted))) .then((rows) => rows[0]), @@ -401,19 +376,12 @@ export async function handler( providerInfo: Awaited<ReturnType<typeof selectProvider>>, usage: any, ) { - const { - inputTokens, - outputTokens, - reasoningTokens, - cacheReadTokens, - cacheWrite5mTokens, - cacheWrite1hTokens, - } = providerInfo.normalizeUsage(usage) + const { inputTokens, outputTokens, reasoningTokens, cacheReadTokens, cacheWrite5mTokens, cacheWrite1hTokens } = + providerInfo.normalizeUsage(usage) const modelCost = modelInfo.cost200K && - inputTokens + (cacheReadTokens ?? 0) + (cacheWrite5mTokens ?? 0) + (cacheWrite1hTokens ?? 0) > - 200_000 + inputTokens + (cacheReadTokens ?? 0) + (cacheWrite5mTokens ?? 0) + (cacheWrite1hTokens ?? 0) > 200_000 ? modelInfo.cost200K : modelInfo.cost @@ -464,8 +432,7 @@ export async function handler( if (!authInfo) return - const cost = - authInfo.isFree || authInfo.provider?.credentials ? 0 : centsToMicroCents(totalCostInCent) + const cost = authInfo.isFree || authInfo.provider?.credentials ? 0 : centsToMicroCents(totalCostInCent) await Database.transaction(async (tx) => { await tx.insert(UsageTable).values({ workspaceID: authInfo.workspaceID, @@ -505,9 +472,7 @@ export async function handler( `, timeMonthlyUsageUpdated: sql`now()`, }) - .where( - and(eq(UserTable.workspaceID, authInfo.workspaceID), eq(UserTable.id, authInfo.user.id)), - ) + .where(and(eq(UserTable.workspaceID, authInfo.workspaceID), eq(UserTable.id, authInfo.user.id))) }) await Database.use((tx) => @@ -537,10 +502,7 @@ export async function handler( BillingTable.balance, centsToMicroCents((authInfo.billing.reloadTrigger ?? Billing.RELOAD_TRIGGER) * 100), ), - or( - isNull(BillingTable.timeReloadLockedTill), - lt(BillingTable.timeReloadLockedTill, sql`now()`), - ), + or(isNull(BillingTable.timeReloadLockedTill), lt(BillingTable.timeReloadLockedTill, sql`now()`)), ), ), ) diff --git a/packages/console/app/src/routes/zen/util/provider/anthropic.ts b/packages/console/app/src/routes/zen/util/provider/anthropic.ts index f4e8dc44d..d8d1cd741 100644 --- a/packages/console/app/src/routes/zen/util/provider/anthropic.ts +++ b/packages/console/app/src/routes/zen/util/provider/anthropic.ts @@ -123,15 +123,12 @@ export function fromAnthropicRequest(body: any): CommonRequest { if ((p as any).type === "tool_result") { const id = (p as any).tool_use_id const content = - typeof (p as any).content === "string" - ? (p as any).content - : JSON.stringify((p as any).content) + typeof (p as any).content === "string" ? (p as any).content : JSON.stringify((p as any).content) msgs.push({ role: "tool", tool_call_id: id, content }) } } if (partsOut.length > 0) { - if (partsOut.length === 1 && partsOut[0].type === "text") - msgs.push({ role: "user", content: partsOut[0].text }) + if (partsOut.length === 1 && partsOut[0].type === "text") msgs.push({ role: "user", content: partsOut[0].text }) else msgs.push({ role: "user", content: partsOut }) } continue @@ -143,8 +140,7 @@ export function fromAnthropicRequest(body: any): CommonRequest { const tcs: any[] = [] for (const p of partsIn) { if (!p || !(p as any).type) continue - if ((p as any).type === "text" && typeof (p as any).text === "string") - texts.push((p as any).text) + if ((p as any).type === "text" && typeof (p as any).text === "string") texts.push((p as any).text) if ((p as any).type === "tool_use") { const name = (p as any).name const id = (p as any).id @@ -214,9 +210,7 @@ export function fromAnthropicRequest(body: any): CommonRequest { export function toAnthropicRequest(body: CommonRequest) { if (!body || typeof body !== "object") return body - const sysIn = Array.isArray(body.messages) - ? body.messages.filter((m: any) => m && m.role === "system") - : [] + const sysIn = Array.isArray(body.messages) ? body.messages.filter((m: any) => m && m.role === "system") : [] let ccCount = 0 const cc = () => { ccCount++ @@ -367,9 +361,7 @@ export function fromAnthropicResponse(resp: any): CommonResponse { const idIn = (resp as any).id const id = - typeof idIn === "string" - ? idIn.replace(/^msg_/, "chatcmpl_") - : `chatcmpl_${Math.random().toString(36).slice(2)}` + typeof idIn === "string" ? idIn.replace(/^msg_/, "chatcmpl_") : `chatcmpl_${Math.random().toString(36).slice(2)}` const model = (resp as any).model const blocks: any[] = Array.isArray((resp as any).content) ? (resp as any).content : [] @@ -412,9 +404,7 @@ export function fromAnthropicResponse(resp: any): CommonResponse { const ct = typeof (u as any).output_tokens === "number" ? (u as any).output_tokens : undefined const total = pt != null && ct != null ? pt + ct : undefined const cached = - typeof (u as any).cache_read_input_tokens === "number" - ? (u as any).cache_read_input_tokens - : undefined + typeof (u as any).cache_read_input_tokens === "number" ? (u as any).cache_read_input_tokens : undefined const details = cached != null ? { cached_tokens: cached } : undefined return { prompt_tokens: pt, @@ -591,9 +581,7 @@ export function fromAnthropicChunk(chunk: string): CommonChunk | string { prompt_tokens: u.input_tokens, completion_tokens: u.output_tokens, total_tokens: (u.input_tokens || 0) + (u.output_tokens || 0), - ...(u.cache_read_input_tokens - ? { prompt_tokens_details: { cached_tokens: u.cache_read_input_tokens } } - : {}), + ...(u.cache_read_input_tokens ? { prompt_tokens_details: { cached_tokens: u.cache_read_input_tokens } } : {}), } } diff --git a/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts b/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts index d69985728..8a9170ef1 100644 --- a/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts +++ b/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts @@ -57,8 +57,7 @@ export const oaCompatHelper = { const inputTokens = usage.prompt_tokens ?? 0 const outputTokens = usage.completion_tokens ?? 0 const reasoningTokens = usage.completion_tokens_details?.reasoning_tokens ?? undefined - const cacheReadTokens = - usage.cached_tokens ?? usage.prompt_tokens_details?.cached_tokens ?? undefined + const cacheReadTokens = usage.cached_tokens ?? usage.prompt_tokens_details?.cached_tokens ?? undefined return { inputTokens: inputTokens - (cacheReadTokens ?? 0), outputTokens, @@ -80,8 +79,7 @@ export function fromOaCompatibleRequest(body: any): CommonRequest { if (!m || !m.role) continue if (m.role === "system") { - if (typeof m.content === "string" && m.content.length > 0) - msgsOut.push({ role: "system", content: m.content }) + if (typeof m.content === "string" && m.content.length > 0) msgsOut.push({ role: "system", content: m.content }) continue } @@ -92,12 +90,10 @@ export function fromOaCompatibleRequest(body: any): CommonRequest { const parts: any[] = [] for (const p of m.content) { if (!p || !p.type) continue - if (p.type === "text" && typeof p.text === "string") - parts.push({ type: "text", text: p.text }) + if (p.type === "text" && typeof p.text === "string") parts.push({ type: "text", text: p.text }) if (p.type === "image_url") parts.push({ type: "image_url", image_url: p.image_url }) } - if (parts.length === 1 && parts[0].type === "text") - msgsOut.push({ role: "user", content: parts[0].text }) + if (parts.length === 1 && parts[0].type === "text") msgsOut.push({ role: "user", content: parts[0].text }) else if (parts.length > 0) msgsOut.push({ role: "user", content: parts }) } continue @@ -141,8 +137,7 @@ export function toOaCompatibleRequest(body: CommonRequest) { if (p.type === "image_url" && p.image_url) return { type: "image_url", image_url: p.image_url } const s = (p as any).source if (!s || typeof s !== "object") return undefined - if (s.type === "url" && typeof s.url === "string") - return { type: "image_url", image_url: { url: s.url } } + if (s.type === "url" && typeof s.url === "string") return { type: "image_url", image_url: { url: s.url } } if (s.type === "base64" && typeof s.media_type === "string" && typeof s.data === "string") return { type: "image_url", image_url: { url: `data:${s.media_type};base64,${s.data}` } } return undefined @@ -152,8 +147,7 @@ export function toOaCompatibleRequest(body: CommonRequest) { if (!m || !m.role) continue if (m.role === "system") { - if (typeof m.content === "string" && m.content.length > 0) - msgsOut.push({ role: "system", content: m.content }) + if (typeof m.content === "string" && m.content.length > 0) msgsOut.push({ role: "system", content: m.content }) continue } @@ -166,13 +160,11 @@ export function toOaCompatibleRequest(body: CommonRequest) { const parts: any[] = [] for (const p of m.content) { if (!p || !p.type) continue - if (p.type === "text" && typeof p.text === "string") - parts.push({ type: "text", text: p.text }) + if (p.type === "text" && typeof p.text === "string") parts.push({ type: "text", text: p.text }) const ip = toImg(p) if (ip) parts.push(ip) } - if (parts.length === 1 && parts[0].type === "text") - msgsOut.push({ role: "user", content: parts[0].text }) + if (parts.length === 1 && parts[0].type === "text") msgsOut.push({ role: "user", content: parts[0].text }) else if (parts.length > 0) msgsOut.push({ role: "user", content: parts }) } continue @@ -325,9 +317,7 @@ export function toOaCompatibleResponse(resp: CommonResponse) { const idIn = (resp as any).id const id = - typeof idIn === "string" - ? idIn.replace(/^msg_/, "chatcmpl_") - : `chatcmpl_${Math.random().toString(36).slice(2)}` + typeof idIn === "string" ? idIn.replace(/^msg_/, "chatcmpl_") : `chatcmpl_${Math.random().toString(36).slice(2)}` const model = (resp as any).model const blocks: any[] = Array.isArray((resp as any).content) ? (resp as any).content : [] @@ -369,8 +359,7 @@ export function toOaCompatibleResponse(resp: CommonResponse) { const pt = typeof u.input_tokens === "number" ? u.input_tokens : undefined const ct = typeof u.output_tokens === "number" ? u.output_tokens : undefined const total = pt != null && ct != null ? pt + ct : undefined - const cached = - typeof u.cache_read_input_tokens === "number" ? u.cache_read_input_tokens : undefined + const cached = typeof u.cache_read_input_tokens === "number" ? u.cache_read_input_tokens : undefined const details = cached != null ? { cached_tokens: cached } : undefined return { prompt_tokens: pt, diff --git a/packages/console/app/src/routes/zen/util/provider/openai.ts b/packages/console/app/src/routes/zen/util/provider/openai.ts index fa0776b7a..e79e83579 100644 --- a/packages/console/app/src/routes/zen/util/provider/openai.ts +++ b/packages/console/app/src/routes/zen/util/provider/openai.ts @@ -86,11 +86,7 @@ export function fromOpenaiRequest(body: any): CommonRequest { const msgs: any[] = [] - const inMsgs = Array.isArray(body.input) - ? body.input - : Array.isArray(body.messages) - ? body.messages - : [] + const inMsgs = Array.isArray(body.input) ? body.input : Array.isArray(body.messages) ? body.messages : [] for (const m of inMsgs) { if (!m) continue @@ -103,9 +99,7 @@ export function fromOpenaiRequest(body: any): CommonRequest { const args = typeof a === "string" ? a : JSON.stringify(a ?? {}) msgs.push({ role: "assistant", - tool_calls: [ - { id: (m as any).id, type: "function", function: { name, arguments: args } }, - ], + tool_calls: [{ id: (m as any).id, type: "function", function: { name, arguments: args } }], }) } if ((m as any).type === "function_call_output") { @@ -122,8 +116,7 @@ export function fromOpenaiRequest(body: any): CommonRequest { if (typeof c === "string" && c.length > 0) msgs.push({ role: "system", content: c }) if (Array.isArray(c)) { const t = c.find((p: any) => p && typeof p.text === "string") - if (t && typeof t.text === "string" && t.text.length > 0) - msgs.push({ role: "system", content: t.text }) + if (t && typeof t.text === "string" && t.text.length > 0) msgs.push({ role: "system", content: t.text }) } continue } @@ -136,24 +129,18 @@ export function fromOpenaiRequest(body: any): CommonRequest { const parts: any[] = [] for (const p of c) { if (!p || !(p as any).type) continue - if ( - ((p as any).type === "text" || (p as any).type === "input_text") && - typeof (p as any).text === "string" - ) + if (((p as any).type === "text" || (p as any).type === "input_text") && typeof (p as any).text === "string") parts.push({ type: "text", text: (p as any).text }) const ip = toImg(p) if (ip) parts.push(ip) if ((p as any).type === "tool_result") { const id = (p as any).tool_call_id const content = - typeof (p as any).content === "string" - ? (p as any).content - : JSON.stringify((p as any).content) + typeof (p as any).content === "string" ? (p as any).content : JSON.stringify((p as any).content) msgs.push({ role: "tool", tool_call_id: id, content }) } } - if (parts.length === 1 && parts[0].type === "text") - msgs.push({ role: "user", content: parts[0].text }) + if (parts.length === 1 && parts[0].type === "text") msgs.push({ role: "user", content: parts[0].text }) else if (parts.length > 0) msgs.push({ role: "user", content: parts }) } continue @@ -280,10 +267,7 @@ export function toOpenaiRequest(body: CommonRequest) { } if ((m as any).role === "tool") { - const out = - typeof (m as any).content === "string" - ? (m as any).content - : JSON.stringify((m as any).content) + const out = typeof (m as any).content === "string" ? (m as any).content : JSON.stringify((m as any).content) input.push({ type: "function_call_output", call_id: (m as any).tool_call_id, output: out }) continue } @@ -351,9 +335,7 @@ export function fromOpenaiResponse(resp: any): CommonResponse { const idIn = (r as any).id const id = - typeof idIn === "string" - ? idIn.replace(/^resp_/, "chatcmpl_") - : `chatcmpl_${Math.random().toString(36).slice(2)}` + typeof idIn === "string" ? idIn.replace(/^resp_/, "chatcmpl_") : `chatcmpl_${Math.random().toString(36).slice(2)}` const model = (r as any).model ?? (resp as any).model const out = Array.isArray((r as any).output) ? (r as any).output : [] @@ -480,9 +462,7 @@ export function toOpenaiResponse(resp: CommonResponse) { })() return { - id: - (resp as any).id?.replace(/^chatcmpl_/, "resp_") ?? - `resp_${Math.random().toString(36).slice(2)}`, + id: (resp as any).id?.replace(/^chatcmpl_/, "resp_") ?? `resp_${Math.random().toString(36).slice(2)}`, object: "response", model: (resp as any).model, output: outputItems, diff --git a/packages/console/app/src/routes/zen/v1/models.ts b/packages/console/app/src/routes/zen/v1/models.ts index 3d0c31470..ee2b3ab54 100644 --- a/packages/console/app/src/routes/zen/v1/models.ts +++ b/packages/console/app/src/routes/zen/v1/models.ts @@ -50,10 +50,7 @@ export async function GET(input: APIEvent) { }) .from(KeyTable) .innerJoin(WorkspaceTable, eq(WorkspaceTable.id, KeyTable.workspaceID)) - .leftJoin( - ModelTable, - and(eq(ModelTable.workspaceID, KeyTable.workspaceID), isNull(ModelTable.timeDeleted)), - ) + .leftJoin(ModelTable, and(eq(ModelTable.workspaceID, KeyTable.workspaceID), isNull(ModelTable.timeDeleted))) .where(and(eq(KeyTable.key, apiKey), isNull(KeyTable.timeDeleted))) .then((rows) => rows.map((row) => row.model)), ) diff --git a/packages/console/app/src/style/token/font.css b/packages/console/app/src/style/token/font.css index dc0d298f1..67143e662 100644 --- a/packages/console/app/src/style/token/font.css +++ b/packages/console/app/src/style/token/font.css @@ -15,7 +15,6 @@ body { --font-size-9xl: 8rem; --font-mono: - "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", - "Courier New", monospace; + "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --font-sans: var(--font-mono); } diff --git a/packages/console/core/script/lookup-user.ts b/packages/console/core/script/lookup-user.ts index af9bcc3a1..1ae18c4dd 100644 --- a/packages/console/core/script/lookup-user.ts +++ b/packages/console/core/script/lookup-user.ts @@ -8,22 +8,15 @@ if (!email) { process.exit(1) } -const authData = await printTable("Auth", (tx) => - tx.select().from(AuthTable).where(eq(AuthTable.subject, email)), -) +const authData = await printTable("Auth", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.subject, email))) if (authData.length === 0) { console.error("User not found") process.exit(1) } -await printTable("Auth", (tx) => - tx.select().from(AuthTable).where(eq(AuthTable.accountID, authData[0].accountID)), -) +await printTable("Auth", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.accountID, authData[0].accountID))) -function printTable( - title: string, - callback: (tx: Database.TxOrDb) => Promise<any[]>, -): Promise<any[]> { +function printTable(title: string, callback: (tx: Database.TxOrDb) => Promise<any[]>): Promise<any[]> { return Database.use(async (tx) => { const data = await callback(tx) console.log(`== ${title} ==`) diff --git a/packages/console/core/script/reset-db.ts b/packages/console/core/script/reset-db.ts index bd00e1962..02d498901 100644 --- a/packages/console/core/script/reset-db.ts +++ b/packages/console/core/script/reset-db.ts @@ -8,14 +8,6 @@ import { KeyTable } from "../src/schema/key.sql.js" if (Resource.App.stage !== "frank") throw new Error("This script is only for frank") -for (const table of [ - AccountTable, - BillingTable, - KeyTable, - PaymentTable, - UsageTable, - UserTable, - WorkspaceTable, -]) { +for (const table of [AccountTable, BillingTable, KeyTable, PaymentTable, UsageTable, UserTable, WorkspaceTable]) { await Database.use((tx) => tx.delete(table)) } diff --git a/packages/console/core/src/aws.ts b/packages/console/core/src/aws.ts index ce4a20f44..e87ada6ef 100644 --- a/packages/console/core/src/aws.ts +++ b/packages/console/core/src/aws.ts @@ -24,40 +24,37 @@ export namespace AWS { body: z.string(), }), async (input) => { - const res = await createClient().fetch( - "https://email.us-east-1.amazonaws.com/v2/email/outbound-emails", - { - method: "POST", - headers: { - "X-Amz-Target": "SES.SendEmail", - "Content-Type": "application/json", + const res = await createClient().fetch("https://email.us-east-1.amazonaws.com/v2/email/outbound-emails", { + method: "POST", + headers: { + "X-Amz-Target": "SES.SendEmail", + "Content-Type": "application/json", + }, + body: JSON.stringify({ + FromEmailAddress: `OpenCode Zen <[email protected]>`, + Destination: { + ToAddresses: [input.to], }, - body: JSON.stringify({ - FromEmailAddress: `OpenCode Zen <[email protected]>`, - Destination: { - ToAddresses: [input.to], - }, - Content: { - Simple: { - Subject: { + Content: { + Simple: { + Subject: { + Charset: "UTF-8", + Data: input.subject, + }, + Body: { + Text: { Charset: "UTF-8", - Data: input.subject, + Data: input.body, }, - Body: { - Text: { - Charset: "UTF-8", - Data: input.body, - }, - Html: { - Charset: "UTF-8", - Data: input.body, - }, + Html: { + Charset: "UTF-8", + Data: input.body, }, }, }, - }), - }, - ) + }, + }), + }) if (!res.ok) { throw new Error(`Failed to send email: ${res.statusText}`) } diff --git a/packages/console/core/src/drizzle/index.ts b/packages/console/core/src/drizzle/index.ts index 8b37b1f9c..f0f065de4 100644 --- a/packages/console/core/src/drizzle/index.ts +++ b/packages/console/core/src/drizzle/index.ts @@ -5,10 +5,7 @@ import { Client } from "@planetscale/database" import { MySqlTransaction, type MySqlTransactionConfig } from "drizzle-orm/mysql-core" import type { ExtractTablesWithRelations } from "drizzle-orm" -import type { - PlanetScalePreparedQueryHKT, - PlanetscaleQueryResultHKT, -} from "drizzle-orm/planetscale-serverless" +import type { PlanetScalePreparedQueryHKT, PlanetscaleQueryResultHKT } from "drizzle-orm/planetscale-serverless" import { Context } from "../context" import { memo } from "../util/memo" @@ -70,10 +67,7 @@ export namespace Database { } } - export async function transaction<T>( - callback: (tx: TxOrDb) => Promise<T>, - config?: MySqlTransactionConfig, - ) { + export async function transaction<T>(callback: (tx: TxOrDb) => Promise<T>, config?: MySqlTransactionConfig) { try { const { tx } = TransactionContext.use() return callback(tx) diff --git a/packages/console/core/src/key.ts b/packages/console/core/src/key.ts index 6396fd0b8..688f19b3d 100644 --- a/packages/console/core/src/key.ts +++ b/packages/console/core/src/key.ts @@ -20,14 +20,8 @@ export namespace Key { email: AuthTable.subject, }) .from(KeyTable) - .innerJoin( - UserTable, - and(eq(KeyTable.userID, UserTable.id), eq(KeyTable.workspaceID, UserTable.workspaceID)), - ) - .innerJoin( - AuthTable, - and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")), - ) + .innerJoin(UserTable, and(eq(KeyTable.userID, UserTable.id), eq(KeyTable.workspaceID, UserTable.workspaceID))) + .innerJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email"))) .where( and( ...[ diff --git a/packages/console/core/src/model.ts b/packages/console/core/src/model.ts index 30cc15e45..ea719534d 100644 --- a/packages/console/core/src/model.ts +++ b/packages/console/core/src/model.ts @@ -60,9 +60,7 @@ export namespace Model { export const enable = fn(z.object({ model: z.string() }), ({ model }) => { Actor.assertAdmin() return Database.use((db) => - db - .delete(ModelTable) - .where(and(eq(ModelTable.workspaceID, Actor.workspace()), eq(ModelTable.model, model))), + db.delete(ModelTable).where(and(eq(ModelTable.workspaceID, Actor.workspace()), eq(ModelTable.model, model))), ) }) diff --git a/packages/console/core/src/provider.ts b/packages/console/core/src/provider.ts index 0af642f71..cf2040b59 100644 --- a/packages/console/core/src/provider.ts +++ b/packages/console/core/src/provider.ts @@ -11,9 +11,7 @@ export namespace Provider { tx .select() .from(ProviderTable) - .where( - and(eq(ProviderTable.workspaceID, Actor.workspace()), isNull(ProviderTable.timeDeleted)), - ), + .where(and(eq(ProviderTable.workspaceID, Actor.workspace()), isNull(ProviderTable.timeDeleted))), ), ) @@ -52,12 +50,7 @@ export namespace Provider { return Database.transaction((tx) => tx .delete(ProviderTable) - .where( - and( - eq(ProviderTable.provider, provider), - eq(ProviderTable.workspaceID, Actor.workspace()), - ), - ), + .where(and(eq(ProviderTable.provider, provider), eq(ProviderTable.workspaceID, Actor.workspace()))), ) }, ) diff --git a/packages/console/core/src/schema/auth.sql.ts b/packages/console/core/src/schema/auth.sql.ts index d55e605aa..27c926d6f 100644 --- a/packages/console/core/src/schema/auth.sql.ts +++ b/packages/console/core/src/schema/auth.sql.ts @@ -1,11 +1,4 @@ -import { - index, - mysqlEnum, - mysqlTable, - primaryKey, - uniqueIndex, - varchar, -} from "drizzle-orm/mysql-core" +import { index, mysqlEnum, mysqlTable, primaryKey, uniqueIndex, varchar } from "drizzle-orm/mysql-core" import { id, timestamps, ulid } from "../drizzle/types" export const AuthProvider = ["email", "github", "google"] as const diff --git a/packages/console/core/src/schema/model.sql.ts b/packages/console/core/src/schema/model.sql.ts index 343b0c4f3..1c032aad2 100644 --- a/packages/console/core/src/schema/model.sql.ts +++ b/packages/console/core/src/schema/model.sql.ts @@ -9,8 +9,5 @@ export const ModelTable = mysqlTable( ...timestamps, model: varchar("model", { length: 64 }).notNull(), }, - (table) => [ - ...workspaceIndexes(table), - uniqueIndex("model_workspace_model").on(table.workspaceID, table.model), - ], + (table) => [...workspaceIndexes(table), uniqueIndex("model_workspace_model").on(table.workspaceID, table.model)], ) diff --git a/packages/console/core/src/schema/provider.sql.ts b/packages/console/core/src/schema/provider.sql.ts index 04d11e2e5..11be5b4d7 100644 --- a/packages/console/core/src/schema/provider.sql.ts +++ b/packages/console/core/src/schema/provider.sql.ts @@ -10,8 +10,5 @@ export const ProviderTable = mysqlTable( provider: varchar("provider", { length: 64 }).notNull(), credentials: text("credentials").notNull(), }, - (table) => [ - ...workspaceIndexes(table), - uniqueIndex("workspace_provider").on(table.workspaceID, table.provider), - ], + (table) => [...workspaceIndexes(table), uniqueIndex("workspace_provider").on(table.workspaceID, table.provider)], ) diff --git a/packages/console/core/src/schema/user.sql.ts b/packages/console/core/src/schema/user.sql.ts index ce5b6c53e..7fd7f5e1e 100644 --- a/packages/console/core/src/schema/user.sql.ts +++ b/packages/console/core/src/schema/user.sql.ts @@ -1,12 +1,4 @@ -import { - mysqlTable, - uniqueIndex, - varchar, - int, - mysqlEnum, - index, - bigint, -} from "drizzle-orm/mysql-core" +import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum, index, bigint } from "drizzle-orm/mysql-core" import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types" import { workspaceIndexes } from "./workspace.sql" diff --git a/packages/console/core/src/user.ts b/packages/console/core/src/user.ts index cbb1ac827..8b7a96f44 100644 --- a/packages/console/core/src/user.ts +++ b/packages/console/core/src/user.ts @@ -26,10 +26,7 @@ export namespace User { authEmail: AuthTable.subject, }) .from(UserTable) - .leftJoin( - AuthTable, - and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")), - ) + .leftJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email"))) .where(and(eq(UserTable.workspaceID, Actor.workspace()), isNull(UserTable.timeDeleted))), ), ) @@ -39,13 +36,7 @@ export namespace User { tx .select() .from(UserTable) - .where( - and( - eq(UserTable.workspaceID, Actor.workspace()), - eq(UserTable.id, id), - isNull(UserTable.timeDeleted), - ), - ) + .where(and(eq(UserTable.workspaceID, Actor.workspace()), eq(UserTable.id, id), isNull(UserTable.timeDeleted))) .then((rows) => rows[0]), ), ) @@ -57,10 +48,7 @@ export namespace User { email: AuthTable.subject, }) .from(UserTable) - .leftJoin( - AuthTable, - and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")), - ) + .leftJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email"))) .where(and(eq(UserTable.workspaceID, Actor.workspace()), eq(UserTable.id, id))) .then((rows) => rows[0]?.email), ), @@ -142,16 +130,10 @@ export namespace User { workspaceName: WorkspaceTable.name, }) .from(UserTable) - .innerJoin( - AuthTable, - and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email")), - ) + .innerJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email"))) .innerJoin(WorkspaceTable, eq(WorkspaceTable.id, workspaceID)) .where( - and( - eq(UserTable.workspaceID, workspaceID), - eq(UserTable.id, Actor.assert("user").properties.userID), - ), + and(eq(UserTable.workspaceID, workspaceID), eq(UserTable.id, Actor.assert("user").properties.userID)), ) .then((rows) => rows[0]), ) diff --git a/packages/console/mail/emails/templates/InviteEmail.tsx b/packages/console/mail/emails/templates/InviteEmail.tsx index e94eb564c..baf0d383f 100644 --- a/packages/console/mail/emails/templates/InviteEmail.tsx +++ b/packages/console/mail/emails/templates/InviteEmail.tsx @@ -1,18 +1,6 @@ // @ts-nocheck import React from "react" -import { - Img, - Row, - Html, - Link, - Body, - Head, - Button, - Column, - Preview, - Section, - Container, -} from "@jsx-email/all" +import { Img, Row, Html, Link, Body, Head, Button, Column, Preview, Section, Container } from "@jsx-email/all" import { Text, Fonts, Title, A, Span } from "../components" import { unit, @@ -64,8 +52,8 @@ export const InviteEmail = ({ <Section style={{ padding: `${unit * 2}px 0 0 0` }}> <Text style={headingText}>Join your team's OpenCode workspace</Text> <Text style={contentText}> - You have been invited by <Span style={contentHighlightText}>{inviter}</Span> to join - the <Span style={contentHighlightText}>{workspaceName}</Span> workspace on OpenCode. + You have been invited by <Span style={contentHighlightText}>{inviter}</Span> to join the{" "} + <Span style={contentHighlightText}>{workspaceName}</Span> workspace on OpenCode. </Text> </Section> @@ -73,12 +61,7 @@ export const InviteEmail = ({ <Button style={button} href={url}> <Text style={buttonText}> Join workspace - <Img - width="24" - height="24" - src={`${assetsUrl}/right-arrow.png`} - alt="Arrow right" - /> + <Img width="24" height="24" src={`${assetsUrl}/right-arrow.png`} alt="Arrow right" /> </Text> </Button> </Section> |
