diff --git a/.github/workflows/agent-release.yml b/.github/workflows/agent-release.yml index feaf653f2f..bcd48962ab 100644 --- a/.github/workflows/agent-release.yml +++ b/.github/workflows/agent-release.yml @@ -57,6 +57,9 @@ jobs: - name: Build enricher (agent dependency) run: pnpm --filter @posthog/enricher run build + - name: Build harness (agent dependency) + run: pnpm --filter @posthog/harness run build + - name: Build the package run: pnpm --filter agent run build diff --git a/packages/agent/package.json b/packages/agent/package.json index 1f253ca628..cd94555a5c 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -145,6 +145,7 @@ "@posthog/shared": "workspace:*", "@posthog/git": "workspace:*", "@posthog/enricher": "workspace:*", + "@posthog/harness": "workspace:*", "@types/bun": "latest", "@types/tar": "^6.1.13", "msw": "^2.12.7", @@ -167,7 +168,6 @@ "@opentelemetry/resources": "^2.0.0", "@opentelemetry/sdk-logs": "^0.208.0", "@opentelemetry/semantic-conventions": "^1.28.0", - "@posthog/harness": "workspace:*", "@types/jsonwebtoken": "^9.0.10", "commander": "^14.0.2", "fflate": "^0.8.2", diff --git a/packages/agent/src/pi/rpc-client.ts b/packages/agent/src/pi/rpc-client.ts index 5806b77d1c..1479a4d6af 100644 --- a/packages/agent/src/pi/rpc-client.ts +++ b/packages/agent/src/pi/rpc-client.ts @@ -11,12 +11,17 @@ import { RpcClient, type RpcClientOptions, } from "@earendil-works/pi-coding-agent"; -import type { PosthogProviderOptions } from "@posthog/harness/extensions/posthog-provider/provider"; import { safePiEnvironment } from "./rpc-environment"; import type { PiModelOption, PiThinkingLevel } from "./types"; export type PiRpcClient = RpcClient; +export interface PiRpcProviderOptions { + region?: "us" | "eu" | "dev"; + apiKey: string; + baseUrl?: string; +} + export async function getAvailableModelsWithThinkingLevels( client: PiRpcClient, ): Promise { @@ -70,7 +75,7 @@ function attachJsonlReader( class SecurePiRpcClient extends RpcClient { constructor( private readonly secureOptions: RpcClientOptions, - private readonly providerOptions: PosthogProviderOptions, + private readonly providerOptions: PiRpcProviderOptions, ) { super(secureOptions); } @@ -164,7 +169,7 @@ export function getPiRpcClientProcess( export type PiRpcClientOptions = Pick & { sessionFile?: string; - providerOptions: PosthogProviderOptions & { apiKey: string }; + providerOptions: PiRpcProviderOptions; }; export function createPiRpcClient(options: PiRpcClientOptions): PiRpcClient { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bea5e28250..7474e52bad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -766,9 +766,6 @@ importers: '@opentelemetry/semantic-conventions': specifier: ^1.28.0 version: 1.39.0 - '@posthog/harness': - specifier: workspace:* - version: link:../harness '@types/jsonwebtoken': specifier: ^9.0.10 version: 9.0.10 @@ -806,6 +803,9 @@ importers: '@posthog/git': specifier: workspace:* version: link:../git + '@posthog/harness': + specifier: workspace:* + version: link:../harness '@posthog/shared': specifier: workspace:* version: link:../shared