Skip to content

chore(apps): adapt cli, dashboard, sdk-typescript to the regenerated API clients#727

Merged
DorianZheng merged 1 commit into
mainfrom
chore/adapt-consumers-to-regen-clients
Jun 10, 2026
Merged

chore(apps): adapt cli, dashboard, sdk-typescript to the regenerated API clients#727
DorianZheng merged 1 commit into
mainfrom
chore/adapt-consumers-to-regen-clients

Conversation

@DorianZheng

@DorianZheng DorianZheng commented Jun 10, 2026

Copy link
Copy Markdown
Member

What

The consumer-adaptation follow-up that #726 disclosed: makes apps/cli, apps/dashboard, and apps/libs/sdk-typescript compile against the regenerated API clients by removing code whose server-side API was deleted in the A2+MVP merge (#715). 52 files, +115/−3063 — almost entirely deletions.

cli

  • Deletes the Dockerfile-build flow: --dockerfile/-f and --context/-c flags on boxlite create, CreateBuildInfo construction (cmd/common/build.go with its Dockerfile parsing + MinIO context upload), build-log streaming (cmd/common/logs.go, hit the removed /build-logs endpoint), the MCP create_box buildInfo argument, and pkg/minio (its only consumer was the build flow; go mod tidy drops the dependency).
  • Drops BOXSTATE_BUILD_FAILED / BOXSTATE_PENDING_BUILD handling (states removed from the enum).
  • Regenerates cobra docs via hack/generate-cli-docs.sh — also clears stale boxlite snapshot docs left from the super PR.

dashboard

  • Deletes the Registries page, RegistryTable, the 4 registry hooks, its route enum + hidden-routes entry, and apiClient.ts wiring (DockerRegistryApi was removed). The page was already in HIDDEN_DASHBOARD_ROUTES.
  • Removes the usage-overview wiring (getOrganizationUsageOverview removed with no successor): the UsageOverview/UsageOverviewIndicator/LimitUsageChart components, the quota-driven usage timeline chart (its "percent of quota" mode is built on the deleted RegionUsageOverview quotas throughout), the hook + query keys + LiveIndicator they orphaned. Spending and Limits keep their billing/tier features (wallet, cost breakdown, tier comparison, rate limits).
  • Drops the orphaned templates box filter (the snapshots query param left listBoxesPaginated; nothing set the filter).

sdk-typescript

  • Box: drops template/backupState/backupCreatedAt/buildInfo — fields no longer on the wire model.
  • BoxLite.create(): the wire CreateBox accepts neither buildInfo nor templateId anymore, so create() now throws a clear BoxliteError when image or templateId params are provided instead of silently dropping them. The CreateBoxFromImageParams type, overload, and Image class stay exported (marked @deprecated) because the dashboard Playground imports them — its image flow now gets an honest runtime error (it was already broken server-side); the full Playground rework belongs to the MVP track (PlaygroundProvider.tsx already carries TODO(image-rewrite) markers).
  • Deletes the dead processStreamingResponse helper (stdDemuxStream stays — Process.ts uses it).
  • Adds guard tests (__tests__/BoxLite.create-guards.test.ts) for the two new throws, wiring the dormant jest harness to tsconfig.spec.json + the workspace path aliases so it actually runs (yarn jest --config libs/sdk-typescript/jest.config.js, 2/2 pass). The asserted messages are produced only by the guards — without them the call rejects with a network AxiosError.

Verification

  • go build ./... + gofmt clean in apps/cli; go mod tidy applied.
  • sdk tsconfig.lib and tsconfig.spec typecheck clean; jest guard tests 2/2.
  • dashboard tsc: 216 errors vs the 232-error pre-merge baseline, zero new (position-normalized diff; the dashboard has never been tsc-clean — fix(api): prod webpack build clears 163 latent errors + structural blockers #719 tracks that).
  • make lint:fix exits 0 modifying nothing.
  • Grep sweeps: zero remaining references to any removed client symbol outside the generated dirs.

Out of scope (pre-existing)

apps/runner fails to compile on main (boxlite.WithPort undefined in pkg/boxlite) — fails identically at clean HEAD, unrelated to the regen.

Summary by CodeRabbit

Release Notes

Removed Features

  • Removed Docker build context and Dockerfile upload support from box creation
  • Removed snapshot management functionality from CLI and dashboard
  • Removed Docker registry management feature
  • Simplified usage analytics charts and dashboard metrics

Improvements

  • Streamlined box creation workflow for faster provisioning
  • Cleaned up CLI commands and documentation
  • Optimized dependencies and reduced package size

…API clients

#726 regenerated the clients against the merged A2+MVP API surface; this
adapts the three consumers that still referenced removed APIs (the
follow-up disclosed in that PR).

cli: drop the Dockerfile-build flow (--dockerfile/--context flags,
BuildInfo construction, build-log streaming, MCP buildInfo arg, unused
pkg/minio + its go.mod dependency) and the removed
BUILD_FAILED/PENDING_BUILD states; regenerate cobra docs (also clears
stale snapshot-command docs).

dashboard: delete the Registries page + registry hooks/route
(DockerRegistry API removed) and the usage-overview wiring in
Spending/Limits (endpoint removed, no successor; pages keep billing/tier
features) including the quota-driven usage timeline chart and the hooks,
query keys, and LiveIndicator it orphaned; drop the orphaned 'templates'
filter arg.

sdk-typescript: drop Box fields removed from the wire model
(template/backupState/backupCreatedAt/buildInfo); createBox no longer
accepts buildInfo/templateId, so create() throws a clear BoxliteError
when image/templateId params are provided instead of silently ignoring
them — types stay exported (@deprecated) so the dashboard Playground
keeps compiling; delete the dead processStreamingResponse helper; add
guard tests (wiring the dormant jest harness to tsconfig.spec.json and
the workspace path aliases to make it runnable).

Verified: cli go build + gofmt; sdk tsconfig.lib + tsconfig.spec
typecheck clean; jest guard tests 2/2; dashboard tsc 216 errors vs 232
pre-merge baseline with zero new (dashboard was not tsc-clean before);
make lint:fix clean.
@DorianZheng DorianZheng requested a review from a team as a code owner June 10, 2026 16:53
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2725f6fb-ea26-4c4a-893a-96bbf2c88745

📥 Commits

Reviewing files that changed from the base of the PR and between e2f7ca8 and a98c7fd.

⛔ Files ignored due to path filters (1)
  • apps/cli/go.sum is excluded by !**/*.sum
📒 Files selected for processing (51)
  • apps/cli/cmd/box/create.go
  • apps/cli/cmd/common/box.go
  • apps/cli/cmd/common/build.go
  • apps/cli/cmd/common/logs.go
  • apps/cli/cmd/common/state.go
  • apps/cli/docs/boxlite.md
  • apps/cli/docs/boxlite_create.md
  • apps/cli/docs/boxlite_snapshot.md
  • apps/cli/docs/boxlite_snapshot_create.md
  • apps/cli/docs/boxlite_snapshot_delete.md
  • apps/cli/docs/boxlite_snapshot_list.md
  • apps/cli/docs/boxlite_snapshot_push.md
  • apps/cli/go.mod
  • apps/cli/hack/docs/boxlite.yaml
  • apps/cli/hack/docs/boxlite_create.yaml
  • apps/cli/hack/docs/boxlite_snapshot.yaml
  • apps/cli/hack/docs/boxlite_snapshot_create.yaml
  • apps/cli/hack/docs/boxlite_snapshot_delete.yaml
  • apps/cli/hack/docs/boxlite_snapshot_list.yaml
  • apps/cli/hack/docs/boxlite_snapshot_push.yaml
  • apps/cli/main.go
  • apps/cli/mcp/tools/create_box.go
  • apps/cli/pkg/minio/minio.go
  • apps/cli/views/box/info.go
  • apps/dashboard/src/App.tsx
  • apps/dashboard/src/api/apiClient.ts
  • apps/dashboard/src/components/BoxTable/index.tsx
  • apps/dashboard/src/components/LimitUsageChart.tsx
  • apps/dashboard/src/components/LiveIndicator.tsx
  • apps/dashboard/src/components/RegistryTable.tsx
  • apps/dashboard/src/components/UsageOverview.tsx
  • apps/dashboard/src/components/UsageOverviewIndicator.tsx
  • apps/dashboard/src/components/spending/UsageTimelineChart.tsx
  • apps/dashboard/src/enums/RoutePath.ts
  • apps/dashboard/src/hooks/mutations/useCreateRegistryMutation.ts
  • apps/dashboard/src/hooks/mutations/useDeleteRegistryMutation.ts
  • apps/dashboard/src/hooks/mutations/useUpdateRegistryMutation.ts
  • apps/dashboard/src/hooks/queries/queryKeys.ts
  • apps/dashboard/src/hooks/queries/useAnalyticsUsage.ts
  • apps/dashboard/src/hooks/queries/useOrganizationUsageOverviewQuery.ts
  • apps/dashboard/src/hooks/queries/useRegistriesQuery.ts
  • apps/dashboard/src/hooks/useBoxes.ts
  • apps/dashboard/src/lib/dashboard-features.test.ts
  • apps/dashboard/src/pages/Limits.tsx
  • apps/dashboard/src/pages/Registries.tsx
  • apps/dashboard/src/pages/Spending.tsx
  • apps/libs/sdk-typescript/jest.config.js
  • apps/libs/sdk-typescript/src/Box.ts
  • apps/libs/sdk-typescript/src/BoxLite.ts
  • apps/libs/sdk-typescript/src/__tests__/BoxLite.create-guards.test.ts
  • apps/libs/sdk-typescript/src/utils/Stream.ts

📝 Walkthrough

Walkthrough

This PR removes template-based and image-based box creation, build context uploads, Docker registry management, and usage analytics components across the CLI, SDK, and dashboard. The changes simplify box creation to a runtime-only flow while removing preview/build functionality.

Changes

Build, Template, and Image Creation Removal

Layer / File(s) Summary
CLI build context and logs removal
apps/cli/cmd/box/create.go, apps/cli/cmd/common/state.go, apps/cli/cmd/common/box.go
Removes --dockerfile and --context flags, build-info setup, PENDING_BUILD polling, and build-log streaming from box creation. Updates state error handling to treat BUILD_FAILED as a non-terminal retryable state instead of immediate failure.
CLI documentation: sandbox→box, remove snapshot
apps/cli/docs/boxlite.md, apps/cli/docs/boxlite_create.md, apps/cli/hack/docs/boxlite.yaml, apps/cli/hack/docs/boxlite_create.yaml
Updates all CLI documentation and YAML help definitions to reference "boxes" instead of "sandboxes", removes --dockerfile and --context options from create command, removes all snapshot subcommand documentation.
MCP create tool and box info view updates
apps/cli/mcp/tools/create_box.go, apps/cli/views/box/info.go, apps/cli/main.go
Removes BuildInfo field from MCP CreateBoxArgs schema; removes BUILD_FAILED state label rendering from box info output; reorders CLI subcommand imports.
Go module dependency cleanup
apps/cli/go.mod
Removes minio, crypto, pty, and related indirect dependencies after removing build context and log streaming functionality.
SDK Box model: remove backup and build fields
apps/libs/sdk-typescript/src/Box.ts
Removes template, backupState, backupCreatedAt, and buildInfo properties from Box class; updates DTO mapping to focus on autoStop/autoDelete intervals and volumes.
SDK BoxLite create method: remove template/image paths
apps/libs/sdk-typescript/src/BoxLite.ts, apps/libs/sdk-typescript/src/__tests__/BoxLite.create-guards.test.ts
Removes template-based and image-based creation overloads; adds fail-fast validation to throw on deprecated params; removes PENDING_BUILD polling and build-log streaming; simplifies request payload to runtime-only resource allocation. Adds guard test validating errors on image/templateId usage.
SDK Stream utility: remove processStreamingResponse
apps/libs/sdk-typescript/src/utils/Stream.ts
Removes processStreamingResponse helper that previously streamed build logs; retains stdDemuxStream.

Dashboard Docker Registry Removal

Layer / File(s) Summary
Dashboard registry API and routing removal
apps/dashboard/src/api/apiClient.ts, apps/dashboard/src/App.tsx, apps/dashboard/src/enums/RoutePath.ts, apps/dashboard/src/hooks/queries/queryKeys.ts
Removes DockerRegistryApi from ApiClient, removes REGISTRIES from hidden routes and RoutePath enum, removes registries cache-key factory. Entire Registries page component and all registry-related mutation/query hooks are deleted.

Dashboard Usage Timeline and Overview Removal

Layer / File(s) Summary
Dashboard analytics query removal: usage chart and overview
apps/dashboard/src/hooks/queries/queryKeys.ts, apps/dashboard/src/hooks/queries/useAnalyticsUsage.ts
Removes usageChart cache-key factory and useUsageChart hook; removes useOrganizationUsageOverviewQuery hook and UsageChartParams interface.
Dashboard Limits page: remove region selector and usage overview
apps/dashboard/src/pages/Limits.tsx
Removes region selection state, usage-overview UI components, and related hooks; simplifies loading/error handling to depend only on tier and wallet queries.
Dashboard Spending page: remove usage timeline chart
apps/dashboard/src/pages/Spending.tsx
Removes UsageTimelineChart component, chart-region state, and usage-overview query integration; retains aggregated usage summary and per-box usage table.

Dashboard Minor Updates

Layer / File(s) Summary
Box filters: templates→regions, test formatting
apps/dashboard/src/hooks/useBoxes.ts, apps/dashboard/src/components/BoxTable/index.tsx, apps/dashboard/src/lib/dashboard-features.test.ts
Updates BoxFilters to use regions instead of templates; adjusts useBoxes API call accordingly; reformats BoxTableHeader JSX to single-line invocation; reformats test assertion for VNC tab visibility.
Jest configuration TypeScript path alias resolution
apps/libs/sdk-typescript/jest.config.js
Updates Jest transform to pass tsconfig to ts-jest; adds moduleNameMapper to resolve @boxlite-ai/*-api-client package aliases for test imports.

🎯 4 (Complex) | ⏱️ ~45 minutes

🐰 Hop-hop, templates gone and builds no more,

Registries removed from the dashboard door,

Usage charts fade, timelines retire with grace,

Simple box creation takes their place! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/adapt-consumers-to-regen-clients

Comment @coderabbitai help to get the list of available commands and usage tips.

@DorianZheng DorianZheng merged commit 460c5d6 into main Jun 10, 2026
30 of 31 checks passed
@DorianZheng DorianZheng deleted the chore/adapt-consumers-to-regen-clients branch June 10, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant