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,20 +1,17 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
1
|
import { HotkeyHandler } from "../hotkeys.js";
|
|
3
2
|
import { Dashboard } from "../dashboard/index.js";
|
|
4
3
|
import { DashboardOverlayState, DashboardState } from "../dashboard/state.js";
|
|
5
4
|
import { ContextWatcher } from "../context/context-bridge.js";
|
|
6
5
|
import { loadConfig } from "../config.js";
|
|
7
6
|
import { findMainRepo } from "../worktree.js";
|
|
8
|
-
import { TaskDispatcher } from "../task-dispatcher.js";
|
|
9
7
|
import { TerminalHost } from "../terminal-host.js";
|
|
10
8
|
import { AgentTracker } from "../agent-tracker.js";
|
|
11
|
-
import { InstanceDirectory } from "../instance-directory.js";
|
|
12
9
|
import { TmuxRuntimeManager } from "../tmux/runtime-manager.js";
|
|
13
10
|
import { loadMetadataState } from "../metadata-store.js";
|
|
14
11
|
import { SessionBootstrapService } from "../session-bootstrap.js";
|
|
15
12
|
import { createThread, appendMessage, updateThread } from "../threads.js";
|
|
16
|
-
import { OrchestrationDispatcher } from "../orchestration-dispatcher.js";
|
|
17
13
|
import { ProjectEventBus } from "../project-events.js";
|
|
14
|
+
import { contextualizeAlertInput, mergeDisplayContext, metadataDisplayContext, } from "../alert-display.js";
|
|
18
15
|
import { deriveSessionSemantics } from "../session-semantics.js";
|
|
19
16
|
import { listNotifications } from "../notifications.js";
|
|
20
17
|
import { DashboardUiStateStore } from "../dashboard/ui-state-store.js";
|
|
@@ -91,12 +88,19 @@ export class Multiplexer {
|
|
|
91
88
|
planEntries = [];
|
|
92
89
|
planIndex = 0;
|
|
93
90
|
notificationPanelState = null;
|
|
91
|
+
teammatePickerState = null;
|
|
94
92
|
dashboardPendingActions = new DashboardPendingActions(() => {
|
|
95
93
|
if (this.mode === "dashboard") {
|
|
94
|
+
void this.refreshDashboardModelFromService(true).then(() => {
|
|
95
|
+
if (this.mode === "dashboard") {
|
|
96
|
+
this.renderCurrentDashboardView();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
96
99
|
this.renderCurrentDashboardView();
|
|
97
100
|
}
|
|
98
101
|
});
|
|
99
102
|
stoppingSessionIds = new Set();
|
|
103
|
+
unpreservedExitedSessionIds = new Set();
|
|
100
104
|
graveyardAfterStopSessionIds = new Set();
|
|
101
105
|
dashboardQuickJumpTimeout = null;
|
|
102
106
|
/** Quick switcher overlay state */
|
|
@@ -105,7 +109,6 @@ export class Multiplexer {
|
|
|
105
109
|
/** MRU order of session IDs (most recent first) */
|
|
106
110
|
sessionMRU = [];
|
|
107
111
|
/** Sessions confirmed registered in the instance registry (for claim detection) */
|
|
108
|
-
confirmedRegistered = new Set();
|
|
109
112
|
/** The focused worktree path on the dashboard (undefined = main repo) */
|
|
110
113
|
dashboardState = new DashboardState();
|
|
111
114
|
dashboardUiStateStore = new DashboardUiStateStore();
|
|
@@ -117,11 +120,8 @@ export class Multiplexer {
|
|
|
117
120
|
dashboardPendingExpandedViewportCount = 0;
|
|
118
121
|
dashboardModelVersion = 0;
|
|
119
122
|
agentTracker = new AgentTracker();
|
|
120
|
-
instanceId = randomUUID();
|
|
121
123
|
contextWatcher = new ContextWatcher((target) => this.tmuxRuntimeManager.captureTarget(target, { startLine: -120 }));
|
|
122
|
-
|
|
123
|
-
orchestrationDispatcher = null;
|
|
124
|
-
/** Maps session ID → toolConfigKey for state saving */
|
|
124
|
+
/** Maps session ID → toolConfigKey for topology persistence */
|
|
125
125
|
sessionToolKeys = new Map();
|
|
126
126
|
/** Maps session ID → original args (before preamble injection) */
|
|
127
127
|
sessionOriginalArgs = new Map();
|
|
@@ -131,10 +131,9 @@ export class Multiplexer {
|
|
|
131
131
|
sessionRoles = new Map();
|
|
132
132
|
/** Maps session ID → user-provided stable label */
|
|
133
133
|
sessionLabels = new Map();
|
|
134
|
-
/** Offline sessions from previous runs (loaded from
|
|
134
|
+
/** Offline sessions from previous runs (loaded from runtime topology) */
|
|
135
135
|
offlineSessions = [];
|
|
136
136
|
/** Cross-instance discovery and claim/heartbeat ownership */
|
|
137
|
-
instanceDirectory = new InstanceDirectory();
|
|
138
137
|
tmuxRuntimeManager = new TmuxRuntimeManager();
|
|
139
138
|
sessionBootstrap = new SessionBootstrapService({
|
|
140
139
|
tmuxRuntimeManager: this.tmuxRuntimeManager,
|
|
@@ -153,7 +152,9 @@ export class Multiplexer {
|
|
|
153
152
|
lastStatuslineSnapshotKey = null;
|
|
154
153
|
desktopStateSnapshot = null;
|
|
155
154
|
dashboardSessionsCache = [];
|
|
155
|
+
dashboardTeammatesCache = [];
|
|
156
156
|
dashboardServicesCache = [];
|
|
157
|
+
dashboardRawWorktreeGroupsCache = [];
|
|
157
158
|
dashboardWorktreeGroupsCache = [];
|
|
158
159
|
dashboardOperationFailuresCache = [];
|
|
159
160
|
dashboardMainCheckoutInfoCache = { name: "Main Checkout", branch: "" };
|
|
@@ -176,20 +177,12 @@ export class Multiplexer {
|
|
|
176
177
|
this.hotkeys = new HotkeyHandler((action) => this.handleAction(action));
|
|
177
178
|
this.dashboard = new Dashboard();
|
|
178
179
|
this.runtimeSync = new MultiplexerRuntimeSync({
|
|
179
|
-
instanceDirectory: this.instanceDirectory,
|
|
180
|
-
instanceId: this.instanceId,
|
|
181
180
|
cwd: process.cwd(),
|
|
182
181
|
getMode: () => this.mode,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
this.confirmedRegistered = value;
|
|
186
|
-
},
|
|
187
|
-
getInstanceSessionRefs: () => this.getInstanceSessionRefs(),
|
|
188
|
-
syncSessionsFromState: () => this.syncSessionsFromState(),
|
|
189
|
-
loadOfflineSessions: () => this.loadOfflineSessions(),
|
|
182
|
+
syncSessionsFromTopology: () => this.syncSessionsFromTopology(),
|
|
183
|
+
loadOfflineTopologySessions: () => this.loadOfflineTopologySessions(),
|
|
190
184
|
renderCurrentDashboardView: () => this.renderCurrentDashboardView(),
|
|
191
185
|
renderDashboard: () => this.renderDashboard(),
|
|
192
|
-
handleSessionClaimed: (sessionId) => this.handleSessionClaimed(sessionId),
|
|
193
186
|
writeStatuslineFile: () => this.writeStatuslineFile(),
|
|
194
187
|
});
|
|
195
188
|
this.eventBus.subscribe((event) => {
|
|
@@ -232,7 +225,42 @@ export class Multiplexer {
|
|
|
232
225
|
return this.sessions[this.activeIndex] ?? null;
|
|
233
226
|
}
|
|
234
227
|
publishAlert(input) {
|
|
235
|
-
this.
|
|
228
|
+
const displayContext = this.resolveSessionAlertDisplayContext(input.sessionId, input.worktreePath);
|
|
229
|
+
this.eventBus.publishAlert(contextualizeAlertInput(input, displayContext));
|
|
230
|
+
}
|
|
231
|
+
resolveSessionAlertDisplayContext(sessionId, worktreePath) {
|
|
232
|
+
if (!sessionId)
|
|
233
|
+
return worktreePath ? { worktreePath } : undefined;
|
|
234
|
+
let context = {};
|
|
235
|
+
try {
|
|
236
|
+
context = metadataDisplayContext(loadMetadataState().sessions[sessionId]);
|
|
237
|
+
}
|
|
238
|
+
catch { }
|
|
239
|
+
const session = this.dashboardSessionsCache.find((entry) => entry.id === sessionId) ??
|
|
240
|
+
this.sessions.find((entry) => entry.id === sessionId) ??
|
|
241
|
+
this.offlineSessions.find((entry) => entry.id === sessionId);
|
|
242
|
+
const service = this.dashboardServicesCache.find((entry) => entry.id === sessionId) ??
|
|
243
|
+
this.offlineServices?.find?.((entry) => entry.id === sessionId);
|
|
244
|
+
const sessionAny = session;
|
|
245
|
+
const serviceAny = service;
|
|
246
|
+
const resolvedWorktreePath = worktreePath ?? this.sessionWorktreePaths.get(sessionId) ?? sessionAny?.worktreePath ?? serviceAny?.worktreePath;
|
|
247
|
+
const group = resolvedWorktreePath
|
|
248
|
+
? this.dashboardWorktreeGroupsCache.find((entry) => entry.path === resolvedWorktreePath)
|
|
249
|
+
: this.dashboardWorktreeGroupsCache.find((entry) => !entry.path);
|
|
250
|
+
const serviceCommand = serviceAny?.launchCommandLine ?? serviceAny?.command ?? "";
|
|
251
|
+
const liveContext = {
|
|
252
|
+
label: this.getSessionLabel(sessionId) ??
|
|
253
|
+
sessionAny?.label ??
|
|
254
|
+
serviceAny?.label ??
|
|
255
|
+
(serviceCommand ? this.serviceLabelForCommand?.(serviceCommand) : undefined) ??
|
|
256
|
+
sessionAny?.command,
|
|
257
|
+
command: sessionAny?.command ?? serviceAny?.command ?? serviceAny?.launchCommandLine,
|
|
258
|
+
worktreePath: resolvedWorktreePath,
|
|
259
|
+
worktreeName: sessionAny?.worktreeName ?? serviceAny?.worktreeName ?? group?.name,
|
|
260
|
+
branch: sessionAny?.worktreeBranch ?? serviceAny?.worktreeBranch ?? group?.branch,
|
|
261
|
+
};
|
|
262
|
+
context = mergeDisplayContext(context, liveContext);
|
|
263
|
+
return Object.values(context).some((value) => value !== undefined) ? context : undefined;
|
|
236
264
|
}
|
|
237
265
|
deriveSessionSemanticState(sessionId, status) {
|
|
238
266
|
const derived = loadMetadataState().sessions[sessionId]?.derived;
|
|
@@ -245,11 +273,11 @@ export class Multiplexer {
|
|
|
245
273
|
unseenCount: derived?.unseenCount,
|
|
246
274
|
notificationUnreadCount: unreadNotifications.length,
|
|
247
275
|
latestNotification,
|
|
248
|
-
hasActiveTask:
|
|
276
|
+
hasActiveTask: false,
|
|
249
277
|
});
|
|
250
278
|
}
|
|
251
|
-
registerManagedSession(session, args, toolConfigKey, worktreePath, role, startTime) {
|
|
252
|
-
return registerManagedSessionImpl(this, session, args, toolConfigKey, worktreePath, role, startTime);
|
|
279
|
+
registerManagedSession(session, args, toolConfigKey, worktreePath, role, startTime, team) {
|
|
280
|
+
return registerManagedSessionImpl(this, session, args, toolConfigKey, worktreePath, role, startTime, team);
|
|
253
281
|
}
|
|
254
282
|
handleSessionRuntimeEvent(runtime, event) {
|
|
255
283
|
handleSessionRuntimeEventImpl(this, runtime, event);
|
|
@@ -263,16 +291,6 @@ export class Multiplexer {
|
|
|
263
291
|
updateContextWatcherSessions() {
|
|
264
292
|
updateContextWatcherSessionsImpl(this);
|
|
265
293
|
}
|
|
266
|
-
createTaskDispatcher() {
|
|
267
|
-
return new TaskDispatcher((id) => this.sessions.find((s) => s.id === id), (id) => this.sessionToolKeys.get(id), (id) => this.sessionRoles.get(id), (id) => this.deriveSessionSemanticState(id).runtime.canReceiveInput, (session, prompt) => {
|
|
268
|
-
void this.writeAgentInput(session.id, prompt, undefined, undefined, true);
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
createOrchestrationDispatcher() {
|
|
272
|
-
return new OrchestrationDispatcher((id) => this.sessions.find((s) => s.id === id), (id) => this.deriveSessionSemanticState(id).runtime.canReceiveInput, (session, prompt) => {
|
|
273
|
-
void this.writeAgentInput(session.id, prompt, undefined, undefined, true);
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
294
|
selectLinkedOrOpenTarget(target) {
|
|
277
295
|
selectLinkedOrOpenTarget(this.tmuxRuntimeManager, target);
|
|
278
296
|
}
|
|
@@ -287,7 +305,7 @@ export class Multiplexer {
|
|
|
287
305
|
}
|
|
288
306
|
/**
|
|
289
307
|
* Resume previous sessions using each tool's native resume mechanism.
|
|
290
|
-
* Reads
|
|
308
|
+
* Reads runtime topology and spawns sessions with resumeArgs instead of normal args.
|
|
291
309
|
*/
|
|
292
310
|
async resumeSessions(toolFilter) {
|
|
293
311
|
return resumeSessionsImpl(this, toolFilter);
|
|
@@ -299,8 +317,11 @@ export class Multiplexer {
|
|
|
299
317
|
async restoreSessions(toolFilter) {
|
|
300
318
|
return restoreSessionsImpl(this, toolFilter);
|
|
301
319
|
}
|
|
302
|
-
createSession(command, args, preambleFlag, toolConfigKey, extraPreamble, sessionIdFlag, worktreePath, backendSessionIdOverride, sessionIdOverride, detachedInTmux = false, suppressStartupPreamble = false) {
|
|
303
|
-
return createSessionImpl(this, command, args, preambleFlag, toolConfigKey, extraPreamble, sessionIdFlag, worktreePath, backendSessionIdOverride, sessionIdOverride, detachedInTmux, suppressStartupPreamble);
|
|
320
|
+
createSession(command, args, preambleFlag, toolConfigKey, extraPreamble, sessionIdFlag, worktreePath, backendSessionIdOverride, sessionIdOverride, detachedInTmux = false, suppressStartupPreamble = false, team) {
|
|
321
|
+
return createSessionImpl(this, command, args, preambleFlag, toolConfigKey, extraPreamble, sessionIdFlag, worktreePath, backendSessionIdOverride, sessionIdOverride, detachedInTmux, suppressStartupPreamble, team);
|
|
322
|
+
}
|
|
323
|
+
recordSessionBackendSessionId(sessionId, backendSessionId) {
|
|
324
|
+
return runtimeLifecycleMethods.recordSessionBackendSessionId.call(this, sessionId, backendSessionId);
|
|
304
325
|
}
|
|
305
326
|
/**
|
|
306
327
|
* Migrate an agent from its current worktree to a target worktree.
|
|
@@ -371,17 +392,17 @@ export class Multiplexer {
|
|
|
371
392
|
await this.contextWatcher.syncNow(sourceSessionId).catch(() => { });
|
|
372
393
|
const sourceSnapshot = this.sessionBootstrap.readForkSourceSnapshot(sourceSessionId);
|
|
373
394
|
this.sessionBootstrap.seedForkArtifacts(sourceSessionId, targetSessionId, targetToolConfigKey);
|
|
395
|
+
const codexContinuityPreamble = !toolCfg.preambleFlag
|
|
396
|
+
? this.sessionBootstrap.buildCodexForkContinuityPreamble(sourceSessionId, targetSessionId, sourceSnapshot, instruction)
|
|
397
|
+
: undefined;
|
|
374
398
|
const extraPreamble = [
|
|
375
399
|
this.sessionBootstrap.buildForkPreamble(sourceSessionId, targetSessionId),
|
|
376
|
-
instruction?.trim(),
|
|
400
|
+
codexContinuityPreamble ? undefined : instruction?.trim(),
|
|
401
|
+
codexContinuityPreamble,
|
|
377
402
|
]
|
|
378
403
|
.filter(Boolean)
|
|
379
404
|
.join("\n\n");
|
|
380
405
|
const transport = this.createSession(toolCfg.command, [...toolCfg.args, ...extraArgs], toolCfg.preambleFlag, targetToolConfigKey, extraPreamble, toolCfg.sessionIdFlag, targetWorktree, undefined, targetSessionId, !toolCfg.preambleFlag);
|
|
381
|
-
if (!toolCfg.preambleFlag) {
|
|
382
|
-
const kickoff = this.sessionBootstrap.buildCodexForkKickoffPrompt(sourceSessionId, targetSessionId, sourceSnapshot, instruction);
|
|
383
|
-
await this.sessionBootstrap.deliverDetachedCodexKickoffPrompt(targetSessionId, kickoff, 1800);
|
|
384
|
-
}
|
|
385
406
|
this.agentTracker.emit(sourceSessionId, {
|
|
386
407
|
kind: "status",
|
|
387
408
|
message: `Forked ${targetSessionId} from this session`,
|
|
@@ -439,4 +460,3 @@ export class Multiplexer {
|
|
|
439
460
|
}
|
|
440
461
|
}
|
|
441
462
|
Object.assign(Multiplexer.prototype, dashboardInteractionMethods, dashboardViewMethods, dashboardActionMethods, dashboardTailMethods, persistenceMethods, dashboardStateMethods, agentIoMethods, runtimeLifecycleMethods);
|
|
442
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { clearNotifications, listNotifications, markNotificationsRead } from "../notifications.js";
|
|
2
1
|
import { parseKeys } from "../key-parser.js";
|
|
3
2
|
import { renderNotificationsScreen } from "../tui/screens/subscreen-renderers.js";
|
|
3
|
+
import { createRuntimeExchangeStore } from "../runtime-core/exchange-store.js";
|
|
4
|
+
import { markThreadSeen } from "../threads.js";
|
|
4
5
|
export function showNotificationPanel(host) {
|
|
5
|
-
const entries =
|
|
6
|
+
const entries = loadNotificationEntries(host).slice(0, 40);
|
|
6
7
|
host.notificationPanelState = {
|
|
7
8
|
entries,
|
|
8
9
|
index: entries.length > 0 ? 0 : -1,
|
|
@@ -50,8 +51,8 @@ export function handleNotificationPanelKey(host, data) {
|
|
|
50
51
|
const selected = panel.entries[panel.index];
|
|
51
52
|
if (!selected)
|
|
52
53
|
return;
|
|
53
|
-
|
|
54
|
-
panel.entries =
|
|
54
|
+
markRuntimeInboxEntriesDone({ id: selected.id });
|
|
55
|
+
panel.entries = loadNotificationEntries(host).slice(0, 40);
|
|
55
56
|
if (panel.index >= panel.entries.length)
|
|
56
57
|
panel.index = panel.entries.length - 1;
|
|
57
58
|
host.renderDashboard();
|
|
@@ -61,25 +62,98 @@ export function handleNotificationPanelKey(host, data) {
|
|
|
61
62
|
const selected = panel.entries[panel.index];
|
|
62
63
|
if (!selected)
|
|
63
64
|
return;
|
|
64
|
-
|
|
65
|
-
panel.entries =
|
|
65
|
+
markRuntimeInboxEntriesDone({ id: selected.id });
|
|
66
|
+
panel.entries = loadNotificationEntries(host).slice(0, 40);
|
|
66
67
|
if (panel.index >= panel.entries.length)
|
|
67
68
|
panel.index = panel.entries.length - 1;
|
|
68
69
|
host.renderDashboard();
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
72
|
if (key === "C") {
|
|
72
|
-
|
|
73
|
+
markRuntimeInboxEntriesDone();
|
|
73
74
|
panel.entries = [];
|
|
74
75
|
panel.index = -1;
|
|
75
76
|
host.renderDashboard();
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
return
|
|
79
|
+
function hasNotificationTarget(host, participantId) {
|
|
80
|
+
return Boolean(findNotificationSessionTarget(host, participantId) ?? findNotificationServiceTarget(host, participantId));
|
|
81
|
+
}
|
|
82
|
+
function notificationTargetSessionId(host, participantId) {
|
|
83
|
+
return hasNotificationTarget(host, participantId) ? participantId : undefined;
|
|
84
|
+
}
|
|
85
|
+
function loadNotificationEntries(host) {
|
|
86
|
+
const exchange = createRuntimeExchangeStore().read();
|
|
87
|
+
const threadById = new Map(exchange.threads.map((thread) => [thread.id, thread]));
|
|
88
|
+
const taskById = new Map(exchange.tasks.map((task) => [task.id, task]));
|
|
89
|
+
const latestMessageByThread = new Map();
|
|
90
|
+
for (const message of exchange.messages) {
|
|
91
|
+
const existing = latestMessageByThread.get(message.threadId);
|
|
92
|
+
if (!existing || existing.ts < message.ts)
|
|
93
|
+
latestMessageByThread.set(message.threadId, message);
|
|
94
|
+
}
|
|
95
|
+
return exchange.inbox
|
|
96
|
+
.filter((entry) => entry.state !== "done")
|
|
97
|
+
.map((entry) => {
|
|
98
|
+
if (entry.subjectKind === "thread" || entry.subjectKind === "handoff" || entry.subjectKind === "message") {
|
|
99
|
+
const thread = threadById.get(entry.subjectId);
|
|
100
|
+
if (!thread)
|
|
101
|
+
return undefined;
|
|
102
|
+
const message = latestMessageByThread.get(thread.id);
|
|
103
|
+
return {
|
|
104
|
+
id: entry.id,
|
|
105
|
+
title: thread.title,
|
|
106
|
+
subtitle: `${thread.kind} · ${thread.status}`,
|
|
107
|
+
body: message?.body ?? thread.title,
|
|
108
|
+
sessionId: notificationTargetSessionId(host, entry.participantId),
|
|
109
|
+
targetKind: notificationTargetSessionId(host, entry.participantId)
|
|
110
|
+
? "session"
|
|
111
|
+
: "generic",
|
|
112
|
+
kind: entry.subjectKind,
|
|
113
|
+
unread: true,
|
|
114
|
+
cleared: false,
|
|
115
|
+
createdAt: entry.updatedAt,
|
|
116
|
+
updatedAt: entry.updatedAt,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const task = taskById.get(entry.subjectId);
|
|
120
|
+
if (!task)
|
|
121
|
+
return undefined;
|
|
122
|
+
return {
|
|
123
|
+
id: entry.id,
|
|
124
|
+
title: task.description,
|
|
125
|
+
subtitle: `${task.type ?? "task"} · ${task.status}`,
|
|
126
|
+
body: task.result ?? task.error ?? task.prompt,
|
|
127
|
+
sessionId: notificationTargetSessionId(host, entry.participantId),
|
|
128
|
+
targetKind: notificationTargetSessionId(host, entry.participantId)
|
|
129
|
+
? "session"
|
|
130
|
+
: "generic",
|
|
131
|
+
kind: entry.subjectKind,
|
|
132
|
+
unread: true,
|
|
133
|
+
cleared: false,
|
|
134
|
+
createdAt: entry.updatedAt,
|
|
135
|
+
updatedAt: entry.updatedAt,
|
|
136
|
+
};
|
|
137
|
+
})
|
|
138
|
+
.filter((entry) => Boolean(entry))
|
|
139
|
+
.sort((a, b) => b.createdAt.localeCompare(a.createdAt))
|
|
140
|
+
.slice(0, 200);
|
|
141
|
+
}
|
|
142
|
+
function markRuntimeInboxEntriesDone(input = {}) {
|
|
143
|
+
const store = createRuntimeExchangeStore();
|
|
144
|
+
const entries = store.read().inbox.filter((entry) => !input.id || entry.id === input.id);
|
|
145
|
+
for (const entry of entries) {
|
|
146
|
+
if (entry.subjectKind === "thread" || entry.subjectKind === "handoff" || entry.subjectKind === "message") {
|
|
147
|
+
markThreadSeen(entry.subjectId, entry.participantId);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
store.update((exchange) => ({
|
|
151
|
+
...exchange,
|
|
152
|
+
inbox: exchange.inbox.map((entry) => (!input.id || entry.id === input.id ? { ...entry, state: "done" } : entry)),
|
|
153
|
+
}));
|
|
80
154
|
}
|
|
81
155
|
function refreshNotificationEntries(host) {
|
|
82
|
-
host.notificationEntries = loadNotificationEntries();
|
|
156
|
+
host.notificationEntries = loadNotificationEntries(host);
|
|
83
157
|
if (host.notificationIndex >= host.notificationEntries.length) {
|
|
84
158
|
host.notificationIndex = Math.max(0, host.notificationEntries.length - 1);
|
|
85
159
|
}
|
|
@@ -98,6 +172,13 @@ function ensureNotificationState(host) {
|
|
|
98
172
|
host.notificationIndex = host.notificationEntries.length > 0 ? 0 : -1;
|
|
99
173
|
}
|
|
100
174
|
}
|
|
175
|
+
function findNotificationSessionTarget(host, sessionId) {
|
|
176
|
+
return (host.getDashboardSessions?.().find((entry) => entry.id === sessionId) ??
|
|
177
|
+
(host.dashboardTeammatesCache ?? []).find((entry) => entry.id === sessionId));
|
|
178
|
+
}
|
|
179
|
+
function findNotificationServiceTarget(host, sessionId) {
|
|
180
|
+
return host.getDashboardServices?.().find((entry) => entry.id === sessionId);
|
|
181
|
+
}
|
|
101
182
|
export function showNotifications(host) {
|
|
102
183
|
host.clearDashboardSubscreens();
|
|
103
184
|
refreshNotificationEntries(host);
|
|
@@ -114,11 +195,11 @@ export function renderNotifications(host) {
|
|
|
114
195
|
export function notificationTargetLabel(host, sessionId) {
|
|
115
196
|
if (!sessionId)
|
|
116
197
|
return null;
|
|
117
|
-
const session = host
|
|
198
|
+
const session = findNotificationSessionTarget(host, sessionId);
|
|
118
199
|
if (session) {
|
|
119
200
|
return `${session.label ?? session.command}${session.worktreeName ? ` · ${session.worktreeName}` : ""}`;
|
|
120
201
|
}
|
|
121
|
-
const service = host
|
|
202
|
+
const service = findNotificationServiceTarget(host, sessionId);
|
|
122
203
|
if (service) {
|
|
123
204
|
return `${service.label ?? service.command} [service]${service.worktreeName ? ` · ${service.worktreeName}` : ""}`;
|
|
124
205
|
}
|
|
@@ -127,11 +208,11 @@ export function notificationTargetLabel(host, sessionId) {
|
|
|
127
208
|
export function notificationTargetState(host, sessionId) {
|
|
128
209
|
if (!sessionId)
|
|
129
210
|
return "none";
|
|
130
|
-
const session = host
|
|
211
|
+
const session = findNotificationSessionTarget(host, sessionId);
|
|
131
212
|
if (session) {
|
|
132
213
|
return session.status === "offline" ? "offline" : "live";
|
|
133
214
|
}
|
|
134
|
-
const service = host
|
|
215
|
+
const service = findNotificationServiceTarget(host, sessionId);
|
|
135
216
|
if (service) {
|
|
136
217
|
return service.status === "running" ? "live" : "offline";
|
|
137
218
|
}
|
|
@@ -143,7 +224,7 @@ async function openSelectedNotification(host) {
|
|
|
143
224
|
return;
|
|
144
225
|
if (!entry.sessionId) {
|
|
145
226
|
if (entry.unread) {
|
|
146
|
-
|
|
227
|
+
markRuntimeInboxEntriesDone({ id: entry.id });
|
|
147
228
|
refreshNotificationEntries(host);
|
|
148
229
|
}
|
|
149
230
|
renderNotifications(host);
|
|
@@ -156,10 +237,12 @@ async function openSelectedNotification(host) {
|
|
|
156
237
|
renderNotifications(host);
|
|
157
238
|
return;
|
|
158
239
|
}
|
|
159
|
-
const session = host
|
|
240
|
+
const session = findNotificationSessionTarget(host, entry.sessionId);
|
|
160
241
|
if (session) {
|
|
161
242
|
try {
|
|
162
|
-
await host.activateDashboardEntry(session
|
|
243
|
+
await host.activateDashboardEntry(session, {
|
|
244
|
+
preserveDashboardSelection: Boolean(session.team),
|
|
245
|
+
});
|
|
163
246
|
}
|
|
164
247
|
catch {
|
|
165
248
|
host.footerFlash = "Failed to open notification target";
|
|
@@ -168,12 +251,12 @@ async function openSelectedNotification(host) {
|
|
|
168
251
|
return;
|
|
169
252
|
}
|
|
170
253
|
if (entry.unread) {
|
|
171
|
-
|
|
254
|
+
markRuntimeInboxEntriesDone({ id: entry.id });
|
|
172
255
|
refreshNotificationEntries(host);
|
|
173
256
|
}
|
|
174
257
|
return;
|
|
175
258
|
}
|
|
176
|
-
const service = host
|
|
259
|
+
const service = findNotificationServiceTarget(host, entry.sessionId);
|
|
177
260
|
if (!service) {
|
|
178
261
|
host.footerFlash = "Notification target is no longer available";
|
|
179
262
|
host.footerFlashTicks = 3;
|
|
@@ -190,7 +273,7 @@ async function openSelectedNotification(host) {
|
|
|
190
273
|
return;
|
|
191
274
|
}
|
|
192
275
|
if (entry.unread) {
|
|
193
|
-
|
|
276
|
+
markRuntimeInboxEntriesDone({ id: entry.id });
|
|
194
277
|
refreshNotificationEntries(host);
|
|
195
278
|
}
|
|
196
279
|
}
|
|
@@ -248,13 +331,13 @@ export function handleNotificationsKey(host, data) {
|
|
|
248
331
|
const entry = host.notificationEntries[host.notificationIndex];
|
|
249
332
|
if (!entry)
|
|
250
333
|
return;
|
|
251
|
-
|
|
334
|
+
markRuntimeInboxEntriesDone({ id: entry.id });
|
|
252
335
|
refreshNotificationEntries(host);
|
|
253
336
|
renderNotifications(host);
|
|
254
337
|
return;
|
|
255
338
|
}
|
|
256
339
|
if (key === "R") {
|
|
257
|
-
|
|
340
|
+
markRuntimeInboxEntriesDone();
|
|
258
341
|
refreshNotificationEntries(host);
|
|
259
342
|
renderNotifications(host);
|
|
260
343
|
return;
|
|
@@ -263,13 +346,13 @@ export function handleNotificationsKey(host, data) {
|
|
|
263
346
|
const entry = host.notificationEntries[host.notificationIndex];
|
|
264
347
|
if (!entry)
|
|
265
348
|
return;
|
|
266
|
-
|
|
349
|
+
markRuntimeInboxEntriesDone({ id: entry.id });
|
|
267
350
|
refreshNotificationEntries(host);
|
|
268
351
|
renderNotifications(host);
|
|
269
352
|
return;
|
|
270
353
|
}
|
|
271
354
|
if (key === "C") {
|
|
272
|
-
|
|
355
|
+
markRuntimeInboxEntriesDone();
|
|
273
356
|
refreshNotificationEntries(host);
|
|
274
357
|
renderNotifications(host);
|
|
275
358
|
return;
|
|
@@ -278,4 +361,3 @@ export function handleNotificationsKey(host, data) {
|
|
|
278
361
|
void openSelectedNotification(host);
|
|
279
362
|
}
|
|
280
363
|
}
|
|
281
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { PendingWorktreeActionKind } from "../pending-actions.js";
|
|
1
2
|
import { type DashboardOperationFailure } from "../dashboard/operation-failures.js";
|
|
2
3
|
import { type DashboardScreen } from "../dashboard/state.js";
|
|
3
4
|
import { type DashboardService, type DashboardSession } from "../dashboard/index.js";
|
|
4
5
|
import { loadMetadataState } from "../metadata-store.js";
|
|
5
6
|
export declare const persistenceMethods: {
|
|
6
|
-
writeSessionsFile(this: any): void;
|
|
7
7
|
writeStatuslineFile(this: any, input?: {
|
|
8
8
|
force?: boolean;
|
|
9
9
|
}): void;
|
|
@@ -34,6 +34,22 @@ export declare const persistenceMethods: {
|
|
|
34
34
|
role?: string;
|
|
35
35
|
active: boolean;
|
|
36
36
|
worktreePath?: string;
|
|
37
|
+
launchCommandLine?: string;
|
|
38
|
+
}>;
|
|
39
|
+
teammates: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
kind?: "agent" | "service";
|
|
42
|
+
tool: string;
|
|
43
|
+
label?: string;
|
|
44
|
+
tmuxWindowId?: string;
|
|
45
|
+
tmuxWindowIndex?: number;
|
|
46
|
+
windowName: string;
|
|
47
|
+
headline?: string;
|
|
48
|
+
status: string;
|
|
49
|
+
role?: string;
|
|
50
|
+
active: boolean;
|
|
51
|
+
worktreePath?: string;
|
|
52
|
+
team?: DashboardSession["team"];
|
|
37
53
|
}>;
|
|
38
54
|
tasks: {
|
|
39
55
|
pending: number;
|
|
@@ -49,6 +65,7 @@ export declare const persistenceMethods: {
|
|
|
49
65
|
};
|
|
50
66
|
buildDesktopState(this: any): {
|
|
51
67
|
sessions: DashboardSession[];
|
|
68
|
+
teammates: DashboardSession[];
|
|
52
69
|
services: DashboardService[];
|
|
53
70
|
statusline: ReturnType<any["buildStatuslineSnapshot"]>;
|
|
54
71
|
worktrees: Array<{
|
|
@@ -73,7 +90,18 @@ export declare const persistenceMethods: {
|
|
|
73
90
|
createdAt?: string;
|
|
74
91
|
pending?: boolean;
|
|
75
92
|
removing?: boolean;
|
|
76
|
-
pendingAction?: "creating"
|
|
93
|
+
pendingAction?: Extract<PendingWorktreeActionKind, "creating">;
|
|
94
|
+
operationFailure?: DashboardOperationFailure;
|
|
95
|
+
}>;
|
|
96
|
+
listProjectedDesktopWorktrees(this: any): Array<{
|
|
97
|
+
name: string;
|
|
98
|
+
path: string;
|
|
99
|
+
branch: string;
|
|
100
|
+
isBare: boolean;
|
|
101
|
+
createdAt?: string;
|
|
102
|
+
pending?: boolean;
|
|
103
|
+
removing?: boolean;
|
|
104
|
+
pendingAction?: Extract<PendingWorktreeActionKind, "creating" | "removing" | "graveyarding">;
|
|
77
105
|
operationFailure?: DashboardOperationFailure;
|
|
78
106
|
}>;
|
|
79
107
|
listWorktreeGraveyardEntries(this: any): any[];
|
|
@@ -83,7 +111,7 @@ export declare const persistenceMethods: {
|
|
|
83
111
|
}>;
|
|
84
112
|
resurrectGraveyardWorktree(this: any, path: string): Promise<{
|
|
85
113
|
path: string;
|
|
86
|
-
status: "
|
|
114
|
+
status: "active";
|
|
87
115
|
}>;
|
|
88
116
|
deleteGraveyardWorktree(this: any, path: string): Promise<{
|
|
89
117
|
path: string;
|
|
@@ -102,7 +130,6 @@ export declare const persistenceMethods: {
|
|
|
102
130
|
sessionId: string;
|
|
103
131
|
status: "offline";
|
|
104
132
|
}>;
|
|
105
|
-
removeSessionsFile(this: any): void;
|
|
106
133
|
stripAnsi(this: any, text: string): string;
|
|
107
134
|
centerInWidth(this: any, text: string, width: number): string;
|
|
108
135
|
renderCurrentDashboardView(this: any): void;
|