chore(sync): re-base the fork onto upstream dsh-better-sidebar v0.19.1
The fork was pinned at upstream v0.18.0. That is the entire reason the window
ran TWO sidebars and TWO near-identical panel toggles: DSH 2.0.10 ships its own
right sidebar (@deepseek-ai/dsh-client-ui-sidebar-right), and upstream only
adopted it in v0.19.0-alpha.1 — which arrived after our fork point. v0.19.1 is
also the one upstream line whose support range actually matches our host
(engines.dsh >=0.1.5-rc.1, 14 DSH peers ^0.1.5-rc.1, host = 0.1.5-rc.2), so it
is the only tag the host's startup precheck accepts.
What upstream v0.18.0 → v0.19.1 brings
- src/client/native/{index,surface,tab-adapter}.tsx: every tab the plugin can
draw becomes an OFFICIAL native tab type + body, and an external plugin's
descriptor registered later gets its native type too. This is what retires
the fork's own right panel — and with it the duplicate toggle cluster
(`toggleCluster` is gone from v0.19.1).
- native tab-chip icons via the `sidebar.right.pane.tab.title` seat, coloured
built-in tab icons, file/folder glyphs from DSH's own `FileTypeIcon`.
- guide descriptions (DSH renders them while the guide lists <= 4 entries),
tab bodies that fill the panel, and the 0.1.5-rc.2 adaptation work we were
carrying by hand (peer/devDep pinning, primitives' transitive devDeps).
How the sync was done
Rebuilt the tree from the v0.19.1 tag rather than resolving 53 conflicted
files: our v0.18.0 delta was measured first and is only (a) one mechanical
rename `dsh-better-sidebar` -> `dsh-apes-sidebar` and (b) ten real edits. So:
tag tree + rename (scoped: code/config/scripts/tests/README, while the 46
historical docs/plans records and switch.sh's upstream package name stay
untouched) + re-applied deltas + our apes module.
Fork deltas re-applied on the new base
- src/client/apes/ (icons / locales / tabs): the three apes:* information-layer
tabs (agents / apps / profile), registered through the same BetterSidebarService
as the builtins — which is exactly why they now ride upstream's native adapter
into the official sidebar for free.
- identity: package.json (name/version 1.2.0/description/forkedFrom), dsh.plugin.json
(id/version), SIDEBAR_SERVICE_VERSION 1.2.0, README fork notice,
docs/external-plugin-guide.md.
- scripts/switch.sh + the pnpm switch* scripts (apes <-> upstream two-line switch).
- tests/apes-tabs.spec.ts (unescaped: it starts from the v0.19.1 base).
Dropped
- the Phase A native-registration spike (`apes/native-tabs.tsx` + its spec): it
re-derived by hand exactly what upstream's native layer already does — the
hand-written bridge is dead weight now, and v0.19.1's own e2e/jsdom lanes
cover the same seat contract far better.
- the unused apesProfileGuideDesc key and the two package.json.bak.* backups.
Verified on the new base: typecheck clean; build clean; 1351 passed / 9 skipped
(128 files), up from 1255 on the old base.
This commit is contained in:
1 parent
8753096a58
commit
5a7e2139a0
90 files changed
+1483
-796
No files matched your search
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Tab glyphs for the apes tabs (智能体 / 应用 / 画像).
|
||||
*
|
||||
* These follow the SAME recipe as this repo's own icon set in
|
||||
* `src/client/icons.tsx` — the one the sidebar already uses for 终端 /
|
||||
* 浏览器 / 文件变动: a 16×16 viewBox whose artwork spans 1.5–14.5, a 1.5px
|
||||
* `currentColor` stroke, round caps/joins, `fill: none`.
|
||||
*
|
||||
* That recipe is what makes an icon sit at the native visual weight in the
|
||||
* `+` new-tab menu and the right-panel tile grid: DSH's own glyphs fill
|
||||
* ~92–96% of the box, so artwork padded any tighter renders visibly small
|
||||
* next to them.
|
||||
*
|
||||
* (An earlier revision drew these as fill-only paths spanning only 10–12 of
|
||||
* the 16 units — that is why they read as a separate, lighter family.)
|
||||
*/
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
/** Agent glyph: a rounded robot head with two fill eyes. */
|
||||
export function IconAgentOutline16({ size = 16, className }: { size?: number; className?: string }): ReactNode {
|
||||
return (
|
||||
<svg width={size} height={size} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
||||
<rect x="1.5" y="3" width="13" height="11.5" rx="4.2" stroke="currentColor" strokeWidth="1.5" />
|
||||
<circle cx="5.8" cy="8.6" r="1.25" fill="currentColor" />
|
||||
<circle cx="10.2" cy="8.6" r="1.25" fill="currentColor" />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
/** Apps glyph: a 2×2 grid of rounded squares. */
|
||||
export function IconAppsOutline16({ size = 16, className }: { size?: number; className?: string }): ReactNode {
|
||||
return (
|
||||
<svg width={size} height={size} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
||||
<rect x="1.5" y="1.5" width="5.5" height="5.5" rx="1.8" stroke="currentColor" strokeWidth="1.5" />
|
||||
<rect x="9" y="1.5" width="5.5" height="5.5" rx="1.8" stroke="currentColor" strokeWidth="1.5" />
|
||||
<rect x="1.5" y="9" width="5.5" height="5.5" rx="1.8" stroke="currentColor" strokeWidth="1.5" />
|
||||
<rect x="9" y="9" width="5.5" height="5.5" rx="1.8" stroke="currentColor" strokeWidth="1.5" />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
/** Profile glyph: a head over shoulders. */
|
||||
export function IconUserOutline16({ size = 16, className }: { size?: number; className?: string }): ReactNode {
|
||||
return (
|
||||
<svg width={size} height={size} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
||||
<circle cx="8" cy="4.9" r="3.4" stroke="currentColor" strokeWidth="1.5" />
|
||||
<path d="M1.5 14.5c0-3.3 2.8-5.3 6.5-5.3s6.5 2 6.5 5.3" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* 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 */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* apes:* tab i18n — isolated from the upstream `betterSidebar` locale
|
||||
* namespace (D1 = module B). The fork keeps its own `apes` namespace and
|
||||
* its own `t()` so that adding apes keys never touches the upstream
|
||||
* `locales.ts` (whose `CopyKey = keyof typeof zh` is closed over its own
|
||||
* dicts). The `t()` mirrors the upstream implementation's resolution order
|
||||
* (active-locale chain → key fallback) but reads the apes dicts; it is NOT
|
||||
* wired to the better-locale override store in Phase 1 (those third-language
|
||||
* overrides ride the lazy `locale` chunk that only covers `betterSidebar`
|
||||
* entries — apes keys fall back to zh/en, which is acceptable for the
|
||||
* placeholder round and gets the override integration in Phase 2).
|
||||
*/
|
||||
|
||||
/** The apes locale namespace (registered with ctx.locale under this key). */
|
||||
export const APES_LOCALE_NS = 'apes'
|
||||
|
||||
/** The zh dictionary (source of truth). */
|
||||
export const apesZh = {
|
||||
// View titles
|
||||
apesAgentsTitle: '智能体',
|
||||
apesAppsTitle: '应用',
|
||||
apesProfileTitle: '画像',
|
||||
// Agents view
|
||||
apesAgentsEmpty: '当前会话没有子智能体',
|
||||
apesAgentsRoot: '主智能体',
|
||||
apesAgentRunning: '运行中',
|
||||
apesAgentInactive: '空闲',
|
||||
apesAgentOneShot: '一次性',
|
||||
apesAgentContinuable: '可续',
|
||||
// Profile view
|
||||
apesProfileCurrent: '当前会话',
|
||||
apesProfileCwd: '工作目录',
|
||||
apesProfileNoCwd: '未知',
|
||||
apesProfileRunning: '运行中',
|
||||
apesProfileIdle: '空闲',
|
||||
// Apps view
|
||||
apesAppsNoFeed: '当前 DSH 版本未提供工作区应用数据源',
|
||||
apesAppsWorkspace: '工作区',
|
||||
} as const
|
||||
|
||||
/** The en dictionary (checked against zh — every zh key must appear here). */
|
||||
export const apesEn: Record<keyof typeof apesZh, string> = {
|
||||
apesAgentsTitle: 'Agents',
|
||||
apesAppsTitle: 'Apps',
|
||||
apesProfileTitle: 'Profile',
|
||||
apesAgentsEmpty: 'No subagents in this session',
|
||||
apesAgentsRoot: 'Main agent',
|
||||
apesAgentRunning: 'running',
|
||||
apesAgentInactive: 'idle',
|
||||
apesAgentOneShot: 'one-shot',
|
||||
apesAgentContinuable: 'continuable',
|
||||
apesProfileCurrent: 'Current session',
|
||||
apesProfileCwd: 'Working directory',
|
||||
apesProfileNoCwd: 'unknown',
|
||||
apesProfileRunning: 'running',
|
||||
apesProfileIdle: 'idle',
|
||||
apesAppsNoFeed: 'This DSH version exposes no workspace-app feed',
|
||||
apesAppsWorkspace: 'Workspace',
|
||||
}
|
||||
|
||||
export type ApesCopyKey = keyof typeof apesZh
|
||||
|
||||
/** Resolve the currently active DSH locale ('zh' | 'en' today). */
|
||||
export function attachApesLocale(service: { getSnapshot(): { active: string } } | undefined): void {
|
||||
apesLocaleService = service
|
||||
}
|
||||
|
||||
let apesLocaleService: { getSnapshot(): { active: string } } | undefined
|
||||
|
||||
/**
|
||||
* Translate an apes key. Resolution order: active-locale chain (zh dict when
|
||||
* the DSH preference is zh, en dict otherwise) → key fallback (shows the key
|
||||
* itself rather than `undefined`). Mirrors the upstream t() minus the
|
||||
* better-locale override (Phase 2).
|
||||
*/
|
||||
export function t(key: ApesCopyKey, params?: Record<string, string | number>): string {
|
||||
const active = apesLocaleService?.getSnapshot().active ?? 'zh'
|
||||
const dict = active.toLowerCase().startsWith('zh') ? apesZh : apesEn
|
||||
let text: string | undefined = dict[key]
|
||||
if (text === undefined) text = key
|
||||
if (params !== undefined) {
|
||||
for (const [name, value] of Object.entries(params)) {
|
||||
text = text.replaceAll(`{${name}}`, String(value))
|
||||
}
|
||||
}
|
||||
return text
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
/**
|
||||
* apes:* tab views (D2 = data wiring). Each tab reads live data from the
|
||||
* sessions list feed (`ctx.sessions.list`) via `useSyncExternalStore` and
|
||||
* reuses the fork's PURE lineage/job helpers — these are framework-free and
|
||||
* live outside `builtins/`, so importing them does not couple the apes module
|
||||
* to upstream UI and survives cherry-picks.
|
||||
*
|
||||
* Three information-layer tabs (C6: `apes:tasks` removed — it overlaps the
|
||||
* official DSH session tree in the native sidebar):
|
||||
* - apes:agents → the subagent topology rooted at the main agent of the
|
||||
* current session (rootAncestor + per-parent catalogs).
|
||||
* - apes:apps → no DSH host feed today: shows the workspace (cwd) of the
|
||||
* current session, otherwise an honest "no feed" note.
|
||||
* - apes:profile → the current session's summary row (title, cwd, running).
|
||||
*
|
||||
* Visual unity (C7): colors use the DSW design-token aliases
|
||||
* (`--dsw-alias-*`) so the apes panels match the native DSH sidebar
|
||||
* surface; the runtime defines these on :root. Font sizes / spacing /
|
||||
* radius stay inline (DSH exposes no public `--ds-*` geometry alias for
|
||||
* plugin panels — its own vendor bundles inline those too).
|
||||
*
|
||||
* Data sources (structural mirror — runtime provided by the DSH host):
|
||||
* - `ctx.sessions.list.getSnapshot()` → { current, byId, subagentsByParent? };
|
||||
* `subscribe(cb)` is uSES-safe.
|
||||
* - `scope.sessionId` = the currently-open session.
|
||||
*/
|
||||
import { useCallback, useMemo, useState, type CSSProperties } from 'react'
|
||||
import { useSyncExternalStore } from 'react'
|
||||
import { IconAgentOutline16, IconAppsOutline16, IconUserOutline16 } from './icons.tsx'
|
||||
import type { TabComponentProps, TabDescriptor } from '../service.ts'
|
||||
import type {
|
||||
SidebarSessionList,
|
||||
SidebarSessionSummary,
|
||||
SidebarSubagentCatalog,
|
||||
SidebarSubagentChildEntry,
|
||||
} from '../../context-types.ts'
|
||||
import { rootAncestor, isSideThreadSummary } from '../subagent-lineage.ts'
|
||||
import { t } from './locales.ts'
|
||||
|
||||
/**
|
||||
* DSW design-token color aliases. The DSH runtime defines these on :root
|
||||
* (same set the native dsh-client-ui-* vendor bundles consume). We reference
|
||||
* them by name via `var(...)` with a literal fallback so the panels still
|
||||
* render in a non-DSH context (unit harness) with a sane dark palette.
|
||||
*/
|
||||
const DSW = {
|
||||
bgBase: 'var(--dsw-alias-bg-base, #1a1a1a)',
|
||||
bgLayer1: 'var(--dsw-alias-bg-layer-1, #202020)',
|
||||
borderL1: 'var(--dsw-alias-border-l1, #2a2a2a)',
|
||||
borderL2: 'var(--dsw-alias-border-l2, #303030)',
|
||||
labelPrimary: 'var(--dsw-alias-label-primary, #e8e8e8)',
|
||||
labelSecondary: 'var(--dsw-alias-label-secondary, #a0a0a0)',
|
||||
labelTertiary: 'var(--dsw-alias-label-tertiary, #7a7a7a)',
|
||||
success: 'var(--dsw-alias-state-success-primary, #52c41a)',
|
||||
interactiveHover: 'var(--dsw-alias-interactive-bg-hover, rgba(255,255,255,0.06))',
|
||||
} as const
|
||||
|
||||
/** Shared inline styles (KISS: one object, no CSS module). Colors via DSW. */
|
||||
const S: Record<string, CSSProperties> = {
|
||||
body: { padding: 12, display: 'flex', flexDirection: 'column', gap: 12 },
|
||||
title: { margin: 0, fontSize: 14, fontWeight: 600, color: DSW.labelPrimary },
|
||||
hint: { margin: 0, fontSize: 12, color: DSW.labelTertiary },
|
||||
list: { display: 'flex', flexDirection: 'column', gap: 8 },
|
||||
card: { border: `1px solid ${DSW.borderL1}`, borderRadius: 8, padding: 10, display: 'flex', flexDirection: 'column', gap: 6, background: DSW.bgLayer1 },
|
||||
cardRow: { display: 'flex', alignItems: 'center', gap: 8 },
|
||||
cardLabel: { fontSize: 13, fontWeight: 500, flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', color: DSW.labelPrimary },
|
||||
cardSecondary: { fontSize: 11, color: DSW.labelSecondary, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },
|
||||
badge: { fontSize: 11, color: DSW.labelTertiary, flexShrink: 0 },
|
||||
}
|
||||
|
||||
/** A small colored status dot (self-contained, not the builtin StateDot). */
|
||||
function Dot(props: { color: string }) {
|
||||
const style: CSSProperties = {
|
||||
width: 8, height: 8, borderRadius: '50%', background: props.color, flexShrink: 0, display: 'inline-block',
|
||||
}
|
||||
return <span aria-hidden style={style} />
|
||||
}
|
||||
|
||||
/** Subscribe to the sessions list feed (uSES-safe). Returns the live snapshot. */
|
||||
function useSessionList(ctx: TabComponentProps['ctx']): SidebarSessionList {
|
||||
const sessions = ctx.sessions
|
||||
return useSyncExternalStore(
|
||||
useMemo(() => (callback: () => void) => sessions.list.subscribe(callback), [sessions]),
|
||||
useCallback(() => sessions.list.getSnapshot(), [sessions]),
|
||||
)
|
||||
}
|
||||
|
||||
/** One level of the subagent topology (rooted at the main agent). */
|
||||
function agentChildren(
|
||||
byId: Readonly<Record<string, SidebarSessionSummary>>,
|
||||
parentSessionId: string,
|
||||
): SidebarSessionSummary[] {
|
||||
return Object.values(byId).filter(
|
||||
s => s.origin === 'subagent' && s.parentId === parentSessionId && !isSideThreadSummary(s),
|
||||
)
|
||||
}
|
||||
|
||||
/** apes:agents — the subagent topology of the current session's tree. */
|
||||
function ApesAgentsView(props: TabComponentProps) {
|
||||
const list = useSessionList(props.ctx)
|
||||
const { byId, subagentsByParent } = list
|
||||
const rootId = useMemo(() => rootAncestor(byId, props.scope.sessionId), [byId, props.scope.sessionId])
|
||||
const rootSummary = rootId === undefined ? undefined : byId[rootId]
|
||||
const rootCatalog = rootId === undefined ? undefined : subagentsByParent?.[rootId]
|
||||
|
||||
// The topology: the main agent + its direct subagent children (one level,
|
||||
// with per-child activity). A lazy catalog (subagentsByParent) is preferred
|
||||
// for the child list when present; otherwise fall back to durable byId rows.
|
||||
// (`.filter` does not narrow a union — narrow explicitly to child entries.)
|
||||
const children: SidebarSubagentChildEntry[] = (rootCatalog?.entries ?? [])
|
||||
.filter((e): e is SidebarSubagentChildEntry => e.kind === 'child')
|
||||
.concat(rootCatalog === undefined
|
||||
? agentChildren(byId, rootId ?? '').map<SidebarSubagentChildEntry>(s => ({
|
||||
kind: 'child', id: s.id, mode: 'continuable',
|
||||
activity: s.running === true ? 'running' : 'inactive',
|
||||
label: s.displayTitle, hasChildren: agentChildren(byId, s.id).length > 0,
|
||||
}))
|
||||
: [])
|
||||
|
||||
return (
|
||||
<div style={S.body}>
|
||||
<h2 style={S.title}>{t('apesAgentsTitle')}</h2>
|
||||
{rootSummary === undefined && children.length === 0
|
||||
? <p style={S.hint}>{t('apesAgentsEmpty')}</p>
|
||||
: (
|
||||
<div style={S.list}>
|
||||
{/* Root (main agent) node */}
|
||||
{rootSummary !== undefined && (
|
||||
<div style={S.card}>
|
||||
<div style={S.cardRow}>
|
||||
<Dot color={rootSummary.running === true ? DSW.success : DSW.labelTertiary} />
|
||||
<span style={S.cardLabel} title={rootSummary.displayTitle}>{t('apesAgentsRoot')}: {rootSummary.displayTitle}</span>
|
||||
</div>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.badge}>{rootSummary.running === true ? t('apesAgentRunning') : t('apesAgentInactive')}</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{/* Direct subagent children */}
|
||||
{children.map(entry => {
|
||||
const summary = byId[entry.id]
|
||||
const running = entry.activity === 'running'
|
||||
const label = entry.label ?? summary?.displayTitle ?? entry.id
|
||||
return (
|
||||
<div key={entry.id} style={{ ...S.card, marginLeft: 14, borderLeft: `2px solid ${DSW.borderL2}` }}>
|
||||
<div style={S.cardRow}>
|
||||
<Dot color={running ? DSW.success : DSW.labelTertiary} />
|
||||
<span style={S.cardLabel} title={label}>{label}</span>
|
||||
</div>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.cardSecondary}>
|
||||
{entry.mode === 'one-shot' ? t('apesAgentOneShot') : t('apesAgentContinuable')}
|
||||
{' · '}
|
||||
{running ? t('apesAgentRunning') : t('apesAgentInactive')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** apes:profile — the current session's identity (title, cwd, running state). */
|
||||
export function ApesProfileView(props: TabComponentProps) {
|
||||
const list = useSessionList(props.ctx)
|
||||
const current = list.current
|
||||
const summary = current === undefined ? undefined : list.byId[current]
|
||||
const cwd = summary?.cwd ?? props.scope.cwd
|
||||
|
||||
return (
|
||||
<div style={S.body}>
|
||||
<h2 style={S.title}>{t('apesProfileTitle')}</h2>
|
||||
{summary === undefined
|
||||
? <p style={S.hint}>{t('apesProfileNoCwd')}</p>
|
||||
: (
|
||||
<div style={S.list}>
|
||||
<div style={S.card}>
|
||||
<div style={S.cardRow}>
|
||||
<Dot color={summary.running === true ? DSW.success : DSW.labelTertiary} />
|
||||
<span style={S.cardLabel} title={summary.displayTitle}>{t('apesProfileCurrent')}</span>
|
||||
</div>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.badge}>{summary.running === true ? t('apesProfileRunning') : t('apesProfileIdle')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={S.card}>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.cardLabel}>{summary.displayTitle}</span>
|
||||
</div>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.cardSecondary}>{t('apesProfileCwd')}: {cwd ?? t('apesProfileNoCwd')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** apes:apps — no DSH host feed today; shows the current workspace (cwd). */
|
||||
function ApesAppsView(props: TabComponentProps) {
|
||||
const list = useSessionList(props.ctx)
|
||||
const current = list.current
|
||||
const summary = current === undefined ? undefined : list.byId[current]
|
||||
const cwd = summary?.cwd ?? props.scope.cwd
|
||||
|
||||
return (
|
||||
<div style={S.body}>
|
||||
<h2 style={S.title}>{t('apesAppsTitle')}</h2>
|
||||
<p style={S.hint}>{t('apesAppsNoFeed')}</p>
|
||||
<div style={S.card}>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.cardLabel}>{t('apesAppsWorkspace')}</span>
|
||||
</div>
|
||||
<div style={S.cardRow}>
|
||||
<span style={S.cardSecondary}>{cwd ?? t('apesProfileNoCwd')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* The three apes:* tab descriptors (C6: `apes:tasks` removed — overlaps the
|
||||
* official DSH session tree). Order 901-903: agents/apps/profile. Each is
|
||||
* already shaped as `TabDescriptor` (component + single-instance + icon
|
||||
* element + i18n title function) so `registerApesTabs` can hand them straight
|
||||
* to `service.registerTab`. Information-layer tabs are single-instance.
|
||||
*/
|
||||
export const apesTabs: TabDescriptor[] = [
|
||||
{ id: 'apes:agents', title: () => t('apesAgentsTitle'), icon: (size: number) => <IconAgentOutline16 size={size} />, order: 60, single: true, component: ApesAgentsView },
|
||||
{ id: 'apes:apps', title: () => t('apesAppsTitle'), icon: (size: number) => <IconAppsOutline16 size={size} />, order: 65, single: true, component: ApesAppsView },
|
||||
{ id: 'apes:profile', title: () => t('apesProfileTitle'), icon: (size: number) => <IconUserOutline16 size={size} />, order: 70, single: true, component: ApesProfileView },
|
||||
]
|
||||
Reference in new issue
Block a user