Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

Merge PR #402 tray session shortcuts onto current main.

vastsa883d514f9cb8
diff --cc apps/desktop/electron/main/ipc/register.ts
index ade3e6727,319bc92a7..a7f83bbde
--- a/apps/desktop/electron/main/ipc/register.ts
+++ b/apps/desktop/electron/main/ipc/register.ts
@@@ -28,22 -24,16 +28,24 @@@ import { fetchSkillMarketDocument, sear
import { registerWindowIpc } from "./window-ipc";
import { createComposerTemplateLoader, registerWorkspaceIpc } from "./workspace-ipc";
import { registerComposerIpc } from "./composer-ipc";
+import { registerSpeechIpc } from "./speech-ipc";
import type { IpcRegistrar } from "./types";
+ import type { createTraySessions } from "../tray-sessions";
export type RegisterIpcDependencies = {
ipcMain: IpcMain;
getMainWindow: () => BrowserWindow | null;
getHost: () => HostProcess | null;
+ traySessions: ReturnType<typeof createTraySessions>;
getSidecar: () => AgentSidecar | null;
getAgentHostBridge: () => AgentHostBridge | null;
+ /**
+ * Resolves the remote backend router once it exists. Renderer IPC calls whose
+ * session is owned by a paired remote host are forwarded through it; every
+ * other call — including all internal invokes — runs the local handler
+ * unchanged. Null until the router is wired (and in tests).
+ */
+ getBackendRouter?: () => BackendRouter | null;
getNotificationViewingSessionId: () => string | null;
setNotificationViewingSessionId: (sessionId: string | null) => void;
activeUserSubagentDocuments: (...args: any[]) => Promise<any>;
@@@ -152,21 -140,13 +155,26 @@@ export function registerIpcHandlers(dep
const ipcHandlers = new Map<string, (...args: any[]) => Promise<any>>();
const handle = (channel: string, fn: (...args: any[]) => Promise<any>) => {
- ipcHandlers.set(channel, fn);
+ const handler = async (...args: any[]) => {
+ const result = await fn(...args);
+ traySessions.observeInvoke(channel);
+ return result;
+ };
+ ipcHandlers.set(channel, handler);
- ipcMain.handle(channel, async (_event, ...args) => wrap(() => handler(...args)));
+ // The interception seam for remote-host routing: a renderer call whose
+ // session is owned by a paired remote host is served over RACP-WS; every
+ // other call (and every internal invoke, which never reaches this wrapper)
+ // runs the existing local handler byte-for-byte unchanged.
+ ipcMain.handle(channel, async (_event, ...args) =>
+ wrap(async () => {
+ const router = getBackendRouter?.();
+ if (router) {
+ const outcome = await router.route(channel, args);
+ if (outcome !== ROUTE_LOCAL) return outcome.value;
+ }
- return fn(...args);
++ return handler(...args);
+ }),
+ );
};
const handleWithEvent = (
channel: string,
diff --cc apps/desktop/src/features/app/useAppShellRuntime.tsx
index 104700bb2,4ec48394e..a3bf9ec56
--- a/apps/desktop/src/features/app/useAppShellRuntime.tsx
+++ b/apps/desktop/src/features/app/useAppShellRuntime.tsx
@@@ -20,15 -26,8 +20,16 @@@ import
loadSidebarWidth,
saveSidebarWidth,
} from "../../lib/sidebar-preferences";
-import { StartupSplash } from "../../components/StartupSplash";
+import { sidebarWidthBudget } from "../../lib/sidebar-resize";
+import { commitWorkPanelPresentation } from "../../lib/work-panel-presentation";
+import {
+ MAIN_PANE_MIN_WIDTH,
+ workPanelWidthForSidebarReopen,
+} from "../../lib/work-panel-resize";
+import { browserPluginTab } from "../../lib/work-panel-tabs";
+import { useAppStore } from "../../stores/app-store";
+import { useSidebarTransition } from "./useSidebarTransition";
+ import { useTraySessions } from "./useTraySessions";
const MODIFIER_ONLY_KEYS = new Set([
"Alt",
@@@ -152,9 -123,9 +153,10 @@@ export function useAppShellRuntime()
useAppStore.getState().setWorkPanelWidth(nextPanelWidth);
}
autoCollapsedSidebarRef.current = false;
+ setSidebarWidth(preferredWidth);
setSidebarCollapsed(false);
}, []);
+ useTraySessions({ setSearchOpen, reopenSidebar });
// Stable identity: the keydown and native-menu handlers register once and
// must never capture a stale `sidebarCollapsed`. Every invocation is a user
diff --cc apps/desktop/src/lib/sidebar-preferences.ts
index 40927efb8,8026f2994..a02a8ddc3
--- a/apps/desktop/src/lib/sidebar-preferences.ts
+++ b/apps/desktop/src/lib/sidebar-preferences.ts
@@@ -222,20 -225,13 +223,14 @@@ export function saveSidebarPreferences(
}
export function loadSidebarWidth(): number {
- return SIDEBAR_WIDTH_DEFAULT;
+ const value = read(SIDEBAR_WIDTH_KEY);
+ return typeof value === "number" ? clampSidebarWidth(value) : SIDEBAR_WIDTH_DEFAULT;
}
-export function saveSidebarWidth(): void {
- // The width is fixed; nothing to persist.
+export function saveSidebarWidth(value: number): void {
+ write(SIDEBAR_WIDTH_KEY, clampSidebarWidth(value));
}
- export function sessionIsPinned(id: string, meta: Record<string, SessionMeta>): boolean {
- return meta[id]?.pinned === true;
- }
- export function sessionIsArchived(id: string, meta: Record<string, SessionMeta>): boolean {
- return meta[id]?.archived === true;
- }
export function projectIsPinned(path: string, meta: Record<string, ProjectMeta>): boolean {
const key = normalizeProjectPath(path);
return !!key && meta[key]?.pinned === true;
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index 7dd504110,c9e4a9d87..f47b38993
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -7590,15 -7429,12 +7590,16 @@@ identify the platform validation still
| Acceptance | Scenarios |
|---|---|
+| A / C — Unicode stdio framing | E2E-RPC-unicode-separators |
| C / G / Quality — Plugins navigation | E2E-NAV-plugins-button-goes-back |
+| C / D / Quality — Sidebar row states | E2E-LAYOUT-sidebar-row-states |
+| A / C / Quality — Sidebar material and settings return | E2E-LAYOUT-sidebar-settings |
| B / F / Security — Provider copy | E2E-PROVIDER-copy-config-without-credentials |
+| B / F / Quality — Selected model order | E2E-MODEL-selected-order-persists |
| A — App startup | E2E-001, E2E-002, E2E-003, E2E-004, E2E-067, E2E-076, E2E-079, E2E-092, E2E-097, E2E-143, E2E-150, E2E-168, E2E-204 |
+ | A / C / F / Quality — Tray session navigation | E2E-TRAY-bounded-session-navigation |
| B — Model config | E2E-005, E2E-006, E2E-007, E2E-038, E2E-050, E2E-052, E2E-055, E2E-066, E2E-080, E2E-082, E2E-102c, E2E-102d, E2E-102e, E2E-151, E2E-154, E2E-163, E2E-166, E2E-172, E2E-174, E2E-197, E2E-005G, E2E-005J, E2E-199, E2E-201, E2E-202, E2E-203, E2E-205, E2E-206, E2E-209 |
-| C — Conversation & stream | E2E-008, E2E-008d, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll |
+| C — Conversation & stream | E2E-008, E2E-008d, E2E-008e, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-259, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-SUBAGENT-resume-a-settled-delegation |
| D — Workspace | E2E-012, E2E-013, E2E-022B, E2E-024I, E2E-047, E2E-049, E2E-057, E2E-058, E2E-060, E2E-068, E2E-075, E2E-078, E2E-153, E2E-158, E2E-182, E2E-187, E2E-252 |
| D — Workspace (project ordering) | E2E-253 |
| E — Tools & permissions | E2E-008a, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-024I, E2E-024K, E2E-040, E2E-049, E2E-074, E2E-093, E2E-097, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102d, E2E-102e, E2E-102g, E2E-103, E2E-105, E2E-106, E2E-107, E2E-111, E2E-112, E2E-113, E2E-114, E2E-115, E2E-116, E2E-119, E2E-121, E2E-122, E2E-142, E2E-145, E2E-147, E2E-155, E2E-158, E2E-166, E2E-181, E2E-PLUGIN-imported-pi-package-skills |
diff --cc docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 88860bf61,99c051f67..0bcbdc370
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@@ -5036,15 -4925,12 +5036,16 @@@ IPC 请求无法关闭�
| 验收 | 应用场景 |
|---|---|
+| A / C — Unicode stdio 成帧 | E2E-RPC-unicode-separators |
| C / G / Quality — Plugins navigation | E2E-NAV-plugins-button-goes-back |
+| C / D / Quality — 侧边栏行状态 | E2E-LAYOUT-sidebar-row-states |
+| A / C / Quality — 侧栏材质与设置返回 | E2E-LAYOUT-sidebar-settings |
| B / F / Security — 提供商复制 | E2E-PROVIDER-copy-config-without-credentials |
+| B / F / Quality — 已选模型顺序 | E2E-MODEL-selected-order-persists |
| A — 应用程序启动 | E2E-001、E2E-002、E2E-003、E2E-004、E2E-067、E2E-076、E2E-079、E2E-092、E2E-097、E2E-143、E2E-150、E2E-168、E2E-204、E2E-217 |
| B——模型配置 | E2E-005、E2E-005G、E2E-006、E2E-007、E2E-038、E2E-050、E2E-052、E2E-055、E2E-066、E2E-080、E2E-082、E2E-151、E2E-005J、E2E-199、E2E-201、E2E-202、E2E-203、E2E-209、E2E-166 |
-| C — 对话和直播 | E2E-008、E2E-008d、E2E-008a、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-031、E2E-040、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-052、 E2E-053、E2E-054、E2E-055、E2E-059、E2E-059a、E2E-060c、E2E-060d、E2E-061、E2E-061a、E2E-062、E2E-064、E2E-065、E2E-068、E2E-071、 E2E-073、E2E-074、E2E-075、E2E-081、E2E-083、E2E-084、E2E-086、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-094、E2E-095、E2E-096、 E2E-097、E2E-098、E2E-099、E2E-102、E2E-102a、E2E-102b、E2E-106、E2E-109、E2E-111、E2E-114、E2E-116、E2E-117、E2E-118、E2E-119、 E2E-120、E2E-121、E2E-代理-001、E2E-142、E2E-144、E2E-145、E2E-146、E2E-147、E2E-151、E2E-199、E2E-250、E2E-166 |
+| C — 对话和直播 | E2E-008、E2E-008d、E2E-008a、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-031、E2E-040、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-052、 E2E-053、E2E-054、E2E-055、E2E-059、E2E-059a、E2E-060c、E2E-060d、E2E-061、E2E-061a、E2E-062、E2E-064、E2E-065、E2E-068、E2E-071、 E2E-073、E2E-074、E2E-075、E2E-081、E2E-083、E2E-084、E2E-086、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-094、E2E-095、E2E-096、 E2E-097、E2E-098、E2E-099、E2E-102、E2E-102a、E2E-102b、E2E-106、E2E-109、E2E-111、E2E-114、E2E-116、E2E-117、E2E-118、E2E-119、 E2E-120、E2E-121、E2E-代理-001、E2E-142、E2E-144、E2E-145、E2E-146、E2E-147、E2E-151、E2E-199、E2E-250、E2E-166、E2E-SUBAGENT-resume-a-settled-delegation |
+ | A / C / F / Quality — Tray session navigation | E2E-TRAY-bounded-session-navigation |
| D——工作区 | E2E-012、E2E-013、E2E-022B、E2E-024I、E2E-047、E2E-049、E2E-057、E2E-058、E2E-060、E2E-068、E2E-075、E2E-078、E2E-153 |
| D——工作区(项目排序) | E2E-253 |
| E——工具和权限 | E2E-008a、E2E-014、E2E-015、E2E-016、E2E-017、E2E-018、E2E-019、E2E-024I、E2E-024K、E2E-040、E2E-049、E2E-074、E2E-093、E2E-097、 E2E-099、E2E-100、E2E-101、E2E-102、E2E-103、E2E-105、E2E-106、E2E-107、E2E-111、E2E-112、E2E-113、E2E-114、E2E-115、E2E-116、 E2E-119、E2E-121、E2E-122、E2E-123、E2E-142、E2E-145、E2E-147、E2E-PLUGIN-imported-pi-package-skills、E2E-166 |
diff --cc packages/shared/src/index.ts
index e1b1f7e84,6382da77a..34e41b2de
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@@ -55,5 -52,7 +55,8 @@@ export * from "./trusted-extensions.js"
export * from "./provider-retry.js";
export * from "./message-stream.js";
export * from "./session-collaboration.js";
+ export * from "./session-presentation.js";
+ export * from "./session-outcomes.js";
+ export * from "./tray-sessions.js";
export * from "./window-chrome.js";
+export * from "./prompt-enhancement.js";