Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mprocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ procs:
cwd: .
color: blue

main:
cmd: ["pnpm", "run", "dev:main"]
node:
cmd: ["pnpm", "run", "dev:node"]
cwd: .
color: green

Expand All @@ -15,4 +15,4 @@ procs:
color: yellow
depends_on:
- vite
- main
- node
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"scripts": {
"dev": "mprocs",
"dev:vite": "vite",
"dev:main": "tsc -p tsconfig.json --watch & tsc -p tsconfig.preload.json --watch",
"dev:node": "tsc -p tsconfig.node.json --watch",
"dev:electron": "wait-on tcp:5173 && wait-on dist/main/index.js && electron . --dev",
"build": "pnpm run build:main && pnpm run build:vite && pnpm run build:electron",
"build:main": "tsc -p tsconfig.json && tsc -p tsconfig.preload.json && echo '{\"type\":\"module\"}' > dist/main/package.json",
"build": "pnpm run build:node && pnpm run build:vite && pnpm run build:electron",
"build:node": "tsc -p tsconfig.node.json",
"build:vite": "vite build",
"build:electron": "electron-builder",
"preview": "vite preview",
"typecheck": "tsc --noEmit",
"typecheck": "tsc -p tsconfig.node.json --noEmit && tsc -p tsconfig.web.json --noEmit",
"lint": "eslint src --ext .ts,.tsx",
"generate-client": "tsx scripts/update-openapi-client.ts"
},
Expand Down
14 changes: 7 additions & 7 deletions src/api/posthogClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class PostHogAPIClient {
private api: ReturnType<typeof createApiClient>;
private _teamId: number | null = null;

constructor(private apiKey: string, private apiHost: string) {
constructor(apiKey: string, apiHost: string) {
const baseUrl = apiHost.endsWith('/') ? apiHost.slice(0, -1) : apiHost;
this.api = createApiClient(
buildApiFetcher({ apiToken: apiKey }),
Expand Down Expand Up @@ -64,24 +64,24 @@ export class PostHogAPIClient {
}

async createTask(
title: string,
title: string,
description: string,
repositoryConfig?: { organization: string; repository: string }
) {
const teamId = await this.getTeamId();

const payload = {
title,
description,
origin_product: 'user_created',
origin_product: 'user_created' as const,
...(repositoryConfig && { repository_config: repositoryConfig }),
};

const data = await this.api.post(`/api/projects/{project_id}/tasks/`, {
path: {project_id: teamId.toString()},
body: payload
body: payload as Schemas.Task
});

return data;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, Menu, MenuItemConstructorOptions } from 'electron';
import { app, BrowserWindow, Menu, type MenuItemConstructorOptions } from 'electron';
import path from 'path';
import { fileURLToPath } from 'url';
import { registerPosthogIpc } from './services/posthog.js';
Expand Down
2 changes: 1 addition & 1 deletion src/main/preload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
import { contextBridge, ipcRenderer, type IpcRendererEvent } from 'electron';

interface MessageBoxOptions {
type?: 'info' | 'error' | 'warning' | 'question';
Expand Down
4 changes: 2 additions & 2 deletions src/main/services/agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ipcMain, BrowserWindow, IpcMainInvokeEvent } from 'electron';
import { ipcMain, BrowserWindow, type IpcMainInvokeEvent } from 'electron';
import { getCurrentBranch } from './git.js';
import { createAgent, ClaudeCodeAgent } from '@posthog/code-agent';

Expand All @@ -15,7 +15,7 @@ interface TaskController {
}

export function registerAgentIpc(taskControllers: Map<string, TaskController>, getMainWindow: () => BrowserWindow | null): void {
ipcMain.handle('agent-start', async (_event: IpcMainInvokeEvent, { prompt, repoPath, model }: AgentStartParams): Promise<{ taskId: string; channel: string }> => {
ipcMain.handle('agent-start', async (_event: IpcMainInvokeEvent, { prompt, repoPath }: AgentStartParams): Promise<{ taskId: string; channel: string }> => {
if (!prompt || !repoPath) {
throw new Error('prompt and repoPath are required');
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/services/os.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ipcMain, dialog, BrowserWindow, IpcMainInvokeEvent } from 'electron';
import { ipcMain, dialog, BrowserWindow, type IpcMainInvokeEvent } from 'electron';
import path from 'path';
import fs from 'fs';
import { promisify } from 'util';
Expand Down
2 changes: 1 addition & 1 deletion src/main/services/posthog.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ipcMain, safeStorage, IpcMainInvokeEvent } from 'electron';
import { ipcMain, safeStorage, type IpcMainInvokeEvent } from 'electron';

export function registerPosthogIpc(): void {
// IPC handlers for secure storage
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { radixThemePreset } = require('radix-themes-tw');
import { radixThemePreset } from 'radix-themes-tw';

/** @type {import('tailwindcss').Config} */
module.exports = {
Expand Down
54 changes: 44 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"lib": ["ES2020"],
"moduleResolution": "node",
"allowJs": true,
"baseUrl": "./src",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": true,
"isolatedModules": true,
"jsx": "preserve",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"paths": {
"@/*": [
"./*"
],
"@api/*": [
"api/*"
],
"@main/*": [
"main/*"
],
"@renderer/*": [
"renderer/*"
],
"@shared/*": [
"shared/*"
]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"resolveJsonModule": true,
"outDir": "dist/main",
"rootDir": "src/main",
"types": ["node"]
"target": "esnext"
},
"include": ["src/main/**/*"],
"exclude": ["node_modules", "src/main/preload.ts"]
"exclude": [
"node_modules",
"dist",
"release"
],
"include": [
"src/**/*"
]
}
23 changes: 23 additions & 0 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"noEmit": false,
"module": "ES2022",
"moduleResolution": "node",
"verbatimModuleSyntax": true,
"types": [
"node"
]
},
"exclude": [
"src/renderer/**/*"
],
"extends": "./tsconfig.json",
"include": [
"src/main/**/*",
"src/shared/**/*",
"src/api/**/*"
]
}
17 changes: 0 additions & 17 deletions tsconfig.preload.json

This file was deleted.

39 changes: 0 additions & 39 deletions tsconfig.renderer.json

This file was deleted.

26 changes: 26 additions & 0 deletions tsconfig.web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"jsx": "react-jsx",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable"
],
"outDir": "./dist/renderer",
"target": "ESNext",
"types": [
"vite/client"
]
},
"exclude": [
"src/main/**/*",
"src/api/repoDetector.ts"
],
"extends": "./tsconfig.json",
"include": [
"src/renderer/**/*",
"src/shared/**/*",
"src/api/**/*"
]
}
3 changes: 3 additions & 0 deletions vite.config.ts → vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default defineConfig({
plugins: [react()],
Expand Down