@nitrostack/core 1.0.16 → 1.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitrostack/core",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "NitroStack Core - Build powerful MCP servers with TypeScript",
5
5
  "type": "module",
6
6
  "main": "dist/core/index.js",
@@ -45,9 +45,6 @@
45
45
  ],
46
46
  "author": "Nitrostack Inc <hello@nitrostack.ai>",
47
47
  "license": "Apache-2.0",
48
- "peerDependencies": {
49
- "@modelcontextprotocol/ext-apps": ">=0.1.0"
50
- },
51
48
  "dependencies": {
52
49
  "@modelcontextprotocol/node": "^2.0.0",
53
50
  "@modelcontextprotocol/sdk": "^1.0.4",
@@ -62,7 +59,7 @@
62
59
  "uuid": "^11.0.5",
63
60
  "winston": "^3.17.0",
64
61
  "ws": "^8.18.3",
65
- "zod": "^3.24.1",
62
+ "zod": "^3.25.28",
66
63
  "zod-to-json-schema": "^3.24.6"
67
64
  },
68
65
  "devDependencies": {
@@ -1,5 +0,0 @@
1
- /**
2
- * Pre-built widget HTML paths (production). Kept in sync with NitroStackServer resource handler.
3
- */
4
- export declare function widgetBundleHtmlCandidates(widgetId: string, cwd?: string): string[];
5
- //# sourceMappingURL=widget-bundle-paths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-bundle-paths.d.ts","sourceRoot":"","sources":["../../src/core/widget-bundle-paths.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAsB,GAAG,MAAM,EAAE,CAmBlG"}
@@ -1,25 +0,0 @@
1
- import path from 'node:path';
2
- /**
3
- * Pre-built widget HTML paths (production). Kept in sync with NitroStackServer resource handler.
4
- */
5
- export function widgetBundleHtmlCandidates(widgetId, cwd = process.cwd()) {
6
- const bases = [
7
- ['src', 'widgets', 'out'],
8
- ['dist', 'widgets', 'out'],
9
- ['widgets', 'out'],
10
- ];
11
- const relFiles = [`${widgetId}.html`];
12
- if (widgetId.startsWith('next-')) {
13
- const route = widgetId.slice('next-'.length);
14
- relFiles.push(`${route}.html`, `${route}/index.html`);
15
- }
16
- const paths = [];
17
- for (const baseSeg of bases) {
18
- const base = path.join(cwd, ...baseSeg);
19
- for (const rel of relFiles) {
20
- paths.push(path.join(base, rel));
21
- }
22
- }
23
- return paths;
24
- }
25
- //# sourceMappingURL=widget-bundle-paths.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-bundle-paths.js","sourceRoot":"","sources":["../../src/core/widget-bundle-paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAgB,EAAE,MAAc,OAAO,CAAC,GAAG,EAAE;IACtF,MAAM,KAAK,GAAG;QACZ,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC;QACzB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;QAC1B,CAAC,SAAS,EAAE,KAAK,CAAC;KACV,CAAC;IACX,MAAM,QAAQ,GAAa,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC;IAChD,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,OAAO,EAAE,GAAG,KAAK,aAAa,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * MIME type for MCP Apps / ChatGPT widget HTML templates.
3
- * Hosts enable the MCP Apps bridge (tool I/O, globals) only for this profile.
4
- * @see https://developers.openai.com/apps-sdk/build/mcp-server/
5
- */
6
- export declare const WIDGET_HTML_MIME_TYPE = "text/html;profile=mcp-app";
7
- //# sourceMappingURL=widget-html-mime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-html-mime.d.ts","sourceRoot":"","sources":["../../src/core/widget-html-mime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * MIME type for MCP Apps / ChatGPT widget HTML templates.
3
- * Hosts enable the MCP Apps bridge (tool I/O, globals) only for this profile.
4
- * @see https://developers.openai.com/apps-sdk/build/mcp-server/
5
- */
6
- export const WIDGET_HTML_MIME_TYPE = 'text/html;profile=mcp-app';
7
- //# sourceMappingURL=widget-html-mime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-html-mime.js","sourceRoot":"","sources":["../../src/core/widget-html-mime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * MIME type for interactive MCP / ChatGPT UI resources (SEP-1865).
3
- * Hosts that load "MCP App" iframes reject plain `text/html`.
4
- */
5
- export declare const MCP_APP_WIDGET_MIME_TYPE = "text/html;profile=mcp-app";
6
- /**
7
- * Legacy OpenAI Apps SDK / Skybridge HTML resources (when not using MCP App profile).
8
- */
9
- export declare const OPENAI_SKYBRIDGE_WIDGET_MIME_TYPE = "text/html+skybridge";
10
- /** Plain HTML — what many OpenAI / ChatGPT widget hosts expect in resources/list. */
11
- export declare const OPENAI_PLAIN_HTML_WIDGET_MIME_TYPE = "text/html";
12
- /** @alias Default NitroStack widget resource MIME (MCP App profile) */
13
- export declare const WIDGET_MIME_TYPE = "text/html;profile=mcp-app";
14
- /** @alias Same as {@link MCP_APP_WIDGET_MIME_TYPE} */
15
- export declare const MCP_APPS_MIME_TYPE = "text/html;profile=mcp-app";
16
- /** @alias Skybridge-only */
17
- export declare const OPENAI_SKYBRIDGE_MIME_TYPE = "text/html+skybridge";
18
- /**
19
- * Widget HTML MIME for `resources/read` + tool metadata.
20
- *
21
- * - Default / `mcp-app` / unset: `text/html;profile=mcp-app` (MCP Apps, MCPJam Inspector)
22
- * - `openai`: `text/html+skybridge` (ChatGPT / OpenAI Apps SDK pattern; see repo `todo-openai-apps-sdk-example`)
23
- * - `legacy` / `plain` / `text/html`: plain `text/html` (hosts that reject skybridge)
24
- * - `skybridge`: same as `openai`
25
- *
26
- * Override per component with {@link ComponentMetadata.widgetResourceMime}.
27
- */
28
- export declare function resolveWidgetResourceMimeType(explicit?: string): string;
29
- //# sourceMappingURL=widget-mime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-mime.d.ts","sourceRoot":"","sources":["../../src/core/widget-mime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,iCAAiC,wBAAwB,CAAC;AAEvE,qFAAqF;AACrF,eAAO,MAAM,kCAAkC,cAAc,CAAC;AAE9D,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,8BAA2B,CAAC;AAEzD,sDAAsD;AACtD,eAAO,MAAM,kBAAkB,8BAA2B,CAAC;AAE3D,4BAA4B;AAC5B,eAAO,MAAM,0BAA0B,wBAAoC,CAAC;AAE5E;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAYvE"}
@@ -1,41 +0,0 @@
1
- /**
2
- * MIME type for interactive MCP / ChatGPT UI resources (SEP-1865).
3
- * Hosts that load "MCP App" iframes reject plain `text/html`.
4
- */
5
- export const MCP_APP_WIDGET_MIME_TYPE = 'text/html;profile=mcp-app';
6
- /**
7
- * Legacy OpenAI Apps SDK / Skybridge HTML resources (when not using MCP App profile).
8
- */
9
- export const OPENAI_SKYBRIDGE_WIDGET_MIME_TYPE = 'text/html+skybridge';
10
- /** Plain HTML — what many OpenAI / ChatGPT widget hosts expect in resources/list. */
11
- export const OPENAI_PLAIN_HTML_WIDGET_MIME_TYPE = 'text/html';
12
- /** @alias Default NitroStack widget resource MIME (MCP App profile) */
13
- export const WIDGET_MIME_TYPE = MCP_APP_WIDGET_MIME_TYPE;
14
- /** @alias Same as {@link MCP_APP_WIDGET_MIME_TYPE} */
15
- export const MCP_APPS_MIME_TYPE = MCP_APP_WIDGET_MIME_TYPE;
16
- /** @alias Skybridge-only */
17
- export const OPENAI_SKYBRIDGE_MIME_TYPE = OPENAI_SKYBRIDGE_WIDGET_MIME_TYPE;
18
- /**
19
- * Widget HTML MIME for `resources/read` + tool metadata.
20
- *
21
- * - Default / `mcp-app` / unset: `text/html;profile=mcp-app` (MCP Apps, MCPJam Inspector)
22
- * - `openai`: `text/html+skybridge` (ChatGPT / OpenAI Apps SDK pattern; see repo `todo-openai-apps-sdk-example`)
23
- * - `legacy` / `plain` / `text/html`: plain `text/html` (hosts that reject skybridge)
24
- * - `skybridge`: same as `openai`
25
- *
26
- * Override per component with {@link ComponentMetadata.widgetResourceMime}.
27
- */
28
- export function resolveWidgetResourceMimeType(explicit) {
29
- if (explicit) {
30
- return explicit;
31
- }
32
- const v = process.env.NITRO_WIDGET_RESOURCE_MIME?.trim().toLowerCase();
33
- if (v === 'openai' || v === 'skybridge' || v === 'html+skybridge') {
34
- return OPENAI_SKYBRIDGE_WIDGET_MIME_TYPE;
35
- }
36
- if (v === 'legacy' || v === 'text/html' || v === 'plain') {
37
- return OPENAI_PLAIN_HTML_WIDGET_MIME_TYPE;
38
- }
39
- return MCP_APP_WIDGET_MIME_TYPE;
40
- }
41
- //# sourceMappingURL=widget-mime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-mime.js","sourceRoot":"","sources":["../../src/core/widget-mime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,qBAAqB,CAAC;AAEvE,qFAAqF;AACrF,MAAM,CAAC,MAAM,kCAAkC,GAAG,WAAW,CAAC;AAE9D,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAEzD,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAE3D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAAC,QAAiB;IAC7D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvE,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,gBAAgB,EAAE,CAAC;QAClE,OAAO,iCAAiC,CAAC;IAC3C,CAAC;IACD,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;QACzD,OAAO,kCAAkC,CAAC;IAC5C,CAAC;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}