Skip to content

chore(apps): remove TypeScript cloud SDK (re-apply #738 onto main)#743

Merged
G4614 merged 2 commits into
mainfrom
chore/remove-ts-cloud-sdk
Jun 12, 2026
Merged

chore(apps): remove TypeScript cloud SDK (re-apply #738 onto main)#743
G4614 merged 2 commits into
mainfrom
chore/remove-ts-cloud-sdk

Conversation

@law-chain-hot

@law-chain-hot law-chain-hot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Re-applies chore(apps): remove TypeScript cloud SDK #738 onto main. chore(apps): remove TypeScript cloud SDK #738 was merged with base feat/box-curated-image-boot by mistake, so its content never reached main.
  • Removes the publishable apps/libs/sdk-typescript project and its Nx/build references.
  • Replaces Dashboard's @boxlite-ai/sdk usage with the Dashboard-private cloudBox adapter backed by generated REST clients.
  • Removes TypeScript Cloud SDK playground snippets so the UI no longer teaches users to install @boxlite-ai/sdk.

Differences from #738

Cherry-pick of squash commit 2f5aac6b with three conflict resolutions against current main:

Architecture Context: why delete + rewrite (not a rename)

                BEFORE                                     AFTER
   ┌────────────────┐  ┌─────────────┐         ┌──────────────────────┐
   │ A. Dashboard   │  │ External TS │         │ A. Dashboard          │   External TS users
   └───────┬────────┘  │    users    │         │  ├ UI components      │        │
           │           └──────┬──────┘         │  ├ hooks              │        │
   ┌───────▼──────────────────▼──────┐         │  └ lib/cloudBox.ts ★NEW│       │
   │ B. @boxlite-ai/sdk             │          │    (458-line private  │        │
   │   (apps/libs/sdk-typescript)   │ DELETED  │     adapter)          │        │
   │   9.8k lines, Daytona-derived  │          └──────────┬────────────┘        │
   └───────────────┬───────────────┘                      │                     │
   ┌───────────────▼───────────────┐          ┌───────────▼─────────────────────▼──┐
   │ C. @boxlite-ai/api-client     │          │ C. @boxlite-ai/api-client          │
   │   (generated from OpenAPI)    │          │   (unchanged, still published)     │
   └───────────────┬───────────────┘          └───────────────┬────────────────────┘
                   ▼                                          ▼
              REST API (apps/api)                        REST API (apps/api)

What each layer is. api-client is machine-generated from the API's OpenAPI
spec — it only knows how to call endpoints. The deleted SDK (B) and the new
cloudBox.ts are the handwritten glue above it: form-params → DTO mapping,
poll-until-started, attaching .process/.fs helpers to box objects. Glue
logic is not in the OpenAPI contract, so it cannot be generated.

Why cloudBox.ts is added, not renamed. It is a from-scratch minimal
reimplementation of the <5% of the SDK the Dashboard actually used: 458 lines
vs the SDK's 9.8k, only ~9 identical lines with the old Box.ts
(git diff -M20% detects no rename). Marking it a rename would wrongly suggest
the full SDK class hierarchy survived.

Why delete the SDK at all.

  1. Provenance: it is Daytona-derived AGPL code in a repo that competes with
    Daytona — licensing and optics liability.
  2. Maintenance: every API change (renames, DTO removals, client regen) had to
    sweep 9.8k lines to serve a single internal consumer using <5% of it.
  3. Strategy: our public SDK story is the dual-mode native SDKs
    (Python/Node/Go/C, embedded engine + optional REST). A parallel cloud-only
    TS SDK was a competing second "official way".

What external users keep. The cloud REST API is unchanged; the generated
clients (@boxlite-ai/api-client, api-client-go) remain published. Only the
convenience wrapper is gone.

Known follow-ups (out of scope here).

  • cloudBox.ts still carries the Daytona AGPL header — needs a clean-room pass.
  • Dead tail to remove once Playground is officially retired: hidden Playground
    routes, toolbox-api-client TS package (zero runtime callers), and the
    computer-use/git sections of cloudBox.ts.

Verification

  • vite build --minify false error set diffed against an origin/main baseline worktree: no new errors beyond pre-existing main failures (line-number shifts only).
  • Note: dashboard:build is currently broken on main itself (lightningcss minify + @boxlite-ai/api-client resolution), unrelated to this change.

Relation to #735

feat/box-curated-image-boot (#735) will be rebuilt on top of this branch so its diff contains only the curated-image work.

Summary by CodeRabbit

  • New Features

    • Dashboard now uses the CloudBox-backed API client for box creation and session flows.
  • Bug Fixes

    • Refactored creation/loading flows to improve reliability when creating or loading boxes.
  • Removed Features

    • TypeScript code snippet generation removed — Python is now the sole generated language.

- Remove the publishable apps/libs/sdk-typescript project and its
Nx/build references.
- Replace Dashboard's prior @boxlite-ai/sdk usage with a
Dashboard-private cloudBox adapter backed by generated REST clients.
- Remove TypeScript Cloud SDK playground snippets so the UI no longer
teaches users to install @boxlite-ai/sdk.

The large diff is not because the delete itself is complicated. It is
because `apps/libs/sdk-typescript` had two roles mixed together: it was
a customer-facing package, and Dashboard was also importing it as an
internal cloud box facade.

Legend:
- `*** DELETE TARGET ***` = the package this PR removes.
- `*** REMOVED USER SURFACE ***` = user-facing code/docs path removed
because it advertised that package.
- `[kept]` = still exists after this PR.
- `[new internal]` = Dashboard-only replacement, not a public SDK.

```text
BEFORE

*** REMOVED USER SURFACE ***
+------------------------------------------------+
| Playground TypeScript snippet                  |
| tells users: npm install @boxlite-ai/sdk       |
+-------------------------+----------------------+
                          |
                          | teaches users this package exists
                          v
+------------------------------------------------+      imports       +------------------------------------------------+
| Dashboard Playground                           | -----------------> | *** DELETE TARGET ***                          |
| hooks/providers/VNC/snippets                   |                    | apps/libs/sdk-typescript                       |
|                                                |                    | public package: @boxlite-ai/sdk                |
+------------------------------------------------+                    +-------------------------+----------------------+
                                                                                              |
                                                                                              | wraps
                                                                                              v
                                                                             +------------------------------------------------+
                                                                             | [kept] generated REST API clients             |
                                                                             | api-client / toolbox-api-client               |
                                                                             +-------------------------+----------------------+
                                                                                                       |
                                                                                                       | HTTP
                                                                                                       v
                                                                             +------------------------------------------------+
                                                                             | [kept] BoxLite API / toolbox runtime          |
                                                                             +------------------------------------------------+

Build graph tied to the delete target:
Dashboard tsconfig alias -> Vite SDK alias/polyfills -> Nx dependency -> Docker COPY -> eslint exception
```

```text
AFTER

*** REMOVED USER SURFACE ***
+------------------------------------------------+
| Playground TypeScript snippet                  |
| npm install @boxlite-ai/sdk                    |
|                                                |
| STATUS: DELETED                                |
+------------------------------------------------+

*** DELETE TARGET ***
+------------------------------------------------+
| apps/libs/sdk-typescript                       |
| public package: @boxlite-ai/sdk                |
|                                                |
| STATUS: DELETED                                |
+------------------------------------------------+

Dashboard internal path, after removing the public SDK dependency:

+------------------------------------------------+      imports       +------------------------------------------------+
| [kept] Dashboard Playground                    | -----------------> | [new internal] Dashboard-private cloudBox       |
| hooks/providers/VNC/snippets                   |                    | apps/dashboard/src/lib/cloudBox.ts             |
|                                                |                    | small adapter; not published to customers      |
+------------------------------------------------+                    +-------------------------+----------------------+
                                                                                              |
                                                                                              | calls
                                                                                              v
                                                                             +------------------------------------------------+
                                                                             | [kept] generated REST API clients             |
                                                                             | api-client / toolbox-api-client               |
                                                                             +-------------------------+----------------------+
                                                                                                       |
                                                                                                       | HTTP
                                                                                                       v
                                                                             +------------------------------------------------+
                                                                             | [kept] BoxLite API / toolbox runtime          |
                                                                             +------------------------------------------------+

Build graph cleanup after deleting the target:
No @boxlite-ai/sdk alias -> no SDK Vite polyfills -> no Nx build edge -> no Docker COPY -> no SDK lint exception
```

So the diff fans out into four necessary buckets:

1. Delete the public SDK project itself: `apps/libs/sdk-typescript/**`.
2. Keep Dashboard working by replacing SDK imports with
`apps/dashboard/src/lib/cloudBox.ts`.
3. Stop advertising the removed SDK in Playground code snippets.
4. Remove build-system references that would otherwise point at a
deleted project.

- NX_DAEMON=false corepack yarn nx build dashboard
--configuration=development --nxBail=true --output-style=stream
- NX_DAEMON=false corepack yarn nx build api --configuration=development
--nxBail=true --output-style=stream
- make lint:apps
- rg -n "@boxlite-ai/sdk|sdk-typescript" . -S
@law-chain-hot law-chain-hot requested a review from a team as a code owner June 12, 2026 04:02
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Introduce a CloudBox client abstraction and helpers, refactor dashboard hooks/components to call API clients and use CloudBox types, remove SDK-TypeScript aliases and tooling, and update build/config to stop referencing the local TypeScript SDK.

Changes

SDK-TypeScript Migration to CloudBox Abstraction

Layer / File(s) Summary
CloudBox abstraction layer
apps/dashboard/src/lib/cloudBox.ts
New module introducing CodeLanguage, Resources, CreateBoxParams, CloudBox types and exports: toCreateBoxRequest(), createCloudBox(), waitUntilStarted(), capability client factories, getRunCommand(), withEnvironment(), and helpers.
Hook refactor: use API clients and CloudBox
apps/dashboard/src/hooks/useBoxSession.ts, apps/dashboard/src/hooks/mutations/useCreateBoxMutation.tsx
useBoxSession and the create-box mutation now use boxApi + toCreateBoxRequest, call waitUntilStarted, and wrap API responses with createCloudBox; removed BoxLite client construction and auth/config usage.
Dashboard components → CloudBox types
apps/dashboard/src/components/Playground/..., apps/dashboard/src/contexts/PlaygroundContext.tsx, apps/dashboard/src/lib/playground.tsx, apps/dashboard/src/providers/PlaygroundProvider.tsx
Multiple components and context files import CodeLanguage, Resources, and CloudBoxComputerUse from @/lib/cloudBox instead of the SDK; code snippet generation simplified to Python-only; VNC interaction components cast clients to CloudBoxComputerUse; default image set to 'base'.
Config and build updates
apps/dashboard/tsconfig.app.json, apps/dashboard/vite.config.mts, apps/dashboard/.storybook/main.ts, apps/api/Dockerfile, apps/dashboard/project.json, apps/eslint.config.mjs, apps/tsconfig.base.json, apps/infra-local/scripts/stack-up.sh
Removed @boxlite-ai/sdk TypeScript path alias and Vite/Storybook SDK alias/polyfills; updated Vite build options; Dockerfile now copies *-api-client workspaces and drops sdk-typescript; adjusted Nx build dependency and clarified local dev docs.
SDK-TypeScript cleanup
apps/libs/sdk-typescript/...
Deleted legacy SDK artifacts including OpenTelemetry decorator utility and (in other hunks) many SDK sources, configs, tests, and docs.

Sequence Diagram

sequenceDiagram
  participant UI as Dashboard UI (hook)
  participant useApi as useApi
  participant BoxApi as boxApi
  participant Poll as waitUntilStarted
  participant CloudBox as createCloudBox
  UI->>useApi: request boxApi, toolboxApi
  UI->>BoxApi: createBox(request, orgId)
  BoxApi-->>UI: ApiBox
  UI->>Poll: waitUntilStarted(ApiBox)
  Poll-->>UI: started ApiBox
  UI->>CloudBox: createCloudBox(ApiBox, api, orgId)
  CloudBox-->>UI: CloudBox (capabilities)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • DorianZheng

Poem

🐇 I hopped through code to make things light,
CloudBox arrived and set types right,
Hooks now call the API line by line,
Snippets pruned to Python — tidy and fine,
A little refactor, a cleaner sight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removal of the TypeScript cloud SDK from the codebase and replacement with a private cloudBox adapter.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/remove-ts-cloud-sdk

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
apps/dashboard/src/hooks/useBoxSession.ts (2)

174-184: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Poll VNC status until it becomes ready instead of failing on the first non-active state.

This query treats every transitional status as an error. starting/pending will surface as “failed to become ready” even though the desktop is still booting. The default React Query retry backoff is not a readiness poll; this needs the same poll-until-ready behavior you added for box startup.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/hooks/useBoxSession.ts` around lines 174 - 184, The
vncStatusQuery currently throws on any non-'active' status which treats
transient states as errors; change vncStatusQuery (the useQuery wrapping
toolboxApi.getComputerUseStatusDeprecated) to not throw on transitional statuses
but instead return the current status and enable polling until it becomes
'active'—e.g., have the queryFn return status without throwing, add a
refetchInterval (or a function refetchInterval that returns e.g. 1000–2000ms
while data !== 'active' and false when 'active'), keep the same enabled
condition (vnc && !!boxId && startVncMutation.isSuccess), and optionally use
onSuccess to perform any one-time side effects when status === 'active'. Ensure
queryKey remains queryKeys.box.vncStatus(resolvedScope, boxId).

130-149: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Gate terminal and VNC calls on selectedOrganization.id too.

The create/load paths now hard-fail without an organization ID, but the port preview and VNC flows still call organization-scoped endpoints with selectedOrganization?.id. If a persisted boxId exists while org selection is still loading or switching, these requests can run against the wrong scope before boxQuery has a chance to block them.

Also applies to: 174-191

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/hooks/useBoxSession.ts` around lines 130 - 149, The
port-preview and VNC flows call org-scoped endpoints with
selectedOrganization?.id while not gating on its presence; update
getPortPreviewUrl (useCallback) and any related functions to require a non-null
selectedOrganization.id, add selectedOrganization?.id to their dependency lists,
and change query/mutation enabling so they only run when
selectedOrganization?.id is truthy (e.g., terminalQuery.enabled becomes terminal
&& !!boxId && !!selectedOrganization?.id) and startVncMutation is either
disabled until the org id exists or performs an explicit guard that
throws/returns early if selectedOrganization?.id is missing; apply the same
gating fix to the other VNC/port-related code referenced around the 174-191
region.
apps/dashboard/src/providers/PlaygroundProvider.tsx (1)

300-325: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

The image-selection branch is still unreachable after removing templates.

createBoxFromTemplate = useCustomImageName || useDefaultResourceValues still routes the default and custom-image paths through createBoxFromTemplateParams = {}. That means the new image: 'base' default is dropped, and any non-default templateName is dropped too. Both the Playground run flow and the generated snippets end up ignoring the selected image.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/dashboard/src/providers/PlaygroundProvider.tsx` around lines 300 - 325,
The branch routing is wrong: stop treating custom/default images as "template"
paths and ensure they use createBoxFromImageParams (so the image: 'base' default
and any custom templateName survive). Change createBoxFromTemplate so it only
represents real template use (or simply false if templates are removed) instead
of using useCustomImageName || useDefaultResourceValues, and set
createBoxFromImage = useCustomImageName || !useDefaultResourceValues (so both
custom-image and non-default-resource flows go into createBoxFromImage). Keep
createBoxFromImageParams (and its resources assignment) as-is and return/assign
createBoxFromImageParams when createBoxFromImage is true; leave
createBoxFromTemplateParams for actual template flows only.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/dashboard/src/lib/cloudBox.ts`:
- Around line 404-421: In getRunCommand, argv is currently built with
params?.argv?.join(' ') which allows spaces/metacharacters to be split by the
shell; instead map over params.argv and shell-escape/quote each entry (e.g.,
wrap each argument in single quotes and escape embedded single quotes) then join
those quoted entries with spaces and use that quoted-argv string in the returned
command templates for CodeLanguage.PYTHON, JAVASCRIPT and TYPESCRIPT so each
original param value is passed as a single literal argument to
python3/node/ts-node.

---

Outside diff comments:
In `@apps/dashboard/src/hooks/useBoxSession.ts`:
- Around line 174-184: The vncStatusQuery currently throws on any non-'active'
status which treats transient states as errors; change vncStatusQuery (the
useQuery wrapping toolboxApi.getComputerUseStatusDeprecated) to not throw on
transitional statuses but instead return the current status and enable polling
until it becomes 'active'—e.g., have the queryFn return status without throwing,
add a refetchInterval (or a function refetchInterval that returns e.g.
1000–2000ms while data !== 'active' and false when 'active'), keep the same
enabled condition (vnc && !!boxId && startVncMutation.isSuccess), and optionally
use onSuccess to perform any one-time side effects when status === 'active'.
Ensure queryKey remains queryKeys.box.vncStatus(resolvedScope, boxId).
- Around line 130-149: The port-preview and VNC flows call org-scoped endpoints
with selectedOrganization?.id while not gating on its presence; update
getPortPreviewUrl (useCallback) and any related functions to require a non-null
selectedOrganization.id, add selectedOrganization?.id to their dependency lists,
and change query/mutation enabling so they only run when
selectedOrganization?.id is truthy (e.g., terminalQuery.enabled becomes terminal
&& !!boxId && !!selectedOrganization?.id) and startVncMutation is either
disabled until the org id exists or performs an explicit guard that
throws/returns early if selectedOrganization?.id is missing; apply the same
gating fix to the other VNC/port-related code referenced around the 174-191
region.

In `@apps/dashboard/src/providers/PlaygroundProvider.tsx`:
- Around line 300-325: The branch routing is wrong: stop treating custom/default
images as "template" paths and ensure they use createBoxFromImageParams (so the
image: 'base' default and any custom templateName survive). Change
createBoxFromTemplate so it only represents real template use (or simply false
if templates are removed) instead of using useCustomImageName ||
useDefaultResourceValues, and set createBoxFromImage = useCustomImageName ||
!useDefaultResourceValues (so both custom-image and non-default-resource flows
go into createBoxFromImage). Keep createBoxFromImageParams (and its resources
assignment) as-is and return/assign createBoxFromImageParams when
createBoxFromImage is true; leave createBoxFromTemplateParams for actual
template flows only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c3f2c9e9-4ab9-40bf-8375-4529dcda8daf

📥 Commits

Reviewing files that changed from the base of the PR and between 20873af and 42b7c2a.

📒 Files selected for processing (66)
  • apps/api/Dockerfile
  • apps/dashboard/.storybook/main.ts
  • apps/dashboard/project.json
  • apps/dashboard/src/components/Playground/Box/CodeSnippets/code-language.test.ts
  • apps/dashboard/src/components/Playground/Box/CodeSnippets/index.ts
  • apps/dashboard/src/components/Playground/Box/CodeSnippets/types.ts
  • apps/dashboard/src/components/Playground/Box/CodeSnippets/typescript.ts
  • apps/dashboard/src/components/Playground/Box/CodeSnippetsResponse.tsx
  • apps/dashboard/src/components/Playground/Box/Parameters/Management.tsx
  • apps/dashboard/src/components/Playground/Box/Parameters/ProcessCodeExecution.tsx
  • apps/dashboard/src/components/Playground/VNC/Interaction/Display.tsx
  • apps/dashboard/src/components/Playground/VNC/Interaction/Keyboard.tsx
  • apps/dashboard/src/components/Playground/VNC/Interaction/Mouse.tsx
  • apps/dashboard/src/components/Playground/VNC/Interaction/Screenshot.tsx
  • apps/dashboard/src/contexts/PlaygroundContext.tsx
  • apps/dashboard/src/hooks/mutations/useCreateBoxMutation.tsx
  • apps/dashboard/src/hooks/useBoxSession.ts
  • apps/dashboard/src/lib/cloudBox.ts
  • apps/dashboard/src/lib/playground.tsx
  • apps/dashboard/src/providers/PlaygroundProvider.tsx
  • apps/dashboard/tsconfig.app.json
  • apps/dashboard/vite.config.mts
  • apps/eslint.config.mjs
  • apps/infra-local/scripts/stack-up.sh
  • apps/libs/sdk-typescript/LICENSE
  • apps/libs/sdk-typescript/README.md
  • apps/libs/sdk-typescript/hooks/typedoc-custom.mjs
  • apps/libs/sdk-typescript/jest.config.js
  • apps/libs/sdk-typescript/package.json
  • apps/libs/sdk-typescript/project.json
  • apps/libs/sdk-typescript/src/Box.ts
  • apps/libs/sdk-typescript/src/BoxLite.ts
  • apps/libs/sdk-typescript/src/CodeInterpreter.ts
  • apps/libs/sdk-typescript/src/ComputerUse.ts
  • apps/libs/sdk-typescript/src/FileSystem.ts
  • apps/libs/sdk-typescript/src/Git.ts
  • apps/libs/sdk-typescript/src/Image.ts
  • apps/libs/sdk-typescript/src/LspServer.ts
  • apps/libs/sdk-typescript/src/ObjectStorage.ts
  • apps/libs/sdk-typescript/src/Process.ts
  • apps/libs/sdk-typescript/src/PtyHandle.ts
  • apps/libs/sdk-typescript/src/Volume.ts
  • apps/libs/sdk-typescript/src/__tests__/BoxLite.create-guards.test.ts
  • apps/libs/sdk-typescript/src/code-toolbox/BoxJsCodeToolbox.ts
  • apps/libs/sdk-typescript/src/code-toolbox/BoxPythonCodeToolbox.ts
  • apps/libs/sdk-typescript/src/code-toolbox/BoxTsCodeToolbox.ts
  • apps/libs/sdk-typescript/src/errors/BoxliteError.ts
  • apps/libs/sdk-typescript/src/index.ts
  • apps/libs/sdk-typescript/src/types/Charts.ts
  • apps/libs/sdk-typescript/src/types/CodeInterpreter.ts
  • apps/libs/sdk-typescript/src/types/ExecuteResponse.ts
  • apps/libs/sdk-typescript/src/types/Pty.ts
  • apps/libs/sdk-typescript/src/utils/ArtifactParser.ts
  • apps/libs/sdk-typescript/src/utils/Binary.ts
  • apps/libs/sdk-typescript/src/utils/FileTransfer.ts
  • apps/libs/sdk-typescript/src/utils/Import.ts
  • apps/libs/sdk-typescript/src/utils/Multipart.ts
  • apps/libs/sdk-typescript/src/utils/Runtime.ts
  • apps/libs/sdk-typescript/src/utils/Stream.ts
  • apps/libs/sdk-typescript/src/utils/WebSocket.ts
  • apps/libs/sdk-typescript/src/utils/otel.decorator.ts
  • apps/libs/sdk-typescript/tsconfig.json
  • apps/libs/sdk-typescript/tsconfig.lib.json
  • apps/libs/sdk-typescript/tsconfig.spec.json
  • apps/libs/sdk-typescript/typedoc.json
  • apps/tsconfig.base.json
💤 Files with no reviewable changes (49)
  • apps/libs/sdk-typescript/src/utils/WebSocket.ts
  • apps/libs/sdk-typescript/package.json
  • apps/libs/sdk-typescript/src/types/ExecuteResponse.ts
  • apps/libs/sdk-typescript/tsconfig.lib.json
  • apps/libs/sdk-typescript/tsconfig.json
  • apps/libs/sdk-typescript/src/types/Pty.ts
  • apps/libs/sdk-typescript/src/utils/Stream.ts
  • apps/libs/sdk-typescript/src/FileSystem.ts
  • apps/libs/sdk-typescript/src/types/Charts.ts
  • apps/libs/sdk-typescript/src/Process.ts
  • apps/libs/sdk-typescript/src/utils/ArtifactParser.ts
  • apps/libs/sdk-typescript/src/utils/FileTransfer.ts
  • apps/libs/sdk-typescript/src/code-toolbox/BoxPythonCodeToolbox.ts
  • apps/libs/sdk-typescript/src/Image.ts
  • apps/dashboard/src/components/Playground/Box/CodeSnippets/code-language.test.ts
  • apps/libs/sdk-typescript/src/utils/Runtime.ts
  • apps/libs/sdk-typescript/src/LspServer.ts
  • apps/libs/sdk-typescript/src/utils/Binary.ts
  • apps/libs/sdk-typescript/hooks/typedoc-custom.mjs
  • apps/tsconfig.base.json
  • apps/libs/sdk-typescript/src/utils/Multipart.ts
  • apps/libs/sdk-typescript/src/tests/BoxLite.create-guards.test.ts
  • apps/dashboard/.storybook/main.ts
  • apps/libs/sdk-typescript/src/ObjectStorage.ts
  • apps/api/Dockerfile
  • apps/libs/sdk-typescript/src/errors/BoxliteError.ts
  • apps/libs/sdk-typescript/jest.config.js
  • apps/libs/sdk-typescript/src/types/CodeInterpreter.ts
  • apps/libs/sdk-typescript/README.md
  • apps/libs/sdk-typescript/src/code-toolbox/BoxJsCodeToolbox.ts
  • apps/libs/sdk-typescript/LICENSE
  • apps/libs/sdk-typescript/src/CodeInterpreter.ts
  • apps/libs/sdk-typescript/src/code-toolbox/BoxTsCodeToolbox.ts
  • apps/libs/sdk-typescript/src/index.ts
  • apps/libs/sdk-typescript/src/Volume.ts
  • apps/libs/sdk-typescript/project.json
  • apps/libs/sdk-typescript/src/Box.ts
  • apps/dashboard/vite.config.mts
  • apps/libs/sdk-typescript/src/PtyHandle.ts
  • apps/libs/sdk-typescript/tsconfig.spec.json
  • apps/libs/sdk-typescript/src/ComputerUse.ts
  • apps/dashboard/tsconfig.app.json
  • apps/libs/sdk-typescript/typedoc.json
  • apps/dashboard/src/components/Playground/Box/CodeSnippets/typescript.ts
  • apps/libs/sdk-typescript/src/utils/Import.ts
  • apps/eslint.config.mjs
  • apps/libs/sdk-typescript/src/Git.ts
  • apps/libs/sdk-typescript/src/BoxLite.ts
  • apps/libs/sdk-typescript/src/utils/otel.decorator.ts

Comment thread apps/dashboard/src/lib/cloudBox.ts

@G4614 G4614 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@G4614 G4614 added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit ad155d9 Jun 12, 2026
30 of 31 checks passed
@G4614 G4614 deleted the chore/remove-ts-cloud-sdk branch June 12, 2026 14:15
G4614 pushed a commit that referenced this pull request Jun 12, 2026
## Summary

Stacked on #744. Implements the identity follow-up discussed on #735
(see the "Identity model note" comment there): the engine gains a
CRI-style orchestrator reference, and the runner stops squatting the
engine's `name` slot to carry the control-plane box id.

```text
before                                after
──────                                ─────
runner: WithName(cloudId)             runner: WithExternalRef(cloudId)
engine: name = cloudId (squatted)     engine: external_ref = cloudId
        name unavailable for users            name free for a future
                                              user-facing box name
```

Industry precedent (verified sources):
- CRI `PodSandboxMetadata.uid` — the orchestrator's id travels as a
dedicated metadata field; the runtime mints its own id ([cri-api
api.proto](https://github.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1/api.proto),
`message PodSandboxMetadata`)
- ECS agent attaches `com.amazonaws.ecs.task-arn` as a docker label
([docker_task_engine.go](https://github.com/aws/amazon-ecs-agent/blob/master/agent/engine/docker_task_engine.go))
- The caller-supplied-id pattern (OCI runtime spec `create
<container-id>`) applies to stateless executors (runc/firecracker), not
to stateful daemons like this engine — hence a reference field, not id
injection.

## What changed

- **engine**: `BoxOptions.external_ref` (opaque, json-persisted via the
existing config blob — no DB migration; `lookup_box` already scans
configs). Duplicate refs are rejected at create. Lookup order: exact id
→ name → external_ref → id prefix. `BoxInfo` exposes it, omitted when
unset.
- **C SDK**: `boxlite_options_set_external_ref`, `CBoxInfo.external_ref`
(NULL when unset, freed on drop — the leak-count test now expects 5
inner CStrings), header regenerated by the crate build.
- **Go SDK**: `WithExternalRef`, `BoxInfo.ExternalRef`.
- **Node SDK**: field filled with `None` (orchestrator-facing knob; not
exposed in JS options yet).
- **CLI**: `inspect` shows `ExternalRef` only when present; `list`
columns unchanged (nothing empty is rendered).
- **runner**: `WithName(dto.Id)` → `WithExternalRef(dto.Id)`; restart
recovery (`runtime.Get(dto.Id)`) resolves through the external_ref
match.

## Verification

- engine lib tests: 735/735; the new `lookup_box_by_external_ref` test
was verified two-sided (fails with the lookup clause reverted, passes
restored)
- boxlite-c: 55/55
- CLI / Node / Python crates compile; `go vet` clean on `sdks/go` and
`apps/runner/pkg/boxlite` (final cgo link needs the prebuilt
`libboxlite.a`, absent in this worktree)

## Merge order

#743#735#744 → this PR. Self-contained: reverting is closing this
PR.
law-chain-hot added a commit that referenced this pull request Jun 12, 2026
## Summary

Stacked on #744. Implements the identity follow-up discussed on #735
(see the "Identity model note" comment there): the engine gains a
CRI-style orchestrator reference, and the runner stops squatting the
engine's `name` slot to carry the control-plane box id.

```text
before                                after
──────                                ─────
runner: WithName(cloudId)             runner: WithExternalRef(cloudId)
engine: name = cloudId (squatted)     engine: external_ref = cloudId
        name unavailable for users            name free for a future
                                              user-facing box name
```

Industry precedent (verified sources):
- CRI `PodSandboxMetadata.uid` — the orchestrator's id travels as a
dedicated metadata field; the runtime mints its own id ([cri-api
api.proto](https://github.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1/api.proto),
`message PodSandboxMetadata`)
- ECS agent attaches `com.amazonaws.ecs.task-arn` as a docker label
([docker_task_engine.go](https://github.com/aws/amazon-ecs-agent/blob/master/agent/engine/docker_task_engine.go))
- The caller-supplied-id pattern (OCI runtime spec `create
<container-id>`) applies to stateless executors (runc/firecracker), not
to stateful daemons like this engine — hence a reference field, not id
injection.

## What changed

- **engine**: `BoxOptions.external_ref` (opaque, json-persisted via the
existing config blob — no DB migration; `lookup_box` already scans
configs). Duplicate refs are rejected at create. Lookup order: exact id
→ name → external_ref → id prefix. `BoxInfo` exposes it, omitted when
unset.
- **C SDK**: `boxlite_options_set_external_ref`, `CBoxInfo.external_ref`
(NULL when unset, freed on drop — the leak-count test now expects 5
inner CStrings), header regenerated by the crate build.
- **Go SDK**: `WithExternalRef`, `BoxInfo.ExternalRef`.
- **Node SDK**: field filled with `None` (orchestrator-facing knob; not
exposed in JS options yet).
- **CLI**: `inspect` shows `ExternalRef` only when present; `list`
columns unchanged (nothing empty is rendered).
- **runner**: `WithName(dto.Id)` → `WithExternalRef(dto.Id)`; restart
recovery (`runtime.Get(dto.Id)`) resolves through the external_ref
match.

## Verification

- engine lib tests: 735/735; the new `lookup_box_by_external_ref` test
was verified two-sided (fails with the lookup clause reverted, passes
restored)
- boxlite-c: 55/55
- CLI / Node / Python crates compile; `go vet` clean on `sdks/go` and
`apps/runner/pkg/boxlite` (final cgo link needs the prebuilt
`libboxlite.a`, absent in this worktree)

## Merge order

#743#735#744 → this PR. Self-contained: reverting is closing this
PR.
G4614 pushed a commit that referenced this pull request Jun 12, 2026
…ents (#744)

## Summary

Stacked on #735. The Box entity's identity collapsed there into a single
12-char id; the `boxId` fields on `BoxDto` / the admin overview DTO were
kept only as value mirrors of `id` to avoid touching the API contract
and generated clients in that PR. This PR removes the mirror everywhere:

```text
before (after #735)                 after (this PR)
───────────────────                 ───────────────
entity/DB:   id  ✅ single          unchanged
BoxDto:      id + boxId (same       id only
             value, legacy shape)
admin DTO:   id + boxId mirror      id only
clients:     Box/AdminBoxItem/      boxId field gone (TS + Go)
             Workspace carry boxId
dashboard:   reads .boxId ?? .id    reads .id
```

- API: `BoxDto.boxId`, admin overview `boxId`, dual-id correlation
matching in admin observability — all removed.
- Dashboard: `box-identity` helpers read `.id`; dual-id cache updates
and the uuid-shaped-name special case removed (after the DB rebuild a
box name can never be a uuid).
- Generated clients: regenerated with the repo's own codegen **inside a
disposable BoxLite box** (CI-faithful: Linux + JDK + GNU sed, no host
gofmt drift). Drift is exactly the `boxId` removal on the `Box` /
`AdminBoxItem` / `Workspace` models in the TS and Go clients.
- Untouched on purpose: route/query parameter names like `:boxId` (they
carry the single id), other tables' `boxId` FK column names, and the
analytics `ModelsBoxUsage.boxId` (a real data field, not the mirror).

## Verification

- API jest: 38 suites / 112 tests pass
- Dashboard: `tsc --noEmit` clean against the regenerated client
- Regen ran in a BoxLite box (`boxlite run node:22-bookworm`); output is
byte-for-byte what CI's api-client-drift check regenerates

## Merge order

#743 (remove TS cloud SDK) → #735 (image pipeline + single box identity)
→ this PR.
DorianZheng pushed a commit that referenced this pull request Jun 12, 2026
…main)" (#743) (#751)

Reverts #743. Restores `apps/libs/sdk-typescript` and the dashboard
cloudBox usage to the pre-#743 state (clean `git revert` of ad155d9, no
manual edits).

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

## Summary by CodeRabbit

* **New Features**
* Added TypeScript code snippet support to the Playground alongside
existing Python support.
* Introduced the BoxLite TypeScript SDK (`@boxlite-ai/sdk`), a new
package providing APIs for box management, file operations, git
workflows, code execution, and desktop automation.

* **Refactor**
* Migrated internal dashboard box operations to use the new SDK client
library.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
law-chain-hot added a commit that referenced this pull request Jun 13, 2026
…oolbox/workspace surfaces and box verbs

- Delete toolbox.deprecated.{controller,service,dto} (68 proxy endpoints).
  Their only real consumer was the TypeScript cloud SDK removed in #743;
  the dashboard Playground/VNC routes that also called them are dark.
- Delete workspace.deprecated.controller + dtos (legacy Daytona alias
  surface, zero consumers).
- Delete createBox/deleteBox/startBox/stopBox from box.controller.
  Box verbs are now owned solely by the Box API contract
  (openapi/box.openapi.yaml), served by boxlite-rest. Cloud-capability
  endpoints (signed URLs, ssh, archive, recover, paginated reads, getBox)
  stay: they consume cloud-only ingredients the engine cannot provide.
- boxlite-rest CreateBoxDto + box.openapi.yaml: add cloud-optional create
  fields (labels/public/auto_stop_interval/auto_delete_interval) so the
  dashboard create form can speak the Box API dialect. Local engine
  servers ignore them (serde drops unknown fields).
- metrics.interceptor: move box-create/start/stop capture from the
  removed /api/box routes to the /api/v1 boxes routes.
- apps/api/Dockerfile: drop the toolbox-api-client COPY (package removed
  later in this branch).
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.

2 participants