Skip to content

chore(apps): restore Daytona API-client regen machinery + regenerate clients#716

Merged
DorianZheng merged 3 commits into
mainfrom
chore/port-daytona-client-regen-machinery
Jun 10, 2026
Merged

chore(apps): restore Daytona API-client regen machinery + regenerate clients#716
DorianZheng merged 3 commits into
mainfrom
chore/port-daytona-client-regen-machinery

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Closes the "regenerate api-client/api-client-go" follow-up from #711 (post-#706 rename), and makes the regeneration reproducible so the clients can't silently go stale again.

Why the clients were stale

The apps/ subtree import from daytonaio/daytona dropped the root-level machinery that upstream uses to regenerate clients (researched against upstream — daytonaio/daytona@main):

Upstream piece State in boxlite before this PR Consequence
openapitools.json generator pin missing every machine floats to the latest jar (committed tree mixed 7.12/7.23 output)
hack/{ts,go}-client/ postprocess + Go mustache templates missing (referenced by nx targets!) Go client lost version.go + branded User-Agent; targets failed at the postprocess step
format-lint-api-clients CI drift gate (pr_checks.yaml) missing nothing detected stale clients — how WebhookEvent="sandbox.created" survived the rename merge
committed apps/api/.env dev env missing (boxlite gitignores .env) generate-openapi.ts (boots the full NestJS app) had no env to run under
repo-root-relative nx target paths broken (workspace root moved into apps/) nx run api:openapi resolved apps/apps/api/...

Commit 1 — machinery

  • apps/openapitools.json pins openapi-generator at 7.23.0 (matches the committed clients; upstream pins 7.21.0 — deliberate deviation to minimize this diff).
  • apps/hack/{ts,go}-client/ copied byte-identical from upstream (User-Agent branding, version.go via go:embed, Go model templates).
  • nx path fixes in api, libs/api-client, api-client-go project.json (apps/-rooted workspace), plus TS_NODE_TRANSPILE_ONLY=true (api has pre-existing WIP type errors) and upstream's enumUnknownDefaultCase=true restored on both clients.
  • apps/api/.env.example — offline placeholder env for spec generation (cp api/.env.example api/.env), following the repo's existing .env.example gitignore-exception precedent. SKIP_CONNECTIONS=true (already in the nx target) keeps it offline; values are docker-compose placeholders.
  • @ApiExcludeController() on the four boxlite-rest controllers. That surface is spec-first — its contract is openapi/box.openapi.yaml (the controllers' own docs say so) — and in the swagger-emitted product spec it is OpenAPI-3.0-invalid: :prefix route tokens have no declared path param, and the proxy's @All() expands to the SEARCH verb, which OpenAPI 3.0 cannot express. This invalidity is what broke openapi-generator entirely. The generated BoxLiteREST surface had zero consumers (verified across cli/sdk-go/sdk-typescript/dashboard/daemon).
  • .github/workflows/api-client-drift.yml — port of upstream's drift gate: regenerate both clients on apps/** PRs and fail on diff (redis service container avoids a bootstrap retry-race; actionlint/shellcheck clean).

Commit 2 — regenerated clients (generator output only, no hand edits)

  • WebhookEvent enums now match the server: sandbox.createdbox.created, sandbox.state.updatedbox.state.updated (TS + Go) — this was the consumer-facing break from Post-merge follow-ups for #706 (Sandbox→Box Part 1): client regen + staging migration + CodeQL #711.
  • sandboxIdOrName path-template vars → boxIdOrName; stale "…of the sandbox" doc text → box. Both clients now contain zero sandbox tokens.
  • Go client regression fixed: version.go (go:embed VERSION) restored, UserAgent: "api-client-go/" + ClientVersion instead of the stock "OpenAPI-Generator/1.0.0/go".
  • UNKNOWN_DEFAULT_OPEN_API enum members added across both clients (upstream's enumUnknownDefaultCase=true — forward-compat with unknown server enum values).
  • New TS models/apis picked up (drift catch-up: DTOs and tags added to the api since the last regen), plus the generator's src/docs/*.md — not previously committed, but the drift gate requires committed output to match emitted output exactly, so they're in (upstream suppresses docs; we commit-as-emitted).
  • api_box_lite_rest.go deleted (−4801 lines): the excluded, consumer-less spec-first surface above.

Verification

  • Spec generates cleanly: 0 sandbox tokens, box.* webhook events, 0 {prefix} paths.
  • Regeneration is idempotent (two consecutive runs → identical git status).
  • tsc -p libs/api-client/tsconfig.lib.json → exit 0.
  • go build ./... clean in api-client-go and apps/cli (the Go consumer).
  • No source anywhere references the removed BoxLiteREST generated API or old SANDBOX_* enum members.
  • New workflow passes actionlint + shellcheck.

Not in scope

  • analytics-api-client: its input swagger comes from the external analytics service (upstream excludes it from regen for the same reason); it still contains sandbox.* until that service renames.
  • apps/yarn.lock stays uncommitted (explicitly gitignored by repo policy); the drift job does a plain yarn install. Committing a lockfile would make the gate fully deterministic — separate policy decision.
  • Remaining cosmetic sandbox strings in cli docs / shim (tracked in Post-merge follow-ups for #706 (Sandbox→Box Part 1): client regen + staging migration + CodeQL #711).

The apps/ subtree import dropped the root-level support files that made
'yarn generate:api-client' reproducible in daytonaio/daytona:

- openapitools.json: pin openapi-generator to 7.23.0 (matches the committed
  clients); without it every machine floats to the latest jar
- hack/{ts,go}-client: upstream postprocess scripts (User-Agent branding,
  go version.go via go:embed) and the custom Go mustache templates
- nx target paths: written for upstream's repo-root workspace; rewrite for
  the apps/-rooted workspace (api/src/..., -o api-client-go) and add
  TS_NODE_TRANSPILE_ONLY for the WIP type errors
- api/.env.example: offline dev/CI env for generate-openapi.ts (upstream
  commits apps/api/.env; boxlite ignores .env so ship an example + gitignore
  exception, copy to api/.env before generating)
- @ApiExcludeController on boxlite-rest controllers: that surface is
  spec-first (openapi/box.openapi.yaml); in the product spec its :prefix
  routes and @ALL()-expanded SEARCH verb are OpenAPI-invalid and broke
  generation
- api-client-drift.yml: port of upstream's format-lint-api-clients gate -
  regenerate and fail on diff, so clients can no longer go stale

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
Pure openapi-generator 7.23.0 output via the restored machinery — no hand
edits. Closes the client-staleness item from #711:

- WebhookEvent enums now match the server: sandbox.created -> box.created,
  sandbox.state.updated -> box.state.updated (TS + Go)
- sandboxIdOrName path-template vars -> boxIdOrName; stale sandbox doc text
  caught up; both clients now contain zero sandbox tokens
- Go client regression fixed: version.go (go:embed VERSION) restored and
  UserAgent is api-client-go/<version> again instead of the stock generator
  string
- UNKNOWN_DEFAULT_OPEN_API members added everywhere (enumUnknownDefaultCase)
- new TS models picked up (api DTOs added since the previous regen)
- api_box_lite_rest.go deleted: the boxlite-rest surface is spec-first
  (openapi/box.openapi.yaml) and its generated client had zero consumers

Verified: regen idempotent; tsc exit 0 on libs/api-client; go build + vet
clean in api-client-go and apps/cli.

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
@DorianZheng DorianZheng requested a review from a team as a code owner June 10, 2026 05:10
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 300 files, which is 150 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e9802f40-38ae-4d98-9aac-21734bbffb9a

📥 Commits

Reviewing files that changed from the base of the PR and between 2d6ae82 and f2dc08f.

📒 Files selected for processing (300)
  • .github/workflows/api-client-drift.yml
  • .gitignore
  • apps/api-client-go/.openapi-generator/FILES
  • apps/api-client-go/api/openapi.yaml
  • apps/api-client-go/api_admin.go
  • apps/api-client-go/api_box.go
  • apps/api-client-go/api_box_lite_rest.go
  • apps/api-client-go/api_preview.go
  • apps/api-client-go/api_toolbox.go
  • apps/api-client-go/client.go
  • apps/api-client-go/configuration.go
  • apps/api-client-go/go.mod
  • apps/api-client-go/model_box.go
  • apps/api-client-go/model_box_class.go
  • apps/api-client-go/model_box_desired_state.go
  • apps/api-client-go/model_box_info.go
  • apps/api-client-go/model_box_state.go
  • apps/api-client-go/model_create_box.go
  • apps/api-client-go/model_create_snapshot.go
  • apps/api-client-go/model_job_status.go
  • apps/api-client-go/model_job_type.go
  • apps/api-client-go/model_organization.go
  • apps/api-client-go/model_port_preview_url.go
  • apps/api-client-go/model_pty_create_request.go
  • apps/api-client-go/model_pty_session_info.go
  • apps/api-client-go/model_region_type.go
  • apps/api-client-go/model_runner_state.go
  • apps/api-client-go/model_signed_port_preview_url.go
  • apps/api-client-go/model_snapshot_state.go
  • apps/api-client-go/model_ssh_access_dto.go
  • apps/api-client-go/model_toolbox_proxy_url.go
  • apps/api-client-go/model_update_box_state_dto.go
  • apps/api-client-go/model_volume_state.go
  • apps/api-client-go/model_webhook_event.go
  • apps/api-client-go/model_workspace.go
  • apps/api-client-go/project.json
  • apps/api-client-go/version.go
  • apps/api/.env.example
  • apps/api/project.json
  • apps/api/src/boxlite-rest/boxlite-box.controller.ts
  • apps/api/src/boxlite-rest/boxlite-config.controller.ts
  • apps/api/src/boxlite-rest/boxlite-me.controller.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.ts
  • apps/hack/go-client/openapi-templates/model.mustache
  • apps/hack/go-client/openapi-templates/model_enum.mustache
  • apps/hack/go-client/postprocess.sh
  • apps/hack/ts-client/postprocess.sh
  • apps/libs/api-client/project.json
  • apps/libs/api-client/src/.openapi-generator/FILES
  • apps/libs/api-client/src/api.ts
  • apps/libs/api-client/src/api/admin-api.ts
  • apps/libs/api-client/src/api/auth-api.ts
  • apps/libs/api-client/src/api/box-api.ts
  • apps/libs/api-client/src/api/preview-api.ts
  • apps/libs/api-client/src/api/snapshots-api.ts
  • apps/libs/api-client/src/api/toolbox-api.ts
  • apps/libs/api-client/src/configuration.ts
  • apps/libs/api-client/src/docs/AccountProvider.md
  • apps/libs/api-client/src/docs/AdminApi.md
  • apps/libs/api-client/src/docs/AdminCreateRunner.md
  • apps/libs/api-client/src/docs/Announcement.md
  • apps/libs/api-client/src/docs/ApiKeyList.md
  • apps/libs/api-client/src/docs/ApiKeyResponse.md
  • apps/libs/api-client/src/docs/ApiKeysApi.md
  • apps/libs/api-client/src/docs/AuditApi.md
  • apps/libs/api-client/src/docs/AuditLog.md
  • apps/libs/api-client/src/docs/AuthApi.md
  • apps/libs/api-client/src/docs/Box.md
  • apps/libs/api-client/src/docs/BoxApi.md
  • apps/libs/api-client/src/docs/BoxClass.md
  • apps/libs/api-client/src/docs/BoxDesiredState.md
  • apps/libs/api-client/src/docs/BoxInfo.md
  • apps/libs/api-client/src/docs/BoxLabels.md
  • apps/libs/api-client/src/docs/BoxState.md
  • apps/libs/api-client/src/docs/BoxVolume.md
  • apps/libs/api-client/src/docs/BoxliteConfiguration.md
  • apps/libs/api-client/src/docs/BuildInfo.md
  • apps/libs/api-client/src/docs/Command.md
  • apps/libs/api-client/src/docs/CompletionContext.md
  • apps/libs/api-client/src/docs/CompletionItem.md
  • apps/libs/api-client/src/docs/CompletionList.md
  • apps/libs/api-client/src/docs/CompressedScreenshotResponse.md
  • apps/libs/api-client/src/docs/ComputerUseStartResponse.md
  • apps/libs/api-client/src/docs/ComputerUseStatusResponse.md
  • apps/libs/api-client/src/docs/ComputerUseStopResponse.md
  • apps/libs/api-client/src/docs/ConfigApi.md
  • apps/libs/api-client/src/docs/CreateApiKey.md
  • apps/libs/api-client/src/docs/CreateBox.md
  • apps/libs/api-client/src/docs/CreateBuildInfo.md
  • apps/libs/api-client/src/docs/CreateDockerRegistry.md
  • apps/libs/api-client/src/docs/CreateLinkedAccount.md
  • apps/libs/api-client/src/docs/CreateOrganization.md
  • apps/libs/api-client/src/docs/CreateOrganizationInvitation.md
  • apps/libs/api-client/src/docs/CreateOrganizationQuota.md
  • apps/libs/api-client/src/docs/CreateOrganizationRole.md
  • apps/libs/api-client/src/docs/CreateRegion.md
  • apps/libs/api-client/src/docs/CreateRegionResponse.md
  • apps/libs/api-client/src/docs/CreateRunner.md
  • apps/libs/api-client/src/docs/CreateRunnerResponse.md
  • apps/libs/api-client/src/docs/CreateSessionRequest.md
  • apps/libs/api-client/src/docs/CreateSnapshot.md
  • apps/libs/api-client/src/docs/CreateUser.md
  • apps/libs/api-client/src/docs/CreateVolume.md
  • apps/libs/api-client/src/docs/CreateWorkspace.md
  • apps/libs/api-client/src/docs/DisplayInfoResponse.md
  • apps/libs/api-client/src/docs/DockerRegistry.md
  • apps/libs/api-client/src/docs/DockerRegistryApi.md
  • apps/libs/api-client/src/docs/DownloadFiles.md
  • apps/libs/api-client/src/docs/ExecuteRequest.md
  • apps/libs/api-client/src/docs/ExecuteResponse.md
  • apps/libs/api-client/src/docs/FileInfo.md
  • apps/libs/api-client/src/docs/FileStatus.md
  • apps/libs/api-client/src/docs/GitAddRequest.md
  • apps/libs/api-client/src/docs/GitBranchRequest.md
  • apps/libs/api-client/src/docs/GitCheckoutRequest.md
  • apps/libs/api-client/src/docs/GitCloneRequest.md
  • apps/libs/api-client/src/docs/GitCommitInfo.md
  • apps/libs/api-client/src/docs/GitCommitRequest.md
  • apps/libs/api-client/src/docs/GitCommitResponse.md
  • apps/libs/api-client/src/docs/GitDeleteBranchRequest.md
  • apps/libs/api-client/src/docs/GitRepoRequest.md
  • apps/libs/api-client/src/docs/GitStatus.md
  • apps/libs/api-client/src/docs/HealthApi.md
  • apps/libs/api-client/src/docs/HealthControllerCheck200Response.md
  • apps/libs/api-client/src/docs/HealthControllerCheck200ResponseInfoValue.md
  • apps/libs/api-client/src/docs/Job.md
  • apps/libs/api-client/src/docs/JobStatus.md
  • apps/libs/api-client/src/docs/JobType.md
  • apps/libs/api-client/src/docs/JobsApi.md
  • apps/libs/api-client/src/docs/KeyboardHotkeyRequest.md
  • apps/libs/api-client/src/docs/KeyboardPressRequest.md
  • apps/libs/api-client/src/docs/KeyboardTypeRequest.md
  • apps/libs/api-client/src/docs/ListBranchResponse.md
  • apps/libs/api-client/src/docs/LogEntry.md
  • apps/libs/api-client/src/docs/LspCompletionParams.md
  • apps/libs/api-client/src/docs/LspDocumentRequest.md
  • apps/libs/api-client/src/docs/LspLocation.md
  • apps/libs/api-client/src/docs/LspServerRequest.md
  • apps/libs/api-client/src/docs/LspSymbol.md
  • apps/libs/api-client/src/docs/Match.md
  • apps/libs/api-client/src/docs/MetricDataPoint.md
  • apps/libs/api-client/src/docs/MetricSeries.md
  • apps/libs/api-client/src/docs/MetricsResponse.md
  • apps/libs/api-client/src/docs/MouseClickRequest.md
  • apps/libs/api-client/src/docs/MouseClickResponse.md
  • apps/libs/api-client/src/docs/MouseDragRequest.md
  • apps/libs/api-client/src/docs/MouseDragResponse.md
  • apps/libs/api-client/src/docs/MouseMoveRequest.md
  • apps/libs/api-client/src/docs/MouseMoveResponse.md
  • apps/libs/api-client/src/docs/MousePosition.md
  • apps/libs/api-client/src/docs/MouseScrollRequest.md
  • apps/libs/api-client/src/docs/MouseScrollResponse.md
  • apps/libs/api-client/src/docs/ObjectStorageApi.md
  • apps/libs/api-client/src/docs/OidcConfig.md
  • apps/libs/api-client/src/docs/Organization.md
  • apps/libs/api-client/src/docs/OrganizationBoxDefaultLimitedNetworkEgress.md
  • apps/libs/api-client/src/docs/OrganizationInvitation.md
  • apps/libs/api-client/src/docs/OrganizationRole.md
  • apps/libs/api-client/src/docs/OrganizationSuspension.md
  • apps/libs/api-client/src/docs/OrganizationUsageOverview.md
  • apps/libs/api-client/src/docs/OrganizationUser.md
  • apps/libs/api-client/src/docs/OrganizationsApi.md
  • apps/libs/api-client/src/docs/OtelConfig.md
  • apps/libs/api-client/src/docs/PaginatedAuditLogs.md
  • apps/libs/api-client/src/docs/PaginatedBoxes.md
  • apps/libs/api-client/src/docs/PaginatedJobs.md
  • apps/libs/api-client/src/docs/PaginatedLogs.md
  • apps/libs/api-client/src/docs/PaginatedSnapshots.md
  • apps/libs/api-client/src/docs/PaginatedTraces.md
  • apps/libs/api-client/src/docs/PollJobsResponse.md
  • apps/libs/api-client/src/docs/PortPreviewUrl.md
  • apps/libs/api-client/src/docs/Position.md
  • apps/libs/api-client/src/docs/PosthogConfig.md
  • apps/libs/api-client/src/docs/PreviewApi.md
  • apps/libs/api-client/src/docs/ProcessErrorsResponse.md
  • apps/libs/api-client/src/docs/ProcessLogsResponse.md
  • apps/libs/api-client/src/docs/ProcessRestartResponse.md
  • apps/libs/api-client/src/docs/ProcessStatusResponse.md
  • apps/libs/api-client/src/docs/ProjectDirResponse.md
  • apps/libs/api-client/src/docs/PtyCreateRequest.md
  • apps/libs/api-client/src/docs/PtyCreateResponse.md
  • apps/libs/api-client/src/docs/PtyListResponse.md
  • apps/libs/api-client/src/docs/PtyResizeRequest.md
  • apps/libs/api-client/src/docs/PtySessionInfo.md
  • apps/libs/api-client/src/docs/Range.md
  • apps/libs/api-client/src/docs/RateLimitConfig.md
  • apps/libs/api-client/src/docs/RateLimitEntry.md
  • apps/libs/api-client/src/docs/RegenerateApiKeyResponse.md
  • apps/libs/api-client/src/docs/Region.md
  • apps/libs/api-client/src/docs/RegionQuota.md
  • apps/libs/api-client/src/docs/RegionScreenshotResponse.md
  • apps/libs/api-client/src/docs/RegionType.md
  • apps/libs/api-client/src/docs/RegionUsageOverview.md
  • apps/libs/api-client/src/docs/RegionsApi.md
  • apps/libs/api-client/src/docs/RegistryPushAccessDto.md
  • apps/libs/api-client/src/docs/ReplaceRequest.md
  • apps/libs/api-client/src/docs/ReplaceResult.md
  • apps/libs/api-client/src/docs/ResizeBox.md
  • apps/libs/api-client/src/docs/Runner.md
  • apps/libs/api-client/src/docs/RunnerFull.md
  • apps/libs/api-client/src/docs/RunnerHealthMetrics.md
  • apps/libs/api-client/src/docs/RunnerHealthcheck.md
  • apps/libs/api-client/src/docs/RunnerServiceHealth.md
  • apps/libs/api-client/src/docs/RunnerSnapshotDto.md
  • apps/libs/api-client/src/docs/RunnerState.md
  • apps/libs/api-client/src/docs/RunnersApi.md
  • apps/libs/api-client/src/docs/ScreenshotResponse.md
  • apps/libs/api-client/src/docs/SearchFilesResponse.md
  • apps/libs/api-client/src/docs/SendWebhookDto.md
  • apps/libs/api-client/src/docs/Session.md
  • apps/libs/api-client/src/docs/SessionExecuteRequest.md
  • apps/libs/api-client/src/docs/SessionExecuteResponse.md
  • apps/libs/api-client/src/docs/SetSnapshotGeneralStatusDto.md
  • apps/libs/api-client/src/docs/SignedPortPreviewUrl.md
  • apps/libs/api-client/src/docs/SnapshotDto.md
  • apps/libs/api-client/src/docs/SnapshotManagerCredentials.md
  • apps/libs/api-client/src/docs/SnapshotState.md
  • apps/libs/api-client/src/docs/SnapshotsApi.md
  • apps/libs/api-client/src/docs/SshAccessDto.md
  • apps/libs/api-client/src/docs/SshAccessValidationDto.md
  • apps/libs/api-client/src/docs/StorageAccessDto.md
  • apps/libs/api-client/src/docs/ToolboxApi.md
  • apps/libs/api-client/src/docs/ToolboxProxyUrl.md
  • apps/libs/api-client/src/docs/TraceSpan.md
  • apps/libs/api-client/src/docs/TraceSummary.md
  • apps/libs/api-client/src/docs/UpdateBoxStateDto.md
  • apps/libs/api-client/src/docs/UpdateDockerRegistry.md
  • apps/libs/api-client/src/docs/UpdateJobStatus.md
  • apps/libs/api-client/src/docs/UpdateOrganizationDefaultRegion.md
  • apps/libs/api-client/src/docs/UpdateOrganizationInvitation.md
  • apps/libs/api-client/src/docs/UpdateOrganizationMemberAccess.md
  • apps/libs/api-client/src/docs/UpdateOrganizationQuota.md
  • apps/libs/api-client/src/docs/UpdateOrganizationRegionQuota.md
  • apps/libs/api-client/src/docs/UpdateOrganizationRole.md
  • apps/libs/api-client/src/docs/UpdateRegion.md
  • apps/libs/api-client/src/docs/Url.md
  • apps/libs/api-client/src/docs/User.md
  • apps/libs/api-client/src/docs/UserHomeDirResponse.md
  • apps/libs/api-client/src/docs/UserPublicKey.md
  • apps/libs/api-client/src/docs/UsersApi.md
  • apps/libs/api-client/src/docs/VolumeDto.md
  • apps/libs/api-client/src/docs/VolumeState.md
  • apps/libs/api-client/src/docs/VolumesApi.md
  • apps/libs/api-client/src/docs/WebhookAppPortalAccess.md
  • apps/libs/api-client/src/docs/WebhookControllerGetStatus200Response.md
  • apps/libs/api-client/src/docs/WebhookEvent.md
  • apps/libs/api-client/src/docs/WebhookInitializationStatus.md
  • apps/libs/api-client/src/docs/WebhooksApi.md
  • apps/libs/api-client/src/docs/WindowsResponse.md
  • apps/libs/api-client/src/docs/WorkDirResponse.md
  • apps/libs/api-client/src/docs/Workspace.md
  • apps/libs/api-client/src/docs/WorkspaceApi.md
  • apps/libs/api-client/src/docs/WorkspacePortPreviewUrl.md
  • apps/libs/api-client/src/git_push.sh
  • apps/libs/api-client/src/models/api-key-list.ts
  • apps/libs/api-client/src/models/api-key-response.ts
  • apps/libs/api-client/src/models/box-class.ts
  • apps/libs/api-client/src/models/box-desired-state.ts
  • apps/libs/api-client/src/models/box-info.ts
  • apps/libs/api-client/src/models/box-labels.ts
  • apps/libs/api-client/src/models/box-state.ts
  • apps/libs/api-client/src/models/box-volume.ts
  • apps/libs/api-client/src/models/box.ts
  • apps/libs/api-client/src/models/computer-use-status-response.ts
  • apps/libs/api-client/src/models/create-api-key.ts
  • apps/libs/api-client/src/models/create-box.ts
  • apps/libs/api-client/src/models/create-docker-registry.ts
  • apps/libs/api-client/src/models/create-organization-invitation.ts
  • apps/libs/api-client/src/models/create-organization-role.ts
  • apps/libs/api-client/src/models/create-snapshot.ts
  • apps/libs/api-client/src/models/create-user.ts
  • apps/libs/api-client/src/models/create-workspace.ts
  • apps/libs/api-client/src/models/docker-registry.ts
  • apps/libs/api-client/src/models/job-status.ts
  • apps/libs/api-client/src/models/job-type.ts
  • apps/libs/api-client/src/models/job.ts
  • apps/libs/api-client/src/models/organization-box-default-limited-network-egress.ts
  • apps/libs/api-client/src/models/organization-invitation.ts
  • apps/libs/api-client/src/models/organization-role.ts
  • apps/libs/api-client/src/models/organization-user.ts
  • apps/libs/api-client/src/models/organization.ts
  • apps/libs/api-client/src/models/paginated-boxes.ts
  • apps/libs/api-client/src/models/port-preview-url.ts
  • apps/libs/api-client/src/models/pty-create-request.ts
  • apps/libs/api-client/src/models/pty-session-info.ts
  • apps/libs/api-client/src/models/region-type.ts
  • apps/libs/api-client/src/models/resize-box.ts
  • apps/libs/api-client/src/models/runner-state.ts
  • apps/libs/api-client/src/models/signed-port-preview-url.ts
  • apps/libs/api-client/src/models/snapshot-state.ts
  • apps/libs/api-client/src/models/ssh-access-dto.ts
  • apps/libs/api-client/src/models/toolbox-proxy-url.ts
  • apps/libs/api-client/src/models/update-box-state-dto.ts
  • apps/libs/api-client/src/models/update-organization-invitation.ts
  • apps/libs/api-client/src/models/update-organization-member-access.ts
  • apps/libs/api-client/src/models/update-organization-role.ts
  • apps/libs/api-client/src/models/volume-state.ts
  • apps/libs/api-client/src/models/webhook-event.ts
  • apps/libs/api-client/src/models/workspace.ts
  • apps/openapitools.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/port-daytona-client-regen-machinery

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

apps/ never had a committed lockfile (the repo-root .gitignore blanket
predates the apps/ import), so a fresh CI checkout had no yarn project
anchor — yarn 4 walked up to the repo root and refused to install — and
every CI run would re-resolve all dependencies, letting floating
transitive deps (e.g. @nestjs/swagger) shift the generated spec and turn
the drift gate red for the wrong reason.

Commit the resolution validated end-to-end today (install, spec gen,
client regen, tsc, go build all green), add the !/apps/yarn.lock
gitignore exception, and switch the drift job to yarn install --immutable
with the yarn cache keyed on the lockfile (corepack before setup-node so
the cache probe sees yarn 4). Upstream daytona does the same.

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
@DorianZheng DorianZheng merged commit 8f8629c into main Jun 10, 2026
32 of 33 checks passed
@DorianZheng DorianZheng deleted the chore/port-daytona-client-regen-machinery branch June 10, 2026 05:29
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…ame (#718)

Closes the "Regenerate cli cobra docs + daemon swaggo docs" checkbox
from #711.

CLI Go source and daemon toolbox source are fully renamed (verified 0
`sandbox` tokens before regenerating), but the committed generated docs
predated the rename — cobra markdown/YAML still said "Create a new
sandbox" etc., and the toolbox swagger carried one stale token.

## Changes (all generator output + one script fix)

- `apps/cli/docs/*.md`, `apps/cli/hack/docs/*.yaml` — regenerated via
`hack/generate-cli-docs.sh` (`go run main.go generate-docs`). Diff =
sandbox→box description catch-up + genuine drift catch-up (newly
documented flags such as `--force`, `snapshot delete` usage gaining
`SNAPSHOT_NAME`).
- `apps/daemon/pkg/toolbox/docs/{docs.go,swagger.json,swagger.yaml}` —
regenerated via the daemon `docs` target command (`swag fmt && swag init
… && prettier`). Now 0 sandbox tokens.
- `apps/cli/hack/generate-cli-docs.sh` (+3) — adds a prettier pass over
`hack/docs/**/*.yaml`: the committed YAML is prettier-formatted while
raw cobra output is not, so without this every regen produces ~700 lines
of quoting/indent churn (observed 1172→478 changed lines). Mirrors what
the daemon docs target already does.

## Verification

- 0 `sandbox` tokens in all regenerated outputs (`git grep -i sandbox`
over the three docs trees: empty).
- Every changed line mechanically classified: rename catch-up,
prettier/cobra whitespace normalization, or the named new-flag drift —
nothing unexplained.
- shellcheck clean on the script.

Note: unlike the API clients (#716 added a drift gate), these docs have
no CI gate — staleness will accumulate again until regenerated; a
sibling drift job is a possible follow-up.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated CLI documentation to use "box" terminology instead of
"sandbox" across all commands and help text.
* Improved documentation formatting and alignment in command reference
guides.

* **New Features**
  * Added `boxlite autocomplete` command for shell completion support.
* Enhanced `boxlite snapshot delete` to accept both snapshot ID and
snapshot name.
* Added `--force` flag to `boxlite stop` command for force-stopping
boxes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
G4614 added a commit to G4614/boxlite that referenced this pull request Jun 10, 2026
Building on the path/tsconfig blockers fixed in the previous commit,
this clears the remaining 163 TS errors that surface once webpack
reaches tsc:

- 157 errors from Express 5's @types/express-serve-static-core@5.1.1
  widening ParamsDictionary[key] from `string` to `string | string[]`.
  Express still only returns strings at runtime, so narrow the three
  Request types that funnel into the controllers + interceptors:
    audit.decorator.ts        — AuditContext + TypedRequest
    audit.interceptor.ts      — RequestWithUser
    metrics.interceptor.ts    — RequestWithUser

- 3 errors from an OTel package version skew: sdk-node@^0.218.0 brings
  otlp-exporter-base@0.218 to the hoisted root, but the http exporters
  (exporter-trace/metrics/logs-otlp-http) are still pinned at ^0.207
  and carry their own nested 0.207 copy with an incompatible `headers`
  typing. Cast at the three call sites in tracing.ts until the http
  exporters get bumped to 0.218 in a follow-up dep-bump PR.

- 2 TS2307 errors from runner-api-client not being reachable. The
  Dockerfile COPYs libs to /boxlite/libs/ (which nx's project sourceRoot
  expects) but tsconfig paths declare libs at apps/libs/ relative to
  apps/tsconfig.base.json. Bridge with `ln -s ../libs apps/libs` so both
  consumers see the libs where they expect.

- TS6059 (lib files outside rootDir) that surfaced once the symlink let
  TS reach the lib sources. Widen tsconfig.base.json rootDir from "."
  to ".." so /boxlite/libs/* falls inside the rootDir of /boxlite/.

End state: `docker build -f apps/api/Dockerfile .` produces a working
2.21 MiB dist/apps/api/main.js. Dashboard build (Step 22 of the same
Dockerfile) is still blocked by an *independent* boxlite-ai#706 fallout —
apps/libs/api-client/src/models/index.ts references 12 box-*.ts files
that boxlite-ai#706 forgot to regenerate via openapi-generator. That regen
machinery was restored in upstream boxlite-ai#716; rebasing onto post-boxlite-ai#716 main
picks up the regenerated files and dashboard should follow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…wagger spec (#721)

## Summary

Closes out the **analytics-api-client** item of #711 (Sandbox→Box Part 1
follow-ups).

#706 renamed the dashboard's analytics consumers to Box-named symbols
(`ModelsBoxUsage`, `organizationOrganizationIdUsageBoxGet`, …) but the
committed client still only exported Sandbox-named ones — the dashboard
could not typecheck against the in-repo client. The client also couldn't
be regenerated from this repo at all: its generator input was an
uncommitted `tmp/swagger.json` from the external analytics service (the
reason #716 excluded it).

## Changes

- **Commit the contract in-repo**:
`apps/libs/analytics-api-client/swagger.json`, reconstructed 1:1 from
the previously committed client with only sandbox→box renamed (paths
`/organization/{organizationId}/box/{boxId}/…`, `models.BoxUsage`,
`boxId`, `boxCount`). This is now the spec any future analytics service
must implement — same spec-first direction as
`openapi/box.openapi.yaml`.
- **Point `generate:api-client` at it** (`project.json`), with nx cache
inputs tracking the spec instead of the unrelated `apiClient` named
input.
- **Regenerate** with the pinned openapi-generator **7.23.0** (committed
client was stale 7.12.0 output — the last client on the old generator).
Zero `sandbox` tokens remain.
- **Drift gate**: drop the analytics exclusion from
`api-client-drift.yml` — it now regenerates + diffs analytics like the
other clients (actionlint clean).
- **eslint**: ignore `**/.nx/**` — the generate target caches its `src/`
output under the gitignored `apps/.nx/cache`, and lint after a local
regen tripped on the cached copy of generated code.

## Verification

- Two-side dashboard typecheck: against the **old** client → 13
rename-mismatch errors (`'ModelsBoxUsage'… Did you mean
'ModelsSandboxUsage'?`); against the **new** client → **zero**
analytics-related errors (remaining 24 are pre-existing, unrelated:
Playground/VNC files + unbuilt `@boxlite-ai/sdk` dist).
- Regen is byte-identical across runs (`--skip-nx-cache`), so the drift
gate won't false-positive.
- `make lint:apps` exit 0.

## Notes

- Runtime risk is nil: the analytics client is only instantiated when
`ANALYTICS_API_URL` is configured, no analytics service exists in the
org today, and the API's own (already-renamed) `box/:boxId/telemetry/*`
endpoints serve the dashboard otherwise (`AnalyticsApiDisabledGuard`
makes the two mutually exclusive).
- Pre-existing, **not** fixed here (scope):
`apps/dashboard/tsconfig.app.json` path mappings (`\"@boxlite-ai/*\":
[\"../../libs/*\"]`) have pointed outside the workspace since the apps
tree was flattened (#460), so raw `tsc -p` never resolved any
`@boxlite-ai/*` import. Worth its own follow-up.

Part of #711.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * Added AWS Signature V4 support for API requests.
* Telemetry and usage endpoints now operate at box (per-box) and
organization levels (replacing sandbox-level variants).

* **Documentation**
* Comprehensive API docs added/updated with examples for box telemetry,
per-box usage, aggregated usage, and usage chart endpoints.

* **Chores**
* Drift detection updated to include the analytics API client; linting
ignores extended for generated files.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…lient, fix dead env vars + stale refs

- regenerate toolbox-api-client from the (already-renamed) committed
  daemon swagger: 7.12.0 → pinned 7.23.0 generator, kills the last
  4 generated "sandbox entrypoint" doc-comments; missed by #716/#718
  which covered only the product clients
- add toolbox-api-client to the api-client-drift gate with
  --excludeTaskDependencies (committed daemon swagger is the contract;
  daemon-source↔swagger drift stays ungated, needs swag toolchain)
- fix nx paths broken since the apps/ workspace flattening: generator
  -i specs in toolbox/runner client project.json (apps/daemon→daemon,
  apps/runner→runner — toolbox regen failed outright on the stale
  path) and nx.json cache inputs (go.work, daemon swagger), which
  pointed at nonexistent files and never invalidated caches
- e2e bootstrap.sh + infra-local api.env wrote ADMIN_MAX_*_PER_SANDBOX
  but the API reads ADMIN_MAX_*_PER_BOX (configuration.ts:292) with
  default 0 — admin-org per-box quotas were silently unset
- stack-reset.sh and infra-local README TRUNCATE/SELECT table
  `sandbox`, which migration 1781016743403 renamed to `box`; also
  /api/sandbox routes → /api/box and {{sandboxId}} → {{boxId}} per
  the configuration DTO example
- sweep remaining sandbox vocabulary from e2e cases, teardown,
  runner-update-binary.sh, and infra-local docs (comments,
  docstrings, test function names; no selector references them)
- includes 3 files prettier-normalized by the repo's `make lint:fix`
  pre-commit autofixer (eslint.config.mjs, Sidebar.tsx,
  Onboarding.tsx) — out of format on main; the hook is repo-wide
  and re-applies them on every commit until committed

Part of #711.

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
DorianZheng added a commit that referenced this pull request Jun 10, 2026
…lient, fix dead env vars + stale refs (#723)

Part of #711 — closes out the "Part 1 of N" remainder. A repo-wide sweep
found the rename effectively complete in source
(`runner`/`cli`/`daemon`/`dashboard`/`proxy` at zero tokens; `apps/api`
leftovers are historical migrations, correct as-is). What remained is
below.

## Generated client (the bulk of the diff)

**`toolbox-api-client` regenerated** from the committed
`apps/daemon/pkg/toolbox/docs/swagger.json` (which #718 already renamed
— `git grep "sandbox entrypoint"` has zero hits outside the generated
client). This kills the last 4 generated `sandbox entrypoint session`
doc-comments and moves the client from generator 7.12.0 to the pinned
7.23.0, same modernization #721 did for analytics (hence the
`src/docs/*.md` additions — 7.23 emits them, and the drift gate requires
committed == emitted).

Determinism verified: regen run twice locally (with and without
`--excludeTaskDependencies`), byte-identical both times.

**Drift gate now covers it** (`api-client-drift.yml`): regen via
`--excludeTaskDependencies` so the committed daemon swagger is the
contract and the job needs no Go/swag toolchain. Daemon-source↔swagger
drift stays ungated (the cli/daemon-docs sibling gate noted in #711
remains a follow-up). actionlint + shellcheck clean.

## Why the toolbox client was never regenerated: broken nx paths

The regen target failed outright: `-i
apps/daemon/pkg/toolbox/docs/swagger.json` resolves relative to the nx
workspace root, which *is* `apps/` → `apps/apps/daemon/...` (spec not
found). Kept from upstream daytona's repo layout; #716 fixed only the
product clients' targets. Fixed here:

- `libs/toolbox-api-client/project.json` — `-i
daemon/pkg/toolbox/docs/swagger.json`
- `libs/runner-api-client/project.json` — same latent bug (`-i
runner/...` + its `{workspaceRoot}` input)
- `nx.json` — `apiClient`/`goProduction` named inputs pointed at
`{workspaceRoot}/apps/...` paths that don't exist, so swagger/go.work
changes never invalidated task caches

## Functional config fixes

- **`scripts/test/e2e/bootstrap.sh` +
`apps/infra-local/configs/api.env`** wrote
`ADMIN_MAX_{CPU,MEMORY,DISK}_PER_SANDBOX`, but the API reads
`ADMIN_MAX_*_PER_BOX` (`apps/api/src/config/configuration.ts:292-294`)
with default `0` — admin-org per-box quotas were silently unset.
- **`apps/infra-local/scripts/stack-reset.sh` + README runbook
snippets** ran `TRUNCATE TABLE sandbox, ...` / `SELECT ... FROM sandbox`
— that table was renamed to `box` by migration `1781016743403`, so these
failed as written. Also `/api/sandbox` → `/api/box` (route is
`@Controller('box')`) and `{{sandboxId}}` → `{{boxId}}` (matches the
`configuration.dto.ts` example). infra-local merged in #595 on a
pre-#706 vocabulary.

## Vocabulary sweep (no behavior change)

Comments, docstrings, and three e2e test function names
(`test_*_above_per_sandbox_limit_*` → `per_box`; no `-k` selector,
workflow, or Makefile references them) across `scripts/test/e2e/`,
`scripts/deploy/runner-update-binary.sh`, and `apps/infra-local/`.
File/path references verified against the tree (`box.service.ts`,
`volume.manager.ts:47`, `box_sync.go`, `CREATE_BOX` journal tokens). All
three trees now grep-clean for `sandbox`.

Also includes 3 files prettier-normalized by the repo's `make lint:fix`
pre-commit autofixer (`eslint.config.mjs`, `Sidebar.tsx`,
`Onboarding.tsx`) — they were out of format on `main` and the repo-wide
hook re-applies them on every commit until committed.

## Verification

- Regen byte-identical across repeated runs, including the exact CI
invocation
- `actionlint` + `shellcheck` on the workflow; `shellcheck` on all 6
edited shell scripts (only pre-existing findings on untouched lines);
`py_compile` on all 7 edited Python files
- Every text replacement applied with an exact-unique-match assertion
(count==1 before replace)
- OS-isolation uses of "sandbox" (jailer/seatbelt/bwrap, docs/faq)
deliberately untouched — different concept per the rename's scope

Signed-off-by: dorianzheng <xingzhengde72@gmail.com>
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