Skip to content

Commit faa43d5

Browse files
authored
Fix some AI slop (#1757)
1 parent 73c6791 commit faa43d5

File tree

148 files changed

+732
-842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+732
-842
lines changed

apps/gateway/src/routes/api/v3/conversations/annotate/annotate.handler.test.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1+
import app from '$/routes/app'
2+
import { Providers } from '@latitude-data/constants'
3+
import { Message, MessageRole } from '@latitude-data/constants/legacyCompiler'
4+
import {
5+
DocumentLog,
6+
EvaluationType,
7+
EvaluationV2,
8+
HumanEvaluationMetric,
9+
LogSources,
10+
} from '@latitude-data/core/constants'
111
import { unsafelyGetFirstApiKeyByWorkspaceId } from '@latitude-data/core/data-access/apiKeys'
212
import {
3-
createProject,
413
createDocumentLog,
5-
createProviderLog,
614
createEvaluationV2,
15+
createProject,
16+
createProviderLog,
717
helpers,
818
} from '@latitude-data/core/factories'
9-
import { MessageRole, Message } from '@latitude-data/constants/legacyCompiler'
10-
import app from '$/routes/app'
11-
import { describe, expect, it } from 'vitest'
1219
import { generateUUIDIdentifier } from '@latitude-data/core/lib/generateUUID'
13-
import {
14-
LogSources,
15-
EvaluationType,
16-
HumanEvaluationMetric,
17-
} from '@latitude-data/core/constants'
18-
import { Providers } from '@latitude-data/constants'
19-
import {
20-
ApiKey,
21-
EvaluationV2,
22-
DocumentLog,
23-
} from '@latitude-data/core/schema/types'
20+
import { ApiKey } from '@latitude-data/core/schema/types'
21+
import { describe, expect, it } from 'vitest'
2422

2523
describe('POST /conversations/:conversationUuid/evaluations/:evaluationUuid/annotate', () => {
2624
// Default test messages for provider logs

apps/web/src/app/(actions)/actions/[actionType]/_lib/cloneAgent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ROUTES } from '$/services/routes'
2-
import { ActionExecuteArgs } from './shared'
32
import type { ActionType } from '@latitude-data/constants/actions'
43
import { cloneAgentActionFrontendParametersSchema } from '@latitude-data/core/constants'
4+
import { ActionExecuteArgs } from './shared'
55

66
export const CloneAgentActionSpecification = {
77
parameters: cloneAgentActionFrontendParametersSchema,
@@ -11,7 +11,7 @@ export const CloneAgentActionSpecification = {
1111
async function execute({
1212
parameters: { projectId, commitUuid, hasCompletedOnboarding },
1313
router,
14-
}: ActionExecuteArgs<typeof ActionType.CloneAgent>) {
14+
}: ActionExecuteArgs<ActionType.CloneAgent>) {
1515
if (!hasCompletedOnboarding) {
1616
return router.push(ROUTES.onboarding.root)
1717
}

apps/web/src/app/(actions)/actions/[actionType]/_lib/createAgent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PlaygroundAction } from '$/hooks/usePlaygroundAction'
2-
import { ActionExecuteArgs } from './shared'
32
import type { ActionType } from '@latitude-data/constants/actions'
43
import { createAgentActionFrontendParametersSchema } from '@latitude-data/core/constants'
4+
import { ActionExecuteArgs } from './shared'
55

66
export const CreateAgentActionSpecification = {
77
parameters: createAgentActionFrontendParametersSchema,
@@ -11,7 +11,7 @@ export const CreateAgentActionSpecification = {
1111
async function execute({
1212
parameters: { prompt, projectId, commitUuid },
1313
setPlaygroundAction,
14-
}: ActionExecuteArgs<typeof ActionType.CreateAgent>) {
14+
}: ActionExecuteArgs<ActionType.CreateAgent>) {
1515
return setPlaygroundAction({
1616
action: PlaygroundAction.RunLatte,
1717
payload: { prompt: prompt },

apps/web/src/app/(actions)/actions/[actionType]/_lib/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { executeBackendAction as executeBackendLatitudeAction } from '$/actions/
44
import useLatitudeAction from '$/hooks/useLatitudeAction'
55
import { useOnce } from '$/hooks/useMount'
66
import { useDeferredPlaygroundAction } from '$/hooks/usePlaygroundAction'
7+
import {
8+
ActionBackendParameters,
9+
ActionFrontendParameters,
10+
ActionType,
11+
} from '@latitude-data/constants/actions'
12+
import { User, Workspace } from '@latitude-data/core/schema/types'
713
import { ClientOnly } from '@latitude-data/web-ui/atoms/ClientOnly'
814
import { Icon } from '@latitude-data/web-ui/atoms/Icons'
915
import { Text } from '@latitude-data/web-ui/atoms/Text'
1016
import { useRouter } from 'next/navigation'
1117
import { useCallback, useState } from 'react'
1218
import { ActionFrontendSpecification } from './shared'
1319
import { ACTION_SPECIFICATIONS } from './specifications'
14-
import { User, Workspace } from '@latitude-data/core/schema/types'
15-
import {
16-
ActionBackendParameters,
17-
ActionFrontendParameters,
18-
ActionType,
19-
} from '@latitude-data/constants/actions'
2020

2121
export function ClientPage<T extends ActionType = ActionType>({
2222
type,

apps/web/src/app/(actions)/actions/[actionType]/_lib/shared.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useDeferredPlaygroundAction } from '$/hooks/usePlaygroundAction'
2-
import { useRouter } from 'next/navigation'
3-
import { z } from 'zod'
4-
import { User, Workspace } from '@latitude-data/core/schema/types'
52
import {
63
ActionFrontendParameters,
74
ActionType,
85
} from '@latitude-data/constants/actions'
6+
import { User, Workspace } from '@latitude-data/core/schema/types'
7+
import { useRouter } from 'next/navigation'
8+
import { z } from 'zod'
99

1010
// prettier-ignore
1111
type ZodSchema<T = any> = z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, T, T>

apps/web/src/app/(actions)/actions/[actionType]/_lib/specifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { ActionType } from '@latitude-data/constants/actions'
12
import { CloneAgentActionSpecification } from './cloneAgent'
23
import { CreateAgentActionSpecification } from './createAgent'
34
import { ActionFrontendSpecification } from './shared'
4-
import { ActionType } from '@latitude-data/constants/actions'
55

66
export const ACTION_SPECIFICATIONS = {
77
[ActionType.CreateAgent]: CreateAgentActionSpecification,

apps/web/src/app/(actions)/actions/[actionType]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import buildMetatags from '$/app/_lib/buildMetatags'
44
import { CSPostHogProvider, IdentifyUser } from '$/app/providers'
55
import { getCurrentUserOrRedirect } from '$/services/auth/getCurrentUser'
6-
import { Icon } from '@latitude-data/web-ui/atoms/Icons'
7-
import { ClientPage } from './_lib'
86
import {
97
ActionBackendParameters,
108
ActionType,
119
} from '@latitude-data/constants/actions'
10+
import { Icon } from '@latitude-data/web-ui/atoms/Icons'
11+
import { ClientPage } from './_lib'
1212

1313
export async function generateMetadata() {
1414
return buildMetatags({

apps/web/src/app/(admin)/backoffice/grants/_components/WorkspaceGrants/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { DataTable } from '$/app/(admin)/backoffice/search/_components/DataTable'
44
import { useGrantsAdmin } from '$/stores/admin/grants'
55
import { useWorkspaceLimitsAdmin } from '$/stores/admin/workspaceLimits'
6+
import { Grant, GrantSource } from '@latitude-data/core/constants'
67
import { Badge } from '@latitude-data/web-ui/atoms/Badge'
78
import { Button } from '@latitude-data/web-ui/atoms/Button'
89
import { Card, CardContent, CardHeader } from '@latitude-data/web-ui/atoms/Card'
@@ -13,8 +14,6 @@ import { Text } from '@latitude-data/web-ui/atoms/Text'
1314
import { ClickToCopy } from '@latitude-data/web-ui/molecules/ClickToCopy'
1415
import { useState } from 'react'
1516
import { IssueGrantModal } from '../IssueGrantModal'
16-
import { Grant } from '@latitude-data/constants/grants'
17-
import { GrantSource } from '@latitude-data/core/constants'
1817

1918
export function WorkspaceGrants({ workspaceId }: { workspaceId: number }) {
2019
const [isIssueModalOpen, setIsIssueModalOpen] = useState(false)

apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/(withTabs)/evaluations/[evaluationUuid]/editor/_components/EvaluationEditor/Playground/useRunEvaluationPlaygroundPrompt.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { useStreamHandler } from '$/hooks/playgrounds/useStreamHandler'
22
import { ROUTES } from '$/services/routes'
3-
import {
4-
Commit,
5-
DocumentVersion,
6-
EvaluationV2,
7-
} from '@latitude-data/core/schema/types'
83
import {
94
EvaluationType,
5+
EvaluationV2,
106
LlmEvaluationMetricAnyCustom,
117
} from '@latitude-data/constants'
8+
import { Commit, DocumentVersion } from '@latitude-data/core/schema/types'
129
import { useCallback } from 'react'
1310

1411
export function useRunEvaluationPlaygroundPrompt({

apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/(withTabs)/logs/_components/DocumentLogs/DocumentLogInfo/Evaluations.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ import ResultBadge from '$/components/evaluations/ResultBadge'
77
import { MetadataItem } from '$/components/MetadataItem'
88
import { useEvaluationEditorLink } from '$/lib/useEvaluationEditorLink'
99
import { ROUTES } from '$/services/routes'
10+
import {
11+
DocumentLogWithMetadataAndError,
12+
EvaluationMetric,
13+
EvaluationResultV2,
14+
EvaluationType,
15+
} from '@latitude-data/core/constants'
16+
import {
17+
Commit,
18+
DocumentVersion,
19+
ResultWithEvaluationV2,
20+
} from '@latitude-data/core/schema/types'
1021
import { Button } from '@latitude-data/web-ui/atoms/Button'
1122
import { Icon } from '@latitude-data/web-ui/atoms/Icons'
1223
import { Text } from '@latitude-data/web-ui/atoms/Text'
@@ -15,17 +26,6 @@ import {
1526
useCurrentProject,
1627
} from '@latitude-data/web-ui/providers'
1728
import Link from 'next/link'
18-
import {
19-
Commit,
20-
DocumentLogWithMetadataAndError,
21-
DocumentVersion,
22-
ResultWithEvaluationV2,
23-
} from '@latitude-data/core/schema/types'
24-
import {
25-
EvaluationMetric,
26-
EvaluationResultV2,
27-
EvaluationType,
28-
} from '@latitude-data/core/constants'
2929

3030
type Props<
3131
T extends EvaluationType = EvaluationType,

0 commit comments

Comments
 (0)