@yuriai/web 0.3.3 → 0.3.5

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 (276) hide show
  1. package/dist/assets/AgentAvatar-CNOu_vy0.js +1 -0
  2. package/dist/assets/AgentSelector-K5JSbXv3.js +1 -0
  3. package/dist/assets/ArchivedSessionsDialog-CU9RXl8K.js +1 -0
  4. package/dist/assets/AssistantConversationSurface-u3ndSmZP.js +3 -0
  5. package/dist/assets/AssistantSessionCard-MYBAni6A.js +2 -0
  6. package/dist/assets/AssistantUnreadBadge-opyLZlZd.js +1 -0
  7. package/dist/assets/AssistantView-CDPTtrUZ.js +1 -0
  8. package/dist/assets/AssistantWorkingAvatar-Vghb8xlt.js +1 -0
  9. package/dist/assets/AssistantsSettingsPage-Dt4OP3J-.js +1 -0
  10. package/dist/assets/BinaryFileFallback-CJqnlBzh.js +1 -0
  11. package/dist/assets/BtwPanel-DnMW6R43.js +6 -0
  12. package/dist/assets/BusyDots-FXSlMe2F.js +4 -0
  13. package/dist/assets/ChatContainer-Dg9uDBjk.js +65 -0
  14. package/dist/assets/ChatView-AFUNEBdD.js +3 -0
  15. package/dist/assets/{DiagramView-CaefmjA4.js → DiagramView-j7aFp44v.js} +1 -1
  16. package/dist/assets/{DiffView-BaqthIvq.js → DiffView-DZ_gKyTO.js} +2 -2
  17. package/dist/assets/DiffViewToggle-DkxhEUhV.js +1 -0
  18. package/dist/assets/ErrorBoundary-CCH4LiRY.js +1 -0
  19. package/dist/assets/FadeInOnReveal-DO9PZrJL.js +1 -0
  20. package/dist/assets/{GuiPluginMount-Btp3mJT2.js → GuiPluginMount-BCqt2pmM.js} +1 -1
  21. package/dist/assets/GuiPluginPage-BSjWEmIu.js +1 -0
  22. package/dist/assets/GuiPluginSurface-B8QjacMd.js +1 -0
  23. package/dist/assets/GuiPluginTitlebarItems-DfHugxsx.js +1 -0
  24. package/dist/assets/{GuiPluginWindow-BkAFJyFd.js → GuiPluginWindow-CDycMqzT.js} +1 -1
  25. package/dist/assets/Icon-B-w2YKpn.js +1 -0
  26. package/dist/assets/ImageLoadingPlaceholder-DsgRtfYG.js +1 -0
  27. package/dist/assets/{LoadingImage-Df22Rkor.js → LoadingImage-B3IL7hnv.js} +1 -1
  28. package/dist/assets/MarkdownRenderer-CsEylQVj.js +2 -0
  29. package/dist/assets/{MarkdownRendererImpl-BZc_jUrV.js → MarkdownRendererImpl-CPgpkd9b.js} +1 -1
  30. package/dist/assets/MarkstreamRendererImpl-BzK1BO80.js +3 -0
  31. package/dist/assets/{MobileAssistantSettingsPage-BBIiFN2g.js → MobileAssistantSettingsPage-DVpE3b24.js} +1 -1
  32. package/dist/assets/MobileAssistantTab-BbccE67x.js +1 -0
  33. package/dist/assets/{MobileBtwPage-DVZm5hrZ.js → MobileBtwPage-BRN1gAmR.js} +1 -1
  34. package/dist/assets/{MobileChangesSurface-CiqsGZsg.js → MobileChangesSurface-BwmSTxeh.js} +2 -2
  35. package/dist/assets/MobileChatScreen-Bf42GrQ8.js +1 -0
  36. package/dist/assets/MobileDetailNavigation-DKWnQoSh.js +1 -0
  37. package/dist/assets/MobileFilesSurface-qkfC06Oh.js +2 -0
  38. package/dist/assets/MobileHtmlNetworkBoundary-BKSYPR9N.js +2 -0
  39. package/dist/assets/MobileOverlayPanel-DcRWQlmf.js +1 -0
  40. package/dist/assets/MobileResizableSheet-CF3Pbot4.js +1 -0
  41. package/dist/assets/{MobileSettingsTab-MmDnxG47.js → MobileSettingsTab-of6zpTsr.js} +1 -1
  42. package/dist/assets/{MobileShareBridge-DAlGSXoj.js → MobileShareBridge-CRq9F1rn.js} +1 -1
  43. package/dist/assets/MobileSurface-DGNomvlu.js +1 -0
  44. package/dist/assets/MobileTabPageHeader-0aJFe3_x.js +1 -0
  45. package/dist/assets/ModelLogo-D27dq-si.js +1 -0
  46. package/dist/assets/ModelSelector-Dg__8QLh.js +1 -0
  47. package/dist/assets/MultiRunWindow-COqSg1Nk.js +1 -0
  48. package/dist/assets/OnboardingScreen-DUNyDwc6.js +1 -0
  49. package/dist/assets/OverlayScrollbar-DS6XJ1HA.js +1 -0
  50. package/dist/assets/{PierreDiffViewer-B1e1H6br.js → PierreDiffViewer-BHwj_6j8.js} +3 -3
  51. package/dist/assets/ProviderLogo-Cm9RNV_U.js +1 -0
  52. package/dist/assets/{RemoteAssistantSessionCard-BgL7oxAK.js → RemoteAssistantSessionCard-DAjHRUrC.js} +1 -1
  53. package/dist/assets/RemoteDesktopPanel-Bays6pHh.js +1 -0
  54. package/dist/assets/ScheduledTasksDialog-DnwBC7cj.js +3 -0
  55. package/dist/assets/ScrollableOverlay-CkX-buJm.js +1 -0
  56. package/dist/assets/SettingsGroup-kZ_faXwL.js +1 -0
  57. package/dist/assets/{SettingsView-CLE6ra3s.js → SettingsView-C62JngPE.js} +13 -13
  58. package/dist/assets/SettingsWindow-Cm8apHAR.js +1 -0
  59. package/dist/assets/SetupTourDialog-W_UeWH-i.js +1 -0
  60. package/dist/assets/{SyncActions-CrOoREWF.js → SyncActions-Blnq08ks.js} +1 -1
  61. package/dist/assets/TerminalView-CMugifkh.js +8 -0
  62. package/dist/assets/TextSelectionMenu-B2fIBlD3.js +11 -0
  63. package/dist/assets/{ToolOutputDialog-DqCCsC-N.js → ToolOutputDialog-DdSUE2kP.js} +1 -1
  64. package/dist/assets/{YuriLogo-Cp6vWDWp.js → YuriLogo-Ceon25sC.js} +1 -1
  65. package/dist/assets/{YuriWordmark-CLGHwobA.js → YuriWordmark-CW53XKgV.js} +1 -1
  66. package/dist/assets/{assistant-attachment-cache-bRIIESGe.js → assistant-attachment-cache-eNT2QtmP.js} +1 -1
  67. package/dist/assets/assistantMessagePreview-C7YAFen1.js +1 -0
  68. package/dist/assets/assistantQueries-DxvTFlpL.js +1 -0
  69. package/dist/assets/{auto-read-context-DVGIDEr6.js → auto-read-context-Ce0o43YI.js} +1 -1
  70. package/dist/assets/{capgoAdapter-94K243Zv.js → capgoAdapter-DQwUA-Nt.js} +1 -1
  71. package/dist/assets/card-D44sTpdY.js +1 -0
  72. package/dist/assets/chatUpwardIntent-CnS7WWRL.js +1 -0
  73. package/dist/assets/checkbox-DaKe0Tlq.js +1 -0
  74. package/dist/assets/{client-B_907PBv.js → client-ITylDDCS.js} +1 -1
  75. package/dist/assets/collapsible-CL3SPnOf.js +1 -0
  76. package/dist/assets/{connection-hint-B-kOWome.js → connection-hint-SMNZFDAe.js} +1 -1
  77. package/dist/assets/context-menu-DZunhC8o.js +1 -0
  78. package/dist/assets/diagram-DFXqN638.js +1 -0
  79. package/dist/assets/dialog-CmjXOKMz.js +1 -0
  80. package/dist/assets/dropdown-menu-BT_66BFT.js +1 -0
  81. package/dist/assets/{fileMentionTouchSelection-BQEUty_A.js → fileMentionTouchSelection-B_62hIQI.js} +1 -1
  82. package/dist/assets/{gitApi-BWsBS_2N.js → gitApi-CBfYFgtd.js} +1 -1
  83. package/dist/assets/{gitApiHttp-Dd-FwgCq.js → gitApiHttp-Bswf6gnl.js} +1 -1
  84. package/dist/assets/githubAuthQueries-C5RxUNL2.js +1 -0
  85. package/dist/assets/historyImportQueries-CZsECryv.js +1 -0
  86. package/dist/assets/{host-ChBHl_Vl.js → host-C7jHgymK.js} +1 -1
  87. package/dist/assets/{i18n-DXc6czdR.js → i18n-Dojvs57M.js} +1 -1
  88. package/dist/assets/{icons-Bd-INsoy.js → icons-D_vRtitD.js} +1 -1
  89. package/dist/assets/{imageSource-BR4C9TuS.js → imageSource-Cq_p4gAe.js} +1 -1
  90. package/dist/assets/input-BllFKOjo.js +1 -0
  91. package/dist/assets/{input-store-BSJBQTMi.js → input-store-dLjM4aiu.js} +1 -1
  92. package/dist/assets/insertionBoundaries-Br0Bdl9R.js +1 -0
  93. package/dist/assets/kbd-CwkasrzN.js +1 -0
  94. package/dist/assets/main-B7wAfq9F.js +2 -0
  95. package/dist/assets/main-DVmi0I-y.js +169 -0
  96. package/dist/assets/{markdownHeightCache-CHGGNhWI.js → markdownHeightCache-RX04MAqu.js} +1 -1
  97. package/dist/assets/mcpQueries-qRW-HQMx.js +1 -0
  98. package/dist/assets/miniChat-D7-JQ1hw.js +2 -0
  99. package/dist/assets/mobile-BFQBDlo9.js +2 -0
  100. package/dist/assets/{mobileBackNavigation-DF_uhF-i.js → mobileBackNavigation-DsDUTnFY.js} +1 -1
  101. package/dist/assets/mobileConnections-PVy2SsQ_.js +2 -0
  102. package/dist/assets/multirun-C2RRF2Q3.js +3 -0
  103. package/dist/assets/{native-config-DSpTDz3F.js → native-config-Czc142JT.js} +1 -1
  104. package/dist/assets/{nativeComposerCover-DXFy97OQ.js → nativeComposerCover-DzEGSyOO.js} +1 -1
  105. package/dist/assets/{navigation-jU0HUH9s.js → navigation-C1v9hIAT.js} +2 -2
  106. package/dist/assets/openRemoteProjectSession-C5z2Juv7.js +1 -0
  107. package/dist/assets/pluginPresentation-p_0sXPMT.js +2 -0
  108. package/dist/assets/{project-preview-BCtFY4Rg.js → project-preview-BcLPKzwg.js} +1 -1
  109. package/dist/assets/{prompt-attachment-upload-B5DHrw6U.js → prompt-attachment-upload-BGppTOgV.js} +1 -1
  110. package/dist/assets/pwa-Br2HZksc.js +2 -0
  111. package/dist/assets/queue-abort-optimistic-DciJN9X1.js +1 -0
  112. package/dist/assets/{quota-CqWNkFzw.js → quota-2PwXAoIg.js} +1 -1
  113. package/dist/assets/{reference-history-DBxnA_fF.js → reference-history-BwtzPAmA.js} +1 -1
  114. package/dist/assets/{remote-input-store-C6UIEZxp.js → remote-input-store-DdjKfpxS.js} +1 -1
  115. package/dist/assets/remoteProjectQueries-BXrXdLjN.js +1 -0
  116. package/dist/assets/{remoteSessionReference-Cug8RfIG.js → remoteSessionReference-XfJOxItc.js} +1 -1
  117. package/dist/assets/renderElectronMiniChatApp-BekZAu-s.js +2 -0
  118. package/dist/assets/renderMobileApp-C5U2cyeq.js +17 -0
  119. package/dist/assets/{runtime-file-download-BWeoSXRb.js → runtime-file-download-1s2Al1t3.js} +1 -1
  120. package/dist/assets/runtime-file-resource-C5kmYlLv.js +6 -0
  121. package/dist/assets/{runtimeConfig-zzeYHX6k.js → runtimeConfig-DzYIc49M.js} +1 -1
  122. package/dist/assets/runtimeEndpointReset-BKLVdNhJ.js +4 -0
  123. package/dist/assets/select-BOtGs1FV.js +1 -0
  124. package/dist/assets/{sessionLookup-4zOaVAuF.js → sessionLookup-BTQ_AtWh.js} +1 -1
  125. package/dist/assets/sessionOwnership-BPfk1qCS.js +2 -0
  126. package/dist/assets/shortcuts-Cu4ioDvH.js +1 -0
  127. package/dist/assets/sortable-tabs-strip-DACGW9sB.js +1 -0
  128. package/dist/assets/speechSettingsQueries-BU-4Axb5.js +1 -0
  129. package/dist/assets/{src-QTj33Z0x.css → src-Dj147H4m.css} +1 -1
  130. package/dist/assets/{store-C1ifDY0C.js → store-DRUKTpV5.js} +1 -1
  131. package/dist/assets/switch-DaUn0G3u.js +1 -0
  132. package/dist/assets/{terminalApi-DXvEquBF.js → terminalApi-ClNhXBA8.js} +1 -1
  133. package/dist/assets/textarea-IhQHekYx.js +1 -0
  134. package/dist/assets/{timeFormat-dCsf2MQv.js → timeFormat-BsuUDWLs.js} +1 -1
  135. package/dist/assets/tooltip-Dw3DApa-.js +1 -0
  136. package/dist/assets/truncated-path-KHrfQ66P.js +1 -0
  137. package/dist/assets/{types-s_oc_LRs.js → types-BBBwzIOU.js} +1 -1
  138. package/dist/assets/ui-CHdferA1.js +13 -0
  139. package/dist/assets/{useAppFontEffects-nvkTSYHB.js → useAppFontEffects-Dw6o6XbA.js} +4 -4
  140. package/dist/assets/useDesktopWindowControlsLayout-DAkTdcAP.js +1 -0
  141. package/dist/assets/{useDictation-CZzAlsW0.js → useDictation-sdgDfATy.js} +1 -1
  142. package/dist/assets/{useEffectiveDirectory-BxolHzt4.js → useEffectiveDirectory-DZqC-2HE.js} +1 -1
  143. package/dist/assets/{useFontPreferences-BiRBKhti.js → useFontPreferences-Bb-bxdL8.js} +1 -1
  144. package/dist/assets/{useGitStore-B641o_o0.js → useGitStore-Bbmai549.js} +1 -1
  145. package/dist/assets/{useInlineCommentDraftStore-B2mkmAZd.js → useInlineCommentDraftStore-DrC99u6A.js} +1 -1
  146. package/dist/assets/useMcpConfigStore-ZsZxSrCt.js +1 -0
  147. package/dist/assets/useMobileSwipeActions-fUp7Bkbn.js +1 -0
  148. package/dist/assets/useMobileTranscriptSyncHint-B4izCfqe.js +10 -0
  149. package/dist/assets/useModelLists-B0qSYDby.js +1 -0
  150. package/dist/assets/useOpenCodeReadiness-B9d-wLZB.js +1 -0
  151. package/dist/assets/usePluginsStore-BLncdNj-.js +1 -0
  152. package/dist/assets/useProjectGitActions-CHMe1ku4.js +1 -0
  153. package/dist/assets/{useProjectGitStore-C1K6WpCe.js → useProjectGitStore-Lz9AV32V.js} +1 -1
  154. package/dist/assets/{useProjectRuntimeAPIs-BItoD9Bt.js → useProjectRuntimeAPIs-D51dVo-V.js} +1 -1
  155. package/dist/assets/useQuotaStore-mZs9LTwx.js +1 -0
  156. package/dist/assets/{useSessionBtwStore-BCHq3UOB.js → useSessionBtwStore-CYaTDkvT.js} +1 -1
  157. package/dist/assets/{useStreamingTextThrottle-DGAjmaMZ.js → useStreamingTextThrottle-ul6e3dUd.js} +1 -1
  158. package/dist/assets/worktreeManager-V6hoSVxH.js +1 -0
  159. package/dist/assets/{worktreeSourceBranchPreference-B5Fldnhm.js → worktreeSourceBranchPreference-MQFPkOZy.js} +1 -1
  160. package/dist/index.html +12 -13
  161. package/dist/mini-chat.html +12 -13
  162. package/dist/mobile.html +2 -2
  163. package/package.json +1 -1
  164. package/server/index.js +1 -0
  165. package/server/lib/gui-customization/DOCUMENTATION.md +22 -1
  166. package/server/lib/gui-customization/projects-client.mjs +14 -3
  167. package/server/lib/gui-customization/projects-lifecycle.js +89 -0
  168. package/server/lib/gui-customization/projects-lifecycle.test.js +199 -0
  169. package/server/lib/gui-customization/projects.js +19 -3
  170. package/server/lib/gui-customization/projects.test.js +6 -0
  171. package/server/lib/gui-customization/session-skill.js +2 -2
  172. package/server/lib/gui-customization/session-skill.test.js +6 -0
  173. package/server/lib/gui-customization/skill/SKILL.md +3 -1
  174. package/server/lib/gui-customization/skill/references/projects.md +30 -0
  175. package/server/lib/opencode/feature-routes-runtime.js +5 -0
  176. package/server/lib/opencode/feature-routes-runtime.test.js +6 -0
  177. package/dist/assets/AgentAvatar-CHCjMxCF.js +0 -1
  178. package/dist/assets/AgentSelector-DpOQ7dyw.js +0 -1
  179. package/dist/assets/ArchivedSessionsDialog-nqnWb-Vc.js +0 -1
  180. package/dist/assets/AssistantConversationSurface-CKXgty02.js +0 -3
  181. package/dist/assets/AssistantSessionCard-C2-2fJul.js +0 -2
  182. package/dist/assets/AssistantUnreadBadge-p9mkpbMC.js +0 -1
  183. package/dist/assets/AssistantView-BR8hsjOv.js +0 -1
  184. package/dist/assets/AssistantWorkingAvatar-CoxhuMvM.js +0 -1
  185. package/dist/assets/AssistantsSettingsPage-Bwid1xE0.js +0 -1
  186. package/dist/assets/BinaryFileFallback-Cb3uP7y1.js +0 -1
  187. package/dist/assets/BtwPanel-9VAdk_qa.js +0 -6
  188. package/dist/assets/BusyDots-DeDkh4Ke.js +0 -4
  189. package/dist/assets/ChatContainer-wP6o_O4K.js +0 -65
  190. package/dist/assets/ChatView-DU_2-cfD.js +0 -3
  191. package/dist/assets/DiffViewToggle-BwJ6MYB7.js +0 -1
  192. package/dist/assets/ErrorBoundary-_5B1xjgZ.js +0 -1
  193. package/dist/assets/FadeInOnReveal-BYHr1gqj.js +0 -1
  194. package/dist/assets/GuiPluginPage-DM_RLx6u.js +0 -1
  195. package/dist/assets/GuiPluginSurface-KiyqqEKU.js +0 -1
  196. package/dist/assets/GuiPluginTitlebarItems-DxFINwbr.js +0 -1
  197. package/dist/assets/Icon-DmykXZL1.js +0 -1
  198. package/dist/assets/ImageLoadingPlaceholder-DgM_EFHn.js +0 -1
  199. package/dist/assets/MarkdownRenderer-D7p9Iflj.js +0 -2
  200. package/dist/assets/MarkstreamRendererImpl-BUk_c3g1.js +0 -3
  201. package/dist/assets/MobileAssistantTab-CMIQansR.js +0 -1
  202. package/dist/assets/MobileChatScreen-DDenVTX8.js +0 -1
  203. package/dist/assets/MobileDetailNavigation-ldTzGo19.js +0 -1
  204. package/dist/assets/MobileFilesSurface-DIVH9aPV.js +0 -2
  205. package/dist/assets/MobileHtmlNetworkBoundary-TBxrF4jJ.js +0 -2
  206. package/dist/assets/MobileOverlayPanel-C36VWWmN.js +0 -1
  207. package/dist/assets/MobileResizableSheet-CqphcaKq.js +0 -1
  208. package/dist/assets/MobileSurface-cmaGf3hZ.js +0 -1
  209. package/dist/assets/MobileTabPageHeader-D6P4K98S.js +0 -1
  210. package/dist/assets/ModelLogo-BkbD514M.js +0 -1
  211. package/dist/assets/ModelSelector-HJmXcB3j.js +0 -1
  212. package/dist/assets/MultiRunWindow-BmxVnblA.js +0 -1
  213. package/dist/assets/OnboardingScreen-DnEtIaxG.js +0 -1
  214. package/dist/assets/OverlayScrollbar-D6vmoMkQ.js +0 -1
  215. package/dist/assets/ProviderLogo-DA98yu7M.js +0 -1
  216. package/dist/assets/RemoteDesktopPanel-DBrEQwpr.js +0 -1
  217. package/dist/assets/ScheduledTasksDialog-BVh0yaZR.js +0 -3
  218. package/dist/assets/ScrollableOverlay-stxT7gLf.js +0 -1
  219. package/dist/assets/SettingsGroup-CvaPYznp.js +0 -1
  220. package/dist/assets/SettingsWindow-DpzeOekS.js +0 -1
  221. package/dist/assets/SetupTourDialog-CY_CU5qU.js +0 -1
  222. package/dist/assets/TerminalView-mO5f0Axl.js +0 -8
  223. package/dist/assets/TextSelectionMenu-VsKriqtT.js +0 -11
  224. package/dist/assets/assistantMessagePreview-DLBvPQtq.js +0 -1
  225. package/dist/assets/assistantQueries-NdPqu6rx.js +0 -1
  226. package/dist/assets/card-DmysoUAV.js +0 -1
  227. package/dist/assets/chatUpwardIntent-tvLWGs9Q.js +0 -1
  228. package/dist/assets/checkbox-BMN5hAVm.js +0 -1
  229. package/dist/assets/collapsible-Z0IjDAMO.js +0 -1
  230. package/dist/assets/context-menu-CKlB6wxo.js +0 -1
  231. package/dist/assets/diagram-CzY6n_4N.js +0 -1
  232. package/dist/assets/dialog-BeFBA6ja.js +0 -1
  233. package/dist/assets/dropdown-menu-BblI9sN2.js +0 -1
  234. package/dist/assets/githubAuthQueries-DqregESf.js +0 -1
  235. package/dist/assets/historyImportQueries-D00KjUT2.js +0 -1
  236. package/dist/assets/input-Cf16qJ6g.js +0 -1
  237. package/dist/assets/insertionBoundaries-BSDUOMHN.js +0 -1
  238. package/dist/assets/kbd-CamdaxHJ.js +0 -1
  239. package/dist/assets/main-CHO9s_kb.js +0 -2
  240. package/dist/assets/main-DAbyAg5_.js +0 -169
  241. package/dist/assets/mcpQueries-1WNtiFYh.js +0 -1
  242. package/dist/assets/miniChat-BZMkNMht.js +0 -2
  243. package/dist/assets/mobile-C9XDDOHq.js +0 -2
  244. package/dist/assets/mobileConnections-DjT1L-_m.js +0 -2
  245. package/dist/assets/multirun-D34EMeEj.js +0 -3
  246. package/dist/assets/openRemoteProjectSession-Bm_nafYw.js +0 -1
  247. package/dist/assets/pluginPresentation-DexqrdQ0.js +0 -2
  248. package/dist/assets/pwa-BaWpUiOR.js +0 -2
  249. package/dist/assets/queue-abort-optimistic-UwpgXn4g.js +0 -1
  250. package/dist/assets/remoteProjectQueries-C8382jM8.js +0 -1
  251. package/dist/assets/renderElectronMiniChatApp-CqrlQAsJ.js +0 -2
  252. package/dist/assets/renderMobileApp-CwcwGOox.js +0 -17
  253. package/dist/assets/runtime-file-resource-Bc_ss-sW.js +0 -2
  254. package/dist/assets/runtimeEndpointReset-DUD-TCLY.js +0 -4
  255. package/dist/assets/select-vZCgcnYG.js +0 -1
  256. package/dist/assets/session-startup-barrier-DT-hIBRf.js +0 -1
  257. package/dist/assets/sessionOwnership-CEkPFbS4.js +0 -2
  258. package/dist/assets/shortcuts-WkN3Gh8v.js +0 -1
  259. package/dist/assets/sortable-tabs-strip-DmtfYPz0.js +0 -1
  260. package/dist/assets/speechSettingsQueries-DQnPLEf3.js +0 -1
  261. package/dist/assets/switch-CNmsFYfY.js +0 -1
  262. package/dist/assets/textarea-ZiXxEOHK.js +0 -1
  263. package/dist/assets/tooltip-CpTbxEOE.js +0 -1
  264. package/dist/assets/truncated-path-CcmWjgCQ.js +0 -1
  265. package/dist/assets/ui-DrAJTWV6.js +0 -13
  266. package/dist/assets/useDesktopWindowControlsLayout-i6qqpMbd.js +0 -1
  267. package/dist/assets/useMcpConfigStore-BUSvv0Bl.js +0 -1
  268. package/dist/assets/useMobileSwipeActions-XoxrtaUo.js +0 -1
  269. package/dist/assets/useMobileTranscriptSyncHint-86i3xO8J.js +0 -10
  270. package/dist/assets/useModelLists-Ca085-di.js +0 -1
  271. package/dist/assets/useOpenCodeReadiness-CsNcdsCJ.js +0 -1
  272. package/dist/assets/usePluginsStore-ZHQOW-R5.js +0 -1
  273. package/dist/assets/useProjectGitActions-1QRsD7Rb.js +0 -1
  274. package/dist/assets/useQuotaStore-CSn2pk3T.js +0 -1
  275. package/dist/assets/worktreeManager-QmahFqHc.js +0 -1
  276. package/dist/assets/yuriEvents-BFrD5fMU.js +0 -5
@@ -29,7 +29,7 @@ their immutable staged references until a new session is admitted. Contacts use
29
29
  their own granted `yuri.projects` tools, not this session binding.
30
30
 
31
31
  `projects.js` owns `POST /api/yuri/session-skills/projects` (`describe`, `list`,
32
- `add`, `remote-hosts`, `add-remote`, `remote-projects`, `sessions`, `read-session`, `create-session`, `prompt-session`). `projects-remote.js` uses the injected `remoteHostGateway` and its immutable task leases; discovery returns authenticated `{hubId,hostId,instanceId}` targets, and explicit targets never fall back to local. `remote-hosts` includes authorized machines with no associated project, reports per-machine failures and releases each probe. `add-remote` uses `gateway.registerProject`, shared with the UI: the target validates/canonicalizes and registers the directory before the Hub saves a deduplicated reference and broadcasts project-order invalidation. A Hub write failure leaves the remote project intact; retrying the same target/path completes association. Paths are never resolved on the Hub filesystem. Lease cleanup runs on every outcome. Remote SDK requests preserve generated request data through the lease; bounded message reads use the existing Host turn-page route. No remote bodies are persisted on Hub. Session creation/prompt require stable caller IDs for ambiguous-result inspection, not automatic replay. This capability neither uses nor grants the desktop SSH helper. The global gate and route require the existing loopback service credential,
32
+ `add`, `task-sessions`, `session-state`, `settle-session`, `unsettle-session`, `archive-session`, `unarchive-session`, `remote-hosts`, `add-remote`, `remote-projects`, `sessions`, `read-session`, `create-session`, `prompt-session`). `projects-remote.js` uses the injected `remoteHostGateway` and its immutable task leases; discovery returns authenticated `{hubId,hostId,instanceId}` targets, and explicit targets never fall back to local. `remote-hosts` includes authorized machines with no associated project, reports per-machine failures and releases each probe. `add-remote` uses `gateway.registerProject`, shared with the UI: the target validates/canonicalizes and registers the directory before the Hub saves a deduplicated reference and broadcasts project-order invalidation. A Hub write failure leaves the remote project intact; retrying the same target/path completes association. Paths are never resolved on the Hub filesystem. Lease cleanup runs on every outcome. Remote SDK requests preserve generated request data through the lease; bounded message reads use the existing Host turn-page route. No remote bodies are persisted on Hub. Session creation/prompt require stable caller IDs for ambiguous-result inspection, not automatic replay. This capability neither uses nor grants the desktop SSH helper. The global gate and route require the existing loopback service credential,
33
33
  no browser Origin, shared-service ownership and the session's admitted Host origin.
34
34
  The bridge reuses `projects/registry.js`, just like the UI directory API and contact
35
35
  tools: strict reads, canonical path deduplication, serialized persistence and
@@ -46,6 +46,22 @@ client waits five seconds longer for the result). Caller disconnect cancels and
46
46
  releases the task lease; uncertain writes are inspected by their stable IDs before
47
47
  any retry.
48
48
 
49
+ `projects-lifecycle.js` owns bound-Host task/session archive operations.
50
+ `task-sessions` pages the current index metadata (50 rows), using the same committed
51
+ Host archive filter as the UI; it explicitly distinguishes an exhausted index from
52
+ complete upstream history. It exposes no messages or raw metadata.
53
+ Verification uses `session-state`, which exposes Host archive authority even after
54
+ an archived row leaves the index; nullable task fields do not imply live membership.
55
+ Task archive (`settle-session`) and restore (`unsettle-session`) reuse index writers and the normal
56
+ revision publisher, validating existing membership before writing. Session archive
57
+ and restore reuse `sessionArchiveService.setArchive`, including partial index-repair
58
+ receipts and sanitized errors. Neither path needs a UI password, deletes content,
59
+ changes another runtime partition or bypasses the existing session binding.
60
+ Task projection is not live UI membership: pins and running/pending requests retain
61
+ their existing precedence. Remote targets are rejected by these local operations.
62
+ New admitted sessions get the updated fingerprinted skill and helper after the Host
63
+ is upgraded; existing staged helpers remain immutable, not silently overwritten.
64
+
49
65
  `references/plugin-styles.md` inventories existing host CSS variables for plugin-owned
50
66
  Solid/DOM content, including colors, typography, geometry, controls and optional
51
67
  theme config. The workflow routes every plugin view through this reference. Visual
@@ -141,6 +157,11 @@ sessions across backend upgrades.
141
157
  `projects.test.js` exercises project bridge validation, authentication, binding,
142
158
  persisted idempotent registration and failure receipts. Shared-service admission
143
159
  tests execute the exact staged project helper through the real global auth gate.
160
+ `projects-lifecycle.test.js` executes the staged lifecycle commands through that
161
+ gate with UI password protection enabled, real temporary SQLite/metadata stores
162
+ and the existing archive service. It verifies discovery/pagination, settle and
163
+ archive round trips, missing IDs, binding/runtime rejection, write/read failures,
164
+ revision publication and sanitized partial-repair receipts without production data.
144
165
  `session-skill.test.js` exercises staging, complete resource availability, short
145
166
  per-session pointers, managed admission/rollback/adopted sessions and external
146
167
  ownership. Shared-service admission is covered by
@@ -8,7 +8,8 @@ async function main() {
8
8
  try {
9
9
  const [encoded, operation] = process.argv.slice(2);
10
10
  const binding = JSON.parse(Buffer.from(encoded, 'base64url').toString());
11
- const operations = ['list', 'add', 'remote-hosts', 'add-remote', 'remote-projects', 'sessions', 'read-session', 'create-session', 'prompt-session'];
11
+ const lifecycle = ['task-sessions', 'session-state', 'settle-session', 'unsettle-session', 'archive-session', 'unarchive-session'];
12
+ const operations = ['list', 'add', ...lifecycle, 'remote-hosts', 'add-remote', 'remote-projects', 'sessions', 'read-session', 'create-session', 'prompt-session'];
12
13
  if (!['describe', ...operations].includes(operation)) throw new Error();
13
14
  const origin = new URL(binding.hostOrigin);
14
15
  if (origin.protocol !== 'http:' || !['127.0.0.1', '[::1]'].includes(origin.hostname) || origin.username || origin.password) throw new Error();
@@ -33,7 +34,7 @@ async function main() {
33
34
  if (!response.ok) {
34
35
  const terminal = [401, 403, 501].includes(response.status);
35
36
  console.error(JSON.stringify({ error: 'Project API operation failed', status: response.status, terminal,
36
- ...(['invalid_input', 'validation_error', 'project_unavailable', 'project_operation_failed', 'remote_unavailable', 'remote_target_mismatch', 'remote_response_invalid'].includes(result?.code) ? { code: result.code } : {}),
37
+ ...(['invalid_input', 'session_not_found', 'session_archived', 'session_operation_failed', 'not_found', 'directory_mismatch', 'validation_error', 'project_unavailable', 'project_operation_failed', 'remote_unavailable', 'remote_target_mismatch', 'remote_response_invalid'].includes(result?.code) ? { code: result.code } : {}),
37
38
  recovery: terminal ? 'Stop this workflow; resume only with a new supported session and its bound project describe command.'
38
39
  : 'Result not confirmed. Inspect the same target before retrying; retain sessionID/messageID for interrupted writes. Never switch to local or claim success from a failed request.',
39
40
  }));
@@ -43,9 +44,19 @@ async function main() {
43
44
  if (['add', 'add-remote'].includes(operation) && (typeof result.project?.id !== 'string' || typeof result.project?.path !== 'string' || typeof result.created !== 'boolean')) throw new Error();
44
45
  if (operation === 'remote-hosts' && (!Array.isArray(result.hosts) || !Array.isArray(result.failed) || typeof result.complete !== 'boolean')) throw new Error();
45
46
  if (operation === 'list' && !Array.isArray(result.projects)) throw new Error();
47
+ if (operation === 'task-sessions' && (!Array.isArray(result.sessions) || result.indexedOnly !== true
48
+ || typeof result.historyComplete !== 'boolean' || (result.nextCursor !== null && typeof result.nextCursor !== 'string'))) throw new Error();
49
+ if (operation === 'session-state' && (result.sessionID !== input.sessionID || typeof result.indexed !== 'boolean'
50
+ || !Number.isFinite(result.archivedAt) || (result.settled !== null && typeof result.settled !== 'boolean')
51
+ || (result.pinned !== null && typeof result.pinned !== 'boolean'))) throw new Error();
52
+ if (['settle-session', 'unsettle-session'].includes(operation)
53
+ && (result.sessionID !== input.sessionID || result.settled !== (operation === 'settle-session'))) throw new Error();
54
+ if (['archive-session', 'unarchive-session'].includes(operation)
55
+ && (result.sessionID !== input.sessionID || result.archived !== (operation === 'archive-session')
56
+ || !Number.isFinite(result.archivedAt) || (result.archivedAt > 0) !== result.archived)) throw new Error();
46
57
  if (operation === 'describe' && result.supported !== true) throw new Error();
47
58
  console.log(JSON.stringify(operation === 'describe' ? { ...result,
48
- commands: Object.fromEntries(operations.filter((op) => result.remoteSupported || ['list', 'add'].includes(op)).map((op) => [op, sessionSkillCommand(process.execPath, process.argv[1], encoded, op)])),
59
+ commands: Object.fromEntries(operations.filter((op) => (lifecycle.includes(op) ? result.lifecycleSupported : result.remoteSupported || ['list', 'add'].includes(op))).map((op) => [op, sessionSkillCommand(process.execPath, process.argv[1], encoded, op)])),
49
60
  } : result));
50
61
  } catch {
51
62
  console.error(JSON.stringify({ error: 'Bound project helper failed; the result is unconfirmed', terminal: !bound,
@@ -0,0 +1,89 @@
1
+ import path from 'node:path';
2
+ import { applyHostArchiveToIndexSnapshot } from '../session-index/host-authority-snapshot.js';
3
+
4
+ export const lifecycleOperations = ['task-sessions', 'session-state', 'settle-session', 'unsettle-session', 'archive-session', 'unarchive-session'];
5
+
6
+ export function validLifecycleInput(operation, input) {
7
+ if (!input || typeof input !== 'object' || Array.isArray(input)) return false;
8
+ const allowed = operation === 'task-sessions' ? ['directory', 'cursor']
9
+ : ['archive-session', 'unarchive-session'].includes(operation) ? ['sessionID', 'directory'] : ['sessionID'];
10
+ if (Object.entries(input).some(([key, value]) => !allowed.includes(key)
11
+ || typeof value !== 'string' || !value.trim() || value.length > 4096 || /[\x00-\x1f]/.test(value))) return false;
12
+ if (input.directory !== undefined && !path.isAbsolute(input.directory)) return false;
13
+ if (operation === 'task-sessions') return input.cursor === undefined || /^(0|[1-9]\d{0,8})$/.test(input.cursor);
14
+ return typeof input.sessionID === 'string' && /^ses[A-Za-z0-9_]+$/.test(input.sessionID) && input.sessionID.length <= 256;
15
+ }
16
+
17
+ const unavailable = () => Object.assign(new Error('Session lifecycle unavailable'), { code: 'unsupported', status: 501 });
18
+ const notFound = () => Object.assign(new Error('Session not found'), { code: 'session_not_found', status: 404 });
19
+
20
+ /** Reuse the same index, Host archive authority and revision publisher as the UI. */
21
+ export function createProjectSessionLifecycle({ sessionIndexService, sessionArchiveService, publishSessionIndexChange, sessionMetadataStore }) {
22
+ if (!sessionIndexService || !sessionArchiveService || !sessionMetadataStore) return null;
23
+ const snapshot = async () => {
24
+ const stored = await sessionMetadataStore.getAll();
25
+ if (!stored || typeof stored !== 'object' || Array.isArray(stored)) throw new Error('Session metadata unavailable');
26
+ return applyHostArchiveToIndexSnapshot(sessionIndexService.snapshot(), stored);
27
+ };
28
+ return async (operation, input) => {
29
+ if (operation === 'task-sessions') {
30
+ const { directories, pinnedSessionIds = [] } = await snapshot();
31
+ const scoped = directories.filter((item) => !input.directory || item.directory === input.directory);
32
+ const pins = new Set(pinnedSessionIds);
33
+ const rows = scoped.flatMap((item) => item.sessions)
34
+ .filter((session) => !session.parentID)
35
+ .map((session) => ({
36
+ sessionID: session.id, directory: session.directory, title: session.title,
37
+ settled: Number(session.time?.settled ?? 0) > 0,
38
+ pinned: pins.has(session.id), activityUpdatedAt: session.metadata?.yuri?.titleRefresh?.activityUpdatedAt,
39
+ }));
40
+ const offset = Number(input.cursor ?? 0);
41
+ return {
42
+ sessions: rows.slice(offset, offset + 50),
43
+ nextCursor: offset + 50 < rows.length ? String(offset + 50) : null,
44
+ indexedOnly: true,
45
+ historyComplete: scoped.length > 0 && scoped.every((item) => item.lastFullSyncedAt > 0 && !item.hasMore),
46
+ };
47
+ }
48
+ const sessionID = input.sessionID;
49
+ if (operation === 'session-state') {
50
+ const hit = sessionIndexService.findBySessionId(sessionID);
51
+ const stored = await sessionMetadataStore.get(sessionID);
52
+ const stamp = stored?.yuri?.archive?.archivedAt;
53
+ if (!hit && !Number.isFinite(stamp)) throw notFound();
54
+ const view = await snapshot();
55
+ const row = view.directories.flatMap((item) => item.sessions).find((item) => item.id === sessionID);
56
+ return {
57
+ sessionID, indexed: Boolean(row),
58
+ archivedAt: Number.isFinite(stamp) ? stamp : hit.archivedAt,
59
+ settled: row ? Number(row.time?.settled ?? 0) > 0 : null,
60
+ pinned: row ? view.pinnedSessionIds.includes(sessionID) : null,
61
+ };
62
+ }
63
+ if (operation === 'settle-session' || operation === 'unsettle-session') {
64
+ const action = operation === 'settle-session' ? 'setSettled' : 'clearSettled';
65
+ if (typeof sessionIndexService[action] !== 'function') throw unavailable();
66
+ // The index writer accepts unknown IDs for pending state; this API confirms only existing sessions.
67
+ const hit = sessionIndexService.findBySessionId(sessionID);
68
+ if (!hit) throw notFound();
69
+ const stored = await sessionMetadataStore.get(sessionID);
70
+ if (Number(stored?.yuri?.archive?.archivedAt ?? hit.archivedAt) > 0) {
71
+ throw Object.assign(new Error('Restore session archive first'), { code: 'session_archived', status: 409 });
72
+ }
73
+ if (!sessionIndexService[action](sessionID)) throw notFound();
74
+ publishSessionIndexChange?.();
75
+ return { sessionID, settled: operation === 'settle-session' };
76
+ }
77
+ const archived = operation === 'archive-session';
78
+ const result = await sessionArchiveService.setArchive({
79
+ sessionID, archivedAt: archived ? Date.now() : 0,
80
+ ...(input.directory ? { directory: input.directory } : {}),
81
+ });
82
+ if (!Number.isFinite(result?.archivedAt) || (result.archivedAt > 0) !== archived
83
+ || typeof result.index?.ok !== 'boolean') throw new Error('Session archive unconfirmed');
84
+ return {
85
+ sessionID, archived, archivedAt: result.archivedAt,
86
+ index: result.index.ok ? { ok: true } : { ok: false, retryable: true },
87
+ };
88
+ };
89
+ }
@@ -0,0 +1,199 @@
1
+ import fs from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { randomUUID } from 'node:crypto';
5
+ import { spawn } from 'node:child_process';
6
+ import express from 'express';
7
+ import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest';
8
+ import { createUiAuth } from '../ui-auth/ui-auth.js';
9
+ import { registerAuthAndAccessRoutes } from '../opencode/core-routes.js';
10
+ import { createSessionIndexService } from '../session-index/service.js';
11
+ import { createSessionMetadataStore } from '../session-metadata/session-metadata-store.js';
12
+ import { createSessionArchiveService } from '../session-metadata/session-archive.js';
13
+ import { createCustomizationSkillInstaller } from './session-skill.js';
14
+ import { registerProjectsSkill, PROJECTS_SKILL_PATH } from './projects.js';
15
+ import { createProjectSessionLifecycle, lifecycleOperations } from './projects-lifecycle.js';
16
+
17
+ describe('bound session lifecycle helper end to end', () => {
18
+ let root, server, origin, auth, password, index, metadata, archive, records, publish, caller, command, shared, runtime;
19
+ const run = (command, input) => new Promise((resolve, reject) => {
20
+ const child = spawn(command, { shell: true, stdio: ['pipe', 'pipe', 'pipe'] });
21
+ let stdout = '', stderr = '';
22
+ child.stdout.on('data', (chunk) => { stdout += chunk; });
23
+ child.stderr.on('data', (chunk) => { stderr += chunk; });
24
+ child.on('error', reject);
25
+ child.on('close', (code) => {
26
+ try { resolve({ code, stdout, stderr, value: JSON.parse(code === 0 ? stdout : stderr) }); }
27
+ catch (error) { reject(error); }
28
+ });
29
+ child.stdin.end(input === undefined ? '' : JSON.stringify(input));
30
+ });
31
+ const request = (operation, input = {}, headers = auth) => fetch(`${origin}${PROJECTS_SKILL_PATH}`, {
32
+ method: 'POST', headers: { 'content-type': 'application/json', ...headers },
33
+ body: JSON.stringify({ sessionID: caller.id, operation, input }),
34
+ });
35
+ const commands = async () => {
36
+ const result = await run(command);
37
+ expect(result.code).toBe(0);
38
+ expect(result.value.lifecycleSupported).toBe(true);
39
+ expect(Object.keys(result.value.commands)).toEqual(['list', 'add', ...lifecycleOperations]);
40
+ return result.value.commands;
41
+ };
42
+
43
+ beforeEach(async () => {
44
+ root = await fs.mkdtemp(path.join(os.tmpdir(), 'project-lifecycle-'));
45
+ password = randomUUID(); shared = true; runtime = 'http://runtime.test';
46
+ auth = { Authorization: `Basic ${Buffer.from(`opencode:${password}`).toString('base64')}` };
47
+ const registrationFile = path.join(root, 'service.json');
48
+ await fs.writeFile(registrationFile, JSON.stringify({ url: runtime, password }), { mode: 0o600 });
49
+ index = createSessionIndexService({ dbPath: path.join(root, 'index.sqlite'), getRuntimeConfig: () => ({ apiBaseUrl: runtime }) });
50
+ metadata = createSessionMetadataStore({ dataDir: root });
51
+ const now = Date.now();
52
+ records = new Map([['ses_target', { id: 'ses_target', title: 'Target', directory: root, time: { created: now, updated: now } }]]);
53
+ index.upsert(records.get('ses_target'));
54
+ index.clearSettled('ses_target');
55
+ publish = vi.fn();
56
+ archive = createSessionArchiveService({
57
+ sessionMetadataStore: metadata, sessionIndexService: index,
58
+ fetchUpstreamSession: async ({ sessionID }) => records.get(sessionID) ?? null,
59
+ broadcastSessionEvent: publish,
60
+ });
61
+ caller = { id: 'ses_caller', metadata: { yuri: { scheduledTaskSkill: {} } } };
62
+ const app = express();
63
+ registerAuthAndAccessRoutes(app, {
64
+ express, tunnelAuthController: { classifyRequestScope: () => 'local' },
65
+ uiAuthController: createUiAuth({ password: randomUUID() }),
66
+ getScheduledTaskSkillAuthHeaders: () => auth,
67
+ });
68
+ registerProjectsSkill(app, {
69
+ express, getIsSharedOpenCodeService: () => shared, getOpenCodeAuthHeaders: () => auth,
70
+ createClient: () => ({ session: { get: async () => caller } }),
71
+ sessionLifecycle: createProjectSessionLifecycle({
72
+ sessionIndexService: index, sessionArchiveService: archive, sessionMetadataStore: metadata,
73
+ publishSessionIndexChange: publish,
74
+ }),
75
+ });
76
+ server = await new Promise((resolve) => { const s = app.listen(0, '127.0.0.1', () => resolve(s)); });
77
+ origin = `http://127.0.0.1:${server.address().port}`;
78
+ caller.metadata.yuri.scheduledTaskSkill.hostOrigin = origin;
79
+ let pointer;
80
+ await createCustomizationSkillInstaller({ yuriDataDir: root })({
81
+ session: { instructions: { entry: { put: ({ value }) => { pointer = value; } } } },
82
+ }, caller.id, { projectBinding: { hostOrigin: origin, upstreamOrigin: runtime, registrationFile } });
83
+ command = pointer.split('Bound project helper: ')[1].split('\n')[0];
84
+ });
85
+ afterEach(async () => {
86
+ archive.stop?.();
87
+ await new Promise((resolve) => server.close(resolve));
88
+ index.close();
89
+ await fs.rm(root, { recursive: true, force: true });
90
+ });
91
+
92
+ it('discovers, settles, re-reads and restores through staged commands without UI password, preserving pins and metadata', async () => {
93
+ expect((await fetch(`${origin}/api/yuri/session-index`)).status).toBe(401);
94
+ index.setPinned('ses_target');
95
+ const cmd = await commands();
96
+ const list = await run(cmd['task-sessions'], {});
97
+ expect(list.value.sessions).toEqual([expect.objectContaining({ sessionID: 'ses_target', settled: false, pinned: true })]);
98
+ expect((await run(cmd['settle-session'], { sessionID: 'ses_target' })).value).toEqual({ sessionID: 'ses_target', settled: true });
99
+ expect(publish).toHaveBeenCalledOnce();
100
+ expect((await run(cmd['task-sessions'], { directory: root })).value.sessions[0]).toMatchObject({ settled: true, pinned: true });
101
+ expect((await run(cmd['session-state'], { sessionID: 'ses_target' })).value).toMatchObject({ indexed: true, settled: true, pinned: true, archivedAt: 0 });
102
+ expect(await metadata.get('ses_target')).toEqual({});
103
+ expect((await run(cmd['unsettle-session'], { sessionID: 'ses_target' })).value.settled).toBe(false);
104
+ expect((await run(cmd['task-sessions'], {})).value.sessions[0].settled).toBe(false);
105
+ expect(publish).toHaveBeenCalledTimes(2);
106
+ expect(list.stdout).not.toContain(password);
107
+ });
108
+
109
+ it('round-trips session archive through its real owner and persisted metadata, independently of settle', async () => {
110
+ const cmd = await commands();
111
+ const saved = await run(cmd['archive-session'], { sessionID: 'ses_target', directory: root });
112
+ expect(saved.value).toMatchObject({ sessionID: 'ses_target', archived: true, archivedAt: expect.any(Number), index: { ok: true } });
113
+ expect((await createSessionMetadataStore({ dataDir: root }).get('ses_target')).yuri.archive.archivedAt).toBe(saved.value.archivedAt);
114
+ expect((await run(cmd['task-sessions'], {})).value.sessions).toEqual([]);
115
+ expect((await run(cmd['session-state'], { sessionID: 'ses_target' })).value).toEqual({
116
+ sessionID: 'ses_target', indexed: false, archivedAt: saved.value.archivedAt, settled: null, pinned: null,
117
+ });
118
+ const restored = await run(cmd['unarchive-session'], { sessionID: 'ses_target' });
119
+ expect(restored.value).toMatchObject({ archived: false, archivedAt: 0, index: { ok: true } });
120
+ expect((await run(cmd['task-sessions'], {})).value.sessions).toHaveLength(1);
121
+ expect(saved.stdout + restored.stdout).not.toContain(password);
122
+ });
123
+
124
+ it('rejects unknown IDs and invalid input instead of fabricating successful settle writes', async () => {
125
+ const cmd = await commands();
126
+ const result = await run(cmd['settle-session'], { sessionID: 'ses_missing' });
127
+ expect(result).toMatchObject({ code: 1, value: { status: 404, code: 'session_not_found', terminal: false } });
128
+ expect((await run(cmd['archive-session'], { sessionID: 'ses_missing' })).value).toMatchObject({ status: 404, code: 'not_found' });
129
+ expect((await run(cmd['session-state'], { sessionID: 'ses_missing' })).value).toMatchObject({ status: 404, code: 'session_not_found' });
130
+ for (const operation of lifecycleOperations) {
131
+ for (const input of [null, [], { sessionID: 'invalid' }, { sessionID: 'ses_target', target: {} }, { directory: 'relative' }]) {
132
+ expect((await request(operation, input)).status).toBe(400);
133
+ }
134
+ }
135
+ expect(publish).not.toHaveBeenCalled();
136
+ });
137
+
138
+ it('gates every lifecycle operation by service authentication and admitted Host, and prevents cross-runtime writes', async () => {
139
+ for (const operation of lifecycleOperations) {
140
+ const input = operation === 'task-sessions' ? {} : { sessionID: 'ses_target' };
141
+ for (const headers of [{}, { Authorization: 'Bearer browser' }, { ...auth, Origin: origin }]) {
142
+ expect((await request(operation, input, headers)).status).toBe(403);
143
+ }
144
+ caller.metadata.yuri.scheduledTaskSkill.hostOrigin = 'http://127.0.0.1:1';
145
+ expect((await request(operation, input)).status).toBe(403);
146
+ caller.metadata.yuri.scheduledTaskSkill.hostOrigin = origin;
147
+ }
148
+ runtime = 'http://other-runtime.test';
149
+ expect((await request('task-sessions')).status).toBe(200);
150
+ expect((await (await request('task-sessions')).json()).sessions).toEqual([]);
151
+ expect((await request('settle-session', { sessionID: 'ses_target' })).status).toBe(404);
152
+ shared = false;
153
+ expect((await request('describe')).status).toBe(403);
154
+ expect(publish).not.toHaveBeenCalled();
155
+ });
156
+
157
+ it('returns metadata read failures as errors and partial archive repair without leaking raw exceptions', async () => {
158
+ const cmd = await commands();
159
+ const failedRead = vi.spyOn(metadata, 'getAll').mockRejectedValueOnce(new Error('private-token'));
160
+ expect((await run(cmd['task-sessions'], {})).value).toMatchObject({ status: 503, code: 'session_operation_failed' });
161
+ failedRead.mockRestore();
162
+ const failedIndex = vi.spyOn(index, 'upsertAndReportChange').mockImplementation(() => { throw new Error('private-token'); });
163
+ const result = await run(cmd['archive-session'], { sessionID: 'ses_target' });
164
+ expect(result.value).toMatchObject({ archived: true, index: { ok: false, retryable: true } });
165
+ expect(result.stdout + result.stderr).not.toContain('private-token');
166
+ failedIndex.mockRestore();
167
+ });
168
+
169
+ it('rejects a stale indexed session archive and propagates metadata/write failures without publishing success', async () => {
170
+ await metadata.setSessionMetadata('ses_target', { yuri: { archive: { archivedAt: Date.now() } } }, { allowArchive: true });
171
+ expect((await request('unsettle-session', { sessionID: 'ses_target' })).status).toBe(409);
172
+ expect((await request('task-sessions')).status).toBe(200);
173
+ expect((await (await request('task-sessions')).json()).sessions).toEqual([]);
174
+ await metadata.setSessionMetadata('ses_target', { yuri: { archive: { archivedAt: 0 } } }, { allowArchive: true });
175
+ const failedRead = vi.spyOn(metadata, 'get').mockRejectedValueOnce(new Error('private-token'));
176
+ expect((await request('settle-session', { sessionID: 'ses_target' })).status).toBe(503);
177
+ failedRead.mockRestore();
178
+ const failedWrite = vi.spyOn(index, 'setSettled').mockImplementationOnce(() => { throw new Error('private-token'); });
179
+ const response = await request('settle-session', { sessionID: 'ses_target' });
180
+ expect(response.status).toBe(503);
181
+ expect(await response.text()).not.toContain('private-token');
182
+ failedWrite.mockRestore();
183
+ expect(publish).not.toHaveBeenCalled();
184
+ });
185
+
186
+ it('paginates a scoped index completely without mistaking it for full upstream history', async () => {
187
+ for (let n = 0; n < 55; n++) index.upsert({ ...records.get('ses_target'), id: `ses_${n}`, directory: path.join(root, `repo-${n}`) });
188
+ const cmd = await commands();
189
+ const first = await run(cmd['task-sessions'], {});
190
+ expect(first.value).toMatchObject({ indexedOnly: true, nextCursor: '50', historyComplete: false });
191
+ expect(first.value.sessions).toHaveLength(50);
192
+ const next = await run(cmd['task-sessions'], { cursor: first.value.nextCursor });
193
+ expect(next.value).toMatchObject({ nextCursor: null });
194
+ expect(next.value.sessions).toHaveLength(6);
195
+ const all = [...first.value.sessions, ...next.value.sessions];
196
+ expect(new Set(all.map((row) => row.sessionID)).size).toBe(56);
197
+ expect((await run(cmd['task-sessions'], { directory: root })).value.sessions).toHaveLength(1);
198
+ });
199
+ });
@@ -1,12 +1,14 @@
1
1
  import path from 'node:path';
2
2
  import { authorizeScheduledTaskSkillRequest } from '../scheduled-tasks/session-skill-contract.js';
3
3
  import { remoteProjectOperations, validRemoteProjectInput, runRemoteProjectOperation } from './projects-remote.js';
4
+ import { lifecycleOperations, validLifecycleInput } from './projects-lifecycle.js';
4
5
 
5
6
  export const PROJECTS_SKILL_PATH = '/api/yuri/session-skills/projects';
6
7
 
7
8
  const projectResult = ({ id, path, label }) => ({ id, path, ...(label ? { label } : {}) });
8
9
  const validInput = (operation, input) => {
9
10
  if (remoteProjectOperations.includes(operation)) return validRemoteProjectInput(operation, input);
11
+ if (lifecycleOperations.includes(operation)) return validLifecycleInput(operation, input);
10
12
  if (!input || typeof input !== 'object' || Array.isArray(input)) return false;
11
13
  const allowed = operation === 'add' ? ['path', 'label'] : [];
12
14
  if (Object.keys(input).some((key) => !allowed.includes(key))) return false;
@@ -16,22 +18,31 @@ const validInput = (operation, input) => {
16
18
  };
17
19
 
18
20
  /** Session-bound Host registration; the shared project registry owns persistence. */
19
- export function registerProjectsSkill(app, { express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, createClient, registerProject, readSettingsFromDiskStrict, sanitizeProjects, remoteHostGateway }) {
21
+ export function registerProjectsSkill(app, { express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders, createClient, registerProject, readSettingsFromDiskStrict, sanitizeProjects, remoteHostGateway, sessionLifecycle }) {
20
22
  app.post(PROJECTS_SKILL_PATH, express.json({ limit: '16kb' }), async (req, res) => {
21
23
  res.setHeader('Cache-Control', 'no-store');
22
24
  if (!getIsSharedOpenCodeService() || !authorizeScheduledTaskSkillRequest(req, getOpenCodeAuthHeaders())) return res.status(403).json({ error: 'Forbidden' });
23
25
  const { sessionID, operation, input = {} } = req.body ?? {};
24
26
  if (typeof sessionID !== 'string' || !sessionID || sessionID.length > 256
25
- || !['describe', 'list', 'add', ...remoteProjectOperations].includes(operation) || !validInput(operation, input)) return res.status(400).json({ code: 'invalid_input', error: 'Invalid project input' });
27
+ || !['describe', 'list', 'add', ...lifecycleOperations, ...remoteProjectOperations].includes(operation) || !validInput(operation, input)) return res.status(400).json({ code: 'invalid_input', error: 'Invalid project input' });
26
28
  try {
27
29
  const session = await createClient().session.get({ sessionID });
28
30
  const hostOrigin = `http://${req.socket.localAddress === '::1' ? '[::1]' : '127.0.0.1'}:${req.socket.localPort}`;
29
31
  if (session.metadata?.yuri?.scheduledTaskSkill?.hostOrigin !== hostOrigin) return res.status(403).json({ error: 'Session is not bound to this Host' });
30
- if (operation === 'describe') return res.json({ supported: true, remoteSupported: Boolean(remoteHostGateway?.supported && remoteHostGateway?.acquireTask), inputs: { add: '{path: existing absolute Host directory, label?: display name}', list: '{}',
32
+ if (operation === 'describe') return res.json({ supported: true, remoteSupported: Boolean(remoteHostGateway?.supported && remoteHostGateway?.acquireTask), lifecycleSupported: Boolean(sessionLifecycle), inputs: { add: '{path: existing absolute Host directory, label?: display name}', list: '{}',
33
+ 'task-sessions': '{directory?: absolute bound-Host directory, cursor?: returned nextCursor} bounded Host index metadata, not full upstream history',
34
+ 'session-state': '{sessionID} read Host archive authority and nullable task projection; not upstream existence or live UI state',
35
+ 'settle-session': '{sessionID} task-view 「归档」: moves the session to the archived shelf; reversible, returns to active on new activity', 'unsettle-session': '{sessionID} restores a task-view-archived session to active',
36
+ 'archive-session': '{sessionID, directory?} session-level archive (archivedAt metadata); not the task-view 「归档」', 'unarchive-session': '{sessionID, directory?}',
31
37
  'remote-hosts': '{}', 'add-remote': '{target: {hubId,hostId,instanceId} from remote-hosts, path: existing absolute remote directory, label?}',
32
38
  'remote-projects': '{}', sessions: '{target, directory, cursor?}', 'read-session': '{target, directory, sessionID, cursor?}',
33
39
  'create-session': '{target, directory, sessionID: new caller-generated ID, title?}', 'prompt-session': '{target, directory, sessionID, messageID: stable caller-generated ID, text}' },
34
40
  completion: 'add and add-remote return the persisted project and created=true/false. add-remote registers on the target Host, then saves the Hub reference. Registration does not clone/create files, open a session or change an existing active selection. Retry the same target and path safely after an interrupted response.' });
41
+ if (lifecycleOperations.includes(operation)) {
42
+ if (!sessionLifecycle) return res.status(501).json({ code: 'unsupported', error: 'Session lifecycle is unavailable on this Host' });
43
+ const result = await sessionLifecycle(operation, input);
44
+ return res.json(result);
45
+ }
35
46
  if (remoteProjectOperations.includes(operation)) {
36
47
  const controller = new AbortController();
37
48
  const abort = () => controller.abort();
@@ -60,6 +71,11 @@ export function registerProjectsSkill(app, { express, getIsSharedOpenCodeService
60
71
  return res.json({ project: projectResult(project), created });
61
72
  } catch (error) {
62
73
  if (res.destroyed) return;
74
+ if (lifecycleOperations.includes(operation)) {
75
+ const status = [400, 403, 404, 409, 501, 503].includes(error?.status) ? error.status : 503;
76
+ const code = ['unsupported', 'session_not_found', 'session_archived', 'not_found', 'directory_mismatch', 'validation_error'].includes(error?.code) ? error.code : 'session_operation_failed';
77
+ return res.status(status).json({ code, error: 'Session operation not confirmed; inspect the same session on the bound Host before retrying.' });
78
+ }
63
79
  const code = ['validation_error', 'project_unavailable', 'remote_unavailable', 'remote_target_mismatch', 'remote_response_invalid'].includes(error?.code) ? error.code : 'project_operation_failed';
64
80
  return res.status(code === 'validation_error' ? 400 : 503).json({ code, error: 'Project operation was not confirmed; inspect the same target before retrying. Never retry against the local Host.' });
65
81
  }
@@ -88,6 +88,12 @@ describe('session project registration API', () => {
88
88
  expect(registerProject).not.toHaveBeenCalled();
89
89
  });
90
90
 
91
+ it('explicitly reports unsupported lifecycle capability instead of falling through to registration', async () => {
92
+ expect(await (await request('describe')).json()).toMatchObject({ lifecycleSupported: false });
93
+ expect((await request('settle-session', { sessionID: 'ses_target' })).status).toBe(501);
94
+ expect(registerProject).not.toHaveBeenCalled();
95
+ });
96
+
91
97
  it('keeps remote discovery under the existing service and per-session admission gate', async () => {
92
98
  expect(await (await request('describe')).json()).toMatchObject({ remoteSupported: true });
93
99
  expect(await (await request('remote-projects')).json()).toEqual({ projects: [], failed: [], complete: true });
@@ -31,10 +31,10 @@ export function createCustomizationSkillInstaller({ yuriDataDir }) {
31
31
  };
32
32
  return async (client, sessionID, { remoteBinding, projectBinding } = {}) => {
33
33
  const file = await prepare(Boolean(remoteBinding), Boolean(projectBinding));
34
- const projects = projectBinding ? ` For local/remote project registration, discovering authorized remote machines, or reading/creating/continuing remote sessions, read references/projects.md and run the bound project API helper.\nBound project helper: ${sessionSkillCommand(process.execPath, path.join(path.dirname(file), 'projects.mjs'), Buffer.from(JSON.stringify({ ...projectBinding, sessionID })).toString('base64url'), 'describe')}\n` : ' No bound project helper is provided; project registration and remote project/session access are unavailable through this session skill.';
34
+ const projects = projectBinding ? ` For local/remote project registration, task/session archive and restore, discovering authorized remote machines, or reading/creating/continuing remote sessions, read references/projects.md and run the bound project API helper.\nBound project helper: ${sessionSkillCommand(process.execPath, path.join(path.dirname(file), 'projects.mjs'), Buffer.from(JSON.stringify({ ...projectBinding, sessionID })).toString('base64url'), 'describe')}\n` : ' No bound project helper is provided; project registration, task/session archive and remote project/session access are unavailable through this session skill.';
35
35
  const remote = remoteBinding ? ` For SSH setup/config sync or Relay pairing, use only this bound helper after reading references/remote-connections.md. Bound local desktop helper: ${remoteConnectionsCommand(process.execPath, path.join(path.dirname(file), 'remote-connections.mjs'), Buffer.from(JSON.stringify({ ...remoteBinding, sessionID })).toString('base64url'), 'describe')}` : ' No bound SSH/Relay command is provided: these operations are unavailable in this session. Report that limit and stop this branch; use native Settings or a new supported local desktop session. A script or another capability\'s binding does not enable it. There is no credential/filesystem fallback for this capability.';
36
36
  await client.session.instructions.entry.put({ sessionID, key: 'yuri.customization',
37
- value: `Yuri customization: for adding a directory as a project in Yuri (local or remote), remote sessions, SSH connections, configuration sync, Relay pairing, appearance (themes, CSS/layout, Logo, macOS Dock), work-status widgets, global pages/tabs, custom file parsing/previews, preview exports, or GUI panels/commands/settings, read ${JSON.stringify(file)} first. Use the matching reference and apply changes only when requested.${projects}${remote}`,
37
+ value: `Yuri customization: for adding a directory as a project in Yuri (local or remote), task/session archive or restore (归档/恢复), remote sessions, SSH connections, configuration sync, Relay pairing, appearance (themes, CSS/layout, Logo, macOS Dock), work-status widgets, global pages/tabs, custom file parsing/previews, preview exports, or GUI panels/commands/settings, read ${JSON.stringify(file)} first. Use the matching reference and apply changes only when requested.${projects}${remote}`,
38
38
  });
39
39
  };
40
40
  }
@@ -25,6 +25,7 @@ describe('built-in customization instructions', () => {
25
25
  expect(await fs.readFile(file, 'utf8')).toContain('name: yuri-customization');
26
26
  for (const name of ['projects', 'appearance', 'ui-surfaces', 'plugin-styles', 'gui-api', 'workflow', 'global-pages', 'work-status', 'icons', 'file-previews', 'preview-exports', 'remote-connections']) expect((await fs.readFile(path.join(path.dirname(file), 'references', `${name}.md`), 'utf8')).length).toBeGreaterThan(500);
27
27
  expect(entry.value).toContain('adding a directory as a project in Yuri');
28
+ expect(entry.value).toContain('task/session archive or restore (归档/恢复)');
28
29
  expect(await fs.readFile(file, 'utf8')).toContain('(references/projects.md)');
29
30
  const projects = await fs.readFile(path.join(path.dirname(file), 'references', 'projects.md'), 'utf8');
30
31
  expect(projects).toContain('POST /api/yuri/session-skills/projects');
@@ -55,6 +56,11 @@ describe('built-in customization instructions', () => {
55
56
  expect(projectFile).not.toBe(boundFile);
56
57
  expect(projectEntry).toContain('Bound project helper:');
57
58
  expect(projectEntry).toContain('local/remote project registration');
59
+ expect(projectEntry).toContain('task/session archive and restore');
60
+ expect(projects).toContain('任务归档');
61
+ expect(projects).toContain('会话归档');
62
+ expect(projects).toContain('lifecycleSupported:true');
63
+ expect(await fs.readFile(path.join(path.dirname(projectFile), 'projects.mjs'), 'utf8')).toContain("'settle-session', 'unsettle-session', 'archive-session', 'unarchive-session'");
58
64
  expect(projectEntry).toContain('discovering authorized remote machines');
59
65
  expect(await fs.readFile(path.join(path.dirname(projectFile), 'references', 'projects.md'), 'utf8')).toContain('commands.add-remote');
60
66
  expect(await fs.readFile(path.join(path.dirname(projectFile), 'projects.mjs'), 'utf8')).toContain("'remote-hosts', 'add-remote'");
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: yuri-customization
3
- description: Register local or remote Yuri projects, discover authorized remote machines and read/create/continue remote sessions, configure SSH connections, configuration sync and Relay pairing, or customize its GUI through plugins for appearance, pages, widgets, previews, panels and settings.
3
+ description: Register local or remote Yuri projects, archive conversations (task-view 归档 or session archive), discover authorized remote machines and read/create/continue remote sessions, configure SSH connections, configuration sync and Relay pairing, or customize its GUI through plugins for appearance, pages, widgets, previews, panels and settings.
4
4
  ---
5
5
 
6
6
  # Yuri customization
7
7
 
8
8
  For adding an existing directory to Yuri's project list, follow [projects](references/projects.md) using this session's bound project API helper. Registration is separate from creating files, cloning or opening a conversation.
9
9
 
10
+ For archiving conversations ("归档", moving tasks to the archived shelf, or session-level archive), use the same bound project helper and [archiving conversations](references/projects.md#archiving-conversations-task-archive-vs-session-archive). The task-view 「归档」 is `settle-session`; do not call UI-authenticated routes or edit Host databases.
11
+
10
12
  For adding a remote project on an authorized machine or working with its sessions, use the same bound project helper and the [remote project workflow](references/projects.md#connected-remote-projects-and-sessions). This grants no SSH setup or new connection permission.
11
13
 
12
14
  For SSH setup, configuration sync or Relay pairing, first check this session's pointer for its exact bound local desktop helper command. Without that command, report unavailable and stop this branch: a script file or another capability's binding does not enable it. With the command, follow [remote connections](references/remote-connections.md). For UI changes, use the plugin workflow below. Its GUI contracts describe Yuri's supported subset of the experimental OpenCode GUI SDK 2.2.0, not every capability in the newest upstream Desktop.
@@ -62,6 +62,36 @@ those retain their own capability contract. When the helper is unavailable, use
62
62
  the intended Host's project UI or start a supported session. Keep desktop deep
63
63
  links for their existing navigation purpose, not as an API authorization fallback.
64
64
 
65
+ ## Archiving conversations (task archive vs session archive)
66
+
67
+ Yuri has two different states that the UI labels alike. Pick by what the user sees:
68
+
69
+ | Term | User wording | Operation | What it changes |
70
+ |---|---|---|---|
71
+ | **任务归档 / Task archive** (`settle`) | In the task view, 「归档」 / "move to the archived shelf" / "clear my task list" | `settle-session`, `unsettle-session` | Host session index only. Reversible; a session returns to active on new user activity. |
72
+ | **会话归档 / Session archive** (`archive`) | Explicit "session-level archive", `archivedAt` | `archive-session`, `unarchive-session` | Session metadata `archivedAt`. The session's own lifecycle state. |
73
+
74
+ Use these qualified Chinese terms in agent explanations; the task-view UI keeps its existing 「归档」 label (no new 「已搁置」 term).
75
+
76
+ Default: when the user says 「归档」 about conversations/tasks without further detail, use `settle-session`. Never use `archive-session` for that request; it is not the task-view action. Neither operation deletes content.
77
+
78
+ 1. Run the bound project `describe` command. Continue only when `lifecycleSupported:true`; use the returned commands unchanged. Authentication is owned by the helper: no UI password or browser is required. A missing command or terminal error means stop and request a newly admitted session on an updated Host.
79
+ 2. Discover exact IDs with `commands["task-sessions"]`, supplying `{}` or `{"directory":"/workspace/my-project"}` on stdin. Results contain up to 50 metadata rows (`sessionID`, `directory`, `title`, `settled`, `pinned`, `activityUpdatedAt`) and `nextCursor`. Follow every returned cursor using the same directory filter **before writing**, then select only the user's scope. `indexedOnly:true` means this is the bound Host's task index, not every historical OpenCode session; `historyComplete:false` means full upstream history is not confirmed. Re-read after a concurrent catalog change; never interpret a failed read as an empty list.
80
+ 3. Supply JSON on stdin to the chosen write command, one session per call:
81
+
82
+ ```json
83
+ {"sessionID":"ses_xxxxxxxx"}
84
+ ```
85
+
86
+ `archive-session` / `unarchive-session` also accept an optional absolute `directory` hint. `sessionID` must be an existing OpenCode session ID (`ses…`).
87
+ 4. Completion: settle returns `{"sessionID":"ses_…","settled":true}`, restore returns `settled:false`. Read `commands["session-state"]` with `{"sessionID":"ses_…"}` to verify the Host projection and archive timestamp, or re-list task rows. State returns `indexed`, `archivedAt`, `settled` and `pinned`; the last two are `null` when no task row is projected. It is Host state, not proof of upstream existence or live UI membership. Live running/pending-request sessions may remain visible as active, and settle preserves pins; it does not abort execution or guarantee an empty task view. New user message/inbox activity clears the settle override; assistant completion alone does not.
88
+ Session archive returns `{"sessionID":"ses_…","archived":true,"archivedAt":123,"index":{"ok":true}}`; restore returns `archived:false,archivedAt:0`. `index.ok:false` confirms metadata persistence but not index repair: report partial success and re-check the same ID before retrying; retain the original `archivedAt` receipt.
89
+ 5. `session_not_found`/`not_found` (404) means the selected ID is unavailable, not success. `session_archived` (409) means an existing session-level archive must be restored with `unarchive-session`, not `unsettle-session`. Errors remain unconfirmed and raw credentials/errors are not returned. After an interrupted write, inspect the same IDs before retrying; bulk work reports confirmed counts and per-ID failures.
90
+
91
+ These operations affect only the **bound Host** and its current runtime. Task state for Remote Projects belongs to this connected Hub, never the remote machine's database. A remote `{target,...}` is not accepted here; session-level archive of a remote worker through this helper is unsupported. Keep the full remote target and use its supported workflow rather than falling back to a same-named local session.
92
+
93
+ Archive only sessions the user named or clearly scoped, including the current session only when requested. Use the bound helper rather than UI-authenticated HTTP routes, browser cookies, credential discovery or direct SQLite writes. The Host publishes normal index revisions after confirmed task writes.
94
+
65
95
  ## Connected remote projects and sessions
66
96
 
67
97
  Use this branch to add a remote project on an authorized machine or discover, read, create or continue its sessions. Registration uses the remote machine's filesystem, not this session's local filesystem.
@@ -1,6 +1,7 @@
1
1
  import { registerFsRoutes } from '../fs/routes.js';
2
2
  import { registerRemoteConnectionsSkill } from '../gui-customization/remote-connections.js';
3
3
  import { registerProjectsSkill } from '../gui-customization/projects.js';
4
+ import { createProjectSessionLifecycle } from '../gui-customization/projects-lifecycle.js';
4
5
  import { registerQuotaRoutes } from '../quota/routes.js';
5
6
  import { registerSmallModelRoutes } from '../small-model/routes.js';
6
7
  import { registerSessionMetadataRoutes } from '../session-metadata/routes.js';
@@ -161,6 +162,7 @@ export const createFeatureRoutesRuntime = (dependencies) => {
161
162
  globalMessageStreamHub,
162
163
  getServerId,
163
164
  sessionIndexService,
165
+ publishSessionIndexChange = null,
164
166
  notifyContactTurnComplete,
165
167
  sessionMetadataStore = null,
166
168
  sessionArchiveService = null,
@@ -311,6 +313,9 @@ export const createFeatureRoutesRuntime = (dependencies) => {
311
313
  express, getIsSharedOpenCodeService, getOpenCodeAuthHeaders,
312
314
  createClient: () => makeOpenCodeV2Client({ baseUrl: buildOpenCodeUrl('/', ''), authHeaders: getOpenCodeAuthHeaders(), getRuntimeContract }),
313
315
  registerProject: (input) => projectRegistry.register(input), readSettingsFromDiskStrict, sanitizeProjects,
316
+ sessionLifecycle: createProjectSessionLifecycle({
317
+ sessionIndexService, sessionArchiveService, sessionMetadataStore, publishSessionIndexChange,
318
+ }),
314
319
  });
315
320
  historyImportRuntime = registerHistoryImportRoutes(app, {
316
321
  express, uiAuthController, dataDir: yuriDataDir,
@@ -3,6 +3,12 @@ import { describe, expect, it, vi } from 'vitest';
3
3
  import { createWorktreeTopologyBroadcaster } from './feature-routes-runtime.js';
4
4
 
5
5
  describe('feature routes runtime composition', () => {
6
+ it('wires the bound lifecycle helper to the UI-owned services and revision publisher', async () => {
7
+ const routes = await fs.readFile(new URL('./feature-routes-runtime.js', import.meta.url), 'utf8');
8
+ const host = await fs.readFile(new URL('../../index.js', import.meta.url), 'utf8');
9
+ expect(routes).toMatch(/sessionLifecycle: createProjectSessionLifecycle\(\{\s*sessionIndexService, sessionArchiveService, sessionMetadataStore, publishSessionIndexChange/);
10
+ expect(host).toContain('publishSessionIndexChange: () => sessionIndexSyncRuntime?.publishChange?.()');
11
+ });
6
12
  it('wires session project registration to the shared registry and strict settings reader', async () => {
7
13
  const routes = await fs.readFile(new URL('./feature-routes-runtime.js', import.meta.url), 'utf8');
8
14
  expect(routes).toMatch(/registerProjectsSkill\(app, \{[\s\S]*?registerProject: \(input\) => projectRegistry.register\(input\), readSettingsFromDiskStrict, sanitizeProjects/);