Skip to content

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

Merged
DorianZheng merged 1 commit into
mainfrom
revert-743
Jun 12, 2026
Merged

Revert "chore(apps): remove TypeScript cloud SDK (re-apply #738 onto main)" (#743)#751
DorianZheng merged 1 commit into
mainfrom
revert-743

Conversation

@law-chain-hot

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

Copy link
Copy Markdown
Contributor

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).

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.

@law-chain-hot law-chain-hot requested a review from a team as a code owner June 12, 2026 16:02
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds a new @boxlite-ai/sdk TypeScript package, exports its public API, and rewires the dashboard and build configs to import SDK types and clients from that package. The dashboard playground now supports TypeScript snippets and uses the new SDK for box creation and VNC interactions.

Changes

SDK package and dashboard migration

Layer / File(s) Summary
Core SDK types and utilities
apps/libs/sdk-typescript/src/*, apps/libs/sdk-typescript/src/types/*, apps/libs/sdk-typescript/src/utils/*
New SDK error, runtime, binary, multipart, websocket, stream, OTEL, and import utilities are added together with the SDK type definitions and artifact parsing helpers.
Package entrypoints and build config
apps/libs/sdk-typescript/{package.json,project.json,tsconfig*.json,typedoc.json,jest.config.js,README.md,LICENSE}, apps/tsconfig.base.json, apps/api/Dockerfile, apps/dashboard/{tsconfig.app.json,vite.config.mts,.storybook/main.ts,project.json}, apps/eslint.config.mjs, apps/infra-local/scripts/stack-up.sh
The SDK package manifest, TypeScript configs, Jest config, Nx project, TypeDoc config, and package metadata are added, and the top-level path alias points @boxlite-ai/sdk at the new package.
Box, BoxLite, and service wrappers
apps/libs/sdk-typescript/src/{Box.ts,BoxLite.ts,CodeInterpreter.ts,ComputerUse.ts,FileSystem.ts,Git.ts,Image.ts,LspServer.ts,ObjectStorage.ts,Process.ts,PtyHandle.ts,Volume.ts,code-toolbox/*}
The Box, BoxLite, file, git, volume, LSP, object storage, PTY, process, computer-use, image, and code-toolbox classes are added and wired to the SDK types and helpers.
Dashboard SDK migration
apps/dashboard/src/components/Playground/Box/CodeSnippets/*, apps/dashboard/src/components/Playground/Box/Parameters/*, apps/dashboard/src/components/Playground/VNC/Interaction/*, apps/dashboard/src/contexts/PlaygroundContext.tsx, apps/dashboard/src/hooks/{mutations/useCreateBoxMutation.tsx,useBoxSession.ts}, apps/dashboard/src/lib/playground.tsx, apps/dashboard/src/providers/PlaygroundProvider.tsx
The dashboard switches from the removed cloudBox module to @boxlite-ai/sdk for code snippets, box creation, VNC computer-use interactions, playground context, and Vite/TS/Storybook resolution.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90+ minutes

Possibly related PRs

  • boxlite-ai/boxlite#743: Reworks the same dashboard SDK integration points, but in the opposite direction by reverting the @boxlite-ai/sdk usage back toward the cloudBox adapter.

Suggested reviewers

  • G4614

Poem

🐇 I hop through SDK paths so bright,
New boxes, snippets, and VNC in sight.
I nibble configs, then bound away,
Leaving TypeScript trails that sing today.

✨ 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 revert-743

return [
`\n\n${ind}// Run code securely inside the Box`,
`${ind}const codeRunResponse = await box.process.codeRun(\``,
`${getLanguageCodeToRun(p.actions.codeSnippetLanguage).replace(/`/g, '\\`').replace(/\$\{/g, '\\${')}`,
}

function escapePromiseSpecialCharacters(contents) {
return contents.replace(/`Promise`\s*\\<((?:`?[^`<>]+`?|<[^<>]+>)*?)>/g, (_match, typeContent) => {
type = indexSignatureType
}

type = type.replace(/([*_`\[\]()<>|])/g, '\\$1')
runCommands(...commands: (string | string[])[]): Image {
for (const command of commands) {
if (Array.isArray(command)) {
this._dockerfile += `RUN ${command.map((c) => `"${c.replace(/"/g, '\\\\\\"').replace(/'/g, "\\'")}"`).join(' ')}\n`
return cleanedContent
}

return modified ? lines.join('\n') : contents

// Calculate how many bytes we can safely process
// We need to keep bytes that could potentially be the start of a prefix marker
let safeLen = buf.length
return createCloudBox(response.data, api, selectedOrganization.id)
},
enabled: !!resolvedScope && !!boxId && !!selectedOrganization?.id,
queryFn: () => client?.get(boxId) ?? Promise.reject(new Error('Client not initialized')),
let itemMatch

while ((itemMatch = itemBlockRegex.exec(sectionContent)) !== null) {
const [, name, inheritanceInfo, leftoverText, typeLine, rawDescription] = itemMatch
Comment on lines +7 to +17
import {
Configuration,
ProcessApi,
Command,
Session,
SessionExecuteRequest,
SessionExecuteResponse as ApiSessionExecuteResponse,
PtyCreateRequest,
PtySessionInfo,
SessionSendInputRequest,
} from '@boxlite-ai/toolbox-api-client'
@DorianZheng DorianZheng merged commit 0cc2dda into main Jun 12, 2026
28 of 31 checks passed
@DorianZheng DorianZheng deleted the revert-743 branch June 12, 2026 16:16
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.

3 participants