@treeport/treeport 0.6.1 → 0.8.3
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/dist/dist-BsLn2Gbc.js +1630 -0
- package/dist/node/cli/index.js +172 -125
- package/dist/node/server/core/launcher.js +11 -49
- package/dist/node/server/index.js +9125 -7162
- package/dist/node/server/terminal-host-entry.js +979 -0
- package/dist/{shell-integration-Be_c91lw.js → shell-integration-CPmrVa3B.js} +46 -46
- package/dist/terminal-host-protocol-DZkQRAUF.js +378 -0
- package/dist/{update-qVp7yL5D.js → update-BYHlwpAq.js} +568 -147
- package/dist/web/assets/index-BWYDUD7N.css +2 -0
- package/dist/web/assets/index-BtAAdn1A.js +84 -0
- package/dist/web/index.html +2 -2
- package/drizzle/0012_terminal_host_cutover.sql +41 -0
- package/drizzle/0013_workspace_item_order.sql +13 -0
- package/drizzle/meta/0012_snapshot.json +919 -0
- package/drizzle/meta/0013_snapshot.json +987 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +19 -13
- package/skills/treeport/SKILL.md +4 -4
- package/dist/dist-Crk_Xr82.js +0 -735
- package/dist/web/assets/index-2LLiNn3-.js +0 -146
- package/dist/web/assets/index-DmDs47YU.css +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../../../dist-
|
|
3
|
-
import { t as integrateShellLaunch } from "../../../shell-integration-
|
|
2
|
+
import "../../../dist-BsLn2Gbc.js";
|
|
3
|
+
import { t as integrateShellLaunch } from "../../../shell-integration-CPmrVa3B.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { z } from "zod";
|
|
7
6
|
import { spawn } from "node:child_process";
|
|
7
|
+
import { z } from "zod";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
//#region src/server/core/launcher.ts
|
|
10
10
|
const FORWARDED_SIGNALS = [
|
|
@@ -19,7 +19,6 @@ const launchSpecSchema = z.object({
|
|
|
19
19
|
cwd: z.string(),
|
|
20
20
|
env: z.record(z.string(), z.string()),
|
|
21
21
|
shellIntegrationDir: z.string().optional(),
|
|
22
|
-
tmuxExecutable: z.string().optional(),
|
|
23
22
|
setupTasks: z.array(z.object({
|
|
24
23
|
label: z.string(),
|
|
25
24
|
argv: z.array(z.string()),
|
|
@@ -114,7 +113,6 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
114
113
|
const stdout = dependencies.stdout ?? process.stdout;
|
|
115
114
|
const stderr = dependencies.stderr ?? process.stderr;
|
|
116
115
|
const signalSource = dependencies.signalSource ?? process;
|
|
117
|
-
const tmuxPane = dependencies.tmuxPane === void 0 ? process.env.TMUX_PANE : dependencies.tmuxPane ?? void 0;
|
|
118
116
|
if (spec.setupError) {
|
|
119
117
|
stderr.write(`[Treeport setup] ${safeDiagnostic(spec.setupError) || "setup preparation failed"}\n`);
|
|
120
118
|
return 1;
|
|
@@ -160,25 +158,9 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
160
158
|
...process.env,
|
|
161
159
|
...spec.env
|
|
162
160
|
};
|
|
163
|
-
const command = integrateShellLaunch(spec.argv, commandEnvironment, spec.shellIntegrationDir, spec.
|
|
161
|
+
const command = integrateShellLaunch(spec.argv, commandEnvironment, spec.shellIntegrationDir, Boolean(spec.shellIntegrationDir));
|
|
164
162
|
const initialTitle = spec.initialTitle ? safeDiagnostic(spec.initialTitle) : "";
|
|
165
|
-
if (initialTitle && spec.
|
|
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
|
-
}
|
|
163
|
+
if (initialTitle && spec.shellIntegrationDir) stdout.write(`\u001b]777;command;${initialTitle}\u001b\\`);
|
|
182
164
|
const result = await runChild(command.argv, {
|
|
183
165
|
cwd: spec.cwd,
|
|
184
166
|
env: command.env,
|
|
@@ -188,31 +170,8 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
188
170
|
if (result.spawnError) stderr.write(`Treeport launcher: ${safeDiagnostic(result.spawnError.message) || "spawn error"}\n`);
|
|
189
171
|
if (result.forwardedSignal && (!spec.fallbackArgv || result.forwardedSignal !== "SIGINT")) return 1;
|
|
190
172
|
if (spec.fallbackArgv) {
|
|
191
|
-
if (spec.
|
|
192
|
-
|
|
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
|
-
}
|
|
215
|
-
const fallback = integrateShellLaunch(spec.fallbackArgv, commandEnvironment, spec.shellIntegrationDir, spec.tmuxExecutable);
|
|
173
|
+
if (spec.shellIntegrationDir) stdout.write("\x1B]777;command;\x1B\\");
|
|
174
|
+
const fallback = integrateShellLaunch(spec.fallbackArgv, commandEnvironment, spec.shellIntegrationDir, Boolean(spec.shellIntegrationDir));
|
|
216
175
|
const fallbackResult = await runChild(fallback.argv, {
|
|
217
176
|
cwd: spec.cwd,
|
|
218
177
|
env: fallback.env,
|
|
@@ -246,6 +205,9 @@ async function main() {
|
|
|
246
205
|
process.exit(await runLaunchSpec(spec));
|
|
247
206
|
}
|
|
248
207
|
const invokedPath = process.argv[1];
|
|
249
|
-
if (invokedPath && path.resolve(invokedPath) === path.resolve(fileURLToPath(import.meta.url))) main()
|
|
208
|
+
if (invokedPath && path.resolve(invokedPath) === path.resolve(fileURLToPath(import.meta.url))) main().catch((error) => {
|
|
209
|
+
process.stderr.write(`Treeport launcher: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
210
|
+
process.exit(127);
|
|
211
|
+
});
|
|
250
212
|
//#endregion
|
|
251
213
|
export { runLaunchSpec };
|