@posthog/agent 2.3.13 → 2.3.18

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.
Files changed (63) hide show
  1. package/dist/adapters/claude/conversion/tool-use-to-acp.js.map +1 -1
  2. package/dist/adapters/claude/permissions/permission-options.js.map +1 -1
  3. package/dist/adapters/claude/questions/utils.js.map +1 -1
  4. package/dist/adapters/claude/session/jsonl-hydration.js.map +1 -1
  5. package/dist/adapters/claude/tools.js.map +1 -1
  6. package/dist/agent.js +21 -5
  7. package/dist/agent.js.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/posthog-api.js +1 -1
  10. package/dist/posthog-api.js.map +1 -1
  11. package/dist/server/agent-server.js +21 -5
  12. package/dist/server/agent-server.js.map +1 -1
  13. package/dist/server/bin.cjs +21 -5
  14. package/dist/server/bin.cjs.map +1 -1
  15. package/package.json +1 -1
  16. package/src/adapters/acp-connection.ts +7 -7
  17. package/src/adapters/base-acp-agent.ts +3 -3
  18. package/src/adapters/claude/claude-agent.ts +15 -15
  19. package/src/adapters/claude/conversion/sdk-to-acp.ts +6 -6
  20. package/src/adapters/claude/conversion/tool-use-to-acp.ts +2 -2
  21. package/src/adapters/claude/hooks.ts +3 -3
  22. package/src/adapters/claude/mcp/tool-metadata.ts +1 -1
  23. package/src/adapters/claude/permissions/permission-handlers.ts +8 -8
  24. package/src/adapters/claude/permissions/permission-options.ts +1 -1
  25. package/src/adapters/claude/questions/utils.ts +1 -1
  26. package/src/adapters/claude/session/instructions.ts +19 -0
  27. package/src/adapters/claude/session/jsonl-hydration.test.ts +2 -2
  28. package/src/adapters/claude/session/jsonl-hydration.ts +2 -2
  29. package/src/adapters/claude/session/options.ts +11 -16
  30. package/src/adapters/claude/tools.ts +3 -3
  31. package/src/adapters/claude/types.ts +4 -4
  32. package/src/adapters/codex/spawn.ts +2 -2
  33. package/src/agent.ts +6 -6
  34. package/src/execution-mode.ts +1 -1
  35. package/src/index.ts +1 -1
  36. package/src/otel-log-writer.test.ts +2 -2
  37. package/src/otel-log-writer.ts +2 -2
  38. package/src/posthog-api.ts +2 -2
  39. package/src/resume.ts +4 -4
  40. package/src/sagas/apply-snapshot-saga.test.ts +2 -2
  41. package/src/sagas/apply-snapshot-saga.ts +2 -2
  42. package/src/sagas/capture-tree-saga.test.ts +3 -3
  43. package/src/sagas/capture-tree-saga.ts +2 -2
  44. package/src/sagas/resume-saga.test.ts +4 -4
  45. package/src/sagas/resume-saga.ts +5 -5
  46. package/src/sagas/test-fixtures.ts +3 -3
  47. package/src/server/agent-server.test.ts +5 -5
  48. package/src/server/agent-server.ts +14 -14
  49. package/src/server/bin.ts +2 -2
  50. package/src/server/question-relay.test.ts +5 -5
  51. package/src/server/schemas.test.ts +1 -1
  52. package/src/server/types.ts +2 -2
  53. package/src/server/utils/retry.test.ts +1 -1
  54. package/src/server/utils/sse-parser.test.ts +1 -1
  55. package/src/session-log-writer.test.ts +3 -3
  56. package/src/session-log-writer.ts +4 -4
  57. package/src/test/fixtures/api.ts +2 -2
  58. package/src/test/fixtures/config.ts +2 -2
  59. package/src/tree-tracker.ts +5 -5
  60. package/src/utils/async-mutex.test.ts +1 -1
  61. package/src/utils/common.ts +1 -1
  62. package/src/utils/logger.ts +1 -1
  63. package/src/utils/streams.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/agent",
3
- "version": "2.3.13",
3
+ "version": "2.3.18",
4
4
  "repository": "https://github.com/PostHog/code",
5
5
  "description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
6
6
  "exports": {
@@ -1,17 +1,17 @@
1
1
  import { AgentSideConnection, ndJsonStream } from "@agentclientprotocol/sdk";
2
- import { POSTHOG_NOTIFICATIONS } from "../acp-extensions.js";
3
- import type { SessionLogWriter } from "../session-log-writer.js";
4
- import type { ProcessSpawnedCallback } from "../types.js";
5
- import { Logger } from "../utils/logger.js";
2
+ import { POSTHOG_NOTIFICATIONS } from "../acp-extensions";
3
+ import type { SessionLogWriter } from "../session-log-writer";
4
+ import type { ProcessSpawnedCallback } from "../types";
5
+ import { Logger } from "../utils/logger";
6
6
  import {
7
7
  createBidirectionalStreams,
8
8
  createTappedWritableStream,
9
9
  nodeReadableToWebReadable,
10
10
  nodeWritableToWebWritable,
11
11
  type StreamPair,
12
- } from "../utils/streams.js";
13
- import { ClaudeAcpAgent } from "./claude/claude-agent.js";
14
- import { type CodexProcessOptions, spawnCodexProcess } from "./codex/spawn.js";
12
+ } from "../utils/streams";
13
+ import { ClaudeAcpAgent } from "./claude/claude-agent";
14
+ import { type CodexProcessOptions, spawnCodexProcess } from "./codex/spawn";
15
15
 
16
16
  type AgentAdapter = "claude" | "codex";
17
17
 
@@ -21,9 +21,9 @@ import {
21
21
  fetchGatewayModels,
22
22
  formatGatewayModelName,
23
23
  isAnthropicModel,
24
- } from "../gateway-models.js";
25
- import { Logger } from "../utils/logger.js";
26
- import type { SettingsManager } from "./claude/session/settings.js";
24
+ } from "../gateway-models";
25
+ import { Logger } from "../utils/logger";
26
+ import type { SettingsManager } from "./claude/session/settings";
27
27
 
28
28
  export interface BaseSession {
29
29
  notificationHistory: SessionNotification[];
@@ -44,40 +44,40 @@ import {
44
44
  } from "@anthropic-ai/claude-agent-sdk";
45
45
  import { v7 as uuidv7 } from "uuid";
46
46
  import packageJson from "../../../package.json" with { type: "json" };
47
- import { unreachable, withTimeout } from "../../utils/common.js";
48
- import { Logger } from "../../utils/logger.js";
49
- import { Pushable } from "../../utils/streams.js";
50
- import { BaseAcpAgent } from "../base-acp-agent.js";
51
- import { promptToClaude } from "./conversion/acp-to-sdk.js";
47
+ import { unreachable, withTimeout } from "../../utils/common";
48
+ import { Logger } from "../../utils/logger";
49
+ import { Pushable } from "../../utils/streams";
50
+ import { BaseAcpAgent } from "../base-acp-agent";
51
+ import { promptToClaude } from "./conversion/acp-to-sdk";
52
52
  import {
53
53
  handleResultMessage,
54
54
  handleStreamEvent,
55
55
  handleSystemMessage,
56
56
  handleUserAssistantMessage,
57
- } from "./conversion/sdk-to-acp.js";
58
- import { fetchMcpToolMetadata } from "./mcp/tool-metadata.js";
59
- import { canUseTool } from "./permissions/permission-handlers.js";
60
- import { getAvailableSlashCommands } from "./session/commands.js";
61
- import { parseMcpServers } from "./session/mcp-config.js";
62
- import { DEFAULT_MODEL, toSdkModelId } from "./session/models.js";
57
+ } from "./conversion/sdk-to-acp";
58
+ import { fetchMcpToolMetadata } from "./mcp/tool-metadata";
59
+ import { canUseTool } from "./permissions/permission-handlers";
60
+ import { getAvailableSlashCommands } from "./session/commands";
61
+ import { parseMcpServers } from "./session/mcp-config";
62
+ import { DEFAULT_MODEL, toSdkModelId } from "./session/models";
63
63
  import {
64
64
  buildSessionOptions,
65
65
  buildSystemPrompt,
66
66
  type ProcessSpawnedInfo,
67
- } from "./session/options.js";
68
- import { SettingsManager } from "./session/settings.js";
67
+ } from "./session/options";
68
+ import { SettingsManager } from "./session/settings";
69
69
  import {
70
70
  CODE_EXECUTION_MODES,
71
71
  type CodeExecutionMode,
72
72
  getAvailableModes,
73
- } from "./tools.js";
73
+ } from "./tools";
74
74
  import type {
75
75
  BackgroundTerminal,
76
76
  EffortLevel,
77
77
  NewSessionMeta,
78
78
  Session,
79
79
  ToolUseCache,
80
- } from "./types.js";
80
+ } from "./types";
81
81
 
82
82
  const SESSION_VALIDATION_TIMEOUT_MS = 10_000;
83
83
  const MAX_TITLE_LENGTH = 256;
@@ -17,18 +17,18 @@ import type {
17
17
  BetaContentBlock,
18
18
  BetaRawContentBlockDelta,
19
19
  } from "@anthropic-ai/sdk/resources/beta.mjs";
20
- import { image, text } from "../../../utils/acp-content.js";
21
- import { unreachable } from "../../../utils/common.js";
22
- import type { Logger } from "../../../utils/logger.js";
23
- import { registerHookCallback } from "../hooks.js";
24
- import type { Session, ToolUpdateMeta, ToolUseCache } from "../types.js";
20
+ import { image, text } from "../../../utils/acp-content";
21
+ import { unreachable } from "../../../utils/common";
22
+ import type { Logger } from "../../../utils/logger";
23
+ import { registerHookCallback } from "../hooks";
24
+ import type { Session, ToolUpdateMeta, ToolUseCache } from "../types";
25
25
  import {
26
26
  type ClaudePlanEntry,
27
27
  planEntries,
28
28
  toolInfoFromToolUse,
29
29
  toolUpdateFromEditToolResponse,
30
30
  toolUpdateFromToolResult,
31
- } from "./tool-use-to-acp.js";
31
+ } from "./tool-use-to-acp";
32
32
 
33
33
  type AnthropicContentChunk =
34
34
  | ContentBlockParam
@@ -29,8 +29,8 @@ function stripSystemReminders(value: string): string {
29
29
  return value.replace(SYSTEM_REMINDER_REGEX, "");
30
30
  }
31
31
 
32
- import { resourceLink, text, toolContent } from "../../../utils/acp-content.js";
33
- import { getMcpToolMetadata } from "../mcp/tool-metadata.js";
32
+ import { resourceLink, text, toolContent } from "../../../utils/acp-content";
33
+ import { getMcpToolMetadata } from "../mcp/tool-metadata";
34
34
 
35
35
  type ToolInfo = Pick<ToolCall, "title" | "kind" | "content" | "locations">;
36
36
 
@@ -1,7 +1,7 @@
1
1
  import type { HookCallback, HookInput } from "@anthropic-ai/claude-agent-sdk";
2
- import type { Logger } from "../../utils/logger.js";
3
- import type { SettingsManager } from "./session/settings.js";
4
- import type { CodeExecutionMode } from "./tools.js";
2
+ import type { Logger } from "../../utils/logger";
3
+ import type { SettingsManager } from "./session/settings";
4
+ import type { CodeExecutionMode } from "./tools";
5
5
 
6
6
  const toolUseCallbacks: {
7
7
  [toolUseId: string]: {
@@ -1,5 +1,5 @@
1
1
  import type { McpServerStatus, Query } from "@anthropic-ai/claude-agent-sdk";
2
- import { Logger } from "../../../utils/logger.js";
2
+ import { Logger } from "../../../utils/logger";
3
3
 
4
4
  export interface McpToolMetadata {
5
5
  readOnly: boolean;
@@ -3,27 +3,27 @@ import type {
3
3
  RequestPermissionResponse,
4
4
  } from "@agentclientprotocol/sdk";
5
5
  import type { PermissionUpdate } from "@anthropic-ai/claude-agent-sdk";
6
- import { text } from "../../../utils/acp-content.js";
7
- import type { Logger } from "../../../utils/logger.js";
8
- import { toolInfoFromToolUse } from "../conversion/tool-use-to-acp.js";
6
+ import { text } from "../../../utils/acp-content";
7
+ import type { Logger } from "../../../utils/logger";
8
+ import { toolInfoFromToolUse } from "../conversion/tool-use-to-acp";
9
9
  import {
10
10
  getClaudePlansDir,
11
11
  getLatestAssistantText,
12
12
  isClaudePlanFilePath,
13
13
  isPlanReady,
14
- } from "../plan/utils.js";
14
+ } from "../plan/utils";
15
15
  import {
16
16
  type AskUserQuestionInput,
17
17
  normalizeAskUserQuestionInput,
18
18
  OPTION_PREFIX,
19
19
  type QuestionItem,
20
- } from "../questions/utils.js";
21
- import { isToolAllowedForMode, WRITE_TOOLS } from "../tools.js";
22
- import type { Session } from "../types.js";
20
+ } from "../questions/utils";
21
+ import { isToolAllowedForMode, WRITE_TOOLS } from "../tools";
22
+ import type { Session } from "../types";
23
23
  import {
24
24
  buildExitPlanModePermissionOptions,
25
25
  buildPermissionOptions,
26
- } from "./permission-options.js";
26
+ } from "./permission-options";
27
27
 
28
28
  export type ToolPermissionResult =
29
29
  | {
@@ -1,5 +1,5 @@
1
1
  import type { PermissionUpdate } from "@anthropic-ai/claude-agent-sdk";
2
- import { BASH_TOOLS, READ_TOOLS, SEARCH_TOOLS, WRITE_TOOLS } from "../tools.js";
2
+ import { BASH_TOOLS, READ_TOOLS, SEARCH_TOOLS, WRITE_TOOLS } from "../tools";
3
3
 
4
4
  export interface PermissionOption {
5
5
  kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
@@ -1,6 +1,6 @@
1
1
  import type { ToolCallContent, ToolKind } from "@agentclientprotocol/sdk";
2
2
  import { z } from "zod";
3
- import type { PermissionOption } from "../permissions/permission-options.js";
3
+ import type { PermissionOption } from "../permissions/permission-options";
4
4
 
5
5
  export const OPTION_PREFIX = "option_";
6
6
 
@@ -0,0 +1,19 @@
1
+ const BRANCH_NAMING = `
2
+ # Branch Naming
3
+
4
+ When working in a detached HEAD state, create a descriptive branch name based on the work being done before committing. Do this automatically without asking the user.
5
+ `;
6
+
7
+ const PLAN_MODE = `
8
+ # Plan Mode
9
+
10
+ Only enter plan mode (EnterPlanMode) when the user is requesting a significant change in approach or direction mid-task. Do NOT enter plan mode for:
11
+ - Confirmations or approvals ("yes", "looks good", "continue", "go ahead")
12
+ - Minor clarifications or small adjustments
13
+ - Answers to questions you asked (unless you are still in the initial planning phase and have not yet started executing)
14
+ - Feedback that does not require replanning
15
+
16
+ When in doubt, continue executing and incorporate the feedback inline.
17
+ `;
18
+
19
+ export const APPENDED_INSTRUCTIONS = BRANCH_NAMING + PLAN_MODE;
@@ -1,10 +1,10 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import type { StoredEntry } from "../../../types.js";
2
+ import type { StoredEntry } from "../../../types";
3
3
  import {
4
4
  conversationTurnsToJsonlEntries,
5
5
  getSessionJsonlPath,
6
6
  rebuildConversation,
7
- } from "./jsonl-hydration.js";
7
+ } from "./jsonl-hydration";
8
8
 
9
9
  function entry(
10
10
  sessionUpdate: string,
@@ -3,8 +3,8 @@ import * as fs from "node:fs/promises";
3
3
  import * as os from "node:os";
4
4
  import * as path from "node:path";
5
5
  import type { ContentBlock } from "@agentclientprotocol/sdk";
6
- import type { PostHogAPIClient } from "../../../posthog-api.js";
7
- import type { StoredEntry } from "../../../types.js";
6
+ import type { PostHogAPIClient } from "../../../posthog-api";
7
+ import type { StoredEntry } from "../../../types";
8
8
 
9
9
  interface ConversationTurn {
10
10
  role: "user" | "assistant";
@@ -9,17 +9,18 @@ import type {
9
9
  SpawnedProcess,
10
10
  SpawnOptions,
11
11
  } from "@anthropic-ai/claude-agent-sdk";
12
- import { IS_ROOT } from "../../../utils/common.js";
13
- import type { Logger } from "../../../utils/logger.js";
12
+ import { IS_ROOT } from "../../../utils/common";
13
+ import type { Logger } from "../../../utils/logger";
14
14
  import {
15
15
  createPostToolUseHook,
16
16
  createPreToolUseHook,
17
17
  type OnModeChange,
18
- } from "../hooks.js";
19
- import type { CodeExecutionMode } from "../tools.js";
20
- import type { EffortLevel } from "../types.js";
21
- import { DEFAULT_MODEL } from "./models.js";
22
- import type { SettingsManager } from "./settings.js";
18
+ } from "../hooks";
19
+ import type { CodeExecutionMode } from "../tools";
20
+ import type { EffortLevel } from "../types";
21
+ import { APPENDED_INSTRUCTIONS } from "./instructions";
22
+ import { DEFAULT_MODEL } from "./models";
23
+ import type { SettingsManager } from "./settings";
23
24
 
24
25
  export interface ProcessSpawnedInfo {
25
26
  pid: number;
@@ -47,19 +48,13 @@ export interface BuildOptionsParams {
47
48
  effort?: EffortLevel;
48
49
  }
49
50
 
50
- const BRANCH_NAMING_INSTRUCTIONS = `
51
- # Branch Naming
52
-
53
- When working in a detached HEAD state, create a descriptive branch name based on the work being done before committing. Do this automatically without asking the user.
54
- `;
55
-
56
51
  export function buildSystemPrompt(
57
52
  customPrompt?: unknown,
58
53
  ): Options["systemPrompt"] {
59
54
  const defaultPrompt: Options["systemPrompt"] = {
60
55
  type: "preset",
61
56
  preset: "claude_code",
62
- append: BRANCH_NAMING_INSTRUCTIONS,
57
+ append: APPENDED_INSTRUCTIONS,
63
58
  };
64
59
 
65
60
  if (!customPrompt) {
@@ -67,7 +62,7 @@ export function buildSystemPrompt(
67
62
  }
68
63
 
69
64
  if (typeof customPrompt === "string") {
70
- return customPrompt + BRANCH_NAMING_INSTRUCTIONS;
65
+ return customPrompt + APPENDED_INSTRUCTIONS;
71
66
  }
72
67
 
73
68
  if (
@@ -78,7 +73,7 @@ export function buildSystemPrompt(
78
73
  ) {
79
74
  return {
80
75
  ...defaultPrompt,
81
- append: customPrompt.append + BRANCH_NAMING_INSTRUCTIONS,
76
+ append: customPrompt.append + APPENDED_INSTRUCTIONS,
82
77
  };
83
78
  }
84
79
 
@@ -3,10 +3,10 @@ export {
3
3
  type CodeExecutionMode,
4
4
  getAvailableModes,
5
5
  type ModeInfo,
6
- } from "../../execution-mode.js";
6
+ } from "../../execution-mode";
7
7
 
8
- import type { CodeExecutionMode } from "../../execution-mode.js";
9
- import { isMcpToolReadOnly } from "./mcp/tool-metadata.js";
8
+ import type { CodeExecutionMode } from "../../execution-mode";
9
+ import { isMcpToolReadOnly } from "./mcp/tool-metadata";
10
10
 
11
11
  export const READ_TOOLS: Set<string> = new Set(["Read", "NotebookRead"]);
12
12
 
@@ -8,10 +8,10 @@ import type {
8
8
  Query,
9
9
  SDKUserMessage,
10
10
  } from "@anthropic-ai/claude-agent-sdk";
11
- import type { Pushable } from "../../utils/streams.js";
12
- import type { BaseSession } from "../base-acp-agent.js";
13
- import type { SettingsManager } from "./session/settings.js";
14
- import type { CodeExecutionMode } from "./tools.js";
11
+ import type { Pushable } from "../../utils/streams";
12
+ import type { BaseSession } from "../base-acp-agent";
13
+ import type { SettingsManager } from "./session/settings";
14
+ import type { CodeExecutionMode } from "./tools";
15
15
 
16
16
  export type EffortLevel = "low" | "medium" | "high" | "max";
17
17
 
@@ -2,8 +2,8 @@ import { type ChildProcess, spawn } from "node:child_process";
2
2
  import { existsSync } from "node:fs";
3
3
  import { delimiter, dirname } from "node:path";
4
4
  import type { Readable, Writable } from "node:stream";
5
- import type { ProcessSpawnedCallback } from "../../types.js";
6
- import { Logger } from "../../utils/logger.js";
5
+ import type { ProcessSpawnedCallback } from "../../types";
6
+ import { Logger } from "../../utils/logger";
7
7
 
8
8
  export interface CodexProcessOptions {
9
9
  cwd?: string;
package/src/agent.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createAcpConnection,
3
3
  type InProcessAcpConnection,
4
- } from "./adapters/acp-connection.js";
4
+ } from "./adapters/acp-connection";
5
5
  import {
6
6
  BLOCKED_MODELS,
7
7
  DEFAULT_GATEWAY_MODEL,
8
8
  fetchArrayModels,
9
- } from "./gateway-models.js";
10
- import { PostHogAPIClient, type TaskRunUpdate } from "./posthog-api.js";
11
- import { SessionLogWriter } from "./session-log-writer.js";
12
- import type { AgentConfig, TaskExecutionOptions } from "./types.js";
13
- import { Logger } from "./utils/logger.js";
9
+ } from "./gateway-models";
10
+ import { PostHogAPIClient, type TaskRunUpdate } from "./posthog-api";
11
+ import { SessionLogWriter } from "./session-log-writer";
12
+ import type { AgentConfig, TaskExecutionOptions } from "./types";
13
+ import { Logger } from "./utils/logger";
14
14
 
15
15
  export class Agent {
16
16
  private posthogAPI?: PostHogAPIClient;
@@ -1,4 +1,4 @@
1
- import { IS_ROOT } from "./utils/common.js";
1
+ import { IS_ROOT } from "./utils/common";
2
2
 
3
3
  export interface ModeInfo {
4
4
  id: CodeExecutionMode;
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export { isMcpToolReadOnly } from "./adapters/claude/mcp/tool-metadata.js";
1
+ export { isMcpToolReadOnly } from "./adapters/claude/mcp/tool-metadata";
@@ -1,6 +1,6 @@
1
1
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
2
- import { OtelLogWriter } from "./otel-log-writer.js";
3
- import type { StoredNotification } from "./types.js";
2
+ import { OtelLogWriter } from "./otel-log-writer";
3
+ import type { StoredNotification } from "./types";
4
4
 
5
5
  // Mock the OTEL exporter
6
6
  const mockExport = vi.fn((_logs, callback) => {
@@ -6,8 +6,8 @@ import {
6
6
  LoggerProvider,
7
7
  } from "@opentelemetry/sdk-logs";
8
8
  import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
9
- import type { StoredNotification } from "./types.js";
10
- import type { Logger } from "./utils/logger.js";
9
+ import type { StoredNotification } from "./types";
10
+ import type { Logger } from "./utils/logger";
11
11
 
12
12
  export interface OtelLogConfig {
13
13
  /** PostHog ingest host, e.g., "https://us.i.posthog.com" */
@@ -6,8 +6,8 @@ import type {
6
6
  Task,
7
7
  TaskRun,
8
8
  TaskRunArtifact,
9
- } from "./types.js";
10
- import { getLlmGatewayUrl } from "./utils/gateway.js";
9
+ } from "./types";
10
+ import { getLlmGatewayUrl } from "./utils/gateway";
11
11
 
12
12
  export { getLlmGatewayUrl };
13
13
 
package/src/resume.ts CHANGED
@@ -16,10 +16,10 @@
16
16
  */
17
17
 
18
18
  import type { ContentBlock } from "@agentclientprotocol/sdk";
19
- import type { PostHogAPIClient } from "./posthog-api.js";
20
- import { ResumeSaga } from "./sagas/resume-saga.js";
21
- import type { DeviceInfo, TreeSnapshotEvent } from "./types.js";
22
- import { Logger } from "./utils/logger.js";
19
+ import type { PostHogAPIClient } from "./posthog-api";
20
+ import { ResumeSaga } from "./sagas/resume-saga";
21
+ import type { DeviceInfo, TreeSnapshotEvent } from "./types";
22
+ import { Logger } from "./utils/logger";
23
23
 
24
24
  export interface ResumeState {
25
25
  conversation: ConversationTurn[];
@@ -1,7 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import type { SagaLogger } from "@posthog/shared";
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
- import { ApplySnapshotSaga } from "./apply-snapshot-saga.js";
4
+ import { ApplySnapshotSaga } from "./apply-snapshot-saga";
5
5
  import {
6
6
  createArchiveBuffer,
7
7
  createMockApiClient,
@@ -9,7 +9,7 @@ import {
9
9
  createSnapshot,
10
10
  createTestRepo,
11
11
  type TestRepo,
12
- } from "./test-fixtures.js";
12
+ } from "./test-fixtures";
13
13
 
14
14
  describe("ApplySnapshotSaga", () => {
15
15
  let repo: TestRepo;
@@ -2,8 +2,8 @@ import { mkdir, rm, writeFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { ApplyTreeSaga as GitApplyTreeSaga } from "@posthog/git/sagas/tree";
4
4
  import { Saga } from "@posthog/shared";
5
- import type { PostHogAPIClient } from "../posthog-api.js";
6
- import type { TreeSnapshot } from "../types.js";
5
+ import type { PostHogAPIClient } from "../posthog-api";
6
+ import type { TreeSnapshot } from "../types";
7
7
 
8
8
  export interface ApplySnapshotInput {
9
9
  snapshot: TreeSnapshot;
@@ -1,15 +1,15 @@
1
1
  import { join } from "node:path";
2
2
  import type { SagaLogger } from "@posthog/shared";
3
3
  import { afterEach, beforeEach, describe, expect, it, type vi } from "vitest";
4
- import { isCommitOnRemote, validateForCloudHandoff } from "../tree-tracker.js";
5
- import { CaptureTreeSaga } from "./capture-tree-saga.js";
4
+ import { isCommitOnRemote, validateForCloudHandoff } from "../tree-tracker";
5
+ import { CaptureTreeSaga } from "./capture-tree-saga";
6
6
  import {
7
7
  createMockApiClient,
8
8
  createMockLogger,
9
9
  createSnapshot,
10
10
  createTestRepo,
11
11
  type TestRepo,
12
- } from "./test-fixtures.js";
12
+ } from "./test-fixtures";
13
13
 
14
14
  describe("CaptureTreeSaga", () => {
15
15
  let repo: TestRepo;
@@ -3,8 +3,8 @@ import { readFile, rm } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { CaptureTreeSaga as GitCaptureTreeSaga } from "@posthog/git/sagas/tree";
5
5
  import { Saga } from "@posthog/shared";
6
- import type { PostHogAPIClient } from "../posthog-api.js";
7
- import type { TreeSnapshot } from "../types.js";
6
+ import type { PostHogAPIClient } from "../posthog-api";
7
+ import type { TreeSnapshot } from "../types";
8
8
 
9
9
  export interface CaptureTreeInput {
10
10
  repositoryPath: string;
@@ -1,8 +1,8 @@
1
1
  import type { SagaLogger } from "@posthog/shared";
2
2
  import { afterEach, beforeEach, describe, expect, it, type vi } from "vitest";
3
- import { POSTHOG_NOTIFICATIONS } from "../acp-extensions.js";
4
- import type { PostHogAPIClient } from "../posthog-api.js";
5
- import { ResumeSaga } from "./resume-saga.js";
3
+ import { POSTHOG_NOTIFICATIONS } from "../acp-extensions";
4
+ import type { PostHogAPIClient } from "../posthog-api";
5
+ import { ResumeSaga } from "./resume-saga";
6
6
  import {
7
7
  createAgentChunk,
8
8
  createAgentMessage,
@@ -17,7 +17,7 @@ import {
17
17
  createTreeSnapshotNotification,
18
18
  createUserMessage,
19
19
  type TestRepo,
20
- } from "./test-fixtures.js";
20
+ } from "./test-fixtures";
21
21
 
22
22
  describe("ResumeSaga", () => {
23
23
  let repo: TestRepo;
@@ -1,14 +1,14 @@
1
1
  import type { ContentBlock } from "@agentclientprotocol/sdk";
2
2
  import { Saga } from "@posthog/shared";
3
- import { POSTHOG_NOTIFICATIONS } from "../acp-extensions.js";
4
- import type { PostHogAPIClient } from "../posthog-api.js";
5
- import { TreeTracker } from "../tree-tracker.js";
3
+ import { POSTHOG_NOTIFICATIONS } from "../acp-extensions";
4
+ import type { PostHogAPIClient } from "../posthog-api";
5
+ import { TreeTracker } from "../tree-tracker";
6
6
  import type {
7
7
  DeviceInfo,
8
8
  StoredNotification,
9
9
  TreeSnapshotEvent,
10
- } from "../types.js";
11
- import { Logger } from "../utils/logger.js";
10
+ } from "../types";
11
+ import { Logger } from "../utils/logger";
12
12
 
13
13
  export interface ConversationTurn {
14
14
  role: "user" | "assistant";
@@ -7,9 +7,9 @@ import { promisify } from "node:util";
7
7
  import type { SagaLogger } from "@posthog/shared";
8
8
  import * as tar from "tar";
9
9
  import { vi } from "vitest";
10
- import { POSTHOG_NOTIFICATIONS } from "../acp-extensions.js";
11
- import type { PostHogAPIClient } from "../posthog-api.js";
12
- import type { StoredNotification, TaskRun, TreeSnapshot } from "../types.js";
10
+ import { POSTHOG_NOTIFICATIONS } from "../acp-extensions";
11
+ import type { PostHogAPIClient } from "../posthog-api";
12
+ import type { StoredNotification, TaskRun, TreeSnapshot } from "../types";
13
13
 
14
14
  const execFileAsync = promisify(execFile);
15
15
 
@@ -9,11 +9,11 @@ import {
9
9
  expect,
10
10
  it,
11
11
  } from "vitest";
12
- import { createTestRepo, type TestRepo } from "../test/fixtures/api.js";
13
- import { createPostHogHandlers } from "../test/mocks/msw-handlers.js";
14
- import type { TaskRun } from "../types.js";
15
- import { AgentServer } from "./agent-server.js";
16
- import { type JwtPayload, SANDBOX_CONNECTION_AUDIENCE } from "./jwt.js";
12
+ import { createTestRepo, type TestRepo } from "../test/fixtures/api";
13
+ import { createPostHogHandlers } from "../test/mocks/msw-handlers";
14
+ import type { TaskRun } from "../types";
15
+ import { AgentServer } from "./agent-server";
16
+ import { type JwtPayload, SANDBOX_CONNECTION_AUDIENCE } from "./jwt";
17
17
 
18
18
  interface TestableServer {
19
19
  getInitialPromptOverride(run: TaskRun): string | null;