ryco-cli 0.1.29 → 0.1.31

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.
Files changed (500) hide show
  1. package/README.md +37 -0
  2. package/dist/{AcpAdapter-8CSe4HK7.cjs → AcpAdapter-ByUp9-wk.cjs} +74 -54
  3. package/dist/{AcpAdapter-CG1wRWcf.mjs → AcpAdapter-CY_ANTKu.mjs} +74 -54
  4. package/dist/{AcpNativeLogging-B6TtnnKL.mjs → AcpNativeLogging-C7PC6imv.mjs} +30 -4
  5. package/dist/{AcpNativeLogging-DbjnRnTf.cjs → AcpNativeLogging-OQeAya9d.cjs} +33 -1
  6. package/dist/{AcpRegistryDriver-16ZTxUs3.cjs → AcpRegistryDriver-CD9GN7rI.cjs} +3 -3
  7. package/dist/{AcpRegistryDriver-DZFasKaz.mjs → AcpRegistryDriver-DMZ5VBWJ.mjs} +4 -4
  8. package/dist/AzureDevOpsSourceControlProvider-5giVYoNi.mjs +2053 -0
  9. package/dist/AzureDevOpsSourceControlProvider-BKMXEUaN.cjs +2055 -0
  10. package/dist/{BitbucketSourceControlProvider-DplKc8Wo.mjs → BitbucketSourceControlProvider-BVUBsEUF.mjs} +63 -23
  11. package/dist/{BitbucketSourceControlProvider-B-ZwKj72.cjs → BitbucketSourceControlProvider-BWnnrbch.cjs} +62 -22
  12. package/dist/{BunPTY-Dcl1Lp62.mjs → BunPTY-CMbDQ1Xb.mjs} +1 -1
  13. package/dist/{ClaudeDriver-r0lJ9vmE.cjs → ClaudeDriver-DCrqouOR.cjs} +1376 -194
  14. package/dist/{ClaudeDriver-0gGVop27.mjs → ClaudeDriver-DVOss8cC.mjs} +1377 -195
  15. package/dist/{CodexDriver-bJAbhSwY.cjs → CodexDriver-CBQPHJqU.cjs} +259 -29
  16. package/dist/{CodexDriver-baT02xVb.mjs → CodexDriver-DJoTky7Z.mjs} +261 -31
  17. package/dist/{CodexTextGeneration-Dwp6X3dq.mjs → CodexTextGeneration-BSgNgfZv.mjs} +6 -6
  18. package/dist/{CodexTextGeneration-DFZ5y4gj.cjs → CodexTextGeneration-C9MDQmZm.cjs} +7 -7
  19. package/dist/{CopilotDriver-C0OhnSB1.mjs → CopilotDriver-CUkdPXcH.mjs} +78 -20
  20. package/dist/{CopilotDriver-B_jEqfYQ.cjs → CopilotDriver-DbaMDH16.cjs} +76 -18
  21. package/dist/{CursorDriver-DinXkGP9.mjs → CursorDriver-B-ZilXJB.mjs} +115 -98
  22. package/dist/{CursorDriver-BBFEW7ZI.cjs → CursorDriver-DKQqPbKH.cjs} +116 -99
  23. package/dist/{ForgejoSourceControlProvider-iG9o7aZB.cjs → ForgejoSourceControlProvider-CgpjFECj.cjs} +94 -60
  24. package/dist/{ForgejoSourceControlProvider-Dr0fxfud.mjs → ForgejoSourceControlProvider-DemMYUye.mjs} +95 -61
  25. package/dist/{GitHubSourceControlProvider-L1yFpep4.cjs → GitHubSourceControlProvider-C4un6hOK.cjs} +218 -119
  26. package/dist/{GitHubSourceControlProvider-CnIu0n2Y.mjs → GitHubSourceControlProvider-CRSDYcjc.mjs} +206 -108
  27. package/dist/GitLabSourceControlProvider-D8W1ZLPh.cjs +2260 -0
  28. package/dist/GitLabSourceControlProvider-DpWkJ0M3.mjs +2258 -0
  29. package/dist/{GrokDriver-D_Ylzh5z.cjs → GrokDriver-BQ6G_7ZZ.cjs} +11 -12
  30. package/dist/{GrokDriver-pX-N6HGS.mjs → GrokDriver-Buvas9-q.mjs} +7 -8
  31. package/dist/{Metrics-BjqGlIP4.mjs → Metrics-C3vLS9rz.mjs} +1264 -1151
  32. package/dist/{Metrics-Bf96NJ4j.cjs → Metrics-DjRPLE98.cjs} +1295 -1134
  33. package/dist/{NodePTY-D7tFWuQe.mjs → NodePTY-DgnuBruq.mjs} +1 -1
  34. package/dist/{NodeSqliteClient-BGg70C7Q.cjs → NodeSqliteClient-D8bzGgPN.cjs} +1 -1
  35. package/dist/{OpenCodeDriver-Byu1pf_i.mjs → OpenCodeDriver-BWEZD841.mjs} +184 -50
  36. package/dist/{OpenCodeDriver-BFEw5t09.cjs → OpenCodeDriver-qUiX0RLH.cjs} +185 -51
  37. package/dist/{SideQuestionIsolation-81IoAuoi.mjs → SideQuestionIsolation-B1T-DsR0.mjs} +1 -1
  38. package/dist/{SideQuestionIsolation-CMPkCUP0.cjs → SideQuestionIsolation-BPC-Bxsz.cjs} +1 -1
  39. package/dist/bin.cjs +50689 -15659
  40. package/dist/bin.mjs +50578 -15585
  41. package/dist/client/assets/AccountSettings-B88Q_w9Y.js +1 -0
  42. package/dist/client/assets/AiFocusSettings-Bb0TrCPn.js +1 -0
  43. package/dist/client/assets/{AnimatedHeight-BNg7wnTK.js → AnimatedHeight-epXOsgdm.js} +1 -1
  44. package/dist/client/assets/AppearanceSettings-XS9WRVPU.js +1 -0
  45. package/dist/client/assets/AutomationsDialog-bZckh4Y3.js +1 -0
  46. package/dist/client/assets/AutomationsSummary-wPFZCF49.js +1 -0
  47. package/dist/client/assets/BranchToolbar.logic-DjzLKbbB.js +3 -0
  48. package/dist/client/assets/BrowserPanel-CdBLnnfz.js +1 -0
  49. package/dist/client/assets/ChatRightPanel-BCINd0vP.js +34 -0
  50. package/dist/client/assets/ChatThreadRouteView-BFZ0Si-l.js +1 -0
  51. package/dist/client/assets/ColorSwatchPicker-CGyo99o0.js +1 -0
  52. package/dist/client/assets/CommandPalette.logic-BIOMtnEQ.js +1 -0
  53. package/dist/client/assets/CommandPaletteDialog-Db4LH--z.js +2 -0
  54. package/dist/client/assets/CompositeRoot-DtnwMJKj.js +1 -0
  55. package/dist/client/assets/ComputerUseSettings-CkqCqDsU.js +1 -0
  56. package/dist/client/assets/ConnectionsSettings-B9mxExdG.js +7 -0
  57. package/dist/client/assets/CreatePullRequestDialog-CJ7pNCue.js +1 -0
  58. package/dist/client/assets/CreatePullRequestDialogHost-n4ZjdSr4.js +1 -0
  59. package/dist/client/assets/DiagnosticsSettings-f9rFG9re.js +2 -0
  60. package/dist/client/assets/DiagnosticsSettings.logic-Byf-Bu4S.js +1 -0
  61. package/dist/client/assets/DialogHandle-C0c_rK3I.js +1 -0
  62. package/dist/client/assets/{DialogPopup-DdZlhHuQ.js → DialogPopup-BKW1PEEa.js} +1 -1
  63. package/dist/client/assets/DialogRoot-BIubqrv0.js +1 -0
  64. package/dist/client/assets/DialogTitle-BAX_FLoG.js +1 -0
  65. package/dist/client/assets/{DialogViewport-BwuqbGLY.js → DialogViewport-C2iOUx0O.js} +1 -1
  66. package/dist/client/assets/DiffPanel-BkqDt_SS.js +25 -0
  67. package/dist/client/assets/DisclosureRegion-B8556yU0.js +1 -0
  68. package/dist/client/assets/DraftChatThreadRouteView-BKgRKJ2w.js +1 -0
  69. package/dist/client/assets/{ExternalIdentityWeb.logic-DsTJQkg-.js → ExternalIdentityWeb.logic-Cu6suNrN.js} +1 -1
  70. package/dist/client/assets/GlassSurface-DLYYzRdP.js +1 -0
  71. package/dist/client/assets/HostedConnectionControls-CoVqtnrK.js +1 -0
  72. package/dist/client/assets/HostedHubRoot-CM2CwPUr.js +2 -0
  73. package/dist/client/assets/{HostedNativeAuthorizationRoute-BSq_AlY2.js → HostedNativeAuthorizationRoute-Bizmqrh_.js} +2 -2
  74. package/dist/client/assets/HostedNodeRenameDialog-SXWMsTO0.js +1 -0
  75. package/dist/client/assets/HostedRelayTrustNotice-BfTyrBi5.js +1 -0
  76. package/dist/client/assets/InboxStatusGlyph-BPTqzp7l.js +1 -0
  77. package/dist/client/assets/IntegrationsSettingsPanel-DAPvkV4i.js +1 -0
  78. package/dist/client/assets/KeybindingsSettings-B8g-YI2O.js +1 -0
  79. package/dist/client/assets/LazyBrowserPanel-Ds9cdOC_.js +2 -0
  80. package/dist/client/assets/McpServersSettings-Dw6G3ff3.js +6 -0
  81. package/dist/client/assets/MobileSheet-DfgXNWbd.js +1 -0
  82. package/dist/client/assets/ModelTuningDial-DQBAbuNL.js +1 -0
  83. package/dist/client/assets/NewWorktreeDialog-CDZAJmK6.js +4 -0
  84. package/dist/client/assets/NodeSecuritySettings-3MELA9ru.js +1 -0
  85. package/dist/client/assets/NullStore-gT_6_xZE.js +1 -0
  86. package/dist/client/assets/OnboardingDialog-CAAtNnJf.js +1 -0
  87. package/dist/client/assets/OpinionatedPluginsSettings-AiDB0Vl4.js +1 -0
  88. package/dist/client/assets/{PdfAttachmentPreview-CTo1AyZs.js → PdfAttachmentPreview-BFNW2wjN.js} +2 -2
  89. package/dist/client/assets/{PhoneGetAppInterstitial-DwopOWnQ.js → PhoneGetAppInterstitial-D8fwZ8E9.js} +1 -1
  90. package/dist/client/assets/PhoneHome-YHgHljA0.js +1 -0
  91. package/dist/client/assets/PhoneSettingsSurface-BVxJppvK.js +2 -0
  92. package/dist/client/assets/PreviewPanel-BYcEnkv9.js +643 -0
  93. package/dist/client/assets/ProjectScriptDialog-K34K2Kzm.js +1 -0
  94. package/dist/client/assets/ProjectsPage-DXnMYLjb.js +1 -0
  95. package/dist/client/assets/PromoteChatDialog-CAY7_wJ-.js +1 -0
  96. package/dist/client/assets/ProviderLimitWindow-CK04BSkM.js +1 -0
  97. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BMBrDDOC.js +1 -0
  98. package/dist/client/assets/ProvidersSettingsPanel-C85PX9Es.js +1 -0
  99. package/dist/client/assets/PullRequestsPage-C0rgfGwB.js +1 -0
  100. package/dist/client/assets/{QuitShortcutFeedback-eCvP_MNj.js → QuitShortcutFeedback-DSkKqETs.js} +1 -1
  101. package/dist/client/assets/RedactedSensitiveText-DQ0YveQd.js +1 -0
  102. package/dist/client/assets/RollingText-BzvpP5fa.js +1 -0
  103. package/dist/client/assets/RootAppShell-BYQ-eGNT.js +6 -0
  104. package/dist/client/assets/{Separator-BiINUUQl.js → Separator-DpiW19Vw.js} +1 -1
  105. package/dist/client/assets/SettingsPage-BCFN7Ju2.js +2 -0
  106. package/dist/client/assets/SettingsPanels-CP6z2b1x.js +3 -0
  107. package/dist/client/assets/SettingsPanels.editor-D8U-TWWG.js +1 -0
  108. package/dist/client/assets/SettingsSelect-DEhNaz3E.js +1 -0
  109. package/dist/client/assets/Sidebar.logic-D_ODfSpl.js +1 -0
  110. package/dist/client/assets/SimulatorPanel-DCT6fZ0X.js +1 -0
  111. package/dist/client/assets/SourceControlSettings-DxUtvPMK.js +1 -0
  112. package/dist/client/assets/StatisticsPage-C9SrwtM4.js +1 -0
  113. package/dist/client/assets/StatisticsPanel-BMYLETs0.js +1 -0
  114. package/dist/client/assets/ThreadLinkList-BN5z5EpS.js +169 -0
  115. package/dist/client/assets/ThreadTerminalDrawer-CgIFOlR-.js +18 -0
  116. package/dist/client/assets/ThreadWorkspacePanel-DvXoqQPF.js +3 -0
  117. package/dist/client/assets/ToolbarRootContext-8FsV9Cpj.js +1 -0
  118. package/dist/client/assets/TraitsPicker-DcrpJahy.js +1 -0
  119. package/dist/client/assets/Virtualizer-CwXeUPla.js +1345 -0
  120. package/dist/client/assets/WorkspacePullRequestPanel-3mlcJn9G.js +1 -0
  121. package/dist/client/assets/WorkspaceReview-UGbCgXeK.js +2 -0
  122. package/dist/client/assets/{abnfDiagram-N423BO3Z-DAmGykdr.js → abnfDiagram-N423BO3Z-DVEM6Scc.js} +1 -1
  123. package/dist/client/assets/{activity-DRZlu-MC.js → activity-DVCuAejY.js} +1 -1
  124. package/dist/client/assets/{alert-CwrDisFU.js → alert-FV7ZIit_.js} +1 -1
  125. package/dist/client/assets/alert-dialog-CgXR9tED.js +1 -0
  126. package/dist/client/assets/app-window-3xtwqZgI.js +1 -0
  127. package/dist/client/assets/appChrome-COCz-T7w.js +1 -0
  128. package/dist/client/assets/{appearancePreferences-nFx4MHoI.js → appearancePreferences-NnsvXwBe.js} +1 -1
  129. package/dist/client/assets/architecture-7GRP2DOG-DXXb_0_g.js +1 -0
  130. package/dist/client/assets/{architectureDiagram-T3A2C74G-DypU2ERW.js → architectureDiagram-T3A2C74G-B6pcKiCj.js} +1 -1
  131. package/dist/client/assets/{arrow-left-XhcJWpRy.js → arrow-left-Blu3LSE2.js} +1 -1
  132. package/dist/client/assets/{arrow-right-BBs6iTUL.js → arrow-right-CO3CH0ne.js} +1 -1
  133. package/dist/client/assets/arrow-up-B69gV2Bq.js +1 -0
  134. package/dist/client/assets/{arrow-up-right-CJ9Vq7nK.js → arrow-up-right-BbPGFOLA.js} +1 -1
  135. package/dist/client/assets/authorization-Ob6YwWiI.js +1 -0
  136. package/dist/client/assets/autocomplete-RVpjsrDv.js +1 -0
  137. package/dist/client/assets/ban-BIm2PVkE.js +1 -0
  138. package/dist/client/assets/{blockDiagram-VBNYF7ZC-B9MhR9hY.js → blockDiagram-VBNYF7ZC-WNerGp9V.js} +1 -1
  139. package/dist/client/assets/{bot-D5wgL7pu.js → bot-C9nWtaWq.js} +1 -1
  140. package/dist/client/assets/browserState-jt47YsqD.js +1 -0
  141. package/dist/client/assets/{c4Diagram-5PPSVZJV-C22FWSoE.js → c4Diagram-5PPSVZJV-wp1ioOoM.js} +1 -1
  142. package/dist/client/assets/camera-C13VoW3c.js +1 -0
  143. package/dist/client/assets/capabilities-CfOhq009.js +1 -0
  144. package/dist/client/assets/channel-56r2qL2v.js +1 -0
  145. package/dist/client/assets/{chart-column-D6Lnkklk.js → chart-column-DRv0YtL_.js} +1 -1
  146. package/dist/client/assets/checkbox-CIIIY9FA.js +1 -0
  147. package/dist/client/assets/checks-Dw022Bvy.js +1 -0
  148. package/dist/client/assets/{chunk-2GRJ4B5K-D1tZuCzA.js → chunk-2GRJ4B5K-DRl3ILpc.js} +1 -1
  149. package/dist/client/assets/{chunk-4I5QYGJK-Clf86zK0.js → chunk-4I5QYGJK-CYTRl4bo.js} +1 -1
  150. package/dist/client/assets/{chunk-5RXB4S5H-B36N5RYZ.js → chunk-5RXB4S5H-VCNwRsOa.js} +1 -1
  151. package/dist/client/assets/{chunk-6Q2QTUOP-IAxdzsQJ.js → chunk-6Q2QTUOP-DnSeKGPG.js} +1 -1
  152. package/dist/client/assets/{chunk-7Z6QIM7H-Ctqebv_4.js → chunk-7Z6QIM7H-Cjilh9TF.js} +1 -1
  153. package/dist/client/assets/{chunk-GF5L2VYU-CAfciJae.js → chunk-GF5L2VYU-CGR7AW0t.js} +1 -1
  154. package/dist/client/assets/{chunk-I66GZJ75-BZ7XtZf4.js → chunk-I66GZJ75-CXSn8dDu.js} +1 -1
  155. package/dist/client/assets/{chunk-JQJVKLGR-DVuZCWnv.js → chunk-JQJVKLGR-Dro-75lU.js} +1 -1
  156. package/dist/client/assets/{chunk-KBJHAD2P-DtWbzsRm.js → chunk-KBJHAD2P-BDqN2kVf.js} +1 -1
  157. package/dist/client/assets/{chunk-NSK5VX7P-BVMz_Hc4.js → chunk-NSK5VX7P-DGo5UczH.js} +1 -1
  158. package/dist/client/assets/{chunk-QR6OTTB3-DWitTCy-.js → chunk-QR6OTTB3-RWuyWnBI.js} +1 -1
  159. package/dist/client/assets/{chunk-UBXNYLIW-BuxXXP2s.js → chunk-UBXNYLIW-BPRzeB0w.js} +1 -1
  160. package/dist/client/assets/{chunk-W5SLKNZC-Bnf3sQl4.js → chunk-W5SLKNZC-DYWocTFi.js} +1 -1
  161. package/dist/client/assets/{chunk-WRU74C26-xu-KDOon.js → chunk-WRU74C26-ChbB1jY3.js} +1 -1
  162. package/dist/client/assets/circle-stop-D8B4hRpY.js +1 -0
  163. package/dist/client/assets/circle-x-CNLfrTqR.js +1 -0
  164. package/dist/client/assets/classDiagram-JCYQIIEL-DGvmFev3.js +1 -0
  165. package/dist/client/assets/classDiagram-v2-OCEON4UE-DGvmFev3.js +1 -0
  166. package/dist/client/assets/{clipboard-copy-oDSkUUg4.js → clipboard-copy-DGi8FKNO.js} +1 -1
  167. package/dist/client/assets/clock-3-DmJ4_XPI.js +1 -0
  168. package/dist/client/assets/clock-DZIuPtNG.js +1 -0
  169. package/dist/client/assets/color-picker-BdBXje-a.js +1 -0
  170. package/dist/client/assets/columns-2-CWlMOClK.js +1 -0
  171. package/dist/client/assets/combobox-Dtjtf7AB.js +1 -0
  172. package/dist/client/assets/{cynefin-OW5HDTMX-DGNyiNSf.js → cynefin-OW5HDTMX-TuShvMuM.js} +1 -1
  173. package/dist/client/assets/{cynefinDiagram-MW4NZA55-_ctibv4i.js → cynefinDiagram-MW4NZA55-B0Edt2Em.js} +1 -1
  174. package/dist/client/assets/{dagre-VZM6K2ZE-Bo-bS1Y0.js → dagre-VZM6K2ZE-D-eiuqHx.js} +1 -1
  175. package/dist/client/assets/{data-list-DLsM39Hp.js → data-list-BAx6jBY1.js} +1 -1
  176. package/dist/client/assets/desktopUpdateAtoms-BjrLa3tl.js +1 -0
  177. package/dist/client/assets/desktopWorkspace-C2wXVBhc.js +1 -0
  178. package/dist/client/assets/{deviceName-z0ZWSq0z.js → deviceName-B4youG0v.js} +1 -1
  179. package/dist/client/assets/{diagram-7IWD3JNH-DSjtw1SY.js → diagram-7IWD3JNH-DgM6lMlR.js} +1 -1
  180. package/dist/client/assets/{diagram-B4RE2ZJO-B7fWEvIa.js → diagram-B4RE2ZJO-CyHNDjzV.js} +1 -1
  181. package/dist/client/assets/{diagram-LBJQPF4R-trRYCE5d.js → diagram-LBJQPF4R-DDzuLIN5.js} +1 -1
  182. package/dist/client/assets/{diagram-Q27KOJAE-_DYcRggk.js → diagram-Q27KOJAE-BaBvK9QB.js} +1 -1
  183. package/dist/client/assets/{diagram-UB23O5K3-BkMzOHX8.js → diagram-UB23O5K3-CzZ2ewuZ.js} +1 -1
  184. package/dist/client/assets/dialogWords-Cg0YkJVg.js +1 -0
  185. package/dist/client/assets/diffRouteSearch-D2MKN_ah.js +1 -0
  186. package/dist/client/assets/disclosureMotion-cbMJn5-z.js +1 -0
  187. package/dist/client/assets/{download-CHdS3R_v.js → download-TvtXS4hE.js} +1 -1
  188. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-DubiOMCG.js → ebnfDiagram-BXEA7PRR-CL1vdOKi.js} +1 -1
  189. package/dist/client/assets/editorPreferences-DqKyA-2Z.js +1 -0
  190. package/dist/client/assets/ellipsis-CDK1dNFZ.js +1 -0
  191. package/dist/client/assets/ellipsis-vertical-CwzEUTwV.js +1 -0
  192. package/dist/client/assets/{empty-BlBl_Vvw.js → empty-BovKoxbn.js} +1 -1
  193. package/dist/client/assets/{erDiagram-JOGREHBK-CFDiNfSJ.js → erDiagram-JOGREHBK-DmQR2if6.js} +1 -1
  194. package/dist/client/assets/eventmodeling-NTZA5JFV-D272GIcY.js +1 -0
  195. package/dist/client/assets/external-link-CJeVJZ7s.js +1 -0
  196. package/dist/client/assets/eye-BUmrXqzg.js +1 -0
  197. package/dist/client/assets/file-diff-BWc3mYsz.js +1 -0
  198. package/dist/client/assets/flowDiagram-UKHOOZJN-DLyS38Mm.js +1 -0
  199. package/dist/client/assets/folder-git-2-CPxg5wKP.js +1 -0
  200. package/dist/client/assets/folder-open-DcMymvp1.js +1 -0
  201. package/dist/client/assets/formatCount-B4KLI651.js +1 -0
  202. package/dist/client/assets/{ganttDiagram-PKOTCBZU-DT2XhE-m.js → ganttDiagram-PKOTCBZU-1q2nUL92.js} +1 -1
  203. package/dist/client/assets/git-pull-request-BFPwpm3c.js +1 -0
  204. package/dist/client/assets/{gitGraph-4MIJSDKK-BI5UGiqb.js → gitGraph-4MIJSDKK-COtwmv2S.js} +1 -1
  205. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-CzAB97Rd.js → gitGraphDiagram-DS77QQ5N-ChsvaxX4.js} +1 -1
  206. package/dist/client/assets/{group-DZJuSiJL.js → group-DWWn0dTx.js} +1 -1
  207. package/dist/client/assets/hammer-BXo-EU88.js +1 -0
  208. package/dist/client/assets/hostedConnectionCoordinator-BkAE-RhA.js +1 -0
  209. package/dist/client/assets/hostedPairing-5n5srRC9.js +1 -0
  210. package/dist/client/assets/{index-BAJdq3TK.js → index-DARIYokI.js} +2 -2
  211. package/dist/client/assets/{info-A6RAGUB7-DdGYYgLX.js → info-A6RAGUB7-CI2qZ9wW.js} +1 -1
  212. package/dist/client/assets/{infoDiagram-6WML65LV-zhUpER6a.js → infoDiagram-6WML65LV-BPmgcTPH.js} +1 -1
  213. package/dist/client/assets/{input-CzU08wbL.js → input-CCie4mm1.js} +1 -1
  214. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-BQLkqykE.js → ishikawaDiagram-WSZJBQD7-LyS9p3Yg.js} +1 -1
  215. package/dist/client/assets/{journeyDiagram-NVQOT4AX-DBgsbKOF.js → journeyDiagram-NVQOT4AX-BYaAmN65.js} +1 -1
  216. package/dist/client/assets/{kanban-definition-27J2QSJJ-DF-Rr-xs.js → kanban-definition-27J2QSJJ-D-pwzqFt.js} +1 -1
  217. package/dist/client/assets/{key-round-CvyrSjb2.js → key-round-BlrUTfxB.js} +1 -1
  218. package/dist/client/assets/keyboard-DlBdq6sz.js +1 -0
  219. package/dist/client/assets/label-ChtVI9lp.js +1 -0
  220. package/dist/client/assets/layers-BB-ruGvd.js +1 -0
  221. package/dist/client/assets/lifecycleSuggestionPolicy-0ERe_O53.js +1 -0
  222. package/dist/client/assets/list-checks-BkM_ZRsj.js +1 -0
  223. package/dist/client/assets/loader-3vQnfqIT.js +1 -0
  224. package/dist/client/assets/{log-out-D3rICSt5.js → log-out-CKq9YiLY.js} +1 -1
  225. package/dist/client/assets/{logging-C6tXZlGQ.js → logging-CCg76rgn.js} +1 -1
  226. package/dist/client/assets/main-Ch0bwS-M.js +9 -0
  227. package/dist/client/assets/main-Di0isH9D.css +2 -0
  228. package/dist/client/assets/{mermaid-parser.core-BiGKtilP.js → mermaid-parser.core-RK9ah5RM.js} +2 -2
  229. package/dist/client/assets/{mermaidEngine-Cjfgf3Bg.js → mermaidEngine-Dr8UsPhH.js} +3 -3
  230. package/dist/client/assets/message-circle-dashed-BrjwqS7-.js +1 -0
  231. package/dist/client/assets/messageQueueDrain-B7R7Qmq6.js +1 -0
  232. package/dist/client/assets/messages-square-cDTkDJv_.js +1 -0
  233. package/dist/client/assets/{mindmap-definition-FAOFIHXS-SiU9JwWJ.js → mindmap-definition-FAOFIHXS-DVudWasx.js} +1 -1
  234. package/dist/client/assets/{packet-AYTQ26CC-F-HuW5Dr.js → packet-AYTQ26CC-DnkTsVhD.js} +1 -1
  235. package/dist/client/assets/{pairingUrl-rQM9kSGT.js → pairingUrl-Dn1e2CVw.js} +1 -1
  236. package/dist/client/assets/panels-top-left-B7jZiLth.js +1 -0
  237. package/dist/client/assets/path-text-3Rfu6lt8.js +1 -0
  238. package/dist/client/assets/{pegDiagram-VL7TDLO6-cC-QUd7I.js → pegDiagram-VL7TDLO6-Do5PIp8B.js} +1 -1
  239. package/dist/client/assets/pencil-Bzg-nc6d.js +1 -0
  240. package/dist/client/assets/{pie-WAS4IAKB-BI3XUcLN.js → pie-WAS4IAKB-B_nNQOzn.js} +1 -1
  241. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-BP4gJ4ZK.js → pieDiagram-7S7Q4E2Y-D_IG4xwA.js} +1 -1
  242. package/dist/client/assets/{play-BJZrOx6T.js → play-DpXXQ1qB.js} +1 -1
  243. package/dist/client/assets/popover-OWEv6cQz.js +48 -0
  244. package/dist/client/assets/presentationTier-DPVAxTK4.js +1 -0
  245. package/dist/client/assets/previewRouteSearch-BjZdTuSf.js +1 -0
  246. package/dist/client/assets/primary-Cf-xJExj.js +4 -0
  247. package/dist/client/assets/primitives-CxTBN7D4.js +1 -0
  248. package/dist/client/assets/projectCheckouts.logic-DUT4AxXr.js +1 -0
  249. package/dist/client/assets/projectPaths-B8aVmOZX.js +1 -0
  250. package/dist/client/assets/projectPreferences-CzWBItFj.js +1 -0
  251. package/dist/client/assets/providerCapabilities-B2YOPsLN.js +1 -0
  252. package/dist/client/assets/providerDriverMeta-BHHL9uw0.js +1 -0
  253. package/dist/client/assets/providerModels-v9PYbzRE.js +1 -0
  254. package/dist/client/assets/providerStatus-CDPaqb0S.js +1 -0
  255. package/dist/client/assets/pullRequestsModel.logic-Dv_om_C4.js +1 -0
  256. package/dist/client/assets/{qr-code-BFO8lV1M.js → qr-code-BlbiBIwH.js} +1 -1
  257. package/dist/client/assets/{qr-code-Cmfz5JKf.js → qr-code-DywzVgQC.js} +1 -1
  258. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-DO-N1m-q.js → quadrantDiagram-CIZ2JOQS-DY6fJyrM.js} +1 -1
  259. package/dist/client/assets/{radar-RG4KPBEZ-CfayXQ5F.js → radar-RG4KPBEZ-D9689I5m.js} +1 -1
  260. package/dist/client/assets/radio-group-DVwD6Cuy.js +1 -0
  261. package/dist/client/assets/{railroad-74A4TZTK-CT6f-etT.js → railroad-74A4TZTK-DVzWbQnl.js} +1 -1
  262. package/dist/client/assets/railroad-abnf-HS5TGJTU-C_2P6umA.js +1 -0
  263. package/dist/client/assets/railroad-ebnf-LZEXJU2U-aGlR3R3z.js +1 -0
  264. package/dist/client/assets/railroad-peg-WCYAUIDC-DCB9oE8y.js +1 -0
  265. package/dist/client/assets/{railroadDiagram-AXF67PYL-DC8egbob.js → railroadDiagram-AXF67PYL-D1oJ6Jtl.js} +1 -1
  266. package/dist/client/assets/readCache-B7cDPz2O.js +1 -0
  267. package/dist/client/assets/{refresh-cw-K_hU8_ld.js → refresh-cw-CRUTivd6.js} +1 -1
  268. package/dist/client/assets/{requirementDiagram-LRYGKXZP-DJMzcLk_.js → requirementDiagram-LRYGKXZP-7RM8iREp.js} +1 -1
  269. package/dist/client/assets/rotate-ccw-BE2ZCwL6.js +1 -0
  270. package/dist/client/assets/roving-radio-group-NMPWrDqe.js +1 -0
  271. package/dist/client/assets/rows-2-DDS4dGTX.js +1 -0
  272. package/dist/client/assets/runtime-DjjjAcTE.js +18 -0
  273. package/dist/client/assets/safePolygon-C1AzMRS4.js +1 -0
  274. package/dist/client/assets/{sankeyDiagram-W5VNT64P-YR6aIYLj.js → sankeyDiagram-W5VNT64P-C1tKAPGN.js} +1 -1
  275. package/dist/client/assets/{save-Mh-PA_2P.js → save-OZdkPs_y.js} +1 -1
  276. package/dist/client/assets/scroll-area-80P7vbjw.js +1 -0
  277. package/dist/client/assets/{scrollEdges-Zcpuz3un.js → scrollEdges-C0Oc-5qi.js} +1 -1
  278. package/dist/client/assets/select-Cb9FUPHD.js +1 -0
  279. package/dist/client/assets/separator-CO8bC7Wc.js +1 -0
  280. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-BVeSqWDA.js → sequenceDiagram-SI44F4Z6-DGVpb7jL.js} +1 -1
  281. package/dist/client/assets/settings-2-PrRDu6Lc.js +1 -0
  282. package/dist/client/assets/settingsLayout-CRFNCk_D.js +1 -0
  283. package/dist/client/assets/sheet-C5DW7qVO.js +1 -0
  284. package/dist/client/assets/{shield-i098Bm_B.js → shield-CBHYqlkR.js} +1 -1
  285. package/dist/client/assets/{shield-alert-CXmR7fM9.js → shield-alert-Dc2cGwyR.js} +1 -1
  286. package/dist/client/assets/{shield-check-CdFhWT_o.js → shield-check-_wl7R4Js.js} +1 -1
  287. package/dist/client/assets/sidebar-0BBaFNm3.js +1 -0
  288. package/dist/client/assets/sidebarProjectFolders-BjWzbt8C.js +3 -0
  289. package/dist/client/assets/sidebarProjectGrouping-nQRStWrZ.js +1 -0
  290. package/dist/client/assets/sidebarStatusText-BBKuNies.js +1 -0
  291. package/dist/client/assets/sidebarUndo-Dfq1lvyF.js +1 -0
  292. package/dist/client/assets/{skeleton-BwFgUtuE.js → skeleton-DfUe6VV_.js} +1 -1
  293. package/dist/client/assets/sliders-horizontal-BGXkwvKv.js +1 -0
  294. package/dist/client/assets/sliding-tabs-BnDSjRU3.js +39 -0
  295. package/dist/client/assets/{smartphone-DGfizz51.js → smartphone-OEAQOTdv.js} +1 -1
  296. package/dist/client/assets/spinner-lHRJWsym.js +1 -0
  297. package/dist/client/assets/square-B05NKv3e.js +1 -0
  298. package/dist/client/assets/{star-J3x3fktG.js → star-C8mHmfZu.js} +1 -1
  299. package/dist/client/assets/{stateDiagram-OKZ733FA-DoIZN669.js → stateDiagram-OKZ733FA-CCOAegCG.js} +1 -1
  300. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-D60qqBed.js +1 -0
  301. package/dist/client/assets/storeSelectors-BichCKDC.js +1 -0
  302. package/dist/client/assets/surfaceMorph-BTRijmlU.js +1 -0
  303. package/dist/client/assets/{swimlanes-SLNWSIFB-BoFLigyK.js → swimlanes-SLNWSIFB-CFsLYT4h.js} +1 -1
  304. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-D0SaJgSn.js +8 -0
  305. package/dist/client/assets/switch-oQc7Ifbl.js +1 -0
  306. package/dist/client/assets/text-wrap-DSRdSfDm.js +1 -0
  307. package/dist/client/assets/textarea-VyiIZ0wQ.js +1 -0
  308. package/dist/client/assets/threadPriorityRefreshRuntime-H656C1J_.js +1 -0
  309. package/dist/client/assets/ticker-CPutfhZ4.js +1 -0
  310. package/dist/client/assets/{timeline-definition-Z64GVDOM-D65EmNWc.js → timeline-definition-Z64GVDOM-B4agmO7R.js} +1 -1
  311. package/dist/client/assets/toggle-DFqtCPt-.js +1 -0
  312. package/dist/client/assets/toggle-group-C5ICmqkI.js +1 -0
  313. package/dist/client/assets/{tokenModePresentation-C0-NgmX5.js → tokenModePresentation-umDRm4k1.js} +1 -1
  314. package/dist/client/assets/tooltip-DbqhseXd.js +1 -0
  315. package/dist/client/assets/{treeView-Q6P3EWNA-C2S-OPgI.js → treeView-Q6P3EWNA-C_S3udFB.js} +1 -1
  316. package/dist/client/assets/{treemap-WGGIJYW6-6Ovsu9iH.js → treemap-WGGIJYW6-B-kUSAkE.js} +1 -1
  317. package/dist/client/assets/undo-2-lyluTGMW.js +1 -0
  318. package/dist/client/assets/{unplug-BEfcl9Ht.js → unplug-D6iu-qlh.js} +1 -1
  319. package/dist/client/assets/usage-ClF-eUmy.js +1 -0
  320. package/dist/client/assets/useActiveIndicator-R5NWu8Fg.js +1 -0
  321. package/dist/client/assets/useAppSidebarCollapsed-BbMxfio5.js +1 -0
  322. package/dist/client/assets/useAppearancePreference-Ix13pMKy.js +1 -0
  323. package/dist/client/assets/useAtlassian-BYDCc9lv.js +0 -0
  324. package/dist/client/assets/useCheckoutResolution-CR-oOp5-.js +1 -0
  325. package/dist/client/assets/useDesktopRelaunchGuard-Jmh615iZ.js +1 -0
  326. package/dist/client/assets/useDiffFileNavigation-DeuzdD5E.js +15 -0
  327. package/dist/client/assets/useDiffLayout-DhcXwhBL.js +1 -0
  328. package/dist/client/assets/useEnvironmentSettingsTarget-DM6BRDT7.js +1 -0
  329. package/dist/client/assets/useFocus-CV0KIZwg.js +1 -0
  330. package/dist/client/assets/useGit-CUcs7h5_.js +1 -0
  331. package/dist/client/assets/useGitBranchSearch-CeKFtnCL.js +1 -0
  332. package/dist/client/assets/useHostedDraftExecutionTarget-DvQU5UOq.js +1 -0
  333. package/dist/client/assets/useLabelableId-CEgCRi6q.js +1 -0
  334. package/dist/client/assets/useLandingFlash-BfOOlFtW.js +1 -0
  335. package/dist/client/assets/useLogicalProjectSnapshots-CRNZke74.js +1 -0
  336. package/dist/client/assets/useNavigate-sQZthdyT.js +1 -0
  337. package/dist/client/assets/usePageLeadingInsetClass-Bf4nUvx4.js +1 -0
  338. package/dist/client/assets/usePhoneThreadActions-VaQ-mZex.js +1 -0
  339. package/dist/client/assets/usePopupHandleStore-DimKo2Yy.js +1 -0
  340. package/dist/client/assets/usePopupViewport-YeqX_UM3.js +1 -0
  341. package/dist/client/assets/usePresentationTier-B9kCQ4YH.js +1 -0
  342. package/dist/client/assets/useProject-Kt74Z12J.js +1 -0
  343. package/dist/client/assets/useProviderOptionsUpdater-CTzNh2B7.js +2 -0
  344. package/dist/client/assets/usePullRequestFilesViewed-D5Snmzys.js +1 -0
  345. package/dist/client/assets/usePullRequestsModel-DJL5HHbP.js +40 -0
  346. package/dist/client/assets/useScrollLock-CLZ31xsK.js +1 -0
  347. package/dist/client/assets/useSidebarThreadActions-n6EkLATf.js +6 -0
  348. package/dist/client/assets/{useStatistics-D55-xLMz.js → useStatistics-DD0mYS4J.js} +14 -14
  349. package/dist/client/assets/{useTheme-B441xg4F.js → useTheme-Bdy-BDs-.js} +1 -1
  350. package/dist/client/assets/useValueChanged-DoumqMnV.js +1 -0
  351. package/dist/client/assets/{user-round-C-U7TZKG.js → user-round-BPDXr8Gq.js} +1 -1
  352. package/dist/client/assets/{vennDiagram-T6HMQDX7-fZAexcYr.js → vennDiagram-T6HMQDX7-B1UEn_j_.js} +1 -1
  353. package/dist/client/assets/{vscode-icons-BYX6fBsM.js → vscode-icons-Ccy-gzFN.js} +1 -1
  354. package/dist/client/assets/{wardley-WFR3VGLG-gdYWSMxK.js → wardley-WFR3VGLG-gPdyDc-7.js} +1 -1
  355. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-iDJxQb70.js → wardleyDiagram-T6FBY63Y-2aDcwOA4.js} +1 -1
  356. package/dist/client/assets/workspaceLifecycle-OJ1aKksw.js +3 -0
  357. package/dist/client/assets/workspaceMetadataProjection-CyEyJhUa.js +1 -0
  358. package/dist/client/assets/workspaceRouteSearch-CCavUdbH.js +1 -0
  359. package/dist/client/assets/{wrench-D79uBUSl.js → wrench-CPUCA_rn.js} +1 -1
  360. package/dist/client/assets/wsTransport-C88seBPA.js +15 -0
  361. package/dist/client/assets/{xychartDiagram-ELKLHX3M-B4cfMwpJ.js → xychartDiagram-ELKLHX3M-C1_7Q-1i.js} +1 -1
  362. package/dist/client/favicon.svg +1 -1
  363. package/dist/client/index.html +1 -1
  364. package/dist/collectUint8StreamText-BsLSgI8i.mjs +710 -0
  365. package/dist/collectUint8StreamText-D5olwfpM.cjs +757 -0
  366. package/dist/{deviceHostWorker-L8C9wy38.mjs → deviceHostWorker-B-Dn-6An.mjs} +1 -1
  367. package/dist/{deviceHostWorker-CYnrwfrv.cjs → deviceHostWorker-D4HauWIV.cjs} +1 -1
  368. package/dist/{makeManagedServerProvider-CUwxc0Pn.cjs → makeManagedServerProvider-B5tP7tvg.cjs} +2 -2
  369. package/dist/{makeManagedServerProvider-B_lPFNpL.mjs → makeManagedServerProvider-B65ipCxM.mjs} +2 -2
  370. package/dist/resource-monitor/linux-arm64/ryco-resource-monitor +0 -0
  371. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  372. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  373. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  374. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  375. package/dist/{rolldown-runtime-LGfotAqq.cjs → rolldown-runtime-HbSU0i7K.cjs} +7 -0
  376. package/dist/{runtimeSession-V3RIy8Ao.mjs → runtimeSession-D_BZ-wRH.mjs} +1 -1
  377. package/dist/{src-BzVJd3Me.cjs → src-FmeCeBJ9.cjs} +3408 -308
  378. package/dist/{src-7E1M4gTQ.mjs → src-VTj60bUm.mjs} +2154 -140
  379. package/package.json +1 -1
  380. package/dist/AzureDevOpsSourceControlProvider-DmJD1-WL.cjs +0 -190
  381. package/dist/AzureDevOpsSourceControlProvider-d5Ogsspk.mjs +0 -188
  382. package/dist/GitLabSourceControlProvider-BZdwXdJl.mjs +0 -186
  383. package/dist/GitLabSourceControlProvider-CrcBR6KQ.cjs +0 -188
  384. package/dist/client/assets/AccountSettings-FN7pwqYA.js +0 -1
  385. package/dist/client/assets/AiFocusSettings-xcDAMaqH.js +0 -1
  386. package/dist/client/assets/AppearanceSettings-BvsvAOsG.js +0 -1
  387. package/dist/client/assets/BranchToolbar.logic-DFsXV3Qs.js +0 -3
  388. package/dist/client/assets/BrowserPanel-D-g_xDZs.js +0 -1
  389. package/dist/client/assets/ChatRightPanel-Bm906qNi.js +0 -201
  390. package/dist/client/assets/ChatThreadRouteView-CATwakjI.js +0 -1
  391. package/dist/client/assets/CommandPaletteDialog-Obv1bvxj.js +0 -1
  392. package/dist/client/assets/CompositeRoot-CfkIdky8.js +0 -1
  393. package/dist/client/assets/ComputerUseSettings-ljYmTHea.js +0 -1
  394. package/dist/client/assets/ConnectionsSettings-CIXs7x_E.js +0 -7
  395. package/dist/client/assets/ContextHandoffEndpointLabel-BzI4Wi1i.js +0 -4
  396. package/dist/client/assets/DiagnosticsSettings-DGX_2T2M.js +0 -2
  397. package/dist/client/assets/DialogHandle-CTtSYpsC.js +0 -1
  398. package/dist/client/assets/DialogRoot-k2_0SNKA.js +0 -1
  399. package/dist/client/assets/DialogTitle-Du7CAbaO.js +0 -1
  400. package/dist/client/assets/DialogTrigger-VpFh8Xza.js +0 -1
  401. package/dist/client/assets/DraftChatThreadRouteView-Cmc5HpWf.js +0 -1
  402. package/dist/client/assets/GlassSurface-BlWIlQ0s.js +0 -1
  403. package/dist/client/assets/HostedConnectionControls-ySHqwr4K.js +0 -1
  404. package/dist/client/assets/HostedHubRoot-Caz8PElK.js +0 -2
  405. package/dist/client/assets/HostedNodeRenameDialog-ChxJdr-Z.js +0 -1
  406. package/dist/client/assets/HostedRelayTrustNotice-DPVrIfj_.js +0 -1
  407. package/dist/client/assets/IntegrationsSettingsPanel-eAq5h-D5.js +0 -2
  408. package/dist/client/assets/KeybindingsSettings-D1XaEVGH.js +0 -7
  409. package/dist/client/assets/LazyBrowserPanel-B6POLJh3.js +0 -2
  410. package/dist/client/assets/McpServersSettings-DqLA6n5v.js +0 -6
  411. package/dist/client/assets/MobileSheet-CtQIYRlY.js +0 -1
  412. package/dist/client/assets/NodeSecuritySettings-Skm7GQDl.js +0 -1
  413. package/dist/client/assets/NullStore-b8PhjwPZ.js +0 -1
  414. package/dist/client/assets/OnboardingDialog-8-fKvY5H.js +0 -1
  415. package/dist/client/assets/OpinionatedPluginsSettings-BIJfJ34L.js +0 -1
  416. package/dist/client/assets/PhoneHome-CUzxhhR4.js +0 -1
  417. package/dist/client/assets/PhoneSettingsSurface-BK2RHmYJ.js +0 -2
  418. package/dist/client/assets/ProvidersSettingsPanel-DPxL7AsR.js +0 -1
  419. package/dist/client/assets/RedactedSensitiveText-DH4mWpB6.js +0 -1
  420. package/dist/client/assets/RootAppShell-DwiWD4Cy.js +0 -7
  421. package/dist/client/assets/SettingsDialog-CE8qy0qL.js +0 -2
  422. package/dist/client/assets/SettingsPanels-BYknk6GO.js +0 -3
  423. package/dist/client/assets/SettingsPanels.editor-64bM0lhg.js +0 -2
  424. package/dist/client/assets/SourceControlSettings-BbveiAj3.js +0 -1
  425. package/dist/client/assets/StatisticsPage-CAO_tCeC.js +0 -1
  426. package/dist/client/assets/StatisticsPanel-SNlgMv2o.js +0 -1
  427. package/dist/client/assets/StatisticsSettingsLink-BpkNubL2.js +0 -1
  428. package/dist/client/assets/ThreadTerminalDrawer-9x_kqQPy.js +0 -18
  429. package/dist/client/assets/ThreadWorkspacePanel-BXE17C4x.js +0 -2073
  430. package/dist/client/assets/appChrome-B_VWWDFj.js +0 -1
  431. package/dist/client/assets/architecture-7GRP2DOG-CQNNG5gU.js +0 -1
  432. package/dist/client/assets/authorization-BugIGt5e.js +0 -1
  433. package/dist/client/assets/badge-BswOCwph.js +0 -1
  434. package/dist/client/assets/capabilities-Bj_X9FZ-.js +0 -1
  435. package/dist/client/assets/channel-BtX-w3CK.js +0 -1
  436. package/dist/client/assets/chevron-right-Ddq5gL-L.js +0 -1
  437. package/dist/client/assets/classDiagram-JCYQIIEL-BgDa3HFl.js +0 -1
  438. package/dist/client/assets/classDiagram-v2-OCEON4UE-BgDa3HFl.js +0 -1
  439. package/dist/client/assets/compiler-runtime-C4g8XhC5.js +0 -1
  440. package/dist/client/assets/desktopWorkspace-Ocqt625W.js +0 -1
  441. package/dist/client/assets/editorPreferences-DVhg0CXd.js +0 -1
  442. package/dist/client/assets/eventmodeling-NTZA5JFV-DpzGHjmu.js +0 -1
  443. package/dist/client/assets/flowDiagram-UKHOOZJN-CaDVMm72.js +0 -1
  444. package/dist/client/assets/hostedConnectionCoordinator-BztHfGNt.js +0 -1
  445. package/dist/client/assets/hostedPairing-CqhLPQqG.js +0 -1
  446. package/dist/client/assets/hubRoutes-DExWSvVE.js +0 -1
  447. package/dist/client/assets/kbd-DKuvGqFP.js +0 -1
  448. package/dist/client/assets/layers-CwP65mnC.js +0 -1
  449. package/dist/client/assets/liquidGlass-CA2o_Cq0.js +0 -1
  450. package/dist/client/assets/liquidGlass.worker-icvLJKHf.js +0 -1
  451. package/dist/client/assets/main-BqSANuAs.css +0 -2
  452. package/dist/client/assets/main-RFllWEko.js +0 -9
  453. package/dist/client/assets/motion-C9rN_t9p.js +0 -1
  454. package/dist/client/assets/palette-gaqgtube.js +0 -1
  455. package/dist/client/assets/perfInstrumentation-BT27w4tn.js +0 -1
  456. package/dist/client/assets/presentationTier-xlIjcFab.js +0 -1
  457. package/dist/client/assets/primary-CQh_KHGG.js +0 -5
  458. package/dist/client/assets/providerDriverMeta-LJ2vJxm-.js +0 -1
  459. package/dist/client/assets/providerStatus-DBGvvkyF.js +0 -1
  460. package/dist/client/assets/radio-group-BueX1AVO.js +0 -1
  461. package/dist/client/assets/railroad-abnf-HS5TGJTU-B890iayj.js +0 -1
  462. package/dist/client/assets/railroad-ebnf-LZEXJU2U-C079Tzw6.js +0 -1
  463. package/dist/client/assets/railroad-peg-WCYAUIDC-DxvOX5Rh.js +0 -1
  464. package/dist/client/assets/runtime-OM-uAtaj.js +0 -18
  465. package/dist/client/assets/scroll-area-BC-LB_zE.js +0 -1
  466. package/dist/client/assets/separator-yx1r9ZDw.js +0 -1
  467. package/dist/client/assets/settingsLayout-BbjDM-p0.js +0 -1
  468. package/dist/client/assets/sheet-CpEwjOWn.js +0 -1
  469. package/dist/client/assets/sidebar-DayQTDZp.js +0 -1
  470. package/dist/client/assets/sidebarProjectFolders-DXqx3OlZ.js +0 -4
  471. package/dist/client/assets/sidebarStatusText-kdA6QMZS.js +0 -1
  472. package/dist/client/assets/sidebarUndo-BHFfJj0k.js +0 -1
  473. package/dist/client/assets/square-Cd2WS1gv.js +0 -1
  474. package/dist/client/assets/src-DHNjfMxR.js +0 -14
  475. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-BnzsGHaN.js +0 -1
  476. package/dist/client/assets/storeSelectors-D60AAN01.js +0 -1
  477. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-BnA-oDvU.js +0 -8
  478. package/dist/client/assets/switch-D9inWKdd.js +0 -48
  479. package/dist/client/assets/toggle-group-YNqzWsK0.js +0 -1
  480. package/dist/client/assets/toggle-wMq3LLn1.js +0 -1
  481. package/dist/client/assets/tooltip-mwOCSCXF.js +0 -1
  482. package/dist/client/assets/usage-DF8oQrsy.js +0 -1
  483. package/dist/client/assets/useAppSidebarCollapsed-C0jpPtER.js +0 -1
  484. package/dist/client/assets/useAppearancePreference-Dlh9P8iu.js +0 -1
  485. package/dist/client/assets/useBaseUiId-Bz8dcyjd.js +0 -1
  486. package/dist/client/assets/useLabelableId-C8bc9a0F.js +0 -1
  487. package/dist/client/assets/useNavigate-01O5dMQe.js +0 -1
  488. package/dist/client/assets/usePhoneThreadActions-BIdh81kF.js +0 -1
  489. package/dist/client/assets/usePopupViewport-DYYZwfTW.js +0 -1
  490. package/dist/client/assets/usePresentationTier-hxB7Yv_Q.js +0 -1
  491. package/dist/client/assets/useScrollLock-BO185DkJ.js +0 -1
  492. package/dist/client/assets/useTriggerFocusGuards-CMLVr18J.js +0 -1
  493. package/dist/client/assets/useValueChanged-DSyRHPje.js +0 -1
  494. package/dist/client/assets/workspaceMetadataProjection-So9-wSEZ.js +0 -1
  495. package/dist/collectUint8StreamText-BAUF-vzz.mjs +0 -37
  496. package/dist/collectUint8StreamText-vagpNUMJ.cjs +0 -42
  497. package/dist/git-BKwGfw8A.mjs +0 -132
  498. package/dist/git-Dn5wrgFY.cjs +0 -218
  499. package/dist/sourceControl-B0D1Op29.cjs +0 -253
  500. package/dist/sourceControl-BiEBxN01.mjs +0 -224
@@ -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-7E1M4gTQ.mjs";
3
+ import { Ai as ServerSettingsError, Bs as DEFAULT_GIT_TEXT_GENERATION_MODEL_BY_PROVIDER, Ic as NodeE2eeAdmissionPolicy, Ks as ProviderDriverKind, Li as StorageError, Ti as DEFAULT_SERVER_SETTINGS, Us as MODEL_SLUG_ALIASES_BY_PROVIDER, Vs as DEFAULT_GIT_TEXT_GENERATION_OPTIONS_BY_PROVIDER, Ys as isProviderDriverKind, do as PROJECT_RELOCATION_PENDING_MESSAGE, ki as ServerSettings, qs as ProviderInstanceId } from "./src-VTj60bUm.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 ../../packages/shared/src/Struct.ts
18
- function deepMerge(current, patch) {
19
- if (!P.isObject(current) || !P.isObject(patch)) return patch;
20
- const next = { ...current };
21
- for (const [key, value] of Object.entries(patch)) {
22
- if (value === void 0) continue;
23
- const existing = next[key];
24
- next[key] = P.isObject(existing) && P.isObject(value) ? deepMerge(existing, value) : value;
25
- }
26
- return next;
27
- }
28
- //#endregion
29
- //#region ../../packages/shared/src/model.ts
30
- const DEFAULT_PROVIDER_DRIVER_KIND = ProviderDriverKind.make("codex");
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
- * Resolve the human-readable model title used by picker surfaces and durable
33
- * handoff presentation. Provider catalogs are authoritative when they carry a
34
- * friendly name; the routing slug remains the deterministic final fallback.
46
+ * @param {any} value
47
+ * @returns {string}
35
48
  */
36
- function getModelDisplayName(model, options) {
37
- const shortName = trimOrNull(model.shortName);
38
- const name = trimOrNull(model.name);
39
- const slug = trimOrNull(model.slug) ?? model.slug;
40
- return options?.preferShortName ? shortName ?? name ?? slug : name ?? shortName ?? slug;
41
- }
42
- /** Compose the optional sub-provider prefix exactly as the picker trigger does. */
43
- function getModelDisplayLabel(model, options) {
44
- const title = getModelDisplayName(model, options);
45
- const subProvider = trimOrNull(model.subProvider);
46
- return subProvider ? `${subProvider} · ${title}` : title;
47
- }
48
- function createModelCapabilities(input) {
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
- function cloneSelection(selection) {
87
- return { ...selection };
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
- function withDescriptorCurrentValue(descriptor, rawCurrentValue) {
90
- if (descriptor.type === "boolean") {
91
- if (typeof rawCurrentValue === "boolean") return {
92
- ...descriptor,
93
- currentValue: rawCurrentValue
94
- };
95
- return descriptor;
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
- const currentValue = typeof rawCurrentValue === "string" ? resolveDescriptorChoiceValue(descriptor, rawCurrentValue) : resolveDescriptorChoiceValue(descriptor, descriptor.currentValue);
98
- if (!currentValue) {
99
- const { currentValue: _unusedCurrentValue, ...rest } = descriptor;
100
- return rest;
85
+ toString() {
86
+ return `Type[${this.major}].${this.name}`;
101
87
  }
102
- return {
103
- ...descriptor,
104
- currentValue
105
- };
106
- }
107
- function getProviderOptionDescriptors(input) {
108
- const { caps, selections } = input;
109
- return (caps.optionDescriptors ?? []).map(cloneDescriptor).map((descriptor) => withDescriptorCurrentValue(descriptor, getRawSelectionValueById(selections, descriptor.id) ?? descriptor.currentValue));
110
- }
111
- function getProviderOptionCurrentValue(descriptor) {
112
- if (!descriptor) return;
113
- if (descriptor.type === "boolean") return descriptor.currentValue;
114
- if (descriptor.currentValue) return descriptor.currentValue;
115
- return descriptor.options.find((option) => option.isDefault)?.id;
116
- }
117
- function normalizeModelSlug(model, provider = DEFAULT_PROVIDER_DRIVER_KIND) {
118
- if (typeof model !== "string") return null;
119
- const trimmed = model.trim();
120
- if (!trimmed) return null;
121
- const aliases = MODEL_SLUG_ALIASES_BY_PROVIDER[provider] ?? {};
122
- const aliased = Object.prototype.hasOwnProperty.call(aliases, trimmed) ? aliases[trimmed] : void 0;
123
- return typeof aliased === "string" ? aliased : trimmed;
124
- }
125
- /** Trim a string, returning null for empty/missing values. */
126
- function trimOrNull(value) {
127
- if (typeof value !== "string") return null;
128
- return value.trim() || null;
129
- }
130
- function cloneSelections(selections) {
131
- return selections.map(cloneSelection);
132
- }
133
- function createModelSelection(instanceId, model, options) {
134
- const selections = options ? cloneSelections(options) : [];
135
- const base = {
136
- instanceId,
137
- model
138
- };
139
- return selections.length > 0 ? {
140
- ...base,
141
- options: selections
142
- } : base;
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
- * Context handoff is a provider-instance boundary. Model and option changes
146
- * within one configured instance remain on that provider's normal turn path.
144
+ * @typedef {import('../interface.js').ByteView} ByteView
145
+ * @typedef {import('../interface.js').AllocatedByteView} AllocatedByteView
147
146
  */
148
- function modelSelectionRequiresContextHandoff(input) {
149
- return input.canonicalSelection.instanceId !== input.targetSelection.instanceId;
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
- * Returns the effort value if it is a prompt-injected value according to
153
- * any select descriptor in the given capabilities, or null otherwise.
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 resolvePromptInjectedEffort(caps, rawEffort) {
160
- const trimmed = trimOrNull(rawEffort);
161
- if (!trimmed) return null;
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
- function parsePersistedServerObservabilitySettings(raw) {
187
- try {
188
- return extractPersistedServerObservabilitySettings(Schema.decodeUnknownSync(ServerSettingsJson$1)(raw));
189
- } catch {
190
- return {
191
- otlpTracesUrl: void 0,
192
- otlpMetricsUrl: void 0
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
- function shouldReplaceTextGenerationModelSelection(patch) {
197
- return Boolean(patch && (patch.instanceId !== void 0 || patch.model !== void 0));
198
- }
199
- function mergeModelSelectionOptionsById(input) {
200
- if (input.patch === void 0) return input.current ? [...input.current] : void 0;
201
- if (input.patch.length === 0) return;
202
- const merged = new Map((input.current ?? []).map((selection) => [selection.id, selection.value]));
203
- for (const selection of input.patch) merged.set(selection.id, selection.value);
204
- return [...merged.entries()].map(([id, value]) => ({
205
- id,
206
- value
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
- * Applies a server settings patch while treating textGenerationModelSelection as
211
- * replace-on-provider/model updates. This prevents stale nested options from
212
- * surviving a reset patch that intentionally omits options.
236
+ * @param {string} str
237
+ * @returns {number[]}
213
238
  */
214
- function applyServerSettingsPatch(current, patch) {
215
- const selectionPatch = patch.textGenerationModelSelection;
216
- 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.");
217
- for (const [projectId, expected] of Object.entries(patch.expectedProjectPreferences ?? {})) {
218
- const currentPreferences = current.projectPreferences[projectId] ?? {};
219
- for (const [field, value] of Object.entries(expected)) {
220
- const actual = field === "initialModelSelection" && !Object.hasOwn(currentPreferences, field) ? "absent" : currentPreferences[field] ?? null;
221
- if (!Equal.equals(actual, value)) throw new Error("Project preferences changed elsewhere. Reload before saving.");
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
- const { expectedProjectPreferences: _expected, expectedNodePreferences: _expectedNode, projectPreferences: _projects, ...persistedPatch } = patch;
225
- let next = deepMerge(current, persistedPatch);
226
- if (patch.initialModelSelection !== void 0) next = {
227
- ...next,
228
- initialModelSelection: patch.initialModelSelection
229
- };
230
- if (patch.projectPreferences !== void 0) {
231
- const projects = new Map(Object.entries(current.projectPreferences));
232
- for (const [projectId, preferencesPatch] of Object.entries(patch.projectPreferences)) {
233
- if (preferencesPatch === null) {
234
- projects.delete(projectId);
235
- continue;
236
- }
237
- const preferences = { ...projects.get(projectId) };
238
- for (const [field, value] of Object.entries(preferencesPatch)) if (value === null && field !== "initialModelSelection") delete preferences[field];
239
- else Object.assign(preferences, { [field]: value });
240
- if (Object.keys(preferences).length) projects.set(projectId, preferences);
241
- else projects.delete(projectId);
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
- if (patch.projectWorktreeSubmodules !== void 0) {
249
- const modes = new Map(Object.entries(current.projectWorktreeSubmodules));
250
- for (const [projectId, mode] of Object.entries(patch.projectWorktreeSubmodules)) if (mode === null) modes.delete(projectId);
251
- else modes.set(projectId, mode);
252
- next = {
253
- ...next,
254
- projectWorktreeSubmodules: Object.fromEntries(modes)
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
- if (patch.projectWorktreeRoots !== void 0) {
258
- const roots = new Map(Object.entries(current.projectWorktreeRoots));
259
- for (const [projectId, root] of Object.entries(patch.projectWorktreeRoots)) if (root === null || root === "") roots.delete(projectId);
260
- else roots.set(projectId, root);
261
- next = {
262
- ...next,
263
- projectWorktreeRoots: Object.fromEntries(roots)
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
- if (patch.projectStorageRetention !== void 0) {
267
- const policies = new Map(Object.entries(current.projectStorageRetention));
268
- for (const [projectId, policy] of Object.entries(patch.projectStorageRetention)) if (policy === null) policies.delete(projectId);
269
- else policies.set(projectId, policy);
270
- next = {
271
- ...next,
272
- projectStorageRetention: Object.fromEntries(policies)
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
- const nextWithReplacements = patch.providerInstances !== void 0 ? {
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
- * @param {any} value
340
- * @returns {string|undefined}
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
- function getObjectType(value) {
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 {number} major
351
- * @param {string} name
352
- * @param {boolean} terminal
379
+ * @param {Uint8Array<T>} dest
353
380
  */
354
- constructor(major, name, terminal) {
355
- this.major = major;
356
- this.majorEncoded = major << 5;
357
- this.name = name;
358
- this.terminal = terminal;
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
- toString() {
361
- return `Type[${this.major}].${this.name}`;
388
+ reset() {
389
+ this.cursor = 0;
362
390
  }
363
391
  /**
364
- * @param {Type} typ
365
- * @returns {number}
392
+ * @param {number} byte
366
393
  */
367
- compare(typ) {
368
- return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;
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
- * Check equality between two Type instances. Safe to use across different
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
- static equals(a, b) {
379
- return a === b || a.major === b.major && a.name === b.name;
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 {Type} type
398
- * @param {any} [value]
399
- * @param {number} [encodedLength]
407
+ * @param {boolean} [reset]
408
+ * @returns {Uint8Array<T>}
400
409
  */
401
- constructor(type, value, encodedLength) {
402
- this.type = type;
403
- this.value = value;
404
- this.encodedLength = encodedLength;
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/byte-utils.js
416
- const useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === "function";
417
- const textEncoder$1 = new TextEncoder();
418
- /**
419
- * @typedef {import('../interface.js').ByteView} ByteView
420
- * @typedef {import('../interface.js').AllocatedByteView} AllocatedByteView
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} buf
424
- * @returns {boolean}
427
+ * @param {Uint8Array} data
428
+ * @param {number} pos
429
+ * @param {number} need
425
430
  */
426
- function isBuffer(buf) {
427
- return useBuffer && globalThis.Buffer.isBuffer(buf);
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
- * @param {ByteView|number[]} buf
431
- * @returns {ByteView}
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 {string} string
448
+ * @param {Uint8Array} data
449
+ * @param {number} offset
450
+ * @param {DecodeOptions} options
451
+ * @returns {number}
444
452
  */
445
- (string) => {
446
- return string.length >= FROM_STRING_THRESHOLD_TEXTENCODER ? textEncoder$1.encode(string) : utf8ToBytes(string);
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
- * Buffer variant not fast enough for what we need
450
- * @param {number[]} arr
451
- * @returns {AllocatedByteView}
460
+ * @param {Uint8Array} data
461
+ * @param {number} offset
462
+ * @param {DecodeOptions} options
463
+ * @returns {number}
452
464
  */
453
- const fromArray = (arr) => {
454
- return Uint8Array.from(arr);
455
- };
456
- const slice = useBuffer ? (bytes, start, end) => {
457
- if (isBuffer(bytes)) return new Uint8Array(bytes.subarray(start, end));
458
- return bytes.slice(start, end);
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} bytes
462
- * @param {number} start
463
- * @param {number} end
472
+ * @param {Uint8Array} data
473
+ * @param {number} offset
474
+ * @param {DecodeOptions} options
475
+ * @returns {number}
464
476
  */
465
- (bytes, start, end) => {
466
- return bytes.slice(start, end);
467
- };
468
- const concat = useBuffer ? (chunks, length) => {
469
- chunks = chunks.map((c) => c instanceof Uint8Array ? c : globalThis.Buffer.from(c));
470
- return asU8A(globalThis.Buffer.concat(chunks, length));
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 {ByteView[]} chunks
474
- * @param {number} length
475
- * @returns {AllocatedByteView}
484
+ * @param {Uint8Array} data
485
+ * @param {number} offset
486
+ * @param {DecodeOptions} options
487
+ * @returns {number|bigint}
476
488
  */
477
- (chunks, length) => {
478
- const out = new Uint8Array(length);
479
- let off = 0;
480
- for (let b of chunks) {
481
- if (off + b.length > out.length) b = b.subarray(0, out.length - off);
482
- out.set(b, off);
483
- off += b.length;
484
- }
485
- return out;
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 {number} size
492
- * @returns {AllocatedByteView}
500
+ * @param {Uint8Array} data
501
+ * @param {number} pos
502
+ * @param {number} _minor
503
+ * @param {DecodeOptions} options
504
+ * @returns {Token}
493
505
  */
494
- (size) => {
495
- return new Uint8Array(size);
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} b1
499
- * @param {Uint8Array} b2
500
- * @returns {number}
510
+ * @param {Uint8Array} data
511
+ * @param {number} pos
512
+ * @param {number} _minor
513
+ * @param {DecodeOptions} options
514
+ * @returns {Token}
501
515
  */
502
- function compare(b1, b2) {
503
- if (isBuffer(b1) && isBuffer(b2)) return b1.compare(b2);
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 {string} str
512
- * @returns {number[]}
520
+ * @param {Uint8Array} data
521
+ * @param {number} pos
522
+ * @param {number} _minor
523
+ * @param {DecodeOptions} options
524
+ * @returns {Token}
513
525
  */
514
- function utf8ToBytes(str) {
515
- const out = [];
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
- * Bl is a list of byte chunks, similar to https://github.com/rvagg/bl but for
542
- * writing rather than reading.
543
- * A Bl object accepts set() operations for individual bytes and copyTo() for
544
- * inserting byte arrays. These write operations don't automatically increment
545
- * the internal cursor so its "length" won't be changed. Instead, increment()
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
- * @typedef {import('../interface.js').ByteView} ByteView
558
- * @typedef {import('../interface.js').AllocatedByteView} AllocatedByteView
540
+ * @param {ByteWriter} writer
541
+ * @param {Token} token
559
542
  */
560
- const defaultChunkSize = 256;
561
- var Bl = class {
562
- /**
563
- * @param {number} [chunkSize]
564
- */
565
- constructor(chunkSize = defaultChunkSize) {
566
- this.chunkSize = chunkSize;
567
- /** @type {number} */
568
- this.cursor = 0;
569
- /** @type {number} */
570
- this.maxCursor = -1;
571
- /** @type {(ByteView|number[])[]} */
572
- this.chunks = [];
573
- /** @type {ByteView|number[]|null} */
574
- this._initReuseChunk = null;
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 {Uint8Array} data
724
- * @param {number} offset
725
- * @param {DecodeOptions} options
608
+ * @param {Token} token
726
609
  * @returns {number}
727
610
  */
728
- function readUint8(data, offset, options) {
729
- assertEnoughData(data, offset, 1);
730
- const value = data[offset];
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 {Uint8Array} data
736
- * @param {number} offset
737
- * @param {DecodeOptions} options
615
+ * @param {number} uint
738
616
  * @returns {number}
739
617
  */
740
- function readUint16(data, offset, options) {
741
- assertEnoughData(data, offset, 2);
742
- const value = data[offset] << 8 | data[offset + 1];
743
- if (options.strict === true && value < uintBoundaries[1]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
744
- return value;
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 {Uint8Array} data
748
- * @param {number} offset
749
- * @param {DecodeOptions} options
626
+ * @param {Token} tok1
627
+ * @param {Token} tok2
750
628
  * @returns {number}
751
629
  */
752
- function readUint32(data, offset, options) {
753
- assertEnoughData(data, offset, 4);
754
- const value = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];
755
- if (options.strict === true && value < uintBoundaries[2]) throw new Error(`${decodeErrPrefix} integer encoded in more bytes than necessary (strict decode)`);
756
- return value;
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
- * @param {Uint8Array} data
760
- * @param {number} offset
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 decodeUint8(data, pos, _minor, options) {
782
- return new Token(Type.uint, readUint8(data, pos + 1, options), 2);
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 decodeUint16(data, pos, _minor, options) {
792
- return new Token(Type.uint, readUint16(data, pos + 1, options), 3);
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 decodeUint32(data, pos, _minor, options) {
802
- return new Token(Type.uint, readUint32(data, pos + 1, options), 5);
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 decodeUint64(data, pos, _minor, options) {
812
- return new Token(Type.uint, readUint64(data, pos + 1, options), 9);
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 encodeUint(writer, token) {
819
- return encodeUintValue(writer, 0, token.value);
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 {ByteWriter} writer
823
- * @param {number} major
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;
@@ -2495,325 +2220,624 @@ function tokenToMap(token, tokeniser, options) {
2495
2220
  }
2496
2221
  return useMaps ? m : obj;
2497
2222
  }
2498
- /**
2499
- * Generator that yields [key, value] entries from a CBOR map token.
2500
- * Used by tag decoders that need to preserve key types (e.g., Tag 259 Map).
2501
- * @param {Token} token - The map token
2502
- * @param {DecodeTokenizer} tokeniser
2503
- * @param {DecodeOptions} options
2504
- * @returns {Generator<[any, any], void, unknown>}
2505
- */
2506
- function* tokenToMapEntries(token, tokeniser, options) {
2507
- for (let i = 0; i < token.value; i++) {
2508
- const key = tokensToObject(tokeniser, options);
2509
- if (key === BREAK) {
2510
- if (token.value === Infinity) break;
2511
- throw new Error(`${decodeErrPrefix} got unexpected break to lengthed map`);
2512
- }
2513
- if (key === DONE) throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no key], expected ${token.value})`);
2514
- const value = tokensToObject(tokeniser, options);
2515
- if (value === DONE) throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no value], expected ${token.value})`);
2516
- yield [key, value];
2517
- }
2223
+ /**
2224
+ * Generator that yields [key, value] entries from a CBOR map token.
2225
+ * Used by tag decoders that need to preserve key types (e.g., Tag 259 Map).
2226
+ * @param {Token} token - The map token
2227
+ * @param {DecodeTokenizer} tokeniser
2228
+ * @param {DecodeOptions} options
2229
+ * @returns {Generator<[any, any], void, unknown>}
2230
+ */
2231
+ function* tokenToMapEntries(token, tokeniser, options) {
2232
+ for (let i = 0; i < token.value; i++) {
2233
+ const key = tokensToObject(tokeniser, options);
2234
+ if (key === BREAK) {
2235
+ if (token.value === Infinity) break;
2236
+ throw new Error(`${decodeErrPrefix} got unexpected break to lengthed map`);
2237
+ }
2238
+ if (key === DONE) throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no key], expected ${token.value})`);
2239
+ const value = tokensToObject(tokeniser, options);
2240
+ if (value === DONE) throw new Error(`${decodeErrPrefix} found map but not enough entries (got ${i} [no value], expected ${token.value})`);
2241
+ yield [key, value];
2242
+ }
2243
+ }
2244
+ /**
2245
+ * Creates a TagDecodeControl object for tag decoders.
2246
+ * @param {DecodeTokenizer} tokeniser
2247
+ * @param {DecodeOptions} options
2248
+ * @returns {TagDecodeControl}
2249
+ */
2250
+ function createTagDecodeControl(tokeniser, options) {
2251
+ /** @type {TagDecodeControl & {_called: boolean}} */
2252
+ const decode = function() {
2253
+ if (decode._called) throw new Error(`${decodeErrPrefix} tag decode() may only be called once`);
2254
+ decode._called = true;
2255
+ const value = tokensToObject(tokeniser, options);
2256
+ if (value === DONE) throw new Error(`${decodeErrPrefix} tag content missing`);
2257
+ if (value === BREAK) throw new Error(`${decodeErrPrefix} got unexpected break in tag content`);
2258
+ return value;
2259
+ };
2260
+ decode.entries = function() {
2261
+ if (decode._called) throw new Error(`${decodeErrPrefix} tag decode() may only be called once`);
2262
+ decode._called = true;
2263
+ const token = tokeniser.next();
2264
+ if (!Type.equals(token.type, Type.map)) throw new Error(`${decodeErrPrefix} entries() requires map content, got ${token.type.name}`);
2265
+ const entries = [];
2266
+ for (const entry of tokenToMapEntries(token, tokeniser, options)) entries.push(entry);
2267
+ return entries;
2268
+ };
2269
+ decode._called = false;
2270
+ return decode;
2271
+ }
2272
+ /**
2273
+ * @param {DecodeTokenizer} tokeniser
2274
+ * @param {DecodeOptions} options
2275
+ * @returns {any|typeof BREAK|typeof DONE}
2276
+ */
2277
+ function tokensToObject(tokeniser, options) {
2278
+ if (tokeniser.done()) return DONE;
2279
+ const token = tokeniser.next();
2280
+ if (Type.equals(token.type, Type.break)) return BREAK;
2281
+ if (token.type.terminal) return token.value;
2282
+ if (Type.equals(token.type, Type.array)) return tokenToArray(token, tokeniser, options);
2283
+ if (Type.equals(token.type, Type.map)) return tokenToMap(token, tokeniser, options);
2284
+ if (Type.equals(token.type, Type.tag)) {
2285
+ if (options.tags && typeof options.tags[token.value] === "function") {
2286
+ const decodeControl = createTagDecodeControl(tokeniser, options);
2287
+ const result = options.tags[token.value](decodeControl);
2288
+ if (!decodeControl._called) throw new Error(`${decodeErrPrefix} tag decoder must call decode() or entries()`);
2289
+ return result;
2290
+ }
2291
+ throw new Error(`${decodeErrPrefix} tag not supported (${token.value})`);
2292
+ }
2293
+ throw new Error("unsupported");
2294
+ }
2295
+ /**
2296
+ * @param {Uint8Array} data
2297
+ * @param {DecodeOptions} [options]
2298
+ * @returns {[any, Uint8Array]}
2299
+ */
2300
+ function decodeFirst(data, options) {
2301
+ if (!(data instanceof Uint8Array)) throw new Error(`${decodeErrPrefix} data to decode must be a Uint8Array`);
2302
+ options = Object.assign({}, defaultDecodeOptions, options);
2303
+ const u8aData = asU8A(data);
2304
+ const tokeniser = options.tokenizer || new Tokeniser(u8aData, options);
2305
+ const decoded = tokensToObject(tokeniser, options);
2306
+ if (decoded === DONE) throw new Error(`${decodeErrPrefix} did not find any content to decode`);
2307
+ if (decoded === BREAK) throw new Error(`${decodeErrPrefix} got unexpected break`);
2308
+ return [decoded, data.subarray(tokeniser.pos())];
2309
+ }
2310
+ /**
2311
+ * @param {Uint8Array} data
2312
+ * @param {DecodeOptions} [options]
2313
+ * @returns {any}
2314
+ */
2315
+ function decode(data, options) {
2316
+ const [decoded, remainder] = decodeFirst(data, options);
2317
+ if (remainder.length > 0) throw new Error(`${decodeErrPrefix} too many terminals, data makes no sense`);
2318
+ return decoded;
2319
+ }
2320
+ Object.defineProperty(class Tagged {
2321
+ /**
2322
+ * @param {number} tag - CBOR tag number, a non-negative integer
2323
+ * @param {any} value - The value to be tagged; encoded recursively
2324
+ */
2325
+ constructor(tag, value) {
2326
+ if (typeof tag !== "number" || !Number.isInteger(tag) || tag < 0) throw new TypeError("Tagged: tag must be a non-negative integer");
2327
+ this.tag = tag;
2328
+ this.value = value;
2329
+ }
2330
+ /**
2331
+ * Build a tag decoder for use in `decode()`'s `tags` option that returns the
2332
+ * decoded content wrapped in a `Tagged` instance, preserving the tag number
2333
+ * for the caller to inspect.
2334
+ *
2335
+ * @param {number} tag - The CBOR tag number this decoder will be registered for
2336
+ * @returns {TaggedTagDecoder}
2337
+ *
2338
+ * @example
2339
+ * import { decode, Tagged } from 'cborg'
2340
+ * const value = decode(bytes, { tags: { 16: Tagged.decoder(16) } })
2341
+ * // value instanceof Tagged; value.tag === 16
2342
+ */
2343
+ static decoder(tag) {
2344
+ return (decode) => new Tagged(tag, decode());
2345
+ }
2346
+ /**
2347
+ * Build a `tags` option for `decode()` that wraps each listed tag number in
2348
+ * a `Tagged` instance, preserving those tags through decode without
2349
+ * registering a dedicated decoder per tag.
2350
+ *
2351
+ * @param {...number} tagNumbers - One or more CBOR tag numbers to preserve
2352
+ * @returns {{[tagNumber: number]: TaggedTagDecoder}}
2353
+ *
2354
+ * @example
2355
+ * import { decode, Tagged } from 'cborg'
2356
+ * const value = decode(bytes, { tags: Tagged.preserve(16, 96) })
2357
+ */
2358
+ static preserve(...tagNumbers) {
2359
+ /** @type {{[tagNumber: number]: TaggedTagDecoder}} */
2360
+ const tags = {};
2361
+ for (const tag of tagNumbers) tags[tag] = Tagged.decoder(tag);
2362
+ return tags;
2363
+ }
2364
+ }.prototype, Symbol.toStringTag, { value: "Tagged" });
2365
+ //#endregion
2366
+ //#region ../../packages/shared/src/nodeIdentity.ts
2367
+ const NODE_AUTH_TRANSCRIPT_DOMAIN = "ryco.node-auth.proof.v1";
2368
+ const NODE_KEY_FINGERPRINT_DOMAIN = "ryco.node-key.v1";
2369
+ const NODE_KEY_ROTATION_TRANSCRIPT_DOMAIN = "ryco.node-key-rotation.proof.v1";
2370
+ const NATIVE_NODE_CLAIM_TRANSCRIPT_DOMAIN = "ryco.native-node-claim.proof.v1";
2371
+ var NodeIdentityValidationError = class extends Error {
2372
+ code = "invalid_node_identity_input";
2373
+ constructor() {
2374
+ super("Node identity input is invalid.");
2375
+ this.name = "NodeIdentityValidationError";
2376
+ }
2377
+ };
2378
+ const ID_SUFFIX = "[A-Za-z0-9_-]{22}";
2379
+ const NODE_ID = new RegExp(`^node_${ID_SUFFIX}$`);
2380
+ const NODE_KEY_ID = new RegExp(`^nkey_${ID_SUFFIX}$`);
2381
+ const ROTATION_REQUEST_ID = new RegExp(`^nrot_${ID_SUFFIX}$`);
2382
+ const PUBLIC_ID_SUFFIX = "[A-Za-z0-9_-]{22,43}";
2383
+ const ACCOUNT_ID = new RegExp(`^acct_${PUBLIC_ID_SUFFIX}$`);
2384
+ const SPACE_ID = new RegExp(`^space_${PUBLIC_ID_SUFFIX}$`);
2385
+ const SESSION_ID = new RegExp(`^sess_${PUBLIC_ID_SUFFIX}$`);
2386
+ const NATIVE_NODE_CLAIM_ID = new RegExp(`^nclaim_${PUBLIC_ID_SUFFIX}$`);
2387
+ const DESKTOP_INSTALLATION_ID = new RegExp(`^install_${PUBLIC_ID_SUFFIX}$`);
2388
+ const ENVIRONMENT_ID = /^env_[A-Za-z0-9_-]{22}$/;
2389
+ const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
2390
+ "localhost",
2391
+ "127.0.0.1",
2392
+ "[::1]"
2393
+ ]);
2394
+ function invalid() {
2395
+ throw new NodeIdentityValidationError();
2396
+ }
2397
+ function assertUnsignedSafeInteger(value) {
2398
+ if (!Number.isSafeInteger(value) || value < 0) invalid();
2399
+ }
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 };
2518
2615
  }
2519
- /**
2520
- * Creates a TagDecodeControl object for tag decoders.
2521
- * @param {DecodeTokenizer} tokeniser
2522
- * @param {DecodeOptions} options
2523
- * @returns {TagDecodeControl}
2524
- */
2525
- function createTagDecodeControl(tokeniser, options) {
2526
- /** @type {TagDecodeControl & {_called: boolean}} */
2527
- const decode = function() {
2528
- if (decode._called) throw new Error(`${decodeErrPrefix} tag decode() may only be called once`);
2529
- decode._called = true;
2530
- const value = tokensToObject(tokeniser, options);
2531
- if (value === DONE) throw new Error(`${decodeErrPrefix} tag content missing`);
2532
- if (value === BREAK) throw new Error(`${decodeErrPrefix} got unexpected break in tag content`);
2533
- return value;
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
2534
2632
  };
2535
- decode.entries = function() {
2536
- if (decode._called) throw new Error(`${decodeErrPrefix} tag decode() may only be called once`);
2537
- decode._called = true;
2538
- const token = tokeniser.next();
2539
- if (!Type.equals(token.type, Type.map)) throw new Error(`${decodeErrPrefix} entries() requires map content, got ${token.type.name}`);
2540
- const entries = [];
2541
- for (const entry of tokenToMapEntries(token, tokeniser, options)) entries.push(entry);
2542
- return entries;
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
2543
2665
  };
2544
- decode._called = false;
2545
- return decode;
2666
+ return selections.length > 0 ? {
2667
+ ...base,
2668
+ options: selections
2669
+ } : base;
2670
+ }
2671
+ function canonicalOptionKeys(options) {
2672
+ return (options ?? []).map((option) => JSON.stringify([option.id, option.value])).toSorted((left, right) => left < right ? -1 : left > right ? 1 : 0);
2546
2673
  }
2547
2674
  /**
2548
- * @param {DecodeTokenizer} tokeniser
2549
- * @param {DecodeOptions} options
2550
- * @returns {any|typeof BREAK|typeof DONE}
2675
+ * Semantic equality of two model selections: same instance and model, and the
2676
+ * same options regardless of their order (absent options equal an empty list).
2677
+ * Key order never matters, so a selection round-tripped through JSON and schema
2678
+ * decode equals the hydrated one.
2551
2679
  */
2552
- function tokensToObject(tokeniser, options) {
2553
- if (tokeniser.done()) return DONE;
2554
- const token = tokeniser.next();
2555
- if (Type.equals(token.type, Type.break)) return BREAK;
2556
- if (token.type.terminal) return token.value;
2557
- if (Type.equals(token.type, Type.array)) return tokenToArray(token, tokeniser, options);
2558
- if (Type.equals(token.type, Type.map)) return tokenToMap(token, tokeniser, options);
2559
- if (Type.equals(token.type, Type.tag)) {
2560
- if (options.tags && typeof options.tags[token.value] === "function") {
2561
- const decodeControl = createTagDecodeControl(tokeniser, options);
2562
- const result = options.tags[token.value](decodeControl);
2563
- if (!decodeControl._called) throw new Error(`${decodeErrPrefix} tag decoder must call decode() or entries()`);
2564
- return result;
2565
- }
2566
- throw new Error(`${decodeErrPrefix} tag not supported (${token.value})`);
2567
- }
2568
- throw new Error("unsupported");
2680
+ function sameModelSelection(left, right) {
2681
+ if (left.instanceId !== right.instanceId || left.model !== right.model) return false;
2682
+ const leftOptions = canonicalOptionKeys(left.options);
2683
+ const rightOptions = canonicalOptionKeys(right.options);
2684
+ return leftOptions.length === rightOptions.length && leftOptions.every((key, index) => rightOptions[index] === key);
2569
2685
  }
2570
2686
  /**
2571
- * @param {Uint8Array} data
2572
- * @param {DecodeOptions} [options]
2573
- * @returns {[any, Uint8Array]}
2687
+ * Context handoff is a provider-instance boundary. Model and option changes
2688
+ * within one configured instance remain on that provider's normal turn path.
2574
2689
  */
2575
- function decodeFirst(data, options) {
2576
- if (!(data instanceof Uint8Array)) throw new Error(`${decodeErrPrefix} data to decode must be a Uint8Array`);
2577
- options = Object.assign({}, defaultDecodeOptions, options);
2578
- const u8aData = asU8A(data);
2579
- const tokeniser = options.tokenizer || new Tokeniser(u8aData, options);
2580
- const decoded = tokensToObject(tokeniser, options);
2581
- if (decoded === DONE) throw new Error(`${decodeErrPrefix} did not find any content to decode`);
2582
- if (decoded === BREAK) throw new Error(`${decodeErrPrefix} got unexpected break`);
2583
- return [decoded, data.subarray(tokeniser.pos())];
2690
+ function modelSelectionRequiresContextHandoff(input) {
2691
+ return input.canonicalSelection.instanceId !== input.targetSelection.instanceId;
2584
2692
  }
2585
2693
  /**
2586
- * @param {Uint8Array} data
2587
- * @param {DecodeOptions} [options]
2588
- * @returns {any}
2694
+ * Returns the effort value if it is a prompt-injected value according to
2695
+ * any select descriptor in the given capabilities, or null otherwise.
2696
+ *
2697
+ * Unlike a single `find`, this checks every descriptor so that the
2698
+ * correct descriptor's `promptInjectedValues` list is consulted even when
2699
+ * multiple select descriptors exist.
2589
2700
  */
2590
- function decode(data, options) {
2591
- const [decoded, remainder] = decodeFirst(data, options);
2592
- if (remainder.length > 0) throw new Error(`${decodeErrPrefix} too many terminals, data makes no sense`);
2593
- return decoded;
2594
- }
2595
- Object.defineProperty(class Tagged {
2596
- /**
2597
- * @param {number} tag - CBOR tag number, a non-negative integer
2598
- * @param {any} value - The value to be tagged; encoded recursively
2599
- */
2600
- constructor(tag, value) {
2601
- if (typeof tag !== "number" || !Number.isInteger(tag) || tag < 0) throw new TypeError("Tagged: tag must be a non-negative integer");
2602
- this.tag = tag;
2603
- this.value = value;
2604
- }
2605
- /**
2606
- * Build a tag decoder for use in `decode()`'s `tags` option that returns the
2607
- * decoded content wrapped in a `Tagged` instance, preserving the tag number
2608
- * for the caller to inspect.
2609
- *
2610
- * @param {number} tag - The CBOR tag number this decoder will be registered for
2611
- * @returns {TaggedTagDecoder}
2612
- *
2613
- * @example
2614
- * import { decode, Tagged } from 'cborg'
2615
- * const value = decode(bytes, { tags: { 16: Tagged.decoder(16) } })
2616
- * // value instanceof Tagged; value.tag === 16
2617
- */
2618
- static decoder(tag) {
2619
- return (decode) => new Tagged(tag, decode());
2620
- }
2621
- /**
2622
- * Build a `tags` option for `decode()` that wraps each listed tag number in
2623
- * a `Tagged` instance, preserving those tags through decode without
2624
- * registering a dedicated decoder per tag.
2625
- *
2626
- * @param {...number} tagNumbers - One or more CBOR tag numbers to preserve
2627
- * @returns {{[tagNumber: number]: TaggedTagDecoder}}
2628
- *
2629
- * @example
2630
- * import { decode, Tagged } from 'cborg'
2631
- * const value = decode(bytes, { tags: Tagged.preserve(16, 96) })
2632
- */
2633
- static preserve(...tagNumbers) {
2634
- /** @type {{[tagNumber: number]: TaggedTagDecoder}} */
2635
- const tags = {};
2636
- for (const tag of tagNumbers) tags[tag] = Tagged.decoder(tag);
2637
- return tags;
2638
- }
2639
- }.prototype, Symbol.toStringTag, { value: "Tagged" });
2640
- //#endregion
2641
- //#region ../../packages/shared/src/nodeIdentity.ts
2642
- const NODE_AUTH_TRANSCRIPT_DOMAIN = "ryco.node-auth.proof.v1";
2643
- const NODE_KEY_FINGERPRINT_DOMAIN = "ryco.node-key.v1";
2644
- const NODE_KEY_ROTATION_TRANSCRIPT_DOMAIN = "ryco.node-key-rotation.proof.v1";
2645
- const NATIVE_NODE_CLAIM_TRANSCRIPT_DOMAIN = "ryco.native-node-claim.proof.v1";
2646
- var NodeIdentityValidationError = class extends Error {
2647
- code = "invalid_node_identity_input";
2648
- constructor() {
2649
- super("Node identity input is invalid.");
2650
- this.name = "NodeIdentityValidationError";
2651
- }
2652
- };
2653
- const ID_SUFFIX = "[A-Za-z0-9_-]{22}";
2654
- const NODE_ID = new RegExp(`^node_${ID_SUFFIX}$`);
2655
- const NODE_KEY_ID = new RegExp(`^nkey_${ID_SUFFIX}$`);
2656
- const ROTATION_REQUEST_ID = new RegExp(`^nrot_${ID_SUFFIX}$`);
2657
- const PUBLIC_ID_SUFFIX = "[A-Za-z0-9_-]{22,43}";
2658
- const ACCOUNT_ID = new RegExp(`^acct_${PUBLIC_ID_SUFFIX}$`);
2659
- const SPACE_ID = new RegExp(`^space_${PUBLIC_ID_SUFFIX}$`);
2660
- const SESSION_ID = new RegExp(`^sess_${PUBLIC_ID_SUFFIX}$`);
2661
- const NATIVE_NODE_CLAIM_ID = new RegExp(`^nclaim_${PUBLIC_ID_SUFFIX}$`);
2662
- const DESKTOP_INSTALLATION_ID = new RegExp(`^install_${PUBLIC_ID_SUFFIX}$`);
2663
- const ENVIRONMENT_ID = /^env_[A-Za-z0-9_-]{22}$/;
2664
- const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
2665
- "localhost",
2666
- "127.0.0.1",
2667
- "[::1]"
2668
- ]);
2669
- function invalid() {
2670
- throw new NodeIdentityValidationError();
2671
- }
2672
- function assertUnsignedSafeInteger(value) {
2673
- if (!Number.isSafeInteger(value) || value < 0) invalid();
2701
+ function resolvePromptInjectedEffort(caps, rawEffort) {
2702
+ const trimmed = trimOrNull(rawEffort);
2703
+ if (!trimmed) return null;
2704
+ const descriptors = getProviderOptionDescriptors({ caps });
2705
+ for (const descriptor of descriptors) if (descriptor.type === "select" && descriptor.promptInjectedValues?.includes(trimmed)) return trimmed;
2706
+ return null;
2674
2707
  }
2675
- function assertProtocolVersion(value) {
2676
- if (!Number.isSafeInteger(value) || value < 0 || value > 65535) invalid();
2708
+ function applyClaudePromptEffortPrefix(text, effort) {
2709
+ const trimmed = text.trim();
2710
+ if (!trimmed) return trimmed;
2711
+ if (effort !== "ultrathink") return trimmed;
2712
+ if (trimmed.startsWith("Ultrathink:")) return trimmed;
2713
+ return `Ultrathink:\n${trimmed}`;
2677
2714
  }
2678
- function assertIdentifier(value, pattern) {
2679
- if (!pattern.test(value)) invalid();
2715
+ //#endregion
2716
+ //#region ../../packages/shared/src/serverSettings.ts
2717
+ const ServerSettingsJson$1 = fromLenientJson(ServerSettings);
2718
+ function normalizePersistedServerSettingString(value) {
2719
+ const trimmed = value?.trim();
2720
+ return trimmed && trimmed.length > 0 ? trimmed : void 0;
2680
2721
  }
2681
- function copyBytes(value, expectedLengths) {
2682
- if (!(value instanceof Uint8Array) || !expectedLengths.includes(value.byteLength)) invalid();
2683
- return Uint8Array.from(value);
2722
+ function extractPersistedServerObservabilitySettings(input) {
2723
+ return {
2724
+ otlpTracesUrl: normalizePersistedServerSettingString(input.observability?.otlpTracesUrl),
2725
+ otlpMetricsUrl: normalizePersistedServerSettingString(input.observability?.otlpMetricsUrl)
2726
+ };
2684
2727
  }
2685
- function canonicalizeHubOrigin(value) {
2686
- if (typeof value !== "string" || value.length === 0 || value.length > 512) invalid();
2687
- let url;
2728
+ function parsePersistedServerObservabilitySettings(raw) {
2688
2729
  try {
2689
- url = new URL(value);
2730
+ return extractPersistedServerObservabilitySettings(Schema.decodeUnknownSync(ServerSettingsJson$1)(raw));
2690
2731
  } 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
2732
  return {
2713
- algorithm: descriptor.algorithm,
2714
- publicKey
2733
+ otlpTracesUrl: void 0,
2734
+ otlpMetricsUrl: void 0
2715
2735
  };
2716
2736
  }
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
2737
  }
2751
- function encodeNodeKeyRotationTranscript(input) {
2752
- const hubOrigin = canonicalizeHubOrigin(input.hubOrigin);
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));
2738
+ function shouldReplaceTextGenerationModelSelection(patch) {
2739
+ return Boolean(patch && (patch.instanceId !== void 0 || patch.model !== void 0));
2778
2740
  }
2779
- function encodeNativeNodeClaimTranscript(input) {
2780
- const hubOrigin = canonicalizeHubOrigin(input.hubOrigin);
2781
- assertProtocolVersion(input.protocolVersion);
2782
- assertProtocolVersion(input.transcriptVersion);
2783
- assertIdentifier(input.claimId, NATIVE_NODE_CLAIM_ID);
2784
- assertIdentifier(input.accountId, ACCOUNT_ID);
2785
- assertIdentifier(input.spaceId, SPACE_ID);
2786
- assertIdentifier(input.sessionId, SESSION_ID);
2787
- const dpopKeyThumbprint = copyBytes(input.dpopKeyThumbprint, [32]);
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));
2741
+ function mergeModelSelectionOptionsById(input) {
2742
+ if (input.patch === void 0) return input.current ? [...input.current] : void 0;
2743
+ if (input.patch.length === 0) return;
2744
+ const merged = new Map((input.current ?? []).map((selection) => [selection.id, selection.value]));
2745
+ for (const selection of input.patch) merged.set(selection.id, selection.value);
2746
+ return [...merged.entries()].map(([id, value]) => ({
2747
+ id,
2748
+ value
2749
+ }));
2812
2750
  }
2813
- function equalNodeIdentityBytes(left, right) {
2814
- if (!(left instanceof Uint8Array) || !(right instanceof Uint8Array)) return false;
2815
- if (left.byteLength !== right.byteLength) return false;
2816
- return timingSafeEqual(left, right);
2751
+ /**
2752
+ * Applies a server settings patch while treating textGenerationModelSelection as
2753
+ * replace-on-provider/model updates. This prevents stale nested options from
2754
+ * surviving a reset patch that intentionally omits options.
2755
+ */
2756
+ function applyServerSettingsPatch(current, patch) {
2757
+ const selectionPatch = patch.textGenerationModelSelection;
2758
+ 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.");
2759
+ for (const [projectId, expected] of Object.entries(patch.expectedProjectPreferences ?? {})) {
2760
+ const currentPreferences = current.projectPreferences[projectId] ?? {};
2761
+ for (const [field, value] of Object.entries(expected)) {
2762
+ const actual = field === "initialModelSelection" && !Object.hasOwn(currentPreferences, field) ? "absent" : currentPreferences[field] ?? null;
2763
+ if (!Equal.equals(actual, value)) throw new Error("Project preferences changed elsewhere. Reload before saving.");
2764
+ }
2765
+ }
2766
+ const { expectedProjectPreferences: _expected, expectedNodePreferences: _expectedNode, projectPreferences: _projects, ...persistedPatch } = patch;
2767
+ let next = deepMerge(current, persistedPatch);
2768
+ if (patch.initialModelSelection !== void 0) next = {
2769
+ ...next,
2770
+ initialModelSelection: patch.initialModelSelection
2771
+ };
2772
+ if (patch.projectPreferences !== void 0) {
2773
+ const projects = new Map(Object.entries(current.projectPreferences));
2774
+ for (const [projectId, preferencesPatch] of Object.entries(patch.projectPreferences)) {
2775
+ if (preferencesPatch === null) {
2776
+ projects.delete(projectId);
2777
+ continue;
2778
+ }
2779
+ const preferences = { ...projects.get(projectId) };
2780
+ for (const [field, value] of Object.entries(preferencesPatch)) if (value === null && field !== "initialModelSelection") delete preferences[field];
2781
+ else Object.assign(preferences, { [field]: value });
2782
+ if (Object.keys(preferences).length) projects.set(projectId, preferences);
2783
+ else projects.delete(projectId);
2784
+ }
2785
+ next = {
2786
+ ...next,
2787
+ projectPreferences: Object.fromEntries(projects)
2788
+ };
2789
+ }
2790
+ if (patch.projectWorktreeSubmodules !== void 0) {
2791
+ const modes = new Map(Object.entries(current.projectWorktreeSubmodules));
2792
+ for (const [projectId, mode] of Object.entries(patch.projectWorktreeSubmodules)) if (mode === null) modes.delete(projectId);
2793
+ else modes.set(projectId, mode);
2794
+ next = {
2795
+ ...next,
2796
+ projectWorktreeSubmodules: Object.fromEntries(modes)
2797
+ };
2798
+ }
2799
+ if (patch.projectWorktreeRoots !== void 0) {
2800
+ const roots = new Map(Object.entries(current.projectWorktreeRoots));
2801
+ for (const [projectId, root] of Object.entries(patch.projectWorktreeRoots)) if (root === null || root === "") roots.delete(projectId);
2802
+ else roots.set(projectId, root);
2803
+ next = {
2804
+ ...next,
2805
+ projectWorktreeRoots: Object.fromEntries(roots)
2806
+ };
2807
+ }
2808
+ if (patch.projectStorageRetention !== void 0) {
2809
+ const policies = new Map(Object.entries(current.projectStorageRetention));
2810
+ for (const [projectId, policy] of Object.entries(patch.projectStorageRetention)) if (policy === null) policies.delete(projectId);
2811
+ else policies.set(projectId, policy);
2812
+ next = {
2813
+ ...next,
2814
+ projectStorageRetention: Object.fromEntries(policies)
2815
+ };
2816
+ }
2817
+ if (patch.projectLifecycleSuggestions !== void 0) {
2818
+ const policies = new Map(Object.entries(current.projectLifecycleSuggestions));
2819
+ for (const [projectId, policy] of Object.entries(patch.projectLifecycleSuggestions)) if (policy === null) policies.delete(projectId);
2820
+ else policies.set(projectId, policy);
2821
+ next = {
2822
+ ...next,
2823
+ projectLifecycleSuggestions: Object.fromEntries(policies)
2824
+ };
2825
+ }
2826
+ const nextWithReplacements = patch.providerInstances !== void 0 ? {
2827
+ ...next,
2828
+ providerInstances: patch.providerInstances
2829
+ } : next;
2830
+ if (!selectionPatch) return nextWithReplacements;
2831
+ const instanceId = selectionPatch.instanceId ?? current.textGenerationModelSelection.instanceId;
2832
+ const model = selectionPatch.model ?? current.textGenerationModelSelection.model;
2833
+ const options = shouldReplaceTextGenerationModelSelection(selectionPatch) ? selectionPatch.options : mergeModelSelectionOptionsById({
2834
+ current: current.textGenerationModelSelection.options,
2835
+ patch: selectionPatch.options
2836
+ });
2837
+ return {
2838
+ ...nextWithReplacements,
2839
+ textGenerationModelSelection: createModelSelection(instanceId, model, options)
2840
+ };
2817
2841
  }
2818
2842
  //#endregion
2819
2843
  //#region src/config.ts
@@ -2890,6 +2914,7 @@ function resolveHubConnectorConfig(raw) {
2890
2914
  };
2891
2915
  }
2892
2916
  const DEFAULT_NODE_E2EE_POLICY_CONFIG = {
2917
+ mode: void 0,
2893
2918
  requireE2EE: void 0,
2894
2919
  requireApprovedClientE2EE: void 0,
2895
2920
  configurationIssue: void 0
@@ -2916,15 +2941,21 @@ const parseTriStateBoolean = (value) => {
2916
2941
  function resolveNodeE2eePolicyConfig(raw) {
2917
2942
  const requireE2EE = parseTriStateBoolean(raw.requireE2EE);
2918
2943
  const requireApprovedClientE2EE = parseTriStateBoolean(raw.requireApprovedClientE2EE);
2944
+ const mode = raw.mode === void 0 ? void 0 : Schema.is(NodeE2eeAdmissionPolicy)(raw.mode) ? raw.mode : null;
2919
2945
  return {
2946
+ mode: mode ?? void 0,
2920
2947
  requireE2EE: typeof requireE2EE === "boolean" ? requireE2EE : void 0,
2921
2948
  requireApprovedClientE2EE: typeof requireApprovedClientE2EE === "boolean" ? requireApprovedClientE2EE : void 0,
2922
- configurationIssue: requireE2EE === void 0 || requireApprovedClientE2EE === void 0 ? "configuration_invalid" : void 0
2949
+ configurationIssue: requireE2EE === void 0 || requireApprovedClientE2EE === void 0 || mode === null ? "configuration_invalid" : void 0
2923
2950
  };
2924
2951
  }
2925
2952
  function resolveManagedWorktreesRoot(config) {
2926
2953
  return config.workspaceAccessRoot === void 0 ? config.worktreesDir : path.join(config.workspaceAccessRoot, ".ryco", "worktrees");
2927
2954
  }
2955
+ /** The chats root used when the `chatsRoot` setting is empty. */
2956
+ function resolveManagedChatsRoot(config) {
2957
+ return config.workspaceAccessRoot === void 0 ? config.chatsDir : path.join(config.workspaceAccessRoot, ".ryco", "chats");
2958
+ }
2928
2959
  const deriveServerPaths = Effect.fn(function* (baseDir, devUrl) {
2929
2960
  const { join } = yield* Path.Path;
2930
2961
  const stateDir = join(baseDir, devUrl !== void 0 ? "dev" : "userdata");
@@ -2940,6 +2971,7 @@ const deriveServerPaths = Effect.fn(function* (baseDir, devUrl) {
2940
2971
  settingsPath: join(stateDir, "settings.json"),
2941
2972
  providerStatusCacheDir,
2942
2973
  worktreesDir: join(baseDir, "worktrees"),
2974
+ chatsDir: join(baseDir, "chats"),
2943
2975
  attachmentsDir,
2944
2976
  logsDir,
2945
2977
  serverLogPath: join(logsDir, "server.log"),
@@ -3447,6 +3479,11 @@ async function removeVerifiedWorktree(repository, candidate, cleanup) {
3447
3479
  //#region src/storage/lifecycle.ts
3448
3480
  const storageLifecycleLock = Semaphore.makeUnsafe(1);
3449
3481
  const creations = /* @__PURE__ */ new Map();
3482
+ let activityVersion = 0;
3483
+ const noteStorageActivity = () => {
3484
+ activityVersion++;
3485
+ };
3486
+ const storageActivityVersion = () => activityVersion;
3450
3487
  const overlaps = (a, b, platform = process.platform) => {
3451
3488
  if (platform === "darwin" || platform === "win32") {
3452
3489
  a = a.toLowerCase();
@@ -3455,6 +3492,12 @@ const overlaps = (a, b, platform = process.platform) => {
3455
3492
  const boundary = (root) => root.endsWith(path.sep) ? root : root + path.sep;
3456
3493
  return a === b || a.startsWith(boundary(b)) || b.startsWith(boundary(a));
3457
3494
  };
3495
+ /** `candidate` is `root` or below it. */
3496
+ const contains = (root, candidate, platform) => {
3497
+ const a = platform === "darwin" || platform === "win32" ? root.toLowerCase() : root;
3498
+ const b = platform === "darwin" || platform === "win32" ? candidate.toLowerCase() : candidate;
3499
+ return a === b || b.startsWith(a.endsWith(path.sep) ? a : a + path.sep);
3500
+ };
3458
3501
  const removingPaths = (row) => {
3459
3502
  let identity;
3460
3503
  try {
@@ -3485,6 +3528,7 @@ async function canonicalStoragePath(candidate) {
3485
3528
  function acquireWorktreeCreationLease(sql, candidate) {
3486
3529
  return storageLifecycleLock.withPermit(Effect.gen(function* () {
3487
3530
  const canonical = yield* Effect.tryPromise(() => canonicalStoragePath(candidate));
3531
+ if (yield* isWorktreeRelocationBlocked(sql, canonical)) return yield* new StorageError({ detail: "Checkout relocation is pending or this is a retired checkout path. Reload the workspace." });
3488
3532
  const pending = yield* sql`SELECT path, identity_json FROM storage_owned_entries WHERE state = 'removing' LIMIT 257`;
3489
3533
  if (pending.length > 256) return yield* new StorageError({ detail: "Too many interrupted cleanups to establish safe creation admission. Inspect pending cleanup records." });
3490
3534
  if (pending.some((row) => removingPaths(row).some((root) => overlaps(root, canonical)))) return yield* new StorageError({ detail: "Checkout cleanup is pending. Creation cannot replace an in-flight removal." });
@@ -3493,6 +3537,7 @@ function acquireWorktreeCreationLease(sql, candidate) {
3493
3537
  const remaining = (creations.get(canonical) ?? 1) - 1;
3494
3538
  if (remaining > 0) creations.set(canonical, remaining);
3495
3539
  else creations.delete(canonical);
3540
+ noteStorageActivity();
3496
3541
  });
3497
3542
  }));
3498
3543
  }
@@ -3500,12 +3545,14 @@ function acquireWorktreeCreationLease(sql, candidate) {
3500
3545
  function acquireStoragePathUseLease(sql, candidate) {
3501
3546
  return storageLifecycleLock.withPermit(Effect.gen(function* () {
3502
3547
  const canonical = yield* Effect.tryPromise(() => canonicalStoragePath(candidate));
3503
- if (yield* isStoragePathBlocked(sql, canonical)) return yield* new StorageError({ detail: "Checkout cleanup is pending or complete. Restore/recreate it before provider recovery." });
3548
+ const blocker = yield* storagePathBlocker(sql, canonical);
3549
+ if (blocker !== null) return yield* new StorageError({ detail: blocker === "project-relocation" ? PROJECT_RELOCATION_PENDING_MESSAGE : "Checkout cleanup is pending or complete. Restore/recreate it before provider recovery." });
3504
3550
  creations.set(canonical, (creations.get(canonical) ?? 0) + 1);
3505
3551
  return Effect.sync(() => {
3506
3552
  const remaining = (creations.get(canonical) ?? 1) - 1;
3507
3553
  if (remaining > 0) creations.set(canonical, remaining);
3508
3554
  else creations.delete(canonical);
3555
+ noteStorageActivity();
3509
3556
  });
3510
3557
  }));
3511
3558
  }
@@ -3533,8 +3580,22 @@ function recordCreatedWorktree(sql, repository, candidate) {
3533
3580
  WHERE storage_owned_entries.state != 'removing' RETURNING id`).length !== 1) return yield* new StorageError({ detail: "Ownership capture refused to replace a pending cleanup. The creation outcome remains protected." });
3534
3581
  });
3535
3582
  }
3536
- /** Persistent tombstones prevent restart/resume from granting authority to a removed checkout. */
3537
- function isStoragePathBlocked(sql, candidate, platform = process.platform) {
3583
+ /**
3584
+ * Storage admission for a path: refused while a chat's folder moves or checkout lifecycle work
3585
+ * fences it. Persistent tombstones prevent restart/resume from granting authority to a removed
3586
+ * checkout.
3587
+ */
3588
+ function isStoragePathBlocked(sql, candidate, platform = process.platform, ignoredRelocationId) {
3589
+ return storagePathBlocker(sql, candidate, platform, ignoredRelocationId).pipe(Effect.map((blocker) => blocker !== null));
3590
+ }
3591
+ /** {@link isStoragePathBlocked}, with the reason, so admission can tell a retryable move apart. */
3592
+ function storagePathBlocker(sql, candidate, platform = process.platform, ignoredRelocationId) {
3593
+ return Effect.gen(function* () {
3594
+ if (yield* isProjectRelocationBlocked(sql, candidate, platform)) return "project-relocation";
3595
+ return (yield* isCheckoutPathBlocked(sql, candidate, platform, ignoredRelocationId)) ? "checkout" : null;
3596
+ });
3597
+ }
3598
+ function isCheckoutPathBlocked(sql, candidate, platform, ignoredRelocationId) {
3538
3599
  const ancestors = [];
3539
3600
  let current = path.resolve(candidate);
3540
3601
  for (;;) {
@@ -3545,11 +3606,42 @@ function isStoragePathBlocked(sql, candidate, platform = process.platform) {
3545
3606
  }
3546
3607
  const matching = platform === "darwin" || platform === "win32" ? sql`path COLLATE NOCASE IN ${sql.in(ancestors)}` : sql.in("path", ancestors);
3547
3608
  return Effect.gen(function* () {
3609
+ if (yield* isWorktreeRelocationBlocked(sql, candidate, platform, ignoredRelocationId)) return true;
3548
3610
  if ((yield* sql`SELECT path FROM storage_owned_entries WHERE state IN ('removing', 'removed') AND ${matching} LIMIT 1`).length) return true;
3549
3611
  const pending = yield* sql`SELECT path, identity_json FROM storage_owned_entries WHERE state = 'removing' LIMIT 257`;
3550
3612
  return pending.length > 256 || pending.some((row) => removingPaths(row).some((root) => overlaps(root, path.resolve(candidate), platform)));
3551
3613
  });
3552
3614
  }
3615
+ /** Active moves fence both paths; completed moves permanently fence the old path. */
3616
+ function isWorktreeRelocationBlocked(sql, candidate, platform = process.platform, ignoredRelocationId) {
3617
+ return Effect.gen(function* () {
3618
+ if (!(yield* sql`SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'managed_worktree_relocations'`).length) return false;
3619
+ const rows = yield* sql`
3620
+ SELECT source_path, destination_path, state FROM managed_worktree_relocations
3621
+ WHERE state IN ('moving', 'moved', 'attention', 'complete')
3622
+ AND worktree_id != ${ignoredRelocationId ?? ""}`;
3623
+ const resolved = path.resolve(candidate);
3624
+ return rows.some((row) => row.state === "complete" ? contains(row.source_path, resolved, platform) : overlaps(row.source_path, resolved, platform) || overlaps(row.destination_path, resolved, platform));
3625
+ });
3626
+ }
3627
+ /**
3628
+ * An unsettled chat promotion (`project_relocations` row `pending` or `moved`, see
3629
+ * `project/chatPromotion.ts`) fences everything at or below both of its paths, so no turn, provider
3630
+ * session or terminal starts in a folder that is moving. Promotion writes the row before it stops
3631
+ * sessions and closes terminals. Unlike a checkout move, ancestors stay usable: a project that
3632
+ * merely contains the chats folder is unrelated, and a write into a moving copy fails its
3633
+ * verification. Settled moves lift the fence; the project then points at its new root.
3634
+ */
3635
+ function isProjectRelocationBlocked(sql, candidate, platform = process.platform) {
3636
+ return Effect.gen(function* () {
3637
+ if (!(yield* sql`SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'project_relocations'`).length) return false;
3638
+ const rows = yield* sql`
3639
+ SELECT source_path, destination_path FROM project_relocations
3640
+ WHERE state IN ('pending', 'moved')`;
3641
+ const resolved = path.resolve(candidate);
3642
+ return rows.some((row) => contains(row.source_path, resolved, platform) || contains(row.destination_path, resolved, platform));
3643
+ });
3644
+ }
3553
3645
  //#endregion
3554
3646
  //#region src/atomicWrite.ts
3555
3647
  const writeFileStringAtomically = (input) => Effect.scoped(Effect.gen(function* () {
@@ -3660,7 +3752,11 @@ function expandHomePath(value) {
3660
3752
  }
3661
3753
  //#endregion
3662
3754
  //#region src/project/worktreeRoot.ts
3663
- var WorktreeRootError = class extends Schema.TaggedError()("WorktreeRootError", { detail: Schema.String }) {
3755
+ var WorktreeRootError = class extends Schema.TaggedError()("WorktreeRootError", {
3756
+ detail: Schema.String,
3757
+ /** `restricted`: the workspace access policy rejected it; `unusable`: the path itself is. */
3758
+ reason: Schema.optional(Schema.Literals(["unusable", "restricted"]))
3759
+ }) {
3664
3760
  get message() {
3665
3761
  return this.detail;
3666
3762
  }
@@ -3690,6 +3786,8 @@ async function resolveWorktreePath(candidate) {
3690
3786
  ancestor = parent;
3691
3787
  }
3692
3788
  }
3789
+ /** The canonical nearest existing ancestor; probes that need a real cwd run there. */
3790
+ const resolveExistingAncestor = async (candidate) => (await resolveWorktreePath(candidate)).existingAncestor;
3693
3791
  /** One identity for existing and missing worktree paths; no writable-access requirement.
3694
3792
  * Shared by destination locks, journal lookup and Git-registration comparisons.
3695
3793
  */
@@ -3700,23 +3798,37 @@ async function canonicalizeWorktreeDirectory(candidate) {
3700
3798
  await access(resolved.existingAncestor, constants.W_OK | constants.X_OK);
3701
3799
  return resolved.canonicalPath;
3702
3800
  }
3703
- const validateWorktreeRoot = (value, policy) => Effect.gen(function* () {
3801
+ /**
3802
+ * Validate a node-local root setting (worktree root, chats folder). `label` names the setting in
3803
+ * user-facing errors.
3804
+ */
3805
+ const validateWorktreeRoot = (value, policy, label = "Worktree root") => Effect.gen(function* () {
3704
3806
  const trimmed = value.trim();
3705
3807
  const expanded = expandHomePath(trimmed);
3706
- if (!trimmed || /[\x00-\x1f\x7f]/.test(trimmed) || !path.isAbsolute(expanded) || process.platform === "win32" && !/^(?:[A-Za-z]:[\\/]|\\\\[^\\]+\\[^\\]+)/.test(expanded)) return yield* new WorktreeRootError({ detail: "Worktree root must be an absolute directory on this node or start with ~/." });
3707
- const operation = "worktree root";
3808
+ if (!trimmed || /[\x00-\x1f\x7f]/.test(trimmed) || !path.isAbsolute(expanded) || process.platform === "win32" && !/^(?:[A-Za-z]:[\\/]|\\\\[^\\]+\\[^\\]+)/.test(expanded)) return yield* new WorktreeRootError({
3809
+ detail: `${label} must be an absolute directory on this node or start with ~/.`,
3810
+ reason: "unusable"
3811
+ });
3812
+ const operation = label.toLowerCase();
3813
+ const restricted = (cause) => new WorktreeRootError({
3814
+ detail: cause.message,
3815
+ reason: "restricted"
3816
+ });
3708
3817
  const authorized = yield* policy.assertPath({
3709
3818
  path: path.normalize(expanded),
3710
3819
  operation
3711
- }).pipe(Effect.mapError((cause) => new WorktreeRootError({ detail: cause.message })));
3820
+ }).pipe(Effect.mapError(restricted));
3712
3821
  const canonical = yield* Effect.tryPromise({
3713
3822
  try: () => canonicalizeWorktreeDirectory(authorized),
3714
- catch: () => new WorktreeRootError({ detail: "Worktree root must resolve to a writable directory (or have a writable existing parent), without broken symlinks." })
3823
+ catch: () => new WorktreeRootError({
3824
+ detail: `${label} must resolve to a writable directory (or have a writable existing parent), without broken symlinks.`,
3825
+ reason: "unusable"
3826
+ })
3715
3827
  });
3716
3828
  return yield* policy.assertPath({
3717
3829
  path: canonical,
3718
3830
  operation
3719
- }).pipe(Effect.mapError((cause) => new WorktreeRootError({ detail: cause.message })));
3831
+ }).pipe(Effect.mapError(restricted));
3720
3832
  });
3721
3833
  /** Storage selection only: this never grants access to the selected directory's contents. */
3722
3834
  const selectConfiguredWorktreeRoot = (input) => (input.projectId && Object.hasOwn(input.settings.projectWorktreeRoots, input.projectId) ? input.settings.projectWorktreeRoots[input.projectId] : null) || input.settings.worktreeRoot || resolveManagedWorktreesRoot(input.config);
@@ -4086,12 +4198,13 @@ const makeServerSettings = Effect.gen(function* () {
4086
4198
  updateSettings: (patch) => writeSemaphore.withPermits(1)(Effect.gen(function* () {
4087
4199
  const current = yield* getSettingsFromCache;
4088
4200
  const normalizedPatch = { ...patch };
4089
- const validateRoot = (root) => validateWorktreeRoot(root, worktreeAccessPolicy).pipe(Effect.mapError((cause) => new ServerSettingsError({
4201
+ const validateRoot = (root, label) => validateWorktreeRoot(root, worktreeAccessPolicy, label).pipe(Effect.mapError((cause) => new ServerSettingsError({
4090
4202
  settingsPath,
4091
4203
  detail: cause.message,
4092
4204
  cause
4093
4205
  })));
4094
4206
  if (patch.worktreeRoot) normalizedPatch.worktreeRoot = yield* validateRoot(patch.worktreeRoot);
4207
+ if (patch.chatsRoot) normalizedPatch.chatsRoot = yield* validateRoot(patch.chatsRoot, "Chats folder");
4095
4208
  if (patch.projectWorktreeRoots !== void 0) {
4096
4209
  const roots = [];
4097
4210
  for (const [id, root] of Object.entries(patch.projectWorktreeRoots)) roots.push([id, root ? yield* validateRoot(root) : null]);
@@ -4414,4 +4527,4 @@ const providerTurnMetricAttributes = (input) => {
4414
4527
  });
4415
4528
  };
4416
4529
  //#endregion
4417
- export { makeWorkspaceAccessPolicy as $, getProviderOptionBooleanSelectionValue as $t, runtimeQueueBlockedDuration as A, resolveHubConnectorConfig as At, startupCommandGateQueueHighWater as B, formatNodePublicKeyFingerprint as Bt, providerStartupQueueHighWater as C, acquireStorageSettingsLease as Ct, providerTurnsTotal as D, ServerConfig as Dt, providerTurnMetricAttributes as E, RuntimeMode as Et, runtimeQueueHighWater as F, encodeNativeNodeClaimTranscript as Ft, LocalDiagnosticsMetrics as G, rfc8949EncodeOptions as Gt, terminalRestartsTotal as H, Tokeniser as Ht, runtimeQueueOverflowsTotal as I, encodeNodeAuthenticationTranscript as It, outcomeFromExit as J, applyClaudePromptEffortPrefix as Jt, LocalDiagnosticsMetricsLive as K, Type as Kt, runtimeQueueRecoveriesTotal as L, encodeNodeKeyRotationTranscript as Lt, runtimeQueueDepth as M, resolveNodeE2eePolicyConfig as Mt, runtimeQueueDequeuesTotal as N, resolveStaticDir as Nt, rpcRequestDuration as O, deriveServerPaths as Ot, runtimeQueueEnqueuesTotal as P, canonicalizeHubOrigin as Pt, WorkspaceAccessPolicyLive as Q, getModelSelectionStringOptionValue as Qt, startupCommandGateEnqueuesTotal as R, equalNodeIdentityBytes as Rt, providerStartupQueueDepth as S, mintStorageCleanupClaim as St, providerTurnDuration as T, DEFAULT_PORT as Tt, terminalSessionsTotal as U, decode as Ut, startupCommandGateQueueWaitDuration as V, normalizeHubNodeName as Vt, withMetrics as W, encode as Wt, ServerSettingsService as X, getModelDisplayLabel as Xt, ServerSettingsLive as Y, createModelCapabilities as Yt, redactServerSettingsForClient as Z, getModelSelectionBooleanOptionValue as Zt, providerRuntimeEventsTotal as _, assertCleanWorktree as _t, contextHandoffsTotal as a, resolvePromptInjectedEffort as an, expandHomePath as at, providerStaleStopTimeoutsTotal as b, removeQuarantinedTemporaryDirectory as bt, increment as c, writeFileStringAtomically as ct, orchestrationCommandAckDuration as d, canonicalStoragePath as dt, getProviderOptionCurrentValue 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, normalizeModelSlug 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, getProviderOptionStringSelectionValue as nn, resolveConfiguredWorktreeRoot as nt, gitCommandDuration as o, ServerSecretStoreLive as ot, orchestrationCommandsTotal as p, isStoragePathBlocked as pt, compactTraceAttributes as q, parsePersistedServerObservabilitySettings as qt, contextHandoffDispatchDuration as r, modelSelectionRequiresContextHandoff as rn, selectConfiguredWorktreeRoot as rt, gitCommandsTotal as s, ServerSecretStore as st, contextHandoffContextBytesTotal as t, getProviderOptionDescriptors 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, fingerprintNodePublicKey as zt };
4530
+ export { makeWorkspaceAccessPolicy as $, resolvePromptInjectedEffort as $t, runtimeQueueBlockedDuration as A, DEFAULT_HUB_CONNECTOR_CONFIG as At, startupCommandGateQueueHighWater as B, resolveStaticDir as Bt, providerStartupQueueHighWater as C, captureWorktreeIdentity as Ct, providerTurnsTotal as D, mintStorageCleanupClaim as Dt, providerTurnMetricAttributes as E, removeVerifiedWorktree as Et, runtimeQueueHighWater as F, ensureServerDirectories as Ft, LocalDiagnosticsMetrics as G, getModelSelectionBooleanOptionValue as Gt, terminalRestartsTotal as H, applyClaudePromptEffortPrefix as Ht, runtimeQueueOverflowsTotal as I, resolveHubConnectorConfig as It, outcomeFromExit as J, getProviderOptionCurrentValue as Jt, LocalDiagnosticsMetricsLive as K, getModelSelectionStringOptionValue as Kt, runtimeQueueRecoveriesTotal as L, resolveManagedChatsRoot as Lt, runtimeQueueDepth as M, RuntimeMode as Mt, runtimeQueueDequeuesTotal as N, ServerConfig as Nt, rpcRequestDuration as O, acquireStorageSettingsLease as Ot, runtimeQueueEnqueuesTotal as P, deriveServerPaths as Pt, WorkspaceAccessPolicyLive as Q, normalizeModelSlug as Qt, startupCommandGateEnqueuesTotal as R, resolveManagedWorktreesRoot as Rt, providerStartupQueueDepth as S, assertCleanWorktree as St, providerTurnDuration as T, removeQuarantinedTemporaryDirectory as Tt, terminalSessionsTotal as U, createModelCapabilities as Ut, startupCommandGateQueueWaitDuration as V, parsePersistedServerObservabilitySettings as Vt, withMetrics as W, getModelDisplayLabel as Wt, ServerSettingsService as X, getProviderOptionStringSelectionValue as Xt, ServerSettingsLive as Y, getProviderOptionDescriptors as Yt, redactServerSettingsForClient as Z, modelSelectionRequiresContextHandoff as Zt, providerRuntimeEventsTotal as _, recordCreatedWorktree as _t, contextHandoffsTotal as a, equalNodeIdentityBytes as an, validateWorktreeRoot as at, providerStaleStopTimeoutsTotal as b, storagePathBlocker as bt, increment as c, normalizeHubNodeName as cn, ServerSecretStore as ct, orchestrationCommandAckDuration as d, encode as dn, acquireWorktreeCreationLease as dt, sameModelSelection as en, WorkspaceAccessPolicy as et, orchestrationCommandDuration as f, rfc8949EncodeOptions as fn, canonicalStoragePath as ft, providerMetricAttributes as g, noteStorageActivity as gt, providerEventLogRecordsDroppedTotal as h, isWorktreeRelocationBlocked as ht, contextHandoffPreparationDuration as i, encodeNodeKeyRotationTranscript as in, selectConfiguredWorktreeRoot as it, runtimeQueueCoalescedTotal as j, DEFAULT_PORT as jt, rpcRequestsTotal as k, hasStorageSettingsUpdateLease as kt, metricAttributes as l, Tokeniser as ln, writeFileStringAtomically as lt, orchestrationEventsProcessedTotal as m, isStoragePathBlocked as mt, contextHandoffContextEntriesTotal as n, encodeNativeNodeClaimTranscript as nn, resolveConfiguredWorktreeRoot as nt, gitCommandDuration as o, fingerprintNodePublicKey as on, expandHomePath as ot, orchestrationCommandsTotal as p, Type as pn, hasWorktreeCreationLease as pt, compactTraceAttributes as q, getProviderOptionBooleanSelectionValue as qt, contextHandoffDispatchDuration as r, encodeNodeAuthenticationTranscript as rn, resolveExistingAncestor as rt, gitCommandsTotal as s, formatNodePublicKeyFingerprint as sn, ServerSecretStoreLive as st, contextHandoffContextBytesTotal as t, canonicalizeHubOrigin as tn, canonicalizeWorktreePath as tt, metricNames as u, decode as un, acquireStoragePathUseLease as ut, providerRuntimeStaleEventsTotal as v, storageActivityVersion as vt, providerStartupQueueWaitDuration as w, measureDirectory as wt, providerStartupAdmissionTotal as x, assertCanonicalPath as xt, providerSessionsTotal as y, storageLifecycleLock as yt, startupCommandGateQueueDepth as z, resolveNodeE2eePolicyConfig as zt };