@posthog/agent 2.3.302 → 2.3.304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent.js CHANGED
@@ -245,7 +245,7 @@ import { v7 as uuidv7 } from "uuid";
245
245
  // package.json
246
246
  var package_default = {
247
247
  name: "@posthog/agent",
248
- version: "2.3.302",
248
+ version: "2.3.304",
249
249
  repository: "https://github.com/PostHog/code",
250
250
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
251
251
  exports: {
@@ -4670,6 +4670,16 @@ function toCodexPermissionMode(mode) {
4670
4670
  }
4671
4671
  return "auto";
4672
4672
  }
4673
+ function prependPrContext(params) {
4674
+ const prContext = params._meta?.prContext;
4675
+ if (typeof prContext !== "string" || prContext.length === 0) {
4676
+ return params;
4677
+ }
4678
+ return {
4679
+ ...params,
4680
+ prompt: [{ type: "text", text: prContext }, ...params.prompt]
4681
+ };
4682
+ }
4673
4683
  var CODEX_NATIVE_MODE = {
4674
4684
  default: "auto",
4675
4685
  acceptEdits: "auto",
@@ -4877,7 +4887,9 @@ var CodexAcpAgent = class extends BaseAcpAgent {
4877
4887
  this.session.interruptReason = void 0;
4878
4888
  resetUsage(this.sessionState);
4879
4889
  await this.broadcastUserMessage(params);
4880
- const response = await this.codexConnection.prompt(params);
4890
+ const response = await this.codexConnection.prompt(
4891
+ prependPrContext(params)
4892
+ );
4881
4893
  if (this.sessionState.taskRunId) {
4882
4894
  const { accumulatedUsage } = this.sessionState;
4883
4895
  await this.client.extNotification(POSTHOG_NOTIFICATIONS.TURN_COMPLETE, {