@posthog/agent 2.3.385 → 2.3.387

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 (45) hide show
  1. package/dist/adapters/claude/session/jsonl-hydration.d.ts +1 -0
  2. package/dist/agent.d.ts +1 -0
  3. package/dist/agent.js +21 -2
  4. package/dist/agent.js.map +1 -1
  5. package/dist/handoff-checkpoint.d.ts +39 -0
  6. package/dist/handoff-checkpoint.js +6679 -0
  7. package/dist/handoff-checkpoint.js.map +1 -0
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.js +2 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/logger-RC7sPv0S.d.ts +24 -0
  12. package/dist/posthog-api.d.ts +1 -0
  13. package/dist/posthog-api.js +19 -2
  14. package/dist/posthog-api.js.map +1 -1
  15. package/dist/resume.d.ts +71 -0
  16. package/dist/resume.js +6838 -0
  17. package/dist/resume.js.map +1 -0
  18. package/dist/server/agent-server.d.ts +5 -18
  19. package/dist/server/agent-server.js +1373 -432
  20. package/dist/server/agent-server.js.map +1 -1
  21. package/dist/server/bin.cjs +1370 -429
  22. package/dist/server/bin.cjs.map +1 -1
  23. package/dist/server/schemas.d.ts +191 -0
  24. package/dist/server/schemas.js +108 -0
  25. package/dist/server/schemas.js.map +1 -0
  26. package/dist/tree-tracker.d.ts +68 -0
  27. package/dist/tree-tracker.js +6431 -0
  28. package/dist/tree-tracker.js.map +1 -0
  29. package/dist/types.d.ts +18 -1
  30. package/dist/types.js +5 -0
  31. package/dist/types.js.map +1 -1
  32. package/package.json +17 -1
  33. package/src/acp-extensions.ts +3 -0
  34. package/src/handoff-checkpoint.test.ts +183 -0
  35. package/src/handoff-checkpoint.ts +361 -0
  36. package/src/posthog-api.test.ts +29 -0
  37. package/src/posthog-api.ts +5 -1
  38. package/src/resume.ts +58 -1
  39. package/src/sagas/apply-snapshot-saga.ts +7 -0
  40. package/src/sagas/capture-tree-saga.ts +10 -3
  41. package/src/sagas/resume-saga.ts +32 -0
  42. package/src/sagas/test-fixtures.ts +46 -0
  43. package/src/server/agent-server.ts +76 -57
  44. package/src/server/schemas.ts +21 -2
  45. package/src/types.ts +24 -0
@@ -1,6 +1,7 @@
1
1
  import { ContentBlock } from '@agentclientprotocol/sdk';
2
2
  import { PostHogAPIClient } from '../../../posthog-api.js';
3
3
  import { StoredEntry } from '../../../types.js';
4
+ import '@posthog/git/handoff';
4
5
 
5
6
  interface ConversationTurn {
6
7
  role: "user" | "assistant";
package/dist/agent.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AgentSideConnection } from '@agentclientprotocol/sdk';
2
2
  import { PostHogAPIClient } from './posthog-api.js';
3
3
  import { AgentConfig, TaskExecutionOptions } from './types.js';
4
+ import '@posthog/git/handoff';
4
5
 
5
6
  type StreamPair = {
6
7
  readable: globalThis.ReadableStream<Uint8Array>;
package/dist/agent.js CHANGED
@@ -4030,7 +4030,7 @@ import { v7 as uuidv7 } from "uuid";
4030
4030
  // package.json
4031
4031
  var package_default = {
4032
4032
  name: "@posthog/agent",
4033
- version: "2.3.385",
4033
+ version: "2.3.387",
4034
4034
  repository: "https://github.com/PostHog/code",
4035
4035
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
4036
4036
  exports: {
@@ -4086,9 +4086,25 @@ var package_default = {
4086
4086
  types: "./dist/execution-mode.d.ts",
4087
4087
  import: "./dist/execution-mode.js"
4088
4088
  },
4089
+ "./resume": {
4090
+ types: "./dist/resume.d.ts",
4091
+ import: "./dist/resume.js"
4092
+ },
4093
+ "./handoff-checkpoint": {
4094
+ types: "./dist/handoff-checkpoint.d.ts",
4095
+ import: "./dist/handoff-checkpoint.js"
4096
+ },
4097
+ "./tree-tracker": {
4098
+ types: "./dist/tree-tracker.d.ts",
4099
+ import: "./dist/tree-tracker.js"
4100
+ },
4089
4101
  "./server": {
4090
4102
  types: "./dist/server/agent-server.d.ts",
4091
4103
  import: "./dist/server/agent-server.js"
4104
+ },
4105
+ "./server/schemas": {
4106
+ types: "./dist/server/schemas.d.ts",
4107
+ import: "./dist/server/schemas.js"
4092
4108
  }
4093
4109
  },
4094
4110
  bin: {
@@ -4179,6 +4195,8 @@ var POSTHOG_NOTIFICATIONS = {
4179
4195
  SDK_SESSION: "_posthog/sdk_session",
4180
4196
  /** Tree state snapshot captured (git tree hash + file archive) */
4181
4197
  TREE_SNAPSHOT: "_posthog/tree_snapshot",
4198
+ /** Git checkpoint captured for handoff */
4199
+ GIT_CHECKPOINT: "_posthog/git_checkpoint",
4182
4200
  /** Agent mode changed (interactive/background) */
4183
4201
  MODE_CHANGE: "_posthog/mode_change",
4184
4202
  /** Request to resume a session from previous state */
@@ -18462,7 +18480,8 @@ var PostHogAPIClient = class {
18462
18480
  body: JSON.stringify({ artifacts })
18463
18481
  }
18464
18482
  );
18465
- return response.artifacts ?? [];
18483
+ const manifest = response.artifacts ?? [];
18484
+ return manifest.slice(-artifacts.length);
18466
18485
  }
18467
18486
  /**
18468
18487
  * Download artifact content by storage path