alchemy 2.0.0-beta.37 → 2.0.0-beta.38

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 (633) hide show
  1. package/bin/exec.js +488 -69
  2. package/bin/exec.js.map +1 -1
  3. package/lib/AWS/AutoScaling/LaunchTemplate.d.ts +1 -1
  4. package/lib/AWS/CloudWatch/common.d.ts +1 -1
  5. package/lib/AWS/Credentials.d.ts.map +1 -1
  6. package/lib/AWS/Credentials.js +1 -2
  7. package/lib/AWS/Credentials.js.map +1 -1
  8. package/lib/AWS/DynamoDB/Stream.d.ts.map +1 -1
  9. package/lib/AWS/DynamoDB/Stream.js +1 -1
  10. package/lib/AWS/DynamoDB/Stream.js.map +1 -1
  11. package/lib/AWS/EC2/Instance.d.ts +1 -1
  12. package/lib/AWS/EC2/hosted.d.ts +1 -1
  13. package/lib/AWS/EC2/hosted.d.ts.map +1 -1
  14. package/lib/AWS/EC2/hosted.js +3 -5
  15. package/lib/AWS/EC2/hosted.js.map +1 -1
  16. package/lib/AWS/ECS/Task.d.ts +1 -1
  17. package/lib/AWS/ECS/Task.d.ts.map +1 -1
  18. package/lib/AWS/ECS/Task.js +3 -5
  19. package/lib/AWS/ECS/Task.js.map +1 -1
  20. package/lib/AWS/Endpoint.d.ts.map +1 -1
  21. package/lib/AWS/Endpoint.js +1 -2
  22. package/lib/AWS/Endpoint.js.map +1 -1
  23. package/lib/AWS/Environment.d.ts +2 -2
  24. package/lib/AWS/EventBridge/EventSource.d.ts.map +1 -1
  25. package/lib/AWS/EventBridge/EventSource.js +1 -1
  26. package/lib/AWS/EventBridge/EventSource.js.map +1 -1
  27. package/lib/AWS/Kinesis/StreamEventSource.d.ts.map +1 -1
  28. package/lib/AWS/Kinesis/StreamEventSource.js +1 -1
  29. package/lib/AWS/Kinesis/StreamEventSource.js.map +1 -1
  30. package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
  31. package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
  32. package/lib/AWS/Lambda/Function.d.ts +1 -1
  33. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  34. package/lib/AWS/Lambda/Function.js +7 -11
  35. package/lib/AWS/Lambda/Function.js.map +1 -1
  36. package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
  37. package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
  38. package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
  39. package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
  40. package/lib/AWS/Organizations/common.d.ts +1 -1
  41. package/lib/AWS/Providers.d.ts.map +1 -1
  42. package/lib/AWS/Providers.js +21 -3
  43. package/lib/AWS/Providers.js.map +1 -1
  44. package/lib/AWS/Region.d.ts +1 -1
  45. package/lib/AWS/Region.d.ts.map +1 -1
  46. package/lib/AWS/Region.js +2 -3
  47. package/lib/AWS/Region.js.map +1 -1
  48. package/lib/AWS/S3/Bucket.d.ts.map +1 -1
  49. package/lib/AWS/S3/Bucket.js +5 -2
  50. package/lib/AWS/S3/Bucket.js.map +1 -1
  51. package/lib/AWS/S3/BucketNotifications.d.ts.map +1 -1
  52. package/lib/AWS/S3/BucketNotifications.js +1 -1
  53. package/lib/AWS/S3/BucketNotifications.js.map +1 -1
  54. package/lib/AWS/SNS/TopicEventSource.d.ts.map +1 -1
  55. package/lib/AWS/SNS/TopicEventSource.js +1 -1
  56. package/lib/AWS/SNS/TopicEventSource.js.map +1 -1
  57. package/lib/AWS/SQS/Queue.d.ts.map +1 -1
  58. package/lib/AWS/SQS/Queue.js +23 -5
  59. package/lib/AWS/SQS/Queue.js.map +1 -1
  60. package/lib/Action.d.ts +77 -0
  61. package/lib/Action.d.ts.map +1 -0
  62. package/lib/Action.js +89 -0
  63. package/lib/Action.js.map +1 -0
  64. package/lib/AlchemyContext.d.ts +1 -1
  65. package/lib/Apply.d.ts.map +1 -1
  66. package/lib/Apply.js +222 -3
  67. package/lib/Apply.js.map +1 -1
  68. package/lib/Artifacts.d.ts +1 -1
  69. package/lib/Artifacts.d.ts.map +1 -1
  70. package/lib/Artifacts.js +1 -1
  71. package/lib/Artifacts.js.map +1 -1
  72. package/lib/Auth/AuthProvider.js +1 -1
  73. package/lib/Auth/AuthProvider.js.map +1 -1
  74. package/lib/Auth/Env.d.ts.map +1 -1
  75. package/lib/Auth/Env.js +4 -12
  76. package/lib/Auth/Env.js.map +1 -1
  77. package/lib/Binding.d.ts.map +1 -1
  78. package/lib/Binding.js +5 -5
  79. package/lib/Binding.js.map +1 -1
  80. package/lib/Build/Command.d.ts +1 -1
  81. package/lib/Build/Memo.d.ts +1 -1
  82. package/lib/Bundle/Docker.d.ts +3 -3
  83. package/lib/Bundle/Docker.js +1 -1
  84. package/lib/Bundle/Docker.js.map +1 -1
  85. package/lib/Bundle/TempRoot.d.ts +3 -3
  86. package/lib/Cli/Event.d.ts +1 -1
  87. package/lib/Cli/Event.d.ts.map +1 -1
  88. package/lib/Cli/NamespaceTree.d.ts +11 -5
  89. package/lib/Cli/NamespaceTree.d.ts.map +1 -1
  90. package/lib/Cli/NamespaceTree.js +28 -1
  91. package/lib/Cli/NamespaceTree.js.map +1 -1
  92. package/lib/Cli/commands/_shared.d.ts +1 -1
  93. package/lib/Cli/commands/_shared.js +2 -2
  94. package/lib/Cli/commands/_shared.js.map +1 -1
  95. package/lib/Cli/commands/aws.d.ts +1 -1
  96. package/lib/Cli/commands/cloudflare.d.ts +2 -2
  97. package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
  98. package/lib/Cli/commands/deploy.d.ts +9 -9
  99. package/lib/Cli/commands/deploy.js +1 -1
  100. package/lib/Cli/commands/deploy.js.map +1 -1
  101. package/lib/Cli/commands/login.d.ts +1 -1
  102. package/lib/Cli/commands/logs.d.ts +1 -1
  103. package/lib/Cli/commands/logs.js.map +1 -1
  104. package/lib/Cli/commands/profile.d.ts +1 -3
  105. package/lib/Cli/commands/profile.d.ts.map +1 -1
  106. package/lib/Cli/commands/state.d.ts +1 -1
  107. package/lib/Cli/commands/state.d.ts.map +1 -1
  108. package/lib/Cli/commands/tail.d.ts +1 -1
  109. package/lib/Cli/commands/tail.js.map +1 -1
  110. package/lib/Cli/tui/components/Plan.d.ts.map +1 -1
  111. package/lib/Cli/tui/components/Plan.js +27 -13
  112. package/lib/Cli/tui/components/Plan.js.map +1 -1
  113. package/lib/Cli/tui/components/PlanProgress.d.ts +8 -1
  114. package/lib/Cli/tui/components/PlanProgress.d.ts.map +1 -1
  115. package/lib/Cli/tui/components/PlanProgress.js +95 -16
  116. package/lib/Cli/tui/components/PlanProgress.js.map +1 -1
  117. package/lib/Cloudflare/Access.js +0 -1
  118. package/lib/Cloudflare/Access.js.map +1 -1
  119. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +1 -1
  120. package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
  121. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +1 -1
  122. package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
  123. package/lib/Cloudflare/CloudflareEnvironment.d.ts +1 -1
  124. package/lib/Cloudflare/Container/Container.js +0 -1
  125. package/lib/Cloudflare/Container/Container.js.map +1 -1
  126. package/lib/Cloudflare/Container/ContainerApplication.d.ts +1 -1
  127. package/lib/Cloudflare/Container/ContainerApplication.d.ts.map +1 -1
  128. package/lib/Cloudflare/Container/ContainerApplication.js +4 -6
  129. package/lib/Cloudflare/Container/ContainerApplication.js.map +1 -1
  130. package/lib/Cloudflare/Container/ContainerBinding.js +2 -2
  131. package/lib/Cloudflare/Container/ContainerBinding.js.map +1 -1
  132. package/lib/Cloudflare/D1/D1Database.d.ts +1 -1
  133. package/lib/Cloudflare/D1/D1SqlFile.d.ts +2 -2
  134. package/lib/Cloudflare/Email/EmailAddress.d.ts +45 -0
  135. package/lib/Cloudflare/Email/EmailAddress.d.ts.map +1 -0
  136. package/lib/Cloudflare/Email/EmailAddress.js +99 -0
  137. package/lib/Cloudflare/Email/EmailAddress.js.map +1 -0
  138. package/lib/Cloudflare/Email/EmailRouting.d.ts +42 -0
  139. package/lib/Cloudflare/Email/EmailRouting.d.ts.map +1 -0
  140. package/lib/Cloudflare/Email/EmailRouting.js +89 -0
  141. package/lib/Cloudflare/Email/EmailRouting.js.map +1 -0
  142. package/lib/Cloudflare/Email/EmailRule.d.ts +80 -0
  143. package/lib/Cloudflare/Email/EmailRule.d.ts.map +1 -0
  144. package/lib/Cloudflare/Email/EmailRule.js +110 -0
  145. package/lib/Cloudflare/Email/EmailRule.js.map +1 -0
  146. package/lib/Cloudflare/Email/SendEmail.d.ts +74 -0
  147. package/lib/Cloudflare/Email/SendEmail.d.ts.map +1 -0
  148. package/lib/Cloudflare/Email/SendEmail.js +19 -0
  149. package/lib/Cloudflare/Email/SendEmail.js.map +1 -0
  150. package/lib/Cloudflare/Email/SendEmailBinding.d.ts +64 -0
  151. package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -0
  152. package/lib/Cloudflare/Email/SendEmailBinding.js +54 -0
  153. package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -0
  154. package/lib/Cloudflare/Email/index.d.ts +6 -0
  155. package/lib/Cloudflare/Email/index.d.ts.map +1 -0
  156. package/lib/Cloudflare/Email/index.js +6 -0
  157. package/lib/Cloudflare/Email/index.js.map +1 -0
  158. package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -1
  159. package/lib/Cloudflare/Images/ImagesBinding.js +1 -1
  160. package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
  161. package/lib/Cloudflare/KV/KVNamespaceBinding.js +1 -1
  162. package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
  163. package/lib/Cloudflare/Local/Sidecar.d.ts +1 -1
  164. package/lib/Cloudflare/Local/SidecarHandlers.d.ts +1 -1
  165. package/lib/Cloudflare/Local/SidecarServer.js +1 -1
  166. package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
  167. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  168. package/lib/Cloudflare/Providers.js +6 -1
  169. package/lib/Cloudflare/Providers.js.map +1 -1
  170. package/lib/Cloudflare/Queue/QueueBinding.js +1 -1
  171. package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
  172. package/lib/Cloudflare/R2/R2BucketBinding.js +1 -1
  173. package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
  174. package/lib/Cloudflare/SecretsStore/SecretBinding.js +1 -1
  175. package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
  176. package/lib/Cloudflare/StateStore/Api.d.ts +1 -1
  177. package/lib/Cloudflare/StateStore/State.d.ts +2 -2
  178. package/lib/Cloudflare/Workers/Assets.d.ts +2 -2
  179. package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
  180. package/lib/Cloudflare/Workers/Assets.js +5 -4
  181. package/lib/Cloudflare/Workers/Assets.js.map +1 -1
  182. package/lib/Cloudflare/Workers/Worker.d.ts +2 -2
  183. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  184. package/lib/Cloudflare/Workers/Worker.js +15 -4
  185. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  186. package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -1
  187. package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
  188. package/lib/Cloudflare/Workers/WorkerBundle.js +4 -6
  189. package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
  190. package/lib/Cloudflare/Workers/WorkerName.d.ts +1 -1
  191. package/lib/Cloudflare/Workers/Workflow.js +2 -2
  192. package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
  193. package/lib/Cloudflare/index.d.ts +1 -0
  194. package/lib/Cloudflare/index.d.ts.map +1 -1
  195. package/lib/Cloudflare/index.js +1 -0
  196. package/lib/Cloudflare/index.js.map +1 -1
  197. package/lib/Construct.d.ts +3 -3
  198. package/lib/Construct.d.ts.map +1 -1
  199. package/lib/Construct.js.map +1 -1
  200. package/lib/Deploy.d.ts +1 -1
  201. package/lib/Destroy.d.ts +1 -1
  202. package/lib/Destroy.d.ts.map +1 -1
  203. package/lib/Destroy.js +1 -0
  204. package/lib/Destroy.js.map +1 -1
  205. package/lib/Drizzle/Providers.d.ts +1 -1
  206. package/lib/Drizzle/Schema.d.ts +1 -1
  207. package/lib/GitHub/Providers.d.ts +1 -1
  208. package/lib/Http.d.ts +1 -1
  209. package/lib/Http.d.ts.map +1 -1
  210. package/lib/Http.js +1 -1
  211. package/lib/Http.js.map +1 -1
  212. package/lib/Namespace.d.ts.map +1 -1
  213. package/lib/Namespace.js +3 -4
  214. package/lib/Namespace.js.map +1 -1
  215. package/lib/Neon/Branch.d.ts +2 -2
  216. package/lib/Neon/Branch.d.ts.map +1 -1
  217. package/lib/Neon/Branch.js +59 -27
  218. package/lib/Neon/Branch.js.map +1 -1
  219. package/lib/Neon/Credentials.d.ts +2 -2
  220. package/lib/Neon/Credentials.d.ts.map +1 -1
  221. package/lib/Neon/Credentials.js +2 -2
  222. package/lib/Neon/Credentials.js.map +1 -1
  223. package/lib/Neon/NeonEnvironment.d.ts +1 -1
  224. package/lib/Neon/Project.d.ts +25 -1
  225. package/lib/Neon/Project.d.ts.map +1 -1
  226. package/lib/Neon/Project.js +121 -42
  227. package/lib/Neon/Project.js.map +1 -1
  228. package/lib/Neon/Providers.d.ts +1 -1
  229. package/lib/Neon/SqlFile.d.ts +2 -2
  230. package/lib/Output.d.ts +3 -4
  231. package/lib/Output.d.ts.map +1 -1
  232. package/lib/Output.js +7 -4
  233. package/lib/Output.js.map +1 -1
  234. package/lib/PhysicalName.d.ts +1 -1
  235. package/lib/Plan.d.ts +36 -1
  236. package/lib/Plan.d.ts.map +1 -1
  237. package/lib/Plan.js +197 -31
  238. package/lib/Plan.js.map +1 -1
  239. package/lib/Platform.js +6 -6
  240. package/lib/Platform.js.map +1 -1
  241. package/lib/Provider.d.ts +1 -1
  242. package/lib/Provider.d.ts.map +1 -1
  243. package/lib/Provider.js +1 -1
  244. package/lib/Provider.js.map +1 -1
  245. package/lib/Random.d.ts +1 -1
  246. package/lib/Random.d.ts.map +1 -1
  247. package/lib/Random.js +1 -1
  248. package/lib/Random.js.map +1 -1
  249. package/lib/Resource.d.ts.map +1 -1
  250. package/lib/Resource.js +2 -25
  251. package/lib/Resource.js.map +1 -1
  252. package/lib/Runtime.d.ts +24 -0
  253. package/lib/Runtime.d.ts.map +1 -0
  254. package/lib/Runtime.js +31 -0
  255. package/lib/Runtime.js.map +1 -0
  256. package/lib/Secret.js +1 -1
  257. package/lib/Secret.js.map +1 -1
  258. package/lib/Sidecar/RpcClient.d.ts +1 -1
  259. package/lib/Sidecar/RpcPaths.d.ts +1 -1
  260. package/lib/Sidecar/RpcServer.d.ts +1 -1
  261. package/lib/Sidecar/RpcServices.d.ts +1 -1
  262. package/lib/Stack.d.ts +7 -2
  263. package/lib/Stack.d.ts.map +1 -1
  264. package/lib/Stack.js +4 -4
  265. package/lib/Stack.js.map +1 -1
  266. package/lib/State/ActionState.d.ts +48 -0
  267. package/lib/State/ActionState.d.ts.map +1 -0
  268. package/lib/State/ActionState.js +1 -0
  269. package/lib/State/ActionState.js.map +1 -0
  270. package/lib/State/HttpStateStore.d.ts.map +1 -1
  271. package/lib/State/HttpStateStore.js +1 -1
  272. package/lib/State/HttpStateStore.js.map +1 -1
  273. package/lib/State/InMemoryState.d.ts.map +1 -1
  274. package/lib/State/InMemoryState.js.map +1 -1
  275. package/lib/State/LocalState.d.ts +2 -2
  276. package/lib/State/ResourceState.d.ts +5 -0
  277. package/lib/State/ResourceState.d.ts.map +1 -1
  278. package/lib/State/State.d.ts +10 -2
  279. package/lib/State/State.d.ts.map +1 -1
  280. package/lib/State/State.js +2 -0
  281. package/lib/State/State.js.map +1 -1
  282. package/lib/State/index.d.ts +1 -0
  283. package/lib/State/index.d.ts.map +1 -1
  284. package/lib/State/index.js +1 -0
  285. package/lib/State/index.js.map +1 -1
  286. package/lib/Test/Core.d.ts +2 -2
  287. package/lib/Test/Core.d.ts.map +1 -1
  288. package/lib/Test/Core.js +4 -1
  289. package/lib/Test/Core.js.map +1 -1
  290. package/lib/Util/FileLogger.d.ts +1 -1
  291. package/lib/Util/effect.js +4 -4
  292. package/lib/Util/effect.js.map +1 -1
  293. package/lib/Util/exec.d.ts.map +1 -0
  294. package/lib/Util/exec.js.map +1 -0
  295. package/lib/Util/hash.d.ts +8 -0
  296. package/lib/Util/hash.d.ts.map +1 -0
  297. package/lib/Util/hash.js +11 -0
  298. package/lib/Util/hash.js.map +1 -0
  299. package/lib/Util/ignore.d.ts +40 -0
  300. package/lib/Util/ignore.d.ts.map +1 -0
  301. package/lib/Util/ignore.js +591 -0
  302. package/lib/Util/ignore.js.map +1 -0
  303. package/lib/index.d.ts +1 -0
  304. package/lib/index.d.ts.map +1 -1
  305. package/lib/index.js +1 -0
  306. package/lib/index.js.map +1 -1
  307. package/lib/tsconfig.test.tsbuildinfo +1 -1
  308. package/package.json +22 -28
  309. package/src/AWS/Credentials.ts +1 -2
  310. package/src/AWS/DynamoDB/Stream.ts +1 -4
  311. package/src/AWS/EC2/hosted.ts +14 -16
  312. package/src/AWS/ECS/Task.ts +14 -16
  313. package/src/AWS/Endpoint.ts +2 -5
  314. package/src/AWS/EventBridge/EventSource.ts +1 -4
  315. package/src/AWS/Kinesis/StreamEventSource.ts +1 -4
  316. package/src/AWS/Lambda/Function.ts +31 -35
  317. package/src/AWS/Providers.ts +22 -3
  318. package/src/AWS/Region.ts +2 -3
  319. package/src/AWS/S3/Bucket.ts +7 -2
  320. package/src/AWS/S3/BucketNotifications.ts +1 -4
  321. package/src/AWS/SNS/TopicEventSource.ts +1 -4
  322. package/src/AWS/SQS/Queue.ts +40 -6
  323. package/src/Action.ts +280 -0
  324. package/src/Apply.ts +351 -23
  325. package/src/Artifacts.ts +2 -4
  326. package/src/Auth/AuthProvider.ts +1 -1
  327. package/src/Auth/Env.ts +12 -20
  328. package/src/Binding.ts +5 -9
  329. package/src/Bundle/Docker.ts +1 -1
  330. package/src/Cli/Event.ts +4 -0
  331. package/src/Cli/NamespaceTree.ts +52 -5
  332. package/src/Cli/commands/_shared.ts +2 -2
  333. package/src/Cli/commands/deploy.ts +1 -1
  334. package/src/Cli/commands/logs.ts +4 -4
  335. package/src/Cli/commands/tail.ts +4 -4
  336. package/src/Cli/tui/components/Plan.tsx +65 -17
  337. package/src/Cli/tui/components/PlanProgress.tsx +142 -32
  338. package/src/Cloudflare/Access.ts +1 -1
  339. package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +1 -1
  340. package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +1 -1
  341. package/src/Cloudflare/Container/Container.ts +1 -1
  342. package/src/Cloudflare/Container/ContainerApplication.ts +4 -6
  343. package/src/Cloudflare/Container/ContainerBinding.ts +2 -2
  344. package/src/Cloudflare/Email/EmailAddress.ts +155 -0
  345. package/src/Cloudflare/Email/EmailRouting.ts +138 -0
  346. package/src/Cloudflare/Email/EmailRule.ts +210 -0
  347. package/src/Cloudflare/Email/SendEmail.ts +95 -0
  348. package/src/Cloudflare/Email/SendEmailBinding.ts +124 -0
  349. package/src/Cloudflare/Email/index.ts +5 -0
  350. package/src/Cloudflare/Images/ImagesBinding.ts +1 -1
  351. package/src/Cloudflare/KV/KVNamespaceBinding.ts +1 -1
  352. package/src/Cloudflare/Local/SidecarServer.ts +1 -1
  353. package/src/Cloudflare/Providers.ts +9 -0
  354. package/src/Cloudflare/Queue/QueueBinding.ts +1 -1
  355. package/src/Cloudflare/R2/R2BucketBinding.ts +1 -1
  356. package/src/Cloudflare/SecretsStore/SecretBinding.ts +1 -1
  357. package/src/Cloudflare/Workers/Assets.ts +5 -6
  358. package/src/Cloudflare/Workers/Worker.ts +19 -4
  359. package/src/Cloudflare/Workers/WorkerBundle.ts +4 -6
  360. package/src/Cloudflare/Workers/Workflow.ts +2 -2
  361. package/src/Cloudflare/index.ts +1 -0
  362. package/src/Construct.ts +3 -7
  363. package/src/Destroy.ts +1 -0
  364. package/src/Http.ts +1 -1
  365. package/src/Namespace.ts +4 -4
  366. package/src/Neon/Branch.ts +93 -59
  367. package/src/Neon/Credentials.ts +2 -2
  368. package/src/Neon/Project.ts +193 -64
  369. package/src/Output.ts +9 -7
  370. package/src/Plan.ts +303 -53
  371. package/src/Platform.ts +7 -7
  372. package/src/Provider.ts +8 -3
  373. package/src/Random.ts +1 -1
  374. package/src/Resource.ts +2 -25
  375. package/src/Runtime.ts +38 -0
  376. package/src/Secret.ts +1 -1
  377. package/src/Stack.ts +10 -6
  378. package/src/State/ActionState.ts +51 -0
  379. package/src/State/HttpStateStore.ts +6 -2
  380. package/src/State/InMemoryState.ts +3 -3
  381. package/src/State/ResourceState.ts +5 -0
  382. package/src/State/State.ts +17 -2
  383. package/src/State/index.ts +1 -0
  384. package/src/Test/Core.ts +4 -3
  385. package/src/Util/effect.ts +4 -4
  386. package/src/Util/hash.ts +14 -0
  387. package/src/Util/ignore.ts +815 -0
  388. package/src/index.ts +6 -0
  389. package/lib/Agent/Agent.d.ts +0 -9
  390. package/lib/Agent/Agent.d.ts.map +0 -1
  391. package/lib/Agent/Agent.js +0 -10
  392. package/lib/Agent/Agent.js.map +0 -1
  393. package/lib/Agent/Aspect.d.ts +0 -51
  394. package/lib/Agent/Aspect.d.ts.map +0 -1
  395. package/lib/Agent/Aspect.js +0 -45
  396. package/lib/Agent/Aspect.js.map +0 -1
  397. package/lib/Agent/AspectGraph.d.ts +0 -45
  398. package/lib/Agent/AspectGraph.d.ts.map +0 -1
  399. package/lib/Agent/AspectGraph.js +0 -39
  400. package/lib/Agent/AspectGraph.js.map +0 -1
  401. package/lib/Agent/ContextPlugin.d.ts +0 -8
  402. package/lib/Agent/ContextPlugin.d.ts.map +0 -1
  403. package/lib/Agent/ContextPlugin.js +0 -3
  404. package/lib/Agent/ContextPlugin.js.map +0 -1
  405. package/lib/Agent/Plugin.d.ts +0 -18
  406. package/lib/Agent/Plugin.d.ts.map +0 -1
  407. package/lib/Agent/Plugin.js +0 -8
  408. package/lib/Agent/Plugin.js.map +0 -1
  409. package/lib/Agent/chat/channel.d.ts +0 -9
  410. package/lib/Agent/chat/channel.d.ts.map +0 -1
  411. package/lib/Agent/chat/channel.js +0 -10
  412. package/lib/Agent/chat/channel.js.map +0 -1
  413. package/lib/Agent/chat/event.d.ts +0 -32
  414. package/lib/Agent/chat/event.d.ts.map +0 -1
  415. package/lib/Agent/chat/event.js +0 -32
  416. package/lib/Agent/chat/event.js.map +0 -1
  417. package/lib/Agent/chat/message.d.ts +0 -22
  418. package/lib/Agent/chat/message.d.ts.map +0 -1
  419. package/lib/Agent/chat/message.js +0 -31
  420. package/lib/Agent/chat/message.js.map +0 -1
  421. package/lib/Agent/chat/service.d.ts +0 -102
  422. package/lib/Agent/chat/service.d.ts.map +0 -1
  423. package/lib/Agent/chat/service.js +0 -79
  424. package/lib/Agent/chat/service.js.map +0 -1
  425. package/lib/Agent/chat/thread.d.ts +0 -13
  426. package/lib/Agent/chat/thread.d.ts.map +0 -1
  427. package/lib/Agent/chat/thread.js +0 -16
  428. package/lib/Agent/chat/thread.js.map +0 -1
  429. package/lib/Agent/coding/bash.d.ts +0 -36
  430. package/lib/Agent/coding/bash.d.ts.map +0 -1
  431. package/lib/Agent/coding/bash.js +0 -170
  432. package/lib/Agent/coding/bash.js.map +0 -1
  433. package/lib/Agent/coding/edit.d.ts +0 -31
  434. package/lib/Agent/coding/edit.d.ts.map +0 -1
  435. package/lib/Agent/coding/edit.js +0 -90
  436. package/lib/Agent/coding/edit.js.map +0 -1
  437. package/lib/Agent/coding/glob.d.ts +0 -23
  438. package/lib/Agent/coding/glob.d.ts.map +0 -1
  439. package/lib/Agent/coding/glob.js +0 -78
  440. package/lib/Agent/coding/glob.js.map +0 -1
  441. package/lib/Agent/coding/grep.d.ts +0 -26
  442. package/lib/Agent/coding/grep.d.ts.map +0 -1
  443. package/lib/Agent/coding/grep.js +0 -105
  444. package/lib/Agent/coding/grep.js.map +0 -1
  445. package/lib/Agent/coding/index.d.ts +0 -8
  446. package/lib/Agent/coding/index.d.ts.map +0 -1
  447. package/lib/Agent/coding/index.js +0 -8
  448. package/lib/Agent/coding/index.js.map +0 -1
  449. package/lib/Agent/coding/read.d.ts +0 -27
  450. package/lib/Agent/coding/read.d.ts.map +0 -1
  451. package/lib/Agent/coding/read.js +0 -89
  452. package/lib/Agent/coding/read.js.map +0 -1
  453. package/lib/Agent/coding/readlints.d.ts +0 -19
  454. package/lib/Agent/coding/readlints.d.ts.map +0 -1
  455. package/lib/Agent/coding/readlints.js +0 -53
  456. package/lib/Agent/coding/readlints.js.map +0 -1
  457. package/lib/Agent/coding/write.d.ts +0 -22
  458. package/lib/Agent/coding/write.d.ts.map +0 -1
  459. package/lib/Agent/coding/write.js +0 -53
  460. package/lib/Agent/coding/write.js.map +0 -1
  461. package/lib/Agent/fs/file.d.ts +0 -12
  462. package/lib/Agent/fs/file.d.ts.map +0 -1
  463. package/lib/Agent/fs/file.js +0 -8
  464. package/lib/Agent/fs/file.js.map +0 -1
  465. package/lib/Agent/fs/folder.d.ts +0 -5
  466. package/lib/Agent/fs/folder.d.ts.map +0 -1
  467. package/lib/Agent/fs/folder.js +0 -3
  468. package/lib/Agent/fs/folder.js.map +0 -1
  469. package/lib/Agent/index.d.ts +0 -9
  470. package/lib/Agent/index.d.ts.map +0 -1
  471. package/lib/Agent/index.js +0 -9
  472. package/lib/Agent/index.js.map +0 -1
  473. package/lib/Agent/llm/error.d.ts +0 -208
  474. package/lib/Agent/llm/error.d.ts.map +0 -1
  475. package/lib/Agent/llm/error.js +0 -209
  476. package/lib/Agent/llm/error.js.map +0 -1
  477. package/lib/Agent/llm/index.d.ts +0 -5
  478. package/lib/Agent/llm/index.d.ts.map +0 -1
  479. package/lib/Agent/llm/index.js +0 -5
  480. package/lib/Agent/llm/index.js.map +0 -1
  481. package/lib/Agent/llm/llm.d.ts +0 -32
  482. package/lib/Agent/llm/llm.d.ts.map +0 -1
  483. package/lib/Agent/llm/llm.js +0 -74
  484. package/lib/Agent/llm/llm.js.map +0 -1
  485. package/lib/Agent/llm/stream-collectors.d.ts +0 -46
  486. package/lib/Agent/llm/stream-collectors.d.ts.map +0 -1
  487. package/lib/Agent/llm/stream-collectors.js +0 -33
  488. package/lib/Agent/llm/stream-collectors.js.map +0 -1
  489. package/lib/Agent/llm/stream-text-part.d.ts +0 -5
  490. package/lib/Agent/llm/stream-text-part.d.ts.map +0 -1
  491. package/lib/Agent/llm/stream-text-part.js +0 -4
  492. package/lib/Agent/llm/stream-text-part.js.map +0 -1
  493. package/lib/Agent/lsp/client.d.ts +0 -122
  494. package/lib/Agent/lsp/client.d.ts.map +0 -1
  495. package/lib/Agent/lsp/client.js +0 -180
  496. package/lib/Agent/lsp/client.js.map +0 -1
  497. package/lib/Agent/lsp/diagnostics.d.ts +0 -16
  498. package/lib/Agent/lsp/diagnostics.d.ts.map +0 -1
  499. package/lib/Agent/lsp/diagnostics.js +0 -48
  500. package/lib/Agent/lsp/diagnostics.js.map +0 -1
  501. package/lib/Agent/lsp/jsonrpc.d.ts +0 -90
  502. package/lib/Agent/lsp/jsonrpc.d.ts.map +0 -1
  503. package/lib/Agent/lsp/jsonrpc.js +0 -178
  504. package/lib/Agent/lsp/jsonrpc.js.map +0 -1
  505. package/lib/Agent/lsp/manager.d.ts +0 -38
  506. package/lib/Agent/lsp/manager.d.ts.map +0 -1
  507. package/lib/Agent/lsp/manager.js +0 -98
  508. package/lib/Agent/lsp/manager.js.map +0 -1
  509. package/lib/Agent/lsp/servers.d.ts +0 -28
  510. package/lib/Agent/lsp/servers.d.ts.map +0 -1
  511. package/lib/Agent/lsp/servers.js +0 -21
  512. package/lib/Agent/lsp/servers.js.map +0 -1
  513. package/lib/Agent/process/driver.d.ts +0 -10
  514. package/lib/Agent/process/driver.d.ts.map +0 -1
  515. package/lib/Agent/process/driver.js +0 -153
  516. package/lib/Agent/process/driver.js.map +0 -1
  517. package/lib/Agent/process/issue-service.d.ts +0 -44
  518. package/lib/Agent/process/issue-service.d.ts.map +0 -1
  519. package/lib/Agent/process/issue-service.js +0 -28
  520. package/lib/Agent/process/issue-service.js.map +0 -1
  521. package/lib/Agent/process/issue-tools.d.ts +0 -28
  522. package/lib/Agent/process/issue-tools.d.ts.map +0 -1
  523. package/lib/Agent/process/issue-tools.js +0 -28
  524. package/lib/Agent/process/issue-tools.js.map +0 -1
  525. package/lib/Agent/process/issue.d.ts +0 -16
  526. package/lib/Agent/process/issue.d.ts.map +0 -1
  527. package/lib/Agent/process/issue.js +0 -17
  528. package/lib/Agent/process/issue.js.map +0 -1
  529. package/lib/Agent/process/organization.d.ts +0 -4
  530. package/lib/Agent/process/organization.d.ts.map +0 -1
  531. package/lib/Agent/process/organization.js +0 -3
  532. package/lib/Agent/process/organization.js.map +0 -1
  533. package/lib/Agent/process/process.d.ts +0 -5
  534. package/lib/Agent/process/process.d.ts.map +0 -1
  535. package/lib/Agent/process/process.js +0 -3
  536. package/lib/Agent/process/process.js.map +0 -1
  537. package/lib/Agent/process/reply.d.ts +0 -16
  538. package/lib/Agent/process/reply.d.ts.map +0 -1
  539. package/lib/Agent/process/reply.js +0 -18
  540. package/lib/Agent/process/reply.js.map +0 -1
  541. package/lib/Agent/process/task.d.ts +0 -25
  542. package/lib/Agent/process/task.d.ts.map +0 -1
  543. package/lib/Agent/process/task.js +0 -26
  544. package/lib/Agent/process/task.js.map +0 -1
  545. package/lib/Agent/tool/index.d.ts +0 -4
  546. package/lib/Agent/tool/index.d.ts.map +0 -1
  547. package/lib/Agent/tool/index.js +0 -4
  548. package/lib/Agent/tool/index.js.map +0 -1
  549. package/lib/Agent/tool/parameter.d.ts +0 -12
  550. package/lib/Agent/tool/parameter.d.ts.map +0 -1
  551. package/lib/Agent/tool/parameter.js +0 -6
  552. package/lib/Agent/tool/parameter.js.map +0 -1
  553. package/lib/Agent/tool/result.d.ts +0 -17
  554. package/lib/Agent/tool/result.d.ts.map +0 -1
  555. package/lib/Agent/tool/result.js +0 -6
  556. package/lib/Agent/tool/result.js.map +0 -1
  557. package/lib/Agent/tool/tool.d.ts +0 -32
  558. package/lib/Agent/tool/tool.d.ts.map +0 -1
  559. package/lib/Agent/tool/tool.js +0 -16
  560. package/lib/Agent/tool/tool.js.map +0 -1
  561. package/lib/Agent/util/command-validator.d.ts +0 -12
  562. package/lib/Agent/util/command-validator.d.ts.map +0 -1
  563. package/lib/Agent/util/command-validator.js +0 -74
  564. package/lib/Agent/util/command-validator.js.map +0 -1
  565. package/lib/Agent/util/exec.d.ts.map +0 -1
  566. package/lib/Agent/util/exec.js.map +0 -1
  567. package/lib/Agent/util/parser.d.ts +0 -5
  568. package/lib/Agent/util/parser.d.ts.map +0 -1
  569. package/lib/Agent/util/parser.js +0 -41
  570. package/lib/Agent/util/parser.js.map +0 -1
  571. package/lib/Agent/util/replace.d.ts +0 -38
  572. package/lib/Agent/util/replace.d.ts.map +0 -1
  573. package/lib/Agent/util/replace.js +0 -458
  574. package/lib/Agent/util/replace.js.map +0 -1
  575. package/lib/Agent/util/ripgrep.d.ts +0 -109
  576. package/lib/Agent/util/ripgrep.d.ts.map +0 -1
  577. package/lib/Agent/util/ripgrep.js +0 -221
  578. package/lib/Agent/util/ripgrep.js.map +0 -1
  579. package/lib/Neon/api.d.ts +0 -258
  580. package/lib/Neon/api.d.ts.map +0 -1
  581. package/lib/Neon/api.js +0 -215
  582. package/lib/Neon/api.js.map +0 -1
  583. package/src/Agent/Agent.ts +0 -26
  584. package/src/Agent/Aspect.ts +0 -173
  585. package/src/Agent/AspectGraph.ts +0 -98
  586. package/src/Agent/ContextPlugin.ts +0 -18
  587. package/src/Agent/Plugin.ts +0 -29
  588. package/src/Agent/chat/channel.ts +0 -26
  589. package/src/Agent/chat/event.ts +0 -43
  590. package/src/Agent/chat/message.ts +0 -35
  591. package/src/Agent/chat/service.ts +0 -133
  592. package/src/Agent/chat/thread.ts +0 -17
  593. package/src/Agent/coding/bash.ts +0 -197
  594. package/src/Agent/coding/edit.ts +0 -152
  595. package/src/Agent/coding/glob.ts +0 -96
  596. package/src/Agent/coding/grep.ts +0 -143
  597. package/src/Agent/coding/index.ts +0 -7
  598. package/src/Agent/coding/read.ts +0 -119
  599. package/src/Agent/coding/readlints.ts +0 -78
  600. package/src/Agent/coding/write.ts +0 -79
  601. package/src/Agent/fs/file.ts +0 -22
  602. package/src/Agent/fs/folder.ts +0 -16
  603. package/src/Agent/index.ts +0 -9
  604. package/src/Agent/llm/error.ts +0 -330
  605. package/src/Agent/llm/index.ts +0 -4
  606. package/src/Agent/llm/llm.ts +0 -131
  607. package/src/Agent/llm/stream-collectors.ts +0 -58
  608. package/src/Agent/llm/stream-text-part.ts +0 -7
  609. package/src/Agent/lsp/client.ts +0 -293
  610. package/src/Agent/lsp/diagnostics.ts +0 -64
  611. package/src/Agent/lsp/jsonrpc.ts +0 -317
  612. package/src/Agent/lsp/manager.ts +0 -213
  613. package/src/Agent/lsp/servers.ts +0 -37
  614. package/src/Agent/process/driver.ts +0 -168
  615. package/src/Agent/process/issue-service.ts +0 -48
  616. package/src/Agent/process/issue-tools.ts +0 -33
  617. package/src/Agent/process/issue.ts +0 -22
  618. package/src/Agent/process/organization.ts +0 -16
  619. package/src/Agent/process/process.ts +0 -16
  620. package/src/Agent/process/reply.ts +0 -21
  621. package/src/Agent/process/task.ts +0 -34
  622. package/src/Agent/tool/index.ts +0 -3
  623. package/src/Agent/tool/parameter.ts +0 -35
  624. package/src/Agent/tool/result.ts +0 -51
  625. package/src/Agent/tool/tool.ts +0 -74
  626. package/src/Agent/util/command-validator.ts +0 -98
  627. package/src/Agent/util/parser.ts +0 -39
  628. package/src/Agent/util/replace.ts +0 -559
  629. package/src/Agent/util/ripgrep.ts +0 -256
  630. package/src/Neon/api.ts +0 -579
  631. /package/lib/{Agent/util → Util}/exec.d.ts +0 -0
  632. /package/lib/{Agent/util → Util}/exec.js +0 -0
  633. /package/src/{Agent/util → Util}/exec.ts +0 -0
@@ -1,143 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import * as FileSystem from "effect/FileSystem";
3
- import * as Option from "effect/Option";
4
- import * as S from "effect/Schema";
5
- import { ChildProcess } from "effect/unstable/process";
6
- import { AspectConfig } from "../Aspect.ts";
7
- import { Tool } from "../tool/tool.ts";
8
- import { exec } from "../util/exec.ts";
9
-
10
- const MAX_LINE_LENGTH = 2000;
11
-
12
- class pattern extends Tool.input(
13
- "pattern",
14
- )`The regex pattern to search for in file contents.
15
- Supports full regex syntax (e.g., "log.*Error", "function\\s+\\w+", etc.)` {}
16
-
17
- class path extends Tool.input(
18
- "path",
19
- S.optional(S.String),
20
- )`The directory to search in. Defaults to cwd if not specified.` {}
21
-
22
- class include extends Tool.input(
23
- "include",
24
- S.optional(S.String),
25
- )`File pattern to include in the search (e.g., "*.js", "*.{ts,tsx}")` {}
26
-
27
- class matches extends Tool.output(
28
- "matches",
29
- )`The search results showing file paths and matching lines, sorted by modification time.` {}
30
-
31
- export class grep extends Tool(
32
- "grep",
33
- )`Fast content search tool that works with any codebase size.
34
- Returns ${matches} with file paths and line numbers.
35
-
36
- Given a ${pattern} and optional ${path} and ${include}:
37
- - Searches file contents using regular expressions
38
- - Supports full regex syntax (e.g., "log.*Error", "function\\s+\\w+", etc.)
39
- - Filter files by pattern with the include parameter (e.g., "*.js", "*.{ts,tsx}")
40
- - Returns file paths and line numbers with at least one match sorted by modification time
41
- - Use this tool when you need to find files containing specific patterns
42
- - If you need to identify/count the number of matches within files, use the Bash tool with \`rg\` (ripgrep) directly. Do NOT use \`grep\`.
43
- - When you are doing an open-ended search that may require multiple rounds of globbing and grepping, use the Task tool instead
44
- `(function* ({ pattern, path: searchDir, include }) {
45
- yield* Effect.logDebug(`[grep] pattern=${pattern} path=${searchDir}`);
46
-
47
- const config = yield* Effect.serviceOption(AspectConfig).pipe(
48
- Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
49
- );
50
- const fs = yield* FileSystem.FileSystem;
51
- const searchPath = searchDir || config.cwd;
52
-
53
- const rgArgs = ["-nH", "--field-match-separator=|", "--regexp", pattern];
54
- if (include) {
55
- rgArgs.push("--glob", include);
56
- }
57
- rgArgs.push(searchPath);
58
-
59
- const { stdout, stderr, exitCode } = yield* exec(
60
- ChildProcess.make("rg", rgArgs),
61
- ).pipe(
62
- Effect.catch(() => Effect.succeed({ stdout: "", stderr: "", exitCode: 1 })),
63
- );
64
-
65
- if (exitCode === 1) {
66
- return {
67
- matches: `No matches found for pattern "${pattern}" in ${searchPath}`,
68
- };
69
- } else if (exitCode !== 0) {
70
- return { matches: `ripgrep failed with exit code ${exitCode}: ${stderr}` };
71
- }
72
-
73
- const lines = stdout.split(/\r?\n/);
74
- const matchList: {
75
- path: string;
76
- modTime: number;
77
- lineNum: number;
78
- lineText: string;
79
- }[] = [];
80
-
81
- for (const line of lines) {
82
- if (!line) continue;
83
-
84
- const [filePath, lineNumStr, ...lineTextParts] = line.split("|");
85
- if (!filePath || !lineNumStr || lineTextParts.length === 0) continue;
86
-
87
- const lineNum = parseInt(lineNumStr, 10);
88
- const lineText = lineTextParts.join("|");
89
-
90
- const stats = yield* fs
91
- .stat(filePath)
92
- .pipe(Effect.catch(() => Effect.succeed(null)));
93
- if (!stats) continue;
94
-
95
- const modTime = stats.mtime;
96
- if (!modTime) continue;
97
- matchList.push({
98
- path: filePath,
99
- modTime: modTime.pipe(Option.getOrElse(() => new Date(0))).getTime(),
100
- lineNum,
101
- lineText,
102
- });
103
- }
104
-
105
- matchList.sort((a, b) => b.modTime - a.modTime);
106
-
107
- const limit = 100;
108
- const truncated = matchList.length > limit;
109
- const finalMatches = truncated ? matchList.slice(0, limit) : matchList;
110
-
111
- if (finalMatches.length === 0) {
112
- return {
113
- matches: `No matches found for pattern "${pattern}" in ${searchPath}`,
114
- };
115
- }
116
-
117
- const outputLines = [`Found ${finalMatches.length} matches`];
118
-
119
- let currentFile = "";
120
- for (const match of finalMatches) {
121
- if (currentFile !== match.path) {
122
- if (currentFile !== "") {
123
- outputLines.push("");
124
- }
125
- currentFile = match.path;
126
- outputLines.push(`${match.path}:`);
127
- }
128
- const truncatedLineText =
129
- match.lineText.length > MAX_LINE_LENGTH
130
- ? match.lineText.substring(0, MAX_LINE_LENGTH) + "..."
131
- : match.lineText;
132
- outputLines.push(` Line ${match.lineNum}: ${truncatedLineText}`);
133
- }
134
-
135
- if (truncated) {
136
- outputLines.push("");
137
- outputLines.push(
138
- "(Results are truncated. Consider using a more specific path or pattern.)",
139
- );
140
- }
141
-
142
- return { matches: outputLines.join("\n") };
143
- }) {}
@@ -1,7 +0,0 @@
1
- export * from "./bash.ts";
2
- export * from "./edit.ts";
3
- export * from "./glob.ts";
4
- export * from "./grep.ts";
5
- export * from "./read.ts";
6
- export * from "./readlints.ts";
7
- export * from "./write.ts";
@@ -1,119 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import * as FileSystem from "effect/FileSystem";
3
- import * as Option from "effect/Option";
4
- import * as Path from "effect/Path";
5
- import * as S from "effect/Schema";
6
- import { AspectConfig } from "../Aspect.ts";
7
- import { Tool } from "../tool/tool.ts";
8
-
9
- class filePath extends Tool.input(
10
- "filePath",
11
- )`The path to the file to read. Use relative paths from the current working directory (e.g., "src/index.ts", "test/fixtures/math.ts"). Do NOT use paths starting with "/" - use relative paths instead.` {}
12
-
13
- class offset extends Tool.input(
14
- "offset",
15
- S.optional(S.Number),
16
- )`The line number to start reading from (0-based). Defaults to 0.` {}
17
-
18
- class limit extends Tool.input(
19
- "limit",
20
- S.optional(S.Number),
21
- )`The number of lines to read. Defaults to 2000.` {}
22
-
23
- class content extends Tool.output(
24
- "content",
25
- )`The file content, or an error message if the file cannot be read.` {}
26
-
27
- export class read extends Tool("read")`Reads a file from the local filesystem.
28
- Returns the ${content} of the file.
29
-
30
- Given a ${filePath} and optional ${offset} and ${limit}:
31
- - Use relative paths from the current working directory (e.g., "src/index.ts", "test/fixtures/math.ts")
32
- - Do NOT use paths starting with "/" - use relative paths instead
33
- - By default, it reads up to 2000 lines starting from the beginning of the file
34
- - You can optionally specify a line offset and limit for long files
35
- `(function* ({ filePath: _filePath, offset: _offset, limit: _limit }) {
36
- yield* Effect.logDebug(`[read] filePath=${_filePath}`);
37
-
38
- const config = yield* Effect.serviceOption(AspectConfig).pipe(
39
- Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
40
- );
41
- const fs = yield* FileSystem.FileSystem;
42
- const path = yield* Path.Path;
43
-
44
- const offset = _offset ?? 0;
45
- const limit = _limit ?? 2000;
46
-
47
- if (_filePath.includes(".env")) {
48
- return {
49
- content: "Environment files (.env) are not readable for security reasons",
50
- };
51
- }
52
-
53
- const filePath = path.isAbsolute(_filePath)
54
- ? _filePath
55
- : path.join(config.cwd, _filePath);
56
-
57
- const exists = yield* fs
58
- .exists(filePath)
59
- .pipe(Effect.catch(() => Effect.succeed(false)));
60
-
61
- if (!exists) {
62
- // Try to get suggestions from parent directory
63
- const dir = path.dirname(filePath);
64
- const base = path.basename(filePath);
65
- const dirExists = yield* fs
66
- .exists(dir)
67
- .pipe(Effect.catch(() => Effect.succeed(false)));
68
-
69
- if (dirExists) {
70
- const files = yield* fs
71
- .readDirectory(dir)
72
- .pipe(Effect.catch(() => Effect.succeed([] as string[])));
73
- const suggestions = files
74
- .filter(
75
- (entry) =>
76
- entry.toLowerCase().includes(base.toLowerCase()) ||
77
- base.toLowerCase().includes(entry.toLowerCase()),
78
- )
79
- .map((entry) => path.join(dir, entry))
80
- .slice(0, 3);
81
-
82
- if (suggestions.length > 0) {
83
- return {
84
- content: `File not found: ${filePath}. Did you mean one of these?\n${suggestions.join("\n")}`,
85
- };
86
- }
87
- }
88
- return { content: `File not found: ${filePath}` };
89
- }
90
-
91
- // Check if it's a directory
92
- const stat = yield* fs
93
- .stat(filePath)
94
- .pipe(Effect.catch(() => Effect.succeed(null)));
95
-
96
- if (stat?.type === "Directory") {
97
- const entries = yield* fs
98
- .readDirectory(filePath)
99
- .pipe(Effect.catch(() => Effect.succeed([] as string[])));
100
- return {
101
- content: `Cannot read directory as a file: ${filePath}\nThis is a directory. Contents:\n${entries.slice(0, 10).join("\n")}${entries.length > 10 ? "\n..." : ""}`,
102
- };
103
- }
104
-
105
- const fileContent = yield* fs
106
- .readFileString(filePath)
107
- .pipe(
108
- Effect.catch((e) =>
109
- Effect.succeed(`Failed to read file ${filePath}: ${e}`),
110
- ),
111
- );
112
-
113
- return {
114
- content: fileContent
115
- .split("\n")
116
- .slice(offset, offset + limit)
117
- .join("\n"),
118
- };
119
- }) {}
@@ -1,78 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import * as Option from "effect/Option";
3
- import * as Path from "effect/Path";
4
- import * as S from "effect/Schema";
5
- import { AspectConfig } from "../Aspect.ts";
6
- import { formatDiagnostic } from "../lsp/diagnostics.ts";
7
- import { LSPManager } from "../lsp/manager.ts";
8
- import { Tool } from "../tool/tool.ts";
9
-
10
- export class paths extends Tool.input(
11
- "paths",
12
- S.optional(S.Array(S.String)),
13
- )`Optional array of paths to files or directories to read linter errors for. If not provided, returns diagnostics for all files in the workspace.` {}
14
-
15
- export class diagnostics extends Tool.output(
16
- "diagnostics",
17
- )`The linter errors and diagnostics for the specified paths.` {}
18
-
19
- export class readlints extends Tool(
20
- "readlints",
21
- )`Read and display linter errors from the workspace.
22
- Returns ${diagnostics} for the specified files.
23
-
24
- Given optional ${paths}:
25
- - If a file path is provided, returns diagnostics for that file only
26
- - If a directory path is provided, returns diagnostics for all files within that directory
27
- - If no paths are provided, returns diagnostics for all files in the workspace
28
- - This tool can return linter errors that were already present before your edits, so avoid calling it with a very wide scope of files
29
- - NEVER call this tool on a file unless you've edited it or are about to edit it
30
- `(function* ({ paths: inputPaths }) {
31
- yield* Effect.logDebug(`[readlints] paths=${JSON.stringify(inputPaths)}`);
32
-
33
- const config = yield* Effect.serviceOption(AspectConfig).pipe(
34
- Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
35
- );
36
- const pathService = yield* Path.Path;
37
- const lspManager = yield* LSPManager;
38
-
39
- const resolvedPaths = (inputPaths ?? []).map((p) =>
40
- pathService.isAbsolute(p) ? p : pathService.join(config.cwd, p),
41
- );
42
-
43
- // Get diagnostics for each path
44
- const allDiagnostics = yield* Effect.forEach(
45
- resolvedPaths,
46
- (filePath) =>
47
- lspManager
48
- .getDiagnostics(filePath)
49
- .pipe(Effect.map((diags) => ({ filePath, diags }))),
50
- { concurrency: "unbounded" },
51
- );
52
-
53
- // Format output grouped by file
54
- const results: string[] = [];
55
- for (const { filePath, diags } of allDiagnostics) {
56
- if (diags.length > 0) {
57
- results.push(`${filePath}:`);
58
- for (const d of diags) {
59
- results.push(` ${formatDiagnostic(d)}`);
60
- }
61
- }
62
- }
63
-
64
- yield* Effect.logDebug(
65
- `[readlints] found ${results.length} files with diagnostics`,
66
- );
67
-
68
- if (results.length === 0) {
69
- return {
70
- diagnostics:
71
- resolvedPaths.length > 0
72
- ? `No linter errors found in specified paths`
73
- : `No linter errors found`,
74
- };
75
- }
76
-
77
- return { diagnostics: results.join("\n") };
78
- }) {}
@@ -1,79 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import * as FileSystem from "effect/FileSystem";
3
- import * as Option from "effect/Option";
4
- import * as Path from "effect/Path";
5
- import { AspectConfig } from "../Aspect.ts";
6
- import {
7
- formatDiagnostics,
8
- getDiagnosticsIfAvailable,
9
- } from "../lsp/diagnostics.ts";
10
- import { Tool } from "../tool/tool.ts";
11
-
12
- class filePath extends Tool.input(
13
- "filePath",
14
- )`The path to the file to write. Use relative paths from the current working directory (e.g., "src/index.ts", "test/fixtures/math.test.ts"). Do NOT use paths starting with "/" - use relative paths instead.` {}
15
-
16
- class content extends Tool.input(
17
- "content",
18
- )`The content to write to the file.` {}
19
-
20
- class output extends Tool.output(
21
- "result",
22
- )`The result of the write operation, including any diagnostics from LSP.` {}
23
-
24
- export class write extends Tool("write")`Writes a file to the local filesystem.
25
- Returns the ${output} of the operation.
26
-
27
- Given a ${filePath} and ${content}:
28
- - Use relative paths from the current working directory (e.g., "src/index.ts", "test/fixtures/math.test.ts")
29
- - Do NOT use paths starting with "/" - use relative paths instead
30
- - This tool will overwrite the existing file if there is one at the provided path.
31
- - Parent directories are created automatically if they don't exist.
32
- `(function* ({ filePath: _filePath, content }) {
33
- yield* Effect.logDebug(
34
- `[write] filePath=${_filePath} content.length=${content.length}`,
35
- );
36
-
37
- const config = yield* Effect.serviceOption(AspectConfig).pipe(
38
- Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
39
- );
40
- const path = yield* Path.Path;
41
- const fs = yield* FileSystem.FileSystem;
42
-
43
- const filePath = path.isAbsolute(_filePath)
44
- ? _filePath
45
- : path.join(config.cwd, _filePath);
46
-
47
- // Ensure parent directory exists
48
- const dir = path.dirname(filePath);
49
- yield* fs
50
- .makeDirectory(dir, { recursive: true })
51
- .pipe(Effect.catch(() => Effect.void));
52
-
53
- const writeResult = yield* fs
54
- .writeFileString(filePath, content)
55
- .pipe(
56
- Effect.catch((e) =>
57
- Effect.succeed(`Failed to write file ${filePath}: ${e}`),
58
- ),
59
- );
60
-
61
- if (typeof writeResult === "string") {
62
- yield* Effect.logDebug(`[write] ${writeResult}`);
63
- return { result: writeResult };
64
- }
65
-
66
- // Get diagnostics from LSP servers
67
- const diagnostics = yield* getDiagnosticsIfAvailable(filePath, content);
68
- const formatted = formatDiagnostics(diagnostics);
69
-
70
- yield* Effect.logDebug(
71
- `[write] diagnostics for ${filePath}: ${formatted || "(none)"}`,
72
- );
73
-
74
- return {
75
- result: formatted
76
- ? `Wrote file: ${filePath}\n\n${formatted}`
77
- : `Wrote file: ${filePath}`,
78
- };
79
- }) {}
@@ -1,22 +0,0 @@
1
- import * as S from "effect/Schema";
2
- import { defineAspect, type Aspect } from "../Aspect.ts";
3
-
4
- export interface File<
5
- Name extends string = string,
6
- References extends any[] = any[],
7
- Props extends FileProps = FileProps,
8
- > extends Aspect<File, "file", Name, References, Props> {}
9
-
10
- export class FileProps extends S.Class<FileProps>("FileProps")({
11
- language: S.String,
12
- }) {}
13
-
14
- export const File = defineAspect<
15
- <const Name extends string, const Props extends FileProps>(
16
- name: Name,
17
- props: Props,
18
- ) => <References extends any[]>(
19
- template: TemplateStringsArray,
20
- ...references: References
21
- ) => File<Name, References, Props>
22
- >("file", FileProps);
@@ -1,16 +0,0 @@
1
- import { defineAspect, type Aspect } from "../Aspect.ts";
2
-
3
- export interface Folder<
4
- Name extends string = string,
5
- References extends any[] = any[],
6
- > extends Aspect<Folder, "folder", Name, References> {}
7
-
8
- export const Folder =
9
- defineAspect<
10
- <const Name extends string>(
11
- name: Name,
12
- ) => <References extends any[]>(
13
- template: TemplateStringsArray,
14
- ...references: References
15
- ) => Folder<Name, References>
16
- >("folder");
@@ -1,9 +0,0 @@
1
- export * from "./Agent.ts";
2
- export * from "./Aspect.ts";
3
- export * from "./AspectGraph.ts";
4
- export * from "./process/organization.ts";
5
- export * from "./process/process.ts";
6
- export * from "./tool/index.ts";
7
-
8
- export * as Coding from "./coding/index.ts";
9
- export * as LLM from "./llm/index.ts";