@treeport/treeport 0.5.0 → 0.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 +1 -1
- package/bin/treeport.mjs +26 -1
- package/dist/dist-BsLn2Gbc.js +1630 -0
- package/dist/node/cli/index.js +226 -73
- package/dist/node/server/core/launcher.js +13 -22
- package/dist/node/server/index.js +10440 -5957
- package/dist/node/server/terminal-host-entry.js +962 -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-BW-a6Bd-.js → update-UYS2lMdD.js} +86 -447
- package/dist/web/assets/index-BWYDUD7N.css +2 -0
- package/dist/web/assets/index-C5cx0N4G.js +84 -0
- package/dist/web/index.html +2 -2
- package/drizzle/0010_browser_panels_and_permissions.sql +21 -0
- package/drizzle/0011_free_magdalene.sql +1 -0
- package/drizzle/0012_terminal_host_cutover.sql +41 -0
- package/drizzle/0013_workspace_item_order.sql +13 -0
- package/drizzle/meta/0010_snapshot.json +923 -0
- package/drizzle/meta/0011_snapshot.json +931 -0
- package/drizzle/meta/0012_snapshot.json +919 -0
- package/drizzle/meta/0013_snapshot.json +987 -0
- package/drizzle/meta/_journal.json +28 -0
- package/package.json +21 -13
- package/skills/treeport/SKILL.md +62 -6
- package/dist/web/assets/index-Cr4UkmRD.js +0 -146
- package/dist/web/assets/index-he-SubzL.css +0 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import "../../../dist-BsLn2Gbc.js";
|
|
3
|
+
import { t as integrateShellLaunch } from "../../../shell-integration-CPmrVa3B.js";
|
|
3
4
|
import fs from "node:fs/promises";
|
|
4
5
|
import path from "node:path";
|
|
5
|
-
import { z } from "zod";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
|
+
import { z } from "zod";
|
|
7
8
|
import { fileURLToPath } from "node:url";
|
|
8
9
|
//#region src/server/core/launcher.ts
|
|
9
10
|
const FORWARDED_SIGNALS = [
|
|
@@ -13,11 +14,11 @@ 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()),
|
|
19
21
|
shellIntegrationDir: z.string().optional(),
|
|
20
|
-
tmuxExecutable: z.string().optional(),
|
|
21
22
|
setupTasks: z.array(z.object({
|
|
22
23
|
label: z.string(),
|
|
23
24
|
argv: z.array(z.string()),
|
|
@@ -112,7 +113,6 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
112
113
|
const stdout = dependencies.stdout ?? process.stdout;
|
|
113
114
|
const stderr = dependencies.stderr ?? process.stderr;
|
|
114
115
|
const signalSource = dependencies.signalSource ?? process;
|
|
115
|
-
const tmuxPane = dependencies.tmuxPane === void 0 ? process.env.TMUX_PANE : dependencies.tmuxPane ?? void 0;
|
|
116
116
|
if (spec.setupError) {
|
|
117
117
|
stderr.write(`[Treeport setup] ${safeDiagnostic(spec.setupError) || "setup preparation failed"}\n`);
|
|
118
118
|
return 1;
|
|
@@ -158,7 +158,9 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
158
158
|
...process.env,
|
|
159
159
|
...spec.env
|
|
160
160
|
};
|
|
161
|
-
const command = integrateShellLaunch(spec.argv, commandEnvironment, spec.shellIntegrationDir, spec.
|
|
161
|
+
const command = integrateShellLaunch(spec.argv, commandEnvironment, spec.shellIntegrationDir, Boolean(spec.shellIntegrationDir));
|
|
162
|
+
const initialTitle = spec.initialTitle ? safeDiagnostic(spec.initialTitle) : "";
|
|
163
|
+
if (initialTitle && spec.shellIntegrationDir) stdout.write(`\u001b]777;command;${initialTitle}\u001b\\`);
|
|
162
164
|
const result = await runChild(command.argv, {
|
|
163
165
|
cwd: spec.cwd,
|
|
164
166
|
env: command.env,
|
|
@@ -168,22 +170,8 @@ async function runLaunchSpec(spec, dependencies = {}) {
|
|
|
168
170
|
if (result.spawnError) stderr.write(`Treeport launcher: ${safeDiagnostic(result.spawnError.message) || "spawn error"}\n`);
|
|
169
171
|
if (result.forwardedSignal && (!spec.fallbackArgv || result.forwardedSignal !== "SIGINT")) return 1;
|
|
170
172
|
if (spec.fallbackArgv) {
|
|
171
|
-
if (spec.
|
|
172
|
-
|
|
173
|
-
"set-option",
|
|
174
|
-
"-p",
|
|
175
|
-
"-t",
|
|
176
|
-
tmuxPane,
|
|
177
|
-
"--",
|
|
178
|
-
"@treeport-fallback-shell",
|
|
179
|
-
Buffer.from(JSON.stringify(spec.fallbackArgv[0]), "utf8").toString("base64url")
|
|
180
|
-
], {
|
|
181
|
-
cwd: spec.cwd,
|
|
182
|
-
env: process.env,
|
|
183
|
-
spawnProcess,
|
|
184
|
-
signalSource
|
|
185
|
-
});
|
|
186
|
-
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));
|
|
187
175
|
const fallbackResult = await runChild(fallback.argv, {
|
|
188
176
|
cwd: spec.cwd,
|
|
189
177
|
env: fallback.env,
|
|
@@ -217,6 +205,9 @@ async function main() {
|
|
|
217
205
|
process.exit(await runLaunchSpec(spec));
|
|
218
206
|
}
|
|
219
207
|
const invokedPath = process.argv[1];
|
|
220
|
-
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
|
+
});
|
|
221
212
|
//#endregion
|
|
222
213
|
export { runLaunchSpec };
|