alchemy 2.0.0-beta.2 → 2.0.0-beta.4

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 (77) hide show
  1. package/bin/{alchemy-effect.js → alchemy.js} +171 -171
  2. package/bin/alchemy.js.map +1 -0
  3. package/bin/{alchemy-effect.sh → alchemy.sh} +2 -2
  4. package/lib/cli/index.d.ts.map +1 -1
  5. package/lib/cli/index.js +167 -167
  6. package/lib/cli/index.js.map +1 -1
  7. package/package.json +54 -45
  8. package/src/AWS/AGENTS.md +10 -10
  9. package/src/AWS/Assets.ts +1 -1
  10. package/src/AWS/AuthProvider.ts +392 -0
  11. package/src/AWS/Credentials.ts +0 -1
  12. package/src/AWS/DynamoDB/Table.ts +63 -10
  13. package/src/AWS/EC2/VpcEndpoint.ts +4 -4
  14. package/src/AWS/EC2/hosted.ts +1 -1
  15. package/src/AWS/ECS/Task.ts +1 -1
  16. package/src/AWS/Kinesis/Stream.ts +44 -8
  17. package/src/AWS/Lambda/Function.ts +218 -10
  18. package/src/AWS/S3/Bucket.ts +26 -19
  19. package/src/AWS/S3/BucketNotifications.ts +1 -1
  20. package/src/AWS/SNS/Topic.ts +47 -10
  21. package/src/AWS/SQS/Queue.ts +66 -0
  22. package/src/Auth/AuthProvider.ts +33 -0
  23. package/src/Auth/Credentials.ts +56 -0
  24. package/src/Auth/Env.ts +45 -0
  25. package/src/Auth/Profile.ts +72 -0
  26. package/src/Auth/index.ts +2 -0
  27. package/src/Cloudflare/Auth/AuthProvider.ts +670 -0
  28. package/src/Cloudflare/Auth/OAuthClient.ts +315 -0
  29. package/src/Cloudflare/Container/Container.ts +122 -0
  30. package/src/Cloudflare/Container/ContainerApplication.ts +6 -3
  31. package/src/Cloudflare/Container/ContainerBinding.ts +2 -4
  32. package/src/Cloudflare/Container/StartContainer.ts +1 -1
  33. package/src/Cloudflare/D1/D1Database.ts +23 -4
  34. package/src/Cloudflare/KV/KVNamespace.ts +25 -0
  35. package/src/Cloudflare/Providers.ts +1 -6
  36. package/src/Cloudflare/R2/R2Bucket.ts +45 -2
  37. package/src/Cloudflare/Website/StaticSite.ts +101 -15
  38. package/src/Cloudflare/Website/Vite.ts +86 -20
  39. package/src/Cloudflare/Workers/Assets.ts +170 -207
  40. package/src/Cloudflare/Workers/DurableObjectNamespace.ts +629 -0
  41. package/src/Cloudflare/Workers/DurableObjectState.ts +63 -0
  42. package/src/Cloudflare/Workers/DurableObjectStorage.ts +256 -0
  43. package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +66 -7
  44. package/src/Cloudflare/Workers/InferEnv.ts +11 -7
  45. package/src/Cloudflare/Workers/Rpc.ts +13 -2
  46. package/src/Cloudflare/Workers/ScheduledEvents.ts +185 -0
  47. package/src/Cloudflare/Workers/WebSocket.ts +1 -1
  48. package/src/Cloudflare/Workers/Worker.ts +572 -67
  49. package/src/Cloudflare/Workers/Workflow.ts +53 -11
  50. package/src/Cloudflare/Workers/index.ts +4 -1
  51. package/src/Construct.ts +2 -2
  52. package/src/GitHub/Comment.ts +224 -0
  53. package/src/GitHub/Secret.ts +257 -0
  54. package/src/GitHub/Variable.ts +166 -0
  55. package/src/GitHub/index.ts +3 -0
  56. package/src/Kubernetes/client.ts +2 -2
  57. package/src/Output.ts +1 -1
  58. package/src/Platform.ts +10 -5
  59. package/src/Provider.ts +1 -1
  60. package/src/Resource.ts +4 -4
  61. package/src/Test/Vitest.ts +4 -3
  62. package/src/Util/Clank.ts +77 -0
  63. package/src/Util/PlatformServices.ts +21 -0
  64. package/src/Util/dedent.ts +59 -0
  65. package/src/Util/index.ts +1 -0
  66. package/bin/alchemy-effect.js.map +0 -1
  67. package/src/Cloudflare/Workers/DurableObject.ts +0 -527
  68. package/src/Daemon/Client.ts +0 -116
  69. package/src/Daemon/Config.ts +0 -28
  70. package/src/Daemon/Errors.ts +0 -48
  71. package/src/Daemon/Lock.ts +0 -162
  72. package/src/Daemon/ProcessRegistry.ts +0 -284
  73. package/src/Daemon/RpcSchema.ts +0 -43
  74. package/src/Daemon/RpcServer.ts +0 -231
  75. package/src/Daemon/index.ts +0 -27
  76. package/src/Spawn.ts +0 -23
  77. /package/bin/{alchemy-effect.ts → alchemy.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alchemy",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.4",
4
4
  "homepage": "https://alchemy.run",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Sam Goodwin <sam@alchemy.run>",
@@ -10,8 +10,7 @@
10
10
  "directory": "alchemy"
11
11
  },
12
12
  "bin": {
13
- "alchemy": "bin/alchemy-effect.sh",
14
- "alchemy-effect": "bin/alchemy-effect.sh"
13
+ "alchemy": "bin/alchemy.sh"
15
14
  },
16
15
  "files": [
17
16
  "bin",
@@ -20,165 +19,179 @@
20
19
  ],
21
20
  "type": "module",
22
21
  "sideEffects": false,
22
+ "scripts": {
23
+ "dev": "tsdown --watch",
24
+ "build": "bun bundle && bun pm pack",
25
+ "bundle": "tsdown",
26
+ "bundle:watch": "tsdown --watch",
27
+ "publish:npm": "cp ../README.md . && bun publish && rm README.md",
28
+ "test:benchmark": "tsx --tsconfig tsconfig.test.json test/types.benchmark.ts"
29
+ },
23
30
  "exports": {
24
31
  ".": {
25
- "types": "./src/index.d.ts",
32
+ "types": "./src/index.ts",
26
33
  "bun": "./src/index.ts",
27
34
  "worker": "./src/index.ts",
28
35
  "import": "./lib/index.js"
29
36
  },
30
37
  "./*": {
31
- "types": "./src/*.d.ts",
38
+ "types": "./src/*.ts",
32
39
  "bun": "./src/*.ts",
33
- "worker": "./src/*.ts",
34
- "import": "./lib/*.js"
40
+ "import": "./lib/*.js",
41
+ "worker": "./src/*.ts"
35
42
  },
36
43
  "./Agent": {
37
- "types": "./src/Agent/index.d.ts",
44
+ "types": "./src/Agent/index.ts",
38
45
  "bun": "./src/Agent/index.ts",
39
46
  "worker": "./src/Agent/index.ts",
40
47
  "import": "./lib/Agent/index.js"
41
48
  },
42
49
  "./AWS": {
43
- "types": "./src/AWS/index.d.ts",
50
+ "types": "./src/AWS/index.ts",
44
51
  "bun": "./src/AWS/index.ts",
45
52
  "worker": "./src/AWS/index.ts",
46
53
  "import": "./lib/AWS/index.js"
47
54
  },
48
55
  "./AWS/*": {
49
- "types": "./src/AWS/*/index.d.ts",
56
+ "types": "./src/AWS/*/index.ts",
50
57
  "bun": "./src/AWS/*/index.ts",
51
58
  "worker": "./src/AWS/*/index.ts",
52
59
  "import": "./lib/AWS/*/index.js"
53
60
  },
54
61
  "./AWS/Credentials": {
55
- "types": "./src/AWS/Credentials/index.d.ts",
62
+ "types": "./src/AWS/Credentials/index.ts",
56
63
  "bun": "./src/AWS/Credentials/index.ts",
57
64
  "worker": "./src/AWS/Credentials/index.ts",
58
65
  "import": "./lib/AWS/Credentials/index.js"
59
66
  },
60
67
  "./AWS/Endpoint": {
61
- "types": "./src/AWS/Endpoint/index.d.ts",
68
+ "types": "./src/AWS/Endpoint/index.ts",
62
69
  "bun": "./src/AWS/Endpoint/index.ts",
63
70
  "worker": "./src/AWS/Endpoint/index.ts",
64
71
  "import": "./lib/AWS/Endpoint/index.js"
65
72
  },
66
73
  "./AWS/Region": {
67
- "types": "./src/AWS/Region/index.d.ts",
74
+ "types": "./src/AWS/Region/index.ts",
68
75
  "bun": "./src/AWS/Region/index.ts",
69
76
  "worker": "./src/AWS/Region/index.ts",
70
77
  "import": "./lib/AWS/Region/index.js"
71
78
  },
72
79
  "./AWS/Profile": {
73
- "types": "./src/AWS/Profile/index.d.ts",
80
+ "types": "./src/AWS/Profile/index.ts",
74
81
  "bun": "./src/AWS/Profile/index.ts",
75
82
  "worker": "./src/AWS/Profile/index.ts",
76
83
  "import": "./lib/AWS/Profile/index.js"
77
84
  },
78
85
  "./AWS/Lambda/*": {
79
- "types": "./src/AWS/Lambda/*.d.ts",
86
+ "types": "./src/AWS/Lambda/*.ts",
80
87
  "bun": "./src/AWS/Lambda/*.ts",
81
88
  "worker": "./src/AWS/Lambda/*.ts",
82
89
  "import": "./lib/AWS/Lambda/*.js"
83
90
  },
84
91
  "./Build": {
85
- "types": "./src/Build/index.d.ts",
92
+ "types": "./src/Build/index.ts",
86
93
  "bun": "./src/Build/index.ts",
87
94
  "worker": "./src/Build/index.ts",
88
95
  "import": "./lib/Build/index.js"
89
96
  },
90
97
  "./Construct": {
91
- "types": "./src/Construct/index.d.ts",
98
+ "types": "./src/Construct/index.ts",
92
99
  "bun": "./src/Construct/index.ts",
93
100
  "worker": "./src/Construct/index.ts",
94
101
  "import": "./lib/Construct/index.js"
95
102
  },
96
103
  "./Bundle": {
97
- "types": "./src/Bundle/index.d.ts",
104
+ "types": "./src/Bundle/index.ts",
98
105
  "bun": "./src/Bundle/index.ts",
99
106
  "worker": "./src/Bundle/index.ts",
100
107
  "import": "./lib/Bundle/index.js"
101
108
  },
102
109
  "./ContentType": {
103
- "types": "./src/ContentType.d.ts",
110
+ "types": "./src/ContentType.ts",
104
111
  "bun": "./src/ContentType.ts",
105
112
  "worker": "./src/ContentType.ts",
106
113
  "import": "./lib/ContentType.js"
107
114
  },
108
115
  "./Cloudflare": {
109
- "types": "./src/Cloudflare/index.d.ts",
116
+ "types": "./src/Cloudflare/index.ts",
110
117
  "bun": "./src/Cloudflare/index.ts",
111
118
  "worker": "./src/Cloudflare/index.ts",
112
119
  "import": "./lib/Cloudflare/index.js"
113
120
  },
114
121
  "./Cloudflare/Live": {
115
- "types": "./src/Cloudflare/Live.d.ts",
122
+ "types": "./src/Cloudflare/Live.ts",
116
123
  "bun": "./src/Cloudflare/Live.ts",
117
124
  "worker": "./src/Cloudflare/Live.ts",
118
125
  "import": "./lib/Cloudflare/Live.js"
119
126
  },
120
127
  "./Cloudflare/*": {
121
- "types": "./src/Cloudflare/*/index.d.ts",
128
+ "types": "./src/Cloudflare/*/index.ts",
122
129
  "bun": "./src/Cloudflare/*/index.ts",
123
130
  "worker": "./src/Cloudflare/*/index.ts",
124
131
  "import": "./lib/Cloudflare/*/index.js"
125
132
  },
133
+ "./GitHub": {
134
+ "types": "./src/GitHub/index.ts",
135
+ "bun": "./src/GitHub/index.ts",
136
+ "worker": "./src/GitHub/index.ts",
137
+ "import": "./lib/GitHub/index.js"
138
+ },
126
139
  "./Endpoint": {
127
- "types": "./src/Endpoint/index.d.ts",
140
+ "types": "./src/Endpoint/index.ts",
128
141
  "bun": "./src/Endpoint/index.ts",
129
142
  "worker": "./src/Endpoint/index.ts",
130
143
  "import": "./lib/Endpoint/index.js"
131
144
  },
132
145
  "./Kubernetes": {
133
- "types": "./src/Kubernetes/index.d.ts",
146
+ "types": "./src/Kubernetes/index.ts",
134
147
  "bun": "./src/Kubernetes/index.ts",
135
148
  "worker": "./src/Kubernetes/index.ts",
136
149
  "import": "./lib/Kubernetes/index.js"
137
150
  },
138
151
  "./Output": {
139
- "types": "./src/Output.d.ts",
152
+ "types": "./src/Output.ts",
140
153
  "bun": "./src/Output.ts",
141
154
  "worker": "./src/Output.ts",
142
155
  "import": "./lib/Output.js"
143
156
  },
144
157
  "./Process": {
145
- "types": "./src/Process/index.d.ts",
158
+ "types": "./src/Process/index.ts",
146
159
  "bun": "./src/Process/index.ts",
147
160
  "worker": "./src/Process/index.ts",
148
161
  "import": "./lib/Process/index.js"
149
162
  },
150
163
  "./SQLite": {
151
- "types": "./src/SQLite/index.d.ts",
164
+ "types": "./src/SQLite/index.ts",
152
165
  "bun": "./src/SQLite/index.ts",
153
166
  "worker": "./src/SQLite/index.ts",
154
167
  "import": "./lib/SQLite/index.js"
155
168
  },
156
169
  "./TUI": {
157
- "types": "./src/TUI/index.d.ts",
170
+ "types": "./src/TUI/index.ts",
158
171
  "bun": "./src/TUI/index.ts",
159
172
  "worker": "./src/TUI/index.ts",
160
173
  "import": "./lib/TUI/index.js"
161
174
  },
162
175
  "./Server": {
163
- "types": "./src/Server/index.d.ts",
176
+ "types": "./src/Server/index.ts",
164
177
  "bun": "./src/Server/index.ts",
165
178
  "worker": "./src/Server/index.ts",
166
179
  "import": "./lib/Server/index.js"
167
180
  },
168
181
  "./State": {
169
- "types": "./src/State/index.d.ts",
182
+ "types": "./src/State/index.ts",
170
183
  "bun": "./src/State/index.ts",
171
184
  "worker": "./src/State/index.ts",
172
185
  "import": "./lib/State/index.js"
173
186
  },
174
187
  "./Test/Bun": {
175
- "types": "./src/Test/Bun.d.ts",
188
+ "types": "./src/Test/Bun.ts",
176
189
  "bun": "./src/Test/Bun.ts",
177
190
  "worker": "./src/Test/Bun.ts",
178
191
  "import": "./lib/Test/Bun.js"
179
192
  },
180
193
  "./Util": {
181
- "types": "./src/Util/index.d.ts",
194
+ "types": "./src/Util/index.ts",
182
195
  "bun": "./src/Util/index.ts",
183
196
  "worker": "./src/Util/index.ts",
184
197
  "import": "./lib/Util/index.js"
@@ -187,30 +200,25 @@
187
200
  "publishConfig": {
188
201
  "access": "public"
189
202
  },
190
- "scripts": {
191
- "dev": "tsdown --watch",
192
- "build": "bun bundle && bun pm pack",
193
- "bundle": "tsdown",
194
- "bundle:watch": "tsdown --watch",
195
- "publish:npm": "cp ../README.md . && bun publish && rm README.md",
196
- "test:benchmark": "tsx --tsconfig tsconfig.test.json test/types.benchmark.ts"
197
- },
198
203
  "dependencies": {
204
+ "@clack/prompts": "^0.11.0",
199
205
  "@ai-sdk/anthropic": "^3.0.31",
200
206
  "@ai-sdk/openai": "^3.0.23",
201
207
  "@ai-sdk/provider": "^3.0.8",
202
208
  "@aws-sdk/credential-providers": "^3.0.0",
203
- "@distilled.cloud/aws": "^0.10.0",
204
- "@distilled.cloud/cloudflare": "^0.10.0",
205
- "@distilled.cloud/cloudflare-rolldown-plugin": "0.2.0",
206
- "@distilled.cloud/cloudflare-vite-plugin": "0.1.0",
207
- "@distilled.cloud/core": "^0.10.0",
209
+ "@distilled.cloud/aws": "^0.10.2",
210
+ "@distilled.cloud/cloudflare": "^0.10.2",
211
+ "@distilled.cloud/cloudflare-rolldown-plugin": "0.3.0",
212
+ "@distilled.cloud/cloudflare-vite-plugin": "0.2.0",
213
+ "@distilled.cloud/core": "^0.10.2",
208
214
  "@effect/vitest": "4.0.0-beta.48",
209
215
  "@libsql/client": "^0.17.0",
216
+ "@octokit/rest": "^22.0.1",
210
217
  "@smithy/node-config-provider": "^4.0.0",
211
218
  "@smithy/shared-ini-file-loader": "^4.3.4",
212
219
  "@smithy/types": "^4.8.1",
213
220
  "@types/aws-lambda": "^8.10.152",
221
+ "@types/libsodium-wrappers": "^0.8.2",
214
222
  "ai": "^6.0.62",
215
223
  "aws4fetch": "^1.0.20",
216
224
  "capnp-es": "^0.0.14",
@@ -219,6 +227,7 @@
219
227
  "fast-xml-parser": "^5.3.4",
220
228
  "ignore": "^7.0.5",
221
229
  "jszip": "^3.10.1",
230
+ "libsodium-wrappers": "^0.8.3",
222
231
  "rolldown": "1.0.0-rc.13",
223
232
  "solid-js": "latest",
224
233
  "sonda": "^0.11.1",
package/src/AWS/AGENTS.md CHANGED
@@ -51,7 +51,7 @@ Bindings are:
51
51
 
52
52
  - one file per operation
53
53
  - `Binding.Service` + `Binding.Policy`
54
- - usually named `alchemy-effect/src/AWS/<Service>/<Operation>.ts`
54
+ - usually named `alchemy/src/AWS/<Service>/<Operation>.ts`
55
55
 
56
56
  ### 2. Resource
57
57
 
@@ -73,10 +73,10 @@ Use an event source when the service can push records/events into a runtime.
73
73
 
74
74
  This always has two layers:
75
75
 
76
- 1. Service-level abstraction in `alchemy-effect/src/AWS/<Service>/...`
76
+ 1. Service-level abstraction in `alchemy/src/AWS/<Service>/...`
77
77
  2. Runtime-specific implementation in places like:
78
- - `alchemy-effect/src/AWS/Lambda/...`
79
- - `alchemy-effect/src/Process/...`
78
+ - `alchemy/src/AWS/Lambda/...`
79
+ - `alchemy/src/Process/...`
80
80
 
81
81
  Examples:
82
82
 
@@ -248,8 +248,8 @@ Example:
248
248
 
249
249
  After each binding/resource implementation, update:
250
250
 
251
- 1. `alchemy-effect/src/AWS/<Service>/index.ts`
252
- 2. `alchemy-effect/src/AWS/Providers.ts`
251
+ 1. `alchemy/src/AWS/<Service>/index.ts`
252
+ 2. `alchemy/src/AWS/Providers.ts`
253
253
 
254
254
  If registration is missing, audit should flag it.
255
255
 
@@ -257,7 +257,7 @@ If registration is missing, audit should flag it.
257
257
 
258
258
  Every implemented binding should have a corresponding `describe("<BindingName>")` block in:
259
259
 
260
- - `alchemy-effect/test/AWS/<Service>/Bindings.test.ts`
260
+ - `alchemy/test/AWS/<Service>/Bindings.test.ts`
261
261
 
262
262
  Examples:
263
263
 
@@ -282,7 +282,7 @@ Deterministic rule:
282
282
 
283
283
  Use a real Lambda fixture in:
284
284
 
285
- - `alchemy-effect/test/AWS/<Service>/handler.ts`
285
+ - `alchemy/test/AWS/<Service>/handler.ts`
286
286
 
287
287
  Pattern:
288
288
 
@@ -412,8 +412,8 @@ Required shape:
412
412
  - `Table` keeps stream state in its attributes, but does not accept `streamSpecification` as a plain input prop
413
413
  - stream enablement is requested through the table binding contract
414
414
  - the public helper is `streams(table).process(...)`
415
- - the service-level abstraction lives in `alchemy-effect/src/AWS/DynamoDB/Stream.ts`
416
- - the Lambda runtime implementation lives in `alchemy-effect/src/AWS/Lambda/TableEventSource.ts`
415
+ - the service-level abstraction lives in `alchemy/src/AWS/DynamoDB/Stream.ts`
416
+ - the Lambda runtime implementation lives in `alchemy/src/AWS/Lambda/TableEventSource.ts`
417
417
 
418
418
  Why this pattern exists:
419
419
 
package/src/AWS/Assets.ts CHANGED
@@ -152,7 +152,7 @@ export const assetsLayer = Layer.effect(
152
152
  if (Option.isNone(maybeBucket)) {
153
153
  return yield* Effect.fail(
154
154
  new Error(
155
- "Assets bucket not found. Run 'alchemy-effect bootstrap' to create it.",
155
+ "Assets bucket not found. Run 'alchemy bootstrap' to create it.",
156
156
  ),
157
157
  );
158
158
  }