Commit 3b27d75
committed
feat(deploy/cf): expose env on photon instances + auto-bind Workers AI
Plumbs the Worker's env onto the photon instance as this.env so a
photon can reach CF bindings (Workers AI, KV, R2, queues) directly.
Photons that want to stay portable can branch on
(this as any).env?.AI and fall back to a non-CF path on the local
daemon (where env is undefined).
Auto-includes the [ai] binding in every generated wrangler.toml so
photons can call env.AI.run for embeddings, classification, or small
LLMs without extra setup. Free tier covers thousands of calls/day;
photons that do not use it pay nothing for the binding being declared.1 parent c409ec8 commit 3b27d75
2 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
357 | 369 | | |
358 | 370 | | |
359 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
0 commit comments