dsh-aperture 0.3.3 → 0.4.1

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.en.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-aperture
2
2
 
3
- Discover the models an [Aperture](https://tailscale.com/kb/1542/aperture) gateway serves, and publish them to DeepSeek Harness as `llm-pi-ai` provider routes — so they simply appear in the model selector. Once installed, one Aperture address is all you configure.
3
+ Discover the models an [Aperture](https://tailscale.com/kb/1542/aperture) gateway serves and, by the endpoint each one answers on, register them as this plugin's own provider routes in DeepSeek Harness — so they simply appear in the model selector. Once installed, one Aperture address is all you configure.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,19 +8,18 @@ Requirements: Node ^22.19.0 or ≥24.0.0 (matching DSH), and an Aperture instanc
8
8
 
9
9
  ### 1. Add the plugin
10
10
 
11
- From [npm](https://www.npmjs.com/package/dsh-aperture) (recommended):
12
-
13
11
  ```sh
12
+ # npm (recommended): the published artifact ships a compiled lib/, so no build script has to be authorized
14
13
  npx @deepseek-ai/dsh plugin --profile web add dsh-aperture
15
- ```
16
-
17
- The published artifact ships a compiled `lib/`, so no build script has to be authorized. To pin a commit, or to follow unreleased changes, install from git:
18
14
 
19
- ```sh
15
+ # git: pulls source, compiled by a prepare script during install; pins a commit
20
16
  npx @deepseek-ai/dsh plugin --profile web add github:he0119/dsh-aperture#<sha>
17
+
18
+ # a local checkout: run pnpm run build first
19
+ npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-aperture
21
20
  ```
22
21
 
23
- A git install pulls **source**, compiled by a `prepare` script during install. pnpm ≥10 refuses to run a git dependency's build scripts until it is explicitly allowed, so **the first `add` fails**: dsh prints the package key you need, which you write into the profile's `pnpm-workspace.yaml` before running `add` again.
22
+ pnpm ≥10 refuses to run a git dependency's build scripts, so the git line **fails the first time**: dsh prints the package key you need, which you write into the profile's `pnpm-workspace.yaml` before running it again (the key takes the **map** form with `true`).
24
23
 
25
24
  ```yaml
26
25
  # ~/.dsh/profiles/web/pnpm-workspace.yaml
@@ -28,16 +27,8 @@ allowBuilds:
28
27
  dsh-aperture: true
29
28
  ```
30
29
 
31
- (The key takes the **map** form with `true`; a list is not accepted.)
32
-
33
30
  > That authorization lets this package run code on your machine at install time, outside any agent sandbox. Authorize only source you trust.
34
31
 
35
- When editing the code locally, install the checkout directory instead (run `pnpm run build` first):
36
-
37
- ```sh
38
- npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-aperture
39
- ```
40
-
41
32
  ### 2. Point it at your instance
42
33
 
43
34
  ```yaml
@@ -47,7 +38,7 @@ npx @deepseek-ai/dsh plugin --profile web add /path/to/dsh-aperture
47
38
  baseUrl: https://ai.example.ts.net
48
39
  ```
49
40
 
50
- This layer (the profile patch document, i.e. the user layer) is this plugin's settings namespace, `aperture`. Patch layers **replace the whole row** rather than deep-merging — this row's `config` supersedes the `cordis.patch.yml` this package ships (the composition layer) outright, and since the composition row only declares the row and writes no `config`, what you write is all there is; every key's default lives in the schema, so keys you leave out fall back to the defaults. You can also fill it in from the GUI: on the **Plugins** page open this package, and the first field of its configuration page ("Instance address") writes the same `aperture.baseUrl`; saving lands in the same file.
41
+ This row is the plugin's settings namespace, `aperture`. Patch layers **replace the whole row** rather than deep-merging: what you write is all there is, and keys you leave out fall back to the schema's defaults. You can also fill it in from the GUI: on the **Plugins** page open this package, and its "Instance address" writes the same `aperture.baseUrl`; saving lands in the same file.
51
42
 
52
43
  ### 3. Restart DSH
53
44
 
@@ -59,161 +50,138 @@ npx @deepseek-ai/dsh --profile web --dump-config # should show a "# == dsh-ape
59
50
 
60
51
  ### 4. Confirm
61
52
 
62
- The models appear in the selector under the route `Aperture`. This package's configuration page at **Plugins → dsh-aperture** is that page — the instance address and sync toggle on top, one row per discovered model below.
63
-
64
- ```
65
- Instance address Overridden Reset to default
66
- [https://ai.example.ts.net ]
67
- Where Aperture listens; leave it empty to go dormant and stop discovering models.
68
-
69
- Sync automatically Overridden Reset to default ●━
70
- After each discovery round, write the models into dsh's llm-pi-ai routes. [Save]
53
+ The models appear in the selector under the route `Aperture`. The interface lives in two places:
71
54
 
72
- Saved: rediscovered and published.
73
-
74
- Models 18 ⟳ Refresh now
75
- One model per row; expand a row to edit its overrides, and Save writes only that row. The order comes from discovery, with anything no route can serve last.
76
-
77
- ● deepseek-v4-flash
78
- route aperture · protocol openai-completions · context 1,048,576 · output 384,000 · modalities text+image · reasoning on · 1 overridden
79
- ● gemini-2.5-flash
80
- route aperture · protocol openai-completions · context 128,000 · modalities text · reasoning off
81
- ● qwen3-vl-32b unserved
82
- context 262,144 · modalities text+image · reasoning on
83
-
84
- (expand a row and you get that row's override editor: name and protocol in one group, capacity in another,
85
- modalities beside reasoning, and Save / Clear overrides / Cancel underneath)
86
- ```
55
+ - **Plugins → dsh-aperture**: the instance address, the registration toggle and "Refresh now". The settings page hangs off the package, so there is no separate Configure button.
56
+ - **Settings → Models**: every route this plugin registers is one row on that page, and the row carries a **collapsed** model list — unfold it to get the models that route really serves and the per-model override editor (display name, catalog alias, protocol, capacity, input types, reasoning). Models no route can serve take up no seat there; the Plugins page says one sentence about them: how many, which ones, and where to give them a protocol.
87
57
 
88
- **The instance address and the sync toggle** are two fields of one official settings form: where a field says "Overridden", a "Reset to default" right beside it drops that key from your settings file (the same two words in the same position as the official plugin-config page), and Save writes only the fields you actually changed. The per-model override editor is covered under [Usage](#usage). Headings and spacing separate the groups, while a model row is a card (a hairline outline with a large radius, coloured only with theme tokens this page really defines), and the only thing you can expand is a model row.
89
-
90
- (English labels are shown above; the page itself is bilingual.)
58
+ How the interface is laid out, and where each limit comes from, is in [docs/internals.md](https://github.com/he0119/dsh-aperture/blob/main/docs/internals.md) (Chinese).
91
59
 
92
60
  ## Usage
93
61
 
94
- The interface is at **Plugins → dsh-aperture**: open this plugin in the plugin list; the configuration page hangs off the package, so there is no separate Configure button. The page header's name, icon and description come from the package's `locale/*.json` and `package.json`'s `icon`; the page itself is drawn by the Plugins page. The address, the toggle and the per-model parameters stay drafts until you press Save; models are **one row at a time**, and collapsing a row does not throw its draft away — the "unsaved edits" tag stays visible.
62
+ The address, the toggle and the per-model parameters stay drafts until you press Save; models are **one row at a time**, and collapsing a row does not throw its draft away.
95
63
 
96
- | Where | Effect |
97
- | --- | --- |
98
- | Configuration page · Instance address | edits `baseUrl` (written through the settings seam; when it says "Overridden", the "Reset to default" beside it falls back to the default) |
99
- | Configuration page · Sync toggle | edits `sync`: off discovers without writing `llm-pi-ai`, and that round withdraws whatever this plugin had published (only the three keys it owns; every other provider in the section is left alone); carries the same "Overridden / Reset to default" pair |
100
- | Configuration page · Save | below the form: writes the address and toggle drafts into the settings document; it is revision-fenced, so a form that has drifted from the settings document is refused rather than overwriting someone else's edit; it returns only once that round of re-discovery has landed, so the interface shows the new configuration right away |
101
- | Configuration page · Models | one row per model, one card per row: a state dot at its head (green: this round wrote it into the routes; grey: this round synced but did not write it; amber: no route can serve it — hovering it, or a screen reader, hears exactly that), then the name with its "unserved / N overridden / unsaved edits" tags on the first line and labelled facts (route, protocol, capacities, modalities, reasoning, alias) on the second, with long names ellipsised and facts wrapping; expanded, it is that row's override editor — display name, alias and protocol as one group of text fields, context window and max output as the "capacity" group, and two modality checkboxes beside a three-way reasoning switch (follow discovery / on / off); a field keeps only one line naming where its value comes from ("Source: Aperture"), while how-to copy ("Leave it empty to use the discovered name") lives behind the "i" next to the label and only takes up room once opened; the "Refresh now" action at its top right discovers and republishes immediately, and the list and every row's status follow that round |
102
- | Configuration page · Save / Clear overrides / Cancel | write that row only, clear only the fields the backend report says really were overridden, or drop that row's draft; Save likewise waits for a round of re-discovery, so what you see afterwards is the new value |
64
+ - **Plugins page · instance address and registration toggle**: Save writes only the fields you actually changed, and a form that has drifted from the settings document is refused rather than overwriting someone else's edit; where a field says "overridden", the "Reset to default" beside it drops that key from your settings file (the same two words in the same position as the official plugin-config page).
65
+ - **Plugins page · Refresh now**: writes no settings and simply runs one round of discovery and registration; success, or the reason it failed, lands on the same page.
66
+ - **Plugins page · registration toggle**: off discovers without registering — that round withdraws the three routes this plugin had registered, while routes of the same name registered elsewhere are left alone.
67
+ - **Models page · Save / Clear overrides / Cancel**: write that row only; clear only the fields the backend report says really were overridden; or drop that row's draft. Save likewise waits for a round of re-discovery, so what you see afterwards is the new value.
68
+ - **Capacities**: accept the `1M` / `100K` spelling (decimal suffixes: `1M` is 1000000, not 1048576); an emptied field drops that override and falls back to discovery and the catalog.
103
69
 
104
- In-place edits are configuration: capacities and modalities land on the matching `aperture.models` entry, the catalog alias lands on `aperture.modelAliases[id]`, and writes merge per field — a field the interface never mentions (say `reasoningEfforts`) survives untouched, while an emptied field drops that override and falls back to discovery and the catalog. Capacities accept the `1M` / `100K` spelling (decimal suffixes, the same vocabulary as the official Models page: `1M` is 1000000, not 1048576); what gets stored is still a plain token count, and the field spells it back in the shortest form that survives a round trip (`384000` → `384K`, while `1048576` is not a whole thousand and stays written out). The protocol field is the only way out for an unserved model: filling it in publishes a model that only answers on its native endpoint under the matching route.
70
+ In-place edits are configuration: capacities and input types land on the matching `aperture.models` entry, the catalog alias lands on `aperture.modelAliases[id]`, and writes merge per field — a field the interface never mentions (say `reasoningEfforts`) survives untouched.
105
71
 
106
72
  ## Configuration
107
73
 
108
- Every key lives under that row's `config:` in the profile patch document (user layer); anything you leave out falls back to the defaults below. `baseUrl`, `sync` and the per-model parameters inside `models` and `modelAliases` can also be edited in place on the configuration page; every other key needs the file.
74
+ Every key lives under that row's `config:` in the profile patch document; anything you leave out falls back to the defaults below (a `—` in the Default column means the key has no default: leaving it out leaves it absent). `baseUrl` and `sync` can be edited in place on the Plugins page, and the per-model parameters inside `models` and `modelAliases` on the Settings → Models page; every other key needs the file.
109
75
 
110
76
  | Key | Default | Meaning |
111
77
  | --- | --- | --- |
112
- | `baseUrl` | `''` | Aperture instance root. A trailing `/v1` is tolerated and stripped; empty leaves the plugin dormant |
113
- | `route` | `aperture` | Route key for Chat Completions models; Responses and Anthropic append `-responses` and `-anthropic`, with all three selector labels derived from it |
114
- | `apiKeyEnv` | `''` | Credential-seam reference; non-empty suppresses the placeholder header |
115
- | `headers` | `{}` | Extra request headers; they **win over** the placeholder |
78
+ | `baseUrl` | `''` | Aperture instance root. A trailing `/v1` is tolerated and stripped; empty leaves the plugin dormant (no discovery, no registration) |
79
+ | `routePrefix` | `aperture` | Common prefix of the three route names: a route key is the prefix plus its protocol name in lowercase with dashes (`aperture-openai-chat-completions`, `aperture-openai-responses`, `aperture-anthropic-messages`), and the three selector labels come from the same prefix, spelling out the official Models page's product names for the protocols word for word: `Aperture (OpenAI Chat Completions)`, `Aperture (OpenAI Responses)`, `Aperture (Anthropic Messages)` |
80
+ | `apiKeyEnv` | `—` | Credential-seam reference (must match `^[A-Za-z_][A-Za-z0-9_]*$`); leave the key out to keep sending the placeholder credential. An empty string is not a reference — do not write one |
81
+ | `headers` | `{}` | Extra request headers; on a name collision the **attribution header** and the **placeholder credential** are still filled in per protocol |
116
82
  | `enabledModelIds` | `[]` | Non-empty restricts discovery to these ids (explicit `models` entries are exempt) |
117
83
  | `modelAliases` | `{}` | Gateway id → models.dev id |
118
- | `models` | `[]` | Per-model overrides and extras: `id`, `name`, `api`, `contextWindow`, `maxTokens`, `input`, `thinking`, `reasoningEfforts` |
84
+ | `models` | `[]` | Per-model overrides and extras: `id`, `name`, `protocol`, `contextWindow`, `maxTokens`, `input`, `thinking`, `reasoningEfforts` |
119
85
  | `modelMetadataUrl` | `https://models.dev/models.json` | Catalog URL; `''` disables enrichment |
120
- | `images` | `ignore` | `metadata` adopts models.dev input modalities (images) |
86
+ | `images` | `ignore` | `metadata` adopts models.dev input types (images) |
121
87
  | `reasoning` | `auto` | `off` declares every model non-reasoning |
122
- | `sync` | `true` | `false` discovers without writing (the configuration page still reports) |
88
+ | `sync` | `true` | `false` discovers without registering routes (the configuration page still reports) |
123
89
  | `refreshIntervalMinutes` | `0` | Periodic refresh; `0` refreshes only at load and on change |
124
90
 
125
- Missing capacity and reasoning levels are filled in from Aperture's own fields → [models.dev](https://models.dev) → a conservative default (the fallback capacity, 128000, and the 20s per-request timeout are constants in the code, not configuration). An unstated `maxTokens` is deliberately **omitted**: in `llm-pi-ai` it is also the per-request `max_tokens` cap, so inventing a value would truncate every request.
91
+ Three common examples:
92
+
93
+ ```yaml
94
+ # ~/.dsh/profiles/web/cordis.patch.yml
95
+ - id: aperture
96
+ config:
97
+ models:
98
+ # more reasoning levels for one model (only two conservative ones are offered by default)
99
+ - id: deepseek-v4-pro
100
+ reasoningEfforts: { off: disabled, minimal: minimal, low: low, medium: medium, high: high, max: max }
101
+ # a model the gateway did not list
102
+ - id: gemini-2.5-pro
103
+ api: openai-completions
104
+ modelAliases:
105
+ # the gateway renamed it, so models.dev does not match
106
+ deepseek-flash: deepseek/deepseek-v4-flash
107
+ k3: moonshotai/kimi-k3
108
+ ```
109
+
110
+ Missing capacity and reasoning levels are filled in from Aperture's own fields → [models.dev](https://models.dev) → a conservative default (the fallback capacity, 128000, the 20s per-request timeout, and the five-minute streaming idle cap are constants in the code, not configuration); `maxTokens` is reported to the Host as a default output cap only when the model declares one itself, and nothing is reported when it does not.
126
111
 
127
112
  ## Troubleshooting
128
113
 
129
- **The first `add` from git fails, saying build scripts were ignored?** Add the `allowBuilds` line from the git part of step 1, then re-run — or install from npm, which needs no authorization at all.
114
+ ### The first `add` from git fails, saying build scripts were ignored?
115
+
116
+ Add the `allowBuilds` line from the git part of step 1, then re-run — or install from npm, which needs no authorization at all.
117
+
118
+ ### `Issues with peer dependencies found` during install?
119
+
120
+ Expected: the `@deepseek-ai/cordis`, `@deepseek-ai/schemastery` and `@deepseek-ai/dsh-settings` packages this plugin peers on ship with DSH and are resolved by DSH itself (they never enter the profile's `node_modules`), so pnpm not seeing them does not affect running the plugin.
130
121
 
131
- **`Issues with peer dependencies found` during install?** Expected: the `@deepseek-ai/cordis`, `@deepseek-ai/schemastery` and `@deepseek-ai/dsh-settings` packages this plugin peers on ship with DSH and are resolved by DSH itself (they never enter the profile's `node_modules`), so pnpm not seeing them does not affect running the plugin.
122
+ ### `Failed to resolve dependency: The filename, directory name, or volume label syntax is incorrect. (os error 123)`?
132
123
 
133
- **`Failed to resolve dependency: The filename, directory name, or volume label syntax is incorrect. (os error 123)`?** The git spec is scp-style (`git@github.com:he0119/dsh-aperture.git`) — on Windows the colon reads as a drive letter, so it is parsed as a **local path**. Use a spec pnpm recognises: `github:he0119/dsh-aperture`, `git+https://…` or `git+ssh://…`.
124
+ The git spec is scp-style (`git@github.com:he0119/dsh-aperture.git`) — on Windows the colon reads as a drive letter, so it is parsed as a **local path**. Use a spec pnpm recognises: `github:he0119/dsh-aperture`, `git+https://…` or `git+ssh://…`.
134
125
 
135
- **git over HTTPS is unusable on this machine (schannel / `SEC_E_NO_CREDENTIALS`)?**
126
+ ### git over HTTPS is unusable on this machine (schannel / `SEC_E_NO_CREDENTIALS`)?
136
127
 
137
128
  ```sh
138
129
  git config --global url."git@github.com:".insteadOf "https://github.com/"
139
130
  ```
140
131
 
141
- **Some models never show up in the selector?** Look at the rows tagged `未服务` (unserved) in the Models section of the configuration page. Models that only offer Gemini's native `generateContent` endpoint cannot be attached — this plugin can publish Chat Completions, OpenAI Responses, and Anthropic Messages, but does not translate Gemini's native protocol. Using the wrong endpoint fails loudly, and Aperture names the right one:
132
+ ### Some models never show up in the selector?
142
133
 
143
- ```
144
- 404 model "gemini-2.5-flash" is available via gemini_generate_content, not openai_chat
145
- 404 model "MiniMax-M3" is available via anthropic_messages, not openai_chat
146
- ```
134
+ Look at the sentence on this plugin's configuration page at **Plugins → dsh-aperture**: it says how many models have no route to serve them and what they are called (the route cards list only the models that route really serves). Models that only offer Gemini's native `generateContent` endpoint cannot be attached — this plugin publishes OpenAI Chat Completions, OpenAI Responses and Anthropic Messages only. Using the wrong endpoint fails loudly, for instance `404 model "gemini-2.5-flash" is available via gemini_generate_content, not openai_chat`.
147
135
 
148
- **Want more reasoning levels for a model?** Only two conservative levels are offered by default (DeepSeek family `off/high/max`, every other reasoning model `off/high`). Add your own:
136
+ ### Want more reasoning levels for a model?
149
137
 
150
- ```yaml
151
- # ~/.dsh/profiles/web/cordis.patch.yml
152
- - id: aperture
153
- config:
154
- models:
155
- - id: deepseek-v4-pro
156
- reasoningEfforts:
157
- off: disabled
158
- minimal: minimal
159
- low: low
160
- medium: medium
161
- high: high
162
- max: max
163
- ```
138
+ Only two conservative levels are offered by default (DeepSeek family `off/high/max`, every other reasoning model `off/high`); give that `models` entry a `reasoningEfforts`, as in [Configuration](#configuration).
164
139
 
165
- **Want a model the gateway did not list?** Add it explicitly with `models` — for instance those four Gemini models, if you know they work on an OpenAI-compatible endpoint after all:
140
+ ### Want a model the gateway did not list?
166
141
 
167
- ```yaml
168
- # ~/.dsh/profiles/web/cordis.patch.yml
169
- - id: aperture
170
- config:
171
- models:
172
- - id: gemini-2.5-pro
173
- api: openai-completions
174
- ```
142
+ Add it explicitly to `models` — for instance the Gemini models that sentence on the configuration page reports, if you know they work on an OpenAI-compatible endpoint after all; see [Configuration](#configuration).
175
143
 
176
- **Capacity or reasoning flags were not filled in?** Gateways rename things, and models.dev may not match (in practice `deepseek-flash` and `k3` are `deepseek/deepseek-v4-flash` and `moonshotai/kimi-k3` there). Bridge it explicitly:
144
+ ### Capacity or reasoning flags were not filled in?
177
145
 
178
- ```yaml
179
- # ~/.dsh/profiles/web/cordis.patch.yml
180
- - id: aperture
181
- config:
182
- modelAliases:
183
- deepseek-flash: deepseek/deepseek-v4-flash
184
- k3: moonshotai/kimi-k3
185
- ```
146
+ Gateways rename things, and models.dev may not match (in practice `deepseek-flash` and `k3` are `deepseek/deepseek-v4-flash` and `moonshotai/kimi-k3` there); bridge it with `modelAliases`, as in [Configuration](#configuration).
147
+
148
+ ### The interface says `没注册(路由 aperture-openai-responses 已被另一个适配器注册…)`?
149
+
150
+ One of the route keys it asks for is already served by someone else, most often by an **older version of this plugin** (0.2 and earlier only discovered, and it wrote the routes it found into `llm-pi-ai.providers`). This plugin will not rewrite someone else's configuration for you: delete the matching `providers.<key>` from the `llm-pi-ai` section following the key name that line gives you, or, if that route name belongs to another plugin, change this plugin's `routePrefix` (all three route keys move with it). The next change to the adapter set — a reload after that edit, or pressing "Refresh now" — retries registration; no restart is needed. (The host writes that line in Chinese, as do its action summaries.)
151
+
152
+ ### Coming from 0.2 or earlier, do I have to delete those `aperture*` keys in `llm-pi-ai.providers` myself?
186
153
 
187
- **The configuration page says `设置:未写入(已处于同步状态)`?** That is the normal steady state: the settings already hold the current catalog.
154
+ Yes — and this time no key will point them out for you: the route keys are now the prefix plus the protocol name (by default `aperture-openai-chat-completions`, `aperture-openai-responses`, `aperture-anthropic-messages`), none of which matches the `aperture`, `aperture-responses` or `aperture-anthropic` written back then, so registration never collides. Leaving them behind only lets `llm-pi-ai` keep serving a stale route (duplicate models in the selector).
188
155
 
189
- **Saved but not in effect?** DSH's patch layers stack: above the profile patch document sit higher-priority layers such as `$DSH_HOME/cordis.patch.yml`. If the `aperture` row is written there too, a save from the configuration page lands in the profile patch document but is shadowed by that layer (the settings service may also refuse the write outright, in which case the page says so). Delete the row from the higher-priority layer, or edit it there instead.
156
+ ### Where did the `route` key go?
190
157
 
191
- **Upgrading from 0.2 — where did my `settings.yaml` go?** As of 0.1.7 settings no longer live in a file of their own; they live in the profile patch document. On the first start `$DSH_HOME/settings.yaml` is renamed to `settings.yaml.imported` and each section is moved into the patch document under its settings namespace — the `aperture:` section moves as-is, and every key and value that still passes the schema is unchanged, so the address and the per-model overrides are all still there. From then on only the patch document is read, and `settings.yaml.imported` is just an archive; editing it does nothing. A section whose values no longer validate stays in that archive too, with a line in the log saying so.
158
+ It was renamed to `routePrefix`. The old key raises no error — the schema ignores it, so the prefix quietly falls back to the default `aperture`. If you had renamed the prefix (`route: my-gateway`), copy it onto `routePrefix`; if you only ever wrote the default, just delete the old key.
192
159
 
193
- **No Plugins page / no GUI in this deployment?** The configuration page only exists in the Web GUI (it works over Typert Remote endpoints). A headless profile still discovers and still writes, it just has no clickable page. If the deployment has no manageable profile at all, the `settings` service does not exist and the plugin stays `PENDING` on its hard dependency — its only job is writing settings, so with nowhere to write it deliberately does nothing.
160
+ ### Saved but not in effect?
194
161
 
195
- **Need a real key instead of the placeholder header?** Aperture authenticates by network identity (Tailscale) and needs none; the plugin writes `authorization: Bearer dsh-aperture` / `x-api-key: dsh-aperture` only to make the adapter willing to send the request. It is **not a key**. When a real credential is needed, point `apiKeyEnv` at a credential-seam record and no placeholder is written.
162
+ DSH's patch layers stack: above the profile patch document sit higher-priority layers such as `$DSH_HOME/cordis.patch.yml`. If the `aperture` row is written there too, a save from the configuration page lands in the profile patch document but is shadowed by that layer (the settings service may also refuse the write outright, in which case the page says so). Delete the row from the higher-priority layer, or edit it there instead.
196
163
 
197
- **The old route is still there after changing `route`?** The plugin only knows the three keys it currently owns (`route`, `route` + `-responses`, and `route` + `-anthropic`), not the names it used before, so the old key stays in `llm-pi-ai.providers`. It does no harm and simply stops refreshing; delete the entry by hand to clean it up.
164
+ ### Upgrading from 0.2 — where did my `settings.yaml` go?
165
+
166
+ As of 0.1.7 settings no longer live in a file of their own; they live in the profile patch document. On the first start `$DSH_HOME/settings.yaml` is renamed to `settings.yaml.imported` and each section is moved into the patch document under its settings namespace — the `aperture:` section moves as-is, and every key and value that still passes the schema is unchanged, so the address and the per-model overrides are all still there. From then on only the patch document is read, and that archive does nothing when edited; a section whose values no longer validate stays in the archive too, with a line in the log saying so.
167
+
168
+ ### No Plugins page / no GUI in this deployment?
169
+
170
+ Both interfaces only exist in the Web GUI. A headless profile still discovers and still registers routes, it just has no clickable page — edit the configuration instead. The models also show up as rows on the official Models page; that row's own editor is read-only for this plugin (its settings section is `aperture`), and what you do edit is the block this plugin hangs inside it.
171
+
172
+ ### Need a real key instead of the placeholder credential?
173
+
174
+ No: Aperture authenticates by network identity (Tailscale). The plugin sends `authorization: Bearer dsh-aperture` on every request (the Anthropic route sends `x-api-key: dsh-aperture`), only to make pi-ai willing to send the request — this is **not a key**. When a real credential is needed, point `apiKeyEnv` at a credential-seam record and the placeholder credential is no longer sent.
175
+
176
+ ### Is the old route still there after changing `routePrefix`?
177
+
178
+ The plugin only knows the three keys it currently asks for; once the process exits, the old key has no one serving it. It no longer appears in the selector and needs no cleanup, unless another adapter takes that key over.
198
179
 
199
180
  ## What it does
200
181
 
201
- ```
202
- GET {baseUrl}/v1/models
203
- │
204
- ├─ per model: supported_endpoints ──► routing
205
- │ /v1/chat/completions ──► route (openai-completions)
206
- │ /v1/responses ──► route + -responses (openai-responses)
207
- │ /v1/messages ──► route + -anthropic (anthropic-messages)
208
- │ native generateContent only ──► not published (reported under 未服务)
209
- │
210
- ├─ capacity: Aperture fields ─► models.dev ─► default
211
- ├─ reasoning: Aperture fields ─► models.dev ─► off
212
- │
213
- └─ llm-pi-ai providers.<route>, written into the profile patch document by revision
214
- ```
182
+ The plugin asks the gateway for one `GET {baseUrl}/v1/models` listing and routes each model by its `supported_endpoints`: `/v1/chat/completions` to `openai-completions`, `/v1/responses` to `openai-responses`, `/v1/messages` to `anthropic-messages`, each on one of the three routes sharing the same prefix; a model that only offers native `generateContent` is not published, and the configuration page's sentence names it.
215
183
 
216
- Writes touch only the three keys under `llm-pi-ai.providers` that this plugin owns: an unchanged section is not rewritten; writes are path-addressed so your hand-written providers survive untouched; a failed discovery never wipes the published catalog; a route that lost its models is removed. Design notes — protocol routing, where each fact comes from, lifecycle and dependencies, write behaviour — are in [docs/internals.md](https://github.com/he0119/dsh-aperture/blob/main/docs/internals.md) (Chinese).
184
+ Each route carries exactly one protocol, and a model id is the gateway's id; the plugin writes no configuration at all, so a discovery result only lives in that one registration. When another adapter already holds a route key, the plugin does not force its way in: it skips registration, names the key in the report, and retries whenever the adapter set changes. Why each decision is what it is — and which alternatives were rejected — is in [.agents/notes/implemented/](https://github.com/he0119/dsh-aperture/tree/main/.agents/notes/implemented) (Chinese); current mechanisms and known limits are in [docs/internals.md](https://github.com/he0119/dsh-aperture/blob/main/docs/internals.md) (Chinese).
217
185
 
218
186
  ## Development
219
187
 
@@ -231,7 +199,7 @@ Working on the plugin — build, tests, and a dedicated development instance —
231
199
  - [xiaoyuyu6420/dsh-backup](https://github.com/xiaoyuyu6420/dsh-backup): the reference implementation this plugin follows for the interface wiring — the Remote endpoint shape comes from it, while the way the configuration page is mounted now comes from the Plugins page's slot contract as of 0.1.7.
232
200
  - [Aperture](https://tailscale.com/kb/1542/aperture) (Tailscale): the gateway being discovered.
233
201
  - [models.dev](https://models.dev): enriches capacity and capabilities Aperture does not declare.
234
- - `@deepseek-ai/dsh-llm-pi-ai`: this plugin only discovers; the adapter does the protocol work.
202
+ - [pi-ai](https://www.npmjs.com/package/@earendil-works/pi-ai) (`@earendil-works/pi-ai`): it implements the three wire protocols; this plugin only translates discovery results into its model descriptors.
235
203
 
236
204
  ## License
237
205