@deslop/gateway 0.1.1256 → 0.1.1258
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 +4 -3
- package/dist/client/assets/(home)-DYFhl_K7.js +105 -0
- package/dist/client/assets/effect-CmAQ3NBe.js +17 -0
- package/dist/client/assets/index-DXPokkvI.js +3 -0
- package/dist/client/index.html +2 -2
- package/dist/server.js +3025 -1040
- package/package.json +2 -2
- package/dist/client/assets/(home)-B-NW7KgU.js +0 -105
- package/dist/client/assets/effect-D6ghd3zA.js +0 -17
- package/dist/client/assets/index-CyhWsnqH.js +0 -3
package/README.md
CHANGED
|
@@ -9,18 +9,19 @@ gateway service install --url https://gateway.mp281x.xyz --auth https://auth.mp2
|
|
|
9
9
|
|
|
10
10
|
- **Register** only `https://<gateway>/mcp` in each harness; tools are named `<server>__<tool>`.
|
|
11
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.
|
|
12
13
|
- **Own tool**: `list_mcp_connections` explains a missing or failing server.
|
|
13
14
|
|
|
14
15
|
## AI proxy
|
|
15
16
|
|
|
16
17
|
Each person manages their own Anthropic, OpenRouter, OpenCode Zen and OpenCode Go keys. Keys stay in Gateway's owner-only data files; only their last four characters and last upstream status leave the server.
|
|
17
18
|
|
|
18
|
-
App servers start with `--gateway https://gateway.mp281x.xyz`.
|
|
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.
|
|
19
20
|
|
|
20
|
-
Use `AiGateway` from `@deslop/runtime/ai`: `yield* gateway.apiUrl(provider)` and pass `gateway.authorize(userId)` as the provider client's **construction-time** `transformClient`. 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.
|
|
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.
|
|
21
22
|
|
|
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.
|
|
23
24
|
|
|
24
|
-
Person-scoped RPCs: `ai.keys`, `ai.setKey`, `ai.removeKey`, `ai.
|
|
25
|
+
Person-scoped RPCs: `ai.keys`, `ai.setKey`, `ai.removeKey`, `ai.usage`. Usage queries take epoch-millisecond `from` (inclusive), `to` (exclusive), and `bucket` (`hour` or `day`); `AiUsageReport` returns token/cost totals, UTC buckets split by app and model, and breakdowns by app, model and provider. `unknownCostCalls` distinguishes unknown cost from zero cost.
|
|
25
26
|
|
|
26
27
|
Common flags and service commands: [Deslop app runtime](https://github.com/MP281X/deslop/blob/main/packages/runtime/README.md).
|