@brimveyn/aimux-config 0.5.2 → 0.5.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimveyn/aimux-config",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "TypeScript configuration API for aimux — keymaps, themes, and backends with a fluent builder.",
5
5
  "keywords": [
6
6
  "aimux",
package/src/defaults.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AutoCommitConfig, ResolvedKeymapConfig } from './types'
1
+ import type { AutoCommitConfig, MultiRepoConfig, ResolvedKeymapConfig } from './types'
2
2
 
3
3
  import * as actions from './actions'
4
4
  import { KeymapBuilder } from './keymap-builder'
@@ -12,6 +12,11 @@ export const DEFAULT_AUTO_COMMIT_CONFIG: AutoCommitConfig = {
12
12
  timeoutMs: 60_000,
13
13
  }
14
14
 
15
+ export const DEFAULT_MULTI_REPO_CONFIG: MultiRepoConfig = {
16
+ enabled: true,
17
+ maxDepth: 1,
18
+ }
19
+
15
20
  /**
16
21
  * Build the default keymap — 1:1 transcription of all existing handlers.
17
22
  */
package/src/index.ts CHANGED
@@ -25,6 +25,8 @@ export { GroupBuilder, KeymapBuilder, ModeBindingBuilder } from './keymap-builde
25
25
  export { getDefaultKeymapConfig } from './defaults'
26
26
  export { resolveConfig } from './resolver'
27
27
  export { isAutoCommitEnabled, setAutoCommitEnabled } from './auto-commit-runtime'
28
+ export { getMultiRepoConfig, setMultiRepoConfig } from './multi-repo-runtime'
29
+ export { DEFAULT_MULTI_REPO_CONFIG } from './defaults'
28
30
 
29
31
  // Type exports
30
32
  export type {
@@ -43,6 +45,7 @@ export type {
43
45
  AutoCommitConfig,
44
46
  BackendConfig,
45
47
  BindingDef,
48
+ DiscoveredRepo,
46
49
  FocusMode,
47
50
  GitFileListMode,
48
51
  GitPaneConfig,
@@ -65,6 +68,8 @@ export type {
65
68
  // Mode / state
66
69
  ModeId,
67
70
  ModeKeymapDef,
71
+ MultiRepoConfig,
72
+ MultiRepoState,
68
73
  // Resolved config (internal, but exported for tooling)
69
74
  ResolvedConfig,
70
75
  ResolvedKeymapConfig,
@@ -0,0 +1,20 @@
1
+ import type { MultiRepoConfig } from './types'
2
+
3
+ import { DEFAULT_MULTI_REPO_CONFIG } from './defaults'
4
+
5
+ /**
6
+ * Module-level mirror of `multiRepo` from the resolved config.
7
+ *
8
+ * Set once at startup via `setMultiRepoConfig(resolvedConfig.multiRepo)`. Read
9
+ * by non-React code paths (discovery, poller merge) that need the flag and depth.
10
+ */
11
+
12
+ let current: MultiRepoConfig = DEFAULT_MULTI_REPO_CONFIG
13
+
14
+ export function setMultiRepoConfig(value: MultiRepoConfig): void {
15
+ current = value
16
+ }
17
+
18
+ export function getMultiRepoConfig(): MultiRepoConfig {
19
+ return current
20
+ }
package/src/resolver.ts CHANGED
@@ -3,11 +3,16 @@ import type {
3
3
  AutoCommitConfig,
4
4
  ModeId,
5
5
  ModeKeymapDef,
6
+ MultiRepoConfig,
6
7
  ResolvedConfig,
7
8
  ResolvedKeymapConfig,
8
9
  } from './types'
9
10
 
10
- import { DEFAULT_AUTO_COMMIT_CONFIG, getDefaultKeymapConfig } from './defaults'
11
+ import {
12
+ DEFAULT_AUTO_COMMIT_CONFIG,
13
+ DEFAULT_MULTI_REPO_CONFIG,
14
+ getDefaultKeymapConfig,
15
+ } from './defaults'
11
16
  import { KeymapBuilder } from './keymap-builder'
12
17
 
13
18
  /**
@@ -23,12 +28,18 @@ export function resolveConfig(userConfig: AimuxUserConfig): ResolvedConfig {
23
28
  timeoutMs: userConfig.autoCommit?.timeoutMs ?? DEFAULT_AUTO_COMMIT_CONFIG.timeoutMs,
24
29
  }
25
30
 
31
+ const multiRepo: MultiRepoConfig = {
32
+ enabled: userConfig.multiRepo?.enabled ?? DEFAULT_MULTI_REPO_CONFIG.enabled,
33
+ maxDepth: Math.max(1, userConfig.multiRepo?.maxDepth ?? DEFAULT_MULTI_REPO_CONFIG.maxDepth),
34
+ }
35
+
26
36
  return {
27
37
  autoCommit,
28
38
  backends: userConfig.backends ?? {},
29
39
  gitPane: resolveGitPane(userConfig.gitPane),
30
40
  hooks: userConfig.hooks ?? {},
31
41
  keymaps,
42
+ multiRepo,
32
43
  sessionBar: resolveSessionBar(userConfig.sessionBar),
33
44
  sidebar: userConfig.sidebar ?? {},
34
45
  snippets: userConfig.snippets ?? [],
package/src/types.ts CHANGED
@@ -363,6 +363,17 @@ export interface AutoCommitState {
363
363
  bySession: Record<string, AutoCommitSuggestion>
364
364
  }
365
365
 
366
+ export interface DiscoveredRepo {
367
+ path: string
368
+ name: string
369
+ isRoot: boolean
370
+ }
371
+
372
+ export interface MultiRepoState {
373
+ repos: DiscoveredRepo[]
374
+ prefixes: Record<string, string>
375
+ }
376
+
366
377
  export interface AppState {
367
378
  tabs: TabSession[]
368
379
  activeTabId: string | null
@@ -382,6 +393,7 @@ export interface AppState {
382
393
  gitPanel: GitPanelState
383
394
  gitMode: GitModeState
384
395
  autoCommit: AutoCommitState
396
+ multiRepo: MultiRepoState
385
397
  pendingChords: string[] | null
386
398
  }
387
399
 
@@ -823,6 +835,13 @@ export interface AutoCommitConfig {
823
835
  models: Partial<Record<string, string>>
824
836
  }
825
837
 
838
+ export interface MultiRepoConfig {
839
+ /** When true, scan projectPath for nested git repos and aggregate their status into the git panel. */
840
+ enabled: boolean
841
+ /** How deep to scan below projectPath when discovering sub-repos. 1 = immediate children only. */
842
+ maxDepth: number
843
+ }
844
+
826
845
  export interface AimuxThemeConfig {
827
846
  /** Startup override for light/dark theme family. Reapplied on each launch. */
828
847
  initialMode?: ThemeMode
@@ -855,6 +874,7 @@ export interface AimuxUserConfig {
855
874
  hooks?: HooksConfig
856
875
  snippets?: SnippetDef[]
857
876
  autoCommit?: Partial<AutoCommitConfig>
877
+ multiRepo?: Partial<MultiRepoConfig>
858
878
  statusBar?: StatusBarConfig
859
879
  }
860
880
 
@@ -922,5 +942,6 @@ export interface ResolvedConfig {
922
942
  hooks: HooksConfig
923
943
  snippets: SnippetDef[]
924
944
  autoCommit: AutoCommitConfig
945
+ multiRepo: MultiRepoConfig
925
946
  statusBar: StatusBarConfig
926
947
  }