openship 0.2.3 → 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.
Files changed (82) hide show
  1. package/README.md +104 -61
  2. package/dist/bare-ITM45QBX.js +18 -0
  3. package/dist/bowser-MFQA6OS4.js +2821 -0
  4. package/dist/chunk-3U4SPZD5.js +241 -0
  5. package/dist/chunk-46YJFP4S.js +1771 -0
  6. package/dist/chunk-4CQWT2WL.js +116 -0
  7. package/dist/chunk-4FABQGQP.js +23 -0
  8. package/dist/chunk-4LEL3H2Z.js +84 -0
  9. package/dist/chunk-4MG3BVHE.js +326 -0
  10. package/dist/chunk-4VNS5WPM.js +42 -0
  11. package/dist/chunk-5N7VUGL6.js +2094 -0
  12. package/dist/chunk-5ZCKQ2MI.js +1360 -0
  13. package/dist/chunk-6ERIMTBC.js +1412 -0
  14. package/dist/chunk-7UOB5GGQ.js +132 -0
  15. package/dist/chunk-BUBSSKO6.js +1384 -0
  16. package/dist/chunk-E6W2JMMU.js +341 -0
  17. package/dist/chunk-E77LJWJK.js +1535 -0
  18. package/dist/chunk-F4DFVG6Q.js +573 -0
  19. package/dist/chunk-HFYDYK4D.js +1092 -0
  20. package/dist/chunk-JR2OCMJA.js +46 -0
  21. package/dist/chunk-JUJBBF5U.js +746 -0
  22. package/dist/chunk-JZLNHGLW.js +19145 -0
  23. package/dist/chunk-KD7VO4LG.js +2617 -0
  24. package/dist/chunk-LBFH7THC.js +435 -0
  25. package/dist/chunk-NB2VEIWG.js +129 -0
  26. package/dist/chunk-OJE6YWPQ.js +2866 -0
  27. package/dist/chunk-QKFRZNKN.js +4941 -0
  28. package/dist/chunk-RBZPFTHV.js +13354 -0
  29. package/dist/chunk-S6DSRLNE.js +121 -0
  30. package/dist/chunk-TEYJYSMT.js +409 -0
  31. package/dist/chunk-U2DPZSXA.js +112 -0
  32. package/dist/chunk-WJPCBU7Z.js +3147 -0
  33. package/dist/chunk-XIFRMKYT.js +13 -0
  34. package/dist/chunk-XVSAUO2I.js +7946 -0
  35. package/dist/chunk-Y37KHU7L.js +31 -0
  36. package/dist/chunk-YL67EWYZ.js +416 -0
  37. package/dist/chunk-ZKJOFWBJ.js +1879 -0
  38. package/dist/cloud-JMPHO3CW.js +7 -0
  39. package/dist/cloud-W5G6YXAY.js +24 -0
  40. package/dist/dist-L3MPOWCA.js +65 -0
  41. package/dist/dist-es-4C322O5D.js +22 -0
  42. package/dist/dist-es-GTAMF674.js +87 -0
  43. package/dist/dist-es-KE56MWYO.js +169 -0
  44. package/dist/dist-es-NRZIQY5B.js +484 -0
  45. package/dist/dist-es-WZCR7DHQ.js +317 -0
  46. package/dist/dist-es-XQCOTGC7.js +376 -0
  47. package/dist/dist-es-ZW3HFQUM.js +69 -0
  48. package/dist/docker-3FVJMFC3.js +12 -0
  49. package/dist/docker-edge-executor-ZIWAZWPL.js +9 -0
  50. package/dist/edge-import-53M5DGWZ.js +39 -0
  51. package/dist/event-streams-7LGDL56D.js +42 -0
  52. package/dist/executor-J7BHW5HF.js +26 -0
  53. package/dist/index.js +2459 -3461
  54. package/dist/loadSso-N273C5I7.js +577 -0
  55. package/dist/nginx-YZWKYKQU.js +16 -0
  56. package/dist/noop-RRNCIUI5.js +7 -0
  57. package/dist/openresty-lua-HAO4EUDY.js +32 -0
  58. package/dist/server/index.js +217916 -205055
  59. package/dist/server/migrations/0057_complete_prism.sql +18 -0
  60. package/dist/server/migrations/0058_add_server_is_local.sql +1 -0
  61. package/dist/server/migrations/0059_legal_fixer.sql +18 -0
  62. package/dist/server/migrations/0060_add_route_strategy_host_port.sql +3 -0
  63. package/dist/server/migrations/0061_notification_default_multi_kind.sql +3 -0
  64. package/dist/server/migrations/0062_add_incoming_webhook.sql +21 -0
  65. package/dist/server/migrations/0063_add_migration_logs.sql +1 -0
  66. package/dist/server/migrations/0064_add_migration_partial.sql +2 -0
  67. package/dist/server/migrations/0065_custom_app_template.sql +14 -0
  68. package/dist/server/migrations/0066_ensure_migration_partial_columns.sql +2 -0
  69. package/dist/server/migrations/0067_webhook_delivery.sql +28 -0
  70. package/dist/server/migrations/0068_add_migration_target_volumes.sql +1 -0
  71. package/dist/server/migrations/0069_add_project_composite_routes.sql +1 -0
  72. package/dist/server/migrations/0070_forward_git_to_server.sql +1 -0
  73. package/dist/server/migrations/meta/0057_snapshot.json +9326 -0
  74. package/dist/server/migrations/meta/0058_snapshot.json +9333 -0
  75. package/dist/server/migrations/meta/0059_snapshot.json +9495 -0
  76. package/dist/server/migrations/meta/0060_snapshot.json +9515 -0
  77. package/dist/server/migrations/meta/_journal.json +99 -1
  78. package/dist/setup-5X3WEEHA.js +14 -0
  79. package/dist/signin-DR462ERO.js +663 -0
  80. package/dist/sso-oidc-VBZLJUK5.js +830 -0
  81. package/dist/sts-EJLZ4Z77.js +1422 -0
  82. package/package.json +6 -2
@@ -0,0 +1,31 @@
1
+ // ../../packages/adapters/src/infra/cloud.ts
2
+ var CloudInfraProvider = class {
3
+ client;
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ // ── Routing ──────────────────────────────────────────────────────────
8
+ async registerRoute(route) {
9
+ void route;
10
+ }
11
+ async removeRoute(domain) {
12
+ void domain;
13
+ }
14
+ // ── SSL ──────────────────────────────────────────────────────────────
15
+ async provisionCert(domain) {
16
+ return { domain, expiresAt: "", issuer: "oblien", verified: false };
17
+ }
18
+ async renewCert(domain) {
19
+ return { domain, expiresAt: "", issuer: "oblien", verified: false };
20
+ }
21
+ async verifyCert(domain) {
22
+ return { domain, expiresAt: "", issuer: "oblien", verified: false };
23
+ }
24
+ async installCert(_domain, _cert) {
25
+ throw new Error("Manual certificates are not supported on Openship Cloud");
26
+ }
27
+ };
28
+
29
+ export {
30
+ CloudInfraProvider
31
+ };
@@ -0,0 +1,416 @@
1
+ import {
2
+ getTarCreateEnv,
3
+ prepareSourceTarArgs
4
+ } from "./chunk-4MG3BVHE.js";
5
+ import {
6
+ TRANSFER_EXCLUDES,
7
+ packageManagerEnsureCommand,
8
+ safeErrorMessage
9
+ } from "./chunk-JZLNHGLW.js";
10
+
11
+ // ../../packages/adapters/src/runtime/git-clone.ts
12
+ function sq(value) {
13
+ return `'${value.replace(/'/g, "'\\''")}'`;
14
+ }
15
+ function injectGitToken(repoUrl, token) {
16
+ if (!token) return repoUrl;
17
+ try {
18
+ const url = new URL(repoUrl);
19
+ if (url.protocol !== "https:") return repoUrl;
20
+ url.username = "x-access-token";
21
+ url.password = token;
22
+ return url.toString();
23
+ } catch {
24
+ return repoUrl;
25
+ }
26
+ }
27
+ function toGitHubSshUrl(repoUrl) {
28
+ try {
29
+ const url = new URL(repoUrl);
30
+ const host = url.hostname;
31
+ const repoPath = url.pathname.replace(/^\/+/, "").replace(/\.git$/, "");
32
+ return `git@${host}:${repoPath}.git`;
33
+ } catch {
34
+ return repoUrl;
35
+ }
36
+ }
37
+ var TERMINAL_PROMPT = ["GIT_TERMINAL_PROMPT", "0", false];
38
+ function invocation(cloneUrl, entries, disableHelper) {
39
+ return {
40
+ cloneUrl,
41
+ gitEnv: entries.map(([k, v, q]) => `${k}=${q ? sq(v) : v}`).join(" "),
42
+ credFlag: disableHelper ? "-c credential.helper=" : "",
43
+ env: Object.fromEntries(entries.map(([k, v]) => [k, v])),
44
+ credArgs: disableHelper ? ["-c", "credential.helper="] : []
45
+ };
46
+ }
47
+ function assertNotOptionLike(repoUrl) {
48
+ if (repoUrl.trimStart().startsWith("-")) {
49
+ throw new Error(
50
+ `Refusing to clone from ${JSON.stringify(repoUrl)}: a repository URL must not start with "-" (git would read it as an option).`
51
+ );
52
+ }
53
+ }
54
+ function assembleGitClone(auth) {
55
+ assertNotOptionLike(auth.repoUrl);
56
+ if (auth.ssh) {
57
+ const sshCmd = `ssh -i ${sq(auth.ssh.keyFile)} -o IdentitiesOnly=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=${sq(auth.ssh.knownHostsFile)}`;
58
+ return invocation(
59
+ toGitHubSshUrl(auth.repoUrl),
60
+ [TERMINAL_PROMPT, ["GIT_SSH_COMMAND", sshCmd, true]],
61
+ false
62
+ );
63
+ }
64
+ if (auth.gitCredentialHelperPath) {
65
+ return invocation(
66
+ auth.repoUrl,
67
+ [
68
+ TERMINAL_PROMPT,
69
+ ["GIT_CONFIG_COUNT", "2", false],
70
+ ["GIT_CONFIG_KEY_0", "credential.helper", false],
71
+ ["GIT_CONFIG_VALUE_0", auth.gitCredentialHelperPath, true],
72
+ ["GIT_CONFIG_KEY_1", "credential.useHttpPath", false],
73
+ ["GIT_CONFIG_VALUE_1", "true", false]
74
+ ],
75
+ false
76
+ );
77
+ }
78
+ if (auth.ambient) {
79
+ if (auth.ambient.via === "ssh") {
80
+ return invocation(toGitHubSshUrl(auth.repoUrl), [TERMINAL_PROMPT], false);
81
+ }
82
+ if (auth.ambient.via === "gh") {
83
+ return invocation(
84
+ auth.repoUrl,
85
+ [
86
+ TERMINAL_PROMPT,
87
+ ["GIT_CONFIG_COUNT", "1", false],
88
+ ["GIT_CONFIG_KEY_0", "credential.helper", false],
89
+ ["GIT_CONFIG_VALUE_0", "!gh auth git-credential", true]
90
+ ],
91
+ false
92
+ );
93
+ }
94
+ return invocation(auth.repoUrl, [TERMINAL_PROMPT], false);
95
+ }
96
+ return invocation(
97
+ injectGitToken(auth.repoUrl, auth.gitToken),
98
+ [TERMINAL_PROMPT, ["GIT_ASKPASS", "/bin/echo", false]],
99
+ true
100
+ );
101
+ }
102
+
103
+ // ../../packages/adapters/src/runtime/git-ssh-material.ts
104
+ import { mkdir, rm, writeFile } from "fs/promises";
105
+ async function materializeGitSsh(writer, dir, gitSsh) {
106
+ const keyFile = `${dir}/id`;
107
+ const knownHostsFile = `${dir}/known_hosts`;
108
+ await writer.ensureDir(dir);
109
+ try {
110
+ await writer.writeSecret(keyFile, gitSsh.privateKey);
111
+ await writer.writeSecret(knownHostsFile, gitSsh.knownHosts);
112
+ } catch (err) {
113
+ await writer.remove(dir);
114
+ throw err;
115
+ }
116
+ return {
117
+ keyFile,
118
+ knownHostsFile,
119
+ cleanup: () => writer.remove(dir)
120
+ };
121
+ }
122
+ function shellGitSshWriter(io) {
123
+ return {
124
+ ensureDir: async (dir) => {
125
+ await io.exec(`mkdir -p ${sq(dir)} && chmod 700 ${sq(dir)}`);
126
+ },
127
+ writeSecret: async (path, content) => {
128
+ await io.writeSecret(path, content);
129
+ await io.exec(`chmod 600 ${sq(path)}`);
130
+ },
131
+ remove: async (dir) => {
132
+ await io.exec(`rm -rf ${sq(dir)}`).catch(() => {
133
+ });
134
+ }
135
+ };
136
+ }
137
+ function localGitSshWriter() {
138
+ return {
139
+ ensureDir: (dir) => mkdir(dir, { recursive: true, mode: 448 }).then(() => {
140
+ }),
141
+ writeSecret: (path, content) => writeFile(path, content, { mode: 384 }),
142
+ remove: (dir) => rm(dir, { recursive: true, force: true }).catch(() => {
143
+ })
144
+ };
145
+ }
146
+
147
+ // ../../packages/adapters/src/runtime/build-pipeline.ts
148
+ var BuildLogger = class {
149
+ constructor(onLog) {
150
+ this.onLog = onLog;
151
+ }
152
+ /** Emit a plain log line. */
153
+ log(message, level = "info", meta) {
154
+ this.onLog?.({ timestamp: (/* @__PURE__ */ new Date()).toISOString(), message, level, ...meta });
155
+ }
156
+ /** Emit a step lifecycle event (running / completed / failed / skipped). */
157
+ step(step, status, message) {
158
+ this.onLog?.({
159
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
160
+ message,
161
+ level: status === "failed" ? "error" : "info",
162
+ step,
163
+ stepStatus: status
164
+ });
165
+ }
166
+ /**
167
+ * Run a step: emit running → execute → emit completed/failed.
168
+ * Throws on failure so the caller can handle it.
169
+ */
170
+ async runStep(step, label, fn) {
171
+ this.step(step, "running", label);
172
+ try {
173
+ await fn();
174
+ this.step(step, "completed", `${label} - done`);
175
+ } catch (err) {
176
+ const msg = safeErrorMessage(err);
177
+ this.step(step, "failed", `${label} - ${msg}`);
178
+ throw err;
179
+ }
180
+ }
181
+ /** Get the underlying callback for passing to exec / stream functions. */
182
+ get callback() {
183
+ return (entry) => this.onLog?.(entry);
184
+ }
185
+ };
186
+ var BuildCancelledError = class extends Error {
187
+ constructor(message = "Build cancelled") {
188
+ super(message);
189
+ this.name = "BuildCancelledError";
190
+ }
191
+ };
192
+ async function runBuildPipeline(env, config, logger) {
193
+ let startTime = Date.now();
194
+ let currentStep = "prepare";
195
+ const exec = (command) => env.exec(command, logger.callback);
196
+ const buildDir = resolveBuildDirectory(env.projectDir, config.rootDirectory);
197
+ if (env.hasNativeEnv) {
198
+ const { cpuCores, memoryMb, diskMb } = config.resources;
199
+ logger.log(`Machine: ${cpuCores} CPU \xB7 ${memoryMb} MB RAM \xB7 ${diskMb} MB Disk`);
200
+ }
201
+ try {
202
+ if (env.preflight) {
203
+ await logger.runStep("prepare", "Preparing server", async () => {
204
+ await env.preflight(config, logger);
205
+ });
206
+ }
207
+ startTime = Date.now();
208
+ currentStep = "clone";
209
+ if (config.localPath || config.sourceStaged) {
210
+ logger.step("clone", "completed", "Source ready");
211
+ } else {
212
+ await logger.runStep(
213
+ "clone",
214
+ `Cloning ${config.repoUrl} (branch: ${config.branch})`,
215
+ async () => {
216
+ let sshMaterial;
217
+ if (config.gitSsh) {
218
+ const writeSecretFile = env.writeSecretFile;
219
+ if (!writeSecretFile) {
220
+ throw new Error(
221
+ "SSH-based GitHub auth isn't supported on this build runtime \u2014 use a token or the tunnel relay."
222
+ );
223
+ }
224
+ sshMaterial = await materializeGitSsh(
225
+ shellGitSshWriter({ exec, writeSecret: writeSecretFile }),
226
+ `${env.projectDir}.gitssh`,
227
+ config.gitSsh
228
+ );
229
+ }
230
+ const { cloneUrl, gitEnv: GIT_ENV, credFlag: CRED } = assembleGitClone({
231
+ repoUrl: config.repoUrl,
232
+ gitToken: config.gitToken,
233
+ gitCredentialHelperPath: config.gitCredentialHelperPath,
234
+ ssh: sshMaterial,
235
+ ambient: config.gitAmbient
236
+ });
237
+ try {
238
+ if (config.commitSha) {
239
+ try {
240
+ await exec(
241
+ `${GIT_ENV} git ${CRED} clone --progress --depth 50 --branch ${sq(config.branch)} ${sq(cloneUrl)} ${sq(env.projectDir)} && cd ${sq(env.projectDir)} && git ${CRED} -c advice.detachedHead=false checkout ${sq(config.commitSha)}`
242
+ );
243
+ } catch {
244
+ logger.log(
245
+ `Checkout of ${config.commitSha} failed inside the depth-50 clone; running git fetch --unshallow and retrying.`,
246
+ "warn"
247
+ );
248
+ await exec(
249
+ `cd ${sq(env.projectDir)} && ${GIT_ENV} git ${CRED} fetch --progress --unshallow && git ${CRED} -c advice.detachedHead=false checkout ${sq(config.commitSha)}`
250
+ );
251
+ }
252
+ } else {
253
+ await exec(
254
+ `${GIT_ENV} git ${CRED} clone --progress --depth 1 --branch ${sq(config.branch)} ${sq(cloneUrl)} ${sq(env.projectDir)}`
255
+ );
256
+ }
257
+ } finally {
258
+ await sshMaterial?.cleanup();
259
+ }
260
+ }
261
+ );
262
+ }
263
+ const envPrefix = env.hasNativeEnv ? "" : Object.entries(config.envVars).filter(([k]) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(k)).map(([k, v]) => `export ${k}=${sq(v)}`).join(" && ");
264
+ const JS_PACKAGE_MANAGERS = /* @__PURE__ */ new Set(["npm", "yarn", "pnpm", "bun"]);
265
+ const binPathExport = JS_PACKAGE_MANAGERS.has(config.packageManager) ? `export PATH=${sq(`${buildDir}/node_modules/.bin`)}:${sq(`${env.projectDir}/node_modules/.bin`)}:"$PATH"` : "";
266
+ const inDir = (cmd) => {
267
+ const full = `cd ${sq(buildDir)} && ${cmd}`;
268
+ const prefix = [envPrefix, binPathExport].filter(Boolean).join(" && ");
269
+ return prefix ? `${prefix} && ${full}` : full;
270
+ };
271
+ const pmEnsure = packageManagerEnsureCommand(config.packageManager);
272
+ currentStep = "install";
273
+ if (config.installCommand) {
274
+ const installCmd = pmEnsure ? `${pmEnsure} && ${config.installCommand}` : config.installCommand;
275
+ await logger.runStep(
276
+ "install",
277
+ `Installing dependencies (${config.packageManager})`,
278
+ async () => {
279
+ await exec(inDir(installCmd));
280
+ }
281
+ );
282
+ } else {
283
+ logger.step("install", "skipped", "No install command configured");
284
+ }
285
+ if (config.buildCommand) {
286
+ currentStep = "build";
287
+ const buildCmd = pmEnsure && !config.installCommand ? `${pmEnsure} && ${config.buildCommand}` : config.buildCommand;
288
+ await logger.runStep("build", `Building (${config.buildCommand})`, async () => {
289
+ await exec(inDir(buildCmd));
290
+ });
291
+ } else {
292
+ logger.step("build", "skipped", "No build command configured");
293
+ }
294
+ const durationMs = Date.now() - startTime;
295
+ return { status: "deploying", durationMs };
296
+ } catch (err) {
297
+ const durationMs = Date.now() - startTime;
298
+ if (err instanceof BuildCancelledError) {
299
+ return { status: "cancelled", durationMs, errorMessage: err.message };
300
+ }
301
+ const errorMessage = safeErrorMessage(err);
302
+ return { status: "failed", failedStep: currentStep, durationMs, errorMessage };
303
+ }
304
+ }
305
+ function resolveBuildDirectory(projectDir, rootDirectory) {
306
+ const normalized = rootDirectory?.trim().replace(/^\/+|\/+$/g, "");
307
+ if (!normalized || normalized === ".") {
308
+ return projectDir;
309
+ }
310
+ return `${projectDir}/${normalized}`;
311
+ }
312
+ function parseLogLevel(message) {
313
+ if (/\b(error|fatal|panic)\b/i.test(message)) return "error";
314
+ if (/\bwarn(ing)?\b/i.test(message)) return "warn";
315
+ return "info";
316
+ }
317
+ function detectBuildKillHint(output) {
318
+ if (!output) return null;
319
+ const tail = output.slice(-4096);
320
+ if (/\bsigkill\b|\bKilled\b|out of memory|JavaScript heap out of memory|Allocation failed/i.test(tail)) {
321
+ return "Build process was killed - typically because the target ran out of memory during the build. Increase RAM on the target, add swap, or build locally and ship the dist.";
322
+ }
323
+ return null;
324
+ }
325
+
326
+ // ../../packages/adapters/src/runtime/transfer.ts
327
+ import { execFile } from "child_process";
328
+ var TAR_MAX_BUFFER = 500 * 1024 * 1024;
329
+ async function transferLocalDirectory(localPath, target, logger, options) {
330
+ logger.log(`Transferring ${localPath} \u2192 ${target.path}...
331
+ `);
332
+ if (target.kind === "executor") {
333
+ await target.executor.transferIn(localPath, target.path, logger.callback, {
334
+ excludes: options?.excludes,
335
+ includes: options?.includes,
336
+ alsoInclude: options?.alsoInclude
337
+ });
338
+ await verifyExecutorTransfer(target.executor, target.path, logger);
339
+ return;
340
+ }
341
+ const tarBuffer = await createTarball(localPath, options);
342
+ const result = await target.runtime.transfer.upload({
343
+ body: tarBuffer,
344
+ dest: target.path
345
+ });
346
+ if (!result.files_extracted || result.files_extracted === 0) {
347
+ throw new Error("Transfer produced 0 files - upload may have failed silently");
348
+ }
349
+ logger.log(`Uploaded ${result.files_extracted} files.
350
+ `);
351
+ }
352
+ async function verifyExecutorTransfer(executor, targetPath, logger) {
353
+ try {
354
+ const countOutput = await executor.exec(
355
+ `find ${sq(targetPath)} -mindepth 1 -maxdepth 1 | head -5 | wc -l`
356
+ );
357
+ const fileCount = parseInt(countOutput.trim(), 10);
358
+ if (fileCount === 0) {
359
+ throw new Error(
360
+ `Transfer target ${targetPath} is empty - files were not copied`
361
+ );
362
+ }
363
+ logger.log(`Transfer verified (${fileCount}+ entries in target).
364
+ `);
365
+ } catch (err) {
366
+ if (err instanceof Error && err.message.includes("is empty")) throw err;
367
+ throw new Error(
368
+ `Transfer verification failed: ${safeErrorMessage(err)}`
369
+ );
370
+ }
371
+ }
372
+ async function createTarball(localPath, options) {
373
+ const { args, cleanup } = await prepareSourceTarArgs(localPath, {
374
+ excludes: options?.excludes ?? [...TRANSFER_EXCLUDES],
375
+ includes: options?.includes,
376
+ alsoInclude: options?.alsoInclude
377
+ });
378
+ try {
379
+ return await new Promise((resolve, reject) => {
380
+ execFile(
381
+ "tar",
382
+ args,
383
+ {
384
+ encoding: "buffer",
385
+ maxBuffer: TAR_MAX_BUFFER,
386
+ env: getTarCreateEnv()
387
+ },
388
+ (err, stdout, stderr) => {
389
+ if (err) {
390
+ const stderrText = Buffer.isBuffer(stderr) ? stderr.toString().trim() : String(stderr ?? "").trim();
391
+ reject(new Error(stderrText || err.message));
392
+ return;
393
+ }
394
+ resolve(Buffer.isBuffer(stdout) ? stdout : Buffer.from(stdout));
395
+ }
396
+ );
397
+ });
398
+ } finally {
399
+ await cleanup();
400
+ }
401
+ }
402
+
403
+ export {
404
+ sq,
405
+ injectGitToken,
406
+ assembleGitClone,
407
+ materializeGitSsh,
408
+ shellGitSshWriter,
409
+ localGitSshWriter,
410
+ BuildLogger,
411
+ BuildCancelledError,
412
+ runBuildPipeline,
413
+ parseLogLevel,
414
+ detectBuildKillHint,
415
+ transferLocalDirectory
416
+ };