@brimveyn/aimux 1.12.2 → 1.12.6
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 +2 -2
- package/src/app-runtime/pty-write.ts +52 -0
- package/src/app-runtime/side-effects.ts +62 -21
- package/src/app-runtime/snippet-actions.ts +23 -9
- package/src/app-runtime/use-renderer-bindings.ts +137 -3
- package/src/app.tsx +13 -2
- package/src/input/modes/types.ts +2 -0
- package/src/input/raw-input-handler.ts +33 -0
- package/src/platform/clipboard.ts +14 -0
- package/src/pty/command-registry.ts +6 -0
- package/src/snippets/expand-variables.ts +112 -0
- package/src/snippets/run-shell-var.ts +93 -0
- package/src/snippets/trigger-detector.ts +105 -0
- package/src/state/reducers/modal-state.ts +30 -3
- package/src/state/snippet-catalog.ts +65 -4
- package/src/state/types.ts +16 -3
- package/src/state/validation.ts +22 -1
- package/src/ui/components/modals/snippets/snippet-editor-modal.tsx +10 -6
- package/src/ui/components/modals/snippets/snippet-picker-modal.tsx +16 -5
- package/src/ui/root.tsx +8 -11
package/src/ui/root.tsx
CHANGED
|
@@ -53,19 +53,14 @@ function getCreateSessionFields(modal: ModalState) {
|
|
|
53
53
|
|
|
54
54
|
function getSnippetEditorFields(modal: ModalState) {
|
|
55
55
|
if (modal.type !== 'snippet-editor') {
|
|
56
|
-
return { snippetContent: '', snippetName: '' }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (modal.activeField === 'name') {
|
|
60
|
-
return {
|
|
61
|
-
snippetContent: modal.contentBuffer,
|
|
62
|
-
snippetName: modal.editBuffer ?? '',
|
|
63
|
-
}
|
|
56
|
+
return { snippetContent: '', snippetName: '', snippetTrigger: '' }
|
|
64
57
|
}
|
|
65
58
|
|
|
59
|
+
const editValue = modal.editBuffer ?? ''
|
|
66
60
|
return {
|
|
67
|
-
snippetContent: modal.
|
|
68
|
-
snippetName: modal.
|
|
61
|
+
snippetContent: modal.activeField === 'content' ? editValue : modal.contentBuffer,
|
|
62
|
+
snippetName: modal.activeField === 'name' ? editValue : modal.nameBuffer,
|
|
63
|
+
snippetTrigger: modal.activeField === 'trigger' ? editValue : modal.triggerBuffer,
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
66
|
|
|
@@ -79,7 +74,7 @@ function renderModal(
|
|
|
79
74
|
snippets: SnippetRecord[]
|
|
80
75
|
themeId: ThemeId
|
|
81
76
|
createSessionFields: { directoryQuery: string; sessionName: string }
|
|
82
|
-
snippetEditorFields: { snippetName: string; snippetContent: string }
|
|
77
|
+
snippetEditorFields: { snippetName: string; snippetTrigger: string; snippetContent: string }
|
|
83
78
|
focusMode: FocusMode
|
|
84
79
|
activeAssistant?: string
|
|
85
80
|
autoCommitModel?: string
|
|
@@ -136,6 +131,7 @@ function renderModal(
|
|
|
136
131
|
selectedIndex={modal.selectedIndex}
|
|
137
132
|
filter={modal.editBuffer}
|
|
138
133
|
cursorPos={modal.cursorPos}
|
|
134
|
+
actionMessage={modal.actionMessage}
|
|
139
135
|
/>
|
|
140
136
|
)
|
|
141
137
|
case 'snippet-editor':
|
|
@@ -143,6 +139,7 @@ function renderModal(
|
|
|
143
139
|
<SnippetEditorModal
|
|
144
140
|
activeField={modal.activeField}
|
|
145
141
|
snippetName={options.snippetEditorFields.snippetName}
|
|
142
|
+
snippetTrigger={options.snippetEditorFields.snippetTrigger}
|
|
146
143
|
snippetContent={options.snippetEditorFields.snippetContent}
|
|
147
144
|
isEditing={modal.sessionTargetId !== null}
|
|
148
145
|
/>
|