@guuey/mcp-apps-host 0.27.0 → 0.28.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.
@@ -105,9 +105,26 @@ export declare function toolResultUiResource(block: Extract<AgBlock, {
105
105
  */
106
106
  export declare function uiLocator(uiData: JsonValue | undefined): string | undefined;
107
107
  /**
108
- * The `ui://` locator a `tool-result` block carries, from EITHER channel it
108
+ * The `ui://` locator a `tool-result` block carries, from ANY channel it
109
109
  * can arrive on — the single seam every locator reader goes through.
110
110
  *
111
+ * `_meta.ui.resourceUri` is read FIRST. Under AgJSON draft.4 (core 0.7.0) a
112
+ * kept-open result's later `tool.done` replaces the payload as a unit, so a
113
+ * final that omits `uiData` / `structuredContent` CLEARS them on the fold,
114
+ * while `_meta` (a descriptor) survives an omitting final. The view's
115
+ * identity lives there by the spec's own rule. Reading the payload channels
116
+ * alone would take a folded card dark. Under 0.6.x both channels were kept,
117
+ * so this order gives the same answer on either version.
118
+ *
119
+ * Producers differ in what they put on `_meta.ui`. A server that only MARKS
120
+ * a result as UI (`_meta.ui: {}`) and carries the locator in
121
+ * `structuredContent` names no locator here, so the payload order decides:
122
+ * the same answer as before. A server that states `_meta.ui.resourceUri`
123
+ * gets that one, even when its payload names another, because the spec makes
124
+ * `_meta.ui` the durable identity. Note that a kept-open result (`more:
125
+ * true`) is what exercises the clearing; a producer that never keeps results
126
+ * open never folds an omitting final.
127
+ *
111
128
  * AgJSON §2.1 routes a tool result's `structuredContent` by its `_meta.ui`
112
129
  * sibling: WITH the sibling it is surface data and the normalizer stamps
113
130
  * `uiData`; WITHOUT it, it is model-channel data and lands in
@@ -115,10 +132,16 @@ export declare function uiLocator(uiData: JsonValue | undefined): string | undef
115
132
  * posture; any plain-locator MCP server) therefore delivers a locator that
116
133
  * is byte-identical in shape but lives one field over — reading `uiData`
117
134
  * alone renders NOTHING for it (dark, not "expired"), and the persistence
118
- * projector minted no placeholder row (the read plane 404s). `uiData` wins
119
- * when both carry one (guuey#209 route-A finding).
135
+ * projector minted no placeholder row (the read plane 404s). Between the
136
+ * payload channels `uiData` wins when both carry one (guuey#209 route-A
137
+ * finding). The pod's `blockLocator` (nocode-runtime live-cards.ts) and the
138
+ * persisted door's `snapshotCarriesLocator` (publicApi ui-resource.ts) apply
139
+ * the same order, so live and persisted guards recognize one locator set.
120
140
  */
121
141
  export declare function toolResultLocator(block: {
142
+ _meta?: {
143
+ [key: string]: JsonValue;
144
+ };
122
145
  uiData?: JsonValue;
123
146
  structuredContent?: JsonValue;
124
147
  }): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"block-ui.d.ts","sourceRoot":"","sources":["../src/block-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,CAAC,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAExF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAU5F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAK5F;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,SAAS,GAAG,SAAS,GACzB,oBAAoB,GAAG,SAAS,CAMlC;AAED;;;;;;;;;;;;;GAaG;AACH,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string" && uri.startsWith("ui://") ? uri : undefined;
142
142
  }
143
143
  /**
144
- * The `ui://` locator a `tool-result` block carries, from EITHER channel it
144
+ * The `ui://` locator a `tool-result` block carries, from ANY channel it
145
145
  * can arrive on — the single seam every locator reader goes through.
146
146
  *
147
+ * `_meta.ui.resourceUri` is read FIRST. Under AgJSON draft.4 (core 0.7.0) a
148
+ * kept-open result's later `tool.done` replaces the payload as a unit, so a
149
+ * final that omits `uiData` / `structuredContent` CLEARS them on the fold,
150
+ * while `_meta` (a descriptor) survives an omitting final. The view's
151
+ * identity lives there by the spec's own rule. Reading the payload channels
152
+ * alone would take a folded card dark. Under 0.6.x both channels were kept,
153
+ * so this order gives the same answer on either version.
154
+ *
155
+ * Producers differ in what they put on `_meta.ui`. A server that only MARKS
156
+ * a result as UI (`_meta.ui: {}`) and carries the locator in
157
+ * `structuredContent` names no locator here, so the payload order decides:
158
+ * the same answer as before. A server that states `_meta.ui.resourceUri`
159
+ * gets that one, even when its payload names another, because the spec makes
160
+ * `_meta.ui` the durable identity. Note that a kept-open result (`more:
161
+ * true`) is what exercises the clearing; a producer that never keeps results
162
+ * open never folds an omitting final.
163
+ *
147
164
  * AgJSON §2.1 routes a tool result's `structuredContent` by its `_meta.ui`
148
165
  * sibling: WITH the sibling it is surface data and the normalizer stamps
149
166
  * `uiData`; WITHOUT it, it is model-channel data and lands in
@@ -151,11 +168,14 @@ export function uiLocator(uiData) {
151
168
  * posture; any plain-locator MCP server) therefore delivers a locator that
152
169
  * is byte-identical in shape but lives one field over — reading `uiData`
153
170
  * alone renders NOTHING for it (dark, not "expired"), and the persistence
154
- * projector minted no placeholder row (the read plane 404s). `uiData` wins
155
- * when both carry one (guuey#209 route-A finding).
171
+ * projector minted no placeholder row (the read plane 404s). Between the
172
+ * payload channels `uiData` wins when both carry one (guuey#209 route-A
173
+ * finding). The pod's `blockLocator` (nocode-runtime live-cards.ts) and the
174
+ * persisted door's `snapshotCarriesLocator` (publicApi ui-resource.ts) apply
175
+ * the same order, so live and persisted guards recognize one locator set.
156
176
  */
157
177
  export function toolResultLocator(block) {
158
- return uiLocator(block.uiData) ?? uiLocator(block.structuredContent);
178
+ return uiLocator(block._meta?.ui) ?? uiLocator(block.uiData) ?? uiLocator(block.structuredContent);
159
179
  }
160
180
  export function snapshotUiResource(cardSnapshot) {
161
181
  if (!isJsonObject(cardSnapshot))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guuey/mcp-apps-host",
3
- "version": "0.27.0",
3
+ "version": "0.28.1",
4
4
  "description": "The MCP Apps (SEP-1865) Host role for guuey's chat surfaces — view-mount narrowing across UI channels, ui:// locator rehydration by resources/read, and the sandbox-trust channel contract. Vendor-neutral: any spec-following MCP App mounts through it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,9 +33,9 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@ggui-ai/protocol": "0.20.0",
36
+ "@ggui-ai/protocol": "0.23.0",
37
37
  "@modelcontextprotocol/ext-apps": "^1.7.5",
38
- "@silverprotocol/core": "0.6.7"
38
+ "@silverprotocol/core": "0.7.2"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=18"
package/src/block-ui.ts CHANGED
@@ -176,9 +176,26 @@ export function uiLocator(uiData: JsonValue | undefined): string | undefined {
176
176
  }
177
177
 
178
178
  /**
179
- * The `ui://` locator a `tool-result` block carries, from EITHER channel it
179
+ * The `ui://` locator a `tool-result` block carries, from ANY channel it
180
180
  * can arrive on — the single seam every locator reader goes through.
181
181
  *
182
+ * `_meta.ui.resourceUri` is read FIRST. Under AgJSON draft.4 (core 0.7.0) a
183
+ * kept-open result's later `tool.done` replaces the payload as a unit, so a
184
+ * final that omits `uiData` / `structuredContent` CLEARS them on the fold,
185
+ * while `_meta` (a descriptor) survives an omitting final. The view's
186
+ * identity lives there by the spec's own rule. Reading the payload channels
187
+ * alone would take a folded card dark. Under 0.6.x both channels were kept,
188
+ * so this order gives the same answer on either version.
189
+ *
190
+ * Producers differ in what they put on `_meta.ui`. A server that only MARKS
191
+ * a result as UI (`_meta.ui: {}`) and carries the locator in
192
+ * `structuredContent` names no locator here, so the payload order decides:
193
+ * the same answer as before. A server that states `_meta.ui.resourceUri`
194
+ * gets that one, even when its payload names another, because the spec makes
195
+ * `_meta.ui` the durable identity. Note that a kept-open result (`more:
196
+ * true`) is what exercises the clearing; a producer that never keeps results
197
+ * open never folds an omitting final.
198
+ *
182
199
  * AgJSON §2.1 routes a tool result's `structuredContent` by its `_meta.ui`
183
200
  * sibling: WITH the sibling it is surface data and the normalizer stamps
184
201
  * `uiData`; WITHOUT it, it is model-channel data and lands in
@@ -186,14 +203,18 @@ export function uiLocator(uiData: JsonValue | undefined): string | undefined {
186
203
  * posture; any plain-locator MCP server) therefore delivers a locator that
187
204
  * is byte-identical in shape but lives one field over — reading `uiData`
188
205
  * alone renders NOTHING for it (dark, not "expired"), and the persistence
189
- * projector minted no placeholder row (the read plane 404s). `uiData` wins
190
- * when both carry one (guuey#209 route-A finding).
206
+ * projector minted no placeholder row (the read plane 404s). Between the
207
+ * payload channels `uiData` wins when both carry one (guuey#209 route-A
208
+ * finding). The pod's `blockLocator` (nocode-runtime live-cards.ts) and the
209
+ * persisted door's `snapshotCarriesLocator` (publicApi ui-resource.ts) apply
210
+ * the same order, so live and persisted guards recognize one locator set.
191
211
  */
192
212
  export function toolResultLocator(block: {
213
+ _meta?: { [key: string]: JsonValue };
193
214
  uiData?: JsonValue;
194
215
  structuredContent?: JsonValue;
195
216
  }): string | undefined {
196
- return uiLocator(block.uiData) ?? uiLocator(block.structuredContent);
217
+ return uiLocator(block._meta?.ui) ?? uiLocator(block.uiData) ?? uiLocator(block.structuredContent);
197
218
  }
198
219
 
199
220
  export function snapshotUiResource(cardSnapshot: JsonValue): McpUiResourcePayload | undefined {