@treeport/treeport 0.2.2 → 0.4.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 +2 -2
- package/bin/treeport.mjs +3 -1
- package/dist/{loopback-4XVZbAD1.js → loopback-D7k_J_Wl.js} +16 -11
- package/dist/node/cli/index.js +1257 -104
- package/dist/node/server/core/launcher.js +19 -2
- package/dist/node/server/index.js +469 -377
- package/dist/{shell-integration-7aBNr-p0.js → shell-integration-Be_c91lw.js} +17 -15
- package/dist/web/assets/{index-CUy0IkGL.js → index-DCtptjcH.js} +5 -5
- package/dist/web/assets/index-Wj0w0nWP.css +2 -0
- package/dist/web/index.html +2 -2
- package/dist/web/manifest.webmanifest +2 -2
- package/package.json +4 -4
- package/skills/treeport/SKILL.md +20 -20
- package/dist/web/assets/index-0q5frbNy.css +0 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as integrateShellLaunch } from "../../../shell-integration-
|
|
2
|
+
import { t as integrateShellLaunch } from "../../../shell-integration-Be_c91lw.js";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { z } from "zod";
|
|
5
6
|
import { spawn } from "node:child_process";
|
|
6
7
|
import { fileURLToPath } from "node:url";
|
|
7
8
|
//#region src/server/core/launcher.ts
|
|
@@ -10,6 +11,22 @@ const FORWARDED_SIGNALS = [
|
|
|
10
11
|
"SIGINT",
|
|
11
12
|
"SIGHUP"
|
|
12
13
|
];
|
|
14
|
+
const launchSpecSchema = z.object({
|
|
15
|
+
argv: z.array(z.string()),
|
|
16
|
+
fallbackArgv: z.array(z.string()).optional(),
|
|
17
|
+
cwd: z.string(),
|
|
18
|
+
env: z.record(z.string(), z.string()),
|
|
19
|
+
shellIntegrationDir: z.string().optional(),
|
|
20
|
+
tmuxExecutable: z.string().optional(),
|
|
21
|
+
setupTasks: z.array(z.object({
|
|
22
|
+
label: z.string(),
|
|
23
|
+
argv: z.array(z.string()),
|
|
24
|
+
cwd: z.string(),
|
|
25
|
+
env: z.record(z.string(), z.string()),
|
|
26
|
+
timeoutMs: z.number()
|
|
27
|
+
}).strict()).optional(),
|
|
28
|
+
setupError: z.string().optional()
|
|
29
|
+
}).strict();
|
|
13
30
|
function safeDiagnostic(value) {
|
|
14
31
|
return [...value].map((character) => {
|
|
15
32
|
const codePoint = character.codePointAt(0) ?? 0;
|
|
@@ -176,7 +193,7 @@ async function main() {
|
|
|
176
193
|
}
|
|
177
194
|
let spec;
|
|
178
195
|
try {
|
|
179
|
-
spec = JSON.parse(await fs.readFile(specPath, "utf8"));
|
|
196
|
+
spec = launchSpecSchema.parse(JSON.parse(await fs.readFile(specPath, "utf8")));
|
|
180
197
|
} catch (error) {
|
|
181
198
|
process.stderr.write(`Treeport launcher: cannot read launch spec: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
182
199
|
process.exit(127);
|