@plitzi/sdk-shared 0.32.21 → 0.32.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @plitzi/sdk-shared
2
2
 
3
+ ## 0.32.23
4
+
5
+ ### Patch Changes
6
+
7
+ - v0.32.23
8
+
9
+ ## 0.32.22
10
+
11
+ ### Patch Changes
12
+
13
+ - v0.32.22
14
+
3
15
  ## 0.32.21
4
16
 
5
17
  ### Patch Changes
@@ -297,6 +297,38 @@ export type SSRServerConfig = {
297
297
  * long as the model takes to write the batch. Defaults to true; hosts that stream nothing are unaffected
298
298
  * either way. Set false to keep every view blank until the finished widget arrives. */
299
299
  renderStreaming?: boolean;
300
+ /** How a rendered widget reaches ANYTHING outside its sandbox — images, media, fonts, and the endpoints an
301
+ * apiContainer fetches. A widget runs in an iframe under a CSP the host builds from the origins this server
302
+ * declares on its `ui://` resource, which is read before any widget exists (and the spec allows no per-call
303
+ * CSP), so the origins an agent is about to author can never be declared. With a `secret` set, every external
304
+ * URL a render authored is rewritten to this server's own endpoint — which IS declared — and fetched here,
305
+ * which also settles the redirects, hotlink rules and missing CORS headers a null-origin sandbox cannot. The
306
+ * agent never sees this: it authors the real URL. Without a secret there is no endpoint and the URLs travel
307
+ * as authored, loading only where the host allows their origin. */
308
+ proxy?: {
309
+ /** Set false to serve no endpoint even with a secret configured. */
310
+ enabled?: boolean;
311
+ /** Where the endpoint answers. Default `/__proxy`. */
312
+ path?: string;
313
+ /** Signs each grant (target + kind + expiry + the connection that minted it), so the endpoint is not an open
314
+ * proxy. Required to enable it; any value stable across replicas works. */
315
+ secret?: string;
316
+ /** Absolute base for the URLs handed to widgets (`https://mcp.example.com`). Default: the origin each MCP
317
+ * request arrived on — right whenever the MCP server owns its sub-domain. */
318
+ baseUrl?: string;
319
+ /** Largest response the endpoint will pass through, in bytes. Default 8 MiB. */
320
+ maxBytes?: number;
321
+ /** How long a minted URL keeps working, in seconds. Default 7 days: a widget outlives the call that made it
322
+ * (it stays in the conversation), but a leaked URL should not work forever. */
323
+ ttl?: number;
324
+ /** Which MCP tools may be handed the endpoint at all. Defaults to `['plitzi_render']`, and that default is
325
+ * a guard rather than a convenience: a render is a throwaway widget, so a rewritten URL lives exactly as
326
+ * long as it does, while a tool that WRITES a space (plitzi_apply) would persist proxied URLs into content
327
+ * the user owns — their space would then depend on this server to show its own images, and those URLs
328
+ * expire. Listing a tool only makes the endpoint reachable from it; rewriting is something the tool has to
329
+ * implement, and today plitzi_render is the only one that does. */
330
+ tools?: string[];
331
+ };
300
332
  };
301
333
  /** Receives a {@link ServerLogEvent} for every HTTP request this server answers — whatever stage answered it
302
334
  * and whatever the outcome — plus every MCP tool call and resource read inside those requests. Without it the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-shared",
3
- "version": "0.32.21",
3
+ "version": "0.32.23",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist",