@spunto/build 0.18.0 → 0.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spunto/build",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Spunto's shared Build engine — the devcontainer image protocol and VS Code extension registry clients, with no database, no HTTP framework and no UI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -181,8 +181,17 @@ function startDone(worker) {
181
181
  function projectState() {
182
182
  if (!project) return null
183
183
  const { plan } = project
184
- const baked = existsSync(join(DIR, `.baked-${plan.bakeKey}`))
185
184
  const alive = runnerPid() != null
185
+ // The recipe of the runner of this boot, not the plan's: a recipe change deployed while the box
186
+ // runs (new bakeKey, the plan re-sent at the agent's reconnection) applies at its next start, and
187
+ // the plan's marker is not there before. Read against the plan, the box said `baking` until then,
188
+ // `building` in the dashboard, while it was up and ready (2026-10-26, IMAGE_RECIPE_VERSION 3).
189
+ // A runner started by an agent that kept no key in started.json: past its bake once setup is done.
190
+ const last = lastStart()
191
+ const ofThisBoot = last != null && (alive || last.boot === bootId())
192
+ const baked = ofThisBoot && last.bakeKey
193
+ ? existsSync(join(DIR, `.baked-${last.bakeKey}`))
194
+ : existsSync(join(DIR, `.baked-${plan.bakeKey}`)) || (alive && existsSync(SETUP_DONE))
186
195
  let worker = null
187
196
  try {
188
197
  worker = JSON.parse(readFileSync(MP_STATUS, "utf8"))
@@ -304,7 +313,7 @@ function applyProject(plan) {
304
313
  }
305
314
  const log = openSync(join(DIR, "project.log"), "a")
306
315
  // Before the spawn: the worker script's `ready` of this start must be newer than it (startDone).
307
- writeFileSync(STARTED(), JSON.stringify({ boot, version: plan.version, exitCode: null, at: new Date().toISOString() }))
316
+ writeFileSync(STARTED(), JSON.stringify({ boot, version: plan.version, bakeKey: plan.bakeKey, exitCode: null, at: new Date().toISOString() }))
308
317
  // Detached, in its own session: it outlives an agent restart, like a container's CMD would.
309
318
  const child = spawn("bash", [join(DIR, "runner.sh"), DIR, plan.bakeKey, plan.bakeOnly ? "bake-only" : "full"], {
310
319
  cwd: "/",
@@ -636,6 +636,9 @@ export function defaultVscodeUserSettings(opts?: {
636
636
  }): Record<string, unknown> {
637
637
  const { projectName, colorByProject } = opts ?? {}
638
638
  const settings: Record<string, unknown> = {
639
+ // Built into the image by spunto-pack (`brand: spunto`, coderhammer/features). On an image
640
+ // from before it the theme is missing and VS Code silently keeps its own default.
641
+ "workbench.colorTheme": "Spunto Light",
639
642
  "chat.disableAIFeatures": true,
640
643
  // Workers are ephemeral/single-purpose — the trust prompt only adds friction.
641
644
  "security.workspace.trust.enabled": false,
@@ -685,8 +688,9 @@ export function defaultVscodeUserSettings(opts?: {
685
688
  *
686
689
  * 1 → the hand-written blocks (vscode user, code-server, tmux, dtach, sshd).
687
690
  * 2 → common-utils + spunto-pack.
691
+ * 3 → spunto-pack 1.1: the IDE wears Spunto's name, icons and themes (coderhammer/features).
688
692
  */
689
- export const IMAGE_RECIPE_VERSION = 2
693
+ export const IMAGE_RECIPE_VERSION = 3
690
694
 
691
695
  export function buildImageScript(params: {
692
696
  features: { id: string; ociRef?: string; options?: Record<string, string> }[]
@@ -1406,6 +1410,14 @@ export function buildStartScript(params: StartScriptParams): { script: string; h
1406
1410
  // Makes the editor's own Extensions view search the same registry the picker and the image
1407
1411
  // build used (org setting — see lib/extension-registry.ts). Nothing when the org is on Open VSX.
1408
1412
  ...galleryExport(extensionsGallery),
1413
+ // The IDE is Spunto's, not Coder's (spunto-pack rebrands the files): the name in the title,
1414
+ // no "Deploy code-server for your team" on the welcome page, no "code-server vX is out"
1415
+ // notification. Each flag only if this code-server knows it — an unknown one stops it dead.
1416
+ '_mp_cs_flags=""',
1417
+ "for _f in --app-name --disable-getting-started-override --disable-update-check; do",
1418
+ ' code-server --help 2>/dev/null | grep -q -- "$_f" || continue',
1419
+ ' case "$_f" in --app-name) _mp_cs_flags="$_mp_cs_flags --app-name Spunto" ;; *) _mp_cs_flags="$_mp_cs_flags $_f" ;; esac',
1420
+ "done",
1409
1421
  "while true; do",
1410
1422
  ' VSCODE_PROXY_URI="${PUBLIC_PROTOCOL}://${WORKER_SLUG}-{{port}}.${BASE_DOMAIN}" \\',
1411
1423
  // PORT is overridden here (not unset globally) so a project secret named
@@ -1414,7 +1426,7 @@ export function buildStartScript(params: StartScriptParams): { script: string; h
1414
1426
  // § 4c above restores the original value for that terminal specifically.
1415
1427
  // apps/agent/src/terminal.ts (dashboard's separate terminal feature) is a
1416
1428
  // different process tree entirely and was never affected.
1417
- ` PORT=${idePort} code-server --bind-addr 0.0.0.0:${idePort} --auth none /workspace 2>&1`,
1429
+ ` PORT=${idePort} code-server --bind-addr 0.0.0.0:${idePort} --auth none $_mp_cs_flags /workspace 2>&1`,
1418
1430
  ' echo "[start] code-server exited ($?), restarting in 3s..."',
1419
1431
  " sleep 3",
1420
1432
  "done",
@@ -1642,9 +1654,17 @@ export function buildContainerScript(params: StartScriptParams): { script: strin
1642
1654
  // Same org-level gallery export as the legacy loop above — the two blocks are duplicated on
1643
1655
  // purpose (RFC 0017 §2.1), so this one has to be kept in step by hand.
1644
1656
  ...galleryExport(extensionsGallery),
1657
+ // The IDE is Spunto's, not Coder's (spunto-pack rebrands the files): the name in the title,
1658
+ // no "Deploy code-server for your team" on the welcome page, no "code-server vX is out"
1659
+ // notification. Each flag only if this code-server knows it — an unknown one stops it dead.
1660
+ '_mp_cs_flags=""',
1661
+ "for _f in --app-name --disable-getting-started-override --disable-update-check; do",
1662
+ ' code-server --help 2>/dev/null | grep -q -- "$_f" || continue',
1663
+ ' case "$_f" in --app-name) _mp_cs_flags="$_mp_cs_flags --app-name Spunto" ;; *) _mp_cs_flags="$_mp_cs_flags $_f" ;; esac',
1664
+ "done",
1645
1665
  "while true; do",
1646
1666
  ' VSCODE_PROXY_URI="${PUBLIC_PROTOCOL}://${WORKER_SLUG}-{{port}}.${BASE_DOMAIN}" \\',
1647
- ` PORT=${idePort} code-server --bind-addr 0.0.0.0:${idePort} --auth none /workspace 2>&1`,
1667
+ ` PORT=${idePort} code-server --bind-addr 0.0.0.0:${idePort} --auth none $_mp_cs_flags /workspace 2>&1`,
1648
1668
  ' echo "[start] code-server exited ($?), restarting in 3s..."',
1649
1669
  " sleep 3",
1650
1670
  "done",