@lobu/runtime-server 24.8.0 → 24.9.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 +83 -6
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +6 -2
- package/dist/connectors/github.ts +16 -3
- package/dist/connectors/market_quotes.ts +388 -91
- package/dist/connectors/postgres.ts +21 -14
- package/dist/connectors/x-dm-adapter.js +55 -21
- package/dist/connectors/x.ts +1 -1
- package/dist/db/migrations/20261109010000_workspace_navigation.sql +14 -0
- package/dist/db/migrations/20261110010000_view_resources.sql +11 -0
- package/dist/dependencies.bun.lock +61 -61
- package/dist/owletto/dist/assets/_-B2C9B2RM.js +2 -0
- package/dist/owletto/dist/assets/_-CjyiGzwB.js +3 -0
- package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +2 -0
- package/dist/owletto/dist/assets/_agentId-bna2tPsW.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +2 -0
- package/dist/owletto/dist/assets/{_connectorKey.index-DM5MTO8c.js → _connectorKey.index-DqwSv8Zs.js} +2 -2
- package/dist/owletto/dist/assets/{_conversationId-OJrZjd0o.js → _conversationId-zcs-S3dY.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +2 -0
- package/dist/owletto/dist/assets/_owner-DsvIC94q.js +3 -0
- package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +2 -0
- package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-BC-ZIsrf.js → accept-invitation-k1u3zBcn.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +2 -0
- package/dist/owletto/dist/assets/{agent-connect-pages-CdDjrHjn.js → agent-connect-pages-D3mVM_q4.js} +4 -4
- package/dist/owletto/dist/assets/{agent-editor-form-CDAHRNWl.js → agent-editor-form-Bnc_q5WD.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-BupiSjR-.js → agent-loading-shells-xteN-pyK.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-ju7L2M0l.js → agent-permissions-matrix-C_ayr0pd.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B0ZYVE3n.js → agent-skill-context-r0O0BVOu.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-ByU0xhXn.js → agent-subpage-shell-C2KpYdu3.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-DiVKn1WX.js → agent-thread-Bv_chdPy.js} +3 -3
- package/dist/owletto/dist/assets/{app._appId-BQWElSoP.js → app._appId-BUcNaSMS.js} +2 -2
- package/dist/owletto/dist/assets/{assist-composer-igTXq3DL.js → assist-composer-B1LykXpD.js} +2 -2
- package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +2 -0
- package/dist/owletto/dist/assets/{callback-Dmaio9CX.js → callback-kSLa4n5s.js} +2 -2
- package/dist/owletto/dist/assets/{card-rE4Ctuy6.js → card-C01y1O-W.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BN17CPYh.js → claim-Dnux9Lqf.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-B7xVaUA-.js → client-activity-scopes-BBIq16tG.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-B3LULJxW.js → client-rows-DGh1O-Fu.js} +2 -2
- package/dist/owletto/dist/assets/{clients-CydgUHrc.js → clients-BCvjAJDT.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-UppEMWpt.js → code-editor-BdRMYojw.js} +2 -2
- package/dist/owletto/dist/assets/connect-DZeFSGIH.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D4w-JhJW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId-CaF-ZWlZ.js → connected._clientId-BsDzltNz.js} +2 -2
- package/dist/owletto/dist/assets/{connection-D8ZAMHBT.js → connection-C7glVpPE.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-CJYqryAV.js → connection-feed-detail-CJju0qiw.js} +2 -2
- package/dist/owletto/dist/assets/{connector-page-shell-C23dWdKz.js → connector-page-shell-BeuyjiB2.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-CW4CXtCz.js → connector-provenance-B2C2cjBg.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-Bp08_KPq.js → connectors-DSQ5AWPf.js} +2 -2
- package/dist/owletto/dist/assets/{consent-_PpYI1cT.js → consent-B6Aw_89N.js} +2 -2
- package/dist/owletto/dist/assets/{copy-button-1ALlvZU1.js → copy-button-BhXeXLIm.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-6koO33th.js → core.esm-CJUp2aNZ.js} +3 -3
- package/dist/owletto/dist/assets/create-CWcza8NT.js +2 -0
- package/dist/owletto/dist/assets/{create-kUevP9Xx.js → create-DUlRsFNn.js} +2 -2
- package/dist/owletto/dist/assets/{create-automation-form-BhujNbRr.js → create-automation-form-D141prEG.js} +3 -3
- package/dist/owletto/dist/assets/{create-Drx9tcnG.js → create-bGOYifof.js} +2 -2
- package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +2 -0
- package/dist/owletto/dist/assets/{custom-guardrail-edits-B_aCgvoZ.js → custom-guardrail-edits-DuQ28xv3.js} +2 -2
- package/dist/owletto/dist/assets/{definition-comparison-3zKUSTt8.js → definition-comparison-BUDNuAN_.js} +2 -2
- package/dist/owletto/dist/assets/{detail-page-skeleton-BmxqqIsH.js → detail-page-skeleton-BRHaq5Sj.js} +2 -2
- package/dist/owletto/dist/assets/{device-D2eUt_nr.js → device-D3fzoIrM.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-BFPbTM_o.js → device-pin-tombstone-BIM-ziCH.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-Dqtmb1Xp.js → device._deviceId-BnPqTgK1.js} +2 -2
- package/dist/owletto/dist/assets/{dynamic-schema-form-D3KnzCsW.js → dynamic-schema-form-OkIZImgp.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-CpeX7iiX.js +2 -0
- package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +2 -0
- package/dist/owletto/dist/assets/{entity-pages-DJNSQrfB.js → entity-pages-18xSANrS.js} +2 -2
- package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +2 -0
- package/dist/owletto/dist/assets/{entity-type-page-CouHZbc9.js → entity-type-page-MgZ7_0oh.js} +2 -2
- package/dist/owletto/dist/assets/event-detail-D6AH6a2C.js +2 -0
- package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-DDTwyYt0.js +3 -0
- package/dist/owletto/dist/assets/{full-page-spinner-B7A6Ycyi.js → full-page-spinner-DWo519BU.js} +2 -2
- package/dist/owletto/dist/assets/index-9tTjJo_J.css +1 -0
- package/dist/owletto/dist/assets/{index-B-dZruj6.js → index-BW7IFKXC.js} +2 -2
- package/dist/owletto/dist/assets/{index-C7QM3aqU.js → index-BYcFrinP.js} +2 -2
- package/dist/owletto/dist/assets/index-BhJsTy-C.js +2 -0
- package/dist/owletto/dist/assets/index-CEcsgXDj.js +2 -0
- package/dist/owletto/dist/assets/index-CPscKk2u.js +2 -0
- package/dist/owletto/dist/assets/{index-DXfYVs5m.js → index-Cd8jMsz8.js} +2 -2
- package/dist/owletto/dist/assets/index-CdDNNAx2.js +7906 -0
- package/dist/owletto/dist/assets/index-CfJ2-EpK.js +2 -0
- package/dist/owletto/dist/assets/{index-BztXeLBN.js → index-D1UCJQl1.js} +2 -2
- package/dist/owletto/dist/assets/index-D5DM4g2w.js +2 -0
- package/dist/owletto/dist/assets/index-DmqnKGqW.js +2 -0
- package/dist/owletto/dist/assets/index-DznAbTOF.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-CJK-gzCt.js → json-diff-C-WQqyIf.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-bQAZ0hQp.js → list-skeleton-0B1bTrAK.js} +2 -2
- package/dist/owletto/dist/assets/{login-DLqL54Rk.js → login-CH7P2AyR.js} +2 -2
- package/dist/owletto/dist/assets/{logout-H0F3IfiO.js → logout-D474YsYQ.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-Doic_6qX.js → member-scope-gate-CH_0jHiM.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-BrfaDwIg.js → model-selector-XYmk7Iru.js} +2 -2
- package/dist/owletto/dist/assets/needs-you-list-Bd4iiiqm.js +2 -0
- package/dist/owletto/dist/assets/new-BOsrRqp8.js +2 -0
- package/dist/owletto/dist/assets/{new-5GkxlOuQ.js → new-CJ6TF3Vc.js} +2 -2
- package/dist/owletto/dist/assets/{new-BiA4DGoN.js → new-DGPOjak2.js} +2 -2
- package/dist/owletto/dist/assets/new-Q0XqiZq2.js +2 -0
- package/dist/owletto/dist/assets/{organization-CLrcmgNK.js → organization-hD_Z6TSd.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-Cc8YX1oy.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-DYYOoCvj.js → pending-seed-D7-ld7as.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-BVwOMoq9.js → proposal-review-shell-BWRJidwb.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +2 -0
- package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +2 -0
- package/dist/owletto/dist/assets/{record-session-KuEDuF3S.js → record-session-ClKBr1_C.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-ucwCQmBk.js → renderer-DZ0w2k2r.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-BkiAmXZW.js → reset-password-D2RfrEVZ.js} +2 -2
- package/dist/owletto/dist/assets/{run-initiator-8vdkq-3o.js → run-initiator-B8IRlRd-.js} +2 -2
- package/dist/owletto/dist/assets/runs-CuC7WMtd.js +2 -0
- package/dist/owletto/dist/assets/runs-list-8gUPWjP4.js +2 -0
- package/dist/owletto/dist/assets/{schema-value-CefbtPIY.js → schema-value-k19Ata7u.js} +3 -3
- package/dist/owletto/dist/assets/scoped-feed-bar-L7h-Ca4u.js +2 -0
- package/dist/owletto/dist/assets/{settings-DvzkRYQy.js → settings-BZqntV3E.js} +2 -2
- package/dist/owletto/dist/assets/{source-record-panels-LJIWGtHb.js → source-record-panels-C4UItfdk.js} +2 -2
- package/dist/owletto/dist/assets/{status-variants-BxHtpMOj.js → status-variants-BR_iGWN5.js} +2 -2
- package/dist/owletto/dist/assets/subDays-hOwerOLo.js +2 -0
- package/dist/owletto/dist/assets/{table-1O-ik4_O.js → table-C3DMoL4K.js} +2 -2
- package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +2 -0
- package/dist/owletto/dist/assets/{use-login-redirect-CfCbEeJR.js → use-login-redirect-CYlVkAhE.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-CA-evCDf.js → use-mention-search-CtbixPEE.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-BerT4Z1d.js → views-access-required-CvIIxdS_.js} +2 -2
- package/dist/owletto/dist/index.html +19 -12
- package/dist/server-main.bundle.mjs +4245 -2432
- package/npm-shrinkwrap.json +328 -328
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +23 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/classify-error.d.ts +3 -4
- package/vendor/core/dist/classify-error.js +8 -8
- package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +17 -1
- package/vendor/core/dist/contracts/tools/collection-presentation.js +27 -3
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +39 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +11 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +249 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +83 -21
- package/vendor/core/dist/contracts/tools/navigation.d.ts +248 -0
- package/vendor/core/dist/contracts/tools/navigation.js +284 -0
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +15 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +4 -1
- package/vendor/core/dist/contracts/tools/view-content-hash.js +4 -2
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +52 -0
- package/vendor/core/dist/contracts/tools/view-host.d.ts +68 -0
- package/vendor/core/dist/contracts/tools/view-host.js +28 -1
- package/vendor/core/dist/contracts/tools/view-scope.d.ts +31 -0
- package/vendor/core/dist/contracts/tools/view-scope.js +45 -0
- package/vendor/core/dist/errors.d.ts +17 -24
- package/vendor/core/dist/errors.js +17 -24
- package/vendor/core/dist/types.d.ts +0 -6
- package/vendor/core/package.json +11 -1
- package/vendor/views/dist/api.d.ts +30 -5
- package/vendor/views/dist/api.js +22 -8
- package/vendor/views/dist/bridge.d.ts +17 -0
- package/vendor/views/dist/bridge.js +49 -1
- package/vendor/views/dist/components.d.ts +27 -5
- package/vendor/views/dist/components.js +57 -7
- package/vendor/views/dist/embed.d.ts +98 -0
- package/vendor/views/dist/embed.js +418 -0
- package/vendor/views/dist/index.d.ts +3 -1
- package/vendor/views/dist/index.js +1 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-B0tmXZ86.js +0 -2
- package/dist/owletto/dist/assets/_-DwXULq4r.js +0 -3
- package/dist/owletto/dist/assets/_agentId-B1dNkhnr.js +0 -2
- package/dist/owletto/dist/assets/_agentId-sYjvnBaB.js +0 -2
- package/dist/owletto/dist/assets/_automationId-Bnw_CnT_.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D7Z8DQ-B.js +0 -2
- package/dist/owletto/dist/assets/_eventId-CfB0_2zK.js +0 -2
- package/dist/owletto/dist/assets/_owner-BDvTUY0a.js +0 -3
- package/dist/owletto/dist/assets/_shape-BZidoJMB.js +0 -2
- package/dist/owletto/dist/assets/_slug-R989vOiM.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BDUSrpe5.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BnFqh5-t.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CN2dOiCD.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-BJwRU6qT.js +0 -2
- package/dist/owletto/dist/assets/connect-OdHpIVV9.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-B9u86bb2.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-EI1tcdSE.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-BWPXijAk.js +0 -2
- package/dist/owletto/dist/assets/create-DULVO0HS.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-N6fhcIPy.js +0 -2
- package/dist/owletto/dist/assets/entity-options-IUdQ-64R.js +0 -2
- package/dist/owletto/dist/assets/entity-page-B3Im65EI.js +0 -2
- package/dist/owletto/dist/assets/event-detail-CvaRN1qB.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DwOkLk6A.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-DQ5V4Cvh.js +0 -2
- package/dist/owletto/dist/assets/home-stream-Bg97PUBJ.js +0 -2
- package/dist/owletto/dist/assets/home-toolbar-CpCcHA6z.js +0 -2
- package/dist/owletto/dist/assets/index-9PGnv4-5.js +0 -2
- package/dist/owletto/dist/assets/index-C2TCKJDP.js +0 -7901
- package/dist/owletto/dist/assets/index-CWn46a4y.js +0 -2
- package/dist/owletto/dist/assets/index-CxJONizf.js +0 -2
- package/dist/owletto/dist/assets/index-DJhb3li3.js +0 -2
- package/dist/owletto/dist/assets/index-DY-YGnCe.js +0 -2
- package/dist/owletto/dist/assets/index-j3v7ITPb.js +0 -2
- package/dist/owletto/dist/assets/index-oiy6ygaI.js +0 -2
- package/dist/owletto/dist/assets/index-pEgtAY1t.js +0 -2
- package/dist/owletto/dist/assets/index-xAvK3IyQ.css +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-CUea2Llz.js +0 -74
- package/dist/owletto/dist/assets/new-M-MX_T5C.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-B29OcHwm.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-BbjPgh3k.js +0 -2
- package/dist/owletto/dist/assets/record-activity-BCpNKaUo.js +0 -2
- package/dist/owletto/dist/assets/runs-B_iywKWb.js +0 -2
- package/dist/owletto/dist/assets/runs-list-CJJFRhTl.js +0 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-C4e8pq1A.js +0 -2
- package/dist/owletto/dist/assets/scoped-feed-bar-CapleZvS.js +0 -2
- package/dist/owletto/dist/assets/subDays-DwIOMzYC.js +0 -2
- package/dist/owletto/dist/assets/use-automations-lV8PuE8L.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-Bp84PUMd.js +0 -2
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { type Static } from "@sinclair/typebox";
|
|
2
|
+
/**
|
|
3
|
+
* Resource ceilings, not product limits: a workspace with a thousand views can
|
|
4
|
+
* nest and group them freely. The tree is recursive; these only stop a
|
|
5
|
+
* document from being unbounded.
|
|
6
|
+
*/
|
|
7
|
+
/** Deepest item nesting: a section's items are level 1. */
|
|
8
|
+
export declare const NAVIGATION_MAX_DEPTH = 32;
|
|
9
|
+
export declare const NAVIGATION_MAX_SECTIONS = 100;
|
|
10
|
+
/** Items across every section and level. */
|
|
11
|
+
export declare const NAVIGATION_MAX_ITEMS = 5000;
|
|
12
|
+
/** The whole document, serialized as UTF-8 JSON. */
|
|
13
|
+
export declare const NAVIGATION_MAX_BYTES: number;
|
|
14
|
+
export declare const PageRefSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
15
|
+
kind: import("@sinclair/typebox").TLiteral<"view">;
|
|
16
|
+
key: import("@sinclair/typebox").TString;
|
|
17
|
+
scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
18
|
+
collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
19
|
+
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
20
|
+
filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
21
|
+
field: import("@sinclair/typebox").TString;
|
|
22
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
|
|
23
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
|
|
24
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
25
|
+
field: import("@sinclair/typebox").TString;
|
|
26
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
|
|
27
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
|
|
28
|
+
}>]>>>;
|
|
29
|
+
segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
30
|
+
}>>;
|
|
31
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
33
|
+
event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
34
|
+
}>>;
|
|
35
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
|
|
36
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
37
|
+
kind: import("@sinclair/typebox").TLiteral<"collection">;
|
|
38
|
+
entityType: import("@sinclair/typebox").TString;
|
|
39
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
40
|
+
kind: import("@sinclair/typebox").TLiteral<"record">;
|
|
41
|
+
entityId: import("@sinclair/typebox").TInteger;
|
|
42
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
43
|
+
kind: import("@sinclair/typebox").TLiteral<"link">;
|
|
44
|
+
href: import("@sinclair/typebox").TString;
|
|
45
|
+
}>]>;
|
|
46
|
+
export type PageRef = Static<typeof PageRefSchema>;
|
|
47
|
+
export interface NavigationItem {
|
|
48
|
+
id: string;
|
|
49
|
+
label?: string;
|
|
50
|
+
icon?: string;
|
|
51
|
+
target?: PageRef;
|
|
52
|
+
children?: NavigationItem[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* One item. `children` holds items of this same shape; the wire schema
|
|
56
|
+
* describes the shape once (no recursive `$ref`, which not every MCP host or
|
|
57
|
+
* JSON-schema tool reads) and `validateNavigationConfig` checks every nested
|
|
58
|
+
* item against it while it walks the tree.
|
|
59
|
+
*/
|
|
60
|
+
export declare const NavigationItemSchema: import("@sinclair/typebox").TObject<{
|
|
61
|
+
id: import("@sinclair/typebox").TString;
|
|
62
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
63
|
+
icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
64
|
+
target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
65
|
+
kind: import("@sinclair/typebox").TLiteral<"view">;
|
|
66
|
+
key: import("@sinclair/typebox").TString;
|
|
67
|
+
scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
68
|
+
collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
69
|
+
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
70
|
+
filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
71
|
+
field: import("@sinclair/typebox").TString;
|
|
72
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
|
|
73
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
|
|
74
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
75
|
+
field: import("@sinclair/typebox").TString;
|
|
76
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
|
|
77
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
|
|
78
|
+
}>]>>>;
|
|
79
|
+
segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
80
|
+
}>>;
|
|
81
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
82
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
83
|
+
event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
84
|
+
}>>;
|
|
85
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
|
|
86
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
87
|
+
kind: import("@sinclair/typebox").TLiteral<"collection">;
|
|
88
|
+
entityType: import("@sinclair/typebox").TString;
|
|
89
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
90
|
+
kind: import("@sinclair/typebox").TLiteral<"record">;
|
|
91
|
+
entityId: import("@sinclair/typebox").TInteger;
|
|
92
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
93
|
+
kind: import("@sinclair/typebox").TLiteral<"link">;
|
|
94
|
+
href: import("@sinclair/typebox").TString;
|
|
95
|
+
}>]>>;
|
|
96
|
+
children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
|
|
97
|
+
}>;
|
|
98
|
+
export declare const NavigationSectionSchema: import("@sinclair/typebox").TObject<{
|
|
99
|
+
id: import("@sinclair/typebox").TString;
|
|
100
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
101
|
+
items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
102
|
+
id: import("@sinclair/typebox").TString;
|
|
103
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
104
|
+
icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
105
|
+
target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
106
|
+
kind: import("@sinclair/typebox").TLiteral<"view">;
|
|
107
|
+
key: import("@sinclair/typebox").TString;
|
|
108
|
+
scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
109
|
+
collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
110
|
+
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
111
|
+
filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
112
|
+
field: import("@sinclair/typebox").TString;
|
|
113
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
|
|
114
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
|
|
115
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
116
|
+
field: import("@sinclair/typebox").TString;
|
|
117
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
|
|
118
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
|
|
119
|
+
}>]>>>;
|
|
120
|
+
segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
121
|
+
}>>;
|
|
122
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
123
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
124
|
+
event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
125
|
+
}>>;
|
|
126
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
|
|
127
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
128
|
+
kind: import("@sinclair/typebox").TLiteral<"collection">;
|
|
129
|
+
entityType: import("@sinclair/typebox").TString;
|
|
130
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
131
|
+
kind: import("@sinclair/typebox").TLiteral<"record">;
|
|
132
|
+
entityId: import("@sinclair/typebox").TInteger;
|
|
133
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
134
|
+
kind: import("@sinclair/typebox").TLiteral<"link">;
|
|
135
|
+
href: import("@sinclair/typebox").TString;
|
|
136
|
+
}>]>>;
|
|
137
|
+
children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
|
|
138
|
+
}>>;
|
|
139
|
+
}>;
|
|
140
|
+
export interface NavigationSection {
|
|
141
|
+
id: string;
|
|
142
|
+
label?: string;
|
|
143
|
+
items: NavigationItem[];
|
|
144
|
+
}
|
|
145
|
+
export declare const NavigationConfigSchema: import("@sinclair/typebox").TObject<{
|
|
146
|
+
schemaVersion: import("@sinclair/typebox").TLiteral<1>;
|
|
147
|
+
sections: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
148
|
+
id: import("@sinclair/typebox").TString;
|
|
149
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
150
|
+
items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
151
|
+
id: import("@sinclair/typebox").TString;
|
|
152
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
153
|
+
icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
154
|
+
target: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
155
|
+
kind: import("@sinclair/typebox").TLiteral<"view">;
|
|
156
|
+
key: import("@sinclair/typebox").TString;
|
|
157
|
+
scope: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
158
|
+
collection: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
159
|
+
search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
160
|
+
filters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
161
|
+
field: import("@sinclair/typebox").TString;
|
|
162
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"eq">, import("@sinclair/typebox").TLiteral<"neq">]>;
|
|
163
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TNull]>;
|
|
164
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
165
|
+
field: import("@sinclair/typebox").TString;
|
|
166
|
+
op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"lt">, import("@sinclair/typebox").TLiteral<"lte">, import("@sinclair/typebox").TLiteral<"gt">, import("@sinclair/typebox").TLiteral<"gte">]>;
|
|
167
|
+
value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
|
|
168
|
+
}>]>>>;
|
|
169
|
+
segment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
170
|
+
}>>;
|
|
171
|
+
type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
172
|
+
entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
173
|
+
event: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
174
|
+
}>>;
|
|
175
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBoolean]>>>;
|
|
176
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
177
|
+
kind: import("@sinclair/typebox").TLiteral<"collection">;
|
|
178
|
+
entityType: import("@sinclair/typebox").TString;
|
|
179
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
180
|
+
kind: import("@sinclair/typebox").TLiteral<"record">;
|
|
181
|
+
entityId: import("@sinclair/typebox").TInteger;
|
|
182
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
183
|
+
kind: import("@sinclair/typebox").TLiteral<"link">;
|
|
184
|
+
href: import("@sinclair/typebox").TString;
|
|
185
|
+
}>]>>;
|
|
186
|
+
children: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
|
|
187
|
+
}>>;
|
|
188
|
+
}>>;
|
|
189
|
+
}>;
|
|
190
|
+
export interface NavigationConfig {
|
|
191
|
+
schemaVersion: 1;
|
|
192
|
+
sections: NavigationSection[];
|
|
193
|
+
}
|
|
194
|
+
/** One rendered entry: what the sidebar draws after the server resolved it. */
|
|
195
|
+
export interface ResolvedNavigationItem {
|
|
196
|
+
id: string;
|
|
197
|
+
label: string;
|
|
198
|
+
icon?: string;
|
|
199
|
+
/** App path (`/<workspace>/...`, with query) or an external https URL. */
|
|
200
|
+
href?: string;
|
|
201
|
+
external?: boolean;
|
|
202
|
+
children: ResolvedNavigationItem[];
|
|
203
|
+
}
|
|
204
|
+
export interface ResolvedNavigationSection {
|
|
205
|
+
id: string;
|
|
206
|
+
label?: string;
|
|
207
|
+
items: ResolvedNavigationItem[];
|
|
208
|
+
}
|
|
209
|
+
export declare const ResolvedNavigationSectionSchema: import("@sinclair/typebox").TObject<{
|
|
210
|
+
id: import("@sinclair/typebox").TString;
|
|
211
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
212
|
+
items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
213
|
+
id: import("@sinclair/typebox").TString;
|
|
214
|
+
label: import("@sinclair/typebox").TString;
|
|
215
|
+
icon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
216
|
+
href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
217
|
+
external: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
218
|
+
children: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>;
|
|
219
|
+
}>>;
|
|
220
|
+
}>;
|
|
221
|
+
export type NavigationDestination = {
|
|
222
|
+
kind: "internal";
|
|
223
|
+
path: string;
|
|
224
|
+
} | {
|
|
225
|
+
kind: "external";
|
|
226
|
+
href: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Where a link may go, decided once for both authored navigation links and a
|
|
230
|
+
* view's `openLink`: an absolute `https:` URL off this origin, or a path inside
|
|
231
|
+
* `/<workspace>/` on it. Everything else is refused — other schemes
|
|
232
|
+
* (`javascript:`, `data:`, `http:`), credentials in the URL, and any path that
|
|
233
|
+
* resolves outside the workspace (another workspace, `/account`, `..`).
|
|
234
|
+
*/
|
|
235
|
+
export declare function linkDestination(url: string, origin: string, workspace: string): NavigationDestination | null;
|
|
236
|
+
/**
|
|
237
|
+
* An authored `link` href: an absolute https URL, or a path explicitly relative
|
|
238
|
+
* to the workspace root — no scheme, no leading slash, no `.`/`..` segment (in
|
|
239
|
+
* any encoding), no backslash or control character.
|
|
240
|
+
*/
|
|
241
|
+
export declare function navigationHrefDestination(href: string, origin: string, workspace: string): NavigationDestination | null;
|
|
242
|
+
/**
|
|
243
|
+
* The one validator every writer runs (server `set`, CLI apply and pull):
|
|
244
|
+
* schema shape and bounds, then the rules a schema cannot say. Returns every
|
|
245
|
+
* problem as `<path>: <message>`; empty means valid.
|
|
246
|
+
*/
|
|
247
|
+
export declare function validateNavigationConfig(config: unknown): string[];
|
|
248
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResolvedNavigationSectionSchema = exports.NavigationConfigSchema = exports.NavigationSectionSchema = exports.NavigationItemSchema = exports.PageRefSchema = exports.NAVIGATION_MAX_BYTES = exports.NAVIGATION_MAX_ITEMS = exports.NAVIGATION_MAX_SECTIONS = exports.NAVIGATION_MAX_DEPTH = void 0;
|
|
4
|
+
exports.linkDestination = linkDestination;
|
|
5
|
+
exports.navigationHrefDestination = navigationHrefDestination;
|
|
6
|
+
exports.validateNavigationConfig = validateNavigationConfig;
|
|
7
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
8
|
+
const value_1 = require("@sinclair/typebox/value");
|
|
9
|
+
const view_scope_1 = require("./view-scope");
|
|
10
|
+
// ============================================
|
|
11
|
+
// Workspace navigation: the sidebar's curated sections.
|
|
12
|
+
// ============================================
|
|
13
|
+
//
|
|
14
|
+
// A workspace-owned, versioned document. It only presents: a section is not a
|
|
15
|
+
// permission or an owner, and hiding a destination never authorizes or
|
|
16
|
+
// denies it. `null` (never set) means the automatic default — the workspace's
|
|
17
|
+
// attached views — and an empty `sections` array means deliberately no custom
|
|
18
|
+
// entries. The product shell (Home, Memory, Search, Settings) is never part of
|
|
19
|
+
// it, so no configuration can remove it.
|
|
20
|
+
/**
|
|
21
|
+
* Resource ceilings, not product limits: a workspace with a thousand views can
|
|
22
|
+
* nest and group them freely. The tree is recursive; these only stop a
|
|
23
|
+
* document from being unbounded.
|
|
24
|
+
*/
|
|
25
|
+
/** Deepest item nesting: a section's items are level 1. */
|
|
26
|
+
exports.NAVIGATION_MAX_DEPTH = 32;
|
|
27
|
+
exports.NAVIGATION_MAX_SECTIONS = 100;
|
|
28
|
+
/** Items across every section and level. */
|
|
29
|
+
exports.NAVIGATION_MAX_ITEMS = 5000;
|
|
30
|
+
/** The whole document, serialized as UTF-8 JSON. */
|
|
31
|
+
exports.NAVIGATION_MAX_BYTES = 1024 * 1024;
|
|
32
|
+
const NavigationIdSchema = typebox_1.Type.String({
|
|
33
|
+
pattern: "^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$",
|
|
34
|
+
description: "Stable id, unique across the whole document (sections and items). It names the menu entry, not its destination: two entries may open the same page.",
|
|
35
|
+
});
|
|
36
|
+
const NavigationLabelSchema = typebox_1.Type.String({ minLength: 1, maxLength: 80 });
|
|
37
|
+
const NavigationIconSchema = typebox_1.Type.String({
|
|
38
|
+
pattern: "^[a-z0-9-]{1,40}$",
|
|
39
|
+
description: "A Lucide icon name in kebab-case (https://lucide.dev/icons), e.g. 'building-2'; former Lucide names resolve too. Unknown names render the default icon.",
|
|
40
|
+
});
|
|
41
|
+
const ScalarParamSchema = typebox_1.Type.Union([
|
|
42
|
+
typebox_1.Type.String({ maxLength: 500 }),
|
|
43
|
+
typebox_1.Type.Number(),
|
|
44
|
+
typebox_1.Type.Boolean(),
|
|
45
|
+
]);
|
|
46
|
+
exports.PageRefSchema = typebox_1.Type.Union([
|
|
47
|
+
typebox_1.Type.Object({
|
|
48
|
+
kind: typebox_1.Type.Literal("view"),
|
|
49
|
+
key: view_scope_1.ViewKeySchema,
|
|
50
|
+
scope: typebox_1.Type.Optional(typebox_1.Type.Object(view_scope_1.ViewScopeSchema.properties, {
|
|
51
|
+
additionalProperties: false,
|
|
52
|
+
})),
|
|
53
|
+
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String({ maxLength: 64 }), ScalarParamSchema, {
|
|
54
|
+
maxProperties: 20,
|
|
55
|
+
description: "Declared view params; validated against the view when resolved.",
|
|
56
|
+
})),
|
|
57
|
+
}, { additionalProperties: false }),
|
|
58
|
+
typebox_1.Type.Object({
|
|
59
|
+
kind: typebox_1.Type.Literal("collection"),
|
|
60
|
+
entityType: typebox_1.Type.String({ minLength: 1, maxLength: 120 }),
|
|
61
|
+
}, { additionalProperties: false }),
|
|
62
|
+
typebox_1.Type.Object({
|
|
63
|
+
kind: typebox_1.Type.Literal("record"),
|
|
64
|
+
entityId: typebox_1.Type.Integer({ minimum: 1 }),
|
|
65
|
+
}, { additionalProperties: false }),
|
|
66
|
+
typebox_1.Type.Object({
|
|
67
|
+
kind: typebox_1.Type.Literal("link"),
|
|
68
|
+
href: typebox_1.Type.String({
|
|
69
|
+
minLength: 1,
|
|
70
|
+
maxLength: 2048,
|
|
71
|
+
description: "Workspace-root-relative path (e.g. 'deal?stage=won', resolved under /<workspace>/) or an absolute https:// URL.",
|
|
72
|
+
}),
|
|
73
|
+
}, { additionalProperties: false }),
|
|
74
|
+
], {
|
|
75
|
+
description: "{ kind: 'view', key, scope?, params? } | { kind: 'collection', entityType } | { kind: 'record', entityId } | { kind: 'link', href }",
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* One item. `children` holds items of this same shape; the wire schema
|
|
79
|
+
* describes the shape once (no recursive `$ref`, which not every MCP host or
|
|
80
|
+
* JSON-schema tool reads) and `validateNavigationConfig` checks every nested
|
|
81
|
+
* item against it while it walks the tree.
|
|
82
|
+
*/
|
|
83
|
+
exports.NavigationItemSchema = typebox_1.Type.Object({
|
|
84
|
+
id: NavigationIdSchema,
|
|
85
|
+
label: typebox_1.Type.Optional(NavigationLabelSchema),
|
|
86
|
+
icon: typebox_1.Type.Optional(NavigationIconSchema),
|
|
87
|
+
target: typebox_1.Type.Optional(exports.PageRefSchema),
|
|
88
|
+
children: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Unknown(), {
|
|
89
|
+
description: "Nested items, each the same shape as this one.",
|
|
90
|
+
})),
|
|
91
|
+
}, { additionalProperties: false });
|
|
92
|
+
exports.NavigationSectionSchema = typebox_1.Type.Object({
|
|
93
|
+
id: NavigationIdSchema,
|
|
94
|
+
label: typebox_1.Type.Optional(NavigationLabelSchema),
|
|
95
|
+
items: typebox_1.Type.Array(exports.NavigationItemSchema),
|
|
96
|
+
}, { additionalProperties: false });
|
|
97
|
+
exports.NavigationConfigSchema = typebox_1.Type.Object({
|
|
98
|
+
schemaVersion: typebox_1.Type.Literal(1),
|
|
99
|
+
sections: typebox_1.Type.Array(exports.NavigationSectionSchema, {
|
|
100
|
+
maxItems: exports.NAVIGATION_MAX_SECTIONS,
|
|
101
|
+
}),
|
|
102
|
+
}, {
|
|
103
|
+
additionalProperties: false,
|
|
104
|
+
description: "{ schemaVersion: 1, sections: [{ id, label?, items: [{ id, label?, icon?, target?, children? }] }] }. An item without a target is a labeled group; with both, the label opens the target and a separate control expands the children.",
|
|
105
|
+
});
|
|
106
|
+
// Children are typed opaque on the wire, as on the input side: a recursive
|
|
107
|
+
// schema publishes a `$ref` the OpenAPI document never defines.
|
|
108
|
+
const ResolvedItemSchema = typebox_1.Type.Object({
|
|
109
|
+
id: typebox_1.Type.String(),
|
|
110
|
+
label: typebox_1.Type.String(),
|
|
111
|
+
icon: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
112
|
+
href: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
113
|
+
external: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
114
|
+
children: typebox_1.Type.Array(typebox_1.Type.Unknown(), {
|
|
115
|
+
description: "Nested items, each the same shape as this one.",
|
|
116
|
+
}),
|
|
117
|
+
});
|
|
118
|
+
exports.ResolvedNavigationSectionSchema = typebox_1.Type.Object({
|
|
119
|
+
id: typebox_1.Type.String(),
|
|
120
|
+
label: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
121
|
+
items: typebox_1.Type.Array(ResolvedItemSchema),
|
|
122
|
+
});
|
|
123
|
+
const SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*:/;
|
|
124
|
+
// C0 controls, DEL and whitespace never belong in an authored path.
|
|
125
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: rejecting control characters is the point
|
|
126
|
+
const UNSAFE_CHARS = /[\u0000- \u007f\\]/;
|
|
127
|
+
/**
|
|
128
|
+
* Where a link may go, decided once for both authored navigation links and a
|
|
129
|
+
* view's `openLink`: an absolute `https:` URL off this origin, or a path inside
|
|
130
|
+
* `/<workspace>/` on it. Everything else is refused — other schemes
|
|
131
|
+
* (`javascript:`, `data:`, `http:`), credentials in the URL, and any path that
|
|
132
|
+
* resolves outside the workspace (another workspace, `/account`, `..`).
|
|
133
|
+
*/
|
|
134
|
+
function linkDestination(url, origin, workspace) {
|
|
135
|
+
let parsed;
|
|
136
|
+
try {
|
|
137
|
+
parsed = new URL(url, `${origin}/${encodeURIComponent(workspace)}/`);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
if (parsed.username || parsed.password)
|
|
143
|
+
return null;
|
|
144
|
+
if (parsed.origin === origin) {
|
|
145
|
+
const root = `/${encodeURIComponent(workspace)}`;
|
|
146
|
+
if (parsed.pathname !== root && !parsed.pathname.startsWith(`${root}/`)) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
kind: "internal",
|
|
151
|
+
path: parsed.pathname + parsed.search + parsed.hash,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (parsed.protocol !== "https:")
|
|
155
|
+
return null;
|
|
156
|
+
return { kind: "external", href: parsed.href };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* An authored `link` href: an absolute https URL, or a path explicitly relative
|
|
160
|
+
* to the workspace root — no scheme, no leading slash, no `.`/`..` segment (in
|
|
161
|
+
* any encoding), no backslash or control character.
|
|
162
|
+
*/
|
|
163
|
+
function navigationHrefDestination(href, origin, workspace) {
|
|
164
|
+
if (UNSAFE_CHARS.test(href))
|
|
165
|
+
return null;
|
|
166
|
+
if (SCHEME.test(href)) {
|
|
167
|
+
const destination = linkDestination(href, origin, workspace);
|
|
168
|
+
return destination?.kind === "external" ? destination : null;
|
|
169
|
+
}
|
|
170
|
+
if (href.startsWith("/"))
|
|
171
|
+
return null;
|
|
172
|
+
const path = href.split(/[?#]/, 1)[0] ?? "";
|
|
173
|
+
for (const segment of path.split("/")) {
|
|
174
|
+
let decoded;
|
|
175
|
+
try {
|
|
176
|
+
decoded = decodeURIComponent(segment);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
if (decoded === "." || decoded === ".." || /[/\\]/.test(decoded)) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return linkDestination(href, origin, workspace);
|
|
186
|
+
}
|
|
187
|
+
// ============================================
|
|
188
|
+
// Validation
|
|
189
|
+
// ============================================
|
|
190
|
+
/** Any origin works: validation only asks whether the href can resolve. */
|
|
191
|
+
const VALIDATION_ORIGIN = "https://workspace.invalid";
|
|
192
|
+
/**
|
|
193
|
+
* The one validator every writer runs (server `set`, CLI apply and pull):
|
|
194
|
+
* schema shape and bounds, then the rules a schema cannot say. Returns every
|
|
195
|
+
* problem as `<path>: <message>`; empty means valid.
|
|
196
|
+
*/
|
|
197
|
+
function validateNavigationConfig(config) {
|
|
198
|
+
const bytes = new TextEncoder().encode(JSON.stringify(config) ?? "").length;
|
|
199
|
+
if (bytes > exports.NAVIGATION_MAX_BYTES) {
|
|
200
|
+
return [
|
|
201
|
+
`navigation: ${bytes} bytes exceed the limit of ${exports.NAVIGATION_MAX_BYTES}`,
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
const schemaErrors = (schema, value, at) => [...value_1.Value.Errors(schema, value)]
|
|
205
|
+
.slice(0, 10)
|
|
206
|
+
.map((e) => `${at}${e.path.split("/").join(".")}: ${e.message}`);
|
|
207
|
+
if (!value_1.Value.Check(exports.NavigationConfigSchema, config)) {
|
|
208
|
+
return schemaErrors(exports.NavigationConfigSchema, config, "navigation");
|
|
209
|
+
}
|
|
210
|
+
const doc = config;
|
|
211
|
+
const errors = [];
|
|
212
|
+
const seen = new Set();
|
|
213
|
+
let items = 0;
|
|
214
|
+
const claim = (id, at) => {
|
|
215
|
+
if (seen.has(id))
|
|
216
|
+
errors.push(`${at}: duplicate id '${id}'`);
|
|
217
|
+
seen.add(id);
|
|
218
|
+
};
|
|
219
|
+
// Iterative, so a deep document cannot exhaust the stack; it stops at the
|
|
220
|
+
// first ceiling it crosses.
|
|
221
|
+
const stack = [];
|
|
222
|
+
for (let s = doc.sections.length - 1; s >= 0; s -= 1) {
|
|
223
|
+
const section = doc.sections[s];
|
|
224
|
+
if (!section)
|
|
225
|
+
continue;
|
|
226
|
+
for (let i = section.items.length - 1; i >= 0; i -= 1) {
|
|
227
|
+
stack.push({
|
|
228
|
+
item: section.items[i],
|
|
229
|
+
at: `navigation.sections[${s}].items[${i}]`,
|
|
230
|
+
depth: 1,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
doc.sections.forEach((section, s) => {
|
|
235
|
+
claim(section.id, `navigation.sections[${s}]`);
|
|
236
|
+
});
|
|
237
|
+
while (stack.length > 0 && errors.length < 20) {
|
|
238
|
+
const { item: node, at, depth } = stack.pop();
|
|
239
|
+
items += 1;
|
|
240
|
+
if (items > exports.NAVIGATION_MAX_ITEMS) {
|
|
241
|
+
errors.push(`navigation: more than ${exports.NAVIGATION_MAX_ITEMS} items exceed the limit`);
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
if (depth > exports.NAVIGATION_MAX_DEPTH) {
|
|
245
|
+
errors.push(`${at}: nesting deeper than ${exports.NAVIGATION_MAX_DEPTH} levels exceeds the limit`);
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
if (!value_1.Value.Check(exports.NavigationItemSchema, node)) {
|
|
249
|
+
errors.push(...schemaErrors(exports.NavigationItemSchema, node, at));
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
const item = node;
|
|
253
|
+
claim(item.id, at);
|
|
254
|
+
const children = item.children ?? [];
|
|
255
|
+
if (!item.target && children.length === 0) {
|
|
256
|
+
errors.push(`${at}: an item needs a target, children, or both`);
|
|
257
|
+
}
|
|
258
|
+
if (!item.target && !item.label) {
|
|
259
|
+
errors.push(`${at}: a group without a target needs a label`);
|
|
260
|
+
}
|
|
261
|
+
if (item.target?.kind === "link" && !item.label) {
|
|
262
|
+
// A plain link has no resource to name it.
|
|
263
|
+
errors.push(`${at}: a link needs a label`);
|
|
264
|
+
}
|
|
265
|
+
if (item.target?.kind === "link" &&
|
|
266
|
+
!navigationHrefDestination(item.target.href, VALIDATION_ORIGIN, "w")) {
|
|
267
|
+
errors.push(`${at}.target.href: must be a workspace-relative path without '..' or an https:// URL`);
|
|
268
|
+
}
|
|
269
|
+
if (item.target?.kind === "view") {
|
|
270
|
+
const shape = (0, view_scope_1.viewScopeShapeError)(item.target.scope ?? {});
|
|
271
|
+
if (shape)
|
|
272
|
+
errors.push(`${at}.target.scope: ${shape}`);
|
|
273
|
+
}
|
|
274
|
+
for (let i = children.length - 1; i >= 0; i -= 1) {
|
|
275
|
+
stack.push({
|
|
276
|
+
item: children[i],
|
|
277
|
+
at: `${at}.children[${i}]`,
|
|
278
|
+
depth: depth + 1,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return errors;
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -11,6 +11,13 @@ export declare function matchesRecord(attachment: ViewAttachment, record: {
|
|
|
11
11
|
type: string;
|
|
12
12
|
id: number | string | null;
|
|
13
13
|
}): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the view mounts on records of `typeSlug`: a tab on the type's list
|
|
16
|
+
* or a card on its record pages. With `recordId`, a record card pinned to
|
|
17
|
+
* another id does not count. A collection's `when` narrows what the tab
|
|
18
|
+
* shows, not which records the view is about, so it is ignored here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function attachesToEntityType(attach: readonly ViewAttachment[], typeSlug: string, recordId?: number): boolean;
|
|
14
21
|
export declare function hasWorkspaceAttachment(attach: readonly ViewAttachment[]): boolean;
|
|
15
22
|
/** Without a kind, the web host considers every event attachment a candidate. */
|
|
16
23
|
export declare function eventAttachmentsFor(attach: readonly ViewAttachment[], semanticType?: string): EventAttachment[];
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isEventAttachment = isEventAttachment;
|
|
4
4
|
exports.matchesCollection = matchesCollection;
|
|
5
5
|
exports.matchesRecord = matchesRecord;
|
|
6
|
+
exports.attachesToEntityType = attachesToEntityType;
|
|
6
7
|
exports.hasWorkspaceAttachment = hasWorkspaceAttachment;
|
|
7
8
|
exports.eventAttachmentsFor = eventAttachmentsFor;
|
|
8
9
|
const collection_selection_1 = require("./collection-selection");
|
|
@@ -21,6 +22,20 @@ function matchesRecord(attachment, record) {
|
|
|
21
22
|
attachment.record === record.type &&
|
|
22
23
|
(attachment.id === undefined || attachment.id === record.id));
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether the view mounts on records of `typeSlug`: a tab on the type's list
|
|
27
|
+
* or a card on its record pages. With `recordId`, a record card pinned to
|
|
28
|
+
* another id does not count. A collection's `when` narrows what the tab
|
|
29
|
+
* shows, not which records the view is about, so it is ignored here.
|
|
30
|
+
*/
|
|
31
|
+
function attachesToEntityType(attach, typeSlug, recordId) {
|
|
32
|
+
return attach.some((attachment) => ("collection" in attachment && attachment.collection === typeSlug) ||
|
|
33
|
+
("record" in attachment &&
|
|
34
|
+
attachment.record === typeSlug &&
|
|
35
|
+
(recordId === undefined ||
|
|
36
|
+
attachment.id === undefined ||
|
|
37
|
+
attachment.id === recordId)));
|
|
38
|
+
}
|
|
24
39
|
function hasWorkspaceAttachment(attach) {
|
|
25
40
|
return attach.some((attachment) => "workspace" in attachment);
|
|
26
41
|
}
|
|
@@ -4,7 +4,7 @@ import type { RetainedSource } from "./source-files";
|
|
|
4
4
|
* and the CLI (diff-before-apply): ONE function derives the key on both
|
|
5
5
|
* sides, never read off whatever carried it. The hash covers the source, the
|
|
6
6
|
* declared metadata that affects the stored row (name, description, attach,
|
|
7
|
-
* params, actions), the retained files and dependencies when present, AND
|
|
7
|
+
* params, actions, resources), the retained files and dependencies when present, AND
|
|
8
8
|
* the digest of the executable browser bundle. The
|
|
9
9
|
* bundle matters because the CLI resolves relative imports and view npm deps
|
|
10
10
|
* where node_modules exists: two different executable artifacts built from
|
|
@@ -27,6 +27,9 @@ export interface ViewContentMetadata {
|
|
|
27
27
|
attach: unknown;
|
|
28
28
|
params: unknown;
|
|
29
29
|
actions: unknown;
|
|
30
|
+
/** Hashed only when non-empty, so a view that declares none keeps the
|
|
31
|
+
* identity it had before views could declare resources. */
|
|
32
|
+
resources: readonly string[];
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
35
|
* sha256 of the source plus the declared metadata plus the compiled
|
|
@@ -8,7 +8,7 @@ const node_crypto_1 = require("node:crypto");
|
|
|
8
8
|
* and the CLI (diff-before-apply): ONE function derives the key on both
|
|
9
9
|
* sides, never read off whatever carried it. The hash covers the source, the
|
|
10
10
|
* declared metadata that affects the stored row (name, description, attach,
|
|
11
|
-
* params, actions), the retained files and dependencies when present, AND
|
|
11
|
+
* params, actions, resources), the retained files and dependencies when present, AND
|
|
12
12
|
* the digest of the executable browser bundle. The
|
|
13
13
|
* bundle matters because the CLI resolves relative imports and view npm deps
|
|
14
14
|
* where node_modules exists: two different executable artifacts built from
|
|
@@ -45,10 +45,12 @@ function contentHash(source, metadata, compiledCode, retainedSource) {
|
|
|
45
45
|
const artifactDigest = (0, node_crypto_1.createHash)("sha256")
|
|
46
46
|
.update(compiledCode, "utf8")
|
|
47
47
|
.digest("hex");
|
|
48
|
+
const { resources, ...declared } = metadata;
|
|
49
|
+
const hashed = resources.length > 0 ? metadata : declared;
|
|
48
50
|
const hash = (0, node_crypto_1.createHash)("sha256")
|
|
49
51
|
.update(source)
|
|
50
52
|
.update("\n")
|
|
51
|
-
.update(stableStringify(
|
|
53
|
+
.update(stableStringify(hashed))
|
|
52
54
|
.update("\n")
|
|
53
55
|
.update(artifactDigest);
|
|
54
56
|
if (retainedSource)
|
|
@@ -8,6 +8,8 @@ export interface ViewDefinitionRecord {
|
|
|
8
8
|
attach: ViewAttachment[];
|
|
9
9
|
params: Record<string, ViewParamDecl>;
|
|
10
10
|
actions: Record<string, ViewActionDecl>;
|
|
11
|
+
/** Bare https origins the view may load images from, deduplicated. */
|
|
12
|
+
resources: string[];
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Read `export const view = defineView({...})` out of a view module, without
|