@north-light/api 0.3.724 → 0.3.726
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.
|
@@ -371,7 +371,7 @@ export async function assertRecordedCwdExists(nodeId, meta) {
|
|
|
371
371
|
/** Cleanup deleted this node's managed checkout and its branch, and nothing rebuilds them: refuse on any host, before a caller changes state. */
|
|
372
372
|
export function assertCheckoutNotRemoved(nodeId, meta) {
|
|
373
373
|
const worktree = meta.managed_worktree;
|
|
374
|
-
if (worktree?.state !== 'closed' || worktree.cleanup !== 'complete'
|
|
374
|
+
if (worktree?.state !== 'closed' || worktree.cleanup !== 'complete')
|
|
375
375
|
return;
|
|
376
376
|
throw new InputError({
|
|
377
377
|
error: 'checkout_removed',
|
|
@@ -73,9 +73,11 @@ export function recipeDockerfile(recipe, revision, packagesToken = false) {
|
|
|
73
73
|
out.push('WORKDIR /work');
|
|
74
74
|
out.push(`RUN ${writeRunUserNpmrc()}`);
|
|
75
75
|
// Warm the image's pnpm store from each repository's lockfile, so `pnpm install` in the sandbox links instead of downloading. A failed fetch only costs that
|
|
76
|
-
// warmth, so it is logged and never refuses the sandbox start.
|
|
76
|
+
// warmth, so it is logged and never refuses the sandbox start. The fetch runs as the run user, so the repository and the store are already its own and a
|
|
77
|
+
// setup script's `su crtr -c 'pnpm install'` can write them. No step here may `chown -R` the trees: each one rewrites every file into a new layer, and the
|
|
78
|
+
// doubled multi-GB image kept Blaxel's build at BUILDING past the timeout. The final stage's `COPY --chown` sets ownership once.
|
|
77
79
|
for (const repo of recipe.repositories) {
|
|
78
|
-
out.push(`RUN if [ -f /work/${repo.name}/pnpm-lock.yaml ]; then cd /work/${repo.name} && HOME=/home/${RUN_USER} pnpm fetch >> ${SETUP_LOG_FILE} 2>&1 || echo 'pnpm fetch ${repo.name} failed' >> ${SETUP_LOG_FILE}; fi`);
|
|
80
|
+
out.push(`RUN if [ -f /work/${repo.name}/pnpm-lock.yaml ]; then su ${RUN_USER} -c 'cd /work/${repo.name} && HOME=/home/${RUN_USER} pnpm fetch' >> ${SETUP_LOG_FILE} 2>&1 || echo 'pnpm fetch ${repo.name} failed' >> ${SETUP_LOG_FILE}; fi`);
|
|
79
81
|
}
|
|
80
82
|
for (const source of packages)
|
|
81
83
|
out.push(guarded(`pi install ${source}`, `HOME=/var/lib/crtr PI_CODING_AGENT_DIR=${RECIPE_PI_AGENT_DIR} pi install ${shellQuote(source)}`));
|
|
@@ -83,7 +85,7 @@ export function recipeDockerfile(recipe, revision, packagesToken = false) {
|
|
|
83
85
|
// the step. Its output and exit status are kept in the image (`SETUP_LOG_FILE`, `SETUP_FAILED_FILE`) and the sandbox start script refuses to start with them.
|
|
84
86
|
if (hasScript)
|
|
85
87
|
out.push(guarded('setup script', `bash /tmp/${SETUP_SCRIPT_FILE}`));
|
|
86
|
-
out.push(guarded('finalize', `echo ${Math.trunc(revision)} > /work/.crtr/recipe-revision
|
|
88
|
+
out.push(guarded('finalize', `echo ${Math.trunc(revision)} > /work/.crtr/recipe-revision`));
|
|
87
89
|
out.push('', ...base);
|
|
88
90
|
// Blaxel keeps the ownership set in the Dockerfile only for an image that declares a final USER (an image without one is built all root-owned); the final USER is below.
|
|
89
91
|
for (const dir of ['/work', `/home/${RUN_USER}`, '/var/lib/crtr'])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.726",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|