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
package/dist/tmux/statusline.js
CHANGED
|
@@ -2,16 +2,28 @@ import { basename } from "node:path";
|
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { getProjectStateDirFor } from "../paths.js";
|
|
4
4
|
import { isDashboardWindowName } from "./runtime-manager.js";
|
|
5
|
-
import { compactSessionTitle, currentPathContext, renderDashboardScreens, renderSemanticBadge, renderSessionCompactHint, resolveExactCurrentSessionId, resolveExactSessionMetadata, resolveScopedSessions, trim, } from "../statusline-model.js";
|
|
5
|
+
import { compactSessionTitle, currentPathContext, findStatuslineSession, renderDashboardScreens, renderSemanticBadge, renderSessionCompactHint, resolveCurrentTeammates, resolveExactCurrentSessionId, resolveExactSessionMetadata, resolveFocusedTeammateGroup, resolveFocusedTeammate, resolveScopedSessions, trim, } from "../statusline-model.js";
|
|
6
6
|
function renderStatusRange(range, label) {
|
|
7
7
|
return `#[range=user|${range}]${label}#[norange]`;
|
|
8
8
|
}
|
|
9
|
+
function sanitizeStatuslineProjection(data) {
|
|
10
|
+
const sessions = Array.isArray(data.sessions) ? data.sessions : [];
|
|
11
|
+
const teammates = Array.isArray(data.teammates) ? data.teammates : [];
|
|
12
|
+
const knownSessionIds = new Set([...sessions, ...teammates].map((session) => session.id).filter(Boolean));
|
|
13
|
+
const metadata = Object.fromEntries(Object.entries(data.metadata ?? {}).filter(([sessionId]) => knownSessionIds.has(sessionId)));
|
|
14
|
+
return {
|
|
15
|
+
...data,
|
|
16
|
+
sessions,
|
|
17
|
+
teammates,
|
|
18
|
+
metadata,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
9
21
|
export function loadStatusline(projectRoot) {
|
|
10
22
|
try {
|
|
11
23
|
const path = `${getProjectStateDirFor(projectRoot)}/statusline.json`;
|
|
12
24
|
if (!existsSync(path))
|
|
13
25
|
return null;
|
|
14
|
-
return JSON.parse(readFileSync(path, "utf-8"));
|
|
26
|
+
return sanitizeStatuslineProjection(JSON.parse(readFileSync(path, "utf-8")));
|
|
15
27
|
}
|
|
16
28
|
catch {
|
|
17
29
|
return null;
|
|
@@ -99,7 +111,7 @@ function renderExactHeadline(data, projectRoot, currentSession, currentWindow, c
|
|
|
99
111
|
const activeSessionId = resolveExactCurrentSessionId(data, currentSession, currentWindow, currentWindowId, currentPath, projectRoot);
|
|
100
112
|
if (!activeSessionId)
|
|
101
113
|
return null;
|
|
102
|
-
const session = (data
|
|
114
|
+
const session = findStatuslineSession(data, activeSessionId);
|
|
103
115
|
const headline = session?.headline?.trim();
|
|
104
116
|
if (!headline)
|
|
105
117
|
return null;
|
|
@@ -109,9 +121,7 @@ function renderActiveMetadata(data, projectRoot, currentSession, currentWindow,
|
|
|
109
121
|
if (currentWindow && isDashboardWindowName(currentWindow))
|
|
110
122
|
return null;
|
|
111
123
|
const activeSessionId = resolveExactCurrentSessionId(data, currentSession, currentWindow, currentWindowId, currentPath, projectRoot);
|
|
112
|
-
const activeSession = activeSessionId
|
|
113
|
-
? (data.sessions ?? []).find((entry) => entry.id === activeSessionId)
|
|
114
|
-
: undefined;
|
|
124
|
+
const activeSession = findStatuslineSession(data, activeSessionId);
|
|
115
125
|
const metadata = resolveExactSessionMetadata(data, projectRoot, currentSession, currentWindow, currentWindowId, currentPath);
|
|
116
126
|
if (!metadata)
|
|
117
127
|
return null;
|
|
@@ -159,6 +169,27 @@ function renderSessionChip(session) {
|
|
|
159
169
|
const label = trim(`${identity}${hint ? ` ${hint}` : ""}${badge ? ` ${badge}` : ""}`, 28);
|
|
160
170
|
return session.isCurrent ? `#[fg=black,bg=yellow] ${label} #[default]` : label;
|
|
161
171
|
}
|
|
172
|
+
function teammateLabel(session) {
|
|
173
|
+
return (session.team?.label?.trim() || session.label?.trim() || session.team?.role?.trim() || compactSessionTitle(session));
|
|
174
|
+
}
|
|
175
|
+
function renderTeammateChip(session) {
|
|
176
|
+
const identity = trim(teammateLabel(session), 18);
|
|
177
|
+
const hint = renderSessionCompactHint(session);
|
|
178
|
+
const badge = hint?.includes(" unread") || hint?.includes(" new") ? null : renderSemanticBadge(session.semantic);
|
|
179
|
+
const label = trim(`${identity}${hint ? ` ${hint}` : ""}${badge ? ` ${badge}` : ""}`, 28);
|
|
180
|
+
return session.isCurrent ? `#[fg=black,bg=cyan] ${label} #[default]` : `#[fg=cyan]${label}#[default]`;
|
|
181
|
+
}
|
|
182
|
+
function renderTeammateSegment(teammates) {
|
|
183
|
+
if (teammates.length === 0)
|
|
184
|
+
return null;
|
|
185
|
+
const labels = teammates.slice(0, 3).map((teammate) => {
|
|
186
|
+
const identity = teammateLabel(teammate);
|
|
187
|
+
const hint = renderSessionCompactHint(teammate) ?? teammate.semantic?.presentation.statusLabel ?? teammate.status;
|
|
188
|
+
return trim(`${identity}${hint ? ` ${hint}` : ""}`, 24);
|
|
189
|
+
});
|
|
190
|
+
const more = teammates.length > labels.length ? ` +${teammates.length - labels.length}` : "";
|
|
191
|
+
return `team: ${labels.join(", ")}${more}`;
|
|
192
|
+
}
|
|
162
193
|
function visibleSegmentLength(segment) {
|
|
163
194
|
return segment.replace(/#\[[^\]]*]/g, "").length;
|
|
164
195
|
}
|
|
@@ -179,21 +210,30 @@ function renderBottomLine(data, projectRoot, currentWindow, currentWindowId, cur
|
|
|
179
210
|
}
|
|
180
211
|
return chosen.join(separator);
|
|
181
212
|
}
|
|
182
|
-
const
|
|
213
|
+
const focusedTeammate = resolveFocusedTeammate(data, projectRoot, currentSession, currentWindow, currentWindowId, currentPath);
|
|
214
|
+
const teammateChips = focusedTeammate
|
|
215
|
+
? resolveFocusedTeammateGroup(data, projectRoot, currentSession, currentWindow, currentWindowId, currentPath)
|
|
216
|
+
: [];
|
|
217
|
+
const chips = focusedTeammate
|
|
218
|
+
? teammateChips
|
|
219
|
+
: resolveScopedSessions(data, projectRoot, currentSession, currentWindow, currentWindowId, currentPath);
|
|
183
220
|
const headline = renderExactHeadline(data, projectRoot, currentSession, currentWindow, currentWindowId, currentPath);
|
|
221
|
+
const teammateSegment = focusedTeammate
|
|
222
|
+
? `#[fg=cyan]team plane#[default]`
|
|
223
|
+
: renderTeammateSegment(resolveCurrentTeammates(data, projectRoot, currentSession, currentWindow, currentWindowId, currentPath));
|
|
184
224
|
const pluginSegments = renderPluginSegments(data, projectRoot, "bottom", currentSession, currentWindow, currentWindowId, currentPath);
|
|
185
225
|
const chipSeparator = " · ";
|
|
186
226
|
const detailSeparator = " | ";
|
|
187
227
|
const chosenChips = [];
|
|
188
228
|
let used = 0;
|
|
189
|
-
for (const chip of chips) {
|
|
229
|
+
for (const chip of chips.map(focusedTeammate ? renderTeammateChip : renderSessionChip)) {
|
|
190
230
|
const next = visibleSegmentLength(chip) + (chosenChips.length > 0 ? chipSeparator.length : 0);
|
|
191
231
|
if (used + next > maxWidth)
|
|
192
232
|
break;
|
|
193
233
|
chosenChips.push(chip);
|
|
194
234
|
used += next;
|
|
195
235
|
}
|
|
196
|
-
const detailParts = [headline, ...pluginSegments].filter((segment) => Boolean(segment));
|
|
236
|
+
const detailParts = [headline, teammateSegment, ...pluginSegments].filter((segment) => Boolean(segment));
|
|
197
237
|
const detail = detailParts.join(" · ");
|
|
198
238
|
if (detail) {
|
|
199
239
|
const headlineWidth = visibleSegmentLength(detail);
|
|
@@ -212,4 +252,3 @@ export function renderTmuxStatuslineFromData(data, projectRoot, line, options =
|
|
|
212
252
|
export function renderTmuxStatusline(projectRoot, line, options = {}) {
|
|
213
253
|
return renderTmuxStatuslineFromData(loadStatusline(projectRoot), projectRoot, line, options);
|
|
214
254
|
}
|
|
215
|
-
//# sourceMappingURL=statusline.js.map
|
package/dist/tmux/switcher.js
CHANGED
package/dist/tmux/window-open.js
CHANGED
|
@@ -52,8 +52,7 @@ export function openManagedSessionWindow(tmux, projectRoot, entry) {
|
|
|
52
52
|
.listProjectManagedWindows(projectRoot)
|
|
53
53
|
.find((candidate) => candidate.metadata.kind === "agent" &&
|
|
54
54
|
((entry.tmuxWindowId && candidate.target.windowId === entry.tmuxWindowId) ||
|
|
55
|
-
candidate.metadata.sessionId === entry.id
|
|
56
|
-
(entry.backendSessionId && candidate.metadata.backendSessionId === entry.backendSessionId))) ?? null;
|
|
55
|
+
candidate.metadata.sessionId === entry.id)) ?? null;
|
|
57
56
|
if (!match)
|
|
58
57
|
return null;
|
|
59
58
|
selectLinkedOrOpenTarget(tmux, match.target);
|
|
@@ -68,4 +67,3 @@ export function openManagedServiceWindow(tmux, projectRoot, serviceId) {
|
|
|
68
67
|
selectLinkedOrOpenTarget(tmux, match.target);
|
|
69
68
|
return match.target;
|
|
70
69
|
}
|
|
71
|
-
//# sourceMappingURL=window-open.js.map
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import type { AgentObservation, AgentWatcherContext } from "./agent-watcher.js";
|
|
2
|
-
import type { AimuxPluginInstance } from "./plugin-runtime.js";
|
|
3
|
-
import type { SessionServiceMetadata } from "./metadata-store.js";
|
|
4
|
-
interface PaneSnapshot {
|
|
5
|
-
fingerprint: string;
|
|
6
|
-
promptVisible: boolean;
|
|
7
|
-
errorVisible: boolean;
|
|
8
|
-
lastObservedAt: number;
|
|
9
|
-
lastAppliedActivity?: import("./agent-events.js").AgentActivityState;
|
|
10
|
-
lastAppliedAttention?: import("./agent-events.js").AgentAttentionState;
|
|
11
|
-
}
|
|
12
1
|
export declare function classifyToolPane(tool: string, text: string): {
|
|
13
2
|
promptVisible: boolean;
|
|
14
3
|
errorVisible: boolean;
|
|
@@ -16,10 +5,3 @@ export declare function classifyToolPane(tool: string, text: string): {
|
|
|
16
5
|
updatePromptVisible: boolean;
|
|
17
6
|
blockedMessage?: string;
|
|
18
7
|
};
|
|
19
|
-
export declare function deriveObservation(sessionId: string, tool: string, text: string, previous: PaneSnapshot | undefined): {
|
|
20
|
-
snapshot: PaneSnapshot;
|
|
21
|
-
observation?: AgentObservation;
|
|
22
|
-
};
|
|
23
|
-
export declare function extractLocalServices(text: string): SessionServiceMetadata[];
|
|
24
|
-
export declare function createToolOutputWatcher(context: AgentWatcherContext): AimuxPluginInstance;
|
|
25
|
-
export {};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { isDashboardWindowName, TmuxRuntimeManager } from "./tmux/runtime-manager.js";
|
|
3
|
-
import { OscNotificationParser } from "./osc-notifications.js";
|
|
4
|
-
function fingerprint(text) {
|
|
5
|
-
return createHash("sha1").update(text).digest("hex");
|
|
6
|
-
}
|
|
7
1
|
function tailLines(text, count = 12) {
|
|
8
2
|
return text.split("\n").slice(-count);
|
|
9
3
|
}
|
|
@@ -88,320 +82,3 @@ export function classifyToolPane(tool, text) {
|
|
|
88
82
|
const promptVisible = !updatePromptVisible && tracksPromptReadiness(tool) && hasToolInputPrompt(tool, text, lastLine);
|
|
89
83
|
return { promptVisible, errorVisible, interruptedVisible, updatePromptVisible, blockedMessage };
|
|
90
84
|
}
|
|
91
|
-
export function deriveObservation(sessionId, tool, text, previous) {
|
|
92
|
-
const now = Date.now();
|
|
93
|
-
const nextFingerprint = fingerprint(text);
|
|
94
|
-
const { promptVisible, errorVisible, interruptedVisible, updatePromptVisible, blockedMessage } = classifyToolPane(tool, text);
|
|
95
|
-
const next = {
|
|
96
|
-
fingerprint: nextFingerprint,
|
|
97
|
-
promptVisible,
|
|
98
|
-
errorVisible,
|
|
99
|
-
lastObservedAt: now,
|
|
100
|
-
lastAppliedActivity: previous?.lastAppliedActivity,
|
|
101
|
-
lastAppliedAttention: previous?.lastAppliedAttention,
|
|
102
|
-
};
|
|
103
|
-
if (!previous || previous.fingerprint !== nextFingerprint) {
|
|
104
|
-
if (updatePromptVisible && previous?.lastAppliedAttention !== "blocked") {
|
|
105
|
-
next.lastAppliedActivity = "waiting";
|
|
106
|
-
next.lastAppliedAttention = "blocked";
|
|
107
|
-
return {
|
|
108
|
-
snapshot: next,
|
|
109
|
-
observation: {
|
|
110
|
-
sessionId,
|
|
111
|
-
tool,
|
|
112
|
-
activity: "waiting",
|
|
113
|
-
attention: "blocked",
|
|
114
|
-
event: {
|
|
115
|
-
kind: "blocked",
|
|
116
|
-
message: blockedMessage ?? "Tool update required",
|
|
117
|
-
source: tool,
|
|
118
|
-
tone: "warn",
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
if (errorVisible && previous?.errorVisible !== true) {
|
|
124
|
-
next.lastAppliedActivity = "error";
|
|
125
|
-
next.lastAppliedAttention = "error";
|
|
126
|
-
return {
|
|
127
|
-
snapshot: next,
|
|
128
|
-
observation: {
|
|
129
|
-
sessionId,
|
|
130
|
-
tool,
|
|
131
|
-
activity: "error",
|
|
132
|
-
attention: "error",
|
|
133
|
-
event: {
|
|
134
|
-
kind: interruptedVisible ? "interrupted" : "notify",
|
|
135
|
-
message: interruptedVisible ? "Conversation interrupted" : "Tool error",
|
|
136
|
-
source: tool,
|
|
137
|
-
tone: "error",
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
if (!errorVisible && previous?.lastAppliedAttention === "error") {
|
|
143
|
-
if (tracksPromptReadiness(tool)) {
|
|
144
|
-
if (promptVisible) {
|
|
145
|
-
next.lastAppliedActivity = "waiting";
|
|
146
|
-
next.lastAppliedAttention = "needs_input";
|
|
147
|
-
return {
|
|
148
|
-
snapshot: next,
|
|
149
|
-
observation: {
|
|
150
|
-
sessionId,
|
|
151
|
-
tool,
|
|
152
|
-
activity: "waiting",
|
|
153
|
-
attention: "needs_input",
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
next.lastAppliedActivity = "running";
|
|
158
|
-
next.lastAppliedAttention = "normal";
|
|
159
|
-
return {
|
|
160
|
-
snapshot: next,
|
|
161
|
-
observation: {
|
|
162
|
-
sessionId,
|
|
163
|
-
tool,
|
|
164
|
-
activity: "running",
|
|
165
|
-
attention: "normal",
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
next.lastAppliedActivity = previous.lastAppliedActivity === "error" ? undefined : previous.lastAppliedActivity;
|
|
170
|
-
next.lastAppliedAttention = "normal";
|
|
171
|
-
return {
|
|
172
|
-
snapshot: next,
|
|
173
|
-
observation: {
|
|
174
|
-
sessionId,
|
|
175
|
-
tool,
|
|
176
|
-
attention: "normal",
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
if (!updatePromptVisible && previous?.lastAppliedAttention === "blocked") {
|
|
181
|
-
if (promptVisible) {
|
|
182
|
-
next.lastAppliedActivity = "waiting";
|
|
183
|
-
next.lastAppliedAttention = "needs_input";
|
|
184
|
-
return {
|
|
185
|
-
snapshot: next,
|
|
186
|
-
observation: {
|
|
187
|
-
sessionId,
|
|
188
|
-
tool,
|
|
189
|
-
activity: "waiting",
|
|
190
|
-
attention: "needs_input",
|
|
191
|
-
},
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
next.lastAppliedActivity = "running";
|
|
195
|
-
next.lastAppliedAttention = "normal";
|
|
196
|
-
return {
|
|
197
|
-
snapshot: next,
|
|
198
|
-
observation: {
|
|
199
|
-
sessionId,
|
|
200
|
-
tool,
|
|
201
|
-
activity: "running",
|
|
202
|
-
attention: "normal",
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
if (!promptVisible && previous?.promptVisible && previous.lastAppliedAttention === "needs_input") {
|
|
207
|
-
next.lastAppliedActivity = "running";
|
|
208
|
-
next.lastAppliedAttention = "normal";
|
|
209
|
-
return {
|
|
210
|
-
snapshot: next,
|
|
211
|
-
observation: {
|
|
212
|
-
sessionId,
|
|
213
|
-
tool,
|
|
214
|
-
activity: "running",
|
|
215
|
-
attention: "normal",
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
if (promptVisible) {
|
|
220
|
-
next.lastAppliedActivity = "waiting";
|
|
221
|
-
next.lastAppliedAttention = "needs_input";
|
|
222
|
-
if (!previous?.promptVisible) {
|
|
223
|
-
return {
|
|
224
|
-
snapshot: next,
|
|
225
|
-
observation: {
|
|
226
|
-
sessionId,
|
|
227
|
-
tool,
|
|
228
|
-
activity: "waiting",
|
|
229
|
-
attention: "needs_input",
|
|
230
|
-
event: {
|
|
231
|
-
kind: "needs_input",
|
|
232
|
-
message: "Ready for input",
|
|
233
|
-
source: tool,
|
|
234
|
-
tone: "warn",
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
snapshot: next,
|
|
241
|
-
observation: {
|
|
242
|
-
sessionId,
|
|
243
|
-
tool,
|
|
244
|
-
activity: "waiting",
|
|
245
|
-
attention: "needs_input",
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
if (tracksPromptReadiness(tool)) {
|
|
250
|
-
next.lastAppliedActivity = "running";
|
|
251
|
-
next.lastAppliedAttention = "normal";
|
|
252
|
-
return {
|
|
253
|
-
snapshot: next,
|
|
254
|
-
observation: {
|
|
255
|
-
sessionId,
|
|
256
|
-
tool,
|
|
257
|
-
activity: "running",
|
|
258
|
-
attention: "normal",
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
if (!previous) {
|
|
263
|
-
next.lastAppliedActivity = "running";
|
|
264
|
-
next.lastAppliedAttention = "normal";
|
|
265
|
-
return {
|
|
266
|
-
snapshot: next,
|
|
267
|
-
observation: {
|
|
268
|
-
sessionId,
|
|
269
|
-
tool,
|
|
270
|
-
activity: "running",
|
|
271
|
-
attention: "normal",
|
|
272
|
-
},
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
next.lastAppliedActivity = previous?.lastAppliedActivity;
|
|
276
|
-
next.lastAppliedAttention = previous?.lastAppliedAttention;
|
|
277
|
-
return { snapshot: next };
|
|
278
|
-
}
|
|
279
|
-
if (promptVisible && previous?.lastAppliedActivity !== "waiting") {
|
|
280
|
-
next.lastAppliedActivity = "waiting";
|
|
281
|
-
next.lastAppliedAttention = "needs_input";
|
|
282
|
-
return {
|
|
283
|
-
snapshot: next,
|
|
284
|
-
observation: {
|
|
285
|
-
sessionId,
|
|
286
|
-
tool,
|
|
287
|
-
activity: "waiting",
|
|
288
|
-
attention: "needs_input",
|
|
289
|
-
},
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
if (updatePromptVisible && previous?.lastAppliedAttention !== "blocked") {
|
|
293
|
-
next.lastAppliedActivity = "waiting";
|
|
294
|
-
next.lastAppliedAttention = "blocked";
|
|
295
|
-
return {
|
|
296
|
-
snapshot: next,
|
|
297
|
-
observation: {
|
|
298
|
-
sessionId,
|
|
299
|
-
tool,
|
|
300
|
-
activity: "waiting",
|
|
301
|
-
attention: "blocked",
|
|
302
|
-
event: {
|
|
303
|
-
kind: "blocked",
|
|
304
|
-
message: blockedMessage ?? "Tool update required",
|
|
305
|
-
source: tool,
|
|
306
|
-
tone: "warn",
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
if (errorVisible && previous?.lastAppliedActivity !== "error") {
|
|
312
|
-
next.lastAppliedActivity = "error";
|
|
313
|
-
next.lastAppliedAttention = "error";
|
|
314
|
-
return {
|
|
315
|
-
snapshot: next,
|
|
316
|
-
observation: {
|
|
317
|
-
sessionId,
|
|
318
|
-
tool,
|
|
319
|
-
activity: "error",
|
|
320
|
-
attention: "error",
|
|
321
|
-
},
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
next.lastAppliedActivity = previous?.lastAppliedActivity;
|
|
325
|
-
next.lastAppliedAttention = previous?.lastAppliedAttention;
|
|
326
|
-
return { snapshot: next };
|
|
327
|
-
}
|
|
328
|
-
export function extractLocalServices(text) {
|
|
329
|
-
const services = new Map();
|
|
330
|
-
const urlMatches = text.match(/https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0):\d+(?:[^\s)]*)?/g) ?? [];
|
|
331
|
-
for (const url of urlMatches) {
|
|
332
|
-
const portMatch = url.match(/:(\d+)(?:\/|$)/);
|
|
333
|
-
const port = portMatch ? Number(portMatch[1]) : undefined;
|
|
334
|
-
services.set(url, { url, port });
|
|
335
|
-
}
|
|
336
|
-
return Array.from(services.values()).slice(0, 3);
|
|
337
|
-
}
|
|
338
|
-
export function createToolOutputWatcher(context) {
|
|
339
|
-
const snapshots = new Map();
|
|
340
|
-
const oscParsers = new Map();
|
|
341
|
-
const rawPaneTexts = new Map();
|
|
342
|
-
let timer = null;
|
|
343
|
-
const poll = () => {
|
|
344
|
-
const tmux = new TmuxRuntimeManager();
|
|
345
|
-
const sessionName = tmux.getProjectSession(context.api.projectRoot).sessionName;
|
|
346
|
-
let windows = [];
|
|
347
|
-
try {
|
|
348
|
-
windows = tmux.listManagedWindows(sessionName);
|
|
349
|
-
}
|
|
350
|
-
catch {
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
for (const { target, metadata } of windows) {
|
|
354
|
-
if (!metadata.sessionId || isDashboardWindowName(target.windowName))
|
|
355
|
-
continue;
|
|
356
|
-
let rawText = "";
|
|
357
|
-
try {
|
|
358
|
-
rawText = tmux.captureTarget(target, { startLine: -80, includeEscapes: true });
|
|
359
|
-
}
|
|
360
|
-
catch {
|
|
361
|
-
continue;
|
|
362
|
-
}
|
|
363
|
-
const parser = oscParsers.get(metadata.sessionId) ?? new OscNotificationParser();
|
|
364
|
-
oscParsers.set(metadata.sessionId, parser);
|
|
365
|
-
const previousRaw = rawPaneTexts.get(metadata.sessionId) ?? "";
|
|
366
|
-
const delta = rawText.startsWith(previousRaw) ? rawText.slice(previousRaw.length) : rawText;
|
|
367
|
-
rawPaneTexts.set(metadata.sessionId, rawText);
|
|
368
|
-
const deltaParsed = parser.parseChunk(delta);
|
|
369
|
-
for (const notification of deltaParsed.notifications) {
|
|
370
|
-
context.api.metadata.emitEvent(metadata.sessionId, {
|
|
371
|
-
kind: "notify",
|
|
372
|
-
message: notification.body || notification.title || "Notification",
|
|
373
|
-
source: metadata.command,
|
|
374
|
-
tone: "info",
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
const text = new OscNotificationParser().parseChunk(rawText).cleaned;
|
|
378
|
-
context.api.metadata.setServices(metadata.sessionId, extractLocalServices(text));
|
|
379
|
-
const previous = snapshots.get(metadata.sessionId);
|
|
380
|
-
const { snapshot, observation } = deriveObservation(metadata.sessionId, metadata.command, text, previous);
|
|
381
|
-
snapshots.set(metadata.sessionId, snapshot);
|
|
382
|
-
if (!observation)
|
|
383
|
-
continue;
|
|
384
|
-
if (observation.activity)
|
|
385
|
-
context.api.metadata.setActivity(observation.sessionId, observation.activity);
|
|
386
|
-
if (observation.attention)
|
|
387
|
-
context.api.metadata.setAttention(observation.sessionId, observation.attention);
|
|
388
|
-
if (observation.event)
|
|
389
|
-
context.api.metadata.emitEvent(observation.sessionId, observation.event);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
return {
|
|
393
|
-
start() {
|
|
394
|
-
poll();
|
|
395
|
-
timer = setInterval(poll, 2000);
|
|
396
|
-
timer.unref?.();
|
|
397
|
-
},
|
|
398
|
-
async stop() {
|
|
399
|
-
if (timer)
|
|
400
|
-
clearInterval(timer);
|
|
401
|
-
timer = null;
|
|
402
|
-
oscParsers.clear();
|
|
403
|
-
rawPaneTexts.clear();
|
|
404
|
-
},
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
//# sourceMappingURL=tool-output-watchers.js.map
|
package/dist/tui/render/box.js
CHANGED
package/dist/tui/render/text.js
CHANGED
|
@@ -66,6 +66,15 @@ function colorSessionHint(value) {
|
|
|
66
66
|
return `\x1b[35m${value}\x1b[0m`;
|
|
67
67
|
return `\x1b[2m${value}\x1b[0m`;
|
|
68
68
|
}
|
|
69
|
+
function summarizeTeammate(session, derivedStatusLabel) {
|
|
70
|
+
const identity = session.team?.label ?? session.label ?? session.command;
|
|
71
|
+
const role = session.team?.role ?? session.role;
|
|
72
|
+
const status = derivedStatusLabel(session);
|
|
73
|
+
const hint = session.semantic?.presentation.compactHint;
|
|
74
|
+
return [role ? `${identity}(${role})` : identity, status, hint && hint !== status ? hint : undefined]
|
|
75
|
+
.filter(Boolean)
|
|
76
|
+
.join(" · ");
|
|
77
|
+
}
|
|
69
78
|
export function renderDashboardFrame(state, cols, rows) {
|
|
70
79
|
const contentWidth = Math.max(72, cols);
|
|
71
80
|
const padBlockLine = (line) => line;
|
|
@@ -112,17 +121,6 @@ export function renderDashboardFrame(state, cols, rows) {
|
|
|
112
121
|
? ` \x1b[2;33m→ ${truncate(session.workflowNextAction, 24)}\x1b[0m`
|
|
113
122
|
: "";
|
|
114
123
|
const lastUsedHint = session.lastUsedAt ? ` \x1b[2m· ${formatRelativeRecency(session.lastUsedAt)}\x1b[0m` : "";
|
|
115
|
-
if (session.remoteInstancePid) {
|
|
116
|
-
const icon = "\x1b[2;36m◈\x1b[0m";
|
|
117
|
-
const ownerTag = `\x1b[2mother tab (PID ${session.remoteInstancePid})\x1b[0m`;
|
|
118
|
-
const identity = session.label ?? session.command;
|
|
119
|
-
const headlineText = session.headline ? ` \x1b[2m· ${truncate(session.headline, 40)}\x1b[0m` : "";
|
|
120
|
-
const remoteRoleTag = session.role ? ` \x1b[2;36m(${session.role})\x1b[0m` : "";
|
|
121
|
-
const notificationBadge = session.semantic && session.semantic.notifications.unreadCount > 0
|
|
122
|
-
? ` \x1b[36m${Math.min(session.semantic.notifications.unreadCount, 99)}\x1b[0m`
|
|
123
|
-
: "";
|
|
124
|
-
return `${indent}${prefix}${icon} ${numberBadge}${identity}${remoteRoleTag}${headlineText}${threadBadge}${pendingBadge}${workflowBadge}${workflowHint}${notificationBadge}${lastUsedHint} — ${ownerTag}`;
|
|
125
|
-
}
|
|
126
124
|
const icon = colorSessionIcon(session);
|
|
127
125
|
const statusLabel = state.derivedStatusLabel(session);
|
|
128
126
|
const coloredStatusLabel = colorSessionStatus(session, statusLabel);
|
|
@@ -147,7 +145,11 @@ export function renderDashboardFrame(state, cols, rows) {
|
|
|
147
145
|
const numberBadge = quickDigit ? `[${quickDigit}] ` : "";
|
|
148
146
|
const identity = service.label ?? service.command;
|
|
149
147
|
const statusLabel = service.pendingAction ?? service.status;
|
|
150
|
-
const commandHint = service.
|
|
148
|
+
const commandHint = service.shellCommand
|
|
149
|
+
? ` \x1b[2m· ${truncate(service.shellCommand, 36)}\x1b[0m`
|
|
150
|
+
: service.foregroundCommand
|
|
151
|
+
? ` \x1b[2m· ${truncate(service.foregroundCommand, 22)}\x1b[0m`
|
|
152
|
+
: "";
|
|
151
153
|
const pidHint = service.pid ? ` \x1b[2m(pid ${service.pid})\x1b[0m` : "";
|
|
152
154
|
const previewHint = service.previewLine ? ` \x1b[2m· ${truncate(service.previewLine, 40)}\x1b[0m` : "";
|
|
153
155
|
const lastUsedHint = service.lastUsedAt ? ` \x1b[2m· ${formatRelativeRecency(service.lastUsedAt)}\x1b[0m` : "";
|
|
@@ -214,32 +216,29 @@ export function renderDashboardFrame(state, cols, rows) {
|
|
|
214
216
|
? "[x] stop"
|
|
215
217
|
: selectedSession?.status === "offline"
|
|
216
218
|
? "[x] kill"
|
|
217
|
-
: selectedSession
|
|
218
|
-
? ""
|
|
219
|
-
:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const rLabel = selectedSession && !selectedSession.remoteInstancePid ? " [r] name" : "";
|
|
219
|
+
: selectedSession
|
|
220
|
+
? "[x] stop"
|
|
221
|
+
: "";
|
|
222
|
+
const rLabel = selectedSession ? " [r] name" : "";
|
|
223
|
+
const teamLabel = selectedSession && state.selectedTeammates.length > 0 ? " [e] team" : "";
|
|
223
224
|
const enterLabel = selectedService
|
|
224
225
|
? "Enter open"
|
|
225
|
-
: selectedSession?.
|
|
226
|
-
? "Enter
|
|
227
|
-
:
|
|
228
|
-
? "Enter resume"
|
|
229
|
-
: "Enter focus";
|
|
226
|
+
: selectedSession?.status === "offline"
|
|
227
|
+
? "Enter resume"
|
|
228
|
+
: "Enter focus";
|
|
230
229
|
if (state.sessions.length === 0 && !state.hasWorktrees) {
|
|
231
230
|
return " [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork [S] msg [H] handoff [T] task [o] thread [R] reply [p] plans [g] graveyard [?] help [q] quit ";
|
|
232
231
|
}
|
|
233
232
|
if (state.hasWorktrees && state.navLevel === "sessions") {
|
|
234
233
|
const xPart = xLabel ? ` ${xLabel}` : "";
|
|
235
|
-
return ` ↑↓ items 1-9/12 jump ${enterLabel} Esc back [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork [S] msg [H] handoff [T] task [o] thread [R] reply [m] migrate${xPart}${rLabel} [p] plans [g] graveyard [?] help [q] quit `;
|
|
234
|
+
return ` ↑↓ items Shift+↑↓ reorder 1-9/12 jump ${enterLabel} Esc back [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork [S] msg [H] handoff [T] task [o] thread [R] reply${teamLabel} [m] migrate${xPart}${rLabel} [p] plans [g] graveyard [?] help [q] quit `;
|
|
236
235
|
}
|
|
237
236
|
if (state.hasWorktrees) {
|
|
238
237
|
return ` ↑↓ worktrees 1-9/12 jump Enter step in [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork(step in) [w] worktree [p] plans [g] graveyard [?] help [q] quit `;
|
|
239
238
|
}
|
|
240
239
|
if (state.sessions.length > 0) {
|
|
241
240
|
const xPart = xLabel ? ` ${xLabel}` : "";
|
|
242
|
-
return ` ↑↓ select ${enterLabel} [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork [S] msg [H] handoff [T] task [o] thread [R] reply [w] worktree${xPart}${rLabel} [p] plans [g] graveyard [?] help [q] quit `;
|
|
241
|
+
return ` ↑↓ select ${enterLabel} [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork [S] msg [H] handoff [T] task [o] thread [R] reply${teamLabel} [w] worktree${xPart}${rLabel} [p] plans [g] graveyard [?] help [q] quit `;
|
|
243
242
|
}
|
|
244
243
|
return " [u] attention [a] activity [t] threads [i] inbox [Tab] details [c] new agent [v] service [f] fork [S] msg [H] handoff [T] task [o] thread [R] reply [w] worktree [p] plans [g] graveyard [?] help [q] quit ";
|
|
245
244
|
};
|
|
@@ -321,6 +320,9 @@ export function renderDashboardFrame(state, cols, rows) {
|
|
|
321
320
|
if (selectedService) {
|
|
322
321
|
lines.push(...wrapKeyValue("Service", `${selectedService.label ?? selectedService.command} (${selectedService.id})`, width));
|
|
323
322
|
lines.push(...wrapKeyValue("Command", selectedService.command, width));
|
|
323
|
+
if (selectedService.shellCommand) {
|
|
324
|
+
lines.push(...wrapKeyValue(selectedService.shellCommandState === "running" ? "Running" : "Last command", selectedService.shellCommand, width));
|
|
325
|
+
}
|
|
324
326
|
if (selectedService.foregroundCommand)
|
|
325
327
|
lines.push(...wrapKeyValue("Foreground", selectedService.foregroundCommand, width));
|
|
326
328
|
if (selectedService.pid)
|
|
@@ -406,6 +408,16 @@ export function renderDashboardFrame(state, cols, rows) {
|
|
|
406
408
|
if ((selected.services?.length ?? 0) > 0) {
|
|
407
409
|
lines.push(...wrapKeyValue("Services", selected.services.map((s) => s.url ?? `:${s.port}`).join(", "), width));
|
|
408
410
|
}
|
|
411
|
+
if (state.selectedTeammates.length > 0) {
|
|
412
|
+
lines.push("");
|
|
413
|
+
lines.push("\x1b[1mTeam\x1b[0m");
|
|
414
|
+
for (const teammate of state.selectedTeammates.slice(0, 5)) {
|
|
415
|
+
lines.push(...wrapKeyValue("-", summarizeTeammate(teammate, state.derivedStatusLabel), width));
|
|
416
|
+
}
|
|
417
|
+
if (state.selectedTeammates.length > 5) {
|
|
418
|
+
lines.push(...wrapKeyValue("-", `${state.selectedTeammates.length - 5} more`, width));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
409
421
|
while (lines.length < height)
|
|
410
422
|
lines.push("");
|
|
411
423
|
return lines.slice(0, height);
|
|
@@ -479,4 +491,3 @@ export function renderDashboardFrame(state, cols, rows) {
|
|
|
479
491
|
scrollOffset,
|
|
480
492
|
};
|
|
481
493
|
}
|
|
482
|
-
//# sourceMappingURL=dashboard-renderers.js.map
|
|
@@ -12,6 +12,8 @@ export declare function buildDashboardErrorOverlayOutput(ctx: any): string | nul
|
|
|
12
12
|
export declare function renderDashboardErrorOverlay(ctx: any): void;
|
|
13
13
|
export declare function buildNotificationPanelOverlayOutput(ctx: any): string | null;
|
|
14
14
|
export declare function renderNotificationPanel(ctx: any): void;
|
|
15
|
+
export declare function buildTeammatePickerOverlayOutput(ctx: any): string | null;
|
|
16
|
+
export declare function renderTeammatePickerOverlay(ctx: any): void;
|
|
15
17
|
export declare function buildHelpOverlayOutput(_ctx: any): string;
|
|
16
18
|
export declare function renderHelpOverlay(ctx: any): void;
|
|
17
19
|
export declare function buildSwitcherOverlayOutput(ctx: any): string;
|