@brimveyn/aimux-config 0.5.0 → 0.5.1
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/package.json +1 -1
- package/src/actions.ts +6 -0
- package/src/defaults.ts +8 -0
- package/src/types.ts +7 -0
package/package.json
CHANGED
package/src/actions.ts
CHANGED
|
@@ -48,6 +48,12 @@ export function helpModal(scope?: ModeId): KeyResult {
|
|
|
48
48
|
export const toggleSidebar: KeyResult = r([{ type: 'toggle-sidebar' }])
|
|
49
49
|
export const toggleGitPane: KeyResult = r([{ type: 'toggle-git-pane' }])
|
|
50
50
|
export const toggleSessionBar: KeyResult = r([{ type: 'toggle-session-bar' }])
|
|
51
|
+
export const toggleAIUsage: ActionFn = (ctx: ModeContext) => {
|
|
52
|
+
if (ctx.state.modal.type === 'ai-usage') {
|
|
53
|
+
return r([{ type: 'close-modal' }], [], 'navigation')
|
|
54
|
+
}
|
|
55
|
+
return r([{ type: 'open-ai-usage-modal' }], [], 'modal.ai-usage')
|
|
56
|
+
}
|
|
51
57
|
|
|
52
58
|
export function setGitPaneMode(mode: 'embedded' | 'pane'): KeyResult {
|
|
53
59
|
return r([{ mode, type: 'set-git-pane-mode' }])
|
package/src/defaults.ts
CHANGED
|
@@ -75,6 +75,7 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
75
75
|
.mode(['navigation', 'terminal-input'], (m) =>
|
|
76
76
|
m
|
|
77
77
|
.map('<Leader>b', actions.toggleSessionBar, 'Toggle session bar')
|
|
78
|
+
.map('<Leader>u', actions.toggleAIUsage, 'Toggle AI usage')
|
|
78
79
|
.map('<Leader>1', actions.switchSessionByIndex(1), 'Session 1')
|
|
79
80
|
.map('<Leader>2', actions.switchSessionByIndex(2), 'Session 2')
|
|
80
81
|
.map('<Leader>3', actions.switchSessionByIndex(3), 'Session 3')
|
|
@@ -147,6 +148,13 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
|
|
|
147
148
|
.passthrough()
|
|
148
149
|
)
|
|
149
150
|
|
|
151
|
+
// -----------------------------------------------------------------------
|
|
152
|
+
// Modal: ai-usage (info-only)
|
|
153
|
+
// -----------------------------------------------------------------------
|
|
154
|
+
.mode('modal.ai-usage', (m) =>
|
|
155
|
+
m.map('<Esc>', actions.closeModal, 'Close').map('<Leader>u', actions.toggleAIUsage, 'Close')
|
|
156
|
+
)
|
|
157
|
+
|
|
150
158
|
// -----------------------------------------------------------------------
|
|
151
159
|
// Modal: update-available
|
|
152
160
|
// -----------------------------------------------------------------------
|
package/src/types.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type ModeId =
|
|
|
27
27
|
| 'modal.git-commit.confirm'
|
|
28
28
|
| 'modal.git-commit.generating'
|
|
29
29
|
| 'modal.update-available'
|
|
30
|
+
| 'modal.ai-usage'
|
|
30
31
|
|
|
31
32
|
// ─── Primitive app types ──────────────────────────────────────────────────────
|
|
32
33
|
|
|
@@ -308,6 +309,10 @@ export interface ModalUpdateAvailable extends ModalBase {
|
|
|
308
309
|
latestVersion: string
|
|
309
310
|
}
|
|
310
311
|
|
|
312
|
+
export interface ModalAIUsage extends ModalBase {
|
|
313
|
+
type: 'ai-usage'
|
|
314
|
+
}
|
|
315
|
+
|
|
311
316
|
export type ModalState =
|
|
312
317
|
| ModalClosed
|
|
313
318
|
| ModalNewTab
|
|
@@ -322,6 +327,7 @@ export type ModalState =
|
|
|
322
327
|
| ModalSnippetEditor
|
|
323
328
|
| ModalGitCommit
|
|
324
329
|
| ModalUpdateAvailable
|
|
330
|
+
| ModalAIUsage
|
|
325
331
|
|
|
326
332
|
export interface LayoutState {
|
|
327
333
|
terminalCols: number
|
|
@@ -407,6 +413,7 @@ export type ModalAction =
|
|
|
407
413
|
| { type: 'set-theme-entry-count'; count: number }
|
|
408
414
|
| { type: 'open-theme-picker' }
|
|
409
415
|
| { type: 'open-update-available-modal'; currentVersion: string; latestVersion: string }
|
|
416
|
+
| { type: 'open-ai-usage-modal' }
|
|
410
417
|
|
|
411
418
|
export type SessionAction =
|
|
412
419
|
| { type: 'load-session'; sessionId: string; workspaceSnapshot?: WorkspaceSnapshotV1 }
|