feat(apes): Phase 2 数据接入 — 4 个信息层 tab 接真实会话数据
- apes:tasks 接 jobsBySession + running sessions(live 任务列表:
label/status/kind/耗时 + owner 归属,复用 collectTreeJobs/orderJobs)
- apes:agents 接 subagent 拓扑(rootAncestor + subagentsByParent 目录,
parent→children activity running/inactive, 降级用 byId origin 过滤)
- apes:profile 接 byId[current](当前会话画像: title/cwd/running + agent 状态)
- apes:apps 展示 cwd/workspace 信息(无 DSH host feed, 保留说明)
数据源: ctx.sessions.list (useSyncExternalStore, uSES 安全订阅)
复用 pure helper: subagent-lineage.ts (rootAncestor/isSideThreadSummary)
+ subagent-jobs.ts (collectTreeJobs/orderJobs/isJobLive/jobDotState)
UI 独立内联样式, 不耦合 builtin CSS module / StateDot (保持 apes/ 隔离)
locales: 加 status/duration/empty/workspace 文案 (zh+en, 含 {param} 插值)
gate: 1250 passed | typecheck exit 0 | tsdown build complete
This commit is contained in:
@@ -123,8 +123,9 @@ describe('apes i18n contract', () => {
|
||||
|
||||
it('supports {param} interpolation', () => {
|
||||
attachApesLocale({ getSnapshot: () => ({ active: 'zh' }) })
|
||||
// The placeholder hints carry no params today; assert the mechanism via
|
||||
// a synthetic key shape (the t() contract, not a real apes key).
|
||||
expect(typeof t('apesTasksHint')).toBe('string')
|
||||
// The duration strings carry {seconds} params — assert the mechanism via
|
||||
// a real key (the t() contract, not a synthetic one).
|
||||
expect(t('apesDurationSeconds', { seconds: 5 })).toBe('5 秒')
|
||||
expect(t('apesDurationMinutes', { minutes: 2, seconds: 7 })).toBe('2 分 7 秒')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user