@posthog/agent 1.26.0 → 1.27.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 (571) hide show
  1. package/dist/index.d.ts +1274 -20
  2. package/dist/index.js +7296 -11
  3. package/dist/index.js.map +1 -1
  4. package/package.json +6 -12
  5. package/src/agent.ts +42 -5
  6. package/src/types.ts +1 -1
  7. package/dist/_virtual/_commonjsHelpers.js +0 -6
  8. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  9. package/dist/_virtual/_tslib.js +0 -74
  10. package/dist/_virtual/_tslib.js.map +0 -1
  11. package/dist/_virtual/additionalItems.js +0 -4
  12. package/dist/_virtual/additionalItems.js.map +0 -1
  13. package/dist/_virtual/additionalProperties.js +0 -4
  14. package/dist/_virtual/additionalProperties.js.map +0 -1
  15. package/dist/_virtual/ajv.js +0 -4
  16. package/dist/_virtual/ajv.js.map +0 -1
  17. package/dist/_virtual/allOf.js +0 -4
  18. package/dist/_virtual/allOf.js.map +0 -1
  19. package/dist/_virtual/anyOf.js +0 -4
  20. package/dist/_virtual/anyOf.js.map +0 -1
  21. package/dist/_virtual/applicability.js +0 -4
  22. package/dist/_virtual/applicability.js.map +0 -1
  23. package/dist/_virtual/boolSchema.js +0 -4
  24. package/dist/_virtual/boolSchema.js.map +0 -1
  25. package/dist/_virtual/code.js +0 -4
  26. package/dist/_virtual/code.js.map +0 -1
  27. package/dist/_virtual/code2.js +0 -4
  28. package/dist/_virtual/code2.js.map +0 -1
  29. package/dist/_virtual/const.js +0 -4
  30. package/dist/_virtual/const.js.map +0 -1
  31. package/dist/_virtual/contains.js +0 -4
  32. package/dist/_virtual/contains.js.map +0 -1
  33. package/dist/_virtual/core.js +0 -4
  34. package/dist/_virtual/core.js.map +0 -1
  35. package/dist/_virtual/dataType.js +0 -4
  36. package/dist/_virtual/dataType.js.map +0 -1
  37. package/dist/_virtual/defaults.js +0 -4
  38. package/dist/_virtual/defaults.js.map +0 -1
  39. package/dist/_virtual/dependencies.js +0 -4
  40. package/dist/_virtual/dependencies.js.map +0 -1
  41. package/dist/_virtual/draft7.js +0 -4
  42. package/dist/_virtual/draft7.js.map +0 -1
  43. package/dist/_virtual/enum.js +0 -4
  44. package/dist/_virtual/enum.js.map +0 -1
  45. package/dist/_virtual/equal.js +0 -4
  46. package/dist/_virtual/equal.js.map +0 -1
  47. package/dist/_virtual/errors.js +0 -4
  48. package/dist/_virtual/errors.js.map +0 -1
  49. package/dist/_virtual/format.js +0 -4
  50. package/dist/_virtual/format.js.map +0 -1
  51. package/dist/_virtual/formats.js +0 -4
  52. package/dist/_virtual/formats.js.map +0 -1
  53. package/dist/_virtual/id.js +0 -4
  54. package/dist/_virtual/id.js.map +0 -1
  55. package/dist/_virtual/if.js +0 -4
  56. package/dist/_virtual/if.js.map +0 -1
  57. package/dist/_virtual/index.js +0 -4
  58. package/dist/_virtual/index.js.map +0 -1
  59. package/dist/_virtual/index10.js +0 -4
  60. package/dist/_virtual/index10.js.map +0 -1
  61. package/dist/_virtual/index11.js +0 -4
  62. package/dist/_virtual/index11.js.map +0 -1
  63. package/dist/_virtual/index2.js +0 -4
  64. package/dist/_virtual/index2.js.map +0 -1
  65. package/dist/_virtual/index3.js +0 -4
  66. package/dist/_virtual/index3.js.map +0 -1
  67. package/dist/_virtual/index4.js +0 -4
  68. package/dist/_virtual/index4.js.map +0 -1
  69. package/dist/_virtual/index5.js +0 -4
  70. package/dist/_virtual/index5.js.map +0 -1
  71. package/dist/_virtual/index6.js +0 -4
  72. package/dist/_virtual/index6.js.map +0 -1
  73. package/dist/_virtual/index7.js +0 -4
  74. package/dist/_virtual/index7.js.map +0 -1
  75. package/dist/_virtual/index8.js +0 -4
  76. package/dist/_virtual/index8.js.map +0 -1
  77. package/dist/_virtual/index9.js +0 -4
  78. package/dist/_virtual/index9.js.map +0 -1
  79. package/dist/_virtual/items.js +0 -4
  80. package/dist/_virtual/items.js.map +0 -1
  81. package/dist/_virtual/items2020.js +0 -4
  82. package/dist/_virtual/items2020.js.map +0 -1
  83. package/dist/_virtual/keyword.js +0 -4
  84. package/dist/_virtual/keyword.js.map +0 -1
  85. package/dist/_virtual/limit.js +0 -4
  86. package/dist/_virtual/limit.js.map +0 -1
  87. package/dist/_virtual/limitItems.js +0 -4
  88. package/dist/_virtual/limitItems.js.map +0 -1
  89. package/dist/_virtual/limitLength.js +0 -4
  90. package/dist/_virtual/limitLength.js.map +0 -1
  91. package/dist/_virtual/limitNumber.js +0 -4
  92. package/dist/_virtual/limitNumber.js.map +0 -1
  93. package/dist/_virtual/limitProperties.js +0 -4
  94. package/dist/_virtual/limitProperties.js.map +0 -1
  95. package/dist/_virtual/metadata.js +0 -4
  96. package/dist/_virtual/metadata.js.map +0 -1
  97. package/dist/_virtual/multipleOf.js +0 -4
  98. package/dist/_virtual/multipleOf.js.map +0 -1
  99. package/dist/_virtual/names.js +0 -4
  100. package/dist/_virtual/names.js.map +0 -1
  101. package/dist/_virtual/not.js +0 -4
  102. package/dist/_virtual/not.js.map +0 -1
  103. package/dist/_virtual/oneOf.js +0 -4
  104. package/dist/_virtual/oneOf.js.map +0 -1
  105. package/dist/_virtual/pattern.js +0 -4
  106. package/dist/_virtual/pattern.js.map +0 -1
  107. package/dist/_virtual/patternProperties.js +0 -4
  108. package/dist/_virtual/patternProperties.js.map +0 -1
  109. package/dist/_virtual/prefixItems.js +0 -4
  110. package/dist/_virtual/prefixItems.js.map +0 -1
  111. package/dist/_virtual/properties.js +0 -4
  112. package/dist/_virtual/properties.js.map +0 -1
  113. package/dist/_virtual/propertyNames.js +0 -4
  114. package/dist/_virtual/propertyNames.js.map +0 -1
  115. package/dist/_virtual/ref.js +0 -4
  116. package/dist/_virtual/ref.js.map +0 -1
  117. package/dist/_virtual/ref_error.js +0 -4
  118. package/dist/_virtual/ref_error.js.map +0 -1
  119. package/dist/_virtual/required.js +0 -4
  120. package/dist/_virtual/required.js.map +0 -1
  121. package/dist/_virtual/resolve.js +0 -4
  122. package/dist/_virtual/resolve.js.map +0 -1
  123. package/dist/_virtual/rules.js +0 -4
  124. package/dist/_virtual/rules.js.map +0 -1
  125. package/dist/_virtual/scope.js +0 -4
  126. package/dist/_virtual/scope.js.map +0 -1
  127. package/dist/_virtual/subschema.js +0 -4
  128. package/dist/_virtual/subschema.js.map +0 -1
  129. package/dist/_virtual/thenElse.js +0 -4
  130. package/dist/_virtual/thenElse.js.map +0 -1
  131. package/dist/_virtual/types.js +0 -4
  132. package/dist/_virtual/types.js.map +0 -1
  133. package/dist/_virtual/ucs2length.js +0 -4
  134. package/dist/_virtual/ucs2length.js.map +0 -1
  135. package/dist/_virtual/uniqueItems.js +0 -4
  136. package/dist/_virtual/uniqueItems.js.map +0 -1
  137. package/dist/_virtual/uri.js +0 -4
  138. package/dist/_virtual/uri.js.map +0 -1
  139. package/dist/_virtual/util.js +0 -4
  140. package/dist/_virtual/util.js.map +0 -1
  141. package/dist/_virtual/validation_error.js +0 -4
  142. package/dist/_virtual/validation_error.js.map +0 -1
  143. package/dist/example-client.d.ts +0 -3
  144. package/dist/example-client.d.ts.map +0 -1
  145. package/dist/example.d.ts +0 -3
  146. package/dist/example.d.ts.map +0 -1
  147. package/dist/index.d.ts.map +0 -1
  148. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js +0 -891
  149. package/dist/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +0 -1
  150. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js +0 -876
  151. package/dist/node_modules/@agentclientprotocol/sdk/dist/schema.js.map +0 -1
  152. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js +0 -66
  153. package/dist/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +0 -1
  154. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +0 -23
  155. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +0 -1
  156. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +0 -331
  157. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +0 -1
  158. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +0 -717
  159. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +0 -1
  160. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +0 -221
  161. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +0 -1
  162. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +0 -56
  163. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +0 -1
  164. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +0 -440
  165. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +0 -1
  166. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +0 -94
  167. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +0 -1
  168. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +0 -1610
  169. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +0 -1
  170. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +0 -91
  171. package/dist/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +0 -1
  172. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js +0 -133
  173. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/ZodError.js.map +0 -1
  174. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js +0 -9
  175. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/errors.js.map +0 -1
  176. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js +0 -9
  177. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/errorUtil.js.map +0 -1
  178. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js +0 -112
  179. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/parseUtil.js.map +0 -1
  180. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js +0 -136
  181. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/helpers/util.js.map +0 -1
  182. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js +0 -112
  183. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/locales/en.js.map +0 -1
  184. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js +0 -3297
  185. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v3/types.js.map +0 -1
  186. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js +0 -44
  187. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/errors.js.map +0 -1
  188. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js +0 -36
  189. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/iso.js.map +0 -1
  190. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js +0 -10
  191. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/parse.js.map +0 -1
  192. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js +0 -657
  193. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/classic/schemas.js.map +0 -1
  194. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js +0 -449
  195. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/api.js.map +0 -1
  196. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js +0 -413
  197. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/checks.js.map +0 -1
  198. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js +0 -57
  199. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/core.js.map +0 -1
  200. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js +0 -38
  201. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/doc.js.map +0 -1
  202. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js +0 -86
  203. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/errors.js.map +0 -1
  204. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js +0 -61
  205. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/parse.js.map +0 -1
  206. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js +0 -80
  207. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/regexes.js.map +0 -1
  208. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js +0 -52
  209. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/registries.js.map +0 -1
  210. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js +0 -1307
  211. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/schemas.js.map +0 -1
  212. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js +0 -842
  213. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
  214. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js +0 -335
  215. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/util.js.map +0 -1
  216. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js +0 -8
  217. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/core/versions.js.map +0 -1
  218. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js +0 -51
  219. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/zod/v4/mini/schemas.js.map +0 -1
  220. package/dist/node_modules/ajv/dist/ajv.js +0 -69
  221. package/dist/node_modules/ajv/dist/ajv.js.map +0 -1
  222. package/dist/node_modules/ajv/dist/compile/codegen/code.js +0 -169
  223. package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +0 -1
  224. package/dist/node_modules/ajv/dist/compile/codegen/index.js +0 -712
  225. package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +0 -1
  226. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +0 -157
  227. package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +0 -1
  228. package/dist/node_modules/ajv/dist/compile/errors.js +0 -140
  229. package/dist/node_modules/ajv/dist/compile/errors.js.map +0 -1
  230. package/dist/node_modules/ajv/dist/compile/index.js +0 -253
  231. package/dist/node_modules/ajv/dist/compile/index.js.map +0 -1
  232. package/dist/node_modules/ajv/dist/compile/names.js +0 -40
  233. package/dist/node_modules/ajv/dist/compile/names.js.map +0 -1
  234. package/dist/node_modules/ajv/dist/compile/ref_error.js +0 -25
  235. package/dist/node_modules/ajv/dist/compile/ref_error.js.map +0 -1
  236. package/dist/node_modules/ajv/dist/compile/resolve.js +0 -162
  237. package/dist/node_modules/ajv/dist/compile/resolve.js.map +0 -1
  238. package/dist/node_modules/ajv/dist/compile/rules.js +0 -29
  239. package/dist/node_modules/ajv/dist/compile/rules.js.map +0 -1
  240. package/dist/node_modules/ajv/dist/compile/util.js +0 -183
  241. package/dist/node_modules/ajv/dist/compile/util.js.map +0 -1
  242. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +0 -30
  243. package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +0 -1
  244. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -64
  245. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +0 -1
  246. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +0 -213
  247. package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +0 -1
  248. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +0 -49
  249. package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +0 -1
  250. package/dist/node_modules/ajv/dist/compile/validate/index.js +0 -544
  251. package/dist/node_modules/ajv/dist/compile/validate/index.js.map +0 -1
  252. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +0 -139
  253. package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +0 -1
  254. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +0 -95
  255. package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +0 -1
  256. package/dist/node_modules/ajv/dist/core.js +0 -639
  257. package/dist/node_modules/ajv/dist/core.js.map +0 -1
  258. package/dist/node_modules/ajv/dist/refs/data.json.js +0 -31
  259. package/dist/node_modules/ajv/dist/refs/data.json.js.map +0 -1
  260. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +0 -254
  261. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +0 -1
  262. package/dist/node_modules/ajv/dist/runtime/equal.js +0 -9
  263. package/dist/node_modules/ajv/dist/runtime/equal.js.map +0 -1
  264. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
  265. package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
  266. package/dist/node_modules/ajv/dist/runtime/uri.js +0 -8
  267. package/dist/node_modules/ajv/dist/runtime/uri.js.map +0 -1
  268. package/dist/node_modules/ajv/dist/runtime/validation_error.js +0 -22
  269. package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +0 -1
  270. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -53
  271. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +0 -1
  272. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -112
  273. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +0 -1
  274. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -26
  275. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +0 -1
  276. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -14
  277. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +0 -1
  278. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -99
  279. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +0 -1
  280. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -93
  281. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +0 -1
  282. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -70
  283. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +0 -1
  284. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -77
  285. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +0 -1
  286. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -57
  287. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +0 -1
  288. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -37
  289. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +0 -1
  290. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -29
  291. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +0 -1
  292. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -64
  293. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +0 -1
  294. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -80
  295. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +0 -1
  296. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -15
  297. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +0 -1
  298. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -61
  299. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +0 -1
  300. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -42
  301. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +0 -1
  302. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -16
  303. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +0 -1
  304. package/dist/node_modules/ajv/dist/vocabularies/code.js +0 -146
  305. package/dist/node_modules/ajv/dist/vocabularies/code.js.map +0 -1
  306. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +0 -11
  307. package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +0 -1
  308. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +0 -21
  309. package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +0 -1
  310. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +0 -131
  311. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +0 -1
  312. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -113
  313. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +0 -1
  314. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -12
  315. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +0 -1
  316. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +0 -28
  317. package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +0 -1
  318. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +0 -94
  319. package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +0 -1
  320. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +0 -9
  321. package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +0 -1
  322. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +0 -21
  323. package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +0 -1
  324. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +0 -31
  325. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +0 -1
  326. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -54
  327. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +0 -1
  328. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +0 -54
  329. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +0 -1
  330. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -26
  331. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +0 -1
  332. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -33
  333. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +0 -1
  334. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -29
  335. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +0 -1
  336. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -26
  337. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +0 -1
  338. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -28
  339. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +0 -1
  340. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -27
  341. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +0 -1
  342. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +0 -84
  343. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +0 -1
  344. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -72
  345. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +0 -1
  346. package/dist/node_modules/ajv-formats/dist/formats.js +0 -212
  347. package/dist/node_modules/ajv-formats/dist/formats.js.map +0 -1
  348. package/dist/node_modules/ajv-formats/dist/index.js +0 -52
  349. package/dist/node_modules/ajv-formats/dist/index.js.map +0 -1
  350. package/dist/node_modules/ajv-formats/dist/limit.js +0 -75
  351. package/dist/node_modules/ajv-formats/dist/limit.js.map +0 -1
  352. package/dist/node_modules/diff/libesm/diff/base.js +0 -256
  353. package/dist/node_modules/diff/libesm/diff/base.js.map +0 -1
  354. package/dist/node_modules/diff/libesm/diff/line.js +0 -64
  355. package/dist/node_modules/diff/libesm/diff/line.js.map +0 -1
  356. package/dist/node_modules/diff/libesm/patch/create.js +0 -185
  357. package/dist/node_modules/diff/libesm/patch/create.js.map +0 -1
  358. package/dist/node_modules/fast-deep-equal/index.js +0 -47
  359. package/dist/node_modules/fast-deep-equal/index.js.map +0 -1
  360. package/dist/node_modules/fast-uri/index.js +0 -347
  361. package/dist/node_modules/fast-uri/index.js.map +0 -1
  362. package/dist/node_modules/fast-uri/lib/schemes.js +0 -255
  363. package/dist/node_modules/fast-uri/lib/schemes.js.map +0 -1
  364. package/dist/node_modules/fast-uri/lib/utils.js +0 -334
  365. package/dist/node_modules/fast-uri/lib/utils.js.map +0 -1
  366. package/dist/node_modules/json-schema-traverse/index.js +0 -98
  367. package/dist/node_modules/json-schema-traverse/index.js.map +0 -1
  368. package/dist/node_modules/uuid/dist/rng.js +0 -14
  369. package/dist/node_modules/uuid/dist/rng.js.map +0 -1
  370. package/dist/node_modules/uuid/dist/stringify.js +0 -29
  371. package/dist/node_modules/uuid/dist/stringify.js.map +0 -1
  372. package/dist/node_modules/uuid/dist/v7.js +0 -65
  373. package/dist/node_modules/uuid/dist/v7.js.map +0 -1
  374. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -37
  375. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +0 -1
  376. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -26
  377. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +0 -1
  378. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -17
  379. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +0 -1
  380. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -11
  381. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +0 -1
  382. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -66
  383. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +0 -1
  384. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -21
  385. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +0 -1
  386. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +0 -30
  387. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +0 -1
  388. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -53
  389. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +0 -1
  390. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -8
  391. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +0 -1
  392. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -8
  393. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +0 -1
  394. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -8
  395. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +0 -1
  396. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -50
  397. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +0 -1
  398. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -11
  399. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +0 -1
  400. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -11
  401. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +0 -1
  402. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -9
  403. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +0 -1
  404. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -56
  405. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +0 -1
  406. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -24
  407. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +0 -1
  408. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -30
  409. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +0 -1
  410. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -19
  411. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +0 -1
  412. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -15
  413. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +0 -1
  414. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -13
  415. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +0 -1
  416. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -37
  417. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +0 -1
  418. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -56
  419. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +0 -1
  420. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -76
  421. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +0 -1
  422. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -25
  423. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +0 -1
  424. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -24
  425. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +0 -1
  426. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -8
  427. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +0 -1
  428. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -8
  429. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +0 -1
  430. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +0 -65
  431. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +0 -1
  432. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -24
  433. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +0 -1
  434. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -350
  435. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +0 -1
  436. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -36
  437. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +0 -1
  438. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -10
  439. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +0 -1
  440. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -84
  441. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +0 -1
  442. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -8
  443. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +0 -1
  444. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +0 -109
  445. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +0 -1
  446. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -90
  447. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +0 -1
  448. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js +0 -42
  449. package/dist/node_modules/zod-to-json-schema/node_modules/zod/v3/types.js.map +0 -1
  450. package/dist/package.json.js +0 -8
  451. package/dist/package.json.js.map +0 -1
  452. package/dist/src/acp-extensions.d.ts +0 -91
  453. package/dist/src/acp-extensions.d.ts.map +0 -1
  454. package/dist/src/acp-extensions.js +0 -38
  455. package/dist/src/acp-extensions.js.map +0 -1
  456. package/dist/src/adapters/claude/claude.d.ts +0 -136
  457. package/dist/src/adapters/claude/claude.d.ts.map +0 -1
  458. package/dist/src/adapters/claude/claude.js +0 -1128
  459. package/dist/src/adapters/claude/claude.js.map +0 -1
  460. package/dist/src/adapters/claude/mcp-server.d.ts +0 -30
  461. package/dist/src/adapters/claude/mcp-server.d.ts.map +0 -1
  462. package/dist/src/adapters/claude/mcp-server.js +0 -668
  463. package/dist/src/adapters/claude/mcp-server.js.map +0 -1
  464. package/dist/src/adapters/claude/tools.d.ts +0 -35
  465. package/dist/src/adapters/claude/tools.d.ts.map +0 -1
  466. package/dist/src/adapters/claude/tools.js +0 -473
  467. package/dist/src/adapters/claude/tools.js.map +0 -1
  468. package/dist/src/adapters/claude/utils.d.ts +0 -48
  469. package/dist/src/adapters/claude/utils.d.ts.map +0 -1
  470. package/dist/src/adapters/claude/utils.js +0 -158
  471. package/dist/src/adapters/claude/utils.js.map +0 -1
  472. package/dist/src/agent.d.ts +0 -58
  473. package/dist/src/agent.d.ts.map +0 -1
  474. package/dist/src/agent.js +0 -576
  475. package/dist/src/agent.js.map +0 -1
  476. package/dist/src/agents/execution.d.ts +0 -2
  477. package/dist/src/agents/execution.d.ts.map +0 -1
  478. package/dist/src/agents/execution.js +0 -40
  479. package/dist/src/agents/execution.js.map +0 -1
  480. package/dist/src/agents/planning.d.ts +0 -2
  481. package/dist/src/agents/planning.d.ts.map +0 -1
  482. package/dist/src/agents/planning.js +0 -63
  483. package/dist/src/agents/planning.js.map +0 -1
  484. package/dist/src/agents/research.d.ts +0 -2
  485. package/dist/src/agents/research.d.ts.map +0 -1
  486. package/dist/src/agents/research.js +0 -163
  487. package/dist/src/agents/research.js.map +0 -1
  488. package/dist/src/file-manager.d.ts +0 -43
  489. package/dist/src/file-manager.d.ts.map +0 -1
  490. package/dist/src/file-manager.js +0 -266
  491. package/dist/src/file-manager.js.map +0 -1
  492. package/dist/src/git-manager.d.ts +0 -79
  493. package/dist/src/git-manager.d.ts.map +0 -1
  494. package/dist/src/git-manager.js +0 -454
  495. package/dist/src/git-manager.js.map +0 -1
  496. package/dist/src/posthog-api.d.ts +0 -48
  497. package/dist/src/posthog-api.d.ts.map +0 -1
  498. package/dist/src/posthog-api.js +0 -260
  499. package/dist/src/posthog-api.js.map +0 -1
  500. package/dist/src/prompt-builder.d.ts +0 -49
  501. package/dist/src/prompt-builder.d.ts.map +0 -1
  502. package/dist/src/prompt-builder.js +0 -397
  503. package/dist/src/prompt-builder.js.map +0 -1
  504. package/dist/src/schemas.d.ts +0 -980
  505. package/dist/src/schemas.d.ts.map +0 -1
  506. package/dist/src/schemas.js +0 -196
  507. package/dist/src/schemas.js.map +0 -1
  508. package/dist/src/session-store.d.ts +0 -58
  509. package/dist/src/session-store.d.ts.map +0 -1
  510. package/dist/src/session-store.js +0 -206
  511. package/dist/src/session-store.js.map +0 -1
  512. package/dist/src/task-manager.d.ts +0 -25
  513. package/dist/src/task-manager.d.ts.map +0 -1
  514. package/dist/src/task-manager.js +0 -123
  515. package/dist/src/task-manager.js.map +0 -1
  516. package/dist/src/template-manager.d.ts +0 -30
  517. package/dist/src/template-manager.d.ts.map +0 -1
  518. package/dist/src/template-manager.js +0 -152
  519. package/dist/src/template-manager.js.map +0 -1
  520. package/dist/src/todo-manager.d.ts +0 -29
  521. package/dist/src/todo-manager.d.ts.map +0 -1
  522. package/dist/src/todo-manager.js +0 -135
  523. package/dist/src/todo-manager.js.map +0 -1
  524. package/dist/src/tools/registry.d.ts +0 -25
  525. package/dist/src/tools/registry.d.ts.map +0 -1
  526. package/dist/src/tools/registry.js +0 -120
  527. package/dist/src/tools/registry.js.map +0 -1
  528. package/dist/src/tools/types.d.ts +0 -80
  529. package/dist/src/tools/types.d.ts.map +0 -1
  530. package/dist/src/types.d.ts +0 -193
  531. package/dist/src/types.d.ts.map +0 -1
  532. package/dist/src/types.js +0 -11
  533. package/dist/src/types.js.map +0 -1
  534. package/dist/src/utils/logger.d.ts +0 -37
  535. package/dist/src/utils/logger.d.ts.map +0 -1
  536. package/dist/src/utils/logger.js +0 -83
  537. package/dist/src/utils/logger.js.map +0 -1
  538. package/dist/src/utils/tapped-stream.d.ts +0 -17
  539. package/dist/src/utils/tapped-stream.d.ts.map +0 -1
  540. package/dist/src/utils/tapped-stream.js +0 -45
  541. package/dist/src/utils/tapped-stream.js.map +0 -1
  542. package/dist/src/workflow/config.d.ts +0 -3
  543. package/dist/src/workflow/config.d.ts.map +0 -1
  544. package/dist/src/workflow/config.js +0 -54
  545. package/dist/src/workflow/config.js.map +0 -1
  546. package/dist/src/workflow/steps/build.d.ts +0 -3
  547. package/dist/src/workflow/steps/build.d.ts.map +0 -1
  548. package/dist/src/workflow/steps/build.js +0 -108
  549. package/dist/src/workflow/steps/build.js.map +0 -1
  550. package/dist/src/workflow/steps/finalize.d.ts +0 -3
  551. package/dist/src/workflow/steps/finalize.d.ts.map +0 -1
  552. package/dist/src/workflow/steps/finalize.js +0 -188
  553. package/dist/src/workflow/steps/finalize.js.map +0 -1
  554. package/dist/src/workflow/steps/plan.d.ts +0 -3
  555. package/dist/src/workflow/steps/plan.d.ts.map +0 -1
  556. package/dist/src/workflow/steps/plan.js +0 -136
  557. package/dist/src/workflow/steps/plan.js.map +0 -1
  558. package/dist/src/workflow/steps/research.d.ts +0 -3
  559. package/dist/src/workflow/steps/research.d.ts.map +0 -1
  560. package/dist/src/workflow/steps/research.js +0 -189
  561. package/dist/src/workflow/steps/research.js.map +0 -1
  562. package/dist/src/workflow/types.d.ts +0 -51
  563. package/dist/src/workflow/types.d.ts.map +0 -1
  564. package/dist/src/workflow/utils.d.ts +0 -12
  565. package/dist/src/workflow/utils.d.ts.map +0 -1
  566. package/dist/src/workflow/utils.js +0 -41
  567. package/dist/src/workflow/utils.js.map +0 -1
  568. package/dist/src/worktree-manager.d.ts +0 -39
  569. package/dist/src/worktree-manager.d.ts.map +0 -1
  570. package/dist/src/worktree-manager.js +0 -808
  571. package/dist/src/worktree-manager.js.map +0 -1
@@ -1,712 +0,0 @@
1
- import { __exports as codegen } from '../../../../../_virtual/index9.js';
2
- import { __require as requireCode } from './code.js';
3
- import { __require as requireScope } from './scope.js';
4
-
5
- var hasRequiredCodegen;
6
-
7
- function requireCodegen () {
8
- if (hasRequiredCodegen) return codegen;
9
- hasRequiredCodegen = 1;
10
- (function (exports$1) {
11
- Object.defineProperty(exports$1, "__esModule", { value: true });
12
- exports$1.or = exports$1.and = exports$1.not = exports$1.CodeGen = exports$1.operators = exports$1.varKinds = exports$1.ValueScopeName = exports$1.ValueScope = exports$1.Scope = exports$1.Name = exports$1.regexpCode = exports$1.stringify = exports$1.getProperty = exports$1.nil = exports$1.strConcat = exports$1.str = exports$1._ = void 0;
13
- const code_1 = requireCode();
14
- const scope_1 = requireScope();
15
- var code_2 = requireCode();
16
- Object.defineProperty(exports$1, "_", { enumerable: true, get: function () { return code_2._; } });
17
- Object.defineProperty(exports$1, "str", { enumerable: true, get: function () { return code_2.str; } });
18
- Object.defineProperty(exports$1, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } });
19
- Object.defineProperty(exports$1, "nil", { enumerable: true, get: function () { return code_2.nil; } });
20
- Object.defineProperty(exports$1, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } });
21
- Object.defineProperty(exports$1, "stringify", { enumerable: true, get: function () { return code_2.stringify; } });
22
- Object.defineProperty(exports$1, "regexpCode", { enumerable: true, get: function () { return code_2.regexpCode; } });
23
- Object.defineProperty(exports$1, "Name", { enumerable: true, get: function () { return code_2.Name; } });
24
- var scope_2 = requireScope();
25
- Object.defineProperty(exports$1, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } });
26
- Object.defineProperty(exports$1, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } });
27
- Object.defineProperty(exports$1, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } });
28
- Object.defineProperty(exports$1, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } });
29
- exports$1.operators = {
30
- GT: new code_1._Code(">"),
31
- GTE: new code_1._Code(">="),
32
- LT: new code_1._Code("<"),
33
- LTE: new code_1._Code("<="),
34
- EQ: new code_1._Code("==="),
35
- NEQ: new code_1._Code("!=="),
36
- NOT: new code_1._Code("!"),
37
- OR: new code_1._Code("||"),
38
- AND: new code_1._Code("&&"),
39
- ADD: new code_1._Code("+"),
40
- };
41
- class Node {
42
- optimizeNodes() {
43
- return this;
44
- }
45
- optimizeNames(_names, _constants) {
46
- return this;
47
- }
48
- }
49
- class Def extends Node {
50
- constructor(varKind, name, rhs) {
51
- super();
52
- this.varKind = varKind;
53
- this.name = name;
54
- this.rhs = rhs;
55
- }
56
- render({ es5, _n }) {
57
- const varKind = es5 ? scope_1.varKinds.var : this.varKind;
58
- const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`;
59
- return `${varKind} ${this.name}${rhs};` + _n;
60
- }
61
- optimizeNames(names, constants) {
62
- if (!names[this.name.str])
63
- return;
64
- if (this.rhs)
65
- this.rhs = optimizeExpr(this.rhs, names, constants);
66
- return this;
67
- }
68
- get names() {
69
- return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
70
- }
71
- }
72
- class Assign extends Node {
73
- constructor(lhs, rhs, sideEffects) {
74
- super();
75
- this.lhs = lhs;
76
- this.rhs = rhs;
77
- this.sideEffects = sideEffects;
78
- }
79
- render({ _n }) {
80
- return `${this.lhs} = ${this.rhs};` + _n;
81
- }
82
- optimizeNames(names, constants) {
83
- if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
84
- return;
85
- this.rhs = optimizeExpr(this.rhs, names, constants);
86
- return this;
87
- }
88
- get names() {
89
- const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
90
- return addExprNames(names, this.rhs);
91
- }
92
- }
93
- class AssignOp extends Assign {
94
- constructor(lhs, op, rhs, sideEffects) {
95
- super(lhs, rhs, sideEffects);
96
- this.op = op;
97
- }
98
- render({ _n }) {
99
- return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
100
- }
101
- }
102
- class Label extends Node {
103
- constructor(label) {
104
- super();
105
- this.label = label;
106
- this.names = {};
107
- }
108
- render({ _n }) {
109
- return `${this.label}:` + _n;
110
- }
111
- }
112
- class Break extends Node {
113
- constructor(label) {
114
- super();
115
- this.label = label;
116
- this.names = {};
117
- }
118
- render({ _n }) {
119
- const label = this.label ? ` ${this.label}` : "";
120
- return `break${label};` + _n;
121
- }
122
- }
123
- class Throw extends Node {
124
- constructor(error) {
125
- super();
126
- this.error = error;
127
- }
128
- render({ _n }) {
129
- return `throw ${this.error};` + _n;
130
- }
131
- get names() {
132
- return this.error.names;
133
- }
134
- }
135
- class AnyCode extends Node {
136
- constructor(code) {
137
- super();
138
- this.code = code;
139
- }
140
- render({ _n }) {
141
- return `${this.code};` + _n;
142
- }
143
- optimizeNodes() {
144
- return `${this.code}` ? this : undefined;
145
- }
146
- optimizeNames(names, constants) {
147
- this.code = optimizeExpr(this.code, names, constants);
148
- return this;
149
- }
150
- get names() {
151
- return this.code instanceof code_1._CodeOrName ? this.code.names : {};
152
- }
153
- }
154
- class ParentNode extends Node {
155
- constructor(nodes = []) {
156
- super();
157
- this.nodes = nodes;
158
- }
159
- render(opts) {
160
- return this.nodes.reduce((code, n) => code + n.render(opts), "");
161
- }
162
- optimizeNodes() {
163
- const { nodes } = this;
164
- let i = nodes.length;
165
- while (i--) {
166
- const n = nodes[i].optimizeNodes();
167
- if (Array.isArray(n))
168
- nodes.splice(i, 1, ...n);
169
- else if (n)
170
- nodes[i] = n;
171
- else
172
- nodes.splice(i, 1);
173
- }
174
- return nodes.length > 0 ? this : undefined;
175
- }
176
- optimizeNames(names, constants) {
177
- const { nodes } = this;
178
- let i = nodes.length;
179
- while (i--) {
180
- // iterating backwards improves 1-pass optimization
181
- const n = nodes[i];
182
- if (n.optimizeNames(names, constants))
183
- continue;
184
- subtractNames(names, n.names);
185
- nodes.splice(i, 1);
186
- }
187
- return nodes.length > 0 ? this : undefined;
188
- }
189
- get names() {
190
- return this.nodes.reduce((names, n) => addNames(names, n.names), {});
191
- }
192
- }
193
- class BlockNode extends ParentNode {
194
- render(opts) {
195
- return "{" + opts._n + super.render(opts) + "}" + opts._n;
196
- }
197
- }
198
- class Root extends ParentNode {
199
- }
200
- class Else extends BlockNode {
201
- }
202
- Else.kind = "else";
203
- class If extends BlockNode {
204
- constructor(condition, nodes) {
205
- super(nodes);
206
- this.condition = condition;
207
- }
208
- render(opts) {
209
- let code = `if(${this.condition})` + super.render(opts);
210
- if (this.else)
211
- code += "else " + this.else.render(opts);
212
- return code;
213
- }
214
- optimizeNodes() {
215
- super.optimizeNodes();
216
- const cond = this.condition;
217
- if (cond === true)
218
- return this.nodes; // else is ignored here
219
- let e = this.else;
220
- if (e) {
221
- const ns = e.optimizeNodes();
222
- e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
223
- }
224
- if (e) {
225
- if (cond === false)
226
- return e instanceof If ? e : e.nodes;
227
- if (this.nodes.length)
228
- return this;
229
- return new If(not(cond), e instanceof If ? [e] : e.nodes);
230
- }
231
- if (cond === false || !this.nodes.length)
232
- return undefined;
233
- return this;
234
- }
235
- optimizeNames(names, constants) {
236
- var _a;
237
- this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
238
- if (!(super.optimizeNames(names, constants) || this.else))
239
- return;
240
- this.condition = optimizeExpr(this.condition, names, constants);
241
- return this;
242
- }
243
- get names() {
244
- const names = super.names;
245
- addExprNames(names, this.condition);
246
- if (this.else)
247
- addNames(names, this.else.names);
248
- return names;
249
- }
250
- }
251
- If.kind = "if";
252
- class For extends BlockNode {
253
- }
254
- For.kind = "for";
255
- class ForLoop extends For {
256
- constructor(iteration) {
257
- super();
258
- this.iteration = iteration;
259
- }
260
- render(opts) {
261
- return `for(${this.iteration})` + super.render(opts);
262
- }
263
- optimizeNames(names, constants) {
264
- if (!super.optimizeNames(names, constants))
265
- return;
266
- this.iteration = optimizeExpr(this.iteration, names, constants);
267
- return this;
268
- }
269
- get names() {
270
- return addNames(super.names, this.iteration.names);
271
- }
272
- }
273
- class ForRange extends For {
274
- constructor(varKind, name, from, to) {
275
- super();
276
- this.varKind = varKind;
277
- this.name = name;
278
- this.from = from;
279
- this.to = to;
280
- }
281
- render(opts) {
282
- const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
283
- const { name, from, to } = this;
284
- return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
285
- }
286
- get names() {
287
- const names = addExprNames(super.names, this.from);
288
- return addExprNames(names, this.to);
289
- }
290
- }
291
- class ForIter extends For {
292
- constructor(loop, varKind, name, iterable) {
293
- super();
294
- this.loop = loop;
295
- this.varKind = varKind;
296
- this.name = name;
297
- this.iterable = iterable;
298
- }
299
- render(opts) {
300
- return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
301
- }
302
- optimizeNames(names, constants) {
303
- if (!super.optimizeNames(names, constants))
304
- return;
305
- this.iterable = optimizeExpr(this.iterable, names, constants);
306
- return this;
307
- }
308
- get names() {
309
- return addNames(super.names, this.iterable.names);
310
- }
311
- }
312
- class Func extends BlockNode {
313
- constructor(name, args, async) {
314
- super();
315
- this.name = name;
316
- this.args = args;
317
- this.async = async;
318
- }
319
- render(opts) {
320
- const _async = this.async ? "async " : "";
321
- return `${_async}function ${this.name}(${this.args})` + super.render(opts);
322
- }
323
- }
324
- Func.kind = "func";
325
- class Return extends ParentNode {
326
- render(opts) {
327
- return "return " + super.render(opts);
328
- }
329
- }
330
- Return.kind = "return";
331
- class Try extends BlockNode {
332
- render(opts) {
333
- let code = "try" + super.render(opts);
334
- if (this.catch)
335
- code += this.catch.render(opts);
336
- if (this.finally)
337
- code += this.finally.render(opts);
338
- return code;
339
- }
340
- optimizeNodes() {
341
- var _a, _b;
342
- super.optimizeNodes();
343
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
344
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
345
- return this;
346
- }
347
- optimizeNames(names, constants) {
348
- var _a, _b;
349
- super.optimizeNames(names, constants);
350
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
351
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
352
- return this;
353
- }
354
- get names() {
355
- const names = super.names;
356
- if (this.catch)
357
- addNames(names, this.catch.names);
358
- if (this.finally)
359
- addNames(names, this.finally.names);
360
- return names;
361
- }
362
- }
363
- class Catch extends BlockNode {
364
- constructor(error) {
365
- super();
366
- this.error = error;
367
- }
368
- render(opts) {
369
- return `catch(${this.error})` + super.render(opts);
370
- }
371
- }
372
- Catch.kind = "catch";
373
- class Finally extends BlockNode {
374
- render(opts) {
375
- return "finally" + super.render(opts);
376
- }
377
- }
378
- Finally.kind = "finally";
379
- class CodeGen {
380
- constructor(extScope, opts = {}) {
381
- this._values = {};
382
- this._blockStarts = [];
383
- this._constants = {};
384
- this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
385
- this._extScope = extScope;
386
- this._scope = new scope_1.Scope({ parent: extScope });
387
- this._nodes = [new Root()];
388
- }
389
- toString() {
390
- return this._root.render(this.opts);
391
- }
392
- // returns unique name in the internal scope
393
- name(prefix) {
394
- return this._scope.name(prefix);
395
- }
396
- // reserves unique name in the external scope
397
- scopeName(prefix) {
398
- return this._extScope.name(prefix);
399
- }
400
- // reserves unique name in the external scope and assigns value to it
401
- scopeValue(prefixOrName, value) {
402
- const name = this._extScope.value(prefixOrName, value);
403
- const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());
404
- vs.add(name);
405
- return name;
406
- }
407
- getScopeValue(prefix, keyOrRef) {
408
- return this._extScope.getValue(prefix, keyOrRef);
409
- }
410
- // return code that assigns values in the external scope to the names that are used internally
411
- // (same names that were returned by gen.scopeName or gen.scopeValue)
412
- scopeRefs(scopeName) {
413
- return this._extScope.scopeRefs(scopeName, this._values);
414
- }
415
- scopeCode() {
416
- return this._extScope.scopeCode(this._values);
417
- }
418
- _def(varKind, nameOrPrefix, rhs, constant) {
419
- const name = this._scope.toName(nameOrPrefix);
420
- if (rhs !== undefined && constant)
421
- this._constants[name.str] = rhs;
422
- this._leafNode(new Def(varKind, name, rhs));
423
- return name;
424
- }
425
- // `const` declaration (`var` in es5 mode)
426
- const(nameOrPrefix, rhs, _constant) {
427
- return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
428
- }
429
- // `let` declaration with optional assignment (`var` in es5 mode)
430
- let(nameOrPrefix, rhs, _constant) {
431
- return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
432
- }
433
- // `var` declaration with optional assignment
434
- var(nameOrPrefix, rhs, _constant) {
435
- return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
436
- }
437
- // assignment code
438
- assign(lhs, rhs, sideEffects) {
439
- return this._leafNode(new Assign(lhs, rhs, sideEffects));
440
- }
441
- // `+=` code
442
- add(lhs, rhs) {
443
- return this._leafNode(new AssignOp(lhs, exports$1.operators.ADD, rhs));
444
- }
445
- // appends passed SafeExpr to code or executes Block
446
- code(c) {
447
- if (typeof c == "function")
448
- c();
449
- else if (c !== code_1.nil)
450
- this._leafNode(new AnyCode(c));
451
- return this;
452
- }
453
- // returns code for object literal for the passed argument list of key-value pairs
454
- object(...keyValues) {
455
- const code = ["{"];
456
- for (const [key, value] of keyValues) {
457
- if (code.length > 1)
458
- code.push(",");
459
- code.push(key);
460
- if (key !== value || this.opts.es5) {
461
- code.push(":");
462
- (0, code_1.addCodeArg)(code, value);
463
- }
464
- }
465
- code.push("}");
466
- return new code_1._Code(code);
467
- }
468
- // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
469
- if(condition, thenBody, elseBody) {
470
- this._blockNode(new If(condition));
471
- if (thenBody && elseBody) {
472
- this.code(thenBody).else().code(elseBody).endIf();
473
- }
474
- else if (thenBody) {
475
- this.code(thenBody).endIf();
476
- }
477
- else if (elseBody) {
478
- throw new Error('CodeGen: "else" body without "then" body');
479
- }
480
- return this;
481
- }
482
- // `else if` clause - invalid without `if` or after `else` clauses
483
- elseIf(condition) {
484
- return this._elseNode(new If(condition));
485
- }
486
- // `else` clause - only valid after `if` or `else if` clauses
487
- else() {
488
- return this._elseNode(new Else());
489
- }
490
- // end `if` statement (needed if gen.if was used only with condition)
491
- endIf() {
492
- return this._endBlockNode(If, Else);
493
- }
494
- _for(node, forBody) {
495
- this._blockNode(node);
496
- if (forBody)
497
- this.code(forBody).endFor();
498
- return this;
499
- }
500
- // a generic `for` clause (or statement if `forBody` is passed)
501
- for(iteration, forBody) {
502
- return this._for(new ForLoop(iteration), forBody);
503
- }
504
- // `for` statement for a range of values
505
- forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
506
- const name = this._scope.toName(nameOrPrefix);
507
- return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
508
- }
509
- // `for-of` statement (in es5 mode replace with a normal for loop)
510
- forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
511
- const name = this._scope.toName(nameOrPrefix);
512
- if (this.opts.es5) {
513
- const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
514
- return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => {
515
- this.var(name, (0, code_1._) `${arr}[${i}]`);
516
- forBody(name);
517
- });
518
- }
519
- return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
520
- }
521
- // `for-in` statement.
522
- // With option `ownProperties` replaced with a `for-of` loop for object keys
523
- forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
524
- if (this.opts.ownProperties) {
525
- return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);
526
- }
527
- const name = this._scope.toName(nameOrPrefix);
528
- return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
529
- }
530
- // end `for` loop
531
- endFor() {
532
- return this._endBlockNode(For);
533
- }
534
- // `label` statement
535
- label(label) {
536
- return this._leafNode(new Label(label));
537
- }
538
- // `break` statement
539
- break(label) {
540
- return this._leafNode(new Break(label));
541
- }
542
- // `return` statement
543
- return(value) {
544
- const node = new Return();
545
- this._blockNode(node);
546
- this.code(value);
547
- if (node.nodes.length !== 1)
548
- throw new Error('CodeGen: "return" should have one node');
549
- return this._endBlockNode(Return);
550
- }
551
- // `try` statement
552
- try(tryBody, catchCode, finallyCode) {
553
- if (!catchCode && !finallyCode)
554
- throw new Error('CodeGen: "try" without "catch" and "finally"');
555
- const node = new Try();
556
- this._blockNode(node);
557
- this.code(tryBody);
558
- if (catchCode) {
559
- const error = this.name("e");
560
- this._currNode = node.catch = new Catch(error);
561
- catchCode(error);
562
- }
563
- if (finallyCode) {
564
- this._currNode = node.finally = new Finally();
565
- this.code(finallyCode);
566
- }
567
- return this._endBlockNode(Catch, Finally);
568
- }
569
- // `throw` statement
570
- throw(error) {
571
- return this._leafNode(new Throw(error));
572
- }
573
- // start self-balancing block
574
- block(body, nodeCount) {
575
- this._blockStarts.push(this._nodes.length);
576
- if (body)
577
- this.code(body).endBlock(nodeCount);
578
- return this;
579
- }
580
- // end the current self-balancing block
581
- endBlock(nodeCount) {
582
- const len = this._blockStarts.pop();
583
- if (len === undefined)
584
- throw new Error("CodeGen: not in self-balancing block");
585
- const toClose = this._nodes.length - len;
586
- if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
587
- throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
588
- }
589
- this._nodes.length = len;
590
- return this;
591
- }
592
- // `function` heading (or definition if funcBody is passed)
593
- func(name, args = code_1.nil, async, funcBody) {
594
- this._blockNode(new Func(name, args, async));
595
- if (funcBody)
596
- this.code(funcBody).endFunc();
597
- return this;
598
- }
599
- // end function definition
600
- endFunc() {
601
- return this._endBlockNode(Func);
602
- }
603
- optimize(n = 1) {
604
- while (n-- > 0) {
605
- this._root.optimizeNodes();
606
- this._root.optimizeNames(this._root.names, this._constants);
607
- }
608
- }
609
- _leafNode(node) {
610
- this._currNode.nodes.push(node);
611
- return this;
612
- }
613
- _blockNode(node) {
614
- this._currNode.nodes.push(node);
615
- this._nodes.push(node);
616
- }
617
- _endBlockNode(N1, N2) {
618
- const n = this._currNode;
619
- if (n instanceof N1 || (N2 && n instanceof N2)) {
620
- this._nodes.pop();
621
- return this;
622
- }
623
- throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
624
- }
625
- _elseNode(node) {
626
- const n = this._currNode;
627
- if (!(n instanceof If)) {
628
- throw new Error('CodeGen: "else" without "if"');
629
- }
630
- this._currNode = n.else = node;
631
- return this;
632
- }
633
- get _root() {
634
- return this._nodes[0];
635
- }
636
- get _currNode() {
637
- const ns = this._nodes;
638
- return ns[ns.length - 1];
639
- }
640
- set _currNode(node) {
641
- const ns = this._nodes;
642
- ns[ns.length - 1] = node;
643
- }
644
- }
645
- exports$1.CodeGen = CodeGen;
646
- function addNames(names, from) {
647
- for (const n in from)
648
- names[n] = (names[n] || 0) + (from[n] || 0);
649
- return names;
650
- }
651
- function addExprNames(names, from) {
652
- return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
653
- }
654
- function optimizeExpr(expr, names, constants) {
655
- if (expr instanceof code_1.Name)
656
- return replaceName(expr);
657
- if (!canOptimize(expr))
658
- return expr;
659
- return new code_1._Code(expr._items.reduce((items, c) => {
660
- if (c instanceof code_1.Name)
661
- c = replaceName(c);
662
- if (c instanceof code_1._Code)
663
- items.push(...c._items);
664
- else
665
- items.push(c);
666
- return items;
667
- }, []));
668
- function replaceName(n) {
669
- const c = constants[n.str];
670
- if (c === undefined || names[n.str] !== 1)
671
- return n;
672
- delete names[n.str];
673
- return c;
674
- }
675
- function canOptimize(e) {
676
- return (e instanceof code_1._Code &&
677
- e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));
678
- }
679
- }
680
- function subtractNames(names, from) {
681
- for (const n in from)
682
- names[n] = (names[n] || 0) - (from[n] || 0);
683
- }
684
- function not(x) {
685
- return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`;
686
- }
687
- exports$1.not = not;
688
- const andCode = mappend(exports$1.operators.AND);
689
- // boolean AND (&&) expression with the passed arguments
690
- function and(...args) {
691
- return args.reduce(andCode);
692
- }
693
- exports$1.and = and;
694
- const orCode = mappend(exports$1.operators.OR);
695
- // boolean OR (||) expression with the passed arguments
696
- function or(...args) {
697
- return args.reduce(orCode);
698
- }
699
- exports$1.or = or;
700
- function mappend(op) {
701
- return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);
702
- }
703
- function par(x) {
704
- return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;
705
- }
706
-
707
- } (codegen));
708
- return codegen;
709
- }
710
-
711
- export { requireCodegen as __require };
712
- //# sourceMappingURL=index.js.map