alchemy 2.0.0-beta.3 → 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.
- package/bin/{alchemy-effect.js → alchemy.js} +170 -170
- package/bin/alchemy.js.map +1 -0
- package/bin/{alchemy-effect.sh → alchemy.sh} +2 -2
- package/lib/cli/index.d.ts.map +1 -1
- package/lib/cli/index.js +167 -167
- package/lib/cli/index.js.map +1 -1
- package/package.json +38 -38
- package/src/AWS/AGENTS.md +10 -10
- package/src/AWS/Assets.ts +1 -1
- package/src/AWS/AuthProvider.ts +392 -0
- package/src/AWS/Credentials.ts +0 -1
- package/src/AWS/DynamoDB/Table.ts +63 -10
- package/src/AWS/EC2/VpcEndpoint.ts +4 -4
- package/src/AWS/EC2/hosted.ts +1 -1
- package/src/AWS/ECS/Task.ts +1 -1
- package/src/AWS/Kinesis/Stream.ts +44 -8
- package/src/AWS/Lambda/Function.ts +218 -10
- package/src/AWS/S3/Bucket.ts +26 -19
- package/src/AWS/S3/BucketNotifications.ts +1 -1
- package/src/AWS/SNS/Topic.ts +47 -10
- package/src/AWS/SQS/Queue.ts +66 -0
- package/src/Auth/AuthProvider.ts +33 -0
- package/src/Auth/Credentials.ts +56 -0
- package/src/Auth/Env.ts +45 -0
- package/src/Auth/Profile.ts +72 -0
- package/src/Auth/index.ts +2 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +670 -0
- package/src/Cloudflare/Auth/OAuthClient.ts +315 -0
- package/src/Cloudflare/Container/ContainerApplication.ts +3 -3
- package/src/Cloudflare/Container/ContainerBinding.ts +2 -4
- package/src/Cloudflare/Container/StartContainer.ts +1 -1
- package/src/Cloudflare/Providers.ts +1 -6
- package/src/Cloudflare/R2/R2Bucket.ts +2 -2
- package/src/Cloudflare/Website/StaticSite.ts +44 -15
- package/src/Cloudflare/Website/Vite.ts +34 -12
- package/src/Cloudflare/Workers/Assets.ts +170 -207
- package/src/Cloudflare/Workers/DurableObjectNamespace.ts +230 -370
- package/src/Cloudflare/Workers/DurableObjectState.ts +63 -0
- package/src/Cloudflare/Workers/DurableObjectStorage.ts +256 -0
- package/src/Cloudflare/Workers/InferEnv.ts +11 -7
- package/src/Cloudflare/Workers/Rpc.ts +13 -2
- package/src/Cloudflare/Workers/ScheduledEvents.ts +185 -0
- package/src/Cloudflare/Workers/WebSocket.ts +1 -1
- package/src/Cloudflare/Workers/Worker.ts +261 -61
- package/src/Cloudflare/Workers/index.ts +3 -0
- package/src/Construct.ts +2 -2
- package/src/GitHub/Secret.ts +52 -7
- package/src/GitHub/Variable.ts +45 -2
- package/src/Kubernetes/client.ts +2 -2
- package/src/Output.ts +1 -1
- package/src/Platform.ts +10 -5
- package/src/Resource.ts +4 -4
- package/src/Test/Vitest.ts +4 -3
- package/src/Util/Clank.ts +77 -0
- package/src/Util/PlatformServices.ts +21 -0
- package/src/Util/dedent.ts +4 -1
- package/bin/alchemy-effect.js.map +0 -1
- package/src/Daemon/Client.ts +0 -116
- package/src/Daemon/Config.ts +0 -28
- package/src/Daemon/Errors.ts +0 -48
- package/src/Daemon/Lock.ts +0 -162
- package/src/Daemon/ProcessRegistry.ts +0 -284
- package/src/Daemon/RpcSchema.ts +0 -43
- package/src/Daemon/RpcServer.ts +0 -231
- package/src/Daemon/index.ts +0 -27
- package/src/Spawn.ts +0 -23
- /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.
|
|
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
|
|
14
|
-
"alchemy-effect": "bin/alchemy-effect.sh"
|
|
13
|
+
"alchemy": "bin/alchemy.sh"
|
|
15
14
|
},
|
|
16
15
|
"files": [
|
|
17
16
|
"bin",
|
|
@@ -30,169 +29,169 @@
|
|
|
30
29
|
},
|
|
31
30
|
"exports": {
|
|
32
31
|
".": {
|
|
33
|
-
"types": "./src/index.
|
|
32
|
+
"types": "./src/index.ts",
|
|
34
33
|
"bun": "./src/index.ts",
|
|
35
34
|
"worker": "./src/index.ts",
|
|
36
35
|
"import": "./lib/index.js"
|
|
37
36
|
},
|
|
38
37
|
"./*": {
|
|
39
|
-
"types": "./src/*.
|
|
38
|
+
"types": "./src/*.ts",
|
|
40
39
|
"bun": "./src/*.ts",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
40
|
+
"import": "./lib/*.js",
|
|
41
|
+
"worker": "./src/*.ts"
|
|
43
42
|
},
|
|
44
43
|
"./Agent": {
|
|
45
|
-
"types": "./src/Agent/index.
|
|
44
|
+
"types": "./src/Agent/index.ts",
|
|
46
45
|
"bun": "./src/Agent/index.ts",
|
|
47
46
|
"worker": "./src/Agent/index.ts",
|
|
48
47
|
"import": "./lib/Agent/index.js"
|
|
49
48
|
},
|
|
50
49
|
"./AWS": {
|
|
51
|
-
"types": "./src/AWS/index.
|
|
50
|
+
"types": "./src/AWS/index.ts",
|
|
52
51
|
"bun": "./src/AWS/index.ts",
|
|
53
52
|
"worker": "./src/AWS/index.ts",
|
|
54
53
|
"import": "./lib/AWS/index.js"
|
|
55
54
|
},
|
|
56
55
|
"./AWS/*": {
|
|
57
|
-
"types": "./src/AWS/*/index.
|
|
56
|
+
"types": "./src/AWS/*/index.ts",
|
|
58
57
|
"bun": "./src/AWS/*/index.ts",
|
|
59
58
|
"worker": "./src/AWS/*/index.ts",
|
|
60
59
|
"import": "./lib/AWS/*/index.js"
|
|
61
60
|
},
|
|
62
61
|
"./AWS/Credentials": {
|
|
63
|
-
"types": "./src/AWS/Credentials/index.
|
|
62
|
+
"types": "./src/AWS/Credentials/index.ts",
|
|
64
63
|
"bun": "./src/AWS/Credentials/index.ts",
|
|
65
64
|
"worker": "./src/AWS/Credentials/index.ts",
|
|
66
65
|
"import": "./lib/AWS/Credentials/index.js"
|
|
67
66
|
},
|
|
68
67
|
"./AWS/Endpoint": {
|
|
69
|
-
"types": "./src/AWS/Endpoint/index.
|
|
68
|
+
"types": "./src/AWS/Endpoint/index.ts",
|
|
70
69
|
"bun": "./src/AWS/Endpoint/index.ts",
|
|
71
70
|
"worker": "./src/AWS/Endpoint/index.ts",
|
|
72
71
|
"import": "./lib/AWS/Endpoint/index.js"
|
|
73
72
|
},
|
|
74
73
|
"./AWS/Region": {
|
|
75
|
-
"types": "./src/AWS/Region/index.
|
|
74
|
+
"types": "./src/AWS/Region/index.ts",
|
|
76
75
|
"bun": "./src/AWS/Region/index.ts",
|
|
77
76
|
"worker": "./src/AWS/Region/index.ts",
|
|
78
77
|
"import": "./lib/AWS/Region/index.js"
|
|
79
78
|
},
|
|
80
79
|
"./AWS/Profile": {
|
|
81
|
-
"types": "./src/AWS/Profile/index.
|
|
80
|
+
"types": "./src/AWS/Profile/index.ts",
|
|
82
81
|
"bun": "./src/AWS/Profile/index.ts",
|
|
83
82
|
"worker": "./src/AWS/Profile/index.ts",
|
|
84
83
|
"import": "./lib/AWS/Profile/index.js"
|
|
85
84
|
},
|
|
86
85
|
"./AWS/Lambda/*": {
|
|
87
|
-
"types": "./src/AWS/Lambda/*.
|
|
86
|
+
"types": "./src/AWS/Lambda/*.ts",
|
|
88
87
|
"bun": "./src/AWS/Lambda/*.ts",
|
|
89
88
|
"worker": "./src/AWS/Lambda/*.ts",
|
|
90
89
|
"import": "./lib/AWS/Lambda/*.js"
|
|
91
90
|
},
|
|
92
91
|
"./Build": {
|
|
93
|
-
"types": "./src/Build/index.
|
|
92
|
+
"types": "./src/Build/index.ts",
|
|
94
93
|
"bun": "./src/Build/index.ts",
|
|
95
94
|
"worker": "./src/Build/index.ts",
|
|
96
95
|
"import": "./lib/Build/index.js"
|
|
97
96
|
},
|
|
98
97
|
"./Construct": {
|
|
99
|
-
"types": "./src/Construct/index.
|
|
98
|
+
"types": "./src/Construct/index.ts",
|
|
100
99
|
"bun": "./src/Construct/index.ts",
|
|
101
100
|
"worker": "./src/Construct/index.ts",
|
|
102
101
|
"import": "./lib/Construct/index.js"
|
|
103
102
|
},
|
|
104
103
|
"./Bundle": {
|
|
105
|
-
"types": "./src/Bundle/index.
|
|
104
|
+
"types": "./src/Bundle/index.ts",
|
|
106
105
|
"bun": "./src/Bundle/index.ts",
|
|
107
106
|
"worker": "./src/Bundle/index.ts",
|
|
108
107
|
"import": "./lib/Bundle/index.js"
|
|
109
108
|
},
|
|
110
109
|
"./ContentType": {
|
|
111
|
-
"types": "./src/ContentType.
|
|
110
|
+
"types": "./src/ContentType.ts",
|
|
112
111
|
"bun": "./src/ContentType.ts",
|
|
113
112
|
"worker": "./src/ContentType.ts",
|
|
114
113
|
"import": "./lib/ContentType.js"
|
|
115
114
|
},
|
|
116
115
|
"./Cloudflare": {
|
|
117
|
-
"types": "./src/Cloudflare/index.
|
|
116
|
+
"types": "./src/Cloudflare/index.ts",
|
|
118
117
|
"bun": "./src/Cloudflare/index.ts",
|
|
119
118
|
"worker": "./src/Cloudflare/index.ts",
|
|
120
119
|
"import": "./lib/Cloudflare/index.js"
|
|
121
120
|
},
|
|
122
121
|
"./Cloudflare/Live": {
|
|
123
|
-
"types": "./src/Cloudflare/Live.
|
|
122
|
+
"types": "./src/Cloudflare/Live.ts",
|
|
124
123
|
"bun": "./src/Cloudflare/Live.ts",
|
|
125
124
|
"worker": "./src/Cloudflare/Live.ts",
|
|
126
125
|
"import": "./lib/Cloudflare/Live.js"
|
|
127
126
|
},
|
|
128
127
|
"./Cloudflare/*": {
|
|
129
|
-
"types": "./src/Cloudflare/*/index.
|
|
128
|
+
"types": "./src/Cloudflare/*/index.ts",
|
|
130
129
|
"bun": "./src/Cloudflare/*/index.ts",
|
|
131
130
|
"worker": "./src/Cloudflare/*/index.ts",
|
|
132
131
|
"import": "./lib/Cloudflare/*/index.js"
|
|
133
132
|
},
|
|
134
133
|
"./GitHub": {
|
|
135
|
-
"types": "./src/GitHub/index.
|
|
134
|
+
"types": "./src/GitHub/index.ts",
|
|
136
135
|
"bun": "./src/GitHub/index.ts",
|
|
137
136
|
"worker": "./src/GitHub/index.ts",
|
|
138
137
|
"import": "./lib/GitHub/index.js"
|
|
139
138
|
},
|
|
140
139
|
"./Endpoint": {
|
|
141
|
-
"types": "./src/Endpoint/index.
|
|
140
|
+
"types": "./src/Endpoint/index.ts",
|
|
142
141
|
"bun": "./src/Endpoint/index.ts",
|
|
143
142
|
"worker": "./src/Endpoint/index.ts",
|
|
144
143
|
"import": "./lib/Endpoint/index.js"
|
|
145
144
|
},
|
|
146
145
|
"./Kubernetes": {
|
|
147
|
-
"types": "./src/Kubernetes/index.
|
|
146
|
+
"types": "./src/Kubernetes/index.ts",
|
|
148
147
|
"bun": "./src/Kubernetes/index.ts",
|
|
149
148
|
"worker": "./src/Kubernetes/index.ts",
|
|
150
149
|
"import": "./lib/Kubernetes/index.js"
|
|
151
150
|
},
|
|
152
151
|
"./Output": {
|
|
153
|
-
"types": "./src/Output.
|
|
152
|
+
"types": "./src/Output.ts",
|
|
154
153
|
"bun": "./src/Output.ts",
|
|
155
154
|
"worker": "./src/Output.ts",
|
|
156
155
|
"import": "./lib/Output.js"
|
|
157
156
|
},
|
|
158
157
|
"./Process": {
|
|
159
|
-
"types": "./src/Process/index.
|
|
158
|
+
"types": "./src/Process/index.ts",
|
|
160
159
|
"bun": "./src/Process/index.ts",
|
|
161
160
|
"worker": "./src/Process/index.ts",
|
|
162
161
|
"import": "./lib/Process/index.js"
|
|
163
162
|
},
|
|
164
163
|
"./SQLite": {
|
|
165
|
-
"types": "./src/SQLite/index.
|
|
164
|
+
"types": "./src/SQLite/index.ts",
|
|
166
165
|
"bun": "./src/SQLite/index.ts",
|
|
167
166
|
"worker": "./src/SQLite/index.ts",
|
|
168
167
|
"import": "./lib/SQLite/index.js"
|
|
169
168
|
},
|
|
170
169
|
"./TUI": {
|
|
171
|
-
"types": "./src/TUI/index.
|
|
170
|
+
"types": "./src/TUI/index.ts",
|
|
172
171
|
"bun": "./src/TUI/index.ts",
|
|
173
172
|
"worker": "./src/TUI/index.ts",
|
|
174
173
|
"import": "./lib/TUI/index.js"
|
|
175
174
|
},
|
|
176
175
|
"./Server": {
|
|
177
|
-
"types": "./src/Server/index.
|
|
176
|
+
"types": "./src/Server/index.ts",
|
|
178
177
|
"bun": "./src/Server/index.ts",
|
|
179
178
|
"worker": "./src/Server/index.ts",
|
|
180
179
|
"import": "./lib/Server/index.js"
|
|
181
180
|
},
|
|
182
181
|
"./State": {
|
|
183
|
-
"types": "./src/State/index.
|
|
182
|
+
"types": "./src/State/index.ts",
|
|
184
183
|
"bun": "./src/State/index.ts",
|
|
185
184
|
"worker": "./src/State/index.ts",
|
|
186
185
|
"import": "./lib/State/index.js"
|
|
187
186
|
},
|
|
188
187
|
"./Test/Bun": {
|
|
189
|
-
"types": "./src/Test/Bun.
|
|
188
|
+
"types": "./src/Test/Bun.ts",
|
|
190
189
|
"bun": "./src/Test/Bun.ts",
|
|
191
190
|
"worker": "./src/Test/Bun.ts",
|
|
192
191
|
"import": "./lib/Test/Bun.js"
|
|
193
192
|
},
|
|
194
193
|
"./Util": {
|
|
195
|
-
"types": "./src/Util/index.
|
|
194
|
+
"types": "./src/Util/index.ts",
|
|
196
195
|
"bun": "./src/Util/index.ts",
|
|
197
196
|
"worker": "./src/Util/index.ts",
|
|
198
197
|
"import": "./lib/Util/index.js"
|
|
@@ -202,15 +201,16 @@
|
|
|
202
201
|
"access": "public"
|
|
203
202
|
},
|
|
204
203
|
"dependencies": {
|
|
204
|
+
"@clack/prompts": "^0.11.0",
|
|
205
205
|
"@ai-sdk/anthropic": "^3.0.31",
|
|
206
206
|
"@ai-sdk/openai": "^3.0.23",
|
|
207
207
|
"@ai-sdk/provider": "^3.0.8",
|
|
208
208
|
"@aws-sdk/credential-providers": "^3.0.0",
|
|
209
|
-
"@distilled.cloud/aws": "^0.10.
|
|
210
|
-
"@distilled.cloud/cloudflare": "^0.10.
|
|
211
|
-
"@distilled.cloud/cloudflare-rolldown-plugin": "0.
|
|
212
|
-
"@distilled.cloud/cloudflare-vite-plugin": "0.
|
|
213
|
-
"@distilled.cloud/core": "^0.10.
|
|
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",
|
|
214
214
|
"@effect/vitest": "4.0.0-beta.48",
|
|
215
215
|
"@libsql/client": "^0.17.0",
|
|
216
216
|
"@octokit/rest": "^22.0.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
|
|
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
|
|
76
|
+
1. Service-level abstraction in `alchemy/src/AWS/<Service>/...`
|
|
77
77
|
2. Runtime-specific implementation in places like:
|
|
78
|
-
- `alchemy
|
|
79
|
-
- `alchemy
|
|
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
|
|
252
|
-
2. `alchemy
|
|
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
|
|
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
|
|
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
|
|
416
|
-
- the Lambda runtime implementation lives in `alchemy
|
|
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
|
|
155
|
+
"Assets bucket not found. Run 'alchemy bootstrap' to create it.",
|
|
156
156
|
),
|
|
157
157
|
);
|
|
158
158
|
}
|