@posthog/agent 1.24.0 → 1.25.0

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 (577) hide show
  1. package/LICENSE +33 -0
  2. package/dist/_virtual/_commonjsHelpers.js +6 -0
  3. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  4. package/dist/_virtual/additionalItems.js +4 -0
  5. package/dist/_virtual/additionalItems.js.map +1 -0
  6. package/dist/_virtual/additionalProperties.js +4 -0
  7. package/dist/_virtual/additionalProperties.js.map +1 -0
  8. package/dist/_virtual/ajv.js +4 -0
  9. package/dist/_virtual/ajv.js.map +1 -0
  10. package/dist/_virtual/allOf.js +4 -0
  11. package/dist/_virtual/allOf.js.map +1 -0
  12. package/dist/_virtual/anyOf.js +4 -0
  13. package/dist/_virtual/anyOf.js.map +1 -0
  14. package/dist/_virtual/applicability.js +4 -0
  15. package/dist/_virtual/applicability.js.map +1 -0
  16. package/dist/_virtual/boolSchema.js +4 -0
  17. package/dist/_virtual/boolSchema.js.map +1 -0
  18. package/dist/_virtual/code.js +4 -0
  19. package/dist/_virtual/code.js.map +1 -0
  20. package/dist/_virtual/code2.js +4 -0
  21. package/dist/_virtual/code2.js.map +1 -0
  22. package/dist/_virtual/const.js +4 -0
  23. package/dist/_virtual/const.js.map +1 -0
  24. package/dist/_virtual/contains.js +4 -0
  25. package/dist/_virtual/contains.js.map +1 -0
  26. package/dist/_virtual/core.js +4 -0
  27. package/dist/_virtual/core.js.map +1 -0
  28. package/dist/_virtual/dataType.js +4 -0
  29. package/dist/_virtual/dataType.js.map +1 -0
  30. package/dist/_virtual/defaults.js +4 -0
  31. package/dist/_virtual/defaults.js.map +1 -0
  32. package/dist/_virtual/dependencies.js +4 -0
  33. package/dist/_virtual/dependencies.js.map +1 -0
  34. package/dist/_virtual/draft7.js +4 -0
  35. package/dist/_virtual/draft7.js.map +1 -0
  36. package/dist/_virtual/enum.js +4 -0
  37. package/dist/_virtual/enum.js.map +1 -0
  38. package/dist/_virtual/equal.js +4 -0
  39. package/dist/_virtual/equal.js.map +1 -0
  40. package/dist/_virtual/errors.js +4 -0
  41. package/dist/_virtual/errors.js.map +1 -0
  42. package/dist/_virtual/format.js +4 -0
  43. package/dist/_virtual/format.js.map +1 -0
  44. package/dist/_virtual/formats.js +4 -0
  45. package/dist/_virtual/formats.js.map +1 -0
  46. package/dist/_virtual/id.js +4 -0
  47. package/dist/_virtual/id.js.map +1 -0
  48. package/dist/_virtual/if.js +4 -0
  49. package/dist/_virtual/if.js.map +1 -0
  50. package/dist/_virtual/index.js +4 -0
  51. package/dist/_virtual/index.js.map +1 -0
  52. package/dist/_virtual/index10.js +4 -0
  53. package/dist/_virtual/index10.js.map +1 -0
  54. package/dist/_virtual/index11.js +4 -0
  55. package/dist/_virtual/index11.js.map +1 -0
  56. package/dist/_virtual/index2.js +4 -0
  57. package/dist/_virtual/index2.js.map +1 -0
  58. package/dist/_virtual/index3.js +4 -0
  59. package/dist/_virtual/index3.js.map +1 -0
  60. package/dist/_virtual/index4.js +4 -0
  61. package/dist/_virtual/index4.js.map +1 -0
  62. package/dist/_virtual/index5.js +4 -0
  63. package/dist/_virtual/index5.js.map +1 -0
  64. package/dist/_virtual/index6.js +4 -0
  65. package/dist/_virtual/index6.js.map +1 -0
  66. package/dist/_virtual/index7.js +4 -0
  67. package/dist/_virtual/index7.js.map +1 -0
  68. package/dist/_virtual/index8.js +4 -0
  69. package/dist/_virtual/index8.js.map +1 -0
  70. package/dist/_virtual/index9.js +4 -0
  71. package/dist/_virtual/index9.js.map +1 -0
  72. package/dist/_virtual/items.js +4 -0
  73. package/dist/_virtual/items.js.map +1 -0
  74. package/dist/_virtual/items2020.js +4 -0
  75. package/dist/_virtual/items2020.js.map +1 -0
  76. package/dist/_virtual/keyword.js +4 -0
  77. package/dist/_virtual/keyword.js.map +1 -0
  78. package/dist/_virtual/limit.js +4 -0
  79. package/dist/_virtual/limit.js.map +1 -0
  80. package/dist/_virtual/limitItems.js +4 -0
  81. package/dist/_virtual/limitItems.js.map +1 -0
  82. package/dist/_virtual/limitLength.js +4 -0
  83. package/dist/_virtual/limitLength.js.map +1 -0
  84. package/dist/_virtual/limitNumber.js +4 -0
  85. package/dist/_virtual/limitNumber.js.map +1 -0
  86. package/dist/_virtual/limitProperties.js +4 -0
  87. package/dist/_virtual/limitProperties.js.map +1 -0
  88. package/dist/_virtual/metadata.js +4 -0
  89. package/dist/_virtual/metadata.js.map +1 -0
  90. package/dist/_virtual/multipleOf.js +4 -0
  91. package/dist/_virtual/multipleOf.js.map +1 -0
  92. package/dist/_virtual/names.js +4 -0
  93. package/dist/_virtual/names.js.map +1 -0
  94. package/dist/_virtual/not.js +4 -0
  95. package/dist/_virtual/not.js.map +1 -0
  96. package/dist/_virtual/oneOf.js +4 -0
  97. package/dist/_virtual/oneOf.js.map +1 -0
  98. package/dist/_virtual/pattern.js +4 -0
  99. package/dist/_virtual/pattern.js.map +1 -0
  100. package/dist/_virtual/patternProperties.js +4 -0
  101. package/dist/_virtual/patternProperties.js.map +1 -0
  102. package/dist/_virtual/prefixItems.js +4 -0
  103. package/dist/_virtual/prefixItems.js.map +1 -0
  104. package/dist/_virtual/properties.js +4 -0
  105. package/dist/_virtual/properties.js.map +1 -0
  106. package/dist/_virtual/propertyNames.js +4 -0
  107. package/dist/_virtual/propertyNames.js.map +1 -0
  108. package/dist/_virtual/ref.js +4 -0
  109. package/dist/_virtual/ref.js.map +1 -0
  110. package/dist/_virtual/ref_error.js +4 -0
  111. package/dist/_virtual/ref_error.js.map +1 -0
  112. package/dist/_virtual/required.js +4 -0
  113. package/dist/_virtual/required.js.map +1 -0
  114. package/dist/_virtual/resolve.js +4 -0
  115. package/dist/_virtual/resolve.js.map +1 -0
  116. package/dist/_virtual/rules.js +4 -0
  117. package/dist/_virtual/rules.js.map +1 -0
  118. package/dist/_virtual/scope.js +4 -0
  119. package/dist/_virtual/scope.js.map +1 -0
  120. package/dist/_virtual/subschema.js +4 -0
  121. package/dist/_virtual/subschema.js.map +1 -0
  122. package/dist/_virtual/thenElse.js +4 -0
  123. package/dist/_virtual/thenElse.js.map +1 -0
  124. package/dist/_virtual/types.js +4 -0
  125. package/dist/_virtual/types.js.map +1 -0
  126. package/dist/_virtual/ucs2length.js +4 -0
  127. package/dist/_virtual/ucs2length.js.map +1 -0
  128. package/dist/_virtual/uniqueItems.js +4 -0
  129. package/dist/_virtual/uniqueItems.js.map +1 -0
  130. package/dist/_virtual/uri.js +4 -0
  131. package/dist/_virtual/uri.js.map +1 -0
  132. package/dist/_virtual/util.js +4 -0
  133. package/dist/_virtual/util.js.map +1 -0
  134. package/dist/_virtual/validation_error.js +4 -0
  135. package/dist/_virtual/validation_error.js.map +1 -0
  136. package/dist/claude-cli/cli.js +2294 -2146
  137. package/dist/example-client.d.ts +3 -0
  138. package/dist/example-client.d.ts.map +1 -0
  139. package/dist/index.d.ts +12 -4
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +5 -1
  142. package/dist/index.js.map +1 -1
  143. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js +610 -0
  144. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
  145. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js +875 -0
  146. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js.map +1 -0
  147. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js +66 -0
  148. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
  149. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +23 -0
  150. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -0
  151. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +331 -0
  152. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
  153. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +717 -0
  154. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -0
  155. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +221 -0
  156. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
  157. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +56 -0
  158. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
  159. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +440 -0
  160. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
  161. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +94 -0
  162. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +1 -0
  163. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1610 -0
  164. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
  165. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +91 -0
  166. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
  167. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js +133 -0
  168. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js.map +1 -0
  169. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js +9 -0
  170. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js.map +1 -0
  171. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js +9 -0
  172. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  173. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js +112 -0
  174. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  175. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js +136 -0
  176. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js.map +1 -0
  177. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js +112 -0
  178. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js.map +1 -0
  179. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js +3297 -0
  180. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js.map +1 -0
  181. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js +44 -0
  182. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js.map +1 -0
  183. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js +36 -0
  184. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js.map +1 -0
  185. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js +10 -0
  186. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js.map +1 -0
  187. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js +657 -0
  188. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js.map +1 -0
  189. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js +449 -0
  190. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js.map +1 -0
  191. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js +413 -0
  192. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js.map +1 -0
  193. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js +57 -0
  194. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js.map +1 -0
  195. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js +38 -0
  196. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js.map +1 -0
  197. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js +86 -0
  198. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js.map +1 -0
  199. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js +61 -0
  200. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js.map +1 -0
  201. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js +80 -0
  202. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js.map +1 -0
  203. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js +52 -0
  204. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js.map +1 -0
  205. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js +1307 -0
  206. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js.map +1 -0
  207. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js +842 -0
  208. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  209. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js +335 -0
  210. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js.map +1 -0
  211. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js +8 -0
  212. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js.map +1 -0
  213. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js +51 -0
  214. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js.map +1 -0
  215. package/dist/node_modules/ajv/dist/ajv.js +69 -0
  216. package/dist/node_modules/ajv/dist/ajv.js.map +1 -0
  217. package/dist/node_modules/ajv/dist/compile/codegen/code.js +169 -0
  218. package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  219. package/dist/node_modules/ajv/dist/compile/codegen/index.js +712 -0
  220. package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  221. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +157 -0
  222. package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  223. package/dist/node_modules/ajv/dist/compile/errors.js +140 -0
  224. package/dist/node_modules/ajv/dist/compile/errors.js.map +1 -0
  225. package/dist/node_modules/ajv/dist/compile/index.js +253 -0
  226. package/dist/node_modules/ajv/dist/compile/index.js.map +1 -0
  227. package/dist/node_modules/ajv/dist/compile/names.js +40 -0
  228. package/dist/node_modules/ajv/dist/compile/names.js.map +1 -0
  229. package/dist/node_modules/ajv/dist/compile/ref_error.js +25 -0
  230. package/dist/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  231. package/dist/node_modules/ajv/dist/compile/resolve.js +162 -0
  232. package/dist/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  233. package/dist/node_modules/ajv/dist/compile/rules.js +29 -0
  234. package/dist/node_modules/ajv/dist/compile/rules.js.map +1 -0
  235. package/dist/node_modules/ajv/dist/compile/util.js +183 -0
  236. package/dist/node_modules/ajv/dist/compile/util.js.map +1 -0
  237. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
  238. package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  239. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
  240. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  241. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +213 -0
  242. package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  243. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +49 -0
  244. package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  245. package/dist/node_modules/ajv/dist/compile/validate/index.js +544 -0
  246. package/dist/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  247. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +139 -0
  248. package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  249. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +95 -0
  250. package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  251. package/dist/node_modules/ajv/dist/core.js +639 -0
  252. package/dist/node_modules/ajv/dist/core.js.map +1 -0
  253. package/dist/node_modules/ajv/dist/refs/data.json.js +31 -0
  254. package/dist/node_modules/ajv/dist/refs/data.json.js.map +1 -0
  255. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +254 -0
  256. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +1 -0
  257. package/dist/node_modules/ajv/dist/runtime/equal.js +9 -0
  258. package/dist/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  259. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +25 -0
  260. package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  261. package/dist/node_modules/ajv/dist/runtime/uri.js +8 -0
  262. package/dist/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  263. package/dist/node_modules/ajv/dist/runtime/validation_error.js +22 -0
  264. package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  265. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +53 -0
  266. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  267. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +112 -0
  268. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  269. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +26 -0
  270. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  271. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +14 -0
  272. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  273. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +99 -0
  274. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  275. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +93 -0
  276. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  277. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +70 -0
  278. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  279. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +77 -0
  280. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  281. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +57 -0
  282. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  283. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +37 -0
  284. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  285. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +29 -0
  286. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  287. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +64 -0
  288. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  289. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +80 -0
  290. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  291. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +15 -0
  292. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  293. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +61 -0
  294. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  295. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +42 -0
  296. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  297. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +16 -0
  298. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  299. package/dist/node_modules/ajv/dist/vocabularies/code.js +146 -0
  300. package/dist/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  301. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +11 -0
  302. package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  303. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +21 -0
  304. package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  305. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +131 -0
  306. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  307. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +113 -0
  308. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  309. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +12 -0
  310. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  311. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +28 -0
  312. package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  313. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +94 -0
  314. package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  315. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +9 -0
  316. package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  317. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +21 -0
  318. package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  319. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +31 -0
  320. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  321. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +54 -0
  322. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  323. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +54 -0
  324. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  325. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +26 -0
  326. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  327. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +33 -0
  328. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  329. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +29 -0
  330. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  331. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +26 -0
  332. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  333. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +28 -0
  334. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  335. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +27 -0
  336. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  337. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +84 -0
  338. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  339. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +72 -0
  340. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  341. package/dist/node_modules/ajv-formats/dist/formats.js +212 -0
  342. package/dist/node_modules/ajv-formats/dist/formats.js.map +1 -0
  343. package/dist/node_modules/ajv-formats/dist/index.js +52 -0
  344. package/dist/node_modules/ajv-formats/dist/index.js.map +1 -0
  345. package/dist/node_modules/ajv-formats/dist/limit.js +75 -0
  346. package/dist/node_modules/ajv-formats/dist/limit.js.map +1 -0
  347. package/dist/node_modules/diff/libesm/diff/base.js +256 -0
  348. package/dist/node_modules/diff/libesm/diff/base.js.map +1 -0
  349. package/dist/node_modules/diff/libesm/diff/line.js +64 -0
  350. package/dist/node_modules/diff/libesm/diff/line.js.map +1 -0
  351. package/dist/node_modules/diff/libesm/patch/create.js +185 -0
  352. package/dist/node_modules/diff/libesm/patch/create.js.map +1 -0
  353. package/dist/node_modules/fast-deep-equal/index.js +47 -0
  354. package/dist/node_modules/fast-deep-equal/index.js.map +1 -0
  355. package/dist/node_modules/fast-uri/index.js +347 -0
  356. package/dist/node_modules/fast-uri/index.js.map +1 -0
  357. package/dist/node_modules/fast-uri/lib/schemes.js +255 -0
  358. package/dist/node_modules/fast-uri/lib/schemes.js.map +1 -0
  359. package/dist/node_modules/fast-uri/lib/utils.js +334 -0
  360. package/dist/node_modules/fast-uri/lib/utils.js.map +1 -0
  361. package/dist/node_modules/json-schema-traverse/index.js +98 -0
  362. package/dist/node_modules/json-schema-traverse/index.js.map +1 -0
  363. package/dist/node_modules/uuid/dist/rng.js +14 -0
  364. package/dist/node_modules/uuid/dist/rng.js.map +1 -0
  365. package/dist/node_modules/uuid/dist/stringify.js +29 -0
  366. package/dist/node_modules/uuid/dist/stringify.js.map +1 -0
  367. package/dist/node_modules/uuid/dist/v7.js +65 -0
  368. package/dist/node_modules/uuid/dist/v7.js.map +1 -0
  369. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
  370. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
  371. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +26 -0
  372. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
  373. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +17 -0
  374. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
  375. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +11 -0
  376. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
  377. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +66 -0
  378. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
  379. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +21 -0
  380. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
  381. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +30 -0
  382. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
  383. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +53 -0
  384. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
  385. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
  386. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
  387. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
  388. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
  389. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +8 -0
  390. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
  391. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +50 -0
  392. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
  393. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +11 -0
  394. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
  395. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
  396. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
  397. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +9 -0
  398. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
  399. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +56 -0
  400. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
  401. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +24 -0
  402. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
  403. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +30 -0
  404. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
  405. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +19 -0
  406. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
  407. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +15 -0
  408. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
  409. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +13 -0
  410. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
  411. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +37 -0
  412. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
  413. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +56 -0
  414. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
  415. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +76 -0
  416. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
  417. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +25 -0
  418. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
  419. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +24 -0
  420. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
  421. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
  422. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
  423. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +8 -0
  424. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
  425. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +65 -0
  426. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
  427. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +24 -0
  428. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
  429. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +350 -0
  430. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
  431. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +36 -0
  432. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
  433. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
  434. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
  435. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +84 -0
  436. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
  437. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +8 -0
  438. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
  439. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +109 -0
  440. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
  441. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +90 -0
  442. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
  443. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js +42 -0
  444. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js.map +1 -0
  445. package/dist/package.json.js +8 -0
  446. package/dist/package.json.js.map +1 -0
  447. package/dist/src/acp-extensions.d.ts +91 -0
  448. package/dist/src/acp-extensions.d.ts.map +1 -0
  449. package/dist/src/acp-extensions.js +38 -0
  450. package/dist/src/acp-extensions.js.map +1 -0
  451. package/dist/src/adapters/claude/claude.d.ts +136 -0
  452. package/dist/src/adapters/claude/claude.d.ts.map +1 -0
  453. package/dist/src/adapters/claude/claude.js +1112 -0
  454. package/dist/src/adapters/claude/claude.js.map +1 -0
  455. package/dist/src/adapters/claude/mcp-server.d.ts +30 -0
  456. package/dist/src/adapters/claude/mcp-server.d.ts.map +1 -0
  457. package/dist/src/adapters/claude/mcp-server.js +655 -0
  458. package/dist/src/adapters/claude/mcp-server.js.map +1 -0
  459. package/dist/src/adapters/claude/tools.d.ts +35 -0
  460. package/dist/src/adapters/claude/tools.d.ts.map +1 -0
  461. package/dist/src/adapters/claude/tools.js +466 -0
  462. package/dist/src/adapters/claude/tools.js.map +1 -0
  463. package/dist/src/adapters/claude/utils.d.ts +48 -0
  464. package/dist/src/adapters/claude/utils.d.ts.map +1 -0
  465. package/dist/src/adapters/claude/utils.js +158 -0
  466. package/dist/src/adapters/claude/utils.js.map +1 -0
  467. package/dist/src/agent.d.ts +15 -25
  468. package/dist/src/agent.d.ts.map +1 -1
  469. package/dist/src/agent.js +118 -156
  470. package/dist/src/agent.js.map +1 -1
  471. package/dist/src/file-manager.d.ts +2 -2
  472. package/dist/src/file-manager.d.ts.map +1 -1
  473. package/dist/src/file-manager.js +13 -5
  474. package/dist/src/file-manager.js.map +1 -1
  475. package/dist/src/git-manager.d.ts +1 -0
  476. package/dist/src/git-manager.d.ts.map +1 -1
  477. package/dist/src/git-manager.js +18 -0
  478. package/dist/src/git-manager.js.map +1 -1
  479. package/dist/src/posthog-api.d.ts +8 -13
  480. package/dist/src/posthog-api.d.ts.map +1 -1
  481. package/dist/src/posthog-api.js +14 -2
  482. package/dist/src/posthog-api.js.map +1 -1
  483. package/dist/src/prompt-builder.d.ts +2 -2
  484. package/dist/src/prompt-builder.d.ts.map +1 -1
  485. package/dist/src/prompt-builder.js +7 -7
  486. package/dist/src/prompt-builder.js.map +1 -1
  487. package/dist/src/schemas.d.ts +980 -0
  488. package/dist/src/schemas.d.ts.map +1 -0
  489. package/dist/src/schemas.js +196 -0
  490. package/dist/src/schemas.js.map +1 -0
  491. package/dist/src/session-store.d.ts +53 -0
  492. package/dist/src/session-store.d.ts.map +1 -0
  493. package/dist/src/session-store.js +195 -0
  494. package/dist/src/session-store.js.map +1 -0
  495. package/dist/src/task-manager.d.ts +3 -3
  496. package/dist/src/task-manager.d.ts.map +1 -1
  497. package/dist/src/task-manager.js.map +1 -1
  498. package/dist/src/template-manager.d.ts.map +1 -1
  499. package/dist/src/template-manager.js +6 -6
  500. package/dist/src/template-manager.js.map +1 -1
  501. package/dist/src/todo-manager.d.ts +2 -2
  502. package/dist/src/todo-manager.d.ts.map +1 -1
  503. package/dist/src/todo-manager.js +5 -1
  504. package/dist/src/todo-manager.js.map +1 -1
  505. package/dist/src/types.d.ts +54 -159
  506. package/dist/src/types.d.ts.map +1 -1
  507. package/dist/src/types.js +1 -0
  508. package/dist/src/types.js.map +1 -1
  509. package/dist/src/utils/logger.d.ts +10 -2
  510. package/dist/src/utils/logger.d.ts.map +1 -1
  511. package/dist/src/utils/logger.js +35 -20
  512. package/dist/src/utils/logger.js.map +1 -1
  513. package/dist/src/utils/tapped-stream.d.ts +17 -0
  514. package/dist/src/utils/tapped-stream.d.ts.map +1 -0
  515. package/dist/src/utils/tapped-stream.js +45 -0
  516. package/dist/src/utils/tapped-stream.js.map +1 -0
  517. package/dist/src/workflow/steps/build.d.ts.map +1 -1
  518. package/dist/src/workflow/steps/build.js +15 -9
  519. package/dist/src/workflow/steps/build.js.map +1 -1
  520. package/dist/src/workflow/steps/finalize.d.ts.map +1 -1
  521. package/dist/src/workflow/steps/finalize.js +4 -4
  522. package/dist/src/workflow/steps/finalize.js.map +1 -1
  523. package/dist/src/workflow/steps/plan.d.ts.map +1 -1
  524. package/dist/src/workflow/steps/plan.js +22 -12
  525. package/dist/src/workflow/steps/plan.js.map +1 -1
  526. package/dist/src/workflow/steps/research.d.ts.map +1 -1
  527. package/dist/src/workflow/steps/research.js +33 -26
  528. package/dist/src/workflow/steps/research.js.map +1 -1
  529. package/dist/src/workflow/types.d.ts +10 -5
  530. package/dist/src/workflow/types.d.ts.map +1 -1
  531. package/dist/src/worktree-manager.d.ts +39 -0
  532. package/dist/src/worktree-manager.d.ts.map +1 -0
  533. package/dist/src/worktree-manager.js +810 -0
  534. package/dist/src/worktree-manager.js.map +1 -0
  535. package/package.json +19 -15
  536. package/src/acp-extensions.ts +117 -0
  537. package/src/adapters/claude/claude.ts +1498 -0
  538. package/src/adapters/claude/mcp-server.ts +810 -0
  539. package/src/adapters/claude/tools.ts +609 -0
  540. package/src/adapters/claude/utils.ts +267 -0
  541. package/src/agent.ts +151 -222
  542. package/src/file-manager.ts +16 -7
  543. package/src/git-manager.ts +20 -0
  544. package/src/posthog-api.ts +38 -17
  545. package/src/prompt-builder.ts +23 -15
  546. package/src/schemas.ts +241 -0
  547. package/src/session-store.ts +244 -0
  548. package/src/task-manager.ts +3 -3
  549. package/src/template-manager.ts +8 -8
  550. package/src/todo-manager.ts +9 -3
  551. package/src/types.ts +79 -210
  552. package/src/utils/logger.ts +47 -22
  553. package/src/utils/tapped-stream.ts +60 -0
  554. package/src/workflow/steps/build.ts +16 -11
  555. package/src/workflow/steps/finalize.ts +4 -11
  556. package/src/workflow/steps/plan.ts +24 -19
  557. package/src/workflow/steps/research.ts +34 -33
  558. package/src/workflow/types.ts +14 -5
  559. package/src/worktree-manager.ts +884 -0
  560. package/dist/src/adapters/claude/claude-adapter.d.ts +0 -18
  561. package/dist/src/adapters/claude/claude-adapter.d.ts.map +0 -1
  562. package/dist/src/adapters/claude/claude-adapter.js +0 -356
  563. package/dist/src/adapters/claude/claude-adapter.js.map +0 -1
  564. package/dist/src/adapters/claude/tool-mapper.d.ts +0 -19
  565. package/dist/src/adapters/claude/tool-mapper.d.ts.map +0 -1
  566. package/dist/src/adapters/claude/tool-mapper.js +0 -44
  567. package/dist/src/adapters/claude/tool-mapper.js.map +0 -1
  568. package/dist/src/adapters/types.d.ts +0 -33
  569. package/dist/src/adapters/types.d.ts.map +0 -1
  570. package/dist/src/task-progress-reporter.d.ts +0 -42
  571. package/dist/src/task-progress-reporter.d.ts.map +0 -1
  572. package/dist/src/task-progress-reporter.js +0 -398
  573. package/dist/src/task-progress-reporter.js.map +0 -1
  574. package/src/adapters/claude/claude-adapter.ts +0 -390
  575. package/src/adapters/claude/tool-mapper.ts +0 -46
  576. package/src/adapters/types.ts +0 -37
  577. package/src/task-progress-reporter.ts +0 -454
package/dist/src/agent.js CHANGED
@@ -1,11 +1,11 @@
1
- import { query } from '@anthropic-ai/claude-agent-sdk';
2
- import { ClaudeAdapter } from './adapters/claude/claude-adapter.js';
1
+ import { POSTHOG_NOTIFICATIONS } from './acp-extensions.js';
2
+ import { createAcpConnection } from './adapters/claude/claude.js';
3
3
  import { PostHogFileManager } from './file-manager.js';
4
4
  import { GitManager } from './git-manager.js';
5
5
  import { PostHogAPIClient } from './posthog-api.js';
6
6
  import { PromptBuilder } from './prompt-builder.js';
7
+ import { SessionStore } from './session-store.js';
7
8
  import { TaskManager } from './task-manager.js';
8
- import { TaskProgressReporter } from './task-progress-reporter.js';
9
9
  import { TemplateManager } from './template-manager.js';
10
10
  import { Logger } from './utils/logger.js';
11
11
  import { TASK_WORKFLOW } from './workflow/config.js';
@@ -13,22 +13,21 @@ export { PermissionMode } from './types.js';
13
13
 
14
14
  class Agent {
15
15
  workingDirectory;
16
- onEvent;
17
16
  taskManager;
18
17
  posthogAPI;
19
18
  fileManager;
20
19
  gitManager;
21
20
  templateManager;
22
- adapter;
23
21
  logger;
24
- progressReporter;
22
+ acpConnection;
25
23
  promptBuilder;
26
24
  mcpServers;
27
25
  canUseTool;
26
+ currentRunId;
27
+ sessionStore;
28
28
  debug;
29
29
  constructor(config) {
30
30
  this.workingDirectory = config.workingDirectory || process.cwd();
31
- this.onEvent = config.onEvent;
32
31
  this.canUseTool = config.canUseTool;
33
32
  this.debug = config.debug || false;
34
33
  // Build default PostHog MCP server configuration
@@ -52,23 +51,28 @@ class Agent {
52
51
  ...defaultMcpServers,
53
52
  ...config.mcpServers,
54
53
  };
55
- this.logger = new Logger({ debug: this.debug, prefix: "[PostHog Agent]" });
54
+ this.logger = new Logger({
55
+ debug: this.debug,
56
+ prefix: "[PostHog Agent]",
57
+ onLog: config.onLog,
58
+ });
56
59
  this.taskManager = new TaskManager();
57
- // Hardcode Claude adapter for now - extensible for other providers later
58
- this.adapter = new ClaudeAdapter();
59
60
  this.fileManager = new PostHogFileManager(this.workingDirectory, this.logger.child("FileManager"));
60
61
  this.gitManager = new GitManager({
61
62
  repositoryPath: this.workingDirectory,
62
63
  logger: this.logger.child("GitManager"),
63
- // TODO: Add author config from environment or config
64
64
  });
65
65
  this.templateManager = new TemplateManager();
66
- if (config.posthogApiUrl && config.posthogApiKey) {
66
+ if (config.posthogApiUrl &&
67
+ config.posthogApiKey &&
68
+ config.posthogProjectId) {
67
69
  this.posthogAPI = new PostHogAPIClient({
68
70
  apiUrl: config.posthogApiUrl,
69
71
  apiKey: config.posthogApiKey,
70
72
  projectId: config.posthogProjectId,
71
73
  });
74
+ // Create SessionStore from the API client for ACP connection
75
+ this.sessionStore = new SessionStore(this.posthogAPI, this.logger.child("SessionStore"));
72
76
  }
73
77
  this.promptBuilder = new PromptBuilder({
74
78
  getTaskFiles: (taskId) => this.getTaskFiles(taskId),
@@ -76,7 +80,6 @@ class Agent {
76
80
  posthogClient: this.posthogAPI,
77
81
  logger: this.logger.child("PromptBuilder"),
78
82
  });
79
- this.progressReporter = new TaskProgressReporter(this.posthogAPI, this.logger);
80
83
  }
81
84
  /**
82
85
  * Enable or disable debug logging
@@ -98,38 +101,52 @@ class Agent {
98
101
  process.env.ANTHROPIC_BASE_URL = gatewayUrl;
99
102
  process.env.ANTHROPIC_AUTH_TOKEN = apiKey;
100
103
  this.ensureOpenAIGatewayEnv(gatewayUrl, apiKey);
101
- this.logger.debug("Configured LLM gateway", { gatewayUrl });
102
104
  }
103
105
  catch (error) {
104
106
  this.logger.error("Failed to configure LLM gateway", error);
105
107
  throw error;
106
108
  }
107
109
  }
110
+ getOrCreateConnection() {
111
+ if (!this.acpConnection) {
112
+ this.acpConnection = createAcpConnection({
113
+ sessionStore: this.sessionStore,
114
+ });
115
+ }
116
+ return this.acpConnection;
117
+ }
108
118
  // Adaptive task execution orchestrated via workflow steps
109
- async runTask(taskOrId, options = {}) {
110
- await this._configureLlmGateway();
111
- const task = typeof taskOrId === "string" ? await this.fetchTask(taskOrId) : taskOrId;
119
+ async runTask(taskId, taskRunId, options = {}) {
120
+ // await this._configureLlmGateway();
121
+ const task = await this.fetchTask(taskId);
112
122
  const cwd = options.repositoryPath || this.workingDirectory;
113
123
  const isCloudMode = options.isCloudMode ?? false;
114
124
  const taskSlug = task.slug || task.id;
125
+ // Use taskRunId as sessionId - they are the same identifier
126
+ this.currentRunId = taskRunId;
115
127
  this.logger.info("Starting adaptive task execution", {
116
128
  taskId: task.id,
117
129
  taskSlug,
130
+ taskRunId,
118
131
  isCloudMode,
119
132
  });
120
- // Initialize progress reporter for task run tracking (needed for PR attachment)
121
- await this.progressReporter.start(task.id, {
122
- totalSteps: TASK_WORKFLOW.length,
133
+ const connection = this.getOrCreateConnection();
134
+ // Create sendNotification using ACP connection's extNotification
135
+ const sendNotification = async (method, params) => {
136
+ this.logger.debug(`Notification: ${method}`, params);
137
+ await connection.agentConnection.extNotification?.(method, params);
138
+ };
139
+ await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {
140
+ sessionId: taskRunId,
141
+ runId: taskRunId,
123
142
  });
124
- this.emitEvent(this.adapter.createStatusEvent("run_started", {
125
- runId: this.progressReporter.runId,
126
- }));
127
- await this.prepareTaskBranch(taskSlug, isCloudMode);
143
+ await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);
128
144
  let taskError;
129
145
  try {
130
146
  const workflowContext = {
131
147
  task,
132
148
  taskSlug,
149
+ runId: taskRunId,
133
150
  cwd,
134
151
  isCloudMode,
135
152
  options,
@@ -137,11 +154,11 @@ class Agent {
137
154
  fileManager: this.fileManager,
138
155
  gitManager: this.gitManager,
139
156
  promptBuilder: this.promptBuilder,
140
- progressReporter: this.progressReporter,
141
- adapter: this.adapter,
157
+ connection: connection.agentConnection,
158
+ sessionId: taskRunId,
159
+ sendNotification,
142
160
  mcpServers: this.mcpServers,
143
161
  posthogAPI: this.posthogAPI,
144
- emitEvent: (event) => this.emitEvent(event),
145
162
  stepResults: {},
146
163
  };
147
164
  for (const step of TASK_WORKFLOW) {
@@ -152,10 +169,13 @@ class Agent {
152
169
  }
153
170
  const shouldCreatePR = options.createPR ?? isCloudMode;
154
171
  if (shouldCreatePR) {
155
- await this.ensurePullRequest(task, workflowContext.stepResults);
172
+ await this.ensurePullRequest(task, workflowContext.stepResults, sendNotification);
156
173
  }
157
174
  this.logger.info("Task execution complete", { taskId: task.id });
158
- this.emitEvent(this.adapter.createStatusEvent("task_complete", { taskId: task.id }));
175
+ await sendNotification(POSTHOG_NOTIFICATIONS.TASK_COMPLETE, {
176
+ sessionId: taskRunId,
177
+ taskId: task.id,
178
+ });
159
179
  }
160
180
  catch (error) {
161
181
  taskError = error instanceof Error ? error : new Error(String(error));
@@ -163,59 +183,61 @@ class Agent {
163
183
  taskId: task.id,
164
184
  error: taskError.message,
165
185
  });
166
- }
167
- finally {
168
- if (taskError) {
169
- await this.progressReporter.fail(taskError);
170
- // biome-ignore lint/correctness/noUnsafeFinally: we actually want to throw the error
171
- throw taskError;
172
- }
173
- else {
174
- await this.progressReporter.complete();
175
- }
186
+ await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {
187
+ sessionId: taskRunId,
188
+ message: taskError.message,
189
+ });
190
+ throw taskError;
176
191
  }
177
192
  }
178
- // Direct prompt execution - still supported for low-level usage
179
- async run(prompt, options = {}) {
193
+ /**
194
+ * Creates an in-process ACP connection for client communication.
195
+ * Sets up git branch for the task, configures LLM gateway.
196
+ * The client handles all prompting/querying via the returned streams.
197
+ *
198
+ * @returns InProcessAcpConnection with clientStreams for the client to use
199
+ */
200
+ async runTaskV2(taskId, taskRunId, options = {}) {
180
201
  await this._configureLlmGateway();
181
- const baseOptions = {
182
- model: "claude-sonnet-4-5-20250929",
183
- cwd: options.repositoryPath || this.workingDirectory,
184
- permissionMode: options.permissionMode || "default",
185
- settingSources: ["local"],
186
- mcpServers: this.mcpServers,
202
+ const task = await this.fetchTask(taskId);
203
+ const taskSlug = task.slug || task.id;
204
+ const isCloudMode = options.isCloudMode ?? false;
205
+ options.repositoryPath || this.workingDirectory;
206
+ // Use taskRunId as sessionId - they are the same identifier
207
+ this.currentRunId = taskRunId;
208
+ this.acpConnection = createAcpConnection({
209
+ sessionStore: this.sessionStore,
210
+ sessionId: taskRunId,
211
+ taskId: task.id,
212
+ });
213
+ const sendNotification = async (method, params) => {
214
+ this.logger.debug(`Notification: ${method}`, params);
215
+ await this.acpConnection?.agentConnection.extNotification?.(method, params);
187
216
  };
188
- // Add canUseTool hook if provided (options take precedence over instance config)
189
- const canUseTool = options.canUseTool || this.canUseTool;
190
- if (canUseTool) {
191
- baseOptions.canUseTool = canUseTool;
192
- }
193
- const response = query({
194
- prompt,
195
- options: { ...baseOptions, ...(options.queryOverrides || {}) },
217
+ await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {
218
+ sessionId: taskRunId,
219
+ runId: taskRunId,
196
220
  });
197
- const results = [];
198
- try {
199
- for await (const message of response) {
200
- this.logger.debug("Received message in direct run", message);
201
- // Emit raw SDK event
202
- this.emitEvent(this.adapter.createRawSDKEvent(message));
203
- const transformedEvents = this.adapter.transform(message);
204
- for (const event of transformedEvents) {
205
- this.emitEvent(event);
206
- }
207
- results.push(message);
221
+ if (!options.skipGitBranch) {
222
+ try {
223
+ await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);
224
+ }
225
+ catch (error) {
226
+ const errorMessage = error instanceof Error ? error.message : String(error);
227
+ this.logger.error("Failed to prepare task branch", {
228
+ error: errorMessage,
229
+ });
230
+ await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {
231
+ sessionId: taskRunId,
232
+ message: errorMessage,
233
+ });
234
+ throw error;
208
235
  }
209
236
  }
210
- catch (error) {
211
- this.logger.error("Error during direct run", error);
212
- throw error;
213
- }
214
- return { results };
237
+ return this.acpConnection;
215
238
  }
216
239
  // PostHog task operations
217
240
  async fetchTask(taskId) {
218
- this.logger.debug("Fetching task from PostHog", { taskId });
219
241
  if (!this.posthogAPI) {
220
242
  const error = new Error("PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.");
221
243
  this.logger.error("PostHog API not configured", error);
@@ -226,72 +248,12 @@ class Agent {
226
248
  getPostHogClient() {
227
249
  return this.posthogAPI;
228
250
  }
229
- async listTasks(filters) {
230
- if (!this.posthogAPI) {
231
- throw new Error("PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.");
232
- }
233
- return this.posthogAPI.listTasks(filters);
234
- }
235
- // File system operations for task artifacts
236
- async writeTaskFile(taskId, fileName, content, type = "reference") {
237
- this.logger.debug("Writing task file", {
238
- taskId,
239
- fileName,
240
- type,
241
- contentLength: content.length,
242
- });
243
- await this.fileManager.writeTaskFile(taskId, {
244
- name: fileName,
245
- content,
246
- type,
247
- });
248
- }
249
- async readTaskFile(taskId, fileName) {
250
- this.logger.debug("Reading task file", { taskId, fileName });
251
- return await this.fileManager.readTaskFile(taskId, fileName);
252
- }
253
251
  async getTaskFiles(taskId) {
254
252
  this.logger.debug("Getting task files", { taskId });
255
253
  const files = await this.fileManager.getTaskFiles(taskId);
256
254
  this.logger.debug("Found task files", { taskId, fileCount: files.length });
257
255
  return files;
258
256
  }
259
- async writePlan(taskId, plan) {
260
- this.logger.info("Writing plan", { taskId, planLength: plan.length });
261
- await this.fileManager.writePlan(taskId, plan);
262
- }
263
- async readPlan(taskId) {
264
- this.logger.debug("Reading plan", { taskId });
265
- return await this.fileManager.readPlan(taskId);
266
- }
267
- // Git operations for task execution
268
- async createPlanningBranch(taskId) {
269
- this.logger.info("Creating planning branch", { taskId });
270
- const branchName = await this.gitManager.createTaskPlanningBranch(taskId);
271
- this.logger.debug("Planning branch created", { taskId, branchName });
272
- return branchName;
273
- }
274
- async commitPlan(taskId, taskTitle) {
275
- this.logger.info("Committing plan", { taskId, taskTitle });
276
- const commitHash = await this.gitManager.commitPlan(taskId, taskTitle);
277
- this.logger.debug("Plan committed", { taskId, commitHash });
278
- return commitHash;
279
- }
280
- async createImplementationBranch(taskId, planningBranchName) {
281
- this.logger.info("Creating implementation branch", {
282
- taskId,
283
- fromBranch: planningBranchName,
284
- });
285
- const branchName = await this.gitManager.createTaskImplementationBranch(taskId, planningBranchName);
286
- this.logger.debug("Implementation branch created", { taskId, branchName });
287
- return branchName;
288
- }
289
- async commitImplementation(taskId, taskTitle, planSummary) {
290
- this.logger.info("Committing implementation", { taskId, taskTitle });
291
- const commitHash = await this.gitManager.commitImplementation(taskId, taskTitle, planSummary);
292
- this.logger.debug("Implementation committed", { taskId, commitHash });
293
- return commitHash;
294
- }
295
257
  async createPullRequest(taskId, branchName, taskTitle, taskDescription, customBody) {
296
258
  this.logger.info("Creating pull request", {
297
259
  taskId,
@@ -313,7 +275,7 @@ Generated by PostHog Agent`;
313
275
  }
314
276
  async attachPullRequestToTask(taskId, prUrl, branchName) {
315
277
  this.logger.info("Attaching PR to task run", { taskId, prUrl, branchName });
316
- if (!this.posthogAPI || !this.progressReporter.runId) {
278
+ if (!this.posthogAPI || !this.currentRunId) {
317
279
  const error = new Error("PostHog API not configured or no active run. Cannot attach PR to task.");
318
280
  this.logger.error("PostHog API not configured", error);
319
281
  throw error;
@@ -324,26 +286,26 @@ Generated by PostHog Agent`;
324
286
  if (branchName) {
325
287
  updates.branch = branchName;
326
288
  }
327
- await this.posthogAPI.updateTaskRun(taskId, this.progressReporter.runId, updates);
289
+ await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, updates);
328
290
  this.logger.debug("PR attached to task run", {
329
291
  taskId,
330
- runId: this.progressReporter.runId,
292
+ runId: this.currentRunId,
331
293
  prUrl,
332
294
  });
333
295
  }
334
296
  async updateTaskBranch(taskId, branchName) {
335
297
  this.logger.info("Updating task run branch", { taskId, branchName });
336
- if (!this.posthogAPI || !this.progressReporter.runId) {
298
+ if (!this.posthogAPI || !this.currentRunId) {
337
299
  const error = new Error("PostHog API not configured or no active run. Cannot update branch.");
338
300
  this.logger.error("PostHog API not configured", error);
339
301
  throw error;
340
302
  }
341
- await this.posthogAPI.updateTaskRun(taskId, this.progressReporter.runId, {
303
+ await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, {
342
304
  branch: branchName,
343
305
  });
344
306
  this.logger.debug("Task run branch updated", {
345
307
  taskId,
346
- runId: this.progressReporter.runId,
308
+ runId: this.currentRunId,
347
309
  branchName,
348
310
  });
349
311
  }
@@ -366,17 +328,30 @@ Generated by PostHog Agent`;
366
328
  }
367
329
  return null;
368
330
  }
369
- async prepareTaskBranch(taskSlug, isCloudMode) {
331
+ async prepareTaskBranch(taskSlug, isCloudMode, sendNotification) {
370
332
  if (await this.gitManager.hasChanges()) {
371
333
  throw new Error("Cannot start task with uncommitted changes. Please commit or stash your changes first.");
372
334
  }
335
+ // If we're running in a worktree, we're already on the correct branch
336
+ // (the worktree was created with its own branch). Skip branch creation.
337
+ const isWorktree = await this.gitManager.isWorktree();
338
+ if (isWorktree) {
339
+ const currentBranch = await this.gitManager.getCurrentBranch();
340
+ this.logger.info("Running in worktree, using existing branch", {
341
+ branch: currentBranch,
342
+ });
343
+ await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {
344
+ branch: currentBranch,
345
+ });
346
+ return;
347
+ }
373
348
  await this.gitManager.resetToDefaultBranchIfNeeded();
374
349
  const existingBranch = await this.gitManager.getTaskBranch(taskSlug);
375
350
  if (!existingBranch) {
376
351
  const branchName = await this.gitManager.createTaskBranch(taskSlug);
377
- this.emitEvent(this.adapter.createStatusEvent("branch_created", {
352
+ await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {
378
353
  branch: branchName,
379
- }));
354
+ });
380
355
  await this.gitManager.addAllPostHogFiles();
381
356
  // Only commit if there are changes or we're in cloud mode
382
357
  if (isCloudMode) {
@@ -409,7 +384,7 @@ Generated by PostHog Agent`;
409
384
  process.env.OPENAI_API_KEY = resolvedToken;
410
385
  }
411
386
  }
412
- async ensurePullRequest(task, stepResults) {
387
+ async ensurePullRequest(task, stepResults, sendNotification) {
413
388
  const latestRun = task.latest_run;
414
389
  const existingPr = latestRun?.output && typeof latestRun.output === "object"
415
390
  ? latestRun.output.pr_url
@@ -430,7 +405,7 @@ Generated by PostHog Agent`;
430
405
  const finalizeResult = stepResults.finalize;
431
406
  const prBody = finalizeResult?.prBody;
432
407
  const prUrl = await this.createPullRequest(task.id, branchName, task.title, task.description ?? "", prBody);
433
- this.emitEvent(this.adapter.createStatusEvent("pr_created", { prUrl }));
408
+ await sendNotification(POSTHOG_NOTIFICATIONS.PR_CREATED, { prUrl });
434
409
  try {
435
410
  await this.attachPullRequestToTask(task.id, prUrl, branchName);
436
411
  this.logger.info("PR attached to task successfully", {
@@ -444,19 +419,6 @@ Generated by PostHog Agent`;
444
419
  });
445
420
  }
446
421
  }
447
- emitEvent(event) {
448
- if (this.debug && event.type !== "token") {
449
- // Log all events except tokens (too verbose)
450
- this.logger.debug("Emitting event", { type: event.type, ts: event.ts });
451
- }
452
- const persistPromise = this.progressReporter.recordEvent(event);
453
- if (persistPromise && typeof persistPromise.then === "function") {
454
- persistPromise.catch((error) => this.logger.debug("Failed to persist agent event", {
455
- message: error.message,
456
- }));
457
- }
458
- this.onEvent?.(event);
459
- }
460
422
  }
461
423
 
462
424
  export { Agent };
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sources":["../../src/agent.ts"],"sourcesContent":["import { query } from \"@anthropic-ai/claude-agent-sdk\";\nimport { ClaudeAdapter } from \"./adapters/claude/claude-adapter.js\";\nimport type { ProviderAdapter } from \"./adapters/types.js\";\nimport { PostHogFileManager } from \"./file-manager.js\";\nimport { GitManager } from \"./git-manager.js\";\nimport { PostHogAPIClient } from \"./posthog-api.js\";\nimport { PromptBuilder } from \"./prompt-builder.js\";\nimport { TaskManager } from \"./task-manager.js\";\nimport { TaskProgressReporter } from \"./task-progress-reporter.js\";\nimport { TemplateManager } from \"./template-manager.js\";\nimport type {\n AgentConfig,\n CanUseTool,\n ExecutionResult,\n Task,\n} from \"./types.js\";\nimport { Logger } from \"./utils/logger.js\";\nimport { TASK_WORKFLOW } from \"./workflow/config.js\";\nimport type { WorkflowRuntime } from \"./workflow/types.js\";\n\nexport class Agent {\n private workingDirectory: string;\n private onEvent?: (event: any) => void;\n private taskManager: TaskManager;\n private posthogAPI?: PostHogAPIClient;\n private fileManager: PostHogFileManager;\n private gitManager: GitManager;\n private templateManager: TemplateManager;\n private adapter: ProviderAdapter;\n private logger: Logger;\n private progressReporter: TaskProgressReporter;\n private promptBuilder: PromptBuilder;\n private mcpServers?: Record<string, any>;\n private canUseTool?: CanUseTool;\n public debug: boolean;\n\n constructor(config: AgentConfig) {\n this.workingDirectory = config.workingDirectory || process.cwd();\n this.onEvent = config.onEvent;\n this.canUseTool = config.canUseTool;\n this.debug = config.debug || false;\n\n // Build default PostHog MCP server configuration\n const posthogMcpUrl =\n config.posthogMcpUrl ||\n process.env.POSTHOG_MCP_URL ||\n \"https://mcp.posthog.com/mcp\";\n\n // Add auth if API key provided\n const headers: Record<string, string> = {};\n if (config.posthogApiKey) {\n headers.Authorization = `Bearer ${config.posthogApiKey}`;\n }\n\n const defaultMcpServers = {\n posthog: {\n type: \"http\" as const,\n url: posthogMcpUrl,\n ...(Object.keys(headers).length > 0 ? { headers } : {}),\n },\n };\n\n // Merge default PostHog MCP with user-provided servers (user config takes precedence)\n this.mcpServers = {\n ...defaultMcpServers,\n ...config.mcpServers,\n };\n this.logger = new Logger({ debug: this.debug, prefix: \"[PostHog Agent]\" });\n this.taskManager = new TaskManager();\n // Hardcode Claude adapter for now - extensible for other providers later\n this.adapter = new ClaudeAdapter();\n\n this.fileManager = new PostHogFileManager(\n this.workingDirectory,\n this.logger.child(\"FileManager\"),\n );\n this.gitManager = new GitManager({\n repositoryPath: this.workingDirectory,\n logger: this.logger.child(\"GitManager\"),\n // TODO: Add author config from environment or config\n });\n this.templateManager = new TemplateManager();\n\n if (config.posthogApiUrl && config.posthogApiKey) {\n this.posthogAPI = new PostHogAPIClient({\n apiUrl: config.posthogApiUrl,\n apiKey: config.posthogApiKey,\n projectId: config.posthogProjectId,\n });\n }\n\n this.promptBuilder = new PromptBuilder({\n getTaskFiles: (taskId: string) => this.getTaskFiles(taskId),\n generatePlanTemplate: (vars) => this.templateManager.generatePlan(vars),\n posthogClient: this.posthogAPI,\n logger: this.logger.child(\"PromptBuilder\"),\n });\n this.progressReporter = new TaskProgressReporter(\n this.posthogAPI,\n this.logger,\n );\n }\n\n /**\n * Enable or disable debug logging\n */\n setDebug(enabled: boolean) {\n this.debug = enabled;\n this.logger.setDebug(enabled);\n }\n\n /**\n * Configure LLM gateway environment variables for Claude Code CLI\n */\n private async _configureLlmGateway(): Promise<void> {\n if (!this.posthogAPI) {\n return;\n }\n\n try {\n const gatewayUrl = this.posthogAPI.getLlmGatewayUrl();\n const apiKey = this.posthogAPI.getApiKey();\n\n process.env.ANTHROPIC_BASE_URL = gatewayUrl;\n process.env.ANTHROPIC_AUTH_TOKEN = apiKey;\n this.ensureOpenAIGatewayEnv(gatewayUrl, apiKey);\n\n this.logger.debug(\"Configured LLM gateway\", { gatewayUrl });\n } catch (error) {\n this.logger.error(\"Failed to configure LLM gateway\", error);\n throw error;\n }\n }\n\n // Adaptive task execution orchestrated via workflow steps\n async runTask(\n taskOrId: Task | string,\n options: import(\"./types.js\").TaskExecutionOptions = {},\n ): Promise<void> {\n await this._configureLlmGateway();\n\n const task =\n typeof taskOrId === \"string\" ? await this.fetchTask(taskOrId) : taskOrId;\n const cwd = options.repositoryPath || this.workingDirectory;\n const isCloudMode = options.isCloudMode ?? false;\n const taskSlug = (task as any).slug || task.id;\n\n this.logger.info(\"Starting adaptive task execution\", {\n taskId: task.id,\n taskSlug,\n isCloudMode,\n });\n\n // Initialize progress reporter for task run tracking (needed for PR attachment)\n await this.progressReporter.start(task.id, {\n totalSteps: TASK_WORKFLOW.length,\n });\n this.emitEvent(\n this.adapter.createStatusEvent(\"run_started\", {\n runId: this.progressReporter.runId,\n }),\n );\n\n await this.prepareTaskBranch(taskSlug, isCloudMode);\n\n let taskError: Error | undefined;\n try {\n const workflowContext: WorkflowRuntime = {\n task,\n taskSlug,\n cwd,\n isCloudMode,\n options,\n logger: this.logger,\n fileManager: this.fileManager,\n gitManager: this.gitManager,\n promptBuilder: this.promptBuilder,\n progressReporter: this.progressReporter,\n adapter: this.adapter,\n mcpServers: this.mcpServers,\n posthogAPI: this.posthogAPI,\n emitEvent: (event: any) => this.emitEvent(event),\n stepResults: {},\n };\n\n for (const step of TASK_WORKFLOW) {\n const result = await step.run({ step, context: workflowContext });\n if (result.halt) {\n return;\n }\n }\n\n const shouldCreatePR = options.createPR ?? isCloudMode;\n if (shouldCreatePR) {\n await this.ensurePullRequest(task, workflowContext.stepResults);\n }\n\n this.logger.info(\"Task execution complete\", { taskId: task.id });\n this.emitEvent(\n this.adapter.createStatusEvent(\"task_complete\", { taskId: task.id }),\n );\n } catch (error) {\n taskError = error instanceof Error ? error : new Error(String(error));\n this.logger.error(\"Task execution failed\", {\n taskId: task.id,\n error: taskError.message,\n });\n } finally {\n if (taskError) {\n await this.progressReporter.fail(taskError);\n // biome-ignore lint/correctness/noUnsafeFinally: we actually want to throw the error\n throw taskError;\n } else {\n await this.progressReporter.complete();\n }\n }\n }\n\n // Direct prompt execution - still supported for low-level usage\n async run(\n prompt: string,\n options: {\n repositoryPath?: string;\n permissionMode?: import(\"./types.js\").PermissionMode;\n queryOverrides?: Record<string, any>;\n canUseTool?: CanUseTool;\n } = {},\n ): Promise<ExecutionResult> {\n await this._configureLlmGateway();\n const baseOptions: Record<string, any> = {\n model: \"claude-sonnet-4-5-20250929\",\n cwd: options.repositoryPath || this.workingDirectory,\n permissionMode: (options.permissionMode as any) || \"default\",\n settingSources: [\"local\"],\n mcpServers: this.mcpServers,\n };\n\n // Add canUseTool hook if provided (options take precedence over instance config)\n const canUseTool = options.canUseTool || this.canUseTool;\n if (canUseTool) {\n baseOptions.canUseTool = canUseTool;\n }\n\n const response = query({\n prompt,\n options: { ...baseOptions, ...(options.queryOverrides || {}) },\n });\n\n const results = [];\n try {\n for await (const message of response) {\n this.logger.debug(\"Received message in direct run\", message);\n // Emit raw SDK event\n this.emitEvent(this.adapter.createRawSDKEvent(message));\n const transformedEvents = this.adapter.transform(message);\n for (const event of transformedEvents) {\n this.emitEvent(event);\n }\n results.push(message);\n }\n } catch (error) {\n this.logger.error(\"Error during direct run\", error);\n throw error;\n }\n\n return { results };\n }\n\n // PostHog task operations\n async fetchTask(taskId: string): Promise<Task> {\n this.logger.debug(\"Fetching task from PostHog\", { taskId });\n if (!this.posthogAPI) {\n const error = new Error(\n \"PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n return this.posthogAPI.fetchTask(taskId);\n }\n\n getPostHogClient(): PostHogAPIClient | undefined {\n return this.posthogAPI;\n }\n\n async listTasks(filters?: {\n repository?: string;\n organization?: string;\n origin_product?: string;\n }): Promise<Task[]> {\n if (!this.posthogAPI) {\n throw new Error(\n \"PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.\",\n );\n }\n return this.posthogAPI.listTasks(filters);\n }\n\n // File system operations for task artifacts\n async writeTaskFile(\n taskId: string,\n fileName: string,\n content: string,\n type: \"plan\" | \"context\" | \"reference\" | \"output\" = \"reference\",\n ): Promise<void> {\n this.logger.debug(\"Writing task file\", {\n taskId,\n fileName,\n type,\n contentLength: content.length,\n });\n await this.fileManager.writeTaskFile(taskId, {\n name: fileName,\n content,\n type,\n });\n }\n\n async readTaskFile(taskId: string, fileName: string): Promise<string | null> {\n this.logger.debug(\"Reading task file\", { taskId, fileName });\n return await this.fileManager.readTaskFile(taskId, fileName);\n }\n\n async getTaskFiles(taskId: string): Promise<any[]> {\n this.logger.debug(\"Getting task files\", { taskId });\n const files = await this.fileManager.getTaskFiles(taskId);\n this.logger.debug(\"Found task files\", { taskId, fileCount: files.length });\n return files;\n }\n\n async writePlan(taskId: string, plan: string): Promise<void> {\n this.logger.info(\"Writing plan\", { taskId, planLength: plan.length });\n await this.fileManager.writePlan(taskId, plan);\n }\n\n async readPlan(taskId: string): Promise<string | null> {\n this.logger.debug(\"Reading plan\", { taskId });\n return await this.fileManager.readPlan(taskId);\n }\n\n // Git operations for task execution\n async createPlanningBranch(taskId: string): Promise<string> {\n this.logger.info(\"Creating planning branch\", { taskId });\n const branchName = await this.gitManager.createTaskPlanningBranch(taskId);\n this.logger.debug(\"Planning branch created\", { taskId, branchName });\n return branchName;\n }\n\n async commitPlan(taskId: string, taskTitle: string): Promise<string> {\n this.logger.info(\"Committing plan\", { taskId, taskTitle });\n const commitHash = await this.gitManager.commitPlan(taskId, taskTitle);\n this.logger.debug(\"Plan committed\", { taskId, commitHash });\n return commitHash;\n }\n\n async createImplementationBranch(\n taskId: string,\n planningBranchName?: string,\n ): Promise<string> {\n this.logger.info(\"Creating implementation branch\", {\n taskId,\n fromBranch: planningBranchName,\n });\n const branchName = await this.gitManager.createTaskImplementationBranch(\n taskId,\n planningBranchName,\n );\n this.logger.debug(\"Implementation branch created\", { taskId, branchName });\n return branchName;\n }\n\n async commitImplementation(\n taskId: string,\n taskTitle: string,\n planSummary?: string,\n ): Promise<string> {\n this.logger.info(\"Committing implementation\", { taskId, taskTitle });\n const commitHash = await this.gitManager.commitImplementation(\n taskId,\n taskTitle,\n planSummary,\n );\n this.logger.debug(\"Implementation committed\", { taskId, commitHash });\n return commitHash;\n }\n\n async createPullRequest(\n taskId: string,\n branchName: string,\n taskTitle: string,\n taskDescription: string,\n customBody?: string,\n ): Promise<string> {\n this.logger.info(\"Creating pull request\", {\n taskId,\n branchName,\n taskTitle,\n });\n\n const defaultBody = `## Task Details\n**Task ID**: ${taskId}\n**Description**: ${taskDescription}\n\n## Changes\nThis PR implements the changes described in the task.\n\nGenerated by PostHog Agent`;\n const prBody = customBody || defaultBody;\n\n const prUrl = await this.gitManager.createPullRequest(\n branchName,\n taskTitle,\n prBody,\n );\n\n this.logger.info(\"Pull request created\", { taskId, prUrl });\n return prUrl;\n }\n\n async attachPullRequestToTask(\n taskId: string,\n prUrl: string,\n branchName?: string,\n ): Promise<void> {\n this.logger.info(\"Attaching PR to task run\", { taskId, prUrl, branchName });\n\n if (!this.posthogAPI || !this.progressReporter.runId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot attach PR to task.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n const updates: any = {\n output: { pr_url: prUrl },\n };\n if (branchName) {\n updates.branch = branchName;\n }\n\n await this.posthogAPI.updateTaskRun(\n taskId,\n this.progressReporter.runId,\n updates,\n );\n this.logger.debug(\"PR attached to task run\", {\n taskId,\n runId: this.progressReporter.runId,\n prUrl,\n });\n }\n\n async updateTaskBranch(taskId: string, branchName: string): Promise<void> {\n this.logger.info(\"Updating task run branch\", { taskId, branchName });\n\n if (!this.posthogAPI || !this.progressReporter.runId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot update branch.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n await this.posthogAPI.updateTaskRun(taskId, this.progressReporter.runId, {\n branch: branchName,\n });\n this.logger.debug(\"Task run branch updated\", {\n taskId,\n runId: this.progressReporter.runId,\n branchName,\n });\n }\n\n // Execution management\n cancelTask(taskId: string): void {\n // Find the execution for this task and cancel it\n for (const [executionId, execution] of this.taskManager.executionStates) {\n if (execution.taskId === taskId && execution.status === \"running\") {\n this.taskManager.cancelExecution(executionId);\n break;\n }\n }\n }\n\n getTaskExecutionStatus(taskId: string): string | null {\n // Find the execution for this task\n for (const execution of this.taskManager.executionStates.values()) {\n if (execution.taskId === taskId) {\n return execution.status;\n }\n }\n return null;\n }\n\n private async prepareTaskBranch(\n taskSlug: string,\n isCloudMode: boolean,\n ): Promise<void> {\n if (await this.gitManager.hasChanges()) {\n throw new Error(\n \"Cannot start task with uncommitted changes. Please commit or stash your changes first.\",\n );\n }\n\n await this.gitManager.resetToDefaultBranchIfNeeded();\n\n const existingBranch = await this.gitManager.getTaskBranch(taskSlug);\n if (!existingBranch) {\n const branchName = await this.gitManager.createTaskBranch(taskSlug);\n this.emitEvent(\n this.adapter.createStatusEvent(\"branch_created\", {\n branch: branchName,\n }),\n );\n\n await this.gitManager.addAllPostHogFiles();\n\n // Only commit if there are changes or we're in cloud mode\n if (isCloudMode) {\n await this.gitManager.commitAndPush(`Initialize task ${taskSlug}`, {\n allowEmpty: true,\n });\n } else {\n // Check if there are any changes before committing\n const hasChanges = await this.gitManager.hasStagedChanges();\n if (hasChanges) {\n await this.gitManager.commitChanges(`Initialize task ${taskSlug}`);\n }\n }\n } else {\n this.logger.info(\"Switching to existing task branch\", {\n branch: existingBranch,\n });\n await this.gitManager.switchToBranch(existingBranch);\n }\n }\n\n private ensureOpenAIGatewayEnv(gatewayUrl?: string, token?: string): void {\n const resolvedGatewayUrl = gatewayUrl || process.env.ANTHROPIC_BASE_URL;\n const resolvedToken = token || process.env.ANTHROPIC_AUTH_TOKEN;\n\n if (resolvedGatewayUrl) {\n process.env.OPENAI_BASE_URL = resolvedGatewayUrl;\n }\n\n if (resolvedToken) {\n process.env.OPENAI_API_KEY = resolvedToken;\n }\n }\n\n private async ensurePullRequest(\n task: Task,\n stepResults: Record<string, any>,\n ): Promise<void> {\n const latestRun = task.latest_run;\n const existingPr =\n latestRun?.output && typeof latestRun.output === \"object\"\n ? (latestRun.output as any).pr_url\n : null;\n\n if (existingPr) {\n this.logger.info(\"PR already exists, skipping creation\", {\n taskId: task.id,\n prUrl: existingPr,\n });\n return;\n }\n\n const buildResult = stepResults.build;\n if (!buildResult?.commitCreated) {\n this.logger.warn(\n \"Build step did not produce a commit; skipping PR creation\",\n { taskId: task.id },\n );\n return;\n }\n\n const branchName = await this.gitManager.getCurrentBranch();\n const finalizeResult = stepResults.finalize;\n const prBody = finalizeResult?.prBody;\n\n const prUrl = await this.createPullRequest(\n task.id,\n branchName,\n task.title,\n task.description ?? \"\",\n prBody,\n );\n\n this.emitEvent(this.adapter.createStatusEvent(\"pr_created\", { prUrl }));\n\n try {\n await this.attachPullRequestToTask(task.id, prUrl, branchName);\n this.logger.info(\"PR attached to task successfully\", {\n taskId: task.id,\n prUrl,\n });\n } catch (error) {\n this.logger.warn(\"Could not attach PR to task\", {\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n private emitEvent(event: any): void {\n if (this.debug && event.type !== \"token\") {\n // Log all events except tokens (too verbose)\n this.logger.debug(\"Emitting event\", { type: event.type, ts: event.ts });\n }\n const persistPromise = this.progressReporter.recordEvent(event);\n if (persistPromise && typeof persistPromise.then === \"function\") {\n persistPromise.catch((error: Error) =>\n this.logger.debug(\"Failed to persist agent event\", {\n message: error.message,\n }),\n );\n }\n this.onEvent?.(event);\n }\n}\n\nexport type {\n AgentConfig,\n ExecutionResult,\n SupportingFile,\n Task,\n} from \"./types.js\";\nexport { PermissionMode } from \"./types.js\";\n"],"names":[],"mappings":";;;;;;;;;;;;;MAoBa,KAAK,CAAA;AACR,IAAA,gBAAgB;AAChB,IAAA,OAAO;AACP,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,eAAe;AACf,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,gBAAgB;AAChB,IAAA,aAAa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IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC;AAC9D,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;gBACnD,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,KAAK;AACN,aAAA,CAAC;QACJ;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;AAC9C,gBAAA,KAAK,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9D,aAAA,CAAC;QACJ;IACF;AAEQ,IAAA,SAAS,CAAC,KAAU,EAAA;QAC1B,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;;YAExC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACzE;QACA,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC;QAC/D,IAAI,cAAc,IAAI,OAAO,cAAc,CAAC,IAAI,KAAK,UAAU,EAAE;AAC/D,YAAA,cAAc,CAAC,KAAK,CAAC,CAAC,KAAY,KAChC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE;gBACjD,OAAO,EAAE,KAAK,CAAC,OAAO;AACvB,aAAA,CAAC,CACH;QACH;AACA,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB;AACD;;;;"}
1
+ {"version":3,"file":"agent.js","sources":["../../src/agent.ts"],"sourcesContent":["import { POSTHOG_NOTIFICATIONS } from \"./acp-extensions.js\";\nimport {\n createAcpConnection,\n type InProcessAcpConnection,\n} from \"./adapters/claude/claude.js\";\nimport { PostHogFileManager } from \"./file-manager.js\";\nimport { GitManager } from \"./git-manager.js\";\nimport { PostHogAPIClient } from \"./posthog-api.js\";\nimport { PromptBuilder } from \"./prompt-builder.js\";\nimport { SessionStore } from \"./session-store.js\";\nimport { TaskManager } from \"./task-manager.js\";\nimport { TemplateManager } from \"./template-manager.js\";\nimport type { AgentConfig, CanUseTool, Task } from \"./types.js\";\nimport { Logger } from \"./utils/logger.js\";\nimport { TASK_WORKFLOW } from \"./workflow/config.js\";\nimport type { SendNotification, WorkflowRuntime } from \"./workflow/types.js\";\n\nexport class Agent {\n private workingDirectory: string;\n private taskManager: TaskManager;\n private posthogAPI?: PostHogAPIClient;\n private fileManager: PostHogFileManager;\n private gitManager: GitManager;\n private templateManager: TemplateManager;\n private logger: Logger;\n private acpConnection?: InProcessAcpConnection;\n private promptBuilder: PromptBuilder;\n private mcpServers?: Record<string, any>;\n private canUseTool?: CanUseTool;\n private currentRunId?: string;\n private sessionStore?: SessionStore;\n public debug: boolean;\n\n constructor(config: AgentConfig) {\n this.workingDirectory = config.workingDirectory || process.cwd();\n this.canUseTool = config.canUseTool;\n this.debug = config.debug || false;\n\n // Build default PostHog MCP server configuration\n const posthogMcpUrl =\n config.posthogMcpUrl ||\n process.env.POSTHOG_MCP_URL ||\n \"https://mcp.posthog.com/mcp\";\n\n // Add auth if API key provided\n const headers: Record<string, string> = {};\n if (config.posthogApiKey) {\n headers.Authorization = `Bearer ${config.posthogApiKey}`;\n }\n\n const defaultMcpServers = {\n posthog: {\n type: \"http\" as const,\n url: posthogMcpUrl,\n ...(Object.keys(headers).length > 0 ? { headers } : {}),\n },\n };\n\n // Merge default PostHog MCP with user-provided servers (user config takes precedence)\n this.mcpServers = {\n ...defaultMcpServers,\n ...config.mcpServers,\n };\n this.logger = new Logger({\n debug: this.debug,\n prefix: \"[PostHog Agent]\",\n onLog: config.onLog,\n });\n this.taskManager = new TaskManager();\n\n this.fileManager = new PostHogFileManager(\n this.workingDirectory,\n this.logger.child(\"FileManager\"),\n );\n this.gitManager = new GitManager({\n repositoryPath: this.workingDirectory,\n logger: this.logger.child(\"GitManager\"),\n });\n this.templateManager = new TemplateManager();\n\n if (\n config.posthogApiUrl &&\n config.posthogApiKey &&\n config.posthogProjectId\n ) {\n this.posthogAPI = new PostHogAPIClient({\n apiUrl: config.posthogApiUrl,\n apiKey: config.posthogApiKey,\n projectId: config.posthogProjectId,\n });\n\n // Create SessionStore from the API client for ACP connection\n this.sessionStore = new SessionStore(\n this.posthogAPI,\n this.logger.child(\"SessionStore\"),\n );\n }\n\n this.promptBuilder = new PromptBuilder({\n getTaskFiles: (taskId: string) => this.getTaskFiles(taskId),\n generatePlanTemplate: (vars) => this.templateManager.generatePlan(vars),\n posthogClient: this.posthogAPI,\n logger: this.logger.child(\"PromptBuilder\"),\n });\n }\n\n /**\n * Enable or disable debug logging\n */\n setDebug(enabled: boolean) {\n this.debug = enabled;\n this.logger.setDebug(enabled);\n }\n\n /**\n * Configure LLM gateway environment variables for Claude Code CLI\n */\n private async _configureLlmGateway(): Promise<void> {\n if (!this.posthogAPI) {\n return;\n }\n\n try {\n const gatewayUrl = this.posthogAPI.getLlmGatewayUrl();\n const apiKey = this.posthogAPI.getApiKey();\n process.env.ANTHROPIC_BASE_URL = gatewayUrl;\n process.env.ANTHROPIC_AUTH_TOKEN = apiKey;\n this.ensureOpenAIGatewayEnv(gatewayUrl, apiKey);\n } catch (error) {\n this.logger.error(\"Failed to configure LLM gateway\", error);\n throw error;\n }\n }\n\n private getOrCreateConnection(): InProcessAcpConnection {\n if (!this.acpConnection) {\n this.acpConnection = createAcpConnection({\n sessionStore: this.sessionStore,\n });\n }\n return this.acpConnection;\n }\n\n // Adaptive task execution orchestrated via workflow steps\n async runTask(\n taskId: string,\n taskRunId: string,\n options: import(\"./types.js\").TaskExecutionOptions = {},\n ): Promise<void> {\n // await this._configureLlmGateway();\n\n const task = await this.fetchTask(taskId);\n const cwd = options.repositoryPath || this.workingDirectory;\n const isCloudMode = options.isCloudMode ?? false;\n const taskSlug = (task as any).slug || task.id;\n\n // Use taskRunId as sessionId - they are the same identifier\n this.currentRunId = taskRunId;\n\n this.logger.info(\"Starting adaptive task execution\", {\n taskId: task.id,\n taskSlug,\n taskRunId,\n isCloudMode,\n });\n\n const connection = this.getOrCreateConnection();\n\n // Create sendNotification using ACP connection's extNotification\n const sendNotification: SendNotification = async (method, params) => {\n this.logger.debug(`Notification: ${method}`, params);\n await connection.agentConnection.extNotification?.(method, params);\n };\n\n await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {\n sessionId: taskRunId,\n runId: taskRunId,\n });\n\n await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);\n\n let taskError: Error | undefined;\n try {\n const workflowContext: WorkflowRuntime = {\n task,\n taskSlug,\n runId: taskRunId,\n cwd,\n isCloudMode,\n options,\n logger: this.logger,\n fileManager: this.fileManager,\n gitManager: this.gitManager,\n promptBuilder: this.promptBuilder,\n connection: connection.agentConnection,\n sessionId: taskRunId,\n sendNotification,\n mcpServers: this.mcpServers,\n posthogAPI: this.posthogAPI,\n stepResults: {},\n };\n\n for (const step of TASK_WORKFLOW) {\n const result = await step.run({ step, context: workflowContext });\n if (result.halt) {\n return;\n }\n }\n\n const shouldCreatePR = options.createPR ?? isCloudMode;\n if (shouldCreatePR) {\n await this.ensurePullRequest(\n task,\n workflowContext.stepResults,\n sendNotification,\n );\n }\n\n this.logger.info(\"Task execution complete\", { taskId: task.id });\n await sendNotification(POSTHOG_NOTIFICATIONS.TASK_COMPLETE, {\n sessionId: taskRunId,\n taskId: task.id,\n });\n } catch (error) {\n taskError = error instanceof Error ? error : new Error(String(error));\n this.logger.error(\"Task execution failed\", {\n taskId: task.id,\n error: taskError.message,\n });\n await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {\n sessionId: taskRunId,\n message: taskError.message,\n });\n throw taskError;\n }\n }\n\n /**\n * Creates an in-process ACP connection for client communication.\n * Sets up git branch for the task, configures LLM gateway.\n * The client handles all prompting/querying via the returned streams.\n *\n * @returns InProcessAcpConnection with clientStreams for the client to use\n */\n async runTaskV2(\n taskId: string,\n taskRunId: string,\n options: import(\"./types.js\").TaskExecutionOptions = {},\n ): Promise<InProcessAcpConnection> {\n await this._configureLlmGateway();\n\n const task = await this.fetchTask(taskId);\n const taskSlug = (task as any).slug || task.id;\n const isCloudMode = options.isCloudMode ?? false;\n const _cwd = options.repositoryPath || this.workingDirectory;\n\n // Use taskRunId as sessionId - they are the same identifier\n this.currentRunId = taskRunId;\n\n this.acpConnection = createAcpConnection({\n sessionStore: this.sessionStore,\n sessionId: taskRunId,\n taskId: task.id,\n });\n\n const sendNotification: SendNotification = async (method, params) => {\n this.logger.debug(`Notification: ${method}`, params);\n await this.acpConnection?.agentConnection.extNotification?.(\n method,\n params,\n );\n };\n\n await sendNotification(POSTHOG_NOTIFICATIONS.RUN_STARTED, {\n sessionId: taskRunId,\n runId: taskRunId,\n });\n\n if (!options.skipGitBranch) {\n try {\n await this.prepareTaskBranch(taskSlug, isCloudMode, sendNotification);\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n this.logger.error(\"Failed to prepare task branch\", {\n error: errorMessage,\n });\n await sendNotification(POSTHOG_NOTIFICATIONS.ERROR, {\n sessionId: taskRunId,\n message: errorMessage,\n });\n throw error;\n }\n }\n\n return this.acpConnection;\n }\n\n // PostHog task operations\n async fetchTask(taskId: string): Promise<Task> {\n if (!this.posthogAPI) {\n const error = new Error(\n \"PostHog API not configured. Provide posthogApiUrl and posthogApiKey in constructor.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n return this.posthogAPI.fetchTask(taskId);\n }\n\n getPostHogClient(): PostHogAPIClient | undefined {\n return this.posthogAPI;\n }\n\n async getTaskFiles(taskId: string): Promise<any[]> {\n this.logger.debug(\"Getting task files\", { taskId });\n const files = await this.fileManager.getTaskFiles(taskId);\n this.logger.debug(\"Found task files\", { taskId, fileCount: files.length });\n return files;\n }\n\n async createPullRequest(\n taskId: string,\n branchName: string,\n taskTitle: string,\n taskDescription: string,\n customBody?: string,\n ): Promise<string> {\n this.logger.info(\"Creating pull request\", {\n taskId,\n branchName,\n taskTitle,\n });\n\n const defaultBody = `## Task Details\n**Task ID**: ${taskId}\n**Description**: ${taskDescription}\n\n## Changes\nThis PR implements the changes described in the task.\n\nGenerated by PostHog Agent`;\n const prBody = customBody || defaultBody;\n\n const prUrl = await this.gitManager.createPullRequest(\n branchName,\n taskTitle,\n prBody,\n );\n\n this.logger.info(\"Pull request created\", { taskId, prUrl });\n return prUrl;\n }\n\n async attachPullRequestToTask(\n taskId: string,\n prUrl: string,\n branchName?: string,\n ): Promise<void> {\n this.logger.info(\"Attaching PR to task run\", { taskId, prUrl, branchName });\n\n if (!this.posthogAPI || !this.currentRunId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot attach PR to task.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n const updates: any = {\n output: { pr_url: prUrl },\n };\n if (branchName) {\n updates.branch = branchName;\n }\n\n await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, updates);\n this.logger.debug(\"PR attached to task run\", {\n taskId,\n runId: this.currentRunId,\n prUrl,\n });\n }\n\n async updateTaskBranch(taskId: string, branchName: string): Promise<void> {\n this.logger.info(\"Updating task run branch\", { taskId, branchName });\n\n if (!this.posthogAPI || !this.currentRunId) {\n const error = new Error(\n \"PostHog API not configured or no active run. Cannot update branch.\",\n );\n this.logger.error(\"PostHog API not configured\", error);\n throw error;\n }\n\n await this.posthogAPI.updateTaskRun(taskId, this.currentRunId, {\n branch: branchName,\n });\n this.logger.debug(\"Task run branch updated\", {\n taskId,\n runId: this.currentRunId,\n branchName,\n });\n }\n\n // Execution management\n cancelTask(taskId: string): void {\n // Find the execution for this task and cancel it\n for (const [executionId, execution] of this.taskManager.executionStates) {\n if (execution.taskId === taskId && execution.status === \"running\") {\n this.taskManager.cancelExecution(executionId);\n break;\n }\n }\n }\n\n getTaskExecutionStatus(taskId: string): string | null {\n // Find the execution for this task\n for (const execution of this.taskManager.executionStates.values()) {\n if (execution.taskId === taskId) {\n return execution.status;\n }\n }\n return null;\n }\n\n private async prepareTaskBranch(\n taskSlug: string,\n isCloudMode: boolean,\n sendNotification: SendNotification,\n ): Promise<void> {\n if (await this.gitManager.hasChanges()) {\n throw new Error(\n \"Cannot start task with uncommitted changes. Please commit or stash your changes first.\",\n );\n }\n\n // If we're running in a worktree, we're already on the correct branch\n // (the worktree was created with its own branch). Skip branch creation.\n const isWorktree = await this.gitManager.isWorktree();\n if (isWorktree) {\n const currentBranch = await this.gitManager.getCurrentBranch();\n this.logger.info(\"Running in worktree, using existing branch\", {\n branch: currentBranch,\n });\n await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {\n branch: currentBranch,\n });\n return;\n }\n\n await this.gitManager.resetToDefaultBranchIfNeeded();\n\n const existingBranch = await this.gitManager.getTaskBranch(taskSlug);\n if (!existingBranch) {\n const branchName = await this.gitManager.createTaskBranch(taskSlug);\n await sendNotification(POSTHOG_NOTIFICATIONS.BRANCH_CREATED, {\n branch: branchName,\n });\n\n await this.gitManager.addAllPostHogFiles();\n\n // Only commit if there are changes or we're in cloud mode\n if (isCloudMode) {\n await this.gitManager.commitAndPush(`Initialize task ${taskSlug}`, {\n allowEmpty: true,\n });\n } else {\n // Check if there are any changes before committing\n const hasChanges = await this.gitManager.hasStagedChanges();\n if (hasChanges) {\n await this.gitManager.commitChanges(`Initialize task ${taskSlug}`);\n }\n }\n } else {\n this.logger.info(\"Switching to existing task branch\", {\n branch: existingBranch,\n });\n await this.gitManager.switchToBranch(existingBranch);\n }\n }\n\n private ensureOpenAIGatewayEnv(gatewayUrl?: string, token?: string): void {\n const resolvedGatewayUrl = gatewayUrl || process.env.ANTHROPIC_BASE_URL;\n const resolvedToken = token || process.env.ANTHROPIC_AUTH_TOKEN;\n\n if (resolvedGatewayUrl) {\n process.env.OPENAI_BASE_URL = resolvedGatewayUrl;\n }\n\n if (resolvedToken) {\n process.env.OPENAI_API_KEY = resolvedToken;\n }\n }\n\n private async ensurePullRequest(\n task: Task,\n stepResults: Record<string, any>,\n sendNotification: SendNotification,\n ): Promise<void> {\n const latestRun = task.latest_run;\n const existingPr =\n latestRun?.output && typeof latestRun.output === \"object\"\n ? (latestRun.output as any).pr_url\n : null;\n\n if (existingPr) {\n this.logger.info(\"PR already exists, skipping creation\", {\n taskId: task.id,\n prUrl: existingPr,\n });\n return;\n }\n\n const buildResult = stepResults.build;\n if (!buildResult?.commitCreated) {\n this.logger.warn(\n \"Build step did not produce a commit; skipping PR creation\",\n { taskId: task.id },\n );\n return;\n }\n\n const branchName = await this.gitManager.getCurrentBranch();\n const finalizeResult = stepResults.finalize;\n const prBody = finalizeResult?.prBody;\n\n const prUrl = await this.createPullRequest(\n task.id,\n branchName,\n task.title,\n task.description ?? \"\",\n prBody,\n );\n\n await sendNotification(POSTHOG_NOTIFICATIONS.PR_CREATED, { prUrl });\n\n try {\n await this.attachPullRequestToTask(task.id, prUrl, branchName);\n this.logger.info(\"PR attached to task successfully\", {\n taskId: task.id,\n prUrl,\n });\n } catch (error) {\n this.logger.warn(\"Could not attach PR to task\", {\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n}\n\nexport type {\n AgentConfig,\n ExecutionResult,\n SupportingFile,\n Task,\n} from \"./types.js\";\nexport { PermissionMode } from \"./types.js\";\n"],"names":[],"mappings":";;;;;;;;;;;;;MAiBa,KAAK,CAAA;AACR,IAAA,gBAAgB;AAChB,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,eAAe;AACf,IAAA,MAAM;AACN,IAAA,aAAa;AACb,IAAA,aAAa;AACb,IAAA,UAAU;AACV,IAAA,UAAU;AACV,IAAA,YAAY;AACZ,IAAA,YAAY;AACb,IAAA,KAAK;AAEZ,IAAA,WAAA,CAAY,MAAmB,EAAA;QAC7B,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gB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,CAAC,WAAW,IAAI,EAAE,EACtB,MAAM,CACP;QAED,MAAM,gBAAgB,CAAC,qBAAqB,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC;AAEnE,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC;AAC9D,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE;gBACnD,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,KAAK;AACN,aAAA,CAAC;QACJ;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE;AAC9C,gBAAA,KAAK,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9D,aAAA,CAAC;QACJ;IACF;AACD;;;;"}
@@ -33,8 +33,8 @@ export declare class PostHogFileManager {
33
33
  readRequirements(taskId: string): Promise<string | null>;
34
34
  writeResearch(taskId: string, data: ResearchEvaluation): Promise<void>;
35
35
  readResearch(taskId: string): Promise<ResearchEvaluation | null>;
36
- writeTodos(taskId: string, data: any): Promise<void>;
37
- readTodos(taskId: string): Promise<any | null>;
36
+ writeTodos(taskId: string, data: unknown): Promise<void>;
37
+ readTodos(taskId: string): Promise<unknown | null>;
38
38
  getTaskFiles(taskId: string): Promise<SupportingFile[]>;
39
39
  collectTaskArtifacts(taskId: string): Promise<LocalArtifact[]>;
40
40
  private resolveFileType;
@@ -1 +1 @@
1
- {"version":3,"file":"file-manager.d.ts","sourceRoot":"","sources":["../../src/file-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAA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