@ggui-ai/protocol 0.2.0-alpha.4 → 0.3.0-rc.0

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.
Files changed (197) hide show
  1. package/README.md +16 -16
  2. package/dist/envelope-adapters.d.ts +6 -5
  3. package/dist/envelope-adapters.d.ts.map +1 -1
  4. package/dist/envelope-adapters.js +3 -3
  5. package/dist/envelopes/builders.d.ts +6 -32
  6. package/dist/envelopes/builders.d.ts.map +1 -1
  7. package/dist/envelopes/builders.js +3 -25
  8. package/dist/errors/version-mismatch.d.ts +1 -1
  9. package/dist/errors/version-mismatch.js +1 -1
  10. package/dist/gadgets/resolve-app-gadgets.d.ts +10 -0
  11. package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -0
  12. package/dist/gadgets/resolve-app-gadgets.js +19 -0
  13. package/dist/gadgets/resolve-contract-gadgets.d.ts +6 -6
  14. package/dist/gadgets/resolve-contract-gadgets.js +5 -5
  15. package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
  16. package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -1
  17. package/dist/gadgets/stdlib-gadgets.js +43 -22
  18. package/dist/iframe-bridge.d.ts +4 -43
  19. package/dist/iframe-bridge.d.ts.map +1 -1
  20. package/dist/iframe-bridge.js +4 -141
  21. package/dist/index.d.ts +60 -62
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +66 -61
  24. package/dist/integrations/mcp-apps.d.ts +83 -38
  25. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  26. package/dist/integrations/mcp-apps.js +98 -52
  27. package/dist/recommended-prompts.d.ts +1 -1
  28. package/dist/recommended-prompts.js +1 -1
  29. package/dist/registry/blueprint-key.d.ts +3 -0
  30. package/dist/registry/blueprint-key.d.ts.map +1 -1
  31. package/dist/registry/blueprint-key.js +9 -0
  32. package/dist/registry/blueprint-stamp.d.ts +12 -0
  33. package/dist/registry/blueprint-stamp.d.ts.map +1 -0
  34. package/dist/registry/blueprint-stamp.js +12 -0
  35. package/dist/registry/canonicalize-contract.d.ts +31 -2
  36. package/dist/registry/canonicalize-contract.d.ts.map +1 -1
  37. package/dist/registry/canonicalize-contract.js +125 -13
  38. package/dist/registry/portable-blueprint.d.ts +64 -0
  39. package/dist/registry/portable-blueprint.d.ts.map +1 -0
  40. package/dist/registry/portable-blueprint.js +103 -0
  41. package/dist/registry/summarize-contract.d.ts +7 -2
  42. package/dist/registry/summarize-contract.d.ts.map +1 -1
  43. package/dist/registry/summarize-contract.js +12 -3
  44. package/dist/registry/variant-key.d.ts +17 -0
  45. package/dist/registry/variant-key.d.ts.map +1 -0
  46. package/dist/registry/variant-key.js +22 -0
  47. package/dist/schema-learning/derive-contract.d.ts +2 -2
  48. package/dist/schema-learning/derive-contract.js +2 -2
  49. package/dist/schema-learning/merge.d.ts.map +1 -1
  50. package/dist/schema-learning/merge.js +3 -2
  51. package/dist/schemas/app-theme.d.ts +38 -0
  52. package/dist/schemas/app-theme.d.ts.map +1 -0
  53. package/dist/schemas/app-theme.js +43 -0
  54. package/dist/schemas/blueprint.d.ts +30 -11
  55. package/dist/schemas/blueprint.d.ts.map +1 -1
  56. package/dist/schemas/blueprint.js +62 -26
  57. package/dist/schemas/data-contract.d.ts +28 -30
  58. package/dist/schemas/data-contract.d.ts.map +1 -1
  59. package/dist/schemas/data-contract.js +26 -26
  60. package/dist/schemas/handshake-suggestion.d.ts +2 -4
  61. package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
  62. package/dist/schemas/handshake-suggestion.js +5 -14
  63. package/dist/schemas/mcp.d.ts +240 -58
  64. package/dist/schemas/mcp.d.ts.map +1 -1
  65. package/dist/schemas/mcp.js +285 -93
  66. package/dist/schemas/ops-blueprint.d.ts +12 -12
  67. package/dist/schemas/ops-blueprint.d.ts.map +1 -1
  68. package/dist/schemas/ops-blueprint.js +14 -24
  69. package/dist/screen-blueprints/define.d.ts +2 -2
  70. package/dist/screen-blueprints/match.d.ts +12 -7
  71. package/dist/screen-blueprints/match.d.ts.map +1 -1
  72. package/dist/screen-blueprints/match.js +7 -5
  73. package/dist/screen-blueprints/types.d.ts +14 -18
  74. package/dist/screen-blueprints/types.d.ts.map +1 -1
  75. package/dist/transport/websocket.d.ts +5 -26
  76. package/dist/transport/websocket.d.ts.map +1 -1
  77. package/dist/types/app-config.d.ts +0 -1
  78. package/dist/types/app-config.d.ts.map +1 -1
  79. package/dist/types/auth.d.ts +1 -46
  80. package/dist/types/auth.d.ts.map +1 -1
  81. package/dist/types/blueprint-source.d.ts +123 -0
  82. package/dist/types/blueprint-source.d.ts.map +1 -0
  83. package/dist/types/blueprint-source.js +126 -0
  84. package/dist/types/blueprint.d.ts +25 -18
  85. package/dist/types/blueprint.d.ts.map +1 -1
  86. package/dist/types/contract-inference.d.ts +2 -43
  87. package/dist/types/contract-inference.d.ts.map +1 -1
  88. package/dist/types/data-contract.d.ts +59 -344
  89. package/dist/types/data-contract.d.ts.map +1 -1
  90. package/dist/types/data-contract.js +5 -12
  91. package/dist/types/events.d.ts +31 -69
  92. package/dist/types/events.d.ts.map +1 -1
  93. package/dist/types/{render-event.d.ts → ggui-session-event.d.ts} +15 -15
  94. package/dist/types/ggui-session-event.d.ts.map +1 -0
  95. package/dist/types/{render-event.js → ggui-session-event.js} +5 -5
  96. package/dist/types/handshake-suggestion.d.ts +49 -35
  97. package/dist/types/handshake-suggestion.d.ts.map +1 -1
  98. package/dist/types/host-context.d.ts +8 -8
  99. package/dist/types/host-context.d.ts.map +1 -1
  100. package/dist/types/host-context.js +5 -5
  101. package/dist/types/invoke.d.ts +1 -13
  102. package/dist/types/invoke.d.ts.map +1 -1
  103. package/dist/types/{canvas-lifecycle.d.ts → lifecycle.d.ts} +35 -37
  104. package/dist/types/lifecycle.d.ts.map +1 -0
  105. package/dist/types/{canvas-lifecycle.js → lifecycle.js} +12 -14
  106. package/dist/types/live-channel.d.ts +48 -104
  107. package/dist/types/live-channel.d.ts.map +1 -1
  108. package/dist/types/llm.d.ts +13 -24
  109. package/dist/types/llm.d.ts.map +1 -1
  110. package/dist/types/llm.js +23 -53
  111. package/dist/types/mcp.d.ts +55 -176
  112. package/dist/types/mcp.d.ts.map +1 -1
  113. package/dist/types/mcp.js +2 -2
  114. package/dist/types/oauth-user-id.d.ts +12 -0
  115. package/dist/types/oauth-user-id.d.ts.map +1 -0
  116. package/dist/types/oauth-user-id.js +10 -0
  117. package/dist/types/portable-blueprint.d.ts +53 -0
  118. package/dist/types/portable-blueprint.d.ts.map +1 -0
  119. package/dist/types/portable-blueprint.js +8 -0
  120. package/dist/types/{session.d.ts → render.d.ts} +51 -53
  121. package/dist/types/render.d.ts.map +1 -0
  122. package/dist/types/thread.d.ts.map +1 -1
  123. package/dist/types/thread.js +3 -3
  124. package/dist/types/ui-generator.d.ts +5 -46
  125. package/dist/types/ui-generator.d.ts.map +1 -1
  126. package/dist/types/ui-generator.js +1 -53
  127. package/dist/validation/ajv-runtime.d.ts +3 -3
  128. package/dist/validation/ajv-runtime.d.ts.map +1 -1
  129. package/dist/validation/ajv-runtime.js +6 -5
  130. package/dist/validation/contract-validator.d.ts +23 -22
  131. package/dist/validation/contract-validator.d.ts.map +1 -1
  132. package/dist/validation/contract-validator.js +28 -26
  133. package/dist/validation/cross-references.d.ts +3 -3
  134. package/dist/validation/cross-references.js +3 -3
  135. package/dist/validation/hygiene-rules.d.ts +9 -9
  136. package/dist/validation/hygiene-rules.js +13 -13
  137. package/dist/validation/is-record.d.ts +17 -0
  138. package/dist/validation/is-record.d.ts.map +1 -0
  139. package/dist/validation/is-record.js +18 -0
  140. package/dist/validation/lint-contract.d.ts +1 -1
  141. package/dist/validation/lint-contract.js +3 -3
  142. package/dist/validation/name-invariants.d.ts +4 -4
  143. package/dist/validation/name-invariants.js +4 -4
  144. package/dist/validation/reserved-channels.d.ts +43 -46
  145. package/dist/validation/reserved-channels.d.ts.map +1 -1
  146. package/dist/validation/reserved-channels.js +14 -177
  147. package/dist/validation/resolve-stream-channel.d.ts +3 -9
  148. package/dist/validation/resolve-stream-channel.d.ts.map +1 -1
  149. package/dist/validation/resolve-stream-channel.js +3 -4
  150. package/dist/validation/sanitize-error.d.ts +10 -9
  151. package/dist/validation/sanitize-error.d.ts.map +1 -1
  152. package/dist/validation/sanitize-error.js +19 -18
  153. package/dist/validation/schema-compat-invariants.d.ts +1 -1
  154. package/dist/validation/schema-compat-invariants.js +3 -3
  155. package/dist/validation/schema-meta-validation.d.ts +4 -4
  156. package/dist/validation/schema-meta-validation.d.ts.map +1 -1
  157. package/dist/validation/schema-meta-validation.js +7 -9
  158. package/dist/validation/schema-subset.d.ts +9 -8
  159. package/dist/validation/schema-subset.d.ts.map +1 -1
  160. package/dist/validation/ui-security.d.ts +0 -17
  161. package/dist/validation/ui-security.d.ts.map +1 -1
  162. package/dist/validation/ui-security.js +17 -22
  163. package/dist/validation/zod-to-json-schema.d.ts +1 -1
  164. package/dist/validation/zod-to-json-schema.d.ts.map +1 -1
  165. package/dist/validation/zod-to-json-schema.js +4 -3
  166. package/dist/version.d.ts +783 -9
  167. package/dist/version.d.ts.map +1 -1
  168. package/dist/version.js +782 -8
  169. package/package.json +2 -2
  170. package/dist/bridge/invoke-agent.d.ts +0 -65
  171. package/dist/bridge/invoke-agent.d.ts.map +0 -1
  172. package/dist/bridge/invoke-agent.js +0 -113
  173. package/dist/stream/stream-parser.d.ts +0 -62
  174. package/dist/stream/stream-parser.d.ts.map +0 -1
  175. package/dist/stream/stream-parser.js +0 -199
  176. package/dist/types/canvas-lifecycle.d.ts.map +0 -1
  177. package/dist/types/credential.d.ts +0 -41
  178. package/dist/types/credential.d.ts.map +0 -1
  179. package/dist/types/credential.js +0 -32
  180. package/dist/types/data-bindings.d.ts +0 -322
  181. package/dist/types/data-bindings.d.ts.map +0 -1
  182. package/dist/types/data-bindings.js +0 -29
  183. package/dist/types/feedback.d.ts +0 -22
  184. package/dist/types/feedback.d.ts.map +0 -1
  185. package/dist/types/feedback.js +0 -7
  186. package/dist/types/mcp-proxy.d.ts +0 -67
  187. package/dist/types/mcp-proxy.d.ts.map +0 -1
  188. package/dist/types/mcp-proxy.js +0 -46
  189. package/dist/types/openrouter-models.d.ts +0 -23
  190. package/dist/types/openrouter-models.d.ts.map +0 -1
  191. package/dist/types/openrouter-models.js +0 -4843
  192. package/dist/types/region.d.ts +0 -26
  193. package/dist/types/region.d.ts.map +0 -1
  194. package/dist/types/region.js +0 -36
  195. package/dist/types/render-event.d.ts.map +0 -1
  196. package/dist/types/session.d.ts.map +0 -1
  197. /package/dist/types/{session.js → render.js} +0 -0
@@ -4,10 +4,10 @@
4
4
  * Events prefixed with `ggui-` are `postMessage` types (cross-origin iframe boundary).
5
5
  * Events prefixed with `ggui:` are `CustomEvent` names (same-origin, dispatched on `window`).
6
6
  *
7
- * The bridge has three directions:
8
- * 1. **Agent to Component** (inbound): data, streams, progress
9
- * 2. **Component to Agent** (outbound): user interactions (form submits, clicks)
10
- * 3. **Component to Host** (outbound): rendering lifecycle (resize, success, error)
7
+ * The bridge is one-directional: **Agent to Component** (inbound) data
8
+ * deliveries. Outbound user interaction does NOT travel over this bridge —
9
+ * generated components emit canonical `data:submit` ActionEnvelopes via the
10
+ * wire-config action hooks (`useAction`) over the live channel.
11
11
  */
12
12
  export const BRIDGE_EVENTS = {
13
13
  // === Agent → Component (inbound via ggui_emit) ===
@@ -15,27 +15,6 @@ export const BRIDGE_EVENTS = {
15
15
  AGENT_DATA_POST: 'ggui-agent-data',
16
16
  /** `CustomEvent` name dispatched on `window` when agent data arrives. Components listen for this to receive real-time data from the agent (chat messages, typing indicators, etc.). */
17
17
  AGENT_DATA: 'ggui:agent-data',
18
- // === Agent → Component (inbound via streaming) ===
19
- /** `CustomEvent` name for streaming text chunks from the agent. Fired incrementally as the agent generates a response. */
20
- AGENT_STREAM: 'ggui:agent-stream',
21
- // === Agent → Shell (inbound agent messages) ===
22
- /** `CustomEvent` name for agent messages. Payload includes `type: 'thinking' | 'chat'`. Thinking messages show what the agent is doing; chat messages are final responses. */
23
- AGENT_MSG: 'ggui:agent-msg',
24
- // === Platform → Shell (inbound via generation logs) ===
25
- /** `CustomEvent` name for UI generation log updates. Debug/devtools only — not displayed to end users. */
26
- AGENT_LOGS: 'ggui:logs',
27
- // === Component → Agent (outbound via user interaction) ===
28
- /** `postMessage` type for iframe-to-parent user interaction data. Carries form submissions and click events from generated components back to the host. */
29
- USER_DATA_POST: 'ggui-user-data',
30
- /** `CustomEvent` name dispatched on the parent window when user data arrives from the iframe. The host shell listens for this to forward events to the agent. */
31
- USER_DATA: 'ggui:user-data',
32
- // === Component → Host (outbound via rendering lifecycle) ===
33
- /** `postMessage` type sent when a component's content size changes. Used by the host to auto-resize the iframe to fit content. */
34
- RESIZE: 'ggui-resize',
35
- /** `postMessage` type sent when a component renders successfully. The host uses this to hide loading indicators and show the component. */
36
- RENDER_SUCCESS: 'ggui-render-success',
37
- /** `postMessage` type sent when a component fails to render. The host uses this to show an error state instead of a blank iframe. */
38
- RENDER_ERROR: 'ggui-render-error',
39
18
  };
40
19
  /**
41
20
  * Srcdoc JS snippet: bridge agent data postMessages into CustomEvents inside iframe.
@@ -48,119 +27,3 @@ export const SRCDOC_AGENT_DATA_BRIDGE = `
48
27
  window.dispatchEvent(new CustomEvent("ggui:agent-data", { detail: event.data.payload }));
49
28
  }
50
29
  });`;
51
- /**
52
- * Srcdoc JS snippet: auto-report content height changes to parent.
53
- *
54
- * Uses a ResizeObserver on <html> to detect layout changes and posts
55
- * a `ggui-resize` message with the current scrollHeight. Also fires
56
- * an initial measurement on the next animation frame after injection.
57
- *
58
- * Inject this into any srcdoc or rendered page <script> so the parent
59
- * can auto-size the iframe to fit content without scrollbars.
60
- */
61
- export const SRCDOC_RESIZE_BRIDGE = `
62
- (function() {
63
- var resizeObserver = new ResizeObserver(function() {
64
- parent.postMessage({ type: "${BRIDGE_EVENTS.RESIZE}", height: document.documentElement.scrollHeight }, "*");
65
- });
66
- resizeObserver.observe(document.documentElement);
67
- // Initial measurement after first paint
68
- requestAnimationFrame(function() {
69
- parent.postMessage({ type: "${BRIDGE_EVENTS.RESIZE}", height: document.documentElement.scrollHeight }, "*");
70
- });
71
- })();`;
72
- /**
73
- * Srcdoc JS snippet: universal interaction bridge inside iframe.
74
- *
75
- * Three layers of automatic event capture (no props.onSubmit needed):
76
- * 1. Form submit intercept — captures <form> submissions with all field data
77
- * 2. Interactive element clicks — buttons, [role="button"], links, [data-action]
78
- * 3. Cursor-pointer fallback (approach C) — any styled-clickable div/span/card
79
- *
80
- * All layers skip if props.onSubmit already handled the event (__ggui_submitHandled).
81
- * Click handler uses bubble phase so component handlers run first.
82
- */
83
- export const SRCDOC_USER_DATA_BRIDGE = `
84
- // Dedup: props.onSubmit sets __ggui_submitHandled = true synchronously.
85
- // Both layers check this. We use a microtask to reset it so it stays
86
- // true for ALL handlers in the same event cycle (click + submit).
87
- function __ggui_wasHandled() {
88
- if (!window.__ggui_submitHandled) return false;
89
- // Reset via microtask — stays true for all sync handlers in this tick
90
- Promise.resolve().then(function() { window.__ggui_submitHandled = false; });
91
- return true;
92
- }
93
-
94
- // Layer 1: Form submit intercept (bubble phase — lets component onSubmit run first)
95
- // Handles: <form> submit via enter key or submit-button click.
96
- // Uses bubble phase so component's onSubmit (which may call props.onSubmit) fires first.
97
- document.addEventListener("submit", function(e) {
98
- e.preventDefault();
99
- if (__ggui_wasHandled()) return;
100
- var form = e.target;
101
- var data = {};
102
- try { data = Object.fromEntries(new FormData(form)); } catch(_) {}
103
- parent.postMessage({ type: "ggui-user-data", data: data }, "*");
104
- });
105
-
106
- // Layers 2+3: Universal click handler (bubble phase — runs after component handlers)
107
- // Handles: buttons, [role="button"], links, [data-action], cursor:pointer elements.
108
- // Does NOT handle submit-type elements inside forms (Layer 1 handles those).
109
- document.addEventListener("click", function(e) {
110
- if (__ggui_wasHandled()) return;
111
- if (!e.target || !e.target.closest) return;
112
-
113
- // Layer 2: Find the closest standard interactive element
114
- var el = e.target.closest("button")
115
- || e.target.closest("[role='button']")
116
- || e.target.closest("a[href], a[data-action]")
117
- || e.target.closest("[data-action]")
118
- || e.target.closest("[data-ggui-action]");
119
-
120
- // Layer 3 (approach C): Fallback — walk up DOM looking for cursor:pointer
121
- if (!el) {
122
- var target = e.target;
123
- var depth = 0;
124
- while (target && target !== document.documentElement && depth < 6) {
125
- if (target.nodeType === 1) {
126
- try {
127
- if (window.getComputedStyle(target).cursor === "pointer") {
128
- el = target;
129
- break;
130
- }
131
- } catch(_) {}
132
- }
133
- target = target.parentElement;
134
- depth++;
135
- }
136
- }
137
- if (!el) return;
138
-
139
- // Skip submit-type elements inside forms — Layer 1 handles those.
140
- // (click fires before submit, so we must yield to avoid double-fire)
141
- // <button> defaults to type="submit", so el.type === "submit" catches both
142
- // <button> and <button type="submit">. Only <button type="button"> is excluded.
143
- if (el.closest("form") && el.type === "submit") return;
144
-
145
- // Skip form control elements — these are data entry, not actions.
146
- // Checkboxes, radios, inputs, selects get captured via form submit (Layer 1).
147
- var tag = el.tagName;
148
- if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || tag === "LABEL") return;
149
-
150
- // For standalone interactive elements, post click event with label + data attributes
151
- var data = { action: "click" };
152
- var label = el.getAttribute("aria-label")
153
- || el.getAttribute("data-label")
154
- || el.innerText
155
- || el.textContent;
156
- if (label) data.label = label.trim().substring(0, 200);
157
-
158
- // Spread data-* attributes into payload (data-action, data-value, etc.)
159
- if (el.dataset) {
160
- for (var key in el.dataset) {
161
- if (el.dataset.hasOwnProperty(key)) data[key] = el.dataset[key];
162
- }
163
- }
164
-
165
- parent.postMessage({ type: "ggui-user-data", data: data }, "*");
166
- });`;
package/dist/index.d.ts CHANGED
@@ -1,63 +1,61 @@
1
- export * from './version';
2
- export * from './types/auth';
3
- export * from './types/capabilities';
4
- export * from './types/events';
5
- export * from './types/region';
6
- export * from './types/session';
7
- export * from './types/render-event';
8
- export * from './types/thread';
9
- export * from './types/live-channel';
10
- export * from './types/ui-generator';
11
- export * from './types/mcp';
12
- export * from './schemas/mcp';
13
- export * from './schemas/invoke';
14
- export * from './schemas/data-contract';
15
- export { canonicalizeContracts, canonicalizeValue, } from './registry/canonicalize-contract';
16
- export { summarizeContract } from './registry/summarize-contract';
17
- export type { TextBlock, ToolUseBlock, ToolResultBlock, ContentBlock, TextDelta, InputJsonDelta, ContentBlockDeltaPayload, MessageStartEvent, ContentBlockStartEvent, ContentBlockDeltaEvent, ContentBlockStopEvent, MessageDeltaEvent, MessageStopEvent, PingEvent, ErrorEvent, InvokeEvent, InvokeErrorCode, InvokeTurn, InvokeRequest, } from './types/invoke';
18
- export * from './types/llm';
19
- export * from './types/llm-route';
20
- export * from './types/openrouter-models';
21
- export * from './types/interface-context';
22
- export * from './types/host-context';
23
- export * from './types/canvas-lifecycle';
24
- export * from './types/data-bindings';
25
- export * from './types/feedback';
26
- export * from './types/data-contract';
27
- export * from './types/blueprint';
28
- export * from './schemas/blueprint';
29
- export * from './types/handshake-suggestion';
30
- export * from './schemas/handshake-suggestion';
31
- export * from './schemas/ops-blueprint';
32
- export * from './types/contract-inference';
33
- export * from './types/gadget';
34
- export * from './types/app-config';
35
- export * from './iframe-bridge';
36
- export * from './envelope-adapters';
37
- export * from './envelopes/builders';
38
- export * from './errors/version-mismatch';
39
- export * from './errors/unknown-permission-name';
40
- export * from './validation/contract-validator';
41
- export * from './validation/cross-references';
42
- export * from './validation/hygiene-rules';
43
- export * from './validation/lint-contract';
44
- export * from './validation/name-invariants';
45
- export * from './validation/schema-compat-invariants';
46
- export * from './validation/schema-meta-validation';
47
- export * from './validation/resolve-stream-channel';
48
- export * from './validation/reserved-channels';
49
- export * from './validation/sanitize-error';
50
- export * from './validation/schema-subset';
51
- export * from './validation/zod-to-json-schema';
52
- export * from './validation/ui-security';
53
- export * from './stream/stream-parser';
54
- export * from './bridge/invoke-agent';
55
- export * from './schema-learning/merge';
56
- export * from './schema-learning/derive-contract';
57
- export * from './screen-blueprints/index';
58
- export * from './types/credential';
59
- export { GGUI_AGENT_SYSTEM_PROMPT } from './recommended-prompts';
60
- export * from './types/mcp-proxy';
61
- export { STDLIB_GADGETS, STDLIB_GADGETS_PACKAGE, STDLIB_GADGETS_VERSION, STDLIB_GADGET_HOOKS, } from './gadgets/stdlib-gadgets';
62
- export { filterDescriptorsToContract, gadgetIdentityKey, gadgetExportName, listContractGadgets, } from './gadgets/resolve-contract-gadgets';
1
+ export * from "./version";
2
+ export * from "./types/auth";
3
+ export * from "./types/capabilities";
4
+ export * from "./types/events";
5
+ export * from "./types/render";
6
+ export * from "./types/ggui-session-event";
7
+ export * from "./types/thread";
8
+ export * from "./types/live-channel";
9
+ export * from "./types/ui-generator";
10
+ export * from "./types/mcp";
11
+ export * from "./schemas/mcp";
12
+ export * from "./schemas/invoke";
13
+ export * from "./schemas/data-contract";
14
+ export * from "./schemas/app-theme";
15
+ export { canonicalizeContracts, canonicalizeValue } from "./registry/canonicalize-contract";
16
+ export { summarizeContract } from "./registry/summarize-contract";
17
+ export type { TextBlock, ToolUseBlock, ToolResultBlock, ContentBlock, InvokeEvent, InvokeErrorCode, InvokeTurn, } from "./types/invoke";
18
+ export * from "./types/llm";
19
+ export * from "./types/llm-route";
20
+ export * from "./types/interface-context";
21
+ export * from "./types/host-context";
22
+ export * from "./types/lifecycle";
23
+ export * from "./types/data-contract";
24
+ export * from "./types/blueprint";
25
+ export * from "./types/blueprint-source";
26
+ export * from "./types/portable-blueprint";
27
+ export * from "./schemas/blueprint";
28
+ export * from "./types/handshake-suggestion";
29
+ export * from "./schemas/handshake-suggestion";
30
+ export * from "./schemas/ops-blueprint";
31
+ export * from "./types/contract-inference";
32
+ export * from "./types/gadget";
33
+ export * from "./types/app-config";
34
+ export { composeOAuthUserId } from "./types/oauth-user-id.js";
35
+ export * from "./iframe-bridge";
36
+ export * from "./envelope-adapters";
37
+ export * from "./envelopes/builders";
38
+ export * from "./errors/version-mismatch";
39
+ export * from "./errors/unknown-permission-name";
40
+ export * from "./validation/contract-validator";
41
+ export * from "./validation/cross-references";
42
+ export * from "./validation/is-record";
43
+ export * from "./validation/hygiene-rules";
44
+ export * from "./validation/lint-contract";
45
+ export * from "./validation/name-invariants";
46
+ export * from "./validation/schema-compat-invariants";
47
+ export * from "./validation/schema-meta-validation";
48
+ export * from "./validation/resolve-stream-channel";
49
+ export * from "./validation/reserved-channels";
50
+ export * from "./validation/sanitize-error";
51
+ export * from "./validation/schema-subset";
52
+ export * from "./validation/zod-to-json-schema";
53
+ export * from "./validation/ui-security";
54
+ export * from "./schema-learning/merge";
55
+ export * from "./schema-learning/derive-contract";
56
+ export * from "./screen-blueprints/index";
57
+ export { GGUI_AGENT_SYSTEM_PROMPT } from "./recommended-prompts";
58
+ export { STDLIB_GADGETS, STDLIB_GADGETS_PACKAGE, STDLIB_GADGETS_VERSION, STDLIB_GADGET_HOOKS, } from "./gadgets/stdlib-gadgets";
59
+ export { resolveAppGadgets } from './gadgets/resolve-app-gadgets';
60
+ export { filterDescriptorsToContract, gadgetIdentityKey, gadgetExportName, listContractGadgets, } from "./gadgets/resolve-contract-gadgets";
63
61
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAI/B,cAAc,sBAAsB,CAAC;AAOrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAIxC,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,kCAAkC,CAAC;AAK1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,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oC,CAAC"}
package/dist/index.js CHANGED
@@ -1,80 +1,85 @@
1
- export * from './version.js';
2
- export * from './types/auth.js';
3
- export * from './types/capabilities.js';
4
- export * from './types/events.js';
5
- export * from './types/region.js';
6
- export * from './types/session.js';
7
- export * from './types/render-event.js';
8
- export * from './types/thread.js';
1
+ export * from "./version.js";
2
+ export * from "./types/auth.js";
3
+ export * from "./types/capabilities.js";
4
+ export * from "./types/events.js";
5
+ export * from "./types/render.js";
6
+ export * from "./types/ggui-session-event.js";
7
+ export * from "./types/thread.js";
9
8
  // Live-channel contract payload types — SubscribePayload / AckPayload /
10
9
  // StreamEnvelope / etc. The WHAT each live-channel message carries,
11
10
  // independent of how the wire frames it.
12
- export * from './types/live-channel.js';
11
+ export * from "./types/live-channel.js";
13
12
  // WebSocket transport envelope (WebSocketMessage / WebSocketMessageType
14
13
  // / ConnectionStatus) is NOT re-exported at root. Transport implementors
15
14
  // import it from the dedicated subpath: `@ggui-ai/protocol/transport/
16
15
  // websocket`. That keeps `@ggui-ai/protocol`'s root surface free of
17
16
  // wire-framing baggage — consumers that only need contract shapes don't
18
17
  // pay the transport types' weight.
19
- export * from './types/ui-generator.js';
20
- export * from './types/mcp.js';
21
- export * from './schemas/mcp.js';
22
- export * from './schemas/invoke.js';
23
- export * from './schemas/data-contract.js';
18
+ export * from "./types/ui-generator.js";
19
+ export * from "./types/mcp.js";
20
+ export * from "./schemas/mcp.js";
21
+ export * from "./schemas/invoke.js";
22
+ export * from "./schemas/data-contract.js";
23
+ // Per-app theme overlay — `AppTheme` + injection-safe `appThemeSchema`
24
+ // (`--ggui-*` css-var map). Consumed by the deploy/persist path (ggui.json
25
+ // → managed cloud app) and projected into the rendered iframe's `:root`.
26
+ export * from "./schemas/app-theme.js";
24
27
  // Registry-side helpers — pure utilities for computing the canonical
25
28
  // identity hash of a DataContract shape. Consumed by the Tier 1
26
29
  // exact-match path of the blueprint registry.
27
- export { canonicalizeContracts, canonicalizeValue, } from './registry/canonicalize-contract.js';
30
+ export { canonicalizeContracts, canonicalizeValue } from "./registry/canonicalize-contract.js";
28
31
  // `blueprintKey` lives at `@ggui-ai/protocol/blueprint-key` (server-only).
29
32
  // It pulls in `node:crypto`, which browsers can't bundle. Same convention
30
33
  // as `./content-hash`. Server consumers import from the subpath:
31
34
  // import { blueprintKey } from '@ggui-ai/protocol/blueprint-key';
32
- export { summarizeContract } from './registry/summarize-contract.js';
33
- export * from './types/llm.js';
34
- export * from './types/llm-route.js';
35
- export * from './types/openrouter-models.js';
36
- export * from './types/interface-context.js';
37
- export * from './types/host-context.js';
38
- export * from './types/canvas-lifecycle.js';
39
- export * from './types/data-bindings.js';
40
- export * from './types/feedback.js';
41
- export * from './types/data-contract.js';
42
- export * from './types/blueprint.js';
43
- export * from './schemas/blueprint.js';
44
- export * from './types/handshake-suggestion.js';
45
- export * from './schemas/handshake-suggestion.js';
35
+ export { summarizeContract } from "./registry/summarize-contract.js";
36
+ export * from "./types/llm.js";
37
+ export * from "./types/llm-route.js";
38
+ export * from "./types/interface-context.js";
39
+ export * from "./types/host-context.js";
40
+ export * from "./types/lifecycle.js";
41
+ export * from "./types/data-contract.js";
42
+ export * from "./types/blueprint.js";
43
+ export * from "./types/blueprint-source.js";
44
+ export * from "./types/portable-blueprint.js";
45
+ export * from "./schemas/blueprint.js";
46
+ export * from "./types/handshake-suggestion.js";
47
+ export * from "./schemas/handshake-suggestion.js";
46
48
  // Operator-class blueprint tool schemas. Lives alongside the blueprint
47
49
  // type schemas so handlers + cloud pod + console + fixtures all import
48
50
  // the wire shape from one place.
49
- export * from './schemas/ops-blueprint.js';
50
- export * from './types/contract-inference.js';
51
- export * from './types/gadget.js';
52
- export * from './types/app-config.js';
53
- export * from './iframe-bridge.js';
54
- export * from './envelope-adapters.js';
55
- export * from './envelopes/builders.js';
56
- export * from './errors/version-mismatch.js';
57
- export * from './errors/unknown-permission-name.js';
58
- export * from './validation/contract-validator.js';
59
- export * from './validation/cross-references.js';
60
- export * from './validation/hygiene-rules.js';
61
- export * from './validation/lint-contract.js';
62
- export * from './validation/name-invariants.js';
63
- export * from './validation/schema-compat-invariants.js';
64
- export * from './validation/schema-meta-validation.js';
65
- export * from './validation/resolve-stream-channel.js';
66
- export * from './validation/reserved-channels.js';
67
- export * from './validation/sanitize-error.js';
68
- export * from './validation/schema-subset.js';
69
- export * from './validation/zod-to-json-schema.js';
70
- export * from './validation/ui-security.js';
71
- export * from './stream/stream-parser.js';
72
- export * from './bridge/invoke-agent.js';
73
- export * from './schema-learning/merge.js';
74
- export * from './schema-learning/derive-contract.js';
75
- export * from './screen-blueprints/index.js';
76
- export * from './types/credential.js';
77
- export { GGUI_AGENT_SYSTEM_PROMPT } from './recommended-prompts.js';
78
- export * from './types/mcp-proxy.js';
79
- export { STDLIB_GADGETS, STDLIB_GADGETS_PACKAGE, STDLIB_GADGETS_VERSION, STDLIB_GADGET_HOOKS, } from './gadgets/stdlib-gadgets.js';
80
- export { filterDescriptorsToContract, gadgetIdentityKey, gadgetExportName, listContractGadgets, } from './gadgets/resolve-contract-gadgets.js';
51
+ export * from "./schemas/ops-blueprint.js";
52
+ export * from "./types/contract-inference.js";
53
+ export * from "./types/gadget.js";
54
+ export * from "./types/app-config.js";
55
+ // Canonical externally-issued user-id namespace (`'<providerId>:<subject>'`).
56
+ // Shared by the OAuth-login routes and the OIDC verify adapter (which
57
+ // can't import upward from mcp-server), so every consumer computes the
58
+ // same id from one definition.
59
+ export { composeOAuthUserId } from "./types/oauth-user-id.js";
60
+ export * from "./iframe-bridge.js";
61
+ export * from "./envelope-adapters.js";
62
+ export * from "./envelopes/builders.js";
63
+ export * from "./errors/version-mismatch.js";
64
+ export * from "./errors/unknown-permission-name.js";
65
+ export * from "./validation/contract-validator.js";
66
+ export * from "./validation/cross-references.js";
67
+ export * from "./validation/is-record.js";
68
+ export * from "./validation/hygiene-rules.js";
69
+ export * from "./validation/lint-contract.js";
70
+ export * from "./validation/name-invariants.js";
71
+ export * from "./validation/schema-compat-invariants.js";
72
+ export * from "./validation/schema-meta-validation.js";
73
+ export * from "./validation/resolve-stream-channel.js";
74
+ export * from "./validation/reserved-channels.js";
75
+ export * from "./validation/sanitize-error.js";
76
+ export * from "./validation/schema-subset.js";
77
+ export * from "./validation/zod-to-json-schema.js";
78
+ export * from "./validation/ui-security.js";
79
+ export * from "./schema-learning/merge.js";
80
+ export * from "./schema-learning/derive-contract.js";
81
+ export * from "./screen-blueprints/index.js";
82
+ export { GGUI_AGENT_SYSTEM_PROMPT } from "./recommended-prompts.js";
83
+ export { STDLIB_GADGETS, STDLIB_GADGETS_PACKAGE, STDLIB_GADGETS_VERSION, STDLIB_GADGET_HOOKS, } from "./gadgets/stdlib-gadgets.js";
84
+ export { resolveAppGadgets } from './gadgets/resolve-app-gadgets.js';
85
+ export { filterDescriptorsToContract, gadgetIdentityKey, gadgetExportName, listContractGadgets, } from "./gadgets/resolve-contract-gadgets.js";