@cerbur/clutch-dsh-worktree 0.1.9 → 0.1.10

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 (501) hide show
  1. package/README.md +99 -23
  2. package/README.zh.md +75 -19
  3. package/lib/client/WorktreeSurface.d.ts +4 -7
  4. package/lib/client/WorktreeSurface.d.ts.map +1 -1
  5. package/lib/client/WorktreeSurface.js +44 -1419
  6. package/lib/client/WorktreeSurface.js.map +1 -1
  7. package/lib/client/{WorktreeContext.d.ts → context/WorktreeContext.d.ts} +1 -1
  8. package/lib/client/context/WorktreeContext.d.ts.map +1 -0
  9. package/lib/client/context/WorktreeContext.js.map +1 -0
  10. package/lib/client/{WorktreeHeroContext.d.ts → context/WorktreeHeroContext.d.ts} +1 -1
  11. package/lib/client/context/WorktreeHeroContext.d.ts.map +1 -0
  12. package/lib/client/context/WorktreeHeroContext.js.map +1 -0
  13. package/lib/client/{worktree-context-store.d.ts → context/worktree-context-store.d.ts} +1 -1
  14. package/lib/client/context/worktree-context-store.d.ts.map +1 -0
  15. package/lib/client/{worktree-context-store.js → context/worktree-context-store.js} +2 -2
  16. package/lib/client/context/worktree-context-store.js.map +1 -0
  17. package/lib/client/{worktree-context.d.ts → context/worktree-context.d.ts} +1 -1
  18. package/lib/client/context/worktree-context.d.ts.map +1 -0
  19. package/lib/client/{worktree-context.js → context/worktree-context.js} +5 -3
  20. package/lib/client/context/worktree-context.js.map +1 -0
  21. package/lib/client/entry.d.ts +1 -1
  22. package/lib/client/entry.d.ts.map +1 -1
  23. package/lib/client/entry.js +25 -13
  24. package/lib/client/entry.js.map +1 -1
  25. package/lib/client/index.d.ts +3 -3
  26. package/lib/client/index.d.ts.map +1 -1
  27. package/lib/client/index.js +2 -2
  28. package/lib/client/index.js.map +1 -1
  29. package/lib/client/locales.d.ts +66 -0
  30. package/lib/client/locales.d.ts.map +1 -1
  31. package/lib/client/locales.js +76 -10
  32. package/lib/client/locales.js.map +1 -1
  33. package/lib/client/{WorktreeOverlay.d.ts → overlay/WorktreeOverlay.d.ts} +2 -2
  34. package/lib/client/overlay/WorktreeOverlay.d.ts.map +1 -0
  35. package/lib/client/{WorktreeOverlay.js → overlay/WorktreeOverlay.js} +2 -2
  36. package/lib/client/overlay/WorktreeOverlay.js.map +1 -0
  37. package/lib/client/overlay/overlay-bounds.d.ts.map +1 -0
  38. package/lib/client/overlay/overlay-bounds.js.map +1 -0
  39. package/lib/client/overlay/sidebar-overlay-geometry.d.ts.map +1 -0
  40. package/lib/client/overlay/sidebar-overlay-geometry.js.map +1 -0
  41. package/lib/client/permission/worktree-permission-icon.d.ts.map +1 -0
  42. package/lib/client/permission/worktree-permission-icon.js.map +1 -0
  43. package/lib/client/permission/worktree-permission.d.ts.map +1 -0
  44. package/lib/client/permission/worktree-permission.js.map +1 -0
  45. package/lib/client/session/session-view.d.ts.map +1 -0
  46. package/lib/client/session/session-view.js.map +1 -0
  47. package/lib/client/{virtual-workspace-membership.d.ts → session/virtual-workspace-membership.d.ts} +1 -1
  48. package/lib/client/session/virtual-workspace-membership.d.ts.map +1 -0
  49. package/lib/client/{virtual-workspace-membership.js → session/virtual-workspace-membership.js} +1 -1
  50. package/lib/client/session/virtual-workspace-membership.js.map +1 -0
  51. package/lib/client/{worktree-session-fork.d.ts → session/worktree-session-fork.d.ts} +7 -1
  52. package/lib/client/session/worktree-session-fork.d.ts.map +1 -0
  53. package/lib/client/{worktree-session-fork.js → session/worktree-session-fork.js} +50 -4
  54. package/lib/client/session/worktree-session-fork.js.map +1 -0
  55. package/lib/client/session/worktree-session-order.d.ts.map +1 -0
  56. package/lib/client/session/worktree-session-order.js.map +1 -0
  57. package/lib/client/session/worktree-session-position.d.ts.map +1 -0
  58. package/lib/client/session/worktree-session-position.js.map +1 -0
  59. package/lib/client/{worktree-session.d.ts → session/worktree-session.d.ts} +3 -3
  60. package/lib/client/session/worktree-session.d.ts.map +1 -0
  61. package/lib/client/{worktree-session.js → session/worktree-session.js} +3 -3
  62. package/lib/client/session/worktree-session.js.map +1 -0
  63. package/lib/client/surface/actions/lifecycle-commands.d.ts +9 -0
  64. package/lib/client/surface/actions/lifecycle-commands.d.ts.map +1 -0
  65. package/lib/client/surface/actions/lifecycle-commands.js +243 -0
  66. package/lib/client/surface/actions/lifecycle-commands.js.map +1 -0
  67. package/lib/client/surface/actions/useDragActions.d.ts +26 -0
  68. package/lib/client/surface/actions/useDragActions.d.ts.map +1 -0
  69. package/lib/client/surface/actions/useDragActions.js +125 -0
  70. package/lib/client/surface/actions/useDragActions.js.map +1 -0
  71. package/lib/client/surface/actions/useLifecycleActions.d.ts +30 -0
  72. package/lib/client/surface/actions/useLifecycleActions.d.ts.map +1 -0
  73. package/lib/client/surface/actions/useLifecycleActions.js +140 -0
  74. package/lib/client/surface/actions/useLifecycleActions.js.map +1 -0
  75. package/lib/client/surface/actions/useNativeActions.d.ts +48 -0
  76. package/lib/client/surface/actions/useNativeActions.d.ts.map +1 -0
  77. package/lib/client/surface/actions/useNativeActions.js +182 -0
  78. package/lib/client/surface/actions/useNativeActions.js.map +1 -0
  79. package/lib/client/surface/actions/useSessionActions.d.ts +24 -0
  80. package/lib/client/surface/actions/useSessionActions.d.ts.map +1 -0
  81. package/lib/client/surface/actions/useSessionActions.js +116 -0
  82. package/lib/client/surface/actions/useSessionActions.js.map +1 -0
  83. package/lib/client/surface/actions/useSurfaceMutation.d.ts +15 -0
  84. package/lib/client/surface/actions/useSurfaceMutation.d.ts.map +1 -0
  85. package/lib/client/surface/actions/useSurfaceMutation.js +24 -0
  86. package/lib/client/surface/actions/useSurfaceMutation.js.map +1 -0
  87. package/lib/client/surface/actions/useWorktreeRegistration.d.ts +31 -0
  88. package/lib/client/surface/actions/useWorktreeRegistration.d.ts.map +1 -0
  89. package/lib/client/surface/actions/useWorktreeRegistration.js +203 -0
  90. package/lib/client/surface/actions/useWorktreeRegistration.js.map +1 -0
  91. package/lib/client/surface/actions/worktree-cleanup-flow.d.ts +10 -0
  92. package/lib/client/surface/actions/worktree-cleanup-flow.d.ts.map +1 -0
  93. package/lib/client/surface/actions/worktree-cleanup-flow.js +19 -0
  94. package/lib/client/surface/actions/worktree-cleanup-flow.js.map +1 -0
  95. package/lib/client/surface/components/AccessConfirmation.d.ts +9 -0
  96. package/lib/client/surface/components/AccessConfirmation.d.ts.map +1 -0
  97. package/lib/client/surface/components/AccessConfirmation.js +18 -0
  98. package/lib/client/surface/components/AccessConfirmation.js.map +1 -0
  99. package/lib/client/surface/components/ActiveWorktree.d.ts +28 -0
  100. package/lib/client/surface/components/ActiveWorktree.d.ts.map +1 -0
  101. package/lib/client/surface/components/ActiveWorktree.js +154 -0
  102. package/lib/client/surface/components/ActiveWorktree.js.map +1 -0
  103. package/lib/client/surface/components/ArchivedWorktree.d.ts +24 -0
  104. package/lib/client/surface/components/ArchivedWorktree.d.ts.map +1 -0
  105. package/lib/client/surface/components/ArchivedWorktree.js +145 -0
  106. package/lib/client/surface/components/ArchivedWorktree.js.map +1 -0
  107. package/lib/client/surface/components/ArchivedWorktrees.d.ts +25 -0
  108. package/lib/client/surface/components/ArchivedWorktrees.d.ts.map +1 -0
  109. package/lib/client/surface/components/ArchivedWorktrees.js +20 -0
  110. package/lib/client/surface/components/ArchivedWorktrees.js.map +1 -0
  111. package/lib/client/surface/components/LifecycleDialogs.d.ts +20 -0
  112. package/lib/client/surface/components/LifecycleDialogs.d.ts.map +1 -0
  113. package/lib/client/surface/components/LifecycleDialogs.js +31 -0
  114. package/lib/client/surface/components/LifecycleDialogs.js.map +1 -0
  115. package/lib/client/surface/components/NativeDialogs.d.ts +9 -0
  116. package/lib/client/surface/components/NativeDialogs.d.ts.map +1 -0
  117. package/lib/client/surface/components/NativeDialogs.js +14 -0
  118. package/lib/client/surface/components/NativeDialogs.js.map +1 -0
  119. package/lib/client/surface/components/NotificationToasts.d.ts +7 -0
  120. package/lib/client/surface/components/NotificationToasts.d.ts.map +1 -0
  121. package/lib/client/surface/components/NotificationToasts.js +24 -0
  122. package/lib/client/surface/components/NotificationToasts.js.map +1 -0
  123. package/lib/client/surface/components/RegistrationDialog.d.ts +15 -0
  124. package/lib/client/surface/components/RegistrationDialog.d.ts.map +1 -0
  125. package/lib/client/surface/components/RegistrationDialog.js +22 -0
  126. package/lib/client/surface/components/RegistrationDialog.js.map +1 -0
  127. package/lib/client/surface/components/SurfaceContent.d.ts +31 -0
  128. package/lib/client/surface/components/SurfaceContent.d.ts.map +1 -0
  129. package/lib/client/surface/components/SurfaceContent.js +65 -0
  130. package/lib/client/surface/components/SurfaceContent.js.map +1 -0
  131. package/lib/client/surface/components/SurfaceHeader.d.ts +15 -0
  132. package/lib/client/surface/components/SurfaceHeader.d.ts.map +1 -0
  133. package/lib/client/surface/components/SurfaceHeader.js +42 -0
  134. package/lib/client/surface/components/SurfaceHeader.js.map +1 -0
  135. package/lib/client/surface/components/WorkspaceTree.d.ts +32 -0
  136. package/lib/client/surface/components/WorkspaceTree.d.ts.map +1 -0
  137. package/lib/client/surface/components/WorkspaceTree.js +145 -0
  138. package/lib/client/surface/components/WorkspaceTree.js.map +1 -0
  139. package/lib/client/{worktree-surface-dialogs.d.ts → surface/components/dialogs.d.ts} +5 -2
  140. package/lib/client/surface/components/dialogs.d.ts.map +1 -0
  141. package/lib/client/{worktree-surface-dialogs.js → surface/components/dialogs.js} +67 -24
  142. package/lib/client/surface/components/dialogs.js.map +1 -0
  143. package/lib/client/{worktree-surface-rows.d.ts → surface/components/rows.d.ts} +3 -3
  144. package/lib/client/surface/components/rows.d.ts.map +1 -0
  145. package/lib/client/{worktree-surface-rows.js → surface/components/rows.js} +79 -17
  146. package/lib/client/surface/components/rows.js.map +1 -0
  147. package/lib/client/surface/notification-queue.d.ts +11 -0
  148. package/lib/client/surface/notification-queue.d.ts.map +1 -0
  149. package/lib/client/surface/notification-queue.js +19 -0
  150. package/lib/client/surface/notification-queue.js.map +1 -0
  151. package/lib/client/{worktree-surface-selectors.d.ts → surface/selectors.d.ts} +10 -5
  152. package/lib/client/surface/selectors.d.ts.map +1 -0
  153. package/lib/client/{worktree-surface-selectors.js → surface/selectors.js} +23 -6
  154. package/lib/client/surface/selectors.js.map +1 -0
  155. package/lib/client/surface/shared.d.ts +40 -0
  156. package/lib/client/surface/shared.d.ts.map +1 -0
  157. package/lib/client/surface/shared.js +53 -0
  158. package/lib/client/surface/shared.js.map +1 -0
  159. package/lib/client/surface/state/useLifecycleState.d.ts +34 -0
  160. package/lib/client/surface/state/useLifecycleState.d.ts.map +1 -0
  161. package/lib/client/surface/state/useLifecycleState.js +39 -0
  162. package/lib/client/surface/state/useLifecycleState.js.map +1 -0
  163. package/lib/client/surface/state/useRegistrationState.d.ts +34 -0
  164. package/lib/client/surface/state/useRegistrationState.d.ts.map +1 -0
  165. package/lib/client/surface/state/useRegistrationState.js +44 -0
  166. package/lib/client/surface/state/useRegistrationState.js.map +1 -0
  167. package/lib/client/surface/state/useSessionExpansion.d.ts +39 -0
  168. package/lib/client/surface/state/useSessionExpansion.d.ts.map +1 -0
  169. package/lib/client/surface/state/useSessionExpansion.js +230 -0
  170. package/lib/client/surface/state/useSessionExpansion.js.map +1 -0
  171. package/lib/client/surface/state/useSessionOrdering.d.ts +15 -0
  172. package/lib/client/surface/state/useSessionOrdering.d.ts.map +1 -0
  173. package/lib/client/surface/state/useSessionOrdering.js +68 -0
  174. package/lib/client/surface/state/useSessionOrdering.js.map +1 -0
  175. package/lib/client/surface/state/useSurfaceMenus.d.ts +9 -0
  176. package/lib/client/surface/state/useSurfaceMenus.d.ts.map +1 -0
  177. package/lib/client/surface/state/useSurfaceMenus.js +15 -0
  178. package/lib/client/surface/state/useSurfaceMenus.js.map +1 -0
  179. package/lib/client/surface/state/useSurfaceRefresh.d.ts +39 -0
  180. package/lib/client/surface/state/useSurfaceRefresh.d.ts.map +1 -0
  181. package/lib/client/surface/state/useSurfaceRefresh.js +274 -0
  182. package/lib/client/surface/state/useSurfaceRefresh.js.map +1 -0
  183. package/lib/client/surface/state/useSurfaceSources.d.ts +31 -0
  184. package/lib/client/surface/state/useSurfaceSources.d.ts.map +1 -0
  185. package/lib/client/surface/state/useSurfaceSources.js +63 -0
  186. package/lib/client/surface/state/useSurfaceSources.js.map +1 -0
  187. package/lib/client/{worktree-surface-types.d.ts → surface/types.d.ts} +50 -13
  188. package/lib/client/surface/types.d.ts.map +1 -0
  189. package/lib/client/surface/types.js +2 -0
  190. package/lib/client/surface/types.js.map +1 -0
  191. package/lib/client/{WorktreeModeAction.d.ts → view/WorktreeModeAction.d.ts} +1 -1
  192. package/lib/client/view/WorktreeModeAction.d.ts.map +1 -0
  193. package/lib/client/{WorktreeModeAction.js → view/WorktreeModeAction.js} +1 -1
  194. package/lib/client/view/WorktreeModeAction.js.map +1 -0
  195. package/lib/client/view/navigation.d.ts.map +1 -0
  196. package/lib/client/view/navigation.js.map +1 -0
  197. package/lib/client/view/view-mode-store.d.ts.map +1 -0
  198. package/lib/client/view/view-mode-store.js.map +1 -0
  199. package/lib/client/view/view-mode.d.ts.map +1 -0
  200. package/lib/client/view/view-mode.js.map +1 -0
  201. package/lib/client/{worktree-error-copy.d.ts → view/worktree-error-copy.d.ts} +2 -2
  202. package/lib/client/view/worktree-error-copy.d.ts.map +1 -0
  203. package/lib/client/view/worktree-error-copy.js.map +1 -0
  204. package/lib/client/{worktree-expand-state.d.ts → view/worktree-expand-state.d.ts} +1 -0
  205. package/lib/client/view/worktree-expand-state.d.ts.map +1 -0
  206. package/lib/client/{worktree-expand-state.js → view/worktree-expand-state.js} +11 -0
  207. package/lib/client/view/worktree-expand-state.js.map +1 -0
  208. package/lib/client/{worktree-view-actions.d.ts → view/worktree-view-actions.d.ts} +11 -5
  209. package/lib/client/view/worktree-view-actions.d.ts.map +1 -0
  210. package/lib/client/{worktree-view-actions.js → view/worktree-view-actions.js} +13 -11
  211. package/lib/client/view/worktree-view-actions.js.map +1 -0
  212. package/lib/client/view/worktree-view-errors.d.ts.map +1 -0
  213. package/lib/client/view/worktree-view-errors.js.map +1 -0
  214. package/lib/client/{worktree-view-read.d.ts → view/worktree-view-read.d.ts} +4 -2
  215. package/lib/client/view/worktree-view-read.d.ts.map +1 -0
  216. package/lib/client/{worktree-view-read.js → view/worktree-view-read.js} +4 -1
  217. package/lib/client/view/worktree-view-read.js.map +1 -0
  218. package/lib/client/view/worktree-view.d.ts.map +1 -0
  219. package/lib/client/view/worktree-view.js.map +1 -0
  220. package/lib/client/worktree-connection.d.ts +5 -0
  221. package/lib/client/worktree-connection.d.ts.map +1 -1
  222. package/lib/client/worktree-connection.js +16 -0
  223. package/lib/client/worktree-connection.js.map +1 -1
  224. package/lib/client.js +4295 -2634
  225. package/lib/client.js.map +1 -1
  226. package/lib/contract/index.contract.js +10 -0
  227. package/lib/contract/index.contract.js.map +1 -1
  228. package/lib/contract/index.d.ts +46 -3
  229. package/lib/contract/index.d.ts.map +1 -1
  230. package/lib/contract/index.js +7 -0
  231. package/lib/contract/index.js.map +1 -1
  232. package/lib/host/dsh-read-adapter.d.ts +10 -1
  233. package/lib/host/dsh-read-adapter.d.ts.map +1 -1
  234. package/lib/host/dsh-read-adapter.js +18 -1
  235. package/lib/host/dsh-read-adapter.js.map +1 -1
  236. package/lib/host/remote.d.ts.map +1 -1
  237. package/lib/host/remote.js +14 -0
  238. package/lib/host/remote.js.map +1 -1
  239. package/lib/host/service.d.ts +24 -0
  240. package/lib/host/service.d.ts.map +1 -1
  241. package/lib/host/service.js +39 -1
  242. package/lib/host/service.js.map +1 -1
  243. package/lib/host/worktree-activity.d.ts +13 -0
  244. package/lib/host/worktree-activity.d.ts.map +1 -0
  245. package/lib/host/worktree-activity.js +23 -0
  246. package/lib/host/worktree-activity.js.map +1 -0
  247. package/lib/host/worktree-permission-manager.js +2 -2
  248. package/lib/host/worktree-permission-manager.js.map +1 -1
  249. package/lib/index.d.ts +3 -3
  250. package/lib/index.d.ts.map +1 -1
  251. package/lib/index.js +2 -2
  252. package/lib/index.js.map +1 -1
  253. package/lib/manage/manager-context.d.ts +2 -1
  254. package/lib/manage/manager-context.d.ts.map +1 -1
  255. package/lib/manage/manager-sessions.js +4 -4
  256. package/lib/manage/manager-sessions.js.map +1 -1
  257. package/lib/manage/manager-worktree-lifecycle.d.ts +23 -0
  258. package/lib/manage/manager-worktree-lifecycle.d.ts.map +1 -0
  259. package/lib/manage/manager-worktree-lifecycle.js +165 -0
  260. package/lib/manage/manager-worktree-lifecycle.js.map +1 -0
  261. package/lib/manage/manager-worktrees.d.ts +1 -6
  262. package/lib/manage/manager-worktrees.d.ts.map +1 -1
  263. package/lib/manage/manager-worktrees.js +78 -112
  264. package/lib/manage/manager-worktrees.js.map +1 -1
  265. package/lib/manage/manager.d.ts +17 -1
  266. package/lib/manage/manager.d.ts.map +1 -1
  267. package/lib/manage/manager.js +23 -6
  268. package/lib/manage/manager.js.map +1 -1
  269. package/lib/provider/generated-name.d.ts +8 -0
  270. package/lib/provider/generated-name.d.ts.map +1 -0
  271. package/lib/provider/generated-name.js +29 -0
  272. package/lib/provider/generated-name.js.map +1 -0
  273. package/lib/provider/{git.d.ts → git/adapter.d.ts} +2 -2
  274. package/lib/provider/git/adapter.d.ts.map +1 -0
  275. package/lib/provider/{git.js → git/adapter.js} +11 -2
  276. package/lib/provider/git/adapter.js.map +1 -0
  277. package/lib/provider/{repository-fingerprint.d.ts → git/repository-fingerprint.d.ts} +1 -1
  278. package/lib/provider/git/repository-fingerprint.d.ts.map +1 -0
  279. package/lib/provider/git/repository-fingerprint.js.map +1 -0
  280. package/lib/provider/{subprocess.d.ts → git/subprocess.d.ts} +1 -1
  281. package/lib/provider/git/subprocess.d.ts.map +1 -0
  282. package/lib/provider/git/subprocess.js.map +1 -0
  283. package/lib/provider/git/worktree-status.d.ts +5 -0
  284. package/lib/provider/git/worktree-status.d.ts.map +1 -0
  285. package/lib/provider/git/worktree-status.js +23 -0
  286. package/lib/provider/git/worktree-status.js.map +1 -0
  287. package/lib/provider/index.d.ts +5 -5
  288. package/lib/provider/index.d.ts.map +1 -1
  289. package/lib/provider/index.js +5 -5
  290. package/lib/provider/index.js.map +1 -1
  291. package/lib/provider/mutation-token.d.ts +1 -1
  292. package/lib/provider/mutation-token.d.ts.map +1 -1
  293. package/lib/provider/mutation-token.js +1 -0
  294. package/lib/provider/mutation-token.js.map +1 -1
  295. package/lib/provider/sidecar/mutation-lock.d.ts.map +1 -0
  296. package/lib/provider/{mutation-lock.js → sidecar/mutation-lock.js} +1 -1
  297. package/lib/provider/sidecar/mutation-lock.js.map +1 -0
  298. package/lib/provider/{sidecar.d.ts → sidecar/repository.d.ts} +3 -3
  299. package/lib/provider/sidecar/repository.d.ts.map +1 -0
  300. package/lib/provider/{sidecar.js → sidecar/repository.js} +12 -5
  301. package/lib/provider/sidecar/repository.js.map +1 -0
  302. package/lib/provider/{sidecar-persistence.d.ts → sidecar/sidecar-persistence.d.ts} +1 -1
  303. package/lib/provider/sidecar/sidecar-persistence.d.ts.map +1 -0
  304. package/lib/provider/{sidecar-persistence.js → sidecar/sidecar-persistence.js} +29 -2
  305. package/lib/provider/sidecar/sidecar-persistence.js.map +1 -0
  306. package/lib/provider/{sidecar-schema.d.ts → sidecar/sidecar-schema.d.ts} +1 -1
  307. package/lib/provider/sidecar/sidecar-schema.d.ts.map +1 -0
  308. package/lib/provider/{sidecar-schema.js → sidecar/sidecar-schema.js} +52 -16
  309. package/lib/provider/sidecar/sidecar-schema.js.map +1 -0
  310. package/lib/provider/transaction/dependencies.d.ts +10 -0
  311. package/lib/provider/transaction/dependencies.d.ts.map +1 -0
  312. package/lib/provider/transaction/dependencies.js +2 -0
  313. package/lib/provider/transaction/dependencies.js.map +1 -0
  314. package/lib/provider/transaction/index.d.ts +17 -0
  315. package/lib/provider/transaction/index.d.ts.map +1 -0
  316. package/lib/provider/transaction/index.js +44 -0
  317. package/lib/provider/transaction/index.js.map +1 -0
  318. package/lib/provider/transaction/operations/adopt-branch.d.ts +6 -0
  319. package/lib/provider/transaction/operations/adopt-branch.d.ts.map +1 -0
  320. package/lib/provider/transaction/operations/adopt-branch.js +59 -0
  321. package/lib/provider/transaction/operations/adopt-branch.js.map +1 -0
  322. package/lib/provider/transaction/operations/clean.d.ts +4 -0
  323. package/lib/provider/transaction/operations/clean.d.ts.map +1 -0
  324. package/lib/provider/transaction/operations/clean.js +168 -0
  325. package/lib/provider/transaction/operations/clean.js.map +1 -0
  326. package/lib/provider/transaction/operations/create.d.ts +5 -0
  327. package/lib/provider/transaction/operations/create.d.ts.map +1 -0
  328. package/lib/provider/transaction/operations/create.js +136 -0
  329. package/lib/provider/transaction/operations/create.js.map +1 -0
  330. package/lib/provider/transaction/operations/import.d.ts +5 -0
  331. package/lib/provider/transaction/operations/import.d.ts.map +1 -0
  332. package/lib/provider/transaction/operations/import.js +92 -0
  333. package/lib/provider/transaction/operations/import.js.map +1 -0
  334. package/lib/provider/transaction/operations/remove.d.ts +4 -0
  335. package/lib/provider/transaction/operations/remove.d.ts.map +1 -0
  336. package/lib/provider/transaction/operations/remove.js +164 -0
  337. package/lib/provider/transaction/operations/remove.js.map +1 -0
  338. package/lib/provider/transaction/recovery/failure-recovery.d.ts +32 -0
  339. package/lib/provider/transaction/recovery/failure-recovery.d.ts.map +1 -0
  340. package/lib/provider/transaction/recovery/failure-recovery.js +147 -0
  341. package/lib/provider/transaction/recovery/failure-recovery.js.map +1 -0
  342. package/lib/provider/transaction/recovery/recover.d.ts +4 -0
  343. package/lib/provider/transaction/recovery/recover.d.ts.map +1 -0
  344. package/lib/provider/transaction/recovery/recover.js +162 -0
  345. package/lib/provider/transaction/recovery/recover.js.map +1 -0
  346. package/lib/provider/transaction/support/admission.d.ts +7 -0
  347. package/lib/provider/transaction/support/admission.d.ts.map +1 -0
  348. package/lib/provider/transaction/support/admission.js +90 -0
  349. package/lib/provider/transaction/support/admission.js.map +1 -0
  350. package/lib/provider/transaction/support/inspection.d.ts +11 -0
  351. package/lib/provider/transaction/support/inspection.d.ts.map +1 -0
  352. package/lib/provider/transaction/support/inspection.js +51 -0
  353. package/lib/provider/transaction/support/inspection.js.map +1 -0
  354. package/lib/provider/transaction/support/journal.d.ts +12 -0
  355. package/lib/provider/transaction/support/journal.d.ts.map +1 -0
  356. package/lib/provider/transaction/support/journal.js +72 -0
  357. package/lib/provider/transaction/support/journal.js.map +1 -0
  358. package/lib/provider/transaction/support/locking.d.ts +4 -0
  359. package/lib/provider/transaction/support/locking.d.ts.map +1 -0
  360. package/lib/provider/transaction/support/locking.js +11 -0
  361. package/lib/provider/transaction/support/locking.js.map +1 -0
  362. package/lib/provider/transaction/support/path-safety.d.ts +11 -0
  363. package/lib/provider/transaction/support/path-safety.d.ts.map +1 -0
  364. package/lib/provider/transaction/support/path-safety.js +82 -0
  365. package/lib/provider/transaction/support/path-safety.js.map +1 -0
  366. package/lib/provider/transaction/support/paths.d.ts +10 -0
  367. package/lib/provider/transaction/support/paths.d.ts.map +1 -0
  368. package/lib/provider/transaction/support/paths.js +68 -0
  369. package/lib/provider/transaction/support/paths.js.map +1 -0
  370. package/lib/provider/transaction/support/publication.d.ts +9 -0
  371. package/lib/provider/transaction/support/publication.d.ts.map +1 -0
  372. package/lib/provider/transaction/support/publication.js +92 -0
  373. package/lib/provider/transaction/support/publication.js.map +1 -0
  374. package/lib/provider/transaction/types.d.ts +38 -0
  375. package/lib/provider/transaction/types.d.ts.map +1 -0
  376. package/lib/provider/transaction/types.js +2 -0
  377. package/lib/provider/transaction/types.js.map +1 -0
  378. package/lib/provider/types.d.ts +22 -3
  379. package/lib/provider/types.d.ts.map +1 -1
  380. package/lib/provider/types.js +1 -1
  381. package/lib/provider/types.js.map +1 -1
  382. package/lib/provider/worktree-lifecycle.d.ts +19 -0
  383. package/lib/provider/worktree-lifecycle.d.ts.map +1 -0
  384. package/lib/provider/worktree-lifecycle.js +44 -0
  385. package/lib/provider/worktree-lifecycle.js.map +1 -0
  386. package/lib/typert.host.js +269 -30
  387. package/lib/typert.remote-client.d.ts +10 -0
  388. package/lib/typert.remote-client.d.ts.map +1 -1
  389. package/lib/typert.remote-client.js +269 -30
  390. package/package.json +1 -1
  391. package/lib/client/WorktreeContext.d.ts.map +0 -1
  392. package/lib/client/WorktreeContext.js.map +0 -1
  393. package/lib/client/WorktreeHeroContext.d.ts.map +0 -1
  394. package/lib/client/WorktreeHeroContext.js.map +0 -1
  395. package/lib/client/WorktreeModeAction.d.ts.map +0 -1
  396. package/lib/client/WorktreeModeAction.js.map +0 -1
  397. package/lib/client/WorktreeOverlay.d.ts.map +0 -1
  398. package/lib/client/WorktreeOverlay.js.map +0 -1
  399. package/lib/client/dsh-rc1-slot-contract.d.ts +0 -43
  400. package/lib/client/dsh-rc1-slot-contract.d.ts.map +0 -1
  401. package/lib/client/dsh-rc1-slot-contract.js +0 -2
  402. package/lib/client/dsh-rc1-slot-contract.js.map +0 -1
  403. package/lib/client/navigation.d.ts.map +0 -1
  404. package/lib/client/navigation.js.map +0 -1
  405. package/lib/client/overlay-bounds.d.ts.map +0 -1
  406. package/lib/client/overlay-bounds.js.map +0 -1
  407. package/lib/client/session-view.d.ts.map +0 -1
  408. package/lib/client/session-view.js.map +0 -1
  409. package/lib/client/sidebar-overlay-geometry.d.ts.map +0 -1
  410. package/lib/client/sidebar-overlay-geometry.js.map +0 -1
  411. package/lib/client/view-mode-store.d.ts.map +0 -1
  412. package/lib/client/view-mode-store.js.map +0 -1
  413. package/lib/client/view-mode.d.ts.map +0 -1
  414. package/lib/client/view-mode.js.map +0 -1
  415. package/lib/client/virtual-workspace-membership.d.ts.map +0 -1
  416. package/lib/client/virtual-workspace-membership.js.map +0 -1
  417. package/lib/client/worktree-context-store.d.ts.map +0 -1
  418. package/lib/client/worktree-context-store.js.map +0 -1
  419. package/lib/client/worktree-context.d.ts.map +0 -1
  420. package/lib/client/worktree-context.js.map +0 -1
  421. package/lib/client/worktree-error-copy.d.ts.map +0 -1
  422. package/lib/client/worktree-error-copy.js.map +0 -1
  423. package/lib/client/worktree-expand-state.d.ts.map +0 -1
  424. package/lib/client/worktree-expand-state.js.map +0 -1
  425. package/lib/client/worktree-permission-icon.d.ts.map +0 -1
  426. package/lib/client/worktree-permission-icon.js.map +0 -1
  427. package/lib/client/worktree-permission.d.ts.map +0 -1
  428. package/lib/client/worktree-permission.js.map +0 -1
  429. package/lib/client/worktree-session-fork.d.ts.map +0 -1
  430. package/lib/client/worktree-session-fork.js.map +0 -1
  431. package/lib/client/worktree-session-order.d.ts.map +0 -1
  432. package/lib/client/worktree-session-order.js.map +0 -1
  433. package/lib/client/worktree-session-position.d.ts.map +0 -1
  434. package/lib/client/worktree-session-position.js.map +0 -1
  435. package/lib/client/worktree-session.d.ts.map +0 -1
  436. package/lib/client/worktree-session.js.map +0 -1
  437. package/lib/client/worktree-surface-dialogs.d.ts.map +0 -1
  438. package/lib/client/worktree-surface-dialogs.js.map +0 -1
  439. package/lib/client/worktree-surface-rows.d.ts.map +0 -1
  440. package/lib/client/worktree-surface-rows.js.map +0 -1
  441. package/lib/client/worktree-surface-selectors.d.ts.map +0 -1
  442. package/lib/client/worktree-surface-selectors.js.map +0 -1
  443. package/lib/client/worktree-surface-types.d.ts.map +0 -1
  444. package/lib/client/worktree-surface-types.js +0 -2
  445. package/lib/client/worktree-surface-types.js.map +0 -1
  446. package/lib/client/worktree-view-actions.d.ts.map +0 -1
  447. package/lib/client/worktree-view-actions.js.map +0 -1
  448. package/lib/client/worktree-view-errors.d.ts.map +0 -1
  449. package/lib/client/worktree-view-errors.js.map +0 -1
  450. package/lib/client/worktree-view-read.d.ts.map +0 -1
  451. package/lib/client/worktree-view-read.js.map +0 -1
  452. package/lib/client/worktree-view.d.ts.map +0 -1
  453. package/lib/client/worktree-view.js.map +0 -1
  454. package/lib/provider/git.d.ts.map +0 -1
  455. package/lib/provider/git.js.map +0 -1
  456. package/lib/provider/mutation-lock.d.ts.map +0 -1
  457. package/lib/provider/mutation-lock.js.map +0 -1
  458. package/lib/provider/repository-fingerprint.d.ts.map +0 -1
  459. package/lib/provider/repository-fingerprint.js.map +0 -1
  460. package/lib/provider/sidecar-persistence.d.ts.map +0 -1
  461. package/lib/provider/sidecar-persistence.js.map +0 -1
  462. package/lib/provider/sidecar-schema.d.ts.map +0 -1
  463. package/lib/provider/sidecar-schema.js.map +0 -1
  464. package/lib/provider/sidecar.d.ts.map +0 -1
  465. package/lib/provider/sidecar.js.map +0 -1
  466. package/lib/provider/subprocess.d.ts.map +0 -1
  467. package/lib/provider/subprocess.js.map +0 -1
  468. package/lib/provider/transaction.d.ts +0 -65
  469. package/lib/provider/transaction.d.ts.map +0 -1
  470. package/lib/provider/transaction.js +0 -1011
  471. package/lib/provider/transaction.js.map +0 -1
  472. /package/lib/client/{WorktreeContext.js → context/WorktreeContext.js} +0 -0
  473. /package/lib/client/{WorktreeHeroContext.js → context/WorktreeHeroContext.js} +0 -0
  474. /package/lib/client/{overlay-bounds.d.ts → overlay/overlay-bounds.d.ts} +0 -0
  475. /package/lib/client/{overlay-bounds.js → overlay/overlay-bounds.js} +0 -0
  476. /package/lib/client/{sidebar-overlay-geometry.d.ts → overlay/sidebar-overlay-geometry.d.ts} +0 -0
  477. /package/lib/client/{sidebar-overlay-geometry.js → overlay/sidebar-overlay-geometry.js} +0 -0
  478. /package/lib/client/{worktree-permission-icon.d.ts → permission/worktree-permission-icon.d.ts} +0 -0
  479. /package/lib/client/{worktree-permission-icon.js → permission/worktree-permission-icon.js} +0 -0
  480. /package/lib/client/{worktree-permission.d.ts → permission/worktree-permission.d.ts} +0 -0
  481. /package/lib/client/{worktree-permission.js → permission/worktree-permission.js} +0 -0
  482. /package/lib/client/{session-view.d.ts → session/session-view.d.ts} +0 -0
  483. /package/lib/client/{session-view.js → session/session-view.js} +0 -0
  484. /package/lib/client/{worktree-session-order.d.ts → session/worktree-session-order.d.ts} +0 -0
  485. /package/lib/client/{worktree-session-order.js → session/worktree-session-order.js} +0 -0
  486. /package/lib/client/{worktree-session-position.d.ts → session/worktree-session-position.d.ts} +0 -0
  487. /package/lib/client/{worktree-session-position.js → session/worktree-session-position.js} +0 -0
  488. /package/lib/client/{navigation.d.ts → view/navigation.d.ts} +0 -0
  489. /package/lib/client/{navigation.js → view/navigation.js} +0 -0
  490. /package/lib/client/{view-mode-store.d.ts → view/view-mode-store.d.ts} +0 -0
  491. /package/lib/client/{view-mode-store.js → view/view-mode-store.js} +0 -0
  492. /package/lib/client/{view-mode.d.ts → view/view-mode.d.ts} +0 -0
  493. /package/lib/client/{view-mode.js → view/view-mode.js} +0 -0
  494. /package/lib/client/{worktree-error-copy.js → view/worktree-error-copy.js} +0 -0
  495. /package/lib/client/{worktree-view-errors.d.ts → view/worktree-view-errors.d.ts} +0 -0
  496. /package/lib/client/{worktree-view-errors.js → view/worktree-view-errors.js} +0 -0
  497. /package/lib/client/{worktree-view.d.ts → view/worktree-view.d.ts} +0 -0
  498. /package/lib/client/{worktree-view.js → view/worktree-view.js} +0 -0
  499. /package/lib/provider/{repository-fingerprint.js → git/repository-fingerprint.js} +0 -0
  500. /package/lib/provider/{subprocess.js → git/subprocess.js} +0 -0
  501. /package/lib/provider/{mutation-lock.d.ts → sidecar/mutation-lock.d.ts} +0 -0
@@ -0,0 +1,68 @@
1
+ import { useEffect, useMemo } from 'react';
2
+ import { filterVisibleSessionIds } from '../../session/session-view.js';
3
+ import { unboundSessionIds, workspaceSessionIds } from '../../view/view-mode.js';
4
+ import { nextSessionOrderAccount, } from '../../session/worktree-session-order.js';
5
+ import { filterArchivedSessionIds } from '../../view/worktree-view.js';
6
+ import { bindingIdsFor } from '../selectors.js';
7
+ import { updatedAtById } from '../shared.js';
8
+ export function useSessionOrdering({ read, source, props }) {
9
+ const { readState, viewByWorkspace } = read;
10
+ const { workspaces, sessions, archivedSessionIds, sessionOrderSnapshot, mode } = source;
11
+ const { sessionOrder } = props;
12
+ const sessionOrderInputs = useMemo(() => {
13
+ if (readState.status !== 'ready')
14
+ return [];
15
+ const inputs = [];
16
+ for (const workspace of workspaces.items) {
17
+ const view = viewByWorkspace.get(workspace.workspaceId);
18
+ const allWorkspaceSessionIds = filterArchivedSessionIds(workspaceSessionIds(workspaces, workspace.workspaceId, sessions.ids), archivedSessionIds);
19
+ const bindings = view?.bindings ?? [];
20
+ const boundSessionIds = new Set(bindings.map((binding) => binding.sessionId));
21
+ const mainSessionIds = filterVisibleSessionIds(unboundSessionIds(allWorkspaceSessionIds, [...boundSessionIds]), sessions);
22
+ inputs.push({
23
+ accountKey: `main:${workspace.workspaceId}`,
24
+ sessionIds: mainSessionIds,
25
+ updatedAtById: updatedAtById(mainSessionIds, sessions),
26
+ });
27
+ for (const record of view?.worktrees ?? []) {
28
+ const worktreeSessionIds = filterVisibleSessionIds(filterArchivedSessionIds(bindingIdsFor(bindings, record.worktreeId).filter((sessionId) => sessions.ids.includes(sessionId)), archivedSessionIds), sessions);
29
+ inputs.push({
30
+ accountKey: `worktree:${record.worktreeId}`,
31
+ sessionIds: worktreeSessionIds,
32
+ updatedAtById: updatedAtById(worktreeSessionIds, sessions),
33
+ });
34
+ }
35
+ }
36
+ return inputs;
37
+ }, [
38
+ archivedSessionIds,
39
+ readState.status,
40
+ sessions.byId,
41
+ sessions.ids,
42
+ viewByWorkspace,
43
+ workspaces,
44
+ workspaces.items,
45
+ ]);
46
+ const orderedSessionIdsByAccount = useMemo(() => {
47
+ const ordered = new Map();
48
+ for (const input of sessionOrderInputs) {
49
+ const previous = sessionOrderSnapshot.accounts[input.accountKey];
50
+ ordered.set(input.accountKey, nextSessionOrderAccount({
51
+ baseIds: input.sessionIds,
52
+ updatedAtById: input.updatedAtById,
53
+ previous,
54
+ }).order);
55
+ }
56
+ return ordered;
57
+ }, [sessionOrderInputs, sessionOrderSnapshot]);
58
+ useEffect(() => {
59
+ if (mode !== 'worktree' || readState.status !== 'ready')
60
+ return;
61
+ for (const input of sessionOrderInputs) {
62
+ sessionOrder.actions.reconcile(input.accountKey, input.sessionIds, input.updatedAtById);
63
+ }
64
+ sessionOrder.actions.retain(sessionOrderInputs.map((input) => input.accountKey));
65
+ }, [mode, readState.status, sessionOrder, sessionOrderInputs]);
66
+ return { sessionOrderInputs, orderedSessionIdsByAccount };
67
+ }
68
+ //# sourceMappingURL=useSessionOrdering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSessionOrdering.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useSessionOrdering.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EACL,uBAAuB,GAExB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAqB,aAAa,EAAE,MAAM,cAAc,CAAC;AAchE,MAAM,UAAU,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAS;IAC/D,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IAC5C,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxF,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,kBAAkB,GAAG,OAAO,CAA+B,GAAG,EAAE;QACpE,IAAI,SAAS,CAAC,MAAM,KAAK,OAAO;YAAE,OAAO,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAwB,EAAE,CAAC;QACvC,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACxD,MAAM,sBAAsB,GAAG,wBAAwB,CACrD,mBAAmB,CAAC,UAAU,EAAE,SAAS,CAAC,WAAW,EAAE,QAAQ,CAA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OpenWorkspaceMenuId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
4
+ openMainMenuId: string | undefined;
5
+ setOpenMainMenuId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
6
+ openWorktreeMenuId: string | undefined;
7
+ setOpenWorktreeMenuId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
8
+ };
9
+ //# sourceMappingURL=useSurfaceMenus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceMenus.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useSurfaceMenus.tsx"],"names":[],"mappings":"AAEA,wBAAgB,eAAe;;;;;;;EAY9B"}
@@ -0,0 +1,15 @@
1
+ import { useState } from 'react';
2
+ export function useSurfaceMenus() {
3
+ const [openWorkspaceMenuId, setOpenWorkspaceMenuId] = useState();
4
+ const [openMainMenuId, setOpenMainMenuId] = useState();
5
+ const [openWorktreeMenuId, setOpenWorktreeMenuId] = useState();
6
+ return {
7
+ openWorkspaceMenuId,
8
+ setOpenWorkspaceMenuId,
9
+ openMainMenuId,
10
+ setOpenMainMenuId,
11
+ openWorktreeMenuId,
12
+ setOpenWorktreeMenuId,
13
+ };
14
+ }
15
+ //# sourceMappingURL=useSurfaceMenus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceMenus.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useSurfaceMenus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,EAAU,CAAC;IACzE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAAU,CAAC;IAC/D,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,EAAU,CAAC;IACvE,OAAO;QACL,mBAAmB;QACnB,sBAAsB;QACtB,cAAc;QACd,iBAAiB;QACjB,kBAAkB;QAClB,qBAAqB;KACtB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { ReadState, RefreshOptions, WorktreeSurfaceProps } from '../types.js';
2
+ import type { useRegistrationState } from './useRegistrationState.js';
3
+ import type { useSurfaceSources } from './useSurfaceSources.js';
4
+ type Input = {
5
+ source: Pick<ReturnType<typeof useSurfaceSources>, 'forkRecoverySnapshot' | 'workspaceIdsRef' | 'mode' | 'workspaceIds' | 'sessionPresentations'>;
6
+ props: Pick<WorktreeSurfaceProps, 'manager' | 'viewReader' | 'invalidateWorktreeContext' | 'syncSessionWorkspaces'>;
7
+ registrationState: Pick<ReturnType<typeof useRegistrationState>, 'modalReadViewRef' | 'setModalReadError' | 'setModalReadLoading' | 'modalReadLoader' | 'setWorktreeModalWorkspaceId'>;
8
+ };
9
+ export declare function useSurfaceRefresh({ source, props, registrationState }: Input): {
10
+ readState: ReadState;
11
+ setReadState: import("react").Dispatch<import("react").SetStateAction<ReadState>>;
12
+ readStateRef: import("react").MutableRefObject<ReadState>;
13
+ refreshGuard: import("react").MutableRefObject<{
14
+ begin: () => number;
15
+ isCurrent: (generation: number) => boolean;
16
+ invalidate: () => void;
17
+ run<T>(load: () => Promise<T>, onSuccess: (value: T) => void, onError: (error: unknown) => void): Promise<void>;
18
+ }>;
19
+ targetRefreshGuards: import("react").MutableRefObject<Map<string, {
20
+ begin: () => number;
21
+ isCurrent: (generation: number) => boolean;
22
+ invalidate: () => void;
23
+ run<T>(load: () => Promise<T>, onSuccess: (value: T) => void, onError: (error: unknown) => void): Promise<void>;
24
+ }>>;
25
+ forkRecoveryRevisionRef: import("react").MutableRefObject<number>;
26
+ guardFor: (workspaceId: string) => {
27
+ begin: () => number;
28
+ isCurrent: (generation: number) => boolean;
29
+ invalidate: () => void;
30
+ run<T>(load: () => Promise<T>, onSuccess: (value: T) => void, onError: (error: unknown) => void): Promise<void>;
31
+ };
32
+ refresh: (options?: RefreshOptions) => Promise<void>;
33
+ loadModalWorktreeView: (workspaceId: string) => void;
34
+ previousWorkspaceIdsRef: import("react").MutableRefObject<readonly string[]>;
35
+ viewByWorkspace: Map<string, import("../../view/worktree-view-read.js").WorktreeWorkspaceView>;
36
+ previousActivityRef: import("react").MutableRefObject<Readonly<Record<string, import("../../session/session-view.js").SessionPresentation>>>;
37
+ };
38
+ export {};
39
+ //# sourceMappingURL=useSurfaceRefresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceRefresh.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useSurfaceRefresh.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,IAAI,CACV,UAAU,CAAC,OAAO,iBAAiB,CAAC,EACpC,sBAAsB,GAAG,iBAAiB,GAAG,MAAM,GAAG,cAAc,GAAG,sBAAsB,CAC9F,CAAC;IACF,KAAK,EAAE,IAAI,CACT,oBAAoB,EACpB,SAAS,GAAG,YAAY,GAAG,2BAA2B,GAAG,uBAAuB,CACjF,CAAC;IACF,iBAAiB,EAAE,IAAI,CACrB,UAAU,CAAC,OAAO,oBAAoB,CAAC,EACrC,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,iBAAiB,GACjB,6BAA6B,CAChC,CAAC;CACH,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,KAAK;;;;;;;;;;;;;;;;;4BAmB5C,MAAM;;;;;;wBAQnB,cAAc,KAAQ,OAAO,CAAC,IAAI,CAAC;yCA6HrC,MAAM,KAAG,IAAI;;;;EA0J9B"}
@@ -0,0 +1,274 @@
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
+ import { createWorktreeRefreshGuard, mergeWorktreeView, mergeWorktreeViews, toWorktreeViewError, } from '../../view/worktree-view.js';
3
+ import { worktreeActivityRefreshWorkspaceIds } from '../selectors.js';
4
+ import { EMPTY_READ_STATE } from '../shared.js';
5
+ export function useSurfaceRefresh({ source, props, registrationState }) {
6
+ const { forkRecoverySnapshot, workspaceIdsRef, mode, workspaceIds, sessionPresentations } = source;
7
+ const { manager, viewReader, invalidateWorktreeContext, syncSessionWorkspaces } = props;
8
+ const { modalReadViewRef, setModalReadError, setModalReadLoading, modalReadLoader, setWorktreeModalWorkspaceId, } = registrationState;
9
+ const [readState, setReadState] = useState(EMPTY_READ_STATE);
10
+ const readStateRef = useRef(readState);
11
+ readStateRef.current = readState;
12
+ const refreshGuard = useRef(createWorktreeRefreshGuard());
13
+ const targetRefreshGuards = useRef(new Map());
14
+ const forkRecoveryRevisionRef = useRef(forkRecoverySnapshot.revision);
15
+ const guardFor = (workspaceId) => {
16
+ const current = targetRefreshGuards.current.get(workspaceId);
17
+ if (current !== undefined)
18
+ return current;
19
+ const created = createWorktreeRefreshGuard();
20
+ targetRefreshGuards.current.set(workspaceId, created);
21
+ return created;
22
+ };
23
+ const refresh = useCallback(async (options = {}) => {
24
+ if (manager === undefined) {
25
+ refreshGuard.current.invalidate();
26
+ for (const guard of targetRefreshGuards.current.values())
27
+ guard.invalidate();
28
+ setReadState(EMPTY_READ_STATE);
29
+ return;
30
+ }
31
+ const scope = options.scope ?? { kind: 'global' };
32
+ const preserveCurrent = options.preserveCurrent === true;
33
+ const currentWorkspaceIds = workspaceIdsRef.current;
34
+ if (scope.kind === 'global') {
35
+ if (!preserveCurrent) {
36
+ setReadState({ status: 'loading', views: [] });
37
+ }
38
+ const selectedWorkspaceIds = [...currentWorkspaceIds];
39
+ for (const workspaceId of selectedWorkspaceIds) {
40
+ viewReader.invalidate(workspaceId);
41
+ }
42
+ const contextRefresh = options.invalidateContext === false ? undefined : invalidateWorktreeContext?.();
43
+ await refreshGuard.current.run(async () => {
44
+ const [views] = await Promise.all([
45
+ viewReader.readMany(selectedWorkspaceIds),
46
+ contextRefresh ?? Promise.resolve(),
47
+ ]);
48
+ return views;
49
+ }, (views) => {
50
+ setReadState((current) => {
51
+ const merged = mergeWorktreeViews(current.views, workspaceIdsRef.current, views);
52
+ return {
53
+ status: 'ready',
54
+ views: modalReadViewRef.current === undefined
55
+ ? merged
56
+ : mergeWorktreeView(merged, modalReadViewRef.current),
57
+ };
58
+ });
59
+ }, (error) => {
60
+ if (preserveCurrent)
61
+ throw error;
62
+ setReadState({
63
+ status: 'error',
64
+ views: modalReadViewRef.current === undefined ? [] : [modalReadViewRef.current],
65
+ error: toWorktreeViewError(error),
66
+ });
67
+ });
68
+ return;
69
+ }
70
+ const requestedWorkspaceIds = scope.kind === 'workspace' ? [scope.workspaceId] : scope.workspaceIds;
71
+ const selectedWorkspaceIds = [...new Set(requestedWorkspaceIds)].filter((workspaceId) => currentWorkspaceIds.includes(workspaceId));
72
+ if (selectedWorkspaceIds.length === 0)
73
+ return;
74
+ await Promise.allSettled(selectedWorkspaceIds.map(async (workspaceId) => {
75
+ const guard = guardFor(workspaceId);
76
+ viewReader.invalidate(workspaceId, { reuseInFlight: options.reuseInFlight });
77
+ const contextRefresh = options.invalidateContext === false
78
+ ? undefined
79
+ : invalidateWorktreeContext?.(workspaceId);
80
+ const generation = guard.begin();
81
+ try {
82
+ const view = await viewReader.read(workspaceId);
83
+ if (!guard.isCurrent(generation))
84
+ return;
85
+ if (!workspaceIdsRef.current.includes(workspaceId))
86
+ return;
87
+ setReadState((current) => {
88
+ const remainingTargetError = current.targetError?.workspaceIds.filter((candidate) => candidate !== workspaceId) ?? [];
89
+ const next = {
90
+ ...current,
91
+ status: 'ready',
92
+ views: mergeWorktreeViews(current.views, workspaceIdsRef.current, [view]),
93
+ error: undefined,
94
+ };
95
+ if (remainingTargetError.length === 0) {
96
+ const withoutTargetError = { ...next };
97
+ delete withoutTargetError.targetError;
98
+ return withoutTargetError;
99
+ }
100
+ return {
101
+ ...next,
102
+ targetError: {
103
+ workspaceIds: remainingTargetError,
104
+ error: current.targetError.error,
105
+ },
106
+ };
107
+ });
108
+ }
109
+ catch (error) {
110
+ if (!guard.isCurrent(generation))
111
+ return;
112
+ if (!workspaceIdsRef.current.includes(workspaceId))
113
+ return;
114
+ setReadState((current) => {
115
+ const previousIds = current.targetError?.workspaceIds ?? [];
116
+ return {
117
+ ...current,
118
+ status: 'ready',
119
+ views: mergeWorktreeViews(current.views, workspaceIdsRef.current, []),
120
+ error: undefined,
121
+ targetError: {
122
+ workspaceIds: [...new Set([...previousIds, workspaceId])],
123
+ error: {
124
+ ...toWorktreeViewError(error),
125
+ retryable: true,
126
+ },
127
+ },
128
+ };
129
+ });
130
+ }
131
+ finally {
132
+ await contextRefresh?.catch(() => undefined);
133
+ }
134
+ }));
135
+ }, [invalidateWorktreeContext, manager, viewReader]);
136
+ const loadModalWorktreeView = useCallback((workspaceId) => {
137
+ setModalReadError(undefined);
138
+ setModalReadLoading(true);
139
+ if (manager === undefined) {
140
+ setModalReadLoading(false);
141
+ setModalReadError({
142
+ code: 'WORKTREE_VIEW_UNAVAILABLE',
143
+ message: '',
144
+ retryable: true,
145
+ });
146
+ return;
147
+ }
148
+ void modalReadLoader.current.load(workspaceId, (view) => {
149
+ modalReadViewRef.current = view;
150
+ setModalReadLoading(false);
151
+ setReadState((current) => ({
152
+ ...current,
153
+ views: mergeWorktreeView(current.views, view),
154
+ }));
155
+ }, (error) => {
156
+ setModalReadLoading(false);
157
+ setModalReadError(toWorktreeViewError(error));
158
+ });
159
+ }, [manager, viewReader]);
160
+ useEffect(() => {
161
+ if (mode === 'worktree') {
162
+ void refresh({ preserveCurrent: readStateRef.current.status === 'ready' });
163
+ }
164
+ else {
165
+ refreshGuard.current.invalidate();
166
+ for (const guard of targetRefreshGuards.current.values())
167
+ guard.invalidate();
168
+ modalReadLoader.current.invalidate();
169
+ modalReadViewRef.current = undefined;
170
+ setWorktreeModalWorkspaceId(undefined);
171
+ setModalReadError(undefined);
172
+ setModalReadLoading(false);
173
+ setReadState(EMPTY_READ_STATE);
174
+ }
175
+ }, [mode, refresh]);
176
+ const previousWorkspaceIdsRef = useRef(workspaceIds);
177
+ useEffect(() => {
178
+ const previousWorkspaceIds = previousWorkspaceIdsRef.current;
179
+ previousWorkspaceIdsRef.current = workspaceIds;
180
+ if (mode !== 'worktree')
181
+ return;
182
+ const addedWorkspaceIds = workspaceIds.filter((workspaceId) => !previousWorkspaceIds.includes(workspaceId));
183
+ const removedWorkspaceIds = previousWorkspaceIds.filter((workspaceId) => !workspaceIds.includes(workspaceId));
184
+ for (const workspaceId of removedWorkspaceIds) {
185
+ targetRefreshGuards.current.delete(workspaceId);
186
+ }
187
+ setReadState((current) => {
188
+ const views = mergeWorktreeViews(current.views, workspaceIds, []);
189
+ const remainingTargetError = current.targetError?.workspaceIds.filter((workspaceId) => workspaceIds.includes(workspaceId)) ?? [];
190
+ const next = { ...current, views };
191
+ if (remainingTargetError.length === 0) {
192
+ const withoutTargetError = { ...next };
193
+ delete withoutTargetError.targetError;
194
+ return withoutTargetError;
195
+ }
196
+ return {
197
+ ...next,
198
+ targetError: {
199
+ workspaceIds: remainingTargetError,
200
+ error: current.targetError.error,
201
+ },
202
+ };
203
+ });
204
+ for (const workspaceId of addedWorkspaceIds) {
205
+ void refresh({
206
+ scope: { kind: 'workspace', workspaceId },
207
+ preserveCurrent: true,
208
+ }).catch(() => {
209
+ // The target error remains visible and can be retried explicitly.
210
+ });
211
+ }
212
+ }, [mode, refresh, workspaceIds]);
213
+ useEffect(() => {
214
+ if (forkRecoveryRevisionRef.current === forkRecoverySnapshot.revision)
215
+ return;
216
+ forkRecoveryRevisionRef.current = forkRecoverySnapshot.revision;
217
+ if (mode !== 'worktree' || manager === undefined)
218
+ return;
219
+ if (forkRecoverySnapshot.affectedWorkspaceIds.length === 0)
220
+ return;
221
+ void refresh({
222
+ scope: {
223
+ kind: 'workspaces',
224
+ workspaceIds: forkRecoverySnapshot.affectedWorkspaceIds,
225
+ },
226
+ preserveCurrent: readStateRef.current.status === 'ready',
227
+ }).catch(() => {
228
+ // Recovery state remains visible; the next explicit retry can refresh it again.
229
+ });
230
+ }, [
231
+ forkRecoverySnapshot.affectedWorkspaceIds,
232
+ forkRecoverySnapshot.revision,
233
+ manager,
234
+ mode,
235
+ refresh,
236
+ ]);
237
+ useEffect(() => {
238
+ if (readState.status !== 'ready' || syncSessionWorkspaces === undefined)
239
+ return;
240
+ syncSessionWorkspaces(readState.views.flatMap((view) => view.bindings.map((binding) => ({
241
+ workspaceId: binding.workspaceId,
242
+ sessionId: binding.sessionId,
243
+ }))));
244
+ }, [readState.status, readState.views, syncSessionWorkspaces]);
245
+ const viewByWorkspace = useMemo(() => new Map(readState.views.map((view) => [view.workspaceId, view])), [readState.views]);
246
+ const previousActivityRef = useRef(sessionPresentations);
247
+ useEffect(() => {
248
+ const previous = previousActivityRef.current;
249
+ previousActivityRef.current = sessionPresentations;
250
+ if (mode !== 'worktree')
251
+ return;
252
+ const affected = worktreeActivityRefreshWorkspaceIds(readStateRef.current.views, previous, sessionPresentations);
253
+ if (affected.length > 0)
254
+ void refresh({
255
+ scope: { kind: 'workspaces', workspaceIds: affected },
256
+ preserveCurrent: true,
257
+ });
258
+ }, [mode, refresh, sessionPresentations]);
259
+ return {
260
+ readState,
261
+ setReadState,
262
+ readStateRef,
263
+ refreshGuard,
264
+ targetRefreshGuards,
265
+ forkRecoveryRevisionRef,
266
+ guardFor,
267
+ refresh,
268
+ loadModalWorktreeView,
269
+ previousWorkspaceIdsRef,
270
+ viewByWorkspace,
271
+ previousActivityRef,
272
+ };
273
+ }
274
+ //# sourceMappingURL=useSurfaceRefresh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceRefresh.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useSurfaceRefresh.tsx"],"names":[],"mappings":"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C;QACnD,IAAI,IAAI,KAAK,UAAU;YAAE,OAAO;QAChC,MAAM,QAAQ,GAAG,mCAAmC,CAClD,YAAY,CAAC,OAAO,CAAC,KAAK,EAC1B,QAAQ,EACR,oBAAoB,CACrB,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACrB,KAAK,OAAO,CAAC;gBACX,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE;gBACrD,eAAe,EAAE,IAAI;aACtB,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAC1C,OAAO;QACL,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,mBAAmB;QACnB,uBAAuB;QACvB,QAAQ;QACR,OAAO;QACP,qBAAqB;QACrB,uBAAuB;QACvB,eAAe;QACf,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type SessionListLike } from '../../session/session-view.js';
2
+ import type { WorkspaceListLike, WorktreeSurfaceProps } from '../types.js';
3
+ type Input = {
4
+ props: Pick<WorktreeSurfaceProps, 'useStore' | 'available' | 'manager' | 'useSessions' | 'useWorkspaces' | 'forkRecovery' | 'expandState' | 'permissionNotice' | 'fullAccessConfirmation' | 'sessionOrder'>;
5
+ };
6
+ export declare function useSurfaceSources({ props }: Input): {
7
+ preferredMode: import("../../view/view-mode.js").WorktreeViewMode;
8
+ mode: import("../../view/view-mode.js").WorktreeViewMode;
9
+ sessions: SessionListLike;
10
+ workspaces: WorkspaceListLike;
11
+ forkRecoveryStore: import("../../session/worktree-session-fork.js").WorktreeForkRecoveryStore;
12
+ forkRecoverySnapshot: import("../../session/worktree-session-fork.js").WorktreeForkRecoverySnapshot;
13
+ currentSessionId: string | undefined;
14
+ workspaceIds: readonly string[];
15
+ workspaceIdsRef: import("react").MutableRefObject<readonly string[]>;
16
+ expandSnapshot: import("../../view/worktree-expand-state.js").WorktreeExpandState;
17
+ permissionNoticeSnapshot: import("../types.js").WorktreePermissionNotice | undefined;
18
+ fullAccessConfirmationSnapshot: import("../../index.js").WorktreeFullAccessConfirmationInput | undefined;
19
+ fullAccessConfirmationKey: string;
20
+ fullAccessAcknowledged: boolean;
21
+ setFullAccessAcknowledged: import("react").Dispatch<import("react").SetStateAction<boolean>>;
22
+ sessionOrderSnapshot: import("../../session/worktree-session-order.js").WorktreeSessionOrderState;
23
+ sessionPresentations: Readonly<Record<string, import("../../session/session-view.js").SessionPresentation>>;
24
+ ref: import("react").RefObject<HTMLDivElement>;
25
+ width: number;
26
+ bounds: import("../../overlay/overlay-bounds.js").OverlayBounds;
27
+ collapsed: boolean;
28
+ archivedSessionIds: readonly string[];
29
+ };
30
+ export {};
31
+ //# sourceMappingURL=useSurfaceSources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceSources.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useSurfaceSources.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAWrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE3E,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,IAAI,CACT,oBAAoB,EAClB,UAAU,GACV,WAAW,GACX,SAAS,GACT,aAAa,GACb,eAAe,GACf,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,wBAAwB,GACxB,cAAc,CACjB,CAAC;CACH,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;EA2FjD"}
@@ -0,0 +1,63 @@
1
+ import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
2
+ import { deriveSessionPresentationIndex } from '../../session/session-view.js';
3
+ import { useSidebarOverlayGeometry } from '../../overlay/sidebar-overlay-geometry.js';
4
+ import { effectiveViewMode } from '../../view/view-mode.js';
5
+ import { EMPTY_FORK_RECOVERY_STORE, EMPTY_FULL_ACCESS_CONFIRMATION_SNAPSHOT, EMPTY_FULL_ACCESS_CONFIRMATION_SUBSCRIBE, EMPTY_PERMISSION_NOTICE_SNAPSHOT, EMPTY_PERMISSION_NOTICE_SUBSCRIBE, useStableWorkspaceIds, } from '../shared.js';
6
+ export function useSurfaceSources({ props }) {
7
+ const { useStore, available, manager, useSessions, useWorkspaces, forkRecovery, expandState, permissionNotice, fullAccessConfirmation, sessionOrder, } = props;
8
+ const preferredMode = useStore((state) => state.viewMode);
9
+ const mode = effectiveViewMode(preferredMode, available && manager !== undefined);
10
+ const sessions = useSessions((state) => state);
11
+ const workspaces = useWorkspaces((state) => state);
12
+ const forkRecoveryStore = forkRecovery ?? EMPTY_FORK_RECOVERY_STORE;
13
+ const forkRecoverySnapshot = useSyncExternalStore(forkRecoveryStore.subscribe, forkRecoveryStore.getSnapshot, forkRecoveryStore.getSnapshot);
14
+ const currentSessionId = sessions.current;
15
+ const workspaceIds = useStableWorkspaceIds(workspaces.items);
16
+ const workspaceIdsRef = useRef(workspaceIds);
17
+ workspaceIdsRef.current = workspaceIds;
18
+ const expandSnapshot = useSyncExternalStore(expandState.subscribe, expandState.getSnapshot, expandState.getSnapshot);
19
+ const permissionNoticeSnapshot = useSyncExternalStore(permissionNotice?.subscribe ?? EMPTY_PERMISSION_NOTICE_SUBSCRIBE, permissionNotice?.getSnapshot ?? EMPTY_PERMISSION_NOTICE_SNAPSHOT, permissionNotice?.getSnapshot ?? EMPTY_PERMISSION_NOTICE_SNAPSHOT);
20
+ const fullAccessConfirmationSnapshot = useSyncExternalStore(fullAccessConfirmation?.subscribe ?? EMPTY_FULL_ACCESS_CONFIRMATION_SUBSCRIBE, fullAccessConfirmation?.getSnapshot ?? EMPTY_FULL_ACCESS_CONFIRMATION_SNAPSHOT, fullAccessConfirmation?.getSnapshot ?? EMPTY_FULL_ACCESS_CONFIRMATION_SNAPSHOT);
21
+ const fullAccessConfirmationKey = fullAccessConfirmationSnapshot === undefined
22
+ ? ''
23
+ : [
24
+ fullAccessConfirmationSnapshot.workspaceId,
25
+ fullAccessConfirmationSnapshot.worktreeId,
26
+ fullAccessConfirmationSnapshot.sessionId,
27
+ fullAccessConfirmationSnapshot.cwd,
28
+ ].join('\u0000');
29
+ const [fullAccessAcknowledged, setFullAccessAcknowledged] = useState(false);
30
+ useEffect(() => {
31
+ setFullAccessAcknowledged(false);
32
+ }, [fullAccessConfirmationKey]);
33
+ const sessionOrderSnapshot = useSyncExternalStore(sessionOrder.subscribe, sessionOrder.getSnapshot, sessionOrder.getSnapshot);
34
+ const sessionPresentations = useMemo(() => deriveSessionPresentationIndex(sessions), [sessions.byId]);
35
+ const { ref, width, bounds } = useSidebarOverlayGeometry(mode === 'worktree');
36
+ const collapsed = width <= 64;
37
+ const archivedSessionIds = workspaces.archivedSessionIds ?? [];
38
+ return {
39
+ preferredMode,
40
+ mode,
41
+ sessions,
42
+ workspaces,
43
+ forkRecoveryStore,
44
+ forkRecoverySnapshot,
45
+ currentSessionId,
46
+ workspaceIds,
47
+ workspaceIdsRef,
48
+ expandSnapshot,
49
+ permissionNoticeSnapshot,
50
+ fullAccessConfirmationSnapshot,
51
+ fullAccessConfirmationKey,
52
+ fullAccessAcknowledged,
53
+ setFullAccessAcknowledged,
54
+ sessionOrderSnapshot,
55
+ sessionPresentations,
56
+ ref,
57
+ width,
58
+ bounds,
59
+ collapsed,
60
+ archivedSessionIds,
61
+ };
62
+ }
63
+ //# sourceMappingURL=useSurfaceSources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceSources.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useSurfaceSources.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAwB,MAA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