aimux-cli 0.1.16 → 0.1.19
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 +184 -67
- package/bin/aimux-dev +10 -0
- package/dist/agent-events.js +0 -1
- package/dist/agent-output-parser.js +0 -1
- package/dist/agent-prompt-delivery.js +0 -1
- package/dist/agent-tracker.js +0 -1
- package/dist/agent-watcher.js +0 -1
- package/dist/alert-display.d.ts +21 -0
- package/dist/alert-display.js +85 -0
- package/dist/atomic-write.js +0 -1
- package/dist/attachment-store.d.ts +0 -7
- package/dist/attachment-store.js +2 -87
- package/dist/builtin-metadata-watchers.js +4 -5
- package/dist/claude-hooks.d.ts +1 -0
- package/dist/claude-hooks.js +25 -1
- package/dist/config.d.ts +19 -13
- package/dist/config.js +28 -15
- package/dist/connection-targets.d.ts +8 -0
- package/dist/connection-targets.js +27 -0
- package/dist/context/compactor.js +0 -1
- package/dist/context/context-bridge.js +0 -1
- package/dist/context/context-file.js +0 -1
- package/dist/context/history.js +0 -1
- package/dist/credentials.d.ts +12 -0
- package/dist/credentials.js +48 -0
- package/dist/daemon.d.ts +23 -0
- package/dist/daemon.js +391 -67
- package/dist/dashboard/command-spec.js +0 -1
- package/dist/dashboard/feedback.js +0 -1
- package/dist/dashboard/index.d.ts +13 -10
- package/dist/dashboard/index.js +3 -27
- package/dist/dashboard/operation-failures.js +0 -1
- package/dist/dashboard/order.d.ts +22 -0
- package/dist/dashboard/order.js +54 -0
- package/dist/dashboard/pending-actions.d.ts +39 -10
- package/dist/dashboard/pending-actions.js +166 -37
- package/dist/dashboard/quick-jump.d.ts +2 -1
- package/dist/dashboard/quick-jump.js +7 -5
- package/dist/dashboard/runtime-evidence.js +0 -1
- package/dist/dashboard/session-actions.d.ts +4 -4
- package/dist/dashboard/session-actions.js +1 -2
- package/dist/dashboard/session-registry.d.ts +4 -3
- package/dist/dashboard/session-registry.js +16 -51
- package/dist/dashboard/sort.js +0 -1
- package/dist/dashboard/state.d.ts +1 -1
- package/dist/dashboard/state.js +0 -1
- package/dist/dashboard/targets.js +0 -1
- package/dist/dashboard/ui-state-store.d.ts +16 -1
- package/dist/dashboard/ui-state-store.js +73 -3
- package/dist/debug-state.d.ts +97 -0
- package/dist/debug-state.js +540 -0
- package/dist/debug.d.ts +38 -0
- package/dist/debug.js +219 -16
- package/dist/default-plugins/gh-pr-context.d.ts +2 -1
- package/dist/default-plugins/gh-pr-context.js +17 -12
- package/dist/default-plugins/transcript-length.js +15 -3
- package/dist/fast-control.js +37 -20
- package/dist/hotkeys.js +0 -1
- package/dist/http-client.js +31 -3
- package/dist/key-parser.js +0 -1
- package/dist/last-used.js +0 -1
- package/dist/local-ui-server.d.ts +22 -0
- package/dist/local-ui-server.js +185 -0
- package/dist/login-flow.d.ts +7 -0
- package/dist/login-flow.js +119 -0
- package/dist/main.js +821 -152
- package/dist/managed-launch-env.js +14 -1
- package/dist/metadata-server.d.ts +36 -36
- package/dist/metadata-server.js +638 -138
- package/dist/metadata-store.d.ts +4 -1
- package/dist/metadata-store.js +30 -3
- package/dist/multiplexer/agent-io-methods.d.ts +2 -10
- package/dist/multiplexer/agent-io-methods.js +12 -44
- package/dist/multiplexer/archives.js +8 -10
- package/dist/multiplexer/dashboard-actions-methods.js +0 -1
- package/dist/multiplexer/dashboard-control.js +45 -14
- package/dist/multiplexer/dashboard-interaction.d.ts +8 -2
- package/dist/multiplexer/dashboard-interaction.js +187 -29
- package/dist/multiplexer/dashboard-model.d.ts +10 -3
- package/dist/multiplexer/dashboard-model.js +417 -36
- package/dist/multiplexer/dashboard-ops.d.ts +9 -7
- package/dist/multiplexer/dashboard-ops.js +178 -69
- package/dist/multiplexer/dashboard-state-methods.d.ts +2 -1
- package/dist/multiplexer/dashboard-state-methods.js +3 -3
- package/dist/multiplexer/dashboard-tail-methods.d.ts +22 -10
- package/dist/multiplexer/dashboard-tail-methods.js +164 -48
- package/dist/multiplexer/dashboard-view-methods.d.ts +1 -1
- package/dist/multiplexer/dashboard-view-methods.js +23 -9
- package/dist/multiplexer/graveyard-view-model.d.ts +9 -1
- package/dist/multiplexer/graveyard-view-model.js +39 -1
- package/dist/multiplexer/index.d.ts +15 -12
- package/dist/multiplexer/index.js +64 -44
- package/dist/multiplexer/navigation.js +0 -1
- package/dist/multiplexer/notifications.js +107 -25
- package/dist/multiplexer/persistence-methods.d.ts +31 -4
- package/dist/multiplexer/persistence-methods.js +304 -309
- package/dist/multiplexer/runtime-lifecycle-methods.d.ts +8 -10
- package/dist/multiplexer/runtime-lifecycle-methods.js +104 -87
- package/dist/multiplexer/runtime-state.d.ts +8 -10
- package/dist/multiplexer/runtime-state.js +82 -146
- package/dist/multiplexer/runtime-sync.d.ts +2 -10
- package/dist/multiplexer/runtime-sync.js +3 -19
- package/dist/multiplexer/service-state-snapshot.d.ts +2 -4
- package/dist/multiplexer/service-state-snapshot.js +4 -52
- package/dist/multiplexer/services.d.ts +1 -0
- package/dist/multiplexer/services.js +55 -6
- package/dist/multiplexer/session-capture.d.ts +1 -0
- package/dist/multiplexer/session-capture.js +23 -0
- package/dist/multiplexer/session-launch.d.ts +4 -1
- package/dist/multiplexer/session-launch.js +152 -64
- package/dist/multiplexer/session-runtime-core.d.ts +8 -20
- package/dist/multiplexer/session-runtime-core.js +40 -136
- package/dist/multiplexer/subscreens.js +10 -4
- package/dist/multiplexer/tool-picker.js +0 -1
- package/dist/multiplexer/worktree-graveyard.d.ts +0 -1
- package/dist/multiplexer/worktree-graveyard.js +15 -17
- package/dist/multiplexer/worktrees.js +96 -41
- package/dist/notification-context.js +8 -5
- package/dist/notifications.js +163 -102
- package/dist/notify.d.ts +4 -0
- package/dist/notify.js +14 -1
- package/dist/orchestration-actions.js +0 -1
- package/dist/orchestration-routing.js +0 -1
- package/dist/orchestration.js +0 -1
- package/dist/osc-notifications.js +0 -1
- package/dist/paths.d.ts +32 -7
- package/dist/paths.js +82 -59
- package/dist/pending-actions.d.ts +5 -0
- package/dist/pending-actions.js +13 -0
- package/dist/plugin-runtime.js +9 -3
- package/dist/project-events.d.ts +1 -10
- package/dist/project-events.js +0 -11
- package/dist/project-scanner.d.ts +2 -3
- package/dist/project-scanner.js +58 -130
- package/dist/project-service-manifest.d.ts +1 -3
- package/dist/project-service-manifest.js +1 -4
- package/dist/recency.js +0 -1
- package/dist/recorder.js +0 -1
- package/dist/relay-client.d.ts +30 -0
- package/dist/relay-client.js +190 -0
- package/dist/remote-access.d.ts +16 -0
- package/dist/remote-access.js +90 -0
- package/dist/runtime-core/exchange-derived.d.ts +2 -0
- package/dist/runtime-core/exchange-derived.js +153 -0
- package/dist/runtime-core/exchange-import.d.ts +24 -0
- package/dist/runtime-core/exchange-import.js +317 -0
- package/dist/runtime-core/exchange-store.d.ts +157 -0
- package/dist/runtime-core/exchange-store.js +452 -0
- package/dist/runtime-core/topology-services.d.ts +38 -0
- package/dist/runtime-core/topology-services.js +170 -0
- package/dist/runtime-core/topology-sessions.d.ts +52 -0
- package/dist/runtime-core/topology-sessions.js +238 -0
- package/dist/runtime-core/topology-store.d.ts +171 -0
- package/dist/runtime-core/topology-store.js +419 -0
- package/dist/runtime-core/topology-worktrees.d.ts +60 -0
- package/dist/runtime-core/topology-worktrees.js +199 -0
- package/dist/runtime-migration.d.ts +69 -0
- package/dist/runtime-migration.js +398 -0
- package/dist/session-bootstrap.d.ts +8 -6
- package/dist/session-bootstrap.js +51 -159
- package/dist/session-runtime.d.ts +2 -0
- package/dist/session-runtime.js +1 -1
- package/dist/session-semantics.d.ts +12 -4
- package/dist/session-semantics.js +14 -1
- package/dist/shell-args.js +0 -1
- package/dist/shell-hooks.js +32 -11
- package/dist/shell-state.d.ts +2 -0
- package/dist/shell-state.js +26 -2
- package/dist/status-detector.js +0 -1
- package/dist/statusline-model.d.ts +10 -2
- package/dist/statusline-model.js +106 -31
- package/dist/task-workflow.d.ts +6 -9
- package/dist/task-workflow.js +37 -85
- package/dist/tasks.d.ts +6 -33
- package/dist/tasks.js +46 -89
- package/dist/team.d.ts +29 -0
- package/dist/team.js +40 -1
- package/dist/terminal-host.js +0 -1
- package/dist/threads.d.ts +6 -35
- package/dist/threads.js +89 -99
- package/dist/tmux/doctor.js +0 -1
- package/dist/tmux/inbox-popup.js +37 -16
- package/dist/tmux/runtime-manager.d.ts +3 -0
- package/dist/tmux/runtime-manager.js +21 -5
- package/dist/tmux/session-transport.js +0 -1
- package/dist/tmux/statusline-cache.js +0 -1
- package/dist/tmux/statusline.js +49 -10
- package/dist/tmux/switcher.js +0 -1
- package/dist/tmux/window-open.js +1 -3
- package/dist/tool-output-watchers.d.ts +0 -18
- package/dist/tool-output-watchers.js +0 -323
- package/dist/tui/render/box.js +0 -1
- package/dist/tui/render/text.js +0 -1
- package/dist/tui/screens/dashboard-renderers.js +37 -26
- package/dist/tui/screens/overlay-renderers.d.ts +2 -0
- package/dist/tui/screens/overlay-renderers.js +37 -2
- package/dist/tui/screens/subscreen-renderers.js +7 -1
- package/dist/workflow.js +0 -1
- package/dist/worktree.js +17 -1
- package/dist-ui/_expo/static/css/web-30453ede1678c16acb08b97e83e8646d.css +1 -0
- package/dist-ui/_expo/static/js/web/entry-477c745b2adc79367a4380ecf07d9ff6.js +14620 -0
- package/dist-ui/assets/assets/images/icon.a5413dcd2e811c9f2317d01a28118d8a.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
- package/dist-ui/favicon.ico +0 -0
- package/dist-ui/index.html +38 -0
- package/dist-ui/metadata.json +1 -0
- package/package.json +29 -12
- package/dist/agent-events.js.map +0 -1
- package/dist/agent-message-parts.d.ts +0 -17
- package/dist/agent-message-parts.js +0 -31
- package/dist/agent-message-parts.js.map +0 -1
- package/dist/agent-output-parser.js.map +0 -1
- package/dist/agent-prompt-delivery.js.map +0 -1
- package/dist/agent-tracker.js.map +0 -1
- package/dist/agent-watcher.js.map +0 -1
- package/dist/atomic-write.js.map +0 -1
- package/dist/attachment-store.js.map +0 -1
- package/dist/builtin-metadata-watchers.js.map +0 -1
- package/dist/claude-hooks.js.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context/compactor.js.map +0 -1
- package/dist/context/context-bridge.js.map +0 -1
- package/dist/context/context-file.js.map +0 -1
- package/dist/context/history.js.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/dashboard/command-spec.js.map +0 -1
- package/dist/dashboard/feedback.js.map +0 -1
- package/dist/dashboard/index.js.map +0 -1
- package/dist/dashboard/operation-failures.js.map +0 -1
- package/dist/dashboard/pending-actions.js.map +0 -1
- package/dist/dashboard/quick-jump.js.map +0 -1
- package/dist/dashboard/runtime-evidence.js.map +0 -1
- package/dist/dashboard/session-actions.js.map +0 -1
- package/dist/dashboard/session-registry.js.map +0 -1
- package/dist/dashboard/sort.js.map +0 -1
- package/dist/dashboard/state.js.map +0 -1
- package/dist/dashboard/targets.js.map +0 -1
- package/dist/dashboard/ui-state-store.js.map +0 -1
- package/dist/debug.js.map +0 -1
- package/dist/default-plugins/gh-pr-context.js.map +0 -1
- package/dist/default-plugins/transcript-length.js.map +0 -1
- package/dist/fast-control.js.map +0 -1
- package/dist/hotkeys.js.map +0 -1
- package/dist/http-client.js.map +0 -1
- package/dist/instance-directory.d.ts +0 -32
- package/dist/instance-directory.js +0 -82
- package/dist/instance-directory.js.map +0 -1
- package/dist/instance-registry.d.ts +0 -39
- package/dist/instance-registry.js +0 -208
- package/dist/instance-registry.js.map +0 -1
- package/dist/key-parser.js.map +0 -1
- package/dist/last-used.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/managed-launch-env.js.map +0 -1
- package/dist/metadata-server.js.map +0 -1
- package/dist/metadata-store.js.map +0 -1
- package/dist/multiplexer/agent-io-methods.js.map +0 -1
- package/dist/multiplexer/archives.js.map +0 -1
- package/dist/multiplexer/dashboard-actions-methods.js.map +0 -1
- package/dist/multiplexer/dashboard-control.js.map +0 -1
- package/dist/multiplexer/dashboard-interaction.js.map +0 -1
- package/dist/multiplexer/dashboard-model.js.map +0 -1
- package/dist/multiplexer/dashboard-ops.js.map +0 -1
- package/dist/multiplexer/dashboard-state-methods.js.map +0 -1
- package/dist/multiplexer/dashboard-tail-methods.js.map +0 -1
- package/dist/multiplexer/dashboard-view-methods.js.map +0 -1
- package/dist/multiplexer/graveyard-view-model.js.map +0 -1
- package/dist/multiplexer/index.js.map +0 -1
- package/dist/multiplexer/navigation.js.map +0 -1
- package/dist/multiplexer/notifications.js.map +0 -1
- package/dist/multiplexer/persistence-methods.js.map +0 -1
- package/dist/multiplexer/runtime-lifecycle-methods.js.map +0 -1
- package/dist/multiplexer/runtime-state.js.map +0 -1
- package/dist/multiplexer/runtime-sync.js.map +0 -1
- package/dist/multiplexer/service-state-snapshot.js.map +0 -1
- package/dist/multiplexer/services.js.map +0 -1
- package/dist/multiplexer/session-actions.d.ts +0 -40
- package/dist/multiplexer/session-actions.js +0 -110
- package/dist/multiplexer/session-actions.js.map +0 -1
- package/dist/multiplexer/session-launch.js.map +0 -1
- package/dist/multiplexer/session-runtime-core.js.map +0 -1
- package/dist/multiplexer/subscreens.js.map +0 -1
- package/dist/multiplexer/tool-picker.js.map +0 -1
- package/dist/multiplexer/worktree-graveyard.js.map +0 -1
- package/dist/multiplexer/worktrees.js.map +0 -1
- package/dist/notification-context.js.map +0 -1
- package/dist/notifications.js.map +0 -1
- package/dist/notify.js.map +0 -1
- package/dist/orchestration-actions.js.map +0 -1
- package/dist/orchestration-dispatcher.d.ts +0 -25
- package/dist/orchestration-dispatcher.js +0 -59
- package/dist/orchestration-dispatcher.js.map +0 -1
- package/dist/orchestration-routing.js.map +0 -1
- package/dist/orchestration.js.map +0 -1
- package/dist/osc-notifications.js.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/plugin-runtime.js.map +0 -1
- package/dist/project-events.js.map +0 -1
- package/dist/project-scanner.js.map +0 -1
- package/dist/project-service-manifest.js.map +0 -1
- package/dist/recency.js.map +0 -1
- package/dist/recorder.js.map +0 -1
- package/dist/session-bootstrap.js.map +0 -1
- package/dist/session-input-operations.d.ts +0 -19
- package/dist/session-input-operations.js +0 -46
- package/dist/session-input-operations.js.map +0 -1
- package/dist/session-message-history.d.ts +0 -27
- package/dist/session-message-history.js +0 -105
- package/dist/session-message-history.js.map +0 -1
- package/dist/session-runtime.js.map +0 -1
- package/dist/session-semantics.js.map +0 -1
- package/dist/shell-args.js.map +0 -1
- package/dist/shell-hooks.js.map +0 -1
- package/dist/shell-state.js.map +0 -1
- package/dist/status-detector.js.map +0 -1
- package/dist/statusline-model.js.map +0 -1
- package/dist/task-dispatcher.d.ts +0 -64
- package/dist/task-dispatcher.js +0 -213
- package/dist/task-dispatcher.js.map +0 -1
- package/dist/task-workflow.js.map +0 -1
- package/dist/tasks.js.map +0 -1
- package/dist/team.js.map +0 -1
- package/dist/terminal-host.js.map +0 -1
- package/dist/threads.js.map +0 -1
- package/dist/tmux/doctor.js.map +0 -1
- package/dist/tmux/inbox-popup.js.map +0 -1
- package/dist/tmux/runtime-manager.js.map +0 -1
- package/dist/tmux/session-transport.js.map +0 -1
- package/dist/tmux/statusline-cache.js.map +0 -1
- package/dist/tmux/statusline.js.map +0 -1
- package/dist/tmux/switcher.js.map +0 -1
- package/dist/tmux/window-open.js.map +0 -1
- package/dist/tool-output-watchers.js.map +0 -1
- package/dist/tui/render/box.js.map +0 -1
- package/dist/tui/render/text.js.map +0 -1
- package/dist/tui/screens/dashboard-renderers.js.map +0 -1
- package/dist/tui/screens/overlay-renderers.js.map +0 -1
- package/dist/tui/screens/subscreen-renderers.js.map +0 -1
- package/dist/workflow.js.map +0 -1
- package/dist/worktree.js.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { DashboardSession } from "./index.js";
|
|
2
2
|
import type { SessionState } from "../multiplexer/index.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { SessionTeamMetadata } from "../team.js";
|
|
4
4
|
export interface DashboardLocalSession {
|
|
5
5
|
id: string;
|
|
6
6
|
command: string;
|
|
7
7
|
tmuxWindowId?: string;
|
|
8
8
|
backendSessionId?: string;
|
|
9
|
+
team?: SessionTeamMetadata;
|
|
9
10
|
createdAt?: string;
|
|
10
11
|
status: DashboardSession["status"];
|
|
11
12
|
worktreePath?: string;
|
|
@@ -14,9 +15,9 @@ export interface DashboardSessionRegistryOptions {
|
|
|
14
15
|
sessions: DashboardLocalSession[];
|
|
15
16
|
activeIndex: number;
|
|
16
17
|
offlineSessions: SessionState[];
|
|
17
|
-
remoteInstances: InstanceInfo[];
|
|
18
18
|
hiddenWorktreePaths?: Set<string>;
|
|
19
19
|
mainRepoPath?: string;
|
|
20
|
+
includeTeammates?: boolean;
|
|
20
21
|
getSessionLabel: (sessionId: string) => string | undefined;
|
|
21
22
|
getSessionHeadline: (sessionId: string) => string | undefined;
|
|
22
23
|
getSessionTaskDescription: (sessionId: string) => string | undefined;
|
|
@@ -44,6 +45,6 @@ export interface DashboardSessionRegistryOptions {
|
|
|
44
45
|
threadName?: string;
|
|
45
46
|
} | undefined;
|
|
46
47
|
}
|
|
47
|
-
export declare function getRemoteOwnedSessionKeys(remoteInstances: InstanceInfo[]): Set<string>;
|
|
48
48
|
export declare function buildDashboardSessions(options: DashboardSessionRegistryOptions): DashboardSession[];
|
|
49
49
|
export declare function orderDashboardSessionsByVisualWorktree(sessions: DashboardSession[], worktreePaths: Array<string | undefined>, mainRepoPath?: string): DashboardSession[];
|
|
50
|
+
export declare function selectDashboardTeammates(sessions: DashboardSession[], parentSession: Pick<DashboardSession, "id" | "team"> | undefined): DashboardSession[];
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
+
import { compareTeammateSessions, isTeammateSession } from "../team.js";
|
|
2
3
|
import { listWorktrees as listAllWorktrees } from "../worktree.js";
|
|
3
|
-
export function getRemoteOwnedSessionKeys(remoteInstances) {
|
|
4
|
-
const owned = new Set();
|
|
5
|
-
for (const inst of remoteInstances) {
|
|
6
|
-
for (const session of inst.sessions) {
|
|
7
|
-
owned.add(session.id);
|
|
8
|
-
if (session.backendSessionId)
|
|
9
|
-
owned.add(session.backendSessionId);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return owned;
|
|
13
|
-
}
|
|
14
4
|
export function buildDashboardSessions(options) {
|
|
15
5
|
const normalizeWtPath = normalizeWorktreePathFactory(options.mainRepoPath);
|
|
16
6
|
const hiddenWorktreePaths = options.hiddenWorktreePaths ?? new Set();
|
|
17
7
|
const seenLocalSessionKeys = new Set();
|
|
8
|
+
const includeTeammates = options.includeTeammates ?? false;
|
|
18
9
|
const dashSessions = [];
|
|
19
10
|
for (const [index, session] of options.sessions.entries()) {
|
|
11
|
+
if (!includeTeammates && isTeammateSession(session))
|
|
12
|
+
continue;
|
|
20
13
|
const normalizedWorktreePath = normalizeWtPath(session.worktreePath);
|
|
21
14
|
if (normalizedWorktreePath && hiddenWorktreePaths.has(normalizedWorktreePath))
|
|
22
15
|
continue;
|
|
@@ -30,6 +23,7 @@ export function buildDashboardSessions(options) {
|
|
|
30
23
|
command: session.command,
|
|
31
24
|
tmuxWindowId: session.tmuxWindowId,
|
|
32
25
|
backendSessionId: session.backendSessionId,
|
|
26
|
+
team: session.team,
|
|
33
27
|
createdAt: session.createdAt,
|
|
34
28
|
status: session.status,
|
|
35
29
|
active: index === options.activeIndex,
|
|
@@ -54,45 +48,9 @@ export function buildDashboardSessions(options) {
|
|
|
54
48
|
threadName: options.getSessionDerived(session.id)?.threadName,
|
|
55
49
|
});
|
|
56
50
|
}
|
|
57
|
-
for (const inst of options.remoteInstances) {
|
|
58
|
-
for (const session of inst.sessions) {
|
|
59
|
-
const normalizedWorktreePath = normalizeWtPath(session.worktreePath);
|
|
60
|
-
if (normalizedWorktreePath && hiddenWorktreePaths.has(normalizedWorktreePath))
|
|
61
|
-
continue;
|
|
62
|
-
if (dashSessions.some((existing) => existing.id === session.id))
|
|
63
|
-
continue;
|
|
64
|
-
dashSessions.push({
|
|
65
|
-
index: dashSessions.length,
|
|
66
|
-
id: session.id,
|
|
67
|
-
command: session.tool,
|
|
68
|
-
backendSessionId: session.backendSessionId,
|
|
69
|
-
createdAt: session.createdAt,
|
|
70
|
-
status: "running",
|
|
71
|
-
active: false,
|
|
72
|
-
worktreePath: normalizedWorktreePath,
|
|
73
|
-
remoteInstancePid: inst.pid,
|
|
74
|
-
remoteInstanceId: inst.instanceId,
|
|
75
|
-
remoteBackendSessionId: session.backendSessionId,
|
|
76
|
-
label: options.getSessionLabel(session.id),
|
|
77
|
-
headline: options.getSessionHeadline(session.id),
|
|
78
|
-
cwd: options.getSessionContext(session.id)?.cwd,
|
|
79
|
-
repoOwner: options.getSessionContext(session.id)?.repo?.owner,
|
|
80
|
-
repoName: options.getSessionContext(session.id)?.repo?.name,
|
|
81
|
-
repoRemote: options.getSessionContext(session.id)?.repo?.remote,
|
|
82
|
-
prNumber: options.getSessionContext(session.id)?.pr?.number,
|
|
83
|
-
prTitle: options.getSessionContext(session.id)?.pr?.title,
|
|
84
|
-
prUrl: options.getSessionContext(session.id)?.pr?.url,
|
|
85
|
-
activity: options.getSessionDerived(session.id)?.activity,
|
|
86
|
-
attention: options.getSessionDerived(session.id)?.attention,
|
|
87
|
-
unseenCount: options.getSessionDerived(session.id)?.unseenCount,
|
|
88
|
-
lastEvent: options.getSessionDerived(session.id)?.lastEvent,
|
|
89
|
-
services: options.getSessionDerived(session.id)?.services,
|
|
90
|
-
threadId: options.getSessionDerived(session.id)?.threadId,
|
|
91
|
-
threadName: options.getSessionDerived(session.id)?.threadName,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
51
|
for (const offline of options.offlineSessions) {
|
|
52
|
+
if (!includeTeammates && isTeammateSession(offline))
|
|
53
|
+
continue;
|
|
96
54
|
const alreadyShown = dashSessions.some((session) => session.id === offline.id ||
|
|
97
55
|
(offline.backendSessionId && session.backendSessionId === offline.backendSessionId));
|
|
98
56
|
if (alreadyShown)
|
|
@@ -108,13 +66,13 @@ export function buildDashboardSessions(options) {
|
|
|
108
66
|
id: offline.id,
|
|
109
67
|
command: offline.command,
|
|
110
68
|
backendSessionId: offline.backendSessionId,
|
|
69
|
+
team: offline.team,
|
|
111
70
|
createdAt: offline.createdAt,
|
|
112
71
|
status: "offline",
|
|
113
72
|
active: false,
|
|
114
73
|
worktreePath,
|
|
115
74
|
worktreeName: worktreeInfo?.name,
|
|
116
75
|
worktreeBranch: worktreeInfo?.branch,
|
|
117
|
-
remoteBackendSessionId: offline.backendSessionId,
|
|
118
76
|
label: offline.label,
|
|
119
77
|
headline: offline.headline,
|
|
120
78
|
cwd: options.getSessionContext(offline.id)?.cwd,
|
|
@@ -159,6 +117,14 @@ export function orderDashboardSessionsByVisualWorktree(sessions, worktreePaths,
|
|
|
159
117
|
}
|
|
160
118
|
return ordered;
|
|
161
119
|
}
|
|
120
|
+
export function selectDashboardTeammates(sessions, parentSession) {
|
|
121
|
+
if (!parentSession || isTeammateSession(parentSession))
|
|
122
|
+
return [];
|
|
123
|
+
return sessions
|
|
124
|
+
.filter((session) => session.team?.parentSessionId === parentSession.id)
|
|
125
|
+
.sort(compareTeammateSessions)
|
|
126
|
+
.map((session, index) => ({ ...session, index }));
|
|
127
|
+
}
|
|
162
128
|
function normalizeWorktreePathFactory(mainRepoPath) {
|
|
163
129
|
return (path) => (path && mainRepoPath && path === mainRepoPath ? undefined : path);
|
|
164
130
|
}
|
|
@@ -178,4 +144,3 @@ function resolveWorktreeInfo(worktreePath) {
|
|
|
178
144
|
return undefined;
|
|
179
145
|
return { name, branch: "unknown" };
|
|
180
146
|
}
|
|
181
|
-
//# sourceMappingURL=session-registry.js.map
|
package/dist/dashboard/sort.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DashboardSession, DashboardWorktreeEntry } from "./index.js";
|
|
2
2
|
export type DashboardScreen = "dashboard" | "activity" | "workflow" | "threads" | "notifications" | "plans" | "graveyard" | "help";
|
|
3
3
|
export type DashboardLevel = "worktrees" | "sessions";
|
|
4
|
-
export type DashboardOverlayKind = "none" | "tool-picker" | "tool-options" | "worktree-input" | "service-input" | "label-input" | "orchestration-input" | "orchestration-route-picker" | "worktree-list" | "worktree-remove-confirm" | "migrate-picker" | "thread-reply" | "notification-panel" | "switcher";
|
|
4
|
+
export type DashboardOverlayKind = "none" | "tool-picker" | "tool-options" | "worktree-input" | "service-input" | "label-input" | "orchestration-input" | "orchestration-route-picker" | "worktree-list" | "worktree-remove-confirm" | "migrate-picker" | "thread-reply" | "notification-panel" | "teammate-picker" | "switcher";
|
|
5
5
|
export declare class DashboardState {
|
|
6
6
|
screen: DashboardScreen;
|
|
7
7
|
detailsSidebarVisible: boolean;
|
package/dist/dashboard/state.js
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import type { DashboardSession } from "./index.js";
|
|
1
|
+
import type { DashboardService, DashboardSession, WorktreeGroup } from "./index.js";
|
|
2
|
+
import { type DashboardOrderDirection, type DashboardOrderKind, type DashboardOrderState } from "./order.js";
|
|
2
3
|
import { type DashboardState } from "./state.js";
|
|
3
4
|
export declare class DashboardUiStateStore {
|
|
4
5
|
private preferredSelection;
|
|
5
6
|
private flatSessionId;
|
|
6
7
|
private selectionNeedsRestore;
|
|
8
|
+
private orderState;
|
|
9
|
+
loadSharedState(state?: DashboardState): void;
|
|
7
10
|
loadInto(state: DashboardState, clientKey: string): void;
|
|
8
11
|
persist(mode: "dashboard" | "project-service", clientKey: string, state: DashboardState, activeIndex: number, dashSessions: DashboardSession[]): void;
|
|
9
12
|
preferEntrySelection(state: DashboardState, kind: "session" | "service", id: string, worktreePath?: string): void;
|
|
10
13
|
markSelectionDirty(): void;
|
|
11
14
|
consumeSelectionRestore(state: DashboardState, dashSessions: DashboardSession[], hasWorktrees: boolean, activeIndex: number, setActiveIndex: (value: number) => void): void;
|
|
15
|
+
getOrderState(): DashboardOrderState;
|
|
16
|
+
orderWorktreeGroups(groups: WorktreeGroup[]): WorktreeGroup[];
|
|
17
|
+
orderSessionsForWorktree(sessions: DashboardSession[], worktreePath: string | undefined): DashboardSession[];
|
|
18
|
+
orderServicesForWorktree(services: DashboardService[], worktreePath: string | undefined): DashboardService[];
|
|
19
|
+
moveEntryWithinWorktree(input: {
|
|
20
|
+
kind: DashboardOrderKind;
|
|
21
|
+
worktreePath: string | undefined;
|
|
22
|
+
selectedId: string;
|
|
23
|
+
direction: DashboardOrderDirection;
|
|
24
|
+
sessions: DashboardSession[];
|
|
25
|
+
services: DashboardService[];
|
|
26
|
+
}): boolean;
|
|
12
27
|
}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dashboardOrderKey, moveDashboardOrder, orderDashboardServicesForWorktree, orderDashboardSessionsForWorktree, orderDashboardWorktreeGroups, } from "./order.js";
|
|
2
3
|
import { getDashboardClientUiStatePath, getDashboardUiStatePath } from "../paths.js";
|
|
3
4
|
export class DashboardUiStateStore {
|
|
4
5
|
preferredSelection = null;
|
|
5
6
|
flatSessionId = null;
|
|
6
7
|
selectionNeedsRestore = true;
|
|
7
|
-
|
|
8
|
+
orderState = {
|
|
9
|
+
agentOrderByWorktreeKey: {},
|
|
10
|
+
serviceOrderByWorktreeKey: {},
|
|
11
|
+
};
|
|
12
|
+
loadSharedState(state) {
|
|
13
|
+
this.orderState = {
|
|
14
|
+
agentOrderByWorktreeKey: {},
|
|
15
|
+
serviceOrderByWorktreeKey: {},
|
|
16
|
+
};
|
|
8
17
|
try {
|
|
9
18
|
const raw = readFileSync(getDashboardUiStatePath(), "utf-8");
|
|
10
19
|
const snapshot = JSON.parse(raw);
|
|
11
|
-
if (typeof snapshot.detailsSidebarVisible === "boolean") {
|
|
20
|
+
if (state && typeof snapshot.detailsSidebarVisible === "boolean") {
|
|
12
21
|
state.detailsSidebarVisible = snapshot.detailsSidebarVisible;
|
|
13
22
|
}
|
|
23
|
+
this.orderState = {
|
|
24
|
+
agentOrderByWorktreeKey: sanitizeOrderMap(snapshot.agentOrderByWorktreeKey),
|
|
25
|
+
serviceOrderByWorktreeKey: sanitizeOrderMap(snapshot.serviceOrderByWorktreeKey),
|
|
26
|
+
};
|
|
14
27
|
}
|
|
15
28
|
catch { }
|
|
29
|
+
}
|
|
30
|
+
loadInto(state, clientKey) {
|
|
31
|
+
this.loadSharedState(state);
|
|
16
32
|
try {
|
|
17
33
|
const raw = readFileSync(getDashboardClientUiStatePath(clientKey), "utf-8");
|
|
18
34
|
const snapshot = JSON.parse(raw);
|
|
@@ -44,6 +60,12 @@ export class DashboardUiStateStore {
|
|
|
44
60
|
return;
|
|
45
61
|
const sharedSnapshot = {
|
|
46
62
|
detailsSidebarVisible: state.detailsSidebarVisible,
|
|
63
|
+
...(hasOrderEntries(this.orderState.agentOrderByWorktreeKey)
|
|
64
|
+
? { agentOrderByWorktreeKey: this.orderState.agentOrderByWorktreeKey }
|
|
65
|
+
: {}),
|
|
66
|
+
...(hasOrderEntries(this.orderState.serviceOrderByWorktreeKey)
|
|
67
|
+
? { serviceOrderByWorktreeKey: this.orderState.serviceOrderByWorktreeKey }
|
|
68
|
+
: {}),
|
|
47
69
|
};
|
|
48
70
|
const clientSnapshot = {
|
|
49
71
|
screen: state.screen,
|
|
@@ -111,5 +133,53 @@ export class DashboardUiStateStore {
|
|
|
111
133
|
}
|
|
112
134
|
this.selectionNeedsRestore = false;
|
|
113
135
|
}
|
|
136
|
+
getOrderState() {
|
|
137
|
+
return {
|
|
138
|
+
agentOrderByWorktreeKey: { ...this.orderState.agentOrderByWorktreeKey },
|
|
139
|
+
serviceOrderByWorktreeKey: { ...this.orderState.serviceOrderByWorktreeKey },
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
orderWorktreeGroups(groups) {
|
|
143
|
+
return orderDashboardWorktreeGroups(groups, this.orderState);
|
|
144
|
+
}
|
|
145
|
+
orderSessionsForWorktree(sessions, worktreePath) {
|
|
146
|
+
return orderDashboardSessionsForWorktree(sessions, worktreePath, this.orderState);
|
|
147
|
+
}
|
|
148
|
+
orderServicesForWorktree(services, worktreePath) {
|
|
149
|
+
return orderDashboardServicesForWorktree(services, worktreePath, this.orderState);
|
|
150
|
+
}
|
|
151
|
+
moveEntryWithinWorktree(input) {
|
|
152
|
+
const key = dashboardOrderKey(input.worktreePath);
|
|
153
|
+
if (input.kind === "session") {
|
|
154
|
+
const result = moveDashboardOrder(input.sessions, this.orderState.agentOrderByWorktreeKey[key], input.selectedId, input.direction);
|
|
155
|
+
this.orderState.agentOrderByWorktreeKey = {
|
|
156
|
+
...this.orderState.agentOrderByWorktreeKey,
|
|
157
|
+
[key]: result.order,
|
|
158
|
+
};
|
|
159
|
+
return result.moved;
|
|
160
|
+
}
|
|
161
|
+
const result = moveDashboardOrder(input.services, this.orderState.serviceOrderByWorktreeKey[key], input.selectedId, input.direction);
|
|
162
|
+
this.orderState.serviceOrderByWorktreeKey = {
|
|
163
|
+
...this.orderState.serviceOrderByWorktreeKey,
|
|
164
|
+
[key]: result.order,
|
|
165
|
+
};
|
|
166
|
+
return result.moved;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function sanitizeOrderMap(value) {
|
|
170
|
+
if (!value || typeof value !== "object")
|
|
171
|
+
return {};
|
|
172
|
+
const output = {};
|
|
173
|
+
for (const [key, ids] of Object.entries(value)) {
|
|
174
|
+
if (!Array.isArray(ids))
|
|
175
|
+
continue;
|
|
176
|
+
const cleanIds = ids.filter((id) => typeof id === "string" && id.length > 0);
|
|
177
|
+
if (cleanIds.length > 0) {
|
|
178
|
+
output[key] = cleanIds;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return output;
|
|
182
|
+
}
|
|
183
|
+
function hasOrderEntries(value) {
|
|
184
|
+
return Object.values(value).some((ids) => ids.length > 0);
|
|
114
185
|
}
|
|
115
|
-
//# sourceMappingURL=ui-state-store.js.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type ReadOnlyProjectPaths } from "./paths.js";
|
|
2
|
+
import { type TmuxWindowMetadata, type TmuxTarget } from "./tmux/runtime-manager.js";
|
|
3
|
+
import { type WorktreeInfo } from "./worktree.js";
|
|
4
|
+
type SourceStatus = "found" | "missing" | "unavailable" | "error";
|
|
5
|
+
type SourceRole = "authority" | "projection" | "cache" | "substrate" | "legacy" | "unavailable";
|
|
6
|
+
type TargetResolutionStatus = "matched" | "missing" | "ambiguous";
|
|
7
|
+
type TargetKind = "session" | "service" | "worktree" | "backend-session" | "notification" | "operation-failure" | "tmux-window";
|
|
8
|
+
type DebugStateSourceKey = "savedState" | "runtimeTopology" | "metadata" | "tmux" | "gitWorktrees" | "graveyard" | "worktreeGraveyard" | "notifications" | "operationFailures" | "runtimeRows" | "pendingActions" | "dashboardSnapshot";
|
|
9
|
+
export interface SourceResult<T> {
|
|
10
|
+
status: SourceStatus;
|
|
11
|
+
path?: string;
|
|
12
|
+
reason?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
value?: T;
|
|
15
|
+
}
|
|
16
|
+
export interface SourceRoleDescriptor {
|
|
17
|
+
role: SourceRole;
|
|
18
|
+
authority?: string;
|
|
19
|
+
note: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TargetMatch {
|
|
22
|
+
canonicalKey: string;
|
|
23
|
+
kind: TargetKind;
|
|
24
|
+
source: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
backendSessionId?: string;
|
|
27
|
+
worktreePath?: string;
|
|
28
|
+
worktreeName?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
raw: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface DebugStateReport {
|
|
33
|
+
version: 1;
|
|
34
|
+
target: string;
|
|
35
|
+
project: {
|
|
36
|
+
repoRoot: string;
|
|
37
|
+
projectId: string;
|
|
38
|
+
projectStateDir: string;
|
|
39
|
+
localAimuxDir: string;
|
|
40
|
+
};
|
|
41
|
+
targetResolution: {
|
|
42
|
+
status: TargetResolutionStatus;
|
|
43
|
+
entityCount: number;
|
|
44
|
+
matches: TargetMatch[];
|
|
45
|
+
};
|
|
46
|
+
sourceRoles: Record<DebugStateSourceKey, SourceRoleDescriptor>;
|
|
47
|
+
sources: {
|
|
48
|
+
savedState: SourceResult<{
|
|
49
|
+
services: unknown[];
|
|
50
|
+
}>;
|
|
51
|
+
runtimeTopology: SourceResult<{
|
|
52
|
+
sessions: unknown[];
|
|
53
|
+
services: unknown[];
|
|
54
|
+
worktrees: unknown[];
|
|
55
|
+
}>;
|
|
56
|
+
metadata: SourceResult<{
|
|
57
|
+
sessions: unknown[];
|
|
58
|
+
}>;
|
|
59
|
+
tmux: SourceResult<{
|
|
60
|
+
windows: Array<{
|
|
61
|
+
target: TmuxTarget;
|
|
62
|
+
metadata: TmuxWindowMetadata;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
gitWorktrees: SourceResult<{
|
|
66
|
+
worktrees: WorktreeInfo[];
|
|
67
|
+
}>;
|
|
68
|
+
graveyard: SourceResult<{
|
|
69
|
+
entries: unknown[];
|
|
70
|
+
}>;
|
|
71
|
+
worktreeGraveyard: SourceResult<{
|
|
72
|
+
entries: unknown[];
|
|
73
|
+
}>;
|
|
74
|
+
notifications: SourceResult<{
|
|
75
|
+
notifications: unknown[];
|
|
76
|
+
}>;
|
|
77
|
+
operationFailures: SourceResult<{
|
|
78
|
+
failures: unknown[];
|
|
79
|
+
}>;
|
|
80
|
+
runtimeRows: SourceResult<never>;
|
|
81
|
+
pendingActions: SourceResult<never>;
|
|
82
|
+
dashboardSnapshot: SourceResult<never>;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface BuildDebugStateReportOptions {
|
|
86
|
+
cwd?: string;
|
|
87
|
+
target: string;
|
|
88
|
+
paths?: ReadOnlyProjectPaths;
|
|
89
|
+
tmuxWindows?: Array<{
|
|
90
|
+
target: TmuxTarget;
|
|
91
|
+
metadata: TmuxWindowMetadata;
|
|
92
|
+
}> | Error;
|
|
93
|
+
worktrees?: WorktreeInfo[] | Error;
|
|
94
|
+
}
|
|
95
|
+
export declare function buildDebugStateReport(options: BuildDebugStateReportOptions): DebugStateReport;
|
|
96
|
+
export declare function renderDebugStateReport(report: DebugStateReport): string;
|
|
97
|
+
export {};
|