Skip to content

Snapshot build: support npm/bun dependencies in declarative YAML #964

@rblalock

Description

@rblalock

Problem

The declarative snapshot build file (agentuity-snapshot.yaml) only supports apt packages in the dependencies field. There's no way to install npm/bun packages declaratively.

This means any snapshot that needs npm packages (e.g., opencode-ai, typescript, etc.) must be built manually:

agentuity cloud sandbox create --runtime agentuity:latest --memory 4Gi --network
agentuity cloud sandbox exec <id> -- bash -c 'bun install -g opencode-ai'
agentuity cloud sandbox snapshot create <id> --name my-snapshot --public
agentuity cloud sandbox delete <id> --confirm

This is not reproducible from the YAML alone, can't be version-controlled effectively, and requires a separate build script.

Proposed Solution

Support npm/bun packages in the dependencies field, or add a new field like packages or npm:

version: 1
runtime: agentuity:latest
name: agentuity-coder

dependencies:
  - curl        # apt package (existing behavior)

packages:       # npm/bun packages (new)
  - opencode-ai
  - typescript

Or alternatively, support a commands / run field for arbitrary setup:

run:
  - bun install -g opencode-ai
  - ln -sf /usr/local/bin/bun /home/agentuity/.bun/bin/node

Use Case

Building the agentuity-coder snapshot for Agentuity Coder IDE. We need both the Agentuity CLI (from agentuity:latest runtime) and OpenCode (opencode-ai npm package). Currently requires a manual build script because the declarative system can't install npm packages.

Current Workaround

A shell script (scripts/build-coder-snapshot.sh) that automates the manual sandbox create → exec → snapshot → delete workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions