Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
feat(settings): inline imports in owning destinations
vastsa50137d741ef7
diff --git a/apps/desktop/electron/main/ipc/agent-import-ipc.ts b/apps/desktop/electron/main/ipc/agent-import-ipc.tsindex c531c6d81..2f3e57ff9 100644--- a/apps/desktop/electron/main/ipc/agent-import-ipc.ts+++ b/apps/desktop/electron/main/ipc/agent-import-ipc.ts@@ -76,6 +76,9 @@ export interface McpImportRunItem {}export interface McpImportRunPayload {+ /** Defaults to global for existing callers. */+ level?: "global" | "project";+ projectPath?: string;items: McpImportRunItem[];}@@ -157,6 +160,8 @@ export async function runMcpImport(hostCall: HostCall,payload: McpImportRunPayload,): Promise<McpImportRunResult> {+ const level = payload.level ?? "global";+ const projectPath = level === "project" ? payload.projectPath : undefined;const result: McpImportRunResult = {imported: [],skipped: [],@@ -165,6 +170,8 @@ export async function runMcpImport(for (const item of payload.items) {const server: Record<string, unknown> = {id: item.id,+ level,+ ...(projectPath ? { projectPath } : {}),transport: item.transport,...(item.label !== undefined ? { label: item.label } : {}),...(item.description !== undefined ? { description: item.description } : {}),@@ -178,7 +185,12 @@ export async function runMcpImport(const res = await hostCall<{ server: unknown }>("mcp.upsert", { server });if (item.disabled === true) {try {- await hostCall("mcp.setEnabled", { id: item.id, enabled: false });+ await hostCall("mcp.setEnabled", {+ id: item.id,+ level,+ ...(projectPath ? { projectPath } : {}),+ enabled: false,+ });} catch (error) {// Turning off failed after the server was written; report it as a// failure so the user is not left with an enabled server they diddiff --git a/apps/desktop/electron/test/agent-import-ipc.test.mjs b/apps/desktop/electron/test/agent-import-ipc.test.mjsindex 31951ddea..6c74fd259 100644--- a/apps/desktop/electron/test/agent-import-ipc.test.mjs+++ b/apps/desktop/electron/test/agent-import-ipc.test.mjs@@ -133,10 +133,52 @@ test("runMcpImport disables a server after upsert when the item asks for it", asassert.equal(host.calls[0].method, "mcp.upsert");const server = host.calls[0].params.server;assert.equal(server.id, "off");+ assert.equal(server.level, "global", "legacy callers default to global scope");assert.equal(server.command, "npx");assert.equal(server.disabled, undefined, "disabled is stripped from the payload");assert.equal(host.calls[1].method, "mcp.setEnabled");- assert.deepEqual(host.calls[1].params, { id: "off", enabled: false });+ assert.deepEqual(host.calls[1].params, {+ id: "off",+ level: "global",+ enabled: false,+ });+});++test("runMcpImport applies project scope to both upsert and disabled state", async () => {+ const host = stubHost({+ "mcp.upsert": [{ server: { id: "project-server" } }],+ "mcp.setEnabled": [{ ok: true }],+ });+ const result = await runMcpImport(host.call, {+ level: "project",+ projectPath: "/project",+ items: [+ {+ source: "claude-code",+ sourcePath: "/project/.mcp.json",+ id: "project-server",+ rawKey: "project-server",+ transport: "stdio",+ command: "node",+ disabled: true,+ },+ ],+ });++ assert.equal(result.imported.length, 1);+ assert.deepEqual(host.calls[0].params.server, {+ id: "project-server",+ level: "project",+ projectPath: "/project",+ transport: "stdio",+ command: "node",+ });+ assert.deepEqual(host.calls[1].params, {+ id: "project-server",+ level: "project",+ projectPath: "/project",+ enabled: false,+ });});test("runMcpImport reports an `already exists` upsert as skipped, not failed", async () => {diff --git a/apps/desktop/src/components/settings/AgentMcpPage.tsx b/apps/desktop/src/components/settings/AgentMcpPage.tsxindex 719dd9ac9..98f57b45e 100644--- a/apps/desktop/src/components/settings/AgentMcpPage.tsx+++ b/apps/desktop/src/components/settings/AgentMcpPage.tsx@@ -35,6 +35,8 @@ import {type McpDraft,} from "../extensions/McpEditorSheet";import { McpMarketPanel } from "./McpMarketPanel";+import { AgentMcpImportPanel } from "../../features/settings/imports/AgentMcpImportPanel";+import { ImportToggleButton } from "../../features/settings/import-workbench";import {IconArrowUpDown,IconKey,@@ -109,6 +111,7 @@ export function AgentMcpPage() {const setStatuses = (update: (current: McpServerStatus[]) => McpServerStatus[]) =>setServers((current) => ({ ...current, statuses: update(current.statuses) }));const [filter, setFilter] = useState<CapabilityFilter>("all");+ const [importOpen, setImportOpen] = useState(false);const [search, setSearch] = useState("");const [busyId, setBusyId] = useState<string | null>(null);const [menuFor, setMenuFor] = useState<string | null>(null);@@ -648,6 +651,13 @@ export function AgentMcpPage() {}actions={<>+ <ImportToggleButton+ open={importOpen}+ controls="agent-mcp-import-panel"+ label={t("settings.importMcpFromTools")}+ disabled={targetLevel === "project" && !selectedProjectPath}+ onClick={() => setImportOpen((current) => !current)}+ />{addButton}{marketButton}</>@@ -655,6 +665,26 @@ export function AgentMcpPage() {/>}>+ <section+ id="agent-mcp-import-panel"+ className="settings-card-block import-inline-section"+ hidden={!importOpen}+ >+ <div className="settings-card-heading-line">+ <h3 className="settings-card-heading">+ {t("settings.importAgentMcpTitle")}+ </h3>+ </div>+ <div className="import-inline-workbench">+ <AgentMcpImportPanel+ key={`${targetLevel}:${targetLevel === "project" ? selectedProjectPath ?? "" : ""}`}+ level={targetLevel}+ projectPath={targetLevel === "project" ? selectedProjectPath ?? undefined : undefined}+ onImported={load}+ />+ </div>+ </section>+<CapabilityPanelloading={loading}refreshing={refreshing}diff --git a/apps/desktop/src/components/settings/AgentSkillsPage.tsx b/apps/desktop/src/components/settings/AgentSkillsPage.tsxindex 9a713003f..cea2bc2e3 100644--- a/apps/desktop/src/components/settings/AgentSkillsPage.tsx+++ b/apps/desktop/src/components/settings/AgentSkillsPage.tsx@@ -43,6 +43,8 @@ import {IconTrash,} from "../icons";import { SkillMarketPanel } from "./SkillMarketPanel";+import { AgentSkillImportPanel } from "../../features/settings/imports/AgentSkillImportPanel";+import { ImportToggleButton } from "../../features/settings/import-workbench";import { TooltipButton } from "../ui";const GLOBAL_SKILLS_PATH = "~/.agents/skills";@@ -90,6 +92,7 @@ export function AgentSkillsPage() {showToast(error instanceof Error ? error.message : String(error), { variant: "error" }),);const [filter, setFilter] = useState<CapabilityFilter>("all");+ const [importOpen, setImportOpen] = useState(false);const [search, setSearch] = useState("");const [busyId, setBusyId] = useState<string | null>(null);const [menuFor, setMenuFor] = useState<string | null>(null);@@ -541,6 +544,13 @@ export function AgentSkillsPage() {}actions={<>+ <ImportToggleButton+ open={importOpen}+ controls="agent-skills-import-panel"+ label={t("settings.importSkillFromTools")}+ disabled={targetLevel === "project" && !selectedProjectPath}+ onClick={() => setImportOpen((current) => !current)}+ /><CapabilityButton variant="primary" title={newSkillTitle} onClick={openCreate}><IconPlus size={14} />{t("settings.newSkill")}@@ -551,6 +561,26 @@ export function AgentSkillsPage() {/>}>+ <section+ id="agent-skills-import-panel"+ className="settings-card-block import-inline-section"+ hidden={!importOpen}+ >+ <div className="settings-card-heading-line">+ <h3 className="settings-card-heading">+ {t("settings.importAgentSkillsTitle")}+ </h3>+ </div>+ <div className="import-inline-workbench">+ <AgentSkillImportPanel+ key={`${targetLevel}:${targetLevel === "project" ? selectedProjectPath ?? "" : ""}`}+ level={targetLevel}+ projectPath={targetLevel === "project" ? selectedProjectPath ?? undefined : undefined}+ onImported={load}+ />+ </div>+ </section>+<CapabilityPanelloading={loading}refreshing={refreshing}diff --git a/apps/desktop/src/components/settings/ModelConfigPage.tsx b/apps/desktop/src/components/settings/ModelConfigPage.tsxindex e1ccc7191..0363beb3f 100644--- a/apps/desktop/src/components/settings/ModelConfigPage.tsx+++ b/apps/desktop/src/components/settings/ModelConfigPage.tsx@@ -41,6 +41,8 @@ import { ServiceList } from "./ServiceList";import { serviceRowKind } from "./service-row-status";import { useVendorAccounts } from "./useVendorAccounts";import { VendorAccountDialog, type VendorAccountForm } from "./VendorAccountDialog";+import { ModelConfigImportPanel } from "../../features/settings/imports/ModelConfigImportPanel";+import { ImportToggleButton } from "../../features/settings/import-workbench";type CatalogStatus = {loaded: boolean;@@ -114,6 +116,7 @@ export function ModelConfigPage() {const [changingImageModel, setChangingImageModel] = useState(false);const [refreshingCatalog, setRefreshingCatalog] = useState(false);const [catalogStatus, setCatalogStatus] = useState<CatalogStatus | null>(null);+ const [importOpen, setImportOpen] = useState(false);const {vendors,accountFor,@@ -567,6 +570,12 @@ export function ModelConfigPage() {) : null}</div><div className="provider-section-head-actions">+ <ImportToggleButton+ open={importOpen}+ controls="model-config-import-panel"+ label={t("settings.importTitle")}+ onClick={() => setImportOpen((current) => !current)}+ /><Buttonvariant="primary"className="model-provider-add"@@ -580,6 +589,14 @@ export function ModelConfigPage() {</div></div>+ <div+ id="model-config-import-panel"+ className="import-inline-workbench"+ hidden={!importOpen}+ >+ <ModelConfigImportPanel />+ </div>+<div className="settings-panel model-provider-panel">{providers.length === 0 ? (<div className="model-provider-empty">diff --git a/apps/desktop/src/components/ui.tsx b/apps/desktop/src/components/ui.tsxindex d8c54c06b..b6c36931a 100644--- a/apps/desktop/src/components/ui.tsx+++ b/apps/desktop/src/components/ui.tsx@@ -741,13 +741,21 @@ export function SegmentedControl<T extends string>({export function Checkbox({label,className,+ indeterminate = false,...props-}: Omit<InputHTMLAttributes<HTMLInputElement>, "type"> & {+}: Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "ref"> & {label: ReactNode;+ indeterminate?: boolean;}) {return (<label className={cx("ui-checkbox", className)}>- <input type="checkbox" {...props} />+ <input+ type="checkbox"+ ref={(node) => {+ if (node) node.indeterminate = indeterminate;+ }}+ {...props}+ /><span>{label}</span></label>);diff --git a/apps/desktop/src/features/settings/SettingsPage.tsx b/apps/desktop/src/features/settings/SettingsPage.tsxindex 259980777..07b1bb1cf 100644--- a/apps/desktop/src/features/settings/SettingsPage.tsx+++ b/apps/desktop/src/features/settings/SettingsPage.tsx@@ -20,7 +20,6 @@ import {IconBookOpen,IconBot,IconChevronLeft,- IconDownload,IconFileText,IconGlobe,IconInfo,@@ -58,7 +57,6 @@ import {SettingsRow,} from "./primitives";import { AgentInstructionsSection, UpdatesRow } from "./agent-sections";-import { ImportSection } from "./import-page";import { PromptEnhancementCard } from "./prompt-enhancement-card";import { CloseBehaviorSection, DeveloperSection } from "./developer-sections";import { PluginScenicThemesDestination } from "../../components/settings/PluginScenicThemesDestination";@@ -241,7 +239,6 @@ export function SettingsPage() {skills: <IconBookOpen size={14} />,mcp: <IconServer size={14} />,subagents: <IconBot size={14} />,- import: <IconDownload size={14} />,projects: <IconArchive size={14} />,sync: <IconCloudDown size={14} />,remoteHosts: <IconGlobe size={14} />,@@ -572,7 +569,6 @@ export function SettingsPage() {{tab === "instructions" && <AgentInstructionsSection />}- {tab === "import" && <ImportSection />}{tab === "projects" && <ProjectsPage />}diff --git a/apps/desktop/src/features/settings/import-page.tsx b/apps/desktop/src/features/settings/import-page.tsxindex 7fce10716..cea60bdb6 100644--- a/apps/desktop/src/features/settings/import-page.tsx+++ b/apps/desktop/src/features/settings/import-page.tsx@@ -1,1142 +1,4 @@-/**- * Settings ▸ Import.- *- * One workbench for everything this machine can hand over: sessions, provider- * and model configuration, skills, and MCP servers. A tab per kind means a- * scan result survives a switch; the active kind owns one toolbar (select-all- * with both counts, its own options, rescan, import selected) and one list- * panel whose group headers are quiet label lines and whose rows are- * individual tiles — the same rhythm as the agent capability destinations.- *- * Every kind keeps its own explicit scan: switching tabs never starts one.- */-import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";-import { useTranslation } from "react-i18next";-import type {- ExternalMcpCandidate,- ExternalMcpImportItem,- ExternalMcpScanResult,- ExternalMcpSourceKind,- ExternalSkillCandidate,- ExternalSkillImportItem,- ExternalSkillScanResult,- ExternalSkillSourceKind,- ImportCandidate,- ModelConfigImportCandidate,-} from "../../lib/api";-import { api } from "../../lib/api";-import { useAppStore } from "../../stores/app-store";-import {- DEFAULT_IMPORT_GROUP_BY,- formatImportDate,- groupImportCandidates,- type ImportGroupBy,-} from "../../lib/import-groups";-import { Badge, Button, HelpIcon, SegmentedControl, cx } from "../../components/ui";-import { IconChevronLeft, IconDownload } from "../../components/icons";-import { SettingsMenuSelect } from "../../components/settings/SettingsMenuSelect";--type ImportKind = "sessions" | "models" | "skills" | "mcp";--/**- * Tab labels reuse the sessions / models / skills / MCP labels the sidebar and- * the settings rail already ship, so the switcher adds no catalog entries and- * cannot drift from the destination it mirrors.- */-const IMPORT_KINDS: readonly { id: ImportKind; labelKey: string }[] = [- { id: "sessions", labelKey: "nav.sessions" },- { id: "models", labelKey: "settings.nav.models" },- { id: "skills", labelKey: "settings.nav.skills" },- { id: "mcp", labelKey: "settings.nav.mcp" },-];--export function ImportSection() {- const { t } = useTranslation();- const [kind, setKind] = useState<ImportKind>("sessions");-- return (- <div className="import-page">- <SegmentedControl- value={kind}- onChange={(value) => setKind(value)}- options={IMPORT_KINDS.map((entry) => ({- value: entry.id,- label: t(entry.labelKey),- id: `import-tab-${entry.id}`,- controls: `import-panel-${entry.id}`,- }))}- label={t("settings.import")}- role="tablist"- className="import-segment"- itemClassName="import-segment-btn"- />-- {IMPORT_KINDS.map((entry) => (- <div- key={entry.id}- className="import-view"- id={`import-panel-${entry.id}`}- role="tabpanel"- aria-labelledby={`import-tab-${entry.id}`}- hidden={kind !== entry.id}- >- <ImportKindPanel kind={entry.id} />- </div>- ))}- </div>- );-}--/**- * The four workbenches stay mounted: `hidden` only takes one out of view, so a- * scan result and its selection survive a tab switch.- */-function ImportKindPanel({ kind }: { kind: ImportKind }) {- if (kind === "sessions") return <SessionImportPanel />;- if (kind === "models") return <ModelConfigImportPanel />;- if (kind === "skills") return <SkillsScanImportPanel />;- return <McpScanImportPanel />;-}--/* ---------------------------------------------------------------------------- * Shared page anatomy- * ------------------------------------------------------------------------- */--/**- * The only action row on a kind: both counts behind the select-all control,- * kind options and the two actions on the right. `found` is the kind's own- * localized sentence, so the row never needs a per-kind copy of itself.- */-function ImportToolbar({- found,- selectedCount,- allSelected,- selectAllLabel,- onToggleAll,- scanning,- importing,- onScan,- onImport,- options,- hint,-}: {- found: string;- selectedCount: number;- allSelected: boolean;- selectAllLabel: string;- onToggleAll: (on: boolean) => void;- scanning: boolean;- importing: boolean;- onScan: () => void;- onImport: () => void;- /** Kind-specific control in front of the actions, e.g. grouping or mode. */- options?: ReactNode;- /** The current result set's caveat (a source cap), on demand. */- hint?: string;-}) {- const { t } = useTranslation();- const selectAllRef = useRef<HTMLInputElement>(null);-- useEffect(() => {- const node = selectAllRef.current;- if (node) node.indeterminate = selectedCount > 0 && !allSelected;- }, [selectedCount, allSelected]);-- return (- <div className="import-toolbar">- <label className="import-select-all">- <input- ref={selectAllRef}- type="checkbox"- checked={allSelected}- aria-label={selectAllLabel}- onChange={(event) => onToggleAll(event.target.checked)}- />- <span className="import-count">- <span className="import-count-found">{found}</span>- {selectedCount > 0 ? (- <span className="import-count-selected">- {t("settings.importSelectedCount", { count: selectedCount })}- </span>- ) : null}- </span>- </label>- <div className="import-toolbar-actions">- {options}- {hint ? <HelpIcon label={hint} /> : null}- <Button- variant="secondary"- disabled={scanning}- aria-busy={scanning || undefined}- onClick={onScan}- >- {scanning ? t("settings.importScanning") : t("settings.importScan")}- </Button>- <Button- variant="primary"- disabled={importing || selectedCount === 0}- aria-busy={importing || undefined}- onClick={onImport}- >- {importing- ? t("settings.importing")- : t("settings.importSelected", { count: selectedCount })}- </Button>- </div>- </div>- );-}--/** A labelled menu select inside the toolbar, for grouping or import mode. */-function ImportOption({- label,- value,- options,- hint,- onChange,-}: {- label: string;- value: string;- options: { id: string; label: string }[];- /** Explains the choice, reached from the label's help icon. */- hint?: string;- onChange: (id: string) => void;-}) {- return (- <label className="import-option">- <span className="import-option-label">- {label}- {hint ? <HelpIcon label={hint} /> : null}- </span>- <SettingsMenuSelect- className="import-option-select"- label={label}- value={value}- options={options}- onChange={onChange}- />- </label>- );-}--/** One group: a quiet label line that also discloses its rows. */-function ImportGroup({- bodyId,- name,- path,- count,- countLabel,- expanded,- onToggle,- selection,- children,-}: {- bodyId: string;- name: string;- /** Exact project path, or the resolved config path, when the group has one. */- path?: string | null;- count: number;- countLabel: string;- expanded: boolean;- onToggle: () => void;- /** Kinds whose groups are selectable render the leading checkbox. */- selection?: {- label: string;- checked: boolean;- indeterminate: boolean;- onChange: (on: boolean) => void;- };- children: ReactNode;-}) {- return (- <section className="import-group">- <div className="import-group-header">- {selection ? (- <input- type="checkbox"- checked={selection.checked}- aria-label={selection.label}- ref={(node) => {- if (node) node.indeterminate = selection.indeterminate;- }}- onChange={(event) => selection.onChange(event.target.checked)}- />- ) : null}- <button- type="button"- className="import-group-toggle"- aria-controls={bodyId}- aria-expanded={expanded}- onClick={onToggle}- >- <span- className={cx("import-group-chevron", !expanded && "collapsed")}- aria-hidden- >- <IconChevronLeft size={13} />- </span>- <span className="import-group-name">{name}</span>- {path ? (- <code className="import-group-path" title={path}>- {path}- </code>- ) : null}- <span className="import-group-count" title={countLabel}>- {count}- </span>- </button>- </div>- {expanded ? (- <div id={bodyId} className="import-group-body">- {children}- </div>- ) : null}- </section>- );-}--/**- * One candidate. The checkbox, the identity, and the row's own badge are the- * whole anatomy, so every kind reads the same way.- */-function ImportRow({- title,- meta,- checked,- onChange,- badge,-}: {- title: string;- meta: ReactNode;- checked: boolean;- onChange: (on: boolean) => void;- badge?: ReactNode;-}) {- return (- <label className="import-row">- <input- type="checkbox"- checked={checked}- onChange={(event) => onChange(event.target.checked)}- />- <span className="import-row-main">- <span className="import-row-title">{title}</span>- <span className="import-row-meta">{meta}</span>- </span>- {badge}- </label>- );-}--/**- * Pre-scan state: what the scan will look at, and the action that starts it.- * Empty states carry no filler, so a kind without a description shows only the- * glyph and the action.- */-function ImportIdle({- description,- note,- onScan,- scanning,-}: {- description?: string;- note?: string;- onScan: () => void;- scanning: boolean;-}) {- const { t } = useTranslation();- const help = [description, note].filter(Boolean).join(" · ");- return (- <div className="settings-panel import-panel">- <div className="import-idle">- <span className="import-idle-glyph" aria-hidden>- <IconDownload size={20} />- </span>- <div className="import-idle-actions">- <Button variant="secondary" disabled={scanning} onClick={onScan}>- {scanning ? t("settings.importScanning") : t("settings.importScan")}- </Button>- {help ? <HelpIcon label={help} /> : null}- </div>- </div>- </div>- );-}--/** The result surface: rows when a scan found something, a line when it did not. */-function ImportResults({ message, children }: { message?: string; children?: ReactNode }) {- return (- <div className="settings-panel import-panel">- {message ? <p className="import-empty">{message}</p> : children}- </div>- );-}--/**- * Clears a selection when the underlying candidate set is replaced.- * `keyOf` stays with the caller so every kind keeps its own identity rule.- */-function toggleKey(previous: Set<string>, key: string, on: boolean): Set<string> {- const next = new Set(previous);- if (on) next.add(key);- else next.delete(key);- return next;-}---/**- * Group disclosure. Groups start expanded — the found candidates are the- * answer to a scan — and every kind's label line discloses its own rows, so all- * four read the same way.- */-function useGroupDisclosure() {- const [collapsed, setCollapsed] = useState<Set<string>>(new Set());- return {- isExpanded: (id: string) => !collapsed.has(id),- toggle: (id: string) =>- setCollapsed((previous) =>- previous.has(id)- ? new Set([...previous].filter((entry) => entry !== id))- : new Set([...previous, id]),- ),- reset: () => setCollapsed(new Set()),- };-}-/* ---------------------------------------------------------------------------- * Sessions- * ------------------------------------------------------------------------- */--export function SessionImportPanel() {- const { t, i18n } = useTranslation();- const refreshSessions = useAppStore((s) => s.refreshSessions);- const showToast = useAppStore((s) => s.showToast);- const [candidates, setCandidates] = useState<ImportCandidate[] | null>(null);- const [selected, setSelected] = useState<Set<string>>(new Set());- const [groupBy, setGroupBy] = useState<ImportGroupBy>(DEFAULT_IMPORT_GROUP_BY);- const disclosure = useGroupDisclosure();- const [scanning, setScanning] = useState(false);- const [importing, setImporting] = useState(false);- const [codexCap, setCodexCap] = useState<number | null>(null);--- const keyOf = (candidate: ImportCandidate) =>- `${candidate.source}:${candidate.externalId}`;-- const scan = async () => {- setScanning(true);- try {- const res = await api.scanImportSessions();- setCandidates(res.sessions);- setCodexCap(typeof res.truncated?.codex === "number" ? res.truncated.codex : null);- setSelected(new Set());- disclosure.reset();-- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setScanning(false);- }- };-- const runImport = async () => {- if (!candidates) return;- const items = candidates.filter((candidate) => selected.has(keyOf(candidate)));- if (items.length === 0) return;- setImporting(true);- try {- const res = await api.runImportSessions(items);- await refreshSessions({ revealImportedProjects: true });- showToast(- t("settings.importResult", {- imported: res.imported,- skipped: res.skipped,- failed: res.failed,- }),- { variant: res.failed > 0 ? "error" : "success" },- );- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setImporting(false);- }- };-- const importLabels = useMemo(- () => ({- noProject: t("settings.importNoProject"),- sources: {- "claude-code": t("settings.importSourceClaudeCode"),- opencode: t("settings.importSourceOpenCode"),- codex: t("settings.importSourceCodex"),- pi: t("settings.importSourcePi"),- } as Record<ImportCandidate["source"], string>,- }),- [t],- );-- const groups = useMemo(- () => groupImportCandidates(candidates ?? [], groupBy, importLabels),- [candidates, groupBy, importLabels],- );-- const allKeys = useMemo(() => (candidates ?? []).map(keyOf), [candidates]);- const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));-- const toggleKeys = (keys: string[], on: boolean) => {- setSelected((previous) => {- const next = new Set(previous);- for (const key of keys) {- if (on) next.add(key);- else next.delete(key);- }- return next;- });- };-- return (- <div className="import-workbench">- {candidates === null ? (- <ImportIdle- note={importLabels.sources && [- importLabels.sources["claude-code"],- importLabels.sources.opencode,- importLabels.sources.codex,- importLabels.sources.pi,- ].join(" · ")}- onScan={() => void scan()}- scanning={scanning}- />- ) : (- <>- <ImportToolbar- found={t("settings.importFound", { count: candidates.length })}- selectedCount={selected.size}- allSelected={allSelected}- selectAllLabel={t("settings.importSelectAll")}- onToggleAll={(on) => toggleKeys(allKeys, on)}- scanning={scanning}- importing={importing}- onScan={() => void scan()}- onImport={() => void runImport()}- hint={- codexCap != null- ? t("settings.importCodexCapped", { limit: codexCap })- : undefined- }- options={- <ImportOption- label={t("settings.importGroupBy")}- value={groupBy}- onChange={(id) => {- setGroupBy(id as ImportGroupBy);- disclosure.reset();- }}- options={[- { id: "source", label: t("settings.importGroupBySource") },- { id: "path", label: t("settings.importGroupByPath") },- ]}- />- }- />- <ImportResults- message={- candidates.length === 0 ? t("settings.importNone") : undefined- }- >- <div className="import-groups">-- {groups.map((group, groupIndex) => {- const groupKeys = group.items.map(keyOf);- const groupSelected = groupKeys.filter((k) => selected.has(k)).length;- const bodyId = `import-session-group-${groupIndex}`;- return (- <ImportGroup- key={group.id}- bodyId={bodyId}- name={group.name}- path={group.projectPath}- count={group.items.length}- countLabel={t("settings.importSessionCount", {- count: group.items.length,- })}- expanded={disclosure.isExpanded(group.id)}- onToggle={() => disclosure.toggle(group.id)}- selection={{- label: t("settings.importSelectGroup", { name: group.name }),- checked: groupSelected === groupKeys.length,- indeterminate:- groupSelected > 0 && groupSelected < groupKeys.length,- onChange: (on) => toggleKeys(groupKeys, on),- }}- >- {group.items.map((candidate) => {- const key = keyOf(candidate);- return (- <ImportRow- key={key}- title={candidate.title}- meta={`${- candidate.messageCount === null- ? t("settings.importMessagesUnknown")- : t("settings.importMessages", {- count: candidate.messageCount,- })- } · ${formatImportDate(- candidate.updatedAt,- i18n.resolvedLanguage || i18n.language,- )}`}- checked={selected.has(key)}- onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}- badge={- <Badge tone="neutral">- {importLabels.sources[candidate.source]}- </Badge>- }- />- );- })}- </ImportGroup>- );- })}- </div>- </ImportResults>- </>- )}- </div>- );-}--/* ---------------------------------------------------------------------------- * Provider and model configuration- * ------------------------------------------------------------------------- */--function hostOf(baseUrl: string | null): string {- if (!baseUrl) return "";- try {- return new URL(baseUrl).host || baseUrl;- } catch {- return baseUrl.replace(/^https?:\/\//, "").split("/")[0] || baseUrl;- }-}--export function ModelConfigImportPanel() {- const { t } = useTranslation();- const refreshProviders = useAppStore((s) => s.refreshProviders);- const showToast = useAppStore((s) => s.showToast);- const [candidates, setCandidates] = useState<ModelConfigImportCandidate[] | null>(- null,- );- const [selected, setSelected] = useState<Set<string>>(new Set());- const disclosure = useGroupDisclosure();- const [scanning, setScanning] = useState(false);- const [importing, setImporting] = useState(false);-- const keyOf = (candidate: ModelConfigImportCandidate) =>- `${candidate.source}:${candidate.externalId}`;-- const scan = async () => {- setScanning(true);- try {- const res = await api.scanImportModelConfigs();- setCandidates(res.providers);- setSelected(new Set());- disclosure.reset();- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setScanning(false);- }- };-- const runImport = async () => {- if (!candidates) return;- const items = candidates.filter((candidate) => selected.has(keyOf(candidate)));- if (items.length === 0) return;- setImporting(true);- try {- const res = await api.runImportModelConfigs(items);- await refreshProviders();- showToast(- t("settings.importResult", {- imported: res.imported,- skipped: res.skipped,- failed: res.failed,- }),- { variant: res.failed > 0 ? "error" : "success" },- );- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setImporting(false);- }- };-- const sourceLabels: Record<ModelConfigImportCandidate["source"], string> = useMemo(- () => ({- "claude-code": t("settings.importSourceClaudeCode"),- opencode: t("settings.importSourceOpenCode"),- codex: t("settings.importSourceCodex"),- pi: t("settings.importSourcePi"),- "cc-switch": t("settings.importSourceCcSwitch"),- }),- [t],- );-- const groups = useMemo(() => {- if (!candidates) return [];- const grouped = new Map<- ModelConfigImportCandidate["source"],- ModelConfigImportCandidate[]- >();- for (const candidate of candidates) {- const items = grouped.get(candidate.source) ?? [];- items.push(candidate);- grouped.set(candidate.source, items);- }- return [...grouped.entries()].map(([source, items]) => ({- id: source,- name: sourceLabels[source],- items,- }));- }, [candidates, sourceLabels]);-- const allKeys = useMemo(() => (candidates ?? []).map(keyOf), [candidates]);- const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));-- const toggleKeys = (keys: string[], on: boolean) => {- setSelected((previous) => {- const next = new Set(previous);- for (const key of keys) {- if (on) next.add(key);- else next.delete(key);- }- return next;- });- };-- return (- <div className="import-workbench">- {candidates === null ? (- <ImportIdle- description={t("settings.importModelsScanDesc")}- onScan={() => void scan()}- scanning={scanning}- />- ) : (- <>- <ImportToolbar- found={t("settings.importModelsFound", { count: candidates.length })}- selectedCount={selected.size}- allSelected={allSelected}- selectAllLabel={t("settings.importModelsSelectAll")}- onToggleAll={(on) => toggleKeys(allKeys, on)}- scanning={scanning}- importing={importing}- onScan={() => void scan()}- onImport={() => void runImport()}- />- <ImportResults- message={- candidates.length === 0 ? t("settings.importModelsNone") : undefined- }- >- <div className="import-groups">- {groups.map((group, groupIndex) => {- const groupKeys = group.items.map(keyOf);- const groupSelected = groupKeys.filter((k) => selected.has(k)).length;- const bodyId = `import-model-group-${groupIndex}`;- return (- <ImportGroup- key={group.id}- bodyId={bodyId}- name={group.name}- count={group.items.length}- countLabel={t("settings.importModelsFound", {- count: group.items.length,- })}- expanded={disclosure.isExpanded(group.id)}- onToggle={() => disclosure.toggle(group.id)}- selection={{- label: t("settings.importModelsSelectGroup", { name: group.name }),- checked: groupSelected === groupKeys.length,- indeterminate:- groupSelected > 0 && groupSelected < groupKeys.length,- onChange: (on) => toggleKeys(groupKeys, on),- }}- >- {group.items.map((candidate) => {- const key = keyOf(candidate);- const host = hostOf(candidate.baseUrl);- return (- <ImportRow- key={key}- title={candidate.name}- meta={`${t("settings.importModelsCount", {- count: candidate.modelIds.length,- })}${host ? ` · ${host}` : ""}`}- checked={selected.has(key)}- onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}- badge={- <Badge tone={candidate.hasSecret ? "success" : "warning"}>- {candidate.hasSecret- ? t("settings.importModelsHasKey")- : t("settings.importModelsNoKey")}- </Badge>- }- />- );- })}- </ImportGroup>- );- })}- </div>- </ImportResults>- </>- )}- </div>- );-}--/* ---------------------------------------------------------------------------- * Skills and MCP servers scanned from the other agent tools on this machine- * ------------------------------------------------------------------------- */--const SKILL_SOURCE_KEY: Record<ExternalSkillSourceKind, string> = {- "claude-user": "settings.importAgentScanSourceClaudeUser",- "claude-project": "settings.importAgentScanSourceClaudeProject",- "pi-user": "settings.importAgentScanSourcePiUser",- "pi-project": "settings.importAgentScanSourcePiProject",-};--const MCP_SOURCE_KEY: Record<ExternalMcpSourceKind, string> = {- "claude-desktop": "settings.importAgentScanSourceClaudeDesktop",- "claude-code": "settings.importAgentScanSourceClaudeCode",- "cursor-global": "settings.importAgentScanSourceCursorGlobal",- "cursor-project": "settings.importAgentScanSourceCursorProject",- codex: "settings.importAgentScanSourceCodex",- opencode: "settings.importAgentScanSourceOpenCode",- "chatgpt-desktop": "settings.importAgentScanSourceChatgpt",-};--function groupBySource<C extends { source: string }>(- candidates: C[],-): Array<{ id: string; items: C[] }> {- const map = new Map<string, C[]>();- for (const candidate of candidates) {- const bucket = map.get(candidate.source);- if (bucket) bucket.push(candidate);- else map.set(candidate.source, [candidate]);- }- return Array.from(map.entries()).map(([id, items]) => ({ id, items }));-}--export function SkillsScanImportPanel() {- const { t } = useTranslation();- const showToast = useAppStore((s) => s.showToast);- const [result, setResult] = useState<ExternalSkillScanResult | null>(null);- const [selected, setSelected] = useState<Set<string>>(new Set());- const disclosure = useGroupDisclosure();- const [mode, setMode] = useState<"copy" | "link">("copy");- const [scanning, setScanning] = useState(false);- const [importing, setImporting] = useState(false);-- const keyOf = (candidate: ExternalSkillCandidate) =>- `${candidate.source}:${candidate.sourcePath}`;-- const scan = async () => {- setScanning(true);- try {- const res = await api.scanExternalSkills();- setResult(res);- setSelected(new Set());- disclosure.reset();- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setScanning(false);- }- };-- const runImport = async () => {- if (!result) return;- const items: ExternalSkillImportItem[] = result.candidates- .filter((candidate) => selected.has(keyOf(candidate)))- .map((candidate) => ({- source: candidate.source,- sourcePath: candidate.sourcePath,- shape: candidate.shape,- rootDir: candidate.rootDir,- id: candidate.id,- name: candidate.name,- description: candidate.description,- }));- if (items.length === 0) return;- setImporting(true);- try {- const res = await api.runExternalSkillsImport({- level: "global",- mode,- items,- });- showToast(- t("settings.importAgentScanResult", {- imported: res.imported.length,- skipped: res.skipped.length,- failed: res.failed.length,- }),- { variant: res.failed.length > 0 ? "error" : "success" },- );- // Refresh the scan so already-imported rows disappear next round.- await scan();- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setImporting(false);- }- };-- const groups = useMemo(() => groupBySource(result?.candidates ?? []), [result]);- const allKeys = useMemo(- () => (result?.candidates ?? []).map(keyOf),- [result],- );- const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));-- return (- <div className="import-workbench">- {result === null ? (- <ImportIdle- description={t("settings.importAgentSkillsDesc")}- onScan={() => void scan()}- scanning={scanning}- />- ) : (- <>- <ImportToolbar- found={t("settings.importAgentScanFoundSkills", {- count: result.candidates.length,- })}- selectedCount={selected.size}- allSelected={allSelected}- selectAllLabel={t("settings.importSelectAll")}- onToggleAll={(on) => setSelected(on ? new Set(allKeys) : new Set())}- scanning={scanning}- importing={importing}- onScan={() => void scan()}- onImport={() => void runImport()}- options={- <ImportOption- label={t("settings.importAgentScanMode")}- value={mode}- onChange={(id) => setMode(id as "copy" | "link")}- hint={t("settings.importAgentScanModeHint")}- options={[- { id: "copy", label: t("settings.importAgentScanModeCopy") },- { id: "link", label: t("settings.importAgentScanModeLink") },- ]}- />- }- />- <ImportResults- message={- result.candidates.length === 0- ? t("settings.importAgentScanNone")- : undefined- }- >- <div className="import-groups">- {groups.map((group, groupIndex) => (- <ImportGroup- key={group.id}- bodyId={`import-skill-group-${groupIndex}`}- name={t(- SKILL_SOURCE_KEY[group.id as ExternalSkillSourceKind] ??- "settings.importSourcePi",- )}- count={group.items.length}- countLabel={t("settings.importAgentScanFoundSkills", {- count: group.items.length,- })}- expanded={disclosure.isExpanded(group.id)}- onToggle={() => disclosure.toggle(group.id)}- >- {group.items.map((candidate) => {- const key = keyOf(candidate);- return (- <ImportRow- key={key}- title={candidate.name || candidate.id}- meta={candidate.description || candidate.sourcePath}- checked={selected.has(key)}- onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}- badge={- <Badge tone="neutral">- {candidate.shape === "dir"- ? t("settings.importAgentScanShapeDir")- : t("settings.importAgentScanShapeFile")}- </Badge>- }- />- );- })}- </ImportGroup>- ))}- </div>- </ImportResults>- </>- )}- </div>- );-}--export function McpScanImportPanel() {- const { t } = useTranslation();- const showToast = useAppStore((s) => s.showToast);- const [result, setResult] = useState<ExternalMcpScanResult | null>(null);- const [selected, setSelected] = useState<Set<string>>(new Set());- const disclosure = useGroupDisclosure();- const [scanning, setScanning] = useState(false);- const [importing, setImporting] = useState(false);-- const keyOf = (candidate: ExternalMcpCandidate) =>- `${candidate.source}:${candidate.id}`;-- const scan = async () => {- setScanning(true);- try {- const res = await api.scanExternalMcp();- setResult(res);- setSelected(new Set());- disclosure.reset();- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setScanning(false);- }- };-- const runImport = async () => {- if (!result) return;- const items: ExternalMcpImportItem[] = result.candidates- .filter((candidate) => selected.has(keyOf(candidate)))- .map((candidate) => ({- source: candidate.source,- sourcePath: candidate.sourcePath,- id: candidate.id,- rawKey: candidate.rawKey,- label: candidate.label,- description: candidate.description,- transport: candidate.transport,- command: candidate.command,- args: candidate.args,- env: candidate.env,- url: candidate.url,- headers: candidate.headers,- disabled: candidate.disabled,- }));- if (items.length === 0) return;- setImporting(true);- try {- const res = await api.runExternalMcpImport({ items });- showToast(- t("settings.importAgentScanResult", {- imported: res.imported.length,- skipped: res.skipped.length,- failed: res.failed.length,- }),- { variant: res.failed.length > 0 ? "error" : "success" },- );- await scan();- } catch (e) {- showToast(e instanceof Error ? e.message : String(e), { variant: "error" });- } finally {- setImporting(false);- }- };-- const groups = useMemo(() => groupBySource(result?.candidates ?? []), [result]);- const allKeys = useMemo(- () => (result?.candidates ?? []).map(keyOf),- [result],- );- const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));-- return (- <div className="import-workbench">- {result === null ? (- <ImportIdle- description={t("settings.importAgentMcpDesc")}- onScan={() => void scan()}- scanning={scanning}- />- ) : (- <>- <ImportToolbar- found={t("settings.importAgentScanFoundMcp", {- count: result.candidates.length,- })}- selectedCount={selected.size}- allSelected={allSelected}- selectAllLabel={t("settings.importSelectAll")}- onToggleAll={(on) => setSelected(on ? new Set(allKeys) : new Set())}- scanning={scanning}- importing={importing}- onScan={() => void scan()}- onImport={() => void runImport()}- />- <ImportResults- message={- result.candidates.length === 0- ? t("settings.importAgentScanNone")- : undefined- }- >- <div className="import-groups">- {groups.map((group, groupIndex) => (- <ImportGroup- key={group.id}- bodyId={`import-mcp-group-${groupIndex}`}- name={t(- MCP_SOURCE_KEY[group.id as ExternalMcpSourceKind] ??- "settings.importSourcePi",- )}- count={group.items.length}- countLabel={t("settings.importAgentScanFoundMcp", {- count: group.items.length,- })}- expanded={disclosure.isExpanded(group.id)}- onToggle={() => disclosure.toggle(group.id)}- >- {group.items.map((candidate) => {- const key = keyOf(candidate);- return (- <ImportRow- key={key}- title={candidate.label || candidate.id}- meta={- candidate.description ||- candidate.command ||- candidate.url ||- candidate.sourcePath- }- checked={selected.has(key)}- onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}- badge={- <Badge tone="neutral">- {candidate.transport === "http"- ? t("settings.importAgentScanTransportHttp")- : t("settings.importAgentScanTransportStdio")}- </Badge>- }- />- );- })}- </ImportGroup>- ))}- </div>- </ImportResults>- </>- )}- </div>- );-}+/** Internal re-exports for existing settings importer references. */+export { ModelConfigImportPanel } from "./imports/ModelConfigImportPanel";+export { AgentSkillImportPanel } from "./imports/AgentSkillImportPanel";+export { AgentMcpImportPanel } from "./imports/AgentMcpImportPanel";diff --git a/apps/desktop/src/features/settings/import-workbench.tsx b/apps/desktop/src/features/settings/import-workbench.tsxnew file mode 100644index 000000000..f33b21dfa--- /dev/null+++ b/apps/desktop/src/features/settings/import-workbench.tsx@@ -0,0 +1,338 @@+import { useState, type ReactNode } from "react";+import { useTranslation } from "react-i18next";+import { Button, Checkbox, HelpIcon, cx } from "../../components/ui";+import { IconChevronLeft, IconDownload } from "../../components/icons";+import { SettingsMenuSelect } from "../../components/settings/SettingsMenuSelect";++/**+ * The only action row on a kind: both counts behind the select-all control,+ * kind options and the two actions on the right. `found` is the kind's own+ * localized sentence, so the row never needs a per-kind copy of itself.+ */+export function ImportToolbar({+ found,+ selectedCount,+ allSelected,+ selectAllLabel,+ onToggleAll,+ scanning,+ importing,+ onScan,+ onImport,+ options,+}: {+ found: string;+ selectedCount: number;+ allSelected: boolean;+ selectAllLabel: string;+ onToggleAll: (on: boolean) => void;+ scanning: boolean;+ importing: boolean;+ onScan: () => void;+ onImport: () => void;+ /** Kind-specific control in front of the actions, e.g. grouping or mode. */+ options?: ReactNode;+}) {+ const { t } = useTranslation();++ return (+ <div className="import-toolbar">+ <Checkbox+ className="import-select-all"+ checked={allSelected}+ indeterminate={selectedCount > 0 && !allSelected}+ aria-label={selectAllLabel}+ onChange={(event) => onToggleAll(event.target.checked)}+ label={+ <span className="import-count">+ <span className="import-count-found">{found}</span>+ {selectedCount > 0 ? (+ <span className="import-count-selected">+ {t("settings.importSelectedCount", { count: selectedCount })}+ </span>+ ) : null}+ </span>+ }+ />+ <div className="import-toolbar-actions">+ {options}+ <Button+ variant="secondary"+ disabled={scanning}+ aria-busy={scanning || undefined}+ onClick={onScan}+ >+ {scanning ? t("settings.importScanning") : t("settings.importScan")}+ </Button>+ <Button+ variant="primary"+ disabled={importing || selectedCount === 0}+ aria-busy={importing || undefined}+ onClick={onImport}+ >+ {importing+ ? t("settings.importing")+ : t("settings.importSelected", { count: selectedCount })}+ </Button>+ </div>+ </div>+ );+}++/** A labelled menu select inside the toolbar, for grouping or import mode. */+export function ImportOption({+ label,+ value,+ options,+ hint,+ onChange,+}: {+ label: string;+ value: string;+ options: { id: string; label: string }[];+ /** Explains the choice, reached from the label's help icon. */+ hint?: string;+ onChange: (id: string) => void;+}) {+ return (+ <label className="import-option">+ <span className="import-option-label">+ {label}+ {hint ? <HelpIcon label={hint} /> : null}+ </span>+ <SettingsMenuSelect+ className="import-option-select"+ label={label}+ value={value}+ options={options}+ onChange={onChange}+ />+ </label>+ );+}++/** One group: a quiet label line that also discloses its rows. */+export function ImportGroup({+ bodyId,+ name,+ path,+ count,+ countLabel,+ expanded,+ onToggle,+ selection,+ children,+}: {+ bodyId: string;+ name: string;+ /** Exact project path, or the resolved config path, when the group has one. */+ path?: string | null;+ count: number;+ countLabel: string;+ expanded: boolean;+ onToggle: () => void;+ /** Kinds whose groups are selectable render the leading checkbox. */+ selection?: {+ label: string;+ checked: boolean;+ indeterminate: boolean;+ onChange: (on: boolean) => void;+ };+ children: ReactNode;+}) {+ return (+ <section className="import-group">+ <div className="import-group-header">+ {selection ? (+ <Checkbox+ className="import-group-checkbox"+ checked={selection.checked}+ indeterminate={selection.indeterminate}+ aria-label={selection.label}+ onChange={(event) => selection.onChange(event.target.checked)}+ label=""+ />+ ) : null}+ <button+ type="button"+ className="import-group-toggle"+ aria-controls={bodyId}+ aria-expanded={expanded}+ onClick={onToggle}+ >+ <span+ className={cx("import-group-chevron", !expanded && "collapsed")}+ aria-hidden+ >+ <IconChevronLeft size={13} />+ </span>+ <span className="import-group-name">{name}</span>+ {path ? (+ <code className="import-group-path" title={path}>+ {path}+ </code>+ ) : null}+ <span className="import-group-count" title={countLabel}>+ {count}+ </span>+ </button>+ </div>+ {expanded ? (+ <div id={bodyId} className="import-group-body">+ {children}+ </div>+ ) : null}+ </section>+ );+}++/**+ * One candidate. The checkbox, the identity, and the row's own badge are the+ * whole anatomy, so every kind reads the same way.+ */+export function ImportRow({+ title,+ meta,+ checked,+ onChange,+ badge,+}: {+ title: string;+ meta: ReactNode;+ checked: boolean;+ onChange: (on: boolean) => void;+ badge?: ReactNode;+}) {+ return (+ <Checkbox+ className="import-row"+ checked={checked}+ onChange={(event) => onChange(event.target.checked)}+ label={+ <>+ <span className="import-row-main">+ <span className="import-row-title">{title}</span>+ <span className="import-row-meta">{meta}</span>+ </span>+ {badge}+ </>+ }+ />+ );+}++/**+ * Pre-scan state: what the scan will look at, and the action that starts it.+ * Empty states carry no filler, so a kind without a description shows only the+ * glyph and the action.+ */+export function ImportIdle({+ description,+ note,+ onScan,+ scanning,+}: {+ description?: string;+ note?: string;+ onScan: () => void;+ scanning: boolean;+}) {+ const { t } = useTranslation();+ const help = [description, note].filter(Boolean).join(" · ");+ return (+ <div className="settings-panel import-panel">+ <div className="import-idle">+ <span className="import-idle-glyph" aria-hidden>+ <IconDownload size={20} />+ </span>+ <div className="import-idle-actions">+ <Button variant="secondary" disabled={scanning} onClick={onScan}>+ {scanning ? t("settings.importScanning") : t("settings.importScan")}+ </Button>+ {help ? <HelpIcon label={help} /> : null}+ </div>+ </div>+ </div>+ );+}++/** The result surface: rows when a scan found something, a line when it did not. */+export function ImportResults({ message, children }: { message?: string; children?: ReactNode }) {+ return (+ <div className="settings-panel import-panel">+ {message ? <p className="import-empty">{message}</p> : children}+ </div>+ );+}++/**+ * Clears a selection when the underlying candidate set is replaced.+ * `keyOf` stays with the caller so every kind keeps its own identity rule.+ */+export function toggleKey(previous: Set<string>, key: string, on: boolean): Set<string> {+ const next = new Set(previous);+ if (on) next.add(key);+ else next.delete(key);+ return next;+}+++/**+ * Group disclosure. Groups start expanded — the found candidates are the+ * answer to a scan — and every kind's label line discloses its own rows, so all+ * three read the same way.+ */+export function useGroupDisclosure() {+ const [collapsed, setCollapsed] = useState<Set<string>>(new Set());+ return {+ isExpanded: (id: string) => !collapsed.has(id),+ toggle: (id: string) =>+ setCollapsed((previous) =>+ previous.has(id)+ ? new Set([...previous].filter((entry) => entry !== id))+ : new Set([...previous, id]),+ ),+ reset: () => setCollapsed(new Set()),+ };+}++export function groupBySource<C extends { source: string }>(+ candidates: C[],+): Array<{ id: string; items: C[] }> {+ const map = new Map<string, C[]>();+ for (const candidate of candidates) {+ const bucket = map.get(candidate.source);+ if (bucket) bucket.push(candidate);+ else map.set(candidate.source, [candidate]);+ }+ return Array.from(map.entries()).map(([id, items]) => ({ id, items }));+}++++export function ImportToggleButton({+ open,+ controls,+ label,+ disabled,+ onClick,+}: {+ open: boolean;+ controls: string;+ label: string;+ disabled?: boolean;+ onClick: () => void;+}) {+ return (+ <Button+ variant="secondary"+ aria-expanded={open}+ aria-controls={controls}+ disabled={disabled}+ onClick={onClick}+ >+ <IconDownload size={14} />+ {label}+ </Button>+ );+}diff --git a/apps/desktop/src/features/settings/imports/AgentMcpImportPanel.tsx b/apps/desktop/src/features/settings/imports/AgentMcpImportPanel.tsxnew file mode 100644index 000000000..09ab31c64--- /dev/null+++ b/apps/desktop/src/features/settings/imports/AgentMcpImportPanel.tsx@@ -0,0 +1,192 @@+import { useMemo, useState } from "react";+import { useTranslation } from "react-i18next";+import type {+ ExternalMcpCandidate,+ ExternalMcpImportItem,+ ExternalMcpScanResult,+ ExternalMcpSourceKind,+} from "../../../lib/api";+import { api } from "../../../lib/api";+import { useAppStore } from "../../../stores/app-store";+import { externalMcpDisplayMeta } from "./import-format";+import { Badge } from "../../../components/ui";+import {+ ImportGroup,+ ImportIdle,+ ImportResults,+ ImportRow,+ ImportToolbar,+ groupBySource,+ toggleKey,+ useGroupDisclosure,+} from "../import-workbench";++const MCP_SOURCE_KEY: Record<ExternalMcpSourceKind, string> = {+ "claude-desktop": "settings.importAgentScanSourceClaudeDesktop",+ "claude-code": "settings.importAgentScanSourceClaudeCode",+ "cursor-global": "settings.importAgentScanSourceCursorGlobal",+ "cursor-project": "settings.importAgentScanSourceCursorProject",+ codex: "settings.importAgentScanSourceCodex",+ opencode: "settings.importAgentScanSourceOpenCode",+ "chatgpt-desktop": "settings.importAgentScanSourceChatgpt",+};++export function AgentMcpImportPanel({+ level,+ projectPath,+ onImported,+}: {+ level: "global" | "project";+ projectPath?: string;+ onImported: () => Promise<unknown>;+}) {+ const { t } = useTranslation();+ const showToast = useAppStore((s) => s.showToast);+ const [result, setResult] = useState<ExternalMcpScanResult | null>(null);+ const [selected, setSelected] = useState<Set<string>>(new Set());+ const disclosure = useGroupDisclosure();+ const [scanning, setScanning] = useState(false);+ const [importing, setImporting] = useState(false);++ const keyOf = (candidate: ExternalMcpCandidate) =>+ `${candidate.source}:${candidate.id}`;++ const scan = async () => {+ setScanning(true);+ try {+ const res = await api.scanExternalMcp(projectPath ? { projectPath } : undefined);+ setResult(res);+ setSelected(new Set());+ disclosure.reset();+ } catch (e) {+ showToast(e instanceof Error ? e.message : String(e), { variant: "error" });+ } finally {+ setScanning(false);+ }+ };++ const runImport = async () => {+ if (!result) return;+ const items: ExternalMcpImportItem[] = result.candidates+ .filter((candidate) => selected.has(keyOf(candidate)))+ .map((candidate) => ({+ source: candidate.source,+ sourcePath: candidate.sourcePath,+ id: candidate.id,+ rawKey: candidate.rawKey,+ label: candidate.label,+ description: candidate.description,+ transport: candidate.transport,+ command: candidate.command,+ args: candidate.args,+ env: candidate.env,+ url: candidate.url,+ headers: candidate.headers,+ disabled: candidate.disabled,+ }));+ if (items.length === 0) return;+ setImporting(true);+ try {+ const res = await api.runExternalMcpImport({+ level,+ ...(level === "project" && projectPath ? { projectPath } : {}),+ items,+ });+ showToast(+ t("settings.importAgentScanResult", {+ imported: res.imported.length,+ skipped: res.skipped.length,+ failed: res.failed.length,+ }),+ { variant: res.failed.length > 0 ? "error" : "success" },+ );+ if (res.imported.length > 0) await onImported();+ await scan();+ } catch (e) {+ showToast(e instanceof Error ? e.message : String(e), { variant: "error" });+ } finally {+ setImporting(false);+ }+ };++ const groups = useMemo(() => groupBySource(result?.candidates ?? []), [result]);+ const allKeys = useMemo(+ () => (result?.candidates ?? []).map(keyOf),+ [result],+ );+ const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));++ return (+ <div className="import-workbench">+ {result === null ? (+ <ImportIdle+ description={t("settings.importAgentMcpDesc")}+ onScan={() => void scan()}+ scanning={scanning}+ />+ ) : (+ <>+ <ImportToolbar+ found={t("settings.importAgentScanFoundMcp", {+ count: result.candidates.length,+ })}+ selectedCount={selected.size}+ allSelected={allSelected}+ selectAllLabel={t("settings.importSelectAll")}+ onToggleAll={(on) => setSelected(on ? new Set(allKeys) : new Set())}+ scanning={scanning}+ importing={importing}+ onScan={() => void scan()}+ onImport={() => void runImport()}+ />+ <ImportResults+ message={+ result.candidates.length === 0+ ? t("settings.importAgentScanNone")+ : undefined+ }+ >+ <div className="import-groups">+ {groups.map((group, groupIndex) => (+ <ImportGroup+ key={group.id}+ bodyId={`import-mcp-group-${groupIndex}`}+ name={t(+ MCP_SOURCE_KEY[group.id as ExternalMcpSourceKind] ??+ "settings.importSourcePi",+ )}+ count={group.items.length}+ countLabel={t("settings.importAgentScanFoundMcp", {+ count: group.items.length,+ })}+ expanded={disclosure.isExpanded(group.id)}+ onToggle={() => disclosure.toggle(group.id)}+ >+ {group.items.map((candidate) => {+ const key = keyOf(candidate);+ return (+ <ImportRow+ key={key}+ title={candidate.label || candidate.id}+ meta={externalMcpDisplayMeta(candidate)}+ checked={selected.has(key)}+ onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}+ badge={+ <Badge tone="neutral">+ {candidate.transport === "http"+ ? t("settings.importAgentScanTransportHttp")+ : t("settings.importAgentScanTransportStdio")}+ </Badge>+ }+ />+ );+ })}+ </ImportGroup>+ ))}+ </div>+ </ImportResults>+ </>+ )}+ </div>+ );+}diff --git a/apps/desktop/src/features/settings/imports/AgentSkillImportPanel.tsx b/apps/desktop/src/features/settings/imports/AgentSkillImportPanel.tsxnew file mode 100644index 000000000..5e77a8e3a--- /dev/null+++ b/apps/desktop/src/features/settings/imports/AgentSkillImportPanel.tsx@@ -0,0 +1,198 @@+import { useMemo, useState } from "react";+import { useTranslation } from "react-i18next";+import type {+ ExternalSkillCandidate,+ ExternalSkillImportItem,+ ExternalSkillScanResult,+ ExternalSkillSourceKind,+} from "../../../lib/api";+import { api } from "../../../lib/api";+import { useAppStore } from "../../../stores/app-store";+import { Badge } from "../../../components/ui";+import {+ ImportGroup,+ ImportIdle,+ ImportOption,+ ImportResults,+ ImportRow,+ ImportToolbar,+ groupBySource,+ toggleKey,+ useGroupDisclosure,+} from "../import-workbench";++const SKILL_SOURCE_KEY: Record<ExternalSkillSourceKind, string> = {+ "claude-user": "settings.importAgentScanSourceClaudeUser",+ "claude-project": "settings.importAgentScanSourceClaudeProject",+ "pi-user": "settings.importAgentScanSourcePiUser",+ "pi-project": "settings.importAgentScanSourcePiProject",+};++export function AgentSkillImportPanel({+ level,+ projectPath,+ onImported,+}: {+ level: "global" | "project";+ projectPath?: string;+ onImported: () => Promise<unknown>;+}) {+ const { t } = useTranslation();+ const showToast = useAppStore((s) => s.showToast);+ const [result, setResult] = useState<ExternalSkillScanResult | null>(null);+ const [selected, setSelected] = useState<Set<string>>(new Set());+ const disclosure = useGroupDisclosure();+ const [mode, setMode] = useState<"copy" | "link">("copy");+ const [scanning, setScanning] = useState(false);+ const [importing, setImporting] = useState(false);++ const keyOf = (candidate: ExternalSkillCandidate) =>+ `${candidate.source}:${candidate.sourcePath}`;++ const scan = async () => {+ setScanning(true);+ try {+ const res = await api.scanExternalSkills(projectPath ? { projectPath } : undefined);+ setResult(res);+ setSelected(new Set());+ disclosure.reset();+ } catch (e) {+ showToast(e instanceof Error ? e.message : String(e), { variant: "error" });+ } finally {+ setScanning(false);+ }+ };++ const runImport = async () => {+ if (!result) return;+ const items: ExternalSkillImportItem[] = result.candidates+ .filter((candidate) => selected.has(keyOf(candidate)))+ .map((candidate) => ({+ source: candidate.source,+ sourcePath: candidate.sourcePath,+ shape: candidate.shape,+ rootDir: candidate.rootDir,+ id: candidate.id,+ name: candidate.name,+ description: candidate.description,+ }));+ if (items.length === 0) return;+ setImporting(true);+ try {+ const res = await api.runExternalSkillsImport({+ level,+ ...(level === "project" && projectPath ? { projectPath } : {}),+ mode,+ items,+ });+ showToast(+ t("settings.importAgentScanResult", {+ imported: res.imported.length,+ skipped: res.skipped.length,+ failed: res.failed.length,+ }),+ { variant: res.failed.length > 0 ? "error" : "success" },+ );+ if (res.imported.length > 0) await onImported();+ // Refresh candidates so the imported entries are no longer selectable.+ await scan();+ } catch (e) {+ showToast(e instanceof Error ? e.message : String(e), { variant: "error" });+ } finally {+ setImporting(false);+ }+ };++ const groups = useMemo(() => groupBySource(result?.candidates ?? []), [result]);+ const allKeys = useMemo(+ () => (result?.candidates ?? []).map(keyOf),+ [result],+ );+ const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));++ return (+ <div className="import-workbench">+ {result === null ? (+ <ImportIdle+ description={t("settings.importAgentSkillsDesc")}+ onScan={() => void scan()}+ scanning={scanning}+ />+ ) : (+ <>+ <ImportToolbar+ found={t("settings.importAgentScanFoundSkills", {+ count: result.candidates.length,+ })}+ selectedCount={selected.size}+ allSelected={allSelected}+ selectAllLabel={t("settings.importSelectAll")}+ onToggleAll={(on) => setSelected(on ? new Set(allKeys) : new Set())}+ scanning={scanning}+ importing={importing}+ onScan={() => void scan()}+ onImport={() => void runImport()}+ options={+ <ImportOption+ label={t("settings.importAgentScanMode")}+ value={mode}+ onChange={(id) => setMode(id as "copy" | "link")}+ hint={t("settings.importAgentScanModeHint")}+ options={[+ { id: "copy", label: t("settings.importAgentScanModeCopy") },+ { id: "link", label: t("settings.importAgentScanModeLink") },+ ]}+ />+ }+ />+ <ImportResults+ message={+ result.candidates.length === 0+ ? t("settings.importAgentScanNone")+ : undefined+ }+ >+ <div className="import-groups">+ {groups.map((group, groupIndex) => (+ <ImportGroup+ key={group.id}+ bodyId={`import-skill-group-${groupIndex}`}+ name={t(+ SKILL_SOURCE_KEY[group.id as ExternalSkillSourceKind] ??+ "settings.importSourcePi",+ )}+ count={group.items.length}+ countLabel={t("settings.importAgentScanFoundSkills", {+ count: group.items.length,+ })}+ expanded={disclosure.isExpanded(group.id)}+ onToggle={() => disclosure.toggle(group.id)}+ >+ {group.items.map((candidate) => {+ const key = keyOf(candidate);+ return (+ <ImportRow+ key={key}+ title={candidate.name || candidate.id}+ meta={candidate.description || candidate.sourcePath}+ checked={selected.has(key)}+ onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}+ badge={+ <Badge tone="neutral">+ {candidate.shape === "dir"+ ? t("settings.importAgentScanShapeDir")+ : t("settings.importAgentScanShapeFile")}+ </Badge>+ }+ />+ );+ })}+ </ImportGroup>+ ))}+ </div>+ </ImportResults>+ </>+ )}+ </div>+ );+}diff --git a/apps/desktop/src/features/settings/imports/ModelConfigImportPanel.tsx b/apps/desktop/src/features/settings/imports/ModelConfigImportPanel.tsxnew file mode 100644index 000000000..aabc4c98d--- /dev/null+++ b/apps/desktop/src/features/settings/imports/ModelConfigImportPanel.tsx@@ -0,0 +1,207 @@+import { useMemo, useState } from "react";+import { useTranslation } from "react-i18next";+import type { ModelConfigImportCandidate } from "../../../lib/api";+import { api } from "../../../lib/api";+import { useAppStore } from "../../../stores/app-store";+import { Badge } from "../../../components/ui";+import {+ ImportGroup,+ ImportIdle,+ ImportOption,+ ImportResults,+ ImportRow,+ ImportToolbar,+ toggleKey,+ useGroupDisclosure,+} from "../import-workbench";++/* ---------------------------------------------------------------------------+ * Provider and model configuration+ * ------------------------------------------------------------------------- */++function hostOf(baseUrl: string | null): string {+ if (!baseUrl) return "";+ try {+ return new URL(baseUrl).host || baseUrl;+ } catch {+ return baseUrl.replace(/^https?:\/\//, "").split("/")[0] || baseUrl;+ }+}++export function ModelConfigImportPanel() {+ const { t } = useTranslation();+ const refreshProviders = useAppStore((s) => s.refreshProviders);+ const showToast = useAppStore((s) => s.showToast);+ const [candidates, setCandidates] = useState<ModelConfigImportCandidate[] | null>(+ null,+ );+ const [selected, setSelected] = useState<Set<string>>(new Set());+ const disclosure = useGroupDisclosure();+ const [scanning, setScanning] = useState(false);+ const [importing, setImporting] = useState(false);++ const keyOf = (candidate: ModelConfigImportCandidate) =>+ `${candidate.source}:${candidate.externalId}`;++ const scan = async () => {+ setScanning(true);+ try {+ const res = await api.scanImportModelConfigs();+ setCandidates(res.providers);+ setSelected(new Set());+ disclosure.reset();+ } catch (e) {+ showToast(e instanceof Error ? e.message : String(e), { variant: "error" });+ } finally {+ setScanning(false);+ }+ };++ const runImport = async () => {+ if (!candidates) return;+ const items = candidates.filter((candidate) => selected.has(keyOf(candidate)));+ if (items.length === 0) return;+ setImporting(true);+ try {+ const res = await api.runImportModelConfigs(items);+ await refreshProviders();+ showToast(+ t("settings.importResult", {+ imported: res.imported,+ skipped: res.skipped,+ failed: res.failed,+ }),+ { variant: res.failed > 0 ? "error" : "success" },+ );+ } catch (e) {+ showToast(e instanceof Error ? e.message : String(e), { variant: "error" });+ } finally {+ setImporting(false);+ }+ };++ const sourceLabels: Record<ModelConfigImportCandidate["source"], string> = useMemo(+ () => ({+ "claude-code": t("settings.importSourceClaudeCode"),+ opencode: t("settings.importSourceOpenCode"),+ codex: t("settings.importSourceCodex"),+ pi: t("settings.importSourcePi"),+ "cc-switch": t("settings.importSourceCcSwitch"),+ }),+ [t],+ );++ const groups = useMemo(() => {+ if (!candidates) return [];+ const grouped = new Map<+ ModelConfigImportCandidate["source"],+ ModelConfigImportCandidate[]+ >();+ for (const candidate of candidates) {+ const items = grouped.get(candidate.source) ?? [];+ items.push(candidate);+ grouped.set(candidate.source, items);+ }+ return [...grouped.entries()].map(([source, items]) => ({+ id: source,+ name: sourceLabels[source],+ items,+ }));+ }, [candidates, sourceLabels]);++ const allKeys = useMemo(() => (candidates ?? []).map(keyOf), [candidates]);+ const allSelected = allKeys.length > 0 && allKeys.every((k) => selected.has(k));++ const toggleKeys = (keys: string[], on: boolean) => {+ setSelected((previous) => {+ const next = new Set(previous);+ for (const key of keys) {+ if (on) next.add(key);+ else next.delete(key);+ }+ return next;+ });+ };++ return (+ <div className="import-workbench">+ {candidates === null ? (+ <ImportIdle+ description={t("settings.importModelsScanDesc")}+ onScan={() => void scan()}+ scanning={scanning}+ />+ ) : (+ <>+ <ImportToolbar+ found={t("settings.importModelsFound", { count: candidates.length })}+ selectedCount={selected.size}+ allSelected={allSelected}+ selectAllLabel={t("settings.importModelsSelectAll")}+ onToggleAll={(on) => toggleKeys(allKeys, on)}+ scanning={scanning}+ importing={importing}+ onScan={() => void scan()}+ onImport={() => void runImport()}+ />+ <ImportResults+ message={+ candidates.length === 0 ? t("settings.importModelsNone") : undefined+ }+ >+ <div className="import-groups">+ {groups.map((group, groupIndex) => {+ const groupKeys = group.items.map(keyOf);+ const groupSelected = groupKeys.filter((k) => selected.has(k)).length;+ const bodyId = `import-model-group-${groupIndex}`;+ return (+ <ImportGroup+ key={group.id}+ bodyId={bodyId}+ name={group.name}+ count={group.items.length}+ countLabel={t("settings.importModelsFound", {+ count: group.items.length,+ })}+ expanded={disclosure.isExpanded(group.id)}+ onToggle={() => disclosure.toggle(group.id)}+ selection={{+ label: t("settings.importModelsSelectGroup", { name: group.name }),+ checked: groupSelected === groupKeys.length,+ indeterminate:+ groupSelected > 0 && groupSelected < groupKeys.length,+ onChange: (on) => toggleKeys(groupKeys, on),+ }}+ >+ {group.items.map((candidate) => {+ const key = keyOf(candidate);+ const host = hostOf(candidate.baseUrl);+ return (+ <ImportRow+ key={key}+ title={candidate.name}+ meta={`${t("settings.importModelsCount", {+ count: candidate.modelIds.length,+ })}${host ? ` · ${host}` : ""}`}+ checked={selected.has(key)}+ onChange={(on) => setSelected((previous) => toggleKey(previous, key, on))}+ badge={+ <Badge tone={candidate.hasSecret ? "success" : "warning"}>+ {candidate.hasSecret+ ? t("settings.importModelsHasKey")+ : t("settings.importModelsNoKey")}+ </Badge>+ }+ />+ );+ })}+ </ImportGroup>+ );+ })}+ </div>+ </ImportResults>+ </>+ )}+ </div>+ );+}diff --git a/apps/desktop/src/features/settings/imports/import-format.ts b/apps/desktop/src/features/settings/imports/import-format.tsnew file mode 100644index 000000000..bbbd1ae43--- /dev/null+++ b/apps/desktop/src/features/settings/imports/import-format.ts@@ -0,0 +1,16 @@+import type { ExternalMcpCandidate } from "../../../lib/api";++/** Keep inline URL credentials, paths, and query values out of candidate rows. */+export function externalMcpDisplayMeta(candidate: ExternalMcpCandidate): string {+ if (candidate.description) return candidate.description;+ if (candidate.command) return candidate.command;+ if (candidate.url) {+ try {+ const host = new URL(candidate.url).host;+ if (host) return host;+ } catch {+ // An unparseable source URL is not shown; use the config path instead.+ }+ }+ return candidate.sourcePath;+}diff --git a/apps/desktop/src/lib/api.ts b/apps/desktop/src/lib/api.tsindex c28f35e53..ddaf408bc 100644--- a/apps/desktop/src/lib/api.ts+++ b/apps/desktop/src/lib/api.ts@@ -281,6 +281,9 @@ export interface ExternalMcpImportItem {}export interface ExternalMcpImportPayload {+ /** Defaults to global for existing callers. */+ level?: "global" | "project";+ projectPath?: string;items: ExternalMcpImportItem[];}diff --git a/apps/desktop/src/lib/settings-search.ts b/apps/desktop/src/lib/settings-search.tsindex 8651f99b7..a8200958c 100644--- a/apps/desktop/src/lib/settings-search.ts+++ b/apps/desktop/src/lib/settings-search.ts@@ -14,7 +14,6 @@ export type SettingsTabId =| "skills"| "mcp"| "subagents"- | "import"| "projects"| "sync"| "remoteHosts"@@ -186,6 +185,14 @@ export const SETTINGS_NAV: SettingsNavEntry[] = [// Subscription accounts share the service list (D625)."settings.vendorAccounts","settings.vendorSubscription",+ "settings.importTitle",+ "settings.importModelsScanDesc",+ "settings.importModelsTitle",+ "settings.importSourceClaudeCode",+ "settings.importSourceOpenCode",+ "settings.importSourceCodex",+ "settings.importSourcePi",+ "settings.importSourceCcSwitch",],},{@@ -199,6 +206,9 @@ export const SETTINGS_NAV: SettingsNavEntry[] = ["settings.globalScopeDescription","settings.projectScopeDescription","settings.importSkill",+ "settings.importSkillFromTools",+ "settings.importAgentSkillsTitle",+ "settings.importAgentSkillsDesc","settings.capabilityFilterGlobal","settings.capabilityFilterProject","extensions.skills.add",@@ -218,6 +228,9 @@ export const SETTINGS_NAV: SettingsNavEntry[] = ["settings.globalScopeDescription","settings.projectScopeDescription","settings.addMcp",+ "settings.importMcpFromTools",+ "settings.importAgentMcpTitle",+ "settings.importAgentMcpDesc","settings.editMcp","settings.transport","settings.capabilityFilterGlobal",@@ -249,21 +262,6 @@ export const SETTINGS_NAV: SettingsNavEntry[] = ["extensions.subagents.tools",],},- {- id: "import",- labelKey: "settings.nav.import",- titleKey: "settings.import",- group: "workspace",- keywordKeys: [- "settings.importTitle",- "settings.importModelsTitle",- "settings.importSourceClaudeCode",- "settings.importSourceOpenCode",- "settings.importSourceCodex",- "settings.importSourcePi",- "settings.importSourceCcSwitch",- ],- },{id: "projects",labelKey: "settings.nav.projects",diff --git a/apps/desktop/src/styles/sessions.css b/apps/desktop/src/styles/sessions.cssindex 3a9bcb5f3..7b0f28d18 100644--- a/apps/desktop/src/styles/sessions.css+++ b/apps/desktop/src/styles/sessions.css@@ -1,53 +1,18 @@-/*- Session management — settings session import (groups and rows) and the- sidebar session controls: lists, toolbars, sort popover, checkboxes, project- grouping, and disclosure. Base thread row styles live in- sidebar-threads.css.-*/+/* Session controls: lists, toolbars, sort popover, project grouping, and+ disclosure. Base thread row styles live in sidebar-threads.css. *//* -------------------------------------------------------------------------- * Settings > Import. One workbench per kind — sessions, model configuration,- * skills, MCP servers: a segmented kind switcher, one toolbar (select-all with- * both counts, kind options, rescan, import selected), then one list panel- * whose group headers are quiet label lines and whose rows are individual- * tiles. The rhythm matches the agent capability destinations.+ * Inline import workbenches inside their settings destinations.*/-.import-page {- display: flex;- min-width: 0;- flex-direction: column;- gap: 14px;-}--/*- Kind switcher. The shared `.settings-segment` already carries both theme- pairs and the raised active pill; only the page-scale pills are local.- Compound selectors on purpose: providers.css defines `.settings-segment-item`- further down the cascade, so a bare `.import-segment-btn` would lose to it.-*/-.settings-segment.import-segment {- align-self: flex-start;- max-width: 100%;- flex-wrap: wrap;-}--.settings-segment-item.import-segment-btn {- padding: 5px 12px;- font-size: var(--text-sm);- font-weight: var(--font-weight-medium);- white-space: nowrap;+.import-inline-section[hidden],+.import-inline-workbench[hidden] {+ display: none;}-/* Tab panels stay mounted so a scan result survives a switch. */-.import-view {- display: flex;+.import-inline-workbench {min-width: 0;- flex-direction: column;-}--.import-view[hidden] {- display: none;+ padding: 10px 0;}.import-workbench {@@ -247,19 +212,31 @@}.import-row:has(input:focus-visible),-.import-group-header > input:focus-visible {+.import-group-checkbox:has(> input:focus-visible) {outline: none;box-shadow: 0 0 0 2px color-mix(in oklab, var(--ds-accent) 22%, transparent);}.import-row > input[type="checkbox"],-.import-group-header > input[type="checkbox"] {+.import-group-checkbox > input[type="checkbox"] {width: 14px;height: 14px;flex: 0 0 auto;margin: 0;}+.import-row > span {+ display: flex;+ min-width: 0;+ flex: 1;+ align-items: center;+ gap: 10px;+}++.import-group-checkbox > span {+ display: none;+}+.import-row-main {display: flex;min-width: 0;diff --git a/apps/desktop/test/agent-capability-settings.test.mjs b/apps/desktop/test/agent-capability-settings.test.mjsindex bdf7e494e..158265751 100644--- a/apps/desktop/test/agent-capability-settings.test.mjs+++ b/apps/desktop/test/agent-capability-settings.test.mjs@@ -78,14 +78,19 @@ test("one search field covers the page and every row carries its level", () => {assert.match(styles, /\.agent-capability-badge\.is-level\s*\{/);});-test("skills keep the MCP-shaped toolbar and scope import actions in group headers", () => {+test("skills keep file imports in group headers and expose the external scan in-page", () => {const toolbar = skills.slice(skills.indexOf("<CapabilityToolbar"), skills.indexOf("<CapabilityPanel"));assert.match(toolbar, /actions=\{[\s\S]*?CapabilityButton variant="primary"/);assert.match(toolbar, /settings\.newSkill/);+ assert.match(toolbar, /ImportToggleButton/);+ assert.match(toolbar, /settings\.importSkillFromTools/);assert.doesNotMatch(toolbar, /extensions\.skills\.add/);- assert.doesNotMatch(toolbar, /importSkill|IconDownload|settings\.importSkill/);assert.match(skills, /action=\{importButton\("global"\)\}/);assert.match(skills, /action=\{selectedProjectPath \? importButton\("project"\) : undefined\}/);+ assert.match(skills, /<AgentSkillImportPanel/);+ assert.match(skills, /level=\{targetLevel\}/);+ assert.match(mcp, /<AgentMcpImportPanel/);+ assert.match(mcp, /settings\.importMcpFromTools/);assert.match(layout, /action\?: ReactNode/);});diff --git a/apps/desktop/test/import-format.test.mjs b/apps/desktop/test/import-format.test.mjsnew file mode 100644index 000000000..7130f7061--- /dev/null+++ b/apps/desktop/test/import-format.test.mjs@@ -0,0 +1,40 @@+import assert from "node:assert/strict";+import { dirname, join } from "node:path";+import { register } from "node:module";+import test from "node:test";+import { fileURLToPath, pathToFileURL } from "node:url";++const here = dirname(fileURLToPath(import.meta.url));+register(pathToFileURL(join(here, "helpers/ts-import-hooks.mjs")));+const { externalMcpDisplayMeta } = await import(+ "../src/features/settings/imports/import-format.ts"+);++test("MCP candidate metadata never exposes URL credentials or query values", () => {+ const meta = externalMcpDisplayMeta({+ source: "claude-code",+ sourcePath: "/config/mcp.json",+ id: "remote",+ rawKey: "remote",+ transport: "http",+ url: "https://user:[email protected]:8443/path?token=private#fragment",+ warnings: [],+ });++ assert.equal(meta, "example.test:8443");+ assert.doesNotMatch(meta, /user|secret|private|path|fragment/);+});++test("MCP candidate metadata prefers safe description or command text", () => {+ const base = {+ source: "claude-code",+ sourcePath: "/config/mcp.json",+ id: "local",+ rawKey: "local",+ transport: "stdio",+ warnings: [],+ };++ assert.equal(externalMcpDisplayMeta({ ...base, description: "Local tools" }), "Local tools");+ assert.equal(externalMcpDisplayMeta({ ...base, command: "node" }), "node");+});diff --git a/apps/desktop/test/model-config-import.test.mjs b/apps/desktop/test/model-config-import.test.mjsindex 45d28c639..defe5cacc 100644--- a/apps/desktop/test/model-config-import.test.mjs+++ b/apps/desktop/test/model-config-import.test.mjs@@ -1,4 +1,4 @@-import { readSettingsSource, readMainSource } from "./helpers/source-contracts.mjs";+import { readMainSource } from "./helpers/source-contracts.mjs";import assert from "node:assert/strict";import { mkdir, mkdtemp, writeFile } from "node:fs/promises";import { register } from "node:module";@@ -84,17 +84,25 @@ test("scanModelConfigs returns nothing when the home directory is empty", asyncassert.deepEqual(drafts, []);});-test("settings import and protocol expose model-config import independently of sessions", async () => {+test("model settings embeds the model-config importer while retaining its protocol", async () => {const { readFile } = await import("node:fs/promises");- const settingsPage = await readSettingsSource();+ const modelPage = await readFile(+ new URL("../src/components/settings/ModelConfigPage.tsx", import.meta.url),+ "utf8",+ );+ const modelImport = await readFile(+ new URL("../src/features/settings/imports/ModelConfigImportPanel.tsx", import.meta.url),+ "utf8",+ );const apiSource = await readFile(new URL("../src/lib/api.ts", import.meta.url), "utf8");const protocol = await readFile(new URL("../../../packages/shared/src/protocol.ts", import.meta.url),"utf8",);const mainSource = await readMainSource();- assert.match(settingsPage, /scanImportModelConfigs/);- assert.match(settingsPage, /ModelConfigImportPanel/);+ assert.match(modelPage, /ImportToggleButton/);+ assert.match(modelPage, /<ModelConfigImportPanel \/>/);+ assert.match(modelImport, /scanImportModelConfigs/);assert.match(apiSource, /modelConfigImportScan/);assert.match(protocol, /pi-desktop\/modelConfig\/importScan/);assert.match(mainSource, /providers\.create/);diff --git a/apps/desktop/test/project-import-archive.test.mjs b/apps/desktop/test/project-import-archive.test.mjsindex d2ecd8a63..c7e1f7755 100644--- a/apps/desktop/test/project-import-archive.test.mjs+++ b/apps/desktop/test/project-import-archive.test.mjs@@ -3,20 +3,20 @@ import test from "node:test";import { readFile } from "node:fs/promises";import { readAppSource, readStoreModule } from "./helpers/source-contracts.mjs";-const [appSource, projectSlice, sessionSlice, importSource] = await Promise.all([+const [appSource, projectSlice, sessionSlice, settingsImportSource] = await Promise.all([readAppSource(),readStoreModule("slices/project-slice.ts"),readStoreModule("slices/session-slice.ts"),readFile(new URL("../src/features/settings/import-page.tsx", import.meta.url), "utf8"),]);-test("session imports restore archived projects only for newly added sessions", () => {+test("plugin session imports retain project restoration without a Settings session importer", () => {assert.match(projectSlice, /restoreProjects: \(paths\) =>/);assert.match(projectSlice, /projectIsArchived\(key, get\(\)\.projectMeta\)/);assert.match(sessionSlice, /refreshSessions: async \(options\) =>/);assert.match(sessionSlice, /projectPathsForNewSessions\(previousSessions, sessions\.sessions\)/);assert.match(sessionSlice, /get\(\)\.restoreProjects/);- assert.match(importSource, /await refreshSessions\(\{ revealImportedProjects: true \}\)/);+ assert.doesNotMatch(settingsImportSource, /SessionImportPanel|scanImportSessions/);assert.match(appSource, /event\.reason === "plugin\.session\.import"/);assert.match(appSource, /revealImportedProjects: true/);});diff --git a/apps/desktop/test/settings-general.test.mjs b/apps/desktop/test/settings-general.test.mjsindex c806d1c55..475c1f3ae 100644--- a/apps/desktop/test/settings-general.test.mjs+++ b/apps/desktop/test/settings-general.test.mjs@@ -410,7 +410,7 @@ test("settings nav icons map each destination to a semantic lucide glyph", () =>assert.match(settingsPageSource, /shortcuts: <IconKeyboard/);assert.match(settingsPageSource, /instructions: <IconFileText/);assert.match(settingsPageSource, /agent: <IconBot/);- assert.match(settingsPageSource, /import: <IconDownload/);+ assert.doesNotMatch(settingsPageSource, /import: <IconDownload/);assert.match(settingsPageSource, /projects: <IconArchive/);assert.match(settingsPageSource, /about: <IconInfo/);assert.doesNotMatch(settingsPageSource, /general: <IconSettings/);@@ -446,7 +446,9 @@ test("settings nav keeps a flat searchable index with titled visual groups", ()"shortcuts","instructions","agent",- "import",+ "skills",+ "mcp",+ "subagents","projects","about",].map((id) => settingsSearchSource.indexOf(`id: "${id}"`));@@ -485,7 +487,6 @@ test("settings rail uses short parallel labels and descriptive page titles", ()"settings.nav.skills","settings.nav.mcp","settings.nav.subagents",- "settings.nav.import","settings.nav.projects","settings.nav.info",];diff --git a/apps/desktop/test/settings-help-tooltip.test.mjs b/apps/desktop/test/settings-help-tooltip.test.mjsindex 06810d39e..c3adc67b6 100644--- a/apps/desktop/test/settings-help-tooltip.test.mjs+++ b/apps/desktop/test/settings-help-tooltip.test.mjs@@ -9,7 +9,9 @@ const source = (path) =>const ui = await source("components/ui.tsx");const primitives = await source("features/settings/primitives.tsx");const settingsPage = await source("features/settings/SettingsPage.tsx");-const importPage = await source("features/settings/import-page.tsx");+const importWorkbench = await source("features/settings/import-workbench.tsx");+const modelImport = await source("features/settings/imports/ModelConfigImportPanel.tsx");+const skillImport = await source("features/settings/imports/AgentSkillImportPanel.tsx");const networkProxy = await source("components/settings/NetworkProxySection.tsx");const styles = await loadStyles();@@ -108,15 +110,12 @@ test("one settings row renderer owns the layout", () => {});test("an import hint is reachable from the control it explains", () => {- // The standalone hint line is gone; the toolbar and its option carry it.- assert.doesNotMatch(importPage, /className="import-hint"/);- assert.match(importPage, /hint\?: string;/);- assert.match(importPage, /hint=\{t\("settings\.importAgentScanModeHint"\)\}/);- assert.match(importPage, /hint=\{\n\s+codexCap != null/);- assert.match(importPage, /\{hint \? <HelpIcon label=\{hint\} \/> : null\}/);- assert.match(importPage, /\{help \? <HelpIcon label=\{help\} \/> : null\}/);- // A hint rides beside the controls, so the toolbar must still render them:- // a half-migrated prop list silently dropped the grouping and mode pickers- // once already, and no source-level assertion caught it.- assert.match(importPage, /\{options\}\n\s+\{hint \? <HelpIcon/);+ // The standalone hint line is gone; skill mode keeps its help text beside+ // the option, while the retired session-only cap note leaves Settings too.+ assert.doesNotMatch(importWorkbench, /className="import-hint"/);+ assert.match(importWorkbench, /hint\?: string;/);+ assert.match(skillImport, /hint=\{t\("settings\.importAgentScanModeHint"\)\}/);+ assert.doesNotMatch(modelImport, /codexCap|importCodexCapped/);+ assert.match(importWorkbench, /\{help \? <HelpIcon label=\{help\} \/> : null\}/);+ assert.match(importWorkbench, /<HelpIcon label=\{hint\} \/>/);});diff --git a/apps/desktop/test/settings-import-page.test.mjs b/apps/desktop/test/settings-import-page.test.mjsindex c0a30d518..a8d425e85 100644--- a/apps/desktop/test/settings-import-page.test.mjs+++ b/apps/desktop/test/settings-import-page.test.mjs@@ -1,119 +1,81 @@-/**- * Settings ▸ Import page contract.- *- * Source-oriented like the neighboring settings suites: the import destination- * is one workbench per kind (sessions, model configuration, skills, MCP), and- * the regressions this guards are structural — four stacked scan cards coming- * back, a hidden tab panel that the author's own `display: flex` keeps laid- * out, rows losing their tile/typography tokens, or a kind losing the scan that- * belongs to it.- */-import { readSettingsSourceSync } from "./helpers/source-contracts.mjs";-import { loadStylesSync } from "./helpers/styles.mjs";import assert from "node:assert/strict";+import { readFileSync } from "node:fs";import test from "node:test";+import { fileURLToPath } from "node:url";+import { loadStylesSync } from "./helpers/styles.mjs";-const settings = readSettingsSourceSync();+const here = new URL(".", import.meta.url);+const read = (path) => readFileSync(fileURLToPath(new URL(path, here)), "utf8");+const settingsPage = read("../src/features/settings/SettingsPage.tsx");+const settingsSearch = read("../src/lib/settings-search.ts");+const modelPage = read("../src/components/settings/ModelConfigPage.tsx");+const skillsPage = read("../src/components/settings/AgentSkillsPage.tsx");+const mcpPage = read("../src/components/settings/AgentMcpPage.tsx");+const modelImport = read("../src/features/settings/imports/ModelConfigImportPanel.tsx");+const skillImport = read("../src/features/settings/imports/AgentSkillImportPanel.tsx");+const mcpImport = read("../src/features/settings/imports/AgentMcpImportPanel.tsx");+const workbench = read("../src/features/settings/import-workbench.tsx");const styles = loadStylesSync();-const start = settings.indexOf(" * Settings ▸ Import.");-assert.ok(start > 0, "import page module missing from the settings domain");-const end = settings.indexOf("\n/* features/settings/", start);-const page = settings.slice(start, end === -1 ? undefined : end);-function cssRule(selector) {const from = styles.indexOf(`\n${selector} {`);assert.ok(from >= 0, `${selector} rule missing`);return styles.slice(from, styles.indexOf("}", from));}-test("import is one workbench per kind instead of four stacked scan cards", () => {- // One tab strip owns the four kinds; each kind gets one panel behind it.- assert.match(page, /role="tablist"/);- assert.match(page, /id: `import-tab-\$\{entry\.id\}`/);- assert.match(page, /controls: `import-panel-\$\{entry\.id\}`/);- assert.match(page, /aria-labelledby={`import-tab-\$\{entry\.id\}`}/);+test("settings no longer exposes a standalone import or session-import destination", () => {+ assert.doesNotMatch(settingsSearch, /id: "import"/);+ assert.doesNotMatch(settingsPage, /ImportSection|tab === "import"/);+ assert.doesNotMatch(read("../src/features/settings/import-page.tsx"), /SessionImportPanel/);+});- // One toolbar and one idle state per kind — not per section or per step.- assert.equal((page.match(/<ImportToolbar/g) ?? []).length, 4);- assert.equal((page.match(/<ImportIdle/g) ?? []).length, 4);+test("model, skills, and MCP imports are available from their own settings pages", () => {+ assert.match(modelPage, /ImportToggleButton/);+ assert.match(modelPage, /<ModelConfigImportPanel \/>/);+ assert.match(modelImport, /api\.scanImportModelConfigs\(\)/);- // The retired anatomy: a lone Scan card per kind, a bare empty div, a tinted- // group strip, and a second copy of the settings row scaffold.- assert.doesNotMatch(page, /settings-empty/);- assert.doesNotMatch(page, /<SettingsCard/);- assert.doesNotMatch(page, /import-group-title/);- assert.doesNotMatch(page, /settings-description/);-});+ assert.match(skillsPage, /ImportToggleButton/);+ assert.match(skillsPage, /<AgentSkillImportPanel/);+ assert.match(skillsPage, /level=\{targetLevel\}/);+ assert.match(skillImport, /api\.scanExternalSkills\(/);+ assert.match(skillImport, /level,\s*\.\.\./);-test("every kind keeps its own scan and its state across a tab switch", () => {- for (const call of [- "scanImportSessions",- "scanImportModelConfigs",- "scanExternalSkills",- "scanExternalMcp",+ assert.match(mcpPage, /ImportToggleButton/);+ assert.match(mcpPage, /<AgentMcpImportPanel/);+ assert.match(mcpPage, /level=\{targetLevel\}/);+ assert.match(mcpImport, /api\.scanExternalMcp\(/);+ assert.match(mcpImport, /level,\s*\.\.\./);++ for (const [source, panelId] of [+ [modelPage, "model-config-import-panel"],+ [skillsPage, "agent-skills-import-panel"],+ [mcpPage, "agent-mcp-import-panel"],]) {- assert.match(page, new RegExp(`api\\.${call}\\(`), `${call} missing`);+ assert.match(source, /onClick=\{\(\) => setImportOpen\(\(current\) => !current\)\}/);+ assert.match(source, new RegExp(`id="${panelId}"`));+ assert.match(source, /hidden=\{!importOpen\}/);}- // No kind may start another kind's scan.- assert.match(page, /api\.scanImportSessions\(\)/);- assert.match(page, /settings\.importCodexCapped/);- assert.match(page, /api\.scanExternalMcp\(\)/);-+});- // Panels stay mounted and only `hidden` takes the inactive one out of view.- assert.match(page, /hidden={kind !== entry\.id}/);- assert.match(cssRule(".import-view[hidden]"), /display:\s*none/);+test("capability imports follow the selected project and reset when scope changes", () => {+ for (const source of [skillsPage, mcpPage]) {+ assert.match(source, /key=\{`\$\{targetLevel\}:/);+ assert.match(source, /projectPath=\{targetLevel === "project" \? selectedProjectPath/);+ assert.match(source, /disabled=\{targetLevel === "project" && !selectedProjectPath\}/);+ }+ assert.match(skillImport, /level === "project" && projectPath/);+ assert.match(mcpImport, /level === "project" && projectPath/);});-test("import rows are tiles with token typography and quiet group labels", () => {+test("shared inline workbench retains accessible selection and importer controls", () => {+ assert.match(workbench, /<Checkbox/);+ assert.match(workbench, /aria-expanded=\{open\}/);+ assert.match(workbench, /settings\.importSelected/);+ assert.doesNotMatch(workbench, /<input\s+type="checkbox"/);+assert.match(cssRule(".import-row"), /background:\s*var\(--ds-tile\)/);assert.match(cssRule(".import-row:hover"), /var\(--ds-tile-hover\)/);- assert.match(- cssRule(".import-row:has(input:checked)"),- /var\(--ds-tile-deep\)/,- "selection must stay tonal",- );assert.match(cssRule(".import-row-title"), /font-size:\s*var\(--text-md\)/);assert.match(cssRule(".import-row-meta"), /font-size:\s*var\(--text-2xs\)/);-- // The group header is a quiet label line, not a tinted 13.5px band.- const label = cssRule(".import-group-name");- assert.match(label, /font-size:\s*var\(--text-2xs\)/);- assert.match(label, /text-transform:\s*uppercase/);- assert.doesNotMatch(cssRule(".import-group-header"), /background:/);-- // Latin micro-style relaxes where CJK has no case and wide tracking.- assert.match(styles, /:lang\(zh-CN\) \.import-group-name/);- assert.match(styles, /:lang\(zh-TW\) \.import-group-name/);-- // The list dissolves so each row is its own tile (D297).- const panel = cssRule(".settings-panel.import-panel");- assert.match(panel, /background:\s*transparent/);- assert.match(cssRule(".import-idle"), /background:\s*var\(--ds-tile\)/);- assert.match(cssRule(".import-empty"), /background:\s*var\(--ds-tile\)/);-});--test("the toolbar is one dense row: counts left, options and actions right", () => {- assert.match(page, /className="import-select-all"/);- assert.match(page, /className="import-count"/);- assert.match(page, /import-count-selected/);assert.match(cssRule(".import-toolbar-actions"), /margin-left:\s*auto/);- assert.match(cssRule(".import-toolbar-actions > .btn"), /min-height:\s*28px/);- assert.match(cssRule(".import-option-select .settings-menu-select-trigger"), /height:\s*28px/);- // The kind options stay real menu selects, never platform-drawn selectors.- assert.match(page, /<SettingsMenuSelect/);- assert.doesNotMatch(page, /<select/);-});--test("every kind's group label line discloses its own rows", () => {- // One shared hook and four kinds: a group header may not become a label with- // no disclosure, and no kind may keep a private copy of the state.- assert.equal((page.match(/useGroupDisclosure\(\)/g) ?? []).length, 5);- assert.equal(- (page.match(/onToggle=\{\(\) => disclosure\.toggle\(/g) ?? []).length,- 4,- );- assert.doesNotMatch(page, /onToggle=\{\(\) => undefined\}/);- assert.doesNotMatch(page, /collapsedGroups/);});diff --git a/apps/desktop/test/settings-import-workbench.test.mjs b/apps/desktop/test/settings-import-workbench.test.mjsnew file mode 100644index 000000000..c6f1821d7--- /dev/null+++ b/apps/desktop/test/settings-import-workbench.test.mjs@@ -0,0 +1,56 @@+import assert from "node:assert/strict";+import test from "node:test";+import { createElement } from "react";+import { renderToStaticMarkup } from "react-dom/server";+import { createInstance } from "i18next";+import { I18nextProvider } from "react-i18next";+import { catalogs } from "@pi-desktop/i18n";+import { createServer } from "vite";+import { fileURLToPath } from "node:url";++test("inline import disclosure exposes state and forwards the user's toggle", async () => {+ const server = await createServer({+ root: fileURLToPath(new URL("..", import.meta.url)),+ configFile: false,+ server: { middlewareMode: true, hmr: false, ws: false },+ esbuild: { jsx: "automatic" },+ appType: "custom",+ optimizeDeps: { noDiscovery: true, include: [] },+ });++ try {+ const { ImportToggleButton } = await server.ssrLoadModule(+ "/src/features/settings/import-workbench.tsx",+ );+ const i18n = createInstance();+ await i18n.init({+ lng: "en",+ resources: { en: { translation: catalogs.en } },+ });+ let toggles = 0;+ const props = {+ open: false,+ controls: "agent-skills-import-panel",+ label: "Scan other tools",+ onClick: () => { toggles += 1; },+ };+ const render = (open) => renderToStaticMarkup(+ createElement(+ I18nextProvider,+ { i18n },+ createElement(ImportToggleButton, { ...props, open }),+ ),+ );++ assert.match(render(false), /aria-expanded="false"/);+ assert.match(render(false), /aria-controls="agent-skills-import-panel"/);+ assert.match(render(true), /aria-expanded="true"/);+ assert.match(render(true), />Scan other tools<\/button>/);++ const button = ImportToggleButton(props);+ button.props.onClick();+ assert.equal(toggles, 1, "activating the disclosure reaches the owning page");+ } finally {+ await server.close();+ }+});diff --git a/apps/desktop/test/settings-inline-import-user-path.test.mjs b/apps/desktop/test/settings-inline-import-user-path.test.mjsnew file mode 100644index 000000000..5c3340a8a--- /dev/null+++ b/apps/desktop/test/settings-inline-import-user-path.test.mjs@@ -0,0 +1,373 @@+import assert from "node:assert/strict";+import { spawn } from "node:child_process";+import { createRequire } from "node:module";+import { cp, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";+import { tmpdir } from "node:os";+import { dirname, join } from "node:path";+import test from "node:test";+import { fileURLToPath } from "node:url";+import { repositoryRoot, resolveElectronBinary } from "../../../scripts/e2e/boot.mjs";++const root = repositoryRoot();+const here = dirname(fileURLToPath(import.meta.url));+const { build } = createRequire(join(root, "packages/agent-runtime/package.json"))("esbuild");++const fixtureSource = String.raw`+import React from "react";+import { createRoot } from "react-dom/client";+import { flushSync } from "react-dom";+import i18n from "i18next";+import { initReactI18next } from "react-i18next";+import { catalogs, flattenCatalog } from "@pi-desktop/i18n";+import { IPC } from "@pi-desktop/shared";+import { SettingsPage } from "../../apps/desktop/src/features/settings/SettingsPage";+import { ToastHost } from "../../apps/desktop/src/components/Toast";+import { useAppStore } from "../../apps/desktop/src/stores/app-store";++const projectPath = "/tmp/pi-settings-inline-import-project";+const candidate = {+ source: "claude-code",+ sourcePath: projectPath + "/.mcp.json",+ id: "fixture-project-server",+ rawKey: "fixture-project-server",+ label: "Workspace Fixture MCP",+ description: "Local fixture server",+ transport: "stdio",+ command: "node",+ args: ["server.js"],+ disabled: true,+ warnings: [],+};+const importedServer = {+ id: candidate.id,+ label: candidate.label,+ level: "project",+ projectPath,+ transport: "stdio",+ command: candidate.command,+ args: candidate.args,+ enabled: false,+ createdAt: "2026-10-04T00:00:00.000Z",+ updatedAt: "2026-10-04T00:00:00.000Z",+};+const project = {+ id: 1,+ path: projectPath,+ name: "Inline Import Project",+ pinned: true,+ createdAt: 0,+ lastOpenedAt: 0,+};+const calls = [];+let imported = false;++// Toast audio is optional feedback; this hidden fixture checks the visible+// toast only and does not emit a sound during the automated UI run.+Object.defineProperty(window, "AudioContext", { configurable: true, value: undefined });+window.piDesktop = {+ platform: "darwin",+ on() { return () => {}; },+ async invoke(channel, ...args) {+ const input = args[0];+ calls.push({ channel, input });+ let data;+ switch (channel) {+ case IPC.invoke.pluginScenicThemesDestinations:+ data = [];+ break;+ case IPC.invoke.projectList:+ data = { projects: [project] };+ break;+ case IPC.invoke.skillList:+ data = { skills: [] };+ break;+ case IPC.invoke.mcpList:+ data = {+ servers: imported && input?.level === "project" ? [importedServer] : [],+ statuses: [],+ };+ break;+ case IPC.invoke.mcpImportScan:+ data = { candidates: imported ? [] : [candidate], sources: [] };+ break;+ case IPC.invoke.mcpImportRun:+ imported = true;+ data = {+ imported: [{ item: input.items[0], server: importedServer }],+ skipped: [],+ failed: [],+ };+ break;+ default:+ throw new Error("Unexpected fixture IPC: " + channel);+ }+ return { ok: true, data };+ },+};++await i18n.use(initReactI18next).init({+ lng: "en",+ fallbackLng: "en",+ keySeparator: false,+ resources: { en: { translation: flattenCatalog(catalogs.en) } },+ interpolation: { escapeValue: false },+});+useAppStore.setState({+ settings: { defaultMode: "agent", theme: "light", language: "en", developerMode: false },+ settingsTab: "skills",+ page: "settings",+ workspace: { path: projectPath, name: project.name },+});+document.documentElement.dataset.theme = "light";+const root = createRoot(document.getElementById("root"));+flushSync(() => root.render(React.createElement(React.Fragment, null,+ React.createElement(SettingsPage),+ React.createElement(ToastHost),+)));++const frame = () => new Promise(requestAnimationFrame);+async function settle() {+ await frame();+ await frame();+}+function requireNode(node, message) {+ if (!node) throw new Error(message);+ return node;+}+function buttons() {+ return [...document.querySelectorAll("button")];+}+function buttonByLabel(label) {+ return buttons().find((button) => button.textContent.trim() === label);+}+async function waitFor(predicate, message) {+ for (let attempt = 0; attempt < 90; attempt += 1) {+ await settle();+ const value = predicate();+ if (value) return value;+ }+ throw new Error(message);+}++window.settingsInlineMcpImportProbe = async () => {+ await waitFor(() => buttonByLabel("MCP"), "MCP destination did not render");+ flushSync(() => requireNode(buttonByLabel("MCP"), "MCP navigation is missing").click());+ await waitFor(+ () => document.querySelector(".agent-capability-segment"),+ "MCP settings page did not open",+ );++ const projectFilter = requireNode(+ [...document.querySelectorAll('.agent-capability-segment button[role="radio"]')]+ .find((button) => button.textContent.trim().startsWith("Project")),+ "Project scope filter is missing",+ );+ flushSync(() => projectFilter.click());+ await settle();+ if (projectFilter.getAttribute("aria-checked") !== "true") {+ throw new Error("Project scope filter did not become active");+ }++ const toggle = requireNode(+ buttonByLabel("Scan other tools"),+ "Inline MCP scan action is missing",+ );+ if (toggle.disabled) throw new Error("Project scan action is disabled for the current project");+ flushSync(() => toggle.click());+ await settle();+ const panel = requireNode(+ document.getElementById("agent-mcp-import-panel"),+ "Inline MCP workbench is missing",+ );+ if (panel.hidden || toggle.getAttribute("aria-expanded") !== "true") {+ throw new Error("Inline MCP workbench did not expand");+ }+ const scanCountBeforeExplicitClick = calls.filter(+ (call) => call.channel === IPC.invoke.mcpImportScan,+ ).length;++ flushSync(() => requireNode(buttonByLabel("Scan"), "Scan button is missing").click());+ await waitFor(+ () => document.querySelector(".import-row input[type=checkbox]"),+ "Explicit MCP scan did not render its candidate",+ );+ const candidateRow = requireNode(+ [...document.querySelectorAll(".import-row")]+ .find((row) => row.textContent.includes(candidate.label)),+ "Scanned MCP candidate is not visible",+ );+ const candidateCheckbox = requireNode(+ candidateRow.querySelector('input[type="checkbox"]'),+ "Scanned MCP candidate checkbox is missing",+ );+ flushSync(() => candidateCheckbox.click());+ await settle();++ const importButton = requireNode(+ buttons().find((button) => button.textContent.trim() === "Import selected (1)"),+ "Import selected action did not enable after selecting the candidate",+ );+ flushSync(() => importButton.click());+ await waitFor(+ () => [...document.querySelectorAll(".toast-message")]+ .find((node) => node.textContent.trim() === "Import done: 1 imported, 0 skipped, 0 failed"),+ "Successful import result was not shown",+ );+ await waitFor(+ () => [...document.querySelectorAll(".agent-capability-row .agent-capability-name")]+ .find((node) => node.textContent.trim() === candidate.label),+ "Imported MCP server did not appear in the selected project list",+ );++ const runCall = calls.find((call) => call.channel === IPC.invoke.mcpImportRun);+ const scanCalls = calls.filter((call) => call.channel === IPC.invoke.mcpImportScan);+ const visibleRow = [...document.querySelectorAll(".agent-capability-row")]+ .find((row) => row.querySelector(".agent-capability-name")?.textContent.trim() === candidate.label);+ return {+ scanCountBeforeExplicitClick,+ scanCalls,+ runCall,+ visibleToast: [...document.querySelectorAll(".toast-message")]+ .map((node) => node.textContent.trim())+ .find((message) => message.startsWith("Import done:")),+ visibleImportedServer: Boolean(visibleRow),+ importedServerDisabled: visibleRow?.classList.contains("is-off") ?? false,+ };+};+`;++const urlAssets = {+ name: "local-url-assets",+ setup(pluginBuild) {+ pluginBuild.onResolve({ filter: /\?url$/ }, ({ path, resolveDir }) => ({+ path: join(resolveDir, path.slice(0, -4)),+ namespace: "local-url-asset",+ }));+ pluginBuild.onLoad({ filter: /.*/, namespace: "local-url-asset" }, async ({ path }) => ({+ contents: await readFile(path),+ loader: "file",+ }));+ },+};++test("Settings MCP page imports a selected external server into the chosen project", {+ timeout: 60_000,+ skip:+ process.platform === "linux" && !process.env.DISPLAY+ ? "Isolated Electron UI test requires a display"+ : false,+}, async () => {+ const temp = await mkdtemp(join(tmpdir(), "pi-settings-inline-mcp-import-"));+ try {+ await build({+ stdin: {+ contents: fixtureSource,+ resolveDir: join(root, "scripts", "e2e"),+ sourcefile: join(root, "scripts", "e2e", "settings-inline-mcp-import.jsx"),+ loader: "tsx",+ },+ outfile: join(temp, "renderer.js"),+ bundle: true,+ platform: "browser",+ format: "esm",+ jsx: "automatic",+ define: { "process.env.NODE_ENV": '"production"', "import.meta.env.DEV": "true" },+ alias: {+ "@pi-desktop/i18n": join(root, "packages/i18n/src"),+ react: join(root, "apps/desktop/node_modules/react"),+ "react-dom": join(root, "apps/desktop/node_modules/react-dom"),+ i18next: join(root, "apps/desktop/node_modules/i18next"),+ "react-i18next": join(root, "apps/desktop/node_modules/react-i18next"),+ },+ nodePaths: [join(root, "apps/desktop/node_modules")],+ plugins: [urlAssets],+ });++ const renderer = join(root, "apps/desktop/out/renderer");+ const rendererHtml = await readFile(join(renderer, "index.html"), "utf8");+ const css = [...rendererHtml.matchAll(/href="([^" ]+\.css)"/g)]+ .map((match) => match[1]);+ assert(css.length, "Run pnpm --filter @pi-desktop/desktop build before this test");+ await cp(join(renderer, "assets"), join(temp, "assets"), { recursive: true });+ await writeFile(+ join(temp, "index.html"),+ `<!doctype html><html data-platform="darwin"><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:">${css.map((path) => `<link rel="stylesheet" href="${path}">`).join("")}</head><body><div id="root"></div><script type="module" src="renderer.js"></script></body></html>`,+ );+ await writeFile(+ join(temp, "main.cjs"),+ `+const { app, BrowserWindow } = require("electron");+const path = require("node:path");+app.setPath("userData", path.join(__dirname, "profile"));+app.whenReady().then(async () => {+ const win = new BrowserWindow({ show: false, width: 1100, height: 760,+ webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false, backgroundThrottling: false } });+ win.webContents.on("console-message", (event) => console.error(event.message));+ try {+ await win.loadFile(path.join(__dirname, "index.html"));+ const result = await win.webContents.executeJavaScript("window.settingsInlineMcpImportProbe()");+ console.log("SETTINGS_INLINE_MCP_IMPORT " + JSON.stringify(result));+ app.exit(0);+ } catch (error) {+ console.error(error?.stack ?? error);+ app.exit(1);+ }+});+`,+ );++ const env = { ...process.env };+ delete env.ELECTRON_RUN_AS_NODE;+ const child = spawn(resolveElectronBinary(root).electronBinary, [join(temp, "main.cjs")], {+ env,+ stdio: ["ignore", "pipe", "pipe"],+ });+ let output = "";+ for (const stream of [child.stdout, child.stderr]) {+ stream.setEncoding("utf8");+ stream.on("data", (chunk) => { output += chunk; });+ }+ const timer = setTimeout(() => child.kill("SIGKILL"), 30_000);+ let code;+ try {+ code = await new Promise((resolve, reject) => {+ child.once("error", reject);+ child.once("close", resolve);+ });+ } finally {+ clearTimeout(timer);+ }+ assert.equal(code, 0, output);+ const resultLine = output.split(/\r?\n/)+ .find((line) => line.startsWith("SETTINGS_INLINE_MCP_IMPORT "));+ assert(resultLine, output);+ const result = JSON.parse(resultLine.slice("SETTINGS_INLINE_MCP_IMPORT ".length));++ assert.equal(result.scanCountBeforeExplicitClick, 0, "Expanding the inline panel must not scan");+ assert.equal(result.scanCalls.length, 2, "The explicit scan and post-import refresh should run");+ assert.deepEqual(result.scanCalls[0].input, {+ projectPath: "/tmp/pi-settings-inline-import-project",+ });+ assert.deepEqual(result.runCall.input, {+ level: "project",+ projectPath: "/tmp/pi-settings-inline-import-project",+ items: [{+ source: "claude-code",+ sourcePath: "/tmp/pi-settings-inline-import-project/.mcp.json",+ id: "fixture-project-server",+ rawKey: "fixture-project-server",+ label: "Workspace Fixture MCP",+ description: "Local fixture server",+ transport: "stdio",+ command: "node",+ args: ["server.js"],+ disabled: true,+ }],+ });+ assert.equal(result.visibleToast, "Import done: 1 imported, 0 skipped, 0 failed");+ assert.equal(result.visibleImportedServer, true);+ assert.equal(result.importedServerDisabled, true);+ } finally {+ await rm(temp, { recursive: true, force: true });+ }+});diff --git a/docs/adr/0179-import-model-configuration.md b/docs/adr/0179-import-model-configuration.mdindex 908b7cecd..241ec360b 100644--- a/docs/adr/0179-import-model-configuration.md+++ b/docs/adr/0179-import-model-configuration.md@@ -1,6 +1,7 @@# ADR 0179: Import model configuration from local agent stores-- Status: Accepted+- Status: Accepted for model import semantics; original Settings placement+ superseded by ADR 0319 / D645- Date: 2026-09-08- Deciders: PI-Desktop core- Related: D007, D342, ADR 0012,@@ -10,10 +11,10 @@## Context-Settings → Import already scans Claude Code, Codex, OpenCode, and Pi session-stores. The same tools keep provider URLs, model ids, and often API keys in-well-known files. Users who switch to PI-Desktop otherwise retype those-endpoints on Settings → Models.+At the time this decision was recorded, Settings → Import scanned Claude Code,+Codex, OpenCode, and Pi session stores. The same tools keep provider URLs,+model ids, and often API keys in well-known files. Users who switch to+PI-Desktop otherwise retype those endpoints on Settings → Models.D007 forbids auto-import of `~/.pi` so PI-Desktop owns `~/.pi-desktop`. Thatmust stay true for model configuration: a scan is an explicit action, and@@ -28,8 +29,11 @@ credentials. Copying refresh tokens would be the wrong security boundary.## Decision-1. **Settings → Import** gains a second card, Model configuration, with its- own Scan / selection / Import selected. Session import is unchanged.+1. The original placement was a Model configuration card under+ **Settings → Import**, with its own Scan / selection / Import selected.+ ADR 0319 / D645 supersedes that placement and retires the Settings+ session-import UI. The model scan/import semantics below remain in force;+ plugin session-import contracts remain unchanged.2. **Sources** (same family as session import):- Claude Code: `~/.claude/settings.json` plus `settings.local.json`diff --git a/docs/adr/0319-settings-inline-imports.md b/docs/adr/0319-settings-inline-imports.mdnew file mode 100644index 000000000..227e0ee6c--- /dev/null+++ b/docs/adr/0319-settings-inline-imports.md@@ -0,0 +1,33 @@+# Inline External Imports in Owning Settings Destinations++**Status:** Accepted+**Date:** 2026-10-04+**Decision:** D645++## Context++Settings had one Import destination combining four independent workflows:+session import, model configuration import, external skill import, and+external MCP import. The model and agent capability destinations already own+the records those imports create. Session import is also available through the+plugin session API, so the Settings scanner duplicates a workflow without+being the only supported entry point.++## Decision++Remove the standalone Settings Import destination and move external model,+skill, and MCP scan panels into their corresponding Settings pages. Each scan+remains explicit. Skills and MCP imports use the selected global/project+filter as their destination; project imports carry the selected project path.++Remove the Settings session-import UI. Keep existing plugin session import,+host RPC, IPC, and persistence behavior unchanged.++## Consequences++- The Settings rail and search no longer expose an Import destination.+- Models, Skills, and MCP each expose their importer from their owning page.+- Import candidates and selected rows stay within one capability scope; a+ scope change clears the panel state.+- Existing plugin session import contracts continue to own session ingestion.+- No host protocol, plugin API, permission, or database migration is required.diff --git a/docs/adr/README.md b/docs/adr/README.mdindex 753634d3a..74ad46b83 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -359,3 +359,4 @@ Each ADR includes:| image-generation-capability | [Image generation as a configured Agent capability](image-generation-capability.md) | Accepted || retained-browser-pages-per-tab | [Retain a host-owned browser page per resource tab](retained-browser-pages-per-tab.md) | Accepted || 0318 | [Publish native Linux arm64 artifacts](0318-linux-arm64-release-lane.md) | Accepted (D638) |+| 0319 | [Inline external imports in owning Settings destinations](0319-settings-inline-imports.md) | Accepted (D645) |diff --git a/docs/spec/00-baseline.md b/docs/spec/00-baseline.mdindex 515567513..6a1869a13 100644--- a/docs/spec/00-baseline.md+++ b/docs/spec/00-baseline.md@@ -1,7 +1,7 @@# PI-Desktop Baseline Freeze-- Baseline Version: `0.4.20`-- Date: `2026-10-02`+- Baseline Version: `0.4.21`+- Date: `2026-10-04`- Status: `Frozen for implementation details (indefinite local permission approvals + Plan checkpoint artifact + approval/execution startup fence + protocol v11 + schema v16 + host-owned plugin session import/read/update/delete P0/P1 + selectable shell catalog + icon-free composer prompt row + turn-boundary context checkpoint compaction + session-scoped work panel + edge-specific work-panel/chat resize ownership + models.dev chat model catalog + provider/runtime safety + M5 hardening + settings IA + project archive + sidebar organization + app update delivery + three-platform release + Extensions page density and theme-readable actions + custom global UI font + ChatGPT-style logical project groups)`- Language policy: **English-first**- Backend policy: **Rust host core + pi agent sidecar**@@ -37,6 +37,10 @@> safe unanimous third-party matches as fallback. Pi remains the OAuth,> transport and typed non-chat operation layer; it no longer supplies sibling> chat-model limits.+> `0.4.21` removes the standalone Settings Import destination. Model, skill,+> and MCP scans live inside their owning settings pages, while session import+> remains available to plugins through the existing plugin API (D645 / ADR+> 0319).> `0.4.10` replaces destructive work-panel clearing on conversation switches> with runtime session-scoped contexts through D142 / ADR 0028.> `0.4.11` adopts turn-boundary model-context checkpoint compaction through@@ -165,7 +169,9 @@37. Secrets backend: **safeStorage primary + encrypted file fallback**38. Workspace ignore: **denylist + defaults + `.pi-desktopignore`**39. Tool result limits: **per-tool budgets (128KB / 4000 lines search, 96KB / 4000 lines shell); `truncated` only when a result is cut short**-40. Settings directory: **Basics / Model configuration / Import / Project archive / Info**;+40. Settings directory: **General / AI / Shortcuts / Instructions / Models / Skills / MCP / Subagents / Project archive / Cloud sync / Remote Hosts / Info**;+ external model, skill, and MCP scans live in their owning pages; session+ import is plugin-owned;the project archive owns durable project discovery, archive, restore, andreopen workflows;plugin management remains the app shell's independent **Plugins** destinationdiff --git a/docs/spec/03-runtime/11-provider-model-system.md b/docs/spec/03-runtime/11-provider-model-system.mdindex 37ab8db4b..68c45783a 100644--- a/docs/spec/03-runtime/11-provider-model-system.md+++ b/docs/spec/03-runtime/11-provider-model-system.md@@ -550,13 +550,13 @@ type ModelDescriptor = {- keep model cards compact by default, expand metadata/configuration on demand,and keep dialog actions outside the independently scrollable content- do not expose raw catalog compatibility internals or provider secrets-- Settings → Import can copy provider/model rows from Claude Code, Codex,- OpenCode, Pi, and CC Switch. The scan is explicit. Stored API keys are- copied into the host secret store; OAuth/subscription grants are not.- An equivalent provider (normalized URL + API style + same credential) is- skipped on re-import. Different credentials at one endpoint remain- independent providers. No protocol or schema version bump- (D342 / ADR 0179 / ADR 0188).+- Settings → Models → Providers can scan and copy provider/model rows from+ Claude Code, Codex, OpenCode, Pi, and CC Switch. The inline scan is explicit.+ Stored API keys are copied into the host secret store; OAuth/subscription+ grants are not. An equivalent provider (normalized URL + API style + same+ credential) is skipped on re-import. Different credentials at one endpoint+ remain independent providers. No protocol or schema version bump+ (D342 / ADR 0179 / ADR 0188 / D645).### Model selector- search all models across enabled providersdiff --git a/docs/spec/04-ux/01-ui-ia.md b/docs/spec/04-ux/01-ui-ia.mdindex ff739fa42..3a56d0127 100644--- a/docs/spec/04-ux/01-ui-ia.md+++ b/docs/spec/04-ux/01-ui-ia.md@@ -337,12 +337,11 @@ changes the page destination rather than a tab inside a shared capability panel.Appearance lives inside General; global AI behavior (permissions and contextmanagement) lives inside 全局 AI; keyboard shortcuts and global/projectinstructions have their own destinations; provider management lives inside-Model configuration. Import scans supported local agent stores for sessions-and, independently, for model configuration, and presents candidates in-collapsible groups. Project path is an alternate grouping for sessions-alongside the default source grouping, and every scan or grouping change starts-with all groups collapsed. Model-configuration import copies stored API keys-and skips subscription logins. Project archive owns the durable D086 Projects index+Model configuration. Models, Skills, and MCP each open their external-store+import workbench inline within the owning Settings destination; scans start+only when the user asks. Skills and MCP imports follow the current Global /+Project filter and selected project. Session import is provided through the+plugin API rather than a Settings destination. Project archive owns the durable D086 Projects index(search, add, expand, pin, archive/restore, close, and reopen) and always includesarchived records. Opening or switching a project retains a sidebar tab, selectsthat project as the active workspace, and returns to chat. Other retained tabs@@ -354,16 +353,17 @@ shared capability contract:scope note, then uses the same neutral elevated Settings surface as the otherdestinations; no capability page has a decorative hero, colored top bar, orseparate visual theme.-- Skills and MCP use stacked global/project card blocks in one column. Each- block has a quiet heading row with a scope title, scope description,- resolved `.agents` path, localized count, and its actions; the project- block shows a recent-project picker. Project records take precedence over- global records.-- Skills have one native **Import** action per surface. It accepts exactly one- file and physically copies it into the selected `.agents/skills` directory.+- Skills and MCP use one list filtered by Global / Project in a shared toolbar.+ The toolbar has a project picker and the current filter determines which+ capability rows and creation/import destination are active.+- Skills keep native file and folder import actions in each level group and+ provide **Scan other tools** in the page toolbar. External skill imports use+ the active filter and preserve the selected project's scope.- MCP has one **Add** action per surface. Add and Edit open the existing`McpEditorSheet` as a modal overlay with stdio/HTTP branches, validation,duplicate checks, locked edit ids, scope text, and Test connection feedback.+ **Scan other tools** opens the external MCP workbench inline and uses the+ active Global / Project filter and selected project for its import target.- Subagents use one full-width global surface under `~/.agents/subagents`; theyhave no project picker, project surface, or project-level toggle. Creating orediting a subagent picks the pinned model from configured provider models, ordiff --git a/docs/spec/04-ux/06-settings-ia.md b/docs/spec/04-ux/06-settings-ia.mdindex c4d6e0cba..af701672d 100644--- a/docs/spec/04-ux/06-settings-ia.md+++ b/docs/spec/04-ux/06-settings-ia.md@@ -53,18 +53,17 @@ Settings is a **full-window page** that replaces the app sidebar + main chrome (6. **Skills / 技能** — Lucide `BookOpen` (reusable agent instructions)7. **MCP** — Lucide `Server` (agent connections)8. **Subagents / 子智能体** — Lucide `Bot` (built-in and personal parallel agents)- 9. **Import / 导入** — Lucide `Download` (bring sessions and model configuration in from other tools)- 10. **Projects / 项目** — Lucide `Archive` (durable project index)- 11. **Cloud sync / 云同步** — Lucide `CloudDownload` (encrypted portable configuration backup and bidirectional sync)- 12. **Remote Hosts / 远程主机** — Lucide `Globe` (SSH bootstrap and pairing inventory; developer mode only)- 13. **Info / 信息** — Lucide `Info` (versions, logs, updates, developer)+ 9. **Projects / 项目** — Lucide `Archive` (durable project index)+ 10. **Cloud sync / 云同步** — Lucide `CloudDownload` (encrypted portable configuration backup and bidirectional sync)+ 11. **Remote Hosts / 远程主机** — Lucide `Globe` (SSH bootstrap and pairing inventory; developer mode only)+ 12. **Info / 信息** — Lucide `Info` (versions, logs, updates, developer)Icons are decorative (`aria-hidden` via the SVG default) and stay monochromewith the rail label; do not reuse refresh/rotate glyphs here.- The directory remains a flat searchable list in the same exact order. Forscanability, the destinations are shown in four titled visual clusters:`Preferences` / `偏好` (General, AI, Shortcuts), `Agent` / `智能体`(Instructions, Models, Skills, MCP, Subagents), `Workspace` / `工作区`- (Import, Projects), and `System` / `系统` (Cloud sync, Remote Hosts, Info;+ (Projects), and `System` / `系统` (Cloud sync, Remote Hosts, Info;Remote Hosts is developer-only). Headings aremuted, non-interactive labels and use whitespace for separation; no dividerlines are rendered. These are visual landmarks only, not a second navigation@@ -528,6 +527,11 @@ a usage tab.- vendor-account rows are not rendered in the AI services list; a connectedvendor account can still be selected in Defaults and is managed only in theVendor accounts card+ - the Providers section header has an **Import from other tools** action.+ Its inline panel scans only after the user starts a scan, groups local+ provider drafts by source, and never renders raw credentials. Stored API+ keys are written to the host secret store; subscription/OAuth logins are+ not imported. Re-importing an equivalent provider is skipped.The permission-mode selector remains available in the composer while thesession is in Agent, Plan, or Goal. In Plan and Goal it controls Bash@@ -615,7 +619,7 @@ system while preserving their different data ownership:the width with evenly divided segments, search sits below it, and theactions wrap left-aligned. Group headers drop the resolved path so row copykeeps the width.-- Skills exposes a Market action beside New / Import. Market is a second view+- Skills exposes a Market action beside New and Scan other tools. Market is a second viewof the same page, not a new Settings destination: browse catalog sources,preview the assembled markdown (including inlined sibling `.md` files), andinstall through `skills.create` into `~/.agents/skills`. Built-in picks are@@ -628,6 +632,14 @@ system while preserving their different data ownership:guard says so instead of calling every source unreachable, because a proxieduser sees that refusal while the same URL opens in their browser (ADR 0177).Back reloads the skill list.+- Skills also exposes **Scan other tools** in its toolbar. The explicit scan+ opens inline on the Skills page, and imported entries follow the current+ Global / Project filter and selected project. The native file and folder+ import actions remain available in their level groups.+- MCP exposes **Scan other tools** beside Add and Market. The explicit scan+ opens inline on the MCP page. Imported servers follow the current Global /+ Project filter and selected project; secrets and header values are never+ shown in candidate rows.- The Subagents create/edit sheet pins a model with a searchable, provider-grouped anchored menu — the same option-menu control the service picker uses— over the configured, runnable models the Composer offers, plus an@@ -690,33 +702,16 @@ system while preserving their different data ownership:instruction API; project instructions remain managed from the active projectmenu and are resolved after the global layer.-### Import-- Scan supported local agent stores for **sessions**, **model configuration**,- **skills**, and **MCP servers** through one workbench per kind behind the- page's kind switcher. Every kind keeps its own explicit scan: none of them- runs automatically, and switching kinds never starts one (D007 / D342).-- Sessions: review candidates through `SessionImportPanel`. Source and- project-path grouping behavior follows- [08-component-spec §18](08-component-spec.md#18-import-destination).- The Group-by control is the same in-app menu select as the Appearance and- Permissions pickers, not a platform-drawn `<select>`. A Codex archive larger- than `CODEX_SCAN_MAX_FILES` (250) is truncated to the newest session files by- `YYYY/MM/DD` path date; the workbench shows a localized cap note, and omitted- Codex files are not in that candidate list.--- Model configuration: review provider drafts through- `ModelConfigImportPanel`- ([08-component-spec §18.5](08-component-spec.md#185-modelconfigimportpanel)).- Stored API keys from those configs are copied into the host secret store;- subscription/OAuth logins are not copied. CC Switch (`~/.cc-switch`) is- scanned as its own source so saved profiles, not only the currently- applied live file, can be imported. Re-importing an equivalent provider- (same normalized base URL, API style, and credential) is skipped; profiles- with different credentials at one endpoint remain separate. If the app has- no default model yet, the first newly created provider becomes the default.-- Skills and MCP servers reuse the agent capability scanners and their source- labels. The skills kind carries the import mode (copy or symlink); the MCP- kind writes into the same MCP list the MCP destination manages.+### Inline import workbenches+- Model configuration, external skills, and external MCP scans live inside+ Models, Skills, and MCP respectively. Each page keeps an explicit scan and+ selection panel; opening or closing the panel never starts a scan.+- Skills and MCP imports use the destination selected by the page's current+ Global / Project filter. Project scans and writes carry the selected project+ path, and the scan panel resets when that scope changes.+- Settings has no session-import panel. Session ingestion is available to+ plugins through the existing host-owned plugin session API; project binding+ and refresh behavior remain documented with the plugin session contracts.### Project archive- Reuses the durable Projects index as a settings-scale management surface@@ -738,7 +733,7 @@ system while preserving their different data ownership:in the iOS sense: the selected row is the header of its own card, so thedetail opens under the row and repeats nothing the row already states. Onetoolbar leads the page and nothing is expanded in it: like the capability and- Import destinations, the destination carries no description line, so no+ inline import workbenches, the destination carries no description line, so nosentence sits between the page title and the controls. It reuses the samecomposition, control height, and row rhythm as the agent capability pages(D257) and adds no page-specific chrome.@@ -845,7 +840,7 @@ system while preserving their different data ownership:2. Rail shows the search pill at the top, the back-to-app action pinned at thefoot on the main sidebar's footer icon line, and exactly General / 常规, AI,Shortcuts / 快捷键, Instructions / 指令, Models / 模型, Skills / 技能, MCP,- Subagents / 子智能体, Import / 导入, Projects / 项目, Cloud sync / 云同步,+ Subagents / 子智能体, Projects / 项目, Cloud sync / 云同步,Remote Hosts / 远程主机, and Info / 信息 in that order. Cloud sync / 云同步 isavailable to every user; Remote Hosts appears only in developer mode. Voiceappears between AI and Shortcuts only in development builds with developerdiff --git a/docs/spec/04-ux/07-ui-design-system.md b/docs/spec/04-ux/07-ui-design-system.mdindex 59d2f0cf5..c063b71cb 100644--- a/docs/spec/04-ux/07-ui-design-system.md+++ b/docs/spec/04-ux/07-ui-design-system.md@@ -1434,11 +1434,10 @@ is reserved for non-Settings contexts where OS-level rendering is acceptable.per D092, the content cards fill the pane width available from the currentwindow instead of retaining D070's fixed 720px cap — the earlier in-shell200px rail and broad grouped directory are superseded-- **Import**: four kinds (sessions / models / skills / MCP) behind one- page-scale segmented switcher, composed like the agent capability pages: a- quiet pre-scan next-action state per kind, one toolbar per kind (select-all- with both counts, the kind's own option, re-scan, import selected), and one- list whose group headers are quiet label lines and whose candidates are- individual tiles. No per-kind scan card, no tinted group band, no second- copy of the settings row scaffold+- **Inline import workbenches**: model configuration, external skills, and+ external MCP scans live in Models, Skills, and MCP respectively. Each page+ exposes an explicit scan action and an inline selection workbench; opening a+ workbench never scans automatically. Skills and MCP imports follow the+ selected global/project scope. Settings has no session-import destination;+ plugins retain session ingestion through their existing API.- Light destination cards use white elevated plates (not flat gray fills)diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 1624622dc..a12aaba46 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -3721,126 +3721,95 @@ dismissToast(id: number); // ToastHost internal / tests----## 18. Import destination+## 18. Inline import workbenches### 18.1 Purpose-Scan supported local agent stores for the four things this machine can hand-over — sessions, provider/model configuration, skills, and MCP servers — then-review the candidates, select them, and start an explicit import.+Model configuration, external skills, and MCP imports live in the Settings+pages that own the records they create. Settings does not provide a session+import destination; plugin session imports remain available through the plugin+API and keep their existing ownership and project-binding rules.-### 18.2 Anatomy+### 18.2 Shared anatomy-One workbench per kind behind a segmented kind switcher; every kind owns its-own scan, selection, and import action.+Each owning page has an import toggle. The toggle reveals an inline workbench+that remains mounted while closed, preserving a scan result and selection until+the scope changes or the user scans again.```text-[ Sessions | Models | Skills | MCP ] ← kind switcher-[ ] Found 12 · 6 selected Group by: Source ▾ [Scan] [Import selected (6)]-───────────────────────────────────────────────────────────────────────────-CLAUDE CODE ~/code/pi 4-[ ] Refactor the importer 12 messages · Jan 5, 2026 [Claude Code]+Models: Providers [Import from other tools] [Add provider]+Skills: [All | Global | Project] [Search] [Scan other tools] [New] [Market]+MCP: [All | Global | Project] [Search] [Scan other tools] [Add] [Market]++[ ] Found 3 · 1 selected [Scan] [Import selected (1)]+CLAUDE CODE 1+[ ] example-server node [stdio]```-- The switcher reuses the labels the sidebar and the settings rail already ship- (`nav.sessions`, `settings.nav.models`, `settings.nav.skills`,- `settings.nav.mcp`), so the page adds no catalog entries of its own.-- Each kind carries its own toolbar: the select-all checkbox with both the- "found" sentence and the selected count, the kind's own option (session- grouping, skills import mode), re-scan, and Import selected.-- Before a kind's first scan its panel shows a quiet next-action state: what the- scan reads plus the Scan action. Switching tabs never starts a scan- (D007 / D342).-- Group headers are quiet label lines — source or project name, the resolved- path in mono, and a count pill — not tinted bands; the candidates below them- are individual tiles.-- The grouping control supports **Project path** and **Source**. Source is the- default. In project-path mode, exact paths remain visible in group headers,- and sessions without a project path appear in a final **No project** group.-- Import source names, grouping and mode controls, counts, results, and- accessible names come from the shared i18n catalog. Candidate dates use the- active app locale.--### 18.3 States and interactions--- A successful scan replaces the prior candidate set, clears selection, and- shows every group expanded: the found candidates are the answer to the scan,- so they are not hidden behind a second click.-- Codex session discovery walks `~/.codex/sessions/YYYY/MM/DD` newest-path-first- and stops after 250 `.jsonl` files. That order is folder-date lexicographic,- not `updatedAt`. When the cap hits, `session/importScan` returns- `truncated.codex = 250` and the sessions toolbar shows the localized cap note;- older Codex files are absent from the candidate list.--- Every kind scans on its own: a session scan never starts a model-config,- skills, or MCP scan, and switching tabs preserves the result and the- selection of the kind left behind (inactive panels stay mounted and hidden).-- A successful import creates or reuses one durable Projects-index entry for- each distinct non-empty project path and refreshes sessions/projects.-- When a successful core or plugin import adds a project-bound session under an- archived project, the renderer restores that project's presentation state- after the refresh so the project and imported session are visible in the- default sidebar. This applies only to newly added bound sessions; ordinary- refreshes, pathless sessions, and skipped imports preserve archive state.-- Path-less imports create no project entry and remain under Temporary- sessions. Import never creates a physical filesystem directory.-- Re-importing an existing source session skips it without duplicating its- project entry.-- Changing the grouping mode preserves candidate selection and shows every- newly formed group expanded.-- Expanding or collapsing one group does not affect the others.-- Group and global checkboxes support checked, unchecked, and indeterminate- selection states; the global checkbox reports a partial selection as- indeterminate.-- Candidates inside each group and groups themselves are ordered newest first;- the path-less group remains last in project-path mode.--### 18.4 Accessibility--- The kind switcher is a `tablist` of `tab` controls, each carrying- `aria-selected` and `aria-controls` that names its panel. Every panel is a- `tabpanel` labelled by its tab, and an inactive panel is `hidden` rather than- visually covered.-- Each disclosure button exposes `aria-expanded` and references its body with+- Scanning is explicit; opening the panel never starts a scan.+- A successful scan replaces its candidates, clears the selection, and shows+ source groups expanded. Group headers disclose their rows and expose localized+ counts.+- Candidate rows are selectable tiles with source, identity, concise metadata,+ and any kind-specific badge. Secrets are never displayed.+- The toolbar and group checkboxes expose checked, unchecked, and indeterminate+ states. Import remains disabled until at least one candidate is selected.+- A scope change resets the Skills or MCP panel so candidates from one target+ cannot be imported into another by mistake.++### 18.3 Capability scope++- The destination is the current Global / Project filter. The All filter+ targets Global, matching the existing create action.+- Project scope requires a selected project. The import toggle is disabled when+ Project is selected without a project path.+- Project scans receive the selected path, and imports carry both the level and+ path through IPC to host-core. The same scope is used when preserving a+ source MCP server's disabled state.+- Skills keep their existing copy / link mode. A successful import refreshes+ the capability list and scan results.++### 18.4 Accessibility and responsive behavior++- The import toggle is a button with `aria-expanded` and `aria-controls`; its+ controlled panel is hidden when closed.+- Disclosure buttons expose `aria-expanded` and reference their group body with`aria-controls`.-- Global and group checkboxes have localized accessible names and carry the- indeterminate state.-- The grouping and import-mode selectors are the shared in-app menu selects- with visible labels and keyboard operation, never a platform-drawn- `<select>`.-- Group count pills carry the localized count sentence as their title.-- Projects-row disclosure and action-menu buttons expose localized,- project-specific accessible names.+- Global, group, and row checkboxes use the shared checkbox control and carry+ localized accessible names.+- Group labels and counts wrap within the available Settings content width;+ the toolbar actions wrap on narrow windows without horizontal page scrolling.### 18.5 ModelConfigImportPanel-Scan the same local agent stores for provider and model settings, review-candidates grouped by source, select them, and start an explicit import.--```text-[ ] Found 3 · 1 selected [Scan] [Import selected (1)]-───────────────────────────────────────────────────────────────────────────-CLAUDE CODE 1-[ ] acme-gateway 4 models · api.acme.dev [API key]-```--- The kind is independent of session import: its own scan, selection, and- Import selected action. A session scan never starts a model-config scan, and- the two are shown one at a time behind the switcher.-- Source grouping is the only grouping. A successful scan replaces the prior- candidate set, clears selection, and shows every group expanded.-- Each row shows the provider name, model count, host, an API key / No API- key badge, and the source. The raw secret never reaches the renderer.-- Import creates one `providers.create` row per selected candidate. An- existing provider with the same normalized base URL, API style, and- credential is skipped; different credentials at one endpoint create- independent rows. OAuth-only source accounts are omitted from the scan.- CC Switch is a fifth source (`~/.cc-switch/cc-switch.db`); a live tool- file that matches a CC Switch endpoint and credential is not listed twice;- a different credential remains visible.-- If `settings.defaultProviderId` is empty after a successful create, the- first new provider becomes the global default.----+Models exposes model configuration scanning from the Providers section. Scan+candidates from Claude Code, Codex, OpenCode, Pi, and CC Switch. Rows show the+provider name, model count, host, source, and an API key / No API key badge; no+raw secret reaches the renderer. Stored API keys are saved through the host+secret store. OAuth and subscription logins are not copied. Re-importing an+equivalent provider (normalized URL, API style, and credential) is skipped;+different credentials at one endpoint remain separate providers. If no default+model exists after import, the first created provider becomes the default.++### 18.6 External skill import++Skills exposes its external scan from the page toolbar, alongside New and+Market. The scanner covers supported Claude and Pi skill stores. Candidate+rows show the name, description or source path, and file / folder shape. The+copy / link option stays in the workbench. Imported skills follow the selected+Global / Project scope and project path, then the list and scan results refresh.+The native file and folder import actions in the level groups remain available.++### 18.7 External MCP import++MCP exposes its external scan from the page toolbar, alongside Add and Market.+The scanner covers supported Claude Desktop, Claude Code, Cursor, Codex,+OpenCode, and ChatGPT Desktop stores. Candidate rows show a label, safe+metadata, source, and transport. URL metadata is reduced to its host so+userinfo, paths, and query credentials never render; environment and header+values are not shown. Imported servers follow the selected Global / Project+scope and project path. A disabled source server remains disabled after the+host write succeeds.## 19. ProviderStudio (Settings → Agent)diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex c56f2e9fa..a5e54345e 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -2798,41 +2798,53 @@ identify the platform validation still needed.- **Status**: Unit-covered (`session-scratch-path.test.mjs`); desktop journeyDraft (run only in a capable environment when this surface changes)-#### E2E-036: Localized import grouping starts collapsed--- **Tab accessibility**: Switch between the four import kinds in English and- Chinese. Each selected tab keeps its stable `import-tab-*` id and points to- the matching `import-panel-*` through `aria-controls`; that panel points- back through `aria-labelledby`. Inactive panels remain hidden and preserve- their existing state. The shared selection/link contract is covered by- `apps/desktop/test/segmented-control.test.mjs`, with page wiring checked in- `apps/desktop/test/settings-import-page.test.mjs`.-- **Preconditions**: Supported local agent stores contain importable sessions across at least two project paths and two sources, including one session without a project path; the app can be launched once with an English system locale and once with a Simplified Chinese system locale.-- **Steps**: 1) Launch in English and open Settings → Import. 2) Scan for sessions. 3) Inspect the initial source groups. 4) Expand one group and select a session. 5) Change Group by to Project path. 6) Switch back to Source. 7) Repeat the flow after launching with a Simplified Chinese system locale.-- **Expected**: Source/来源 is the initial grouping; all groups are collapsed after the scan and after either grouping change; project-path mode shows exact project paths and a final No project/未关联项目 group; expanding one group leaves the others collapsed; the selected session remains selected across grouping changes; counts, dates, selection labels, accessible names, and the import result use the active locale without raw keys or unresolved double-brace placeholders. A Codex archive above the scan threshold may show an em dash for its unknown message count during review, but it remains selectable and the later import converts the complete transcript. A Codex archive with more than 250 session files shows only the newest 250 by folder date plus a localized cap note; older Codex sessions are absent from that scan.--- **Specs linked**: `04-ux/01-ui-ia.md`, `04-ux/02-i18n-english-first.md`, `04-ux/08-component-spec.md`-- **Acceptance**: F (session import review)-- **Milestone**: M2-- **Status**: Draft+#### E2E-036: Settings session-import destination retired-#### E2E-037: Import creates durable project entries+- **Expected**: Settings has no session-import tab or scan panel. Plugin session+ import remains available through the host-owned API and is covered by+ E2E-214 / E2E-215 / E2E-216. The legacy local-session scanner remains covered+ by its importer unit tests.+- **Specs linked**: `04-ux/06-settings-ia.md`, `04-ux/08-component-spec.md`,+ `07-plugins/03-plugin-api.md`, ADR 0319 / D645+- **Status**: Retired by D645; Settings UI removed-- **Preconditions**: Import candidates include two sessions at path A, one at path B, and one without a project path; neither project is the active workspace.-- **Steps**: 1) Import all candidates. 2) Open Settings → Project archive. 3) Inspect and expand paths A and B. 4) Return home and inspect Temporary sessions. 5) Repeat the import.-- **Expected**: Project archive contains exactly one durable row for A and one for B; the matching imported sessions appear under their exact project rows; the path-less session appears only under Temporary sessions; the active workspace does not change; repeating import duplicates neither sessions nor project rows; no missing filesystem path is created on disk.-- **Specs linked**: `03-runtime/04-data-storage.md`, `04-ux/01-ui-ia.md`, `04-ux/08-component-spec.md`-- **Acceptance**: F (session/project persistence)-- **Milestone**: M2-- **Status**: Draft+#### E2E-037: Core session-import project workflow retired++- **Expected**: Project binding and renderer refresh for imported sessions are+ verified through plugin-owned session import in E2E-216. Settings no longer+ invokes the legacy core session scanner/import path. Plugin ownership,+ durable project rows, and project archive behavior remain unchanged.+- **Specs linked**: `03-runtime/04-data-storage.md`,+ `04-ux/01-ui-ia.md`, `07-plugins/03-plugin-api.md`, ADR 0319 / D645+- **Status**: Superseded by E2E-214 / E2E-216#### E2E-038: Settings owns the project archive destination-- **Preconditions**: App running with at least one configured provider, one supported local session store, one retained project, and one archived project.-- **Steps**: 1) Open Settings. 2) Inspect the complete settings rail. 3) Open Basics and change the theme in its Appearance card using the searchable theme picker. 4) Open 全局 AI and inspect the Permissions and Defaults cards, including the Command shell row; confirm Context management has no settings card. 5) Open Shortcuts and inspect the Keyboard shortcuts card. 6) Open Instructions and save global instructions. 7) Open Model configuration and inspect the provider studio. 8) Open Import, Project archive, and Info in order. 9) Search Settings for "project" or "archive". 10) In Project archive, compare each group strip's count with its rendered rows. 11) Switch the sort control from Recent to Name. 12) Search for a known session title, confirm the owning project is selected and its inspector lists matching sessions, then reveal more than eight sessions; clear the search with the clear affordance. 13) Open the inspector menu, dismiss it with Escape and with an outside press. 14) Restore the archived project, then activate it. 15) Archive one project session, open it from Project archive, and return to Project archive. 16) Return to the app shell and open Plugins.-- **Expected**: The rail contains exactly Basics, 全局 AI/AI, Shortcuts, Instructions, Model configuration, Import, Project archive, and Info in that order, each with its semantic Lucide icon (Sliders / Sparkles / Keyboard / FileText / Bot / Download / Archive / Info). The flat directory is visually grouped under four muted, non-interactive headings — Personal / 个人 for Basics, AI, and Shortcuts; Agent / 智能体 for Instructions and Model configuration; Workspace / 工作区 for Import and Project archive; About / 关于 for Info — with whitespace and no divider lines between groups; searching keeps the destination results flat and hides empty groups together with their headings. Appearance remains in Basics, while Permissions, Defaults, and the Command shell row live under 全局 AI; an available selected shell is represented by the selector without a duplicate Configured status, while default, fallback, and no-effective-shell states remain explicit; Context management has no settings card; Keyboard shortcuts and global instructions have their own destinations; Developer lives under Info; Project archive shows active, closed, and archived durable rows without a visibility toggle, grouping them under the always-visible Pinned / All projects / Archived strips (D168/D267/D455) with per-section counts in a one-column workbench. The destination renders no hero block and no page-level counter run: the intro is one quiet description line, and each group strip's count agrees with its rendered rows; a click selects a row without leaving Settings; sorting by Name reorders rows inside every section without hiding any; search matches project fields and session titles and reports a match count, a session-title result selects its owning project, lists sessions in the inspector by latest activity with relative update times, and reveals history in batches of eight; clearing the search restores the complete index. The inspector menu closes on Escape and on an outside press. Bootstrap completion and background refreshes do not return Settings or Extensions to the chat home; the destination changes only after an explicit navigation action. Restore keeps the archive open and activation returns to chat with the restored project retained in the sidebar. Opening an archived session succeeds before clearing its archived state, returns to chat with that session selected, and makes it visible in the project sidebar; returning to Project archive no longer shows that session as archived. The home sidebar and global page results have no standalone Projects destination; Settings search finds Project archive; Plugins remains an independent app-shell destination.+- **Preconditions**: App running with developer mode enabled, at least one configured provider, one retained project, and one archived project.+- **Steps**:+ 1. Open Settings and inspect the complete settings rail.+ 2. Open General and change the theme in its Appearance card using the+ searchable theme picker.+ 3. Open AI and inspect the Permissions and Defaults cards, including the+ Command shell row; confirm Context management has no settings card.+ 4. Open Shortcuts and inspect the Keyboard shortcuts card.+ 5. Open Instructions and save global instructions.+ 6. Open Models and inspect the provider studio and inline import action.+ 7. Open Skills and MCP and confirm each has its own external-import action.+ 8. Open Projects and Info in order.+ 9. Search Settings for "project" or "archive".+ 10. In Projects, compare each group strip's count with its rendered rows.+ 11. Switch the sort control from Recent to Name.+ 12. Search for a known session title, confirm the owning project is selected+ and its inspector lists matching sessions, then reveal more than eight+ sessions; clear the search with the clear affordance.+ 13. Open the inspector menu, dismiss it with Escape and with an outside press.+ 14. Restore the archived project, then activate it.+ 15. Archive one project session, open it from Projects, and return to Projects.+ 16. Return to the app shell and open Plugins.+- **Expected**: The rail contains exactly General, AI, Shortcuts, Instructions, Models, Skills, MCP, Subagents, Projects, Cloud sync, Remote Hosts, and Info in that order, each with its semantic Lucide icon (Sliders / Sparkles / Keyboard / FileText / Bot / BookOpen / Server / Bot / Archive / CloudDownload / Globe / Info). The flat directory is visually grouped under four muted, non-interactive headings — Preferences / 偏好 for General, AI, and Shortcuts; Agent / 智能体 for Instructions and Models; Workspace / 工作区 for Projects; About / 关于 for Info — with whitespace and no divider lines between groups; searching keeps the destination results flat and hides empty groups together with their headings. Appearance remains in General, while Permissions, Defaults, and the Command shell row live under 全局 AI; an available selected shell is represented by the selector without a duplicate Configured status, while default, fallback, and no-effective-shell states remain explicit; Context management has no settings card; Keyboard shortcuts and global instructions have their own destinations; Developer lives under Info; Projects shows active, closed, and archived durable rows without a visibility toggle, grouping them under the always-visible Pinned / All projects / Archived strips (D168/D267/D455) with per-section counts in a one-column workbench. The destination renders no hero block and no page-level counter run: the intro is one quiet description line, and each group strip's count agrees with its rendered rows; a click selects a row without leaving Settings; sorting by Name reorders rows inside every section without hiding any; search matches project fields and session titles and reports a match count, a session-title result selects its owning project, lists sessions in the inspector by latest activity with relative update times, and reveals history in batches of eight; clearing the search restores the complete index. The inspector menu closes on Escape and on an outside press. Bootstrap completion and background refreshes do not return Settings or Extensions to the chat home; the destination changes only after an explicit navigation action. Restore keeps the archive open and activation returns to chat with the restored project retained in the sidebar. Opening an archived session succeeds before clearing its archived state, returns to chat with that session selected, and makes it visible in the project sidebar; returning to Project archive no longer shows that session as archived. The home sidebar and global page results have no standalone Projects destination; Settings search finds Projects; Plugins remains an independent app-shell destination.- **Specs linked**: `04-ux/06-settings-ia.md`, `04-ux/01-ui-ia.md`, `03-runtime/11-provider-model-system.md`-- **Acceptance**: B (model configuration), F (session import)+- **Acceptance**: B (model configuration), F (project persistence)- **Milestone**: M4- **Status**: Unit-covered (`settings-project-archive.test.mjs`, `project-archive.test.mjs`, `sidebar-navigation.test.mjs`); rendered scenario Draft@@ -2909,7 +2921,7 @@ identify the platform validation still needed.#### E2E-043: Settings content follows window width- **Preconditions**: App running windowed on macOS with Settings open.-- **Steps**: 1) Open Basics at the default window width and record the content-card width. 2) Expand the window to 1600px wide. 3) Open Model configuration, Import, and Project archive. 4) Shrink the window to the supported 800px minimum.+- **Steps**: 1) Open General at the default window width and record the content-card width. 2) Expand the window to 1600px wide. 3) Open Models, Skills, MCP, and Projects. 4) Shrink the window to the supported 800px minimum.- **Expected**: The right-side content cards expand and contract with the available pane at every tested width; the 275px rail and pane gutters remain stable; controls remain visible without clipping or horizontal page scrolling.- **Specs linked**: `04-ux/06-settings-ia.md`, `04-ux/07-ui-design-system.md`- **Acceptance**: Quality (key operations feel polished)@@ -5908,7 +5920,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.2. Inspect the rendered `BrandLogo` source in the sidebar and startup splash,and inspect the light eight-frame `HomeMascotLogo` GIF in the empty-homehero. Hover the mascot and verify that its cadence does not change.- 3. Switch the theme to dark (Settings → Basics → Appearance, or system appearance change).+ 3. Switch the theme to dark (Settings → General → Appearance, or system appearance change).4. Re-inspect the same surfaces without reloading.5. Switch back to light and re-inspect.- **Expected**:@@ -9371,20 +9383,20 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.| 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 |-| F — Persistence | E2E-020, E2E-021, E2E-021a, E2E-036, E2E-037, E2E-038, E2E-040, E2E-042, E2E-047, E2E-048, E2E-051, E2E-054, E2E-056, E2E-061, E2E-062, E2E-064, E2E-066, E2E-068, E2E-071, E2E-072, E2E-073, E2E-082, E2E-084, E2E-096, E2E-098, E2E-102, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-102i, E2E-103, E2E-AGENTS-001, E2E-061a, E2E-073a, E2E-104, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-118, E2E-119, E2E-120, E2E-121, E2E-123, E2E-142, E2E-146, E2E-146a, E2E-148, E2E-151, E2E-158, E2E-160, E2E-168, E2E-171, E2E-177, E2E-178, E2E-183, E2E-186, E2E-005J, E2E-PLUGIN-session-orchestrator-real-workers |+| F — Persistence | E2E-020, E2E-021, E2E-021a, E2E-038, E2E-SETTINGS-inline-capability-imports, E2E-040, E2E-042, E2E-047, E2E-048, E2E-051, E2E-054, E2E-056, E2E-061, E2E-062, E2E-064, E2E-066, E2E-068, E2E-071, E2E-072, E2E-073, E2E-082, E2E-084, E2E-096, E2E-098, E2E-102, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-102i, E2E-103, E2E-AGENTS-001, E2E-061a, E2E-073a, E2E-104, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-118, E2E-119, E2E-120, E2E-121, E2E-123, E2E-142, E2E-146, E2E-146a, E2E-148, E2E-151, E2E-158, E2E-160, E2E-168, E2E-171, E2E-177, E2E-178, E2E-183, E2E-186, E2E-005J, E2E-PLUGIN-session-orchestrator-real-workers || F — Persistence (project ordering) | E2E-251 || G — Plugins | E2E-022, E2E-022A, E2E-022B, E2E-022C, E2E-023, E2E-024, E2E-024B, E2E-024C, E2E-024D, E2E-024AA, E2E-024E, E2E-024W, E2E-024F, E2E-024G, E2E-024H, E2E-024I, E2E-024J, E2E-024K, E2E-024L, E2E-024M, E2E-024N, E2E-024O, E2E-024P, E2E-025, E2E-026, E2E-105, E2E-117, E2E-120, E2E-122, E2E-123, E2E-024Q, E2E-148, E2E-152, E2E-153, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-imported-pi-package-wrapper, E2E-PLUGIN-import-extension-installs-dependencies, E2E-PLUGIN-import-extension-reports-missing-dependency, E2E-PLUGIN-global-shortcut-owns-only-its-own-command, E2E-PLUGIN-permission-gate-for-real-time-capabilities, E2E-PLUGIN-background-audio-and-realtime-connection, E2E-PLUGIN-fs-root-follows-the-calling-session || H — Diagnostics | E2E-027, E2E-031, E2E-034, E2E-042, E2E-096, E2E-098, E2E-104, E2E-107, E2E-108, E2E-109, E2E-110, E2E-113, E2E-115, E2E-116, E2E-118, E2E-121, E2E-146, E2E-146a, E2E-155, E2E-159, E2E-176, E2E-194, E2E-195 |-| Security | E2E-028, E2E-029, E2E-030, E2E-024J, E2E-024K, E2E-024M, E2E-049, E2E-068, E2E-086, E2E-102c, E2E-102d, E2E-102e, E2E-105, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-113, E2E-115, E2E-116, E2E-117, E2E-119, E2E-121, E2E-122, E2E-123, E2E-142, E2E-148, E2E-151, E2E-153, E2E-158, E2E-187, E2E-196c, E2E-196b, E2E-196, E2E-PLUGIN-fs-root-follows-the-calling-session |-| Quality | E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-032, E2E-033, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-053, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-103, E2E-AGENTS-001, E2E-021a, E2E-024N, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-111, E2E-114, E2E-117, E2E-118, E2E-119, E2E-120, E2E-122, E2E-123, E2E-142, E2E-143, E2E-144, E2E-145, E2E-146, E2E-147, E2E-148, E2E-150, E2E-151, E2E-153, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-168, E2E-172, E2E-173, E2E-174, E2E-011g, E2E-176, E2E-177, E2E-178, E2E-179, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-196, E2E-201, E2E-204, E2E-202, E2E-203, E2E-205, E2E-206, E2E-207, E2E-208, E2E-209, E2E-210, E2E-UPDATE-preference-and-once-only-reminder, E2E-218, E2E-259, E2E-219, E2E-250, E2E-252, E2E-102i, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation |+| Security | E2E-SETTINGS-inline-capability-imports, E2E-028, E2E-029, E2E-030, E2E-024J, E2E-024K, E2E-024M, E2E-049, E2E-068, E2E-086, E2E-102c, E2E-102d, E2E-102e, E2E-105, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-113, E2E-115, E2E-116, E2E-117, E2E-119, E2E-121, E2E-122, E2E-123, E2E-142, E2E-148, E2E-151, E2E-153, E2E-158, E2E-187, E2E-196c, E2E-196b, E2E-196, E2E-PLUGIN-fs-root-follows-the-calling-session |+| Quality | E2E-SETTINGS-inline-capability-imports, E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-032, E2E-033, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-053, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-103, E2E-AGENTS-001, E2E-021a, E2E-024N, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-111, E2E-114, E2E-117, E2E-118, E2E-119, E2E-120, E2E-122, E2E-123, E2E-142, E2E-143, E2E-144, E2E-145, E2E-146, E2E-147, E2E-148, E2E-150, E2E-151, E2E-153, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-168, E2E-172, E2E-173, E2E-174, E2E-011g, E2E-176, E2E-177, E2E-178, E2E-179, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-196, E2E-201, E2E-204, E2E-202, E2E-203, E2E-205, E2E-206, E2E-207, E2E-208, E2E-209, E2E-210, E2E-UPDATE-preference-and-once-only-reminder, E2E-218, E2E-259, E2E-219, E2E-250, E2E-252, E2E-102i, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation || Quality (project ordering) | E2E-253 || C — Conversation & stream (IME slash alias) | E2E-255 || E — Tools & permissions (Skill residency) | E2E-254 || Quality (Skill residency and IME slash alias) | E2E-254, E2E-255 |-| C — Conversation & stream (import visibility) | E2E-257 |-| F — Persistence (import visibility) | E2E-257 |-| G — Plugins (import visibility) | E2E-257 |-| Quality (import visibility) | E2E-257 |+| C — Conversation & stream (plugin session import visibility) | E2E-257 |+| F — Persistence (plugin session import visibility) | E2E-257 |+| G — Plugins (session import visibility) | E2E-257 |+| Quality (plugin session import visibility) | E2E-257 || Quality (Windows updater cache) | E2E-260 || G — Plugins (Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers || Security (Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers |@@ -9422,7 +9434,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.|---|---|| Post-MVP experimental interaction maintenance | E2E-LIVE-VOICE-four-stage-ui || M1 | E2E-001, E2E-002, E2E-003, E2E-028, E2E-029 |-| M2 | E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-008d, E2E-008e, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-020, E2E-021, E2E-021a, E2E-027, E2E-031, E2E-036, E2E-037, E2E-042, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-144, E2E-005J, E2E-201, E2E-202, E2E-207, E2E-206 |+| M2 | E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-008d, E2E-008e, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-020, E2E-021, E2E-021a, E2E-027, E2E-031, E2E-042, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-144, E2E-005J, E2E-201, E2E-202, E2E-207, E2E-206 || M3 | E2E-012, E2E-013, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-040 || M4 | E2E-022, E2E-023, E2E-024, E2E-025, E2E-026, E2E-030, E2E-038 || M5 | E2E-CHAT-long-history-stream-keeps-responsive, E2E-CHAT-running-status-survives-output-pauses, E2E-008a, E2E-032, E2E-033, E2E-034, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-051, E2E-052, E2E-053, E2E-054, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-AGENTS-001, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-094, E2E-095, E2E-143, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-177, E2E-178, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-204, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-252, E2E-102i |@@ -9430,7 +9442,7 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.| M2 (IME slash alias) | E2E-255 || M5 (Skill residency) | E2E-254 || M6 | E2E-104, E2E-105, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-111, E2E-112, E2E-113, E2E-114, E2E-115, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-103, E2E-172 |-| M6+ | E2E-121, E2E-122, E2E-148, E2E-150, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-166, E2E-168, E2E-173, E2E-174, E2E-176, E2E-179, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-202, E2E-203, E2E-205, E2E-209, E2E-210, E2E-UPDATE-preference-and-once-only-reminder, E2E-212, E2E-213, E2E-214, E2E-215, E2E-216, E2E-217, E2E-218, E2E-259, E2E-219, E2E-257, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation |+| M6+ | E2E-121, E2E-122, E2E-148, E2E-150, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-166, E2E-168, E2E-173, E2E-174, E2E-176, E2E-179, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-202, E2E-203, E2E-205, E2E-209, E2E-SETTINGS-inline-capability-imports, E2E-210, E2E-UPDATE-preference-and-once-only-reminder, E2E-212, E2E-213, E2E-214, E2E-215, E2E-216, E2E-217, E2E-218, E2E-259, E2E-219, E2E-257, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation || M6+ (Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers || M6+ (Selected model order) | E2E-MODEL-selected-order-persists || M6+ (MCP server timeout override) | E2E-261 |@@ -9721,9 +9733,9 @@ This test plan spec is accepted when:### US-UI-24 Settings full-page shell- Open Settings (footer profile → Settings).- Expect **full-page** Codex settings (no app sidebar/nav). Left rail has Back- to app, search, and exactly Basics / 全局 AI / Shortcuts / Model configuration /- Import / Project archive / Info in that order; content pane shows section title and the- destination's settings or archive content.+ to app, search, and exactly General / AI / Shortcuts / Instructions / Models /+ Skills / MCP / Subagents / Projects / Cloud sync / Remote Hosts / Info in that+ order; content pane shows the selected destination.- Return to the app shell and expect Plugins to remain an independentsidebar-footer destination.- Drag the empty 46px top band over either the rail or content pane; the native@@ -9930,17 +9942,21 @@ This test plan spec is accepted when:a standalone New task row.### US-UI-52 Settings gold chrome metrics (D070)-- Open Settings light Basics at ~1200×690.-- Expect ~275px `#f4f4f4` rail, single active Basics pill, Back + search.+- Open Settings light General at ~1200×690.+- Expect ~275px `#f4f4f4` rail, single active General pill, Back + search.- Expect the working theme selector without inert toggle or open-target rows.-- Expect Permissions + Basics + Appearance elevated cards; Agent,- Import, and Info remain the only other destinations.+- Expect Appearance in General and Permissions + Defaults in AI. The rail+ contains General, AI, Shortcuts, Instructions, Models, Skills, MCP,+ Subagents, Projects, Cloud sync, and Info; Remote Hosts appears only in+ developer mode. Voice may appear between AI and Shortcuts in development+ builds with developer mode on; plugin-contributed destinations follow the+ core groups. There is no Import destination.- Resize between 800px, 1200px, and 1600px widths; the content cards fill theavailable right pane at each size without changing the rail or introducinghorizontal scrolling.### US-UI-53 Settings dark shell (D070)-- Dark theme Settings Basics: black rail, elevated cards, blue on-toggles, Back returns to chat.+- Dark theme Settings General: black rail, elevated cards, blue on-toggles, Back returns to chat.- Row descriptions use theme-aware secondary text and remain clearly readable onthe `#212121` card surface; they must not fall back to low-contrast muted ink.@@ -10579,7 +10595,7 @@ This test plan spec is accepted when:distinct from the built-in token stack (for example PingFang SC); a clean`~/.pi-desktop` profile.- **Steps**:- 1) Open Settings → Basics and confirm the Appearance card shows a Font row+ 1) Open Settings → General and confirm the Appearance card shows a Font rowbelow Theme and Language with a trigger labeled "System default".2) Open the Font picker and confirm it lists System default followed byinstalled system families only — no bundled open-licensed families and no@@ -12914,11 +12930,11 @@ are withdrawn with ADR 0165.endpoint and different keys, and optionally one OAuth-only vendor.PI-Desktop may already have an equivalent provider.- **Steps**:- 1. Open Settings → Import. Confirm a Sessions card and a Model- configuration card, each with its own Scan.- 2. Scan model configuration. Confirm groups start collapsed, rows show- name, model count, host, and an API key / No API key badge, and that- no secret value appears in the UI or in the scan IPC payload.+ 1. Open Settings → Models and expand **Import from other tools**. Confirm+ the inline workbench is idle until Scan is activated.+ 2. Scan model configuration. Confirm source groups start expanded, rows+ show name, model count, host, and an API key / No API key badge, and no+ secret value appears in the UI or scan IPC payload.3. Import the selected providers. Confirm both same-endpoint profiles appearas separate rows under Settings → Models and remain selectable in theComposer model menu. Re-import the same selection and confirm those@@ -12927,7 +12943,7 @@ are withdrawn with ADR 0165.becomes the default. If a default already existed, confirm it isunchanged.5. Confirm an OAuth-only source account is absent from the candidate- list and that session import still works independently.+ list.- **Expected**: Explicit scan only (D007). Stored API keys land in the hostsecret store. Only equivalent providers (normalized URL + API style + samecredential) skip; different credentials at one endpoint remain separate.@@ -12935,12 +12951,43 @@ are withdrawn with ADR 0165.- **Specs linked**: `04-ux/06-settings-ia.md`,`04-ux/08-component-spec.md` §18.5, `03-runtime/01-ipc-protocol.md`,`03-runtime/11-provider-model-system.md`, ADR 0179, D342-- **Acceptance**: B (model configuration), F (session import)+- **Acceptance**: B (model configuration)- **Milestone**: M4- **Status**: Unit-covered (`packages/shared/src/model-config-import.test.ts`,`apps/desktop/test/model-config-import.test.mjs`); full UI journey Draft(run only in a capable environment when this surface changes)+#### E2E-SETTINGS-inline-capability-imports: Import skills and MCP in their owning pages++- **Preconditions**: A supported external skill and MCP configuration are+ available. At least two projects exist. One MCP source is disabled and its URL+ includes userinfo and query credentials.+- **Steps**:+ 1. Open Settings → Skills, select Project and a project, then expand Scan+ other tools. Confirm opening the panel does not scan. Scan, select a skill,+ choose its copy or link mode, and import it.+ 2. Confirm the new skill belongs to the selected project. Change the project+ and confirm the prior candidates and selection are cleared.+ 3. Open Settings → MCP, select Project and the same project, expand Scan+ other tools, scan, select the disabled MCP candidate, and import it.+ 4. Confirm the server belongs to that project, remains disabled, and the+ candidate row shows only the URL host without userinfo, path, or query.+ 5. Change project scope and confirm the prior MCP candidates and selection+ are cleared.+- **Expected**: Skills and MCP scans start only after an explicit Scan action.+ Project scans and writes carry the selected project path; scope changes clear+ stale candidates. MCP disabled state is preserved and URL credentials never+ render in candidate metadata.+- **Specs linked**: `04-ux/06-settings-ia.md`,+ `04-ux/08-component-spec.md` §18.3 / §18.6 / §18.7, ADR 0319 / D645+- **Acceptance**: F (persistence), Security, Quality+- **Milestone**: M6++- **Status**: Source-contract and scoped IPC tests covered+ (`settings-import-page.test.mjs`, `agent-capability-settings.test.mjs`,+ `agent-import-ipc.test.mjs`, `import-format.test.mjs`). The project MCP scan,+ selection, import, visible result, and scoped payload are exercised by+ `pnpm test:e2e:settings-inline-import` in an isolated Electron fixture.+#### E2E-210: Documentation screenshots resolve from GitHub and VitePress- **Preconditions**: The repository contains the gallery assets under@@ -14827,29 +14874,26 @@ plugin-form fixtures in an isolated temporary directory at runtime.- **Milestone**: M5 (project organization maintenance).- **Status**: Unit/source-contract covered (`apps/desktop/test/project-create-dialog.test.mjs`);full UI scenario remains Draft.-#### E2E-257: Importing into an archived project restores its visibility+#### E2E-257: Plugin session import into an archived project restores its visibility- **Preconditions**: A durable project has been archived in the renderer- sidebar preferences and is hidden from the default sidebar. A core import- candidate has that project's path, and a test plugin can import a session- with an explicit host project id.+ sidebar preferences and is hidden from the default sidebar. A test plugin+ can import a new session with an explicit host project id.- **Steps**:1. Open Settings → Project archive and confirm the archived project remainsavailable there while the default sidebar omits it.- 2. Scan and import the core candidate whose project path belongs to the- archived project.- 3. Confirm the project and its imported session appear in the default+- 2. Use the plugin's `session.importBatch` with the existing project's id+ and wait for the host session refresh event.+- 3. Confirm the project and its newly imported session appear in the defaultsidebar, then archive the project again.- 4. Use the plugin's `session.importBatch` with the existing project's id and- inspect the sidebar after the host refresh event.- 5. Refresh sessions without importing anything, import a pathless session,- and repeat an already imported session.-- **Expected**: Each successful import that adds a project-bound session clears- the archived presentation state for that exact normalized project path and- makes the project/session discoverable. Ordinary refreshes, pathless- sessions, skipped imports, and plugin history paths without an explicit- project binding leave archive state unchanged; no host project row or- transcript is deleted or recreated.+- 4. Refresh sessions without importing anything, then use+ `session.importBatch` for a pathless session and for a duplicate or+ skipped session.+- **Expected**: A successful plugin import that adds a project-bound session+ clears the archived presentation state for that exact normalized project+ path and makes the project/session discoverable. Ordinary refreshes,+ pathless sessions, skipped imports, and repeated imports leave archive state+ unchanged; no host project row or transcript is deleted or recreated.- **Specs linked**: `04-ux/06-settings-ia.md`, `04-ux/08-component-spec.md`,`03-runtime/04-data-storage.md`, ADR 0236, D407- **Acceptance**: C (conversation & stream), F (persistence), G (plugins),@@ -14869,22 +14913,23 @@ plugin-form fixtures in an isolated temporary directory at runtime.`# AGENTS.md`, `You are Codex`, `<environment>`) and at least one sessionwhose stored timestamps are corrupt or out of range.- **Steps**:- 1. Run Settings → Session import → Scan over the archive.- 2. Inspect candidate titles and the createdAt/updatedAt shown per session.- 3. Import a session whose first real user message follows synthetic- injections.+ 1. Run `node --test test/importer-codex-scan.test.mjs` from `apps/desktop`.+ 2. Confirm test coverage for synthetic title filtering and timestamp fallback.+ 3. Confirm an archive above the file cap reports truncation metadata and+ includes only the newest 250 files.- **Expected**: Candidate titles come from the first real user message —synthetic injections never surface as titles, while genuinely pastedmarkdown that starts with `#` (for example `# Role: …`) is kept. Sessionswhose user messages are all synthetic do not appear as candidates. Acorrupt or out-of-range stored timestamp falls back to the source file's- mtime, never to the import moment.+ mtime, never to the import moment. An archive above 250 session files returns+ the newest 250 by folder date plus truncated-count metadata; Settings no+ longer renders the retired session-import cap note.- **Specs linked**: `03-runtime/01-ipc-protocol.md`,- `04-ux/06-settings-ia.md`, D320+ D320- **Acceptance**: C (conversation & stream), F (persistence), Quality- **Milestone**: M6+-- **Status**: Unit-covered (`importer-codex-scan.test.mjs`); UI journey Draft- (run only in a capable environment when this surface changes)+- **Status**: Unit-covered (`importer-codex-scan.test.mjs`); no Settings UI journey#### E2E-LAYOUT-three-column-width-prioritydiff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 9d2dbaf4a..5b9eb208e 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -370,7 +370,7 @@ Gold source: local Codex electron captures; latest row wins where rows conflict.| D334 | Contained in-chat image display | **Amend the desktop `fs/read` workspace-only clause: `fs/read`, `fs/reveal`, and `fs/open` share `resolveOpenablePath` (workspace, `<data_dir>/scratch/`, `<data_dir>/attachments/`, plus `attachments/<sha256>` blobs). Reads `realpath` the target. Add renderer-only `fs/readImageDataUrl` that returns a bounded image data URL or `missing` / `notImage` / `tooLarge` and never non-image bytes. A known image extension wins over client `mimeType`; extension-less blobs accept only the `IMAGE_MIME` allowlist. Chat thumbnails and local Markdown images load through that channel; click opens the host files viewer. Not a plugin API. See ADR 0172 and E2E-187.** | History attachments are extension-less data-root blobs the renderer origin cannot load; an unbounded absolute-path read would leak arbitrary files. || D336 | Host-owned plugin completions and session context | **Amend D019: plugins may read the in-flight tool session's model-facing transcript through `pi.session.getLlmContext()` when `session.read` is granted, and may run a one-shot completion through `pi.agent.complete()` when `agent.complete` is granted. `pi.models.list()` lists ready provider/model rows (`models.list`). Credentials never leave Electron main. `includeSessionContext` requires both complete permissions and an in-flight tool session; plugins cannot pass a session id. Completions are rate-braked (8/60s) and size-capped. `session:modelChanged` is pushed after `session.configure`. The bundled first-party Advisor UX is temporarily not shipped; the public APIs remain available to explicitly installed plugins. No protocol/schema bump. See ADR 0174 and E2E-188 / E2E-189.** | Second-opinion tools need the user's models and the current LLM context without holding secrets or calling providers from plugin code. || D340 | User-configurable outbound proxy | **Settings → General → Network exposes Proxy as System / Direct / Custom. Custom accepts http/https/socks5 URLs and a bypass list, persisted as optional `AppSettings.networkProxy`. Chromium `session.setProxy` covers the in-app browser and `net.fetch`; the agent sidecar applies an undici dispatcher (SOCKS5 CONNECT or HTTP ProxyAgent) via `sidecar.configure`; host-core marketplace curl uses `--proxy` from the stored blob and does not inherit proxy env (workspace Bash stays clean). OAuth still uses the system browser. No protocol or schema version bump. See ADR 0177 and E2E-190.** | Node fetch ignores the OS proxy, so Clash/V2Ray/SOCKS5 users could browse but not call models. One settings control should own app-owned HTTP. |-| D342 | Import model configuration from local agent stores | **Amend D007: Settings → Import still never auto-imports `~/.pi` (or any other tool). An explicit Model configuration card scans Claude Code, Codex, OpenCode, Pi, and CC Switch (`~/.cc-switch/cc-switch.db`, fallback `config.json`) provider rows, lists drafts without secrets, and `modelConfig/importRun` copies API keys through `providers.create`. A live tool file that matches a CC Switch endpoint and credential is not listed twice. OAuth/subscription tokens stay in the source app. Equivalent providers (normalized base URL + API style + same credential) are skipped; different credentials at one endpoint remain independent rows (ADR 0188). If no global default model exists, the first newly created provider becomes it. Electron IPC only; no host protocol or schema version bump. See ADR 0179, ADR 0188, and E2E-209.** | Users already import sessions from those stores and otherwise retype the same endpoints and keys on the Models page. |+| D342 | Import model configuration from local agent stores | **Amend D007: Settings → Import still never auto-imports `~/.pi` (or any other tool). An explicit Model configuration card scans Claude Code, Codex, OpenCode, Pi, and CC Switch (`~/.cc-switch/cc-switch.db`, fallback `config.json`) provider rows, lists drafts without secrets, and `modelConfig/importRun` copies API keys through `providers.create`. A live tool file that matches a CC Switch endpoint and credential is not listed twice. OAuth/subscription tokens stay in the source app. Equivalent providers (normalized base URL + API style + same credential) are skipped; different credentials at one endpoint remain independent rows (ADR 0188). If no global default model exists, the first newly created provider becomes it. Electron IPC only; no host protocol or schema version bump. See ADR 0179, ADR 0188, and E2E-209. The Settings placement and session-import UI were superseded by D645 / ADR 0319: model import now lives on Models, and Settings has no session-import UI.** | Users already import sessions from those stores and otherwise retype the same endpoints and keys on the Models page. || D351 | Preserve distinct credentials during model configuration import | **Amend D342 / ADR 0179: an imported provider is equivalent only when normalized endpoint, API style, and credential all match. Same-endpoint profiles with different API keys create independent provider rows and remain selectable in Composer. Electron main resolves existing API keys through the host secret boundary; secrets never reach the renderer, logs, or provider metadata. The live-file-versus-CC-Switch scan uses the same credential-aware rule. No host protocol or storage schema version bump. See ADR 0188 and E2E-209.** | CC Switch stores multiple accounts at one gateway endpoint; endpoint-only idempotence silently dropped all but the first profile during import. || D344 | Main-owned picker capabilities | **Amend D197 / D334: composer native file and image pickers keep selected absolute paths in Electron main behind a short-lived, sender-bound, one-shot token. `composer/importFiles` accepts only that token and a durable session id; the renderer never supplies source paths. The MVP file picker offers regular files only, so unsupported directory selection and its misleading UI copy are removed. Main retains realpath, regular-file, session-scratch, and size-limit validation. See ADR 0181 and E2E-102h.** | Renderer IPC is not a user-click gate: accepting arbitrary absolute paths in the import payload creates a local file exfiltration primitive. Folder import needs separate bounded traversal and symlink semantics. || D314 | Shipped locale registry and language picker | **Amend D073: UI locales are listed in `@pi-desktop/i18n` (`en`, `zh-CN`, `zh-TW`, `tr`). Native names stay untranslated. Settings → General language is a searchable picker (Auto + registry), not three preview cards. Plugin labels keep their `en` + `zh-CN` contract with English fallback for shell locales without a plugin translation; the product changelog follows every shipped product locale. See ADR 0160, ADR 0182, and E2E-091.** | Preview cards cannot scale past two languages; a registry lets additional locales ship without rewriting the Appearance card. |@@ -7455,3 +7455,17 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.and`config_sync::domains::tests::writes_imported_instruction_files_beyond_the_former_size_cap`in `crates/host-core/src/config_sync/domains.rs`.+## 2026-10-04 — External imports live with their Settings destination (D645)++- D645 removes the standalone Settings `import` destination. Model+ configuration, external skills, and external MCP scans are opened inline+ from Models, Skills, and MCP respectively. Capability imports follow the+ selected global/project level, and project scans bind to the selected+ project.+- Settings no longer exposes core session scanning/import. Plugins retain+ their existing host-owned session import API and project binding behavior;+ no IPC, plugin permission, host protocol, or persistence contract changes.+- Covered by the isolated Settings MCP import user-path test, scoped MCP IPC,+ and safe MCP metadata tests. See+ ADR 0319, `04-ux/06-settings-ia.md`, `04-ux/08-component-spec.md`, and+ E2E-038 / E2E-043 / E2E-209.diff --git a/docs/zh-CN/spec/00-baseline.md b/docs/zh-CN/spec/00-baseline.mdindex 8cebb0ee8..e015cc168 100644--- a/docs/zh-CN/spec/00-baseline.md+++ b/docs/zh-CN/spec/00-baseline.md@@ -3,8 +3,8 @@> **翻译说明:** 本页是与 [英文源规格](/spec/00-baseline) 一一对应的机器辅助翻译。代码、协议字段和标识符保持原文;如翻译与英文源事实有歧义,以英文版本为准。-- 基线版本:`0.4.19`-- 日期:`2026-09-29`+- 基线版本:`0.4.21`+- 日期:`2026-10-04`- 状态:`Frozen for implementation details (Plan checkpoint artifact + approval/execution startup fence + protocol v11 + schema v15 + host-owned plugin session import/read/update/delete P0/P1 + selectable shell catalog + icon-free composer prompt row + turn-boundary context checkpoint compaction + session-scoped work panel + pi-owned model metadata + provider/runtime safety + M5 hardening + settings IA + project archive + sidebar organization + app update delivery + three-platform release + Extensions page density and theme-readable actions + custom global UI font)`- 语言政策:**英语优先**- 后端策略:**Rust 主机核心 + pi 代理 sidecar**@@ -90,6 +90,9 @@> D374 将其修订为单一规范 WebSocket 绑定、无头 Agent Host 模块和完整本地审批词汇;> D375 将 SSH 隧道远端 Host 排在首位,Gateway 与浏览器访问不排期。> 当前基线仍排除远程 Gateway / WebUI 控制。+> `0.4.21` 移除了独立的设置「导入」目的地。模型、技能和 MCP 扫描+> 内嵌在各自的设置页面中;会话导入继续通过现有插件 API 提供+>(D645 / ADR 0319)。## 冻结的决定@@ -138,7 +141,8 @@37. Secrets后端:**safeStorage主+加密文件后备**38. 工作区忽略:**拒绝列表 + 默认值 + `.pi-desktopignore`**39. 工具结果限制:**按工具预算(搜索 128KB / 4000 行,shell 96KB / 4000 行);仅在结果被切断时 `truncated`**-40.设置目录:**Basics/模型配置/Import/Project archive/Info**;+40.设置目录:**常规/AI/快捷键/指令/模型/技能/MCP/子智能体/项目归档/云同步/远程主机/信息**;+ 外部模型、技能和 MCP 扫描内嵌在各自页面;会话导入由插件负责;项目档案拥有持久的项目发现、归档、恢复和重新开放工作流程;插件管理仍然是应用程序外壳的独立 **插件** 目的地diff --git a/docs/zh-CN/spec/03-runtime/11-provider-model-system.md b/docs/zh-CN/spec/03-runtime/11-provider-model-system.mdindex 59a9c65ae..4a3e19b2c 100644--- a/docs/zh-CN/spec/03-runtime/11-provider-model-system.md+++ b/docs/zh-CN/spec/03-runtime/11-provider-model-system.md@@ -458,8 +458,8 @@ type ModelDescriptor = {- 模型卡片默认保持紧凑,按需展开 metadata/configuration,并让对话框操作留在可独立滚动的内容区域之外- 不要暴露原始的目录兼容性内部细节或提供商机密-- 设置 → 导入可以从 Claude Code、Codex、OpenCode、Pi 和 CC Switch 复制- provider/model 行。扫描是显式的。已存储的 API key 会被复制进宿主密钥库;+- 设置 → 模型的“提供商”区块提供内嵌扫描,可从 Claude Code、Codex、OpenCode、Pi+ 和 CC Switch 导入 provider/model 行。扫描是显式的。已存储的 API key 会被复制进宿主密钥库;OAuth/订阅授权则不会。重复导入时只会跳过等价提供商(归一化 URL + API风格 + 相同凭据);同一端点的不同凭据仍保持为独立提供商。不涉及协议或模式版本升级(D342 / ADR 0179 / ADR 0188)diff --git a/docs/zh-CN/spec/04-ux/01-ui-ia.md b/docs/zh-CN/spec/04-ux/01-ui-ia.mdindex 60917472a..ce29cc03f 100644--- a/docs/zh-CN/spec/04-ux/01-ui-ia.md+++ b/docs/zh-CN/spec/04-ux/01-ui-ia.md@@ -247,24 +247,23 @@ schedule. Renaming an Hourly task does not restart its interval.外观位于常规;全局人工智能行为(权限和上下文管理)存在于全局人工智能内部;键盘快捷键和 global/project指令有其自己的目的地;供应商管理位于内部-模型配置。导入扫描支持本地代理存储和呈现-可折叠组中的候选人。项目路径是备用分组-与默认源分组一起,每次扫描或分组更改都会开始-所有团体都崩溃了。项目档案拥有持久的 D086 项目索引+模型配置。模型、技能和 MCP 各自在所属设置页内打开外部存储导入工作台,+且仅在用户明确启动时扫描。技能和 MCP 导入遵循当前“全局 / 项目”筛选及+所选项目。会话导入通过插件 API 提供,而不是设置目的地。项目档案拥有持久的 D086 项目索引(搜索、添加、展开、固定、archive/restore、关闭和重新打开)并且始终包括存档记录。打开或切换项目会保留侧边栏选项卡,选择该项目作为活动工作区,然后返回聊天。其他保留的选项卡保持开放。扩展管理仍然完全独立于应用程序外壳扩展目标(见 §3.4)。设置 > 智能体遵循以下共享能力契约:-- 技能和 MCP 使用单列堆叠的全局/项目卡片区块。每个区块有安静的标题行:作用域- 标题与说明、解析后的 `.agents` 路径、本地化计数和操作;项目区块显示最近项目- 选择器。项目项优先于全局项。-- 每个区块的技能只有一个原生“导入”操作,只接受一个文件,并物理复制到选中的- `.agents/skills` 目录。-- 每个区块的 MCP 只有一个“新增”操作;新增和编辑复用 `McpEditorSheet` 二级模态框,+- 技能和 MCP 使用共享工具栏中的“全局 / 项目”筛选展示同一份列表。工具栏含项目选择器;+ 当前筛选决定列表内容及新建、导入操作的目标。+- 技能保留各作用域区块中的原生文件和文件夹导入操作,并在页面工具栏提供“扫描其他工具”。+ 外部技能导入遵循当前筛选及所选项目。+- 每个 MCP 页面只有一个“新增”操作;新增和编辑复用 `McpEditorSheet` 二级模态框,包含 stdio/HTTP 分支、校验、同级别重名拦截、编辑时锁定 ID、作用范围和测试- 连接反馈。+ 连接反馈。“扫描其他工具”在 MCP 页内打开外部导入工作台,并遵循当前“全局 / 项目”筛选+ 与所选项目。- 子代理使用 `~/.agents/subagents` 下的单个全局宽区块,没有项目选择器、项目区块或项目级开关。新建或编辑子智能体时,固定模型从已配置的提供商模型中选择,或沿用会话模型,不需要手打 `provider/model` 标识。diff --git a/docs/zh-CN/spec/04-ux/06-settings-ia.md b/docs/zh-CN/spec/04-ux/06-settings-ia.mdindex 8dc71e55c..e0cdabc9d 100644--- a/docs/zh-CN/spec/04-ux/06-settings-ia.md+++ b/docs/zh-CN/spec/04-ux/06-settings-ia.md@@ -33,16 +33,15 @@6. **技能** — Lucide `BookOpen`(可复用的智能体指令)7. **MCP** — Lucide `Server`(智能体连接)8. **子智能体** — Lucide `Bot`(内置与自建的并行工作智能体)- 9. **导入** — Lucide `Download`(从其他工具引入会话和模型配置)- 10. **项目** — Lucide `Archive`(持久项目索引)- 11. **云同步** — Lucide `CloudDownload`(加密的可移植配置备份与双向同步)- 12. **远程主机** — Lucide `Globe`(SSH 引导与配对清单;仅开发者模式)- 13. **信息** — Lucide `Info`(版本、日志、更新、开发人员)+ 9. **项目** — Lucide `Archive`(持久项目索引)+ 10. **云同步** — Lucide `CloudDownload`(加密的可移植配置备份与双向同步)+ 11. **远程主机** — Lucide `Globe`(SSH 引导与配对清单;仅开发者模式)+ 12. **信息** — Lucide `Info`(版本、日志、更新、开发人员)图标具有装饰性(通过 SVG 默认设置为 `aria-hidden`)并保持单色带有导轨标签;不要在此处重复使用 refresh/rotate 字形。- 目录仍是保持相同顺序的可搜索扁平列表。为便于扫描,目的地分为四个带标题的视觉分组:“偏好”(常规、AI、快捷键)、“智能体”(指令、模型、技能、- MCP、子智能体)、“工作区”(导入、项目)和“系统”(云同步、远程主机、信息;远程主机仅开发者模式可见)。标题使用柔和+ MCP、子智能体)、“工作区”(项目)和“系统”(云同步、远程主机、信息;远程主机仅开发者模式可见)。标题使用柔和的非交互文字,分组之间只使用留白,不绘制分割线;搜索过滤后,空分组及其标题一并隐藏。- **云同步**是面向所有用户、在任何构建中都可见的常规「系统」目的地:其导轨行、页面@@ -215,6 +214,9 @@ Token 用量**不是设置目的地**(D335 / ADR 0173)。已完成回合历对话框正文可滚动以访问两份列表;较矮的宽窗口仍保持左右布局。- **提供商**工作室:- OpenAI 兼容的添加提供程序对话框(从添加提供程序/空状态 CTA 打开)+ - 提供商区块标题提供“从其他工具导入”操作。内嵌面板仅在用户明确启动扫描后读取本地配置,+ 按来源分组显示草稿,且不渲染原始凭据;已存储的 API 密钥写入宿主密钥库,+ 订阅/OAuth 登录不导入,等价提供商会跳过。- 新建对话框先只显示**服务**。命名端点按厂商平铺(OpenAI、Anthropic、Google、OpenRouter、DeepSeek、通义千问、月之暗面、智谱、硅基流动、火山方舟、MiniMax、MiniMax (OpenAI)、小米、Kimi 编程等),不再分国际 / 国内。选中后显示服务 + API 密钥和主机摘要。自定义端点随后分三行显示服务、名称与接口地址、以及 API 密钥与接口格式,让字段在表单变化时保持稳定对齐;接口地址不附带解释性说明。获取模型失败时,分类结论以一条 toast 报出,空列表处只保留一行「无列表」文案,已有缓存列表时列表原样保留;两种情况都不展示原始 HTTP/JSON 报错。探测结论(已连接、来自目录或被拒绝)只播报一次,密钥下方不再保留状态行。名称(命名行)与可选自定义请求头放在高级设置中。对话框右上角提供明确的“高级设置”按钮,点击后打开独立紧凑弹框,主表单只保留端点和模型面板。弹框可直接添加包含 User-Agent 在内的常用请求头,可将与持久化相同的规范化请求头 JSON 复制到剪贴板(忽略空名称,后者覆盖前者),也支持导入直接请求头对象或 `{ "headers": { ... } }` JSON;导入时按名称合并,不重复添加。列表最多显示五行,更多请求头在自身区域滚动;留空则使用适配器默认值。服务是可搜索锚定菜单(按显示名、厂商、主机过滤),不是原生下拉框。- 带有头像缩写、主机、默认模型、秘密状态的提供商卡,和测试/make-default/删除操作@@ -262,15 +264,21 @@ Token 用量**不是设置目的地**(D335 / ADR 0173)。已完成回合历指令 API;项目指令仍由活动项目管理菜单并在全局层之后解决。-### 导入-- 通过页面自身的类型切换器之后每个类型一个工作台,扫描受支持的本地代理存储中的**会话**、**模型配置**、**技能**和 **MCP 服务器**。每个类型都保留各自的显式扫描:它们都不会自动运行,切换类型也绝不会启动扫描(D007 / D342)。-- 会话:通过 `SessionImportPanel` 审核候选项。来源与项目路径分组行为见- [08-组件规范 §18](/zh-CN/spec/04-ux/08-component-spec#18-导入目的地)。- Group-by 控件与外观和权限选择器一样,是同一个应用内菜单选择器,而不是平台绘制的 `<select>`。-- 模型配置:通过 `ModelConfigImportPanel` 审核提供商草稿+### 内嵌导入工作台+- 模型配置、外部技能和外部 MCP 扫描分别位于“模型”“技能”和“MCP”设置页。每页保留+ 显式扫描与选择工作台;打开或关闭工作台不会自动扫描。+- 技能和 MCP 导入遵循当前“全局 / 项目”筛选及所选项目。项目扫描和写入都携带所选项目+ 路径;切换目标作用域会重置候选项与选择,避免导入到旧目标。+- 技能工作台保留复制/链接模式以及技能区块中的原生文件、文件夹导入操作。MCP 候选行+ 不显示秘密或请求头值,URL 元数据只显示主机;来源服务器原本禁用时,导入后仍保持禁用。+- 设置不提供会话扫描或导入面板。会话导入通过现有宿主拥有的插件会话 API 提供;项目绑定+ 与刷新行为遵循插件会话契约(D645 / ADR 0319)。+- 模型配置通过 `ModelConfigImportPanel` 审核提供商草稿([08-组件规范 §18.5](/zh-CN/spec/04-ux/08-component-spec#185-modelconfigimportpanel))。- 这些配置里保存的 API 密钥会复制到宿主密钥库;订阅/OAuth 登录不复制。CC Switch(`~/.cc-switch`)作为独立来源扫描,因此可导入已保存的配置档案,而不只是当前生效的 live 文件。再次导入等价提供商(规范化 base URL、API 风格和相同凭据)时跳过;同一端点不同凭据的配置档案保持独立。若应用尚无默认模型,则本次新建的第一个提供商成为默认。-- 技能和 MCP 服务器复用智能体能力扫描器及其来源标签。技能类型携带导入模式(复制或符号链接);MCP 类型写入 MCP 目的地所管理的同一个 MCP 列表。+ CC Switch(`~/.cc-switch`)作为独立来源扫描,可导入已保存的配置档案,而不只是当前生效的+ live 文件。同一规范化 base URL、API 风格和凭据的提供商会跳过;同一端点但凭据不同的+ 配置档案保持独立。若应用尚无默认模型,本次新建的首个提供商成为默认。工作台细节见+ [08-组件规范 §18](/zh-CN/spec/04-ux/08-component-spec#18-内嵌导入工作台)。### 项目档案- 重用持久项目索引作为设置规模管理界面@@ -280,7 +288,7 @@ Token 用量**不是设置目的地**(D335 / ADR 0173)。已完成回合历- 该目的地是一个工作台(D267),由 D455 修订为单列:精简行,检查器在选中行下方铺满宽度;现进一步改为 iOS 意义上的内嵌分组索引:选中行就是它自己卡片的表头,因此详情在该行下方展开,且不重复行上已有的信息。- 一个工具栏领起页面,且默认不展开任何内容:与能力页面和导入目的地一样,+ 一个工具栏领起页面,且默认不展开任何内容:与能力页面和内嵌导入工作台一样,该目的地不带说明行,页面标题与控制之间没有整句文字。它复用与智能体能力页面(D257)相同的构成、控件高度和行节奏,不引入页面专属装饰。@@ -368,7 +376,7 @@ Token 用量**不是设置目的地**(D335 / ADR 0173)。已完成回合历1.打开设置隐藏编码应用侧边栏(全页接管)2. 导轨顶部显示搜索药丸,底部固定返回应用程序操作并与主侧边栏底部图标行同一条线,并精确显示常规、AI、快捷键、指令、模型、技能、MCP、- 子智能体、导入、项目、云同步、远程主机和信息(远程主机仅在开发者模式开启时显示),+ 子智能体、项目、云同步、远程主机和信息(远程主机仅在开发者模式开启时显示),并按偏好、智能体、工作区、系统分组。没有用量设置目的地。3.外观是常规的一部分,没有独立的导轨目的地diff --git a/docs/zh-CN/spec/04-ux/07-ui-design-system.md b/docs/zh-CN/spec/04-ux/07-ui-design-system.mdindex caba303ca..7832703f4 100644--- a/docs/zh-CN/spec/04-ux/07-ui-design-system.md+++ b/docs/zh-CN/spec/04-ux/07-ui-design-system.md@@ -1257,9 +1257,9 @@ Linux 保留淡入淡出和滑动退出。根据 D092,内容卡填充当前可用的窗格宽度窗口而不是保留 D070 的固定 720px 上限 - 早期的 in-shell200px 轨道和广泛的分组目录被取代-- **导入**:四种类型(会话 / 模型 / 技能 / MCP)位于一个页面级分段切换器之后,- 其构成与智能体能力页面一致:每个类型一个安静的扫描前下一步操作状态、- 每个类型一个工具栏(全选连同两个计数、该类型自己的选项、重新扫描、导入所选),- 以及一个列表,其分组标题是安静的标签行、候选项是独立磁贴。没有按类型划分的- 扫描卡片、没有着色的分组条带,也没有第二份设置行脚手架副本+- **内嵌导入工作台**:模型配置、外部技能与外部 MCP 扫描分别位于模型、技能和 MCP+ 设置页中,由各页的操作显式打开和启动;设置不再有独立的导入目的地或会话导入面板。+ 工作台复用智能体能力页的紧凑工具栏和候选列表:扫描前显示安静的下一步提示,来源分组+ 使用标签行与独立候选磁贴,不绘制着色分组条带。技能和 MCP 导入遵循各自页面当前的+ 全局/项目筛选及所选项目;会话导入由插件 API 提供。- 浅色目的地卡使用白色高架板(不是平坦的灰色填充)diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.mdindex cf98ccc75..35181745c 100644--- a/docs/zh-CN/spec/04-ux/08-component-spec.md+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md@@ -2610,104 +2610,70 @@ dismissToast(id: number); // ToastHost internal / tests----## 18. 导入目的地+## 18. 内嵌导入工作台### 18.1 目的-扫描受支持的本地代理存储,找出这台机器能够移交的四样内容——会话、-提供商/模型配置、技能和 MCP 服务器——然后审查候选项、选中它们并-发起一次显式导入。+模型配置、外部技能与外部 MCP 导入分别位于拥有这些记录的“模型”“技能”和“MCP”+设置页。设置不提供会话导入目的地;插件仍通过既有 API 导入会话,并遵循插件归属与+项目绑定规则。-### 18.2 解剖学+### 18.2 共享结构-每个类型一个工作台,位于分段式类型切换器之后;每个类型拥有自己的-扫描、选择和导入操作。+各设置页通过一个操作按钮展开内嵌工作台。工作台关闭时仍保持挂载,因此重新打开可保留+扫描结果和选择;目标作用域改变或用户重新扫描时,候选结果会更新。```text-[ Sessions | Models | Skills | MCP ] ← 类型切换器-[ ] Found 12 · 6 selected Group by: Source ▾ [Scan] [Import selected (6)]-───────────────────────────────────────────────────────────────────────────-CLAUDE CODE ~/code/pi 4-[ ] Refactor the importer 12 messages · Jan 5, 2026 [Claude Code]+模型:提供商 [从其他工具导入] [添加提供商]+技能:[全部 | 全局 | 项目] [搜索] [扫描其他工具] [新建] [市场]+MCP:[全部 | 全局 | 项目] [搜索] [扫描其他工具] [添加] [市场]++[ ] 已找到 3 · 已选 1 [扫描] [导入所选 (1)]+CLAUDE CODE 1+[ ] example-server node [stdio]```-- 切换器复用侧边栏和设置导航栏已经发布的标签(`nav.sessions`、- `settings.nav.models`、`settings.nav.skills`、`settings.nav.mcp`),- 因此该页面不新增自己的目录条目。-- 每个类型都带自己的工具栏:全选复选框连同“found”文案和已选数量、- 该类型自己的选项(会话分组、技能导入模式)、重新扫描,以及 Import selected。-- 在某个类型首次扫描之前,其面板会显示一个安静的下一步操作状态:扫描会读取- 什么,以及 Scan 操作。切换选项卡绝不会启动扫描(D007 / D342)。-- 分组标题是安静的标签行——来源或项目名称、以等宽字体显示的解析路径,- 以及一个计数胶囊——而不是着色条带;它们下方的候选项是独立磁贴。-- 分组控件支持**项目路径**和**来源**。来源是默认值。在项目路径模式下,- 精确路径在分组标题中保持可见,没有项目路径的会话出现在最后的- **无项目**分组中。-- 导入来源名称、分组与模式控件、计数、结果和可访问名称都来自共享的- i18n 目录。候选项日期使用当前应用区域设置。--### 18.3 状态和交互--- 一次成功的扫描会替换先前的候选集合、清空选择,并让每个分组保持展开:- 找到的候选项就是扫描的答案,所以它们不会被藏在第二次点击之后。-- 每个类型各自扫描:会话扫描绝不会启动模型配置、技能或 MCP 扫描,- 切换选项卡会保留离开的那个类型的结果和选择(非活动面板保持挂载并隐藏)。-- 一次成功的导入会为每个不同的非空项目路径创建或重复使用一个持久的项目索引条目- 并刷新 sessions/projects。-- 当一次成功的核心或插件导入在已归档项目下新增一个绑定项目的会话时,- 渲染器会在刷新之后恢复该项目的展示状态,使该项目和导入的会话在默认- 侧边栏中可见。这只适用于新增的绑定会话;普通刷新、无路径会话和被跳过的- 导入都会保留归档状态。-- 无路径导入不会创建项目条目并保留在临时- 会话下。导入永远不会创建物理文件系统目录。-- 重新导入现有来源会话会跳过它,而不会重复其项目条目。-- 更改分组模式会保留候选选择,并让每个新形成的分组保持展开。-- 展开或折叠一个分组不会影响其他分组。-- 分组和全局复选框支持选中、未选中和不确定- 选择状态;全局复选框将部分选择报告为不确定。-- 每个分组内的候选项以及分组本身都按最新优先排序;- 无路径分组在项目路径模式下保持在最后。--### 18.4 辅助功能--- 类型切换器是一个由 `tab` 控件组成的 `tablist`,每个控件都带有- `aria-selected` 和命名其面板的 `aria-controls`。每个面板都是一个由其选项卡- 标记的 `tabpanel`;非活动面板是 `hidden`,而不是被视觉覆盖。-- 每个公开按钮都会公开 `aria-expanded` 并引用其主体- `aria-controls`。-- 全局和分组复选框具有本地化的可访问名称,并携带不确定状态。-- 分组和导入模式选择器是共享的应用内菜单选择器,具有可见标签并可通过键盘操作,- 绝不是平台绘制的 `<select>`。-- 分组计数胶囊以其标题携带本地化的计数文案。-- 项目行公开按钮和操作菜单按钮公开本地化、-项目特定的可访问名称。+- 扫描由用户明确启动;展开或收起工作台不会自动扫描。+- 成功扫描会替换候选集合、清空选择,并展开来源分组。分组标题显示本地化计数,点击后可收起其候选行。+- 候选行以独立磁贴显示来源、身份、简短元数据和类型徽标;不显示秘密。至少选择一项后才可导入。+- 技能或 MCP 的目标作用域改变时,工作台会重置,防止把旧目标的候选导入到新目标。++### 18.3 能力作用域++- 目标由页面当前的“全局 / 项目”筛选决定。“全部”筛选与现有新建行为一致,写入全局作用域。+- 选择“项目”但尚未选择项目路径时,扫描入口禁用。+- 项目扫描会收到所选项目路径;导入经 IPC 写入 Host 时同时携带级别和路径。来源 MCP 服务器原本禁用时,保持禁用状态的写入也使用相同作用域。+- 技能保留复制/链接模式。导入成功后刷新能力列表和扫描结果。++### 18.4 辅助功能与响应式布局++- 导入切换按钮公开 `aria-expanded`,并通过 `aria-controls` 指向受控面板;关闭时面板为 `hidden`。+- 分组披露按钮公开 `aria-expanded`,并通过 `aria-controls` 指向分组内容。+- 全选、分组与候选项复选框使用共享复选框控件,具有本地化可访问名称和不确定状态。+- 窄窗口下分组名称与计数可换行,工具栏操作折行而不造成页面水平滚动。### 18.5 ModelConfigImportPanel-扫描同样那些本地 agent 存储中的提供商与模型设置,按来源分组查看候选项,-选中它们,然后发起一次显式导入。+模型页在“提供商”区块中提供外部模型配置扫描,覆盖 Claude Code、Codex、OpenCode、Pi+与 CC Switch。候选行显示提供商名称、模型数量、主机、来源以及 API key / No API key+徽章;原始密钥不会进入渲染器,而是通过 Host secret store 保存。OAuth 与订阅登录不复制。+若归一化 URL、API 风格和凭据均相同,则重复导入会跳过;同一端点的不同凭据保留为独立+提供商。若导入前尚无默认模型,首个新建的提供商成为默认值。-```text-[ ] Found 3 · 1 selected [Scan] [Import selected (1)]-───────────────────────────────────────────────────────────────────────────-CLAUDE CODE 1-[ ] acme-gateway 4 models · api.acme.dev [API key]-```+### 18.6 外部技能导入++技能页工具栏在“新建”和“市场”旁提供“扫描其他工具”。扫描支持的 Claude 与 Pi 技能+存储,候选行显示名称、描述或来源路径以及文件/文件夹形态。复制/链接选项位于工作台中。+导入遵循所选全局/项目作用域和项目路径,随后刷新技能列表与扫描结果。各作用域中的原生+文件和文件夹导入操作继续保留。++### 18.7 外部 MCP 导入-- 该类型独立于会话导入:它有自己的扫描、选择和 Import selected 操作。- 会话扫描绝不会启动模型配置扫描,两者在切换器之后一次只显示一个。-- 按来源分组是唯一的分组方式。一次成功的扫描会替换先前的候选集合、清空- 选择,并让所有分组保持展开。-- 每一行显示提供商名称、模型数量、主机、“有 API key / 无 API key”徽章,- 以及来源。原始密钥绝不会到达渲染器。-- 导入会为每个选中的候选项创建一条 `providers.create` 记录。若已存在- base URL 归一化结果、API 风格和凭据都相同的提供商,则跳过;同一端点的- 不同凭据创建独立记录。仅支持 OAuth 的- 来源账户不会出现在扫描结果中。CC Switch 是第五个来源- (`~/.cc-switch/cc-switch.db`);与某个 CC Switch 端点和凭据都匹配的实时- 工具文件不会被列出两次,不同凭据仍会保留。-- 若一次成功创建之后 `settings.defaultProviderId` 仍为空,则第一个新建的- 提供商成为全局默认。+MCP 页工具栏在“添加”和“市场”旁提供“扫描其他工具”。扫描支持 Claude Desktop、+Claude Code、Cursor、Codex、OpenCode 与 ChatGPT Desktop。候选行显示名称、安全元数据、+来源和传输方式。URL 元数据只保留主机,不渲染 userinfo、路径或查询参数;环境变量与+请求头值不显示。导入遵循所选全局/项目作用域和项目路径;来源服务器处于禁用状态时,+Host 写入后仍保持禁用。---@@ -2999,8 +2965,8 @@ Sidebar footer Popover (360px max)11. 所有组件都有正确的 ARIA 角色和标签12. 响应式折叠在 800px 和 640px 断点处工作13. Toast 堆叠在顶部中心,带有变体图标 + 关闭、自动关闭 4s/8s、悬停时暂停,并根据 §17 通过 01-ui-ia.md/03-permission-ux.md 进行宣布-14. 会话导入默认为源分组,提供项目路径分组,在 scan/group 更改后折叠所有组,并根据 §18 公开可访问的组公开状态-15. 导入的项目路径在持久项目索引中只出现一次;无路径导入保留临时会话并且不会创建文件系统目录+14. 模型、技能和 MCP 工作台只有在用户明确启动扫描后才读取来源;技能与 MCP 导入遵循当前作用域和所选项目+15. 设置不呈现会话导入 UI;插件导入的项目会话遵循插件 API 的项目绑定规则,并在持久项目索引中复用项目记录16. ProviderStudio显示英雄总结+添加对话框+提供商卡;秘密永远不会变得原始; test/default/delete 保持键盘可访问17.NotificationInbox 公开 All/Unread 视图、确切的未读徽章语义、行激活、标记所有已读和清除操作;它是键盘可操作的diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.mdindex d5e8af915..83f5ceb83 100644--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md@@ -1198,34 +1198,42 @@ task-candidate E2E 从请求工作树运行,但使用主工作区已经准备- **里程碑**:M2- **状态**:草案-#### E2E-036:本地化导入分组开始折叠+#### E2E-036:设置会话导入目的地已移除-- **先决条件**:支持的本地代理存储包含跨至少两个项目路径和两个源的可导入会话,包括一个没有项目路径的会话;该应用程序可以使用英语系统区域设置启动一次,也可以使用简体中文系统区域设置启动一次。-- **步骤**: 1) 以英文启动并打开“设置”→“导入”。 2) 扫描会话。 3) 检查初始源组。 4) 展开一个组并选择一个会话。 5) 将分组依据更改为项目路径。 6) 切换回源。 7) 使用简体中文系统区域设置启动后重复该流程。-- **预期**:来源/来源是初始分组;扫描后以及任一分组更改后,所有组都会折叠;项目路径模式显示准确的项目路径和最终的“无项目/未关联项目组”;一组的扩张导致其他组的崩溃;选定的会话在分组更改中保持选定状态;计数、日期、选择标签、可访问名称和导入结果使用活动区域设置,无需原始键或未解析的双括号占位符。-- **链接规格**:`04-ux/01-ui-ia.md`、`04-ux/02-i18n-english-first.md`、`04-ux/08-component-spec.md`-- **接受**:F(会话导入审核)-- **里程碑**:M2-- **状态**:草案+- **预期**:设置中没有会话导入选项卡或扫描面板。插件仍可通过宿主拥有的会话 API 导入会话,相关边界由 E2E-214 / E2E-215 / E2E-216 覆盖。旧本地会话扫描器只由导入器单元测试覆盖。+- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md`、`07-plugins/03-plugin-api.md`、ADR 0319 / D645+- **状态**:D645 退役;设置 UI 已移除-#### E2E-037:导入创建持久的项目条目+#### E2E-037:核心会话导入项目流程已退役-- **前提条件**:导入候选者包括两个路径 A 的会话、一个路径 B 的会话和一个没有项目路径的会话;这两个项目都不是活动工作区。-- **步骤**:1) 导入所有候选。 2) 打开设置→项目存档。 3) 检查并扩展路径 A 和 B。 4) 返回家中并检查临时会话。 5) 重复导入。-- **预期**:项目存档恰好包含 A 的一行和 B 的一行;匹配的导入会话出现在其确切的项目行下;无路径会话仅出现在临时会话下;活动工作区不会改变;重复导入既不会重复会话,也不会重复项目行;磁盘上不会创建丢失的文件系统路径。-- **链接规格**:`03-runtime/04-data-storage.md`、`04-ux/01-ui-ia.md`、`04-ux/08-component-spec.md`-- **接受**:F(session/project 持久性)-- **里程碑**:M2-- **状态**:草案+- **预期**:会话导入时的项目绑定与渲染器刷新由插件会话导入 E2E-216 验证。设置不再调用旧的核心会话扫描/导入路径;插件归属、持久项目记录和项目存档行为保持不变。+- **链接规格**:`03-runtime/04-data-storage.md`、`04-ux/01-ui-ia.md`、`07-plugins/03-plugin-api.md`、ADR 0319 / D645+- **状态**:由 E2E-214 / E2E-216 取代#### E2E-038:设置拥有项目存档目标-- **先决条件**:应用程序运行时至少有一个已配置的提供程序、一个受支持的本地会话存储、一个保留的项目和一个存档的项目。-- **步骤**:1) 打开设置。 2) 检查完整的设置导轨。 3) 打开Basics 并使用可搜索主题选择器更改其外观卡中的主题。 4) 打开全局 AI 并检查权限和默认项卡,包括命令 Shell 行;确认上下文管理没有设置卡。 5) 打开快捷方式并检查键盘快捷方式卡。 6) 打开指令并保存全局指令。 7) 打开模型配置并检查提供商工作室。 8) 按顺序打开“导入”、“项目存档”和“信息”。 9) 搜索设置“项目”或“存档”。 10) 在项目存档中,将每个分组条的计数与其呈现的行进行比较。 11) 将排序控件从“最近”切换到“名称”。 12) 搜索已知的会话标题,检查其展开的项目行,然后显示八个以上的会话;通过清晰的功能来清除搜索。 13) 打开行菜单,使用 Escape 并按下外部按钮将其关闭。 14) 恢复存档的项目,然后激活它。 15) 归档一个项目会话,从项目归档中打开它,然后返回项目归档。 16) 返回应用程序外壳并打开插件。-- **预期**:该导轨按顺序包含基础知识、全局 AI/AI、快捷方式、说明、模型配置、导入、项目存档和信息,每个都有其语义 Lucide 图标(滑块/火花/键盘/文件文本/机器人/下载/存档/信息);行按四个柔和的非交互标题分组:Personal / 个人包含基础知识、全局 AI 和快捷键,Agent / 智能体包含说明和模型配置,Workspace / 工作区包含导入和项目存档,About / 关于包含信息;分组之间使用留白而不是分割线,搜索保持目的地结果扁平,并将空分组及其标题一起隐藏。外观保留在基础下,权限、默认项和命令 Shell 行位于全局 AI 下;可用的已选 Shell 由选择器表示,不重复显示“已配置”状态;默认、回退和无实际 Shell 状态仍明确展示;上下文管理没有设置卡;键盘快捷键和全局指令都有自己的目的地;开发者生活在 Info 下;项目存档显示活动、关闭和存档的持久行,无需可见性切换,将它们分组在一个面板内始终可见的固定/所有项目/存档分组条 (D168/D267) 下,并带有每个部分的计数。该目的地不呈现英雄区块,也没有页面级计数器串:引导区是一条安静的说明行,每个分组条的计数与其呈现的行一致;按名称排序会重新排序每个部分内的行,而不隐藏任何行;搜索匹配项目字段和会话标题并报告匹配计数,会话标题结果扩展其所属项目,按最新活动和相对更新时间列出会话,并以八个批次显示历史记录;清除搜索将恢复完整索引。行菜单在 Escape 和外部按下时关闭。恢复使存档保持打开状态,激活返回以与侧栏中保留的恢复项目聊天。打开归档会话时,应用会先成功选择该会话,再清除它的归档状态;聊天页选中该会话,项目侧边栏重新显示它,返回项目归档后它也不再处于归档状态。主页侧边栏和全局页面结果没有独立的项目目标;设置搜索找到项目存档;插件仍然是一个独立的应用程序外壳目的地。+- **先决条件**:应用程序已开启开发者模式,并至少配置一个提供商、保留一个项目且有一个已存档项目。+- **步骤**:+ 1) 打开设置并检查完整的设置导轨。+ 2) 打开“常规”,使用可搜索主题选择器更改外观卡中的主题。+ 3) 打开“AI”并检查权限和默认项卡,包括命令 Shell 行;确认上下文管理没有设置卡。+ 4) 打开快捷方式并检查键盘快捷方式卡。+ 5) 打开指令并保存全局指令。+ 6) 打开“模型”并检查提供商工作室和内嵌导入操作。+ 7) 打开“技能”和“MCP”,确认各自都有外部导入操作。+ 8) 按顺序打开“项目”和“信息”。+ 9) 搜索设置“项目”或“存档”。+ 10) 在“项目”中,将每个分组条的计数与其呈现的行进行比较。+ 11) 将排序控件从“最近”切换到“名称”。+ 12) 搜索已知的会话标题,确认所属项目被选中且检查器列出匹配会话,然后显示八个以上的会话;通过清除控件清除搜索。+ 13) 打开检查器菜单,使用 Escape 和外部按下来关闭。+ 14) 恢复存档的项目,然后激活它。+ 15) 归档一个项目会话,从项目归档中打开它,然后返回项目归档。+ 16) 返回应用程序外壳并打开插件。+- **预期**:导轨按顺序包含常规、AI、快捷键、指令、模型、技能、MCP、子智能体、项目、云同步、远程主机和信息,分别使用其语义 Lucide 图标;目的地按“偏好”(常规、AI、快捷键)、“智能体”(指令、模型、技能、MCP、子智能体)、“工作区”(项目)和“系统”(云同步、远程主机、信息)分组。组间使用留白而非分割线,搜索保持目的地结果扁平,并同时隐藏空分组及其标题。模型、技能和 MCP 页分别拥有内嵌的外部导入工作台;打开工作台不会扫描。设置没有会话导入面板,会话导入由插件 API 提供。外观保留在“常规”下,权限、默认项和命令 Shell 行位于全局 AI 下;可用的已选 Shell 由选择器表示,不重复显示“已配置”状态;默认、回退和无实际 Shell 状态仍明确展示;上下文管理没有设置卡;键盘快捷键和全局指令都有自己的目的地;“开发者”位于“信息”下;项目存档显示活动、关闭和存档的持久行,无需可见性切换,将它们分组在一个面板内始终可见的固定/所有项目/存档分组条 (D168/D267) 下,并带有每个部分的计数。该目的地不呈现英雄区块,也没有页面级计数器串:引导区是一条安静的说明行,每个分组条的计数与其呈现的行一致;按名称排序会重新排序每个部分内的行,而不隐藏任何行;搜索匹配项目字段和会话标题并报告匹配计数,会话标题结果扩展其所属项目,按最新活动和相对更新时间列出会话,并以八个批次显示历史记录;清除搜索将恢复完整索引。行菜单在 Escape 和外部按下时关闭。恢复使存档保持打开状态,激活返回以与侧栏中保留的恢复项目聊天。打开归档会话时,应用会先成功选择该会话,再清除它的归档状态;聊天页选中该会话,项目侧边栏重新显示它,返回项目归档后它也不再处于归档状态。主页侧边栏和全局页面结果没有独立的项目目标;设置搜索找到项目存档;插件仍然是一个独立的应用程序外壳目的地。- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/01-ui-ia.md`、`03-runtime/11-provider-model-system.md`-- **接受**:B(模型配置),F(会话导入)-- **里程碑**:M4+- **接受**:B(模型配置),F(项目存档与持久化)+- **里程碑**:M5- **状态**:单位覆盖(`settings-project-archive.test.mjs`、`sidebar-navigation.test.mjs`);渲染场景草稿#### E2E-091:外观卡通过可搜索主题和语言选择器选择@@ -1273,7 +1281,7 @@ task-candidate E2E 从请求工作树运行,但使用主工作区已经准备#### E2E-043:设置内容跟随窗口宽度- **先决条件**:应用程序在 macOS 上以窗口方式运行,并且打开“设置”。-- **步骤**: 1) 以默认窗口宽度打开Basics,并记录内容卡宽度。 2) 将窗口扩展到 1600px 宽。 3) 打开模型配置、导入和项目存档。 4) 将窗口缩小到支持的最小 800px。+- **步骤**: 1) 以默认窗口宽度打开“常规”,并记录内容卡宽度。 2) 将窗口扩展到 1600px 宽。 3) 打开模型、技能、MCP 和项目。 4) 将窗口缩小到支持的最小 800px。- **预期**:右侧内容卡在每个测试宽度上随可用窗格展开和收缩; 275px 导轨和窗格排水沟保持稳定;控件保持可见,无需剪切或水平页面滚动。- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/07-ui-design-system.md`- **验收**:质量(关键操作感觉很精致)@@ -3286,7 +3294,7 @@ PI-Desktop 图标;两个表面都不会暴露库存 Electron 名称或图标- **先决条件**:PI-Desktop 在 Windows 上运行,有光和暗可用的主题。-- **步骤**:1)在浅色主题中,打开仍存在的本机选择(计划任务表单),并确认设置里的常规、全局 AI、模型配置和导入选择器都是应用内菜单而不是平台 `<select>`。2)以深色主题重复剩余本机列表。3)切换主题后无需重启即可再次打开每个列表。+- **步骤**:1)在浅色主题中,打开仍存在的本机选择(计划任务表单),并确认设置里的常规、全局 AI 和技能导入模式选择器都是应用内菜单而不是平台 `<select>`。2)以深色主题重复剩余本机列表。3)切换主题后无需重启即可再次打开每个列表。- **预期**:设置里的紧凑选择器使用共享锚定菜单。每个仍存在的关闭本机触发器和打开的本机选项列表都使用活动主题的可读 foreground/background 配对。没有黑暗主题列表退回到带有浅色文本的浅色 Windows 表面,没有浅色主题列表使用深色主题墨水,更改主题会更新后续打开。同样的结果适用于设置之外的本机选择。- **链接规格**:`04-ux/06-settings-ia.md`,`04-ux/07-ui-design-system.md`@@ -3445,7 +3453,7 @@ IPC 请求无法关闭。2. 检查侧边栏和启动画面中渲染的 `BrandLogo` 源,并检查空首页英雄中的浅色八帧 `HomeMascotLogo` GIF。将鼠标悬停在吉祥物上并验证节奏不变。- 3. 将主题切换为深色(设置→基础→外观,或系统外观更改)。+ 3. 将主题切换为深色(设置→常规→外观,或系统外观更改)。4. 重新检查相同的表面,无需重新加载。5. 切换回光源并重新检查。- **预期**:@@ -5581,18 +5589,18 @@ eleven-tool-round desktop paths are verified by| 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 |-| F——坚持 | E2E-020、E2E-021、E2E-036、E2E-037、E2E-038、E2E-040、E2E-042、E2E-047、E2E-048、E2E-048c、E2E-051、E2E-054、E2E-056、E2E-061、E2E-062、 E2E-064、E2E-066、E2E-068、E2E-071、E2E-072、E2E-073、E2E-082、E2E-084、E2E-096、E2E-098、E2E-102、E2E-102b、E2E-103、E2E-代理-001、 E2E-061a、E2E-073a、E2E-104、E2E-106、E2E-107、E2E-108、E2E-109、E2E-110、E2E-112、E2E-118、E2E-119、E2E-120、E2E-121、E2E-123、E2E-142、E2E-146、E2E-148、E2E-151、E2E-171、E2E-005J |+| F——坚持 | E2E-020、E2E-021、E2E-038、E2E-SETTINGS-inline-capability-imports、E2E-040、E2E-042、E2E-047、E2E-048、E2E-048c、E2E-051、E2E-054、E2E-056、E2E-061、E2E-062、 E2E-064、E2E-066、E2E-068、E2E-071、E2E-072、E2E-073、E2E-082、E2E-084、E2E-096、E2E-098、E2E-102、E2E-102b、E2E-103、E2E-代理-001、 E2E-061a、E2E-073a、E2E-104、E2E-106、E2E-107、E2E-108、E2E-109、E2E-110、E2E-112、E2E-118、E2E-119、E2E-120、E2E-121、E2E-123、E2E-142、E2E-146、E2E-148、E2E-151、E2E-171、E2E-005J || F——持久化(项目排序) | E2E-253 || G——插件 | E2E-022、E2E-022A、E2E-022B、E2E-022C、E2E-023、E2E-024、E2E-024B、E2E-024C、E2E-024D、E2E-024AA、E2E-024E、E2E-024W、E2E-024F、E2E-024G、E2E-024H、 E2E-024I、E2E-024J、E2E-024K、E2E-024L、E2E-024M、E2E-024N、E2E-024O、E2E-024P、E2E-025、E2E-026、E2E-105、E2E-117、E2E-120、E2E-122、E2E-123、E2E-148、E2E-153、E2E-PLUGIN-imported-pi-package-skills、E2E-PLUGIN-imported-pi-package-wrapper、E2E-PLUGIN-import-extension-installs-dependencies、E2E-PLUGIN-import-extension-reports-missing-dependency、E2E-PLUGIN-global-shortcut-owns-only-its-own-command、E2E-PLUGIN-permission-gate-for-real-time-capabilities、E2E-PLUGIN-background-audio-and-realtime-connection || H——诊断 | E2E-027、E2E-031、E2E-034、E2E-042、E2E-096、E2E-098、E2E-104、E2E-107、E2E-108、E2E-109、E2E-110、E2E-113、E2E-115、E2E-116、 E2E-118、E2E-121、E2E-146、E2E-194、E2E-195 |-| 安全性 | E2E-028、E2E-029、E2E-030、E2E-024J、E2E-024K、E2E-024M、E2E-049、E2E-068、E2E-086、E2E-105、E2E-106、E2E-107、E2E-108、E2E-109、 E2E-110、E2E-112、E2E-113、E2E-115、E2E-116、E2E-117、E2E-119、E2E-121、E2E-122、E2E-123、E2E-142、E2E-148、E2E-151、E2E-153 |-| 品质 | E2E-CHAT-running-status-survives-output-pauses、E2E-032、E2E-033、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048c、E2E-048A、E2E-049、E2E-050、E2E-053、E2E-055、 E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、 E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、 E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-094、E2E-095、E2E-096、E2E-097、E2E-098、E2E-099、E2E-100、E2E-101、E2E-102、 E2E-102a、E2E-102b、E2E-103、E2E-AGENTS-001、E2E-024N、E2E-024O、E2E-059a、E2E-060b、E2E-060c、E2E-060d、E2E-061a、E2E-073a、E2E-111、 E2E-114、E2E-117、E2E-118、E2E-119、E2E-120、E2E-122、E2E-123、E2E-142、E2E-143、E2E-144、E2E-145、E2E-146、E2E-147、E2E-148、E2E-150、E2E-151、E2E-153、E2E-194、E2E-195、E2E-199、E2E-200、E2E-201、E2E-202、E2E-203、E2E-204、E2E-209、E2E-210、E2E-UPDATE-preference-and-once-only-reminder、E2E-250、E2E-PLUGIN-imported-pi-package-skills、E2E-SUBAGENT-resume-a-settled-delegation |+| 安全性 | E2E-SETTINGS-inline-capability-imports、E2E-028、E2E-029、E2E-030、E2E-024J、E2E-024K、E2E-024M、E2E-049、E2E-068、E2E-086、E2E-105、E2E-106、E2E-107、E2E-108、E2E-109、 E2E-110、E2E-112、E2E-113、E2E-115、E2E-116、E2E-117、E2E-119、E2E-121、E2E-122、E2E-123、E2E-142、E2E-148、E2E-151、E2E-153 |+| 品质 | E2E-SETTINGS-inline-capability-imports、E2E-CHAT-running-status-survives-output-pauses、E2E-032、E2E-033、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048c、E2E-048A、E2E-049、E2E-050、E2E-053、E2E-055、 E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、 E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、 E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-094、E2E-095、E2E-096、E2E-097、E2E-098、E2E-099、E2E-100、E2E-101、E2E-102、 E2E-102a、E2E-102b、E2E-103、E2E-AGENTS-001、E2E-024N、E2E-024O、E2E-059a、E2E-060b、E2E-060c、E2E-060d、E2E-061a、E2E-073a、E2E-111、 E2E-114、E2E-117、E2E-118、E2E-119、E2E-120、E2E-122、E2E-123、E2E-142、E2E-143、E2E-144、E2E-145、E2E-146、E2E-147、E2E-148、E2E-150、E2E-151、E2E-153、E2E-194、E2E-195、E2E-199、E2E-200、E2E-201、E2E-202、E2E-203、E2E-204、E2E-209、E2E-210、E2E-UPDATE-preference-and-once-only-reminder、E2E-250、E2E-PLUGIN-imported-pi-package-skills、E2E-SUBAGENT-resume-a-settled-delegation || 品质(项目排序) | E2E-253 || C — 对话和直播(输入法斜杠别名) | E2E-255 || E——工具和权限(Skill 常驻) | E2E-254 || 品质(Skill 常驻与输入法斜杠别名) | E2E-254、E2E-255 |-| C — 对话和直播(导入可见性) | E2E-257 |-| F——持久化(导入可见性) | E2E-257 |+| C — 对话和直播(插件会话导入可见性) | E2E-257 |+| F——持久化(插件会话导入可见性) | E2E-257 || C — 对话和直播(聊天文件引用) | E2E-CHAT-shorthand-file-ref-opens-the-matching-file、E2E-CHAT-file-ref-opens-the-surface-that-owns-it || C / 质量 / 安全(对话 MP4 附件) | E2E-CHAT-mp4-attachment-opens-in-system-player || G——插件(聊天文件引用) | E2E-CHAT-file-ref-opens-the-surface-that-owns-it、E2E-PLUGIN-file-view-collapse-persists |@@ -5600,8 +5608,8 @@ eleven-tool-round desktop paths are verified by| G——插件(项目文件夹根) | E2E-PLUGIN-file-view-switches-folder-per-project || 安全性(项目文件夹根) | E2E-PLUGIN-file-view-switches-folder-per-project || 品质(项目文件夹根) | E2E-PLUGIN-file-view-switches-folder-per-project |-| G——插件(导入可见性) | E2E-257 |-| 品质(导入可见性) | E2E-257 |+| G——插件(会话导入可见性) | E2E-257 |+| 品质(插件会话导入可见性) | E2E-257 || G——插件(Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers || 安全性(Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers || 品质(Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers |@@ -5632,7 +5640,7 @@ eleven-tool-round desktop paths are verified by|---|---|| MVP 后实验性交互维护 | E2E-LIVE-VOICE-four-stage-ui || M1 | E2E-001、E2E-002、E2E-003、E2E-028、E2E-029 |-| M2 | E2E-004、E2E-005、E2E-006、E2E-007、E2E-008、E2E-008d、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-020、E2E-021、E2E-027、E2E-031、 E2E-036、E2E-037、E2E-042、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-144、E2E-005J、E2E-201 |+| M2 | E2E-004、E2E-005、E2E-006、E2E-007、E2E-008、E2E-008d、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-020、E2E-021、E2E-027、E2E-031、E2E-042、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-144、E2E-005J、E2E-201 || M3 | E2E-012、E2E-013、E2E-014、E2E-015、E2E-016、E2E-017、E2E-018、E2E-019、E2E-040 || M4 | E2E-022、E2E-023、E2E-024、E2E-025、E2E-026、E2E-030、E2E-038 || M5 | E2E-CHAT-running-status-survives-output-pauses、E2E-008a、E2E-032、E2E-033、E2E-034、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048c、E2E-048A、E2E-049、E2E-050、 E2E-051、E2E-052、E2E-053、E2E-054、E2E-055、E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、 E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、 E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-096、E2E-097、E2E-098、E2E-099、 E2E-100、E2E-101、E2E-102、E2E-102a、E2E-102b、E2E-AGENTS-001、E2E-059a、E2E-060b、E2E-060c、E2E-061a、E2E-073a、E2E-094、E2E-095、E2E-143、E2E-145、E2E-146、E2E-147、E2E-194、E2E-195、E2E-204、E2E-250 |@@ -5640,7 +5648,7 @@ eleven-tool-round desktop paths are verified by| M2(输入法斜杠别名) | E2E-255 || M5(Skill 常驻) | E2E-254 || M6 | E2E-104、E2E-105、E2E-106、E2E-107、E2E-108、E2E-109、E2E-110、E2E-111、E2E-112、E2E-113、E2E-114、E2E-115、E2E-116、E2E-117、 E2E-118、E2E-119、E2E-120、E2E-103 |-| M6+ | E2E-121、E2E-122、E2E-123、E2E-142、E2E-148、E2E-150、E2E-151、E2E-168、E2E-199、E2E-200、E2E-202、E2E-203、E2E-209、E2E-211、E2E-UPDATE-preference-and-once-only-reminder、E2E-212、E2E-213、E2E-214、E2E-215、E2E-216、E2E-217、E2E-257、E2E-166、E2E-SUBAGENT-resume-a-settled-delegation |+| M6+ | E2E-121、E2E-122、E2E-123、E2E-142、E2E-148、E2E-150、E2E-151、E2E-168、E2E-199、E2E-200、E2E-202、E2E-203、E2E-209、E2E-211、E2E-UPDATE-preference-and-once-only-reminder、E2E-212、E2E-213、E2E-214、E2E-215、E2E-216、E2E-217、E2E-257、E2E-SETTINGS-inline-capability-imports、E2E-166、E2E-SUBAGENT-resume-a-settled-delegation || M6+(Session Orchestrator) | E2E-PLUGIN-session-orchestrator-real-workers || M6+(已选模型顺序) | E2E-MODEL-selected-order-persists || M6+(MCP 服务器超时覆盖) | E2E-261 |@@ -5913,10 +5921,9 @@ eleven-tool-round desktop paths are verified by### US-UI-24 设置全页 shell- 打开设置(页脚配置文件 → 设置)。-- 预计**全页** Codex 设置(无应用程序 sidebar/nav)。左导轨有后部- 到应用程序、搜索和确切的基础知识/全局AI/快捷方式/模型配置/- 按顺序导入/项目存档/信息;内容窗格显示部分标题和-目的地的设置或存档内容。+- 预计**全页**设置(无应用程序 sidebar/nav)。左导轨有返回应用、搜索,以及常规、AI、+ 快捷键、指令、模型、技能、MCP、子智能体、项目、云同步、远程主机、信息,+ 按该顺序排列;内容窗格显示所选设置页或项目存档。- 返回应用程序外壳并期望插件保持独立侧边栏页脚目的地。- 将空的 46 像素顶带拖到导轨或内容窗格上;本地人@@ -6020,8 +6027,8 @@ eleven-tool-round desktop paths are verified by- 全页外壳:`#f3f3f3` 上的轨道 ~260px,主 `#fff`;搜索药丸位于导轨顶部;返回应用程序固定在导轨底部,并与主外壳侧边栏底部图标行垂直居中于同一条线;带有图标的常规活动药丸。-- 铁路订单完全是常规、AI、快捷键、指令、模型、技能、MCP、子智能体、导入、- 项目和信息;其下显示偏好、智能体、工作区和系统四个柔和标题,组间没有+- 导轨顺序为常规、AI、快捷键、指令、模型、技能、MCP、子智能体、项目、云同步、+ 远程主机和信息;下方显示偏好、智能体、工作区和系统四个柔和标题,组间没有分割线、重复目的地或占位符行。选中页面仍保留描述性标题,例如“模型配置”和“项目归档”。- 常规内容:大标题和一张带有工作信息的**外观**卡@@ -6096,18 +6103,17 @@ eleven-tool-round desktop paths are verified by- 黑暗家庭范围内的会话创建控件保持安静的图标操作,无需独立的新任务行。-### US-UI-52 设置金铬指标 (D070)-- 打开“设置”灯“基本”,分辨率约为 1200×690。-- 预计约 275 像素 `#f4f4f4` 导轨,单个活性基础药丸,后退 + 搜索。-- 期望工作主题选择器没有惰性切换或开放目标行。-- 期待权限+基础+外观提升卡; Agent,-导入和信息仍然是唯一的其他目的地。-- 在 800 像素、1200 像素和 1600 像素宽度之间调整大小;内容卡填充+### US-UI-52 设置外观指标 (D070)+- 在约 1200×690 的窗口中打开浅色主题的“设置 → 常规”。+- 侧栏宽度约 275 像素,背景为 `#f4f4f4`,常规项为唯一选中项,并显示返回和搜索。+- 主题选择器可正常使用,且没有无效开关或打开目标行。+- “常规”页显示外观卡片,“AI”页显示权限和默认值卡片。核心侧栏依次包含常规、AI、快捷键、指令、模型、技能、MCP、子智能体、项目、云同步和信息;仅开发者模式显示远程主机。开发版且开启开发者模式时,AI 与快捷键之间可能显示语音;插件扩展目的地位于核心分组之后。侧栏不再有“导入”入口。+- 在 800、1200 和 1600 像素宽度之间调整窗口;内容卡片填充每种尺寸都可用右窗格,无需更换导轨或引入水平滚动。### US-UI-53 设置暗壳 (D070)-- 深色主题设置基础:黑色导轨、提升卡、蓝色开关、返回聊天。+- 深色主题设置常规页:黑色侧栏、卡片层级、蓝色开启状态,返回操作回到聊天。- 行描述使用主题感知辅助文本并保持清晰可读`#212121` 卡面;它们不能退回到低对比度的柔和墨水。@@ -6582,7 +6588,7 @@ eleven-tool-round desktop paths are verified by- **前置条件**:应用在 macOS 上运行,系统装有与内置令牌栈不同的字体(例如 PingFang SC);使用干净的 `~/.pi-desktop` 配置。- **步骤**:- 1) 打开设置 → 基础,确认外观卡片在主题与语言下方显示一个字体行,+ 1) 打开设置 → 常规,确认外观卡片在主题与语言下方显示一个字体行,触发器标签为「跟随系统」。2) 打开字体选择器,确认只列出跟随系统与系统已安装字体——没有内置开源字体,任何一行都没有许可证角标;@@ -7613,13 +7619,23 @@ eleven-tool-round desktop paths are verified by#### E2E-209:从本地智能体存储导入模型配置-- **前提条件**:本机存在 Claude Code / Codex / OpenCode / Pi / CC Switch 的提供商配置。-- **步骤**:1) 打开设置 → 导入 → 模型配置。2) 扫描并导入与现有行凭据不同的配置。3) 再次导入相同凭据。4) 确认 Composer 能选中新导入的提供商,密钥不进入渲染器。-- **预期**:规范化端点、API 风格和凭据都相同才视为等价;不同密钥在同一端点创建独立行。重复导入幂等跳过。见 ADR 0179 / ADR 0188 / D342 / D351。-- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md`、ADR 0179、ADR 0188-- **验收**:B、质量+- **前提条件**:至少有一个受支持的本地配置,来源包括 `~/.claude/settings.json`、`~/.codex/config.toml` 的 `[model_providers.*]`、`~/.config/opencode/opencode.json`、`~/.pi/agent/models.json` 或 `~/.cc-switch/cc-switch.db`;其中包含同一端点、不同 API key 的两个配置档案,并可选包含一个仅 OAuth 的厂商。PI-Desktop 中可以已有等价提供商。+- **步骤**:1) 打开设置 → 模型并展开“从其他工具导入”,确认扫描前工作台为空闲状态。2) 扫描模型配置,确认来源组默认展开、候选行显示名称/模型数/主机/API key 或 No API key 徽章,且界面和扫描 IPC payload 都没有秘密值。3) 导入选中的提供商,确认同端点的不同密钥成为独立记录并可在 Composer 模型菜单中选择;再次导入同一选择,确认未变化的凭据被跳过。4) 若应用此前没有默认模型,确认首个导入提供商成为默认;若已有默认值,确认其不变。5) 确认仅 OAuth 的来源账户不会出现在候选列表中。+- **预期**:只有显式扫描(D007)。已存储的 API key 写入宿主密钥库。只有等价提供商(归一化 URL + API 风格 + 相同凭据)会跳过;同端点的不同凭据保持独立。协议与 schema 版本不升级。+- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md` §18.5、`03-runtime/01-ipc-protocol.md`、`03-runtime/11-provider-model-system.md`、ADR 0179、D342+- **接受**:B(模型配置)+- **里程碑**:M4+- **状态**:单元覆盖(`packages/shared/src/model-config-import.test.ts`、`apps/desktop/test/model-config-import.test.mjs`);完整 UI 旅程为草稿(该表面变更时需在具备条件的环境中运行)++#### E2E-SETTINGS-inline-capability-imports:在所属设置页导入技能和 MCP++- **前提条件**:可扫描受支持的外部技能与 MCP 配置;至少有两个项目;一个来源 MCP 服务器处于禁用状态,URL 包含 userinfo 与查询凭据。+- **步骤**:1) 打开设置 → 技能,选择“项目”和一个项目,再展开“扫描其他工具”。确认打开面板不会扫描;启动扫描,选择技能,选择复制或链接模式并导入。2) 确认新技能属于所选项目。切换项目后确认旧候选与选择已清除。3) 打开设置 → MCP,选择“项目”和同一项目,展开“扫描其他工具”,扫描并导入已禁用的 MCP 候选。4) 确认服务器属于该项目、仍为禁用状态,候选行只显示 URL 主机,不显示 userinfo、路径或查询参数。5) 改变项目作用域后确认旧 MCP 候选与选择已清除。+- **预期**:技能和 MCP 扫描仅在用户明确启动后执行。项目扫描和写入携带所选项目路径;作用域变化会清除旧候选。MCP 禁用状态保持不变,候选元数据不会渲染 URL 凭据。+- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md` §18.3 / §18.6 / §18.7、ADR 0319 / D645+- **验收**:F(持久化)、Security、Quality- **里程碑**:M6+-- **状态**:单元已覆盖;完整 UI 旅程为草稿+- **状态**:源契约与作用域 IPC 测试覆盖(`settings-import-page.test.mjs`、`agent-capability-settings.test.mjs`、`agent-import-ipc.test.mjs`、`import-format.test.mjs`)。隔离 Electron 用例 `pnpm test:e2e:settings-inline-import` 覆盖项目级 MCP 扫描、选择、导入、可见结果和作用域载荷。#### E2E-213:Composer 模型菜单首帧保持已配置别名@@ -8149,16 +8165,15 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture- **验收**:品质(项目入口)、D(工作区)- **里程碑**:M5- **状态**:单元覆盖(`apps/desktop/test/project-create-dialog.test.mjs`、`apps/desktop/test/git-clone.test.mjs`);渲染桌面旅程为草稿(除非明确要求,不本地运行 E2E)-#### E2E-257:导入到已归档项目后恢复其可见性+#### E2E-257:通过插件导入会话后恢复已归档项目的可见性-- **前提条件**:一个持久项目已在渲染器侧边栏偏好中归档,并从默认侧边栏隐藏。一个核心导入候选携带该项目路径,测试插件可以使用明确的 host project id 导入会话。+- **前提条件**:一个持久项目已在渲染器侧边栏偏好中归档,并从默认侧边栏隐藏。测试插件可以使用明确的 host project id 导入新会话。- **步骤**:1. 打开设置 → 项目归档,确认已归档项目仍可用,而默认侧边栏不显示它。- 2. 扫描并导入项目路径属于该已归档项目的核心候选。- 3. 确认项目和导入的会话出现在默认侧边栏,然后再次归档项目。- 4. 使用插件的 `session.importBatch` 和现有项目 id,检查 host 刷新事件后的侧边栏。- 5. 在不导入任何内容时刷新会话,导入一个无路径会话,并重复导入已有会话。-- **预期**:每个成功且新增的项目绑定导入都会清除对应规范化项目路径的渲染器归档状态,并使项目/会话可发现。普通刷新、无路径会话、跳过的导入,以及没有明确项目绑定的插件历史路径都保持归档状态不变;host 项目行和转录本不被删除或重建。+- 2. 使用插件的 `session.importBatch` 和现有项目 id 导入会话,并等待 host 会话刷新事件。+- 3. 确认项目和新导入的会话出现在默认侧边栏,然后再次归档项目。+- 4. 在不导入内容时刷新会话,再通过 `session.importBatch` 导入无路径会话以及重复或跳过的会话。+- **预期**:成功新增且绑定到项目的插件导入会清除对应规范化项目路径的归档状态,并使项目/会话可发现。普通刷新、无路径会话、跳过的导入和重复导入都保持归档状态不变;host 项目行和转录本不会被删除或重建。- **链接规格**:`04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md`、`03-runtime/04-data-storage.md`、ADR 0236、D407- **验收**:C(对话与流)、F(持久化)、G(插件)、品质- **里程碑**:M6+@@ -8168,14 +8183,14 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture- **前提条件**:一个 Codex 归档,其中的会话以合成注入开头(`# Context from my IDE setup:`、`# In app browser:`、`# Browser comments:`、`# Files mentioned by the user:`、`# Diff comments:`、`# Selected text:`、`# Review findings:`、`# AGENTS.md`、`You are Codex`、`<environment>`),且至少一个会话的存储时间戳损坏或越界。- **步骤**:- 1. 对该归档运行设置 → 会话导入 → 扫描。+ 1. 使用 `importer-codex-scan.test.mjs` 对该归档运行会话扫描器。2. 检查候选会话的标题与每条会话展示的 createdAt/updatedAt。- 3. 导入一个首条真实用户消息位于合成注入之后的会话。+ 3. 通过旧导入器测试契约检查一个真实用户消息位于合成注入之后的会话;不再启动设置 UI 导入流程。- **预期**:候选标题取自第一条真实用户消息——合成注入绝不作为标题出现,而以 `#` 开头的真实粘贴内容(例如 `# Role: …`)予以保留。用户消息全为合成的会话不作为候选出现。损坏或越界的存储时间戳回退到源文件的 mtime,绝不回退到导入时刻。-- **链接规格**:`03-runtime/01-ipc-protocol.md`、`04-ux/06-settings-ia.md`、D320+- **链接规格**:`03-runtime/01-ipc-protocol.md`、D320- **验收**:C(对话与流)、F(持久化)、品质- **里程碑**:M6+-- **状态**:由单元测试覆盖(`importer-codex-scan.test.mjs`);UI 旅程为草稿(该表面变更时需在具备条件的环境中运行)+- **状态**:由 `importer-codex-scan.test.mjs` 单元测试覆盖;不再有设置 UI 旅程#### E2E-LAYOUT-three-column-width-prioritydiff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex 4ccafb528..45cd6845f 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -372,7 +372,7 @@| D334 | 受约束的聊天内图片显示 | **修订桌面 `fs/read` 仅工作区条款:`fs/read`、`fs/reveal` 和 `fs/open` 共用 `resolveOpenablePath`(工作区、`<data_dir>/scratch/`、`<data_dir>/attachments/`,以及 `attachments/<sha256>` blob)。读取会 `realpath` 目标。** | 聊天需要内联图片,但不能把任意绝对路径交给渲染器。 || D336 | 由宿主代发的插件补全与会话上下文 | **修订 D019:插件在授予 `session.read` 时可经 `pi.session.getLlmContext()` 读取进行中工具会话的面向模型转录,并在授予相应权限时经 `pi.agent.complete()` 跑一次性补全。见 ADR 0174。** | 插件需要第二意见补全,但不能自己拿提供商凭据。 || D340 | 用户可配置的出站代理 | **设置 → 通用 → 网络把代理暴露为系统 / 直连 / 自定义。自定义接受 http/https/socks5 URL 和绕过列表,持久化为可选 `AppSettings.networkProxy`。Chromium `session.setProxy` 覆盖内置浏览器和 `net.fetch`;sidecar 经 undici dispatcher 应用。见 ADR 0177 与 E2E-190。** | Node fetch 忽略操作系统代理,Clash/V2Ray/SOCKS5 用户能浏览却不能调模型。 |-| D342 | 从本地智能体存储导入模型配置 | **修订 D007:设置 → 导入仍不自动导入 `~/.pi`。显式模型配置卡片扫描 Claude Code、Codex、OpenCode、Pi 和 CC Switch 提供商行,列出不含密钥的草稿,并由 `modelConfig/importRun` 经 `providers.create` 复制 API 密钥。等价提供商(规范化 base URL + API 风格 + 同一凭据)被跳过。见 ADR 0179、ADR 0188 与 E2E-209。** | 用户已经从这些存储导入会话,否则要在模型页重打同样的端点和密钥。 |+| D342 | 从本地智能体存储导入模型配置 | **修订 D007:设置 → 导入仍不自动导入 `~/.pi`。显式模型配置卡片扫描 Claude Code、Codex、OpenCode、Pi 和 CC Switch 提供商行,列出不含密钥的草稿,并由 `modelConfig/importRun` 经 `providers.create` 复制 API 密钥。等价提供商(规范化 base URL + API 风格 + 同一凭据)被跳过。见 ADR 0179、ADR 0188 与 E2E-209。设置入口和会话导入 UI 后由 D645 / ADR 0319 修订:模型导入现位于模型页,设置页不再提供会话导入。** | 用户已经从这些存储导入会话,否则要在模型页重打同样的端点和密钥。 || D351 | 模型配置导入保留不同凭据 | **修订 D342 / ADR 0179:导入提供商仅在规范化端点、API 风格和凭据都匹配时视为等价。同一端点不同 API 密钥创建独立提供商行,并仍可在 Composer 中选择。Electron main 经宿主密钥边界解析已有 API 密钥。见 ADR 0188 与 E2E-209。** | CC Switch 在同一网关端点存多个账户;仅按端点幂等会静默丢掉除第一个以外的配置。 || D344 | 由主进程拥有的文件选择能力 | **修订 D197 / D334:Composer 原生文件和图片选择器把选中的绝对路径留在 Electron main,用短时、绑定发送者、一次性令牌保护。`composer/importFiles` 只接受该令牌和持久会话 id;渲染器从不提供源路径。MVP 文件选择器只提供常规文件。见 ADR 0181 与 E2E-102h。** | 渲染器 IPC 不是用户点击门禁:导入载荷接受任意绝对路径会变成本地文件外泄原语。 || D314 | 已发布语言注册表与语言选择器 | **修订 D073:界面语言列在 `@pi-desktop/i18n`(`en`、`zh-CN`、`zh-TW`、`tr`)。本地名称永不翻译。设置 → 常规的语言是可搜索选择器(跟随系统 + 注册表),不再是三张预览卡。插件标签保持 `en` + `zh-CN` 契约;没有插件翻译的外壳语言使用英语回退;产品更新日志跟随每个已发布产品语言。见 ADR 0160、ADR 0182 与 E2E-091。** | 预览卡无法扩展到两种以上语言;注册表让添加语言无需重写外观卡即可发货。 |@@ -3425,6 +3425,7 @@ D193 和 D194。- 设置 → 导入已经能扫描会话。同一批工具还把提供商地址、模型 id 和 API 密钥写在本机配置里,用户否则要在模型页重填。- 增加独立的模型配置卡片:显式扫描 Claude Code / Codex / OpenCode / Pi / CC Switch,密钥留在主进程扫描缓存,通过 `providers.create` 写入。OAuth/订阅令牌不复制。仅跳过相同归一化端点、API 风格和凭据的等价提供商;同一端点的不同凭据保持独立。D007 的禁止自动导入仍然有效(ADR 0188)。- 决策 D342 记录为 ADR 0179。见 `04-ux/06-settings-ia.md`、`04-ux/08-component-spec.md` §18.5 与 E2E-192。+- 设置导入入口与会话导入 UI 后由 D645 / ADR 0319 修订;模型扫描和凭据导入语义仍适用,入口现位于“模型”设置页。## 2026-09-08 —— 模型配置导入保留不同凭据(D351)@@ -5250,3 +5251,14 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编`config_sync::domains::tests::captures_project_instruction_files_beyond_the_former_size_cap`与 `config_sync::domains::tests::writes_imported_instruction_files_beyond_the_former_size_cap`覆盖。+## 2026-10-04 —— 外部导入内嵌到所属设置页(D645)++- D645 移除独立的设置 `import` 目的地。模型配置、外部技能和外部 MCP 扫描分别从+ “模型”“技能”和“MCP”页内打开。能力导入遵循当前全局/项目层级;项目扫描绑定到+ 所选项目。+- 设置不再提供核心会话扫描/导入。插件继续使用现有宿主拥有的会话导入 API 与项目绑定+ 行为;不改变 IPC、插件权限、宿主协议或持久化契约。+- 由隔离的设置 MCP 导入用户路径测试、`agent-import-ipc.test.mjs` 和+ `import-format.test.mjs` 覆盖。见 ADR 0319、`04-ux/06-settings-ia.md`、+ `04-ux/08-component-spec.md`、E2E-038 / E2E-043 / E2E-209 与+ E2E-SETTINGS-inline-capability-imports。diff --git a/package.json b/package.jsonindex d38500019..e7a107fa6 100644--- a/package.json+++ b/package.json@@ -49,6 +49,7 @@"test:e2e:todos": "node scripts/e2e-todo-checklist.mjs","test:e2e:provider-model-layout": "node scripts/e2e-provider-model-layout.mjs","test:e2e:settings-scroll": "node scripts/e2e-settings-scroll.mjs",+ "test:e2e:settings-inline-import": "node --test apps/desktop/test/settings-inline-import-user-path.test.mjs","test:e2e:config-sync": "node scripts/e2e-config-sync-multidevice.mjs","test:e2e:layout": "node scripts/e2e-three-column-layout.mjs","test:e2e:window-controls": "node scripts/e2e-window-controls.mjs",diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.tsindex 74e854d44..be8541350 100644--- a/packages/i18n/src/locales/de/index.ts+++ b/packages/i18n/src/locales/de/index.ts@@ -777,7 +777,6 @@ sklm: {"skills": "Fähigkeiten","mcp": "MCP","subagents": "Subagenten",- "import": "Importieren Sie","projects": "Projekte","sync": "Cloud-Synchronisierung","remoteHosts": "Remote-Hosts",@@ -1168,7 +1167,6 @@ sklm: {"skillSaved": "Gespeichert {{name}}","subagentCreated": "Erstellt {{name}}","subagentSaved": "Gespeichert {{name}}",- "import": "Importieren","projectArchive": "Projektarchiv","remoteHosts": {"title": "Remote-Hosts",@@ -1219,7 +1217,6 @@ sklm: {"importFound": "Sitzungen gefunden: {{count}}","importFound_one": "1 Sitzung gefunden","importFound_other": "{{count}} Sitzungen gefunden",- "importCodexCapped": "Codex ist auf die {{limit}} neuesten Sitzungsdateien (nach Ordnerdatum) begrenzt.","importNone": "Auf diesem Computer wurden keine importierbaren Sitzungen gefunden.","importSelectAll": "Alle auswählen",@@ -1230,9 +1227,6 @@ sklm: {"importMessages_other": "{{count}} Nachrichten","importMessagesUnknown": "—","importNoProject": "Kein Projekt",- "importSessionCount": "{{count}} Sitzungen",- "importSessionCount_one": "1 Sitzung",- "importSessionCount_other": "{{count}} Sitzungen","importSelectedCount": "{{count}} ausgewählt","importGroupBy": "Gruppieren nach","importGroupByPath": "Projektpfad",diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.tsindex df11531ba..200bec80c 100644--- a/packages/i18n/src/locales/en/index.ts+++ b/packages/i18n/src/locales/en/index.ts@@ -789,7 +789,6 @@ sklm: {skills: "Skills",mcp: "MCP",subagents: "Subagents",- import: "Import",projects: "Projects",sync: "Cloud sync",remoteHosts: "Remote hosts",@@ -1022,7 +1021,6 @@ sklm: {skillSaved: "Saved {{name}}",subagentCreated: "Created {{name}}",subagentSaved: "Saved {{name}}",- import: "Import",projectArchive: "Project archive",remoteHosts: {title: "Remote hosts",@@ -1234,7 +1232,6 @@ sklm: {importFound: "Sessions found: {{count}}",importFound_one: "1 session found",importFound_other: "{{count}} sessions found",- importCodexCapped: "Codex is limited to the {{limit}} newest session files (by folder date).",importNone: "No importable sessions found on this machine.",importSelectAll: "Select all",@@ -1245,9 +1242,6 @@ sklm: {importMessages_other: "{{count}} messages",importMessagesUnknown: "—",importNoProject: "No project",- importSessionCount: "{{count}} sessions",- importSessionCount_one: "1 session",- importSessionCount_other: "{{count}} sessions",importSelectedCount: "{{count}} selected",importGroupBy: "Group by",importGroupByPath: "Project path",diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.tsindex 47a8aa344..539e21c15 100644--- a/packages/i18n/src/locales/es/index.ts+++ b/packages/i18n/src/locales/es/index.ts@@ -777,7 +777,6 @@ sklm: {"skills": "Habilidades","mcp": "MCP","subagents": "Subagentes",- "import": "Importar","projects": "Proyectos","sync": "Sincronización en la nube","remoteHosts": "Hosts remotos",@@ -1168,7 +1167,6 @@ sklm: {"skillSaved": "Guardado {{name}}","subagentCreated": "Creado {{name}}","subagentSaved": "Guardado {{name}}",- "import": "Importar","projectArchive": "Archivo de proyecto","remoteHosts": {"title": "Hosts remotos",@@ -1219,7 +1217,6 @@ sklm: {"importFound": "Sesiones encontradas: {{count}}","importFound_one": "1 sesión encontrada","importFound_other": "{{count}} sesiones encontradas",- "importCodexCapped": "Codex se limita a los {{limit}} archivos de sesión más recientes (por fecha de carpeta).","importNone": "No se encontraron sesiones importables en esta máquina.","importSelectAll": "Seleccionar todo",@@ -1230,9 +1227,6 @@ sklm: {"importMessages_other": "{{count}} mensajes","importMessagesUnknown": "—","importNoProject": "Sin proyecto",- "importSessionCount": "{{count}} sesiones",- "importSessionCount_one": "1 sesión",- "importSessionCount_other": "{{count}} sesiones","importSelectedCount": "{{count}} seleccionada","importGroupBy": "Agrupar por","importGroupByPath": "Ruta del proyecto",diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.tsindex 352ebe71e..31692ef38 100644--- a/packages/i18n/src/locales/fr/index.ts+++ b/packages/i18n/src/locales/fr/index.ts@@ -777,7 +777,6 @@ sklm: {"skills": "Compétences","mcp": "MCP","subagents": "Sous-agents",- "import": "Importation","projects": "Projets","sync": "Synchronisation cloud","remoteHosts": "Hôtes distants",@@ -1168,7 +1167,6 @@ sklm: {"skillSaved": "Enregistré {{name}}","subagentCreated": "Créé {{name}}","subagentSaved": "Enregistré {{name}}",- "import": "Importation","projectArchive": "Archive du projet","remoteHosts": {"title": "Hôtes distants",@@ -1219,7 +1217,6 @@ sklm: {"importFound": "Sessions trouvées : {{count}}","importFound_one": "1 session trouvée","importFound_other": "{{count}} sessions trouvées",- "importCodexCapped": "Codex est limité aux {{limit}} fichiers de session les plus récents (par date de dossier).","importNone": "Aucune session importable trouvée sur cette machine.","importSelectAll": "Sélectionner tous les",@@ -1230,9 +1227,6 @@ sklm: {"importMessages_other": "{{count}} messages","importMessagesUnknown": "—","importNoProject": "Aucun projet",- "importSessionCount": "{{count}} sessions",- "importSessionCount_one": "1 session",- "importSessionCount_other": "{{count}} sessions","importSelectedCount": "{{count}} sélectionnées","importGroupBy": "Regrouper par","importGroupByPath": "Chemin du projet",diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.tsindex eea4c76ea..82cc1011e 100644--- a/packages/i18n/src/locales/ko/index.ts+++ b/packages/i18n/src/locales/ko/index.ts@@ -785,7 +785,6 @@ sklm: {skills: "스킬",mcp: "MCP",subagents: "서브에이전트",- import: "가져오기",projects: "프로젝트",sync: "클라우드 동기화",remoteHosts: "원격 호스트",@@ -1176,7 +1175,6 @@ sklm: {skillSaved: "{{name}} 저장됨",subagentCreated: "{{name}} 생성됨",subagentSaved: "{{name}} 저장됨",- import: "가져오기",projectArchive: "프로젝트 보관함",remoteHosts: {title: "원격 호스트",@@ -1227,7 +1225,6 @@ sklm: {importFound: "찾은 세션: {{count}}",importFound_one: "세션 1개 찾음",importFound_other: "세션 {{count}}개 찾음",- importCodexCapped: "Codex는 폴더 날짜 기준 최신 세션 파일 {{limit}}개만 표시합니다.",importNone: "이 컴퓨터에서 가져올 수 있는 세션을 찾지 못했습니다.",importSelectAll: "모두 선택",@@ -1238,9 +1235,6 @@ sklm: {importMessages_other: "메시지 {{count}}개",importMessagesUnknown: "—",importNoProject: "프로젝트 없음",- importSessionCount: "세션 {{count}}개",- importSessionCount_one: "세션 1개",- importSessionCount_other: "세션 {{count}}개",importSelectedCount: "{{count}}개 선택됨",importGroupBy: "그룹화 기준",importGroupByPath: "프로젝트 경로",diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.tsindex ab222a782..f350d3f02 100644--- a/packages/i18n/src/locales/pt-BR/index.ts+++ b/packages/i18n/src/locales/pt-BR/index.ts@@ -762,7 +762,6 @@ export const ptBR = {skills: "Habilidades",mcp: "MCP",subagents: "Subagentes",- import: "Importar",projects: "Projetos",sync: "Sincronização",remoteHosts: "Hosts remotos",@@ -989,7 +988,6 @@ export const ptBR = {skillSaved: "Salvo {{name}}",subagentCreated: "{{name}} criado",subagentSaved: "Salvo {{name}}",- import: "Importar",projectArchive: "Arquivo de projeto",remoteHosts: {title: "Hosts remotos",@@ -1185,7 +1183,6 @@ export const ptBR = {importFound: "Sessões encontradas: {{count}}",importFound_one: "1 sessão encontrada",importFound_other: "{{count}} sessões encontradas",- importCodexCapped: "O Codex é limitado aos {{limit}} arquivos de sessão mais recentes (por data da pasta).",importNone: "Nenhum dado encontrado para importar.",importSelectAll: "Selecionar tudo",importSelected: "Importar selecionado ({{count}})",@@ -1195,9 +1192,6 @@ export const ptBR = {importMessages_other: "{{count}} mensagens",importMessagesUnknown: "—",importNoProject: "Nenhum projeto selecionado",- importSessionCount: "{{count}} sessões",- importSessionCount_one: "1 sessão",- importSessionCount_other: "{{count}} sessões",importSelectedCount: "{{count}} selecionada",importGroupBy: "Agrupar por",importGroupByPath: "Agrupar por caminho",diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.tsindex 2b68e8925..2f713e0b0 100644--- a/packages/i18n/src/locales/tr/index.ts+++ b/packages/i18n/src/locales/tr/index.ts@@ -785,7 +785,6 @@ sklm: {skills: "Beceriler",mcp: "MCP",subagents: "Alt ajanlar",- import: "İçe aktar",projects: "Projeler",sync: "Bulut senkronizasyonu",remoteHosts: "Uzak ana bilgisayarlar",@@ -1166,7 +1165,6 @@ sklm: {skillSaved: "{{name}} kaydedildi",subagentCreated: "{{name}} oluşturuldu",subagentSaved: "{{name}} kaydedildi",- import: "İçe aktar",projectArchive: "Proje arşivi",remoteHosts: {title: "Uzak ana bilgisayarlar",@@ -1217,7 +1215,6 @@ sklm: {importFound: "Bulunan oturumlar: {{count}}",importFound_one: "1 oturum bulundu",importFound_other: "{{count}} oturum bulundu",- importCodexCapped: "Codex, klasör tarihine göre en yeni {{limit}} oturum dosyasıyla sınırlıdır.",importNone: "Bu makinede içe aktarılabilir oturum bulunamadı.",importSelectAll: "Tümünü seç",@@ -1228,9 +1225,6 @@ sklm: {importMessages_other: "{{count}} ileti",importMessagesUnknown: "—",importNoProject: "Proje yok",- importSessionCount: "{{count}} oturum",- importSessionCount_one: "1 oturum",- importSessionCount_other: "{{count}} oturum",importSelectedCount: "{{count}} seçili",importGroupBy: "Grupla",importGroupByPath: "Proje yolu",diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.tsindex 1b7fbc1b6..4b366c428 100644--- a/packages/i18n/src/locales/zh-CN/index.ts+++ b/packages/i18n/src/locales/zh-CN/index.ts@@ -775,7 +775,6 @@ sklm: {skills: "技能",mcp: "MCP",subagents: "子智能体",- import: "导入",projects: "项目",sync: "云同步",remoteHosts: "远程主机",@@ -1152,7 +1151,6 @@ sklm: {skillSaved: "已保存 {{name}}",subagentCreated: "已新建 {{name}}",subagentSaved: "已保存 {{name}}",- import: "导入",projectArchive: "项目归档",remoteHosts: {title: "远程主机",@@ -1203,7 +1201,6 @@ sklm: {importFound: "发现 {{count}} 个会话",importFound_one: "发现 1 个会话",importFound_other: "发现 {{count}} 个会话",- importCodexCapped: "Codex 仅列出按目录日期最新的 {{limit}} 个会话文件。",importNone: "未在本机发现可导入的会话。",importSelectAll: "全选",@@ -1214,9 +1211,6 @@ sklm: {importMessages_other: "{{count}} 条消息",importMessagesUnknown: "—",importNoProject: "未关联项目",- importSessionCount: "{{count}} 个会话",- importSessionCount_one: "1 个会话",- importSessionCount_other: "{{count}} 个会话",importSelectedCount: "已选 {{count}} 个",importGroupBy: "分组方式",importGroupByPath: "项目路径",diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.tsindex 32b8f8382..bd3e59f41 100644--- a/packages/i18n/src/locales/zh-TW/index.ts+++ b/packages/i18n/src/locales/zh-TW/index.ts@@ -775,7 +775,6 @@ sklm: {skills: "技能",mcp: "MCP",subagents: "子智慧體",- import: "匯入",projects: "專案",sync: "雲端同步",remoteHosts: "遠端主機",@@ -1152,7 +1151,6 @@ sklm: {skillSaved: "已儲存 {{name}}",subagentCreated: "已新建 {{name}}",subagentSaved: "已儲存 {{name}}",- import: "匯入",projectArchive: "專案歸檔",remoteHosts: {title: "遠端主機",@@ -1203,7 +1201,6 @@ sklm: {importFound: "發現 {{count}} 個會話",importFound_one: "發現 1 個會話",importFound_other: "發現 {{count}} 個會話",- importCodexCapped: "Codex 僅列出依目錄日期最新的 {{limit}} 個工作階段檔案。",importNone: "未在本機發現可匯入的會話。",importSelectAll: "全選",@@ -1214,9 +1211,6 @@ sklm: {importMessages_other: "{{count}} 條訊息",importMessagesUnknown: "—",importNoProject: "未關聯專案",- importSessionCount: "{{count}} 個會話",- importSessionCount_one: "1 個會話",- importSessionCount_other: "{{count}} 個會話",importSelectedCount: "已選 {{count}} 個",importGroupBy: "分組方式",importGroupByPath: "專案路徑",diff --git a/packages/i18n/test/catalogs.test.mjs b/packages/i18n/test/catalogs.test.mjsindex 29fd69b66..85b25c021 100644--- a/packages/i18n/test/catalogs.test.mjs+++ b/packages/i18n/test/catalogs.test.mjs@@ -133,7 +133,6 @@ test("settings rail labels stay concise and parallel across locales", () => {"skills","mcp","subagents",- "import","projects","info",].map((key) => `settings.nav.${key}`);@@ -149,7 +148,6 @@ test("settings rail labels stay concise and parallel across locales", () => {"Skills","MCP","Subagents",- "Import","Projects","Info",],@@ -165,11 +163,14 @@ test("settings rail labels stay concise and parallel across locales", () => {"技能","MCP","子智能体",- "导入","项目","信息",],);+ assert.equal(english["settings.nav.import"], undefined);+ assert.equal(chinese["settings.nav.import"], undefined);+ assert.equal(english["settings.import"], undefined);+ assert.equal(chinese["settings.import"], undefined);assert.equal(english["settings.groupPreferences"], "Preferences");assert.equal(chinese["settings.groupPreferences"], "偏好");assert.equal(english["settings.groupSystem"], "System");