@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.
- package/README.md +99 -23
- package/README.zh.md +75 -19
- package/lib/client/WorktreeSurface.d.ts +4 -7
- package/lib/client/WorktreeSurface.d.ts.map +1 -1
- package/lib/client/WorktreeSurface.js +44 -1419
- package/lib/client/WorktreeSurface.js.map +1 -1
- package/lib/client/{WorktreeContext.d.ts → context/WorktreeContext.d.ts} +1 -1
- package/lib/client/context/WorktreeContext.d.ts.map +1 -0
- package/lib/client/context/WorktreeContext.js.map +1 -0
- package/lib/client/{WorktreeHeroContext.d.ts → context/WorktreeHeroContext.d.ts} +1 -1
- package/lib/client/context/WorktreeHeroContext.d.ts.map +1 -0
- package/lib/client/context/WorktreeHeroContext.js.map +1 -0
- package/lib/client/{worktree-context-store.d.ts → context/worktree-context-store.d.ts} +1 -1
- package/lib/client/context/worktree-context-store.d.ts.map +1 -0
- package/lib/client/{worktree-context-store.js → context/worktree-context-store.js} +2 -2
- package/lib/client/context/worktree-context-store.js.map +1 -0
- package/lib/client/{worktree-context.d.ts → context/worktree-context.d.ts} +1 -1
- package/lib/client/context/worktree-context.d.ts.map +1 -0
- package/lib/client/{worktree-context.js → context/worktree-context.js} +5 -3
- package/lib/client/context/worktree-context.js.map +1 -0
- package/lib/client/entry.d.ts +1 -1
- package/lib/client/entry.d.ts.map +1 -1
- package/lib/client/entry.js +25 -13
- package/lib/client/entry.js.map +1 -1
- package/lib/client/index.d.ts +3 -3
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +2 -2
- package/lib/client/index.js.map +1 -1
- package/lib/client/locales.d.ts +66 -0
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +76 -10
- package/lib/client/locales.js.map +1 -1
- package/lib/client/{WorktreeOverlay.d.ts → overlay/WorktreeOverlay.d.ts} +2 -2
- package/lib/client/overlay/WorktreeOverlay.d.ts.map +1 -0
- package/lib/client/{WorktreeOverlay.js → overlay/WorktreeOverlay.js} +2 -2
- package/lib/client/overlay/WorktreeOverlay.js.map +1 -0
- package/lib/client/overlay/overlay-bounds.d.ts.map +1 -0
- package/lib/client/overlay/overlay-bounds.js.map +1 -0
- package/lib/client/overlay/sidebar-overlay-geometry.d.ts.map +1 -0
- package/lib/client/overlay/sidebar-overlay-geometry.js.map +1 -0
- package/lib/client/permission/worktree-permission-icon.d.ts.map +1 -0
- package/lib/client/permission/worktree-permission-icon.js.map +1 -0
- package/lib/client/permission/worktree-permission.d.ts.map +1 -0
- package/lib/client/permission/worktree-permission.js.map +1 -0
- package/lib/client/session/session-view.d.ts.map +1 -0
- package/lib/client/session/session-view.js.map +1 -0
- package/lib/client/{virtual-workspace-membership.d.ts → session/virtual-workspace-membership.d.ts} +1 -1
- package/lib/client/session/virtual-workspace-membership.d.ts.map +1 -0
- package/lib/client/{virtual-workspace-membership.js → session/virtual-workspace-membership.js} +1 -1
- package/lib/client/session/virtual-workspace-membership.js.map +1 -0
- package/lib/client/{worktree-session-fork.d.ts → session/worktree-session-fork.d.ts} +7 -1
- package/lib/client/session/worktree-session-fork.d.ts.map +1 -0
- package/lib/client/{worktree-session-fork.js → session/worktree-session-fork.js} +50 -4
- package/lib/client/session/worktree-session-fork.js.map +1 -0
- package/lib/client/session/worktree-session-order.d.ts.map +1 -0
- package/lib/client/session/worktree-session-order.js.map +1 -0
- package/lib/client/session/worktree-session-position.d.ts.map +1 -0
- package/lib/client/session/worktree-session-position.js.map +1 -0
- package/lib/client/{worktree-session.d.ts → session/worktree-session.d.ts} +3 -3
- package/lib/client/session/worktree-session.d.ts.map +1 -0
- package/lib/client/{worktree-session.js → session/worktree-session.js} +3 -3
- package/lib/client/session/worktree-session.js.map +1 -0
- package/lib/client/surface/actions/lifecycle-commands.d.ts +9 -0
- package/lib/client/surface/actions/lifecycle-commands.d.ts.map +1 -0
- package/lib/client/surface/actions/lifecycle-commands.js +243 -0
- package/lib/client/surface/actions/lifecycle-commands.js.map +1 -0
- package/lib/client/surface/actions/useDragActions.d.ts +26 -0
- package/lib/client/surface/actions/useDragActions.d.ts.map +1 -0
- package/lib/client/surface/actions/useDragActions.js +125 -0
- package/lib/client/surface/actions/useDragActions.js.map +1 -0
- package/lib/client/surface/actions/useLifecycleActions.d.ts +30 -0
- package/lib/client/surface/actions/useLifecycleActions.d.ts.map +1 -0
- package/lib/client/surface/actions/useLifecycleActions.js +140 -0
- package/lib/client/surface/actions/useLifecycleActions.js.map +1 -0
- package/lib/client/surface/actions/useNativeActions.d.ts +48 -0
- package/lib/client/surface/actions/useNativeActions.d.ts.map +1 -0
- package/lib/client/surface/actions/useNativeActions.js +182 -0
- package/lib/client/surface/actions/useNativeActions.js.map +1 -0
- package/lib/client/surface/actions/useSessionActions.d.ts +24 -0
- package/lib/client/surface/actions/useSessionActions.d.ts.map +1 -0
- package/lib/client/surface/actions/useSessionActions.js +116 -0
- package/lib/client/surface/actions/useSessionActions.js.map +1 -0
- package/lib/client/surface/actions/useSurfaceMutation.d.ts +15 -0
- package/lib/client/surface/actions/useSurfaceMutation.d.ts.map +1 -0
- package/lib/client/surface/actions/useSurfaceMutation.js +24 -0
- package/lib/client/surface/actions/useSurfaceMutation.js.map +1 -0
- package/lib/client/surface/actions/useWorktreeRegistration.d.ts +31 -0
- package/lib/client/surface/actions/useWorktreeRegistration.d.ts.map +1 -0
- package/lib/client/surface/actions/useWorktreeRegistration.js +203 -0
- package/lib/client/surface/actions/useWorktreeRegistration.js.map +1 -0
- package/lib/client/surface/actions/worktree-cleanup-flow.d.ts +10 -0
- package/lib/client/surface/actions/worktree-cleanup-flow.d.ts.map +1 -0
- package/lib/client/surface/actions/worktree-cleanup-flow.js +19 -0
- package/lib/client/surface/actions/worktree-cleanup-flow.js.map +1 -0
- package/lib/client/surface/components/AccessConfirmation.d.ts +9 -0
- package/lib/client/surface/components/AccessConfirmation.d.ts.map +1 -0
- package/lib/client/surface/components/AccessConfirmation.js +18 -0
- package/lib/client/surface/components/AccessConfirmation.js.map +1 -0
- package/lib/client/surface/components/ActiveWorktree.d.ts +28 -0
- package/lib/client/surface/components/ActiveWorktree.d.ts.map +1 -0
- package/lib/client/surface/components/ActiveWorktree.js +154 -0
- package/lib/client/surface/components/ActiveWorktree.js.map +1 -0
- package/lib/client/surface/components/ArchivedWorktree.d.ts +24 -0
- package/lib/client/surface/components/ArchivedWorktree.d.ts.map +1 -0
- package/lib/client/surface/components/ArchivedWorktree.js +145 -0
- package/lib/client/surface/components/ArchivedWorktree.js.map +1 -0
- package/lib/client/surface/components/ArchivedWorktrees.d.ts +25 -0
- package/lib/client/surface/components/ArchivedWorktrees.d.ts.map +1 -0
- package/lib/client/surface/components/ArchivedWorktrees.js +20 -0
- package/lib/client/surface/components/ArchivedWorktrees.js.map +1 -0
- package/lib/client/surface/components/LifecycleDialogs.d.ts +20 -0
- package/lib/client/surface/components/LifecycleDialogs.d.ts.map +1 -0
- package/lib/client/surface/components/LifecycleDialogs.js +31 -0
- package/lib/client/surface/components/LifecycleDialogs.js.map +1 -0
- package/lib/client/surface/components/NativeDialogs.d.ts +9 -0
- package/lib/client/surface/components/NativeDialogs.d.ts.map +1 -0
- package/lib/client/surface/components/NativeDialogs.js +14 -0
- package/lib/client/surface/components/NativeDialogs.js.map +1 -0
- package/lib/client/surface/components/NotificationToasts.d.ts +7 -0
- package/lib/client/surface/components/NotificationToasts.d.ts.map +1 -0
- package/lib/client/surface/components/NotificationToasts.js +24 -0
- package/lib/client/surface/components/NotificationToasts.js.map +1 -0
- package/lib/client/surface/components/RegistrationDialog.d.ts +15 -0
- package/lib/client/surface/components/RegistrationDialog.d.ts.map +1 -0
- package/lib/client/surface/components/RegistrationDialog.js +22 -0
- package/lib/client/surface/components/RegistrationDialog.js.map +1 -0
- package/lib/client/surface/components/SurfaceContent.d.ts +31 -0
- package/lib/client/surface/components/SurfaceContent.d.ts.map +1 -0
- package/lib/client/surface/components/SurfaceContent.js +65 -0
- package/lib/client/surface/components/SurfaceContent.js.map +1 -0
- package/lib/client/surface/components/SurfaceHeader.d.ts +15 -0
- package/lib/client/surface/components/SurfaceHeader.d.ts.map +1 -0
- package/lib/client/surface/components/SurfaceHeader.js +42 -0
- package/lib/client/surface/components/SurfaceHeader.js.map +1 -0
- package/lib/client/surface/components/WorkspaceTree.d.ts +32 -0
- package/lib/client/surface/components/WorkspaceTree.d.ts.map +1 -0
- package/lib/client/surface/components/WorkspaceTree.js +145 -0
- package/lib/client/surface/components/WorkspaceTree.js.map +1 -0
- package/lib/client/{worktree-surface-dialogs.d.ts → surface/components/dialogs.d.ts} +5 -2
- package/lib/client/surface/components/dialogs.d.ts.map +1 -0
- package/lib/client/{worktree-surface-dialogs.js → surface/components/dialogs.js} +67 -24
- package/lib/client/surface/components/dialogs.js.map +1 -0
- package/lib/client/{worktree-surface-rows.d.ts → surface/components/rows.d.ts} +3 -3
- package/lib/client/surface/components/rows.d.ts.map +1 -0
- package/lib/client/{worktree-surface-rows.js → surface/components/rows.js} +79 -17
- package/lib/client/surface/components/rows.js.map +1 -0
- package/lib/client/surface/notification-queue.d.ts +11 -0
- package/lib/client/surface/notification-queue.d.ts.map +1 -0
- package/lib/client/surface/notification-queue.js +19 -0
- package/lib/client/surface/notification-queue.js.map +1 -0
- package/lib/client/{worktree-surface-selectors.d.ts → surface/selectors.d.ts} +10 -5
- package/lib/client/surface/selectors.d.ts.map +1 -0
- package/lib/client/{worktree-surface-selectors.js → surface/selectors.js} +23 -6
- package/lib/client/surface/selectors.js.map +1 -0
- package/lib/client/surface/shared.d.ts +40 -0
- package/lib/client/surface/shared.d.ts.map +1 -0
- package/lib/client/surface/shared.js +53 -0
- package/lib/client/surface/shared.js.map +1 -0
- package/lib/client/surface/state/useLifecycleState.d.ts +34 -0
- package/lib/client/surface/state/useLifecycleState.d.ts.map +1 -0
- package/lib/client/surface/state/useLifecycleState.js +39 -0
- package/lib/client/surface/state/useLifecycleState.js.map +1 -0
- package/lib/client/surface/state/useRegistrationState.d.ts +34 -0
- package/lib/client/surface/state/useRegistrationState.d.ts.map +1 -0
- package/lib/client/surface/state/useRegistrationState.js +44 -0
- package/lib/client/surface/state/useRegistrationState.js.map +1 -0
- package/lib/client/surface/state/useSessionExpansion.d.ts +39 -0
- package/lib/client/surface/state/useSessionExpansion.d.ts.map +1 -0
- package/lib/client/surface/state/useSessionExpansion.js +230 -0
- package/lib/client/surface/state/useSessionExpansion.js.map +1 -0
- package/lib/client/surface/state/useSessionOrdering.d.ts +15 -0
- package/lib/client/surface/state/useSessionOrdering.d.ts.map +1 -0
- package/lib/client/surface/state/useSessionOrdering.js +68 -0
- package/lib/client/surface/state/useSessionOrdering.js.map +1 -0
- package/lib/client/surface/state/useSurfaceMenus.d.ts +9 -0
- package/lib/client/surface/state/useSurfaceMenus.d.ts.map +1 -0
- package/lib/client/surface/state/useSurfaceMenus.js +15 -0
- package/lib/client/surface/state/useSurfaceMenus.js.map +1 -0
- package/lib/client/surface/state/useSurfaceRefresh.d.ts +39 -0
- package/lib/client/surface/state/useSurfaceRefresh.d.ts.map +1 -0
- package/lib/client/surface/state/useSurfaceRefresh.js +274 -0
- package/lib/client/surface/state/useSurfaceRefresh.js.map +1 -0
- package/lib/client/surface/state/useSurfaceSources.d.ts +31 -0
- package/lib/client/surface/state/useSurfaceSources.d.ts.map +1 -0
- package/lib/client/surface/state/useSurfaceSources.js +63 -0
- package/lib/client/surface/state/useSurfaceSources.js.map +1 -0
- package/lib/client/{worktree-surface-types.d.ts → surface/types.d.ts} +50 -13
- package/lib/client/surface/types.d.ts.map +1 -0
- package/lib/client/surface/types.js +2 -0
- package/lib/client/surface/types.js.map +1 -0
- package/lib/client/{WorktreeModeAction.d.ts → view/WorktreeModeAction.d.ts} +1 -1
- package/lib/client/view/WorktreeModeAction.d.ts.map +1 -0
- package/lib/client/{WorktreeModeAction.js → view/WorktreeModeAction.js} +1 -1
- package/lib/client/view/WorktreeModeAction.js.map +1 -0
- package/lib/client/view/navigation.d.ts.map +1 -0
- package/lib/client/view/navigation.js.map +1 -0
- package/lib/client/view/view-mode-store.d.ts.map +1 -0
- package/lib/client/view/view-mode-store.js.map +1 -0
- package/lib/client/view/view-mode.d.ts.map +1 -0
- package/lib/client/view/view-mode.js.map +1 -0
- package/lib/client/{worktree-error-copy.d.ts → view/worktree-error-copy.d.ts} +2 -2
- package/lib/client/view/worktree-error-copy.d.ts.map +1 -0
- package/lib/client/view/worktree-error-copy.js.map +1 -0
- package/lib/client/{worktree-expand-state.d.ts → view/worktree-expand-state.d.ts} +1 -0
- package/lib/client/view/worktree-expand-state.d.ts.map +1 -0
- package/lib/client/{worktree-expand-state.js → view/worktree-expand-state.js} +11 -0
- package/lib/client/view/worktree-expand-state.js.map +1 -0
- package/lib/client/{worktree-view-actions.d.ts → view/worktree-view-actions.d.ts} +11 -5
- package/lib/client/view/worktree-view-actions.d.ts.map +1 -0
- package/lib/client/{worktree-view-actions.js → view/worktree-view-actions.js} +13 -11
- package/lib/client/view/worktree-view-actions.js.map +1 -0
- package/lib/client/view/worktree-view-errors.d.ts.map +1 -0
- package/lib/client/view/worktree-view-errors.js.map +1 -0
- package/lib/client/{worktree-view-read.d.ts → view/worktree-view-read.d.ts} +4 -2
- package/lib/client/view/worktree-view-read.d.ts.map +1 -0
- package/lib/client/{worktree-view-read.js → view/worktree-view-read.js} +4 -1
- package/lib/client/view/worktree-view-read.js.map +1 -0
- package/lib/client/view/worktree-view.d.ts.map +1 -0
- package/lib/client/view/worktree-view.js.map +1 -0
- package/lib/client/worktree-connection.d.ts +5 -0
- package/lib/client/worktree-connection.d.ts.map +1 -1
- package/lib/client/worktree-connection.js +16 -0
- package/lib/client/worktree-connection.js.map +1 -1
- package/lib/client.js +4295 -2634
- package/lib/client.js.map +1 -1
- package/lib/contract/index.contract.js +10 -0
- package/lib/contract/index.contract.js.map +1 -1
- package/lib/contract/index.d.ts +46 -3
- package/lib/contract/index.d.ts.map +1 -1
- package/lib/contract/index.js +7 -0
- package/lib/contract/index.js.map +1 -1
- package/lib/host/dsh-read-adapter.d.ts +10 -1
- package/lib/host/dsh-read-adapter.d.ts.map +1 -1
- package/lib/host/dsh-read-adapter.js +18 -1
- package/lib/host/dsh-read-adapter.js.map +1 -1
- package/lib/host/remote.d.ts.map +1 -1
- package/lib/host/remote.js +14 -0
- package/lib/host/remote.js.map +1 -1
- package/lib/host/service.d.ts +24 -0
- package/lib/host/service.d.ts.map +1 -1
- package/lib/host/service.js +39 -1
- package/lib/host/service.js.map +1 -1
- package/lib/host/worktree-activity.d.ts +13 -0
- package/lib/host/worktree-activity.d.ts.map +1 -0
- package/lib/host/worktree-activity.js +23 -0
- package/lib/host/worktree-activity.js.map +1 -0
- package/lib/host/worktree-permission-manager.js +2 -2
- package/lib/host/worktree-permission-manager.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/manage/manager-context.d.ts +2 -1
- package/lib/manage/manager-context.d.ts.map +1 -1
- package/lib/manage/manager-sessions.js +4 -4
- package/lib/manage/manager-sessions.js.map +1 -1
- package/lib/manage/manager-worktree-lifecycle.d.ts +23 -0
- package/lib/manage/manager-worktree-lifecycle.d.ts.map +1 -0
- package/lib/manage/manager-worktree-lifecycle.js +165 -0
- package/lib/manage/manager-worktree-lifecycle.js.map +1 -0
- package/lib/manage/manager-worktrees.d.ts +1 -6
- package/lib/manage/manager-worktrees.d.ts.map +1 -1
- package/lib/manage/manager-worktrees.js +78 -112
- package/lib/manage/manager-worktrees.js.map +1 -1
- package/lib/manage/manager.d.ts +17 -1
- package/lib/manage/manager.d.ts.map +1 -1
- package/lib/manage/manager.js +23 -6
- package/lib/manage/manager.js.map +1 -1
- package/lib/provider/generated-name.d.ts +8 -0
- package/lib/provider/generated-name.d.ts.map +1 -0
- package/lib/provider/generated-name.js +29 -0
- package/lib/provider/generated-name.js.map +1 -0
- package/lib/provider/{git.d.ts → git/adapter.d.ts} +2 -2
- package/lib/provider/git/adapter.d.ts.map +1 -0
- package/lib/provider/{git.js → git/adapter.js} +11 -2
- package/lib/provider/git/adapter.js.map +1 -0
- package/lib/provider/{repository-fingerprint.d.ts → git/repository-fingerprint.d.ts} +1 -1
- package/lib/provider/git/repository-fingerprint.d.ts.map +1 -0
- package/lib/provider/git/repository-fingerprint.js.map +1 -0
- package/lib/provider/{subprocess.d.ts → git/subprocess.d.ts} +1 -1
- package/lib/provider/git/subprocess.d.ts.map +1 -0
- package/lib/provider/git/subprocess.js.map +1 -0
- package/lib/provider/git/worktree-status.d.ts +5 -0
- package/lib/provider/git/worktree-status.d.ts.map +1 -0
- package/lib/provider/git/worktree-status.js +23 -0
- package/lib/provider/git/worktree-status.js.map +1 -0
- package/lib/provider/index.d.ts +5 -5
- package/lib/provider/index.d.ts.map +1 -1
- package/lib/provider/index.js +5 -5
- package/lib/provider/index.js.map +1 -1
- package/lib/provider/mutation-token.d.ts +1 -1
- package/lib/provider/mutation-token.d.ts.map +1 -1
- package/lib/provider/mutation-token.js +1 -0
- package/lib/provider/mutation-token.js.map +1 -1
- package/lib/provider/sidecar/mutation-lock.d.ts.map +1 -0
- package/lib/provider/{mutation-lock.js → sidecar/mutation-lock.js} +1 -1
- package/lib/provider/sidecar/mutation-lock.js.map +1 -0
- package/lib/provider/{sidecar.d.ts → sidecar/repository.d.ts} +3 -3
- package/lib/provider/sidecar/repository.d.ts.map +1 -0
- package/lib/provider/{sidecar.js → sidecar/repository.js} +12 -5
- package/lib/provider/sidecar/repository.js.map +1 -0
- package/lib/provider/{sidecar-persistence.d.ts → sidecar/sidecar-persistence.d.ts} +1 -1
- package/lib/provider/sidecar/sidecar-persistence.d.ts.map +1 -0
- package/lib/provider/{sidecar-persistence.js → sidecar/sidecar-persistence.js} +29 -2
- package/lib/provider/sidecar/sidecar-persistence.js.map +1 -0
- package/lib/provider/{sidecar-schema.d.ts → sidecar/sidecar-schema.d.ts} +1 -1
- package/lib/provider/sidecar/sidecar-schema.d.ts.map +1 -0
- package/lib/provider/{sidecar-schema.js → sidecar/sidecar-schema.js} +52 -16
- package/lib/provider/sidecar/sidecar-schema.js.map +1 -0
- package/lib/provider/transaction/dependencies.d.ts +10 -0
- package/lib/provider/transaction/dependencies.d.ts.map +1 -0
- package/lib/provider/transaction/dependencies.js +2 -0
- package/lib/provider/transaction/dependencies.js.map +1 -0
- package/lib/provider/transaction/index.d.ts +17 -0
- package/lib/provider/transaction/index.d.ts.map +1 -0
- package/lib/provider/transaction/index.js +44 -0
- package/lib/provider/transaction/index.js.map +1 -0
- package/lib/provider/transaction/operations/adopt-branch.d.ts +6 -0
- package/lib/provider/transaction/operations/adopt-branch.d.ts.map +1 -0
- package/lib/provider/transaction/operations/adopt-branch.js +59 -0
- package/lib/provider/transaction/operations/adopt-branch.js.map +1 -0
- package/lib/provider/transaction/operations/clean.d.ts +4 -0
- package/lib/provider/transaction/operations/clean.d.ts.map +1 -0
- package/lib/provider/transaction/operations/clean.js +168 -0
- package/lib/provider/transaction/operations/clean.js.map +1 -0
- package/lib/provider/transaction/operations/create.d.ts +5 -0
- package/lib/provider/transaction/operations/create.d.ts.map +1 -0
- package/lib/provider/transaction/operations/create.js +136 -0
- package/lib/provider/transaction/operations/create.js.map +1 -0
- package/lib/provider/transaction/operations/import.d.ts +5 -0
- package/lib/provider/transaction/operations/import.d.ts.map +1 -0
- package/lib/provider/transaction/operations/import.js +92 -0
- package/lib/provider/transaction/operations/import.js.map +1 -0
- package/lib/provider/transaction/operations/remove.d.ts +4 -0
- package/lib/provider/transaction/operations/remove.d.ts.map +1 -0
- package/lib/provider/transaction/operations/remove.js +164 -0
- package/lib/provider/transaction/operations/remove.js.map +1 -0
- package/lib/provider/transaction/recovery/failure-recovery.d.ts +32 -0
- package/lib/provider/transaction/recovery/failure-recovery.d.ts.map +1 -0
- package/lib/provider/transaction/recovery/failure-recovery.js +147 -0
- package/lib/provider/transaction/recovery/failure-recovery.js.map +1 -0
- package/lib/provider/transaction/recovery/recover.d.ts +4 -0
- package/lib/provider/transaction/recovery/recover.d.ts.map +1 -0
- package/lib/provider/transaction/recovery/recover.js +162 -0
- package/lib/provider/transaction/recovery/recover.js.map +1 -0
- package/lib/provider/transaction/support/admission.d.ts +7 -0
- package/lib/provider/transaction/support/admission.d.ts.map +1 -0
- package/lib/provider/transaction/support/admission.js +90 -0
- package/lib/provider/transaction/support/admission.js.map +1 -0
- package/lib/provider/transaction/support/inspection.d.ts +11 -0
- package/lib/provider/transaction/support/inspection.d.ts.map +1 -0
- package/lib/provider/transaction/support/inspection.js +51 -0
- package/lib/provider/transaction/support/inspection.js.map +1 -0
- package/lib/provider/transaction/support/journal.d.ts +12 -0
- package/lib/provider/transaction/support/journal.d.ts.map +1 -0
- package/lib/provider/transaction/support/journal.js +72 -0
- package/lib/provider/transaction/support/journal.js.map +1 -0
- package/lib/provider/transaction/support/locking.d.ts +4 -0
- package/lib/provider/transaction/support/locking.d.ts.map +1 -0
- package/lib/provider/transaction/support/locking.js +11 -0
- package/lib/provider/transaction/support/locking.js.map +1 -0
- package/lib/provider/transaction/support/path-safety.d.ts +11 -0
- package/lib/provider/transaction/support/path-safety.d.ts.map +1 -0
- package/lib/provider/transaction/support/path-safety.js +82 -0
- package/lib/provider/transaction/support/path-safety.js.map +1 -0
- package/lib/provider/transaction/support/paths.d.ts +10 -0
- package/lib/provider/transaction/support/paths.d.ts.map +1 -0
- package/lib/provider/transaction/support/paths.js +68 -0
- package/lib/provider/transaction/support/paths.js.map +1 -0
- package/lib/provider/transaction/support/publication.d.ts +9 -0
- package/lib/provider/transaction/support/publication.d.ts.map +1 -0
- package/lib/provider/transaction/support/publication.js +92 -0
- package/lib/provider/transaction/support/publication.js.map +1 -0
- package/lib/provider/transaction/types.d.ts +38 -0
- package/lib/provider/transaction/types.d.ts.map +1 -0
- package/lib/provider/transaction/types.js +2 -0
- package/lib/provider/transaction/types.js.map +1 -0
- package/lib/provider/types.d.ts +22 -3
- package/lib/provider/types.d.ts.map +1 -1
- package/lib/provider/types.js +1 -1
- package/lib/provider/types.js.map +1 -1
- package/lib/provider/worktree-lifecycle.d.ts +19 -0
- package/lib/provider/worktree-lifecycle.d.ts.map +1 -0
- package/lib/provider/worktree-lifecycle.js +44 -0
- package/lib/provider/worktree-lifecycle.js.map +1 -0
- package/lib/typert.host.js +269 -30
- package/lib/typert.remote-client.d.ts +10 -0
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +269 -30
- package/package.json +1 -1
- package/lib/client/WorktreeContext.d.ts.map +0 -1
- package/lib/client/WorktreeContext.js.map +0 -1
- package/lib/client/WorktreeHeroContext.d.ts.map +0 -1
- package/lib/client/WorktreeHeroContext.js.map +0 -1
- package/lib/client/WorktreeModeAction.d.ts.map +0 -1
- package/lib/client/WorktreeModeAction.js.map +0 -1
- package/lib/client/WorktreeOverlay.d.ts.map +0 -1
- package/lib/client/WorktreeOverlay.js.map +0 -1
- package/lib/client/dsh-rc1-slot-contract.d.ts +0 -43
- package/lib/client/dsh-rc1-slot-contract.d.ts.map +0 -1
- package/lib/client/dsh-rc1-slot-contract.js +0 -2
- package/lib/client/dsh-rc1-slot-contract.js.map +0 -1
- package/lib/client/navigation.d.ts.map +0 -1
- package/lib/client/navigation.js.map +0 -1
- package/lib/client/overlay-bounds.d.ts.map +0 -1
- package/lib/client/overlay-bounds.js.map +0 -1
- package/lib/client/session-view.d.ts.map +0 -1
- package/lib/client/session-view.js.map +0 -1
- package/lib/client/sidebar-overlay-geometry.d.ts.map +0 -1
- package/lib/client/sidebar-overlay-geometry.js.map +0 -1
- package/lib/client/view-mode-store.d.ts.map +0 -1
- package/lib/client/view-mode-store.js.map +0 -1
- package/lib/client/view-mode.d.ts.map +0 -1
- package/lib/client/view-mode.js.map +0 -1
- package/lib/client/virtual-workspace-membership.d.ts.map +0 -1
- package/lib/client/virtual-workspace-membership.js.map +0 -1
- package/lib/client/worktree-context-store.d.ts.map +0 -1
- package/lib/client/worktree-context-store.js.map +0 -1
- package/lib/client/worktree-context.d.ts.map +0 -1
- package/lib/client/worktree-context.js.map +0 -1
- package/lib/client/worktree-error-copy.d.ts.map +0 -1
- package/lib/client/worktree-error-copy.js.map +0 -1
- package/lib/client/worktree-expand-state.d.ts.map +0 -1
- package/lib/client/worktree-expand-state.js.map +0 -1
- package/lib/client/worktree-permission-icon.d.ts.map +0 -1
- package/lib/client/worktree-permission-icon.js.map +0 -1
- package/lib/client/worktree-permission.d.ts.map +0 -1
- package/lib/client/worktree-permission.js.map +0 -1
- package/lib/client/worktree-session-fork.d.ts.map +0 -1
- package/lib/client/worktree-session-fork.js.map +0 -1
- package/lib/client/worktree-session-order.d.ts.map +0 -1
- package/lib/client/worktree-session-order.js.map +0 -1
- package/lib/client/worktree-session-position.d.ts.map +0 -1
- package/lib/client/worktree-session-position.js.map +0 -1
- package/lib/client/worktree-session.d.ts.map +0 -1
- package/lib/client/worktree-session.js.map +0 -1
- package/lib/client/worktree-surface-dialogs.d.ts.map +0 -1
- package/lib/client/worktree-surface-dialogs.js.map +0 -1
- package/lib/client/worktree-surface-rows.d.ts.map +0 -1
- package/lib/client/worktree-surface-rows.js.map +0 -1
- package/lib/client/worktree-surface-selectors.d.ts.map +0 -1
- package/lib/client/worktree-surface-selectors.js.map +0 -1
- package/lib/client/worktree-surface-types.d.ts.map +0 -1
- package/lib/client/worktree-surface-types.js +0 -2
- package/lib/client/worktree-surface-types.js.map +0 -1
- package/lib/client/worktree-view-actions.d.ts.map +0 -1
- package/lib/client/worktree-view-actions.js.map +0 -1
- package/lib/client/worktree-view-errors.d.ts.map +0 -1
- package/lib/client/worktree-view-errors.js.map +0 -1
- package/lib/client/worktree-view-read.d.ts.map +0 -1
- package/lib/client/worktree-view-read.js.map +0 -1
- package/lib/client/worktree-view.d.ts.map +0 -1
- package/lib/client/worktree-view.js.map +0 -1
- package/lib/provider/git.d.ts.map +0 -1
- package/lib/provider/git.js.map +0 -1
- package/lib/provider/mutation-lock.d.ts.map +0 -1
- package/lib/provider/mutation-lock.js.map +0 -1
- package/lib/provider/repository-fingerprint.d.ts.map +0 -1
- package/lib/provider/repository-fingerprint.js.map +0 -1
- package/lib/provider/sidecar-persistence.d.ts.map +0 -1
- package/lib/provider/sidecar-persistence.js.map +0 -1
- package/lib/provider/sidecar-schema.d.ts.map +0 -1
- package/lib/provider/sidecar-schema.js.map +0 -1
- package/lib/provider/sidecar.d.ts.map +0 -1
- package/lib/provider/sidecar.js.map +0 -1
- package/lib/provider/subprocess.d.ts.map +0 -1
- package/lib/provider/subprocess.js.map +0 -1
- package/lib/provider/transaction.d.ts +0 -65
- package/lib/provider/transaction.d.ts.map +0 -1
- package/lib/provider/transaction.js +0 -1011
- package/lib/provider/transaction.js.map +0 -1
- /package/lib/client/{WorktreeContext.js → context/WorktreeContext.js} +0 -0
- /package/lib/client/{WorktreeHeroContext.js → context/WorktreeHeroContext.js} +0 -0
- /package/lib/client/{overlay-bounds.d.ts → overlay/overlay-bounds.d.ts} +0 -0
- /package/lib/client/{overlay-bounds.js → overlay/overlay-bounds.js} +0 -0
- /package/lib/client/{sidebar-overlay-geometry.d.ts → overlay/sidebar-overlay-geometry.d.ts} +0 -0
- /package/lib/client/{sidebar-overlay-geometry.js → overlay/sidebar-overlay-geometry.js} +0 -0
- /package/lib/client/{worktree-permission-icon.d.ts → permission/worktree-permission-icon.d.ts} +0 -0
- /package/lib/client/{worktree-permission-icon.js → permission/worktree-permission-icon.js} +0 -0
- /package/lib/client/{worktree-permission.d.ts → permission/worktree-permission.d.ts} +0 -0
- /package/lib/client/{worktree-permission.js → permission/worktree-permission.js} +0 -0
- /package/lib/client/{session-view.d.ts → session/session-view.d.ts} +0 -0
- /package/lib/client/{session-view.js → session/session-view.js} +0 -0
- /package/lib/client/{worktree-session-order.d.ts → session/worktree-session-order.d.ts} +0 -0
- /package/lib/client/{worktree-session-order.js → session/worktree-session-order.js} +0 -0
- /package/lib/client/{worktree-session-position.d.ts → session/worktree-session-position.d.ts} +0 -0
- /package/lib/client/{worktree-session-position.js → session/worktree-session-position.js} +0 -0
- /package/lib/client/{navigation.d.ts → view/navigation.d.ts} +0 -0
- /package/lib/client/{navigation.js → view/navigation.js} +0 -0
- /package/lib/client/{view-mode-store.d.ts → view/view-mode-store.d.ts} +0 -0
- /package/lib/client/{view-mode-store.js → view/view-mode-store.js} +0 -0
- /package/lib/client/{view-mode.d.ts → view/view-mode.d.ts} +0 -0
- /package/lib/client/{view-mode.js → view/view-mode.js} +0 -0
- /package/lib/client/{worktree-error-copy.js → view/worktree-error-copy.js} +0 -0
- /package/lib/client/{worktree-view-errors.d.ts → view/worktree-view-errors.d.ts} +0 -0
- /package/lib/client/{worktree-view-errors.js → view/worktree-view-errors.js} +0 -0
- /package/lib/client/{worktree-view.d.ts → view/worktree-view.d.ts} +0 -0
- /package/lib/client/{worktree-view.js → view/worktree-view.js} +0 -0
- /package/lib/provider/{repository-fingerprint.js → git/repository-fingerprint.js} +0 -0
- /package/lib/provider/{subprocess.js → git/subprocess.js} +0 -0
- /package/lib/provider/{mutation-lock.d.ts → sidecar/mutation-lock.d.ts} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type SessionListLike } from '../session/session-view.js';
|
|
2
|
+
import type { WorktreeFullAccessConfirmationInput } from '../permission/worktree-permission.js';
|
|
3
|
+
import type { WorktreeForkRecovery, WorktreeForkRecoveryStore } from '../session/worktree-session-fork.js';
|
|
4
|
+
import { type WorktreeViewError } from '../view/worktree-view.js';
|
|
5
|
+
import type { ReadState, WorkspaceLike, WorktreePermissionNotice } from './types.js';
|
|
6
|
+
export declare function toNativeWorktreeViewError(error: unknown): WorktreeViewError;
|
|
7
|
+
export declare const EMPTY_READ_STATE: ReadState;
|
|
8
|
+
export declare const EMPTY_PERMISSION_NOTICE: WorktreePermissionNotice | undefined;
|
|
9
|
+
export declare const EMPTY_PERMISSION_NOTICE_SUBSCRIBE: () => (() => void);
|
|
10
|
+
export declare const EMPTY_PERMISSION_NOTICE_SNAPSHOT: () => WorktreePermissionNotice | undefined;
|
|
11
|
+
export declare const EMPTY_FULL_ACCESS_CONFIRMATION_SUBSCRIBE: () => (() => void);
|
|
12
|
+
export declare const EMPTY_FULL_ACCESS_CONFIRMATION_SNAPSHOT: () => WorktreeFullAccessConfirmationInput | undefined;
|
|
13
|
+
export declare const EMPTY_FORK_RECOVERY_SNAPSHOT: {
|
|
14
|
+
readonly revision: 0;
|
|
15
|
+
readonly pending: readonly [];
|
|
16
|
+
readonly affectedWorkspaceIds: readonly [];
|
|
17
|
+
};
|
|
18
|
+
export declare const EMPTY_FORK_RECOVERY_STORE: WorktreeForkRecoveryStore;
|
|
19
|
+
export type ExpandedSessionGroups = Record<string, boolean>;
|
|
20
|
+
export declare function cx(...classes: (string | boolean | undefined | null)[]): string;
|
|
21
|
+
export interface WorktreeCreateDefaults {
|
|
22
|
+
readonly baseBranch?: string;
|
|
23
|
+
readonly newBranch?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CurrentSessionRevealState {
|
|
26
|
+
readonly sessionId: string;
|
|
27
|
+
readonly suppressedKeys: Readonly<Record<string, true>>;
|
|
28
|
+
}
|
|
29
|
+
export interface SessionOrderInput {
|
|
30
|
+
readonly accountKey: string;
|
|
31
|
+
readonly sessionIds: readonly string[];
|
|
32
|
+
readonly updatedAtById: Readonly<Record<string, number | undefined>>;
|
|
33
|
+
}
|
|
34
|
+
export declare function updatedAtById(sessionIds: readonly string[], sessions: SessionListLike): Readonly<Record<string, number | undefined>>;
|
|
35
|
+
export declare function forkRecoveryError(recovery: WorktreeForkRecovery): WorktreeViewError;
|
|
36
|
+
export declare function useStableWorkspaceIds(workspaces: readonly WorkspaceLike[]): readonly string[];
|
|
37
|
+
export declare function IconCollapseAll16({ size }: {
|
|
38
|
+
size?: number;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/client/surface/shared.tsx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AS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;CACzD;AACD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACtE;AACD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,QAAQ,EAAE,eAAe,GACxB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAI9C;AACD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,iBAAiB,CAUnF;AACD,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,MAAM,EAAE,CAM7F;AACD,wBAAgB,iBAAiB,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAMjE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { stableWorkspaceIds, toWorktreeViewError, } from '../view/worktree-view.js';
|
|
4
|
+
export function toNativeWorktreeViewError(error) {
|
|
5
|
+
const viewError = toWorktreeViewError(error);
|
|
6
|
+
if (typeof error === 'object' && error !== null)
|
|
7
|
+
return viewError;
|
|
8
|
+
return { ...viewError, message: String(error) };
|
|
9
|
+
}
|
|
10
|
+
export const EMPTY_READ_STATE = { status: 'idle', views: [] };
|
|
11
|
+
export const EMPTY_PERMISSION_NOTICE = undefined;
|
|
12
|
+
export const EMPTY_PERMISSION_NOTICE_SUBSCRIBE = () => () => { };
|
|
13
|
+
export const EMPTY_PERMISSION_NOTICE_SNAPSHOT = () => EMPTY_PERMISSION_NOTICE;
|
|
14
|
+
export const EMPTY_FULL_ACCESS_CONFIRMATION_SUBSCRIBE = () => () => { };
|
|
15
|
+
export const EMPTY_FULL_ACCESS_CONFIRMATION_SNAPSHOT = () => undefined;
|
|
16
|
+
export const EMPTY_FORK_RECOVERY_SNAPSHOT = {
|
|
17
|
+
revision: 0,
|
|
18
|
+
pending: [],
|
|
19
|
+
affectedWorkspaceIds: [],
|
|
20
|
+
};
|
|
21
|
+
export const EMPTY_FORK_RECOVERY_STORE = {
|
|
22
|
+
getSnapshot: () => EMPTY_FORK_RECOVERY_SNAPSHOT,
|
|
23
|
+
subscribe: () => () => { },
|
|
24
|
+
};
|
|
25
|
+
export function cx(...classes) {
|
|
26
|
+
return classes.filter(Boolean).join(' ');
|
|
27
|
+
}
|
|
28
|
+
export function updatedAtById(sessionIds, sessions) {
|
|
29
|
+
return Object.fromEntries(sessionIds.map((sessionId) => [sessionId, sessions.byId[sessionId]?.updatedAt]));
|
|
30
|
+
}
|
|
31
|
+
export function forkRecoveryError(recovery) {
|
|
32
|
+
const error = toNativeWorktreeViewError(recovery.error);
|
|
33
|
+
return {
|
|
34
|
+
...error,
|
|
35
|
+
code: error.code === 'WORKTREE_VIEW_FAILED' ? 'SESSION_BINDING_FAILED' : error.code,
|
|
36
|
+
details: {
|
|
37
|
+
...(error.details ?? {}),
|
|
38
|
+
sessionId: recovery.childSessionId,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function useStableWorkspaceIds(workspaces) {
|
|
43
|
+
const next = workspaces.map((workspace) => workspace.workspaceId);
|
|
44
|
+
const previousRef = useRef([]);
|
|
45
|
+
const stable = stableWorkspaceIds(previousRef.current, next);
|
|
46
|
+
if (stable !== previousRef.current)
|
|
47
|
+
previousRef.current = stable;
|
|
48
|
+
return previousRef.current;
|
|
49
|
+
}
|
|
50
|
+
export function IconCollapseAll16({ size = 16 }) {
|
|
51
|
+
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "currentColor", children: _jsx("path", { d: "M9 11h6v1H9v-1zm6-3H9v1h6V8zm-6-3h6v1H9V5zM4.15 2.15l-.71.7L5.59 5H1v1h4.59L3.44 8.15l.71.7L7.5 5.5 4.15 2.15zm0 6l-.71.7L5.59 11H1v1h4.59l-2.15 2.15.71.7L7.5 11.5 4.15 8.15z" }) }));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/client/surface/shared.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,yBAAyB,CAAC,KAAc;IACtD,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,OAAO,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAClD,CAAC;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAc,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAyC,SAAS,CAAC;AACvF,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAiB,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAyC,EAAE,CACzF,uBAAuB,CAAC;AAC1B,MAAM,CAAC,MAAM,wCAAwC,GAAG,GAAiB,EAAE,CAAC,GAAG,EA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AC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,MAAM,CAAoB,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7D,IAAI,MAAM,KAAK,WAAW,CAAC,OAAO;QAAE,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC;IACjE,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,EAAE,IAAI,GAAG,EAAE,EAAqB;IAChE,OAAO,CACL,cAAK,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,YACrE,eAAM,CAAC,EAAC,gLAAgL,GAAG,GACvL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { WorktreeRecord } from '../../../contract/index.js';
|
|
2
|
+
import type { WorktreeSurfaceProps } from '../types.js';
|
|
3
|
+
import type { useSurfaceMutation } from '../actions/useSurfaceMutation.js';
|
|
4
|
+
import type { useSurfaceSources } from './useSurfaceSources.js';
|
|
5
|
+
type Input = {
|
|
6
|
+
props: Pick<WorktreeSurfaceProps, 'manager'>;
|
|
7
|
+
source: Pick<ReturnType<typeof useSurfaceSources>, 'mode'>;
|
|
8
|
+
mutation: Pick<ReturnType<typeof useSurfaceMutation>, 'setActionPending'>;
|
|
9
|
+
};
|
|
10
|
+
export declare function useLifecycleState({ props, source, mutation }: Input): {
|
|
11
|
+
worktreeBranchAdoption: WorktreeRecord | undefined;
|
|
12
|
+
setWorktreeBranchAdoption: import("react").Dispatch<import("react").SetStateAction<WorktreeRecord | undefined>>;
|
|
13
|
+
worktreeRemoval: WorktreeRecord | undefined;
|
|
14
|
+
setWorktreeRemoval: import("react").Dispatch<import("react").SetStateAction<WorktreeRecord | undefined>>;
|
|
15
|
+
worktreeCleanDisk: WorktreeRecord | undefined;
|
|
16
|
+
setWorktreeCleanDisk: import("react").Dispatch<import("react").SetStateAction<WorktreeRecord | undefined>>;
|
|
17
|
+
worktreeForget: WorktreeRecord | undefined;
|
|
18
|
+
setWorktreeForget: import("react").Dispatch<import("react").SetStateAction<WorktreeRecord | undefined>>;
|
|
19
|
+
cleanupGuard: import("react").MutableRefObject<{
|
|
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
|
+
branchAdoptionGuard: import("react").MutableRefObject<{
|
|
26
|
+
begin: () => number;
|
|
27
|
+
isCurrent: (generation: number) => boolean;
|
|
28
|
+
invalidate: () => void;
|
|
29
|
+
run<T>(load: () => Promise<T>, onSuccess: (value: T) => void, onError: (error: unknown) => void): Promise<void>;
|
|
30
|
+
}>;
|
|
31
|
+
permissionRetryPending: import("react").MutableRefObject<boolean>;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=useLifecycleState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLifecycleState.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useLifecycleState.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3D,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EAAE,kBAAkB,CAAC,CAAC;CAC3E,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;EAmCnE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { createWorktreeRefreshGuard } from '../../view/worktree-view.js';
|
|
3
|
+
export function useLifecycleState({ props, source, mutation }) {
|
|
4
|
+
const { manager } = props;
|
|
5
|
+
const { mode } = source;
|
|
6
|
+
const { setActionPending } = mutation;
|
|
7
|
+
const [worktreeBranchAdoption, setWorktreeBranchAdoption] = useState();
|
|
8
|
+
const [worktreeRemoval, setWorktreeRemoval] = useState();
|
|
9
|
+
const [worktreeCleanDisk, setWorktreeCleanDisk] = useState();
|
|
10
|
+
const [worktreeForget, setWorktreeForget] = useState();
|
|
11
|
+
const cleanupGuard = useRef(createWorktreeRefreshGuard());
|
|
12
|
+
const branchAdoptionGuard = useRef(createWorktreeRefreshGuard());
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const guard = branchAdoptionGuard.current;
|
|
15
|
+
setWorktreeBranchAdoption(undefined);
|
|
16
|
+
return () => guard.invalidate();
|
|
17
|
+
}, [manager, mode]);
|
|
18
|
+
const permissionRetryPending = useRef(false);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const guard = cleanupGuard.current;
|
|
21
|
+
permissionRetryPending.current = false;
|
|
22
|
+
setActionPending(false);
|
|
23
|
+
return () => guard.invalidate();
|
|
24
|
+
}, [manager, mode]);
|
|
25
|
+
return {
|
|
26
|
+
worktreeBranchAdoption,
|
|
27
|
+
setWorktreeBranchAdoption,
|
|
28
|
+
worktreeRemoval,
|
|
29
|
+
setWorktreeRemoval,
|
|
30
|
+
worktreeCleanDisk,
|
|
31
|
+
setWorktreeCleanDisk,
|
|
32
|
+
worktreeForget,
|
|
33
|
+
setWorktreeForget,
|
|
34
|
+
cleanupGuard,
|
|
35
|
+
branchAdoptionGuard,
|
|
36
|
+
permissionRetryPending,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=useLifecycleState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLifecycleState.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useLifecycleState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAWzE,MAAM,UAAU,iBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAS;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxB,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ,CAAC;IACtC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,EAAkB,CAAC;IACvF,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,EAAkB,CAAC;IACzE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,EAAkB,CAAC;IAC7E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAAkB,CAAC;IACvE,MAAM,YAAY,GAAG,MAAM,CAAC,0BAA0B,EAAE,CAAC,CAAC;IAC1D,MAAM,mBAAmB,GAAG,MAAM,CAAC,0BAA0B,EAAE,CAAC,CAAC;IACjE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC1C,yBAAyB,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACpB,MAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC;QACnC,sBAAsB,CAAC,OAAO,GAAG,KAAK,CAAC;QACvC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACpB,OAAO;QACL,sBAAsB;QACtB,yBAAyB;QACzB,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;QACpB,cAAc;QACd,iBAAiB;QACjB,YAAY;QACZ,mBAAmB;QACnB,sBAAsB;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type WorktreeViewError, type WorktreeWorkspaceView } from '../../view/worktree-view.js';
|
|
2
|
+
import type { ImportCandidatesState, WorktreeRegistrationMode, WorktreeSurfaceProps } from '../types.js';
|
|
3
|
+
type Input = {
|
|
4
|
+
props: Pick<WorktreeSurfaceProps, 'viewReader'>;
|
|
5
|
+
};
|
|
6
|
+
export declare function useRegistrationState({ props }: Input): {
|
|
7
|
+
worktreeModalWorkspaceId: string | undefined;
|
|
8
|
+
setWorktreeModalWorkspaceId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
9
|
+
modalReadError: WorktreeViewError | undefined;
|
|
10
|
+
setModalReadError: import("react").Dispatch<import("react").SetStateAction<WorktreeViewError | undefined>>;
|
|
11
|
+
modalReadLoading: boolean;
|
|
12
|
+
setModalReadLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
13
|
+
worktreeModalMode: WorktreeRegistrationMode;
|
|
14
|
+
setWorktreeModalMode: import("react").Dispatch<import("react").SetStateAction<WorktreeRegistrationMode>>;
|
|
15
|
+
importCandidates: ImportCandidatesState;
|
|
16
|
+
setImportCandidates: import("react").Dispatch<import("react").SetStateAction<ImportCandidatesState>>;
|
|
17
|
+
selectedImportPath: string | undefined;
|
|
18
|
+
setSelectedImportPath: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
19
|
+
selectedBranch: string;
|
|
20
|
+
setSelectedBranch: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
21
|
+
newBranch: string;
|
|
22
|
+
setNewBranch: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
23
|
+
modalReadLoader: import("react").MutableRefObject<import("../../view/worktree-view-read.js").WorktreeModalViewLoader>;
|
|
24
|
+
modalReadViewRef: import("react").MutableRefObject<WorktreeWorkspaceView | undefined>;
|
|
25
|
+
importCandidatesGuard: import("react").MutableRefObject<{
|
|
26
|
+
begin: () => number;
|
|
27
|
+
isCurrent: (generation: number) => boolean;
|
|
28
|
+
invalidate: () => void;
|
|
29
|
+
run<T>(load: () => Promise<T>, onSuccess: (value: T) => void, onError: (error: unknown) => void): Promise<void>;
|
|
30
|
+
}>;
|
|
31
|
+
modalWorkspaceIdRef: import("react").MutableRefObject<string | undefined>;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=useRegistrationState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegistrationState.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useRegistrationState.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAA;CAAE,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCpD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
|
+
import { createWorktreeModalViewLoader, createWorktreeRefreshGuard, } from '../../view/worktree-view.js';
|
|
3
|
+
export function useRegistrationState({ props }) {
|
|
4
|
+
const { viewReader } = props;
|
|
5
|
+
const [worktreeModalWorkspaceId, setWorktreeModalWorkspaceId] = useState();
|
|
6
|
+
const [modalReadError, setModalReadError] = useState();
|
|
7
|
+
const [modalReadLoading, setModalReadLoading] = useState(false);
|
|
8
|
+
const [worktreeModalMode, setWorktreeModalMode] = useState('create');
|
|
9
|
+
const [importCandidates, setImportCandidates] = useState({
|
|
10
|
+
status: 'idle',
|
|
11
|
+
candidates: [],
|
|
12
|
+
});
|
|
13
|
+
const [selectedImportPath, setSelectedImportPath] = useState();
|
|
14
|
+
const [selectedBranch, setSelectedBranch] = useState('');
|
|
15
|
+
const [newBranch, setNewBranch] = useState('');
|
|
16
|
+
const modalReadLoader = useRef(createWorktreeModalViewLoader(viewReader));
|
|
17
|
+
const modalReadViewRef = useRef();
|
|
18
|
+
const importCandidatesGuard = useRef(createWorktreeRefreshGuard());
|
|
19
|
+
const modalWorkspaceIdRef = useRef(worktreeModalWorkspaceId);
|
|
20
|
+
modalWorkspaceIdRef.current = worktreeModalWorkspaceId;
|
|
21
|
+
return {
|
|
22
|
+
worktreeModalWorkspaceId,
|
|
23
|
+
setWorktreeModalWorkspaceId,
|
|
24
|
+
modalReadError,
|
|
25
|
+
setModalReadError,
|
|
26
|
+
modalReadLoading,
|
|
27
|
+
setModalReadLoading,
|
|
28
|
+
worktreeModalMode,
|
|
29
|
+
setWorktreeModalMode,
|
|
30
|
+
importCandidates,
|
|
31
|
+
setImportCandidates,
|
|
32
|
+
selectedImportPath,
|
|
33
|
+
setSelectedImportPath,
|
|
34
|
+
selectedBranch,
|
|
35
|
+
setSelectedBranch,
|
|
36
|
+
newBranch,
|
|
37
|
+
setNewBranch,
|
|
38
|
+
modalReadLoader,
|
|
39
|
+
modalReadViewRef,
|
|
40
|
+
importCandidatesGuard,
|
|
41
|
+
modalWorkspaceIdRef,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=useRegistrationState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegistrationState.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useRegistrationState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAG3B,MAAM,6BAA6B,CAAC;AASrC,MAAM,UAAU,oBAAoB,CAAC,EAAE,KAAK,EAAS;IACnD,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,GAAG,QAAQ,EAAU,CAAC;IACnF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAAqB,CAAC;IAC1E,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAA2B,QAAQ,CAAC,CAAC;IAC/F,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAwB;QAC9E,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;IACH,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,EAAsB,CAAC;IACnF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,MAAM,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1E,MAAM,gBAAgB,GAAG,MAAM,EAAyB,CAAC;IACzD,MAAM,qBAAqB,GAAG,MAAM,CAAC,0BAA0B,EAAE,CAAC,CAAC;IACnE,MAAM,mBAAmB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC7D,mBAAmB,CAAC,OAAO,GAAG,wBAAwB,CAAC;IACvD,OAAO;QACL,wBAAwB;QACxB,2BAA2B;QAC3B,cAAc;QACd,iBAAiB;QACjB,gBAAgB;QAChB,mBAAmB;QACnB,iBAAiB;QACjB,oBAAoB;QACpB,gBAAgB;QAChB,mBAAmB;QACnB,kBAAkB;QAClB,qBAAqB;QACrB,cAAc;QACd,iBAAiB;QACjB,SAAS;QACT,YAAY;QACZ,eAAe;QACf,gBAAgB;QAChB,qBAAqB;QACrB,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CurrentSessionRevealState, ExpandedSessionGroups } from '../shared.js';
|
|
2
|
+
import type { WorktreeSurfaceProps } from '../types.js';
|
|
3
|
+
import type { useSurfaceRefresh } from './useSurfaceRefresh.js';
|
|
4
|
+
import type { useSurfaceSources } from './useSurfaceSources.js';
|
|
5
|
+
type Input = {
|
|
6
|
+
read: Pick<ReturnType<typeof useSurfaceRefresh>, 'readState' | 'viewByWorkspace'>;
|
|
7
|
+
source: Pick<ReturnType<typeof useSurfaceSources>, 'currentSessionId' | 'workspaces' | 'mode' | 'ref' | 'expandSnapshot' | 'workspaceIds'>;
|
|
8
|
+
props: Pick<WorktreeSurfaceProps, 'expandState'>;
|
|
9
|
+
};
|
|
10
|
+
export declare function useSessionExpansion({ read, source, props }: Input): {
|
|
11
|
+
searchQuery: string;
|
|
12
|
+
setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
13
|
+
searchExpanded: boolean;
|
|
14
|
+
setSearchExpanded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
15
|
+
searchRoot: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
16
|
+
searchInput: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
17
|
+
currentSessionReveal: CurrentSessionRevealState | undefined;
|
|
18
|
+
setCurrentSessionReveal: import("react").Dispatch<import("react").SetStateAction<CurrentSessionRevealState | undefined>>;
|
|
19
|
+
searchQueryRef: import("react").MutableRefObject<string>;
|
|
20
|
+
locateGenerationRef: import("react").MutableRefObject<number>;
|
|
21
|
+
positionedLocateGenerationRef: import("react").MutableRefObject<number | undefined>;
|
|
22
|
+
expandedArchivedWorkspaces: Readonly<Record<string, boolean>>;
|
|
23
|
+
setExpandedArchivedWorkspaces: import("react").Dispatch<import("react").SetStateAction<Readonly<Record<string, boolean>>>>;
|
|
24
|
+
expandedSessionGroups: ExpandedSessionGroups;
|
|
25
|
+
setExpandedSessionGroups: import("react").Dispatch<import("react").SetStateAction<ExpandedSessionGroups>>;
|
|
26
|
+
query: string;
|
|
27
|
+
currentSessionLocation: import("../selectors.js").CurrentSessionLocation | undefined;
|
|
28
|
+
currentRevealKeys: Set<string>;
|
|
29
|
+
isCurrentSessionReveal: (key: string) => boolean;
|
|
30
|
+
clearSessionGroups: (groupKeys: readonly string[]) => void;
|
|
31
|
+
suppressCurrentSessionReveal: (key: string) => boolean;
|
|
32
|
+
toggleWorkspace: (workspaceId: string) => void;
|
|
33
|
+
toggleMain: (workspaceId: string) => void;
|
|
34
|
+
toggleWorktree: (worktreeId: string) => void;
|
|
35
|
+
toggleArchivedWorkspace: (workspaceId: string) => void;
|
|
36
|
+
toggleSessionGroup: (groupKey: string, autoExpanded: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=useSessionExpansion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSessionExpansion.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useSessionExpansion.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAAC,CAAC;IAClF,MAAM,EAAE,IAAI,CACV,UAAU,CAAC,OAAO,iBAAiB,CAAC,EACpC,kBAAkB,GAAG,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,gBAAgB,GAAG,cAAc,CACvF,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK;;;;;;;;;;;;;;;;;;;kCAgD3B,MAAM,KAAG,OAAO;oCA+Dd,SAAS,MAAM,EAAE,KAAG,IAAI;wCAIpB,MAAM,KAAG,OAAO;mCAWrB,MAAM,KAAG,IAAI;8BA0BlB,MAAM,KAAG,IAAI;iCAcV,MAAM,KAAG,IAAI;2CAcH,MAAM,KAAG,IAAI;mCAarB,MAAM,gBAAgB,OAAO,KAAG,IAAI;EA4C3E"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { isMainExpanded, isWorkspaceExpanded, isWorktreeExpanded, } from '../../view/worktree-expand-state.js';
|
|
3
|
+
import { scrollCurrentSessionIntoView } from '../../session/worktree-session-position.js';
|
|
4
|
+
import { clearSessionGroupExpansion, currentSessionRevealKeys, isCompleteWorktreeWorkspaceSnapshot, resolveCurrentSessionLocation, } from '../selectors.js';
|
|
5
|
+
export function useSessionExpansion({ read, source, props }) {
|
|
6
|
+
const { readState, viewByWorkspace } = read;
|
|
7
|
+
const { currentSessionId, workspaces, mode, ref, expandSnapshot, workspaceIds } = source;
|
|
8
|
+
const { expandState } = props;
|
|
9
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
10
|
+
const [searchExpanded, setSearchExpanded] = useState(false);
|
|
11
|
+
const searchRoot = useRef(null);
|
|
12
|
+
const searchInput = useRef(null);
|
|
13
|
+
const [currentSessionReveal, setCurrentSessionReveal] = useState();
|
|
14
|
+
const searchQueryRef = useRef(searchQuery);
|
|
15
|
+
searchQueryRef.current = searchQuery;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!searchExpanded)
|
|
18
|
+
return;
|
|
19
|
+
const onClick = (event) => {
|
|
20
|
+
if (!(event.target instanceof Node) || searchRoot.current?.contains(event.target) === true)
|
|
21
|
+
return;
|
|
22
|
+
searchInput.current?.blur();
|
|
23
|
+
if (searchQuery.trim() !== '')
|
|
24
|
+
return;
|
|
25
|
+
setSearchExpanded(false);
|
|
26
|
+
};
|
|
27
|
+
document.addEventListener('click', onClick);
|
|
28
|
+
return () => {
|
|
29
|
+
document.removeEventListener('click', onClick);
|
|
30
|
+
};
|
|
31
|
+
}, [searchExpanded, searchQuery]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (searchExpanded) {
|
|
34
|
+
searchInput.current?.focus({ preventScroll: true });
|
|
35
|
+
}
|
|
36
|
+
}, [searchExpanded]);
|
|
37
|
+
const locateGenerationRef = useRef(0);
|
|
38
|
+
const positionedLocateGenerationRef = useRef();
|
|
39
|
+
const [expandedArchivedWorkspaces, setExpandedArchivedWorkspaces] = useState({});
|
|
40
|
+
const [expandedSessionGroups, setExpandedSessionGroups] = useState({});
|
|
41
|
+
const query = searchQuery.trim().toLocaleLowerCase();
|
|
42
|
+
const currentSessionLocation = useMemo(() => readState.status === 'ready'
|
|
43
|
+
? resolveCurrentSessionLocation(currentSessionId, workspaces.items, readState.views)
|
|
44
|
+
: undefined, [currentSessionId, readState.status, readState.views, workspaces.items]);
|
|
45
|
+
const currentRevealKeys = useMemo(() => new Set(currentSessionRevealKeys(currentSessionLocation)), [currentSessionLocation]);
|
|
46
|
+
const isCurrentSessionReveal = (key) => currentSessionReveal !== undefined &&
|
|
47
|
+
currentSessionReveal.sessionId === currentSessionId &&
|
|
48
|
+
currentRevealKeys.has(key) &&
|
|
49
|
+
currentSessionReveal.suppressedKeys[key] !== true;
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
locateGenerationRef.current += 1;
|
|
52
|
+
positionedLocateGenerationRef.current = undefined;
|
|
53
|
+
if (mode !== 'worktree') {
|
|
54
|
+
setCurrentSessionReveal(undefined);
|
|
55
|
+
setSearchExpanded(false);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (searchQueryRef.current.trim().length > 0) {
|
|
59
|
+
setSearchQuery('');
|
|
60
|
+
setSearchExpanded(false);
|
|
61
|
+
}
|
|
62
|
+
setCurrentSessionReveal(currentSessionId === undefined
|
|
63
|
+
? undefined
|
|
64
|
+
: { sessionId: currentSessionId, suppressedKeys: {} });
|
|
65
|
+
}, [currentSessionId, mode]);
|
|
66
|
+
useLayoutEffect(() => {
|
|
67
|
+
if (mode !== 'worktree' ||
|
|
68
|
+
currentSessionId === undefined ||
|
|
69
|
+
currentSessionLocation === undefined) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const generation = locateGenerationRef.current;
|
|
73
|
+
if (positionedLocateGenerationRef.current === generation)
|
|
74
|
+
return;
|
|
75
|
+
let cancelled = false;
|
|
76
|
+
const frame = requestAnimationFrame(() => {
|
|
77
|
+
if (cancelled || generation !== locateGenerationRef.current)
|
|
78
|
+
return;
|
|
79
|
+
if (!scrollCurrentSessionIntoView(ref.current, currentSessionId))
|
|
80
|
+
return;
|
|
81
|
+
positionedLocateGenerationRef.current = generation;
|
|
82
|
+
});
|
|
83
|
+
return () => {
|
|
84
|
+
cancelled = true;
|
|
85
|
+
cancelAnimationFrame(frame);
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
currentSessionId,
|
|
89
|
+
currentSessionLocation,
|
|
90
|
+
currentSessionReveal,
|
|
91
|
+
expandSnapshot,
|
|
92
|
+
mode,
|
|
93
|
+
query,
|
|
94
|
+
readState.status,
|
|
95
|
+
]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (readState.status !== 'ready' ||
|
|
98
|
+
!isCompleteWorktreeWorkspaceSnapshot(workspaceIds, readState.views))
|
|
99
|
+
return;
|
|
100
|
+
expandState.actions.retain(workspaceIds, readState.views.flatMap((view) => view.worktrees.map((record) => record.worktreeId)));
|
|
101
|
+
}, [expandState, readState.status, readState.views, workspaceIds]);
|
|
102
|
+
const clearSessionGroups = (groupKeys) => {
|
|
103
|
+
if (groupKeys.length === 0)
|
|
104
|
+
return;
|
|
105
|
+
setExpandedSessionGroups((current) => clearSessionGroupExpansion(current, groupKeys));
|
|
106
|
+
};
|
|
107
|
+
const suppressCurrentSessionReveal = (key) => {
|
|
108
|
+
if (!isCurrentSessionReveal(key))
|
|
109
|
+
return false;
|
|
110
|
+
setCurrentSessionReveal((current) => {
|
|
111
|
+
if (current === undefined || current.sessionId !== currentSessionId)
|
|
112
|
+
return current;
|
|
113
|
+
return {
|
|
114
|
+
...current,
|
|
115
|
+
suppressedKeys: { ...current.suppressedKeys, [key]: true },
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
120
|
+
const toggleWorkspace = (workspaceId) => {
|
|
121
|
+
const persistedExpanded = isWorkspaceExpanded(expandSnapshot, workspaceId);
|
|
122
|
+
const autoExpanded = isCurrentSessionReveal('workspace:' + workspaceId);
|
|
123
|
+
const visuallyExpanded = persistedExpanded || autoExpanded;
|
|
124
|
+
if (visuallyExpanded && autoExpanded) {
|
|
125
|
+
suppressCurrentSessionReveal('workspace:' + workspaceId);
|
|
126
|
+
}
|
|
127
|
+
if (visuallyExpanded && !persistedExpanded) {
|
|
128
|
+
clearSessionGroups([
|
|
129
|
+
'main:' + workspaceId,
|
|
130
|
+
...(viewByWorkspace.get(workspaceId)?.worktrees.map((record) => record.worktreeId) ?? []).map((worktreeId) => 'worktree:' + worktreeId),
|
|
131
|
+
]);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
expandState.actions.toggleWorkspace(workspaceId);
|
|
135
|
+
if (visuallyExpanded) {
|
|
136
|
+
clearSessionGroups([
|
|
137
|
+
'main:' + workspaceId,
|
|
138
|
+
...(viewByWorkspace.get(workspaceId)?.worktrees.map((record) => record.worktreeId) ?? []).map((worktreeId) => 'worktree:' + worktreeId),
|
|
139
|
+
]);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const toggleMain = (workspaceId) => {
|
|
143
|
+
const persistedExpanded = isMainExpanded(expandSnapshot, workspaceId);
|
|
144
|
+
const autoExpanded = isCurrentSessionReveal('main:' + workspaceId);
|
|
145
|
+
const visuallyExpanded = persistedExpanded || autoExpanded;
|
|
146
|
+
if (visuallyExpanded && autoExpanded) {
|
|
147
|
+
suppressCurrentSessionReveal('main:' + workspaceId);
|
|
148
|
+
}
|
|
149
|
+
if (visuallyExpanded && !persistedExpanded) {
|
|
150
|
+
clearSessionGroups(['main:' + workspaceId]);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
expandState.actions.toggleMain(workspaceId);
|
|
154
|
+
if (visuallyExpanded)
|
|
155
|
+
clearSessionGroups(['main:' + workspaceId]);
|
|
156
|
+
};
|
|
157
|
+
const toggleWorktree = (worktreeId) => {
|
|
158
|
+
const persistedExpanded = isWorktreeExpanded(expandSnapshot, worktreeId);
|
|
159
|
+
const autoExpanded = isCurrentSessionReveal('worktree:' + worktreeId);
|
|
160
|
+
const visuallyExpanded = persistedExpanded || autoExpanded;
|
|
161
|
+
if (visuallyExpanded && autoExpanded) {
|
|
162
|
+
suppressCurrentSessionReveal('worktree:' + worktreeId);
|
|
163
|
+
}
|
|
164
|
+
if (visuallyExpanded && !persistedExpanded) {
|
|
165
|
+
clearSessionGroups(['worktree:' + worktreeId]);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
expandState.actions.toggleWorktree(worktreeId);
|
|
169
|
+
if (visuallyExpanded)
|
|
170
|
+
clearSessionGroups(['worktree:' + worktreeId]);
|
|
171
|
+
};
|
|
172
|
+
const toggleArchivedWorkspace = (workspaceId) => {
|
|
173
|
+
const archivedKey = 'archived:' + workspaceId;
|
|
174
|
+
const autoExpanded = isCurrentSessionReveal(archivedKey);
|
|
175
|
+
const persistedExpanded = expandedArchivedWorkspaces[workspaceId] === true;
|
|
176
|
+
const visuallyExpanded = persistedExpanded || autoExpanded;
|
|
177
|
+
if (visuallyExpanded && autoExpanded) {
|
|
178
|
+
suppressCurrentSessionReveal(archivedKey);
|
|
179
|
+
}
|
|
180
|
+
setExpandedArchivedWorkspaces((current) => ({
|
|
181
|
+
...current,
|
|
182
|
+
[workspaceId]: !visuallyExpanded,
|
|
183
|
+
}));
|
|
184
|
+
};
|
|
185
|
+
const toggleSessionGroup = (groupKey, autoExpanded) => {
|
|
186
|
+
const transientExpanded = expandedSessionGroups[groupKey] === true;
|
|
187
|
+
if (autoExpanded) {
|
|
188
|
+
suppressCurrentSessionReveal('session-group:' + groupKey);
|
|
189
|
+
setExpandedSessionGroups((current) => {
|
|
190
|
+
const next = { ...current };
|
|
191
|
+
delete next[groupKey];
|
|
192
|
+
return next;
|
|
193
|
+
});
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
setExpandedSessionGroups((current) => ({
|
|
197
|
+
...current,
|
|
198
|
+
[groupKey]: !transientExpanded,
|
|
199
|
+
}));
|
|
200
|
+
};
|
|
201
|
+
return {
|
|
202
|
+
searchQuery,
|
|
203
|
+
setSearchQuery,
|
|
204
|
+
searchExpanded,
|
|
205
|
+
setSearchExpanded,
|
|
206
|
+
searchRoot,
|
|
207
|
+
searchInput,
|
|
208
|
+
currentSessionReveal,
|
|
209
|
+
setCurrentSessionReveal,
|
|
210
|
+
searchQueryRef,
|
|
211
|
+
locateGenerationRef,
|
|
212
|
+
positionedLocateGenerationRef,
|
|
213
|
+
expandedArchivedWorkspaces,
|
|
214
|
+
setExpandedArchivedWorkspaces,
|
|
215
|
+
expandedSessionGroups,
|
|
216
|
+
setExpandedSessionGroups,
|
|
217
|
+
query,
|
|
218
|
+
currentSessionLocation,
|
|
219
|
+
currentRevealKeys,
|
|
220
|
+
isCurrentSessionReveal,
|
|
221
|
+
clearSessionGroups,
|
|
222
|
+
suppressCurrentSessionReveal,
|
|
223
|
+
toggleWorkspace,
|
|
224
|
+
toggleMain,
|
|
225
|
+
toggleWorktree,
|
|
226
|
+
toggleArchivedWorkspace,
|
|
227
|
+
toggleSessionGroup,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=useSessionExpansion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSessionExpansion.js","sourceRoot":"","sources":["../../../../src/client/surface/state/useSessionExpansion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,mCAAmC,EACnC,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAezB,MAAM,UA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AAC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QACD,wBAAwB,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACrC,GAAG,OAAO;YACV,CAAC,QAAQ,CAAC,EAAE,CAAC,iBAAiB;SAC/B,CAAC,CAAC,CAAC;IACN,CAAC,CAAC;IACF,OAAO;QACL,WAAW;QACX,cAAc;QACd,cAAc;QACd,iBAAiB;QACjB,UAAU;QACV,WAAW;QACX,oBAAoB;QACpB,uBAAuB;QACvB,cAAc;QACd,mBAAmB;QACnB,6BAA6B;QAC7B,0BAA0B;QAC1B,6BAA6B;QAC7B,qBAAqB;QACrB,wBAAwB;QACxB,KAAK;QACL,sBAAsB;QACtB,iBAAiB;QACjB,sBAAsB;QACtB,kBAAkB;QAClB,4BAA4B;QAC5B,eAAe;QACf,UAAU;QACV,cAAc;QACd,uBAAuB;QACvB,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SessionOrderInput } from '../shared.js';
|
|
2
|
+
import type { WorktreeSurfaceProps } from '../types.js';
|
|
3
|
+
import type { useSurfaceRefresh } from './useSurfaceRefresh.js';
|
|
4
|
+
import type { useSurfaceSources } from './useSurfaceSources.js';
|
|
5
|
+
type Input = {
|
|
6
|
+
read: Pick<ReturnType<typeof useSurfaceRefresh>, 'readState' | 'viewByWorkspace'>;
|
|
7
|
+
source: Pick<ReturnType<typeof useSurfaceSources>, 'workspaces' | 'sessions' | 'archivedSessionIds' | 'sessionOrderSnapshot' | 'mode'>;
|
|
8
|
+
props: Pick<WorktreeSurfaceProps, 'sessionOrder'>;
|
|
9
|
+
};
|
|
10
|
+
export declare function useSessionOrdering({ read, source, props }: Input): {
|
|
11
|
+
sessionOrderInputs: readonly SessionOrderInput[];
|
|
12
|
+
orderedSessionIdsByAccount: Map<string, readonly string[]>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=useSessionOrdering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSessionOrdering.d.ts","sourceRoot":"","sources":["../../../../src/client/surface/state/useSessionOrdering.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAAC,CAAC;IAClF,MAAM,EAAE,IAAI,CACV,UAAU,CAAC,OAAO,iBAAiB,CAAC,EACpC,YAAY,GAAG,UAAU,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,MAAM,CACnF,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;CACnD,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK;;;EA2EhE"}
|