@kubohiroya/turbowarp-http-server 0.2.0 → 0.3.0
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/README.ja.md +32 -14
- package/README.md +104 -43
- package/assets/block-icon.svg +1 -0
- package/dist/cli.js +131 -17
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapters/cloudflare.d.ts +2 -0
- package/dist/compiler/adapters/cloudflare.js +477 -0
- package/dist/compiler/adapters/cloudflare.js.map +1 -0
- package/dist/compiler/adapters/firebase.d.ts +2 -0
- package/dist/compiler/adapters/firebase.js +489 -0
- package/dist/compiler/adapters/firebase.js.map +1 -0
- package/dist/compiler/adapters/index.d.ts +2 -0
- package/dist/compiler/adapters/index.js +3 -0
- package/dist/compiler/adapters/index.js.map +1 -0
- package/dist/compiler/binary/codec.d.ts +4 -0
- package/dist/compiler/binary/codec.js +45 -0
- package/dist/compiler/binary/codec.js.map +1 -0
- package/dist/compiler/binary/error.d.ts +3 -0
- package/dist/compiler/binary/error.js +21 -0
- package/dist/compiler/binary/error.js.map +1 -0
- package/dist/compiler/binary/index.d.ts +4 -0
- package/dist/compiler/binary/index.js +5 -0
- package/dist/compiler/binary/index.js.map +1 -0
- package/dist/compiler/binary/runtime.d.ts +18 -0
- package/dist/compiler/binary/runtime.js +123 -0
- package/dist/compiler/binary/runtime.js.map +1 -0
- package/dist/compiler/binary/types.d.ts +17 -0
- package/dist/compiler/binary/types.js +2 -0
- package/dist/compiler/binary/types.js.map +1 -0
- package/dist/compiler/feature-flags.d.ts +4 -0
- package/dist/compiler/feature-flags.js +4 -0
- package/dist/compiler/feature-flags.js.map +1 -0
- package/dist/compiler/index.d.ts +35 -0
- package/dist/compiler/index.js +84 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/ir-v2/canonical.d.ts +3 -0
- package/dist/compiler/ir-v2/canonical.js +50 -0
- package/dist/compiler/ir-v2/canonical.js.map +1 -0
- package/dist/compiler/ir-v2/index.d.ts +4 -0
- package/dist/compiler/ir-v2/index.js +5 -0
- package/dist/compiler/ir-v2/index.js.map +1 -0
- package/dist/compiler/ir-v2/parse.d.ts +10 -0
- package/dist/compiler/ir-v2/parse.js +753 -0
- package/dist/compiler/ir-v2/parse.js.map +1 -0
- package/dist/compiler/ir-v2/strict-json.d.ts +4 -0
- package/dist/compiler/ir-v2/strict-json.js +133 -0
- package/dist/compiler/ir-v2/strict-json.js.map +1 -0
- package/dist/compiler/ir-v2/types.d.ts +412 -0
- package/dist/compiler/ir-v2/types.js +84 -0
- package/dist/compiler/ir-v2/types.js.map +1 -0
- package/dist/compiler/kvs/lowering.d.ts +13 -0
- package/dist/compiler/kvs/lowering.js +77 -0
- package/dist/compiler/kvs/lowering.js.map +1 -0
- package/dist/compiler/manifest/error.d.ts +7 -0
- package/dist/compiler/manifest/error.js +9 -0
- package/dist/compiler/manifest/error.js.map +1 -0
- package/dist/compiler/manifest/index.d.ts +6 -0
- package/dist/compiler/manifest/index.js +7 -0
- package/dist/compiler/manifest/index.js.map +1 -0
- package/dist/compiler/manifest/operations.d.ts +12 -0
- package/dist/compiler/manifest/operations.js +60 -0
- package/dist/compiler/manifest/operations.js.map +1 -0
- package/dist/compiler/manifest/parse.d.ts +9 -0
- package/dist/compiler/manifest/parse.js +280 -0
- package/dist/compiler/manifest/parse.js.map +1 -0
- package/dist/compiler/manifest/registry.d.ts +3 -0
- package/dist/compiler/manifest/registry.js +48 -0
- package/dist/compiler/manifest/registry.js.map +1 -0
- package/dist/compiler/manifest/resolve.d.ts +14 -0
- package/dist/compiler/manifest/resolve.js +116 -0
- package/dist/compiler/manifest/resolve.js.map +1 -0
- package/dist/compiler/manifest/types.d.ts +95 -0
- package/dist/compiler/manifest/types.js +3 -0
- package/dist/compiler/manifest/types.js.map +1 -0
- package/dist/compiler/named-body/index.d.ts +1 -0
- package/dist/compiler/named-body/index.js +2 -0
- package/dist/compiler/named-body/index.js.map +1 -0
- package/dist/compiler/named-body/lowering.d.ts +18 -0
- package/dist/compiler/named-body/lowering.js +83 -0
- package/dist/compiler/named-body/lowering.js.map +1 -0
- package/dist/compiler/pipeline/compiler.d.ts +18 -0
- package/dist/compiler/pipeline/compiler.js +105 -0
- package/dist/compiler/pipeline/compiler.js.map +1 -0
- package/dist/compiler/pipeline/core-generator.d.ts +3 -0
- package/dist/compiler/pipeline/core-generator.js +483 -0
- package/dist/compiler/pipeline/core-generator.js.map +1 -0
- package/dist/compiler/pipeline/index.d.ts +5 -0
- package/dist/compiler/pipeline/index.js +6 -0
- package/dist/compiler/pipeline/index.js.map +1 -0
- package/dist/compiler/pipeline/registry.d.ts +7 -0
- package/dist/compiler/pipeline/registry.js +17 -0
- package/dist/compiler/pipeline/registry.js.map +1 -0
- package/dist/compiler/pipeline/requirements.d.ts +9 -0
- package/dist/compiler/pipeline/requirements.js +135 -0
- package/dist/compiler/pipeline/requirements.js.map +1 -0
- package/dist/compiler/pipeline/types.d.ts +65 -0
- package/dist/compiler/pipeline/types.js +2 -0
- package/dist/compiler/pipeline/types.js.map +1 -0
- package/dist/compiler/runtime/error.d.ts +6 -0
- package/dist/compiler/runtime/error.js +9 -0
- package/dist/compiler/runtime/error.js.map +1 -0
- package/dist/compiler/runtime/index.d.ts +1 -0
- package/dist/compiler/runtime/index.js +2 -0
- package/dist/compiler/runtime/index.js.map +1 -0
- package/dist/compiler/structured-data/index.d.ts +3 -0
- package/dist/compiler/structured-data/index.js +4 -0
- package/dist/compiler/structured-data/index.js.map +1 -0
- package/dist/compiler/structured-data/lowering.d.ts +30 -0
- package/dist/compiler/structured-data/lowering.js +202 -0
- package/dist/compiler/structured-data/lowering.js.map +1 -0
- package/dist/compiler/structured-data/path.d.ts +2 -0
- package/dist/compiler/structured-data/path.js +60 -0
- package/dist/compiler/structured-data/path.js.map +1 -0
- package/dist/compiler/structured-data/runtime.d.ts +20 -0
- package/dist/compiler/structured-data/runtime.js +210 -0
- package/dist/compiler/structured-data/runtime.js.map +1 -0
- package/dist/compiler/turbowarp-v2.d.ts +8 -0
- package/dist/compiler/turbowarp-v2.js +479 -0
- package/dist/compiler/turbowarp-v2.js.map +1 -0
- package/dist/compiler/validator/index.d.ts +4 -0
- package/dist/compiler/validator/index.js +5 -0
- package/dist/compiler/validator/index.js.map +1 -0
- package/dist/compiler/validator/ir-validator.d.ts +10 -0
- package/dist/compiler/validator/ir-validator.js +463 -0
- package/dist/compiler/validator/ir-validator.js.map +1 -0
- package/dist/compiler/validator/resource-lifetime.d.ts +18 -0
- package/dist/compiler/validator/resource-lifetime.js +106 -0
- package/dist/compiler/validator/resource-lifetime.js.map +1 -0
- package/dist/compiler/validator/turbowarp-subset.d.ts +3 -0
- package/dist/compiler/validator/turbowarp-subset.js +241 -0
- package/dist/compiler/validator/turbowarp-subset.js.map +1 -0
- package/dist/compiler/validator/types.d.ts +30 -0
- package/dist/compiler/validator/types.js +7 -0
- package/dist/compiler/validator/types.js.map +1 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/digest-cli.js +0 -0
- package/dist/extension-manifest.json +102 -0
- package/dist/named-body.d.ts +57 -0
- package/dist/named-body.js +396 -0
- package/dist/named-body.js.map +1 -0
- package/dist/named-data-namespace.d.ts +3 -0
- package/dist/named-data-namespace.js +6 -0
- package/dist/named-data-namespace.js.map +1 -0
- package/dist/protocol.d.ts +13 -1
- package/dist/protocol.js +34 -0
- package/dist/protocol.js.map +1 -1
- package/dist/resource-named-body-provider.d.ts +8 -0
- package/dist/resource-named-body-provider.js +88 -0
- package/dist/resource-named-body-provider.js.map +1 -0
- package/dist/server.d.ts +10 -1
- package/dist/server.js +37 -7
- package/dist/server.js.map +1 -1
- package/dist/turbowarp-http-server.js +1614 -1099
- package/docs/binary-resource-semantics.ja.md +84 -0
- package/docs/cloudflare-worker-compiler.ja.md +90 -0
- package/docs/compiler-manifest-registry.ja.md +79 -0
- package/docs/compiler-platform-pipeline.ja.md +94 -0
- package/docs/deploy-ir-v2.ja.md +123 -0
- package/docs/fixed-input-editors.ja.md +23 -0
- package/docs/index.html +86 -0
- package/docs/ir-v2-conformance.ja.md +65 -0
- package/docs/named-response-body.ja.md +120 -0
- package/docs/platform-storage-adapters.ja.md +99 -0
- package/docs/server-executable-subset.ja.md +88 -0
- package/docs/structured-data-lowering.ja.md +63 -0
- package/docs/turbowarp-http-server.architecture.html +4 -0
- package/examples/compiler/message-app.v2.ir.json +41 -0
- package/package.json +45 -20
- package/schemas/block-editor-fixed-inputs.schema.json +85 -0
- package/schemas/compiler-extension-manifest.schema.json +126 -0
- package/schemas/compiler-manifest-lock-v1.schema.json +48 -0
- package/schemas/deploy-ir-v2.schema.json +835 -0
- package/schemas/ir-v2-conformance-fixture.schema.json +44 -0
- package/src/block-definitions.json +76 -0
- package/src/cli.ts +136 -23
- package/src/compiler/adapters/cloudflare.ts +510 -0
- package/src/compiler/adapters/firebase.ts +538 -0
- package/src/compiler/adapters/index.ts +2 -0
- package/src/compiler/binary/codec.ts +61 -0
- package/src/compiler/binary/error.ts +25 -0
- package/src/compiler/binary/index.ts +4 -0
- package/src/compiler/binary/runtime.ts +133 -0
- package/src/compiler/binary/types.ts +26 -0
- package/src/compiler/feature-flags.ts +7 -0
- package/src/compiler/index.ts +114 -0
- package/src/compiler/ir-v2/canonical.ts +46 -0
- package/src/compiler/ir-v2/index.ts +9 -0
- package/src/compiler/ir-v2/parse.ts +921 -0
- package/src/compiler/ir-v2/strict-json.ts +129 -0
- package/src/compiler/ir-v2/types.ts +462 -0
- package/src/compiler/kvs/lowering.ts +88 -0
- package/src/compiler/manifest/error.ts +29 -0
- package/src/compiler/manifest/index.ts +17 -0
- package/src/compiler/manifest/operations.ts +175 -0
- package/src/compiler/manifest/parse.ts +390 -0
- package/src/compiler/manifest/registry.ts +74 -0
- package/src/compiler/manifest/resolve.ts +159 -0
- package/src/compiler/manifest/types.ts +112 -0
- package/src/compiler/named-body/index.ts +1 -0
- package/src/compiler/named-body/lowering.ts +186 -0
- package/src/compiler/pipeline/compiler.ts +138 -0
- package/src/compiler/pipeline/core-generator.ts +486 -0
- package/src/compiler/pipeline/index.ts +5 -0
- package/src/compiler/pipeline/registry.ts +18 -0
- package/src/compiler/pipeline/requirements.ts +139 -0
- package/src/compiler/pipeline/types.ts +59 -0
- package/src/compiler/runtime/error.ts +11 -0
- package/src/compiler/runtime/index.ts +1 -0
- package/src/compiler/structured-data/index.ts +3 -0
- package/src/compiler/structured-data/lowering.ts +314 -0
- package/src/compiler/structured-data/path.ts +53 -0
- package/src/compiler/structured-data/runtime.ts +221 -0
- package/src/compiler/turbowarp-v2.ts +610 -0
- package/src/compiler/validator/index.ts +4 -0
- package/src/compiler/validator/ir-validator.ts +812 -0
- package/src/compiler/validator/resource-lifetime.ts +153 -0
- package/src/compiler/validator/turbowarp-subset.ts +387 -0
- package/src/compiler/validator/types.ts +68 -0
- package/src/config.ts +1 -1
- package/src/extension.ts +87 -1
- package/src/fixed-input-editors.ts +181 -0
- package/src/fixed-input-schema.ts +15 -0
- package/src/named-body.ts +495 -0
- package/src/named-data-namespace.ts +6 -0
- package/src/protocol.ts +50 -1
- package/src/resource-named-body-provider.ts +106 -0
- package/src/server.ts +88 -8
- package/docs/turbowarp-http-server.architecture.visual-check.1440x900.dark.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.1440x900.light.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.dark.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.light.png +0 -0
- package/docs/turbowarp-http-server.architecture.visual-check.html +0 -32
- package/docs/turbowarp-http-server.architecture.visual-check.json +0 -547
- package/schemas/extension-manifest.schema.json +0 -49
- package/src/extension-manifest.ts +0 -149
package/README.ja.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# TurboWarp-HTTP-Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="assets/block-icon.svg" alt="" width="48" height="48">
|
|
4
|
+
|
|
5
|
+
[English](README.md) | 日本語
|
|
4
6
|
|
|
5
7
|
CLI で起動する HTTP ブリッジサーバと、そのサーバへ WebSocket 接続する TurboWarp 機能拡張を同じ package で提供します。
|
|
6
8
|
|
|
@@ -71,14 +73,14 @@ turbowarp-http-server \
|
|
|
71
73
|
|---|---|
|
|
72
74
|
| `GET /health` | ヘルスチェック |
|
|
73
75
|
| `GET /ws` | TurboWarp extension が接続する WebSocket endpoint |
|
|
74
|
-
| `GET /@assets/<name>` | resource capability が接続されている場合、Asset
|
|
76
|
+
| `GET /@assets/<name>` | resource capability が接続されている場合、Asset Cache の named resource を配信 |
|
|
75
77
|
| `HEAD /@assets/<name>` | body なしで同じ resource metadata を返却 |
|
|
76
78
|
| `PUT /@assets/<name>` | 対応 capability で named resource を作成または atomic replace |
|
|
77
79
|
| `DELETE /@assets/<name>` | 対応 capability で named resource を削除 |
|
|
78
80
|
| `GET /@assets/` | binary payload を含めず metadata/listing を返却 |
|
|
79
81
|
| その他の HTTP route | HTTP forwarding 実装前の一時的な `503 not_connected` 応答 |
|
|
80
82
|
|
|
81
|
-
Sprite route はこれとは別の TurboWarp-facing layer です。`camera` という名前の Sprite は `/camera` を公開でき、Sprite を「隠す」とその route を無効化できます。Sprite handler は HTML、JSON、redirect、`/camera/image.jpg` のような friendly alias を返せますが、`@assets` を Sprite の子 namespace にするのではなく Asset
|
|
83
|
+
Sprite route はこれとは別の TurboWarp-facing layer です。`camera` という名前の Sprite は `/camera` を公開でき、Sprite を「隠す」とその route を無効化できます。Sprite handler は HTML、JSON、redirect、`/camera/image.jpg` のような friendly alias を返せますが、`@assets` を Sprite の子 namespace にするのではなく Asset Cache capability を参照します。
|
|
82
84
|
|
|
83
85
|
### 学習用コミュニティサーバ
|
|
84
86
|
|
|
@@ -121,11 +123,11 @@ COMMUNITY_OAUTH_DEMO_SCOPE=profile
|
|
|
121
123
|
|
|
122
124
|
この community server は local educational implementation であり、公開運用向けではありません。internet に公開する前に、in-memory storage を durable storage に置き換え、rate limit と abuse moderation、HTTPS と secure cookie、完全な OAuth token/userinfo exchange、必要な email または external identity verification、upload scan、audit log、backup、retention、takedown、incident-response 手順を追加してください。
|
|
123
125
|
|
|
124
|
-
## Asset
|
|
126
|
+
## Asset Cache Resource Serving
|
|
125
127
|
|
|
126
|
-
HTTP server は camera-agnostic です。`turbowarp-asset-
|
|
128
|
+
HTTP server は camera-agnostic です。`turbowarp-asset-cache` のような外部 capability が提供する generic named resource を配信し、private field を読んだり Asset Cache の storage を複製したりしません。
|
|
127
129
|
|
|
128
|
-
generic Asset
|
|
130
|
+
generic Asset Cache namespace は `/@assets/` を root にします。これは Sprite route の管理下ではなく、background/server-side resource capability が管理します。Sprite route は friendly alias を提供できますが、generic resource route は global に保ちます。
|
|
129
131
|
|
|
130
132
|
| Resource | HTTP route |
|
|
131
133
|
|---|---|
|
|
@@ -138,7 +140,7 @@ resource response は `Content-Type`、`Content-Length`、可能な場合は `ET
|
|
|
138
140
|
|
|
139
141
|
`PUT` は request body bytes と `Content-Type` を使い、capability 経由で resource を作成または置換します。server は configurable body-size limit を適用し、capability が拒否する MIME type を `415` にし、置換は後続 request へ atomic に見えるようにします。進行中の `GET` は開始時点の snapshot を受け取ります。
|
|
140
142
|
|
|
141
|
-
`/_tw-http/` は management namespace として予約し、asset route として扱いません。`/camera/@assets/live-camera` のような path は generic Asset
|
|
143
|
+
`/_tw-http/` は management namespace として予約し、asset route として扱いません。`/camera/@assets/live-camera` のような path は generic Asset Cache route ではありません。必要なら Scratch/TurboWarp handler で friendly Sprite URL を `/@assets/<name>` へ alias します。authorization hook が設定されている場合は `GET`、`HEAD`、`PUT`、`DELETE`、listing に一貫して適用します。structured log には route、resource name、MIME type、byte count、status などの metadata だけを含め、binary request/response body は含めません。
|
|
142
144
|
|
|
143
145
|
## Sprite Route Model
|
|
144
146
|
|
|
@@ -150,7 +152,7 @@ TurboWarp-facing route は project object と自然に対応させます。
|
|
|
150
152
|
| Sprite `camera` が表示中 | `/camera` |
|
|
151
153
|
| Sprite `camera` が非表示 | route disabled |
|
|
152
154
|
|
|
153
|
-
これにより Scratch 上の操作が HTTP 公開状態と直感的につながります。Sprite を「表示する」と route が公開され、「隠す」と route が取り下げられます。Asset
|
|
155
|
+
これにより Scratch 上の操作が HTTP 公開状態と直感的につながります。Sprite を「表示する」と route が公開され、「隠す」と route が取り下げられます。Asset Cache resource は `/@assets/<name>` に global に置くため、同じ resource を複数の Sprite route から storage duplication なしに再利用できます。
|
|
154
156
|
|
|
155
157
|
live camera page は次のように扱えます。
|
|
156
158
|
|
|
@@ -166,7 +168,7 @@ GET /camera/image.jpg
|
|
|
166
168
|
-> /@assets/live-camera を返す friendly handler/alias
|
|
167
169
|
```
|
|
168
170
|
|
|
169
|
-
つまり `/camera/image.jpg` は Sprite route の判断で、`/@assets/live-camera` は generic Asset
|
|
171
|
+
つまり `/camera/image.jpg` は Sprite route の判断で、`/@assets/live-camera` は generic Asset Cache resource endpoint です。
|
|
170
172
|
|
|
171
173
|
## デプロイターゲット検討
|
|
172
174
|
|
|
@@ -236,6 +238,20 @@ current request ID
|
|
|
236
238
|
|
|
237
239
|
simple query/header reporter は最初の値を返します。wire protocol は全値を保持するため、将来 list-oriented block を追加しても protocol を壊さずに済みます。
|
|
238
240
|
|
|
241
|
+
server へ compile 可能な一時値には、通常の Scratch 変数ではなく handler variable を使います。値は request ID ごとに分離され、response 完了時に破棄されます。
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
set handler variable [name] to [value]
|
|
245
|
+
change handler variable [name] by [amount]
|
|
246
|
+
handler variable [name]
|
|
247
|
+
handler variable [name] exists?
|
|
248
|
+
delete handler variable [name]
|
|
249
|
+
delete all handler variables
|
|
250
|
+
active handler variables
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
これは TurboWarp Temporary Variables の thread variable に対応する request-local な機能です。request をまたいで残す値には D1 等の永続 storage を使います。通常の variable/list、broadcast、`forever` は Cloudflare Worker 用 compiler の MVP では受理しません。詳しい置換規則と compile command は [TurboWarp → Cloudflare Workers/Hono コンパイラ設計](docs/cloudflare-worker-compiler.ja.md) を参照してください。
|
|
254
|
+
|
|
239
255
|
response blocks は current request の response builder を変更し、最後に response message として完了します。
|
|
240
256
|
|
|
241
257
|
```text
|
|
@@ -260,12 +276,12 @@ bridge が未接続の場合、通常 route は `503` を返します。connecte
|
|
|
260
276
|
```text
|
|
261
277
|
TurboWarp Camera Source
|
|
262
278
|
-> 10 秒ごとに current frame を capture
|
|
263
|
-
-> Asset
|
|
279
|
+
-> Asset Cache resource "live-camera" を replace
|
|
264
280
|
-> HTTP Server が /@assets/live-camera を配信
|
|
265
281
|
-> browser が stable URL を読み込む
|
|
266
282
|
```
|
|
267
283
|
|
|
268
|
-
HTTP server は `turbowarp-camera-source` や `turbowarp-html` に依存しません。Camera Source は snapshot を作り、Asset
|
|
284
|
+
HTTP server は `turbowarp-camera-source` や `turbowarp-html` に依存しません。Camera Source は snapshot を作り、Asset Cache が named resource を所有し、HTTP Server は generic resource URL を配信します。
|
|
269
285
|
|
|
270
286
|
ブロックレベルの例:
|
|
271
287
|
|
|
@@ -289,7 +305,7 @@ end
|
|
|
289
305
|
/camera/image.jpg -> /@assets/live-camera
|
|
290
306
|
```
|
|
291
307
|
|
|
292
|
-
`turbowarp-html` で生成した HTML page が `<img>` を 10 秒ごとに refresh する構成でも、cache correctness は timestamp query string ではなく HTTP validation headers で担保します。Asset
|
|
308
|
+
`turbowarp-html` で生成した HTML page が `<img>` を 10 秒ごとに refresh する構成でも、cache correctness は timestamp query string ではなく HTTP validation headers で担保します。Asset Cache から replacement identity が得られる場合、client は stable URL を ETag で revalidate し、古い browser cache に固定されず最新 snapshot を受け取れます。
|
|
293
309
|
|
|
294
310
|
### TurboWarp extension bundle
|
|
295
311
|
|
|
@@ -304,7 +320,7 @@ end
|
|
|
304
320
|
レビューした exact version をインストールします。
|
|
305
321
|
|
|
306
322
|
```bash
|
|
307
|
-
pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.
|
|
323
|
+
pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.3.0
|
|
308
324
|
```
|
|
309
325
|
|
|
310
326
|
standalone bundle は次の場所から読み込めます。
|
|
@@ -316,7 +332,7 @@ node_modules/@kubohiroya/turbowarp-http-server/dist/turbowarp-http-server.js
|
|
|
316
332
|
version 固定の CDN URL は次の形式です。
|
|
317
333
|
|
|
318
334
|
```text
|
|
319
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.
|
|
335
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.3.0/dist/turbowarp-http-server.js
|
|
320
336
|
```
|
|
321
337
|
|
|
322
338
|
## 開発
|
|
@@ -344,3 +360,5 @@ pnpm check
|
|
|
344
360
|
## ライセンス
|
|
345
361
|
|
|
346
362
|
[Mozilla Public License 2.0](LICENSE) (SPDX: `MPL-2.0`)。
|
|
363
|
+
|
|
364
|
+
固定入力の編集範囲・互換性・切戻しについては [固定入力の編集](docs/fixed-input-editors.ja.md) を参照してください。
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# TurboWarp-HTTP-Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="assets/block-icon.svg" alt="" width="48" height="48">
|
|
4
|
+
|
|
5
|
+
English | [日本語](README.ja.md)
|
|
4
6
|
|
|
5
7
|
A companion package with both a CLI HTTP bridge server and a TurboWarp extension that connects Scratch-style block programs to that server over WebSocket.
|
|
6
8
|
|
|
@@ -36,49 +38,20 @@ From an installed package:
|
|
|
36
38
|
turbowarp-http-server --host 127.0.0.1 --port 8787
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
For an offline venue LAN, enable HTTP Digest authentication with an htdigest file:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
turbowarp-http-digest init ./users.htdigest --realm turbowarp-lan
|
|
43
|
-
turbowarp-http-digest add ./users.htdigest alice --realm turbowarp-lan
|
|
44
|
-
|
|
45
|
-
turbowarp-http-server \
|
|
46
|
-
--host 0.0.0.0 \
|
|
47
|
-
--port 8787 \
|
|
48
|
-
--auth-digest ./users.htdigest \
|
|
49
|
-
--auth-realm turbowarp-lan
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Digest authentication is intended for simple user identification on a trusted LAN where certificates and external identity providers are not available. It is disabled by default. The authenticated username is forwarded to TurboWarp handlers as the runtime-owned `x-turbowarp-http-auth-user` request header; an incoming client-supplied header with the same name is overwritten. The `/ws` endpoint is only accepted from localhost peers.
|
|
53
|
-
|
|
54
|
-
TurboWarp handlers can read authentication context with reporter blocks: `current auth type`, `current authenticated user`, `current auth provider`, `current auth profile JSON`, and `auth profile field [NAME]`. Digest authentication provides the username. OAuth-capable deployments can forward provider profile data as request auth context, and handlers can read fields such as `email`, `name`, or dotted paths like `organization.name`.
|
|
55
|
-
|
|
56
|
-
If a certificate and private key are already available, the server can run HTTPS directly:
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
turbowarp-http-server \
|
|
60
|
-
--host 0.0.0.0 \
|
|
61
|
-
--port 8787 \
|
|
62
|
-
--tls-cert ./certs/server.crt \
|
|
63
|
-
--tls-key ./certs/server.key
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Certificate issuance, renewal, distribution, and OS/browser trust configuration are outside this package. For Internet-facing deployments, terminate TLS at a reverse proxy and use the Cloudflare/OAuth deployment path for authentication.
|
|
67
|
-
|
|
68
41
|
The server exposes:
|
|
69
42
|
|
|
70
43
|
| Route | Purpose |
|
|
71
44
|
|---|---|
|
|
72
45
|
| `GET /health` | Health check |
|
|
73
46
|
| `GET /ws` | WebSocket endpoint used by the TurboWarp extension |
|
|
74
|
-
| `GET /@assets/<name>` | Serve a named Asset
|
|
47
|
+
| `GET /@assets/<name>` | Serve a named Asset Cache resource when a resource capability is attached |
|
|
75
48
|
| `HEAD /@assets/<name>` | Return the same resource metadata without a body |
|
|
76
49
|
| `PUT /@assets/<name>` | Create or atomically replace a named resource when supported |
|
|
77
50
|
| `DELETE /@assets/<name>` | Remove a named resource when supported |
|
|
78
51
|
| `GET /@assets/` | Return resource metadata without embedding binary payloads when supported |
|
|
79
52
|
| Any other HTTP route | Temporary `503 not_connected` placeholder until HTTP forwarding is implemented |
|
|
80
53
|
|
|
81
|
-
Sprite routes are a separate TurboWarp-facing layer. A Sprite named `camera` can publish `/camera`, and hiding that Sprite can disable the route. Those Sprite handlers may serve HTML, JSON, redirects, or friendly aliases such as `/camera/image.jpg`; they should call into the Asset
|
|
54
|
+
Sprite routes are a separate TurboWarp-facing layer. A Sprite named `camera` can publish `/camera`, and hiding that Sprite can disable the route. Those Sprite handlers may serve HTML, JSON, redirects, or friendly aliases such as `/camera/image.jpg`; they should call into the Asset Cache capability instead of making `@assets` a child namespace of the Sprite.
|
|
82
55
|
|
|
83
56
|
### Learning-only community server
|
|
84
57
|
|
|
@@ -134,7 +107,7 @@ The reviewed JavaScript build is committed to this repository, so users do not n
|
|
|
134
107
|
Install an exact version that you have reviewed:
|
|
135
108
|
|
|
136
109
|
```bash
|
|
137
|
-
pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.
|
|
110
|
+
pnpm add --save-exact @kubohiroya/turbowarp-http-server@0.3.0
|
|
138
111
|
```
|
|
139
112
|
|
|
140
113
|
Load the standalone bundle from:
|
|
@@ -146,7 +119,7 @@ node_modules/@kubohiroya/turbowarp-http-server/dist/turbowarp-http-server.js
|
|
|
146
119
|
A version-pinned CDN URL is:
|
|
147
120
|
|
|
148
121
|
```text
|
|
149
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.
|
|
122
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-http-server@0.3.0/dist/turbowarp-http-server.js
|
|
150
123
|
```
|
|
151
124
|
|
|
152
125
|
## Quick start
|
|
@@ -162,11 +135,11 @@ send [{"type":"ping"}] to HTTP bridge
|
|
|
162
135
|
last HTTP bridge message
|
|
163
136
|
```
|
|
164
137
|
|
|
165
|
-
## Asset
|
|
138
|
+
## Asset Cache Resource Serving
|
|
166
139
|
|
|
167
|
-
The HTTP server is camera-agnostic. It serves generic named resources supplied by an external capability, such as `turbowarp-asset-
|
|
140
|
+
The HTTP server is camera-agnostic. It serves generic named resources supplied by an external capability, such as `turbowarp-asset-cache`, without reading private extension fields or duplicating Asset Cache storage.
|
|
168
141
|
|
|
169
|
-
The generic Asset
|
|
142
|
+
The generic Asset Cache namespace is rooted at `/@assets/`. It is not owned by a Sprite route; it is managed by the background/server-side resource capability. Sprite routes can still expose friendly aliases, but the generic resource route stays global.
|
|
170
143
|
|
|
171
144
|
| Resource | HTTP route |
|
|
172
145
|
|---|---|
|
|
@@ -187,7 +160,7 @@ Resource responses include `Content-Type`, `Content-Length`, `ETag` when identit
|
|
|
187
160
|
|
|
188
161
|
`PUT` uses the request body bytes and `Content-Type` to create or replace a resource through the capability. The server enforces a configurable body-size limit before handing bytes to the capability, rejects unsupported MIME types when the capability reports them, and makes replacements visible atomically to subsequent requests. A `GET` already in progress receives the snapshot it started with.
|
|
189
162
|
|
|
190
|
-
The management namespace `/_tw-http/` is reserved and is not treated as an asset route. Paths such as `/camera/@assets/live-camera` are not generic Asset
|
|
163
|
+
The management namespace `/_tw-http/` is reserved and is not treated as an asset route. Paths such as `/camera/@assets/live-camera` are not generic Asset Cache routes; use a Scratch/TurboWarp handler to alias friendly Sprite URLs to `/@assets/<name>` when needed. Resource authorization hooks, when configured, are applied to `GET`, `HEAD`, `PUT`, `DELETE`, and listing requests. Structured resource logs include metadata such as route, resource name, MIME type, byte count, and status; they do not include binary request or response bodies.
|
|
191
164
|
|
|
192
165
|
## Sprite Route Model
|
|
193
166
|
|
|
@@ -199,7 +172,7 @@ TurboWarp-facing routes should map naturally to visible project objects:
|
|
|
199
172
|
| Sprite `camera` while visible | `/camera` |
|
|
200
173
|
| Sprite `camera` while hidden | route disabled |
|
|
201
174
|
|
|
202
|
-
This keeps Scratch interaction tangible: showing a Sprite publishes its route, and hiding it withdraws that route. Asset
|
|
175
|
+
This keeps Scratch interaction tangible: showing a Sprite publishes its route, and hiding it withdraws that route. Asset Cache resources remain global at `/@assets/<name>` so the same resource can be reused by multiple Sprite routes without duplicating storage.
|
|
203
176
|
|
|
204
177
|
A live camera page can therefore be modeled as:
|
|
205
178
|
|
|
@@ -215,7 +188,7 @@ GET /camera/image.jpg
|
|
|
215
188
|
-> friendly handler/alias that serves /@assets/live-camera
|
|
216
189
|
```
|
|
217
190
|
|
|
218
|
-
In other words, `/camera/image.jpg` is a Sprite route decision, while `/@assets/live-camera` is the generic Asset
|
|
191
|
+
In other words, `/camera/image.jpg` is a Sprite route decision, while `/@assets/live-camera` is the generic Asset Cache resource endpoint.
|
|
219
192
|
|
|
220
193
|
## Response Content Builders
|
|
221
194
|
|
|
@@ -305,12 +278,12 @@ For low-frequency camera publishing, compose three independent pieces:
|
|
|
305
278
|
```text
|
|
306
279
|
TurboWarp Camera Source
|
|
307
280
|
-> capture current frame every 10 seconds
|
|
308
|
-
-> replace Asset
|
|
281
|
+
-> replace Asset Cache resource "live-camera"
|
|
309
282
|
-> HTTP Server serves /@assets/live-camera
|
|
310
283
|
-> browser loads the stable URL
|
|
311
284
|
```
|
|
312
285
|
|
|
313
|
-
The HTTP server does not depend on `turbowarp-camera-source` or `turbowarp-html`. Camera Source only produces snapshots; Asset
|
|
286
|
+
The HTTP server does not depend on `turbowarp-camera-source` or `turbowarp-html`. Camera Source only produces snapshots; Asset Cache owns the named resource; HTTP Server serves the generic resource URL.
|
|
314
287
|
|
|
315
288
|
Example block-level flow:
|
|
316
289
|
|
|
@@ -334,7 +307,7 @@ If a friendlier URL is desired, a Scratch/TurboWarp route handler can alias:
|
|
|
334
307
|
/camera/image.jpg -> /@assets/live-camera
|
|
335
308
|
```
|
|
336
309
|
|
|
337
|
-
An HTML page generated by `turbowarp-html` can refresh an `<img>` every 10 seconds, but cache correctness should come from HTTP validation headers, not timestamp query strings. With replacement identities from Asset
|
|
310
|
+
An HTML page generated by `turbowarp-html` can refresh an `<img>` every 10 seconds, but cache correctness should come from HTTP validation headers, not timestamp query strings. With replacement identities from Asset Cache, clients can revalidate the stable URL using ETag and receive the newest snapshot without stale browser cache behavior.
|
|
338
311
|
|
|
339
312
|
## Block reference
|
|
340
313
|
|
|
@@ -510,6 +483,76 @@ Returns the current request client address when available.
|
|
|
510
483
|
| Type | Reporter |
|
|
511
484
|
| Opcode | `currentRequestClientAddress` |
|
|
512
485
|
|
|
486
|
+
### `set handler variable [NAME] to [VALUE]`
|
|
487
|
+
|
|
488
|
+
Sets a request-local variable that is discarded when the current HTTP response completes.
|
|
489
|
+
|
|
490
|
+
| Property | Value |
|
|
491
|
+
|---|---|
|
|
492
|
+
| Type | Command |
|
|
493
|
+
| Opcode | `setHandlerVariable` |
|
|
494
|
+
| `NAME` | String, default: `value` |
|
|
495
|
+
| `VALUE` | String, default: `0` |
|
|
496
|
+
|
|
497
|
+
### `change handler variable [NAME] by [AMOUNT]`
|
|
498
|
+
|
|
499
|
+
Changes a request-local numeric variable using Scratch number conversion rules.
|
|
500
|
+
|
|
501
|
+
| Property | Value |
|
|
502
|
+
|---|---|
|
|
503
|
+
| Type | Command |
|
|
504
|
+
| Opcode | `changeHandlerVariable` |
|
|
505
|
+
| `NAME` | String, default: `value` |
|
|
506
|
+
| `AMOUNT` | Number, default: `1` |
|
|
507
|
+
|
|
508
|
+
### `handler variable [NAME]`
|
|
509
|
+
|
|
510
|
+
Returns a request-local handler variable, or an empty string when it does not exist.
|
|
511
|
+
|
|
512
|
+
| Property | Value |
|
|
513
|
+
|---|---|
|
|
514
|
+
| Type | Reporter |
|
|
515
|
+
| Opcode | `handlerVariable` |
|
|
516
|
+
| `NAME` | String, default: `value` |
|
|
517
|
+
|
|
518
|
+
### `handler variable [NAME] exists?`
|
|
519
|
+
|
|
520
|
+
Reports whether a request-local handler variable exists.
|
|
521
|
+
|
|
522
|
+
| Property | Value |
|
|
523
|
+
|---|---|
|
|
524
|
+
| Type | Boolean |
|
|
525
|
+
| Opcode | `handlerVariableExists` |
|
|
526
|
+
| `NAME` | String, default: `value` |
|
|
527
|
+
|
|
528
|
+
### `delete handler variable [NAME]`
|
|
529
|
+
|
|
530
|
+
Deletes a request-local handler variable.
|
|
531
|
+
|
|
532
|
+
| Property | Value |
|
|
533
|
+
|---|---|
|
|
534
|
+
| Type | Command |
|
|
535
|
+
| Opcode | `deleteHandlerVariable` |
|
|
536
|
+
| `NAME` | String, default: `value` |
|
|
537
|
+
|
|
538
|
+
### `delete all handler variables`
|
|
539
|
+
|
|
540
|
+
Deletes all request-local handler variables for the current HTTP handler.
|
|
541
|
+
|
|
542
|
+
| Property | Value |
|
|
543
|
+
|---|---|
|
|
544
|
+
| Type | Command |
|
|
545
|
+
| Opcode | `clearHandlerVariables` |
|
|
546
|
+
|
|
547
|
+
### `active handler variables`
|
|
548
|
+
|
|
549
|
+
Returns comma-separated names of request-local handler variables.
|
|
550
|
+
|
|
551
|
+
| Property | Value |
|
|
552
|
+
|---|---|
|
|
553
|
+
| Type | Reporter |
|
|
554
|
+
| Opcode | `listHandlerVariables` |
|
|
555
|
+
|
|
513
556
|
### `current auth type`
|
|
514
557
|
|
|
515
558
|
Returns the current authentication type, such as digest or oauth.
|
|
@@ -656,6 +699,22 @@ Responds with JSON.
|
|
|
656
699
|
| Opcode | `respondWithJson` |
|
|
657
700
|
| `BODY` | String, default: `{"ok":true}` |
|
|
658
701
|
|
|
702
|
+
### `respond with named [NAMESPACE] [NAME] kind [KIND] scope [SCOPE] target [TARGET_ID] as [REPRESENTATION] max bytes [MAX_BYTES]`
|
|
703
|
+
|
|
704
|
+
Completes the response with a named structured, document, binary, or asset snapshot resolved by the server.
|
|
705
|
+
|
|
706
|
+
| Property | Value |
|
|
707
|
+
|---|---|
|
|
708
|
+
| Type | Command |
|
|
709
|
+
| Opcode | `respondWithNamedBody` |
|
|
710
|
+
| `NAMESPACE` | String, default: `asset` |
|
|
711
|
+
| `NAME` | String, default: `avatar` |
|
|
712
|
+
| `KIND` | String, default: `asset` |
|
|
713
|
+
| `SCOPE` | String, default: `project` |
|
|
714
|
+
| `TARGET_ID` | String, default: `Stage:1` |
|
|
715
|
+
| `REPRESENTATION` | String, default: `raw` |
|
|
716
|
+
| `MAX_BYTES` | Number, default: `10485760` |
|
|
717
|
+
|
|
659
718
|
### `record HTTP log [ENTRY]`
|
|
660
719
|
|
|
661
720
|
Adds a structured HTTP log entry JSON string to the extension log buffer.
|
|
@@ -872,3 +931,5 @@ Useful commands:
|
|
|
872
931
|
## License
|
|
873
932
|
|
|
874
933
|
[Mozilla Public License 2.0](LICENSE) (SPDX: `MPL-2.0`).
|
|
934
|
+
|
|
935
|
+
固定入力の編集範囲・互換性・切戻しについては [固定入力の編集](docs/fixed-input-editors.ja.md) を参照してください。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M28.0 27.0L28.0 5.0M28.0 27.0L43.6 11.4M28.0 27.0L50.0 27.0M28.0 27.0L43.6 42.6M28.0 27.0L28.0 49.0M28.0 27.0L12.4 42.6M28.0 27.0L6.0 27.0M28.0 27.0L12.4 11.4" stroke="#2563EB" stroke-width="1.04" stroke-linecap="round"/><path d="M28.0 10.0L40.0 15.0L45.0 27.0L40.0 39.0L28.0 44.0L16.0 39.0L11.0 27.0L16.0 15.0Z" fill="none" stroke="#2563EB" stroke-width="1.3" stroke-linejoin="round"/><path d="M22.5 21h11.5l7 7v14.5a2 2 0 0 1-2 2H22.5a2 2 0 0 1-2-2V23a2 2 0 0 1 2-2z" fill="#fff" stroke="#16305C" stroke-width="2.4" stroke-linejoin="round"/><path d="M34 21v7h7" fill="none" stroke="#16305C" stroke-width="2.4" stroke-linejoin="round"/><path d="M25.5 33.5h9.5M25.5 39.5h4.5" stroke="#16305C" stroke-width="2.2" stroke-linecap="round"/><path d="M14 0V8.0" stroke="#16305C" stroke-width="1.5" stroke-linecap="round"/><path d="M12.3 8.5L6.1 6.9L3.1 2.9M15.7 8.5L21.9 6.9L24.9 2.9M12.3 10.0L5.4 9.9L2.1 6.9M15.7 10.0L22.6 9.9L25.9 6.9M12.3 11.8L5.4 11.9L2.1 14.9M15.7 11.8L22.6 11.9L25.9 14.9M12.3 13.3L6.1 14.9L3.1 18.9M15.7 13.3L21.9 14.9L24.9 18.9" fill="none" stroke="#16305C" stroke-width="1.05" stroke-linecap="round" stroke-linejoin="round"/><circle cx="14" cy="10.9" r="3.4" fill="#16305C"/><circle cx="14" cy="15.1" r="2.3" fill="#16305C"/></svg>
|
package/dist/cli.js
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { HtdigestFile } from './auth/digest-file.js';
|
|
3
3
|
import { startServer } from './server.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
console.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import { compileToDirectory } from './compiler/index.js';
|
|
5
|
+
void main(process.argv.slice(2)).catch((error) => {
|
|
6
|
+
console.error(error instanceof Error ? error.message : error);
|
|
7
|
+
process.exitCode = 1;
|
|
8
|
+
});
|
|
9
|
+
async function main(args) {
|
|
10
|
+
if (args[0] === 'compile') {
|
|
11
|
+
const options = parseCompileArgs(args.slice(1));
|
|
12
|
+
const result = await compileToDirectory(options);
|
|
13
|
+
for (const diagnostic of result.diagnostics) {
|
|
14
|
+
console.warn(`[${diagnostic.code}] ${diagnostic.message}`);
|
|
15
|
+
}
|
|
16
|
+
console.log(`Generated ${result.files.length} files in ${options.output}.`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const options = parseArgs(args);
|
|
20
|
+
const server = startServer(toServerOptions(options));
|
|
21
|
+
console.log(`turbowarp-http-server listening on ${options.tlsCert ? 'https' : 'http'}://${server.hostname}:${server.port}`);
|
|
22
|
+
function shutdown(signal) {
|
|
23
|
+
console.log(`Received ${signal}; shutting down.`);
|
|
24
|
+
server
|
|
25
|
+
.close()
|
|
26
|
+
.catch((error) => {
|
|
27
|
+
console.error(error);
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
})
|
|
30
|
+
.finally(() => {
|
|
31
|
+
process.exit();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
35
|
+
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
18
36
|
}
|
|
19
|
-
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
20
|
-
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
21
37
|
function parseArgs(args) {
|
|
22
38
|
const options = {
|
|
23
39
|
hostname: process.env.HOST ?? '127.0.0.1',
|
|
@@ -49,6 +65,9 @@ function parseArgs(args) {
|
|
|
49
65
|
else if (arg === '--community') {
|
|
50
66
|
options.community = {};
|
|
51
67
|
}
|
|
68
|
+
else if (arg === '--enable-named-response-body') {
|
|
69
|
+
options.namedResponseBody = true;
|
|
70
|
+
}
|
|
52
71
|
else if (arg === '--auth-digest') {
|
|
53
72
|
options.authDigestFile = requireValue(args, index, '--auth-digest');
|
|
54
73
|
index += 1;
|
|
@@ -84,6 +103,78 @@ function parseArgs(args) {
|
|
|
84
103
|
}
|
|
85
104
|
return options;
|
|
86
105
|
}
|
|
106
|
+
function parseCompileArgs(args) {
|
|
107
|
+
let input = '';
|
|
108
|
+
let output = '';
|
|
109
|
+
let format = 'turbowarp-json';
|
|
110
|
+
let force = false;
|
|
111
|
+
let target;
|
|
112
|
+
let targetConfig;
|
|
113
|
+
let manifestLock;
|
|
114
|
+
let namedResponseBody = false;
|
|
115
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
116
|
+
const arg = args[index];
|
|
117
|
+
if (arg === '--input') {
|
|
118
|
+
input = requireValue(args, index, '--input');
|
|
119
|
+
index += 1;
|
|
120
|
+
}
|
|
121
|
+
else if (arg === '--output') {
|
|
122
|
+
output = requireValue(args, index, '--output');
|
|
123
|
+
index += 1;
|
|
124
|
+
}
|
|
125
|
+
else if (arg === '--format') {
|
|
126
|
+
const value = requireValue(args, index, '--format');
|
|
127
|
+
if (value !== 'turbowarp-json' && value !== 'ir')
|
|
128
|
+
throw new Error(`Invalid format: ${value}`);
|
|
129
|
+
format = value;
|
|
130
|
+
index += 1;
|
|
131
|
+
}
|
|
132
|
+
else if (arg === '--force') {
|
|
133
|
+
force = true;
|
|
134
|
+
}
|
|
135
|
+
else if (arg === '--target') {
|
|
136
|
+
target = requireValue(args, index, '--target');
|
|
137
|
+
index += 1;
|
|
138
|
+
}
|
|
139
|
+
else if (arg === '--target-config') {
|
|
140
|
+
targetConfig = requireValue(args, index, '--target-config');
|
|
141
|
+
index += 1;
|
|
142
|
+
}
|
|
143
|
+
else if (arg === '--manifest-lock') {
|
|
144
|
+
manifestLock = requireValue(args, index, '--manifest-lock');
|
|
145
|
+
index += 1;
|
|
146
|
+
}
|
|
147
|
+
else if (arg === '--enable-named-response-body') {
|
|
148
|
+
namedResponseBody = true;
|
|
149
|
+
}
|
|
150
|
+
else if (arg === '--help' || arg === '-h') {
|
|
151
|
+
printCompileHelp();
|
|
152
|
+
process.exit(0);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
throw new Error(`Unknown compile argument: ${arg}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (!input)
|
|
159
|
+
throw new Error('compile requires --input <file>.');
|
|
160
|
+
if (!output)
|
|
161
|
+
throw new Error('compile requires --output <directory>.');
|
|
162
|
+
if (target === undefined)
|
|
163
|
+
throw new Error('compile requires --target <id>.');
|
|
164
|
+
if (manifestLock !== undefined && format !== 'turbowarp-json') {
|
|
165
|
+
throw new Error('--manifest-lock requires --format turbowarp-json.');
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
input,
|
|
169
|
+
output,
|
|
170
|
+
format,
|
|
171
|
+
force,
|
|
172
|
+
target,
|
|
173
|
+
namedResponseBody,
|
|
174
|
+
...(targetConfig === undefined ? {} : { targetConfig }),
|
|
175
|
+
...(manifestLock === undefined ? {} : { manifestLock })
|
|
176
|
+
};
|
|
177
|
+
}
|
|
87
178
|
function toServerOptions(options) {
|
|
88
179
|
const serverOptions = {
|
|
89
180
|
hostname: options.hostname,
|
|
@@ -91,6 +182,9 @@ function toServerOptions(options) {
|
|
|
91
182
|
};
|
|
92
183
|
if (options.community !== undefined)
|
|
93
184
|
serverOptions.community = options.community;
|
|
185
|
+
if (options.namedResponseBody !== undefined) {
|
|
186
|
+
serverOptions.namedResponseBody = options.namedResponseBody;
|
|
187
|
+
}
|
|
94
188
|
const digestAuth = toDigestAuthOptions(options);
|
|
95
189
|
if (digestAuth)
|
|
96
190
|
serverOptions.digestAuth = digestAuth;
|
|
@@ -128,7 +222,9 @@ function isTruthy(value) {
|
|
|
128
222
|
return value === '1' || value === 'true' || value === 'yes';
|
|
129
223
|
}
|
|
130
224
|
function printHelp() {
|
|
131
|
-
console.log(`Usage:
|
|
225
|
+
console.log(`Usage:
|
|
226
|
+
turbowarp-http-server [--host <host>] [--port <port>]
|
|
227
|
+
turbowarp-http-server compile --input <file> --output <directory> [options]
|
|
132
228
|
|
|
133
229
|
Starts the companion HTTP/WebSocket bridge for the TurboWarp extension.
|
|
134
230
|
|
|
@@ -136,6 +232,7 @@ Options:
|
|
|
136
232
|
--host <host> Hostname or address to bind. Defaults to HOST or 127.0.0.1.
|
|
137
233
|
--port <port> TCP port to bind. Defaults to PORT or 8787.
|
|
138
234
|
--community Enable the learning-only Scratch-like community routes.
|
|
235
|
+
--enable-named-response-body Enable experimental named response blocks (default OFF).
|
|
139
236
|
--auth-digest <file>
|
|
140
237
|
Enable HTTP Digest authentication using an htdigest file.
|
|
141
238
|
--auth-realm <realm>
|
|
@@ -153,4 +250,21 @@ Environment:
|
|
|
153
250
|
TURBOWARP_HTTP_TLS_KEY
|
|
154
251
|
`);
|
|
155
252
|
}
|
|
253
|
+
function printCompileHelp() {
|
|
254
|
+
console.log(`Usage: turbowarp-http-server compile --input <file> --output <directory> [options]
|
|
255
|
+
|
|
256
|
+
Compiles an accepted TurboWarp project.json subset or deploy IR to Hono deployment artifacts.
|
|
257
|
+
|
|
258
|
+
Options:
|
|
259
|
+
--input <file> TurboWarp project.json or deploy IR JSON.
|
|
260
|
+
--output <directory> Generated project directory.
|
|
261
|
+
--format <format> turbowarp-json (default) or ir.
|
|
262
|
+
--target <id> Required deployment target; for example cloudflare-workers.
|
|
263
|
+
--target-config <file> Adapter config containing binding names, never secrets.
|
|
264
|
+
--manifest-lock <file> Locked extension manifests for TurboWarp project input.
|
|
265
|
+
--enable-named-response-body Enable the experimental named body IR operation (default OFF).
|
|
266
|
+
--force Replace generated files in a non-empty output directory.
|
|
267
|
+
-h, --help Show this help.
|
|
268
|
+
`);
|
|
269
|
+
}
|
|
156
270
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAExC,OAAO,EAAC,kBAAkB,EAA2B,MAAM,qBAAqB,CAAC;AAajF,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACxD,OAAO,CAAC,KAAK,C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