@lobu/runtime-server 24.2.0 → 24.3.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 +24 -2
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/gchat.ts +31 -1
- package/dist/connectors/postgres.ts +9 -5
- package/dist/dependencies.bun.lock +104 -167
- package/dist/owletto/dist/assets/_-XKF0m81R.js +3 -0
- package/dist/owletto/dist/assets/_-e8MbEBtw.js +2 -0
- package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-emObu67X.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CfFFAYK1.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-D3vuAQPe.js +2 -0
- package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +2 -0
- package/dist/owletto/dist/assets/_name-DjtJMop4.js +2 -0
- package/dist/owletto/dist/assets/_owner-oBX68rb9.js +3 -0
- package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +2 -0
- package/dist/owletto/dist/assets/{_slug-MHQU8ftJ.js → _slug-B2g5qzn3.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-38lHBvjO.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-_G_lDz5K.js → activity-route-view-voRYSM3a.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-DiU7Un5w.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-BgyLhJCo.js → agent-client-setup-list-Bkyw22GW.js} +4 -4
- package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-QrIDroFL.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CyoGSxcZ.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-jkf9DjdO.js → agent-loading-shells-CamDtzHY.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-C8j8kRB1.js → agent-permissions-matrix-CgsQ8BK_.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B9giw2u2.js → agent-skill-context-lWbXKEm1.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BMZ3r1bP.js → agent-skills-route-D-w3tY_2.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-D49f-bzP.js → agent-subpage-shell-CLqpn5Tb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-BGHYHWDO.js → agent-thread-CsRexwTv.js} +4 -4
- package/dist/owletto/dist/assets/agents-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CmGrMvPC.js +2 -0
- package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +121 -0
- package/dist/owletto/dist/assets/{app._appId-A51tx2jU.js → app._appId-BO7G38fL.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-DCAZBKle.js → automation-detail-content-DMYxs6F6.js} +2 -2
- package/dist/owletto/dist/assets/automations-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/calendar-DDCCSPW6.js +2 -0
- package/dist/owletto/dist/assets/{callback-WmyCei3R.js → callback-DFciMR8u.js} +2 -2
- package/dist/owletto/dist/assets/{card-Cspo-4M6.js → card-BCsbrdGs.js} +2 -2
- package/dist/owletto/dist/assets/{claim-CCKdBtFt.js → claim-BRua2b_7.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-CmK3DkSP.js → client-activity-scopes-BLIy1Zc3.js} +2 -2
- package/dist/owletto/dist/assets/client-rows-DiJQ5D1z.js +2 -0
- package/dist/owletto/dist/assets/clients-8-EpRjsm.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-C8FJbT2P.js → code-editor-BFZa4EIt.js} +2 -2
- package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D2K4tmvW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-BTI5JXA3.js +2 -0
- package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +2 -0
- package/dist/owletto/dist/assets/connections-browser-BMV8bf54.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-DqZA-FdG.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-bmBJJ9B4.js → connector-provenance-BIg8P8WY.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists-B44Q9W-j.js → connector-scope-lists-CJYz53YF.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CTWPDH8f.js → connectors-BroKpwhB.js} +2 -2
- package/dist/owletto/dist/assets/{consent-C_WBfmQ8.js → consent-fzLN-Qy7.js} +2 -2
- package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-CoJ5Splc.js → core.esm-A1UnFbGs.js} +2 -2
- package/dist/owletto/dist/assets/create-BjwsYarn.js +2 -0
- package/dist/owletto/dist/assets/create-Dzr4mlr0.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-DHW6OUoS.js +3 -0
- package/dist/owletto/dist/assets/create-c94SPL21.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CeUS_78Q.js → cronstrue-xxpD1P2-.js} +2 -2
- package/dist/owletto/dist/assets/{device-Br9JHadR.js → device-C3AEoL5c.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B_te59GE.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +2 -0
- package/dist/owletto/dist/assets/{entity-avatar-BZIa-7i5.js → entity-avatar-CEV4ttUQ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-DJv2EhVV.js +2 -0
- package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +2 -0
- package/dist/owletto/dist/assets/event-card-CBlsG32u.js +2 -0
- package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +2 -0
- package/dist/owletto/dist/assets/events-feed-VfU4csn2.js +2 -0
- package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
- package/dist/owletto/dist/assets/filter-bar-COU0sBFQ.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-C1Q_jEzD.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +2 -0
- package/dist/owletto/dist/assets/identity-BaFLmbSo.js +2 -0
- package/dist/owletto/dist/assets/index-008wj-Pz.js +7950 -0
- package/dist/owletto/dist/assets/index-BaetvYLa.js +2 -0
- package/dist/owletto/dist/assets/index-BiEf5xOE.css +1 -0
- package/dist/owletto/dist/assets/index-BrDP4PCs.js +2 -0
- package/dist/owletto/dist/assets/index-BuXIeK7D.js +2 -0
- package/dist/owletto/dist/assets/index-CAVcR9za.js +2 -0
- package/dist/owletto/dist/assets/index-CMLfWGPU.js +2 -0
- package/dist/owletto/dist/assets/index-D0YEYP7N.js +2 -0
- package/dist/owletto/dist/assets/{index-BhBYXtEN.js → index-DFyBbp7b.js} +2 -2
- package/dist/owletto/dist/assets/{index-DRbaESbJ.js → index-DNtYqkiA.js} +2 -2
- package/dist/owletto/dist/assets/index-DQxzeM37.js +2 -0
- package/dist/owletto/dist/assets/index-DkO0nPex.js +2 -0
- package/dist/owletto/dist/assets/index-KlRId0g6.js +2 -0
- package/dist/owletto/dist/assets/index-Ywnqi4A6.js +2 -0
- package/dist/owletto/dist/assets/index-xnxhf3Op.js +2 -0
- package/dist/owletto/dist/assets/{index-Bhop_otG.js → index-yIub2xUM.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-4sMmayDd.js → json-diff-LE_vNZrM.js} +4 -4
- package/dist/owletto/dist/assets/{list-skeleton-BafzvpOM.js → list-skeleton-Kzxi2OXB.js} +2 -2
- package/dist/owletto/dist/assets/login-DWOT6jtS.js +2 -0
- package/dist/owletto/dist/assets/logout-Dt_VDilG.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-Dit3MXBQ.js → member-scope-gate-De75CR7W.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-BeFuFH7p.js → model-selector-3l9lY50C.js} +2 -2
- package/dist/owletto/dist/assets/model-udnQ_S43.js +2 -0
- package/dist/owletto/dist/assets/models-CQj7GIOp.js +2 -0
- package/dist/owletto/dist/assets/new-BOwIHkre.js +2 -0
- package/dist/owletto/dist/assets/{new-ChwqLmVY.js → new-BbdwuJPm.js} +2 -2
- package/dist/owletto/dist/assets/new-DTuFCQhV.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-D15LYKSe.js → oauth-workspace-access-QPo4YwRX.js} +2 -2
- package/dist/owletto/dist/assets/{organization-CoUJYXx7.js → organization-BDzjnqPf.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +2 -0
- package/dist/owletto/dist/assets/{permissions-C6UFdvz2.js → permissions-CfoY4WFY.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-CmLy1MZf.js → proposal-review-shell-CVkLnnKo.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +2 -0
- package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +2 -0
- package/dist/owletto/dist/assets/{record-session-CJzFoVKc.js → record-session-D07szzqN.js} +2 -2
- package/dist/owletto/dist/assets/{linked-record-peek-B0_B4PnF.js → renderer-AJxSmE3-.js} +30 -30
- package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +2 -0
- package/dist/owletto/dist/assets/{runs-B0zVYb-w.js → runs-lG2ChtOt.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-DcJqbCrU.js → schema-type-editor-panel-C_Es0qDf.js} +2 -2
- package/dist/owletto/dist/assets/settings-CEAOg7fr.js +2 -0
- package/dist/owletto/dist/assets/{settings-Dg0D_l_w.js → settings-gGYXbFfd.js} +2 -2
- package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CjFPgKKJ.js +2 -0
- package/dist/owletto/dist/assets/{status-dot-_LQZmEIX.js → status-dot-CSBtKT4g.js} +2 -2
- package/dist/owletto/dist/assets/table-DHM-vCxP.js +2 -0
- package/dist/owletto/dist/assets/use-automations-C4TSie1i.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CAFbh-Dk.js → use-mention-search-PfZrNbu_.js} +2 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-D-fJx_Md.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-2ubIf_3N.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +99167 -97912
- package/npm-shrinkwrap.json +537 -896
- package/package.json +7 -10
- package/vendor/@better-auth-kysely-adapter/.bun-tag-abf95749a412716 +0 -0
- package/vendor/@better-auth-kysely-adapter/LICENSE.md +20 -0
- package/vendor/@better-auth-kysely-adapter/README.md +17 -0
- package/vendor/@better-auth-kysely-adapter/dist/bun-sqlite-dialect-DoOVo4ja.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/d1-sqlite-dialect-Cru74LbR.mjs +133 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.d.mts +116 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.mjs +719 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.d.mts +27 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/sqlite-introspector-DSCAP82F.mjs +90 -0
- package/vendor/@better-auth-kysely-adapter/package.json +52 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +29 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -1
- package/vendor/connector-sdk/dist/index.js +4 -0
- package/vendor/connector-sdk/dist/redact.d.ts +10 -0
- package/vendor/connector-sdk/dist/redact.js +130 -0
- package/vendor/connector-sdk/dist/types.d.ts +2 -1
- package/vendor/connector-sdk/package.json +6 -1
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +6 -0
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +1 -1
- package/vendor/core/dist/contracts/worker/device-automation.js +1 -1
- package/vendor/core/dist/errors.d.ts +0 -20
- package/vendor/core/dist/errors.js +1 -25
- package/vendor/core/dist/otel.js +38 -10
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/package.json +26 -5
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-Cjvw31gU.js +0 -2
- package/dist/owletto/dist/assets/_-iToIRRFt.js +0 -3
- package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +0 -2
- package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +0 -2
- package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +0 -2
- package/dist/owletto/dist/assets/_name-BsOZmvlH.js +0 -2
- package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +0 -3
- package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +0 -2
- package/dist/owletto/dist/assets/agents-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +0 -2
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
- package/dist/owletto/dist/assets/automations-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +0 -2
- package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +0 -2
- package/dist/owletto/dist/assets/connection-DJd9bnEc.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-IO6G5QjL.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +0 -2
- package/dist/owletto/dist/assets/copy-button-kcjg8Giw.js +0 -2
- package/dist/owletto/dist/assets/create-CQE5rD0i.js +0 -2
- package/dist/owletto/dist/assets/create-DQNlRTUX.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +0 -3
- package/dist/owletto/dist/assets/create-lOFSQV_5.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +0 -2
- package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +0 -2
- package/dist/owletto/dist/assets/event-detail-C25TvOb_.js +0 -2
- package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +0 -2
- package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +0 -2
- package/dist/owletto/dist/assets/identity-BkK8ggdp.js +0 -2
- package/dist/owletto/dist/assets/index-Bw5iV_J7.js +0 -2
- package/dist/owletto/dist/assets/index-C3dpyynY.js +0 -2
- package/dist/owletto/dist/assets/index-C3zAbslo.js +0 -2
- package/dist/owletto/dist/assets/index-CGKN_WN_.js +0 -2
- package/dist/owletto/dist/assets/index-CgRaCOzW.js +0 -2
- package/dist/owletto/dist/assets/index-DfIoxD5Q.js +0 -2
- package/dist/owletto/dist/assets/index-DijuudSs.js +0 -2
- package/dist/owletto/dist/assets/index-Dr7bouPX.css +0 -1
- package/dist/owletto/dist/assets/index-JmEl29py.js +0 -7950
- package/dist/owletto/dist/assets/index-NK2VKPoL.js +0 -2
- package/dist/owletto/dist/assets/index-_5qsmBkt.js +0 -2
- package/dist/owletto/dist/assets/index-qkOKpRYs.js +0 -2
- package/dist/owletto/dist/assets/index-wzYkECAe.js +0 -2
- package/dist/owletto/dist/assets/login-XL5XxN6y.js +0 -2
- package/dist/owletto/dist/assets/logout-CMxdhLbM.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +0 -74
- package/dist/owletto/dist/assets/models-BAVaDnKN.js +0 -2
- package/dist/owletto/dist/assets/new-1QLuS1o-.js +0 -2
- package/dist/owletto/dist/assets/new-D21LGMl6.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +0 -2
- package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +0 -2
- package/dist/owletto/dist/assets/reset-password-Y-WO77iR.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +0 -2
- package/dist/owletto/dist/assets/runs-table-9OVdfPXZ.js +0 -2
- package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +0 -2
- package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +0 -2
- package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +0 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DatabaseConnection, DatabaseIntrospector, Dialect, DialectAdapter, Driver, Kysely, QueryCompiler } from "kysely";
|
|
2
|
+
import { DatabaseSync } from "node:sqlite";
|
|
3
|
+
|
|
4
|
+
//#region src/node-sqlite-dialect.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Config for the SQLite dialect.
|
|
7
|
+
*/
|
|
8
|
+
interface NodeSqliteDialectConfig {
|
|
9
|
+
/**
|
|
10
|
+
* A sqlite DatabaseSync instance or a function that returns one.
|
|
11
|
+
*/
|
|
12
|
+
database: DatabaseSync;
|
|
13
|
+
/**
|
|
14
|
+
* Called once when the first query is executed.
|
|
15
|
+
*/
|
|
16
|
+
onCreateConnection?: ((connection: DatabaseConnection) => Promise<void>) | undefined;
|
|
17
|
+
}
|
|
18
|
+
declare class NodeSqliteDialect implements Dialect {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(config: NodeSqliteDialectConfig);
|
|
21
|
+
createDriver(): Driver;
|
|
22
|
+
createQueryCompiler(): QueryCompiler;
|
|
23
|
+
createAdapter(): DialectAdapter;
|
|
24
|
+
createIntrospector(db: Kysely<any>): DatabaseIntrospector;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { NodeSqliteDialect, NodeSqliteDialectConfig };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { t as createSqliteIntrospector } from "./sqlite-introspector-DSCAP82F.mjs";
|
|
2
|
+
import { CompiledQuery, DefaultQueryCompiler } from "kysely";
|
|
3
|
+
//#region src/node-sqlite-dialect.ts
|
|
4
|
+
var NodeSqliteAdapter = class {
|
|
5
|
+
get supportsCreateIfNotExists() {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
get supportsTransactionalDdl() {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
get supportsReturning() {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
async acquireMigrationLock() {}
|
|
15
|
+
async releaseMigrationLock() {}
|
|
16
|
+
get supportsOutput() {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var NodeSqliteDriver = class {
|
|
21
|
+
#config;
|
|
22
|
+
#connectionMutex = new ConnectionMutex();
|
|
23
|
+
#db;
|
|
24
|
+
#connection;
|
|
25
|
+
constructor(config) {
|
|
26
|
+
this.#config = { ...config };
|
|
27
|
+
}
|
|
28
|
+
async init() {
|
|
29
|
+
this.#db = this.#config.database;
|
|
30
|
+
this.#connection = new NodeSqliteConnection(this.#db);
|
|
31
|
+
if (this.#config.onCreateConnection) await this.#config.onCreateConnection(this.#connection);
|
|
32
|
+
}
|
|
33
|
+
async acquireConnection() {
|
|
34
|
+
await this.#connectionMutex.lock();
|
|
35
|
+
return this.#connection;
|
|
36
|
+
}
|
|
37
|
+
async beginTransaction(connection) {
|
|
38
|
+
await connection.executeQuery(CompiledQuery.raw("begin"));
|
|
39
|
+
}
|
|
40
|
+
async commitTransaction(connection) {
|
|
41
|
+
await connection.executeQuery(CompiledQuery.raw("commit"));
|
|
42
|
+
}
|
|
43
|
+
async rollbackTransaction(connection) {
|
|
44
|
+
await connection.executeQuery(CompiledQuery.raw("rollback"));
|
|
45
|
+
}
|
|
46
|
+
async releaseConnection() {
|
|
47
|
+
this.#connectionMutex.unlock();
|
|
48
|
+
}
|
|
49
|
+
async destroy() {
|
|
50
|
+
this.#db?.close();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var NodeSqliteConnection = class {
|
|
54
|
+
#db;
|
|
55
|
+
constructor(db) {
|
|
56
|
+
this.#db = db;
|
|
57
|
+
}
|
|
58
|
+
executeQuery(compiledQuery) {
|
|
59
|
+
const { sql, parameters } = compiledQuery;
|
|
60
|
+
const stmt = this.#db.prepare(sql);
|
|
61
|
+
const params = parameters;
|
|
62
|
+
if (stmt.columns().length > 0) return Promise.resolve({ rows: stmt.all(...params) });
|
|
63
|
+
const { changes, lastInsertRowid } = stmt.run(...params);
|
|
64
|
+
return Promise.resolve({
|
|
65
|
+
rows: [],
|
|
66
|
+
numAffectedRows: BigInt(changes),
|
|
67
|
+
insertId: typeof lastInsertRowid === "bigint" ? lastInsertRowid : BigInt(lastInsertRowid)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async *streamQuery() {
|
|
71
|
+
throw new Error("Streaming query is not supported by SQLite driver.");
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var ConnectionMutex = class {
|
|
75
|
+
#promise;
|
|
76
|
+
#resolve;
|
|
77
|
+
async lock() {
|
|
78
|
+
while (this.#promise !== void 0) await this.#promise;
|
|
79
|
+
this.#promise = new Promise((resolve) => {
|
|
80
|
+
this.#resolve = resolve;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
unlock() {
|
|
84
|
+
const resolve = this.#resolve;
|
|
85
|
+
this.#promise = void 0;
|
|
86
|
+
this.#resolve = void 0;
|
|
87
|
+
resolve?.();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var NodeSqliteQueryCompiler = class extends DefaultQueryCompiler {
|
|
91
|
+
getCurrentParameterPlaceholder() {
|
|
92
|
+
return "?";
|
|
93
|
+
}
|
|
94
|
+
getLeftIdentifierWrapper() {
|
|
95
|
+
return "\"";
|
|
96
|
+
}
|
|
97
|
+
getRightIdentifierWrapper() {
|
|
98
|
+
return "\"";
|
|
99
|
+
}
|
|
100
|
+
getAutoIncrement() {
|
|
101
|
+
return "autoincrement";
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var NodeSqliteDialect = class {
|
|
105
|
+
#config;
|
|
106
|
+
constructor(config) {
|
|
107
|
+
this.#config = { ...config };
|
|
108
|
+
}
|
|
109
|
+
createDriver() {
|
|
110
|
+
return new NodeSqliteDriver(this.#config);
|
|
111
|
+
}
|
|
112
|
+
createQueryCompiler() {
|
|
113
|
+
return new NodeSqliteQueryCompiler();
|
|
114
|
+
}
|
|
115
|
+
createAdapter() {
|
|
116
|
+
return new NodeSqliteAdapter();
|
|
117
|
+
}
|
|
118
|
+
createIntrospector(db) {
|
|
119
|
+
return createSqliteIntrospector(db);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { NodeSqliteDialect };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { sql } from "kysely";
|
|
2
|
+
//#region src/kysely-migration-tables.ts
|
|
3
|
+
/**
|
|
4
|
+
* Kysely's internal migration table names, mirrored as local constants.
|
|
5
|
+
*
|
|
6
|
+
* Kysely 0.29 moved these from its main entry to the `kysely/migration`
|
|
7
|
+
* subpath (which 0.28 lacks), and the main entry now exports only type stubs
|
|
8
|
+
* with no runtime value, which breaks strict ESM bundlers.
|
|
9
|
+
*
|
|
10
|
+
* The values are stable parts of Kysely's public migration contract. Mirroring
|
|
11
|
+
* them allows the SQLite dialects to support both Kysely 0.28 and 0.29.
|
|
12
|
+
*
|
|
13
|
+
* TODO: Import these from `kysely/migration` after dropping Kysely 0.28.
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_MIGRATION_TABLE = "kysely_migration";
|
|
16
|
+
const DEFAULT_MIGRATION_LOCK_TABLE = "kysely_migration_lock";
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/sqlite-introspector.ts
|
|
19
|
+
function sqliteIntegerPrimaryKeyColumn(columns) {
|
|
20
|
+
const primaryKeys = columns.filter((column) => column.pk > 0);
|
|
21
|
+
const primaryKey = primaryKeys.length === 1 ? primaryKeys[0] : void 0;
|
|
22
|
+
return primaryKey?.type.toLowerCase() === "integer" ? primaryKey.name : void 0;
|
|
23
|
+
}
|
|
24
|
+
async function sqliteGeneratedPrimaryKeyColumn(db, name, columns) {
|
|
25
|
+
const column = sqliteIntegerPrimaryKeyColumn(columns);
|
|
26
|
+
if (!column) return;
|
|
27
|
+
const { rows } = await sql`
|
|
28
|
+
PRAGMA index_list(${sql.id(name)})
|
|
29
|
+
`.execute(db.withoutPlugins());
|
|
30
|
+
return rows.some((index) => index.origin === "pk") ? void 0 : column;
|
|
31
|
+
}
|
|
32
|
+
function toSqliteTableMetadata(table, columns, autoIncrementColumn) {
|
|
33
|
+
return {
|
|
34
|
+
name: table.name,
|
|
35
|
+
isView: table.type === "view",
|
|
36
|
+
columns: columns.map((column) => ({
|
|
37
|
+
name: column.name,
|
|
38
|
+
dataType: column.type,
|
|
39
|
+
isNullable: column.notnull === 0,
|
|
40
|
+
isAutoIncrementing: column.name === autoIncrementColumn,
|
|
41
|
+
hasDefaultValue: column.dflt_value != null
|
|
42
|
+
}))
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async function readTableMetadata(db, name) {
|
|
46
|
+
const { rows: columns } = await sql`
|
|
47
|
+
PRAGMA table_info(${sql.id(name)})
|
|
48
|
+
`.execute(db.withoutPlugins());
|
|
49
|
+
if (columns.length === 0) return;
|
|
50
|
+
const generatedColumn = await sqliteGeneratedPrimaryKeyColumn(db, name, columns);
|
|
51
|
+
return toSqliteTableMetadata({ name }, columns, generatedColumn);
|
|
52
|
+
}
|
|
53
|
+
async function introspectSqliteTables(db, tableNames) {
|
|
54
|
+
if (tableNames.length === 0) return [];
|
|
55
|
+
try {
|
|
56
|
+
return await db.introspection.getTables();
|
|
57
|
+
} catch {
|
|
58
|
+
return (await Promise.all(tableNames.map((name) => readTableMetadata(db, name)))).filter((table) => table !== void 0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function createSqliteIntrospector(db) {
|
|
62
|
+
const systemDb = db;
|
|
63
|
+
async function getSchemas() {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
async function getTables(options = { withInternalKyselyTables: false }) {
|
|
67
|
+
let query = systemDb.selectFrom("sqlite_schema").where("type", "=", "table").where("name", "not like", "sqlite_%").select("name");
|
|
68
|
+
if (!options.withInternalKyselyTables) query = query.where("name", "!=", DEFAULT_MIGRATION_TABLE).where("name", "!=", DEFAULT_MIGRATION_LOCK_TABLE);
|
|
69
|
+
const tables = await query.execute();
|
|
70
|
+
return Promise.all(tables.map(async ({ name }) => {
|
|
71
|
+
const columns = await db.selectFrom(sql`pragma_table_info(${name})`.as("table_info")).select([
|
|
72
|
+
"cid",
|
|
73
|
+
"name",
|
|
74
|
+
"type",
|
|
75
|
+
"notnull",
|
|
76
|
+
"dflt_value",
|
|
77
|
+
"pk"
|
|
78
|
+
]).execute();
|
|
79
|
+
const generatedColumn = await sqliteGeneratedPrimaryKeyColumn(db, name, columns);
|
|
80
|
+
return toSqliteTableMetadata({ name }, columns, generatedColumn);
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
getSchemas,
|
|
85
|
+
getTables,
|
|
86
|
+
getMetadata: async (options) => ({ tables: await getTables(options) })
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { DEFAULT_MIGRATION_LOCK_TABLE as a, toSqliteTableMetadata as i, introspectSqliteTables as n, DEFAULT_MIGRATION_TABLE as o, sqliteIntegerPrimaryKeyColumn as r, createSqliteIntrospector as t };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@better-auth/kysely-adapter",
|
|
3
|
+
"version": "1.7.7",
|
|
4
|
+
"description": "Kysely adapter for Better Auth",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://www.better-auth.com/docs/adapters/kysely",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/better-auth/better-auth.git",
|
|
11
|
+
"directory": "packages/kysely-adapter"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"auth",
|
|
15
|
+
"kysely",
|
|
16
|
+
"adapter",
|
|
17
|
+
"typescript",
|
|
18
|
+
"better-auth"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"main": "./dist/index.mjs",
|
|
28
|
+
"module": "./dist/index.mjs",
|
|
29
|
+
"types": "./dist/index.d.mts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"dev-source": "./src/index.ts",
|
|
33
|
+
"types": "./dist/index.d.mts",
|
|
34
|
+
"default": "./dist/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"./node-sqlite-dialect": {
|
|
37
|
+
"dev-source": "./src/node-sqlite-dialect.ts",
|
|
38
|
+
"types": "./dist/node-sqlite-dialect.d.mts",
|
|
39
|
+
"default": "./dist/node-sqlite-dialect.mjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@better-auth/utils": "0.4.2",
|
|
44
|
+
"kysely": "^0.28.17 || ^0.29.0",
|
|
45
|
+
"@better-auth/core": "^1.7.7"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"kysely": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -182,6 +182,30 @@ export interface ConnectorRuntimeInfo {
|
|
|
182
182
|
packages: string[];
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* `app_installation` deliveries authenticated by a Google-signed bearer JWT
|
|
187
|
+
* (Google Chat) instead of an HMAC. `{appId}` in {@link signers} is replaced
|
|
188
|
+
* by the value of {@link appIdKey}.
|
|
189
|
+
*/
|
|
190
|
+
export interface ConnectorWebhookGoogleJwtVerification {
|
|
191
|
+
type: 'google-jwt';
|
|
192
|
+
/**
|
|
193
|
+
* Env var holding the receiving app's id (the Google Cloud project number).
|
|
194
|
+
* It is the installs' `provider_app_id`; when unset the provider is not
|
|
195
|
+
* registered and its app-webhook endpoint answers 404.
|
|
196
|
+
*/
|
|
197
|
+
appIdKey: string;
|
|
198
|
+
/**
|
|
199
|
+
* Token audiences to accept, either of which verifies:
|
|
200
|
+
* - `'app_id'` — a JWT self-signed by one of {@link signers} with `aud` = the
|
|
201
|
+
* app id, checked against that service account's published keys.
|
|
202
|
+
* - `'endpoint_url'` — a Google OIDC ID token with `aud` = this provider's
|
|
203
|
+
* public app-webhook URL and a verified `email` in {@link signers}.
|
|
204
|
+
*/
|
|
205
|
+
audiences: Array<'app_id' | 'endpoint_url'>;
|
|
206
|
+
/** Google service-account emails allowed to sign a delivery. */
|
|
207
|
+
signers: string[];
|
|
208
|
+
}
|
|
185
209
|
/**
|
|
186
210
|
* Declarative scheme the gateway uses to verify an inbound provider webhook in
|
|
187
211
|
* the request hot path — no connector code runs before the 202 ack. The shared
|
|
@@ -189,6 +213,11 @@ export interface ConnectorRuntimeInfo {
|
|
|
189
213
|
* at connect time and stored on the connection.
|
|
190
214
|
*/
|
|
191
215
|
export interface ConnectorWebhookSchema {
|
|
216
|
+
/**
|
|
217
|
+
* Non-HMAC verification for `app_installation` deliveries. When set, the HMAC
|
|
218
|
+
* fields below are not used and no webhook secret is resolved.
|
|
219
|
+
*/
|
|
220
|
+
verification?: ConnectorWebhookGoogleJwtVerification;
|
|
192
221
|
/**
|
|
193
222
|
* Request header carrying the provider's HMAC signature over the raw body,
|
|
194
223
|
* e.g. `x-hub-signature-256` (GitHub), `linear-signature`. Omit for providers
|
|
@@ -15,7 +15,7 @@ import { validateEntityMetrics } from './metrics.js';
|
|
|
15
15
|
export { validateEntityMetrics };
|
|
16
16
|
export type { Dimension, EntityMetrics, EventSet, FactMatchRule, Measure, MetricReadMode, MetricTier, Segment, } from './metrics.js';
|
|
17
17
|
export type { ConnectorActionSpec, ConnectorClass, ConnectorFeedSpec, ConnectorSpec, } from './define-connector.js';
|
|
18
|
-
export type { ActionContext, ActionDefinition, ActionResult, ApprovalStatus, AuthArtifact, AuthContext, AuthResult, Connection, ConnectorAgentTooling, ConnectorAgentToolingEnv, ConnectorAuthAppInstallation, ConnectorAuthBrowser, ConnectorAuthEnvField, ConnectorAuthEnvKeys, ConnectorAuthInteractive, ConnectorAuthMethod, ConnectorAuthNone, ConnectorAuthOAuth, ConnectorAuthSchema, ConnectorDefinition, ConnectorInstallationContext, ConnectorOperations, ConnectorRuntimeInfo, ConnectorWebhookSchema, ContentItem, EntityIdentitySpec, EntityLinkPredicate, EntityTraitSpec, EventAttributionRole, EventAttributionRule, EventAttributionTargetSpec, EventEnvelope, Feed, FeedDefinition, FeedOperation, FeedObserveContext, FeedReadContext, FeedReadHandler, FeedReadResult, FeedReadMatch, FeedReadWindow, FeedReadWindowCoverage, FeedSyncHandler, FeedWebhookDeclaration, EntityTypeContribution, QueryContext, QueryResult, ReflectContext, ReflectedMeasure, ReflectResult, Run, RunStatus, RunType, RuntimeConnectorDefinition, RuntimeFeedDefinition, RuntimeFeedWebhook, SyncContext, SyncCredentials, SyncResult, WebhookRecordContext, WebhookRecordNormalizer, WebhookRegistration, WebhookRegistrationContext, } from './connector-types.js';
|
|
18
|
+
export type { ActionContext, ActionDefinition, ActionResult, ApprovalStatus, AuthArtifact, AuthContext, AuthResult, Connection, ConnectorAgentTooling, ConnectorAgentToolingEnv, ConnectorAuthAppInstallation, ConnectorAuthBrowser, ConnectorAuthEnvField, ConnectorAuthEnvKeys, ConnectorAuthInteractive, ConnectorAuthMethod, ConnectorAuthNone, ConnectorAuthOAuth, ConnectorAuthSchema, ConnectorDefinition, ConnectorInstallationContext, ConnectorOperations, ConnectorRuntimeInfo, ConnectorWebhookGoogleJwtVerification, ConnectorWebhookSchema, ContentItem, EntityIdentitySpec, EntityLinkPredicate, EntityTraitSpec, EventAttributionRole, EventAttributionRule, EventAttributionTargetSpec, EventEnvelope, Feed, FeedDefinition, FeedOperation, FeedObserveContext, FeedReadContext, FeedReadHandler, FeedReadResult, FeedReadMatch, FeedReadWindow, FeedReadWindowCoverage, FeedSyncHandler, FeedWebhookDeclaration, EntityTypeContribution, QueryContext, QueryResult, ReflectContext, ReflectedMeasure, ReflectResult, Run, RunStatus, RunType, RuntimeConnectorDefinition, RuntimeFeedDefinition, RuntimeFeedWebhook, SyncContext, SyncCredentials, SyncResult, WebhookRecordContext, WebhookRecordNormalizer, WebhookRegistration, WebhookRegistrationContext, } from './connector-types.js';
|
|
19
19
|
import { normalizeAuthUserId, normalizeEmail, normalizeEmailDomain, normalizeIdentifier, normalizePhone } from './identity-normalize.js';
|
|
20
20
|
export { normalizeAuthUserId, normalizeEmail, normalizeEmailDomain, normalizeIdentifier, normalizePhone, };
|
|
21
21
|
export type { IdentityNamespace, IdentityNamespaceDefinition, IdentityNormalizerKind, IdentitySubjectKind, } from './identity-namespaces.js';
|
|
@@ -58,4 +58,6 @@ export type { FileDelta, FileSystemSource, Snapshot } from './file-source.js';
|
|
|
58
58
|
export { connect } from './net.js';
|
|
59
59
|
export type { ConnectFn, Socket, SocketAddress, SocketOptions, } from './net.js';
|
|
60
60
|
export { assertFeedReadWindow, validateFeedReadWindow } from './feed-read-window.js';
|
|
61
|
+
export { isSecretOutputKey, redactOutput } from './redact.js';
|
|
62
|
+
export { scrubDiagnosticValue } from '@lobu/core/diagnostic-scrubber';
|
|
61
63
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -46,4 +46,8 @@ export { extensionNetworkSync } from './extension-network.js';
|
|
|
46
46
|
// =============================================================================
|
|
47
47
|
export { connect } from './net.js';
|
|
48
48
|
export { assertFeedReadWindow, validateFeedReadWindow } from './feed-read-window.js';
|
|
49
|
+
// The worker's output redaction catalog, shared so a connector that returns
|
|
50
|
+
// third-party text (logs, messages) can scrub it with the same patterns.
|
|
51
|
+
export { isSecretOutputKey, redactOutput } from './redact.js';
|
|
52
|
+
export { scrubDiagnosticValue } from '@lobu/core/diagnostic-scrubber';
|
|
49
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redact secrets from connector output before it leaves the worker.
|
|
3
|
+
*
|
|
4
|
+
* Patterns are deliberately broad — false positives are preferred to leaking a
|
|
5
|
+
* real credential into the runs table. Add new patterns here when a connector
|
|
6
|
+
* surfaces a new sensitive shape.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isSecretOutputKey(key: string): boolean;
|
|
9
|
+
export declare function redactOutput(text: string): string;
|
|
10
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redact secrets from connector output before it leaves the worker.
|
|
3
|
+
*
|
|
4
|
+
* Patterns are deliberately broad — false positives are preferred to leaking a
|
|
5
|
+
* real credential into the runs table. Add new patterns here when a connector
|
|
6
|
+
* surfaces a new sensitive shape.
|
|
7
|
+
*/
|
|
8
|
+
const REDACTED = '[REDACTED]';
|
|
9
|
+
// Keep this module dependency-free: it is also bundled into connector isolates.
|
|
10
|
+
// Match credential suffixes even in concatenated names such as PGPASSWORD.
|
|
11
|
+
// The token scanner bounds the work; requiring a prefix delimiter loses secrets.
|
|
12
|
+
const SECRET_KEY = /(?:api[_-]?key|access[_-]?token|refresh[_-]?token|id[_-]?token|auth[_-]?token|client[_-]?secret|secret(?:[_-]access)?[_-]?key|private[_-]?key|token|secret|password|passwd|credentials?|authorization|auth|bearer|cookies?|set[_-]cookie|session[_-]?id)s?$/i;
|
|
13
|
+
export function isSecretOutputKey(key) {
|
|
14
|
+
const normalized = key.replace(/([a-z0-9])([A-Z])/g, '$1_$2');
|
|
15
|
+
return SECRET_KEY.test(key) || SECRET_KEY.test(normalized) ||
|
|
16
|
+
(key.toUpperCase().includes('AWS_') && /(?:KEY|TOKEN|SECRET)$/i.test(key));
|
|
17
|
+
}
|
|
18
|
+
function quotedValueEnd(text, start, delimiter) {
|
|
19
|
+
const quote = delimiter.at(-1);
|
|
20
|
+
const escapes = delimiter.length - 1;
|
|
21
|
+
// A quote closes embedded JSON only at the opening delimiter's escaping layer.
|
|
22
|
+
let end = start;
|
|
23
|
+
while (end < text.length) {
|
|
24
|
+
const runStart = end;
|
|
25
|
+
while (text[end] === '\\')
|
|
26
|
+
end++;
|
|
27
|
+
if (text[end] === quote && (end - runStart) % (2 * (escapes + 1)) === escapes) {
|
|
28
|
+
return end - escapes;
|
|
29
|
+
}
|
|
30
|
+
if (end < text.length)
|
|
31
|
+
end++;
|
|
32
|
+
}
|
|
33
|
+
return end;
|
|
34
|
+
}
|
|
35
|
+
// Consume whole key tokens once, then scan only explicitly assigned secret values.
|
|
36
|
+
// A length threshold misses short passwords; unbounded key-search regexes can
|
|
37
|
+
// repeatedly rescan long malformed log lines.
|
|
38
|
+
function redactAssignments(text) {
|
|
39
|
+
const keys = /[\w.-]+/g;
|
|
40
|
+
const assignment = /(\\*["'])?\s*[:=]\s*(\\*["'])?/y;
|
|
41
|
+
const authScheme = /(?:Bearer|Basic)\s+/iy;
|
|
42
|
+
const parts = [];
|
|
43
|
+
let copied = 0;
|
|
44
|
+
let key;
|
|
45
|
+
while ((key = keys.exec(text))) {
|
|
46
|
+
if (!isSecretOutputKey(key[0]))
|
|
47
|
+
continue;
|
|
48
|
+
assignment.lastIndex = keys.lastIndex;
|
|
49
|
+
const separator = assignment.exec(text);
|
|
50
|
+
if (!separator)
|
|
51
|
+
continue;
|
|
52
|
+
const start = assignment.lastIndex;
|
|
53
|
+
const delimiter = separator[2];
|
|
54
|
+
let end = start;
|
|
55
|
+
let replacement = REDACTED;
|
|
56
|
+
if (!delimiter && text.startsWith(REDACTED, start)) {
|
|
57
|
+
keys.lastIndex = start + REDACTED.length;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (delimiter) {
|
|
61
|
+
end = quotedValueEnd(text, start, delimiter);
|
|
62
|
+
}
|
|
63
|
+
else if (text[start] === '{' || text[start] === '[') {
|
|
64
|
+
// Secret containers hide every descendant, even those with ordinary keys.
|
|
65
|
+
let depth = 0;
|
|
66
|
+
do {
|
|
67
|
+
const quoteStart = end;
|
|
68
|
+
while (text[end] === '\\')
|
|
69
|
+
end++;
|
|
70
|
+
if (text[end] === '"' || text[end] === "'") {
|
|
71
|
+
const quote = text.slice(quoteStart, end + 1);
|
|
72
|
+
end = quotedValueEnd(text, end + 1, quote) + quote.length;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (text[end] === '{' || text[end] === '[')
|
|
76
|
+
depth++;
|
|
77
|
+
if (text[end] === '}' || text[end] === ']')
|
|
78
|
+
depth--;
|
|
79
|
+
end++;
|
|
80
|
+
} while (depth > 0 && end < text.length);
|
|
81
|
+
const quote = separator[1] ?? '"';
|
|
82
|
+
replacement = `${quote}${REDACTED}${quote}`;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// An unquoted authentication value includes its scheme and credential.
|
|
86
|
+
// Removing only the scheme would hide it from later token redaction.
|
|
87
|
+
authScheme.lastIndex = start;
|
|
88
|
+
if (authScheme.test(text))
|
|
89
|
+
end = authScheme.lastIndex;
|
|
90
|
+
while (end < text.length && !/[\s,;&}\]"']/.test(text[end]))
|
|
91
|
+
end++;
|
|
92
|
+
}
|
|
93
|
+
if (end > start) {
|
|
94
|
+
parts.push(text.slice(copied, start), replacement);
|
|
95
|
+
copied = end;
|
|
96
|
+
}
|
|
97
|
+
keys.lastIndex = end;
|
|
98
|
+
}
|
|
99
|
+
parts.push(text.slice(copied));
|
|
100
|
+
return parts.join('');
|
|
101
|
+
}
|
|
102
|
+
const PATTERNS = [
|
|
103
|
+
// HTTP Authorization header (e.g. "Authorization: Bearer abc...") — match
|
|
104
|
+
// the rest of the line so multi-token schemes like "Bearer xxx" get caught.
|
|
105
|
+
{ regex: /Authorization:[^\r\n]+/gi, replacement: `Authorization: ${REDACTED}` },
|
|
106
|
+
// Cookie / Set-Cookie header — same line-eating shape.
|
|
107
|
+
{ regex: /(Set-)?Cookie:[^\r\n]+/gi, replacement: `$1Cookie: ${REDACTED}` },
|
|
108
|
+
// Bearer tokens anywhere (URL-safe-base64 style values)
|
|
109
|
+
{ regex: /Bearer\s+[\w\-.~+/=]+/gi, replacement: `Bearer ${REDACTED}` },
|
|
110
|
+
// JWT shape (eyJ...header.payload.sig)
|
|
111
|
+
{ regex: /eyJ[\w\-]+\.[\w\-]+\.[\w\-]+/g, replacement: REDACTED },
|
|
112
|
+
// Google OAuth access token shape (ya29.<varies>) — high-confidence.
|
|
113
|
+
{ regex: /ya29\.[\w\-.]{20,}/g, replacement: REDACTED },
|
|
114
|
+
// Bound the scheme search so a long non-URI token is not rescanned at every
|
|
115
|
+
// character. Retain the scheme, username and host for diagnostics.
|
|
116
|
+
{
|
|
117
|
+
regex: /([a-z][a-z0-9+.-]{0,63}:\/\/[^:/\s]+):([^@/\s]+)@/gi,
|
|
118
|
+
replacement: `$1:${REDACTED}@`,
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
export function redactOutput(text) {
|
|
122
|
+
if (!text)
|
|
123
|
+
return text;
|
|
124
|
+
let result = redactAssignments(text);
|
|
125
|
+
for (const { regex, replacement } of PATTERNS) {
|
|
126
|
+
result = result.replace(regex, replacement);
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -38,7 +38,8 @@ export interface Env {
|
|
|
38
38
|
GOOGLE_CLIENT_SECRET?: string;
|
|
39
39
|
APPLE_CLIENT_ID?: string;
|
|
40
40
|
APPLE_CLIENT_SECRET?: string;
|
|
41
|
-
|
|
41
|
+
CLOUDFLARE_EMAIL_ACCOUNT_ID?: string;
|
|
42
|
+
CLOUDFLARE_EMAIL_API_TOKEN?: string;
|
|
42
43
|
EMAIL_FROM_AUTH?: string;
|
|
43
44
|
EMAIL_FROM_INVITES?: string;
|
|
44
45
|
EMAIL_REPLY_TO?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/connector-sdk",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.3.0",
|
|
4
4
|
"description": "Lobu memory SDK — build pluggable connectors for Lobu memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -75,10 +75,15 @@
|
|
|
75
75
|
"./device-manifest-hash": {
|
|
76
76
|
"types": "./dist/device-manifest-hash.d.ts",
|
|
77
77
|
"import": "./dist/device-manifest-hash.js"
|
|
78
|
+
},
|
|
79
|
+
"./redact": {
|
|
80
|
+
"types": "./dist/redact.d.ts",
|
|
81
|
+
"import": "./dist/redact.js"
|
|
78
82
|
}
|
|
79
83
|
},
|
|
80
84
|
"files": [
|
|
81
85
|
"dist",
|
|
86
|
+
"src/redact.ts",
|
|
82
87
|
"!**/*.map"
|
|
83
88
|
],
|
|
84
89
|
"sideEffects": false,
|
|
@@ -30,6 +30,12 @@ export type ToolErrorCode =
|
|
|
30
30
|
| "VALIDATION"
|
|
31
31
|
/** Denied by org-scope / cross-org visibility rules. */
|
|
32
32
|
| "PERMISSION"
|
|
33
|
+
/**
|
|
34
|
+
* `manage_entity update` sent `manual_edit: true`, but the caller may not
|
|
35
|
+
* assert a person's edit: it lacks the `entities:manual_edit` scope, or an
|
|
36
|
+
* agent, MCP session or Automation is behind the call (HTTP 403).
|
|
37
|
+
*/
|
|
38
|
+
| "MANUAL_EDIT_NOT_ALLOWED"
|
|
33
39
|
/** Upstream throttled the request (HTTP 429 / too many requests). */
|
|
34
40
|
| "RATE_LIMITED"
|
|
35
41
|
/** Upstream request or DB statement timed out (e.g. PG 57014). */
|
|
@@ -50,6 +50,10 @@ exports.TOOL_ERRORS = {
|
|
|
50
50
|
retryable: false,
|
|
51
51
|
message: "Not permitted in this organization scope.",
|
|
52
52
|
},
|
|
53
|
+
MANUAL_EDIT_NOT_ALLOWED: {
|
|
54
|
+
retryable: false,
|
|
55
|
+
message: "This caller may not assert a manual edit; it needs the entities:manual_edit scope and no agent, MCP session or Automation behind it.",
|
|
56
|
+
},
|
|
53
57
|
RATE_LIMITED: {
|
|
54
58
|
retryable: true,
|
|
55
59
|
message: "The upstream rate limit was hit; retry shortly.",
|
|
@@ -122,7 +122,7 @@ exports.AutomationScheduleTriggerSchema = typebox_1.Type.Object({
|
|
|
122
122
|
})),
|
|
123
123
|
skip_if_unchanged: typebox_1.Type.Optional(typebox_1.Type.Boolean({
|
|
124
124
|
default: true,
|
|
125
|
-
description: "
|
|
125
|
+
description: "Book a due window with no new or changed source content as a no-op run instead of dispatching an agent. Applies to native dispatch and to external claimNextWindow, which answers 409 for a skipped window.",
|
|
126
126
|
})),
|
|
127
127
|
}, { additionalProperties: false });
|
|
128
128
|
exports.AutomationTriggerSchema = typebox_1.Type.Union([
|
|
@@ -114,7 +114,7 @@ exports.ManageEntitySchemaSchema = typebox_1.Type.Object({
|
|
|
114
114
|
interactions: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Object({ emits: typebox_1.Type.String() }))),
|
|
115
115
|
})),
|
|
116
116
|
], {
|
|
117
|
-
description: "[entity_type: create/update] Event semantic types this type produces, keyed by semantic_type slug. Each entry can have a description, optional metadataSchema (JSON Schema), optional jsonTemplate (the event card's render template), and optional interactions registry mapping template action names to emitted event kinds. Author interactive dashboards as React views attached to the kind (views.set with attach [{
|
|
117
|
+
description: "[entity_type: create/update] Event semantic types this type produces, keyed by semantic_type slug. Each entry can have a description, optional metadataSchema (JSON Schema), optional jsonTemplate (the event card's render template), and optional interactions registry mapping template action names to emitted event kinds. Author interactive dashboards as React views attached to the kind (views.set with attach [{ event: '<kind>' }]), not as jsonTemplate. Supplying an object replaces the entire registry: read the current value and merge before updating. `null` clears all kinds; omit to leave unchanged.",
|
|
118
118
|
})),
|
|
119
119
|
backing: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Null(), exports.BackingInputSchema], {
|
|
120
120
|
description: "[entity_type: create/update] Makes the type DERIVED — a read-only SQL view. `{ sql }` runs over your org's internal tables; `{ sql, connection: <slug> }` runs LIVE against that connection's external database (read-only, no copy). `null` clears it (revert to a stored type); omit to leave unchanged. Read a derived type's rows by running its `backing_sql` (returned by `get`) through `query_sql` — and when `get` also returns a `backing_source`, pass it as `query_sql`'s `connection` so the view runs against the external DB instead of your internal tables. `get` also returns `measure_columns` (the view's aggregate columns, classified on read).",
|
|
@@ -24,6 +24,7 @@ export declare const UpdateEntityAction: import("@sinclair/typebox").TObject<{
|
|
|
24
24
|
metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
25
25
|
field_note: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
26
26
|
affirm_fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
27
|
+
manual_edit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
27
28
|
automation_source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
28
29
|
automation_id: import("@sinclair/typebox").TNumber;
|
|
29
30
|
run_id: import("@sinclair/typebox").TNumber;
|
|
@@ -162,6 +163,7 @@ export declare const ManageEntitySchema: import("@sinclair/typebox").TUnion<[imp
|
|
|
162
163
|
metadata: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
163
164
|
field_note: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
164
165
|
affirm_fields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
166
|
+
manual_edit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
165
167
|
automation_source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
166
168
|
automation_id: import("@sinclair/typebox").TNumber;
|
|
167
169
|
run_id: import("@sinclair/typebox").TNumber;
|
|
@@ -430,6 +432,8 @@ export declare const ManageEntityResultSchema: import("@sinclair/typebox").TUnio
|
|
|
430
432
|
approval_current: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
431
433
|
/** Who proposed the blocked change: 'agent' | 'automation'. */
|
|
432
434
|
approval_attribution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"automation" | "agent">[]>>;
|
|
435
|
+
/** True when a `manual_edit` assertion was honoured: the edit was recorded as the person's own. */
|
|
436
|
+
manual_edit_applied: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
433
437
|
}>, import("@sinclair/typebox").TObject<{
|
|
434
438
|
action: import("@sinclair/typebox").TLiteral<"list">;
|
|
435
439
|
entities: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
@@ -128,6 +128,10 @@ exports.UpdateEntityAction = typebox_1.Type.Object({
|
|
|
128
128
|
affirm_fields: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String(), {
|
|
129
129
|
description: "[update] Metadata field names whose CURRENT value the human approves as-is. No value change, but each is marked human-owned so an Automation can't later overwrite it without an approval. The 'approve' half of the recap feedback loop.",
|
|
130
130
|
})),
|
|
131
|
+
// Asserted manual edit: a first-party backend records a person's own change
|
|
132
|
+
manual_edit: typebox_1.Type.Optional(typebox_1.Type.Boolean({
|
|
133
|
+
description: "[update] Assert that the signed-in person made this change themselves, so it is recorded as their manual edit: the fields it sets (and affirm_fields) become theirs, and Automations then queue an approval instead of updating them. A wrong assertion takes the field away from Automations. Honoured for a person's own web-session edit, or for a token minted with the entities:manual_edit scope by a person in the web app, with no agent, MCP session or Automation behind the call; otherwise the update fails with 403 MANUAL_EDIT_NOT_ALLOWED and nothing is written. Defaults to false.",
|
|
134
|
+
})),
|
|
131
135
|
automation_source: typebox_1.Type.Optional(AutomationSource),
|
|
132
136
|
});
|
|
133
137
|
exports.ListEntitiesAction = typebox_1.Type.Object({
|
|
@@ -423,6 +427,8 @@ exports.ManageEntityResultSchema = typebox_1.Type.Union([
|
|
|
423
427
|
approval_current: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
424
428
|
/** Who proposed the blocked change: 'agent' | 'automation'. */
|
|
425
429
|
approval_attribution: typebox_1.Type.Optional(interaction_envelope_1.ApprovalAttributionSchema),
|
|
430
|
+
/** True when a `manual_edit` assertion was honoured: the edit was recorded as the person's own. */
|
|
431
|
+
manual_edit_applied: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
426
432
|
}),
|
|
427
433
|
typebox_1.Type.Object({
|
|
428
434
|
action: typebox_1.Type.Literal("list"),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* headless args, flag mapping, MCP wiring). Adding a CLI is now one entry,
|
|
9
9
|
* not a ~140-line executor copy.
|
|
10
10
|
* - the Automation prompt builder — the completion contract the spawned CLI
|
|
11
|
-
* must satisfy
|
|
11
|
+
* must satisfy.
|
|
12
12
|
*
|
|
13
13
|
* The connector-worker daemon consumes these from core. This module is pure
|
|
14
14
|
* data + string building: it imports nothing above core.
|