@lobu/runtime-server 23.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 +70 -6
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +1 -1
- package/dist/connectors/linkedin-inbox-adapter.js +4 -7
- package/dist/connectors/linkedin.ts +53 -34
- package/dist/connectors/reddit.ts +92 -20
- package/dist/connectors/slack.ts +1 -0
- package/dist/connectors/whatsapp-web-adapter.js +41 -11
- package/dist/connectors/whatsapp-web-helpers.ts +1 -1
- package/dist/connectors/whatsapp_web.ts +2 -2
- package/dist/connectors/x-identity.ts +5 -3
- 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 +63 -60
- package/dist/guest.bundle.js +362 -300
- 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-BuUzGtVL.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-w17IFTtf.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-mnTN2AZt.js → agent-card-controls-Be1Okb2C.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-Bg3hBfUV.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-BOrCXcAl.js → agent-guardrails-route-DMOjG1D4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-Dqcvky-k.js → agent-loading-shells-De_2d8Lr.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-BOo_4r_4.js → agent-permissions-matrix-gZWl6mAe.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-CCdvtlmH.js → agent-skill-context-JLaTamGR.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BUxIswuq.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-Djgp00r_.js → card-yU0TmNRH.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BYUZnyMp.js → claim-DJfTvlT2.js} +2 -2
- package/dist/owletto/dist/assets/client-rows--FrZfJol.js +2 -0
- package/dist/owletto/dist/assets/{clients-D3Zbjxin.js → clients-L4K1UT8c.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-DHeyRGZI.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-C3XXFEqh.js → connection-ByvKkyFm.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-CIJJLDP8.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-8-d8hl10.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-CdSvVCgx.js → consent-DdfINrVp.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-BdXoZAfc.js → conversations-table-BSznfdYt.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CYvgWCuv.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-CtSSeYj3.js → create-automation-form-9T5WnoUs.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-n4qGUraE.js → cronstrue-BWFEyy_P.js} +2 -2
- package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-BMp7UsMo.js → deployments-body-2xKS8gRo.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-RvUdVkj3.js → deployments-wG_8QzOF.js} +2 -2
- package/dist/owletto/dist/assets/{device-CPU6CjkJ.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-DqpH99np.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-BQVliQW1.js → index-DAOyXG1X.js} +2 -2
- package/dist/owletto/dist/assets/{index-B9uPN6FC.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-Hio-HRfo.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-ICgKp3YK.js → index-ZNlrDc_f.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-DBoag_OS.js → json-diff-DFvYINBT.js} +3 -3
- package/dist/owletto/dist/assets/{list-skeleton-C_GuoxAH.js → list-skeleton-DFsEqLU1.js} +2 -2
- package/dist/owletto/dist/assets/login-DO0j-AYr.js +2 -0
- package/dist/owletto/dist/assets/{logout-CLGgeZB7.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-dAbDgJvx.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-BkdULx2r.js → new-ByBhteWA.js} +2 -2
- package/dist/owletto/dist/assets/new-DWp3deoW.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-BxsjwgdH.js → oauth-workspace-access-D_5uESuz.js} +2 -2
- package/dist/owletto/dist/assets/{organization-gxGeDjIV.js → organization-DTFoYP4V.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-DF5iGC3c.js +2 -0
- package/dist/owletto/dist/assets/{permissions-aPHaKLec.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-D-65Pgu-.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-uX_V6bip.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-CPyzlfD1.js → source-record-panels-Cg249m1S.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-By8RZyKW.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 +3881 -3215
- package/npm-shrinkwrap.json +277 -261
- package/package.json +6 -5
- package/vendor/connector-sdk/package.json +1 -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/contracts/agent-settings.d.ts +6 -2
- package/vendor/core/dist/contracts/agent-settings.js +12 -1
- 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 +39 -2
- package/vendor/core/dist/contracts/worker/protocol.js +24 -1
- package/vendor/core/dist/index.d.ts +1 -1
- package/vendor/core/dist/index.js +2 -1
- 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/package.json +11 -5
- 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/_-3J-IrxWk.js +0 -2
- package/dist/owletto/dist/assets/_-DYUE3ix4.js +0 -3
- package/dist/owletto/dist/assets/_agentId-Bn2IAjIy.js +0 -2
- package/dist/owletto/dist/assets/_agentId-Cam7Z0N7.js +0 -2
- package/dist/owletto/dist/assets/_automationId-CXEiKVZJ.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CS85l61t.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-clVDIyW0.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-Ci2k-BuN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-B0662F8h.js +0 -2
- package/dist/owletto/dist/assets/_name-CwWePlOl.js +0 -2
- package/dist/owletto/dist/assets/_owner-dTWkrKsK.js +0 -3
- package/dist/owletto/dist/assets/_shape-BtS3y4M9.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dc9m-nlR.js +0 -2
- package/dist/owletto/dist/assets/_slug-DQHutM41.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-B30ik8ma.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CUHypQnF.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CMqYiiKM.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-B_vrqLVc.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-hTs7eO_U.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-D92imvSt.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-BJOijbT0.js +0 -6
- package/dist/owletto/dist/assets/agents-9XjpDj_S.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-Bt5QCYQ7.js +0 -2
- package/dist/owletto/dist/assets/app._appId-CKv7_squ.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-vUwVumXf.js +0 -2
- package/dist/owletto/dist/assets/automations-9XjpDj_S.js +0 -2
- package/dist/owletto/dist/assets/callback-BRgcL8gz.js +0 -2
- package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
- package/dist/owletto/dist/assets/connect-CfsFsy9P.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-DkiC8xos.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CIXrGOsT.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-Ckdz6I0y.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-CNxafNeo.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CKZjzRz6.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CadPVsI3.js +0 -2
- package/dist/owletto/dist/assets/connectors-lvLJ30lo.js +0 -2
- package/dist/owletto/dist/assets/create-0xW9eXxG.js +0 -2
- package/dist/owletto/dist/assets/create-B0qhrrX4.js +0 -2
- package/dist/owletto/dist/assets/create-CAfF-yI1.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-i6xxkWKV.js +0 -2
- package/dist/owletto/dist/assets/deployments-4Itm35Xc.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-CrjG7gPo.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Cs3ZmXWo.js +0 -2
- package/dist/owletto/dist/assets/entity-options-uXjgT7y9.js +0 -2
- package/dist/owletto/dist/assets/entity-page-Dc0LGr5U.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CwZxa0BR.js +0 -2
- package/dist/owletto/dist/assets/event-detail-ve2d6Gbb.js +0 -2
- package/dist/owletto/dist/assets/events-feed-BtvhZF1f.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Cj-v6NtH.js +0 -2
- package/dist/owletto/dist/assets/guardrails-HFo2Ut8B.js +0 -2
- package/dist/owletto/dist/assets/identity-BigVSBCl.js +0 -2
- package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
- package/dist/owletto/dist/assets/index-BfedB4Rc.js +0 -2
- package/dist/owletto/dist/assets/index-CUw3aKBI.js +0 -2
- package/dist/owletto/dist/assets/index-CXhxUkv3.js +0 -2
- package/dist/owletto/dist/assets/index-Cr5hwh-C.js +0 -7950
- package/dist/owletto/dist/assets/index-CzkTV4ZQ.js +0 -2
- package/dist/owletto/dist/assets/index-DKSx8JN_.js +0 -2
- package/dist/owletto/dist/assets/index-DVk7Ug0d.js +0 -2
- package/dist/owletto/dist/assets/index-DmZuKGf8.js +0 -2
- package/dist/owletto/dist/assets/index-cPcroOH0.js +0 -2
- package/dist/owletto/dist/assets/index-n7sTbNv4.js +0 -2
- package/dist/owletto/dist/assets/index-xiFpcWKv.js +0 -2
- package/dist/owletto/dist/assets/login-Ci6ixHuL.js +0 -2
- package/dist/owletto/dist/assets/member-scope-gate-B44INDPY.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DyQiRvzl.js +0 -103
- package/dist/owletto/dist/assets/models-DpVP7ZwX.js +0 -2
- package/dist/owletto/dist/assets/new-BUb7AnEW.js +0 -2
- package/dist/owletto/dist/assets/new-CHOr-EcI.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-CHoQHe2H.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-UcZr87_Q.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DcnlADmj.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CBXH6v1d.js +0 -2
- package/dist/owletto/dist/assets/renderer-mEDnVW0O.js +0 -97
- package/dist/owletto/dist/assets/runs-C0rCgGwX.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Du1JMjg5.js +0 -2
- package/dist/owletto/dist/assets/runs-table-syPJ6r6T.js +0 -2
- package/dist/owletto/dist/assets/settings-9NkNA1G1.js +0 -2
- package/dist/owletto/dist/assets/settings-E-10sLQX.js +0 -2
- package/dist/owletto/dist/assets/skills-D2Ri9b4f.js +0 -2
- package/dist/owletto/dist/assets/status-dot-B-EWMgq6.js +0 -2
- package/dist/owletto/dist/assets/tabs-DqIIkCX-.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CqLZQrnO.js +0 -2
- /package/vendor/postgres/{.bun-tag-f39dafdb2305d504 → .bun-tag-2f292c6554a8475e} +0 -0
|
@@ -31,9 +31,22 @@ export declare const SUGGESTION_LIMITS: {
|
|
|
31
31
|
* Normalize an untrusted `prompts` value into at most {@link SUGGESTION_LIMITS}
|
|
32
32
|
* valid `{title,message}` entries. Trims BEFORE capping length (so leading
|
|
33
33
|
* whitespace can't yield an empty displayed title), drops malformed/empty
|
|
34
|
-
* entries, and returns `[]` for any non-array input. Shared by the
|
|
35
|
-
* and
|
|
34
|
+
* entries, and returns `[]` for any non-array input. Shared by the worker
|
|
35
|
+
* and completion route so the worker (untrusted) and the server enforce one
|
|
36
36
|
* identical contract.
|
|
37
37
|
*/
|
|
38
38
|
export declare function sanitizeSuggestionPrompts(value: unknown): SuggestedPrompt[];
|
|
39
|
+
/**
|
|
40
|
+
* The follow-up question asked after a human-facing turn's reply, on the same
|
|
41
|
+
* session and model that wrote it. Asked as a side request — never appended to
|
|
42
|
+
* the conversation — so the model can use the user's language and preferences
|
|
43
|
+
* retained in its current context. Reusing the prefix enables prompt caching.
|
|
44
|
+
*/
|
|
45
|
+
export declare const FOLLOW_UP_SUGGESTIONS_PROMPT: string;
|
|
46
|
+
/**
|
|
47
|
+
* The chips in a reply to {@link FOLLOW_UP_SUGGESTIONS_PROMPT}, sanitized.
|
|
48
|
+
* Tolerates a markdown fence or prose around the object by parsing from the
|
|
49
|
+
* first `{` to the last `}`; anything unparseable is no suggestions.
|
|
50
|
+
*/
|
|
51
|
+
export declare function parseFollowUpSuggestions(reply: string): SuggestedPrompt[];
|
|
39
52
|
//# sourceMappingURL=suggestions.d.ts.map
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* `@lobu/core` import here.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.SUGGESTION_LIMITS = void 0;
|
|
12
|
+
exports.FOLLOW_UP_SUGGESTIONS_PROMPT = exports.SUGGESTION_LIMITS = void 0;
|
|
13
13
|
exports.sanitizeSuggestionPrompts = sanitizeSuggestionPrompts;
|
|
14
|
+
exports.parseFollowUpSuggestions = parseFollowUpSuggestions;
|
|
14
15
|
/** Limits enforced wherever suggestions enter or leave durable storage.
|
|
15
16
|
* `maxTitleChars` counts UTF-16 code units, matching how Slack measures its
|
|
16
17
|
* 75-char button-text cap (the tightest limit a title reaches on a surface this
|
|
@@ -28,8 +29,8 @@ exports.SUGGESTION_LIMITS = {
|
|
|
28
29
|
* Normalize an untrusted `prompts` value into at most {@link SUGGESTION_LIMITS}
|
|
29
30
|
* valid `{title,message}` entries. Trims BEFORE capping length (so leading
|
|
30
31
|
* whitespace can't yield an empty displayed title), drops malformed/empty
|
|
31
|
-
* entries, and returns `[]` for any non-array input. Shared by the
|
|
32
|
-
* and
|
|
32
|
+
* entries, and returns `[]` for any non-array input. Shared by the worker
|
|
33
|
+
* and completion route so the worker (untrusted) and the server enforce one
|
|
33
34
|
* identical contract.
|
|
34
35
|
*/
|
|
35
36
|
function sanitizeSuggestionPrompts(value) {
|
|
@@ -59,6 +60,50 @@ function sanitizeSuggestionPrompts(value) {
|
|
|
59
60
|
}
|
|
60
61
|
return out;
|
|
61
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* The follow-up question asked after a human-facing turn's reply, on the same
|
|
65
|
+
* session and model that wrote it. Asked as a side request — never appended to
|
|
66
|
+
* the conversation — so the model can use the user's language and preferences
|
|
67
|
+
* retained in its current context. Reusing the prefix enables prompt caching.
|
|
68
|
+
*/
|
|
69
|
+
exports.FOLLOW_UP_SUGGESTIONS_PROMPT = [
|
|
70
|
+
"Before the user replies: decide whether your last reply needs follow-up action chips the user can tap.",
|
|
71
|
+
'Default to {"prompts":[]} when your reply leaves nothing open.',
|
|
72
|
+
'If your reply offers concrete next steps ("If you want, I can …", "Want me to …?"), turn up to three distinct offers into chips.',
|
|
73
|
+
"Otherwise offer a chip only for a concrete next step your reply leaves open that would help the user proceed.",
|
|
74
|
+
"Return no suggestions for routine answers, acknowledgements, corrections, a finished request with nothing left open, a question the user must answer in their own words, or a reply that closes the topic, and none at all if the user asked for no suggestions.",
|
|
75
|
+
"Do not invent extra work or add a generic offer to explore further.",
|
|
76
|
+
"When useful next steps remain, return 1-3 distinct actions. A single useful action is enough; never pad the list.",
|
|
77
|
+
"",
|
|
78
|
+
'Each item is {"title","message"}:',
|
|
79
|
+
'- "title": a short tappable label, at most 20 characters.',
|
|
80
|
+
'- "message": the full message sent verbatim AS THE USER if tapped.',
|
|
81
|
+
"",
|
|
82
|
+
"Write both in the language the user writes in. Write `message` in the user's voice, as a request to you:",
|
|
83
|
+
' good: "Show me the diff" bad: "I can show you the diff"',
|
|
84
|
+
'Do not call any tool. Reply with STRICT JSON {"prompts":[{"title":"...","message":"..."}]} and nothing else.',
|
|
85
|
+
].join("\n");
|
|
86
|
+
/**
|
|
87
|
+
* The chips in a reply to {@link FOLLOW_UP_SUGGESTIONS_PROMPT}, sanitized.
|
|
88
|
+
* Tolerates a markdown fence or prose around the object by parsing from the
|
|
89
|
+
* first `{` to the last `}`; anything unparseable is no suggestions.
|
|
90
|
+
*/
|
|
91
|
+
function parseFollowUpSuggestions(reply) {
|
|
92
|
+
const start = reply.indexOf("{");
|
|
93
|
+
const end = reply.lastIndexOf("}");
|
|
94
|
+
if (start < 0 || end <= start)
|
|
95
|
+
return [];
|
|
96
|
+
let parsed;
|
|
97
|
+
try {
|
|
98
|
+
parsed = JSON.parse(reply.slice(start, end + 1));
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
if (!parsed || typeof parsed !== "object")
|
|
104
|
+
return [];
|
|
105
|
+
return sanitizeSuggestionPrompts(parsed.prompts);
|
|
106
|
+
}
|
|
62
107
|
/**
|
|
63
108
|
* Truncate to at most `maxUnits` UTF-16 code units without splitting a
|
|
64
109
|
* surrogate pair. Counting code POINTS would undercount against platform caps
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SecretRef } from "./secret-refs";
|
|
2
|
+
import type { SuggestedPrompt } from "./suggestions";
|
|
2
3
|
/**
|
|
3
4
|
* Unified authentication profile for any model provider.
|
|
4
5
|
* Persisted per-(userId, agentId) by the gateway's UserAuthProfileStore;
|
|
@@ -30,9 +31,23 @@ export interface AuthProfile {
|
|
|
30
31
|
/** Durable secret reference for the refresh token. */
|
|
31
32
|
refreshTokenRef?: SecretRef;
|
|
32
33
|
accountId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Refresh suspension set by the token-refresh job when the provider
|
|
36
|
+
* reports the grant itself is dead (`invalid_grant`). Suspended profiles
|
|
37
|
+
* are excluded from token refresh and credential selection until the user
|
|
38
|
+
* reconnects, which writes fresh metadata without this field.
|
|
39
|
+
*/
|
|
40
|
+
refreshSuspended?: {
|
|
41
|
+
/** Provider OAuth error code that killed the grant. */
|
|
42
|
+
code: string;
|
|
43
|
+
/** Epoch ms when the suspension was recorded. */
|
|
44
|
+
at: number;
|
|
45
|
+
};
|
|
33
46
|
};
|
|
34
47
|
createdAt: number;
|
|
35
48
|
}
|
|
49
|
+
/** True when the token-refresh job suspended this profile's grant as dead. */
|
|
50
|
+
export declare function isRefreshSuspended(profile: AuthProfile): boolean;
|
|
36
51
|
/** True if the profile has any credential source (resolved or ref). */
|
|
37
52
|
export declare function hasCredentialSource(profile: AuthProfile): boolean;
|
|
38
53
|
/**
|
|
@@ -234,6 +249,17 @@ export interface ThreadResponsePayload {
|
|
|
234
249
|
* duplicate of the reply and must always surface.
|
|
235
250
|
*/
|
|
236
251
|
repliedInBand?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Follow-up chips for this reply, proposed by the model that wrote it. Set
|
|
254
|
+
* only on the COMPLETION row; delivered with the reply once output
|
|
255
|
+
* guardrails pass.
|
|
256
|
+
*/
|
|
257
|
+
suggestions?: SuggestedPrompt[];
|
|
258
|
+
/**
|
|
259
|
+
* The agent_turn `runs.id` that produced this terminal row. Orders a late
|
|
260
|
+
* terminal against newer turns of the same conversation.
|
|
261
|
+
*/
|
|
262
|
+
turnRunId?: number;
|
|
237
263
|
/**
|
|
238
264
|
* Raw error message. When provider context is available, the gateway labels
|
|
239
265
|
* the source and unwraps the common JSON message envelope without rewording
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SUGGESTION_LIMITS = exports.sanitizeSuggestionPrompts = void 0;
|
|
4
|
+
exports.isRefreshSuspended = isRefreshSuspended;
|
|
4
5
|
exports.hasCredentialSource = hasCredentialSource;
|
|
6
|
+
/** True when the token-refresh job suspended this profile's grant as dead. */
|
|
7
|
+
function isRefreshSuspended(profile) {
|
|
8
|
+
return Boolean(profile.metadata?.refreshSuspended);
|
|
9
|
+
}
|
|
5
10
|
/** True if the profile has any credential source (resolved or ref). */
|
|
6
11
|
function hasCredentialSource(profile) {
|
|
7
12
|
return Boolean(profile.credential || profile.credentialRef);
|
package/vendor/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Core types and utilities for Lobu agent platform",
|
|
6
6
|
"repository": {
|
|
@@ -221,6 +221,11 @@
|
|
|
221
221
|
"import": "./dist/contracts/tools/view-attach.js",
|
|
222
222
|
"require": "./dist/contracts/tools/view-attach.js"
|
|
223
223
|
},
|
|
224
|
+
"./contracts/tools/view-definition": {
|
|
225
|
+
"types": "./dist/contracts/tools/view-definition.d.ts",
|
|
226
|
+
"import": "./dist/contracts/tools/view-definition.js",
|
|
227
|
+
"require": "./dist/contracts/tools/view-definition.js"
|
|
228
|
+
},
|
|
224
229
|
"./contracts/tools/view-path": {
|
|
225
230
|
"types": "./dist/contracts/tools/view-path.d.ts",
|
|
226
231
|
"import": "./dist/contracts/tools/view-path.js",
|
|
@@ -233,14 +238,15 @@
|
|
|
233
238
|
}
|
|
234
239
|
},
|
|
235
240
|
"dependencies": {
|
|
236
|
-
"@sinclair/typebox": "^0.34.41",
|
|
237
|
-
"ajv": "^8.17.1",
|
|
238
|
-
"ajv-formats": "^3.0.1",
|
|
239
241
|
"@opentelemetry/api": "^1.9.0",
|
|
240
|
-
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
241
242
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.222.0",
|
|
242
243
|
"@opentelemetry/resources": "^2.11.0",
|
|
244
|
+
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
243
245
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
246
|
+
"@sinclair/typebox": "^0.34.41",
|
|
247
|
+
"acorn": "^8.16.0",
|
|
248
|
+
"ajv": "^8.17.1",
|
|
249
|
+
"ajv-formats": "^3.0.1",
|
|
244
250
|
"winston": "^3.17.0"
|
|
245
251
|
}
|
|
246
252
|
}
|
|
@@ -159,6 +159,14 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
159
159
|
if (terminated)
|
|
160
160
|
return queryError(q, Errors.connection('CONNECTION_DESTROYED', options))
|
|
161
161
|
|
|
162
|
+
if (!socket) {
|
|
163
|
+
// A stale reservation can execute after closed() clears the socket.
|
|
164
|
+
// Do not signal backpressure: this connection cannot emit a drain event
|
|
165
|
+
// to resume queries queued behind the rejected write.
|
|
166
|
+
queryError(q, Errors.connection('CONNECTION_CLOSED', options))
|
|
167
|
+
return true
|
|
168
|
+
}
|
|
169
|
+
|
|
162
170
|
if (stream)
|
|
163
171
|
return queryError(q, Errors.generic('COPY_IN_PROGRESS', 'You cannot execute queries during copy'))
|
|
164
172
|
|
|
@@ -254,6 +262,16 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
254
262
|
}
|
|
255
263
|
|
|
256
264
|
function nextWrite(fn) {
|
|
265
|
+
if (!socket) {
|
|
266
|
+
// Cursor and COPY writes can still arrive after closed() clears the
|
|
267
|
+
// socket. A throw from this timer would be an uncaughtException, so
|
|
268
|
+
// reject the pending queries instead. Report no backpressure: a closed
|
|
269
|
+
// socket never emits the drain event that would resume them.
|
|
270
|
+
nextWriteTimer !== null && clearImmediate(nextWriteTimer)
|
|
271
|
+
chunk = nextWriteTimer = null
|
|
272
|
+
error(Errors.connection('CONNECTION_CLOSED', options))
|
|
273
|
+
return true
|
|
274
|
+
}
|
|
257
275
|
const x = socket.write(chunk, fn)
|
|
258
276
|
nextWriteTimer !== null && clearImmediate(nextWriteTimer)
|
|
259
277
|
chunk = nextWriteTimer = null
|
|
@@ -157,6 +157,14 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
157
157
|
if (terminated)
|
|
158
158
|
return queryError(q, Errors.connection('CONNECTION_DESTROYED', options))
|
|
159
159
|
|
|
160
|
+
if (!socket) {
|
|
161
|
+
// A stale reservation can execute after closed() clears the socket.
|
|
162
|
+
// Do not signal backpressure: this connection cannot emit a drain event
|
|
163
|
+
// to resume queries queued behind the rejected write.
|
|
164
|
+
queryError(q, Errors.connection('CONNECTION_CLOSED', options))
|
|
165
|
+
return true
|
|
166
|
+
}
|
|
167
|
+
|
|
160
168
|
if (stream)
|
|
161
169
|
return queryError(q, Errors.generic('COPY_IN_PROGRESS', 'You cannot execute queries during copy'))
|
|
162
170
|
|
|
@@ -252,6 +260,16 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
252
260
|
}
|
|
253
261
|
|
|
254
262
|
function nextWrite(fn) {
|
|
263
|
+
if (!socket) {
|
|
264
|
+
// Cursor and COPY writes can still arrive after closed() clears the
|
|
265
|
+
// socket. A throw from this timer would be an uncaughtException, so
|
|
266
|
+
// reject the pending queries instead. Report no backpressure: a closed
|
|
267
|
+
// socket never emits the drain event that would resume them.
|
|
268
|
+
nextWriteTimer !== null && clearImmediate(nextWriteTimer)
|
|
269
|
+
chunk = nextWriteTimer = null
|
|
270
|
+
error(Errors.connection('CONNECTION_CLOSED', options))
|
|
271
|
+
return true
|
|
272
|
+
}
|
|
255
273
|
const x = socket.write(chunk, fn)
|
|
256
274
|
nextWriteTimer !== null && clearImmediate(nextWriteTimer)
|
|
257
275
|
chunk = nextWriteTimer = null
|
|
@@ -157,6 +157,14 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
157
157
|
if (terminated)
|
|
158
158
|
return queryError(q, Errors.connection('CONNECTION_DESTROYED', options))
|
|
159
159
|
|
|
160
|
+
if (!socket) {
|
|
161
|
+
// A stale reservation can execute after closed() clears the socket.
|
|
162
|
+
// Do not signal backpressure: this connection cannot emit a drain event
|
|
163
|
+
// to resume queries queued behind the rejected write.
|
|
164
|
+
queryError(q, Errors.connection('CONNECTION_CLOSED', options))
|
|
165
|
+
return true
|
|
166
|
+
}
|
|
167
|
+
|
|
160
168
|
if (stream)
|
|
161
169
|
return queryError(q, Errors.generic('COPY_IN_PROGRESS', 'You cannot execute queries during copy'))
|
|
162
170
|
|
|
@@ -252,6 +260,16 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
|
252
260
|
}
|
|
253
261
|
|
|
254
262
|
function nextWrite(fn) {
|
|
263
|
+
if (!socket) {
|
|
264
|
+
// Cursor and COPY writes can still arrive after closed() clears the
|
|
265
|
+
// socket. A throw from this timer would be an uncaughtException, so
|
|
266
|
+
// reject the pending queries instead. Report no backpressure: a closed
|
|
267
|
+
// socket never emits the drain event that would resume them.
|
|
268
|
+
nextWriteTimer !== null && clearImmediate(nextWriteTimer)
|
|
269
|
+
chunk = nextWriteTimer = null
|
|
270
|
+
error(Errors.connection('CONNECTION_CLOSED', options))
|
|
271
|
+
return true
|
|
272
|
+
}
|
|
255
273
|
const x = socket.write(chunk, fn)
|
|
256
274
|
nextWriteTimer !== null && clearImmediate(nextWriteTimer)
|
|
257
275
|
chunk = nextWriteTimer = null
|
|
@@ -20,14 +20,17 @@
|
|
|
20
20
|
* that capability keep params local to the frame.
|
|
21
21
|
*
|
|
22
22
|
* Read budget: reads run on a user-facing path, when the host is ready and
|
|
23
|
-
* the query changes
|
|
23
|
+
* the query changes, `refetch()` is called, or a live query receives a host
|
|
24
|
+
* data-change notification.
|
|
24
25
|
* `query_sql` runs in a read-only, org-scoped transaction with a 5 second
|
|
25
26
|
* statement timeout and returns at most 500 rows; `useQuery` reports a hit as
|
|
26
27
|
* `errorCode: "UPSTREAM_TIMEOUT"` or `truncated: true`, so render those
|
|
27
|
-
* states instead of an empty or partial table.
|
|
28
|
-
*
|
|
29
|
-
* `
|
|
30
|
-
*
|
|
28
|
+
* states instead of an empty or partial table. Each cell is bounded too
|
|
29
|
+
* (strings to a 4,000-code-point head plus a suffix, JSON values to 16 KiB);
|
|
30
|
+
* `truncatedColumns` names the columns where a returned cell was cut.
|
|
31
|
+
* Never aggregate history in a view: no `GROUP BY`, `DISTINCT ON`, per-row
|
|
32
|
+
* regexp, or leading-wildcard `LIKE` over `events` (or any other table that
|
|
33
|
+
* grows with history). History grows; the answer a view shows does not.
|
|
31
34
|
*
|
|
32
35
|
* For "latest state" views, compute state at write time. One event-based
|
|
33
36
|
* pattern is an Automation bound to the entity declaring a keyed event output
|
|
@@ -68,7 +71,7 @@ export type Params = Record<string, ParamValue>;
|
|
|
68
71
|
* ```tsx
|
|
69
72
|
* export const view = defineView({
|
|
70
73
|
* key: "deal-won",
|
|
71
|
-
* attach: [{
|
|
74
|
+
* attach: [{ event: "deal.won", type: "deal" }],
|
|
72
75
|
* });
|
|
73
76
|
*
|
|
74
77
|
* export default function DealWon() {
|
|
@@ -106,20 +109,38 @@ export interface ParamDef {
|
|
|
106
109
|
};
|
|
107
110
|
}
|
|
108
111
|
/**
|
|
109
|
-
* Where a view appears:
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
112
|
+
* Where a view appears: one page per entry.
|
|
113
|
+
*
|
|
114
|
+
* - `{ record: "deal" }` — a card on every deal's page, above its activity;
|
|
115
|
+
* `{ record: "deal", id: 7 }` pins it to one record. The card renders
|
|
116
|
+
* `inline`; "See all" (`requestDisplayMode("fullscreen")`) or the card's
|
|
117
|
+
* Open shows the same view fullscreen in the peek.
|
|
118
|
+
* - `{ collection: "deal", when? }` — a tab on the deal list page. `when`
|
|
119
|
+
* equalities must all be present in scope.collection.filters; they control
|
|
120
|
+
* discoverability, never authorization.
|
|
121
|
+
* - `{ workspace: true }` — a tab on the Data hub.
|
|
122
|
+
* - `{ event: "deal.won", type? }` — one event's page, optionally only when
|
|
123
|
+
* the event links an entity of `type`.
|
|
117
124
|
*/
|
|
118
125
|
export type Attachment = ViewAttachment;
|
|
126
|
+
/** How the host is showing the view: a card in a page (`inline`) or the
|
|
127
|
+
* view's own surface (`fullscreen`: the peek, a full page, a tab). */
|
|
128
|
+
export type DisplayMode = "inline" | "fullscreen";
|
|
129
|
+
/** The space the host gives the frame. Width is fixed or capped; an inline
|
|
130
|
+
* card's `maxHeight` is the height budget past which the host clips. */
|
|
131
|
+
export interface Container {
|
|
132
|
+
width?: number;
|
|
133
|
+
maxWidth?: number;
|
|
134
|
+
height?: number;
|
|
135
|
+
maxHeight?: number;
|
|
136
|
+
}
|
|
119
137
|
export interface ViewDefinition {
|
|
120
138
|
/** View key: the single namespace of keys (no `custom:` prefix). Required —
|
|
121
139
|
* it is the identity `invoke_view_action` and the shell route key on. */
|
|
122
140
|
key: string;
|
|
141
|
+
/** Display name; defaults to the key when the view is saved. */
|
|
142
|
+
name?: string;
|
|
143
|
+
description?: string;
|
|
123
144
|
/** Where the view appears. The attach line lives in the module; there are
|
|
124
145
|
* no attach/detach verbs. */
|
|
125
146
|
attach: Attachment[];
|
|
@@ -138,7 +159,25 @@ export declare function useHost(): {
|
|
|
138
159
|
connected: boolean;
|
|
139
160
|
ready: boolean;
|
|
140
161
|
theme: "light" | "dark";
|
|
162
|
+
/**
|
|
163
|
+
* Ask the host to open `url`. A relative URL (`"deal/acme-renewal"`, a
|
|
164
|
+
* record's `<type>/<slug>`) resolves against the workspace root, so the same
|
|
165
|
+
* link works on every page and in every host; a full URL opens outside the
|
|
166
|
+
* app. The frame is sandboxed, so this is the only way a view navigates;
|
|
167
|
+
* rejects when the host declines.
|
|
168
|
+
*/
|
|
169
|
+
openLink: (url: string) => Promise<void>;
|
|
170
|
+
/** `inline` as a card on a page, `fullscreen` as the view's own surface.
|
|
171
|
+
* Render a summary inline and the full view fullscreen. */
|
|
172
|
+
displayMode: DisplayMode;
|
|
173
|
+
container: Container;
|
|
174
|
+
/** Ask the host for another mode ("See all" → `"fullscreen"`). Resolves with
|
|
175
|
+
* the mode the host set, which stays the current one when it declines. */
|
|
176
|
+
requestDisplayMode: (mode: DisplayMode) => Promise<DisplayMode>;
|
|
141
177
|
};
|
|
178
|
+
/** The workspace root relative links resolve against: the shell's
|
|
179
|
+
* `lobu-workspace` meta, absent outside a server-rendered shell. */
|
|
180
|
+
export declare function resolveViewHref(href: string): string;
|
|
142
181
|
/**
|
|
143
182
|
* Tagged template: scalar values are rendered as escaped SQL literals,
|
|
144
183
|
* never spliced raw. Numbers must be finite, booleans map to true/false,
|
|
@@ -170,9 +209,10 @@ export declare function tool(name: string, args?: Record<string, unknown>): Tool
|
|
|
170
209
|
* reports a thrown script as `success: false` — both would otherwise render as
|
|
171
210
|
* "no rows". The server's typed code rides along as `errorCode`, and a capped
|
|
172
211
|
* result (`query_sql`'s `has_more`, `query_sdk`'s `return_truncated`) is
|
|
173
|
-
* flagged `truncated` instead of passing as the whole answer
|
|
212
|
+
* flagged `truncated` instead of passing as the whole answer, and a
|
|
213
|
+
* `query_sql` cell bounded by its size limits is named in `truncatedColumns`.
|
|
174
214
|
*/
|
|
175
|
-
export declare function queryResult<T>(kind: "sql" | "sdk" | "tool", result: ToolResult): Pick<QueryState<T>, "data" | "error" | "errorCode" | "truncated">;
|
|
215
|
+
export declare function queryResult<T>(kind: "sql" | "sdk" | "tool", result: ToolResult): Pick<QueryState<T>, "data" | "error" | "errorCode" | "truncated" | "truncatedColumns">;
|
|
176
216
|
export interface QueryState<T> {
|
|
177
217
|
data: T | null;
|
|
178
218
|
error: string | null;
|
|
@@ -184,16 +224,30 @@ export interface QueryState<T> {
|
|
|
184
224
|
* rows (fewer past its response-size ceiling) and `query_sdk` drops an
|
|
185
225
|
* oversized return value. `data` is then not the whole result. */
|
|
186
226
|
truncated: boolean;
|
|
227
|
+
/** `query_sql` columns where a returned cell was bounded: a string cut to
|
|
228
|
+
* its first 4,000 Unicode code points plus "… [truncated]", or a JSON value
|
|
229
|
+
* over 16 KiB replaced by `{ _truncated: true, bytes }` (attachments become
|
|
230
|
+
* null with attachments_truncated). Show those cells as too large, or select
|
|
231
|
+
* smaller elements or fields, e.g. `jsonb_array_elements(metadata->'items')`.
|
|
232
|
+
* Paginate as needed; each returned cell is still subject to these limits. */
|
|
233
|
+
truncatedColumns: string[];
|
|
187
234
|
loading: boolean;
|
|
188
235
|
refetch: () => void;
|
|
189
236
|
}
|
|
237
|
+
export interface QueryOptions {
|
|
238
|
+
/** Re-read in the background whenever workspace data changes (default
|
|
239
|
+
* true). Pass false for a read that reaches a remote source, such as a
|
|
240
|
+
* `feeds.readMany` search: it then runs once per query and again only on
|
|
241
|
+
* `refetch()`. */
|
|
242
|
+
live?: boolean;
|
|
243
|
+
}
|
|
190
244
|
/**
|
|
191
245
|
* Run a read through the host. `sql\`…\`` → `query_sql`; a string →
|
|
192
246
|
* `query_sdk` script; `tool(name, args)` → that tool; `null` skips. The first
|
|
193
247
|
* fetch waits for the host's first `tool-input`: reads before it run against
|
|
194
248
|
* defaults and double-fetch when the real scope lands.
|
|
195
249
|
*/
|
|
196
|
-
export declare function useQuery<T = unknown>(query: SqlQuery | ToolQuery | string | null): QueryState<T>;
|
|
250
|
+
export declare function useQuery<T = unknown>(query: SqlQuery | ToolQuery | string | null, options?: QueryOptions): QueryState<T>;
|
|
197
251
|
export interface ActionResult {
|
|
198
252
|
ok: boolean;
|
|
199
253
|
error: string | null;
|