Files
apes-sidebar/src/client/apes/index.ts
T
figmar aa28c1fbc7 feat(v1.1.0): adapt to DSH 2.0.10 (0.1.5-rc.2), drop apes:tasks, DSW token styles
C1-C5 env repair:
- align all @deepseek-ai/dsh-* peer+devDeps to 0.1.5-rc.2 (DSH 2.0.10 ships it)
- fix 0.1.5-rc.2 npm packaging defect: 15 primitives runtime deps (anser,
  shiki, katex, marked, ... ) were mis-declared as devDeps in the published
  package -> add to local devDependencies so vitest can resolve them
- fix sidechat-seed contract: dsh-session@0.1.5 assertAssistantSettlementShape
  now requires a top-level data.stream: Array on assistant messages -> seed
  helper emits stream: []

C6 slim tabs:
- remove apes:tasks (overlaps the official DSH session tree in the native
  sidebar); keep apes:agents / apes:apps / apes:profile
- clean dead code: ApesTasksView + job helpers import + apes i18n dead keys
  (tasks/status/duration) and the unused menu-title keys

C7 style align:
- apes view inline colors -> DSW alias tokens (--dsw-alias-bg/border/label/
  state-success/interactive) with literal fallbacks; geometry (font/spacing/
  radius) stays inline (DSH exposes no --ds-* geometry tokens to plugin panels)

gate: typecheck ok / build ok / test 119 files · 1249 passed
2026-09-16 01:57:46 +08:00

44 lines
1.8 KiB
TypeScript

/**
* apes:* information-layer tabs — the fork's own contribution on top of the
* upstream dsh-better-sidebar. Three tabs ship (agents / apps / profile);
* `apes:tasks` was removed (C6) because it overlaps the official DSH session
* tree in the native sidebar, and `messages` is deferred (no DSH
* message-stream API yet — tracked separately).
*
* Isolated under `src/client/apes/` so the upstream `builtins/` tree stays
* untouched: cherry-picking upstream releases only has to keep the single
* `registerApesTabs(...)` call site in `index.tsx` (see D1 = module B).
*
* Every descriptor is registered through the same `BetterSidebarService`
* the builtins use (dogfood), so the apes tabs get the full sidebar
* lifecycle for free: + menu, enable/disable switches, badge pills,
* dedupe/focus, and HMR-safe disposal via the returned disposer.
*/
import type { Context } from '../../context-types.ts'
import type { BetterSidebarService } from '../service.ts'
import { apesTabs } from './tabs.tsx'
// Re-exported so index.tsx can register the apes dictionaries + attach the
// locale service in one import (keeps the apes module self-contained).
export { APES_LOCALE_NS, apesZh, apesEn, attachApesLocale } from './locales.ts'
/**
* Register the apes:* tabs with the sidebar service. Returns a disposer that
* unregisters all of them (cordis auto-invokes it on fiber disposal, so HMR
* re-activation re-registers cleanly — same contract as registerBuiltins).
*/
export function registerApesTabs(
_ctx: Context,
service: BetterSidebarService,
): () => void {
const disposers: (() => void)[] = []
for (const tab of apesTabs) {
disposers.push(service.registerTab(tab))
}
return () => {
for (const d of disposers) {
try { d() } catch { /* already disposed */ }
}
}
}