Remove development export entries that pointed at source TypeScript files and limit published package files to dist output. Update core tsconfig path handling so local builds still resolve workspace sources while consumers use compiled artifacts.
We want users to install `@clinebot/sdk` instead of `@clinebot/core`
because "sdk" rolls off the tongue better as the public-facing package
name. `@clinebot/core` already re-exports the key types from
`@clinebot/agents`, `@clinebot/llms`, and `@clinebot/shared`, so
`@clinebot/sdk` is a thin wrapper that just does `export * from
"@clinebot/core"`.
## What changed
New `packages/sdk/` directory containing:
- `package.json` -- named `@clinebot/sdk`, version `0.0.36` (matching
current published packages), single dependency on `@clinebot/core` via
`workspace:*`. Same publish-related fields (`main`, `types`, `exports`,
`files`, `publishConfig`) as core, adapted for the simpler
single-entrypoint structure.
- `src/index.ts` -- literally just `export * from "@clinebot/core"`.
- `bun.mts` -- minimal Bun.build config that externalizes
`@clinebot/core` so the output JS is just a re-export, not a bundle of
core's internals.
- `tsconfig.json` / `tsconfig.build.json` -- follows the same pattern as
other packages (extends `tsconfig.base.json`, emits declarations only
via tsc).
The release script (`scripts/release.ts`) was updated to add `"sdk"` to
`SDK_PUBLISH_ORDER` after `"core"`, so it gets published in the correct
dependency order during `bun release sdk`. The help text was also
updated to reflect the new package in the list.
No changes were needed for:
- Workspace registration: root `package.json` uses `"packages/*"` glob,
so `packages/sdk` is auto-discovered.
- Version bumping: `scripts/version.ts` iterates all package directories
and bumps non-internal packages automatically.
- Publish verification: `scripts/check-publish.ts` auto-discovers
non-internal packages. Verified it picks up `@clinebot/sdk` and the
package passes all checks (packing, manifest version alignment, npm
install in isolation, module resolution).
## Verification
- `bun run build:sdk` succeeds, `@clinebot/sdk` builds cleanly alongside
all other packages
- `bun -F @clinebot/sdk typecheck` passes
- `bun scripts/check-publish.ts` passes with all 5 published packages
(shared, llms, agents, core, sdk) verified
- Built output is minimal: `dist/index.js` is
`export*from"@clinebot/core";` and `dist/index.d.ts` is the
corresponding re-export declaration
## Test plan
- [x] `bun run build:sdk` builds all packages including sdk
- [x] `bun -F @clinebot/sdk typecheck` passes
- [x] `bun scripts/check-publish.ts` verifies all 5 packages pack,
install, and resolve correctly
- [ ] After merge, `bun release sdk` should publish `@clinebot/sdk` to
npm alongside the other packages
The CLI's interactive TUI has been rewritten from scratch using
[OpenTUI](https://github.com/anomalyco/opentui), replacing the Ink-based
implementation. OpenTUI is a native terminal rendering engine written in
Zig with a React reconciler, giving us capabilities that were impossible
with Ink: native diff rendering, syntax-highlighted code, streaming
markdown, scrollable content, mouse interaction, and clipboard support.
### Before / After
The old TUI was a single 1,300-line monolith (`interactive-tui.ts`) with
30+ useState hooks, limited rendering (plain text only), and no dialog
system. The new TUI is decomposed into focused components, contexts, and
hooks with rich rendering throughout.
### Architecture
```
run-interactive.ts (runtime bridge)
|
| callbacks: onSubmit, onAbort, onModelChange, onModeChange, ...
v
index.tsx (OpenTUI renderer)
|
v
root.tsx (provider tree + view router + global keyboard)
|
+-- DialogProvider Modal dialogs (model picker, tool approval, settings, etc.)
+-- SessionProvider Chat entries, running state, mode, usage tracking
+-- EventBridgeProvider Subscribes to SDK agent events, forwards to session
|
+-- View Router
+-- HomeView Welcome screen with animated robot + centered input
+-- ChatView Scrollbox message list + input bar + status bar
+-- OnboardingView First-run provider/model setup wizard
+-- ConfigView Settings browser (dialog)
+-- HistoryView Session history with resume (dialog)
```
The TUI never talks to the SDK directly. All communication flows through
callback props defined in `TuiProps`. The runtime bridge
(`run-interactive.ts`) owns session lifecycle, event wiring, and state
that persists across session restarts.
### What's New
Core rendering:
- Streaming markdown for assistant responses (`<markdown>` element)
- Unified diffs with syntax highlighting for file edits (`<diff>`
element)
- Syntax-highlighted code for file reads (`<code>` element)
- Expandable/collapsible tool output sections
- Scrollable chat with auto-scroll pinning during streaming
- Mouse-tracked animated robot on the home screen
Dialog system (`@opentui-ui/dialog`):
- Model selector with search, thinking level picker, and provider
switching
- Cline-specific model picker with recommended/free tiers
- Tool approval dialog (approve/reject/always-approve per tool)
- Ask question dialog (agent asks user for input mid-run)
- Config/settings browser with interactive toggles
- Session history browser with message preview and resume
- Help overlay with all keyboard shortcuts and commands
- Provider picker with OAuth login and API key entry
- Device code auth flow for Cline provider
Input and navigation:
- Autocomplete dropdown for `/` slash commands and `@` file mentions
- Input history (up/down arrow through previous prompts)
- Message queuing (Enter during a running turn queues the message)
- Steer messages (Ctrl+S sends guidance to a running turn)
- Text selection with copy-to-clipboard (OSC52)
Session management:
- `/history` to browse and resume past sessions
- `/compact` for manual context window compaction
- `/clear` to reset conversation
- `/model` to switch models mid-conversation (preserves chat history)
- `/help` with full keyboard shortcut and command reference
- `/settings` for interactive config browser
Plan/Act mode:
- Tab toggles between plan and act mode with accent color change
(yellow/cyan)
- `switch_to_act_mode` tool lets the agent transition from plan to act
mid-session
- System prompt and tools are rebuilt on mode switch, conversation
history preserved
Onboarding:
- First-run wizard detects if no provider is configured
- Step-by-step provider selection, authentication (OAuth or API key),
model selection
- Thinking level configuration for supported models
- Results applied to runtime config immediately
### Interactive Setup Wizards
Three new top-level CLI commands that walk users through complex setup
flows interactively, so they don't have to construct long flag-heavy
commands by hand:
`clite connect` - Connector setup for messaging platforms (Telegram,
Slack, Discord, Google Chat, WhatsApp, Linear). Walks through bot token
entry, platform-specific options, and launches the bridge.
`clite schedule` - Scheduled run creation. Walks through cron expression
(with presets like "weekdays at 9am"), prompt, workspace, provider/model
selection, iteration limits, and timeout.
`clite mcp` - MCP server management. Lists configured servers, add new
ones (stdio or SSE), edit existing config, remove servers, and test
connectivity.
### What Got Removed
- `interactive-tui.ts` (1,314 lines) and all old Ink components
(ChatMessage, ConfigView, InputBox, MentionMenu, SlashMenu, StatusBar,
WelcomeView)
- `run-interactive-opentui.ts` (merged into `run-interactive.ts`)
The old Ink `HistoryListView` component is preserved at
`commands/history-list-view.ts` because the standalone `clite history`
command still uses Ink for its interactive picker. This is separate from
the main TUI.
### Runtime Changes
- Shebang changed from `#!/usr/bin/env node` to `#!/usr/bin/env bun`
(required because OpenTUI uses `bun:ffi`)
- `package.json` bin entry changed from `dist/index.js` to
`src/index.ts` for `bun link` dev workflow
- Minor SDK changes: `hookPath` added to `RpcSessionRow`, `toolTimeouts`
config support, `resolveSystemPrompt` export
### Documentation
- `DEVELOPMENT.md`: Full development guide covering prerequisites (Bun,
Zig, Node), first-time setup, monorepo structure, tech stack, TUI
architecture walkthrough, and common dev tasks
- `DISTRIBUTION.md`: Plan for publishing compiled binaries to npm
(platform-specific packages, binary resolver, postinstall caching, CI
pipeline). Uses OpenCode's distribution model as reference.
### Testing Locally
```bash
# Install prerequisites
curl -fsSL https://bun.sh/install | bash
brew install zig # macOS. For Linux: snap install zig --classic
# Clone and checkout
git clone <repo-url>
cd cline-sdk-wip
git checkout saoudrizwan/cli-tui-opentui
bun install
# Build SDK packages (required for workspace package resolution)
bun run build:sdk
# Link globally
cd apps/cli
bun link
# Run from anywhere
clite
```
Or skip the build/link and run directly from source:
```bash
cd apps/cli
bun run dev
```
To test onboarding flow with a fresh config: `clite --config
/tmp/cline-test`
---------
Co-authored-by: abeatrix <beatrix@cline.bot>
Introduce a `RuntimeHost` boundary in `@clinebot/core` that unifies
local and RPC-backed execution under a single contract.
- Add `RuntimeHost`, `LocalRuntimeHost`, `RpcRuntimeHost`, and
`createRuntimeHost` as primary exports replacing generic session
host/manager types
- Update ARCHITECTURE.md with new section 2a "Runtime Host Boundary"
describing the concrete implementations and design implications
- Renumber "Session Startup Bootstrap" from 2a to 2b
- Update Local In-Process and RPC-Backed runtime flow steps to reflect
the runtime-host factory pattern
- Add runtime boundary notes to DOC.md clarifying ownership of local
execution, RPC translation, and host selection responsibilities
- `ClineCore` now delegates uniformly to `RuntimeHost` without branching
on local vs RPC behavior; transport-specific logic lives inside concrete
host implementations
* refactor: unify session message files
- subagents and main agents should have the same file structure
- they should be stored within the same session directory
- fixed issues where not all assistant message includes mettrics data
* moved files
* hide warning
* node 22 required
* feat: add @clinebot/enterprise SDK package
Introduces @clinebot/enterprise, a new optional composition layer that adds enterprise capabilities on top of @clinebot/core and @clinebot/agents without leaking enterprise-specific concerns into lower-level packages.
The package handles the full enterprise sync lifecycle:
1. Identity resolution — pluggable IdentityAdapter interface (WorkOS adapter included)
2. Control plane sync — fetches remote config bundles via EnterpriseControlPlane
3. Policy materialization — writes managed rules, workflows, and skills to disk so @clinebot/core discovers them through its standard local file path (no special in-memory injection)
4. Telemetry configuration — maps bundle data to normalized OpenTelemetryClientConfig from @clinebot/shared
5. Runtime integration — exposes createEnterprisePlugin() and prepareEnterpriseRuntime() to wire everything into @clinebot/core as an AgentExtension
Design decisions
- Provider-agnostic contracts — IdentityAdapter, EnterpriseControlPlane, and EnterpriseTelemetryAdapter are thin interfaces; WorkOS is an included provider, not a hard dependency
- File-based materialization — enterprise-managed instructions land on disk and are loaded through the same path as any local instruction file, keeping prompt assembly consistent
- Shared RemoteConfig — EnterpriseConfigBundle normalizes into RemoteConfig from @clinebot/shared; no separate enterprise-only config contract
- Clean boundary — if a feature works without org identity, remote policy, or enterprise telemetry, it doesn't belong in this package
* clean up
* refactor: rpc/src/client.ts
* revert package.json
* autoload
* rename agents directory to extensions
* fix renamed path
* fix: use renamed extensions path
* fix checkpoint hooks
- Update session ID resolution in core to prioritize `node-machine-id` before falling back to a locally stored fallback file.
- Refactor history list display logic:
- Add `formatHistoryTitle` to clean up, normalize, and truncate session titles.
- Apply truncation to providers and models to ensure consistent layout.
- Update UI instruction text for better readability.
- Update `SpawnAgentInputSchema` to use `z.looseObject`.
- Revert version change
* docs: simplify CLI build/publish process
- Update README to clarify npm publishing uses Bun
- Remove `--production` flag from build script for consistency
- Simplify release script to use `bun publish` directly
- Move workspace dependencies from `dependencies` to `devDependencies`
- Remove deprecated `pack` script and related prepare/restore steps
* dev: fix version scripts
helpers and session backend imports
`@clinebot/core/node` (instead of `@clinebot/core/server`) for Node runtime
helpers and session backend imports, keeping workspace boundary guidance
accurate after the package path change.
Replace deep subpath imports (e.g. `@cline/llms/providers`,
`@cline/llms/models`) with top-level package imports (`@cline/llms`)
to comply with the new cross-workspace import boundary policy.
- Update all internal usages of `@cline/llms/providers` and
`@cline/llms/models` to access exports via the package root
(e.g. `providers.getLiveModelsCatalog`, `models.CLINE_MODELS`)
- Document allowed vs. disallowed cross-workspace imports in README
- Fix stale local file paths in agents/ARCHITECTURE.md
- Add reference to `bun run check:boundaries` enforcement command