This commit is contained in:
Ariel Weinberger
2025-07-16 20:29:03 -05:00
parent 98e81a5536
commit 0c09ae8467
10 changed files with 843 additions and 1159 deletions
+3
View File
@@ -0,0 +1,3 @@
tmp
node_modules
.env
+18
View File
@@ -0,0 +1,18 @@
FROM --platform=$BUILDPLATFORM node:22-alpine AS build
WORKDIR /app
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN npm i -g corepack@latest
RUN corepack enable
RUN corepack prepare pnpm@10.0.0 --activate
ADD ./package.json /app/package.json
ADD ./pnpm-lock.yaml /app/pnpm-lock.yaml
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
ADD ./ /app/
RUN pnpm run build
-1145
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"dev": "tsx watch src/server.ts",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rimraf dist && tsup"
},
"keywords": [],
"author": "",
@@ -13,6 +14,8 @@
"devDependencies": {
"@prisma/client": "^6.10.1",
"@types/node": "^24.0.13",
"rimraf": "^6.0.1",
"tsup": "^8.5.0",
"tsx": "^4.20.3",
"typescript": "^5.8.3"
},
+765
View File
File diff suppressed because it is too large Load Diff
+11 -2
View File
@@ -8,13 +8,22 @@ import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { HTTPException } from 'hono/http-exception';
import { fileURLToPath } from 'url';
import { handleChatRequest } from '@/handlers/chat/route';
import { handleChatRequest } from './handlers/chat/route';
import { getConversation, getConversations } from './handlers/conversation';
import { contextStorage } from "hono/context-storage";
import { RuntimeContextType } from './lib/ai/mastra/utils/runtime-context';
const app = new Hono();
export type HonoEnv = {
Variables: {
runtimeContext: RuntimeContextType,
}
}
const app = new Hono<HonoEnv>();
// Middleware
app.use('*', cors());
app.use(contextStorage());
app.onError((err, c) => {
if (err instanceof HTTPException) {
return err.getResponse();
-10
View File
@@ -1,10 +0,0 @@
[
{
"role": "system",
"content": "\nYou are Imagine, an AI powered software developer. \nTake the user's request and then call the proceed tool to get it implemented.\n "
},
{
"role": "user",
"content": "What is the content of src/App.tsx?"
}
]
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": false,
"outDir": "./dist",
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
"declarationMap": true,
"jsx": "preserve",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "dist"]
}
+16
View File
@@ -0,0 +1,16 @@
import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/server.ts'],
format: ['esm'],
target: 'node22',
platform: 'node',
dts: true,
sourcemap: true,
clean: true,
outDir: 'dist',
treeshake: true,
tsconfig: 'tsconfig.tsup.json',
shims: true,
bundle: true,
});
+2 -1
View File
@@ -12,7 +12,8 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "bundler"
"moduleResolution": "bundler",
"declaration": true,
},
"references": [
{ "path": "./ai-service" }