@deslop/gateway 0.1.1259 → 0.1.1261
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.md +3 -14
- package/dist/client/assets/{(home)-DYFhl_K7.js → (home)-B-lmVWI2.js} +6 -6
- package/dist/client/assets/effect-DmsZG62Z.js +17 -0
- package/dist/client/assets/index-DWNgL0cx.js +3 -0
- package/dist/client/index.html +2 -2
- package/dist/server.js +82 -40
- package/package.json +2 -2
- package/dist/client/assets/effect-CmAQ3NBe.js +0 -17
- package/dist/client/assets/index-DXPokkvI.js +0 -3
package/README.md
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
# Gateway
|
|
2
2
|
|
|
3
|
-
One MCP endpoint for every MCP server you connect; add servers on its page.
|
|
4
|
-
|
|
5
3
|
```bash
|
|
6
4
|
npm install --global @deslop/gateway
|
|
7
5
|
gateway service install --url https://gateway.mp281x.xyz --auth https://auth.mp281x.xyz --admins <github-id>
|
|
8
6
|
```
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
- **Admins** (`--admins`) add and connect servers; everyone signed in shares them.
|
|
12
|
-
- **Deslop servers** name Auth in their protected-resource metadata and take the caller's own access token for discovery and calls, without Connect or stored tokens. Only third-party OAuth servers keep the Connect flow.
|
|
13
|
-
- **Own tool**: `list_mcp_connections` explains a missing or failing server.
|
|
8
|
+
Register only `https://<gateway>/mcp` in each harness. Admins add and connect servers; everyone signed in shares them. AI keys and usage belong to each person, as described in this app's `AGENTS.md`.
|
|
14
9
|
|
|
15
10
|
## AI proxy
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
App servers start with `--gateway https://gateway.mp281x.xyz`. Every AI call sends the person's signed access JWT; Gateway verifies it and records its `azp` client label as the app. No app-specific credential is issued. Without `--auth`, calls use the local developer.
|
|
20
|
-
|
|
21
|
-
Use `AiGateway` from `@deslop/runtime/ai`: `yield* gateway.apiUrl(provider)` and pass `yield* gateway.authorize(userId)` as the provider client's **construction-time** `transformClient`. The runtime prefers the person's freshest server-side session, refreshing it when needed, then a recently verified bearer with at least 60 seconds left. Otherwise it asks the person to open the app once. OpenRouter's scoped `withClientTransform` does not cover streaming chat completions. OpenRouter's base includes `/v1`; its Decisions client derives `/alpha/decisions` correctly. OpenCode bases expose protocol-family paths such as `/openai/v1/chat/completions` and `/anthropic/v1/messages` without translating them.
|
|
22
|
-
|
|
23
|
-
`/ai/<provider>/<rest>` forwards method, query, body and upstream status. Fetch decodes compressed responses; stale encoding and length headers, hop-by-hop headers and headers nominated by `Connection` are removed from the streamed answer. Caller credentials and hop-by-hop headers are removed before inserting the person's provider key. Missing keys return HTTP 402 with instructions to add a key in Gateway. JSON and SSE usage is metered asynchronously; provider-reported cost wins, then daily-cached models.dev prices, otherwise cost remains unknown. Usage is stored per person and UTC month.
|
|
12
|
+
App servers start with `--gateway https://gateway.mp281x.xyz`.
|
|
24
13
|
|
|
25
|
-
|
|
14
|
+
Use `AiGateway` from `@deslop/runtime/ai`: `yield* gateway.apiUrl(provider)` and pass `yield* gateway.authorize(userId)` as the provider client's **construction-time** `transformClient`. OpenRouter's scoped `withClientTransform` does not cover streaming chat completions.
|
|
26
15
|
|
|
27
16
|
Common flags and service commands: [Deslop app runtime](https://github.com/MP281X/deslop/blob/main/packages/runtime/README.md).
|