@lobu/runtime-server 20.2.0 → 21.1.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 (270) hide show
  1. package/dist/catalogs/automations.json +0 -8
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/README.md +15 -16
  4. package/dist/connectors/github.ts +274 -193
  5. package/dist/connectors/google_calendar.ts +54 -160
  6. package/dist/connectors/google_drive.ts +106 -131
  7. package/dist/connectors/google_gmail.ts +53 -30
  8. package/dist/connectors/hackernews.ts +2 -5
  9. package/dist/connectors/jira.ts +71 -27
  10. package/dist/connectors/linear.ts +55 -21
  11. package/dist/connectors/microsoft_outlook.ts +151 -110
  12. package/dist/connectors/postgres.ts +19 -11
  13. package/dist/connectors/producthunt.ts +11 -7
  14. package/dist/connectors/reddit.ts +36 -6
  15. package/dist/connectors/rss.ts +2 -2
  16. package/dist/connectors/whatsapp_web.ts +5 -4
  17. package/dist/connectors/x.ts +32 -17
  18. package/dist/connectors/youtube.ts +18 -5
  19. package/dist/db/migrations/20260917000000_views.sql +271 -0
  20. package/dist/db/migrations/20260917000001_views_attach_index.sql +14 -0
  21. package/dist/db/migrations/20260918000000_runs_turn_tool_event_uniq.sql +51 -0
  22. package/dist/db/migrations/20260923230000_runs_connector_artifact_hash.sql +32 -0
  23. package/dist/db/migrations/20260924000000_resource_source_files.sql +17 -0
  24. package/dist/db/migrations/20260928120000_classification_consolidation.sql +51 -0
  25. package/dist/dependencies.bun.lock +113 -102
  26. package/dist/guest.bundle.js +78 -10
  27. package/dist/owletto/dist/assets/_-00GgOtdu.js +1 -0
  28. package/dist/owletto/dist/assets/_-XlUwOWCI.js +2 -0
  29. package/dist/owletto/dist/assets/_agentId-B2DrawIk.js +1 -0
  30. package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +1 -0
  31. package/dist/owletto/dist/assets/_automationId-BLnqLtUv.js +1 -0
  32. package/dist/owletto/dist/assets/{_connectorKey._connectionId-BAJGfcy7.js → _connectorKey._connectionId-DcUWoZ-C.js} +1 -1
  33. package/dist/owletto/dist/assets/{_connectorKey.index-BBF8vGJS.js → _connectorKey.index-C_yKycN_.js} +1 -1
  34. package/dist/owletto/dist/assets/_conversationId-CpuEvflw.js +1 -0
  35. package/dist/owletto/dist/assets/_deploymentId-BL9tnDFl.js +1 -0
  36. package/dist/owletto/dist/assets/_name-DlxjWkKk.js +1 -0
  37. package/dist/owletto/dist/assets/_owner-Cg50UU6m.js +1 -0
  38. package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +1 -0
  39. package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +1 -0
  40. package/dist/owletto/dist/assets/_slug-DbD-wv2m.js +1 -0
  41. package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +1 -0
  42. package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +1 -0
  43. package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +1 -0
  44. package/dist/owletto/dist/assets/accept-invitation-BmQKbQem.js +1 -0
  45. package/dist/owletto/dist/assets/activity-route-view-BvtAoGVt.js +1 -0
  46. package/dist/owletto/dist/assets/{agent-card-controls-CZO6GI0s.js → agent-card-controls-bhTMPoVi.js} +1 -1
  47. package/dist/owletto/dist/assets/{agent-client-setup-list-_chLOorY.js → agent-client-setup-list-BBbq_2B1.js} +1 -1
  48. package/dist/owletto/dist/assets/{agent-connect-pages-DWBgSIYT.js → agent-connect-pages-DkDlFVY5.js} +1 -1
  49. package/dist/owletto/dist/assets/{agent-editor-form-BTNlg0kQ.js → agent-editor-form-DwHD9j1Y.js} +1 -1
  50. package/dist/owletto/dist/assets/{agent-guardrails-route-B5uoMC6o.js → agent-guardrails-route-0PsTrqMC.js} +1 -1
  51. package/dist/owletto/dist/assets/{agent-loading-shells-CLoLeFcB.js → agent-loading-shells-BQLjzMPy.js} +1 -1
  52. package/dist/owletto/dist/assets/{agent-permissions-matrix-TP00-MYL.js → agent-permissions-matrix-B-Q5rmuB.js} +1 -1
  53. package/dist/owletto/dist/assets/{agent-skill-context-D4a2QCoZ.js → agent-skill-context-s42Q4Wjo.js} +1 -1
  54. package/dist/owletto/dist/assets/{agent-skills-route-KVDDTbJB.js → agent-skills-route-Cwq1QrhW.js} +1 -1
  55. package/dist/owletto/dist/assets/{agent-subpage-shell-DuVYZvBE.js → agent-subpage-shell-DtzoRy6N.js} +1 -1
  56. package/dist/owletto/dist/assets/agent-thread-D7AGGjRV.js +8 -0
  57. package/dist/owletto/dist/assets/agents-BqCKU4CT.js +1 -0
  58. package/dist/owletto/dist/assets/agents-workbench-Cl7FO7b3.js +1 -0
  59. package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +127 -0
  60. package/dist/owletto/dist/assets/{app._appId-D0_LQTJU.js → app._appId-CqYz3AOO.js} +1 -1
  61. package/dist/owletto/dist/assets/automation-detail-content-CKSywvzE.js +1 -0
  62. package/dist/owletto/dist/assets/automations-BqCKU4CT.js +1 -0
  63. package/dist/owletto/dist/assets/{calendar-C0XpOHd8.js → calendar-CHXehtu0.js} +1 -1
  64. package/dist/owletto/dist/assets/{callback-CO_K9eR-.js → callback-DZ3YyXeV.js} +1 -1
  65. package/dist/owletto/dist/assets/{card-DeFQuU_J.js → card-4Ull9W6d.js} +1 -1
  66. package/dist/owletto/dist/assets/{claim-CUpWOSie.js → claim-BGLCPLXq.js} +1 -1
  67. package/dist/owletto/dist/assets/clients-C7ubnFsS.js +1 -0
  68. package/dist/owletto/dist/assets/{code-editor-BqGUZFt6.js → code-editor-BHiWR94J.js} +1 -1
  69. package/dist/owletto/dist/assets/connect-BNatqg6j.js +1 -0
  70. package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +1 -0
  71. package/dist/owletto/dist/assets/connected._clientId-7RU89sVW.js +1 -0
  72. package/dist/owletto/dist/assets/{connection-BgAlYjeV.js → connection-CTaUGXl6.js} +1 -1
  73. package/dist/owletto/dist/assets/{connection-feed-detail-B3ePAinf.js → connection-feed-detail-B1xieiEh.js} +1 -1
  74. package/dist/owletto/dist/assets/{connector-provenance-DgsDg0Z9.js → connector-provenance-DRdUEmQ1.js} +1 -1
  75. package/dist/owletto/dist/assets/{connectors-CqPQPo9U.js → connectors-NBwCLuZg.js} +1 -1
  76. package/dist/owletto/dist/assets/{consent-bswcIzsf.js → consent-fmhPPlpi.js} +1 -1
  77. package/dist/owletto/dist/assets/{core.esm-DsLgjoel.js → core.esm-C-eNiUAl.js} +1 -1
  78. package/dist/owletto/dist/assets/{create-Dwo04oWV.js → create-8bBbQJGY.js} +1 -1
  79. package/dist/owletto/dist/assets/create-Cl6cfNAp.js +1 -0
  80. package/dist/owletto/dist/assets/create-DrVso8O7.js +1 -0
  81. package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +2 -0
  82. package/dist/owletto/dist/assets/{create._connectorKey-CCBb2pil.js → create._connectorKey-CHAotlsF.js} +1 -1
  83. package/dist/owletto/dist/assets/{cronstrue-ChFyC9ps.js → cronstrue-C5yTgk5z.js} +1 -1
  84. package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +1 -0
  85. package/dist/owletto/dist/assets/deployments-D1gbQwsy.js +1 -0
  86. package/dist/owletto/dist/assets/deployments-body-DycIGlnL.js +1 -0
  87. package/dist/owletto/dist/assets/device-DyPnQkhO.js +1 -0
  88. package/dist/owletto/dist/assets/{device-pin-tombstone-1ikyqSdb.js → device-pin-tombstone-CwJitllC.js} +1 -1
  89. package/dist/owletto/dist/assets/device-rows-BBhW1C7Y.js +1 -0
  90. package/dist/owletto/dist/assets/{device._deviceId-DTYKGBY8.js → device._deviceId-XswfXHOc.js} +1 -1
  91. package/dist/owletto/dist/assets/entity-options-utGBmFX0.js +1 -0
  92. package/dist/owletto/dist/assets/entity-page-BxwuqqWk.js +1 -0
  93. package/dist/owletto/dist/assets/entity-type-page-BrWqk6so.js +1 -0
  94. package/dist/owletto/dist/assets/event-page-LIm4EDmJ.js +1 -0
  95. package/dist/owletto/dist/assets/events-feed-C4L8mQV7.js +1 -0
  96. package/dist/owletto/dist/assets/{full-page-spinner-BN2G_YiM.js → full-page-spinner-DsU-Cb3L.js} +1 -1
  97. package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +1 -0
  98. package/dist/owletto/dist/assets/identity-uPYpPogR.js +1 -0
  99. package/dist/owletto/dist/assets/{index-hSE2E46p.js → index-1YrrvVJ4.js} +1 -1
  100. package/dist/owletto/dist/assets/index-BKMafTe4.js +1 -0
  101. package/dist/owletto/dist/assets/index-BsL1-C2-.js +1 -0
  102. package/dist/owletto/dist/assets/index-C58oW727.js +1 -0
  103. package/dist/owletto/dist/assets/index-C8CR2-Ck.css +1 -0
  104. package/dist/owletto/dist/assets/{index-OUb5Mlez.js → index-CDz3-ieP.js} +10 -10
  105. package/dist/owletto/dist/assets/{index-C6VAJ8Ku.js → index-CQ4s6nzy.js} +1 -1
  106. package/dist/owletto/dist/assets/index-CpWKAAGX.js +1 -0
  107. package/dist/owletto/dist/assets/{index-vdqhlocx.js → index-D2dcENg2.js} +1 -1
  108. package/dist/owletto/dist/assets/{index-C2oCgDX7.js → index-DCK0KhMM.js} +1 -1
  109. package/dist/owletto/dist/assets/{index-C-u4yR8Z.js → index-DXqiRON3.js} +1 -1
  110. package/dist/owletto/dist/assets/index-DgEc5IvT.js +1 -0
  111. package/dist/owletto/dist/assets/index-DtRfQcRH.js +7898 -0
  112. package/dist/owletto/dist/assets/index-DvhM9tuI.js +1 -0
  113. package/dist/owletto/dist/assets/index-DwtfHCHB.js +1 -0
  114. package/dist/owletto/dist/assets/index-DyYFZjh-.js +1 -0
  115. package/dist/owletto/dist/assets/index-nOYvNROJ.js +1 -0
  116. package/dist/owletto/dist/assets/index-oDoJENMF.js +1 -0
  117. package/dist/owletto/dist/assets/index-rPdUEOa3.js +1 -0
  118. package/dist/owletto/dist/assets/{json-diff-DnsW7Pin.js → json-diff-DYeX-xLk.js} +2 -2
  119. package/dist/owletto/dist/assets/{list-skeleton-CHzLN7GK.js → list-skeleton-s4GPSJ8J.js} +1 -1
  120. package/dist/owletto/dist/assets/login-Di5VF2F_.js +1 -0
  121. package/dist/owletto/dist/assets/logout-BuaQGSnw.js +1 -0
  122. package/dist/owletto/dist/assets/member-scope-gate-CJqJZk7T.js +1 -0
  123. package/dist/owletto/dist/assets/memory-browse-page-Bibfs2sK.js +101 -0
  124. package/dist/owletto/dist/assets/missing-view-CD4DOaG8.js +1 -0
  125. package/dist/owletto/dist/assets/{model-selector-DfbmHjLu.js → model-selector-XC5CI2Et.js} +1 -1
  126. package/dist/owletto/dist/assets/models--8mTFOLz.js +1 -0
  127. package/dist/owletto/dist/assets/{new-Df_dY6Z5.js → new-BzkA1sq2.js} +1 -1
  128. package/dist/owletto/dist/assets/new-C3f0BShb.js +1 -0
  129. package/dist/owletto/dist/assets/new-DA5LF6iB.js +1 -0
  130. package/dist/owletto/dist/assets/{oauth-workspace-access-D9GmiMfK.js → oauth-workspace-access-D6epOq0R.js} +1 -1
  131. package/dist/owletto/dist/assets/{organization-uSDYkJpX.js → organization-DOtBRqDQ.js} +1 -1
  132. package/dist/owletto/dist/assets/{permissions-Fe0DP6b8.js → permissions-D8uJHINS.js} +1 -1
  133. package/dist/owletto/dist/assets/{proposal-review-shell-D9HwnDda.js → proposal-review-shell-C3K-JXjb.js} +1 -1
  134. package/dist/owletto/dist/assets/{recent-C03LhMD7.js → recent-CFcWceBl.js} +1 -1
  135. package/dist/owletto/dist/assets/{renderer-CHNejd95.js → renderer-1nRJFMGx.js} +2 -2
  136. package/dist/owletto/dist/assets/{reset-password-CuISnlG_.js → reset-password-9RTWhBEb.js} +1 -1
  137. package/dist/owletto/dist/assets/runs-_yVh6PPB.js +1 -0
  138. package/dist/owletto/dist/assets/{runs-panel-DsdESupx.js → runs-panel-B2852xus.js} +1 -1
  139. package/dist/owletto/dist/assets/runs-table--dnFQatY.js +1 -0
  140. package/dist/owletto/dist/assets/{schema-value-normalization-B--OWDL8.js → schema-value-normalization-BspxVEGy.js} +1 -1
  141. package/dist/owletto/dist/assets/{settings-wGNHtsDP.js → settings-9lDASETT.js} +1 -1
  142. package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +1 -0
  143. package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +1 -0
  144. package/dist/owletto/dist/assets/{switch-Dzse_XFM.js → switch-CxDXvPGE.js} +1 -1
  145. package/dist/owletto/dist/assets/use-applied-views-DvMT3wap.js +1 -0
  146. package/dist/owletto/dist/assets/{use-mention-search-uyW1Uwf6.js → use-mention-search-CeTEE3oE.js} +1 -1
  147. package/dist/owletto/dist/assets/view-frame-HoBawpT2.js +1 -0
  148. package/dist/owletto/dist/index.html +2 -2
  149. package/dist/providers.json +0 -1
  150. package/dist/server-main.bundle.mjs +8997 -7479
  151. package/npm-shrinkwrap.json +543 -485
  152. package/package.json +5 -2
  153. package/vendor/connector-sdk/dist/connector-runtime.d.ts +4 -6
  154. package/vendor/connector-sdk/dist/connector-runtime.js +3 -5
  155. package/vendor/connector-sdk/dist/connector-types.d.ts +28 -15
  156. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -1
  157. package/vendor/connector-sdk/dist/define-connector.js +4 -1
  158. package/vendor/connector-sdk/dist/http-client.d.ts +18 -7
  159. package/vendor/connector-sdk/dist/http-client.js +15 -13
  160. package/vendor/connector-sdk/dist/index.d.ts +1 -1
  161. package/vendor/connector-sdk/dist/retry.d.ts +15 -3
  162. package/vendor/connector-sdk/dist/retry.js +40 -64
  163. package/vendor/connector-sdk/package.json +1 -1
  164. package/vendor/core/dist/agent-policy.js +3 -0
  165. package/vendor/core/dist/connector-query-errors.d.ts +3 -3
  166. package/vendor/core/dist/connector-query-errors.js +8 -3
  167. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +14 -0
  168. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +12 -1
  169. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +0 -10
  170. package/vendor/core/dist/contracts/tools/manage-automations.js +0 -33
  171. package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +4 -34
  172. package/vendor/core/dist/contracts/tools/manage-classifiers.js +13 -44
  173. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +24 -0
  174. package/vendor/core/dist/contracts/tools/manage-connections.js +13 -0
  175. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +15 -25
  176. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +3 -5
  177. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +0 -9
  178. package/vendor/core/dist/contracts/tools/manage-entity.js +0 -6
  179. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +11 -0
  180. package/vendor/core/dist/contracts/tools/manage-feeds.js +12 -1
  181. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +47 -6
  182. package/vendor/core/dist/contracts/tools/manage-operations.js +36 -1
  183. package/vendor/core/dist/contracts/tools/manage-views.d.ts +293 -0
  184. package/vendor/core/dist/contracts/tools/manage-views.js +203 -0
  185. package/vendor/core/dist/contracts/tools/source-files-schema.d.ts +7 -0
  186. package/vendor/core/dist/contracts/tools/source-files-schema.js +19 -0
  187. package/vendor/core/dist/contracts/tools/source-files.d.ts +14 -0
  188. package/vendor/core/dist/contracts/tools/source-files.js +55 -0
  189. package/vendor/core/dist/contracts/tools/view-attach.d.ts +20 -0
  190. package/vendor/core/dist/contracts/tools/view-attach.js +45 -0
  191. package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +37 -0
  192. package/vendor/core/dist/contracts/tools/view-content-hash.js +58 -0
  193. package/vendor/core/dist/contracts/tools/view-path.d.ts +18 -0
  194. package/vendor/core/dist/contracts/tools/view-path.js +24 -0
  195. package/vendor/core/dist/contracts/worker/protocol.d.ts +90 -8
  196. package/vendor/core/dist/contracts/worker/protocol.js +70 -10
  197. package/vendor/core/dist/index.d.ts +1 -1
  198. package/vendor/core/dist/provider-config-types.d.ts +0 -9
  199. package/vendor/core/dist/reserved.d.ts +3 -3
  200. package/vendor/core/dist/reserved.js +9 -1
  201. package/vendor/core/dist/sdk-compat.d.ts +1 -1
  202. package/vendor/core/dist/utils/secret-redaction.js +2 -0
  203. package/vendor/core/package.json +30 -5
  204. package/vendor/views/dist/api.d.ts +184 -0
  205. package/vendor/views/dist/api.js +410 -0
  206. package/vendor/views/dist/bridge.d.ts +141 -0
  207. package/vendor/views/dist/bridge.js +330 -0
  208. package/vendor/views/dist/index.d.ts +12 -0
  209. package/vendor/views/dist/index.js +10 -0
  210. package/vendor/views/package.json +35 -0
  211. package/dist/owletto/dist/assets/_-Ds4DyQjj.js +0 -2
  212. package/dist/owletto/dist/assets/_-VmyR6aN_.js +0 -1
  213. package/dist/owletto/dist/assets/_agentId-BAVnp0c7.js +0 -1
  214. package/dist/owletto/dist/assets/_agentId-Df-3rGi5.js +0 -1
  215. package/dist/owletto/dist/assets/_automationId-D696vOjd.js +0 -1
  216. package/dist/owletto/dist/assets/_conversationId-Ci4rgrHm.js +0 -1
  217. package/dist/owletto/dist/assets/_deploymentId-Iy-D5PDq.js +0 -1
  218. package/dist/owletto/dist/assets/_name-CeGwb0oK.js +0 -1
  219. package/dist/owletto/dist/assets/_owner-CFR1G8OX.js +0 -1
  220. package/dist/owletto/dist/assets/_skillKey-DuLcQWBu.js +0 -1
  221. package/dist/owletto/dist/assets/_slug-CDSO20ac.js +0 -1
  222. package/dist/owletto/dist/assets/accept-invitation-Db5jklHT.js +0 -1
  223. package/dist/owletto/dist/assets/activity-route-view-DVW3DoB7.js +0 -1
  224. package/dist/owletto/dist/assets/agent-thread-CzCJU3-R.js +0 -134
  225. package/dist/owletto/dist/assets/agents-DFs57C3c.js +0 -1
  226. package/dist/owletto/dist/assets/agents-workbench-C2bUlJP2.js +0 -1
  227. package/dist/owletto/dist/assets/automation-detail-content-DWkdhnv2.js +0 -1
  228. package/dist/owletto/dist/assets/automations-DFs57C3c.js +0 -1
  229. package/dist/owletto/dist/assets/clients-DhYr4lyL.js +0 -1
  230. package/dist/owletto/dist/assets/connect-Dtb-E5An.js +0 -1
  231. package/dist/owletto/dist/assets/connect._clientId-DWtceAAw.js +0 -1
  232. package/dist/owletto/dist/assets/connected._clientId-CMe-wTuV.js +0 -1
  233. package/dist/owletto/dist/assets/create-CcXUdke7.js +0 -1
  234. package/dist/owletto/dist/assets/create-Cp6hMoeU.js +0 -1
  235. package/dist/owletto/dist/assets/create-automation-form-CJ4meayB.js +0 -1
  236. package/dist/owletto/dist/assets/deployments-CjfFxyDA.js +0 -1
  237. package/dist/owletto/dist/assets/deployments-body-Cg0KiWGr.js +0 -1
  238. package/dist/owletto/dist/assets/device-DpY67Jaj.js +0 -1
  239. package/dist/owletto/dist/assets/device-rows-Cp3yMcuV.js +0 -1
  240. package/dist/owletto/dist/assets/entity-options-1EaSGMX4.js +0 -1
  241. package/dist/owletto/dist/assets/entity-page-DJmM70dv.js +0 -1
  242. package/dist/owletto/dist/assets/entity-type-page-C3mT7tXn.js +0 -1
  243. package/dist/owletto/dist/assets/events-feed-iliGfjit.js +0 -1
  244. package/dist/owletto/dist/assets/guardrails-CLlnRRy9.js +0 -1
  245. package/dist/owletto/dist/assets/identity-MSLryUi8.js +0 -1
  246. package/dist/owletto/dist/assets/index-3o4Eepb4.js +0 -1
  247. package/dist/owletto/dist/assets/index-BUr8321-.js +0 -7898
  248. package/dist/owletto/dist/assets/index-Bulu5ldM.js +0 -1
  249. package/dist/owletto/dist/assets/index-BvbfITqH.js +0 -1
  250. package/dist/owletto/dist/assets/index-ChcQMdod.css +0 -1
  251. package/dist/owletto/dist/assets/index-Clw9ZBj-.js +0 -1
  252. package/dist/owletto/dist/assets/index-D2oL4Ydo.js +0 -1
  253. package/dist/owletto/dist/assets/index-D7wulT4y.js +0 -1
  254. package/dist/owletto/dist/assets/index-DOLFe19K.js +0 -1
  255. package/dist/owletto/dist/assets/index-DTSA0Xh1.js +0 -1
  256. package/dist/owletto/dist/assets/index-DxXXVPU0.js +0 -1
  257. package/dist/owletto/dist/assets/index-nzvsA3hT.js +0 -1
  258. package/dist/owletto/dist/assets/login-CCKNM0gV.js +0 -1
  259. package/dist/owletto/dist/assets/logout-B-N2aodZ.js +0 -1
  260. package/dist/owletto/dist/assets/member-scope-gate-B560Wg-t.js +0 -1
  261. package/dist/owletto/dist/assets/memory-browse-page-DMDqKJn7.js +0 -101
  262. package/dist/owletto/dist/assets/models-M51OGDRE.js +0 -1
  263. package/dist/owletto/dist/assets/new-BVQS9H-Y.js +0 -1
  264. package/dist/owletto/dist/assets/new-DxDVE9nL.js +0 -1
  265. package/dist/owletto/dist/assets/runs-BnYdToDc.js +0 -1
  266. package/dist/owletto/dist/assets/runs-table-B7jKuILd.js +0 -1
  267. package/dist/owletto/dist/assets/settings-Bg9yCCoN.js +0 -1
  268. package/dist/owletto/dist/assets/skills-CN5Ube7A.js +0 -1
  269. package/vendor/core/dist/contracts/tools/manage-view-templates.d.ts +0 -165
  270. package/vendor/core/dist/contracts/tools/manage-view-templates.js +0 -130
@@ -0,0 +1,184 @@
1
+ /**
2
+ * `@lobu/views` authoring surface (brief §1.4): `defineView`, `useParams`,
3
+ * `useScope`, `useQuery`, `useAction`, `sql`, plus the `mountView` entry the
4
+ * compiled bundle calls once. Thin layer over the hand-written `ViewBridge` —
5
+ * nothing here talks to the API directly; every read and action goes through
6
+ * the host as `tools/call`, every param change through
7
+ * `ui/update-model-context`.
8
+ *
9
+ * Contract with the host (our web host, Claude, any MCP Apps host):
10
+ * - `ui/notifications/tool-input` `arguments` = `{ scope, params }`
11
+ * (in Claude these are the `open_view` tool arguments).
12
+ * - reads: `query_sql`, `query_sdk`, and tools the registry marks
13
+ * `readOnlyHint` (`read_knowledge`, `get_automation`, `query_metric`, …);
14
+ * actions: `invoke_view_action`. The web host refuses every other tool, so
15
+ * mixed read/write tools such as `manage_connections` are not reachable
16
+ * from a view: read that data with a `query_sdk` script
17
+ * (`client.connections.list()`) instead.
18
+ * - `setParams` → `ui/update-model-context` `{ structuredContent: { view,
19
+ * params } }`; the web host mirrors it into the address bar. Hosts without
20
+ * that capability keep params local to the frame.
21
+ */
22
+ import { type ReactNode } from "react";
23
+ import { ViewBridge, type ToolResult } from "./bridge.js";
24
+ export type ParamValue = string | number | boolean;
25
+ export type Params = Record<string, ParamValue>;
26
+ /**
27
+ * What the view is rendering. `type` on a type page, `entity` (plus its
28
+ * `type`) on a record page, `event` on an event's page, nothing on the Data hub.
29
+ *
30
+ * `event` is an `events.id` and, like the event's permalink, names its whole
31
+ * supersede lineage. There is no event hook: read it with the same exact-id
32
+ * read the event page renders, and render the current version, the row that
33
+ * nothing superseded (the result is the lineage, oldest first):
34
+ *
35
+ * ```tsx
36
+ * export const view = defineView({
37
+ * key: "deal-won",
38
+ * attach: [{ event_kind: "deal.won", type: "deal" }],
39
+ * });
40
+ *
41
+ * export default function DealWon() {
42
+ * const { event } = useScope();
43
+ * const read = useQuery<{ content: Array<{ superseded_by?: number | null;
44
+ * title: string | null; metadata: Record<string, unknown> }> }>(
45
+ * event === undefined ? null : tool("read_knowledge", { content_ids: [event] })
46
+ * );
47
+ * const current = read.data?.content.find((row) => row.superseded_by == null);
48
+ * return <h1>{current?.title}</h1>;
49
+ * }
50
+ * ```
51
+ */
52
+ export interface Scope {
53
+ type?: string;
54
+ entity?: number | string;
55
+ event?: number;
56
+ }
57
+ export interface ParamDef {
58
+ type: "string" | "number" | "boolean";
59
+ default?: ParamValue;
60
+ }
61
+ /**
62
+ * Where a view appears: exactly one subject per entry. `{ type }`,
63
+ * `{ entity }` and `{ workspace: true }` take a `placement`; an event
64
+ * attachment `{ event_kind, type }` matches events of that kind linked to at
65
+ * least one entity of `type`, renders on the event's page, and takes none.
66
+ */
67
+ export type Attachment = {
68
+ type: string;
69
+ placement?: "tab" | "overview";
70
+ } | {
71
+ entity: number | string;
72
+ placement?: "tab" | "overview";
73
+ } | {
74
+ workspace: true;
75
+ placement?: "tab" | "overview";
76
+ } | {
77
+ event_kind: string;
78
+ type: string;
79
+ };
80
+ export interface ViewDefinition {
81
+ /** View key: the single namespace of keys (no `custom:` prefix). Required —
82
+ * it is the identity `invoke_view_action` and the shell route key on. */
83
+ key: string;
84
+ /** Where the view appears. The attach line lives in the module; there are
85
+ * no attach/detach verbs. */
86
+ attach: Attachment[];
87
+ params?: Record<string, ParamDef>;
88
+ actions?: Record<string, {
89
+ emits: string;
90
+ }>;
91
+ }
92
+ export declare function defineView(def: ViewDefinition): ViewDefinition;
93
+ export declare function useParams(): readonly [
94
+ Params,
95
+ (patch: Partial<Params>) => void
96
+ ];
97
+ export declare function useScope(): Scope;
98
+ export declare function useHost(): {
99
+ connected: boolean;
100
+ ready: boolean;
101
+ theme: "light" | "dark";
102
+ };
103
+ /**
104
+ * Tagged template: scalar values are rendered as escaped SQL literals,
105
+ * never spliced raw. Numbers must be finite, booleans map to true/false,
106
+ * null/undefined become NULL, strings are single-quote escaped; anything
107
+ * else (objects, arrays) throws rather than stringifying a blob into the
108
+ * query. `query_sql` takes no bind parameters, so the guest escapes and the
109
+ * server validates tables — server-side binding stays a one-paragraph
110
+ * proposal until a use case needs it.
111
+ */
112
+ export interface SqlQuery {
113
+ kind: "sql";
114
+ text: string;
115
+ }
116
+ export declare function sql(strings: TemplateStringsArray, ...values: unknown[]): SqlQuery;
117
+ export declare function escapeLiteral(value: unknown): string;
118
+ /** Direct tool read, for a tool the registry marks `readOnlyHint`
119
+ * (`read_knowledge`, `get_automation`, …). The web host refuses mixed
120
+ * read/write tools such as `manage_connections`; use `query_sdk` for those reads. */
121
+ export interface ToolQuery {
122
+ kind: "tool";
123
+ name: string;
124
+ args: Record<string, unknown>;
125
+ }
126
+ export declare function tool(name: string, args?: Record<string, unknown>): ToolQuery;
127
+ /**
128
+ * Read one `useQuery` result. A failed read is an error, never an empty
129
+ * result: `query_sql` answers a rejected statement (unknown table, bad column)
130
+ * with a normal result carrying `error` beside `rows: []`, and `query_sdk`
131
+ * reports a thrown script as `success: false` — both would otherwise render as
132
+ * "no rows".
133
+ */
134
+ export declare function queryResult<T>(kind: "sql" | "sdk" | "tool", result: ToolResult): {
135
+ data: T | null;
136
+ error: string | null;
137
+ };
138
+ export interface QueryState<T> {
139
+ data: T | null;
140
+ error: string | null;
141
+ loading: boolean;
142
+ refetch: () => void;
143
+ }
144
+ /**
145
+ * Run a read through the host. `sql\`…\`` → `query_sql`; a string →
146
+ * `query_sdk` script; `tool(name, args)` → that tool; `null` skips. The first
147
+ * fetch waits for the host's first `tool-input`: reads before it run against
148
+ * defaults and double-fetch when the real scope lands.
149
+ */
150
+ export declare function useQuery<T = unknown>(query: SqlQuery | ToolQuery | string | null): QueryState<T>;
151
+ export interface ActionResult {
152
+ ok: boolean;
153
+ error: string | null;
154
+ result: unknown;
155
+ }
156
+ /** Mint the per-click interaction id the action tool requires (browser retry
157
+ * id on web): a UUID where available, else a time + random fallback. */
158
+ export declare function mintInteractionId(): string;
159
+ /** A declared action → `invoke_view_action { view, action, value }`. The name
160
+ * must exist on the CURRENT view definition; a removed button throws here
161
+ * instead of emitting a stale event. */
162
+ export declare function useAction(name: string): (value?: Record<string, unknown>) => Promise<ActionResult>;
163
+ export declare function defaultsFor(def: ViewDefinition): Params;
164
+ export declare function coerceParams(def: ViewDefinition, raw: unknown): Params;
165
+ export declare function coerceScope(raw: unknown): Scope;
166
+ /**
167
+ * Host bridge provider: seeds scope/params from the first tool-input,
168
+ * exposes reads/actions over tools/call, mirrors params through
169
+ * update-model-context. The server bootstrap renders this around the view's
170
+ * default export; `mountView` does the same for CLI-bundled entries.
171
+ */
172
+ export declare function Provider({ def, bridge, children, }: {
173
+ def: ViewDefinition;
174
+ bridge?: ViewBridge;
175
+ children: ReactNode;
176
+ }): import("react/jsx-runtime").JSX.Element;
177
+ export interface MountOptions {
178
+ /** Test seam: drive the view against a fake parent instead of `window.parent`. */
179
+ bridge?: ViewBridge;
180
+ }
181
+ /** Entry point the compiled bundle calls once. Mounts the component into
182
+ * `#root` and connects to the host. */
183
+ export declare function mountView(def: ViewDefinition, Component: () => ReactNode, opts?: MountOptions): void;
184
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,410 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * `@lobu/views` authoring surface (brief §1.4): `defineView`, `useParams`,
4
+ * `useScope`, `useQuery`, `useAction`, `sql`, plus the `mountView` entry the
5
+ * compiled bundle calls once. Thin layer over the hand-written `ViewBridge` —
6
+ * nothing here talks to the API directly; every read and action goes through
7
+ * the host as `tools/call`, every param change through
8
+ * `ui/update-model-context`.
9
+ *
10
+ * Contract with the host (our web host, Claude, any MCP Apps host):
11
+ * - `ui/notifications/tool-input` `arguments` = `{ scope, params }`
12
+ * (in Claude these are the `open_view` tool arguments).
13
+ * - reads: `query_sql`, `query_sdk`, and tools the registry marks
14
+ * `readOnlyHint` (`read_knowledge`, `get_automation`, `query_metric`, …);
15
+ * actions: `invoke_view_action`. The web host refuses every other tool, so
16
+ * mixed read/write tools such as `manage_connections` are not reachable
17
+ * from a view: read that data with a `query_sdk` script
18
+ * (`client.connections.list()`) instead.
19
+ * - `setParams` → `ui/update-model-context` `{ structuredContent: { view,
20
+ * params } }`; the web host mirrors it into the address bar. Hosts without
21
+ * that capability keep params local to the frame.
22
+ */
23
+ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
24
+ import { createRoot } from "react-dom/client";
25
+ import { ViewBridge } from "./bridge.js";
26
+ export function defineView(def) {
27
+ if (!def || typeof def.key !== "string" || def.key.length === 0) {
28
+ throw new Error("defineView({ key, attach, ... }) requires a non-empty key");
29
+ }
30
+ if (!Array.isArray(def.attach)) {
31
+ throw new Error(`defineView("${def.key}") requires attach to be an array`);
32
+ }
33
+ return def;
34
+ }
35
+ const Ctx = createContext(null);
36
+ function useRuntime() {
37
+ const rt = useContext(Ctx);
38
+ if (!rt)
39
+ throw new Error("@lobu/views hooks must run inside mountView()");
40
+ return rt;
41
+ }
42
+ export function useParams() {
43
+ const rt = useRuntime();
44
+ return [rt.params, rt.setParams];
45
+ }
46
+ export function useScope() {
47
+ return useRuntime().scope;
48
+ }
49
+ export function useHost() {
50
+ const rt = useRuntime();
51
+ return { connected: rt.connected, ready: rt.ready, theme: rt.theme };
52
+ }
53
+ function resultError(result) {
54
+ if (result.isError !== true)
55
+ return null;
56
+ const content = Array.isArray(result.content) ? result.content : [];
57
+ const text = content
58
+ .map((c) => c && typeof c === "object" && c.type === "text"
59
+ ? String(c.text ?? "")
60
+ : "")
61
+ .join("\n")
62
+ .trim();
63
+ return text || "The host reported a tool error.";
64
+ }
65
+ export function sql(strings, ...values) {
66
+ let text = "";
67
+ strings.forEach((s, i) => {
68
+ text += s;
69
+ if (i < values.length)
70
+ text += escapeLiteral(values[i]);
71
+ });
72
+ return { kind: "sql", text };
73
+ }
74
+ export function escapeLiteral(value) {
75
+ if (value === null || value === undefined)
76
+ return "NULL";
77
+ if (typeof value === "number") {
78
+ if (!Number.isFinite(value))
79
+ throw new Error("sql: only finite numbers can be bound");
80
+ return String(value);
81
+ }
82
+ if (typeof value === "boolean")
83
+ return value ? "TRUE" : "FALSE";
84
+ if (typeof value === "string")
85
+ return `'${value.replaceAll("'", "''")}'`;
86
+ throw new Error("sql: only string, number, boolean, null values can be bound");
87
+ }
88
+ export function tool(name, args = {}) {
89
+ if (!name)
90
+ throw new Error("tool() requires a tool name");
91
+ return { kind: "tool", name, args };
92
+ }
93
+ function parseTextJson(result) {
94
+ const content = Array.isArray(result.content) ? result.content : [];
95
+ for (const c of content) {
96
+ if (!c || typeof c !== "object" || c.type !== "text")
97
+ continue;
98
+ let text = String(c.text ?? "").trim();
99
+ const fence = /```(?:json)?\s*([\s\S]*?)```/.exec(text);
100
+ if (fence?.[1])
101
+ text = fence[1].trim();
102
+ try {
103
+ return JSON.parse(text);
104
+ }
105
+ catch {
106
+ // not JSON — keep looking
107
+ }
108
+ }
109
+ return null;
110
+ }
111
+ /**
112
+ * Read one `useQuery` result. A failed read is an error, never an empty
113
+ * result: `query_sql` answers a rejected statement (unknown table, bad column)
114
+ * with a normal result carrying `error` beside `rows: []`, and `query_sdk`
115
+ * reports a thrown script as `success: false` — both would otherwise render as
116
+ * "no rows".
117
+ */
118
+ export function queryResult(kind, result) {
119
+ const err = resultError(result);
120
+ if (err)
121
+ return { data: null, error: err };
122
+ // structuredContent when the tool declares an outputSchema (query_sql,
123
+ // query_sdk, every read tool on MCP hosts); otherwise the text body.
124
+ const sc = (result.structuredContent ??
125
+ parseTextJson(result) ??
126
+ {});
127
+ if (kind === "sql" && typeof sc.error === "string" && sc.error)
128
+ return { data: null, error: sc.error };
129
+ if (kind === "sdk" && sc.success === false) {
130
+ const e = sc.error;
131
+ const message = typeof e === "string" ? e : e?.message;
132
+ return {
133
+ data: null,
134
+ error: typeof message === "string" && message
135
+ ? message
136
+ : "Query script failed",
137
+ };
138
+ }
139
+ // query_sdk → { success, return_value }, query_sql → { rows }, a named
140
+ // tool → its whole body.
141
+ const data = (kind === "sdk" ? sc.return_value : kind === "tool" ? sc : sc.rows);
142
+ return { data: data ?? null, error: null };
143
+ }
144
+ /**
145
+ * Run a read through the host. `sql\`…\`` → `query_sql`; a string →
146
+ * `query_sdk` script; `tool(name, args)` → that tool; `null` skips. The first
147
+ * fetch waits for the host's first `tool-input`: reads before it run against
148
+ * defaults and double-fetch when the real scope lands.
149
+ */
150
+ export function useQuery(query) {
151
+ const rt = useRuntime();
152
+ const [state, setState] = useState({
153
+ data: null,
154
+ error: null,
155
+ loading: query !== null,
156
+ });
157
+ const [tick, setTick] = useState(0);
158
+ const key = query === null
159
+ ? null
160
+ : typeof query === "string"
161
+ ? `sdk:${query}`
162
+ : query.kind === "tool"
163
+ ? `tool:${query.name}:${JSON.stringify(query.args)}`
164
+ : `sql:${query.text}`;
165
+ // biome-ignore lint/correctness/useExhaustiveDependencies: key is the stable identity of query (listing query itself refetches every render); rt.callTool is stable and tick is the intentional refetch trigger.
166
+ useEffect(() => {
167
+ // A skipped query is idle, even when the previous request is in flight.
168
+ if (key === null) {
169
+ setState((s) => (s.loading ? { ...s, loading: false } : s));
170
+ return;
171
+ }
172
+ // Queries still wait for the host to seed scope and params.
173
+ if (!rt.ready)
174
+ return;
175
+ let cancelled = false;
176
+ setState((s) => ({ ...s, loading: true }));
177
+ const q = query;
178
+ const call = typeof q === "string"
179
+ ? rt.callTool("query_sdk", { script: q })
180
+ : q.kind === "tool"
181
+ ? rt.callTool(q.name, q.args)
182
+ : rt.callTool("query_sql", { sql: q.text, limit: 500 });
183
+ call
184
+ .then((result) => {
185
+ if (cancelled)
186
+ return;
187
+ const out = queryResult(typeof q === "string" ? "sdk" : q.kind === "tool" ? "tool" : "sql", result);
188
+ setState({ ...out, loading: false });
189
+ })
190
+ .catch((e) => {
191
+ if (cancelled)
192
+ return;
193
+ setState({
194
+ data: null,
195
+ error: e instanceof Error ? e.message : String(e),
196
+ loading: false,
197
+ });
198
+ });
199
+ return () => {
200
+ cancelled = true;
201
+ };
202
+ }, [key, rt.ready, tick]);
203
+ const refetch = useCallback(() => setTick((t) => t + 1), []);
204
+ return { ...state, refetch };
205
+ }
206
+ /** Mint the per-click interaction id the action tool requires (browser retry
207
+ * id on web): a UUID where available, else a time + random fallback. */
208
+ export function mintInteractionId() {
209
+ if (typeof crypto !== "undefined" && "randomUUID" in crypto) {
210
+ return crypto.randomUUID();
211
+ }
212
+ return `${Date.now()}-${Math.floor(Math.random() * 1e9)}`;
213
+ }
214
+ /** A declared action → `invoke_view_action { view, action, value }`. The name
215
+ * must exist on the CURRENT view definition; a removed button throws here
216
+ * instead of emitting a stale event. */
217
+ export function useAction(name) {
218
+ const rt = useRuntime();
219
+ if (!rt.def.actions?.[name]) {
220
+ throw new Error(`Action "${name}" is not declared on view "${rt.def.key}"`);
221
+ }
222
+ return useCallback(async (value = {}) => {
223
+ try {
224
+ // The tool requires an interaction id (browser retry id on web):
225
+ // mint one per click so retries stay idempotent.
226
+ const result = await rt.callTool("invoke_view_action", {
227
+ view: rt.def.key,
228
+ action: name,
229
+ value,
230
+ interaction_id: mintInteractionId(),
231
+ });
232
+ const err = resultError(result);
233
+ return {
234
+ ok: !err,
235
+ error: err,
236
+ result: result.structuredContent ?? null,
237
+ };
238
+ }
239
+ catch (e) {
240
+ return {
241
+ ok: false,
242
+ error: e instanceof Error ? e.message : String(e),
243
+ result: null,
244
+ };
245
+ }
246
+ }, [rt, name]);
247
+ }
248
+ export function defaultsFor(def) {
249
+ const out = {};
250
+ for (const [k, p] of Object.entries(def.params ?? {})) {
251
+ if (p.default !== undefined)
252
+ out[k] = p.default;
253
+ }
254
+ return out;
255
+ }
256
+ export function coerceParams(def, raw) {
257
+ const out = defaultsFor(def);
258
+ if (!raw || typeof raw !== "object")
259
+ return out;
260
+ for (const [k, v] of Object.entries(raw)) {
261
+ const decl = def.params?.[k];
262
+ if (!decl)
263
+ continue; // unknown params ignored (§1.6)
264
+ if (decl.type === "number") {
265
+ const n = typeof v === "number" ? v : Number(v);
266
+ if (Number.isFinite(n))
267
+ out[k] = n;
268
+ }
269
+ else if (decl.type === "boolean") {
270
+ out[k] = v === true || v === "true";
271
+ }
272
+ else if (v !== undefined && v !== null) {
273
+ out[k] = String(v);
274
+ }
275
+ }
276
+ return out;
277
+ }
278
+ export function coerceScope(raw) {
279
+ if (!raw || typeof raw !== "object")
280
+ return {};
281
+ const scope = raw;
282
+ const out = {};
283
+ if (typeof scope.type === "string" && scope.type.length > 0)
284
+ out.type = scope.type;
285
+ if (typeof scope.entity === "number" || typeof scope.entity === "string") {
286
+ out.entity = scope.entity;
287
+ }
288
+ if (typeof scope.event === "number" && Number.isInteger(scope.event)) {
289
+ out.event = scope.event;
290
+ }
291
+ return out;
292
+ }
293
+ function themeFromContext(ctx) {
294
+ return ctx.theme === "dark" ? "dark" : "light";
295
+ }
296
+ function applyTheme(theme) {
297
+ document.documentElement.classList.toggle("dark", theme === "dark");
298
+ document.documentElement.style.colorScheme = theme;
299
+ }
300
+ /**
301
+ * Host bridge provider: seeds scope/params from the first tool-input,
302
+ * exposes reads/actions over tools/call, mirrors params through
303
+ * update-model-context. The server bootstrap renders this around the view's
304
+ * default export; `mountView` does the same for CLI-bundled entries.
305
+ */
306
+ export function Provider({ def, bridge, children, }) {
307
+ const [connected, setConnected] = useState(false);
308
+ const [ready, setReady] = useState(false);
309
+ const [scope, setScope] = useState({});
310
+ const [params, setParamsState] = useState(() => defaultsFor(def));
311
+ const [theme, setTheme] = useState("light");
312
+ const bridgeRef = useRef(bridge ?? null);
313
+ if (bridge)
314
+ bridgeRef.current = bridge;
315
+ if (bridgeRef.current === null)
316
+ bridgeRef.current = new ViewBridge();
317
+ useEffect(() => {
318
+ const b = bridgeRef.current;
319
+ // Unreachable in practice (the body above always installs a bridge
320
+ // before effects run); fail loud instead of dereferencing null.
321
+ if (!b)
322
+ throw new Error("@lobu/views provider has no host bridge");
323
+ const offInput = b.onToolInput((args) => {
324
+ const input = (args ?? {});
325
+ setScope(coerceScope(input.scope));
326
+ setParamsState(coerceParams(def, input.params));
327
+ setReady(true);
328
+ });
329
+ const offCtx = b.onHostContext((ctx) => {
330
+ const next = themeFromContext(ctx);
331
+ setTheme(next);
332
+ applyTheme(next);
333
+ });
334
+ b.connect()
335
+ .then((ctx) => {
336
+ const next = themeFromContext(ctx);
337
+ setTheme(next);
338
+ applyTheme(next);
339
+ setConnected(true);
340
+ setReady(b.hasToolInput());
341
+ document.documentElement.setAttribute("data-ready", "true");
342
+ })
343
+ .catch((e) => console.error("[lobu-views] connect failed", e));
344
+ return () => {
345
+ offInput();
346
+ offCtx();
347
+ };
348
+ }, [def]);
349
+ const setParams = useCallback((patch) => {
350
+ setParamsState((prev) => {
351
+ const next = coerceParams(def, { ...prev, ...patch });
352
+ const b = bridgeRef.current;
353
+ if (b) {
354
+ b.updateModelContext({ view: def.key, params: next }).catch(() => {
355
+ /* host without update-model-context: params stay frame-local */
356
+ });
357
+ }
358
+ return next;
359
+ });
360
+ }, [def]);
361
+ const callTool = useCallback(async (name, args) => {
362
+ const b = bridgeRef.current;
363
+ if (!b?.isConnected()) {
364
+ // No handshake yet — fail loud instead of queueing into a dead host.
365
+ throw new Error("Not connected to a host");
366
+ }
367
+ return b.callTool(name, args);
368
+ }, []);
369
+ const value = useMemo(() => ({
370
+ def,
371
+ connected,
372
+ ready,
373
+ scope,
374
+ params,
375
+ setParams,
376
+ theme,
377
+ callTool,
378
+ }), [def, connected, ready, scope, params, setParams, theme, callTool]);
379
+ return _jsx(Ctx.Provider, { value: value, children: children });
380
+ }
381
+ /** Entry point the compiled bundle calls once. Mounts the component into
382
+ * `#root` and connects to the host. */
383
+ export function mountView(def, Component, opts) {
384
+ const valid = defineView(def);
385
+ const el = document.getElementById("root");
386
+ if (!el)
387
+ throw new Error("#root missing in view shell");
388
+ const bridge = opts?.bridge ?? new ViewBridge();
389
+ let reported = false;
390
+ const reportSize = () => {
391
+ if (!reported) {
392
+ reported = true;
393
+ document.documentElement.setAttribute("data-mounted", "true");
394
+ }
395
+ const doc = document.documentElement;
396
+ const prev = doc.style.height;
397
+ doc.style.height = "max-content";
398
+ const height = Math.ceil(doc.getBoundingClientRect().height);
399
+ doc.style.height = prev;
400
+ bridge.notifySize(Math.ceil(window.innerWidth), height);
401
+ };
402
+ createRoot(el).render(_jsx(Provider, { def: valid, bridge: bridge, children: _jsx(Component, {}) }));
403
+ if (typeof ResizeObserver !== "undefined") {
404
+ const observer = new ResizeObserver(reportSize);
405
+ observer.observe(document.documentElement);
406
+ observer.observe(document.body);
407
+ }
408
+ reportSize();
409
+ }
410
+ //# sourceMappingURL=api.js.map