tmux-ide 2.6.0 → 2.7.0
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 +14 -9
- package/bin/cli.js +1024 -519
- package/bin/cli.ts +63 -6
- package/bunfig.toml +4 -0
- package/package.json +18 -7
- package/packages/contracts/package.json +22 -0
- package/packages/contracts/src/__tests__/ide-config.test.ts +46 -0
- package/packages/contracts/src/__tests__/terminals.test.ts +87 -0
- package/packages/contracts/src/actions-contract.ts +310 -0
- package/packages/contracts/src/actions-errors.ts +41 -0
- package/packages/contracts/src/domain.ts +36 -0
- package/packages/contracts/src/ide-config.ts +170 -0
- package/packages/contracts/src/index.ts +24 -0
- package/packages/contracts/src/lib-internal/auth.ts +13 -0
- package/packages/contracts/src/lib-internal/hq.ts +38 -0
- package/packages/contracts/src/terminals.ts +116 -0
- package/packages/contracts/src/tmux.ts +60 -0
- package/packages/contracts/src/workspace.ts +67 -0
- package/packages/daemon/dist/agent-explain.d.ts +8 -1
- package/packages/daemon/dist/agent-explain.js +19 -3
- package/packages/daemon/dist/lib/tui-binary.d.ts +57 -0
- package/packages/daemon/dist/lib/tui-binary.js +130 -0
- package/packages/daemon/dist/widgets/explorer/breadcrumbs.d.ts +1 -1
- package/packages/daemon/dist/widgets/explorer/footer.d.ts +1 -1
- package/packages/daemon/dist/widgets/explorer/tree.d.ts +1 -1
- package/packages/daemon/dist/widgets/lib/help-overlay.d.ts +1 -1
- package/packages/daemon/dist/widgets/setup/agent-naming.d.ts +1 -1
- package/packages/daemon/dist/widgets/setup/config-tree.d.ts +1 -1
- package/packages/daemon/dist/widgets/setup/detect-panel.d.ts +1 -1
- package/packages/daemon/dist/widgets/setup/field-editor.d.ts +1 -1
- package/packages/daemon/dist/widgets/setup/footer.d.ts +1 -1
- package/packages/daemon/dist/widgets/setup/layout-picker.d.ts +1 -1
- package/packages/daemon/src/agent-explain.ts +298 -0
- package/packages/daemon/src/attach.ts +20 -0
- package/packages/daemon/src/bin.ts +4 -0
- package/packages/daemon/src/canonical.ts +7 -0
- package/packages/daemon/src/cli.ts +499 -0
- package/packages/daemon/src/command-center/actions/contract.ts +2 -0
- package/packages/daemon/src/command-center/actions/dispatcher.ts +137 -0
- package/packages/daemon/src/command-center/actions/errors.ts +105 -0
- package/packages/daemon/src/command-center/actions/handlers/_project-context.ts +30 -0
- package/packages/daemon/src/command-center/actions/handlers/_resolve-project.ts +78 -0
- package/packages/daemon/src/command-center/actions/handlers/app-set-remote-access.ts +118 -0
- package/packages/daemon/src/command-center/actions/handlers/config-actions.ts +113 -0
- package/packages/daemon/src/command-center/actions/handlers/daemon-shutdown.ts +38 -0
- package/packages/daemon/src/command-center/actions/handlers/project-activate.ts +30 -0
- package/packages/daemon/src/command-center/actions/handlers/project-launch.ts +70 -0
- package/packages/daemon/src/command-center/actions/handlers/project-open-terminal.ts +87 -0
- package/packages/daemon/src/command-center/actions/handlers/project-restart.ts +38 -0
- package/packages/daemon/src/command-center/actions/handlers/project-stop.ts +62 -0
- package/packages/daemon/src/command-center/actions/handlers/terminal-respawn.ts +119 -0
- package/packages/daemon/src/command-center/actions/handlers/terminal-stop.ts +35 -0
- package/packages/daemon/src/command-center/actions/registry.ts +149 -0
- package/packages/daemon/src/command-center/discovery.ts +96 -0
- package/packages/daemon/src/command-center/index.ts +31 -0
- package/packages/daemon/src/command-center/schemas.ts +85 -0
- package/packages/daemon/src/command-center/server.ts +1260 -0
- package/packages/daemon/src/command-center/ws-events.ts +316 -0
- package/packages/daemon/src/config.ts +549 -0
- package/packages/daemon/src/detect.ts +248 -0
- package/packages/daemon/src/doctor.ts +242 -0
- package/packages/daemon/src/embed.ts +5 -0
- package/packages/daemon/src/index.ts +12 -0
- package/packages/daemon/src/init.ts +211 -0
- package/packages/daemon/src/inspect.ts +178 -0
- package/packages/daemon/src/js-yaml.d.ts +10 -0
- package/packages/daemon/src/launch.ts +349 -0
- package/packages/daemon/src/lib/active-projects.ts +49 -0
- package/packages/daemon/src/lib/agent-discovery.ts +121 -0
- package/packages/daemon/src/lib/app-config.ts +427 -0
- package/packages/daemon/src/lib/app-settings.ts +53 -0
- package/packages/daemon/src/lib/auth/auth-service.ts +227 -0
- package/packages/daemon/src/lib/auth/middleware.ts +56 -0
- package/packages/daemon/src/lib/auth/types.ts +2 -0
- package/packages/daemon/src/lib/auth-token.ts +5 -0
- package/packages/daemon/src/lib/authorship.ts +280 -0
- package/packages/daemon/src/lib/canonical-daemon.ts +122 -0
- package/packages/daemon/src/lib/cli-action-bridge.ts +216 -0
- package/packages/daemon/src/lib/daemon-embed.ts +782 -0
- package/packages/daemon/src/lib/daemon-watchdog.ts +111 -0
- package/packages/daemon/src/lib/daemon.ts +79 -0
- package/packages/daemon/src/lib/dot-path.ts +17 -0
- package/packages/daemon/src/lib/errors.ts +67 -0
- package/packages/daemon/src/lib/filesystem-browser.ts +292 -0
- package/packages/daemon/src/lib/launch-plan.ts +90 -0
- package/packages/daemon/src/lib/log.ts +134 -0
- package/packages/daemon/src/lib/output.ts +76 -0
- package/packages/daemon/src/lib/project-init-runner.ts +150 -0
- package/packages/daemon/src/lib/project-inspect.ts +80 -0
- package/packages/daemon/src/lib/project-onboard.ts +149 -0
- package/packages/daemon/src/lib/project-probe.ts +92 -0
- package/packages/daemon/src/lib/project-registry.ts +296 -0
- package/packages/daemon/src/lib/session-monitor.ts +122 -0
- package/packages/daemon/src/lib/session-options.ts +100 -0
- package/packages/daemon/src/lib/shell.ts +8 -0
- package/packages/daemon/src/lib/sizes.ts +36 -0
- package/packages/daemon/src/lib/skill-sync.ts +155 -0
- package/packages/daemon/src/lib/slugify.ts +10 -0
- package/packages/daemon/src/lib/terminals-store.ts +125 -0
- package/packages/daemon/src/lib/tui-binary.ts +165 -0
- package/packages/daemon/src/lib/update-check.ts +298 -0
- package/packages/daemon/src/lib/update.ts +158 -0
- package/packages/daemon/src/lib/workspace-registry.ts +229 -0
- package/packages/daemon/src/lib/worktree.ts +289 -0
- package/packages/daemon/src/lib/yaml-io.ts +27 -0
- package/packages/daemon/src/ls.ts +40 -0
- package/packages/daemon/src/restart.ts +24 -0
- package/packages/daemon/src/restore.ts +514 -0
- package/packages/daemon/src/schemas/domain.ts +2 -0
- package/packages/daemon/src/schemas/filesystem.ts +34 -0
- package/packages/daemon/src/schemas/ide-config.ts +2 -0
- package/packages/daemon/src/schemas/index.ts +59 -0
- package/packages/daemon/src/schemas/inspect.ts +67 -0
- package/packages/daemon/src/schemas/registry.ts +55 -0
- package/packages/daemon/src/schemas/ws-events.ts +135 -0
- package/packages/daemon/src/send.ts +171 -0
- package/packages/daemon/src/server/README.md +15 -0
- package/packages/daemon/src/server/index.ts +74 -0
- package/packages/daemon/src/server/pty-bridge.ts +532 -0
- package/packages/daemon/src/server/standalone.ts +18 -0
- package/packages/daemon/src/server/ws-route.ts +483 -0
- package/packages/daemon/src/status.ts +59 -0
- package/packages/daemon/src/stop.ts +28 -0
- package/packages/daemon/src/terminal/NodePtyAdapter.ts +271 -0
- package/packages/daemon/src/terminal/PtyAdapter.ts +140 -0
- package/packages/daemon/src/terminal/README.md +92 -0
- package/packages/daemon/src/tui/chrome/cheatsheet.ts +260 -0
- package/packages/daemon/src/tui/chrome/chip.ts +30 -0
- package/packages/daemon/src/tui/chrome/events.ts +119 -0
- package/packages/daemon/src/tui/chrome/kitty-keys.ts +55 -0
- package/packages/daemon/src/tui/chrome/menu.ts +289 -0
- package/packages/daemon/src/tui/chrome/notify.ts +382 -0
- package/packages/daemon/src/tui/chrome/panels.ts +111 -0
- package/packages/daemon/src/tui/chrome/sidebar.ts +222 -0
- package/packages/daemon/src/tui/chrome/snapshot.ts +425 -0
- package/packages/daemon/src/tui/chrome/statusline.ts +595 -0
- package/packages/daemon/src/tui/chrome/updater.ts +510 -0
- package/packages/daemon/src/tui/chrome/welcome.ts +124 -0
- package/packages/daemon/src/tui/compiled.ts +121 -0
- package/packages/daemon/src/tui/detect/classify.ts +208 -0
- package/packages/daemon/src/tui/detect/manifest-loader.ts +193 -0
- package/packages/daemon/src/tui/detect/manifest.ts +199 -0
- package/packages/daemon/src/tui/detect/manifests.ts +354 -0
- package/packages/daemon/src/tui/detect/process-tree.ts +217 -0
- package/packages/daemon/src/tui/detect/snapshot.ts +70 -0
- package/packages/daemon/src/tui/integrations/claude.ts +176 -0
- package/packages/daemon/src/tui/integrations/offer.ts +145 -0
- package/packages/daemon/src/tui/main.ts +82 -0
- package/packages/daemon/src/tui/mirror/ack-writer.ts +77 -0
- package/packages/daemon/src/tui/mirror/agent-chip.ts +97 -0
- package/packages/daemon/src/tui/mirror/agent-rows.ts +133 -0
- package/packages/daemon/src/tui/mirror/app-state.ts +179 -0
- package/packages/daemon/src/tui/mirror/app.tsx +5265 -0
- package/packages/daemon/src/tui/mirror/blit.ts +186 -0
- package/packages/daemon/src/tui/mirror/control-client.ts +214 -0
- package/packages/daemon/src/tui/mirror/control.ts +97 -0
- package/packages/daemon/src/tui/mirror/dialog-model.ts +298 -0
- package/packages/daemon/src/tui/mirror/dialog-stack.ts +354 -0
- package/packages/daemon/src/tui/mirror/diff-model.ts +112 -0
- package/packages/daemon/src/tui/mirror/editor-buffer.ts +117 -0
- package/packages/daemon/src/tui/mirror/file-tree.ts +97 -0
- package/packages/daemon/src/tui/mirror/focus-border.ts +57 -0
- package/packages/daemon/src/tui/mirror/folder-picker.ts +124 -0
- package/packages/daemon/src/tui/mirror/home-model.ts +174 -0
- package/packages/daemon/src/tui/mirror/input-coalescer.ts +105 -0
- package/packages/daemon/src/tui/mirror/menu-model.ts +187 -0
- package/packages/daemon/src/tui/mirror/palette.ts +274 -0
- package/packages/daemon/src/tui/mirror/pane-mirror.ts +561 -0
- package/packages/daemon/src/tui/mirror/pane-surface.tsx +415 -0
- package/packages/daemon/src/tui/mirror/perf-tap.ts +160 -0
- package/packages/daemon/src/tui/mirror/resize-model.ts +85 -0
- package/packages/daemon/src/tui/mirror/scrollbar-model.ts +88 -0
- package/packages/daemon/src/tui/mirror/search-model.ts +70 -0
- package/packages/daemon/src/tui/mirror/selection.ts +262 -0
- package/packages/daemon/src/tui/mirror/session-mirror.ts +443 -0
- package/packages/daemon/src/tui/mirror/settings-model.ts +345 -0
- package/packages/daemon/src/tui/mirror/size-truth.ts +77 -0
- package/packages/daemon/src/tui/mirror/spans.ts +46 -0
- package/packages/daemon/src/tui/mirror/status-grammar.ts +32 -0
- package/packages/daemon/src/tui/team/CONTROL.md +50 -0
- package/packages/daemon/src/tui/team/entry.ts +38 -0
- package/packages/daemon/src/tui/team/fuzzy.ts +133 -0
- package/packages/daemon/src/tui/team/home.ts +170 -0
- package/packages/daemon/src/tui/team/index.tsx +1521 -0
- package/packages/daemon/src/tui/team/input.ts +34 -0
- package/packages/daemon/src/tui/team/keymap.ts +127 -0
- package/packages/daemon/src/tui/team/mouse.ts +29 -0
- package/packages/daemon/src/tui/team/nav.ts +31 -0
- package/packages/daemon/src/tui/team/preview.ts +34 -0
- package/packages/daemon/src/tui/team/projects.ts +191 -0
- package/packages/daemon/src/tui/team/report.ts +83 -0
- package/packages/daemon/src/tui/team/sessions.ts +433 -0
- package/packages/daemon/src/tui/team/tree.ts +62 -0
- package/packages/daemon/src/types.ts +13 -0
- package/packages/daemon/src/ui/index.ts +32 -0
- package/packages/daemon/src/ui/terminal/index.ts +9 -0
- package/packages/daemon/src/ui/types.ts +91 -0
- package/packages/daemon/src/ui/web/base.css +80 -0
- package/packages/daemon/src/ui/web/components/Box.tsx +59 -0
- package/packages/daemon/src/ui/web/components/Input.tsx +32 -0
- package/packages/daemon/src/ui/web/components/ScrollBox.tsx +60 -0
- package/packages/daemon/src/ui/web/components/Text.tsx +28 -0
- package/packages/daemon/src/ui/web/hooks.ts +106 -0
- package/packages/daemon/src/ui/web/index.ts +27 -0
- package/packages/daemon/src/ui/web/render.ts +77 -0
- package/packages/daemon/src/ui/web/utils/color.ts +27 -0
- package/packages/daemon/src/validate.ts +217 -0
- package/packages/daemon/src/widgets/changes/README.md +3 -0
- package/packages/daemon/src/widgets/changes/index.tsx +691 -0
- package/packages/daemon/src/widgets/config/README.md +3 -0
- package/packages/daemon/src/widgets/config/index.tsx +481 -0
- package/packages/daemon/src/widgets/explorer/README.md +3 -0
- package/packages/daemon/src/widgets/explorer/breadcrumbs.tsx +77 -0
- package/packages/daemon/src/widgets/explorer/footer.tsx +20 -0
- package/packages/daemon/src/widgets/explorer/header.tsx +23 -0
- package/packages/daemon/src/widgets/explorer/index.tsx +456 -0
- package/packages/daemon/src/widgets/explorer/tree-model.ts +103 -0
- package/packages/daemon/src/widgets/explorer/tree.tsx +165 -0
- package/packages/daemon/src/widgets/lib/config-model.ts +116 -0
- package/packages/daemon/src/widgets/lib/files.ts +88 -0
- package/packages/daemon/src/widgets/lib/git.ts +88 -0
- package/packages/daemon/src/widgets/lib/grammar.ts +126 -0
- package/packages/daemon/src/widgets/lib/help-overlay.tsx +101 -0
- package/packages/daemon/src/widgets/lib/pane-comms.ts +209 -0
- package/packages/daemon/src/widgets/lib/theme.ts +194 -0
- package/packages/daemon/src/widgets/lib/watcher.ts +132 -0
- package/packages/daemon/src/widgets/preview/README.md +3 -0
- package/packages/daemon/src/widgets/preview/index.tsx +416 -0
- package/packages/daemon/src/widgets/resolve.ts +121 -0
- package/packages/daemon/src/widgets/setup/README.md +3 -0
- package/packages/daemon/src/widgets/setup/agent-naming.tsx +112 -0
- package/packages/daemon/src/widgets/setup/config-tree.tsx +246 -0
- package/packages/daemon/src/widgets/setup/detect-panel.tsx +72 -0
- package/packages/daemon/src/widgets/setup/field-editor.tsx +265 -0
- package/packages/daemon/src/widgets/setup/footer.tsx +107 -0
- package/packages/daemon/src/widgets/setup/index.tsx +341 -0
- package/packages/daemon/src/widgets/setup/layout-picker.tsx +96 -0
- package/packages/daemon/src/widgets/setup/orchestrator-panel.tsx +200 -0
- package/packages/daemon/src/widgets/setup/review-panel.tsx +140 -0
- package/packages/daemon/src/widgets/setup/setup-model.ts +188 -0
- package/packages/daemon/src/widgets/sidebar/index.tsx +527 -0
- package/packages/tmux-bridge/package.json +22 -0
- package/packages/tmux-bridge/src/errors.ts +28 -0
- package/packages/tmux-bridge/src/index.ts +31 -0
- package/packages/tmux-bridge/src/monitor.ts +77 -0
- package/packages/tmux-bridge/src/panes.ts +136 -0
- package/packages/tmux-bridge/src/runner.test.ts +501 -0
- package/packages/tmux-bridge/src/runner.ts +91 -0
- package/packages/tmux-bridge/src/sessions.ts +126 -0
- package/packages/tmux-bridge/src/targeting.test.ts +107 -0
- package/packages/tmux-bridge/src/targeting.ts +90 -0
- package/scripts/build-tui.mjs +11 -4
- package/scripts/perf-mirror.mjs +313 -0
- package/scripts/postinstall.js +26 -2
- package/skill/SKILL.md +22 -0
- package/templates/AGENTS.md +14 -7
- package/templates/agent-team-monorepo.yml +8 -0
- package/templates/agent-team-nextjs.yml +8 -0
- package/templates/agent-team.yml +10 -0
- package/templates/convex.yml +2 -0
- package/templates/default.yml +11 -5
- package/templates/go.yml +4 -0
- package/templates/missions.yml +6 -0
- package/templates/nextjs.yml +4 -0
- package/templates/python.yml +4 -0
- package/templates/skills/backend.md +5 -12
- package/templates/skills/frontend.md +5 -12
- package/templates/skills/general-worker.md +5 -12
- package/templates/skills/researcher.md +7 -12
- package/templates/skills/reviewer.md +7 -16
- package/templates/vite.yml +4 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import "@opentui/solid/runtime-plugin-support";
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { execFileSync } from "node:child_process";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { render, useTerminalDimensions } from "@opentui/solid";
|
|
7
|
+
import { RGBA } from "@opentui/core";
|
|
8
|
+
import { createSignal, Switch, Match } from "solid-js";
|
|
9
|
+
import { createTheme, type RGBA as RGBAType } from "../lib/theme.ts";
|
|
10
|
+
import { getAppConfig } from "../../lib/app-config.ts";
|
|
11
|
+
import { detectStack } from "../../detect.ts";
|
|
12
|
+
import { readConfig, writeConfig } from "../../lib/yaml-io.ts";
|
|
13
|
+
import {
|
|
14
|
+
PRESETS,
|
|
15
|
+
flattenConfigTree,
|
|
16
|
+
updateConfigAtPath,
|
|
17
|
+
addPane,
|
|
18
|
+
removePane,
|
|
19
|
+
validateSetupConfig,
|
|
20
|
+
type LayoutPreset,
|
|
21
|
+
type TreeNode,
|
|
22
|
+
} from "./setup-model.ts";
|
|
23
|
+
import type { IdeConfig } from "../../schemas/ide-config.ts";
|
|
24
|
+
import { DetectPanel, type DetectedStackInfo } from "./detect-panel.tsx";
|
|
25
|
+
import { LayoutPicker } from "./layout-picker.tsx";
|
|
26
|
+
import { AgentNaming } from "./agent-naming.tsx";
|
|
27
|
+
import { ConfigTree } from "./config-tree.tsx";
|
|
28
|
+
import { FieldEditor, type FieldType } from "./field-editor.tsx";
|
|
29
|
+
import { Footer, type ViewKind, type FooterActions } from "./footer.tsx";
|
|
30
|
+
|
|
31
|
+
const { values } = parseArgs({
|
|
32
|
+
options: {
|
|
33
|
+
dir: { type: "string" },
|
|
34
|
+
theme: { type: "string" },
|
|
35
|
+
wizard: { type: "boolean" },
|
|
36
|
+
edit: { type: "boolean" },
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const dir = values.dir ?? process.cwd();
|
|
41
|
+
const themeConfig = values.theme ? JSON.parse(values.theme) : undefined;
|
|
42
|
+
const forceWizard = values.wizard ?? false;
|
|
43
|
+
const forceEdit = values.edit ?? false;
|
|
44
|
+
|
|
45
|
+
function toRGBA(c: RGBAType): RGBA {
|
|
46
|
+
return RGBA.fromInts(c.r, c.g, c.b, c.a);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Determine field type from path for the field editor
|
|
50
|
+
function inferFieldType(path: string[]): { type: FieldType; enumValues?: string[] } {
|
|
51
|
+
const last = path[path.length - 1];
|
|
52
|
+
if (last === "role") return { type: "enum", enumValues: ["lead", "teammate", "planner"] };
|
|
53
|
+
if (last === "type")
|
|
54
|
+
return {
|
|
55
|
+
type: "enum",
|
|
56
|
+
enumValues: ["explorer", "changes", "preview", "tasks", "costs", "config", "mission-control"],
|
|
57
|
+
};
|
|
58
|
+
if (last === "dispatch_mode") return { type: "enum", enumValues: ["tasks", "goals"] };
|
|
59
|
+
if (last === "focus" || last === "enabled" || last === "auto_dispatch" || last === "widgets")
|
|
60
|
+
return { type: "boolean" };
|
|
61
|
+
if (last === "size") return { type: "size" };
|
|
62
|
+
return { type: "string" };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Get current value at a path from config
|
|
66
|
+
function getValueAtPath(config: IdeConfig, path: string[]): string {
|
|
67
|
+
let current: unknown = config;
|
|
68
|
+
for (const key of path) {
|
|
69
|
+
if (current === null || current === undefined) return "";
|
|
70
|
+
if (typeof current === "object") {
|
|
71
|
+
current = (current as Record<string, unknown>)[key];
|
|
72
|
+
} else {
|
|
73
|
+
return "";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return current === null || current === undefined ? "" : String(current);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type View =
|
|
80
|
+
| { kind: "detect" }
|
|
81
|
+
| { kind: "layout-picker" }
|
|
82
|
+
| { kind: "agent-naming"; config: IdeConfig }
|
|
83
|
+
| { kind: "orchestrator" }
|
|
84
|
+
| { kind: "review"; config: IdeConfig }
|
|
85
|
+
| { kind: "editor-tree" }
|
|
86
|
+
| { kind: "editor-field"; path: string[] };
|
|
87
|
+
|
|
88
|
+
render(
|
|
89
|
+
() => {
|
|
90
|
+
const theme = createTheme(themeConfig, getAppConfig().theme);
|
|
91
|
+
const dimensions = useTerminalDimensions();
|
|
92
|
+
|
|
93
|
+
// Detect project stack once
|
|
94
|
+
const detected = detectStack(dir);
|
|
95
|
+
const detectedInfo: DetectedStackInfo = {
|
|
96
|
+
packageManager: detected.packageManager,
|
|
97
|
+
language: detected.language,
|
|
98
|
+
frameworks: detected.frameworks,
|
|
99
|
+
devCommand: detected.devCommand,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Determine initial view
|
|
103
|
+
const hasConfig = existsSync(join(dir, "ide.yml"));
|
|
104
|
+
const initialView: View =
|
|
105
|
+
forceEdit && hasConfig
|
|
106
|
+
? { kind: "editor-tree" }
|
|
107
|
+
: forceWizard || !hasConfig
|
|
108
|
+
? { kind: "detect" }
|
|
109
|
+
: { kind: "editor-tree" };
|
|
110
|
+
|
|
111
|
+
const [view, setView] = createSignal<View>(initialView);
|
|
112
|
+
|
|
113
|
+
// Config state — loaded from file for editor mode, built from wizard flow
|
|
114
|
+
const initialConfig: IdeConfig = hasConfig
|
|
115
|
+
? readConfig(dir).config
|
|
116
|
+
: { name: dir.split("/").pop() ?? "project", rows: [{ panes: [{ title: "Shell" }] }] };
|
|
117
|
+
const [config, setConfig] = createSignal<IdeConfig>(initialConfig);
|
|
118
|
+
|
|
119
|
+
function viewKind(): ViewKind {
|
|
120
|
+
return view().kind;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function footerActions(): FooterActions {
|
|
124
|
+
const quit = () => process.exit(0);
|
|
125
|
+
const kind = view().kind;
|
|
126
|
+
|
|
127
|
+
switch (kind) {
|
|
128
|
+
case "detect":
|
|
129
|
+
return {
|
|
130
|
+
onConfirm: () => setView({ kind: "layout-picker" }),
|
|
131
|
+
onQuit: quit,
|
|
132
|
+
};
|
|
133
|
+
case "layout-picker":
|
|
134
|
+
return { onQuit: quit };
|
|
135
|
+
case "agent-naming":
|
|
136
|
+
return {
|
|
137
|
+
onBack: () => setView({ kind: "layout-picker" }),
|
|
138
|
+
onQuit: quit,
|
|
139
|
+
};
|
|
140
|
+
case "orchestrator":
|
|
141
|
+
return {
|
|
142
|
+
onBack: () => setView({ kind: "agent-naming", config: config() }),
|
|
143
|
+
onQuit: quit,
|
|
144
|
+
};
|
|
145
|
+
case "review":
|
|
146
|
+
return {
|
|
147
|
+
onBack: () => setView({ kind: "agent-naming", config: config() }),
|
|
148
|
+
onQuit: quit,
|
|
149
|
+
};
|
|
150
|
+
case "editor-tree":
|
|
151
|
+
return {
|
|
152
|
+
onSave: () => handleSaveOnly(config()),
|
|
153
|
+
onQuit: quit,
|
|
154
|
+
};
|
|
155
|
+
case "editor-field":
|
|
156
|
+
return {
|
|
157
|
+
onBack: () => {
|
|
158
|
+
if (hasConfig && !forceWizard) {
|
|
159
|
+
setView({ kind: "editor-tree" });
|
|
160
|
+
} else {
|
|
161
|
+
setView({ kind: "review", config: config() });
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
default:
|
|
166
|
+
return { onQuit: quit };
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function handleSaveAndLaunch(cfg: IdeConfig) {
|
|
171
|
+
writeConfig(dir, cfg);
|
|
172
|
+
try {
|
|
173
|
+
execFileSync("tmux-ide", [], { cwd: dir, stdio: "inherit" });
|
|
174
|
+
} catch {
|
|
175
|
+
// tmux-ide may not be in PATH when running as widget
|
|
176
|
+
}
|
|
177
|
+
process.exit(0);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function handleSaveOnly(cfg: IdeConfig) {
|
|
181
|
+
writeConfig(dir, cfg);
|
|
182
|
+
process.exit(0);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<box
|
|
187
|
+
width={dimensions().width}
|
|
188
|
+
height={dimensions().height}
|
|
189
|
+
backgroundColor={toRGBA(theme.bg)}
|
|
190
|
+
>
|
|
191
|
+
<box flexGrow={1}>
|
|
192
|
+
<Switch>
|
|
193
|
+
{/* Wizard flow */}
|
|
194
|
+
<Match when={view().kind === "detect"}>
|
|
195
|
+
<DetectPanel
|
|
196
|
+
detected={detectedInfo}
|
|
197
|
+
onContinue={() => setView({ kind: "layout-picker" })}
|
|
198
|
+
theme={theme}
|
|
199
|
+
/>
|
|
200
|
+
</Match>
|
|
201
|
+
|
|
202
|
+
<Match when={view().kind === "layout-picker"}>
|
|
203
|
+
<LayoutPicker
|
|
204
|
+
presets={PRESETS}
|
|
205
|
+
onSelect={(preset: LayoutPreset) => {
|
|
206
|
+
const name = dir.split("/").pop() ?? "project";
|
|
207
|
+
const cfg = preset.buildConfig(name, {
|
|
208
|
+
devCommand: detected.devCommand,
|
|
209
|
+
packageManager: detected.packageManager,
|
|
210
|
+
});
|
|
211
|
+
setConfig(cfg);
|
|
212
|
+
|
|
213
|
+
// If preset has claude panes, go to agent naming
|
|
214
|
+
const hasClaude = cfg.rows.some((r) =>
|
|
215
|
+
r.panes.some((p) => p.command === "claude"),
|
|
216
|
+
);
|
|
217
|
+
if (hasClaude) {
|
|
218
|
+
setView({ kind: "agent-naming", config: cfg });
|
|
219
|
+
} else {
|
|
220
|
+
setView({ kind: "review", config: cfg });
|
|
221
|
+
}
|
|
222
|
+
}}
|
|
223
|
+
theme={theme}
|
|
224
|
+
/>
|
|
225
|
+
</Match>
|
|
226
|
+
|
|
227
|
+
<Match when={view().kind === "agent-naming"}>
|
|
228
|
+
<AgentNaming
|
|
229
|
+
config={config()}
|
|
230
|
+
onContinue={(names: string[]) => {
|
|
231
|
+
let cfg = config();
|
|
232
|
+
let nameIdx = 0;
|
|
233
|
+
// Apply names to claude panes
|
|
234
|
+
for (let ri = 0; ri < cfg.rows.length; ri++) {
|
|
235
|
+
for (let pi = 0; pi < cfg.rows[ri]!.panes.length; pi++) {
|
|
236
|
+
if (cfg.rows[ri]!.panes[pi]!.command === "claude" && nameIdx < names.length) {
|
|
237
|
+
cfg = updateConfigAtPath(
|
|
238
|
+
cfg,
|
|
239
|
+
["rows", String(ri), "panes", String(pi), "title"],
|
|
240
|
+
names[nameIdx],
|
|
241
|
+
);
|
|
242
|
+
nameIdx++;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
setConfig(cfg);
|
|
247
|
+
setView({ kind: "review", config: cfg });
|
|
248
|
+
}}
|
|
249
|
+
theme={theme}
|
|
250
|
+
/>
|
|
251
|
+
</Match>
|
|
252
|
+
|
|
253
|
+
<Match when={view().kind === "review"}>
|
|
254
|
+
<ConfigTree
|
|
255
|
+
config={config()}
|
|
256
|
+
onEditField={(path) => setView({ kind: "editor-field", path })}
|
|
257
|
+
onAddPane={(rowIdx) => {
|
|
258
|
+
setConfig(addPane(config(), rowIdx));
|
|
259
|
+
}}
|
|
260
|
+
onDelete={(path) => {
|
|
261
|
+
// Handle pane deletion: path like ["rows","0","panes","1"]
|
|
262
|
+
if (path.length === 4 && path[0] === "rows" && path[2] === "panes") {
|
|
263
|
+
const rowIdx = parseInt(path[1]!, 10);
|
|
264
|
+
const paneIdx = parseInt(path[3]!, 10);
|
|
265
|
+
setConfig(removePane(config(), rowIdx, paneIdx));
|
|
266
|
+
}
|
|
267
|
+
}}
|
|
268
|
+
onSave={(cfg) => handleSaveAndLaunch(cfg)}
|
|
269
|
+
onConfigChange={(cfg) => setConfig(cfg)}
|
|
270
|
+
theme={theme}
|
|
271
|
+
/>
|
|
272
|
+
</Match>
|
|
273
|
+
|
|
274
|
+
{/* Editor flow */}
|
|
275
|
+
<Match when={view().kind === "editor-tree"}>
|
|
276
|
+
<ConfigTree
|
|
277
|
+
config={config()}
|
|
278
|
+
onEditField={(path) => setView({ kind: "editor-field", path })}
|
|
279
|
+
onAddPane={(rowIdx) => {
|
|
280
|
+
setConfig(addPane(config(), rowIdx));
|
|
281
|
+
}}
|
|
282
|
+
onDelete={(path) => {
|
|
283
|
+
if (path.length === 4 && path[0] === "rows" && path[2] === "panes") {
|
|
284
|
+
const rowIdx = parseInt(path[1]!, 10);
|
|
285
|
+
const paneIdx = parseInt(path[3]!, 10);
|
|
286
|
+
setConfig(removePane(config(), rowIdx, paneIdx));
|
|
287
|
+
}
|
|
288
|
+
}}
|
|
289
|
+
onSave={(cfg) => handleSaveOnly(cfg)}
|
|
290
|
+
onConfigChange={(cfg) => setConfig(cfg)}
|
|
291
|
+
theme={theme}
|
|
292
|
+
/>
|
|
293
|
+
</Match>
|
|
294
|
+
|
|
295
|
+
<Match when={view().kind === "editor-field"}>
|
|
296
|
+
{(() => {
|
|
297
|
+
const v = view() as Extract<View, { kind: "editor-field" }>;
|
|
298
|
+
const fieldInfo = inferFieldType(v.path);
|
|
299
|
+
return (
|
|
300
|
+
<FieldEditor
|
|
301
|
+
path={v.path}
|
|
302
|
+
value={getValueAtPath(config(), v.path)}
|
|
303
|
+
fieldType={fieldInfo.type}
|
|
304
|
+
enumValues={fieldInfo.enumValues}
|
|
305
|
+
onSave={(path, newValue) => {
|
|
306
|
+
setConfig(updateConfigAtPath(config(), path, newValue));
|
|
307
|
+
// Return to appropriate tree view
|
|
308
|
+
const prev = view();
|
|
309
|
+
// Check if we came from editor or wizard review
|
|
310
|
+
if (hasConfig && !forceWizard) {
|
|
311
|
+
setView({ kind: "editor-tree" });
|
|
312
|
+
} else {
|
|
313
|
+
setView({ kind: "review", config: config() });
|
|
314
|
+
}
|
|
315
|
+
}}
|
|
316
|
+
onCancel={() => {
|
|
317
|
+
if (hasConfig && !forceWizard) {
|
|
318
|
+
setView({ kind: "editor-tree" });
|
|
319
|
+
} else {
|
|
320
|
+
setView({ kind: "review", config: config() });
|
|
321
|
+
}
|
|
322
|
+
}}
|
|
323
|
+
theme={theme}
|
|
324
|
+
/>
|
|
325
|
+
);
|
|
326
|
+
})()}
|
|
327
|
+
</Match>
|
|
328
|
+
</Switch>
|
|
329
|
+
</box>
|
|
330
|
+
|
|
331
|
+
<Footer viewKind={viewKind()} theme={theme} actions={footerActions()} />
|
|
332
|
+
</box>
|
|
333
|
+
);
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
targetFps: 30,
|
|
337
|
+
exitOnCtrlC: true,
|
|
338
|
+
useKittyKeyboard: {},
|
|
339
|
+
autoFocus: false,
|
|
340
|
+
},
|
|
341
|
+
);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createSignal } from "solid-js";
|
|
2
|
+
import { RGBA, TextAttributes } from "@opentui/core";
|
|
3
|
+
import { useKeyboard } from "@opentui/solid";
|
|
4
|
+
import type { LayoutPreset } from "./setup-model.ts";
|
|
5
|
+
import type { WidgetTheme, RGBA as RGBAType } from "../lib/theme.ts";
|
|
6
|
+
|
|
7
|
+
function toRGBA(c: RGBAType): RGBA {
|
|
8
|
+
return RGBA.fromInts(c.r, c.g, c.b, c.a);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface LayoutPickerProps {
|
|
12
|
+
presets: LayoutPreset[];
|
|
13
|
+
onSelect: (preset: LayoutPreset) => void;
|
|
14
|
+
theme: WidgetTheme;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function LayoutPicker(props: LayoutPickerProps) {
|
|
18
|
+
const [selectedIndex, setSelectedIndex] = createSignal(0);
|
|
19
|
+
const theme = props.theme;
|
|
20
|
+
|
|
21
|
+
useKeyboard((evt) => {
|
|
22
|
+
if (evt.name === "k" || evt.name === "up") {
|
|
23
|
+
setSelectedIndex((i) => Math.max(0, i - 1));
|
|
24
|
+
evt.preventDefault();
|
|
25
|
+
} else if (evt.name === "j" || evt.name === "down") {
|
|
26
|
+
setSelectedIndex((i) => Math.min(props.presets.length - 1, i + 1));
|
|
27
|
+
evt.preventDefault();
|
|
28
|
+
} else if (evt.name === "return") {
|
|
29
|
+
const preset = props.presets[selectedIndex()];
|
|
30
|
+
if (preset) props.onSelect(preset);
|
|
31
|
+
evt.preventDefault();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<box paddingLeft={1} paddingRight={1}>
|
|
37
|
+
{/* Header */}
|
|
38
|
+
<box flexShrink={0} paddingBottom={1}>
|
|
39
|
+
<text fg={toRGBA(theme.accent)} attributes={TextAttributes.BOLD}>
|
|
40
|
+
Choose Layout
|
|
41
|
+
</text>
|
|
42
|
+
</box>
|
|
43
|
+
|
|
44
|
+
{/* Preset options */}
|
|
45
|
+
{props.presets.map((preset, index) => {
|
|
46
|
+
const isSelected = () => selectedIndex() === index;
|
|
47
|
+
return (
|
|
48
|
+
<box
|
|
49
|
+
flexShrink={0}
|
|
50
|
+
paddingBottom={1}
|
|
51
|
+
backgroundColor={isSelected() ? toRGBA(theme.selected) : undefined}
|
|
52
|
+
onMouseDown={() => setSelectedIndex(index)}
|
|
53
|
+
onMouseMove={() => setSelectedIndex(index)}
|
|
54
|
+
onMouseUp={() => props.onSelect(preset)}
|
|
55
|
+
>
|
|
56
|
+
<box flexDirection="row" gap={1}>
|
|
57
|
+
<text fg={toRGBA(isSelected() ? theme.accent : theme.fgMuted)}>
|
|
58
|
+
{isSelected() ? "▸" : " "}
|
|
59
|
+
</text>
|
|
60
|
+
<text
|
|
61
|
+
fg={toRGBA(isSelected() ? theme.accent : theme.fg)}
|
|
62
|
+
attributes={isSelected() ? TextAttributes.BOLD : 0}
|
|
63
|
+
>
|
|
64
|
+
{preset.label}
|
|
65
|
+
</text>
|
|
66
|
+
<text fg={toRGBA(theme.fgMuted)}>— {preset.description}</text>
|
|
67
|
+
</box>
|
|
68
|
+
{isSelected() ? (
|
|
69
|
+
<box paddingLeft={3}>
|
|
70
|
+
{preset.diagram.map((line) => (
|
|
71
|
+
<text fg={toRGBA(theme.fg)}>{line}</text>
|
|
72
|
+
))}
|
|
73
|
+
</box>
|
|
74
|
+
) : null}
|
|
75
|
+
</box>
|
|
76
|
+
);
|
|
77
|
+
})}
|
|
78
|
+
|
|
79
|
+
{/* Spacer */}
|
|
80
|
+
<box flexGrow={1} />
|
|
81
|
+
|
|
82
|
+
{/* Footer */}
|
|
83
|
+
<box flexShrink={0}>
|
|
84
|
+
<box flexShrink={0} height={1}>
|
|
85
|
+
<text fg={toRGBA(theme.border)} wrapMode="none">
|
|
86
|
+
{"─".repeat(40)}
|
|
87
|
+
</text>
|
|
88
|
+
</box>
|
|
89
|
+
<box flexDirection="row" gap={2}>
|
|
90
|
+
<text fg={toRGBA(theme.fgMuted)}>j/k:navigate</text>
|
|
91
|
+
<text fg={toRGBA(theme.fgMuted)}>Enter:select</text>
|
|
92
|
+
</box>
|
|
93
|
+
</box>
|
|
94
|
+
</box>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { createSignal, For } from "solid-js";
|
|
2
|
+
import { RGBA, TextAttributes } from "@opentui/core";
|
|
3
|
+
import { useKeyboard } from "@opentui/solid";
|
|
4
|
+
import type { WidgetTheme, RGBA as RGBAType } from "../lib/theme.ts";
|
|
5
|
+
|
|
6
|
+
function toRGBA(c: RGBAType): RGBA {
|
|
7
|
+
return RGBA.fromInts(c.r, c.g, c.b, c.a);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface OrchestratorPanelConfig {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
auto_dispatch: boolean;
|
|
13
|
+
master_pane: string | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface OrchestratorPanelProps {
|
|
17
|
+
claudePaneNames: string[];
|
|
18
|
+
theme: WidgetTheme;
|
|
19
|
+
onContinue: (config: OrchestratorPanelConfig) => void;
|
|
20
|
+
onBack: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type Field = "enabled" | "master_pane" | "auto_dispatch" | "confirm";
|
|
24
|
+
|
|
25
|
+
export function OrchestratorPanel(props: OrchestratorPanelProps) {
|
|
26
|
+
const [enabled, setEnabled] = createSignal(true);
|
|
27
|
+
const [autoDispatch, setAutoDispatch] = createSignal(true);
|
|
28
|
+
const [masterIdx, setMasterIdx] = createSignal(0);
|
|
29
|
+
const [activeField, setActiveField] = createSignal<Field>("enabled");
|
|
30
|
+
|
|
31
|
+
const theme = props.theme;
|
|
32
|
+
|
|
33
|
+
const fields: Field[] = ["enabled", "master_pane", "auto_dispatch", "confirm"];
|
|
34
|
+
|
|
35
|
+
function fieldIndex() {
|
|
36
|
+
return fields.indexOf(activeField());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
useKeyboard((evt) => {
|
|
40
|
+
if (evt.name === "escape") {
|
|
41
|
+
props.onBack();
|
|
42
|
+
evt.preventDefault();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (evt.name === "down" || evt.name === "j") {
|
|
47
|
+
const next = Math.min(fieldIndex() + 1, fields.length - 1);
|
|
48
|
+
setActiveField(fields[next]!);
|
|
49
|
+
evt.preventDefault();
|
|
50
|
+
} else if (evt.name === "up" || evt.name === "k") {
|
|
51
|
+
const prev = Math.max(fieldIndex() - 1, 0);
|
|
52
|
+
setActiveField(fields[prev]!);
|
|
53
|
+
evt.preventDefault();
|
|
54
|
+
} else if (evt.name === "space" || evt.name === "return") {
|
|
55
|
+
const field = activeField();
|
|
56
|
+
if (field === "enabled") {
|
|
57
|
+
setEnabled(!enabled());
|
|
58
|
+
} else if (field === "master_pane" && props.claudePaneNames.length > 0) {
|
|
59
|
+
setMasterIdx((masterIdx() + 1) % props.claudePaneNames.length);
|
|
60
|
+
} else if (field === "auto_dispatch") {
|
|
61
|
+
setAutoDispatch(!autoDispatch());
|
|
62
|
+
} else if (field === "confirm") {
|
|
63
|
+
props.onContinue({
|
|
64
|
+
enabled: enabled(),
|
|
65
|
+
auto_dispatch: autoDispatch(),
|
|
66
|
+
master_pane: props.claudePaneNames[masterIdx()] ?? null,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
evt.preventDefault();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
function toggleLabel(active: boolean): string {
|
|
74
|
+
return active ? "[x]" : "[ ]";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isActive(field: Field): boolean {
|
|
78
|
+
return activeField() === field;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<box paddingLeft={1} paddingRight={1}>
|
|
83
|
+
{/* Header */}
|
|
84
|
+
<box flexShrink={0} paddingBottom={1}>
|
|
85
|
+
<text fg={toRGBA(theme.accent)} attributes={TextAttributes.BOLD}>
|
|
86
|
+
Orchestrator Configuration
|
|
87
|
+
</text>
|
|
88
|
+
<text fg={toRGBA(theme.fgMuted)}>
|
|
89
|
+
Configure multi-agent orchestration for your team layout.
|
|
90
|
+
</text>
|
|
91
|
+
</box>
|
|
92
|
+
|
|
93
|
+
{/* Enabled toggle */}
|
|
94
|
+
<box
|
|
95
|
+
flexShrink={0}
|
|
96
|
+
flexDirection="row"
|
|
97
|
+
gap={1}
|
|
98
|
+
paddingBottom={1}
|
|
99
|
+
onMouseDown={() => {
|
|
100
|
+
setActiveField("enabled");
|
|
101
|
+
setEnabled(!enabled());
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<text
|
|
105
|
+
fg={toRGBA(isActive("enabled") ? theme.accent : theme.fg)}
|
|
106
|
+
attributes={isActive("enabled") ? TextAttributes.BOLD : undefined}
|
|
107
|
+
>
|
|
108
|
+
{isActive("enabled") ? ">" : " "} {toggleLabel(enabled())} Enabled
|
|
109
|
+
</text>
|
|
110
|
+
</box>
|
|
111
|
+
|
|
112
|
+
{/* Master pane picker */}
|
|
113
|
+
<box flexShrink={0} paddingBottom={1}>
|
|
114
|
+
<text
|
|
115
|
+
fg={toRGBA(isActive("master_pane") ? theme.accent : theme.fg)}
|
|
116
|
+
attributes={isActive("master_pane") ? TextAttributes.BOLD : undefined}
|
|
117
|
+
>
|
|
118
|
+
{isActive("master_pane") ? ">" : " "} Master Pane
|
|
119
|
+
</text>
|
|
120
|
+
<box paddingLeft={4}>
|
|
121
|
+
<For each={props.claudePaneNames}>
|
|
122
|
+
{(name, i) => (
|
|
123
|
+
<text
|
|
124
|
+
fg={toRGBA(i() === masterIdx() ? theme.accent : theme.fgMuted)}
|
|
125
|
+
onMouseDown={() => {
|
|
126
|
+
setActiveField("master_pane");
|
|
127
|
+
setMasterIdx(i());
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{i() === masterIdx() ? "● " : "○ "}
|
|
131
|
+
{name}
|
|
132
|
+
</text>
|
|
133
|
+
)}
|
|
134
|
+
</For>
|
|
135
|
+
</box>
|
|
136
|
+
<box paddingLeft={4}>
|
|
137
|
+
<text fg={toRGBA(theme.fgMuted)}>Space/Enter to cycle selection</text>
|
|
138
|
+
</box>
|
|
139
|
+
</box>
|
|
140
|
+
|
|
141
|
+
{/* Auto dispatch toggle */}
|
|
142
|
+
<box
|
|
143
|
+
flexShrink={0}
|
|
144
|
+
flexDirection="row"
|
|
145
|
+
gap={1}
|
|
146
|
+
paddingBottom={1}
|
|
147
|
+
onMouseDown={() => {
|
|
148
|
+
setActiveField("auto_dispatch");
|
|
149
|
+
setAutoDispatch(!autoDispatch());
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<text
|
|
153
|
+
fg={toRGBA(isActive("auto_dispatch") ? theme.accent : theme.fg)}
|
|
154
|
+
attributes={isActive("auto_dispatch") ? TextAttributes.BOLD : undefined}
|
|
155
|
+
>
|
|
156
|
+
{isActive("auto_dispatch") ? ">" : " "} {toggleLabel(autoDispatch())} Auto-dispatch tasks
|
|
157
|
+
</text>
|
|
158
|
+
</box>
|
|
159
|
+
|
|
160
|
+
{/* Spacer */}
|
|
161
|
+
<box flexGrow={1} />
|
|
162
|
+
|
|
163
|
+
{/* Continue button */}
|
|
164
|
+
<box
|
|
165
|
+
flexShrink={0}
|
|
166
|
+
paddingBottom={1}
|
|
167
|
+
onMouseDown={() => {
|
|
168
|
+
setActiveField("confirm");
|
|
169
|
+
props.onContinue({
|
|
170
|
+
enabled: enabled(),
|
|
171
|
+
auto_dispatch: autoDispatch(),
|
|
172
|
+
master_pane: props.claudePaneNames[masterIdx()] ?? null,
|
|
173
|
+
});
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<text
|
|
177
|
+
fg={toRGBA(isActive("confirm") ? theme.accent : theme.fgMuted)}
|
|
178
|
+
attributes={isActive("confirm") ? TextAttributes.BOLD : undefined}
|
|
179
|
+
>
|
|
180
|
+
{isActive("confirm") ? ">" : " "} [ Continue → ]
|
|
181
|
+
</text>
|
|
182
|
+
</box>
|
|
183
|
+
|
|
184
|
+
{/* Footer */}
|
|
185
|
+
<box flexShrink={0}>
|
|
186
|
+
<box flexShrink={0} height={1}>
|
|
187
|
+
<text fg={toRGBA(theme.border)} wrapMode="none">
|
|
188
|
+
{"─".repeat(40)}
|
|
189
|
+
</text>
|
|
190
|
+
</box>
|
|
191
|
+
<box flexDirection="row" gap={2}>
|
|
192
|
+
<text fg={toRGBA(theme.fgMuted)}>j/k:navigate</text>
|
|
193
|
+
<text fg={toRGBA(theme.fgMuted)}>Space:toggle</text>
|
|
194
|
+
<text fg={toRGBA(theme.fgMuted)}>Enter:select</text>
|
|
195
|
+
<text fg={toRGBA(theme.fgMuted)}>Esc:back</text>
|
|
196
|
+
</box>
|
|
197
|
+
</box>
|
|
198
|
+
</box>
|
|
199
|
+
);
|
|
200
|
+
}
|