@cjhyy/code-shell 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,27 @@ breaking.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.8.1] - 2026-08-05
12
+
13
+ ### Fixed
14
+
15
+ - Restored Panel App session ownership and browser-bucket routing, including
16
+ external-runtime isolation, so panel tools no longer fail with an unregistered
17
+ session bucket or get rebound when switching conversations.
18
+ - Qualified CodeShell MCP tools for Claude Code even when their names overlap
19
+ Claude built-ins such as `Read`, `Bash`, `Write`, and `Edit`.
20
+ - Kept model choices local to each conversation, refreshed the Codex picker to
21
+ GPT-5.6 Sol/Terra/Luna, and migrated saved 0.8.0 GPT-5.1 selections to Sol.
22
+ - Allowed registered Skill reference files under user and plugin Skill roots to
23
+ be read without a repeated sensitive-path approval, while retaining credential
24
+ and symlink-escape protections.
25
+ - Replaced Mimi's stale "no active task" delivery text with the authoritative
26
+ Work Session launch result after delegation succeeds.
27
+ - Kept the desktop pet visible when double-clicking it to open Mimi; the pet now
28
+ closes only through its right-click close action.
29
+
30
+ ## [0.8.0] - 2026-08-05
31
+
11
32
  ### Added
12
33
 
13
34
  #### Unified input attachments
@@ -59,13 +80,16 @@ breaking.
59
80
 
60
81
  #### Browser automation + built-in browser panel
61
82
 
62
- - CDP-driven automation of the built-in browser (no Playwright/JS-injection):
63
- semantic `browser_observe` / `browser_act` / `browser_navigate` tools, image
64
- & vision observation, multi-tab support, and link/image URL extraction. The
65
- whole capability is a single toggle turning it off removes both the tools
66
- and their prompt text. Stale snapshots are folded to save tokens.
67
- - The agent can open the browser panel itself; selections echo back into tool
68
- cards; screenshots echo to the stream as clickable thumbnails.
83
+ - Semantic `browser_observe` / `browser_act` / `browser_navigate` tools now use
84
+ a task-owned background target in the built-in browser profile by default,
85
+ sharing that profile's login state without silently taking over a tab the
86
+ user opened. The exact same target can be revealed for login or human
87
+ takeover.
88
+ - User-opened built-in tabs and regular Chrome tabs require an explicit claim;
89
+ dedicated Playwright remains an explicit isolated option for scheduled or
90
+ unattended work. Image/vision observation, multi-tab control, URL extraction,
91
+ trace visibility, and stale-snapshot folding are available across the runtime
92
+ control plane.
69
93
 
70
94
  #### Credentials: cookie login, multi-account, inject
71
95
 
@@ -123,6 +147,26 @@ breaking.
123
147
 
124
148
  ### Fixed
125
149
 
150
+ - Link Actions now preserve the dedicated `link` credential-access purpose
151
+ through the desktop bridge, so provider-owned credentials remain
152
+ non-agent-exposable while still being usable by the approved Link tool.
153
+ - Browser device authorization now encrypts the access token, refresh token,
154
+ token and refresh expiries, token endpoint, and public client ID together.
155
+ Only the access token crosses the Link execution boundary; expired or invalid
156
+ connections are hidden from Link Actions and surfaced in the UI for a clean
157
+ reconnect.
158
+ - Link connection cards isolate state per provider and connection method,
159
+ cancel pending device flows on close/unmount, clear abandoned local secrets,
160
+ derive gateway totals from the live channel list, and leave browser-login
161
+ status retryable after a transient status-check failure.
162
+ - Clean-checkout CI now builds workspace exports before package-boundary tests,
163
+ resolves the agent stdio source subpath during typechecking, recognizes the
164
+ packaged Chrome extension globals, and gives coverage tests the same timeout
165
+ budget as the full suite.
166
+ - Desktop packaging now derives its workspace build order from one tested list,
167
+ including the Web, Server, and Chat packages introduced by the monorepo
168
+ split. npm publication also waits for all three native installer jobs, so a
169
+ failed desktop package cannot leave a half-published release.
126
170
  - Addressed the latest core/desktop architecture review findings around stream
127
171
  routing, permission/session scoping, and event coalescing, reducing
128
172
  wrong-session routing, duplicated events, and hard-to-cancel operations in
@@ -174,11 +218,66 @@ breaking.
174
218
 
175
219
  ### Changed
176
220
 
221
+ - The core installer, marketplace, onboarding, and updater implementation
222
+ exports have moved to the `/internal` subpath. Embedders importing these
223
+ implementation details must update their import path for 0.8.0.
224
+ - The short-lived personal todo UI has been replaced by Mimi follow-ups. Existing
225
+ `userData/pet/todos.json` files are intentionally left untouched and are not
226
+ auto-imported; users of that preview should back up or copy any remaining text
227
+ manually.
177
228
  - Refreshed beta-release documentation and repository hygiene: README badges and
178
229
  status copy now reflect the public beta track, obsolete handoff notes are
179
230
  archived under `docs/archive/`, and generated build artifacts are covered by
180
231
  `.gitignore`.
181
232
 
233
+ ## [0.7.1] - 2026-07-11
234
+
235
+ Hardening release. No breaking changes from 0.7.0 — 71 of the 119 commits are
236
+ fixes, concentrated in usage accounting, tool failure semantics, permission
237
+ boundaries and session lifecycle.
238
+
239
+ ### Added
240
+
241
+ - **Full-context session forks** — fork a session and keep the entire context
242
+ instead of restarting from a summary.
243
+ - **MCP HTTP OAuth** — the login and token-refresh flow is now complete, so
244
+ OAuth-protected HTTP MCP servers stay authenticated across restarts.
245
+ - Send images from the mobile remote.
246
+ - Jump from a `DriveAgent` job straight to its CLI session.
247
+ - Browser panel address-bar actions.
248
+
249
+ ### Fixed
250
+
251
+ - **Unified usage accounting** — billing and visibility are now split, and
252
+ aux / Arena / sub-agent / `maxTurns` usage is recovered instead of being
253
+ dropped. Image token estimation was also corrected.
254
+ - **Tool failure and abort semantics** are enforced consistently: a failed tool
255
+ reports as failed, and an abort propagates instead of being swallowed.
256
+ - **Permission modes defer to run boundaries**, so a mode change mid-run can no
257
+ longer apply to a tool call that was already in flight.
258
+ - **Session close is serialized** with close-only generation fencing, removing a
259
+ race between closing a session and its in-flight work.
260
+ - Hook stdin is protected against `EPIPE`, and transcript flush failures are
261
+ surfaced rather than silently lost.
262
+ - Approvals are bounded and plugin denials propagate correctly.
263
+ - Background media jobs are hardened: timed-out video URLs are retained, stream
264
+ fetches are capped, and MCP image names are unique.
265
+ - Duplicate mobile uploads are serialized; review requests are scoped by
266
+ workspace.
267
+
268
+ ## [0.7.0] - 2026-07-10
269
+
270
+ ### Added
271
+
272
+ - **Quick chat dock panel** — a lightweight always-available chat surface in the
273
+ desktop app.
274
+ - **Live CC room transcripts** stream into the desktop client.
275
+ - **Goal judge reads run evidence** (tool results, progress, previous gaps) on
276
+ the primary model, so goal evaluation is grounded in what the run actually did.
277
+ - `DriveAgent` job inspection and cancellation.
278
+ - `DriveAgent` accepts an optional per-job model override for claude/codex.
279
+ - OAuth MCP credentials.
280
+
182
281
  ## [0.6.0-rc.14]
183
282
 
184
283
  ### Fixed
@@ -221,7 +320,7 @@ plus one private Electron POC:
221
320
  render layer, the `code-shell` CLI bin, themes, key bindings, all
222
321
  terminal-only utilities. Imports core; nothing else imports it.
223
322
  - **`@cjhyy/code-shell`** (meta) — thin re-export shim. `import { Engine }
224
- from "@cjhyy/code-shell"` still works for SDK users; the `code-shell`
323
+ from "@cjhyy/code-shell"` still works for SDK users; the `code-shell`
225
324
  bin loads the TUI CLI. Ships three files total: `index.js`, `index.d.ts`,
226
325
  `cli.js`.
227
326
  - **`@cjhyy/code-shell-desktop`** (private) — Electron POC. Currently a
@@ -282,7 +381,7 @@ plugin `hooks.json` files.
282
381
  user's prompt text on `user_prompt_submit`). Registry aggregation is
283
382
  last-write-wins for input/prompt, newline-joined for additionalContext.
284
383
  - **`settings.json` shell hooks.** New `hooks: [{event, command,
285
- matcher?, timeout_ms?, cwd?}]` schema. Engine spawns the command per
384
+ matcher?, timeout_ms?, cwd?}]` schema. Engine spawns the command per
286
385
  emit with the CC wire protocol — stdin is the HookContext JSON,
287
386
  stdout is a HookResult JSON, exit 2 = deny with stderr surfaced to
288
387
  the model. `CODESHELL_HOOK_EVENT` / `CODESHELL_HOOK_CWD` env vars
@@ -301,7 +400,7 @@ plugin `hooks.json` files.
301
400
  `${CODESHELL_PLUGIN_ROOT}` across every text file, so CC-authored
302
401
  plugin scripts that branch on host detection pick the codeshell
303
402
  path. `InstallResult.varRewrite` reports counts and `/plugin
304
- install` prints a `rewrote: N file(s)` line so the modification is
403
+ install` prints a `rewrote: N file(s)` line so the modification is
305
404
  visible.
306
405
  - **`ToolContext.hooks`.** Tools that need to emit lifecycle events
307
406
  (currently `notification` on background sub-agent terminal states)
@@ -365,6 +464,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
365
464
  ## [0.1.6] - 2026-05-13
366
465
 
367
466
  ### Added
467
+
368
468
  - **Built-in skills bundled with the package.** The skill scanner now also
369
469
  reads `skills-builtin/` shipped inside the installed npm package. First
370
470
  built-in is `codeshell-help` — answers questions about code-shell itself
@@ -377,6 +477,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
377
477
  block, since unattended automations have no human to retry the task.
378
478
 
379
479
  ### Fixed
480
+
380
481
  - `code-shell run` now resolves API keys / baseUrl / model from
381
482
  `settings.providers[]` and `settings.models[]` in addition to the legacy
382
483
  `settings.model.*` mirror — matches what Engine reconciles at startup,
@@ -395,8 +496,9 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
395
496
  ## [0.1.5] - 2026-05-13
396
497
 
397
498
  ### Added
499
+
398
500
  - **Auto-installing updater.** Background update check probes `npm config get
399
- prefix` for write permission; if writable, registers a detached `npm i -g`
501
+ prefix` for write permission; if writable, registers a detached `npm i -g`
400
502
  on process exit so the next launch picks up the new version. File lock at
401
503
  `~/.code-shell/.update.lock` (5min stale-takeover) prevents concurrent
402
504
  installs from corrupting each other. Disable with `DISABLE_AUTOUPDATER=1`,
@@ -421,7 +523,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
421
523
  reminder; a third re-read is hard-blocked. Four+ consecutive read-only
422
524
  calls (or three+ silent turns) inject a strategy-change reminder.
423
525
  - **Per-session verbose recorder.** Dev-only JSONL trace under `log/<date>/
424
- session-<sid>.jsonl` capturing every LLM request/response, tool call, and
526
+ session-<sid>.jsonl` capturing every LLM request/response, tool call, and
425
527
  engine event. Gated on `CODE_SHELL_DEV=1` / `--debug` / running from src.
426
528
  7-day retention, argv secrets redacted, per-record output clipped to 256 KB.
427
529
  - **Pasted-noise sanitizer.** Engine rejects tasks that are >70% ANSI/box
@@ -434,6 +536,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
434
536
  progress instead of a stale snapshot from the last completed run.
435
537
 
436
538
  ### Changed (breaking)
539
+
437
540
  - `SessionStatus` is now `"active" | "paused" | TerminalReason` instead of
438
541
  `"active" | "paused" | "completed" | "errored"`. `state.json` records the
439
542
  raw terminal reason (e.g. `aborted_streaming`, `model_error`,
@@ -442,6 +545,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
442
545
  need to widen its match.
443
546
 
444
547
  ### Changed
548
+
445
549
  - API key resolution centralized into `resolveApiKey()` (one canonical
446
550
  fallback chain: option → settings → all provider env vars). Replaces five
447
551
  drifting copies in `repl.ts`, `run.ts`, `runs.ts`, `main.ts`,
@@ -454,6 +558,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
454
558
  ## [0.1.4] - 2026-05-09
455
559
 
456
560
  ### Fixed
561
+
457
562
  - **Multi-model `apiKey` ignored on startup.** When `settings.json` defined
458
563
  a model in `models[]` (with its own `apiKey`/`baseUrl`) and the top-level
459
564
  `model.apiKey` was empty, the runtime fell through to
@@ -472,6 +577,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
472
577
  ## [0.1.0-alpha.1] - 2026-04-30
473
578
 
474
579
  ### Changed (breaking)
580
+
475
581
  - **Tool timeout system rewritten.** Removed the hardcoded
476
582
  `LEGACY_LONG_TIMEOUT_TOOLS = {Agent, Arena}` whitelist in
477
583
  `tool-system/registry.ts`. Tools now declare their own timeout via
@@ -491,6 +597,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
491
597
  (e.g. extended thinking).
492
598
 
493
599
  ### Added
600
+
494
601
  - **`Agent(run_in_background: true)`** — fire-and-forget sub-agents. Returns
495
602
  an `agent_id` immediately instead of blocking the parent turn. The agent
496
603
  runs detached in the same process; restarting loses its state.
@@ -502,6 +609,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
502
609
  registry for async agent handles.
503
610
 
504
611
  ### Notes
612
+
505
613
  - Cross-process / restart-survivable long tasks still belong to `RunManager`
506
614
  in `@cjhyy/code-shell/run`, not to `Agent(run_in_background)`. The split
507
615
  mirrors Claude Code's REPL/Agent-tool/Routines architecture.
@@ -509,6 +617,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
509
617
  ## [0.1.0-alpha.0] - 2026-04-28
510
618
 
511
619
  ### Added
620
+
512
621
  - **`IterativeArena` — multi-model authoring loop.** Pipeline: tournament v1
513
622
  (every participant writes a draft, the author merges anonymized drafts into
514
623
  v1) → critique-revise rounds (parallel critics produce anchored critiques
@@ -527,6 +636,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
527
636
  - `node >= 20` engine constraint alongside the existing `bun >= 1.3` hint.
528
637
 
529
638
  ### Fixed
639
+
530
640
  - TypeScript compilation is now clean (was 50+ errors).
531
641
  - Removed zombie `cli/transports/`, `cli/handlers/`, `cli/remoteIO.ts`,
532
642
  `cli/structuredIO.ts`, `cli/ndjsonSafeStringify.ts` — these were copied
@@ -571,11 +681,13 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
571
681
  Azure backend that rejects tool calls with 401.
572
682
 
573
683
  ### Removed
684
+
574
685
  - `TodoWrite` tool. It was a 6-line wrapper around `TaskCreate` and its
575
686
  presence confused models into using two equivalent interfaces. Use the
576
687
  `Task*` family (`TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`, etc.).
577
688
 
578
689
  ### Changed
690
+
579
691
  - Arena research-phase prompts no longer hard-cap output at "exactly 3 to 6
580
692
  findings". The new instruction asks for "as many findings as the topic
581
693
  warrants — typically 5-15", with each `summary` field expected to be 80+
@@ -593,6 +705,7 @@ see git log between v0.1.6 and v0.2.0 for the detailed change set.)
593
705
  marked `[需调研]` / `[TBD: ...]`.
594
706
 
595
707
  ### Fixed
708
+
596
709
  - IterativeArena: `extractTag` now tolerates LLM responses where the
597
710
  closing `</v1_content>` / `</v_next_content>` marker is missing (e.g. due
598
711
  to max_tokens truncation). Previously the parser fell back to "use the
package/README.md CHANGED
@@ -30,7 +30,7 @@ CodeShell is one orchestration engine wearing three faces:
30
30
  - an **Electron desktop app** with chat, file/browser/terminal/diff panels, model & credential management, an extensions marketplace, automation, and a phone remote, and
31
31
  - a **programmatic SDK** (`import { Engine } from "@cjhyy/code-shell"`) for embedding the engine in your own product.
32
32
 
33
- The core is deliberately **domain-agnostic**. The turn loop, context management, permissions, MCP integration, hooks, tasks, cron, sub-agents, sessions, and memory all stay generic; coding behavior is just a *preset* layered on top not baked into the engine. (See `packages/core/CONTRIBUTING.md`: "core only carries mechanism, not policy.")
33
+ The core is deliberately **domain-agnostic**. The turn loop, context management, permissions, MCP integration, hooks, tasks, cron, sub-agents, sessions, and memory all stay generic. Coding tools, git/worktree behavior, LSP, review, quota, and coding prompts live in the physically separate `@cjhyy/code-shell-capability-coding` package and are composed by the CLI/Desktop hosts. (See `packages/core/CONTRIBUTING.md`: "core only carries mechanism, not policy.")
34
34
 
35
35
  > Status: **0.6.x, entering beta**. The desktop app is the headline product; the CLI and SDK share the same core engine.
36
36
 
@@ -99,10 +99,11 @@ It gives you chat with streaming output, a side-by-side file / browser / termina
99
99
 
100
100
  ### Presets
101
101
 
102
- | Preset | Purpose | Extra tools |
103
- |--------|---------|-------------|
104
- | `general` | General orchestration, research, automation, long-running work | Core orchestration tools only |
105
- | `terminal-coding` | Terminal-native coding assistant | `EnterWorktree`, `ExitWorktree`, `NotebookEdit`, `LSP`, `Brief`, `Arena` |
102
+ | Preset | Purpose | Extra tools |
103
+ | ----------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------ |
104
+ | `harness-min` | Domain-neutral core default for embedding | Minimal filesystem, shell, MCP, memory, task and agent mechanisms |
105
+ | `general` | General orchestration, research, automation, long-running work | Core orchestration tools only |
106
+ | `terminal-coding` | Terminal-native coding assistant | `EnterWorktree`, `ExitWorktree`, `NotebookEdit`, `LSP`, `Brief`, `Arena` |
106
107
 
107
108
  Presets select the system prompt, the built-in tool set, and permission defaults. Configure via the SDK, the CLI `--preset` flag, or settings.
108
109
 
@@ -127,8 +128,9 @@ Presets select the system prompt, the built-in tool set, and permission defaults
127
128
 
128
129
  ### Built-in tools
129
130
 
130
- The default `general` preset whitelists 48 built-ins. The CLI defaults to
131
- `terminal-coding`, which adds coding extras. Runtime guards may hide tools that
131
+ Core by itself defaults to the minimal `harness-min` preset. The CLI and Desktop
132
+ compose the coding capability package, whose host default is `terminal-coding`.
133
+ Runtime guards may hide tools that
132
134
  need unavailable providers, credentials, cookies, or an active goal.
133
135
 
134
136
  - **File / workspace**: `Read`, `Write`, `Edit`, `ApplyPatch`, `Glob`, `Grep`
@@ -169,6 +171,14 @@ const codingEngine = new Engine({
169
171
 
170
172
  Everything is exported from the package root — `import { ... } from "@cjhyy/code-shell"` (or directly from `@cjhyy/code-shell-core`). There are no `/run`, `/arena`, or `/product` subpath entry points.
171
173
 
174
+ Runnable SDK examples live in [`examples/`](examples/) — each runs directly
175
+ with `bun run <file>` and supports `--dry-run` (scripted mock LLM) when no API
176
+ key is configured:
177
+
178
+ - [`examples/01-minimal-agent.ts`](examples/01-minimal-agent.ts) — one Engine, one run, streamed output
179
+ - [`examples/02-approval-flow.ts`](examples/02-approval-flow.ts) — a custom `ApprovalBackend` gating tool calls
180
+ - [`examples/03-in-process-transport.ts`](examples/03-in-process-transport.ts) — the recommended `createServer` / `createClient` factory pair
181
+
172
182
  ---
173
183
 
174
184
  ## Configuration
@@ -216,6 +226,7 @@ The OpenAI-compatible provider aborts any LLM stream idle for `CODESHELL_STREAM_
216
226
  At a high level, CodeShell routes CLI, headless, SDK, and desktop clients through the same engine runtime:
217
227
 
218
228
  - **Preset resolution** selects the system prompt, built-in tools, and permission defaults.
229
+ - **Capability composition** lets products install their own tools, presets, prompt sections, file-history behavior, and session-workspace adapters without putting product policy in core.
219
230
  - **TurnLoop** coordinates model streaming, context assembly, tool execution, and lifecycle events.
220
231
  - **Tool system** hosts built-ins, MCP tools, permissions, hooks, and cancellation.
221
232
  - **Session / run layers** persist transcripts, state, tasks, automation runs, and memories.
@@ -225,7 +236,7 @@ In the desktop app, the Electron main process acts as an IPC service layer: it d
225
236
  Design principles:
226
237
 
227
238
  - **Core first** — the orchestration engine stays domain-agnostic.
228
- - **Presets over hardcoding** — coding behavior lives in configuration.
239
+ - **Capabilities over hardcoding** — coding behavior lives in a separate package composed at the host boundary.
229
240
  - **Secure by default** — permission-gated actions and explicit approval flow; owner-only credential files.
230
241
  - **Long-running ready** — tasks, cron, sleep, sub-agents, and persistent goals are first-class.
231
242
 
@@ -235,10 +246,19 @@ Design principles:
235
246
 
236
247
  ```text
237
248
  packages/
238
- ├── core/ # Engine, context, tools, MCP, hooks, sessions, runs, presets, memory
249
+ ├── link/ # Framework-independent Link provider manifests and authorization guides
250
+ ├── core/ # Domain-agnostic engine, context, MCP, hooks, sessions, runs, memory
251
+ ├── coding/ # Coding capability pack: tools, git/worktrees, LSP, review, prompt/presets
252
+ ├── arena/ # Optional multi-model Arena capability
253
+ ├── pet/ # Mimi behavior, DelegateWork, projection protocol, digital-human teams
254
+ ├── server/ # Headless HTTP/WebSocket host, rooms, uploads, mobile remote
255
+ ├── web/ # Browser-safe remote client state and SPA
239
256
  ├── tui/ # Terminal CLI, Ink-based UI, renderer, commands, approvals
240
257
  ├── desktop/ # Electron desktop client + agent worker bridge + mobile remote app
241
- └── cdp/ # Environment-agnostic CDP browser-action layer (no Playwright)
258
+ ├── cdp/ # Environment-agnostic CDP browser-action layer (no Playwright)
259
+ └── chat/ # Standalone multi-channel chat gateway + optional CodeShell adapter
260
+
261
+ package.json # @cjhyy/code-shell compatibility meta package
242
262
 
243
263
  assets/ # README / product images (mascot, promo hero, Playwright desktop screenshots)
244
264
 
@@ -256,8 +276,8 @@ scripts/ # Build, release, and repo maintenance scripts
256
276
 
257
277
  ```bash
258
278
  bun install
259
- bun run build # build core + tui + meta package
260
- bun run typecheck # root core + tui check; currently not a clean gate
279
+ bun run build # build link + core + capability/host packages + meta package
280
+ bun run typecheck # root core + coding capability + tui + chat check
261
281
  bun test # core / tui test suites
262
282
 
263
283
  # Desktop has its OWN typecheck and build (the root checks do NOT cover it):
@@ -266,7 +286,7 @@ bun run typecheck
266
286
  bun run build
267
287
  ```
268
288
 
269
- > Current caveat: `bun run typecheck` at the repo root reports a pre-existing test typing error in `packages/core/src/tool-system/builtin/drive-claude-code.test.ts:158`. Use it for signal, but do not treat it as a clean gate until that is fixed.
289
+ > Current caveat: `bun run typecheck` at the repository root still reports pre-existing test-source typing diagnostics. The package builds and Desktop typecheck above are the clean gates for this change.
270
290
 
271
291
  `bun run dev` launches the desktop app. For the TUI in dev: `bun run dev:tui`.
272
292
 
@@ -276,6 +296,14 @@ bun run build
276
296
 
277
297
  ## Further reading
278
298
 
299
+ - [Panel Apps v2 — project-bound UI, tools, and Skills](docs/panel-apps.md)
300
+ - [Panel App starter template](https://github.com/cjhyy/codeshell-panel-apps/tree/main/templates/starter)
301
+ - [Design Studio reference Panel App](https://github.com/cjhyy/codeshell-panel-apps/tree/main/apps/design-studio)
302
+ - [Quant Lab reference Panel App](https://github.com/cjhyy/codeshell-panel-apps/tree/main/apps/quant-lab)
303
+ - [Video editor reference plugin](examples/plugins/video-editor/README.md)
304
+ - [Package boundaries & Pet split rationale](docs/architecture/12-package-boundaries-and-release-units.md)
305
+ - [Plugin parity matrix](docs/architecture/13-plugin-parity-and-video-editor.md)
306
+ - [Digital humans & Pet architecture](docs/architecture/14-digital-human-and-pet.md)
279
307
  - [Architecture & feature inventory](docs/architecture/README.md)
280
308
  - [Roadmap & TODO](docs/todo/README.md)
281
309
  - [Prior architecture documentation set (archived, pending rewrite)](docs/archive/architecture/README.md)
@@ -284,7 +312,7 @@ bun run build
284
312
 
285
313
  ## Acknowledgments
286
314
 
287
- The `ApplyPatch` tool (`packages/core/src/tool-system/builtin/apply-patch/`) is adapted from
315
+ The `ApplyPatch` tool (`packages/coding/src/tools/apply-patch/`) is adapted from
288
316
  [OpenAI Codex `codex-rs/apply-patch`](https://github.com/openai/codex/tree/main/codex-rs/apply-patch),
289
317
  licensed under the Apache License 2.0. See `NOTICE.md` and `LICENSE-codex` in that directory
290
318
  for details, including the intentional behavioral divergence where our applier rolls back
package/README.zh-CN.md CHANGED
@@ -30,7 +30,7 @@ CodeShell 是同一个编排引擎的三种形态:
30
30
  - **Electron 桌面应用**:提供聊天、文件/浏览器/终端/diff 面板、模型与凭证管理、扩展市场、自动化和手机远程控制;
31
31
  - **程序化 SDK** (`import { Engine } from "@cjhyy/code-shell"`):可把引擎嵌入你自己的产品。
32
32
 
33
- 核心引擎保持**领域无关**。turn loop、上下文管理、权限、MCP 集成、hooks、tasks、cron、sub-agents、sessions 和 memory 都是通用机制;“写代码助手”只是叠在引擎上的一个 preset,而不是写死在核心里。
33
+ 核心引擎保持**领域无关**。turn loop、上下文管理、权限、MCP 集成、hooks、tasks、cron、sub-agents、sessions 和 memory 都是通用机制。编码工具、git/worktree、LSP、review、quota 与编码 prompt 位于物理独立的 `@cjhyy/code-shell-capability-coding` 包,由 CLI/Desktop host 组合,不写进 core。
34
34
 
35
35
  > 状态:**0.6.x,进入 beta 阶段**。桌面应用是当前主产品;CLI 和 SDK 共享同一个核心引擎。
36
36
 
@@ -99,10 +99,11 @@ bun run dev # 以开发模式启动桌面应用
99
99
 
100
100
  ### Presets
101
101
 
102
- | Preset | 用途 | 额外工具 |
103
- |--------|------|----------|
104
- | `general` | 通用编排、研究、自动化、长期任务 | 仅核心编排工具 |
105
- | `terminal-coding` | 终端原生编码助手 | `EnterWorktree`, `ExitWorktree`, `NotebookEdit`, `LSP`, `Brief`, `Arena` |
102
+ | Preset | 用途 | 额外工具 |
103
+ | ----------------- | ---------------------------------- | ------------------------------------------------------------------------ |
104
+ | `harness-min` | 供其他产品嵌入的领域无关 core 默认 | 最小文件、shell、MCP、memory、task 与 agent 机制 |
105
+ | `general` | 通用编排、研究、自动化、长期任务 | 仅核心编排工具 |
106
+ | `terminal-coding` | 终端原生编码助手 | `EnterWorktree`, `ExitWorktree`, `NotebookEdit`, `LSP`, `Brief`, `Arena` |
106
107
 
107
108
  Preset 决定 system prompt、内置工具集和权限默认值。可通过 SDK、CLI `--preset` 参数或 settings 配置。
108
109
 
@@ -127,8 +128,8 @@ Preset 决定 system prompt、内置工具集和权限默认值。可通过 SDK
127
128
 
128
129
  ### 内置工具
129
130
 
130
- 默认 `general` preset 白名单包含 48 个内置工具。CLI 默认使用
131
- `terminal-coding` preset,并额外加入编码相关工具。运行时 guard 可能隐藏当前不可用的
131
+ 单独使用 core 时默认是最小的 `harness-min` preset。CLI Desktop 会组合 coding
132
+ capability 包,该宿主的默认 preset 是 `terminal-coding`。运行时 guard 可能隐藏当前不可用的
132
133
  provider、凭证、cookie 或 goal 相关工具。
133
134
 
134
135
  - **File / workspace**:`Read`, `Write`, `Edit`, `ApplyPatch`, `Glob`, `Grep`
@@ -214,6 +215,7 @@ OpenAI-compatible provider 会中止在 `CODESHELL_STREAM_IDLE_TIMEOUT_MS` 毫
214
215
  高层来看,CodeShell 让 CLI、headless、SDK 和桌面客户端都走同一个 engine runtime:
215
216
 
216
217
  - **Preset resolution** 选择 system prompt、内置工具和权限默认值;
218
+ - **Capability composition** 允许产品在 core 之外注入工具、presets、prompt sections、文件历史行为与 session workspace adapter;
217
219
  - **TurnLoop** 协调模型流式输出、上下文组装、工具执行和生命周期事件;
218
220
  - **Tool system** 承载内置工具、MCP tools、permissions、hooks 和 cancellation;
219
221
  - **Session / run layers** 持久化 transcripts、state、tasks、automation runs 和 memories。
@@ -223,7 +225,7 @@ OpenAI-compatible provider 会中止在 `CODESHELL_STREAM_IDLE_TIMEOUT_MS` 毫
223
225
  设计原则:
224
226
 
225
227
  - **Core first**:编排引擎保持领域无关;
226
- - **Presets over hardcoding**:编码行为存在配置里;
228
+ - **Capabilities over hardcoding**:编码行为放在独立 package 中,在 host 边界组合;
227
229
  - **Secure by default**:高影响动作默认经过权限门禁;
228
230
  - **Long-running ready**:tasks、cron、sleep、sub-agents 和 persistent goals 都是一等能力。
229
231
 
@@ -233,10 +235,19 @@ OpenAI-compatible provider 会中止在 `CODESHELL_STREAM_IDLE_TIMEOUT_MS` 毫
233
235
 
234
236
  ```text
235
237
  packages/
236
- ├── core/ # Engine, context, tools, MCP, hooks, sessions, runs, presets, memory
237
- ├── tui/ # Terminal CLI, Ink-based UI, renderer, commands, approvals
238
- ├── desktop/ # Electron desktop client + agent worker bridge + mobile remote app
239
- └── cdp/ # Environment-agnostic CDP browser-action layer (no Playwright)
238
+ ├── link/ # 与框架无关的 Link provider 清单和授权指南
239
+ ├── core/ # 领域无关的 Engine、context、MCP、hooks、sessions、runs、memory
240
+ ├── coding/ # 编码 capability:tools、git/worktrees、LSP、review、prompt/presets
241
+ ├── arena/ # 可选的多模型 Arena capability
242
+ ├── pet/ # Mimi 行为、DelegateWork、投影协议、数字人团队
243
+ ├── server/ # Headless HTTP/WebSocket host、rooms、uploads、mobile remote
244
+ ├── web/ # 浏览器安全的远程客户端状态与 SPA
245
+ ├── tui/ # Terminal CLI、Ink UI、renderer、commands、approvals
246
+ ├── desktop/ # Electron desktop client、agent worker bridge、mobile remote app
247
+ ├── cdp/ # Environment-agnostic CDP browser-action layer (no Playwright)
248
+ └── chat/ # 独立多渠道聊天网关与可选 CodeShell adapter
249
+
250
+ package.json # @cjhyy/code-shell 兼容 meta package
240
251
 
241
252
  assets/ # README / product images (mascot, promo hero, Playwright desktop screenshots)
242
253
 
@@ -254,8 +265,8 @@ scripts/ # Build, release, and repo maintenance scripts
254
265
 
255
266
  ```bash
256
267
  bun install
257
- bun run build # build core + tui + meta package
258
- bun run typecheck # root core + tui check; currently not a clean gate
268
+ bun run build # build link + core + capability/host packages + meta package
269
+ bun run typecheck # root core + coding capability + tui + chat check
259
270
  bun test # core / tui test suites
260
271
 
261
272
  # Desktop has its OWN typecheck and build (root checks do NOT cover it):
@@ -264,7 +275,7 @@ bun run typecheck
264
275
  bun run build
265
276
  ```
266
277
 
267
- > 当前注意:repo root 的 `bun run typecheck` 会因 `packages/core/src/tool-system/builtin/drive-claude-code.test.ts:158` 的既有测试类型错误失败。它仍可提供信号,但在该错误修复前不要把它当成干净 gate。
278
+ > 当前注意:repo root 的 `bun run typecheck` 仍会报告既有的测试源码类型诊断。本次改动以各 package build 与上面的 Desktop typecheck 作为干净 gate。
268
279
 
269
280
  `bun run dev` 会启动桌面应用。TUI 开发模式:`bun run dev:tui`。
270
281
 
@@ -275,6 +286,11 @@ bun run build
275
286
  ## 延伸阅读
276
287
 
277
288
  - [Architecture & feature inventory](docs/architecture/README.md)
289
+ - [Plugin panels v1](docs/plugin-panels.md)
290
+ - [视频剪辑参考插件](examples/plugins/video-editor/README.md)
291
+ - [包边界与 Pet 拆分理由](docs/architecture/12-package-boundaries-and-release-units.md)
292
+ - [插件能力差距矩阵](docs/architecture/13-plugin-parity-and-video-editor.md)
293
+ - [数字人与 Pet 架构](docs/architecture/14-digital-human-and-pet.md)
278
294
  - [Roadmap & TODO](docs/todo/README.md)
279
295
  - [Prior architecture documentation set (archived, pending rewrite)](docs/archive/architecture/README.md)
280
296
 
@@ -282,7 +298,7 @@ bun run build
282
298
 
283
299
  ## 致谢
284
300
 
285
- `ApplyPatch` tool(`packages/core/src/tool-system/builtin/apply-patch/`)改编自 [OpenAI Codex `codex-rs/apply-patch`](https://github.com/openai/codex/tree/main/codex-rs/apply-patch),使用 Apache License 2.0。详见该目录下的 `NOTICE.md` 和 `LICENSE-codex`。
301
+ `ApplyPatch` tool(`packages/coding/src/tools/apply-patch/`)改编自 [OpenAI Codex `codex-rs/apply-patch`](https://github.com/openai/codex/tree/main/codex-rs/apply-patch),使用 Apache License 2.0。详见该目录下的 `NOTICE.md` 和 `LICENSE-codex`。
286
302
 
287
303
  ## License
288
304
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjhyy/code-shell",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "Code Shell — meta package. Installs @cjhyy/code-shell-core and @cjhyy/code-shell-tui.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,22 +16,30 @@
16
16
  },
17
17
  "scripts": {
18
18
  "preinstall": "node scripts/check-node.cjs",
19
- "build": "bun run --filter '@cjhyy/code-shell-core' build && bun run --filter '@cjhyy/code-shell-tui' build && bun run scripts/build-meta.ts",
19
+ "build": "bun run --filter '@cjhyy/code-shell-link' build && bun run --filter '@cjhyy/code-shell-core' build && bun run --filter '@cjhyy/code-shell-pet' build && bun run --filter '@cjhyy/code-shell-arena' build && bun run --filter '@cjhyy/code-shell-capability-coding' build && bun run --filter '@cjhyy/code-shell-cdp' build && bun run --filter '@cjhyy/code-shell-server' build && bun run --filter '@cjhyy/code-shell-web' build && bun run --filter '@cjhyy/code-shell-tui' build && bun run --filter '@cjhyy/code-shell-chat' build && bun run scripts/build-meta.ts",
20
20
  "dev": "bun run dev:desktop",
21
21
  "dev:desktop": "bun run --filter '@cjhyy/code-shell-desktop' dev",
22
22
  "dev:tui": "CODE_SHELL_DEV=1 CODESHELL_UI_PERF=1 bun run packages/tui/src/cli/main.ts",
23
23
  "dev:bigtranscript": "bun run scripts/render-bigtranscript-dev.ts",
24
- "test": "bun test",
25
- "test:watch": "bun test --watch",
24
+ "test": "bun test --timeout 30000",
25
+ "test:coverage": "bun test --timeout 30000 --config ./bunfig.coverage.toml packages/core/src/tool-system/builtin packages/core/src/tool-system/testing --coverage --coverage-reporter=text",
26
+ "test:e2e": "bun run build && bun run --cwd packages/desktop build && bun run --cwd packages/desktop test:e2e",
27
+ "smoke": "bun run build && bun run --cwd packages/desktop build && bun run --cwd packages/desktop smoke",
28
+ "test:core-exports": "bun run --filter '@cjhyy/code-shell-core' build && node scripts/smoke-core-exports.mjs",
29
+ "test:core-harness": "bun run --filter '@cjhyy/code-shell-core' build && node scripts/smoke-core-harness.mjs",
30
+ "test:package-release": "bun run scripts/package-release-smoke.ts",
31
+ "test:watch": "bun test --timeout 30000 --watch",
26
32
  "bench:render": "bun run bench/render-tail.bench.ts && bun run bench/render-streaming.bench.ts && bun run bench/render-spinner.bench.ts && bun run bench/render-wheel.bench.ts",
27
- "typecheck": "tsc --noEmit",
33
+ "typecheck": "bun run --filter '@cjhyy/code-shell-chat' typecheck && tsc --noEmit",
28
34
  "lint": "eslint packages/",
29
35
  "lint:engine-bypass": "bash scripts/check-no-engine-bypass.sh",
36
+ "lint:workflow-test-paths": "node scripts/check-workflow-test-paths.mjs",
37
+ "lint:baseline": "node scripts/check-lint-baseline.mjs",
30
38
  "format": "prettier --write 'packages/**/*.ts'"
31
39
  },
32
40
  "dependencies": {
33
- "@cjhyy/code-shell-core": "0.7.1",
34
- "@cjhyy/code-shell-tui": "0.7.1"
41
+ "@cjhyy/code-shell-core": "0.8.1",
42
+ "@cjhyy/code-shell-tui": "0.8.1"
35
43
  },
36
44
  "workspaces": [
37
45
  "packages/*"