@devframes/next 0.9.9 → 0.9.11

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/dist/hub.d.mts CHANGED
@@ -76,8 +76,8 @@ interface DevframeNextHost {
76
76
  * Serve an MCP Streamable-HTTP endpoint at `path` **in-process**, on the
77
77
  * Next app's own origin, through the same catch-all route as the SPAs (the
78
78
  * `/_next/mcp` shape). Built on `createMcpFetchHandler` from
79
- * `devframe/adapters/mcp` (imported lazily: `@modelcontextprotocol/server`
80
- * stays an optional peer). Advertise the path in the connection meta
79
+ * `devframe/adapters/mcp` (imported lazily, so the MCP SDK stays out of
80
+ * the app's bundle graph). Advertise the path in the connection meta
81
81
  * (`mcp: { path }`, same origin, no port) and register the instance via
82
82
  * `registerDevframeInstance` so `devframe connect` can discover it.
83
83
  */
@@ -143,9 +143,11 @@ interface NextDevframeHubOptions {
143
143
  /** The hub's single auth gate. Gates by default; `false` opts out. */
144
144
  auth?: InitHubOptions['auth'];
145
145
  /**
146
- * Expose the aggregate MCP endpoint at `<base>__mcp`. Disabled by default;
147
- * `true` mounts it with the loopback origin gate (trusting same-machine
148
- * callers), or pass an object to opt into an `authorization` identity check.
146
+ * Expose the aggregate MCP endpoint at `<base>__mcp`. Defaults to `'auto'`
147
+ * (mount once any mounted devframe exposes an agent surface); `true`
148
+ * mounts it unconditionally with the
149
+ * loopback origin gate (trusting same-machine callers), an object opts
150
+ * into an `authorization` identity check, `false` keeps it off.
149
151
  */
150
152
  mcp?: InitHubOptions['mcp'];
151
153
  /** Public origin the Next app is reachable at. Default: derived from `PORT`. */
@@ -163,8 +165,8 @@ interface NextDevframeHubOptions {
163
165
  * Build a devframes-hub for a Next.js App Router app: one `initHub()` call
164
166
  * mounting every devframe under `<base><id>/` behind one web-standard
165
167
  * `handler`, with the RPC socket on a side-car (Next routes can't accept WS
166
- * upgrades) and the aggregate MCP route opt-in (pass `mcp` to enable it). The
167
- * UI defaults to
168
+ * upgrades) and the aggregate MCP route mounted on demand (the `'auto'`
169
+ * default; pass `mcp` to force or disable it). The UI defaults to
168
170
  * `@devframes/hub-ui`'s `createUi()`, loaded lazily via a bundler-ignored
169
171
  * dynamic `import()` so its asset lookups resolve at request time; pass `ui`
170
172
  * to swap it or `ui: false` for a headless hub.
package/dist/hub.mjs CHANGED
@@ -84,8 +84,8 @@ function createDevframeNextHost(options) {
84
84
  * Build a devframes-hub for a Next.js App Router app: one `initHub()` call
85
85
  * mounting every devframe under `<base><id>/` behind one web-standard
86
86
  * `handler`, with the RPC socket on a side-car (Next routes can't accept WS
87
- * upgrades) and the aggregate MCP route opt-in (pass `mcp` to enable it). The
88
- * UI defaults to
87
+ * upgrades) and the aggregate MCP route mounted on demand (the `'auto'`
88
+ * default; pass `mcp` to force or disable it). The UI defaults to
89
89
  * `@devframes/hub-ui`'s `createUi()`, loaded lazily via a bundler-ignored
90
90
  * dynamic `import()` so its asset lookups resolve at request time; pass `ui`
91
91
  * to swap it or `ui: false` for a headless hub.
package/dist/single.d.mts CHANGED
@@ -52,6 +52,15 @@ interface CreateDevframeNextHandlerOptions {
52
52
  * or a handler for a custom scheme.
53
53
  */
54
54
  auth?: InitDevframeOptions['auth'];
55
+ /**
56
+ * Widen the side-car WebSocket origin check beyond devframe's
57
+ * loopback-only default. Reaching a remotely-accessed Next dev server
58
+ * (containers, Codespaces, tunnels) needs the app's own origin allowed.
59
+ * Pass extra origins, a `WsOriginRegistry`, or `false` to disable the
60
+ * check (safe when the auth gate owns the trust boundary). Forwarded
61
+ * verbatim to `initDevframe`.
62
+ */
63
+ allowedOrigins?: InitDevframeOptions['allowedOrigins'];
55
64
  /** Origin the Next app is reachable at, for docks needing an absolute URL. */
56
65
  resolveOrigin?: () => string;
57
66
  /** Override where persisted devframe state lives (defaults under the cwd / home). */
@@ -60,8 +69,9 @@ interface CreateDevframeNextHandlerOptions {
60
69
  * Expose the route-based MCP server (Streamable-HTTP) at `<base>__mcp`,
61
70
  * on the Next app's own origin, through the same catch-all route as the
62
71
  * SPA, and advertise it in the handler's `__connection.json`. Overrides
63
- * `def.cli?.mcp`, `undefined` falls through to it, `false` disables the
64
- * route regardless.
72
+ * `def.cli?.mcp`, `undefined` falls through to it, then to the `'auto'`
73
+ * default (mount once the agent surface is non-empty); `false` disables
74
+ * the route regardless.
65
75
  */
66
76
  mcp?: InitDevframeOptions['mcp'];
67
77
  /**
package/dist/single.mjs CHANGED
@@ -91,6 +91,7 @@ function createDevframeNextHandler(def, options = {}) {
91
91
  */
92
92
  auth: options.auth,
93
93
  mcp: options.mcp,
94
+ allowedOrigins: options.allowedOrigins,
94
95
  /**
95
96
  * Next's route handlers never see WebSocket upgrades, so the RPC socket
96
97
  * lives on a side-car server (on `options.port` when pinned, otherwise
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/next",
3
3
  "type": "module",
4
- "version": "0.9.9",
4
+ "version": "0.9.11",
5
5
  "description": "Next.js host integration that serves mounted devframes from an App Router route.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -47,9 +47,9 @@
47
47
  "dist"
48
48
  ],
49
49
  "peerDependencies": {
50
- "@devframes/hub": "0.9.9",
51
- "@devframes/hub-ui": "0.9.9",
52
- "devframe": "0.9.9",
50
+ "@devframes/hub": "0.9.11",
51
+ "@devframes/hub-ui": "0.9.11",
52
+ "devframe": "0.9.11",
53
53
  "next": "^14.0.0 || ^15.0.0 || ^16.0.0",
54
54
  "react": "^18.0.0 || ^19.0.0"
55
55
  },
@@ -71,11 +71,11 @@
71
71
  "h3": "^2.0.1-rc.29"
72
72
  },
73
73
  "devDependencies": {
74
- "@devframes/hub": "0.9.9",
75
- "@devframes/hub-ui": "0.9.9",
74
+ "@devframes/hub": "0.9.11",
75
+ "@devframes/hub-ui": "0.9.11",
76
76
  "@types/node": "^26.4.0",
77
77
  "@types/react": "^19.2.18",
78
- "devframe": "0.9.9",
78
+ "devframe": "0.9.11",
79
79
  "react": "^19.2.8",
80
80
  "tsdown": "^0.22.14"
81
81
  },