@lobu/runtime-server 22.0.0 → 24.0.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 (303) hide show
  1. package/dist/catalogs/connectors.json +1448 -212
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +15 -2
  5. package/dist/connectors/google_gmail.ts +1 -0
  6. package/dist/connectors/jira-helpers.ts +313 -0
  7. package/dist/connectors/jira.ts +29 -221
  8. package/dist/connectors/linkedin-browser-script.ts +13 -0
  9. package/dist/connectors/linkedin-draft-page.js +104 -0
  10. package/dist/connectors/linkedin-drafts.ts +73 -0
  11. package/dist/connectors/linkedin-identity.ts +32 -0
  12. package/dist/connectors/linkedin-inbox-adapter.js +1182 -0
  13. package/dist/connectors/linkedin-inbox.ts +156 -0
  14. package/dist/connectors/linkedin-like.ts +114 -0
  15. package/dist/connectors/linkedin-takeout.ts +577 -0
  16. package/dist/connectors/linkedin.ts +4017 -0
  17. package/dist/connectors/reddit.ts +92 -20
  18. package/dist/connectors/slack.ts +1 -0
  19. package/dist/connectors/takeout-utils.ts +240 -0
  20. package/dist/connectors/tiktok-inbox-page.js +9 -9
  21. package/dist/connectors/tiktok-web-page.js +21 -15
  22. package/dist/connectors/tiktok_web.ts +63 -30
  23. package/dist/connectors/whatsapp-web-adapter.js +104 -574
  24. package/dist/connectors/whatsapp-web-helpers.ts +30 -444
  25. package/dist/connectors/whatsapp-web-identity.ts +20 -6
  26. package/dist/connectors/whatsapp_web.ts +46 -646
  27. package/dist/connectors/x-dm-adapter.js +556 -0
  28. package/dist/connectors/x-identity.ts +33 -2
  29. package/dist/connectors/x.ts +266 -120
  30. package/dist/db/migrations/20261017120000_drop_feeds_kind_virtual.sql +26 -0
  31. package/dist/db/migrations/20261017130000_drop_retired_dead_code_columns.sql +46 -0
  32. package/dist/db/migrations/20261019120000_retire_identities_of_deleted_entities.sql +21 -0
  33. package/dist/db/migrations/20261020120000_entities_live_metadata_domain.sql +66 -0
  34. package/dist/db/migrations/20261020130000_agents_starters.sql +14 -0
  35. package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +71 -0
  36. package/dist/dependencies.bun.lock +78 -75
  37. package/dist/guest.bundle.js +650 -448
  38. package/dist/owletto/dist/assets/_-CC8cTmRg.js +3 -0
  39. package/dist/owletto/dist/assets/_-ksFp4zVf.js +2 -0
  40. package/dist/owletto/dist/assets/_agentId-DWUFSrVp.js +2 -0
  41. package/dist/owletto/dist/assets/_agentId-MENLoohA.js +2 -0
  42. package/dist/owletto/dist/assets/_automationId-BnHqdXOC.js +2 -0
  43. package/dist/owletto/dist/assets/_connectorKey._connectionId-CefXIqy2.js +2 -0
  44. package/dist/owletto/dist/assets/_connectorKey.index-C1QPGf9E.js +2 -0
  45. package/dist/owletto/dist/assets/_conversationId-DinuPCUp.js +2 -0
  46. package/dist/owletto/dist/assets/{_deploymentId-BQfYN1U2.js → _deploymentId-BeyzVjRm.js} +2 -2
  47. package/dist/owletto/dist/assets/_eventId-3L_qeL_l.js +2 -0
  48. package/dist/owletto/dist/assets/_name-Dgedji78.js +2 -0
  49. package/dist/owletto/dist/assets/_owner-DbrKma4e.js +3 -0
  50. package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +2 -0
  51. package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +2 -0
  52. package/dist/owletto/dist/assets/_slug-ndDr_CUg.js +2 -0
  53. package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +2 -0
  54. package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +2 -0
  55. package/dist/owletto/dist/assets/{accept-invitation-D3OgJG4i.js → accept-invitation-CRKbM2Xy.js} +2 -2
  56. package/dist/owletto/dist/assets/activity-route-view-CFLNukhD.js +2 -0
  57. package/dist/owletto/dist/assets/{agent-card-controls-DzRs4Ix9.js → agent-card-controls-Be1Okb2C.js} +2 -2
  58. package/dist/owletto/dist/assets/{agent-client-setup-list-B2SvH7xD.js → agent-client-setup-list-BA8dU_C6.js} +2 -2
  59. package/dist/owletto/dist/assets/agent-connect-pages-CAV-yXus.js +2 -0
  60. package/dist/owletto/dist/assets/agent-editor-form-Bi6WvYX-.js +2 -0
  61. package/dist/owletto/dist/assets/{agent-guardrails-route-BaV1VpDh.js → agent-guardrails-route-DMOjG1D4.js} +2 -2
  62. package/dist/owletto/dist/assets/{agent-loading-shells-CtZJM2Gc.js → agent-loading-shells-De_2d8Lr.js} +2 -2
  63. package/dist/owletto/dist/assets/{agent-permissions-matrix-Ds48KFK9.js → agent-permissions-matrix-gZWl6mAe.js} +2 -2
  64. package/dist/owletto/dist/assets/{agent-skill-context-DPk5r08w.js → agent-skill-context-JLaTamGR.js} +2 -2
  65. package/dist/owletto/dist/assets/{agent-skills-route-DYpB5H1J.js → agent-skills-route-DcK41PWj.js} +2 -2
  66. package/dist/owletto/dist/assets/agent-subpage-shell-BBJoyTuC.js +2 -0
  67. package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +6 -0
  68. package/dist/owletto/dist/assets/agents-C-ReckCa.js +2 -0
  69. package/dist/owletto/dist/assets/agents-workbench-CqaKGggb.js +2 -0
  70. package/dist/owletto/dist/assets/app._appId-Cl1fTuIt.js +2 -0
  71. package/dist/owletto/dist/assets/automation-detail-content-BMLL4lxO.js +2 -0
  72. package/dist/owletto/dist/assets/automations-C-ReckCa.js +2 -0
  73. package/dist/owletto/dist/assets/callback-DTKKsfkz.js +2 -0
  74. package/dist/owletto/dist/assets/{card-DIF8SF9b.js → card-yU0TmNRH.js} +2 -2
  75. package/dist/owletto/dist/assets/{claim-DELEa-gH.js → claim-DJfTvlT2.js} +2 -2
  76. package/dist/owletto/dist/assets/client-rows--FrZfJol.js +2 -0
  77. package/dist/owletto/dist/assets/{clients-CpG676mg.js → clients-L4K1UT8c.js} +2 -2
  78. package/dist/owletto/dist/assets/{code-editor-V27Z4o3P.js → code-editor-U54Gwjit.js} +2 -2
  79. package/dist/owletto/dist/assets/connect-4zqtnDHb.js +2 -0
  80. package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +2 -0
  81. package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +2 -0
  82. package/dist/owletto/dist/assets/connected._clientId.activity-DTpSW1Xy.js +2 -0
  83. package/dist/owletto/dist/assets/connected._clientId.index-h9X5H1x8.js +2 -0
  84. package/dist/owletto/dist/assets/{connection-DySpRE9x.js → connection-ByvKkyFm.js} +2 -2
  85. package/dist/owletto/dist/assets/{connection-feed-detail-C_D68j6d.js → connection-feed-detail-DWM9lTao.js} +2 -2
  86. package/dist/owletto/dist/assets/connections-browser-CEwYrYqt.js +2 -0
  87. package/dist/owletto/dist/assets/{connector-provenance-CNXtzYg5.js → connector-provenance-BocTm__v.js} +2 -2
  88. package/dist/owletto/dist/assets/connector-scope-lists-OYDOydtz.js +2 -0
  89. package/dist/owletto/dist/assets/connectors-CyZpcE5f.js +2 -0
  90. package/dist/owletto/dist/assets/{consent-BVzxrAO9.js → consent-DdfINrVp.js} +2 -2
  91. package/dist/owletto/dist/assets/{conversations-table-DfZGICl7.js → conversations-table-BSznfdYt.js} +2 -2
  92. package/dist/owletto/dist/assets/{core.esm-DiTpULFl.js → core.esm-Dr7tcIB-.js} +2 -2
  93. package/dist/owletto/dist/assets/create-CBGwASon.js +2 -0
  94. package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +2 -0
  95. package/dist/owletto/dist/assets/create-CwThQtd3.js +2 -0
  96. package/dist/owletto/dist/assets/create-automation-form-9T5WnoUs.js +3 -0
  97. package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +2 -0
  98. package/dist/owletto/dist/assets/{cronstrue-DPXl0qA2.js → cronstrue-BWFEyy_P.js} +2 -2
  99. package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +2 -0
  100. package/dist/owletto/dist/assets/{deployments-body-D6TAWs_6.js → deployments-body-2xKS8gRo.js} +2 -2
  101. package/dist/owletto/dist/assets/{deployments-DCQdFdwG.js → deployments-wG_8QzOF.js} +2 -2
  102. package/dist/owletto/dist/assets/{device-CntqYW65.js → device-6z-xgsoW.js} +2 -2
  103. package/dist/owletto/dist/assets/device-pin-tombstone-Cwq88RMU.js +2 -0
  104. package/dist/owletto/dist/assets/device._deviceId-BDerBfD9.js +2 -0
  105. package/dist/owletto/dist/assets/entity-avatar-Cc1CuI-0.js +2 -0
  106. package/dist/owletto/dist/assets/entity-options-DHdMC1Lx.js +2 -0
  107. package/dist/owletto/dist/assets/entity-page--OkXmlNP.js +2 -0
  108. package/dist/owletto/dist/assets/entity-type-page-89RoK_-P.js +2 -0
  109. package/dist/owletto/dist/assets/event-detail-D4YZRtrA.js +2 -0
  110. package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +2 -0
  111. package/dist/owletto/dist/assets/filter-editors-B1_QUpg_.js +2 -0
  112. package/dist/owletto/dist/assets/{full-page-spinner-KpV2FS2u.js → full-page-spinner-Cqih-8IW.js} +2 -2
  113. package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +2 -0
  114. package/dist/owletto/dist/assets/identity-B0nH4yiC.js +2 -0
  115. package/dist/owletto/dist/assets/index-4TSkcsth.js +2 -0
  116. package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
  117. package/dist/owletto/dist/assets/index-BgkhXElB.js +2 -0
  118. package/dist/owletto/dist/assets/index-CoW4Bz3w.js +2 -0
  119. package/dist/owletto/dist/assets/index-Codw-Qqi.js +2 -0
  120. package/dist/owletto/dist/assets/{index-BNh2cidi.js → index-DAOyXG1X.js} +2 -2
  121. package/dist/owletto/dist/assets/{index-BEvyBdOU.js → index-DKPwCasf.js} +2 -2
  122. package/dist/owletto/dist/assets/index-DMyXd3bJ.js +2 -0
  123. package/dist/owletto/dist/assets/index-DYCqXaMf.js +7950 -0
  124. package/dist/owletto/dist/assets/index-DYYZLcJ0.js +2 -0
  125. package/dist/owletto/dist/assets/index-DYzWV5_z.js +2 -0
  126. package/dist/owletto/dist/assets/index-Da6CrGEu.js +2 -0
  127. package/dist/owletto/dist/assets/{index-DCdkwg9H.js → index-DfyDUpuI.js} +2 -2
  128. package/dist/owletto/dist/assets/index-DneshLbf.js +2 -0
  129. package/dist/owletto/dist/assets/index-TgRS2v_F.js +2 -0
  130. package/dist/owletto/dist/assets/{index-BJXkc60S.js → index-ZNlrDc_f.js} +2 -2
  131. package/dist/owletto/dist/assets/{json-diff-D_Ym3Uku.js → json-diff-DFvYINBT.js} +3 -3
  132. package/dist/owletto/dist/assets/{list-skeleton-Bl0OS39L.js → list-skeleton-DFsEqLU1.js} +2 -2
  133. package/dist/owletto/dist/assets/login-DO0j-AYr.js +2 -0
  134. package/dist/owletto/dist/assets/{logout-DUccApuZ.js → logout-BmNwoAf7.js} +2 -2
  135. package/dist/owletto/dist/assets/member-scope-gate-B2LrMWBU.js +2 -0
  136. package/dist/owletto/dist/assets/memory-browse-page-Cjpl8EbB.js +103 -0
  137. package/dist/owletto/dist/assets/{model-selector-CB1BDvlW.js → model-selector-TQcA93xm.js} +2 -2
  138. package/dist/owletto/dist/assets/models-D7aED5Sa.js +2 -0
  139. package/dist/owletto/dist/assets/new-BMrFy5Qa.js +2 -0
  140. package/dist/owletto/dist/assets/{new-B5UsLiy6.js → new-ByBhteWA.js} +2 -2
  141. package/dist/owletto/dist/assets/new-DWp3deoW.js +2 -0
  142. package/dist/owletto/dist/assets/{oauth-workspace-access-PGyTnW2K.js → oauth-workspace-access-D_5uESuz.js} +2 -2
  143. package/dist/owletto/dist/assets/{organization-BH8PYlVu.js → organization-DTFoYP4V.js} +2 -2
  144. package/dist/owletto/dist/assets/peek-pane-content-DF5iGC3c.js +2 -0
  145. package/dist/owletto/dist/assets/{permissions-CwN_YP3u.js → permissions-C_auqxfP.js} +2 -2
  146. package/dist/owletto/dist/assets/proposal-review-shell-DsNiavG_.js +2 -0
  147. package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +2 -0
  148. package/dist/owletto/dist/assets/{recent-DqdZE_TI.js → recent-3d99S2IE.js} +2 -2
  149. package/dist/owletto/dist/assets/record-activity-C9KfBkXb.js +2 -0
  150. package/dist/owletto/dist/assets/record-field-peek-BBZcRuGT.js +2 -0
  151. package/dist/owletto/dist/assets/record-session-BizRugWs.js +2 -0
  152. package/dist/owletto/dist/assets/{reset-password-DAvBYkiI.js → reset-password-DqfcSn8M.js} +2 -2
  153. package/dist/owletto/dist/assets/runs-panel-T1ZxTVz6.js +2 -0
  154. package/dist/owletto/dist/assets/runs-table-D_8QlCCN.js +2 -0
  155. package/dist/owletto/dist/assets/schema-value-normalization-CylKX3PK.js +97 -0
  156. package/dist/owletto/dist/assets/settings-B_ClYztB.js +2 -0
  157. package/dist/owletto/dist/assets/settings-DgX1-xo7.js +2 -0
  158. package/dist/owletto/dist/assets/skills-Drw5tcZw.js +2 -0
  159. package/dist/owletto/dist/assets/{source-record-panels-CRIPMWfN.js → source-record-panels-Cg249m1S.js} +2 -2
  160. package/dist/owletto/dist/assets/{use-mention-search-DqEykWl_.js → use-mention-search-BYbFvHbJ.js} +2 -2
  161. package/dist/owletto/dist/assets/view-param-filters-DMSqkN2J.js +2 -0
  162. package/dist/owletto/dist/index.html +2 -2
  163. package/dist/server-main.bundle.mjs +14031 -12680
  164. package/npm-shrinkwrap.json +329 -313
  165. package/package.json +6 -5
  166. package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
  167. package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
  168. package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
  169. package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
  170. package/vendor/connector-sdk/dist/connector-types.d.ts +10 -0
  171. package/vendor/connector-sdk/dist/index.d.ts +3 -0
  172. package/vendor/connector-sdk/dist/index.js +2 -0
  173. package/vendor/connector-sdk/package.json +9 -1
  174. package/vendor/core/dist/agent-policy.js +0 -3
  175. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  176. package/vendor/core/dist/agent-tooling.js +3 -1
  177. package/vendor/core/dist/capabilities.d.ts +1 -1
  178. package/vendor/core/dist/capabilities.js +0 -1
  179. package/vendor/core/dist/connector-query-errors.d.ts +32 -0
  180. package/vendor/core/dist/connector-query-errors.js +41 -1
  181. package/vendor/core/dist/contracts/agent-settings.d.ts +6 -2
  182. package/vendor/core/dist/contracts/agent-settings.js +12 -1
  183. package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
  184. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
  185. package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
  186. package/vendor/core/dist/contracts/tools/manage-views.d.ts +53 -234
  187. package/vendor/core/dist/contracts/tools/manage-views.js +50 -76
  188. package/vendor/core/dist/contracts/tools/view-attach.d.ts +5 -8
  189. package/vendor/core/dist/contracts/tools/view-attach.js +14 -31
  190. package/vendor/core/dist/contracts/tools/view-definition.d.ts +21 -0
  191. package/vendor/core/dist/contracts/tools/view-definition.js +165 -0
  192. package/vendor/core/dist/contracts/worker/protocol.d.ts +47 -133
  193. package/vendor/core/dist/contracts/worker/protocol.js +33 -62
  194. package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
  195. package/vendor/core/dist/device-pin-tombstones.js +57 -0
  196. package/vendor/core/dist/index.d.ts +3 -2
  197. package/vendor/core/dist/index.js +3 -1
  198. package/vendor/core/dist/logger.js +10 -25
  199. package/vendor/core/dist/suggestions.d.ts +15 -2
  200. package/vendor/core/dist/suggestions.js +48 -3
  201. package/vendor/core/dist/types.d.ts +26 -0
  202. package/vendor/core/dist/types.js +5 -0
  203. package/vendor/core/dist/utils/diagnostic-scrubber.js +258 -21
  204. package/vendor/core/dist/worker/wire.d.ts +0 -10
  205. package/vendor/core/package.json +16 -10
  206. package/vendor/postgres/cf/src/connection.js +18 -0
  207. package/vendor/postgres/cjs/src/connection.js +18 -0
  208. package/vendor/postgres/src/connection.js +18 -0
  209. package/vendor/views/dist/api.d.ts +71 -17
  210. package/vendor/views/dist/api.js +200 -35
  211. package/vendor/views/dist/bridge.d.ts +3 -0
  212. package/vendor/views/dist/bridge.js +9 -1
  213. package/vendor/views/dist/components.d.ts +170 -0
  214. package/vendor/views/dist/components.js +361 -0
  215. package/vendor/views/dist/index.d.ts +1 -1
  216. package/vendor/views/package.json +11 -1
  217. package/dist/owletto/dist/assets/_-CEPl6gU4.js +0 -3
  218. package/dist/owletto/dist/assets/_-C_zNZben.js +0 -2
  219. package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +0 -2
  220. package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +0 -2
  221. package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +0 -2
  222. package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +0 -2
  223. package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +0 -2
  224. package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +0 -2
  225. package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +0 -2
  226. package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +0 -2
  227. package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +0 -3
  228. package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +0 -2
  229. package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +0 -2
  230. package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +0 -2
  231. package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +0 -2
  232. package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +0 -2
  233. package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +0 -2
  234. package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +0 -2
  235. package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +0 -2
  236. package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +0 -2
  237. package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +0 -6
  238. package/dist/owletto/dist/assets/agents-F4mGI2oF.js +0 -2
  239. package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +0 -2
  240. package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +0 -2
  241. package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +0 -2
  242. package/dist/owletto/dist/assets/automations-F4mGI2oF.js +0 -2
  243. package/dist/owletto/dist/assets/callback-CU-hb8JB.js +0 -2
  244. package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
  245. package/dist/owletto/dist/assets/connect-B2YL6qIK.js +0 -2
  246. package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +0 -2
  247. package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +0 -2
  248. package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +0 -2
  249. package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +0 -2
  250. package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +0 -2
  251. package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +0 -2
  252. package/dist/owletto/dist/assets/connectors-BJnk1z_2.js +0 -2
  253. package/dist/owletto/dist/assets/create-CUqO6Kfk.js +0 -2
  254. package/dist/owletto/dist/assets/create-JRFM8mMf.js +0 -2
  255. package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +0 -3
  256. package/dist/owletto/dist/assets/create-iHcxV0xd.js +0 -2
  257. package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +0 -2
  258. package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +0 -2
  259. package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +0 -2
  260. package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +0 -2
  261. package/dist/owletto/dist/assets/entity-options-UJs64GdQ.js +0 -2
  262. package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +0 -2
  263. package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +0 -2
  264. package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +0 -2
  265. package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +0 -2
  266. package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +0 -2
  267. package/dist/owletto/dist/assets/guardrails-molekzAF.js +0 -2
  268. package/dist/owletto/dist/assets/identity-BJcaG66g.js +0 -2
  269. package/dist/owletto/dist/assets/index-B04ON9Jv.js +0 -2
  270. package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
  271. package/dist/owletto/dist/assets/index-BOsK-K-2.js +0 -2
  272. package/dist/owletto/dist/assets/index-BOzuAbvi.js +0 -2
  273. package/dist/owletto/dist/assets/index-Bk1x7A67.js +0 -2
  274. package/dist/owletto/dist/assets/index-CFnx5huL.js +0 -2
  275. package/dist/owletto/dist/assets/index-D3s8rhG9.js +0 -2
  276. package/dist/owletto/dist/assets/index-Dbd1jusf.js +0 -2
  277. package/dist/owletto/dist/assets/index-DqZuqC08.js +0 -2
  278. package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +0 -2
  279. package/dist/owletto/dist/assets/index-KPOvMVa-.js +0 -2
  280. package/dist/owletto/dist/assets/index-_oPeVpL_.js +0 -7950
  281. package/dist/owletto/dist/assets/login-QHdxqX-4.js +0 -2
  282. package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +0 -2
  283. package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +0 -103
  284. package/dist/owletto/dist/assets/models-DnMb3n-Z.js +0 -2
  285. package/dist/owletto/dist/assets/new-BWo8_Pms.js +0 -2
  286. package/dist/owletto/dist/assets/new-DpmDXmFI.js +0 -2
  287. package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +0 -2
  288. package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +0 -2
  289. package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +0 -2
  290. package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +0 -2
  291. package/dist/owletto/dist/assets/renderer-BL6VcwQH.js +0 -97
  292. package/dist/owletto/dist/assets/runs-BWtc5rmc.js +0 -2
  293. package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +0 -2
  294. package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +0 -2
  295. package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +0 -2
  296. package/dist/owletto/dist/assets/settings-Crxlwps-.js +0 -2
  297. package/dist/owletto/dist/assets/skills-D0X430X8.js +0 -2
  298. package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +0 -2
  299. package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +0 -2
  300. package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +0 -2
  301. package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
  302. package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
  303. /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