@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,72 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { createRepositoryFingerprint } from '../../git/repository-fingerprint.js';
|
|
3
|
+
import { WorktreeProviderError, providerError } from '../../types.js';
|
|
4
|
+
export function removeRecoveryIssue(issues, operationId, worktreeId) {
|
|
5
|
+
return (issues ?? []).filter((issue) => issue.operationId !== operationId &&
|
|
6
|
+
(worktreeId === undefined || issue.worktreeId !== worktreeId));
|
|
7
|
+
}
|
|
8
|
+
export function recoveryError(message, details = {}) {
|
|
9
|
+
return providerError('WORKTREE_RECOVERY_REQUIRED', message, details);
|
|
10
|
+
}
|
|
11
|
+
export function normalizeGitError(operation, workspaceRoot, targetPath, error) {
|
|
12
|
+
if (error instanceof WorktreeProviderError)
|
|
13
|
+
return error;
|
|
14
|
+
return providerError('GIT_OPERATION_FAILED', `Git ${operation} failed: ${String(error)}`, {
|
|
15
|
+
operation,
|
|
16
|
+
workspaceRoot,
|
|
17
|
+
targetPath,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function recordForCreate(input) {
|
|
21
|
+
return {
|
|
22
|
+
worktreeId: input.worktreeId,
|
|
23
|
+
workspaceId: input.workspaceId,
|
|
24
|
+
absolutePath: input.targetPath,
|
|
25
|
+
branch: input.targetBranch,
|
|
26
|
+
source: 'plugin',
|
|
27
|
+
status: 'active',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function pendingCreate(input, repository) {
|
|
31
|
+
return {
|
|
32
|
+
id: randomUUID(),
|
|
33
|
+
type: 'create-worktree',
|
|
34
|
+
phase: 'executing',
|
|
35
|
+
workspaceId: input.workspaceId,
|
|
36
|
+
worktreeId: input.worktreeId,
|
|
37
|
+
targetPath: input.targetPath,
|
|
38
|
+
branch: input.targetBranch,
|
|
39
|
+
...(input.newBranch !== undefined ? { baseRef: input.baseBranch } : {}),
|
|
40
|
+
repositoryFingerprint: createRepositoryFingerprint(repository),
|
|
41
|
+
startedAt: new Date().toISOString(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function pendingRemove(input, record, repository) {
|
|
45
|
+
return {
|
|
46
|
+
id: randomUUID(),
|
|
47
|
+
type: 'remove-worktree',
|
|
48
|
+
phase: 'executing',
|
|
49
|
+
workspaceId: input.workspaceId,
|
|
50
|
+
worktreeId: input.worktreeId,
|
|
51
|
+
targetPath: record.absolutePath,
|
|
52
|
+
branch: record.branch,
|
|
53
|
+
source: record.source,
|
|
54
|
+
repositoryFingerprint: createRepositoryFingerprint(repository),
|
|
55
|
+
startedAt: new Date().toISOString(),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function pendingClean(input, record, repository) {
|
|
59
|
+
return {
|
|
60
|
+
id: randomUUID(),
|
|
61
|
+
type: 'clean-worktree',
|
|
62
|
+
phase: 'executing',
|
|
63
|
+
workspaceId: input.workspaceId,
|
|
64
|
+
worktreeId: input.worktreeId,
|
|
65
|
+
targetPath: record.absolutePath,
|
|
66
|
+
branch: record.branch,
|
|
67
|
+
source: record.source,
|
|
68
|
+
repositoryFingerprint: createRepositoryFingerprint(repository),
|
|
69
|
+
startedAt: new Date().toISOString(),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=journal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.js","sourceRoot":"","sources":["../../../../src/provider/transaction/support/journal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAYlF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,UAAU,mBAAmB,CACjC,MAA4C,EAC5C,WAAmB,EACnB,UAAmB;IAEnB,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAC1B,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,WAAW,KAAK,WAAW;QACjC,CAAC,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC,CAChE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,UAA+D,EAAE;IAEjE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,SAAiB,EACjB,aAAqB,EACrB,UAAkB,EAClB,KAAc;IAEd,IAAI,KAAK,YAAY,qBAAqB;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,aAAa,CAAC,sBAAsB,EAAE,OAAO,SAAS,YAAY,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE;QACxF,SAAS;QACT,aAAa;QACb,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,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AW,EAAE;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,KAAoC,EACpC,MAAsB,EACtB,UAA8B;IAE9B,OAAO;QACL,EAAE,EAAE,UAAU,EAAE;QAChB,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,UAAU,EAAE,MAAM,CAAC,YAAY;QAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,qBAAqB,EAAE,2BAA2B,CAAC,UAAU,CAAC;QAC9D,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LockedSidecarStore } from '../../types.js';
|
|
2
|
+
import type { TransactionDependencies } from '../dependencies.js';
|
|
3
|
+
export declare function withShardLock<T>(dependencies: Pick<TransactionDependencies, 'sidecar'>, workspaceId: string, operation: (locked: LockedSidecarStore) => Promise<T>): Promise<T>;
|
|
4
|
+
//# sourceMappingURL=locking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locking.d.ts","sourceRoot":"","sources":["../../../../src/provider/transaction/support/locking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,wBAAsB,aAAa,CAAC,CAAC,EACnC,YAAY,EAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,EACtD,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,CAAC,CAAC,GACpD,OAAO,CAAC,CAAC,CAAC,CASZ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export async function withShardLock(dependencies, workspaceId, operation) {
|
|
2
|
+
if (dependencies.sidecar.runExclusive)
|
|
3
|
+
return dependencies.sidecar.runExclusive(workspaceId, operation);
|
|
4
|
+
// Injected legacy stores remain usable for tests and older compositions, but
|
|
5
|
+
// cannot provide the cross-process shard lock until they implement the seam.
|
|
6
|
+
return operation({
|
|
7
|
+
read: () => dependencies.sidecar.read(workspaceId),
|
|
8
|
+
mutate: (mutation) => dependencies.sidecar.mutate(workspaceId, mutation),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=locking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locking.js","sourceRoot":"","sources":["../../../../src/provider/transaction/support/locking.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,YAAsD,EACtD,WAAmB,EACnB,SAAqD;IAErD,IAAI,YAAY,CAAC,OAAO,CAAC,YAAY;QACnC,OAAO,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACnE,6EAA6E;IAC7E,6EAA6E;IAC7E,OAAO,SAAS,CAAC;QACf,IAAI,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;QAClD,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC;KACzE,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorktreeRecord } from '../../../contract/index.js';
|
|
2
|
+
import type { PendingOperation } from '../../types.js';
|
|
3
|
+
import type { CreateWorktreeTransactionInput } from '../types.js';
|
|
4
|
+
import type { TransactionDependencies } from '../dependencies.js';
|
|
5
|
+
export declare function assertGeneratedTarget(dependencies: Pick<TransactionDependencies, 'dshHome'>, input: CreateWorktreeTransactionInput): void;
|
|
6
|
+
export declare function assertSafeRemovalPath(dependencies: Pick<TransactionDependencies, 'dshHome'>, record: WorktreeRecord, workspaceRoot: string): Promise<void>;
|
|
7
|
+
export declare function assertRecoverableCreatePath(dependencies: Pick<TransactionDependencies, 'dshHome'>, pending: Extract<PendingOperation, {
|
|
8
|
+
readonly type: 'create-worktree';
|
|
9
|
+
}>, workspaceRoot: string): Promise<void>;
|
|
10
|
+
export declare function assertNotSymlink(pathname: string, record: WorktreeRecord): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=path-safety.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-safety.d.ts","sourceRoot":"","sources":["../../../../src/provider/transaction/support/path-safety.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,EACtD,KAAK,EAAE,8BAA8B,GACpC,IAAI,CAgBN;AAED,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,EACtD,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,wBAAsB,2BAA2B,CAC/C,YAAY,EAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,EACtD,OAAO,EAAE,OAAO,CAAC,gBAAgB,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC,EACxE,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAY9F"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { lstat } from 'node:fs/promises';
|
|
3
|
+
import { isMissing, isInside } from './paths.js';
|
|
4
|
+
import { providerError } from '../../types.js';
|
|
5
|
+
export function assertGeneratedTarget(dependencies, input) {
|
|
6
|
+
const generatedRoot = path.join(dependencies.dshHome, 'clutch-dsh-worktree', 'worktree');
|
|
7
|
+
if (!path.isAbsolute(input.targetPath) ||
|
|
8
|
+
!isInside(generatedRoot, input.targetPath) ||
|
|
9
|
+
isInside(input.workspaceRoot, input.targetPath)) {
|
|
10
|
+
throw providerError('WORKTREE_STATE_CONFLICT', 'Generated Worktree path is outside the managed boundary', {
|
|
11
|
+
workspaceId: input.workspaceId,
|
|
12
|
+
targetPath: input.targetPath,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export async function assertSafeRemovalPath(dependencies, record, workspaceRoot) {
|
|
17
|
+
const targetPath = path.resolve(record.absolutePath);
|
|
18
|
+
if (record.source === 'plugin') {
|
|
19
|
+
const generatedRoot = path.join(dependencies.dshHome, 'clutch-dsh-worktree', 'worktree');
|
|
20
|
+
if (!isInside(generatedRoot, targetPath) || isInside(workspaceRoot, targetPath)) {
|
|
21
|
+
throw providerError('WORKTREE_IDENTITY_CHANGED', 'Managed Worktree path moved outside its trusted root', {
|
|
22
|
+
worktreeId: record.worktreeId,
|
|
23
|
+
targetPath: record.absolutePath,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
for (const trustedPath of [
|
|
27
|
+
dependencies.dshHome,
|
|
28
|
+
path.join(dependencies.dshHome, 'clutch-dsh-worktree'),
|
|
29
|
+
generatedRoot,
|
|
30
|
+
targetPath,
|
|
31
|
+
]) {
|
|
32
|
+
await assertNotSymlink(trustedPath, record);
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Imported records are canonicalized at registration time. Refusing a
|
|
37
|
+
// symlink here prevents a later path replacement from redirecting Git's
|
|
38
|
+
// destructive command to an unrelated directory.
|
|
39
|
+
await assertNotSymlink(targetPath, record);
|
|
40
|
+
}
|
|
41
|
+
export async function assertRecoverableCreatePath(dependencies, pending, workspaceRoot) {
|
|
42
|
+
const targetPath = path.resolve(pending.targetPath);
|
|
43
|
+
const generatedRoot = path.join(dependencies.dshHome, 'clutch-dsh-worktree', 'worktree');
|
|
44
|
+
if (!isInside(generatedRoot, targetPath) || isInside(workspaceRoot, targetPath)) {
|
|
45
|
+
throw providerError('WORKTREE_IDENTITY_CHANGED', 'Pending Worktree path moved outside its trusted root', {
|
|
46
|
+
worktreeId: pending.worktreeId,
|
|
47
|
+
targetPath: pending.targetPath,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const record = {
|
|
51
|
+
worktreeId: pending.worktreeId,
|
|
52
|
+
workspaceId: pending.workspaceId,
|
|
53
|
+
absolutePath: pending.targetPath,
|
|
54
|
+
branch: pending.branch,
|
|
55
|
+
source: 'plugin',
|
|
56
|
+
status: 'active',
|
|
57
|
+
};
|
|
58
|
+
for (const trustedPath of [
|
|
59
|
+
dependencies.dshHome,
|
|
60
|
+
path.join(dependencies.dshHome, 'clutch-dsh-worktree'),
|
|
61
|
+
generatedRoot,
|
|
62
|
+
targetPath,
|
|
63
|
+
]) {
|
|
64
|
+
await assertNotSymlink(trustedPath, record);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export async function assertNotSymlink(pathname, record) {
|
|
68
|
+
try {
|
|
69
|
+
if ((await lstat(pathname)).isSymbolicLink()) {
|
|
70
|
+
throw providerError('WORKTREE_IDENTITY_CHANGED', `Worktree path is a symlink: ${pathname}`, {
|
|
71
|
+
worktreeId: record.worktreeId,
|
|
72
|
+
targetPath: record.absolutePath,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (isMissing(error))
|
|
78
|
+
return;
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=path-safety.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-safety.js","sourceRoot":"","sources":["../../../../src/provider/transaction/support/path-safety.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,qBAAqB,CACnC,YAAsD,EACtD,KAAqC;IAErC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,CAAC,CAAC;IACzF,IACE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;QAClC,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC;QAC1C,QAAQ,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC,EAC/C,CAAC;QACD,MAAM,aAAa,CACjB,yBAAyB,EACzB,yDAAyD,EACzD;YACE,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,YAAsD,EACtD,MAAsB,EACtB,aAAqB;IAErB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,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AC,UAAU;SAC/B,CACF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAmB;QAC7B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE,OAAO,CAAC,UAAU;QAChC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF,KAAK,MAAM,WAAW,IAAI;QACxB,YAAY,CAAC,OAAO;QACpB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,qBAAqB,CAAC;QACtD,aAAa;QACb,UAAU;KACX,EAAE,CAAC;QACF,MAAM,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB,EAAE,MAAsB;IAC7E,IAAI,CAAC;QACH,IAAI,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC;YAC7C,MAAM,aAAa,CAAC,2BAA2B,EAAE,+BAA+B,QAAQ,EAAE,EAAE;gBAC1F,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,UAAU,EAAE,MAAM,CAAC,YAAY;aAChC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO;QAC7B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RepositoryIdentity } from '../../types.js';
|
|
2
|
+
export declare function isMissing(error: unknown): boolean;
|
|
3
|
+
export declare function pathExists(pathname: string): Promise<boolean>;
|
|
4
|
+
export declare function pathEntryMissing(pathname: string): Promise<boolean>;
|
|
5
|
+
export declare function isDirectory(pathname: string): Promise<boolean>;
|
|
6
|
+
export declare function canonicalPath(pathname: string): Promise<string>;
|
|
7
|
+
export declare function samePhysicalPath(left: string, right: string): Promise<boolean>;
|
|
8
|
+
export declare function sameRepository(left: RepositoryIdentity, right: RepositoryIdentity): boolean;
|
|
9
|
+
export declare function isInside(parent: string, child: string): boolean;
|
|
10
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../src/provider/transaction/support/paths.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEjD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQnE;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQzE;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOpE;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOrE;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQpF;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAE3F;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAM/D"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { lstat, realpath, stat } from 'node:fs/promises';
|
|
3
|
+
export function isMissing(error) {
|
|
4
|
+
return error.code === 'ENOENT';
|
|
5
|
+
}
|
|
6
|
+
export async function pathExists(pathname) {
|
|
7
|
+
try {
|
|
8
|
+
await stat(pathname);
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
if (isMissing(error))
|
|
13
|
+
return false;
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export async function pathEntryMissing(pathname) {
|
|
18
|
+
try {
|
|
19
|
+
await lstat(pathname);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (isMissing(error))
|
|
24
|
+
return true;
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export async function isDirectory(pathname) {
|
|
29
|
+
try {
|
|
30
|
+
return (await stat(pathname)).isDirectory();
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (isMissing(error))
|
|
34
|
+
return false;
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export async function canonicalPath(pathname) {
|
|
39
|
+
try {
|
|
40
|
+
return await realpath(pathname);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (isMissing(error))
|
|
44
|
+
return path.resolve(pathname);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export async function samePhysicalPath(left, right) {
|
|
49
|
+
if (path.resolve(left) === path.resolve(right))
|
|
50
|
+
return true;
|
|
51
|
+
try {
|
|
52
|
+
return (await realpath(left)) === (await realpath(right));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (isMissing(error))
|
|
56
|
+
return false;
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function sameRepository(left, right) {
|
|
61
|
+
return path.resolve(left.commonDirectory) === path.resolve(right.commonDirectory);
|
|
62
|
+
}
|
|
63
|
+
export function isInside(parent, child) {
|
|
64
|
+
const relative = path.relative(path.resolve(parent), path.resolve(child));
|
|
65
|
+
return (relative === '' ||
|
|
66
|
+
(!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative)));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../src/provider/transaction/support/paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGzD,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAQ,KAAoC,CAAC,IAAI,KAAK,QAAQ,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QACnC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAClC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAA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AAO,CACL,QAAQ,KAAK,EAAE;QACf,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAC3F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorktreeRecord } from '../../../contract/index.js';
|
|
2
|
+
import type { LockedSidecarStore, PendingOperation, RepositoryIdentity } from '../../types.js';
|
|
3
|
+
import type { TransactionDependencies } from '../dependencies.js';
|
|
4
|
+
export declare function publishCreated(dependencies: Pick<TransactionDependencies, 'git'>, locked: LockedSidecarStore, operationId: string, record: WorktreeRecord, repository: RepositoryIdentity): Promise<void>;
|
|
5
|
+
export declare function publishCleaned(locked: LockedSidecarStore, operationId: string, worktreeId: string, repository: RepositoryIdentity): Promise<void>;
|
|
6
|
+
export declare function publishRemoved(locked: LockedSidecarStore, operationId: string, worktreeId: string, repository: RepositoryIdentity): Promise<void>;
|
|
7
|
+
export declare function clearPending(locked: LockedSidecarStore, operationId: string): Promise<void>;
|
|
8
|
+
export declare function markRecovery(locked: LockedSidecarStore, pending: PendingOperation, code: 'WORKTREE_RECOVERY_REQUIRED' | 'WORKTREE_IDENTITY_CHANGED'): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=publication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.d.ts","sourceRoot":"","sources":["../../../../src/provider/transaction/support/publication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAI/F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,wBAAsB,cAAc,CAClC,YAAY,EAAE,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC,EAClD,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,kBAAkB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA8Cf;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,kBAAkB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,kBAAkB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAejG;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,4BAA4B,GAAG,2BAA2B,GAC/D,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createRepositoryFingerprint } from '../../git/repository-fingerprint.js';
|
|
2
|
+
import { completeWorktreeCleanup } from '../../worktree-lifecycle.js';
|
|
3
|
+
import { removeRecoveryIssue, recoveryError } from './journal.js';
|
|
4
|
+
import { findActiveBranchConflict } from './inspection.js';
|
|
5
|
+
export async function publishCreated(dependencies, locked, operationId, record, repository) {
|
|
6
|
+
await locked.mutate(async (snapshot) => {
|
|
7
|
+
const existing = snapshot.worktrees.find((candidate) => candidate.worktreeId === record.worktreeId);
|
|
8
|
+
if (existing && JSON.stringify(existing) !== JSON.stringify(record)) {
|
|
9
|
+
throw recoveryError(`Pending create conflicts with existing Worktree record: ${record.worktreeId}`, {
|
|
10
|
+
worktreeId: record.worktreeId,
|
|
11
|
+
operationId,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const conflict = await findActiveBranchConflict(dependencies, snapshot, record.branch, repository.topLevel, record.worktreeId);
|
|
15
|
+
if (conflict) {
|
|
16
|
+
throw recoveryError(`Pending create conflicts with active branch: ${record.branch}`, {
|
|
17
|
+
worktreeId: record.worktreeId,
|
|
18
|
+
operationId,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const recoveryIssues = removeRecoveryIssue(snapshot.recoveryIssues, operationId, record.worktreeId);
|
|
22
|
+
const { repository: _repository, recoveryIssues: _oldRecovery, ...stableFields } = snapshot;
|
|
23
|
+
void _repository;
|
|
24
|
+
void _oldRecovery;
|
|
25
|
+
return {
|
|
26
|
+
result: undefined,
|
|
27
|
+
snapshot: {
|
|
28
|
+
...stableFields,
|
|
29
|
+
repositoryFingerprint: createRepositoryFingerprint(repository),
|
|
30
|
+
worktrees: existing ? snapshot.worktrees : [record, ...snapshot.worktrees],
|
|
31
|
+
pendingOperation: undefined,
|
|
32
|
+
...(recoveryIssues.length > 0 ? { recoveryIssues } : {}),
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export async function publishCleaned(locked, operationId, worktreeId, repository) {
|
|
38
|
+
await locked.mutate((snapshot) => {
|
|
39
|
+
const recoveryIssues = removeRecoveryIssue(snapshot.recoveryIssues, operationId, worktreeId);
|
|
40
|
+
const { repository: _repository, recoveryIssues: _oldRecovery, ...stableFields } = snapshot;
|
|
41
|
+
void _repository;
|
|
42
|
+
void _oldRecovery;
|
|
43
|
+
const cleaned = completeWorktreeCleanup({
|
|
44
|
+
...stableFields,
|
|
45
|
+
repositoryFingerprint: createRepositoryFingerprint(repository),
|
|
46
|
+
pendingOperation: undefined,
|
|
47
|
+
...(recoveryIssues.length > 0 ? { recoveryIssues } : {}),
|
|
48
|
+
}, worktreeId);
|
|
49
|
+
return {
|
|
50
|
+
result: undefined,
|
|
51
|
+
snapshot: cleaned,
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export async function publishRemoved(locked, operationId, worktreeId, repository) {
|
|
56
|
+
return publishCleaned(locked, operationId, worktreeId, repository);
|
|
57
|
+
}
|
|
58
|
+
export async function clearPending(locked, operationId) {
|
|
59
|
+
await locked.mutate((snapshot) => {
|
|
60
|
+
const recoveryIssues = removeRecoveryIssue(snapshot.recoveryIssues, operationId);
|
|
61
|
+
const { repository: _repository, recoveryIssues: _oldRecovery, ...stableFields } = snapshot;
|
|
62
|
+
void _repository;
|
|
63
|
+
void _oldRecovery;
|
|
64
|
+
return {
|
|
65
|
+
result: undefined,
|
|
66
|
+
snapshot: {
|
|
67
|
+
...stableFields,
|
|
68
|
+
pendingOperation: undefined,
|
|
69
|
+
...(recoveryIssues.length > 0 ? { recoveryIssues } : {}),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export async function markRecovery(locked, pending, code) {
|
|
75
|
+
await locked.mutate((snapshot) => ({
|
|
76
|
+
result: undefined,
|
|
77
|
+
snapshot: {
|
|
78
|
+
...snapshot,
|
|
79
|
+
pendingOperation: { ...pending, phase: 'recovery-needed' },
|
|
80
|
+
recoveryIssues: [
|
|
81
|
+
...(snapshot.recoveryIssues ?? []).filter((issue) => issue.operationId !== pending.id),
|
|
82
|
+
{
|
|
83
|
+
code,
|
|
84
|
+
operationId: pending.id,
|
|
85
|
+
worktreeId: pending.worktreeId,
|
|
86
|
+
observedAt: new Date().toISOString(),
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=publication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publication.js","sourceRoot":"","sources":["../../../../src/provider/transaction/support/publication.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,E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AAC,QAAQ,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,OAAO,CAAC,EAAE,CAAC;gBACtF;oBACE,IAAI;oBACJ,WAAW,EAAE,OAAO,CAAC,EAAE;oBACvB,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACrC;aACF;SACF;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { GitWorktreeAdapter, SidecarStore } from '../types.js';
|
|
2
|
+
export interface CreateWorktreeTransactionInput {
|
|
3
|
+
readonly workspaceId: string;
|
|
4
|
+
readonly workspaceRoot: string;
|
|
5
|
+
readonly targetPath: string;
|
|
6
|
+
readonly worktreeId: string;
|
|
7
|
+
readonly baseBranch: string;
|
|
8
|
+
readonly newBranch?: string;
|
|
9
|
+
readonly targetBranch: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RemoveWorktreeTransactionInput {
|
|
12
|
+
readonly workspaceId: string;
|
|
13
|
+
readonly workspaceRoot: string;
|
|
14
|
+
readonly worktreeId: string;
|
|
15
|
+
readonly mutationToken: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CleanWorktreeTransactionInput {
|
|
18
|
+
readonly workspaceId: string;
|
|
19
|
+
readonly workspaceRoot: string;
|
|
20
|
+
readonly worktreeId: string;
|
|
21
|
+
readonly mutationToken: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ImportWorktreeTransactionInput {
|
|
24
|
+
readonly workspaceId: string;
|
|
25
|
+
readonly workspaceRoot: string;
|
|
26
|
+
readonly absolutePath: string;
|
|
27
|
+
readonly worktreeId: string;
|
|
28
|
+
}
|
|
29
|
+
export interface RecoverWorktreesInput {
|
|
30
|
+
readonly workspaceId: string;
|
|
31
|
+
readonly workspaceRoot: string;
|
|
32
|
+
}
|
|
33
|
+
export interface WorktreeMutationTransactionOptions {
|
|
34
|
+
readonly dshHome: string;
|
|
35
|
+
readonly git: GitWorktreeAdapter;
|
|
36
|
+
readonly sidecar: SidecarStore;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/provider/transaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/provider/transaction/types.ts"],"names":[],"mappings":""}
|
package/lib/provider/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionBinding, WorktreeErrorCode, WorktreeErrorDetails, WorktreeId, WorktreeRecord, WorkspaceId } from '../contract/index.js';
|
|
1
|
+
import type { SessionBinding, WorktreeActivity, WorktreeErrorCode, WorktreeErrorDetails, WorktreeId, WorktreeRecord, WorkspaceId } from '../contract/index.js';
|
|
2
2
|
import type { SubprocessRuntime } from '@deepseek-ai/dsh-subprocess';
|
|
3
3
|
/**
|
|
4
4
|
* 当前 sidecar 磁盘格式的唯一受支持版本;未知版本会被视为损坏,而不是被静默猜测或迁移。
|
|
@@ -6,7 +6,7 @@ import type { SubprocessRuntime } from '@deepseek-ai/dsh-subprocess';
|
|
|
6
6
|
* corruption rather than guessed or silently migrated.
|
|
7
7
|
*/
|
|
8
8
|
export declare const LEGACY_SIDECAR_SCHEMA_VERSION: 1;
|
|
9
|
-
export declare const SIDECAR_SCHEMA_VERSION:
|
|
9
|
+
export declare const SIDECAR_SCHEMA_VERSION: 4;
|
|
10
10
|
export interface RepositoryIdentity {
|
|
11
11
|
readonly topLevel: string;
|
|
12
12
|
readonly commonDirectory: string;
|
|
@@ -41,7 +41,21 @@ export interface RemoveWorktreePendingOperation {
|
|
|
41
41
|
readonly repository?: RepositoryIdentity;
|
|
42
42
|
readonly startedAt: string;
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export interface CleanWorktreePendingOperation {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly type: 'clean-worktree';
|
|
47
|
+
readonly phase: PendingOperationPhase;
|
|
48
|
+
readonly workspaceId: WorkspaceId;
|
|
49
|
+
readonly worktreeId: WorktreeId;
|
|
50
|
+
readonly targetPath: string;
|
|
51
|
+
readonly branch: string;
|
|
52
|
+
readonly source: 'plugin' | 'external';
|
|
53
|
+
readonly repositoryFingerprint: string;
|
|
54
|
+
/** Legacy journal field accepted on read and removed on the next stable write. */
|
|
55
|
+
readonly repository?: RepositoryIdentity;
|
|
56
|
+
readonly startedAt: string;
|
|
57
|
+
}
|
|
58
|
+
export type PendingOperation = CreateWorktreePendingOperation | RemoveWorktreePendingOperation | CleanWorktreePendingOperation;
|
|
45
59
|
export interface RecoveryIssue {
|
|
46
60
|
readonly code: 'WORKTREE_RECOVERY_REQUIRED' | 'WORKTREE_IDENTITY_CHANGED';
|
|
47
61
|
readonly worktreeId?: WorktreeId;
|
|
@@ -80,6 +94,8 @@ export interface DshReadAdapter {
|
|
|
80
94
|
listWorkspaces?(): Promise<readonly DshWorkspaceSummary[]>;
|
|
81
95
|
getSession(sessionId: string): Promise<DshSessionSummary | undefined>;
|
|
82
96
|
listSessions(): Promise<readonly DshSessionSummary[]>;
|
|
97
|
+
/** Optional read-only Session/subagent activity check. */
|
|
98
|
+
readWorktreeActivity?(sessionIds: readonly string[]): Promise<WorktreeActivity>;
|
|
83
99
|
}
|
|
84
100
|
/**
|
|
85
101
|
* `git worktree list --porcelain` 的最小投影;detached HEAD 等条目可以没有本地 branch。
|
|
@@ -87,6 +103,9 @@ export interface DshReadAdapter {
|
|
|
87
103
|
* detached HEAD may have no local branch.
|
|
88
104
|
*/
|
|
89
105
|
export interface GitWorktreeInfo {
|
|
106
|
+
readonly prunable?: boolean;
|
|
107
|
+
readonly locked?: boolean;
|
|
108
|
+
readonly bare?: boolean;
|
|
90
109
|
readonly absolutePath: string;
|
|
91
110
|
readonly branch?: string;
|
|
92
111
|
readonly headCommit?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AACxD,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,WAAW,GACX,WAAW,GACX,iBAAiB,CAAC;AAEtB,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAC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AU,EAAE,CAAC,CAAC;IAClC;;;;OAIG;IACH,YAAY,CAAC,CAAC,CAAC,EACb,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,CAAC,CAAC,GACpD,OAAO,CAAC,CAAC,CAAC,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACjC,MAAM,CAAC,CAAC,EACN,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GACxF,OAAO,CAAC,CAAC,CAAC,CAAC;CACf;AAED;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;gBAE3B,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;IAOxF;;;;OAIG;IACH,MAAM,IAAI;QAAE,IAAI,EAAE,iBAAiB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,oBAAoB,CAAA;KAAE;CAGtF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oBAAyB,GACjC,qBAAqB,CAEvB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAEtF"}
|
package/lib/provider/types.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* corruption rather than guessed or silently migrated.
|
|
5
5
|
*/
|
|
6
6
|
export const LEGACY_SIDECAR_SCHEMA_VERSION = 1;
|
|
7
|
-
export const SIDECAR_SCHEMA_VERSION =
|
|
7
|
+
export const SIDECAR_SCHEMA_VERSION = 4;
|
|
8
8
|
/**
|
|
9
9
|
* Provider/Manage 边界使用的结构化错误;稳定 code 供调用方分支,details 保留诊断上下文。
|
|
10
10
|
* Structured error used across the Provider/Manage boundary; callers branch on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/provider/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/provider/types.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAU,CAAC;AA6PjD;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,IAAI,CAAoB;IACxB,OAAO,CAAuB;IAEvC,YAAY,IAAuB,EAAE,OAAe,EAAE,UAAgC,EAAE;QACtF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IAC3E,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAuB,EACvB,OAAe,EACf,UAAgC,EAAE;IAElC,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,KAAK,YAAY,qBAAqB,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SidecarSnapshot } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Archive a Worktree record in place: change status to 'removed', preserving
|
|
4
|
+
* its physical directory, active Session bindings, and runtime cwd.
|
|
5
|
+
*/
|
|
6
|
+
export declare function archiveWorktreeSnapshot(snapshot: SidecarSnapshot, worktreeId: string): SidecarSnapshot;
|
|
7
|
+
/**
|
|
8
|
+
* Unarchive a Worktree record in place: change status back to 'active'.
|
|
9
|
+
*/
|
|
10
|
+
export declare function unarchiveWorktreeSnapshot(snapshot: SidecarSnapshot, worktreeId: string): SidecarSnapshot;
|
|
11
|
+
/**
|
|
12
|
+
* Mark a Worktree record as cleaned and detach any remaining active bindings.
|
|
13
|
+
*/
|
|
14
|
+
export declare function completeWorktreeCleanup(snapshot: SidecarSnapshot, worktreeId: string): SidecarSnapshot;
|
|
15
|
+
/**
|
|
16
|
+
* Remove a Worktree record and all its Session bindings completely from sidecar management.
|
|
17
|
+
*/
|
|
18
|
+
export declare function forgetWorktreeSnapshot(snapshot: SidecarSnapshot, worktreeId: string): SidecarSnapshot;
|
|
19
|
+
//# sourceMappingURL=worktree-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-lifecycle.d.ts","sourceRoot":"","sources":["../../src/provider/worktree-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,GACjB,eAAe,CAOjB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,GACjB,eAAe,CAOjB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,GACjB,eAAe,CAcjB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,GACjB,eAAe,CAMjB"}
|