@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.
- package/dist/adapters/claude/conversion/tool-use-to-acp.js.map +1 -1
- package/dist/adapters/claude/permissions/permission-options.js.map +1 -1
- package/dist/adapters/claude/questions/utils.js.map +1 -1
- package/dist/adapters/claude/session/jsonl-hydration.js.map +1 -1
- package/dist/adapters/claude/tools.js.map +1 -1
- package/dist/agent.js +21 -5
- package/dist/agent.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/posthog-api.js +1 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.js +21 -5
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +21 -5
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/acp-connection.ts +7 -7
- package/src/adapters/base-acp-agent.ts +3 -3
- package/src/adapters/claude/claude-agent.ts +15 -15
- package/src/adapters/claude/conversion/sdk-to-acp.ts +6 -6
- package/src/adapters/claude/conversion/tool-use-to-acp.ts +2 -2
- package/src/adapters/claude/hooks.ts +3 -3
- package/src/adapters/claude/mcp/tool-metadata.ts +1 -1
- package/src/adapters/claude/permissions/permission-handlers.ts +8 -8
- package/src/adapters/claude/permissions/permission-options.ts +1 -1
- package/src/adapters/claude/questions/utils.ts +1 -1
- package/src/adapters/claude/session/instructions.ts +19 -0
- package/src/adapters/claude/session/jsonl-hydration.test.ts +2 -2
- package/src/adapters/claude/session/jsonl-hydration.ts +2 -2
- package/src/adapters/claude/session/options.ts +11 -16
- package/src/adapters/claude/tools.ts +3 -3
- package/src/adapters/claude/types.ts +4 -4
- package/src/adapters/codex/spawn.ts +2 -2
- package/src/agent.ts +6 -6
- package/src/execution-mode.ts +1 -1
- package/src/index.ts +1 -1
- package/src/otel-log-writer.test.ts +2 -2
- package/src/otel-log-writer.ts +2 -2
- package/src/posthog-api.ts +2 -2
- package/src/resume.ts +4 -4
- package/src/sagas/apply-snapshot-saga.test.ts +2 -2
- package/src/sagas/apply-snapshot-saga.ts +2 -2
- package/src/sagas/capture-tree-saga.test.ts +3 -3
- package/src/sagas/capture-tree-saga.ts +2 -2
- package/src/sagas/resume-saga.test.ts +4 -4
- package/src/sagas/resume-saga.ts +5 -5
- package/src/sagas/test-fixtures.ts +3 -3
- package/src/server/agent-server.test.ts +5 -5
- package/src/server/agent-server.ts +14 -14
- package/src/server/bin.ts +2 -2
- package/src/server/question-relay.test.ts +5 -5
- package/src/server/schemas.test.ts +1 -1
- package/src/server/types.ts +2 -2
- package/src/server/utils/retry.test.ts +1 -1
- package/src/server/utils/sse-parser.test.ts +1 -1
- package/src/session-log-writer.test.ts +3 -3
- package/src/session-log-writer.ts +4 -4
- package/src/test/fixtures/api.ts +2 -2
- package/src/test/fixtures/config.ts +2 -2
- package/src/tree-tracker.ts +5 -5
- package/src/utils/async-mutex.test.ts +1 -1
- package/src/utils/common.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/streams.ts +1 -1
|
@@ -6,33 +6,33 @@ import {
|
|
|
6
6
|
import { type ServerType, serve } from "@hono/node-server";
|
|
7
7
|
import { Hono } from "hono";
|
|
8
8
|
import packageJson from "../../package.json" with { type: "json" };
|
|
9
|
-
import { POSTHOG_NOTIFICATIONS } from "../acp-extensions
|
|
9
|
+
import { POSTHOG_NOTIFICATIONS } from "../acp-extensions";
|
|
10
10
|
import {
|
|
11
11
|
createAcpConnection,
|
|
12
12
|
type InProcessAcpConnection,
|
|
13
|
-
} from "../adapters/acp-connection
|
|
14
|
-
import { selectRecentTurns } from "../adapters/claude/session/jsonl-hydration
|
|
15
|
-
import { PostHogAPIClient } from "../posthog-api
|
|
13
|
+
} from "../adapters/acp-connection";
|
|
14
|
+
import { selectRecentTurns } from "../adapters/claude/session/jsonl-hydration";
|
|
15
|
+
import { PostHogAPIClient } from "../posthog-api";
|
|
16
16
|
import {
|
|
17
17
|
type ConversationTurn,
|
|
18
18
|
type ResumeState,
|
|
19
19
|
resumeFromLog,
|
|
20
|
-
} from "../resume
|
|
21
|
-
import { SessionLogWriter } from "../session-log-writer
|
|
22
|
-
import { TreeTracker } from "../tree-tracker
|
|
20
|
+
} from "../resume";
|
|
21
|
+
import { SessionLogWriter } from "../session-log-writer";
|
|
22
|
+
import { TreeTracker } from "../tree-tracker";
|
|
23
23
|
import type {
|
|
24
24
|
AgentMode,
|
|
25
25
|
DeviceInfo,
|
|
26
26
|
LogLevel,
|
|
27
27
|
TaskRun,
|
|
28
28
|
TreeSnapshotEvent,
|
|
29
|
-
} from "../types
|
|
30
|
-
import { AsyncMutex } from "../utils/async-mutex
|
|
31
|
-
import { getLlmGatewayUrl } from "../utils/gateway
|
|
32
|
-
import { Logger } from "../utils/logger
|
|
33
|
-
import { type JwtPayload, JwtValidationError, validateJwt } from "./jwt
|
|
34
|
-
import { jsonRpcRequestSchema, validateCommandParams } from "./schemas
|
|
35
|
-
import type { AgentServerConfig } from "./types
|
|
29
|
+
} from "../types";
|
|
30
|
+
import { AsyncMutex } from "../utils/async-mutex";
|
|
31
|
+
import { getLlmGatewayUrl } from "../utils/gateway";
|
|
32
|
+
import { Logger } from "../utils/logger";
|
|
33
|
+
import { type JwtPayload, JwtValidationError, validateJwt } from "./jwt";
|
|
34
|
+
import { jsonRpcRequestSchema, validateCommandParams } from "./schemas";
|
|
35
|
+
import type { AgentServerConfig } from "./types";
|
|
36
36
|
|
|
37
37
|
type MessageCallback = (message: unknown) => void;
|
|
38
38
|
|
package/src/server/bin.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { AgentServer } from "./agent-server
|
|
5
|
-
import { mcpServersSchema } from "./schemas
|
|
4
|
+
import { AgentServer } from "./agent-server";
|
|
5
|
+
import { mcpServersSchema } from "./schemas";
|
|
6
6
|
|
|
7
7
|
const envSchema = z.object({
|
|
8
8
|
JWT_PUBLIC_KEY: z
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type SetupServerApi, setupServer } from "msw/node";
|
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import type { PostHogAPIClient } from "../posthog-api
|
|
4
|
-
import { createTestRepo, type TestRepo } from "../test/fixtures/api
|
|
5
|
-
import { createPostHogHandlers } from "../test/mocks/msw-handlers
|
|
6
|
-
import type { Task, TaskRun } from "../types
|
|
7
|
-
import { AgentServer } from "./agent-server
|
|
3
|
+
import type { PostHogAPIClient } from "../posthog-api";
|
|
4
|
+
import { createTestRepo, type TestRepo } from "../test/fixtures/api";
|
|
5
|
+
import { createPostHogHandlers } from "../test/mocks/msw-handlers";
|
|
6
|
+
import type { Task, TaskRun } from "../types";
|
|
7
|
+
import { AgentServer } from "./agent-server";
|
|
8
8
|
|
|
9
9
|
interface TestableAgentServer {
|
|
10
10
|
posthogAPI: PostHogAPIClient;
|
package/src/server/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import type { PostHogAPIClient } from "./posthog-api
|
|
3
|
-
import { SessionLogWriter } from "./session-log-writer
|
|
4
|
-
import type { StoredNotification } from "./types
|
|
2
|
+
import type { PostHogAPIClient } from "./posthog-api";
|
|
3
|
+
import { SessionLogWriter } from "./session-log-writer";
|
|
4
|
+
import type { StoredNotification } from "./types";
|
|
5
5
|
|
|
6
6
|
function makeSessionUpdate(
|
|
7
7
|
sessionUpdate: string,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import fsp from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import type { SessionContext } from "./otel-log-writer
|
|
5
|
-
import type { PostHogAPIClient } from "./posthog-api
|
|
6
|
-
import type { StoredNotification } from "./types
|
|
7
|
-
import { Logger } from "./utils/logger
|
|
4
|
+
import type { SessionContext } from "./otel-log-writer";
|
|
5
|
+
import type { PostHogAPIClient } from "./posthog-api";
|
|
6
|
+
import type { StoredNotification } from "./types";
|
|
7
|
+
import { Logger } from "./utils/logger";
|
|
8
8
|
|
|
9
9
|
export interface SessionLogWriterOptions {
|
|
10
10
|
/** PostHog API client for log persistence */
|
package/src/test/fixtures/api.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { tmpdir } from "node:os";
|
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
import { vi } from "vitest";
|
|
8
|
-
import type { PostHogAPIClient } from "../../posthog-api
|
|
9
|
-
import type { TaskRun, TreeSnapshot } from "../../types
|
|
8
|
+
import type { PostHogAPIClient } from "../../posthog-api";
|
|
9
|
+
import type { TaskRun, TreeSnapshot } from "../../types";
|
|
10
10
|
|
|
11
11
|
const execFileAsync = promisify(execFile);
|
|
12
12
|
|
package/src/tree-tracker.ts
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { isCommitOnRemote as gitIsCommitOnRemote } from "@posthog/git/queries";
|
|
14
|
-
import type { PostHogAPIClient } from "./posthog-api
|
|
15
|
-
import { ApplySnapshotSaga } from "./sagas/apply-snapshot-saga
|
|
16
|
-
import { CaptureTreeSaga } from "./sagas/capture-tree-saga
|
|
17
|
-
import type { TreeSnapshot } from "./types
|
|
18
|
-
import { Logger } from "./utils/logger
|
|
14
|
+
import type { PostHogAPIClient } from "./posthog-api";
|
|
15
|
+
import { ApplySnapshotSaga } from "./sagas/apply-snapshot-saga";
|
|
16
|
+
import { CaptureTreeSaga } from "./sagas/capture-tree-saga";
|
|
17
|
+
import type { TreeSnapshot } from "./types";
|
|
18
|
+
import { Logger } from "./utils/logger";
|
|
19
19
|
|
|
20
20
|
export type { TreeSnapshot };
|
|
21
21
|
|
package/src/utils/common.ts
CHANGED
package/src/utils/logger.ts
CHANGED
package/src/utils/streams.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Readable, Writable } from "node:stream";
|
|
2
2
|
import { ReadableStream, WritableStream } from "node:stream/web";
|
|
3
|
-
import type { Logger } from "./logger
|
|
3
|
+
import type { Logger } from "./logger";
|
|
4
4
|
|
|
5
5
|
export class Pushable<T> implements AsyncIterable<T> {
|
|
6
6
|
private queue: T[] = [];
|