@brimveyn/aimux 1.21.0 → 1.22.2
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 -25
- package/package.json +2 -2
- package/src/app-runtime/auto-commit-driver.ts +22 -27
- package/src/app-runtime/backend-attach-runtime.ts +43 -36
- package/src/app-runtime/backend-runtime-events.ts +107 -88
- package/src/app-runtime/editor-actions.ts +201 -0
- package/src/app-runtime/git-actions.ts +197 -0
- package/src/app-runtime/measure-ref.ts +19 -0
- package/src/app-runtime/navigation-actions.ts +213 -0
- package/src/app-runtime/project-actions.ts +188 -0
- package/src/app-runtime/prompt-injection.ts +123 -0
- package/src/app-runtime/selection.ts +29 -0
- package/src/app-runtime/settings-actions.ts +156 -0
- package/src/app-runtime/setup-actions.ts +237 -0
- package/src/app-runtime/side-effect-context.ts +33 -0
- package/src/app-runtime/side-effects.ts +302 -1541
- package/src/app-runtime/snippet-actions.ts +3 -2
- package/src/app-runtime/tab-actions.ts +218 -0
- package/src/app-runtime/tab-runtime-timeouts.ts +1 -1
- package/src/app-runtime/use-auto-commit-driver.ts +14 -13
- package/src/app-runtime/use-backend-runtime.ts +12 -11
- package/src/app-runtime/use-directory-search.ts +5 -4
- package/src/app-runtime/use-mouse-handlers.ts +2 -1
- package/src/app-runtime/{use-workspace-autosave.ts → use-project-autosave.ts} +4 -4
- package/src/app-runtime/use-renderer-bindings.ts +2 -1
- package/src/app-runtime/use-setup-runner.ts +96 -0
- package/src/app-runtime/use-terminal-resize.ts +18 -14
- package/src/app-runtime/workspace-actions.ts +366 -0
- package/src/app-runtime/workspace-activity.ts +138 -0
- package/src/app-runtime/workspace-naming.ts +90 -0
- package/src/app.tsx +93 -48
- package/src/assets/sounds/bell.wav +0 -0
- package/src/assets/sounds/ding.wav +0 -0
- package/src/assets/sounds/plane.wav +0 -0
- package/src/cli/client/daemon-client.ts +2 -2
- package/src/cli/client/project-resolver.ts +112 -0
- package/src/cli/commands/project/close.ts +32 -0
- package/src/cli/commands/project/create.ts +93 -0
- package/src/cli/commands/project/list.ts +25 -0
- package/src/cli/commands/project/show.ts +32 -0
- package/src/cli/commands/{workspace → project}/switch.ts +19 -19
- package/src/cli/commands/tab/await.ts +2 -2
- package/src/cli/commands/tab/close.ts +3 -3
- package/src/cli/commands/tab/create.ts +74 -73
- package/src/cli/commands/tab/focus.ts +3 -3
- package/src/cli/commands/tab/list.ts +6 -6
- package/src/cli/commands/tab/run.ts +2 -2
- package/src/cli/commands/tab/send.ts +2 -2
- package/src/cli/commands/tab/snapshot.ts +2 -2
- package/src/cli/commands/tab/tail.ts +2 -2
- package/src/cli/commands/tab/wait.ts +2 -2
- package/src/cli/commands/worker/await.ts +3 -3
- package/src/cli/commands/worker/doctor.ts +30 -30
- package/src/cli/commands/worker/list.ts +15 -15
- package/src/cli/commands/worker/prompt.ts +3 -3
- package/src/cli/commands/worker/run.ts +23 -23
- package/src/cli/commands/worker/shared.ts +53 -59
- package/src/cli/commands/worker/stop.ts +29 -29
- package/src/cli/commands/worker/submit.ts +3 -3
- package/src/cli/commands/{worktree → workspace}/create-core.ts +26 -26
- package/src/cli/commands/workspace/create.ts +30 -68
- package/src/cli/commands/workspace/list.ts +52 -9
- package/src/cli/commands/workspace/remove.ts +81 -0
- package/src/cli/completion/plan.ts +2 -2
- package/src/cli/completion/sources.ts +18 -18
- package/src/cli/context.ts +13 -13
- package/src/cli/flags.ts +30 -10
- package/src/cli/index.ts +26 -16
- package/src/cli/output.ts +1 -1
- package/src/cli/registry.ts +12 -12
- package/src/config/loader.ts +16 -5
- package/src/config.ts +70 -112
- package/src/daemon/catalog-writer.ts +67 -67
- package/src/daemon/daemon.ts +205 -201
- package/src/daemon/session-manager.ts +39 -39
- package/src/daemon/session-registry.ts +14 -14
- package/src/git/divergence.ts +33 -2
- package/src/git/git-poller.ts +1 -1
- package/src/git/git-status.ts +2 -2
- package/src/git/{move-worktree.ts → move-workspace.ts} +5 -5
- package/src/git/pr-status.ts +1 -1
- package/src/git/repo-discovery.ts +1 -1
- package/src/git/use-repo-discovery.ts +1 -1
- package/src/git/workspace-branch-poller.ts +54 -0
- package/src/git/workspace-divergence-poller.ts +65 -0
- package/src/git/worktree.ts +29 -0
- package/src/index.tsx +4 -4
- package/src/input/keymap/help-entries.ts +7 -5
- package/src/input/modes/bridge.ts +13 -12
- package/src/input/modes/handlers/shared.ts +1 -1
- package/src/input/modes/transitions.ts +34 -21
- package/src/input/modes/types.ts +48 -31
- package/src/ipc/manager-protocol.ts +44 -44
- package/src/ipc/protocol.ts +192 -166
- package/src/platform/play-sound.ts +184 -0
- package/src/platform/project-search.ts +8 -8
- package/src/platform/worktree-paths.ts +8 -6
- package/src/pty/assistant-question-extractor.ts +1 -1
- package/src/pty/assistant-status-detection-loop.ts +79 -55
- package/src/pty/assistant-status-detector.ts +40 -15
- package/src/pty/command-registry.ts +81 -1
- package/src/restart-terminal-manager.ts +1 -1
- package/src/services/ai-usage/provider.ts +9 -2
- package/src/services/ai-usage/spawn.ts +19 -6
- package/src/session-backend/bootstrap.ts +4 -4
- package/src/session-backend/local-session-backend.ts +78 -75
- package/src/session-backend/remote-session-backend.ts +64 -52
- package/src/session-backend/types.ts +43 -32
- package/src/settings/live.ts +90 -0
- package/src/settings/search.ts +43 -0
- package/src/settings/sections/about.ts +49 -0
- package/src/settings/sections/appearance.ts +54 -0
- package/src/settings/sections/automation.ts +105 -0
- package/src/settings/sections/commands.ts +72 -0
- package/src/settings/sections/editor.ts +56 -0
- package/src/settings/sections/experimental.ts +57 -0
- package/src/settings/sections/git.ts +112 -0
- package/src/settings/sections/index.ts +95 -0
- package/src/settings/sections/integrations.ts +23 -0
- package/src/settings/sections/layout.ts +72 -0
- package/src/settings/sections/notifications.ts +99 -0
- package/src/settings/sections/setup.ts +54 -0
- package/src/settings/sections/status-bar.ts +63 -0
- package/src/settings/settings-store.ts +207 -0
- package/src/settings/types.ts +108 -0
- package/src/snippets/run-shell-var.ts +48 -22
- package/src/state/actions.ts +342 -0
- package/src/state/app-store.ts +2 -1
- package/src/state/bars.ts +1 -1
- package/src/state/dispatch-ref.ts +1 -1
- package/src/state/layout-resize.ts +2 -2
- package/src/state/project-catalog.ts +275 -0
- package/src/state/project-data.ts +143 -0
- package/src/state/{session-persistence.ts → project-persistence.ts} +74 -68
- package/src/state/project-save.ts +46 -0
- package/src/state/project-workspaces.ts +392 -0
- package/src/state/reducers/auto-commit-state.ts +11 -10
- package/src/state/reducers/git-commit-modal-state.ts +122 -0
- package/src/state/reducers/git-mode-state.ts +1 -1
- package/src/state/reducers/git-panel-state.ts +10 -6
- package/src/state/reducers/modal-state.ts +290 -681
- package/src/state/reducers/multi-repo-state.ts +3 -6
- package/src/state/reducers/project-state.ts +312 -0
- package/src/state/reducers/settings-state.ts +80 -0
- package/src/state/reducers/tab-state.ts +107 -60
- package/src/state/reducers/ui-state.ts +4 -3
- package/src/state/selectors.ts +49 -37
- package/src/state/store.ts +57 -24
- package/src/state/types.ts +244 -405
- package/src/state/validation.ts +14 -12
- package/src/terminal-manager/manager-client.ts +32 -32
- package/src/terminal-manager/terminal-manager.ts +24 -24
- package/src/ui/components/git/git-panel.tsx +2 -2
- package/src/ui/components/git/git-view.tsx +12 -12
- package/src/ui/components/git/image-diff/image-diff-view.tsx +1 -1
- package/src/ui/components/git/pane/git-pane-widget.tsx +7 -7
- package/src/ui/components/layout/sidebar/project-list.tsx +444 -0
- package/src/ui/components/layout/sidebar/tab-item.tsx +27 -12
- package/src/ui/components/layout/sidebar/use-sidebar-auto-scroll.ts +1 -1
- package/src/ui/components/layout/sidebar/workspace-row.tsx +253 -0
- package/src/ui/components/layout/status-bar.tsx +6 -2
- package/src/ui/components/layout/terminal-pane.tsx +34 -29
- package/src/ui/components/layout/top-tab-bar.tsx +46 -36
- package/src/ui/components/modals/git/git-commit-modal.tsx +8 -8
- package/src/ui/components/modals/{sessions/create-session-modal.tsx → projects/create-project-modal.tsx} +12 -12
- package/src/ui/components/modals/{sessions/session-name-modal.tsx → projects/project-name-modal.tsx} +2 -2
- package/src/ui/components/modals/{sessions/session-picker-modal.tsx → projects/project-picker-modal.tsx} +33 -35
- package/src/ui/components/modals/settings/settings-search-modal.tsx +70 -0
- package/src/ui/components/modals/shared/form.tsx +34 -22
- package/src/ui/components/modals/shared/picker.tsx +10 -10
- package/src/ui/components/modals/shared/{worktree-delete-confirm.tsx → workspace-delete-confirm.tsx} +9 -9
- package/src/ui/components/modals/tabs/new-tab-modal.tsx +30 -324
- package/src/ui/components/modals/workspace/create-workspace-modal.tsx +101 -0
- package/src/ui/components/modals/{worktree/worktree-move-confirm-modal.tsx → workspace/workspace-move-confirm-modal.tsx} +5 -5
- package/src/ui/components/modals/{worktree/worktree-move-modal.tsx → workspace/workspace-move-modal.tsx} +29 -27
- package/src/ui/components/primitives/input-field.tsx +7 -3
- package/src/ui/components/primitives/surface.tsx +3 -0
- package/src/ui/components/settings/row-value.tsx +74 -0
- package/src/ui/components/settings/settings-row.tsx +78 -0
- package/src/ui/components/settings/settings-view.tsx +169 -0
- package/src/ui/components/setup/setup-widget.tsx +152 -0
- package/src/ui/flash/build-labels.ts +27 -27
- package/src/ui/hooks/use-activity-sprite.ts +73 -0
- package/src/ui/hooks/use-scroll-active-into-view.ts +26 -0
- package/src/ui/{session-ordering.ts → project-ordering.ts} +4 -4
- package/src/ui/root.tsx +139 -121
- package/src/ui/status-bar-model.ts +48 -34
- package/src/ui/terminal-graphics/kitty.ts +28 -2
- package/src/ui/terminal-graphics/sprites/done@330/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/done@330/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/idle@1000/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/idle@1000/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/waiting@170/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/waiting@170/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/0.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/1.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/2.png +0 -0
- package/src/ui/terminal-graphics/sprites/working@150/3.png +0 -0
- package/src/ui/terminal-graphics/sprites.ts +246 -0
- package/src/ui/truncate.ts +7 -0
- package/src/ui/widgets/registry.tsx +6 -3
- package/src/ui/widgets/widget-context-menu.ts +26 -10
- package/src/update.ts +2 -2
- package/src/app-runtime/session-actions.ts +0 -187
- package/src/cli/client/workspace-resolver.ts +0 -110
- package/src/cli/commands/workspace/close.ts +0 -32
- package/src/cli/commands/workspace/show.ts +0 -32
- package/src/cli/commands/worktree/create.ts +0 -55
- package/src/cli/commands/worktree/list.ts +0 -68
- package/src/cli/commands/worktree/remove.ts +0 -81
- package/src/git/worktree-branch-poller.ts +0 -54
- package/src/git/worktree-divergence-poller.ts +0 -59
- package/src/state/reducers/session-state.ts +0 -262
- package/src/state/session-catalog.ts +0 -143
- package/src/state/session-worktrees.ts +0 -260
- package/src/state/workspace-save.ts +0 -43
- package/src/ui/components/layout/sidebar/use-top-tab-bar-auto-scroll.ts +0 -30
- package/src/ui/components/layout/sidebar/workspace-list.tsx +0 -418
- package/src/ui/components/layout/sidebar/worktree-row.tsx +0 -149
- /package/src/ui/{components/git/image-diff → terminal-graphics}/dimensions.ts +0 -0
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProjectRecord, WorkspaceRecord } from '../state/types'
|
|
2
2
|
|
|
3
3
|
import { logDebug } from '../debug/input-log'
|
|
4
4
|
import { createPrefixedId } from '../platform/id'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { loadProjectCatalog, saveProjectCatalog } from '../state/project-catalog'
|
|
6
|
+
import { createEmptyProjectSnapshot } from '../state/project-persistence'
|
|
7
|
+
import { createPrimaryWorkspace, ensureProjectWorkspaces } from '../state/project-workspaces'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Catalog mutations invoked by the daemon when NO UI is attached. When a UI
|
|
11
11
|
* is attached the daemon relays the request as an event and the UI's reducer
|
|
12
|
-
* owns the write (so the live
|
|
12
|
+
* owns the write (so the live project snapshot is preserved).
|
|
13
13
|
*
|
|
14
14
|
* Each helper is a pure read-modify-write against `aimux-sessions.json` —
|
|
15
15
|
* safe to call from the daemon process, no React / dispatcher involved.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
export function
|
|
19
|
-
const
|
|
18
|
+
export function createProjectInCatalog(name: string, projectPath?: string): ProjectRecord {
|
|
19
|
+
const projects = loadProjectCatalog()
|
|
20
20
|
const now = new Date().toISOString()
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const project: ProjectRecord = {
|
|
22
|
+
activeWorkspaceId: undefined,
|
|
23
23
|
createdAt: now,
|
|
24
|
-
id: createPrefixedId('
|
|
24
|
+
id: createPrefixedId('project'),
|
|
25
25
|
lastOpenedAt: now,
|
|
26
26
|
name,
|
|
27
27
|
projectPath,
|
|
28
|
+
projectSnapshot: createEmptyProjectSnapshot(),
|
|
28
29
|
updatedAt: now,
|
|
29
|
-
|
|
30
|
-
worktrees: undefined,
|
|
30
|
+
workspaces: undefined,
|
|
31
31
|
}
|
|
32
32
|
if (projectPath != null && projectPath !== '') {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const workspace = createPrimaryWorkspace(projectPath, now)
|
|
34
|
+
project.activeWorkspaceId = workspace.id
|
|
35
|
+
project.workspaces = [workspace]
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
logDebug('daemon.catalog.
|
|
39
|
-
return
|
|
37
|
+
saveProjectCatalog([...projects, ensureProjectWorkspaces(project)])
|
|
38
|
+
logDebug('daemon.catalog.createProject', { name, projectId: project.id, projectPath })
|
|
39
|
+
return project
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Throws when the target
|
|
44
|
-
* before broadcasting a
|
|
43
|
+
* Throws when the target project isn't in the catalog. Used by the daemon
|
|
44
|
+
* before broadcasting a project-lifecycle request so the CLI's `expectOk`
|
|
45
45
|
* fails fast (with a meaningful message) instead of the `--wait` path
|
|
46
46
|
* hanging out for its timeout while the UI silently ignores an unknown id.
|
|
47
47
|
*/
|
|
48
|
-
export function
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
throw new Error(`
|
|
48
|
+
export function assertProjectInCatalog(projectId: string): void {
|
|
49
|
+
const projects = loadProjectCatalog()
|
|
50
|
+
if (!projects.some((s) => s.id === projectId)) {
|
|
51
|
+
throw new Error(`project not found: ${projectId}`)
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export function bumpLastOpenedInCatalog(
|
|
56
|
-
const
|
|
55
|
+
export function bumpLastOpenedInCatalog(projectId: string): void {
|
|
56
|
+
const projects = loadProjectCatalog()
|
|
57
57
|
const now = new Date().toISOString()
|
|
58
|
-
const target =
|
|
58
|
+
const target = projects.find((s) => s.id === projectId)
|
|
59
59
|
if (!target) {
|
|
60
|
-
throw new Error(`
|
|
60
|
+
throw new Error(`project not found: ${projectId}`)
|
|
61
61
|
}
|
|
62
|
-
const updated =
|
|
63
|
-
|
|
64
|
-
logDebug('daemon.catalog.
|
|
62
|
+
const updated = projects.map((s) => (s.id === projectId ? { ...s, lastOpenedAt: now } : s))
|
|
63
|
+
saveProjectCatalog(updated)
|
|
64
|
+
logDebug('daemon.catalog.switchProject', { projectId })
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
export function deleteFromCatalog(
|
|
68
|
-
const
|
|
69
|
-
const remaining =
|
|
70
|
-
if (remaining.length ===
|
|
71
|
-
throw new Error(`
|
|
67
|
+
export function deleteFromCatalog(projectId: string): void {
|
|
68
|
+
const projects = loadProjectCatalog()
|
|
69
|
+
const remaining = projects.filter((s) => s.id !== projectId)
|
|
70
|
+
if (remaining.length === projects.length) {
|
|
71
|
+
throw new Error(`project not found: ${projectId}`)
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
logDebug('daemon.catalog.
|
|
73
|
+
saveProjectCatalog(remaining)
|
|
74
|
+
logDebug('daemon.catalog.closeProject', { projectId })
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export function
|
|
78
|
-
const
|
|
79
|
-
const target =
|
|
77
|
+
export function addWorkspaceToCatalog(projectId: string, workspace: WorkspaceRecord): void {
|
|
78
|
+
const projects = loadProjectCatalog()
|
|
79
|
+
const target = projects.find((s) => s.id === projectId)
|
|
80
80
|
if (!target) {
|
|
81
|
-
throw new Error(`
|
|
81
|
+
throw new Error(`project not found: ${projectId}`)
|
|
82
82
|
}
|
|
83
|
-
const existing = target.
|
|
84
|
-
if (existing.some((w) => w.id ===
|
|
85
|
-
throw new Error(`
|
|
83
|
+
const existing = target.workspaces ?? []
|
|
84
|
+
if (existing.some((w) => w.id === workspace.id)) {
|
|
85
|
+
throw new Error(`workspace already exists: ${workspace.id}`)
|
|
86
86
|
}
|
|
87
|
-
const updated =
|
|
88
|
-
s.id ===
|
|
89
|
-
? { ...s, updatedAt: new Date().toISOString(),
|
|
87
|
+
const updated = projects.map((s) =>
|
|
88
|
+
s.id === projectId
|
|
89
|
+
? { ...s, updatedAt: new Date().toISOString(), workspaces: [...existing, workspace] }
|
|
90
90
|
: s
|
|
91
91
|
)
|
|
92
|
-
|
|
93
|
-
logDebug('daemon.catalog.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
saveProjectCatalog(updated)
|
|
93
|
+
logDebug('daemon.catalog.addWorkspace', {
|
|
94
|
+
projectId,
|
|
95
|
+
workspaceId: workspace.id,
|
|
96
|
+
workspaceName: workspace.name,
|
|
97
97
|
})
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export function
|
|
101
|
-
const
|
|
102
|
-
const target =
|
|
100
|
+
export function removeWorkspaceFromCatalog(projectId: string, workspaceId: string): void {
|
|
101
|
+
const projects = loadProjectCatalog()
|
|
102
|
+
const target = projects.find((s) => s.id === projectId)
|
|
103
103
|
if (!target) {
|
|
104
|
-
throw new Error(`
|
|
104
|
+
throw new Error(`project not found: ${projectId}`)
|
|
105
105
|
}
|
|
106
|
-
const existing = target.
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
throw new Error(`
|
|
106
|
+
const existing = target.workspaces ?? []
|
|
107
|
+
const nextWorkspaces = existing.filter((w) => w.id !== workspaceId)
|
|
108
|
+
if (nextWorkspaces.length === existing.length) {
|
|
109
|
+
throw new Error(`workspace not found: ${workspaceId}`)
|
|
110
110
|
}
|
|
111
|
-
const updated =
|
|
112
|
-
s.id ===
|
|
111
|
+
const updated = projects.map((s) =>
|
|
112
|
+
s.id === projectId
|
|
113
113
|
? {
|
|
114
114
|
...s,
|
|
115
|
-
|
|
115
|
+
activeWorkspaceId: s.activeWorkspaceId === workspaceId ? undefined : s.activeWorkspaceId,
|
|
116
116
|
updatedAt: new Date().toISOString(),
|
|
117
|
-
|
|
117
|
+
workspaces: nextWorkspaces,
|
|
118
118
|
}
|
|
119
119
|
: s
|
|
120
120
|
)
|
|
121
|
-
|
|
122
|
-
logDebug('daemon.catalog.
|
|
121
|
+
saveProjectCatalog(updated)
|
|
122
|
+
logDebug('daemon.catalog.removeWorkspace', { projectId, workspaceId })
|
|
123
123
|
}
|