@brimveyn/aimux-config 0.5.13 → 0.5.17

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.13",
3
+ "version": "0.5.17",
4
4
  "description": "TypeScript configuration API for aimux — keymaps, themes, and backends with a fluent builder.",
5
5
  "keywords": [
6
6
  "aimux",
package/src/actions.ts CHANGED
@@ -201,6 +201,10 @@ export const openSnippetEditor: KeyResult = r(
201
201
 
202
202
  export const editSelectedSnippet: KeyResult = r([], [{ type: 'edit-selected-snippet' }])
203
203
  export const deleteSelectedSnippet: KeyResult = r([], [{ type: 'delete-selected-snippet' }])
204
+ export const openSelectedSnippetSourceInEditor: KeyResult = r(
205
+ [],
206
+ [{ type: 'open-selected-snippet-source-in-editor' }]
207
+ )
204
208
 
205
209
  export const pasteSelectedSnippet: KeyResult = r(
206
210
  [{ type: 'close-modal' }],
@@ -278,6 +282,12 @@ export const cancelEditCustomCommand: KeyResult = r(
278
282
  'modal.new-tab.command-edit'
279
283
  )
280
284
 
285
+ export const editSelectedAssistant: KeyResult = r(
286
+ [],
287
+ [{ type: 'edit-selected-assistant' }],
288
+ 'modal.new-tab.editing-command'
289
+ )
290
+
281
291
  // ---------------------------------------------------------------------------
282
292
  // Update-available modal
283
293
  // ---------------------------------------------------------------------------
package/src/defaults.ts CHANGED
@@ -203,6 +203,7 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
203
203
  .map('<C-p>', actions.moveModalSelection(-1), 'Prev')
204
204
  .map('<Down>', actions.moveModalSelection(1))
205
205
  .map('<Up>', actions.moveModalSelection(-1))
206
+ .map('<C-e>', actions.editSelectedAssistant, 'Edit')
206
207
  .passthrough()
207
208
  )
208
209
 
@@ -262,6 +263,7 @@ export function getDefaultKeymapConfig(): ResolvedKeymapConfig {
262
263
  .map('<C-a>', actions.snippetFilterPasteToGroup, 'Send to group')
263
264
  .map('<C-n>', actions.moveModalSelection(1), 'Next')
264
265
  .map('<C-p>', actions.moveModalSelection(-1), 'Prev')
266
+ .map('<C-o>', actions.openSelectedSnippetSourceInEditor, 'Open source file')
265
267
  .map('<Down>', actions.moveModalSelection(1))
266
268
  .map('<Up>', actions.moveModalSelection(-1))
267
269
  .passthrough()
package/src/index.ts CHANGED
@@ -80,6 +80,8 @@ export type {
80
80
  SideEffect,
81
81
  SnippetDef,
82
82
  SnippetRecord,
83
+ SnippetShellVar,
84
+ SnippetVar,
83
85
  SplitDirection,
84
86
  StatusBarConfig,
85
87
  TabSession,
package/src/resolver.ts CHANGED
@@ -44,11 +44,16 @@ export function resolveConfig(userConfig: AimuxUserConfig): ResolvedConfig {
44
44
  sessionBar: resolveSessionBar(userConfig.sessionBar),
45
45
  sidebar: userConfig.sidebar ?? {},
46
46
  snippets: userConfig.snippets ?? [],
47
+ snippetTriggerChar: resolveSnippetTriggerChar(userConfig.snippetTriggerChar),
47
48
  statusBar: userConfig.statusBar ?? {},
48
49
  theme: resolveTheme(userConfig.theme),
49
50
  }
50
51
  }
51
52
 
53
+ function resolveSnippetTriggerChar(value: string | undefined): string {
54
+ return typeof value === 'string' && value.length === 1 ? value : ':'
55
+ }
56
+
52
57
  function resolveTheme(userConfig: AimuxUserConfig['theme']): ResolvedConfig['theme'] {
53
58
  if (!userConfig) return undefined
54
59
  return {
package/src/types.ts CHANGED
@@ -31,7 +31,7 @@ export type ModeId =
31
31
 
32
32
  // ─── Primitive app types ──────────────────────────────────────────────────────
33
33
 
34
- export type BuiltinAssistantId = 'claude' | 'codex' | 'opencode' | 'terminal'
34
+ export type BuiltinAssistantId = 'claude' | 'codex' | 'opencode' | 'terminal' | 'antigravity'
35
35
  export type AssistantId = BuiltinAssistantId | (string & {})
36
36
  export type TabStatus = 'starting' | 'running' | 'disconnected' | 'error'
37
37
 
@@ -150,6 +150,8 @@ export interface SnippetRecord {
150
150
  id: string
151
151
  name: string
152
152
  content: string
153
+ trigger?: string
154
+ vars?: Record<string, SnippetVar>
153
155
  }
154
156
 
155
157
  export type DirectoryResultType = 'git-repo' | 'worktree' | 'workspace'
@@ -273,6 +275,7 @@ export interface ModalRenameTab extends ModalBase {
273
275
  }
274
276
  export interface ModalSnippetPicker extends ModalBase {
275
277
  type: 'snippet-picker'
278
+ actionMessage?: string | null
276
279
  }
277
280
  export interface ModalThemePicker extends ModalBase {
278
281
  type: 'theme-picker'
@@ -303,7 +306,9 @@ export interface ModalGitCommit extends ModalBase {
303
306
  }
304
307
  export interface ModalSnippetEditor extends ModalBase {
305
308
  type: 'snippet-editor'
306
- activeField: 'name' | 'content'
309
+ activeField: 'name' | 'trigger' | 'content'
310
+ nameBuffer: string
311
+ triggerBuffer: string
307
312
  contentBuffer: string
308
313
  }
309
314
 
@@ -430,6 +435,7 @@ export type ModalAction =
430
435
  | { type: 'open-theme-picker' }
431
436
  | { type: 'open-update-available-modal'; currentVersion: string; latestVersion: string }
432
437
  | { type: 'open-ai-usage-modal' }
438
+ | { type: 'open-edit-custom-command'; assistantId: AssistantId }
433
439
 
434
440
  export type SessionAction =
435
441
  | { type: 'load-session'; sessionId: string; workspaceSnapshot?: WorkspaceSnapshotV1 }
@@ -536,6 +542,7 @@ export type GitModeAction =
536
542
  | { type: 'git-mode-set-pending-delete'; path: string | null }
537
543
  | { type: 'git-mode-clear-diff-cache'; path: string }
538
544
  | { type: 'git-mode-set-message'; message: string | null }
545
+ | { type: 'snippet-picker-set-message'; message: string | null }
539
546
  | { type: 'git-mode-toggle-diff-view' }
540
547
  | { type: 'git-mode-shift-head-offset'; delta: number }
541
548
  | { type: 'git-mode-set-head-offset'; offset: number }
@@ -599,6 +606,7 @@ export type AppAction =
599
606
  export type SideEffect =
600
607
  | { type: 'quit'; state: AppState }
601
608
  | { type: 'launch-selected-assistant' }
609
+ | { type: 'edit-selected-assistant' }
602
610
  | { type: 'confirm-selected-session' }
603
611
  | { type: 'delete-selected-session' }
604
612
  | { type: 'open-rename-selected-session' }
@@ -638,6 +646,7 @@ export type SideEffect =
638
646
  | { type: 'toggle-transparent' }
639
647
  | { type: 'toggle-mode' }
640
648
  | { type: 'open-file-in-editor'; path: string }
649
+ | { type: 'open-selected-snippet-source-in-editor' }
641
650
 
642
651
  // ─── Key input / KeyResult / ModeContext ──────────────────────────────────────
643
652
 
@@ -689,10 +698,30 @@ export interface HooksConfig {
689
698
 
690
699
  // ─── Snippet config (stub) ────────────────────────────────────────────────────
691
700
 
701
+ /**
702
+ * A snippet variable resolved at expansion time. The shape is a tagged union
703
+ * discriminated by which key is present (`sh` for now; future: `env`, `date`, …).
704
+ */
705
+ export interface SnippetShellVar {
706
+ /** Shell command run via `sh -c`. The trimmed stdout is interpolated. */
707
+ sh: string
708
+ /** Kill the process after this many ms. Default 5000. */
709
+ timeout?: number
710
+ /** Trim trailing whitespace from stdout. Default true. */
711
+ trim?: boolean
712
+ }
713
+
714
+ export type SnippetVar = SnippetShellVar
715
+
692
716
  export interface SnippetDef {
693
717
  name: string
694
718
  trigger?: string
695
719
  text: string
720
+ /**
721
+ * Optional named variables. Reference them in `text` as `{{name}}`.
722
+ * The key is the variable name; the value declares how to resolve it.
723
+ */
724
+ vars?: Record<string, SnippetVar>
696
725
  }
697
726
 
698
727
  // ─── Action value types ───────────────────────────────────────────────────────
@@ -891,6 +920,12 @@ export interface AimuxUserConfig {
891
920
  gitPane?: GitPaneConfig
892
921
  hooks?: HooksConfig
893
922
  snippets?: SnippetDef[]
923
+ /**
924
+ * Single-character prefix that opens an inline snippet trigger.
925
+ * Defaults to `:` (Espanso-style). Typing `<char><trigger><separator>` in
926
+ * any non-alternate-screen terminal expands the matching snippet.
927
+ */
928
+ snippetTriggerChar?: string
894
929
  autoCommit?: Partial<AutoCommitConfig>
895
930
  multiRepo?: Partial<MultiRepoConfig>
896
931
  statusBar?: StatusBarConfig
@@ -964,6 +999,7 @@ export interface ResolvedConfig {
964
999
  }
965
1000
  hooks: HooksConfig
966
1001
  snippets: SnippetDef[]
1002
+ snippetTriggerChar: string
967
1003
  autoCommit: AutoCommitConfig
968
1004
  multiRepo: MultiRepoConfig
969
1005
  statusBar: StatusBarConfig