Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(skillhub): align live skill palettes and cleanup lifecycles
xd-bobo806962e1c5d3
diff --git a/apps/desktop/help-knowledge/skills.md b/apps/desktop/help-knowledge/skills.mdindex 906151f615..eb49b0d908 100644--- a/apps/desktop/help-knowledge/skills.md+++ b/apps/desktop/help-knowledge/skills.md@@ -30,11 +30,11 @@ Skills are reusable agent capabilities you package as a folder and load into you**Disabling or uninstalling a local skill (Desktop):**-- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from Cindy's command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.+- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from new-task command previews. Active tasks retain the skill preference snapshot applied when their Agent started, including their command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.- The switch is local to this device and Cindy profile. It does not edit external CLI settings, sync to other devices, or override a native engine's own disabled state. Enable it again to let the engine discover it normally.- In the skill's details, use **… → Uninstall skill**. Confirm the location and shared-file impact. Standalone skills, including locally written skills without a market installation record, move to the system trash. Recovery is through the operating system's trash.- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here. Skills provided by Cindy plugins are managed on the owning plugin's page, including when discovered through shared skill links.-- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** in the current app run.+- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** until the current window is closed or reloaded. Retry before then; closing or reloading ends the retry receipt without restoring the removed files.**Publishing your own skill:**diff --git a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.tsindex cd4ac0436c..364d8a4817 100644--- a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts+++ b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts@@ -144,7 +144,7 @@ export const HELP_KNOWLEDGE: HelpKnowledgeDoc[] = [id: "skills",title: "Skills (reusable agent capabilities)",summary: "Browse, install, disable, uninstall, publish, and update agent skills; installed skills appear as \"/\" slash commands and are shared across Claude Code and Codex.",- content: "Skills are reusable agent capabilities you package as a folder and load into your sessions. They're managed on the same page as Plugins — **Skills** and **Plugins** are two tabs of one management surface (the Skills tab is the in-app browser for finding, installing, publishing, and updating skills).\n\n**Skills work with both agents:**\n\n- Skills are **engine-shared** — the same installed skill is available to both Claude Code and Codex, so you install it once.\n\n**Where skills live on disk:**\n\n- Global (available to every session): the shared root `~/.agents/skills/<name>/`, which is cross-linked to `~/.claude/skills/` and `~/.codex/skills/` so every engine sees the same skills. On Windows that's under `C:\\Users\\<you>\\`.\n- Project-scoped (only inside one working directory): `<working-dir>/.agents/skills/<name>/` or `<working-dir>/.claude/skills/<name>/`.\n- Each skill is its own folder with a required `SKILL.md` at the root (the prompt / spec the agent reads). Sibling files and subfolders in that folder are also visible to the agent.\n\n**Importing a local skill:**\n\n- On the Skills page, use **Import skill** (top-right) to pick a `.zip` package or a standalone `SKILL.md` file.\n- A zip must contain a `SKILL.md` (at the package root, or inside a single top-level folder). The YAML frontmatter must include non-empty `name` and `description` fields; `name` must match `^[a-z0-9-]{1,200}$`.\n- You then choose where to install: global, a known project, or another directory. Cindy extracts metadata from the file automatically and lists the skill with that name and description.\n- Imported skills can be uninstalled from the detail page, and you can publish them to SkillHub later if you want.\n\n**Using an installed skill:**\n\n- Hover over a local skill in the `/` suggestions and choose **View skill details** in its information panel to open that exact skill. This does not insert or send the command. Pi package skills remain usable from `/`, but do not show this local detail shortcut; manage them through their package.\n\n- Type `/` in the composer to open the slash-command palette; your installed skills show up there alongside built-in and agent commands. Pick one to run it.\n\n**Disabling or uninstalling a local skill (Desktop):**\n\n- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from Cindy's command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.\n- The switch is local to this device and Cindy profile. It does not edit external CLI settings, sync to other devices, or override a native engine's own disabled state. Enable it again to let the engine discover it normally.\n- In the skill's details, use **… → Uninstall skill**. Confirm the location and shared-file impact. Standalone skills, including locally written skills without a market installation record, move to the system trash. Recovery is through the operating system's trash.\n- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here. Skills provided by Cindy plugins are managed on the owning plugin's page, including when discovered through shared skill links.\n- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** in the current app run.\n\n**Publishing your own skill:**\n\n- Find the publish action on the Skills page and point it at the skill's local folder. It zips the folder and uploads it — reading your directory in place, without copying or moving anything.\n- On first publish, you set the skill's **visibility**: PUBLIC (anyone in the org) or DEPARTMENT_SCOPED (only the departments you choose).\n- The local registry records what you published, so the app knows it's \"yours\" for future updates.\n\n**Updating an already-published skill:**\n\n- On your own skill's detail page you'll see a **发布新版本** (Publish New Version) button.\n- Edit the local folder however you want and publish — the version is **auto-incremented server-side**, you don't pick a number.\n- **Old versions stay live alongside the new one.** Users who already installed an older version keep it until they choose to update.\n- The display name and description are sent on every republish, so editing those metadata fields just means doing a republish.\n\n**Managing an already-published skill:**\n\n- Change who can see or use your skill from the management menu — public, shared with selected teams / departments, or private to you.\n- **Unpublish** makes it private again and returns ownership to your personal scope; it does not remove copies other users already installed.\n- **Authorship is fixed.** Only the original author's account can publish new versions of a given skill (enforced server-side as `NOT_AUTHOR`).\n\n**Browsing and installing others' skills:**\n\n- The marketplace lets you install skills into your global skills directory. You can request a specific version on install; the local registry tracks which version you have.\n\n**Notes:**\n\n- A skill folder without a `SKILL.md` at its root won't be picked up (lowercase `skill.md` is also accepted).\n- Project-scoped skills only show up in sessions whose working directory matches — useful for skills tied to a particular repo's conventions.\n- Editing files inside an installed skill folder takes effect on the next session start; you don't need to reinstall.\n- Uninstalling only removes your local copy. For your own published skills, use unpublish or manage visibility to change market availability.",+ content: "Skills are reusable agent capabilities you package as a folder and load into your sessions. They're managed on the same page as Plugins — **Skills** and **Plugins** are two tabs of one management surface (the Skills tab is the in-app browser for finding, installing, publishing, and updating skills).\n\n**Skills work with both agents:**\n\n- Skills are **engine-shared** — the same installed skill is available to both Claude Code and Codex, so you install it once.\n\n**Where skills live on disk:**\n\n- Global (available to every session): the shared root `~/.agents/skills/<name>/`, which is cross-linked to `~/.claude/skills/` and `~/.codex/skills/` so every engine sees the same skills. On Windows that's under `C:\\Users\\<you>\\`.\n- Project-scoped (only inside one working directory): `<working-dir>/.agents/skills/<name>/` or `<working-dir>/.claude/skills/<name>/`.\n- Each skill is its own folder with a required `SKILL.md` at the root (the prompt / spec the agent reads). Sibling files and subfolders in that folder are also visible to the agent.\n\n**Importing a local skill:**\n\n- On the Skills page, use **Import skill** (top-right) to pick a `.zip` package or a standalone `SKILL.md` file.\n- A zip must contain a `SKILL.md` (at the package root, or inside a single top-level folder). The YAML frontmatter must include non-empty `name` and `description` fields; `name` must match `^[a-z0-9-]{1,200}$`.\n- You then choose where to install: global, a known project, or another directory. Cindy extracts metadata from the file automatically and lists the skill with that name and description.\n- Imported skills can be uninstalled from the detail page, and you can publish them to SkillHub later if you want.\n\n**Using an installed skill:**\n\n- Hover over a local skill in the `/` suggestions and choose **View skill details** in its information panel to open that exact skill. This does not insert or send the command. Pi package skills remain usable from `/`, but do not show this local detail shortcut; manage them through their package.\n\n- Type `/` in the composer to open the slash-command palette; your installed skills show up there alongside built-in and agent commands. Pick one to run it.\n\n**Disabling or uninstalling a local skill (Desktop):**\n\n- Open a skill's detail page to use the switch in the top action bar. For a market skill installed in multiple locations, select the local copy from the location dropdown beside the switch. Turning it off keeps the files and removes the skill from new-task command previews. Active tasks retain the skill preference snapshot applied when their Agent started, including their command palette. New or restarted Claude Code, Codex, and Pi agents apply that choice; an already-running agent keeps its existing context.\n- The switch is local to this device and Cindy profile. It does not edit external CLI settings, sync to other devices, or override a native engine's own disabled state. Enable it again to let the engine discover it normally.\n- In the skill's details, use **… → Uninstall skill**. Confirm the location and shared-file impact. Standalone skills, including locally written skills without a market installation record, move to the system trash. Recovery is through the operating system's trash.\n- External source imports remove only their discovery links and keep the external source files. Package-owned or built-in skills must be removed through their owning package; their uninstall action is unavailable here. Skills provided by Cindy plugins are managed on the owning plugin's page, including when discovered through shared skill links.\n- Uninstalling a shared copy affects external CLIs that use it. It does not unpublish a skill or delete other users' copies. If file removal fails, Cindy keeps the installation. If only metadata/link cleanup fails, the notice offers **Retry cleanup** until the current window is closed or reloaded. Retry before then; closing or reloading ends the retry receipt without restoring the removed files.\n\n**Publishing your own skill:**\n\n- Find the publish action on the Skills page and point it at the skill's local folder. It zips the folder and uploads it — reading your directory in place, without copying or moving anything.\n- On first publish, you set the skill's **visibility**: PUBLIC (anyone in the org) or DEPARTMENT_SCOPED (only the departments you choose).\n- The local registry records what you published, so the app knows it's \"yours\" for future updates.\n\n**Updating an already-published skill:**\n\n- On your own skill's detail page you'll see a **发布新版本** (Publish New Version) button.\n- Edit the local folder however you want and publish — the version is **auto-incremented server-side**, you don't pick a number.\n- **Old versions stay live alongside the new one.** Users who already installed an older version keep it until they choose to update.\n- The display name and description are sent on every republish, so editing those metadata fields just means doing a republish.\n\n**Managing an already-published skill:**\n\n- Change who can see or use your skill from the management menu — public, shared with selected teams / departments, or private to you.\n- **Unpublish** makes it private again and returns ownership to your personal scope; it does not remove copies other users already installed.\n- **Authorship is fixed.** Only the original author's account can publish new versions of a given skill (enforced server-side as `NOT_AUTHOR`).\n\n**Browsing and installing others' skills:**\n\n- The marketplace lets you install skills into your global skills directory. You can request a specific version on install; the local registry tracks which version you have.\n\n**Notes:**\n\n- A skill folder without a `SKILL.md` at its root won't be picked up (lowercase `skill.md` is also accepted).\n- Project-scoped skills only show up in sessions whose working directory matches — useful for skills tied to a particular repo's conventions.\n- Editing files inside an installed skill folder takes effect on the next session start; you don't need to reinstall.\n- Uninstalling only removes your local copy. For your own published skills, use unpublish or manage visibility to change market availability.",},{id: "updates-and-about",diff --git a/apps/desktop/src/main/skillhub/__tests__/installService.test.ts b/apps/desktop/src/main/skillhub/__tests__/installService.test.tsindex 6c01061924..9c6203c966 100644--- a/apps/desktop/src/main/skillhub/__tests__/installService.test.ts+++ b/apps/desktop/src/main/skillhub/__tests__/installService.test.ts@@ -280,6 +280,23 @@ describe('skillhub/installService', () => {expect(fs.readFileSync(path.join(source, 'SKILL.md'), 'utf8')).toBe('restored');});+ it('releases a discarded cleanup receipt without retrying filesystem or registry operations', async () => {+ const { source, target } = await localFixture('cleanup-discarded');+ const { registryService } = await import('../registry');+ vi.mocked(registryService.getInstall).mockResolvedValue({+ origin: 'imported', version: '1', authorId: '', folderHash: 'hash', installedAt: 1, updatedAt: 1,+ });+ vi.mocked(registryService.removeInstall).mockRejectedValueOnce(new Error('disk unavailable'));+ const { uninstall, retryUninstallCleanup, discardUninstallCleanup } = await import('../installService');+ const { shell } = await import('electron');+ const result = await uninstall(source, target);+ if (!result.success || !result.cleanupToken) throw new Error('expected receipt');+ discardUninstallCleanup(result.cleanupToken);+ expect(await retryUninstallCleanup(result.cleanupToken, () => true)).toBe(true);+ expect(registryService.removeInstall).toHaveBeenCalledOnce();+ expect(shell.trashItem).toHaveBeenCalledOnce();+ });+it('keeps the previous install intact when extraction fails during forced update', async () => {const finalDir = path.join(TEST_ROOT, 'skills', 'broken-skill');fs.mkdirSync(finalDir, { recursive: true });diff --git a/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.ts b/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.tsindex e5c6bc8bbc..3298fe5872 100644--- a/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.ts+++ b/apps/desktop/src/main/skillhub/__tests__/registerIpcUsage.test.ts@@ -19,6 +19,8 @@ const installServiceMocks = vi.hoisted(() => ({install: vi.fn(),cancelInstall: vi.fn(),uninstall: vi.fn(),+ retryUninstallCleanup: vi.fn(),+ discardUninstallCleanup: vi.fn(),}));vi.mock('electron', () => ({@@ -157,6 +159,7 @@ describe('registerSkillhubIpc usage handlers', () => {const destroyedCallbacks: Array<() => void> = [];const sender = {id: 11,+ on: vi.fn(),once: vi.fn((event: string, callback: () => void) => {if (event === 'destroyed') destroyedCallbacks.push(callback);}),@@ -228,7 +231,7 @@ describe('registerSkillhubIpc usage handlers', () => {});it('revokes project scan grants after the last active project session disappears', async () => {- const sender = { id: 12, once: vi.fn() };+ const sender = { id: 12, on: vi.fn(), once: vi.fn() };scanAllSkills.mockResolvedValueOnce({skills: [{absolutePath: '/physical/demo',@@ -275,7 +278,7 @@ describe('registerSkillhubIpc usage handlers', () => {|| (candidate.includes('/new-skill') && roots.has('/physical/new-skill'))));readSkillRawFile.mockResolvedValue({ success: true, content: 'raw' });- const sender = { id: 33, once: vi.fn() };+ const sender = { id: 33, on: vi.fn(), once: vi.fn() };const scan = handlers.get('skillhub:scan');const olderRequest = scan?.({ sender }, { projects: [{ projectRoot: '/old', hash: 'old' }] });@@ -302,7 +305,7 @@ describe('registerSkillhubIpc usage handlers', () => {});it('revokes a sender scan grant when the active data owner changes', async () => {- const sender = { id: 34, once: vi.fn() };+ const sender = { id: 34, on: vi.fn(), once: vi.fn() };scanAllSkills.mockResolvedValueOnce({skills: [{absolutePath: '/physical/demo',@@ -332,7 +335,7 @@ describe('registerSkillhubIpc usage handlers', () => {});it('rejects renderer-provided project roots outside Main-owned active projects', async () => {- const sender = { id: 44, once: vi.fn() };+ const sender = { id: 44, on: vi.fn(), once: vi.fn() };const result = await handlers.get('skillhub:scan')?.({ sender },@@ -625,7 +628,7 @@ describe('registerSkillhubIpc usage handlers', () => {kind: 'skill', scope: 'project', name: 'local', absolutePath,discoveredPath: source, projectRoot: project,}], sources: [] });- const event = { sender: { id: 71, once: vi.fn() } };+ const event = { sender: { id: 71, on: vi.fn(), once: vi.fn() } };await handlers.get('skillhub:scan')!(event, { projects: [{ projectRoot: project, hash: 'fixture' }] });return { event, absolutePath, project };}@@ -650,6 +653,30 @@ describe('registerSkillhubIpc usage handlers', () => {expect(setCindySkillEnabled).toHaveBeenCalledTimes(1);});+ it.each(['destroyed', 'reload'] as const)('revokes cleanup grants and receipts on window %s', async (lifecycle) => {+ const { event, absolutePath } = await scanLocalFixture();+ installServiceMocks.uninstall.mockResolvedValueOnce({ success: true, cleanupToken: 'receipt' });+ await handlers.get('skillhub:uninstall')!(event, { absolutePath });+ if (lifecycle === 'destroyed') {+ event.sender.once.mock.calls.find(([name]) => name === 'destroyed')![1]();+ } else {+ event.sender.on.mock.calls.find(([name]) => name === 'did-start-navigation');+ }+ expect(installServiceMocks.discardUninstallCleanup).toHaveBeenCalledWith('receipt');+ await expect(handlers.get('skillhub:retry-uninstall-cleanup')!(event, 'receipt')).rejects.toThrow('PRECONDITION_FAILED');+ expect(installServiceMocks.retryUninstallCleanup).not.toHaveBeenCalled();+ });++ it('discards a late cleanup receipt when its window reloads during uninstall', async () => {+ const { event, absolutePath } = await scanLocalFixture();+ installServiceMocks.uninstall.mockImplementationOnce(async () => {+ event.sender.on.mock.calls.find(([name]) => name === 'did-start-navigation');+ return { success: true, cleanupToken: 'late-receipt' };+ });+ expect(await handlers.get('skillhub:uninstall')!(event, { absolutePath })).toEqual({ success: true });+ expect(installServiceMocks.discardUninstallCleanup).toHaveBeenCalledWith('late-receipt');+ });+it('rejects direct uninstall of a plugin snapshot even when the scanned UI claims it is removable', async () => {const stateRoot = fs.mkdtempSync(path.join(fixtureRoot, 'plugin-state-'));const source = path.join(stateRoot, 'skill-snapshots', 'plugin', 'revision', 'skill');@@ -663,7 +690,7 @@ describe('registerSkillhubIpc usage handlers', () => {kind: 'skill', scope: 'global', name: 'plugin--skill', canUninstall: true,absolutePath: source, discoveredPath: alias, discoveryPaths: [alias],}], sources: [] });- const event = { sender: { id: 73, once: vi.fn() } };+ const event = { sender: { id: 73, on: vi.fn(), once: vi.fn() } };await handlers.get('skillhub:scan')!(event, {});await expect(handlers.get('skillhub:uninstall')!(event, { absolutePath: source })).rejects.toThrow('PRECONDITION_FAILED');diff --git a/apps/desktop/src/main/skillhub/installService.ts b/apps/desktop/src/main/skillhub/installService.tsindex 8dd2ffddb2..eb87345271 100644--- a/apps/desktop/src/main/skillhub/installService.ts+++ b/apps/desktop/src/main/skillhub/installService.ts@@ -1099,6 +1099,11 @@ interface UninstallCleanup {// Only Main-issued receipts can retry metadata/link cleanup; no second trash operation.const pendingUninstallCleanup = new Map<string, UninstallCleanup>();+/** End a window-scoped retry receipt without performing any filesystem mutation. */+export function discardUninstallCleanup(token: string): void {+ pendingUninstallCleanup.delete(token);+}+async function finishUninstallCleanup(cleanup: UninstallCleanup, canMutate: () => boolean): Promise<boolean> {const { skillName, resolved, operationPath, registryMatch, links } = cleanup;if (!canMutate()) return false;diff --git a/apps/desktop/src/main/skillhub/registerIpc.ts b/apps/desktop/src/main/skillhub/registerIpc.tsindex 4719debd93..abed8955ba 100644--- a/apps/desktop/src/main/skillhub/registerIpc.ts+++ b/apps/desktop/src/main/skillhub/registerIpc.ts@@ -161,15 +161,29 @@ export function registerSkillhubIpc(options: RegisterSkillhubIpcOptions): void {};const scanGenerationBySender = new Map<number, number>();const scanGrantCleanupRegistered = new WeakSet<object>();+ const cleanupGenerationBySender = new WeakMap<object, number>();const ensureScanGrantCleanup = (event: Electron.IpcMainInvokeEvent) => {if (scanGrantCleanupRegistered.has(event.sender)) return;scanGrantCleanupRegistered.add(event.sender);- event.sender.once('destroyed', () => {+ const revokeWindowGrants = () => {+ cleanupGenerationBySender.set(event.sender, (cleanupGenerationBySender.get(event.sender) ?? 0) + 1);+ for (const [token, grant] of cleanupGrants) {+ if (grant.senderId !== event.sender.id) continue;+ cleanupGrants.delete(token);+ installService.discardUninstallCleanup(token);+ }scannedSkillRootsBySender.delete(event.sender.id);localSkillsBySender.delete(event.sender.id);+ scanGenerationBySender.set(event.sender.id, (scanGenerationBySender.get(event.sender.id) ?? 0) + 1);+ };+ event.sender.once('destroyed', () => {+ revokeWindowGrants();scanGenerationBySender.delete(event.sender.id);});+ event.sender.on('did-start-navigation', (_event, _url, isInPlace, isMainFrame) => {+ if (isMainFrame && !isInPlace) revokeWindowGrants();+ });};const rememberScannedSkillRoots = (@@ -973,13 +987,20 @@ export function registerSkillhubIpc(options: RegisterSkillhubIpcOptions): void {throwIpcError('PRECONDITION_FAILED', 'Skill cannot be uninstalled; refresh and retry');}const ownerId = getCurrentDataOwnerId();+ const cleanupGeneration = cleanupGenerationBySender.get(event.sender) ?? 0;const result = await installService.uninstall(absolutePath, target,() => ownerId === getCurrentDataOwnerId() && !isAppSessionBoundaryPending()&& !isPluginManagedSkillPath(target.sourcePath, options.getManagedSkillRoots()));if (!result.success) throwIpcError('INTERNAL', 'Could not move Skill to the trash; retry');await refreshCodexProjectSkillCache(result.projectWorkingDir);broadcastLocalChange();- if (result.cleanupToken) cleanupGrants.set(result.cleanupToken, { ownerId, senderId: event.sender.id });+ if (result.cleanupToken) {+ if ((cleanupGenerationBySender.get(event.sender) ?? 0) !== cleanupGeneration) {+ installService.discardUninstallCleanup(result.cleanupToken);+ return { success: true };+ }+ cleanupGrants.set(result.cleanupToken, { ownerId, senderId: event.sender.id });+ }return { success: true, ...(result.cleanupToken ? { cleanupToken: result.cleanupToken } : {}) };},);@@ -988,6 +1009,7 @@ export function registerSkillhubIpc(options: RegisterSkillhubIpcOptions): void {assertTrustedAppRendererEvent(event);const grant = cleanupGrants.get(token);const canMutate = () => !!grant && grant.ownerId === getCurrentDataOwnerId()+ && cleanupGrants.get(token) === grant&& grant.senderId === event.sender.id && !isAppSessionBoundaryPending();if (!canMutate()) throwIpcError('PRECONDITION_FAILED', 'Cleanup is no longer available');const complete = await installService.retryUninstallCleanup(token, canMutate);diff --git a/apps/desktop/src/preload/__tests__/skillhubFanOut.test.ts b/apps/desktop/src/preload/__tests__/skillhubFanOut.test.tsnew file mode 100644index 0000000000..65dcbd00fc--- /dev/null+++ b/apps/desktop/src/preload/__tests__/skillhubFanOut.test.ts@@ -0,0 +1,37 @@+import fs from 'node:fs';+import ts from 'typescript';+import { describe, expect, it, vi } from 'vitest';++const source = fs.readFileSync(new URL('../preload.ts', import.meta.url), 'utf8');++describe('SkillHub local-state IPC subscriptions', () => {+ it('shares one IPC listener and removes it after HMR-style disposal', () => {+ const start = source.indexOf('type FanOut =');+ const end = source.indexOf('// Stage 2 C1:', start);+ const compiled = ts.transpileModule(source.slice(start, end), {+ compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS },+ }).outputText;+ const ipc = { on: vi.fn(), removeListener: vi.fn() };+ const create = new Function('ipcRenderer', `${compiled}\nreturn createIpcFanOut;`)(ipc);+ const subscribe = create('skillhub:local-state-changed');+ const oldStore = vi.fn();+ const composer = vi.fn();+ const disposeStore = subscribe(oldStore);+ const disposeComposer = subscribe(composer);+ expect(ipc.on).toHaveBeenCalledTimes(1);+ ipc.on.mock.calls[0][1]({});+ expect(oldStore).toHaveBeenCalledOnce();+ expect(composer).toHaveBeenCalledOnce();+ disposeStore();+ const newStore = vi.fn();+ const disposeNew = subscribe(newStore);+ ipc.on.mock.calls[0][1]({});+ expect(oldStore).toHaveBeenCalledOnce();+ expect(newStore).toHaveBeenCalledOnce();+ disposeComposer();+ disposeNew();+ expect(ipc.removeListener).toHaveBeenCalledWith('skillhub:local-state-changed', ipc.on.mock.calls[0][1]);+ expect(source).toContain("const fanOutSkillhubLocalStateChanged = createIpcFanOut('skillhub:local-state-changed')");+ expect(source).toContain('onLocalStateChanged: fanOutSkillhubLocalStateChanged');+ });+});diff --git a/apps/desktop/src/preload/preload.ts b/apps/desktop/src/preload/preload.tsindex 9adf3860d9..ae120022c1 100644--- a/apps/desktop/src/preload/preload.ts+++ b/apps/desktop/src/preload/preload.ts@@ -500,6 +500,7 @@ function createIpcFanOut(channel: string): FanOut {// Stage 2 C1: cc-agent:* push channel fanout 全部退役 (renderer 已切到 maker:event 等),// 老 7 个 fanOut + fanOutUserMessagePersisted 一起拿掉。const fanOutUpdateStatus = createIpcFanOut('update-status');+const fanOutSkillhubLocalStateChanged = createIpcFanOut('skillhub:local-state-changed');const fanOutDbSlimmingStartupProgress = createIpcFanOut(DB_SLIMMING_STARTUP_PROGRESS_CHANGED_CHANNEL,);@@ -2947,11 +2948,7 @@ contextBridge.exposeInMainWorld('electronAPI', {skillhub: {setEnabled: (params: { absolutePath: string; enabled: boolean }): Promise<{ cindyEnabled: boolean }> =>ipcRenderer.invoke('skillhub:set-enabled', params),- onLocalStateChanged: (callback: () => void): (() => void) => {- const handler = () => callback();- ipcRenderer.on('skillhub:local-state-changed', handler);- return () => ipcRenderer.removeListener('skillhub:local-state-changed', handler);- },+ onLocalStateChanged: fanOutSkillhubLocalStateChanged,scan: (params: {projects?: import('../main/skillhub/scanner').ProjectInput[];}): Promise<{diff --git a/apps/desktop/src/renderer/features/skillhub/hooks/useSkillhub.ts b/apps/desktop/src/renderer/features/skillhub/hooks/useSkillhub.tsindex a4cb790a0e..ea1a22dcdc 100644--- a/apps/desktop/src/renderer/features/skillhub/hooks/useSkillhub.ts+++ b/apps/desktop/src/renderer/features/skillhub/hooks/useSkillhub.ts@@ -236,6 +236,18 @@ function ensureAuthListener(): void {});}+if (import.meta.hot) {+ import.meta.hot.dispose(() => {+ authListenerUnsubscribe?.();+ localStateListenerUnsubscribe?.();+ authListenerUnsubscribe = null;+ localStateListenerUnsubscribe = null;+ scanRequestId += 1;+ latestScan = null;+ listeners.clear();+ });+}+// ── v0.2.1: wire up sync store setters into useSkillSync ─────────────────────registerSyncStoreSetters({ setSyncResults, mergeSyncResults, setSyncError });diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex cc84dce6ea..9c0d402819 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -11240,7 +11240,7 @@"sharedImpact": "Other Agents sharing this skill will also be affected. Published versions and installations elsewhere are unaffected.","managedElsewhere": "This Skill belongs to another package or shared directory. Remove it at its source.","managedByPlugin": "This skill is provided by a plugin. Manage it on that plugin’s page.",- "cleanupIncomplete": "The skill was removed, but some local records or links could not be cleaned up.",+ "cleanupIncomplete": "The skill was removed, but some records or links remain. Retry before closing or reloading this window.","retryCleanup": "Retry cleanup","cleanupComplete": "Cleanup completed"}diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 6541c6b8fc..418be1a420 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -11224,7 +11224,7 @@"sharedImpact": "このスキルを共有する他の Agent にも影響します。公開済みバージョンや別の場所のインストールには影響しません。","managedElsewhere": "このスキルは別のパッケージまたは共有ディレクトリで管理されています。提供元で削除してください","managedByPlugin": "このスキルはプラグインが提供しています。提供元のプラグインページで管理してください。",- "cleanupIncomplete": "スキルは削除されましたが、一部のローカル記録またはリンクを整理できませんでした。",+ "cleanupIncomplete": "スキルは削除されましたが、一部の記録やリンクが残っています。ウィンドウを閉じるか再読み込みする前に再試行してください。","retryCleanup": "整理を再試行","cleanupComplete": "整理が完了しました"}diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 92192fcaa8..a0d2e87412 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -11224,7 +11224,7 @@"sharedImpact": "이 스킬을 공유하는 다른 Agent도 영향을 받습니다. 게시된 버전과 다른 위치에 설치된 스킬에는 영향을 주지 않습니다.","managedElsewhere": "이 스킬은 다른 패키지 또는 공유 디렉터리에서 관리됩니다. 원본 위치에서 제거하세요","managedByPlugin": "이 스킬은 플러그인이 제공합니다. 해당 플러그인 페이지에서 관리하세요.",- "cleanupIncomplete": "스킬은 제거되었지만 일부 로컬 기록이나 링크를 정리하지 못했습니다.",+ "cleanupIncomplete": "스킬은 제거되었지만 일부 기록이나 링크가 남아 있습니다. 창을 닫거나 새로고침하기 전에 다시 시도하세요.","retryCleanup": "정리 다시 시도","cleanupComplete": "정리 완료"}diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex bd712e8d46..3436340990 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -11224,7 +11224,7 @@"sharedImpact": "共用此技能的其他 Agent 也会受影响。云端发布和其他安装位置不受影响。","managedElsewhere": "此技能由其他包或共享目录管理,需在其来源处移除","managedByPlugin": "此技能由插件提供,请到所属插件页面管理。",- "cleanupIncomplete": "技能已移除,但部分本地记录或链接未清理完成。",+ "cleanupIncomplete": "技能已移除,但部分记录或链接未清理完成。请在关闭或刷新窗口前重试。","retryCleanup": "重试清理","cleanupComplete": "清理完成"}diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex 17578288f2..0a49a4462e 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -11224,7 +11224,7 @@"sharedImpact": "共用此技能的其他 Agent 也會受影響。雲端發布和其他安裝位置不受影響。","managedElsewhere": "此技能由其他套件或共用目錄管理,需在其來源處移除","managedByPlugin": "此技能由插件提供,請到所屬插件頁面管理。",- "cleanupIncomplete": "技能已移除,但部分本機記錄或連結尚未清理完成。",+ "cleanupIncomplete": "技能已移除,但部分記錄或連結未清理完成。請在關閉或重新整理視窗前重試。","retryCleanup": "重試清理","cleanupComplete": "清理完成"}diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.mdindex 107ed1ff58..e130183cc8 100644--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@ -9,7 +9,7 @@本区块由 `scripts/design-inventory.mjs` 生成,请勿手改。重新生成:`pnpm design:inventory`;校验:`pnpm check:design-inventory`。-计数快照日期:2026-09-07。生成命令:`pnpm design:inventory`。裸颜色匹配与 `scripts/hardcoded-color-audit.mjs` 共用 `scripts/shared/hardcoded-color-match.mjs`(HEX / rgb() / rgba() / hsl() / hsla()),台账统计层额外剔除 `var()` 包装与注释(TS/TSX 剥块注释与整行注释)——语义 token 消费与注释引用不是迁移债务;裸圆角为粗粒度(`rounded*` class、`border-radius:` 与 React style 对象的 `borderRadius:`)。Token 计数为样式源里 `var(--token)` / `hsl(var(--token)` 的去重 ID 数。+计数快照日期:2026-09-08。生成命令:`pnpm design:inventory`。裸颜色匹配与 `scripts/hardcoded-color-audit.mjs` 共用 `scripts/shared/hardcoded-color-match.mjs`(HEX / rgb() / rgba() / hsl() / hsla()),台账统计层额外剔除 `var()` 包装与注释(TS/TSX 剥块注释与整行注释)——语义 token 消费与注释引用不是迁移债务;裸圆角为粗粒度(`rounded*` class、`border-radius:` 与 React style 对象的 `borderRadius:`)。Token 计数为样式源里 `var(--token)` / `hsl(var(--token)` 的去重 ID 数。登记 surface 数:35。平台本轮仅 Desktop。@@ -40,8 +40,8 @@| `desktop.plugins.installed` | desktop | 已装插件 | hash `/plugins`(GhostPluginPage) | AddMarketplaceDialog, GhostPluginDetailView, GhostPluginPage, MarketPluginDetailView, MyPublishesSection, PluginManagementLayout, PluginScopePicker, UpdateAllDialog | apps/desktop/src/renderer/features/plugin/AddMarketplaceDialog.tsx, apps/desktop/src/renderer/features/plugin/GhostPluginDetailView.tsx, apps/desktop/src/renderer/features/plugin/GhostPluginPage.tsx, apps/desktop/src/renderer/features/plugin/MarketPluginDetailView.tsx, apps/desktop/src/renderer/features/plugin/MyPublishesSection.tsx, apps/desktop/src/renderer/features/plugin/PluginManagementLayout.tsx, apps/desktop/src/renderer/features/plugin/PluginScopePicker.tsx, apps/desktop/src/renderer/features/plugin/UpdateAllDialog.tsx, apps/desktop/src/renderer/features/plugin/plugin-motion.css | 49 | 0 | 82 || `desktop.settings` | desktop | 设置 | hash `/settings`(SettingsView;tab 含 general / personalization / providers / billing / usage / voice-input / im-bot / shortcuts / agent-island / import / remote-control / ghosts / builtin-tools / computer-use / help / about) | SettingsView | apps/desktop/src/renderer/components/settings/AboutSection.tsx, apps/desktop/src/renderer/components/settings/AccountDeletionSection.tsx, apps/desktop/src/renderer/components/settings/AddProviderWizard.tsx, apps/desktop/src/renderer/components/settings/AgentIslandSection.tsx, apps/desktop/src/renderer/components/settings/AgentResourceSection.tsx, apps/desktop/src/renderer/components/settings/AppearanceSection.tsx, apps/desktop/src/renderer/components/settings/AuxiliaryModelSection.tsx, apps/desktop/src/renderer/components/settings/BetaChannelCell.tsx, apps/desktop/src/renderer/components/settings/BrowserBackendSubsection.tsx, apps/desktop/src/renderer/components/settings/BrowserRealProfileSubsection.tsx, apps/desktop/src/renderer/components/settings/BuiltinToolsSection.tsx, apps/desktop/src/renderer/components/settings/ChatEmbeddingCell.tsx, apps/desktop/src/renderer/components/settings/ChipMetricsSection.tsx, apps/desktop/src/renderer/components/settings/CollaborationSection.tsx, apps/desktop/src/renderer/components/settings/CompactionSection.tsx, apps/desktop/src/renderer/components/settings/ComposerSendShortcutSection.tsx, apps/desktop/src/renderer/components/settings/ComputerPermissionGuideWindow.tsx, apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx, apps/desktop/src/renderer/components/settings/CustomProviderDialog.tsx, apps/desktop/src/renderer/components/settings/CustomProviderRuntimeFillOverlay.tsx, apps/desktop/src/renderer/components/settings/DefaultOverrideControls.tsx, apps/desktop/src/renderer/components/settings/DingTalkBotSection.tsx, apps/desktop/src/renderer/components/settings/DiscordBotSection.tsx, apps/desktop/src/renderer/components/settings/DownloadMeter.tsx, apps/desktop/src/renderer/components/settings/ExperimentalSection.tsx, apps/desktop/src/renderer/components/settings/FeishuBotNotificationSection.tsx, apps/desktop/src/renderer/components/settings/FeishuBotSection.tsx, apps/desktop/src/renderer/components/settings/FontFamilyPicker.tsx, apps/desktop/src/renderer/components/settings/GenericGamepadLayout.tsx, apps/desktop/src/renderer/components/settings/GitSafetySection.tsx, apps/desktop/src/renderer/components/settings/HelpAssistantPanel.tsx, apps/desktop/src/renderer/components/settings/HelpSection.tsx, apps/desktop/src/renderer/components/settings/HelpThreadView.tsx, apps/desktop/src/renderer/components/settings/HookConnectionsSection.tsx, apps/desktop/src/renderer/components/settings/HookWorkspacePrefsEditor.tsx, apps/desktop/src/renderer/components/settings/ImBotSection.tsx, apps/desktop/src/renderer/components/settings/ImChannelSettingsCard.tsx, apps/desktop/src/renderer/components/settings/ImDefaultSettingsSection.tsx, apps/desktop/src/renderer/components/settings/ImLifecycleAnnouncementSection.tsx, apps/desktop/src/renderer/components/settings/InputDeviceConnectionStatus.tsx, apps/desktop/src/renderer/components/settings/JoyConGamepadLayout.tsx, apps/desktop/src/renderer/components/settings/KeyboardShortcutsSection.tsx, apps/desktop/src/renderer/components/settings/LanguageSection.tsx, apps/desktop/src/renderer/components/settings/LayoutResetControl.tsx, apps/desktop/src/renderer/components/settings/LinkOpenSection.tsx, apps/desktop/src/renderer/components/settings/LocalOllamaInstall.tsx, apps/desktop/src/renderer/components/settings/LocalPackagingTag.tsx, apps/desktop/src/renderer/components/settings/LogoutSection.tsx, apps/desktop/src/renderer/components/settings/LspBetaCell.tsx, apps/desktop/src/renderer/components/settings/McpServerDialog.tsx, apps/desktop/src/renderer/components/settings/McpServersSection.tsx, apps/desktop/src/renderer/components/settings/MemorySection.tsx, apps/desktop/src/renderer/components/settings/MessageNavRailCell.tsx, apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx, apps/desktop/src/renderer/components/settings/ModelPriceOverrideDialog.tsx, apps/desktop/src/renderer/components/settings/MyDevicesPanel.tsx, apps/desktop/src/renderer/components/settings/NotificationSection.tsx, apps/desktop/src/renderer/components/settings/OAuthDeviceCodeCard.tsx, apps/desktop/src/renderer/components/settings/OllamaProviderDetail.tsx, apps/desktop/src/renderer/components/settings/PiPackagesSection.tsx, apps/desktop/src/renderer/components/settings/PlayStationGamepadLayout.tsx, apps/desktop/src/renderer/components/settings/ProfileEditDialog.tsx, apps/desktop/src/renderer/components/settings/ProvidersSection.tsx, apps/desktop/src/renderer/components/settings/RemoteControlSection.tsx, apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx, apps/desktop/src/renderer/components/settings/RemoteSection.tsx, apps/desktop/src/renderer/components/settings/SessionImportSection.tsx, apps/desktop/src/renderer/components/settings/SessionRuntimeFallbackCell.tsx, apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx, apps/desktop/src/renderer/components/settings/SettingsCatalogPanel.tsx, apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx, apps/desktop/src/renderer/components/settings/SettingsTextInput.tsx, apps/desktop/src/renderer/components/settings/SettingsView.tsx, apps/desktop/src/renderer/components/settings/SilentEncryptedRetryCell.tsx, apps/desktop/src/renderer/components/settings/SshKeySetupDialog.tsx, apps/desktop/src/renderer/components/settings/StorageManagementCard.tsx, apps/desktop/src/renderer/components/settings/StreamFadeSection.tsx, apps/desktop/src/renderer/components/settings/SubagentModelSection.tsx, apps/desktop/src/renderer/components/settings/SwitchProGamepadLayout.tsx, apps/desktop/src/renderer/components/settings/TelegramBehaviorSettings.tsx, apps/desktop/src/renderer/components/settings/TelegramBotSection.tsx, apps/desktop/src/renderer/components/settings/TelegramRemoteDevices.tsx, apps/desktop/src/renderer/components/settings/TerminalShellSection.tsx, apps/desktop/src/renderer/components/settings/TipsSection.tsx, apps/desktop/src/renderer/components/settings/UnifiedModelList.tsx, apps/desktop/src/renderer/components/settings/UserProfileCard.tsx, apps/desktop/src/renderer/components/settings/UserPromptSection.tsx, apps/desktop/src/renderer/components/settings/VisionBridgeSection.tsx, apps/desktop/src/renderer/components/settings/VoiceInputSection.tsx, apps/desktop/src/renderer/components/settings/WechatBotSection.tsx, apps/desktop/src/renderer/components/settings/WecomBotSection.tsx, apps/desktop/src/renderer/components/settings/WindowBehaviorSection.tsx, apps/desktop/src/renderer/components/settings/WorkLouderCodexKeyboardLayout.tsx, apps/desktop/src/renderer/components/settings/WorkLouderCodexKeycapGlyphs.tsx, apps/desktop/src/renderer/components/settings/WorkLouderCodexSettings.tsx, apps/desktop/src/renderer/components/settings/XUsageGuide.tsx, apps/desktop/src/renderer/components/settings/XboxGamepadLayout.tsx, apps/desktop/src/renderer/components/settings/XboxGamepadSettings.tsx, apps/desktop/src/renderer/components/settings/androidStatusPresentation.ts, apps/desktop/src/renderer/components/settings/billingVisibility.ts, apps/desktop/src/renderer/components/settings/browserOpenForLoginError.ts, apps/desktop/src/renderer/components/settings/computerPermissionFlow.ts, apps/desktop/src/renderer/components/settings/contacts/ContactDetailPane.tsx, apps/desktop/src/renderer/components/settings/contacts/ContactsImportDialog.tsx, apps/desktop/src/renderer/components/settings/contacts/ContactsListPane.tsx, apps/desktop/src/renderer/components/settings/contacts/ContactsManagerDialog.tsx, apps/desktop/src/renderer/components/settings/contacts/ContactsSection.tsx, apps/desktop/src/renderer/components/settings/contacts/startContactsAiSession.ts, apps/desktop/src/renderer/components/settings/dualSenseSilhouette.ts, apps/desktop/src/renderer/components/settings/feishuBotPresentation.ts, apps/desktop/src/renderer/components/settings/fontFamilyValue.ts, apps/desktop/src/renderer/components/settings/gamepadLayoutPrimitives.tsx, apps/desktop/src/renderer/components/settings/gamepadSilhouetteGeom.ts, apps/desktop/src/renderer/components/settings/hookWorkspacePrefsLogic.ts, apps/desktop/src/renderer/components/settings/imBotVisibility.ts, apps/desktop/src/renderer/components/settings/imDefaultSettingsLogic.ts, apps/desktop/src/renderer/components/settings/joyConSilhouette.ts, apps/desktop/src/renderer/components/settings/modelManagementPresentation.ts, apps/desktop/src/renderer/components/settings/modelManagementState.ts, apps/desktop/src/renderer/components/settings/myDevicesModel.ts, apps/desktop/src/renderer/components/settings/providerAssetModule.ts, apps/desktop/src/renderer/components/settings/realProfilePermissionGuide.ts, apps/desktop/src/renderer/components/settings/switchProSilhouette.ts, apps/desktop/src/renderer/components/settings/ultimateC1Silhouette.ts, apps/desktop/src/renderer/components/settings/usage/UsageBreakdownTables.tsx, apps/desktop/src/renderer/components/settings/usage/UsageHistorySection.tsx, apps/desktop/src/renderer/components/settings/usage/UsageStatRow.tsx, apps/desktop/src/renderer/components/settings/usage/UsageTaskTable.tsx, apps/desktop/src/renderer/components/settings/usage/UsageTokenBars.tsx, apps/desktop/src/renderer/components/settings/usage/formatUsagePercent.ts, apps/desktop/src/renderer/components/settings/usage/usageHistoryStats.ts, apps/desktop/src/renderer/components/settings/usageVisibility.ts, apps/desktop/src/renderer/components/settings/wizardRecommend.ts, apps/desktop/src/renderer/components/settings/workLouderCodexCommandCopy.ts, apps/desktop/src/renderer/components/settings/xboxSeriesSilhouette.ts, apps/desktop/src/renderer/styles/sortable.css | 142 | 121 | 744 || `desktop.shell.main-layout` | desktop | 主窗口壳(标题栏 / 左右栏 / 内容区) | main BrowserWindow → renderer/index.tsx → main-entry.tsx → App → MainLayout (`#/` 受保护壳) | ChromeActions, FeishuConflictDialogHost, GhostMediaLightboxHost, MainLayout, RightSidebar, RightSidebarShell, SessionShareImportWizard, Sidebar, UpdateNoticeDialog, WindowControls | apps/desktop/src/renderer/cindy-brain/GhostMediaLightboxHost.tsx, apps/desktop/src/renderer/components/UpdateNoticeDialog.tsx, apps/desktop/src/renderer/components/feishuBot/FeishuConflictDialog.tsx, apps/desktop/src/renderer/components/feishuBot/FeishuConflictDialogHost.tsx, apps/desktop/src/renderer/components/layout/BrowserWebviewPool.tsx, apps/desktop/src/renderer/components/layout/ChromeActions.tsx, apps/desktop/src/renderer/components/layout/ContentHeader.tsx, apps/desktop/src/renderer/components/layout/CredentialStoreBanner.tsx, apps/desktop/src/renderer/components/layout/FadeSwitcher.tsx, apps/desktop/src/renderer/components/layout/GhostPanelWindowLayout.tsx, apps/desktop/src/renderer/components/layout/GlobalDropImportListener.tsx, apps/desktop/src/renderer/components/layout/MainLayout.tsx, apps/desktop/src/renderer/components/layout/RightSidebar.tsx, apps/desktop/src/renderer/components/layout/RightSidebarDetach.tsx, apps/desktop/src/renderer/components/layout/RightSidebarMaximize.tsx, apps/desktop/src/renderer/components/layout/RightSidebarToggle.tsx, apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx, apps/desktop/src/renderer/components/layout/chromeActionsGeometry.ts, apps/desktop/src/renderer/components/layout/chromeActionsLayout.ts, apps/desktop/src/renderer/components/layout/railChromeActions.ts, apps/desktop/src/renderer/components/layout/windowDrag.tsx, apps/desktop/src/renderer/components/settings/SessionShareImportWizard.tsx, apps/desktop/src/renderer/components/sidebar/AccountSwitcherDialog.tsx, apps/desktop/src/renderer/components/sidebar/AttentionDot.tsx, apps/desktop/src/renderer/components/sidebar/GhostMainViewNavEntries.tsx, apps/desktop/src/renderer/components/sidebar/MobileDownloadDialog.tsx, apps/desktop/src/renderer/components/sidebar/Sidebar.tsx, apps/desktop/src/renderer/components/sidebar/SidebarIconButton.tsx, apps/desktop/src/renderer/components/sidebar/SidebarTopNav.tsx, apps/desktop/src/renderer/components/sidebar/SortableList.tsx, apps/desktop/src/renderer/components/sidebar/UpdateBanner.tsx, apps/desktop/src/renderer/components/sidebar/UserInfoSection.tsx, apps/desktop/src/renderer/components/sidebar/VendorIcon.tsx, apps/desktop/src/renderer/components/sidebar/VendorReadinessBadge.tsx, apps/desktop/src/renderer/components/sidebar/WorktreeBadge.tsx, apps/desktop/src/renderer/components/title-bar/ChromeIconButton.tsx, apps/desktop/src/renderer/components/title-bar/MenuButton.tsx, apps/desktop/src/renderer/components/title-bar/WindowControls.tsx, apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsx, apps/desktop/src/renderer/features/right-sidebar/EmptyState.tsx, apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsx, apps/desktop/src/renderer/features/right-sidebar/TabBar.tsx, apps/desktop/src/renderer/features/right-sidebar/TabBodyErrorBoundary.tsx, apps/desktop/src/renderer/features/right-sidebar/hooks/useBrowserWebview.ts, apps/desktop/src/renderer/features/right-sidebar/hooks/useNativePopupSurface.ts, apps/desktop/src/renderer/features/right-sidebar/iosSimulatorPluginAvailability.ts, apps/desktop/src/renderer/features/right-sidebar/lib/browserPartition.ts, apps/desktop/src/renderer/features/right-sidebar/lib/browserWebviewPool.ts, apps/desktop/src/renderer/features/right-sidebar/lib/detachedSidebarRouting.ts, apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts, apps/desktop/src/renderer/features/right-sidebar/lib/iosSimulatorFocusBridge.ts, apps/desktop/src/renderer/features/right-sidebar/lib/lastTurnChangedFiles.ts, apps/desktop/src/renderer/features/right-sidebar/lib/nativePopupTabs.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openBackgroundTasksTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openInSidebarBrowser.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openInSidebarFileBrowser.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openSubagentsTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openTerminalShortcut.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openTurnReview.ts, apps/desktop/src/renderer/features/right-sidebar/lib/popupRouter.ts, apps/desktop/src/renderer/features/right-sidebar/lib/popupTabs.ts, apps/desktop/src/renderer/features/right-sidebar/lib/rsbBrowserBridge.ts, apps/desktop/src/renderer/features/right-sidebar/lib/sidebarCommands.ts, apps/desktop/src/renderer/features/right-sidebar/lib/sidebarHostSession.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/BackgroundTasksBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/WorkflowAgentStrip.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/WorkflowProgressTree.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/chatTaskFocusIntent.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/listSessionTasks.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/workflowProgressModel.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/FileBrowserBody.css, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/FileBrowserBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/dropExternalFile.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/fileTreeImagePreview.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/useSessionScopedTreeWidth.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/index.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorInstanceGrid.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/iosSimulatorH264Decoder.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/OrcaWorkersAttentionIcon.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/OrcaWorkersTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/actions.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/closeDecision.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/ResourceUsageBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/subscription.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/ImageDiffPreview.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/MarkdownDiffPreview.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/PlainUnifiedDiff.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/diffRows.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/highlight.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/inlineDiff.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/useDiffHighlights.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/diffExpansionPreference.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/fileTree.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/gitApplyCommand.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/markdownPreview.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useLastTurnFilter.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useReviewGitState.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useReviewSource.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/ConversationStream.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/DetailView.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/RunList.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentChrome.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentToolCard.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentsBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentChangeFence.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentConversation.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentFormat.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/TerminalTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/lib/xtermPool.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserChrome.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserCommentPopover.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/browserCommentEditorDraft.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/lib/parseOmnibox.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/useBrowserComment.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/useLocalHtmlAutoReload.ts, apps/desktop/src/renderer/features/right-sidebar/registry.ts, apps/desktop/src/renderer/features/right-sidebar/store.ts, apps/desktop/src/renderer/features/right-sidebar/types.ts, apps/desktop/src/renderer/layout/LayoutRoot.tsx, apps/desktop/src/renderer/layout/PanelDragController.tsx, apps/desktop/src/renderer/layout/PanelDragPrototype.tsx, apps/desktop/src/renderer/layout/collapsePrefs.ts, apps/desktop/src/renderer/layout/layoutDevTools.ts, apps/desktop/src/renderer/layout/panePlacement.tsx, apps/desktop/src/renderer/layout/paneWidths.tsx, apps/desktop/src/renderer/layout/panelMaximize.tsx, apps/desktop/src/renderer/styles/globals.css | 145 | 72 | 288 |-| `desktop.skillhub.local` | desktop | SkillHub 本地技能 | hash `/skillhub/local` 及详情 `/skillhub/local/:kind/global/:name`、`/skillhub/local/:kind/project/:projectHash/:name` | InstallTargetPicker, PluginManagementLayout, SkillhubDetailView, SkillhubFeatureLayout, SkillhubHomeView, SkillhubMarketPreviewPanel | apps/desktop/src/renderer/features/plugin/PluginManagementLayout.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubDetailView.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubFeatureLayout.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubHomeView.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubMarketPreviewPanel.tsx, apps/desktop/src/renderer/features/skillhub/components/InstallTargetPicker.tsx | 41 | 0 | 71 |-| `desktop.skillhub.market` | desktop | SkillHub 市场 | hash `/skillhub/market`(SkillhubMarketListView) | InstallTargetPicker, MarketCard, MarketInfoEditDialog, SkillhubMarketListView, SkillhubMarketPreviewPanel, VisibilityEditorDialog | apps/desktop/src/renderer/features/skillhub/SkillhubMarketListView.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubMarketPreviewPanel.tsx, apps/desktop/src/renderer/features/skillhub/components/InstallTargetPicker.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketCard.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketInfoEditDialog.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketPreviewTree.tsx, apps/desktop/src/renderer/features/skillhub/components/PlatformTagSelector.tsx, apps/desktop/src/renderer/features/skillhub/components/SkillCategoryFilterBar.tsx, apps/desktop/src/renderer/features/skillhub/components/SkillIcon.tsx, apps/desktop/src/renderer/features/skillhub/components/SkillTagList.tsx, apps/desktop/src/renderer/features/skillhub/components/TeamScopePicker.tsx, apps/desktop/src/renderer/features/skillhub/components/VisibilityEditorDialog.tsx | 46 | 0 | 59 |+| `desktop.skillhub.local` | desktop | SkillHub 本地技能 | hash `/skillhub/local` 及详情 `/skillhub/local/:kind/global/:name`、`/skillhub/local/:kind/project/:projectHash/:name` | InstallTargetPicker, PluginManagementLayout, SkillhubDetailView, SkillhubFeatureLayout, SkillhubHomeView, SkillhubMarketPreviewPanel | apps/desktop/src/renderer/features/plugin/PluginManagementLayout.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubDetailView.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubFeatureLayout.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubHomeView.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubMarketPreviewPanel.tsx, apps/desktop/src/renderer/features/skillhub/components/InstallTargetPicker.tsx | 41 | 0 | 66 |+| `desktop.skillhub.market` | desktop | SkillHub 市场 | hash `/skillhub/market`(SkillhubMarketListView) | InstallTargetPicker, MarketCard, MarketInfoEditDialog, SkillhubMarketListView, SkillhubMarketPreviewPanel, VisibilityEditorDialog | apps/desktop/src/renderer/features/skillhub/SkillhubMarketListView.tsx, apps/desktop/src/renderer/features/skillhub/SkillhubMarketPreviewPanel.tsx, apps/desktop/src/renderer/features/skillhub/components/HomeMarketCard.tsx, apps/desktop/src/renderer/features/skillhub/components/InstallTargetPicker.tsx, apps/desktop/src/renderer/features/skillhub/components/LocalSkillControls.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketCard.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketInfoEditDialog.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketLocalSkills.tsx, apps/desktop/src/renderer/features/skillhub/components/MarketPreviewTree.tsx, apps/desktop/src/renderer/features/skillhub/components/PlatformTagSelector.tsx, apps/desktop/src/renderer/features/skillhub/components/SkillCategoryFilterBar.tsx, apps/desktop/src/renderer/features/skillhub/components/SkillIcon.tsx, apps/desktop/src/renderer/features/skillhub/components/SkillTagList.tsx, apps/desktop/src/renderer/features/skillhub/components/TeamScopePicker.tsx, apps/desktop/src/renderer/features/skillhub/components/VisibilityEditorDialog.tsx | 47 | 0 | 63 || `desktop.window.computer-permission-guide` | desktop | 电脑使用权限引导 | `?view=computer-permission-guide` → ComputerPermissionGuideWindow;backdrop 同文件 | ComputerPermissionBackdrop, ComputerPermissionGuideWindow | apps/desktop/src/main/computer-permission-guide/MacComputerPermissionGuideNativeHost.ts, apps/desktop/src/main/computer-permission-guide/placement.ts, apps/desktop/src/main/computer-permission-guide/request.ts, apps/desktop/src/main/computer-permission-guide/switch-target.ts, apps/desktop/src/main/computer-permission-guide/window.ts, apps/desktop/src/renderer/components/settings/ComputerPermissionGuideWindow.tsx | 7 | 2 | 9 || `desktop.window.ghost-panel` | desktop | 插件面板独立窗口 | `?ghostPanelWindow=<id>` → renderer/ghost-panel-window-entry.tsx;hash `/ghost-panel-window` | GhostPanelWindowLayout | apps/desktop/src/main/ghost-panel-window/controller.ts, apps/desktop/src/main/ghost-panel-window/ipc.ts, apps/desktop/src/main/ghost-panel-window/registry.ts, apps/desktop/src/main/ghost-panel-window/settings-store.ts, apps/desktop/src/main/ghost-panel-window/window.ts, apps/desktop/src/renderer/components/layout/GhostPanelWindowLayout.tsx, apps/desktop/src/renderer/ghost-panel-window-entry.tsx, apps/desktop/src/renderer/styles/globals.css | 59 | 64 | 14 || `desktop.window.resource-usage` | desktop | 资源用量窗口 | `?resourceUsageWindow=1` → renderer/resource-usage-entry.tsx(不走 router.tsx) | ResourceUsageWindowLayout, ResourceUsageWindowRoot | apps/desktop/src/main/resource-usage-window/controller.ts, apps/desktop/src/main/resource-usage-window/ipc.ts, apps/desktop/src/main/resource-usage-window/open-sender.ts, apps/desktop/src/main/resource-usage-window/registry.ts, apps/desktop/src/main/resource-usage-window/window.ts, apps/desktop/src/renderer/components/resource-usage/ResourceUsageWindowLayout.tsx, apps/desktop/src/renderer/resource-usage-entry.tsx, apps/desktop/src/renderer/styles/globals.css | 59 | 64 | 14 |@@ -82,6 +82,7 @@| `/skillhub/local` | SkillhubHomeView | `desktop.skillhub.local` || `/skillhub/local/:kind/global/:name` | SkillhubDetailView | `desktop.skillhub.local` || `/skillhub/local/:kind/project/:projectHash/:name` | SkillhubDetailView | `desktop.skillhub.local` |+| `/skillhub/local/by-path` | SkillhubDetailView | `desktop.skillhub.local` || `/skillhub/market` | SkillhubMarketListView | `desktop.skillhub.market` |### 排除的 redirectdiff --git a/packages/maker-core/src/agents/base-agent.ts b/packages/maker-core/src/agents/base-agent.tsindex ad7d7d4c09..b2668bd8e1 100644--- a/packages/maker-core/src/agents/base-agent.ts+++ b/packages/maker-core/src/agents/base-agent.ts@@ -1947,6 +1947,8 @@ export interface CodexContextWindowInfo {* 上层 Session 类持有此句柄并对外暴露 UI 友好的 API。*/export interface AgentSessionHandle {+ /** Cindy Skill preference snapshot used to configure this native runtime. */+ readonly disabledSkillPaths?: readonly string[];getCodexContextWindowInfo?(): Promise<CodexContextWindowInfo | null>;/** SDK 内部 sessionId,session.started 后会回填 */readonly id: string;@@ -2322,8 +2324,8 @@ export abstract class BaseAgent {}/** Filter only the palette projection; management discovery retains disabled sources. */- filterActiveSkillCommands(result: ListAgentSkillsResult, remoteHostId?: string): ListAgentSkillsResult {- const disabled = remoteHostId ? [] : this.deps.getDisabledSkillPaths?.() ?? [];+ filterActiveSkillCommands(result: ListAgentSkillsResult, remoteHostId?: string, snapshot?: readonly string[]): ListAgentSkillsResult {+ const disabled = remoteHostId ? [] : snapshot ?? this.deps.getDisabledSkillPaths?.() ?? [];if (disabled.length === 0) return result;return { ...result, skills: result.skills.filter((skill) => !skill.path || !isSkillDisabled(skill.path, disabled)) };}diff --git a/packages/maker-core/src/agents/claude-code/index.ts b/packages/maker-core/src/agents/claude-code/index.tsindex 375a59f895..c94e7636ab 100644--- a/packages/maker-core/src/agents/claude-code/index.ts+++ b/packages/maker-core/src/agents/claude-code/index.ts@@ -5594,6 +5594,7 @@ export class ClaudeCodeAgent extends BaseAgent {});};const handle: AgentSessionHandle = {+ disabledSkillPaths: Object.freeze([...disabledSkillPaths]),reviewAutoPermissionAction: async (action) => {const decision = await reviewAutoAction(action,diff --git a/packages/maker-core/src/agents/codex/index.ts b/packages/maker-core/src/agents/codex/index.tsindex c177eaa634..71d2b1aecd 100644--- a/packages/maker-core/src/agents/codex/index.ts+++ b/packages/maker-core/src/agents/codex/index.ts@@ -4823,7 +4823,7 @@ export class CodexAgent extends BaseAgent {),);const disabledSkillPaths = opts.remoteHostId || opts.botRuntimeProfile || reviewMode- ? [] : this.deps.getDisabledSkillPaths?.() ?? [];+ ? [] : [...(this.deps.getDisabledSkillPaths?.() ?? [])];if (disabledSkillPaths.length > 0) {try {const response = await host.request<{ config?: Record<string, unknown> }>(@@ -11940,6 +11940,7 @@ export class CodexAgent extends BaseAgent {}// ── AgentSessionHandle ──────────────────────────────────────────────────const handle: AgentSessionHandle = {+ disabledSkillPaths: Object.freeze([...disabledSkillPaths]),reviewAutoPermissionAction: async (action) => {const decision = await reviewAutoAction(action);if (decision.unavailable) autoReviewUnavailableNotice.notify();diff --git a/packages/maker-core/src/agents/pi/index.ts b/packages/maker-core/src/agents/pi/index.tsindex ebac1a9722..060aeac693 100644--- a/packages/maker-core/src/agents/pi/index.ts+++ b/packages/maker-core/src/agents/pi/index.ts@@ -5812,6 +5812,7 @@ export class PiAgent extends BaseAgent {getRuntimeCapabilities() {return runtimeCapabilityManifest;},+ disabledSkillPaths: Object.freeze([...disabledSkillPaths]),onRuntimeCapabilitiesChange(listener) {if (closed) {notifyRuntimeCapabilityListener(listener, undefined);diff --git a/packages/maker-core/src/maker.test.ts b/packages/maker-core/src/maker.test.tsindex bf1d0d73af..52f9a658ba 100644--- a/packages/maker-core/src/maker.test.ts+++ b/packages/maker-core/src/maker.test.ts@@ -16,7 +16,7 @@ import { createAsyncQueue } from './agents/shared/async-queue.js';import {TurnPermissionPolicyUnsupportedError,type AgentSessionHandle,- type BaseAgent,+ BaseAgent,} from './agents/base-agent.js';import type { SessionMeta, SessionStorage } from './interfaces/session-storage.js';import type { AgentKind, PermissionMode } from './types/common.js';@@ -132,6 +132,31 @@ function createAgent(}describe('Maker Pi managed-package skill boundary', () => {+ it.each(['claude-code', 'codex', 'pi'] as const)('keeps %s live palettes on their startup Skill snapshot', async (agentKind) => {+ const source = '/fixture/disabled-skill';+ let disabled: string[] = [source];+ const agent = createAgent(async (opts) => ({+ ...createHandle({ id: opts.sessionId ?? 'fixture', agentKind }),+ disabledSkillPaths: Object.freeze([...disabled]),+ }), agentKind);+ agent.listAgentSkills = vi.fn(async () => ({ skills: [{+ kind: 'agent-skill' as const, name: 'demo', source: 'skill' as const, path: source,+ }] }));+ agent.filterActiveSkillCommands = (result, remoteHostId, snapshot) => BaseAgent.prototype.filterActiveSkillCommands.call(+ { deps: { getDisabledSkillPaths: () => disabled } } as unknown as BaseAgent, result, remoteHostId, snapshot,+ );+ const maker = new Maker({ agents: { [agentKind]: agent }, storage: createStorage(), logger: createLogger() });+ await maker.createSession({ id: 'disabled-start', agentKind, workingDir: '/repo', model: 'm' });+ disabled = [];+ expect((await maker.listAgentSkills(agentKind, { workingDir: '/repo' })).skills).toHaveLength(1);+ expect((await maker.listAgentSkills(agentKind, { workingDir: '/repo', sessionId: 'disabled-start' })).skills).toEqual([]);+ await maker.createSession({ id: 'enabled-start', agentKind, workingDir: '/repo', model: 'm' });+ disabled = [source];+ expect((await maker.listAgentSkills(agentKind, { workingDir: '/repo' })).skills).toEqual([]);+ expect((await maker.listAgentSkills(agentKind, { workingDir: '/repo', sessionId: 'enabled-start' })).skills).toHaveLength(1);+ await maker.shutdown();+ });+it('allows package skills only for previews and ordinary local Pi tasks', async () => {const storage = createStorage();const base = {diff --git a/packages/maker-core/src/maker.ts b/packages/maker-core/src/maker.tsindex 80c0996a1c..2ad6867ab4 100644--- a/packages/maker-core/src/maker.ts+++ b/packages/maker-core/src/maker.ts@@ -1294,15 +1294,16 @@ export class Maker {&& !sessionMeta.remoteHostId));const agent = this.requireAgent(agentKind);+ const session = sessionId ? this.getSession(sessionId) : undefined;const filter = (result: ListAgentSkillsResult) => agent.filterActiveSkillCommands(result, agentOpts.remoteHostId ?? sessionMeta?.remoteHostId ?? undefined,+ session?.agentKind === agentKind ? session.getDisabledSkillPaths() : undefined,);const result = filter(await agent.listAgentSkills({...agentOpts,includeManagedPiPackages,}));if (agentKind !== 'pi' || !sessionId) return result;- const session = this.getSession(sessionId);if (session?.agentKind !== 'pi'|| !opts.workingDirdiff --git a/packages/maker-core/src/session.ts b/packages/maker-core/src/session.tsindex 71574bf240..1c0516ecac 100644--- a/packages/maker-core/src/session.ts+++ b/packages/maker-core/src/session.ts@@ -1399,6 +1399,10 @@ export class Session {return this.handle.getRuntimeCapabilities?.();}+ getDisabledSkillPaths(): readonly string[] | undefined {+ return this.handle.disabledSkillPaths;+ }+/** Subscribe to replacement of the current per-session Pi runtime catalog. */onRuntimeCapabilitiesChange(listener: (manifest: PiRuntimeCapabilityManifest | undefined) => void,diff --git a/scripts/__tests__/design-inventory.test.mjs b/scripts/__tests__/design-inventory.test.mjsindex 30023050b0..a28386da5e 100644--- a/scripts/__tests__/design-inventory.test.mjs+++ b/scripts/__tests__/design-inventory.test.mjs@@ -125,6 +125,7 @@ test('extractRouterFacts: 真实 router.tsx 的三类去向逐条钉死', () =>'/skillhub/local SkillhubHomeView','/skillhub/local/:kind/global/:name SkillhubDetailView','/skillhub/local/:kind/project/:projectHash/:name SkillhubDetailView',+ '/skillhub/local/by-path SkillhubDetailView','/skillhub/market SkillhubMarketListView',]);diff --git a/scripts/shared/design-inventory.mjs b/scripts/shared/design-inventory.mjsindex 31f30a7c0b..bb455f4d87 100644--- a/scripts/shared/design-inventory.mjs+++ b/scripts/shared/design-inventory.mjs@@ -617,8 +617,9 @@ export function catalogSurfaces() {'/skillhub/local','/skillhub/local/:kind/global/:name','/skillhub/local/:kind/project/:projectHash/:name',+ '/skillhub/local/by-path',],- routeEntryComponents: { '/skillhub/local': 'SkillhubHomeView', '/skillhub/local/:kind/global/:name': 'SkillhubDetailView', '/skillhub/local/:kind/project/:projectHash/:name': 'SkillhubDetailView' },+ routeEntryComponents: { '/skillhub/local': 'SkillhubHomeView', '/skillhub/local/:kind/global/:name': 'SkillhubDetailView', '/skillhub/local/:kind/project/:projectHash/:name': 'SkillhubDetailView', '/skillhub/local/by-path': 'SkillhubDetailView' },},{id: 'desktop.skillhub.market',