@treeport/treeport 0.4.0 → 0.6.1
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 +1 -1
- package/bin/treeport.mjs +26 -1
- package/dist/dist-Crk_Xr82.js +735 -0
- package/dist/node/cli/index.js +184 -1596
- package/dist/node/server/core/launcher.js +45 -0
- package/dist/node/server/index.js +3530 -446
- package/dist/update-qVp7yL5D.js +2716 -0
- package/dist/web/assets/index-2LLiNn3-.js +146 -0
- package/dist/web/assets/index-DmDs47YU.css +2 -0
- package/dist/web/index.html +2 -2
- package/drizzle/0008_recent_project_visibility.sql +4 -0
- package/drizzle/0009_open_folders.sql +148 -0
- package/drizzle/0010_browser_panels_and_permissions.sql +21 -0
- package/drizzle/0011_free_magdalene.sql +1 -0
- package/drizzle/meta/0008_snapshot.json +792 -0
- package/drizzle/meta/0009_snapshot.json +804 -0
- package/drizzle/meta/0010_snapshot.json +923 -0
- package/drizzle/meta/0011_snapshot.json +931 -0
- package/drizzle/meta/_journal.json +28 -0
- package/package.json +6 -3
- package/skills/treeport/SKILL.md +71 -6
- package/dist/loopback-D7k_J_Wl.js +0 -412
- package/dist/web/assets/index-DCtptjcH.js +0 -146
- package/dist/web/assets/index-Wj0w0nWP.css +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import "../../../dist-Crk_Xr82.js";
|
|
2
3
|
import { t as integrateShellLaunch } from "../../../shell-integration-Be_c91lw.js";
|
|
3
4
|
import fs from "node:fs/promises";
|
|
4
5
|
import path from "node:path";
|
|
@@ -13,6 +14,7 @@ const FORWARDED_SIGNALS = [
|
|
|
13
14
|
];
|
|
14
15
|
const launchSpecSchema = z.object({
|
|
15
16
|
argv: z.array(z.string()),
|
|
17
|
+
initialTitle: z.string().trim().min(1).max(120).optional(),
|
|
16
18
|
fallbackArgv: z.array(z.string()).optional(),
|
|
17
19
|
cwd: z.string(),
|
|
18
20
|
env: z.record(z.string(), z.string()),
|
|
@@ -112,6 +114,7 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
112
114
|
const stdout = dependencies.stdout ?? process.stdout;
|
|
113
115
|
const stderr = dependencies.stderr ?? process.stderr;
|
|
114
116
|
const signalSource = dependencies.signalSource ?? process;
|
|
117
|
+
const tmuxPane = dependencies.tmuxPane === void 0 ? process.env.TMUX_PANE : dependencies.tmuxPane ?? void 0;
|
|
115
118
|
if (spec.setupError) {
|
|
116
119
|
stderr.write(`[Treeport setup] ${safeDiagnostic(spec.setupError) || "setup preparation failed"}\n`);
|
|
117
120
|
return 1;
|
|
@@ -158,6 +161,24 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
158
161
|
...spec.env
|
|
159
162
|
};
|
|
160
163
|
const command = integrateShellLaunch(spec.argv, commandEnvironment, spec.shellIntegrationDir, spec.tmuxExecutable);
|
|
164
|
+
const initialTitle = spec.initialTitle ? safeDiagnostic(spec.initialTitle) : "";
|
|
165
|
+
if (initialTitle && spec.tmuxExecutable && tmuxPane) {
|
|
166
|
+
if ((await runChild([
|
|
167
|
+
spec.tmuxExecutable,
|
|
168
|
+
"set-option",
|
|
169
|
+
"-p",
|
|
170
|
+
"-t",
|
|
171
|
+
tmuxPane,
|
|
172
|
+
"--",
|
|
173
|
+
"@treeport-command",
|
|
174
|
+
initialTitle
|
|
175
|
+
], {
|
|
176
|
+
cwd: spec.cwd,
|
|
177
|
+
env: process.env,
|
|
178
|
+
spawnProcess,
|
|
179
|
+
signalSource
|
|
180
|
+
})).forwardedSignal) return 1;
|
|
181
|
+
}
|
|
161
182
|
const result = await runChild(command.argv, {
|
|
162
183
|
cwd: spec.cwd,
|
|
163
184
|
env: command.env,
|
|
@@ -167,6 +188,30 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
167
188
|
if (result.spawnError) stderr.write(`Treeport launcher: ${safeDiagnostic(result.spawnError.message) || "spawn error"}\n`);
|
|
168
189
|
if (result.forwardedSignal && (!spec.fallbackArgv || result.forwardedSignal !== "SIGINT")) return 1;
|
|
169
190
|
if (spec.fallbackArgv) {
|
|
191
|
+
if (spec.tmuxExecutable && tmuxPane && spec.fallbackArgv[0]) {
|
|
192
|
+
if ((await runChild([
|
|
193
|
+
spec.tmuxExecutable,
|
|
194
|
+
"set-option",
|
|
195
|
+
"-p",
|
|
196
|
+
"-u",
|
|
197
|
+
"-t",
|
|
198
|
+
tmuxPane,
|
|
199
|
+
"@treeport-command",
|
|
200
|
+
";",
|
|
201
|
+
"set-option",
|
|
202
|
+
"-p",
|
|
203
|
+
"-t",
|
|
204
|
+
tmuxPane,
|
|
205
|
+
"--",
|
|
206
|
+
"@treeport-fallback-shell",
|
|
207
|
+
Buffer.from(JSON.stringify(spec.fallbackArgv[0]), "utf8").toString("base64url")
|
|
208
|
+
], {
|
|
209
|
+
cwd: spec.cwd,
|
|
210
|
+
env: process.env,
|
|
211
|
+
spawnProcess,
|
|
212
|
+
signalSource
|
|
213
|
+
})).forwardedSignal) return 1;
|
|
214
|
+
}
|
|
170
215
|
const fallback = integrateShellLaunch(spec.fallbackArgv, commandEnvironment, spec.shellIntegrationDir, spec.tmuxExecutable);
|
|
171
216
|
const fallbackResult = await runChild(fallback.argv, {
|
|
172
217
|
cwd: spec.cwd,
|