@brimveyn/aimux 1.20.4 → 1.22.0
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 +27 -25
- package/package.json +2 -2
- package/src/app-runtime/auto-commit-driver.ts +22 -27
- package/src/app-runtime/backend-attach-runtime.ts +43 -36
- package/src/app-runtime/backend-runtime-events.ts +107 -88
- package/src/app-runtime/editor-actions.ts +201 -0
- package/src/app-runtime/git-actions.ts +197 -0
- package/src/app-runtime/measure-ref.ts +19 -0
- package/src/app-runtime/navigation-actions.ts +213 -0
- package/src/app-runtime/project-actions.ts +188 -0
- package/src/app-runtime/prompt-injection.ts +123 -0
- package/src/app-runtime/selection.ts +29 -0
- package/src/app-runtime/settings-actions.ts +156 -0
- package/src/app-runtime/setup-actions.ts +237 -0
- package/src/app-runtime/side-effect-context.ts +33 -0
- package/src/app-runtime/side-effects.ts +305 -1589
- package/src/app-runtime/snippet-actions.ts +3 -2
- package/src/app-runtime/split-drag-controller.ts +4 -8
- package/src/app-runtime/tab-actions.ts +218 -0
- package/src/app-runtime/tab-runtime-timeouts.ts +1 -1
- package/src/app-runtime/use-auto-commit-driver.ts +14 -13
- package/src/app-runtime/use-backend-runtime.ts +12 -11
- package/src/app-runtime/use-directory-search.ts +5 -4
- package/src/app-runtime/use-mouse-handlers.ts +28 -42
- package/src/app-runtime/{use-workspace-autosave.ts → use-project-autosave.ts} +4 -4
- package/src/app-runtime/use-renderer-bindings.ts +2 -1
- package/src/app-runtime/use-setup-runner.ts +96 -0
- package/src/app-runtime/use-terminal-resize.ts +28 -33
- package/src/app-runtime/workspace-actions.ts +366 -0
- package/src/app-runtime/workspace-activity.ts +138 -0
- package/src/app-runtime/workspace-naming.ts +90 -0
- package/src/app.tsx +102 -85
- package/src/assets/sounds/bell.wav +0 -0
- package/src/assets/sounds/ding.wav +0 -0
- package/src/assets/sounds/plane.wav +0 -0
- package/src/cli/client/daemon-client.ts +2 -2
- package/src/cli/client/project-resolver.ts +112 -0
- package/src/cli/commands/project/close.ts +32 -0
- package/src/cli/commands/project/create.ts +93 -0
- package/src/cli/commands/project/list.ts +25 -0
- package/src/cli/commands/project/show.ts +32 -0
- package/src/cli/commands/{workspace → project}/switch.ts +19 -19
- package/src/cli/commands/tab/await.ts +2 -2
- package/src/cli/commands/tab/close.ts +3 -3
- package/src/cli/commands/tab/create.ts +74 -73
- package/src/cli/commands/tab/focus.ts +3 -3
- package/src/cli/commands/tab/list.ts +6 -6
- package/src/cli/commands/tab/run.ts +2 -2
- package/src/cli/commands/tab/send.ts +2 -2
- package/src/cli/commands/tab/snapshot.ts +2 -2
- package/src/cli/commands/tab/tail.ts +2 -2
- package/src/cli/commands/tab/wait.ts +2 -2
- package/src/cli/commands/worker/await.ts +3 -3
- package/src/cli/commands/worker/doctor.ts +30 -30
- package/src/cli/commands/worker/list.ts +15 -15
- package/src/cli/commands/worker/prompt.ts +3 -3
- package/src/cli/commands/worker/run.ts +23 -23
- package/src/cli/commands/worker/shared.ts +53 -59
- package/src/cli/commands/worker/stop.ts +29 -29
- package/src/cli/commands/worker/submit.ts +3 -3
- package/src/cli/commands/{worktree → workspace}/create-core.ts +26 -26
- package/src/cli/commands/workspace/create.ts +30 -68
- package/src/cli/commands/workspace/list.ts +52 -9
- package/src/cli/commands/workspace/remove.ts +81 -0
- package/src/cli/completion/plan.ts +2 -2
- package/src/cli/completion/sources.ts +18 -18
- package/src/cli/context.ts +13 -13
- package/src/cli/flags.ts +30 -10
- package/src/cli/index.ts +26 -16
- package/src/cli/output.ts +1 -1
- package/src/cli/registry.ts +12 -12
- package/src/config/loader.ts +16 -5
- package/src/config.ts +149 -101
- package/src/daemon/catalog-writer.ts +67 -67
- package/src/daemon/daemon.ts +205 -201
- package/src/daemon/session-manager.ts +39 -39
- package/src/daemon/session-registry.ts +14 -14
- package/src/git/divergence.ts +33 -2
- package/src/git/git-poller.ts +1 -1
- package/src/git/git-status.ts +2 -2
- package/src/git/{move-worktree.ts → move-workspace.ts} +5 -5
- package/src/git/pr-merge.ts +64 -0
- package/src/git/pr-status-poller.ts +57 -0
- package/src/git/pr-status.ts +227 -0
- package/src/git/repo-discovery.ts +1 -1
- package/src/git/use-repo-discovery.ts +1 -1
- package/src/git/workspace-branch-poller.ts +54 -0
- package/src/git/workspace-divergence-poller.ts +65 -0
- package/src/git/worktree.ts +29 -0
- package/src/index.tsx +11 -6
- package/src/input/keymap/help-entries.ts +7 -5
- package/src/input/modes/bridge.ts +13 -12
- package/src/input/modes/handlers/shared.ts +1 -1
- package/src/input/modes/transitions.ts +34 -21
- package/src/input/modes/types.ts +48 -31
- package/src/ipc/manager-protocol.ts +44 -44
- package/src/ipc/protocol.ts +192 -166
- package/src/platform/open-url.ts +39 -0
- package/src/platform/play-sound.ts +184 -0
- package/src/platform/project-search.ts +8 -8
- package/src/platform/worktree-paths.ts +8 -6
- package/src/pty/assistant-question-extractor.ts +1 -1
- package/src/pty/assistant-status-detection-loop.ts +79 -55
- package/src/pty/assistant-status-detector.ts +40 -15
- package/src/pty/command-registry.ts +81 -1
- package/src/restart-terminal-manager.ts +1 -1
- package/src/services/ai-usage/provider.ts +9 -2
- package/src/services/ai-usage/spawn.ts +3 -1
- package/src/session-backend/bootstrap.ts +4 -4
- package/src/session-backend/local-session-backend.ts +78 -75
- package/src/session-backend/remote-session-backend.ts +64 -52
- package/src/session-backend/types.ts +43 -32
- package/src/settings/live.ts +90 -0
- package/src/settings/search.ts +43 -0
- package/src/settings/sections/about.ts +49 -0
- package/src/settings/sections/appearance.ts +54 -0
- package/src/settings/sections/automation.ts +105 -0
- package/src/settings/sections/commands.ts +72 -0
- package/src/settings/sections/editor.ts +56 -0
- package/src/settings/sections/experimental.ts +57 -0
- package/src/settings/sections/git.ts +112 -0
- package/src/settings/sections/index.ts +95 -0
- package/src/settings/sections/integrations.ts +23 -0
- package/src/settings/sections/layout.ts +72 -0
- package/src/settings/sections/notifications.ts +99 -0
- package/src/settings/sections/setup.ts +54 -0
- package/src/settings/sections/status-bar.ts +63 -0
- package/src/settings/settings-store.ts +207 -0
- package/src/settings/types.ts +108 -0
- package/src/snippets/run-shell-var.ts +48 -22
- package/src/state/actions.ts +342 -0
- package/src/state/app-store.ts +2 -1
- package/src/state/bars.ts +75 -0
- package/src/state/dispatch-ref.ts +1 -1
- package/src/state/git-pane-sizing.ts +0 -9
- package/src/state/layout-resize.ts +2 -2
- package/src/state/pr-status-store.ts +39 -0
- package/src/state/project-catalog.ts +275 -0
- package/src/state/project-data.ts +143 -0
- package/src/state/{session-persistence.ts → project-persistence.ts} +77 -73
- package/src/state/project-save.ts +46 -0
- package/src/state/project-workspaces.ts +392 -0
- package/src/state/reducers/auto-commit-state.ts +11 -10
- package/src/state/reducers/git-commit-modal-state.ts +122 -0
- package/src/state/reducers/git-mode-state.ts +1 -1
- package/src/state/reducers/git-panel-state.ts +10 -53
- package/src/state/reducers/modal-state.ts +290 -681
- package/src/state/reducers/multi-repo-state.ts +3 -6
- package/src/state/reducers/project-state.ts +312 -0
- package/src/state/reducers/settings-state.ts +80 -0
- package/src/state/reducers/tab-state.ts +107 -60
- package/src/state/reducers/ui-state.ts +86 -15
- package/src/state/selectors.ts +49 -37
- package/src/state/store.ts +83 -57
- package/src/state/types.ts +261 -417
- package/src/state/validation.ts +14 -12
- package/src/terminal-manager/manager-client.ts +32 -32
- package/src/terminal-manager/terminal-manager.ts +24 -24
- package/src/ui/components/git/diff-renderer/pierre-diff.tsx +2 -1
- package/src/ui/components/git/git-panel.tsx +2 -2
- package/src/ui/components/git/git-view.tsx +12 -12
- package/src/ui/components/git/image-diff/image-diff-view.tsx +1 -1
- package/src/ui/components/git/pane/git-pane-header.tsx +105 -39
- package/src/ui/components/git/pane/git-pane-widget.tsx +37 -23
- package/src/ui/components/git/pane/pr-checks-panel.tsx +197 -0
- package/src/ui/components/git/pane/pr-state-row.tsx +103 -0
- package/src/ui/components/layout/bar.tsx +191 -0
- package/src/ui/components/layout/sidebar/project-list.tsx +444 -0
- package/src/ui/components/layout/sidebar/tab-item.tsx +27 -12
- package/src/ui/components/layout/sidebar/use-sidebar-auto-scroll.ts +1 -1
- package/src/ui/components/layout/sidebar/workspace-row.tsx +253 -0
- package/src/ui/components/layout/status-bar.tsx +6 -2
- package/src/ui/components/layout/terminal-pane.tsx +34 -29
- package/src/ui/components/layout/top-tab-bar.tsx +48 -37
- package/src/ui/components/modals/git/git-commit-modal.tsx +8 -8
- package/src/ui/components/modals/{sessions/create-session-modal.tsx → projects/create-project-modal.tsx} +12 -12
- package/src/ui/components/modals/{sessions/session-name-modal.tsx → projects/project-name-modal.tsx} +2 -2
- package/src/ui/components/modals/{sessions/session-picker-modal.tsx → projects/project-picker-modal.tsx} +33 -35
- package/src/ui/components/modals/settings/settings-search-modal.tsx +70 -0
- package/src/ui/components/modals/shared/form.tsx +34 -22
- package/src/ui/components/modals/shared/picker.tsx +10 -10
- package/src/ui/components/modals/shared/{worktree-delete-confirm.tsx → workspace-delete-confirm.tsx} +9 -9
- package/src/ui/components/modals/tabs/new-tab-modal.tsx +30 -324
- package/src/ui/components/modals/workspace/create-workspace-modal.tsx +101 -0
- package/src/ui/components/modals/{worktree/worktree-move-confirm-modal.tsx → workspace/workspace-move-confirm-modal.tsx} +5 -5
- package/src/ui/components/modals/{worktree/worktree-move-modal.tsx → workspace/workspace-move-modal.tsx} +29 -27
- package/src/ui/components/primitives/input-field.tsx +7 -3
- package/src/ui/components/primitives/surface.tsx +3 -0
- package/src/ui/components/settings/row-value.tsx +74 -0
- package/src/ui/components/settings/settings-row.tsx +78 -0
- package/src/ui/components/settings/settings-view.tsx +169 -0
- package/src/ui/components/setup/setup-widget.tsx +152 -0
- package/src/ui/flash/build-labels.ts +27 -27
- package/src/ui/hooks/use-activity-sprite.ts +73 -0
- package/src/ui/hooks/use-scroll-active-into-view.ts +26 -0
- package/src/ui/{session-ordering.ts → project-ordering.ts} +4 -4
- package/src/ui/root.tsx +164 -230
- package/src/ui/status-bar-model.ts +48 -34
- package/src/ui/terminal-graphics/kitty.ts +28 -2
- package/src/ui/terminal-graphics/sprites/done@330/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/done@330/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/idle@1000/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/idle@1000/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/waiting@170/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/waiting@170/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/2.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/3.png +0 -0
- package/src/ui/terminal-graphics/sprites.ts +246 -0
- package/src/ui/truncate.ts +7 -0
- package/src/ui/widgets/registry.tsx +21 -0
- package/src/ui/widgets/widget-context-menu.ts +85 -0
- package/src/update.ts +2 -2
- package/src/app-runtime/session-actions.ts +0 -187
- package/src/cli/client/workspace-resolver.ts +0 -110
- package/src/cli/commands/workspace/close.ts +0 -32
- package/src/cli/commands/workspace/show.ts +0 -32
- package/src/cli/commands/worktree/create.ts +0 -55
- package/src/cli/commands/worktree/list.ts +0 -68
- package/src/cli/commands/worktree/remove.ts +0 -81
- package/src/git/worktree-branch-poller.ts +0 -54
- package/src/git/worktree-divergence-poller.ts +0 -59
- package/src/state/reducers/session-state.ts +0 -262
- package/src/state/session-catalog.ts +0 -143
- package/src/state/session-worktrees.ts +0 -260
- package/src/state/workspace-save.ts +0 -45
- package/src/ui/components/git/pane/git-pane-context-menu.ts +0 -26
- package/src/ui/components/layout/sidebar/sidebar.tsx +0 -163
- package/src/ui/components/layout/sidebar/use-top-tab-bar-auto-scroll.ts +0 -30
- package/src/ui/components/layout/sidebar/workspace-list.tsx +0 -418
- package/src/ui/components/layout/sidebar/worktree-row.tsx +0 -149
- /package/src/ui/{components/git/image-diff → terminal-graphics}/dimensions.ts +0 -0
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import type { MouseEvent as OtuiMouseEvent } from '@opentui/core'
|
|
2
|
-
|
|
3
|
-
import { memo, useCallback, useMemo } from 'react'
|
|
4
|
-
|
|
5
|
-
import type { SessionRecord, WorktreeRecord } from '../../../../state/types'
|
|
6
|
-
|
|
7
|
-
import { useAppStore } from '../../../../state/app-store'
|
|
8
|
-
import { dispatchGlobal, runSideEffectGlobal } from '../../../../state/dispatch-ref'
|
|
9
|
-
import { formatDivergence } from '../../../../state/session-worktrees'
|
|
10
|
-
import { useBaseTheme, useTheme } from '../../../theme'
|
|
11
|
-
import { FlashLabelBadge } from '../../flash/flash-label-badge'
|
|
12
|
-
import { ContextMenuBox } from '../../overlays/context-menu/context-menu-box'
|
|
13
|
-
|
|
14
|
-
interface WorktreeRowProps {
|
|
15
|
-
session: SessionRecord
|
|
16
|
-
worktree: WorktreeRecord
|
|
17
|
-
/** 1-based index of the workspace in the visible order (for switch-session-by-index). */
|
|
18
|
-
sessionIndex: number
|
|
19
|
-
/** True when this row is the active cursor item. */
|
|
20
|
-
isActiveItem: boolean
|
|
21
|
-
/** True when this row's workspace is the current session (selection scope). */
|
|
22
|
-
inCurrentGroup: boolean
|
|
23
|
-
/** True when this is the last non-primary worktree of its workspace. Drives └─ vs ├─. */
|
|
24
|
-
isLast: boolean
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const WorktreeRow = memo(function WorktreeRow({
|
|
28
|
-
inCurrentGroup,
|
|
29
|
-
isActiveItem,
|
|
30
|
-
isLast,
|
|
31
|
-
session,
|
|
32
|
-
sessionIndex,
|
|
33
|
-
worktree,
|
|
34
|
-
}: WorktreeRowProps) {
|
|
35
|
-
const t = useTheme()
|
|
36
|
-
// Selection highlight must stay opaque in transparent mode.
|
|
37
|
-
const base = useBaseTheme()
|
|
38
|
-
const currentSessionId = useAppStore((s) => s.currentSessionId)
|
|
39
|
-
const isCurrentSession = session.id === currentSessionId
|
|
40
|
-
const divergence = useAppStore((s) => s.worktreeDivergence[worktree.id])
|
|
41
|
-
|
|
42
|
-
const handleMouseDown = useCallback(
|
|
43
|
-
(event: OtuiMouseEvent) => {
|
|
44
|
-
if (event.button !== 0) return
|
|
45
|
-
event.preventDefault()
|
|
46
|
-
event.stopPropagation()
|
|
47
|
-
if (isCurrentSession) {
|
|
48
|
-
dispatchGlobal({
|
|
49
|
-
sessionId: session.id,
|
|
50
|
-
type: 'set-active-worktree',
|
|
51
|
-
worktreeId: worktree.id,
|
|
52
|
-
})
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
// Cross-workspace click: send the worktree id along with the switch so
|
|
56
|
-
// the side effect can apply it atomically. Splitting it into a separate
|
|
57
|
-
// dispatch+switch leaves a window where subscribers/re-renders can
|
|
58
|
-
// re-assert the target session's last-persisted worktree.
|
|
59
|
-
runSideEffectGlobal({
|
|
60
|
-
index: sessionIndex,
|
|
61
|
-
type: 'switch-session-by-index',
|
|
62
|
-
worktreeId: worktree.id,
|
|
63
|
-
})
|
|
64
|
-
},
|
|
65
|
-
[isCurrentSession, session.id, sessionIndex, worktree.id]
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
const rightClickMenu = useMemo<[string, () => void][] | undefined>(() => {
|
|
69
|
-
const entries: [string, () => void][] = [
|
|
70
|
-
[
|
|
71
|
-
'Rename',
|
|
72
|
-
() =>
|
|
73
|
-
dispatchGlobal({
|
|
74
|
-
initialName: worktree.name,
|
|
75
|
-
sessionId: session.id,
|
|
76
|
-
type: 'open-rename-worktree-modal',
|
|
77
|
-
worktreeId: worktree.id,
|
|
78
|
-
}),
|
|
79
|
-
],
|
|
80
|
-
]
|
|
81
|
-
if (worktree.source !== 'primary') {
|
|
82
|
-
entries.push([
|
|
83
|
-
'Remove worktree',
|
|
84
|
-
() =>
|
|
85
|
-
// Always confirm first. Confirming routes through the full delete side
|
|
86
|
-
// effect (closes the worktree's tabs, disposes their PTYs, prunes the
|
|
87
|
-
// snapshot, removes the git worktree). closeTabs (not force) cleans up
|
|
88
|
-
// the tabs while keeping the non-force `git worktree remove`, so
|
|
89
|
-
// uncommitted work in a temp worktree is still protected — a dirty
|
|
90
|
-
// worktree re-prompts for an explicit force-delete.
|
|
91
|
-
dispatchGlobal({
|
|
92
|
-
closeTabs: true,
|
|
93
|
-
force: false,
|
|
94
|
-
reason: 'Its assistant tabs will be closed and the worktree removed.',
|
|
95
|
-
sessionId: session.id,
|
|
96
|
-
type: 'open-worktree-delete-confirm',
|
|
97
|
-
worktreeId: worktree.id,
|
|
98
|
-
worktreeLabel: worktree.branch ?? worktree.name,
|
|
99
|
-
}),
|
|
100
|
-
])
|
|
101
|
-
}
|
|
102
|
-
return entries
|
|
103
|
-
}, [session.id, worktree.branch, worktree.id, worktree.name, worktree.source])
|
|
104
|
-
|
|
105
|
-
let bgColor: string | undefined
|
|
106
|
-
if (isActiveItem) {
|
|
107
|
-
bgColor = base.backgroundElement
|
|
108
|
-
} else if (inCurrentGroup) {
|
|
109
|
-
bgColor = base.backgroundPanel
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const connector = isLast ? '└─' : '├─'
|
|
113
|
-
const branchCont = isLast ? ' ' : '│ '
|
|
114
|
-
const branchText = worktree.branch ?? ''
|
|
115
|
-
const showBranch = branchText !== ''
|
|
116
|
-
const divergenceText = formatDivergence(divergence)
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<ContextMenuBox
|
|
120
|
-
id={`sidebar-wt-${worktree.id}`}
|
|
121
|
-
flexDirection="column"
|
|
122
|
-
flexShrink={0}
|
|
123
|
-
paddingLeft={1}
|
|
124
|
-
paddingRight={1}
|
|
125
|
-
backgroundColor={bgColor}
|
|
126
|
-
rightClickMenu={rightClickMenu}
|
|
127
|
-
onMouseDown={handleMouseDown}
|
|
128
|
-
>
|
|
129
|
-
<box flexDirection="row" alignItems="center">
|
|
130
|
-
<text fg={t.textMuted} selectable={false} wrapMode="none">
|
|
131
|
-
{connector}{' '}
|
|
132
|
-
</text>
|
|
133
|
-
<FlashLabelBadge rowKey={`wt:${worktree.id}`} />
|
|
134
|
-
<text fg={t.text} selectable={false} wrapMode="none">
|
|
135
|
-
{worktree.name}
|
|
136
|
-
</text>
|
|
137
|
-
</box>
|
|
138
|
-
{showBranch ? (
|
|
139
|
-
<box flexDirection="row">
|
|
140
|
-
<text fg={t.textMuted} selectable={false} wrapMode="none">
|
|
141
|
-
{branchCont}
|
|
142
|
-
{'\u{e702}'} {branchText}
|
|
143
|
-
{divergenceText !== '' ? ` ${divergenceText}` : ''}
|
|
144
|
-
</text>
|
|
145
|
-
</box>
|
|
146
|
-
) : null}
|
|
147
|
-
</ContextMenuBox>
|
|
148
|
-
)
|
|
149
|
-
})
|
|
File without changes
|