@sentropic/h2a 0.98.7 → 0.98.8-rc.1
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -15
- package/dist/cli.js.map +1 -1
- package/dist/hosts/native-artifacts.d.ts +2 -0
- package/dist/hosts/native-artifacts.d.ts.map +1 -1
- package/dist/hosts/native-artifacts.js +19 -5
- package/dist/hosts/native-artifacts.js.map +1 -1
- package/dist/hosts/native-convergence.d.ts +1 -0
- package/dist/hosts/native-convergence.d.ts.map +1 -1
- package/dist/hosts/native-convergence.js +1 -1
- package/dist/hosts/native-convergence.js.map +1 -1
- package/dist/hosts/native-skills.d.ts +6 -0
- package/dist/hosts/native-skills.d.ts.map +1 -1
- package/dist/hosts/native-skills.js +9 -4
- package/dist/hosts/native-skills.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/identity/live.d.ts.map +1 -1
- package/dist/runtime/identity/live.js +27 -4
- package/dist/runtime/identity/live.js.map +1 -1
- package/dist/runtime/identity/worker.js +21 -2
- package/dist/runtime/identity/worker.js.map +1 -1
- package/dist/runtime/local-files/identity-fence.d.ts +1 -0
- package/dist/runtime/local-files/identity-fence.d.ts.map +1 -1
- package/dist/runtime/local-files/identity-fence.js +14 -3
- package/dist/runtime/local-files/identity-fence.js.map +1 -1
- package/dist/runtime/local-files/locks.d.ts +16 -9
- package/dist/runtime/local-files/locks.d.ts.map +1 -1
- package/dist/runtime/local-files/locks.js +238 -42
- package/dist/runtime/local-files/locks.js.map +1 -1
- package/dist/runtime/local-files/succession-lock.d.ts.map +1 -1
- package/dist/runtime/local-files/succession-lock.js +7 -6
- package/dist/runtime/local-files/succession-lock.js.map +1 -1
- package/dist/runtime/mcp/identity-state.d.ts +2 -0
- package/dist/runtime/mcp/identity-state.d.ts.map +1 -1
- package/dist/runtime/mcp/identity-state.js +39 -1
- package/dist/runtime/mcp/identity-state.js.map +1 -1
- package/dist/runtime/mcp/index.d.ts +11 -1
- package/dist/runtime/mcp/index.d.ts.map +1 -1
- package/dist/runtime/mcp/index.js +10 -0
- package/dist/runtime/mcp/index.js.map +1 -1
- package/dist/runtime/mcp/server.d.ts +23 -1
- package/dist/runtime/mcp/server.d.ts.map +1 -1
- package/dist/runtime/mcp/server.js +18 -2
- package/dist/runtime/mcp/server.js.map +1 -1
- package/dist/runtime/mcp/stdio.d.ts.map +1 -1
- package/dist/runtime/mcp/stdio.js +60 -4
- package/dist/runtime/mcp/stdio.js.map +1 -1
- package/dist/runtime/mcp/tools.d.ts +22 -0
- package/dist/runtime/mcp/tools.d.ts.map +1 -1
- package/dist/runtime/mcp/tools.js.map +1 -1
- package/dist/runtime/mcp/ui-render/a2ui-common-types.d.ts +32 -0
- package/dist/runtime/mcp/ui-render/a2ui-common-types.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/a2ui-common-types.js +374 -0
- package/dist/runtime/mcp/ui-render/a2ui-common-types.js.map +1 -0
- package/dist/runtime/mcp/ui-render/assets.d.ts +104 -0
- package/dist/runtime/mcp/ui-render/assets.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/assets.js +217 -0
- package/dist/runtime/mcp/ui-render/assets.js.map +1 -0
- package/dist/runtime/mcp/ui-render/bpmn-port.d.ts +3 -0
- package/dist/runtime/mcp/ui-render/bpmn-port.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/bpmn-port.js +621 -0
- package/dist/runtime/mcp/ui-render/bpmn-port.js.map +1 -0
- package/dist/runtime/mcp/ui-render/fallback.d.ts +35 -0
- package/dist/runtime/mcp/ui-render/fallback.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/fallback.js +245 -0
- package/dist/runtime/mcp/ui-render/fallback.js.map +1 -0
- package/dist/runtime/mcp/ui-render/index.d.ts +51 -0
- package/dist/runtime/mcp/ui-render/index.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/index.js +38 -0
- package/dist/runtime/mcp/ui-render/index.js.map +1 -0
- package/dist/runtime/mcp/ui-render/inline.d.ts +3 -0
- package/dist/runtime/mcp/ui-render/inline.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/inline.js +21 -0
- package/dist/runtime/mcp/ui-render/inline.js.map +1 -0
- package/dist/runtime/mcp/ui-render/negotiation.d.ts +23 -0
- package/dist/runtime/mcp/ui-render/negotiation.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/negotiation.js +45 -0
- package/dist/runtime/mcp/ui-render/negotiation.js.map +1 -0
- package/dist/runtime/mcp/ui-render/registry-entry.d.ts +74 -0
- package/dist/runtime/mcp/ui-render/registry-entry.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/registry-entry.js +207 -0
- package/dist/runtime/mcp/ui-render/registry-entry.js.map +1 -0
- package/dist/runtime/mcp/ui-render/resources.d.ts +35 -0
- package/dist/runtime/mcp/ui-render/resources.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/resources.js +342 -0
- package/dist/runtime/mcp/ui-render/resources.js.map +1 -0
- package/dist/runtime/mcp/ui-render/tools.d.ts +42 -0
- package/dist/runtime/mcp/ui-render/tools.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/tools.js +367 -0
- package/dist/runtime/mcp/ui-render/tools.js.map +1 -0
- package/dist/runtime/mcp/ui-render/types.d.ts +96 -0
- package/dist/runtime/mcp/ui-render/types.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/types.js +22 -0
- package/dist/runtime/mcp/ui-render/types.js.map +1 -0
- package/dist/runtime/mcp/ui-render/validation.d.ts +151 -0
- package/dist/runtime/mcp/ui-render/validation.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/validation.js +460 -0
- package/dist/runtime/mcp/ui-render/validation.js.map +1 -0
- package/dist/runtime/mcp/ui-render/watermark.d.ts +38 -0
- package/dist/runtime/mcp/ui-render/watermark.d.ts.map +1 -0
- package/dist/runtime/mcp/ui-render/watermark.js +52 -0
- package/dist/runtime/mcp/ui-render/watermark.js.map +1 -0
- package/dist/runtime/mcp-central.d.ts.map +1 -1
- package/dist/runtime/mcp-central.js +55 -6
- package/dist/runtime/mcp-central.js.map +1 -1
- package/fixtures/ui-render-ac-l3/offline-measurement.v1.json +105 -0
- package/package.json +8 -5
- package/vendor/design-system-elements/catalog.json +1234 -0
- package/vendor/design-system-elements/dist/browser/assets/bpmn-CZlEAdL6.ttf +0 -0
- package/vendor/design-system-elements/dist/browser/assets/bpmn-DaGVGZ7K.woff +0 -0
- package/vendor/design-system-elements/dist/browser/assets/bpmn-DaJ2be00.woff2 +0 -0
- package/vendor/design-system-elements/dist/browser/chunks/BpmnRenderUtil-WMCgqGDs.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/BpmnUpdater-C-UNbzXl.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/LabelUtil-7QpE43Ed.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/LayoutUtil-hAMJmJFU.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/ModelUtil-CMh7LuN4.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/Modeler-BfAmwsmK.js +389 -0
- package/vendor/design-system-elements/dist/browser/chunks/Viewer-eYLzc3fD.js +4 -0
- package/vendor/design-system-elements/dist/browser/chunks/bpmn-canvas-DeAWdJFy.js +2207 -0
- package/vendor/design-system-elements/dist/browser/chunks/colored-CSIQaGsQ.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/dist-Co2MgHWm.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/dist-O6_2ByYB.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/dist-kvAYI1vo.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/entropic-CM5BHERN.js +2173 -0
- package/vendor/design-system-elements/dist/browser/chunks/focus-renderer-C4z8aS9F.js +8 -0
- package/vendor/design-system-elements/dist/browser/chunks/forge-B8hrW4lA.js +2173 -0
- package/vendor/design-system-elements/dist/browser/chunks/layout-q0TR9-aY.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/legend-CXdfCBh6.js +1 -0
- package/vendor/design-system-elements/dist/browser/chunks/textMetrics-BrMS6-sA.js +2 -0
- package/vendor/design-system-elements/dist/browser/chunks/tokens-DFPpCvf1.js +1 -0
- package/vendor/design-system-elements/dist/browser/elements.js +2221 -0
- package/vendor/design-system-elements/dist/browser/sri.json +166 -0
- package/vendor/design-system-elements/envelope.json +43 -0
- package/vendor/design-system-elements/manifest.json +101 -0
- package/vendor/design-system-elements/schemas/BarChart.v1.json +556 -0
- package/vendor/design-system-elements/schemas/BpmnCanvas.v1.json +139 -0
- package/vendor/design-system-elements/schemas/DecisionDossier.v1.json +635 -0
- package/vendor/ui-render-inline/BarChart.js +1 -0
- package/vendor/ui-render-inline/BpmnCanvas.js +1 -0
- package/vendor/ui-render-inline/DecisionDossier.js +1 -0
- package/vendor/ui-render-inline/manifest.json +80 -0
- package/vendor/ui-render-inline/render.js +1 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ui:// render tool surface (h2a spec §4; DS spec §8.2, §8.3):
|
|
3
|
+
* `list_components`, `get_schema`, `render`, the per-component fallback
|
|
4
|
+
* `render_<id>` tools, and `submit_intent`. Every result is a transport-
|
|
5
|
+
* shaped `{ content, structuredContent?, isError? }` — `structuredContent`
|
|
6
|
+
* carries the machine view (envelope echo + diagnostics) while `content`
|
|
7
|
+
* stays within the DS §8.2 byte caps so the model-visible surface is always
|
|
8
|
+
* bounded.
|
|
9
|
+
*/
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
11
|
+
import { fallbackContent, formatDiagnosticsSummary, truncateUtf8Bytes } from "./fallback.js";
|
|
12
|
+
import { utf8ByteLength } from "./validation.js";
|
|
13
|
+
import { PILOT_RESOURCE_DOMAIN } from "./types.js";
|
|
14
|
+
/** Every tool name the module owns (h2a spec §4.1). */
|
|
15
|
+
export const UI_RENDER_TOOL_NAMES = [
|
|
16
|
+
"list_components",
|
|
17
|
+
"get_schema",
|
|
18
|
+
"render",
|
|
19
|
+
"render_BarChart",
|
|
20
|
+
"render_BpmnCanvas",
|
|
21
|
+
"render_DecisionDossier",
|
|
22
|
+
"submit_intent"
|
|
23
|
+
];
|
|
24
|
+
/** The pinned catalogue summaries of the normative component trio (§4.2.1). */
|
|
25
|
+
const COMPONENT_SUMMARIES = {
|
|
26
|
+
BarChart: "Categorical bar chart with optional reference lines, shaded bands, goal line, annotations, and bar selection.",
|
|
27
|
+
BpmnCanvas: "Read-only BPMN 2.0 process diagram viewer rendering F1 moddle JSON documents.",
|
|
28
|
+
DecisionDossier: "Read-only decision-dossier snapshot published by @sentropic/focus."
|
|
29
|
+
};
|
|
30
|
+
/** The intent names the §4.6 schema admits. */
|
|
31
|
+
const INTENT_NAMES = ["select", "open", "choose-option", "comment"];
|
|
32
|
+
/** The §4.6 intent input schema, verbatim. */
|
|
33
|
+
const INTENT_INPUT_SCHEMA = {
|
|
34
|
+
type: "object",
|
|
35
|
+
additionalProperties: false,
|
|
36
|
+
required: ["event", "name", "target", "context"],
|
|
37
|
+
properties: {
|
|
38
|
+
event: { const: "intent" },
|
|
39
|
+
name: { type: "string", enum: [...INTENT_NAMES] },
|
|
40
|
+
target: {
|
|
41
|
+
type: "string",
|
|
42
|
+
minLength: 1,
|
|
43
|
+
maxLength: 256,
|
|
44
|
+
description: "Identifier of the selected/targeted item (e.g. bar label key or option id)."
|
|
45
|
+
},
|
|
46
|
+
context: {
|
|
47
|
+
type: "object",
|
|
48
|
+
additionalProperties: true,
|
|
49
|
+
description: "Structured intent context (e.g. component name, question targetRef, annotation, value)."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/** The x-sentropic metadata block of one catalogue entry. */
|
|
54
|
+
function sentropicOf(entry) {
|
|
55
|
+
return entry?.["x-sentropic"];
|
|
56
|
+
}
|
|
57
|
+
/** One closed §4.5 diagnostic, as emitted by the tools themselves. */
|
|
58
|
+
function diagnostic(code, path, message, detail) {
|
|
59
|
+
return {
|
|
60
|
+
code,
|
|
61
|
+
path,
|
|
62
|
+
message,
|
|
63
|
+
severity: "error",
|
|
64
|
+
source: "catalog",
|
|
65
|
+
...(detail !== undefined ? { detail } : {})
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** A refused tool result: bounded summary text + diagnostics. */
|
|
69
|
+
function refused(args) {
|
|
70
|
+
return {
|
|
71
|
+
content: [{ type: "text", text: formatDiagnosticsSummary(args.diagnostics) }],
|
|
72
|
+
isError: true,
|
|
73
|
+
structuredContent: {
|
|
74
|
+
...(args.envelopeSha256 !== undefined
|
|
75
|
+
? { envelopeSha256: args.envelopeSha256 }
|
|
76
|
+
: { envelope: args.envelope }),
|
|
77
|
+
diagnostics: args.diagnostics
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function createUiRenderTools(options) {
|
|
82
|
+
const { assets, validator } = options;
|
|
83
|
+
const inlineLimitBytes = options.inlineLimitBytes ?? 1_048_576 - 16_384; // resolveFrameBudget default − 16 KiB (§5.2)
|
|
84
|
+
const components = Object.keys(assets.catalog.components);
|
|
85
|
+
const perComponentUri = (component) => `ui://sentropic/${component}/v1`;
|
|
86
|
+
/** Per-connection intent fallback (§4.2.4); closed sessions can be collected. */
|
|
87
|
+
const sessionStates = new WeakMap();
|
|
88
|
+
const defaultConnection = {};
|
|
89
|
+
function sessionState(context) {
|
|
90
|
+
const key = context ?? defaultConnection;
|
|
91
|
+
let state = sessionStates.get(key);
|
|
92
|
+
if (state === undefined) {
|
|
93
|
+
state = {};
|
|
94
|
+
sessionStates.set(key, state);
|
|
95
|
+
}
|
|
96
|
+
return state;
|
|
97
|
+
}
|
|
98
|
+
function cspDeclaration() {
|
|
99
|
+
return { resourceDomains: [PILOT_RESOURCE_DOMAIN], connectDomains: [] };
|
|
100
|
+
}
|
|
101
|
+
function listTools() {
|
|
102
|
+
const descriptors = [
|
|
103
|
+
{
|
|
104
|
+
name: "list_components",
|
|
105
|
+
description: "List the catalogued design-system components (name, element, contract, engine, summary).",
|
|
106
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
107
|
+
annotations: { readOnlyHint: true },
|
|
108
|
+
_meta: { ui: { visibility: ["model", "app"] } }
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "get_schema",
|
|
112
|
+
description: "Return the standalone JSON Schema and the single example envelope of one catalogued component.",
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
additionalProperties: false,
|
|
116
|
+
required: ["component"],
|
|
117
|
+
properties: {
|
|
118
|
+
component: {
|
|
119
|
+
type: "string",
|
|
120
|
+
minLength: 1,
|
|
121
|
+
maxLength: 64,
|
|
122
|
+
description: "Catalogued component name (BarChart, BpmnCanvas, DecisionDossier)."
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
annotations: { readOnlyHint: true },
|
|
127
|
+
_meta: { ui: { visibility: ["model", "app"] } }
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "render",
|
|
131
|
+
description: "Validate and render one SEP-1865 envelope (the arguments ARE the envelope: optional catalogId, contract, optional mode, root) through the linked ui:// resource.",
|
|
132
|
+
inputSchema: assets.envelopeSchema,
|
|
133
|
+
annotations: { readOnlyHint: true },
|
|
134
|
+
_meta: {
|
|
135
|
+
ui: {
|
|
136
|
+
resourceUri: "ui://sentropic/render/v1",
|
|
137
|
+
visibility: ["model", "app"],
|
|
138
|
+
csp: cspDeclaration()
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "submit_intent",
|
|
144
|
+
description: "Record an intent event dispatched by a rendered component (e.g. a bar selection) and forward it to the configured consumer.",
|
|
145
|
+
inputSchema: INTENT_INPUT_SCHEMA,
|
|
146
|
+
annotations: { readOnlyHint: true },
|
|
147
|
+
_meta: { ui: { visibility: ["app"] } }
|
|
148
|
+
}
|
|
149
|
+
];
|
|
150
|
+
for (const component of components) {
|
|
151
|
+
const schema = assets.schemas[component];
|
|
152
|
+
if (schema === undefined)
|
|
153
|
+
continue; // a workspace overlay may miss per-component schemas
|
|
154
|
+
descriptors.push({
|
|
155
|
+
name: `render_${component}`,
|
|
156
|
+
description: `Validate and render a ${component} envelope through the single-component ${perComponentUri(component)} resource.`,
|
|
157
|
+
inputSchema: schema,
|
|
158
|
+
annotations: { readOnlyHint: true },
|
|
159
|
+
_meta: {
|
|
160
|
+
ui: {
|
|
161
|
+
resourceUri: perComponentUri(component),
|
|
162
|
+
visibility: ["model", "app"],
|
|
163
|
+
csp: cspDeclaration()
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
return descriptors;
|
|
169
|
+
}
|
|
170
|
+
function listComponents() {
|
|
171
|
+
const lines = [];
|
|
172
|
+
const listed = [];
|
|
173
|
+
for (const [name, entry] of Object.entries(assets.catalog.components)) {
|
|
174
|
+
const sentropic = sentropicOf(entry);
|
|
175
|
+
const contract = typeof sentropic?.contract === "string" ? sentropic.contract : "";
|
|
176
|
+
const engine = typeof sentropic?.engine === "string" ? sentropic.engine : "";
|
|
177
|
+
const element = typeof sentropic?.element === "string" ? sentropic.element : "";
|
|
178
|
+
const summary = COMPONENT_SUMMARIES[name] ?? "";
|
|
179
|
+
const status = typeof sentropic?.status === "string" ? sentropic.status : undefined;
|
|
180
|
+
listed.push(status === undefined ? { name, element, contract, engine, summary } : { name, element, contract, engine, summary, status });
|
|
181
|
+
const statusPart = status === undefined ? "" : `, status: ${status}`;
|
|
182
|
+
lines.push(`${name} (contract ${contract}, engine ${engine}${statusPart}): ${summary}`);
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
186
|
+
structuredContent: { catalogId: assets.catalog.catalogId, components: listed }
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function getSchema(component) {
|
|
190
|
+
const entry = assets.catalog.components[component];
|
|
191
|
+
if (entry === undefined) {
|
|
192
|
+
return refused({
|
|
193
|
+
diagnostics: [
|
|
194
|
+
diagnostic("unknown-component", "/root/component", `no catalogued component is named ${component}`, { component })
|
|
195
|
+
]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (sentropicOf(entry)?.status === "unknown") {
|
|
199
|
+
return refused({
|
|
200
|
+
diagnostics: [
|
|
201
|
+
diagnostic("component-unavailable", "/root/component", `${component} is catalogued as a placeholder (x-sentropic.status "unknown") and cannot render`, { component })
|
|
202
|
+
]
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
const schema = assets.schemas[component];
|
|
206
|
+
if (schema === undefined) {
|
|
207
|
+
return refused({
|
|
208
|
+
diagnostics: [
|
|
209
|
+
diagnostic("unknown-component", "/root/component", `no standalone schema is vendored for ${component}`, { component })
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const example = {
|
|
214
|
+
catalogId: assets.catalog.catalogId,
|
|
215
|
+
contract: sentropicOf(entry)?.contract,
|
|
216
|
+
root: sentropicOf(entry)?.example
|
|
217
|
+
};
|
|
218
|
+
const structuredContent = { catalogId: assets.catalog.catalogId, schema, example };
|
|
219
|
+
return {
|
|
220
|
+
content: [
|
|
221
|
+
{
|
|
222
|
+
type: "text",
|
|
223
|
+
text: truncateUtf8Bytes(JSON.stringify(structuredContent, null, 2), 262_144)
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
structuredContent
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/** Assembles the success result of render / render_<id> for one negotiation state. */
|
|
230
|
+
function renderSuccess(args, diagnostics, structuredContent, component, resourceUri, negotiated) {
|
|
231
|
+
if (negotiated) {
|
|
232
|
+
const text = truncateUtf8Bytes(`Rendered ${component} (contract ${args.contract ?? ""}); the host displays ${resourceUri}.`, 4096);
|
|
233
|
+
return { content: [{ type: "text", text }], structuredContent };
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
content: fallbackContent(component, args.root),
|
|
237
|
+
structuredContent
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function submitIntent(args, context) {
|
|
241
|
+
const intent = args ?? {};
|
|
242
|
+
// §4.6 structural validation.
|
|
243
|
+
if (intent.event !== "intent") {
|
|
244
|
+
return refused({
|
|
245
|
+
diagnostics: [diagnostic("schema-violation", "/event", "event must be the constant \"intent\"")]
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
const name = intent.name;
|
|
249
|
+
if (typeof name !== "string" || !INTENT_NAMES.includes(name)) {
|
|
250
|
+
return refused({
|
|
251
|
+
diagnostics: [
|
|
252
|
+
diagnostic("schema-violation", "/name", `name must be one of ${INTENT_NAMES.join(", ")}`, { found: String(name) })
|
|
253
|
+
]
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
const target = intent.target;
|
|
257
|
+
if (typeof target !== "string" || target.length < 1 || target.length > 256) {
|
|
258
|
+
return refused({
|
|
259
|
+
diagnostics: [
|
|
260
|
+
diagnostic("schema-violation", "/target", "target must be a string of 1..256 characters")
|
|
261
|
+
]
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
const intentContext = intent.context;
|
|
265
|
+
if (intentContext === null || typeof intentContext !== "object" || Array.isArray(intentContext)) {
|
|
266
|
+
return refused({
|
|
267
|
+
diagnostics: [diagnostic("schema-violation", "/context", "context must be an object")]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
// Component resolution: context.component, else the last rendered component.
|
|
271
|
+
const contextComponent = intentContext.component;
|
|
272
|
+
const component = typeof contextComponent === "string"
|
|
273
|
+
? contextComponent
|
|
274
|
+
: sessionState(context).lastRenderedComponent;
|
|
275
|
+
if (component === undefined) {
|
|
276
|
+
return refused({
|
|
277
|
+
diagnostics: [
|
|
278
|
+
diagnostic("schema-violation", "/context/component", "no rendered component is known for this session; pass context.component", { component })
|
|
279
|
+
]
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
const entry = assets.catalog.components[component];
|
|
283
|
+
const events = sentropicOf(entry)?.events;
|
|
284
|
+
const permitted = Array.isArray(events) ? events.filter((e) => typeof e === "string") : [];
|
|
285
|
+
if (!permitted.includes(name)) {
|
|
286
|
+
return refused({
|
|
287
|
+
diagnostics: [
|
|
288
|
+
diagnostic("schema-violation", "/name", `"${name}" is not a permitted intent for ${component}`, { component, permitted })
|
|
289
|
+
]
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
const intentEvent = {
|
|
293
|
+
event: "intent",
|
|
294
|
+
name,
|
|
295
|
+
target,
|
|
296
|
+
context: intentContext
|
|
297
|
+
};
|
|
298
|
+
options.onIntent?.(intentEvent, context);
|
|
299
|
+
return {
|
|
300
|
+
content: [
|
|
301
|
+
{ type: "text", text: truncateUtf8Bytes(`Intent recorded: ${name} on ${target}`, 1024) }
|
|
302
|
+
],
|
|
303
|
+
structuredContent: { ok: true, intent: intentEvent }
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function callTool(name, args, context) {
|
|
307
|
+
if (name === "list_components")
|
|
308
|
+
return listComponents();
|
|
309
|
+
if (name === "get_schema") {
|
|
310
|
+
const component = args?.component;
|
|
311
|
+
if (typeof component !== "string" || component.length === 0) {
|
|
312
|
+
return refused({
|
|
313
|
+
diagnostics: [diagnostic("schema-violation", "/component", "component is required")]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return getSchema(component);
|
|
317
|
+
}
|
|
318
|
+
if (name === "render") {
|
|
319
|
+
return handleRender(undefined, "ui://sentropic/render/v1", args, context);
|
|
320
|
+
}
|
|
321
|
+
if (name === "submit_intent")
|
|
322
|
+
return submitIntent(args, context);
|
|
323
|
+
for (const component of components) {
|
|
324
|
+
if (name === `render_${component}`) {
|
|
325
|
+
return handleRender(component, perComponentUri(component), args, context);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return undefined;
|
|
329
|
+
}
|
|
330
|
+
/** The shared render / render_<id> pipeline (§4.2.3). */
|
|
331
|
+
function handleRender(pinnedComponent, resourceUri, args, context) {
|
|
332
|
+
const envelope = args ?? {};
|
|
333
|
+
const rootComponent = envelope.root && typeof envelope.root === "object"
|
|
334
|
+
? envelope.root.component
|
|
335
|
+
: undefined;
|
|
336
|
+
if (pinnedComponent !== undefined && typeof rootComponent === "string" && rootComponent !== pinnedComponent) {
|
|
337
|
+
return refused({
|
|
338
|
+
diagnostics: [
|
|
339
|
+
diagnostic("schema-violation", "/root/component", `render_${pinnedComponent} renders ${pinnedComponent} envelopes, not ${rootComponent}`, { expected: pinnedComponent, found: rootComponent })
|
|
340
|
+
],
|
|
341
|
+
envelope
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
const diagnostics = [...validator.validate(envelope)];
|
|
345
|
+
const hasError = diagnostics.some((item) => item.severity === "error");
|
|
346
|
+
if (!hasError && typeof rootComponent === "string") {
|
|
347
|
+
sessionState(context).lastRenderedComponent = rootComponent;
|
|
348
|
+
}
|
|
349
|
+
const serialized = JSON.stringify(envelope);
|
|
350
|
+
const structuredContent = utf8ByteLength(serialized) > inlineLimitBytes
|
|
351
|
+
? {
|
|
352
|
+
envelopeSha256: createHash("sha256").update(serialized, "utf8").digest("hex"),
|
|
353
|
+
diagnostics
|
|
354
|
+
}
|
|
355
|
+
: { envelope, diagnostics };
|
|
356
|
+
if (hasError) {
|
|
357
|
+
return {
|
|
358
|
+
content: [{ type: "text", text: formatDiagnosticsSummary(diagnostics) }],
|
|
359
|
+
isError: true,
|
|
360
|
+
structuredContent
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
return renderSuccess(envelope, diagnostics, structuredContent, typeof rootComponent === "string" ? rootComponent : "", resourceUri, context?.uiCapability?.negotiated === true);
|
|
364
|
+
}
|
|
365
|
+
return { listTools, callTool };
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../src/runtime/mcp/ui-render/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,qBAAqB,EAKtB,MAAM,YAAY,CAAC;AAIpB,uDAAuD;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,eAAe;CACP,CAAC;AAEX,+EAA+E;AAC/E,MAAM,mBAAmB,GAAqC;IAC5D,QAAQ,EACN,+GAA+G;IACjH,UAAU,EAAE,+EAA+E;IAC3F,eAAe,EAAE,oEAAoE;CACtF,CAAC;AAEF,+CAA+C;AAC/C,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,CAAU,CAAC;AAE7E,8CAA8C;AAC9C,MAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;IAChD,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC,EAAE;QACjD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,CAAC;YACZ,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C,UAAU,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC7E,WAAW;aACZ;YACH,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QAChC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,CAAC,WAAW,CAAC,EAAE,CAAC;gBACxE,OAAO,EAAE,IAAI;gBACb,iBAAiB;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,aAAa,CAClB,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EACtD,WAAW,EACX,OAAO,EAAE,YAAY,EAAE,UAAU,KAAK,IAAI,CAC3C,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* json-render L3 — the ui:// render module's shared types (DS spec §4, §6.5,
|
|
3
|
+
* §8; h2a spec §1.2, §3, §4). The diagnostic shape is the CLOSED §4.5 set of
|
|
4
|
+
* the JSON_RENDER standard: ten codes, five sources, one RFC 6901 `path`
|
|
5
|
+
* into the envelope, `detail` for machine extras.
|
|
6
|
+
*/
|
|
7
|
+
/** The SEP-1865 MCP App resource MIME type. */
|
|
8
|
+
export declare const UI_MIME_TYPE = "text/html;profile=mcp-app";
|
|
9
|
+
/** The A2UI component-catalogue resource MIME type. */
|
|
10
|
+
export declare const CATALOG_MIME_TYPE = "application/schema+json";
|
|
11
|
+
/** The single CDN origin the pilot asset rule allows (DS §6.4, U-12). */
|
|
12
|
+
export declare const PILOT_RESOURCE_DOMAIN = "https://cdn.jsdelivr.net";
|
|
13
|
+
/** The closed §4.5 diagnostic code set. */
|
|
14
|
+
export type DiagnosticCode = "unknown-component" | "component-unavailable" | "unsupported-contract" | "unsupported-mode" | "schema-violation" | "semantic-invalid" | "payload-too-large" | "host-capability-missing" | "engine-load-failed" | "watermark-refused";
|
|
15
|
+
/** The closed §4.5 diagnostic source set (`diagram-core` is reserved for DS L8). */
|
|
16
|
+
export type DiagnosticSource = "catalog" | "host" | "focus" | "bpmn-canvas" | "diagram-core";
|
|
17
|
+
/** The single §4.5 diagnostic shape. */
|
|
18
|
+
export interface UiRenderDiagnostic {
|
|
19
|
+
readonly code: DiagnosticCode | (string & {});
|
|
20
|
+
/** RFC 6901 JSON Pointer into the envelope ("" for the envelope itself). */
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly message: string;
|
|
23
|
+
readonly severity: "error" | "warning";
|
|
24
|
+
readonly source: DiagnosticSource;
|
|
25
|
+
readonly detail?: Readonly<Record<string, unknown>>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A finding of an injected semantic port (§4.3 item 2). `pointer` is RFC 6901
|
|
29
|
+
* RELATIVE TO THE PAYLOAD; the envelope validator anchors it into the envelope.
|
|
30
|
+
*/
|
|
31
|
+
export interface SemanticFinding {
|
|
32
|
+
readonly code: string;
|
|
33
|
+
readonly message: string;
|
|
34
|
+
readonly pointer?: string;
|
|
35
|
+
readonly severity: "error" | "warning";
|
|
36
|
+
}
|
|
37
|
+
/** The engines that can own a component's semantics (§4.3 item 2). */
|
|
38
|
+
export type EngineSource = "focus" | "bpmn-canvas" | "diagram-core";
|
|
39
|
+
/** The injected binding to one owning runtime (§4.3 item 2). */
|
|
40
|
+
export interface SemanticPort {
|
|
41
|
+
readonly source: EngineSource;
|
|
42
|
+
validate(payload: unknown): readonly SemanticFinding[];
|
|
43
|
+
}
|
|
44
|
+
/** The §4.6 intent event the mounted element dispatches (`st-intent`). */
|
|
45
|
+
export interface IntentEvent {
|
|
46
|
+
readonly event: "intent";
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly target: string;
|
|
49
|
+
readonly context: Readonly<Record<string, unknown>>;
|
|
50
|
+
}
|
|
51
|
+
/** SEP-1865 CSP domains a host must allow for the MCP App resource. */
|
|
52
|
+
export interface UiCspDeclaration {
|
|
53
|
+
readonly resourceDomains: readonly string[];
|
|
54
|
+
readonly connectDomains: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
/** The `io.modelcontextprotocol/ui` capability as negotiated per connection. */
|
|
57
|
+
export interface UiExtensionCapability {
|
|
58
|
+
readonly negotiated: boolean;
|
|
59
|
+
readonly mimeTypes: readonly string[];
|
|
60
|
+
}
|
|
61
|
+
/** One `resources/list` entry (MCP `Resource`). */
|
|
62
|
+
export interface McpResourceDescriptor {
|
|
63
|
+
readonly uri: string;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly description: string;
|
|
66
|
+
readonly mimeType: string;
|
|
67
|
+
readonly _meta?: {
|
|
68
|
+
readonly ui?: {
|
|
69
|
+
readonly csp?: UiCspDeclaration;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** One `resources/read` content entry (MCP `ResourceContents` with text). */
|
|
74
|
+
export interface McpResourceContents {
|
|
75
|
+
readonly uri: string;
|
|
76
|
+
readonly mimeType: string;
|
|
77
|
+
readonly text: string;
|
|
78
|
+
readonly _meta?: {
|
|
79
|
+
readonly ui?: {
|
|
80
|
+
readonly csp?: UiCspDeclaration;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface McpReadResourceResult {
|
|
85
|
+
readonly contents: readonly McpResourceContents[];
|
|
86
|
+
}
|
|
87
|
+
/** A typed `resources/read` refusal (-32002) for an unknown URI. */
|
|
88
|
+
export declare class UnknownResourceError extends Error {
|
|
89
|
+
readonly uri: string;
|
|
90
|
+
constructor(uri: string);
|
|
91
|
+
}
|
|
92
|
+
/** Stable per-connection context threaded by the transports (h2a spec §1.2). */
|
|
93
|
+
export interface UiRenderCallContext {
|
|
94
|
+
readonly uiCapability?: UiExtensionCapability;
|
|
95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;SACjC,CAAC;KACH,CAAC;CACH;AAED,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,CAAC,EAAE,CAAC,EAAE;YACZ,QAAQ,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACnD;AAED,oEAAoE;AACpE,qBAAa,oBAAqB,SAAQ,KAAK;aACjB,GAAG,EAAE,MAAM;gBAAX,GAAG,EAAE,MAAM;CAIxC;AAED,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC;CAC/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* json-render L3 — the ui:// render module's shared types (DS spec §4, §6.5,
|
|
3
|
+
* §8; h2a spec §1.2, §3, §4). The diagnostic shape is the CLOSED §4.5 set of
|
|
4
|
+
* the JSON_RENDER standard: ten codes, five sources, one RFC 6901 `path`
|
|
5
|
+
* into the envelope, `detail` for machine extras.
|
|
6
|
+
*/
|
|
7
|
+
/** The SEP-1865 MCP App resource MIME type. */
|
|
8
|
+
export const UI_MIME_TYPE = "text/html;profile=mcp-app";
|
|
9
|
+
/** The A2UI component-catalogue resource MIME type. */
|
|
10
|
+
export const CATALOG_MIME_TYPE = "application/schema+json";
|
|
11
|
+
/** The single CDN origin the pilot asset rule allows (DS §6.4, U-12). */
|
|
12
|
+
export const PILOT_RESOURCE_DOMAIN = "https://cdn.jsdelivr.net";
|
|
13
|
+
/** A typed `resources/read` refusal (-32002) for an unknown URI. */
|
|
14
|
+
export class UnknownResourceError extends Error {
|
|
15
|
+
uri;
|
|
16
|
+
constructor(uri) {
|
|
17
|
+
super(`Resource not found: ${uri}`);
|
|
18
|
+
this.uri = uri;
|
|
19
|
+
this.name = "UnknownResourceError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/runtime/mcp/ui-render/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAExD,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAE3D,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAkGhE,oEAAoE;AACpE,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACjB;IAA5B,YAA4B,GAAW;QACrC,KAAK,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAC;QADV,QAAG,GAAH,GAAG,CAAQ;QAErC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
|