Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions desktop/electron/e2e/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,23 @@ test('terminal: a local PTY round-trips through the bridge', async () => {
});

test('terminal UI: opening a local shell mounts an xterm screen', async () => {
// Ctrl+8 → the Terminal surface (AppShell command hint). The panel is
// always-mounted but CSS-hidden until active.
await page.keyboard.press('Control+8');
// On boot with no hub configured the "Add a hub" connect modal is open; its
// backdrop intercepts clicks on the surface, so dismiss it first (its close
// button lives in the modal head). Conditional — it isn't always present.
// backdrop intercepts clicks, so dismiss it before touching anything else
// (its close button lives in the modal head). Conditional — it isn't always
// present. This now has to happen FIRST: the old version reached the surface
// with a keyboard shortcut, which the backdrop does not block.
const connectClose = page.locator('.connect-head button');
if (await connectClose.isVisible().catch(() => false)) {
await connectClose.click();
await expect(page.locator('.connect')).toHaveCount(0);
}
// Then click the Terminal rail tab BY IDENTITY. Not the Ctrl+<n> shortcut:
// that is positional, so every job added to the activity bar renumbers it and
// silently lands this test on a different surface. Adding J8 Replay between
// Compare and Record moved Terminal from 8 to 9, and the breakage surfaced as
// a 30s click timeout on `.term-add-btn` — a failure that names neither the
// rail nor the shortcut.
await page.locator('[data-job="terminal"]').click();
await page.locator('.term-add-btn').first().click(); // the "+" new-session menu
await page.locator('.term-add-menu button').first().click(); // "Local shell"
// xterm mounted its screen — proves the UI PTY path renders without crashing
Expand Down
40 changes: 40 additions & 0 deletions desktop/src/hub/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,46 @@ export class HubClient {
* secret_refs + network_policy} a spawn attaches via `env_profile_id`. The
* hub holds env_vars + setup_script (non-secret); secret_refs point into the
* zero-knowledge vault. */
// --- datasets (J8 Replay W1) ---
//
// Team-scoped with a `?project=` filter, like runs. The hub owns the row and
// the folded digest; the episodes table is NOT stored there — `listEpisodes`
// is proxied to the host that holds the bytes, so it is a windowed read, not
// a cheap local query. Page it; do not fetch it whole.
async listDatasets(params: { project?: string; host?: string } = {}): Promise<Entity[]> {
const out = await this.transport.get(this.transport.team('/datasets'), params);
return asArray(out);
}
getDataset(id: string): Promise<Entity> {
return this.transport.get(this.transport.team(`/datasets/${id}`)) as Promise<Entity>;
}
/** Register a dataset root. Idempotent on (project, host, root_path): a
* repeat returns the existing row rather than a duplicate, which is what
* makes "Open in Replay" safe to hit twice. */
createDataset(body: Json): Promise<Entity> {
return this.transport.post(this.transport.team('/datasets'), body) as Promise<Entity>;
}
/** Only `name` and `env_ref` are patchable — location and digest are not. */
updateDataset(id: string, patch: Json): Promise<Entity> {
return this.transport.patch(this.transport.team(`/datasets/${id}`), patch) as Promise<Entity>;
}
/** Removes the hub's index entry only; the host's bytes are untouched. */
deleteDataset(id: string): Promise<Json> {
return this.transport.delete(this.transport.team(`/datasets/${id}`));
}
/** Ask the owning host to re-read the root and store the fold. Manual by
* design — nothing re-reads a dataset unasked. */
refreshDataset(id: string): Promise<Entity> {
return this.transport.post(this.transport.team(`/datasets/${id}/refresh`), {}) as Promise<Entity>;
}
/** One window of the episodes table, proxied from the host. */
listDatasetEpisodes(id: string, params: { offset?: number; limit?: number } = {}): Promise<Entity> {
return this.transport.get(this.transport.team(`/datasets/${id}/episodes`), {
offset: params.offset !== undefined ? String(params.offset) : undefined,
limit: params.limit !== undefined ? String(params.limit) : undefined,
}) as Promise<Entity>;
}

async listEnvProfiles(): Promise<Entity[]> {
const out = await this.transport.get(this.transport.team('/env-profiles'));
return asArray(out);
Expand Down
91 changes: 91 additions & 0 deletions desktop/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,53 @@ const en: Dict = {
'job.debug.hint': 'Inspect code, diffs, logs & model checkpoints',
'job.compare': 'Compare',
'job.compare.hint': 'Compare many runs side by side',
'job.replay': 'Replay',
'job.replay.hint': 'Datasets, episodes & rollout analysis',
// J8 Replay (docs/plans/replay-datasets-episodes.md). "Replay" here is the
// job that plays back robot experience — never the transcript surface's
// raw-wire replay; the glossary pins the overlap.
'replay.register': 'Register',
'replay.register.cancel': 'Cancel',
'replay.register.add': 'Add',
'replay.register.path': 'Absolute path to the dataset root',
'replay.register.host': 'Host',
'replay.register.hint': 'The folder containing meta/. Nothing is scanned until you refresh.',
'replay.project': 'Project',
'replay.library': 'Datasets',
'replay.empty': 'No datasets registered in this project yet.',
'replay.pick': 'Pick a dataset to inspect.',
'replay.unread': 'not read',
'replay.unread.title': 'This dataset has not been read yet.',
'replay.unread.hint': 'Refresh to have the host read its metadata and fold a digest.',
'replay.refresh': 'Refresh',
'replay.refreshing': 'Reading…',
'replay.asOf': 'as of',
'replay.stat.episodes': 'Episodes',
'replay.stat.frames': 'Frames',
'replay.stat.duration': 'Duration',
'replay.stat.fps': 'FPS',
'replay.stat.tasks': 'Tasks',
'replay.streams': 'Video streams',
'replay.streams.none': 'No video streams.',
'replay.stream.depth': 'depth',
'replay.features': 'Features',
'replay.lengths': 'Episode lengths',
'replay.tasksList': 'Task instructions',
'replay.cap.tasks': '(first few shown)',
'replay.cap.stats': 'Statistics are partial — the host stopped at its cap.',
'replay.cap.episodes': 'Episode scan stopped at the host cap; counts may be short.',
'replay.cap.page': 'page size clamped by the host',
'replay.col.index': '#',
'replay.col.length': 'Frames',
'replay.col.duration': 'Duration',
'replay.col.task': 'Task',
'replay.col.rows': 'Rows',
'replay.episodesShort': 'episodes',
'replay.loading': 'Loading episodes…',
'replay.noEpisodes': 'No episodes in this window.',
'replay.prev': 'Previous',
'replay.next': 'Next',
'replay.range': '{from}–{to} of {total}',
'job.record': 'Record',
'job.record.hint': 'Capture decisions & findings',
'job.terminal': 'Terminal',
Expand Down Expand Up @@ -2957,6 +3004,50 @@ const zh: Dict = {
'job.debug.hint': '检视代码、差异、日志与模型检查点',
'job.compare': '对比',
'job.compare.hint': '并排对比多个运行',
'job.replay': '回放',
'job.replay.hint': '数据集、片段与轨迹分析',
'replay.register': '注册',
'replay.register.cancel': '取消',
'replay.register.add': '添加',
'replay.register.path': '数据集根目录的绝对路径',
'replay.register.host': '主机',
'replay.register.hint': '包含 meta/ 的目录。在刷新之前不会扫描任何内容。',
'replay.project': '项目',
'replay.library': '数据集',
'replay.empty': '该项目尚未注册任何数据集。',
'replay.pick': '选择一个数据集以查看。',
'replay.unread': '未读取',
'replay.unread.title': '尚未读取该数据集。',
'replay.unread.hint': '点击刷新,让主机读取其元数据并生成摘要。',
'replay.refresh': '刷新',
'replay.refreshing': '读取中…',
'replay.asOf': '截至',
'replay.stat.episodes': '片段',
'replay.stat.frames': '帧',
'replay.stat.duration': '时长',
'replay.stat.fps': '帧率',
'replay.stat.tasks': '任务',
'replay.streams': '视频流',
'replay.streams.none': '没有视频流。',
'replay.stream.depth': '深度',
'replay.features': '特征',
'replay.lengths': '片段长度',
'replay.tasksList': '任务指令',
'replay.cap.tasks': '(仅显示前若干条)',
'replay.cap.stats': '统计不完整 —— 主机已到达上限。',
'replay.cap.episodes': '片段扫描已到达主机上限,计数可能偏少。',
'replay.cap.page': '分页大小已被主机限制',
'replay.col.index': '#',
'replay.col.length': '帧数',
'replay.col.duration': '时长',
'replay.col.task': '任务',
'replay.col.rows': '行范围',
'replay.episodesShort': '个片段',
'replay.loading': '正在加载片段…',
'replay.noEpisodes': '此范围内没有片段。',
'replay.prev': '上一页',
'replay.next': '下一页',
'replay.range': '{from}–{to},共 {total}',
'job.record': '记录',
'job.record.hint': '记录决策与发现',
'job.terminal': '终端',
Expand Down
Loading
Loading