ryco-cli 0.1.29 → 0.1.30
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/README.md +37 -0
- package/dist/{AcpAdapter-CG1wRWcf.mjs → AcpAdapter-CKWzfB3Q.mjs} +4 -4
- package/dist/{AcpAdapter-8CSe4HK7.cjs → AcpAdapter-DjP0IHpH.cjs} +6 -6
- package/dist/{AcpNativeLogging-DbjnRnTf.cjs → AcpNativeLogging-5gTPK9Fq.cjs} +1 -1
- package/dist/{AcpNativeLogging-B6TtnnKL.mjs → AcpNativeLogging-Do0LktDb.mjs} +1 -1
- package/dist/{AcpRegistryDriver-16ZTxUs3.cjs → AcpRegistryDriver-BblCFfev.cjs} +3 -3
- package/dist/{AcpRegistryDriver-DZFasKaz.mjs → AcpRegistryDriver-BzohT-PC.mjs} +3 -3
- package/dist/{AzureDevOpsSourceControlProvider-DmJD1-WL.cjs → AzureDevOpsSourceControlProvider-CKSvfuDS.cjs} +1 -1
- package/dist/{AzureDevOpsSourceControlProvider-d5Ogsspk.mjs → AzureDevOpsSourceControlProvider-DRWSXTml.mjs} +1 -1
- package/dist/{BitbucketSourceControlProvider-B-ZwKj72.cjs → BitbucketSourceControlProvider-Bvl_q1o2.cjs} +1 -1
- package/dist/{BitbucketSourceControlProvider-DplKc8Wo.mjs → BitbucketSourceControlProvider-D5UVAc9z.mjs} +1 -1
- package/dist/{ClaudeDriver-0gGVop27.mjs → ClaudeDriver-BuQ_azDw.mjs} +7 -7
- package/dist/{ClaudeDriver-r0lJ9vmE.cjs → ClaudeDriver-DZkz0QPr.cjs} +8 -8
- package/dist/{CodexDriver-bJAbhSwY.cjs → CodexDriver-6Ph2cjAW.cjs} +5 -5
- package/dist/{CodexDriver-baT02xVb.mjs → CodexDriver-Bi49RIL4.mjs} +4 -4
- package/dist/{CodexTextGeneration-Dwp6X3dq.mjs → CodexTextGeneration-C5TIspJA.mjs} +4 -4
- package/dist/{CodexTextGeneration-DFZ5y4gj.cjs → CodexTextGeneration-sXPR9eld.cjs} +4 -4
- package/dist/{CopilotDriver-C0OhnSB1.mjs → CopilotDriver-Bcdpz6U_.mjs} +5 -5
- package/dist/{CopilotDriver-B_jEqfYQ.cjs → CopilotDriver-D6P0xgRX.cjs} +5 -5
- package/dist/{CursorDriver-DinXkGP9.mjs → CursorDriver-CRnDGwEv.mjs} +6 -6
- package/dist/{CursorDriver-BBFEW7ZI.cjs → CursorDriver-DMJ7sGSx.cjs} +7 -7
- package/dist/{ForgejoSourceControlProvider-iG9o7aZB.cjs → ForgejoSourceControlProvider-D4jGdaJX.cjs} +1 -1
- package/dist/{ForgejoSourceControlProvider-Dr0fxfud.mjs → ForgejoSourceControlProvider-Dl_Fk3RY.mjs} +1 -1
- package/dist/{GitHubSourceControlProvider-CnIu0n2Y.mjs → GitHubSourceControlProvider-DnwKf0ap.mjs} +1 -1
- package/dist/{GitHubSourceControlProvider-L1yFpep4.cjs → GitHubSourceControlProvider-QMe-zymI.cjs} +1 -1
- package/dist/{GitLabSourceControlProvider-BZdwXdJl.mjs → GitLabSourceControlProvider-Cj07OTBD.mjs} +1 -1
- package/dist/{GitLabSourceControlProvider-CrcBR6KQ.cjs → GitLabSourceControlProvider-CvvN5pHt.cjs} +1 -1
- package/dist/{GrokDriver-pX-N6HGS.mjs → GrokDriver-Bvq1jP3S.mjs} +7 -7
- package/dist/{GrokDriver-D_Ylzh5z.cjs → GrokDriver-jy8JIvYY.cjs} +10 -10
- package/dist/{Metrics-Bf96NJ4j.cjs → Metrics-C0LSU8s7.cjs} +979 -976
- package/dist/{Metrics-BjqGlIP4.mjs → Metrics-CnmjpbWk.mjs} +979 -976
- package/dist/{NodeSqliteClient-BGg70C7Q.cjs → NodeSqliteClient-D8bzGgPN.cjs} +1 -1
- package/dist/{OpenCodeDriver-BFEw5t09.cjs → OpenCodeDriver-Bu5D19tl.cjs} +6 -6
- package/dist/{OpenCodeDriver-Byu1pf_i.mjs → OpenCodeDriver-DhyVaBMT.mjs} +5 -5
- package/dist/{SideQuestionIsolation-81IoAuoi.mjs → SideQuestionIsolation-B-aE6aBz.mjs} +1 -1
- package/dist/{SideQuestionIsolation-CMPkCUP0.cjs → SideQuestionIsolation-CtJ4wX83.cjs} +1 -1
- package/dist/bin.cjs +8564 -302
- package/dist/bin.mjs +8544 -265
- package/dist/client/assets/{AccountSettings-FN7pwqYA.js → AccountSettings-v6-r6gYl.js} +1 -1
- package/dist/client/assets/{AiFocusSettings-xcDAMaqH.js → AiFocusSettings-BVdLON0q.js} +1 -1
- package/dist/client/assets/{AnimatedHeight-BNg7wnTK.js → AnimatedHeight-UXn4-nUd.js} +1 -1
- package/dist/client/assets/{AppearanceSettings-BvsvAOsG.js → AppearanceSettings-DRChsQnN.js} +1 -1
- package/dist/client/assets/{BranchToolbar.logic-DFsXV3Qs.js → BranchToolbar.logic-YN3KjVr9.js} +1 -1
- package/dist/client/assets/{BrowserPanel-D-g_xDZs.js → BrowserPanel-Dxw3stFP.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-Bm906qNi.js → ChatRightPanel-CygpcJiF.js} +5 -5
- package/dist/client/assets/{ChatThreadRouteView-CATwakjI.js → ChatThreadRouteView-DYLZFHu0.js} +1 -1
- package/dist/client/assets/{CommandPaletteDialog-Obv1bvxj.js → CommandPaletteDialog-BRvBzP1R.js} +1 -1
- package/dist/client/assets/{CompositeRoot-CfkIdky8.js → CompositeRoot-BeEGGWwn.js} +1 -1
- package/dist/client/assets/{ComputerUseSettings-ljYmTHea.js → ComputerUseSettings-Cq8Pi0ZU.js} +1 -1
- package/dist/client/assets/{ConnectionsSettings-CIXs7x_E.js → ConnectionsSettings-RSYtexxd.js} +2 -2
- package/dist/client/assets/{ContextHandoffEndpointLabel-BzI4Wi1i.js → ContextHandoffEndpointLabel-CeGDLNA4.js} +1 -1
- package/dist/client/assets/{DiagnosticsSettings-DGX_2T2M.js → DiagnosticsSettings-CDa6MVx4.js} +1 -1
- package/dist/client/assets/{DialogHandle-CTtSYpsC.js → DialogHandle-BE7egDQQ.js} +1 -1
- package/dist/client/assets/{DialogPopup-DdZlhHuQ.js → DialogPopup-NfwDyR5c.js} +1 -1
- package/dist/client/assets/DialogRoot-C4mtzigX.js +1 -0
- package/dist/client/assets/{DialogTitle-Du7CAbaO.js → DialogTitle-B_Q4DykI.js} +1 -1
- package/dist/client/assets/{DialogTrigger-VpFh8Xza.js → DialogTrigger-BSqd4Crj.js} +1 -1
- package/dist/client/assets/{DialogViewport-BwuqbGLY.js → DialogViewport-B6w_ROOE.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-Cmc5HpWf.js → DraftChatThreadRouteView-JW_bXVrM.js} +1 -1
- package/dist/client/assets/{ExternalIdentityWeb.logic-DsTJQkg-.js → ExternalIdentityWeb.logic-BlKX8J9h.js} +1 -1
- package/dist/client/assets/{GlassSurface-BlWIlQ0s.js → GlassSurface-DDG4eTlj.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-ySHqwr4K.js → HostedConnectionControls-CscV6hm1.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-Caz8PElK.js → HostedHubRoot-gp7-ClBP.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-BSq_AlY2.js → HostedNativeAuthorizationRoute-j7oSlakZ.js} +1 -1
- package/dist/client/assets/{HostedNodeRenameDialog-ChxJdr-Z.js → HostedNodeRenameDialog-D1DSiTpx.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-DPVrIfj_.js → HostedRelayTrustNotice-B9jp4SRh.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-eAq5h-D5.js → IntegrationsSettingsPanel-DH7SfWtV.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-D1XaEVGH.js → KeybindingsSettings-DkgYYSHS.js} +1 -1
- package/dist/client/assets/{LazyBrowserPanel-B6POLJh3.js → LazyBrowserPanel-D4e76vc_.js} +1 -1
- package/dist/client/assets/{McpServersSettings-DqLA6n5v.js → McpServersSettings-Dc1kPa-X.js} +1 -1
- package/dist/client/assets/{MobileSheet-CtQIYRlY.js → MobileSheet-lT--mLEz.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-Skm7GQDl.js → NodeSecuritySettings-DcfSx4KT.js} +1 -1
- package/dist/client/assets/{NullStore-b8PhjwPZ.js → NullStore-8d2s-Re3.js} +1 -1
- package/dist/client/assets/{OnboardingDialog-8-fKvY5H.js → OnboardingDialog-CnLjwM6Z.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-BIJfJ34L.js → OpinionatedPluginsSettings-BTJyS3rN.js} +1 -1
- package/dist/client/assets/{PdfAttachmentPreview-CTo1AyZs.js → PdfAttachmentPreview-C8-hT8KQ.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-DwopOWnQ.js → PhoneGetAppInterstitial-Zh0zpBgT.js} +1 -1
- package/dist/client/assets/{PhoneHome-CUzxhhR4.js → PhoneHome-CIMkuDJF.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-BK2RHmYJ.js → PhoneSettingsSurface-CfZQxJNI.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-DPxL7AsR.js → ProvidersSettingsPanel-DAVSiwE1.js} +1 -1
- package/dist/client/assets/{QuitShortcutFeedback-eCvP_MNj.js → QuitShortcutFeedback-Qs9XsuZ4.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-DH4mWpB6.js → RedactedSensitiveText-BHGbQJwB.js} +1 -1
- package/dist/client/assets/{RootAppShell-DwiWD4Cy.js → RootAppShell-T056pByH.js} +2 -2
- package/dist/client/assets/{Separator-BiINUUQl.js → Separator-B6Esv57Y.js} +1 -1
- package/dist/client/assets/{SettingsDialog-CE8qy0qL.js → SettingsDialog-BERU2Qg7.js} +1 -1
- package/dist/client/assets/{SettingsPanels-BYknk6GO.js → SettingsPanels-De_XZOQF.js} +1 -1
- package/dist/client/assets/{SettingsPanels.editor-64bM0lhg.js → SettingsPanels.editor-Dkva9gX_.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-BbveiAj3.js → SourceControlSettings-B4HS17cB.js} +1 -1
- package/dist/client/assets/{StatisticsPage-CAO_tCeC.js → StatisticsPage-Bj2ftFdH.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-SNlgMv2o.js → StatisticsPanel-Dw7GBBmd.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-BpkNubL2.js → StatisticsSettingsLink-_XL3ABoI.js} +1 -1
- package/dist/client/assets/{ThreadTerminalDrawer-9x_kqQPy.js → ThreadTerminalDrawer-CPPzQSXN.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-BXE17C4x.js → ThreadWorkspacePanel-DWKU7Omm.js} +1 -1
- package/dist/client/assets/{abnfDiagram-N423BO3Z-DAmGykdr.js → abnfDiagram-N423BO3Z-ByEe3mC0.js} +1 -1
- package/dist/client/assets/{activity-DRZlu-MC.js → activity-CwTUF6lv.js} +1 -1
- package/dist/client/assets/{alert-CwrDisFU.js → alert-DQEkrtUJ.js} +1 -1
- package/dist/client/assets/{appChrome-B_VWWDFj.js → appChrome-TkWLAGxk.js} +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-HS59zfrk.js +1 -0
- package/dist/client/assets/{architectureDiagram-T3A2C74G-DypU2ERW.js → architectureDiagram-T3A2C74G-Bd-yxaTr.js} +1 -1
- package/dist/client/assets/{arrow-left-XhcJWpRy.js → arrow-left-DUOpzEbP.js} +1 -1
- package/dist/client/assets/{arrow-right-BBs6iTUL.js → arrow-right-HOYJnPKw.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CJ9Vq7nK.js → arrow-up-right-DHnMKuVA.js} +1 -1
- package/dist/client/assets/{authorization-BugIGt5e.js → authorization-D8dOcEYq.js} +1 -1
- package/dist/client/assets/{badge-BswOCwph.js → badge-2AZ3HfVS.js} +1 -1
- package/dist/client/assets/{blockDiagram-VBNYF7ZC-B9MhR9hY.js → blockDiagram-VBNYF7ZC-CPDBonMC.js} +1 -1
- package/dist/client/assets/{bot-D5wgL7pu.js → bot-DxjPA7Bw.js} +1 -1
- package/dist/client/assets/{c4Diagram-5PPSVZJV-C22FWSoE.js → c4Diagram-5PPSVZJV-BM6pAiqT.js} +1 -1
- package/dist/client/assets/{capabilities-Bj_X9FZ-.js → capabilities-CsHjxjab.js} +1 -1
- package/dist/client/assets/channel-Dn3_cOkm.js +1 -0
- package/dist/client/assets/{chart-column-D6Lnkklk.js → chart-column-Cg7d41tb.js} +1 -1
- package/dist/client/assets/chevron-right-Dsw16yGn.js +1 -0
- package/dist/client/assets/{chunk-2GRJ4B5K-D1tZuCzA.js → chunk-2GRJ4B5K-DVKozJ41.js} +1 -1
- package/dist/client/assets/{chunk-4I5QYGJK-Clf86zK0.js → chunk-4I5QYGJK-BRoMwPkW.js} +1 -1
- package/dist/client/assets/{chunk-5RXB4S5H-B36N5RYZ.js → chunk-5RXB4S5H-DFMKyoqP.js} +1 -1
- package/dist/client/assets/{chunk-6Q2QTUOP-IAxdzsQJ.js → chunk-6Q2QTUOP-Ba6UENe9.js} +1 -1
- package/dist/client/assets/{chunk-7Z6QIM7H-Ctqebv_4.js → chunk-7Z6QIM7H-B87gYLWH.js} +1 -1
- package/dist/client/assets/{chunk-GF5L2VYU-CAfciJae.js → chunk-GF5L2VYU-DZ840GRQ.js} +1 -1
- package/dist/client/assets/{chunk-I66GZJ75-BZ7XtZf4.js → chunk-I66GZJ75-BO6p4Aqg.js} +1 -1
- package/dist/client/assets/{chunk-JQJVKLGR-DVuZCWnv.js → chunk-JQJVKLGR-5dTfVinz.js} +1 -1
- package/dist/client/assets/{chunk-KBJHAD2P-DtWbzsRm.js → chunk-KBJHAD2P-BeWfBZdP.js} +1 -1
- package/dist/client/assets/{chunk-NSK5VX7P-BVMz_Hc4.js → chunk-NSK5VX7P-DuRkdn5k.js} +1 -1
- package/dist/client/assets/{chunk-QR6OTTB3-DWitTCy-.js → chunk-QR6OTTB3-Duz4Y_uE.js} +1 -1
- package/dist/client/assets/{chunk-UBXNYLIW-BuxXXP2s.js → chunk-UBXNYLIW-D-z8URgN.js} +1 -1
- package/dist/client/assets/{chunk-W5SLKNZC-Bnf3sQl4.js → chunk-W5SLKNZC-AGjFjjoJ.js} +1 -1
- package/dist/client/assets/{chunk-WRU74C26-xu-KDOon.js → chunk-WRU74C26-BgY3UiXB.js} +1 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-ZQvrS8No.js +1 -0
- package/dist/client/assets/classDiagram-v2-OCEON4UE-ZQvrS8No.js +1 -0
- package/dist/client/assets/{clipboard-copy-oDSkUUg4.js → clipboard-copy-BWf3JuTE.js} +1 -1
- package/dist/client/assets/{cynefin-OW5HDTMX-DGNyiNSf.js → cynefin-OW5HDTMX-BuOAGqlK.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-MW4NZA55-_ctibv4i.js → cynefinDiagram-MW4NZA55-DqV0Aokp.js} +1 -1
- package/dist/client/assets/{dagre-VZM6K2ZE-Bo-bS1Y0.js → dagre-VZM6K2ZE-D_GFquDW.js} +1 -1
- package/dist/client/assets/{data-list-DLsM39Hp.js → data-list-BJCq3CVP.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-Ocqt625W.js → desktopWorkspace-_iM6B9Kf.js} +1 -1
- package/dist/client/assets/{deviceName-z0ZWSq0z.js → deviceName-C2N8ZRX3.js} +1 -1
- package/dist/client/assets/{diagram-7IWD3JNH-DSjtw1SY.js → diagram-7IWD3JNH-B1wlsNg2.js} +1 -1
- package/dist/client/assets/{diagram-B4RE2ZJO-B7fWEvIa.js → diagram-B4RE2ZJO-D-CYoym7.js} +1 -1
- package/dist/client/assets/{diagram-LBJQPF4R-trRYCE5d.js → diagram-LBJQPF4R-DqJ9NCqt.js} +1 -1
- package/dist/client/assets/{diagram-Q27KOJAE-_DYcRggk.js → diagram-Q27KOJAE-3yp1D2u4.js} +1 -1
- package/dist/client/assets/{diagram-UB23O5K3-BkMzOHX8.js → diagram-UB23O5K3-Byp25nGC.js} +1 -1
- package/dist/client/assets/{download-CHdS3R_v.js → download-DsYNYJeu.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-BXEA7PRR-DubiOMCG.js → ebnfDiagram-BXEA7PRR-B_IM1l6o.js} +1 -1
- package/dist/client/assets/{editorPreferences-DVhg0CXd.js → editorPreferences-D8q1ItMW.js} +1 -1
- package/dist/client/assets/{empty-BlBl_Vvw.js → empty-BbJHvskr.js} +1 -1
- package/dist/client/assets/{erDiagram-JOGREHBK-CFDiNfSJ.js → erDiagram-JOGREHBK--OtcrCRJ.js} +1 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-Dj71kuPV.js +1 -0
- package/dist/client/assets/flowDiagram-UKHOOZJN-BaAiwuvL.js +1 -0
- package/dist/client/assets/{ganttDiagram-PKOTCBZU-DT2XhE-m.js → ganttDiagram-PKOTCBZU-w0seBi3Q.js} +1 -1
- package/dist/client/assets/{gitGraph-4MIJSDKK-BI5UGiqb.js → gitGraph-4MIJSDKK-BOJ0lcSW.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-CzAB97Rd.js → gitGraphDiagram-DS77QQ5N-BMfOCCYn.js} +1 -1
- package/dist/client/assets/{group-DZJuSiJL.js → group-tVMKGp7Q.js} +1 -1
- package/dist/client/assets/{hostedConnectionCoordinator-BztHfGNt.js → hostedConnectionCoordinator-BuRWCvUG.js} +1 -1
- package/dist/client/assets/hostedPairing-5n5srRC9.js +1 -0
- package/dist/client/assets/{hubRoutes-DExWSvVE.js → hubRoutes-jcMPIFy3.js} +1 -1
- package/dist/client/assets/{index-BAJdq3TK.js → index-BqZvnGNr.js} +1 -1
- package/dist/client/assets/{info-A6RAGUB7-DdGYYgLX.js → info-A6RAGUB7-acjBTQ5o.js} +1 -1
- package/dist/client/assets/{infoDiagram-6WML65LV-zhUpER6a.js → infoDiagram-6WML65LV-DB01Nc2m.js} +1 -1
- package/dist/client/assets/{input-CzU08wbL.js → input-BDWSVClC.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-BQLkqykE.js → ishikawaDiagram-WSZJBQD7-KhZTvm-J.js} +1 -1
- package/dist/client/assets/{journeyDiagram-NVQOT4AX-DBgsbKOF.js → journeyDiagram-NVQOT4AX-C3JCYk-2.js} +1 -1
- package/dist/client/assets/{kanban-definition-27J2QSJJ-DF-Rr-xs.js → kanban-definition-27J2QSJJ-Dbo0C1s6.js} +1 -1
- package/dist/client/assets/{kbd-DKuvGqFP.js → kbd-Dxm5Elqj.js} +1 -1
- package/dist/client/assets/{key-round-CvyrSjb2.js → key-round-CETZqe3h.js} +1 -1
- package/dist/client/assets/{layers-CwP65mnC.js → layers-Dqez1Uq8.js} +1 -1
- package/dist/client/assets/{log-out-D3rICSt5.js → log-out-D5-aSBAz.js} +1 -1
- package/dist/client/assets/{logging-C6tXZlGQ.js → logging-B_qXVrk6.js} +1 -1
- package/dist/client/assets/{main-RFllWEko.js → main-DAbEANjY.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-BiGKtilP.js → mermaid-parser.core-B6Q-3x_q.js} +2 -2
- package/dist/client/assets/{mermaidEngine-Cjfgf3Bg.js → mermaidEngine-DksLcesB.js} +3 -3
- package/dist/client/assets/{mindmap-definition-FAOFIHXS-SiU9JwWJ.js → mindmap-definition-FAOFIHXS-LaMzRxqw.js} +1 -1
- package/dist/client/assets/{motion-C9rN_t9p.js → motion-BdscFixQ.js} +1 -1
- package/dist/client/assets/{packet-AYTQ26CC-F-HuW5Dr.js → packet-AYTQ26CC-BHhg59Si.js} +1 -1
- package/dist/client/assets/{pairingUrl-rQM9kSGT.js → pairingUrl-Dn1e2CVw.js} +1 -1
- package/dist/client/assets/{palette-gaqgtube.js → palette-92ylWqeC.js} +1 -1
- package/dist/client/assets/{pegDiagram-VL7TDLO6-cC-QUd7I.js → pegDiagram-VL7TDLO6-s7l7UD9d.js} +1 -1
- package/dist/client/assets/{pie-WAS4IAKB-BI3XUcLN.js → pie-WAS4IAKB-DygX31Z9.js} +1 -1
- package/dist/client/assets/{pieDiagram-7S7Q4E2Y-BP4gJ4ZK.js → pieDiagram-7S7Q4E2Y-bb6I9TtZ.js} +1 -1
- package/dist/client/assets/{play-BJZrOx6T.js → play-DUvOxTpL.js} +1 -1
- package/dist/client/assets/{primary-CQh_KHGG.js → primary-DZjgHvyf.js} +3 -3
- package/dist/client/assets/{providerDriverMeta-LJ2vJxm-.js → providerDriverMeta-T2YbXzuS.js} +1 -1
- package/dist/client/assets/{qr-code-Cmfz5JKf.js → qr-code-D4CtBq2F.js} +1 -1
- package/dist/client/assets/{qr-code-BFO8lV1M.js → qr-code-dbkTo07n.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-DO-N1m-q.js → quadrantDiagram-CIZ2JOQS-Cj1Y68ZF.js} +1 -1
- package/dist/client/assets/{radar-RG4KPBEZ-CfayXQ5F.js → radar-RG4KPBEZ-FHM3ftPp.js} +1 -1
- package/dist/client/assets/{radio-group-BueX1AVO.js → radio-group-CRnHYWa8.js} +1 -1
- package/dist/client/assets/{railroad-74A4TZTK-CT6f-etT.js → railroad-74A4TZTK-CPMn18Cm.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DxU7Mt1k.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BYAPVjRd.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-BOqgR_X7.js +1 -0
- package/dist/client/assets/{railroadDiagram-AXF67PYL-DC8egbob.js → railroadDiagram-AXF67PYL-DyV3SuDj.js} +1 -1
- package/dist/client/assets/{refresh-cw-K_hU8_ld.js → refresh-cw-CgDa2Ok_.js} +1 -1
- package/dist/client/assets/{requirementDiagram-LRYGKXZP-DJMzcLk_.js → requirementDiagram-LRYGKXZP-_xEAGWaH.js} +1 -1
- package/dist/client/assets/runtime-BwHA1GUS.js +18 -0
- package/dist/client/assets/{sankeyDiagram-W5VNT64P-YR6aIYLj.js → sankeyDiagram-W5VNT64P-Clf6oTLi.js} +1 -1
- package/dist/client/assets/{save-Mh-PA_2P.js → save-C8h0AMdl.js} +1 -1
- package/dist/client/assets/{scroll-area-BC-LB_zE.js → scroll-area-7n2X_RLQ.js} +1 -1
- package/dist/client/assets/{scrollEdges-Zcpuz3un.js → scrollEdges-BXYnwntN.js} +1 -1
- package/dist/client/assets/{separator-yx1r9ZDw.js → separator-CL1qjMqJ.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-SI44F4Z6-BVeSqWDA.js → sequenceDiagram-SI44F4Z6-CcYtQLSe.js} +1 -1
- package/dist/client/assets/{settingsLayout-BbjDM-p0.js → settingsLayout-DxsFwhF0.js} +1 -1
- package/dist/client/assets/{sheet-CpEwjOWn.js → sheet-CGiaw8-i.js} +1 -1
- package/dist/client/assets/{shield-i098Bm_B.js → shield-DPC4oHTi.js} +1 -1
- package/dist/client/assets/{shield-alert-CXmR7fM9.js → shield-alert-CwH36qZb.js} +1 -1
- package/dist/client/assets/{shield-check-CdFhWT_o.js → shield-check-CGD7sEeF.js} +1 -1
- package/dist/client/assets/{sidebar-DayQTDZp.js → sidebar-Cc6ANbOP.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-DXqx3OlZ.js → sidebarProjectFolders-DO2Uv84F.js} +1 -1
- package/dist/client/assets/{sidebarStatusText-kdA6QMZS.js → sidebarStatusText-B4AtFXZo.js} +1 -1
- package/dist/client/assets/{sidebarUndo-BHFfJj0k.js → sidebarUndo-gdSrfa4O.js} +1 -1
- package/dist/client/assets/{skeleton-BwFgUtuE.js → skeleton-rS3IgBob.js} +1 -1
- package/dist/client/assets/{smartphone-DGfizz51.js → smartphone-DgVJfbv3.js} +1 -1
- package/dist/client/assets/square-Cr9X8U6y.js +1 -0
- package/dist/client/assets/{src-DHNjfMxR.js → src-C3Y_imaX.js} +1 -1
- package/dist/client/assets/{star-J3x3fktG.js → star-Cqay-Cae.js} +1 -1
- package/dist/client/assets/{stateDiagram-OKZ733FA-DoIZN669.js → stateDiagram-OKZ733FA-DEKURpRP.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CWtHILqh.js +1 -0
- package/dist/client/assets/storeSelectors-CTDWheMy.js +1 -0
- package/dist/client/assets/{swimlanes-SLNWSIFB-BoFLigyK.js → swimlanes-SLNWSIFB-DrR6sbi6.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DuaPce9O.js +8 -0
- package/dist/client/assets/{switch-D9inWKdd.js → switch-DnpJB2xv.js} +1 -1
- package/dist/client/assets/{timeline-definition-Z64GVDOM-D65EmNWc.js → timeline-definition-Z64GVDOM-bQJvmJx5.js} +1 -1
- package/dist/client/assets/{toggle-wMq3LLn1.js → toggle-D10FsFoE.js} +1 -1
- package/dist/client/assets/{toggle-group-YNqzWsK0.js → toggle-group-BhzbQPEQ.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-C0-NgmX5.js → tokenModePresentation-BkS-mry_.js} +1 -1
- package/dist/client/assets/{tooltip-mwOCSCXF.js → tooltip-BlweKBxc.js} +1 -1
- package/dist/client/assets/{treeView-Q6P3EWNA-C2S-OPgI.js → treeView-Q6P3EWNA-D4Ex5QTp.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-6Ovsu9iH.js → treemap-WGGIJYW6-C4B6Y6qM.js} +1 -1
- package/dist/client/assets/{unplug-BEfcl9Ht.js → unplug-B1dczi-t.js} +1 -1
- package/dist/client/assets/{usage-DF8oQrsy.js → usage-BBwaxMif.js} +1 -1
- package/dist/client/assets/useAppSidebarCollapsed-CFy476E3.js +1 -0
- package/dist/client/assets/useBaseUiId-DKOjzmu3.js +1 -0
- package/dist/client/assets/{useLabelableId-C8bc9a0F.js → useLabelableId-DQbY2GG1.js} +1 -1
- package/dist/client/assets/{useNavigate-01O5dMQe.js → useNavigate-B8oXtF30.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-BIdh81kF.js → usePhoneThreadActions-6DCLiyJ5.js} +1 -1
- package/dist/client/assets/{usePopupViewport-DYYZwfTW.js → usePopupViewport-CNWcP7Od.js} +1 -1
- package/dist/client/assets/{useScrollLock-BO185DkJ.js → useScrollLock-BbKeKZdj.js} +1 -1
- package/dist/client/assets/{useStatistics-D55-xLMz.js → useStatistics-B76_r68I.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-CMLVr18J.js → useTriggerFocusGuards-BC4Wb3GI.js} +1 -1
- package/dist/client/assets/{useValueChanged-DSyRHPje.js → useValueChanged-BkTbyZdO.js} +1 -1
- package/dist/client/assets/{user-round-C-U7TZKG.js → user-round-CLy1Qy1Y.js} +1 -1
- package/dist/client/assets/{vennDiagram-T6HMQDX7-fZAexcYr.js → vennDiagram-T6HMQDX7-8iiroXim.js} +1 -1
- package/dist/client/assets/{vscode-icons-BYX6fBsM.js → vscode-icons-CJBVQtq5.js} +1 -1
- package/dist/client/assets/{wardley-WFR3VGLG-gdYWSMxK.js → wardley-WFR3VGLG-DpyNUbTc.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-T6FBY63Y-iDJxQb70.js → wardleyDiagram-T6FBY63Y-CI7is3QO.js} +1 -1
- package/dist/client/assets/{workspaceMetadataProjection-So9-wSEZ.js → workspaceMetadataProjection-aqZEXDrQ.js} +1 -1
- package/dist/client/assets/{wrench-D79uBUSl.js → wrench-7pbbxqrZ.js} +1 -1
- package/dist/client/assets/{xychartDiagram-ELKLHX3M-B4cfMwpJ.js → xychartDiagram-ELKLHX3M-BTEX3m2y.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/{deviceHostWorker-CYnrwfrv.cjs → deviceHostWorker-D4HauWIV.cjs} +1 -1
- package/dist/{git-BKwGfw8A.mjs → git-9xWsJYIH.mjs} +1 -1
- package/dist/{git-Dn5wrgFY.cjs → git-xIkXFy_l.cjs} +2 -2
- package/dist/{makeManagedServerProvider-B_lPFNpL.mjs → makeManagedServerProvider-B90UKjnv.mjs} +1 -1
- package/dist/{makeManagedServerProvider-CUwxc0Pn.cjs → makeManagedServerProvider-CF776SAO.cjs} +2 -2
- package/dist/resource-monitor/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
- package/dist/{rolldown-runtime-LGfotAqq.cjs → rolldown-runtime-HbSU0i7K.cjs} +7 -0
- package/dist/{src-BzVJd3Me.cjs → src-CARHuYkT.cjs} +1059 -178
- package/dist/{src-7E1M4gTQ.mjs → src-CtsgPPhb.mjs} +198 -97
- package/package.json +1 -1
- package/dist/client/assets/DialogRoot-k2_0SNKA.js +0 -1
- package/dist/client/assets/architecture-7GRP2DOG-CQNNG5gU.js +0 -1
- package/dist/client/assets/channel-BtX-w3CK.js +0 -1
- package/dist/client/assets/chevron-right-Ddq5gL-L.js +0 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-BgDa3HFl.js +0 -1
- package/dist/client/assets/classDiagram-v2-OCEON4UE-BgDa3HFl.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-DpzGHjmu.js +0 -1
- package/dist/client/assets/flowDiagram-UKHOOZJN-CaDVMm72.js +0 -1
- package/dist/client/assets/hostedPairing-CqhLPQqG.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-B890iayj.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-C079Tzw6.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-DxvOX5Rh.js +0 -1
- package/dist/client/assets/runtime-OM-uAtaj.js +0 -18
- package/dist/client/assets/square-Cd2WS1gv.js +0 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-BnzsGHaN.js +0 -1
- package/dist/client/assets/storeSelectors-D60AAN01.js +0 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-BnA-oDvU.js +0 -8
- package/dist/client/assets/useAppSidebarCollapsed-C0jpPtER.js +0 -1
- package/dist/client/assets/useBaseUiId-Bz8dcyjd.js +0 -1
|
@@ -1,776 +1,641 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { Ko as DEFAULT_GIT_TEXT_GENERATION_MODEL_BY_PROVIDER, Qo as ProviderInstanceId, Xr as DEFAULT_SERVER_SETTINGS, Yo as MODEL_SLUG_ALIASES_BY_PROVIDER, Zo as ProviderDriverKind, ei as ServerSettings, es as isProviderDriverKind, oi as StorageError, qo as DEFAULT_GIT_TEXT_GENERATION_OPTIONS_BY_PROVIDER, ti as ServerSettingsError } from "./src-
|
|
3
|
+
import { Bs as NodeE2eeAdmissionPolicy, Ko as DEFAULT_GIT_TEXT_GENERATION_MODEL_BY_PROVIDER, Qo as ProviderInstanceId, Xr as DEFAULT_SERVER_SETTINGS, Yo as MODEL_SLUG_ALIASES_BY_PROVIDER, Zo as ProviderDriverKind, ei as ServerSettings, es as isProviderDriverKind, oi as StorageError, qo as DEFAULT_GIT_TEXT_GENERATION_OPTIONS_BY_PROVIDER, ti as ServerSettingsError } from "./src-CtsgPPhb.mjs";
|
|
4
4
|
import { r as fromLenientJson } from "./schemaJson-CaG1bOvo.mjs";
|
|
5
5
|
import { n as runProcess } from "./processRunner-DnndFd2A.mjs";
|
|
6
6
|
import { Cache, Cause, Context, Data, DateTime, Deferred, Duration, Effect, Equal, Exit, FileSystem, Layer, Metric, Path, Predicate, PubSub, Ref, Schema, SchemaIssue, Scope, Semaphore, Stream } from "effect";
|
|
7
|
-
import * as P from "effect/Predicate";
|
|
8
7
|
import path, { join } from "node:path";
|
|
9
8
|
import * as Crypto from "node:crypto";
|
|
10
9
|
import { createHash, timingSafeEqual } from "node:crypto";
|
|
10
|
+
import * as P from "effect/Predicate";
|
|
11
11
|
import { constants } from "node:fs";
|
|
12
12
|
import { homedir } from "node:os";
|
|
13
13
|
import fs$1, { access, lstat, realpath } from "node:fs/promises";
|
|
14
14
|
import * as Semaphore$1 from "effect/Semaphore";
|
|
15
15
|
import "effect/PlatformError";
|
|
16
16
|
import { dual } from "effect/Function";
|
|
17
|
-
//#region ../../
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/is.js
|
|
18
|
+
const objectTypeNames = [
|
|
19
|
+
"Object",
|
|
20
|
+
"RegExp",
|
|
21
|
+
"Date",
|
|
22
|
+
"Error",
|
|
23
|
+
"Map",
|
|
24
|
+
"Set",
|
|
25
|
+
"WeakMap",
|
|
26
|
+
"WeakSet",
|
|
27
|
+
"ArrayBuffer",
|
|
28
|
+
"SharedArrayBuffer",
|
|
29
|
+
"DataView",
|
|
30
|
+
"Promise",
|
|
31
|
+
"URL",
|
|
32
|
+
"HTMLElement",
|
|
33
|
+
"Int8Array",
|
|
34
|
+
"Uint8ClampedArray",
|
|
35
|
+
"Int16Array",
|
|
36
|
+
"Uint16Array",
|
|
37
|
+
"Int32Array",
|
|
38
|
+
"Uint32Array",
|
|
39
|
+
"Float32Array",
|
|
40
|
+
"Float64Array",
|
|
41
|
+
"BigInt64Array",
|
|
42
|
+
"BigUint64Array",
|
|
43
|
+
"Tagged"
|
|
44
|
+
];
|
|
31
45
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* friendly name; the routing slug remains the deterministic final fallback.
|
|
46
|
+
* @param {any} value
|
|
47
|
+
* @returns {string}
|
|
35
48
|
*/
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return { optionDescriptors: input.optionDescriptors.map(cloneDescriptor) };
|
|
50
|
-
}
|
|
51
|
-
function getRawSelectionValueById(selections, id) {
|
|
52
|
-
return (selections?.find((candidate) => candidate.id === id))?.value;
|
|
53
|
-
}
|
|
54
|
-
function getProviderOptionSelectionValue(selections, id) {
|
|
55
|
-
return getRawSelectionValueById(selections, id);
|
|
56
|
-
}
|
|
57
|
-
function getProviderOptionStringSelectionValue(selections, id) {
|
|
58
|
-
const value = getProviderOptionSelectionValue(selections, id);
|
|
59
|
-
return typeof value === "string" ? value : void 0;
|
|
60
|
-
}
|
|
61
|
-
function getProviderOptionBooleanSelectionValue(selections, id) {
|
|
62
|
-
const value = getProviderOptionSelectionValue(selections, id);
|
|
63
|
-
return typeof value === "boolean" ? value : void 0;
|
|
64
|
-
}
|
|
65
|
-
function getModelSelectionStringOptionValue(modelSelection, id) {
|
|
66
|
-
return getProviderOptionStringSelectionValue(modelSelection?.options, id);
|
|
67
|
-
}
|
|
68
|
-
function getModelSelectionBooleanOptionValue(modelSelection, id) {
|
|
69
|
-
return getProviderOptionBooleanSelectionValue(modelSelection?.options, id);
|
|
70
|
-
}
|
|
71
|
-
function resolveDescriptorChoiceValue(descriptor, raw) {
|
|
72
|
-
const trimmed = trimOrNull(raw);
|
|
73
|
-
if (!trimmed) return descriptor.currentValue ?? descriptor.options.find((option) => option.isDefault)?.id;
|
|
74
|
-
if (descriptor.options.length === 0) return trimmed;
|
|
75
|
-
if (descriptor.promptInjectedValues?.includes(trimmed) && descriptor.options.some((option) => option.id === trimmed)) return descriptor.options.find((option) => option.isDefault)?.id;
|
|
76
|
-
if (descriptor.options.some((option) => option.id === trimmed)) return trimmed;
|
|
77
|
-
return descriptor.currentValue ?? descriptor.options.find((option) => option.isDefault)?.id;
|
|
78
|
-
}
|
|
79
|
-
function cloneDescriptor(descriptor) {
|
|
80
|
-
return descriptor.type === "select" ? {
|
|
81
|
-
...descriptor,
|
|
82
|
-
options: [...descriptor.options],
|
|
83
|
-
...descriptor.promptInjectedValues ? { promptInjectedValues: [...descriptor.promptInjectedValues] } : {}
|
|
84
|
-
} : { ...descriptor };
|
|
49
|
+
function is(value) {
|
|
50
|
+
if (value === null) return "null";
|
|
51
|
+
if (value === void 0) return "undefined";
|
|
52
|
+
if (value === true || value === false) return "boolean";
|
|
53
|
+
const typeOf = typeof value;
|
|
54
|
+
if (typeOf === "string" || typeOf === "number" || typeOf === "bigint" || typeOf === "symbol") return typeOf;
|
|
55
|
+
if (typeOf === "function") return "Function";
|
|
56
|
+
if (Array.isArray(value)) return "Array";
|
|
57
|
+
if (value instanceof Uint8Array) return "Uint8Array";
|
|
58
|
+
if (value.constructor === Object) return "Object";
|
|
59
|
+
const objectType = getObjectType(value);
|
|
60
|
+
if (objectType) return objectType;
|
|
61
|
+
return "Object";
|
|
85
62
|
}
|
|
86
|
-
|
|
87
|
-
|
|
63
|
+
/**
|
|
64
|
+
* @param {any} value
|
|
65
|
+
* @returns {string|undefined}
|
|
66
|
+
*/
|
|
67
|
+
function getObjectType(value) {
|
|
68
|
+
const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
|
|
69
|
+
if (objectTypeNames.includes(objectTypeName)) return objectTypeName;
|
|
88
70
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/token.js
|
|
73
|
+
var Type = class {
|
|
74
|
+
/**
|
|
75
|
+
* @param {number} major
|
|
76
|
+
* @param {string} name
|
|
77
|
+
* @param {boolean} terminal
|
|
78
|
+
*/
|
|
79
|
+
constructor(major, name, terminal) {
|
|
80
|
+
this.major = major;
|
|
81
|
+
this.majorEncoded = major << 5;
|
|
82
|
+
this.name = name;
|
|
83
|
+
this.terminal = terminal;
|
|
96
84
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const { currentValue: _unusedCurrentValue, ...rest } = descriptor;
|
|
100
|
-
return rest;
|
|
85
|
+
toString() {
|
|
86
|
+
return `Type[${this.major}].${this.name}`;
|
|
101
87
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @param {Type} typ
|
|
90
|
+
* @returns {number}
|
|
91
|
+
*/
|
|
92
|
+
compare(typ) {
|
|
93
|
+
return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Check equality between two Type instances. Safe to use across different
|
|
97
|
+
* copies of the Type class (e.g., when bundlers duplicate the module).
|
|
98
|
+
* (major, name) uniquely identifies a Type; terminal is implied by these.
|
|
99
|
+
* @param {Type} a
|
|
100
|
+
* @param {Type} b
|
|
101
|
+
* @returns {boolean}
|
|
102
|
+
*/
|
|
103
|
+
static equals(a, b) {
|
|
104
|
+
return a === b || a.major === b.major && a.name === b.name;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
Type.uint = new Type(0, "uint", true);
|
|
108
|
+
Type.negint = new Type(1, "negint", true);
|
|
109
|
+
Type.bytes = new Type(2, "bytes", true);
|
|
110
|
+
Type.string = new Type(3, "string", true);
|
|
111
|
+
Type.array = new Type(4, "array", false);
|
|
112
|
+
Type.map = new Type(5, "map", false);
|
|
113
|
+
Type.tag = new Type(6, "tag", false);
|
|
114
|
+
Type.float = new Type(7, "float", true);
|
|
115
|
+
Type.false = new Type(7, "false", true);
|
|
116
|
+
Type.true = new Type(7, "true", true);
|
|
117
|
+
Type.null = new Type(7, "null", true);
|
|
118
|
+
Type.undefined = new Type(7, "undefined", true);
|
|
119
|
+
Type.break = new Type(7, "break", true);
|
|
120
|
+
var Token = class {
|
|
121
|
+
/**
|
|
122
|
+
* @param {Type} type
|
|
123
|
+
* @param {any} [value]
|
|
124
|
+
* @param {number} [encodedLength]
|
|
125
|
+
*/
|
|
126
|
+
constructor(type, value, encodedLength) {
|
|
127
|
+
this.type = type;
|
|
128
|
+
this.value = value;
|
|
129
|
+
this.encodedLength = encodedLength;
|
|
130
|
+
/** @type {Uint8Array|undefined} */
|
|
131
|
+
this.encodedBytes = void 0;
|
|
132
|
+
/** @type {Uint8Array|undefined} */
|
|
133
|
+
this.byteValue = void 0;
|
|
134
|
+
}
|
|
135
|
+
toString() {
|
|
136
|
+
return `Token[${this.type}].${this.value}`;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/byte-utils.js
|
|
141
|
+
const useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === "function";
|
|
142
|
+
const textEncoder$1 = new TextEncoder();
|
|
144
143
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* @typedef {import('../interface.js').ByteView} ByteView
|
|
145
|
+
* @typedef {import('../interface.js').AllocatedByteView} AllocatedByteView
|
|
147
146
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
/**
|
|
148
|
+
* @param {Uint8Array} buf
|
|
149
|
+
* @returns {boolean}
|
|
150
|
+
*/
|
|
151
|
+
function isBuffer(buf) {
|
|
152
|
+
return useBuffer && globalThis.Buffer.isBuffer(buf);
|
|
150
153
|
}
|
|
151
154
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* Unlike a single `find`, this checks every descriptor so that the
|
|
156
|
-
* correct descriptor's `promptInjectedValues` list is consulted even when
|
|
157
|
-
* multiple select descriptors exist.
|
|
155
|
+
* @param {ByteView|number[]} buf
|
|
156
|
+
* @returns {ByteView}
|
|
158
157
|
*/
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const descriptors = getProviderOptionDescriptors({ caps });
|
|
163
|
-
for (const descriptor of descriptors) if (descriptor.type === "select" && descriptor.promptInjectedValues?.includes(trimmed)) return trimmed;
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
function applyClaudePromptEffortPrefix(text, effort) {
|
|
167
|
-
const trimmed = text.trim();
|
|
168
|
-
if (!trimmed) return trimmed;
|
|
169
|
-
if (effort !== "ultrathink") return trimmed;
|
|
170
|
-
if (trimmed.startsWith("Ultrathink:")) return trimmed;
|
|
171
|
-
return `Ultrathink:\n${trimmed}`;
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
|
-
//#region ../../packages/shared/src/serverSettings.ts
|
|
175
|
-
const ServerSettingsJson$1 = fromLenientJson(ServerSettings);
|
|
176
|
-
function normalizePersistedServerSettingString(value) {
|
|
177
|
-
const trimmed = value?.trim();
|
|
178
|
-
return trimmed && trimmed.length > 0 ? trimmed : void 0;
|
|
179
|
-
}
|
|
180
|
-
function extractPersistedServerObservabilitySettings(input) {
|
|
181
|
-
return {
|
|
182
|
-
otlpTracesUrl: normalizePersistedServerSettingString(input.observability?.otlpTracesUrl),
|
|
183
|
-
otlpMetricsUrl: normalizePersistedServerSettingString(input.observability?.otlpMetricsUrl)
|
|
184
|
-
};
|
|
158
|
+
function asU8A(buf) {
|
|
159
|
+
if (!(buf instanceof Uint8Array)) return Uint8Array.from(buf);
|
|
160
|
+
return isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf;
|
|
185
161
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
162
|
+
const FROM_STRING_THRESHOLD_BUFFER = 24;
|
|
163
|
+
const FROM_STRING_THRESHOLD_TEXTENCODER = 200;
|
|
164
|
+
const fromString = useBuffer ? (string) => {
|
|
165
|
+
return string.length >= FROM_STRING_THRESHOLD_BUFFER ? globalThis.Buffer.from(string) : utf8ToBytes(string);
|
|
166
|
+
} :
|
|
167
|
+
/**
|
|
168
|
+
* @param {string} string
|
|
169
|
+
*/
|
|
170
|
+
(string) => {
|
|
171
|
+
return string.length >= FROM_STRING_THRESHOLD_TEXTENCODER ? textEncoder$1.encode(string) : utf8ToBytes(string);
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Buffer variant not fast enough for what we need
|
|
175
|
+
* @param {number[]} arr
|
|
176
|
+
* @returns {AllocatedByteView}
|
|
177
|
+
*/
|
|
178
|
+
const fromArray = (arr) => {
|
|
179
|
+
return Uint8Array.from(arr);
|
|
180
|
+
};
|
|
181
|
+
const slice = useBuffer ? (bytes, start, end) => {
|
|
182
|
+
if (isBuffer(bytes)) return new Uint8Array(bytes.subarray(start, end));
|
|
183
|
+
return bytes.slice(start, end);
|
|
184
|
+
} :
|
|
185
|
+
/**
|
|
186
|
+
* @param {Uint8Array} bytes
|
|
187
|
+
* @param {number} start
|
|
188
|
+
* @param {number} end
|
|
189
|
+
*/
|
|
190
|
+
(bytes, start, end) => {
|
|
191
|
+
return bytes.slice(start, end);
|
|
192
|
+
};
|
|
193
|
+
const concat = useBuffer ? (chunks, length) => {
|
|
194
|
+
chunks = chunks.map((c) => c instanceof Uint8Array ? c : globalThis.Buffer.from(c));
|
|
195
|
+
return asU8A(globalThis.Buffer.concat(chunks, length));
|
|
196
|
+
} :
|
|
197
|
+
/**
|
|
198
|
+
* @param {ByteView[]} chunks
|
|
199
|
+
* @param {number} length
|
|
200
|
+
* @returns {AllocatedByteView}
|
|
201
|
+
*/
|
|
202
|
+
(chunks, length) => {
|
|
203
|
+
const out = new Uint8Array(length);
|
|
204
|
+
let off = 0;
|
|
205
|
+
for (let b of chunks) {
|
|
206
|
+
if (off + b.length > out.length) b = b.subarray(0, out.length - off);
|
|
207
|
+
out.set(b, off);
|
|
208
|
+
off += b.length;
|
|
194
209
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
210
|
+
return out;
|
|
211
|
+
};
|
|
212
|
+
const alloc = useBuffer ? (size) => {
|
|
213
|
+
return globalThis.Buffer.allocUnsafe(size);
|
|
214
|
+
} :
|
|
215
|
+
/**
|
|
216
|
+
* @param {number} size
|
|
217
|
+
* @returns {AllocatedByteView}
|
|
218
|
+
*/
|
|
219
|
+
(size) => {
|
|
220
|
+
return new Uint8Array(size);
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* @param {Uint8Array} b1
|
|
224
|
+
* @param {Uint8Array} b2
|
|
225
|
+
* @returns {number}
|
|
226
|
+
*/
|
|
227
|
+
function compare(b1, b2) {
|
|
228
|
+
if (isBuffer(b1) && isBuffer(b2)) return b1.compare(b2);
|
|
229
|
+
for (let i = 0; i < b1.length; i++) {
|
|
230
|
+
if (b1[i] === b2[i]) continue;
|
|
231
|
+
return b1[i] < b2[i] ? -1 : 1;
|
|
232
|
+
}
|
|
233
|
+
return 0;
|
|
208
234
|
}
|
|
209
235
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* surviving a reset patch that intentionally omits options.
|
|
236
|
+
* @param {string} str
|
|
237
|
+
* @returns {number[]}
|
|
213
238
|
*/
|
|
214
|
-
function
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
for (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
239
|
+
function utf8ToBytes(str) {
|
|
240
|
+
const out = [];
|
|
241
|
+
let p = 0;
|
|
242
|
+
for (let i = 0; i < str.length; i++) {
|
|
243
|
+
let c = str.charCodeAt(i);
|
|
244
|
+
if (c < 128) out[p++] = c;
|
|
245
|
+
else if (c < 2048) {
|
|
246
|
+
out[p++] = c >> 6 | 192;
|
|
247
|
+
out[p++] = c & 63 | 128;
|
|
248
|
+
} else if ((c & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
249
|
+
c = 65536 + ((c & 1023) << 10) + (str.charCodeAt(++i) & 1023);
|
|
250
|
+
out[p++] = c >> 18 | 240;
|
|
251
|
+
out[p++] = c >> 12 & 63 | 128;
|
|
252
|
+
out[p++] = c >> 6 & 63 | 128;
|
|
253
|
+
out[p++] = c & 63 | 128;
|
|
254
|
+
} else {
|
|
255
|
+
if (c >= 55296 && c <= 57343) c = 65533;
|
|
256
|
+
out[p++] = c >> 12 | 224;
|
|
257
|
+
out[p++] = c >> 6 & 63 | 128;
|
|
258
|
+
out[p++] = c & 63 | 128;
|
|
222
259
|
}
|
|
223
260
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
261
|
+
return out;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/bl.js
|
|
265
|
+
/**
|
|
266
|
+
* Bl is a list of byte chunks, similar to https://github.com/rvagg/bl but for
|
|
267
|
+
* writing rather than reading.
|
|
268
|
+
* A Bl object accepts set() operations for individual bytes and copyTo() for
|
|
269
|
+
* inserting byte arrays. These write operations don't automatically increment
|
|
270
|
+
* the internal cursor so its "length" won't be changed. Instead, increment()
|
|
271
|
+
* must be called to extend its length to cover the inserted data.
|
|
272
|
+
* The toBytes() call will convert all internal memory to a single Uint8Array of
|
|
273
|
+
* the correct length, truncating any data that is stored but hasn't been
|
|
274
|
+
* included by an increment().
|
|
275
|
+
* get() can retrieve a single byte.
|
|
276
|
+
* All operations (except toBytes()) take an "offset" argument that will perform
|
|
277
|
+
* the write at the offset _from the current cursor_. For most operations this
|
|
278
|
+
* will be `0` to write at the current cursor position but it can be ahead of
|
|
279
|
+
* the current cursor. Negative offsets probably work but are untested.
|
|
280
|
+
*/
|
|
281
|
+
/**
|
|
282
|
+
* @typedef {import('../interface.js').ByteView} ByteView
|
|
283
|
+
* @typedef {import('../interface.js').AllocatedByteView} AllocatedByteView
|
|
284
|
+
*/
|
|
285
|
+
const defaultChunkSize = 256;
|
|
286
|
+
var Bl = class {
|
|
287
|
+
/**
|
|
288
|
+
* @param {number} [chunkSize]
|
|
289
|
+
*/
|
|
290
|
+
constructor(chunkSize = defaultChunkSize) {
|
|
291
|
+
this.chunkSize = chunkSize;
|
|
292
|
+
/** @type {number} */
|
|
293
|
+
this.cursor = 0;
|
|
294
|
+
/** @type {number} */
|
|
295
|
+
this.maxCursor = -1;
|
|
296
|
+
/** @type {(ByteView|number[])[]} */
|
|
297
|
+
this.chunks = [];
|
|
298
|
+
/** @type {ByteView|number[]|null} */
|
|
299
|
+
this._initReuseChunk = null;
|
|
300
|
+
}
|
|
301
|
+
reset() {
|
|
302
|
+
this.cursor = 0;
|
|
303
|
+
this.maxCursor = -1;
|
|
304
|
+
if (this.chunks.length) this.chunks = [];
|
|
305
|
+
if (this._initReuseChunk !== null) {
|
|
306
|
+
this.chunks.push(this._initReuseChunk);
|
|
307
|
+
this.maxCursor = this._initReuseChunk.length - 1;
|
|
242
308
|
}
|
|
243
|
-
next = {
|
|
244
|
-
...next,
|
|
245
|
-
projectPreferences: Object.fromEntries(projects)
|
|
246
|
-
};
|
|
247
309
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
310
|
+
/**
|
|
311
|
+
* @param {number} byte
|
|
312
|
+
*/
|
|
313
|
+
pushByte(byte) {
|
|
314
|
+
let topChunk = this.chunks[this.chunks.length - 1];
|
|
315
|
+
if (this.cursor > this.maxCursor) {
|
|
316
|
+
topChunk = alloc(this.chunkSize);
|
|
317
|
+
this.chunks.push(topChunk);
|
|
318
|
+
this.maxCursor += topChunk.length;
|
|
319
|
+
if (this._initReuseChunk === null) this._initReuseChunk = topChunk;
|
|
320
|
+
}
|
|
321
|
+
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
|
322
|
+
topChunk[chunkPos] = byte;
|
|
323
|
+
this.cursor++;
|
|
256
324
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
325
|
+
/**
|
|
326
|
+
* @param {ByteView|number[]} bytes
|
|
327
|
+
*/
|
|
328
|
+
push(bytes) {
|
|
329
|
+
let topChunk = this.chunks[this.chunks.length - 1];
|
|
330
|
+
if (this.cursor + bytes.length <= this.maxCursor + 1) {
|
|
331
|
+
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
|
332
|
+
topChunk.set(bytes, chunkPos);
|
|
333
|
+
} else {
|
|
334
|
+
if (topChunk) {
|
|
335
|
+
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
|
336
|
+
if (chunkPos < topChunk.length) {
|
|
337
|
+
this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos);
|
|
338
|
+
this.maxCursor = this.cursor - 1;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (bytes.length < 64 && bytes.length < this.chunkSize) {
|
|
342
|
+
topChunk = alloc(this.chunkSize);
|
|
343
|
+
this.chunks.push(topChunk);
|
|
344
|
+
this.maxCursor += topChunk.length;
|
|
345
|
+
if (this._initReuseChunk === null) this._initReuseChunk = topChunk;
|
|
346
|
+
topChunk.set(bytes, 0);
|
|
347
|
+
} else {
|
|
348
|
+
this.chunks.push(bytes);
|
|
349
|
+
this.maxCursor += bytes.length;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
this.cursor += bytes.length;
|
|
265
353
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
354
|
+
/**
|
|
355
|
+
* @param {boolean} [reset]
|
|
356
|
+
* @returns {AllocatedByteView}
|
|
357
|
+
*/
|
|
358
|
+
toBytes(reset = false) {
|
|
359
|
+
let byts;
|
|
360
|
+
if (this.chunks.length === 1) {
|
|
361
|
+
const chunk = this.chunks[0];
|
|
362
|
+
if (reset && this.cursor > chunk.length / 2) {
|
|
363
|
+
byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor);
|
|
364
|
+
this._initReuseChunk = null;
|
|
365
|
+
this.chunks = [];
|
|
366
|
+
} else byts = slice(chunk, 0, this.cursor);
|
|
367
|
+
} else byts = concat(this.chunks, this.cursor);
|
|
368
|
+
if (reset) this.reset();
|
|
369
|
+
return byts;
|
|
274
370
|
}
|
|
275
|
-
|
|
276
|
-
...next,
|
|
277
|
-
providerInstances: patch.providerInstances
|
|
278
|
-
} : next;
|
|
279
|
-
if (!selectionPatch) return nextWithReplacements;
|
|
280
|
-
const instanceId = selectionPatch.instanceId ?? current.textGenerationModelSelection.instanceId;
|
|
281
|
-
const model = selectionPatch.model ?? current.textGenerationModelSelection.model;
|
|
282
|
-
const options = shouldReplaceTextGenerationModelSelection(selectionPatch) ? selectionPatch.options : mergeModelSelectionOptionsById({
|
|
283
|
-
current: current.textGenerationModelSelection.options,
|
|
284
|
-
patch: selectionPatch.options
|
|
285
|
-
});
|
|
286
|
-
return {
|
|
287
|
-
...nextWithReplacements,
|
|
288
|
-
textGenerationModelSelection: createModelSelection(instanceId, model, options)
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
//#endregion
|
|
292
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/is.js
|
|
293
|
-
const objectTypeNames = [
|
|
294
|
-
"Object",
|
|
295
|
-
"RegExp",
|
|
296
|
-
"Date",
|
|
297
|
-
"Error",
|
|
298
|
-
"Map",
|
|
299
|
-
"Set",
|
|
300
|
-
"WeakMap",
|
|
301
|
-
"WeakSet",
|
|
302
|
-
"ArrayBuffer",
|
|
303
|
-
"SharedArrayBuffer",
|
|
304
|
-
"DataView",
|
|
305
|
-
"Promise",
|
|
306
|
-
"URL",
|
|
307
|
-
"HTMLElement",
|
|
308
|
-
"Int8Array",
|
|
309
|
-
"Uint8ClampedArray",
|
|
310
|
-
"Int16Array",
|
|
311
|
-
"Uint16Array",
|
|
312
|
-
"Int32Array",
|
|
313
|
-
"Uint32Array",
|
|
314
|
-
"Float32Array",
|
|
315
|
-
"Float64Array",
|
|
316
|
-
"BigInt64Array",
|
|
317
|
-
"BigUint64Array",
|
|
318
|
-
"Tagged"
|
|
319
|
-
];
|
|
320
|
-
/**
|
|
321
|
-
* @param {any} value
|
|
322
|
-
* @returns {string}
|
|
323
|
-
*/
|
|
324
|
-
function is(value) {
|
|
325
|
-
if (value === null) return "null";
|
|
326
|
-
if (value === void 0) return "undefined";
|
|
327
|
-
if (value === true || value === false) return "boolean";
|
|
328
|
-
const typeOf = typeof value;
|
|
329
|
-
if (typeOf === "string" || typeOf === "number" || typeOf === "bigint" || typeOf === "symbol") return typeOf;
|
|
330
|
-
if (typeOf === "function") return "Function";
|
|
331
|
-
if (Array.isArray(value)) return "Array";
|
|
332
|
-
if (value instanceof Uint8Array) return "Uint8Array";
|
|
333
|
-
if (value.constructor === Object) return "Object";
|
|
334
|
-
const objectType = getObjectType(value);
|
|
335
|
-
if (objectType) return objectType;
|
|
336
|
-
return "Object";
|
|
337
|
-
}
|
|
371
|
+
};
|
|
338
372
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
373
|
+
* U8Bl is a buffer list that writes directly to a user-provided Uint8Array.
|
|
374
|
+
* It provides the same interface as Bl but writes to a fixed destination.
|
|
375
|
+
* @template {ArrayBufferLike} T
|
|
341
376
|
*/
|
|
342
|
-
|
|
343
|
-
const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
|
|
344
|
-
if (objectTypeNames.includes(objectTypeName)) return objectTypeName;
|
|
345
|
-
}
|
|
346
|
-
//#endregion
|
|
347
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/token.js
|
|
348
|
-
var Type = class {
|
|
377
|
+
var U8Bl = class {
|
|
349
378
|
/**
|
|
350
|
-
* @param {
|
|
351
|
-
* @param {string} name
|
|
352
|
-
* @param {boolean} terminal
|
|
379
|
+
* @param {Uint8Array<T>} dest
|
|
353
380
|
*/
|
|
354
|
-
constructor(
|
|
355
|
-
this.
|
|
356
|
-
|
|
357
|
-
this.
|
|
358
|
-
|
|
381
|
+
constructor(dest) {
|
|
382
|
+
this.dest = dest;
|
|
383
|
+
/** @type {number} */
|
|
384
|
+
this.cursor = 0;
|
|
385
|
+
/** @type {Array<Uint8Array<T>>} */
|
|
386
|
+
this.chunks = [dest];
|
|
359
387
|
}
|
|
360
|
-
|
|
361
|
-
|
|
388
|
+
reset() {
|
|
389
|
+
this.cursor = 0;
|
|
362
390
|
}
|
|
363
391
|
/**
|
|
364
|
-
* @param {
|
|
365
|
-
* @returns {number}
|
|
392
|
+
* @param {number} byte
|
|
366
393
|
*/
|
|
367
|
-
|
|
368
|
-
|
|
394
|
+
pushByte(byte) {
|
|
395
|
+
if (this.cursor >= this.dest.length) throw new Error("write out of bounds, destination buffer is too small");
|
|
396
|
+
this.dest[this.cursor++] = byte;
|
|
369
397
|
}
|
|
370
398
|
/**
|
|
371
|
-
*
|
|
372
|
-
* copies of the Type class (e.g., when bundlers duplicate the module).
|
|
373
|
-
* (major, name) uniquely identifies a Type; terminal is implied by these.
|
|
374
|
-
* @param {Type} a
|
|
375
|
-
* @param {Type} b
|
|
376
|
-
* @returns {boolean}
|
|
399
|
+
* @param {ByteView|number[]} bytes
|
|
377
400
|
*/
|
|
378
|
-
|
|
379
|
-
|
|
401
|
+
push(bytes) {
|
|
402
|
+
if (this.cursor + bytes.length > this.dest.length) throw new Error("write out of bounds, destination buffer is too small");
|
|
403
|
+
this.dest.set(bytes, this.cursor);
|
|
404
|
+
this.cursor += bytes.length;
|
|
380
405
|
}
|
|
381
|
-
};
|
|
382
|
-
Type.uint = new Type(0, "uint", true);
|
|
383
|
-
Type.negint = new Type(1, "negint", true);
|
|
384
|
-
Type.bytes = new Type(2, "bytes", true);
|
|
385
|
-
Type.string = new Type(3, "string", true);
|
|
386
|
-
Type.array = new Type(4, "array", false);
|
|
387
|
-
Type.map = new Type(5, "map", false);
|
|
388
|
-
Type.tag = new Type(6, "tag", false);
|
|
389
|
-
Type.float = new Type(7, "float", true);
|
|
390
|
-
Type.false = new Type(7, "false", true);
|
|
391
|
-
Type.true = new Type(7, "true", true);
|
|
392
|
-
Type.null = new Type(7, "null", true);
|
|
393
|
-
Type.undefined = new Type(7, "undefined", true);
|
|
394
|
-
Type.break = new Type(7, "break", true);
|
|
395
|
-
var Token = class {
|
|
396
406
|
/**
|
|
397
|
-
* @param {
|
|
398
|
-
* @
|
|
399
|
-
* @param {number} [encodedLength]
|
|
407
|
+
* @param {boolean} [reset]
|
|
408
|
+
* @returns {Uint8Array<T>}
|
|
400
409
|
*/
|
|
401
|
-
|
|
402
|
-
this.
|
|
403
|
-
this.
|
|
404
|
-
|
|
405
|
-
/** @type {Uint8Array|undefined} */
|
|
406
|
-
this.encodedBytes = void 0;
|
|
407
|
-
/** @type {Uint8Array|undefined} */
|
|
408
|
-
this.byteValue = void 0;
|
|
409
|
-
}
|
|
410
|
-
toString() {
|
|
411
|
-
return `Token[${this.type}].${this.value}`;
|
|
410
|
+
toBytes(reset = false) {
|
|
411
|
+
const byts = this.dest.subarray(0, this.cursor);
|
|
412
|
+
if (reset) this.reset();
|
|
413
|
+
return byts;
|
|
412
414
|
}
|
|
413
415
|
};
|
|
414
416
|
//#endregion
|
|
415
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/
|
|
416
|
-
const
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
417
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/common.js
|
|
418
|
+
const decodeErrPrefix = "CBOR decode error:";
|
|
419
|
+
const encodeErrPrefix = "CBOR encode error:";
|
|
420
|
+
const uintMinorPrefixBytes = [];
|
|
421
|
+
uintMinorPrefixBytes[23] = 1;
|
|
422
|
+
uintMinorPrefixBytes[24] = 2;
|
|
423
|
+
uintMinorPrefixBytes[25] = 3;
|
|
424
|
+
uintMinorPrefixBytes[26] = 5;
|
|
425
|
+
uintMinorPrefixBytes[27] = 9;
|
|
422
426
|
/**
|
|
423
|
-
* @param {Uint8Array}
|
|
424
|
-
* @
|
|
427
|
+
* @param {Uint8Array} data
|
|
428
|
+
* @param {number} pos
|
|
429
|
+
* @param {number} need
|
|
425
430
|
*/
|
|
426
|
-
function
|
|
427
|
-
|
|
431
|
+
function assertEnoughData(data, pos, need) {
|
|
432
|
+
if (data.length - pos < need) throw new Error(`${decodeErrPrefix} not enough data for type`);
|
|
428
433
|
}
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/0uint.js
|
|
436
|
+
const uintBoundaries = [
|
|
437
|
+
24,
|
|
438
|
+
256,
|
|
439
|
+
65536,
|
|
440
|
+
4294967296,
|
|
441
|
+
BigInt("18446744073709551616")
|
|
442
|
+
];
|
|
429
443
|
/**
|
|
430
|
-
* @
|
|
431
|
-
* @
|
|
444
|
+
* @typedef {import('../interface.js').ByteWriter} ByteWriter
|
|
445
|
+
* @typedef {import('../interface.js').DecodeOptions} DecodeOptions
|
|
432
446
|
*/
|
|
433
|
-
function asU8A(buf) {
|
|
434
|
-
if (!(buf instanceof Uint8Array)) return Uint8Array.from(buf);
|
|
435
|
-
return isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf;
|
|
436
|
-
}
|
|
437
|
-
const FROM_STRING_THRESHOLD_BUFFER = 24;
|
|
438
|
-
const FROM_STRING_THRESHOLD_TEXTENCODER = 200;
|
|
439
|
-
const fromString = useBuffer ? (string) => {
|
|
440
|
-
return string.length >= FROM_STRING_THRESHOLD_BUFFER ? globalThis.Buffer.from(string) : utf8ToBytes(string);
|
|
441
|
-
} :
|
|
442
447
|
/**
|
|
443
|
-
* @param {
|
|
448
|
+
* @param {Uint8Array} data
|
|
449
|
+
* @param {number} offset
|
|
450
|
+
* @param {DecodeOptions} options
|
|
451
|
+
* @returns {number}
|
|
444
452
|
*/
|
|
445
|
-
(
|
|
446
|
-
|
|
447
|
-
|
|
453
|
+
function readUint8(data, offset, options) {
|
|
454
|
+
assertEnoughData(data, offset, 1);
|
|
455
|
+
const value = data[offset];
|
|
456
|
+
if (options.strict === true && value < uintBoundaries[0]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
|
|
457
|
+
return value;
|
|
458
|
+
}
|
|
448
459
|
/**
|
|
449
|
-
*
|
|
450
|
-
* @param {number
|
|
451
|
-
* @
|
|
460
|
+
* @param {Uint8Array} data
|
|
461
|
+
* @param {number} offset
|
|
462
|
+
* @param {DecodeOptions} options
|
|
463
|
+
* @returns {number}
|
|
452
464
|
*/
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
} :
|
|
465
|
+
function readUint16(data, offset, options) {
|
|
466
|
+
assertEnoughData(data, offset, 2);
|
|
467
|
+
const value = data[offset] << 8 | data[offset + 1];
|
|
468
|
+
if (options.strict === true && value < uintBoundaries[1]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
|
|
469
|
+
return value;
|
|
470
|
+
}
|
|
460
471
|
/**
|
|
461
|
-
* @param {Uint8Array}
|
|
462
|
-
* @param {number}
|
|
463
|
-
* @param {
|
|
472
|
+
* @param {Uint8Array} data
|
|
473
|
+
* @param {number} offset
|
|
474
|
+
* @param {DecodeOptions} options
|
|
475
|
+
* @returns {number}
|
|
464
476
|
*/
|
|
465
|
-
(
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
} :
|
|
477
|
+
function readUint32(data, offset, options) {
|
|
478
|
+
assertEnoughData(data, offset, 4);
|
|
479
|
+
const value = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];
|
|
480
|
+
if (options.strict === true && value < uintBoundaries[2]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
|
|
481
|
+
return value;
|
|
482
|
+
}
|
|
472
483
|
/**
|
|
473
|
-
* @param {
|
|
474
|
-
* @param {number}
|
|
475
|
-
* @
|
|
484
|
+
* @param {Uint8Array} data
|
|
485
|
+
* @param {number} offset
|
|
486
|
+
* @param {DecodeOptions} options
|
|
487
|
+
* @returns {number|bigint}
|
|
476
488
|
*/
|
|
477
|
-
(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
const alloc = useBuffer ? (size) => {
|
|
488
|
-
return globalThis.Buffer.allocUnsafe(size);
|
|
489
|
-
} :
|
|
489
|
+
function readUint64(data, offset, options) {
|
|
490
|
+
assertEnoughData(data, offset, 8);
|
|
491
|
+
const hi = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];
|
|
492
|
+
const lo = data[offset + 4] * 16777216 + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7];
|
|
493
|
+
const value = (BigInt(hi) << BigInt(32)) + BigInt(lo);
|
|
494
|
+
if (options.strict === true && value < uintBoundaries[3]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
|
|
495
|
+
if (value <= Number.MAX_SAFE_INTEGER) return Number(value);
|
|
496
|
+
if (options.allowBigInt === true) return value;
|
|
497
|
+
throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`);
|
|
498
|
+
}
|
|
490
499
|
/**
|
|
491
|
-
* @param {
|
|
492
|
-
* @
|
|
500
|
+
* @param {Uint8Array} data
|
|
501
|
+
* @param {number} pos
|
|
502
|
+
* @param {number} _minor
|
|
503
|
+
* @param {DecodeOptions} options
|
|
504
|
+
* @returns {Token}
|
|
493
505
|
*/
|
|
494
|
-
(
|
|
495
|
-
return new
|
|
496
|
-
}
|
|
506
|
+
function decodeUint8(data, pos, _minor, options) {
|
|
507
|
+
return new Token(Type.uint, readUint8(data, pos + 1, options), 2);
|
|
508
|
+
}
|
|
497
509
|
/**
|
|
498
|
-
* @param {Uint8Array}
|
|
499
|
-
* @param {
|
|
500
|
-
* @
|
|
510
|
+
* @param {Uint8Array} data
|
|
511
|
+
* @param {number} pos
|
|
512
|
+
* @param {number} _minor
|
|
513
|
+
* @param {DecodeOptions} options
|
|
514
|
+
* @returns {Token}
|
|
501
515
|
*/
|
|
502
|
-
function
|
|
503
|
-
|
|
504
|
-
for (let i = 0; i < b1.length; i++) {
|
|
505
|
-
if (b1[i] === b2[i]) continue;
|
|
506
|
-
return b1[i] < b2[i] ? -1 : 1;
|
|
507
|
-
}
|
|
508
|
-
return 0;
|
|
516
|
+
function decodeUint16(data, pos, _minor, options) {
|
|
517
|
+
return new Token(Type.uint, readUint16(data, pos + 1, options), 3);
|
|
509
518
|
}
|
|
510
519
|
/**
|
|
511
|
-
* @param {
|
|
512
|
-
* @
|
|
520
|
+
* @param {Uint8Array} data
|
|
521
|
+
* @param {number} pos
|
|
522
|
+
* @param {number} _minor
|
|
523
|
+
* @param {DecodeOptions} options
|
|
524
|
+
* @returns {Token}
|
|
513
525
|
*/
|
|
514
|
-
function
|
|
515
|
-
|
|
516
|
-
let p = 0;
|
|
517
|
-
for (let i = 0; i < str.length; i++) {
|
|
518
|
-
let c = str.charCodeAt(i);
|
|
519
|
-
if (c < 128) out[p++] = c;
|
|
520
|
-
else if (c < 2048) {
|
|
521
|
-
out[p++] = c >> 6 | 192;
|
|
522
|
-
out[p++] = c & 63 | 128;
|
|
523
|
-
} else if ((c & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
524
|
-
c = 65536 + ((c & 1023) << 10) + (str.charCodeAt(++i) & 1023);
|
|
525
|
-
out[p++] = c >> 18 | 240;
|
|
526
|
-
out[p++] = c >> 12 & 63 | 128;
|
|
527
|
-
out[p++] = c >> 6 & 63 | 128;
|
|
528
|
-
out[p++] = c & 63 | 128;
|
|
529
|
-
} else {
|
|
530
|
-
if (c >= 55296 && c <= 57343) c = 65533;
|
|
531
|
-
out[p++] = c >> 12 | 224;
|
|
532
|
-
out[p++] = c >> 6 & 63 | 128;
|
|
533
|
-
out[p++] = c & 63 | 128;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
return out;
|
|
526
|
+
function decodeUint32(data, pos, _minor, options) {
|
|
527
|
+
return new Token(Type.uint, readUint32(data, pos + 1, options), 5);
|
|
537
528
|
}
|
|
538
|
-
//#endregion
|
|
539
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/bl.js
|
|
540
529
|
/**
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
* must be called to extend its length to cover the inserted data.
|
|
547
|
-
* The toBytes() call will convert all internal memory to a single Uint8Array of
|
|
548
|
-
* the correct length, truncating any data that is stored but hasn't been
|
|
549
|
-
* included by an increment().
|
|
550
|
-
* get() can retrieve a single byte.
|
|
551
|
-
* All operations (except toBytes()) take an "offset" argument that will perform
|
|
552
|
-
* the write at the offset _from the current cursor_. For most operations this
|
|
553
|
-
* will be `0` to write at the current cursor position but it can be ahead of
|
|
554
|
-
* the current cursor. Negative offsets probably work but are untested.
|
|
530
|
+
* @param {Uint8Array} data
|
|
531
|
+
* @param {number} pos
|
|
532
|
+
* @param {number} _minor
|
|
533
|
+
* @param {DecodeOptions} options
|
|
534
|
+
* @returns {Token}
|
|
555
535
|
*/
|
|
536
|
+
function decodeUint64(data, pos, _minor, options) {
|
|
537
|
+
return new Token(Type.uint, readUint64(data, pos + 1, options), 9);
|
|
538
|
+
}
|
|
556
539
|
/**
|
|
557
|
-
* @
|
|
558
|
-
* @
|
|
540
|
+
* @param {ByteWriter} writer
|
|
541
|
+
* @param {Token} token
|
|
559
542
|
*/
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
543
|
+
function encodeUint(writer, token) {
|
|
544
|
+
return encodeUintValue(writer, 0, token.value);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* @param {ByteWriter} writer
|
|
548
|
+
* @param {number} major
|
|
549
|
+
* @param {number|bigint} uint
|
|
550
|
+
*/
|
|
551
|
+
function encodeUintValue(writer, major, uint) {
|
|
552
|
+
if (uint < uintBoundaries[0]) {
|
|
553
|
+
const nuint = Number(uint);
|
|
554
|
+
writer.pushByte(major | nuint);
|
|
555
|
+
} else if (uint < uintBoundaries[1]) {
|
|
556
|
+
const nuint = Number(uint);
|
|
557
|
+
writer.push([major | 24, nuint]);
|
|
558
|
+
} else if (uint < uintBoundaries[2]) {
|
|
559
|
+
const nuint = Number(uint);
|
|
560
|
+
writer.push([
|
|
561
|
+
major | 25,
|
|
562
|
+
nuint >>> 8,
|
|
563
|
+
nuint & 255
|
|
564
|
+
]);
|
|
565
|
+
} else if (uint < uintBoundaries[3]) {
|
|
566
|
+
const nuint = Number(uint);
|
|
567
|
+
writer.push([
|
|
568
|
+
major | 26,
|
|
569
|
+
nuint >>> 24 & 255,
|
|
570
|
+
nuint >>> 16 & 255,
|
|
571
|
+
nuint >>> 8 & 255,
|
|
572
|
+
nuint & 255
|
|
573
|
+
]);
|
|
574
|
+
} else {
|
|
575
|
+
const buint = BigInt(uint);
|
|
576
|
+
if (buint < uintBoundaries[4]) {
|
|
577
|
+
const set = [
|
|
578
|
+
major | 27,
|
|
579
|
+
0,
|
|
580
|
+
0,
|
|
581
|
+
0,
|
|
582
|
+
0,
|
|
583
|
+
0,
|
|
584
|
+
0,
|
|
585
|
+
0
|
|
586
|
+
];
|
|
587
|
+
let lo = Number(buint & BigInt(4294967295));
|
|
588
|
+
let hi = Number(buint >> BigInt(32) & BigInt(4294967295));
|
|
589
|
+
set[8] = lo & 255;
|
|
590
|
+
lo = lo >> 8;
|
|
591
|
+
set[7] = lo & 255;
|
|
592
|
+
lo = lo >> 8;
|
|
593
|
+
set[6] = lo & 255;
|
|
594
|
+
lo = lo >> 8;
|
|
595
|
+
set[5] = lo & 255;
|
|
596
|
+
set[4] = hi & 255;
|
|
597
|
+
hi = hi >> 8;
|
|
598
|
+
set[3] = hi & 255;
|
|
599
|
+
hi = hi >> 8;
|
|
600
|
+
set[2] = hi & 255;
|
|
601
|
+
hi = hi >> 8;
|
|
602
|
+
set[1] = hi & 255;
|
|
603
|
+
writer.push(set);
|
|
604
|
+
} else throw new Error(`${decodeErrPrefix} encountered BigInt larger than allowable range`);
|
|
575
605
|
}
|
|
576
|
-
reset() {
|
|
577
|
-
this.cursor = 0;
|
|
578
|
-
this.maxCursor = -1;
|
|
579
|
-
if (this.chunks.length) this.chunks = [];
|
|
580
|
-
if (this._initReuseChunk !== null) {
|
|
581
|
-
this.chunks.push(this._initReuseChunk);
|
|
582
|
-
this.maxCursor = this._initReuseChunk.length - 1;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* @param {number} byte
|
|
587
|
-
*/
|
|
588
|
-
pushByte(byte) {
|
|
589
|
-
let topChunk = this.chunks[this.chunks.length - 1];
|
|
590
|
-
if (this.cursor > this.maxCursor) {
|
|
591
|
-
topChunk = alloc(this.chunkSize);
|
|
592
|
-
this.chunks.push(topChunk);
|
|
593
|
-
this.maxCursor += topChunk.length;
|
|
594
|
-
if (this._initReuseChunk === null) this._initReuseChunk = topChunk;
|
|
595
|
-
}
|
|
596
|
-
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
|
597
|
-
topChunk[chunkPos] = byte;
|
|
598
|
-
this.cursor++;
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* @param {ByteView|number[]} bytes
|
|
602
|
-
*/
|
|
603
|
-
push(bytes) {
|
|
604
|
-
let topChunk = this.chunks[this.chunks.length - 1];
|
|
605
|
-
if (this.cursor + bytes.length <= this.maxCursor + 1) {
|
|
606
|
-
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
|
607
|
-
topChunk.set(bytes, chunkPos);
|
|
608
|
-
} else {
|
|
609
|
-
if (topChunk) {
|
|
610
|
-
const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;
|
|
611
|
-
if (chunkPos < topChunk.length) {
|
|
612
|
-
this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos);
|
|
613
|
-
this.maxCursor = this.cursor - 1;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
if (bytes.length < 64 && bytes.length < this.chunkSize) {
|
|
617
|
-
topChunk = alloc(this.chunkSize);
|
|
618
|
-
this.chunks.push(topChunk);
|
|
619
|
-
this.maxCursor += topChunk.length;
|
|
620
|
-
if (this._initReuseChunk === null) this._initReuseChunk = topChunk;
|
|
621
|
-
topChunk.set(bytes, 0);
|
|
622
|
-
} else {
|
|
623
|
-
this.chunks.push(bytes);
|
|
624
|
-
this.maxCursor += bytes.length;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
this.cursor += bytes.length;
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* @param {boolean} [reset]
|
|
631
|
-
* @returns {AllocatedByteView}
|
|
632
|
-
*/
|
|
633
|
-
toBytes(reset = false) {
|
|
634
|
-
let byts;
|
|
635
|
-
if (this.chunks.length === 1) {
|
|
636
|
-
const chunk = this.chunks[0];
|
|
637
|
-
if (reset && this.cursor > chunk.length / 2) {
|
|
638
|
-
byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor);
|
|
639
|
-
this._initReuseChunk = null;
|
|
640
|
-
this.chunks = [];
|
|
641
|
-
} else byts = slice(chunk, 0, this.cursor);
|
|
642
|
-
} else byts = concat(this.chunks, this.cursor);
|
|
643
|
-
if (reset) this.reset();
|
|
644
|
-
return byts;
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
/**
|
|
648
|
-
* U8Bl is a buffer list that writes directly to a user-provided Uint8Array.
|
|
649
|
-
* It provides the same interface as Bl but writes to a fixed destination.
|
|
650
|
-
* @template {ArrayBufferLike} T
|
|
651
|
-
*/
|
|
652
|
-
var U8Bl = class {
|
|
653
|
-
/**
|
|
654
|
-
* @param {Uint8Array<T>} dest
|
|
655
|
-
*/
|
|
656
|
-
constructor(dest) {
|
|
657
|
-
this.dest = dest;
|
|
658
|
-
/** @type {number} */
|
|
659
|
-
this.cursor = 0;
|
|
660
|
-
/** @type {Array<Uint8Array<T>>} */
|
|
661
|
-
this.chunks = [dest];
|
|
662
|
-
}
|
|
663
|
-
reset() {
|
|
664
|
-
this.cursor = 0;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* @param {number} byte
|
|
668
|
-
*/
|
|
669
|
-
pushByte(byte) {
|
|
670
|
-
if (this.cursor >= this.dest.length) throw new Error("write out of bounds, destination buffer is too small");
|
|
671
|
-
this.dest[this.cursor++] = byte;
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* @param {ByteView|number[]} bytes
|
|
675
|
-
*/
|
|
676
|
-
push(bytes) {
|
|
677
|
-
if (this.cursor + bytes.length > this.dest.length) throw new Error("write out of bounds, destination buffer is too small");
|
|
678
|
-
this.dest.set(bytes, this.cursor);
|
|
679
|
-
this.cursor += bytes.length;
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* @param {boolean} [reset]
|
|
683
|
-
* @returns {Uint8Array<T>}
|
|
684
|
-
*/
|
|
685
|
-
toBytes(reset = false) {
|
|
686
|
-
const byts = this.dest.subarray(0, this.cursor);
|
|
687
|
-
if (reset) this.reset();
|
|
688
|
-
return byts;
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
//#endregion
|
|
692
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/common.js
|
|
693
|
-
const decodeErrPrefix = "CBOR decode error:";
|
|
694
|
-
const encodeErrPrefix = "CBOR encode error:";
|
|
695
|
-
const uintMinorPrefixBytes = [];
|
|
696
|
-
uintMinorPrefixBytes[23] = 1;
|
|
697
|
-
uintMinorPrefixBytes[24] = 2;
|
|
698
|
-
uintMinorPrefixBytes[25] = 3;
|
|
699
|
-
uintMinorPrefixBytes[26] = 5;
|
|
700
|
-
uintMinorPrefixBytes[27] = 9;
|
|
701
|
-
/**
|
|
702
|
-
* @param {Uint8Array} data
|
|
703
|
-
* @param {number} pos
|
|
704
|
-
* @param {number} need
|
|
705
|
-
*/
|
|
706
|
-
function assertEnoughData(data, pos, need) {
|
|
707
|
-
if (data.length - pos < need) throw new Error(`${decodeErrPrefix} not enough data for type`);
|
|
708
606
|
}
|
|
709
|
-
//#endregion
|
|
710
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/0uint.js
|
|
711
|
-
const uintBoundaries = [
|
|
712
|
-
24,
|
|
713
|
-
256,
|
|
714
|
-
65536,
|
|
715
|
-
4294967296,
|
|
716
|
-
BigInt("18446744073709551616")
|
|
717
|
-
];
|
|
718
|
-
/**
|
|
719
|
-
* @typedef {import('../interface.js').ByteWriter} ByteWriter
|
|
720
|
-
* @typedef {import('../interface.js').DecodeOptions} DecodeOptions
|
|
721
|
-
*/
|
|
722
607
|
/**
|
|
723
|
-
* @param {
|
|
724
|
-
* @param {number} offset
|
|
725
|
-
* @param {DecodeOptions} options
|
|
608
|
+
* @param {Token} token
|
|
726
609
|
* @returns {number}
|
|
727
610
|
*/
|
|
728
|
-
function
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (options.strict === true && value < uintBoundaries[0]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
|
|
732
|
-
return value;
|
|
733
|
-
}
|
|
611
|
+
encodeUint.encodedSize = function encodedSize(token) {
|
|
612
|
+
return encodeUintValue.encodedSize(token.value);
|
|
613
|
+
};
|
|
734
614
|
/**
|
|
735
|
-
* @param {
|
|
736
|
-
* @param {number} offset
|
|
737
|
-
* @param {DecodeOptions} options
|
|
615
|
+
* @param {number} uint
|
|
738
616
|
* @returns {number}
|
|
739
617
|
*/
|
|
740
|
-
function
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
if (
|
|
744
|
-
return
|
|
745
|
-
|
|
618
|
+
encodeUintValue.encodedSize = function encodedSize(uint) {
|
|
619
|
+
if (uint < uintBoundaries[0]) return 1;
|
|
620
|
+
if (uint < uintBoundaries[1]) return 2;
|
|
621
|
+
if (uint < uintBoundaries[2]) return 3;
|
|
622
|
+
if (uint < uintBoundaries[3]) return 5;
|
|
623
|
+
return 9;
|
|
624
|
+
};
|
|
746
625
|
/**
|
|
747
|
-
* @param {
|
|
748
|
-
* @param {
|
|
749
|
-
* @param {DecodeOptions} options
|
|
626
|
+
* @param {Token} tok1
|
|
627
|
+
* @param {Token} tok2
|
|
750
628
|
* @returns {number}
|
|
751
629
|
*/
|
|
752
|
-
function
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
630
|
+
encodeUint.compareTokens = function compareTokens(tok1, tok2) {
|
|
631
|
+
return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0;
|
|
632
|
+
};
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/1negint.js
|
|
758
635
|
/**
|
|
759
|
-
* @
|
|
760
|
-
* @
|
|
761
|
-
* @param {DecodeOptions} options
|
|
762
|
-
* @returns {number|bigint}
|
|
636
|
+
* @typedef {import('../interface.js').ByteWriter} ByteWriter
|
|
637
|
+
* @typedef {import('../interface.js').DecodeOptions} DecodeOptions
|
|
763
638
|
*/
|
|
764
|
-
function readUint64(data, offset, options) {
|
|
765
|
-
assertEnoughData(data, offset, 8);
|
|
766
|
-
const hi = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];
|
|
767
|
-
const lo = data[offset + 4] * 16777216 + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7];
|
|
768
|
-
const value = (BigInt(hi) << BigInt(32)) + BigInt(lo);
|
|
769
|
-
if (options.strict === true && value < uintBoundaries[3]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
|
|
770
|
-
if (value <= Number.MAX_SAFE_INTEGER) return Number(value);
|
|
771
|
-
if (options.allowBigInt === true) return value;
|
|
772
|
-
throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`);
|
|
773
|
-
}
|
|
774
639
|
/**
|
|
775
640
|
* @param {Uint8Array} data
|
|
776
641
|
* @param {number} pos
|
|
@@ -778,8 +643,8 @@ function readUint64(data, offset, options) {
|
|
|
778
643
|
* @param {DecodeOptions} options
|
|
779
644
|
* @returns {Token}
|
|
780
645
|
*/
|
|
781
|
-
function
|
|
782
|
-
return new Token(Type.
|
|
646
|
+
function decodeNegint8(data, pos, _minor, options) {
|
|
647
|
+
return new Token(Type.negint, -1 - readUint8(data, pos + 1, options), 2);
|
|
783
648
|
}
|
|
784
649
|
/**
|
|
785
650
|
* @param {Uint8Array} data
|
|
@@ -788,8 +653,8 @@ function decodeUint8(data, pos, _minor, options) {
|
|
|
788
653
|
* @param {DecodeOptions} options
|
|
789
654
|
* @returns {Token}
|
|
790
655
|
*/
|
|
791
|
-
function
|
|
792
|
-
return new Token(Type.
|
|
656
|
+
function decodeNegint16(data, pos, _minor, options) {
|
|
657
|
+
return new Token(Type.negint, -1 - readUint16(data, pos + 1, options), 3);
|
|
793
658
|
}
|
|
794
659
|
/**
|
|
795
660
|
* @param {Uint8Array} data
|
|
@@ -798,9 +663,11 @@ function decodeUint16(data, pos, _minor, options) {
|
|
|
798
663
|
* @param {DecodeOptions} options
|
|
799
664
|
* @returns {Token}
|
|
800
665
|
*/
|
|
801
|
-
function
|
|
802
|
-
return new Token(Type.
|
|
666
|
+
function decodeNegint32(data, pos, _minor, options) {
|
|
667
|
+
return new Token(Type.negint, -1 - readUint32(data, pos + 1, options), 5);
|
|
803
668
|
}
|
|
669
|
+
const neg1b$1 = BigInt(-1);
|
|
670
|
+
const pos1b$1 = BigInt(1);
|
|
804
671
|
/**
|
|
805
672
|
* @param {Uint8Array} data
|
|
806
673
|
* @param {number} pos
|
|
@@ -808,169 +675,27 @@ function decodeUint32(data, pos, _minor, options) {
|
|
|
808
675
|
* @param {DecodeOptions} options
|
|
809
676
|
* @returns {Token}
|
|
810
677
|
*/
|
|
811
|
-
function
|
|
812
|
-
|
|
678
|
+
function decodeNegint64(data, pos, _minor, options) {
|
|
679
|
+
const int = readUint64(data, pos + 1, options);
|
|
680
|
+
if (typeof int !== "bigint") {
|
|
681
|
+
const value = -1 - int;
|
|
682
|
+
if (value >= Number.MIN_SAFE_INTEGER) return new Token(Type.negint, value, 9);
|
|
683
|
+
}
|
|
684
|
+
if (options.allowBigInt !== true) throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`);
|
|
685
|
+
return new Token(Type.negint, neg1b$1 - BigInt(int), 9);
|
|
813
686
|
}
|
|
814
687
|
/**
|
|
815
688
|
* @param {ByteWriter} writer
|
|
816
689
|
* @param {Token} token
|
|
817
690
|
*/
|
|
818
|
-
function
|
|
819
|
-
|
|
691
|
+
function encodeNegint(writer, token) {
|
|
692
|
+
const negint = token.value;
|
|
693
|
+
const unsigned = typeof negint === "bigint" ? negint * neg1b$1 - pos1b$1 : negint * -1 - 1;
|
|
694
|
+
encodeUintValue(writer, token.type.majorEncoded, unsigned);
|
|
820
695
|
}
|
|
821
696
|
/**
|
|
822
|
-
* @param {
|
|
823
|
-
* @
|
|
824
|
-
* @param {number|bigint} uint
|
|
825
|
-
*/
|
|
826
|
-
function encodeUintValue(writer, major, uint) {
|
|
827
|
-
if (uint < uintBoundaries[0]) {
|
|
828
|
-
const nuint = Number(uint);
|
|
829
|
-
writer.pushByte(major | nuint);
|
|
830
|
-
} else if (uint < uintBoundaries[1]) {
|
|
831
|
-
const nuint = Number(uint);
|
|
832
|
-
writer.push([major | 24, nuint]);
|
|
833
|
-
} else if (uint < uintBoundaries[2]) {
|
|
834
|
-
const nuint = Number(uint);
|
|
835
|
-
writer.push([
|
|
836
|
-
major | 25,
|
|
837
|
-
nuint >>> 8,
|
|
838
|
-
nuint & 255
|
|
839
|
-
]);
|
|
840
|
-
} else if (uint < uintBoundaries[3]) {
|
|
841
|
-
const nuint = Number(uint);
|
|
842
|
-
writer.push([
|
|
843
|
-
major | 26,
|
|
844
|
-
nuint >>> 24 & 255,
|
|
845
|
-
nuint >>> 16 & 255,
|
|
846
|
-
nuint >>> 8 & 255,
|
|
847
|
-
nuint & 255
|
|
848
|
-
]);
|
|
849
|
-
} else {
|
|
850
|
-
const buint = BigInt(uint);
|
|
851
|
-
if (buint < uintBoundaries[4]) {
|
|
852
|
-
const set = [
|
|
853
|
-
major | 27,
|
|
854
|
-
0,
|
|
855
|
-
0,
|
|
856
|
-
0,
|
|
857
|
-
0,
|
|
858
|
-
0,
|
|
859
|
-
0,
|
|
860
|
-
0
|
|
861
|
-
];
|
|
862
|
-
let lo = Number(buint & BigInt(4294967295));
|
|
863
|
-
let hi = Number(buint >> BigInt(32) & BigInt(4294967295));
|
|
864
|
-
set[8] = lo & 255;
|
|
865
|
-
lo = lo >> 8;
|
|
866
|
-
set[7] = lo & 255;
|
|
867
|
-
lo = lo >> 8;
|
|
868
|
-
set[6] = lo & 255;
|
|
869
|
-
lo = lo >> 8;
|
|
870
|
-
set[5] = lo & 255;
|
|
871
|
-
set[4] = hi & 255;
|
|
872
|
-
hi = hi >> 8;
|
|
873
|
-
set[3] = hi & 255;
|
|
874
|
-
hi = hi >> 8;
|
|
875
|
-
set[2] = hi & 255;
|
|
876
|
-
hi = hi >> 8;
|
|
877
|
-
set[1] = hi & 255;
|
|
878
|
-
writer.push(set);
|
|
879
|
-
} else throw new Error(`${decodeErrPrefix} encountered BigInt larger than allowable range`);
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* @param {Token} token
|
|
884
|
-
* @returns {number}
|
|
885
|
-
*/
|
|
886
|
-
encodeUint.encodedSize = function encodedSize(token) {
|
|
887
|
-
return encodeUintValue.encodedSize(token.value);
|
|
888
|
-
};
|
|
889
|
-
/**
|
|
890
|
-
* @param {number} uint
|
|
891
|
-
* @returns {number}
|
|
892
|
-
*/
|
|
893
|
-
encodeUintValue.encodedSize = function encodedSize(uint) {
|
|
894
|
-
if (uint < uintBoundaries[0]) return 1;
|
|
895
|
-
if (uint < uintBoundaries[1]) return 2;
|
|
896
|
-
if (uint < uintBoundaries[2]) return 3;
|
|
897
|
-
if (uint < uintBoundaries[3]) return 5;
|
|
898
|
-
return 9;
|
|
899
|
-
};
|
|
900
|
-
/**
|
|
901
|
-
* @param {Token} tok1
|
|
902
|
-
* @param {Token} tok2
|
|
903
|
-
* @returns {number}
|
|
904
|
-
*/
|
|
905
|
-
encodeUint.compareTokens = function compareTokens(tok1, tok2) {
|
|
906
|
-
return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0;
|
|
907
|
-
};
|
|
908
|
-
//#endregion
|
|
909
|
-
//#region ../../node_modules/.bun/cborg@6.1.2/node_modules/cborg/lib/1negint.js
|
|
910
|
-
/**
|
|
911
|
-
* @typedef {import('../interface.js').ByteWriter} ByteWriter
|
|
912
|
-
* @typedef {import('../interface.js').DecodeOptions} DecodeOptions
|
|
913
|
-
*/
|
|
914
|
-
/**
|
|
915
|
-
* @param {Uint8Array} data
|
|
916
|
-
* @param {number} pos
|
|
917
|
-
* @param {number} _minor
|
|
918
|
-
* @param {DecodeOptions} options
|
|
919
|
-
* @returns {Token}
|
|
920
|
-
*/
|
|
921
|
-
function decodeNegint8(data, pos, _minor, options) {
|
|
922
|
-
return new Token(Type.negint, -1 - readUint8(data, pos + 1, options), 2);
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* @param {Uint8Array} data
|
|
926
|
-
* @param {number} pos
|
|
927
|
-
* @param {number} _minor
|
|
928
|
-
* @param {DecodeOptions} options
|
|
929
|
-
* @returns {Token}
|
|
930
|
-
*/
|
|
931
|
-
function decodeNegint16(data, pos, _minor, options) {
|
|
932
|
-
return new Token(Type.negint, -1 - readUint16(data, pos + 1, options), 3);
|
|
933
|
-
}
|
|
934
|
-
/**
|
|
935
|
-
* @param {Uint8Array} data
|
|
936
|
-
* @param {number} pos
|
|
937
|
-
* @param {number} _minor
|
|
938
|
-
* @param {DecodeOptions} options
|
|
939
|
-
* @returns {Token}
|
|
940
|
-
*/
|
|
941
|
-
function decodeNegint32(data, pos, _minor, options) {
|
|
942
|
-
return new Token(Type.negint, -1 - readUint32(data, pos + 1, options), 5);
|
|
943
|
-
}
|
|
944
|
-
const neg1b$1 = BigInt(-1);
|
|
945
|
-
const pos1b$1 = BigInt(1);
|
|
946
|
-
/**
|
|
947
|
-
* @param {Uint8Array} data
|
|
948
|
-
* @param {number} pos
|
|
949
|
-
* @param {number} _minor
|
|
950
|
-
* @param {DecodeOptions} options
|
|
951
|
-
* @returns {Token}
|
|
952
|
-
*/
|
|
953
|
-
function decodeNegint64(data, pos, _minor, options) {
|
|
954
|
-
const int = readUint64(data, pos + 1, options);
|
|
955
|
-
if (typeof int !== "bigint") {
|
|
956
|
-
const value = -1 - int;
|
|
957
|
-
if (value >= Number.MIN_SAFE_INTEGER) return new Token(Type.negint, value, 9);
|
|
958
|
-
}
|
|
959
|
-
if (options.allowBigInt !== true) throw new Error(`${decodeErrPrefix} integers outside of the safe integer range are not supported`);
|
|
960
|
-
return new Token(Type.negint, neg1b$1 - BigInt(int), 9);
|
|
961
|
-
}
|
|
962
|
-
/**
|
|
963
|
-
* @param {ByteWriter} writer
|
|
964
|
-
* @param {Token} token
|
|
965
|
-
*/
|
|
966
|
-
function encodeNegint(writer, token) {
|
|
967
|
-
const negint = token.value;
|
|
968
|
-
const unsigned = typeof negint === "bigint" ? negint * neg1b$1 - pos1b$1 : negint * -1 - 1;
|
|
969
|
-
encodeUintValue(writer, token.type.majorEncoded, unsigned);
|
|
970
|
-
}
|
|
971
|
-
/**
|
|
972
|
-
* @param {Token} token
|
|
973
|
-
* @returns {number}
|
|
697
|
+
* @param {Token} token
|
|
698
|
+
* @returns {number}
|
|
974
699
|
*/
|
|
975
700
|
encodeNegint.encodedSize = function encodedSize(token) {
|
|
976
701
|
const negint = token.value;
|
|
@@ -2672,148 +2397,423 @@ function invalid() {
|
|
|
2672
2397
|
function assertUnsignedSafeInteger(value) {
|
|
2673
2398
|
if (!Number.isSafeInteger(value) || value < 0) invalid();
|
|
2674
2399
|
}
|
|
2675
|
-
function assertProtocolVersion(value) {
|
|
2676
|
-
if (!Number.isSafeInteger(value) || value < 0 || value > 65535) invalid();
|
|
2400
|
+
function assertProtocolVersion(value) {
|
|
2401
|
+
if (!Number.isSafeInteger(value) || value < 0 || value > 65535) invalid();
|
|
2402
|
+
}
|
|
2403
|
+
function assertIdentifier(value, pattern) {
|
|
2404
|
+
if (!pattern.test(value)) invalid();
|
|
2405
|
+
}
|
|
2406
|
+
function copyBytes(value, expectedLengths) {
|
|
2407
|
+
if (!(value instanceof Uint8Array) || !expectedLengths.includes(value.byteLength)) invalid();
|
|
2408
|
+
return Uint8Array.from(value);
|
|
2409
|
+
}
|
|
2410
|
+
function canonicalizeHubOrigin(value) {
|
|
2411
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 512) invalid();
|
|
2412
|
+
let url;
|
|
2413
|
+
try {
|
|
2414
|
+
url = new URL(value);
|
|
2415
|
+
} catch {
|
|
2416
|
+
return invalid();
|
|
2417
|
+
}
|
|
2418
|
+
const isLoopbackHttp = url.protocol === "http:" && LOOPBACK_HOSTS.has(url.hostname);
|
|
2419
|
+
if (url.protocol !== "https:" && !isLoopbackHttp || url.username !== "" || url.password !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "" || value !== url.origin) invalid();
|
|
2420
|
+
return url.origin;
|
|
2421
|
+
}
|
|
2422
|
+
function normalizeHubNodeName(value) {
|
|
2423
|
+
if (typeof value !== "string") invalid();
|
|
2424
|
+
const normalized = value.trim();
|
|
2425
|
+
if (normalized.length === 0 || normalized.length > 100) invalid();
|
|
2426
|
+
return normalized;
|
|
2427
|
+
}
|
|
2428
|
+
function validateNodePublicKey(descriptor) {
|
|
2429
|
+
if (descriptor.algorithm === "ed25519") return {
|
|
2430
|
+
algorithm: descriptor.algorithm,
|
|
2431
|
+
publicKey: copyBytes(descriptor.publicKey, [32])
|
|
2432
|
+
};
|
|
2433
|
+
if (descriptor.algorithm === "p256") {
|
|
2434
|
+
const publicKey = copyBytes(descriptor.publicKey, [33, 65]);
|
|
2435
|
+
const prefix = publicKey[0];
|
|
2436
|
+
if (publicKey.byteLength === 33 && prefix !== 2 && prefix !== 3 || publicKey.byteLength === 65 && prefix !== 4) invalid();
|
|
2437
|
+
return {
|
|
2438
|
+
algorithm: descriptor.algorithm,
|
|
2439
|
+
publicKey
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
return invalid();
|
|
2443
|
+
}
|
|
2444
|
+
function fingerprintNodePublicKey(descriptor) {
|
|
2445
|
+
const key = validateNodePublicKey(descriptor);
|
|
2446
|
+
const canonical = encode([
|
|
2447
|
+
NODE_KEY_FINGERPRINT_DOMAIN,
|
|
2448
|
+
key.algorithm,
|
|
2449
|
+
key.publicKey
|
|
2450
|
+
], rfc8949EncodeOptions);
|
|
2451
|
+
return Uint8Array.from(createHash("sha256").update(canonical).digest());
|
|
2452
|
+
}
|
|
2453
|
+
function formatNodePublicKeyFingerprint(fingerprint) {
|
|
2454
|
+
const bytes = copyBytes(fingerprint, [32]);
|
|
2455
|
+
return `SHA256:${Buffer.from(bytes).toString("base64url")}`;
|
|
2456
|
+
}
|
|
2457
|
+
function encodeNodeAuthenticationTranscript(input) {
|
|
2458
|
+
const hubOrigin = canonicalizeHubOrigin(input.hubOrigin);
|
|
2459
|
+
assertProtocolVersion(input.protocolMajor);
|
|
2460
|
+
assertProtocolVersion(input.protocolMinor);
|
|
2461
|
+
assertIdentifier(input.nodeId, NODE_ID);
|
|
2462
|
+
assertIdentifier(input.activeKeyId, NODE_KEY_ID);
|
|
2463
|
+
assertUnsignedSafeInteger(input.challengeExpiresAt);
|
|
2464
|
+
const challenge = copyBytes(input.challenge, [32]);
|
|
2465
|
+
return Uint8Array.from(encode([
|
|
2466
|
+
NODE_AUTH_TRANSCRIPT_DOMAIN,
|
|
2467
|
+
hubOrigin,
|
|
2468
|
+
input.protocolMajor,
|
|
2469
|
+
input.protocolMinor,
|
|
2470
|
+
input.nodeId,
|
|
2471
|
+
input.activeKeyId,
|
|
2472
|
+
input.challengeExpiresAt,
|
|
2473
|
+
challenge
|
|
2474
|
+
], rfc8949EncodeOptions));
|
|
2475
|
+
}
|
|
2476
|
+
function encodeNodeKeyRotationTranscript(input) {
|
|
2477
|
+
const hubOrigin = canonicalizeHubOrigin(input.hubOrigin);
|
|
2478
|
+
assertProtocolVersion(input.protocolMajor);
|
|
2479
|
+
assertProtocolVersion(input.protocolMinor);
|
|
2480
|
+
assertIdentifier(input.rotationRequestId, ROTATION_REQUEST_ID);
|
|
2481
|
+
assertIdentifier(input.nodeId, NODE_ID);
|
|
2482
|
+
assertIdentifier(input.oldActiveKeyId, NODE_KEY_ID);
|
|
2483
|
+
assertIdentifier(input.newKeyId, NODE_KEY_ID);
|
|
2484
|
+
assertUnsignedSafeInteger(input.challengeExpiresAt);
|
|
2485
|
+
const newKey = validateNodePublicKey(input.newKey);
|
|
2486
|
+
const fingerprint = fingerprintNodePublicKey(newKey);
|
|
2487
|
+
const challenge = copyBytes(input.challenge, [32]);
|
|
2488
|
+
return Uint8Array.from(encode([
|
|
2489
|
+
NODE_KEY_ROTATION_TRANSCRIPT_DOMAIN,
|
|
2490
|
+
hubOrigin,
|
|
2491
|
+
input.protocolMajor,
|
|
2492
|
+
input.protocolMinor,
|
|
2493
|
+
input.rotationRequestId,
|
|
2494
|
+
input.nodeId,
|
|
2495
|
+
input.oldActiveKeyId,
|
|
2496
|
+
input.newKeyId,
|
|
2497
|
+
newKey.algorithm,
|
|
2498
|
+
newKey.publicKey,
|
|
2499
|
+
fingerprint,
|
|
2500
|
+
input.challengeExpiresAt,
|
|
2501
|
+
challenge
|
|
2502
|
+
], rfc8949EncodeOptions));
|
|
2503
|
+
}
|
|
2504
|
+
function encodeNativeNodeClaimTranscript(input) {
|
|
2505
|
+
const hubOrigin = canonicalizeHubOrigin(input.hubOrigin);
|
|
2506
|
+
assertProtocolVersion(input.protocolVersion);
|
|
2507
|
+
assertProtocolVersion(input.transcriptVersion);
|
|
2508
|
+
assertIdentifier(input.claimId, NATIVE_NODE_CLAIM_ID);
|
|
2509
|
+
assertIdentifier(input.accountId, ACCOUNT_ID);
|
|
2510
|
+
assertIdentifier(input.spaceId, SPACE_ID);
|
|
2511
|
+
assertIdentifier(input.sessionId, SESSION_ID);
|
|
2512
|
+
const dpopKeyThumbprint = copyBytes(input.dpopKeyThumbprint, [32]);
|
|
2513
|
+
assertIdentifier(input.installationId, DESKTOP_INSTALLATION_ID);
|
|
2514
|
+
assertIdentifier(input.environmentId, ENVIRONMENT_ID);
|
|
2515
|
+
const nodeKey = validateNodePublicKey(input.nodeKey);
|
|
2516
|
+
const nodeFingerprint = fingerprintNodePublicKey(nodeKey);
|
|
2517
|
+
assertUnsignedSafeInteger(input.claimExpiresAt);
|
|
2518
|
+
const challenge = copyBytes(input.challenge, [32]);
|
|
2519
|
+
return Uint8Array.from(encode([
|
|
2520
|
+
NATIVE_NODE_CLAIM_TRANSCRIPT_DOMAIN,
|
|
2521
|
+
hubOrigin,
|
|
2522
|
+
input.protocolVersion,
|
|
2523
|
+
input.transcriptVersion,
|
|
2524
|
+
input.claimId,
|
|
2525
|
+
input.accountId,
|
|
2526
|
+
input.spaceId,
|
|
2527
|
+
input.sessionId,
|
|
2528
|
+
dpopKeyThumbprint,
|
|
2529
|
+
input.installationId,
|
|
2530
|
+
input.environmentId,
|
|
2531
|
+
nodeKey.algorithm,
|
|
2532
|
+
nodeKey.publicKey,
|
|
2533
|
+
nodeFingerprint,
|
|
2534
|
+
input.claimExpiresAt,
|
|
2535
|
+
challenge
|
|
2536
|
+
], rfc8949EncodeOptions));
|
|
2537
|
+
}
|
|
2538
|
+
function equalNodeIdentityBytes(left, right) {
|
|
2539
|
+
if (!(left instanceof Uint8Array) || !(right instanceof Uint8Array)) return false;
|
|
2540
|
+
if (left.byteLength !== right.byteLength) return false;
|
|
2541
|
+
return timingSafeEqual(left, right);
|
|
2542
|
+
}
|
|
2543
|
+
//#endregion
|
|
2544
|
+
//#region ../../packages/shared/src/Struct.ts
|
|
2545
|
+
function deepMerge(current, patch) {
|
|
2546
|
+
if (!P.isObject(current) || !P.isObject(patch)) return patch;
|
|
2547
|
+
const next = { ...current };
|
|
2548
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
2549
|
+
if (value === void 0) continue;
|
|
2550
|
+
const existing = next[key];
|
|
2551
|
+
next[key] = P.isObject(existing) && P.isObject(value) ? deepMerge(existing, value) : value;
|
|
2552
|
+
}
|
|
2553
|
+
return next;
|
|
2554
|
+
}
|
|
2555
|
+
//#endregion
|
|
2556
|
+
//#region ../../packages/shared/src/model.ts
|
|
2557
|
+
const DEFAULT_PROVIDER_DRIVER_KIND = ProviderDriverKind.make("codex");
|
|
2558
|
+
/**
|
|
2559
|
+
* Resolve the human-readable model title used by picker surfaces and durable
|
|
2560
|
+
* handoff presentation. Provider catalogs are authoritative when they carry a
|
|
2561
|
+
* friendly name; the routing slug remains the deterministic final fallback.
|
|
2562
|
+
*/
|
|
2563
|
+
function getModelDisplayName(model, options) {
|
|
2564
|
+
const shortName = trimOrNull(model.shortName);
|
|
2565
|
+
const name = trimOrNull(model.name);
|
|
2566
|
+
const slug = trimOrNull(model.slug) ?? model.slug;
|
|
2567
|
+
return options?.preferShortName ? shortName ?? name ?? slug : name ?? shortName ?? slug;
|
|
2568
|
+
}
|
|
2569
|
+
/** Compose the optional sub-provider prefix exactly as the picker trigger does. */
|
|
2570
|
+
function getModelDisplayLabel(model, options) {
|
|
2571
|
+
const title = getModelDisplayName(model, options);
|
|
2572
|
+
const subProvider = trimOrNull(model.subProvider);
|
|
2573
|
+
return subProvider ? `${subProvider} · ${title}` : title;
|
|
2574
|
+
}
|
|
2575
|
+
function createModelCapabilities(input) {
|
|
2576
|
+
return { optionDescriptors: input.optionDescriptors.map(cloneDescriptor) };
|
|
2577
|
+
}
|
|
2578
|
+
function getRawSelectionValueById(selections, id) {
|
|
2579
|
+
return (selections?.find((candidate) => candidate.id === id))?.value;
|
|
2580
|
+
}
|
|
2581
|
+
function getProviderOptionSelectionValue(selections, id) {
|
|
2582
|
+
return getRawSelectionValueById(selections, id);
|
|
2583
|
+
}
|
|
2584
|
+
function getProviderOptionStringSelectionValue(selections, id) {
|
|
2585
|
+
const value = getProviderOptionSelectionValue(selections, id);
|
|
2586
|
+
return typeof value === "string" ? value : void 0;
|
|
2587
|
+
}
|
|
2588
|
+
function getProviderOptionBooleanSelectionValue(selections, id) {
|
|
2589
|
+
const value = getProviderOptionSelectionValue(selections, id);
|
|
2590
|
+
return typeof value === "boolean" ? value : void 0;
|
|
2591
|
+
}
|
|
2592
|
+
function getModelSelectionStringOptionValue(modelSelection, id) {
|
|
2593
|
+
return getProviderOptionStringSelectionValue(modelSelection?.options, id);
|
|
2594
|
+
}
|
|
2595
|
+
function getModelSelectionBooleanOptionValue(modelSelection, id) {
|
|
2596
|
+
return getProviderOptionBooleanSelectionValue(modelSelection?.options, id);
|
|
2597
|
+
}
|
|
2598
|
+
function resolveDescriptorChoiceValue(descriptor, raw) {
|
|
2599
|
+
const trimmed = trimOrNull(raw);
|
|
2600
|
+
if (!trimmed) return descriptor.currentValue ?? descriptor.options.find((option) => option.isDefault)?.id;
|
|
2601
|
+
if (descriptor.options.length === 0) return trimmed;
|
|
2602
|
+
if (descriptor.promptInjectedValues?.includes(trimmed) && descriptor.options.some((option) => option.id === trimmed)) return descriptor.options.find((option) => option.isDefault)?.id;
|
|
2603
|
+
if (descriptor.options.some((option) => option.id === trimmed)) return trimmed;
|
|
2604
|
+
return descriptor.currentValue ?? descriptor.options.find((option) => option.isDefault)?.id;
|
|
2605
|
+
}
|
|
2606
|
+
function cloneDescriptor(descriptor) {
|
|
2607
|
+
return descriptor.type === "select" ? {
|
|
2608
|
+
...descriptor,
|
|
2609
|
+
options: [...descriptor.options],
|
|
2610
|
+
...descriptor.promptInjectedValues ? { promptInjectedValues: [...descriptor.promptInjectedValues] } : {}
|
|
2611
|
+
} : { ...descriptor };
|
|
2612
|
+
}
|
|
2613
|
+
function cloneSelection(selection) {
|
|
2614
|
+
return { ...selection };
|
|
2615
|
+
}
|
|
2616
|
+
function withDescriptorCurrentValue(descriptor, rawCurrentValue) {
|
|
2617
|
+
if (descriptor.type === "boolean") {
|
|
2618
|
+
if (typeof rawCurrentValue === "boolean") return {
|
|
2619
|
+
...descriptor,
|
|
2620
|
+
currentValue: rawCurrentValue
|
|
2621
|
+
};
|
|
2622
|
+
return descriptor;
|
|
2623
|
+
}
|
|
2624
|
+
const currentValue = typeof rawCurrentValue === "string" ? resolveDescriptorChoiceValue(descriptor, rawCurrentValue) : resolveDescriptorChoiceValue(descriptor, descriptor.currentValue);
|
|
2625
|
+
if (!currentValue) {
|
|
2626
|
+
const { currentValue: _unusedCurrentValue, ...rest } = descriptor;
|
|
2627
|
+
return rest;
|
|
2628
|
+
}
|
|
2629
|
+
return {
|
|
2630
|
+
...descriptor,
|
|
2631
|
+
currentValue
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
function getProviderOptionDescriptors(input) {
|
|
2635
|
+
const { caps, selections } = input;
|
|
2636
|
+
return (caps.optionDescriptors ?? []).map(cloneDescriptor).map((descriptor) => withDescriptorCurrentValue(descriptor, getRawSelectionValueById(selections, descriptor.id) ?? descriptor.currentValue));
|
|
2637
|
+
}
|
|
2638
|
+
function getProviderOptionCurrentValue(descriptor) {
|
|
2639
|
+
if (!descriptor) return;
|
|
2640
|
+
if (descriptor.type === "boolean") return descriptor.currentValue;
|
|
2641
|
+
if (descriptor.currentValue) return descriptor.currentValue;
|
|
2642
|
+
return descriptor.options.find((option) => option.isDefault)?.id;
|
|
2643
|
+
}
|
|
2644
|
+
function normalizeModelSlug(model, provider = DEFAULT_PROVIDER_DRIVER_KIND) {
|
|
2645
|
+
if (typeof model !== "string") return null;
|
|
2646
|
+
const trimmed = model.trim();
|
|
2647
|
+
if (!trimmed) return null;
|
|
2648
|
+
const aliases = MODEL_SLUG_ALIASES_BY_PROVIDER[provider] ?? {};
|
|
2649
|
+
const aliased = Object.prototype.hasOwnProperty.call(aliases, trimmed) ? aliases[trimmed] : void 0;
|
|
2650
|
+
return typeof aliased === "string" ? aliased : trimmed;
|
|
2651
|
+
}
|
|
2652
|
+
/** Trim a string, returning null for empty/missing values. */
|
|
2653
|
+
function trimOrNull(value) {
|
|
2654
|
+
if (typeof value !== "string") return null;
|
|
2655
|
+
return value.trim() || null;
|
|
2656
|
+
}
|
|
2657
|
+
function cloneSelections(selections) {
|
|
2658
|
+
return selections.map(cloneSelection);
|
|
2659
|
+
}
|
|
2660
|
+
function createModelSelection(instanceId, model, options) {
|
|
2661
|
+
const selections = options ? cloneSelections(options) : [];
|
|
2662
|
+
const base = {
|
|
2663
|
+
instanceId,
|
|
2664
|
+
model
|
|
2665
|
+
};
|
|
2666
|
+
return selections.length > 0 ? {
|
|
2667
|
+
...base,
|
|
2668
|
+
options: selections
|
|
2669
|
+
} : base;
|
|
2670
|
+
}
|
|
2671
|
+
/**
|
|
2672
|
+
* Context handoff is a provider-instance boundary. Model and option changes
|
|
2673
|
+
* within one configured instance remain on that provider's normal turn path.
|
|
2674
|
+
*/
|
|
2675
|
+
function modelSelectionRequiresContextHandoff(input) {
|
|
2676
|
+
return input.canonicalSelection.instanceId !== input.targetSelection.instanceId;
|
|
2677
|
+
}
|
|
2678
|
+
/**
|
|
2679
|
+
* Returns the effort value if it is a prompt-injected value according to
|
|
2680
|
+
* any select descriptor in the given capabilities, or null otherwise.
|
|
2681
|
+
*
|
|
2682
|
+
* Unlike a single `find`, this checks every descriptor so that the
|
|
2683
|
+
* correct descriptor's `promptInjectedValues` list is consulted even when
|
|
2684
|
+
* multiple select descriptors exist.
|
|
2685
|
+
*/
|
|
2686
|
+
function resolvePromptInjectedEffort(caps, rawEffort) {
|
|
2687
|
+
const trimmed = trimOrNull(rawEffort);
|
|
2688
|
+
if (!trimmed) return null;
|
|
2689
|
+
const descriptors = getProviderOptionDescriptors({ caps });
|
|
2690
|
+
for (const descriptor of descriptors) if (descriptor.type === "select" && descriptor.promptInjectedValues?.includes(trimmed)) return trimmed;
|
|
2691
|
+
return null;
|
|
2692
|
+
}
|
|
2693
|
+
function applyClaudePromptEffortPrefix(text, effort) {
|
|
2694
|
+
const trimmed = text.trim();
|
|
2695
|
+
if (!trimmed) return trimmed;
|
|
2696
|
+
if (effort !== "ultrathink") return trimmed;
|
|
2697
|
+
if (trimmed.startsWith("Ultrathink:")) return trimmed;
|
|
2698
|
+
return `Ultrathink:\n${trimmed}`;
|
|
2677
2699
|
}
|
|
2678
|
-
|
|
2679
|
-
|
|
2700
|
+
//#endregion
|
|
2701
|
+
//#region ../../packages/shared/src/serverSettings.ts
|
|
2702
|
+
const ServerSettingsJson$1 = fromLenientJson(ServerSettings);
|
|
2703
|
+
function normalizePersistedServerSettingString(value) {
|
|
2704
|
+
const trimmed = value?.trim();
|
|
2705
|
+
return trimmed && trimmed.length > 0 ? trimmed : void 0;
|
|
2680
2706
|
}
|
|
2681
|
-
function
|
|
2682
|
-
|
|
2683
|
-
|
|
2707
|
+
function extractPersistedServerObservabilitySettings(input) {
|
|
2708
|
+
return {
|
|
2709
|
+
otlpTracesUrl: normalizePersistedServerSettingString(input.observability?.otlpTracesUrl),
|
|
2710
|
+
otlpMetricsUrl: normalizePersistedServerSettingString(input.observability?.otlpMetricsUrl)
|
|
2711
|
+
};
|
|
2684
2712
|
}
|
|
2685
|
-
function
|
|
2686
|
-
if (typeof value !== "string" || value.length === 0 || value.length > 512) invalid();
|
|
2687
|
-
let url;
|
|
2713
|
+
function parsePersistedServerObservabilitySettings(raw) {
|
|
2688
2714
|
try {
|
|
2689
|
-
|
|
2715
|
+
return extractPersistedServerObservabilitySettings(Schema.decodeUnknownSync(ServerSettingsJson$1)(raw));
|
|
2690
2716
|
} catch {
|
|
2691
|
-
return invalid();
|
|
2692
|
-
}
|
|
2693
|
-
const isLoopbackHttp = url.protocol === "http:" && LOOPBACK_HOSTS.has(url.hostname);
|
|
2694
|
-
if (url.protocol !== "https:" && !isLoopbackHttp || url.username !== "" || url.password !== "" || url.pathname !== "/" || url.search !== "" || url.hash !== "" || value !== url.origin) invalid();
|
|
2695
|
-
return url.origin;
|
|
2696
|
-
}
|
|
2697
|
-
function normalizeHubNodeName(value) {
|
|
2698
|
-
if (typeof value !== "string") invalid();
|
|
2699
|
-
const normalized = value.trim();
|
|
2700
|
-
if (normalized.length === 0 || normalized.length > 100) invalid();
|
|
2701
|
-
return normalized;
|
|
2702
|
-
}
|
|
2703
|
-
function validateNodePublicKey(descriptor) {
|
|
2704
|
-
if (descriptor.algorithm === "ed25519") return {
|
|
2705
|
-
algorithm: descriptor.algorithm,
|
|
2706
|
-
publicKey: copyBytes(descriptor.publicKey, [32])
|
|
2707
|
-
};
|
|
2708
|
-
if (descriptor.algorithm === "p256") {
|
|
2709
|
-
const publicKey = copyBytes(descriptor.publicKey, [33, 65]);
|
|
2710
|
-
const prefix = publicKey[0];
|
|
2711
|
-
if (publicKey.byteLength === 33 && prefix !== 2 && prefix !== 3 || publicKey.byteLength === 65 && prefix !== 4) invalid();
|
|
2712
2717
|
return {
|
|
2713
|
-
|
|
2714
|
-
|
|
2718
|
+
otlpTracesUrl: void 0,
|
|
2719
|
+
otlpMetricsUrl: void 0
|
|
2715
2720
|
};
|
|
2716
2721
|
}
|
|
2717
|
-
return invalid();
|
|
2718
|
-
}
|
|
2719
|
-
function fingerprintNodePublicKey(descriptor) {
|
|
2720
|
-
const key = validateNodePublicKey(descriptor);
|
|
2721
|
-
const canonical = encode([
|
|
2722
|
-
NODE_KEY_FINGERPRINT_DOMAIN,
|
|
2723
|
-
key.algorithm,
|
|
2724
|
-
key.publicKey
|
|
2725
|
-
], rfc8949EncodeOptions);
|
|
2726
|
-
return Uint8Array.from(createHash("sha256").update(canonical).digest());
|
|
2727
|
-
}
|
|
2728
|
-
function formatNodePublicKeyFingerprint(fingerprint) {
|
|
2729
|
-
const bytes = copyBytes(fingerprint, [32]);
|
|
2730
|
-
return `SHA256:${Buffer.from(bytes).toString("base64url")}`;
|
|
2731
|
-
}
|
|
2732
|
-
function encodeNodeAuthenticationTranscript(input) {
|
|
2733
|
-
const hubOrigin = canonicalizeHubOrigin(input.hubOrigin);
|
|
2734
|
-
assertProtocolVersion(input.protocolMajor);
|
|
2735
|
-
assertProtocolVersion(input.protocolMinor);
|
|
2736
|
-
assertIdentifier(input.nodeId, NODE_ID);
|
|
2737
|
-
assertIdentifier(input.activeKeyId, NODE_KEY_ID);
|
|
2738
|
-
assertUnsignedSafeInteger(input.challengeExpiresAt);
|
|
2739
|
-
const challenge = copyBytes(input.challenge, [32]);
|
|
2740
|
-
return Uint8Array.from(encode([
|
|
2741
|
-
NODE_AUTH_TRANSCRIPT_DOMAIN,
|
|
2742
|
-
hubOrigin,
|
|
2743
|
-
input.protocolMajor,
|
|
2744
|
-
input.protocolMinor,
|
|
2745
|
-
input.nodeId,
|
|
2746
|
-
input.activeKeyId,
|
|
2747
|
-
input.challengeExpiresAt,
|
|
2748
|
-
challenge
|
|
2749
|
-
], rfc8949EncodeOptions));
|
|
2750
2722
|
}
|
|
2751
|
-
function
|
|
2752
|
-
|
|
2753
|
-
assertProtocolVersion(input.protocolMajor);
|
|
2754
|
-
assertProtocolVersion(input.protocolMinor);
|
|
2755
|
-
assertIdentifier(input.rotationRequestId, ROTATION_REQUEST_ID);
|
|
2756
|
-
assertIdentifier(input.nodeId, NODE_ID);
|
|
2757
|
-
assertIdentifier(input.oldActiveKeyId, NODE_KEY_ID);
|
|
2758
|
-
assertIdentifier(input.newKeyId, NODE_KEY_ID);
|
|
2759
|
-
assertUnsignedSafeInteger(input.challengeExpiresAt);
|
|
2760
|
-
const newKey = validateNodePublicKey(input.newKey);
|
|
2761
|
-
const fingerprint = fingerprintNodePublicKey(newKey);
|
|
2762
|
-
const challenge = copyBytes(input.challenge, [32]);
|
|
2763
|
-
return Uint8Array.from(encode([
|
|
2764
|
-
NODE_KEY_ROTATION_TRANSCRIPT_DOMAIN,
|
|
2765
|
-
hubOrigin,
|
|
2766
|
-
input.protocolMajor,
|
|
2767
|
-
input.protocolMinor,
|
|
2768
|
-
input.rotationRequestId,
|
|
2769
|
-
input.nodeId,
|
|
2770
|
-
input.oldActiveKeyId,
|
|
2771
|
-
input.newKeyId,
|
|
2772
|
-
newKey.algorithm,
|
|
2773
|
-
newKey.publicKey,
|
|
2774
|
-
fingerprint,
|
|
2775
|
-
input.challengeExpiresAt,
|
|
2776
|
-
challenge
|
|
2777
|
-
], rfc8949EncodeOptions));
|
|
2723
|
+
function shouldReplaceTextGenerationModelSelection(patch) {
|
|
2724
|
+
return Boolean(patch && (patch.instanceId !== void 0 || patch.model !== void 0));
|
|
2778
2725
|
}
|
|
2779
|
-
function
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
assertIdentifier(input.installationId, DESKTOP_INSTALLATION_ID);
|
|
2789
|
-
assertIdentifier(input.environmentId, ENVIRONMENT_ID);
|
|
2790
|
-
const nodeKey = validateNodePublicKey(input.nodeKey);
|
|
2791
|
-
const nodeFingerprint = fingerprintNodePublicKey(nodeKey);
|
|
2792
|
-
assertUnsignedSafeInteger(input.claimExpiresAt);
|
|
2793
|
-
const challenge = copyBytes(input.challenge, [32]);
|
|
2794
|
-
return Uint8Array.from(encode([
|
|
2795
|
-
NATIVE_NODE_CLAIM_TRANSCRIPT_DOMAIN,
|
|
2796
|
-
hubOrigin,
|
|
2797
|
-
input.protocolVersion,
|
|
2798
|
-
input.transcriptVersion,
|
|
2799
|
-
input.claimId,
|
|
2800
|
-
input.accountId,
|
|
2801
|
-
input.spaceId,
|
|
2802
|
-
input.sessionId,
|
|
2803
|
-
dpopKeyThumbprint,
|
|
2804
|
-
input.installationId,
|
|
2805
|
-
input.environmentId,
|
|
2806
|
-
nodeKey.algorithm,
|
|
2807
|
-
nodeKey.publicKey,
|
|
2808
|
-
nodeFingerprint,
|
|
2809
|
-
input.claimExpiresAt,
|
|
2810
|
-
challenge
|
|
2811
|
-
], rfc8949EncodeOptions));
|
|
2726
|
+
function mergeModelSelectionOptionsById(input) {
|
|
2727
|
+
if (input.patch === void 0) return input.current ? [...input.current] : void 0;
|
|
2728
|
+
if (input.patch.length === 0) return;
|
|
2729
|
+
const merged = new Map((input.current ?? []).map((selection) => [selection.id, selection.value]));
|
|
2730
|
+
for (const selection of input.patch) merged.set(selection.id, selection.value);
|
|
2731
|
+
return [...merged.entries()].map(([id, value]) => ({
|
|
2732
|
+
id,
|
|
2733
|
+
value
|
|
2734
|
+
}));
|
|
2812
2735
|
}
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2736
|
+
/**
|
|
2737
|
+
* Applies a server settings patch while treating textGenerationModelSelection as
|
|
2738
|
+
* replace-on-provider/model updates. This prevents stale nested options from
|
|
2739
|
+
* surviving a reset patch that intentionally omits options.
|
|
2740
|
+
*/
|
|
2741
|
+
function applyServerSettingsPatch(current, patch) {
|
|
2742
|
+
const selectionPatch = patch.textGenerationModelSelection;
|
|
2743
|
+
for (const [field, value] of Object.entries(patch.expectedNodePreferences ?? {})) if (!Equal.equals(current[field] ?? null, value)) throw new Error("Node preferences changed elsewhere. Reload before saving.");
|
|
2744
|
+
for (const [projectId, expected] of Object.entries(patch.expectedProjectPreferences ?? {})) {
|
|
2745
|
+
const currentPreferences = current.projectPreferences[projectId] ?? {};
|
|
2746
|
+
for (const [field, value] of Object.entries(expected)) {
|
|
2747
|
+
const actual = field === "initialModelSelection" && !Object.hasOwn(currentPreferences, field) ? "absent" : currentPreferences[field] ?? null;
|
|
2748
|
+
if (!Equal.equals(actual, value)) throw new Error("Project preferences changed elsewhere. Reload before saving.");
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
const { expectedProjectPreferences: _expected, expectedNodePreferences: _expectedNode, projectPreferences: _projects, ...persistedPatch } = patch;
|
|
2752
|
+
let next = deepMerge(current, persistedPatch);
|
|
2753
|
+
if (patch.initialModelSelection !== void 0) next = {
|
|
2754
|
+
...next,
|
|
2755
|
+
initialModelSelection: patch.initialModelSelection
|
|
2756
|
+
};
|
|
2757
|
+
if (patch.projectPreferences !== void 0) {
|
|
2758
|
+
const projects = new Map(Object.entries(current.projectPreferences));
|
|
2759
|
+
for (const [projectId, preferencesPatch] of Object.entries(patch.projectPreferences)) {
|
|
2760
|
+
if (preferencesPatch === null) {
|
|
2761
|
+
projects.delete(projectId);
|
|
2762
|
+
continue;
|
|
2763
|
+
}
|
|
2764
|
+
const preferences = { ...projects.get(projectId) };
|
|
2765
|
+
for (const [field, value] of Object.entries(preferencesPatch)) if (value === null && field !== "initialModelSelection") delete preferences[field];
|
|
2766
|
+
else Object.assign(preferences, { [field]: value });
|
|
2767
|
+
if (Object.keys(preferences).length) projects.set(projectId, preferences);
|
|
2768
|
+
else projects.delete(projectId);
|
|
2769
|
+
}
|
|
2770
|
+
next = {
|
|
2771
|
+
...next,
|
|
2772
|
+
projectPreferences: Object.fromEntries(projects)
|
|
2773
|
+
};
|
|
2774
|
+
}
|
|
2775
|
+
if (patch.projectWorktreeSubmodules !== void 0) {
|
|
2776
|
+
const modes = new Map(Object.entries(current.projectWorktreeSubmodules));
|
|
2777
|
+
for (const [projectId, mode] of Object.entries(patch.projectWorktreeSubmodules)) if (mode === null) modes.delete(projectId);
|
|
2778
|
+
else modes.set(projectId, mode);
|
|
2779
|
+
next = {
|
|
2780
|
+
...next,
|
|
2781
|
+
projectWorktreeSubmodules: Object.fromEntries(modes)
|
|
2782
|
+
};
|
|
2783
|
+
}
|
|
2784
|
+
if (patch.projectWorktreeRoots !== void 0) {
|
|
2785
|
+
const roots = new Map(Object.entries(current.projectWorktreeRoots));
|
|
2786
|
+
for (const [projectId, root] of Object.entries(patch.projectWorktreeRoots)) if (root === null || root === "") roots.delete(projectId);
|
|
2787
|
+
else roots.set(projectId, root);
|
|
2788
|
+
next = {
|
|
2789
|
+
...next,
|
|
2790
|
+
projectWorktreeRoots: Object.fromEntries(roots)
|
|
2791
|
+
};
|
|
2792
|
+
}
|
|
2793
|
+
if (patch.projectStorageRetention !== void 0) {
|
|
2794
|
+
const policies = new Map(Object.entries(current.projectStorageRetention));
|
|
2795
|
+
for (const [projectId, policy] of Object.entries(patch.projectStorageRetention)) if (policy === null) policies.delete(projectId);
|
|
2796
|
+
else policies.set(projectId, policy);
|
|
2797
|
+
next = {
|
|
2798
|
+
...next,
|
|
2799
|
+
projectStorageRetention: Object.fromEntries(policies)
|
|
2800
|
+
};
|
|
2801
|
+
}
|
|
2802
|
+
const nextWithReplacements = patch.providerInstances !== void 0 ? {
|
|
2803
|
+
...next,
|
|
2804
|
+
providerInstances: patch.providerInstances
|
|
2805
|
+
} : next;
|
|
2806
|
+
if (!selectionPatch) return nextWithReplacements;
|
|
2807
|
+
const instanceId = selectionPatch.instanceId ?? current.textGenerationModelSelection.instanceId;
|
|
2808
|
+
const model = selectionPatch.model ?? current.textGenerationModelSelection.model;
|
|
2809
|
+
const options = shouldReplaceTextGenerationModelSelection(selectionPatch) ? selectionPatch.options : mergeModelSelectionOptionsById({
|
|
2810
|
+
current: current.textGenerationModelSelection.options,
|
|
2811
|
+
patch: selectionPatch.options
|
|
2812
|
+
});
|
|
2813
|
+
return {
|
|
2814
|
+
...nextWithReplacements,
|
|
2815
|
+
textGenerationModelSelection: createModelSelection(instanceId, model, options)
|
|
2816
|
+
};
|
|
2817
2817
|
}
|
|
2818
2818
|
//#endregion
|
|
2819
2819
|
//#region src/config.ts
|
|
@@ -2890,6 +2890,7 @@ function resolveHubConnectorConfig(raw) {
|
|
|
2890
2890
|
};
|
|
2891
2891
|
}
|
|
2892
2892
|
const DEFAULT_NODE_E2EE_POLICY_CONFIG = {
|
|
2893
|
+
mode: void 0,
|
|
2893
2894
|
requireE2EE: void 0,
|
|
2894
2895
|
requireApprovedClientE2EE: void 0,
|
|
2895
2896
|
configurationIssue: void 0
|
|
@@ -2916,10 +2917,12 @@ const parseTriStateBoolean = (value) => {
|
|
|
2916
2917
|
function resolveNodeE2eePolicyConfig(raw) {
|
|
2917
2918
|
const requireE2EE = parseTriStateBoolean(raw.requireE2EE);
|
|
2918
2919
|
const requireApprovedClientE2EE = parseTriStateBoolean(raw.requireApprovedClientE2EE);
|
|
2920
|
+
const mode = raw.mode === void 0 ? void 0 : Schema.is(NodeE2eeAdmissionPolicy)(raw.mode) ? raw.mode : null;
|
|
2919
2921
|
return {
|
|
2922
|
+
mode: mode ?? void 0,
|
|
2920
2923
|
requireE2EE: typeof requireE2EE === "boolean" ? requireE2EE : void 0,
|
|
2921
2924
|
requireApprovedClientE2EE: typeof requireApprovedClientE2EE === "boolean" ? requireApprovedClientE2EE : void 0,
|
|
2922
|
-
configurationIssue: requireE2EE === void 0 || requireApprovedClientE2EE === void 0 ? "configuration_invalid" : void 0
|
|
2925
|
+
configurationIssue: requireE2EE === void 0 || requireApprovedClientE2EE === void 0 || mode === null ? "configuration_invalid" : void 0
|
|
2923
2926
|
};
|
|
2924
2927
|
}
|
|
2925
2928
|
function resolveManagedWorktreesRoot(config) {
|
|
@@ -4414,4 +4417,4 @@ const providerTurnMetricAttributes = (input) => {
|
|
|
4414
4417
|
});
|
|
4415
4418
|
};
|
|
4416
4419
|
//#endregion
|
|
4417
|
-
export { makeWorkspaceAccessPolicy as $,
|
|
4420
|
+
export { makeWorkspaceAccessPolicy as $, formatNodePublicKeyFingerprint as $t, runtimeQueueBlockedDuration as A, resolveHubConnectorConfig as At, startupCommandGateQueueHighWater as B, getProviderOptionBooleanSelectionValue as Bt, providerStartupQueueHighWater as C, acquireStorageSettingsLease as Ct, providerTurnsTotal as D, ServerConfig as Dt, providerTurnMetricAttributes as E, RuntimeMode as Et, runtimeQueueHighWater as F, applyClaudePromptEffortPrefix as Ft, LocalDiagnosticsMetrics as G, normalizeModelSlug as Gt, terminalRestartsTotal as H, getProviderOptionDescriptors as Ht, runtimeQueueOverflowsTotal as I, createModelCapabilities as It, outcomeFromExit as J, encodeNativeNodeClaimTranscript as Jt, LocalDiagnosticsMetricsLive as K, resolvePromptInjectedEffort as Kt, runtimeQueueRecoveriesTotal as L, getModelDisplayLabel as Lt, runtimeQueueDepth as M, resolveNodeE2eePolicyConfig as Mt, runtimeQueueDequeuesTotal as N, resolveStaticDir as Nt, rpcRequestDuration as O, deriveServerPaths as Ot, runtimeQueueEnqueuesTotal as P, parsePersistedServerObservabilitySettings as Pt, WorkspaceAccessPolicyLive as Q, fingerprintNodePublicKey as Qt, startupCommandGateEnqueuesTotal as R, getModelSelectionBooleanOptionValue as Rt, providerStartupQueueDepth as S, mintStorageCleanupClaim as St, providerTurnDuration as T, DEFAULT_PORT as Tt, terminalSessionsTotal as U, getProviderOptionStringSelectionValue as Ut, startupCommandGateQueueWaitDuration as V, getProviderOptionCurrentValue as Vt, withMetrics as W, modelSelectionRequiresContextHandoff as Wt, ServerSettingsService as X, encodeNodeKeyRotationTranscript as Xt, ServerSettingsLive as Y, encodeNodeAuthenticationTranscript as Yt, redactServerSettingsForClient as Z, equalNodeIdentityBytes as Zt, providerRuntimeEventsTotal as _, assertCleanWorktree as _t, contextHandoffsTotal as a, Type as an, expandHomePath as at, providerStaleStopTimeoutsTotal as b, removeQuarantinedTemporaryDirectory as bt, increment as c, writeFileStringAtomically as ct, orchestrationCommandAckDuration as d, canonicalStoragePath as dt, normalizeHubNodeName as en, WorkspaceAccessPolicy as et, orchestrationCommandDuration as f, hasWorktreeCreationLease as ft, providerMetricAttributes as g, assertCanonicalPath as gt, providerEventLogRecordsDroppedTotal as h, storageLifecycleLock as ht, contextHandoffPreparationDuration as i, rfc8949EncodeOptions as in, validateWorktreeRoot as it, runtimeQueueCoalescedTotal as j, resolveManagedWorktreesRoot as jt, rpcRequestsTotal as k, ensureServerDirectories as kt, metricAttributes as l, acquireStoragePathUseLease as lt, orchestrationEventsProcessedTotal as m, recordCreatedWorktree as mt, contextHandoffContextEntriesTotal as n, decode as nn, resolveConfiguredWorktreeRoot as nt, gitCommandDuration as o, ServerSecretStoreLive as ot, orchestrationCommandsTotal as p, isStoragePathBlocked as pt, compactTraceAttributes as q, canonicalizeHubOrigin as qt, contextHandoffDispatchDuration as r, encode as rn, selectConfiguredWorktreeRoot as rt, gitCommandsTotal as s, ServerSecretStore as st, contextHandoffContextBytesTotal as t, Tokeniser as tn, canonicalizeWorktreePath as tt, metricNames as u, acquireWorktreeCreationLease as ut, providerRuntimeStaleEventsTotal as v, captureWorktreeIdentity as vt, providerStartupQueueWaitDuration as w, hasStorageSettingsUpdateLease as wt, providerStartupAdmissionTotal as x, removeVerifiedWorktree as xt, providerSessionsTotal as y, measureDirectory as yt, startupCommandGateQueueDepth as z, getModelSelectionStringOptionValue as zt };
|