@lobu/runtime-server 21.2.1 → 22.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 (388) hide show
  1. package/dist/catalogs/automations.json +40 -13
  2. package/dist/catalogs/connectors.json +16601 -597
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +7 -5
  5. package/dist/connectors/_google/actions.ts +270 -0
  6. package/dist/connectors/_google/discovery/calendar_v3.json +1 -0
  7. package/dist/connectors/_google/discovery/chat_v1.json +1 -0
  8. package/dist/connectors/_google/discovery/docs_v1.json +1 -0
  9. package/dist/connectors/_google/discovery/drive_v3.json +1 -0
  10. package/dist/connectors/_google/discovery/gmail_v1.json +1 -0
  11. package/dist/connectors/_google/discovery/people_v1.json +1 -0
  12. package/dist/connectors/_google/discovery/sheets_v4.json +1 -0
  13. package/dist/connectors/_google/discovery/tasks_v1.json +1 -0
  14. package/dist/connectors/_google/discovery/youtube_v3.json +1 -0
  15. package/dist/connectors/_google/discovery.ts +442 -0
  16. package/dist/connectors/_google/errors.ts +91 -0
  17. package/dist/connectors/_google/list-feed.ts +223 -0
  18. package/dist/connectors/_google/policies.ts +127 -0
  19. package/dist/connectors/agentid.ts +43 -0
  20. package/dist/connectors/chat-user-identity.ts +2 -1
  21. package/dist/connectors/github-automation-events.ts +9 -0
  22. package/dist/connectors/github-identity.ts +28 -3
  23. package/dist/connectors/github.ts +101 -59
  24. package/dist/connectors/google_calendar.ts +207 -719
  25. package/dist/connectors/google_drive.ts +16 -2
  26. package/dist/connectors/google_gmail.ts +51 -33
  27. package/dist/connectors/herdr.ts +406 -0
  28. package/dist/connectors/jira.ts +6 -6
  29. package/dist/connectors/linear.ts +7 -4
  30. package/dist/connectors/postgres.ts +27 -2
  31. package/dist/connectors/tiktok-inbox-page.js +230 -0
  32. package/dist/connectors/tiktok-web-page.js +211 -0
  33. package/dist/connectors/tiktok_web.ts +286 -0
  34. package/dist/connectors/whatsapp-web-adapter.js +228 -10
  35. package/dist/connectors/whatsapp-web-helpers.ts +47 -14
  36. package/dist/connectors/whatsapp-web-identity.ts +121 -0
  37. package/dist/connectors/whatsapp_web.ts +170 -29
  38. package/dist/connectors/x.ts +276 -136
  39. package/dist/db/migrations/20261005150000_retire_agent_tool_config.sql +31 -0
  40. package/dist/db/migrations/20261005173700_drop_retired_agent_tool_config.sql +29 -0
  41. package/dist/db/migrations/20261007010000_identity_association_guards.sql +242 -0
  42. package/dist/db/migrations/20261007010001_identity_association_indexes.sql +35 -0
  43. package/dist/db/migrations/20261007012000_connector_browser_requirement.sql +7 -0
  44. package/dist/db/migrations/20261009010000_identity_member_decision_indexes.sql +22 -0
  45. package/dist/db/migrations/20261009015900_retire_remaining_physical_merges.sql +196 -0
  46. package/dist/db/migrations/20261009020000_retire_physical_entity_merge.sql +82 -0
  47. package/dist/db/migrations/20261009030000_retire_physical_merge_indexes.sql +39 -0
  48. package/dist/db/migrations/20261009030001_drop_physical_entity_redirect.sql +62 -0
  49. package/dist/db/migrations/20261009040000_normalize_identity_decisions.sql +60 -0
  50. package/dist/db/migrations/20261010220000_notification_targets_user_event_order.sql +53 -0
  51. package/dist/db/migrations/20261010223000_device_workers_user_fresh_cover.sql +39 -0
  52. package/dist/db/migrations/20261010223001_runs_org_default_view.sql +41 -0
  53. package/dist/db/migrations/20261010223002_events_org_guidance.sql +42 -0
  54. package/dist/db/migrations/20261011002000_finish_product_eval_retirement.sql +37 -0
  55. package/dist/db/migrations/20261011160000_mcp_conversation_workspaces.sql +97 -0
  56. package/dist/db/migrations/20261013120000_events_live_org_effective_date.sql +42 -0
  57. package/dist/db/migrations/20261013150000_events_live_linked_org_ids_gin.sql +41 -0
  58. package/dist/db/migrations/20261014120000_clear_team_device_auto_pause.sql +34 -0
  59. package/dist/db/migrations/20261014150000_connector_webhook_event_type_backfill.sql +30 -0
  60. package/dist/db/migrations/20261014170000_retire_atlassian_mcp_webhook_refresh.sql +51 -0
  61. package/dist/db/migrations/20261015010000_connection_auth_profile_fk_set_null_column.sql +53 -0
  62. package/dist/db/migrations/20261015120000_personal_org_connector_auto_policy.sql +38 -0
  63. package/dist/db/migrations/preconditions/20261005150000_retire_agent_tool_config.sql +22 -0
  64. package/dist/db/migrations/preconditions/20261005173700_drop_retired_agent_tool_config.sql +13 -0
  65. package/dist/db/migrations/preconditions/20261009020000_retire_physical_entity_merge.sql +26 -0
  66. package/dist/db/migrations/preconditions/20261011002000_finish_product_eval_retirement.sql +14 -0
  67. package/dist/dependencies.bun.lock +135 -128
  68. package/dist/guest.bundle.js +131 -185
  69. package/dist/owletto/dist/assets/_-CEPl6gU4.js +3 -0
  70. package/dist/owletto/dist/assets/_-C_zNZben.js +2 -0
  71. package/dist/owletto/dist/assets/_-DtqBFgK5.js +1 -0
  72. package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +2 -0
  73. package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +2 -0
  74. package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +2 -0
  75. package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +2 -0
  76. package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +2 -0
  77. package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +2 -0
  78. package/dist/owletto/dist/assets/_deploymentId-BQfYN1U2.js +2 -0
  79. package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +2 -0
  80. package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +2 -0
  81. package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +3 -0
  82. package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +2 -0
  83. package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +2 -0
  84. package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +2 -0
  85. package/dist/owletto/dist/assets/_threadId-DtqBFgK5.js +1 -0
  86. package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +2 -0
  87. package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +2 -0
  88. package/dist/owletto/dist/assets/accept-invitation-D3OgJG4i.js +2 -0
  89. package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +2 -0
  90. package/dist/owletto/dist/assets/agent-card-controls-DzRs4Ix9.js +2 -0
  91. package/dist/owletto/dist/assets/{agent-client-setup-list-BFtgRwe8.js → agent-client-setup-list-B2SvH7xD.js} +4 -3
  92. package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +2 -0
  93. package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +2 -0
  94. package/dist/owletto/dist/assets/agent-guardrails-route-BaV1VpDh.js +2 -0
  95. package/dist/owletto/dist/assets/agent-loading-shells-CtZJM2Gc.js +2 -0
  96. package/dist/owletto/dist/assets/agent-permissions-matrix-Ds48KFK9.js +2 -0
  97. package/dist/owletto/dist/assets/{agent-skill-context-BAr2Dw3F.js → agent-skill-context-DPk5r08w.js} +2 -1
  98. package/dist/owletto/dist/assets/agent-skills-route-DYpB5H1J.js +2 -0
  99. package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +2 -0
  100. package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +6 -0
  101. package/dist/owletto/dist/assets/agents-F4mGI2oF.js +2 -0
  102. package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +2 -0
  103. package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +128 -0
  104. package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +2 -0
  105. package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +2 -0
  106. package/dist/owletto/dist/assets/automations-F4mGI2oF.js +2 -0
  107. package/dist/owletto/dist/assets/{callback-CaRe2TOT.js → callback-CU-hb8JB.js} +2 -1
  108. package/dist/owletto/dist/assets/{card-CMmh2mzo.js → card-DIF8SF9b.js} +2 -1
  109. package/dist/owletto/dist/assets/claim-DELEa-gH.js +2 -0
  110. package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +1 -0
  111. package/dist/owletto/dist/assets/clients-CpG676mg.js +2 -0
  112. package/dist/owletto/dist/assets/code-editor-V27Z4o3P.js +16 -0
  113. package/dist/owletto/dist/assets/connect-B2YL6qIK.js +2 -0
  114. package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +2 -0
  115. package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +2 -0
  116. package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +2 -0
  117. package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +2 -0
  118. package/dist/owletto/dist/assets/connection-DySpRE9x.js +2 -0
  119. package/dist/owletto/dist/assets/connection-feed-detail-C_D68j6d.js +2 -0
  120. package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +1 -0
  121. package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +2 -0
  122. package/dist/owletto/dist/assets/{connector-provenance-BjKiUhYE.js → connector-provenance-CNXtzYg5.js} +2 -1
  123. package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +2 -0
  124. package/dist/owletto/dist/assets/{connectors-Baejya0T.js → connectors-BJnk1z_2.js} +2 -1
  125. package/dist/owletto/dist/assets/consent-BVzxrAO9.js +2 -0
  126. package/dist/owletto/dist/assets/conversations-table-DfZGICl7.js +2 -0
  127. package/dist/owletto/dist/assets/{core.esm-QA7BQgiK.js → core.esm-DiTpULFl.js} +2 -1
  128. package/dist/owletto/dist/assets/create-CUqO6Kfk.js +2 -0
  129. package/dist/owletto/dist/assets/create-JRFM8mMf.js +2 -0
  130. package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +3 -0
  131. package/dist/owletto/dist/assets/create-iHcxV0xd.js +2 -0
  132. package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +2 -0
  133. package/dist/owletto/dist/assets/{cronstrue-2GHCtD7h.js → cronstrue-DPXl0qA2.js} +2 -1
  134. package/dist/owletto/dist/assets/deployments-DCQdFdwG.js +2 -0
  135. package/dist/owletto/dist/assets/{deployments-body-Bm2upStd.js → deployments-body-D6TAWs_6.js} +2 -1
  136. package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +2 -0
  137. package/dist/owletto/dist/assets/device-CntqYW65.js +2 -0
  138. package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +2 -0
  139. package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +2 -0
  140. package/dist/owletto/dist/assets/{entity-options-CrbS6K-i.js → entity-options-UJs64GdQ.js} +2 -1
  141. package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +2 -0
  142. package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +2 -0
  143. package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +2 -0
  144. package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +2 -0
  145. package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +2 -0
  146. package/dist/owletto/dist/assets/full-page-spinner-KpV2FS2u.js +2 -0
  147. package/dist/owletto/dist/assets/guardrails-molekzAF.js +2 -0
  148. package/dist/owletto/dist/assets/identity-BJcaG66g.js +2 -0
  149. package/dist/owletto/dist/assets/index-B04ON9Jv.js +2 -0
  150. package/dist/owletto/dist/assets/index-BEvyBdOU.js +2 -0
  151. package/dist/owletto/dist/assets/{index-Cf0GJoiG.js → index-BJXkc60S.js} +2 -1
  152. package/dist/owletto/dist/assets/index-BLEcy9-T.css +1 -0
  153. package/dist/owletto/dist/assets/index-BNh2cidi.js +2 -0
  154. package/dist/owletto/dist/assets/index-BOsK-K-2.js +2 -0
  155. package/dist/owletto/dist/assets/{index-DlepU3cY.js → index-BOzuAbvi.js} +2 -1
  156. package/dist/owletto/dist/assets/index-Bk1x7A67.js +2 -0
  157. package/dist/owletto/dist/assets/index-CDz3-ieP.js +1 -0
  158. package/dist/owletto/dist/assets/index-CFnx5huL.js +2 -0
  159. package/dist/owletto/dist/assets/index-D3s8rhG9.js +2 -0
  160. package/dist/owletto/dist/assets/index-DCdkwg9H.js +2 -0
  161. package/dist/owletto/dist/assets/index-Dbd1jusf.js +2 -0
  162. package/dist/owletto/dist/assets/index-DqZuqC08.js +2 -0
  163. package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +2 -0
  164. package/dist/owletto/dist/assets/index-DtqBFgK5.js +1 -0
  165. package/dist/owletto/dist/assets/index-KPOvMVa-.js +2 -0
  166. package/dist/owletto/dist/assets/index-Vcq4gwWv.js +1 -0
  167. package/dist/owletto/dist/assets/index-_oPeVpL_.js +7950 -0
  168. package/dist/owletto/dist/assets/index-rrnUF981.js +1 -0
  169. package/dist/owletto/dist/assets/json-diff-D_Ym3Uku.js +4 -0
  170. package/dist/owletto/dist/assets/{list-skeleton-BtWn2eo2.js → list-skeleton-Bl0OS39L.js} +2 -1
  171. package/dist/owletto/dist/assets/login-QHdxqX-4.js +2 -0
  172. package/dist/owletto/dist/assets/logout-DUccApuZ.js +2 -0
  173. package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +2 -0
  174. package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +103 -0
  175. package/dist/owletto/dist/assets/model-selector-CB1BDvlW.js +2 -0
  176. package/dist/owletto/dist/assets/models-DnMb3n-Z.js +2 -0
  177. package/dist/owletto/dist/assets/new-B5UsLiy6.js +2 -0
  178. package/dist/owletto/dist/assets/new-BWo8_Pms.js +2 -0
  179. package/dist/owletto/dist/assets/new-DpmDXmFI.js +2 -0
  180. package/dist/owletto/dist/assets/oauth-workspace-access-PGyTnW2K.js +2 -0
  181. package/dist/owletto/dist/assets/organization-BH8PYlVu.js +2 -0
  182. package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +2 -0
  183. package/dist/owletto/dist/assets/{permissions-h_qSft1A.js → permissions-CwN_YP3u.js} +2 -1
  184. package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +2 -0
  185. package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +2 -0
  186. package/dist/owletto/dist/assets/{recent-JiBNvZzD.js → recent-DqdZE_TI.js} +2 -1
  187. package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +2 -0
  188. package/dist/owletto/dist/assets/{renderer-DgPLyEbx.js → renderer-BL6VcwQH.js} +28 -27
  189. package/dist/owletto/dist/assets/reset-password-DAvBYkiI.js +2 -0
  190. package/dist/owletto/dist/assets/runs-BWtc5rmc.js +2 -0
  191. package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +2 -0
  192. package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +2 -0
  193. package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +2 -0
  194. package/dist/owletto/dist/assets/settings-Crxlwps-.js +2 -0
  195. package/dist/owletto/dist/assets/skill-editor-D_W3QlRz.js +1 -0
  196. package/dist/owletto/dist/assets/skills-D0X430X8.js +2 -0
  197. package/dist/owletto/dist/assets/source-record-panels-CRIPMWfN.js +2 -0
  198. package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +2 -0
  199. package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +2 -0
  200. package/dist/owletto/dist/assets/{use-mention-search-B4DfZFm5.js → use-mention-search-DqEykWl_.js} +3 -2
  201. package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +2 -0
  202. package/dist/owletto/dist/assets/workspace-label-o_QfBuCM.js +2 -0
  203. package/dist/owletto/dist/index.html +46 -4
  204. package/dist/providers.json +1 -1
  205. package/dist/server-main.bundle.mjs +135551 -132880
  206. package/npm-shrinkwrap.json +578 -611
  207. package/package.json +4 -3
  208. package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
  209. package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
  210. package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
  211. package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
  212. package/vendor/connector-sdk/dist/connector-types.d.ts +159 -45
  213. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
  214. package/vendor/connector-sdk/dist/define-connector.js +3 -0
  215. package/vendor/connector-sdk/dist/index.d.ts +5 -2
  216. package/vendor/connector-sdk/dist/index.js +1 -0
  217. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
  218. package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
  219. package/vendor/connector-sdk/package.json +5 -1
  220. package/vendor/core/dist/agent-policy.js +1 -1
  221. package/vendor/core/dist/agent-store.d.ts +2 -0
  222. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  223. package/vendor/core/dist/agent-tooling.js +1 -1
  224. package/vendor/core/dist/capabilities.js +2 -0
  225. package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
  226. package/vendor/core/dist/contracts/agent-settings.js +1 -7
  227. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
  228. package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
  229. package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
  230. package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
  231. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
  232. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
  233. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
  234. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
  235. package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
  236. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
  237. package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
  238. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
  239. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
  240. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
  241. package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
  242. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
  243. package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
  244. package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
  245. package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
  246. package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
  247. package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
  248. package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
  249. package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
  250. package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
  251. package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
  252. package/vendor/core/dist/contracts/worker/protocol.d.ts +122 -28
  253. package/vendor/core/dist/contracts/worker/protocol.js +81 -17
  254. package/vendor/core/dist/index.d.ts +3 -4
  255. package/vendor/core/dist/index.js +3 -6
  256. package/vendor/core/dist/json-template.d.ts +6 -10
  257. package/vendor/core/dist/json-template.js +5 -9
  258. package/vendor/core/dist/logger.js +11 -5
  259. package/vendor/core/dist/shell-safety.d.ts +9 -0
  260. package/vendor/core/dist/shell-safety.js +154 -0
  261. package/vendor/core/dist/suggestions.d.ts +1 -1
  262. package/vendor/core/dist/suggestions.js +1 -1
  263. package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
  264. package/vendor/core/dist/tool-trace-summary.js +1 -1
  265. package/vendor/core/dist/types.d.ts +1 -3
  266. package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
  267. package/vendor/core/dist/utils/{sentry-scrubber.js → diagnostic-scrubber.js} +25 -53
  268. package/vendor/core/dist/worker/auth.d.ts +44 -6
  269. package/vendor/core/dist/worker/auth.js +44 -11
  270. package/vendor/core/package.json +15 -6
  271. package/vendor/views/dist/api.d.ts +39 -29
  272. package/vendor/views/dist/api.js +110 -83
  273. package/vendor/views/dist/bridge.d.ts +4 -0
  274. package/vendor/views/dist/bridge.js +15 -0
  275. package/vendor/views/dist/index.d.ts +1 -0
  276. package/vendor/views/dist/index.js +0 -7
  277. package/vendor/views/package.json +4 -1
  278. package/dist/owletto/dist/assets/_-CLhipgJI.js +0 -1
  279. package/dist/owletto/dist/assets/_-D0ZVGAIA.js +0 -2
  280. package/dist/owletto/dist/assets/_agentId-BLXUf3ot.js +0 -1
  281. package/dist/owletto/dist/assets/_agentId-DnI66MF3.js +0 -1
  282. package/dist/owletto/dist/assets/_automationId-ziwseLb7.js +0 -1
  283. package/dist/owletto/dist/assets/_connectorKey._connectionId-B6V3ySFK.js +0 -1
  284. package/dist/owletto/dist/assets/_connectorKey.index-CR5u_dtt.js +0 -1
  285. package/dist/owletto/dist/assets/_conversationId-FBMYmOl8.js +0 -1
  286. package/dist/owletto/dist/assets/_deploymentId-DNTXbT_m.js +0 -1
  287. package/dist/owletto/dist/assets/_name-B37LKIxH.js +0 -1
  288. package/dist/owletto/dist/assets/_owner-BxYumqC2.js +0 -1
  289. package/dist/owletto/dist/assets/_shape-Bxz-04jR.js +0 -1
  290. package/dist/owletto/dist/assets/_skillKey-D5MFbiw2.js +0 -1
  291. package/dist/owletto/dist/assets/_slug-Dlhit09k.js +0 -1
  292. package/dist/owletto/dist/assets/_viewKey-C6535i-t.js +0 -1
  293. package/dist/owletto/dist/assets/_viewKey-CQCtY3Y8.js +0 -1
  294. package/dist/owletto/dist/assets/_viewKey-CxKfKbRa.js +0 -1
  295. package/dist/owletto/dist/assets/accept-invitation-BQQwec3R.js +0 -1
  296. package/dist/owletto/dist/assets/activity-route-view-BwThvdGs.js +0 -1
  297. package/dist/owletto/dist/assets/agent-card-controls-B3RhzsPz.js +0 -1
  298. package/dist/owletto/dist/assets/agent-connect-pages-BO4wQn4L.js +0 -1
  299. package/dist/owletto/dist/assets/agent-editor-form-BYC4uSNz.js +0 -1
  300. package/dist/owletto/dist/assets/agent-guardrails-route-Dp02G1AQ.js +0 -1
  301. package/dist/owletto/dist/assets/agent-loading-shells-OagauQzV.js +0 -1
  302. package/dist/owletto/dist/assets/agent-permissions-matrix-B9Ho3P1t.js +0 -1
  303. package/dist/owletto/dist/assets/agent-skills-route-B4VUnVi0.js +0 -1
  304. package/dist/owletto/dist/assets/agent-subpage-shell-Dz8I-GUt.js +0 -1
  305. package/dist/owletto/dist/assets/agent-thread-B9-cdkaV.js +0 -8
  306. package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -1
  307. package/dist/owletto/dist/assets/agents-D0CIg4b9.js +0 -1
  308. package/dist/owletto/dist/assets/agents-workbench-C2sr5h82.js +0 -1
  309. package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +0 -127
  310. package/dist/owletto/dist/assets/app._appId-DLsJ_QWS.js +0 -1
  311. package/dist/owletto/dist/assets/automation-detail-content-9Rjb_I9j.js +0 -1
  312. package/dist/owletto/dist/assets/automations-D0CIg4b9.js +0 -1
  313. package/dist/owletto/dist/assets/calendar-DAiyi1ZL.js +0 -1
  314. package/dist/owletto/dist/assets/claim-CYHnUF7G.js +0 -1
  315. package/dist/owletto/dist/assets/clients-Cp1BJ28u.js +0 -1
  316. package/dist/owletto/dist/assets/code-editor-CYsR2VBP.js +0 -15
  317. package/dist/owletto/dist/assets/connect-CZip2g_B.js +0 -1
  318. package/dist/owletto/dist/assets/connect._clientId-CEKY8Dnv.js +0 -1
  319. package/dist/owletto/dist/assets/connected._clientId-C5xRjxNO.js +0 -1
  320. package/dist/owletto/dist/assets/connection-C06HZ241.js +0 -1
  321. package/dist/owletto/dist/assets/connection-feed-detail-D1whY5hL.js +0 -1
  322. package/dist/owletto/dist/assets/consent-CfYDldcF.js +0 -1
  323. package/dist/owletto/dist/assets/create-C3P-3_8O.js +0 -1
  324. package/dist/owletto/dist/assets/create-CwnrPUEw.js +0 -1
  325. package/dist/owletto/dist/assets/create-DOScS9Gl.js +0 -1
  326. package/dist/owletto/dist/assets/create-automation-form-CuxiIRCF.js +0 -2
  327. package/dist/owletto/dist/assets/create._connectorKey-Bjv3lCf8.js +0 -1
  328. package/dist/owletto/dist/assets/deployments-ByBv1DW-.js +0 -1
  329. package/dist/owletto/dist/assets/deployments-C-_ECORv.js +0 -1
  330. package/dist/owletto/dist/assets/device-B0i7Xp8y.js +0 -1
  331. package/dist/owletto/dist/assets/device-automation-BIjs7DZJ.js +0 -1
  332. package/dist/owletto/dist/assets/device-pin-tombstone-Bd6vS2zu.js +0 -1
  333. package/dist/owletto/dist/assets/device-rows-Bwf8qDte.js +0 -1
  334. package/dist/owletto/dist/assets/device._deviceId-DJLAesm3.js +0 -1
  335. package/dist/owletto/dist/assets/entity-page-ijZe_1-6.js +0 -1
  336. package/dist/owletto/dist/assets/entity-type-page-onp2Tk_E.js +0 -1
  337. package/dist/owletto/dist/assets/event-page-C0B2UDY-.js +0 -1
  338. package/dist/owletto/dist/assets/events-feed-DK35T4g7.js +0 -1
  339. package/dist/owletto/dist/assets/full-page-spinner-Dd8eEaxq.js +0 -1
  340. package/dist/owletto/dist/assets/guardrails-DKO8_J-G.js +0 -1
  341. package/dist/owletto/dist/assets/identity-CKM54vrM.js +0 -1
  342. package/dist/owletto/dist/assets/index--VmN5WxW.js +0 -1
  343. package/dist/owletto/dist/assets/index-B2AmRqYh.js +0 -7898
  344. package/dist/owletto/dist/assets/index-B_rcEgFX.js +0 -1
  345. package/dist/owletto/dist/assets/index-BmAuAhub.css +0 -1
  346. package/dist/owletto/dist/assets/index-BmhGe6-Z.js +0 -1
  347. package/dist/owletto/dist/assets/index-C1dJSGrL.js +0 -1
  348. package/dist/owletto/dist/assets/index-CAFw4qCb.js +0 -1
  349. package/dist/owletto/dist/assets/index-CCcc_xBw.js +0 -52
  350. package/dist/owletto/dist/assets/index-CLU3gXVm.js +0 -1
  351. package/dist/owletto/dist/assets/index-CqQVnAY-.js +0 -1
  352. package/dist/owletto/dist/assets/index-CxT0uyIe.js +0 -1
  353. package/dist/owletto/dist/assets/index-DR08e6Ec.js +0 -1
  354. package/dist/owletto/dist/assets/index-DYb9L5FC.js +0 -1
  355. package/dist/owletto/dist/assets/index-SUUcQGT-.js +0 -1
  356. package/dist/owletto/dist/assets/index-SdiFOfR1.js +0 -1
  357. package/dist/owletto/dist/assets/index-zcfi5r1l.js +0 -1
  358. package/dist/owletto/dist/assets/json-diff-ClBBYBQD.js +0 -3
  359. package/dist/owletto/dist/assets/login-d3PdO-qV.js +0 -1
  360. package/dist/owletto/dist/assets/logout-DgckxwLn.js +0 -1
  361. package/dist/owletto/dist/assets/member-scope-gate-DXOCfx-v.js +0 -1
  362. package/dist/owletto/dist/assets/memory-browse-page-CeAnKoTR.js +0 -101
  363. package/dist/owletto/dist/assets/missing-view-DrZ8m8yo.js +0 -1
  364. package/dist/owletto/dist/assets/model-selector-CapL1ARf.js +0 -1
  365. package/dist/owletto/dist/assets/models-CB8mhq7j.js +0 -1
  366. package/dist/owletto/dist/assets/new-BBUb-VR4.js +0 -1
  367. package/dist/owletto/dist/assets/new-CBLJ25_w.js +0 -1
  368. package/dist/owletto/dist/assets/new-tTXB4qBW.js +0 -1
  369. package/dist/owletto/dist/assets/oauth-workspace-access-DearynqZ.js +0 -1
  370. package/dist/owletto/dist/assets/organization-BgdBg-PJ.js +0 -1
  371. package/dist/owletto/dist/assets/pending-seed-CPbfgnLX.js +0 -1
  372. package/dist/owletto/dist/assets/proposal-review-shell-D4YNrrye.js +0 -1
  373. package/dist/owletto/dist/assets/reset-password-B8tWPtIj.js +0 -1
  374. package/dist/owletto/dist/assets/runs-oHveuEUB.js +0 -1
  375. package/dist/owletto/dist/assets/runs-panel-C56GDaJm.js +0 -1
  376. package/dist/owletto/dist/assets/runs-table-BUKDjiBc.js +0 -1
  377. package/dist/owletto/dist/assets/schema-value-normalization-3JuM_r1H.js +0 -1
  378. package/dist/owletto/dist/assets/settings-DaKg6U5O.js +0 -1
  379. package/dist/owletto/dist/assets/settings-DhnRi2nq.js +0 -1
  380. package/dist/owletto/dist/assets/skills-BpQncuMC.js +0 -1
  381. package/dist/owletto/dist/assets/switch-BQ40_DMb.js +0 -1
  382. package/dist/owletto/dist/assets/use-applied-views-B-Z-Weji.js +0 -1
  383. package/dist/owletto/dist/assets/view-frame-C7ciEoLo.js +0 -1
  384. package/vendor/core/dist/sentry.d.ts +0 -26
  385. package/vendor/core/dist/sentry.js +0 -133
  386. package/vendor/core/dist/tool-policy.d.ts +0 -74
  387. package/vendor/core/dist/tool-policy.js +0 -305
  388. package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_TURN_ACCESS = void 0;
3
4
  exports.looksLikeWorkerToken = looksLikeWorkerToken;
4
5
  exports.generateWorkerToken = generateWorkerToken;
5
6
  exports.generateWorkerTokenPair = generateWorkerTokenPair;
@@ -20,6 +21,17 @@ const logger = (0, logger_1.createLogger)("worker-auth");
20
21
  function looksLikeWorkerToken(token) {
21
22
  return /^[0-9a-f]+:[0-9a-f]+:[0-9a-f]+$/i.test(token);
22
23
  }
24
+ /**
25
+ * Worker authentication using encrypted conversation ID.
26
+ * Token format: encrypted(JSON payload of thread metadata).
27
+ */
28
+ /** See {@link WorkerTokenData.chatAccess}. */
29
+ exports.CHAT_TURN_ACCESS = [
30
+ "member",
31
+ "org_shared",
32
+ "public_visitor",
33
+ "reply_only",
34
+ ];
23
35
  function generateToken(userId, conversationId, deploymentName, options, tokenKind, jti = (0, node_crypto_1.randomUUID)()) {
24
36
  if (!options.channelId) {
25
37
  throw new Error("channelId is required for worker token generation");
@@ -46,7 +58,9 @@ function generateToken(userId, conversationId, deploymentName, options, tokenKin
46
58
  runId: options.runId,
47
59
  messageId: options.messageId,
48
60
  adminTools: options.adminTools,
49
- adminActorUserId: options.adminActorUserId,
61
+ actorUserId: options.actorUserId,
62
+ chatAccess: options.chatAccess,
63
+ chatSenderWorkspaces: options.chatSenderWorkspaces,
50
64
  runtimeProviderId: options.runtimeProviderId,
51
65
  sandboxId: options.sandboxId,
52
66
  allowedDomains: options.allowedDomains,
@@ -182,18 +196,37 @@ function verifyToken(token, expectedKind) {
182
196
  return null;
183
197
  }
184
198
  }
185
- // The admin-tools pair is inseparable: the allowlist limits WHAT may
186
- // run and the resolved auth subject says WHO authorized it. Accepting one
187
- // without the other either makes the allowlist unusable or tempts callers
188
- // to reinterpret the platform-scoped `userId` as an auth user again.
189
- if ((data.adminTools === undefined) !==
190
- (data.adminActorUserId === undefined)) {
191
- logger.error("Worker token rejected: adminTools and adminActorUserId must be set together");
199
+ // The allowlist limits WHAT may run; the resolved auth subject says WHO
200
+ // authorized it. An allowlist without its actor would tempt callers to
201
+ // reinterpret the platform-scoped `userId` as an auth user again. The
202
+ // reverse is valid: an ordinary chat turn acts as its sender with no
203
+ // admin allowlist at all.
204
+ if (data.adminTools !== undefined && data.actorUserId === undefined) {
205
+ logger.error("Worker token rejected: adminTools requires actorUserId");
206
+ return null;
207
+ }
208
+ if (data.actorUserId !== undefined &&
209
+ (typeof data.actorUserId !== "string" || !data.actorUserId)) {
210
+ logger.error("Worker token rejected: actorUserId must be a non-empty string");
211
+ return null;
212
+ }
213
+ // `chatAccess` decides what a chat sender may reach, so an unknown value
214
+ // is rejected rather than defaulted, and the member tier must name its
215
+ // member: the claim alone never grants a user identity.
216
+ if (data.chatAccess !== undefined &&
217
+ !exports.CHAT_TURN_ACCESS.includes(data.chatAccess)) {
218
+ logger.error("Worker token rejected: unknown chatAccess");
219
+ return null;
220
+ }
221
+ if (data.chatAccess === "member" && data.actorUserId === undefined) {
222
+ logger.error("Worker token rejected: a member chatAccess requires actorUserId");
192
223
  return null;
193
224
  }
194
- if (data.adminActorUserId !== undefined &&
195
- (typeof data.adminActorUserId !== "string" || !data.adminActorUserId)) {
196
- logger.error("Worker token rejected: adminActorUserId must be a non-empty string");
225
+ // The sender-workspace grant widens what a turn reaches, so it exists
226
+ // only as the literal `true` on a member turn that names its member.
227
+ if (data.chatSenderWorkspaces !== undefined &&
228
+ (data.chatSenderWorkspaces !== true || data.chatAccess !== "member")) {
229
+ logger.error("Worker token rejected: chatSenderWorkspaces requires a member chatAccess");
197
230
  return null;
198
231
  }
199
232
  // `runtimeProviderId` / `sandboxId` are optional but, when present, the
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "21.2.1",
3
+ "version": "22.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core types and utilities for Lobu agent platform",
6
6
  "repository": {
@@ -41,10 +41,10 @@
41
41
  "import": "./dist/tool-trace-summary.js",
42
42
  "require": "./dist/tool-trace-summary.js"
43
43
  },
44
- "./tool-policy": {
45
- "types": "./dist/tool-policy.d.ts",
46
- "import": "./dist/tool-policy.js",
47
- "require": "./dist/tool-policy.js"
44
+ "./shell-safety": {
45
+ "types": "./dist/shell-safety.d.ts",
46
+ "import": "./dist/shell-safety.js",
47
+ "require": "./dist/shell-safety.js"
48
48
  },
49
49
  "./memory-flush": {
50
50
  "types": "./dist/memory-flush.d.ts",
@@ -156,6 +156,16 @@
156
156
  "import": "./dist/contracts/tools/manage-entity-schema.js",
157
157
  "require": "./dist/contracts/tools/manage-entity-schema.js"
158
158
  },
159
+ "./contracts/tools/collection-presentation": {
160
+ "types": "./dist/contracts/tools/collection-presentation.d.ts",
161
+ "import": "./dist/contracts/tools/collection-presentation.js",
162
+ "require": "./dist/contracts/tools/collection-presentation.js"
163
+ },
164
+ "./contracts/tools/collection-selection": {
165
+ "types": "./dist/contracts/tools/collection-selection.d.ts",
166
+ "import": "./dist/contracts/tools/collection-selection.js",
167
+ "require": "./dist/contracts/tools/collection-selection.js"
168
+ },
159
169
  "./contracts/tools/manage-entity": {
160
170
  "types": "./dist/contracts/tools/manage-entity.d.ts",
161
171
  "import": "./dist/contracts/tools/manage-entity.js",
@@ -231,7 +241,6 @@
231
241
  "@opentelemetry/exporter-trace-otlp-grpc": "^0.222.0",
232
242
  "@opentelemetry/resources": "^2.11.0",
233
243
  "@opentelemetry/semantic-conventions": "^1.28.0",
234
- "@sentry/node": "^10.74.0",
235
244
  "winston": "^3.17.0"
236
245
  }
237
246
  }
@@ -49,18 +49,21 @@
49
49
  * const current = status.data?.content[0];
50
50
  * ```
51
51
  */
52
+ import type { CollectionSelection } from "@lobu/core/contracts/tools/collection-selection";
53
+ import type { ViewAttachment } from "@lobu/core/contracts/tools/manage-views";
52
54
  import { type ReactNode } from "react";
53
- import { ViewBridge, type ToolResult } from "./bridge.js";
55
+ import { type ToolResult, ViewBridge } from "./bridge.js";
54
56
  export type ParamValue = string | number | boolean;
55
57
  export type Params = Record<string, ParamValue>;
56
58
  /**
57
59
  * What the view is rendering. `type` on a type page, `entity` (plus its
58
60
  * `type`) on a record page, `event` on an event's page, nothing on the Data hub.
59
61
  *
60
- * `event` is an `events.id` and, like the event's permalink, names its whole
61
- * supersede lineage. There is no event hook: read it with the same exact-id
62
- * read the event page renders, and render the current version, the row that
63
- * nothing superseded (the result is the lineage, oldest first):
62
+ * `event` is the resolved stored version supplied by the host. New actions
63
+ * reject a superseded version; reopening resolves the permalink again.
64
+ * There is no event hook: read it with the same exact-id read the event page
65
+ * renders. Select the supplied version from the returned lineage so the
66
+ * displayed content and action subject stay aligned:
64
67
  *
65
68
  * ```tsx
66
69
  * export const view = defineView({
@@ -70,12 +73,12 @@ export type Params = Record<string, ParamValue>;
70
73
  *
71
74
  * export default function DealWon() {
72
75
  * const { event } = useScope();
73
- * const read = useQuery<{ content: Array<{ superseded_by?: number | null;
76
+ * const read = useQuery<{ content: Array<{ id: number;
74
77
  * title: string | null; metadata: Record<string, unknown> }> }>(
75
78
  * event === undefined ? null : tool("read_knowledge", { content_ids: [event] })
76
79
  * );
77
- * const current = read.data?.content.find((row) => row.superseded_by == null);
78
- * return <h1>{current?.title}</h1>;
80
+ * const subject = read.data?.content.find((row) => row.id === event);
81
+ * return <h1>{subject?.title}</h1>;
79
82
  * }
80
83
  * ```
81
84
  */
@@ -83,30 +86,36 @@ export interface Scope {
83
86
  type?: string;
84
87
  entity?: number | string;
85
88
  event?: number;
89
+ /** Shared collection selection; absent on record, event and workspace pages.
90
+ * Pass search/filters/segment to entities.list alongside entity_type: type.
91
+ * Host selection does not replace view-specific sort/layout params. */
92
+ collection?: CollectionSelection;
86
93
  }
87
94
  export interface ParamDef {
88
95
  type: "string" | "number" | "boolean";
89
96
  default?: ParamValue;
97
+ /** Offer this param in the host's filter bar: a set value shows as a chip
98
+ * above the view, and picking one updates the param. Options make it a
99
+ * pick list; without them the host asks for a value of the param's type. */
100
+ filter?: {
101
+ label: string;
102
+ options?: Array<{
103
+ value: ParamValue;
104
+ label: string;
105
+ }>;
106
+ };
90
107
  }
91
108
  /**
92
109
  * Where a view appears: exactly one subject per entry. `{ type }`,
93
- * `{ entity }` and `{ workspace: true }` take a `placement`; an event
94
- * attachment `{ event_kind, type }` matches events of that kind linked to at
95
- * least one entity of `type`, renders on the event's page, and takes none.
110
+ * `{ entity }` and `{ workspace: true }` take a `placement`. Type attachments
111
+ * may declare surface: "collection" (tab only) or "record" (tab/overview).
112
+ * Collection `when` equalities must all be present in scope.collection.filters;
113
+ * they control discoverability, never authorization. Omitted surface preserves
114
+ * legacy collection and record matching. An event
115
+ * attachment `{ event_kind, type? }` matches that kind, optionally qualified by
116
+ * a linked entity type. It renders on the event page without a placement.
96
117
  */
97
- export type Attachment = {
98
- type: string;
99
- placement?: "tab" | "overview";
100
- } | {
101
- entity: number | string;
102
- placement?: "tab" | "overview";
103
- } | {
104
- workspace: true;
105
- placement?: "tab" | "overview";
106
- } | {
107
- event_kind: string;
108
- type: string;
109
- };
118
+ export type Attachment = ViewAttachment;
110
119
  export interface ViewDefinition {
111
120
  /** View key: the single namespace of keys (no `custom:` prefix). Required —
112
121
  * it is the identity `invoke_view_action` and the shell route key on. */
@@ -189,13 +198,14 @@ export interface ActionResult {
189
198
  ok: boolean;
190
199
  error: string | null;
191
200
  result: unknown;
201
+ /** Retry the same submission after a failed acknowledgement. A new call to
202
+ * useAction's function is a new intent, even when its value is identical. */
203
+ retry: (() => Promise<ActionResult>) | null;
192
204
  }
193
- /** Mint the per-click interaction id the action tool requires (browser retry
194
- * id on web): a UUID where available, else a time + random fallback. */
205
+ /** Mint one id for a deliberate submission, retained by its retry closure. */
195
206
  export declare function mintInteractionId(): string;
196
- /** A declared action → `invoke_view_action { view, action, value }`. The name
197
- * must exist on the CURRENT view definition; a removed button throws here
198
- * instead of emitting a stale event. */
207
+ /** Submit a declared action. Failed acknowledgements expose an explicit retry
208
+ * that keeps the original value, event subject and interaction id. */
199
209
  export declare function useAction(name: string): (value?: Record<string, unknown>) => Promise<ActionResult>;
200
210
  export declare function defaultsFor(def: ViewDefinition): Params;
201
211
  export declare function coerceParams(def: ViewDefinition, raw: unknown): Params;
@@ -1,55 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * `@lobu/views` authoring surface (brief §1.4): `defineView`, `useParams`,
4
- * `useScope`, `useQuery`, `useAction`, `sql`, plus the `mountView` entry the
5
- * compiled bundle calls once. Thin layer over the hand-written `ViewBridge` —
6
- * nothing here talks to the API directly; every read and action goes through
7
- * the host as `tools/call`, every param change through
8
- * `ui/update-model-context`.
9
- *
10
- * Contract with the host (our web host, Claude, any MCP Apps host):
11
- * - `ui/notifications/tool-input` `arguments` = `{ scope, params }`
12
- * (in Claude these are the `open_view` tool arguments).
13
- * - reads: `query_sql`, `query_sdk`, and tools the registry marks
14
- * `readOnlyHint` (`read_knowledge`, `get_automation`, `query_metric`, …);
15
- * actions: `invoke_view_action`. The web host refuses every other tool, so
16
- * mixed read/write tools such as `manage_connections` are not reachable
17
- * from a view: read that data with a `query_sdk` script
18
- * (`client.connections.list()`) instead.
19
- * - `setParams` → `ui/update-model-context` `{ structuredContent: { view,
20
- * params } }`; the web host mirrors it into the address bar. Hosts without
21
- * that capability keep params local to the frame.
22
- *
23
- * Read budget: reads run on a user-facing path, when the host is ready and
24
- * the query changes or `refetch()` is called.
25
- * `query_sql` runs in a read-only, org-scoped transaction with a 5 second
26
- * statement timeout and returns at most 500 rows; `useQuery` reports a hit as
27
- * `errorCode: "UPSTREAM_TIMEOUT"` or `truncated: true`, so render those
28
- * states instead of an empty or partial table. Never aggregate history in a
29
- * view: no `GROUP BY`, `DISTINCT ON`, per-row regexp, or leading-wildcard
30
- * `LIKE` over `events` (or any other table that grows with history). History
31
- * grows; the answer a view shows does not.
32
- *
33
- * For "latest state" views, compute state at write time. One event-based
34
- * pattern is an Automation bound to the entity declaring a keyed event output
35
- * (`outputs: { status: { event: "account_status", key: ["account"] } }`), so
36
- * each emitted update supersedes the previous event with the same output
37
- * identity. The view reads current events with `read_knowledge`
38
- * (registry-marked `readOnlyHint`, so the host lets a view call it), which
39
- * skips superseded rows:
40
- *
41
- * ```tsx
42
- * const { entity } = useScope();
43
- * const status = useQuery<{ content: Array<{ title: string | null;
44
- * metadata: Record<string, unknown> }> }>(
45
- * typeof entity === "number"
46
- * ? tool("read_knowledge", { entity_id: entity,
47
- * semantic_type: "account_status", sort_by: "date", limit: 1 })
48
- * : null
49
- * );
50
- * const current = status.data?.content[0];
51
- * ```
52
- */
53
2
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
54
3
  import { createRoot } from "react-dom/client";
55
4
  import { ViewBridge } from "./bridge.js";
@@ -210,6 +159,16 @@ export function useQuery(query) {
210
159
  loading: query !== null,
211
160
  });
212
161
  const [tick, setTick] = useState(0);
162
+ // A host data change re-reads the same query in the background: the rows
163
+ // already on screen stay until the fresh ones land, so a live view never
164
+ // flashes its loading state on every write.
165
+ const lastRead = useRef(null);
166
+ // Reads are numbered so a newer read never discards an older one still in
167
+ // flight for the same key: under a steady stream of writes every re-read
168
+ // would be superseded before it answered. Only a key change, or a newer
169
+ // answer already on screen, drops a result.
170
+ const readSeq = useRef(0);
171
+ const shownSeq = useRef(0);
213
172
  const key = query === null
214
173
  ? null
215
174
  : typeof query === "string"
@@ -217,18 +176,29 @@ export function useQuery(query) {
217
176
  : query.kind === "tool"
218
177
  ? `tool:${query.name}:${JSON.stringify(query.args)}`
219
178
  : `sql:${query.text}`;
220
- // biome-ignore lint/correctness/useExhaustiveDependencies: key is the stable identity of query (listing query itself refetches every render); rt.callTool is stable and tick is the intentional refetch trigger.
179
+ // biome-ignore lint/correctness/useExhaustiveDependencies: key is the stable identity of query (listing query itself refetches every render); rt.callTool is stable; tick and rt.dataVersion are the intentional refetch triggers.
221
180
  useEffect(() => {
222
181
  // A skipped query is idle, even when the previous request is in flight.
223
182
  if (key === null) {
183
+ lastRead.current = null;
224
184
  setState((s) => (s.loading ? { ...s, loading: false } : s));
225
185
  return;
226
186
  }
227
187
  // Queries still wait for the host to seed scope and params.
228
188
  if (!rt.ready)
229
189
  return;
230
- let cancelled = false;
231
- setState((s) => ({ ...s, loading: true }));
190
+ const seq = ++readSeq.current;
191
+ const show = (next) => {
192
+ if (lastRead.current?.key !== key || seq < shownSeq.current)
193
+ return;
194
+ shownSeq.current = seq;
195
+ setState(next);
196
+ };
197
+ const background = lastRead.current?.key === key &&
198
+ lastRead.current.dataVersion !== rt.dataVersion;
199
+ lastRead.current = { key, dataVersion: rt.dataVersion };
200
+ if (!background)
201
+ setState((s) => ({ ...s, loading: true }));
232
202
  const q = query;
233
203
  const call = typeof q === "string"
234
204
  ? rt.callTool("query_sdk", { script: q })
@@ -237,15 +207,11 @@ export function useQuery(query) {
237
207
  : rt.callTool("query_sql", { sql: q.text, limit: 500 });
238
208
  call
239
209
  .then((result) => {
240
- if (cancelled)
241
- return;
242
210
  const out = queryResult(typeof q === "string" ? "sdk" : q.kind === "tool" ? "tool" : "sql", result);
243
- setState({ ...out, loading: false });
211
+ show({ ...out, loading: false });
244
212
  })
245
213
  .catch((e) => {
246
- if (cancelled)
247
- return;
248
- setState({
214
+ show({
249
215
  data: null,
250
216
  error: e instanceof Error ? e.message : String(e),
251
217
  errorCode: null,
@@ -253,53 +219,76 @@ export function useQuery(query) {
253
219
  loading: false,
254
220
  });
255
221
  });
256
- return () => {
257
- cancelled = true;
258
- };
259
- }, [key, rt.ready, tick]);
222
+ }, [key, rt.ready, tick, rt.dataVersion]);
260
223
  const refetch = useCallback(() => setTick((t) => t + 1), []);
261
224
  return { ...state, refetch };
262
225
  }
263
- /** Mint the per-click interaction id the action tool requires (browser retry
264
- * id on web): a UUID where available, else a time + random fallback. */
226
+ /** Mint one id for a deliberate submission, retained by its retry closure. */
265
227
  export function mintInteractionId() {
266
228
  if (typeof crypto !== "undefined" && "randomUUID" in crypto) {
267
229
  return crypto.randomUUID();
268
230
  }
269
231
  return `${Date.now()}-${Math.floor(Math.random() * 1e9)}`;
270
232
  }
271
- /** A declared action → `invoke_view_action { view, action, value }`. The name
272
- * must exist on the CURRENT view definition; a removed button throws here
273
- * instead of emitting a stale event. */
233
+ /** Submit a declared action. Failed acknowledgements expose an explicit retry
234
+ * that keeps the original value, event subject and interaction id. */
274
235
  export function useAction(name) {
275
236
  const rt = useRuntime();
276
237
  if (!rt.def.actions?.[name]) {
277
238
  throw new Error(`Action "${name}" is not declared on view "${rt.def.key}"`);
278
239
  }
279
240
  return useCallback(async (value = {}) => {
241
+ if (!rt.ready) {
242
+ return {
243
+ ok: false,
244
+ error: "The host has not supplied the view subject.",
245
+ result: null,
246
+ retry: null,
247
+ };
248
+ }
249
+ let args;
280
250
  try {
281
- // The tool requires an interaction id (browser retry id on web):
282
- // mint one per click so retries stay idempotent.
283
- const result = await rt.callTool("invoke_view_action", {
251
+ // Snapshot JSON before the first send; edits to a form after a failure
252
+ // must not change the meaning of an already accepted submission.
253
+ args = JSON.parse(JSON.stringify({
284
254
  view: rt.def.key,
285
255
  action: name,
286
256
  value,
257
+ ...(rt.scope.event === undefined
258
+ ? {}
259
+ : { scope: { event: rt.scope.event } }),
287
260
  interaction_id: mintInteractionId(),
288
- });
289
- const err = resultError(result);
290
- return {
291
- ok: !err,
292
- error: err,
293
- result: result.structuredContent ?? null,
294
- };
261
+ }));
295
262
  }
296
- catch (e) {
263
+ catch (error) {
297
264
  return {
298
265
  ok: false,
299
- error: e instanceof Error ? e.message : String(e),
266
+ error: error instanceof Error ? error.message : String(error),
300
267
  result: null,
268
+ retry: null,
301
269
  };
302
270
  }
271
+ const submit = async () => {
272
+ try {
273
+ const result = await rt.callTool("invoke_view_action", args);
274
+ const error = resultError(result);
275
+ return {
276
+ ok: !error,
277
+ error,
278
+ result: result.structuredContent ?? null,
279
+ retry: error ? submit : null,
280
+ };
281
+ }
282
+ catch (error) {
283
+ return {
284
+ ok: false,
285
+ error: error instanceof Error ? error.message : String(error),
286
+ result: null,
287
+ retry: submit,
288
+ };
289
+ }
290
+ };
291
+ return submit();
303
292
  }, [rt, name]);
304
293
  }
305
294
  export function defaultsFor(def) {
@@ -345,6 +334,19 @@ export function coerceScope(raw) {
345
334
  if (typeof scope.event === "number" && Number.isInteger(scope.event)) {
346
335
  out.event = scope.event;
347
336
  }
337
+ if (scope.collection !== undefined) {
338
+ if (!out.type || out.entity !== undefined || out.event !== undefined) {
339
+ throw new Error("Collection selection requires a type page");
340
+ }
341
+ if (!scope.collection ||
342
+ typeof scope.collection !== "object" ||
343
+ Array.isArray(scope.collection)) {
344
+ throw new Error("Collection selection must be an object");
345
+ }
346
+ // The host validates selection. Preserve it for the validating read API;
347
+ // never drop an unfamiliar filter and silently widen the collection.
348
+ out.collection = scope.collection;
349
+ }
348
350
  return out;
349
351
  }
350
352
  function themeFromContext(ctx) {
@@ -366,6 +368,7 @@ export function Provider({ def, bridge, children, }) {
366
368
  const [scope, setScope] = useState({});
367
369
  const [params, setParamsState] = useState(() => defaultsFor(def));
368
370
  const [theme, setTheme] = useState("light");
371
+ const [dataVersion, setDataVersion] = useState(0);
369
372
  const bridgeRef = useRef(bridge ?? null);
370
373
  if (bridge)
371
374
  bridgeRef.current = bridge;
@@ -383,11 +386,20 @@ export function Provider({ def, bridge, children, }) {
383
386
  setParamsState(coerceParams(def, input.params));
384
387
  setReady(true);
385
388
  });
389
+ // MCP hosts initially send the permalink arguments. The opening result
390
+ // supplies the exact readable version, including after a supersession.
391
+ const offResult = b.onToolResult((result) => {
392
+ const resolved = result.structuredContent;
393
+ if (resolved?.view === def.key && resolved.scope) {
394
+ setScope(coerceScope(resolved.scope));
395
+ }
396
+ });
386
397
  const offCtx = b.onHostContext((ctx) => {
387
398
  const next = themeFromContext(ctx);
388
399
  setTheme(next);
389
400
  applyTheme(next);
390
401
  });
402
+ const offData = b.onDataChanged(() => setDataVersion((v) => v + 1));
391
403
  b.connect()
392
404
  .then((ctx) => {
393
405
  const next = themeFromContext(ctx);
@@ -400,7 +412,9 @@ export function Provider({ def, bridge, children, }) {
400
412
  .catch((e) => console.error("[lobu-views] connect failed", e));
401
413
  return () => {
402
414
  offInput();
415
+ offResult();
403
416
  offCtx();
417
+ offData();
404
418
  };
405
419
  }, [def]);
406
420
  const setParams = useCallback((patch) => {
@@ -431,9 +445,22 @@ export function Provider({ def, bridge, children, }) {
431
445
  params,
432
446
  setParams,
433
447
  theme,
448
+ dataVersion,
449
+ callTool,
450
+ }), [
451
+ def,
452
+ connected,
453
+ ready,
454
+ scope,
455
+ params,
456
+ setParams,
457
+ theme,
458
+ dataVersion,
434
459
  callTool,
435
- }), [def, connected, ready, scope, params, setParams, theme, callTool]);
436
- return _jsx(Ctx.Provider, { value: value, children: children });
460
+ ]);
461
+ // A host-resolved replacement is a new form, including in MCP hosts that
462
+ // keep the iframe mounted while delivering the opening result.
463
+ return (_jsx(Ctx.Provider, { value: value, children: children }, scope.event ?? "unbound"));
437
464
  }
438
465
  /** Entry point the compiled bundle calls once. Mounts the component into
439
466
  * `#root` and connects to the host. */
@@ -68,6 +68,7 @@ export declare class ViewBridge {
68
68
  private toolResultListeners;
69
69
  private toolCancelledListeners;
70
70
  private hostContextListeners;
71
+ private dataChangedListeners;
71
72
  /** Set by the first `tool-input` and never cleared: queries must not fire
72
73
  * before it (the host seeds scope + params there; anything read earlier
73
74
  * runs against defaults and double-fetches). */
@@ -93,6 +94,9 @@ export declare class ViewBridge {
93
94
  onToolResult(listener: (result: ToolResult) => void): () => void;
94
95
  onToolCancelled(listener: (reason: string | null) => void): () => void;
95
96
  onHostContext(listener: (ctx: HostContext) => void): () => void;
97
+ /** The host saw workspace data change (Lobu hosts only; other hosts never
98
+ * send it, and reads then refresh on their own triggers). */
99
+ onDataChanged(listener: () => void): () => void;
96
100
  /**
97
101
  * Run the `ui/initialize` handshake, then announce readiness. Resolves with
98
102
  * the host context. Rejects when the host answers with an error or stays
@@ -20,6 +20,9 @@ const HANDOFF_NOTIFICATIONS = new Set([
20
20
  "ui/notifications/tool-cancelled",
21
21
  ]);
22
22
  const PROTOCOL_VERSION = "2026-01-26";
23
+ /** Lobu host → guest: workspace data changed, re-read. Not an MCP Apps
24
+ * method; hosts that do not speak it simply never send it. */
25
+ const DATA_CHANGED_NOTIFICATION = "lobu/notifications/data-changed";
23
26
  const DEFAULT_TIMEOUT_MS = 60_000;
24
27
  function isRecord(value) {
25
28
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -42,6 +45,7 @@ export class ViewBridge {
42
45
  toolResultListeners = new Set();
43
46
  toolCancelledListeners = new Set();
44
47
  hostContextListeners = new Set();
48
+ dataChangedListeners = new Set();
45
49
  /** Set by the first `tool-input` and never cleared: queries must not fire
46
50
  * before it (the host seeds scope + params there; anything read earlier
47
51
  * runs against defaults and double-fetches). */
@@ -113,6 +117,12 @@ export class ViewBridge {
113
117
  this.hostContextListeners.add(listener);
114
118
  return () => this.hostContextListeners.delete(listener);
115
119
  }
120
+ /** The host saw workspace data change (Lobu hosts only; other hosts never
121
+ * send it, and reads then refresh on their own triggers). */
122
+ onDataChanged(listener) {
123
+ this.dataChangedListeners.add(listener);
124
+ return () => this.dataChangedListeners.delete(listener);
125
+ }
116
126
  /**
117
127
  * Run the `ui/initialize` handshake, then announce readiness. Resolves with
118
128
  * the host context. Rejects when the host answers with an error or stays
@@ -312,6 +322,11 @@ export class ViewBridge {
312
322
  listener(snapshot);
313
323
  break;
314
324
  }
325
+ case DATA_CHANGED_NOTIFICATION: {
326
+ for (const listener of [...this.dataChangedListeners])
327
+ listener();
328
+ break;
329
+ }
315
330
  default:
316
331
  break;
317
332
  }
@@ -5,6 +5,7 @@
5
5
  * frame. The module declares itself with `defineView` and mounts once with
6
6
  * `mountView`; hooks bridge params, scope, reads and actions to the host.
7
7
  */
8
+ export type { AttributeFilter, CollectionSelection, } from "@lobu/core/contracts/tools/collection-selection";
8
9
  export { ViewBridge } from "./bridge.js";
9
10
  export type { BridgeOptions, HostContext, ToolResult, ViewHandoff, } from "./bridge.js";
10
11
  export { coerceParams, defaultsFor, defineView, escapeLiteral, mintInteractionId, mountView, Provider, sql, tool, useAction, useHost, useParams, useQuery, useScope, } from "./api.js";
@@ -1,10 +1,3 @@
1
- /**
2
- * `@lobu/views` — authoring runtime for Lobu views.
3
- *
4
- * A view is an ordinary React module rendered in the sandboxed MCP Apps
5
- * frame. The module declares itself with `defineView` and mounts once with
6
- * `mountView`; hooks bridge params, scope, reads and actions to the host.
7
- */
8
1
  export { ViewBridge } from "./bridge.js";
9
2
  export { coerceParams, defaultsFor, defineView, escapeLiteral, mintInteractionId, mountView, Provider, sql, tool, useAction, useHost, useParams, useQuery, useScope, } from "./api.js";
10
3
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/views",
3
- "version": "21.2.1",
3
+ "version": "22.0.0",
4
4
  "description": "Authoring runtime for Lobu views — React modules rendered in the sandboxed MCP Apps frame",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,6 +21,9 @@
21
21
  "dist",
22
22
  "!**/*.map"
23
23
  ],
24
+ "dependencies": {
25
+ "@lobu/core": "file:../core"
26
+ },
24
27
  "peerDependencies": {
25
28
  "react": "^19.0.0",
26
29
  "react-dom": "^19.0.0"
@@ -1 +0,0 @@
1
- import{cm as t,j as p,cn as m}from"./index-B2AmRqYh.js";import{A as e}from"./activity-route-view-BwThvdGs.js";import"./device-automation-BIjs7DZJ.js";import"./agent-thread-storage-U6htL3ad.js";import"./pending-seed-CPbfgnLX.js";import"./clients-Cp1BJ28u.js";import"./client-rows-EJSKR6z1.js";import"./connection-label-BobuYiAG.js";import"./events-feed-DK35T4g7.js";import"./use-applied-views-B-Z-Weji.js";import"./renderer-DgPLyEbx.js";import"./card-CMmh2mzo.js";import"./calendar-DAiyi1ZL.js";import"./agent-loading-shells-OagauQzV.js";import"./member-scope-gate-DXOCfx-v.js";function w(){const{owner:o,_splat:r}=t.useParams(),i=t.useSearch();return p.jsx(e,{owner:o,search:i,attentionLens:!1,entityScope:m(r||"").path})}export{w as component};