Skip to content

JACoB PR for Issue Add Persistent Chat History Dropdown to Chat Interface#113

Draft
jacob-local-kevin[bot] wants to merge 6 commits intomainfrom
jacob-issue-112-1727122858255
Draft

JACoB PR for Issue Add Persistent Chat History Dropdown to Chat Interface#113
jacob-local-kevin[bot] wants to merge 6 commits intomainfrom
jacob-issue-112-1727122858255

Conversation

@jacob-local-kevin
Copy link
Contributor

Changes Performed:

Step 1: Create Chat History Dropdown Component

Files:

/src/app/dashboard/[org]/[repo]/chat/components/ChatHistoryDropdown.tsx

Details:

Create a new React component named ChatHistoryDropdown to display the chat history in a dropdown menu. This component should be designed to fetch and display a list of chat sessions, each with a timestamp and a brief summary. Use Tailwind CSS for styling to ensure consistency with the project's design system. The component should handle user interactions for selecting a chat session, which will then trigger the loading of the selected chat session's messages into the main chat interface. Ensure the component is responsive and integrates well with the existing chat UI.

Exit Criteria

A new React component for the chat history dropdown is created and styled with Tailwind CSS, capable of fetching and displaying chat sessions.

Step 2: Define Database Schema for Chat Sessions

Files:

/src/server/db/tables/chatSessions.table.ts

Details:

Create a new file to define the database schema for storing chat sessions. This schema should include fields for a unique session ID, user ID, timestamps for session start and end, and a brief summary or title of the session. Use the orchidORM library for defining the schema, following the conventions used in existing tables within the codebase. This will enable the storage and retrieval of chat sessions for the chat history feature.

Exit Criteria

A new database schema for chat sessions is defined, allowing for the storage and retrieval of chat history.

Step 3: Integrate Chat History Dropdown in Chat Component

Files:

/src/app/dashboard/[org]/[repo]/chat/components/Chat.tsx

Details:

Modify the Chat.tsx file to integrate the ChatHistoryDropdown component. This integration involves importing the new component and adding it to the chat interface's layout, ideally to the left of the current chat messages. Ensure the component is properly positioned and styled to match the overall design of the chat interface. Additionally, implement logic to handle the selection of a chat session from the dropdown, which should trigger the loading of the selected session's messages into the chat interface.

Exit Criteria

The chat interface is successfully modified to include the chat history dropdown, with functionality for selecting and loading chat sessions.

Step 4: Implement API Endpoints for Chat History

Files:

/src/server/api/routers/chat.ts

Details:

Modify the chat.ts file within the API routers directory to add new TRPC procedures for fetching chat history from the database. These procedures should handle requests to fetch a list of chat sessions and the messages for a selected session. Ensure the procedures are properly authenticated and validate the input parameters. This will require updating the existing API structure to support these new functionalities.

Exit Criteria

New TRPC procedures for fetching chat history are implemented and integrated into the existing chat API.

@jacob-ai-bot fix error

Error Message:

Command failed: __NEXT_TEST_MODE=1 SKIP_ENV_VALIDATION=1 npm run build --verbose && npx tsc --noEmit
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/bin/npm
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build
npm verbose argv "run" "build" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-09-23T20_25_09_576Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-09-23T20_25_09_576Z-debug-0.log
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/lib/node_modules/npm/bin/npm-cli.js
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build:1-next
npm verbose argv "run" "build:1-next"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-09-23T20_25_09_792Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-09-23T20_25_09_792Z-debug-0.log
 ⚠ Compiled with warnings

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'table' is not exported from 'orchid-orm' (imported as 'table').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'uuid' is not exported from 'orchid-orm' (imported as 'uuid').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'uuid' is not exported from 'orchid-orm' (imported as 'uuid').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'text' is not exported from 'orchid-orm' (imported as 'text').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts



===== TS errors =====

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:10
Type error: '"orchid-orm"' has no exported member named 'table'. Did you mean 'Table'?

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |          ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:17
Type error: Module '"orchid-orm"' has no exported member 'text'.

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |                 ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:23
Type error: Module '"orchid-orm"' has no exported member 'timestamp'.

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |                       ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:34
Type error: Module '"orchid-orm"' has no exported member 'uuid'.

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |                                  ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:7:23
Type error: Cannot find name 'users'.

   5 |   userId: uuid()
   6 |     .notNull()
>  7 |     .references(() => users.id),
     |                       ^
   8 |   sessionStart: timestamp().notNull().defaultNow(),
   9 |   sessionEnd: timestamp(),
  10 |   summary: text(),

===== TS errors =====


Failed to compile.

./src/server/db/tables/chatSessions.table.ts:1:10
Type error: '"orchid-orm"' has no exported member named 'table'. Did you mean 'Table'?

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |          ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),
npm verbose cwd /private/tmp/tmp-5016-T5UXR5LdPRDS
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1
ERROR: "build:1-next" exited with 1.
npm verbose cwd /private/tmp/tmp-5016-T5UXR5LdPRDS
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1

@jacob-local-kevin
Copy link
Contributor Author

JACoB here...

I'm busy working on this error.

I'll continue to comment on this pull request with status as I make progress.

@jacob-local-kevin
Copy link
Contributor Author

This PR has been updated with a new commit.

Next Steps

I am working to resolve an error. I will update this PR with my progress.
@jacob-ai-bot fix error

Error Message (Attempt Number 2):

Command failed: __NEXT_TEST_MODE=1 SKIP_ENV_VALIDATION=1 npm run build --verbose && npx tsc --noEmit
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/bin/npm
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build
npm verbose argv "run" "build" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-09-23T20_27_43_700Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-09-23T20_27_43_700Z-debug-0.log
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/lib/node_modules/npm/bin/npm-cli.js
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build:1-next
npm verbose argv "run" "build:1-next"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-09-23T20_27_43_914Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-09-23T20_27_43_914Z-debug-0.log
 ⚠ Compiled with warnings

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'table' is not exported from 'orchid-orm' (imported as 'table').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'uuid' is not exported from 'orchid-orm' (imported as 'uuid').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'uuid' is not exported from 'orchid-orm' (imported as 'uuid').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'text' is not exported from 'orchid-orm' (imported as 'text').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts



===== TS errors =====

[Test Mode] ./src/app/api/auth/accessToken/[key]/route.ts:37:27
Type error: Object literal may only specify known properties, and 'accessToken' does not exist in type 'ShapeColumnPrimaryKeys<{ createdAt: ColumnWithDefault<TimestampTZColumn<DefaultSchemaConfig>, RawSQLBase<QueryColumn<unknown, any>, unknown>>; ... 4 more ...; expiresAt: ColumnWithDefault<...>; }> | { ...; }'.

  35 |   try {
  36 |     const rowsUpdated = await db.tokens
> 37 |       .findBy({ writeKey, accessToken: null })
     |                           ^
  38 |       .update({ accessToken });
  39 |
  40 |     if (rowsUpdated === 0) {

[Test Mode] ./src/app/api/chat/v2/route.ts:117:47
Type error: Property 'overview' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'overview' does not exist on type 'string'.

  115 |
  116 |     const context = codebaseContext
> 117 |       .map((c) => `${c.filePath}: ${c.context.overview} \n\n ${c.context.text}`)
      |                                               ^
  118 |       .join("\n\n");
  119 |
  120 |     // const codebase = codebaseContext

[Test Mode] ./src/app/api/chat/v2/route.ts:117:74
Type error: Property 'text' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'text' does not exist on type 'string'.

  115 |
  116 |     const context = codebaseContext
> 117 |       .map((c) => `${c.filePath}: ${c.context.overview} \n\n ${c.context.text}`)
      |                                                                          ^
  118 |       .join("\n\n");
  119 |
  120 |     // const codebase = codebaseContext

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:76:21
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  74 |         const { issueId, payload } = event;
  75 |         const existingTask = tasks.find((t) => t.issueId === issueId);
> 76 |         if (payload.type === TaskType.task) {
     |                     ^
  77 |           if (existingTask) {
  78 |             console.log(
  79 |               "ignoring task (for now) - because it already exists",

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:85:51
Type error: Property 'subType' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'subType' does not exist on type 'string'.

  83 |             setSelectedTask({
  84 |               ...existingTask,
> 85 |               plan: getPlanForTaskSubType(payload.subType),
     |                                                   ^
  86 |               status: TaskStatus.DONE,
  87 |               currentPlanStep: (existingTask.plan?.length ?? 1) - 1,
  88 |               statusDescription: "Task completed",

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:97:13
Type error: Spread types may only be created from object types.

   95 |           }
   96 |           const newTask = {
>  97 |             ...payload,
      |             ^
   98 |             issueId,
   99 |             plan: getPlanForTaskSubType(payload.subType),
  100 |           };

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:99:49
Type error: Property 'subType' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'subType' does not exist on type 'string'.

   97 |             ...payload,
   98 |             issueId,
>  99 |             plan: getPlanForTaskSubType(payload.subType),
      |                                                 ^
  100 |           };
  101 |           setTasks([newTask, ...tasks]);
  102 |           setSelectedTask(newTask);

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:115:23
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  113 |           const newTask = { ...existingTask };
  114 |           // update the task with the new payload
> 115 |           if (payload.type === TaskType.issue) {
      |                       ^
  116 |             newTask.issue = payload;
  117 |           }
  118 |           if (payload.type === TaskType.pull_request) {

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:116:13
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' is not assignable to type 'Issue | undefined'.
  Type 'string' is not assignable to type 'Issue'.

  114 |           // update the task with the new payload
  115 |           if (payload.type === TaskType.issue) {
> 116 |             newTask.issue = payload;
      |             ^
  117 |           }
  118 |           if (payload.type === TaskType.pull_request) {
  119 |             newTask.pullRequest = payload;

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:118:23
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  116 |             newTask.issue = payload;
  117 |           }
> 118 |           if (payload.type === TaskType.pull_request) {
      |                       ^
  119 |             newTask.pullRequest = payload;
  120 |           }
  121 |           if (payload.type === TaskType.code) {

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:119:13
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' is not assignable to type 'PullRequest | undefined'.
  Type 'string' is not assignable to type 'PullRequest'.

  117 |           }
  118 |           if (payload.type === TaskType.pull_request) {
> 119 |             newTask.pullRequest = payload;
      |             ^
  120 |           }
  121 |           if (payload.type === TaskType.code) {
  122 |             // Loop throught the code files and update the task with the new code if it exists, add it if it doesn't

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:121:23
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  119 |             newTask.pullRequest = payload;
  120 |           }
> 121 |           if (payload.type === TaskType.code) {
      |                       ^
  122 |             // Loop throught the code files and update the task with the new code if it exists, add it if it doesn't
  123 |             const codeFile = payload;
  124 |             const newCodeFiles = [...(newTask.codeFiles ?? [])];

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:126:46
Type error: Property 'fileName' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'fileName' does not exist on type 'string'.

  124 |             const newCodeFiles = [...(newTask.codeFiles ?? [])];
  125 |             const index = newCodeFiles.findIndex(
> 126 |               (c) => c.fileName === codeFile.fileName,
      |                                              ^
  127 |             );
  128 |             if (index !== -1) {
  129 |               newCodeFiles[index] = codeFile;

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:129:15
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' is not assignable to type 'Code'.
  Type 'string' is not assignable to type 'Code'.

  127 |             );
  128 |             if (index !== -1) {
> 129 |               newCodeFiles[index] = codeFile;
      |               ^
  130 |             } else {
  131 |               newCodeFiles.push(codeFile);
  132 |             }

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:131:33
Type error: Argument of type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' is not assignable to parameter of type 'Code'.

  129 |               newCodeFiles[index] = codeFile;
  130 |             } else {
> 131 |               newCodeFiles.push(codeFile);
      |                                 ^
  132 |             }
  133 |             newTask.codeFiles = newCodeFiles;
  134 |           }

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:135:23
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  133 |             newTask.codeFiles = newCodeFiles;
  134 |           }
> 135 |           if (payload.type === TaskType.command) {
      |                       ^
  136 |             // add the command to the task.commands array
  137 |             newTask.commands = [...(newTask.commands ?? []), payload];
  138 |           }

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:137:33
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[] | Command' is not assignable to type 'Command'.
  Type 'string' is not assignable to type 'Command'.

  135 |           if (payload.type === TaskType.command) {
  136 |             // add the command to the task.commands array
> 137 |             newTask.commands = [...(newTask.commands ?? []), payload];
      |                                 ^
  138 |           }
  139 |           if (payload.type === TaskType.prompt) {
  140 |             // add the prompt to the task.prompts array

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:137:62
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' is not assignable to type 'Command'.
  Type 'string' is not assignable to type 'Command'.

  135 |           if (payload.type === TaskType.command) {
  136 |             // add the command to the task.commands array
> 137 |             newTask.commands = [...(newTask.commands ?? []), payload];
      |                                                              ^
  138 |           }
  139 |           if (payload.type === TaskType.prompt) {
  140 |             // add the prompt to the task.prompts array

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:139:23
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  137 |             newTask.commands = [...(newTask.commands ?? []), payload];
  138 |           }
> 139 |           if (payload.type === TaskType.prompt) {
      |                       ^
  140 |             // add the prompt to the task.prompts array
  141 |             newTask.prompts = [...(newTask.prompts ?? []), payload];
  142 |           }

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:141:32
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[] | Prompt' is not assignable to type 'Prompt'.
  Type 'string' is not assignable to type 'Prompt'.

  139 |           if (payload.type === TaskType.prompt) {
  140 |             // add the prompt to the task.prompts array
> 141 |             newTask.prompts = [...(newTask.prompts ?? []), payload];
      |                                ^
  142 |           }
  143 |
  144 |           // update the task in the tasks array

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:141:60
Type error: Type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' is not assignable to type 'Prompt'.
  Type 'string' is not assignable to type 'Prompt'.

  139 |           if (payload.type === TaskType.prompt) {
  140 |             // add the prompt to the task.prompts array
> 141 |             newTask.prompts = [...(newTask.prompts ?? []), payload];
      |                                                            ^
  142 |           }
  143 |
  144 |           // update the task in the tasks array

[Test Mode] ./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx:149:57
Type error: Property 'type' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'type' does not exist on type 'string'.

  147 |           );
  148 |           setSelectedTask(newTask);
> 149 |           setSelectedIcon(getSidebarIconForType(payload.type));
      |                                                         ^
  150 |         }
  151 |       },
  152 |       onError(err) {

[Test Mode] ./src/server/api/routers/codebaseContext.ts:78:13
Type error: Object literal may only specify known properties, and 'projectId' does not exist in type 'ShapeColumnPrimaryKeys<{ createdAt: ColumnWithDefault<TimestampTZColumn<DefaultSchemaConfig>, RawSQLBase<QueryColumn<unknown, any>, unknown>>; ... 5 more ...; context: JSONColumn<...>; }>'.

  76 |         const existingContext =
  77 |           (await db.codebaseContext.findByOptional({
> 78 |             projectId,
     |             ^
  79 |             filePath,
  80 |           })) ?? null;
  81 |

[Test Mode] ./src/server/api/routers/events.ts:293:19
Type error: Property 'schema' does not exist on type 'typeof EventsTable'.

  291 |   add: protectedProcedure
  292 |     .input(
> 293 |       EventsTable.schema().omit({ id: true, createdAt: true, updatedAt: true }),
      |                   ^
  294 |     )
  295 |     .mutation(async (opts) => {
  296 |       const event = { ...opts.input }; /* [..] add to db */

[Test Mode] ./src/server/api/routers/github.ts:388:69
Type error: Property 'overview' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'overview' does not exist on type 'string'.

  386 |         }
  387 |         const extractedIssue = await getExtractedIssue(
> 388 |           `${codebaseContext.map((c) => `${c.filePath}: ${c.context.overview} ${c.context.diagram} `).join("\n")}`,
      |                                                                     ^
  389 |           issueText,
  390 |           "o1-mini-2024-09-12",
  391 |         );

[Test Mode] ./src/server/api/routers/github.ts:388:91
Type error: Property 'diagram' does not exist on type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]'.
  Property 'diagram' does not exist on type 'string'.

  386 |         }
  387 |         const extractedIssue = await getExtractedIssue(
> 388 |           `${codebaseContext.map((c) => `${c.filePath}: ${c.context.overview} ${c.context.diagram} `).join("\n")}`,
      |                                                                                           ^
  389 |           issueText,
  390 |           "o1-mini-2024-09-12",
  391 |         );

[Test Mode] ./src/server/api/routers/todos.ts:18:7
Type error: Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }[]' is not assignable to type 'Todo[]'.
  Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }' is not assignable to type 'Todo'.
    Types of property 'createdAt' are incompatible.
      Type 'string' is not assignable to type 'number'.

  16 |     )
  17 |     .query(async ({ input: { projectId } }): Promise<Todo[]> => {
> 18 |       return await db.todos
     |       ^
  19 |         .where({ projectId, isArchived: false })
  20 |         .order({ position: "DESC" })
  21 |         .all();

[Test Mode] ./src/server/api/routers/todos.ts:31:7
Type error: Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }' is not assignable to type 'Todo'.

  29 |     .query(async ({ input: { id } }): Promise<Todo> => {
  30 |       const todo = await db.todos.find(id);
> 31 |       return todo;
     |       ^
  32 |     }),
  33 |
  34 |   create: protectedProcedure

[Test Mode] ./src/server/api/routers/todos.ts:55:11
Type error: Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }' is not assignable to type 'Todo'.
  Types of property 'createdAt' are incompatible.
    Type 'string' is not assignable to type 'number'.

  53 |           const createdTodo = await db.todos.selectAll().insert(input);
  54 |           await researchIssue(description, createdTodo.id, issueId, "", 3);
> 55 |           return createdTodo;
     |           ^
  56 |         }
  57 |       }
  58 |

[Test Mode] ./src/server/api/routers/todos.ts:68:7
Type error: Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }' is not assignable to type 'Todo'.

  66 |       };
  67 |       const createdTodo = await db.todos.selectAll().insert(newTodo);
> 68 |       return createdTodo;
     |       ^
  69 |     }),
  70 |
  71 |   update: protectedProcedure

[Test Mode] ./src/server/api/routers/todos.ts:85:7
Type error: Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }' is not assignable to type 'Todo'.

  83 |     .mutation(async ({ input: { id, ...updates } }): Promise<Todo> => {
  84 |       const updatedTodo = await db.todos.selectAll().find(id).update(updates);
> 85 |       return updatedTodo;
     |       ^
  86 |     }),
  87 |
  88 |   archive: protectedProcedure

[Test Mode] ./src/server/api/routers/todos.ts:99:7
Type error: Type '{ name: string; id: number; createdAt: string; updatedAt: string; projectId: number; issueId: number | null; status: TodoStatus; description: string; position: number; branch: string | null; isArchived: boolean; }' is not assignable to type 'Todo'.

   97 |         .find(id)
   98 |         .update({ isArchived: true });
>  99 |       return archivedTodo;
      |       ^
  100 |     }),
  101 |
  102 |   updatePosition: protectedProcedure

[Test Mode] ./src/server/auth.ts:81:13
Type error: Object literal may only specify known properties, and 'userId' does not exist in type 'ShapeColumnPrimaryKeys<{ id: PrimaryKeyColumn<SerialColumn<DefaultSchemaConfig>, string>; userId: IntegerColumn<DefaultSchemaConfig>; ... 9 more ...; token_type: TextColumn<...>; }>'.

  79 |         const dbAccount = await db.accounts
  80 |           .findByOptional({
> 81 |             userId: parseInt(user.id, 10),
     |             ^
  82 |           })
  83 |           .select("id");
  84 |         if (dbAccount) {

[Test Mode] ./src/server/auth.ts:110:50
Type error: Object literal may only specify known properties, and 'userId' does not exist in type 'ShapeColumnPrimaryKeys<{ id: PrimaryKeyColumn<SerialColumn<DefaultSchemaConfig>, string>; userId: IntegerColumn<DefaultSchemaConfig>; ... 9 more ...; token_type: TextColumn<...>; }>'.

  108 |       const { session, user } = params;
  109 |       const userId = parseInt(user.id, 10);
> 110 |       const account = await db.accounts.findBy({ userId });
      |                                                  ^
  111 |       return {
  112 |         ...session,
  113 |         accessToken: account.access_token,

[Test Mode] ./src/server/db/baseTable.ts:8:63
Type error: Expected 0 arguments, but got 2.

   6 |     ...t,
   7 |     // eslint-disable-next-line @typescript-eslint/no-inferrable-types
>  8 |     text: (min: number = 0, max: number = Infinity) => t.text(min, max),
     |                                                               ^
   9 |     timestamp: <P extends number>(precision?: P) =>
  10 |       t.timestamp<P>(precision).asNumber(),
  11 |   }),

[Test Mode] ./src/server/db/baseTable.ts:10:19
Type error: Expected 0 type arguments, but got 1.

   8 |     text: (min: number = 0, max: number = Infinity) => t.text(min, max),
   9 |     timestamp: <P extends number>(precision?: P) =>
> 10 |       t.timestamp<P>(precision).asNumber(),
     |                   ^
  11 |   }),
  12 |   schemaProvider: zodSchemaProvider,
  13 | });

[Test Mode] ./src/server/db/baseTable.ts:12:3
Type error: Object literal may only specify known properties, and 'schemaProvider' does not exist in type '{ schemaConfig?: DefaultSchemaConfig | undefined; columnTypes?: { text: (min?: number, max?: number) => TextColumn<DefaultSchemaConfig>; ... 50 more ...; timestampsNoTZ<T extends ColumnTypeBase<...>>(this: { ...; }): Timestamps<...>; } | ((t: DefaultColumnTypes<...>) => { ...; }) | undefined; ... 4 more ...; languag...'.

  10 |       t.timestamp<P>(precision).asNumber(),
  11 |   }),
> 12 |   schemaProvider: zodSchemaProvider,
     |   ^
  13 | });
  14 |

[Test Mode] ./src/server/db/dbScript.ts:2:32
Type error: Cannot find module 'orchid-orm/codegen' or its corresponding type declarations.

  1 | import { rakeDb } from "rake-db";
> 2 | import { appCodeUpdater } from "orchid-orm/codegen";
    |                                ^
  3 | import { config } from "./config";
  4 | import { BaseTable } from "./baseTable";
  5 |

[Test Mode] ./src/server/db/dbScript.ts:9:3
Type error: Object literal may only specify known properties, and 'appCodeUpdater' does not exist in type 'InputRakeDbConfig<ColumnSchemaConfig<ColumnTypeBase<ColumnTypeSchemaArg, unknown, any, any, unknown, unknown, any, unknown, any, ColumnDataBase>>, DefaultColumnTypes<...>>'.

   7 |   baseTable: BaseTable,
   8 |   migrationsPath: "./migrations",
>  9 |   appCodeUpdater: appCodeUpdater({
     |   ^
  10 |     tablePath: (tableName) => `./tables/${tableName}.table.ts`,
  11 |     ormPath: "./db.ts",
  12 |   }),

[Test Mode] ./src/server/db/dbScript.ts:10:17
Type error: Parameter 'tableName' implicitly has an 'any' type.

   8 |   migrationsPath: "./migrations",
   9 |   appCodeUpdater: appCodeUpdater({
> 10 |     tablePath: (tableName) => `./tables/${tableName}.table.ts`,
     |                 ^
  11 |     ormPath: "./db.ts",
  12 |   }),
  13 |   useCodeUpdater: false, // set to true to disable code updater

[Test Mode] ./src/server/db/tables/accounts.table.ts:11:27
Type error: Expected 0 arguments, but got 2.

   9 |     provider: t.varchar(255),
  10 |     providerAccountId: t.varchar(255),
> 11 |     refresh_token: t.text(0, Infinity),
     |                           ^
  12 |     access_token: t.text(0, Infinity),
  13 |     expires_at: t.bigint(),
  14 |     id_token: t.text(0, Infinity),

[Test Mode] ./src/server/db/tables/accounts.table.ts:12:26
Type error: Expected 0 arguments, but got 2.

  10 |     providerAccountId: t.varchar(255),
  11 |     refresh_token: t.text(0, Infinity),
> 12 |     access_token: t.text(0, Infinity),
     |                          ^
  13 |     expires_at: t.bigint(),
  14 |     id_token: t.text(0, Infinity),
  15 |     scope: t.text(0, Infinity),

[Test Mode] ./src/server/db/tables/accounts.table.ts:14:22
Type error: Expected 0 arguments, but got 2.

  12 |     access_token: t.text(0, Infinity),
  13 |     expires_at: t.bigint(),
> 14 |     id_token: t.text(0, Infinity),
     |                      ^
  15 |     scope: t.text(0, Infinity),
  16 |     session_state: t.text(0, Infinity),
  17 |     token_type: t.text(0, Infinity),

[Test Mode] ./src/server/db/tables/accounts.table.ts:15:19
Type error: Expected 0 arguments, but got 2.

  13 |     expires_at: t.bigint(),
  14 |     id_token: t.text(0, Infinity),
> 15 |     scope: t.text(0, Infinity),
     |                   ^
  16 |     session_state: t.text(0, Infinity),
  17 |     token_type: t.text(0, Infinity),
  18 |   }));

[Test Mode] ./src/server/db/tables/accounts.table.ts:16:27
Type error: Expected 0 arguments, but got 2.

  14 |     id_token: t.text(0, Infinity),
  15 |     scope: t.text(0, Infinity),
> 16 |     session_state: t.text(0, Infinity),
     |                           ^
  17 |     token_type: t.text(0, Infinity),
  18 |   }));
  19 | }

[Test Mode] ./src/server/db/tables/accounts.table.ts:17:24
Type error: Expected 0 arguments, but got 2.

  15 |     scope: t.text(0, Infinity),
  16 |     session_state: t.text(0, Infinity),
> 17 |     token_type: t.text(0, Infinity),
     |                        ^
  18 |   }));
  19 | }
  20 |

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:10
Type error: '"orchid-orm"' has no exported member named 'table'. Did you mean 'Table'?

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |          ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:17
Type error: Module '"orchid-orm"' has no exported member 'text'.

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |                 ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:23
Type error: '"orchid-orm"' has no exported member named 'timestamp'. Did you mean 'Timestamps'?

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |                       ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:1:34
Type error: Module '"orchid-orm"' has no exported member 'uuid'.

> 1 | import { table, text, timestamp, uuid } from "orchid-orm";
    |                                  ^
  2 |
  3 | export const chatSessions = table("chat_sessions", {
  4 |   id: uuid().primaryKey().defaultRandom(),

[Test Mode] ./src/server/db/tables/chatSessions.table.ts:7:23
Type error: Cannot find name 'users'.

   5 |   userId: uuid()
   6 |     .notNull()
>  7 |     .references(() => users.id),
     |                       ^
   8 |   sessionStart: timestamp().notNull().defaultNow(),
   9 |   sessionEnd: timestamp(),
  10 |   summary: text(),

[Test Mode] ./src/server/db/tables/codebaseContext.table.ts:1:39
Type error: '"orchid-orm"' has no exported member named 'Updateable'. Did you mean 'Updatable'?

> 1 | import type { Selectable, Insertable, Updateable, Queryable } from "orchid-orm";
    |                                       ^
  2 | import { BaseTable } from "../baseTable";
  3 |
  4 | export type CodebaseFile = Selectable<CodebaseContextTable>;

[Test Mode] ./src/server/db/tables/codebaseContext.table.ts:16:21
Type error: Expected 0 arguments, but got 1.

  14 |     filePath: t.varchar(255),
  15 |     lastCommitHash: t.varchar(40),
> 16 |     context: t.json((j) =>
     |                     ^
  17 |       j.object({
  18 |         file: j.string(),
  19 |         code: j.array(j.string()),

[Test Mode] ./src/server/db/tables/codebaseContext.table.ts:16:22
Type error: Parameter 'j' implicitly has an 'any' type.

  14 |     filePath: t.varchar(255),
  15 |     lastCommitHash: t.varchar(40),
> 16 |     context: t.json((j) =>
     |                      ^
  17 |       j.object({
  18 |         file: j.string(),
  19 |         code: j.array(j.string()),

[Test Mode] ./src/server/db/tables/events.table.ts:2:39
Type error: '"orchid-orm"' has no exported member named 'Updateable'. Did you mean 'Updatable'?

  1 | import { type JSONTypes } from "orchid-core";
> 2 | import type { Selectable, Insertable, Updateable, Queryable } from "orchid-orm";
    |                                       ^
  3 | import { BaseTable } from "../baseTable";
  4 | import {
  5 |   TaskType,

[Test Mode] ./src/server/db/tables/events.table.ts:71:26
Type error: Expected 0 arguments, but got 2.

  69 |     projectId: t.integer().foreignKey("projects", "id"),
  70 |     userId: t.text(),
> 71 |     repoFullName: t.text(0, Infinity).unique(),
     |                          ^
  72 |     issueId: t.integer().nullable(),
  73 |     pullRequestId: t.integer().nullable(),
  74 |     type: t.enum("task_type", TASK_TYPE_VALUES),

[Test Mode] ./src/server/db/tables/events.table.ts:75:21
Type error: Expected 0 arguments, but got 1.

  73 |     pullRequestId: t.integer().nullable(),
  74 |     type: t.enum("task_type", TASK_TYPE_VALUES),
> 75 |     payload: t.json((t) =>
     |                     ^
  76 |       t.discriminatedUnion("type", [
  77 |         t.object({
  78 |           type: t.literal(TaskType.task),

[Test Mode] ./src/server/db/tables/events.table.ts:75:22
Type error: Parameter 't' implicitly has an 'any' type.

  73 |     pullRequestId: t.integer().nullable(),
  74 |     type: t.enum("task_type", TASK_TYPE_VALUES),
> 75 |     payload: t.json((t) =>
     |                      ^
  76 |       t.discriminatedUnion("type", [
  77 |         t.object({
  78 |           type: t.literal(TaskType.task),

[Test Mode] ./src/server/db/tables/projects.table.ts:1:39
Type error: '"orchid-orm"' has no exported member named 'Updateable'. Did you mean 'Updatable'?

> 1 | import type { Selectable, Insertable, Updateable, Queryable } from "orchid-orm";
    |                                       ^
  2 | import { BaseTable } from "../baseTable";
  3 |
  4 | export type Project = Selectable<ProjectsTable>;

[Test Mode] ./src/server/db/tables/projects.table.ts:15:22
Type error: Expected 0 arguments, but got 2.

  13 |     repoId: t.bigint().unique(),
  14 |     repoNodeId: t.varchar(255).unique(),
> 15 |     repoName: t.text(0, Infinity),
     |                      ^
  16 |     repoFullName: t.text(0, Infinity).unique(),
  17 |     settings: t.json().default({}),
  18 |     ...t.timestamps(),

[Test Mode] ./src/server/db/tables/projects.table.ts:16:26
Type error: Expected 0 arguments, but got 2.

  14 |     repoNodeId: t.varchar(255).unique(),
  15 |     repoName: t.text(0, Infinity),
> 16 |     repoFullName: t.text(0, Infinity).unique(),
     |                          ^
  17 |     settings: t.json().default({}),
  18 |     ...t.timestamps(),
  19 |   }));

[Test Mode] ./src/server/db/tables/todos.table.ts:1:39
Type error: '"orchid-orm"' has no exported member named 'Updateable'. Did you mean 'Updatable'?

> 1 | import type { Selectable, Insertable, Updateable, Queryable } from "orchid-orm";
    |                                       ^
  2 | import { BaseTable } from "../baseTable";
  3 | import { TodoStatus } from "../enums";
  4 |

[Test Mode] ./src/server/db/tables/tokens.table.ts:11:25
Type error: Expected 0 arguments, but got 2.

   9 |       .default(t.sql`gen_random_uuid()`)
  10 |       .unique(),
> 11 |     accessToken: t.text(0, Infinity).nullable(),
     |                         ^
  12 |     expiresAt: t
  13 |       .timestamp()
  14 |       .parse((value) => (value ? new Date(value) : value))

[Test Mode] ./src/server/db/tables/tokens.table.ts:15:11
Type error: Argument of type 'IntegerColumn<DefaultSchemaConfig>' is not assignable to parameter of type 'Omit<ColumnTypeBase<ColumnTypeSchemaArg, unknown, any, any, unknown, unknown, any, unknown, any, ColumnDataBase>, "inputType" | "outputType"> & { ...; }'.
  Type 'IntegerColumn<DefaultSchemaConfig>' is not assignable to type '{ inputType: DateColumnInput; outputType: string | Date; }'.
    Types of property 'outputType' are incompatible.
      Type 'number' is not assignable to type 'string | Date'.

  13 |       .timestamp()
  14 |       .parse((value) => (value ? new Date(value) : value))
> 15 |       .as(t.integer())
     |           ^
  16 |       .default(t.sql`now() + interval '1 hour'`),
  17 |     ...t.timestamps(),
  18 |   }));

[Test Mode] ./src/server/db/tables/users.table.ts:20:11
Type error: Argument of type 'IntegerColumn<DefaultSchemaConfig>' is not assignable to parameter of type 'Omit<ColumnTypeBase<ColumnTypeSchemaArg, unknown, any, any, unknown, unknown, any, unknown, any, ColumnDataBase>, "inputType" | "outputType"> & { ...; }'.
  Type 'IntegerColumn<DefaultSchemaConfig>' is not assignable to type '{ inputType: DateColumnInput | null; outputType: string | Date | null; }'.
    Types of property 'outputType' are incompatible.
      Type 'number' is not assignable to type 'string | Date | null'.

  18 |       .nullable()
  19 |       .parse((value) => (value ? new Date(value) : value))
> 20 |       .as(t.integer()),
     |           ^
  21 |     image: t.text(0, Infinity).nullable(),
  22 |     login: t.text().nullable(),
  23 |     role: t.enum("user_role", USER_ROLE_VALUES).default(UserRole.USER),

[Test Mode] ./src/server/db/tables/users.table.ts:21:19
Type error: Expected 0 arguments, but got 2.

  19 |       .parse((value) => (value ? new Date(value) : value))
  20 |       .as(t.integer()),
> 21 |     image: t.text(0, Infinity).nullable(),
     |                   ^
  22 |     login: t.text().nullable(),
  23 |     role: t.enum("user_role", USER_ROLE_VALUES).default(UserRole.USER),
  24 |     onboardingStatus: t

[Test Mode] ./src/server/messaging/queue.ts:165:12
Type error: Argument of type '{ repoName: string; repoFullName: string; repoNodeId: string; }' is not assignable to parameter of type '"id" | "createdAt" | "updatedAt" | "repoId" | "repoNodeId" | "repoName" | "repoFullName" | "settings" | ("id" | "createdAt" | "updatedAt" | "repoId" | "repoNodeId" | "repoName" | "repoFullName" | "settings")[] | { ...; } | undefined'.

  163 |     })
  164 |     .onConflict("repoId")
> 165 |     .merge(projectUpdate);
      |            ^
  166 |   if (eventId && eventName) {
  167 |     console.log(
  168 |       `[${repository.full_name}] onGitHubEvent: ${eventId} ${eventName} : DB project ID: ${project.id}`,

[Test Mode] ./src/server/utils/codebaseContext.ts:105:7
Type error: Object literal may only specify known properties, and 'projectId' does not exist in type 'ShapeColumnPrimaryKeys<{ createdAt: ColumnWithDefault<TimestampTZColumn<DefaultSchemaConfig>, RawSQLBase<QueryColumn<unknown, any>, unknown>>; ... 5 more ...; context: JSONColumn<...>; }>'.

  103 |     const filePath = standardizePath(_filePath);
  104 |     const existingContext = await db.codebaseContext.findByOptional({
> 105 |       projectId,
      |       ^
  106 |       filePath,
  107 |     });
  108 |

[Test Mode] ./src/server/utils/codebaseContext.ts:175:5
Type error: Object literal may only specify known properties, and 'projectId' does not exist in type 'ShapeColumnPrimaryKeys<{ createdAt: ColumnWithDefault<TimestampTZColumn<DefaultSchemaConfig>, RawSQLBase<QueryColumn<unknown, any>, unknown>>; ... 5 more ...; context: JSONColumn<...>; }>'.

  173 |
  174 |   const existingFile = await db.codebaseContext.findByOptional({
> 175 |     projectId,
      |     ^
  176 |     filePath,
  177 |   });
  178 |

[Test Mode] ./src/server/utils/events.ts:18:9
Type error: Type 'number' is not assignable to type 'string | Expression<QueryColumn<unknown, any>> | Date | Query | undefined'.

  16 |     .where({
  17 |       createdAt: {
> 18 |         lte: DateTime.now()
     |         ^
  19 |           .minus({
  20 |             seconds: EVENT_RETENTION_TIME_IN_SECONDS,
  21 |           })

[Test Mode] ./src/server/utils/settings.ts:99:24
Type error: Conversion of type 'string | number | boolean | { [x: string]: unknown; } | (string | number | boolean | { [x: string]: unknown; })[]' to type 'RepoSettings' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property 'language' is missing in type '(string | number | boolean | { [x: string]: unknown; })[]' but required in type 'RepoSettings'.

   97 |     });
   98 |     if (project) {
>  99 |       settingsFromDb = project.settings as RepoSettings;
      |                        ^
  100 |     }
  101 |   }
  102 |

[Test Mode] ./src/server/utils/todos.ts:30:5
Type error: Object literal may only specify known properties, and 'projectId' does not exist in type 'ShapeColumnPrimaryKeys<{ createdAt: ColumnWithDefault<TimestampTZColumn<DefaultSchemaConfig>, RawSQLBase<QueryColumn<unknown, any>, unknown>>; ... 9 more ...; isArchived: ColumnWithDefault<...>; }>'.

  28 |   // Check if a todo for this issue already exists
  29 |   const existingTodo = await db.todos.findByOptional({
> 30 |     projectId: projectId,
     |     ^
  31 |     issueId: issueNumber,
  32 |   });
  33 |

===== TS errors =====


Failed to compile.

./src/app/api/auth/accessToken/[key]/route.ts:37:27
Type error: Object literal may only specify known properties, and 'accessToken' does not exist in type 'ShapeColumnPrimaryKeys<{ createdAt: ColumnWithDefault<TimestampTZColumn<DefaultSchemaConfig>, RawSQLBase<QueryColumn<unknown, any>, unknown>>; ... 4 more ...; expiresAt: ColumnWithDefault<...>; }> | { ...; }'.

  35 |   try {
  36 |     const rowsUpdated = await db.tokens
> 37 |       .findBy({ writeKey, accessToken: null })
     |                           ^
  38 |       .update({ accessToken });
  39 |
  40 |     if (rowsUpdated === 0) {
npm verbose cwd /private/tmp/tmp-5016-gXrUWu3KSs7p
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1
ERROR: "build:1-next" exited with 1.
npm verbose cwd /private/tmp/tmp-5016-gXrUWu3KSs7p
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1

@jacob-local-kevin
Copy link
Contributor Author

JACoB here...

I'm busy working on this error.

I'll continue to comment on this pull request with status as I make progress.

@jacob-local-kevin
Copy link
Contributor Author

This PR has been updated with a new commit.

Next Steps

I am working to resolve an error. I will update this PR with my progress.
@jacob-ai-bot fix error

Error Message (Attempt Number 3):

Command failed: __NEXT_TEST_MODE=1 SKIP_ENV_VALIDATION=1 npm run build --verbose && npx tsc --noEmit
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/bin/npm
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build
npm verbose argv "run" "build" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-09-23T20_29_34_379Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-09-23T20_29_34_379Z-debug-0.log
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/lib/node_modules/npm/bin/npm-cli.js
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build:1-next
npm verbose argv "run" "build:1-next"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-09-23T20_29_34_573Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-09-23T20_29_34_573Z-debug-0.log
 ⚠ Compiled with warnings

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'table' is not exported from 'orchid-orm' (imported as 'table').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'uuid' is not exported from 'orchid-orm' (imported as 'uuid').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'uuid' is not exported from 'orchid-orm' (imported as 'uuid').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'text' is not exported from 'orchid-orm' (imported as 'text').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts

./src/server/db/tables/chatSessions.table.ts
Attempted import error: 'timestamp' is not exported from 'orchid-orm' (imported as 'timestamp').

Import trace for requested module:
./src/server/db/tables/chatSessions.table.ts
./src/server/api/routers/chat.ts
./src/server/api/root.ts
./src/app/api/trpc/[trpc]/route.ts


Failed to compile.

./src/app/dashboard/[org]/[repo]/chat/components/Chat.tsx
43:10  Warning: 'selectedSessionId' is assigned a value but never used.  @typescript-eslint/no-unused-vars

./src/app/dashboard/[org]/[repo]/issue-writer/IssueWriter.tsx
11:3  Warning: 'faTimes' is defined but never used.  @typescript-eslint/no-unused-vars
26:63  Warning: 'project' is defined but never used. Allowed unused args must match /^_/u.  @typescript-eslint/no-unused-vars

./src/app/dashboard/[org]/[repo]/otto/Dashboard.tsx
85:43  Error: Unsafe argument of type `any` assigned to a parameter of type `TaskSubType`.  @typescript-eslint/no-unsafe-argument
99:41  Error: Unsafe argument of type `any` assigned to a parameter of type `TaskSubType`.  @typescript-eslint/no-unsafe-argument
102:27  Error: Unsafe argument of type `any` assigned to a parameter of type `SetStateAction<Task | undefined>`.  @typescript-eslint/no-unsafe-argument
149:49  Error: Unsafe argument of type `any` assigned to a parameter of type `TaskType`.  @typescript-eslint/no-unsafe-argument

./src/server/api/routers/github.ts
5:8  Warning: 'ExtractedIssueInfo' is defined but never used.  @typescript-eslint/no-unused-vars

./src/server/db/tables/events.table.ts
102:41  Error: Unsafe argument of type `any` assigned to a parameter of type `{ unknown: () => JSONUnknown; boolean: () => JSONBoolean; null: () => JSONNull; number: <T extends number = number>() => JSONNumber<T>; string: <T_1 extends string = string>() => JSONString<...>; ... 10 more ...; union: <T_8 extends JSONUnionArgs>(...types: T_8) => JSONUnion<...>; }`.  @typescript-eslint/no-unsafe-argument
104:24  Error: Unsafe argument of type `any` assigned to a parameter of type `{ unknown: () => JSONUnknown; boolean: () => JSONBoolean; null: () => JSONNull; number: <T extends number = number>() => JSONNumber<T>; string: <T_1 extends string = string>() => JSONString<...>; ... 10 more ...; union: <T_8 extends JSONUnionArgs>(...types: T_8) => JSONUnion<...>; }`.  @typescript-eslint/no-unsafe-argument
115:43  Error: Unsafe argument of type `any` assigned to a parameter of type `{ unknown: () => JSONUnknown; boolean: () => JSONBoolean; null: () => JSONNull; number: <T extends number = number>() => JSONNumber<T>; string: <T_1 extends string = string>() => JSONString<...>; ... 10 more ...; union: <T_8 extends JSONUnionArgs>(...types: T_8) => JSONUnion<...>; }`.  @typescript-eslint/no-unsafe-argument
118:34  Error: Unsafe argument of type `any` assigned to a parameter of type `{ unknown: () => JSONUnknown; boolean: () => JSONBoolean; null: () => JSONNull; number: <T extends number = number>() => JSONNumber<T>; string: <T_1 extends string = string>() => JSONString<...>; ... 10 more ...; union: <T_8 extends JSONUnionArgs>(...types: T_8) => JSONUnion<...>; }`.  @typescript-eslint/no-unsafe-argument
128:43  Error: Unsafe argument of type `any` assigned to a parameter of type `{ unknown: () => JSONUnknown; boolean: () => JSONBoolean; null: () => JSONNull; number: <T extends number = number>() => JSONNumber<T>; string: <T_1 extends string = string>() => JSONString<...>; ... 10 more ...; union: <T_8 extends JSONUnionArgs>(...types: T_8) => JSONUnion<...>; }`.  @typescript-eslint/no-unsafe-argument

./src/server/utils/codebaseContext.ts
185:59  Error: Unsafe argument of type `Updateable<CodebaseContextTable>` assigned to a parameter of type `{ projectId?: UpdateColumn<SetQueryReturnsOne<TableToDb<CodebaseContextTable, EmptyObject>> & QueryMetaHasWhere, "projectId"> | undefined; ... 5 more ...; updatedAt?: UpdateColumn<...>; }`.  @typescript-eslint/no-unsafe-argument

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
npm verbose cwd /private/tmp/tmp-5016-sySRgL82MpOr
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1
ERROR: "build:1-next" exited with 1.
npm verbose cwd /private/tmp/tmp-5016-sySRgL82MpOr
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm  v10.8.2
npm verbose exit 1
npm verbose code 1

@jacob-local-kevin
Copy link
Contributor Author

JACoB here...

I'm busy working on this error.

I'll continue to comment on this pull request with status as I make progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants