@owlmeans/viable-sdk 0.1.18-rc.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 +128 -0
- package/build/api/index.d.ts +2 -0
- package/build/api/index.d.ts.map +1 -0
- package/build/api/index.js +2 -0
- package/build/api/index.js.map +1 -0
- package/build/api/remote.d.ts +14 -0
- package/build/api/remote.d.ts.map +1 -0
- package/build/api/remote.js +123 -0
- package/build/api/remote.js.map +1 -0
- package/build/consts.d.ts +47 -0
- package/build/consts.d.ts.map +1 -0
- package/build/consts.js +47 -0
- package/build/consts.js.map +1 -0
- package/build/context/index.d.ts +22 -0
- package/build/context/index.d.ts.map +1 -0
- package/build/context/index.js +92 -0
- package/build/context/index.js.map +1 -0
- package/build/errors.d.ts +21 -0
- package/build/errors.d.ts.map +1 -0
- package/build/errors.js +36 -0
- package/build/errors.js.map +1 -0
- package/build/executor/boot-check.d.ts +73 -0
- package/build/executor/boot-check.d.ts.map +1 -0
- package/build/executor/boot-check.js +155 -0
- package/build/executor/boot-check.js.map +1 -0
- package/build/executor/env.d.ts +25 -0
- package/build/executor/env.d.ts.map +1 -0
- package/build/executor/env.js +77 -0
- package/build/executor/env.js.map +1 -0
- package/build/executor/errors.d.ts +69 -0
- package/build/executor/errors.d.ts.map +1 -0
- package/build/executor/errors.js +80 -0
- package/build/executor/errors.js.map +1 -0
- package/build/executor/files.d.ts +124 -0
- package/build/executor/files.d.ts.map +1 -0
- package/build/executor/files.js +529 -0
- package/build/executor/files.js.map +1 -0
- package/build/executor/git.d.ts +52 -0
- package/build/executor/git.d.ts.map +1 -0
- package/build/executor/git.js +353 -0
- package/build/executor/git.js.map +1 -0
- package/build/executor/health.d.ts +92 -0
- package/build/executor/health.d.ts.map +1 -0
- package/build/executor/health.js +98 -0
- package/build/executor/health.js.map +1 -0
- package/build/executor/index.d.ts +39 -0
- package/build/executor/index.d.ts.map +1 -0
- package/build/executor/index.js +173 -0
- package/build/executor/index.js.map +1 -0
- package/build/executor/integrity.d.ts +17 -0
- package/build/executor/integrity.d.ts.map +1 -0
- package/build/executor/integrity.js +59 -0
- package/build/executor/integrity.js.map +1 -0
- package/build/executor/layout.d.ts +61 -0
- package/build/executor/layout.d.ts.map +1 -0
- package/build/executor/layout.js +98 -0
- package/build/executor/layout.js.map +1 -0
- package/build/executor/shell.d.ts +89 -0
- package/build/executor/shell.d.ts.map +1 -0
- package/build/executor/shell.js +280 -0
- package/build/executor/shell.js.map +1 -0
- package/build/executor/spawn.d.ts +111 -0
- package/build/executor/spawn.d.ts.map +1 -0
- package/build/executor/spawn.js +314 -0
- package/build/executor/spawn.js.map +1 -0
- package/build/harness/index.d.ts +28 -0
- package/build/harness/index.d.ts.map +1 -0
- package/build/harness/index.js +83 -0
- package/build/harness/index.js.map +1 -0
- package/build/harness/templates.d.ts +30 -0
- package/build/harness/templates.d.ts.map +1 -0
- package/build/harness/templates.js +162 -0
- package/build/harness/templates.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +12 -0
- package/build/index.js.map +1 -0
- package/build/project/env.d.ts +108 -0
- package/build/project/env.d.ts.map +1 -0
- package/build/project/env.js +233 -0
- package/build/project/env.js.map +1 -0
- package/build/project/marker.d.ts +34 -0
- package/build/project/marker.d.ts.map +1 -0
- package/build/project/marker.js +54 -0
- package/build/project/marker.js.map +1 -0
- package/build/project/setup.d.ts +62 -0
- package/build/project/setup.d.ts.map +1 -0
- package/build/project/setup.js +190 -0
- package/build/project/setup.js.map +1 -0
- package/build/run/index.d.ts +75 -0
- package/build/run/index.d.ts.map +1 -0
- package/build/run/index.js +150 -0
- package/build/run/index.js.map +1 -0
- package/build/run/serve.d.ts +18 -0
- package/build/run/serve.d.ts.map +1 -0
- package/build/run/serve.js +148 -0
- package/build/run/serve.js.map +1 -0
- package/build/run/state.d.ts +75 -0
- package/build/run/state.d.ts.map +1 -0
- package/build/run/state.js +136 -0
- package/build/run/state.js.map +1 -0
- package/build/session/index.d.ts +17 -0
- package/build/session/index.d.ts.map +1 -0
- package/build/session/index.js +226 -0
- package/build/session/index.js.map +1 -0
- package/build/session/questions.d.ts +16 -0
- package/build/session/questions.d.ts.map +1 -0
- package/build/session/questions.js +17 -0
- package/build/session/questions.js.map +1 -0
- package/build/session/queue.d.ts +54 -0
- package/build/session/queue.d.ts.map +1 -0
- package/build/session/queue.js +102 -0
- package/build/session/queue.js.map +1 -0
- package/build/session/tasks.d.ts +15 -0
- package/build/session/tasks.d.ts.map +1 -0
- package/build/session/tasks.js +16 -0
- package/build/session/tasks.js.map +1 -0
- package/build/task/driver.d.ts +30 -0
- package/build/task/driver.d.ts.map +1 -0
- package/build/task/driver.js +120 -0
- package/build/task/driver.js.map +1 -0
- package/build/task/envelope.d.ts +35 -0
- package/build/task/envelope.d.ts.map +1 -0
- package/build/task/envelope.js +230 -0
- package/build/task/envelope.js.map +1 -0
- package/build/task/index.d.ts +4 -0
- package/build/task/index.d.ts.map +1 -0
- package/build/task/index.js +4 -0
- package/build/task/index.js.map +1 -0
- package/build/task/inquiry.d.ts +53 -0
- package/build/task/inquiry.d.ts.map +1 -0
- package/build/task/inquiry.js +232 -0
- package/build/task/inquiry.js.map +1 -0
- package/build/tools/catalogue.d.ts +17 -0
- package/build/tools/catalogue.d.ts.map +1 -0
- package/build/tools/catalogue.js +1169 -0
- package/build/tools/catalogue.js.map +1 -0
- package/build/tools/index.d.ts +7 -0
- package/build/tools/index.d.ts.map +1 -0
- package/build/tools/index.js +7 -0
- package/build/tools/index.js.map +1 -0
- package/build/tools/jobs.d.ts +12 -0
- package/build/tools/jobs.d.ts.map +1 -0
- package/build/tools/jobs.js +60 -0
- package/build/tools/jobs.js.map +1 -0
- package/build/tools/mcp.d.ts +43 -0
- package/build/tools/mcp.d.ts.map +1 -0
- package/build/tools/mcp.js +131 -0
- package/build/tools/mcp.js.map +1 -0
- package/build/tools/platform.d.ts +77 -0
- package/build/tools/platform.d.ts.map +1 -0
- package/build/tools/platform.js +316 -0
- package/build/tools/platform.js.map +1 -0
- package/build/tools/refusal.d.ts +66 -0
- package/build/tools/refusal.d.ts.map +1 -0
- package/build/tools/refusal.js +377 -0
- package/build/tools/refusal.js.map +1 -0
- package/build/tools/types.d.ts +83 -0
- package/build/tools/types.d.ts.map +1 -0
- package/build/tools/types.js +38 -0
- package/build/tools/types.js.map +1 -0
- package/build/types.d.ts +174 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +105 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import p from 'node:path';
|
|
4
|
+
import { formatIntegrityReport, TARGET_BOOTCHECK_MARKER, TARGET_BOOTCHECK_PORT, TARGET_BOOTCHECK_SCHEMA } from '@owlmeans/viable-common';
|
|
5
|
+
import { probePort, readEnvFile, ROOT_ENV_FILE, serviceEndpoint } from '../project/env.js';
|
|
6
|
+
import { restartApi } from '../run/state.js';
|
|
7
|
+
import { createBootCheckJob, runBootCheck } from './boot-check.js';
|
|
8
|
+
import { backendEnv, frontendEnv } from './env.js';
|
|
9
|
+
import { verifyTarget } from './integrity.js';
|
|
10
|
+
import { apiPath, hasWorker, libraryPaths, webPath, workerPath } from './layout.js';
|
|
11
|
+
import { runCommand, runScript } from './spawn.js';
|
|
12
|
+
/**
|
|
13
|
+
* The shell half of the local executor — every `SlotShellCommand`, against a directory.
|
|
14
|
+
*
|
|
15
|
+
* The contract every method answers with is the publisher's: **error text, or `null` for
|
|
16
|
+
* success**. It is not a transcript — a command that fails returns the diagnostics a fixer or a
|
|
17
|
+
* person can act on, and a command that succeeds returns nothing at all.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* The one reason a script refuses that is NOT a verdict about the code.
|
|
21
|
+
*
|
|
22
|
+
* A build with nothing to build on is an ordinary no-op that the next trigger repeats correctly —
|
|
23
|
+
* it happens between attaching to a fresh clone and the first install. It must not be reported as
|
|
24
|
+
* a failed build, or the connector announces broken code during a window in which nothing was
|
|
25
|
+
* even attempted.
|
|
26
|
+
*/
|
|
27
|
+
export const NOT_INSTALLED_REASON = "cannot run: the target's dependencies are not installed yet";
|
|
28
|
+
/** Whether a refusal describes the code, or merely a window in which nothing ran. */
|
|
29
|
+
export const isBuildVerdict = (reason) => reason == null || !reason.includes(NOT_INSTALLED_REASON);
|
|
30
|
+
/**
|
|
31
|
+
* One boot-check job per directory.
|
|
32
|
+
*
|
|
33
|
+
* Module-level rather than per-helper because a helper is built per command: two `BootCheck`
|
|
34
|
+
* calls would otherwise each start an instance onto the same port, and a `BootCheckStatus` would
|
|
35
|
+
* read a job nobody had started.
|
|
36
|
+
*/
|
|
37
|
+
const _jobs = new Map();
|
|
38
|
+
const jobFor = (dir) => {
|
|
39
|
+
const existing = _jobs.get(dir);
|
|
40
|
+
if (existing != null)
|
|
41
|
+
return existing;
|
|
42
|
+
const job = createBootCheckJob();
|
|
43
|
+
_jobs.set(dir, job);
|
|
44
|
+
return job;
|
|
45
|
+
};
|
|
46
|
+
export const createLocalShellHelper = (fileHelper, subproject) => {
|
|
47
|
+
const root = p.resolve(fileHelper.getRootPath());
|
|
48
|
+
/**
|
|
49
|
+
* Refuse to run anything in a tree that is no longer the generated application.
|
|
50
|
+
*
|
|
51
|
+
* Every command below executes something the tree decides: `bun install` runs the lifecycle
|
|
52
|
+
* hooks a `package.json` declares, and `bun run build` runs its `scripts.build`. Both are as
|
|
53
|
+
* writable as any source file — by the editor, by the agent, and by a git merge — so the guard
|
|
54
|
+
* belongs in front of the spawn, not in front of whichever caller was considered.
|
|
55
|
+
*
|
|
56
|
+
* Returned as text rather than thrown, because that is the contract every method here already
|
|
57
|
+
* answers with. A caller needs no new branch to notice.
|
|
58
|
+
*/
|
|
59
|
+
const refusal = async (prefix = 'Refused') => {
|
|
60
|
+
const report = await verifyTarget(root);
|
|
61
|
+
return report.ok
|
|
62
|
+
? null
|
|
63
|
+
: `${prefix}: the project in this directory is not a Viable application\n`
|
|
64
|
+
+ formatIntegrityReport(report);
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Everything that must be true before a script may be spawned, in order.
|
|
68
|
+
*
|
|
69
|
+
* Each check exists because the failure it replaces lies about the cause. A missing cwd is
|
|
70
|
+
* reported by `posix_spawn` as `ENOENT … '/bin/sh'`, which sends every reader after a broken
|
|
71
|
+
* toolchain while the real fault is an initialization that never happened. A missing
|
|
72
|
+
* `node_modules/.bin` makes every `scripts.build` exit 127 with `script "build" exited with
|
|
73
|
+
* code 127`, which names the script rather than the reason and reads as a broken template.
|
|
74
|
+
*/
|
|
75
|
+
const runTargetScript = async (script, cwd, env) => {
|
|
76
|
+
if (!await fs.pathExists(cwd)) {
|
|
77
|
+
return `${script} cannot run: ${cwd} does not exist `
|
|
78
|
+
+ `— the target project was never initialized in this directory`;
|
|
79
|
+
}
|
|
80
|
+
if (!await fs.pathExists(p.resolve(root, 'node_modules', '.bin'))) {
|
|
81
|
+
return `${script} ${NOT_INSTALLED_REASON}`;
|
|
82
|
+
}
|
|
83
|
+
const refused = await refusal(`${script} refused`);
|
|
84
|
+
if (refused != null)
|
|
85
|
+
return refused;
|
|
86
|
+
return await runScript(script, cwd, env);
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Build every package this tree consumes through its `build/` output, in dependency order.
|
|
90
|
+
*
|
|
91
|
+
* Not a hard-coded `common`. v2 splits the shared code in two — `common` and the `backend`
|
|
92
|
+
* library `api` and `worker` compile against — so a type check that built only `common` ran
|
|
93
|
+
* against a stale or absent `sources/backend/build` and reported errors about the package it
|
|
94
|
+
* had just failed to build. `tsc -b` is incremental, so re-running this costs a tsbuildinfo
|
|
95
|
+
* read once the output is current.
|
|
96
|
+
*/
|
|
97
|
+
const buildLibraries = async () => {
|
|
98
|
+
for (const cwd of libraryPaths(root)) {
|
|
99
|
+
const error = await runTargetScript('build', cwd);
|
|
100
|
+
if (error != null) {
|
|
101
|
+
return error;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
};
|
|
106
|
+
const buildWorker = async () => {
|
|
107
|
+
const dir = workerPath(root);
|
|
108
|
+
if (dir == null || !hasWorker(root)) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return await runTargetScript('build', dir);
|
|
112
|
+
};
|
|
113
|
+
const helper = {
|
|
114
|
+
bun: async (args, options) => {
|
|
115
|
+
const refused = await refusal();
|
|
116
|
+
if (refused != null)
|
|
117
|
+
return refused;
|
|
118
|
+
const cmd = `bun ${args ?? 'install'}`;
|
|
119
|
+
return await runCommand(cmd, { cwd: fileHelper.getRootPath(options?.subproject ?? subproject) });
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Throw the lockfile away and install again.
|
|
123
|
+
*
|
|
124
|
+
* The truncate is the point. `bun install` on its own reproduces whatever the lockfile says,
|
|
125
|
+
* and a target's lockfile was written the day the project was created — so a framework
|
|
126
|
+
* package republished afterwards is invisible to it no matter how often the target is
|
|
127
|
+
* rebuilt. Emptied rather than deleted, matching initialization: bun reads an empty file as
|
|
128
|
+
* "no lockfile", so a failed install leaves a state the next attempt resolves cleanly instead
|
|
129
|
+
* of one where a stale lock has come back.
|
|
130
|
+
*/
|
|
131
|
+
reinstall: async () => {
|
|
132
|
+
const refused = await refusal();
|
|
133
|
+
if (refused != null)
|
|
134
|
+
return refused;
|
|
135
|
+
try {
|
|
136
|
+
await fs.writeFile(p.join(root, 'bun.lock'), '');
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// No lockfile to clear is not a failure — a tree may predate one, or have had it removed.
|
|
140
|
+
}
|
|
141
|
+
return await runCommand('bun install', { cwd: root });
|
|
142
|
+
},
|
|
143
|
+
buildCommon: async () => {
|
|
144
|
+
const refused = await refusal();
|
|
145
|
+
if (refused != null)
|
|
146
|
+
return refused;
|
|
147
|
+
return await buildLibraries();
|
|
148
|
+
},
|
|
149
|
+
validate: async (subprojectOverride) => {
|
|
150
|
+
const refused = await refusal();
|
|
151
|
+
if (refused != null)
|
|
152
|
+
return refused;
|
|
153
|
+
const libraries = await buildLibraries();
|
|
154
|
+
if (libraries != null) {
|
|
155
|
+
return libraries;
|
|
156
|
+
}
|
|
157
|
+
// The diagnostics are on stdout; `tsc`'s stderr is about the compiler, not about the code.
|
|
158
|
+
return await runCommand('bunx tsc --noEmit', {
|
|
159
|
+
cwd: fileHelper.getRootPath(subprojectOverride ?? subproject),
|
|
160
|
+
stdoutOnly: true,
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
/** The buildability check for the UI: the browser bundle really built, or the reason it did not. */
|
|
164
|
+
validateWithRenderer: async () => await buildLibraries() ?? await runTargetScript('build', webPath(root), await frontendEnv(root)),
|
|
165
|
+
/**
|
|
166
|
+
* Rebuild the whole target, in dependency order.
|
|
167
|
+
*
|
|
168
|
+
* The libraries first, because everything else resolves them from `node_modules` at RUN time
|
|
169
|
+
* and follows each to its `build/index.js` — a bundle built before them starts with
|
|
170
|
+
* `Cannot find package '<slug>-backend'`, a message about a dependency for a build that never
|
|
171
|
+
* happened. The remaining three are independent, so all of them run and their problems are
|
|
172
|
+
* reported together rather than one round trip at a time.
|
|
173
|
+
*/
|
|
174
|
+
build: async () => {
|
|
175
|
+
const libraries = await buildLibraries();
|
|
176
|
+
if (libraries != null) {
|
|
177
|
+
return libraries;
|
|
178
|
+
}
|
|
179
|
+
const errors = [
|
|
180
|
+
await runTargetScript('build', apiPath(root)),
|
|
181
|
+
await buildWorker(),
|
|
182
|
+
await runTargetScript('build', webPath(root), await frontendEnv(root)),
|
|
183
|
+
].filter((error) => error != null);
|
|
184
|
+
return errors.length > 0 ? errors.join('\n') : null;
|
|
185
|
+
},
|
|
186
|
+
/** Build the api only — the type check the frontend renderer build cannot give it. */
|
|
187
|
+
validateBackend: async () => await buildLibraries() ?? await runTargetScript('build', apiPath(root)),
|
|
188
|
+
/**
|
|
189
|
+
* Reconcile the target's database with its code.
|
|
190
|
+
*
|
|
191
|
+
* The target owns its own structure: every `@owlmeans/postgres` resource creates and updates
|
|
192
|
+
* its table while the context initializes. So a sync is not a command run against the source
|
|
193
|
+
* tree — it is *check that the database is there, then restart the backend* — and there is
|
|
194
|
+
* nothing to generate and no migration file to apply.
|
|
195
|
+
*
|
|
196
|
+
* A local target's database is the developer's. The platform provisions none, so an absent
|
|
197
|
+
* URL is reported by NAME rather than repaired: it is a line the person has to write, and
|
|
198
|
+
* "database unavailable" would send them looking at a server instead.
|
|
199
|
+
*/
|
|
200
|
+
dbSync: async () => {
|
|
201
|
+
const values = await readEnvFile(root, ROOT_ENV_FILE);
|
|
202
|
+
const url = values.DATABASE_URL ?? '';
|
|
203
|
+
if (url === '') {
|
|
204
|
+
return `DATABASE_URL is not set in ${ROOT_ENV_FILE}. A local target uses a database on `
|
|
205
|
+
+ `this machine and the platform provisions none — set it and run this again.`;
|
|
206
|
+
}
|
|
207
|
+
const endpoint = serviceEndpoint(url);
|
|
208
|
+
if (endpoint == null) {
|
|
209
|
+
return `DATABASE_URL in ${ROOT_ENV_FILE} is not a URL naming a host and a port.`;
|
|
210
|
+
}
|
|
211
|
+
if (!await probePort(endpoint.host, endpoint.port)) {
|
|
212
|
+
return `Nothing is listening at ${endpoint.host}:${endpoint.port} — `
|
|
213
|
+
+ `the database DATABASE_URL names is not reachable from this machine.`;
|
|
214
|
+
}
|
|
215
|
+
return await restartApi(root);
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* Answering, not enforcing.
|
|
219
|
+
*
|
|
220
|
+
* The connector refuses on its own before every spawn regardless; this exists so a caller can
|
|
221
|
+
* ask BEFORE letting a merge reach a build, and report the violations to the person whose
|
|
222
|
+
* repository they belong to.
|
|
223
|
+
*/
|
|
224
|
+
integrity: async () => {
|
|
225
|
+
const report = await verifyTarget(root);
|
|
226
|
+
return {
|
|
227
|
+
result: report.ok ? null : formatIntegrityReport(report),
|
|
228
|
+
ok: report.ok,
|
|
229
|
+
violations: report.violations.map(violation => `${violation.path}: ${violation.detail}`),
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* Start a real boot in isolation and return at once.
|
|
234
|
+
*
|
|
235
|
+
* A second start joins the running check rather than spawning another instance onto the port.
|
|
236
|
+
* The verdict is read with {@link bootCheckStatus}; `wait` is the legacy blocking path for a
|
|
237
|
+
* caller that predates the job.
|
|
238
|
+
*/
|
|
239
|
+
bootCheck: async (options = {}) => {
|
|
240
|
+
const job = jobFor(root);
|
|
241
|
+
job.start(async () => {
|
|
242
|
+
// `skipBuild` reaches `dist/index.js` with no build in front of it, so the guard has to be
|
|
243
|
+
// here and not only inside the build.
|
|
244
|
+
const refused = await refusal('Boot check refused');
|
|
245
|
+
if (refused != null) {
|
|
246
|
+
return { ok: false, phase: 'build', error: refused };
|
|
247
|
+
}
|
|
248
|
+
const values = await readEnvFile(root, ROOT_ENV_FILE);
|
|
249
|
+
if ((values.DATABASE_URL ?? '') === '') {
|
|
250
|
+
// Without a database the check cannot connect, and reporting that as a boot failure
|
|
251
|
+
// would blame the generated code for a target that was never configured.
|
|
252
|
+
return {
|
|
253
|
+
ok: false, phase: 'schema',
|
|
254
|
+
error: `Boot check skipped: ${ROOT_ENV_FILE} declares no DATABASE_URL`,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return await runBootCheck({
|
|
258
|
+
port: TARGET_BOOTCHECK_PORT,
|
|
259
|
+
marker: TARGET_BOOTCHECK_MARKER,
|
|
260
|
+
cwd: apiPath(root),
|
|
261
|
+
env: {
|
|
262
|
+
...await backendEnv(root),
|
|
263
|
+
BACKEND_PORT: `${TARGET_BOOTCHECK_PORT}`,
|
|
264
|
+
DATABASE_SCHEMA: TARGET_BOOTCHECK_SCHEMA,
|
|
265
|
+
},
|
|
266
|
+
bootId: randomUUID(),
|
|
267
|
+
...(options.skipBuild === true
|
|
268
|
+
? {}
|
|
269
|
+
: { build: async () => await buildLibraries() ?? await runTargetScript('build', apiPath(root)) }),
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
if (options.wait !== true)
|
|
273
|
+
return null;
|
|
274
|
+
return await job.pending() ?? job.status().report;
|
|
275
|
+
},
|
|
276
|
+
bootCheckStatus: async () => jobFor(root).status(),
|
|
277
|
+
};
|
|
278
|
+
return helper;
|
|
279
|
+
};
|
|
280
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/executor/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,OAAO,EACL,qBAAqB,EAAc,uBAAuB,EAAE,qBAAqB,EACjF,uBAAuB,EACxB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAElE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,6DAA6D,CAAA;AAEjG,qFAAqF;AACrF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAqB,EAAW,EAAE,CAC/D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7E,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Everything that starts, bounds or ends a child process on the developer's machine.
|
|
4
|
+
*
|
|
5
|
+
* Shared by the shell commands, the boot check and the local run so the three cannot disagree
|
|
6
|
+
* about what a failure looks like or when a port is free — the publisher learned both lessons the
|
|
7
|
+
* expensive way, and neither of them is about Kubernetes.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Output ceiling for every validate/build child process.
|
|
11
|
+
*
|
|
12
|
+
* Node's default is 1 MiB, and a target project with a few hundred type errors exceeds it: the
|
|
13
|
+
* child is killed and the fixer receives `stdout maxBuffer length exceeded` instead of the errors
|
|
14
|
+
* it is supposed to repair.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MAX_OUTPUT_BUFFER: number;
|
|
17
|
+
/** One-shot script ceiling. A build that outlives it is wedged, not slow. */
|
|
18
|
+
export declare const BUILD_TIMEOUT = 300000;
|
|
19
|
+
/**
|
|
20
|
+
* Compose a failed command's output into the text a fixer reads.
|
|
21
|
+
*
|
|
22
|
+
* Never interpolate the `ExecException` beside `stderr`: its string form is
|
|
23
|
+
* `Error: Command failed: <cmd>\n<stderr>`, so the naive `${stdout} ${error} ${stderr}` shape
|
|
24
|
+
* emitted every diagnostic twice and prefixed a runner sentence that is not a diagnostic at all.
|
|
25
|
+
* Both survive into the fix conversation — the duplicate doubles the prompt for nothing, and the
|
|
26
|
+
* preamble is what a model latches onto when it cannot see a real cause. Say it once, and say
|
|
27
|
+
* what actually ran only when there is nothing else to report.
|
|
28
|
+
*/
|
|
29
|
+
export declare const failureOutput: (error: unknown, stdout: string, stderr: string, cmd: string) => string;
|
|
30
|
+
export interface RunOptions {
|
|
31
|
+
cwd: string;
|
|
32
|
+
env?: Record<string, string>;
|
|
33
|
+
/** Answer with stdout alone on failure — what a type check's diagnostics are. */
|
|
34
|
+
stdoutOnly?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Run a shell command and answer "error text, or null".
|
|
38
|
+
*
|
|
39
|
+
* The one contract every shell command here shares. A caller never has to know whether the child
|
|
40
|
+
* exited non-zero, failed to spawn or produced nothing — those are all one answer.
|
|
41
|
+
*/
|
|
42
|
+
export declare const runCommand: (cmd: string, options: RunOptions) => Promise<string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Run one of the target's own `scripts.*`, bounded.
|
|
45
|
+
*
|
|
46
|
+
* `spawn` rather than `exec` because a build's output is unbounded and streaming it costs nothing,
|
|
47
|
+
* and because a wedged `bunx` resolving forever must die rather than hold the caller open. The
|
|
48
|
+
* timeout is reported as a verdict, not thrown, so it reaches the same channel a failed build does.
|
|
49
|
+
*/
|
|
50
|
+
export declare const runScript: (script: string, cwd: string, env?: Record<string, string>) => Promise<string | null>;
|
|
51
|
+
/**
|
|
52
|
+
* Bound one whole dispatch, whatever it is.
|
|
53
|
+
*
|
|
54
|
+
* Every operation below already bounds itself, but one that wedges AROUND its own bound — a lock
|
|
55
|
+
* nothing releases, a promise that never settles — holds the caller open with nothing to report,
|
|
56
|
+
* and the caller's timeout becomes the only limit. Reaching this means the operation failed to
|
|
57
|
+
* bound itself, not that it needed longer.
|
|
58
|
+
*/
|
|
59
|
+
export declare const withDeadline: <T>(label: string, ms: number, fn: () => Promise<T>) => Promise<T>;
|
|
60
|
+
/** Whether anything answers a TCP connect on a local port. */
|
|
61
|
+
export declare const probeListening: (port: number, timeoutMs?: number) => Promise<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Wait until nothing answers on a local port.
|
|
64
|
+
*
|
|
65
|
+
* The child spawned here is a shell wrapping `bun`, so the shell's exit is not proof the target is
|
|
66
|
+
* gone: a signal the shell dies from and `bun` survives leaves an orphan that still owns the port.
|
|
67
|
+
* Whether the port answers is the only fact that decides whether a replacement can bind, so a
|
|
68
|
+
* restart waits on that and never on an exit event.
|
|
69
|
+
*/
|
|
70
|
+
export declare const waitForPortFree: (port: number, timeoutMs?: number, pollMs?: number) => Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Terminate a detached child's whole process group and wait until it is actually gone.
|
|
73
|
+
*
|
|
74
|
+
* Awaiting matters: the caller restarts right after, and a process still holding the port makes
|
|
75
|
+
* the replacement lose the bind and exit — leaving nothing listening and no error anyone reads.
|
|
76
|
+
*/
|
|
77
|
+
export declare const killGroupAndWait: (proc: ChildProcess, options?: {
|
|
78
|
+
term?: number;
|
|
79
|
+
kill?: number;
|
|
80
|
+
}) => Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Take a port back from a leftover running the same command.
|
|
83
|
+
*
|
|
84
|
+
* A connector that was killed — a host restart, a Ctrl-C, a crashed run — leaves its DETACHED
|
|
85
|
+
* children alive, because detaching them is what keeps a build from dying with the tool that
|
|
86
|
+
* started it. What survives holds the target's port, and every later attempt then fails with the
|
|
87
|
+
* target's own "the api port is already in use", which reads as a defect in the generated app.
|
|
88
|
+
*
|
|
89
|
+
* Matched by the marker the spawn carries, never by the port alone: a process this connector did
|
|
90
|
+
* not start is not ours to signal, whatever it is sitting on.
|
|
91
|
+
*/
|
|
92
|
+
export declare const reclaimPort: (port: number, marker: string) => Promise<boolean>;
|
|
93
|
+
/**
|
|
94
|
+
* The pids whose command line carries a marker.
|
|
95
|
+
*
|
|
96
|
+
* `/proc` rather than `ps`, for the same reason the publisher reads it: no shell, no parsing of a
|
|
97
|
+
* format that differs per platform. Somewhere without `/proc` simply has nothing to reclaim, which
|
|
98
|
+
* is the honest answer there.
|
|
99
|
+
*/
|
|
100
|
+
export declare const findProcesses: (needles: string | string[]) => Promise<number[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Signal a process GROUP, falling back to the process.
|
|
103
|
+
*
|
|
104
|
+
* The negative pid is the point: a child spawned detached through a shell survives a signal aimed
|
|
105
|
+
* at the shell's own pid, and what survives is the `bun` process holding the port.
|
|
106
|
+
*/
|
|
107
|
+
export declare const signalGroup: (pid: number | undefined, signal: NodeJS.Signals) => boolean;
|
|
108
|
+
/** Whether a recorded pid is still a live process. */
|
|
109
|
+
export declare const isAlive: (pid: number | undefined) => boolean;
|
|
110
|
+
export declare const delay: (ms: number) => Promise<void>;
|
|
111
|
+
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/executor/spawn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAmB,CAAA;AAEjD,6EAA6E;AAC7E,eAAO,MAAM,aAAa,SAAU,CAAA;AASpC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,UACjB,OAAO,UAAU,MAAM,UAAU,MAAM,OAAO,MAAM,KAC1D,MAKF,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAe,MAAM,WAAW,UAAU,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAkBrF,CAAA;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,WACZ,MAAM,OAAO,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACxD,OAAO,CAAC,MAAM,GAAG,IAAI,CA4BtB,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAU,CAAC,SAC3B,MAAM,MAAM,MAAM,MAAM,MAAM,OAAO,CAAC,CAAC,CAAC,KAC9C,OAAO,CAAC,CAAC,CAeX,CAAA;AAED,8DAA8D;AA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