@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.
- package/dist/catalogs/automations.json +40 -13
- package/dist/catalogs/connectors.json +16601 -597
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +7 -5
- package/dist/connectors/_google/actions.ts +270 -0
- package/dist/connectors/_google/discovery/calendar_v3.json +1 -0
- package/dist/connectors/_google/discovery/chat_v1.json +1 -0
- package/dist/connectors/_google/discovery/docs_v1.json +1 -0
- package/dist/connectors/_google/discovery/drive_v3.json +1 -0
- package/dist/connectors/_google/discovery/gmail_v1.json +1 -0
- package/dist/connectors/_google/discovery/people_v1.json +1 -0
- package/dist/connectors/_google/discovery/sheets_v4.json +1 -0
- package/dist/connectors/_google/discovery/tasks_v1.json +1 -0
- package/dist/connectors/_google/discovery/youtube_v3.json +1 -0
- package/dist/connectors/_google/discovery.ts +442 -0
- package/dist/connectors/_google/errors.ts +91 -0
- package/dist/connectors/_google/list-feed.ts +223 -0
- package/dist/connectors/_google/policies.ts +127 -0
- package/dist/connectors/agentid.ts +43 -0
- package/dist/connectors/chat-user-identity.ts +2 -1
- package/dist/connectors/github-automation-events.ts +9 -0
- package/dist/connectors/github-identity.ts +28 -3
- package/dist/connectors/github.ts +101 -59
- package/dist/connectors/google_calendar.ts +207 -719
- package/dist/connectors/google_drive.ts +16 -2
- package/dist/connectors/google_gmail.ts +51 -33
- package/dist/connectors/herdr.ts +406 -0
- package/dist/connectors/jira.ts +6 -6
- package/dist/connectors/linear.ts +7 -4
- package/dist/connectors/postgres.ts +27 -2
- package/dist/connectors/tiktok-inbox-page.js +230 -0
- package/dist/connectors/tiktok-web-page.js +211 -0
- package/dist/connectors/tiktok_web.ts +286 -0
- package/dist/connectors/whatsapp-web-adapter.js +228 -10
- package/dist/connectors/whatsapp-web-helpers.ts +47 -14
- package/dist/connectors/whatsapp-web-identity.ts +121 -0
- package/dist/connectors/whatsapp_web.ts +170 -29
- package/dist/connectors/x.ts +276 -136
- package/dist/db/migrations/20261005150000_retire_agent_tool_config.sql +31 -0
- package/dist/db/migrations/20261005173700_drop_retired_agent_tool_config.sql +29 -0
- package/dist/db/migrations/20261007010000_identity_association_guards.sql +242 -0
- package/dist/db/migrations/20261007010001_identity_association_indexes.sql +35 -0
- package/dist/db/migrations/20261007012000_connector_browser_requirement.sql +7 -0
- package/dist/db/migrations/20261009010000_identity_member_decision_indexes.sql +22 -0
- package/dist/db/migrations/20261009015900_retire_remaining_physical_merges.sql +196 -0
- package/dist/db/migrations/20261009020000_retire_physical_entity_merge.sql +82 -0
- package/dist/db/migrations/20261009030000_retire_physical_merge_indexes.sql +39 -0
- package/dist/db/migrations/20261009030001_drop_physical_entity_redirect.sql +62 -0
- package/dist/db/migrations/20261009040000_normalize_identity_decisions.sql +60 -0
- package/dist/db/migrations/20261010220000_notification_targets_user_event_order.sql +53 -0
- package/dist/db/migrations/20261010223000_device_workers_user_fresh_cover.sql +39 -0
- package/dist/db/migrations/20261010223001_runs_org_default_view.sql +41 -0
- package/dist/db/migrations/20261010223002_events_org_guidance.sql +42 -0
- package/dist/db/migrations/20261011002000_finish_product_eval_retirement.sql +37 -0
- package/dist/db/migrations/20261011160000_mcp_conversation_workspaces.sql +97 -0
- package/dist/db/migrations/20261013120000_events_live_org_effective_date.sql +42 -0
- package/dist/db/migrations/20261013150000_events_live_linked_org_ids_gin.sql +41 -0
- package/dist/db/migrations/20261014120000_clear_team_device_auto_pause.sql +34 -0
- package/dist/db/migrations/20261014150000_connector_webhook_event_type_backfill.sql +30 -0
- package/dist/db/migrations/20261014170000_retire_atlassian_mcp_webhook_refresh.sql +51 -0
- package/dist/db/migrations/20261015010000_connection_auth_profile_fk_set_null_column.sql +53 -0
- package/dist/db/migrations/20261015120000_personal_org_connector_auto_policy.sql +38 -0
- package/dist/db/migrations/preconditions/20261005150000_retire_agent_tool_config.sql +22 -0
- package/dist/db/migrations/preconditions/20261005173700_drop_retired_agent_tool_config.sql +13 -0
- package/dist/db/migrations/preconditions/20261009020000_retire_physical_entity_merge.sql +26 -0
- package/dist/db/migrations/preconditions/20261011002000_finish_product_eval_retirement.sql +14 -0
- package/dist/dependencies.bun.lock +135 -128
- package/dist/guest.bundle.js +131 -185
- package/dist/owletto/dist/assets/_-CEPl6gU4.js +3 -0
- package/dist/owletto/dist/assets/_-C_zNZben.js +2 -0
- package/dist/owletto/dist/assets/_-DtqBFgK5.js +1 -0
- package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +2 -0
- package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +2 -0
- package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +2 -0
- package/dist/owletto/dist/assets/_deploymentId-BQfYN1U2.js +2 -0
- package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +2 -0
- package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +2 -0
- package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +3 -0
- package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +2 -0
- package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +2 -0
- package/dist/owletto/dist/assets/_threadId-DtqBFgK5.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +2 -0
- package/dist/owletto/dist/assets/accept-invitation-D3OgJG4i.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +2 -0
- package/dist/owletto/dist/assets/agent-card-controls-DzRs4Ix9.js +2 -0
- package/dist/owletto/dist/assets/{agent-client-setup-list-BFtgRwe8.js → agent-client-setup-list-B2SvH7xD.js} +4 -3
- package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +2 -0
- package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +2 -0
- package/dist/owletto/dist/assets/agent-guardrails-route-BaV1VpDh.js +2 -0
- package/dist/owletto/dist/assets/agent-loading-shells-CtZJM2Gc.js +2 -0
- package/dist/owletto/dist/assets/agent-permissions-matrix-Ds48KFK9.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-BAr2Dw3F.js → agent-skill-context-DPk5r08w.js} +2 -1
- package/dist/owletto/dist/assets/agent-skills-route-DYpB5H1J.js +2 -0
- package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +2 -0
- package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +6 -0
- package/dist/owletto/dist/assets/agents-F4mGI2oF.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +2 -0
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +128 -0
- package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +2 -0
- package/dist/owletto/dist/assets/automations-F4mGI2oF.js +2 -0
- package/dist/owletto/dist/assets/{callback-CaRe2TOT.js → callback-CU-hb8JB.js} +2 -1
- package/dist/owletto/dist/assets/{card-CMmh2mzo.js → card-DIF8SF9b.js} +2 -1
- package/dist/owletto/dist/assets/claim-DELEa-gH.js +2 -0
- package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +1 -0
- package/dist/owletto/dist/assets/clients-CpG676mg.js +2 -0
- package/dist/owletto/dist/assets/code-editor-V27Z4o3P.js +16 -0
- package/dist/owletto/dist/assets/connect-B2YL6qIK.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +2 -0
- package/dist/owletto/dist/assets/connection-DySpRE9x.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-C_D68j6d.js +2 -0
- package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +1 -0
- package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-BjKiUhYE.js → connector-provenance-CNXtzYg5.js} +2 -1
- package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +2 -0
- package/dist/owletto/dist/assets/{connectors-Baejya0T.js → connectors-BJnk1z_2.js} +2 -1
- package/dist/owletto/dist/assets/consent-BVzxrAO9.js +2 -0
- package/dist/owletto/dist/assets/conversations-table-DfZGICl7.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-QA7BQgiK.js → core.esm-DiTpULFl.js} +2 -1
- package/dist/owletto/dist/assets/create-CUqO6Kfk.js +2 -0
- package/dist/owletto/dist/assets/create-JRFM8mMf.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +3 -0
- package/dist/owletto/dist/assets/create-iHcxV0xd.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-2GHCtD7h.js → cronstrue-DPXl0qA2.js} +2 -1
- package/dist/owletto/dist/assets/deployments-DCQdFdwG.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-Bm2upStd.js → deployments-body-D6TAWs_6.js} +2 -1
- package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +2 -0
- package/dist/owletto/dist/assets/device-CntqYW65.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +2 -0
- package/dist/owletto/dist/assets/{entity-options-CrbS6K-i.js → entity-options-UJs64GdQ.js} +2 -1
- package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +2 -0
- package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +2 -0
- package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +2 -0
- package/dist/owletto/dist/assets/full-page-spinner-KpV2FS2u.js +2 -0
- package/dist/owletto/dist/assets/guardrails-molekzAF.js +2 -0
- package/dist/owletto/dist/assets/identity-BJcaG66g.js +2 -0
- package/dist/owletto/dist/assets/index-B04ON9Jv.js +2 -0
- package/dist/owletto/dist/assets/index-BEvyBdOU.js +2 -0
- package/dist/owletto/dist/assets/{index-Cf0GJoiG.js → index-BJXkc60S.js} +2 -1
- package/dist/owletto/dist/assets/index-BLEcy9-T.css +1 -0
- package/dist/owletto/dist/assets/index-BNh2cidi.js +2 -0
- package/dist/owletto/dist/assets/index-BOsK-K-2.js +2 -0
- package/dist/owletto/dist/assets/{index-DlepU3cY.js → index-BOzuAbvi.js} +2 -1
- package/dist/owletto/dist/assets/index-Bk1x7A67.js +2 -0
- package/dist/owletto/dist/assets/index-CDz3-ieP.js +1 -0
- package/dist/owletto/dist/assets/index-CFnx5huL.js +2 -0
- package/dist/owletto/dist/assets/index-D3s8rhG9.js +2 -0
- package/dist/owletto/dist/assets/index-DCdkwg9H.js +2 -0
- package/dist/owletto/dist/assets/index-Dbd1jusf.js +2 -0
- package/dist/owletto/dist/assets/index-DqZuqC08.js +2 -0
- package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +2 -0
- package/dist/owletto/dist/assets/index-DtqBFgK5.js +1 -0
- package/dist/owletto/dist/assets/index-KPOvMVa-.js +2 -0
- package/dist/owletto/dist/assets/index-Vcq4gwWv.js +1 -0
- package/dist/owletto/dist/assets/index-_oPeVpL_.js +7950 -0
- package/dist/owletto/dist/assets/index-rrnUF981.js +1 -0
- package/dist/owletto/dist/assets/json-diff-D_Ym3Uku.js +4 -0
- package/dist/owletto/dist/assets/{list-skeleton-BtWn2eo2.js → list-skeleton-Bl0OS39L.js} +2 -1
- package/dist/owletto/dist/assets/login-QHdxqX-4.js +2 -0
- package/dist/owletto/dist/assets/logout-DUccApuZ.js +2 -0
- package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +103 -0
- package/dist/owletto/dist/assets/model-selector-CB1BDvlW.js +2 -0
- package/dist/owletto/dist/assets/models-DnMb3n-Z.js +2 -0
- package/dist/owletto/dist/assets/new-B5UsLiy6.js +2 -0
- package/dist/owletto/dist/assets/new-BWo8_Pms.js +2 -0
- package/dist/owletto/dist/assets/new-DpmDXmFI.js +2 -0
- package/dist/owletto/dist/assets/oauth-workspace-access-PGyTnW2K.js +2 -0
- package/dist/owletto/dist/assets/organization-BH8PYlVu.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +2 -0
- package/dist/owletto/dist/assets/{permissions-h_qSft1A.js → permissions-CwN_YP3u.js} +2 -1
- package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +2 -0
- package/dist/owletto/dist/assets/{recent-JiBNvZzD.js → recent-DqdZE_TI.js} +2 -1
- package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +2 -0
- package/dist/owletto/dist/assets/{renderer-DgPLyEbx.js → renderer-BL6VcwQH.js} +28 -27
- package/dist/owletto/dist/assets/reset-password-DAvBYkiI.js +2 -0
- package/dist/owletto/dist/assets/runs-BWtc5rmc.js +2 -0
- package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +2 -0
- package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +2 -0
- package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +2 -0
- package/dist/owletto/dist/assets/settings-Crxlwps-.js +2 -0
- package/dist/owletto/dist/assets/skill-editor-D_W3QlRz.js +1 -0
- package/dist/owletto/dist/assets/skills-D0X430X8.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CRIPMWfN.js +2 -0
- package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +2 -0
- package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-B4DfZFm5.js → use-mention-search-DqEykWl_.js} +3 -2
- package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +2 -0
- package/dist/owletto/dist/assets/workspace-label-o_QfBuCM.js +2 -0
- package/dist/owletto/dist/index.html +46 -4
- package/dist/providers.json +1 -1
- package/dist/server-main.bundle.mjs +135551 -132880
- package/npm-shrinkwrap.json +578 -611
- package/package.json +4 -3
- package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
- package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
- package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
- package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +159 -45
- package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
- package/vendor/connector-sdk/dist/define-connector.js +3 -0
- package/vendor/connector-sdk/dist/index.d.ts +5 -2
- package/vendor/connector-sdk/dist/index.js +1 -0
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
- package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
- package/vendor/connector-sdk/package.json +5 -1
- package/vendor/core/dist/agent-policy.js +1 -1
- package/vendor/core/dist/agent-store.d.ts +2 -0
- package/vendor/core/dist/agent-tooling.d.ts +1 -1
- package/vendor/core/dist/agent-tooling.js +1 -1
- package/vendor/core/dist/capabilities.js +2 -0
- package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
- package/vendor/core/dist/contracts/agent-settings.js +1 -7
- package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
- package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
- package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
- package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
- package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
- package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
- package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
- package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
- package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
- package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
- package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
- package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
- package/vendor/core/dist/contracts/worker/protocol.d.ts +122 -28
- package/vendor/core/dist/contracts/worker/protocol.js +81 -17
- package/vendor/core/dist/index.d.ts +3 -4
- package/vendor/core/dist/index.js +3 -6
- package/vendor/core/dist/json-template.d.ts +6 -10
- package/vendor/core/dist/json-template.js +5 -9
- package/vendor/core/dist/logger.js +11 -5
- package/vendor/core/dist/shell-safety.d.ts +9 -0
- package/vendor/core/dist/shell-safety.js +154 -0
- package/vendor/core/dist/suggestions.d.ts +1 -1
- package/vendor/core/dist/suggestions.js +1 -1
- package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
- package/vendor/core/dist/tool-trace-summary.js +1 -1
- package/vendor/core/dist/types.d.ts +1 -3
- package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
- package/vendor/core/dist/utils/{sentry-scrubber.js → diagnostic-scrubber.js} +25 -53
- package/vendor/core/dist/worker/auth.d.ts +44 -6
- package/vendor/core/dist/worker/auth.js +44 -11
- package/vendor/core/package.json +15 -6
- package/vendor/views/dist/api.d.ts +39 -29
- package/vendor/views/dist/api.js +110 -83
- package/vendor/views/dist/bridge.d.ts +4 -0
- package/vendor/views/dist/bridge.js +15 -0
- package/vendor/views/dist/index.d.ts +1 -0
- package/vendor/views/dist/index.js +0 -7
- package/vendor/views/package.json +4 -1
- package/dist/owletto/dist/assets/_-CLhipgJI.js +0 -1
- package/dist/owletto/dist/assets/_-D0ZVGAIA.js +0 -2
- package/dist/owletto/dist/assets/_agentId-BLXUf3ot.js +0 -1
- package/dist/owletto/dist/assets/_agentId-DnI66MF3.js +0 -1
- package/dist/owletto/dist/assets/_automationId-ziwseLb7.js +0 -1
- package/dist/owletto/dist/assets/_connectorKey._connectionId-B6V3ySFK.js +0 -1
- package/dist/owletto/dist/assets/_connectorKey.index-CR5u_dtt.js +0 -1
- package/dist/owletto/dist/assets/_conversationId-FBMYmOl8.js +0 -1
- package/dist/owletto/dist/assets/_deploymentId-DNTXbT_m.js +0 -1
- package/dist/owletto/dist/assets/_name-B37LKIxH.js +0 -1
- package/dist/owletto/dist/assets/_owner-BxYumqC2.js +0 -1
- package/dist/owletto/dist/assets/_shape-Bxz-04jR.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-D5MFbiw2.js +0 -1
- package/dist/owletto/dist/assets/_slug-Dlhit09k.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-C6535i-t.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-CQCtY3Y8.js +0 -1
- package/dist/owletto/dist/assets/_viewKey-CxKfKbRa.js +0 -1
- package/dist/owletto/dist/assets/accept-invitation-BQQwec3R.js +0 -1
- package/dist/owletto/dist/assets/activity-route-view-BwThvdGs.js +0 -1
- package/dist/owletto/dist/assets/agent-card-controls-B3RhzsPz.js +0 -1
- package/dist/owletto/dist/assets/agent-connect-pages-BO4wQn4L.js +0 -1
- package/dist/owletto/dist/assets/agent-editor-form-BYC4uSNz.js +0 -1
- package/dist/owletto/dist/assets/agent-guardrails-route-Dp02G1AQ.js +0 -1
- package/dist/owletto/dist/assets/agent-loading-shells-OagauQzV.js +0 -1
- package/dist/owletto/dist/assets/agent-permissions-matrix-B9Ho3P1t.js +0 -1
- package/dist/owletto/dist/assets/agent-skills-route-B4VUnVi0.js +0 -1
- package/dist/owletto/dist/assets/agent-subpage-shell-Dz8I-GUt.js +0 -1
- package/dist/owletto/dist/assets/agent-thread-B9-cdkaV.js +0 -8
- package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -1
- package/dist/owletto/dist/assets/agents-D0CIg4b9.js +0 -1
- package/dist/owletto/dist/assets/agents-workbench-C2sr5h82.js +0 -1
- package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +0 -127
- package/dist/owletto/dist/assets/app._appId-DLsJ_QWS.js +0 -1
- package/dist/owletto/dist/assets/automation-detail-content-9Rjb_I9j.js +0 -1
- package/dist/owletto/dist/assets/automations-D0CIg4b9.js +0 -1
- package/dist/owletto/dist/assets/calendar-DAiyi1ZL.js +0 -1
- package/dist/owletto/dist/assets/claim-CYHnUF7G.js +0 -1
- package/dist/owletto/dist/assets/clients-Cp1BJ28u.js +0 -1
- package/dist/owletto/dist/assets/code-editor-CYsR2VBP.js +0 -15
- package/dist/owletto/dist/assets/connect-CZip2g_B.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-CEKY8Dnv.js +0 -1
- package/dist/owletto/dist/assets/connected._clientId-C5xRjxNO.js +0 -1
- package/dist/owletto/dist/assets/connection-C06HZ241.js +0 -1
- package/dist/owletto/dist/assets/connection-feed-detail-D1whY5hL.js +0 -1
- package/dist/owletto/dist/assets/consent-CfYDldcF.js +0 -1
- package/dist/owletto/dist/assets/create-C3P-3_8O.js +0 -1
- package/dist/owletto/dist/assets/create-CwnrPUEw.js +0 -1
- package/dist/owletto/dist/assets/create-DOScS9Gl.js +0 -1
- package/dist/owletto/dist/assets/create-automation-form-CuxiIRCF.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-Bjv3lCf8.js +0 -1
- package/dist/owletto/dist/assets/deployments-ByBv1DW-.js +0 -1
- package/dist/owletto/dist/assets/deployments-C-_ECORv.js +0 -1
- package/dist/owletto/dist/assets/device-B0i7Xp8y.js +0 -1
- package/dist/owletto/dist/assets/device-automation-BIjs7DZJ.js +0 -1
- package/dist/owletto/dist/assets/device-pin-tombstone-Bd6vS2zu.js +0 -1
- package/dist/owletto/dist/assets/device-rows-Bwf8qDte.js +0 -1
- package/dist/owletto/dist/assets/device._deviceId-DJLAesm3.js +0 -1
- package/dist/owletto/dist/assets/entity-page-ijZe_1-6.js +0 -1
- package/dist/owletto/dist/assets/entity-type-page-onp2Tk_E.js +0 -1
- package/dist/owletto/dist/assets/event-page-C0B2UDY-.js +0 -1
- package/dist/owletto/dist/assets/events-feed-DK35T4g7.js +0 -1
- package/dist/owletto/dist/assets/full-page-spinner-Dd8eEaxq.js +0 -1
- package/dist/owletto/dist/assets/guardrails-DKO8_J-G.js +0 -1
- package/dist/owletto/dist/assets/identity-CKM54vrM.js +0 -1
- package/dist/owletto/dist/assets/index--VmN5WxW.js +0 -1
- package/dist/owletto/dist/assets/index-B2AmRqYh.js +0 -7898
- package/dist/owletto/dist/assets/index-B_rcEgFX.js +0 -1
- package/dist/owletto/dist/assets/index-BmAuAhub.css +0 -1
- package/dist/owletto/dist/assets/index-BmhGe6-Z.js +0 -1
- package/dist/owletto/dist/assets/index-C1dJSGrL.js +0 -1
- package/dist/owletto/dist/assets/index-CAFw4qCb.js +0 -1
- package/dist/owletto/dist/assets/index-CCcc_xBw.js +0 -52
- package/dist/owletto/dist/assets/index-CLU3gXVm.js +0 -1
- package/dist/owletto/dist/assets/index-CqQVnAY-.js +0 -1
- package/dist/owletto/dist/assets/index-CxT0uyIe.js +0 -1
- package/dist/owletto/dist/assets/index-DR08e6Ec.js +0 -1
- package/dist/owletto/dist/assets/index-DYb9L5FC.js +0 -1
- package/dist/owletto/dist/assets/index-SUUcQGT-.js +0 -1
- package/dist/owletto/dist/assets/index-SdiFOfR1.js +0 -1
- package/dist/owletto/dist/assets/index-zcfi5r1l.js +0 -1
- package/dist/owletto/dist/assets/json-diff-ClBBYBQD.js +0 -3
- package/dist/owletto/dist/assets/login-d3PdO-qV.js +0 -1
- package/dist/owletto/dist/assets/logout-DgckxwLn.js +0 -1
- package/dist/owletto/dist/assets/member-scope-gate-DXOCfx-v.js +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-CeAnKoTR.js +0 -101
- package/dist/owletto/dist/assets/missing-view-DrZ8m8yo.js +0 -1
- package/dist/owletto/dist/assets/model-selector-CapL1ARf.js +0 -1
- package/dist/owletto/dist/assets/models-CB8mhq7j.js +0 -1
- package/dist/owletto/dist/assets/new-BBUb-VR4.js +0 -1
- package/dist/owletto/dist/assets/new-CBLJ25_w.js +0 -1
- package/dist/owletto/dist/assets/new-tTXB4qBW.js +0 -1
- package/dist/owletto/dist/assets/oauth-workspace-access-DearynqZ.js +0 -1
- package/dist/owletto/dist/assets/organization-BgdBg-PJ.js +0 -1
- package/dist/owletto/dist/assets/pending-seed-CPbfgnLX.js +0 -1
- package/dist/owletto/dist/assets/proposal-review-shell-D4YNrrye.js +0 -1
- package/dist/owletto/dist/assets/reset-password-B8tWPtIj.js +0 -1
- package/dist/owletto/dist/assets/runs-oHveuEUB.js +0 -1
- package/dist/owletto/dist/assets/runs-panel-C56GDaJm.js +0 -1
- package/dist/owletto/dist/assets/runs-table-BUKDjiBc.js +0 -1
- package/dist/owletto/dist/assets/schema-value-normalization-3JuM_r1H.js +0 -1
- package/dist/owletto/dist/assets/settings-DaKg6U5O.js +0 -1
- package/dist/owletto/dist/assets/settings-DhnRi2nq.js +0 -1
- package/dist/owletto/dist/assets/skills-BpQncuMC.js +0 -1
- package/dist/owletto/dist/assets/switch-BQ40_DMb.js +0 -1
- package/dist/owletto/dist/assets/use-applied-views-B-Z-Weji.js +0 -1
- package/dist/owletto/dist/assets/view-frame-C7ciEoLo.js +0 -1
- package/vendor/core/dist/sentry.d.ts +0 -26
- package/vendor/core/dist/sentry.js +0 -133
- package/vendor/core/dist/tool-policy.d.ts +0 -74
- package/vendor/core/dist/tool-policy.js +0 -305
- 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
|
-
|
|
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
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
//
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
logger.error("Worker token rejected: adminTools
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
package/vendor/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/core",
|
|
3
|
-
"version": "
|
|
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
|
-
"./
|
|
45
|
-
"types": "./dist/
|
|
46
|
-
"import": "./dist/
|
|
47
|
-
"require": "./dist/
|
|
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 {
|
|
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
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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<{
|
|
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
|
|
78
|
-
* return <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
|
|
94
|
-
*
|
|
95
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
197
|
-
*
|
|
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;
|
package/vendor/views/dist/api.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
231
|
-
|
|
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
|
-
|
|
211
|
+
show({ ...out, loading: false });
|
|
244
212
|
})
|
|
245
213
|
.catch((e) => {
|
|
246
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
/**
|
|
272
|
-
*
|
|
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
|
-
//
|
|
282
|
-
//
|
|
283
|
-
|
|
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 (
|
|
263
|
+
catch (error) {
|
|
297
264
|
return {
|
|
298
265
|
ok: false,
|
|
299
|
-
error:
|
|
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
|
-
|
|
436
|
-
|
|
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": "
|
|
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};
|