@nuwax-ai/openui-mcp 0.2.0 → 0.2.2
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 +12 -0
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +2 -2
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/openui-reference.d.ts +1 -0
- package/dist/server/openui-reference.d.ts.map +1 -1
- package/dist/server/openui-reference.js +8 -1
- package/dist/server/openui-reference.js.map +1 -1
- package/dist/server/version.d.ts +1 -1
- package/dist/server/version.d.ts.map +1 -1
- package/dist/server/version.js +1 -1
- package/dist/server/version.js.map +1 -1
- package/dist/web/runtime.js +64260 -50657
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
- Apply the Host-selected light or dark mode through OpenUI's official
|
|
6
|
+
`ThemeProvider` instead of falling back to the operating-system color scheme.
|
|
7
|
+
- Keep the frozen Runtime light by default until a Host explicitly requests
|
|
8
|
+
dark mode.
|
|
9
|
+
|
|
10
|
+
## 0.2.1
|
|
11
|
+
|
|
12
|
+
- Clarify that `nuwax_render_openui` creates OpenUI Artifacts and is never an alias for the blocking `nuwax_ask_question` interaction tool.
|
|
13
|
+
- Keep the MCP server-reported version aligned with the npm package version.
|
|
14
|
+
|
|
3
15
|
## 0.2.0
|
|
4
16
|
|
|
5
17
|
- Persist OpenUI artifacts as `data/{artifactId}.openui.json`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoBpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,mBAAmB,GACjC,SAAS,CAkJX"}
|
|
@@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { OPENUI_AUTHORING_PROMPT_NAME, OPENUI_GUIDE_RESOURCE_URI, OPENUI_REFERENCE_TOOL_NAME, OPENUI_SCHEMA_RESOURCE_URI, OPENUI_TOOL_NAME, openUiReferenceInputSchema, openUiArtifactRefSchema, renderOpenUiInputSchema, } from './contracts.js';
|
|
4
4
|
import { OPENUI_MCP_VERSION } from './version.js';
|
|
5
|
-
import { getOpenUiDslSchema, getOpenUiReference } from './openui-reference.js';
|
|
5
|
+
import { getOpenUiDslSchema, getOpenUiReference, OPENUI_TOOL_BOUNDARY, } from './openui-reference.js';
|
|
6
6
|
import { OpenUiPolicyError } from './policy.js';
|
|
7
7
|
export function createOpenUiMcpServer(renderService) {
|
|
8
8
|
const server = new McpServer({
|
|
@@ -73,7 +73,7 @@ export function createOpenUiMcpServer(renderService) {
|
|
|
73
73
|
}));
|
|
74
74
|
server.registerTool(OPENUI_TOOL_NAME, {
|
|
75
75
|
title: 'Render Nuwax OpenUI',
|
|
76
|
-
description:
|
|
76
|
+
description: `${OPENUI_TOOL_BOUNDARY}\nCreate or update a durable OpenUI artifact in the active project. Use this whenever the user asks to show, render, visualize, preview, or build a card, dashboard, chart, table, report, form, status panel, or other structured interface—even if they do not mention OpenUI. The tool writes data/{artifactId}.openui.json and returns a lightweight reference. Reuse artifactId to update an existing UI. OpenUI Lang is assignment-based and is NEVER XML/HTML/JSX: start with root = Stack(...), use positional arguments, and reference every defined variable. For complex UI or uncertain component signatures, call nuwax_get_openui_reference first. Reactive filters must handle empty initial bindings, and dynamic pie/radial charts must guard zero totals. Use inline for compact conversation UI and sidecar only for a full page.`,
|
|
77
77
|
inputSchema: renderOpenUiInputSchema,
|
|
78
78
|
outputSchema: openUiArtifactRefSchema,
|
|
79
79
|
annotations: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,UAAU,qBAAqB,CACnC,aAAkC;IAElC,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,kBAAkB;KAC5B,CAAC,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Aa,CAAC,KAAK,CAAC;gBACxB,CAAC,CAAC,KAAK,YAAY,KAAK;oBACtB,CAAC,CAAC,KAAK,CAAC,OAAO;oBACf,CAAC,CAAC,kCAAkC,CAAC;YAC3C,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,GAAG,OAAO,2CAA2C,0BAA0B,8FAA8F;qBACpL;iBACF;gBACD,KAAK,EACH,KAAK,YAAY,iBAAiB;oBAChC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;oBACtB,CAAC,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE;aAC1C,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OpenUiReferenceInput } from './contracts.js';
|
|
2
|
+
export declare const OPENUI_TOOL_BOUNDARY = "## Tool Boundary (CRITICAL)\n\n- nuwax_render_openui and nuwax_ask_question are separate tools; nuwax_render_openui is not an alias for nuwax_ask_question.\n- Use nuwax_render_openui to create or update a durable visual Artifact: cards, dashboards, charts, tables, reports, application forms, and interactive pages.\n- Never substitute nuwax_ask_question when the user asks to render, show, preview, demonstrate, or update OpenUI. Load the OpenUI reference, author openui-lang, then call nuwax_render_openui.\n- nuwax_ask_question is only for a blocking clarification or decision that the Agent must receive before it can continue. Its inline/modal/wizard schema is not OpenUI Lang and must never be passed to nuwax_render_openui.\n";
|
|
2
3
|
export declare function getOpenUiReference(profile: OpenUiReferenceInput['profile']): string;
|
|
3
4
|
export declare function getOpenUiDslSchema(): string;
|
|
4
5
|
//# sourceMappingURL=openui-reference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openui-reference.d.ts","sourceRoot":"","sources":["../../src/openui-reference.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"openui-reference.d.ts","sourceRoot":"","sources":["../../src/openui-reference.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAW3D,eAAO,MAAM,oBAAoB,iuBAMhC,CAAC;AAoBF,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,GACvC,MAAM,CAMR;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
|
@@ -5,6 +5,13 @@ const PROFILE_FOCUS = {
|
|
|
5
5
|
form: 'Focus on Form, FormControl, input components, Buttons/Action, validation rules, bindings, and Modal.',
|
|
6
6
|
all: 'Use any documented component, but prefer the smallest set that satisfies the request.',
|
|
7
7
|
};
|
|
8
|
+
export const OPENUI_TOOL_BOUNDARY = `## Tool Boundary (CRITICAL)
|
|
9
|
+
|
|
10
|
+
- nuwax_render_openui and nuwax_ask_question are separate tools; nuwax_render_openui is not an alias for nuwax_ask_question.
|
|
11
|
+
- Use nuwax_render_openui to create or update a durable visual Artifact: cards, dashboards, charts, tables, reports, application forms, and interactive pages.
|
|
12
|
+
- Never substitute nuwax_ask_question when the user asks to render, show, preview, demonstrate, or update OpenUI. Load the OpenUI reference, author openui-lang, then call nuwax_render_openui.
|
|
13
|
+
- nuwax_ask_question is only for a blocking clarification or decision that the Agent must receive before it can continue. Its inline/modal/wizard schema is not OpenUI Lang and must never be passed to nuwax_render_openui.
|
|
14
|
+
`;
|
|
8
15
|
const REACTIVE_DASHBOARD_GUARDRAILS = `## Nuwax Reactive Dashboard Guardrails (CRITICAL)
|
|
9
16
|
|
|
10
17
|
- Reactive input and select bindings start with an empty value. An optional filter MUST bypass @Filter until its binding is non-empty.
|
|
@@ -22,7 +29,7 @@ export function getOpenUiReference(profile) {
|
|
|
22
29
|
const guardrails = profile === 'dashboard' || profile === 'all'
|
|
23
30
|
? `\n\n${REACTIVE_DASHBOARD_GUARDRAILS}`
|
|
24
31
|
: '';
|
|
25
|
-
return
|
|
32
|
+
return `${OPENUI_TOOL_BOUNDARY}\nAuthoring profile: ${profile}. ${PROFILE_FOCUS[profile]}\nDo not emit XML, HTML, JSX, markdown fences, or explanations inside document.source.${guardrails}\n\n${normalizeGeneratedReference(openuiLibrary.prompt({}))}`;
|
|
26
33
|
}
|
|
27
34
|
export function getOpenUiDslSchema() {
|
|
28
35
|
return JSON.stringify(openuiLibrary.toJSONSchema(), null, 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openui-reference.js","sourceRoot":"","sources":["../../src/openui-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9D,MAAM,aAAa,GAAoD;IACrE,KAAK,EACH,2FAA2F;IAC7F,SAAS,EACP,gFAAgF;IAClF,IAAI,EAAE,sGAAsG;IAC5G,GAAG,EAAE,uFAAuF;CAC7F,CAAC;AAEF,MAAM,6BAA6B,GAAG;;;;;;;;;CASrC,CAAC;AAEF,SAAS,2BAA2B,CAAC,SAAiB;IACpD,OAAO,SAAS,CAAC,OAAO,CACtB,kGAAkG,EAClG,qKAAqK,CACtK,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,OAAwC;IAExC,MAAM,UAAU,GACd,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK;QAC1C,CAAC,CAAC,OAAO,6BAA6B,EAAE;QACxC,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,
|
|
1
|
+
{"version":3,"file":"openui-reference.js","sourceRoot":"","sources":["../../src/openui-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9D,MAAM,aAAa,GAAoD;IACrE,KAAK,EACH,2FAA2F;IAC7F,SAAS,EACP,gFAAgF;IAClF,IAAI,EAAE,sGAAsG;IAC5G,GAAG,EAAE,uFAAuF;CAC7F,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;CAMnC,CAAC;AAEF,MAAM,6BAA6B,GAAG;;;;;;;;;CASrC,CAAC;AAEF,SAAS,2BAA2B,CAAC,SAAiB;IACpD,OAAO,SAAS,CAAC,OAAO,CACtB,kGAAkG,EAClG,qKAAqK,CACtK,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,OAAwC;IAExC,MAAM,UAAU,GACd,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK;QAC1C,CAAC,CAAC,OAAO,6BAA6B,EAAE;QACxC,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,GAAG,oBAAoB,wBAAwB,OAAO,KAAK,aAAa,CAAC,OAAO,CAAC,yFAAyF,UAAU,OAAO,2BAA2B,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC5P,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/server/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const OPENUI_MCP_VERSION = "0.1
|
|
1
|
+
export declare const OPENUI_MCP_VERSION = "0.2.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,UAAU,CAAC"}
|
package/dist/server/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const OPENUI_MCP_VERSION = '0.1
|
|
1
|
+
export const OPENUI_MCP_VERSION = '0.2.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC"}
|