@zackbart/connecta 0.12.0 → 0.12.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 CHANGED
@@ -2,6 +2,86 @@
2
2
 
3
3
  All notable changes to this package are documented here.
4
4
 
5
+ ## 0.12.2 — 2026-08-02
6
+
7
+ Rendered programs can now bind a small, explicit set of read-only connector
8
+ calls into their view. `connecta.ui(html, { reads })` validates every binding
9
+ against the request-local catalog before accepting the UI, and the trusted
10
+ Apps shell exposes only those names and declared view arguments through
11
+ `connecta.read`. The program markup never receives connector addresses or a
12
+ general tool channel, and mutation-capable tools remain unavailable. Existing
13
+ `connecta.ui(html)` calls are byte-for-byte unchanged and remain display-only;
14
+ deployments whose views do not need refresh, pagination, or drill-down reads
15
+ can ignore this release. No deployment configuration changes are required
16
+ (#287, #289, PR #290).
17
+
18
+ ### Added
19
+
20
+ - **Bounded read bindings for rendered views.** Programs may bind 1–32 names
21
+ to catalog addresses proven read-only, with optional fixed arguments and an
22
+ allowlist of view-supplied arguments. The manifest shares the existing
23
+ emitted-byte budget and binding does not dispatch a call or spend the
24
+ program's host-call budget.
25
+ - **A narrow `connecta.read(name, args)` view API.** The trusted outer shell
26
+ translates bound names into ordinary `call_tool` requests, reusing its
27
+ current authorization, catalog, and safety checks. It rejects unknown names,
28
+ undeclared arguments, fixed-argument overrides, and more than eight
29
+ concurrent reads.
30
+
31
+ ### Changed
32
+
33
+ - **The program UI resource advances to `/v2`.** The new shell requires the
34
+ host's MCP Apps server-tools capability and makes only `call_tool` visible to
35
+ the app; the other six meta-tools remain model-only. Display-only views do
36
+ not receive the read bridge.
37
+ - **The UI security contract is explicit.** The new design record defines the
38
+ data flow, threat model, validation rules, executor parity, and the boundary
39
+ between accepted reads and still-gated mutations.
40
+
41
+ ## 0.12.1 — 2026-08-01
42
+
43
+ Instructions, not behavior. Calling-side feedback and a first-hand run of the
44
+ render loop found the same gap twice: a program that renders a view has to guess
45
+ at shapes the text never showed it. Guessing `{ result }` for a batch entry
46
+ fails silently through optional chaining — the run succeeds, the view renders,
47
+ and it is confidently empty — so the entry envelope now rides the
48
+ `connecta.call`/`connecta.batch` capabilities bullet rather than prose three
49
+ paragraphs down. The `connecta.ui` bullet and a new `U12` state the other half:
50
+ the model reads the return value, not the view, so a program that renders one
51
+ also returns the summary built from the same variables the view renders. No
52
+ runtime path changed. The only deltas a deployment ships are the served
53
+ `execute_code` description, the served usage skill, and the docs — upgrade and
54
+ its agents simply read better instructions. Nothing breaks, and a deployment
55
+ whose agents never render a view can ignore all of it; for the ones that do,
56
+ the new text is the entire release (#282, PR #284).
57
+
58
+ ### Changed
59
+
60
+ - **The batch entry envelope is stated where it is read.**
61
+ `execute_code`'s `connecta.call`/`connecta.batch` bullet now carries
62
+ `{ address, ok: true, data }` / `{ address, ok: false, error, errorDetails }`
63
+ and says to destructure that, not a bare result. Hosts truncate long
64
+ descriptions, so the bullets are a fixed budget: the text moved weight
65
+ forward instead of adding it and came out net shorter, now under a
66
+ 4,400-character ceiling test.
67
+ - **The return value is what the model reads.** The `connecta.ui` bullet and
68
+ the new normative `U12` in `documentation/code-mode.md` bind program authors
69
+ to returning the summary built from the same variables the view renders — a
70
+ view the return value does not mirror is a view nobody in the loop can check.
71
+ Connecta enforces nothing here; it never reads the HTML or diffs it against
72
+ the return, because a heuristic there would be the host-side projection the
73
+ ethos already refuses.
74
+ - **The usage skill has a guarded-render recipe.** A "Rendering a view" section
75
+ says to fetch first and check the shape in code, and on a surprise — empty
76
+ array, missing key — to return a trimmed first record instead of rendering.
77
+ The wrong view becomes the sample you needed.
78
+ - **Result sampling on the catalog surface is refused.** The `ethos.md`
79
+ decisions table records `sample` / `dryRun` as refused: sampling is execution
80
+ and cannot ride a catalog read, most tools carry required arguments no
81
+ sampler can invent, and a program that checks the shape before rendering
82
+ already hands back the first record inside the run it was going to make
83
+ anyway, at zero new surface.
84
+
5
85
  ## 0.12.0 — 2026-08-01
6
86
 
7
87
  Programs gained a *view*. `execute_code` code can now call `connecta.ui(html)`
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * A build-time string constant, not a file read at startup: the core is
5
5
  * Web-API-only so it runs unchanged on Workers, and the same bytes have to
6
- * serve everywhere. The shell is display-only — it renders whatever HTML a
7
- * program handed `connecta.ui` inside a nested `srcdoc` frame and forwards no
8
- * channel back from that frame to the host, so program-authored markup is
9
- * inert beyond its own pixels.
6
+ * serve everywhere. It renders whatever HTML a program handed `connecta.ui`
7
+ * inside a nested `srcdoc` frame. The one-argument form forwards no channel;
8
+ * an explicitly bound view gets only named read calls through the trusted
9
+ * shell, never a raw host channel.
10
10
  *
11
11
  * The address carries a version segment because hosts are permitted to
12
- * prefetch and cache templates by URI: change these bytes, bump `v1`.
12
+ * prefetch and cache templates by URI: change these bytes, bump the version.
13
13
  */
14
14
  /** The only `ui://` URI in the system. No program input reaches it. */
15
- export declare const PROGRAM_UI_RESOURCE_URI = "ui://connecta/program-ui/v1";
15
+ export declare const PROGRAM_UI_RESOURCE_URI = "ui://connecta/program-ui/v2";
16
16
  /** The mimeType the Apps spec requires of an HTML template. */
17
17
  export declare const PROGRAM_UI_MIME_TYPE = "text/html;profile=mcp-app";
18
18
  /**
@@ -29,10 +29,12 @@ export declare const MCP_APPS_EXTENSION = "io.modelcontextprotocol/ui";
29
29
  * Apps postMessage dialect (`ui/initialize`, `ui/notifications/initialized`,
30
30
  * `ui/notifications/tool-result`, `ui/notifications/size-changed`,
31
31
  * `ui/resource-teardown`), lifts `_meta["connecta/ui"].html` out of the
32
- * delivered tool result, and puts it in a frame. It declares no CSP domains,
33
- * so the host applies its restrictive default and the `srcdoc` frame inherits
34
- * `default-src 'none'` the payload gets scripts and local interactivity,
35
- * and no network.
32
+ * delivered tool result, and puts it in a frame. An optional read manifest
33
+ * installs one narrow `connecta.read(name, args)` bridge in that inner frame;
34
+ * the outer shell maps declared names to the existing `call_tool` meta-tool.
35
+ * It declares no CSP domains, so the host applies its restrictive default and
36
+ * the `srcdoc` frame inherits `default-src 'none'` — program markup still gets
37
+ * no direct network.
36
38
  */
37
- export declare const PROGRAM_UI_SHELL_HTML = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>connecta program view</title>\n <style>\n html,\n body {\n margin: 0;\n padding: 0;\n background: transparent;\n }\n #program-view {\n display: block;\n width: 100%;\n min-height: 480px;\n border: 0;\n }\n </style>\n </head>\n <body>\n <iframe\n id=\"program-view\"\n title=\"Program-rendered view\"\n sandbox=\"allow-scripts\"\n srcdoc=\"\"\n ></iframe>\n <script>\n (function () {\n \"use strict\";\n // The host frame is the only peer this shell speaks to, in either\n // direction. The payload frame below is sandboxed to scripts alone,\n // with no same-origin escape, and is never handed a reply path:\n // anything it posts fails the source check and is dropped. There is\n // no bridge from program HTML to the host, by construction rather\n // than by validation.\n var host = window.parent;\n var view = document.getElementById(\"program-view\");\n var initializeId = \"connecta-ui-initialize\";\n var lastWidth = 0;\n var lastHeight = 0;\n\n function send(message) {\n if (!host || host === window) return;\n host.postMessage(message, \"*\");\n }\n\n function notify(method, params) {\n send({ jsonrpc: \"2.0\", method: method, params: params });\n }\n\n // Program views are fixed-height by construction. The shell has no\n // bridge to the payload frame \u2014 that is the security posture, not an\n // omission \u2014 so it can never learn the payload's content height, and\n // what it reports here is its own box: the min-height above, unless\n // the host has given it more. Taller content scrolls inside the inner\n // frame rather than growing the view. Raising the min-height is the\n // only lever; a content-height signal would cost the isolation.\n function reportSize() {\n var width = Math.ceil(document.documentElement.clientWidth);\n var height = Math.ceil(document.documentElement.scrollHeight);\n if (width === lastWidth && height === lastHeight) return;\n lastWidth = width;\n lastHeight = height;\n notify(\"ui/notifications/size-changed\", {\n width: width,\n height: height\n });\n }\n\n function payloadHtml(result) {\n if (!result || typeof result !== \"object\") return null;\n var meta = result._meta;\n if (!meta || typeof meta !== \"object\") return null;\n var payload = meta[\"connecta/ui\"];\n if (!payload || typeof payload !== \"object\") return null;\n var html = payload.html;\n return typeof html === \"string\" && html.length > 0 ? html : null;\n }\n\n function render(params) {\n var html =\n payloadHtml(params) ||\n payloadHtml(params && params.result) ||\n payloadHtml(params && params.toolResult);\n if (html === null) return;\n view.srcdoc = html;\n reportSize();\n }\n\n window.addEventListener(\"message\", function (event) {\n if (event.source !== host) return;\n var message = event.data;\n if (!message || message.jsonrpc !== \"2.0\") return;\n if (message.method === \"ui/notifications/tool-result\") {\n render(message.params);\n return;\n }\n if (message.method === \"ui/resource-teardown\") {\n // A host->view request, not a notification: the host waits for\n // this reply before it tears the view down. There is nothing to\n // release, so answer immediately rather than make it time out.\n if (message.id !== undefined && message.id !== null) {\n send({ jsonrpc: \"2.0\", id: message.id, result: {} });\n }\n return;\n }\n // Only a completed handshake earns \"initialized\". A JSON-RPC error\n // response carries the same id, and announcing initialization on one\n // would assert a handshake that never happened.\n if (message.id === initializeId && message.result !== undefined) {\n notify(\"ui/notifications/initialized\", {});\n }\n });\n\n window.addEventListener(\"resize\", reportSize);\n view.addEventListener(\"load\", reportSize);\n\n // Every field here is required by the Apps initialize schema, and a\n // conforming host rejects the request outright when one is missing \u2014\n // which would strand the shell before any tool result arrives.\n send({\n jsonrpc: \"2.0\",\n id: initializeId,\n method: \"ui/initialize\",\n params: {\n appInfo: { name: \"connecta program view\", version: \"1\" },\n appCapabilities: {},\n protocolVersion: \"2026-01-26\"\n }\n });\n reportSize();\n })();\n </script>\n </body>\n</html>\n";
39
+ export declare const PROGRAM_UI_SHELL_HTML = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>connecta program view</title>\n <style>\n html,\n body {\n margin: 0;\n padding: 0;\n background: transparent;\n }\n #program-view {\n display: block;\n width: 100%;\n min-height: 480px;\n border: 0;\n }\n </style>\n </head>\n <body>\n <iframe\n id=\"program-view\"\n title=\"Program-rendered view\"\n sandbox=\"allow-scripts\"\n srcdoc=\"\"\n ></iframe>\n <script>\n (function () {\n \"use strict\";\n // The outer shell is the only host peer. The payload frame is\n // sandboxed to scripts alone, with no same-origin escape. Its one\n // optional message dialect is handled below and translated into\n // bounded call_tool requests; raw JSON-RPC is never forwarded.\n var host = window.parent;\n var view = document.getElementById(\"program-view\");\n var initializeId = \"connecta-ui-initialize\";\n var lastWidth = 0;\n var lastHeight = 0;\n var reads = null;\n var hostCanCallTools = false;\n var nextHostRequestId = 0;\n var pendingHostReads = Object.create(null);\n var activeHostReads = 0;\n var maxActiveHostReads = 8;\n\n function send(message) {\n if (!host || host === window) return;\n host.postMessage(message, \"*\");\n }\n\n function notify(method, params) {\n send({ jsonrpc: \"2.0\", method: method, params: params });\n }\n\n // Program views are fixed-height by construction. The shell has no\n // content-height bridge to the payload frame, so it can never learn\n // the payload's content height, and\n // what it reports here is its own box: the min-height above, unless\n // the host has given it more. Taller content scrolls inside the inner\n // frame rather than growing the view. Raising the min-height is the\n // only lever; a content-height signal would cost the isolation.\n function reportSize() {\n var width = Math.ceil(document.documentElement.clientWidth);\n var height = Math.ceil(document.documentElement.scrollHeight);\n if (width === lastWidth && height === lastHeight) return;\n lastWidth = width;\n lastHeight = height;\n notify(\"ui/notifications/size-changed\", {\n width: width,\n height: height\n });\n }\n\n function payload(result) {\n if (!result || typeof result !== \"object\") return null;\n var meta = result._meta;\n if (!meta || typeof meta !== \"object\") return null;\n var value = meta[\"connecta/ui\"];\n if (!value || typeof value !== \"object\") return null;\n return typeof value.html === \"string\" && value.html.length > 0\n ? value\n : null;\n }\n\n // This function is serialized into the opaque-origin payload frame.\n // It knows no addresses and has no host channel of its own: one named\n // read request goes to the trusted outer shell and one correlated\n // result comes back.\n function payloadReadBridge() {\n \"use strict\";\n var pending = Object.create(null);\n var nextId = 0;\n\n function read(name, args) {\n return new Promise(function (resolve, reject) {\n var id = String(++nextId);\n pending[id] = { resolve: resolve, reject: reject };\n try {\n window.parent.postMessage({\n type: \"connecta/read\",\n id: id,\n name: name,\n args: args === undefined ? {} : args\n }, \"*\");\n } catch (error) {\n delete pending[id];\n reject(error);\n }\n });\n }\n\n Object.defineProperty(globalThis, \"connecta\", {\n value: Object.freeze({ read: read }),\n configurable: false,\n enumerable: true,\n writable: false\n });\n\n window.addEventListener(\"message\", function (event) {\n if (event.source !== window.parent) return;\n var message = event.data;\n if (!message || message.type !== \"connecta/read-result\") return;\n var waiter = pending[message.id];\n if (!waiter) return;\n delete pending[message.id];\n if (message.ok) waiter.resolve(message.value);\n else waiter.reject(new Error(message.error || \"Read failed\"));\n });\n }\n\n function htmlWithReadBridge(html) {\n var script =\n \"<scr\" + \"ipt>(\" + payloadReadBridge.toString() + \")();</scr\" + \"ipt>\";\n var head = /<head(?:\\s[^>]*)?>/i.exec(html);\n if (head) {\n var at = (head.index || 0) + head[0].length;\n return html.slice(0, at) + script + html.slice(at);\n }\n var document = /<html(?:\\s[^>]*)?>/i.exec(html);\n if (document) {\n var afterHtml = (document.index || 0) + document[0].length;\n return html.slice(0, afterHtml) + \"<head>\" + script + \"</head>\" + html.slice(afterHtml);\n }\n return script + html;\n }\n\n function render(params) {\n var value =\n payload(params) ||\n payload(params && params.result) ||\n payload(params && params.toolResult);\n if (value === null) return;\n reads = value.reads && typeof value.reads === \"object\"\n ? value.reads\n : null;\n view.srcdoc = reads\n ? htmlWithReadBridge(value.html)\n : value.html;\n reportSize();\n }\n\n function readError(message, fallback) {\n if (message && typeof message.message === \"string\") return message.message;\n if (message && message.data && typeof message.data.message === \"string\") {\n return message.data.message;\n }\n return fallback;\n }\n\n function finishInnerRead(innerId, ok, value) {\n if (!view.contentWindow) return;\n view.contentWindow.postMessage(ok\n ? { type: \"connecta/read-result\", id: innerId, ok: true, value: value }\n : { type: \"connecta/read-result\", id: innerId, ok: false, error: value }, \"*\");\n }\n\n function beginInnerRead(message) {\n if (!hostCanCallTools) {\n finishInnerRead(message && message.id, false, \"This host does not support app-initiated server tool calls\");\n return;\n }\n if (!message || typeof message.id !== \"string\" || typeof message.name !== \"string\") return;\n if (!reads || !Object.prototype.hasOwnProperty.call(reads, message.name)) {\n finishInnerRead(message.id, false, \"Unknown read binding\");\n return;\n }\n if (activeHostReads >= maxActiveHostReads) {\n finishInnerRead(message.id, false, \"Too many concurrent reads\");\n return;\n }\n var binding = reads[message.name];\n if (!binding || typeof binding !== \"object\" || typeof binding.address !== \"string\") {\n finishInnerRead(message.id, false, \"Invalid read binding\");\n return;\n }\n var supplied = message.args;\n if (!supplied || typeof supplied !== \"object\" || Array.isArray(supplied)) {\n finishInnerRead(message.id, false, \"Read arguments must be an object\");\n return;\n }\n var allowed = Array.isArray(binding.viewArgs) ? binding.viewArgs : [];\n var suppliedKeys = Object.keys(supplied);\n for (var i = 0; i < suppliedKeys.length; i++) {\n var key = suppliedKeys[i];\n if (allowed.indexOf(key) === -1) {\n finishInnerRead(message.id, false, \"Undeclared read argument \" + JSON.stringify(key));\n return;\n }\n }\n var args = Object.create(null);\n var fixed = binding.fixedArgs && typeof binding.fixedArgs === \"object\"\n ? binding.fixedArgs\n : {};\n Object.keys(fixed).forEach(function (key) { args[key] = fixed[key]; });\n suppliedKeys.forEach(function (key) { args[key] = supplied[key]; });\n\n var hostId = \"connecta-ui-read-\" + String(++nextHostRequestId);\n pendingHostReads[hostId] = { innerId: message.id };\n activeHostReads++;\n send({\n jsonrpc: \"2.0\",\n id: hostId,\n method: \"tools/call\",\n params: {\n name: \"call_tool\",\n arguments: {\n address: binding.address,\n args: args,\n resultMode: \"value\"\n }\n }\n });\n }\n\n function finishHostRead(message) {\n var pending = pendingHostReads[message.id];\n if (!pending) return false;\n delete pendingHostReads[message.id];\n activeHostReads--;\n if (message.error) {\n finishInnerRead(pending.innerId, false, readError(message.error, \"Host rejected read\"));\n return true;\n }\n var toolResult = message.result;\n if (!toolResult || typeof toolResult !== \"object\") {\n finishInnerRead(pending.innerId, false, \"Host returned an invalid tool result\");\n return true;\n }\n var structured = toolResult.structuredContent;\n if (toolResult.isError || (structured && structured.ok === false)) {\n var detail = structured && structured.error;\n var content = Array.isArray(toolResult.content)\n ? toolResult.content.find(function (block) { return block && block.type === \"text\"; })\n : null;\n finishInnerRead(\n pending.innerId,\n false,\n readError(detail, content && content.text ? content.text : \"Read failed\")\n );\n return true;\n }\n var value = structured && structured.ok === true &&\n Object.prototype.hasOwnProperty.call(structured, \"data\")\n ? structured.data\n : structured !== undefined\n ? structured\n : toolResult;\n finishInnerRead(pending.innerId, true, value);\n return true;\n }\n\n window.addEventListener(\"message\", function (event) {\n var message = event.data;\n if (event.source === view.contentWindow) {\n if (message && message.type === \"connecta/read\") beginInnerRead(message);\n return;\n }\n if (event.source !== host) return;\n if (!message || message.jsonrpc !== \"2.0\") return;\n if (message.id !== undefined && finishHostRead(message)) return;\n if (message.method === \"ui/notifications/tool-result\") {\n render(message.params);\n return;\n }\n if (message.method === \"ui/resource-teardown\") {\n // A host->view request, not a notification: the host waits for\n // this reply before it tears the view down. There is nothing to\n // release, so answer immediately rather than make it time out.\n if (message.id !== undefined && message.id !== null) {\n send({ jsonrpc: \"2.0\", id: message.id, result: {} });\n }\n return;\n }\n // Only a completed handshake earns \"initialized\". A JSON-RPC error\n // response carries the same id, and announcing initialization on one\n // would assert a handshake that never happened.\n if (message.id === initializeId && message.result !== undefined) {\n var capabilities = message.result.hostCapabilities;\n hostCanCallTools = Boolean(capabilities && capabilities.serverTools);\n notify(\"ui/notifications/initialized\", {});\n }\n });\n\n window.addEventListener(\"resize\", reportSize);\n view.addEventListener(\"load\", reportSize);\n\n // Every field here is required by the Apps initialize schema, and a\n // conforming host rejects the request outright when one is missing \u2014\n // which would strand the shell before any tool result arrives.\n send({\n jsonrpc: \"2.0\",\n id: initializeId,\n method: \"ui/initialize\",\n params: {\n appInfo: { name: \"connecta program view\", version: \"1\" },\n appCapabilities: {},\n protocolVersion: \"2026-01-26\"\n }\n });\n reportSize();\n })();\n </script>\n </body>\n</html>\n";
38
40
  //# sourceMappingURL=apps-shell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apps-shell.d.ts","sourceRoot":"","sources":["../src/apps-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,gEAAgE;AAChE,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,ssKAyIjC,CAAC"}
1
+ {"version":3,"file":"apps-shell.d.ts","sourceRoot":"","sources":["../src/apps-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,gEAAgE;AAChE,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,07ZAsUjC,CAAC"}
@@ -3,16 +3,16 @@
3
3
  *
4
4
  * A build-time string constant, not a file read at startup: the core is
5
5
  * Web-API-only so it runs unchanged on Workers, and the same bytes have to
6
- * serve everywhere. The shell is display-only — it renders whatever HTML a
7
- * program handed `connecta.ui` inside a nested `srcdoc` frame and forwards no
8
- * channel back from that frame to the host, so program-authored markup is
9
- * inert beyond its own pixels.
6
+ * serve everywhere. It renders whatever HTML a program handed `connecta.ui`
7
+ * inside a nested `srcdoc` frame. The one-argument form forwards no channel;
8
+ * an explicitly bound view gets only named read calls through the trusted
9
+ * shell, never a raw host channel.
10
10
  *
11
11
  * The address carries a version segment because hosts are permitted to
12
- * prefetch and cache templates by URI: change these bytes, bump `v1`.
12
+ * prefetch and cache templates by URI: change these bytes, bump the version.
13
13
  */
14
14
  /** The only `ui://` URI in the system. No program input reaches it. */
15
- export const PROGRAM_UI_RESOURCE_URI = "ui://connecta/program-ui/v1";
15
+ export const PROGRAM_UI_RESOURCE_URI = "ui://connecta/program-ui/v2";
16
16
  /** The mimeType the Apps spec requires of an HTML template. */
17
17
  export const PROGRAM_UI_MIME_TYPE = "text/html;profile=mcp-app";
18
18
  /**
@@ -29,10 +29,12 @@ export const MCP_APPS_EXTENSION = "io.modelcontextprotocol/ui";
29
29
  * Apps postMessage dialect (`ui/initialize`, `ui/notifications/initialized`,
30
30
  * `ui/notifications/tool-result`, `ui/notifications/size-changed`,
31
31
  * `ui/resource-teardown`), lifts `_meta["connecta/ui"].html` out of the
32
- * delivered tool result, and puts it in a frame. It declares no CSP domains,
33
- * so the host applies its restrictive default and the `srcdoc` frame inherits
34
- * `default-src 'none'` the payload gets scripts and local interactivity,
35
- * and no network.
32
+ * delivered tool result, and puts it in a frame. An optional read manifest
33
+ * installs one narrow `connecta.read(name, args)` bridge in that inner frame;
34
+ * the outer shell maps declared names to the existing `call_tool` meta-tool.
35
+ * It declares no CSP domains, so the host applies its restrictive default and
36
+ * the `srcdoc` frame inherits `default-src 'none'` — program markup still gets
37
+ * no direct network.
36
38
  */
37
39
  export const PROGRAM_UI_SHELL_HTML = `<!doctype html>
38
40
  <html lang="en">
@@ -65,17 +67,21 @@ export const PROGRAM_UI_SHELL_HTML = `<!doctype html>
65
67
  <script>
66
68
  (function () {
67
69
  "use strict";
68
- // The host frame is the only peer this shell speaks to, in either
69
- // direction. The payload frame below is sandboxed to scripts alone,
70
- // with no same-origin escape, and is never handed a reply path:
71
- // anything it posts fails the source check and is dropped. There is
72
- // no bridge from program HTML to the host, by construction rather
73
- // than by validation.
70
+ // The outer shell is the only host peer. The payload frame is
71
+ // sandboxed to scripts alone, with no same-origin escape. Its one
72
+ // optional message dialect is handled below and translated into
73
+ // bounded call_tool requests; raw JSON-RPC is never forwarded.
74
74
  var host = window.parent;
75
75
  var view = document.getElementById("program-view");
76
76
  var initializeId = "connecta-ui-initialize";
77
77
  var lastWidth = 0;
78
78
  var lastHeight = 0;
79
+ var reads = null;
80
+ var hostCanCallTools = false;
81
+ var nextHostRequestId = 0;
82
+ var pendingHostReads = Object.create(null);
83
+ var activeHostReads = 0;
84
+ var maxActiveHostReads = 8;
79
85
 
80
86
  function send(message) {
81
87
  if (!host || host === window) return;
@@ -87,8 +93,8 @@ export const PROGRAM_UI_SHELL_HTML = `<!doctype html>
87
93
  }
88
94
 
89
95
  // Program views are fixed-height by construction. The shell has no
90
- // bridge to the payload frame that is the security posture, not an
91
- // omission — so it can never learn the payload's content height, and
96
+ // content-height bridge to the payload frame, so it can never learn
97
+ // the payload's content height, and
92
98
  // what it reports here is its own box: the min-height above, unless
93
99
  // the host has given it more. Taller content scrolls inside the inner
94
100
  // frame rather than growing the view. Raising the min-height is the
@@ -105,30 +111,213 @@ export const PROGRAM_UI_SHELL_HTML = `<!doctype html>
105
111
  });
106
112
  }
107
113
 
108
- function payloadHtml(result) {
114
+ function payload(result) {
109
115
  if (!result || typeof result !== "object") return null;
110
116
  var meta = result._meta;
111
117
  if (!meta || typeof meta !== "object") return null;
112
- var payload = meta["connecta/ui"];
113
- if (!payload || typeof payload !== "object") return null;
114
- var html = payload.html;
115
- return typeof html === "string" && html.length > 0 ? html : null;
118
+ var value = meta["connecta/ui"];
119
+ if (!value || typeof value !== "object") return null;
120
+ return typeof value.html === "string" && value.html.length > 0
121
+ ? value
122
+ : null;
123
+ }
124
+
125
+ // This function is serialized into the opaque-origin payload frame.
126
+ // It knows no addresses and has no host channel of its own: one named
127
+ // read request goes to the trusted outer shell and one correlated
128
+ // result comes back.
129
+ function payloadReadBridge() {
130
+ "use strict";
131
+ var pending = Object.create(null);
132
+ var nextId = 0;
133
+
134
+ function read(name, args) {
135
+ return new Promise(function (resolve, reject) {
136
+ var id = String(++nextId);
137
+ pending[id] = { resolve: resolve, reject: reject };
138
+ try {
139
+ window.parent.postMessage({
140
+ type: "connecta/read",
141
+ id: id,
142
+ name: name,
143
+ args: args === undefined ? {} : args
144
+ }, "*");
145
+ } catch (error) {
146
+ delete pending[id];
147
+ reject(error);
148
+ }
149
+ });
150
+ }
151
+
152
+ Object.defineProperty(globalThis, "connecta", {
153
+ value: Object.freeze({ read: read }),
154
+ configurable: false,
155
+ enumerable: true,
156
+ writable: false
157
+ });
158
+
159
+ window.addEventListener("message", function (event) {
160
+ if (event.source !== window.parent) return;
161
+ var message = event.data;
162
+ if (!message || message.type !== "connecta/read-result") return;
163
+ var waiter = pending[message.id];
164
+ if (!waiter) return;
165
+ delete pending[message.id];
166
+ if (message.ok) waiter.resolve(message.value);
167
+ else waiter.reject(new Error(message.error || "Read failed"));
168
+ });
169
+ }
170
+
171
+ function htmlWithReadBridge(html) {
172
+ var script =
173
+ "<scr" + "ipt>(" + payloadReadBridge.toString() + ")();</scr" + "ipt>";
174
+ var head = /<head(?:\\s[^>]*)?>/i.exec(html);
175
+ if (head) {
176
+ var at = (head.index || 0) + head[0].length;
177
+ return html.slice(0, at) + script + html.slice(at);
178
+ }
179
+ var document = /<html(?:\\s[^>]*)?>/i.exec(html);
180
+ if (document) {
181
+ var afterHtml = (document.index || 0) + document[0].length;
182
+ return html.slice(0, afterHtml) + "<head>" + script + "</head>" + html.slice(afterHtml);
183
+ }
184
+ return script + html;
116
185
  }
117
186
 
118
187
  function render(params) {
119
- var html =
120
- payloadHtml(params) ||
121
- payloadHtml(params && params.result) ||
122
- payloadHtml(params && params.toolResult);
123
- if (html === null) return;
124
- view.srcdoc = html;
188
+ var value =
189
+ payload(params) ||
190
+ payload(params && params.result) ||
191
+ payload(params && params.toolResult);
192
+ if (value === null) return;
193
+ reads = value.reads && typeof value.reads === "object"
194
+ ? value.reads
195
+ : null;
196
+ view.srcdoc = reads
197
+ ? htmlWithReadBridge(value.html)
198
+ : value.html;
125
199
  reportSize();
126
200
  }
127
201
 
202
+ function readError(message, fallback) {
203
+ if (message && typeof message.message === "string") return message.message;
204
+ if (message && message.data && typeof message.data.message === "string") {
205
+ return message.data.message;
206
+ }
207
+ return fallback;
208
+ }
209
+
210
+ function finishInnerRead(innerId, ok, value) {
211
+ if (!view.contentWindow) return;
212
+ view.contentWindow.postMessage(ok
213
+ ? { type: "connecta/read-result", id: innerId, ok: true, value: value }
214
+ : { type: "connecta/read-result", id: innerId, ok: false, error: value }, "*");
215
+ }
216
+
217
+ function beginInnerRead(message) {
218
+ if (!hostCanCallTools) {
219
+ finishInnerRead(message && message.id, false, "This host does not support app-initiated server tool calls");
220
+ return;
221
+ }
222
+ if (!message || typeof message.id !== "string" || typeof message.name !== "string") return;
223
+ if (!reads || !Object.prototype.hasOwnProperty.call(reads, message.name)) {
224
+ finishInnerRead(message.id, false, "Unknown read binding");
225
+ return;
226
+ }
227
+ if (activeHostReads >= maxActiveHostReads) {
228
+ finishInnerRead(message.id, false, "Too many concurrent reads");
229
+ return;
230
+ }
231
+ var binding = reads[message.name];
232
+ if (!binding || typeof binding !== "object" || typeof binding.address !== "string") {
233
+ finishInnerRead(message.id, false, "Invalid read binding");
234
+ return;
235
+ }
236
+ var supplied = message.args;
237
+ if (!supplied || typeof supplied !== "object" || Array.isArray(supplied)) {
238
+ finishInnerRead(message.id, false, "Read arguments must be an object");
239
+ return;
240
+ }
241
+ var allowed = Array.isArray(binding.viewArgs) ? binding.viewArgs : [];
242
+ var suppliedKeys = Object.keys(supplied);
243
+ for (var i = 0; i < suppliedKeys.length; i++) {
244
+ var key = suppliedKeys[i];
245
+ if (allowed.indexOf(key) === -1) {
246
+ finishInnerRead(message.id, false, "Undeclared read argument " + JSON.stringify(key));
247
+ return;
248
+ }
249
+ }
250
+ var args = Object.create(null);
251
+ var fixed = binding.fixedArgs && typeof binding.fixedArgs === "object"
252
+ ? binding.fixedArgs
253
+ : {};
254
+ Object.keys(fixed).forEach(function (key) { args[key] = fixed[key]; });
255
+ suppliedKeys.forEach(function (key) { args[key] = supplied[key]; });
256
+
257
+ var hostId = "connecta-ui-read-" + String(++nextHostRequestId);
258
+ pendingHostReads[hostId] = { innerId: message.id };
259
+ activeHostReads++;
260
+ send({
261
+ jsonrpc: "2.0",
262
+ id: hostId,
263
+ method: "tools/call",
264
+ params: {
265
+ name: "call_tool",
266
+ arguments: {
267
+ address: binding.address,
268
+ args: args,
269
+ resultMode: "value"
270
+ }
271
+ }
272
+ });
273
+ }
274
+
275
+ function finishHostRead(message) {
276
+ var pending = pendingHostReads[message.id];
277
+ if (!pending) return false;
278
+ delete pendingHostReads[message.id];
279
+ activeHostReads--;
280
+ if (message.error) {
281
+ finishInnerRead(pending.innerId, false, readError(message.error, "Host rejected read"));
282
+ return true;
283
+ }
284
+ var toolResult = message.result;
285
+ if (!toolResult || typeof toolResult !== "object") {
286
+ finishInnerRead(pending.innerId, false, "Host returned an invalid tool result");
287
+ return true;
288
+ }
289
+ var structured = toolResult.structuredContent;
290
+ if (toolResult.isError || (structured && structured.ok === false)) {
291
+ var detail = structured && structured.error;
292
+ var content = Array.isArray(toolResult.content)
293
+ ? toolResult.content.find(function (block) { return block && block.type === "text"; })
294
+ : null;
295
+ finishInnerRead(
296
+ pending.innerId,
297
+ false,
298
+ readError(detail, content && content.text ? content.text : "Read failed")
299
+ );
300
+ return true;
301
+ }
302
+ var value = structured && structured.ok === true &&
303
+ Object.prototype.hasOwnProperty.call(structured, "data")
304
+ ? structured.data
305
+ : structured !== undefined
306
+ ? structured
307
+ : toolResult;
308
+ finishInnerRead(pending.innerId, true, value);
309
+ return true;
310
+ }
311
+
128
312
  window.addEventListener("message", function (event) {
129
- if (event.source !== host) return;
130
313
  var message = event.data;
314
+ if (event.source === view.contentWindow) {
315
+ if (message && message.type === "connecta/read") beginInnerRead(message);
316
+ return;
317
+ }
318
+ if (event.source !== host) return;
131
319
  if (!message || message.jsonrpc !== "2.0") return;
320
+ if (message.id !== undefined && finishHostRead(message)) return;
132
321
  if (message.method === "ui/notifications/tool-result") {
133
322
  render(message.params);
134
323
  return;
@@ -146,6 +335,8 @@ export const PROGRAM_UI_SHELL_HTML = `<!doctype html>
146
335
  // response carries the same id, and announcing initialization on one
147
336
  // would assert a handshake that never happened.
148
337
  if (message.id === initializeId && message.result !== undefined) {
338
+ var capabilities = message.result.hostCapabilities;
339
+ hostCanCallTools = Boolean(capabilities && capabilities.serverTools);
149
340
  notify("ui/notifications/initialized", {});
150
341
  }
151
342
  });
@@ -1 +1 @@
1
- {"version":3,"file":"apps-shell.js","sourceRoot":"","sources":["../src/apps-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEjD,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIpC,CAAC"}
1
+ {"version":3,"file":"apps-shell.js","sourceRoot":"","sources":["../src/apps-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEjD,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsUpC,CAAC"}
package/dist/execute.d.ts CHANGED
@@ -88,6 +88,15 @@ export type EmittedBlock = {
88
88
  data: string;
89
89
  mimeType: string;
90
90
  };
91
+ interface UiReadBinding {
92
+ address: string;
93
+ fixedArgs: Record<string, unknown>;
94
+ viewArgs: string[];
95
+ }
96
+ interface UiPayload {
97
+ html: string;
98
+ reads?: Record<string, UiReadBinding>;
99
+ }
91
100
  /**
92
101
  * Request-local collection for `connecta.emit` and `connecta.ui`. Budgets fail
93
102
  * loudly at the crossing call — nothing is partially accepted and prior blocks
@@ -106,9 +115,7 @@ export declare class EmitCollector {
106
115
  /** The shared transport aggregate: emitted blocks plus the UI payload. */
107
116
  bytes: number;
108
117
  /** The one accepted UI payload (U2), delivered in result `_meta` on success. */
109
- ui?: {
110
- html: string;
111
- };
118
+ ui?: UiPayload;
112
119
  /** What the blocks alone cost, so the `emitted` aggregate stays a true pair. */
113
120
  private blockBytes;
114
121
  constructor(maxBytes: number, maxBlocks: number, diagnostics?: ExecuteDiagnostics | undefined);
@@ -125,7 +132,8 @@ export declare class EmitCollector {
125
132
  * problem worth naming — that there is a second payload at all — and a
126
133
  * complaint about its type would send the author to fix the wrong thing.
127
134
  */
128
- acceptUi(raw: unknown): void;
135
+ acceptUi(...values: unknown[]): void;
136
+ acceptUiPayload(payload: UiPayload): void;
129
137
  }
130
138
  /** Convert a connector/tool name into a valid JS identifier. */
131
139
  export declare function sanitizeIdentifier(name: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAW5D,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAY3E,OAAO,EACL,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACP,MAAM,YAAY,CAAC;AAIpB,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,UAAY,CAAC;AACnD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAG7C,KAAK,0BAA0B,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,UAAU,2BAA2B;IACnC,SAAS,EAAE,0BAA0B,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,cAAM,kBAAkB;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAGvB;IACJ,WAAW,SAAK;IAChB,OAAO,SAAK;IACZ,cAAc,SAAK;IACnB,OAA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