()
| 74 | }); |
| 75 | |
| 76 | const main = async (): Promise<void> => { |
| 77 | const fixture = await mkdtemp(join(tmpdir(), "executor-packed-apps-fixture-")); |
| 78 | const dataDir = await mkdtemp(join(tmpdir(), "executor-packed-apps-data-")); |
| 79 | const scopeDir = await mkdtemp(join(tmpdir(), "executor-packed-apps-scope-")); |
| 80 | let proc: Subprocess<"ignore", "pipe", "pipe"> | null = null; |
| 81 | try { |
| 82 | await mkdir(join(fixture, "tools"), { recursive: true }); |
| 83 | await writeFile( |
| 84 | join(fixture, "tools", "greet.ts"), |
| 85 | ` |
| 86 | import { z } from "zod"; |
| 87 | import { defineTool } from "executor:app"; |
| 88 | |
| 89 | const Input = z.object({ name: z.string() }); |
| 90 | |
| 91 | export default defineTool({ |
| 92 | description: "Greet", |
| 93 | input: Input, |
| 94 | async handler(input) { |
| 95 | return { greeting: "hello " + input.name }; |
| 96 | }, |
| 97 | }); |
| 98 | `, |
| 99 | ); |
| 100 | await writeFile( |
| 101 | join(fixture, "package.json"), |
| 102 | `${JSON.stringify({ name: "packed-apps-smoke", dependencies: { zod: "4.3.6" } })}\n`, |
| 103 | ); |
| 104 | await writeFile(join(fixture, "bun.lock"), ""); |
| 105 | |
| 106 | proc = spawn({ |
| 107 | cmd: [ |
| 108 | resolve(binary), |
| 109 | "daemon", |
| 110 | "run", |
| 111 | "--foreground", |
| 112 | "--port", |
| 113 | "0", |
| 114 | "--hostname", |
| 115 | "127.0.0.1", |
| 116 | "--auth-token", |
| 117 | AUTH_TOKEN, |
| 118 | ], |
| 119 | env: { |
| 120 | ...process.env, |
| 121 | EXECUTOR_CLIENT: "desktop", |
| 122 | EXECUTOR_DATA_DIR: dataDir, |
| 123 | EXECUTOR_SCOPE_DIR: scopeDir, |
| 124 | }, |
| 125 | stdin: "ignore", |
| 126 | stdout: "pipe", |
| 127 | stderr: "pipe", |
| 128 | }); |
| 129 | |
| 130 | const port = await waitForReadyPort(proc); |
| 131 | const origin = `http://127.0.0.1:${port}`; |
| 132 | console.log(`[smoke-packed-apps] ready on ${origin}`); |
| 133 |
no test coverage detected