| 2 | 2 | | // |
| 3 | 3 | | // Self-hosted phase 1 runs the core forge only. The site and the services |
| 4 | 4 | | // still hold bindings to the cloud runner and the deployments' builders; |
| 5 | | − | // this Worker stands in for each of them, so a page that asks whether the |
| 6 | | − | // runner is on here is told no instead of failing. |
| 7 | | − | // |
| 8 | | − | // - As the runner, for the methods the site once called on it: it is |
| 9 | | − | // not enabled, and starting anything fails with a message that says why. |
| 10 | | − | // - For the JSON protocol the Rust services speak (`POST /rpc/<method>`): |
| 11 | | − | // every method answers with a failed Result. |
| 5 | + | // this Worker stands in for each of them: every method of the JSON protocol |
| 6 | + | // the services speak (`POST /rpc/<method>`) answers with a failed Result |
| 7 | + | // that says why, instead of failing. |
| 12 | 8 | | // |
| 13 | 9 | | // OFF_NAME names the feature in those messages, such as "Cloud runners". |
| 14 | 10 | | |
| ⋯ |
| 23 | 19 | | } |
| 24 | 20 | | |
| 25 | 21 | | export default class Off extends WorkerEntrypoint { |
| 26 | | − | // ── The runner's methods, as the site calls them ── |
| 27 | | − | async enabled() { |
| 28 | | − | return false; |
| 29 | | − | } |
| 30 | | − | async modelAccess() { |
| 31 | | − | return { own: null, hosted: false, trial: null }; |
| 32 | | − | } |
| 33 | | − | async instructions() { |
| 34 | | − | return off(this.env); |
| 35 | | − | } |
| 36 | | − | async run() { |
| 37 | | − | return off(this.env); |
| 38 | | − | } |
| 39 | | − | async plan() { |
| 40 | | − | return off(this.env); |
| 41 | | − | } |
| 42 | | − | async applyPlan() { |
| 43 | | − | return off(this.env); |
| 44 | | − | } |
| 45 | | − | async update() { |
| 46 | | − | return off(this.env); |
| 47 | | − | } |
| 48 | | − | async review() { |
| 49 | | − | return off(this.env); |
| 50 | | − | } |
| 51 | | − | async recheck() { |
| 52 | | − | return off(this.env); |
| 53 | | − | } |
| 54 | | − | async stopRun() { |
| 55 | | − | return off(this.env); |
| 56 | | − | } |
| 57 | | − | |
| 58 | 22 | | // ── The JSON protocol ── |
| 59 | 23 | | async fetch(request) { |
| 60 | 24 | | const { pathname } = new URL(request.url); |