@workerdeck/server 0.13.0 → 0.16.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.md CHANGED
@@ -186,6 +186,32 @@ services and any unattended use. Without it the server logs a one-time notice in
186
186
  OAuth, never reads or forwards tokens — see the repo README's
187
187
  ["Auth & Anthropic's terms"](https://github.com/workerdeck/workerdeck#auth--anthropics-terms).
188
188
 
189
+ ## Rules you cannot infer from the types
190
+
191
+ - **A scope miss answers 404, never 403.** Whether a session exists in another scope is not the
192
+ caller's business, so the out-of-scope answer is byte-identical to the unknown-id one.
193
+ - **Visibility is full control.** There is no read-only attach: a client that can see a session can
194
+ send `user_message`, `permission_decision`, `interrupt` and `close`. `SessionPanel`'s `readOnly`
195
+ removes the affordance, not the authority — enforce at the gateway or not at all.
196
+ - **`authorizeSession` is synchronous on purpose.** It runs per route and per row of every list. An
197
+ expensive lookup belongs in `authenticate`, where it happens once and lands on the principal.
198
+ - **`sandboxedProviderProfile()`'s empty arrays are load-bearing.** `capabilities: []` and
199
+ `mcpServers: []` mean "nothing"; *absent* means "whatever the host wired". Do not normalise one
200
+ into the other.
201
+ - **A Claude profile does not pin `CLAUDE_CONFIG_DIR` when that would be a no-op.** Setting the
202
+ variable at all moves the CLI off the macOS Keychain, so pinning the default directory breaks a
203
+ working `claude login`. "Pin the default dir" and "don't pin" are different logins.
204
+ - **`checkCredentials` is display-only** unless you also set `requireAvailableProfile`. A create
205
+ against an unavailable profile otherwise proceeds and fails with the engine's own error — right
206
+ for an operator (the probe can be stale), wrong in front of an end user.
207
+ - **`createEngineRunner` has four invisible obligations**: forward `restore`, adopt `id`, seed the
208
+ VFS only when *not* restoring, and dispose per-session resources via `onClose`. Every one is a
209
+ runtime-only failure. `createProviderRunner()` does all four; reach for the raw hook only when it
210
+ genuinely doesn't fit.
211
+ - **One origin is not a convenience.** A browser cannot put an `Authorization` header on a
212
+ WebSocket upgrade, so a cookie is the only credential a tab can present on an attach, and a
213
+ cookie is per-origin. That is what `fallback` is for — an app served from the gateway's own port.
214
+
189
215
  ## License
190
216
 
191
217
  MIT © Tobias Strebitzer —