Skip to content

Commit e1466c4

Browse files
authored
feat[logs]: added cost approximations for each model, display in logs sidebar (#135)
* added cost approximations for each model, display in logs sidebar * npm run format
1 parent 4128bfe commit e1466c4

File tree

30 files changed

+869
-471
lines changed

30 files changed

+869
-471
lines changed

sim/app/(auth)/verify/page.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,15 @@ export default function VerifyPage() {
66
const baseUrl = `${protocol}://${appUrl}`
77

88
const hasResendKey = Boolean(
9-
process.env.RESEND_API_KEY &&
10-
process.env.RESEND_API_KEY !== 'placeholder'
9+
process.env.RESEND_API_KEY && process.env.RESEND_API_KEY !== 'placeholder'
1110
)
1211
const isProduction = process.env.NODE_ENV === 'production'
1312

1413
return (
1514
<main className="flex min-h-screen flex-col items-center justify-center bg-gray-50">
1615
<div className="sm:mx-auto sm:w-full sm:max-w-md">
1716
<h1 className="text-2xl font-bold text-center mb-8">Sim Studio</h1>
18-
<VerifyContent
19-
hasResendKey={hasResendKey}
20-
baseUrl={baseUrl}
21-
isProduction={isProduction}
22-
/>
17+
<VerifyContent hasResendKey={hasResendKey} baseUrl={baseUrl} isProduction={isProduction} />
2318
</div>
2419
</main>
2520
)

sim/app/(auth)/verify/use-verification.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ interface UseVerificationReturn {
2828
handleOtpChange: (value: string) => void
2929
}
3030

31-
export function useVerification({ hasResendKey, isProduction }: UseVerificationParams): UseVerificationReturn {
31+
export function useVerification({
32+
hasResendKey,
33+
isProduction,
34+
}: UseVerificationParams): UseVerificationReturn {
3235
const router = useRouter()
3336
const searchParams = useSearchParams()
3437
const { addNotification } = useNotificationStore()
@@ -172,6 +175,6 @@ export function useVerification({ hasResendKey, isProduction }: UseVerificationP
172175
isProduction,
173176
verifyCode,
174177
resendCode,
175-
handleOtpChange
178+
handleOtpChange,
176179
}
177-
}
180+
}

sim/app/(auth)/verify/verify-content.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ interface VerifyContentProps {
2020
isProduction: boolean
2121
}
2222

23-
function VerificationForm({ hasResendKey, isProduction }: { hasResendKey: boolean, isProduction: boolean }) {
23+
function VerificationForm({
24+
hasResendKey,
25+
isProduction,
26+
}: {
27+
hasResendKey: boolean
28+
isProduction: boolean
29+
}) {
2430
const {
2531
otp,
2632
email,
@@ -31,7 +37,7 @@ function VerificationForm({ hasResendKey, isProduction }: { hasResendKey: boolea
3137
isOtpComplete,
3238
verifyCode,
3339
resendCode,
34-
handleOtpChange
40+
handleOtpChange,
3541
} = useVerification({ hasResendKey, isProduction })
3642

3743
return (
@@ -124,9 +130,7 @@ function VerificationFormFallback() {
124130
return (
125131
<CardHeader>
126132
<CardTitle>Loading verification...</CardTitle>
127-
<CardDescription>
128-
Please wait while we load your verification details...
129-
</CardDescription>
133+
<CardDescription>Please wait while we load your verification details...</CardDescription>
130134
</CardHeader>
131135
)
132136
}

sim/app/blocks/blocks/github.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import { GithubIcon } from '@/components/icons'
2-
import { CreateCommentResponse, LatestCommitResponse, PullRequestResponse, RepoInfoResponse } from '@/tools/github/types'
2+
import {
3+
CreateCommentResponse,
4+
LatestCommitResponse,
5+
PullRequestResponse,
6+
RepoInfoResponse,
7+
} from '@/tools/github/types'
38
import { BlockConfig } from '../types'
49

5-
type GitHubResponse = PullRequestResponse | CreateCommentResponse | LatestCommitResponse | RepoInfoResponse
10+
type GitHubResponse =
11+
| PullRequestResponse
12+
| CreateCommentResponse
13+
| LatestCommitResponse
14+
| RepoInfoResponse
615

716
export const GitHubBlock: BlockConfig<GitHubResponse> = {
817
type: 'github',
@@ -160,8 +169,8 @@ export const GitHubBlock: BlockConfig<GitHubResponse> = {
160169
response: {
161170
type: {
162171
content: 'string',
163-
metadata: 'json'
164-
}
165-
}
172+
metadata: 'json',
173+
},
174+
},
166175
},
167176
}

sim/app/components/ui/command.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ import { cn } from '@/lib/utils'
3636
// This file is not typed correctly from shadcn, so we're disabling the type checker
3737
// @ts-nocheck
3838

39+
// This file is not typed correctly from shadcn, so we're disabling the type checker
40+
// @ts-nocheck
41+
42+
// This file is not typed correctly from shadcn, so we're disabling the type checker
43+
// @ts-nocheck
44+
3945
const Command = React.forwardRef<
4046
React.ElementRef<typeof CommandPrimitive>,
4147
React.ComponentPropsWithoutRef<typeof CommandPrimitive> & {

0 commit comments

Comments
 (0)