Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
修复移动端全局技能加载
DavidShen55fa04bf042e
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsxindex 9c1ce8b1c5..a61c6bc4ce 100644--- a/apps/mobile/app/sessions/[sessionId].tsx+++ b/apps/mobile/app/sessions/[sessionId].tsx@@ -470,7 +470,6 @@ import type {RemoteSession,} from '@/session/types';import type {- MobileAgentSkillListResult,MobileAtResourceItem,MobileDesktopCommandListResult,MobileModelPricingMap,@@ -2282,12 +2281,10 @@ export default function SessionScreen() {await openLink(deviceId);const [builtins, skills, desktop] = await Promise.all([maker.listAgentCommands(agentKind),- currentSession.workingDir- ? maker.listAgentSkills(agentKind, {- workingDir: currentSession.workingDir,- forceReload: false,- })- : Promise.resolve({ success: true, skills: [] } satisfies MobileAgentSkillListResult),+ maker.listAgentSkills(agentKind, {+ ...(currentSession.workingDir ? { workingDir: currentSession.workingDir } : {}),+ forceReload: false,+ }),// desktop 命令是 additive 展示(白名单分流不依赖此清单,清单只参与同名 skill// 让行仲裁,见 desktopSlashCommands):拉取失败(含老被控端无此通道)静默降级// 为不展示,不能拖垮 builtin/skill 两路。diff --git a/apps/mobile/app/sessions/new.tsx b/apps/mobile/app/sessions/new.tsxindex 19d0bd26b1..f77a41dc1b 100644--- a/apps/mobile/app/sessions/new.tsx+++ b/apps/mobile/app/sessions/new.tsx@@ -53,7 +53,6 @@ import { ScreenBackButton } from '@/components/MobilePrimitives';import { PaperPlaneIcon } from '@/components/PaperPlaneIcon';import { useDeviceLink } from '@/device-link/DeviceLinkContext';import type {- MobileAgentSkillListResult,MobileAtResourceItem,MobileSlashCommand,RemoteDirectoryEntry,@@ -1142,12 +1141,10 @@ export default function NewRemoteSessionScreen() {await openLink(selectedDeviceId);const [builtins, skills] = await Promise.all([maker.listAgentCommands(agentKind),- workingDir- ? maker.listAgentSkills(agentKind, {- workingDir,- forceReload: false,- })- : Promise.resolve({ success: true, skills: [] } satisfies MobileAgentSkillListResult),+ maker.listAgentSkills(agentKind, {+ ...(workingDir ? { workingDir } : {}),+ forceReload: false,+ }),]);return { builtins, skills };})diff --git a/apps/mobile/src/__tests__/mobileMakerTransport.test.ts b/apps/mobile/src/__tests__/mobileMakerTransport.test.tsindex b98287285a..122ab48e18 100644--- a/apps/mobile/src/__tests__/mobileMakerTransport.test.ts+++ b/apps/mobile/src/__tests__/mobileMakerTransport.test.ts@@ -271,6 +271,7 @@ describe('mobile maker transport', () => {await maker.setExtraDirs('s1', ['/repo/docs']);await maker.listAgentCommands('claude-code');await maker.listAgentSkills('claude-code', { workingDir: '/repo' });+ await maker.listAgentSkills('codex', {});await maker.scanAtResources('claude-code', { workingDir: '/repo', cap: 2000, query: 'session' });await maker.fetchRemoteMedia('xdt-image://local/a.png');await maker.transcribeVoice({ ossKey: 'voice-key', mimeType: 'audio/mp4', fileName: 'voice.m4a' });@@ -312,6 +313,7 @@ describe('mobile maker transport', () => {['maker:set-extra-dirs', ['s1', ['/repo/docs']]],['maker:list-agent-commands', ['claude-code']],['maker:list-agent-skills', ['claude-code', { workingDir: '/repo' }]],+ ['maker:list-agent-skills', ['codex', {}]],['maker:scan-at-resources', ['claude-code', { workingDir: '/repo', cap: 2000, query: 'session' }]],['device-link:media:fetch', [{ url: 'xdt-image://local/a.png' }]],['device-link:voice:transcribe', [{ ossKey: 'voice-key', mimeType: 'audio/mp4', fileName: 'voice.m4a' }]],diff --git a/apps/mobile/src/device-link/mobileMakerTransport.ts b/apps/mobile/src/device-link/mobileMakerTransport.tsindex a8c2238ef5..2df9064d26 100644--- a/apps/mobile/src/device-link/mobileMakerTransport.ts+++ b/apps/mobile/src/device-link/mobileMakerTransport.ts@@ -392,7 +392,7 @@ export interface MobileMakerTransport {* 被控端执行,这里只拿 runId;评审 UI 暂只有桌面端,移动端以系统卡提示去桌面评审。*/learnStart(req: MobileLearnStartRequest): Promise<{ runId: string }>;- listAgentSkills(agentKind: MobileAgentKind, opts: { workingDir: string; forceReload?: boolean }): Promise<MobileAgentSkillListResult>;+ listAgentSkills(agentKind: MobileAgentKind, opts: { workingDir?: string; forceReload?: boolean }): Promise<MobileAgentSkillListResult>;scanAtResources(agentKind: MobileAgentKind, opts: { workingDir: string; cap?: number; query?: string }): Promise<MobileAtResourceScanResult>;fetchRemoteMedia(url: string, opts?: { skipCache?: boolean; thumbnail?: boolean }): Promise<MobileRemoteMediaFetchResult>;transcribeVoice(input: MobileVoiceTranscribeRequest): Promise<MobileVoiceTranscribeResult>;