@brimveyn/aimux 1.7.4 → 1.8.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 -15
- package/package.json +2 -2
- package/src/app-runtime/auto-commit-driver.ts +286 -0
- package/src/app-runtime/auto-commit-ref.ts +20 -0
- package/src/app-runtime/backend-attach-runtime.ts +3 -1
- package/src/app-runtime/session-actions.ts +7 -2
- package/src/app-runtime/side-effects.ts +99 -1
- package/src/app-runtime/use-auto-commit-driver.ts +133 -0
- package/src/app-runtime/use-terminal-resize.ts +20 -12
- package/src/app.tsx +59 -22
- package/src/auto-commit/default-auto-commit-prompt.md +46 -0
- package/src/auto-commit/headless-commands.ts +40 -0
- package/src/auto-commit/output-parser.ts +21 -0
- package/src/auto-commit/prompt-loader.ts +33 -0
- package/src/auto-commit/staging-mode.ts +5 -0
- package/src/auto-commit/strip-ansi.ts +13 -0
- package/src/auto-commit/suggestion-runner.ts +55 -0
- package/src/auto-commit/working-tree-hash.ts +24 -0
- package/src/config.ts +24 -0
- package/src/daemon/session-registry.ts +1 -0
- package/src/index.tsx +1 -1
- package/src/input/keymap/help-entries.ts +4 -4
- package/src/input/modes/bridge.ts +6 -0
- package/src/input/modes/transitions.ts +3 -1
- package/src/input/modes/types.ts +4 -0
- package/src/ipc/manager-protocol.ts +2 -2
- package/src/ipc/protocol.ts +2 -8
- package/src/pty/assistant-status-detector.ts +1 -1
- package/src/pty/terminal-snapshot.ts +38 -4
- package/src/services/ai-usage/adapters/claude.ts +139 -0
- package/src/services/ai-usage/adapters/codex.ts +191 -0
- package/src/services/ai-usage/provider.ts +84 -0
- package/src/services/ai-usage/spawn.ts +49 -0
- package/src/services/ai-usage/types.ts +20 -0
- package/src/session-backend/local-session-backend.ts +10 -2
- package/src/state/ai-usage-store.ts +29 -0
- package/src/state/reducers/auto-commit-state.ts +59 -0
- package/src/state/reducers/modal-state.ts +106 -2
- package/src/state/reducers/session-state.ts +26 -14
- package/src/state/session-persistence.ts +14 -5
- package/src/state/store.ts +24 -14
- package/src/state/types.ts +55 -2
- package/src/state/workspace-save.ts +4 -0
- package/src/ui/ai-usage/controller.ts +35 -0
- package/src/ui/components/ai-usage-indicator.tsx +131 -0
- package/src/ui/components/ai-usage-popover.tsx +152 -0
- package/src/ui/components/create-session-modal.tsx +2 -2
- package/src/ui/components/git-commit-modal.tsx +167 -18
- package/src/ui/components/session-bar.tsx +2 -2
- package/src/ui/components/session-picker-modal.tsx +4 -4
- package/src/ui/components/sidebar.tsx +3 -1
- package/src/ui/components/status-bar.tsx +2 -0
- package/src/ui/components/terminal-pane.tsx +18 -3
- package/src/ui/root.tsx +13 -2
- package/src/ui/status-bar-model.ts +1 -1
package/src/ui/root.tsx
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { MouseEvent } from '@opentui/core'
|
|
2
2
|
|
|
3
3
|
import type { TerminalContentOrigin } from '../input/raw-input-handler'
|
|
4
|
-
import type { ModalState, SessionRecord, SnippetRecord } from '../state/types'
|
|
4
|
+
import type { FocusMode, ModalState, SessionRecord, SnippetRecord } from '../state/types'
|
|
5
5
|
import type { ThemeId } from './themes'
|
|
6
6
|
|
|
7
7
|
import { useAppStore } from '../state/app-store'
|
|
8
8
|
import { dispatchGlobal } from '../state/dispatch-ref'
|
|
9
9
|
import { getGitPaneWidthFromRatio } from '../state/git-pane-sizing'
|
|
10
10
|
import { getTreeForTab, PANE_BORDER, type SplitDirection } from '../state/layout-tree'
|
|
11
|
+
import { AIUsagePopover } from './components/ai-usage-popover'
|
|
11
12
|
import { ContextMenuBox } from './components/context-menu-box'
|
|
12
13
|
import { ContextMenuOverlay } from './components/context-menu-overlay'
|
|
13
14
|
import { CreateSessionModal } from './components/create-session-modal'
|
|
@@ -78,6 +79,9 @@ function renderModal(
|
|
|
78
79
|
themeId: ThemeId
|
|
79
80
|
createSessionFields: { directoryQuery: string; sessionName: string }
|
|
80
81
|
snippetEditorFields: { snippetName: string; snippetContent: string }
|
|
82
|
+
focusMode: FocusMode
|
|
83
|
+
activeAssistant?: string
|
|
84
|
+
autoCommitModel?: string
|
|
81
85
|
}
|
|
82
86
|
) {
|
|
83
87
|
switch (modal.type) {
|
|
@@ -107,7 +111,7 @@ function renderModal(
|
|
|
107
111
|
case 'session-name':
|
|
108
112
|
return (
|
|
109
113
|
<SessionNameModal
|
|
110
|
-
title={modal.sessionTargetId ? 'Rename
|
|
114
|
+
title={modal.sessionTargetId ? 'Rename workspace' : 'Create workspace'}
|
|
111
115
|
value={modal.editBuffer ?? ''}
|
|
112
116
|
/>
|
|
113
117
|
)
|
|
@@ -176,8 +180,11 @@ function renderModal(
|
|
|
176
180
|
return (
|
|
177
181
|
<GitCommitModal
|
|
178
182
|
activeField={modal.activeField}
|
|
183
|
+
assistant={options.activeAssistant}
|
|
179
184
|
body={bodyText}
|
|
180
185
|
cursorPos={modal.cursorPos ?? (modal.editBuffer ?? '').length}
|
|
186
|
+
model={options.autoCommitModel}
|
|
187
|
+
stage={modal.stage}
|
|
181
188
|
title={titleText}
|
|
182
189
|
/>
|
|
183
190
|
)
|
|
@@ -272,11 +279,14 @@ export function RootView({
|
|
|
272
279
|
<StatusBar />
|
|
273
280
|
<PendingChordOverlay />
|
|
274
281
|
<ContextMenuOverlay />
|
|
282
|
+
<AIUsagePopover />
|
|
275
283
|
{renderModal(modal, {
|
|
284
|
+
activeAssistant: activeTab?.assistant,
|
|
276
285
|
createSessionFields,
|
|
277
286
|
currentSessionId,
|
|
278
287
|
currentTabCount: tabs.length,
|
|
279
288
|
customCommands,
|
|
289
|
+
focusMode,
|
|
280
290
|
sessions,
|
|
281
291
|
snippetEditorFields,
|
|
282
292
|
snippets,
|
|
@@ -379,6 +389,7 @@ export function RootView({
|
|
|
379
389
|
currentSessionId,
|
|
380
390
|
currentTabCount: tabs.length,
|
|
381
391
|
customCommands,
|
|
392
|
+
focusMode,
|
|
382
393
|
sessions,
|
|
383
394
|
snippetEditorFields,
|
|
384
395
|
snippets,
|
|
@@ -61,7 +61,7 @@ export function getStatusBarModel(
|
|
|
61
61
|
const currentSession = state.currentSessionId
|
|
62
62
|
? state.sessions.find((session) => session.id === state.currentSessionId)
|
|
63
63
|
: undefined
|
|
64
|
-
const sessionName = currentSession?.name ?? 'no
|
|
64
|
+
const sessionName = currentSession?.name ?? 'no workspace'
|
|
65
65
|
const sessionLabel = currentSession?.projectPath
|
|
66
66
|
? `${sessionName} (${abbreviatePath(currentSession.projectPath)})`
|
|
67
67
|
: sessionName
|