Skip to content
Open
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
16 changes: 2 additions & 14 deletions apps/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"author": "PostHog",
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "2.2.4",
"@electron-forge/cli": "^7.11.1",
"@electron-forge/maker-deb": "^7.11.1",
"@electron-forge/maker-dmg": "^7.11.1",
Expand All @@ -60,15 +59,12 @@
"@storybook/addon-docs": "10.2.0",
"@storybook/react-vite": "10.2.0",
"@tanstack/devtools-vite": "^0.7.0",
"@tanstack/react-router": "catalog:",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/better-sqlite3": "^7.6.13",
"@types/canvas-confetti": "^1.9.0",
"@types/node": "^24.0.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.1.0",
"@types/semver": "^7.7.1",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/ui": "^4.0.10",
"adm-zip": "^0.5.16",
Expand All @@ -77,10 +73,10 @@
"jimp": "^1.6.0",
"jsdom": "^26.0.0",
"lint-staged": "^15.5.2",
"memfs": "^4.56.10",
"postcss": "^8.4.33",
"storybook": "10.2.0",
"tailwindcss": "^4.2.2",
"tar": "^7.5.0",
"tsx": "^4.20.6",
"typed-openapi": "^2.2.2",
"typescript": "^5.9.3",
Expand All @@ -92,9 +88,6 @@
"dependencies": {
"@fontsource-variable/inter": "^5.2.8",
"@inversifyjs/strongly-typed": "2.2.0",
"@json-render/core": "^0.19.0",
"@modelcontextprotocol/sdk": "^1.12.1",
"@opentelemetry/api-logs": "^0.208.0",
"@opentelemetry/exporter-logs-otlp-http": "^0.208.0",
"@opentelemetry/resources": "^2.5.0",
"@opentelemetry/sdk-logs": "^0.208.0",
Expand Down Expand Up @@ -134,7 +127,6 @@
"electron-store": "^11.0.0",
"fflate": "^0.8.2",
"file-icon": "^6.0.0",
"fzf": "^0.5.2",
"ignore": "^7.0.5",
"inversify": "^7.10.6",
"is-glob": "^4.0.3",
Expand All @@ -148,11 +140,7 @@
"react-dom": "19.1.0",
"react-hotkeys-hook": "^4.4.4",
"reflect-metadata": "^0.2.2",
"semver": "^7.6.0",
"shadcn": "^4.1.2",
"smol-toml": "^1.6.0",
"tailwindcss-scroll-mask": "^0.0.3",
"tw-animate-css": "^1.4.0",
"zod": "^4.1.12"
}
}
4 changes: 0 additions & 4 deletions apps/code/src/main/utils/__mocks__/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ export const logger = {
debug: vi.fn(),
scope: () => createScopedLogger(),
};

export type Logger = typeof logger;
export type ScopedLogger = ReturnType<typeof logger.scope>;

export const getLogFilePath = vi.fn(() => "/mock/path/main.log");
2 changes: 0 additions & 2 deletions apps/code/src/main/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ log.transports.ipc.level = level;
log.transports.otel = initOtelTransport(level);

export const logger = log;
export type Logger = typeof logger;
export type ScopedLogger = ReturnType<typeof logger.scope>;

export function getLogFilePath(): string {
return join(LOG_DIR, LOG_FILE);
Expand Down
4 changes: 0 additions & 4 deletions apps/code/src/renderer/di/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,3 @@ container.bind(TITLE_GENERATOR_FILE_READ_CLIENT).toConstantValue({
container
.bind(TITLE_GENERATOR_LOGGER)
.toConstantValue(logger.scope("title-generator"));

export function get<T>(token: symbol): T {
return container.get<T>(token);
}
8 changes: 0 additions & 8 deletions apps/code/src/renderer/di/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,3 @@ export const TRPC_CLIENT = Symbol.for("posthog.host.renderer.trpc-client");

// Services
export const TASK_SERVICE = Symbol.for("posthog.host.renderer.task-service");

export const RENDERER_TOKENS = Object.freeze({
// Infrastructure
TRPCClient: TRPC_CLIENT,

// Services
TaskService: TASK_SERVICE,
});
10 changes: 0 additions & 10 deletions apps/code/src/shared/constants.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
export const BILLING_FLAG = "posthog-code-billing";
export const EXPERIMENT_SUGGESTIONS_FLAG =
"posthog-code-experiment-suggestions";
export const SELF_DRIVING_SETUP_TASK_FLAG =
"posthog-code-self-driving-setup-task";
export const SYNC_CLOUD_TASKS_FLAG = "posthog-code-sync-cloud-tasks";
export const HOME_TAB_FLAG = "posthog-code-home-tab";
export const DISCOVERY_RUN_FLAG = "posthog-code-discovery-run";
export const BRANCH_PREFIX = "posthog-code/";
export const DATA_DIR = ".posthog-code";
export const WORKTREES_DIR = ".posthog-code/worktrees";
export const LEGACY_DATA_DIRS = [
".twig",
Expand Down
4 changes: 1 addition & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@
},
"dependencies": {
"@inversifyjs/strongly-typed": "2.2.0",
"@posthog/core": "workspace:*",
"@posthog/di": "workspace:*",
"@posthog/host-router": "workspace:*",
"@posthog/platform": "workspace:*",
"@posthog/shared": "workspace:*",
"@posthog/ui": "workspace:*",
"@posthog/workspace-client": "workspace:*",
"@tanstack/react-query": "^5.90.2",
"@trpc/client": "^11.12.0",
"@trpc/tanstack-react-query": "^11.12.0",
"inversify": "^7.10.6",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-hotkeys-hook": "^4.4.4",
"reflect-metadata": "^0.2.2"
},
"devDependencies": {
Expand Down
12 changes: 8 additions & 4 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
"ignoreWorkspaces": ["apps/mobile", "apps/twig", "apps/web"],
"ignoreWorkspaces": ["apps/mobile"],
"workspaces": {
".": {
"entry": ["mprocs.yaml", "scripts/*.{mjs,js,ts}"]
Expand Down Expand Up @@ -29,7 +29,11 @@
"is-glob",
"micromatch",
"node-addon-api",
"@vitest/coverage-v8"
"@vitest/coverage-v8",
"better-sqlite3",
"node-pty",
"@parcel/watcher",
"drizzle-orm"
]
},
"apps/cli": {
Expand Down Expand Up @@ -69,10 +73,10 @@
"includeEntryExports": true
},
"packages/enricher": {
"entry": ["src/**/*.test.ts", "scripts/*.cjs"],
"entry": ["src/index.ts", "src/**/*.test.ts", "scripts/*.cjs"],
"project": ["src/**/*.ts"],
"ignoreDependencies": ["tree-sitter-cli"],
"includeEntryExports": true
"includeEntryExports": false
},
"packages/git": {
"entry": ["src/*.ts", "src/**/*.test.ts"],
Expand Down
12 changes: 0 additions & 12 deletions packages/agent/src/resume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,6 @@ export async function resumeFromLog(
};
}

/**
* Convert resumed conversation back to API format for continuation.
*/
export function conversationToPromptHistory(
conversation: ConversationTurn[],
): Array<{ role: "user" | "assistant"; content: ContentBlock[] }> {
return conversation.map((turn) => ({
role: turn.role,
content: turn.content,
}));
}

const RESUME_HISTORY_TOKEN_BUDGET = 50_000;
const TOOL_RESULT_MAX_CHARS = 2000;

Expand Down
3 changes: 0 additions & 3 deletions packages/agent/src/server/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ export const jsonRpcRequestSchema = z.object({
params: z.record(z.string(), z.unknown()).optional(),
id: z.union([z.string(), z.number()]).optional(),
});

export type JsonRpcRequest = z.infer<typeof jsonRpcRequestSchema>;

export const userMessageParamsSchema = z
.object({
content: z
Expand Down
37 changes: 0 additions & 37 deletions packages/agent/src/test/fixtures/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { promisify } from "node:util";
import { vi } from "vitest";
import type { PostHogAPIClient } from "../../posthog-api";
import type { TaskRun } from "../../types";

const execFileAsync = promisify(execFile);

Expand Down Expand Up @@ -63,37 +60,3 @@ export async function createTestRepo(prefix = "test-repo"): Promise<TestRepo> {
},
};
}

export function createMockApiClient(
overrides: Partial<PostHogAPIClient> = {},
): PostHogAPIClient {
return {
uploadTaskArtifacts: vi
.fn()
.mockResolvedValue([{ storage_path: "gs://bucket/handoff/test.pack" }]),
downloadArtifact: vi.fn(),
getTaskRun: vi.fn(),
fetchTaskRunLogs: vi.fn(),
...overrides,
} as unknown as PostHogAPIClient;
}

export function createTaskRun(overrides: Partial<TaskRun> = {}): TaskRun {
return {
id: "run-1",
task: "task-1",
team: 1,
branch: null,
stage: null,
environment: "local",
status: "in_progress",
log_url: "https://logs.example.com/run-1",
error_message: null,
output: null,
state: {},
created_at: new Date().toISOString(),
updated_at: new Date().toISOString(),
completed_at: null,
...overrides,
};
}
33 changes: 0 additions & 33 deletions packages/agent/src/test/fixtures/config.ts

This file was deleted.

Loading
Loading