tmux-ide 1.2.1 → 2.0.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/bin/cli.js +4 -216
- package/bin/cli.ts +536 -0
- package/package.json +33 -14
- package/src/__tests__/support.ts +186 -0
- package/src/{attach.js → attach.ts} +7 -4
- package/src/cli.test.ts +314 -0
- package/src/command-center/discovery.test.ts +265 -0
- package/src/command-center/discovery.ts +296 -0
- package/src/command-center/index.ts +31 -0
- package/src/command-center/schemas.ts +57 -0
- package/src/command-center/server.test.ts +818 -0
- package/src/command-center/server.ts +1426 -0
- package/src/config-cli.test.ts +86 -0
- package/src/config.test.ts +205 -0
- package/src/config.ts +313 -0
- package/src/detect.test.ts +142 -0
- package/src/{detect.js → detect.ts} +31 -15
- package/src/dispatch.ts +102 -0
- package/src/doctor.test.ts +119 -0
- package/src/doctor.ts +167 -0
- package/src/init.test.ts +101 -0
- package/src/init.ts +144 -0
- package/src/inspect.test.ts +67 -0
- package/src/{inspect.js → inspect.ts} +95 -10
- package/src/integration.test.ts.skip +276 -0
- package/src/js-yaml.d.ts +10 -0
- package/src/launch.test.ts +222 -0
- package/src/launch.ts +494 -0
- package/src/lib/auth/auth-service.test.ts +178 -0
- package/src/lib/auth/auth-service.ts +227 -0
- package/src/lib/auth/middleware.test.ts +119 -0
- package/src/lib/auth/middleware.ts +56 -0
- package/src/lib/auth/types.ts +13 -0
- package/src/lib/authorship.test.ts +242 -0
- package/src/lib/authorship.ts +280 -0
- package/src/lib/cast/recorder.test.ts +127 -0
- package/src/lib/cast/recorder.ts +148 -0
- package/src/lib/daemon-watchdog.ts +102 -0
- package/src/lib/daemon.ts +417 -0
- package/src/lib/dot-path.test.ts +66 -0
- package/src/lib/dot-path.ts +17 -0
- package/src/lib/errors.ts +44 -0
- package/src/lib/event-log.test.ts +189 -0
- package/src/lib/event-log.ts +237 -0
- package/src/lib/github-pr.ts +182 -0
- package/src/lib/hq/client.test.ts +154 -0
- package/src/lib/hq/client.ts +142 -0
- package/src/lib/hq/mdns.test.ts +54 -0
- package/src/lib/hq/mdns.ts +88 -0
- package/src/lib/hq/registry.test.ts +237 -0
- package/src/lib/hq/registry.ts +145 -0
- package/src/lib/hq/types.ts +44 -0
- package/src/lib/ipc/socket-protocol.test.ts +126 -0
- package/src/lib/ipc/socket-protocol.ts +324 -0
- package/src/lib/launch-plan.test.ts +119 -0
- package/src/lib/launch-plan.ts +90 -0
- package/src/lib/log.test.ts +39 -0
- package/src/lib/log.ts +71 -0
- package/src/lib/metrics.test.ts +213 -0
- package/src/lib/metrics.ts +345 -0
- package/src/lib/orchestrator.test.ts +2358 -0
- package/src/lib/orchestrator.ts +1792 -0
- package/src/lib/{output.js → output.ts} +18 -10
- package/src/lib/plan-store.test.ts +148 -0
- package/src/lib/plan-store.ts +131 -0
- package/src/lib/research.test.ts +208 -0
- package/src/lib/research.ts +475 -0
- package/src/lib/round-trip.test.ts +341 -0
- package/src/lib/session-monitor.test.ts +152 -0
- package/src/lib/session-monitor.ts +282 -0
- package/src/lib/session-options.test.ts +146 -0
- package/src/lib/{session-options.js → session-options.ts} +11 -6
- package/src/lib/shell.test.ts +20 -0
- package/src/lib/shell.ts +8 -0
- package/src/lib/sizes.test.ts +73 -0
- package/src/lib/{sizes.js → sizes.ts} +4 -4
- package/src/lib/skill-registry.test.ts +134 -0
- package/src/lib/skill-registry.ts +86 -0
- package/src/lib/slugify.test.ts +35 -0
- package/src/lib/slugify.ts +10 -0
- package/src/lib/task-store.ts +352 -0
- package/src/lib/tmux.test.ts +500 -0
- package/src/lib/tmux.ts +372 -0
- package/src/lib/token-tracker.test.ts +102 -0
- package/src/lib/token-tracker.ts +70 -0
- package/src/lib/tunnels/cloudflare.test.ts +73 -0
- package/src/lib/tunnels/cloudflare.ts +254 -0
- package/src/lib/tunnels/manager.test.ts +63 -0
- package/src/lib/tunnels/manager.ts +132 -0
- package/src/lib/tunnels/ngrok.test.ts +94 -0
- package/src/lib/tunnels/ngrok.ts +261 -0
- package/src/lib/tunnels/tailscale.test.ts +103 -0
- package/src/lib/tunnels/tailscale.ts +1048 -0
- package/src/lib/tunnels/types.ts +44 -0
- package/src/lib/validation.test.ts +289 -0
- package/src/lib/validation.ts +123 -0
- package/src/lib/webhook.ts +51 -0
- package/src/lib/workflow-store.ts +209 -0
- package/src/lib/ws-v3/protocol.test.ts +127 -0
- package/src/lib/ws-v3/protocol.ts +160 -0
- package/src/lib/yaml-io.test.ts +125 -0
- package/src/lib/{yaml-io.js → yaml-io.ts} +5 -4
- package/src/ls.test.ts +76 -0
- package/src/{ls.js → ls.ts} +4 -4
- package/src/metrics-cli.ts +177 -0
- package/src/notify.ts +85 -0
- package/src/orchestrator-status.ts +228 -0
- package/src/plan.ts +117 -0
- package/src/postinstall.test.ts +79 -0
- package/src/remote.test.ts +115 -0
- package/src/remote.ts +148 -0
- package/src/restart.ts +24 -0
- package/src/schemas/domain.ts +422 -0
- package/src/schemas/ide-config.ts +148 -0
- package/src/schemas/index.ts +53 -0
- package/src/send.test.ts +70 -0
- package/src/send.ts +181 -0
- package/src/skill.test.ts +114 -0
- package/src/skill.ts +138 -0
- package/src/status.ts +66 -0
- package/src/stop.test.ts +176 -0
- package/src/stop.ts +47 -0
- package/src/task.test.ts +1466 -0
- package/src/task.ts +1143 -0
- package/src/tunnel.test.ts +80 -0
- package/src/tunnel.ts +133 -0
- package/src/types.ts +15 -0
- package/src/ui/index.ts +32 -0
- package/src/ui/terminal/index.ts +9 -0
- package/src/ui/types.ts +91 -0
- package/src/ui/web/base.css +80 -0
- package/src/ui/web/components/Box.tsx +59 -0
- package/src/ui/web/components/Input.tsx +32 -0
- package/src/ui/web/components/ScrollBox.tsx +60 -0
- package/src/ui/web/components/Text.tsx +28 -0
- package/src/ui/web/hooks.ts +106 -0
- package/src/ui/web/index.ts +27 -0
- package/src/ui/web/render.ts +77 -0
- package/src/ui/web/utils/color.test.ts +93 -0
- package/src/ui/web/utils/color.ts +27 -0
- package/src/validate.test.ts +385 -0
- package/src/validate.ts +217 -0
- package/src/widgets/changes/index.tsx +576 -0
- package/src/widgets/config/index.tsx +440 -0
- package/src/widgets/costs/index.tsx +216 -0
- package/src/widgets/explorer/breadcrumbs.tsx +77 -0
- package/src/widgets/explorer/footer.tsx +20 -0
- package/src/widgets/explorer/header.tsx +23 -0
- package/src/widgets/explorer/index.tsx +408 -0
- package/src/widgets/explorer/tree-model.test.ts +214 -0
- package/src/widgets/explorer/tree-model.ts +103 -0
- package/src/widgets/explorer/tree.tsx +156 -0
- package/src/widgets/lib/config-model.ts +116 -0
- package/src/widgets/lib/files.test.ts +103 -0
- package/src/widgets/lib/files.ts +88 -0
- package/src/widgets/lib/git.test.ts +151 -0
- package/src/widgets/lib/git.ts +88 -0
- package/src/widgets/lib/pane-comms.test.ts +178 -0
- package/src/widgets/lib/pane-comms.ts +192 -0
- package/src/widgets/lib/theme.ts +151 -0
- package/src/widgets/lib/watcher.ts +50 -0
- package/src/widgets/mission-control/activity-feed.tsx +59 -0
- package/src/widgets/mission-control/agent-panel.tsx +132 -0
- package/src/widgets/mission-control/command-bar.tsx +63 -0
- package/src/widgets/mission-control/index.tsx +751 -0
- package/src/widgets/mission-control/task-panel.tsx +238 -0
- package/src/widgets/preview/index.tsx +415 -0
- package/src/widgets/resolve.ts +40 -0
- package/src/widgets/setup/agent-naming.tsx +112 -0
- package/src/widgets/setup/config-tree.tsx +238 -0
- package/src/widgets/setup/detect-panel.tsx +72 -0
- package/src/widgets/setup/field-editor.tsx +265 -0
- package/src/widgets/setup/footer.tsx +107 -0
- package/src/widgets/setup/index.tsx +340 -0
- package/src/widgets/setup/layout-picker.tsx +96 -0
- package/src/widgets/setup/orchestrator-panel.tsx +200 -0
- package/src/widgets/setup/review-panel.tsx +140 -0
- package/src/widgets/setup/setup-model.test.ts +303 -0
- package/src/widgets/setup/setup-model.ts +188 -0
- package/src/widgets/tasks/index.tsx +129 -0
- package/src/widgets/tasks/task-detail.tsx +309 -0
- package/src/widgets/tasks/task-form.tsx +193 -0
- package/src/widgets/tasks/task-list.tsx +205 -0
- package/src/widgets/tasks/task-model.test.ts +473 -0
- package/src/widgets/tasks/task-model.ts +157 -0
- package/templates/AGENTS.md +20 -0
- package/templates/missions.yml +41 -0
- package/templates/skills/backend.md +30 -0
- package/templates/skills/frontend.md +30 -0
- package/templates/skills/general-worker.md +30 -0
- package/templates/skills/researcher.md +69 -0
- package/templates/skills/reviewer.md +30 -0
- package/src/config.js +0 -341
- package/src/doctor.js +0 -91
- package/src/init.js +0 -73
- package/src/launch.js +0 -245
- package/src/lib/dot-path.js +0 -16
- package/src/lib/errors.js +0 -35
- package/src/lib/launch-plan.js +0 -49
- package/src/lib/session-monitor.js +0 -179
- package/src/lib/tmux.js +0 -237
- package/src/restart.js +0 -16
- package/src/status.js +0 -35
- package/src/stop.js +0 -25
- package/src/validate.js +0 -154
package/bin/cli.js
CHANGED
|
@@ -1,216 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import { init } from "../src/init.js";
|
|
6
|
-
import { stop } from "../src/stop.js";
|
|
7
|
-
import { attach } from "../src/attach.js";
|
|
8
|
-
import { ls } from "../src/ls.js";
|
|
9
|
-
import { doctor } from "../src/doctor.js";
|
|
10
|
-
import { status } from "../src/status.js";
|
|
11
|
-
import { inspect } from "../src/inspect.js";
|
|
12
|
-
import { validate } from "../src/validate.js";
|
|
13
|
-
import { detect } from "../src/detect.js";
|
|
14
|
-
import { config } from "../src/config.js";
|
|
15
|
-
import { restart } from "../src/restart.js";
|
|
16
|
-
import { IdeError } from "../src/lib/errors.js";
|
|
17
|
-
import { printCommandError } from "../src/lib/output.js";
|
|
18
|
-
|
|
19
|
-
const { positionals, values } = parseArgs({
|
|
20
|
-
allowPositionals: true,
|
|
21
|
-
strict: false,
|
|
22
|
-
options: {
|
|
23
|
-
json: { type: "boolean" },
|
|
24
|
-
row: { type: "string" },
|
|
25
|
-
pane: { type: "string" },
|
|
26
|
-
title: { type: "string" },
|
|
27
|
-
command: { type: "string" },
|
|
28
|
-
size: { type: "string" },
|
|
29
|
-
write: { type: "boolean" },
|
|
30
|
-
template: { type: "string" },
|
|
31
|
-
name: { type: "string" },
|
|
32
|
-
verbose: { type: "boolean", default: false },
|
|
33
|
-
help: { type: "boolean", short: "h" },
|
|
34
|
-
version: { type: "boolean", short: "v" },
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const knownCommands = new Set([
|
|
39
|
-
"start",
|
|
40
|
-
"init",
|
|
41
|
-
"stop",
|
|
42
|
-
"attach",
|
|
43
|
-
"restart",
|
|
44
|
-
"ls",
|
|
45
|
-
"doctor",
|
|
46
|
-
"status",
|
|
47
|
-
"inspect",
|
|
48
|
-
"validate",
|
|
49
|
-
"detect",
|
|
50
|
-
"config",
|
|
51
|
-
"help",
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
// --version / -v
|
|
55
|
-
if (values.version) {
|
|
56
|
-
const require = createRequire(import.meta.url);
|
|
57
|
-
const pkg = require("../package.json");
|
|
58
|
-
console.log(`tmux-ide v${pkg.version}`);
|
|
59
|
-
process.exit(0);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (values.verbose) {
|
|
63
|
-
globalThis.__tmuxIdeVerbose = true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const firstPositional = positionals[0];
|
|
67
|
-
const hasKnownCommand = firstPositional ? knownCommands.has(firstPositional) : false;
|
|
68
|
-
const command = hasKnownCommand ? firstPositional : "start";
|
|
69
|
-
const startTargetDir = hasKnownCommand ? positionals[1] : firstPositional;
|
|
70
|
-
const json = values.json ?? false;
|
|
71
|
-
|
|
72
|
-
const noColor = "NO_COLOR" in process.env;
|
|
73
|
-
const bold = (s) => (noColor ? s : `\x1b[1m${s}\x1b[22m`);
|
|
74
|
-
const cyan = (s) => (noColor ? s : `\x1b[36m${s}\x1b[39m`);
|
|
75
|
-
const dim = (s) => (noColor ? s : `\x1b[2m${s}\x1b[22m`);
|
|
76
|
-
|
|
77
|
-
if (values.help) {
|
|
78
|
-
printHelp();
|
|
79
|
-
process.exit(0);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function printHelp() {
|
|
83
|
-
console.log(`${bold("tmux-ide")} — Terminal IDE powered by tmux
|
|
84
|
-
|
|
85
|
-
${bold("Usage:")}
|
|
86
|
-
${cyan("tmux-ide")} ${dim("Launch IDE from ide.yml")}
|
|
87
|
-
${cyan("tmux-ide <path>")} ${dim("Launch from a specific directory")}
|
|
88
|
-
${cyan("tmux-ide init")} [--template] ${dim("Scaffold a new ide.yml (auto-detects stack)")}
|
|
89
|
-
${cyan("tmux-ide stop")} ${dim("Kill the current IDE session")}
|
|
90
|
-
${cyan("tmux-ide restart")} ${dim("Stop and relaunch the IDE session")}
|
|
91
|
-
${cyan("tmux-ide attach")} ${dim("Reattach to a running session")}
|
|
92
|
-
${cyan("tmux-ide ls")} ${dim("List all tmux sessions")}
|
|
93
|
-
${cyan("tmux-ide status")} [--json] ${dim("Show session status")}
|
|
94
|
-
${cyan("tmux-ide inspect")} [--json] ${dim("Show effective config and runtime state")}
|
|
95
|
-
${cyan("tmux-ide doctor")} ${dim("Check system requirements")}
|
|
96
|
-
${cyan("tmux-ide validate")} [--json] ${dim("Validate ide.yml")}
|
|
97
|
-
${cyan("tmux-ide detect")} [--json] ${dim("Detect project stack")}
|
|
98
|
-
${cyan("tmux-ide detect --write")} ${dim("Detect and write ide.yml")}
|
|
99
|
-
${cyan("tmux-ide config")} [--json] ${dim("Dump config as JSON")}
|
|
100
|
-
${cyan("tmux-ide config set")} <path> <value>
|
|
101
|
-
${cyan("tmux-ide config add-pane")} --row <N> --title <T> [--command <C>]
|
|
102
|
-
${cyan("tmux-ide config remove-pane")} --row <N> --pane <M>
|
|
103
|
-
${cyan("tmux-ide config add-row")} [--size <percent>]
|
|
104
|
-
${cyan("tmux-ide config enable-team")} [--name <N>] ${dim("Enable agent teams")}
|
|
105
|
-
${cyan("tmux-ide config disable-team")} ${dim("Disable agent teams")}
|
|
106
|
-
|
|
107
|
-
${bold("Flags:")}
|
|
108
|
-
${cyan("--json")} ${dim("Output as JSON (all commands)")}
|
|
109
|
-
${cyan("--template <name>")} ${dim("Use specific template for init")}
|
|
110
|
-
${cyan("--write")} ${dim("Write detected config to ide.yml")}
|
|
111
|
-
${cyan("--verbose")} ${dim("Log all tmux commands (or set TMUX_IDE_DEBUG=1)")}
|
|
112
|
-
${cyan("-h, --help")} ${dim("Show usage")}
|
|
113
|
-
${cyan("-v, --version")} ${dim("Show version number")}`);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
try {
|
|
117
|
-
switch (command) {
|
|
118
|
-
case "start":
|
|
119
|
-
await launch(startTargetDir, { json });
|
|
120
|
-
break;
|
|
121
|
-
|
|
122
|
-
case "init":
|
|
123
|
-
await init({ template: values.template, json });
|
|
124
|
-
break;
|
|
125
|
-
|
|
126
|
-
case "stop":
|
|
127
|
-
await stop(positionals[1], { json });
|
|
128
|
-
break;
|
|
129
|
-
|
|
130
|
-
case "attach":
|
|
131
|
-
await attach(positionals[1], { json });
|
|
132
|
-
break;
|
|
133
|
-
|
|
134
|
-
case "restart":
|
|
135
|
-
await restart(positionals[1], { json });
|
|
136
|
-
break;
|
|
137
|
-
|
|
138
|
-
case "ls":
|
|
139
|
-
await ls({ json });
|
|
140
|
-
break;
|
|
141
|
-
|
|
142
|
-
case "doctor":
|
|
143
|
-
await doctor({ json });
|
|
144
|
-
break;
|
|
145
|
-
|
|
146
|
-
case "status":
|
|
147
|
-
await status(positionals[1], { json });
|
|
148
|
-
break;
|
|
149
|
-
|
|
150
|
-
case "inspect":
|
|
151
|
-
await inspect(positionals[1], { json });
|
|
152
|
-
break;
|
|
153
|
-
|
|
154
|
-
case "validate":
|
|
155
|
-
await validate(positionals[1], { json });
|
|
156
|
-
break;
|
|
157
|
-
|
|
158
|
-
case "detect":
|
|
159
|
-
await detect(positionals[1], { json, write: values.write });
|
|
160
|
-
break;
|
|
161
|
-
|
|
162
|
-
case "config": {
|
|
163
|
-
const sub = positionals[1]; // set, add-pane, remove-pane, add-row, or undefined (dump)
|
|
164
|
-
let action = "dump";
|
|
165
|
-
let configArgs = [];
|
|
166
|
-
|
|
167
|
-
if (sub === "set") {
|
|
168
|
-
action = "set";
|
|
169
|
-
configArgs = positionals.slice(2);
|
|
170
|
-
} else if (sub === "add-pane") {
|
|
171
|
-
action = "add-pane";
|
|
172
|
-
// Pass named flags as args array
|
|
173
|
-
configArgs = [];
|
|
174
|
-
if (values.row !== undefined) configArgs.push("--row", values.row);
|
|
175
|
-
if (values.title !== undefined) configArgs.push("--title", values.title);
|
|
176
|
-
if (values.command !== undefined) configArgs.push("--command", values.command);
|
|
177
|
-
if (values.size !== undefined) configArgs.push("--size", values.size);
|
|
178
|
-
} else if (sub === "remove-pane") {
|
|
179
|
-
action = "remove-pane";
|
|
180
|
-
configArgs = [];
|
|
181
|
-
if (values.row !== undefined) configArgs.push("--row", values.row);
|
|
182
|
-
if (values.pane !== undefined) configArgs.push("--pane", values.pane);
|
|
183
|
-
} else if (sub === "add-row") {
|
|
184
|
-
action = "add-row";
|
|
185
|
-
configArgs = [];
|
|
186
|
-
if (values.size !== undefined) configArgs.push("--size", values.size);
|
|
187
|
-
} else if (sub === "enable-team") {
|
|
188
|
-
action = "enable-team";
|
|
189
|
-
configArgs = [];
|
|
190
|
-
if (values.name !== undefined) configArgs.push("--name", values.name);
|
|
191
|
-
} else if (sub === "disable-team") {
|
|
192
|
-
action = "disable-team";
|
|
193
|
-
configArgs = [];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
await config(null, { json, action, args: configArgs });
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
case "help":
|
|
201
|
-
printHelp();
|
|
202
|
-
break;
|
|
203
|
-
|
|
204
|
-
default:
|
|
205
|
-
throw new IdeError(`Unknown command: ${command}\nRun "tmux-ide help" for usage.`, {
|
|
206
|
-
code: "USAGE",
|
|
207
|
-
exitCode: 1,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
} catch (error) {
|
|
211
|
-
if (error instanceof IdeError) {
|
|
212
|
-
printCommandError(error, { json });
|
|
213
|
-
} else {
|
|
214
|
-
throw error;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// Thin shim — delegates to cli.ts which runs natively under Bun.
|
|
3
|
+
// This file exists for backward compatibility with npm/pnpm link.
|
|
4
|
+
import "./cli.ts";
|