@lobu/runtime-server 22.0.0 → 24.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +1448 -212
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +15 -2
- package/dist/connectors/google_gmail.ts +1 -0
- package/dist/connectors/jira-helpers.ts +313 -0
- package/dist/connectors/jira.ts +29 -221
- package/dist/connectors/linkedin-browser-script.ts +13 -0
- package/dist/connectors/linkedin-draft-page.js +104 -0
- package/dist/connectors/linkedin-drafts.ts +73 -0
- package/dist/connectors/linkedin-identity.ts +32 -0
- package/dist/connectors/linkedin-inbox-adapter.js +1182 -0
- package/dist/connectors/linkedin-inbox.ts +156 -0
- package/dist/connectors/linkedin-like.ts +114 -0
- package/dist/connectors/linkedin-takeout.ts +577 -0
- package/dist/connectors/linkedin.ts +4017 -0
- package/dist/connectors/reddit.ts +92 -20
- package/dist/connectors/slack.ts +1 -0
- package/dist/connectors/takeout-utils.ts +240 -0
- package/dist/connectors/tiktok-inbox-page.js +9 -9
- package/dist/connectors/tiktok-web-page.js +21 -15
- package/dist/connectors/tiktok_web.ts +63 -30
- package/dist/connectors/whatsapp-web-adapter.js +104 -574
- package/dist/connectors/whatsapp-web-helpers.ts +30 -444
- package/dist/connectors/whatsapp-web-identity.ts +20 -6
- package/dist/connectors/whatsapp_web.ts +46 -646
- package/dist/connectors/x-dm-adapter.js +556 -0
- package/dist/connectors/x-identity.ts +33 -2
- package/dist/connectors/x.ts +266 -120
- package/dist/db/migrations/20261017120000_drop_feeds_kind_virtual.sql +26 -0
- package/dist/db/migrations/20261017130000_drop_retired_dead_code_columns.sql +46 -0
- package/dist/db/migrations/20261019120000_retire_identities_of_deleted_entities.sql +21 -0
- package/dist/db/migrations/20261020120000_entities_live_metadata_domain.sql +66 -0
- package/dist/db/migrations/20261020130000_agents_starters.sql +14 -0
- package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +71 -0
- package/dist/dependencies.bun.lock +78 -75
- package/dist/guest.bundle.js +650 -448
- package/dist/owletto/dist/assets/_-CC8cTmRg.js +3 -0
- package/dist/owletto/dist/assets/_-ksFp4zVf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DWUFSrVp.js +2 -0
- package/dist/owletto/dist/assets/_agentId-MENLoohA.js +2 -0
- package/dist/owletto/dist/assets/_automationId-BnHqdXOC.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CefXIqy2.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-C1QPGf9E.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-DinuPCUp.js +2 -0
- package/dist/owletto/dist/assets/{_deploymentId-BQfYN1U2.js → _deploymentId-BeyzVjRm.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-3L_qeL_l.js +2 -0
- package/dist/owletto/dist/assets/_name-Dgedji78.js +2 -0
- package/dist/owletto/dist/assets/_owner-DbrKma4e.js +3 -0
- package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +2 -0
- package/dist/owletto/dist/assets/_slug-ndDr_CUg.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D3OgJG4i.js → accept-invitation-CRKbM2Xy.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-CFLNukhD.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-DzRs4Ix9.js → agent-card-controls-Be1Okb2C.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-B2SvH7xD.js → agent-client-setup-list-BA8dU_C6.js} +2 -2
- package/dist/owletto/dist/assets/agent-connect-pages-CAV-yXus.js +2 -0
- package/dist/owletto/dist/assets/agent-editor-form-Bi6WvYX-.js +2 -0
- package/dist/owletto/dist/assets/{agent-guardrails-route-BaV1VpDh.js → agent-guardrails-route-DMOjG1D4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-CtZJM2Gc.js → agent-loading-shells-De_2d8Lr.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-Ds48KFK9.js → agent-permissions-matrix-gZWl6mAe.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-DPk5r08w.js → agent-skill-context-JLaTamGR.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-DYpB5H1J.js → agent-skills-route-DcK41PWj.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-BBJoyTuC.js +2 -0
- package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +6 -0
- package/dist/owletto/dist/assets/agents-C-ReckCa.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CqaKGggb.js +2 -0
- package/dist/owletto/dist/assets/app._appId-Cl1fTuIt.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-BMLL4lxO.js +2 -0
- package/dist/owletto/dist/assets/automations-C-ReckCa.js +2 -0
- package/dist/owletto/dist/assets/callback-DTKKsfkz.js +2 -0
- package/dist/owletto/dist/assets/{card-DIF8SF9b.js → card-yU0TmNRH.js} +2 -2
- package/dist/owletto/dist/assets/{claim-DELEa-gH.js → claim-DJfTvlT2.js} +2 -2
- package/dist/owletto/dist/assets/client-rows--FrZfJol.js +2 -0
- package/dist/owletto/dist/assets/{clients-CpG676mg.js → clients-L4K1UT8c.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-V27Z4o3P.js → code-editor-U54Gwjit.js} +2 -2
- package/dist/owletto/dist/assets/connect-4zqtnDHb.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-DTpSW1Xy.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-h9X5H1x8.js +2 -0
- package/dist/owletto/dist/assets/{connection-DySpRE9x.js → connection-ByvKkyFm.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-C_D68j6d.js → connection-feed-detail-DWM9lTao.js} +2 -2
- package/dist/owletto/dist/assets/connections-browser-CEwYrYqt.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-CNXtzYg5.js → connector-provenance-BocTm__v.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-OYDOydtz.js +2 -0
- package/dist/owletto/dist/assets/connectors-CyZpcE5f.js +2 -0
- package/dist/owletto/dist/assets/{consent-BVzxrAO9.js → consent-DdfINrVp.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-DfZGICl7.js → conversations-table-BSznfdYt.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-DiTpULFl.js → core.esm-Dr7tcIB-.js} +2 -2
- package/dist/owletto/dist/assets/create-CBGwASon.js +2 -0
- package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +2 -0
- package/dist/owletto/dist/assets/create-CwThQtd3.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-9T5WnoUs.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-DPXl0qA2.js → cronstrue-BWFEyy_P.js} +2 -2
- package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-D6TAWs_6.js → deployments-body-2xKS8gRo.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-DCQdFdwG.js → deployments-wG_8QzOF.js} +2 -2
- package/dist/owletto/dist/assets/{device-CntqYW65.js → device-6z-xgsoW.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-Cwq88RMU.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-BDerBfD9.js +2 -0
- package/dist/owletto/dist/assets/entity-avatar-Cc1CuI-0.js +2 -0
- package/dist/owletto/dist/assets/entity-options-DHdMC1Lx.js +2 -0
- package/dist/owletto/dist/assets/entity-page--OkXmlNP.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-89RoK_-P.js +2 -0
- package/dist/owletto/dist/assets/event-detail-D4YZRtrA.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-B1_QUpg_.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-KpV2FS2u.js → full-page-spinner-Cqih-8IW.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +2 -0
- package/dist/owletto/dist/assets/identity-B0nH4yiC.js +2 -0
- package/dist/owletto/dist/assets/index-4TSkcsth.js +2 -0
- package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
- package/dist/owletto/dist/assets/index-BgkhXElB.js +2 -0
- package/dist/owletto/dist/assets/index-CoW4Bz3w.js +2 -0
- package/dist/owletto/dist/assets/index-Codw-Qqi.js +2 -0
- package/dist/owletto/dist/assets/{index-BNh2cidi.js → index-DAOyXG1X.js} +2 -2
- package/dist/owletto/dist/assets/{index-BEvyBdOU.js → index-DKPwCasf.js} +2 -2
- package/dist/owletto/dist/assets/index-DMyXd3bJ.js +2 -0
- package/dist/owletto/dist/assets/index-DYCqXaMf.js +7950 -0
- package/dist/owletto/dist/assets/index-DYYZLcJ0.js +2 -0
- package/dist/owletto/dist/assets/index-DYzWV5_z.js +2 -0
- package/dist/owletto/dist/assets/index-Da6CrGEu.js +2 -0
- package/dist/owletto/dist/assets/{index-DCdkwg9H.js → index-DfyDUpuI.js} +2 -2
- package/dist/owletto/dist/assets/index-DneshLbf.js +2 -0
- package/dist/owletto/dist/assets/index-TgRS2v_F.js +2 -0
- package/dist/owletto/dist/assets/{index-BJXkc60S.js → index-ZNlrDc_f.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-D_Ym3Uku.js → json-diff-DFvYINBT.js} +3 -3
- package/dist/owletto/dist/assets/{list-skeleton-Bl0OS39L.js → list-skeleton-DFsEqLU1.js} +2 -2
- package/dist/owletto/dist/assets/login-DO0j-AYr.js +2 -0
- package/dist/owletto/dist/assets/{logout-DUccApuZ.js → logout-BmNwoAf7.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-B2LrMWBU.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-Cjpl8EbB.js +103 -0
- package/dist/owletto/dist/assets/{model-selector-CB1BDvlW.js → model-selector-TQcA93xm.js} +2 -2
- package/dist/owletto/dist/assets/models-D7aED5Sa.js +2 -0
- package/dist/owletto/dist/assets/new-BMrFy5Qa.js +2 -0
- package/dist/owletto/dist/assets/{new-B5UsLiy6.js → new-ByBhteWA.js} +2 -2
- package/dist/owletto/dist/assets/new-DWp3deoW.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-PGyTnW2K.js → oauth-workspace-access-D_5uESuz.js} +2 -2
- package/dist/owletto/dist/assets/{organization-BH8PYlVu.js → organization-DTFoYP4V.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-DF5iGC3c.js +2 -0
- package/dist/owletto/dist/assets/{permissions-CwN_YP3u.js → permissions-C_auqxfP.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-DsNiavG_.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +2 -0
- package/dist/owletto/dist/assets/{recent-DqdZE_TI.js → recent-3d99S2IE.js} +2 -2
- package/dist/owletto/dist/assets/record-activity-C9KfBkXb.js +2 -0
- package/dist/owletto/dist/assets/record-field-peek-BBZcRuGT.js +2 -0
- package/dist/owletto/dist/assets/record-session-BizRugWs.js +2 -0
- package/dist/owletto/dist/assets/{reset-password-DAvBYkiI.js → reset-password-DqfcSn8M.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-T1ZxTVz6.js +2 -0
- package/dist/owletto/dist/assets/runs-table-D_8QlCCN.js +2 -0
- package/dist/owletto/dist/assets/schema-value-normalization-CylKX3PK.js +97 -0
- package/dist/owletto/dist/assets/settings-B_ClYztB.js +2 -0
- package/dist/owletto/dist/assets/settings-DgX1-xo7.js +2 -0
- package/dist/owletto/dist/assets/skills-Drw5tcZw.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-CRIPMWfN.js → source-record-panels-Cg249m1S.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-DqEykWl_.js → use-mention-search-BYbFvHbJ.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-DMSqkN2J.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +14031 -12680
- package/npm-shrinkwrap.json +329 -313
- package/package.json +6 -5
- package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
- package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
- package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
- package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +10 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -0
- package/vendor/connector-sdk/dist/index.js +2 -0
- package/vendor/connector-sdk/package.json +9 -1
- package/vendor/core/dist/agent-policy.js +0 -3
- package/vendor/core/dist/agent-tooling.d.ts +1 -1
- package/vendor/core/dist/agent-tooling.js +3 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +0 -1
- package/vendor/core/dist/connector-query-errors.d.ts +32 -0
- package/vendor/core/dist/connector-query-errors.js +41 -1
- package/vendor/core/dist/contracts/agent-settings.d.ts +6 -2
- package/vendor/core/dist/contracts/agent-settings.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +53 -234
- package/vendor/core/dist/contracts/tools/manage-views.js +50 -76
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +5 -8
- package/vendor/core/dist/contracts/tools/view-attach.js +14 -31
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +21 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +165 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +47 -133
- package/vendor/core/dist/contracts/worker/protocol.js +33 -62
- package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
- package/vendor/core/dist/device-pin-tombstones.js +57 -0
- package/vendor/core/dist/index.d.ts +3 -2
- package/vendor/core/dist/index.js +3 -1
- package/vendor/core/dist/logger.js +10 -25
- package/vendor/core/dist/suggestions.d.ts +15 -2
- package/vendor/core/dist/suggestions.js +48 -3
- package/vendor/core/dist/types.d.ts +26 -0
- package/vendor/core/dist/types.js +5 -0
- package/vendor/core/dist/utils/diagnostic-scrubber.js +258 -21
- package/vendor/core/dist/worker/wire.d.ts +0 -10
- package/vendor/core/package.json +16 -10
- package/vendor/postgres/cf/src/connection.js +18 -0
- package/vendor/postgres/cjs/src/connection.js +18 -0
- package/vendor/postgres/src/connection.js +18 -0
- package/vendor/views/dist/api.d.ts +71 -17
- package/vendor/views/dist/api.js +200 -35
- package/vendor/views/dist/bridge.d.ts +3 -0
- package/vendor/views/dist/bridge.js +9 -1
- package/vendor/views/dist/components.d.ts +170 -0
- package/vendor/views/dist/components.js +361 -0
- package/vendor/views/dist/index.d.ts +1 -1
- package/vendor/views/package.json +11 -1
- package/dist/owletto/dist/assets/_-CEPl6gU4.js +0 -3
- package/dist/owletto/dist/assets/_-C_zNZben.js +0 -2
- package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +0 -2
- package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +0 -2
- package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +0 -2
- package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +0 -2
- package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +0 -2
- package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +0 -3
- package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +0 -2
- package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +0 -6
- package/dist/owletto/dist/assets/agents-F4mGI2oF.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +0 -2
- package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +0 -2
- package/dist/owletto/dist/assets/automations-F4mGI2oF.js +0 -2
- package/dist/owletto/dist/assets/callback-CU-hb8JB.js +0 -2
- package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
- package/dist/owletto/dist/assets/connect-B2YL6qIK.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +0 -2
- package/dist/owletto/dist/assets/connectors-BJnk1z_2.js +0 -2
- package/dist/owletto/dist/assets/create-CUqO6Kfk.js +0 -2
- package/dist/owletto/dist/assets/create-JRFM8mMf.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +0 -3
- package/dist/owletto/dist/assets/create-iHcxV0xd.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +0 -2
- package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +0 -2
- package/dist/owletto/dist/assets/entity-options-UJs64GdQ.js +0 -2
- package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +0 -2
- package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +0 -2
- package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +0 -2
- package/dist/owletto/dist/assets/guardrails-molekzAF.js +0 -2
- package/dist/owletto/dist/assets/identity-BJcaG66g.js +0 -2
- package/dist/owletto/dist/assets/index-B04ON9Jv.js +0 -2
- package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
- package/dist/owletto/dist/assets/index-BOsK-K-2.js +0 -2
- package/dist/owletto/dist/assets/index-BOzuAbvi.js +0 -2
- package/dist/owletto/dist/assets/index-Bk1x7A67.js +0 -2
- package/dist/owletto/dist/assets/index-CFnx5huL.js +0 -2
- package/dist/owletto/dist/assets/index-D3s8rhG9.js +0 -2
- package/dist/owletto/dist/assets/index-Dbd1jusf.js +0 -2
- package/dist/owletto/dist/assets/index-DqZuqC08.js +0 -2
- package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +0 -2
- package/dist/owletto/dist/assets/index-KPOvMVa-.js +0 -2
- package/dist/owletto/dist/assets/index-_oPeVpL_.js +0 -7950
- package/dist/owletto/dist/assets/login-QHdxqX-4.js +0 -2
- package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +0 -103
- package/dist/owletto/dist/assets/models-DnMb3n-Z.js +0 -2
- package/dist/owletto/dist/assets/new-BWo8_Pms.js +0 -2
- package/dist/owletto/dist/assets/new-DpmDXmFI.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +0 -2
- package/dist/owletto/dist/assets/renderer-BL6VcwQH.js +0 -97
- package/dist/owletto/dist/assets/runs-BWtc5rmc.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +0 -2
- package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +0 -2
- package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +0 -2
- package/dist/owletto/dist/assets/settings-Crxlwps-.js +0 -2
- package/dist/owletto/dist/assets/skills-D0X430X8.js +0 -2
- package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +0 -2
- package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +0 -2
- package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
- package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
- /package/vendor/postgres/{.bun-tag-f39dafdb2305d504 → .bun-tag-2f292c6554a8475e} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewKeySchema = void 0;
|
|
3
|
+
exports.ManageViewsResultSchema = exports.ManageViewsSchema = exports.RemoveViewAction = exports.ListViewsAction = exports.GetViewAction = exports.SetViewAction = exports.ViewRowSchema = exports.ViewDefinitionSchema = exports.ViewActionDeclSchema = exports.ViewParamDeclSchema = exports.ViewAttachmentSchema = exports.ViewKeySchema = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
const collection_selection_1 = require("./collection-selection");
|
|
6
6
|
const source_files_schema_1 = require("./source-files-schema");
|
|
@@ -15,78 +15,46 @@ exports.ViewKeySchema = typebox_1.Type.String({
|
|
|
15
15
|
maxLength: 64,
|
|
16
16
|
description: "View key, e.g. 'pipeline'.",
|
|
17
17
|
});
|
|
18
|
-
// Where a view appears
|
|
19
|
-
// no attach/detach verbs — changing
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
// `event_kind` belongs to the event variant alone. The subject variants stay
|
|
24
|
-
// open objects (the handler reports a mixed entry itself), so each one forbids
|
|
25
|
-
// the key: otherwise `{ event_kind, type, placement }` would validate as a
|
|
26
|
-
// type attachment and render as a type tab.
|
|
27
|
-
const NoEventKind = typebox_1.Type.Optional(typebox_1.Type.Never());
|
|
28
|
-
const TypeSubject = {
|
|
29
|
-
type: typebox_1.Type.String({
|
|
30
|
-
minLength: 1,
|
|
31
|
-
maxLength: 120,
|
|
32
|
-
description: "Entity-type slug this view attaches to.",
|
|
33
|
-
}),
|
|
34
|
-
placement: ViewPlacementSchema,
|
|
35
|
-
event_kind: NoEventKind,
|
|
36
|
-
};
|
|
18
|
+
// Where a view appears: one page per entry, named by its key. The attach line
|
|
19
|
+
// lives in the module source; there are no attach/detach verbs — changing it
|
|
20
|
+
// means re-saving the view. How the view renders there is the view's own
|
|
21
|
+
// choice, from the host's display mode (an inline card or fullscreen).
|
|
22
|
+
const EntityTypeSlug = (description) => typebox_1.Type.String({ minLength: 1, maxLength: 120, description });
|
|
37
23
|
exports.ViewAttachmentSchema = typebox_1.Type.Union([
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
...TypeSubject,
|
|
41
|
-
surface: typebox_1.Type.Optional(typebox_1.Type.Never()),
|
|
42
|
-
when: typebox_1.Type.Optional(typebox_1.Type.Never()),
|
|
43
|
-
}),
|
|
24
|
+
// A record page: an inline card above the record's activity, opening
|
|
25
|
+
// fullscreen in the peek. `id` pins it to one record of the type.
|
|
44
26
|
typebox_1.Type.Object({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
record: EntityTypeSlug("Entity type whose record pages show this view."),
|
|
28
|
+
id: typebox_1.Type.Optional(typebox_1.Type.Integer({
|
|
29
|
+
minimum: 1,
|
|
30
|
+
description: "Show it on this one record of the type only.",
|
|
31
|
+
})),
|
|
32
|
+
}, { additionalProperties: false }),
|
|
33
|
+
// A type's list page: a tab beside the records, at /<type>/-/views/<key>.
|
|
49
34
|
typebox_1.Type.Object({
|
|
50
|
-
|
|
51
|
-
surface: typebox_1.Type.Literal("collection"),
|
|
52
|
-
placement: typebox_1.Type.Optional(typebox_1.Type.Literal("tab")),
|
|
35
|
+
collection: EntityTypeSlug("Entity type whose list page shows this view as a tab."),
|
|
53
36
|
when: typebox_1.Type.Optional(collection_selection_1.CollectionWhenSchema),
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
entity: typebox_1.Type.Union([typebox_1.Type.Integer(), typebox_1.Type.String()], {
|
|
57
|
-
description: "Entity id (number) or slug (string) this view attaches to.",
|
|
58
|
-
}),
|
|
59
|
-
placement: ViewPlacementSchema,
|
|
60
|
-
event_kind: NoEventKind,
|
|
61
|
-
surface: typebox_1.Type.Optional(typebox_1.Type.Never()),
|
|
62
|
-
when: typebox_1.Type.Optional(typebox_1.Type.Never()),
|
|
63
|
-
}),
|
|
37
|
+
}, { additionalProperties: false }),
|
|
38
|
+
// The Data hub: a tab at /data/-/views/<key>.
|
|
64
39
|
typebox_1.Type.Object({
|
|
65
40
|
workspace: typebox_1.Type.Literal(true, {
|
|
66
41
|
description: "A tab on the Data hub, at /data/-/views/<key>.",
|
|
67
42
|
}),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
when: typebox_1.Type.Optional(typebox_1.Type.Never()),
|
|
72
|
-
}),
|
|
73
|
-
// An event subject: the view renders one event (scope.event) on the event's
|
|
74
|
-
// own page, /events/<id>/-/views/<key>. It matches an event whose kind is
|
|
75
|
-
// `event_kind`, optionally qualified by a linked entity of `type`. Closed, and no
|
|
76
|
-
// placement: the event page has one layout.
|
|
43
|
+
}, { additionalProperties: false }),
|
|
44
|
+
// One event's page, /events/<id>/-/views/<key>: matches an event of kind
|
|
45
|
+
// `event`, optionally only when it links an entity of `type`.
|
|
77
46
|
typebox_1.Type.Object({
|
|
78
|
-
|
|
47
|
+
event: typebox_1.Type.String({
|
|
79
48
|
minLength: 1,
|
|
80
49
|
maxLength: 128,
|
|
50
|
+
pattern: "^[A-Za-z][A-Za-z0-9._-]{0,127}$",
|
|
81
51
|
description: "Event kind (semantic_type) this view renders, e.g. 'deal.won'.",
|
|
82
52
|
}),
|
|
83
|
-
type: typebox_1.Type.Optional(
|
|
84
|
-
minLength: 1,
|
|
85
|
-
maxLength: 120,
|
|
86
|
-
description: "Optional linked entity-type qualifier. Omit to match the event kind alone.",
|
|
87
|
-
})),
|
|
53
|
+
type: typebox_1.Type.Optional(EntityTypeSlug("Only events linking an entity of this type.")),
|
|
88
54
|
}, { additionalProperties: false }),
|
|
89
|
-
]
|
|
55
|
+
], {
|
|
56
|
+
description: '{ record: "<type>", id?: <entity id> }, { collection: "<type>", when? }, { workspace: true } or { event: "<kind>", type?: "<type>" }',
|
|
57
|
+
});
|
|
90
58
|
// Declared, typed URL params. Unknown params are ignored; `$collection`,
|
|
91
59
|
// `peek` and `peek_*` are reserved for shared selection and the peek pane.
|
|
92
60
|
exports.ViewParamDeclSchema = typebox_1.Type.Object({
|
|
@@ -118,6 +86,27 @@ exports.ViewActionDeclSchema = typebox_1.Type.Object({
|
|
|
118
86
|
description: "Event kind appended when the action fires, e.g. 'deal.won'.",
|
|
119
87
|
}),
|
|
120
88
|
});
|
|
89
|
+
// Everything a view declares about itself, read from its module's
|
|
90
|
+
// `export const view = defineView({...})`. The module is the only place these
|
|
91
|
+
// live: `set` takes the source and the server reads this out of it.
|
|
92
|
+
exports.ViewDefinitionSchema = typebox_1.Type.Object({
|
|
93
|
+
key: exports.ViewKeySchema,
|
|
94
|
+
name: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
95
|
+
minLength: 1,
|
|
96
|
+
maxLength: 120,
|
|
97
|
+
description: "Display name; defaults to the key.",
|
|
98
|
+
})),
|
|
99
|
+
description: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500, description: "What the view shows." })),
|
|
100
|
+
attach: typebox_1.Type.Array(exports.ViewAttachmentSchema, {
|
|
101
|
+
description: "Where the view appears.",
|
|
102
|
+
}),
|
|
103
|
+
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema, {
|
|
104
|
+
description: "Declared URL params.",
|
|
105
|
+
})),
|
|
106
|
+
actions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema, {
|
|
107
|
+
description: "Declared actions and the event kind each emits.",
|
|
108
|
+
})),
|
|
109
|
+
}, { additionalProperties: false });
|
|
121
110
|
// Public projection of a stored view: metadata only, never the bundle. The
|
|
122
111
|
// bundle travels over the view resource / shell route; the source over get.
|
|
123
112
|
exports.ViewRowSchema = typebox_1.Type.Object({
|
|
@@ -146,18 +135,12 @@ exports.ViewRowSchema = typebox_1.Type.Object({
|
|
|
146
135
|
// variant must read true for every one of them.
|
|
147
136
|
exports.SetViewAction = typebox_1.Type.Object({
|
|
148
137
|
action: typebox_1.Type.Literal("set", {
|
|
149
|
-
description: "Store a view: compile
|
|
138
|
+
description: "Store a view: read its key, name, description, attach, params and actions from the module's `export const view = defineView({...})`, compile it, and upsert by that key.",
|
|
150
139
|
}),
|
|
151
|
-
key: exports.ViewKeySchema,
|
|
152
|
-
name: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
153
|
-
maxLength: 120,
|
|
154
|
-
description: "[set] Display name; defaults to key.",
|
|
155
|
-
})),
|
|
156
|
-
description: typebox_1.Type.Optional(typebox_1.Type.String({ maxLength: 500, description: "[set] What the view shows." })),
|
|
157
140
|
source_code: typebox_1.Type.String({
|
|
158
141
|
minLength: 1,
|
|
159
142
|
maxLength: 1000000,
|
|
160
|
-
description: "[set] The view module source (TSX).
|
|
143
|
+
description: "[set] The view module source (TSX). Its `defineView({...})` argument must be a literal; it is the only place the view's key, name, description, attach, params and actions are declared.",
|
|
161
144
|
}),
|
|
162
145
|
compiled_code: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
163
146
|
minLength: 1,
|
|
@@ -165,15 +148,6 @@ exports.SetViewAction = typebox_1.Type.Object({
|
|
|
165
148
|
})),
|
|
166
149
|
source_files: typebox_1.Type.Optional(source_files_schema_1.SourceFilesSchema),
|
|
167
150
|
dependencies: typebox_1.Type.Optional(source_files_schema_1.SourceDependenciesSchema),
|
|
168
|
-
attach: typebox_1.Type.Optional(typebox_1.Type.Array(exports.ViewAttachmentSchema, {
|
|
169
|
-
description: "[set] Where the view appears; extracted from the module by the caller.",
|
|
170
|
-
})),
|
|
171
|
-
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewParamDeclSchema, {
|
|
172
|
-
description: "[set] Declared URL params.",
|
|
173
|
-
})),
|
|
174
|
-
actions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), exports.ViewActionDeclSchema, {
|
|
175
|
-
description: "[set] Declared actions and the event kind each emits.",
|
|
176
|
-
})),
|
|
177
151
|
last_writer: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
178
152
|
maxLength: 200,
|
|
179
153
|
description: "[set] Provenance; defaults to the caller.",
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { type CollectionSelection } from "./collection-selection";
|
|
2
2
|
import type { ViewAttachment } from "./manage-views";
|
|
3
3
|
type EventAttachment = Extract<ViewAttachment, {
|
|
4
|
-
|
|
4
|
+
event: string;
|
|
5
5
|
}>;
|
|
6
|
-
type ViewPlacement = "tab" | "overview";
|
|
7
|
-
/** An event's type qualifies its linked entities; it never names a page tab. */
|
|
8
6
|
export declare function isEventAttachment(attachment: ViewAttachment): attachment is EventAttachment;
|
|
9
|
-
|
|
10
|
-
export declare function
|
|
7
|
+
/** A tab on the type's list page, when the list's selection implies `when`. */
|
|
8
|
+
export declare function matchesCollection(attachment: ViewAttachment, typeSlug: string, selection?: CollectionSelection): boolean;
|
|
9
|
+
/** A card on the record's page: every record of the type, or one pinned id. */
|
|
11
10
|
export declare function matchesRecord(attachment: ViewAttachment, record: {
|
|
12
11
|
type: string;
|
|
13
12
|
id: number;
|
|
14
|
-
|
|
15
|
-
parentId: number | null;
|
|
16
|
-
}, placement: ViewPlacement): boolean;
|
|
13
|
+
}): boolean;
|
|
17
14
|
export declare function hasWorkspaceAttachment(attach: readonly ViewAttachment[]): boolean;
|
|
18
15
|
/** Without a kind, the web host considers every event attachment a candidate. */
|
|
19
16
|
export declare function eventAttachmentsFor(attach: readonly ViewAttachment[], semanticType?: string): EventAttachment[];
|
|
@@ -1,50 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isEventAttachment = isEventAttachment;
|
|
4
|
-
exports.
|
|
5
|
-
exports.matchesType = matchesType;
|
|
4
|
+
exports.matchesCollection = matchesCollection;
|
|
6
5
|
exports.matchesRecord = matchesRecord;
|
|
7
6
|
exports.hasWorkspaceAttachment = hasWorkspaceAttachment;
|
|
8
7
|
exports.eventAttachmentsFor = eventAttachmentsFor;
|
|
9
8
|
const collection_selection_1 = require("./collection-selection");
|
|
10
|
-
/** An event's type qualifies its linked entities; it never names a page tab. */
|
|
11
9
|
function isEventAttachment(attachment) {
|
|
12
|
-
return
|
|
10
|
+
return "event" in attachment;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/** A tab on the type's list page, when the list's selection implies `when`. */
|
|
13
|
+
function matchesCollection(attachment, typeSlug, selection = {}) {
|
|
14
|
+
return ("collection" in attachment &&
|
|
15
|
+
attachment.collection === typeSlug &&
|
|
16
|
+
(!attachment.when || (0, collection_selection_1.selectionImplies)(selection, attachment.when)));
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
attachment.
|
|
21
|
-
attachment.
|
|
22
|
-
(!attachment.when || (0, collection_selection_1.selectionImplies)(selection, attachment.when)) &&
|
|
23
|
-
(attachment.placement ?? "tab") === placement);
|
|
24
|
-
}
|
|
25
|
-
function matchesRecord(attachment, record, placement) {
|
|
26
|
-
if (isEventAttachment(attachment))
|
|
27
|
-
return false;
|
|
28
|
-
if ((attachment.placement ?? "tab") !== placement)
|
|
29
|
-
return false;
|
|
30
|
-
if ("entity" in attachment) {
|
|
31
|
-
return typeof attachment.entity === "number"
|
|
32
|
-
? attachment.entity === record.id
|
|
33
|
-
: record.parentId === null && attachment.entity === record.slug;
|
|
34
|
-
}
|
|
35
|
-
return ("type" in attachment &&
|
|
36
|
-
attachment.type === record.type &&
|
|
37
|
-
attachment.surface !== "collection");
|
|
18
|
+
/** A card on the record's page: every record of the type, or one pinned id. */
|
|
19
|
+
function matchesRecord(attachment, record) {
|
|
20
|
+
return ("record" in attachment &&
|
|
21
|
+
attachment.record === record.type &&
|
|
22
|
+
(attachment.id === undefined || attachment.id === record.id));
|
|
38
23
|
}
|
|
39
24
|
function hasWorkspaceAttachment(attach) {
|
|
40
|
-
return attach.some((attachment) =>
|
|
41
|
-
"workspace" in attachment &&
|
|
42
|
-
attachment.workspace === true);
|
|
25
|
+
return attach.some((attachment) => "workspace" in attachment);
|
|
43
26
|
}
|
|
44
27
|
/** Without a kind, the web host considers every event attachment a candidate. */
|
|
45
28
|
function eventAttachmentsFor(attach, semanticType) {
|
|
46
29
|
return attach
|
|
47
30
|
.filter(isEventAttachment)
|
|
48
|
-
.filter((attachment) => semanticType === undefined || attachment.
|
|
31
|
+
.filter((attachment) => semanticType === undefined || attachment.event === semanticType);
|
|
49
32
|
}
|
|
50
33
|
//# sourceMappingURL=view-attach.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ViewActionDecl, type ViewAttachment, type ViewParamDecl } from "./manage-views";
|
|
2
|
+
/** A view's declaration with its defaults applied: what the server stores and
|
|
3
|
+
* what the CLI hashes, so both derive it from the same function. */
|
|
4
|
+
export interface ViewDefinitionRecord {
|
|
5
|
+
key: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
attach: ViewAttachment[];
|
|
9
|
+
params: Record<string, ViewParamDecl>;
|
|
10
|
+
actions: Record<string, ViewActionDecl>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Read `export const view = defineView({...})` out of a view module, without
|
|
14
|
+
* running it. `js` is the module with TypeScript and JSX already stripped
|
|
15
|
+
* (esbuild `transform`); the argument must be a plain literal (objects,
|
|
16
|
+
* arrays, strings, numbers, booleans, null), so a declaration is data the
|
|
17
|
+
* server can read safely from any author's source. Throws an Error whose
|
|
18
|
+
* message names what to fix.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readViewDefinition(js: string): ViewDefinitionRecord;
|
|
21
|
+
//# sourceMappingURL=view-definition.d.ts.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readViewDefinition = readViewDefinition;
|
|
4
|
+
const value_1 = require("@sinclair/typebox/value");
|
|
5
|
+
const acorn_1 = require("acorn");
|
|
6
|
+
const manage_views_1 = require("./manage-views");
|
|
7
|
+
const VIEWS_PACKAGE = "@lobu/views";
|
|
8
|
+
/**
|
|
9
|
+
* Read `export const view = defineView({...})` out of a view module, without
|
|
10
|
+
* running it. `js` is the module with TypeScript and JSX already stripped
|
|
11
|
+
* (esbuild `transform`); the argument must be a plain literal (objects,
|
|
12
|
+
* arrays, strings, numbers, booleans, null), so a declaration is data the
|
|
13
|
+
* server can read safely from any author's source. Throws an Error whose
|
|
14
|
+
* message names what to fix.
|
|
15
|
+
*/
|
|
16
|
+
function readViewDefinition(js) {
|
|
17
|
+
let program;
|
|
18
|
+
try {
|
|
19
|
+
program = (0, acorn_1.parse)(js, {
|
|
20
|
+
ecmaVersion: "latest",
|
|
21
|
+
sourceType: "module",
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
throw new Error(`view module does not parse: ${error.message}`);
|
|
26
|
+
}
|
|
27
|
+
const callee = defineViewLocalName(program.body);
|
|
28
|
+
const argument = callee ? viewExportArgument(program.body, callee) : null;
|
|
29
|
+
if (!argument) {
|
|
30
|
+
throw new Error(`the module must export const view = defineView({ key, attach, ... }) with defineView imported from "${VIEWS_PACKAGE}"`);
|
|
31
|
+
}
|
|
32
|
+
if (!hasDefaultExport(program.body)) {
|
|
33
|
+
throw new Error("the module must have a default-export component");
|
|
34
|
+
}
|
|
35
|
+
const raw = literalValue(argument, "defineView");
|
|
36
|
+
if (!value_1.Value.Check(manage_views_1.ViewDefinitionSchema, raw)) {
|
|
37
|
+
const first = value_1.Value.Errors(manage_views_1.ViewDefinitionSchema, raw).First();
|
|
38
|
+
const at = first?.path
|
|
39
|
+
? `defineView${first.path.split("/").join(".")}`
|
|
40
|
+
: "defineView";
|
|
41
|
+
// A union (an attach entry) names the shapes it accepts, not "Expected
|
|
42
|
+
// union value".
|
|
43
|
+
const schema = first?.schema;
|
|
44
|
+
const message = schema?.anyOf && schema.description
|
|
45
|
+
? `Expected ${schema.description}`
|
|
46
|
+
: (first?.message ?? "invalid view definition");
|
|
47
|
+
throw new Error(`${at}: ${message}`);
|
|
48
|
+
}
|
|
49
|
+
const def = raw;
|
|
50
|
+
return {
|
|
51
|
+
key: def.key,
|
|
52
|
+
name: def.name?.trim() ? def.name : def.key,
|
|
53
|
+
description: def.description ?? "",
|
|
54
|
+
attach: def.attach,
|
|
55
|
+
params: def.params ?? {},
|
|
56
|
+
actions: def.actions ?? {},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function defineViewLocalName(body) {
|
|
60
|
+
for (const statement of body) {
|
|
61
|
+
if (statement.type !== "ImportDeclaration")
|
|
62
|
+
continue;
|
|
63
|
+
if (statement.source.value !== VIEWS_PACKAGE)
|
|
64
|
+
continue;
|
|
65
|
+
for (const spec of statement.specifiers) {
|
|
66
|
+
if (spec.type !== "ImportSpecifier")
|
|
67
|
+
continue;
|
|
68
|
+
const imported = spec.imported;
|
|
69
|
+
if (imported.name === "defineView" || imported.value === "defineView") {
|
|
70
|
+
return spec.local.name;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
function hasDefaultExport(body) {
|
|
77
|
+
return body.some((statement) => statement.type === "ExportDefaultDeclaration" ||
|
|
78
|
+
(statement.type === "ExportNamedDeclaration" &&
|
|
79
|
+
(statement.specifiers ?? []).some((spec) => spec.exported.name === "default")));
|
|
80
|
+
}
|
|
81
|
+
function viewExportArgument(body, callee) {
|
|
82
|
+
for (const statement of body) {
|
|
83
|
+
if (statement.type !== "ExportNamedDeclaration")
|
|
84
|
+
continue;
|
|
85
|
+
const declaration = statement.declaration;
|
|
86
|
+
if (declaration?.type !== "VariableDeclaration")
|
|
87
|
+
continue;
|
|
88
|
+
for (const declarator of declaration.declarations) {
|
|
89
|
+
if (declarator.id.name !== "view")
|
|
90
|
+
continue;
|
|
91
|
+
const init = declarator.init;
|
|
92
|
+
const args = init?.arguments;
|
|
93
|
+
if (init?.type === "CallExpression" &&
|
|
94
|
+
init.callee.type === "Identifier" &&
|
|
95
|
+
init.callee.name === callee &&
|
|
96
|
+
args?.length === 1) {
|
|
97
|
+
return args[0] ?? null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
function literalValue(node, path) {
|
|
104
|
+
switch (node.type) {
|
|
105
|
+
case "ObjectExpression": {
|
|
106
|
+
const out = {};
|
|
107
|
+
for (const prop of node.properties) {
|
|
108
|
+
if (prop.type !== "Property" ||
|
|
109
|
+
prop.kind !== "init" ||
|
|
110
|
+
prop.computed ||
|
|
111
|
+
prop.method ||
|
|
112
|
+
prop.shorthand) {
|
|
113
|
+
throw notLiteral(path, "a spread, shorthand, method or computed key");
|
|
114
|
+
}
|
|
115
|
+
const keyNode = prop.key;
|
|
116
|
+
const key = keyNode.type === "Identifier"
|
|
117
|
+
? keyNode.name
|
|
118
|
+
: typeof keyNode.value === "string" ||
|
|
119
|
+
typeof keyNode.value === "number"
|
|
120
|
+
? String(keyNode.value)
|
|
121
|
+
: null;
|
|
122
|
+
if (key === null || key === "__proto__") {
|
|
123
|
+
throw notLiteral(path, "an unsupported key");
|
|
124
|
+
}
|
|
125
|
+
out[key] = literalValue(prop.value, `${path}.${key}`);
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
case "ArrayExpression":
|
|
130
|
+
return node.elements.map((element, index) => {
|
|
131
|
+
if (!element || element.type === "SpreadElement") {
|
|
132
|
+
throw notLiteral(`${path}[${index}]`, "a hole or spread");
|
|
133
|
+
}
|
|
134
|
+
return literalValue(element, `${path}[${index}]`);
|
|
135
|
+
});
|
|
136
|
+
case "Literal":
|
|
137
|
+
if (node.regex || node.bigint !== undefined) {
|
|
138
|
+
throw notLiteral(path, "a regular expression or bigint");
|
|
139
|
+
}
|
|
140
|
+
return node.value;
|
|
141
|
+
case "UnaryExpression": {
|
|
142
|
+
const argument = node.argument;
|
|
143
|
+
if (node.operator === "-" &&
|
|
144
|
+
argument.type === "Literal" &&
|
|
145
|
+
typeof argument.value === "number") {
|
|
146
|
+
return -argument.value;
|
|
147
|
+
}
|
|
148
|
+
throw notLiteral(path, `the expression \`${node.operator}…\``);
|
|
149
|
+
}
|
|
150
|
+
case "TemplateLiteral":
|
|
151
|
+
if (node.expressions.length === 0) {
|
|
152
|
+
return (node.quasis[0]?.value)
|
|
153
|
+
.cooked;
|
|
154
|
+
}
|
|
155
|
+
throw notLiteral(path, "a template with ${…}");
|
|
156
|
+
default:
|
|
157
|
+
throw notLiteral(path, node.type === "Identifier"
|
|
158
|
+
? `the variable \`${node.name}\``
|
|
159
|
+
: `a ${node.type}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function notLiteral(path, found) {
|
|
163
|
+
return new Error(`${path} must be written out as a literal (objects, arrays, strings, numbers, booleans, null); found ${found}`);
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=view-definition.js.map
|