@lobu/runtime-server 23.0.0 → 24.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 (266) hide show
  1. package/dist/catalogs/connectors.json +70 -6
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +1 -1
  5. package/dist/connectors/linkedin-inbox-adapter.js +4 -7
  6. package/dist/connectors/linkedin.ts +53 -34
  7. package/dist/connectors/reddit.ts +92 -20
  8. package/dist/connectors/slack.ts +1 -0
  9. package/dist/connectors/whatsapp-web-adapter.js +41 -11
  10. package/dist/connectors/whatsapp-web-helpers.ts +1 -1
  11. package/dist/connectors/whatsapp_web.ts +2 -2
  12. package/dist/connectors/x-dm-adapter.js +65 -30
  13. package/dist/connectors/x-identity.ts +5 -3
  14. package/dist/db/migrations/20261019120000_retire_identities_of_deleted_entities.sql +21 -0
  15. package/dist/db/migrations/20261020120000_entities_live_metadata_domain.sql +66 -0
  16. package/dist/db/migrations/20261020130000_agents_starters.sql +14 -0
  17. package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +71 -0
  18. package/dist/db/migrations/20261021010000_views_compile_config_hash.sql +16 -0
  19. package/dist/dependencies.bun.lock +64 -61
  20. package/dist/guest.bundle.js +362 -300
  21. package/dist/owletto/dist/assets/_-BorucF19.js +3 -0
  22. package/dist/owletto/dist/assets/_-CkGyNi0G.js +2 -0
  23. package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +2 -0
  24. package/dist/owletto/dist/assets/_agentId-DgRrCE2B.js +2 -0
  25. package/dist/owletto/dist/assets/_automationId-DSrZIYcs.js +2 -0
  26. package/dist/owletto/dist/assets/_connectorKey._connectionId-DWxv1uoi.js +2 -0
  27. package/dist/owletto/dist/assets/_connectorKey.index-BTP5ijdT.js +2 -0
  28. package/dist/owletto/dist/assets/_conversationId-98Y3RuRO.js +2 -0
  29. package/dist/owletto/dist/assets/{_deploymentId-BuUzGtVL.js → _deploymentId-B1UWPY0i.js} +2 -2
  30. package/dist/owletto/dist/assets/_eventId-BAnr8g8z.js +2 -0
  31. package/dist/owletto/dist/assets/_name-BUfFO_A0.js +2 -0
  32. package/dist/owletto/dist/assets/_owner-C79BwQ0I.js +3 -0
  33. package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +2 -0
  34. package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +2 -0
  35. package/dist/owletto/dist/assets/_slug-DbPdDc-5.js +2 -0
  36. package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +2 -0
  37. package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +2 -0
  38. package/dist/owletto/dist/assets/{accept-invitation-w17IFTtf.js → accept-invitation-UXU5Fx2G.js} +2 -2
  39. package/dist/owletto/dist/assets/activity-route-view-D7ORHntE.js +2 -0
  40. package/dist/owletto/dist/assets/{agent-card-controls-mnTN2AZt.js → agent-card-controls-CplnPhbv.js} +2 -2
  41. package/dist/owletto/dist/assets/{agent-client-setup-list-Bg3hBfUV.js → agent-client-setup-list-BlXB4SE5.js} +2 -2
  42. package/dist/owletto/dist/assets/agent-connect-pages-BmknviTI.js +2 -0
  43. package/dist/owletto/dist/assets/agent-editor-form-DsSoeQeF.js +2 -0
  44. package/dist/owletto/dist/assets/{agent-guardrails-route-BOrCXcAl.js → agent-guardrails-route-TdvvIc_J.js} +2 -2
  45. package/dist/owletto/dist/assets/{agent-loading-shells-Dqcvky-k.js → agent-loading-shells-B7v6Cffw.js} +2 -2
  46. package/dist/owletto/dist/assets/{agent-permissions-matrix-BOo_4r_4.js → agent-permissions-matrix-BkZu1LYE.js} +2 -2
  47. package/dist/owletto/dist/assets/{agent-skill-context-CCdvtlmH.js → agent-skill-context-DFucg4c4.js} +2 -2
  48. package/dist/owletto/dist/assets/{agent-skills-route-BUxIswuq.js → agent-skills-route-B3vvvZZe.js} +2 -2
  49. package/dist/owletto/dist/assets/agent-subpage-shell-CZJvnjNC.js +2 -0
  50. package/dist/owletto/dist/assets/agent-thread-D38STyeu.js +6 -0
  51. package/dist/owletto/dist/assets/agents-DAOln24A.js +2 -0
  52. package/dist/owletto/dist/assets/agents-workbench-DJ67GZ93.js +2 -0
  53. package/dist/owletto/dist/assets/app._appId-Cp78oEZ9.js +2 -0
  54. package/dist/owletto/dist/assets/automation-detail-content-DSwbRpbx.js +2 -0
  55. package/dist/owletto/dist/assets/automations-DAOln24A.js +2 -0
  56. package/dist/owletto/dist/assets/callback-CBexCo3F.js +2 -0
  57. package/dist/owletto/dist/assets/{card-Djgp00r_.js → card-jzhQrMDP.js} +2 -2
  58. package/dist/owletto/dist/assets/{claim-BYUZnyMp.js → claim-B-wq745Q.js} +2 -2
  59. package/dist/owletto/dist/assets/client-rows-BYbsXGy9.js +2 -0
  60. package/dist/owletto/dist/assets/{clients-D3Zbjxin.js → clients-BhNl1tVq.js} +2 -2
  61. package/dist/owletto/dist/assets/{code-editor-DHeyRGZI.js → code-editor-CEqoCky-.js} +2 -2
  62. package/dist/owletto/dist/assets/connect-wx-qqLir.js +2 -0
  63. package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +2 -0
  64. package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +2 -0
  65. package/dist/owletto/dist/assets/connected._clientId.activity-BqprYeOX.js +2 -0
  66. package/dist/owletto/dist/assets/connected._clientId.index-DhRoSzBr.js +2 -0
  67. package/dist/owletto/dist/assets/{connection-C3XXFEqh.js → connection-CNm2ukrI.js} +2 -2
  68. package/dist/owletto/dist/assets/{connection-feed-detail-CIJJLDP8.js → connection-feed-detail-WcGCA6qY.js} +2 -2
  69. package/dist/owletto/dist/assets/connections-browser-CrtnAs0Q.js +2 -0
  70. package/dist/owletto/dist/assets/{connector-provenance-8-d8hl10.js → connector-provenance-D-ECOlMJ.js} +2 -2
  71. package/dist/owletto/dist/assets/connector-scope-lists-CRFEpSvk.js +2 -0
  72. package/dist/owletto/dist/assets/connectors-CH4KBZyT.js +2 -0
  73. package/dist/owletto/dist/assets/{consent-CdSvVCgx.js → consent-C9ZpHb7V.js} +2 -2
  74. package/dist/owletto/dist/assets/{conversations-table-BdXoZAfc.js → conversations-table-D_HOe1jN.js} +2 -2
  75. package/dist/owletto/dist/assets/{core.esm-CYvgWCuv.js → core.esm-BupT3V0i.js} +2 -2
  76. package/dist/owletto/dist/assets/create-C4lptGWj.js +2 -0
  77. package/dist/owletto/dist/assets/create-CCjZxIkK.js +2 -0
  78. package/dist/owletto/dist/assets/create-DkgUQAbB.js +2 -0
  79. package/dist/owletto/dist/assets/{create-automation-form-CtSSeYj3.js → create-automation-form-Bpy92SM5.js} +3 -3
  80. package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +2 -0
  81. package/dist/owletto/dist/assets/{cronstrue-n4qGUraE.js → cronstrue-CWImw-kf.js} +2 -2
  82. package/dist/owletto/dist/assets/{deployments-RvUdVkj3.js → deployments-C5hvipQh.js} +2 -2
  83. package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +2 -0
  84. package/dist/owletto/dist/assets/{deployments-body-BMp7UsMo.js → deployments-body-DGII20dQ.js} +2 -2
  85. package/dist/owletto/dist/assets/{device-CPU6CjkJ.js → device-D-7WBe9E.js} +2 -2
  86. package/dist/owletto/dist/assets/device-pin-tombstone-2U0UMu3_.js +2 -0
  87. package/dist/owletto/dist/assets/device._deviceId-Bn37UpWH.js +2 -0
  88. package/dist/owletto/dist/assets/entity-avatar-mdh7Kq5D.js +2 -0
  89. package/dist/owletto/dist/assets/entity-options-Clz_WXK-.js +2 -0
  90. package/dist/owletto/dist/assets/entity-page-D3e4iPle.js +2 -0
  91. package/dist/owletto/dist/assets/entity-type-page-DebN1vCM.js +2 -0
  92. package/dist/owletto/dist/assets/event-detail-DV_zfWnC.js +2 -0
  93. package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +2 -0
  94. package/dist/owletto/dist/assets/filter-editors-Bwhqj7lY.js +2 -0
  95. package/dist/owletto/dist/assets/{full-page-spinner-DqpH99np.js → full-page-spinner-BVbcpW3R.js} +2 -2
  96. package/dist/owletto/dist/assets/guardrails-BiJollCA.js +2 -0
  97. package/dist/owletto/dist/assets/identity-HCFWtdaI.js +2 -0
  98. package/dist/owletto/dist/assets/index-8wxsyxqt.js +2 -0
  99. package/dist/owletto/dist/assets/index-9YuSRymd.js +7950 -0
  100. package/dist/owletto/dist/assets/index-B3c-0eZG.js +2 -0
  101. package/dist/owletto/dist/assets/index-B64PGxQm.js +2 -0
  102. package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
  103. package/dist/owletto/dist/assets/{index-Hio-HRfo.js → index-BTlx9K_t.js} +2 -2
  104. package/dist/owletto/dist/assets/index-BX0EA_oB.js +2 -0
  105. package/dist/owletto/dist/assets/index-CdJJaQDX.js +2 -0
  106. package/dist/owletto/dist/assets/index-CfT_W8Vo.js +2 -0
  107. package/dist/owletto/dist/assets/index-CxF2XXzl.js +2 -0
  108. package/dist/owletto/dist/assets/index-D3WHeGql.js +2 -0
  109. package/dist/owletto/dist/assets/{index-ICgKp3YK.js → index-D7gHOpfg.js} +2 -2
  110. package/dist/owletto/dist/assets/{index-B9uPN6FC.js → index-DB1iWI_a.js} +2 -2
  111. package/dist/owletto/dist/assets/index-DMNzF8Lf.js +2 -0
  112. package/dist/owletto/dist/assets/index-DyB3IzOA.js +2 -0
  113. package/dist/owletto/dist/assets/{index-BQVliQW1.js → index-fgAJydgX.js} +2 -2
  114. package/dist/owletto/dist/assets/{json-diff-DBoag_OS.js → json-diff-DIN5Jhfx.js} +3 -3
  115. package/dist/owletto/dist/assets/{list-skeleton-C_GuoxAH.js → list-skeleton-CepswBka.js} +2 -2
  116. package/dist/owletto/dist/assets/login-DxGYyE4n.js +2 -0
  117. package/dist/owletto/dist/assets/{logout-CLGgeZB7.js → logout-Bkzc7J44.js} +2 -2
  118. package/dist/owletto/dist/assets/member-scope-gate-DD4YBFn-.js +2 -0
  119. package/dist/owletto/dist/assets/memory-browse-page-D_UlBa27.js +103 -0
  120. package/dist/owletto/dist/assets/{model-selector-dAbDgJvx.js → model-selector-CDrAjH31.js} +2 -2
  121. package/dist/owletto/dist/assets/models-BAVeysNq.js +2 -0
  122. package/dist/owletto/dist/assets/new-C2av0diq.js +2 -0
  123. package/dist/owletto/dist/assets/{new-BkdULx2r.js → new-ktz9Cs_P.js} +2 -2
  124. package/dist/owletto/dist/assets/new-snm1ctHn.js +2 -0
  125. package/dist/owletto/dist/assets/{oauth-workspace-access-BxsjwgdH.js → oauth-workspace-access-lZNZ9gul.js} +2 -2
  126. package/dist/owletto/dist/assets/{organization-gxGeDjIV.js → organization-Cb0W823y.js} +2 -2
  127. package/dist/owletto/dist/assets/peek-pane-content-BNR9ImQY.js +2 -0
  128. package/dist/owletto/dist/assets/{permissions-aPHaKLec.js → permissions-Dv39zWKt.js} +2 -2
  129. package/dist/owletto/dist/assets/proposal-review-shell-CFhOqCLf.js +2 -0
  130. package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +2 -0
  131. package/dist/owletto/dist/assets/{recent-D-65Pgu-.js → recent-QhnLDU1_.js} +2 -2
  132. package/dist/owletto/dist/assets/record-activity-ZJntBfN_.js +2 -0
  133. package/dist/owletto/dist/assets/record-field-peek-Brh1IQGy.js +2 -0
  134. package/dist/owletto/dist/assets/record-session-Pbr5czGw.js +2 -0
  135. package/dist/owletto/dist/assets/{reset-password-uX_V6bip.js → reset-password-CzZw6RcC.js} +2 -2
  136. package/dist/owletto/dist/assets/runs-panel-C0_DNTcq.js +2 -0
  137. package/dist/owletto/dist/assets/runs-table-B1APZv7d.js +2 -0
  138. package/dist/owletto/dist/assets/schema-value-normalization-CKdPjdPC.js +97 -0
  139. package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +2 -0
  140. package/dist/owletto/dist/assets/settings-VDNiffKU.js +2 -0
  141. package/dist/owletto/dist/assets/skills-DgDGscm5.js +2 -0
  142. package/dist/owletto/dist/assets/{source-record-panels-CPyzlfD1.js → source-record-panels-BdfOVPWn.js} +2 -2
  143. package/dist/owletto/dist/assets/{use-mention-search-By8RZyKW.js → use-mention-search-Dcunv4L0.js} +2 -2
  144. package/dist/owletto/dist/assets/view-param-filters-B0quibBi.js +2 -0
  145. package/dist/owletto/dist/index.html +2 -2
  146. package/dist/server-main.bundle.mjs +4226 -3348
  147. package/npm-shrinkwrap.json +280 -264
  148. package/package.json +6 -5
  149. package/vendor/connector-sdk/package.json +1 -1
  150. package/vendor/core/dist/agent-policy.js +0 -3
  151. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  152. package/vendor/core/dist/agent-tooling.js +3 -1
  153. package/vendor/core/dist/contracts/agent-settings.d.ts +6 -2
  154. package/vendor/core/dist/contracts/agent-settings.js +12 -1
  155. package/vendor/core/dist/contracts/tools/manage-views.d.ts +53 -234
  156. package/vendor/core/dist/contracts/tools/manage-views.js +50 -76
  157. package/vendor/core/dist/contracts/tools/view-attach.d.ts +5 -8
  158. package/vendor/core/dist/contracts/tools/view-attach.js +14 -31
  159. package/vendor/core/dist/contracts/tools/view-definition.d.ts +21 -0
  160. package/vendor/core/dist/contracts/tools/view-definition.js +165 -0
  161. package/vendor/core/dist/contracts/tools/view-runtime.d.ts +74 -0
  162. package/vendor/core/dist/contracts/tools/view-runtime.js +86 -0
  163. package/vendor/core/dist/contracts/worker/protocol.d.ts +39 -2
  164. package/vendor/core/dist/contracts/worker/protocol.js +24 -1
  165. package/vendor/core/dist/index.d.ts +1 -1
  166. package/vendor/core/dist/index.js +2 -1
  167. package/vendor/core/dist/suggestions.d.ts +15 -2
  168. package/vendor/core/dist/suggestions.js +48 -3
  169. package/vendor/core/dist/types.d.ts +26 -0
  170. package/vendor/core/dist/types.js +5 -0
  171. package/vendor/core/package.json +16 -5
  172. package/vendor/postgres/cf/src/connection.js +18 -0
  173. package/vendor/postgres/cjs/src/connection.js +18 -0
  174. package/vendor/postgres/src/connection.js +18 -0
  175. package/vendor/views/dist/api.d.ts +71 -17
  176. package/vendor/views/dist/api.js +200 -35
  177. package/vendor/views/dist/bridge.d.ts +3 -0
  178. package/vendor/views/dist/bridge.js +9 -1
  179. package/vendor/views/dist/components.d.ts +170 -0
  180. package/vendor/views/dist/components.js +361 -0
  181. package/vendor/views/dist/index.d.ts +1 -1
  182. package/vendor/views/package.json +11 -1
  183. package/dist/owletto/dist/assets/_-3J-IrxWk.js +0 -2
  184. package/dist/owletto/dist/assets/_-DYUE3ix4.js +0 -3
  185. package/dist/owletto/dist/assets/_agentId-Bn2IAjIy.js +0 -2
  186. package/dist/owletto/dist/assets/_agentId-Cam7Z0N7.js +0 -2
  187. package/dist/owletto/dist/assets/_automationId-CXEiKVZJ.js +0 -2
  188. package/dist/owletto/dist/assets/_connectorKey._connectionId-CS85l61t.js +0 -2
  189. package/dist/owletto/dist/assets/_connectorKey.index-clVDIyW0.js +0 -2
  190. package/dist/owletto/dist/assets/_conversationId-Ci2k-BuN.js +0 -2
  191. package/dist/owletto/dist/assets/_eventId-B0662F8h.js +0 -2
  192. package/dist/owletto/dist/assets/_name-CwWePlOl.js +0 -2
  193. package/dist/owletto/dist/assets/_owner-dTWkrKsK.js +0 -3
  194. package/dist/owletto/dist/assets/_shape-BtS3y4M9.js +0 -2
  195. package/dist/owletto/dist/assets/_skillKey-Dc9m-nlR.js +0 -2
  196. package/dist/owletto/dist/assets/_slug-DQHutM41.js +0 -2
  197. package/dist/owletto/dist/assets/_viewKey-B30ik8ma.js +0 -2
  198. package/dist/owletto/dist/assets/_viewKey-CUHypQnF.js +0 -2
  199. package/dist/owletto/dist/assets/activity-route-view-CMqYiiKM.js +0 -2
  200. package/dist/owletto/dist/assets/agent-connect-pages-B_vrqLVc.js +0 -2
  201. package/dist/owletto/dist/assets/agent-editor-form-hTs7eO_U.js +0 -2
  202. package/dist/owletto/dist/assets/agent-subpage-shell-D92imvSt.js +0 -2
  203. package/dist/owletto/dist/assets/agent-thread-BJOijbT0.js +0 -6
  204. package/dist/owletto/dist/assets/agents-9XjpDj_S.js +0 -2
  205. package/dist/owletto/dist/assets/agents-workbench-Bt5QCYQ7.js +0 -2
  206. package/dist/owletto/dist/assets/app._appId-CKv7_squ.js +0 -2
  207. package/dist/owletto/dist/assets/automation-detail-content-vUwVumXf.js +0 -2
  208. package/dist/owletto/dist/assets/automations-9XjpDj_S.js +0 -2
  209. package/dist/owletto/dist/assets/callback-BRgcL8gz.js +0 -2
  210. package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
  211. package/dist/owletto/dist/assets/connect-CfsFsy9P.js +0 -2
  212. package/dist/owletto/dist/assets/connect._clientId-DkiC8xos.js +0 -2
  213. package/dist/owletto/dist/assets/connected._clientId-CIXrGOsT.js +0 -2
  214. package/dist/owletto/dist/assets/connected._clientId.activity-Ckdz6I0y.js +0 -2
  215. package/dist/owletto/dist/assets/connected._clientId.index-CNxafNeo.js +0 -2
  216. package/dist/owletto/dist/assets/connections-browser-CKZjzRz6.js +0 -2
  217. package/dist/owletto/dist/assets/connector-scope-lists-CadPVsI3.js +0 -2
  218. package/dist/owletto/dist/assets/connectors-lvLJ30lo.js +0 -2
  219. package/dist/owletto/dist/assets/create-0xW9eXxG.js +0 -2
  220. package/dist/owletto/dist/assets/create-B0qhrrX4.js +0 -2
  221. package/dist/owletto/dist/assets/create-CAfF-yI1.js +0 -2
  222. package/dist/owletto/dist/assets/create._connectorKey-i6xxkWKV.js +0 -2
  223. package/dist/owletto/dist/assets/deployments-4Itm35Xc.js +0 -2
  224. package/dist/owletto/dist/assets/device-pin-tombstone-CrjG7gPo.js +0 -2
  225. package/dist/owletto/dist/assets/device._deviceId-Cs3ZmXWo.js +0 -2
  226. package/dist/owletto/dist/assets/entity-options-uXjgT7y9.js +0 -2
  227. package/dist/owletto/dist/assets/entity-page-Dc0LGr5U.js +0 -2
  228. package/dist/owletto/dist/assets/entity-type-page-CwZxa0BR.js +0 -2
  229. package/dist/owletto/dist/assets/event-detail-ve2d6Gbb.js +0 -2
  230. package/dist/owletto/dist/assets/events-feed-BtvhZF1f.js +0 -2
  231. package/dist/owletto/dist/assets/filter-editors-Cj-v6NtH.js +0 -2
  232. package/dist/owletto/dist/assets/guardrails-HFo2Ut8B.js +0 -2
  233. package/dist/owletto/dist/assets/identity-BigVSBCl.js +0 -2
  234. package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
  235. package/dist/owletto/dist/assets/index-BfedB4Rc.js +0 -2
  236. package/dist/owletto/dist/assets/index-CUw3aKBI.js +0 -2
  237. package/dist/owletto/dist/assets/index-CXhxUkv3.js +0 -2
  238. package/dist/owletto/dist/assets/index-Cr5hwh-C.js +0 -7950
  239. package/dist/owletto/dist/assets/index-CzkTV4ZQ.js +0 -2
  240. package/dist/owletto/dist/assets/index-DKSx8JN_.js +0 -2
  241. package/dist/owletto/dist/assets/index-DVk7Ug0d.js +0 -2
  242. package/dist/owletto/dist/assets/index-DmZuKGf8.js +0 -2
  243. package/dist/owletto/dist/assets/index-cPcroOH0.js +0 -2
  244. package/dist/owletto/dist/assets/index-n7sTbNv4.js +0 -2
  245. package/dist/owletto/dist/assets/index-xiFpcWKv.js +0 -2
  246. package/dist/owletto/dist/assets/login-Ci6ixHuL.js +0 -2
  247. package/dist/owletto/dist/assets/member-scope-gate-B44INDPY.js +0 -2
  248. package/dist/owletto/dist/assets/memory-browse-page-DyQiRvzl.js +0 -103
  249. package/dist/owletto/dist/assets/models-DpVP7ZwX.js +0 -2
  250. package/dist/owletto/dist/assets/new-BUb7AnEW.js +0 -2
  251. package/dist/owletto/dist/assets/new-CHOr-EcI.js +0 -2
  252. package/dist/owletto/dist/assets/peek-pane-content-CHoQHe2H.js +0 -2
  253. package/dist/owletto/dist/assets/proposal-review-shell-UcZr87_Q.js +0 -2
  254. package/dist/owletto/dist/assets/public-shell-ready-DcnlADmj.js +0 -2
  255. package/dist/owletto/dist/assets/record-activity-CBXH6v1d.js +0 -2
  256. package/dist/owletto/dist/assets/renderer-mEDnVW0O.js +0 -97
  257. package/dist/owletto/dist/assets/runs-C0rCgGwX.js +0 -2
  258. package/dist/owletto/dist/assets/runs-panel-Du1JMjg5.js +0 -2
  259. package/dist/owletto/dist/assets/runs-table-syPJ6r6T.js +0 -2
  260. package/dist/owletto/dist/assets/settings-9NkNA1G1.js +0 -2
  261. package/dist/owletto/dist/assets/settings-E-10sLQX.js +0 -2
  262. package/dist/owletto/dist/assets/skills-D2Ri9b4f.js +0 -2
  263. package/dist/owletto/dist/assets/status-dot-B-EWMgq6.js +0 -2
  264. package/dist/owletto/dist/assets/tabs-DqIIkCX-.js +0 -2
  265. package/dist/owletto/dist/assets/view-param-filters-CqLZQrnO.js +0 -2
  266. /package/vendor/postgres/{.bun-tag-f39dafdb2305d504 → .bun-tag-2f292c6554a8475e} +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewKeySchema = void 0;
3
+ exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewDefinitionSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewKeySchema = void 0;
4
4
  const typebox_1 = require("@sinclair/typebox");
5
5
  const collection_selection_1 = require("./collection-selection");
6
6
  const source_files_schema_1 = require("./source-files-schema");
@@ -15,78 +15,46 @@ exports.ViewKeySchema = typebox_1.Type.String({
15
15
  maxLength: 64,
16
16
  description: "View key, e.g. 'pipeline'.",
17
17
  });
18
- // Where a view appears. The attach line lives in the module source; there are
19
- // no attach/detach verbs — changing placement means re-saving the view.
20
- const ViewPlacementSchema = typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("tab"), typebox_1.Type.Literal("overview")], {
21
- description: "Type-attached views render as a full tab or an Overview card.",
22
- }));
23
- // `event_kind` belongs to the event variant alone. The subject variants stay
24
- // open objects (the handler reports a mixed entry itself), so each one forbids
25
- // the key: otherwise `{ event_kind, type, placement }` would validate as a
26
- // type attachment and render as a type tab.
27
- const NoEventKind = typebox_1.Type.Optional(typebox_1.Type.Never());
28
- const TypeSubject = {
29
- type: typebox_1.Type.String({
30
- minLength: 1,
31
- maxLength: 120,
32
- description: "Entity-type slug this view attaches to.",
33
- }),
34
- placement: ViewPlacementSchema,
35
- event_kind: NoEventKind,
36
- };
18
+ // Where a view appears: one page per entry, named by its key. The attach line
19
+ // lives in the module source; there are no attach/detach verbs — changing it
20
+ // means re-saving the view. How the view renders there is the view's own
21
+ // choice, from the host's display mode (an inline card or fullscreen).
22
+ const EntityTypeSlug = (description) => typebox_1.Type.String({ minLength: 1, maxLength: 120, description });
37
23
  exports.ViewAttachmentSchema = typebox_1.Type.Union([
38
- // Existing type declarations continue to appear on collections and records.
39
- typebox_1.Type.Object({
40
- ...TypeSubject,
41
- surface: typebox_1.Type.Optional(typebox_1.Type.Never()),
42
- when: typebox_1.Type.Optional(typebox_1.Type.Never()),
43
- }),
24
+ // A record page: an inline card above the record's activity, opening
25
+ // fullscreen in the peek. `id` pins it to one record of the type.
44
26
  typebox_1.Type.Object({
45
- ...TypeSubject,
46
- surface: typebox_1.Type.Literal("record"),
47
- when: typebox_1.Type.Optional(typebox_1.Type.Never()),
48
- }),
27
+ record: EntityTypeSlug("Entity type whose record pages show this view."),
28
+ id: typebox_1.Type.Optional(typebox_1.Type.Integer({
29
+ minimum: 1,
30
+ description: "Show it on this one record of the type only.",
31
+ })),
32
+ }, { additionalProperties: false }),
33
+ // A type's list page: a tab beside the records, at /<type>/-/views/<key>.
49
34
  typebox_1.Type.Object({
50
- ...TypeSubject,
51
- surface: typebox_1.Type.Literal("collection"),
52
- placement: typebox_1.Type.Optional(typebox_1.Type.Literal("tab")),
35
+ collection: EntityTypeSlug("Entity type whose list page shows this view as a tab."),
53
36
  when: typebox_1.Type.Optional(collection_selection_1.CollectionWhenSchema),
54
- }),
55
- typebox_1.Type.Object({
56
- entity: typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.String()], {
57
- description: "Entity id (number) or slug (string) this view attaches to.",
58
- }),
59
- placement: ViewPlacementSchema,
60
- event_kind: NoEventKind,
61
- surface: typebox_1.Type.Optional(typebox_1.Type.Never()),
62
- when: typebox_1.Type.Optional(typebox_1.Type.Never()),
63
- }),
37
+ }, { additionalProperties: false }),
38
+ // The Data hub: a tab at /data/-/views/<key>.
64
39
  typebox_1.Type.Object({
65
40
  workspace: typebox_1.Type.Literal(true, {
66
41
  description: "A tab on the Data hub, at /data/-/views/<key>.",
67
42
  }),
68
- placement: ViewPlacementSchema,
69
- event_kind: NoEventKind,
70
- surface: typebox_1.Type.Optional(typebox_1.Type.Never()),
71
- when: typebox_1.Type.Optional(typebox_1.Type.Never()),
72
- }),
73
- // An event subject: the view renders one event (scope.event) on the event's
74
- // own page, /events/<id>/-/views/<key>. It matches an event whose kind is
75
- // `event_kind`, optionally qualified by a linked entity of `type`. Closed, and no
76
- // placement: the event page has one layout.
43
+ }, { additionalProperties: false }),
44
+ // One event's page, /events/<id>/-/views/<key>: matches an event of kind
45
+ // `event`, optionally only when it links an entity of `type`.
77
46
  typebox_1.Type.Object({
78
- event_kind: typebox_1.Type.String({
47
+ event: typebox_1.Type.String({
79
48
  minLength: 1,
80
49
  maxLength: 128,
50
+ pattern: "^[A-Za-z][A-Za-z0-9._-]{0,127}$",
81
51
  description: "Event kind (semantic_type) this view renders, e.g. 'deal.won'.",
82
52
  }),
83
- type: typebox_1.Type.Optional(typebox_1.Type.String({
84
- minLength: 1,
85
- maxLength: 120,
86
- description: "Optional linked entity-type qualifier. Omit to match the event kind alone.",
87
- })),
53
+ type: typebox_1.Type.Optional(EntityTypeSlug("Only events linking an entity of this type.")),
88
54
  }, { additionalProperties: false }),
89
- ]);
55
+ ], {
56
+ description: '{ record: "<type>", id?: <entity id> }, { collection: "<type>", when? }, { workspace: true } or { event: "<kind>", type?: "<type>" }',
57
+ });
90
58
  // Declared, typed URL params. Unknown params are ignored; `$collection`,
91
59
  // `peek` and `peek_*` are reserved for shared selection and the peek pane.
92
60
  exports.ViewParamDeclSchema = typebox_1.Type.Object({
@@ -118,6 +86,27 @@ exports.ViewActionDeclSchema = typebox_1.Type.Object({
118
86
  description: "Event kind appended when the action fires, e.g. 'deal.won'.",
119
87
  }),
120
88
  });
89
+ // Everything a view declares about itself, read from its module's
90
+ // `export const view = defineView({...})`. The module is the only place these
91
+ // live: `set` takes the source and the server reads this out of it.
92
+ exports.ViewDefinitionSchema = typebox_1.Type.Object({
93
+ key: exports.ViewKeySchema,
94
+ name: typebox_1.Type.Optional(typebox_1.Type.String({
95
+ minLength: 1,
96
+ maxLength: 120,
97
+ description: "Display name; defaults to the key.",
98
+ })),
99
+ description: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500, description: "What the view shows." })),
100
+ attach: typebox_1.Type.Array(exports.ViewAttachmentSchema, {
101
+ description: "Where the view appears.",
102
+ }),
103
+ params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema, {
104
+ description: "Declared URL params.",
105
+ })),
106
+ actions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema, {
107
+ description: "Declared actions and the event kind each emits.",
108
+ })),
109
+ }, { additionalProperties: false });
121
110
  // Public projection of a stored view: metadata only, never the bundle. The
122
111
  // bundle travels over the view resource / shell route; the source over get.
123
112
  exports.ViewRowSchema = typebox_1.Type.Object({
@@ -146,18 +135,12 @@ exports.ViewRowSchema = typebox_1.Type.Object({
146
135
  // variant must read true for every one of them.
147
136
  exports.SetViewAction = typebox_1.Type.Object({
148
137
  action: typebox_1.Type.Literal("set", {
149
- description: "Store a view: compile source_code and upsert by key.",
138
+ description: "Store a view: read its key, name, description, attach, params and actions from the module's `export const view = defineView({...})`, compile it, and upsert by that key.",
150
139
  }),
151
- key: exports.ViewKeySchema,
152
- name: typebox_1.Type.Optional(typebox_1.Type.String({
153
- maxLength: 120,
154
- description: "[set] Display name; defaults to key.",
155
- })),
156
- description: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500, description: "[set] What the view shows." })),
157
140
  source_code: typebox_1.Type.String({
158
141
  minLength: 1,
159
142
  maxLength: 1000000,
160
- description: "[set] The view module source (TSX). Compiled server-side.",
143
+ description: "[set] The view module source (TSX). Its `defineView({...})` argument must be a literal; it is the only place the view's key, name, description, attach, params and actions are declared.",
161
144
  }),
162
145
  compiled_code: typebox_1.Type.Optional(typebox_1.Type.String({
163
146
  minLength: 1,
@@ -165,15 +148,6 @@ exports.SetViewAction = typebox_1.Type.Object({
165
148
  })),
166
149
  source_files: typebox_1.Type.Optional(source_files_schema_1.SourceFilesSchema),
167
150
  dependencies: typebox_1.Type.Optional(source_files_schema_1.SourceDependenciesSchema),
168
- attach: typebox_1.Type.Optional(typebox_1.Type.Array(exports.ViewAttachmentSchema, {
169
- description: "[set] Where the view appears; extracted from the module by the caller.",
170
- })),
171
- params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema, {
172
- description: "[set] Declared URL params.",
173
- })),
174
- actions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema, {
175
- description: "[set] Declared actions and the event kind each emits.",
176
- })),
177
151
  last_writer: typebox_1.Type.Optional(typebox_1.Type.String({
178
152
  maxLength: 200,
179
153
  description: "[set] Provenance; defaults to the caller.",
@@ -1,19 +1,16 @@
1
1
  import { type CollectionSelection } from "./collection-selection";
2
2
  import type { ViewAttachment } from "./manage-views";
3
3
  type EventAttachment = Extract<ViewAttachment, {
4
- event_kind: string;
4
+ event: string;
5
5
  }>;
6
- type ViewPlacement = "tab" | "overview";
7
- /** An event's type qualifies its linked entities; it never names a page tab. */
8
6
  export declare function isEventAttachment(attachment: ViewAttachment): attachment is EventAttachment;
9
- export declare function isTabAttachment(attachment: ViewAttachment): boolean;
10
- export declare function matchesType(attachment: ViewAttachment, typeSlug: string, placement: ViewPlacement, selection?: CollectionSelection): boolean;
7
+ /** A tab on the type's list page, when the list's selection implies `when`. */
8
+ export declare function matchesCollection(attachment: ViewAttachment, typeSlug: string, selection?: CollectionSelection): boolean;
9
+ /** A card on the record's page: every record of the type, or one pinned id. */
11
10
  export declare function matchesRecord(attachment: ViewAttachment, record: {
12
11
  type: string;
13
12
  id: number;
14
- slug: string;
15
- parentId: number | null;
16
- }, placement: ViewPlacement): boolean;
13
+ }): boolean;
17
14
  export declare function hasWorkspaceAttachment(attach: readonly ViewAttachment[]): boolean;
18
15
  /** Without a kind, the web host considers every event attachment a candidate. */
19
16
  export declare function eventAttachmentsFor(attach: readonly ViewAttachment[], semanticType?: string): EventAttachment[];
@@ -1,50 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isEventAttachment = isEventAttachment;
4
- exports.isTabAttachment = isTabAttachment;
5
- exports.matchesType = matchesType;
4
+ exports.matchesCollection = matchesCollection;
6
5
  exports.matchesRecord = matchesRecord;
7
6
  exports.hasWorkspaceAttachment = hasWorkspaceAttachment;
8
7
  exports.eventAttachmentsFor = eventAttachmentsFor;
9
8
  const collection_selection_1 = require("./collection-selection");
10
- /** An event's type qualifies its linked entities; it never names a page tab. */
11
9
  function isEventAttachment(attachment) {
12
- return ("event_kind" in attachment && typeof attachment.event_kind === "string");
10
+ return "event" in attachment;
13
11
  }
14
- function isTabAttachment(attachment) {
15
- return (!isEventAttachment(attachment) && (attachment.placement ?? "tab") === "tab");
12
+ /** A tab on the type's list page, when the list's selection implies `when`. */
13
+ function matchesCollection(attachment, typeSlug, selection = {}) {
14
+ return ("collection" in attachment &&
15
+ attachment.collection === typeSlug &&
16
+ (!attachment.when || (0, collection_selection_1.selectionImplies)(selection, attachment.when)));
16
17
  }
17
- function matchesType(attachment, typeSlug, placement, selection = {}) {
18
- return (!isEventAttachment(attachment) &&
19
- "type" in attachment &&
20
- attachment.type === typeSlug &&
21
- attachment.surface !== "record" &&
22
- (!attachment.when || (0, collection_selection_1.selectionImplies)(selection, attachment.when)) &&
23
- (attachment.placement ?? "tab") === placement);
24
- }
25
- function matchesRecord(attachment, record, placement) {
26
- if (isEventAttachment(attachment))
27
- return false;
28
- if ((attachment.placement ?? "tab") !== placement)
29
- return false;
30
- if ("entity" in attachment) {
31
- return typeof attachment.entity === "number"
32
- ? attachment.entity === record.id
33
- : record.parentId === null && attachment.entity === record.slug;
34
- }
35
- return ("type" in attachment &&
36
- attachment.type === record.type &&
37
- attachment.surface !== "collection");
18
+ /** A card on the record's page: every record of the type, or one pinned id. */
19
+ function matchesRecord(attachment, record) {
20
+ return ("record" in attachment &&
21
+ attachment.record === record.type &&
22
+ (attachment.id === undefined || attachment.id === record.id));
38
23
  }
39
24
  function hasWorkspaceAttachment(attach) {
40
- return attach.some((attachment) => !isEventAttachment(attachment) &&
41
- "workspace" in attachment &&
42
- attachment.workspace === true);
25
+ return attach.some((attachment) => "workspace" in attachment);
43
26
  }
44
27
  /** Without a kind, the web host considers every event attachment a candidate. */
45
28
  function eventAttachmentsFor(attach, semanticType) {
46
29
  return attach
47
30
  .filter(isEventAttachment)
48
- .filter((attachment) => semanticType === undefined || attachment.event_kind === semanticType);
31
+ .filter((attachment) => semanticType === undefined || attachment.event === semanticType);
49
32
  }
50
33
  //# sourceMappingURL=view-attach.js.map
@@ -0,0 +1,21 @@
1
+ import { type ViewActionDecl, type ViewAttachment, type ViewParamDecl } from "./manage-views";
2
+ /** A view's declaration with its defaults applied: what the server stores and
3
+ * what the CLI hashes, so both derive it from the same function. */
4
+ export interface ViewDefinitionRecord {
5
+ key: string;
6
+ name: string;
7
+ description: string;
8
+ attach: ViewAttachment[];
9
+ params: Record<string, ViewParamDecl>;
10
+ actions: Record<string, ViewActionDecl>;
11
+ }
12
+ /**
13
+ * Read `export const view = defineView({...})` out of a view module, without
14
+ * running it. `js` is the module with TypeScript and JSX already stripped
15
+ * (esbuild `transform`); the argument must be a plain literal (objects,
16
+ * arrays, strings, numbers, booleans, null), so a declaration is data the
17
+ * server can read safely from any author's source. Throws an Error whose
18
+ * message names what to fix.
19
+ */
20
+ export declare function readViewDefinition(js: string): ViewDefinitionRecord;
21
+ //# sourceMappingURL=view-definition.d.ts.map
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readViewDefinition = readViewDefinition;
4
+ const value_1 = require("@sinclair/typebox/value");
5
+ const acorn_1 = require("acorn");
6
+ const manage_views_1 = require("./manage-views");
7
+ const VIEWS_PACKAGE = "@lobu/views";
8
+ /**
9
+ * Read `export const view = defineView({...})` out of a view module, without
10
+ * running it. `js` is the module with TypeScript and JSX already stripped
11
+ * (esbuild `transform`); the argument must be a plain literal (objects,
12
+ * arrays, strings, numbers, booleans, null), so a declaration is data the
13
+ * server can read safely from any author's source. Throws an Error whose
14
+ * message names what to fix.
15
+ */
16
+ function readViewDefinition(js) {
17
+ let program;
18
+ try {
19
+ program = (0, acorn_1.parse)(js, {
20
+ ecmaVersion: "latest",
21
+ sourceType: "module",
22
+ });
23
+ }
24
+ catch (error) {
25
+ throw new Error(`view module does not parse: ${error.message}`);
26
+ }
27
+ const callee = defineViewLocalName(program.body);
28
+ const argument = callee ? viewExportArgument(program.body, callee) : null;
29
+ if (!argument) {
30
+ throw new Error(`the module must export const view = defineView({ key, attach, ... }) with defineView imported from "${VIEWS_PACKAGE}"`);
31
+ }
32
+ if (!hasDefaultExport(program.body)) {
33
+ throw new Error("the module must have a default-export component");
34
+ }
35
+ const raw = literalValue(argument, "defineView");
36
+ if (!value_1.Value.Check(manage_views_1.ViewDefinitionSchema, raw)) {
37
+ const first = value_1.Value.Errors(manage_views_1.ViewDefinitionSchema, raw).First();
38
+ const at = first?.path
39
+ ? `defineView${first.path.split("/").join(".")}`
40
+ : "defineView";
41
+ // A union (an attach entry) names the shapes it accepts, not "Expected
42
+ // union value".
43
+ const schema = first?.schema;
44
+ const message = schema?.anyOf && schema.description
45
+ ? `Expected ${schema.description}`
46
+ : (first?.message ?? "invalid view definition");
47
+ throw new Error(`${at}: ${message}`);
48
+ }
49
+ const def = raw;
50
+ return {
51
+ key: def.key,
52
+ name: def.name?.trim() ? def.name : def.key,
53
+ description: def.description ?? "",
54
+ attach: def.attach,
55
+ params: def.params ?? {},
56
+ actions: def.actions ?? {},
57
+ };
58
+ }
59
+ function defineViewLocalName(body) {
60
+ for (const statement of body) {
61
+ if (statement.type !== "ImportDeclaration")
62
+ continue;
63
+ if (statement.source.value !== VIEWS_PACKAGE)
64
+ continue;
65
+ for (const spec of statement.specifiers) {
66
+ if (spec.type !== "ImportSpecifier")
67
+ continue;
68
+ const imported = spec.imported;
69
+ if (imported.name === "defineView" || imported.value === "defineView") {
70
+ return spec.local.name;
71
+ }
72
+ }
73
+ }
74
+ return null;
75
+ }
76
+ function hasDefaultExport(body) {
77
+ return body.some((statement) => statement.type === "ExportDefaultDeclaration" ||
78
+ (statement.type === "ExportNamedDeclaration" &&
79
+ (statement.specifiers ?? []).some((spec) => spec.exported.name === "default")));
80
+ }
81
+ function viewExportArgument(body, callee) {
82
+ for (const statement of body) {
83
+ if (statement.type !== "ExportNamedDeclaration")
84
+ continue;
85
+ const declaration = statement.declaration;
86
+ if (declaration?.type !== "VariableDeclaration")
87
+ continue;
88
+ for (const declarator of declaration.declarations) {
89
+ if (declarator.id.name !== "view")
90
+ continue;
91
+ const init = declarator.init;
92
+ const args = init?.arguments;
93
+ if (init?.type === "CallExpression" &&
94
+ init.callee.type === "Identifier" &&
95
+ init.callee.name === callee &&
96
+ args?.length === 1) {
97
+ return args[0] ?? null;
98
+ }
99
+ }
100
+ }
101
+ return null;
102
+ }
103
+ function literalValue(node, path) {
104
+ switch (node.type) {
105
+ case "ObjectExpression": {
106
+ const out = {};
107
+ for (const prop of node.properties) {
108
+ if (prop.type !== "Property" ||
109
+ prop.kind !== "init" ||
110
+ prop.computed ||
111
+ prop.method ||
112
+ prop.shorthand) {
113
+ throw notLiteral(path, "a spread, shorthand, method or computed key");
114
+ }
115
+ const keyNode = prop.key;
116
+ const key = keyNode.type === "Identifier"
117
+ ? keyNode.name
118
+ : typeof keyNode.value === "string" ||
119
+ typeof keyNode.value === "number"
120
+ ? String(keyNode.value)
121
+ : null;
122
+ if (key === null || key === "__proto__") {
123
+ throw notLiteral(path, "an unsupported key");
124
+ }
125
+ out[key] = literalValue(prop.value, `${path}.${key}`);
126
+ }
127
+ return out;
128
+ }
129
+ case "ArrayExpression":
130
+ return node.elements.map((element, index) => {
131
+ if (!element || element.type === "SpreadElement") {
132
+ throw notLiteral(`${path}[${index}]`, "a hole or spread");
133
+ }
134
+ return literalValue(element, `${path}[${index}]`);
135
+ });
136
+ case "Literal":
137
+ if (node.regex || node.bigint !== undefined) {
138
+ throw notLiteral(path, "a regular expression or bigint");
139
+ }
140
+ return node.value;
141
+ case "UnaryExpression": {
142
+ const argument = node.argument;
143
+ if (node.operator === "-" &&
144
+ argument.type === "Literal" &&
145
+ typeof argument.value === "number") {
146
+ return -argument.value;
147
+ }
148
+ throw notLiteral(path, `the expression \`${node.operator}…\``);
149
+ }
150
+ case "TemplateLiteral":
151
+ if (node.expressions.length === 0) {
152
+ return (node.quasis[0]?.value)
153
+ .cooked;
154
+ }
155
+ throw notLiteral(path, "a template with ${…}");
156
+ default:
157
+ throw notLiteral(path, node.type === "Identifier"
158
+ ? `the variable \`${node.name}\``
159
+ : `a ${node.type}`);
160
+ }
161
+ }
162
+ function notLiteral(path, found) {
163
+ return new Error(`${path} must be written out as a literal (objects, arrays, strings, numbers, booleans, null); found ${found}`);
164
+ }
165
+ //# sourceMappingURL=view-definition.js.map
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The view runtime contract: React, React DOM and `@lobu/views` are supplied
3
+ * by the view shell, never bundled into a view. The server builds them once
4
+ * from its own installation and inlines that script ahead of every view
5
+ * bundle as `globalThis[VIEW_RUNTIME_GLOBAL]`; each view bundle reads its
6
+ * runtime imports off that global. A runtime fix reaches views using this
7
+ * contract on the next deploy, without re-saving them. A self-contained
8
+ * bundle from before the contract keeps running on its own runtime until it
9
+ * is saved again; one the server built is rebuilt when served.
10
+ *
11
+ * Every view compiler builds through these pieces — the server on save and on
12
+ * a served rebuild, and `lobu apply` in the author's checkout — so the same
13
+ * retained source compiles to the same bundle wherever it is built.
14
+ */
15
+ /** Global the shell's runtime script assigns and every view bundle reads. */
16
+ export declare const VIEW_RUNTIME_GLOBAL = "__lobuViews";
17
+ /** Module specifiers a view imports from the shell runtime. */
18
+ export declare const VIEW_RUNTIME_MODULES: readonly string[];
19
+ /** Packages behind {@link VIEW_RUNTIME_MODULES}. A view whose retained
20
+ * dependencies are all among these needs nothing but its own source files
21
+ * to compile, so the server can build it. */
22
+ export declare const VIEW_RUNTIME_PACKAGES: readonly string[];
23
+ /** Entry source that mounts the module at `specifier` through the runtime's
24
+ * `mountView`: its `view` declaration and default-export component. */
25
+ export declare function viewMountEntry(specifier: string): string;
26
+ /** Entry source for the shell runtime script: every runtime module, keyed by
27
+ * specifier on the runtime global. */
28
+ export declare function viewRuntimeEntry(): string;
29
+ /** esbuild options every view bundle and the runtime script share. */
30
+ export declare const VIEW_BUILD_OPTIONS: {
31
+ readonly bundle: true;
32
+ readonly write: false;
33
+ readonly format: "iife";
34
+ readonly platform: "browser";
35
+ readonly target: "es2022";
36
+ readonly jsx: "automatic";
37
+ readonly minify: true;
38
+ readonly sourcemap: false;
39
+ readonly legalComments: "none";
40
+ readonly define: {
41
+ readonly "process.env.NODE_ENV": "\"production\"";
42
+ };
43
+ readonly logLevel: "silent";
44
+ };
45
+ interface RuntimePluginBuild {
46
+ onResolve(options: {
47
+ filter: RegExp;
48
+ }, callback: (args: {
49
+ path: string;
50
+ }) => {
51
+ path: string;
52
+ namespace: string;
53
+ } | undefined): void;
54
+ onLoad(options: {
55
+ filter: RegExp;
56
+ namespace: string;
57
+ }, callback: (args: {
58
+ path: string;
59
+ }) => {
60
+ contents: string;
61
+ loader: "js";
62
+ }): void;
63
+ }
64
+ /**
65
+ * esbuild plugin resolving each runtime module to a shim that reads it off
66
+ * the runtime global, so the bundle carries none of the runtime. Structurally
67
+ * typed: core does not depend on esbuild.
68
+ */
69
+ export declare function viewRuntimePlugin(): {
70
+ name: string;
71
+ setup(build: RuntimePluginBuild): void;
72
+ };
73
+ export {};
74
+ //# sourceMappingURL=view-runtime.d.ts.map
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * The view runtime contract: React, React DOM and `@lobu/views` are supplied
4
+ * by the view shell, never bundled into a view. The server builds them once
5
+ * from its own installation and inlines that script ahead of every view
6
+ * bundle as `globalThis[VIEW_RUNTIME_GLOBAL]`; each view bundle reads its
7
+ * runtime imports off that global. A runtime fix reaches views using this
8
+ * contract on the next deploy, without re-saving them. A self-contained
9
+ * bundle from before the contract keeps running on its own runtime until it
10
+ * is saved again; one the server built is rebuilt when served.
11
+ *
12
+ * Every view compiler builds through these pieces — the server on save and on
13
+ * a served rebuild, and `lobu apply` in the author's checkout — so the same
14
+ * retained source compiles to the same bundle wherever it is built.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.VIEW_BUILD_OPTIONS = exports.VIEW_RUNTIME_PACKAGES = exports.VIEW_RUNTIME_MODULES = exports.VIEW_RUNTIME_GLOBAL = void 0;
18
+ exports.viewMountEntry = viewMountEntry;
19
+ exports.viewRuntimeEntry = viewRuntimeEntry;
20
+ exports.viewRuntimePlugin = viewRuntimePlugin;
21
+ /** Global the shell's runtime script assigns and every view bundle reads. */
22
+ exports.VIEW_RUNTIME_GLOBAL = "__lobuViews";
23
+ /** Module specifiers a view imports from the shell runtime. */
24
+ exports.VIEW_RUNTIME_MODULES = [
25
+ "react",
26
+ "react/jsx-runtime",
27
+ "react-dom",
28
+ "react-dom/client",
29
+ "@lobu/views",
30
+ "@lobu/views/components",
31
+ ];
32
+ /** Packages behind {@link VIEW_RUNTIME_MODULES}. A view whose retained
33
+ * dependencies are all among these needs nothing but its own source files
34
+ * to compile, so the server can build it. */
35
+ exports.VIEW_RUNTIME_PACKAGES = [
36
+ "react",
37
+ "react-dom",
38
+ "@lobu/views",
39
+ ];
40
+ const RUNTIME_NAMESPACE = "lobu-view-runtime";
41
+ /** Entry source that mounts the module at `specifier` through the runtime's
42
+ * `mountView`: its `view` declaration and default-export component. */
43
+ function viewMountEntry(specifier) {
44
+ return `import { mountView } from "@lobu/views";\nimport * as mod from ${JSON.stringify(specifier)};\nmountView(mod.view, mod.default);\n`;
45
+ }
46
+ /** Entry source for the shell runtime script: every runtime module, keyed by
47
+ * specifier on the runtime global. */
48
+ function viewRuntimeEntry() {
49
+ const imports = exports.VIEW_RUNTIME_MODULES.map((specifier, i) => `import * as m${i} from ${JSON.stringify(specifier)};`);
50
+ const entries = exports.VIEW_RUNTIME_MODULES.map((specifier, i) => `${JSON.stringify(specifier)}: m${i}`);
51
+ return `${imports.join("\n")}\nglobalThis[${JSON.stringify(exports.VIEW_RUNTIME_GLOBAL)}] = Object.freeze({ ${entries.join(", ")} });\n`;
52
+ }
53
+ /** esbuild options every view bundle and the runtime script share. */
54
+ exports.VIEW_BUILD_OPTIONS = {
55
+ bundle: true,
56
+ write: false,
57
+ format: "iife",
58
+ platform: "browser",
59
+ target: "es2022",
60
+ jsx: "automatic",
61
+ minify: true,
62
+ sourcemap: false,
63
+ legalComments: "none",
64
+ define: { "process.env.NODE_ENV": '"production"' },
65
+ logLevel: "silent",
66
+ };
67
+ /**
68
+ * esbuild plugin resolving each runtime module to a shim that reads it off
69
+ * the runtime global, so the bundle carries none of the runtime. Structurally
70
+ * typed: core does not depend on esbuild.
71
+ */
72
+ function viewRuntimePlugin() {
73
+ return {
74
+ name: "lobu-view-runtime",
75
+ setup(build) {
76
+ build.onResolve({ filter: /.*/ }, (args) => exports.VIEW_RUNTIME_MODULES.includes(args.path)
77
+ ? { path: args.path, namespace: RUNTIME_NAMESPACE }
78
+ : undefined);
79
+ build.onLoad({ filter: /.*/, namespace: RUNTIME_NAMESPACE }, (args) => ({
80
+ contents: `module.exports = globalThis[${JSON.stringify(exports.VIEW_RUNTIME_GLOBAL)}][${JSON.stringify(args.path)}];`,
81
+ loader: "js",
82
+ }));
83
+ },
84
+ };
85
+ }
86
+ //# sourceMappingURL=view-runtime.js.map