tmux-ide 1.3.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 +27 -14
- package/src/__tests__/support.ts +186 -0
- package/src/attach.ts +20 -0
- 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.ts +248 -0
- 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.ts +212 -0
- 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.ts +76 -0
- 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.ts +100 -0
- 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.ts +36 -0
- 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.ts +27 -0
- package/src/ls.test.ts +76 -0
- package/src/ls.ts +40 -0
- 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/dist/attach.d.ts +0 -3
- package/dist/attach.js +0 -14
- package/dist/config.d.ts +0 -5
- package/dist/config.js +0 -269
- package/dist/detect.d.ts +0 -15
- package/dist/detect.js +0 -228
- package/dist/doctor.d.ts +0 -3
- package/dist/doctor.js +0 -66
- package/dist/init.d.ts +0 -4
- package/dist/init.js +0 -67
- package/dist/inspect.d.ts +0 -54
- package/dist/inspect.js +0 -118
- package/dist/launch.d.ts +0 -22
- package/dist/launch.js +0 -174
- package/dist/lib/dot-path.d.ts +0 -2
- package/dist/lib/dot-path.js +0 -17
- package/dist/lib/errors.d.ts +0 -29
- package/dist/lib/errors.js +0 -37
- package/dist/lib/launch-plan.d.ts +0 -6
- package/dist/lib/launch-plan.js +0 -40
- package/dist/lib/output.d.ts +0 -9
- package/dist/lib/output.js +0 -65
- package/dist/lib/session-monitor.d.ts +0 -12
- package/dist/lib/session-monitor.js +0 -160
- package/dist/lib/session-options.d.ts +0 -13
- package/dist/lib/session-options.js +0 -85
- package/dist/lib/sizes.d.ts +0 -16
- package/dist/lib/sizes.js +0 -36
- package/dist/lib/tmux.d.ts +0 -42
- package/dist/lib/tmux.js +0 -225
- package/dist/lib/yaml-io.d.ts +0 -10
- package/dist/lib/yaml-io.js +0 -24
- package/dist/ls.d.ts +0 -3
- package/dist/ls.js +0 -35
- package/dist/restart.d.ts +0 -4
- package/dist/restart.js +0 -13
- package/dist/status.d.ts +0 -3
- package/dist/status.js +0 -29
- package/dist/stop.d.ts +0 -3
- package/dist/stop.js +0 -21
- package/dist/types.d.ts +0 -41
- package/dist/types.js +0 -1
- package/dist/validate.d.ts +0 -4
- package/dist/validate.js +0 -172
package/dist/validate.js
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
|
-
import { readConfig } from "./lib/yaml-io.js";
|
|
3
|
-
import { outputError } from "./lib/output.js";
|
|
4
|
-
export function validateConfig(config) {
|
|
5
|
-
const errors = [];
|
|
6
|
-
if (config == null || typeof config !== "object" || Array.isArray(config)) {
|
|
7
|
-
errors.push("config must be an object");
|
|
8
|
-
return errors;
|
|
9
|
-
}
|
|
10
|
-
const cfg = config;
|
|
11
|
-
if (cfg.name !== undefined && typeof cfg.name !== "string") {
|
|
12
|
-
errors.push("'name' must be a string");
|
|
13
|
-
}
|
|
14
|
-
if (cfg.before !== undefined && typeof cfg.before !== "string") {
|
|
15
|
-
errors.push("'before' must be a string");
|
|
16
|
-
}
|
|
17
|
-
if (!Array.isArray(cfg.rows)) {
|
|
18
|
-
errors.push("'rows' must be an array");
|
|
19
|
-
}
|
|
20
|
-
else if (cfg.rows.length === 0) {
|
|
21
|
-
errors.push("'rows' must not be empty");
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
for (let i = 0; i < cfg.rows.length; i++) {
|
|
25
|
-
const row = cfg.rows[i];
|
|
26
|
-
if (!row.panes || !Array.isArray(row.panes)) {
|
|
27
|
-
errors.push(`rows[${i}].panes must be an array`);
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (row.panes.length === 0) {
|
|
31
|
-
errors.push(`rows[${i}].panes must not be empty`);
|
|
32
|
-
}
|
|
33
|
-
if (row.size !== undefined) {
|
|
34
|
-
validateSize(row.size, `rows[${i}].size`, errors);
|
|
35
|
-
}
|
|
36
|
-
for (let j = 0; j < row.panes.length; j++) {
|
|
37
|
-
const pane = row.panes[j];
|
|
38
|
-
if (pane.title !== undefined && typeof pane.title !== "string") {
|
|
39
|
-
errors.push(`rows[${i}].panes[${j}].title must be a string`);
|
|
40
|
-
}
|
|
41
|
-
if (pane.command !== undefined && typeof pane.command !== "string") {
|
|
42
|
-
errors.push(`rows[${i}].panes[${j}].command must be a string`);
|
|
43
|
-
}
|
|
44
|
-
if (pane.dir !== undefined && typeof pane.dir !== "string") {
|
|
45
|
-
errors.push(`rows[${i}].panes[${j}].dir must be a string`);
|
|
46
|
-
}
|
|
47
|
-
if (pane.focus !== undefined && typeof pane.focus !== "boolean") {
|
|
48
|
-
errors.push(`rows[${i}].panes[${j}].focus must be a boolean`);
|
|
49
|
-
}
|
|
50
|
-
if (pane.env !== undefined) {
|
|
51
|
-
if (pane.env == null || typeof pane.env !== "object" || Array.isArray(pane.env)) {
|
|
52
|
-
errors.push(`rows[${i}].panes[${j}].env must be an object`);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
for (const [key, val] of Object.entries(pane.env)) {
|
|
56
|
-
if (typeof val !== "string" && typeof val !== "number") {
|
|
57
|
-
errors.push(`rows[${i}].panes[${j}].env.${key} must be a string or number`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (pane.size !== undefined) {
|
|
63
|
-
validateSize(pane.size, `rows[${i}].panes[${j}].size`, errors);
|
|
64
|
-
}
|
|
65
|
-
if (pane.role !== undefined) {
|
|
66
|
-
if (pane.role !== "lead" && pane.role !== "teammate") {
|
|
67
|
-
errors.push(`rows[${i}].panes[${j}].role must be "lead" or "teammate"`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (pane.task !== undefined && typeof pane.task !== "string") {
|
|
71
|
-
errors.push(`rows[${i}].panes[${j}].task must be a string`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Check multiple focus panes in this row
|
|
75
|
-
const focusCount = row.panes.filter((p) => p.focus === true).length;
|
|
76
|
-
if (focusCount > 1) {
|
|
77
|
-
errors.push(`Row ${i} has ${focusCount} panes with focus: true (max 1)`);
|
|
78
|
-
}
|
|
79
|
-
// Check pane sizes sum within this row
|
|
80
|
-
const paneSizes = row.panes
|
|
81
|
-
.map((p) => p.size)
|
|
82
|
-
.filter((s) => typeof s === "string" && /^[1-9]\d*%$/.test(s))
|
|
83
|
-
.map((s) => parseInt(s, 10));
|
|
84
|
-
const paneSum = paneSizes.reduce((a, b) => a + b, 0);
|
|
85
|
-
if (paneSum > 100) {
|
|
86
|
-
errors.push(`Row ${i} pane sizes sum to ${paneSum}%, which exceeds 100%`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Check row sizes sum
|
|
90
|
-
const rowSizes = cfg.rows
|
|
91
|
-
.map((r) => r.size)
|
|
92
|
-
.filter((s) => typeof s === "string" && /^[1-9]\d*%$/.test(s))
|
|
93
|
-
.map((s) => parseInt(s, 10));
|
|
94
|
-
const rowSum = rowSizes.reduce((a, b) => a + b, 0);
|
|
95
|
-
if (rowSum > 100) {
|
|
96
|
-
errors.push(`Row sizes sum to ${rowSum}%, which exceeds 100%`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// Validate team config
|
|
100
|
-
if (cfg.team !== undefined) {
|
|
101
|
-
if (cfg.team == null || typeof cfg.team !== "object" || Array.isArray(cfg.team)) {
|
|
102
|
-
errors.push("'team' must be an object");
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
const team = cfg.team;
|
|
106
|
-
if (team.name === undefined) {
|
|
107
|
-
errors.push("'team.name' is required when team is specified");
|
|
108
|
-
}
|
|
109
|
-
else if (typeof team.name !== "string") {
|
|
110
|
-
errors.push("'team.name' must be a string");
|
|
111
|
-
}
|
|
112
|
-
if (team.model !== undefined && typeof team.model !== "string") {
|
|
113
|
-
errors.push("'team.model' must be a string");
|
|
114
|
-
}
|
|
115
|
-
if (team.permissions !== undefined && !Array.isArray(team.permissions)) {
|
|
116
|
-
errors.push("'team.permissions' must be an array");
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (cfg.theme !== undefined) {
|
|
121
|
-
if (cfg.theme == null || typeof cfg.theme !== "object" || Array.isArray(cfg.theme)) {
|
|
122
|
-
errors.push("'theme' must be an object");
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
const theme = cfg.theme;
|
|
126
|
-
for (const key of ["accent", "border", "bg", "fg"]) {
|
|
127
|
-
if (theme[key] !== undefined && typeof theme[key] !== "string") {
|
|
128
|
-
errors.push(`theme.${key} must be a string`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return errors;
|
|
134
|
-
}
|
|
135
|
-
function validateSize(value, path, errors) {
|
|
136
|
-
const s = String(value);
|
|
137
|
-
if (!/^[1-9]\d*%$/.test(s)) {
|
|
138
|
-
errors.push(`${path} "${value}" must be a percentage (e.g. "50%")`);
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const num = parseInt(s, 10);
|
|
142
|
-
if (num > 100) {
|
|
143
|
-
errors.push(`${path} must not exceed 100%`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
export async function validate(targetDir, { json } = {}) {
|
|
147
|
-
const dir = resolve(targetDir ?? ".");
|
|
148
|
-
let config;
|
|
149
|
-
try {
|
|
150
|
-
({ config } = readConfig(dir));
|
|
151
|
-
}
|
|
152
|
-
catch (e) {
|
|
153
|
-
outputError(`Cannot read ide.yml: ${e.message}`, "READ_ERROR");
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const errors = validateConfig(config);
|
|
157
|
-
const valid = errors.length === 0;
|
|
158
|
-
if (json) {
|
|
159
|
-
console.log(JSON.stringify({ valid, errors }, null, 2));
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (valid) {
|
|
163
|
-
console.log("✓ ide.yml is valid");
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
console.log("✗ ide.yml has errors:");
|
|
167
|
-
for (const e of errors) {
|
|
168
|
-
console.log(` - ${e}`);
|
|
169
|
-
}
|
|
170
|
-
process.exitCode = 1;
|
|
171
|
-
}
|
|
172
|
-
}
|